Commit 87f21854 authored by Cedric Roux's avatar Cedric Roux

Merge remote-tracking branch 'origin/mmse_receiver' into develop_integration_2018_w29

Conflicts:
	cmake_targets/CMakeLists.txt
parents c836ef28 759c1342
......@@ -665,6 +665,7 @@ add_boolean_option(SMBV False "Rohde&Schwarz SMBV100A vector
add_boolean_option(DEBUG_PHY False "Enable PHY layer debugging options")
add_boolean_option(DEBUG_PHY_PROC False "Enable debugging of PHY layer procedures")
add_boolean_option(DEBUG_DLSCH False "Enable debugging of DLSCH physical layer channel")
add_boolean_option(MEX False "Enabling compilation with mex")
##########################
# NAS LAYER OPTIONS
......@@ -1084,6 +1085,7 @@ set(PHY_SRC_COMMON
# ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/slss.c
# ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/sldch.c
# ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/slsch.c
${OPENAIR1_DIR}/PHY/LTE_UE_TRANSPORT/get_pmi.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/group_hopping.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/phich_common.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/pcfich_common.c
......@@ -1172,6 +1174,7 @@ set(PHY_SRC_UE
${OPENAIR1_DIR}/PHY/LTE_UE_TRANSPORT/sss_ue.c
${OPENAIR1_DIR}/PHY/LTE_UE_TRANSPORT/dlsch_demodulation.c
${OPENAIR1_DIR}/PHY/LTE_UE_TRANSPORT/dlsch_llr_computation.c
${OPENAIR1_DIR}/PHY/LTE_UE_TRANSPORT/linear_preprocessing_rec.c
${OPENAIR1_DIR}/PHY/LTE_UE_TRANSPORT/dlsch_decoding.c
${OPENAIR1_DIR}/PHY/LTE_UE_TRANSPORT/dci_tools_ue.c
${OPENAIR1_DIR}/PHY/LTE_UE_TRANSPORT/uci_tools_ue.c
......@@ -1219,6 +1222,27 @@ add_library(PHY ${PHY_SRC})
add_library(PHY_UE ${PHY_SRC_UE})
add_library(PHY_RU ${PHY_SRC_RU})
#Library for mex functions
#########################3
set(PHY_MEX_UE
${OPENAIR1_DIR}/PHY/LTE_UE_TRANSPORT/linear_preprocessing_rec.c
${OPENAIR1_DIR}/PHY/LTE_UE_TRANSPORT/dlsch_llr_computation.c
${OPENAIR1_DIR}/PHY/LTE_UE_TRANSPORT/dlsch_demodulation.c
${OPENAIR1_DIR}/PHY/TOOLS/log2_approx.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/lte_mcs.c
${OPENAIR1_DIR}/PHY/LTE_UE_TRANSPORT/get_pmi.c
${OPENAIR1_DIR}/PHY/TOOLS/dB_routines.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/pmch_common.c
${OPENAIR1_DIR}/PHY/TOOLS/cadd_vv.c
${OPENAIR1_DIR}/PHY/TOOLS/cmult_sv.c
${OPENAIR1_DIR}/PHY/TOOLS/cmult_vv.c
${OPENAIR1_DIR}/PHY/LTE_UE_TRANSPORT/dlsch_llr_computation_avx2.c
${OPENAIR1_DIR}/PHY/TOOLS/signal_energy.c
${OPENAIR1_DIR}/PHY/LTE_ESTIMATION/lte_ue_measurements.c
${OPENAIR2_DIR}/UTIL/LOG/log.c
)
add_library(PHY_MEX ${PHY_MEX_UE})
#Layer 2 library
#####################
set(MAC_DIR ${OPENAIR2_DIR}/LAYER2/MAC)
......@@ -1814,11 +1838,13 @@ endif()
# So, here are some hacks here. Hope this gets fixed in future!
if(EXISTS "/usr/include/atlas/cblas.h" OR EXISTS "/usr/include/cblas.h")
include_directories("/usr/include/atlas")
LINK_DIRECTORIES("/usr/lib/lapack")
LINK_DIRECTORIES("/usr/lib64")
LINK_DIRECTORIES("/usr/lib64/atlas") #Added because atlas libraries in CentOS 7 are here!
if(EXISTS "/usr/lib64/libblas.so" OR EXISTS "/usr/lib/libblas.so") #Case for CentOS7
list(APPEND ATLAS_LIBRARIES blas)
else() # Case for Ubuntu
list(APPEND ATLAS_LIBRARIES cblas)
endif()
......@@ -1844,6 +1870,8 @@ else()
message("No Blas/Atlas libs found, some targets will fail")
endif()
list(APPEND ATLAS_LIBRARIES lapack lapacke)
if (${XFORMS})
include_directories ("/usr/include/X11")
set(XFORMS_SOURCE
......@@ -2005,7 +2033,7 @@ add_executable(lte-uesoftmodem
target_link_libraries (lte-uesoftmodem
-Wl,--start-group
RRC_LIB S1AP_LIB S1AP_ENB GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT UDP SCHED_RU_LIB SCHED_UE_LIB PHY_COMMON PHY_UE PHY_RU LFDS L2_UE SIMU
${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} LFDS7
${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} LFDS7 ${ATLAS_LIBRARIES}
NFAPI_COMMON_LIB NFAPI_LIB NFAPI_PNF_LIB NFAPI_USER_LIB
-Wl,--end-group z dl)
......@@ -2045,7 +2073,7 @@ add_executable(lte-uesoftmodem-nos1
target_link_libraries (lte-uesoftmodem-nos1
-Wl,--start-group
RRC_LIB SECU_CN SECU_OSA UTIL HASHTABLE SCHED_RU_LIB SCHED_UE_LIB PHY_COMMON PHY_UE PHY_RU LFDS L2_UE SIMU ${MSC_LIB} ${RAL_LIB} ${ITTI_LIB}
${MIH_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} LFDS7
${MIH_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} LFDS7 ${ATLAS_LIBRARIES}
NFAPI_COMMON_LIB NFAPI_LIB NFAPI_PNF_LIB NFAPI_USER_LIB
-Wl,--end-group z dl )
......
......@@ -549,6 +549,8 @@ check_install_oai_software() {
iptables-dev \
libatlas-base-dev \
libblas-dev \
liblapack-dev\
liblapacke-dev\
libffi-dev \
libforms-bin \
libforms-dev \
......
......@@ -165,49 +165,6 @@ int8_t delta_PUSCH_acc[4] = {-1,0,1,3};
int8_t *delta_PUCCH_lut = delta_PUSCH_acc;
uint8_t get_pmi(uint8_t N_RB_DL, MIMO_mode_t mode, uint32_t pmi_alloc,uint16_t rb)
{
/*
MIMO_mode_t mode = dlsch_harq->mimo_mode;
uint32_t pmi_alloc = dlsch_harq->pmi_alloc;
*/
switch (N_RB_DL) {
case 6: // 1 PRB per subband
if (mode <= PUSCH_PRECODING1)
return((pmi_alloc>>(rb<<1))&3);
else
return((pmi_alloc>>rb)&1);
break;
default:
case 25: // 4 PRBs per subband
if (mode <= PUSCH_PRECODING1)
return((pmi_alloc>>((rb>>2)<<1))&3);
else
return((pmi_alloc>>(rb>>2))&1);
break;
case 50: // 6 PRBs per subband
if (mode <= PUSCH_PRECODING1)
return((pmi_alloc>>((rb/6)<<1))&3);
else
return((pmi_alloc>>(rb/6))&1);
break;
case 100: // 8 PRBs per subband
if (mode <= PUSCH_PRECODING1)
return((pmi_alloc>>((rb>>3)<<1))&3);
else
return((pmi_alloc>>(rb>>3))&1);
break;
}
}
uint32_t check_phich_reg(LTE_DL_FRAME_PARMS *frame_parms,uint32_t kprime,uint8_t lprime,uint8_t mi)
{
......
......@@ -37,7 +37,7 @@
#include "PHY/LTE_TRANSPORT/transport_eNB.h"
#include "UTIL/LOG/vcd_signal_dumper.h"
#include "PHY/LTE_TRANSPORT/transport_proto.h"
#include "PHY/LTE_TRANSPORT/transport_common_proto.h"
//#define DEBUG_DLSCH_MODULATION
#define NEW_ALLOC_RE
......
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#include "PHY/LTE_UE_TRANSPORT/transport_proto_ue.h"
uint8_t get_pmi(uint8_t N_RB_DL, MIMO_mode_t mode, uint32_t pmi_alloc,uint16_t rb)
{
/*
MIMO_mode_t mode = dlsch_harq->mimo_mode;
uint32_t pmi_alloc = dlsch_harq->pmi_alloc;
*/
switch (N_RB_DL) {
case 6: // 1 PRB per subband
if (mode <= PUSCH_PRECODING1)
return((pmi_alloc>>(rb<<1))&3);
else
return((pmi_alloc>>rb)&1);
break;
default:
case 25: // 4 PRBs per subband
if (mode <= PUSCH_PRECODING1)
return((pmi_alloc>>((rb>>2)<<1))&3);
else
return((pmi_alloc>>(rb>>2))&1);
break;
case 50: // 6 PRBs per subband
if (mode <= PUSCH_PRECODING1)
return((pmi_alloc>>((rb/6)<<1))&3);
else
return((pmi_alloc>>(rb/6))&1);
break;
case 100: // 8 PRBs per subband
if (mode <= PUSCH_PRECODING1)
return((pmi_alloc>>((rb>>3)<<1))&3);
else
return((pmi_alloc>>(rb>>3))&1);
break;
}
}
This diff is collapsed.
#include<stdio.h>
#include<math.h>
#include<complex.h>
#include <stdlib.h>
#include "PHY/defs_UE.h"
/* FUNCTIONS FOR LINEAR PREPROCESSING: MMSE, WHITENNING, etc*/
void transpose(int N, float complex *A, float complex *Result);
void conjugate_transpose(int N, float complex *A, float complex *Result);
void H_hermH_plus_sigma2I(int N, int M, float complex *A, float sigma2, float complex *Result);
void HH_herm_plus_sigma2I(int M, int N, float complex *A, float sigma2, float complex *Result);
void eigen_vectors_values(int N, float complex *A, float complex *Vectors, float *Values_Matrix);
void lin_eq_solver(int N, float complex *A, float complex* B);
//float complex* lin_eq_solver (int N, float complex* A, float complex* B);
/* mutl_matrix_matrix_row_based performs multiplications when matrix is row-oriented H[0], H[1]; H[2], H[3]*/
void mutl_matrix_matrix_row_based(float complex* M0, float complex* M1, int rows_M0, int col_M0, int rows_M1, int col_M1, float complex* Result );
/* mutl_matrix_matrix_col_based performs multiplications matrix is column-oriented H[0], H[2]; H[1], H[3]*/
void mutl_matrix_matrix_col_based(float complex* M0, float complex* M1, int rows_M0, int col_M0, int rows_M1, int col_M1, float complex* Result );
void compute_MMSE(float complex* H, int order_H, float sigma2, float complex* W_MMSE);
void compute_white_filter(float complex* H, int order_H, float sigma2, float complex* U_1, float complex* D_1);
void mmse_processing_oai(LTE_UE_PDSCH *pdsch_vars,
LTE_DL_FRAME_PARMS *frame_parms,
PHY_MEASUREMENTS *measurements,
unsigned char first_symbol_flag,
MIMO_mode_t mimo_mode,
unsigned short mmse_flag,
int noise_power,
unsigned char symbol,
unsigned short nb_rb);
void precode_channel_est(int32_t **dl_ch_estimates_ext,
LTE_DL_FRAME_PARMS *frame_parms,
LTE_UE_PDSCH *pdsch_vars,
unsigned char symbol,
unsigned short nb_rb,
MIMO_mode_t mimo_mode);
void rxdataF_to_float(int32_t **rxdataF_ext,
float complex **rxdataF_f,
int n_rx,
int length,
int start_point);
void chan_est_to_float(int32_t **dl_ch_estimates_ext,
float complex **dl_ch_estimates_ext_f,
int n_tx,
int n_rx,
int length,
int start_point);
void float_to_chan_est(int32_t **dl_ch_estimates_ext,
float complex **dl_ch_estimates_ext_f,
int n_tx,
int n_rx,
int length,
int start_point);
void float_to_rxdataF(int32_t **rxdataF_ext,
float complex **rxdataF_f,
int n_tx,
int n_rx,
int length,
int start_point);
void mult_mmse_rxdataF(float complex** Wmmse,
float complex** rxdataF_ext_f,
int n_tx,
int n_rx,
int length,
int start_point);
void mult_mmse_chan_est(float complex** Wmmse,
float complex** dl_ch_estimates_ext_f,
int n_tx,
int n_rx,
int length,
int start_point);
void mmse_processing_core(int32_t **rxdataF_ext,
int32_t **dl_ch_estimates_ext,
int sigma2,
int n_tx,
int n_rx,
int length,
int start_point);
void mmse_processing_core_flp(float complex** rxdataF_ext_flcpx,
float complex **H,
int32_t **rxdataF_ext,
int32_t **dl_ch_estimates_ext,
float sigma2,
int n_tx,
int n_rx,
int length,
int start_point);
void whitening_processing_core_flp(float complex** rxdataF_ext_flcpx,
float complex **H,
int32_t **rxdataF_ext,
int32_t **dl_ch_estimates_ext,
float sigma2,
int n_tx,
int n_rx,
int length,
int start_point);
float sqrt_float(float x, float sqrt_x);
......@@ -106,6 +106,22 @@ void qpsk_qpsk(int16_t *stream0_in,
@param nb_rb number of RBs for this allocation
@param pbch_pss_sss_adj Number of channel bits taken by PBCH/PSS/SSS
@param llr128p pointer to pointer to symbol in dlsch_llr*/
void qpsk_llr(int16_t *stream0_in,
int16_t *stream0_out,
int length);
void qam16_llr(int16_t *stream0_in,
int16_t *chan_magn,
int16_t *llr,
int length);
void qam64_llr(int16_t *stream0_in,
int16_t *chan_magn,
int16_t *chan_magn_b,
int16_t *llr,
int length);
int32_t dlsch_qpsk_qpsk_llr(LTE_DL_FRAME_PARMS *frame_parms,
int32_t **rxdataF_comp,
int32_t **rxdataF_comp_i,
......@@ -816,6 +832,19 @@ void dlsch_channel_compensation(int32_t **rxdataF_ext,
uint8_t output_shift,
PHY_MEASUREMENTS *phy_measurements);
void dlsch_channel_compensation_core(int **rxdataF_ext,
int **dl_ch_estimates_ext,
int **dl_ch_mag,
int **dl_ch_magb,
int **rxdataF_comp,
int **rho,
unsigned char n_tx,
unsigned char n_rx,
unsigned char mod_order,
unsigned char output_shift,
int length,
int start_point);
void dlsch_dual_stream_correlation(LTE_DL_FRAME_PARMS *frame_parms,
unsigned char symbol,
unsigned short nb_rb,
......@@ -912,6 +941,7 @@ void dlsch_channel_compensation_TM34(LTE_DL_FRAME_PARMS *frame_parms,
int round,
MIMO_mode_t mimo_mode,
unsigned short nb_rb,
unsigned short mmse_flag,
unsigned char output_shift0,
unsigned char output_shift1);
......@@ -929,6 +959,13 @@ void dlsch_channel_level(int32_t **dl_ch_estimates_ext,
uint8_t pilots_flag,
uint16_t nb_rb);
void dlsch_channel_level_core(int32_t **dl_ch_estimates_ext,
int32_t *avg,
int n_tx,
int n_rx,
int length,
int start_point);
void dlsch_channel_level_TM34(int **dl_ch_estimates_ext,
LTE_DL_FRAME_PARMS *frame_parms,
......@@ -937,6 +974,7 @@ void dlsch_channel_level_TM34(int **dl_ch_estimates_ext,
int *avg_1,
uint8_t symbol,
unsigned short nb_rb,
unsigned int mmse_flag,
MIMO_mode_t mimo_mode);
......
......@@ -69,6 +69,38 @@
#include <pthread.h>
#include "assertions.h"
#ifdef MEX
#include "mex.h"
# define msg mexPrintf
# undef LOG_D
# undef LOG_E
# undef LOG_I
# undef LOG_N
# undef LOG_T
# undef LOG_W
# undef LOG_M
# define LOG_D(x, ...) mexPrintf(__VA_ARGS__)
# define LOG_E(x, ...) mexPrintf(__VA_ARGS__)
# define LOG_I(x, ...) mexPrintf(__VA_ARGS__)
# define LOG_N(x, ...) mexPrintf(__VA_ARGS__)
# define LOG_T(x, ...) mexPrintf(__VA_ARGS__)
# define LOG_W(x, ...) mexPrintf(__VA_ARGS__)
# define LOG_M(x, ...) mexPrintf(__VA_ARGS__)
#else
# ifdef OPENAIR2
# if ENABLE_RAL
# include "collection/hashtable/hashtable.h"
# include "COMMON/ral_messages_types.h"
# include "UTIL/queue.h"
# endif
# include "log.h"
# define msg(aRGS...) LOG_D(PHY, ##aRGS)
# else
# define msg printf
# endif
#endif
/// Context data structure for RX/TX portion of subframe processing
typedef struct {
......
......@@ -414,6 +414,8 @@ check_install_oai_software() {
test_install_package libatlas-dev
test_install_package libblas3gf
test_install_package libblas-dev
test_install_package liblapack-dev
test_install_package liblapack-dev
# if [ $MACHINE_ARCH = 64 ]; then
test_install_package libconfig8-dev
# else
......
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