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

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

Conflicts:
	cmake_targets/CMakeLists.txt
parents c836ef28 759c1342
......@@ -515,12 +515,12 @@ set (CONFIG_SOURCES
${CONFIG_ROOTDIR}/config_load_configmodule.c
${CONFIG_ROOTDIR}/config_userapi.c
${CONFIG_ROOTDIR}/config_cmdline.c
)
)
set (CONFIG_LIBCONFIG_SOURCES
${CONFIG_ROOTDIR}/libconfig/config_libconfig.c
)
)
add_library(params_libconfig MODULE ${CONFIG_LIBCONFIG_SOURCES} )
target_link_libraries(params_libconfig config)
target_link_libraries(params_libconfig config)
# shared library loader
set (SHLIB_LOADER_SOURCES
${OPENAIR_DIR}/common/utils/load_module_shlib.c
......@@ -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
......@@ -984,7 +985,7 @@ set(SECU_CN_SRC
)
add_library(SECU_CN ${SECU_CN_SRC})
# Physical Channel Procedures Scheduling
# Physical Channel Procedures Scheduling
################################"
set(SCHED_SRC
${OPENAIR1_DIR}/SCHED/fapi_l1.c
......@@ -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
......@@ -1926,7 +1954,7 @@ add_executable(lte-softmodem
target_link_libraries (lte-softmodem
-Wl,--start-group
RRC_LIB S1AP_LIB S1AP_ENB GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB SCHED_RU_LIB PHY_COMMON PHY PHY_RU LFDS L2
RRC_LIB S1AP_LIB S1AP_ENB GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB SCHED_RU_LIB PHY_COMMON PHY PHY_RU LFDS L2
${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} LFDS7
NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB
-Wl,--end-group z dl)
......@@ -1964,7 +1992,7 @@ add_executable(lte-softmodem-nos1
)
target_link_libraries (lte-softmodem-nos1
-Wl,--start-group
RRC_LIB SECU_CN SECU_OSA UTIL HASHTABLE SCHED_LIB SCHED_RU_LIB PHY_COMMON PHY PHY_RU LFDS L2 ${MSC_LIB} ${RAL_LIB} ${ITTI_LIB}
RRC_LIB SECU_CN SECU_OSA UTIL HASHTABLE SCHED_LIB SCHED_RU_LIB PHY_COMMON PHY PHY_RU LFDS L2 ${MSC_LIB} ${RAL_LIB} ${ITTI_LIB}
${MIH_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} LFDS7
NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB
-Wl,--end-group z dl )
......@@ -2004,8 +2032,8 @@ 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
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 ${ATLAS_LIBRARIES}
NFAPI_COMMON_LIB NFAPI_LIB NFAPI_PNF_LIB NFAPI_USER_LIB
-Wl,--end-group z dl)
......@@ -2044,8 +2072,8 @@ 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
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 ${ATLAS_LIBRARIES}
NFAPI_COMMON_LIB NFAPI_LIB NFAPI_PNF_LIB NFAPI_USER_LIB
-Wl,--end-group z dl )
......
......@@ -56,7 +56,7 @@ white='\E[37m'
reset_color='\E[00m'
COLORIZE=1
cecho() {
cecho() {
# Color-echo
# arg1 = message
# arg2 = color
......@@ -147,10 +147,10 @@ clean_kernel() {
clean_all_files() {
set_openair_env
dir=$OPENAIR_DIR/cmake_targets
rm -rf $dir/log $OPENAIR_DIR/targets/bin/*
rm -rf $dir/log $OPENAIR_DIR/targets/bin/*
rm -rf $dir/lte_build_oai $dir/lte-simulators/build
rm -rf $dir/oaisim_build_oai/build $dir/oaisim_build_oai/CMakeLists.txt
rm -rf $dir/autotests/bin $dir/autotests/log $dir/autotests/*/build
rm -rf $dir/autotests/bin $dir/autotests/log $dir/autotests/*/build
}
###################################
......@@ -272,7 +272,7 @@ check_install_usrp_uhd_driver(){
v=$(lsb_release -cs)
$SUDO apt-add-repository --remove "deb http://files.ettus.com/binaries/uhd/repo/uhd/ubuntu/$v $v main"
# The new USRP repository
# Raphael Defosseux: Adding a loop on adding PPA because in CI the gpg key retrieve may
# Raphael Defosseux: Adding a loop on adding PPA because in CI the gpg key retrieve may
# timeout due to proxy / network latencies in Eurecom on VM
echo_info "\nAdding PPA repository ettusresearch/uhd\n"
x=0
......@@ -352,7 +352,7 @@ check_install_bladerf_driver(){
fi
$SUDO apt-get install -y --allow-unauthenticated bladerf libbladerf-dev
$SUDO apt-get install -y --allow-unauthenticated bladerf-firmware-fx3
$SUDO apt-get install -y --allow-unauthenticated bladerf-fpga-hostedx40
$SUDO apt-get install -y --allow-unauthenticated bladerf-fpga-hostedx40
elif [[ "$OS_BASEDISTRO" == "fedora" ]]; then
install_bladerf_driver_from_source
else
......@@ -373,7 +373,7 @@ check_install_lmssdr_driver(){
echo_error "lmssdr support implies installing lmssdr drivers and tools" \
" from sources. check:"
echo_info "https://open-cells.com/index.php/2017/05/10/limesdr-installation/"
echo_fatal "Cannot compile lmssdr device"
echo_fatal "Cannot compile lmssdr device"
fi
......@@ -470,7 +470,7 @@ check_install_additional_tools (){
python2-matplotlib"
fi
$SUDO $INSTALLER install -y $PACKAGE_LIST
$SUDO rm -fr /opt/ssh
$SUDO GIT_SSL_NO_VERIFY=true git clone https://gitlab.eurecom.fr/oai/ssh.git /opt/ssh
......@@ -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 \
......@@ -602,7 +604,7 @@ check_install_oai_software() {
# Fedora repos already contain gccxml's successor castxml.
$SUDO $INSTALLER install -y castxml
fi
$SUDO $INSTALLER install -y \
autoconf \
automake \
......@@ -689,7 +691,7 @@ install_asn1c_from_source(){
}
#################################################
# 2. compile
# 2. compile
################################################
install_nas_tools() {
......@@ -718,7 +720,7 @@ set_openair_env(){
[ -f "/.$fullpath" ] || fullpath=`readlink -f $PWD/$fullpath`
openair_path=${fullpath%/cmake_targets/*}
openair_path=${openair_path%/targets/*}
openair_path=${openair_path%/openair[123]/*}
openair_path=${openair_path%/openair[123]/*}
export OPENAIR_DIR=$openair_path
export OPENAIR1_DIR=$openair_path/openair1
export OPENAIR2_DIR=$openair_path/openair2
......@@ -735,7 +737,7 @@ ppid=$$
arraycounter=1
echo_info "** Trapped CTRL-C. Killing all subprocesses now..."
echo_info "** Calling sync now..."
sync
sync
while true
do
FORLOOP=FALSE
......@@ -753,7 +755,7 @@ do
arraycounter=`expr $arraycounter - 1`
## We want to kill child process id first and then parent id's
while [ $arraycounter -ne 0 ]
do
do
echo "first we send ctrl-c to program"
$SUDO kill -INT "${procid[$arraycounter]}"
sleep 5
......
......@@ -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)
{
......@@ -330,7 +287,7 @@ void conv_eMTC_rballoc(uint16_t resource_block_coding,
uint32_t N_RB_DL,
uint32_t *rb_alloc) {
int narrowband = resource_block_coding>>5;
int RIV = resource_block_coding&31;
int N_NB_DL = N_RB_DL/6;
......@@ -346,7 +303,7 @@ void conv_eMTC_rballoc(uint16_t resource_block_coding,
rb_alloc[2] = 0;
rb_alloc[3] = 0;
rb_alloc[ind] = alloc<<ind_mod;
if (ind_mod > 26) rb_alloc[ind+1] = alloc>>(6-(ind_mod-26));
if (ind_mod > 26) rb_alloc[ind+1] = alloc>>(6-(ind_mod-26));
}
void conv_rballoc(uint8_t ra_header,uint32_t rb_alloc,uint32_t N_RB_DL,uint32_t *rb_alloc2)
......@@ -410,7 +367,7 @@ void conv_rballoc(uint8_t ra_header,uint32_t rb_alloc,uint32_t N_RB_DL,uint32_t
// bit mask across
if ((rb_alloc2[0]>>31)==1)
rb_alloc2[1] |= 1;
if ((rb_alloc&1) != 0)
rb_alloc2[1] |= (3<<16);
break;
......@@ -420,7 +377,7 @@ void conv_rballoc(uint8_t ra_header,uint32_t rb_alloc,uint32_t N_RB_DL,uint32_t
for (i=0; i<25; i++) {
if ((rb_alloc&(1<<(24-i))) != 0)
rb_alloc2[(4*i)>>5] |= (0xf<<((4*i)%32));
// printf("rb_alloc2[%d] (type 0) %x (%d)\n",(4*i)>>5,rb_alloc2[(4*i)>>5],rb_alloc&(1<<i));
}
......
......@@ -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
......@@ -714,8 +714,8 @@ int allocate_REs_in_RB(PHY_VARS_eNB* phy_vars_eNB,
int first_layer0 = -1; //= dlsch0_harq->first_layer;
int Nlayers0 = -1; // = dlsch0_harq->Nlayers;
uint8_t mod_order0=0;
uint8_t mod_order1=0;
uint8_t mod_order0=0;
uint8_t mod_order1=0;
uint8_t precoder_index0,precoder_index1;
uint8_t *x1=NULL;
......
......@@ -642,7 +642,7 @@ int dlsch_qpsk_llr(LTE_DL_FRAME_PARMS *frame_parms,
uint32_t *rxF = (uint32_t*)&rxdataF_comp[0][((int32_t)symbol*frame_parms->N_RB_DL*12)];
uint32_t *llr32;
int i,len;
int len;
uint8_t symbol_mod = (symbol >= (7-frame_parms->Ncp))? (symbol-(7-frame_parms->Ncp)) : symbol;
/*
......@@ -681,19 +681,28 @@ int dlsch_qpsk_llr(LTE_DL_FRAME_PARMS *frame_parms,
dlsch_llr,
llr32);
*/
//printf("ll32p=%p , dlsch_llr=%p, symbol=%d, flag=%d \n", llr32, dlsch_llr, symbol, first_symbol_flag);
for (i=0; i<len; i++) {
*llr32 = *rxF;
//printf("llr %d : (%d,%d)\n",i,((int16_t*)llr32)[0],((int16_t*)llr32)[1]);
rxF++;
llr32++;
}
//*llr32p = (int16_t *)llr32;
qpsk_llr((short *)rxF,
(short *)llr32,
len);
return(0);
}
void qpsk_llr(int16_t *stream0_in,
int16_t *stream0_out,
int length)
{
int i;
for (i=0; i<2*length; i++) {
*stream0_out = *stream0_in;
//printf("llr %d : (%d,%d)\n",i,((int16_t*)stream0_out)[0],((int16_t*)stream0_out)[1]);
stream0_in++;
stream0_out++;
}
}
int32_t dlsch_qpsk_llr_SIC(LTE_DL_FRAME_PARMS *frame_parms,
int32_t **rxdataF_comp,
int32_t **sic_buffer, //Q15
......@@ -817,45 +826,21 @@ void dlsch_16qam_llr(LTE_DL_FRAME_PARMS *frame_parms,
int16_t **llr32p,
uint8_t beamforming_mode)
{
int32_t *rxF = (int32_t*)&rxdataF_comp[0][(symbol*frame_parms->N_RB_DL*12)];
int32_t *ch_mag = (int32_t*)&dl_ch_mag[0][(symbol*frame_parms->N_RB_DL*12)];
int32_t *llr32;
#if defined(__x86_64__) || defined(__i386__)
__m128i *rxF = (__m128i*)&rxdataF_comp[0][(symbol*frame_parms->N_RB_DL*12)];
__m128i *ch_mag;
__m128i llr128[2];
uint32_t *llr32;
#elif defined(__arm__)
int16x8_t *rxF = (int16x8_t*)&rxdataF_comp[0][(symbol*frame_parms->N_RB_DL*12)];
int16x8_t *ch_mag;
int16x8_t xmm0;
int16_t *llr16;
#endif
int i,len;
int len;
unsigned char symbol_mod,len_mod4=0;
#if defined(__x86_64__) || defined(__i386__)
if (first_symbol_flag==1) {
llr32 = (uint32_t*)dlsch_llr;
} else {
llr32 = (uint32_t*)*llr32p;
}
#elif defined(__arm__)
if (first_symbol_flag==1) {
llr16 = (int16_t*)dlsch_llr;
llr32 = (int32_t*)dlsch_llr;
} else {
llr16 = (int16_t*)*llr32p;
llr32 = (int32_t*)*llr32p;
}
#endif
symbol_mod = (symbol>=(7-frame_parms->Ncp)) ? symbol-(7-frame_parms->Ncp) : symbol;
#if defined(__x86_64__) || defined(__i386__)
ch_mag = (__m128i*)&dl_ch_mag[0][(symbol*frame_parms->N_RB_DL*12)];
#elif defined(__arm__)
ch_mag = (int16x8_t*)&dl_ch_mag[0][(symbol*frame_parms->N_RB_DL*12)];
#endif
if ((symbol_mod==0) || (symbol_mod==(4-frame_parms->Ncp))) {
if (frame_parms->nb_antenna_ports_eNB!=1)
len = (nb_rb*8) - (2*pbch_pss_sss_adjust/3);
......@@ -881,18 +866,45 @@ void dlsch_16qam_llr(LTE_DL_FRAME_PARMS *frame_parms,
len>>=2; // length in quad words (4 REs)
// printf("len>>=2=%d\n", len);
len+=(len_mod4==0 ? 0 : 1);
// printf("len+=%d\n", len);
for (i=0; i<len; i++) {
qam16_llr((short *)rxF,
(short *)ch_mag,
(short *)llr32,
len);
// printf ("This line in qam16_llr is %d.\n", __LINE__);
}
void qam16_llr(int16_t *stream0_in,
int16_t *chan_magn,
int16_t *llr,
int length)
{
int i;
#if defined(__x86_64__) || defined(__i386__)
__m128i *rxF_128 = (__m128i*)stream0_in;
__m128i *ch_mag_128 = (__m128i*)chan_magn;
__m128i llr128[2];
int32_t *llr32 = (int32_t*) llr;
#elif defined(__arm__)
int16x8_t *rxF_128 = (int16x8_t*)stream0_in;
int16x8_t *ch_mag_128 = (int16x8_t*)chan_magn;
int16x8_t xmm0;
int16_t *llr16 = (int16_t*)llr;
#endif
// printf ("This line in qam16_llr is %d.\n", __LINE__);
for (i=0; i<length; i++) {
#if defined(__x86_64__) || defined(__i386)
xmm0 = _mm_abs_epi16(rxF[i]);
xmm0 = _mm_subs_epi16(ch_mag[i],xmm0);
xmm0 = _mm_abs_epi16(rxF_128[i]);
xmm0 = _mm_subs_epi16(ch_mag_128[i],xmm0);
// lambda_1=y_R, lambda_2=|y_R|-|h|^2, lamda_3=y_I, lambda_4=|y_I|-|h|^2
llr128[0] = _mm_unpacklo_epi32(rxF[i],xmm0);
llr128[1] = _mm_unpackhi_epi32(rxF[i],xmm0);
llr128[0] = _mm_unpacklo_epi32(rxF_128[i],xmm0);
llr128[1] = _mm_unpackhi_epi32(rxF_128[i],xmm0);
llr32[0] = _mm_extract_epi32(llr128[0],0); //((uint32_t *)&llr128[0])[0];
llr32[1] = _mm_extract_epi32(llr128[0],1); //((uint32_t *)&llr128[0])[1];
llr32[1] = _mm_extract_epi32(llr128[0],1); //((uint32_t *)&llr128[0])[0];
llr32[2] = _mm_extract_epi32(llr128[0],2); //((uint32_t *)&llr128[0])[2];
llr32[3] = _mm_extract_epi32(llr128[0],3); //((uint32_t *)&llr128[0])[3];
llr32[4] = _mm_extract_epi32(llr128[1],0); //((uint32_t *)&llr128[1])[0];
......@@ -922,14 +934,17 @@ void dlsch_16qam_llr(LTE_DL_FRAME_PARMS *frame_parms,
llr16[14] = vgetq_lane_s16(xmm0,7);
llr16[15] = vgetq_lane_s16(xmm0,7);
llr16+=16;
#endif
}
#if defined(__x86_64__) || defined(__i386__)
#if defined(__x86_64__) || defined(__i386)
_mm_empty();
_m_empty();
#endif
}
void dlsch_16qam_llr_SIC (LTE_DL_FRAME_PARMS *frame_parms,
......@@ -1036,6 +1051,7 @@ void dlsch_16qam_llr_SIC (LTE_DL_FRAME_PARMS *frame_parms,
}
}
//----------------------------------------------------------------------------------------------
// 64-QAM
//----------------------------------------------------------------------------------------------
......@@ -1053,14 +1069,10 @@ void dlsch_64qam_llr(LTE_DL_FRAME_PARMS *frame_parms,
uint32_t llr_offset,
uint8_t beamforming_mode)
{
#if defined(__x86_64__) || defined(__i386__)
__m128i *rxF = (__m128i*)&rxdataF_comp[0][(symbol*frame_parms->N_RB_DL*12)];
__m128i *ch_mag,*ch_magb;
#elif defined(__arm__)
int16x8_t *rxF = (int16x8_t*)&rxdataF_comp[0][(symbol*frame_parms->N_RB_DL*12)];
int16x8_t *ch_mag,*ch_magb,xmm1,xmm2;
#endif
int i,len,len2;
int32_t *rxF = (int32_t*)&rxdataF_comp[0][(symbol*frame_parms->N_RB_DL*12)];
int32_t *ch_mag = (int32_t*)&dl_ch_mag[0][(symbol*frame_parms->N_RB_DL*12)];
int32_t *ch_magb = (int32_t*)&dl_ch_magb[0][(symbol*frame_parms->N_RB_DL*12)];
int len,len2;
unsigned char symbol_mod,len_mod4;
short *llr;
int16_t *llr2;
......@@ -1079,13 +1091,6 @@ void dlsch_64qam_llr(LTE_DL_FRAME_PARMS *frame_parms,
symbol_mod = (symbol>=(7-frame_parms->Ncp)) ? symbol-(7-frame_parms->Ncp) : symbol;
#if defined(__x86_64__) || defined(__i386__)
ch_mag = (__m128i*)&dl_ch_mag[0][(symbol*frame_parms->N_RB_DL*12)];
ch_magb = (__m128i*)&dl_ch_magb[0][(symbol*frame_parms->N_RB_DL*12)];
#elif defined(__arm__)
ch_mag = (int16x8_t*)&dl_ch_mag[0][(symbol*frame_parms->N_RB_DL*12)];
ch_magb = (int16x8_t*)&dl_ch_magb[0][(symbol*frame_parms->N_RB_DL*12)];
#endif
if ((symbol_mod==0) || (symbol_mod==(4-frame_parms->Ncp))) {
if (frame_parms->nb_antenna_ports_eNB!=1)
len = (nb_rb*8) - (2*pbch_pss_sss_adjust/3);
......@@ -1115,18 +1120,49 @@ void dlsch_64qam_llr(LTE_DL_FRAME_PARMS *frame_parms,
len2=len>>2; // length in quad words (4 REs)
len2+=((len_mod4==0)?0:1);
for (i=0; i<len2; i++) {
qam64_llr((short *)rxF,
(short *)ch_mag,
(short *)ch_magb,
llr2,
len2);
}
void qam64_llr(int16_t *stream0_in,
int16_t *chan_magn,
int16_t *chan_magn_b,
int16_t *llr,
int length)
{
#if defined(__x86_64__) || defined(__i386__)
xmm1 = _mm_abs_epi16(rxF[i]);
xmm1 = _mm_subs_epi16(ch_mag[i],xmm1);
__m128i *rxF_128 = (__m128i*)stream0_in;
__m128i *ch_mag_128 = (__m128i*)chan_magn;
__m128i *ch_magb_128 = (__m128i*)chan_magn_b;
#elif defined(__arm__)
int16x8_t *rxF_128 = (int16x8_t*)stream0_in;
int16x8_t *ch_mag_128 = (int16x8_t*)chan_magn;
int16x8_t *ch_magb_128 = (int16x8_t*)chan_magn_b;
int16x8_t xmm1,xmm2;
#endif
int i;
//int16_t *llr2;
//llr2 = llr;
for (i=0; i<length; i++) {
#if defined(__x86_64__) || defined(__i386__)
xmm1 = _mm_abs_epi16(rxF_128[i]);
xmm1 = _mm_subs_epi16(ch_mag_128[i],xmm1);
xmm2 = _mm_abs_epi16(xmm1);
xmm2 = _mm_subs_epi16(ch_magb[i],xmm2);
xmm2 = _mm_subs_epi16(ch_magb_128[i],xmm2);
#elif defined(__arm__)
xmm1 = vabsq_s16(rxF[i]);
xmm1 = vsubq_s16(ch_mag[i],xmm1);
xmm1 = vabsq_s16(rxF_128[i]);
xmm1 = vsubq_s16(ch_mag_128[i],xmm1);
xmm2 = vabsq_s16(xmm1);
xmm2 = vsubq_s16(ch_magb[i],xmm2);
xmm2 = vsubq_s16(ch_magb_128[i],xmm2);
#endif
// loop over all LLRs in quad word (24 coded bits)
/*
......@@ -1141,64 +1177,64 @@ void dlsch_64qam_llr(LTE_DL_FRAME_PARMS *frame_parms,