Commit 9301bca0 authored by Francesco Mani's avatar Francesco Mani

fix for pucch rx reading rxdataF

parent a53f195b
...@@ -1117,10 +1117,24 @@ void nr_decode_pucch2(PHY_VARS_gNB *gNB, ...@@ -1117,10 +1117,24 @@ void nr_decode_pucch2(PHY_VARS_gNB *gNB,
int16_t rd_im_ext[Prx2][4*pucch_pdu->nr_of_symbols*pucch_pdu->prb_size] __attribute__((aligned(32))); int16_t rd_im_ext[Prx2][4*pucch_pdu->nr_of_symbols*pucch_pdu->prb_size] __attribute__((aligned(32)));
int16_t *r_re_ext_p,*r_im_ext_p,*rd_re_ext_p,*rd_im_ext_p; int16_t *r_re_ext_p,*r_im_ext_p,*rd_re_ext_p,*rd_im_ext_p;
int16_t *rp[Prx2]; int nb_re_pucch = 12*pucch_pdu->prb_size;
int16_t rp[Prx2][nb_re_pucch*2],*tmp_rp;
__m64 dmrs_re,dmrs_im; __m64 dmrs_re,dmrs_im;
for (int aa=0;aa<Prx;aa++) rp[aa] = ((int16_t *)&rxdataF[aa][(l2*frame_parms->ofdm_symbol_size)+re_offset]); for (int aa=0;aa<Prx;aa++){
tmp_rp = ((int16_t *)&rxdataF[aa][l2*frame_parms->ofdm_symbol_size]);
if (re_offset + nb_re_pucch < frame_parms->ofdm_symbol_size) {
memcpy1((void*)rp[aa],(void*)&tmp_rp[re_offset*2],nb_re_pucch*sizeof(int32_t));
}
else {
int neg_length = frame_parms->ofdm_symbol_size-re_offset;
int pos_length = nb_re_pucch-neg_length;
memcpy1((void*)rp[aa],(void*)&tmp_rp[re_offset*2],neg_length*sizeof(int32_t));
memcpy1((void*)&rp[aa][neg_length*2],(void*)tmp_rp,pos_length*sizeof(int32_t));
}
}
#ifdef DEBUG_NR_PUCCH_RX #ifdef DEBUG_NR_PUCCH_RX
printf("Decoding pucch2 for %d symbols, %d PRB\n",pucch_pdu->nr_of_symbols,pucch_pdu->prb_size); printf("Decoding pucch2 for %d symbols, %d PRB\n",pucch_pdu->nr_of_symbols,pucch_pdu->prb_size);
...@@ -1141,67 +1155,19 @@ void nr_decode_pucch2(PHY_VARS_gNB *gNB, ...@@ -1141,67 +1155,19 @@ void nr_decode_pucch2(PHY_VARS_gNB *gNB,
rd_re_ext_p=&rd_re_ext[aa][4*prb]; rd_re_ext_p=&rd_re_ext[aa][4*prb];
rd_im_ext_p=&rd_im_ext[aa][4*prb]; rd_im_ext_p=&rd_im_ext[aa][4*prb];
r_re_ext_p[0]=rp[aa][0]; for (int idx=0; idx<8; idx++) {
r_im_ext_p[0]=rp[aa][1]; r_re_ext_p[idx<<1]=rp[aa][prb*24+6*idx];
rd_re_ext_p[0]=rp[aa][2]; r_im_ext_p[idx<<1]=rp[aa][prb*24+1+6*idx];
rd_im_ext_p[0]=rp[aa][3]; rd_re_ext_p[idx]=rp[aa][prb*24+2+6*idx];
r_re_ext_p[1]=rp[aa][4]; rd_im_ext_p[idx]=rp[aa][prb*24+3+6*idx];
r_im_ext_p[1]=rp[aa][5]; r_re_ext_p[1+(idx<<1)]=rp[aa][prb*24+4+6*idx];
r_im_ext_p[1+(idx<<1)]=rp[aa][prb*24+5+6*idx];
r_re_ext_p[2]=rp[aa][6]; }
r_im_ext_p[2]=rp[aa][7];
rd_re_ext_p[1]=rp[aa][8];
rd_im_ext_p[1]=rp[aa][9];
r_re_ext_p[3]=rp[aa][10];
r_im_ext_p[3]=rp[aa][11];
r_re_ext_p[4]=rp[aa][12];
r_im_ext_p[4]=rp[aa][13];
rd_re_ext_p[2]=rp[aa][14];
rd_im_ext_p[2]=rp[aa][15];
r_re_ext_p[5]=rp[aa][16];
r_im_ext_p[5]=rp[aa][17];
r_re_ext_p[6]=rp[aa][18];
r_im_ext_p[6]=rp[aa][19];
rd_re_ext_p[3]=rp[aa][20];
rd_im_ext_p[3]=rp[aa][21];
r_re_ext_p[7]=rp[aa][22];
r_im_ext_p[7]=rp[aa][23];
r_re_ext_p[8]=rp[aa][24];
r_im_ext_p[8]=rp[aa][25];
rd_re_ext_p[4]=rp[aa][26];
rd_im_ext_p[4]=rp[aa][27];
r_re_ext_p[9]=rp[aa][28];
r_im_ext_p[9]=rp[aa][29];
r_re_ext_p[10]=rp[aa][30];
r_im_ext_p[10]=rp[aa][31];
rd_re_ext_p[5]=rp[aa][32];
rd_im_ext_p[5]=rp[aa][33];
r_re_ext_p[11]=rp[aa][34];
r_im_ext_p[11]=rp[aa][35];
r_re_ext_p[12]=rp[aa][36];
r_im_ext_p[12]=rp[aa][37];
rd_re_ext_p[6]=rp[aa][38];
rd_im_ext_p[6]=rp[aa][39];
r_re_ext_p[13]=rp[aa][40];
r_im_ext_p[13]=rp[aa][41];
r_re_ext_p[14]=rp[aa][42];
r_im_ext_p[14]=rp[aa][43];
rd_re_ext_p[7]=rp[aa][44];
rd_im_ext_p[7]=rp[aa][45];
r_re_ext_p[15]=rp[aa][46];
r_im_ext_p[15]=rp[aa][47];
#ifdef DEBUG_NR_PUCCH_RX #ifdef DEBUG_NR_PUCCH_RX
for (int i=0;i<8;i++) printf("Ant %d PRB %d dmrs[%d] -> (%d,%d)\n",aa,prb+(i>>2),i,rd_re_ext_p[i],rd_im_ext_p[i]); for (int i=0;i<8;i++) printf("Ant %d PRB %d dmrs[%d] -> (%d,%d)\n",aa,prb+(i>>2),i,rd_re_ext_p[i],rd_im_ext_p[i]);
for (int i=0;i<16;i++) printf("Ant %d PRB %d data[%d] -> (%d,%d)\n",aa,prb+(i>>3),i,r_re_ext_p[i],r_im_ext_p[i]); for (int i=0;i<16;i++) printf("Ant %d PRB %d data[%d] -> (%d,%d)\n",aa,prb+(i>>3),i,r_re_ext_p[i],r_im_ext_p[i]);
#endif #endif
rp[aa]+=48;
} // aa } // aa
} // prb } // prb
...@@ -1628,7 +1594,7 @@ void nr_decode_pucch2(PHY_VARS_gNB *gNB, ...@@ -1628,7 +1594,7 @@ void nr_decode_pucch2(PHY_VARS_gNB *gNB,
} // half_prb } // half_prb
// run polar decoder on llrs // run polar decoder on llrs
decoderState = polar_decoder_int16((int16_t*)llrs, decodedPayload, 0, currentPtr); decoderState = polar_decoder_int16((int16_t*)llrs, decodedPayload, 0, currentPtr);
LOG_D(PHY,"UCI decoderState %d, payload[0] %llux\n",decoderState,(unsigned long long)decodedPayload[0]); LOG_D(PHY,"UCI decoderState %d, payload[0] %llu\n",decoderState,(unsigned long long)decodedPayload[0]);
if (decoderState>0) decoderState=1; if (decoderState>0) decoderState=1;
corr_dB = dB_fixed64(corr); corr_dB = dB_fixed64(corr);
LOG_D(PHY,"metric %d dB\n",corr_dB); LOG_D(PHY,"metric %d dB\n",corr_dB);
......
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