Commit 852a6c4f authored by Robert Schmidt's avatar Robert Schmidt

Remove write-only variables

parent ca4b438d
...@@ -82,7 +82,7 @@ endif() ...@@ -82,7 +82,7 @@ endif()
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS Debug Release RelWithDebInfo MinSizeRel) set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS Debug Release RelWithDebInfo MinSizeRel)
# #
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse4.2 -std=gnu99 -Wall -Wstrict-prototypes -fno-strict-aliasing -rdynamic -funroll-loops -Wno-packed-bitfield-compat ") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse4.2 -std=gnu99 -Wall -Wstrict-prototypes -fno-strict-aliasing -rdynamic -funroll-loops")
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -ggdb -DMALLOC_CHECK_=3") set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -ggdb -DMALLOC_CHECK_=3")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -ggdb -DMALLOC_CHECK_=3 -O2") set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -ggdb -DMALLOC_CHECK_=3 -O2")
......
...@@ -10,7 +10,7 @@ add_definitions(-std=gnu99) ...@@ -10,7 +10,7 @@ add_definitions(-std=gnu99)
ENABLE_LANGUAGE(C) ENABLE_LANGUAGE(C)
set(CMAKE_C_FLAGS set(CMAKE_C_FLAGS
"${CMAKE_C_FLAGS} ${C_FLAGS_PROCESSOR} -Werror -Wall -Wstrict-prototypes -Wno-packed-bitfield-compat -g") "${CMAKE_C_FLAGS} ${C_FLAGS_PROCESSOR} -Werror -Wall -Wstrict-prototypes -g")
set(OPENAIR_DIR $ENV{OPENAIR_DIR}) set(OPENAIR_DIR $ENV{OPENAIR_DIR})
set(OPENAIR3_DIR $ENV{OPENAIR_DIR}/openair3) set(OPENAIR3_DIR $ENV{OPENAIR_DIR}/openair3)
......
...@@ -29,7 +29,6 @@ int main(int argc, char *argv[]) ...@@ -29,7 +29,6 @@ int main(int argc, char *argv[])
uint32_t decoderState=0, blockErrorState=0; //0 = Success, -1 = Decoding failed, 1 = Block Error. uint32_t decoderState=0, blockErrorState=0; //0 = Success, -1 = Decoding failed, 1 = Block Error.
uint16_t testLength = NR_POLAR_PBCH_PAYLOAD_BITS, coderLength = NR_POLAR_PBCH_E; uint16_t testLength = NR_POLAR_PBCH_PAYLOAD_BITS, coderLength = NR_POLAR_PBCH_E;
uint16_t blockErrorCumulative=0, bitErrorCumulative=0; uint16_t blockErrorCumulative=0, bitErrorCumulative=0;
double timeEncoderCumulative = 0, timeDecoderCumulative = 0;
uint8_t aggregation_level = 8, decoderListSize = 8, logFlag = 0; uint8_t aggregation_level = 8, decoderListSize = 8, logFlag = 0;
uint16_t rnti=0; uint16_t rnti=0;
...@@ -326,8 +325,6 @@ int main(int argc, char *argv[]) ...@@ -326,8 +325,6 @@ int main(int argc, char *argv[])
#endif #endif
//Iteration times are in microseconds. //Iteration times are in microseconds.
timeEncoderCumulative+=(timeEncoder.diff/(get_cpu_freq_GHz()*1000.0));
timeDecoderCumulative+=(timeDecoder.diff/(get_cpu_freq_GHz()*1000.0));
if (logFlag) fprintf(logFile,",%f,%d,%u,%f,%f\n", SNR, nBitError, blockErrorState, (timeEncoder.diff/(get_cpu_freq_GHz()*1000.0)), (timeDecoder.diff/(get_cpu_freq_GHz()*1000.0))); if (logFlag) fprintf(logFile,",%f,%d,%u,%f,%f\n", SNR, nBitError, blockErrorState, (timeEncoder.diff/(get_cpu_freq_GHz()*1000.0)), (timeDecoder.diff/(get_cpu_freq_GHz()*1000.0)));
if (nBitError<0) { if (nBitError<0) {
...@@ -351,14 +348,11 @@ int main(int argc, char *argv[]) ...@@ -351,14 +348,11 @@ int main(int argc, char *argv[])
decoderListSize, SNR, ((double)blockErrorCumulative/iterations), decoderListSize, SNR, ((double)blockErrorCumulative/iterations),
((double)bitErrorCumulative / (iterations*testLength)), ((double)bitErrorCumulative / (iterations*testLength)),
(double)timeEncoder.diff/timeEncoder.trials/(get_cpu_freq_GHz()*1000.0),(double)timeDecoder.diff/timeDecoder.trials/(get_cpu_freq_GHz()*1000.0)); (double)timeEncoder.diff/timeEncoder.trials/(get_cpu_freq_GHz()*1000.0),(double)timeDecoder.diff/timeDecoder.trials/(get_cpu_freq_GHz()*1000.0));
//(timeEncoderCumulative/iterations),timeDecoderCumulative/iterations);
if (blockErrorCumulative==0 && bitErrorCumulative==0) break; if (blockErrorCumulative==0 && bitErrorCumulative==0) break;
blockErrorCumulative = 0; blockErrorCumulative = 0;
bitErrorCumulative = 0; bitErrorCumulative = 0;
timeEncoderCumulative = 0;
timeDecoderCumulative = 0;
} }
print_meas(&timeEncoder,"polar_encoder",NULL,NULL); print_meas(&timeEncoder,"polar_encoder",NULL,NULL);
......
...@@ -174,7 +174,7 @@ uint32_t sub_block_interleaving_cc(uint32_t D, uint8_t *d,uint8_t *w) { ...@@ -174,7 +174,7 @@ uint32_t sub_block_interleaving_cc(uint32_t D, uint8_t *d,uint8_t *w) {
void sub_block_deinterleaving_turbo(uint32_t D,int16_t *d,int16_t *w) { void sub_block_deinterleaving_turbo(uint32_t D,int16_t *d,int16_t *w) {
uint32_t RTC = (D>>5), ND, ND3; uint32_t RTC = (D>>5), ND, ND3;
uint32_t row,col,Kpi,index; uint32_t row,col,Kpi;
uint32_t index3,k,k2; uint32_t index3,k,k2;
int16_t *d1,*d2,*d3; int16_t *d1,*d2,*d3;
...@@ -200,7 +200,6 @@ void sub_block_deinterleaving_turbo(uint32_t D,int16_t *d,int16_t *w) { ...@@ -200,7 +200,6 @@ void sub_block_deinterleaving_turbo(uint32_t D,int16_t *d,int16_t *w) {
#ifdef RM_DEBUG2 #ifdef RM_DEBUG2
printf("Col %d\n",col); printf("Col %d\n",col);
#endif #endif
index = bitrev[col];
index3 = bitrev_x3[col];//3*index; index3 = bitrev_x3[col];//3*index;
for (row=0; row<RTC; row++) { for (row=0; row<RTC; row++) {
...@@ -208,7 +207,6 @@ void sub_block_deinterleaving_turbo(uint32_t D,int16_t *d,int16_t *w) { ...@@ -208,7 +207,6 @@ void sub_block_deinterleaving_turbo(uint32_t D,int16_t *d,int16_t *w) {
d2[index3] = w[Kpi+k2]; d2[index3] = w[Kpi+k2];
d3[index3] = w[Kpi+1+k2]; d3[index3] = w[Kpi+1+k2];
index3+=96; index3+=96;
index+=32;
k++; k++;
k2++; k2++;
k2++; k2++;
......
...@@ -771,7 +771,6 @@ void ulsch_correct_ext(int32_t **rxdataF_ext, ...@@ -771,7 +771,6 @@ void ulsch_correct_ext(int32_t **rxdataF_ext,
void ulsch_channel_compensation(int32_t **rxdataF_ext, void ulsch_channel_compensation(int32_t **rxdataF_ext,
int32_t **ul_ch_estimates_ext, int32_t **ul_ch_estimates_ext,
int32_t **ul_ch_mag, int32_t **ul_ch_mag,
int32_t **ul_ch_magb,
int32_t **rxdataF_comp, int32_t **rxdataF_comp,
LTE_DL_FRAME_PARMS *frame_parms, LTE_DL_FRAME_PARMS *frame_parms,
uint8_t symbol, uint8_t symbol,
...@@ -780,13 +779,13 @@ void ulsch_channel_compensation(int32_t **rxdataF_ext, ...@@ -780,13 +779,13 @@ void ulsch_channel_compensation(int32_t **rxdataF_ext,
uint8_t output_shift) { uint8_t output_shift) {
uint16_t rb; uint16_t rb;
#if defined(__x86_64__) || defined(__i386__) #if defined(__x86_64__) || defined(__i386__)
__m128i *ul_ch128,*ul_ch_mag128,*ul_ch_mag128b,*rxdataF128,*rxdataF_comp128; __m128i *ul_ch128,*ul_ch_mag128,*rxdataF128,*rxdataF_comp128;
uint8_t aarx;//,symbol_mod; uint8_t aarx;//,symbol_mod;
__m128i mmtmpU0,mmtmpU1,mmtmpU2,mmtmpU3; __m128i mmtmpU0,mmtmpU1,mmtmpU2,mmtmpU3;
#elif defined(__arm__) || defined(__aarch64__) #elif defined(__arm__) || defined(__aarch64__)
int16x4_t *ul_ch128,*rxdataF128; int16x4_t *ul_ch128,*rxdataF128;
int16x8_t *ul_ch_mag128,*ul_ch_mag128b,*rxdataF_comp128; int16x8_t *ul_ch_mag128,*rxdataF_comp128;
uint8_t aarx;//,symbol_mod; uint8_t aarx;//,symbol_mod;
int32x4_t mmtmpU0,mmtmpU1,mmtmpU0b,mmtmpU1b; int32x4_t mmtmpU0,mmtmpU1,mmtmpU0b,mmtmpU1b;
int16_t conj[4]__attribute__((aligned(16))) = {1,-1,1,-1}; int16_t conj[4]__attribute__((aligned(16))) = {1,-1,1,-1};
...@@ -798,13 +797,11 @@ void ulsch_channel_compensation(int32_t **rxdataF_ext, ...@@ -798,13 +797,11 @@ void ulsch_channel_compensation(int32_t **rxdataF_ext,
#if defined(__x86_64__) || defined(__i386__) #if defined(__x86_64__) || defined(__i386__)
ul_ch128 = (__m128i *)&ul_ch_estimates_ext[aarx][symbol*frame_parms->N_RB_DL*12]; ul_ch128 = (__m128i *)&ul_ch_estimates_ext[aarx][symbol*frame_parms->N_RB_DL*12];
ul_ch_mag128 = (__m128i *)&ul_ch_mag[aarx][symbol*frame_parms->N_RB_DL*12]; ul_ch_mag128 = (__m128i *)&ul_ch_mag[aarx][symbol*frame_parms->N_RB_DL*12];
ul_ch_mag128b = (__m128i *)&ul_ch_magb[aarx][symbol*frame_parms->N_RB_DL*12];
rxdataF128 = (__m128i *)&rxdataF_ext[aarx][symbol*frame_parms->N_RB_DL*12]; rxdataF128 = (__m128i *)&rxdataF_ext[aarx][symbol*frame_parms->N_RB_DL*12];
rxdataF_comp128 = (__m128i *)&rxdataF_comp[aarx][symbol*frame_parms->N_RB_DL*12]; rxdataF_comp128 = (__m128i *)&rxdataF_comp[aarx][symbol*frame_parms->N_RB_DL*12];
#elif defined(__arm__) || defined(__aarch64__) #elif defined(__arm__) || defined(__aarch64__)
ul_ch128 = (int16x4_t *)&ul_ch_estimates_ext[aarx][symbol*frame_parms->N_RB_DL*12]; ul_ch128 = (int16x4_t *)&ul_ch_estimates_ext[aarx][symbol*frame_parms->N_RB_DL*12];
ul_ch_mag128 = (int16x8_t *)&ul_ch_mag[aarx][symbol*frame_parms->N_RB_DL*12]; ul_ch_mag128 = (int16x8_t *)&ul_ch_mag[aarx][symbol*frame_parms->N_RB_DL*12];
ul_ch_mag128b = (int16x8_t *)&ul_ch_magb[aarx][symbol*frame_parms->N_RB_DL*12];
rxdataF128 = (int16x4_t *)&rxdataF_ext[aarx][symbol*frame_parms->N_RB_DL*12]; rxdataF128 = (int16x4_t *)&rxdataF_ext[aarx][symbol*frame_parms->N_RB_DL*12];
rxdataF_comp128 = (int16x8_t *)&rxdataF_comp[aarx][symbol*frame_parms->N_RB_DL*12]; rxdataF_comp128 = (int16x8_t *)&rxdataF_comp[aarx][symbol*frame_parms->N_RB_DL*12];
#endif #endif
...@@ -912,7 +909,6 @@ void ulsch_channel_compensation(int32_t **rxdataF_ext, ...@@ -912,7 +909,6 @@ void ulsch_channel_compensation(int32_t **rxdataF_ext,
ul_ch128+=3; ul_ch128+=3;
ul_ch_mag128+=3; ul_ch_mag128+=3;
ul_ch_mag128b+=3;
rxdataF128+=3; rxdataF128+=3;
rxdataF_comp128+=3; rxdataF_comp128+=3;
#elif defined(__arm__) || defined(__aarch64__) #elif defined(__arm__) || defined(__aarch64__)
...@@ -962,7 +958,6 @@ void ulsch_channel_compensation(int32_t **rxdataF_ext, ...@@ -962,7 +958,6 @@ void ulsch_channel_compensation(int32_t **rxdataF_ext,
ul_ch128+=6; ul_ch128+=6;
ul_ch_mag128+=3; ul_ch_mag128+=3;
ul_ch_mag128b+=3;
rxdataF128+=6; rxdataF128+=6;
rxdataF_comp128+=3; rxdataF_comp128+=3;
#endif #endif
...@@ -1169,7 +1164,6 @@ void rx_ulsch(PHY_VARS_eNB *eNB, ...@@ -1169,7 +1164,6 @@ void rx_ulsch(PHY_VARS_eNB *eNB,
pusch_vars->rxdataF_ext, pusch_vars->rxdataF_ext,
pusch_vars->drs_ch_estimates, pusch_vars->drs_ch_estimates,
pusch_vars->ul_ch_mag, pusch_vars->ul_ch_mag,
pusch_vars->ul_ch_magb,
pusch_vars->rxdataF_comp, pusch_vars->rxdataF_comp,
frame_parms, frame_parms,
l, l,
......
...@@ -4550,12 +4550,11 @@ void dlsch_alamouti(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -4550,12 +4550,11 @@ void dlsch_alamouti(LTE_DL_FRAME_PARMS *frame_parms,
unsigned short nb_rb) { unsigned short nb_rb) {
#if defined(__x86_64__)||defined(__i386__) #if defined(__x86_64__)||defined(__i386__)
short *rxF0,*rxF1; short *rxF0,*rxF1;
__m128i *ch_mag0,*ch_mag1,*ch_mag0b,*ch_mag1b, *rxF0_128; __m128i *ch_mag0,*ch_mag1,*ch_mag0b,*ch_mag1b;
unsigned char rb,re; unsigned char rb,re;
int jj = (symbol*frame_parms->N_RB_DL*12); int jj = (symbol*frame_parms->N_RB_DL*12);
uint8_t symbol_mod = (symbol>=(7-frame_parms->Ncp)) ? symbol-(7-frame_parms->Ncp) : symbol; uint8_t symbol_mod = (symbol>=(7-frame_parms->Ncp)) ? symbol-(7-frame_parms->Ncp) : symbol;
uint8_t pilots = ((symbol_mod==0)||(symbol_mod==(4-frame_parms->Ncp))) ? 1 : 0; uint8_t pilots = ((symbol_mod==0)||(symbol_mod==(4-frame_parms->Ncp))) ? 1 : 0;
rxF0_128 = (__m128i *) &rxdataF_comp[0][jj];
//amp = _mm_set1_epi16(ONE_OVER_2_Q15); //amp = _mm_set1_epi16(ONE_OVER_2_Q15);
// printf("Doing alamouti!\n"); // printf("Doing alamouti!\n");
rxF0 = (short *)&rxdataF_comp[0][jj]; //tx antenna 0 h0*y rxF0 = (short *)&rxdataF_comp[0][jj]; //tx antenna 0 h0*y
...@@ -4590,33 +4589,20 @@ void dlsch_alamouti(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -4590,33 +4589,20 @@ void dlsch_alamouti(LTE_DL_FRAME_PARMS *frame_parms,
//ch_mag0b[0] = _mm_srai_epi16(ch_mag0b[0],1); //ch_mag0b[0] = _mm_srai_epi16(ch_mag0b[0],1);
//ch_mag0b[1] = _mm_srai_epi16(ch_mag0b[1],1); //ch_mag0b[1] = _mm_srai_epi16(ch_mag0b[1],1);
//rxF0_128[0] = _mm_mulhi_epi16(rxF0_128[0],amp);
//rxF0_128[0] = _mm_slli_epi16(rxF0_128[0],1);
//rxF0_128[1] = _mm_mulhi_epi16(rxF0_128[1],amp);
//rxF0_128[1] = _mm_slli_epi16(rxF0_128[1],1);
//rxF0_128[0] = _mm_srai_epi16(rxF0_128[0],1);
//rxF0_128[1] = _mm_srai_epi16(rxF0_128[1],1);
if (pilots==0) { if (pilots==0) {
ch_mag0[2] = _mm_adds_epi16(ch_mag0[2],ch_mag1[2]); ch_mag0[2] = _mm_adds_epi16(ch_mag0[2],ch_mag1[2]);
ch_mag0b[2] = _mm_adds_epi16(ch_mag0b[2],ch_mag1b[2]); ch_mag0b[2] = _mm_adds_epi16(ch_mag0b[2],ch_mag1b[2]);
//ch_mag0[2] = _mm_srai_epi16(ch_mag0[2],1); //ch_mag0[2] = _mm_srai_epi16(ch_mag0[2],1);
//ch_mag0b[2] = _mm_srai_epi16(ch_mag0b[2],1); //ch_mag0b[2] = _mm_srai_epi16(ch_mag0b[2],1);
//rxF0_128[2] = _mm_mulhi_epi16(rxF0_128[2],amp);
//rxF0_128[2] = _mm_slli_epi16(rxF0_128[2],1);
//rxF0_128[2] = _mm_srai_epi16(rxF0_128[2],1);
ch_mag0+=3; ch_mag0+=3;
ch_mag1+=3; ch_mag1+=3;
ch_mag0b+=3; ch_mag0b+=3;
ch_mag1b+=3; ch_mag1b+=3;
rxF0_128+=3;
} else { } else {
ch_mag0+=2; ch_mag0+=2;
ch_mag1+=2; ch_mag1+=2;
ch_mag0b+=2; ch_mag0b+=2;
ch_mag1b+=2; ch_mag1b+=2;
rxF0_128+=2;
} }
} }
......
...@@ -145,7 +145,7 @@ void mch_extract_rbs_khz_1dot25(int **rxdataF, ...@@ -145,7 +145,7 @@ void mch_extract_rbs_khz_1dot25(int **rxdataF,
/*unsigned char symbol,*/ /*unsigned char symbol,*/
unsigned char subframe, unsigned char subframe,
LTE_DL_FRAME_PARMS *frame_parms) { LTE_DL_FRAME_PARMS *frame_parms) {
int i,j,offset,aarx,numext; int i, j, offset, aarx;
if( (subframe&0x1) == 0) { if( (subframe&0x1) == 0) {
offset=0; offset=0;
...@@ -153,8 +153,6 @@ void mch_extract_rbs_khz_1dot25(int **rxdataF, ...@@ -153,8 +153,6 @@ void mch_extract_rbs_khz_1dot25(int **rxdataF,
offset=3; offset=3;
} }
numext=0;
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) { for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
for (i=0,j=0; i<frame_parms->N_RB_DL*72; i++) { for (i=0,j=0; i<frame_parms->N_RB_DL*72; i++) {
if( ((i-offset)%6) != 0 ) { if( ((i-offset)%6) != 0 ) {
...@@ -163,7 +161,6 @@ void mch_extract_rbs_khz_1dot25(int **rxdataF, ...@@ -163,7 +161,6 @@ void mch_extract_rbs_khz_1dot25(int **rxdataF,
rxdataF_ext[aarx][(frame_parms->N_RB_DL*60)+j+0] = rxdataF[aarx][i+1+0]; //DC rxdataF_ext[aarx][(frame_parms->N_RB_DL*60)+j+0] = rxdataF[aarx][i+1+0]; //DC
dl_ch_estimates_ext[aarx][j+0] = dl_ch_estimates[aarx][i+0]; dl_ch_estimates_ext[aarx][j+0] = dl_ch_estimates[aarx][i+0];
dl_ch_estimates_ext[aarx][(frame_parms->N_RB_DL*60)+j+0] = dl_ch_estimates[aarx][i+(frame_parms->N_RB_DL*72)+0]; dl_ch_estimates_ext[aarx][(frame_parms->N_RB_DL*60)+j+0] = dl_ch_estimates[aarx][i+(frame_parms->N_RB_DL*72)+0];
numext+=2;
j++; j++;
} }
} }
......
...@@ -813,7 +813,6 @@ uint8_t nr_ue_get_rach(module_id_t mod_id, ...@@ -813,7 +813,6 @@ uint8_t nr_ue_get_rach(module_id_t mod_id,
uint16_t sdu_lengths[NB_RB_MAX] = {0}; uint16_t sdu_lengths[NB_RB_MAX] = {0};
int TBS_bytes = 848; int TBS_bytes = 848;
int mac_ce_len = 0; int mac_ce_len = 0;
int header_length_total=0;
unsigned short post_padding = 1; unsigned short post_padding = 1;
// fill ulsch_buffer with random data // fill ulsch_buffer with random data
...@@ -823,7 +822,6 @@ uint8_t nr_ue_get_rach(module_id_t mod_id, ...@@ -823,7 +822,6 @@ uint8_t nr_ue_get_rach(module_id_t mod_id,
//Sending SDUs with size 1 //Sending SDUs with size 1
//Initialize elements of sdu_lengths //Initialize elements of sdu_lengths
sdu_lengths[0] = TBS_bytes - 3 - post_padding - mac_ce_len; sdu_lengths[0] = TBS_bytes - 3 - post_padding - mac_ce_len;
header_length_total += 2 + (sdu_lengths[0] >= 128);
size_sdu += sdu_lengths[0]; size_sdu += sdu_lengths[0];
if (size_sdu > 0) { if (size_sdu > 0) {
......
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