From aec1263e7166cd7e94b9969f4ad2dd57564703df Mon Sep 17 00:00:00 2001 From: yilmazt Date: Tue, 10 Sep 2019 16:37:06 +0200 Subject: [PATCH] initial cppcheck fixes --- ci-scripts/oai-ci-vm-tool | 2 +- executables/nr-ru.c | 2 +- openair1/PHY/CODING/TESTBENCH/ldpctest.c | 57 ++++++++------- .../CODING/nrPolar_tools/nr_polar_encoder.c | 2 +- openair1/PHY/CODING/nr_segmentation.c | 24 +++---- openair1/PHY/MODULATION/slot_fep_nr.c | 14 ++-- openair1/PHY/NR_REFSIG/nr_dmrs_rx.c | 41 ++++++----- openair1/PHY/NR_REFSIG/ul_ref_seq_nr.c | 11 ++- openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c | 15 ++-- .../nr_dl_channel_estimation.c | 71 +++++++++---------- openair1/PHY/NR_UE_TRANSPORT/dci_nr.c | 24 +++---- .../NR_UE_TRANSPORT/nr_dlsch_demodulation.c | 8 +-- openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c | 4 +- .../PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c | 17 ++--- openair1/PHY/NR_UE_TRANSPORT/pss_nr.c | 14 ++-- openair1/SCHED_NR_UE/phy_procedures_nr_ue.c | 2 +- openair1/SCHED_NR_UE/pucch_uci_ue_nr.c | 2 +- openair1/SIMULATION/NR_PHY/dlschsim.c | 6 +- openair1/SIMULATION/NR_PHY/ulschsim.c | 8 +-- openair1/SIMULATION/NR_PHY/ulsim.c | 2 +- targets/RT/USER/lte-hwlat.c | 12 ++-- targets/RT/USER/lte-hwlat2.c | 6 +- 22 files changed, 172 insertions(+), 172 deletions(-) diff --git a/ci-scripts/oai-ci-vm-tool b/ci-scripts/oai-ci-vm-tool index d4414b7ac2..a37c4f7b08 100755 --- a/ci-scripts/oai-ci-vm-tool +++ b/ci-scripts/oai-ci-vm-tool @@ -177,7 +177,7 @@ function variant__v4__cppcheck { VM_MEMORY=4096 LOG_PATTERN=cppcheck.xml NB_PATTERN_FILES=1 - BUILD_OPTIONS="--enable=warning --force --xml --xml-version=2 --suppressions-list=ci-scripts/cppcheck_suppressions.list -I common/utils -I openair3/NAS/COMMON/UTIL -j4" + BUILD_OPTIONS="--enable=warning --force --xml --xml-version=2 -i openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder.c --suppressions-list=ci-scripts/cppcheck_suppressions.list -I common/utils -I openair3/NAS/COMMON/UTIL -j4" } function variant__v5__gnb_usrp { diff --git a/executables/nr-ru.c b/executables/nr-ru.c index c73b2fa277..e7cf6685b2 100644 --- a/executables/nr-ru.c +++ b/executables/nr-ru.c @@ -774,7 +774,7 @@ void tx_rf(RU_t *ru,int frame,int slot, uint64_t timestamp) { LOG_D(PHY,"[TXPATH] RU %d tx_rf, writing to TS %llu, frame %d, unwrapped_frame %d, subframe %d\n",ru->idx, (long long unsigned int)timestamp,frame,proc->frame_tx_unwrap,slot); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE, 0 ); - AssertFatal(txs == siglen+sf_extension,"TX : Timeout (sent %d/%d)\n",txs, siglen); + AssertFatal(txs == siglen+sf_extension,"TX : Timeout (sent %u/%d)\n", txs, siglen); } } diff --git a/openair1/PHY/CODING/TESTBENCH/ldpctest.c b/openair1/PHY/CODING/TESTBENCH/ldpctest.c index 6db9548dbe..d73cbd05e8 100644 --- a/openair1/PHY/CODING/TESTBENCH/ldpctest.c +++ b/openair1/PHY/CODING/TESTBENCH/ldpctest.c @@ -118,7 +118,7 @@ int test_ldpc(short No_iteration, unsigned int *crc_misses, time_stats_t *time_optim, time_stats_t *time_decoder, - n_iter_stats_t * dec_iter) + n_iter_stats_t *dec_iter) { //clock initiate //time_stats_t time,time_optim,tinput,tprep,tparity,toutput, time_decoder; @@ -146,12 +146,12 @@ int test_ldpc(short No_iteration, double *modulated_input[MAX_NUM_DLSCH_SEGMENTS]; char *channel_output_fixed[MAX_NUM_DLSCH_SEGMENTS]; unsigned int i,j,trial=0; - short BG,Zc,Kb,nrows;//,ncols; + short BG=0,Zc,Kb=0,nrows=0;//,ncols; int no_punctured_columns,removed_bit; int i1; int R_ind = 0; //Table of possible lifting sizes -//short lift_size[51]= {2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,18,20,22,24,26,28,30,32,36,40,44,48,52,56,60,64,72,80,88,96,104,112,120,128,144,160,176,192,208,224,240,256,288,320,352,384}; + //short lift_size[51]= {2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,18,20,22,24,26,28,30,32,36,40,44,48,52,56,60,64,72,80,88,96,104,112,120,128,144,160,176,192,208,224,240,256,288,320,352,384}; //int n_segments=1; int code_rate_vec[8] = {15, 13, 25, 12, 23, 34, 56, 89}; //double code_rate_actual_vec[8] = {0.2, 0.33333, 0.4, 0.5, 0.66667, 0.73333, 0.81481, 0.88}; @@ -227,15 +227,15 @@ int test_ldpc(short No_iteration, //determine number of bits in codeword if (block_length>3840) { - BG=1; + BG = 1; Kb = 22; - nrows=46; //parity check bits + nrows = 46; //parity check bits //ncols=22; //info bits } else if (block_length<=3840) { - BG=2; - nrows=42; //parity check bits + BG = 2; + nrows = 42; //parity check bits //ncols=10; // info bits if (block_length>640) @@ -246,7 +246,7 @@ int test_ldpc(short No_iteration, Kb = 8; else Kb = 6; - } + } if (nom_rate == 1) if (denom_rate == 5) @@ -298,7 +298,7 @@ int test_ldpc(short No_iteration, } } - printf("ldpc_test: codeword_length %d, n_segments %d, block_length %d, BG %d, Zc %d, Kb %d\n",n_segments *block_length, n_segments, block_length,BG, Zc, Kb); + printf("ldpc_test: codeword_length %d, n_segments %d, block_length %d, BG %d, Zc %d, Kb %d\n",n_segments *block_length, n_segments, block_length, BG, Zc, Kb); no_punctured_columns=(int)((nrows-2)*Zc+block_length-block_length*(1/((float)nom_rate/(float)denom_rate)))/Zc; // printf("puncture:%d\n",no_punctured_columns); removed_bit=(nrows-no_punctured_columns-2) * Zc+block_length-(int)(block_length/((float)nom_rate/(float)denom_rate)); @@ -330,11 +330,11 @@ int test_ldpc(short No_iteration, if (ntrials==1) for (j=0;j3840) { - BG=1; + BG = 1; Kb = 22; //nrows=46; //parity check bits //ncols=22; //info bits } else if (block_length<=3840) { - BG=2; + BG = 2; //nrows=42; //parity check bits //ncols=10; // info bits @@ -689,9 +688,9 @@ int main(int argc, char *argv[]) time_decoder, dec_iter); - printf("SNR %f, BLER %f (%d/%d)\n",SNR,(float)decoded_errors[i]/(float)n_trials,decoded_errors[i],n_trials); - printf("SNR %f, BER %f (%d/%d)\n",SNR,(float)errors_bit/(float)n_trials/(float)block_length/(double)n_segments ,decoded_errors[i],n_trials); - printf("SNR %f, Uncoded BER %f (%d/%d)\n",SNR,errors_bit_uncoded/(float)n_trials/(double)n_segments ,decoded_errors[i],n_trials); + printf("SNR %f, BLER %f (%u/%d)\n", SNR, (float)decoded_errors[i]/(float)n_trials, decoded_errors[i], n_trials); + printf("SNR %f, BER %f (%u/%d)\n", SNR, (float)errors_bit/(float)n_trials/(float)block_length/(double)n_segments, decoded_errors[i], n_trials); + printf("SNR %f, Uncoded BER %f (%u/%d)\n",SNR, errors_bit_uncoded/(float)n_trials/(double)n_segments, decoded_errors[i], n_trials); printf("SNR %f, Mean iterations: %f\n",SNR, dec_iter->n_iter_mean); printf("SNR %f, Std iterations: %f\n",SNR, dec_iter->n_iter_std); printf("SNR %f, Max iterations: %d\n",SNR, dec_iter->n_iter_max); diff --git a/openair1/PHY/CODING/nrPolar_tools/nr_polar_encoder.c b/openair1/PHY/CODING/nrPolar_tools/nr_polar_encoder.c index 9858f16cb0..df9b53a8b0 100644 --- a/openair1/PHY/CODING/nrPolar_tools/nr_polar_encoder.c +++ b/openair1/PHY/CODING/nrPolar_tools/nr_polar_encoder.c @@ -268,7 +268,7 @@ static inline void polar_rate_matching(t_nrPolar_params *polarParams,void *in,vo #endif for (int i=0; iencoderLength; i++) { #ifdef DEBUG_POLAR_ENCODER - printf("%u<-%u : %llx.%llx =>",i,polarParams->rate_matching_pattern[i],((uint64_t *)out)[1],((uint64_t *)out)[0]); + printf("%d<-%u : %llx.%llx =>",i,polarParams->rate_matching_pattern[i],((uint64_t *)out)[1],((uint64_t *)out)[0]); #endif tmp0 = (*in128&(((uint128_t)1)<rate_matching_pattern[i])); if (tmp0!=0) { diff --git a/openair1/PHY/CODING/nr_segmentation.c b/openair1/PHY/CODING/nr_segmentation.c index 421f440ec2..00616f2189 100644 --- a/openair1/PHY/CODING/nr_segmentation.c +++ b/openair1/PHY/CODING/nr_segmentation.c @@ -30,12 +30,12 @@ //#define DEBUG_SEGMENTATION int32_t nr_segmentation(unsigned char *input_buffer, - unsigned char **output_buffers, - unsigned int B, - unsigned int *C, - unsigned int *K, - unsigned int *Zout, // [hna] Zout is Zc - unsigned int *F) + unsigned char **output_buffers, + unsigned int B, + unsigned int *C, + unsigned int *K, + unsigned int *Zout, // [hna] Zout is Zc + unsigned int *F) { unsigned int L,Bprime,Bprime_by_C,Z,r,Kb,k,s,crc,Kprime; @@ -53,12 +53,12 @@ int32_t nr_segmentation(unsigned char *input_buffer, Bprime = B+((*C)*L); #ifdef DEBUG_SEGMENTATION - printf("Bprime %d\n",Bprime); + printf("Bprime %u\n",Bprime); #endif } if ((*C)>MAX_NUM_DLSCH_SEGMENTS) { - LOG_E(PHY,"nr_segmentation.c: too many segments %d, B %d, L %d, Bprime %d\n",*C,B,L,Bprime); + LOG_E(PHY,"nr_segmentation.c: too many segments %d, B %d, L %d, Bprime %d\n",*C,B,L,Bprime); return(-1); } @@ -83,7 +83,7 @@ else Z = (Bprime_by_C/Kb); #ifdef DEBUG_SEGMENTATION - printf("nr segmetation B %d Bprime %d Bprime_by_C %d z %d \n", B, Bprime, Bprime_by_C, Z); + printf("nr segmetation B %u Bprime %u Bprime_by_C %u z %u \n", B, Bprime, Bprime_by_C, Z); #endif if (Z <= 2) { @@ -110,7 +110,7 @@ else *K = *K + 8; #ifdef DEBUG_SEGMENTATION - printf("Z_by_C %d , K2 %d\n",Z,*K); + printf("Z_by_C %u , K2 %u\n",Z,*K); #endif } else if (Z <= 256) { // increase by 4 bytes til here *K = (Z>>4)<<4; @@ -134,8 +134,8 @@ else *F = ((*K) - Bprime_by_C); #ifdef DEBUG_SEGMENTATION - printf("final nr seg output Z %d K %d F %d \n", *Zout, *K, *F); - printf("C %d, K %d, Bprime_bytes %d, Bprime %d, F %d\n",*C,*K,Bprime>>3,Bprime,*F); + printf("final nr seg output Z %u K %u F %u \n", *Zout, *K, *F); + printf("C %u, K %u, Bprime_bytes %u, Bprime %u, F %u\n",*C,*K,Bprime>>3,Bprime,*F); #endif if ((input_buffer) && (output_buffers)) { diff --git a/openair1/PHY/MODULATION/slot_fep_nr.c b/openair1/PHY/MODULATION/slot_fep_nr.c index c00fef5929..11aaf1f78e 100644 --- a/openair1/PHY/MODULATION/slot_fep_nr.c +++ b/openair1/PHY/MODULATION/slot_fep_nr.c @@ -36,10 +36,10 @@ #endif*/ int nr_slot_fep(PHY_VARS_NR_UE *ue, - unsigned char symbol, - unsigned char Ns, - int sample_offset, - int no_prefix) + unsigned char symbol, + unsigned char Ns, + int sample_offset, + int no_prefix) { NR_DL_FRAME_PARMS *frame_parms = &ue->frame_parms; NR_UE_COMMON *common_vars = &ue->common_vars; @@ -131,8 +131,8 @@ int nr_slot_fep(PHY_VARS_NR_UE *ue, #ifdef DEBUG_FEP // if (ue->frame <100) - /*LOG_I(PHY,*/printf("slot_fep: frame %d: slot %d, symbol %d, nb_prefix_samples %d, nb_prefix_samples0 %d, slot_offset %d, sample_offset %d,rx_offset %d, frame_length_samples %d\n", ue->proc.proc_rxtx[(Ns)&1].frame_rx,Ns, symbol, - nb_prefix_samples,nb_prefix_samples0,slot_offset,sample_offset,rx_offset,frame_length_samples); + /*LOG_I(PHY,*/printf("slot_fep: frame %d: slot %d, symbol %d, nb_prefix_samples %u, nb_prefix_samples0 %u, slot_offset %u, sample_offset %d,rx_offset %u, frame_length_samples %u\n", + ue->proc.proc_rxtx[(Ns)&1].frame_rx, Ns, symbol, nb_prefix_samples, nb_prefix_samples0, slot_offset, sample_offset, rx_offset, frame_length_samples); #endif if (symbol==0) { @@ -192,7 +192,7 @@ int nr_slot_fep(PHY_VARS_NR_UE *ue, #ifdef DEBUG_FEP // if (ue->frame <100) - printf("slot_fep: frame %d: symbol %d rx_offset %d\n", ue->proc.proc_rxtx[(Ns)&1].frame_rx, symbol,rx_offset); + printf("slot_fep: frame %d: symbol %d rx_offset %u\n", ue->proc.proc_rxtx[(Ns)&1].frame_rx, symbol, rx_offset); #endif } diff --git a/openair1/PHY/NR_REFSIG/nr_dmrs_rx.c b/openair1/PHY/NR_REFSIG/nr_dmrs_rx.c index e0c17bfb75..8251a93254 100644 --- a/openair1/PHY/NR_REFSIG/nr_dmrs_rx.c +++ b/openair1/PHY/NR_REFSIG/nr_dmrs_rx.c @@ -48,14 +48,13 @@ short nr_rx_mod_table[14] = {0,0,23170,-23170,-23170,23170,23170,-23170,23170,2 short nr_rx_nmod_table[14] = {0,0,-23170,23170,23170,-23170,-23170,23170,-23170,-23170,23170,23170,23170,-23170}; - int nr_pdsch_dmrs_rx(PHY_VARS_NR_UE *ue, - unsigned int Ns, - unsigned int *nr_gold_pdsch, - int32_t *output, - unsigned short p, - unsigned char lp, - unsigned short nb_pdsch_rb) + unsigned int Ns, + unsigned int *nr_gold_pdsch, + int32_t *output, + unsigned short p, + unsigned char lp, + unsigned short nb_pdsch_rb) { int8_t w,config_type; short *mod_table; @@ -101,15 +100,15 @@ int nr_pdsch_dmrs_rx(PHY_VARS_NR_UE *ue, return(0); } -int nr_pdcch_dmrs_rx(PHY_VARS_NR_UE *ue, - uint8_t eNB_offset, - unsigned int Ns, - unsigned int *nr_gold_pdcch, - int32_t *output, - unsigned short p, - unsigned short nb_rb_coreset) -{ +int nr_pdcch_dmrs_rx(PHY_VARS_NR_UE *ue, + uint8_t eNB_offset, + unsigned int Ns, + unsigned int *nr_gold_pdcch, + int32_t *output, + unsigned short p, + unsigned short nb_rb_coreset) +{ uint8_t idx=0; //uint8_t pdcch_rb_offset =0; //nr_gold_pdcch += ((int)floor(ue->frame_parms.ssb_start_subcarrier/12)+pdcch_rb_offset)*3/32; @@ -121,8 +120,8 @@ int nr_pdcch_dmrs_rx(PHY_VARS_NR_UE *ue, ((int16_t*)output)[(i<<1)+1] = nr_rx_mod_table[((NR_MOD_TABLE_QPSK_OFFSET + idx)<<1) + 1]; #ifdef DEBUG_PDCCH if (i<8) - printf("i %d idx %d pdcch gold %u 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)[(i<<1)+1],&output[0]); + printf("i %d idx %d pdcch gold %u b0-b1 %d-%d mod_dmrs %d %d addr %p\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)[(i<<1)+1],&output[0]); #endif } } @@ -130,7 +129,10 @@ int nr_pdcch_dmrs_rx(PHY_VARS_NR_UE *ue, return(0); } -int nr_pbch_dmrs_rx(int symbol,unsigned int *nr_gold_pbch,int32_t *output ) + +int nr_pbch_dmrs_rx(int symbol, + unsigned int *nr_gold_pbch, + int32_t *output) { int m,m0,m1; uint8_t idx=0; @@ -164,6 +166,3 @@ int nr_pbch_dmrs_rx(int symbol,unsigned int *nr_gold_pbch,int32_t *output ) return(0); } - - - diff --git a/openair1/PHY/NR_REFSIG/ul_ref_seq_nr.c b/openair1/PHY/NR_REFSIG/ul_ref_seq_nr.c index 1a64c8902c..8521a2618f 100644 --- a/openair1/PHY/NR_REFSIG/ul_ref_seq_nr.c +++ b/openair1/PHY/NR_REFSIG/ul_ref_seq_nr.c @@ -54,7 +54,9 @@ * *********************************************************************/ -int16_t *base_sequence_less_than_36(unsigned int M_ZC, unsigned int u, unsigned int scaling) +int16_t *base_sequence_less_than_36(unsigned int M_ZC, + unsigned int u, + unsigned int scaling) { char *phi_table; int16_t *rv_overbar; @@ -77,7 +79,7 @@ int16_t *base_sequence_less_than_36(unsigned int M_ZC, unsigned int u, unsigned case 30: break; default: - printf("function base_sequence_less_than 36_: unsupported base sequence size : %d \n", M_ZC); + printf("function base_sequence_less_than 36_: unsupported base sequence size : %u \n", M_ZC); assert(0); break; } @@ -121,7 +123,10 @@ int16_t *base_sequence_less_than_36(unsigned int M_ZC, unsigned int u, unsigned * *********************************************************************/ -int16_t *base_sequence_36_or_larger(unsigned int Msc_RS, unsigned int u, unsigned int v, unsigned int scaling) +int16_t *base_sequence_36_or_larger(unsigned int Msc_RS, + unsigned int u, + unsigned int v, + unsigned int scaling) { int16_t *rv_overbar; unsigned int N_ZC; diff --git a/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c b/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c index b3ce80d1ae..1667e52d27 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c +++ b/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c @@ -95,7 +95,7 @@ void free_gNB_dlsch(NR_gNB_DLSCH_t *dlsch) dlsch->harq_processes[i]->d[r] = NULL; } - } + } free16(dlsch->harq_processes[i],sizeof(NR_DL_gNB_HARQ_t)); dlsch->harq_processes[i] = NULL; } @@ -103,7 +103,7 @@ void free_gNB_dlsch(NR_gNB_DLSCH_t *dlsch) free16(dlsch,sizeof(NR_gNB_DLSCH_t)); dlsch = NULL; - } + } } @@ -269,10 +269,11 @@ void clean_gNB_dlsch(NR_gNB_DLSCH_t *dlsch) } } -int nr_dlsch_encoding(unsigned char *a,int frame, - uint8_t slot, - NR_gNB_DLSCH_t *dlsch, - NR_DL_FRAME_PARMS* frame_parms) +int nr_dlsch_encoding(unsigned char *a, + int frame, + uint8_t slot, + NR_gNB_DLSCH_t *dlsch, + NR_DL_FRAME_PARMS* frame_parms) { unsigned int G; @@ -418,7 +419,7 @@ int nr_dlsch_encoding(unsigned char *a,int frame, } } #ifdef DEBUG_DLSCH_CODING - printf("Rate Matching, Code segment %d (coded bits (G) %d,unpunctured/repeated bits per code segment %d,mod_order %d, nb_rb %d)...\n", + printf("Rate Matching, Code segment %d (coded bits (G) %u, unpunctured/repeated bits per code segment %d, mod_order %d, nb_rb %d)...\n", r, G, Kr*3, 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 6df9e0c20e..513d49a25e 100644 --- a/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c +++ b/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c @@ -31,11 +31,11 @@ int nr_pbch_dmrs_correlation(PHY_VARS_NR_UE *ue, - uint8_t eNB_offset, - unsigned char Ns, - unsigned char symbol, - int dmrss, - NR_UE_SSB *current_ssb) + uint8_t eNB_offset, + unsigned char Ns, + unsigned char symbol, + int dmrss, + NR_UE_SSB *current_ssb) { int pilot[200] __attribute__((aligned(16))); unsigned char aarx; @@ -149,7 +149,7 @@ int nr_pbch_dmrs_correlation(PHY_VARS_NR_UE *ue, current_ssb->c_im +=ch[1]; #ifdef DEBUG_CH - printf("pilot %d : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt,rxF[0],rxF[1],ch[0],ch[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[0],ch[1],pil[0],pil[1]); #endif pil+=2; @@ -165,7 +165,7 @@ int nr_pbch_dmrs_correlation(PHY_VARS_NR_UE *ue, current_ssb->c_im +=ch[1]; #ifdef DEBUG_CH - printf("pilot %d : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt+1,rxF[0],rxF[1],ch[0],ch[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[0],ch[1],pil[0],pil[1]); #endif pil+=2; //re_offset = (re_offset+4)&(ue->frame_parms.ofdm_symbol_size-1); @@ -180,7 +180,7 @@ int nr_pbch_dmrs_correlation(PHY_VARS_NR_UE *ue, current_ssb->c_im +=ch[1]; #ifdef DEBUG_CH - printf("pilot %d : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt+2,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]); + printf("pilot %u : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt+2,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]); #endif pil+=2; @@ -199,12 +199,12 @@ int nr_pbch_dmrs_correlation(PHY_VARS_NR_UE *ue, int nr_pbch_channel_estimation(PHY_VARS_NR_UE *ue, - uint8_t eNB_offset, - unsigned char Ns, - unsigned char symbol, - int dmrss, - uint8_t ssb_index, - uint8_t n_hf) + uint8_t eNB_offset, + unsigned char Ns, + unsigned char symbol, + int dmrss, + uint8_t ssb_index, + uint8_t n_hf) { int pilot[200] __attribute__((aligned(16))); unsigned char aarx; @@ -367,7 +367,7 @@ int nr_pbch_channel_estimation(PHY_VARS_NR_UE *ue, ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15); #ifdef DEBUG_CH - printf("pilot %d : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt,rxF[0],rxF[1],ch[0],ch[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[0],ch[1],pil[0],pil[1]); #endif multadd_real_vector_complex_scalar(fl, ch, @@ -387,7 +387,7 @@ int nr_pbch_channel_estimation(PHY_VARS_NR_UE *ue, ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15); #ifdef DEBUG_CH - printf("pilot %d : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt+1,rxF[0],rxF[1],ch[0],ch[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[0],ch[1],pil[0],pil[1]); #endif multadd_real_vector_complex_scalar(fm, ch, @@ -403,7 +403,7 @@ int nr_pbch_channel_estimation(PHY_VARS_NR_UE *ue, ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15); #ifdef DEBUG_CH - printf("pilot %d : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt+2,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]); + printf("pilot %u : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt+2,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]); #endif multadd_real_vector_complex_scalar(fr, @@ -426,11 +426,11 @@ int nr_pbch_channel_estimation(PHY_VARS_NR_UE *ue, } int nr_pdcch_channel_estimation(PHY_VARS_NR_UE *ue, - uint8_t eNB_offset, - unsigned char Ns, - unsigned char symbol, - unsigned short coreset_start_subcarrier, - unsigned short nb_rb_coreset) + uint8_t eNB_offset, + unsigned char Ns, + unsigned char symbol, + unsigned short coreset_start_subcarrier, + unsigned short nb_rb_coreset) { int pilot[200] __attribute__((aligned(16))); unsigned char aarx,p; @@ -550,7 +550,7 @@ int nr_pdcch_channel_estimation(PHY_VARS_NR_UE *ue, ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15); ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15); #ifdef DEBUG_PDCCH - printf("pilot %d : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt,rxF[0],rxF[1],ch[0],ch[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[0],ch[1],pil[0],pil[1]); #endif multadd_real_vector_complex_scalar(fl, ch, @@ -566,7 +566,7 @@ int nr_pdcch_channel_estimation(PHY_VARS_NR_UE *ue, ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15); ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15); #ifdef DEBUG_PDCCH - printf("pilot %d : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt+1,rxF[0],rxF[1],ch[0],ch[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[0],ch[1],pil[0],pil[1]); #endif multadd_real_vector_complex_scalar(fm, ch, @@ -656,14 +656,13 @@ int nr_pdcch_channel_estimation(PHY_VARS_NR_UE *ue, } int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue, - uint8_t eNB_offset, - unsigned char Ns, - unsigned short p, - unsigned char symbol, - unsigned short bwp_start_subcarrier, - unsigned short nb_rb_pdsch) + uint8_t eNB_offset, + unsigned char Ns, + unsigned short p, + unsigned char symbol, + unsigned short bwp_start_subcarrier, + unsigned short nb_rb_pdsch) { - int pilot[1320] __attribute__((aligned(16))); unsigned char aarx; unsigned short k; @@ -804,7 +803,7 @@ int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue, ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15); ch[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[0],ch[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[0],ch[1],pil[0],pil[1]); #endif multadd_real_vector_complex_scalar(fm, ch, @@ -819,7 +818,7 @@ int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue, ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15); ch[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[0],ch[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[0],ch[1],pil[0],pil[1]); #endif multadd_real_vector_complex_scalar(fmm, ch, @@ -837,7 +836,7 @@ int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue, ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15); ch[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[0],ch[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[0],ch[1],pil[0],pil[1]); #endif multadd_real_vector_complex_scalar(fm, ch, @@ -856,7 +855,7 @@ int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue, ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15); #ifdef DEBUG_PDSCH printf("ch 0 %d\n",((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])); - printf("pilot %d: rxF - > (%d,%d) addr %p ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt+1,rxF[0],rxF[1],&rxF[0],ch[0],ch[1],pil[0],pil[1]); + printf("pilot %u: rxF - > (%d,%d) addr %p ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt+1,rxF[0],rxF[1],&rxF[0],ch[0],ch[1],pil[0],pil[1]); #endif multadd_real_vector_complex_scalar(fmr, ch, @@ -872,7 +871,7 @@ int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue, ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15); ch[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+2,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]); + printf("pilot %u: rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt+2,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]); #endif multadd_real_vector_complex_scalar(fr, ch, diff --git a/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c b/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c index b91a2a5bc4..3f206a679c 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c +++ b/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c @@ -1175,7 +1175,7 @@ void nr_dci_decoding_procedure0(int s, } else { nb_candidates = (L2 == 4) ? 4 : ((L2 == 8)? 2 : 1); // according to Table 10.1-1 (38.213 section 10.1) #ifdef NR_PDCCH_DCI_DEBUG - printf("\t\t<-NR_PDCCH_DCI_DEBUG (nr_dci_decoding_procedure0)-> we are in common searchSpace and nb_candidates=%d for L2=%d\n",nb_candidates,L2); + printf("\t\t<-NR_PDCCH_DCI_DEBUG (nr_dci_decoding_procedure0)-> we are in common searchSpace and nb_candidates=%u for L2=%d\n", nb_candidates, L2); #endif } } else { @@ -1214,7 +1214,7 @@ void nr_dci_decoding_procedure0(int s, } #ifdef NR_PDCCH_DCI_DEBUG - printf("\t\t<-NR_PDCCH_DCI_DEBUG (nr_dci_decoding_procedure0)-> L2(%d) | nCCE[%d](%d) | Yk(%d) | nb_candidates(%d)\n",L2,p,nCCE[p],Yk,nb_candidates); + printf("\t\t<-NR_PDCCH_DCI_DEBUG (nr_dci_decoding_procedure0)-> L2(%d) | nCCE[%d](%d) | Yk(%u) | nb_candidates(%u)\n", L2, p, nCCE[p], Yk, nb_candidates); #endif /* for (CCEind=0; CCEind m_max_slot_pdcch_Table10_1_2(%d)=%d\n",L,m_max_slot_pdcch_Table10_1_2[L]); + if(0 <= L && L < 4) printf("\t\t<-NR_PDCCH_DCI_DEBUG (nr_dci_decoding_procedure0)-> m_max_slot_pdcch_Table10_1_2(%d)=%d\n",L,m_max_slot_pdcch_Table10_1_2[L]); #endif for (m = 0; m < nb_candidates; m++) { @@ -1236,16 +1236,16 @@ void nr_dci_decoding_procedure0(int s, if (nCCE[p] < L2) return; #ifdef NR_PDCCH_DCI_DEBUG - int debug1 = nCCE[p] / L2; - int debug2 = L2*m_p_s_L_max; - printf("\t\t<-NR_PDCCH_DCI_DEBUG (nr_dci_decoding_procedure0)-> debug1(%d)=nCCE[p]/L2 | nCCE[%d](%d) | L2(%d)\n",debug1,p,nCCE[p],L2); - printf("\t\t<-NR_PDCCH_DCI_DEBUG (nr_dci_decoding_procedure0)-> debug2(%d)=L2*m_p_s_L_max | L2(%d) | m_p_s_L_max(%d)\n",debug2,L2,m_p_s_L_max); + int debug1 = nCCE[p] / L2; + int debug2 = L2*m_p_s_L_max; + printf("\t\t<-NR_PDCCH_DCI_DEBUG (nr_dci_decoding_procedure0)-> debug1(%d)=nCCE[p]/L2 | nCCE[%d](%d) | L2(%d)\n",debug1,p,nCCE[p],L2); + printf("\t\t<-NR_PDCCH_DCI_DEBUG (nr_dci_decoding_procedure0)-> debug2(%d)=L2*m_p_s_L_max | L2(%d) | m_p_s_L_max(%d)\n",debug2,L2,m_p_s_L_max); #endif - CCEind = (((Yk + (uint16_t)(floor((m*nCCE[p])/(L2*m_p_s_L_max))) + n_ci) % (uint16_t)(floor(nCCE[p] / L2))) * L2); + CCEind = (((Yk + (uint16_t)(floor((m*nCCE[p])/(L2*m_p_s_L_max))) + n_ci) % (uint16_t)(floor(nCCE[p] / L2))) * L2); #ifdef NR_PDCCH_DCI_DEBUG - printf ("\t\t<-NR_PDCCH_DCI_DEBUG (nr_dci_decoding_procedure0)-> CCEind(%d) = (((Yk(%d) + ((m(%d)*nCCE[p](%d))/(L2(%d)*m_p_s_L_max(%d)))) % (nCCE[p] / L2)) * L2)\n", + printf("\t\t<-NR_PDCCH_DCI_DEBUG (nr_dci_decoding_procedure0)-> CCEind(%d) = (((Yk(%u) + ((m(%u)*nCCE[p](%d))/(L2(%d)*m_p_s_L_max(%d)))) %% (nCCE[p] / L2)) * L2)\n", CCEind,Yk,m,nCCE[p],L2,m_p_s_L_max); - printf ("\t\t<-NR_PDCCH_DCI_DEBUG (nr_dci_decoding_procedure0)-> n_candidate(m)=%d | CCEind=%d |",m,CCEind); + printf("\t\t<-NR_PDCCH_DCI_DEBUG (nr_dci_decoding_procedure0)-> n_candidate(m)=%u | CCEind=%d |",m,CCEind); #endif if (CCEind < 32) @@ -1254,7 +1254,7 @@ void nr_dci_decoding_procedure0(int s, CCEmap = CCEmap1; else if (CCEind < 96) CCEmap = CCEmap2; - else AssertFatal(1==0,"Illegal CCEind %d (Yk %d, m %d, nCCE %d, L2 %d\n",CCEind, Yk, m, nCCE[p], L2); + else AssertFatal(1==0,"Illegal CCEind %d (Yk %u, m %u, nCCE %d, L2 %d\n", CCEind, Yk, m, nCCE[p], L2); switch (L2) { case 1: @@ -1286,7 +1286,7 @@ void nr_dci_decoding_procedure0(int s, CCEmap_cand = (*CCEmap) & CCEmap_mask; // CCE is not allocated yet #ifdef NR_PDCCH_DCI_DEBUG - printf ("\t\t<-NR_PDCCH_DCI_DEBUG (nr_dci_decoding_procedure0)-> CCEmap_cand=%d \n",CCEmap_cand); + printf ("\t\t<-NR_PDCCH_DCI_DEBUG (nr_dci_decoding_procedure0)-> CCEmap_cand=%u \n",CCEmap_cand); #endif if (CCEmap_cand == 0) { diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c index 167d7cfbc5..adc7764fd3 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c @@ -379,11 +379,11 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, #if UE_TIMING_TRACE stop_meas(&ue->generic_stat_bis[ue->current_thread_id[nr_tti_rx]][slot]); #if DISABLE_LOG_X - printf("[AbsSFN %d.%d] Slot%d Symbol %d Flag %d type %d: Pilot/Data extraction %5.2f \n",frame,nr_tti_rx,slot, - symbol,ue->high_speed_flag,type,symbol,ue->generic_stat_bis[ue->current_thread_id[nr_tti_rx]][slot].p_time/(cpuf*1000.0)); + printf("[AbsSFN %d.%d] Slot%d Symbol %d Flag %d type %d: Pilot/Data extraction %5.2f \n", + frame,nr_tti_rx,slot,symbol,ue->high_speed_flag,type,ue->generic_stat_bis[ue->current_thread_id[nr_tti_rx]][slot].p_time/(cpuf*1000.0)); #else - LOG_I(PHY, "[AbsSFN %d.%d] Slot%d Symbol %d Flag %d type %d: Pilot/Data extraction %5.2f \n",frame,nr_tti_rx,slot,symbol, - ue->high_speed_flag,type,ue->generic_stat_bis[ue->current_thread_id[nr_tti_rx]][slot].p_time/(cpuf*1000.0)); + LOG_I(PHY, "[AbsSFN %d.%d] Slot%d Symbol %d Flag %d type %d: Pilot/Data extraction %5.2f \n", + frame,nr_tti_rx,slot,symbol,ue->high_speed_flag,type,ue->generic_stat_bis[ue->current_thread_id[nr_tti_rx]][slot].p_time/(cpuf*1000.0)); #endif #endif diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c b/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c index cac9ae92ac..85e76d5177 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c @@ -93,7 +93,7 @@ uint16_t nr_pbch_extract(int **rxdataF, (i!=(nushiftmod4+8))) { rxF_ext[j]=rxF[rx_offset]; #ifdef DEBUG_PBCH - printf("rxF ext[%d] = (%d,%d) rxF [%d]= (%d,%d)\n",(9*rb) + j, + printf("rxF ext[%d] = (%d,%d) rxF [%u]= (%d,%d)\n",(9*rb) + j, ((int16_t *)&rxF_ext[j])[0], ((int16_t *)&rxF_ext[j])[1], rx_offset, @@ -116,7 +116,7 @@ uint16_t nr_pbch_extract(int **rxdataF, (i!=(nushiftmod4+8))) { rxF_ext[j]=rxF[rx_offset]; #ifdef DEBUG_PBCH - printf("rxF ext[%d] = (%d,%d) rxF [%d]= (%d,%d)\n",(rb<4) ? (9*rb) + j : (9*(rb-12))+j, + printf("rxF ext[%d] = (%d,%d) rxF [%u]= (%d,%d)\n",(rb<4) ? (9*rb) + j : (9*(rb-12))+j, ((int16_t *)&rxF_ext[j])[0], ((int16_t *)&rxF_ext[j])[1], rx_offset, diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c index 5c8493c370..bc1f9548d4 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c @@ -44,8 +44,7 @@ void free_nr_ue_ulsch(NR_UE_ULSCH_t *ulsch) { - int i; - int r; + int i, r; if (ulsch) { #ifdef DEBUG_ULSCH_FREE @@ -87,10 +86,10 @@ void free_nr_ue_ulsch(NR_UE_ULSCH_t *ulsch) } - -NR_UE_ULSCH_t *new_nr_ue_ulsch(unsigned char N_RB_UL, int number_of_harq_pids, uint8_t abstraction_flag) +NR_UE_ULSCH_t *new_nr_ue_ulsch(unsigned char N_RB_UL, + int number_of_harq_pids, + uint8_t abstraction_flag) { - NR_UE_ULSCH_t *ulsch; unsigned char exit_flag = 0,i,r; unsigned char bw_scaling =1; @@ -187,12 +186,10 @@ NR_UE_ULSCH_t *new_nr_ue_ulsch(unsigned char N_RB_UL, int number_of_harq_pids, u } - int nr_ulsch_encoding(NR_UE_ULSCH_t *ulsch, - NR_DL_FRAME_PARMS* frame_parms, - uint8_t harq_pid) + NR_DL_FRAME_PARMS* frame_parms, + uint8_t harq_pid) { - /////////////////////////parameters and variables declaration///////////////////////// /////////// @@ -376,7 +373,7 @@ int nr_ulsch_encoding(NR_UE_ULSCH_t *ulsch, } #ifdef DEBUG_DLSCH_CODING - printf("Rate Matching, Code segment %d (coded bits (G) %d,unpunctured/repeated bits per code segment %d,mod_order %d, nb_rb %d)...\n", + printf("Rate Matching, Code segment %d (coded bits (G) %u, unpunctured/repeated bits per code segment %d, mod_order %d, nb_rb %d)...\n", r, G, Kr*3, diff --git a/openair1/PHY/NR_UE_TRANSPORT/pss_nr.c b/openair1/PHY/NR_UE_TRANSPORT/pss_nr.c index c9fb300706..b13cd008b5 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/pss_nr.c +++ b/openair1/PHY/NR_UE_TRANSPORT/pss_nr.c @@ -234,8 +234,8 @@ void generate_pss_nr(NR_DL_FRAME_PARMS *fp,int N_ID_2) if (N_ID_2 == 0) { char output_file[255]; char sequence_name[255]; - sprintf(output_file, "pss_seq_%d_%d.m", N_ID_2, length); - sprintf(sequence_name, "pss_seq_%d_%d", N_ID_2, length); + sprintf(output_file, "pss_seq_%d_%u.m", N_ID_2, length); + sprintf(sequence_name, "pss_seq_%d_%u", N_ID_2, length); printf("file %s sequence %s\n", output_file, sequence_name); LOG_M(output_file, sequence_name, primary_synchro, LENGTH_PSS_NR, 1, 1); @@ -298,14 +298,14 @@ void generate_pss_nr(NR_DL_FRAME_PARMS *fp,int N_ID_2) if (N_ID_2 == 0) { char output_file[255]; char sequence_name[255]; - sprintf(output_file, "%s%d_%d%s","pss_seq_t_", N_ID_2, length, ".m"); - sprintf(sequence_name, "%s%d_%d","pss_seq_t_", N_ID_2, length); + sprintf(output_file, "%s%d_%u%s","pss_seq_t_", N_ID_2, length, ".m"); + sprintf(sequence_name, "%s%d_%u","pss_seq_t_", N_ID_2, length); printf("file %s sequence %s\n", output_file, sequence_name); LOG_M(output_file, sequence_name, primary_synchro_time, length, 1, 1); - sprintf(output_file, "%s%d_%d%s","pss_seq_f_", N_ID_2, length, ".m"); - sprintf(sequence_name, "%s%d_%d","pss_seq_f_", N_ID_2, length); + sprintf(output_file, "%s%d_%u%s","pss_seq_f_", N_ID_2, length, ".m"); + sprintf(sequence_name, "%s%d_%u","pss_seq_f_", N_ID_2, length); LOG_M(output_file, sequence_name, synchroF_tmp, length, 1, 1); } @@ -900,7 +900,7 @@ int pss_search_time_nr(int **rxdata, ///rx data in time domain pss_source = pss_index; #ifdef DEBUG_PSS_NR - printf("pss_index %d: n %6d peak_value %15llu\n", pss_index, n, (unsigned long long)pss_corr_ue[pss_index][n]); + printf("pss_index %d: n %6u peak_value %15llu\n", pss_index, n, (unsigned long long)pss_corr_ue[pss_index][n]); #endif } } diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c index 73b66c539f..308dc6d1c0 100644 --- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c +++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c @@ -3044,7 +3044,7 @@ int nr_ue_pdcch_procedures(uint8_t eNB_id, &format_found, crc_scrambled_values); #ifdef NR_PDCCH_SCHED_DEBUG - printf("<-NR_PDCCH_PHY_PROCEDURES_LTE_UE (nr_ue_pdcch_procedures)-> Ending function nr_dci_decoding_procedure() -> dci_cnt=%d\n",dci_cnt); + printf("<-NR_PDCCH_PHY_PROCEDURES_LTE_UE (nr_ue_pdcch_procedures)-> Ending function nr_dci_decoding_procedure() -> dci_cnt=%u\n",dci_cnt); #endif VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DCI_DECODING, VCD_FUNCTION_OUT); diff --git a/openair1/SCHED_NR_UE/pucch_uci_ue_nr.c b/openair1/SCHED_NR_UE/pucch_uci_ue_nr.c index 93059c00e0..21886418b0 100644 --- a/openair1/SCHED_NR_UE/pucch_uci_ue_nr.c +++ b/openair1/SCHED_NR_UE/pucch_uci_ue_nr.c @@ -922,7 +922,7 @@ boolean_t select_pucch_resource(PHY_VARS_NR_UE *ue, uint8_t gNB_id, int uci_size /* a valid resource has already be found outside this function */ resource_set_found = TRUE; ready_pucch_resource_id = TRUE; - pucch_resource_indicator = pucch_resource_indicator; + //pucch_resource_indicator = pucch_resource_indicator; } if (resource_set_found == TRUE) { diff --git a/openair1/SIMULATION/NR_PHY/dlschsim.c b/openair1/SIMULATION/NR_PHY/dlschsim.c index 09ef2ff3f3..a1b99cbe62 100644 --- a/openair1/SIMULATION/NR_PHY/dlschsim.c +++ b/openair1/SIMULATION/NR_PHY/dlschsim.c @@ -427,7 +427,7 @@ int main(int argc, char **argv) mod_order = nr_get_Qm(Imcs, 1); available_bits = nr_get_G(nb_rb, nb_symb_sch, nb_re_dmrs, length_dmrs, mod_order, 1); TBS = nr_compute_tbs(Imcs, nb_rb, nb_symb_sch, nb_re_dmrs, length_dmrs, Nl); - printf("available bits %d TBS %d mod_order %d\n", available_bits, TBS, mod_order); + printf("available bits %u TBS %u mod_order %d\n", available_bits, TBS, mod_order); //dlsch->harq_ids[subframe]= 0; rel15->n_prb = nb_rb; rel15->nb_symbols = nb_symb_sch; @@ -463,7 +463,7 @@ int main(int argc, char **argv) //estimated_output = harq_process->b; #ifdef DEBUG_NR_DLSCHSIM - for (i = 0; i < TBS / 8; i++) printf("test_input[i]=%d \n",test_input[i]); + for (i = 0; i < TBS / 8; i++) printf("test_input[i]=%hhu \n",test_input[i]); #endif /*for (int i=0; i 0) { n_false_positive++; if (n_trials == 1) - printf("errors_bit %d (trial %d)\n", errors_bit, trial); + printf("errors_bit %u (trial %d)\n", errors_bit, trial); } } diff --git a/openair1/SIMULATION/NR_PHY/ulschsim.c b/openair1/SIMULATION/NR_PHY/ulschsim.c index b3f769fef0..ed5ee73769 100644 --- a/openair1/SIMULATION/NR_PHY/ulschsim.c +++ b/openair1/SIMULATION/NR_PHY/ulschsim.c @@ -386,8 +386,8 @@ int main(int argc, char **argv) mod_order = nr_get_Qm(Imcs, 1); available_bits = nr_get_G(nb_rb, nb_symb_sch, nb_re_dmrs, length_dmrs, mod_order, 1); TBS = nr_compute_tbs(Imcs, nb_rb, nb_symb_sch, nb_re_dmrs, length_dmrs, Nl); - printf("\n"); - printf("available bits %d TBS %d mod_order %d\n", available_bits, TBS, mod_order); + + printf("\nAvailable bits %u TBS %u mod_order %d\n", available_bits, TBS, mod_order); /////////// setting rel15_ul parameters /////////// rel15_ul->number_rbs = nb_rb; @@ -449,7 +449,7 @@ int main(int argc, char **argv) //////////////////////////////////////////////////////////////////////////////////////////// #ifdef DEBUG_NR_ULSCHSIM - for (i = 0; i < TBS / 8; i++) printf("test_input[i]=%d \n",test_input[i]); + for (i = 0; i < TBS / 8; i++) printf("test_input[i]=%hhu \n",test_input[i]); #endif /////////////////////////ULSCH coding///////////////////////// @@ -536,7 +536,7 @@ int main(int argc, char **argv) if (errors_bit > 0) { n_false_positive++; if (n_trials == 1) - printf("errors_bit %d (trial %d)\n", errors_bit, trial); + printf("errors_bit %u (trial %d)\n", errors_bit, trial); } printf("\n"); } diff --git a/openair1/SIMULATION/NR_PHY/ulsim.c b/openair1/SIMULATION/NR_PHY/ulsim.c index d71bea59f0..85fec505e0 100644 --- a/openair1/SIMULATION/NR_PHY/ulsim.c +++ b/openair1/SIMULATION/NR_PHY/ulsim.c @@ -539,7 +539,7 @@ int main(int argc, char **argv) if (errors_bit > 0) { n_false_positive++; if (n_trials == 1) - printf("errors_bit = %d (trial %d)\n", errors_bit, trial); + printf("errors_bit = %u (trial %d)\n", errors_bit, trial); } printf("\n"); } // [hna] for (trial = 0; trial < n_trials; trial++) diff --git a/targets/RT/USER/lte-hwlat.c b/targets/RT/USER/lte-hwlat.c index 3fb4b0e99e..20482adf87 100755 --- a/targets/RT/USER/lte-hwlat.c +++ b/targets/RT/USER/lte-hwlat.c @@ -187,7 +187,7 @@ int32_t **txdata; int setup_ue_buffers(PHY_VARS_UE **phy_vars_ue, openair0_config_t *openair0_cfg); -static inline void saif_meas(int frame_rx, int subframe_rx) { +static inline void saif_meas(unsigned int frame_rx, unsigned int subframe_rx) { static latency_stat_t __thread latency_stat; static struct timespec __thread last= {0}; struct timespec now; @@ -238,7 +238,7 @@ static inline void saif_meas(int frame_rx, int subframe_rx) { if ( (diffTime>=1500) || ( !(frame_rx%1024) && subframe_rx == 0 ) ) { time_t current=time(NULL); printf("\n"); - printf("%.2f Period stats cnt=%7.7ld 0.. 250=%7.7ld 250.. 500=%7.7ld 500.. 600=%7.7ld 600.. 700=%7.7ld 700.. 800=%7.7ld - (frame_rx=%d) - %s", + printf("%.2f Period stats cnt=%7.7ld 0.. 250=%7.7ld 250.. 500=%7.7ld 500.. 600=%7.7ld 600.. 700=%7.7ld 700.. 800=%7.7ld - (frame_rx=%u) - %s", now.tv_sec+(double)now.tv_nsec/1e9, latency_stat.counter, latency_stat.stat250, latency_stat.stat500, @@ -246,7 +246,7 @@ static inline void saif_meas(int frame_rx, int subframe_rx) { latency_stat.stat800, frame_rx, ctime(¤t)); - printf("%.2f Period stats cnt=%7.7ld 800.. 880=%7.7ld 880.. 960=%7.7ld 960..1040=%7.7ld 1040..1120=%7.7ld 1120..1200=%7.7ld - (frame_rx=%d) - %s", + printf("%.2f Period stats cnt=%7.7ld 800.. 880=%7.7ld 880.. 960=%7.7ld 960..1040=%7.7ld 1040..1120=%7.7ld 1120..1200=%7.7ld - (frame_rx=%u) - %s", now.tv_sec+(double)now.tv_nsec/1e9, latency_stat.counter, latency_stat.stat880, latency_stat.stat960, @@ -254,7 +254,7 @@ static inline void saif_meas(int frame_rx, int subframe_rx) { latency_stat.stat1200, frame_rx, ctime(¤t)); - printf("%.2f Period stats cnt=%7.7ld 1200..1300=%7.7ld 1300..1500=%7.7ld 1500..2000=%7.7ld 2000..2500=%7.7ld >3000=%7.7ld - (frame_rx=%d) - %s", + printf("%.2f Period stats cnt=%7.7ld 1200..1300=%7.7ld 1300..1500=%7.7ld 1500..2000=%7.7ld 2000..2500=%7.7ld >3000=%7.7ld - (frame_rx=%u) - %s", now.tv_sec+(double)now.tv_nsec/1e9, latency_stat.counter, latency_stat.stat1300, latency_stat.stat1500, @@ -326,7 +326,7 @@ int main(void) openair0_device rf_device; openair0_timestamp timestamp = 0; - int sub_frame = 0; + unsigned int sub_frame = 0; unsigned int frame_rx = 0; unsigned int nb_antennas_tx = 1; @@ -922,7 +922,7 @@ int main(void) rxp[0] = (void*)&rxdata[0][sub_frame*nb_sample_per_tti]; - readBlockSize = rf_device.trx_read_func( &rf_device, + readBlockSize = rf_device.trx_read_func(&rf_device, ×tamp, rxp, nb_sample_per_tti, diff --git a/targets/RT/USER/lte-hwlat2.c b/targets/RT/USER/lte-hwlat2.c index 67761be9a7..57d2dbaad1 100644 --- a/targets/RT/USER/lte-hwlat2.c +++ b/targets/RT/USER/lte-hwlat2.c @@ -670,7 +670,7 @@ void *UE_thread(void *arg) { { proc = rxtx_proc[i]; pthread_getname_np(proc->pthread_rxtx,threadname,128 ); - printf("RxTX Thread unlock latency on thread %s (it. %ld) (us) : max=%8.3f - mean=%8.3f - min=%8.3f\n", + printf("RxTX Thread unlock latency on thread %s (it. %lu) (us) : max=%8.3f - mean=%8.3f - min=%8.3f\n", threadname, proc->syr_rdtsc_rxtx_th_unlock_iteration, proc->syr_rdtsc_rxtx_th_unlock_max, @@ -1192,9 +1192,9 @@ void histogram_save_in_csv( histo_time_t *histo , char *file_sufix) for ( i = 0; i < HISTOGRAM_SIZE; i++ ) { if ( i + 1 == HISTOGRAM_SIZE ) - fprintf( fp, "%u+;%u\n", min_val, histo[i].count ); + fprintf( fp, "%d+;%u\n", min_val, histo[i].count ); else - fprintf( fp, "%u-%.0f;%u\n", min_val, histo[i].max, histo[i].count ); + fprintf( fp, "%d-%.0f;%u\n", min_val, histo[i].max, histo[i].count ); min_val = histo[i].max; }