From 44ded7bfc36691a4c7d6199789e5fc77dabf7def Mon Sep 17 00:00:00 2001
From: Hongzhi Wang <hongzhi.wang@tcl.com>
Date: Tue, 12 Jun 2018 17:26:27 +0200
Subject: [PATCH] ue enable nr channel est

---
 cmake_targets/CMakeLists.txt                   |  2 ++
 openair1/PHY/MODULATION/slot_fep.c             |  4 ++--
 openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c |  1 +
 openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c         |  4 ++--
 openair1/PHY/defs_nr_UE.h                      | 12 ++++++------
 5 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt
index ce23ac73a3..2d2048c99a 100644
--- a/cmake_targets/CMakeLists.txt
+++ b/cmake_targets/CMakeLists.txt
@@ -1276,6 +1276,8 @@ set(PHY_SRC_UE
   ${OPENAIR1_DIR}/PHY/NR_UE_TRANSPORT/
   ${OPENAIR1_DIR}/PHY/NR_UE_TRANSPORT/srs_modulation_nr.c
   ${OPENAIR1_DIR}/PHY/NR_REFSIG/ul_ref_seq_nr.c
+  ${OPENAIR1_DIR}/PHY/NR_REFSIG/nr_dmrs_rx.c
+  ${OPENAIR1_DIR}/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c
   ${OPENAIR1_DIR}/PHY/TOOLS/file_output.c
   ${OPENAIR1_DIR}/PHY/TOOLS/cadd_vv.c
   ${OPENAIR1_DIR}/PHY/TOOLS/lte_dfts.c
diff --git a/openair1/PHY/MODULATION/slot_fep.c b/openair1/PHY/MODULATION/slot_fep.c
index 3b5a2f1840..54eab75810 100644
--- a/openair1/PHY/MODULATION/slot_fep.c
+++ b/openair1/PHY/MODULATION/slot_fep.c
@@ -190,11 +190,11 @@ int slot_fep_pbch(PHY_VARS_NR_UE *ue,
 #if UE_TIMING_TRACE
         start_meas(&ue->dlsch_channel_estimation_stats);
 #endif
-      /*  nr_pbch_channel_estimation(ue,eNB_id,0,
+        nr_pbch_channel_estimation(ue,eNB_id,0,
                                   Ns,
                                   aa,
                                   l,
-                                  symbol);*/
+                                  symbol);
       }
 
 
diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c b/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c
index 45c93ea53a..a2373b8ef2 100644
--- a/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c
+++ b/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c
@@ -42,6 +42,7 @@
 
 #include "PHY/NR_REFSIG/pss_nr.h"
 #include "PHY/NR_REFSIG/sss_nr.h"
+#include "PHY/NR_REFSIG/refsig_defs_ue.h"
 
 extern openair0_config_t openair0_cfg[];
 static  nfapi_config_request_t config_t;
diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c b/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c
index 8844938a66..6c2db526a1 100644
--- a/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c
+++ b/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c
@@ -67,8 +67,8 @@ uint16_t nr_pbch_extract(int **rxdataF,
   uint8_t i,j,aarx,aatx;
   int *dl_ch0,*dl_ch0_ext,*rxF,*rxF_ext;
 
-  int rx_offset = frame_parms->ofdm_symbol_size-3*12;
-  int ch_offset = frame_parms->N_RB_DL*6-3*12;
+  int rx_offset = frame_parms->ofdm_symbol_size-10*12;
+  int ch_offset = frame_parms->N_RB_DL*6-10*12;
   int nushiftmod4 = frame_parms->nushift%4;
 
   for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
diff --git a/openair1/PHY/defs_nr_UE.h b/openair1/PHY/defs_nr_UE.h
index 4c41852bad..bf8020ecda 100644
--- a/openair1/PHY/defs_nr_UE.h
+++ b/openair1/PHY/defs_nr_UE.h
@@ -769,14 +769,14 @@ typedef struct {
 
 #endif
 
-  /// UE-specific reference symbols (p=5), TM 7
-  uint32_t lte_gold_uespec_port5_table[20][38];
+  /// PBCH DMRS sequence
+  uint32_t nr_gold_pbch[2][64][NR_PBCH_DMRS_LENGTH_DWORD];
 
-  /// ue-specific reference symbols
-  uint32_t lte_gold_uespec_table[2][20][2][21];
+  /// PDSCH DMRS
+  uint32_t nr_gold_pdsch[2][20][2][21];
 
-  /// mbsfn reference symbols
-  uint32_t lte_gold_mbsfn_table[10][3][42];
+  /// PDCCH DMRS
+  uint32_t nr_gold_pdcch[10][3][42];
 
   uint32_t X_u[64][839];
 
-- 
GitLab