From 86250f682aae413f0e448dda397e0d0ab501e5a1 Mon Sep 17 00:00:00 2001
From: Francesco Mani <francesco.mani@eurecom.fr>
Date: Tue, 28 Jul 2020 16:35:12 +0200
Subject: [PATCH] bugfix in ul estimation and other minor changes

---
 .../PHY/NR_ESTIMATION/nr_ul_channel_estimation.c |  7 ++++---
 openair1/PHY/NR_ESTIMATION/nr_ul_estimation.h    |  1 +
 .../PHY/NR_TRANSPORT/nr_ulsch_demodulation.c     |  1 +
 .../PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c  | 16 ++++++++--------
 .../GENERIC-LTE-EPC/CONF/testing_enb.conf        |  2 +-
 5 files changed, 15 insertions(+), 12 deletions(-)

diff --git a/openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c b/openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c
index 0b43c738a61..9a6f47b01dd 100644
--- a/openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c
+++ b/openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c
@@ -34,6 +34,7 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
                                 unsigned char Ns,
                                 unsigned short p,
                                 unsigned char symbol,
+                                int ul_id,
                                 unsigned short bwp_start_subcarrier,
                                 nfapi_nr_pusch_pdu_t *pusch_pdu) {
 
@@ -43,8 +44,8 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
   unsigned int pilot_cnt,re_cnt;
   int16_t ch[2],ch_r[2],ch_l[2],*pil,*rxF,*ul_ch;
   int16_t *fl,*fm,*fr,*fml,*fmr,*fmm,*fdcl,*fdcr,*fdclh,*fdcrh;
-  int ch_offset,symbol_offset, UE_id = 0;
-  int32_t **ul_ch_estimates_time =  gNB->pusch_vars[UE_id]->ul_ch_estimates_time;
+  int ch_offset,symbol_offset ;
+  int32_t **ul_ch_estimates_time =  gNB->pusch_vars[ul_id]->ul_ch_estimates_time;
   __m128i *ul_ch_128;
 
 #ifdef DEBUG_CH
@@ -55,7 +56,7 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
   //uint16_t Nid_cell = (eNB_offset == 0) ? gNB->frame_parms.Nid_cell : gNB->measurements.adj_cell_id[eNB_offset-1];
 
   uint8_t nushift;
-  int **ul_ch_estimates  = gNB->pusch_vars[UE_id]->ul_ch_estimates;
+  int **ul_ch_estimates  = gNB->pusch_vars[ul_id]->ul_ch_estimates;
   int **rxdataF = gNB->common_vars.rxdataF;
 
   nushift = (p>>1)&1;
diff --git a/openair1/PHY/NR_ESTIMATION/nr_ul_estimation.h b/openair1/PHY/NR_ESTIMATION/nr_ul_estimation.h
index a7789c92249..b1fd412ebf1 100644
--- a/openair1/PHY/NR_ESTIMATION/nr_ul_estimation.h
+++ b/openair1/PHY/NR_ESTIMATION/nr_ul_estimation.h
@@ -43,6 +43,7 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
                                 unsigned char Ns,
                                 unsigned short p,
                                 unsigned char symbol,
+                                int ul_id,
                                 unsigned short bwp_start_subcarrier,
                                 nfapi_nr_pusch_pdu_t *pusch_pdu);
 
diff --git a/openair1/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c b/openair1/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c
index a966db5844a..0375ce5c4e1 100644
--- a/openair1/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c
+++ b/openair1/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c
@@ -1082,6 +1082,7 @@ int nr_rx_pusch(PHY_VARS_gNB *gNB,
                                 nr_tti_rx,
                                 0, // p
                                 symbol,
+                                ulsch_id,
                                 bwp_start_subcarrier,
                                 rel15_ul);
   stop_meas(&gNB->ulsch_channel_estimation_stats);
diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c
index 7f941e55672..996bd93a76d 100644
--- a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c
+++ b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c
@@ -333,9 +333,9 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
                                        dlsch0_harq->pmi_alloc,
                                        pdsch_vars[eNB_id_i]->pmi_ext,
                                        symbol,
-									   pilots,
-									   start_rb,
-									   nb_rb_pdsch,
+                                       pilots,
+                                       start_rb,
+                                       nb_rb_pdsch,
                                        nr_tti_rx,
                                        ue->high_speed_flag,
                                        frame_parms,
@@ -348,9 +348,9 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
                                        dlsch0_harq->pmi_alloc,
                                        pdsch_vars[eNB_id_i]->pmi_ext,
                                        symbol,
-									   pilots,
-									   start_rb,
-									   nb_rb_pdsch,
+                                       pilots,
+                                       start_rb,
+                                       nb_rb_pdsch,
                                        nr_tti_rx,
                                        ue->high_speed_flag,
                                        frame_parms,
@@ -510,7 +510,7 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
                                (aatx>1) ? pdsch_vars[eNB_id]->rho : NULL,
                                frame_parms,
                                symbol,
-							   pilots,
+                               pilots,
                                first_symbol_flag,
                                dlsch0_harq->Qm,
                                nb_rb,
@@ -1141,7 +1141,7 @@ void nr_dlsch_channel_compensation(int **rxdataF_ext,
                                 int **rho,
                                 NR_DL_FRAME_PARMS *frame_parms,
                                 unsigned char symbol,
-								uint8_t pilots,
+				uint8_t pilots,
                                 uint8_t first_symbol_flag,
                                 unsigned char mod_order,
                                 unsigned short nb_rb,
diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_enb.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_enb.conf
index ea105d86b62..4c0d346360e 100644
--- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_enb.conf
+++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_enb.conf
@@ -235,7 +235,7 @@ MACRLCs = (
 
 THREAD_STRUCT = (
   {
-    parallel_config = "PARALLEL_RU_L1_TRX_SPLITaaaaaa";
+    parallel_config = "PARALLEL_RU_L1_TRX_SPLIT";
     worker_config = "ENABLE";
   }
 );
-- 
GitLab