diff --git a/CMakeLists.txt b/CMakeLists.txt index 015e66e46d..98dba37442 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -926,7 +926,6 @@ set(PHY_SRC_UE ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/sss_gen.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 @@ -1072,16 +1071,8 @@ add_dependencies(PHY_COMMON dfts) add_library(PHY ${PHY_SRC}) target_link_libraries(PHY PRIVATE asn1_lte_rrc_hdrs asn1_nr_rrc_hdrs) -pkg_check_modules(blas REQUIRED blas) -pkg_check_modules(lapacke REQUIRED lapacke) - add_library(PHY_UE ${PHY_SRC_UE}) target_link_libraries(PHY_UE PRIVATE asn1_lte_rrc_hdrs asn1_nr_rrc_hdrs UTIL) -# RHEL needs also cblas, but Ubuntu does not have it. So `cblas_LIBRARIES` and -# `cblas_INCLUDE_DIRS` will be empty for Ubuntu, a no-op -pkg_check_modules(cblas cblas) -target_link_libraries(PHY_UE PRIVATE ${blas_LIBRARIES} ${cblas_LIBRARIES} ${lapacke_LIBRARIES}) -target_include_directories(PHY_UE PRIVATE ${blas_INCLUDE_DIRS} ${cblas_INCLUDE_DIRS} ${lapacke_INCLUDE_DIRS}) add_library(PHY_NR_COMMON ${PHY_NR_SRC_COMMON}) target_link_libraries(PHY_NR_COMMON PUBLIC UTIL) @@ -1773,7 +1764,6 @@ target_link_libraries(lte-softmodem PRIVATE target_link_libraries(lte-softmodem PRIVATE pthread m CONFIG_LIB rt) target_link_libraries(lte-softmodem PRIVATE ${T_LIB}) target_link_libraries(lte-softmodem PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs) -target_link_libraries(lte-softmodem PRIVATE ${blas_LIBRARIES} ${cblas_LIBRARIES} ${lapacke_LIBRARIES} ${lapack_LIBRARIES}) if(E2_AGENT) target_link_libraries(lte-softmodem PUBLIC e2_agent e2_agent_arg e2_ran_func_du_cucp_cuup) @@ -1824,7 +1814,6 @@ target_link_libraries(lte-uesoftmodem PRIVATE target_link_libraries(lte-uesoftmodem PRIVATE pthread m CONFIG_LIB rt) target_link_libraries(lte-uesoftmodem PRIVATE ${T_LIB}) target_link_libraries(lte-uesoftmodem PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs) -target_link_libraries(lte-uesoftmodem PRIVATE ${blas_LIBRARIES} ${cblas_LIBRARIES} ${lapacke_LIBRARIES} ${lapack_LIBRARIES}) # force the generation of ASN.1 so that we don't need to wait during the build target_link_libraries(lte-uesoftmodem PRIVATE diff --git a/cmake_targets/tools/build_helper b/cmake_targets/tools/build_helper index 74d45cda9b..64c171276c 100755 --- a/cmake_targets/tools/build_helper +++ b/cmake_targets/tools/build_helper @@ -496,9 +496,6 @@ check_install_oai_software() { ninja-build \ pkg-config \ git \ - libblas-dev \ - liblapack-dev \ - liblapacke-dev \ libreadline-dev \ libconfig-dev \ libsctp-dev \ @@ -536,10 +533,6 @@ check_install_oai_software() { openssl-devel \ patch \ readline-devel \ - lapack \ - lapack-devel \ - blas \ - blas-devel \ vim-common \ zlib-devel \ yaml-cpp-devel diff --git a/doc/cross-compile.md b/doc/cross-compile.md index 69e59cb832..62ad99deb1 100644 --- a/doc/cross-compile.md +++ b/doc/cross-compile.md @@ -42,10 +42,7 @@ sudo apt install -y gcc-aarch64-linux-gnu \ g++-aarch64-linux-gnu sudo apt-get install -y \ - libblas-dev:arm64 \ libc6-dev-i386 \ - liblapack-dev:arm64 \ - liblapacke-dev:arm64 \ libreadline-dev:arm64 \ libgnutls28-dev:arm64 \ libconfig-dev:arm64 \ diff --git a/docker/Dockerfile.base.ubuntu.cross-arm64 b/docker/Dockerfile.base.ubuntu.cross-arm64 index 1365df71fe..fa9918eda8 100644 --- a/docker/Dockerfile.base.ubuntu.cross-arm64 +++ b/docker/Dockerfile.base.ubuntu.cross-arm64 @@ -57,9 +57,6 @@ RUN apt-get update && \ tzdata \ xxd \ # ARM64 packages - libblas-dev:arm64 \ - liblapack-dev:arm64 \ - liblapacke-dev:arm64 \ libreadline-dev:arm64 \ libgnutls28-dev:arm64 \ libconfig-dev:arm64 \ diff --git a/docker/Dockerfile.eNB.ubuntu b/docker/Dockerfile.eNB.ubuntu index d0312f8cce..6229bf9028 100644 --- a/docker/Dockerfile.eNB.ubuntu +++ b/docker/Dockerfile.eNB.ubuntu @@ -51,7 +51,6 @@ RUN apt-get update && \ libboost-system1.83.0 \ libboost-program-options1.83.0 \ tzdata \ - libblas3 \ libconfig9 \ openssl \ net-tools \ @@ -74,8 +73,7 @@ RUN apt-get update && \ # if the --sanitize option was used to build, additional packages are required /bin/bash -c 'if [[ "$BUILD_OPTION" = "--sanitize" ]]; then DEBIAN_FRONTEND=noninteractive apt-get install --yes \ libasan8 \ - libubsan1 \ - liblapacke; fi' && \ + libubsan1 ; fi' && \ apt-get clean -y && \ rm -rf /var/lib/apt/lists/* diff --git a/docker/Dockerfile.gNB.aerial.ubuntu b/docker/Dockerfile.gNB.aerial.ubuntu index b79ab78fa8..980c909c4d 100644 --- a/docker/Dockerfile.gNB.aerial.ubuntu +++ b/docker/Dockerfile.gNB.aerial.ubuntu @@ -70,7 +70,6 @@ RUN apt-get update && \ procps \ libsctp1 \ tzdata \ - libblas3 \ libconfig9 \ openssl \ net-tools \ diff --git a/docker/Dockerfile.gNB.aerial.ubuntu.sanitize-address b/docker/Dockerfile.gNB.aerial.ubuntu.sanitize-address index 07b6d7111b..1792836b85 100644 --- a/docker/Dockerfile.gNB.aerial.ubuntu.sanitize-address +++ b/docker/Dockerfile.gNB.aerial.ubuntu.sanitize-address @@ -69,7 +69,6 @@ RUN apt-get update && \ procps \ libsctp1 \ tzdata \ - libblas3 \ libconfig9 \ openssl \ net-tools \ diff --git a/docker/Dockerfile.gNB.aw2s.ubuntu b/docker/Dockerfile.gNB.aw2s.ubuntu index 840b4a8a28..7826afd794 100644 --- a/docker/Dockerfile.gNB.aw2s.ubuntu +++ b/docker/Dockerfile.gNB.aw2s.ubuntu @@ -48,7 +48,6 @@ RUN apt-get update && \ procps \ libsctp1 \ tzdata \ - libblas3 \ libc6 \ libconfig9 \ gdb \ diff --git a/docker/Dockerfile.gNB.fhi72.rhel9 b/docker/Dockerfile.gNB.fhi72.rhel9 index bbcfe7b42d..50ac7ab78a 100644 --- a/docker/Dockerfile.gNB.fhi72.rhel9 +++ b/docker/Dockerfile.gNB.fhi72.rhel9 @@ -101,10 +101,6 @@ COPY --from=gnb-build /usr/local/lib64/flexric /usr/local/lib64/flexric COPY --from=gnb-base \ /lib64/libconfig.so.11 \ /lib64/libforms.so.2 \ - /lib64/libblas.so.3 \ - /lib64/libcblas.so.3 \ - /lib64/liblapack.so.3 \ - /lib64/liblapacke.so.3 \ /lib64/libicudata.so.67 \ /lib64/libicui18n.so.67 \ /lib64/libicuuc.so.67 \ diff --git a/docker/Dockerfile.gNB.fhi72.rocky b/docker/Dockerfile.gNB.fhi72.rocky index ba7861d1bf..816fa16be6 100644 --- a/docker/Dockerfile.gNB.fhi72.rocky +++ b/docker/Dockerfile.gNB.fhi72.rocky @@ -90,10 +90,6 @@ COPY --from=gnb-build /usr/local/lib64/flexric /usr/local/lib64/flexric COPY --from=gnb-base \ /lib64/libconfig.so.11 \ /lib64/libforms.so.2 \ - /lib64/libblas.so.3 \ - /lib64/libcblas.so.3 \ - /lib64/liblapack.so.3 \ - /lib64/liblapacke.so.3 \ /lib64/libicudata.so.67 \ /lib64/libicui18n.so.67 \ /lib64/libicuuc.so.67 \ diff --git a/docker/Dockerfile.gNB.fhi72.ubuntu b/docker/Dockerfile.gNB.fhi72.ubuntu index 09af53eed5..03e21e4688 100644 --- a/docker/Dockerfile.gNB.fhi72.ubuntu +++ b/docker/Dockerfile.gNB.fhi72.ubuntu @@ -44,7 +44,6 @@ RUN apt-get update && \ pkg-config \ libsctp1 \ tzdata \ - libblas3 \ libconfig9 \ openssl \ net-tools \ @@ -63,8 +62,7 @@ RUN apt-get update && \ # if the --sanitize option was used to build, additional packages are required /bin/bash -c 'if [[ "$BUILD_OPTION" = "--sanitize" ]]; then DEBIAN_FRONTEND=noninteractive apt-get install --yes \ libasan8 \ - libubsan1 \ - liblapacke; fi' && \ + libubsan1 ; fi' && \ rm -rf /var/lib/apt/lists/* WORKDIR /opt/oai-gnb/bin diff --git a/docker/Dockerfile.gNB.ubuntu b/docker/Dockerfile.gNB.ubuntu index 45017486b3..9156ce98c8 100644 --- a/docker/Dockerfile.gNB.ubuntu +++ b/docker/Dockerfile.gNB.ubuntu @@ -51,7 +51,6 @@ RUN apt-get update && \ libboost-system1.83.0 \ libboost-program-options1.83.0 \ tzdata \ - libblas3 \ libconfig9 \ openssl \ net-tools \ @@ -69,8 +68,7 @@ RUN apt-get update && \ # if the --sanitize option was used to build, additional packages are required /bin/bash -c 'if [[ "$BUILD_OPTION" = "--sanitize" ]]; then DEBIAN_FRONTEND=noninteractive apt-get install --yes \ libasan8 \ - libubsan1 \ - liblapacke; fi' && \ + libubsan1; fi' && \ apt-get clean -y && \ rm -rf /var/lib/apt/lists/* diff --git a/docker/Dockerfile.lteRU.ubuntu b/docker/Dockerfile.lteRU.ubuntu index dbfc94055a..9bf886a096 100644 --- a/docker/Dockerfile.lteRU.ubuntu +++ b/docker/Dockerfile.lteRU.ubuntu @@ -49,7 +49,6 @@ RUN apt-get update && \ libboost-thread1.83.0 \ libboost-system1.83.0 \ libboost-program-options1.83.0 \ - libblas3 \ libconfig9 \ net-tools \ gdb \ diff --git a/docker/Dockerfile.lteUE.rhel9 b/docker/Dockerfile.lteUE.rhel9 index 6dee43cbac..2a8a828633 100644 --- a/docker/Dockerfile.lteUE.rhel9 +++ b/docker/Dockerfile.lteUE.rhel9 @@ -73,10 +73,6 @@ COPY --from=lte-ue-build \ COPY --from=lte-ue-base \ /lib64/libconfig.so.11 \ - /lib64/libblas.so.3 \ - /lib64/libcblas.so.3 \ - /lib64/liblapack.so.3 \ - /lib64/liblapacke.so.3 \ /lib64/libboost_chrono.so.1.75.0 \ /lib64/libboost_date_time.so.1.75.0 \ /lib64/libboost_filesystem.so.1.75.0 \ diff --git a/docker/Dockerfile.lteUE.rocky b/docker/Dockerfile.lteUE.rocky index 5f968b266a..19fea4ab4f 100644 --- a/docker/Dockerfile.lteUE.rocky +++ b/docker/Dockerfile.lteUE.rocky @@ -74,10 +74,6 @@ COPY --from=lte-ue-build \ COPY --from=lte-ue-base \ /lib64/libconfig.so.11 \ - /lib64/libblas.so.3 \ - /lib64/libcblas.so.3 \ - /lib64/liblapack.so.3 \ - /lib64/liblapacke.so.3 \ /lib64/libboost_chrono.so.1.75.0 \ /lib64/libboost_date_time.so.1.75.0 \ /lib64/libboost_filesystem.so.1.75.0 \ diff --git a/docker/Dockerfile.lteUE.ubuntu b/docker/Dockerfile.lteUE.ubuntu index 909c137ddd..7c608c0077 100644 --- a/docker/Dockerfile.lteUE.ubuntu +++ b/docker/Dockerfile.lteUE.ubuntu @@ -51,8 +51,6 @@ RUN apt-get update && \ libboost-system1.83.0 \ libboost-program-options1.83.0 \ tzdata \ - liblapacke \ - libblas3 \ libconfig9 \ openssl \ net-tools \ @@ -75,8 +73,7 @@ RUN apt-get update && \ # if the --sanitize option was used to build, additional packages are required /bin/bash -c 'if [[ "$BUILD_OPTION" = "--sanitize" ]]; then DEBIAN_FRONTEND=noninteractive apt-get install --yes \ libasan8 \ - libubsan1 \ - liblapacke; fi' && \ + libubsan1 ; fi' && \ apt-get clean -y && \ rm -rf /var/lib/apt/lists/* diff --git a/docker/Dockerfile.nr-cuup.ubuntu b/docker/Dockerfile.nr-cuup.ubuntu index 33fd01ab0e..ed00800582 100644 --- a/docker/Dockerfile.nr-cuup.ubuntu +++ b/docker/Dockerfile.nr-cuup.ubuntu @@ -47,8 +47,7 @@ RUN apt-get update && \ # if the --sanitize option was used to build, additional packages are required /bin/bash -c 'if [[ "$BUILD_OPTION" = "--sanitize" ]]; then DEBIAN_FRONTEND=noninteractive apt-get install --yes \ libasan8 \ - libubsan1 \ - liblapacke; fi' && \ + libubsan1; fi' && \ rm -rf /var/lib/apt/lists/* ## Copy E2 SM models diff --git a/docker/Dockerfile.nrORU.fhi72.ubuntu b/docker/Dockerfile.nrORU.fhi72.ubuntu index 9c4e1b3971..dc014c70d8 100644 --- a/docker/Dockerfile.nrORU.fhi72.ubuntu +++ b/docker/Dockerfile.nrORU.fhi72.ubuntu @@ -36,7 +36,6 @@ RUN apt-get update && \ pkg-config \ libsctp1 \ tzdata \ - libblas3 \ libconfig9 \ openssl \ net-tools \ diff --git a/docker/Dockerfile.nrUE.ubuntu b/docker/Dockerfile.nrUE.ubuntu index 7c8b15d013..ef700825d1 100644 --- a/docker/Dockerfile.nrUE.ubuntu +++ b/docker/Dockerfile.nrUE.ubuntu @@ -52,8 +52,6 @@ RUN apt-get update && \ libboost-system1.83.0 \ libboost-program-options1.83.0 \ tzdata \ - liblapacke \ - libblas3 \ libconfig9 \ openssl \ net-tools \ diff --git a/docker/Dockerfile.phySim.rhel9 b/docker/Dockerfile.phySim.rhel9 index 40db199bd4..bbba2060f9 100644 --- a/docker/Dockerfile.phySim.rhel9 +++ b/docker/Dockerfile.phySim.rhel9 @@ -69,10 +69,6 @@ COPY --from=phy-sim-build /opt/oai-physim/bin/ /opt/oai-physim/bin/ COPY --from=phy-sim-build \ /oai-ran/cmake_targets/ran_build/build/libcoding.so \ - /lib64/liblapacke.so.3 \ - /lib64/libblas.so.3 \ - /lib64/libcblas.so.3 \ - /lib64/liblapack.so.3 \ /usr/lib64/libasan.so.6 \ /usr/lib64/libubsan.so.1 \ /oai-ran/cmake_targets/ran_build/build/libdfts.so \ diff --git a/openair1/PHY/CODING/TESTBENCH/Makefile b/openair1/PHY/CODING/TESTBENCH/Makefile index 030f19b47b..c915bbed38 100644 --- a/openair1/PHY/CODING/TESTBENCH/Makefile +++ b/openair1/PHY/CODING/TESTBENCH/Makefile @@ -44,12 +44,12 @@ $(OBJ) : %.o : %.c $(CC) -c $(CFLAGS) -Wall -I$(TOP_DIR) -I$(TOP_DIR)/PHY/CODING -I$(OPENAIR0_DIR)/express-mimo/simulator/baseband/C/channel_decoder -o $@ $< ltetest: $(OBJ) ltetest.c - $(CC) ltetest.c -O2 -I$(TOP_DIR) -I$(TOP_DIR)/PHY/CODING -I$(OPENAIR0_DIR)/express-mimo/simulator/baseband/C/channel_decoder -o ltetest $(CFLAGS) $(OBJ) -lm -DOPENAIR_LTE -lblas -lrt + $(CC) ltetest.c -O2 -I$(TOP_DIR) -I$(TOP_DIR)/PHY/CODING -I$(OPENAIR0_DIR)/express-mimo/simulator/baseband/C/channel_decoder -o ltetest $(CFLAGS) $(OBJ) -lm -DOPENAIR_LTE -lrt pdcch_test: $(OBJ) pdcch_test.c - $(CC) pdcch_test.c -I$(TOP_DIR) -o pdcch_test $(CFLAGS) $(PHY_OBJS) -lm -lblas + $(CC) pdcch_test.c -I$(TOP_DIR) -o pdcch_test $(CFLAGS) $(PHY_OBJS) -lm viterbi_test: $(OBJ) viterbi_test.c - $(CC) viterbi_test.c -I$(TOP_DIR) -o viterbi_test $(CFLAGS) $(PHY_OBJS) -lm -lblas + $(CC) viterbi_test.c -I$(TOP_DIR) -o viterbi_test $(CFLAGS) $(PHY_OBJS) -lm clean: rm $(OBJ) diff --git a/openair1/PHY/LTE_ESTIMATION/lte_ue_measurements.c b/openair1/PHY/LTE_ESTIMATION/lte_ue_measurements.c index 3dc55ef1f6..86af5fb81c 100644 --- a/openair1/PHY/LTE_ESTIMATION/lte_ue_measurements.c +++ b/openair1/PHY/LTE_ESTIMATION/lte_ue_measurements.c @@ -549,10 +549,7 @@ void construct_HhH_elements(int *ch0conj_ch0, //00_00 } } - -void squared_matrix_element(int32_t *Hh_h_00, - int32_t *Hh_h_00_sq, - unsigned short nb_rb) +static void squared_matrix_element(int32_t *Hh_h_00, int32_t *Hh_h_00_sq, unsigned short nb_rb) { simde__m128i *Hh_h_00_128,*Hh_h_00_sq_128; diff --git a/openair1/PHY/LTE_UE_TRANSPORT/dlsch_demodulation.c b/openair1/PHY/LTE_UE_TRANSPORT/dlsch_demodulation.c index 9aa520c585..b8157652c2 100644 --- a/openair1/PHY/LTE_UE_TRANSPORT/dlsch_demodulation.c +++ b/openair1/PHY/LTE_UE_TRANSPORT/dlsch_demodulation.c @@ -41,48 +41,308 @@ #include #include #include -#include -#include -#include "linear_preprocessing_rec.h" - -//#define DEBUG_MMSE - /* dynamic shift for LLR computation for TM3/4 * set as command line argument, see lte-softmodem.c * default value: 0 */ int16_t dlsch_demod_shift = 0; -int16_t interf_unaw_shift = 13; +static const int16_t interf_unaw_shift = 13; unsigned char offset_mumimo_llr_drange_fix=0; -//inferference-free case -unsigned char interf_unaw_shift_tm4_mcs[29]= {5, 3, 4, 3, 3, 2, 1, 1, 2, 0, 1, 1, 1, 1, 0, 0, - 1, 1, 1, 1, 0, 2, 1, 0, 1, 0, 1, 0, 0 - } ; -unsigned char interf_unaw_shift_tm1_mcs[29]= {5, 5, 4, 3, 3, 3, 2, 2, 4, 4, 2, 3, 3, 3, 1, 1, - 0, 1, 1, 2, 5, 4, 4, 6, 5, 1, 0, 5, 6 - } ; // mcs 21, 26, 28 seem to be errorneous +// inferference-free case -/* -//original values from sebastion + same hand tuning -unsigned char offset_mumimo_llr_drange[29][3]={{8,8,8},{7,7,7},{7,7,7},{7,7,7},{6,6,6},{6,6,6},{6,6,6},{5,5,5},{4,4,4},{1,2,4}, // QPSK -{5,5,4},{5,5,5},{5,5,5},{3,3,3},{2,2,2},{2,2,2},{2,2,2}, // 16-QAM -{2,2,1},{3,3,3},{3,3,3},{3,3,1},{2,2,2},{2,2,2},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}}; //64-QAM +static const unsigned char offset_mumimo_llr_drange[29][3] = { + {0, 6, 5}, {0, 4, 5}, {0, 4, 5}, {0, 5, 4}, {0, 5, 6}, {0, 5, 3}, {0, 4, 4}, {0, 4, 4}, {0, 3, 3}, {0, 1, 2}, + {1, 1, 0}, {1, 3, 2}, {3, 4, 1}, {2, 0, 0}, {2, 2, 2}, {1, 1, 1}, {2, 1, 0}, {2, 1, 1}, {1, 0, 1}, {1, 0, 1}, + {0, 0, 0}, {1, 0, 0}, {0, 0, 0}, {0, 1, 0}, {1, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}}; + +static void dlsch_channel_compensation_TM34(LTE_DL_FRAME_PARMS *frame_parms, + LTE_UE_PDSCH *lte_ue_pdsch_vars, + PHY_MEASUREMENTS *phy_measurements, + int eNB_id, + unsigned char symbol, + unsigned char mod_order0, + unsigned char mod_order1, + int harq_pid, + int round, + MIMO_mode_t mimo_mode, + unsigned short nb_rb, + unsigned short mmse_flag, + unsigned char output_shift0, + unsigned char output_shift1); + +static void dlsch_channel_compensation_TM56(int **rxdataF_ext, + int **dl_ch_estimates_ext, + int **dl_ch_mag, + int **dl_ch_magb, + int **rxdataF_comp, + unsigned char *pmi_ext, + LTE_DL_FRAME_PARMS *frame_parms, + PHY_MEASUREMENTS *measurements, + int eNB_id, + unsigned char symbol, + unsigned char mod_order, + unsigned short nb_rb, + unsigned char output_shift, + unsigned char dl_power_off); + +static void dlsch_dual_stream_correlation(LTE_DL_FRAME_PARMS *frame_parms, + unsigned char symbol, + unsigned short nb_rb, + int **dl_ch_estimates_ext, + int **dl_ch_estimates_ext_i, + int **dl_ch_rho_ext, + unsigned char output_shift); + +/** \fn dlsch_extract_rbs_single(int32_t **rxdataF, + int32_t **dl_ch_estimates, + int32_t **rxdataF_ext, + int32_t **dl_ch_estimates_ext, + uint16_t pmi, + uint8_t *pmi_ext, + uint32_t *rb_alloc, + uint8_t symbol, + uint8_t subframe, + LTE_DL_FRAME_PARMS *frame_parms) + \brief This function extracts the received resource blocks, both channel estimates and data symbols, + for the current allocation and for single antenna eNB transmission. + @param rxdataF Raw FFT output of received signal + @param dl_ch_estimates Channel estimates of current slot + @param rxdataF_ext FFT output for RBs in this allocation + @param dl_ch_estimates_ext Channel estimates for RBs in this allocation + @param pmi subband Precoding matrix indicator + @param pmi_ext Extracted PMI for chosen RBs + @param rb_alloc RB allocation vector + @param symbol Symbol to extract + @param subframe Subframe number + @param vrb_type Flag to indicate distributed VRB type + @param high_speed_flag + @param frame_parms Pointer to frame descriptor */ -/* -//first optimization try -unsigned char offset_mumimo_llr_drange[29][3]={{7, 8, 7},{6, 6, 7},{6, 6, 7},{6, 6, 6},{5, 6, 6},{5, 5, 6},{5, 5, 6},{4, 5, 4},{4, 3, 4},{3, 2, 2},{6, 5, 5},{5, 4, 4},{5, 5, 4},{3, 3, 2},{2, 2, 1},{2, 1, 1},{2, 2, 2},{3, 3, 3},{3, 3, 2},{3, 3, 2},{3, 2, 1},{2, 2, 2},{2, 2, 2},{0, 0, 0},{0, 0, 0},{0, 0, 0},{0, 0, 0},{0, 0, 0}}; +static uint16_t dlsch_extract_rbs_single(int32_t **rxdataF, + int32_t **dl_ch_estimates, + int32_t **rxdataF_ext, + int32_t **dl_ch_estimates_ext, + uint16_t pmi, + uint8_t *pmi_ext, + uint32_t *rb_alloc, + uint8_t symbol, + uint8_t subframe, + uint32_t high_speed_flag, + LTE_DL_FRAME_PARMS *frame_parms); + +/** \fn dlsch_alamouti(LTE_DL_FRAME_PARMS *frame_parms, + int32_t **rxdataF_comp, + int32_t **dl_ch_mag, + int32_t **dl_ch_magb, + uint8_t symbol, + uint16_t nb_rb) + \brief This function does Alamouti combining on RX and prepares LLR inputs by skipping pilots, PBCH and primary/secondary + synchronization signals. + @param frame_parms Frame descriptor structure + @param rxdataF_comp Compensated channel output + @param dl_ch_mag First squared-magnitude of channel (16QAM and 64QAM) for LLR computation. Alamouti combining should be + performed on this as well. Result is stored in first antenna position + @param dl_ch_magb Second squared-magnitude of channel (64QAM only) for LLR computation. Alamouti combining should be performed + on this as well. Result is stored in first antenna position + @param symbol Symbol in sub-frame + @param nb_rb Number of RBs in this allocation */ -//second optimization try -/* - unsigned char offset_mumimo_llr_drange[29][3]={{5, 8, 7},{4, 6, 8},{3, 6, 7},{7, 7, 6},{4, 7, 8},{4, 7, 4},{6, 6, 6},{3, 6, 6},{3, 6, 6},{1, 3, 4},{1, 1, 0},{3, 3, 2},{3, 4, 1},{4, 0, 1},{4, 2, 2},{3, 1, 2},{2, 1, 0},{2, 1, 1},{1, 0, 1},{1, 0, 1},{0, 0, 0},{1, 0, 0},{0, 0, 0},{0, 1, 0},{1, 0, 0},{0, 0, 0},{0, 0, 0},{0, 0, 0},{0, 0, 0}}; w +static void dlsch_alamouti(LTE_DL_FRAME_PARMS *frame_parms, + int32_t **rxdataF_comp, + int32_t **dl_ch_mag, + int32_t **dl_ch_magb, + uint8_t symbol, + uint16_t nb_rb); + +/** \fn dlsch_detection_mrc(LTE_DL_FRAME_PARMS *frame_parms, + int32_t **rxdataF_comp, + int32_t **rxdataF_comp_i, + int32_t **rho, + int32_t **rho_i, + int32_t **dl_ch_mag, + int32_t **dl_ch_magb, + uint8_t symbol, + uint16_t nb_rb, + uint8_t dual_stream_UE) + + \brief This function does maximal-ratio combining for dual-antenna receivers. + @param frame_parms Frame descriptor structure + @param rxdataF_comp Compensated channel output + @param rxdataF_comp_i Compensated channel output for interference + @param rho Cross correlation between spatial channels + @param rho_i Cross correlation between signal and inteference channels + @param dl_ch_mag First squared-magnitude of channel (16QAM and 64QAM) for LLR computation. Alamouti combining should be + performed on this as well. Result is stored in first antenna position + @param dl_ch_magb Second squared-magnitude of channel (64QAM only) for LLR computation. Alamouti combining should be performed + on this as well. Result is stored in first antenna position + @param symbol Symbol in sub-frame + @param nb_rb Number of RBs in this allocation + @param dual_stream_UE Flag to indicate dual-stream detection */ -unsigned char offset_mumimo_llr_drange[29][3]= {{0, 6, 5},{0, 4, 5},{0, 4, 5},{0, 5, 4},{0, 5, 6},{0, 5, 3},{0, 4, 4},{0, 4, 4},{0, 3, 3},{0, 1, 2},{1, 1, 0},{1, 3, 2},{3, 4, 1},{2, 0, 0},{2, 2, 2},{1, 1, 1},{2, 1, 0},{2, 1, 1},{1, 0, 1},{1, 0, 1},{0, 0, 0},{1, 0, 0},{0, 0, 0},{0, 1, 0},{1, 0, 0},{0, 0, 0},{0, 0, 0},{0, 0, 0},{0, 0, 0}}; +static void dlsch_detection_mrc(LTE_DL_FRAME_PARMS *frame_parms, + int32_t **rxdataF_comp, + int32_t **rxdataF_comp_i, + int32_t **rho, + int32_t **rho_i, + int32_t **dl_ch_mag, + int32_t **dl_ch_magb, + int32_t **dl_ch_mag_i, + int32_t **dl_ch_magb_i, + uint8_t symbol, + uint16_t nb_rb, + uint8_t dual_stream_UE); + +static void dlsch_detection_mrc_TM34(LTE_DL_FRAME_PARMS *frame_parms, + LTE_UE_PDSCH *lte_ue_pdsch_vars, + int harq_pid, + int round, + unsigned char symbol, + unsigned short nb_rb, + unsigned char dual_stream_UE); + +/** \fn dlsch_extract_rbs_dual(int32_t **rxdataF, + int32_t **dl_ch_estimates, + int32_t **rxdataF_ext, + int32_t **dl_ch_estimates_ext, + uint16_t pmi, + uint8_t *pmi_ext, + uint32_t *rb_alloc, + uint8_t symbol, + LTE_DL_FRAME_PARMS *frame_parms) + \brief This function extracts the received resource blocks, both channel estimates and data symbols, + for the current allocation and for dual antenna eNB transmission. + @param rxdataF Raw FFT output of received signal + @param dl_ch_estimates Channel estimates of current slot + @param rxdataF_ext FFT output for RBs in this allocation + @param dl_ch_estimates_ext Channel estimates for RBs in this allocation + @param pmi subband Precoding matrix indicator + @param pmi_ext Extracted PMI for chosen RBs + @param rb_alloc RB allocation vector + @param symbol Symbol to extract + @param subframe Subframe index + @param high_speed_flag + @param frame_parms Pointer to frame descriptor +*/ +static uint16_t dlsch_extract_rbs_dual(int32_t **rxdataF, + int32_t **dl_ch_estimates, + int32_t **rxdataF_ext, + int32_t **dl_ch_estimates_ext, + uint16_t pmi, + uint8_t *pmi_ext, + uint32_t *rb_alloc, + uint8_t symbol, + uint8_t subframe, + uint32_t high_speed_flag, + LTE_DL_FRAME_PARMS *frame_parms, + MIMO_mode_t mimo_mode); + +/** \fn dlsch_extract_rbs_TM7(int32_t **rxdataF, + int32_t **dl_bf_ch_estimates, + int32_t **rxdataF_ext, + int32_t **dl_bf_ch_estimates_ext, + uint32_t *rb_alloc, + uint8_t symbol, + uint8_t subframe, + uint32_t high_speed_flag, + LTE_DL_FRAME_PARMS *frame_parms) + \brief This function extracts the received resource blocks, both channel estimates and data symbols, + for the current allocation and for single antenna eNB transmission. + @param rxdataF Raw FFT output of received signal + @param dl_bf_ch_estimates Beamforming channel estimates of current slot + @param rxdataF_ext FFT output for RBs in this allocation + @param dl_bf_ch_estimates_ext Beamforming channel estimates for RBs in this allocation + @param rb_alloc RB allocation vector + @param symbol Symbol to extract + @param subframe Subframe number + @param high_speed_flag + @param frame_parms Pointer to frame descriptor +*/ +static uint16_t dlsch_extract_rbs_TM7(int32_t **rxdataF, + int32_t **dl_bf_ch_estimates, + int32_t **rxdataF_ext, + int32_t **dl_bf_ch_estimates_ext, + uint32_t *rb_alloc, + uint8_t symbol, + uint8_t subframe, + uint32_t high_speed_flag, + LTE_DL_FRAME_PARMS *frame_parms); + +static const short TM3_prec[8] __attribute__((aligned(16))) = {1, 1, -1, -1, 1, 1, -1, -1}; + +void prec2A_TM3_128(simde__m128i *ch0,simde__m128i *ch1) { + simde__m128i amp = simde_mm_set1_epi16(ONE_OVER_SQRT2_Q15); + simde__m128i tmp0,tmp1; + //simde_mm_mulhi_epi16 + // print_shorts("prec2A_TM3 ch0 (before):",ch0); + // print_shorts("prec2A_TM3 ch1 (before):",ch1); + tmp0 = ch0[0]; + tmp1 = simde_mm_sign_epi16(ch1[0],((simde__m128i *)&TM3_prec)[0]); + // print_shorts("prec2A_TM3 ch1*s (mid):",(simde__m128i *)TM3_prec); + ch0[0] = simde_mm_adds_epi16(ch0[0],tmp1); + ch1[0] = simde_mm_subs_epi16(tmp0,tmp1); + ch0[0] = simde_mm_mulhi_epi16(ch0[0],amp); + ch0[0] = simde_mm_slli_epi16(ch0[0],1); + ch1[0] = simde_mm_mulhi_epi16(ch1[0],amp); + ch1[0] = simde_mm_slli_epi16(ch1[0],1); + // print_shorts("prec2A_TM3 ch0 (mid):",&tmp0); + // print_shorts("prec2A_TM3 ch1 (mid):",ch1); + //ch0[0] = simde_mm_mulhi_epi16(ch0[0],amp); + //ch0[0] = simde_mm_slli_epi16(ch0[0],1); + //ch1[0] = simde_mm_mulhi_epi16(ch1[0],amp); + //ch1[0] = simde_mm_slli_epi16(ch1[0],1); + //ch0[0] = simde_mm_srai_epi16(ch0[0],1); + //ch1[0] = simde_mm_srai_epi16(ch1[0],1); + // print_shorts("prec2A_TM3 ch0 (after):",ch0); + // print_shorts("prec2A_TM3 ch1 (after):",ch1); +} +// precoding is stream 0 .5(1,1) .5(1,-1) .5(1,1) .5(1,-1) +// stream 1 .5(1,-1) .5(1,1) .5(1,-1) .5(1,1) +// store "precoded" channel for stream 0 in ch0, stream 1 in ch1 -extern void print_shorts(char *s,int16_t *x); +// pmi = 0 => stream 0 (1,1), stream 1 (1,-1) +// pmi = 1 => stream 0 (1,j), stream 2 (1,-j) + +static void prec2A_TM4_128(int pmi, simde__m128i *ch0, simde__m128i *ch1) +{ + // sqrt(2) is already taken into account in computation sqrt_rho_a, sqrt_rho_b, + //so divide by 2 is replaced by divide by sqrt(2). + // printf ("demod pmi=%d\n", pmi); + simde__m128i amp; + amp = simde_mm_set1_epi16(ONE_OVER_SQRT2_Q15); + simde__m128i tmp0,tmp1; + + // print_shorts("prec2A_TM4 ch0 (before):",ch0); + // print_shorts("prec2A_TM4 ch1 (before):",ch1); + + if (pmi == 0) { //[1 1;1 -1] + tmp0 = ch0[0]; + tmp1 = ch1[0]; + ch0[0] = simde_mm_adds_epi16(tmp0,tmp1); + ch1[0] = simde_mm_subs_epi16(tmp0,tmp1); + } else { //ch0+j*ch1 ch0-j*ch1 + tmp0 = ch0[0]; + tmp1 = oai_mm_conj(oai_mm_swap(ch1[0])); + ch0[0] = simde_mm_subs_epi16(tmp0,tmp1); + ch1[0] = simde_mm_add_epi16(tmp0,tmp1); + } + + //print_shorts("prec2A_TM4 ch0 (middle):",ch0); + //print_shorts("prec2A_TM4 ch1 (middle):",ch1); + ch0[0] = simde_mm_mulhi_epi16(ch0[0],amp); + ch0[0] = simde_mm_slli_epi16(ch0[0],1); + ch1[0] = simde_mm_mulhi_epi16(ch1[0],amp); + ch1[0] = simde_mm_slli_epi16(ch1[0],1); + // ch0[0] = simde_mm_srai_epi16(ch0[0],1); //divide by 2 + // ch1[0] = simde_mm_srai_epi16(ch1[0],1); //divide by 2 + //print_shorts("prec2A_TM4 ch0 (end):",ch0); + //print_shorts("prec2A_TM4 ch1 (end):",ch1); + // print_shorts("prec2A_TM4 ch0 (end):",ch0); + //print_shorts("prec2A_TM4 ch1 (end):",ch1); +} int rx_pdsch(PHY_VARS_UE *ue, PDSCH_t type, @@ -525,6 +785,8 @@ int rx_pdsch(PHY_VARS_UE *ue, start_meas(&ue->generic_stat_bis[ue->current_thread_id[subframe]][slot]); #endif + #ifdef USE_MMSE + // mmse_flag is harcoded to false if (rx_type==rx_IC_dual_stream && mmse_flag==1) { precode_channel_est(pdsch_vars[eNB_id]->dl_ch_estimates_ext, frame_parms, @@ -542,6 +804,7 @@ int rx_pdsch(PHY_VARS_UE *ue, symbol, nb_rb); } + #endif // Now channel compensation if (dlsch0_harq->mimo_modemimo_mode == SISO) || - ((dlsch0_harq->mimo_mode >= UNIFORM_PRECODING11) && - (dlsch0_harq->mimo_mode <= PUSCH_PRECODING0)) || - (dlsch0_harq->mimo_mode == TM7)) { - /* - dlsch_siso(frame_parms, - pdsch_vars[eNB_id]->rxdataF_comp, - pdsch_vars[eNB_id_i]->rxdataF_comp, - symbol, - nb_rb); - */ + if ((dlsch0_harq->mimo_mode == SISO) + || ((dlsch0_harq->mimo_mode >= UNIFORM_PRECODING11) && (dlsch0_harq->mimo_mode <= PUSCH_PRECODING0)) + || (dlsch0_harq->mimo_mode == TM7)) { } else if (dlsch0_harq->mimo_mode == ALAMOUTI) { dlsch_alamouti(frame_parms, pdsch_vars[eNB_id]->rxdataF_comp0, @@ -1381,116 +1636,8 @@ void dlsch_channel_compensation(int **rxdataF_ext, } -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) - +static void prec2A_TM56_128(unsigned char pmi, simde__m128i *ch0, simde__m128i *ch1) { - unsigned short ii; - int length_mod8 = 0; - simde__m128i *dl_ch128,*dl_ch_mag128,*dl_ch_mag128b, *dl_ch128_2, *rxdataF128,*rxdataF_comp128,*rho128; - simde__m128i QAM_amp128={0}; - int aatx = 0, aarx = 0; - - for (aatx=0; aatx 1 ? n_rx : 2; - dl_ch128 = (simde__m128i *)&dl_ch_estimates_ext[aatx*x + aarx][start_point]; - dl_ch_mag128 = (simde__m128i *)&dl_ch_mag[aatx*x + aarx][start_point]; - dl_ch_mag128b = (simde__m128i *)&dl_ch_magb[aatx*x + aarx][start_point]; - rxdataF128 = (simde__m128i *)&rxdataF_ext[aarx][start_point]; - rxdataF_comp128 = (simde__m128i *)&rxdataF_comp[aatx*x + aarx][start_point]; - length_mod8 = length&7; - - if (length_mod8 == 0) { - for (ii=0; ii>3; ++ii) { - if (mod_order>2) { - simde__m128i mmtmpD0, mmtmpD1; - // get channel amplitude if not QPSK - mmtmpD0 = oai_mm_smadd(dl_ch128[0], dl_ch128[0], output_shift); - mmtmpD1 = oai_mm_smadd(dl_ch128[1], dl_ch128[1], output_shift); - mmtmpD0 = simde_mm_packs_epi32(mmtmpD0, mmtmpD1); - // store channel magnitude here in a new field of dlsch - dl_ch_mag128[0] = simde_mm_unpacklo_epi16(mmtmpD0, mmtmpD0); - dl_ch_mag128b[0] = dl_ch_mag128[0]; - dl_ch_mag128[0] = simde_mm_mulhi_epi16(dl_ch_mag128[0], QAM_amp128); - dl_ch_mag128[0] = simde_mm_slli_epi16(dl_ch_mag128[0], 1); - dl_ch_mag128[1] = simde_mm_unpackhi_epi16(mmtmpD0, mmtmpD0); - dl_ch_mag128b[1] = dl_ch_mag128[1]; - dl_ch_mag128[1] = simde_mm_mulhi_epi16(dl_ch_mag128[1], QAM_amp128); - dl_ch_mag128[1] = simde_mm_slli_epi16(dl_ch_mag128[1], 1); - dl_ch_mag128b[0] = simde_mm_mulhi_epi16(dl_ch_mag128b[0], QAM_amp128b); - dl_ch_mag128b[0] = simde_mm_slli_epi16(dl_ch_mag128b[0], 1); - dl_ch_mag128b[1] = simde_mm_mulhi_epi16(dl_ch_mag128b[1], QAM_amp128b); - dl_ch_mag128b[1] = simde_mm_slli_epi16(dl_ch_mag128b[1], 1); - } - - // multiply by conjugated channel - rxdataF_comp128[0] = oai_mm_cpx_mult_conj(dl_ch128[0], rxdataF128[0], output_shift); - rxdataF_comp128[1] = oai_mm_cpx_mult_conj(dl_ch128[1], rxdataF128[1], output_shift); - dl_ch128+=2; - dl_ch_mag128+=2; - dl_ch_mag128b+=2; - rxdataF128+=2; - rxdataF_comp128+=2; - } - } else { - printf ("Channel Compensation: Received number of subcarriers is not multiple of 8, \n" - "need to adapt the code!\n"); - } - } - } - - /*This part of code makes sense only for processing in 2x2 blocks*/ - if (rho) { - for (aarx=0; aarx>3; ++ii) { - // multiply by conjugated channel - rho128[0] = oai_mm_cpx_mult_conj(dl_ch128[0], dl_ch128_2[0], output_shift); - rho128[1] = oai_mm_cpx_mult_conj(dl_ch128[1], dl_ch128_2[1], output_shift); - dl_ch128+=2; - dl_ch128_2+=2; - rho128+=2; - } - } else { - printf ("Channel Compensation: Received number of subcarriers is not multiple of 8, \n" - "need to adapt the code!\n"); - } - } - } - -} - - -void prec2A_TM56_128(unsigned char pmi,simde__m128i *ch0,simde__m128i *ch1) { simde__m128i amp; amp = simde_mm_set1_epi16(ONE_OVER_SQRT2_Q15); @@ -1522,93 +1669,23 @@ void prec2A_TM56_128(unsigned char pmi,simde__m128i *ch0,simde__m128i *ch1) { ch0[0] = simde_mm_mulhi_epi16(ch0[0],amp); ch0[0] = simde_mm_slli_epi16(ch0[0],1); } -// precoding is stream 0 .5(1,1) .5(1,-1) .5(1,1) .5(1,-1) -// stream 1 .5(1,-1) .5(1,1) .5(1,-1) .5(1,1) -// store "precoded" channel for stream 0 in ch0, stream 1 in ch1 -short TM3_prec[8]__attribute__((aligned(16))) = {1,1,-1,-1,1,1,-1,-1} ; -void prec2A_TM3_128(simde__m128i *ch0,simde__m128i *ch1) { - simde__m128i amp = simde_mm_set1_epi16(ONE_OVER_SQRT2_Q15); - simde__m128i tmp0,tmp1; - //simde_mm_mulhi_epi16 - // print_shorts("prec2A_TM3 ch0 (before):",ch0); - // print_shorts("prec2A_TM3 ch1 (before):",ch1); - tmp0 = ch0[0]; - tmp1 = simde_mm_sign_epi16(ch1[0],((simde__m128i *)&TM3_prec)[0]); - // print_shorts("prec2A_TM3 ch1*s (mid):",(simde__m128i *)TM3_prec); - ch0[0] = simde_mm_adds_epi16(ch0[0],tmp1); - ch1[0] = simde_mm_subs_epi16(tmp0,tmp1); - ch0[0] = simde_mm_mulhi_epi16(ch0[0],amp); - ch0[0] = simde_mm_slli_epi16(ch0[0],1); - ch1[0] = simde_mm_mulhi_epi16(ch1[0],amp); - ch1[0] = simde_mm_slli_epi16(ch1[0],1); - // print_shorts("prec2A_TM3 ch0 (mid):",&tmp0); - // print_shorts("prec2A_TM3 ch1 (mid):",ch1); - //ch0[0] = simde_mm_mulhi_epi16(ch0[0],amp); - //ch0[0] = simde_mm_slli_epi16(ch0[0],1); - //ch1[0] = simde_mm_mulhi_epi16(ch1[0],amp); - //ch1[0] = simde_mm_slli_epi16(ch1[0],1); - //ch0[0] = simde_mm_srai_epi16(ch0[0],1); - //ch1[0] = simde_mm_srai_epi16(ch1[0],1); - // print_shorts("prec2A_TM3 ch0 (after):",ch0); - // print_shorts("prec2A_TM3 ch1 (after):",ch1); -} - -// pmi = 0 => stream 0 (1,1), stream 1 (1,-1) -// pmi = 1 => stream 0 (1,j), stream 2 (1,-j) - -void prec2A_TM4_128(int pmi,simde__m128i *ch0,simde__m128i *ch1) { - // sqrt(2) is already taken into account in computation sqrt_rho_a, sqrt_rho_b, - //so divide by 2 is replaced by divide by sqrt(2). - // printf ("demod pmi=%d\n", pmi); - simde__m128i amp; - amp = simde_mm_set1_epi16(ONE_OVER_SQRT2_Q15); - simde__m128i tmp0,tmp1; - - // print_shorts("prec2A_TM4 ch0 (before):",ch0); - // print_shorts("prec2A_TM4 ch1 (before):",ch1); - - if (pmi == 0) { //[1 1;1 -1] - tmp0 = ch0[0]; - tmp1 = ch1[0]; - ch0[0] = simde_mm_adds_epi16(tmp0,tmp1); - ch1[0] = simde_mm_subs_epi16(tmp0,tmp1); - } else { //ch0+j*ch1 ch0-j*ch1 - tmp0 = ch0[0]; - tmp1 = oai_mm_conj(oai_mm_swap(ch1[0])); - ch0[0] = simde_mm_subs_epi16(tmp0,tmp1); - ch1[0] = simde_mm_add_epi16(tmp0,tmp1); - } - - //print_shorts("prec2A_TM4 ch0 (middle):",ch0); - //print_shorts("prec2A_TM4 ch1 (middle):",ch1); - ch0[0] = simde_mm_mulhi_epi16(ch0[0],amp); - ch0[0] = simde_mm_slli_epi16(ch0[0],1); - ch1[0] = simde_mm_mulhi_epi16(ch1[0],amp); - ch1[0] = simde_mm_slli_epi16(ch1[0],1); - // ch0[0] = simde_mm_srai_epi16(ch0[0],1); //divide by 2 - // ch1[0] = simde_mm_srai_epi16(ch1[0],1); //divide by 2 - //print_shorts("prec2A_TM4 ch0 (end):",ch0); - //print_shorts("prec2A_TM4 ch1 (end):",ch1); - // print_shorts("prec2A_TM4 ch0 (end):",ch0); - //print_shorts("prec2A_TM4 ch1 (end):",ch1); -} - -void dlsch_channel_compensation_TM56(int **rxdataF_ext, - int **dl_ch_estimates_ext, - int **dl_ch_mag, - int **dl_ch_magb, - int **rxdataF_comp, - unsigned char *pmi_ext, - LTE_DL_FRAME_PARMS *frame_parms, - PHY_MEASUREMENTS *measurements, - int eNB_id, - unsigned char symbol, - unsigned char mod_order, - unsigned short nb_rb, - unsigned char output_shift, - unsigned char dl_power_off) { +static void dlsch_channel_compensation_TM56(int **rxdataF_ext, + int **dl_ch_estimates_ext, + int **dl_ch_mag, + int **dl_ch_magb, + int **rxdataF_comp, + unsigned char *pmi_ext, + LTE_DL_FRAME_PARMS *frame_parms, + PHY_MEASUREMENTS *measurements, + int eNB_id, + unsigned char symbol, + unsigned char mod_order, + unsigned short nb_rb, + unsigned char output_shift, + unsigned char dl_power_off) +{ unsigned short rb,Nre; simde__m128i *dl_ch0_128,*dl_ch1_128,*dl_ch_mag128,*dl_ch_mag128b,*rxdataF128,*rxdataF_comp128; unsigned char aarx=0,symbol_mod,pilots=0; @@ -1719,89 +1796,25 @@ void dlsch_channel_compensation_TM56(int **rxdataF_ext, } // rx_antennas measurements->precoded_cqi_dB[eNB_id][0] = dB_fixed2(precoded_signal_strength,measurements->n0_power_tot); - //printf("eNB_id %d, symbol %d: precoded CQI %d dB\n",eNB_id,symbol, - // measurements->precoded_cqi_dB[eNB_id][0]); - + // printf("eNB_id %d, symbol %d: precoded CQI %d dB\n",eNB_id,symbol, + // measurements->precoded_cqi_dB[eNB_id][0]); } -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) { - unsigned short rb; - simde__m128i *dl_ch0_128,*dl_ch1_128; - unsigned char aarx=0,symbol_mod,pilots=0; - unsigned char *pmi_ext = pdsch_vars->pmi_ext; - symbol_mod = (symbol>=(7-frame_parms->Ncp)) ? symbol-(7-frame_parms->Ncp) : symbol; - - if ((symbol_mod == 0) || (symbol_mod == (4-frame_parms->Ncp))) - pilots=1; - - for (aarx=0; aarxnb_antennas_rx; aarx++) { - dl_ch0_128 = (simde__m128i *)&dl_ch_estimates_ext[aarx][symbol*frame_parms->N_RB_DL*12]; // this is h11 - dl_ch1_128 = (simde__m128i *)&dl_ch_estimates_ext[2+aarx][symbol*frame_parms->N_RB_DL*12]; // this is h12 - - for (rb=0; rbprecoded_cqi_dB[eNB_id][0]); } - void dlsch_dual_stream_correlation(LTE_DL_FRAME_PARMS *frame_parms, unsigned char symbol, unsigned short nb_rb, @@ -2068,19 +2080,19 @@ void dlsch_dual_stream_correlation(LTE_DL_FRAME_PARMS *frame_parms, } - -void dlsch_detection_mrc(LTE_DL_FRAME_PARMS *frame_parms, - int **rxdataF_comp, - int **rxdataF_comp_i, - int **rho, - int **rho_i, - int **dl_ch_mag, - int **dl_ch_magb, - int **dl_ch_mag_i, - int **dl_ch_magb_i, - unsigned char symbol, - unsigned short nb_rb, - unsigned char dual_stream_UE) { +static void dlsch_detection_mrc(LTE_DL_FRAME_PARMS *frame_parms, + int **rxdataF_comp, + int **rxdataF_comp_i, + int **rho, + int **rho_i, + int **dl_ch_mag, + int **dl_ch_magb, + int **dl_ch_mag_i, + int **dl_ch_magb_i, + unsigned char symbol, + unsigned short nb_rb, + unsigned char dual_stream_UE) +{ unsigned char aatx; int i; simde__m128i *rxdataF_comp128_0,*rxdataF_comp128_1,*rxdataF_comp128_i0,*rxdataF_comp128_i1,*dl_ch_mag128_0,*dl_ch_mag128_1,*dl_ch_mag128_0b,*dl_ch_mag128_1b,*rho128_0,*rho128_1,*rho128_i0,*rho128_i1, @@ -2136,16 +2148,16 @@ void dlsch_detection_mrc(LTE_DL_FRAME_PARMS *frame_parms, } } } - } -void dlsch_detection_mrc_TM34(LTE_DL_FRAME_PARMS *frame_parms, - LTE_UE_PDSCH *pdsch_vars, - int harq_pid, - int round, - unsigned char symbol, - unsigned short nb_rb, - unsigned char dual_stream_UE) { +static void dlsch_detection_mrc_TM34(LTE_DL_FRAME_PARMS *frame_parms, + LTE_UE_PDSCH *pdsch_vars, + int harq_pid, + int round, + unsigned char symbol, + unsigned short nb_rb, + unsigned char dual_stream_UE) +{ int i; simde__m128i *rxdataF_comp128_0,*rxdataF_comp128_1; simde__m128i *dl_ch_mag128_0,*dl_ch_mag128_1; @@ -2259,7 +2271,6 @@ void dlsch_detection_mrc_TM34(LTE_DL_FRAME_PARMS *frame_parms, } } } - } void dlsch_scale_channel(int **dl_ch_estimates_ext, @@ -2462,260 +2473,6 @@ void dlsch_channel_level_median(int **dl_ch_estimates_ext, } -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) { - int **rxdataF_ext = pdsch_vars->rxdataF_ext; - int **dl_ch_estimates_ext = pdsch_vars->dl_ch_estimates_ext; - unsigned char *pmi_ext = pdsch_vars->pmi_ext; - int avg_00[frame_parms->nb_antenna_ports_eNB*frame_parms->nb_antennas_rx]; - int avg_01[frame_parms->nb_antenna_ports_eNB*frame_parms->nb_antennas_rx]; - int symbol_mod, length, start_point, nre; - symbol_mod = (symbol>=(7-frame_parms->Ncp)) ? symbol-(7-frame_parms->Ncp) : symbol; - - if (((symbol_mod == 0) || (symbol_mod == (frame_parms->Ncp-1)))&&(frame_parms->nb_antenna_ports_eNB!=1)) - nre=8; - else if (((symbol_mod == 0) || (symbol_mod == (frame_parms->Ncp-1)))&&(frame_parms->nb_antenna_ports_eNB==1)) - nre=10; - else - nre=12; - - length = nre*nb_rb; - start_point = symbol*nb_rb*12; - mmse_processing_core(rxdataF_ext, - dl_ch_estimates_ext, - noise_power, - frame_parms->nb_antenna_ports_eNB, - frame_parms->nb_antennas_rx, - length, - start_point); - - /*dlsch_channel_aver_band(dl_ch_estimates_ext, - frame_parms, - chan_avg, - symbol, - nb_rb); - - - for (aatx=0; aatxnb_antenna_ports_eNB; aatx++) - for (aarx=0; aarxnb_antennas_rx; aarx++) { - H[aatx*frame_parms->nb_antennas_rx + aarx] = (float)(chan_avg[aatx*frame_parms->nb_antennas_rx + aarx].r/(32768.0)) + I*(float)(chan_avg[aatx*frame_parms->nb_antennas_rx + aarx].i/(32768.0)); - // printf("H [%d] = (%f, %f) \n", aatx*frame_parms->nb_antennas_rx + aarx, creal(H[aatx*frame_parms->nb_antennas_rx + aarx]), cimag(H[aatx*frame_parms->nb_antennas_rx + aarx])); - }*/ - - if (first_symbol_flag == 1) { - dlsch_channel_level_TM34(dl_ch_estimates_ext, - frame_parms, - pmi_ext, - avg_00, - avg_01, - symbol, - nb_rb, - mmse_flag, - mimo_mode); - avg_00[0] = (log2_approx(avg_00[0])/2) + dlsch_demod_shift+4;// + 2 ;//+ 4; - avg_01[0] = (log2_approx(avg_01[0])/2) + dlsch_demod_shift+4;// + 2 ;//+ 4; - pdsch_vars->log2_maxh0 = cmax(avg_00[0],0); - pdsch_vars->log2_maxh1 = cmax(avg_01[0],0); - } -} - -void mmse_processing_core(int32_t **rxdataF_ext, - int32_t **dl_ch_estimates_ext, - int noise_power, - int n_tx, - int n_rx, - int length, - int start_point) { - int aatx, aarx, re; - float imag; - float real; - float complex **W_MMSE= malloc(n_tx*n_rx*sizeof(float complex *)); - - for (int j=0; j max) - max = fabs(creal(W_MMSE_re[aatx*n_rx + aarx])); - - if (fabs(cimag(W_MMSE_re[aatx*n_rx + aarx])) > max) - max = fabs(cimag(W_MMSE_re[aatx*n_rx + aarx])); - } - } - } - - one_over_max = 1.0/max; - - for (re=0; re> 16); - real = (int16_t) (rxdataF_ext[aarx][start_point + re] & 0xffff); - rxdataF_f[aarx][re] = (float)(real/(32768.0)) + I*(float)(imag/(32768.0)); -#ifdef DEBUG_MMSE - - if (re==0) { - printf("rxdataF_to_float: aarx = %d, real= %d, imag = %d\n", aarx, real, imag); - //printf("rxdataF_to_float: rxdataF_ext[%d][%d] = %d\n", aarx, start_point + re, rxdataF_ext[aarx][start_point + re]); - //printf("rxdataF_to_float: ant %d, re = %d, rxdataF_f real = %f, rxdataF_f imag = %f \n", aarx, re, creal(rxdataF_f[aarx][re]), cimag(rxdataF_f[aarx][re])); - } - -#endif - } - } -} - - - -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) { - short re; - int aatx,aarx; - int16_t imag; - int16_t real; - - for (aatx=0; aatx> 16); - real = (int16_t) (dl_ch_estimates_ext[aatx*n_rx + aarx][start_point+ re] & 0xffff); - dl_ch_estimates_ext_f[aatx*n_rx + aarx][re] = (float)(real/(32768.0)) + I*(float)(imag/(32768.0)); -#ifdef DEBUG_MMSE - - if (re==0) { - printf("ant %d, re = %d, real = %d, imag = %d \n", aatx*n_rx + aarx, re, real, imag); - printf("ant %d, re = %d, real = %f, imag = %f \n", aatx*n_rx + aarx, re, creal(dl_ch_estimates_ext_f[aatx*n_rx + aarx][re]), cimag(dl_ch_estimates_ext_f[aatx*n_rx + aarx][re])); - } - -#endif - } - } - } -} - -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) { - short re; - int aarx, aatx; - int16_t imag; - int16_t real; - - for (aatx=0; aatx=1) - imag = INT16_MAX; - else - imag = cimag(dl_ch_estimates_ext_f[aatx*n_rx + aarx][re])*32768; - - if (creal(dl_ch_estimates_ext_f[aatx*n_rx + aarx][re])<-1) - real = -INT16_MAX; - else if (creal(dl_ch_estimates_ext_f[aatx*n_rx + aarx][re])>=1) - real = INT16_MAX; - else - real = creal(dl_ch_estimates_ext_f[aatx*n_rx + aarx][re])*32768; - - dl_ch_estimates_ext[aatx*n_rx + aarx][start_point + re] = (((int32_t)imag)<<16)|((int32_t)real & 0xffff); -#ifdef DEBUG_MMSE - - if (re==0) { - printf(" float_to_chan_est: chan est real = %f, chan est imag = %f\n",creal(dl_ch_estimates_ext_f[aatx*n_rx + aarx][re]), cimag(dl_ch_estimates_ext_f[aatx*n_rx + aarx][re])); - printf("float_to_chan_est: real fixed = %d, imag fixed = %d\n", real, imag); - printf("float_to_chan_est: ant %d, re = %d, dl_ch_estimates_ext = %d \n", aatx*n_rx + aarx, re, dl_ch_estimates_ext[aatx*n_rx + aarx][start_point + re]); - } - -#endif - } - } - } -} - - -void float_to_rxdataF(int32_t **rxdataF_ext, - float complex **rxdataF_f, - int n_tx, - int n_rx, - int length, - int start_point) { - short re; - int aarx; - int16_t imag; - int16_t real; - - for (aarx=0; aarx=1) - imag = INT16_MAX; - else - imag = cimag(rxdataF_f[aarx][re])*32768; - - if (creal(rxdataF_f[aarx][re])<-1) - real = -INT16_MAX; - else if (creal(rxdataF_f[aarx][re])>=1) - real = INT16_MAX; - else - real = creal(rxdataF_f[aarx][re])*32768; - - rxdataF_ext[aarx][start_point + re] = (((int32_t)imag)<<16)|(((int32_t)real) & 0xffff); -#ifdef DEBUG_MMSE - - if (re==0) { - printf(" float_to_rxdataF: real = %f, imag = %f\n",creal(rxdataF_f[aarx][re]), cimag(rxdataF_f[aarx][re])); - printf("float_to_rxdataF: real fixed = %d, imag fixed = %d\n", real, imag); - printf("float_to_rxdataF: ant %d, re = %d, rxdataF_ext = %d \n", aarx, re, rxdataF_ext[aarx][start_point + re]); - } - -#endif - } - } -} - - -void mult_mmse_rxdataF(float complex **Wmmse, - float complex **rxdataF_ext_f, - int n_tx, - int n_rx, - int length, - int start_point) { - short re; - int aarx, aatx; - float complex *rxdata_re = malloc(n_rx*sizeof(float complex)); - float complex *rxdata_mmse_re = malloc(n_rx*sizeof(float complex)); - float complex *Wmmse_re = malloc(n_tx*n_rx*sizeof(float complex)); - - for (re=0; renb_antennas_rx); } -unsigned short dlsch_extract_rbs_dual(int **rxdataF, - int **dl_ch_estimates, - int **rxdataF_ext, - int **dl_ch_estimates_ext, - unsigned short pmi, - unsigned char *pmi_ext, - unsigned int *rb_alloc, - unsigned char symbol, - unsigned char subframe, - uint32_t high_speed_flag, - LTE_DL_FRAME_PARMS *frame_parms, - MIMO_mode_t mimo_mode) { +static unsigned short dlsch_extract_rbs_dual(int **rxdataF, + int **dl_ch_estimates, + int **rxdataF_ext, + int **dl_ch_estimates_ext, + unsigned short pmi, + unsigned char *pmi_ext, + unsigned int *rb_alloc, + unsigned char symbol, + unsigned char subframe, + uint32_t high_speed_flag, + LTE_DL_FRAME_PARMS *frame_parms, + MIMO_mode_t mimo_mode) +{ int prb,nb_rb=0; int prb_off,prb_off2; int rb_alloc_ind,skip_half=0,sss_symb,pss_symb=0,nsymb,l; @@ -4369,15 +3891,16 @@ unsigned short dlsch_extract_rbs_dual(int **rxdataF, return(nb_rb/frame_parms->nb_antennas_rx); } -unsigned short dlsch_extract_rbs_TM7(int **rxdataF, - int **dl_bf_ch_estimates, - int **rxdataF_ext, - int **dl_bf_ch_estimates_ext, - unsigned int *rb_alloc, - unsigned char symbol, - unsigned char subframe, - uint32_t high_speed_flag, - LTE_DL_FRAME_PARMS *frame_parms) { +static unsigned short dlsch_extract_rbs_TM7(int **rxdataF, + int **dl_bf_ch_estimates, + int **rxdataF_ext, + int **dl_bf_ch_estimates_ext, + unsigned int *rb_alloc, + unsigned char symbol, + unsigned char subframe, + uint32_t high_speed_flag, + LTE_DL_FRAME_PARMS *frame_parms) +{ unsigned short rb,nb_rb=0; unsigned char rb_alloc_ind; unsigned char i,aarx,l,nsymb,skip_half=0,sss_symb,pss_symb=0; diff --git a/openair1/PHY/LTE_UE_TRANSPORT/linear_preprocessing_rec.c b/openair1/PHY/LTE_UE_TRANSPORT/linear_preprocessing_rec.c deleted file mode 100644 index 86a4b93ddd..0000000000 --- a/openair1/PHY/LTE_UE_TRANSPORT/linear_preprocessing_rec.c +++ /dev/null @@ -1,370 +0,0 @@ -/* These functions compute linear preprocessing for -the UE using LAPACKE and CBLAS modules of -LAPACK libraries. -MMSE and MMSE whitening filters are available. -Functions are using RowMajor storage of the -matrices, like in conventional C. Traditional -Fortran functions of LAPACK employ ColumnMajor -data storage. */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -//#define DEBUG_PREPROC -#include "common/utils/utils.h" - -void transpose (int N, float complex *A, float complex *Result) -{ - // COnputes C := alpha*op(A)*op(B) + beta*C, - CBLAS_TRANSPOSE transa = CblasTrans; - CBLAS_TRANSPOSE transb = CblasNoTrans; - int rows_opA = N; // number of rows in op(A) and in C - int col_opB = N; //number of columns of op(B) and in C - int col_opA = N; //number of columns in op(A) and rows in op(B) - int col_B; //number of columns in B - float complex alpha = 1.0+I*0; - int lda = rows_opA; - float complex beta = 0.0+I*0; - int ldc = rows_opA; - int i; - float complex* B; - - int ldb = col_opB; - - if (transb == CblasNoTrans) { - B = calloc_or_fail(ldb * col_opB, sizeof(float complex)); - col_B= col_opB; - } - else { - B = calloc_or_fail(ldb * col_opA, sizeof(float complex)); - col_B = col_opA; - } - float complex* C = malloc_or_fail(ldc * col_opB * sizeof(float complex)); - - for (i=0; i>2)*sizeof(float complex)); - float complex *H1_re = malloc_or_fail(n_rx*(n_tx>>2)*sizeof(float complex)); - float complex *R_corr_col_n_0_re = malloc_or_fail(n_rx*n_tx*sizeof(float complex)); - float complex *R_corr_col_n_1_re = malloc_or_fail(n_rx*n_tx*sizeof(float complex)); - float complex *U_0_re = malloc_or_fail(n_rx*n_tx*sizeof(float complex)); - float complex *U_1_re = malloc_or_fail(n_rx*n_tx*sizeof(float complex)); - float complex *U_0_herm_re = malloc_or_fail(n_rx*n_tx*sizeof(float complex)); - float complex *U_1_herm_re = malloc_or_fail(n_rx*n_tx*sizeof(float complex)); - float complex *D_0_re = malloc_or_fail(n_rx*n_tx*sizeof(float complex)); - float complex *D_1_re = malloc_or_fail(n_rx*n_tx*sizeof(float complex)); - float complex *W_Wh_0_re = malloc_or_fail(n_rx*n_tx*sizeof(float complex)); - float complex *W_Wh_1_re = malloc_or_fail(n_rx*n_tx*sizeof(float complex)); - - for (aatx=0; aatx>2), H1_re, sigma2, R_corr_col_n_0_re); - HH_herm_plus_sigma2I(n_rx, (n_tx>>2), H0_re, sigma2, R_corr_col_n_1_re); - - eigen_vectors_values(n_rx, R_corr_col_n_0_re, U_0_re, D_0_re); - eigen_vectors_values(n_rx, R_corr_col_n_1_re, U_1_re, D_1_re); - - transpose (n_rx, U_0_re, U_0_herm_re); - transpose (n_rx, U_1_re, U_1_herm_re); - - sigma = (float)(sqrt((double)(sigma2))); - - /*The inverse of a diagonal matrix is obtained by replacing each element in the diagonal with its reciprocal. - A square root of a diagonal matrix is given by the diagonal matrix, whose diagonal entries are just the square - roots of the original matrix.*/ - - - D_0_re_inv_sqrt[0] = sqrt_float(1/D_0_re_inv[0]); - D_0_re_inv_sqrt[5] = sqrt_float(1/D_0_re_inv[5]); - D_0_re_inv_sqrt[10] = sqrt_float(1/D_0_re_inv[10]); - D_0_re_inv_sqrt[15] = sqrt_float(1/D_0_re_inv[15]); - - D_1_re_inv[0] = sqrt_float(1/D_1_re_inv[0]); - D_1_re_inv[5] = sqrt_float(1/D_1_re_inv[5]); - D_1_re_inv[10] = sqrt_float(1/D_1_re_inv[10]); - D_1_re_inv[15] = sqrt_float(1/D_1_re_inv[15]); - - now only to multiply - - free(H0); - free(H1); - free(R_corr_col_n_0); - free(R_corr_col_n_1); -} -#endif - -float sqrt_float(float x, float sqrt_x) -{ - sqrt_x = (float)(sqrt((double)(x))); - return sqrt_x; -} diff --git a/openair1/PHY/LTE_UE_TRANSPORT/linear_preprocessing_rec.h b/openair1/PHY/LTE_UE_TRANSPORT/linear_preprocessing_rec.h deleted file mode 100644 index f38bc47556..0000000000 --- a/openair1/PHY/LTE_UE_TRANSPORT/linear_preprocessing_rec.h +++ /dev/null @@ -1,121 +0,0 @@ - -#include -#include -#include -#include -#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); diff --git a/openair1/PHY/LTE_UE_TRANSPORT/pmch_ue.c b/openair1/PHY/LTE_UE_TRANSPORT/pmch_ue.c index 81ddb264ff..14616c4259 100644 --- a/openair1/PHY/LTE_UE_TRANSPORT/pmch_ue.c +++ b/openair1/PHY/LTE_UE_TRANSPORT/pmch_ue.c @@ -50,49 +50,6 @@ #define MBSFN_FDD_SF7 0x08 #define MBSFN_FDD_SF8 0x04 - - -void dump_mch(PHY_VARS_UE *ue,uint8_t eNB_id,uint16_t coded_bits_per_codeword,int subframe) { - char fname[32],vname[32]; -#define NSYMB_PMCH 12 - sprintf(fname,"mch_rxF_ext0.m"); - sprintf(vname,"pmch_rxF_ext0"); - LOG_M(fname,vname,ue->pdsch_vars_MCH[ue->current_thread_id[subframe]][eNB_id]->rxdataF_ext[0],12*(ue->frame_parms.N_RB_DL)*12,1,1); - sprintf(fname,"mch_ch_ext00.m"); - sprintf(vname,"pmch_ch_ext00"); - LOG_M(fname,vname,ue->pdsch_vars_MCH[ue->current_thread_id[subframe]][eNB_id]->dl_ch_estimates_ext[0],12*(ue->frame_parms.N_RB_DL)*NSYMB_PMCH,1,1); - /* - LOG_M("dlsch%d_ch_ext01.m","dl01_ch0_ext",pdsch_vars[eNB_id]->dl_ch_estimates_ext[1],12*N_RB_DL*NSYMB_PMCH,1,1); - LOG_M("dlsch%d_ch_ext10.m","dl10_ch0_ext",pdsch_vars[eNB_id]->dl_ch_estimates_ext[2],12*N_RB_DL*NSYMB_PMCH,1,1); - LOG_M("dlsch%d_ch_ext11.m","dl11_ch0_ext",pdsch_vars[eNB_id]->dl_ch_estimates_ext[3],12*N_RB_DL*NSYMB_PMCH,1,1); - LOG_M("dlsch%d_rho.m","dl_rho",pdsch_vars[eNB_id]->rho[0],12*N_RB_DL*NSYMB_PMCH,1,1); - */ - sprintf(fname,"mch_rxF_comp0.m"); - sprintf(vname,"pmch_rxF_comp0"); - LOG_M(fname,vname,ue->pdsch_vars_MCH[ue->current_thread_id[subframe]][eNB_id]->rxdataF_comp0[0],12*(ue->frame_parms.N_RB_DL)*NSYMB_PMCH,1,1); - sprintf(fname,"mch_rxF_llr.m"); - sprintf(vname,"pmch_llr"); - LOG_M(fname,vname, ue->pdsch_vars_MCH[ue->current_thread_id[subframe]][eNB_id]->llr[0],coded_bits_per_codeword,1,0); - sprintf(fname,"mch_mag1.m"); - sprintf(vname,"pmch_mag1"); - LOG_M(fname,vname,ue->pdsch_vars_MCH[ue->current_thread_id[subframe]][eNB_id]->dl_ch_mag0[0],12*(ue->frame_parms.N_RB_DL)*NSYMB_PMCH,1,1); - sprintf(fname,"mch_mag2.m"); - sprintf(vname,"pmch_mag2"); - LOG_M(fname,vname,ue->pdsch_vars_MCH[ue->current_thread_id[subframe]][eNB_id]->dl_ch_magb0[0],12*(ue->frame_parms.N_RB_DL)*NSYMB_PMCH,1,1); - LOG_M("mch00_ch0.m","pmch00_ch0", - &(ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates[eNB_id][0][0]), - ue->frame_parms.ofdm_symbol_size*12,1,1); - LOG_M("rxsig_mch.m","rxs_mch", - &ue->common_vars.rxdata[0][subframe*ue->frame_parms.samples_per_tti], - ue->frame_parms.samples_per_tti,1,1); - /* - if (PHY_vars_eNB_g) - LOG_M("txsig_mch.m","txs_mch", - &PHY_vars_eNB_g[0][0]->common_vars.txdata[0][0][subframe*ue->frame_parms.samples_per_tti], - ue->frame_parms.samples_per_tti,1,1);*/ -} - - void fill_UE_dlsch_MCH(PHY_VARS_UE *ue,int mcs,int ndi,int rvidx,int eNB_id) { LTE_UE_DLSCH_t *dlsch = ue->dlsch_MCH[eNB_id]; LTE_DL_FRAME_PARMS *frame_parms=&ue->frame_parms; diff --git a/openair1/PHY/LTE_UE_TRANSPORT/transport_proto_ue.h b/openair1/PHY/LTE_UE_TRANSPORT/transport_proto_ue.h index 06bf87fc74..8cf4020d2e 100644 --- a/openair1/PHY/LTE_UE_TRANSPORT/transport_proto_ue.h +++ b/openair1/PHY/LTE_UE_TRANSPORT/transport_proto_ue.h @@ -78,17 +78,6 @@ int rx_pmch_khz_1dot25(PHY_VARS_UE *ue, unsigned char symbol*/ ,int mcs); -/** \brief Dump OCTAVE/MATLAB files for PMCH debugging - @param phy_vars_ue Pointer to UE variables - @param eNB_id index of eNB in ue variables - @param coded_bits_per_codeword G from 36.211 - @param subframe Index of subframe - @returns 0 on success -*/ -void dump_mch(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint16_t coded_bits_per_codeword,int subframe); - - - /** \brief This function computes the LLRs for ML (max-logsum approximation) dual-stream QPSK/QPSK reception. @param stream0_in Input from channel compensated (MR combined) stream 0 @param stream1_in Input from channel compensated (MR combined) stream 1 @@ -580,216 +569,6 @@ void dlsch_64qam_llr(LTE_DL_FRAME_PARMS *frame_parms, uint32_t llr_offset, uint8_t beamforming_mode); - -/** \fn dlsch_siso(LTE_DL_FRAME_PARMS *frame_parms, - int32_t **rxdataF_comp, - int32_t **rxdataF_comp_i, - uint8_t l, - uint16_t nb_rb) - \brief This function does the first stage of llr computation for SISO, by just extracting the pilots, PBCH and primary/secondary synchronization sequences. - @param frame_parms Frame descriptor structure - @param rxdataF_comp Compensated channel output - @param rxdataF_comp_i Compensated channel output for interference - @param l symbol in sub-frame - @param nb_rb Number of RBs in this allocation -*/ - -void dlsch_siso(LTE_DL_FRAME_PARMS *frame_parms, - int32_t **rxdataF_comp, - int32_t **rxdataF_comp_i, - uint8_t l, - uint16_t nb_rb); - -/** \fn dlsch_alamouti(LTE_DL_FRAME_PARMS *frame_parms, - int32_t **rxdataF_comp, - int32_t **dl_ch_mag, - int32_t **dl_ch_magb, - uint8_t symbol, - uint16_t nb_rb) - \brief This function does Alamouti combining on RX and prepares LLR inputs by skipping pilots, PBCH and primary/secondary synchronization signals. - @param frame_parms Frame descriptor structure - @param rxdataF_comp Compensated channel output - @param dl_ch_mag First squared-magnitude of channel (16QAM and 64QAM) for LLR computation. Alamouti combining should be performed on this as well. Result is stored in first antenna position - @param dl_ch_magb Second squared-magnitude of channel (64QAM only) for LLR computation. Alamouti combining should be performed on this as well. Result is stored in first antenna position - @param symbol Symbol in sub-frame - @param nb_rb Number of RBs in this allocation -*/ -void dlsch_alamouti(LTE_DL_FRAME_PARMS *frame_parms, - int32_t **rxdataF_comp, - int32_t **dl_ch_mag, - int32_t **dl_ch_magb, - uint8_t symbol, - uint16_t nb_rb); - -/** \fn dlsch_antcyc(LTE_DL_FRAME_PARMS *frame_parms, - int32_t **rxdataF_comp, - int32_t **dl_ch_mag, - int32_t **dl_ch_magb, - uint8_t symbol, - uint16_t nb_rb) - \brief This function does antenna selection (based on antenna cycling pattern) on RX and prepares LLR inputs by skipping pilots, PBCH and primary/secondary synchronization signals. Note that this is not LTE, it is just included for comparison purposes. - @param frame_parms Frame descriptor structure - @param rxdataF_comp Compensated channel output - @param dl_ch_mag First squared-magnitude of channel (16QAM and 64QAM) for LLR computation. Alamouti combining should be performed on this as well. Result is stored in first antenna position - @param dl_ch_magb Second squared-magnitude of channel (64QAM only) for LLR computation. Alamouti combining should be performed on this as well. Result is stored in first antenna position - @param symbol Symbol in sub-frame - @param nb_rb Number of RBs in this allocation -*/ -void dlsch_antcyc(LTE_DL_FRAME_PARMS *frame_parms, - int32_t **rxdataF_comp, - int32_t **dl_ch_mag, - int32_t **dl_ch_magb, - uint8_t symbol, - uint16_t nb_rb); - -/** \fn dlsch_detection_mrc(LTE_DL_FRAME_PARMS *frame_parms, - int32_t **rxdataF_comp, - int32_t **rxdataF_comp_i, - int32_t **rho, - int32_t **rho_i, - int32_t **dl_ch_mag, - int32_t **dl_ch_magb, - uint8_t symbol, - uint16_t nb_rb, - uint8_t dual_stream_UE) - - \brief This function does maximal-ratio combining for dual-antenna receivers. - @param frame_parms Frame descriptor structure - @param rxdataF_comp Compensated channel output - @param rxdataF_comp_i Compensated channel output for interference - @param rho Cross correlation between spatial channels - @param rho_i Cross correlation between signal and inteference channels - @param dl_ch_mag First squared-magnitude of channel (16QAM and 64QAM) for LLR computation. Alamouti combining should be performed on this as well. Result is stored in first antenna position - @param dl_ch_magb Second squared-magnitude of channel (64QAM only) for LLR computation. Alamouti combining should be performed on this as well. Result is stored in first antenna position - @param symbol Symbol in sub-frame - @param nb_rb Number of RBs in this allocation - @param dual_stream_UE Flag to indicate dual-stream detection -*/ -void dlsch_detection_mrc(LTE_DL_FRAME_PARMS *frame_parms, - int32_t **rxdataF_comp, - int32_t **rxdataF_comp_i, - int32_t **rho, - int32_t **rho_i, - int32_t **dl_ch_mag, - int32_t **dl_ch_magb, - int32_t **dl_ch_mag_i, - int32_t **dl_ch_magb_i, - uint8_t symbol, - uint16_t nb_rb, - uint8_t dual_stream_UE); - -void dlsch_detection_mrc_TM34(LTE_DL_FRAME_PARMS *frame_parms, - LTE_UE_PDSCH *lte_ue_pdsch_vars, - int harq_pid, - int round, - unsigned char symbol, - unsigned short nb_rb, - unsigned char dual_stream_UE); - -/** \fn dlsch_extract_rbs_single(int32_t **rxdataF, - int32_t **dl_ch_estimates, - int32_t **rxdataF_ext, - int32_t **dl_ch_estimates_ext, - uint16_t pmi, - uint8_t *pmi_ext, - uint32_t *rb_alloc, - uint8_t symbol, - uint8_t subframe, - LTE_DL_FRAME_PARMS *frame_parms) - \brief This function extracts the received resource blocks, both channel estimates and data symbols, - for the current allocation and for single antenna eNB transmission. - @param rxdataF Raw FFT output of received signal - @param dl_ch_estimates Channel estimates of current slot - @param rxdataF_ext FFT output for RBs in this allocation - @param dl_ch_estimates_ext Channel estimates for RBs in this allocation - @param pmi subband Precoding matrix indicator - @param pmi_ext Extracted PMI for chosen RBs - @param rb_alloc RB allocation vector - @param symbol Symbol to extract - @param subframe Subframe number - @param vrb_type Flag to indicate distributed VRB type - @param high_speed_flag - @param frame_parms Pointer to frame descriptor -*/ -uint16_t dlsch_extract_rbs_single(int32_t **rxdataF, - int32_t **dl_ch_estimates, - int32_t **rxdataF_ext, - int32_t **dl_ch_estimates_ext, - uint16_t pmi, - uint8_t *pmi_ext, - uint32_t *rb_alloc, - uint8_t symbol, - uint8_t subframe, - uint32_t high_speed_flag, - LTE_DL_FRAME_PARMS *frame_parms); - -/** \fn dlsch_extract_rbs_dual(int32_t **rxdataF, - int32_t **dl_ch_estimates, - int32_t **rxdataF_ext, - int32_t **dl_ch_estimates_ext, - uint16_t pmi, - uint8_t *pmi_ext, - uint32_t *rb_alloc, - uint8_t symbol, - LTE_DL_FRAME_PARMS *frame_parms) - \brief This function extracts the received resource blocks, both channel estimates and data symbols, - for the current allocation and for dual antenna eNB transmission. - @param rxdataF Raw FFT output of received signal - @param dl_ch_estimates Channel estimates of current slot - @param rxdataF_ext FFT output for RBs in this allocation - @param dl_ch_estimates_ext Channel estimates for RBs in this allocation - @param pmi subband Precoding matrix indicator - @param pmi_ext Extracted PMI for chosen RBs - @param rb_alloc RB allocation vector - @param symbol Symbol to extract - @param subframe Subframe index - @param high_speed_flag - @param frame_parms Pointer to frame descriptor -*/ -uint16_t dlsch_extract_rbs_dual(int32_t **rxdataF, - int32_t **dl_ch_estimates, - int32_t **rxdataF_ext, - int32_t **dl_ch_estimates_ext, - uint16_t pmi, - uint8_t *pmi_ext, - uint32_t *rb_alloc, - uint8_t symbol, - uint8_t subframe, - uint32_t high_speed_flag, - LTE_DL_FRAME_PARMS *frame_parms, - MIMO_mode_t mimo_mode); - -/** \fn dlsch_extract_rbs_TM7(int32_t **rxdataF, - int32_t **dl_bf_ch_estimates, - int32_t **rxdataF_ext, - int32_t **dl_bf_ch_estimates_ext, - uint32_t *rb_alloc, - uint8_t symbol, - uint8_t subframe, - uint32_t high_speed_flag, - LTE_DL_FRAME_PARMS *frame_parms) - \brief This function extracts the received resource blocks, both channel estimates and data symbols, - for the current allocation and for single antenna eNB transmission. - @param rxdataF Raw FFT output of received signal - @param dl_bf_ch_estimates Beamforming channel estimates of current slot - @param rxdataF_ext FFT output for RBs in this allocation - @param dl_bf_ch_estimates_ext Beamforming channel estimates for RBs in this allocation - @param rb_alloc RB allocation vector - @param symbol Symbol to extract - @param subframe Subframe number - @param high_speed_flag - @param frame_parms Pointer to frame descriptor -*/ -uint16_t dlsch_extract_rbs_TM7(int32_t **rxdataF, - int32_t **dl_bf_ch_estimates, - int32_t **rxdataF_ext, - int32_t **dl_bf_ch_estimates_ext, - uint32_t *rb_alloc, - uint8_t symbol, - uint8_t subframe, - uint32_t high_speed_flag, - LTE_DL_FRAME_PARMS *frame_parms); - /** \brief This function performs channel compensation (matched filtering) on the received RBs for this allocation. In addition, it computes the squared-magnitude of the channel with weightings for 16QAM/64QAM detection as well as dual-stream detection (cross-correlation) @param rxdataF_ext Frequency-domain received signal in RBs to be demodulated @param dl_ch_estimates_ext Frequency-domain channel estimates in RBs to be demodulated @@ -819,35 +598,6 @@ 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, - int **dl_ch_estimates_ext, - int **dl_ch_estimates_ext_i, - int **dl_ch_rho_ext, - unsigned char output_shift); - -void dlsch_dual_stream_correlationTM34(LTE_DL_FRAME_PARMS *frame_parms, - unsigned char symbol, - unsigned short nb_rb, - int **dl_ch_estimates_ext, - int **dl_ch_estimates_ext_i, - int **dl_ch_rho_ext, - unsigned char output_shift0, - unsigned char output_shift1); //This function is used to compute multiplications in Hhermitian * H matrix void conjch0_mult_ch1(int *ch0, int *ch1, @@ -869,10 +619,6 @@ void construct_HhH_elements(int *ch0conj_ch0, int32_t *after_mf_11, unsigned short nb_rb); -void squared_matrix_element(int32_t *Hh_h_00, - int32_t *Hh_h_00_sq, - unsigned short nb_rb); - void dlsch_channel_level_TM34_meas(int *ch00, int *ch01, int *ch10, @@ -901,38 +647,6 @@ uint8_t rank_estimation_tm3_tm4(int *dl_ch_estimates_00, int *dl_ch_estimates_11, unsigned short nb_rb); -void dlsch_channel_compensation_TM56(int **rxdataF_ext, - int **dl_ch_estimates_ext, - int **dl_ch_mag, - int **dl_ch_magb, - int **rxdataF_comp, - unsigned char *pmi_ext, - LTE_DL_FRAME_PARMS *frame_parms, - PHY_MEASUREMENTS *phy_measurements, - int eNB_id, - unsigned char symbol, - unsigned char mod_order, - unsigned short nb_rb, - unsigned char output_shift, - unsigned char dl_power_off); - - -void dlsch_channel_compensation_TM34(LTE_DL_FRAME_PARMS *frame_parms, - LTE_UE_PDSCH *lte_ue_pdsch_vars, - PHY_MEASUREMENTS *phy_measurements, - int eNB_id, - unsigned char symbol, - unsigned char mod_order0, - unsigned char mod_order1, - int harq_pid, - int round, - MIMO_mode_t mimo_mode, - unsigned short nb_rb, - unsigned short mmse_flag, - unsigned char output_shift0, - unsigned char output_shift1); - - /** \brief This function computes the average channel level over all allocated RBs and antennas (TX/RX) in order to compute output shift for compensated signal @param dl_ch_estimates_ext Channel estimates in allocated RBs @param frame_parms Pointer to frame descriptor @@ -1669,12 +1383,6 @@ uint8_t is_not_pilot(uint8_t pilots, uint8_t re, uint8_t nushift, uint8_t use2nd uint8_t is_not_UEspecRS(int8_t lprime, uint8_t re, uint8_t nushift, uint8_t Ncp, uint8_t beamforming_mode); -uint32_t dlsch_decoding_abstraction(double *dlsch_MIPB, - LTE_DL_FRAME_PARMS *lte_frame_parms, - LTE_UE_DLSCH_t *dlsch, - uint8_t subframe, - uint8_t num_pdcch_symbols); - // DL power control functions double get_pa_dB(uint8_t pa); diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c index ab73bedb4f..980a625978 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c @@ -50,30 +50,6 @@ //#define DEBUG_DLSCH_DEMOD //#define DEBUG_PDSCH_RX -// [MCS][i_mod (0,1,2) = (2,4,6)] -//unsigned char offset_mumimo_llr_drange_fix=0; -//inferference-free case -/*unsigned char interf_unaw_shift_tm4_mcs[29]={5, 3, 4, 3, 3, 2, 1, 1, 2, 0, 1, 1, 1, 1, 0, 0, - 1, 1, 1, 1, 0, 2, 1, 0, 1, 0, 1, 0, 0} ;*/ - -//unsigned char interf_unaw_shift_tm1_mcs[29]={5, 5, 4, 3, 3, 3, 2, 2, 4, 4, 2, 3, 3, 3, 1, 1, -// 0, 1, 1, 2, 5, 4, 4, 6, 5, 1, 0, 5, 6} ; // mcs 21, 26, 28 seem to be errorneous - -/* -unsigned char offset_mumimo_llr_drange[29][3]={{8,8,8},{7,7,7},{7,7,7},{7,7,7},{6,6,6},{6,6,6},{6,6,6},{5,5,5},{4,4,4},{1,2,4}, // QPSK -{5,5,4},{5,5,5},{5,5,5},{3,3,3},{2,2,2},{2,2,2},{2,2,2}, // 16-QAM -{2,2,1},{3,3,3},{3,3,3},{3,3,1},{2,2,2},{2,2,2},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}}; //64-QAM -*/ - /* - //first optimization try - unsigned char offset_mumimo_llr_drange[29][3]={{7, 8, 7},{6, 6, 7},{6, 6, 7},{6, 6, 6},{5, 6, 6},{5, 5, 6},{5, 5, 6},{4, 5, 4},{4, 3, 4},{3, 2, 2},{6, 5, 5},{5, 4, 4},{5, 5, 4},{3, 3, 2},{2, 2, 1},{2, 1, 1},{2, 2, 2},{3, 3, 3},{3, 3, 2},{3, 3, 2},{3, 2, 1},{2, 2, 2},{2, 2, 2},{0, 0, 0},{0, 0, 0},{0, 0, 0},{0, 0, 0},{0, 0, 0}}; - */ - //second optimization try - /* - unsigned char offset_mumimo_llr_drange[29][3]={{5, 8, 7},{4, 6, 8},{3, 6, 7},{7, 7, 6},{4, 7, 8},{4, 7, 4},{6, 6, 6},{3, 6, 6},{3, 6, 6},{1, 3, 4},{1, 1, 0},{3, 3, 2},{3, 4, 1},{4, 0, 1},{4, 2, 2},{3, 1, 2},{2, 1, 0},{2, 1, 1},{1, 0, 1},{1, 0, 1},{0, 0, 0},{1, 0, 0},{0, 0, 0},{0, 1, 0},{1, 0, 0},{0, 0, 0},{0, 0, 0},{0, 0, 0},{0, 0, 0}}; w - */ -//unsigned char offset_mumimo_llr_drange[29][3]= {{0, 6, 5},{0, 4, 5},{0, 4, 5},{0, 5, 4},{0, 5, 6},{0, 5, 3},{0, 4, 4},{0, 4, 4},{0, 3, 3},{0, 1, 2},{1, 1, 0},{1, 3, 2},{3, 4, 1},{2, 0, 0},{2, 2, 2},{1, 1, 1},{2, 1, 0},{2, 1, 1},{1, 0, 1},{1, 0, 1},{0, 0, 0},{1, 0, 0},{0, 0, 0},{0, 1, 0},{1, 0, 0},{0, 0, 0},{0, 0, 0},{0, 0, 0},{0, 0, 0}}; - #define print_ints(s,x) printf("%s = %d %d %d %d\n",s,(x)[0],(x)[1],(x)[2],(x)[3]) #define print_shorts(s,x) printf("%s = [%d+j*%d, %d+j*%d, %d+j*%d, %d+j*%d]\n",s,(x)[0],(x)[1],(x)[2],(x)[3],(x)[4],(x)[5],(x)[6],(x)[7]) diff --git a/openair1/SCHED_UE/phy_procedures_lte_ue.c b/openair1/SCHED_UE/phy_procedures_lte_ue.c index 8ca02917b0..b91accc6ff 100644 --- a/openair1/SCHED_UE/phy_procedures_lte_ue.c +++ b/openair1/SCHED_UE/phy_procedures_lte_ue.c @@ -2925,19 +2925,16 @@ void ue_pmch_procedures(PHY_VARS_UE *ue, else ue->dlsch_mtch_errors[sync_area][0]++; - LOG_E(PHY,"[UE %d] Frame %d, subframe %d: PMCH in error (%d,%d), not passing to L2 (TBS %d, iter %d,G %d)\n", + LOG_E(PHY, + "[UE %d] Frame %d, subframe %d: PMCH in error (%d,%d), not passing to L2 (TBS %d, iter %d,G %d)\n", ue->Mod_id, - frame_rx,subframe_rx, + frame_rx, + subframe_rx, ue->dlsch_mcch_errors[sync_area][0], ue->dlsch_mtch_errors[sync_area][0], - ue->dlsch_MCH[0]->harq_processes[0]->TBS>>3, + ue->dlsch_MCH[0]->harq_processes[0]->TBS >> 3, ue->dlsch_MCH[0]->max_turbo_iterations, ue->dlsch_MCH[0]->harq_processes[0]->G); - // dump_mch(ue,0,ue->dlsch_MCH[0]->harq_processes[0]->G,subframe_rx); - //if(subframe_rx == 3){ - //dump_mch(ue,0,ue->dlsch_MCH[0]->harq_processes[0]->G,subframe_rx); - //exit_fun("nothing to add"); - //} if (LOG_DEBUGFLAG(DEBUG_UE_PHYPROC)) { for (int i=0; idlsch_MCH[0]->harq_processes[0]->TBS>>3; i++) { @@ -2962,11 +2959,9 @@ void ue_pmch_procedures(PHY_VARS_UE *ue, CC_id, frame_rx, ue->dlsch_MCH[0]->harq_processes[0]->b, - ue->dlsch_MCH[0]->harq_processes[0]->TBS>>3, - eNB_id,// not relevant in eMBMS context + ue->dlsch_MCH[0]->harq_processes[0]->TBS >> 3, + eNB_id, // not relevant in eMBMS context sync_area); - //dump_mch(ue,0,ue->dlsch_MCH[0]->harq_processes[0]->G,subframe_rx); - //exit_fun("nothing to add"); if (mcch_active == 1) ue->dlsch_mcch_received[sync_area][0]++; diff --git a/openair1/SIMULATION/TOOLS/random_channel.c b/openair1/SIMULATION/TOOLS/random_channel.c index cf973f5d84..7ec844329f 100644 --- a/openair1/SIMULATION/TOOLS/random_channel.c +++ b/openair1/SIMULATION/TOOLS/random_channel.c @@ -1849,27 +1849,6 @@ int random_channel(channel_desc_t *desc, uint8_t abstraction_flag) { } } - /* - FIXME: Function cblas_zgemv has an undefined output (for the same input) after a second call in RHEL8 (acorr = nan) - alpha.r = 1.0; - alpha.i = 0.0; - beta.r = 0.0; - beta.i = 0.0; - cblas_zgemv(CblasRowMajor, CblasNoTrans, desc->nb_tx*desc->nb_rx, desc->nb_tx*desc->nb_rx, - (void *) &alpha, (void *) desc->R_sqrt[i/3], desc->nb_rx*desc->nb_tx, - (void *) anew, 1, (void *) &beta, (void *) acorr, 1); - */ - - /* - for (aarx=0;aarxnb_rx;aarx++) { - for (aatx=0;aatxnb_tx;aatx++) { - desc->a[i][aarx+(aatx*desc->nb_rx)].x = acorr[aarx+(aatx*desc->nb_rx)].x; - desc->a[i][aarx+(aatx*desc->nb_rx)].y = acorr[aarx+(aatx*desc->nb_rx)].y; - printf("tap %d, acorr1(%d,%d) = %f+1j*%f\n",i,aatx,aarx,acorr[aarx+(aatx*desc->nb_rx)].x, acorr[aarx+(aatx*desc->nb_rx)].y); - } - } - */ - if (desc->first_run==1) { memcpy(desc->a[i], acorr, desc->nb_tx * desc->nb_rx * sizeof(*acorr)); } else { diff --git a/openair2/UTIL/OMG/makefile b/openair2/UTIL/OMG/makefile index 80ab8c6394..87475ed133 100644 --- a/openair2/UTIL/OMG/makefile +++ b/openair2/UTIL/OMG/makefile @@ -100,7 +100,7 @@ $(OBJ) : %.o : %.c $(L2_OBJS) : %.o : %.c $(CC) -c $(CFLAGS) $(EXTRA_CFLAGS) -DMAC_CONTEXT=1 -DPHY_CONTEXT=1 -I$(TOP_DIR) $(L2_incl) -o $@ $< -physim : $(OBJ) $(L2_OBJS) OMG.c common.c static.c job.c rwp.c rwalk.c hashtable.c mobility_parser.c trace.c -I$(TOP_DIR) $(L2_incl) -o physim $(CFLAGS) $(EXTRA_CFLAGS) $(OBJ) $(L2_OBJS) -lm -lforms -L/usr/local/lib -lforms -lX11 -L/usr/X11R6/lib -lXpm -lblas -lpthread +physim : $(OBJ) $(L2_OBJS) OMG.c common.c static.c job.c rwp.c rwalk.c hashtable.c mobility_parser.c trace.c -I$(TOP_DIR) $(L2_incl) -o physim $(CFLAGS) $(EXTRA_CFLAGS) $(OBJ) $(L2_OBJS) -lm -lforms -L/usr/local/lib -lforms -lX11 -L/usr/X11R6/lib -lXpm -lpthread clean: rm -f physim diff --git a/tools/packages/packages.cmake b/tools/packages/packages.cmake index 8ec8581354..0ec0008e5a 100644 --- a/tools/packages/packages.cmake +++ b/tools/packages/packages.cmake @@ -62,7 +62,7 @@ if(PACKAGING_LTE) set(CPACK_RPM_PACKAGE_OAI-LTE_SUMMARY "OpenAirInterface LTE package") set(CPACK_RPM_PACKAGE_OAI-LTE_DESCRIPTION "${LTE_PACKAGE_DESCRIPTION}") else() - set(CPACK_DEBIAN_OAI-LTE_PACKAGE_DEPENDS "liboai-common, libblas3, liblapacke") + set(CPACK_DEBIAN_OAI-LTE_PACKAGE_DEPENDS "liboai-common") set(CPACK_DEBIAN_OAI-LTE_SUMMARY "OpenAirInterface LTE package") set(CPACK_DEBIAN_OAI-LTE_DESCRIPTION "${LTE_PACKAGE_DESCRIPTION}") endif()