From 96622f6b809f46513f526e9d92d997c3a2cad574 Mon Sep 17 00:00:00 2001 From: Raymond Knopp Date: Sat, 5 Nov 2022 13:56:53 +0100 Subject: [PATCH 1/3] debugging of pucch2, logging --- openair1/PHY/NR_TRANSPORT/pucch_rx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openair1/PHY/NR_TRANSPORT/pucch_rx.c b/openair1/PHY/NR_TRANSPORT/pucch_rx.c index e8b535d3bd..bb1dfb805c 100644 --- a/openair1/PHY/NR_TRANSPORT/pucch_rx.c +++ b/openair1/PHY/NR_TRANSPORT/pucch_rx.c @@ -53,7 +53,7 @@ #include "T.h" -//#define DEBUG_NR_PUCCH_RX 1 +#define DEBUG_NR_PUCCH_RX 1 NR_gNB_PUCCH_t *new_gNB_pucch(void){ NR_gNB_PUCCH_t *pucch; @@ -1551,7 +1551,7 @@ void nr_decode_pucch2(PHY_VARS_gNB *gNB, } // cw loop corr_dB = dB_fixed64((uint64_t)corr); #ifdef DEBUG_NR_PUCCH_RX - LOG_I(PHY,"slot %d PUCCH2 cw_ML %d, metric %d dB\n",slot,cw_ML,corr_dB); + printf("slot %d PUCCH2 cw_ML %d, metric %d dB\n",slot,cw_ML,corr_dB); #endif decodedPayload[0]=(uint64_t)cw_ML; } From bf370cc55d49a3741aaa299ebd4fccfd02aaa694 Mon Sep 17 00:00:00 2001 From: Raymond Knopp Date: Sat, 5 Nov 2022 21:54:23 +0100 Subject: [PATCH 2/3] fixed correlation computation in pucch_rx.c --- openair1/PHY/NR_TRANSPORT/pucch_rx.c | 44 +++++++++++++++++++++------- 1 file changed, 33 insertions(+), 11 deletions(-) diff --git a/openair1/PHY/NR_TRANSPORT/pucch_rx.c b/openair1/PHY/NR_TRANSPORT/pucch_rx.c index bb1dfb805c..7940b481de 100644 --- a/openair1/PHY/NR_TRANSPORT/pucch_rx.c +++ b/openair1/PHY/NR_TRANSPORT/pucch_rx.c @@ -53,7 +53,7 @@ #include "T.h" -#define DEBUG_NR_PUCCH_RX 1 +//#define DEBUG_NR_PUCCH_RX 1 NR_gNB_PUCCH_t *new_gNB_pucch(void){ NR_gNB_PUCCH_t *pucch; @@ -1515,31 +1515,50 @@ void nr_decode_pucch2(PHY_VARS_gNB *gNB, #endif prod_re[aa] = simde_mm256_hadds_epi16(prod_re[aa],prod_re[aa]);// 0+1 +#ifdef DEBUG_NR_PUCCH_RX + printf("0.prod_re[%d] => (%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d)\n",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]); +#endif prod_im[aa] = simde_mm256_hadds_epi16(prod_im[aa],prod_im[aa]); prod_re[aa] = simde_mm256_hadds_epi16(prod_re[aa],prod_re[aa]);// 0+1+2+3 +#ifdef DEBUG_NR_PUCCH_RX + printf("1.prod_re[%d] => (%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d)\n",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]); +#endif prod_im[aa] = simde_mm256_hadds_epi16(prod_im[aa],prod_im[aa]); prod_re[aa] = simde_mm256_hadds_epi16(prod_re[aa],prod_re[aa]);// 0+1+2+3+4+5+6+7 - prod_im[aa] = simde_mm256_hadds_epi16(prod_im[aa],prod_im[aa]); - prod_re[aa] = simde_mm256_hadds_epi16(prod_re[aa],prod_re[aa]);// 0+1+2+3+4+5+6+7+8+9+10+11+12+13+14+15 +#ifdef DEBUG_NR_PUCCH_RX + printf("2.prod_re[%d] => (%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d)\n",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]); +#endif prod_im[aa] = simde_mm256_hadds_epi16(prod_im[aa],prod_im[aa]); } int64_t corr_re=0,corr_im=0; for (int aa=0;aa corr) { corr = corr_tmp; cw_ML=cw; +#ifdef DEBUG_NR_PUCCH_RX + printf("slot %d PUCCH2 cw_ML %d, corr %llu\n",slot,cw_ML,corr); +#endif } } // cw loop corr_dB = dB_fixed64((uint64_t)corr); #ifdef DEBUG_NR_PUCCH_RX - printf("slot %d PUCCH2 cw_ML %d, metric %d dB\n",slot,cw_ML,corr_dB); + printf("slot %d PUCCH2 cw_ML %d, metric %d \n",slot,cw_ML,corr_dB); #endif decodedPayload[0]=(uint64_t)cw_ML; } From 821e3ad5ce2d3e7d7564402a26773ab49a02c573 Mon Sep 17 00:00:00 2001 From: francescomani Date: Mon, 7 Nov 2022 09:46:24 +0100 Subject: [PATCH 3/3] set random payload for pucchsim --- openair1/SIMULATION/NR_PHY/pucchsim.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/openair1/SIMULATION/NR_PHY/pucchsim.c b/openair1/SIMULATION/NR_PHY/pucchsim.c index 7dc5ccdeff..d3f7ef5c7b 100644 --- a/openair1/SIMULATION/NR_PHY/pucchsim.c +++ b/openair1/SIMULATION/NR_PHY/pucchsim.c @@ -104,6 +104,7 @@ int main(int argc, char **argv) int nr_slot_tx=0; int nr_frame_tx=0; uint64_t actual_payload=0,payload_received; + bool random_payload = true; int nr_bit=1; // maximum value possible is 2 uint8_t m0=0;// higher layer paramater initial cyclic shift uint8_t nrofSymbols=1; //number of OFDM symbols can be 1-2 for format 1 @@ -317,6 +318,7 @@ int main(int argc, char **argv) break; case 'B': actual_payload=atoi(optarg); + random_payload = false; break; case 'T': //nacktoack_flag=(uint8_t)atoi(optarg); @@ -379,6 +381,10 @@ int main(int argc, char **argv) int do_DTX=0; if ((format < 2) && (actual_payload == 4)) do_DTX=1; + if (random_payload) { + srand(time(NULL)); // Initialization, should only be called once. + actual_payload = rand(); // Returns a pseudo-random integer between 0 and RAND_MAX. + } actual_payload &= ((1<>1)^(!harq_list[1].harq_value))); + ack_nack_errors+=(((actual_payload&1)^(!harq_list[1].harq_value))+((actual_payload>>1)^(!harq_list[0].harq_value))); else if ((!confidence_lvl && !harq_list[0].harq_value) || (!confidence_lvl && nr_bit == 2 && !harq_list[1].harq_value)) ack_nack_errors++;