Commit d0a3788c authored by frtabu's avatar frtabu

re-apply fixes lost with last rebase

parent efe116ab
...@@ -527,7 +527,7 @@ int pnf_param_resp_cb(nfapi_vnf_config_t *config, int p5_idx, nfapi_pnf_param_re ...@@ -527,7 +527,7 @@ int pnf_param_resp_cb(nfapi_vnf_config_t *config, int p5_idx, nfapi_pnf_param_re
nfapi_vnf_pnf_config_req(config, p5_idx, &req); nfapi_vnf_pnf_config_req(config, p5_idx, &req);
} }
}
int pnf_start_resp_cb(nfapi_vnf_config_t* config, int p5_idx, nfapi_pnf_start_response_t* resp) int pnf_start_resp_cb(nfapi_vnf_config_t* config, int p5_idx, nfapi_pnf_start_response_t* resp)
{ {
printf("[VNF_SIM] pnf start response idx:%d\n", p5_idx); printf("[VNF_SIM] pnf start response idx:%d\n", p5_idx);
...@@ -596,7 +596,7 @@ int param_resp_cb(nfapi_vnf_config_t* config, int p5_idx, nfapi_param_response_t ...@@ -596,7 +596,7 @@ int param_resp_cb(nfapi_vnf_config_t* config, int p5_idx, nfapi_param_response_t
// for now just 1 // for now just 1
vnf_p7_info& p7_vnf = vnf->p7_vnfs[0]; vnf_p7_info& p7_vnf = vnf->p7_vnfs[0];
printf("[VNF_SIM] %d.%d pnf p7 %s:%d timing %d %d %d %d\n", p5_idx, phy.id, phy.remote_addr.c_str(), phy.remote_port, p7_vnf.timing_window, p7_vnf.periodic_timing_period, p7_vnf.aperiodic_timing_enabled, p7_vnf.periodic_timing_period); printf("[VNF_SIM] %d.%d pnf p7 %s:%d timing %u %u %u %u\n", p5_idx, phy.id, phy.remote_addr.c_str(), phy.remote_port, p7_vnf.timing_window, p7_vnf.periodic_timing_period, p7_vnf.aperiodic_timing_enabled, p7_vnf.periodic_timing_period);
nfapi_config_request_t req; nfapi_config_request_t req;
......
...@@ -356,7 +356,7 @@ void generate_phich_reg_mapping(LTE_DL_FRAME_PARMS *frame_parms) { ...@@ -356,7 +356,7 @@ void generate_phich_reg_mapping(LTE_DL_FRAME_PARMS *frame_parms) {
frame_parms->phich_reg[1+(mprime<<1)][1] = ((frame_parms->Nid_cell*n1/n0) + mprime + (n1/3))%n1; frame_parms->phich_reg[1+(mprime<<1)][1] = ((frame_parms->Nid_cell*n1/n0) + mprime + (n1/3))%n1;
frame_parms->phich_reg[1+(mprime<<1)][2] = ((frame_parms->Nid_cell*n2/n0) + mprime + (2*n2/3))%n2; frame_parms->phich_reg[1+(mprime<<1)][2] = ((frame_parms->Nid_cell*n2/n0) + mprime + (2*n2/3))%n2;
//#ifdef DEBUG_PHICH //#ifdef DEBUG_PHICH
printf("phich_reg :%d => %d,%d,%d\n",mprime<<1,frame_parms->phich_reg[mprime<<1][0],frame_parms->phich_reg[mprime][1],frame_parms->phich_reg[mprime][2]); printf("phich_reg :%u => %d,%d,%d\n",mprime<<1,frame_parms->phich_reg[mprime<<1][0],frame_parms->phich_reg[mprime][1],frame_parms->phich_reg[mprime][2]);
printf("phich_reg :%d => %d,%d,%d\n",1+(mprime<<1),frame_parms->phich_reg[1+(mprime<<1)][0],frame_parms->phich_reg[1+(mprime<<1)][1],frame_parms->phich_reg[1+(mprime<<1)][2]); printf("phich_reg :%d => %d,%d,%d\n",1+(mprime<<1),frame_parms->phich_reg[1+(mprime<<1)][0],frame_parms->phich_reg[1+(mprime<<1)][1],frame_parms->phich_reg[1+(mprime<<1)][2]);
//#endif //#endif
} }
......
...@@ -75,7 +75,6 @@ void free_eNB_ulsch(LTE_eNB_ULSCH_t *ulsch) { ...@@ -75,7 +75,6 @@ void free_eNB_ulsch(LTE_eNB_ULSCH_t *ulsch) {
} }
free16(ulsch,sizeof(LTE_eNB_ULSCH_t)); free16(ulsch,sizeof(LTE_eNB_ULSCH_t));
ulsch = NULL;
} }
} }
...@@ -869,7 +868,7 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc, ...@@ -869,7 +868,7 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc,
G = nb_rb * (12 * Q_m) * (ulsch_harq->Nsymb_pusch); G = nb_rb * (12 * Q_m) * (ulsch_harq->Nsymb_pusch);
Q_CQI = Q_m * Qprime; Q_CQI = Q_m * Qprime;
#ifdef DEBUG_ULSCH_DECODING #ifdef DEBUG_ULSCH_DECODING
printf("ulsch_decoding: G %d, Q_RI %d, Q_CQI %d (L %d, Or1 %d) O_ACK %d\n",G,Q_RI,Q_CQI,L,ulsch_harq->Or1,ulsch_harq->O_ACK); printf("ulsch_decoding: G %u, Q_RI %u, Q_CQI %u (L %u, Or1 %d) O_ACK %d\n",G,Q_RI,Q_CQI,L,ulsch_harq->Or1,ulsch_harq->O_ACK);
#endif #endif
G = G - Q_RI - Q_CQI; G = G - Q_RI - Q_CQI;
ulsch_harq->G = G; ulsch_harq->G = G;
...@@ -968,7 +967,7 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc, ...@@ -968,7 +967,7 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc,
} }
#ifdef DEBUG_ULSCH_DECODING #ifdef DEBUG_ULSCH_DECODING
printf("ulsch_decoding.c: ACK i %d, r %d, j %d, ColumnSet[j] %d\n",i,r,j,columnset[j]); printf("ulsch_decoding.c: ACK i %u, r %d, j %u, ColumnSet[j] %d\n",i,r,j,columnset[j]);
#endif #endif
j=(j+3)&3; j=(j+3)&3;
} }
...@@ -1373,7 +1372,7 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc, ...@@ -1373,7 +1372,7 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc,
printf("ulsch_decoding: Or1=%d\n",ulsch_harq->Or1); printf("ulsch_decoding: Or1=%d\n",ulsch_harq->Or1);
for (i=0; i<1+((8+ulsch_harq->Or1)/8); i++) for (i=0; i<1+((8+ulsch_harq->Or1)/8); i++)
printf("ulsch_decoding: O[%d] %d\n",i,ulsch_harq->o[i]); printf("ulsch_decoding: O[%u] %d\n",i,ulsch_harq->o[i]);
if (ulsch_harq->cqi_crc_status == 1) if (ulsch_harq->cqi_crc_status == 1)
printf("RX CQI CRC OK (%x)\n",extract_cqi_crc(ulsch_harq->o,ulsch_harq->Or1)); printf("RX CQI CRC OK (%x)\n",extract_cqi_crc(ulsch_harq->o,ulsch_harq->Or1));
......
...@@ -362,6 +362,10 @@ void pdcch_channel_level(int32_t **dl_ch_estimates_ext, ...@@ -362,6 +362,10 @@ void pdcch_channel_level(int32_t **dl_ch_estimates_ext,
#elif defined(__arm__) #elif defined(__arm__)
int16x8_t *dl_ch128; int16x8_t *dl_ch128;
int32x4_t *avg128P; int32x4_t *avg128P;
#else
int16_t *dl_ch128;
int32_t *avg128P;
#error Unsupported CPU architecture, cannot build __FILE__
#endif #endif
for (aatx=0; aatx<frame_parms->nb_antenna_ports_eNB; aatx++) for (aatx=0; aatx<frame_parms->nb_antenna_ports_eNB; aatx++)
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) { for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
...@@ -370,7 +374,11 @@ void pdcch_channel_level(int32_t **dl_ch_estimates_ext, ...@@ -370,7 +374,11 @@ void pdcch_channel_level(int32_t **dl_ch_estimates_ext,
avg128P = _mm_setzero_si128(); avg128P = _mm_setzero_si128();
dl_ch128=(__m128i *)&dl_ch_estimates_ext[(aatx<<1)+aarx][0]; dl_ch128=(__m128i *)&dl_ch_estimates_ext[(aatx<<1)+aarx][0];
#elif defined(__arm__) #elif defined(__arm__)
dl_ch128=&dl_ch_estimates_ext[(aatx<<1)+aarx][0];
#error __arm__ not yet implemented, cannot build __FILE__
#else
dl_ch128=&dl_ch_estimates_ext[(aatx<<1)+aarx][0];
#error Unsupported CPU architecture, cannot build __FILE__
#endif #endif
for (rb=0; rb<nb_rb; rb++) { for (rb=0; rb<nb_rb; rb++) {
...@@ -379,7 +387,8 @@ void pdcch_channel_level(int32_t **dl_ch_estimates_ext, ...@@ -379,7 +387,8 @@ void pdcch_channel_level(int32_t **dl_ch_estimates_ext,
avg128P = _mm_add_epi32(avg128P,_mm_madd_epi16(dl_ch128[1],dl_ch128[1])); avg128P = _mm_add_epi32(avg128P,_mm_madd_epi16(dl_ch128[1],dl_ch128[1]));
avg128P = _mm_add_epi32(avg128P,_mm_madd_epi16(dl_ch128[2],dl_ch128[2])); avg128P = _mm_add_epi32(avg128P,_mm_madd_epi16(dl_ch128[2],dl_ch128[2]));
#elif defined(__arm__) #elif defined(__arm__)
#else
#error Unsupported CPU architecture, cannot build __FILE__
#endif #endif
dl_ch128+=3; dl_ch128+=3;
/* /*
...@@ -423,6 +432,8 @@ void pdcch_detection_mrc_i(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -423,6 +432,8 @@ void pdcch_detection_mrc_i(LTE_DL_FRAME_PARMS *frame_parms,
__m128i *rxdataF_comp128_0,*rxdataF_comp128_1,*rxdataF_comp128_i0,*rxdataF_comp128_i1,*rho128_0,*rho128_1,*rho128_i0,*rho128_i1; __m128i *rxdataF_comp128_0,*rxdataF_comp128_1,*rxdataF_comp128_i0,*rxdataF_comp128_i1,*rho128_0,*rho128_1,*rho128_i0,*rho128_i1;
#elif defined(__arm__) #elif defined(__arm__)
int16x8_t *rxdataF_comp128_0,*rxdataF_comp128_1,*rxdataF_comp128_i0,*rxdataF_comp128_i1,*rho128_0,*rho128_1,*rho128_i0,*rho128_i1; int16x8_t *rxdataF_comp128_0,*rxdataF_comp128_1,*rxdataF_comp128_i0,*rxdataF_comp128_i1,*rho128_0,*rho128_1,*rho128_i0,*rho128_i1;
#else
#error Unsupported CPU architecture, cannot build __FILE__
#endif #endif
int32_t i; int32_t i;
...@@ -436,6 +447,8 @@ void pdcch_detection_mrc_i(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -436,6 +447,8 @@ void pdcch_detection_mrc_i(LTE_DL_FRAME_PARMS *frame_parms,
#elif defined(__arm__) #elif defined(__arm__)
rxdataF_comp128_0 = (int16x8_t *)&rxdataF_comp[(aatx<<1)][symbol*frame_parms->N_RB_DL*12]; rxdataF_comp128_0 = (int16x8_t *)&rxdataF_comp[(aatx<<1)][symbol*frame_parms->N_RB_DL*12];
rxdataF_comp128_1 = (int16x8_t *)&rxdataF_comp[(aatx<<1)+1][symbol*frame_parms->N_RB_DL*12]; rxdataF_comp128_1 = (int16x8_t *)&rxdataF_comp[(aatx<<1)+1][symbol*frame_parms->N_RB_DL*12];
#else
#error Unsupported CPU architecture, cannot build __FILE__
#endif #endif
// MRC on each re of rb on MF output // MRC on each re of rb on MF output
for (i=0; i<frame_parms->N_RB_DL*3; i++) { for (i=0; i<frame_parms->N_RB_DL*3; i++) {
......
...@@ -746,7 +746,7 @@ int dlsch_encoding_SIC(PHY_VARS_UE *ue, ...@@ -746,7 +746,7 @@ int dlsch_encoding_SIC(PHY_VARS_UE *ue,
Kr_bytes = Kr>>3; Kr_bytes = Kr>>3;
#ifdef DEBUG_DLSCH_CODING #ifdef DEBUG_DLSCH_CODING
printf("Generating Code Segment %d (%d bits)\n",r,Kr); printf("Generating Code Segment %u (%u bits)\n",r,Kr);
// generate codewords // generate codewords
printf("bits_per_codeword (Kr)= %u, A %u\n",Kr,A); printf("bits_per_codeword (Kr)= %u, A %u\n",Kr,A);
printf("N_RB = %d\n",nb_rb); printf("N_RB = %d\n",nb_rb);
......
...@@ -2248,7 +2248,7 @@ void dlsch_channel_compensation_TM56(int **rxdataF_ext, ...@@ -2248,7 +2248,7 @@ void dlsch_channel_compensation_TM56(int **rxdataF_ext,
for (rb=0; rb<nb_rb; rb++) { for (rb=0; rb<nb_rb; rb++) {
#ifdef DEBUG_DLSCH_DEMOD #ifdef DEBUG_DLSCH_DEMOD
printf("mode 6 prec: rb %d, pmi->%d\n",rb,pmi_ext[rb]); printf("mode 6 prec: rb %d, pmi->%u\n",rb,pmi_ext[rb]);
#endif #endif
prec2A_TM56_128(pmi_ext[rb],&dl_ch0_128b[0],&dl_ch1_128b[0]); prec2A_TM56_128(pmi_ext[rb],&dl_ch0_128b[0],&dl_ch1_128b[0]);
prec2A_TM56_128(pmi_ext[rb],&dl_ch0_128b[1],&dl_ch1_128b[1]); prec2A_TM56_128(pmi_ext[rb],&dl_ch0_128b[1],&dl_ch1_128b[1]);
...@@ -4771,7 +4771,7 @@ unsigned short dlsch_extract_rbs_single(int **rxdataF, ...@@ -4771,7 +4771,7 @@ unsigned short dlsch_extract_rbs_single(int **rxdataF,
else { // Odd number of RBs else { // Odd number of RBs
for (rb=0; rb<frame_parms->N_RB_DL>>1; rb++) { for (rb=0; rb<frame_parms->N_RB_DL>>1; rb++) {
#ifdef DEBUG_DLSCH_DEMOD #ifdef DEBUG_DLSCH_DEMOD
printf("dlch_ext %d\n",dl_ch0_ext-&dl_ch_estimates_ext[aarx][0]); printf("dlch_ext %u\n",dl_ch0_ext-&dl_ch_estimates_ext[aarx][0]);
#endif #endif
skip_half=0; skip_half=0;
......
...@@ -9494,7 +9494,7 @@ int main(int argc, char**argv) ...@@ -9494,7 +9494,7 @@ int main(int argc, char**argv)
LOG_M("x24576.m","x24576",x,24576,1,1); LOG_M("x24576.m","x24576",x,24576,1,1);
int dftsizes[33]={24,36,48,60,72,96,108,120,144,180,192,216,240,288,300,324,360,384,432,480,540,576,600,648,720,768,864,900,960,972,1080,1152,1200}; int dftsizes[33]={24,36,48,60,72,96,108,120,144,180,192,216,240,288,300,324,360,384,432,480,540,576,600,648,720,768,864,900,960,972,1080,1152,1200};
void (*dft[33])(int16_t *x,int16_t *y,uint8_t scale) = {dft24,dft36,dft48,dft60,dft72,dft96,dft108,dft120,dft144,dft180,dft192,dft216,dft240,dft288,dft300,dft324,dft360,dft384,dft432,dft480,dft540,dft576,dft600,dft648,dft720,dft768,dft864,dft900,dft960,dft972,dft1080,dft1152,dft1200}; void (*dft)(int16_t *x,int16_t *y,uint8_t scale)[33] = {dft24,dft36,dft48,dft60,dft72,dft96,dft108,dft120,dft144,dft180,dft192,dft216,dft240,dft288,dft300,dft324,dft360,dft384,dft432,dft480,dft540,dft576,dft600,dft648,dft720,dft768,dft864,dft900,dft960,dft972,dft1080,dft1152,dft1200};
for (int n=0;n<33;n++) { for (int n=0;n<33;n++) {
// 4xN-point DFT // 4xN-point DFT
memset((void*)x,0,dftsizes[n]*8*sizeof(int16_t)); memset((void*)x,0,dftsizes[n]*8*sizeof(int16_t));
......
...@@ -19,6 +19,7 @@ int f_read(char *calibF_fname, int nb_antM, int nb_freq, int16_t (*calibF_mtx)[n ...@@ -19,6 +19,7 @@ int f_read(char *calibF_fname, int nb_antM, int nb_freq, int16_t (*calibF_mtx)[n
} }
printf("%d\n",(int)calibF_mtx[0][0]); printf("%d\n",(int)calibF_mtx[0][0]);
printf("%d\n",(int)calibF_mtx[1][599]); printf("%d\n",(int)calibF_mtx[1][599]);
fclose(calibF_fd);
} else } else
printf("%s not found, running with defaults\n",calibF_fname); printf("%s not found, running with defaults\n",calibF_fname);
} }
...@@ -64,6 +64,7 @@ int smbv_init_config(const char* fname, uint16_t sequence_length) ...@@ -64,6 +64,7 @@ int smbv_init_config(const char* fname, uint16_t sequence_length)
if (sequence_length>4) { if (sequence_length>4) {
msg("ERROR invalid sequence length: %d, maximum is 4\n", sequence_length); msg("ERROR invalid sequence length: %d, maximum is 4\n", sequence_length);
fclose(f_ptr);
return -1; return -1;
} else } else
slen = sequence_length; slen = sequence_length;
...@@ -448,13 +449,6 @@ int smbv_send_config (const char* fname, char* smbv_ip) ...@@ -448,13 +449,6 @@ int smbv_send_config (const char* fname, char* smbv_ip)
int bytes_sent, status, sockfd; int bytes_sent, status, sockfd;
char buf[BUFFER_LENGTH]; char buf[BUFFER_LENGTH];
if (fopen(fname,"r")!=NULL) {
msg("Configuration file: %s\n",fname);
} else {
msg("ERROR: can't open SMBV config file: %s\n",fname);
return -1;
}
memset(buf,0,BUFFER_LENGTH); memset(buf,0,BUFFER_LENGTH);
// first, load up address structs with getaddrinfo(): // first, load up address structs with getaddrinfo():
......
...@@ -3000,7 +3000,7 @@ void ue_pdsch_procedures(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc, int eNB_id, PDSC ...@@ -3000,7 +3000,7 @@ void ue_pdsch_procedures(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc, int eNB_id, PDSC
int i_mod,eNB_id_i,dual_stream_UE; int i_mod,eNB_id_i,dual_stream_UE;
int first_symbol_flag=0; int first_symbol_flag=0;
if (dlsch0->active == 0) if (dlsch0 && dlsch0->active == 0)
return; return;
for (m=s0; m<=s1; m++) { for (m=s0; m<=s1; m++) {
...@@ -4209,7 +4209,7 @@ int phy_procedures_slot_parallelization_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *pr ...@@ -4209,7 +4209,7 @@ int phy_procedures_slot_parallelization_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *pr
ue->dlsch_ra[eNB_id]->active = 0; ue->dlsch_ra[eNB_id]->active = 0;
} }
if (LOG_DEBUGFLAG(UE_TIMING) if (LOG_DEBUGFLAG(UE_TIMING)) {
stop_meas(&ue->dlsch_procedures_stat[ue->current_thread_id[subframe_rx]]); stop_meas(&ue->dlsch_procedures_stat[ue->current_thread_id[subframe_rx]]);
LOG_I(PHY, "[AbsSFN %d.%d] Channel Decoder: %5.2f \n",frame_rx,subframe_rx,ue->dlsch_procedures_stat[ue->current_thread_id[subframe_rx]].p_time/(cpuf*1000.0)); LOG_I(PHY, "[AbsSFN %d.%d] Channel Decoder: %5.2f \n",frame_rx,subframe_rx,ue->dlsch_procedures_stat[ue->current_thread_id[subframe_rx]].p_time/(cpuf*1000.0));
} }
......
...@@ -1916,7 +1916,7 @@ int main(int argc, char **argv) { ...@@ -1916,7 +1916,7 @@ int main(int argc, char **argv) {
i=0; i=0;
while ((!feof(input_trch_fd)) && (i<input_buffer_length0<<3)) { while ((!feof(input_trch_fd)) && (i<input_buffer_length0<<3)) {
ret=fscanf(input_trch_fd,"%s",input_trch_val); ret=fscanf(input_trch_fd,"%15s",input_trch_val);
if (input_trch_val[0] == '1') if (input_trch_val[0] == '1')
input_buffer0[k][i>>3]+=(1<<(7-(i&7))); input_buffer0[k][i>>3]+=(1<<(7-(i&7)));
...@@ -2492,7 +2492,7 @@ PMI_FEEDBACK: ...@@ -2492,7 +2492,7 @@ PMI_FEEDBACK:
rate = (double)tbs/(double)coded_bits_per_codeword; rate = (double)tbs/(double)coded_bits_per_codeword;
if ((SNR==snr0) && (trials==0) && (round==0)) if ((SNR==snr0) && (trials==0) && (round==0))
printf("User %d, cw %d: Rate = %f (%f bits/dim) (G %d, TBS %d, mod %d, pdcch_sym %d, ndi %d)\n", printf("User %d, cw %d: Rate = %f (%f bits/dim) (G %u, TBS %u, mod %d, pdcch_sym %d, ndi %d)\n",
k,cw,rate,rate*get_Qm(eNB->dlsch[k][0]->harq_processes[0]->mcs), k,cw,rate,rate*get_Qm(eNB->dlsch[k][0]->harq_processes[0]->mcs),
coded_bits_per_codeword, coded_bits_per_codeword,
tbs, tbs,
...@@ -2764,7 +2764,7 @@ PMI_FEEDBACK: ...@@ -2764,7 +2764,7 @@ PMI_FEEDBACK:
tx_lev_dB = (unsigned int) dB_fixed(tx_lev); tx_lev_dB = (unsigned int) dB_fixed(tx_lev);
if (n_frames==1) { if (n_frames==1) {
printf("tx_lev = %d (%d dB)\n",tx_lev,tx_lev_dB); printf("tx_lev = %u (%u dB)\n",tx_lev,tx_lev_dB);
LOG_M("txsig0.m","txs0", &eNB->common_vars.txdata[eNB_id][0][subframe*eNB->frame_parms.samples_per_tti],eNB->frame_parms.samples_per_tti,1,1); LOG_M("txsig0.m","txs0", &eNB->common_vars.txdata[eNB_id][0][subframe*eNB->frame_parms.samples_per_tti],eNB->frame_parms.samples_per_tti,1,1);
// LOG_M("txsig0.m","txs0",&eNB->common_vars.txdata[eNB_id][0][0*eNB->frame_parms.samples_per_tti],eNB->frame_parms.samples_per_tti*10,1,1); // LOG_M("txsig0.m","txs0",&eNB->common_vars.txdata[eNB_id][0][0*eNB->frame_parms.samples_per_tti],eNB->frame_parms.samples_per_tti*10,1,1);
} }
...@@ -3110,7 +3110,7 @@ PMI_FEEDBACK: ...@@ -3110,7 +3110,7 @@ PMI_FEEDBACK:
//round_trials[0]++; //round_trials[0]++;
if (n_frames==1) if (n_frames==1)
printf("DCI error trial %d errs[0] %d\n",trials,errs[0]); printf("DCI error trial %u errs[0] %u\n",trials,errs[0]);
} }
// for (i=1;i<=round;i++) // for (i=1;i<=round;i++)
...@@ -3153,7 +3153,7 @@ PMI_FEEDBACK: ...@@ -3153,7 +3153,7 @@ PMI_FEEDBACK:
rate = (double)dlsch_tbs25[get_I_TBS(UE->dlsch[UE->current_thread_id[subframe]][0][0]->harq_processes[UE->dlsch[UE->current_thread_id[subframe]][0][0]->current_harq_pid]->mcs)][UE->dlsch[UE->current_thread_id[subframe]][0][0]->nb_rb-1]/(coded_bits_per_codeword); rate = (double)dlsch_tbs25[get_I_TBS(UE->dlsch[UE->current_thread_id[subframe]][0][0]->harq_processes[UE->dlsch[UE->current_thread_id[subframe]][0][0]->current_harq_pid]->mcs)][UE->dlsch[UE->current_thread_id[subframe]][0][0]->nb_rb-1]/(coded_bits_per_codeword);
rate*=get_Qm(UE->dlsch[UE->current_thread_id[subframe]][0][0]->harq_processes[UE->dlsch[UE->current_thread_id[subframe]][0][0]->current_harq_pid]->mcs); rate*=get_Qm(UE->dlsch[UE->current_thread_id[subframe]][0][0]->harq_processes[UE->dlsch[UE->current_thread_id[subframe]][0][0]->current_harq_pid]->mcs);
*/ */
printf("num_pdcch_symbols %d, G %d, TBS %d\n",UE->pdcch_vars[0]->num_pdcch_symbols,coded_bits_per_codeword, printf("num_pdcch_symbols %d, G %u, TBS %d\n",UE->pdcch_vars[0]->num_pdcch_symbols,coded_bits_per_codeword,
UE->dlsch[UE->current_thread_id[subframe]][0][0]->harq_processes[UE->dlsch[UE->current_thread_id[subframe]][0][0]->current_harq_pid]->TBS); UE->dlsch[UE->current_thread_id[subframe]][0][0]->harq_processes[UE->dlsch[UE->current_thread_id[subframe]][0][0]->current_harq_pid]->TBS);
dlsch_active = 1; dlsch_active = 1;
} else { } else {
...@@ -3166,10 +3166,6 @@ PMI_FEEDBACK: ...@@ -3166,10 +3166,6 @@ PMI_FEEDBACK:
round=5; round=5;
if (n_frames==1) if (n_frames==1)
<<<<<<< f8509a1bf61f8f3f798575e01db8e5d4807d9ce9
printf("DCI misdetection trial %d\n",trials);
=======
printf("DCI misdetection trial %u\n",trials); printf("DCI misdetection trial %u\n",trials);
>>>>>>> new set of cppcheck fixes >>>>>>> new set of cppcheck fixes
} }
...@@ -3751,12 +3747,7 @@ PMI_FEEDBACK: ...@@ -3751,12 +3747,7 @@ PMI_FEEDBACK:
SNR, SNR,
(double)tx_lev_dB+10*log10(UE->frame_parms.ofdm_symbol_size/(NB_RB*12)), (double)tx_lev_dB+10*log10(UE->frame_parms.ofdm_symbol_size/(NB_RB*12)),
sigma2_dB); sigma2_dB);
<<<<<<< f8509a1bf61f8f3f798575e01db8e5d4807d9ce9
printf("Errors (%d(%d)/%d %d/%d %d/%d %d/%d), Pe = (%e,%e,%e,%e), dci_errors %d/%d, Pe = %e => effective rate %f (%2.1f%%,%f, %f), normalized delay %f (%f)\n",
=======
printf("Errors (%u(%u)/%u %u/%u %u/%u %u/%u), Pe = (%e,%e,%e,%e), dci_errors %u/%u, Pe = %e => effective rate %f (%2.1f%%,%f, %f), normalized delay %f (%f)\n", printf("Errors (%u(%u)/%u %u/%u %u/%u %u/%u), Pe = (%e,%e,%e,%e), dci_errors %u/%u, Pe = %e => effective rate %f (%2.1f%%,%f, %f), normalized delay %f (%f)\n",
>>>>>>> new set of cppcheck fixes
errs[0], errs[0],
errs2[0], errs2[0],
round_trials[0], round_trials[0],
...@@ -3887,7 +3878,7 @@ PMI_FEEDBACK: ...@@ -3887,7 +3878,7 @@ PMI_FEEDBACK:
} }
if ((transmission_mode != 3) && (transmission_mode != 4)) { if ((transmission_mode != 3) && (transmission_mode != 4)) {
fprintf(bler_fd,"%f;%d;%d;%f;%d;%d;%d;%d;%d;%d;%d;%d;%d\n", fprintf(bler_fd,"%f;%d;%d;%f;%u;%u;%u;%u;%u;%u;%u;%u;%u\n",
SNR, SNR,
mcs1, mcs1,
eNB->dlsch[0][0]->harq_processes[0]->TBS, eNB->dlsch[0][0]->harq_processes[0]->TBS,
...@@ -3902,7 +3893,7 @@ PMI_FEEDBACK: ...@@ -3902,7 +3893,7 @@ PMI_FEEDBACK:
round_trials[3], round_trials[3],
dci_errors); dci_errors);
} else { } else {
fprintf(bler_fd,"%f;%d;%d;%d;%d;%f;%d;%d;%d;%d;%d;%d;%d;%d;%d\n", fprintf(bler_fd,"%f;%d;%d;%d;%d;%f;%u;%u;%u;%u;%u;%u;%u;%u;%u\n",
SNR, SNR,
mcs1,mcs2, mcs1,mcs2,
eNB->dlsch[0][0]->harq_processes[0]->TBS, eNB->dlsch[0][0]->harq_processes[0]->TBS,
...@@ -3935,7 +3926,7 @@ PMI_FEEDBACK: ...@@ -3935,7 +3926,7 @@ PMI_FEEDBACK:
if ( (test_perf != 0) && (100 * effective_rate > test_perf )) { if ( (test_perf != 0) && (100 * effective_rate > test_perf )) {
//fprintf(time_meas_fd,"SNR; MCS; TBS; rate; err0; trials0; err1; trials1; err2; trials2; err3; trials3; dci_err\n"); //fprintf(time_meas_fd,"SNR; MCS; TBS; rate; err0; trials0; err1; trials1; err2; trials2; err3; trials3; dci_err\n");
if ((transmission_mode != 3) && (transmission_mode != 4)) { if ((transmission_mode != 3) && (transmission_mode != 4)) {
fprintf(time_meas_fd,"%f;%d;%d;%f;%d;%d;%d;%d;%d;%d;%d;%d;%d;", fprintf(time_meas_fd,"%f;%d;%d;%f;%u;%u;%u;%u;%u;%u;%u;%u;%u;",
SNR, SNR,
mcs1, mcs1,
eNB->dlsch[0][0]->harq_processes[0]->TBS, eNB->dlsch[0][0]->harq_processes[0]->TBS,
...@@ -3950,7 +3941,7 @@ PMI_FEEDBACK: ...@@ -3950,7 +3941,7 @@ PMI_FEEDBACK:
round_trials[3], round_trials[3],
dci_errors); dci_errors);
//fprintf(time_meas_fd,"SNR; MCS; TBS; rate; DL_DECOD_ITER; err0; trials0; err1; trials1; err2; trials2; err3; trials3; PE; dci_err;PE;ND;\n"); //fprintf(time_meas_fd,"SNR; MCS; TBS; rate; DL_DECOD_ITER; err0; trials0; err1; trials1; err2; trials2; err3; trials3; PE; dci_err;PE;ND;\n");
fprintf(time_meas_fd,"%f;%d;%d;%f; %2.1f%%;%f;%f;%d;%d;%d;%d;%d;%d;%d;%d;%e;%e;%e;%e;%d;%d;%e;%f;%f;", fprintf(time_meas_fd,"%f;%d;%d;%f; %2.1f%%;%f;%f;%u;%u;%u;%u;%u;%u;%u;%u;%e;%e;%e;%e;%u;%u;%e;%f;%f;",
SNR, SNR,
mcs1, mcs1,
eNB->dlsch[0][0]->harq_processes[0]->TBS, eNB->dlsch[0][0]->harq_processes[0]->TBS,
...@@ -3977,7 +3968,7 @@ PMI_FEEDBACK: ...@@ -3977,7 +3968,7 @@ PMI_FEEDBACK:
(double)eNB->dlsch[0][0]->harq_processes[0]->TBS, (double)eNB->dlsch[0][0]->harq_processes[0]->TBS,
(1.0*(round_trials[0]-errs[0])+2.0*(round_trials[1]-errs[1])+3.0*(round_trials[2]-errs[2])+4.0*(round_trials[3]-errs[3]))/((double)round_trials[0])); (1.0*(round_trials[0]-errs[0])+2.0*(round_trials[1]-errs[1])+3.0*(round_trials[2]-errs[2])+4.0*(round_trials[3]-errs[3]))/((double)round_trials[0]));
} else { } else {
fprintf(time_meas_fd,"%f;%d;%d;%d;%d;%f;%d;%d;%d;%d;%d;%d;%d;%d;%d;", fprintf(time_meas_fd,"%f;%d;%d;%d;%d;%f;%u;%u;%u;%u;%u;%u;%u;%u;%u;",
SNR, SNR,
mcs1,mcs2, mcs1,mcs2,
eNB->dlsch[0][0]->harq_processes[0]->TBS, eNB->dlsch[0][0]->harq_processes[0]->TBS,
...@@ -3993,7 +3984,7 @@ PMI_FEEDBACK: ...@@ -3993,7 +3984,7 @@ PMI_FEEDBACK:
round_trials[3], round_trials[3],
dci_errors); dci_errors);
//fprintf(time_meas_fd,"SNR; MCS; TBS; rate; DL_DECOD_ITER; err0; trials0; err1; trials1; err2; trials2; err3; trials3; PE; dci_err;PE;ND;\n"); //fprintf(time_meas_fd,"SNR; MCS; TBS; rate; DL_DECOD_ITER; err0; trials0; err1; trials1; err2; trials2; err3; trials3; PE; dci_err;PE;ND;\n");
fprintf(time_meas_fd,"%f;%d;%d;%d;%d;%f;%2.1f;%f;%f;%d;%d;%d;%d;%d;%d;%d;%d;%e;%e;%e;%e;%d;%d;%e;%f;%f;", fprintf(time_meas_fd,"%f;%d;%d;%d;%d;%f;%2.1f;%f;%f;%u;%u;%u;%u;%u;%u;%u;%u;%e;%e;%e;%e;%u;%u;%e;%f;%f;",
SNR, SNR,
mcs1,mcs2, mcs1,mcs2,
eNB->dlsch[0][0]->harq_processes[0]->TBS, eNB->dlsch[0][0]->harq_processes[0]->TBS,
......
...@@ -460,7 +460,7 @@ int main(int argc, char **argv) { ...@@ -460,7 +460,7 @@ int main(int argc, char **argv) {
0,0,0); 0,0,0);
if (n_frames==1) if (n_frames==1)
printf("MCH decoding returns %d\n",ret); printf("MCH decoding returns %u\n",ret);
if (ret == (1+UE->dlsch_MCH[0]->max_turbo_iterations)) if (ret == (1+UE->dlsch_MCH[0]->max_turbo_iterations))
errs[0]++; errs[0]++;
...@@ -469,15 +469,15 @@ int main(int argc, char **argv) { ...@@ -469,15 +469,15 @@ int main(int argc, char **argv) {
eNB->proc.proc_rxtx[0].frame_tx++; eNB->proc.proc_rxtx[0].frame_tx++;
} }
printf("errors %d/%d (Pe %e)\n",errs[round],trials,(double)errs[round]/trials); printf("errors %u/%u (Pe %e)\n",errs[round],trials,(double)errs[round]/trials);
if (awgn_flag==0) if (awgn_flag==0)
fprintf(fd,"SNR_%d_%d = [SNR_%d_%d %f]; errs_mch_%d_%d =[errs_mch_%d_%d %d]; mch_trials_%d_%d =[mch_trials_%d_%d %d];\n", fprintf(fd,"SNR_%d_%d = [SNR_%d_%d %f]; errs_mch_%d_%d =[errs_mch_%d_%d %u]; mch_trials_%d_%d =[mch_trials_%d_%d %u];\n",
mcs,N_RB_DL,mcs,N_RB_DL,SNR, mcs,N_RB_DL,mcs,N_RB_DL,SNR,
mcs,N_RB_DL,mcs,N_RB_DL,errs[0], mcs,N_RB_DL,mcs,N_RB_DL,errs[0],
mcs,N_RB_DL,mcs,N_RB_DL,trials); mcs,N_RB_DL,mcs,N_RB_DL,trials);
else else
fprintf(fd,"SNR_awgn_%d = [SNR_awgn_%d %f]; errs_mch_awgn_%d =[errs_mch_awgn_%d %d]; mch_trials_awgn_%d =[mch_trials_awgn_%d %d];\n", fprintf(fd,"SNR_awgn_%d = [SNR_awgn_%d %f]; errs_mch_awgn_%d =[errs_mch_awgn_%d %u]; mch_trials_awgn_%d =[mch_trials_awgn_%d %u];\n",
N_RB_DL,N_RB_DL,SNR, N_RB_DL,N_RB_DL,SNR,
N_RB_DL,N_RB_DL,errs[0], N_RB_DL,N_RB_DL,errs[0],
N_RB_DL,N_RB_DL,trials); N_RB_DL,N_RB_DL,trials);
......
...@@ -708,7 +708,7 @@ int main(int argc, char **argv) { ...@@ -708,7 +708,7 @@ int main(int argc, char **argv) {
i=0; i=0;
while (!feof(input_fd)) { while (!feof(input_fd)) {
if (fscanf(input_fd,"%s %s",input_val_str,input_val_str2) != 2) { //&input_val1,&input_val2); if (fscanf(input_fd,"%49s %49s",input_val_str,input_val_str2) != 2) { //&input_val1,&input_val2);
printf("%s:%d:%s: error with fscanf, exiting\n", __FILE__, __LINE__, __FUNCTION__); printf("%s:%d:%s: error with fscanf, exiting\n", __FILE__, __LINE__, __FUNCTION__);
exit(1); exit(1);
} }
......
...@@ -721,7 +721,7 @@ int main(int argc, char **argv) { ...@@ -721,7 +721,7 @@ int main(int argc, char **argv) {
i=0; i=0;
while (!feof(input_fd)) { while (!feof(input_fd)) {
ret=fscanf(input_fd,"%s %s",input_val_str,input_val_str2);//&input_val1,&input_val2); ret=fscanf(input_fd,"%49s %49s",input_val_str,input_val_str2);//&input_val1,&input_val2);
if (ret != 2) { if (ret != 2) {
printf("%s:%d:%s: fscanf error, exiting\n", __FILE__, __LINE__, __FUNCTION__); printf("%s:%d:%s: fscanf error, exiting\n", __FILE__, __LINE__, __FUNCTION__);
......
...@@ -105,15 +105,6 @@ int main(int argc, char **argv) { ...@@ -105,15 +105,6 @@ int main(int argc, char **argv) {
number_of_cards = 1; number_of_cards = 1;
openair_daq_vars.rx_rf_mode = 1; openair_daq_vars.rx_rf_mode = 1;
/*
rxdataF = (int **)malloc16(2*sizeof(int*));
rxdataF[0] = (int *)malloc16(FRAME_LENGTH_BYTES);
rxdataF[1] = (int *)malloc16(FRAME_LENGTH_BYTES);
rxdata = (int **)malloc16(2*sizeof(int*));
rxdata[0] = (int *)malloc16(FRAME_LENGTH_BYTES);
rxdata[1] = (int *)malloc16(FRAME_LENGTH_BYTES);
*/
while ((c = getopt (argc, argv, "f:hpf:g:n:s:S:t:x:y:z:N:F:GdP:")) != -1) { while ((c = getopt (argc, argv, "f:hpf:g:n:s:S:t:x:y:z:N:F:GdP:")) != -1) {
switch (c) { switch (c) {
case 'f': case 'f':
...@@ -604,8 +595,14 @@ int main(int argc, char **argv) { ...@@ -604,8 +595,14 @@ int main(int argc, char **argv) {
} }
free(s_re); free(s_re);
free(s_re1);
free(s_re2);
free(s_im); free(s_im);
free(s_im1);
free(s_im2);
free(r_re); free(r_re);
free(r_re1);
free(r_re2);
free(r_im); free(r_im);
free(r_im1); free(r_im1);
free(r_im2); free(r_im2);
......
...@@ -1141,7 +1141,7 @@ int main(int argc, char **argv) { ...@@ -1141,7 +1141,7 @@ int main(int argc, char **argv) {
i=0; i=0;
while (!feof(input_fd)) { while (!feof(input_fd)) {
ret=fscanf(input_fd,"%s %s",input_val_str,input_val_str2);//&input_val1,&input_val2); ret=fscanf(input_fd,"%49s %49s",input_val_str,input_val_str2);//&input_val1,&input_val2);
/* /*
if ((i%4)==0) { if ((i%4)==0) {
((short*)txdata[0])[i/2] = (short)((1<<15)*strtod(input_val_str,NULL)); ((short*)txdata[0])[i/2] = (short)((1<<15)*strtod(input_val_str,NULL));
......
...@@ -349,19 +349,6 @@ int main(int argc, char **argv) { ...@@ -349,19 +349,6 @@ int main(int argc, char **argv) {
char input_val_str[50],input_val_str2[50]; char input_val_str[50],input_val_str2[50];
// FILE *rx_frame_file; // FILE *rx_frame_file;
FILE *csv_fdUL=NULL; FILE *csv_fdUL=NULL;
/*
FILE *fperen=NULL;
char fperen_name[512];
FILE *fmageren=NULL;
char fmageren_name[512];
FILE *flogeren=NULL;
char flogeren_name[512];
*/
/* FILE *ftxlev;
char ftxlev_name[512];
*/
char csv_fname[512]; char csv_fname[512];
static int n_frames=5000; static int n_frames=5000;
static int n_ch_rlz = 1; static int n_ch_rlz = 1;
...@@ -820,7 +807,7 @@ int main(int argc, char **argv) { ...@@ -820,7 +807,7 @@ int main(int argc, char **argv) {
if (cqi_flag == 1) coded_bits_per_codeword-=UE->ulsch[0]->O; if (cqi_flag == 1) coded_bits_per_codeword-=UE->ulsch[0]->O;
rate = (double)dlsch_tbs25[get_I_TBS(mcs)][nb_rb-1]/(coded_bits_per_codeword); rate = (double)dlsch_tbs25[get_I_TBS(mcs)][nb_rb-1]/(coded_bits_per_codeword);
printf("Rate = %f (mod %d), coded bits %d\n",rate,get_Qm_ul(mcs),coded_bits_per_codeword); printf("Rate = %f (mod %d), coded bits %u\n",rate,get_Qm_ul(mcs),coded_bits_per_codeword);
for (ch_realization=0; ch_realization<n_ch_rlz; ch_realization++) { for (ch_realization=0; ch_realization<n_ch_rlz; ch_realization++) {
/* /*
...@@ -882,7 +869,7 @@ int main(int argc, char **argv) { ...@@ -882,7 +869,7 @@ int main(int argc, char **argv) {
i=0; i=0;
while (!feof(input_fdUL)) { while (!feof(input_fdUL)) {
ret=fscanf(input_fdUL,"%s %s",input_val_str,input_val_str2);//&input_val1,&input_val2); ret=fscanf(input_fdUL,"%49s %49s",input_val_str,input_val_str2);//&input_val1,&input_val2);
if (ret != 2) printf("ERROR: error reading file\n"); if (ret != 2) printf("ERROR: error reading file\n");
...@@ -969,7 +956,7 @@ int main(int argc, char **argv) { ...@@ -969,7 +956,7 @@ int main(int argc, char **argv) {
eNB->ulsch[0]->harq_processes[harq_pid]->round=round; eNB->ulsch[0]->harq_processes[harq_pid]->round=round;
UE->ulsch[0]->harq_processes[harq_pid]->round=round;