intermediate commit
This commit is contained in:
@@ -871,7 +871,7 @@ __m256i *pucch2_lut[9]={pucch2_3bit,
|
|||||||
pucch2_10bit,
|
pucch2_10bit,
|
||||||
pucch2_11bit};
|
pucch2_11bit};
|
||||||
|
|
||||||
__m64 pucch2_polar_8bit[256*2];
|
__m64 pucch2_polar_4bit[16];
|
||||||
|
|
||||||
void init_pucch2_luts() {
|
void init_pucch2_luts() {
|
||||||
|
|
||||||
@@ -952,25 +952,17 @@ void init_pucch2_luts() {
|
|||||||
*lut_ip1 = _mm256_insert_epi16(*lut_ip1,bit,15);
|
*lut_ip1 = _mm256_insert_epi16(*lut_ip1,bit,15);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (uint16_t i=0;i<256;i++) {
|
for (uint16_t i=0;i<16;i++) {
|
||||||
__m64 *lut_i=&pucch2_polar_8bit[i<<1];
|
__m64 *lut_i=&pucch2_polar_4bit[i];
|
||||||
__m64 *lut_ip1=&pucch2_polar_8bit[1+(i<<1)];
|
|
||||||
bit = (out&0x1) > 0 ? -1 : 1;
|
bit = (i&0x1) > 0 ? -1 : 1;
|
||||||
*lut_i = _mm_insert_pi16(*lut_i,bit,0);
|
*lut_i = _mm_insert_pi16(*lut_i,bit,0);
|
||||||
bit = (out&0x2) > 0 ? -1 : 1;
|
bit = (i&0x2) > 0 ? -1 : 1;
|
||||||
*lut_ip1 = _mm_insert_pi16(*lut_ip1,bit,0);
|
|
||||||
bit = (out&0x4) > 0 ? -1 : 1;
|
|
||||||
*lut_i = _mm_insert_pi16(*lut_i,bit,1);
|
*lut_i = _mm_insert_pi16(*lut_i,bit,1);
|
||||||
bit = (out&0x8) > 0 ? -1 : 1;
|
bit = (i&0x4) > 0 ? -1 : 1;
|
||||||
*lut_ip1 = _mm_insert_pi16(*lut_ip1,bit,1);
|
|
||||||
bit = (out&0x10) > 0 ? -1 : 1;
|
|
||||||
*lut_i = _mm_insert_pi16(*lut_i,bit,2);
|
*lut_i = _mm_insert_pi16(*lut_i,bit,2);
|
||||||
bit = (out&0x20) > 0 ? -1 : 1;
|
bit = (i&0x8) > 0 ? -1 : 1;
|
||||||
*lut_ip1 = _mm_insert_pi16(*lut_ip1,bit,2);
|
|
||||||
bit = (out&0x40) > 0 ? -1 : 1;
|
|
||||||
*lut_i = _mm_insert_pi16(*lut_i,bit,3);
|
*lut_i = _mm_insert_pi16(*lut_i,bit,3);
|
||||||
bit = (out&0x80) > 0 ? -1 : 1;
|
|
||||||
*lut_ip1 = _mm_insert_pi16(*lut_ip1,bit,3);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1030,8 +1022,8 @@ void nr_decode_pucch2(PHY_VARS_gNB *gNB,
|
|||||||
for (int aa=0;aa<Prx;aa++) {
|
for (int aa=0;aa<Prx;aa++) {
|
||||||
r_re_ext_p=&r_re_ext[aa][8*prb];
|
r_re_ext_p=&r_re_ext[aa][8*prb];
|
||||||
r_im_ext_p=&r_im_ext[aa][8*prb];
|
r_im_ext_p=&r_im_ext[aa][8*prb];
|
||||||
rd_re_ext_p=&r_re_ext[aa][4*prb];
|
rd_re_ext_p=&rd_re_ext[aa][4*prb];
|
||||||
rd_im_ext_p=&r_im_ext[aa][4*prb];
|
rd_im_ext_p=&rd_im_ext[aa][4*prb];
|
||||||
|
|
||||||
r_re_ext_p[0]=rp[aa][0];
|
r_re_ext_p[0]=rp[aa][0];
|
||||||
r_im_ext_p[0]=rp[aa][1];
|
r_im_ext_p[0]=rp[aa][1];
|
||||||
@@ -1091,6 +1083,7 @@ void nr_decode_pucch2(PHY_VARS_gNB *gNB,
|
|||||||
|
|
||||||
#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],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],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],i);
|
||||||
#endif
|
#endif
|
||||||
rp[aa]+=48;
|
rp[aa]+=48;
|
||||||
} // aa
|
} // aa
|
||||||
@@ -1121,8 +1114,8 @@ void nr_decode_pucch2(PHY_VARS_gNB *gNB,
|
|||||||
((int16_t*)&dmrs_re)[3],((int16_t*)&dmrs_im)[3]);
|
((int16_t*)&dmrs_re)[3],((int16_t*)&dmrs_im)[3]);
|
||||||
#endif
|
#endif
|
||||||
for (int aa=0;aa<Prx;aa++) {
|
for (int aa=0;aa<Prx;aa++) {
|
||||||
rd_re_ext_p=&r_re_ext[aa][8*group];
|
rd_re_ext_p=&rd_re_ext[aa][8*group];
|
||||||
rd_im_ext_p=&r_im_ext[aa][8*group];
|
rd_im_ext_p=&rd_im_ext[aa][8*group];
|
||||||
|
|
||||||
#ifdef DEBUG_NR_PUCCH_RX
|
#ifdef DEBUG_NR_PUCCH_RX
|
||||||
printf("Group %d: rd ((%d,%d),(%d,%d),(%d,%d),(%d,%d))\n",
|
printf("Group %d: rd ((%d,%d),(%d,%d),(%d,%d),(%d,%d))\n",
|
||||||
@@ -1153,8 +1146,8 @@ void nr_decode_pucch2(PHY_VARS_gNB *gNB,
|
|||||||
((int16_t*)&dmrs_re)[3],((int16_t*)&dmrs_im)[3]);
|
((int16_t*)&dmrs_re)[3],((int16_t*)&dmrs_im)[3]);
|
||||||
#endif
|
#endif
|
||||||
for (int aa=0;aa<Prx;aa++) {
|
for (int aa=0;aa<Prx;aa++) {
|
||||||
rd_re_ext_p=&r_re_ext[aa][8*group];
|
rd_re_ext_p=&rd_re_ext[aa][8*group];
|
||||||
rd_im_ext_p=&r_im_ext[aa][8*group];
|
rd_im_ext_p=&rd_im_ext[aa][8*group];
|
||||||
#ifdef DEBUG_NR_PUCCH_RX
|
#ifdef DEBUG_NR_PUCCH_RX
|
||||||
printf("Group %d: rd ((%d,%d),(%d,%d),(%d,%d),(%d,%d))\n",
|
printf("Group %d: rd ((%d,%d),(%d,%d),(%d,%d),(%d,%d))\n",
|
||||||
group,
|
group,
|
||||||
@@ -1216,8 +1209,8 @@ void nr_decode_pucch2(PHY_VARS_gNB *gNB,
|
|||||||
r_re_ext[aa][re_offset+5],r_im_ext[aa][re_offset+5],
|
r_re_ext[aa][re_offset+5],r_im_ext[aa][re_offset+5],
|
||||||
r_re_ext[aa][re_offset+6],r_im_ext[aa][re_offset+6],
|
r_re_ext[aa][re_offset+6],r_im_ext[aa][re_offset+6],
|
||||||
r_re_ext[aa][re_offset+7],r_im_ext[aa][re_offset+7]);
|
r_re_ext[aa][re_offset+7],r_im_ext[aa][re_offset+7]);
|
||||||
printf("prb %d: c ((%d,%d),(%d,%d),(%d,%d),(%d,%d),(%d,%d),(%d,%d),(%d,%d),(%d,%d))\n",
|
printf("prb %d (%x): c ((%d,%d),(%d,%d),(%d,%d),(%d,%d),(%d,%d),(%d,%d),(%d,%d),(%d,%d))\n",
|
||||||
prb,
|
prb,s,
|
||||||
((int16_t*)&c_re0)[0],((int16_t*)&c_im0)[0],
|
((int16_t*)&c_re0)[0],((int16_t*)&c_im0)[0],
|
||||||
((int16_t*)&c_re0)[1],((int16_t*)&c_im0)[1],
|
((int16_t*)&c_re0)[1],((int16_t*)&c_im0)[1],
|
||||||
((int16_t*)&c_re0)[2],((int16_t*)&c_im0)[2],
|
((int16_t*)&c_re0)[2],((int16_t*)&c_im0)[2],
|
||||||
@@ -1237,8 +1230,8 @@ void nr_decode_pucch2(PHY_VARS_gNB *gNB,
|
|||||||
r_re_ext[aa][re_offset+13],r_im_ext[aa][re_offset+13],
|
r_re_ext[aa][re_offset+13],r_im_ext[aa][re_offset+13],
|
||||||
r_re_ext[aa][re_offset+14],r_im_ext[aa][re_offset+14],
|
r_re_ext[aa][re_offset+14],r_im_ext[aa][re_offset+14],
|
||||||
r_re_ext[aa][re_offset+15],r_im_ext[aa][re_offset+15]);
|
r_re_ext[aa][re_offset+15],r_im_ext[aa][re_offset+15]);
|
||||||
printf("prb %d: c ((%d,%d),(%d,%d),(%d,%d),(%d,%d),(%d,%d),(%d,%d),(%d,%d),(%d,%d))\n",
|
printf("prb %d (%x): c ((%d,%d),(%d,%d),(%d,%d),(%d,%d),(%d,%d),(%d,%d),(%d,%d),(%d,%d))\n",
|
||||||
prb+1,
|
prb+1,s,
|
||||||
((int16_t*)&c_re2)[0],((int16_t*)&c_im2)[0],
|
((int16_t*)&c_re2)[0],((int16_t*)&c_im2)[0],
|
||||||
((int16_t*)&c_re2)[1],((int16_t*)&c_im2)[1],
|
((int16_t*)&c_re2)[1],((int16_t*)&c_im2)[1],
|
||||||
((int16_t*)&c_re2)[2],((int16_t*)&c_im2)[2],
|
((int16_t*)&c_re2)[2],((int16_t*)&c_im2)[2],
|
||||||
@@ -1294,6 +1287,9 @@ void nr_decode_pucch2(PHY_VARS_gNB *gNB,
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
s = lte_gold_generic(&x1, &x2, 0);
|
s = lte_gold_generic(&x1, &x2, 0);
|
||||||
|
#ifdef DEBUG_NR_PUCCH_RX
|
||||||
|
printf("\n");
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
AssertFatal(pucch_pdu->bit_len_csi_part1 + pucch_pdu->bit_len_csi_part2 == 0,"no csi for now\n");
|
AssertFatal(pucch_pdu->bit_len_csi_part1 + pucch_pdu->bit_len_csi_part2 == 0,"no csi for now\n");
|
||||||
AssertFatal((pucch_pdu->bit_len_harq+pucch_pdu->sr_flag > 2 ) && (pucch_pdu->bit_len_harq+pucch_pdu->sr_flag < 65),"illegal length (%d,%d)\n",pucch_pdu->bit_len_harq,pucch_pdu->sr_flag);
|
AssertFatal((pucch_pdu->bit_len_harq+pucch_pdu->sr_flag > 2 ) && (pucch_pdu->bit_len_harq+pucch_pdu->sr_flag < 65),"illegal length (%d,%d)\n",pucch_pdu->bit_len_harq,pucch_pdu->sr_flag);
|
||||||
@@ -1331,6 +1327,19 @@ void nr_decode_pucch2(PHY_VARS_gNB *gNB,
|
|||||||
_mm256_mullo_epi16(pucch2_lut[nb_bit-3][(cw<<1)+1],rp_im[aa][0])),5);
|
_mm256_mullo_epi16(pucch2_lut[nb_bit-3][(cw<<1)+1],rp_im[aa][0])),5);
|
||||||
prod_im[aa] = _mm256_srai_epi16(_mm256_subs_epi16(_mm256_mullo_epi16(pucch2_lut[nb_bit-3][cw<<1],rp2_im[aa][0]),
|
prod_im[aa] = _mm256_srai_epi16(_mm256_subs_epi16(_mm256_mullo_epi16(pucch2_lut[nb_bit-3][cw<<1],rp2_im[aa][0]),
|
||||||
_mm256_mullo_epi16(pucch2_lut[nb_bit-3][(cw<<1)+1],rp2_re[aa][0])),5);
|
_mm256_mullo_epi16(pucch2_lut[nb_bit-3][(cw<<1)+1],rp2_re[aa][0])),5);
|
||||||
|
#ifdef DEBUG_NR_PUCCH_RX
|
||||||
|
printf("prod_re[%d] => (%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d)",aa,
|
||||||
|
((int16_t*)&prod_re[aa])[0],((int16_t*)&prod_re[aa])[1],((int16_t*)&prod_re[aa])[2],((int16_t*)&prod_re[aa])[3],
|
||||||
|
((int16_t*)&prod_re[aa])[4],((int16_t*)&prod_re[aa])[5],((int16_t*)&prod_re[aa])[6],((int16_t*)&prod_re[aa])[7],
|
||||||
|
((int16_t*)&prod_re[aa])[8],((int16_t*)&prod_re[aa])[9],((int16_t*)&prod_re[aa])[10],((int16_t*)&prod_re[aa])[11],
|
||||||
|
((int16_t*)&prod_re[aa])[12],((int16_t*)&prod_re[aa])[13],((int16_t*)&prod_re[aa])[14],((int16_t*)&prod_re[aa])[15]);
|
||||||
|
printf("prod_im[%d] => (%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d)",aa,
|
||||||
|
((int16_t*)&prod_im[aa])[0],((int16_t*)&prod_im[aa])[1],((int16_t*)&prod_im[aa])[2],((int16_t*)&prod_im[aa])[3],
|
||||||
|
((int16_t*)&prod_im[aa])[4],((int16_t*)&prod_im[aa])[5],((int16_t*)&prod_im[aa])[6],((int16_t*)&prod_im[aa])[7],
|
||||||
|
((int16_t*)&prod_im[aa])[8],((int16_t*)&prod_im[aa])[9],((int16_t*)&prod_im[aa])[10],((int16_t*)&prod_im[aa])[11],
|
||||||
|
((int16_t*)&prod_im[aa])[12],((int16_t*)&prod_im[aa])[13],((int16_t*)&prod_im[aa])[14],((int16_t*)&prod_im[aa])[15]);
|
||||||
|
|
||||||
|
#endif
|
||||||
prod_re[aa] = _mm256_hadds_epi16(prod_re[aa],prod_re[aa]);// 0+1
|
prod_re[aa] = _mm256_hadds_epi16(prod_re[aa],prod_re[aa]);// 0+1
|
||||||
prod_im[aa] = _mm256_hadds_epi16(prod_im[aa],prod_im[aa]);
|
prod_im[aa] = _mm256_hadds_epi16(prod_im[aa],prod_im[aa]);
|
||||||
prod_re[aa] = _mm256_hadds_epi16(prod_re[aa],prod_re[aa]);// 0+1+2+3
|
prod_re[aa] = _mm256_hadds_epi16(prod_re[aa],prod_re[aa]);// 0+1+2+3
|
||||||
@@ -1395,46 +1404,57 @@ void nr_decode_pucch2(PHY_VARS_gNB *gNB,
|
|||||||
}
|
}
|
||||||
__m64 prod_re[Prx2],prod_im[Prx2];
|
__m64 prod_re[Prx2],prod_im[Prx2];
|
||||||
|
|
||||||
for (int cw=0;cw<256;cw++) {
|
for (int cw=0;cw<16;cw++) {
|
||||||
#ifdef DEBUG_NR_PUCCH_RX
|
#ifdef DEBUG_NR_PUCCH_RX
|
||||||
printf("cw %d:",cw);
|
printf("cw %d:",cw);
|
||||||
for (int i=0;i<32;i+=2) {
|
for (int i=0;i<4;i++) {
|
||||||
printf("%d,%d,",
|
printf("%d,",
|
||||||
((int16_t*)&pucch2_lut[nb_bit-3][cw<<1])[i>>1],
|
((int16_t*)&pucch2_polar_4bit[cw])[i>>1]);
|
||||||
((int16_t*)&pucch2_lut[nb_bit-3][cw<<1])[1+(i>>1)]);
|
|
||||||
}
|
}
|
||||||
printf("\n");
|
printf("\n");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
// non-coherent LLR computation on groups of 4 REs (half-PRBs)
|
// non-coherent LLR computation on groups of 4 REs (half-PRBs)
|
||||||
for (in half_prb=0;half_prb<(2*pucch_pdu->prb_size);half_prb++) {
|
int32_t corr_re,corr_im,corr_tmp;
|
||||||
|
for (int half_prb=0;half_prb<(2*pucch_pdu->prb_size);half_prb++) {
|
||||||
for (int cw=0;cw<256;cw++) {
|
for (int cw=0;cw<256;cw++) {
|
||||||
|
corr_tmp=0;
|
||||||
for (int aa=0;aa<Prx;aa++) {
|
for (int aa=0;aa<Prx;aa++) {
|
||||||
prod_re[aa] = _mm_srai_pi16(_mm_adds_pi16(_mm_mullo_pi16(pucch2_polar_8bit[cw<<1],rp_re[aa][half_prb]),
|
prod_re[aa] = _mm_srai_pi16(_mm_adds_pi16(_mm_mullo_pi16(pucch2_polar_4bit[cw&15],rp_re[aa][half_prb]),
|
||||||
_mm_mullo_pi16(pucch2_polar_8bit[(cw<<1)+1],rp_im[aa][half_prb])),5);
|
_mm_mullo_pi16(pucch2_polar_4bit[cw>>4],rp_im[aa][half_prb])),5);
|
||||||
prod_im[aa] = _mm_srai_pi16(_mm_subs_pi16(_mm_mullo_pi16(pucch2_polar_8bit[cw<<1],rp2_im[aa][half_prb]),
|
prod_im[aa] = _mm_srai_pi16(_mm_subs_pi16(_mm_mullo_pi16(pucch2_polar_4bit[cw&15],rp2_im[aa][half_prb]),
|
||||||
_mm_mullo_pi16(pucch2_polar_8bit[(cw<<1)+1],rp2_re[aa][half_prb])),5);
|
_mm_mullo_pi16(pucch2_polar_4bit[cw>>4],rp2_re[aa][half_prb])),5);
|
||||||
prod_re[aa] = _mm_hadds_pi16(prod_re[aa],prod_re[aa]);// 0+1
|
prod_re[aa] = _mm_hadds_pi16(prod_re[aa],prod_re[aa]);// 0+1
|
||||||
prod_im[aa] = _mm_hadds_pi16(prod_im[aa],prod_im[aa]);
|
prod_im[aa] = _mm_hadds_pi16(prod_im[aa],prod_im[aa]);
|
||||||
prod_re[aa] = _mm_hadds_pi16(prod_re[aa],prod_re[aa]);// 0+1+2+3
|
prod_re[aa] = _mm_hadds_pi16(prod_re[aa],prod_re[aa]);// 0+1+2+3
|
||||||
prod_im[aa] = _mm_hadds_pi16(prod_im[aa],prod_im[aa]);
|
prod_im[aa] = _mm_hadds_pi16(prod_im[aa],prod_im[aa]);
|
||||||
|
|
||||||
|
|
||||||
LOG_D(PHY,"pucch2 half_prb %d cw %d aa %d: (%d,%d)+(%d,%d) = (%d,%d)\n",half_prb,cw,aa,
|
corr_re = ( corr32_re[half_prb>>2][aa]/(2*nc_group_size*4/2)+((int16_t*)(&prod_re[aa]))[0]);
|
||||||
corr32_re[half_prb>>2][aa],corr32_im[half_prb>>2][aa],
|
corr_im = ( corr32_im[half_prb>>2][aa]/(2*nc_group_size*4/2)+((int16_t*)(&prod_im[aa]))[0]);
|
||||||
|
corr_tmp += corr_re*corr_re + corr_im*corr_im;
|
||||||
|
LOG_D(PHY,"pucch2 half_prb %d cw %d (%d,%d) aa %d: (%d,%d,%d,%d,%d,%d,%d,%d)x(%d,%d,%d,%d,%d,%d,%d,%d) (%d,%d)+(%d,%d) = (%d,%d) => %d\n",
|
||||||
|
half_prb,cw,cw&15,cw>>4,aa,
|
||||||
|
((int16_t*)&pucch2_polar_4bit[cw&15])[0],((int16_t*)&pucch2_polar_4bit[cw>>4])[0],
|
||||||
|
((int16_t*)&pucch2_polar_4bit[cw&15])[1],((int16_t*)&pucch2_polar_4bit[cw>>4])[1],
|
||||||
|
((int16_t*)&pucch2_polar_4bit[cw&15])[2],((int16_t*)&pucch2_polar_4bit[cw>>4])[2],
|
||||||
|
((int16_t*)&pucch2_polar_4bit[cw&15])[3],((int16_t*)&pucch2_polar_4bit[cw>>4])[3],
|
||||||
|
((int16_t*)&rp_re[aa][half_prb])[0],((int16_t*)&rp_im[aa][half_prb])[0],
|
||||||
|
((int16_t*)&rp_re[aa][half_prb])[1],((int16_t*)&rp_im[aa][half_prb])[1],
|
||||||
|
((int16_t*)&rp_re[aa][half_prb])[2],((int16_t*)&rp_im[aa][half_prb])[2],
|
||||||
|
((int16_t*)&rp_re[aa][half_prb])[3],((int16_t*)&rp_im[aa][half_prb])[3],
|
||||||
|
corr32_re[half_prb>>2][aa]/(2*nc_group_size*4/2),corr32_im[half_prb>>2][aa]/(2*nc_group_size*4/2),
|
||||||
((int16_t*)(&prod_re[aa]))[0],
|
((int16_t*)(&prod_re[aa]))[0],
|
||||||
((int16_t*)(&prod_im[aa]))[0],
|
((int16_t*)(&prod_im[aa]))[0],
|
||||||
corr32_re[half_prb>>2][aa]+((int16_t*)(&prod_re[aa]))[0],
|
corr_re,
|
||||||
corr32_im[half_prb>>2][aa]+((int16_t*)(&prod_im[aa]))[0]);
|
corr_im,
|
||||||
|
corr_tmp);
|
||||||
corr_re = ( corr32_re[half_prb>>2][aa]+((int16_t*)(&prod_re[aa]))[0]);
|
|
||||||
corr_im = ( corr32_im[half_prb>>2][aa]+((int16_t*)(&prod_im[aa]))[0]);
|
|
||||||
corr_tmp += corr_re*corr_re + corr_im*corr_im;
|
|
||||||
}
|
}
|
||||||
int64_t corr_tmp = corr_re*corr_re + corr_im*corr_im;
|
|
||||||
}
|
}
|
||||||
|
} // half_prb
|
||||||
AssertFatal(1==0,"stopping here\n");
|
AssertFatal(1==0,"stopping here\n");
|
||||||
}
|
|
||||||
|
} // n_bit > 11
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -806,18 +806,26 @@ inline void nr_pucch2_3_4_scrambling(uint16_t M_bit,uint16_t rnti,uint16_t n_id,
|
|||||||
// c_init=nRNTI*2^15+n_id according to TS 38.211 Subclause 6.3.2.6.1
|
// c_init=nRNTI*2^15+n_id according to TS 38.211 Subclause 6.3.2.6.1
|
||||||
//x2 = (rnti) + ((uint32_t)(1+nr_tti_tx)<<16)*(1+(fp->Nid_cell<<1));
|
//x2 = (rnti) + ((uint32_t)(1+nr_tti_tx)<<16)*(1+(fp->Nid_cell<<1));
|
||||||
x2 = ((rnti)<<15)+n_id;
|
x2 = ((rnti)<<15)+n_id;
|
||||||
s = lte_gold_generic(&x1, &x2, 1);
|
|
||||||
#ifdef DEBUG_NR_PUCCH_TX
|
#ifdef DEBUG_NR_PUCCH_TX
|
||||||
printf("\t\t [nr_pucch2_3_4_scrambling] gold sequence s=%x\n",s);
|
printf("\t\t [nr_pucch2_3_4_scrambling] gold sequence s=%x\n",s);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
for (i=0; i<M_bit; i++) {
|
uint8_t *btildep=btilde;
|
||||||
|
int M_bit2=M_bit > 31 ? 32 : (M_bit&31), M_bit3=M_bit;
|
||||||
|
for (int iprime=0;iprime<=(M_bit>>5);iprime++,btildep+=32) {
|
||||||
|
s = lte_gold_generic(&x1, &x2, (iprime==0) ? 1 : 0);
|
||||||
|
|
||||||
|
for (i=0; i<M_bit2; i++) {
|
||||||
c = (uint8_t)((s>>i)&1);
|
c = (uint8_t)((s>>i)&1);
|
||||||
btilde[i] = (((B>>i)&1) ^ c);
|
btildep[i] = (((B>>i)&1) ^ c);
|
||||||
#ifdef DEBUG_NR_PUCCH_TX
|
#ifdef DEBUG_NR_PUCCH_TX
|
||||||
//printf("\t\t\t btilde[%d]=%lx from scrambled bit %d\n",i,btilde[i],((B>>i)&1));
|
printf("\t\t\t btilde[%d]=%lx from unscrambled bit %d and scrambling %d (%x)\n",i+(iprime<<5),btilde[i],((B>>i)&1),c,s>>i);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
M_bit3-=32;
|
||||||
|
M_bit2=M_bit3 > 31 ? 32 : (M_bit3&31);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#ifdef DEBUG_NR_PUCCH_TX
|
#ifdef DEBUG_NR_PUCCH_TX
|
||||||
printf("\t\t [nr_pucch2_3_4_scrambling] scrambling M_bit=%d bits\n", M_bit);
|
printf("\t\t [nr_pucch2_3_4_scrambling] scrambling M_bit=%d bits\n", M_bit);
|
||||||
|
|||||||
Reference in New Issue
Block a user