diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000000000000000000000000000000000000..c75f8fa464aa3f784031634abfa5fc3e8d0d2193 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,32 @@ +job1: + script: + - echo $PWD + - echo $USER + - echo $OAI_USER + - echo $OAI_EXTRA_ARGS + - echo $NFS_SHARE_DIR + - echo $EXTERNAL_SHARE_DIR + - echo $SHELL + - git rev-parse --abbrev-ref HEAD + - git_head=`git rev-parse HEAD` + - echo $git_head + - tmp=`git show-ref --head | grep $git_head` + - tmp=(${tmp///// }) + - git_branch=${tmp[@]:(-1)} + - echo $git_branch + - source oaienv + - echo $OPENAIR_DIR + - NFS_TEST_RESULTS_DIR=$NFS_SHARE_DIR/$git_branch/$git_head + - EXTERNAL_SHARE_RESULTS_DIR=$EXTERNAL_SHARE_DIR/$git_branch/$git_head + - echo $NFS_TEST_RESULTS_DIR + - echo $EXTERNAL_SHARE_RESULTS_DIR + - echo $NRUNS_LTE_SOFTMODEM + - echo $TIMEOUT_CMD + - mkdir -p $OPENAIR_DIR/cmake_targets/autotests/log + - python $OPENAIR_DIR/cmake_targets/autotests/run_exec_lte-softmodem_tests.py -c -5GRepoHeadVersion $git_head -n $NFS_SHARE_DIR -u $OAI_USER -p $OAI_PASS $OAI_EXTRA_ARGS -g "$OAI_TEST_CASE_GROUP">& $OPENAIR_DIR/cmake_targets/autotests/python_autotest_cleanup.log + - python $OPENAIR_DIR/cmake_targets/autotests/run_exec_lte-softmodem_tests.py -r -5GRepoHeadVersion $git_head -n $NFS_SHARE_DIR -u $OAI_USER -p $OAI_PASS `echo $OAI_EXTRA_ARGS` -g "$OAI_TEST_CASE_GROUP" --nrun_lte_softmodem $NRUNS_LTE_SOFTMODEM --timeout_cmd $TIMEOUT_CMD >& $OPENAIR_DIR/cmake_targets/autotests/python_autotest.log + - mv $OPENAIR_DIR/cmake_targets/autotests/python_autotest.log $OPENAIR_DIR/cmake_targets/autotests/log/python_autotest.log + - mv $OPENAIR_DIR/cmake_targets/autotests/python_autotest_cleanup.log $OPENAIR_DIR/cmake_targets/autotests/log/python_autotest_cleanup.log + - sshpass -p "$OAI_PASS" rsync -az -e "ssh -o StrictHostKeyChecking=no " --rsync-path="mkdir -p $NFS_TEST_RESULTS_DIR && rsync" $OPENAIR_DIR/cmake_targets/autotests/log $OAI_USER@localhost:$NFS_TEST_RESULTS_DIR + - sshpass -p "$OAI_PASS" rsync -az -e "ssh -o StrictHostKeyChecking=no " --rsync-path="mkdir -p $EXTERNAL_SHARE_DIR && rsync" $OPENAIR_DIR/cmake_targets/autotests/log $OAI_USER@localhost:$EXTERNAL_SHARE_DIR + - cat $OPENAIR_DIR/cmake_targets/autotests/log/results_autotests.xml diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index b75964075454fbbdb443baa97e61e05c5588c977..1c8f3d221e9debd0bd0232c9f8ce082d6a096c8c 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -36,12 +36,16 @@ set (OPENAIR1_DIR ${OPENAIR_DIR}/openair1) set (OPENAIR2_DIR ${OPENAIR_DIR}/openair2) set (OPENAIR3_DIR ${OPENAIR_DIR}/openair3) set (OPENAIR_TARGETS ${OPENAIR_DIR}/targets) -set (OPENAIR3_DIR ${OPENAIR_DIR}/openair3) +set (OPENAIR3_DIR ${OPENAIR_DIR}/openair3) set (OPENAIR_CMAKE ${OPENAIR_DIR}/cmake_targets) set (OPENAIR_BIN_DIR ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}) project (OpenAirInterface) +add_subdirectory(${OPENAIR_TARGETS}/ARCH/LMSSDR/USERSPACE/LIB/lms7002m lms7002m) +add_subdirectory(${OPENAIR_TARGETS}/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR lmsSDR) +add_subdirectory(${OPENAIR_TARGETS}/ARCH/LMSSDR/USERSPACE/LIB/Si5351C Si5351C) + ########################################### # macros to define options as there is numerous options in oai ################################################ @@ -159,8 +163,13 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_FCNTL_H=1 -DHAVE_ARPA_INET_H=1 -DHAVE_SYS_TIME_H=1 -DHAVE_SYS_SOCKET_H=1 -DHAVE_STRERROR=1 -DHAVE_SOCKET=1 -DHAVE_MEMSET=1 -DHAVE_GETTIMEOFDAY=1 -DHAVE_STDLIB_H=1 -DHAVE_MALLOC=1 -DHAVE_LIBSCTP" ) set(CMAKE_CXX_FLAGS - "${CMAKE_CXX_FLAGS} ${C_FLAGS_PROCESSOR}" + "${CMAKE_CXX_FLAGS} ${C_FLAGS_PROCESSOR} -std=c++11 " ) + + +######################### +set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-rpath -Wl,${OPENAIR_TARGETS}/bin") +######################### # set a flag for changes in the source code # these changes are related to hardcoded path to include .h files add_definitions(-DCMAKER) @@ -168,7 +177,6 @@ set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS} -g -DMALLOC_CHECK_=3") set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS} -g -DMALLOC_CHECK_=3 -O2") - set(GIT_BRANCH "UNKNOWN") set(GIT_COMMIT_HASH "UNKNOWN") set(GIT_COMMIT_DATE "UNKNOWN") @@ -269,6 +277,9 @@ endif (${RTAI}) set(asn1c_call "${OPENAIR_CMAKE}/tools/generate_asn1") set(asn1_generated_dir ${OPENAIR_BIN_DIR}) +set(protoc_call "${OPENAIR_CMAKE}/tools/generate_protobuf") +set(protobuf_generated_dir ${OPENAIR_BIN_DIR}) + # RRC ###### add_list2_option(RRC_ASN1_VERSION "Rel10" "ASN.1 version of RRC interface" "Rel8" "Rel10" "CBA") @@ -430,8 +441,55 @@ add_list1_option(NB_ANTENNAS_RX "2" "Number of antennas in reception" "1" "2" "4 add_list1_option(NB_ANTENNAS_TX "2" "Number of antennas in transmission" "1" "2" "4") add_list1_option(NB_ANTENNAS_TXRX "2" "Number of antennas in ????" "1" "2" "4") -add_list2_option(RF_BOARD "EXMIMO" "RF head type" "False" "EXMIMO" "OAI_USRP" "ETHERNET" "OAI_BLADERF" "CPRIGW") +add_list2_option(RF_BOARD "EXMIMO" "RF head type" "None" "EXMIMO" "OAI_USRP" "OAI_BLADERF" "CPRIGW" "OAI_LMSSDR") + +add_list2_option(TRANSP_PRO "None" "Transport protocol type" "None" "ETHERNET") + + +# include RF devices / transport protocols library modules +###################################################################### + +include_directories("${OPENAIR_TARGETS}/ARCH/EXMIMO/USERSPACE/LIB/") +include_directories ("${OPENAIR_TARGETS}/ARCH/EXMIMO/DEFS/") +#set (option_HWEXMIMOLIB_lib "-l ") +set(HWLIB_EXMIMO_SOURCE + ${OPENAIR_TARGETS}/ARCH/EXMIMO/USERSPACE/LIB/openair0_lib.c + ${OPENAIR_TARGETS}/ARCH/EXMIMO/USERSPACE/LIB/gain_control.c + ) +add_library(oai_exmimodevif MODULE ${HWLIB_EXMIMO_SOURCE} ) +include_directories("${OPENAIR_TARGETS}/ARCH/USRP/USERSPACE/LIB/") +set (option_HWUSRPLIB_lib "-l uhd") +set(HWLIB_USRP_SOURCE + ${OPENAIR_TARGETS}/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp + ) +add_library(oai_usrpdevif MODULE ${HWLIB_USRP_SOURCE} ) + +include_directories("${OPENAIR_TARGETS}/ARCH/BLADERF/USERSPACE/LIB/") +set (option_HWBLADERFLIB_lib "-l bladerf") +set(HWLIB_BLADERF_SOURCE + ${OPENAIR_TARGETS}/ARCH/BLADERF/USERSPACE/LIB/bladerf_lib.c + ) +add_library(oai_bladerfdevif MODULE ${HWLIB_BLADERF_SOURCE} ) + +include_directories("${OPENAIR_TARGETS}/ARCH/LMSSDR/USERSPACE/LIB/") +set (option_HWLMSSDRLIB_lib "-l LMS_SDR -l LMS7002M -l Si5351C") +set(HWLIB_LMSSDR_SOURCE + ${OPENAIR_TARGETS}/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp + ) +add_library(oai_lmssdrdevif MODULE ${HWLIB_LMSSDR_SOURCE} ) + +include_directories("${OPENAIR_TARGETS}/ARCH/ETHERNET/USERSPACE/LIB/") +set(TPLIB_ETHERNET_SOURCE + ${OPENAIR_TARGETS}/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.c + ${OPENAIR_TARGETS}/ARCH/ETHERNET/USERSPACE/LIB/eth_udp.c + ${OPENAIR_TARGETS}/ARCH/ETHERNET/USERSPACE/LIB/eth_raw.c + ) +add_library(oai_eth_transpro MODULE ${TPLIB_ETHERNET_SOURCE} ) + + +# RF devices / transport protocols settings +###################################################################### if (${RF_BOARD} STREQUAL "EXMIMO") set(DRIVER2013) include_directories ("${OPENAIR_TARGETS}/ARCH/EXMIMO/USERSPACE/LIB/") @@ -439,6 +497,7 @@ if (${RF_BOARD} STREQUAL "EXMIMO") set(HW_SOURCE ${HW_SOURCE} ${OPENAIR_TARGETS}/ARCH/EXMIMO/USERSPACE/LIB/openair0_lib.c ${OPENAIR_TARGETS}/ARCH/EXMIMO/USERSPACE/LIB/gain_control.c) + set(option_HW_lib "-rdynamic -ldl") elseif (${RF_BOARD} STREQUAL "OAI_USRP") include_directories("${OPENAIR_TARGETS}/ARCH/USRP/USERSPACE/LIB/") @@ -446,8 +505,7 @@ elseif (${RF_BOARD} STREQUAL "OAI_USRP") set(HW_SOURCE ${HW_SOURCE} ${OPENAIR_TARGETS}/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp) LINK_DIRECTORIES("/opt/lib") - set(option_HW_lib "uhd") - set(LOWLATENCY False) + set(option_HW_lib "-luhd -rdynamic -ldl") elseif (${RF_BOARD} STREQUAL "OAI_BLADERF") include_directories("${OPENAIR_TARGETS}/ARCH/BLADERF/USERSPACE/LIB/") @@ -457,26 +515,51 @@ elseif (${RF_BOARD} STREQUAL "OAI_BLADERF") ${OPENAIR_TARGETS}/ARCH/BLADERF/USERSPACE/LIB/bladerf_lib.c ) LINK_DIRECTORIES("/usr/lib/x86_64-linux-gnu") - set(option_HW_lib "bladeRF") -#set(LOWLATENCY False) -elseif (${RF_BOARD} STREQUAL "ETHERNET") - include_directories ("${OPENAIR_TARGETS}/ARCH/ETHERNET/USERSPACE/LIB") - set(HW_SOURCE ${HW_SOURCE} - ${OPENAIR_TARGETS}/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.c - ) - set(LOWLATENCY True) - + set(option_HW_lib "bladeRF -rdynamic -ldl") + #set(LOWLATENCY False) + +elseif (${RF_BOARD} STREQUAL "OAI_LMSSDR") + include_directories("${OPENAIR_TARGETS}/ARCH/LMSSDR/USERSPACE/LIB") + include_directories("${OPENAIR_TARGETS}/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR") + include_directories("${OPENAIR_TARGETS}/ARCH/LMSSDR/USERSPACE/LIB/lms7002m") + include_directories("${OPENAIR_TARGETS}/ARCH/LMSSDR/USERSPACE/LIB/Si5351C") + include_directories("${OPENAIR_TARGETS}/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/LMS_StreamBoard") + LINK_DIRECTORIES("/usr/lib/x86_64-linux-gnu") + LINK_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}/lmsSDR") + LINK_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}/lms7002m") + LINK_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}/Si5351C") + set(HW_SOURCE ${HW_SOURCE} ${OPENAIR_TARGETS}/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp) + set(LOWLATENCY False) + set(option_HW_lib "-lLMS_SDR -lLMS7002M -lSi5351C -rdynamic -ldl") + elseif (${RF_BOARD} STREQUAL "CPRIGW") set(HW_SOURCE ${HW_SOURCE} ${OPENAIR_TARGETS}/ARCH/CPRIGW/USERSPACE/LIB/cprigw_lib.c ) include_directories("${OPENAIR_TARGETS}/ARCH/CPRIGW/USERSPACE/LIB/") - set(option_HW_lib "-rdynamic dl") + set(option_HW_lib "-rdynamic dl") + endif (${RF_BOARD} STREQUAL "EXMIMO") + +if (${TRANSP_PRO} STREQUAL "ETHERNET") + + include_directories ("${OPENAIR_TARGETS}/ARCH/ETHERNET/USERSPACE/LIB") + set(TRANSPORT_SOURCE ${TRANSPORT_SOURCE} + ${OPENAIR_TARGETS}/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.c + ${OPENAIR_TARGETS}/ARCH/ETHERNET/USERSPACE/LIB/eth_udp.c + ${OPENAIR_TARGETS}/ARCH/ETHERNET/USERSPACE/LIB/eth_raw.c + ) + set(option_TP_lib "-rdynamic -ldl") + + +endif (${TRANSP_PRO} STREQUAL "ETHERNET") +########################################################## + include_directories ("${OPENAIR_TARGETS}/ARCH/COMMON") +Message("LOWLATENCY flag is ${LOWLATENCY}") ############################################################## # ???!!! TO BE DOCUMENTED OPTIONS !!!??? @@ -499,6 +582,9 @@ add_list_string_option(PACKAGE_NAME "NotDefined" "As per attribute name") add_boolean_option(MESSAGE_CHART_GENERATOR False "For generating sequence diagrams") add_boolean_option(MESSAGE_CHART_GENERATOR_RLC_MAC False "trace RLC-MAC exchanges in sequence diagrams") add_boolean_option(MESSAGE_CHART_GENERATOR_PHY False "trace some PHY exchanges in sequence diagrams") + +add_boolean_option(ENB_AGENT True "enable eNB agent to inteface with a SDN contrller") + ######################## # Include order ########################## @@ -869,6 +955,7 @@ set(PHY_SRC ${OPENAIR1_DIR}/PHY/CODING/viterbi_lte.c ${OPENAIR1_DIR}/PHY/INIT/lte_init.c ${OPENAIR1_DIR}/PHY/INIT/lte_parms.c + ${OPENAIR1_DIR}/PHY/INIT/lte_param_init.c ${OPENAIR1_DIR}/PHY/TOOLS/file_output.c ${OPENAIR1_DIR}/PHY/TOOLS/lte_dfts.c ${OPENAIR1_DIR}/PHY/TOOLS/log2_approx.c @@ -1023,7 +1110,6 @@ add_library(CN_UTILS ${OPENAIR3_DIR}/UTILS/conversions.c ${OPENAIR3_DIR}/UTILS/enum_string.c ${OPENAIR3_DIR}/UTILS/log.c - ${OPENAIR3_DIR}/UTILS/mme_config.c ${OPENAIR3_DIR}/UTILS/mcc_mnc_itu.c ) @@ -1430,10 +1516,11 @@ add_definitions(-DASN1_MINIMUM_VERSION=924) ################################# # add executables for operation -#################################"" +################################# # lte-softmodem is both eNB and UE implementation ################################################### + add_executable(lte-softmodem ${rrc_h} ${s1ap_h} @@ -1451,6 +1538,7 @@ add_executable(lte-softmodem ${OPENAIR3_DIR}/NAS/UE/nas_ue_task.c ${GTPU_need_ITTI} ${HW_SOURCE} + ${TRANSPORT_SOURCE} ${RTAI_SOURCE} ${XFORMS_SOURCE} ${XFORMS_SOURCE_SOFTMODEM} @@ -1458,13 +1546,14 @@ 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 PHY LFDS L2 ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ${ITTI_LIB} ${MIH_LIB} + RRC_LIB S1AP_LIB S1AP_ENB GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB PHY LFDS L2 ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ${ITTI_LIB} ${MIH_LIB} -Wl,--end-group ) target_link_libraries (lte-softmodem ${LIBXML2_LIBRARIES}) -target_link_libraries (lte-softmodem pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} sctp ${option_HW_lib} ${XFORMS_LIBRARIES} ) +target_link_libraries (lte-softmodem pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} sctp ${option_HW_lib} ${option_TP_lib} ${XFORMS_LIBRARIES} ) target_link_libraries (lte-softmodem ${LIBBOOST_LIBRARIES}) +target_link_libraries (lte-softmodem ${LIB_LMS_LIBRARIES}) # lte-softmodem-nos1 is both eNB and UE implementation ################################################### @@ -1485,6 +1574,7 @@ add_executable(lte-softmodem-nos1 #${OPENAIR2_DIR}/RRC/NAS/rb_config.c ${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/netlink_init.c ${HW_SOURCE} + ${TRANSPORT_SOURCE} ${RTAI_SOURCE} ${XFORMS_SOURCE} ${XFORMS_SOURCE_SOFTMODEM} @@ -1495,38 +1585,43 @@ target_link_libraries (lte-softmodem-nos1 -Wl,--end-group ) target_link_libraries (lte-softmodem-nos1 ${LIBXML2_LIBRARIES}) -target_link_libraries (lte-softmodem-nos1 pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} ${option_HW_lib} ${XFORMS_LIBRARIES} ) +target_link_libraries (lte-softmodem-nos1 pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} ${option_HW_lib} ${option_TP_lib} ${XFORMS_LIBRARIES} ) target_link_libraries (lte-softmodem-nos1 ${LIBBOOST_LIBRARIES}) - - +target_link_libraries (lte-softmodem-nos1 ${LIB_LMS_LIBRARIES}) # rrh ################################ -set(DRIVER2013) - -#Note: only on RF type is currently supported for RRH +#Note: only one RF type (USRP) is currently supported for RRH add_executable(rrh_gw ${OPENAIR_TARGETS}/RT/USER/rrh_gw.c ${OPENAIR_TARGETS}/RT/USER/eNB_transport_IQ.c ${OPENAIR_TARGETS}/RT/USER/UE_transport_IQ.c ${OPENAIR_TARGETS}/RT/USER/rt_wrapper.c ${OPENAIR_TARGETS}/ARCH/COMMON/common_lib.c - ${OPENAIR_TARGETS}/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.c ${HW_SOURCE} + ${TRANSPORT_SOURCE} ) -# assert and common_lib.h -target_include_directories(rrh_gw PRIVATE ${OPENAIR_DIR}/common/utils/itti ${OPENAIR_TARGETS}/ARCH/COMMON ${OPENAIR_TARGETS}/ARCH/ETHERNET/USERSPACE/LIB/ ) - +target_include_directories(rrh_gw PRIVATE ${OPENAIR_DIR}/common/utils/itti) target_link_libraries(rrh_gw -Wl,--start-group UTIL LFDS -Wl,--end-group ) target_link_libraries (rrh_gw rt pthread m ) -target_link_libraries (rrh_gw ${option_HW_lib} ${LIBBOOST_LIBRARIES} ) +target_link_libraries (rrh_gw ${option_HW_lib} ${option_TP_lib} ${LIBBOOST_LIBRARIES} ) +target_link_libraries (rrh_gw ${LIB_LMS_LIBRARIES}) -#Message("-- default_HW_lib=ETHERNET") # only in case of RRH Message("-- option_HW_lib=${option_HW_lib}") Message("-- HW_SOURCE=${HW_SOURCE}") +Message("-- option_TP_lib=${option_TP_lib}") +Message("-- TRANSPORT_SOURCE=${TRANSPORT_SOURCE}") + +if (${RF_BOARD} STREQUAL "OAI_LMSSDR") + add_dependencies(lte-softmodem LMS7002M LMS_SDR Si5351C) + add_dependencies(lte-softmodem-nos1 LMS7002M LMS_SDR Si5351C) + add_dependencies(rrh_gw LMS7002M LMS_SDR Si5351C) +endif (${RF_BOARD} STREQUAL "OAI_LMSSDR") + + # USIM process ################# @@ -1577,6 +1672,7 @@ add_executable(oaisim ${GTPU_need_ITTI} ${OPENAIR_TARGETS}/COMMON/create_tasks.c ${HW_SOURCE} + ${TRANSPORT_SOURCE} ${XFORMS_SOURCE} ) @@ -1588,7 +1684,7 @@ target_link_libraries (oaisim -Wl,--end-group ) target_link_libraries (oaisim ${LIBXML2_LIBRARIES} ${LAPACK_LIBRARIES}) -target_link_libraries (oaisim pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} sctp ${option_HW_lib} +target_link_libraries (oaisim pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} sctp ${option_HW_lib} ${option_TP_lib} ${ATLAS_LIBRARIES} ${XFORMS_LIBRARIES} ${OPENPGM_LIBRARIES}) #Force link with forms, regardless XFORMS option target_link_libraries (oaisim forms) @@ -1615,6 +1711,7 @@ add_executable(oaisim_nos1 ${OPENAIR2_DIR}/UTIL/OMG/sumo.c ${OPENAIR_TARGETS}/COMMON/create_tasks.c ${HW_SOURCE} + ${TRANSPORT_SOURCE} ${XFORMS_SOURCE} ) target_include_directories(oaisim_nos1 PUBLIC ${OPENAIR_TARGETS}/SIMU/USER) @@ -1624,7 +1721,7 @@ target_link_libraries (oaisim_nos1 -Wl,--end-group ) target_link_libraries (oaisim_nos1 ${LIBXML2_LIBRARIES} ${LAPACK_LIBRARIES}) -target_link_libraries (oaisim_nos1 pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} ${option_HW_lib} +target_link_libraries (oaisim_nos1 pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} ${option_HW_lib} ${option_TP_lib} ${ATLAS_LIBRARIES} ${XFORMS_LIBRARIES} ${OPENPGM_LIBRARIES}) #Force link with forms, regardless XFORMS option target_link_libraries (oaisim_nos1 forms) diff --git a/cmake_targets/autotests/README.txt b/cmake_targets/autotests/README.txt index a370ae573d5d303868172b6c4bb601754d30b986..d3b72edf46a8b7730627d50ca1bcd292c8afa51c 100644 --- a/cmake_targets/autotests/README.txt +++ b/cmake_targets/autotests/README.txt @@ -98,46 +98,97 @@ Obj.# Case# Test# Description 01 55 lte-softmodem tests with USRP B210 RF as eNB and ALU EPC w/ Bandrich COTS UE for TX/1RX, 2TX/2RX -01 55 00 Band 7 FDD 5MHz UL Throughput for 60 sec for 1TX/1RX -01 55 01 Band 7 FDD 10MHz UL Throughput for 60 sec for 1TX/1RX -01 55 02 Band 7 FDD 20MHz UL Throughput for 60 sec for 1TX/1RX -01 55 03 Band 7 FDD 5MHz DL Throughput for 60 sec for 1TX/1RX -01 55 04 Band 7 FDD 10MHz DL Throughput for 60 sec for 1TX/1RX -01 55 05 Band 7 FDD 20MHz DL Throughput for 60 sec for 1TX/1RX -01 55 06 Band 7 FDD 5MHz UL Throughput for 60 sec for 2TX/2RX -01 55 07 Band 7 FDD 10MHz UL Throughput for 60 sec for 2TX/2RX -01 55 08 Band 7 FDD 20MHz UL Throughput for 60 sec for 2TX/2RX -01 55 09 Band 7 FDD 5MHz DL Throughput for 60 sec for 2TX/2RX -01 55 10 Band 7 FDD 10MHz DL Throughput for 60 sec for 2TX/2RX -01 55 11 Band 7 FDD 20MHz DL Throughput for 60 sec for 2TX/2RX +01 55 00 Band 7 FDD 5MHz UL Throughput for 300 sec for 1TX/1RX +01 55 01 Band 7 FDD 10MHz UL Throughput for 300 sec for 1TX/1RX +01 55 02 Band 7 FDD 20MHz UL Throughput for 300 sec for 1TX/1RX +01 55 03 Band 7 FDD 5MHz DL Throughput for 300 sec for 1TX/1RX +01 55 04 Band 7 FDD 10MHz DL Throughput for 300 sec for 1TX/1RX +01 55 05 Band 7 FDD 20MHz DL Throughput for 300 sec for 1TX/1RX +01 55 06 Band 7 FDD 5MHz UL Throughput for 300 sec for 2TX/2RX +01 55 07 Band 7 FDD 10MHz UL Throughput for 300 sec for 2TX/2RX +01 55 08 Band 7 FDD 20MHz UL Throughput for 300 sec for 2TX/2RX +01 55 09 Band 7 FDD 5MHz DL Throughput for 300 sec for 2TX/2RX +01 55 10 Band 7 FDD 10MHz DL Throughput for 300 sec for 2TX/2RX +01 55 11 Band 7 FDD 20MHz DL Throughput for 300 sec for 2TX/2RX 01 56 lte-softmodem tests with USRP B210 RF as eNB and OAI EPC (eNB and EPC are on same machines) w/ Bandrich COTS UE - +01 56 00 Band 7 FDD 5MHz UL Throughput for 300 sec for 1TX/1RX +01 56 01 Band 7 FDD 10MHz UL Throughput for 300 sec for 1TX/1RX +01 56 02 Band 7 FDD 20MHz UL Throughput for 300 sec for 1TX/1RX +01 56 03 Band 7 FDD 5MHz DL Throughput for 300 sec for 1TX/1RX +01 56 04 Band 7 FDD 10MHz DL Throughput for 300 sec for 1TX/1RX +01 56 05 Band 7 FDD 20MHz DL Throughput for 300 sec for 1TX/1RX 01 57 lte-softmodem tests with USRP B210 RF as eNB and OAI EPC (eNB and EPC are on different machines) w/ Bandrich COTS UE +01 57 00 Band 7 FDD 5MHz UL Throughput for 300 sec for 1TX/1RX +01 57 01 Band 7 FDD 10MHz UL Throughput for 300 sec for 1TX/1RX +01 57 02 Band 7 FDD 20MHz UL Throughput for 300 sec for 1TX/1RX +01 57 03 Band 7 FDD 5MHz DL Throughput for 300 sec for 1TX/1RX +01 57 04 Band 7 FDD 10MHz DL Throughput for 300 sec for 1TX/1RX +01 57 05 Band 7 FDD 20MHz DL Throughput for 300 sec for 1TX/1RX 01 58 lte-softmodem tests with USRP X310 RF as eNB and ALU EPC w/ Bandrich COTS UE for `TX/1RX, 2TX/2RX -01 58 00 Band 7 FDD 5MHz UL Throughput for 60 sec for 1TX/1RX -01 58 01 Band 7 FDD 10MHz UL Throughput for 60 sec for 1TX/1RX -01 58 02 Band 7 FDD 20MHz UL Throughput for 60 sec for 1TX/1RX -01 58 03 Band 7 FDD 5MHz DL Throughput for 60 sec for 1TX/1RX -01 58 04 Band 7 FDD 10MHz DL Throughput for 60 sec for 1TX/1RX -01 58 05 Band 7 FDD 20MHz DL Throughput for 60 sec for 1TX/1RX +01 58 00 Band 7 FDD 5MHz UL Throughput for 300 sec for 1TX/1RX +01 58 01 Band 7 FDD 10MHz UL Throughput for 300 sec for 1TX/1RX +01 58 02 Band 7 FDD 20MHz UL Throughput for 300 sec for 1TX/1RX +01 58 03 Band 7 FDD 5MHz DL Throughput for 300 sec for 1TX/1RX +01 58 04 Band 7 FDD 10MHz DL Throughput for 300 sec for 1TX/1RX +01 58 05 Band 7 FDD 20MHz DL Throughput for 300 sec for 1TX/1RX 01 59 lte-softmodem tests with USRP X310 RF as eNB and OAI EPC (eNB and EPC are on same machines) w/ Bandrich COTS UE -01 61 lte-softmodem tests with USRP X310 RF as eNB and OAI EPC (eNB and EPC are on different machines) w/ Bandrich COTS UE +01 60 lte-softmodem tests with USRP X310 RF as eNB and OAI EPC (eNB and EPC are on different machines) w/ Bandrich COTS UE +01 60 00 Band 7 FDD 5MHz UL Throughput for 300 sec for 1TX/1RX +01 60 01 Band 7 FDD 10MHz UL Throughput for 300 sec for 1TX/1RX +01 60 02 Band 7 FDD 20MHz UL Throughput for 300 sec for 1TX/1RX +01 60 03 Band 7 FDD 5MHz DL Throughput for 300 sec for 1TX/1RX +01 60 04 Band 7 FDD 10MHz DL Throughput for 300 sec for 1TX/1RX +01 60 05 Band 7 FDD 20MHz DL Throughput for 300 sec for 1TX/1RX 01 61 lte-softmodem tests with EXMIMO RF as eNB and ALU EPC w/ Bandrich COTS UE for `TX/1RX, 2TX/2RX -01 61 00 Band 7 FDD 5MHz UL Throughput for 60 sec for 1TX/1RX -01 61 01 Band 7 FDD 10MHz UL Throughput for 60 sec for 1TX/1RX -01 61 02 Band 7 FDD 20MHz UL Throughput for 60 sec for 1TX/1RX -01 61 03 Band 7 FDD 5MHz DL Throughput for 60 sec for 1TX/1RX -01 61 04 Band 7 FDD 10MHz DL Throughput for 60 sec for 1TX/1RX -01 61 05 Band 7 FDD 20MHz DL Throughput for 60 sec for 1TX/1RX +01 61 00 Band 7 FDD 5MHz UL Throughput for 300 sec for 1TX/1RX +01 61 01 Band 7 FDD 10MHz UL Throughput for 300 sec for 1TX/1RX +01 61 02 Band 7 FDD 20MHz UL Throughput for 300 sec for 1TX/1RX +01 61 03 Band 7 FDD 5MHz DL Throughput for 300 sec for 1TX/1RX +01 61 04 Band 7 FDD 10MHz DL Throughput for 300 sec for 1TX/1RX +01 61 05 Band 7 FDD 20MHz DL Throughput for 300 sec for 1TX/1RX 01 62 lte-softmodem tests with EXMIMO RF as eNB and OAI EPC (eNB and EPC are on same machines) w/ Bandrich COTS UE + 01 63 lte-softmodem tests with EXMIMO RF as eNB and OAI EPC (eNB and EPC are on different machines) w/ Bandrich COTS UE +01 63 00 Band 7 FDD 5MHz UL Throughput for 300 sec for 1TX/1RX +01 63 01 Band 7 FDD 10MHz UL Throughput for 300 sec for 1TX/1RX +01 63 02 Band 7 FDD 20MHz UL Throughput for 300 sec for 1TX/1RX +01 63 03 Band 7 FDD 5MHz DL Throughput for 300 sec for 1TX/1RX +01 63 04 Band 7 FDD 10MHz DL Throughput for 300 sec for 1TX/1RX +01 63 05 Band 7 FDD 20MHz DL Throughput for 300 sec for 1TX/1RX + +01 65 00 lte-softmodem tests with BladeRF RF as eNB and ALU EPC w/ Bandrich COTS UE for TX/1RX +01 65 00 Band 7 FDD 5MHz UL Throughput for 300 sec for 1TX/1RX +01 65 01 Band 7 FDD 10MHz UL Throughput for 300 sec for 1TX/1RX +01 65 02 Band 7 FDD 20MHz UL Throughput for 300 sec for 1TX/1RX +01 65 03 Band 7 FDD 5MHz DL Throughput for 300 sec for 1TX/1RX +01 65 04 Band 7 FDD 10MHz DL Throughput for 300 sec for 1TX/1RX +01 65 05 Band 7 FDD 20MHz DL Throughput for 300 sec for 1TX/1RX + + +01 70 00 lte-softmodem tests with SoDeRa RF as eNB and ALU EPC w/ Bandrich COTS UE for TX/1RX +01 70 00 Band 7 FDD 5MHz UL Throughput for 300 sec for 1TX/1RX +01 70 01 Band 7 FDD 10MHz UL Throughput for 300 sec for 1TX/1RX +01 70 02 Band 7 FDD 20MHz UL Throughput for 300 sec for 1TX/1RX +01 70 03 Band 7 FDD 5MHz DL Throughput for 300 sec for 1TX/1RX +01 70 04 Band 7 FDD 10MHz DL Throughput for 300 sec for 1TX/1RX +01 70 05 Band 7 FDD 20MHz DL Throughput for 300 sec for 1TX/1RX + + +01 75 00 lte-softmodem + RRH tests with B210 RF as eNB and ALU EPC w/ Bandrich COTS UE for TX/1RX +01 75 00 Band 7 FDD 5MHz UL Throughput for 300 sec for 1TX/1RX +01 75 01 Band 7 FDD 10MHz UL Throughput for 300 sec for 1TX/1RX +01 75 02 Band 7 FDD 20MHz UL Throughput for 300 sec for 1TX/1RX +01 75 03 Band 7 FDD 5MHz DL Throughput for 300 sec for 1TX/1RX +01 75 04 Band 7 FDD 10MHz DL Throughput for 300 sec for 1TX/1RX +01 75 05 Band 7 FDD 20MHz DL Throughput for 300 sec for 1TX/1RX + 01 64 lte-softmodem-noS1 tests diff --git a/cmake_targets/autotests/core.py b/cmake_targets/autotests/core.py index 8881781144ddf2acd61bac0fd5942c53a33b4093..5b1f39a85b74e0953101446c9971fb079d72ecbe 100644 --- a/cmake_targets/autotests/core.py +++ b/cmake_targets/autotests/core.py @@ -118,8 +118,7 @@ class core: rsp1 = self.prompt1 rsp2 = self.prompt2 if sudo == True: - command = 'echo \'' + self.password + '\' | sudo -S -E ' + command - + command = 'echo \'' + '' + '\' | sudo -S -E bash -c \' ' + command + '\' ' self.wait_quiet() if self.send_cr: log.stats['cmd'] += 1 @@ -140,7 +139,7 @@ class core: rsp2 = self.prompt2 self.wait_quiet() if sudo == True: - command = 'echo \'' + self.password + '\' | sudo -S -E ' + command + command = 'echo \'' + '' + '\' | sudo -S -E bash -c \' ' + command + '\' ' if self.send_cr: log.stats['cmd'] += 1 self.oai.sendline(command) @@ -193,6 +192,7 @@ class core: if index == 0 or index == 1 : return self.oai.before else: + print "command = " + command + "rsp1 = " + rsp1 + " rsp2 = " + rsp2 + " index = " + str(index) raise log.err(self.failed(command, rsp1 + ' or ' + rsp2,debug)) @@ -240,8 +240,9 @@ class core: # print rsp if (rsp.find(expect) == -1): return 'OK' - - raise log.err(self.failed(command, expect,debug)) + else: + print "command = " + command + "expect = " + expect + "rsp = " + rsp + raise log.err(self.failed(command, expect,debug)) # **************************send_wait************************* diff --git a/cmake_targets/autotests/openair.py b/cmake_targets/autotests/openair.py index e8d07ba1e1f1c36ce623a515da32366a2afc766b..1079c466a822b5cfdfe4d76bfad383175972d5a3 100644 --- a/cmake_targets/autotests/openair.py +++ b/cmake_targets/autotests/openair.py @@ -83,10 +83,13 @@ class openair(core): return (stdout, stderr) def connect(self, username, password, prompt='PEXPECT_OAI'): - while True: + max_retries=100 + i=0 + while i <= max_retries: self.prompt1 = prompt self.prompt2 = prompt self.password = '' + i=i+1 # WE do not store the password when sending commands for secuirity reasons. The password might be accidentally logged in such cases. #The password is used only to make ssh connections. In case user wants to run programs with sudo, then he/she needs to add following line in /etc/sudoers # your_user_name ALL=(ALL:ALL) NOPASSWD: ALL @@ -109,11 +112,14 @@ class openair(core): except Exception, e: error='' error = error + ' In function: ' + sys._getframe().f_code.co_name + ': *** Caught exception: ' + str(e.__class__) + " : " + str( e) + error = error + 'address = "'+ self.address +' username = ' + username error = error + traceback.format_exc() print error - print "Retrying again in 60 seconds" - time.sleep(60) - #sys.exit(1) + print "Retrying again in 1 seconds" + time.sleep(1) + if i==max_retries: + print "Fatal Error: Terminating the program now..." + sys.exit(1) def connect2(self, username, password, prompt='$'): self.prompt1 = prompt diff --git a/cmake_targets/autotests/run_exec_autotests.bash b/cmake_targets/autotests/run_exec_autotests.bash index 836a8c197afea8a0fbb9ae763506f29ac7f4fa76..a622b07efb050abc0ac2eb0af3237539dfff0a1b 100755 --- a/cmake_targets/autotests/run_exec_autotests.bash +++ b/cmake_targets/autotests/run_exec_autotests.bash @@ -175,6 +175,7 @@ function test_compile() { #\param $13 -> output of compilation program that needs to be found for test case to pass #\param $14 -> tags to help identify the test case for readability in output xml file #\param $15 => password for the user to run certain commands as sudo +#\param $16 => test config file params to be modified function test_compile_and_run() { xUnit_start @@ -195,12 +196,14 @@ function test_compile_and_run() { compile_prog_out=${13} tags=${14} mypassword=${15} + test_config_file=${16} + build_dir=$tdir/$1/build #exec_file=$build_dir/$6 xmlfile_testcase=$log_dir/test.$1.xml #Temporary log file where execution log is stored. temp_exec_log=$log_dir/temp_log.txt - + export OPENAIR_LOGDIR=$log_dir rm -fr $log_dir mkdir -p $log_dir @@ -219,6 +222,10 @@ function test_compile_and_run() { #compile_prog_array=() #read -a compile_prog_array <<<"$compile_prog" + + #test_config_file=`eval "echo \"$test_config_file\" "` + + #echo "test_config_file = $test_config_file" tags_array=() read -a tags_array <<<"$tags" @@ -238,17 +245,21 @@ function test_compile_and_run() { cd $log_dir { uname -a - #eval $pre_compile_prog - #cmake .. - #rm -fv $exec_file - echo "Executing $compile_prog $compile_args" >> $log_file + echo "Executing $pre_compile_prog" + eval $pre_compile_prog + + if [ "$test_config_file" != "" ]; then + echo "Modifying test_config_file parameters..." + echo "$test_config_file" |xargs -L 1 $OPENAIR_DIR/cmake_targets/autotests/tools/search_repl.py + fi + echo "Executing $compile_prog $compile_args" eval "$compile_prog $compile_args" echo "Copying compilation log files to test case log directory: $log_dir" cp -fvr $OPENAIR_DIR/cmake_targets/log/ $log_dir/compile_log }>> $log_file 2>&1 echo "</COMPILATION LOG>" >> $log_file 2>&1 #done - + #process the test case if it is that of execution if [ "$class" == "execution" ]; then tags_array_index=0 @@ -437,7 +448,8 @@ for search_expr in "${test_case_array[@]}" else flag_run_test_case=1 fi - + + #We skip this test case if it is not in the group list if [ "$flag_run_test_case" -ne "1" ]; then continue @@ -458,6 +470,7 @@ for search_expr in "${test_case_array[@]}" nruns=`xmlstarlet sel -t -v "/testCaseList/testCase[@id='$search_expr']/nruns" $xml_conf` compile_prog_out=`xmlstarlet sel -t -v "/testCaseList/testCase[@id='$search_expr']/compile_prog_out" $xml_conf` tags=`xmlstarlet sel -t -v "/testCaseList/testCase[@id='$search_expr']/tags" $xml_conf` + test_config_file=`xmlstarlet sel -t -v "/testCaseList/testCase[@id='$search_expr']/test_config_file" $xml_conf` echo "class = $class" echo "name = $name" @@ -497,7 +510,7 @@ for search_expr in "${test_case_array[@]}" test_compile "$name" "$compile_prog" "$compile_prog_args" "$pre_exec" "$pre_exec_args" "$main_exec" "$main_exec_args" "search_array_true[@]" "$search_expr_false" "$nruns" "$pre_compile_prog" "$class" "$compile_prog_out" "$tags" elif [ "$class" == "execution" ]; then $SUDO killall -q oaisim_nos1 - test_compile_and_run "$name" "$compile_prog" "$compile_prog_args" "$pre_exec" "$pre_exec_args" "$main_exec" "$main_exec_args" "search_array_true[@]" "$search_expr_false" "$nruns" "$pre_compile_prog" "$class" "$compile_prog_out" "$tags" "$mypassword" + test_compile_and_run "$name" "$compile_prog" "$compile_prog_args" "$pre_exec" "$pre_exec_args" "$main_exec" "$main_exec_args" "search_array_true[@]" "$search_expr_false" "$nruns" "$pre_compile_prog" "$class" "$compile_prog_out" "$tags" "$mypassword" "$test_config_file" else echo "Unexpected class of test case...Skipping the test case $name ...." fi diff --git a/cmake_targets/autotests/run_exec_lte-softmodem_tests.py b/cmake_targets/autotests/run_exec_lte-softmodem_tests.py old mode 100644 new mode 100755 index b76b5f9698fbb9c14f4fa0b7cf358b4573579dbe..341879895469c4bfb75178994593c3536020a8fe --- a/cmake_targets/autotests/run_exec_lte-softmodem_tests.py +++ b/cmake_targets/autotests/run_exec_lte-softmodem_tests.py @@ -60,21 +60,29 @@ import paramiko import subprocess import commands sys.path.append('/opt/ssh') +sys.path.append(os.path.expandvars('$OPENAIR_DIR/cmake_targets/autotests/tools/')) +from lib_autotest import * import ssh from ssh import SSHSession +import argparse +# \brief write a string to a file +# \param filename name of file +# \param string string to write +# \mode file opening mode (default=write) def write_file(filename, string, mode="w"): text_file = open(filename, mode) text_file.write(string) text_file.close() - -#$1 name of file (assuming created with iperf -s -u .... -#$2 minimum throughput -#$3 maximum throughput -#$4 average throughput -#$5 minimum duration of throughput -#The throughput values found in file must be higher than values from from 2,3,4,5 + +# \brief function to check if test case passed throughput test +# \param filename name of file which has throughput results (usually from iperf -s ... +# \param min_tput minimum throughput +# \param max_tuput maximum throughput +# \param average average throughput +# \param min_duration minimum duration of throughput +#The throughput values found in file must be higher than values from from arguments 2,3,4,5 #The function returns True if throughput conditions are saisfied else it returns fails def tput_test(filename, min_tput, max_tput, average, min_duration): @@ -101,13 +109,16 @@ def tput_test(filename, min_tput, max_tput, average, min_duration): else: return False , tput_string - +# \brief Convert string to float or return None if there is exception def try_convert_to_float(string, fail=None): try: return float(string) except Exception: return fail; +# \brief get throughput statistics from log file +# \param search_expr search expression found in test_case_list.xml file +# \param logfile_traffic logfile which has traffic statistics def tput_test_search_expr (search_expr, logfile_traffic): result=0 tput_string='' @@ -153,7 +164,13 @@ def tput_test_search_expr (search_expr, logfile_traffic): return result, tput_string - +# \brief function to copy files to/from remote machine +# \param username user with which to make sftp connection +# \param password password of user +# \param hostname host to connect +# \ports port of remote machine on which server is listening +# \paramList This is list of operations as a set {operation: "get/put", localfile: "filename", remotefile: "filename" +# \param logfile Ignored currently and set once at the beginning of program def sftp_module (username, password, hostname, ports, paramList,logfile): #localD = localfile #remoteD = remotefile @@ -162,14 +179,9 @@ def sftp_module (username, password, hostname, ports, paramList,logfile): #paramiko logfile path should not be changed with multiple calls. The logs seem to in first file regardless error = "" #The lines below are outside exception loop to be sure to terminate the test case if the network connectivity goes down or there is authentication failure - - - transport = paramiko.Transport(hostname, ports) transport.connect(username = username, password = password) sftp = paramiko.SFTPClient.from_transport(transport) - - # index =0 for param in paramList: try: @@ -201,6 +213,9 @@ def sftp_module (username, password, hostname, ports, paramList,logfile): write_file(logfile, error, "a") res = os.system('\n echo \'SFTP Module Log for Machine: <' + hostname + '> ends...\' >> ' + logfile + ' 2>&1 \n') +# \brief bash script stub put at the end of scripts to terminate it +# \param timeout_cmd terminate script after timeout_cmd seconds +# \param terminate_missing_procs if True terminate all the processes launched by script if one of them terminates prematurely (due to error) def finalize_deploy_script (timeout_cmd, terminate_missing_procs='True'): cmd = 'declare -i timeout_cmd='+str(timeout_cmd) + '\n' if terminate_missing_procs == 'True': @@ -239,40 +254,67 @@ def finalize_deploy_script (timeout_cmd, terminate_missing_procs='True'): return cmd +# \brief run python script and update config file params of test case +# \param oai module with already open connection +# \param config_string config string taken from xml file +# \param logdirRepo directory of remote repository +# \param python_script python script location def update_config_file(oai, config_string, logdirRepo, python_script): + cmd="" if config_string : stringArray = config_string.splitlines() - cmd="" #python_script = '$OPENAIR_DIR/targets/autotests/tools/search_repl.py' for string in stringArray: #split the string based on space now string1=string.split() cmd = cmd + 'python ' + python_script + ' ' + logdirRepo+'/'+string1[0] + ' ' + string1[1] + ' '+ string1[2] + '\n' #cmd = cmd + 'perl -p -i -e \'s/'+ string1[1] + '\\s*=\\s*"\\S*"\\s*/' + string1[1] + ' = "' + string1[2] +'"' + '/g\' ' + logdirRepo + '/' +string1[0] + '\n' - return cmd - #result = oai.send_recv(cmd) + return cmd + #result = oai.send_recv(cmd) -def SSHSessionWrapper(machine, username, key_file, password, logdir_remote_testcase, logdir_local_base): - while True: +# \brief thread safe sshsession wrapper due to occasional connection issues with ssh +# \param machine name of machine +# \param username user login for remote machine +# \param key_file file name which has keys to enable passwordless login +# \param password password for remote machine +# \param logdir_remote remote directory +# \param logdir_local_base local directory +# \param operation operation to perform (get_all, put_all) transfers recursively for directories +def SSHSessionWrapper(machine, username, key_file, password, logdir_remote, logdir_local_base, operation): + max_tries = 100 + i=0 + while i <= max_tries: + i = i +1 try: ssh = SSHSession(machine , username, key_file, password) - ssh.get_all(logdir_remote_testcase , logdir_local_base) + if operation == "get_all": + ssh.get_all(logdir_remote , logdir_local_base) + elif operation == "put_all": + ssh.put_all(logdir_local_base, logdir_remote ) + else: + print "Error: Uknown operation in SSHSessionWrapper. Exiting now..." + sys.exit(1) break except Exception, e: error='' error = error + ' In Class = function: ' + sys._getframe().f_code.co_name + ': *** Caught exception: ' + str(e.__class__) + " : " + str( e) - error = error + '\n username = ' + username + '\n machine = ' + machine + '\n logdir_remote = ' + logdir_remote_testcase + '\n logdir_local_base = ' + logdir_local_base + error = error + '\n username = ' + username + '\n machine = ' + machine + '\n logdir_remote = ' + logdir_remote + '\n logdir_local_base = ' + logdir_local_base error = error + traceback.format_exc() print error - print " Trying again in 60 seconds" - time.sleep(60) + print " Retrying again in 1 seconds" + time.sleep(1) print "Continuing ..." + if i ==max_tries: + print "Fatal Error: Max no of retries reached. Exiting now..." + sys.exit(1) -#Function to clean old programs that might be running from earlier execution -#oai - parameter for making connection to machine -#programList - list of programs that must be terminated before execution of any test case +# \briefFunction to clean old programs that might be running from earlier execution +# \param oai - parameter for making connection to machine +# \parm programList list of programs that must be terminated before execution of any test case +# \param CleanUpAluLteBox program to terminate AlU Bell Labs LTE Box +# \param ExmimoRfStop String to stop EXMIMO card (specified in test_case_list.xml) def cleanOldPrograms(oai, programList, CleanUpAluLteBox, ExmimoRfStop): cmd = 'killall -q -r ' + programList result = oai.send(cmd, True) @@ -283,20 +325,19 @@ def cleanOldPrograms(oai, programList, CleanUpAluLteBox, ExmimoRfStop): #result = oai.send_recv(cmd) #print result result = oai.send_expect_false(cmd, 'Match found', False) - print result + print "Looking for old programs..." + result res=oai.send_recv(CleanUpAluLteBox, True) - res = oai.send_recv(ExmimoRfStop, True) - -class myThread (threading.Thread): - def __init__(self, threadID, name, counter): - threading.Thread.__init__(self) - self.threadID = threadID - self.name = name - self.counter = counter - def run(self): - print "Starting " + self.name - - + res = oai.send_recv(ExmimoRfStop, False) + +# \brief Class thread to launch a generic command on remote machine +# \param threadID number of thread (for book keeping) +# \param threadname string of threadname (for book keeping) +# \param machine machine name on which to run the command +# \param username username with which to login +# \param password password with which to login +# \param cmd command as a string to run on remote machine +# \parma sudo if True sudo is set +# \param timeout timeout of command in seconds class oaiThread (threading.Thread): def __init__(self, threadID, threadname, machine, username, password, cmd, sudo, timeout): threading.Thread.__init__(self) @@ -311,7 +352,7 @@ class oaiThread (threading.Thread): def run(self): try: oai = openair('localdomain',self.machine) - oai.connect(user, self.password) + oai.connect(self.username, self.password) print "Starting " + self.threadname + " on machine " + self.machine result = oai.send_recv(self.cmd, self.sudo, self.timeout) print "result = " + result @@ -320,14 +361,24 @@ class oaiThread (threading.Thread): except Exception, e: error='' error = error + ' In class oaiThread, function: ' + sys._getframe().f_code.co_name + ': *** Caught exception: ' + str(e.__class__) + " : " + str( e) - error = error + '\n threadID = ' + str(self.threadID) + '\n threadname = ' + self.threadname + '\n timeout = ' + self.timeout + '\n machine = ' + self.machine + '\n cmd = ' + self.cmd + '\n timeout = ' + str(self.timeout) + '\n' + error = error + '\n threadID = ' + str(self.threadID) + '\n threadname = ' + self.threadname + '\n timeout = ' + str(self.timeout) + '\n machine = ' + self.machine + '\n cmd = ' + self.cmd + '\n timeout = ' + str(self.timeout) + '\n username = ' + self.username + '\n' error = error + traceback.format_exc() print error -#This class runs test cases with class execution, compilatation +# \brief This class runs test cases with class {execution, compilatation} +# \param threadID number of thread (for book keeping) +# \param name string of threadname (for book keeping) +# \param machine machine name on which to run the command +# \param logdirOAI5GRepo directory on remote machine which as openairinterface5g repo installed +# \param testcasename name of test case to run on remote machine +# \param CleanupAluLteBox string that contains commands to stop ALU Bell Labs LTEBox (specified in test_case_list.xml) +# \param user username with which to login +# \param password password with which to login +# \param timeout timeout of command in seconds +# \param ExmimoRfStop command to stop EXMIMO Card class testCaseThread_generic (threading.Thread): - def __init__(self, threadID, name, machine, logdirOAI5GRepo, testcasename,oldprogramList, CleanupAluLteBox, password, timeout, ExmimoRfStop): + def __init__(self, threadID, name, machine, logdirOAI5GRepo, testcasename,oldprogramList, CleanupAluLteBox, user, password, timeout, ExmimoRfStop): threading.Thread.__init__(self) self.threadID = threadID self.name = name @@ -339,16 +390,17 @@ class testCaseThread_generic (threading.Thread): self.CleanupAluLteBox = CleanupAluLteBox self.password=password self.ExmimoRfStop = ExmimoRfStop + self.user = user def run(self): try: mypassword='' #addsudo = 'echo \'' + mypassword + '\' | sudo -S -E ' addpass = 'echo \'' + mypassword + '\' | ' - user = getpass.getuser() + #user = getpass.getuser() print "Starting test case : " + self.testcasename + " On machine " + self.machine + " timeout = " + str(self.timeout) oai = openair('localdomain',self.machine) - oai.connect(user, self.password) - cleanOldPrograms(oai, self.oldprogramList, self.CleanupAluLteBox, self.ExmimoRfStop) + oai.connect(self.user, self.password) + #cleanOldPrograms(oai, self.oldprogramList, self.CleanupAluLteBox, self.ExmimoRfStop) logdir_local = os.environ.get('OPENAIR_DIR') logdir_local_testcase = logdir_local +'/cmake_targets/autotests/log/'+ self.testcasename logdir_local_base = logdir_local +'/cmake_targets/autotests/log/' @@ -380,15 +432,15 @@ class testCaseThread_generic (threading.Thread): #Now we copy all the remote files #ssh = SSHSession(self.machine , username=user, key_file=None, password=self.password) #ssh.get_all(logdir_remote_testcase , logdir_local_base) - SSHSessionWrapper(self.machine, user, None, self.password, logdir_remote_testcase, logdir_local_base) + SSHSessionWrapper(self.machine, self.user, None, self.password, logdir_remote_testcase, logdir_local_base, "get_all") print "Finishing test case : " + self.testcasename + " On machine " + self.machine - cleanOldPrograms(oai, self.oldprogramList, self.CleanupAluLteBox, self.ExmimoRfStop) + #cleanOldPrograms(oai, self.oldprogramList, self.CleanupAluLteBox, self.ExmimoRfStop) #oai.kill(user,mypassword) oai.disconnect() except Exception, e: error='' error = error + ' In Class = testCaseThread_generic, function: ' + sys._getframe().f_code.co_name + ': *** Caught exception: ' + str(e.__class__) + " : " + str( e) - error = error + '\n threadID = ' + str(self.threadID) + '\n threadName = ' + self.name + '\n testcasename = ' + self.testcasename + '\n machine = ' + self.machine + '\n logdirOAI5GRepo = ' + self.logdirOAI5GRepo + '\n' + '\n timeout = ' + str(self.timeout) + error = error + '\n threadID = ' + str(self.threadID) + '\n threadName = ' + self.name + '\n testcasename = ' + self.testcasename + '\n machine = ' + self.machine + '\n logdirOAI5GRepo = ' + self.logdirOAI5GRepo + '\n' + '\n timeout = ' + str(self.timeout) + '\n user = ' + self.user error = error + traceback.format_exc() print error print "Continuing with next test case..." @@ -396,12 +448,25 @@ class testCaseThread_generic (threading.Thread): - +# \bried function to run a command as a sudo +# \param cmd command as a string +# \param password password to be supplied def addsudo (cmd, password=""): cmd = 'echo \'' + password + '\' | sudo -S -E bash -c \' ' + cmd + '\' ' return cmd -def handle_testcaseclass_generic (testcasename, threadListGeneric, oldprogramList, logdirOAI5GRepo, MachineList, password, CleanupAluLteBox,timeout, ExmimoRfStop): +# \brief handler for executing test cases (compilation, execution) +# \param name of testcase +# \param threadListGeneric list of threads which are already running on remote machines +# \param oldprogramList list of programs which must be terminated before running a test case +# \param logdirOAI5GRepo directory on remote machine which as openairinterface5g repo installed +# \param MachineList list of all machines on which generic test cases can be run +# \param user username with which to login +# \param password password with which to login +# \param CleanupAluLteBox string that contains commands to stop ALU Bell Labs LTEBox (specified in test_case_list.xml) +# \param timeout timeout of command in seconds +# \param ExmimoRfStop command to stop EXMIMO Card +def handle_testcaseclass_generic (testcasename, threadListGeneric, oldprogramList, logdirOAI5GRepo, MachineList, user, password, CleanupAluLteBox,timeout, ExmimoRfStop): try: mypassword=password MachineListFree=[] @@ -439,7 +504,7 @@ def handle_testcaseclass_generic (testcasename, threadListGeneric, oldprogramLis print "MachineListBusy = " + ','.join(MachineListBusy) print "MachineList = " + ','.join(MachineList) machine = MachineListFree[0] - thread = testCaseThread_generic(1,"Generic Thread_"+testcasename+"_"+ "machine_", machine, logdirOAI5GRepo, testcasename, oldprogramList, CleanupAluLteBox, password, timeout, ExmimoRfStop) + thread = testCaseThread_generic(1,"Generic Thread_"+testcasename+"_"+ "machine_", machine, logdirOAI5GRepo, testcasename, oldprogramList, CleanupAluLteBox, user, password, timeout, ExmimoRfStop) param={"thread_id":thread, "Machine":machine, "testcasename":testcasename} thread.start() threadListNew.append(param) @@ -447,13 +512,15 @@ def handle_testcaseclass_generic (testcasename, threadListGeneric, oldprogramLis except Exception, e: error='' error = error + ' In function: ' + sys._getframe().f_code.co_name + ': *** Caught exception: ' + str(e.__class__) + " : " + str( e) - error = error + '\n testcasename = ' + testcasename + '\n logdirOAI5GRepo = ' + logdirOAI5GRepo + '\n MachineList = ' + ','.join(MachineList) + '\n timeout = ' + str(timeout) + '\n' + error = error + '\n testcasename = ' + testcasename + '\n logdirOAI5GRepo = ' + logdirOAI5GRepo + '\n MachineList = ' + ','.join(MachineList) + '\n timeout = ' + str(timeout) + '\n' + 'user = ' + user error = error + traceback.format_exc() print error print "Continuing..." #sys.exit(1) -#Blocking wait for all threads related to generic testcase execution, class (compilation and execution) +# \brief Blocking wait for all threads related to generic testcase execution, class (compilation and execution) +# \param threadListGeneric list of threads which are running on remote machines +# \param timeout time to wait on threads in seconds def wait_testcaseclass_generic_threads(threadListGeneric, timeout = 1): threadListGenericNew=[] for param in threadListGeneric: @@ -471,24 +538,50 @@ def wait_testcaseclass_generic_threads(threadListGeneric, timeout = 1): #threadListGeneric.remove(param) return threadListGenericNew -#Function to handle test case class : lte-softmodem -def handle_testcaseclass_softmodem (testcase, oldprogramList, logdirOAI5GRepo , logdirOpenaircnRepo, MachineList, password, CleanUpAluLteBox, ExmimoRfStop): + +# \brief handler for executing test cases (lte-softmodem) +# \param testcase name of testcase +# \param oldprogramList list of programs which must be terminated before running a test case +# \param logdirOAI5GRepo directory on remote machine which has openairinterface5g repo installed +# \param logdirOpenaircnRepo directory on remote machine which has openair-cn repo installed +# \param MachineList list of all machines on which test cases can be run +# \param user username with which to login +# \param password password with which to login +# \param CleanupAluLteBox string that contains commands to stop ALU Bell Labs LTEBox (specified in test_case_list.xml) +# \param ExmimoRfStop command to stop EXMIMO Card +# \param nruns_lte-softmodem global parameter to override number of runs (nruns) within the test case +def handle_testcaseclass_softmodem (testcase, oldprogramList, logdirOAI5GRepo , logdirOpenaircnRepo, MachineList, user, password, CleanUpAluLteBox, ExmimoRfStop, nruns_lte_softmodem, timeout_cmd): #We ignore the password sent to this function for secuirity reasons for password present in log files #It is recommended to add a line in /etc/sudoers that looks something like below. The line below will run sudo without password prompt # your_user_name ALL=(ALL:ALL) NOPASSWD: ALL mypassword='' #addsudo = 'echo \'' + mypassword + '\' | sudo -S -E ' addpass = 'echo \'' + mypassword + '\' | ' - user = getpass.getuser() + #user = getpass.getuser() testcasename = testcase.get('id') testcaseclass = testcase.findtext('class',default='') - timeout_cmd = testcase.findtext('TimeOut_cmd',default='') + if timeout_cmd == '': + timeout_cmd = testcase.findtext('TimeOut_cmd',default='') timeout_cmd = int(float(timeout_cmd)) #Timeout_thread is more than that of cmd to have room for compilation time, etc timeout_thread = timeout_cmd + 300 - nruns = testcase.findtext('nruns',default='') + if nruns_lte_softmodem == '': + nruns = testcase.findtext('nruns',default='') + else: + nruns = nruns_lte_softmodem nruns = int(float(nruns)) tags = testcase.findtext('tags',default='') + + RRHMachine = testcase.findtext('RRH',default='') + RRH_compile_prog = testcase.findtext('RRH_compile_prog',default='') + RRH_compile_prog_args = testcase.findtext('RRH_compile_prog_args',default='') + RRH_pre_exec = testcase.findtext('RRH_pre_exec',default='') + RRH_pre_exec_args = testcase.findtext('RRH_pre_exec_args',default='') + RRH_main_exec = testcase.findtext('RRH_main_exec',default='') + RRH_main_exec_args = testcase.findtext('RRH_main_exec_args',default='') + RRH_terminate_missing_procs = testcase.findtext('RRH_terminate_missing_procs',default='True') + + eNBMachine = testcase.findtext('eNB',default='') eNB_config_file = testcase.findtext('eNB_config_file',default='') eNB_compile_prog = testcase.findtext('eNB_compile_prog',default='') @@ -501,6 +594,8 @@ def handle_testcaseclass_softmodem (testcase, oldprogramList, logdirOAI5GRepo , eNB_traffic_exec_args = testcase.findtext('eNB_traffic_exec_args',default='') eNB_terminate_missing_procs = testcase.findtext('eNB_terminate_missing_procs',default='True') eNB_search_expr_true = testcase.findtext('eNB_search_expr_true','') + if re.compile('\w+').match(eNB_search_expr_true) != None: + eNB_search_expr_true = eNB_search_expr_true + ' duration=' + str(timeout_cmd-90) + 's' UEMachine = testcase.findtext('UE',default='') UE_config_file = testcase.findtext('UE_config_file',default='') @@ -515,6 +610,8 @@ def handle_testcaseclass_softmodem (testcase, oldprogramList, logdirOAI5GRepo , UE_terminate_missing_procs = testcase.findtext('UE_terminate_missing_procs',default='True') UE_search_expr_true = testcase.findtext('UE_search_expr_true','') UE_stop_script = testcase.findtext('UE_stop_script','') + if re.compile('\w+').match(UE_search_expr_true) != None: + UE_search_expr_true = UE_search_expr_true + ' duration=' + str(timeout_cmd-90) + 's' EPCMachine = testcase.findtext('EPC',default='') EPC_config_file = testcase.findtext('EPC_config_file',default='') @@ -533,6 +630,8 @@ def handle_testcaseclass_softmodem (testcase, oldprogramList, logdirOAI5GRepo , EPC_traffic_exec_args = testcase.findtext('EPC_traffic_exec_args',default='') EPC_terminate_missing_procs = testcase.findtext('EPC_terminate_missing_procs',default='True') EPC_search_expr_true = testcase.findtext('EPC_search_expr_true','') + if re.compile('\w+').match(EPC_search_expr_true) != None: + EPC_search_expr_true = EPC_search_expr_true + ' duration=' + str(timeout_cmd-90) + 's' index_eNBMachine = MachineList.index(eNBMachine) index_UEMachine = MachineList.index(UEMachine) @@ -547,13 +646,15 @@ def handle_testcaseclass_softmodem (testcase, oldprogramList, logdirOAI5GRepo , oai_EPC = openair('localdomain', EPCMachine) oai_EPC.connect(user, password) res = oai_eNB.send_recv(cmd) - - cleanOldPrograms(oai_eNB, oldprogramList, CleanUpAluLteBox, ExmimoRfStop) - cleanOldPrograms(oai_UE, oldprogramList, CleanUpAluLteBox, ExmimoRfStop) - cleanOldPrograms(oai_EPC, oldprogramList, CleanUpAluLteBox, ExmimoRfStop) - logdir_eNB = logdirOAI5GRepo+'/cmake_targets/autotests/log/'+ testcasename - logdir_UE = logdirOAI5GRepo+'/cmake_targets/autotests/log/'+ testcasename - logdir_EPC = logdirOpenaircnRepo+'/TEST/autotests/log/'+ testcasename + if RRHMachine != '': + cmd = 'cd ' + logdirOAI5GRepo + '; source oaienv ; env|grep OPENAIR' + index_RRHMachine = MachineList.index(RRHMachine) + oai_RRH = openair('localdomain', RRHMachine) + oai_RRH.connect(user, password) + res= oai_RRH.send_recv(cmd) + #cleanOldPrograms(oai_eNB, oldprogramList, CleanUpAluLteBox, ExmimoRfStop) + #cleanOldPrograms(oai_UE, oldprogramList, CleanUpAluLteBox, ExmimoRfStop) + #cleanOldPrograms(oai_EPC, oldprogramList, CleanUpAluLteBox, ExmimoRfStop) logdir_local = os.environ.get('OPENAIR_DIR') if logdir_local is None: print "Environment variable OPENAIR_DIR not set correctly" @@ -579,10 +680,14 @@ def handle_testcaseclass_softmodem (testcase, oldprogramList, logdirOAI5GRepo , run_result=1 run_result_string='' logdir_eNB = logdirOAI5GRepo+'/cmake_targets/autotests/log/'+ testcasename + '/run_' + str(run) + logdir_RRH = logdirOAI5GRepo+'/cmake_targets/autotests/log/'+ testcasename + '/run_' + str(run) logdir_UE = logdirOAI5GRepo+'/cmake_targets/autotests/log/'+ testcasename + '/run_' + str(run) logdir_EPC = logdirOpenaircnRepo+'/TEST/autotests/log/'+ testcasename + '/run_' + str(run) logdir_local_testcase = logdir_local + '/cmake_targets/autotests/log/'+ testcasename + '/run_' + str(run) #Make the log directory of test case + if RRHMachine != '': + cmd = 'rm -fr ' + logdir_RRH + ' ; mkdir -p ' + logdir_RRH + result = oai_RRH.send_recv(cmd) cmd = 'rm -fr ' + logdir_eNB + ' ; mkdir -p ' + logdir_eNB result = oai_eNB.send_recv(cmd) cmd = 'rm -fr ' + logdir_UE + ' ; mkdir -p ' + logdir_UE @@ -591,6 +696,39 @@ def handle_testcaseclass_softmodem (testcase, oldprogramList, logdirOAI5GRepo , result = oai_EPC.send_recv(cmd) cmd = ' rm -fr ' + logdir_local_testcase + ' ; mkdir -p ' + logdir_local_testcase result = os.system(cmd) + + if RRHMachine != '': + logfile_compile_RRH = logdir_RRH + '/RRH_compile' + '_' + str(run) + '_.log' + logfile_exec_RRH = logdir_RRH + '/RRH_exec' + '_' + str(run) + '_.log' + logfile_pre_exec_RRH = logdir_RRH + '/RRH_pre_exec' + '_' + str(run) + '_.log' + logfile_task_RRH_compile_out = logdir_RRH + '/RRH_task_compile_out' + '_' + str(run) + '_.log' + logfile_task_RRH_compile = logdir_local_testcase + '/RRH_task_compile' + '_' + str(run) + '_.log' + logfile_task_RRH_out = logdir_RRH + '/RRH_task_out' + '_' + str(run) + '_.log' + logfile_task_RRH = logdir_local_testcase + '/RRH_task' + '_' + str(run) + '_.log' + task_RRH_compile = ' ( uname -a ; date \n' + task_RRH_compile = task_RRH_compile + 'cd ' + logdirOAI5GRepo + ' ; source oaienv ; source cmake_targets/tools/build_helper \n' + task_RRH_compile = task_RRH_compile + 'env |grep OPENAIR \n' + if RRH_compile_prog != "": + task_RRH_compile = task_RRH_compile + ' ( ' + RRH_compile_prog + ' '+ RRH_compile_prog_args + ' ) > ' + logfile_compile_RRH + ' 2>&1 \n' + task_RRH_compile = task_RRH_compile + ' date ) > ' + logfile_task_RRH_compile_out + ' 2>&1 ' + write_file(logfile_task_RRH_compile, task_RRH_compile, mode="w") + + task_RRH = ' ( uname -a ; date \n' + task_RRH = task_RRH + ' export OPENAIR_TESTDIR=' + logdir_RRH + '\n' + task_RRH = task_RRH + 'cd ' + logdirOAI5GRepo + ' ; source oaienv ; source cmake_targets/tools/build_helper \n' + task_RRH = task_RRH + 'env |grep OPENAIR \n' + 'array_exec_pid=() \n' + + if RRH_pre_exec != "": + task_RRH = task_RRH + ' ( date; ' + RRH_pre_exec + ' '+ RRH_pre_exec_args + ' ) > ' + logfile_pre_exec_RRH + ' 2>&1 \n' + if RRH_main_exec != "": + task_RRH = task_RRH + ' ( date; ' + addsudo(RRH_main_exec + ' ' + RRH_main_exec_args, mypassword) + ' ) > ' + logfile_exec_RRH + ' 2>&1 & \n' + task_RRH = task_RRH + 'array_exec_pid+=($!) \n' + task_RRH = task_RRH + 'echo eNB_main_exec PID = $! \n' + #terminate the eNB test case after timeout_cmd seconds + task_RRH = task_RRH + finalize_deploy_script (timeout_cmd, RRH_terminate_missing_procs) + ' \n' + task_RRH = task_RRH + 'handle_ctrl_c' + '\n' + task_RRH = task_RRH + ' ) > ' + logfile_task_RRH_out + ' 2>&1 ' + write_file(logfile_task_RRH, task_RRH, mode="w") logfile_compile_eNB = logdir_eNB + '/eNB_compile' + '_' + str(run) + '_.log' logfile_exec_eNB = logdir_eNB + '/eNB_exec' + '_' + str(run) + '_.log' @@ -601,6 +739,10 @@ def handle_testcaseclass_softmodem (testcase, oldprogramList, logdirOAI5GRepo , logfile_task_eNB_out = logdir_eNB + '/eNB_task_out' + '_' + str(run) + '_.log' logfile_task_eNB = logdir_local_testcase + '/eNB_task' + '_' + str(run) + '_.log' logfile_local_traffic_eNB_out = logdir_local_testcase + '/eNB_traffic' + '_' + str(run) + '_.log' + logfile_tshark_eNB = logdir_eNB + '/eNB_tshark' + '_' + str(run) + '_.log' + logfile_pcap_eNB = logdir_eNB + '/eNB_tshark' + '_' + str(run) + '_.pcap' + logfile_pcap_zip_eNB = logdir_eNB + '/eNB_tshark' + '_' + str(run) + '_.pcap.zip' + logfile_pcap_tmp_eNB = '/tmp/' + '/eNB_tshark' + '_' + str(run) + '_.pcap' task_eNB_compile = ' ( uname -a ; date \n' task_eNB_compile = task_eNB_compile + 'cd ' + logdirOAI5GRepo + ' ; source oaienv ; source cmake_targets/tools/build_helper \n' @@ -612,19 +754,27 @@ def handle_testcaseclass_softmodem (testcase, oldprogramList, logdirOAI5GRepo , write_file(logfile_task_eNB_compile, task_eNB_compile, mode="w") task_eNB = ' ( uname -a ; date \n' + task_eNB = task_eNB + ' export OPENAIR_TESTDIR=' + logdir_eNB + '\n' task_eNB = task_eNB + 'cd ' + logdirOAI5GRepo + ' ; source oaienv ; source cmake_targets/tools/build_helper \n' task_eNB = task_eNB + 'env |grep OPENAIR \n' + 'array_exec_pid=() \n' if eNB_pre_exec != "": - task_eNB = task_eNB + ' ( ' + eNB_pre_exec + ' '+ eNB_pre_exec_args + ' ) > ' + logfile_pre_exec_eNB + ' 2>&1 \n' + task_eNB = task_eNB + ' ( date; ' + eNB_pre_exec + ' '+ eNB_pre_exec_args + ' ) > ' + logfile_pre_exec_eNB + ' 2>&1 \n' if eNB_main_exec != "": - task_eNB = task_eNB + ' ( ' + addsudo(eNB_main_exec + ' ' + eNB_main_exec_args, mypassword) + ' ) > ' + logfile_exec_eNB + ' 2>&1 & \n' + task_eNB = task_eNB + ' ( date; ' + addsudo(eNB_main_exec + ' ' + eNB_main_exec_args, mypassword) + ' ) > ' + logfile_exec_eNB + ' 2>&1 & \n' task_eNB = task_eNB + 'array_exec_pid+=($!) \n' task_eNB = task_eNB + 'echo eNB_main_exec PID = $! \n' if eNB_traffic_exec != "": - task_eNB = task_eNB + ' ( ' + eNB_traffic_exec + ' ' + eNB_traffic_exec_args + ' ) > ' + logfile_traffic_eNB + ' 2>&1 & \n ' + cmd_traffic = eNB_traffic_exec + ' ' + eNB_traffic_exec_args + if cmd_traffic.find('-c') >= 0: + cmd_traffic = cmd_traffic + ' -t ' + str(timeout_cmd - 60) + task_eNB = task_eNB + ' (date; ' + cmd_traffic + ' ) > ' + logfile_traffic_eNB + ' 2>&1 & \n' task_eNB = task_eNB + 'array_exec_pid+=($!) \n' task_eNB = task_eNB + 'echo eNB_traffic_exec PID = $! \n' + + task_eNB = task_eNB + ' (date; sudo rm -f ' + logfile_pcap_tmp_eNB + ' ; sudo -E tshark -i any -s 65535 -a duration:' + str(timeout_cmd-10)+ ' -w ' + logfile_pcap_tmp_eNB+ ' ; sudo -E chown ' + user + ' ' + logfile_pcap_tmp_eNB + ' ; zip -j -9 ' + logfile_pcap_zip_eNB + ' ' + logfile_pcap_tmp_eNB + ' ) > ' + logfile_tshark_eNB + ' 2>&1 & \n ' + task_eNB = task_eNB + 'array_exec_pid+=($!) \n' + task_eNB = task_eNB + 'echo eNB_tshark_exec PID = $! \n' #terminate the eNB test case after timeout_cmd seconds task_eNB = task_eNB + finalize_deploy_script (timeout_cmd, eNB_terminate_missing_procs) + ' \n' #task_eNB = task_eNB + 'sleep ' + str(timeout_cmd) + ' \n' @@ -662,13 +812,16 @@ def handle_testcaseclass_softmodem (testcase, oldprogramList, logdirOAI5GRepo , task_UE = task_UE + 'source cmake_targets/tools/build_helper \n' task_UE = task_UE + 'env |grep OPENAIR \n' if UE_pre_exec != "": - task_UE = task_UE + ' ( ' + UE_pre_exec + ' '+ UE_pre_exec_args + ' ) > ' + logfile_pre_exec_UE + ' 2>&1 \n' + task_UE = task_UE + ' ( date; ' + UE_pre_exec + ' '+ UE_pre_exec_args + ' ) > ' + logfile_pre_exec_UE + ' 2>&1 \n' if UE_main_exec != "": - task_UE = task_UE + ' ( ' + addsudo(UE_main_exec + ' ' + UE_main_exec_args, mypassword) + ' ) > ' + logfile_exec_UE + ' 2>&1 & \n' + task_UE = task_UE + ' ( date; ' + addsudo(UE_main_exec + ' ' + UE_main_exec_args, mypassword) + ' ) > ' + logfile_exec_UE + ' 2>&1 & \n' task_UE = task_UE + 'array_exec_pid+=($!) \n' task_UE = task_UE + 'echo UE_main_exec PID = $! \n' if UE_traffic_exec != "": - task_UE = task_UE + ' ( ' + UE_traffic_exec + ' ' + UE_traffic_exec_args + ' ) >' + logfile_traffic_UE + ' 2>&1 & \n' + cmd_traffic = UE_traffic_exec + ' ' + UE_traffic_exec_args + if cmd_traffic.find('-c') >= 0: + cmd_traffic = cmd_traffic + ' -t ' + str(timeout_cmd - 60) + task_UE = task_UE + ' ( date; ' + cmd_traffic + ' ) >' + logfile_traffic_UE + ' 2>&1 & \n' task_UE = task_UE + 'array_exec_pid+=($!) \n' task_UE = task_UE + 'echo UE_traffic_exec PID = $! \n' #terminate the UE test case after timeout_cmd seconds @@ -693,7 +846,7 @@ def handle_testcaseclass_softmodem (testcase, oldprogramList, logdirOAI5GRepo , task_EPC_compile = ' ( uname -a ; date \n' task_EPC_compile = task_EPC_compile + 'array_exec_pid=()' + '\n' - task_EPC_compile = task_EPC_compile + 'cd ' + logdirOpenaircnRepo + '\n' + task_EPC_compile = task_EPC_compile + 'cd ' + logdirOpenaircnRepo + ' ; source oaienv \n' task_EPC_compile = task_EPC_compile + update_config_file(oai_EPC, EPC_config_file, logdirOpenaircnRepo, logdirOpenaircnRepo+'/TEST/autotests/tools/search_repl.py') + '\n' task_EPC_compile = task_EPC_compile + 'source BUILD/TOOLS/build_helper \n' if EPC_compile_prog != "": @@ -704,21 +857,25 @@ def handle_testcaseclass_softmodem (testcase, oldprogramList, logdirOAI5GRepo , write_file(logfile_task_EPC_compile, task_EPC_compile, mode="w") task_EPC = ' ( uname -a ; date \n' + task_EPC = task_EPC + ' export OPENAIRCN_TESTDIR=' + logdir_EPC + '\n' task_EPC = task_EPC + 'array_exec_pid=()' + '\n' - task_EPC = task_EPC + 'cd ' + logdirOpenaircnRepo + '\n' + task_EPC = task_EPC + 'cd ' + logdirOpenaircnRepo + '; source oaienv\n' task_EPC = task_EPC + 'source BUILD/TOOLS/build_helper \n' if EPC_pre_exec != "": - task_EPC = task_EPC + ' ( ' + EPC_pre_exec + ' '+ EPC_pre_exec_args + ' ) > ' + logfile_pre_exec_EPC + ' 2>&1 \n' + task_EPC = task_EPC + ' ( date; ' + EPC_pre_exec + ' '+ EPC_pre_exec_args + ' ) > ' + logfile_pre_exec_EPC + ' 2>&1 \n' if HSS_main_exec != "": - task_EPC = task_EPC + '(' + addsudo (HSS_main_exec + ' ' + HSS_main_exec_args, mypassword) + ' ) > ' + logfile_exec_HSS + ' 2>&1 & \n' + task_EPC = task_EPC + '( date; ' + addsudo (HSS_main_exec + ' ' + HSS_main_exec_args, mypassword) + ' ) > ' + logfile_exec_HSS + ' 2>&1 & \n' task_EPC = task_EPC + 'array_exec_pid+=($!) \n' task_EPC = task_EPC + 'echo HSS_main_exec PID = $! \n' if EPC_main_exec != "": - task_EPC = task_EPC + '(' + addsudo (EPC_main_exec + ' ' + EPC_main_exec_args, mypassword) + ' ) > ' + logfile_exec_EPC + ' 2>&1 & \n' + task_EPC = task_EPC + '( date; ' + addsudo (EPC_main_exec + ' ' + EPC_main_exec_args, mypassword) + ' ) > ' + logfile_exec_EPC + ' 2>&1 & \n' task_EPC = task_EPC + 'array_exec_pid+=($!) \n' task_EPC = task_EPC + 'echo EPC_main_exec PID = $! \n' if EPC_traffic_exec != "": - task_EPC = task_EPC + '(' + EPC_traffic_exec + ' ' + EPC_traffic_exec_args + ' ) > ' + logfile_traffic_EPC + ' 2>&1 & \n' + cmd_traffic = EPC_traffic_exec + ' ' + EPC_traffic_exec_args + if cmd_traffic.find('-c') >= 0: + cmd_traffic = cmd_traffic + ' -t ' + str(timeout_cmd - 60) + task_EPC = task_EPC + '( date; ' + cmd_traffic + ' ) > ' + logfile_traffic_EPC + ' 2>&1 & \n' task_EPC = task_EPC + 'array_exec_pid+=($!) \n' task_EPC = task_EPC + 'echo EPC_traffic_exec PID = $! \n' #terminate the EPC test case after timeout_cmd seconds @@ -732,14 +889,20 @@ def handle_testcaseclass_softmodem (testcase, oldprogramList, logdirOAI5GRepo , thread_EPC = oaiThread(1, "EPC_thread", EPCMachine, user, password , task_EPC_compile, False, timeout_thread) thread_eNB = oaiThread(2, "eNB_thread", eNBMachine, user, password , task_eNB_compile, False, timeout_thread) thread_UE = oaiThread(3, "UE_thread", UEMachine, user, password , task_UE_compile, False, timeout_thread) + if RRHMachine != '': + thread_RRH = oaiThread(4, "RRH_thread", RRHMachine, user, password , task_RRH_compile, False, timeout_thread) threads=[] threads.append(thread_eNB) threads.append(thread_UE) threads.append(thread_EPC) + if RRHMachine != '': + threads.append(thread_RRH) # Start new Threads thread_eNB.start() thread_UE.start() thread_EPC.start() + if RRHMachine != '': + thread_RRH.start() #Wait for all the compile threads to complete for t in threads: t.join() @@ -748,25 +911,29 @@ def handle_testcaseclass_softmodem (testcase, oldprogramList, logdirOAI5GRepo , thread_EPC = oaiThread(1, "EPC_thread", EPCMachine, user, password , task_EPC, False, timeout_thread) thread_eNB = oaiThread(2, "eNB_thread", eNBMachine, user, password , task_eNB, False, timeout_thread) thread_UE = oaiThread(3, "UE_thread", UEMachine, user, password , task_UE, False, timeout_thread) - + if RRHMachine != '': + thread_RRH = oaiThread(4, "RRH_thread", RRHMachine, user, password , task_RRH, False, timeout_thread) threads=[] threads.append(thread_eNB) threads.append(thread_UE) threads.append(thread_EPC) + if RRHMachine != '': + threads.append(thread_RRH) # Start new Threads thread_eNB.start() thread_UE.start() thread_EPC.start() - + if RRHMachine != '': + thread_RRH.start() #Wait for all the compile threads to complete for t in threads: t.join() #Now we get the log files from remote machines on the local machine - - cleanOldPrograms(oai_eNB, oldprogramList, CleanUpAluLteBox, ExmimoRfStop) - cleanOldPrograms(oai_UE, oldprogramList, CleanUpAluLteBox, ExmimoRfStop) - cleanOldPrograms(oai_EPC, oldprogramList, CleanUpAluLteBox, ExmimoRfStop) + if RRHMachine != '': + cleanOldProgramsAllMachines([oai_eNB, oai_UE, oai_EPC, oai_RRH] , oldprogramList, CleanUpAluLteBox, ExmimoRfStop) + else: + cleanOldProgramsAllMachines([oai_eNB, oai_UE, oai_EPC] , oldprogramList, CleanUpAluLteBox, ExmimoRfStop) logfile_UE_stop_script_out = logdir_UE + '/UE_stop_script_out' + '_' + str(run) + '_.log' logfile_UE_stop_script = logdir_local_testcase + '/UE_stop_script' + '_' + str(run) + '_.log' @@ -781,22 +948,36 @@ def handle_testcaseclass_softmodem (testcase, oldprogramList, logdirOAI5GRepo , thread_UE.start() thread_UE.join() + #Now we change the permissions of the logfiles to avoid some of them being with root permissions + cmd = 'sudo -E chown -R ' + user + ' ' + logdir_eNB + res= oai_eNB.send_recv(cmd) + print "Changing permissions of logdir <" + logdir_eNB + "> in eNB machine..." + res + + cmd = 'sudo -E chown -R ' + user + ' ' + logdir_UE + res= oai_UE.send_recv(cmd) + print "Changing permissions of logdir <" + logdir_UE + "> in UE machine..." + res + + cmd = 'sudo -E chown -R ' + user + ' ' + logdir_EPC + res= oai_EPC.send_recv(cmd) + print "Changing permissions of logdir <" + logdir_EPC + "> in EPC machine..." + res + + if RRHMachine != '': + cmd = 'sudo -E chown -R ' + user + ' ' + logdir_RRH + res= oai_RRH.send_recv(cmd) + print "Changing permissions of logdir <" + logdir_RRH + "> in RRH machine..." + res print "Copying files from EPCMachine : " + EPCMachine + "logdir_EPC = " + logdir_EPC - #ssh = SSHSession(EPCMachine , username=user, key_file=None, password=password) - #ssh.get_all(logdir_EPC , logdir_local + '/cmake_targets/autotests/log/'+ testcasename) - SSHSessionWrapper(EPCMachine, user, None, password, logdir_EPC, logdir_local + '/cmake_targets/autotests/log/'+ testcasename) + SSHSessionWrapper(EPCMachine, user, None, password, logdir_EPC, logdir_local + '/cmake_targets/autotests/log/'+ testcasename, "get_all") print "Copying files from eNBMachine " + eNBMachine + "logdir_eNB = " + logdir_eNB - #ssh = SSHSession(eNBMachine , username=user, key_file=None, password=password) - #ssh.get_all(logdir_eNB, logdir_local + '/cmake_targets/autotests/log/'+ testcasename) - SSHSessionWrapper(eNBMachine, user, None, password, logdir_eNB, logdir_local + '/cmake_targets/autotests/log/'+ testcasename) + SSHSessionWrapper(eNBMachine, user, None, password, logdir_eNB, logdir_local + '/cmake_targets/autotests/log/'+ testcasename, "get_all") print "Copying files from UEMachine : " + UEMachine + "logdir_UE = " + logdir_UE - #ssh = SSHSession(UEMachine , username=user, key_file=None, password=password) - #ssh.get_all(logdir_UE , logdir_local + '/cmake_targets/autotests/log/'+ testcasename) - SSHSessionWrapper(UEMachine, user, None, password, logdir_UE, logdir_local + '/cmake_targets/autotests/log/'+ testcasename) + SSHSessionWrapper(UEMachine, user, None, password, logdir_UE, logdir_local + '/cmake_targets/autotests/log/'+ testcasename, "get_all") + if RRHMachine != '': + print "Copying files from RRHMachine : " + RRHMachine + "logdir_RRH = " + logdir_RRH + SSHSessionWrapper(RRHMachine, user, None, password, logdir_RRH, logdir_local + '/cmake_targets/autotests/log/'+ testcasename, "get_all") #Currently we only perform throughput tests @@ -839,7 +1020,10 @@ def handle_testcaseclass_softmodem (testcase, oldprogramList, logdirOAI5GRepo , write_file(xmlFile, xml, mode="w") -#This function searches if test case is present in list of test cases that need to be executed by user +# \brief This function searches if test case is present in list of test cases that need to be executed by user +# \param testcasename the test case to search for +# \param testcasegroup list that is passed from the arguments +# \param test_case_exclude list of test cases excluded from execution (specified in test_case_list.xml) def search_test_case_group(testcasename, testcasegroup, test_case_exclude): if test_case_exclude != "": @@ -869,70 +1053,154 @@ def search_test_case_group(testcasename, testcasegroup, test_case_exclude): if match >=0: return True return False - - -#thread1 = myThread(1, "Thread-1", 1) +# \brief thread that cleans up remote machines from pre-existing test case executions +# \param threadID number of thread (for book keeping) +# \param threadname name of thread (for book keeping) +# \param oai handler that can be used to execute programs on remote machines +# \param CleanUpOldProgs list of programs which must be terminated before running a test case (specified in test_case_list.xml) +# \param CleanupAluLteBox string that contains commands to stop ALU Bell Labs LTEBox (specified in test_case_list.xml) +# \param ExmimoRfStop command to stop EXMIMO Card +class oaiCleanOldProgramThread (threading.Thread): + def __init__(self, threadID, threadname, oai, CleanUpOldProgs, CleanUpAluLteBox, ExmimoRfStop): + threading.Thread.__init__(self) + self.threadID = threadID + self.threadname = threadname + self.oai = oai + self.CleanUpOldProgs = CleanUpOldProgs + self.CleanUpAluLteBox = CleanUpAluLteBox + self.ExmimoRfStop = ExmimoRfStop + def run(self): + try: + cleanOldPrograms(self.oai, self.CleanUpOldProgs, self.CleanUpAluLteBox, self.ExmimoRfStop) + except Exception, e: + error='' + error = error + ' In class oaiCleanOldProgramThread, function: ' + sys._getframe().f_code.co_name + ': *** Caught exception: ' + str(e.__class__) + " : " + str( e) + error = error + '\n threadID = ' + str(self.threadID) + '\n threadname = ' + self.threadname + '\n CleanUpOldProgs = ' + self.CleanUpOldProgs + '\n CleanUpAluLteBox = ' + self.CleanUpAluLteBox + '\n ExmimoRfStop = ' + self.ExmimoRfStop + '\n' + error = error + traceback.format_exc() + print error + print "There is error in cleaning up old programs....." + #sys.exit(1) + +# \brief Run parallel threads in all machines for clean up old execution of test cases +# \param oai_list list of handlers that can be used to execute programs on remote machines +# \param CleanUpOldProgs list of programs which must be terminated before running a test case (specified in test_case_list.xml) +# \param CleanupAluLteBox string that contains commands to stop ALU Bell Labs LTEBox (specified in test_case_list.xml) +# \param ExmimoRfStop command to stop EXMIMO Card +def cleanOldProgramsAllMachines(oai_list, CleanOldProgs, CleanUpAluLteBox, ExmimoRfStop): + threadId=0 + threadList=[] + for oai in oai_list: + threadName="cleanup_thread_"+str(threadId) + thread=oaiCleanOldProgramThread(threadId, threadName, oai, CleanUpOldProgs, CleanUpAluLteBox, ExmimoRfStop) + threadList.append(thread) + thread.start() + threadId = threadId + 1 + for t in threadList: + t.join() + + debug = 0 pw ='' i = 0 dlsim=0 localshell=0 -is_compiled = 0 -timeout=2000 -xmlInputFile="./test_case_list.xml" -NFSResultsDir = '/mnt/sradio' -cleanupOldProgramsScript = '$OPENAIR_DIR/cmake_targets/autotests/tools/remove_old_programs.bash' +GitOAI5GRepoBranch='' +GitOAI5GHeadVersion='' +user='' +pw='' testcasegroup='' - -logdir = '/tmp/' + 'OAITestFrameWork-' + getpass.getuser() + '/' -logdirOAI5GRepo = logdir + 'openairinterface5g/' -logdirOpenaircnRepo = logdir + 'openair-cn/' - +NFSResultsShare='' +cleanUpRemoteMachines=False openairdir_local = os.environ.get('OPENAIR_DIR') if openairdir_local is None: print "Environment variable OPENAIR_DIR not set correctly" sys.exit() -locallogdir = openairdir_local + '/cmake_targets/autotests/log/' -#Remove the contents of local log directory -#os.system(' rm -fr ' + locallogdir + '; mkdir -p ' + locallogdir ) +locallogdir = openairdir_local + '/cmake_targets/autotests/log' +MachineList = '' +MachineListGeneric='' flag_remove_logdir=False +flag_start_testcase=False +nruns_lte_softmodem='' +flag_skip_git_head_check=False +flag_skip_oai_install=False +Timeout_cmd='' +print "Number of arguments argc = " + str(len(sys.argv)) +#for index in range(1,len(sys.argv) ): +# print "argv_" + str(index) + " : " + sys.argv[index] + i=1 while i < len (sys.argv): arg=sys.argv[i] - if arg == '-d': - debug = 1 - elif arg == '-dd': - debug = 2 - elif arg == '-p' : - prompt2 = sys.argv[i+1] - i = i +1 - elif arg == '-r': - flag_remove_logdir=True - elif arg == '-w' : - pw = sys.argv[i+1] - i = i +1 - elif arg == '-P' : - dlsim = 1 - elif arg == '-l' : - localshell = 1 - elif arg == '-c' : - is_compiled = 1 - elif arg == '-t' : - timeout = sys.argv[i+1] - i = i +1 + if arg == '-r': + flag_remove_logdir=True + elif arg == '-s' : + flag_start_testcase=True elif arg == '-g' : testcasegroup = sys.argv[i+1].replace("\"","") i = i +1 + elif arg == '-c': + cleanUpRemoteMachines=True + elif arg == '-5GRepoBranch': + GitOAI5GRepoBranch = sys.argv[i+1] + i = i +1 + elif arg == '-5GRepoHeadVersion': + GitOAI5GHeadVersion = sys.argv[i+1] + #We now find the branch that corresponds to this Git Head Commit + cmd = "git show-ref --head " + " | grep " + GitOAI5GHeadVersion + cmd_out = subprocess.check_output ([cmd], shell=True) + cmd_out=cmd_out.replace("\n","") + cmd_out = cmd_out.split('/') + GitOAI5GRepoBranch = cmd_out[-1] + if GitOAI5GRepoBranch == '': + print "Error extracting GitBranch from head commit. Exiting now..." + sys.exit(1) + i = i +1 + elif arg == '-u': + user = sys.argv[i+1] + i = i +1 + elif arg == '-p': + pw = sys.argv[i+1] + i = i +1 + elif arg == '-n': + NFSResultsShare = sys.argv[i+1] + i = i +1 + elif arg == '--nrun_lte_softmodem': + nruns_lte_softmodem = sys.argv[i+1] + i = i +1 + elif arg == '-MachineList': + MachineList = sys.argv[i+1] + MachineList = MachineList.replace("\"","") + MachineList = MachineList.replace("\'","") + i = i +1 + elif arg == '-MachineListGeneric': + MachineListGeneric = sys.argv[i+1] + MachineListGeneric = MachineListGeneric.replace("\"","") + MachineListGeneric = MachineListGeneric.replace("\'","") + i = i +1 + elif arg == '--skip-git-head-check': + flag_skip_git_head_check=True + elif arg == '--timeout_cmd': + Timeout_cmd = sys.argv[i+1] + i = i +1 + elif arg == '--skip-oai-install': + flag_skip_oai_install=True elif arg == '-h' : - print "-d: low debug level" - print "-dd: high debug level" - print "-p: set the prompt" + print "-s: This flag *MUST* be set to start the test cases" print "-r: Remove the log directory in autotests" print "-g: Run test cases in a group" - print "-w: set the password for ssh to localhost" - print "-l: use local shell instead of ssh connection" - print "-t: set the time out in second for commands" + print "-c: Run cleanup scripts on remote machines and exit" + print "-5GRepoBranch: Branch for OAI 5G Repository to run tests (overrides the branch in test_case_list.xml)" + print "-5GRepoHeadVersion: Head commit on which to run tests (overrides the branch in test_case_list.xml)" + print "-u: use the user name passed as argument" + print "-p: use the password passed as an argument" + print "-n: Set the NFS share passed as an argument" + print "--nrun_lte_softmodem: Set the number of runs for lte-softmodem test case class" + print "-MachineList : overrides the MachineList parameter in test_case_list.xml" + print "-MachineListGeneric : overrides the MachineListGeneric parameter in test_case_list.xml" + print "--skip-git-head-check: skip checking of GitHead remote/local branch (only for debugging)" + print "--timeout_cmd: Override the default parameter (timeout_cmd) in test_case_list.xml. This parameter is in seconds and should be > 120" + print "--skip-oai-install: Skips the openairinterface5g installer" sys.exit() else : print "Unrecongnized Option: <" + arg + ">. Use -h to see valid options" @@ -957,27 +1225,48 @@ except KeyError: print "Please set the environment variable OPENAIR_TARGETS in the .bashrc" sys.exit(1) -if flag_remove_logdir == True: - print "Removing directory: " + locallogdir - os.system(' rm -fr ' + locallogdir + '; mkdir -p ' + locallogdir ) - +print "Killing zombie ssh sessions from earlier sessions..." +cmd='ps aux |grep \"/usr/bin/ssh -q -l guptar\"|tr -s \" \" :|cut -f 2 -d :|xargs kill -9 ' +os.system(cmd) - -paramiko_logfile = os.path.expandvars('$OPENAIR_DIR/cmake_targets/autotests/log/paramiko.log') -res=os.system(' echo > ' + paramiko_logfile) -paramiko.util.log_to_file(paramiko_logfile) +if flag_start_testcase == False: + print "You need to start the testcase by passing option -s. Use -h to see all options. Aborting now..." + sys.exit(1) # get the oai object host = os.uname()[1] #oai = openair('localdomain','calisson') -oai_list = {} - +oai_list = [] #start_time = time.time() # datetime.datetime.now() -user = getpass.getuser() +if user=='': + user = getpass.getuser() +if pw=='': + pw = getpass.getpass() + +print "Killing zombie ssh sessions from earlier sessions..." +cmd='ps aux |grep \"/usr/bin/ssh -q -l guptar\"|tr -s \" \" :|cut -f 2 -d :|xargs kill -9 ' +cmd = cmd + '; ps aux |grep \"/usr/bin/ssh -q -l ' + user + '\"|tr -s \" \" :|cut -f 2 -d :|xargs kill -9 ' +os.system(cmd) + print "host = " + host print "user = " + user -pw=getpass.getpass() +xmlInputFile=os.environ.get('OPENAIR_DIR')+"/cmake_targets/autotests/test_case_list.xml" +NFSResultsDir = '/mnt/sradio' +cleanupOldProgramsScript = '$OPENAIR_DIR/cmake_targets/autotests/tools/remove_old_programs.bash' +logdir = '/tmp/' + 'OAITestFrameWork-' + user + '/' +logdirOAI5GRepo = logdir + 'openairinterface5g/' +logdirOpenaircnRepo = logdir + 'openair-cn/' + +if flag_remove_logdir == True: + print "Removing directory: " + locallogdir + os.system(' rm -fr ' + locallogdir + '; mkdir -p ' + locallogdir ) + +paramiko_logfile = os.path.expandvars('$OPENAIR_DIR/cmake_targets/autotests/log/paramiko.log') +res=os.system(' echo > ' + paramiko_logfile) +paramiko.util.log_to_file(paramiko_logfile) + +#pw=getpass.getpass() #Now we parse the xml file for basic configuration xmlTree = ET.parse(xmlInputFile) @@ -985,52 +1274,59 @@ xmlRoot = xmlTree.getroot() - -MachineList = xmlRoot.findtext('MachineList',default='') +if MachineList =='': + MachineList = xmlRoot.findtext('MachineList',default='') NFSResultsShare = xmlRoot.findtext('NFSResultsShare',default='') GitOpenaircnRepo = xmlRoot.findtext('GitOpenair-cnRepo',default='') GitOAI5GRepo = xmlRoot.findtext('GitOAI5GRepo',default='') -GitOAI5GRepoBranch = xmlRoot.findtext('GitOAI5GRepoBranch',default='') + +if GitOAI5GRepoBranch == '': + GitOAI5GRepoBranch = xmlRoot.findtext('GitOAI5GRepoBranch',default='') + GitOpenaircnRepoBranch = xmlRoot.findtext('GitOpenair-cnRepoBranch',default='') CleanUpOldProgs = xmlRoot.findtext('CleanUpOldProgs',default='') CleanUpAluLteBox = xmlRoot.findtext('CleanUpAluLteBox',default='') Timeout_execution = int (xmlRoot.findtext('Timeout_execution')) -MachineListGeneric = xmlRoot.findtext('MachineListGeneric',default='') +if MachineListGeneric == '': + MachineListGeneric = xmlRoot.findtext('MachineListGeneric',default='') TestCaseExclusionList = xmlRoot.findtext('TestCaseExclusionList',default='') ExmimoRfStop = xmlRoot.findtext('ExmimoRfStop',default='') +if nruns_lte_softmodem == '': + nruns_lte_softmodem = xmlRoot.findtext('nruns_lte-softmodem',default='') + print "MachineList = " + MachineList print "GitOpenair-cnRepo = " + GitOpenaircnRepo print "GitOAI5GRepo = " + GitOAI5GRepo print "GitOAI5GBranch = " + GitOAI5GRepoBranch print "GitOpenaircnRepoBranch = " + GitOpenaircnRepoBranch print "NFSResultsShare = " + NFSResultsShare -cmd = "git show-ref --heads -s "+ GitOAI5GRepoBranch -GitOAI5GHeadVersion = subprocess.check_output ([cmd], shell=True) +print "nruns_lte_softmodem = " + nruns_lte_softmodem +print "Timeout_cmd = " + Timeout_cmd + +if GitOAI5GHeadVersion == '': + cmd = "git show-ref --heads -s "+ GitOAI5GRepoBranch + GitOAI5GHeadVersion = subprocess.check_output ([cmd], shell=True) + GitOAI5GHeadVersion=GitOAI5GHeadVersion.replace("\n","") + print "GitOAI5GHeadVersion = " + GitOAI5GHeadVersion print "CleanUpOldProgs = " + CleanUpOldProgs print "Timeout_execution = " + str(Timeout_execution) -MachineList = MachineList.split() -MachineListGeneric = MachineListGeneric.split() - -index=0 -for machine in MachineList: - oai_list[index] = openair('localdomain',machine) - index = index + 1 - - -#myThread (1,"sddsf", 1) - - -#thread1 = oaiThread1(1, "Thread-1", 1) -#def __init__(self, threadID, name, counter, oai, cmd, sudo, timeout): - -#sys.exit() - +if GitOAI5GHeadVersion == '': + print "Error getting the OAI5GBranch Head version...Exiting" + sys.exit() +NFSTestsResultsDir = NFSResultsShare + '/'+ GitOAI5GRepoBranch + '/' + GitOAI5GHeadVersion +print "NFSTestsResultsDir = " + NFSTestsResultsDir +MachineList = MachineList.split() +MachineListGeneric = MachineListGeneric.split() +#index=0 +for machine in MachineList: + oai_list.append( openair('localdomain',machine)) + #index = index + 1 print "\nTesting the sanity of machines used for testing..." @@ -1049,14 +1345,6 @@ if localshell == 0: #print "password: " + pw # issues in ubuntu 12.04 oai_list[index].connect(user,pw) - #print "result = " + result - - - #print '\nCleaning Older running programs : ' + CleanUpOldProgs - #cleanOldPrograms(oai_list[index], CleanUpOldProgs) - - - print '\nChecking for sudo permissions on machine <'+machine+'>...' result = oai_list[index].send_expect_false('sudo -S -v','may not run sudo',True) print "Sudo permissions..." + result @@ -1064,18 +1352,17 @@ if localshell == 0: print '\nCleaning Older running programs : ' + CleanUpOldProgs cleanOldPrograms(oai_list[index], CleanUpOldProgs, CleanUpAluLteBox, ExmimoRfStop) - result = oai_list[index].send('mount ' + NFSResultsDir, True) - print "Mounting NFS Share " + NFSResultsDir + "..." + result + #result = oai_list[index].send('mount ' + NFSResultsDir, True) + #print "Mounting NFS Share " + NFSResultsDir + "..." + result # Check if NFS share is mounted correctly. - print 'Checking if NFS Share<' + NFSResultsDir + '> is mounted correctly...' - #result = oai_list[index].send_expect('mount | grep ' + NFSResultsDir, NFSResultsDir ) - cmd = 'if grep -qs '+NFSResultsDir+ ' /proc/mounts; then echo \'' + NFSResultsDir + ' is mounted\' ; fi' - search_expr = NFSResultsDir + ' is mounted' - print "cmd = " + cmd - print "search_expr = " + search_expr - result = oai_list[index].send_expect(cmd, search_expr) - print "Mount NFS_Results_Dir..." + result + #print 'Checking if NFS Share<' + NFSResultsDir + '> is mounted correctly...' + #cmd = 'if grep -qs '+NFSResultsDir+ ' /proc/mounts; then echo \'' + NFSResultsDir + ' is mounted\' ; fi' + #search_expr = NFSResultsDir + ' is mounted' + #print "cmd = " + cmd + #print "search_expr = " + search_expr + #result = oai_list[index].send_expect(cmd, search_expr) + #print "Mount NFS_Results_Dir..." + result index = index + 1 #oai.connect2(user,pw) @@ -1087,39 +1374,18 @@ else: pw = '' oai_list[0].connect_localshell() - - - - -cpu_freq = int(oai_list[0].cpu_freq()) -if timeout == 2000 : - if cpu_freq <= 2000 : - timeout = 3000 - elif cpu_freq < 2700 : - timeout = 2000 - elif cpu_freq < 3300 : - timeout = 1500 -print "cpu freq(MHz): " + str(cpu_freq) + "timeout(s): " + str(timeout) - -# The log files are stored in branch/version/ - - - -#result = oai_list[0].send('uname -a ' ) -#print result - #We now prepare the machines for testing -#index=0 +index=0 threads_init_setup=[] -for index in oai_list: +for oai in oai_list: try: print "setting up machine: " + MachineList[index] #print oai_list[oai].send_recv('echo \''+pw+'\' |sudo -S -v') #print oai_list[oai].send_recv('sudo su') #print oai_list[oai].send_recv('who am i') #cleanUpPrograms(oai_list[oai] - cmd = 'mkdir -p ' + logdir + ' ; rm -fr ' + logdir + '/*' - result = oai_list[index].send_recv(cmd) + cmd = 'sudo -S -E rm -fr ' + logdir + ' ; mkdir -p ' + logdir + result = oai.send_recv(cmd) setuplogfile = logdir + '/setup_log_' + MachineList[index] + '_.txt' setup_script = locallogdir + '/setup_script_' + MachineList[index] + '_.txt' @@ -1128,54 +1394,44 @@ for index in oai_list: #cmd = cmd + 'mkdir -p ' + logdir + '\n' cmd = cmd + 'cd '+ logdir + '\n' cmd = cmd + 'git config --global http.sslVerify false \n' - cmd = cmd + 'git clone '+ GitOAI5GRepo + '\n' - cmd = cmd + 'git clone '+ GitOpenaircnRepo + '\n' + cmd = cmd + 'git clone --depth 1 '+ GitOAI5GRepo + ' -b ' + GitOAI5GRepoBranch +' \n' + cmd = cmd + 'git clone '+ GitOpenaircnRepo + ' -b ' +GitOpenaircnRepoBranch + ' \n' cmd = cmd + 'cd ' + logdirOAI5GRepo + '\n' - cmd = cmd + 'git checkout ' + GitOAI5GHeadVersion + '\n' + cmd = cmd + 'git checkout ' + GitOAI5GRepoBranch + '\n' + #cmd = cmd + 'git checkout ' + GitOAI5GHeadVersion + '\n' + cmd = cmd + 'git_head=`git ls-remote |grep \'' + GitOAI5GRepoBranch + '\'` \n' + cmd = cmd + 'git_head=($git_head) \n' + cmd = cmd + 'git_head=${git_head[0]} \n' + cmd = cmd + 'echo \"GitOAI5GHeadVersion_remote = $git_head\"' + cmd = cmd + 'echo \"GitOAI5GHeadVersion_local = ' + GitOAI5GHeadVersion + '\" \n' + if flag_skip_git_head_check==True: + cmd = cmd + 'echo \"skipping GitHead check...\" \n ' + else: + cmd = cmd + 'if [ \"$git_head\" != \"'+ GitOAI5GHeadVersion + '\" ]; then echo \"error: Git openairinterface5g head version does not match\" ; fi \n' cmd = cmd + 'source oaienv' + '\n' + if flag_skip_oai_install == False: + cmd = cmd + 'source $OPENAIR_DIR/cmake_targets/tools/build_helper \n' + cmd = cmd + 'echo \"Installing core OAI dependencies...Start\" \n' + cmd = cmd + '$OPENAIR_DIR/cmake_targets/build_oai -I --install-optional-packages \n' + cmd = cmd + 'echo \"Installing core OAI dependencies...Finished\" \n' + #cmd = cmd + 'echo \"Installing BLADERF OAI dependencies...Start\" \n' + #cmd = cmd + 'check_install_bladerf_driver \n' + #cmd = cmd + 'echo \"Installing BLADERF OAI dependencies...Finished\" \n' + #cmd = cmd + 'echo \"Installing USRP OAI dependencies...Start\" \n' + #cmd = cmd + 'check_install_usrp_uhd_driver \n' + #cmd = cmd + 'echo \"Installing USRP OAI dependencies...Finished\" \n' cmd = cmd + 'cd ' + logdirOpenaircnRepo + '\n' cmd = cmd + 'git checkout ' + GitOpenaircnRepoBranch + '\n' cmd = cmd + 'env |grep OPENAIR' + '\n' cmd = cmd + ' cd ' + logdir + '\n' - cmd = cmd + ' ) > ' + setuplogfile + ' 2>&1 ' + cmd = cmd + ' ) > ' + setuplogfile + ' 2>&1 \n' #cmd = cmd + 'echo \' ' + cmd + '\' > ' + setup_script + ' 2>&1 \n ' #result = oai_list[index].send_recv(cmd, False, 300 ) write_file(setup_script, cmd, mode="w") - tempThread = oaiThread(index, 'thread_setup_'+str(index)+'_' + MachineList[index] , MachineList[index] , user, pw, cmd, False, 300) + tempThread = oaiThread(index, 'thread_setup_'+str(index)+'_' + MachineList[index] , MachineList[index] , user, pw, cmd, False, 3000) threads_init_setup.append(tempThread ) tempThread.start() - - #localfile = locallogdir + '/setup_log_' + MachineList[index] + '_.txt' - #remotefile = logdir + '/setup_log_' + MachineList[index] + '_.txt' - - #sftp_log = os.path.expandvars(locallogdir + '/sftp_module.log') - #sftp_module (user, pw, MachineList[index], 22, localfile, remotefile, sftp_log, "get") - - - #Now we copy test_case_list.xml on the remote machines - #localfile = os.path.expandvars('$OPENAIR_DIR/cmake_targets/autotests/test_case_list.xml') - #remotefile = logdirOAI5GRepo + '/cmake_targets/autotests/test_case_list.xml' - - #sftp_log = os.path.expandvars(locallogdir + '/sftp_module.log') - #sftp_module (user, pw, MachineList[index], 22, localfile, remotefile, sftp_log, "put") - - - #print oai_list[index].send('rm -fR ' + logdir) - #print oai_list[index].send('mkdir -p ' + logdir) - #print oai_list[index].send('cd '+ logdir) - #print oai_list[index].send('git clone '+ GitOAI5GRepo ) - #print oai_list[index].send('git clone '+ GitOpenaircnRepo) - #print oai_list[index].send('cd ' + logdirOAI5GRepo) - #print oai_list[index].send('git checkout ' + GitOAI5GHeadVersion) - #print oai_list[index].send('source oaienv') - #print oai_list[index].send('cd ' + logdirOpenaircnRepo) - #print oai_list[index].send('git checkout ' + GitOpenaircnRepoBranch) - #print oai_list[index].send_recv('cd ' + logdirOAI5GRepo) - #print oai_list[index].send_recv('source oaienv') - #print oai_list[index].send_recv('env |grep OPENAIR') - - #print '\nCleaning Older running programs : ' + CleanUpOldProgs - #cleanOldPrograms(oai_list[index], CleanUpOldProgs) + index = index + 1 except Exception, e: print 'There is error in one of the commands to setup the machine '+ MachineList[index] error='' @@ -1205,8 +1461,10 @@ for t in threads_init_setup: paramList.append ( {"operation":'put', "localfile":localfile, "remotefile":remotefile} ) sftp_log = os.path.expandvars(locallogdir + '/sftp_module.log') sftp_module (user, pw, MachineList[index], port, paramList, sftp_log) - index = index+1 - + + cmd = ' cd ' + logdirOAI5GRepo + ' ; source oaienv ; env|grep OPENAIR \n' + res = oai_list[index].send_recv(cmd) + index = index +1 if os.path.exists(localfile) == 0: print "Setup log file <" + localfile + "> missing for machine <" + MachineList[index] + ">. Please check the setup log files. Exiting now" sys.exit(1) @@ -1214,12 +1472,16 @@ for t in threads_init_setup: #Now we process all the test cases #Now we check if there was error in setup files -status, out = commands.getstatusoutput('grep ' + ' -il \'error\' ' + locallogdir + '/setup*') +status, out = commands.getstatusoutput('grep ' + ' -il \'error\' ' + locallogdir + '/setup_log*') if (out != '') : print "There is error in setup of machines" print "status = " + str(status) + "\n Check files for error = " + out - print sys.exit(1) + print "Exiting now..." + sys.exit(1) +cleanOldProgramsAllMachines(oai_list, CleanUpOldProgs, CleanUpAluLteBox, ExmimoRfStop) +if cleanUpRemoteMachines == True: + sys.exit(0) threadListGlobal=[] testcaseList=xmlRoot.findall('testCase') @@ -1243,11 +1505,12 @@ for testcase in testcaseList: print "eNBMachine : " + eNBMachine + "UEMachine : " + UEMachine + "EPCMachine : " + EPCMachine + "MachineList : " + ','.join(MachineList) print "testcasename = " + testcasename + " class = " + testcaseclass threadListGlobal = wait_testcaseclass_generic_threads(threadListGlobal, Timeout_execution) - handle_testcaseclass_softmodem (testcase, CleanUpOldProgs, logdirOAI5GRepo, logdirOpenaircnRepo, MachineList, pw, CleanUpAluLteBox, ExmimoRfStop ) + #cleanOldProgramsAllMachines(oai_list, CleanUpOldProgs, CleanUpAluLteBox, ExmimoRfStop) + handle_testcaseclass_softmodem (testcase, CleanUpOldProgs, logdirOAI5GRepo, logdirOpenaircnRepo, MachineList, user, pw, CleanUpAluLteBox, ExmimoRfStop, nruns_lte_softmodem, Timeout_cmd ) elif (testcaseclass == 'compilation'): - threadListGlobal = handle_testcaseclass_generic (testcasename, threadListGlobal, CleanUpOldProgs, logdirOAI5GRepo, MachineListGeneric, pw, CleanUpAluLteBox,Timeout_execution, ExmimoRfStop) + threadListGlobal = handle_testcaseclass_generic (testcasename, threadListGlobal, CleanUpOldProgs, logdirOAI5GRepo, MachineListGeneric, user, pw, CleanUpAluLteBox,Timeout_execution, ExmimoRfStop) elif (testcaseclass == 'execution'): - threadListGlobal = handle_testcaseclass_generic (testcasename, threadListGlobal, CleanUpOldProgs, logdirOAI5GRepo, MachineListGeneric, pw, CleanUpAluLteBox,ExmimoRfStop) + threadListGlobal = handle_testcaseclass_generic (testcasename, threadListGlobal, CleanUpOldProgs, logdirOAI5GRepo, MachineListGeneric, user, pw, CleanUpAluLteBox, Timeout_execution, ExmimoRfStop) else : print "Unknown test case class: " + testcaseclass sys.exit() @@ -1262,66 +1525,24 @@ for testcase in testcaseList: #sys.exit(1) -print "Exiting the test cases execution now..." +print "Exiting the test cases execution now. Waiting for existing threads to complete..." -for t in threadListGlobal: - t.join - -sys.exit() - - #+ "class = "+ classx +for param in threadListGlobal: + thread_id = param["thread_id"] + thread_id.join() +print "Creating xml file for overall results..." +cmd = "cat $OPENAIR_DIR/cmake_targets/autotests/log/*/*.xml > $OPENAIR_DIR/cmake_targets/autotests/log/results_autotests.xml " +res=os.system(cmd) +print "Now copying files to NFS Share" +oai_localhost = openair('localdomain','localhost') +oai_localhost.connect(user,pw) +cmd = ' rm -fr ' + NFSTestsResultsDir + ' ; mkdir -p ' + NFSTestsResultsDir +res = oai_localhost.send_recv(cmd) +print "Deleting NFSTestResults Dir..." + res - #index = index +1 +print "Copying files from GilabCI Runner Machine : " + host + " .locallogdir = " + locallogdir + ", NFSTestsResultsDir = " + NFSTestsResultsDir +SSHSessionWrapper('localhost', user, None, pw , NFSTestsResultsDir , locallogdir, "put_all") -test = 'test01' -ctime=datetime.datetime.utcnow().strftime("%Y-%m-%d.%Hh%M") -logfile = user+'.'+test+'.'+ctime+'.txt' -logdir = os.getcwd() + '/pre-ci-logs-'+host; -oai.create_dir(logdir,debug) -print 'log dir: ' + logdir -print 'log file: ' + logfile -pwd = oai.send_recv('pwd') -print "pwd = " + pwd -result = oai.send('echo linux | sudo -S ls -al;sleep 5') -print "result =" + result sys.exit() - -#oai.send_nowait('mkdir -p -m 755' + logdir + ';') - -#print '=================start the ' + test + ' at ' + ctime + '=================\n' -#print 'Results will be reported in log file : ' + logfile -log.writefile(logfile,'====================start'+test+' at ' + ctime + '=======================\n') -log.set_debug_level(debug) - -oai.kill(user, pw) -oai.rm_driver(oai,user,pw) - -# start te test cases -if is_compiled == 0 : - is_compiled=case01.execute(oai, user, pw, host,logfile,logdir,debug,timeout) - -if is_compiled != 0 : - case02.execute(oai, user, pw, host, logfile,logdir,debug) - case03.execute(oai, user, pw, host, logfile,logdir,debug) - case04.execute(oai, user, pw, host, logfile,logdir,debug) - case05.execute(oai, user, pw, host, logfile,logdir,debug) -else : - print 'Compilation error: skip test case 02,03,04,05' - -oai.kill(user, pw) -oai.rm_driver(oai,user,pw) - -# perform the stats -log.statistics(logfile) - - -oai.disconnect() - -ctime=datetime.datetime.utcnow().strftime("%Y-%m-%d_%Hh%M") -log.writefile(logfile,'====================end the '+ test + ' at ' + ctime +'====================') -print 'Test results can be found in : ' + logfile -#print '\nThis test took %f minutes\n' % math.ceil((time.time() - start_time)/60) - -#print '\n=====================end the '+ test + ' at ' + ctime + '=====================' diff --git a/cmake_targets/autotests/test_case_list.xml b/cmake_targets/autotests/test_case_list.xml index ba34085d90ef7b50cf11226852ed65e37b2cda58..8478d6b898adef18c21518bd46b0072064035ba7 100644 --- a/cmake_targets/autotests/test_case_list.xml +++ b/cmake_targets/autotests/test_case_list.xml @@ -1,17 +1,18 @@ <testCaseList> -<MachineList>stevens calisson mozart nano amerique</MachineList> - <NFSResultsShare>/mnt/sradio/TEST_RESULTS</NFSResultsShare> +<MachineList>mozart calisson stevens nano amerique</MachineList> + <NFSResultsShare>/mnt/sradio/TEST_RESULTS/</NFSResultsShare> <GitOAI5GRepo>https://gitlab.eurecom.fr/oai/openairinterface5g.git</GitOAI5GRepo> <GitOpenair-cnRepo>https://gitlab.eurecom.fr/oai/openair-cn.git</GitOpenair-cnRepo> - <GitOAI5GRepoBranch>enhancement-57-UHD-interfacing</GitOAI5GRepoBranch> - <GitOpenair-cnRepoBranch>feature-17-test_framework</GitOpenair-cnRepoBranch> - <CleanUpOldProgs>oaisim* oaisim_nos1* lte-softmodem* lte-softmodem-nos1* mme_gw* run_epc* run_hss* iperf* hss hss_sim configure_cots_bandrich_ue* wvdial* run_exec_autotests* iperf</CleanUpOldProgs> - <CleanUpAluLteBox>/opt/ltebox/tools/stop_ltebox</CleanUpAluLteBox> -<ExmimoRfStop>cd $OPENAIR_DIR/cmake_targets/autotests/tools/exmimo; sudo -E -S octave ./exmimo_stop.m</ExmimoRfStop> + <GitOAI5GRepoBranch>develop</GitOAI5GRepoBranch> + <GitOpenair-cnRepoBranch>develop</GitOpenair-cnRepoBranch> + <CleanUpOldProgs>oaisim* oaisim_nos1* lte-softmodem* lte-softmodem-nos1* mme_gw* run_epc* run_hss* hss hss_sim configure_cots_bandrich_ue* wvdial* iperf iperf_script ping tshark rrh_gw</CleanUpOldProgs> + <CleanUpAluLteBox>sudo -S -E /opt/ltebox/tools/stop_ltebox</CleanUpAluLteBox> +<ExmimoRfStop>$OPENAIR_DIR/cmake_targets/build_oai -w EXMIMO -c; sudo -S -E $OPENAIR_DIR/cmake_targets/tools/stop_exmimo2; uname -a; dmesg|tail</ExmimoRfStop> <Timeout_execution>36000</Timeout_execution> - <TestCaseExclusionList>0104+ 015502 015505 015506 015507 015508 015508 015509 015510 015511 015600 015700 016102 016105</TestCaseExclusionList> - <MachineListGeneric>calisson stevens mozart nano amerique</MachineListGeneric> + <TestCaseExclusionList>0102+ 0104+ 015502 015505 015506 015507 015508 015509 015510 015511 015602 015605 015702 015705 015802 015805 016002 016005 016102 016105 016302 016305 016502 016505 017002 017005 017502 017505</TestCaseExclusionList> + <nruns_lte-softmodem>3</nruns_lte-softmodem> + <MachineListGeneric>mozart calisson stevens nano amerique</MachineListGeneric> <testCase id="010101" > <class>compilation</class> <desc>Build oaisim.Rel8</desc> @@ -80,7 +81,8 @@ <compile_prog_args>--eNB -w USRP -r Rel10 --noS1 -c </compile_prog_args> <compile_prog_out>$OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 $OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/rb_tool - $OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/CMakeFiles/nasmesh/nasmesh.ko</compile_prog_out> + $OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/CMakeFiles/nasmesh/nasmesh.ko + $OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/liboai_usrpdevif.so</compile_prog_out> <pre_exec></pre_exec> <pre_exec_args></pre_exec_args> <main_exec></main_exec> @@ -121,14 +123,15 @@ <compile_prog_args>--eNB -w BLADERF -r Rel10 --noS1 -c </compile_prog_args> <compile_prog_out>$OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 $OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/rb_tool - $OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/CMakeFiles/nasmesh/nasmesh.ko</compile_prog_out> + $OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/CMakeFiles/nasmesh/nasmesh.ko + $OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/liboai_bladerfdevif.so</compile_prog_out> <pre_exec></pre_exec> <pre_exec_args></pre_exec_args> <main_exec></main_exec> <main_exec_args></main_exec_args> <search_expr_true></search_expr_true> <search_expr_false></search_expr_false> - <tags>lte-softmodem_noS1.EXMIMO.Rel10</tags> + <tags>lte-softmodem_noS1.BLADERF.Rel10</tags> <nruns>1</nruns> </testCase> @@ -137,10 +140,11 @@ <desc>Build lte_softmodem_noS1.ETHERNET.Rel10</desc> <pre_compile_prog></pre_compile_prog> <compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</compile_prog> - <compile_prog_args>--eNB -w ETHERNET -r Rel10 --noS1 -c </compile_prog_args> + <compile_prog_args>--eNB -w None -t ETHERNET -r Rel10 --noS1 -c </compile_prog_args> <compile_prog_out>$OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 $OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/rb_tool - $OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/CMakeFiles/nasmesh/nasmesh.ko</compile_prog_out> + $OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/CMakeFiles/nasmesh/nasmesh.ko + $OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/liboai_eth_transpro.so</compile_prog_out> <pre_exec></pre_exec> <pre_exec_args></pre_exec_args> <main_exec></main_exec> @@ -159,7 +163,8 @@ <pre_compile_prog></pre_compile_prog> <compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</compile_prog> <compile_prog_args>--eNB -w USRP -r Rel10 -c </compile_prog_args> - <compile_prog_out>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</compile_prog_out> + <compile_prog_out>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem + $OPENAIR_DIR/cmake_targets/lte_build_oai/build/liboai_usrpdevif.so</compile_prog_out> <pre_exec></pre_exec> <pre_exec_args></pre_exec_args> <main_exec></main_exec> @@ -196,7 +201,8 @@ <pre_compile_prog></pre_compile_prog> <compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</compile_prog> <compile_prog_args>--eNB -w BLADERF -r Rel10 -c </compile_prog_args> - <compile_prog_out>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</compile_prog_out> + <compile_prog_out>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem + $OPENAIR_DIR/cmake_targets/lte_build_oai/build/liboai_bladerfdevif.so</compile_prog_out> <pre_exec></pre_exec> <pre_exec_args></pre_exec_args> <main_exec></main_exec> @@ -212,8 +218,9 @@ <desc>Build lte_softmodem.ETHERNET.Rel10</desc> <pre_compile_prog></pre_compile_prog> <compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</compile_prog> - <compile_prog_args>--eNB -w ETHERNET -r Rel10 -c </compile_prog_args> - <compile_prog_out>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</compile_prog_out> + <compile_prog_args>--eNB -w None -t ETHERNET -r Rel10 -c </compile_prog_args> + <compile_prog_out>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem + $OPENAIR_DIR/cmake_targets/lte_build_oai/build/liboai_eth_transpro.so</compile_prog_out> <pre_exec></pre_exec> <pre_exec_args></pre_exec_args> <main_exec></main_exec> @@ -260,11 +267,13 @@ <testCase id="010140" > <class>compilation</class> - <desc>Build RRH Gateway</desc> + <desc>Build RRH Gateway for USRP(RF) + Ethernet (Transport)</desc> <pre_compile_prog></pre_compile_prog> <compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</compile_prog> - <compile_prog_args>--RRH -w USRP -c </compile_prog_args> - <compile_prog_out>$OPENAIR_DIR/cmake_targets/rrh_gw/build/rrh_gw</compile_prog_out> + <compile_prog_args>--RRH -w USRP -t ETHERNET -c </compile_prog_args> + <compile_prog_out>$OPENAIR_DIR/cmake_targets/rrh_gw/build/rrh_gw + $OPENAIR_DIR/cmake_targets/rrh_gw/build/liboai_usrpdevif.so + $OPENAIR_DIR/cmake_targets/rrh_gw/build/liboai_eth_transpro.so</compile_prog_out> <pre_exec></pre_exec> <pre_exec_args></pre_exec_args> <main_exec></main_exec> @@ -277,14 +286,16 @@ <testCase id="010141" > <class>compilation</class> - <desc>Build RRH Gateway</desc> + <desc>Build RRH Gateway for EXMIMO(RF) + Ethernet (Transport)</desc> <pre_compile_prog></pre_compile_prog> <compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</compile_prog> - <compile_prog_args>--RRH -w EXMIMO -c </compile_prog_args> + <compile_prog_args>--RRH -w EXMIMO -t ETHNERNET -c </compile_prog_args> <compile_prog_out>$OPENAIR_DIR/cmake_targets/rrh_gw/build/rrh_gw $OPENAIR_DIR/cmake_targets/rrh_gw/build/CMakeFiles/openair_rf/openair_rf.ko $OPENAIR_DIR/cmake_targets/rrh_gw/build/updatefw - $OPENAIR_DIR/cmake_targets/rrh_gw/build/oarf_config_exmimo.oct</compile_prog_out> + $OPENAIR_DIR/cmake_targets/rrh_gw/build/oarf_config_exmimo.oct + $OPENAIR_DIR/cmake_targets/rrh_gw/build/liboai_exmimodevif.so + $OPENAIR_DIR/cmake_targets/rrh_gw/build/liboai_eth_transpro.so</compile_prog_out> <pre_exec></pre_exec> <pre_exec_args></pre_exec_args> <main_exec></main_exec> @@ -300,8 +311,10 @@ <desc>Build RRH Gateway</desc> <pre_compile_prog></pre_compile_prog> <compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</compile_prog> - <compile_prog_args>--RRH -w BLADERF -c </compile_prog_args> - <compile_prog_out>$OPENAIR_DIR/cmake_targets/rrh_gw/build/rrh_gw</compile_prog_out> + <compile_prog_args>--RRH -w BLADERF -t ETHERNET -c </compile_prog_args> + <compile_prog_out>$OPENAIR_DIR/cmake_targets/rrh_gw/build/rrh_gw + $OPENAIR_DIR/cmake_targets/rrh_gw/build/liboai_bladerfdevif.so + $OPENAIR_DIR/cmake_targets/rrh_gw/build/liboai_eth_transpro.so</compile_prog_out> <pre_exec></pre_exec> <pre_exec_args></pre_exec_args> <main_exec></main_exec> @@ -316,18 +329,22 @@ <testCase id="010200"> <class>execution</class> <desc>Run OAISIM Rel10 TDD, 1 eNB + 1 UE (5 MHz/10MHz/20MHz), (TM 1,2) and search for errors, segmentation fault or exit</desc> - <pre_compile_prog></pre_compile_prog> + <pre_compile_prog>cp -vf $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf $OPENAIR_LOGDIR/enb.band7.generic.oaisim.local_no_mme.conf </pre_compile_prog> <compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</compile_prog> <compile_prog_args>--oaisim --noS1 -c </compile_prog_args> <pre_exec>$OPENAIR_DIR/cmake_targets/tools/init_nas_nos1</pre_exec> <pre_exec_args></pre_exec_args> + <test_config_file>$OPENAIR_LOGDIR/enb.band7.generic.oaisim.local_no_mme.conf frame_type \"TDD\" + $OPENAIR_LOGDIR/enb.band7.generic.oaisim.local_no_mme.conf eutra_band 38 + $OPENAIR_LOGDIR/enb.band7.generic.oaisim.local_no_mme.conf downlink_frequency 2580000000L + $OPENAIR_LOGDIR/enb.band7.generic.oaisim.local_no_mme.conf uplink_frequency_offset 0</test_config_file> <main_exec>$OPENAIR_DIR/cmake_targets/oaisim_noS1_build_oai/build/oaisim_nos1</main_exec> - <main_exec_args> -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u1 -n100 -R 25 -x 1 - -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u1 -n100 -R 50 -x 1 - -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u1 -n100 -R 100 -x 1 - -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u1 -n100 -R 25 -x 2 - -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u1 -n100 -R 50 -x 2 - -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u1 -n100 -R 100 -x 2 </main_exec_args> + <main_exec_args> -O $OPENAIR_LOGDIR/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u1 -n100 -R 25 -x 1 + -O $OPENAIR_LOGDIR/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u1 -n100 -R 50 -x 1 + -O $OPENAIR_LOGDIR/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u1 -n100 -R 100 -x 1 + -O $OPENAIR_LOGDIR/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u1 -n100 -R 25 -x 2 + -O $OPENAIR_LOGDIR/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u1 -n100 -R 50 -x 2 + -O $OPENAIR_LOGDIR/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u1 -n100 -R 100 -x 2 </main_exec_args> <tags>oaisim_noS1.tdd.5MHz.TM1 oaisim_noS1.tdd.10MHz.TM1 oaisim_noS1.tdd.20MHz.TM1 oaisim_noS1.tdd.5MHz.TM2 oaisim_noS1.tdd.10MHz.TM2 oaisim_noS1.tdd.20MHz.TM2</tags> <search_expr_true>"Received RRCConnectionReconfigurationComplete from UE 0"</search_expr_true> <search_expr_false>segmentation fault|assertion|exiting|fatal</search_expr_false> @@ -337,18 +354,22 @@ <testCase id="010201"> <class>execution</class> <desc>Run OAISIM Rel10 TDD, 1 eNB + 1 UE (5 MHz/10MHz/20MHz), (TM 1,2) in PHY_ABSTRACTION mode and search for errors, segmentation fault or exit</desc> - <pre_compile_prog></pre_compile_prog> + <pre_compile_prog>cp -vf $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf $OPENAIR_LOGDIR/enb.band7.generic.oaisim.local_no_mme.conf </pre_compile_prog> <compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</compile_prog> <compile_prog_args>--oaisim --noS1 -c </compile_prog_args> + <test_config_file>$OPENAIR_LOGDIR/enb.band7.generic.oaisim.local_no_mme.conf frame_type \"TDD\" + $OPENAIR_LOGDIR/enb.band7.generic.oaisim.local_no_mme.conf eutra_band 38 + $OPENAIR_LOGDIR/enb.band7.generic.oaisim.local_no_mme.conf downlink_frequency 2580000000L + $OPENAIR_LOGDIR/enb.band7.generic.oaisim.local_no_mme.conf uplink_frequency_offset 0</test_config_file> <pre_exec>$OPENAIR_DIR/cmake_targets/tools/init_nas_nos1</pre_exec> <pre_exec_args></pre_exec_args> <main_exec>$OPENAIR_DIR/cmake_targets/oaisim_noS1_build_oai/build/oaisim_nos1</main_exec> - <main_exec_args> -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u1 -n100 -R 25 -x 1 -a - -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u1 -n100 -R 50 -x 1 -a - -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u1 -n100 -R 100 -x 1 -a - -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u1 -n100 -R 25 -x 2 -a - -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u1 -n100 -R 50 -x 2 -a - -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u1 -n100 -R 100 -x 2 -a </main_exec_args> + <main_exec_args> -O $OPENAIR_LOGDIR/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u1 -n100 -R 25 -x 1 -a + -O $OPENAIR_LOGDIR/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u1 -n100 -R 50 -x 1 -a + -O $OPENAIR_LOGDIR/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u1 -n100 -R 100 -x 1 -a + -O $OPENAIR_LOGDIR/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u1 -n100 -R 25 -x 2 -a + -O $OPENAIR_LOGDIR/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u1 -n100 -R 50 -x 2 -a + -O $OPENAIR_LOGDIR/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u1 -n100 -R 100 -x 2 -a </main_exec_args> <tags>oaisim_noS1.tdd.5MHz.TM1 oaisim_noS1.tdd.10MHz.TM1 oaisim_noS1.tdd.20MHz.TM1 oaisim_noS1.tdd.5MHz.TM2 oaisim_noS1.tdd.10MHz.TM2 oaisim_noS1.tdd.20MHz.TM2</tags> <search_expr_true>"Received RRCConnectionReconfigurationComplete from UE 0"</search_expr_true> <search_expr_false>segmentation fault|assertion|exiting|fatal</search_expr_false> @@ -358,18 +379,22 @@ <testCase id="010202"> <class>execution</class> <desc>Run OAISIM Rel10 TDD, 1 eNB + 3 UEs (5 MHz/10MHz/20MHz), (TM 1,2) and search for errors, segmentation fault or exit</desc> - <pre_compile_prog></pre_compile_prog> +<pre_compile_prog>cp -vf $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf $OPENAIR_LOGDIR/enb.band7.generic.oaisim.local_no_mme.conf </pre_compile_prog> <compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</compile_prog> <compile_prog_args>--oaisim --noS1 -c </compile_prog_args> + <test_config_file>$OPENAIR_LOGDIR/enb.band7.generic.oaisim.local_no_mme.conf frame_type \"TDD\" + $OPENAIR_LOGDIR/enb.band7.generic.oaisim.local_no_mme.conf eutra_band 38 + $OPENAIR_LOGDIR/enb.band7.generic.oaisim.local_no_mme.conf downlink_frequency 2580000000L + $OPENAIR_LOGDIR/enb.band7.generic.oaisim.local_no_mme.conf uplink_frequency_offset 0</test_config_file> <pre_exec>$OPENAIR_DIR/cmake_targets/tools/init_nas_nos1</pre_exec> <pre_exec_args></pre_exec_args> <main_exec>$OPENAIR_DIR/cmake_targets/oaisim_noS1_build_oai/build/oaisim_nos1</main_exec> - <main_exec_args> -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 25 -x 1 - -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 50 -x 1 - -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 100 -x 1 - -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 25 -x 2 - -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 50 -x 2 - -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 100 -x 2</main_exec_args> + <main_exec_args> -O $OPENAIR_LOGDIR/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 25 -x 1 + -O $OPENAIR_LOGDIR/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 50 -x 1 + -O $OPENAIR_LOGDIR/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 100 -x 1 + -O $OPENAIR_LOGDIR/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 25 -x 2 + -O $OPENAIR_LOGDIR/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 50 -x 2 + -O $OPENAIR_LOGDIR/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 100 -x 2</main_exec_args> <tags>oaisim_noS1.tdd.5MHz.TM1 oaisim_noS1.tdd.10MHz.TM1 oaisim_noS1.tdd.20MHz.TM1 oaisim_noS1.tdd.5MHz.TM2 oaisim_noS1.tdd.10MHz.TM2 oaisim_noS1.tdd.20MHz.TM2 </tags> <search_expr_true>"Received RRCConnectionReconfigurationComplete from UE 0" "Received RRCConnectionReconfigurationComplete from UE 1" "Received RRCConnectionReconfigurationComplete from UE 2"</search_expr_true> <search_expr_false>segmentation fault|assertion|exiting|fatal</search_expr_false> @@ -379,18 +404,22 @@ <testCase id="010203"> <class>execution</class> <desc>Run OAISIM Rel10 TDD, 1 eNB + 3 UEs (5 MHz) in PHY_ABSTRACTION mode and search for errors, segmentation fault or exit</desc> - <pre_compile_prog></pre_compile_prog> + <pre_compile_prog>cp -vf $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf $OPENAIR_LOGDIR/enb.band7.generic.oaisim.local_no_mme.conf </pre_compile_prog> <compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</compile_prog> <compile_prog_args>--oaisim --noS1 -c </compile_prog_args> + <test_config_file>$OPENAIR_LOGDIR/enb.band7.generic.oaisim.local_no_mme.conf frame_type \"TDD\" + $OPENAIR_LOGDIR/enb.band7.generic.oaisim.local_no_mme.conf eutra_band 38 + $OPENAIR_LOGDIR/enb.band7.generic.oaisim.local_no_mme.conf downlink_frequency 2580000000L + $OPENAIR_LOGDIR/enb.band7.generic.oaisim.local_no_mme.conf uplink_frequency_offset 0</test_config_file> <pre_exec>$OPENAIR_DIR/cmake_targets/tools/init_nas_nos1</pre_exec> <pre_exec_args></pre_exec_args> <main_exec>$OPENAIR_DIR/cmake_targets/oaisim_noS1_build_oai/build/oaisim_nos1</main_exec> - <main_exec_args> -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 25 -x 1 -a - -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 50 -x 1 -a - -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 100 -x 1 -a - -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 25 -x 2 -a - -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 50 -x 2 -a - -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 100 -x 2 -a</main_exec_args> + <main_exec_args> -O $OPENAIR_LOGDIR/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 25 -x 1 -a + -O $OPENAIR_LOGDIR/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 50 -x 1 -a + -O $OPENAIR_LOGDIR/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 100 -x 1 -a + -O $OPENAIR_LOGDIR/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 25 -x 2 -a + -O $OPENAIR_LOGDIR/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 50 -x 2 -a + -O $OPENAIR_LOGDIR/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 100 -x 2 -a</main_exec_args> <tags>oaisim_noS1.tdd.5MHz.TM1 oaisim_noS1.tdd.10MHz.TM1 oaisim_noS1.tdd.20MHz.TM1 oaisim_noS1.tdd.5MHz.TM2 oaisim_noS1.tdd.10MHz.TM2 oaisim_nos1.tdd.20MHz.TM2</tags> <search_expr_true>"Received RRCConnectionReconfigurationComplete from UE 0" "Received RRCConnectionReconfigurationComplete from UE 1" "Received RRCConnectionReconfigurationComplete from UE 2"</search_expr_true> <search_expr_false>segmentation fault|assertion|exiting|fatal</search_expr_false> @@ -400,18 +429,22 @@ <testCase id="010204"> <class>execution</class> <desc>Run OAI Rel10 TDD, 1 eNB + 1 UE (5 MHz) without abstraction mode, send ping from from eNB to UE, and check that there is no packet losses</desc> - <pre_compile_prog></pre_compile_prog> + <pre_compile_prog>cp -vf $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf $OPENAIR_LOGDIR/enb.band7.generic.oaisim.local_no_mme.conf </pre_compile_prog> <compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</compile_prog> <compile_prog_args>--oaisim --noS1 -c </compile_prog_args> <pre_exec>$OPENAIR_DIR/cmake_targets/tools/init_nas_nos1</pre_exec> <pre_exec_args></pre_exec_args> + <test_config_file>$OPENAIR_LOGDIR/enb.band7.generic.oaisim.local_no_mme.conf frame_type \"TDD\" + $OPENAIR_LOGDIR/enb.band7.generic.oaisim.local_no_mme.conf eutra_band 38 + $OPENAIR_LOGDIR/enb.band7.generic.oaisim.local_no_mme.conf downlink_frequency 2580000000L + $OPENAIR_LOGDIR/enb.band7.generic.oaisim.local_no_mme.conf uplink_frequency_offset 0</test_config_file> <main_exec>$OPENAIR_DIR/cmake_targets/oaisim_noS1_build_oai/build/oaisim_nos1</main_exec> - <main_exec_args> -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 25 -x 1 -c26 - -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 50 -x 1 -c26 - -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 100 -x 1 -c26 - -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 25 -x 2 -c26 - -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 50 -x 2 -c26 - -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 100 -x 2 -c26</main_exec_args> + <main_exec_args> -O $OPENAIR_LOGDIR/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 25 -x 1 -c26 + -O $OPENAIR_LOGDIR/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 50 -x 1 -c26 + -O $OPENAIR_LOGDIR/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 100 -x 1 -c26 + -O $OPENAIR_LOGDIR/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 25 -x 2 -c26 + -O $OPENAIR_LOGDIR/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 50 -x 2 -c26 + -O $OPENAIR_LOGDIR/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 100 -x 2 -c26</main_exec_args> <tags>oaisim_noS1.tdd.5MHz.TM1 oaisim_noS1.tdd.10MHz.TM1 oaisim_noS1.tdd.20MHz.TM1 oaisim_noS1.tdd.5MHz.TM2 oaisim_noS1.tdd.10MHz.TM2 oaisim_noS1.tdd.20MHz.TM2 </tags> <search_expr_true>"DL and UL loss rate below 10"</search_expr_true> <search_expr_false>segmentation fault|assertion|exiting|fatal</search_expr_false> @@ -421,18 +454,22 @@ <testCase id="010205"> <class>execution</class> <desc>Run OAI Rel10 TDD, 1 eNB + 1 UE (5 MHz) in PHY_ABSTRACTION mode, send ping from from eNB to UE, and check that there is no packet losses</desc> - <pre_compile_prog></pre_compile_prog> + <pre_compile_prog>cp -vf $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf $OPENAIR_LOGDIR/enb.band7.generic.oaisim.local_no_mme.conf </pre_compile_prog> <compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</compile_prog> <compile_prog_args>--oaisim --noS1 -c </compile_prog_args> <pre_exec>$OPENAIR_DIR/cmake_targets/tools/init_nas_nos1</pre_exec> <pre_exec_args></pre_exec_args> + <test_config_file>$OPENAIR_LOGDIR/enb.band7.generic.oaisim.local_no_mme.conf frame_type \"TDD\" + $OPENAIR_LOGDIR/enb.band7.generic.oaisim.local_no_mme.conf eutra_band 38 + $OPENAIR_LOGDIR/enb.band7.generic.oaisim.local_no_mme.conf downlink_frequency 2580000000L + $OPENAIR_LOGDIR/enb.band7.generic.oaisim.local_no_mme.conf uplink_frequency_offset 0</test_config_file> <main_exec>$OPENAIR_DIR/cmake_targets/oaisim_noS1_build_oai/build/oaisim_nos1</main_exec> - <main_exec_args> -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 25 -x 1 -c26 -a - -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 50 -x 1 -c26 -a - -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 100 -x 1 -c26 -a - -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 25 -x 2 -c26 -a - -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 50 -x 2 -c26 -a - -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 100 -x 2 -c26 -a</main_exec_args> + <main_exec_args> -O $OPENAIR_LOGDIR/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 25 -x 1 -c26 -a + -O $OPENAIR_LOGDIR/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 50 -x 1 -c26 -a + -O $OPENAIR_LOGDIR/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 100 -x 1 -c26 -a + -O $OPENAIR_LOGDIR/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 25 -x 2 -c26 -a + -O $OPENAIR_LOGDIR/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 50 -x 2 -c26 -a + -O $OPENAIR_LOGDIR/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 100 -x 2 -c26 -a</main_exec_args> <tags>oaisim_noS1.tdd.5MHz.TM1 oaisim_noS1.tdd.10MHz.TM1 oaisim_noS1.tdd.20MHz.TM1 oaisim_noS1.tdd.5MHz.TM2 oaisim_noS1.tdd.10MHz.TM2 oaisim_noS1.tdd.20MHz.TM2 </tags> <search_expr_true>"DL and UL loss rate below 10"</search_expr_true> <search_expr_false>segmentation fault|assertion|exiting|fatal</search_expr_false> @@ -858,12 +895,9 @@ <eNB>calisson</eNB> <UE>stevens</UE> <EPC>amerique</EPC> - <TimeOut_cmd>360</TimeOut_cmd> + <TimeOut_cmd>390</TimeOut_cmd> <eNB_working_dir>/tmp</eNB_working_dir> - <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf tracking_area_code \"1\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_country_code \"208\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_network_code \"92\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tracking_area_code \"1\" + <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tracking_area_code \"1\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_country_code \"208\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_network_code \"92\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf N_RB_DL 25 @@ -871,13 +905,13 @@ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf downlink_frequency 2660000000L targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf uplink_frequency_offset -120000000 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tx_gain 90 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf rx_gain 130 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf rx_gain 125 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf frame_type \"FDD\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_rx 1 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_tx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1U \"eth1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_PORT_FOR_S1U 2152</eNB_config_file> <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog> @@ -885,40 +919,34 @@ <eNB_pre_exec></eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf </eNB_main_exec_args> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf -W </eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> <eNB_search_expr_false></eNB_search_expr_false> - <eNB_terminate_missing_procs>True</eNB_terminate_missing_procs> + <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs> <UE_working_dir>/tmp</UE_working_dir> - <UE_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf tracking_area_code \"4\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_country_code \"5\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_network_code \"6\"</UE_config_file> - <UE_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog> - <UE_compile_prog_args>--eNB -w USRP -x -c </UE_compile_prog_args> + <UE_config_file></UE_config_file> + <UE_compile_prog></UE_compile_prog> + <UE_compile_prog_args></UE_compile_prog_args> <UE_pre_exec></UE_pre_exec> <UE_pre_exec_args></UE_pre_exec_args> - <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 45; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> + <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> <UE_main_exec_args></UE_main_exec_args> - <UE_traffic_exec>while true; do var=`ifconfig ppp0` ;sleep 1; if [ "$var" != "" ]; then break; fi ; done ; sleep 5; iperf -u -c 192.172.0.1 -b 10Mbits/s -t 300 -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 10Mbits/s -B 192.172.0.2</UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> <UE_search_expr_true></UE_search_expr_true> <UE_search_expr_false></UE_search_expr_false> - <UE_terminate_missing_procs>True</UE_terminate_missing_procs> + <UE_terminate_missing_procs>False</UE_terminate_missing_procs> <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue </UE_stop_script> <EPC_working_dir>/tmp</EPC_working_dir> - <EPC_config_file>BUILD/EPC/epc.local.enb.conf.in MCC \"208\" - BUILD/EPC/epc.local.enb.conf.in MNC \"92\" - BUILD/EPC/epc.local.enb.conf.in TAC \"1\" - BUILD/EPC/epc.local.enb.conf.in PGW_INTERFACE_NAME_FOR_SGI \"eth1\" - BUILD/EPC/epc.local.enb.conf.in PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.82/24\" </EPC_config_file> - <EPC_compile_prog>SCRIPTS/build_epc</EPC_compile_prog> - <EPC_compile_prog_args>-c -l</EPC_compile_prog_args> - <HSS_compile_prog>SCRIPTS/build_hss</HSS_compile_prog> - <HSS_compile_prog_args> -c -l </HSS_compile_prog_args> + <EPC_config_file></EPC_config_file> + <EPC_compile_prog></EPC_compile_prog> + <EPC_compile_prog_args></EPC_compile_prog_args> + <HSS_compile_prog></HSS_compile_prog> + <HSS_compile_prog_args></HSS_compile_prog_args> <EPC_pre_exec></EPC_pre_exec> <EPC_pre_exec_args></EPC_pre_exec_args> @@ -926,11 +954,11 @@ <EPC_main_exec_args></EPC_main_exec_args> <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec> <HSS_main_exec_args></HSS_main_exec_args> - <EPC_traffic_exec>sleep 5; iperf -s -i 1 -u -f m -B 192.172.0.1</EPC_traffic_exec> + <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m -B 192.172.0.1</EPC_traffic_exec> <EPC_traffic_exec_args></EPC_traffic_exec_args> - <EPC_search_expr_true>throughput_test min=1.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec duration=300.0s </EPC_search_expr_true> + <EPC_search_expr_true>throughput_test min=1.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec </EPC_search_expr_true> <EPC_search_expr_false></EPC_search_expr_false> - <EPC_terminate_missing_procs>True</EPC_terminate_missing_procs> + <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs> <tags>USRPb210.ALU_EPC.Bandrich.5MHz.FDD.Band_7.UL.1TX.1RX</tags> <nruns>10</nruns> </testCase> @@ -942,12 +970,9 @@ <eNB>calisson</eNB> <UE>stevens</UE> <EPC>amerique</EPC> - <TimeOut_cmd>360</TimeOut_cmd> + <TimeOut_cmd>390</TimeOut_cmd> <eNB_working_dir>/tmp</eNB_working_dir> - <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf tracking_area_code \"1\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_country_code \"208\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_network_code \"92\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tracking_area_code \"1\" + <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tracking_area_code \"1\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_country_code \"208\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_network_code \"92\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf N_RB_DL 50 @@ -955,13 +980,13 @@ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf downlink_frequency 2660000000L targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf uplink_frequency_offset -120000000 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tx_gain 90 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf rx_gain 130 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf rx_gain 125 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf frame_type \"FDD\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_rx 1 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_tx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1U \"eth1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_PORT_FOR_S1U 2152</eNB_config_file> <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog> @@ -969,7 +994,7 @@ <eNB_pre_exec></eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf </eNB_main_exec_args> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf -W </eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> @@ -977,16 +1002,14 @@ <eNB_terminate_missing_procs>True</eNB_terminate_missing_procs> <UE_working_dir>/tmp</UE_working_dir> - <UE_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf tracking_area_code \"4\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_country_code \"5\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_network_code \"6\"</UE_config_file> - <UE_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog> - <UE_compile_prog_args>--eNB -w USRP -x -c </UE_compile_prog_args> + <UE_config_file></UE_config_file> + <UE_compile_prog></UE_compile_prog> + <UE_compile_prog_args></UE_compile_prog_args> <UE_pre_exec></UE_pre_exec> <UE_pre_exec_args></UE_pre_exec_args> - <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 45; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> + <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> <UE_main_exec_args></UE_main_exec_args> - <UE_traffic_exec>while true; do var=`ifconfig ppp0` ;sleep 1; if [ "$var" != "" ]; then break; fi ; done ; sleep 5; iperf -u -c 192.172.0.1 -b 10Mbits/s -t 300 -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 10Mbits/s -B 192.172.0.2</UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> <UE_search_expr_true></UE_search_expr_true> <UE_search_expr_false></UE_search_expr_false> @@ -994,15 +1017,11 @@ <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue </UE_stop_script> <EPC_working_dir>/tmp</EPC_working_dir> - <EPC_config_file>BUILD/EPC/epc.local.enb.conf.in MCC \"208\" - BUILD/EPC/epc.local.enb.conf.in MNC \"92\" - BUILD/EPC/epc.local.enb.conf.in TAC \"1\" - BUILD/EPC/epc.local.enb.conf.in PGW_INTERFACE_NAME_FOR_SGI \"eth1\" - BUILD/EPC/epc.local.enb.conf.in PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.82/24\" </EPC_config_file> - <EPC_compile_prog>SCRIPTS/build_epc</EPC_compile_prog> - <EPC_compile_prog_args>-c -l</EPC_compile_prog_args> - <HSS_compile_prog>SCRIPTS/build_hss</HSS_compile_prog> - <HSS_compile_prog_args> -c -l </HSS_compile_prog_args> + <EPC_config_file></EPC_config_file> + <EPC_compile_prog></EPC_compile_prog> + <EPC_compile_prog_args></EPC_compile_prog_args> + <HSS_compile_prog></HSS_compile_prog> + <HSS_compile_prog_args></HSS_compile_prog_args> <EPC_pre_exec></EPC_pre_exec> <EPC_pre_exec_args></EPC_pre_exec_args> @@ -1010,9 +1029,9 @@ <EPC_main_exec_args></EPC_main_exec_args> <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec> <HSS_main_exec_args></HSS_main_exec_args> - <EPC_traffic_exec>sleep 5; iperf -s -i 1 -u -f m -B 192.172.0.1</EPC_traffic_exec> + <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m -B 192.172.0.1</EPC_traffic_exec> <EPC_traffic_exec_args></EPC_traffic_exec_args> - <EPC_search_expr_true>throughput_test min=2.0Mbits/sec max=2.0Mbits/sec average=2.0Mbits/sec duration=300.0s </EPC_search_expr_true> + <EPC_search_expr_true>throughput_test min=1.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec </EPC_search_expr_true> <EPC_search_expr_false></EPC_search_expr_false> <EPC_terminate_missing_procs>True</EPC_terminate_missing_procs> <tags>USRPb210.ALU_EPC.Bandrich.10MHz.FDD.Band_7.UL.1TX.1RX</tags> @@ -1025,12 +1044,9 @@ <eNB>calisson</eNB> <UE>stevens</UE> <EPC>amerique</EPC> - <TimeOut_cmd>360</TimeOut_cmd> + <TimeOut_cmd>390</TimeOut_cmd> <eNB_working_dir>/tmp</eNB_working_dir> - <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf tracking_area_code \"1\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_country_code \"208\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_network_code \"92\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tracking_area_code \"1\" + <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tracking_area_code \"1\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_country_code \"208\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_network_code \"92\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf N_RB_DL 100 @@ -1038,13 +1054,13 @@ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf downlink_frequency 2660000000L targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf uplink_frequency_offset -120000000 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tx_gain 90 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf rx_gain 130 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf rx_gain 125 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf frame_type \"FDD\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_rx 1 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_tx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1U \"eth1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_PORT_FOR_S1U 2152</eNB_config_file> <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog> @@ -1052,7 +1068,7 @@ <eNB_pre_exec></eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf </eNB_main_exec_args> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf -W </eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> @@ -1060,16 +1076,14 @@ <eNB_terminate_missing_procs>True</eNB_terminate_missing_procs> <UE_working_dir>/tmp</UE_working_dir> - <UE_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf tracking_area_code \"4\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_country_code \"5\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_network_code \"6\"</UE_config_file> - <UE_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog> - <UE_compile_prog_args>--eNB -w USRP -x -c </UE_compile_prog_args> + <UE_config_file></UE_config_file> + <UE_compile_prog></UE_compile_prog> + <UE_compile_prog_args></UE_compile_prog_args> <UE_pre_exec></UE_pre_exec> <UE_pre_exec_args></UE_pre_exec_args> - <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 45; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> + <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> <UE_main_exec_args></UE_main_exec_args> - <UE_traffic_exec>while true; do var=`ifconfig ppp0` ;sleep 1; if [ "$var" != "" ]; then break; fi ; done ; sleep 5; iperf -u -c 192.172.0.1 -b 10Mbits/s -t 300 -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 10Mbits/s -B 192.172.0.2</UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> <UE_search_expr_true></UE_search_expr_true> <UE_search_expr_false></UE_search_expr_false> @@ -1077,15 +1091,11 @@ <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue </UE_stop_script> <EPC_working_dir>/tmp</EPC_working_dir> - <EPC_config_file>BUILD/EPC/epc.local.enb.conf.in MCC \"208\" - BUILD/EPC/epc.local.enb.conf.in MNC \"92\" - BUILD/EPC/epc.local.enb.conf.in TAC \"1\" - BUILD/EPC/epc.local.enb.conf.in PGW_INTERFACE_NAME_FOR_SGI \"eth1\" - BUILD/EPC/epc.local.enb.conf.in PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.82/24\" </EPC_config_file> - <EPC_compile_prog>SCRIPTS/build_epc</EPC_compile_prog> - <EPC_compile_prog_args>-c -l</EPC_compile_prog_args> - <HSS_compile_prog>SCRIPTS/build_hss</HSS_compile_prog> - <HSS_compile_prog_args> -c -l </HSS_compile_prog_args> + <EPC_config_file></EPC_config_file> + <EPC_compile_prog></EPC_compile_prog> + <EPC_compile_prog_args></EPC_compile_prog_args> + <HSS_compile_prog></HSS_compile_prog> + <HSS_compile_prog_args></HSS_compile_prog_args> <EPC_pre_exec></EPC_pre_exec> <EPC_pre_exec_args></EPC_pre_exec_args> @@ -1093,9 +1103,9 @@ <EPC_main_exec_args></EPC_main_exec_args> <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec> <HSS_main_exec_args></HSS_main_exec_args> - <EPC_traffic_exec>sleep 5; iperf -s -i 1 -u -f m -B 192.172.0.1</EPC_traffic_exec> + <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m -B 192.172.0.1</EPC_traffic_exec> <EPC_traffic_exec_args></EPC_traffic_exec_args> - <EPC_search_expr_true>throughput_test min=4.0Mbits/sec max=4.0Mbits/sec average=4.0Mbits/sec duration=300.0s </EPC_search_expr_true> + <EPC_search_expr_true>throughput_test min=1.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec </EPC_search_expr_true> <EPC_search_expr_false></EPC_search_expr_false> <EPC_terminate_missing_procs>True</EPC_terminate_missing_procs> <tags>USRPb210.ALU_EPC.Bandrich.20MHz.FDD.Band_7.UL.1TX.1RX</tags> @@ -1108,12 +1118,9 @@ <eNB>calisson</eNB> <UE>stevens</UE> <EPC>amerique</EPC> - <TimeOut_cmd>360</TimeOut_cmd> + <TimeOut_cmd>390</TimeOut_cmd> <eNB_working_dir>/tmp</eNB_working_dir> - <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf tracking_area_code \"1\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_country_code \"208\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_network_code \"92\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tracking_area_code \"1\" + <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tracking_area_code \"1\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_country_code \"208\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_network_code \"92\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf N_RB_DL 25 @@ -1121,13 +1128,13 @@ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf downlink_frequency 2660000000L targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf uplink_frequency_offset -120000000 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tx_gain 90 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf rx_gain 130 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf rx_gain 125 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf frame_type \"FDD\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_rx 1 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_tx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1U \"eth1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_PORT_FOR_S1U 2152</eNB_config_file> <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog> @@ -1135,7 +1142,7 @@ <eNB_pre_exec></eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf </eNB_main_exec_args> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf -W </eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> @@ -1143,32 +1150,26 @@ <eNB_terminate_missing_procs>True</eNB_terminate_missing_procs> <UE_working_dir>/tmp</UE_working_dir> - <UE_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf tracking_area_code \"4\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_country_code \"5\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_network_code \"6\"</UE_config_file> - <UE_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog> - <UE_compile_prog_args>--eNB -w USRP -x -c </UE_compile_prog_args> + <UE_config_file></UE_config_file> + <UE_compile_prog></UE_compile_prog> + <UE_compile_prog_args></UE_compile_prog_args> <UE_pre_exec></UE_pre_exec> <UE_pre_exec_args></UE_pre_exec_args> - <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 45; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> + <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> <UE_main_exec_args></UE_main_exec_args> - <UE_traffic_exec>while true; do var=`ifconfig ppp0` ;sleep 1; if [ "$var" != "" ]; then break; fi ; done ; sleep 5; iperf -s -i 1 -u -f m -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m -B 192.172.0.2</UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> <UE_terminate_missing_procs>True</UE_terminate_missing_procs> <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue </UE_stop_script> - <UE_search_expr_true>throughput_test min=4.0Mbits/sec max=5.0Mbits/sec average=4.0Mbits/sec duration=60.0s </UE_search_expr_true> + <UE_search_expr_true>throughput_test min=4.0Mbits/sec max=5.0Mbits/sec average=4.0Mbits/sec </UE_search_expr_true> <UE_search_expr_false></UE_search_expr_false> <EPC_working_dir>/tmp</EPC_working_dir> - <EPC_config_file>BUILD/EPC/epc.local.enb.conf.in MCC \"208\" - BUILD/EPC/epc.local.enb.conf.in MNC \"92\" - BUILD/EPC/epc.local.enb.conf.in TAC \"1\" - BUILD/EPC/epc.local.enb.conf.in PGW_INTERFACE_NAME_FOR_SGI \"eth1\" - BUILD/EPC/epc.local.enb.conf.in PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.82/24\" </EPC_config_file> - <EPC_compile_prog>SCRIPTS/build_epc</EPC_compile_prog> - <EPC_compile_prog_args>-c -l</EPC_compile_prog_args> - <HSS_compile_prog>SCRIPTS/build_hss</HSS_compile_prog> - <HSS_compile_prog_args> -c -l </HSS_compile_prog_args> + <EPC_config_file></EPC_config_file> + <EPC_compile_prog></EPC_compile_prog> + <EPC_compile_prog_args></EPC_compile_prog_args> + <HSS_compile_prog></HSS_compile_prog> + <HSS_compile_prog_args></HSS_compile_prog_args> <EPC_pre_exec></EPC_pre_exec> <EPC_pre_exec_args></EPC_pre_exec_args> @@ -1176,7 +1177,7 @@ <EPC_main_exec_args></EPC_main_exec_args> <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec> <HSS_main_exec_args></HSS_main_exec_args> - <EPC_traffic_exec>sleep 60; iperf -u -c 192.172.0.2 -b 10Mbits/s -t 300 -B 192.172.0.1</EPC_traffic_exec> + <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s -B 192.172.0.1</EPC_traffic_exec> <EPC_traffic_exec_args></EPC_traffic_exec_args> <EPC_search_expr_false></EPC_search_expr_false> <EPC_terminate_missing_procs>True</EPC_terminate_missing_procs> @@ -1190,12 +1191,9 @@ <eNB>calisson</eNB> <UE>stevens</UE> <EPC>amerique</EPC> - <TimeOut_cmd>360</TimeOut_cmd> + <TimeOut_cmd>390</TimeOut_cmd> <eNB_working_dir>/tmp</eNB_working_dir> - <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf tracking_area_code \"1\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_country_code \"208\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_network_code \"92\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tracking_area_code \"1\" + <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tracking_area_code \"1\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_country_code \"208\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_network_code \"92\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf N_RB_DL 50 @@ -1203,13 +1201,13 @@ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf downlink_frequency 2660000000L targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf uplink_frequency_offset -120000000 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tx_gain 90 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf rx_gain 130 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf rx_gain 125 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf frame_type \"FDD\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_rx 1 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_tx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1U \"eth1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_PORT_FOR_S1U 2152</eNB_config_file> <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog> @@ -1217,7 +1215,7 @@ <eNB_pre_exec></eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf </eNB_main_exec_args> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf -W </eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> @@ -1225,33 +1223,26 @@ <eNB_terminate_missing_procs>True</eNB_terminate_missing_procs> <UE_working_dir>/tmp</UE_working_dir> - <UE_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf tracking_area_code \"4\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_country_code \"5\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_network_code \"6\"</UE_config_file> - <UE_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog> - <UE_compile_prog_args>--eNB -w USRP -x -c </UE_compile_prog_args> + <UE_config_file></UE_config_file> + <UE_compile_prog_args></UE_compile_prog_args> <UE_pre_exec></UE_pre_exec> <UE_pre_exec_args></UE_pre_exec_args> - <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 45; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> + <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> <UE_main_exec_args></UE_main_exec_args> - <UE_traffic_exec>while true; do var=`ifconfig ppp0` ;sleep 1; if [ "$var" != "" ]; then break; fi ; done ; sleep 5; iperf -s -i 1 -u -f m -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m -B 192.172.0.2</UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> - <UE_search_expr_true>throughput_test min=8.0Mbits/sec max=9.0Mbits/sec average=8.5Mbits/sec duration=300.0s </UE_search_expr_true> + <UE_search_expr_true>throughput_test min=8.0Mbits/sec max=9.0Mbits/sec average=8.5Mbits/sec </UE_search_expr_true> <UE_search_expr_false></UE_search_expr_false> <UE_terminate_missing_procs>True</UE_terminate_missing_procs> <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue </UE_stop_script> <EPC_working_dir>/tmp</EPC_working_dir> - <EPC_config_file>BUILD/EPC/epc.local.enb.conf.in MCC \"208\" - BUILD/EPC/epc.local.enb.conf.in MNC \"92\" - BUILD/EPC/epc.local.enb.conf.in TAC \"1\" - BUILD/EPC/epc.local.enb.conf.in PGW_INTERFACE_NAME_FOR_SGI \"eth1\" - BUILD/EPC/epc.local.enb.conf.in PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.82/24\" </EPC_config_file> - <EPC_compile_prog>SCRIPTS/build_epc</EPC_compile_prog> - <EPC_compile_prog_args>-c -l</EPC_compile_prog_args> - <HSS_compile_prog>SCRIPTS/build_hss</HSS_compile_prog> - <HSS_compile_prog_args> -c -l </HSS_compile_prog_args> + <EPC_config_file></EPC_config_file> + <EPC_compile_prog></EPC_compile_prog> + <EPC_compile_prog_args></EPC_compile_prog_args> + <HSS_compile_prog></HSS_compile_prog> + <HSS_compile_prog_args></HSS_compile_prog_args> <EPC_pre_exec></EPC_pre_exec> <EPC_pre_exec_args></EPC_pre_exec_args> @@ -1259,7 +1250,7 @@ <EPC_main_exec_args></EPC_main_exec_args> <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec> <HSS_main_exec_args></HSS_main_exec_args> - <EPC_traffic_exec>sleep 60; iperf -u -c 192.172.0.2 -b 10Mbits/s -t 300 -B 192.172.0.1</EPC_traffic_exec> + <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s -B 192.172.0.1</EPC_traffic_exec> <EPC_traffic_exec_args></EPC_traffic_exec_args> <EPC_search_expr_false></EPC_search_expr_false> <EPC_terminate_missing_procs>True</EPC_terminate_missing_procs> @@ -1273,12 +1264,9 @@ <eNB>calisson</eNB> <UE>stevens</UE> <EPC>amerique</EPC> - <TimeOut_cmd>360</TimeOut_cmd> + <TimeOut_cmd>390</TimeOut_cmd> <eNB_working_dir>/tmp</eNB_working_dir> - <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf tracking_area_code \"1\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_country_code \"208\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_network_code \"92\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tracking_area_code \"1\" + <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tracking_area_code \"1\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_country_code \"208\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_network_code \"92\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf N_RB_DL 100 @@ -1286,13 +1274,13 @@ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf downlink_frequency 2660000000L targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf uplink_frequency_offset -120000000 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tx_gain 90 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf rx_gain 130 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf rx_gain 125 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf frame_type \"FDD\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_rx 1 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_tx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1U \"eth1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_PORT_FOR_S1U 2152</eNB_config_file> <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog> @@ -1300,7 +1288,7 @@ <eNB_pre_exec></eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf </eNB_main_exec_args> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf -W </eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> @@ -1308,33 +1296,27 @@ <eNB_terminate_missing_procs>True</eNB_terminate_missing_procs> <UE_working_dir>/tmp</UE_working_dir> - <UE_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf tracking_area_code \"4\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_country_code \"5\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_network_code \"6\"</UE_config_file> - <UE_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog> - <UE_compile_prog_args>--eNB -w USRP -x -c </UE_compile_prog_args> + <UE_config_file></UE_config_file> + <UE_compile_prog></UE_compile_prog> + <UE_compile_prog_args></UE_compile_prog_args> <UE_pre_exec></UE_pre_exec> <UE_pre_exec_args></UE_pre_exec_args> - <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 45; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> + <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> <UE_main_exec_args></UE_main_exec_args> - <UE_traffic_exec>while true; do var=`ifconfig ppp0` ;sleep 1; if [ "$var" != "" ]; then break; fi ; done ; sleep 5; iperf -s -i 1 -u -f m -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m -B 192.172.0.2</UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> - <UE_search_expr_true>throughput_test min=15.0Mbits/sec max=15.0Mbits/sec average=15.0Mbits/sec duration=300.0s </UE_search_expr_true> + <UE_search_expr_true>throughput_test min=15.0Mbits/sec max=15.0Mbits/sec average=15.0Mbits/sec </UE_search_expr_true> <UE_search_expr_false></UE_search_expr_false> <UE_terminate_missing_procs>True</UE_terminate_missing_procs> <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue </UE_stop_script> <EPC_working_dir>/tmp</EPC_working_dir> - <EPC_config_file>BUILD/EPC/epc.local.enb.conf.in MCC \"208\" - BUILD/EPC/epc.local.enb.conf.in MNC \"92\" - BUILD/EPC/epc.local.enb.conf.in TAC \"1\" - BUILD/EPC/epc.local.enb.conf.in PGW_INTERFACE_NAME_FOR_SGI \"eth1\" - BUILD/EPC/epc.local.enb.conf.in PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.82/24\" </EPC_config_file> - <EPC_compile_prog>SCRIPTS/build_epc</EPC_compile_prog> - <EPC_compile_prog_args>-c -l</EPC_compile_prog_args> - <HSS_compile_prog>SCRIPTS/build_hss</HSS_compile_prog> - <HSS_compile_prog_args> -c -l </HSS_compile_prog_args> + <EPC_config_file></EPC_config_file> + <EPC_compile_prog></EPC_compile_prog> + <EPC_compile_prog_args></EPC_compile_prog_args> + <HSS_compile_prog></HSS_compile_prog> + <HSS_compile_prog_args></HSS_compile_prog_args> <EPC_pre_exec></EPC_pre_exec> <EPC_pre_exec_args></EPC_pre_exec_args> @@ -1342,7 +1324,7 @@ <EPC_main_exec_args></EPC_main_exec_args> <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec> <HSS_main_exec_args></HSS_main_exec_args> - <EPC_traffic_exec>sleep 60; iperf -u -c 192.172.0.2 -b 10Mbits/s -t 300 -B 192.172.0.1</EPC_traffic_exec> + <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s -B 192.172.0.1</EPC_traffic_exec> <EPC_traffic_exec_args></EPC_traffic_exec_args> <EPC_search_expr_false></EPC_search_expr_false> <EPC_terminate_missing_procs>True</EPC_terminate_missing_procs> @@ -1357,12 +1339,9 @@ <eNB>calisson</eNB> <UE>stevens</UE> <EPC>amerique</EPC> - <TimeOut_cmd>360</TimeOut_cmd> + <TimeOut_cmd>390</TimeOut_cmd> <eNB_working_dir>/tmp</eNB_working_dir> - <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf tracking_area_code \"1\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_country_code \"208\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_network_code \"92\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tracking_area_code \"1\" + <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tracking_area_code \"1\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_country_code \"208\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_network_code \"92\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf N_RB_DL 25 @@ -1370,13 +1349,13 @@ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf downlink_frequency 2660000000L targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf uplink_frequency_offset -120000000 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tx_gain 90 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf rx_gain 130 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf rx_gain 125 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf frame_type \"FDD\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_rx 2 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_tx 2 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1U \"eth1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_PORT_FOR_S1U 2152</eNB_config_file> <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog> @@ -1384,7 +1363,7 @@ <eNB_pre_exec></eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf </eNB_main_exec_args> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf -W </eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> @@ -1392,16 +1371,14 @@ <eNB_terminate_missing_procs>True</eNB_terminate_missing_procs> <UE_working_dir>/tmp</UE_working_dir> - <UE_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf tracking_area_code \"4\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_country_code \"5\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_network_code \"6\"</UE_config_file> - <UE_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog> - <UE_compile_prog_args>--eNB -w USRP -x -c </UE_compile_prog_args> + <UE_config_file></UE_config_file> + <UE_compile_prog></UE_compile_prog> + <UE_compile_prog_args></UE_compile_prog_args> <UE_pre_exec></UE_pre_exec> <UE_pre_exec_args></UE_pre_exec_args> - <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 45; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> + <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue;$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> <UE_main_exec_args></UE_main_exec_args> - <UE_traffic_exec>while true; do var=`ifconfig ppp0` ;sleep 1; if [ "$var" != "" ]; then break; fi ; done ; sleep 5; iperf -u -c 192.172.0.1 -b 10Mbits/s -t 300 -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 10Mbits/s -B 192.172.0.2</UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> <UE_search_expr_true></UE_search_expr_true> <UE_search_expr_false></UE_search_expr_false> @@ -1409,15 +1386,11 @@ <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue </UE_stop_script> <EPC_working_dir>/tmp</EPC_working_dir> - <EPC_config_file>BUILD/EPC/epc.local.enb.conf.in MCC \"208\" - BUILD/EPC/epc.local.enb.conf.in MNC \"92\" - BUILD/EPC/epc.local.enb.conf.in TAC \"1\" - BUILD/EPC/epc.local.enb.conf.in PGW_INTERFACE_NAME_FOR_SGI \"eth1\" - BUILD/EPC/epc.local.enb.conf.in PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.82/24\" </EPC_config_file> - <EPC_compile_prog>SCRIPTS/build_epc</EPC_compile_prog> - <EPC_compile_prog_args>-c -l</EPC_compile_prog_args> - <HSS_compile_prog>SCRIPTS/build_hss</HSS_compile_prog> - <HSS_compile_prog_args> -c -l </HSS_compile_prog_args> + <EPC_config_file></EPC_config_file> + <EPC_compile_prog></EPC_compile_prog> + <EPC_compile_prog_args></EPC_compile_prog_args> + <HSS_compile_prog></HSS_compile_prog> + <HSS_compile_prog_args></HSS_compile_prog_args> <EPC_pre_exec></EPC_pre_exec> <EPC_pre_exec_args></EPC_pre_exec_args> @@ -1425,9 +1398,9 @@ <EPC_main_exec_args></EPC_main_exec_args> <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec> <HSS_main_exec_args></HSS_main_exec_args> - <EPC_traffic_exec>sleep 5; iperf -s -i 1 -u -f m -B 192.172.0.1</EPC_traffic_exec> + <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo iperf -s -i 1 -u -f m -B 192.172.0.1</EPC_traffic_exec> <EPC_traffic_exec_args></EPC_traffic_exec_args> - <EPC_search_expr_true>throughput_test min=1.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec duration=300.0s </EPC_search_expr_true> + <EPC_search_expr_true>throughput_test min=1.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec </EPC_search_expr_true> <EPC_search_expr_false></EPC_search_expr_false> <EPC_terminate_missing_procs>True</EPC_terminate_missing_procs> <tags>USRPb210.ALU_EPC.Bandrich.5MHz.FDD.Band_7.UL.2TX.2RX</tags> @@ -1441,12 +1414,9 @@ <eNB>calisson</eNB> <UE>stevens</UE> <EPC>amerique</EPC> - <TimeOut_cmd>360</TimeOut_cmd> + <TimeOut_cmd>390</TimeOut_cmd> <eNB_working_dir>/tmp</eNB_working_dir> - <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf tracking_area_code \"1\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_country_code \"208\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_network_code \"92\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tracking_area_code \"1\" + <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tracking_area_code \"1\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_country_code \"208\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_network_code \"92\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf N_RB_DL 50 @@ -1454,13 +1424,13 @@ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf downlink_frequency 2660000000L targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf uplink_frequency_offset -120000000 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tx_gain 90 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf rx_gain 130 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf rx_gain 125 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf frame_type \"FDD\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_rx 2 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_tx 2 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1U \"eth1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_PORT_FOR_S1U 2152</eNB_config_file> <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog> @@ -1468,7 +1438,7 @@ <eNB_pre_exec></eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf </eNB_main_exec_args> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf -W </eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> @@ -1476,16 +1446,13 @@ <eNB_terminate_missing_procs>True</eNB_terminate_missing_procs> <UE_working_dir>/tmp</UE_working_dir> - <UE_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf tracking_area_code \"4\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_country_code \"5\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_network_code \"6\"</UE_config_file> - <UE_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog> - <UE_compile_prog_args>--eNB -w USRP -x -c </UE_compile_prog_args> + <UE_config_file></UE_config_file>> + <UE_compile_prog_args></UE_compile_prog_args> <UE_pre_exec></UE_pre_exec> <UE_pre_exec_args></UE_pre_exec_args> - <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 45; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> + <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue;$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> <UE_main_exec_args></UE_main_exec_args> - <UE_traffic_exec>while true; do var=`ifconfig ppp0` ;sleep 1; if [ "$var" != "" ]; then break; fi ; done ; sleep 5; iperf -u -c 192.172.0.1 -b 10Mbits/s -t 300 -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 10Mbits/s -B 192.172.0.2</UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> <UE_search_expr_true></UE_search_expr_true> <UE_search_expr_false></UE_search_expr_false> @@ -1493,15 +1460,11 @@ <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue </UE_stop_script> <EPC_working_dir>/tmp</EPC_working_dir> - <EPC_config_file>BUILD/EPC/epc.local.enb.conf.in MCC \"208\" - BUILD/EPC/epc.local.enb.conf.in MNC \"92\" - BUILD/EPC/epc.local.enb.conf.in TAC \"1\" - BUILD/EPC/epc.local.enb.conf.in PGW_INTERFACE_NAME_FOR_SGI \"eth1\" - BUILD/EPC/epc.local.enb.conf.in PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.82/24\" </EPC_config_file> - <EPC_compile_prog>SCRIPTS/build_epc</EPC_compile_prog> - <EPC_compile_prog_args>-c -l</EPC_compile_prog_args> - <HSS_compile_prog>SCRIPTS/build_hss</HSS_compile_prog> - <HSS_compile_prog_args> -c -l </HSS_compile_prog_args> + <EPC_config_file></EPC_config_file> + <EPC_compile_prog></EPC_compile_prog> + <EPC_compile_prog_args></EPC_compile_prog_args> + <HSS_compile_prog></HSS_compile_prog> + <HSS_compile_prog_args></HSS_compile_prog_args> <EPC_pre_exec></EPC_pre_exec> <EPC_pre_exec_args></EPC_pre_exec_args> @@ -1509,9 +1472,9 @@ <EPC_main_exec_args></EPC_main_exec_args> <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec> <HSS_main_exec_args></HSS_main_exec_args> - <EPC_traffic_exec>sleep 5; iperf -s -i 1 -u -f m -B 192.172.0.1</EPC_traffic_exec> + <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m -B 192.172.0.1</EPC_traffic_exec> <EPC_traffic_exec_args></EPC_traffic_exec_args> - <EPC_search_expr_true>throughput_test min=2.0Mbits/sec max=2.0Mbits/sec average=2.0Mbits/sec duration=300.0s </EPC_search_expr_true> + <EPC_search_expr_true>throughput_test min=2.0Mbits/sec max=2.0Mbits/sec average=2.0Mbits/sec </EPC_search_expr_true> <EPC_search_expr_false></EPC_search_expr_false> <EPC_terminate_missing_procs>True</EPC_terminate_missing_procs> <tags>USRPb210.ALU_EPC.Bandrich.10MHz.FDD.Band_7.UL.2TX.2RX</tags> @@ -1524,12 +1487,9 @@ <eNB>calisson</eNB> <UE>stevens</UE> <EPC>amerique</EPC> - <TimeOut_cmd>360</TimeOut_cmd> + <TimeOut_cmd>390</TimeOut_cmd> <eNB_working_dir>/tmp</eNB_working_dir> - <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf tracking_area_code \"1\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_country_code \"208\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_network_code \"92\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tracking_area_code \"1\" + <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tracking_area_code \"1\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_country_code \"208\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_network_code \"92\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf N_RB_DL 100 @@ -1537,13 +1497,13 @@ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf downlink_frequency 2660000000L targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf uplink_frequency_offset -120000000 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tx_gain 90 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf rx_gain 130 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf rx_gain 125 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf frame_type \"FDD\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_rx 2 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_tx 2 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1U \"eth1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_PORT_FOR_S1U 2152</eNB_config_file> <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog> @@ -1551,7 +1511,7 @@ <eNB_pre_exec></eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf </eNB_main_exec_args> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf -W </eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> @@ -1559,16 +1519,14 @@ <eNB_terminate_missing_procs>True</eNB_terminate_missing_procs> <UE_working_dir>/tmp</UE_working_dir> - <UE_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf tracking_area_code \"4\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_country_code \"5\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_network_code \"6\"</UE_config_file> - <UE_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog> - <UE_compile_prog_args>--eNB -w USRP -x -c </UE_compile_prog_args> + <UE_config_file></UE_config_file> + <UE_compile_prog></UE_compile_prog> + <UE_compile_prog_args></UE_compile_prog_args> <UE_pre_exec></UE_pre_exec> <UE_pre_exec_args></UE_pre_exec_args> - <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 45; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> + <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> <UE_main_exec_args></UE_main_exec_args> - <UE_traffic_exec>while true; do var=`ifconfig ppp0` ;sleep 1; if [ "$var" != "" ]; then break; fi ; done ; sleep 5; iperf -u -c 192.172.0.1 -b 10Mbits/s -t 300 -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 10Mbits/s -B 192.172.0.2</UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> <UE_search_expr_true></UE_search_expr_true> <UE_search_expr_false></UE_search_expr_false> @@ -1576,15 +1534,11 @@ <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue </UE_stop_script> <EPC_working_dir>/tmp</EPC_working_dir> - <EPC_config_file>BUILD/EPC/epc.local.enb.conf.in MCC \"208\" - BUILD/EPC/epc.local.enb.conf.in MNC \"92\" - BUILD/EPC/epc.local.enb.conf.in TAC \"1\" - BUILD/EPC/epc.local.enb.conf.in PGW_INTERFACE_NAME_FOR_SGI \"eth1\" - BUILD/EPC/epc.local.enb.conf.in PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.82/24\" </EPC_config_file> - <EPC_compile_prog>SCRIPTS/build_epc</EPC_compile_prog> - <EPC_compile_prog_args>-c -l</EPC_compile_prog_args> - <HSS_compile_prog>SCRIPTS/build_hss</HSS_compile_prog> - <HSS_compile_prog_args> -c -l </HSS_compile_prog_args> + <EPC_config_file></EPC_config_file> + <EPC_compile_prog></EPC_compile_prog> + <EPC_compile_prog_args></EPC_compile_prog_args> + <HSS_compile_prog></HSS_compile_prog> + <HSS_compile_prog_args></HSS_compile_prog_args> <EPC_pre_exec></EPC_pre_exec> <EPC_pre_exec_args></EPC_pre_exec_args> @@ -1592,9 +1546,9 @@ <EPC_main_exec_args></EPC_main_exec_args> <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec> <HSS_main_exec_args></HSS_main_exec_args> - <EPC_traffic_exec>sleep 5; iperf -s -i 1 -u -f m -B 192.172.0.1</EPC_traffic_exec> + <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m -B 192.172.0.1</EPC_traffic_exec> <EPC_traffic_exec_args></EPC_traffic_exec_args> - <EPC_search_expr_true>throughput_test min=4.0Mbits/sec max=4.0Mbits/sec average=4.0Mbits/sec duration=300.0s </EPC_search_expr_true> + <EPC_search_expr_true>throughput_test min=4.0Mbits/sec max=4.0Mbits/sec average=4.0Mbits/sec </EPC_search_expr_true> <EPC_search_expr_false></EPC_search_expr_false> <EPC_terminate_missing_procs>True</EPC_terminate_missing_procs> <tags>USRPb210.ALU_EPC.Bandrich.20MHz.FDD.Band_7.UL.2TX.2RX</tags> @@ -1607,12 +1561,9 @@ <eNB>calisson</eNB> <UE>stevens</UE> <EPC>amerique</EPC> - <TimeOut_cmd>360</TimeOut_cmd> + <TimeOut_cmd>390</TimeOut_cmd> <eNB_working_dir>/tmp</eNB_working_dir> - <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf tracking_area_code \"1\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_country_code \"208\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_network_code \"92\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tracking_area_code \"1\" + <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tracking_area_code \"1\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_country_code \"208\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_network_code \"92\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf N_RB_DL 25 @@ -1620,13 +1571,13 @@ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf downlink_frequency 2660000000L targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf uplink_frequency_offset -120000000 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tx_gain 90 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf rx_gain 130 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf rx_gain 125 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf frame_type \"FDD\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_rx 2 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_tx 2 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1U \"eth1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_PORT_FOR_S1U 2152</eNB_config_file> <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog> @@ -1634,7 +1585,7 @@ <eNB_pre_exec></eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf </eNB_main_exec_args> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf -W </eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> @@ -1642,33 +1593,27 @@ <eNB_terminate_missing_procs>True</eNB_terminate_missing_procs> <UE_working_dir>/tmp</UE_working_dir> - <UE_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf tracking_area_code \"4\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_country_code \"5\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_network_code \"6\"</UE_config_file> - <UE_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog> - <UE_compile_prog_args>--eNB -w USRP -x -c </UE_compile_prog_args> + <UE_config_file></UE_config_file> + <UE_compile_prog></UE_compile_prog> + <UE_compile_prog_args></UE_compile_prog_args> <UE_pre_exec></UE_pre_exec> <UE_pre_exec_args></UE_pre_exec_args> - <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 45; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> + <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> <UE_main_exec_args></UE_main_exec_args> - <UE_traffic_exec>while true; do var=`ifconfig ppp0` ;sleep 1; if [ "$var" != "" ]; then break; fi ; done ; sleep 5; iperf -s -i 1 -u -f m -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m -B 192.172.0.2</UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> - <UE_search_expr_true>throughput_test min=4.0Mbits/sec max=5.0Mbits/sec average=4.0Mbits/sec duration=300.0s </UE_search_expr_true> + <UE_search_expr_true>throughput_test min=4.0Mbits/sec max=5.0Mbits/sec average=4.0Mbits/sec </UE_search_expr_true> <UE_search_expr_false></UE_search_expr_false> <UE_terminate_missing_procs>True</UE_terminate_missing_procs> <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue </UE_stop_script> <EPC_working_dir>/tmp</EPC_working_dir> - <EPC_config_file>BUILD/EPC/epc.local.enb.conf.in MCC \"208\" - BUILD/EPC/epc.local.enb.conf.in MNC \"92\" - BUILD/EPC/epc.local.enb.conf.in TAC \"1\" - BUILD/EPC/epc.local.enb.conf.in PGW_INTERFACE_NAME_FOR_SGI \"eth1\" - BUILD/EPC/epc.local.enb.conf.in PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.82/24\" </EPC_config_file> - <EPC_compile_prog>SCRIPTS/build_epc</EPC_compile_prog> - <EPC_compile_prog_args>-c -l</EPC_compile_prog_args> - <HSS_compile_prog>SCRIPTS/build_hss</HSS_compile_prog> - <HSS_compile_prog_args> -c -l </HSS_compile_prog_args> + <EPC_config_file></EPC_config_file> + <EPC_compile_prog></EPC_compile_prog> + <EPC_compile_prog_args></EPC_compile_prog_args> + <HSS_compile_prog></HSS_compile_prog> + <HSS_compile_prog_args></HSS_compile_prog_args> <EPC_pre_exec></EPC_pre_exec> <EPC_pre_exec_args></EPC_pre_exec_args> @@ -1676,7 +1621,7 @@ <EPC_main_exec_args></EPC_main_exec_args> <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec> <HSS_main_exec_args></HSS_main_exec_args> - <EPC_traffic_exec>sleep 60; iperf -u -c 192.172.0.2 -b 10Mbits/s -t 300 -B 192.172.0.1</EPC_traffic_exec> + <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s -B 192.172.0.1</EPC_traffic_exec> <EPC_traffic_exec_args></EPC_traffic_exec_args> <EPC_search_expr_false></EPC_search_expr_false> <EPC_terminate_missing_procs>True</EPC_terminate_missing_procs> @@ -1690,12 +1635,9 @@ <eNB>calisson</eNB> <UE>stevens</UE> <EPC>amerique</EPC> - <TimeOut_cmd>360</TimeOut_cmd> + <TimeOut_cmd>390</TimeOut_cmd> <eNB_working_dir>/tmp</eNB_working_dir> - <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf tracking_area_code \"1\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_country_code \"208\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_network_code \"92\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tracking_area_code \"1\" + <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tracking_area_code \"1\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_country_code \"208\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_network_code \"92\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf N_RB_DL 50 @@ -1703,13 +1645,13 @@ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf downlink_frequency 2660000000L targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf uplink_frequency_offset -120000000 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tx_gain 90 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf rx_gain 130 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf rx_gain 125 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf frame_type \"FDD\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_rx 2 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_tx 2 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1U \"eth1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_PORT_FOR_S1U 2152</eNB_config_file> <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog> @@ -1717,7 +1659,7 @@ <eNB_pre_exec></eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf </eNB_main_exec_args> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf -W </eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> @@ -1725,33 +1667,27 @@ <eNB_terminate_missing_procs>True</eNB_terminate_missing_procs> <UE_working_dir>/tmp</UE_working_dir> - <UE_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf tracking_area_code \"4\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_country_code \"5\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_network_code \"6\"</UE_config_file> - <UE_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog> - <UE_compile_prog_args>--eNB -w USRP -x -c </UE_compile_prog_args> + <UE_config_file></UE_config_file> + <UE_compile_prog></UE_compile_prog> + <UE_compile_prog_args></UE_compile_prog_args> <UE_pre_exec></UE_pre_exec> <UE_pre_exec_args></UE_pre_exec_args> - <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 45; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> + <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> <UE_main_exec_args></UE_main_exec_args> - <UE_traffic_exec>while true; do var=`ifconfig ppp0` ;sleep 1; if [ "$var" != "" ]; then break; fi ; done ; sleep 5; iperf -s -i 1 -u -f m -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m -B 192.172.0.2</UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> - <UE_search_expr_true>throughput_test min=8.0Mbits/sec max=9.0Mbits/sec average=8.5Mbits/sec duration=300.0s </UE_search_expr_true> + <UE_search_expr_true>throughput_test min=8.0Mbits/sec max=9.0Mbits/sec average=8.5Mbits/sec </UE_search_expr_true> <UE_search_expr_false></UE_search_expr_false> <UE_terminate_missing_procs>True</UE_terminate_missing_procs> <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue </UE_stop_script> <EPC_working_dir>/tmp</EPC_working_dir> - <EPC_config_file>BUILD/EPC/epc.local.enb.conf.in MCC \"208\" - BUILD/EPC/epc.local.enb.conf.in MNC \"92\" - BUILD/EPC/epc.local.enb.conf.in TAC \"1\" - BUILD/EPC/epc.local.enb.conf.in PGW_INTERFACE_NAME_FOR_SGI \"eth1\" - BUILD/EPC/epc.local.enb.conf.in PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.82/24\" </EPC_config_file> - <EPC_compile_prog>SCRIPTS/build_epc</EPC_compile_prog> - <EPC_compile_prog_args>-c -l</EPC_compile_prog_args> - <HSS_compile_prog>SCRIPTS/build_hss</HSS_compile_prog> - <HSS_compile_prog_args> -c -l </HSS_compile_prog_args> + <EPC_config_file></EPC_config_file> + <EPC_compile_prog></EPC_compile_prog> + <EPC_compile_prog_args></EPC_compile_prog_args> + <HSS_compile_prog></HSS_compile_prog> + <HSS_compile_prog_args></HSS_compile_prog_args> <EPC_pre_exec></EPC_pre_exec> <EPC_pre_exec_args></EPC_pre_exec_args> @@ -1759,7 +1695,7 @@ <EPC_main_exec_args></EPC_main_exec_args> <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec> <HSS_main_exec_args></HSS_main_exec_args> - <EPC_traffic_exec>sleep 60; iperf -u -c 192.172.0.2 -b 10Mbits/s -t 300 -B 192.172.0.1</EPC_traffic_exec> + <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s -B 192.172.0.1</EPC_traffic_exec> <EPC_traffic_exec_args></EPC_traffic_exec_args> <EPC_search_expr_false></EPC_search_expr_false> <EPC_terminate_missing_procs>True</EPC_terminate_missing_procs> @@ -1773,12 +1709,9 @@ <eNB>calisson</eNB> <UE>stevens</UE> <EPC>amerique</EPC> - <TimeOut_cmd>360</TimeOut_cmd> + <TimeOut_cmd>390</TimeOut_cmd> <eNB_working_dir>/tmp</eNB_working_dir> - <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf tracking_area_code \"1\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_country_code \"208\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_network_code \"92\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tracking_area_code \"1\" + <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tracking_area_code \"1\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_country_code \"208\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_network_code \"92\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf N_RB_DL 100 @@ -1786,13 +1719,13 @@ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf downlink_frequency 2660000000L targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf uplink_frequency_offset -120000000 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tx_gain 90 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf rx_gain 130 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf rx_gain 125 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf frame_type \"FDD\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_rx 2 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_tx 2 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1U \"eth1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_PORT_FOR_S1U 2152</eNB_config_file> <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog> @@ -1800,7 +1733,7 @@ <eNB_pre_exec></eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf </eNB_main_exec_args> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf -W </eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> @@ -1808,33 +1741,27 @@ <eNB_terminate_missing_procs>True</eNB_terminate_missing_procs> <UE_working_dir>/tmp</UE_working_dir> - <UE_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf tracking_area_code \"4\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_country_code \"5\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_network_code \"6\"</UE_config_file> - <UE_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog> - <UE_compile_prog_args>--eNB -w USRP -x -c </UE_compile_prog_args> + <UE_config_file></UE_config_file> + <UE_compile_prog></UE_compile_prog> + <UE_compile_prog_args></UE_compile_prog_args> <UE_pre_exec></UE_pre_exec> <UE_pre_exec_args></UE_pre_exec_args> - <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 45; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> + <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> <UE_main_exec_args></UE_main_exec_args> - <UE_traffic_exec>while true; do var=`ifconfig ppp0` ;sleep 1; if [ "$var" != "" ]; then break; fi ; done ; sleep 5; iperf -s -i 1 -u -f m -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m -B 192.172.0.2</UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> - <UE_search_expr_true>throughput_test min=15.0Mbits/sec max=15.0Mbits/sec average=15.0Mbits/sec duration=300.0s </UE_search_expr_true> + <UE_search_expr_true>throughput_test min=15.0Mbits/sec max=15.0Mbits/sec average=15.0Mbits/sec </UE_search_expr_true> <UE_search_expr_false></UE_search_expr_false> <UE_terminate_missing_procs>True</UE_terminate_missing_procs> <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue </UE_stop_script> <EPC_working_dir>/tmp</EPC_working_dir> - <EPC_config_file>BUILD/EPC/epc.local.enb.conf.in MCC \"208\" - BUILD/EPC/epc.local.enb.conf.in MNC \"92\" - BUILD/EPC/epc.local.enb.conf.in TAC \"1\" - BUILD/EPC/epc.local.enb.conf.in PGW_INTERFACE_NAME_FOR_SGI \"eth1\" - BUILD/EPC/epc.local.enb.conf.in PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.82/24\" </EPC_config_file> - <EPC_compile_prog>SCRIPTS/build_epc</EPC_compile_prog> - <EPC_compile_prog_args>-c -l</EPC_compile_prog_args> - <HSS_compile_prog>SCRIPTS/build_hss</HSS_compile_prog> - <HSS_compile_prog_args> -c -l </HSS_compile_prog_args> + <EPC_config_file></EPC_config_file> + <EPC_compile_prog></EPC_compile_prog> + <EPC_compile_prog_args></EPC_compile_prog_args> + <HSS_compile_prog></HSS_compile_prog> + <HSS_compile_prog_args></HSS_compile_prog_args> <EPC_pre_exec></EPC_pre_exec> <EPC_pre_exec_args></EPC_pre_exec_args> @@ -1842,7 +1769,7 @@ <EPC_main_exec_args></EPC_main_exec_args> <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec> <HSS_main_exec_args></HSS_main_exec_args> - <EPC_traffic_exec>sleep 60; iperf -u -c 192.172.0.2 -b 10Mbits/s -t 300 -B 192.172.0.1</EPC_traffic_exec> + <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s -B 192.172.0.1</EPC_traffic_exec> <EPC_traffic_exec_args></EPC_traffic_exec_args> <EPC_search_expr_false></EPC_search_expr_false> <EPC_terminate_missing_procs>True</EPC_terminate_missing_procs> @@ -1851,225 +1778,3219 @@ </testCase> - <testCase id="015800" > + <testCase id="015600" > <class>lte-softmodem</class> <desc></desc> - <eNB>mozart</eNB> + <eNB>calisson</eNB> <UE>stevens</UE> - <EPC>amerique</EPC> - <TimeOut_cmd>360</TimeOut_cmd> + <EPC>calisson</EPC> + <TimeOut_cmd>390</TimeOut_cmd> <eNB_working_dir>/tmp</eNB_working_dir> - <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf tracking_area_code \"1\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf mobile_country_code \"208\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf mobile_network_code \"92\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf N_RB_DL 25 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf downlink_frequency 2660000000L - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf uplink_frequency_offset -120000000 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf frame_type \"FDD\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf nb_antennas_rx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf nb_antennas_tx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth0\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.111/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1U \"eth0\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.111/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf ENB_PORT_FOR_S1U 2152</eNB_config_file> + <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf N_RB_DL 25 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf pdsch_referenceSignalPower -26 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mme_ip_address "ipv4=\"192.170.0.1\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf tx_gain 90 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf rx_gain 125 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5:3\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.170.0.2/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5:4\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.170.1.2/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf ENB_PORT_FOR_S1U 2152</eNB_config_file> <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog> - <eNB_compile_prog_args>--eNB -w USRP -x -c </eNB_compile_prog_args> - <eNB_pre_exec>sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail</eNB_pre_exec> + <eNB_compile_prog_args>--eNB -w USRP -c</eNB_compile_prog_args> + <eNB_pre_exec>sleep 15; sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' ; sudo -E ifconfig eth5:3 192.170.0.2 up ; sudo -E ifconfig eth5:4 192.170.1.2 up; ifconfig ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf $OPENAIR_TESTDIR/enb.conf</eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> - <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf </eNB_main_exec_args> + <eNB_main_exec> $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf -W </eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> <eNB_search_expr_false></eNB_search_expr_false> - <eNB_terminate_missing_procs>True</eNB_terminate_missing_procs> + <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs> <UE_working_dir>/tmp</UE_working_dir> - <UE_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf tracking_area_code \"4\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_country_code \"5\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_network_code \"6\"</UE_config_file> - <UE_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog> - <UE_compile_prog_args>--eNB -w USRP -x -c </UE_compile_prog_args> - <UE_pre_exec></UE_pre_exec> + <UE_config_file></UE_config_file> + <UE_compile_prog></UE_compile_prog> + <UE_compile_prog_args></UE_compile_prog_args> + <UE_pre_exec>sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' </UE_pre_exec> <UE_pre_exec_args></UE_pre_exec_args> - <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 45; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> + <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> <UE_main_exec_args></UE_main_exec_args> - <UE_traffic_exec>while true; do var=`ifconfig ppp0` ;sleep 1; if [ "$var" != "" ]; then break; fi ; done ; sleep 5; iperf -u -c 192.172.0.1 -b 10Mbits/s -t 300 -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 10Mbits/s -B 192.172.0.2</UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> <UE_search_expr_true></UE_search_expr_true> <UE_search_expr_false></UE_search_expr_false> - <UE_terminate_missing_procs>True</UE_terminate_missing_procs> - <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue </UE_stop_script> + <UE_terminate_missing_procs>False</UE_terminate_missing_procs> + <UE_stop_script>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue </UE_stop_script> <EPC_working_dir>/tmp</EPC_working_dir> - <EPC_config_file>BUILD/EPC/epc.local.enb.conf.in MCC \"208\" - BUILD/EPC/epc.local.enb.conf.in MNC \"92\" - BUILD/EPC/epc.local.enb.conf.in TAC \"1\" - BUILD/EPC/epc.local.enb.conf.in PGW_INTERFACE_NAME_FOR_SGI \"eth1\" - BUILD/EPC/epc.local.enb.conf.in PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.82/24\" </EPC_config_file> - <EPC_compile_prog>SCRIPTS/build_epc</EPC_compile_prog> + <EPC_config_file>BUILD/EPC/epc.conf.in MCC \"208\" + BUILD/EPC/epc.conf.in MNC \"92\" + BUILD/EPC/epc.conf.in TAC \"1\" + BUILD/EPC/epc.conf.in MME_INTERFACE_NAME_FOR_S1_MME \"eth5:1\" + BUILD/EPC/epc.conf.in MME_IPV4_ADDRESS_FOR_S1_MME \"192.170.0.1/24\" + BUILD/EPC/epc.conf.in SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP \"eth5:2\"; + BUILD/EPC/epc.conf.in SGW_IPV4_ADDRESS_FOR_S1U_S12_S4_UP \"192.170.1.1/24\"; + BUILD/EPC/epc.conf.in PGW_INTERFACE_NAME_FOR_SGI \"eth5\" + BUILD/EPC/epc.conf.in PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.82/24\" + BUILD/EPC/epc.conf.in IPV4_LIST \"192.172.0.0/24\",\"192.172.1.0/24\"</EPC_config_file> + <EPC_compile_prog>$OPENAIRCN_DIR/SCRIPTS/build_epc</EPC_compile_prog> <EPC_compile_prog_args>-c -l</EPC_compile_prog_args> - <HSS_compile_prog>SCRIPTS/build_hss</HSS_compile_prog> - <HSS_compile_prog_args> -c -l </HSS_compile_prog_args> + <HSS_compile_prog>$OPENAIRCN_DIR/SCRIPTS/build_hss</HSS_compile_prog> + <HSS_compile_prog_args> -c -l --debug --random false </HSS_compile_prog_args> - <EPC_pre_exec></EPC_pre_exec> + <EPC_pre_exec>sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' ; sudo -E ifconfig eth5 add 192.172.0.1</EPC_pre_exec> <EPC_pre_exec_args></EPC_pre_exec_args> - <EPC_main_exec>/opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000</EPC_main_exec> - <EPC_main_exec_args></EPC_main_exec_args> - <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec> + <EPC_main_exec>$OPENAIRCN_DIR/SCRIPTS/run_epc </EPC_main_exec> + <EPC_main_exec_args> -i -r </EPC_main_exec_args> + <HSS_main_exec>sleep 10; cp $OPENAIRCN_DIR/BUILD/EPC/epc.conf.in $OPENAIRCN_TESTDIR/epc.conf.in; $OPENAIRCN_DIR/SCRIPTS/run_hss --export-db $OPENAIRCN_TESTDIR/hss_export.db </HSS_main_exec> <HSS_main_exec_args></HSS_main_exec_args> - <EPC_traffic_exec>sleep 5; iperf -s -i 1 -u -f m -B 192.172.0.1</EPC_traffic_exec> + <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m -B 192.172.0.1</EPC_traffic_exec> <EPC_traffic_exec_args></EPC_traffic_exec_args> - <EPC_search_expr_true>throughput_test min=1.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec duration=300.0s </EPC_search_expr_true> + <EPC_search_expr_true>throughput_test min=1.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec </EPC_search_expr_true> <EPC_search_expr_false></EPC_search_expr_false> - <EPC_terminate_missing_procs>True</EPC_terminate_missing_procs> - <tags>USRPx310.ALU_EPC.Bandrich.5MHz.FDD.Band_7.UL.1TX.1RX</tags> + <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs> + <tags>USRPb210.OAI_EPC_local.Bandrich.5MHz.FDD.Band_7.UL.1TX.1RX</tags> <nruns>10</nruns> - </testCase> - + </testCase> - <testCase id="015801" > + <testCase id="015601" > <class>lte-softmodem</class> <desc></desc> - <eNB>mozart</eNB> + <eNB>calisson</eNB> <UE>stevens</UE> - <EPC>amerique</EPC> - <TimeOut_cmd>360</TimeOut_cmd> + <EPC>calisson</EPC> + <TimeOut_cmd>390</TimeOut_cmd> <eNB_working_dir>/tmp</eNB_working_dir> - <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310..conf tracking_area_code \"1\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf mobile_country_code \"208\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf mobile_network_code \"92\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf N_RB_DL 50 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf downlink_frequency 2660000000L - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf uplink_frequency_offset -120000000 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf frame_type \"FDD\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf nb_antennas_rx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf nb_antennas_tx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth0\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.111/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.conf ENB_INTERFACE_NAME_FOR_S1U \"eth0\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.111/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.conf ENB_PORT_FOR_S1U 2152</eNB_config_file> + <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf N_RB_DL 50 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf pdsch_referenceSignalPower -29 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mme_ip_address "ipv4=\"192.170.0.1\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf tx_gain 90 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf rx_gain 125 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5:3\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.170.0.2/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5:4\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.170.1.2/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf ENB_PORT_FOR_S1U 2152</eNB_config_file> <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog> - <eNB_compile_prog_args>--eNB -w USRP -x -c </eNB_compile_prog_args> - <eNB_pre_exec>sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail</eNB_pre_exec> + <eNB_compile_prog_args>--eNB -w USRP -c</eNB_compile_prog_args> + <eNB_pre_exec>sleep 15; sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' ;sudo -E ifconfig eth5:3 192.170.0.2 up ; sudo -E ifconfig eth5:4 192.170.1.2 up; ifconfig ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf $OPENAIR_TESTDIR/enb.conf</eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> - <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf </eNB_main_exec_args> + <eNB_main_exec> $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf -W </eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> <eNB_search_expr_false></eNB_search_expr_false> - <eNB_terminate_missing_procs>True</eNB_terminate_missing_procs> + <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs> <UE_working_dir>/tmp</UE_working_dir> - <UE_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf tracking_area_code \"4\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_country_code \"5\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_network_code \"6\"</UE_config_file> - <UE_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog> - <UE_compile_prog_args>--eNB -w USRP -x -c </UE_compile_prog_args> - <UE_pre_exec></UE_pre_exec> + <UE_config_file></UE_config_file> + <UE_compile_prog></UE_compile_prog> + <UE_compile_prog_args></UE_compile_prog_args> + <UE_pre_exec>sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' </UE_pre_exec> <UE_pre_exec_args></UE_pre_exec_args> - <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 45; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> + <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> <UE_main_exec_args></UE_main_exec_args> - <UE_traffic_exec>while true; do var=`ifconfig ppp0` ;sleep 1; if [ "$var" != "" ]; then break; fi ; done ; sleep 5; iperf -u -c 192.172.0.1 -b 10Mbits/s -t 300 -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 10Mbits/s -B 192.172.0.2</UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> <UE_search_expr_true></UE_search_expr_true> <UE_search_expr_false></UE_search_expr_false> - <UE_terminate_missing_procs>True</UE_terminate_missing_procs> - <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue </UE_stop_script> + <UE_terminate_missing_procs>False</UE_terminate_missing_procs> + <UE_stop_script>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue </UE_stop_script> <EPC_working_dir>/tmp</EPC_working_dir> - <EPC_config_file>BUILD/EPC/epc.local.enb.conf.in MCC \"208\" - BUILD/EPC/epc.local.enb.conf.in MNC \"92\" - BUILD/EPC/epc.local.enb.conf.in TAC \"1\" - BUILD/EPC/epc.local.enb.conf.in PGW_INTERFACE_NAME_FOR_SGI \"eth1\" - BUILD/EPC/epc.local.enb.conf.in PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.82/24\" </EPC_config_file> - <EPC_compile_prog>SCRIPTS/build_epc</EPC_compile_prog> + <EPC_config_file>BUILD/EPC/epc.conf.in MCC \"208\" + BUILD/EPC/epc.conf.in MNC \"92\" + BUILD/EPC/epc.conf.in TAC \"1\" + BUILD/EPC/epc.conf.in MME_INTERFACE_NAME_FOR_S1_MME \"eth5:1\" + BUILD/EPC/epc.conf.in MME_IPV4_ADDRESS_FOR_S1_MME \"192.170.0.1/24\" + BUILD/EPC/epc.conf.in SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP \"eth5:2\"; + BUILD/EPC/epc.conf.in SGW_IPV4_ADDRESS_FOR_S1U_S12_S4_UP \"192.170.1.1/24\"; + BUILD/EPC/epc.conf.in PGW_INTERFACE_NAME_FOR_SGI \"eth5\" + BUILD/EPC/epc.conf.in PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.82/24\" + BUILD/EPC/epc.conf.in IPV4_LIST \"192.172.0.0/24\",\"192.172.1.0/24\"</EPC_config_file> + <EPC_compile_prog>$OPENAIRCN_DIR/SCRIPTS/build_epc</EPC_compile_prog> <EPC_compile_prog_args>-c -l</EPC_compile_prog_args> - <HSS_compile_prog>SCRIPTS/build_hss</HSS_compile_prog> - <HSS_compile_prog_args> -c -l </HSS_compile_prog_args> + <HSS_compile_prog>$OPENAIRCN_DIR/SCRIPTS/build_hss</HSS_compile_prog> + <HSS_compile_prog_args> -c -l --debug --random false </HSS_compile_prog_args> - <EPC_pre_exec></EPC_pre_exec> + <EPC_pre_exec>sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' ;sudo -E ifconfig eth5 add 192.172.0.1 ; cp $OPENAIRCN_DIR/BUILD/EPC/epc.conf.in $OPENAIRCN_TESTDIR/epc.conf.in</EPC_pre_exec> <EPC_pre_exec_args></EPC_pre_exec_args> - <EPC_main_exec>/opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000</EPC_main_exec> - <EPC_main_exec_args></EPC_main_exec_args> - <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec> + <EPC_main_exec>$OPENAIRCN_DIR/SCRIPTS/run_epc </EPC_main_exec> + <EPC_main_exec_args> -i -r </EPC_main_exec_args> + <HSS_main_exec>sleep 10; $OPENAIRCN_DIR/SCRIPTS/run_hss --export-db $OPENAIRCN_TESTDIR/hss_export.db </HSS_main_exec> <HSS_main_exec_args></HSS_main_exec_args> - <EPC_traffic_exec>sleep 5; iperf -s -i 1 -u -f m -B 192.172.0.1</EPC_traffic_exec> + <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m -B 192.172.0.1</EPC_traffic_exec> <EPC_traffic_exec_args></EPC_traffic_exec_args> - <EPC_search_expr_true>throughput_test min=2.0Mbits/sec max=2.0Mbits/sec average=2.0Mbits/sec duration=300.0s </EPC_search_expr_true> + <EPC_search_expr_true>throughput_test min=1.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec </EPC_search_expr_true> <EPC_search_expr_false></EPC_search_expr_false> - <EPC_terminate_missing_procs>True</EPC_terminate_missing_procs> - <tags>USRPx310.ALU_EPC.Bandrich.10MHz.FDD.Band_7.UL.1TX.1RX</tags> + <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs> + <tags>USRPb210.OAI_EPC_local.Bandrich.10MHz.FDD.Band_7.UL.1TX.1RX</tags> <nruns>10</nruns> - </testCase> + </testCase> - <testCase id="015802" > + <testCase id="015602" > <class>lte-softmodem</class> <desc></desc> - <eNB>mozart</eNB> + <eNB>calisson</eNB> <UE>stevens</UE> - <EPC>amerique</EPC> - <TimeOut_cmd>360</TimeOut_cmd> + <EPC>calisson</EPC> + <TimeOut_cmd>390</TimeOut_cmd> <eNB_working_dir>/tmp</eNB_working_dir> - <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf tracking_area_code \"1\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf mobile_country_code \"208\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf mobile_network_code \"92\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf N_RB_DL 100 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf downlink_frequency 2660000000L - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf uplink_frequency_offset -120000000 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf frame_type \"FDD\" + <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf N_RB_DL 100 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf pdsch_referenceSignalPower -29 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mme_ip_address "ipv4=\"192.170.0.1\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf tx_gain 90 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf rx_gain 125 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5:3\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.170.0.2/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5:4\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.170.1.2/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf ENB_PORT_FOR_S1U 2152</eNB_config_file> + <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog> + <eNB_compile_prog_args>--eNB -w USRP -c</eNB_compile_prog_args> + <eNB_pre_exec>sleep 15; sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' ;sudo -E ifconfig eth5:3 192.170.0.2 up ; sudo -E ifconfig eth5:4 192.170.1.2 up; ifconfig ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf $OPENAIR_TESTDIR/enb.conf</eNB_pre_exec> + <eNB_pre_exec_args></eNB_pre_exec_args> + <eNB_main_exec> $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf -W </eNB_main_exec_args> + <eNB_traffic_exec></eNB_traffic_exec> + <eNB_traffic_exec_args></eNB_traffic_exec_args> + <eNB_search_expr_true></eNB_search_expr_true> + <eNB_search_expr_false></eNB_search_expr_false> + <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs> + + <UE_working_dir>/tmp</UE_working_dir> + <UE_config_file></UE_config_file> + <UE_compile_prog></UE_compile_prog> + <UE_compile_prog_args></UE_compile_prog_args> + <UE_pre_exec>sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' </UE_pre_exec> + <UE_pre_exec_args></UE_pre_exec_args> + <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> + <UE_main_exec_args></UE_main_exec_args> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 10Mbits/s -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec_args></UE_traffic_exec_args> + <UE_search_expr_true></UE_search_expr_true> + <UE_search_expr_false></UE_search_expr_false> + <UE_terminate_missing_procs>False</UE_terminate_missing_procs> + <UE_stop_script>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue </UE_stop_script> + + <EPC_working_dir>/tmp</EPC_working_dir> + <EPC_config_file>BUILD/EPC/epc.conf.in MCC \"208\" + BUILD/EPC/epc.conf.in MNC \"92\" + BUILD/EPC/epc.conf.in TAC \"1\" + BUILD/EPC/epc.conf.in MME_INTERFACE_NAME_FOR_S1_MME \"eth5:1\" + BUILD/EPC/epc.conf.in MME_IPV4_ADDRESS_FOR_S1_MME \"192.170.0.1/24\" + BUILD/EPC/epc.conf.in SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP \"eth5:2\"; + BUILD/EPC/epc.conf.in SGW_IPV4_ADDRESS_FOR_S1U_S12_S4_UP \"192.170.1.1/24\"; + BUILD/EPC/epc.conf.in PGW_INTERFACE_NAME_FOR_SGI \"eth5\" + BUILD/EPC/epc.conf.in PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.82/24\" + BUILD/EPC/epc.conf.in IPV4_LIST \"192.172.0.0/24\",\"192.172.1.0/24\"</EPC_config_file> + <EPC_compile_prog>$OPENAIRCN_DIR/SCRIPTS/build_epc</EPC_compile_prog> + <EPC_compile_prog_args>-c -l</EPC_compile_prog_args> + <HSS_compile_prog>$OPENAIRCN_DIR/SCRIPTS/build_hss</HSS_compile_prog> + <HSS_compile_prog_args> -c -l --debug --random false </HSS_compile_prog_args> + + <EPC_pre_exec>sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' ; sudo -E ifconfig eth5 add 192.172.0.1 ; cp $OPENAIRCN_DIR/BUILD/EPC/epc.conf.in $OPENAIRCN_TESTDIR/epc.conf.in</EPC_pre_exec> + <EPC_pre_exec_args></EPC_pre_exec_args> + <EPC_main_exec>$OPENAIRCN_DIR/SCRIPTS/run_epc </EPC_main_exec> + <EPC_main_exec_args> -i -r </EPC_main_exec_args> + <HSS_main_exec>sleep 10; $OPENAIRCN_DIR/SCRIPTS/run_hss --export-db $OPENAIRCN_TESTDIR/hss_export.db </HSS_main_exec> + <HSS_main_exec_args></HSS_main_exec_args> + <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m -B 192.172.0.1</EPC_traffic_exec> + <EPC_traffic_exec_args></EPC_traffic_exec_args> + <EPC_search_expr_true>throughput_test min=1.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec </EPC_search_expr_true> + <EPC_search_expr_false></EPC_search_expr_false> + <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs> + <tags>USRPb210.OAI_EPC_local.Bandrich.20MHz.FDD.Band_7.UL.1TX.1RX</tags> + <nruns>10</nruns> + </testCase> + + <testCase id="015603" > + <class>lte-softmodem</class> + <desc></desc> + <eNB>calisson</eNB> + <UE>stevens</UE> + <EPC>calisson</EPC> + <TimeOut_cmd>390</TimeOut_cmd> + <eNB_working_dir>/tmp</eNB_working_dir> + <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf N_RB_DL 25 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf pdsch_referenceSignalPower -26 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mme_ip_address "ipv4=\"192.170.0.1\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf tx_gain 90 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf rx_gain 125 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5:3\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.170.0.2/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5:4\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.170.1.2/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf ENB_PORT_FOR_S1U 2152</eNB_config_file> + <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog> + <eNB_compile_prog_args>--eNB -w USRP -c</eNB_compile_prog_args> + <eNB_pre_exec>sleep 15; sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' ;sudo -E ifconfig eth5:3 192.170.0.2 up ; sudo -E ifconfig eth5:4 192.170.1.2 up; ifconfig ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf $OPENAIR_TESTDIR/enb.conf</eNB_pre_exec> + <eNB_pre_exec_args></eNB_pre_exec_args> + <eNB_main_exec> $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf -W </eNB_main_exec_args> + <eNB_traffic_exec></eNB_traffic_exec> + <eNB_traffic_exec_args></eNB_traffic_exec_args> + <eNB_search_expr_true></eNB_search_expr_true> + <eNB_search_expr_false></eNB_search_expr_false> + <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs> + + <UE_working_dir>/tmp</UE_working_dir> + <UE_config_file></UE_config_file> + <UE_compile_prog></UE_compile_prog> + <UE_compile_prog_args></UE_compile_prog_args> + <UE_pre_exec>sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' </UE_pre_exec> + <UE_pre_exec_args></UE_pre_exec_args> + <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> + <UE_main_exec_args></UE_main_exec_args> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec_args></UE_traffic_exec_args> + <UE_search_expr_true>throughput_test min=10.0Mbits/sec max=10.5Mbits/sec average=11.0Mbits/sec </UE_search_expr_true> + <UE_search_expr_false></UE_search_expr_false> + <UE_terminate_missing_procs>False</UE_terminate_missing_procs> + <UE_stop_script>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue </UE_stop_script> + + <EPC_working_dir>/tmp</EPC_working_dir> + <EPC_config_file>BUILD/EPC/epc.conf.in MCC \"208\" + BUILD/EPC/epc.conf.in MNC \"92\" + BUILD/EPC/epc.conf.in TAC \"1\" + BUILD/EPC/epc.conf.in MME_INTERFACE_NAME_FOR_S1_MME \"eth5:1\" + BUILD/EPC/epc.conf.in MME_IPV4_ADDRESS_FOR_S1_MME \"192.170.0.1/24\" + BUILD/EPC/epc.conf.in SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP \"eth5:2\"; + BUILD/EPC/epc.conf.in SGW_IPV4_ADDRESS_FOR_S1U_S12_S4_UP \"192.170.1.1/24\"; + BUILD/EPC/epc.conf.in PGW_INTERFACE_NAME_FOR_SGI \"eth5\" + BUILD/EPC/epc.conf.in PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.82/24\" + BUILD/EPC/epc.conf.in IPV4_LIST \"192.172.0.0/24\",\"192.172.1.0/24\"</EPC_config_file> + <EPC_compile_prog>$OPENAIRCN_DIR/SCRIPTS/build_epc</EPC_compile_prog> + <EPC_compile_prog_args>-c -l</EPC_compile_prog_args> + <HSS_compile_prog>$OPENAIRCN_DIR/SCRIPTS/build_hss</HSS_compile_prog> + <HSS_compile_prog_args> -c -l --debug --random false </HSS_compile_prog_args> + + <EPC_pre_exec>sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' ;sudo -E ifconfig eth5 add 192.172.0.1 ; cp $OPENAIRCN_DIR/BUILD/EPC/epc.conf.in $OPENAIRCN_TESTDIR/epc.conf.in</EPC_pre_exec> + <EPC_pre_exec_args></EPC_pre_exec_args> + <EPC_main_exec>$OPENAIRCN_DIR/SCRIPTS/run_epc </EPC_main_exec> + <EPC_main_exec_args> -i -r </EPC_main_exec_args> + <HSS_main_exec>sleep 10; $OPENAIRCN_DIR/SCRIPTS/run_hss --export-db $OPENAIRCN_TESTDIR/hss_export.db </HSS_main_exec> + <HSS_main_exec_args></HSS_main_exec_args> + <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s -B 192.172.0.1</EPC_traffic_exec> + <EPC_traffic_exec_args></EPC_traffic_exec_args> + <EPC_search_expr_true></EPC_search_expr_true> + <EPC_search_expr_false></EPC_search_expr_false> + <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs> + <tags>USRPb210.OAI_EPC_local.Bandrich.5MHz.FDD.Band_7.DL.1TX.1RX</tags> + <nruns>10</nruns> + </testCase> + + <testCase id="015604" > + <class>lte-softmodem</class> + <desc></desc> + <eNB>calisson</eNB> + <UE>stevens</UE> + <EPC>calisson</EPC> + <TimeOut_cmd>390</TimeOut_cmd> + <eNB_working_dir>/tmp</eNB_working_dir> + <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf N_RB_DL 50 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf pdsch_referenceSignalPower -29 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mme_ip_address "ipv4=\"192.170.0.1\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf tx_gain 90 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf rx_gain 125 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5:3\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.170.0.2/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5:4\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.170.1.2/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf ENB_PORT_FOR_S1U 2152</eNB_config_file> + <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog> + <eNB_compile_prog_args>--eNB -w USRP -c</eNB_compile_prog_args> + <eNB_pre_exec>sleep 15; sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' ;sudo -E ifconfig eth5:3 192.170.0.2 up ; sudo -E ifconfig eth5:4 192.170.1.2 up; ifconfig ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf $OPENAIR_TESTDIR/enb.conf</eNB_pre_exec> + <eNB_pre_exec_args></eNB_pre_exec_args> + <eNB_main_exec> $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf -W </eNB_main_exec_args> + <eNB_traffic_exec></eNB_traffic_exec> + <eNB_traffic_exec_args></eNB_traffic_exec_args> + <eNB_search_expr_true></eNB_search_expr_true> + <eNB_search_expr_false></eNB_search_expr_false> + <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs> + + <UE_working_dir>/tmp</UE_working_dir> + <UE_config_file></UE_config_file> + <UE_compile_prog></UE_compile_prog> + <UE_compile_prog_args></UE_compile_prog_args> + <UE_pre_exec>sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' </UE_pre_exec> + <UE_pre_exec_args></UE_pre_exec_args> + <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> + <UE_main_exec_args></UE_main_exec_args> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec_args></UE_traffic_exec_args> + <UE_search_expr_true>throughput_test min=20.0Mbits/sec max=21.0Mbits/sec average=22.0Mbits/sec </UE_search_expr_true> + <UE_search_expr_false></UE_search_expr_false> + <UE_terminate_missing_procs>False</UE_terminate_missing_procs> + <UE_stop_script>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue </UE_stop_script> + + <EPC_working_dir>/tmp</EPC_working_dir> + <EPC_config_file>BUILD/EPC/epc.conf.in MCC \"208\" + BUILD/EPC/epc.conf.in MNC \"92\" + BUILD/EPC/epc.conf.in TAC \"1\" + BUILD/EPC/epc.conf.in MME_INTERFACE_NAME_FOR_S1_MME \"eth5:1\" + BUILD/EPC/epc.conf.in MME_IPV4_ADDRESS_FOR_S1_MME \"192.170.0.1/24\" + BUILD/EPC/epc.conf.in SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP \"eth5:2\"; + BUILD/EPC/epc.conf.in SGW_IPV4_ADDRESS_FOR_S1U_S12_S4_UP \"192.170.1.1/24\"; + BUILD/EPC/epc.conf.in PGW_INTERFACE_NAME_FOR_SGI \"eth5\" + BUILD/EPC/epc.conf.in PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.82/24\" + BUILD/EPC/epc.conf.in IPV4_LIST \"192.172.0.0/24\",\"192.172.1.0/24\"</EPC_config_file> + <EPC_compile_prog>$OPENAIRCN_DIR/SCRIPTS/build_epc</EPC_compile_prog> + <EPC_compile_prog_args>-c -l</EPC_compile_prog_args> + <HSS_compile_prog>$OPENAIRCN_DIR/SCRIPTS/build_hss</HSS_compile_prog> + <HSS_compile_prog_args> -c -l --debug --random false </HSS_compile_prog_args> + + <EPC_pre_exec>sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' ;sudo -E ifconfig eth5 add 192.172.0.1 ; cp $OPENAIRCN_DIR/BUILD/EPC/epc.conf.in $OPENAIRCN_TESTDIR/epc.conf.in</EPC_pre_exec> + <EPC_pre_exec_args></EPC_pre_exec_args> + <EPC_main_exec>$OPENAIRCN_DIR/SCRIPTS/run_epc </EPC_main_exec> + <EPC_main_exec_args> -i -r </EPC_main_exec_args> + <HSS_main_exec>sleep 10; $OPENAIRCN_DIR/SCRIPTS/run_hss --export-db $OPENAIRCN_TESTDIR/hss_export.db </HSS_main_exec> + <HSS_main_exec_args></HSS_main_exec_args> + <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s -B 192.172.0.1</EPC_traffic_exec> + <EPC_traffic_exec_args></EPC_traffic_exec_args> + <EPC_search_expr_true></EPC_search_expr_true> + <EPC_search_expr_false></EPC_search_expr_false> + <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs> + <tags>USRPb210.OAI_EPC_local.Bandrich.10MHz.FDD.Band_7.DL.1TX.1RX</tags> + <nruns>10</nruns> + </testCase> + + <testCase id="015605" > + <class>lte-softmodem</class> + <desc></desc> + <eNB>calisson</eNB> + <UE>stevens</UE> + <EPC>calisson</EPC> + <TimeOut_cmd>390</TimeOut_cmd> + <eNB_working_dir>/tmp</eNB_working_dir> + <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf N_RB_DL 100 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf pdsch_referenceSignalPower -29 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mme_ip_address "ipv4=\"192.170.0.1\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf tx_gain 90 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf rx_gain 125 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5:3\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.170.0.2/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5:4\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.170.1.2/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf ENB_PORT_FOR_S1U 2152</eNB_config_file> + <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog> + <eNB_compile_prog_args>--eNB -w USRP -c</eNB_compile_prog_args> + <eNB_pre_exec>sleep 15; sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' ;sudo -E ifconfig eth5:3 192.170.0.2 up ; sudo -E ifconfig eth5:4 192.170.1.2 up; ifconfig ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf $OPENAIR_TESTDIR/enb.conf</eNB_pre_exec> + <eNB_pre_exec_args></eNB_pre_exec_args> + <eNB_main_exec> $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf -W </eNB_main_exec_args> + <eNB_traffic_exec></eNB_traffic_exec> + <eNB_traffic_exec_args></eNB_traffic_exec_args> + <eNB_search_expr_true></eNB_search_expr_true> + <eNB_search_expr_false></eNB_search_expr_false> + <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs> + + <UE_working_dir>/tmp</UE_working_dir> + <UE_config_file></UE_config_file> + <UE_compile_prog></UE_compile_prog> + <UE_compile_prog_args></UE_compile_prog_args> + <UE_pre_exec>sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' </UE_pre_exec> + <UE_pre_exec_args></UE_pre_exec_args> + <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> + <UE_main_exec_args></UE_main_exec_args> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec_args></UE_traffic_exec_args> + <UE_search_expr_true>throughput_test min=40.0Mbits/sec max=42.0Mbits/sec average=44.0Mbits/sec </UE_search_expr_true> + <UE_search_expr_false></UE_search_expr_false> + <UE_terminate_missing_procs>False</UE_terminate_missing_procs> + <UE_stop_script>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue </UE_stop_script> + + <EPC_working_dir>/tmp</EPC_working_dir> + <EPC_config_file>BUILD/EPC/epc.conf.in MCC \"208\" + BUILD/EPC/epc.conf.in MNC \"92\" + BUILD/EPC/epc.conf.in TAC \"1\" + BUILD/EPC/epc.conf.in MME_INTERFACE_NAME_FOR_S1_MME \"eth5:1\" + BUILD/EPC/epc.conf.in MME_IPV4_ADDRESS_FOR_S1_MME \"192.170.0.1/24\" + BUILD/EPC/epc.conf.in SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP \"eth5:2\"; + BUILD/EPC/epc.conf.in SGW_IPV4_ADDRESS_FOR_S1U_S12_S4_UP \"192.170.1.1/24\"; + BUILD/EPC/epc.conf.in PGW_INTERFACE_NAME_FOR_SGI \"eth5\" + BUILD/EPC/epc.conf.in PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.82/24\" + BUILD/EPC/epc.conf.in IPV4_LIST \"192.172.0.0/24\",\"192.172.1.0/24\"</EPC_config_file> + <EPC_compile_prog>$OPENAIRCN_DIR/SCRIPTS/build_epc</EPC_compile_prog> + <EPC_compile_prog_args>-c -l</EPC_compile_prog_args> + <HSS_compile_prog>$OPENAIRCN_DIR/SCRIPTS/build_hss</HSS_compile_prog> + <HSS_compile_prog_args> -c -l --debug --random false</HSS_compile_prog_args> + + <EPC_pre_exec>sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' ;sudo -E ifconfig eth5 add 192.172.0.1 ; cp $OPENAIRCN_DIR/BUILD/EPC/epc.conf.in $OPENAIRCN_TESTDIR/epc.conf.in</EPC_pre_exec> + <EPC_pre_exec_args></EPC_pre_exec_args> + <EPC_main_exec>$OPENAIRCN_DIR/SCRIPTS/run_epc </EPC_main_exec> + <EPC_main_exec_args> -i -r </EPC_main_exec_args> + <HSS_main_exec>sleep 10; $OPENAIRCN_DIR/SCRIPTS/run_hss --export-db $OPENAIRCN_TESTDIR/hss_export.db </HSS_main_exec> + <HSS_main_exec_args></HSS_main_exec_args> + <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s -B 192.172.0.1</EPC_traffic_exec> + <EPC_traffic_exec_args></EPC_traffic_exec_args> + <EPC_search_expr_true></EPC_search_expr_true> + <EPC_search_expr_false></EPC_search_expr_false> + <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs> + <tags>USRPb210.OAI_EPC_local.Bandrich.20MHz.FDD.Band_7.DL.1TX.1RX</tags> + <nruns>10</nruns> + </testCase> + + <testCase id="015700" > + <class>lte-softmodem</class> + <desc></desc> + <eNB>calisson</eNB> + <UE>stevens</UE> + <EPC>nano</EPC> + <TimeOut_cmd>390</TimeOut_cmd> + <eNB_working_dir>/tmp</eNB_working_dir> + <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf N_RB_DL 25 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf pdsch_referenceSignalPower -26 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mme_ip_address "ipv4=\"192.168.12.62\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tx_gain 90 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf rx_gain 125 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_PORT_FOR_S1U 2152</eNB_config_file> + <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog> + <eNB_compile_prog_args>--eNB -w USRP -c</eNB_compile_prog_args> + <eNB_pre_exec>sleep 15; sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches'; ifconfig ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf $OPENAIR_TESTDIR/enb.conf</eNB_pre_exec> + <eNB_pre_exec_args></eNB_pre_exec_args> + <eNB_main_exec> $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf -W </eNB_main_exec_args> + <eNB_traffic_exec></eNB_traffic_exec> + <eNB_traffic_exec_args></eNB_traffic_exec_args> + <eNB_search_expr_true></eNB_search_expr_true> + <eNB_search_expr_false></eNB_search_expr_false> + <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs> + + <UE_working_dir>/tmp</UE_working_dir> + <UE_config_file></UE_config_file> + <UE_compile_prog></UE_compile_prog> + <UE_compile_prog_args></UE_compile_prog_args> + <UE_pre_exec>sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' </UE_pre_exec> + <UE_pre_exec_args></UE_pre_exec_args> + <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> + <UE_main_exec_args></UE_main_exec_args> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 10Mbits/s -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec_args></UE_traffic_exec_args> + <UE_search_expr_true></UE_search_expr_true> + <UE_search_expr_false></UE_search_expr_false> + <UE_terminate_missing_procs>False</UE_terminate_missing_procs> + <UE_stop_script>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue </UE_stop_script> + + <EPC_working_dir>/tmp</EPC_working_dir> + <EPC_config_file>BUILD/EPC/epc.conf.in MCC \"208\" + BUILD/EPC/epc.conf.in MNC \"92\" + BUILD/EPC/epc.conf.in TAC \"1\" + BUILD/EPC/epc.conf.in MME_INTERFACE_NAME_FOR_S1_MME \"eth0\" + BUILD/EPC/epc.conf.in MME_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.62/24\" + BUILD/EPC/epc.conf.in SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP \"eth0\"; + BUILD/EPC/epc.conf.in SGW_IPV4_ADDRESS_FOR_S1U_S12_S4_UP \"192.168.12.62/24\"; + BUILD/EPC/epc.conf.in PGW_INTERFACE_NAME_FOR_SGI \"eth0\" + BUILD/EPC/epc.conf.in PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.62/24\" + BUILD/EPC/epc.conf.in IPV4_LIST \"192.172.0.0/24\",\"192.172.1.0/24\" + BUILD/EPC/epc.conf.in OUTPUT \"CONSOLE\"</EPC_config_file> + <EPC_compile_prog>$OPENAIRCN_DIR/SCRIPTS/build_epc</EPC_compile_prog> + <EPC_compile_prog_args>-c -l</EPC_compile_prog_args> + <HSS_compile_prog>$OPENAIRCN_DIR/SCRIPTS/build_hss</HSS_compile_prog> + <HSS_compile_prog_args> -c -l --debug --random false </HSS_compile_prog_args> + + <EPC_pre_exec>sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' ; sudo -E ifconfig eth0 add 192.172.0.1</EPC_pre_exec> + <EPC_pre_exec_args></EPC_pre_exec_args> + <EPC_main_exec>$OPENAIRCN_DIR/SCRIPTS/run_epc </EPC_main_exec> + <EPC_main_exec_args> -r </EPC_main_exec_args> + <HSS_main_exec>sleep 10; cp $OPENAIRCN_DIR/BUILD/EPC/epc.conf.in $OPENAIRCN_TESTDIR/epc.conf.in; $OPENAIRCN_DIR/SCRIPTS/run_hss --export-db $OPENAIRCN_TESTDIR/hss_export.db </HSS_main_exec> + <HSS_main_exec_args></HSS_main_exec_args> + <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m -B 192.172.0.1</EPC_traffic_exec> + <EPC_traffic_exec_args></EPC_traffic_exec_args> + <EPC_search_expr_true>throughput_test min=1.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec </EPC_search_expr_true> + <EPC_search_expr_false></EPC_search_expr_false> + <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs> + <tags>USRPb210.OAI_EPC_remote.Bandrich.5MHz.FDD.Band_7.UL.1TX.1RX</tags> + <nruns>10</nruns> + </testCase> + + <testCase id="015701" > + <class>lte-softmodem</class> + <desc></desc> + <eNB>calisson</eNB> + <UE>stevens</UE> + <EPC>nano</EPC> + <TimeOut_cmd>390</TimeOut_cmd> + <eNB_working_dir>/tmp</eNB_working_dir> + <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf N_RB_DL 50 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf pdsch_referenceSignalPower -29 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mme_ip_address "ipv4=\"192.168.12.62\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tx_gain 90 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf rx_gain 125 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_PORT_FOR_S1U 2152</eNB_config_file> + <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog> + <eNB_compile_prog_args>--eNB -w USRP -c</eNB_compile_prog_args> + <eNB_pre_exec>sleep 15; sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' ; ifconfig ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf $OPENAIR_TESTDIR/enb.conf</eNB_pre_exec> + <eNB_pre_exec_args></eNB_pre_exec_args> + <eNB_main_exec> $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf -W </eNB_main_exec_args> + <eNB_traffic_exec></eNB_traffic_exec> + <eNB_traffic_exec_args></eNB_traffic_exec_args> + <eNB_search_expr_true></eNB_search_expr_true> + <eNB_search_expr_false></eNB_search_expr_false> + <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs> + + <UE_working_dir>/tmp</UE_working_dir> + <UE_config_file></UE_config_file> + <UE_compile_prog></UE_compile_prog> + <UE_compile_prog_args></UE_compile_prog_args> + <UE_pre_exec>sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' </UE_pre_exec> + <UE_pre_exec_args></UE_pre_exec_args> + <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> + <UE_main_exec_args></UE_main_exec_args> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 10Mbits/s -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec_args></UE_traffic_exec_args> + <UE_search_expr_true></UE_search_expr_true> + <UE_search_expr_false></UE_search_expr_false> + <UE_terminate_missing_procs>False</UE_terminate_missing_procs> + <UE_stop_script>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue </UE_stop_script> + + <EPC_working_dir>/tmp</EPC_working_dir> + <EPC_config_file>BUILD/EPC/epc.conf.in MCC \"208\" + BUILD/EPC/epc.conf.in MNC \"92\" + BUILD/EPC/epc.conf.in TAC \"1\" + BUILD/EPC/epc.conf.in MME_INTERFACE_NAME_FOR_S1_MME \"eth0\" + BUILD/EPC/epc.conf.in MME_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.62/24\" + BUILD/EPC/epc.conf.in SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP \"eth0\"; + BUILD/EPC/epc.conf.in SGW_IPV4_ADDRESS_FOR_S1U_S12_S4_UP \"192.168.12.62/24\"; + BUILD/EPC/epc.conf.in PGW_INTERFACE_NAME_FOR_SGI \"eth0\" + BUILD/EPC/epc.conf.in PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.62/24\" + BUILD/EPC/epc.conf.in IPV4_LIST \"192.172.0.0/24\",\"192.172.1.0/24\"</EPC_config_file> + <EPC_compile_prog>$OPENAIRCN_DIR/SCRIPTS/build_epc</EPC_compile_prog> + <EPC_compile_prog_args>-c -l</EPC_compile_prog_args> + <HSS_compile_prog>$OPENAIRCN_DIR/SCRIPTS/build_hss</HSS_compile_prog> + <HSS_compile_prog_args> -c -l --debug --random false </HSS_compile_prog_args> + + <EPC_pre_exec>sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' ;sudo -E ifconfig eth0 add 192.172.0.1; cp $OPENAIRCN_DIR/BUILD/EPC/epc.conf.in $OPENAIRCN_TESTDIR/epc.conf.in</EPC_pre_exec> + <EPC_pre_exec_args></EPC_pre_exec_args> + <EPC_main_exec>$OPENAIRCN_DIR/SCRIPTS/run_epc </EPC_main_exec> + <EPC_main_exec_args> -r </EPC_main_exec_args> + <HSS_main_exec>sleep 10; $OPENAIRCN_DIR/SCRIPTS/run_hss --export-db $OPENAIRCN_TESTDIR/hss_export.db </HSS_main_exec> + <HSS_main_exec_args></HSS_main_exec_args> + <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m -B 192.172.0.1</EPC_traffic_exec> + <EPC_traffic_exec_args></EPC_traffic_exec_args> + <EPC_search_expr_true>throughput_test min=1.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec </EPC_search_expr_true> + <EPC_search_expr_false></EPC_search_expr_false> + <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs> + <tags>USRPb210.OAI_EPC_remote.Bandrich.10MHz.FDD.Band_7.UL.1TX.1RX</tags> + <nruns>10</nruns> + </testCase> + + <testCase id="015702" > + <class>lte-softmodem</class> + <desc></desc> + <eNB>calisson</eNB> + <UE>stevens</UE> + <EPC>nano</EPC> + <TimeOut_cmd>390</TimeOut_cmd> + <eNB_working_dir>/tmp</eNB_working_dir> + <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf N_RB_DL 100 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf pdsch_referenceSignalPower -29 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mme_ip_address "ipv4=\"192.168.12.62\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tx_gain 90 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf rx_gain 125 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_PORT_FOR_S1U 2152</eNB_config_file> + <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog> + <eNB_compile_prog_args>--eNB -w USRP -c</eNB_compile_prog_args> + <eNB_pre_exec>sleep 15; sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' ;sudo -E ifconfig eth0:3 192.170.0.2 up ; sudo -E ifconfig eth0:4 192.170.1.2 up; ifconfig ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf $OPENAIR_TESTDIR/enb.conf </eNB_pre_exec> + <eNB_pre_exec_args></eNB_pre_exec_args> + <eNB_main_exec> $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf -W </eNB_main_exec_args> + <eNB_traffic_exec></eNB_traffic_exec> + <eNB_traffic_exec_args></eNB_traffic_exec_args> + <eNB_search_expr_true></eNB_search_expr_true> + <eNB_search_expr_false></eNB_search_expr_false> + <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs> + + <UE_working_dir>/tmp</UE_working_dir> + <UE_config_file></UE_config_file> + <UE_compile_prog></UE_compile_prog> + <UE_compile_prog_args></UE_compile_prog_args> + <UE_pre_exec>sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' </UE_pre_exec> + <UE_pre_exec_args></UE_pre_exec_args> + <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> + <UE_main_exec_args></UE_main_exec_args> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 10Mbits/s -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec_args></UE_traffic_exec_args> + <UE_search_expr_true></UE_search_expr_true> + <UE_search_expr_false></UE_search_expr_false> + <UE_terminate_missing_procs>False</UE_terminate_missing_procs> + <UE_stop_script>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue </UE_stop_script> + + <EPC_working_dir>/tmp</EPC_working_dir> + <EPC_config_file>BUILD/EPC/epc.conf.in MCC \"208\" + BUILD/EPC/epc.conf.in MNC \"92\" + BUILD/EPC/epc.conf.in TAC \"1\" + BUILD/EPC/epc.conf.in MME_INTERFACE_NAME_FOR_S1_MME \"eth0\" + BUILD/EPC/epc.conf.in MME_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.62/24\" + BUILD/EPC/epc.conf.in SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP \"eth0\"; + BUILD/EPC/epc.conf.in SGW_IPV4_ADDRESS_FOR_S1U_S12_S4_UP \"192.168.12.62/24\"; + BUILD/EPC/epc.conf.in PGW_INTERFACE_NAME_FOR_SGI \"eth0\" + BUILD/EPC/epc.conf.in PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.62/24\" + BUILD/EPC/epc.conf.in IPV4_LIST \"192.172.0.0/24\",\"192.172.1.0/24\"</EPC_config_file> + <EPC_compile_prog>$OPENAIRCN_DIR/SCRIPTS/build_epc</EPC_compile_prog> + <EPC_compile_prog_args>-c -l</EPC_compile_prog_args> + <HSS_compile_prog>$OPENAIRCN_DIR/SCRIPTS/build_hss</HSS_compile_prog> + <HSS_compile_prog_args> -c -l --debug --random false </HSS_compile_prog_args> + + <EPC_pre_exec>sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' ; sudo -E ifconfig eth0 add 192.172.0.1 ; cp $OPENAIRCN_DIR/BUILD/EPC/epc.conf.in $OPENAIRCN_TESTDIR/epc.conf.in</EPC_pre_exec> + <EPC_pre_exec_args></EPC_pre_exec_args> + <EPC_main_exec>$OPENAIRCN_DIR/SCRIPTS/run_epc </EPC_main_exec> + <EPC_main_exec_args> -r </EPC_main_exec_args> + <HSS_main_exec>sleep 10; $OPENAIRCN_DIR/SCRIPTS/run_hss --export-db $OPENAIRCN_TESTDIR/hss_export.db </HSS_main_exec> + <HSS_main_exec_args></HSS_main_exec_args> + <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m -B 192.172.0.1</EPC_traffic_exec> + <EPC_traffic_exec_args></EPC_traffic_exec_args> + <EPC_search_expr_true>throughput_test min=1.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec </EPC_search_expr_true> + <EPC_search_expr_false></EPC_search_expr_false> + <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs> + <tags>USRPb210.OAI_EPC_remote.Bandrich.20MHz.FDD.Band_7.UL.1TX.1RX</tags> + <nruns>10</nruns> + </testCase> + + <testCase id="015703" > + <class>lte-softmodem</class> + <desc></desc> + <eNB>calisson</eNB> + <UE>stevens</UE> + <EPC>nano</EPC> + <TimeOut_cmd>390</TimeOut_cmd> + <eNB_working_dir>/tmp</eNB_working_dir> + <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf N_RB_DL 25 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf pdsch_referenceSignalPower -26 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mme_ip_address "ipv4=\"192.168.12.62\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tx_gain 90 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf rx_gain 125 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_PORT_FOR_S1U 2152</eNB_config_file> + <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog> + <eNB_compile_prog_args>--eNB -w USRP -c</eNB_compile_prog_args> + <eNB_pre_exec>sleep 15; sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' ; ifconfig ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf $OPENAIR_TESTDIR/enb.conf</eNB_pre_exec> + <eNB_pre_exec_args></eNB_pre_exec_args> + <eNB_main_exec> $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf -W </eNB_main_exec_args> + <eNB_traffic_exec></eNB_traffic_exec> + <eNB_traffic_exec_args></eNB_traffic_exec_args> + <eNB_search_expr_true></eNB_search_expr_true> + <eNB_search_expr_false></eNB_search_expr_false> + <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs> + + <UE_working_dir>/tmp</UE_working_dir> + <UE_config_file></UE_config_file> + <UE_compile_prog></UE_compile_prog> + <UE_compile_prog_args></UE_compile_prog_args> + <UE_pre_exec>sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' </UE_pre_exec> + <UE_pre_exec_args></UE_pre_exec_args> + <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> + <UE_main_exec_args></UE_main_exec_args> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec_args></UE_traffic_exec_args> + <UE_search_expr_true>throughput_test min=10.0Mbits/sec max=10.5Mbits/sec average=11.0Mbits/sec </UE_search_expr_true> + <UE_search_expr_false></UE_search_expr_false> + <UE_terminate_missing_procs>False</UE_terminate_missing_procs> + <UE_stop_script>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue </UE_stop_script> + + <EPC_working_dir>/tmp</EPC_working_dir> + <EPC_config_file>BUILD/EPC/epc.conf.in MCC \"208\" + BUILD/EPC/epc.conf.in MNC \"92\" + BUILD/EPC/epc.conf.in TAC \"1\" + BUILD/EPC/epc.conf.in MME_INTERFACE_NAME_FOR_S1_MME \"eth0\" + BUILD/EPC/epc.conf.in MME_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.62/24\" + BUILD/EPC/epc.conf.in SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP \"eth0\"; + BUILD/EPC/epc.conf.in SGW_IPV4_ADDRESS_FOR_S1U_S12_S4_UP \"192.168.12.62/24\"; + BUILD/EPC/epc.conf.in PGW_INTERFACE_NAME_FOR_SGI \"eth0\" + BUILD/EPC/epc.conf.in PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.62/24\" + BUILD/EPC/epc.conf.in IPV4_LIST \"192.172.0.0/24\",\"192.172.1.0/24\"</EPC_config_file> + <EPC_compile_prog>$OPENAIRCN_DIR/SCRIPTS/build_epc</EPC_compile_prog> + <EPC_compile_prog_args>-c -l</EPC_compile_prog_args> + <HSS_compile_prog>$OPENAIRCN_DIR/SCRIPTS/build_hss</HSS_compile_prog> + <HSS_compile_prog_args> -c -l --debug --random false </HSS_compile_prog_args> + + <EPC_pre_exec>sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' ;sudo -E ifconfig eth0 add 192.172.0.1 ; cp $OPENAIRCN_DIR/BUILD/EPC/epc.conf.in $OPENAIRCN_TESTDIR/epc.conf.in</EPC_pre_exec> + <EPC_pre_exec_args></EPC_pre_exec_args> + <EPC_main_exec>$OPENAIRCN_DIR/SCRIPTS/run_epc </EPC_main_exec> + <EPC_main_exec_args> -r </EPC_main_exec_args> + <HSS_main_exec>sleep 10; $OPENAIRCN_DIR/SCRIPTS/run_hss --export-db $OPENAIRCN_TESTDIR/hss_export.db </HSS_main_exec> + <HSS_main_exec_args></HSS_main_exec_args> + <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s -B 192.172.0.1</EPC_traffic_exec> + <EPC_traffic_exec_args></EPC_traffic_exec_args> + <EPC_search_expr_true></EPC_search_expr_true> + <EPC_search_expr_false></EPC_search_expr_false> + <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs> + <tags>USRPb210.OAI_EPC_remote.Bandrich.5MHz.FDD.Band_7.DL.1TX.1RX</tags> + <nruns>10</nruns> + </testCase> + + <testCase id="015704" > + <class>lte-softmodem</class> + <desc></desc> + <eNB>calisson</eNB> + <UE>stevens</UE> + <EPC>nano</EPC> + <TimeOut_cmd>390</TimeOut_cmd> + <eNB_working_dir>/tmp</eNB_working_dir> + <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf N_RB_DL 50 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf pdsch_referenceSignalPower -29 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mme_ip_address "ipv4=\"192.168.12.62\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tx_gain 90 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf rx_gain 125 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_PORT_FOR_S1U 2152</eNB_config_file> + <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog> + <eNB_compile_prog_args>--eNB -w USRP -c</eNB_compile_prog_args> + <eNB_pre_exec>sleep 15; sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' ; ifconfig ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf $OPENAIR_TESTDIR/enb.conf</eNB_pre_exec> + <eNB_pre_exec_args></eNB_pre_exec_args> + <eNB_main_exec> $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf -W </eNB_main_exec_args> + <eNB_traffic_exec></eNB_traffic_exec> + <eNB_traffic_exec_args></eNB_traffic_exec_args> + <eNB_search_expr_true></eNB_search_expr_true> + <eNB_search_expr_false></eNB_search_expr_false> + <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs> + + <UE_working_dir>/tmp</UE_working_dir> + <UE_config_file></UE_config_file> + <UE_compile_prog></UE_compile_prog> + <UE_compile_prog_args></UE_compile_prog_args> + <UE_pre_exec>sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' </UE_pre_exec> + <UE_pre_exec_args></UE_pre_exec_args> + <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> + <UE_main_exec_args></UE_main_exec_args> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec_args></UE_traffic_exec_args> + <UE_search_expr_true>throughput_test min=20.0Mbits/sec max=21.0Mbits/sec average=22.0Mbits/sec </UE_search_expr_true> + <UE_search_expr_false></UE_search_expr_false> + <UE_terminate_missing_procs>False</UE_terminate_missing_procs> + <UE_stop_script>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue </UE_stop_script> + + <EPC_working_dir>/tmp</EPC_working_dir> + <EPC_config_file>BUILD/EPC/epc.conf.in MCC \"208\" + BUILD/EPC/epc.conf.in MNC \"92\" + BUILD/EPC/epc.conf.in TAC \"1\" + BUILD/EPC/epc.conf.in MME_INTERFACE_NAME_FOR_S1_MME \"eth0\" + BUILD/EPC/epc.conf.in MME_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.62/24\" + BUILD/EPC/epc.conf.in SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP \"eth0\"; + BUILD/EPC/epc.conf.in SGW_IPV4_ADDRESS_FOR_S1U_S12_S4_UP \"192.168.12.62/24\"; + BUILD/EPC/epc.conf.in PGW_INTERFACE_NAME_FOR_SGI \"eth0\" + BUILD/EPC/epc.conf.in PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.62/24\" + BUILD/EPC/epc.conf.in IPV4_LIST \"192.172.0.0/24\",\"192.172.1.0/24\"</EPC_config_file> + <EPC_compile_prog>$OPENAIRCN_DIR/SCRIPTS/build_epc</EPC_compile_prog> + <EPC_compile_prog_args>-c -l</EPC_compile_prog_args> + <HSS_compile_prog>$OPENAIRCN_DIR/SCRIPTS/build_hss</HSS_compile_prog> + <HSS_compile_prog_args> -c -l --debug --random false</HSS_compile_prog_args> + + <EPC_pre_exec>sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' ;sudo -E ifconfig eth0 add 192.172.0.1 ; cp $OPENAIRCN_DIR/BUILD/EPC/epc.conf.in $OPENAIRCN_TESTDIR/epc.conf.in</EPC_pre_exec> + <EPC_pre_exec_args></EPC_pre_exec_args> + <EPC_main_exec>$OPENAIRCN_DIR/SCRIPTS/run_epc </EPC_main_exec> + <EPC_main_exec_args> -r </EPC_main_exec_args> + <HSS_main_exec>sleep 10; $OPENAIRCN_DIR/SCRIPTS/run_hss --export-db $OPENAIRCN_TESTDIR/hss_export.db </HSS_main_exec> + <HSS_main_exec_args></HSS_main_exec_args> + <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s -B 192.172.0.1</EPC_traffic_exec> + <EPC_traffic_exec_args></EPC_traffic_exec_args> + <EPC_search_expr_true></EPC_search_expr_true> + <EPC_search_expr_false></EPC_search_expr_false> + <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs> + <tags>USRPb210.OAI_EPC_remote.Bandrich.10MHz.FDD.Band_7.DL.1TX.1RX</tags> + <nruns>10</nruns> + </testCase> + + <testCase id="015705" > + <class>lte-softmodem</class> + <desc></desc> + <eNB>calisson</eNB> + <UE>stevens</UE> + <EPC>nano</EPC> + <TimeOut_cmd>390</TimeOut_cmd> + <eNB_working_dir>/tmp</eNB_working_dir> + <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf N_RB_DL 100 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf pdsch_referenceSignalPower -29 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mme_ip_address "ipv4=\"192.168.12.62\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tx_gain 90 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf rx_gain 125 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_PORT_FOR_S1U 2152</eNB_config_file> + <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog> + <eNB_compile_prog_args>--eNB -w USRP -c</eNB_compile_prog_args> + <eNB_pre_exec>sleep 15; sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' ; ifconfig ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf $OPENAIR_TESTDIR/enb.conf</eNB_pre_exec> + <eNB_pre_exec_args></eNB_pre_exec_args> + <eNB_main_exec> $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf -W </eNB_main_exec_args> + <eNB_traffic_exec></eNB_traffic_exec> + <eNB_traffic_exec_args></eNB_traffic_exec_args> + <eNB_search_expr_true></eNB_search_expr_true> + <eNB_search_expr_false></eNB_search_expr_false> + <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs> + + <UE_working_dir>/tmp</UE_working_dir> + <UE_config_file></UE_config_file> + <UE_compile_prog></UE_compile_prog> + <UE_compile_prog_args></UE_compile_prog_args> + <UE_pre_exec>sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' </UE_pre_exec> + <UE_pre_exec_args></UE_pre_exec_args> + <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> + <UE_main_exec_args></UE_main_exec_args> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec_args></UE_traffic_exec_args> + <UE_search_expr_true>throughput_test min=20.0Mbits/sec max=21.0Mbits/sec average=22.0Mbits/sec </UE_search_expr_true> + <UE_search_expr_false></UE_search_expr_false> + <UE_terminate_missing_procs>False</UE_terminate_missing_procs> + <UE_stop_script>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue </UE_stop_script> + + <EPC_working_dir>/tmp</EPC_working_dir> + <EPC_config_file>BUILD/EPC/epc.conf.in MCC \"208\" + BUILD/EPC/epc.conf.in MNC \"92\" + BUILD/EPC/epc.conf.in TAC \"1\" + BUILD/EPC/epc.conf.in MME_INTERFACE_NAME_FOR_S1_MME \"eth0\" + BUILD/EPC/epc.conf.in MME_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.62/24\" + BUILD/EPC/epc.conf.in SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP \"eth0\"; + BUILD/EPC/epc.conf.in SGW_IPV4_ADDRESS_FOR_S1U_S12_S4_UP \"192.168.12.62/24\"; + BUILD/EPC/epc.conf.in PGW_INTERFACE_NAME_FOR_SGI \"eth0\" + BUILD/EPC/epc.conf.in PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.62/24\" + BUILD/EPC/epc.conf.in IPV4_LIST \"192.172.0.0/24\",\"192.172.1.0/24\"</EPC_config_file> + <EPC_compile_prog>$OPENAIRCN_DIR/SCRIPTS/build_epc</EPC_compile_prog> + <EPC_compile_prog_args>-c -l</EPC_compile_prog_args> + <HSS_compile_prog>$OPENAIRCN_DIR/SCRIPTS/build_hss</HSS_compile_prog> + <HSS_compile_prog_args> -c -l --debug --random false </HSS_compile_prog_args> + + <EPC_pre_exec>sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' ;sudo -E ifconfig eth0 add 192.172.0.1 ;cp $OPENAIRCN_DIR/BUILD/EPC/epc.conf.in $OPENAIRCN_TESTDIR/epc.conf.in </EPC_pre_exec> + <EPC_pre_exec_args></EPC_pre_exec_args> + <EPC_main_exec>$OPENAIRCN_DIR/SCRIPTS/run_epc </EPC_main_exec> + <EPC_main_exec_args> -r </EPC_main_exec_args> + <HSS_main_exec>sleep 10; $OPENAIRCN_DIR/SCRIPTS/run_hss --export-db $OPENAIRCN_TESTDIR/hss_export.db </HSS_main_exec> + <HSS_main_exec_args></HSS_main_exec_args> + <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s -B 192.172.0.1</EPC_traffic_exec> + <EPC_traffic_exec_args></EPC_traffic_exec_args> + <EPC_search_expr_true></EPC_search_expr_true> + <EPC_search_expr_false></EPC_search_expr_false> + <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs> + <tags>USRPb210.OAI_EPC_remote.Bandrich.20MHz.FDD.Band_7.DL.1TX.1RX</tags> + <nruns>10</nruns> + </testCase> + + + <testCase id="015800" > + <class>lte-softmodem</class> + <desc></desc> + <eNB>mozart</eNB> + <UE>stevens</UE> + <EPC>amerique</EPC> + <TimeOut_cmd>390</TimeOut_cmd> + <eNB_working_dir>/tmp</eNB_working_dir> + <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf N_RB_DL 25 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1U \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf ENB_PORT_FOR_S1U 2152</eNB_config_file> + <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog> + <eNB_compile_prog_args>--eNB -w USRP -x -c </eNB_compile_prog_args> + <eNB_pre_exec>sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail</eNB_pre_exec> + <eNB_pre_exec_args></eNB_pre_exec_args> + <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf -W </eNB_main_exec_args> + <eNB_traffic_exec></eNB_traffic_exec> + <eNB_traffic_exec_args></eNB_traffic_exec_args> + <eNB_search_expr_true></eNB_search_expr_true> + <eNB_search_expr_false></eNB_search_expr_false> + <eNB_terminate_missing_procs>True</eNB_terminate_missing_procs> + + <UE_working_dir>/tmp</UE_working_dir> + <UE_config_file></UE_config_file> + <UE_compile_prog_args></UE_compile_prog_args> + <UE_pre_exec></UE_pre_exec> + <UE_pre_exec_args></UE_pre_exec_args> + <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> + <UE_main_exec_args></UE_main_exec_args> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 10Mbits/s -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec_args></UE_traffic_exec_args> + <UE_search_expr_true></UE_search_expr_true> + <UE_search_expr_false></UE_search_expr_false> + <UE_terminate_missing_procs>True</UE_terminate_missing_procs> + <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue </UE_stop_script> + + <EPC_working_dir>/tmp</EPC_working_dir> + <EPC_config_file></EPC_config_file> + <EPC_compile_prog></EPC_compile_prog> + <EPC_compile_prog_args></EPC_compile_prog_args> + <HSS_compile_prog></HSS_compile_prog> + <HSS_compile_prog_args></HSS_compile_prog_args> + + <EPC_pre_exec></EPC_pre_exec> + <EPC_pre_exec_args></EPC_pre_exec_args> + <EPC_main_exec>/opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000</EPC_main_exec> + <EPC_main_exec_args></EPC_main_exec_args> + <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec> + <HSS_main_exec_args></HSS_main_exec_args> + <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m -B 192.172.0.1</EPC_traffic_exec> + <EPC_traffic_exec_args></EPC_traffic_exec_args> + <EPC_search_expr_true>throughput_test min=1.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec </EPC_search_expr_true> + <EPC_search_expr_false></EPC_search_expr_false> + <EPC_terminate_missing_procs>True</EPC_terminate_missing_procs> + <tags>USRPx310.ALU_EPC.Bandrich.5MHz.FDD.Band_7.UL.1TX.1RX</tags> + <nruns>10</nruns> + </testCase> + + + <testCase id="015801" > + <class>lte-softmodem</class> + <desc></desc> + <eNB>mozart</eNB> + <UE>stevens</UE> + <EPC>amerique</EPC> + <TimeOut_cmd>390</TimeOut_cmd> + <eNB_working_dir>/tmp</eNB_working_dir> + <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf N_RB_DL 50 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.conf ENB_INTERFACE_NAME_FOR_S1U \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.conf ENB_PORT_FOR_S1U 2152</eNB_config_file> + <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog> + <eNB_compile_prog_args>--eNB -w USRP -x -c </eNB_compile_prog_args> + <eNB_pre_exec>sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail</eNB_pre_exec> + <eNB_pre_exec_args></eNB_pre_exec_args> + <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf -W </eNB_main_exec_args> + <eNB_traffic_exec></eNB_traffic_exec> + <eNB_traffic_exec_args></eNB_traffic_exec_args> + <eNB_search_expr_true></eNB_search_expr_true> + <eNB_search_expr_false></eNB_search_expr_false> + <eNB_terminate_missing_procs>True</eNB_terminate_missing_procs> + + <UE_working_dir>/tmp</UE_working_dir> + <UE_config_file></UE_config_file> + <UE_compile_prog_args></UE_compile_prog_args> + <UE_pre_exec></UE_pre_exec> + <UE_pre_exec_args></UE_pre_exec_args> + <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> + <UE_main_exec_args></UE_main_exec_args> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 10Mbits/s -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec_args></UE_traffic_exec_args> + <UE_search_expr_true></UE_search_expr_true> + <UE_search_expr_false></UE_search_expr_false> + <UE_terminate_missing_procs>True</UE_terminate_missing_procs> + <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue </UE_stop_script> + + <EPC_working_dir>/tmp</EPC_working_dir> + <EPC_config_file></EPC_config_file> + <EPC_compile_prog></EPC_compile_prog> + <EPC_compile_prog_args></EPC_compile_prog_args> + <HSS_compile_prog></HSS_compile_prog> + <HSS_compile_prog_args></HSS_compile_prog_args> + + <EPC_pre_exec></EPC_pre_exec> + <EPC_pre_exec_args></EPC_pre_exec_args> + <EPC_main_exec>/opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000</EPC_main_exec> + <EPC_main_exec_args></EPC_main_exec_args> + <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec> + <HSS_main_exec_args></HSS_main_exec_args> + <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m -B 192.172.0.1</EPC_traffic_exec> + <EPC_traffic_exec_args></EPC_traffic_exec_args> + <EPC_search_expr_true>throughput_test min=1.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec </EPC_search_expr_true> + <EPC_search_expr_false></EPC_search_expr_false> + <EPC_terminate_missing_procs>True</EPC_terminate_missing_procs> + <tags>USRPx310.ALU_EPC.Bandrich.10MHz.FDD.Band_7.UL.1TX.1RX</tags> + <nruns>10</nruns> + </testCase> + + <testCase id="015802" > + <class>lte-softmodem</class> + <desc></desc> + <eNB>mozart</eNB> + <UE>stevens</UE> + <EPC>amerique</EPC> + <TimeOut_cmd>390</TimeOut_cmd> + <eNB_working_dir>/tmp</eNB_working_dir> + <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf N_RB_DL 100 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf ENB_INTERFACE_NAME_FOR_S1U \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf ENB_PORT_FOR_S1U 2152</eNB_config_file> + <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog> + <eNB_compile_prog_args>--eNB -w USRP -x -c </eNB_compile_prog_args> + <eNB_pre_exec>sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail</eNB_pre_exec> + <eNB_pre_exec_args></eNB_pre_exec_args> + <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf -W </eNB_main_exec_args> + <eNB_traffic_exec></eNB_traffic_exec> + <eNB_traffic_exec_args></eNB_traffic_exec_args> + <eNB_search_expr_true></eNB_search_expr_true> + <eNB_search_expr_false></eNB_search_expr_false> + <eNB_terminate_missing_procs>True</eNB_terminate_missing_procs> + + <UE_working_dir>/tmp</UE_working_dir> + <UE_config_file></UE_config_file> + <UE_compile_prog></UE_compile_prog> + <UE_compile_prog_args></UE_compile_prog_args> + <UE_pre_exec></UE_pre_exec> + <UE_pre_exec_args></UE_pre_exec_args> + <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> + <UE_main_exec_args></UE_main_exec_args> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 10Mbits/s -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec_args></UE_traffic_exec_args> + <UE_search_expr_true></UE_search_expr_true> + <UE_search_expr_false></UE_search_expr_false> + <UE_terminate_missing_procs>True</UE_terminate_missing_procs> + <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue </UE_stop_script> + + <EPC_working_dir>/tmp</EPC_working_dir> + <EPC_config_file></EPC_config_file> + <EPC_compile_prog></EPC_compile_prog> + <EPC_compile_prog_args></EPC_compile_prog_args> + <HSS_compile_prog></HSS_compile_prog> + <HSS_compile_prog_args></HSS_compile_prog_args> + + <EPC_pre_exec></EPC_pre_exec> + <EPC_pre_exec_args></EPC_pre_exec_args> + <EPC_main_exec>/opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000</EPC_main_exec> + <EPC_main_exec_args></EPC_main_exec_args> + <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec> + <HSS_main_exec_args></HSS_main_exec_args> + <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m -B 192.172.0.1</EPC_traffic_exec> + <EPC_traffic_exec_args></EPC_traffic_exec_args> + <EPC_search_expr_true>throughput_test min=1.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec </EPC_search_expr_true> + <EPC_search_expr_false></EPC_search_expr_false> + <EPC_terminate_missing_procs>True</EPC_terminate_missing_procs> + <tags>USRPx310.ALU_EPC.Bandrich.20MHz.FDD.Band_7.UL.1TX.1RX</tags> + <nruns>10</nruns> + </testCase> + + <testCase id="015803" > + <class>lte-softmodem</class> + <desc></desc> + <eNB>mozart</eNB> + <UE>stevens</UE> + <EPC>amerique</EPC> + <TimeOut_cmd>390</TimeOut_cmd> + <eNB_working_dir>/tmp</eNB_working_dir> + <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf N_RB_DL 25 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1U \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf ENB_PORT_FOR_S1U 2152</eNB_config_file> + <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog> + <eNB_compile_prog_args>--eNB -w USRP -x -c </eNB_compile_prog_args> + <eNB_pre_exec>sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail</eNB_pre_exec> + <eNB_pre_exec_args></eNB_pre_exec_args> + <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf -W </eNB_main_exec_args> + <eNB_traffic_exec></eNB_traffic_exec> + <eNB_traffic_exec_args></eNB_traffic_exec_args> + <eNB_search_expr_true></eNB_search_expr_true> + <eNB_search_expr_false></eNB_search_expr_false> + <eNB_terminate_missing_procs>True</eNB_terminate_missing_procs> + + <UE_working_dir>/tmp</UE_working_dir> + <UE_config_file></UE_config_file> + <UE_compile_prog></UE_compile_prog> + <UE_compile_prog_args></UE_compile_prog_args> + <UE_pre_exec></UE_pre_exec> + <UE_pre_exec_args></UE_pre_exec_args> + <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> + <UE_main_exec_args></UE_main_exec_args> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec_args></UE_traffic_exec_args> + <UE_terminate_missing_procs>True</UE_terminate_missing_procs> + <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue </UE_stop_script> + <UE_search_expr_true>throughput_test min=4.0Mbits/sec max=5.0Mbits/sec average=4.0Mbits/sec </UE_search_expr_true> + <UE_search_expr_false></UE_search_expr_false> + + <EPC_working_dir>/tmp</EPC_working_dir> + <EPC_config_file></EPC_config_file> + <EPC_compile_prog></EPC_compile_prog> + <EPC_compile_prog_args></EPC_compile_prog_args> + <HSS_compile_prog></HSS_compile_prog> + <HSS_compile_prog_args></HSS_compile_prog_args> + + <EPC_pre_exec></EPC_pre_exec> + <EPC_pre_exec_args></EPC_pre_exec_args> + <EPC_main_exec>/opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000</EPC_main_exec> + <EPC_main_exec_args></EPC_main_exec_args> + <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec> + <HSS_main_exec_args></HSS_main_exec_args> + <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s -B 192.172.0.1</EPC_traffic_exec> + <EPC_traffic_exec_args></EPC_traffic_exec_args> + <EPC_search_expr_false></EPC_search_expr_false> + <EPC_terminate_missing_procs>True</EPC_terminate_missing_procs> + <tags>USRPx310.ALU_EPC.Bandrich.5MHz.FDD.Band_7.DL.1TX.1RX</tags> + <nruns>10</nruns> + </testCase> + + <testCase id="015804" > + <class>lte-softmodem</class> + <desc></desc> + <eNB>mozart</eNB> + <UE>stevens</UE> + <EPC>amerique</EPC> + <TimeOut_cmd>390</TimeOut_cmd> + <eNB_working_dir>/tmp</eNB_working_dir> + <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf N_RB_DL 50 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf ENB_INTERFACE_NAME_FOR_S1U \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf ENB_PORT_FOR_S1U 2152</eNB_config_file> + <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog> + <eNB_compile_prog_args>--eNB -w USRP -x -c </eNB_compile_prog_args> + <eNB_pre_exec>sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail</eNB_pre_exec> + <eNB_pre_exec_args>sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail</eNB_pre_exec_args> + <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf -W </eNB_main_exec_args> + <eNB_traffic_exec></eNB_traffic_exec> + <eNB_traffic_exec_args></eNB_traffic_exec_args> + <eNB_search_expr_true></eNB_search_expr_true> + <eNB_search_expr_false></eNB_search_expr_false> + <eNB_terminate_missing_procs>True</eNB_terminate_missing_procs> + + <UE_working_dir>/tmp</UE_working_dir> + <UE_config_file></UE_config_file> + <UE_compile_prog></UE_compile_prog> + <UE_compile_prog_args></UE_compile_prog_args> + <UE_pre_exec></UE_pre_exec> + <UE_pre_exec_args></UE_pre_exec_args> + <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> + <UE_main_exec_args></UE_main_exec_args> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec_args></UE_traffic_exec_args> + <UE_terminate_missing_procs>True</UE_terminate_missing_procs> + <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue </UE_stop_script> + <UE_search_expr_true>throughput_test min=8.0Mbits/sec max=9.0Mbits/sec average=8.5Mbits/sec </UE_search_expr_true> + <UE_search_expr_false></UE_search_expr_false> + + <EPC_working_dir>/tmp</EPC_working_dir> + <EPC_config_file></EPC_config_file> + <EPC_compile_prog></EPC_compile_prog> + <EPC_compile_prog_args></EPC_compile_prog_args> + <HSS_compile_prog></HSS_compile_prog> + <HSS_compile_prog_args></HSS_compile_prog_args> + + <EPC_pre_exec></EPC_pre_exec> + <EPC_pre_exec_args></EPC_pre_exec_args> + <EPC_main_exec>/opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000</EPC_main_exec> + <EPC_main_exec_args></EPC_main_exec_args> + <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec> + <HSS_main_exec_args></HSS_main_exec_args> + <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s -B 192.172.0.1</EPC_traffic_exec> + <EPC_traffic_exec_args></EPC_traffic_exec_args> + <EPC_search_expr_false></EPC_search_expr_false> + <EPC_terminate_missing_procs>True</EPC_terminate_missing_procs> + <tags>USRPx310.ALU_EPC.Bandrich.10MHz.FDD.Band_7.DL.1TX.1RX</tags> + <nruns>10</nruns> + </testCase> + + <testCase id="015805" > + <class>lte-softmodem</class> + <desc></desc> + <eNB>mozart</eNB> + <UE>stevens</UE> + <EPC>amerique</EPC> + <TimeOut_cmd>390</TimeOut_cmd> + <eNB_working_dir>/tmp</eNB_working_dir> + <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf N_RB_DL 100 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf ENB_INTERFACE_NAME_FOR_S1U \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf ENB_PORT_FOR_S1U 2152</eNB_config_file> + <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog> + <eNB_compile_prog_args>--eNB -w USRP -x -c </eNB_compile_prog_args> + <eNB_pre_exec>sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail</eNB_pre_exec> + <eNB_pre_exec_args></eNB_pre_exec_args> + <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf -W </eNB_main_exec_args> + <eNB_traffic_exec></eNB_traffic_exec> + <eNB_traffic_exec_args></eNB_traffic_exec_args> + <eNB_search_expr_true></eNB_search_expr_true> + <eNB_search_expr_false></eNB_search_expr_false> + <eNB_terminate_missing_procs>True</eNB_terminate_missing_procs> + + <UE_working_dir>/tmp</UE_working_dir> + <UE_config_file></UE_config_file> + <UE_compile_prog></UE_compile_prog> + <UE_compile_prog_args></UE_compile_prog_args> + <UE_pre_exec></UE_pre_exec> + <UE_pre_exec_args></UE_pre_exec_args> + <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> + <UE_main_exec_args></UE_main_exec_args> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec_args></UE_traffic_exec_args> + <UE_terminate_missing_procs>True</UE_terminate_missing_procs> + <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue </UE_stop_script> + <UE_search_expr_true>throughput_test min=15.0Mbits/sec max=15.0Mbits/sec average=15.0Mbits/sec </UE_search_expr_true> + <UE_search_expr_false></UE_search_expr_false> + + <EPC_working_dir>/tmp</EPC_working_dir> + <EPC_config_file></EPC_config_file> + <EPC_compile_prog></EPC_compile_prog> + <EPC_compile_prog_args></EPC_compile_prog_args> + <HSS_compile_prog></HSS_compile_prog> + <HSS_compile_prog_args></HSS_compile_prog_args> + + <EPC_pre_exec></EPC_pre_exec> + <EPC_pre_exec_args></EPC_pre_exec_args> + <EPC_main_exec>/opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000</EPC_main_exec> + <EPC_main_exec_args></EPC_main_exec_args> + <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec> + <HSS_main_exec_args></HSS_main_exec_args> + <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s -B 192.172.0.1</EPC_traffic_exec> + <EPC_traffic_exec_args></EPC_traffic_exec_args> + <EPC_search_expr_false></EPC_search_expr_false> + <EPC_terminate_missing_procs>True</EPC_terminate_missing_procs> + <tags>USRPx310.ALU_EPC.Bandrich.20MHz.FDD.Band_7.DL.1TX.1RX</tags> + <nruns>10</nruns> + </testCase> + + + + + <testCase id="016000" > + <class>lte-softmodem</class> + <desc></desc> + <eNB>mozart</eNB> + <UE>stevens</UE> + <EPC>nano</EPC> + <TimeOut_cmd>390</TimeOut_cmd> + <eNB_working_dir>/tmp</eNB_working_dir> + <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf N_RB_DL 25 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf mme_ip_address "ipv4=\"192.168.12.62\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1U \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf ENB_PORT_FOR_S1U 2152</eNB_config_file> + <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog> + <eNB_compile_prog_args>--eNB -w USRP -x -c </eNB_compile_prog_args> + <eNB_pre_exec>sleep 15; sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf $OPENAIR_TESTDIR/enb.conf</eNB_pre_exec> + <eNB_pre_exec_args></eNB_pre_exec_args> + <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf -W </eNB_main_exec_args> + <eNB_traffic_exec></eNB_traffic_exec> + <eNB_traffic_exec_args></eNB_traffic_exec_args> + <eNB_search_expr_true></eNB_search_expr_true> + <eNB_search_expr_false></eNB_search_expr_false> + <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs> + + <UE_working_dir>/tmp</UE_working_dir> + <UE_config_file></UE_config_file> + <UE_compile_prog></UE_compile_prog> + <UE_compile_prog_args></UE_compile_prog_args> + <UE_pre_exec>sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' </UE_pre_exec> + <UE_pre_exec_args></UE_pre_exec_args> + <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> + <UE_main_exec_args></UE_main_exec_args> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 10Mbits/s -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec_args></UE_traffic_exec_args> + <UE_search_expr_true></UE_search_expr_true> + <UE_search_expr_false></UE_search_expr_false> + <UE_terminate_missing_procs>False</UE_terminate_missing_procs> + <UE_stop_script>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue </UE_stop_script> + + <EPC_working_dir>/tmp</EPC_working_dir> + <EPC_config_file>BUILD/EPC/epc.conf.in MCC \"208\" + BUILD/EPC/epc.conf.in MNC \"92\" + BUILD/EPC/epc.conf.in TAC \"1\" + BUILD/EPC/epc.conf.in MME_INTERFACE_NAME_FOR_S1_MME \"eth0\" + BUILD/EPC/epc.conf.in MME_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.62/24\" + BUILD/EPC/epc.conf.in SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP \"eth0\"; + BUILD/EPC/epc.conf.in SGW_IPV4_ADDRESS_FOR_S1U_S12_S4_UP \"192.168.12.62/24\"; + BUILD/EPC/epc.conf.in PGW_INTERFACE_NAME_FOR_SGI \"eth0\" + BUILD/EPC/epc.conf.in PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.62/24\" + BUILD/EPC/epc.conf.in IPV4_LIST \"192.172.0.0/24\",\"192.172.1.0/24\"</EPC_config_file> + <EPC_compile_prog>$OPENAIRCN_DIR/SCRIPTS/build_epc</EPC_compile_prog> + <EPC_compile_prog_args>-c -l</EPC_compile_prog_args> + <HSS_compile_prog>$OPENAIRCN_DIR/SCRIPTS/build_hss</HSS_compile_prog> + <HSS_compile_prog_args> -c -l --debug --random false </HSS_compile_prog_args> + + <EPC_pre_exec>sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' ; sudo -E ifconfig eth0 add 192.172.0.1 ; cp $OPENAIRCN_DIR/BUILD/EPC/epc.conf.in $OPENAIRCN_TESTDIR/epc.conf.in</EPC_pre_exec> + <EPC_pre_exec_args></EPC_pre_exec_args> + <EPC_main_exec>$OPENAIRCN_DIR/SCRIPTS/run_epc </EPC_main_exec> + <EPC_main_exec_args> -r </EPC_main_exec_args> + <HSS_main_exec>sleep 10; $OPENAIRCN_DIR/SCRIPTS/run_hss --export-db $OPENAIRCN_TESTDIR/hss_export.db </HSS_main_exec> + <HSS_main_exec_args></HSS_main_exec_args> + <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m -B 192.172.0.1</EPC_traffic_exec> + <EPC_traffic_exec_args></EPC_traffic_exec_args> + <EPC_search_expr_true>throughput_test min=1.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec </EPC_search_expr_true> + <EPC_search_expr_false></EPC_search_expr_false> + <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs> + <tags>USRPx310.OAI_EPC_remote.Bandrich.5MHz.FDD.Band_7.UL.1TX.1RX</tags> + <nruns>10</nruns> + </testCase> + + + + <testCase id="016001" > + <class>lte-softmodem</class> + <desc></desc> + <eNB>mozart</eNB> + <UE>stevens</UE> + <EPC>nano</EPC> + <TimeOut_cmd>390</TimeOut_cmd> + <eNB_working_dir>/tmp</eNB_working_dir> + <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf N_RB_DL 50 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf mme_ip_address "ipv4=\"192.168.12.62\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf ENB_INTERFACE_NAME_FOR_S1U \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf ENB_PORT_FOR_S1U 2152</eNB_config_file> + <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog> + <eNB_compile_prog_args>--eNB -w USRP -x -c </eNB_compile_prog_args> + <eNB_pre_exec>sleep 15; sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.epc.remote.conf $OPENAIR_TESTDIR/enb.conf</eNB_pre_exec> + <eNB_pre_exec_args></eNB_pre_exec_args> + <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf -W </eNB_main_exec_args> + <eNB_traffic_exec></eNB_traffic_exec> + <eNB_traffic_exec_args></eNB_traffic_exec_args> + <eNB_search_expr_true></eNB_search_expr_true> + <eNB_search_expr_false></eNB_search_expr_false> + <eNB_terminate_missing_procs>True</eNB_terminate_missing_procs> + + <UE_working_dir>/tmp</UE_working_dir> + <UE_config_file></UE_config_file> + <UE_compile_prog></UE_compile_prog> + <UE_compile_prog_args></UE_compile_prog_args> + <UE_pre_exec>sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' </UE_pre_exec> + <UE_pre_exec_args></UE_pre_exec_args> + <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> + <UE_main_exec_args></UE_main_exec_args> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 10Mbits/s -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec_args></UE_traffic_exec_args> + <UE_search_expr_true></UE_search_expr_true> + <UE_search_expr_false></UE_search_expr_false> + <UE_terminate_missing_procs>False</UE_terminate_missing_procs> + <UE_stop_script>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue </UE_stop_script> + + <EPC_working_dir>/tmp</EPC_working_dir> + <EPC_config_file>BUILD/EPC/epc.conf.in MCC \"208\" + BUILD/EPC/epc.conf.in MNC \"92\" + BUILD/EPC/epc.conf.in TAC \"1\" + BUILD/EPC/epc.conf.in MME_INTERFACE_NAME_FOR_S1_MME \"eth0\" + BUILD/EPC/epc.conf.in MME_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.62/24\" + BUILD/EPC/epc.conf.in SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP \"eth0\"; + BUILD/EPC/epc.conf.in SGW_IPV4_ADDRESS_FOR_S1U_S12_S4_UP \"192.168.12.62/24\"; + BUILD/EPC/epc.conf.in PGW_INTERFACE_NAME_FOR_SGI \"eth0\" + BUILD/EPC/epc.conf.in PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.62/24\" + BUILD/EPC/epc.conf.in IPV4_LIST \"192.172.0.0/24\",\"192.172.1.0/24\"</EPC_config_file> + <EPC_compile_prog>$OPENAIRCN_DIR/SCRIPTS/build_epc</EPC_compile_prog> + <EPC_compile_prog_args>-c -l</EPC_compile_prog_args> + <HSS_compile_prog>$OPENAIRCN_DIR/SCRIPTS/build_hss</HSS_compile_prog> + <HSS_compile_prog_args> -c -l --debug --random false </HSS_compile_prog_args> + + <EPC_pre_exec>sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' ;sudo -E ifconfig eth0 add 192.172.0.1 ; cp $OPENAIRCN_DIR/BUILD/EPC/epc.conf.in $OPENAIRCN_TESTDIR/epc.conf.in </EPC_pre_exec> + <EPC_pre_exec_args></EPC_pre_exec_args> + <EPC_main_exec>$OPENAIRCN_DIR/SCRIPTS/run_epc </EPC_main_exec> + <EPC_main_exec_args> -r </EPC_main_exec_args> + <HSS_main_exec>sleep 10; $OPENAIRCN_DIR/SCRIPTS/run_hss --export-db $OPENAIRCN_TESTDIR/hss_export.db </HSS_main_exec> + <HSS_main_exec_args></HSS_main_exec_args> + <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m -B 192.172.0.1</EPC_traffic_exec> + <EPC_traffic_exec_args></EPC_traffic_exec_args> + <EPC_search_expr_true>throughput_test min=1.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec </EPC_search_expr_true> + <EPC_search_expr_false></EPC_search_expr_false> + <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs> + <tags>USRPx310.OAI_EPC_remote.Bandrich.10MHz.FDD.Band_7.UL.1TX.1RX</tags> + <nruns>10</nruns> + </testCase> + + <testCase id="016002" > + <class>lte-softmodem</class> + <desc></desc> + <eNB>mozart</eNB> + <UE>stevens</UE> + <EPC>nano</EPC> + <TimeOut_cmd>390</TimeOut_cmd> + <eNB_working_dir>/tmp</eNB_working_dir> + <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf N_RB_DL 100 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf mme_ip_address "ipv4=\"192.168.12.62\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf ENB_INTERFACE_NAME_FOR_S1U \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf ENB_PORT_FOR_S1U 2152</eNB_config_file> + <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog> + <eNB_compile_prog_args>--eNB -w USRP -x -c </eNB_compile_prog_args> + <eNB_pre_exec>sleep 15; sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.epc.remote.conf $OPENAIR_TESTDIR/enb.conf</eNB_pre_exec> + <eNB_pre_exec_args></eNB_pre_exec_args> + <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf -W </eNB_main_exec_args> + <eNB_traffic_exec></eNB_traffic_exec> + <eNB_traffic_exec_args></eNB_traffic_exec_args> + <eNB_search_expr_true></eNB_search_expr_true> + <eNB_search_expr_false></eNB_search_expr_false> + <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs> + + <UE_working_dir>/tmp</UE_working_dir> + <UE_config_file></UE_config_file> + <UE_compile_prog></UE_compile_prog> + <UE_compile_prog_args></UE_compile_prog_args> + <UE_pre_exec>sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' </UE_pre_exec> + <UE_pre_exec_args></UE_pre_exec_args> + <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> + <UE_main_exec_args></UE_main_exec_args> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 10Mbits/s -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec_args></UE_traffic_exec_args> + <UE_search_expr_true></UE_search_expr_true> + <UE_search_expr_false></UE_search_expr_false> + <UE_terminate_missing_procs>False</UE_terminate_missing_procs> + <UE_stop_script>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue </UE_stop_script> + + <EPC_working_dir>/tmp</EPC_working_dir> + <EPC_config_file>BUILD/EPC/epc.conf.in MCC \"208\" + BUILD/EPC/epc.conf.in MNC \"92\" + BUILD/EPC/epc.conf.in TAC \"1\" + BUILD/EPC/epc.conf.in MME_INTERFACE_NAME_FOR_S1_MME \"eth0\" + BUILD/EPC/epc.conf.in MME_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.62/24\" + BUILD/EPC/epc.conf.in SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP \"eth0\"; + BUILD/EPC/epc.conf.in SGW_IPV4_ADDRESS_FOR_S1U_S12_S4_UP \"192.168.12.62/24\"; + BUILD/EPC/epc.conf.in PGW_INTERFACE_NAME_FOR_SGI \"eth0\" + BUILD/EPC/epc.conf.in PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.62/24\" + BUILD/EPC/epc.conf.in IPV4_LIST \"192.172.0.0/24\",\"192.172.1.0/24\"</EPC_config_file> + <EPC_compile_prog>$OPENAIRCN_DIR/SCRIPTS/build_epc</EPC_compile_prog> + <EPC_compile_prog_args>-c -l</EPC_compile_prog_args> + <HSS_compile_prog>$OPENAIRCN_DIR/SCRIPTS/build_hss</HSS_compile_prog> + <HSS_compile_prog_args> -c -l --debug --random false</HSS_compile_prog_args> + + <EPC_pre_exec>sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' ; sudo -E ifconfig eth0 add 192.172.0.1</EPC_pre_exec> + <EPC_pre_exec_args></EPC_pre_exec_args> + <EPC_main_exec>$OPENAIRCN_DIR/SCRIPTS/run_epc </EPC_main_exec> + <EPC_main_exec_args> -r </EPC_main_exec_args> + <HSS_main_exec>sleep 10; $OPENAIRCN_DIR/SCRIPTS/run_hss --export-db $OPENAIRCN_TESTDIR/hss_export.db </HSS_main_exec> + <HSS_main_exec_args></HSS_main_exec_args> + <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m -B 192.172.0.1</EPC_traffic_exec> + <EPC_traffic_exec_args></EPC_traffic_exec_args> + <EPC_search_expr_true>throughput_test min=1.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec </EPC_search_expr_true> + <EPC_search_expr_false></EPC_search_expr_false> + <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs> + <tags>USRPx310.OAI_EPC_remote.Bandrich.20MHz.FDD.Band_7.UL.1TX.1RX</tags> + <nruns>10</nruns> + </testCase> + + <testCase id="016003" > + <class>lte-softmodem</class> + <desc></desc> + <eNB>mozart</eNB> + <UE>stevens</UE> + <EPC>nano</EPC> + <TimeOut_cmd>390</TimeOut_cmd> + <eNB_working_dir>/tmp</eNB_working_dir> + <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf N_RB_DL 25 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf mme_ip_address "ipv4=\"192.168.12.62\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1U \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf ENB_PORT_FOR_S1U 2152</eNB_config_file> + <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog> + <eNB_compile_prog_args>--eNB -w USRP -x -c </eNB_compile_prog_args> + <eNB_pre_exec>sleep 15; sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf $OPENAIR_TESTDIR/enb.conf</eNB_pre_exec> + <eNB_pre_exec_args></eNB_pre_exec_args> + <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf -W </eNB_main_exec_args> + <eNB_traffic_exec></eNB_traffic_exec> + <eNB_traffic_exec_args></eNB_traffic_exec_args> + <eNB_search_expr_true></eNB_search_expr_true> + <eNB_search_expr_false></eNB_search_expr_false> + <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs> + + <UE_working_dir>/tmp</UE_working_dir> + <UE_config_file></UE_config_file> + <UE_compile_prog></UE_compile_prog> + <UE_compile_prog_args></UE_compile_prog_args> + <UE_pre_exec>sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' </UE_pre_exec> + <UE_pre_exec_args></UE_pre_exec_args> + <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> + <UE_main_exec_args></UE_main_exec_args> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec_args></UE_traffic_exec_args> + <UE_search_expr_true>throughput_test min=10.0Mbits/sec max=10.5Mbits/sec average=11.0Mbits/sec </UE_search_expr_true> + <UE_search_expr_false></UE_search_expr_false> + <UE_terminate_missing_procs>False</UE_terminate_missing_procs> + <UE_stop_script>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue </UE_stop_script> + + <EPC_working_dir>/tmp</EPC_working_dir> + <EPC_config_file>BUILD/EPC/epc.conf.in MCC \"208\" + BUILD/EPC/epc.conf.in MNC \"92\" + BUILD/EPC/epc.conf.in TAC \"1\" + BUILD/EPC/epc.conf.in MME_INTERFACE_NAME_FOR_S1_MME \"eth0\" + BUILD/EPC/epc.conf.in MME_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.62/24\" + BUILD/EPC/epc.conf.in SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP \"eth0\"; + BUILD/EPC/epc.conf.in SGW_IPV4_ADDRESS_FOR_S1U_S12_S4_UP \"192.168.12.62/24\"; + BUILD/EPC/epc.conf.in PGW_INTERFACE_NAME_FOR_SGI \"eth0\" + BUILD/EPC/epc.conf.in PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.62/24\" + BUILD/EPC/epc.conf.in IPV4_LIST \"192.172.0.0/24\",\"192.172.1.0/24\"</EPC_config_file> + <EPC_compile_prog>$OPENAIRCN_DIR/SCRIPTS/build_epc</EPC_compile_prog> + <EPC_compile_prog_args>-c -l </EPC_compile_prog_args> + <HSS_compile_prog>$OPENAIRCN_DIR/SCRIPTS/build_hss</HSS_compile_prog> + <HSS_compile_prog_args> -c -l --debug --random false </HSS_compile_prog_args> + + <EPC_pre_exec>sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' ;sudo -E ifconfig eth0 add 192.172.0.1 ; cp $OPENAIRCN_DIR/BUILD/EPC/epc.conf.in $OPENAIRCN_TESTDIR/epc.conf.in</EPC_pre_exec> + <EPC_pre_exec_args></EPC_pre_exec_args> + <EPC_main_exec>$OPENAIRCN_DIR/SCRIPTS/run_epc </EPC_main_exec> + <EPC_main_exec_args> -r </EPC_main_exec_args> + <HSS_main_exec>sleep 10; $OPENAIRCN_DIR/SCRIPTS/run_hss --export-db $OPENAIRCN_TESTDIR/hss_export.db </HSS_main_exec> + <HSS_main_exec_args></HSS_main_exec_args> + <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s -B 192.172.0.1</EPC_traffic_exec> + <EPC_traffic_exec_args></EPC_traffic_exec_args> + <EPC_search_expr_true></EPC_search_expr_true> + <EPC_search_expr_false></EPC_search_expr_false> + <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs> + <tags>USRPx310.OAI_EPC_remote.Bandrich.5MHz.FDD.Band_7.DL.1TX.1RX</tags> + <nruns>10</nruns> + </testCase> + + <testCase id="016004" > + <class>lte-softmodem</class> + <desc></desc> + <eNB>mozart</eNB> + <UE>stevens</UE> + <EPC>nano</EPC> + <TimeOut_cmd>390</TimeOut_cmd> + <eNB_working_dir>/tmp</eNB_working_dir> + <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf N_RB_DL 50 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf mme_ip_address "ipv4=\"192.168.12.62\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf ENB_INTERFACE_NAME_FOR_S1U \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf ENB_PORT_FOR_S1U 2152</eNB_config_file> + <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog> + <eNB_compile_prog_args>--eNB -w USRP -x -c </eNB_compile_prog_args> + <eNB_pre_exec>sleep 15; sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.epc.remote.conf $OPENAIR_TESTDIR/enb.conf</eNB_pre_exec> + <eNB_pre_exec_args>sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail</eNB_pre_exec_args> + <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf -W </eNB_main_exec_args> + <eNB_traffic_exec></eNB_traffic_exec> + <eNB_traffic_exec_args></eNB_traffic_exec_args> + <eNB_search_expr_true></eNB_search_expr_true> + <eNB_search_expr_false></eNB_search_expr_false> + <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs> + + <UE_working_dir>/tmp</UE_working_dir> + <UE_config_file></UE_config_file> + <UE_compile_prog></UE_compile_prog> + <UE_compile_prog_args></UE_compile_prog_args> + <UE_pre_exec>sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' </UE_pre_exec> + <UE_pre_exec_args></UE_pre_exec_args> + <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> + <UE_main_exec_args></UE_main_exec_args> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec_args></UE_traffic_exec_args> + <UE_search_expr_true>throughput_test min=20.0Mbits/sec max=21.0Mbits/sec average=22.0Mbits/sec </UE_search_expr_true> + <UE_search_expr_false></UE_search_expr_false> + <UE_terminate_missing_procs>False</UE_terminate_missing_procs> + <UE_stop_script>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue </UE_stop_script> + + <EPC_working_dir>/tmp</EPC_working_dir> + <EPC_config_file>BUILD/EPC/epc.conf.in MCC \"208\" + BUILD/EPC/epc.conf.in MNC \"92\" + BUILD/EPC/epc.conf.in TAC \"1\" + BUILD/EPC/epc.conf.in MME_INTERFACE_NAME_FOR_S1_MME \"eth0\" + BUILD/EPC/epc.conf.in MME_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.62/24\" + BUILD/EPC/epc.conf.in SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP \"eth0\"; + BUILD/EPC/epc.conf.in SGW_IPV4_ADDRESS_FOR_S1U_S12_S4_UP \"192.168.12.62/24\"; + BUILD/EPC/epc.conf.in PGW_INTERFACE_NAME_FOR_SGI \"eth0\" + BUILD/EPC/epc.conf.in PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.62/24\" + BUILD/EPC/epc.conf.in IPV4_LIST \"192.172.0.0/24\",\"192.172.1.0/24\"</EPC_config_file> + <EPC_compile_prog>$OPENAIRCN_DIR/SCRIPTS/build_epc</EPC_compile_prog> + <EPC_compile_prog_args>-c -l</EPC_compile_prog_args> + <HSS_compile_prog>$OPENAIRCN_DIR/SCRIPTS/build_hss</HSS_compile_prog> + <HSS_compile_prog_args> -c -l --debug --random false</HSS_compile_prog_args> + + <EPC_pre_exec>sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' ;sudo -E ifconfig eth0 add 192.172.0.1 ; cp $OPENAIRCN_DIR/BUILD/EPC/epc.conf.in $OPENAIRCN_TESTDIR/epc.conf</EPC_pre_exec> + <EPC_pre_exec_args></EPC_pre_exec_args> + <EPC_main_exec>$OPENAIRCN_DIR/SCRIPTS/run_epc </EPC_main_exec> + <EPC_main_exec_args> -r </EPC_main_exec_args> + <HSS_main_exec>sleep 10; $OPENAIRCN_DIR/SCRIPTS/run_hss --export-db $OPENAIRCN_TESTDIR/hss_export.db </HSS_main_exec> + <HSS_main_exec_args></HSS_main_exec_args> + <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s -B 192.172.0.1</EPC_traffic_exec> + <EPC_traffic_exec_args></EPC_traffic_exec_args> + <EPC_search_expr_true></EPC_search_expr_true> + <EPC_search_expr_false></EPC_search_expr_false> + <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs> + <tags>USRPx310.OAI_EPC_remote.Bandrich.10MHz.FDD.Band_7.DL.1TX.1RX</tags> + <nruns>10</nruns> + </testCase> + + <testCase id="016005" > + <class>lte-softmodem</class> + <desc></desc> + <eNB>mozart</eNB> + <UE>stevens</UE> + <EPC>nano</EPC> + <TimeOut_cmd>390</TimeOut_cmd> + <eNB_working_dir>/tmp</eNB_working_dir> + <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf N_RB_DL 100 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf mme_ip_address "ipv4=\"192.168.12.62\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf frame_type \"FDD\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf nb_antennas_rx 1 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf nb_antennas_tx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth0\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.111/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1U \"eth0\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.111/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.epc.remote.conf ENB_PORT_FOR_S1U 2152</eNB_config_file> + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf ENB_INTERFACE_NAME_FOR_S1U \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf ENB_PORT_FOR_S1U 2152</eNB_config_file> + <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog> + <eNB_compile_prog_args>--eNB -w USRP -x -c </eNB_compile_prog_args> + <eNB_pre_exec>sleep 15; sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf $OPENAIR_TESTDIR/enb.conf</eNB_pre_exec> + <eNB_pre_exec_args></eNB_pre_exec_args> + <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf -W </eNB_main_exec_args> + <eNB_traffic_exec></eNB_traffic_exec> + <eNB_traffic_exec_args></eNB_traffic_exec_args> + <eNB_search_expr_true></eNB_search_expr_true> + <eNB_search_expr_false></eNB_search_expr_false> + <eNB_terminate_missing_procs>True</eNB_terminate_missing_procs> + + <UE_working_dir>/tmp</UE_working_dir> + <UE_config_file></UE_config_file> + <UE_compile_prog></UE_compile_prog> + <UE_compile_prog_args></UE_compile_prog_args> + <UE_pre_exec>sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' </UE_pre_exec> + <UE_pre_exec_args></UE_pre_exec_args> + <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> + <UE_main_exec_args></UE_main_exec_args> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec_args></UE_traffic_exec_args> + <UE_search_expr_true>throughput_test min=20.0Mbits/sec max=21.0Mbits/sec average=22.0Mbits/sec </UE_search_expr_true> + <UE_search_expr_false></UE_search_expr_false> + <UE_terminate_missing_procs>False</UE_terminate_missing_procs> + <UE_stop_script>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue </UE_stop_script> + + <EPC_working_dir>/tmp</EPC_working_dir> + <EPC_config_file>BUILD/EPC/epc.conf.in MCC \"208\" + BUILD/EPC/epc.conf.in MNC \"92\" + BUILD/EPC/epc.conf.in TAC \"1\" + BUILD/EPC/epc.conf.in MME_INTERFACE_NAME_FOR_S1_MME \"eth0\" + BUILD/EPC/epc.conf.in MME_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.62/24\" + BUILD/EPC/epc.conf.in SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP \"eth0\"; + BUILD/EPC/epc.conf.in SGW_IPV4_ADDRESS_FOR_S1U_S12_S4_UP \"192.168.12.62/24\"; + BUILD/EPC/epc.conf.in PGW_INTERFACE_NAME_FOR_SGI \"eth0\" + BUILD/EPC/epc.conf.in PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.62/24\" + BUILD/EPC/epc.conf.in IPV4_LIST \"192.172.0.0/24\",\"192.172.1.0/24\"</EPC_config_file> + <EPC_compile_prog>$OPENAIRCN_DIR/SCRIPTS/build_epc</EPC_compile_prog> + <EPC_compile_prog_args>-c -l</EPC_compile_prog_args> + <HSS_compile_prog>$OPENAIRCN_DIR/SCRIPTS/build_hss</HSS_compile_prog> + <HSS_compile_prog_args> -c -l --debug --random false </HSS_compile_prog_args> + + <EPC_pre_exec>sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' ;sudo -E ifconfig eth0 add 192.172.0.1 ; cp $OPENAIRCN_DIR/BUILD/EPC/epc.conf.in $OPENAIRCN_TESTDIR/epc.conf.in</EPC_pre_exec> + <EPC_pre_exec_args></EPC_pre_exec_args> + <EPC_main_exec>$OPENAIRCN_DIR/SCRIPTS/run_epc </EPC_main_exec> + <EPC_main_exec_args> -r </EPC_main_exec_args> + <HSS_main_exec>sleep 10; $OPENAIRCN_DIR/SCRIPTS/run_hss --export-db $OPENAIRCN_TESTDIR/hss_export.db </HSS_main_exec> + <HSS_main_exec_args></HSS_main_exec_args> + <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s -B 192.172.0.1</EPC_traffic_exec> + <EPC_traffic_exec_args></EPC_traffic_exec_args> + <EPC_search_expr_true></EPC_search_expr_true> + <EPC_search_expr_false></EPC_search_expr_false> + <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs> + <tags>USRPx310.OAI_EPC_remote.Bandrich.20MHz.FDD.Band_7.DL.1TX.1RX</tags> + <nruns>10</nruns> + </testCase> + + <testCase id="016100" > + <class>lte-softmodem</class> + <desc></desc> + <eNB>calisson</eNB> + <UE>stevens</UE> + <EPC>amerique</EPC> + <TimeOut_cmd>390</TimeOut_cmd> + <eNB_working_dir>/tmp</eNB_working_dir> + <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf N_RB_DL 25 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_PORT_FOR_S1U 2152</eNB_config_file> + <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog> + <eNB_compile_prog_args>--eNB -w EXMIMO -x -c </eNB_compile_prog_args> + <eNB_pre_exec>sudo -E -S $OPENAIR_DIR/cmake_targets/tools/init_exmimo2; dmesg|tail </eNB_pre_exec> + <eNB_pre_exec_args></eNB_pre_exec_args> + <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf -W </eNB_main_exec_args> + <eNB_traffic_exec></eNB_traffic_exec> + <eNB_traffic_exec_args></eNB_traffic_exec_args> + <eNB_search_expr_true></eNB_search_expr_true> + <eNB_search_expr_false></eNB_search_expr_false> + <eNB_terminate_missing_procs>True</eNB_terminate_missing_procs> + + <UE_working_dir>/tmp</UE_working_dir> + <UE_config_file></UE_config_file> + <UE_compile_prog_args></UE_compile_prog_args> + <UE_pre_exec></UE_pre_exec> + <UE_pre_exec_args></UE_pre_exec_args> + <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> + <UE_main_exec_args></UE_main_exec_args> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 10Mbits/s -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec_args></UE_traffic_exec_args> + <UE_search_expr_true></UE_search_expr_true> + <UE_search_expr_false></UE_search_expr_false> + <UE_terminate_missing_procs>True</UE_terminate_missing_procs> + <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue </UE_stop_script> + + <EPC_working_dir>/tmp</EPC_working_dir> + <EPC_config_file></EPC_config_file> + <EPC_compile_prog></EPC_compile_prog> + <EPC_compile_prog_args></EPC_compile_prog_args> + <HSS_compile_prog></HSS_compile_prog> + <HSS_compile_prog_args></HSS_compile_prog_args> + + <EPC_pre_exec></EPC_pre_exec> + <EPC_pre_exec_args></EPC_pre_exec_args> + <EPC_main_exec>/opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000</EPC_main_exec> + <EPC_main_exec_args></EPC_main_exec_args> + <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec> + <HSS_main_exec_args></HSS_main_exec_args> + <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m -B 192.172.0.1</EPC_traffic_exec> + <EPC_traffic_exec_args></EPC_traffic_exec_args> + <EPC_search_expr_true>throughput_test min=1.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec </EPC_search_expr_true> + <EPC_search_expr_false></EPC_search_expr_false> + <EPC_terminate_missing_procs>True</EPC_terminate_missing_procs> + <tags>EXMIMO.ALU_EPC.Bandrich.5MHz.FDD.Band_7.UL.1TX.1RX</tags> + <nruns>10</nruns> + </testCase> + + + <testCase id="016101" > + <class>lte-softmodem</class> + <desc></desc> + <eNB>calisson</eNB> + <UE>stevens</UE> + <EPC>amerique</EPC> + <TimeOut_cmd>390</TimeOut_cmd> + <eNB_working_dir>/tmp</eNB_working_dir> + <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf N_RB_DL 50 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_PORT_FOR_S1U 2152</eNB_config_file> + <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog> + <eNB_compile_prog_args>--eNB -w EXMIMO -x -c </eNB_compile_prog_args> + <eNB_pre_exec>sudo -E -S $OPENAIR_DIR/cmake_targets/tools/init_exmimo2 ; dmesg|tail</eNB_pre_exec> + <eNB_pre_exec_args></eNB_pre_exec_args> + <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf -W </eNB_main_exec_args> + <eNB_traffic_exec></eNB_traffic_exec> + <eNB_traffic_exec_args></eNB_traffic_exec_args> + <eNB_search_expr_true></eNB_search_expr_true> + <eNB_search_expr_false></eNB_search_expr_false> + <eNB_terminate_missing_procs>True</eNB_terminate_missing_procs> + + <UE_working_dir>/tmp</UE_working_dir> + <UE_config_file></UE_config_file> + <UE_compile_prog></UE_compile_prog> + <UE_compile_prog_args></UE_compile_prog_args> + <UE_pre_exec></UE_pre_exec> + <UE_pre_exec_args></UE_pre_exec_args> + <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> + <UE_main_exec_args></UE_main_exec_args> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 10Mbits/s -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec_args></UE_traffic_exec_args> + <UE_search_expr_true></UE_search_expr_true> + <UE_search_expr_false></UE_search_expr_false> + <UE_terminate_missing_procs>True</UE_terminate_missing_procs> + <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue </UE_stop_script> + + <EPC_working_dir>/tmp</EPC_working_dir> + <EPC_config_file></EPC_config_file> + <EPC_compile_prog></EPC_compile_prog> + <EPC_compile_prog_args></EPC_compile_prog_args> + <HSS_compile_prog></HSS_compile_prog> + <HSS_compile_prog_args></HSS_compile_prog_args> + + <EPC_pre_exec></EPC_pre_exec> + <EPC_pre_exec_args></EPC_pre_exec_args> + <EPC_main_exec>/opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000</EPC_main_exec> + <EPC_main_exec_args></EPC_main_exec_args> + <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec> + <HSS_main_exec_args></HSS_main_exec_args> + <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m -B 192.172.0.1</EPC_traffic_exec> + <EPC_traffic_exec_args></EPC_traffic_exec_args> + <EPC_search_expr_true>throughput_test min=1.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec </EPC_search_expr_true> + <EPC_search_expr_false></EPC_search_expr_false> + <EPC_terminate_missing_procs>True</EPC_terminate_missing_procs> + <tags>EXMIMO.ALU_EPC.Bandrich.10MHz.FDD.Band_7.UL.1TX.1RX</tags> + <nruns>10</nruns> + </testCase> + + <testCase id="016102" > + <class>lte-softmodem</class> + <desc></desc> + <eNB>calisson</eNB> + <UE>stevens</UE> + <EPC>amerique</EPC> + <TimeOut_cmd>390</TimeOut_cmd> + <eNB_working_dir>/tmp</eNB_working_dir> + <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf N_RB_DL 100 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_PORT_FOR_S1U 2152</eNB_config_file> + <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog> + <eNB_compile_prog_args>--eNB -w EXMIMO -x -c </eNB_compile_prog_args> + <eNB_pre_exec>sudo -E -S $OPENAIR_DIR/cmake_targets/tools/init_exmimo2 ; dmesg|tail</eNB_pre_exec> + <eNB_pre_exec_args></eNB_pre_exec_args> + <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf -W </eNB_main_exec_args> + <eNB_traffic_exec></eNB_traffic_exec> + <eNB_traffic_exec_args></eNB_traffic_exec_args> + <eNB_search_expr_true></eNB_search_expr_true> + <eNB_search_expr_false></eNB_search_expr_false> + <eNB_terminate_missing_procs>True</eNB_terminate_missing_procs> + + <UE_working_dir>/tmp</UE_working_dir> + <UE_config_file></UE_config_file> + <UE_compile_prog></UE_compile_prog> + <UE_compile_prog_args></UE_compile_prog_args> + <UE_pre_exec></UE_pre_exec> + <UE_pre_exec_args></UE_pre_exec_args> + <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> + <UE_main_exec_args></UE_main_exec_args> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 10Mbits/s -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec_args></UE_traffic_exec_args> + <UE_search_expr_true></UE_search_expr_true> + <UE_search_expr_false></UE_search_expr_false> + <UE_terminate_missing_procs>True</UE_terminate_missing_procs> + <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue </UE_stop_script> + + <EPC_working_dir>/tmp</EPC_working_dir> + <EPC_config_file>BUILD/EPC/epc.local.enb.conf.in MCC \"208\" + BUILD/EPC/epc.local.enb.conf.in MNC \"92\" + BUILD/EPC/epc.local.enb.conf.in TAC \"1\" + BUILD/EPC/epc.local.enb.conf.in PGW_INTERFACE_NAME_FOR_SGI \"eth5\" + BUILD/EPC/epc.local.enb.conf.in PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.82/24\" </EPC_config_file> + <EPC_compile_prog>SCRIPTS/build_epc</EPC_compile_prog> + <EPC_compile_prog_args>-c -l</EPC_compile_prog_args> + <HSS_compile_prog>SCRIPTS/build_hss</HSS_compile_prog> + <HSS_compile_prog_args> -c -l </HSS_compile_prog_args> + + <EPC_pre_exec></EPC_pre_exec> + <EPC_pre_exec_args></EPC_pre_exec_args> + <EPC_main_exec>/opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000</EPC_main_exec> + <EPC_main_exec_args></EPC_main_exec_args> + <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec> + <HSS_main_exec_args></HSS_main_exec_args> + <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m -B 192.172.0.1</EPC_traffic_exec> + <EPC_traffic_exec_args></EPC_traffic_exec_args> + <EPC_search_expr_true>throughput_test min=1.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec </EPC_search_expr_true> + <EPC_search_expr_false></EPC_search_expr_false> + <EPC_terminate_missing_procs>True</EPC_terminate_missing_procs> + <tags>EXMIMO.ALU_EPC.Bandrich.20MHz.FDD.Band_7.UL.1TX.1RX</tags> + <nruns>10</nruns> + </testCase> + + <testCase id="016103" > + <class>lte-softmodem</class> + <desc></desc> + <eNB>calisson</eNB> + <UE>stevens</UE> + <EPC>amerique</EPC> + <TimeOut_cmd>390</TimeOut_cmd> + <eNB_working_dir>/tmp</eNB_working_dir> + <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf N_RB_DL 25 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_PORT_FOR_S1U 2152</eNB_config_file> + <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog> + <eNB_compile_prog_args>--eNB -w EXMIMO -x -c </eNB_compile_prog_args> + <eNB_pre_exec>sudo -E -S $OPENAIR_DIR/cmake_targets/tools/init_exmimo2 ; dmesg|tail</eNB_pre_exec> + <eNB_pre_exec_args></eNB_pre_exec_args> + <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf -W </eNB_main_exec_args> + <eNB_traffic_exec></eNB_traffic_exec> + <eNB_traffic_exec_args></eNB_traffic_exec_args> + <eNB_search_expr_true></eNB_search_expr_true> + <eNB_search_expr_false></eNB_search_expr_false> + <eNB_terminate_missing_procs>True</eNB_terminate_missing_procs> + + <UE_working_dir>/tmp</UE_working_dir> + <UE_config_file></UE_config_file> + <UE_compile_prog></UE_compile_prog> + <UE_compile_prog_args></UE_compile_prog_args> + <UE_pre_exec></UE_pre_exec> + <UE_pre_exec_args></UE_pre_exec_args> + <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> + <UE_main_exec_args></UE_main_exec_args> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec_args></UE_traffic_exec_args> + <UE_terminate_missing_procs>True</UE_terminate_missing_procs> + <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue </UE_stop_script> + <UE_search_expr_true>throughput_test min=4.0Mbits/sec max=5.0Mbits/sec average=4.0Mbits/sec </UE_search_expr_true> + <UE_search_expr_false></UE_search_expr_false> + + <EPC_working_dir>/tmp</EPC_working_dir> + <EPC_config_file></EPC_config_file> + <EPC_compile_prog></EPC_compile_prog> + <EPC_compile_prog_args></EPC_compile_prog_args> + <HSS_compile_prog></HSS_compile_prog> + <HSS_compile_prog_args></HSS_compile_prog_args> + + <EPC_pre_exec></EPC_pre_exec> + <EPC_pre_exec_args></EPC_pre_exec_args> + <EPC_main_exec>/opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000</EPC_main_exec> + <EPC_main_exec_args></EPC_main_exec_args> + <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec> + <HSS_main_exec_args></HSS_main_exec_args> + <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s -B 192.172.0.1</EPC_traffic_exec> + <EPC_traffic_exec_args></EPC_traffic_exec_args> + <EPC_search_expr_false></EPC_search_expr_false> + <EPC_terminate_missing_procs>True</EPC_terminate_missing_procs> + <tags>EXMIMO.ALU_EPC.Bandrich.5MHz.FDD.Band_7.DL.1TX.1RX</tags> + <nruns>10</nruns> + </testCase> + + <testCase id="016104" > + <class>lte-softmodem</class> + <desc></desc> + <eNB>calisson</eNB> + <UE>stevens</UE> + <EPC>amerique</EPC> + <TimeOut_cmd>390</TimeOut_cmd> + <eNB_working_dir>/tmp</eNB_working_dir> + <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf N_RB_DL 50 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_PORT_FOR_S1U 2152</eNB_config_file> + <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog> + <eNB_compile_prog_args>--eNB -w EXMIMO -x -c </eNB_compile_prog_args> + <eNB_pre_exec>sudo -E -S $OPENAIR_DIR/cmake_targets/tools/init_exmimo2 ; dmesg|tail</eNB_pre_exec> + <eNB_pre_exec_args></eNB_pre_exec_args> + <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf -W </eNB_main_exec_args> + <eNB_traffic_exec></eNB_traffic_exec> + <eNB_traffic_exec_args></eNB_traffic_exec_args> + <eNB_search_expr_true></eNB_search_expr_true> + <eNB_search_expr_false></eNB_search_expr_false> + <eNB_terminate_missing_procs>True</eNB_terminate_missing_procs> + + <UE_working_dir>/tmp</UE_working_dir> + <UE_config_file></UE_config_file> + <UE_compile_prog></UE_compile_prog> + <UE_compile_prog_args></UE_compile_prog_args> + <UE_pre_exec></UE_pre_exec> + <UE_pre_exec_args></UE_pre_exec_args> + <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> + <UE_main_exec_args></UE_main_exec_args> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec_args></UE_traffic_exec_args> + <UE_terminate_missing_procs>True</UE_terminate_missing_procs> + <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue </UE_stop_script> + <UE_search_expr_true>throughput_test min=8.0Mbits/sec max=9.0Mbits/sec average=8.5Mbits/sec </UE_search_expr_true> + <UE_search_expr_false></UE_search_expr_false> + + <EPC_working_dir>/tmp</EPC_working_dir> + <EPC_config_file></EPC_config_file> + <EPC_compile_prog></EPC_compile_prog> + <EPC_compile_prog_args></EPC_compile_prog_args> + <HSS_compile_prog></HSS_compile_prog> + <HSS_compile_prog_args></HSS_compile_prog_args> + + <EPC_pre_exec></EPC_pre_exec> + <EPC_pre_exec_args></EPC_pre_exec_args> + <EPC_main_exec>/opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000</EPC_main_exec> + <EPC_main_exec_args></EPC_main_exec_args> + <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec> + <HSS_main_exec_args></HSS_main_exec_args> + <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s -B 192.172.0.1</EPC_traffic_exec> + <EPC_traffic_exec_args></EPC_traffic_exec_args> + <EPC_search_expr_false></EPC_search_expr_false> + <EPC_terminate_missing_procs>True</EPC_terminate_missing_procs> + <tags>EXMIMO.ALU_EPC.Bandrich.10MHz.FDD.Band_7.DL.1TX.1RX</tags> + <nruns>10</nruns> + </testCase> + + <testCase id="016105" > + <class>lte-softmodem</class> + <desc></desc> + <eNB>calisson</eNB> + <UE>stevens</UE> + <EPC>amerique</EPC> + <TimeOut_cmd>390</TimeOut_cmd> + <eNB_working_dir>/tmp</eNB_working_dir> + <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf N_RB_DL 100 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_PORT_FOR_S1U 2152</eNB_config_file> + <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog> + <eNB_compile_prog_args>--eNB -w EXMIMO -x -c </eNB_compile_prog_args> + <eNB_pre_exec>sudo -E -S $OPENAIR_DIR/cmake_targets/tools/init_exmimo2 ; dmesg|tail</eNB_pre_exec> + <eNB_pre_exec_args></eNB_pre_exec_args> + <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf -W </eNB_main_exec_args> + <eNB_traffic_exec></eNB_traffic_exec> + <eNB_traffic_exec_args></eNB_traffic_exec_args> + <eNB_search_expr_true></eNB_search_expr_true> + <eNB_search_expr_false></eNB_search_expr_false> + <eNB_terminate_missing_procs>True</eNB_terminate_missing_procs> + + <UE_working_dir>/tmp</UE_working_dir> + <UE_config_file></UE_config_file> + <UE_compile_prog></UE_compile_prog> + <UE_compile_prog_args></UE_compile_prog_args> + <UE_pre_exec></UE_pre_exec> + <UE_pre_exec_args></UE_pre_exec_args> + <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> + <UE_main_exec_args></UE_main_exec_args> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec_args></UE_traffic_exec_args> + <UE_terminate_missing_procs>True</UE_terminate_missing_procs> + <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue </UE_stop_script> + <UE_search_expr_true>throughput_test min=15.0Mbits/sec max=15.0Mbits/sec average=15.0Mbits/sec </UE_search_expr_true> + <UE_search_expr_false></UE_search_expr_false> + + <EPC_working_dir>/tmp</EPC_working_dir> + <EPC_config_file></EPC_config_file> + <EPC_compile_prog></EPC_compile_prog> + <EPC_compile_prog_args></EPC_compile_prog_args> + <HSS_compile_prog></HSS_compile_prog> + <HSS_compile_prog_args></HSS_compile_prog_args> + + <EPC_pre_exec></EPC_pre_exec> + <EPC_pre_exec_args></EPC_pre_exec_args> + <EPC_main_exec>/opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000</EPC_main_exec> + <EPC_main_exec_args></EPC_main_exec_args> + <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec> + <HSS_main_exec_args></HSS_main_exec_args> + <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s -B 192.172.0.1</EPC_traffic_exec> + <EPC_traffic_exec_args></EPC_traffic_exec_args> + <EPC_search_expr_false></EPC_search_expr_false> + <EPC_terminate_missing_procs>True</EPC_terminate_missing_procs> + <tags>EXMIMO.ALU_EPC.Bandrich.20MHz.FDD.Band_7.DL.1TX.1RX</tags> + <nruns>10</nruns> + </testCase> + + + + <testCase id="016300" > + <class>lte-softmodem</class> + <desc></desc> + <eNB>calisson</eNB> + <UE>stevens</UE> + <EPC>nano</EPC> + <TimeOut_cmd>390</TimeOut_cmd> + <eNB_working_dir>/tmp</eNB_working_dir> + <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf N_RB_DL 25 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf mme_ip_address "ipv4=\"192.168.12.62\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_PORT_FOR_S1U 2152</eNB_config_file> + <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog> + <eNB_compile_prog_args>--eNB -w EXMIMO -x -c </eNB_compile_prog_args> + <eNB_pre_exec>sleep 15; sudo -E -S $OPENAIR_DIR/cmake_targets/tools/init_exmimo2; dmesg|tail ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf $OPENAIR_TESTDIR/enb.conf </eNB_pre_exec> + <eNB_pre_exec_args></eNB_pre_exec_args> + <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf -W </eNB_main_exec_args> + <eNB_traffic_exec></eNB_traffic_exec> + <eNB_traffic_exec_args></eNB_traffic_exec_args> + <eNB_search_expr_true></eNB_search_expr_true> + <eNB_search_expr_false></eNB_search_expr_false> + <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs> + + + <UE_working_dir>/tmp</UE_working_dir> + <UE_config_file></UE_config_file> + <UE_compile_prog></UE_compile_prog> + <UE_compile_prog_args></UE_compile_prog_args> + <UE_pre_exec>sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' </UE_pre_exec> + <UE_pre_exec_args></UE_pre_exec_args> + <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> + <UE_main_exec_args></UE_main_exec_args> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 10Mbits/s -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec_args></UE_traffic_exec_args> + <UE_search_expr_true></UE_search_expr_true> + <UE_search_expr_false></UE_search_expr_false> + <UE_terminate_missing_procs>False</UE_terminate_missing_procs> + <UE_stop_script>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue </UE_stop_script> + + <EPC_working_dir>/tmp</EPC_working_dir> + <EPC_config_file>BUILD/EPC/epc.conf.in MCC \"208\" + BUILD/EPC/epc.conf.in MNC \"92\" + BUILD/EPC/epc.conf.in TAC \"1\" + BUILD/EPC/epc.conf.in MME_INTERFACE_NAME_FOR_S1_MME \"eth0\" + BUILD/EPC/epc.conf.in MME_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.62/24\" + BUILD/EPC/epc.conf.in SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP \"eth0\"; + BUILD/EPC/epc.conf.in SGW_IPV4_ADDRESS_FOR_S1U_S12_S4_UP \"192.168.12.62/24\"; + BUILD/EPC/epc.conf.in PGW_INTERFACE_NAME_FOR_SGI \"eth0\" + BUILD/EPC/epc.conf.in PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.62/24\" + BUILD/EPC/epc.conf.in IPV4_LIST \"192.172.0.0/24\",\"192.172.1.0/24\"</EPC_config_file> + <EPC_compile_prog>$OPENAIRCN_DIR/SCRIPTS/build_epc</EPC_compile_prog> + <EPC_compile_prog_args>-c -l</EPC_compile_prog_args> + <HSS_compile_prog>$OPENAIRCN_DIR/SCRIPTS/build_hss</HSS_compile_prog> + <HSS_compile_prog_args> -c -l --debug --random false </HSS_compile_prog_args> + + <EPC_pre_exec>sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' ; sudo -E ifconfig eth0 add 192.172.0.1 ;cp $OPENAIRCN_DIR/BUILD/EPC/epc.conf.in $OPENAIRCN_TESTDIR/epc.conf.in</EPC_pre_exec> + <EPC_pre_exec_args></EPC_pre_exec_args> + <EPC_main_exec>$OPENAIRCN_DIR/SCRIPTS/run_epc </EPC_main_exec> + <EPC_main_exec_args> -r </EPC_main_exec_args> + <HSS_main_exec>sleep 10; $OPENAIRCN_DIR/SCRIPTS/run_hss --export-db $OPENAIRCN_TESTDIR/hss_export.db </HSS_main_exec> + <HSS_main_exec_args></HSS_main_exec_args> + <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m -B 192.172.0.1</EPC_traffic_exec> + <EPC_traffic_exec_args></EPC_traffic_exec_args> + <EPC_search_expr_true>throughput_test min=1.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec </EPC_search_expr_true> + <EPC_search_expr_false></EPC_search_expr_false> + <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs> + <tags>EXMIMO.OAI_EPC_remote.Bandrich.5MHz.FDD.Band_7.UL.1TX.1RX</tags> + <nruns>10</nruns> + </testCase> + + + + <testCase id="016301" > + <class>lte-softmodem</class> + <desc></desc> + <eNB>calisson</eNB> + <UE>stevens</UE> + <EPC>nano</EPC> + <TimeOut_cmd>390</TimeOut_cmd> + <eNB_working_dir>/tmp</eNB_working_dir> + <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf N_RB_DL 50 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf mme_ip_address "ipv4=\"192.168.12.62\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_PORT_FOR_S1U 2152</eNB_config_file> + <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog> + <eNB_compile_prog_args>--eNB -w EXMIMO -x -c </eNB_compile_prog_args> + <eNB_pre_exec>sleep 15; sudo -E -S $OPENAIR_DIR/cmake_targets/tools/init_exmimo2 ; dmesg|tail; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf $OPENAIR_TESTDIR/enb.conf</eNB_pre_exec> + <eNB_pre_exec_args></eNB_pre_exec_args> + <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf -W </eNB_main_exec_args> + <eNB_traffic_exec></eNB_traffic_exec> + <eNB_traffic_exec_args></eNB_traffic_exec_args> + <eNB_search_expr_true></eNB_search_expr_true> + <eNB_search_expr_false></eNB_search_expr_false> + <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs> + + <UE_working_dir>/tmp</UE_working_dir> + <UE_config_file></UE_config_file> + <UE_compile_prog></UE_compile_prog> + <UE_compile_prog_args></UE_compile_prog_args> + <UE_pre_exec>sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' </UE_pre_exec> + <UE_pre_exec_args></UE_pre_exec_args> + <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> + <UE_main_exec_args></UE_main_exec_args> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 10Mbits/s -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec_args></UE_traffic_exec_args> + <UE_search_expr_true></UE_search_expr_true> + <UE_search_expr_false></UE_search_expr_false> + <UE_terminate_missing_procs>False</UE_terminate_missing_procs> + <UE_stop_script>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue </UE_stop_script> + + <EPC_working_dir>/tmp</EPC_working_dir> + <EPC_config_file>BUILD/EPC/epc.conf.in MCC \"208\" + BUILD/EPC/epc.conf.in MNC \"92\" + BUILD/EPC/epc.conf.in TAC \"1\" + BUILD/EPC/epc.conf.in MME_INTERFACE_NAME_FOR_S1_MME \"eth0\" + BUILD/EPC/epc.conf.in MME_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.62/24\" + BUILD/EPC/epc.conf.in SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP \"eth0\"; + BUILD/EPC/epc.conf.in SGW_IPV4_ADDRESS_FOR_S1U_S12_S4_UP \"192.168.12.62/24\"; + BUILD/EPC/epc.conf.in PGW_INTERFACE_NAME_FOR_SGI \"eth0\" + BUILD/EPC/epc.conf.in PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.62/24\" + BUILD/EPC/epc.conf.in IPV4_LIST \"192.172.0.0/24\",\"192.172.1.0/24\"</EPC_config_file> + <EPC_compile_prog>$OPENAIRCN_DIR/SCRIPTS/build_epc</EPC_compile_prog> + <EPC_compile_prog_args>-c -l</EPC_compile_prog_args> + <HSS_compile_prog>$OPENAIRCN_DIR/SCRIPTS/build_hss</HSS_compile_prog> + <HSS_compile_prog_args> -c -l --debug --random false </HSS_compile_prog_args> + + <EPC_pre_exec>sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' ;sudo -E ifconfig eth0 add 192.172.0.1 ; cp $OPENAIRCN_DIR/BUILD/EPC/epc.conf.in $OPENAIRCN_TESTDIR/epc.conf.in</EPC_pre_exec> + <EPC_pre_exec_args></EPC_pre_exec_args> + <EPC_main_exec>$OPENAIRCN_DIR/SCRIPTS/run_epc </EPC_main_exec> + <EPC_main_exec_args> -r </EPC_main_exec_args> + <HSS_main_exec>sleep 10; $OPENAIRCN_DIR/SCRIPTS/run_hss --export-db $OPENAIRCN_TESTDIR/hss_export.db </HSS_main_exec> + <HSS_main_exec_args></HSS_main_exec_args> + <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m -B 192.172.0.1</EPC_traffic_exec> + <EPC_traffic_exec_args></EPC_traffic_exec_args> + <EPC_search_expr_true>throughput_test min=1.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec </EPC_search_expr_true> + <EPC_search_expr_false></EPC_search_expr_false> + <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs> + <tags>EXMIMO.OAI_EPC_remote.Bandrich.10MHz.FDD.Band_7.UL.1TX.1RX</tags> + <nruns>10</nruns> + </testCase> + + <testCase id="016302" > + <class>lte-softmodem</class> + <desc></desc> + <eNB>calisson</eNB> + <UE>stevens</UE> + <EPC>nano</EPC> + <TimeOut_cmd>390</TimeOut_cmd> + <eNB_working_dir>/tmp</eNB_working_dir> + <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf N_RB_DL 100 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf mme_ip_address "ipv4=\"192.168.12.62\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_PORT_FOR_S1U 2152</eNB_config_file> + <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog> + <eNB_compile_prog_args>--eNB -w EXMIMO -x -c </eNB_compile_prog_args> + <eNB_pre_exec>sleep 15; sudo -E -S $OPENAIR_DIR/cmake_targets/tools/init_exmimo2 ; dmesg|tail ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf $OPENAIR_TESTDIR/enb.conf</eNB_pre_exec> + <eNB_pre_exec_args></eNB_pre_exec_args> + <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf -W </eNB_main_exec_args> + <eNB_traffic_exec></eNB_traffic_exec> + <eNB_traffic_exec_args></eNB_traffic_exec_args> + <eNB_search_expr_true></eNB_search_expr_true> + <eNB_search_expr_false></eNB_search_expr_false> + <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs> + + <UE_working_dir>/tmp</UE_working_dir> + <UE_config_file></UE_config_file> + <UE_compile_prog></UE_compile_prog> + <UE_compile_prog_args></UE_compile_prog_args> + <UE_pre_exec>sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' </UE_pre_exec> + <UE_pre_exec_args></UE_pre_exec_args> + <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> + <UE_main_exec_args></UE_main_exec_args> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 10Mbits/s -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec_args></UE_traffic_exec_args> + <UE_search_expr_true></UE_search_expr_true> + <UE_search_expr_false></UE_search_expr_false> + <UE_terminate_missing_procs>False</UE_terminate_missing_procs> + <UE_stop_script>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue </UE_stop_script> + + <EPC_working_dir>/tmp</EPC_working_dir> + <EPC_config_file>BUILD/EPC/epc.conf.in MCC \"208\" + BUILD/EPC/epc.conf.in MNC \"92\" + BUILD/EPC/epc.conf.in TAC \"1\" + BUILD/EPC/epc.conf.in MME_INTERFACE_NAME_FOR_S1_MME \"eth0\" + BUILD/EPC/epc.conf.in MME_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.62/24\" + BUILD/EPC/epc.conf.in SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP \"eth0\"; + BUILD/EPC/epc.conf.in SGW_IPV4_ADDRESS_FOR_S1U_S12_S4_UP \"192.168.12.62/24\"; + BUILD/EPC/epc.conf.in PGW_INTERFACE_NAME_FOR_SGI \"eth0\" + BUILD/EPC/epc.conf.in PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.62/24\" + BUILD/EPC/epc.conf.in IPV4_LIST \"192.172.0.0/24\",\"192.172.1.0/24\"</EPC_config_file> + <EPC_compile_prog>$OPENAIRCN_DIR/SCRIPTS/build_epc</EPC_compile_prog> + <EPC_compile_prog_args>-c -l</EPC_compile_prog_args> + <HSS_compile_prog>$OPENAIRCN_DIR/SCRIPTS/build_hss</HSS_compile_prog> + <HSS_compile_prog_args> -c -l --debug --random false </HSS_compile_prog_args> + + <EPC_pre_exec>sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' ; sudo -E ifconfig eth0 add 192.172.0.1 ; cp $OPENAIRCN_DIR/BUILD/EPC/epc.conf.in $OPENAIRCN_TESTDIR/epc.conf.in</EPC_pre_exec> + <EPC_pre_exec_args></EPC_pre_exec_args> + <EPC_main_exec>$OPENAIRCN_DIR/SCRIPTS/run_epc </EPC_main_exec> + <EPC_main_exec_args> -r </EPC_main_exec_args> + <HSS_main_exec>sleep 10; $OPENAIRCN_DIR/SCRIPTS/run_hss --export-db $OPENAIRCN_TESTDIR/hss_export.db </HSS_main_exec> + <HSS_main_exec_args></HSS_main_exec_args> + <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m -B 192.172.0.1</EPC_traffic_exec> + <EPC_traffic_exec_args></EPC_traffic_exec_args> + <EPC_search_expr_true>throughput_test min=1.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec </EPC_search_expr_true> + <EPC_search_expr_false></EPC_search_expr_false> + <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs> + <tags>EXMIMO.OAI_EPC_remote.Bandrich.20MHz.FDD.Band_7.UL.1TX.1RX</tags> + <nruns>10</nruns> + </testCase> + + <testCase id="016303" > + <class>lte-softmodem</class> + <desc></desc> + <eNB>calisson</eNB> + <UE>stevens</UE> + <EPC>nano</EPC> + <TimeOut_cmd>390</TimeOut_cmd> + <eNB_working_dir>/tmp</eNB_working_dir> + <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf N_RB_DL 25 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf mme_ip_address "ipv4=\"192.168.12.62\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_PORT_FOR_S1U 2152</eNB_config_file> + <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog> + <eNB_compile_prog_args>--eNB -w EXMIMO -x -c </eNB_compile_prog_args> + <eNB_pre_exec>sleep 15; sudo -E -S $OPENAIR_DIR/cmake_targets/tools/init_exmimo2 ; dmesg|tail; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf $OPENAIR_TESTDIR/enb.conf</eNB_pre_exec> + <eNB_pre_exec_args></eNB_pre_exec_args> + <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf -W </eNB_main_exec_args> + <eNB_traffic_exec></eNB_traffic_exec> + <eNB_traffic_exec_args></eNB_traffic_exec_args> + <eNB_search_expr_true></eNB_search_expr_true> + <eNB_search_expr_false></eNB_search_expr_false> + <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs>> + + <UE_working_dir>/tmp</UE_working_dir> + <UE_config_file></UE_config_file> + <UE_compile_prog></UE_compile_prog> + <UE_compile_prog_args></UE_compile_prog_args> + <UE_pre_exec>sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' </UE_pre_exec> + <UE_pre_exec_args></UE_pre_exec_args> + <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> + <UE_main_exec_args></UE_main_exec_args> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec_args></UE_traffic_exec_args> + <UE_search_expr_true>throughput_test min=10.0Mbits/sec max=10.5Mbits/sec average=11.0Mbits/sec </UE_search_expr_true> + <UE_search_expr_false></UE_search_expr_false> + <UE_terminate_missing_procs>False</UE_terminate_missing_procs> + <UE_stop_script>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue </UE_stop_script> + + <EPC_working_dir>/tmp</EPC_working_dir> + <EPC_config_file>BUILD/EPC/epc.conf.in MCC \"208\" + BUILD/EPC/epc.conf.in MNC \"92\" + BUILD/EPC/epc.conf.in TAC \"1\" + BUILD/EPC/epc.conf.in MME_INTERFACE_NAME_FOR_S1_MME \"eth0\" + BUILD/EPC/epc.conf.in MME_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.62/24\" + BUILD/EPC/epc.conf.in SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP \"eth0\"; + BUILD/EPC/epc.conf.in SGW_IPV4_ADDRESS_FOR_S1U_S12_S4_UP \"192.168.12.62/24\"; + BUILD/EPC/epc.conf.in PGW_INTERFACE_NAME_FOR_SGI \"eth0\" + BUILD/EPC/epc.conf.in PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.62/24\" + BUILD/EPC/epc.conf.in IPV4_LIST \"192.172.0.0/24\",\"192.172.1.0/24\"</EPC_config_file> + <EPC_compile_prog>$OPENAIRCN_DIR/SCRIPTS/build_epc</EPC_compile_prog> + <EPC_compile_prog_args>-c -l</EPC_compile_prog_args> + <HSS_compile_prog>$OPENAIRCN_DIR/SCRIPTS/build_hss</HSS_compile_prog> + <HSS_compile_prog_args> -c -l --debug --random false </HSS_compile_prog_args> + + <EPC_pre_exec>sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' ;sudo -E ifconfig eth0 add 192.172.0.1 ;cp $OPENAIRCN_DIR/BUILD/EPC/epc.conf.in $OPENAIRCN_TESTDIR/epc.conf.in</EPC_pre_exec> + <EPC_pre_exec_args></EPC_pre_exec_args> + <EPC_main_exec>$OPENAIRCN_DIR/SCRIPTS/run_epc </EPC_main_exec> + <EPC_main_exec_args> -r </EPC_main_exec_args> + <HSS_main_exec>sleep 10; $OPENAIRCN_DIR/SCRIPTS/run_hss --export-db $OPENAIRCN_TESTDIR/hss_export.db </HSS_main_exec> + <HSS_main_exec_args></HSS_main_exec_args> + <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s -B 192.172.0.1</EPC_traffic_exec> + <EPC_traffic_exec_args></EPC_traffic_exec_args> + <EPC_search_expr_true></EPC_search_expr_true> + <EPC_search_expr_false></EPC_search_expr_false> + <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs> + <tags>EXMIMO.OAI_EPC_remote.Bandrich.5MHz.FDD.Band_7.DL.1TX.1RX</tags> + <nruns>10</nruns> + </testCase> + + <testCase id="016304" > + <class>lte-softmodem</class> + <desc></desc> + <eNB>calisson</eNB> + <UE>stevens</UE> + <EPC>nano</EPC> + <TimeOut_cmd>390</TimeOut_cmd> + <eNB_working_dir>/tmp</eNB_working_dir> + <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf N_RB_DL 50 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf mme_ip_address "ipv4=\"192.168.12.62\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_PORT_FOR_S1U 2152</eNB_config_file> + <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog> + <eNB_compile_prog_args>--eNB -w EXMIMO -x -c </eNB_compile_prog_args> + <eNB_pre_exec>sleep 15; sudo -E -S $OPENAIR_DIR/cmake_targets/tools/init_exmimo2 ; dmesg|tail; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf $OPENAIR_TESTDIR/enb.conf</eNB_pre_exec> + <eNB_pre_exec_args></eNB_pre_exec_args> + <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf -W </eNB_main_exec_args> + <eNB_traffic_exec></eNB_traffic_exec> + <eNB_traffic_exec_args></eNB_traffic_exec_args> + <eNB_search_expr_true></eNB_search_expr_true> + <eNB_search_expr_false></eNB_search_expr_false> + <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs> + + <UE_working_dir>/tmp</UE_working_dir> + <UE_config_file></UE_config_file> + <UE_compile_prog></UE_compile_prog> + <UE_compile_prog_args></UE_compile_prog_args> + <UE_pre_exec>sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' </UE_pre_exec> + <UE_pre_exec_args></UE_pre_exec_args> + <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> + <UE_main_exec_args></UE_main_exec_args> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec_args></UE_traffic_exec_args> + <UE_search_expr_true>throughput_test min=20.0Mbits/sec max=21.0Mbits/sec average=22.0Mbits/sec </UE_search_expr_true> + <UE_search_expr_false></UE_search_expr_false> + <UE_terminate_missing_procs>False</UE_terminate_missing_procs> + <UE_stop_script>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue </UE_stop_script> + + <EPC_working_dir>/tmp</EPC_working_dir> + <EPC_config_file>BUILD/EPC/epc.conf.in MCC \"208\" + BUILD/EPC/epc.conf.in MNC \"92\" + BUILD/EPC/epc.conf.in TAC \"1\" + BUILD/EPC/epc.conf.in MME_INTERFACE_NAME_FOR_S1_MME \"eth0\" + BUILD/EPC/epc.conf.in MME_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.62/24\" + BUILD/EPC/epc.conf.in SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP \"eth0\"; + BUILD/EPC/epc.conf.in SGW_IPV4_ADDRESS_FOR_S1U_S12_S4_UP \"192.168.12.62/24\"; + BUILD/EPC/epc.conf.in PGW_INTERFACE_NAME_FOR_SGI \"eth0\" + BUILD/EPC/epc.conf.in PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.62/24\" + BUILD/EPC/epc.conf.in IPV4_LIST \"192.172.0.0/24\",\"192.172.1.0/24\"</EPC_config_file> + <EPC_compile_prog>$OPENAIRCN_DIR/SCRIPTS/build_epc</EPC_compile_prog> + <EPC_compile_prog_args>-c -l</EPC_compile_prog_args> + <HSS_compile_prog>$OPENAIRCN_DIR/SCRIPTS/build_hss</HSS_compile_prog> + <HSS_compile_prog_args> -c -l --debug --random false </HSS_compile_prog_args> + + <EPC_pre_exec>sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' ;sudo -E ifconfig eth0 add 192.172.0.1 ; cp $OPENAIRCN_DIR/BUILD/EPC/epc.conf.in $OPENAIRCN_TESTDIR/epc.conf.in</EPC_pre_exec> + <EPC_pre_exec_args></EPC_pre_exec_args> + <EPC_main_exec>$OPENAIRCN_DIR/SCRIPTS/run_epc </EPC_main_exec> + <EPC_main_exec_args> -r </EPC_main_exec_args> + <HSS_main_exec>sleep 10; $OPENAIRCN_DIR/SCRIPTS/run_hss --export-db $OPENAIRCN_TESTDIR/hss_export.db </HSS_main_exec> + <HSS_main_exec_args></HSS_main_exec_args> + <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s -B 192.172.0.1</EPC_traffic_exec> + <EPC_traffic_exec_args></EPC_traffic_exec_args> + <EPC_search_expr_true></EPC_search_expr_true> + <EPC_search_expr_false></EPC_search_expr_false> + <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs> + <tags>EXMIMO.OAI_EPC_remote.Bandrich.10MHz.FDD.Band_7.DL.1TX.1RX</tags> + <nruns>10</nruns> + </testCase> + + <testCase id="016305" > + <class>lte-softmodem</class> + <desc></desc> + <eNB>calisson</eNB> + <UE>stevens</UE> + <EPC>nano</EPC> + <TimeOut_cmd>390</TimeOut_cmd> + <eNB_working_dir>/tmp</eNB_working_dir> + <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf N_RB_DL 100 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf mme_ip_address "ipv4=\"192.168.12.62\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_PORT_FOR_S1U 2152</eNB_config_file> + <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog> + <eNB_compile_prog_args>--eNB -w EXMIMO -x -c </eNB_compile_prog_args> + <eNB_pre_exec>sleep 15; sudo -E -S $OPENAIR_DIR/cmake_targets/tools/init_exmimo2 ; dmesg|tail; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf $OPENAIR_TESTDIR/enb.conf</eNB_pre_exec> + <eNB_pre_exec_args></eNB_pre_exec_args> + <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf -W </eNB_main_exec_args> + <eNB_traffic_exec></eNB_traffic_exec> + <eNB_traffic_exec_args></eNB_traffic_exec_args> + <eNB_search_expr_true></eNB_search_expr_true> + <eNB_search_expr_false></eNB_search_expr_false> + <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs> + + <UE_working_dir>/tmp</UE_working_dir> + <UE_config_file></UE_config_file> + <UE_compile_prog></UE_compile_prog> + <UE_compile_prog_args></UE_compile_prog_args> + <UE_pre_exec>sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' </UE_pre_exec> + <UE_pre_exec_args></UE_pre_exec_args> + <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> + <UE_main_exec_args></UE_main_exec_args> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec_args></UE_traffic_exec_args> + <UE_search_expr_true>throughput_test min=20.0Mbits/sec max=21.0Mbits/sec average=22.0Mbits/sec </UE_search_expr_true> + <UE_search_expr_false></UE_search_expr_false> + <UE_terminate_missing_procs>False</UE_terminate_missing_procs> + <UE_stop_script>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue </UE_stop_script> + + <EPC_working_dir>/tmp</EPC_working_dir> + <EPC_config_file>BUILD/EPC/epc.conf.in MCC \"208\" + BUILD/EPC/epc.conf.in MNC \"92\" + BUILD/EPC/epc.conf.in TAC \"1\" + BUILD/EPC/epc.conf.in MME_INTERFACE_NAME_FOR_S1_MME \"eth0\" + BUILD/EPC/epc.conf.in MME_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.62/24\" + BUILD/EPC/epc.conf.in SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP \"eth0\"; + BUILD/EPC/epc.conf.in SGW_IPV4_ADDRESS_FOR_S1U_S12_S4_UP \"192.168.12.62/24\"; + BUILD/EPC/epc.conf.in PGW_INTERFACE_NAME_FOR_SGI \"eth0\" + BUILD/EPC/epc.conf.in PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.62/24\" + BUILD/EPC/epc.conf.in IPV4_LIST \"192.172.0.0/24\",\"192.172.1.0/24\"</EPC_config_file> + <EPC_compile_prog>$OPENAIRCN_DIR/SCRIPTS/build_epc</EPC_compile_prog> + <EPC_compile_prog_args>-c -l</EPC_compile_prog_args> + <HSS_compile_prog>$OPENAIRCN_DIR/SCRIPTS/build_hss</HSS_compile_prog> + <HSS_compile_prog_args> -c -l --debug --random false</HSS_compile_prog_args> + + <EPC_pre_exec>sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' ;sudo -E ifconfig eth0 add 192.172.0.1</EPC_pre_exec> + <EPC_pre_exec_args></EPC_pre_exec_args> + <EPC_main_exec>$OPENAIRCN_DIR/SCRIPTS/run_epc </EPC_main_exec> + <EPC_main_exec_args> -r </EPC_main_exec_args> + <HSS_main_exec>sleep 10; $OPENAIRCN_DIR/SCRIPTS/run_hss --export-db $OPENAIRCN_TESTDIR/hss_export.db </HSS_main_exec> + <HSS_main_exec_args></HSS_main_exec_args> + <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s -B 192.172.0.1; cp $OPENAIRCN_DIR/BUILD/EPC/epc.conf.in $OPENAIRCN_TESTDIR/epc.conf.in</EPC_traffic_exec> + <EPC_traffic_exec_args></EPC_traffic_exec_args> + <EPC_search_expr_true></EPC_search_expr_true> + <EPC_search_expr_false></EPC_search_expr_false> + <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs> + <tags>EXMIMO.OAI_EPC_remote.Bandrich.20MHz.FDD.Band_7.DL.1TX.1RX</tags> + <nruns>10</nruns> + </testCase> + + + <testCase id="016500" > + <class>lte-softmodem</class> + <desc></desc> + <eNB>mozart</eNB> + <UE>stevens</UE> + <EPC>amerique</EPC> + <TimeOut_cmd>390</TimeOut_cmd> + <eNB_working_dir>/tmp</eNB_working_dir> + <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf N_RB_DL 25 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf tx_gain 90 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf rx_gain 125 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf pdsch_referenceSignalPower -26 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf ENB_INTERFACE_NAME_FOR_S1U \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf ENB_PORT_FOR_S1U 2152</eNB_config_file> + <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog> + <eNB_compile_prog_args>--eNB -w BLADERF -x -c </eNB_compile_prog_args> + <eNB_pre_exec>sudo -E $OPENAIR_DIR/cmake_targets/tools/start_bladerf.py</eNB_pre_exec> + <eNB_pre_exec_args></eNB_pre_exec_args> + <eNB_main_exec>sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf -W </eNB_main_exec_args> + <eNB_traffic_exec></eNB_traffic_exec> + <eNB_traffic_exec_args></eNB_traffic_exec_args> + <eNB_search_expr_true></eNB_search_expr_true> + <eNB_search_expr_false></eNB_search_expr_false> + <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs> + + <UE_working_dir>/tmp</UE_working_dir> + <UE_config_file></UE_config_file> + <UE_compile_prog></UE_compile_prog> + <UE_compile_prog_args></UE_compile_prog_args> + <UE_pre_exec></UE_pre_exec> + <UE_pre_exec_args></UE_pre_exec_args> + <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> + <UE_main_exec_args></UE_main_exec_args> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 10Mbits/s -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec_args></UE_traffic_exec_args> + <UE_search_expr_true></UE_search_expr_true> + <UE_search_expr_false></UE_search_expr_false> + <UE_terminate_missing_procs>False</UE_terminate_missing_procs> + <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue </UE_stop_script> + + <EPC_working_dir>/tmp</EPC_working_dir> + <EPC_config_file></EPC_config_file> + <EPC_compile_prog></EPC_compile_prog> + <EPC_compile_prog_args></EPC_compile_prog_args> + <HSS_compile_prog></HSS_compile_prog> + <HSS_compile_prog_args></HSS_compile_prog_args> + + <EPC_pre_exec></EPC_pre_exec> + <EPC_pre_exec_args></EPC_pre_exec_args> + <EPC_main_exec>/opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000</EPC_main_exec> + <EPC_main_exec_args></EPC_main_exec_args> + <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec> + <HSS_main_exec_args></HSS_main_exec_args> + <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m -B 192.172.0.1</EPC_traffic_exec> + <EPC_traffic_exec_args></EPC_traffic_exec_args> + <EPC_search_expr_true>throughput_test min=1.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec </EPC_search_expr_true> + <EPC_search_expr_false></EPC_search_expr_false> + <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs> + <tags>BladeRF.ALU_EPC.Bandrich.5MHz.FDD.Band_7.UL.1TX.1RX</tags> + <nruns>10</nruns> + </testCase> + + + <testCase id="016501" > + <class>lte-softmodem</class> + <desc></desc> + <eNB>mozart</eNB> + <UE>stevens</UE> + <EPC>amerique</EPC> + <TimeOut_cmd>390</TimeOut_cmd> + <eNB_working_dir>/tmp</eNB_working_dir> + <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf N_RB_DL 50 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf tx_gain 90 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf rx_gain 125 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf pdsch_referenceSignalPower -29 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf ENB_INTERFACE_NAME_FOR_S1U \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf ENB_PORT_FOR_S1U 2152</eNB_config_file> + <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog> + <eNB_compile_prog_args>--eNB -w BLADERF -x -c </eNB_compile_prog_args> + <eNB_pre_exec>sudo -E $OPENAIR_DIR/cmake_targets/tools/start_bladerf.py</eNB_pre_exec> + <eNB_pre_exec_args></eNB_pre_exec_args> + <eNB_main_exec>sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf -W </eNB_main_exec_args> + <eNB_traffic_exec></eNB_traffic_exec> + <eNB_traffic_exec_args></eNB_traffic_exec_args> + <eNB_search_expr_true></eNB_search_expr_true> + <eNB_search_expr_false></eNB_search_expr_false> + <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs> + + <UE_working_dir>/tmp</UE_working_dir> + <UE_config_file></UE_config_file> + <UE_compile_prog></UE_compile_prog> + <UE_compile_prog_args></UE_compile_prog_args> + <UE_pre_exec></UE_pre_exec> + <UE_pre_exec_args></UE_pre_exec_args> + <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> + <UE_main_exec_args></UE_main_exec_args> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 10Mbits/s -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec_args></UE_traffic_exec_args> + <UE_search_expr_true></UE_search_expr_true> + <UE_search_expr_false></UE_search_expr_false> + <UE_terminate_missing_procs>True</UE_terminate_missing_procs> + <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue </UE_stop_script> + + <EPC_working_dir>/tmp</EPC_working_dir> + <EPC_config_file></EPC_config_file> + <EPC_compile_prog></EPC_compile_prog> + <EPC_compile_prog_args></EPC_compile_prog_args> + <HSS_compile_prog></HSS_compile_prog> + <HSS_compile_prog_args></HSS_compile_prog_args> + + <EPC_pre_exec></EPC_pre_exec> + <EPC_pre_exec_args></EPC_pre_exec_args> + <EPC_main_exec>/opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000</EPC_main_exec> + <EPC_main_exec_args></EPC_main_exec_args> + <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec> + <HSS_main_exec_args></HSS_main_exec_args> + <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m -B 192.172.0.1</EPC_traffic_exec> + <EPC_traffic_exec_args></EPC_traffic_exec_args> + <EPC_search_expr_true>throughput_test min=1.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec </EPC_search_expr_true> + <EPC_search_expr_false></EPC_search_expr_false> + <EPC_terminate_missing_procs>True</EPC_terminate_missing_procs> + <tags>BladeRF.ALU_EPC.Bandrich.10MHz.FDD.Band_7.UL.1TX.1RX</tags> + <nruns>10</nruns> + </testCase> + + <testCase id="016502" > + <class>lte-softmodem</class> + <desc></desc> + <eNB>mozart</eNB> + <UE>stevens</UE> + <EPC>amerique</EPC> + <TimeOut_cmd>390</TimeOut_cmd> + <eNB_working_dir>/tmp</eNB_working_dir> + <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf N_RB_DL 100 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf tx_gain 90 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf rx_gain 125 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf pdsch_referenceSignalPower -32 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf ENB_INTERFACE_NAME_FOR_S1U \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf ENB_PORT_FOR_S1U 2152</eNB_config_file> + <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog> + <eNB_compile_prog_args>--eNB -w BLADERF -x -c </eNB_compile_prog_args> + <eNB_pre_exec>sudo -E $OPENAIR_DIR/cmake_targets/tools/start_bladerf.py</eNB_pre_exec> + <eNB_pre_exec_args></eNB_pre_exec_args> + <eNB_main_exec>sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf -W </eNB_main_exec_args> + <eNB_traffic_exec></eNB_traffic_exec> + <eNB_traffic_exec_args></eNB_traffic_exec_args> + <eNB_search_expr_true></eNB_search_expr_true> + <eNB_search_expr_false></eNB_search_expr_false> + <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs> + + <UE_working_dir>/tmp</UE_working_dir> + <UE_config_file></UE_config_file> + <UE_compile_prog></UE_compile_prog> + <UE_compile_prog_args></UE_compile_prog_args> + <UE_pre_exec></UE_pre_exec> + <UE_pre_exec_args></UE_pre_exec_args> + <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> + <UE_main_exec_args></UE_main_exec_args> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 10Mbits/s -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec_args></UE_traffic_exec_args> + <UE_search_expr_true></UE_search_expr_true> + <UE_search_expr_false></UE_search_expr_false> + <UE_terminate_missing_procs>True</UE_terminate_missing_procs> + <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue </UE_stop_script> + + <EPC_working_dir>/tmp</EPC_working_dir> + <EPC_config_file></EPC_config_file> + <EPC_compile_prog></EPC_compile_prog> + <EPC_compile_prog_args></EPC_compile_prog_args> + <HSS_compile_prog></HSS_compile_prog> + <HSS_compile_prog_args></HSS_compile_prog_args> + + <EPC_pre_exec></EPC_pre_exec> + <EPC_pre_exec_args></EPC_pre_exec_args> + <EPC_main_exec>/opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000</EPC_main_exec> + <EPC_main_exec_args></EPC_main_exec_args> + <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec> + <HSS_main_exec_args></HSS_main_exec_args> + <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m -B 192.172.0.1</EPC_traffic_exec> + <EPC_traffic_exec_args></EPC_traffic_exec_args> + <EPC_search_expr_true>throughput_test min=1.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec </EPC_search_expr_true> + <EPC_search_expr_false></EPC_search_expr_false> + <EPC_terminate_missing_procs>True</EPC_terminate_missing_procs> + <tags>BladeRF.ALU_EPC.Bandrich.20MHz.FDD.Band_7.UL.1TX.1RX</tags> + <nruns>10</nruns> + </testCase> + + <testCase id="016503" > + <class>lte-softmodem</class> + <desc></desc> + <eNB>mozart</eNB> + <UE>stevens</UE> + <EPC>amerique</EPC> + <TimeOut_cmd>390</TimeOut_cmd> + <eNB_working_dir>/tmp</eNB_working_dir> + <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf N_RB_DL 25 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf tx_gain 90 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf rx_gain 125 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf pdsch_referenceSignalPower -26 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf ENB_INTERFACE_NAME_FOR_S1U \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf ENB_PORT_FOR_S1U 2152</eNB_config_file> + <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog> + <eNB_compile_prog_args>--eNB -w BLADERF -x -c </eNB_compile_prog_args> + <eNB_pre_exec>sudo -E $OPENAIR_DIR/cmake_targets/tools/start_bladerf.py</eNB_pre_exec> + <eNB_pre_exec_args></eNB_pre_exec_args> + <eNB_main_exec>sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf -W </eNB_main_exec_args> + <eNB_traffic_exec></eNB_traffic_exec> + <eNB_traffic_exec_args></eNB_traffic_exec_args> + <eNB_search_expr_true></eNB_search_expr_true> + <eNB_search_expr_false></eNB_search_expr_false> + <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs> + + <UE_working_dir>/tmp</UE_working_dir> + <UE_config_file></UE_config_file> + <UE_compile_prog></UE_compile_prog> + <UE_compile_prog_args></UE_compile_prog_args> + <UE_pre_exec></UE_pre_exec> + <UE_pre_exec_args></UE_pre_exec_args> + <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> + <UE_main_exec_args></UE_main_exec_args> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec_args></UE_traffic_exec_args> + <UE_terminate_missing_procs>True</UE_terminate_missing_procs> + <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue </UE_stop_script> + <UE_search_expr_true>throughput_test min=4.0Mbits/sec max=5.0Mbits/sec average=4.0Mbits/sec </UE_search_expr_true> + <UE_search_expr_false></UE_search_expr_false> + + <EPC_working_dir>/tmp</EPC_working_dir> + <EPC_config_file></EPC_config_file> + <EPC_compile_prog></EPC_compile_prog> + <EPC_compile_prog_args></EPC_compile_prog_args> + <HSS_compile_prog></HSS_compile_prog> + <HSS_compile_prog_args></HSS_compile_prog_args> + + <EPC_pre_exec></EPC_pre_exec> + <EPC_pre_exec_args></EPC_pre_exec_args> + <EPC_main_exec>/opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000</EPC_main_exec> + <EPC_main_exec_args></EPC_main_exec_args> + <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec> + <HSS_main_exec_args></HSS_main_exec_args> + <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s -B 192.172.0.1</EPC_traffic_exec> + <EPC_traffic_exec_args></EPC_traffic_exec_args> + <EPC_search_expr_false></EPC_search_expr_false> + <EPC_terminate_missing_procs>True</EPC_terminate_missing_procs> + <tags>BladeRF.ALU_EPC.Bandrich.5MHz.FDD.Band_7.DL.1TX.1RX</tags> + <nruns>10</nruns> + </testCase> + + <testCase id="016504" > + <class>lte-softmodem</class> + <desc></desc> + <eNB>mozart</eNB> + <UE>stevens</UE> + <EPC>amerique</EPC> + <TimeOut_cmd>390</TimeOut_cmd> + <eNB_working_dir>/tmp</eNB_working_dir> + <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf N_RB_DL 50 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf tx_gain 90 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf rx_gain 125 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf pdsch_referenceSignalPower -29 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf ENB_INTERFACE_NAME_FOR_S1U \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf ENB_PORT_FOR_S1U 2152</eNB_config_file> <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog> - <eNB_compile_prog_args>--eNB -w USRP -x -c </eNB_compile_prog_args> - <eNB_pre_exec>sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail</eNB_pre_exec> + <eNB_compile_prog_args>--eNB -w BLADERF -x -c </eNB_compile_prog_args> + <eNB_pre_exec>sudo -E $OPENAIR_DIR/cmake_targets/tools/start_bladerf.py</eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> - <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf </eNB_main_exec_args> + <eNB_main_exec>sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf -W </eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> <eNB_search_expr_false></eNB_search_expr_false> - <eNB_terminate_missing_procs>True</eNB_terminate_missing_procs> + <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs> <UE_working_dir>/tmp</UE_working_dir> - <UE_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf tracking_area_code \"4\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_country_code \"5\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_network_code \"6\"</UE_config_file> - <UE_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog> - <UE_compile_prog_args>--eNB -w USRP -x -c </UE_compile_prog_args> + <UE_config_file></UE_config_file> + <UE_compile_prog_args></UE_compile_prog_args> <UE_pre_exec></UE_pre_exec> <UE_pre_exec_args></UE_pre_exec_args> - <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 45; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> + <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> <UE_main_exec_args></UE_main_exec_args> - <UE_traffic_exec>while true; do var=`ifconfig ppp0` ;sleep 1; if [ "$var" != "" ]; then break; fi ; done ; sleep 5; iperf -u -c 192.172.0.1 -b 10Mbits/s -t 300 -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m -B 192.172.0.2</UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> - <UE_search_expr_true></UE_search_expr_true> + <UE_search_expr_true>throughput_test min=8.0Mbits/sec max=9.0Mbits/sec average=8.5Mbits/sec </UE_search_expr_true> <UE_search_expr_false></UE_search_expr_false> <UE_terminate_missing_procs>True</UE_terminate_missing_procs> <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue </UE_stop_script> + <EPC_working_dir>/tmp</EPC_working_dir> - <EPC_config_file>BUILD/EPC/epc.local.enb.conf.in MCC \"208\" - BUILD/EPC/epc.local.enb.conf.in MNC \"92\" - BUILD/EPC/epc.local.enb.conf.in TAC \"1\" - BUILD/EPC/epc.local.enb.conf.in PGW_INTERFACE_NAME_FOR_SGI \"eth1\" - BUILD/EPC/epc.local.enb.conf.in PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.82/24\" </EPC_config_file> - <EPC_compile_prog>SCRIPTS/build_epc</EPC_compile_prog> - <EPC_compile_prog_args>-c -l</EPC_compile_prog_args> - <HSS_compile_prog>SCRIPTS/build_hss</HSS_compile_prog> - <HSS_compile_prog_args> -c -l </HSS_compile_prog_args> + <EPC_config_file></EPC_config_file> + <EPC_compile_prog></EPC_compile_prog> + <EPC_compile_prog_args></EPC_compile_prog_args> + <HSS_compile_prog></HSS_compile_prog> + <HSS_compile_prog_args></HSS_compile_prog_args> <EPC_pre_exec></EPC_pre_exec> <EPC_pre_exec_args></EPC_pre_exec_args> @@ -2077,77 +4998,74 @@ <EPC_main_exec_args></EPC_main_exec_args> <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec> <HSS_main_exec_args></HSS_main_exec_args> - <EPC_traffic_exec>sleep 5; iperf -s -i 1 -u -f m -B 192.172.0.1</EPC_traffic_exec> + <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s -B 192.172.0.1</EPC_traffic_exec> <EPC_traffic_exec_args></EPC_traffic_exec_args> - <EPC_search_expr_true>throughput_test min=4.0Mbits/sec max=4.0Mbits/sec average=4.0Mbits/sec duration=300.0s </EPC_search_expr_true> <EPC_search_expr_false></EPC_search_expr_false> <EPC_terminate_missing_procs>True</EPC_terminate_missing_procs> - <tags>USRPx310.ALU_EPC.Bandrich.20MHz.FDD.Band_7.UL.1TX.1RX</tags> + <tags>BladeRF.ALU_EPC.Bandrich.10MHz.FDD.Band_7.DL.1TX.1RX</tags> <nruns>10</nruns> </testCase> - <testCase id="015803" > + <testCase id="016505" > <class>lte-softmodem</class> <desc></desc> <eNB>mozart</eNB> <UE>stevens</UE> <EPC>amerique</EPC> - <TimeOut_cmd>360</TimeOut_cmd> + <TimeOut_cmd>390</TimeOut_cmd> <eNB_working_dir>/tmp</eNB_working_dir> - <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf tracking_area_code \"1\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf mobile_country_code \"208\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf mobile_network_code \"92\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf N_RB_DL 25 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf downlink_frequency 2660000000L - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf uplink_frequency_offset -120000000 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf frame_type \"FDD\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf nb_antennas_rx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf nb_antennas_tx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth0\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.111/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1U \"eth0\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.111/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf ENB_PORT_FOR_S1U 2152</eNB_config_file> + <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf N_RB_DL 100 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf tx_gain 90 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf rx_gain 125 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf pdsch_referenceSignalPower -32 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf ENB_INTERFACE_NAME_FOR_S1U \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf ENB_PORT_FOR_S1U 2152</eNB_config_file> <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog> - <eNB_compile_prog_args>--eNB -w USRP -x -c </eNB_compile_prog_args> - <eNB_pre_exec>sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail</eNB_pre_exec> + <eNB_compile_prog_args>--eNB -w BLADERF -x -c </eNB_compile_prog_args> + <eNB_pre_exec>sudo -E $OPENAIR_DIR/cmake_targets/tools/start_bladerf.py</eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> - <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf </eNB_main_exec_args> + <eNB_main_exec>sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf -W </eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> <eNB_search_expr_false></eNB_search_expr_false> - <eNB_terminate_missing_procs>True</eNB_terminate_missing_procs> + <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs> <UE_working_dir>/tmp</UE_working_dir> - <UE_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf tracking_area_code \"4\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_country_code \"5\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_network_code \"6\"</UE_config_file> - <UE_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog> - <UE_compile_prog_args>--eNB -w USRP -x -c </UE_compile_prog_args> + <UE_config_file></UE_config_file> + <UE_compile_prog></UE_compile_prog> + <UE_compile_prog_args></UE_compile_prog_args> <UE_pre_exec></UE_pre_exec> <UE_pre_exec_args></UE_pre_exec_args> - <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 45; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> + <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> <UE_main_exec_args></UE_main_exec_args> - <UE_traffic_exec>while true; do var=`ifconfig ppp0` ;sleep 1; if [ "$var" != "" ]; then break; fi ; done ; sleep 5; iperf -s -i 1 -u -f m -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m -B 192.172.0.2</UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> + <UE_search_expr_true>throughput_test min=15.0Mbits/sec max=15.0Mbits/sec average=15.0Mbits/sec </UE_search_expr_true> + <UE_search_expr_false></UE_search_expr_false> <UE_terminate_missing_procs>True</UE_terminate_missing_procs> <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue </UE_stop_script> - <UE_search_expr_true>throughput_test min=4.0Mbits/sec max=5.0Mbits/sec average=4.0Mbits/sec duration=300.0s </UE_search_expr_true> - <UE_search_expr_false></UE_search_expr_false> + <EPC_working_dir>/tmp</EPC_working_dir> - <EPC_config_file>BUILD/EPC/epc.local.enb.conf.in MCC \"208\" - BUILD/EPC/epc.local.enb.conf.in MNC \"92\" - BUILD/EPC/epc.local.enb.conf.in TAC \"1\" - BUILD/EPC/epc.local.enb.conf.in PGW_INTERFACE_NAME_FOR_SGI \"eth1\" - BUILD/EPC/epc.local.enb.conf.in PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.82/24\" </EPC_config_file> - <EPC_compile_prog>SCRIPTS/build_epc</EPC_compile_prog> - <EPC_compile_prog_args>-c -l</EPC_compile_prog_args> - <HSS_compile_prog>SCRIPTS/build_hss</HSS_compile_prog> - <HSS_compile_prog_args> -c -l </HSS_compile_prog_args> + <EPC_config_file></EPC_config_file> + <EPC_compile_prog></EPC_compile_prog> + <EPC_compile_prog_args></EPC_compile_prog_args> + <HSS_compile_prog></HSS_compile_prog> + <HSS_compile_prog_args></HSS_compile_prog_args> <EPC_pre_exec></EPC_pre_exec> <EPC_pre_exec_args></EPC_pre_exec_args> @@ -2155,76 +5073,73 @@ <EPC_main_exec_args></EPC_main_exec_args> <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec> <HSS_main_exec_args></HSS_main_exec_args> - <EPC_traffic_exec>sleep 60; iperf -u -c 192.172.0.2 -b 10Mbits/s -t 300 -B 192.172.0.1</EPC_traffic_exec> + <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s -B 192.172.0.1</EPC_traffic_exec> <EPC_traffic_exec_args></EPC_traffic_exec_args> <EPC_search_expr_false></EPC_search_expr_false> <EPC_terminate_missing_procs>True</EPC_terminate_missing_procs> - <tags>USRPx310.ALU_EPC.Bandrich.5MHz.FDD.Band_7.DL.1TX.1RX</tags> + <tags>BladeRF.ALU_EPC.Bandrich.20MHz.FDD.Band_7.DL.1TX.1RX</tags> <nruns>10</nruns> </testCase> - <testCase id="015804" > + <testCase id="017000" > <class>lte-softmodem</class> <desc></desc> <eNB>mozart</eNB> <UE>stevens</UE> <EPC>amerique</EPC> - <TimeOut_cmd>360</TimeOut_cmd> + <TimeOut_cmd>390</TimeOut_cmd> <eNB_working_dir>/tmp</eNB_working_dir> - <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf tracking_area_code \"1\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf mobile_country_code \"208\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf mobile_network_code \"92\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf N_RB_DL 50 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf downlink_frequency 2660000000L - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf uplink_frequency_offset -120000000 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf frame_type \"FDD\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf nb_antennas_rx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf nb_antennas_tx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth0\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.111/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf ENB_INTERFACE_NAME_FOR_S1U \"eth0\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.111/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf ENB_PORT_FOR_S1U 2152</eNB_config_file> + <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf N_RB_DL 25 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf tx_gain 60 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf rx_gain 111 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf pdsch_referenceSignalPower -26 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf ENB_INTERFACE_NAME_FOR_S1U \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf ENB_PORT_FOR_S1U 2152</eNB_config_file> <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog> - <eNB_compile_prog_args>--eNB -w USRP -x -c </eNB_compile_prog_args> - <eNB_pre_exec>sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail</eNB_pre_exec> - <eNB_pre_exec_args>sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail</eNB_pre_exec_args> - <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf </eNB_main_exec_args> + <eNB_compile_prog_args>--eNB -w LMSSDR -x -c </eNB_compile_prog_args> + <eNB_pre_exec></eNB_pre_exec> + <eNB_pre_exec_args></eNB_pre_exec_args> + <eNB_main_exec>sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf -W </eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> <eNB_search_expr_false></eNB_search_expr_false> - <eNB_terminate_missing_procs>True</eNB_terminate_missing_procs> + <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs> <UE_working_dir>/tmp</UE_working_dir> - <UE_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf tracking_area_code \"4\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_country_code \"5\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_network_code \"6\"</UE_config_file> - <UE_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog> - <UE_compile_prog_args>--eNB -w USRP -x -c </UE_compile_prog_args> + <UE_config_file></UE_config_file> + <UE_compile_prog></UE_compile_prog> + <UE_compile_prog_args></UE_compile_prog_args> <UE_pre_exec></UE_pre_exec> <UE_pre_exec_args></UE_pre_exec_args> - <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 45; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> + <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> <UE_main_exec_args></UE_main_exec_args> - <UE_traffic_exec>while true; do var=`ifconfig ppp0` ;sleep 1; if [ "$var" != "" ]; then break; fi ; done ; sleep 5; iperf -s -i 1 -u -f m -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 10Mbits/s -B 192.172.0.2</UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> - <UE_terminate_missing_procs>True</UE_terminate_missing_procs> - <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue </UE_stop_script> - <UE_search_expr_true>throughput_test min=8.0Mbits/sec max=9.0Mbits/sec average=8.5Mbits/sec duration=300.0s </UE_search_expr_true> + <UE_search_expr_true></UE_search_expr_true> <UE_search_expr_false></UE_search_expr_false> + <UE_terminate_missing_procs>False</UE_terminate_missing_procs> + <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue </UE_stop_script> <EPC_working_dir>/tmp</EPC_working_dir> - <EPC_config_file>BUILD/EPC/epc.local.enb.conf.in MCC \"208\" - BUILD/EPC/epc.local.enb.conf.in MNC \"92\" - BUILD/EPC/epc.local.enb.conf.in TAC \"1\" - BUILD/EPC/epc.local.enb.conf.in PGW_INTERFACE_NAME_FOR_SGI \"eth1\" - BUILD/EPC/epc.local.enb.conf.in PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.82/24\" </EPC_config_file> - <EPC_compile_prog>SCRIPTS/build_epc</EPC_compile_prog> - <EPC_compile_prog_args>-c -l</EPC_compile_prog_args> - <HSS_compile_prog>SCRIPTS/build_hss</HSS_compile_prog> - <HSS_compile_prog_args> -c -l </HSS_compile_prog_args> + <EPC_config_file></EPC_config_file> + <EPC_compile_prog></EPC_compile_prog> + <EPC_compile_prog_args></EPC_compile_prog_args> + <HSS_compile_prog></HSS_compile_prog> + <HSS_compile_prog_args></HSS_compile_prog_args> <EPC_pre_exec></EPC_pre_exec> <EPC_pre_exec_args></EPC_pre_exec_args> @@ -2232,76 +5147,75 @@ <EPC_main_exec_args></EPC_main_exec_args> <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec> <HSS_main_exec_args></HSS_main_exec_args> - <EPC_traffic_exec>sleep 60; iperf -u -c 192.172.0.2 -b 10Mbits/s -t 300 -B 192.172.0.1</EPC_traffic_exec> + <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m -B 192.172.0.1</EPC_traffic_exec> <EPC_traffic_exec_args></EPC_traffic_exec_args> + <EPC_search_expr_true>throughput_test min=1.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec </EPC_search_expr_true> <EPC_search_expr_false></EPC_search_expr_false> - <EPC_terminate_missing_procs>True</EPC_terminate_missing_procs> - <tags>USRPx310.ALU_EPC.Bandrich.10MHz.FDD.Band_7.DL.1TX.1RX</tags> + <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs> + <tags>SoDeRa.ALU_EPC.Bandrich.5MHz.FDD.Band_7.UL.1TX.1RX</tags> <nruns>10</nruns> </testCase> - <testCase id="015805" > + + <testCase id="017001" > <class>lte-softmodem</class> <desc></desc> <eNB>mozart</eNB> <UE>stevens</UE> <EPC>amerique</EPC> - <TimeOut_cmd>360</TimeOut_cmd> - <eNB_working_dir>/tmp</eNB_working_dir> - <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.epc.conf tracking_area_code \"1\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.epc.conf mobile_country_code \"208\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.epc.conf mobile_network_code \"92\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.epc.conf N_RB_DL 100 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.epc.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.epc.conf downlink_frequency 2660000000L - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.epc.conf uplink_frequency_offset -120000000 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.epc.conf frame_type \"FDD\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.epc.conf nb_antennas_rx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.epc.conf nb_antennas_tx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth0\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.111/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf ENB_INTERFACE_NAME_FOR_S1U \"eth0\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.111/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf ENB_PORT_FOR_S1U 2152</eNB_config_file> + <TimeOut_cmd>390</TimeOut_cmd> + <eNB_working_dir>/tmp</eNB_working_dir> + <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf N_RB_DL 50 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf tx_gain 60 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf rx_gain 111 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf pdsch_referenceSignalPower -26 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf ENB_INTERFACE_NAME_FOR_S1U \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf ENB_PORT_FOR_S1U 2152</eNB_config_file> <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog> - <eNB_compile_prog_args>--eNB -w USRP -x -c </eNB_compile_prog_args> - <eNB_pre_exec>sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail</eNB_pre_exec> + <eNB_compile_prog_args>--eNB -w LMSSDR -x -c </eNB_compile_prog_args> + <eNB_pre_exec></eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> - <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.epc.conf </eNB_main_exec_args> + <eNB_main_exec>sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf -W </eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> <eNB_search_expr_false></eNB_search_expr_false> - <eNB_terminate_missing_procs>True</eNB_terminate_missing_procs> + <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs> <UE_working_dir>/tmp</UE_working_dir> - <UE_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf tracking_area_code \"4\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_country_code \"5\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_network_code \"6\"</UE_config_file> - <UE_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog> - <UE_compile_prog_args>--eNB -w USRP -x -c </UE_compile_prog_args> + <UE_config_file></UE_config_file> + <UE_compile_prog></UE_compile_prog> + <UE_compile_prog_args></UE_compile_prog_args> <UE_pre_exec></UE_pre_exec> <UE_pre_exec_args></UE_pre_exec_args> - <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 45; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> + <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> <UE_main_exec_args></UE_main_exec_args> - <UE_traffic_exec>while true; do var=`ifconfig ppp0` ;sleep 1; if [ "$var" != "" ]; then break; fi ; done ; sleep 5; iperf -s -i 1 -u -f m -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 10Mbits/s -B 192.172.0.2</UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> + <UE_search_expr_true></UE_search_expr_true> + <UE_search_expr_false></UE_search_expr_false> <UE_terminate_missing_procs>True</UE_terminate_missing_procs> <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue </UE_stop_script> - <UE_search_expr_true>throughput_test min=15.0Mbits/sec max=15.0Mbits/sec average=15.0Mbits/sec duration=300.0s </UE_search_expr_true> - <UE_search_expr_false></UE_search_expr_false> <EPC_working_dir>/tmp</EPC_working_dir> - <EPC_config_file>BUILD/EPC/epc.local.enb.conf.in MCC \"208\" - BUILD/EPC/epc.local.enb.conf.in MNC \"92\" - BUILD/EPC/epc.local.enb.conf.in TAC \"1\" - BUILD/EPC/epc.local.enb.conf.in PGW_INTERFACE_NAME_FOR_SGI \"eth1\" - BUILD/EPC/epc.local.enb.conf.in PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.82/24\" </EPC_config_file> - <EPC_compile_prog>SCRIPTS/build_epc</EPC_compile_prog> - <EPC_compile_prog_args>-c -l</EPC_compile_prog_args> - <HSS_compile_prog>SCRIPTS/build_hss</HSS_compile_prog> - <HSS_compile_prog_args> -c -l </HSS_compile_prog_args> + <EPC_config_file></EPC_config_file> + <EPC_compile_prog></EPC_compile_prog> + <EPC_compile_prog_args></EPC_compile_prog_args> + <HSS_compile_prog></HSS_compile_prog> + <HSS_compile_prog_args></HSS_compile_prog_args> <EPC_pre_exec></EPC_pre_exec> <EPC_pre_exec_args></EPC_pre_exec_args> @@ -2309,63 +5223,62 @@ <EPC_main_exec_args></EPC_main_exec_args> <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec> <HSS_main_exec_args></HSS_main_exec_args> - <EPC_traffic_exec>sleep 60; iperf -u -c 192.172.0.2 -b 10Mbits/s -t 300 -B 192.172.0.1</EPC_traffic_exec> + <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m -B 192.172.0.1</EPC_traffic_exec> <EPC_traffic_exec_args></EPC_traffic_exec_args> + <EPC_search_expr_true>throughput_test min=1.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec </EPC_search_expr_true> <EPC_search_expr_false></EPC_search_expr_false> <EPC_terminate_missing_procs>True</EPC_terminate_missing_procs> - <tags>USRPx310.ALU_EPC.Bandrich.20MHz.FDD.Band_7.DL.1TX.1RX</tags> + <tags>SoDeRa.ALU_EPC.Bandrich.10MHz.FDD.Band_7.UL.1TX.1RX</tags> <nruns>10</nruns> </testCase> - - - - <testCase id="016100" > + <testCase id="017002" > <class>lte-softmodem</class> <desc></desc> - <eNB>calisson</eNB> + <eNB>mozart</eNB> <UE>stevens</UE> <EPC>amerique</EPC> - <TimeOut_cmd>360</TimeOut_cmd> + <TimeOut_cmd>390</TimeOut_cmd> <eNB_working_dir>/tmp</eNB_working_dir> - <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf tracking_area_code \"1\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf mobile_country_code \"208\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf mobile_network_code \"92\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf N_RB_DL 25 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf downlink_frequency 2660000000L - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf uplink_frequency_offset -120000000 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf frame_type \"FDD\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf nb_antennas_rx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf nb_antennas_tx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth1\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_INTERFACE_NAME_FOR_S1U \"eth1\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_PORT_FOR_S1U 2152</eNB_config_file> + <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf N_RB_DL 100 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf tx_gain 60 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf rx_gain 111 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf pdsch_referenceSignalPower -26 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf ENB_INTERFACE_NAME_FOR_S1U \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf ENB_PORT_FOR_S1U 2152</eNB_config_file> <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog> - <eNB_compile_prog_args>--eNB -w EXMIMO -x -c </eNB_compile_prog_args> - <eNB_pre_exec>sudo -E -S $OPENAIR_DIR/cmake_targets/tools/init_exmimo2; dmesg|tail </eNB_pre_exec> + <eNB_compile_prog_args>--eNB -w LMSSDR -x -c </eNB_compile_prog_args> + <eNB_pre_exec></eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> - <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf </eNB_main_exec_args> + <eNB_main_exec>sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf -W </eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> <eNB_search_expr_false></eNB_search_expr_false> - <eNB_terminate_missing_procs>True</eNB_terminate_missing_procs> + <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs> <UE_working_dir>/tmp</UE_working_dir> - <UE_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf tracking_area_code \"4\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_country_code \"5\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_network_code \"6\"</UE_config_file> - <UE_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog> - <UE_compile_prog_args>--eNB -w USRP -x -c </UE_compile_prog_args> + <UE_config_file></UE_config_file> + <UE_compile_prog></UE_compile_prog> + <UE_compile_prog_args></UE_compile_prog_args> <UE_pre_exec></UE_pre_exec> <UE_pre_exec_args></UE_pre_exec_args> - <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 45; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> + <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> <UE_main_exec_args></UE_main_exec_args> - <UE_traffic_exec>while true; do var=`ifconfig ppp0` ;sleep 1; if [ "$var" != "" ]; then break; fi ; done ; sleep 5; iperf -u -c 192.172.0.1 -b 10Mbits/s -t 300 -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 10Mbits/s -B 192.172.0.2</UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> <UE_search_expr_true></UE_search_expr_true> <UE_search_expr_false></UE_search_expr_false> @@ -2373,15 +5286,11 @@ <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue </UE_stop_script> <EPC_working_dir>/tmp</EPC_working_dir> - <EPC_config_file>BUILD/EPC/epc.local.enb.conf.in MCC \"208\" - BUILD/EPC/epc.local.enb.conf.in MNC \"92\" - BUILD/EPC/epc.local.enb.conf.in TAC \"1\" - BUILD/EPC/epc.local.enb.conf.in PGW_INTERFACE_NAME_FOR_SGI \"eth1\" - BUILD/EPC/epc.local.enb.conf.in PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.82/24\" </EPC_config_file> - <EPC_compile_prog>SCRIPTS/build_epc</EPC_compile_prog> - <EPC_compile_prog_args>-c -l</EPC_compile_prog_args> - <HSS_compile_prog>SCRIPTS/build_hss</HSS_compile_prog> - <HSS_compile_prog_args> -c -l </HSS_compile_prog_args> + <EPC_config_file></EPC_config_file> + <EPC_compile_prog></EPC_compile_prog> + <EPC_compile_prog_args></EPC_compile_prog_args> + <HSS_compile_prog></HSS_compile_prog> + <HSS_compile_prog_args></HSS_compile_prog_args> <EPC_pre_exec></EPC_pre_exec> <EPC_pre_exec_args></EPC_pre_exec_args> @@ -2389,78 +5298,223 @@ <EPC_main_exec_args></EPC_main_exec_args> <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec> <HSS_main_exec_args></HSS_main_exec_args> - <EPC_traffic_exec>sleep 5; iperf -s -i 1 -u -f m -B 192.172.0.1</EPC_traffic_exec> + <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m -B 192.172.0.1</EPC_traffic_exec> <EPC_traffic_exec_args></EPC_traffic_exec_args> - <EPC_search_expr_true>throughput_test min=1.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec duration=300.0s </EPC_search_expr_true> + <EPC_search_expr_true>throughput_test min=1.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec </EPC_search_expr_true> <EPC_search_expr_false></EPC_search_expr_false> <EPC_terminate_missing_procs>True</EPC_terminate_missing_procs> - <tags>EXMIMO.ALU_EPC.Bandrich.5MHz.FDD.Band_7.UL.1TX.1RX</tags> + <tags>SoDeRa.ALU_EPC.Bandrich.20MHz.FDD.Band_7.UL.1TX.1RX</tags> <nruns>10</nruns> </testCase> + <testCase id="017003" > + <class>lte-softmodem</class> + <desc></desc> + <eNB>mozart</eNB> + <UE>stevens</UE> + <EPC>amerique</EPC> + <TimeOut_cmd>390</TimeOut_cmd> + <eNB_working_dir>/tmp</eNB_working_dir> + <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf N_RB_DL 25 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf tx_gain 60 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf rx_gain 111 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf pdsch_referenceSignalPower -29 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf ENB_INTERFACE_NAME_FOR_S1U \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf ENB_PORT_FOR_S1U 2152</eNB_config_file> + <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog> + <eNB_compile_prog_args>--eNB -w LMSSDR -x -c </eNB_compile_prog_args> + <eNB_pre_exec></eNB_pre_exec> + <eNB_pre_exec_args></eNB_pre_exec_args> + <eNB_main_exec>sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf -W </eNB_main_exec_args> + <eNB_traffic_exec></eNB_traffic_exec> + <eNB_traffic_exec_args></eNB_traffic_exec_args> + <eNB_search_expr_true></eNB_search_expr_true> + <eNB_search_expr_false></eNB_search_expr_false> + <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs> + + <UE_working_dir>/tmp</UE_working_dir> + <UE_config_file></UE_config_file> + <UE_compile_prog></UE_compile_prog> + <UE_compile_prog_args></UE_compile_prog_args> + <UE_pre_exec></UE_pre_exec> + <UE_pre_exec_args></UE_pre_exec_args> + <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> + <UE_main_exec_args></UE_main_exec_args> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec_args></UE_traffic_exec_args> + <UE_terminate_missing_procs>True</UE_terminate_missing_procs> + <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue </UE_stop_script> + <UE_search_expr_true>throughput_test min=4.0Mbits/sec max=5.0Mbits/sec average=4.0Mbits/sec </UE_search_expr_true> + <UE_search_expr_false></UE_search_expr_false> + + <EPC_working_dir>/tmp</EPC_working_dir> + <EPC_config_file></EPC_config_file> + <EPC_compile_prog></EPC_compile_prog> + <EPC_compile_prog_args></EPC_compile_prog_args> + <HSS_compile_prog></HSS_compile_prog> + <HSS_compile_prog_args></HSS_compile_prog_args> - <testCase id="016101" > + <EPC_pre_exec></EPC_pre_exec> + <EPC_pre_exec_args></EPC_pre_exec_args> + <EPC_main_exec>/opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000</EPC_main_exec> + <EPC_main_exec_args></EPC_main_exec_args> + <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec> + <HSS_main_exec_args></HSS_main_exec_args> + <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s -B 192.172.0.1</EPC_traffic_exec> + <EPC_traffic_exec_args></EPC_traffic_exec_args> + <EPC_search_expr_false></EPC_search_expr_false> + <EPC_terminate_missing_procs>True</EPC_terminate_missing_procs> + <tags>BladeRF.ALU_EPC.Bandrich.5MHz.FDD.Band_7.DL.1TX.1RX</tags> + <nruns>10</nruns> + </testCase> + + <testCase id="017004" > <class>lte-softmodem</class> <desc></desc> - <eNB>calisson</eNB> + <eNB>mozart</eNB> <UE>stevens</UE> <EPC>amerique</EPC> - <TimeOut_cmd>360</TimeOut_cmd> + <TimeOut_cmd>390</TimeOut_cmd> <eNB_working_dir>/tmp</eNB_working_dir> - <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf tracking_area_code \"1\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf mobile_country_code \"208\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf mobile_network_code \"92\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf N_RB_DL 50 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf downlink_frequency 2660000000L - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf uplink_frequency_offset -120000000 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf frame_type \"FDD\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf nb_antennas_rx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf nb_antennas_tx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth1\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_INTERFACE_NAME_FOR_S1U \"eth1\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_PORT_FOR_S1U 2152</eNB_config_file> + <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf N_RB_DL 50 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf tx_gain 60 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf rx_gain 111 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf pdsch_referenceSignalPower -29 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf ENB_INTERFACE_NAME_FOR_S1U \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf ENB_PORT_FOR_S1U 2152</eNB_config_file> <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog> - <eNB_compile_prog_args>--eNB -w EXMIMO -x -c </eNB_compile_prog_args> - <eNB_pre_exec>sudo -E -S $OPENAIR_DIR/cmake_targets/tools/init_exmimo2 ; dmesg|tail</eNB_pre_exec> + <eNB_compile_prog_args>--eNB -w LMSSDR -x -c </eNB_compile_prog_args> + <eNB_pre_exec></eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> - <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf </eNB_main_exec_args> + <eNB_main_exec>sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf -W </eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> <eNB_search_expr_false></eNB_search_expr_false> - <eNB_terminate_missing_procs>True</eNB_terminate_missing_procs> + <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs> <UE_working_dir>/tmp</UE_working_dir> - <UE_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf tracking_area_code \"4\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_country_code \"5\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_network_code \"6\"</UE_config_file> - <UE_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog> - <UE_compile_prog_args>--eNB -w USRP -x -c </UE_compile_prog_args> + <UE_config_file></UE_config_file> + <UE_compile_prog_args></UE_compile_prog_args> <UE_pre_exec></UE_pre_exec> <UE_pre_exec_args></UE_pre_exec_args> - <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 45; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> + <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> <UE_main_exec_args></UE_main_exec_args> - <UE_traffic_exec>while true; do var=`ifconfig ppp0` ;sleep 1; if [ "$var" != "" ]; then break; fi ; done ; sleep 5; iperf -u -c 192.172.0.1 -b 10Mbits/s -t 300 -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m -B 192.172.0.2</UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> - <UE_search_expr_true></UE_search_expr_true> + <UE_search_expr_true>throughput_test min=8.0Mbits/sec max=9.0Mbits/sec average=8.5Mbits/sec </UE_search_expr_true> <UE_search_expr_false></UE_search_expr_false> <UE_terminate_missing_procs>True</UE_terminate_missing_procs> <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue </UE_stop_script> + <EPC_working_dir>/tmp</EPC_working_dir> - <EPC_config_file>BUILD/EPC/epc.local.enb.conf.in MCC \"208\" - BUILD/EPC/epc.local.enb.conf.in MNC \"92\" - BUILD/EPC/epc.local.enb.conf.in TAC \"1\" - BUILD/EPC/epc.local.enb.conf.in PGW_INTERFACE_NAME_FOR_SGI \"eth1\" - BUILD/EPC/epc.local.enb.conf.in PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.82/24\" </EPC_config_file> - <EPC_compile_prog>SCRIPTS/build_epc</EPC_compile_prog> - <EPC_compile_prog_args>-c -l</EPC_compile_prog_args> - <HSS_compile_prog>SCRIPTS/build_hss</HSS_compile_prog> - <HSS_compile_prog_args> -c -l </HSS_compile_prog_args> + <EPC_config_file></EPC_config_file> + <EPC_compile_prog></EPC_compile_prog> + <EPC_compile_prog_args></EPC_compile_prog_args> + <HSS_compile_prog></HSS_compile_prog> + <HSS_compile_prog_args></HSS_compile_prog_args> + + <EPC_pre_exec></EPC_pre_exec> + <EPC_pre_exec_args></EPC_pre_exec_args> + <EPC_main_exec>/opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000</EPC_main_exec> + <EPC_main_exec_args></EPC_main_exec_args> + <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec> + <HSS_main_exec_args></HSS_main_exec_args> + <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s -B 192.172.0.1</EPC_traffic_exec> + <EPC_traffic_exec_args></EPC_traffic_exec_args> + <EPC_search_expr_false></EPC_search_expr_false> + <EPC_terminate_missing_procs>True</EPC_terminate_missing_procs> + <tags>SoDeRa.ALU_EPC.Bandrich.10MHz.FDD.Band_7.DL.1TX.1RX</tags> + <nruns>10</nruns> + </testCase> + + <testCase id="017005" > + <class>lte-softmodem</class> + <desc></desc> + <eNB>mozart</eNB> + <UE>stevens</UE> + <EPC>amerique</EPC> + <TimeOut_cmd>390</TimeOut_cmd> + <eNB_working_dir>/tmp</eNB_working_dir> + <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf N_RB_DL 100 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf tx_gain 60 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf rx_gain 111 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf pdsch_referenceSignalPower -29 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf ENB_INTERFACE_NAME_FOR_S1U \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf ENB_PORT_FOR_S1U 2152</eNB_config_file> + <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog> + <eNB_compile_prog_args>--eNB -w LMSSDR -x -c </eNB_compile_prog_args> + <eNB_pre_exec></eNB_pre_exec> + <eNB_pre_exec_args></eNB_pre_exec_args> + <eNB_main_exec>sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf -W </eNB_main_exec_args> + <eNB_traffic_exec></eNB_traffic_exec> + <eNB_traffic_exec_args></eNB_traffic_exec_args> + <eNB_search_expr_true></eNB_search_expr_true> + <eNB_search_expr_false></eNB_search_expr_false> + <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs> + + <UE_working_dir>/tmp</UE_working_dir> + <UE_config_file></UE_config_file> + <UE_compile_prog></UE_compile_prog> + <UE_compile_prog_args></UE_compile_prog_args> + <UE_pre_exec></UE_pre_exec> + <UE_pre_exec_args></UE_pre_exec_args> + <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> + <UE_main_exec_args></UE_main_exec_args> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec_args></UE_traffic_exec_args> + <UE_search_expr_true>throughput_test min=15.0Mbits/sec max=15.0Mbits/sec average=15.0Mbits/sec </UE_search_expr_true> + <UE_search_expr_false></UE_search_expr_false> + <UE_terminate_missing_procs>True</UE_terminate_missing_procs> + <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue </UE_stop_script> + + + <EPC_working_dir>/tmp</EPC_working_dir> + <EPC_config_file></EPC_config_file> + <EPC_compile_prog></EPC_compile_prog> + <EPC_compile_prog_args></EPC_compile_prog_args> + <HSS_compile_prog></HSS_compile_prog> + <HSS_compile_prog_args></HSS_compile_prog_args> <EPC_pre_exec></EPC_pre_exec> <EPC_pre_exec_args></EPC_pre_exec_args> @@ -2468,77 +5522,83 @@ <EPC_main_exec_args></EPC_main_exec_args> <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec> <HSS_main_exec_args></HSS_main_exec_args> - <EPC_traffic_exec>sleep 5; iperf -s -i 1 -u -f m -B 192.172.0.1</EPC_traffic_exec> + <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s -B 192.172.0.1</EPC_traffic_exec> <EPC_traffic_exec_args></EPC_traffic_exec_args> - <EPC_search_expr_true>throughput_test min=2.0Mbits/sec max=2.0Mbits/sec average=2.0Mbits/sec duration=300.0s </EPC_search_expr_true> <EPC_search_expr_false></EPC_search_expr_false> <EPC_terminate_missing_procs>True</EPC_terminate_missing_procs> - <tags>EXMIMO.ALU_EPC.Bandrich.10MHz.FDD.Band_7.UL.1TX.1RX</tags> + <tags>SoDeRa.ALU_EPC.Bandrich.20MHz.FDD.Band_7.DL.1TX.1RX</tags> <nruns>10</nruns> </testCase> - <testCase id="016102" > + <testCase id="017500" > <class>lte-softmodem</class> <desc></desc> - <eNB>calisson</eNB> + <RRH>calisson</RRH> <UE>stevens</UE> <EPC>amerique</EPC> - <TimeOut_cmd>360</TimeOut_cmd> + <eNB>mozart</eNB> + <TimeOut_cmd>390</TimeOut_cmd> <eNB_working_dir>/tmp</eNB_working_dir> - <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf tracking_area_code \"1\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf mobile_country_code \"208\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf mobile_network_code \"92\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf N_RB_DL 100 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf downlink_frequency 2660000000L - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf uplink_frequency_offset -120000000 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf frame_type \"FDD\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf nb_antennas_rx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf nb_antennas_tx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth1\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_INTERFACE_NAME_FOR_S1U \"eth1\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_PORT_FOR_S1U 2152</eNB_config_file> + <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf N_RB_DL 25 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tx_gain 90 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf rx_gain 125 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1U \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_PORT_FOR_S1U 2152 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf rrh_gw_config "local_if_name=\"eth0\";remote_address=\"10:60:4b:75:80:83\";local_address=\"98:90:96:df:66:07\";local_port=50000;remote_port=50000;tr_preference=\"raw\";rf_preference=\"usrp_b200\";iq_txshift=5;tx_sample_advance=70;tx_scheduling_advance=9;"</eNB_config_file> + + <RRH_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</RRH_compile_prog> + <RRH_compile_prog_args>--RRH -w USRP -t ETHERNET -c --disable-deadline </RRH_compile_prog_args> + <RRH_pre_exec></RRH_pre_exec> + <RRH_pre_exec_args></RRH_pre_exec_args> + <RRH_main_exec>sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/rrh_gw/build/rrh_gw</RRH_main_exec> + <RRH_main_exec_args> -n1 -g3 -x -i eth1 </RRH_main_exec_args> + <RRH_terminate_missing_procs>False</RRH_terminate_missing_procs> + <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog> - <eNB_compile_prog_args>--eNB -w EXMIMO -x -c </eNB_compile_prog_args> - <eNB_pre_exec>sudo -E -S $OPENAIR_DIR/cmake_targets/tools/init_exmimo2 ; dmesg|tail</eNB_pre_exec> + <eNB_compile_prog_args>--eNB -w None -t ETHERNET -x -c --disable-deadline </eNB_compile_prog_args> + <eNB_pre_exec></eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> - <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf </eNB_main_exec_args> + <eNB_main_exec>sleep 5; $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf -W </eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> <eNB_search_expr_false></eNB_search_expr_false> - <eNB_terminate_missing_procs>True</eNB_terminate_missing_procs> + <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs> <UE_working_dir>/tmp</UE_working_dir> - <UE_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf tracking_area_code \"4\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_country_code \"5\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_network_code \"6\"</UE_config_file> - <UE_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog> - <UE_compile_prog_args>--eNB -w USRP -x -c </UE_compile_prog_args> + <UE_config_file></UE_config_file> + <UE_compile_prog></UE_compile_prog> + <UE_compile_prog_args></UE_compile_prog_args> <UE_pre_exec></UE_pre_exec> <UE_pre_exec_args></UE_pre_exec_args> - <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 45; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> + <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> <UE_main_exec_args></UE_main_exec_args> - <UE_traffic_exec>while true; do var=`ifconfig ppp0` ;sleep 1; if [ "$var" != "" ]; then break; fi ; done ; sleep 5; iperf -u -c 192.172.0.1 -b 10Mbits/s -t 300 -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 10Mbits/s -B 192.172.0.2</UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> <UE_search_expr_true></UE_search_expr_true> <UE_search_expr_false></UE_search_expr_false> - <UE_terminate_missing_procs>True</UE_terminate_missing_procs> + <UE_terminate_missing_procs>False</UE_terminate_missing_procs> <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue </UE_stop_script> <EPC_working_dir>/tmp</EPC_working_dir> - <EPC_config_file>BUILD/EPC/epc.local.enb.conf.in MCC \"208\" - BUILD/EPC/epc.local.enb.conf.in MNC \"92\" - BUILD/EPC/epc.local.enb.conf.in TAC \"1\" - BUILD/EPC/epc.local.enb.conf.in PGW_INTERFACE_NAME_FOR_SGI \"eth1\" - BUILD/EPC/epc.local.enb.conf.in PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.82/24\" </EPC_config_file> - <EPC_compile_prog>SCRIPTS/build_epc</EPC_compile_prog> - <EPC_compile_prog_args>-c -l</EPC_compile_prog_args> - <HSS_compile_prog>SCRIPTS/build_hss</HSS_compile_prog> - <HSS_compile_prog_args> -c -l </HSS_compile_prog_args> + <EPC_config_file></EPC_config_file> + <EPC_compile_prog></EPC_compile_prog> + <EPC_compile_prog_args></EPC_compile_prog_args> + <HSS_compile_prog></HSS_compile_prog> + <HSS_compile_prog_args></HSS_compile_prog_args> <EPC_pre_exec></EPC_pre_exec> <EPC_pre_exec_args></EPC_pre_exec_args> @@ -2546,44 +5606,47 @@ <EPC_main_exec_args></EPC_main_exec_args> <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec> <HSS_main_exec_args></HSS_main_exec_args> - <EPC_traffic_exec>sleep 5; iperf -s -i 1 -u -f m -B 192.172.0.1</EPC_traffic_exec> + <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m -B 192.172.0.1</EPC_traffic_exec> <EPC_traffic_exec_args></EPC_traffic_exec_args> - <EPC_search_expr_true>throughput_test min=4.0Mbits/sec max=4.0Mbits/sec average=4.0Mbits/sec duration=300.0s </EPC_search_expr_true> + <EPC_search_expr_true>throughput_test min=1.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec </EPC_search_expr_true> <EPC_search_expr_false></EPC_search_expr_false> - <EPC_terminate_missing_procs>True</EPC_terminate_missing_procs> - <tags>EXMIMO.ALU_EPC.Bandrich.20MHz.FDD.Band_7.UL.1TX.1RX</tags> + <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs> + <tags>USRPb210.RRH.ALU_EPC.Bandrich.5MHz.FDD.Band_7.UL.1TX.1RX</tags> <nruns>10</nruns> </testCase> - <testCase id="016103" > + + <testCase id="017501" > <class>lte-softmodem</class> <desc></desc> <eNB>calisson</eNB> <UE>stevens</UE> <EPC>amerique</EPC> - <TimeOut_cmd>360</TimeOut_cmd> + <TimeOut_cmd>390</TimeOut_cmd> <eNB_working_dir>/tmp</eNB_working_dir> - <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf tracking_area_code \"1\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf mobile_country_code \"208\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf mobile_network_code \"92\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf N_RB_DL 25 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf downlink_frequency 2660000000L - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf uplink_frequency_offset -120000000 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf frame_type \"FDD\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf nb_antennas_rx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf nb_antennas_tx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth1\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_INTERFACE_NAME_FOR_S1U \"eth1\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_PORT_FOR_S1U 2152</eNB_config_file> + <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf N_RB_DL 50 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tx_gain 90 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf rx_gain 125 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_PORT_FOR_S1U 2152</eNB_config_file> <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog> - <eNB_compile_prog_args>--eNB -w EXMIMO -x -c </eNB_compile_prog_args> - <eNB_pre_exec>sudo -E -S $OPENAIR_DIR/cmake_targets/tools/init_exmimo2 ; dmesg|tail</eNB_pre_exec> + <eNB_compile_prog_args>--eNB -w USRP -x -c </eNB_compile_prog_args> + <eNB_pre_exec></eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf </eNB_main_exec_args> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf -W </eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> @@ -2591,32 +5654,26 @@ <eNB_terminate_missing_procs>True</eNB_terminate_missing_procs> <UE_working_dir>/tmp</UE_working_dir> - <UE_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf tracking_area_code \"4\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_country_code \"5\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_network_code \"6\"</UE_config_file> - <UE_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog> - <UE_compile_prog_args>--eNB -w USRP -x -c </UE_compile_prog_args> + <UE_config_file></UE_config_file> + <UE_compile_prog></UE_compile_prog> + <UE_compile_prog_args></UE_compile_prog_args> <UE_pre_exec></UE_pre_exec> <UE_pre_exec_args></UE_pre_exec_args> - <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 45; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> + <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> <UE_main_exec_args></UE_main_exec_args> - <UE_traffic_exec>while true; do var=`ifconfig ppp0` ;sleep 1; if [ "$var" != "" ]; then break; fi ; done ; sleep 5; iperf -s -i 1 -u -f m -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 10Mbits/s -B 192.172.0.2</UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> + <UE_search_expr_true></UE_search_expr_true> + <UE_search_expr_false></UE_search_expr_false> <UE_terminate_missing_procs>True</UE_terminate_missing_procs> <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue </UE_stop_script> - <UE_search_expr_true>throughput_test min=4.0Mbits/sec max=5.0Mbits/sec average=4.0Mbits/sec duration=300.0s </UE_search_expr_true> - <UE_search_expr_false></UE_search_expr_false> <EPC_working_dir>/tmp</EPC_working_dir> - <EPC_config_file>BUILD/EPC/epc.local.enb.conf.in MCC \"208\" - BUILD/EPC/epc.local.enb.conf.in MNC \"92\" - BUILD/EPC/epc.local.enb.conf.in TAC \"1\" - BUILD/EPC/epc.local.enb.conf.in PGW_INTERFACE_NAME_FOR_SGI \"eth1\" - BUILD/EPC/epc.local.enb.conf.in PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.82/24\" </EPC_config_file> - <EPC_compile_prog>SCRIPTS/build_epc</EPC_compile_prog> - <EPC_compile_prog_args>-c -l</EPC_compile_prog_args> - <HSS_compile_prog>SCRIPTS/build_hss</HSS_compile_prog> - <HSS_compile_prog_args> -c -l </HSS_compile_prog_args> + <EPC_config_file></EPC_config_file> + <EPC_compile_prog></EPC_compile_prog> + <EPC_compile_prog_args></EPC_compile_prog_args> + <HSS_compile_prog></HSS_compile_prog> + <HSS_compile_prog_args></HSS_compile_prog_args> <EPC_pre_exec></EPC_pre_exec> <EPC_pre_exec_args></EPC_pre_exec_args> @@ -2624,43 +5681,46 @@ <EPC_main_exec_args></EPC_main_exec_args> <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec> <HSS_main_exec_args></HSS_main_exec_args> - <EPC_traffic_exec>sleep 60; iperf -u -c 192.172.0.2 -b 10Mbits/s -t 300 -B 192.172.0.1</EPC_traffic_exec> + <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m -B 192.172.0.1</EPC_traffic_exec> <EPC_traffic_exec_args></EPC_traffic_exec_args> + <EPC_search_expr_true>throughput_test min=1.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec </EPC_search_expr_true> <EPC_search_expr_false></EPC_search_expr_false> <EPC_terminate_missing_procs>True</EPC_terminate_missing_procs> - <tags>EXMIMO.ALU_EPC.Bandrich.5MHz.FDD.Band_7.DL.1TX.1RX</tags> + <tags>USRPb210.RRH.ALU_EPC.Bandrich.10MHz.FDD.Band_7.UL.1TX.1RX</tags> <nruns>10</nruns> </testCase> - <testCase id="016104" > + <testCase id="017502" > <class>lte-softmodem</class> <desc></desc> <eNB>calisson</eNB> <UE>stevens</UE> <EPC>amerique</EPC> - <TimeOut_cmd>360</TimeOut_cmd> + <TimeOut_cmd>390</TimeOut_cmd> <eNB_working_dir>/tmp</eNB_working_dir> - <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf tracking_area_code \"1\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf mobile_country_code \"208\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf mobile_network_code \"92\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf N_RB_DL 50 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf downlink_frequency 2660000000L - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf uplink_frequency_offset -120000000 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf frame_type \"FDD\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf nb_antennas_rx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf nb_antennas_tx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth1\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_INTERFACE_NAME_FOR_S1U \"eth1\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_PORT_FOR_S1U 2152</eNB_config_file> + <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf N_RB_DL 100 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tx_gain 90 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf rx_gain 125 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_PORT_FOR_S1U 2152</eNB_config_file> <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog> - <eNB_compile_prog_args>--eNB -w EXMIMO -x -c </eNB_compile_prog_args> - <eNB_pre_exec>sudo -E -S $OPENAIR_DIR/cmake_targets/tools/init_exmimo2 ; dmesg|tail</eNB_pre_exec> + <eNB_compile_prog_args>--eNB -w USRP -x -c </eNB_compile_prog_args> + <eNB_pre_exec></eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf </eNB_main_exec_args> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf -W </eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> @@ -2668,32 +5728,26 @@ <eNB_terminate_missing_procs>True</eNB_terminate_missing_procs> <UE_working_dir>/tmp</UE_working_dir> - <UE_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf tracking_area_code \"4\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_country_code \"5\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_network_code \"6\"</UE_config_file> - <UE_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog> - <UE_compile_prog_args>--eNB -w USRP -x -c </UE_compile_prog_args> + <UE_config_file></UE_config_file> + <UE_compile_prog></UE_compile_prog> + <UE_compile_prog_args></UE_compile_prog_args> <UE_pre_exec></UE_pre_exec> <UE_pre_exec_args></UE_pre_exec_args> - <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 45; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> + <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> <UE_main_exec_args></UE_main_exec_args> - <UE_traffic_exec>while true; do var=`ifconfig ppp0` ;sleep 1; if [ "$var" != "" ]; then break; fi ; done ; sleep 5; iperf -s -i 1 -u -f m -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 10Mbits/s -B 192.172.0.2</UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> + <UE_search_expr_true></UE_search_expr_true> + <UE_search_expr_false></UE_search_expr_false> <UE_terminate_missing_procs>True</UE_terminate_missing_procs> <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue </UE_stop_script> - <UE_search_expr_true>throughput_test min=8.0Mbits/sec max=9.0Mbits/sec average=8.5Mbits/sec duration=300.0s </UE_search_expr_true> - <UE_search_expr_false></UE_search_expr_false> <EPC_working_dir>/tmp</EPC_working_dir> - <EPC_config_file>BUILD/EPC/epc.local.enb.conf.in MCC \"208\" - BUILD/EPC/epc.local.enb.conf.in MNC \"92\" - BUILD/EPC/epc.local.enb.conf.in TAC \"1\" - BUILD/EPC/epc.local.enb.conf.in PGW_INTERFACE_NAME_FOR_SGI \"eth1\" - BUILD/EPC/epc.local.enb.conf.in PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.82/24\" </EPC_config_file> - <EPC_compile_prog>SCRIPTS/build_epc</EPC_compile_prog> - <EPC_compile_prog_args>-c -l</EPC_compile_prog_args> - <HSS_compile_prog>SCRIPTS/build_hss</HSS_compile_prog> - <HSS_compile_prog_args> -c -l </HSS_compile_prog_args> + <EPC_config_file></EPC_config_file> + <EPC_compile_prog></EPC_compile_prog> + <EPC_compile_prog_args></EPC_compile_prog_args> + <HSS_compile_prog></HSS_compile_prog> + <HSS_compile_prog_args></HSS_compile_prog_args> <EPC_pre_exec></EPC_pre_exec> <EPC_pre_exec_args></EPC_pre_exec_args> @@ -2701,43 +5755,46 @@ <EPC_main_exec_args></EPC_main_exec_args> <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec> <HSS_main_exec_args></HSS_main_exec_args> - <EPC_traffic_exec>sleep 60; iperf -u -c 192.172.0.2 -b 10Mbits/s -t 300 -B 192.172.0.1</EPC_traffic_exec> + <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m -B 192.172.0.1</EPC_traffic_exec> <EPC_traffic_exec_args></EPC_traffic_exec_args> + <EPC_search_expr_true>throughput_test min=1.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec </EPC_search_expr_true> <EPC_search_expr_false></EPC_search_expr_false> <EPC_terminate_missing_procs>True</EPC_terminate_missing_procs> - <tags>EXMIMO.ALU_EPC.Bandrich.10MHz.FDD.Band_7.DL.1TX.1RX</tags> + <tags>USRPb210.RRH.ALU_EPC.Bandrich.20MHz.FDD.Band_7.UL.1TX.1RX</tags> <nruns>10</nruns> </testCase> - <testCase id="016105" > + <testCase id="017503" > <class>lte-softmodem</class> <desc></desc> <eNB>calisson</eNB> <UE>stevens</UE> <EPC>amerique</EPC> - <TimeOut_cmd>360</TimeOut_cmd> + <TimeOut_cmd>390</TimeOut_cmd> <eNB_working_dir>/tmp</eNB_working_dir> - <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf tracking_area_code \"1\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf mobile_country_code \"208\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf mobile_network_code \"92\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf N_RB_DL 100 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf downlink_frequency 2660000000L - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf uplink_frequency_offset -120000000 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf frame_type \"FDD\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf nb_antennas_rx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf nb_antennas_tx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth1\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_INTERFACE_NAME_FOR_S1U \"eth1\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf ENB_PORT_FOR_S1U 2152</eNB_config_file> + <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf N_RB_DL 25 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tx_gain 90 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf rx_gain 125 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_PORT_FOR_S1U 2152</eNB_config_file> <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog> - <eNB_compile_prog_args>--eNB -w EXMIMO -x -c </eNB_compile_prog_args> - <eNB_pre_exec>sudo -E -S $OPENAIR_DIR/cmake_targets/tools/init_exmimo2 ; dmesg|tail</eNB_pre_exec> + <eNB_compile_prog_args>--eNB -w USRP -x -c </eNB_compile_prog_args> + <eNB_pre_exec></eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf </eNB_main_exec_args> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf -W </eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> @@ -2745,32 +5802,26 @@ <eNB_terminate_missing_procs>True</eNB_terminate_missing_procs> <UE_working_dir>/tmp</UE_working_dir> - <UE_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf tracking_area_code \"4\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_country_code \"5\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_network_code \"6\"</UE_config_file> - <UE_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog> - <UE_compile_prog_args>--eNB -w USRP -x -c </UE_compile_prog_args> + <UE_config_file></UE_config_file> + <UE_compile_prog></UE_compile_prog> + <UE_compile_prog_args></UE_compile_prog_args> <UE_pre_exec></UE_pre_exec> <UE_pre_exec_args></UE_pre_exec_args> - <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 45; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> + <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> <UE_main_exec_args></UE_main_exec_args> - <UE_traffic_exec>while true; do var=`ifconfig ppp0` ;sleep 1; if [ "$var" != "" ]; then break; fi ; done ; sleep 5; iperf -s -i 1 -u -f m -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m -B 192.172.0.2</UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> <UE_terminate_missing_procs>True</UE_terminate_missing_procs> <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue </UE_stop_script> - <UE_search_expr_true>throughput_test min=15.0Mbits/sec max=15.0Mbits/sec average=15.0Mbits/sec duration=300.0s </UE_search_expr_true> + <UE_search_expr_true>throughput_test min=4.0Mbits/sec max=5.0Mbits/sec average=4.0Mbits/sec </UE_search_expr_true> <UE_search_expr_false></UE_search_expr_false> <EPC_working_dir>/tmp</EPC_working_dir> - <EPC_config_file>BUILD/EPC/epc.local.enb.conf.in MCC \"208\" - BUILD/EPC/epc.local.enb.conf.in MNC \"92\" - BUILD/EPC/epc.local.enb.conf.in TAC \"1\" - BUILD/EPC/epc.local.enb.conf.in PGW_INTERFACE_NAME_FOR_SGI \"eth1\" - BUILD/EPC/epc.local.enb.conf.in PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.82/24\" </EPC_config_file> - <EPC_compile_prog>SCRIPTS/build_epc</EPC_compile_prog> - <EPC_compile_prog_args>-c -l</EPC_compile_prog_args> - <HSS_compile_prog>SCRIPTS/build_hss</HSS_compile_prog> - <HSS_compile_prog_args> -c -l </HSS_compile_prog_args> + <EPC_config_file></EPC_config_file> + <EPC_compile_prog></EPC_compile_prog> + <EPC_compile_prog_args></EPC_compile_prog_args> + <HSS_compile_prog></HSS_compile_prog> + <HSS_compile_prog_args></HSS_compile_prog_args> <EPC_pre_exec></EPC_pre_exec> <EPC_pre_exec_args></EPC_pre_exec_args> @@ -2778,117 +5829,118 @@ <EPC_main_exec_args></EPC_main_exec_args> <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec> <HSS_main_exec_args></HSS_main_exec_args> - <EPC_traffic_exec>sleep 60; iperf -u -c 192.172.0.2 -b 10Mbits/s -t 300 -B 192.172.0.1</EPC_traffic_exec> + <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s -B 192.172.0.1</EPC_traffic_exec> <EPC_traffic_exec_args></EPC_traffic_exec_args> <EPC_search_expr_false></EPC_search_expr_false> <EPC_terminate_missing_procs>True</EPC_terminate_missing_procs> - <tags>EXMIMO.ALU_EPC.Bandrich.20MHz.FDD.Band_7.DL.1TX.1RX</tags> + <tags>USRPb210.RRH.ALU_EPC.Bandrich.5MHz.FDD.Band_7.DL.1TX.1RX</tags> <nruns>10</nruns> </testCase> - - - <testCase id="015600" > + <testCase id="017504" > <class>lte-softmodem</class> <desc></desc> <eNB>calisson</eNB> <UE>stevens</UE> - <EPC>nano</EPC> - <TimeOut_cmd>60</TimeOut_cmd> + <EPC>amerique</EPC> + <TimeOut_cmd>390</TimeOut_cmd> <eNB_working_dir>/tmp</eNB_working_dir> - <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf tracking_area_code \"1\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_country_code \"208\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_network_code \"92\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tracking_area_code \"1\" + <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tracking_area_code \"1\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_country_code \"208\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_network_code \"92\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf N_RB_DL 50 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mme_ip_address "ipv4=\"192.168.12.62\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"</eNB_config_file> + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tx_gain 90 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf rx_gain 125 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_PORT_FOR_S1U 2152</eNB_config_file> <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog> - <eNB_compile_prog_args>--eNB -w USRP -c</eNB_compile_prog_args> + <eNB_compile_prog_args>--eNB -w USRP -x -c </eNB_compile_prog_args> <eNB_pre_exec></eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf </eNB_main_exec_args> - <eNB_traffic_exec>iperf -s</eNB_traffic_exec> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf -W </eNB_main_exec_args> + <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> <eNB_search_expr_false></eNB_search_expr_false> <eNB_terminate_missing_procs>True</eNB_terminate_missing_procs> <UE_working_dir>/tmp</UE_working_dir> - <UE_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf tracking_area_code \"1\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_country_code \"208\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_network_code \"92\"</UE_config_file> - <UE_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog> - <UE_compile_prog_args>--eNB -w USRP -c</UE_compile_prog_args> + <UE_config_file></UE_config_file> + <UE_compile_prog_args></UE_compile_prog_args> <UE_pre_exec></UE_pre_exec> <UE_pre_exec_args></UE_pre_exec_args> - <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> + <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> <UE_main_exec_args></UE_main_exec_args> - <UE_traffic_exec>ping 192.172.0.1</UE_traffic_exec> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m -B 192.172.0.2</UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> - <UE_search_expr_true></UE_search_expr_true> + <UE_search_expr_true>throughput_test min=8.0Mbits/sec max=9.0Mbits/sec average=8.5Mbits/sec </UE_search_expr_true> <UE_search_expr_false></UE_search_expr_false> <UE_terminate_missing_procs>True</UE_terminate_missing_procs> + <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue </UE_stop_script> + <EPC_working_dir>/tmp</EPC_working_dir> - <EPC_config_file>BUILD/EPC/epc.local.enb.conf.in MCC \"208\" - BUILD/EPC/epc.local.enb.conf.in MNC \"92\" - BUILD/EPC/epc.local.enb.conf.in TAC \"1\" - BUILD/EPC/epc.local.enb.conf.in PGW_INTERFACE_NAME_FOR_SGI \"eth1\" - BUILD/EPC/epc.local.enb.conf.in PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.82/24\" - BUILD/EPC/epc.conf.in MCC \"208\" - BUILD/EPC/epc.conf.in MNC \"92\" - BUILD/EPC/epc.conf.in TAC \"1\" - BUILD/EPC/epc.conf.in PGW_INTERFACE_NAME_FOR_SGI \"eth1\" - BUILD/EPC/epc.conf.in PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.82/24\" - BUILD/EPC/epc.conf.in MME_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.62/24\" - BUILD/EPC/epc.conf.in SGW_IPV4_ADDRESS_FOR_S1U_S12_S4_UP \"192.168.12.62/24\" - BUILD/EPC/epc.conf.in PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.62/24\"</EPC_config_file> - <EPC_compile_prog>SCRIPTS/build_epc</EPC_compile_prog> - <EPC_compile_prog_args>-c -l</EPC_compile_prog_args> - <HSS_compile_prog>SCRIPTS/build_hss</HSS_compile_prog> - <HSS_compile_prog_args> -c </HSS_compile_prog_args> + <EPC_config_file></EPC_config_file> + <EPC_compile_prog></EPC_compile_prog> + <EPC_compile_prog_args></EPC_compile_prog_args> + <HSS_compile_prog></HSS_compile_prog> + <HSS_compile_prog_args></HSS_compile_prog_args> <EPC_pre_exec></EPC_pre_exec> <EPC_pre_exec_args></EPC_pre_exec_args> - <EPC_main_exec>/SCRIPTS/run_epc -g </EPC_main_exec> + <EPC_main_exec>/opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000</EPC_main_exec> <EPC_main_exec_args></EPC_main_exec_args> - <HSS_main_exec>/SCRIPTS/run_hss -g </HSS_main_exec> + <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec> <HSS_main_exec_args></HSS_main_exec_args> - <EPC_traffic_exec>iperf -s</EPC_traffic_exec> + <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s -B 192.172.0.1</EPC_traffic_exec> <EPC_traffic_exec_args></EPC_traffic_exec_args> - <EPC_search_expr_true></EPC_search_expr_true> <EPC_search_expr_false></EPC_search_expr_false> <EPC_terminate_missing_procs>True</EPC_terminate_missing_procs> + <tags>USRPb210.RRH.ALU_EPC.Bandrich.10MHz.FDD.Band_7.DL.1TX.1RX</tags> <nruns>10</nruns> - </testCase> - + </testCase> - <testCase id="015700" > + <testCase id="017505" > <class>lte-softmodem</class> <desc></desc> <eNB>calisson</eNB> <UE>stevens</UE> - <EPC>calisson</EPC> - <TimeOut_cmd>60</TimeOut_cmd> + <EPC>amerique</EPC> + <TimeOut_cmd>390</TimeOut_cmd> <eNB_working_dir>/tmp</eNB_working_dir> - <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf tracking_area_code \"1\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_country_code \"208\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_network_code \"92\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf N_RB_DL 50 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tracking_area_code \"1\" + <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tracking_area_code \"1\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_country_code \"208\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_network_code \"92\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf N_RB_DL 50 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mme_ip_address "ipv4=\"192.168.12.62\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"</eNB_config_file> + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf N_RB_DL 100 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tx_gain 90 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf rx_gain 125 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf ENB_PORT_FOR_S1U 2152</eNB_config_file> <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog> - <eNB_compile_prog_args>--eNB -w USRP -c</eNB_compile_prog_args> + <eNB_compile_prog_args>--eNB -w USRP -x -c </eNB_compile_prog_args> <eNB_pre_exec></eNB_pre_exec> <eNB_pre_exec_args></eNB_pre_exec_args> <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec> - <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf </eNB_main_exec_args> + <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf -W </eNB_main_exec_args> <eNB_traffic_exec></eNB_traffic_exec> <eNB_traffic_exec_args></eNB_traffic_exec_args> <eNB_search_expr_true></eNB_search_expr_true> @@ -2896,54 +5948,43 @@ <eNB_terminate_missing_procs>True</eNB_terminate_missing_procs> <UE_working_dir>/tmp</UE_working_dir> - <UE_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf tracking_area_code \"1\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_country_code \"208\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_network_code \"92\"</UE_config_file> - <UE_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog> - <UE_compile_prog_args>--eNB -w USRP -c</UE_compile_prog_args> + <UE_config_file></UE_config_file> + <UE_compile_prog></UE_compile_prog> + <UE_compile_prog_args></UE_compile_prog_args> <UE_pre_exec></UE_pre_exec> <UE_pre_exec_args></UE_pre_exec_args> - <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> + <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec> <UE_main_exec_args></UE_main_exec_args> - <UE_traffic_exec>ping 192.172.0.1</UE_traffic_exec> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m -B 192.172.0.2</UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> - <UE_search_expr_true></UE_search_expr_true> + <UE_search_expr_true>throughput_test min=15.0Mbits/sec max=15.0Mbits/sec average=15.0Mbits/sec </UE_search_expr_true> <UE_search_expr_false></UE_search_expr_false> <UE_terminate_missing_procs>True</UE_terminate_missing_procs> + <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue </UE_stop_script> + <EPC_working_dir>/tmp</EPC_working_dir> - <EPC_config_file>BUILD/EPC/epc.local.enb.conf.in MCC \"208\" - BUILD/EPC/epc.local.enb.conf.in MNC \"92\" - BUILD/EPC/epc.local.enb.conf.in TAC \"1\" - BUILD/EPC/epc.local.enb.conf.in PGW_INTERFACE_NAME_FOR_SGI \"eth1\" - BUILD/EPC/epc.local.enb.conf.in PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.82/24\" - BUILD/EPC/epc.conf.in MCC \"208\" - BUILD/EPC/epc.conf.in MNC \"92\" - BUILD/EPC/epc.conf.in TAC \"1\" - BUILD/EPC/epc.conf.in PGW_INTERFACE_NAME_FOR_SGI \"eth1\" - BUILD/EPC/epc.conf.in PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.62/24\" - BUILD/EPC/epc.conf.in MME_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.62/24\" - BUILD/EPC/epc.conf.in SGW_IPV4_ADDRESS_FOR_S1U_S12_S4_UP \"192.168.12.62/24\" - BUILD/EPC/epc.conf.in PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.62/24\"</EPC_config_file> - <EPC_compile_prog>SCRIPTS/build_epc</EPC_compile_prog> - <EPC_compile_prog_args>-c -l</EPC_compile_prog_args> - <HSS_compile_prog>SCRIPTS/build_hss</HSS_compile_prog> - <HSS_compile_prog_args> -c -l </HSS_compile_prog_args> + <EPC_config_file></EPC_config_file> + <EPC_compile_prog></EPC_compile_prog> + <EPC_compile_prog_args></EPC_compile_prog_args> + <HSS_compile_prog></HSS_compile_prog> + <HSS_compile_prog_args></HSS_compile_prog_args> <EPC_pre_exec></EPC_pre_exec> <EPC_pre_exec_args></EPC_pre_exec_args> - <EPC_main_exec>SCRIPTS/run_epc -l </EPC_main_exec> + <EPC_main_exec>/opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000</EPC_main_exec> <EPC_main_exec_args></EPC_main_exec_args> - <HSS_main_exec>SCRIPTS/run_hss </HSS_main_exec> + <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec> <HSS_main_exec_args></HSS_main_exec_args> - <EPC_traffic_exec>iperf -s</EPC_traffic_exec> + <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s -B 192.172.0.1</EPC_traffic_exec> <EPC_traffic_exec_args></EPC_traffic_exec_args> - <EPC_search_expr_true></EPC_search_expr_true> <EPC_search_expr_false></EPC_search_expr_false> <EPC_terminate_missing_procs>True</EPC_terminate_missing_procs> - + <tags>USRPb210.RRH.ALU_EPC.Bandrich.20MHz.FDD.Band_7.DL.1TX.1RX</tags> <nruns>10</nruns> - </testCase> + </testCase> + + </testCaseList> diff --git a/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py b/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py index ae25013f52cda113300db1223a663580fba1119c..99aed7c29f4f8b2b54b3749e26da3344b44d3d78 100755 --- a/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py +++ b/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py @@ -10,6 +10,7 @@ import threading import signal import traceback import os +import commands # configure the serial connections (the parameters differs on the device you are connecting to) #First we find an open port to work with @@ -20,6 +21,10 @@ if openair_dir == None: print "Error getting OPENAIR_DIR environment variable" sys.exit(1) +sys.path.append(os.path.expandvars('$OPENAIR_DIR/cmake_targets/autotests/tools/')) + +from lib_autotest import * + def find_open_port(): global serial_port, ser max_ports=100 @@ -34,8 +39,7 @@ def find_open_port(): ser = serial.Serial(port=serial_port) return -find_open_port() -print 'Using Serial port : ' + serial_port + #serial_port = '/dev/ttyUSB2' bandrich_ppd_config = os.environ.get('OPENAIR_DIR') + '/cmake_targets/autotests/tools/wdial.bandrich.conf' @@ -126,8 +130,9 @@ def start_ue () : break ip = IPRoute() idx = ip.link_lookup(ifname=iface)[0] - os.system ('route add 192.172.0.1 ppp0') - os.system ('ping -c 5 192.172.0.1') + os.system ('route add ' + gw + ' ppp0') + os.system('sleep 5') + os.system ('ping ' + gw) break except Exception, e: error = ' Interface ' + iface + 'does not exist...' @@ -144,11 +149,52 @@ def stop_ue(): send_command('AT+CGATT=0' , 'OK|ERROR' , timeout) send_command('AT+CFUN=4' , 'OK' , timeout) -for arg in sys.argv[1:]: + +#reset the USB BUS of Bandrich UE +def reset_ue(): + stringIdBandrich='BandRich, Inc. 4G LTE adapter' + status, out = commands.getstatusoutput('lsusb | grep -i \'' + stringIdBandrich + '\'') + if (out == '') : + print "Bandrich 4G LTE Adapter not found. Exiting now..." + sys.exit() + p=re.compile('Bus\s*(\w+)\s*Device\s*(\w+):\s*ID\s*(\w+):(\w+)') + res=p.findall(out) + BusId=res[0][0] + DeviceId=res[0][1] + VendorId=res[0][2] + ProductId=res[0][3] + usb_dir= find_usb_path(VendorId, ProductId) + print "Bandrich 4G LTE Adapter found in..." + usb_dir + cmd = "sudo sh -c \"echo 0 > " + usb_dir + "/authorized\"" + os.system(cmd + " ; sleep 15" ) + cmd = "sudo sh -c \"echo 1 > " + usb_dir + "/authorized\"" + os.system(cmd + " ; sleep 30" ) + +i=1 +gw='192.172.0.1' +while i < len(sys.argv): + arg=sys.argv[i] if arg == '--start-ue' : + find_open_port() + print 'Using Serial port : ' + serial_port start_ue() elif arg == '--stop-ue' : + find_open_port() + print 'Using Serial port : ' + serial_port stop_ue() + elif arg == '--reset-ue' : + reset_ue() + elif arg == '-gw' : + gw = sys.argv[i+1] + i=i+1 + elif arg == '-h' : + print "--reset-ue: Reset the UE on USB Bus. Similar to unplugging and plugging the UE" + print "--stop-ue: Stop the UE. Send DETACH command" + print "--start-ue: Start the UE. Send ATTACH command" + print "-gw: Specify the default gw as sometimes the gateway/route arguments are not set properly via wvdial" else : print " Script called with wrong arguments, arg = " + arg sys.exit() + i = i +1 + + diff --git a/cmake_targets/autotests/tools/configure_cots_huaweiE398_ue.py b/cmake_targets/autotests/tools/configure_cots_huaweiE398_ue.py new file mode 100755 index 0000000000000000000000000000000000000000..07d532c5d613fc45813657b137fa4eec04b5a197 --- /dev/null +++ b/cmake_targets/autotests/tools/configure_cots_huaweiE398_ue.py @@ -0,0 +1,200 @@ +#!/usr/bin/python + +import time +import serial +import os +from pyroute2 import IPRoute +import sys +import re +import threading +import signal +import traceback +import os +import commands + +# configure the serial connections (the parameters differs on the device you are connecting to) +#First we find an open port to work with +serial_port='' +ser=serial.Serial() +openair_dir = os.environ.get('OPENAIR_DIR') +if openair_dir == None: + print "Error getting OPENAIR_DIR environment variable" + sys.exit(1) + +sys.path.append(os.path.expandvars('$OPENAIR_DIR/cmake_targets/autotests/tools/')) + +from lib_autotest import * + +def find_open_port(): + global serial_port, ser + max_ports=100 + if os.path.exists(serial_port) == True: + return serial_port + for port in range(0,100): + serial_port = '/dev/ttyUSB'+str(port) + if os.path.exists(serial_port) == True: + print 'New Serial Port : ' + serial_port + break + + ser = serial.Serial(port=serial_port) + return + + + +#serial_port = '/dev/ttyUSB2' +bandrich_ppd_config = os.environ.get('OPENAIR_DIR') + '/cmake_targets/autotests/tools/wdial.bandrich.conf' + +exit_flag=0 + +def signal_handler(signal, frame): + print('You pressed Ctrl+C!') + print('Resetting the UE to detached state') + timeout=10 + exit_flag=1 + send_command('AT+CGATT=0' , 'OK' , timeout) + sys.exit(0) + +signal.signal(signal.SIGINT, signal_handler) + + + +#ser.open() +#ser.isOpen() + +class pppThread (threading.Thread): + def __init__(self, threadID, name, counter): + threading.Thread.__init__(self) + self.threadID = threadID + self.name = name + self.counter = counter + def run(self): + print "Starting " + self.name + #Here we keep running pppd thread in indefinite loop as this script terminates sometimes + #while 1: + while 1: + time.sleep(5) #Hard coded, do not reduce this number! + print "Starting wvdial now..." + print 'exit_flag = ' + str(exit_flag) + send_command('AT+CGATT=1','OK', 300) + os.system('wvdial -C ' + bandrich_ppd_config + '' ) + if exit_flag == 1: + print "Exit flag set to true. Exiting pppThread now" + print "Terminating wvdial now..." + +def send_command (cmd, response, timeout): + count=0 + sleep_duration = 1 + print 'In function: send_command: cmd = <' + cmd + '> response: <' + response + '> \n' + global serial_port, ser + while count <= timeout: + try: + #Sometimes the port does not exist coz of reset in modem. + #In that case, we need to search for this port again + if os.path.exists(serial_port) == False: + find_open_port() + ser.write (cmd + '\r\n') + out = '' + time.sleep(sleep_duration) + count = count + sleep_duration + while ser.inWaiting() > 0: + out += ser.read(1) + print 'out = <' + out + '> response = <' + response + '> \n' + if re.search(response, out): + break + except Exception, e: + error = ' cmd : ' + cmd + ' response : ' + response + error = error + ' In function: ' + sys._getframe().f_code.co_name + ': *** Caught exception: ' + str(e.__class__) + " : " + str( e) + error = error + traceback.format_exc() + print error + + +def start_ue () : + #print 'Enter your commands below.\r\nInsert "exit" to leave the application.' + timeout=60 #timeout in seconds + send_command('AT', 'OK' , timeout) + #send_command('AT+CFUN=1' , 'OK' , timeout) + #send_command('AT+CGATT=0' , 'OK' , timeout) + send_command('AT+CGATT=1','OK', 300) + #os.system('wvdial -C ' + bandrich_ppd_config + ' &' ) + + thread_ppp = pppThread(1, "ppp_thread", 1) + thread_ppp.start() + + iface='ppp0' + + while 1: + time.sleep ( 2) + #Now we check if ppp0 interface is up and running + try: + if exit_flag == 1: + break + ip = IPRoute() + idx = ip.link_lookup(ifname=iface)[0] + os.system ('route add ' + gw + ' ppp0') + os.system('sleep 5') + os.system ('ping ' + gw) + break + except Exception, e: + error = ' Interface ' + iface + 'does not exist...' + error = error + ' In function: ' + sys._getframe().f_code.co_name + ': *** Caught exception: ' + str(e.__class__) + " : " + str( e) + error = error + traceback.format_exc() + print error + + thread_ppp.join() + +def stop_ue(): + timeout=60 + os.system('killall wvdial') + send_command('AT', 'OK' , timeout) + send_command('AT+CGATT=0' , 'OK|ERROR' , timeout) + #send_command('AT+CFUN=4' , 'OK' , timeout) + + +#reset the USB BUS of Bandrich UE +def reset_ue(): + stringIdBandrich='Huawei Technologies Co., Ltd. E398 LTE/UMTS/GSM Modem/Networkcard' + status, out = commands.getstatusoutput('lsusb | grep -i \'' + stringIdBandrich + '\'') + if (out == '') : + print "Bandrich 4G LTE Adapter not found. Exiting now..." + sys.exit() + p=re.compile('Bus\s*(\w+)\s*Device\s*(\w+):\s*ID\s*(\w+):(\w+)') + res=p.findall(out) + BusId=res[0][0] + DeviceId=res[0][1] + VendorId=res[0][2] + ProductId=res[0][3] + usb_dir= find_usb_path(VendorId, ProductId) + print "Bandrich 4G LTE Adapter found in..." + usb_dir + cmd = "sudo sh -c \"echo 0 > " + usb_dir + "/authorized\"" + os.system(cmd + " ; sleep 15" ) + cmd = "sudo sh -c \"echo 1 > " + usb_dir + "/authorized\"" + os.system(cmd + " ; sleep 30" ) + +i=1 +gw='192.172.0.1' +while i < len(sys.argv): + arg=sys.argv[i] + if arg == '--start-ue' : + find_open_port() + print 'Using Serial port : ' + serial_port + start_ue() + elif arg == '--stop-ue' : + find_open_port() + print 'Using Serial port : ' + serial_port + stop_ue() + elif arg == '--reset-ue' : + reset_ue() + elif arg == '-gw' : + gw = sys.argv[i+1] + i=i+1 + elif arg == '-h' : + print "--reset-ue: Reset the UE on USB Bus. Similar to unplugging and plugging the UE" + print "--stop-ue: Stop the UE. Send DETACH command" + print "--start-ue: Start the UE. Send ATTACH command" + print "-gw: Specify the default gw as sometimes the gateway/route arguments are not set properly via wvdial" + else : + print " Script called with wrong arguments, arg = " + arg + sys.exit() + i = i +1 + + diff --git a/cmake_targets/autotests/tools/exmimo/init_exmimo2 b/cmake_targets/autotests/tools/exmimo/init_exmimo2 deleted file mode 100755 index 66eedf93dd4d407deaabee6a61091c8f04fd0a61..0000000000000000000000000000000000000000 --- a/cmake_targets/autotests/tools/exmimo/init_exmimo2 +++ /dev/null @@ -1,85 +0,0 @@ -#!/bin/bash - -################################################################################ -# OpenAirInterface -# Copyright(c) 1999 - 2015 Eurecom -# -# OpenAirInterface is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# -# OpenAirInterface is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with OpenAirInterface.The full GNU General Public License is -# included in this distribution in the file called "COPYING". If not, -# see <http://www.gnu.org/licenses/>. -# -# Contact Information -# OpenAirInterface Admin: openair_admin@eurecom.fr -# OpenAirInterface Tech : openair_tech@eurecom.fr -# OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr -# -# Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE -# -################################################################################ -# file init_nas_nos1 -# brief loads the nasmesh module and sets up the radio bearers (used to provide ip interface without S1 interface) -# author Florian Kaltenberger -# -####################################### - -load_module() -{ - mod_name=${1##*/} - mod_name=${mod_name%.*} - if awk "/$mod_name/ {found=1 ;exit} END {if (found!=1) exit 1}" /proc/modules - then - echo "module $mod_name already loaded: I remove it first" - sudo rmmod $mod_name - fi - echo loading $mod_name - sudo insmod $1 -} - - -function main() -{ -PCI=`lspci -m | grep Xilinx` -if [ -z "$PCI" ]; then - echo "No card found. Stopping!" - return -fi - -## This part corrects the wrong configuration of the endpoint done by the bios in some machines -echo "$PCI" | while read config_reg; do -SLOT_NUMBER=`echo $config_reg | awk -F\" '{print $1}'` -sudo setpci -s $SLOT_NUMBER 60.b=10 -done - - -load_module $OPENAIR_DIR/targets/bin/openair_rf.ko -sleep 1 - -if [ ! -e /dev/openair0 ]; then - sudo mknod /dev/openair0 c 127 0 - sudo chmod a+rw /dev/openair0 -fi - -DEVICE=`echo $PCI | awk -F\" '{print $(NF-1)}' | awk '{print $2}'` -DEVICE_SWID=${DEVICE:2:2} -if [ $DEVICE_SWID == '0a' ]; then - echo "Using firware version 10" - $OPENAIR_DIR/targets/bin/updatefw -s 0x43fffff0 -b -f $OPENAIR_TARGETS/ARCH/EXMIMO/USERSPACE/OAI_FW_INIT/sdr_expressmimo2_v10 -else - echo 'No corresponding firmware found' - return -fi -} - -main "$@" diff --git a/cmake_targets/autotests/tools/exmimo/oarf_config_exmimo.oct b/cmake_targets/autotests/tools/exmimo/oarf_config_exmimo.oct deleted file mode 100755 index f8c24153f648cb6f0211defd9f958dab8dae92b2..0000000000000000000000000000000000000000 Binary files a/cmake_targets/autotests/tools/exmimo/oarf_config_exmimo.oct and /dev/null differ diff --git a/cmake_targets/autotests/tools/exmimo/oarf_get_frame.oct b/cmake_targets/autotests/tools/exmimo/oarf_get_frame.oct deleted file mode 100755 index 8dd108b798d3958df6e296fe1e7101744e041f2e..0000000000000000000000000000000000000000 Binary files a/cmake_targets/autotests/tools/exmimo/oarf_get_frame.oct and /dev/null differ diff --git a/cmake_targets/autotests/tools/exmimo/oarf_get_num_detected_cards.oct b/cmake_targets/autotests/tools/exmimo/oarf_get_num_detected_cards.oct deleted file mode 100755 index 3d84d86ebad99e6997ec6f86e4f09e8cf83be245..0000000000000000000000000000000000000000 Binary files a/cmake_targets/autotests/tools/exmimo/oarf_get_num_detected_cards.oct and /dev/null differ diff --git a/cmake_targets/autotests/tools/exmimo/oarf_send_frame.oct b/cmake_targets/autotests/tools/exmimo/oarf_send_frame.oct deleted file mode 100755 index 4da12f517237f8125b673ffa8c8d56c36a85f6a5..0000000000000000000000000000000000000000 Binary files a/cmake_targets/autotests/tools/exmimo/oarf_send_frame.oct and /dev/null differ diff --git a/cmake_targets/autotests/tools/exmimo/oarf_stop.oct b/cmake_targets/autotests/tools/exmimo/oarf_stop.oct deleted file mode 100755 index b234829cc085c05b638981d5e03919ebc4300859..0000000000000000000000000000000000000000 Binary files a/cmake_targets/autotests/tools/exmimo/oarf_stop.oct and /dev/null differ diff --git a/cmake_targets/autotests/tools/exmimo/oarf_stop_without_reset.oct b/cmake_targets/autotests/tools/exmimo/oarf_stop_without_reset.oct deleted file mode 100755 index 74ca17e3e0d1ed96a16c879a057623cfb20a5f47..0000000000000000000000000000000000000000 Binary files a/cmake_targets/autotests/tools/exmimo/oarf_stop_without_reset.oct and /dev/null differ diff --git a/cmake_targets/autotests/tools/exmimo/openair_rf.ko b/cmake_targets/autotests/tools/exmimo/openair_rf.ko deleted file mode 100644 index 2f948c087147032d9bd0b4259cdeaa337a853d3c..0000000000000000000000000000000000000000 Binary files a/cmake_targets/autotests/tools/exmimo/openair_rf.ko and /dev/null differ diff --git a/cmake_targets/autotests/tools/exmimo/updatefw b/cmake_targets/autotests/tools/exmimo/updatefw deleted file mode 100755 index d404a74cbbe032cb3efda14a80ab613c6c92f07b..0000000000000000000000000000000000000000 Binary files a/cmake_targets/autotests/tools/exmimo/updatefw and /dev/null differ diff --git a/cmake_targets/autotests/tools/find_usb_path.bash b/cmake_targets/autotests/tools/find_usb_path.bash new file mode 100755 index 0000000000000000000000000000000000000000..c8ec950292361aa59c282531dad39aa183bd2e9c --- /dev/null +++ b/cmake_targets/autotests/tools/find_usb_path.bash @@ -0,0 +1,20 @@ +#!/bin/bash + +#arg1 idVendor +#arg2 idProduct +argIdVendor=$1 +argIdProduct=$2 + +echo $1 +echo $2 + +for X in /sys/bus/usb/devices/*; do + #echo "$X" + idVendor=`cat "$X/idVendor" 2>/dev/null` + idProduct=`cat "$X/idProduct" 2>/dev/null` + if [ "$argIdVendor" == "$idVendor" ] && [ "$argIdProduct" == "$idProduct" ] + then + echo "$X" + fi +done + diff --git a/cmake_targets/autotests/tools/iperf_script b/cmake_targets/autotests/tools/iperf_script new file mode 100755 index 0000000000000000000000000000000000000000..ecd2f7a996911586e6986aca96e73848065ea591 --- /dev/null +++ b/cmake_targets/autotests/tools/iperf_script @@ -0,0 +1,22 @@ +#!/bin/bash + +#arg1 timeout to wait before running the script +#arg2 interface +#arg3 iperf arguments + +args=($*) +timeout=${args[0]} +iface=${args[1]} +iperf_args=(${args[@]:2}) + +#array=${1:-1} +echo "args = ${args[@]}" +echo "timeout = $timeout" +echo "iface = $iface" +echo "iperf_args = ${iperf_args[@]}" + +sleep $timeout + +while true; do var=`ifconfig $iface` ;sleep 1; if [ "$var" != "" ]; then break; fi ; done ; sleep 5 + +iperf ${iperf_args[@]} diff --git a/cmake_targets/autotests/tools/lib_autotest.py b/cmake_targets/autotests/tools/lib_autotest.py new file mode 100644 index 0000000000000000000000000000000000000000..67234de567e76d93b6c9c47cccdc3ca4d4444b29 --- /dev/null +++ b/cmake_targets/autotests/tools/lib_autotest.py @@ -0,0 +1,33 @@ +#!/usr/bin/python + +import os +from pyroute2 import IPRoute +import sys +import re +import threading +import signal +import traceback +import commands + +def read_file(filename): + try: + file = open(filename, 'r') + return file.read() + except Exception, e: + # WE just ignore the exception as some files are probably not present + #error = ' Filename ' + filename + #error = error + ' In function: ' + sys._getframe().f_code.co_name + ': *** Caught exception: ' + str(e.__class__) + " : " + str( e) + #error = error + traceback.format_exc() + #print error + return '' + +def find_usb_path(idVendor, idProduct): + for root, dirs, files in os.walk("/sys/bus/usb/devices", topdown=False): + for name in dirs: + tmpdir= os.path.join(root, name) + tmpidVendor = read_file(tmpdir+'/idVendor').replace("\n","") + tmpidProduct = read_file(tmpdir+'/idProduct').replace("\n","") + if tmpidVendor == idVendor and tmpidProduct == idProduct: + return tmpdir + return '' + diff --git a/cmake_targets/autotests/tools/search_repl.py b/cmake_targets/autotests/tools/search_repl.py index 0a91945c771770992f926386d258b8f456921830..be0568599ff16f89795805944fbc2e88247aa385 100755 --- a/cmake_targets/autotests/tools/search_repl.py +++ b/cmake_targets/autotests/tools/search_repl.py @@ -1,27 +1,34 @@ #!/usr/bin/python import sys import re +import os #Arg 1 name of file #Arg 2 keyword #arg 3 replacement text #Note that these should be seperated by spaces if len(sys.argv) != 4: - print "search_repl.py: Wrong number of arguments. This program needs 3 arguments" + print "search_repl.py: Wrong number of arguments. This program needs 3 arguments. The number of arguments supplied : " + str(sys.argv) sys.exit() -filename = sys.argv[1] +filename = os.path.expandvars(sys.argv[1]) keyword = sys.argv[2] replacement_text = sys.argv[3] + file = open(filename, 'r') string = file.read() file.close() if keyword == 'mme_ip_address': - #string = (re.sub(r"mme_ip_address\s*=\s*\([^\$]+)\)\s*;\s*", r"<% tex \1 %>", t, re.M) replacement_text = keyword + ' = ( { ' + replacement_text + ' } ) ; ' string = re.sub(r"mme_ip_address\s*=\s*\(([^\$]+?)\)\s*;", replacement_text, string, re.M) +elif keyword == 'IPV4_LIST': + replacement_text = keyword + ' = ( ' + replacement_text + ' ) ; ' + string = re.sub(r"IPV4_LIST\s*=\s*\(([^\$]+?)\)\s*;", replacement_text, string, re.M) +elif keyword == 'rrh_gw_config': + replacement_text = keyword + ' = ( { ' + replacement_text + ' } ) ; ' + string = re.sub(r"rrh_gw_config\s*=\s*\(([^\$]+?)\)\s*;", replacement_text, string, re.M) else : replacement_text = keyword + ' = ' + replacement_text + ' ; ' string = re.sub(r"%s\s*=\s*([^\$]+?)\s*;" % keyword , replacement_text, string, re.M) diff --git a/cmake_targets/build_oai b/cmake_targets/build_oai index 25bec96b98cd28571ef6b9f65457cb256bffb3e8..6300e9ec03760071fbee9ba3c33975d74a3c9417 100755 --- a/cmake_targets/build_oai +++ b/cmake_targets/build_oai @@ -45,15 +45,18 @@ MSC_GEN="False" XFORMS="False" PRINT_STATS="False" VCD_TIMING="False" +LOWLATENCY_FLAG_USER="False" +FORCE_LOWLATENCY_FLAG_USER="" REL="Rel10" HW="EXMIMO" +TP="None" NOS1=0 EPC=0 VERBOSE_COMPILE=0 CFLAGS_PROCESSOR_USER="" RUN_GROUP=0 TEST_CASE_GROUP="" - +BUILD_DOXYGEN=0 trap handle_ctrl_c INT function print_help() { @@ -88,10 +91,13 @@ Options default is Rel10, Rel8 limits the implementation to 3GPP Release 8 version -w | --hardware - EXMIMO (Default), USRP, BLADERF, ETHERNET, None + EXMIMO (Default), USRP, BLADERF, LMSSDR, None Adds this RF board support (in external packages installation and in compilation) +-t | --transport protocol + ETHERNET , None + Adds this trasport protocol support in compilation --oaisim - Makes the oaisim simulator. Hardware will be defaulted to "NONE". + Makes the oaisim simulator. Hardware will be defaulted to "None". --phy_simulators Makes the unitary tests Layer 1 simulators --core_simulators @@ -113,7 +119,12 @@ Options Shows detailed compilation instructions in makefile --cflags_processor Manually Add CFLAGS of processor if they are not detected correctly by script. Only add these flags if you know your processor supports them. Example flags: -msse3 -msse4.1 -msse4.2 -mavx2 - +--build-doxygen + Builds doxygen based documentation. +--disable-deadline + Disables deadline scheduler of Linux kernel (>=3.14.x). +--enable-deadline + Disables deadline scheduler of Linux kernel (>=3.14.x). Usage (first build): oaisim (eNB + UE): ./build_oai -I -g --oaisim -x --install-system-files Eurecom EXMIMO + COTS UE : ./build_oai -I -g --eNB -x --install-system-files @@ -165,20 +176,35 @@ function main() { shift;; -r | --3gpp-release) REL=$2 - echo_info "setting release to: $REL" + echo_info "Setting release to: $REL" shift 2;; -w | --hardware) HW="$2" #"${i#*=}" - # Use OAI_USRP as the key word USRP is used inside UHD driver - if [ "$HW" == "USRP" ] ; then - HW="OAI_USRP" - fi - if [ "$HW" == "BLADERF" ] ; then - HW="OAI_BLADERF" - fi - echo_info "setting hardware to: $HW" + # Use OAI_USRP as the key word USRP is used inside UHD driver + if [ "$HW" != "BLADERF" -a "$HW" != "USRP" -a "$HW" != "LMSSDR" -a "$HW" != "None" -a "$HW" != "EXMIMO" ] ; then + echo_fatal "Unknown HW type $HW will exit..." + else + if [ "$HW" == "USRP" ] ; then + HW="OAI_USRP" + fi + if [ "$HW" == "BLADERF" ] ; then + HW="OAI_BLADERF" + fi + if [ "$HW" == "LMSSDR" ] ; then + HW="OAI_LMSSDR" + fi + echo_info "Setting hardware to: $HW" + fi + shift 2;; + -t | --transport_protocol) + TP="$2" #"${i#*=}" + if [ "$TP" != "ETHERNET" -a "$TP" != "None" ] ; then + echo_fatal "Unknown TP type $TP will exit..." + else + echo_info "Setting transport protocol to: $TP" + fi shift 2;; - --oaisim) + --oaisim) oaisim=1 echo_info "Will compile oaisim and drivers nasmesh, ..." shift;; @@ -200,7 +226,7 @@ function main() { echo_info "executing test cases only in group: $TEST_CASE_GROUP" shift 2;; -V | --vcd) - echo_info "setting gtk-wave output" + echo_info "Setting gtk-wave output" VCD_TIMING=1 EXE_ARGUMENTS="$EXE_ARGUMENTS -V" shift;; @@ -223,8 +249,20 @@ function main() { shift;; --cflags_processor) CFLAGS_PROCESSOR_USER=$2 - echo_info "setting CPU FLAGS from USER to: $CFLAGS_PROCESSOR_USER" + echo_info "Setting CPU FLAGS from USER to: $CFLAGS_PROCESSOR_USER" shift 2;; + --build-doxygen) + BUILD_DOXYGEN=1 + echo_info "Will build doxygen support" + shift;; + --disable-deadline) + FORCE_LOWLATENCY_FLAG_USER="False" + echo_info "Disabling the usage of deadline scheduler" + shift 1;; + --enable-deadline) + FORCE_LOWLATENCY_FLAG_USER="True" + echo_info "Enabling the usage of deadline scheduler" + shift 1;; -h | --help) print_help exit 1;; @@ -234,6 +272,64 @@ function main() { break;; esac done + + ######################################################### + # check validity of HW and TP parameters for RRH and eNB + ######################################################### + # to be discussed + + if [ "$eNB" = "1" ] ; then + if [ "$HW" = "None" -a "$TP" = "None" ] ; then + echo_fatal "Define a local radio head (e.g. -w EXMIMO) or a transport protocol (e.g. -t ETHERNET) to communicate with a remote radio head!" + fi + if [ "$HW" != "None" -a "$TP" != "None" ] ; then + echo_fatal "Currently eNB can not support simultaniously local and remote radio heads!!" + fi + if [ "$HW" = "None" ] ; then + echo_info "No radio head has been selected (HW set to $HW)" + fi + if [ "$TP" = "None" ] ; then + echo_info "No transport protocol has been selected (TP set to $TP)" + fi + fi + + if [ "$RRH" = "1" ] ; then + if [ "$TP" = "None" ] ; then + echo_fatal "A transport protocol (e.g. -t ETHERNET) must be defined!" + fi + if [ "$HW" = "None" ] ; then + echo_info "No radio head has been selected (HW set to $HW)" + fi + fi + + echo_info "RF HW set to $HW" + #Now we set flags to enable deadline scheduler settings + #By default: USRP: disable, + #By default: BLADERF: enable, + #By default: EXMIMO: enable + if [ "$FORCE_LOWLATENCY_FLAG_USER" = "" ]; then + if [ "$HW" = "EXMIMO" ] ; then + LOWLATENCY_FLAG_USER="True" + elif [ "$HW" = "ETHERNET" ] ; then + LOWLATENCY_FLAG_USER="True" + elif [ "$HW" = "OAI_USRP" ] ; then + LOWLATENCY_FLAG_USER="False" + elif [ "$HW" = "OAI_BLADERF" ] ; then + LOWLATENCY_FLAG_USER="False" + elif [ "$HW" = "OAI_LMSSDR" ] ; then + LOWLATENCY_FLAG_USER="False" + elif [ "$HW" = "None" ] ; then + LOWLATENCY_FLAG_USER="False" + else + echo_error "Unknown HW type $HW. Exiting now..." + exit + fi + else + LOWLATENCY_FLAG_USER=$FORCE_LOWLATENCY_FLAG_USER + fi + + echo_info "Flags for Deadline scheduler: $LOWLATENCY_FLAG_USER" + ############################################ # setting and printing OAI envs, we should check here @@ -273,7 +369,7 @@ function main() { check_install_usrp_uhd_driver fi if [ "$HW" == "OAI_BLADERF" ] ; then - echo_info "installing packages for BALDERF support" + echo_info "installing packages for BLADERF support" check_install_bladerf_driver fi fi @@ -284,9 +380,11 @@ function main() { fi if [ "$oaisim" = "1" ] ; then - if [ "$HW" != "ETHERNET" ] ; then - HW="NONE" - fi + #to be discussed + # there is no RF device and no transport protocol + HW="None" + TP="None" + if [ "$XFORMS" == "True" ] ; then PRINT_STATS="True" fi @@ -320,7 +418,9 @@ function main() { echo "set ( RRC_ASN1_VERSION \"${REL}\")" >> $cmake_file echo "set ( ENABLE_VCD_FIFO $VCD_TIMING )" >> $cmake_file echo "set ( RF_BOARD \"${HW}\")" >> $cmake_file - echo "set(PACKAGE_NAME \"${lte_exec}\")" >> $cmake_file + echo "set ( TRANSP_PRO \"${TP}\")" >> $cmake_file + echo "set(PACKAGE_NAME \"${lte_exec}\")" >> $cmake_file + echo "set (LOWLATENCY \"${LOWLATENCY_FLAG_USER}\" )" >>$cmake_file echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)' >> $cmake_file cd $DIR/$lte_build_dir/build cmake .. @@ -525,32 +625,124 @@ function main() { fi # RRH compilation - ################## + ##################### if [ "$RRH" = "1" ] ; then - echo_info "Compiling RRH" - if [ $HW == "ETHERNET" ] ; then - echo_info "RF frontend for RRH is not defined. This mode is used for testing (loopback)." - elif [ $HW != "EXMIMO" -a $HW != "OAI_USRP" -a $HW != "OAI_BLADERF" ] ; then - echo_fatal "Hardware not defined ($HW)" - fi - cmake_file=$DIR/rrh_gw/CMakeLists.txt - echo "cmake_minimum_required(VERSION 2.8)" > $cmake_file - echo "set(ENABLE_VCD_FIFO $VCD_TIMING )" >> $cmake_file - echo "set(ENABLE_ITTI False )" >> $cmake_file - echo "set(RF_BOARD \"${HW}\")" >> $cmake_file - echo 'set(PACKAGE_NAME "\"rrh_gw\"")' >> $cmake_file - echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)' >> $cmake_file - [ "$CLEAN" = "1" ] && rm -rf $DIR/rrh_gw/build - mkdir -p $DIR/rrh_gw/build - cd $DIR/rrh_gw/build + rrh_exec=rrh_gw + rrh_build_dir=rrh_gw + + echo_info "Compiling $rrh_exec ..." + + [ "$CLEAN" = "1" ] && rm -rf $DIR/rrh_gw/build + mkdir -p $DIR/$rrh_build_dir/build + cmake_file=$DIR/$rrh_build_dir/CMakeLists.txt + echo "cmake_minimum_required(VERSION 2.8)" > $cmake_file + echo "set(ENABLE_VCD_FIFO $VCD_TIMING )" >> $cmake_file + echo "set(ENABLE_ITTI False )" >> $cmake_file + echo "set(RF_BOARD \"${HW}\")" >> $cmake_file + echo "set(TRANSP_PRO \"${TP}\")" >> $cmake_file + echo 'set(PACKAGE_NAME "\"rrh_gw\"")' >> $cmake_file + echo "set (LOWLATENCY \"${LOWLATENCY_FLAG_USER}\" )" >>$cmake_file + echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)' >> $cmake_file + cd $DIR/$rrh_build_dir/build + cmake .. + compilations \ + rrh_gw rrh_gw \ + rrh_gw $dbin/rrh_gw + + fi + + # build RF device and transport protocol libraries + ##################################### + if [ "$eNB" = "1" -o "$RRH" = "1" ] ; then + + if [ "$eNB" = "1" ] ; then + build_dir=$lte_build_dir + else + build_dir=$rrh_build_dir + fi + + # build RF device libraries (currently EXMIMO is not complied with the rest of HW targets) + if [ "$HW" != "None" ] ; then + rm -f liboai_device.so + rm -f $dbin/liboai_device.so + + + # link liboai_device.so with the selected RF device library + if [ "$HW" == "EXMIMO" ] ; then + + #add exmimo compilation + #TODO EXMIMO library support + + echo_info "liboai_device.so is linked to EXMIMO device library" + elif [ "$HW" == "OAI_USRP" ] ; then + if [ -d "/usr/include/uhd" ] ; then + compilations \ + $build_dir oai_usrpdevif \ + liboai_usrpdevif.so $dbin/liboai_usrpdevif.so.$REL + fi + + ln -s liboai_usrpdevif.so liboai_device.so + ln -s $dbin/liboai_usrpdevif.so.$REL $dbin/liboai_device.so + echo_info "liboai_device.so is linked to USRP device library" + elif [ "$HW" == "OAI_BLADERF" ] ; then + if [ -f "/usr/include/libbladeRF.h" ] ; then + compilations \ + $build_dir oai_bladerfdevif \ + liboai_bladerfdevif.so $dbin/liboai_bladerfdevif.so.$REL + fi + + ln -s liboai_bladerfdevif.so liboai_device.so + ln -s $dbin/liboai_bladerfdevif.so.$REL $dbin/liboai_device.so + echo_info "liboai_device.so is linked to BLADERF device library" + elif [ "$HW" == "OAI_LMSSDR" ] ; then +# if [ -f "/usr/include/libbladeRF.h" ] ; then + compilations \ + $build_dir oai_lmssdrdevif \ + liboai_lmssdrdevif.so $dbin/liboai_lmssdrdevif.so.$REL +# fi + + ln -s liboai_lmssdrdevif.so liboai_device.so + ln -s $dbin/liboai_lmssdrdevif.so.$REL $dbin/liboai_device.so + echo_info "liboai_device.so is linked to LMSSDR device library" + else + echo_info "liboai_device.so is not linked to any device library" + fi + fi + + # build trasport protocol libraries (currently only ETHERNET is available) + if [ "$TP" != "None" ] ; then + rm -f liboai_transpro.so + rm -f $dbin/liboai_transpro.so + + if [ "$TP" == "ETHERNET" ] ; then + compilations \ + $build_dir oai_eth_transpro \ + liboai_eth_transpro.so $dbin/liboai_eth_transpro.so.$REL + ln -s liboai_eth_transpro.so liboai_transpro.so + ln -s $dbin/liboai_eth_transpro.so.$REL $dbin/liboai_transpro.so + echo_info "liboai_transpro.so is linked with ETHERNET library" + fi + fi +fi + + + # Doxygen Support + ##################### + if [ "$BUILD_DOXYGEN" = "1" ] ;then + doxygen_log=$OPENAIR_DIR/cmake_targets/log/doxygen.log + echo_info "Building doxygen based documentation. The documentation file is located here: $OPENAIR_DIR/targets/DOCS/html/index.html" + echo_info "Doxygen Generation log is located here: $doxygen_log" + echo_info "Generating doxygen files....please wait" + ( + [ "$CLEAN" = "1" ] && rm -rf $OPENAIR_DIR/cmake_targets/doxygen/build + mkdir -p $OPENAIR_DIR/cmake_targets/doxygen/build + cd $OPENAIR_DIR/cmake_targets/doxygen/build cmake .. - compilations \ - rrh_gw rrh_gw \ - rrh_gw $dbin/rrh_gw + make doc + ) >& $doxygen_log fi - # Auto-tests ##################### if [ "$OAI_TEST" = "1" ]; then diff --git a/cmake_targets/rrh_gw/CMakeLists.txt b/cmake_targets/rrh_gw/CMakeLists.txt deleted file mode 100644 index 9ff1437f0c58db559a3a9386489a18cc1e2a596e..0000000000000000000000000000000000000000 --- a/cmake_targets/rrh_gw/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ -cmake_minimum_required(VERSION 2.8) -set(ENABLE_VCD_FIFO False ) -set(ENABLE_ITTI False ) -set(RF_BOARD "ETHERNET") -set(PACKAGE_NAME "\"rrh_gw\"") -include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt) diff --git a/cmake_targets/tools/build_helper b/cmake_targets/tools/build_helper index 5585a43d35292e1f90cfbb9911f0061d0a98ab08..810b7349d20434e9c6907ea7804c1adc9fb84c62 100755 --- a/cmake_targets/tools/build_helper +++ b/cmake_targets/tools/build_helper @@ -163,33 +163,27 @@ install_gnutls_from_source(){ check_install_usrp_uhd_driver(){ - log_file=$OPENAIR_DIR/cmake_targets/log/check_install_usrp_uhd_driver_log.txt - echo_info "\nIn function: check_install_usrp_uhd_driver(). Installing USRP Drivers : The logfile for the installation is located here: $log_file " - ( + #first we remove old installation + $SUDO apt-get remove uhd libuhd-dev libuhd003 uhd-host -y v=$(lsb_release -cs) - $SUDO apt-add-repository "deb http://files.ettus.com/binaries/uhd/repo/uhd/ubuntu/$v $v main" + $SUDO apt-add-repository --remove "deb http://files.ettus.com/binaries/uhd/repo/uhd/ubuntu/$v $v main" + #The new USRP repository + $SUDO add-apt-repository ppa:ettusresearch/uhd -y $SUDO apt-get update $SUDO apt-get -y install python python-tk libboost-all-dev libusb-1.0-0-dev - $SUDO apt-get -y install -t `lsb_release -cs` uhd --force-yes - ) >& $log_file + $SUDO apt-get -y install libuhd-dev libuhd003 uhd-host + $SUDO uhd_images_downloader } check_install_bladerf_driver(){ - log_file=$OPENAIR_DIR/cmake_targets/log/check_install_bladerf_driver_log.txt - echo_info "\nIn function: check_install_bladerf_driver(). Install BLADERF drivers : The logfile for the installation is located here: $log_file " - ( $SUDO add-apt-repository -y ppa:bladerf/bladerf $SUDO apt-get update $SUDO apt-get install -y bladerf libbladerf-dev $SUDO apt-get install -y bladerf-firmware-fx3 $SUDO apt-get install -y bladerf-fpga-hostedx40 - bladeRF-cli --flash-firmware /usr/share/Nuand/bladeRF/bladeRF_fw.img - ) >& $log_file + $SUDO bladeRF-cli --flash-firmware /usr/share/Nuand/bladeRF/bladeRF_fw.img } check_install_additional_tools (){ - log_file=$OPENAIR_DIR/cmake_targets/log/check_install_additional_tools_log.txt - echo_info "\nIn function: check_install_oai_software(). Installing optional OAI packages : The logfile for the installation is located here: $log_file " - ( $SUDO apt-get update $SUDO apt-get install -y \ check \ @@ -199,7 +193,6 @@ check_install_additional_tools (){ libboost-all-dev \ libpthread-stubs0-dev \ openvpn \ - phpmyadmin \ pkg-config \ python-dev \ python-pexpect \ @@ -212,14 +205,9 @@ check_install_additional_tools (){ vlan \ ctags \ ntpdate - ) >& $log_file } check_install_oai_software() { - - log_file=$OPENAIR_DIR/cmake_targets/log/check_install_oai_software_log.txt - echo_info "\nIn function: check_install_oai_software(). Installing mandatory OAI packages : The logfile for the installation is located here: $log_file " - ( $SUDO apt-get update $SUDO apt-get install -y \ autoconf \ @@ -280,7 +268,10 @@ check_install_oai_software() { python-pip \ pydb \ wvdial \ - python-numpy + python-numpy \ + sshpass \ + libxslt1-dev + $SUDO update-alternatives --set liblapack.so /usr/lib/atlas-base/atlas/liblapack.so if [ `lsb_release -rs` = '12.04' ] ; then install_nettle_from_source @@ -290,7 +281,6 @@ check_install_oai_software() { fi $SUDO pip install paramiko $SUDO pip install pyroute2 - ) > $log_file 2>&1 install_asn1c_from_source $SUDO rm -fr /opt/ssh $SUDO git clone https://gist.github.com/2190472.git /opt/ssh @@ -311,8 +301,8 @@ install_asn1c_from_source(){ patch -p0 < $OPENAIR_DIR/openair3/S1AP/MESSAGES/ASN1/asn1cpatch_3.p0 >> /tmp/log_compile_asn1c ./configure make -j`nproc` - $SUDO make install - ) > $asn1_install_dir 2>&1 + $SUDO make install + ) > $asn1_install_dir 2>&1 } ################################################# @@ -393,3 +383,21 @@ done } +# get from http://www.linuxjournal.com/content/validating-ip-address-bash-script +validate_ip() { + +local ip=$1 +local stat=1 + +if [[ $ip =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then + OIFS=$IFS + IFS='.' + ip=($ip) + IFS=$OIFS + [[ ${ip[0]} -le 255 && ${ip[1]} -le 255 \ + && ${ip[2]} -le 255 && ${ip[3]} -le 255 ]] + stat=$? +fi + +return $stat +} diff --git a/cmake_targets/autotests/tools/exmimo/exmimo_stop.m b/cmake_targets/tools/exmimo_stop_octave.m similarity index 100% rename from cmake_targets/autotests/tools/exmimo/exmimo_stop.m rename to cmake_targets/tools/exmimo_stop_octave.m diff --git a/cmake_targets/tools/start_bladerf.py b/cmake_targets/tools/start_bladerf.py new file mode 100755 index 0000000000000000000000000000000000000000..ad83d5d5179f47cc76ffcf8bafa358e4dce9fcf5 --- /dev/null +++ b/cmake_targets/tools/start_bladerf.py @@ -0,0 +1,46 @@ +#!/usr/bin/python +import time +import serial +import os +from pyroute2 import IPRoute +import sys +import re +import threading +import signal +import traceback +import commands + +if os.environ.get('OPENAIR_DIR') == None: + print "Error getting OPENAIR_DIR environment variable" + sys.exit(1) + +sys.path.append(os.path.expandvars('$OPENAIR_DIR/cmake_targets/autotests/tools/')) + +from lib_autotest import * + +def reset_bladerf(): + stringIdBladeRF='OpenMoko, Inc' + status, out = commands.getstatusoutput('lsusb | grep -i \'' + stringIdBladeRF + '\'') + if (out == '') : + print "BladeRF not found. Exiting now..." + sys.exit() + p=re.compile('Bus\s*(\w+)\s*Device\s*(\w+):\s*ID\s*(\w+):(\w+)') + res=p.findall(out) + BusId=res[0][0] + DeviceId=res[0][1] + VendorId=res[0][2] + ProductId=res[0][3] + usb_dir= find_usb_path(VendorId, ProductId) + print "BladeRF Found in directory..." + usb_dir + cmd = "sudo sh -c \"echo 0 > " + usb_dir + "/authorized\"" + os.system(cmd + " ; sleep 5" ) + cmd = "sudo sh -c \"echo 1 > " + usb_dir + "/authorized\"" + os.system(cmd + " ; sleep 5" ) + +os.system ('sudo -E bladeRF-cli --flash-firmware /usr/share/Nuand/bladeRF/bladeRF_fw.img') + +print "Resettting BladeRF..." + +reset_bladerf() + +os.system ("dmesg|tail") diff --git a/cmake_targets/tools/stop_exmimo2 b/cmake_targets/tools/stop_exmimo2 new file mode 100755 index 0000000000000000000000000000000000000000..a68fdb7d57d9a4e8c1457d5bdcccd67f2e42c64d --- /dev/null +++ b/cmake_targets/tools/stop_exmimo2 @@ -0,0 +1,17 @@ +#!/bin/bash + +echo "This script stops exmimo2 as it might be transmitting signal by itself if lte-softmodem terminates incorrectly" + +if [ "$OPENAIR_DIR" == "" ]; then + echo "Is the OPENAIR_DIR path set correctly? Exiting now" + exit +fi +sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' + +#load the module +sudo -E $OPENAIR_DIR/cmake_targets/tools/init_exmimo2 + +#now we stop the card from transmitting anything +cd $OPENAIR_DIR/targets/bin +sudo -E octave -H --no-gui $OPENAIR_DIR/cmake_targets/tools/exmimo_stop_octave.m + diff --git a/openair1/PHY/CODING/lte_rate_matching.c b/openair1/PHY/CODING/lte_rate_matching.c index 69697fc2e0c0ef932e330788f0782bdc1b5c428f..96663bd8a6f8829b23a73c05700371ed0ef5f1a9 100644 --- a/openair1/PHY/CODING/lte_rate_matching.c +++ b/openair1/PHY/CODING/lte_rate_matching.c @@ -36,6 +36,7 @@ #include <stdlib.h> #endif #include "PHY/defs.h" +#include "assertions.h" //#define cmin(a,b) ((a)<(b) ? (a) : (b)) @@ -515,16 +516,14 @@ uint32_t lte_rate_matching_turbo(uint32_t RTC, // if (rvidx==3) // for (cnt=0;cnt<Ncb;cnt++) // counter_buffer[rvidx][cnt]=0; - if (Ncb<(3*(RTC<<5))) { - msg("Exiting, RM condition (Nir %d, Nsoft %d, Kw %d\n",Nir,Nsoft,3*(RTC<<5)); - return(0); - } + AssertFatal(Ncb>=(3*RTC<<5),"Exiting, RM condition (Ncb %d, Nir/C %d, Nsoft %d, Kw %d\n",Ncb,Nir/C,Nsoft,3*(RTC<<5)); + Gp = G/Nl/Qm; GpmodC = Gp%C; #ifdef RM_DEBUG - printf("lte_rate_matching_turbo: Kw %d, rvidx %d, G %d, Qm %d, Nl%d, r %d\n",3*(RTC<<5),rvidx, G, Qm,Nl,r); + printf("lte_rate_matching_turbo: Ncb %d, Kw %d, Nir/C %d, rvidx %d, G %d, Qm %d, Nl%d, r %d\n",Ncb,3*(RTC<<5),Nir/C,rvidx, G, Qm,Nl,r); #endif if (r < (C-(GpmodC))) diff --git a/openair1/PHY/INIT/lte_param_init.c b/openair1/PHY/INIT/lte_param_init.c new file mode 100644 index 0000000000000000000000000000000000000000..2b827dcb0e0c8a8a760c94d66854de8e03b4182a --- /dev/null +++ b/openair1/PHY/INIT/lte_param_init.c @@ -0,0 +1,106 @@ +#include <string.h> +#include <math.h> +#include <unistd.h> +#include <execinfo.h> +#include <signal.h> + +#include "SIMULATION/TOOLS/defs.h" +#include "PHY/types.h" +#include "PHY/defs.h" +#include "PHY/extern.h" + +extern PHY_VARS_eNB *PHY_vars_eNB; +extern PHY_VARS_UE *PHY_vars_UE; + +void lte_param_init(unsigned char N_tx, + unsigned char N_rx, + unsigned char transmission_mode, + uint8_t extended_prefix_flag, + frame_t frame_type, + uint16_t Nid_cell, + uint8_t tdd_config, + uint8_t N_RB_DL, + uint8_t threequarter_fs, + uint8_t osf, + uint32_t perfect_ce) +{ + + LTE_DL_FRAME_PARMS *lte_frame_parms; + int i; + + + printf("Start lte_param_init\n"); + PHY_vars_eNB = malloc(sizeof(PHY_VARS_eNB)); + PHY_vars_UE = malloc(sizeof(PHY_VARS_UE)); + //PHY_config = malloc(sizeof(PHY_CONFIG)); + mac_xface = malloc(sizeof(MAC_xface)); + + srand(0); + randominit(0); + set_taus_seed(0); + + lte_frame_parms = &(PHY_vars_eNB->lte_frame_parms); + + lte_frame_parms->N_RB_DL = N_RB_DL; //50 for 10MHz and 25 for 5 MHz + lte_frame_parms->N_RB_UL = N_RB_DL; + lte_frame_parms->threequarter_fs = threequarter_fs; + lte_frame_parms->Ncp = extended_prefix_flag; + lte_frame_parms->Nid_cell = Nid_cell; + lte_frame_parms->nushift = Nid_cell%6; + lte_frame_parms->nb_antennas_tx = N_tx; + lte_frame_parms->nb_antennas_rx = N_rx; + lte_frame_parms->nb_antennas_tx_eNB = N_tx; + lte_frame_parms->phich_config_common.phich_resource = one; + lte_frame_parms->tdd_config = tdd_config; + lte_frame_parms->frame_type = frame_type; + // lte_frame_parms->Csrs = 2; + // lte_frame_parms->Bsrs = 0; + // lte_frame_parms->kTC = 0;44 + // lte_frame_parms->n_RRC = 0; + lte_frame_parms->mode1_flag = (transmission_mode == 1)? 1 : 0; + + init_frame_parms(lte_frame_parms,osf); + + //copy_lte_parms_to_phy_framing(lte_frame_parms, &(PHY_config->PHY_framing)); + + // phy_init_top(lte_frame_parms); //allocation + + PHY_vars_UE->is_secondary_ue = 0; + PHY_vars_UE->lte_frame_parms = *lte_frame_parms; + PHY_vars_eNB->lte_frame_parms = *lte_frame_parms; + + phy_init_lte_top(lte_frame_parms); + dump_frame_parms(lte_frame_parms); + + PHY_vars_UE->PHY_measurements.n_adj_cells=0; + PHY_vars_UE->PHY_measurements.adj_cell_id[0] = Nid_cell+1; + PHY_vars_UE->PHY_measurements.adj_cell_id[1] = Nid_cell+2; + + for (i=0; i<3; i++) + lte_gold(lte_frame_parms,PHY_vars_UE->lte_gold_table[i],Nid_cell+i); + + phy_init_lte_ue(PHY_vars_UE,1,0); + phy_init_lte_eNB(PHY_vars_eNB,0,0,0); + + generate_pcfich_reg_mapping(&PHY_vars_UE->lte_frame_parms); + generate_phich_reg_mapping(&PHY_vars_UE->lte_frame_parms); + + // DL power control init + if (transmission_mode == 1) { + PHY_vars_eNB->pdsch_config_dedicated->p_a = dB0; // 4 = 0dB + ((PHY_vars_eNB->lte_frame_parms).pdsch_config_common).p_b = 0; + PHY_vars_UE->pdsch_config_dedicated->p_a = dB0; // 4 = 0dB + ((PHY_vars_UE->lte_frame_parms).pdsch_config_common).p_b = 0; + } else { // rho_a = rhob + PHY_vars_eNB->pdsch_config_dedicated->p_a = dB0; // 4 = 0dB + ((PHY_vars_eNB->lte_frame_parms).pdsch_config_common).p_b = 1; + PHY_vars_UE->pdsch_config_dedicated->p_a = dB0; // 4 = 0dB + ((PHY_vars_UE->lte_frame_parms).pdsch_config_common).p_b = 1; + } + + PHY_vars_UE->perfect_ce = perfect_ce; + + printf("Done lte_param_init\n"); + + +} diff --git a/openair1/PHY/INIT/lte_parms.c b/openair1/PHY/INIT/lte_parms.c index 55bd964aa7e302b1e7853a4e41dc5c5c84b3a215..fa0e731af97830ad22bad3c85f89584cd8246e07 100644 --- a/openair1/PHY/INIT/lte_parms.c +++ b/openair1/PHY/INIT/lte_parms.c @@ -68,33 +68,57 @@ int init_frame_parms(LTE_DL_FRAME_PARMS *frame_parms,uint8_t osf) break; default: - msg("Illegal oversampling %d\n",osf); + printf("Illegal oversampling %d\n",osf); return(-1); } switch (frame_parms->N_RB_DL) { + case 100: if (osf>1) { - msg("Illegal oversampling %d for N_RB_DL %d\n",osf,frame_parms->N_RB_DL); + printf("Illegal oversampling %d for N_RB_DL %d\n",osf,frame_parms->N_RB_DL); return(-1); } - frame_parms->ofdm_symbol_size = 2048; - frame_parms->log2_symbol_size = 11; - frame_parms->samples_per_tti = 30720; - frame_parms->first_carrier_offset = 2048-600; + if (frame_parms->threequarter_fs) { + frame_parms->ofdm_symbol_size = 1536; + frame_parms->samples_per_tti = 23040; + frame_parms->first_carrier_offset = 1536-600; + frame_parms->nb_prefix_samples=(frame_parms->nb_prefix_samples*3)>>2; + frame_parms->nb_prefix_samples0=(frame_parms->nb_prefix_samples0*3)>>2; + } + else { + frame_parms->ofdm_symbol_size = 2048; + frame_parms->samples_per_tti = 30720; + frame_parms->first_carrier_offset = 2048-600; + } + frame_parms->N_RBGS = 4; + frame_parms->N_RBG = 25; + break; + + case 75: + if (osf>1) { + printf("Illegal oversampling %d for N_RB_DL %d\n",osf,frame_parms->N_RB_DL); + return(-1); + } + + + frame_parms->ofdm_symbol_size = 1536; + frame_parms->samples_per_tti = 23040; + frame_parms->first_carrier_offset = 1536-450; + frame_parms->nb_prefix_samples=(frame_parms->nb_prefix_samples*3)>>2; + frame_parms->nb_prefix_samples0=(frame_parms->nb_prefix_samples0*3)>>2; frame_parms->N_RBGS = 4; frame_parms->N_RBG = 25; break; case 50: if (osf>1) { - msg("Illegal oversampling %d for N_RB_DL %d\n",osf,frame_parms->N_RB_DL); + printf("Illegal oversampling %d for N_RB_DL %d\n",osf,frame_parms->N_RB_DL); return(-1); } frame_parms->ofdm_symbol_size = 1024*osf; - frame_parms->log2_symbol_size = 10+log2_osf; frame_parms->samples_per_tti = 15360*osf; frame_parms->first_carrier_offset = frame_parms->ofdm_symbol_size - 300; frame_parms->nb_prefix_samples>>=(1-log2_osf); @@ -105,13 +129,13 @@ int init_frame_parms(LTE_DL_FRAME_PARMS *frame_parms,uint8_t osf) case 25: if (osf>2) { - msg("Illegal oversampling %d for N_RB_DL %d\n",osf,frame_parms->N_RB_DL); + printf("Illegal oversampling %d for N_RB_DL %d\n",osf,frame_parms->N_RB_DL); return(-1); } frame_parms->ofdm_symbol_size = 512*osf; - frame_parms->log2_symbol_size = 9+log2_osf; + frame_parms->samples_per_tti = 7680*osf; frame_parms->first_carrier_offset = frame_parms->ofdm_symbol_size - 150; frame_parms->nb_prefix_samples>>=(2-log2_osf); @@ -124,7 +148,6 @@ int init_frame_parms(LTE_DL_FRAME_PARMS *frame_parms,uint8_t osf) case 15: frame_parms->ofdm_symbol_size = 256*osf; - frame_parms->log2_symbol_size = 8+log2_osf; frame_parms->samples_per_tti = 3840*osf; frame_parms->first_carrier_offset = frame_parms->ofdm_symbol_size - 90; frame_parms->nb_prefix_samples>>=(3-log2_osf); @@ -135,7 +158,6 @@ int init_frame_parms(LTE_DL_FRAME_PARMS *frame_parms,uint8_t osf) case 6: frame_parms->ofdm_symbol_size = 128*osf; - frame_parms->log2_symbol_size = 7+log2_osf; frame_parms->samples_per_tti = 1920*osf; frame_parms->first_carrier_offset = frame_parms->ofdm_symbol_size - 36; frame_parms->nb_prefix_samples>>=(4-log2_osf); @@ -145,7 +167,7 @@ int init_frame_parms(LTE_DL_FRAME_PARMS *frame_parms,uint8_t osf) break; default: - msg("init_frame_parms: Error: Number of resource blocks (N_RB_DL %d) undefined, frame_parms = %p \n",frame_parms->N_RB_DL, frame_parms); + printf("init_frame_parms: Error: Number of resource blocks (N_RB_DL %d) undefined, frame_parms = %p \n",frame_parms->N_RB_DL, frame_parms); return(-1); break; } @@ -159,23 +181,22 @@ int init_frame_parms(LTE_DL_FRAME_PARMS *frame_parms,uint8_t osf) void dump_frame_parms(LTE_DL_FRAME_PARMS *frame_parms) { - msg("frame_parms->N_RB_DL=%d\n",frame_parms->N_RB_DL); - msg("frame_parms->N_RB_UL=%d\n",frame_parms->N_RB_UL); - msg("frame_parms->Nid_cell=%d\n",frame_parms->Nid_cell); - msg("frame_parms->Ncp=%d\n",frame_parms->Ncp); - msg("frame_parms->Ncp_UL=%d\n",frame_parms->Ncp_UL); - msg("frame_parms->nushift=%d\n",frame_parms->nushift); - msg("frame_parms->frame_type=%d\n",frame_parms->frame_type); - msg("frame_parms->tdd_config=%d\n",frame_parms->tdd_config); - msg("frame_parms->tdd_config_S=%d\n",frame_parms->tdd_config_S); - msg("frame_parms->mode1_flag=%d\n",frame_parms->mode1_flag); - msg("frame_parms->nb_antennas_tx=%d\n",frame_parms->nb_antennas_tx); - msg("frame_parms->nb_antennas_rx=%d\n",frame_parms->nb_antennas_rx); - msg("frame_parms->ofdm_symbol_size=%d\n",frame_parms->ofdm_symbol_size); - msg("frame_parms->log2_symbol_size=%d\n",frame_parms->log2_symbol_size); - msg("frame_parms->nb_prefix_samples=%d\n",frame_parms->nb_prefix_samples); - msg("frame_parms->nb_prefix_samples0=%d\n",frame_parms->nb_prefix_samples0); - msg("frame_parms->first_carrier_offset=%d\n",frame_parms->first_carrier_offset); - msg("frame_parms->samples_per_tti=%d\n",frame_parms->samples_per_tti); - msg("frame_parms->symbols_per_tti=%d\n",frame_parms->symbols_per_tti); + printf("frame_parms->N_RB_DL=%d\n",frame_parms->N_RB_DL); + printf("frame_parms->N_RB_UL=%d\n",frame_parms->N_RB_UL); + printf("frame_parms->Nid_cell=%d\n",frame_parms->Nid_cell); + printf("frame_parms->Ncp=%d\n",frame_parms->Ncp); + printf("frame_parms->Ncp_UL=%d\n",frame_parms->Ncp_UL); + printf("frame_parms->nushift=%d\n",frame_parms->nushift); + printf("frame_parms->frame_type=%d\n",frame_parms->frame_type); + printf("frame_parms->tdd_config=%d\n",frame_parms->tdd_config); + printf("frame_parms->tdd_config_S=%d\n",frame_parms->tdd_config_S); + printf("frame_parms->mode1_flag=%d\n",frame_parms->mode1_flag); + printf("frame_parms->nb_antennas_tx=%d\n",frame_parms->nb_antennas_tx); + printf("frame_parms->nb_antennas_rx=%d\n",frame_parms->nb_antennas_rx); + printf("frame_parms->ofdm_symbol_size=%d\n",frame_parms->ofdm_symbol_size); + printf("frame_parms->nb_prefix_samples=%d\n",frame_parms->nb_prefix_samples); + printf("frame_parms->nb_prefix_samples0=%d\n",frame_parms->nb_prefix_samples0); + printf("frame_parms->first_carrier_offset=%d\n",frame_parms->first_carrier_offset); + printf("frame_parms->samples_per_tti=%d\n",frame_parms->samples_per_tti); + printf("frame_parms->symbols_per_tti=%d\n",frame_parms->symbols_per_tti); } diff --git a/openair1/PHY/LTE_ESTIMATION/defs.h b/openair1/PHY/LTE_ESTIMATION/defs.h index 10dc558c9b46490a27c533e9ec1fb7c5f9809bf2..903793c2b57c3902e1c43f0c619d420ff36717e5 100644 --- a/openair1/PHY/LTE_ESTIMATION/defs.h +++ b/openair1/PHY/LTE_ESTIMATION/defs.h @@ -243,15 +243,16 @@ int lte_est_timing_advance(LTE_DL_FRAME_PARMS *frame_parms, int lte_est_timing_advance_pusch(PHY_VARS_eNB* phy_vars_eNB,module_id_t UE_id,uint8_t subframe); -void lte_eNB_I0_measurements(PHY_VARS_eNB *phy_vars_eNb, +void lte_eNB_I0_measurements(PHY_VARS_eNB *phy_vars_eNB, + int subframe, module_id_t eNB_id, unsigned char clear); -void lte_eNB_I0_measurements_emul(PHY_VARS_eNB *phy_vars_eNb, +void lte_eNB_I0_measurements_emul(PHY_VARS_eNB *phy_vars_eNB, uint8_t sect_id); -void lte_eNB_srs_measurements(PHY_VARS_eNB *phy_vars_eNb, +void lte_eNB_srs_measurements(PHY_VARS_eNB *phy_vars_eNBy, module_id_t eNB_id, module_id_t UE_id, unsigned char init_averaging); diff --git a/openair1/PHY/LTE_ESTIMATION/lte_dl_channel_estimation.c b/openair1/PHY/LTE_ESTIMATION/lte_dl_channel_estimation.c index 10c0cef42ad4858ec57ee0ac243ae8a262c2d35d..cfc2d929f1cb75b1edf53cbf92ad2b24e4e363a5 100644 --- a/openair1/PHY/LTE_ESTIMATION/lte_dl_channel_estimation.c +++ b/openair1/PHY/LTE_ESTIMATION/lte_dl_channel_estimation.c @@ -703,24 +703,28 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue, void (*idft)(int16_t *,int16_t *, int); - switch (phy_vars_ue->lte_frame_parms.log2_symbol_size) { - case 7: + switch (phy_vars_ue->lte_frame_parms.ofdm_symbol_size) { + case 128: idft = idft128; break; - case 8: + case 256: idft = idft256; break; - case 9: + case 512: idft = idft512; break; - case 10: + case 1024: idft = idft1024; break; - case 11: + case 1536: + idft = idft1536; + break; + + case 2048: idft = idft2048; break; diff --git a/openair1/PHY/LTE_ESTIMATION/lte_eNB_measurements.c b/openair1/PHY/LTE_ESTIMATION/lte_eNB_measurements.c index 9564b7842c9e91ea48b0955ef1e8b458e8247de2..14e1c185711d119715c186b0328a36ab476b4297 100644 --- a/openair1/PHY/LTE_ESTIMATION/lte_eNB_measurements.c +++ b/openair1/PHY/LTE_ESTIMATION/lte_eNB_measurements.c @@ -39,57 +39,36 @@ int32_t rx_power_avg_eNB[3][3]; -void lte_eNB_I0_measurements(PHY_VARS_eNB *phy_vars_eNb, +void lte_eNB_I0_measurements(PHY_VARS_eNB *phy_vars_eNB, + int subframe, unsigned char eNB_id, unsigned char clear) { - LTE_eNB_COMMON *eNB_common_vars = &phy_vars_eNb->lte_eNB_common_vars; - LTE_DL_FRAME_PARMS *frame_parms = &phy_vars_eNb->lte_frame_parms; - PHY_MEASUREMENTS_eNB *phy_measurements = &phy_vars_eNb->PHY_measurements_eNB[eNB_id]; - + LTE_eNB_COMMON *eNB_common_vars = &phy_vars_eNB->lte_eNB_common_vars; + LTE_DL_FRAME_PARMS *frame_parms = &phy_vars_eNB->lte_frame_parms; + PHY_MEASUREMENTS_eNB *phy_measurements = &phy_vars_eNB->PHY_measurements_eNB[eNB_id]; + int32_t *rb_mask = phy_vars_eNB->rb_mask_ul; uint32_t aarx,rx_power_correction; uint32_t rb; int32_t *ul_ch; int32_t n0_power_tot; - + int len; + int offset; + int Nsymb = (frame_parms->Ncp==NORMAL)?14:12; // noise measurements // for the moment we measure the noise on the 7th OFDM symbol (in S subframe) phy_measurements->n0_power_tot = 0; - /* printf("rxdataF0 %p, rxdataF1 %p\n", - (&eNB_common_vars->rxdataF[0][0][(frame_parms->ofdm_symbol_size + frame_parms->first_carrier_offset)<<1 ]), - (&eNB_common_vars->rxdataF[0][1][(frame_parms->ofdm_symbol_size + frame_parms->first_carrier_offset)<<1 ])); - */ - /* - for (i=0;i<512;i++) - printf("sector 0 antenna 0 : %d,%d\n",((short *)&eNB_common_vars->rxdataF[0][0][(19*frame_parms->ofdm_symbol_size)<<1])[i<<1], - ((short *)&eNB_common_vars->rxdataF[0][0][(19*frame_parms->ofdm_symbol_size)<<1])[1+(i<<1)]); - - for (i=0;i<12;i++) - // printf("sector 0 antenna 1 : %d,%d\n",((short *)&eNB_common_vars->rxdataF[0][1][(19*frame_parms->ofdm_symbol_size)<<1])[i<<1], - ((short *)&eNB_common_vars->rxdataF[0][1][(19*frame_parms->ofdm_symbol_size)<<1])[1+(i<<1)]); - */ - - if ( (frame_parms->ofdm_symbol_size == 128) || - (frame_parms->ofdm_symbol_size == 512) ) - rx_power_correction = 2; - else - rx_power_correction = 1; - for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) { if (clear == 1) phy_measurements->n0_power[aarx]=0; -#ifdef USER_MODE + phy_measurements->n0_power[aarx] = ((k1*signal_energy(&eNB_common_vars->rxdata[eNB_id][aarx][(frame_parms->samples_per_tti<<1) -frame_parms->ofdm_symbol_size], frame_parms->ofdm_symbol_size)) + k2*phy_measurements->n0_power[aarx])>>10; -#else - phy_measurements->n0_power[aarx] = ((k1*signal_energy(&eNB_common_vars->rxdata[eNB_id][aarx][(frame_parms->samples_per_tti<<1) -frame_parms->ofdm_symbol_size], - frame_parms->ofdm_symbol_size))+k2*phy_measurements->n0_power[aarx])>>10; -#endif phy_measurements->n0_power[aarx] = (phy_measurements->n0_power[aarx] * 12*frame_parms->N_RB_DL)/(frame_parms->ofdm_symbol_size); phy_measurements->n0_power_dB[aarx] = (unsigned short) dB_fixed(phy_measurements->n0_power[aarx]); phy_measurements->n0_power_tot += phy_measurements->n0_power[aarx]; @@ -97,52 +76,49 @@ void lte_eNB_I0_measurements(PHY_VARS_eNB *phy_vars_eNb, phy_measurements->n0_power_tot_dB = (unsigned short) dB_fixed(phy_measurements->n0_power_tot); - phy_measurements->n0_power_tot_dBm = phy_measurements->n0_power_tot_dB - phy_vars_eNb->rx_total_gain_eNB_dB; + phy_measurements->n0_power_tot_dBm = phy_measurements->n0_power_tot_dB - phy_vars_eNB->rx_total_gain_eNB_dB; // printf("n0_power %d\n",phy_measurements->n0_power_tot_dB); for (rb=0; rb<frame_parms->N_RB_UL; rb++) { n0_power_tot=0; - - for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) { - - - if (rb < 12) - // ul_ch = &eNB_common_vars->rxdataF[eNB_id][aarx][((19*(frame_parms->ofdm_symbol_size)) + frame_parms->first_carrier_offset + (rb*12))<<1]; - ul_ch = &eNB_common_vars->rxdataF[eNB_id][aarx][((7*frame_parms->ofdm_symbol_size) + frame_parms->first_carrier_offset + (rb*12))<<1]; - else if (rb>12) - ul_ch = &eNB_common_vars->rxdataF[eNB_id][aarx][((7*frame_parms->ofdm_symbol_size) + 6 + (rb-13)*12)<<1]; - else { - ul_ch = NULL; - } - - if (clear == 1) - phy_measurements->n0_subband_power[aarx][rb]=0; - - if (ul_ch) { - // for (i=0;i<24;i+=2) - // printf("re %d => %d\n",i/2,ul_ch[i]); - phy_measurements->n0_subband_power[aarx][rb] = ((k1*(signal_energy_nodc(ul_ch, - 24))*rx_power_correction) + (k2*phy_measurements->n0_subband_power[aarx][rb]))>>11; // 11 and 24 to compensate for repeated signal format - - phy_measurements->n0_subband_power_dB[aarx][rb] = dB_fixed(phy_measurements->n0_subband_power[aarx][rb]); - // printf("eNb %d, aarx %d, rb %d : energy %d (%d dB)\n",eNB_id,aarx,rb,signal_energy_nodc(ul_ch,24), phy_measurements->n0_subband_power_dB[aarx][rb]); - n0_power_tot += phy_measurements->n0_subband_power[aarx][rb]; - } else { - phy_measurements->n0_subband_power[aarx][rb] = 1; - phy_measurements->n0_subband_power_dB[aarx][rb] = -99; - n0_power_tot = 1; + if ((rb_mask[rb>>5]&(1<<(rb&31))) == 0) { // check that rb was not used in this subframe + for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) { + + // select the 7th symbol in an uplink subframe + offset = (frame_parms->first_carrier_offset + (rb*12))%frame_parms->ofdm_symbol_size; + offset += (7*frame_parms->ofdm_symbol_size);//(((Nsymb*subframe)+7)*frame_parms->ofdm_symbol_size); + ul_ch = &eNB_common_vars->rxdataF[eNB_id][aarx][offset]; + len = 12; + // just do first half of middle PRB for odd number of PRBs + if (((frame_parms->N_RB_UL&1) == 1) && + (rb==(frame_parms->N_RB_UL>>1))) { + len=6; + } + if (clear == 1) + phy_measurements->n0_subband_power[aarx][rb]=0; + + AssertFatal(ul_ch, "RX signal buffer (freq) problem"); + + + phy_measurements->n0_subband_power[aarx][rb] = signal_energy_nodc(ul_ch,len); + //((k1*(signal_energy_nodc(ul_ch,len))) + // + (k2*phy_measurements->n0_subband_power[aarx][rb])); + + phy_measurements->n0_subband_power_dB[aarx][rb] = dB_fixed(phy_measurements->n0_subband_power[aarx][rb]); + // printf("subframe %d (%d): eNb %d, aarx %d, rb %d len %d: energy %d (%d dB)\n",subframe,offset,eNB_id,aarx,rb,len,signal_energy_nodc(ul_ch,len), + // phy_measurements->n0_subband_power_dB[aarx][rb]); + n0_power_tot += phy_measurements->n0_subband_power[aarx][rb]; } + + phy_measurements->n0_subband_power_tot_dB[rb] = dB_fixed(n0_power_tot); + phy_measurements->n0_subband_power_tot_dBm[rb] = phy_measurements->n0_subband_power_tot_dB[rb] - phy_vars_eNB->rx_total_gain_eNB_dB - dB_fixed(frame_parms->N_RB_UL); + } - - phy_measurements->n0_subband_power_tot_dB[rb] = dB_fixed(n0_power_tot); - phy_measurements->n0_subband_power_tot_dBm[rb] = phy_measurements->n0_subband_power_tot_dB[rb] - phy_vars_eNb->rx_total_gain_eNB_dB - 14; - } } - void lte_eNB_srs_measurements(PHY_VARS_eNB *phy_vars_eNb, unsigned char eNB_id, unsigned char UE_id, diff --git a/openair1/PHY/LTE_ESTIMATION/lte_sync_time.c b/openair1/PHY/LTE_ESTIMATION/lte_sync_time.c index 9864a50ee29e6dc6d5a343862e1f3f677d38d85f..6e2311789eabe56d5adf61140a8dca98df309f54 100644 --- a/openair1/PHY/LTE_ESTIMATION/lte_sync_time.c +++ b/openair1/PHY/LTE_ESTIMATION/lte_sync_time.c @@ -61,7 +61,6 @@ int lte_sync_time_init(LTE_DL_FRAME_PARMS *frame_parms ) // LTE_UE_COMMON *com { int i,k; - //unsigned short ds = frame_parms->log2_symbol_size - 7; sync_corr_ue0 = (int *)malloc16(LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*sizeof(int)*frame_parms->samples_per_tti); sync_corr_ue1 = (int *)malloc16(LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*sizeof(int)*frame_parms->samples_per_tti); @@ -184,13 +183,6 @@ int lte_sync_time_init(LTE_DL_FRAME_PARMS *frame_parms ) // LTE_UE_COMMON *com LOG_E(PHY,"Unsupported N_RB_DL %d\n",frame_parms->N_RB_DL); break; } - /* - frame_parms->twiddle_ifft, /// complex twiddle factors - frame_parms->rev, /// bit reversed permutation vector - frame_parms->log2_symbol_size,/// log2(FFT_SIZE) - (frame_parms->log2_symbol_size/2), - 0); /// 0 - input is in complex Q1.15 format, 1 - input is in complex redundant Q1.15 format) - */ for (i=0; i<frame_parms->ofdm_symbol_size; i++) ((int32_t*)primary_synch0_time)[i] = sync_tmp[i]; diff --git a/openair1/PHY/LTE_ESTIMATION/lte_ul_channel_estimation.c b/openair1/PHY/LTE_ESTIMATION/lte_ul_channel_estimation.c index 1d23bdca38d7b4121485d3777fdfdd268fbce9e1..1eb663ec89e844a2adc171ecdc818e912a97d81c 100644 --- a/openair1/PHY/LTE_ESTIMATION/lte_ul_channel_estimation.c +++ b/openair1/PHY/LTE_ESTIMATION/lte_ul_channel_estimation.c @@ -432,7 +432,7 @@ int32_t lte_ul_channel_estimation(PHY_VARS_eNB *phy_vars_eNB, in_fft_ptr_0 = &temp_in_fft_0[0]; in_fft_ptr_1 = &temp_in_fft_1[0]; - for(j=0; j<(1<<(frame_parms->log2_symbol_size))/12; j++) { + for(j=0; j<(frame_parms->ofdm_symbol_size)/12; j++) { if (j>19) { ((int16_t*)in_fft_ptr_0)[-40+(2*j)] = ((int16_t*)temp_out_ifft_0)[-80+(2*j)]*rx_power_correction; ((int16_t*)in_fft_ptr_0)[-40+(2*j)+1] = ((int16_t*)temp_out_ifft_0)[-80+(2*j+1)]*rx_power_correction; diff --git a/openair1/PHY/LTE_REFSIG/lte_dl_cell_spec.c b/openair1/PHY/LTE_REFSIG/lte_dl_cell_spec.c index 6faf2e1ed0ee47816182be2473859fe1ac82bcac..8e64275b41f22ffeeeeaa9f0368c3b8ed895a6e6 100644 --- a/openair1/PHY/LTE_REFSIG/lte_dl_cell_spec.c +++ b/openair1/PHY/LTE_REFSIG/lte_dl_cell_spec.c @@ -72,7 +72,7 @@ int lte_dl_cell_spec_SS(PHY_VARS_eNB *phy_vars_eNB, else if ((p==1) && (l>0)) nu = 0; else { - msg("lte_dl_cell_spec: p %d, l %d -> ERROR\n",p,l); + printf("lte_dl_cell_spec: p %d, l %d -> ERROR\n",p,l); return(-1); } @@ -94,9 +94,9 @@ int lte_dl_cell_spec_SS(PHY_VARS_eNB *phy_vars_eNB, output[k] = qpsk[(phy_vars_eNB->lte_gold_table[Ns][l][mprime_dword]>>(2*mprime_qpsk_symb))&3]; //output[k] = (lte_gold_table[eNB_offset][Ns][l][mprime_dword]>>(2*mprime_qpsk_symb))&3; #ifdef DEBUG_DL_CELL_SPEC - msg("Ns %d, l %d, m %d,mprime_dword %d, mprime_qpsk_symbol %d\n", + printf("Ns %d, l %d, m %d,mprime_dword %d, mprime_qpsk_symbol %d\n", Ns,l,m,mprime_dword,mprime_qpsk_symb); - msg("index = %d (k %d)\n",(phy_vars_eNB->lte_gold_table[Ns][l][mprime_dword]>>(2*mprime_qpsk_symb))&3,k); + printf("index = %d (k %d)\n",(phy_vars_eNB->lte_gold_table[Ns][l][mprime_dword]>>(2*mprime_qpsk_symb))&3,k); #endif mprime++; @@ -151,7 +151,7 @@ int lte_dl_cell_spec(PHY_VARS_eNB *phy_vars_eNB, else if ((p==1) && (l>0)) nu = 0; else { - msg("lte_dl_cell_spec: p %d, l %d -> ERROR\n",p,l); + printf("lte_dl_cell_spec: p %d, l %d -> ERROR\n",p,l); return(-1); } @@ -177,9 +177,9 @@ int lte_dl_cell_spec(PHY_VARS_eNB *phy_vars_eNB, output[k] = qpsk[(phy_vars_eNB->lte_gold_table[Ns][l][mprime_dword]>>(2*mprime_qpsk_symb))&3]; //output[k] = (lte_gold_table[eNB_offset][Ns][l][mprime_dword]>>(2*mprime_qpsk_symb))&3; #ifdef DEBUG_DL_CELL_SPEC - msg("Ns %d, l %d, m %d,mprime_dword %d, mprime_qpsk_symbol %d\n", + printf("Ns %d, l %d, m %d,mprime_dword %d, mprime_qpsk_symbol %d\n", Ns,l,m,mprime_dword,mprime_qpsk_symb); - msg("index = %d (k %d)\n",(phy_vars_eNB->lte_gold_table[Ns][l][mprime_dword]>>(2*mprime_qpsk_symb))&3,k); + printf("index = %d (k %d)\n",(phy_vars_eNB->lte_gold_table[Ns][l][mprime_dword]>>(2*mprime_qpsk_symb))&3,k); #endif mprime++; diff --git a/openair1/PHY/LTE_REFSIG/primary_synch.h b/openair1/PHY/LTE_REFSIG/primary_synch.h index f9cf6fc171d156cf197be85d54debc479d66abd1..717f2e552cab59313b7c02b7ef4347070f4667b6 100644 --- a/openair1/PHY/LTE_REFSIG/primary_synch.h +++ b/openair1/PHY/LTE_REFSIG/primary_synch.h @@ -1,31 +1,3 @@ -/******************************************************************************* - OpenAirInterface - Copyright(c) 1999 - 2014 Eurecom - - OpenAirInterface is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - - OpenAirInterface is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with OpenAirInterface.The full GNU General Public License is - included in this distribution in the file called "COPYING". If not, - see <http://www.gnu.org/licenses/>. - - Contact Information - OpenAirInterface Admin: openair_admin@eurecom.fr - OpenAirInterface Tech : openair_tech@eurecom.fr - OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr - - Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE - - *******************************************************************************/ short primary_synch0[144] = {0,0,0,0,0,0,0,0,0,0,32767,0,-26120,-19785,11971,-30502,-24020,-22288,32117,6492,31311,9658,-16384,-28378,25100,-21063,-7292,-31946,20429,25618,14948,29158,11971,-30502,31311,9658,25100,-21063,-16384,28377,-24020,22287,32117,6492,-7292,31945,20429,25618,-26120,-19785,-16384,-28378,-16384,28377,-26120,-19785,-32402,4883,31311,-9659,32117,6492,-7292,-31946,32767,-1,25100,-21063,-24020,22287,-32402,4883,-32402,4883,-24020,22287,25100,-21063,32767,-1,-7292,-31946,32117,6492,31311,-9659,-32402,4883,-26120,-19785,-16384,28377,-16384,-28378,-26120,-19785,20429,25618,-7292,31945,32117,6492,-24020,22287,-16384,28377,25100,-21063,31311,9658,11971,-30502,14948,29158,20429,25618,-7292,-31946,25100,-21063,-16384,-28378,31311,9658,32117,6492,-24020,-22288,11971,-30502,-26120,-19785,32767,0,0,0,0,0,0,0,0,0,0,0}; short primary_synch1[144] = {0,0,0,0,0,0,0,0,0,0,32767,0,-31754,-8086,-24020,-22288,2448,32675,-26120,19784,27073,18458,-16384,28377,25100,21062,-29523,14217,-7292,31945,-13477,-29868,-24020,-22288,27073,18458,25100,21062,-16384,-28378,2448,-32676,-26120,19784,-29523,-14218,-7292,31945,-31754,-8086,-16384,28377,-16384,-28378,-31754,-8086,31311,-9659,27073,-18459,-26120,19784,-29523,14217,32767,-1,25100,21062,2448,-32676,31311,-9659,31311,-9659,2448,-32676,25100,21062,32767,0,-29523,14217,-26120,19784,27073,-18459,31311,-9659,-31754,-8086,-16384,-28378,-16384,28377,-31754,-8086,-7292,31945,-29523,-14218,-26120,19784,2448,-32676,-16384,-28378,25100,21062,27073,18458,-24020,-22288,-13477,-29868,-7292,31945,-29523,14217,25100,21062,-16384,28377,27073,18458,-26120,19784,2448,32675,-24020,-22288,-31754,-8086,32767,0,0,0,0,0,0,0,0,0,0,0}; short primary_synch2[144] = {0,0,0,0,0,0,0,0,0,0,32767,0,-31754,8085,-24020,22287,2448,-32676,-26120,-19785,27073,-18459,-16384,-28378,25100,-21063,-29523,-14218,-7292,-31946,-13477,29867,-24020,22287,27073,-18459,25100,-21063,-16384,28377,2448,32675,-26120,-19785,-29523,14217,-7292,-31946,-31754,8085,-16384,-28378,-16384,28377,-31754,8085,31311,9658,27073,18458,-26120,-19785,-29523,-14218,32767,0,25100,-21063,2448,32675,31311,9658,31311,9658,2448,32675,25100,-21063,32767,0,-29523,-14218,-26120,-19785,27073,18458,31311,9658,-31754,8085,-16384,28377,-16384,-28378,-31754,8085,-7292,-31946,-29523,14217,-26120,-19785,2448,32675,-16384,28377,25100,-21063,27073,-18459,-24020,22287,-13477,29867,-7292,-31946,-29523,-14218,25100,-21063,-16384,-28378,27073,-18459,-26120,-19785,2448,-32676,-24020,22287,-31754,8085,32767,-1,0,0,0,0,0,0,0,0,0,0}; diff --git a/openair1/PHY/LTE_TRANSPORT/dci.c b/openair1/PHY/LTE_TRANSPORT/dci.c index 2fd89c8f642207409c6b4f8aaa0e4fc7855850cc..70761ac5aea2fd11d921dafcc27662e58e4744aa 100644 --- a/openair1/PHY/LTE_TRANSPORT/dci.c +++ b/openair1/PHY/LTE_TRANSPORT/dci.c @@ -2108,14 +2108,14 @@ uint8_t generate_dci_top(uint8_t num_ue_spec_dci, if (dci_alloc[i].L == (uint8_t)L) { #ifdef DEBUG_DCI_ENCODING - LOG_I(PHY,"Generating common DCI %d/%d (nCCE %d) of length %d, aggregation %d (%x)\n",i,num_common_dci,dci_alloc[i].nCCE,dci_alloc[i].dci_length,1<<dci_alloc[i].L, + LOG_I(PHY,"Generating common DCI %d/%d (nCCE %d) of length %d, aggregation %d (%x)\n",i,num_common_dci,dci_alloc[i].firstCCE,dci_alloc[i].dci_length,1<<dci_alloc[i].L, *(unsigned int*)dci_alloc[i].dci_pdu); dump_dci(frame_parms,&dci_alloc[i]); #endif - if (dci_alloc[i].nCCE>=0) { + if (dci_alloc[i].firstCCE>=0) { e_ptr = generate_dci0(dci_alloc[i].dci_pdu, - e+(72*dci_alloc[i].nCCE), + e+(72*dci_alloc[i].firstCCE), dci_alloc[i].dci_length, dci_alloc[i].L, dci_alloc[i].rnti); @@ -2133,9 +2133,9 @@ uint8_t generate_dci_top(uint8_t num_ue_spec_dci, dump_dci(frame_parms,&dci_alloc[i]); #endif - if (dci_alloc[i].nCCE >= 0) { + if (dci_alloc[i].firstCCE >= 0) { e_ptr = generate_dci0(dci_alloc[i].dci_pdu, - e+(72*dci_alloc[i].nCCE), + e+(72*dci_alloc[i].firstCCE), dci_alloc[i].dci_length, dci_alloc[i].L, dci_alloc[i].rnti); @@ -2537,13 +2537,116 @@ uint16_t get_nquad(uint8_t num_pdcch_symbols,LTE_DL_FRAME_PARMS *frame_parms,uin return(Nreg - 4 - (3*Ngroup_PHICH)); } -uint16_t get_nCCE_max(uint8_t Mod_id,uint8_t CC_id) +uint16_t get_nCCE_mac(uint8_t Mod_id,uint8_t CC_id,int num_pdcch_symbols,int subframe) { // check for eNB only ! - return(get_nCCE(3,&PHY_vars_eNB_g[Mod_id][CC_id]->lte_frame_parms,1)); // 5, 15,21 + return(get_nCCE(num_pdcch_symbols, + &PHY_vars_eNB_g[Mod_id][CC_id]->lte_frame_parms, + get_mi(&PHY_vars_eNB_g[Mod_id][CC_id]->lte_frame_parms,subframe))); } + +int get_nCCE_offset_l1(int *CCE_table, + const unsigned char L, + const int nCCE, + const int common_dci, + const unsigned short rnti, + const unsigned char subframe) +{ + + int search_space_free,m,nb_candidates = 0,l,i; + unsigned int Yk; + /* + printf("CCE Allocation: "); + for (i=0;i<nCCE;i++) + printf("%d.",CCE_table[i]); + printf("\n"); + */ + if (common_dci == 1) { + // check CCE(0 ... L-1) + nb_candidates = (L==4) ? 4 : 2; + nb_candidates = min(nb_candidates,nCCE/L); + + // printf("Common DCI nb_candidates %d, L %d\n",nb_candidates,L); + + for (m = nb_candidates-1 ; m >=0 ; m--) { + + search_space_free = 1; + for (l=0; l<L; l++) { + + // printf("CCE_table[%d] %d\n",(m*L)+l,CCE_table[(m*L)+l]); + if (CCE_table[(m*L) + l] == 1) { + search_space_free = 0; + break; + } + } + + if (search_space_free == 1) { + + // printf("returning %d\n",m*L); + + for (l=0; l<L; l++) + CCE_table[(m*L)+l]=1; + return(m*L); + } + } + + return(-1); + + } else { // Find first available in ue specific search space + // according to procedure in Section 9.1.1 of 36.213 (v. 8.6) + // compute Yk + Yk = (unsigned int)rnti; + + for (i=0; i<=subframe; i++) + Yk = (Yk*39827)%65537; + + Yk = Yk % (nCCE/L); + + + switch (L) { + case 1: + case 2: + nb_candidates = 6; + break; + + case 4: + case 8: + nb_candidates = 2; + break; + + default: + DevParam(L, nCCE, rnti); + break; + } + + + LOG_D(MAC,"rnti %x, Yk = %d, nCCE %d (nCCE/L %d),nb_cand %d\n",rnti,Yk,nCCE,nCCE/L,nb_candidates); + + for (m = 0 ; m < nb_candidates ; m++) { + search_space_free = 1; + + for (l=0; l<L; l++) { + if (CCE_table[(((Yk+m)%(nCCE/L))*L) + l] == 1) { + search_space_free = 0; + break; + } + } + + if (search_space_free == 1) { + for (l=0; l<L; l++) + CCE_table[(((Yk+m)%(nCCE/L))*L)+l]=1; + + return(((Yk+m)%(nCCE/L))*L); + } + } + + return(-1); + } +} + + void dci_decoding_procedure0(LTE_UE_PDCCH **lte_ue_pdcch_vars, int do_common, uint8_t subframe, @@ -2691,7 +2794,7 @@ void dci_decoding_procedure0(LTE_UE_PDCCH **lte_ue_pdcch_vars, dci_alloc[*dci_cnt].dci_length = sizeof_bits; dci_alloc[*dci_cnt].rnti = crc; dci_alloc[*dci_cnt].L = L; - dci_alloc[*dci_cnt].nCCE = CCEind; + dci_alloc[*dci_cnt].firstCCE = CCEind; if (sizeof_bytes<=4) { dci_alloc[*dci_cnt].dci_pdu[3] = dci_decoded_output[0]; diff --git a/openair1/PHY/LTE_TRANSPORT/dci_tools.c b/openair1/PHY/LTE_TRANSPORT/dci_tools.c index 6d6f36bc63469c4b50efe756998158ffefb0c626..c9d68cd0aad7b4f3ade100c940d3ea8e658f81b9 100644 --- a/openair1/PHY/LTE_TRANSPORT/dci_tools.c +++ b/openair1/PHY/LTE_TRANSPORT/dci_tools.c @@ -453,7 +453,7 @@ uint32_t conv_1C_RIV(int32_t rballoc,uint32_t N_RB_DL) { } -int get_prb(int N_RB_DL,int odd_slot,int vrb,int Ngap) { +uint32_t get_prb(int N_RB_DL,int odd_slot,int vrb,int Ngap) { int offset; @@ -926,10 +926,15 @@ int generate_eNB_dlsch_params_from_dci(int frame, // printf("FDD 1A: mcs %d, rballoc %x,rv %d, NPRB %d\n",mcs,rballoc,rv,NPRB); } - dlsch0_harq = dlsch[0]->harq_processes[harq_pid]; - dlsch0_harq->rb_alloc[0] = localRIV2alloc_LUT6[rballoc]; + if (vrb_type==LOCALIZED) { + dlsch0_harq->rb_alloc[0] = localRIV2alloc_LUT6[rballoc]; + } + else { + LOG_E(PHY,"Distributed RB allocation not done yet\n"); + mac_xface->macphy_exit("exiting"); + } dlsch0_harq->vrb_type = vrb_type; dlsch0_harq->nb_rb = RIV2nb_rb_LUT6[rballoc];//NPRB; RIV_max = RIV_max6; @@ -960,7 +965,14 @@ int generate_eNB_dlsch_params_from_dci(int frame, dlsch0_harq = dlsch[0]->harq_processes[harq_pid]; - dlsch0_harq->rb_alloc[0] = localRIV2alloc_LUT25[rballoc]; + + if (vrb_type==LOCALIZED) { + dlsch0_harq->rb_alloc[0] = localRIV2alloc_LUT25[rballoc]; + } + else { + LOG_E(PHY,"Distributed RB allocation not done yet\n"); + mac_xface->macphy_exit("exiting"); + } dlsch0_harq->vrb_type = vrb_type; dlsch0_harq->nb_rb = RIV2nb_rb_LUT25[rballoc];//NPRB; RIV_max = RIV_max25; @@ -987,9 +999,16 @@ int generate_eNB_dlsch_params_from_dci(int frame, } dlsch0_harq = dlsch[0]->harq_processes[harq_pid]; + if (vrb_type==LOCALIZED) { + dlsch0_harq->rb_alloc[0] = localRIV2alloc_LUT50_0[rballoc]; + dlsch0_harq->rb_alloc[1] = localRIV2alloc_LUT50_1[rballoc]; + } + else { + LOG_E(PHY,"Distributed RB allocation not done yet\n"); + mac_xface->macphy_exit("exiting"); + } + - dlsch0_harq->rb_alloc[0] = localRIV2alloc_LUT50_0[rballoc]; - dlsch0_harq->rb_alloc[1] = localRIV2alloc_LUT50_1[rballoc]; dlsch0_harq->vrb_type = vrb_type; dlsch0_harq->nb_rb = RIV2nb_rb_LUT50[rballoc];//NPRB; RIV_max = RIV_max50; @@ -1017,10 +1036,17 @@ int generate_eNB_dlsch_params_from_dci(int frame, dlsch0_harq = dlsch[0]->harq_processes[harq_pid]; dlsch0_harq->vrb_type = vrb_type; - dlsch0_harq->rb_alloc[0] = localRIV2alloc_LUT100_0[rballoc]; - dlsch0_harq->rb_alloc[1] = localRIV2alloc_LUT100_1[rballoc]; - dlsch0_harq->rb_alloc[2] = localRIV2alloc_LUT100_2[rballoc]; - dlsch0_harq->rb_alloc[3] = localRIV2alloc_LUT100_3[rballoc]; + if (vrb_type==LOCALIZED) { + dlsch0_harq->rb_alloc[0] = localRIV2alloc_LUT100_0[rballoc]; + dlsch0_harq->rb_alloc[1] = localRIV2alloc_LUT100_1[rballoc]; + dlsch0_harq->rb_alloc[2] = localRIV2alloc_LUT100_2[rballoc]; + dlsch0_harq->rb_alloc[3] = localRIV2alloc_LUT100_3[rballoc]; + } + else { + LOG_E(PHY,"Distributed RB allocation not done yet\n"); + mac_xface->macphy_exit("exiting"); + } + dlsch0_harq->nb_rb = RIV2nb_rb_LUT100[rballoc];//NPRB; @@ -2682,17 +2708,17 @@ int generate_eNB_dlsch_params_from_dci(int frame, #ifdef DEBUG_DCI if (dlsch0) { - msg("dlsch0 eNB: dlsch0 %p\n",dlsch0); - msg("dlsch0 eNB: rnti %x\n",dlsch0->rnti); - msg("dlsch0 eNB: NBRB %d\n",dlsch0_harq->nb_rb); - msg("dlsch0 eNB: rballoc %x\n",dlsch0_harq->rb_alloc[0]); - msg("dlsch0 eNB: harq_pid %d\n",harq_pid); - msg("dlsch0 eNB: round %d\n",dlsch0_harq->round); - msg("dlsch0 eNB: rvidx %d\n",dlsch0_harq->rvidx); - msg("dlsch0 eNB: TBS %d (NPRB %d)\n",dlsch0_harq->TBS,NPRB); - msg("dlsch0 eNB: mcs %d\n",dlsch0_harq->mcs); - msg("dlsch0 eNB: tpmi %d\n",tpmi); - msg("dlsch0 eNB: mimo_mode %d\n",dlsch0_harq->mimo_mode); + printf("dlsch0 eNB: dlsch0 %p\n",dlsch0); + printf("dlsch0 eNB: rnti %x\n",dlsch0->rnti); + printf("dlsch0 eNB: NBRB %d\n",dlsch0_harq->nb_rb); + printf("dlsch0 eNB: rballoc %x\n",dlsch0_harq->rb_alloc[0]); + printf("dlsch0 eNB: harq_pid %d\n",harq_pid); + printf("dlsch0 eNB: round %d\n",dlsch0_harq->round); + printf("dlsch0 eNB: rvidx %d\n",dlsch0_harq->rvidx); + printf("dlsch0 eNB: TBS %d (NPRB %d)\n",dlsch0_harq->TBS,NPRB); + printf("dlsch0 eNB: mcs %d\n",dlsch0_harq->mcs); + printf("dlsch0 eNB: tpmi %d\n",tpmi); + printf("dlsch0 eNB: mimo_mode %d\n",dlsch0_harq->mimo_mode); } #endif @@ -5549,15 +5575,15 @@ int generate_ue_dlsch_params_from_dci(int frame, #ifdef DEBUG_DCI if (dlsch[0]) { - msg("PDSCH dlsch0 UE: rnti %x\n",dlsch[0]->rnti); - msg("PDSCH dlsch0 UE: NBRB %d\n",dlsch0_harq->nb_rb); - msg("PDSCH dlsch0 UE: rballoc %x\n",dlsch0_harq->rb_alloc[0]); - msg("PDSCH dlsch0 UE: harq_pid %d\n",harq_pid); - msg("PDSCH dlsch0 UE: DCINdi %d\n",dlsch0_harq->DCINdi); - msg("PDSCH dlsch0 UE: rvidx %d\n",dlsch0_harq->rvidx); - msg("PDSCH dlsch0 UE: TBS %d\n",dlsch0_harq->TBS); - msg("PDSCH dlsch0 UE: mcs %d\n",dlsch0_harq->mcs); - msg("PDSCH dlsch0 UE: pwr_off %d\n",dlsch0_harq->dl_power_off); + printf("PDSCH dlsch0 UE: rnti %x\n",dlsch[0]->rnti); + printf("PDSCH dlsch0 UE: NBRB %d\n",dlsch0_harq->nb_rb); + printf("PDSCH dlsch0 UE: rballoc %x\n",dlsch0_harq->rb_alloc_even[0]); + printf("PDSCH dlsch0 UE: harq_pid %d\n",harq_pid); + printf("PDSCH dlsch0 UE: DCINdi %d\n",dlsch0_harq->DCINdi); + printf("PDSCH dlsch0 UE: rvidx %d\n",dlsch0_harq->rvidx); + printf("PDSCH dlsch0 UE: TBS %d\n",dlsch0_harq->TBS); + printf("PDSCH dlsch0 UE: mcs %d\n",dlsch0_harq->mcs); + printf("PDSCH dlsch0 UE: pwr_off %d\n",dlsch0_harq->dl_power_off); } #endif diff --git a/openair1/PHY/LTE_TRANSPORT/defs.h b/openair1/PHY/LTE_TRANSPORT/defs.h index 55b9c4fe4453772d8177e36f92718b55e545834a..3cd608aa149b5268eb78ba26d6c7fbb53136aeea 100644 --- a/openair1/PHY/LTE_TRANSPORT/defs.h +++ b/openair1/PHY/LTE_TRANSPORT/defs.h @@ -273,6 +273,8 @@ typedef struct { uint8_t Mdlharq; /// MIMO transmission mode indicator for this sub-frame (for definition see 36-212 V8.6 2009-03, p.17) uint8_t Kmimo; + /// Nsoft parameter related to UE Category + uint32_t Nsoft; /// amplitude of PDSCH (compared to RS) in symbols without pilots int16_t sqrt_rho_a; /// amplitude of PDSCH (compared to RS) in symbols containing pilots @@ -583,13 +585,13 @@ typedef struct { /// UL RSSI per receive antenna int32_t UL_rssi[NB_ANTENNAS_RX]; /// PUCCH1a/b power (digital linear) - int32_t Po_PUCCH; + uint32_t Po_PUCCH; /// PUCCH1a/b power (dBm) int32_t Po_PUCCH_dBm; /// PUCCH1 power (digital linear), conditioned on below threshold - int32_t Po_PUCCH1_below; + uint32_t Po_PUCCH1_below; /// PUCCH1 power (digital linear), conditioned on above threshold - int32_t Po_PUCCH1_above; + uint32_t Po_PUCCH1_above; /// Indicator that Po_PUCCH has been updated by PHY int32_t Po_PUCCH_update; /// DL Wideband CQI index (2 TBs) @@ -700,6 +702,8 @@ typedef struct { uint8_t Mdlharq; /// MIMO transmission mode indicator for this sub-frame (for definition see 36-212 V8.6 2009-03, p.17) uint8_t Kmimo; + /// Nsoft parameter related to UE Category + uint32_t Nsoft; /// Maximum number of Turbo iterations uint8_t max_turbo_iterations; /// accumulated tx power adjustment for PUCCH @@ -744,7 +748,7 @@ typedef struct { /// Aggregation level uint8_t L; /// Position of first CCE of the dci - int nCCE; + int firstCCE; /// flag to indicate that this is a RA response boolean_t ra_flag; /// rnti diff --git a/openair1/PHY/LTE_TRANSPORT/dlsch_coding.c b/openair1/PHY/LTE_TRANSPORT/dlsch_coding.c index f051dc3ecfe9869bf993c4dfe06ea61e0edf793c..95af038ab0265ec9dd6832de6deb6950aacbffa0 100644 --- a/openair1/PHY/LTE_TRANSPORT/dlsch_coding.c +++ b/openair1/PHY/LTE_TRANSPORT/dlsch_coding.c @@ -117,7 +117,7 @@ void free_eNB_dlsch(LTE_eNB_DLSCH_t *dlsch) } -LTE_eNB_DLSCH_t *new_eNB_dlsch(unsigned char Kmimo,unsigned char Mdlharq,unsigned char N_RB_DL, uint8_t abstraction_flag) +LTE_eNB_DLSCH_t *new_eNB_dlsch(unsigned char Kmimo,unsigned char Mdlharq,uint32_t Nsoft,unsigned char N_RB_DL, uint8_t abstraction_flag) { LTE_eNB_DLSCH_t *dlsch; @@ -148,6 +148,7 @@ LTE_eNB_DLSCH_t *new_eNB_dlsch(unsigned char Kmimo,unsigned char Mdlharq,unsigne bzero(dlsch,sizeof(LTE_eNB_DLSCH_t)); dlsch->Kmimo = Kmimo; dlsch->Mdlharq = Mdlharq; + dlsch->Nsoft = Nsoft; for (i=0; i<10; i++) dlsch->harq_ids[i] = Mdlharq; @@ -400,7 +401,7 @@ int dlsch_encoding(unsigned char *a, dlsch->harq_processes[harq_pid]->w[r], dlsch->harq_processes[harq_pid]->e+r_offset, dlsch->harq_processes[harq_pid]->C, // C - NSOFT, // Nsoft, + dlsch->Nsoft, // Nsoft, dlsch->Mdlharq, dlsch->Kmimo, dlsch->harq_processes[harq_pid]->rvidx, diff --git a/openair1/PHY/LTE_TRANSPORT/dlsch_decoding.c b/openair1/PHY/LTE_TRANSPORT/dlsch_decoding.c index 6ab784aa18619a5652847ae72fc4e24d71e457a7..efcd868338602a7d49cba70a1709073d8efdbad2 100644 --- a/openair1/PHY/LTE_TRANSPORT/dlsch_decoding.c +++ b/openair1/PHY/LTE_TRANSPORT/dlsch_decoding.c @@ -81,7 +81,7 @@ void free_ue_dlsch(LTE_UE_DLSCH_t *dlsch) } } -LTE_UE_DLSCH_t *new_ue_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint8_t max_turbo_iterations,uint8_t N_RB_DL, uint8_t abstraction_flag) +LTE_UE_DLSCH_t *new_ue_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint32_t Nsoft,uint8_t max_turbo_iterations,uint8_t N_RB_DL, uint8_t abstraction_flag) { LTE_UE_DLSCH_t *dlsch; @@ -113,6 +113,7 @@ LTE_UE_DLSCH_t *new_ue_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint8_t max_turbo_ite memset(dlsch,0,sizeof(LTE_UE_DLSCH_t)); dlsch->Kmimo = Kmimo; dlsch->Mdlharq = Mdlharq; + dlsch->Nsoft = Nsoft; dlsch->max_turbo_iterations = max_turbo_iterations; for (i=0; i<Mdlharq; i++) { @@ -353,7 +354,7 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue, (uint8_t*)&dummy_w[r][0], dlsch_llr+r_offset, harq_process->C, - NSOFT, + dlsch->Nsoft, dlsch->Mdlharq, dlsch->Kmimo, harq_process->rvidx, diff --git a/openair1/PHY/LTE_TRANSPORT/dlsch_llr_computation.c b/openair1/PHY/LTE_TRANSPORT/dlsch_llr_computation.c index a35f89b8518baa2cdfc342a77045946702074621..f9f6002970ec433d7c962340c28a9954d379bcd3 100644 --- a/openair1/PHY/LTE_TRANSPORT/dlsch_llr_computation.c +++ b/openair1/PHY/LTE_TRANSPORT/dlsch_llr_computation.c @@ -662,14 +662,16 @@ int dlsch_qpsk_llr(LTE_DL_FRAME_PARMS *frame_parms, if ((symbol_mod==0) || (symbol_mod==(4-frame_parms->Ncp))) { if (frame_parms->mode1_flag==0) - len = (nb_rb*8)- (2*pbch_pss_sss_adjust/3); + len = (nb_rb*8) - (2*pbch_pss_sss_adjust/3); else len = (nb_rb*10) - (5*pbch_pss_sss_adjust/6); } else { len = (nb_rb*12) - pbch_pss_sss_adjust; } + // printf("dlsch_qpsk_llr: symbol %d,nb_rb %d, len %d,pbch_pss_sss_adjust %d\n",symbol,nb_rb,len,pbch_pss_sss_adjust); + for (i=0; i<len; i++) { *llr32 = *rxF; // printf("llr %d : (%d,%d)\n",i,((int16_t*)llr32)[0],((int16_t*)llr32)[1]); diff --git a/openair1/PHY/LTE_TRANSPORT/initial_sync.c b/openair1/PHY/LTE_TRANSPORT/initial_sync.c index bc2a00d8e6c16f587d3af3634a6d375cb3258bb3..b8be6305de316644fca26f37cded42365a0d2e2e 100644 --- a/openair1/PHY/LTE_TRANSPORT/initial_sync.c +++ b/openair1/PHY/LTE_TRANSPORT/initial_sync.c @@ -48,7 +48,7 @@ #include "gain_control.h" #endif -#if defined(OAI_USRP) || defined(EXMIMO) +#if defined(OAI_USRP) || defined(EXMIMO) || defined(OAI_LMSSDR) #include "common_lib.h" extern openair0_config_t openair0_cfg[]; #endif @@ -291,17 +291,10 @@ int initial_sync(PHY_VARS_UE *phy_vars_ue, runmode_t mode) frame_parms->Ncp=NORMAL; frame_parms->frame_type=FDD; init_frame_parms(frame_parms,1); - - // write_output("rxdata0.m","rxd0",phy_vars_ue->lte_ue_common_vars.rxdata[0],10*frame_parms->samples_per_tti,1,1); - - /*#ifdef OAI_USRP - for (aarx = 0; aarx<frame_parms->nb_antennas_rx;aarx++) { - rxdata128 = (__m128i*)phy_vars_ue->lte_ue_common_vars.rxdata[aarx]; - for (i=0; i<(frame_parms->samples_per_tti*10)>>2; i++) { - rxdata128[i] = _mm_srai_epi16(rxdata128[i],4); - } - } - #endif*/ + /* + write_output("rxdata0.m","rxd0",phy_vars_ue->lte_ue_common_vars.rxdata[0],10*frame_parms->samples_per_tti,1,1); + exit(-1); + */ sync_pos = lte_sync_time(phy_vars_ue->lte_ue_common_vars.rxdata, frame_parms, (int *)&phy_vars_ue->lte_ue_common_vars.eNb_id); @@ -336,8 +329,12 @@ int initial_sync(PHY_VARS_UE *phy_vars_ue, runmode_t mode) #else #ifndef OAI_USRP +#ifndef OAI_BLADERF +#ifndef OAI_LMSSDR phy_adjust_gain(phy_vars_ue,0); #endif +#endif +#endif #endif // SSS detection @@ -567,7 +564,7 @@ int initial_sync(PHY_VARS_UE *phy_vars_ue, runmode_t mode) phy_vars_ue->lte_frame_parms.phich_config_common.phich_duration, phich_string[phy_vars_ue->lte_frame_parms.phich_config_common.phich_resource], phy_vars_ue->lte_frame_parms.nb_antennas_tx_eNB); -#if defined(OAI_USRP) || defined(EXMIMO) +#if defined(OAI_USRP) || defined(EXMIMO) || defined(OAI_LMSSDR) LOG_I(PHY,"[UE %d] Frame %d Measured Carrier Frequency %.0f Hz (offset %d Hz)\n", phy_vars_ue->Mod_id, phy_vars_ue->frame_rx, diff --git a/openair1/PHY/LTE_TRANSPORT/print_stats.c b/openair1/PHY/LTE_TRANSPORT/print_stats.c index 53ca8759532d12c6004baa755601bd0eb2971d2f..8f6483a3e39a62dfbde7e542336ff79c88cb6662 100644 --- a/openair1/PHY/LTE_TRANSPORT/print_stats.c +++ b/openair1/PHY/LTE_TRANSPORT/print_stats.c @@ -50,7 +50,7 @@ #endif extern int mac_get_rrc_status(uint8_t Mod_id,uint8_t eNB_flag,uint8_t index); -#if defined(OAI_USRP) || defined(EXMIMO) +#if defined(OAI_USRP) || defined(EXMIMO) || defined(OAI_BLADERF) || defined(OAI_LMSSDR) #include "common_lib.h" extern openair0_config_t openair0_cfg[]; #endif @@ -67,11 +67,12 @@ int dump_ue_stats(PHY_VARS_UE *phy_vars_ue, char* buffer, int length, runmode_t if ((mode == normal_txrx) || (mode == no_L2_connect)) { len += sprintf(&buffer[len], "[UE_PROC] UE %d, RNTI %x\n",phy_vars_ue->Mod_id, phy_vars_ue->lte_ue_pdcch_vars[0]->crnti); - len += sprintf(&buffer[len],"[UE PROC] RSRP[0] %.2f dBm/RE, RSSI %.2f dBm, RSRQ[0] %.2f dB, N0 %d dBm/RE\n", + len += sprintf(&buffer[len],"[UE PROC] RSRP[0] %.2f dBm/RE, RSSI %.2f dBm, RSRQ[0] %.2f dB, N0 %d dBm/RE (NF %.1f dB)\n", 10*log10(phy_vars_ue->PHY_measurements.rsrp[0])-phy_vars_ue->rx_total_gain_dB, 10*log10(phy_vars_ue->PHY_measurements.rssi)-phy_vars_ue->rx_total_gain_dB, 10*log10(phy_vars_ue->PHY_measurements.rsrq[0]), - phy_vars_ue->PHY_measurements.n0_power_tot_dBm); + phy_vars_ue->PHY_measurements.n0_power_tot_dBm, + (double)phy_vars_ue->PHY_measurements.n0_power_tot_dBm+132.24); /* len += sprintf(&buffer[len], @@ -96,10 +97,10 @@ int dump_ue_stats(PHY_VARS_UE *phy_vars_ue, char* buffer, int length, runmode_t #ifdef EXMIMO len += sprintf(&buffer[len], "[UE PROC] RX Gain %d dB (LNA %d, vga %d dB)\n",phy_vars_ue->rx_total_gain_dB, openair0_cfg[0].rxg_mode[0],(int)openair0_cfg[0].rx_gain[0]); #endif -#ifdef OAI_USRP +#if defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR) len += sprintf(&buffer[len], "[UE PROC] RX Gain %d dB\n",phy_vars_ue->rx_total_gain_dB); #endif -#if defined(EXMIMO) || defined(OAI_USRP) +#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR) len += sprintf(&buffer[len], "[UE_PROC] Frequency offset %d Hz (%d), estimated carrier frequency %f Hz\n",phy_vars_ue->lte_ue_common_vars.freq_offset,openair_daq_vars.freq_offset,openair0_cfg[0].rx_freq[0]-phy_vars_ue->lte_ue_common_vars.freq_offset); #endif len += sprintf(&buffer[len], "[UE PROC] UE mode = %s (%d)\n",mode_string[phy_vars_ue->UE_mode[0]],phy_vars_ue->UE_mode[0]); @@ -573,12 +574,18 @@ int dump_eNB_stats(PHY_VARS_eNB *phy_vars_eNB, char* buffer, int length) phy_vars_eNB->PHY_measurements_eNB[eNB].n0_power_dB[0], phy_vars_eNB->PHY_measurements_eNB[eNB].n0_power_dB[1]); - len += sprintf(&buffer[len],"[eNB PROC] Subband I0: "); + len += sprintf(&buffer[len],"[eNB PROC] PRB I0 (%X.%X.%X.%X): ", + phy_vars_eNB->rb_mask_ul[0], + phy_vars_eNB->rb_mask_ul[1],phy_vars_eNB->rb_mask_ul[2],phy_vars_eNB->rb_mask_ul[3]); - for (i=0; i<25; i++) - len += sprintf(&buffer[len],"%2d ", - phy_vars_eNB->PHY_measurements_eNB[eNB].n0_subband_power_tot_dB[i]); + for (i=0; i<phy_vars_eNB->lte_frame_parms.N_RB_UL; i++) { + len += sprintf(&buffer[len],"%4d ", + phy_vars_eNB->PHY_measurements_eNB[eNB].n0_subband_power_tot_dBm[i]); + if ((i>0) && ((i%25) == 0)) + len += sprintf(&buffer[len],"\n ", + phy_vars_eNB->PHY_measurements_eNB[eNB].n0_subband_power_tot_dBm[i]); + } len += sprintf(&buffer[len],"\n"); len += sprintf(&buffer[len],"\n[eNB PROC] PERFORMANCE PARAMETERS\n"); /* @@ -634,11 +641,11 @@ int dump_eNB_stats(PHY_VARS_eNB *phy_vars_eNB, char* buffer, int length) dB_fixed(phy_vars_eNB->lte_eNB_pusch_vars[UE_id]->ulsch_power[1]), phy_vars_eNB->eNB_UE_stats[UE_id].UL_rssi[0], phy_vars_eNB->eNB_UE_stats[UE_id].UL_rssi[1], - dB_fixed(phy_vars_eNB->eNB_UE_stats[UE_id].Po_PUCCH)-phy_vars_eNB->rx_total_gain_eNB_dB, + dB_fixed(phy_vars_eNB->eNB_UE_stats[UE_id].Po_PUCCH/phy_vars_eNB->lte_frame_parms.N_RB_UL)-phy_vars_eNB->rx_total_gain_eNB_dB, phy_vars_eNB->lte_frame_parms.ul_power_control_config_common.p0_NominalPUCCH, - dB_fixed(phy_vars_eNB->eNB_UE_stats[UE_id].Po_PUCCH1_below)-phy_vars_eNB->rx_total_gain_eNB_dB, - dB_fixed(phy_vars_eNB->eNB_UE_stats[UE_id].Po_PUCCH1_above)-phy_vars_eNB->rx_total_gain_eNB_dB, - PUCCH1_THRES+phy_vars_eNB->PHY_measurements_eNB[0].n0_power_tot_dBm, //-dB_fixed(phy_vars_eNB->lte_frame_parms.N_RB_UL), + dB_fixed(phy_vars_eNB->eNB_UE_stats[UE_id].Po_PUCCH1_below/phy_vars_eNB->lte_frame_parms.N_RB_UL)-phy_vars_eNB->rx_total_gain_eNB_dB, + dB_fixed(phy_vars_eNB->eNB_UE_stats[UE_id].Po_PUCCH1_above/phy_vars_eNB->lte_frame_parms.N_RB_UL)-phy_vars_eNB->rx_total_gain_eNB_dB, + PUCCH1_THRES+phy_vars_eNB->PHY_measurements_eNB[0].n0_power_tot_dBm-dB_fixed(phy_vars_eNB->lte_frame_parms.N_RB_UL), phy_vars_eNB->eNB_UE_stats[UE_id].sector); for(i=0; i<8; i++) diff --git a/openair1/PHY/LTE_TRANSPORT/proto.h b/openair1/PHY/LTE_TRANSPORT/proto.h index cb127ead4821063951488a6de0dcc7e9f6ee4ded..9afea790b327c6efd15a53949a979f74243c8f7d 100644 --- a/openair1/PHY/LTE_TRANSPORT/proto.h +++ b/openair1/PHY/LTE_TRANSPORT/proto.h @@ -56,15 +56,16 @@ void free_eNB_dlsch(LTE_eNB_DLSCH_t *dlsch); void clean_eNb_dlsch(LTE_eNB_DLSCH_t *dlsch, uint8_t abstraction_flag); -/** \fn new_eNB_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint8_t abstraction_flag) +/** \fn new_eNB_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint32_t Nsoft,uint8_t abstraction_flag) \brief This function allocates structures for a particular DLSCH at eNB @returns Pointer to DLSCH to be removed @param Kmimo Kmimo factor from 36-212/36-213 @param Mdlharq Maximum number of HARQ rounds (36-212/36-213) + @param Nsoft Soft-LLR buffer size from UE-Category @params N_RB_DL total number of resource blocks (determine the operating BW) @param abstraction_flag Flag to indicate abstracted interface */ -LTE_eNB_DLSCH_t *new_eNB_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint8_t N_RB_DL, uint8_t abstraction_flag); +LTE_eNB_DLSCH_t *new_eNB_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint32_t Nsoft,uint8_t N_RB_DL, uint8_t abstraction_flag); /** \fn free_ue_dlsch(LTE_UE_DLSCH_t *dlsch) \brief This function frees memory allocated for a particular DLSCH at UE @@ -72,11 +73,16 @@ LTE_eNB_DLSCH_t *new_eNB_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint8_t N_RB_DL, ui */ void free_ue_dlsch(LTE_UE_DLSCH_t *dlsch); -LTE_eNB_ULSCH_t *new_eNB_ulsch(uint8_t Mdlharq,uint8_t max_turbo_iterations,uint8_t N_RB_UL, uint8_t abstraction_flag); - -LTE_UE_DLSCH_t *new_ue_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint8_t max_turbo_iterations,uint8_t N_RB_DL, uint8_t abstraction_flag); - -LTE_UE_ULSCH_t *new_ue_ulsch(unsigned char Mdlharq,unsigned char N_RB_UL, uint8_t abstraction_flag); +/** \fn new_ue_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint32_t Nsoft,uint8_t abstraction_flag) + \brief This function allocates structures for a particular DLSCH at eNB + @returns Pointer to DLSCH to be removed + @param Kmimo Kmimo factor from 36-212/36-213 + @param Mdlharq Maximum number of HARQ rounds (36-212/36-213) + @param Nsoft Soft-LLR buffer size from UE-Category + @params N_RB_DL total number of resource blocks (determine the operating BW) + @param abstraction_flag Flag to indicate abstracted interface +*/ +LTE_UE_DLSCH_t *new_ue_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint32_t Nsoft,uint8_t max_turbo_iterations,uint8_t N_RB_DL, uint8_t abstraction_flag); void clean_eNb_ulsch(LTE_eNB_ULSCH_t *ulsch, uint8_t abstraction_flag); @@ -1233,11 +1239,20 @@ uint32_t get_TBS_DL(uint8_t mcs, uint16_t nb_rb); uint32_t get_TBS_UL(uint8_t mcs, uint16_t nb_rb); /* \brief Return bit-map of resource allocation for a given DCI rballoc (RIV format) and vrb type + @param N_RB_DL number of PRB on DL + @param indicator for even/odd slot + @param vrb vrb index + @param Ngap Gap indicator +*/ +uint32_t get_prb(int N_RB_DL,int odd_slot,int vrb,int Ngap); + +/* \brief Return prb for a given vrb index @param vrb_type VRB type (0=localized,1=distributed) @param rb_alloc_dci rballoc field from DCI */ uint32_t get_rballoc(vrb_t vrb_type,uint16_t rb_alloc_dci); + /* \brief Return bit-map of resource allocation for a given DCI rballoc (RIV format) and vrb type @returns Transmission mode (1-7) */ @@ -1577,6 +1592,12 @@ uint16_t computeRIV(uint16_t N_RB_DL,uint16_t RBstart,uint16_t Lcrbs); uint32_t pmi_extend(LTE_DL_FRAME_PARMS *frame_parms,uint8_t wideband_pmi); +int get_nCCE_offset_l1(int *CCE_table, + const unsigned char L, + const int nCCE, + const int common_dci, + const unsigned short rnti, + const unsigned char subframe); uint16_t get_nCCE(uint8_t num_pdcch_symbols,LTE_DL_FRAME_PARMS *frame_parms,uint8_t mi); @@ -1584,7 +1605,7 @@ uint16_t get_nquad(uint8_t num_pdcch_symbols,LTE_DL_FRAME_PARMS *frame_parms,uin uint8_t get_mi(LTE_DL_FRAME_PARMS *frame,uint8_t subframe); -uint16_t get_nCCE_max(uint8_t Mod_id,uint8_t CC_id); +uint16_t get_nCCE_mac(uint8_t Mod_id,uint8_t CC_id,int num_pdcch_symbols,int subframe); uint8_t get_num_pdcch_symbols(uint8_t num_dci,DCI_ALLOC_t *dci_alloc,LTE_DL_FRAME_PARMS *frame_parms,uint8_t subframe); @@ -1637,22 +1658,22 @@ void generate_pucch_emul(PHY_VARS_UE *phy_vars_ue, uint8_t subframe); -int32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB, - PUCCH_FMT_t fmt, - uint8_t UE_id, - uint16_t n1_pucch, - uint16_t n2_pucch, - uint8_t shortened_format, - uint8_t *payload, - uint8_t subframe, - uint8_t pucch1_thres); +uint32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB, + PUCCH_FMT_t fmt, + uint8_t UE_id, + uint16_t n1_pucch, + uint16_t n2_pucch, + uint8_t shortened_format, + uint8_t *payload, + uint8_t subframe, + uint8_t pucch1_thres); int32_t rx_pucch_emul(PHY_VARS_eNB *phy_vars_eNB, - uint8_t UE_index, - PUCCH_FMT_t fmt, - uint8_t n1_pucch_sel, - uint8_t *payload, - uint8_t subframe); + uint8_t UE_index, + PUCCH_FMT_t fmt, + uint8_t n1_pucch_sel, + uint8_t *payload, + uint8_t subframe); /*! diff --git a/openair1/PHY/LTE_TRANSPORT/pucch.c b/openair1/PHY/LTE_TRANSPORT/pucch.c index 2ed5694dd190a8c87a95e8d9dc89cec91cdb0085..837c99b07371110fc5a2c89c6b3e2fc6dadff4f9 100644 --- a/openair1/PHY/LTE_TRANSPORT/pucch.c +++ b/openair1/PHY/LTE_TRANSPORT/pucch.c @@ -430,15 +430,15 @@ void generate_pucch_emul(PHY_VARS_UE *phy_vars_ue, } -int32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB, - PUCCH_FMT_t fmt, - uint8_t UE_id, - uint16_t n1_pucch, - uint16_t n2_pucch, - uint8_t shortened_format, - uint8_t *payload, - uint8_t subframe, - uint8_t pucch1_thres) +uint32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB, + PUCCH_FMT_t fmt, + uint8_t UE_id, + uint16_t n1_pucch, + uint16_t n2_pucch, + uint8_t shortened_format, + uint8_t *payload, + uint8_t subframe, + uint8_t pucch1_thres) { @@ -446,11 +446,11 @@ int32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB, LTE_eNB_COMMON *eNB_common_vars = &phy_vars_eNB->lte_eNB_common_vars; LTE_DL_FRAME_PARMS *frame_parms = &phy_vars_eNB->lte_frame_parms; // PUCCH_CONFIG_DEDICATED *pucch_config_dedicated = &phy_vars_eNB->pucch_config_dedicated[UE_id]; - int8_t sigma2_dB = phy_vars_eNB->PHY_measurements_eNB[0].n0_power_dB[0]; - int32_t *Po_PUCCH = &(phy_vars_eNB->eNB_UE_stats[UE_id].Po_PUCCH); + int8_t sigma2_dB = phy_vars_eNB->PHY_measurements_eNB[0].n0_subband_power_tot_dB[6]; + uint32_t *Po_PUCCH = &(phy_vars_eNB->eNB_UE_stats[UE_id].Po_PUCCH); int32_t *Po_PUCCH_dBm = &(phy_vars_eNB->eNB_UE_stats[UE_id].Po_PUCCH_dBm); - int32_t *Po_PUCCH1_below = &(phy_vars_eNB->eNB_UE_stats[UE_id].Po_PUCCH1_below); - int32_t *Po_PUCCH1_above = &(phy_vars_eNB->eNB_UE_stats[UE_id].Po_PUCCH1_above); + uint32_t *Po_PUCCH1_below = &(phy_vars_eNB->eNB_UE_stats[UE_id].Po_PUCCH1_below); + uint32_t *Po_PUCCH1_above = &(phy_vars_eNB->eNB_UE_stats[UE_id].Po_PUCCH1_above); int32_t *Po_PUCCH_update = &(phy_vars_eNB->eNB_UE_stats[UE_id].Po_PUCCH_update); uint32_t u,v,n,aa; uint32_t z[12*14]; @@ -468,7 +468,7 @@ int32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB, uint32_t symbol_offset; int16_t stat_ref_re,stat_ref_im,*cfo,chest_re,chest_im; int32_t stat_re=0,stat_im=0; - int32_t stat,stat_max=0; + uint32_t stat,stat_max=0; uint8_t deltaPUCCH_Shift = frame_parms->pucch_config_common.deltaPUCCH_Shift; uint8_t NRB2 = frame_parms->pucch_config_common.nRB_CQI; @@ -478,6 +478,7 @@ int32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB, uint32_t u1 = (frame_parms->Nid_cell + frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.grouphop[1+(subframe<<1)]) % 30; uint32_t v0=frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.seqhop[subframe<<1]; uint32_t v1=frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.seqhop[1+(subframe<<1)]; + int chL; if (first_call == 1) { for (i=0;i<10;i++) { @@ -508,6 +509,7 @@ int32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB, } */ + if ((deltaPUCCH_Shift==0) || (deltaPUCCH_Shift>3)) { LOG_E(PHY,"[eNB] rx_pucch: Illegal deltaPUCCH_shift %d (should be 1,2,3)\n",deltaPUCCH_Shift); return(-1); @@ -737,30 +739,35 @@ int32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB, cfo = (frame_parms->Ncp==0) ? &cfo_pucch_np[14*phase] : &cfo_pucch_ep[12*phase]; for (l=0; l<(nsymb>>1); l++) { - stat_re += ((rxcomp[aa][off]*(int32_t)cfo[l<<1])>>15) - ((rxcomp[aa][1+off]*(int32_t)cfo[1+(l<<1)])>>15); - stat_im += ((rxcomp[aa][off]*(int32_t)cfo[1+(l<<1)])>>15) + ((rxcomp[aa][1+off]*(int32_t)cfo[(l<<1)])>>15); + stat_re += (((rxcomp[aa][off]*(int32_t)cfo[l<<1])>>15) - ((rxcomp[aa][1+off]*(int32_t)cfo[1+(l<<1)])>>15))/nsymb; + stat_im += (((rxcomp[aa][off]*(int32_t)cfo[1+(l<<1)])>>15) + ((rxcomp[aa][1+off]*(int32_t)cfo[(l<<1)])>>15))/nsymb; off+=2; + + #ifdef DEBUG_PUCCH_RX - LOG_D(PHY,"[eNB] PUCCH subframe %d (%d,%d) => (%d,%d) x (%d,%d) : (%d,%d)\n",subframe,l,re, + LOG_D(PHY,"[eNB] PUCCH subframe %d (%d,%d,%d) => (%d,%d) x (%d,%d) : (%d,%d) , stat %d\n",subframe,phase,l,re, rxcomp[aa][off],rxcomp[aa][1+off], cfo[l<<1],cfo[1+(l<<1)], - stat_re,stat_im); + stat_re,stat_im,stat); #endif } for (l2=0,l=(nsymb>>1); l<(nsymb-1); l++,l2++) { - stat_re += ((rxcomp[aa][off]*(int32_t)cfo[l2<<1])>>15) - ((rxcomp[aa][1+off]*(int32_t)cfo[1+(l2<<1)])>>15); - stat_im += ((rxcomp[aa][off]*(int32_t)cfo[1+(l2<<1)])>>15) + ((rxcomp[aa][1+off]*(int32_t)cfo[(l2<<1)])>>15); + stat_re += (((rxcomp[aa][off]*(int32_t)cfo[l2<<1])>>15) - ((rxcomp[aa][1+off]*(int32_t)cfo[1+(l2<<1)])>>15))/nsymb; + stat_im += (((rxcomp[aa][off]*(int32_t)cfo[1+(l2<<1)])>>15) + ((rxcomp[aa][1+off]*(int32_t)cfo[(l2<<1)])>>15))/nsymb; off+=2; + #ifdef DEBUG_PUCCH_RX - LOG_D(PHY,"[eNB] PUCCH subframe %d (%d,%d) => (%d,%d) x (%d,%d) : (%d,%d)\n",subframe,l2,re, + LOG_D(PHY,"[eNB] PUCCH subframe %d (%d,%d,%d) => (%d,%d) x (%d,%d) : (%d,%d), stat %d\n",subframe,phase,l2,re, rxcomp[aa][off],rxcomp[aa][1+off], cfo[l2<<1],cfo[1+(l2<<1)], - stat_re,stat_im); + stat_re,stat_im,stat); #endif + } - stat += (stat_re*stat_re) + (stat_im*stat_im); + stat += ((stat_re*stat_re) + (stat_im*stat_im)); + } //re } // aa @@ -772,16 +779,18 @@ int32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB, } //phase - stat_max /= (nsymb*12); // normalize to energy per symbol and RE + stat_max *= nsymb; // normalize to energy per symbol + stat_max /= (frame_parms->N_RB_UL*12); // #ifdef DEBUG_PUCCH_RX LOG_D(PHY,"[eNB] PUCCH: stat %d, stat_max %d, phase_max %d\n", stat,stat_max,phase_max); #endif #ifdef DEBUG_PUCCH_RX - LOG_D(PHY,"[eNB] PUCCH fmt0: stat_max : %d, sigma2_dB %d (%d, %d), phase_max : %d\n",dB_fixed(stat_max),sigma2_dB,phy_vars_eNB->PHY_measurements_eNB[0].n0_power_tot_dBm,pucch1_thres,phase_max); + LOG_I(PHY,"[eNB] PUCCH fmt1: stat_max : %d, sigma2_dB %d (%d, %d), phase_max : %d\n",dB_fixed(stat_max),sigma2_dB,phy_vars_eNB->PHY_measurements_eNB[0].n0_subband_power_tot_dBm[6],pucch1_thres,phase_max); #endif phy_vars_eNB->pucch1_stats[UE_id][(subframe<<10)+phy_vars_eNB->pucch1_stats_cnt[UE_id][subframe]] = stat_max; + phy_vars_eNB->pucch1_stats_thres[UE_id][(subframe<<10)+phy_vars_eNB->pucch1_stats_cnt[UE_id][subframe]] = sigma2_dB+pucch1_thres; phy_vars_eNB->pucch1_stats_cnt[UE_id][subframe] = (phy_vars_eNB->pucch1_stats_cnt[UE_id][subframe]+1)&1023; /* @@ -798,13 +807,13 @@ int32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB, if (sigma2_dB<(dB_fixed(stat_max)-pucch1_thres)) { *payload = 1; *Po_PUCCH1_above = ((*Po_PUCCH1_above<<9) + (stat_max<<9)+1024)>>10; - + //LOG_I(PHY,"[eNB] PUCCH fmt1: stat_max : %d, sigma2_dB %d (%d, %d), phase_max : %d\n",dB_fixed(stat_max),sigma2_dB,phy_vars_eNB->PHY_measurements_eNB[0].n0_power_tot_dBm,pucch1_thres,phase_max); } else { *payload = 0; *Po_PUCCH1_below = ((*Po_PUCCH1_below<<9) + (stat_max<<9)+1024)>>10; } - LOG_D(PHY,"[eNB] PUCCH fmt0: stat_max : %d, sigma2_dB %d (I0 %d dBm, thres %d), Po_PUCCH1_below/above : %d / %d\n",dB_fixed(stat_max),sigma2_dB,phy_vars_eNB->PHY_measurements_eNB[0].n0_power_tot_dBm,pucch1_thres,dB_fixed(*Po_PUCCH1_below),dB_fixed(*Po_PUCCH1_above)); + LOG_D(PHY,"[eNB] PUCCH fmt1: stat_max : %d, sigma2_dB %d (I0 %d dBm, thres %d), Po_PUCCH1_below/above : %d / %d\n",dB_fixed(stat_max),sigma2_dB,phy_vars_eNB->PHY_measurements_eNB[0].n0_subband_power_tot_dBm[6],pucch1_thres,dB_fixed(*Po_PUCCH1_below),dB_fixed(*Po_PUCCH1_above)); *Po_PUCCH_update = 1; } else if ((fmt == pucch_format1a)||(fmt == pucch_format1b)) { @@ -813,7 +822,7 @@ int32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB, LOG_I(PHY,"Doing PUCCH detection for format 1a/1b\n"); #endif - for (phase=0; phase<7; phase++) { + for (phase=3;phase<4;phase++){ //phase=0; phase<7; phase++) { stat=0; for (aa=0; aa<frame_parms->nb_antennas_rx; aa++) { @@ -844,6 +853,9 @@ int32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB, #endif } + + + for (l2=0,l=(nsymb>>1); l<(nsymb-1); l++,l2++) { if ((l2<2) || ((l2>(nsymb>>1) - 3)) ) { // data symbols stat_re += ((rxcomp[aa][off]*(int32_t)cfo[l2<<1])>>15) - ((rxcomp[aa][1+off]*(int32_t)cfo[1+(l2<<1)])>>15); @@ -863,34 +875,36 @@ int32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB, } - stat += (((stat_re*stat_re)) + ((stat_im*stat_im)) + - ((stat_ref_re*stat_ref_re)) + ((stat_ref_im*stat_ref_im))); #ifdef DEBUG_PUCCH_RX LOG_D(PHY,"aa%d re %d : phase %d : stat %d\n",aa,re,phase,stat); #endif + + stat += ((((stat_re*stat_re)) + ((stat_im*stat_im)) + + ((stat_ref_re*stat_ref_re)) + ((stat_ref_im*stat_ref_im)))/nsymb); + + } //re } // aa #ifdef DEBUG_PUCCH_RX - LOG_I(PHY,"phase %d : stat %d\n",phase,stat); + LOG_I(PHY,"Format 1A: phase %d : stat %d\n",phase,stat); #endif - if (stat>stat_max) { stat_max = stat; phase_max = phase; } } //phase - stat_max/=(nsymb*12); //normalize to energy per symbol and RE -#ifdef DEBUG_PUCCH_RX - LOG_I(PHY,"[eNB] PUCCH fmt1: stat_max : %d, phase_max : %d\n",stat_max,phase_max); -#endif + stat_max/=(12); //normalize to energy per symbol and RE + //#ifdef DEBUG_PUCCH_RX + LOG_D(PHY,"[eNB] PUCCH fmt1a/b: stat_max : %d, phase_max : %d\n",stat_max,phase_max); + //#endif stat_re=0; stat_im=0; LOG_D(PHY,"PUCCH1A : Po_PUCCH before %d dB (%d)\n",dB_fixed(*Po_PUCCH),*Po_PUCCH); - *Po_PUCCH = ((*Po_PUCCH<<9) + (stat_max<<9)+1024)>>10; - *Po_PUCCH_dBm = dB_fixed(*Po_PUCCH) - phy_vars_eNB->rx_total_gain_eNB_dB; + *Po_PUCCH = ((*Po_PUCCH>>1) + ((stat_max)>>1)); + *Po_PUCCH_dBm = dB_fixed(*Po_PUCCH/frame_parms->N_RB_UL) - phy_vars_eNB->rx_total_gain_eNB_dB; *Po_PUCCH_update = 1; LOG_D(PHY,"PUCCH1A : stat_max %d (%d,%d,%d) => Po_PUCCH %d\n", @@ -906,6 +920,8 @@ int32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB, *Po_PUCCH = ((*Po_PUCCH*1023) + stat_max)>>10; + chL = (nsymb>>1)-4; + for (aa=0; aa<frame_parms->nb_antennas_rx; aa++) { for (re=0; re<12; re++) { chest_re=0; @@ -915,8 +931,8 @@ int32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB, // channel estimate for first slot for (l=2; l<(nsymb>>1)-2; l++) { off=(re<<1) + (24*l); - chest_re += ((rxcomp[aa][off]*(int32_t)cfo[l<<1])>>15) - ((rxcomp[aa][1+off]*(int32_t)cfo[1+(l<<1)])>>15); - chest_im += ((rxcomp[aa][off]*(int32_t)cfo[1+(l<<1)])>>15) + ((rxcomp[aa][1+off]*(int32_t)cfo[(l<<1)])>>15); + chest_re += (((rxcomp[aa][off]*(int32_t)cfo[l<<1])>>15) - ((rxcomp[aa][1+off]*(int32_t)cfo[1+(l<<1)])>>15))/chL; + chest_im += (((rxcomp[aa][off]*(int32_t)cfo[1+(l<<1)])>>15) + ((rxcomp[aa][1+off]*(int32_t)cfo[(l<<1)])>>15))/chL; } #ifdef DEBUG_PUCCH_RX @@ -928,8 +944,8 @@ int32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB, off=(re<<1) + (24*l); tmp_re = ((rxcomp[aa][off]*(int32_t)cfo[l<<1])>>15) - ((rxcomp[aa][1+off]*(int32_t)cfo[1+(l<<1)])>>15); tmp_im = ((rxcomp[aa][off]*(int32_t)cfo[1+(l<<1)])>>15) + ((rxcomp[aa][1+off]*(int32_t)cfo[(l<<1)])>>15); - stat_re += ((tmp_re*chest_re)>>15) + ((tmp_im*chest_im)>>15); - stat_im += ((tmp_re*chest_im)>>15) - ((tmp_im*chest_re)>>15); + stat_re += (((tmp_re*chest_re)>>15) + ((tmp_im*chest_im)>>15))/4; + stat_im += (((tmp_re*chest_im)>>15) - ((tmp_im*chest_re)>>15))/4; off+=2; #ifdef DEBUG_PUCCH_RX LOG_D(PHY,"[eNB] PUCCH subframe %d (%d,%d) => (%d,%d) x (%d,%d) : (%d,%d)\n",subframe,l,re, @@ -943,8 +959,8 @@ int32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB, off=(re<<1) + (24*l); tmp_re = ((rxcomp[aa][off]*(int32_t)cfo[l<<1])>>15) - ((rxcomp[aa][1+off]*(int32_t)cfo[1+(l<<1)])>>15); tmp_im = ((rxcomp[aa][off]*(int32_t)cfo[1+(l<<1)])>>15) + ((rxcomp[aa][1+off]*(int32_t)cfo[(l<<1)])>>15); - stat_re += ((tmp_re*chest_re)>>15) + ((tmp_im*chest_im)>>15); - stat_im += ((tmp_re*chest_im)>>15) - ((tmp_im*chest_re)>>15); + stat_re += (((tmp_re*chest_re)>>15) + ((tmp_im*chest_im)>>15)/4); + stat_im += (((tmp_re*chest_im)>>15) - ((tmp_im*chest_re)>>15)/4); off+=2; #ifdef DEBUG_PUCCH_RX LOG_D(PHY,"[eNB] PUCCH subframe %d (%d,%d) => (%d,%d) x (%d,%d) : (%d,%d)\n",subframe,l,re, @@ -960,8 +976,8 @@ int32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB, // channel estimate for second slot for (l=2; l<(nsymb>>1)-2; l++) { off=(re<<1) + (24*l) + (nsymb>>1)*24; - chest_re += ((rxcomp[aa][off]*(int32_t)cfo[l<<1])>>15) - ((rxcomp[aa][1+off]*(int32_t)cfo[1+(l<<1)])>>15); - chest_im += ((rxcomp[aa][off]*(int32_t)cfo[1+(l<<1)])>>15) + ((rxcomp[aa][1+off]*(int32_t)cfo[(l<<1)])>>15); + chest_re += (((rxcomp[aa][off]*(int32_t)cfo[l<<1])>>15) - ((rxcomp[aa][1+off]*(int32_t)cfo[1+(l<<1)])>>15))/chL; + chest_im += (((rxcomp[aa][off]*(int32_t)cfo[1+(l<<1)])>>15) + ((rxcomp[aa][1+off]*(int32_t)cfo[(l<<1)])>>15))/chL; } #ifdef DEBUG_PUCCH_RX @@ -973,8 +989,8 @@ int32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB, off=(re<<1) + (24*l) + (nsymb>>1)*24; tmp_re = ((rxcomp[aa][off]*(int32_t)cfo[l<<1])>>15) - ((rxcomp[aa][1+off]*(int32_t)cfo[1+(l<<1)])>>15); tmp_im = ((rxcomp[aa][off]*(int32_t)cfo[1+(l<<1)])>>15) + ((rxcomp[aa][1+off]*(int32_t)cfo[(l<<1)])>>15); - stat_re += ((tmp_re*chest_re)>>15) + ((tmp_im*chest_im)>>15); - stat_im += ((tmp_re*chest_im)>>15) - ((tmp_im*chest_re)>>15); + stat_re += (((tmp_re*chest_re)>>15) + ((tmp_im*chest_im)>>15))/4; + stat_im += (((tmp_re*chest_im)>>15) - ((tmp_im*chest_re)>>15))/4; off+=2; #ifdef DEBUG_PUCCH_RX LOG_D(PHY,"[PHY][eNB] PUCCH subframe %d (%d,%d) => (%d,%d) x (%d,%d) : (%d,%d)\n",subframe,l,re, @@ -988,8 +1004,8 @@ int32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB, off=(re<<1) + (24*l) + (nsymb>>1)*24; tmp_re = ((rxcomp[aa][off]*(int32_t)cfo[l<<1])>>15) - ((rxcomp[aa][1+off]*(int32_t)cfo[1+(l<<1)])>>15); tmp_im = ((rxcomp[aa][off]*(int32_t)cfo[1+(l<<1)])>>15) + ((rxcomp[aa][1+off]*(int32_t)cfo[(l<<1)])>>15); - stat_re += ((tmp_re*chest_re)>>9) + ((tmp_im*chest_im)>>9); - stat_im += ((tmp_re*chest_im)>>9) - ((tmp_im*chest_re)>>9); + stat_re += (((tmp_re*chest_re)>>15) + ((tmp_im*chest_im)>>15))/4; + stat_im += (((tmp_re*chest_im)>>15) - ((tmp_im*chest_re)>>15))/4; off+=2; #ifdef DEBUG_PUCCH_RX LOG_D(PHY,"[PHY][eNB] PUCCH subframe %d (%d,%d) => (%d,%d) x (%d,%d) : (%d,%d)\n",subframe,l,re, @@ -1007,20 +1023,27 @@ int32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB, } // aa #ifdef DEBUG_PUCCH_RX - LOG_D(PHY,"PUCCH 1a/b: subframe %d : stat %d,%d (pos %d)\n",subframe,stat_re,stat_im, + LOG_I(PHY,"PUCCH 1a/b: subframe %d : stat %d,%d (pos %d)\n",subframe,stat_re,stat_im, (subframe<<10) + (phy_vars_eNB->pucch1ab_stats_cnt[UE_id][subframe])); #endif - - ((int16_t*)&phy_vars_eNB->pucch1ab_stats[UE_id][(subframe<<10) + (phy_vars_eNB->pucch1_stats_cnt[UE_id][subframe])])[0] = stat_re; - ((int16_t*)&phy_vars_eNB->pucch1ab_stats[UE_id][(subframe<<10) + (phy_vars_eNB->pucch1_stats_cnt[UE_id][subframe])])[1] = stat_im; - phy_vars_eNB->pucch1ab_stats_cnt[UE_id][subframe] = (phy_vars_eNB->pucch1ab_stats_cnt[UE_id][subframe]+1)&1023; + phy_vars_eNB->pucch1ab_stats[UE_id][(subframe<<11) + 2*(phy_vars_eNB->pucch1ab_stats_cnt[UE_id][subframe])] = (stat_re); + phy_vars_eNB->pucch1ab_stats[UE_id][(subframe<<11) + 1+2*(phy_vars_eNB->pucch1ab_stats_cnt[UE_id][subframe])] = (stat_im); + phy_vars_eNB->pucch1ab_stats_cnt[UE_id][subframe] = (phy_vars_eNB->pucch1ab_stats_cnt[UE_id][subframe]+1)&1023; + + + *payload = (stat_re<0) ? 1 : 0; if (fmt==pucch_format1b) *(1+payload) = (stat_im<0) ? 1 : 0; } else { // insufficient energy on PUCCH so NAK *payload = 0; + ((int16_t*)&phy_vars_eNB->pucch1ab_stats[UE_id][(subframe<<10) + (phy_vars_eNB->pucch1ab_stats_cnt[UE_id][subframe])])[0] = (int16_t)(stat_re); + ((int16_t*)&phy_vars_eNB->pucch1ab_stats[UE_id][(subframe<<10) + (phy_vars_eNB->pucch1ab_stats_cnt[UE_id][subframe])])[1] = (int16_t)(stat_im); + phy_vars_eNB->pucch1ab_stats_cnt[UE_id][subframe] = (phy_vars_eNB->pucch1ab_stats_cnt[UE_id][subframe]+1)&1023; + + *payload = (stat_re<0) ? 1 : 0; if (fmt==pucch_format1b) *(1+payload) = 0; @@ -1054,7 +1077,7 @@ int32_t rx_pucch_emul(PHY_VARS_eNB *phy_vars_eNB, } if (UE_id==NB_UE_INST) { - LOG_E(PHY,"rx_pucch_emul: FATAL, didn't find UE with rnti %x\n",rnti); + LOG_W(PHY,"rx_pucch_emul: Didn't find UE with rnti %x\n",rnti); return(-1); } diff --git a/openair1/PHY/LTE_TRANSPORT/ulsch_demodulation.c b/openair1/PHY/LTE_TRANSPORT/ulsch_demodulation.c index 606b2692d5bbe35b9b0d729099f90f8451faf465..f2e4dea58aa75c2264ef7d502e7a169d1ec3e7e1 100644 --- a/openair1/PHY/LTE_TRANSPORT/ulsch_demodulation.c +++ b/openair1/PHY/LTE_TRANSPORT/ulsch_demodulation.c @@ -1657,8 +1657,15 @@ void rx_ulsch(PHY_VARS_eNB *phy_vars_eNB, } } else { for (i=0; i<frame_parms->nb_antennas_rx; i++) { + /* eNB_pusch_vars->ulsch_power[i] = signal_energy_nodc(eNB_pusch_vars->drs_ch_estimates[eNB_id][i], ulsch[UE_id]->harq_processes[harq_pid]->nb_rb*12)*rx_power_correction; + + */ + + eNB_pusch_vars->ulsch_power[i] = signal_energy_nodc(eNB_pusch_vars->drs_ch_estimates[eNB_id][i], + ulsch[UE_id]->harq_processes[harq_pid]->nb_rb*12); + #ifdef LOCALIZATION eNB_pusch_vars->subcarrier_power = (int32_t *)malloc(ulsch[UE_id]->harq_processes[harq_pid]->nb_rb*12*sizeof(int32_t)); eNB_pusch_vars->active_subcarrier = subcarrier_energy(eNB_pusch_vars->drs_ch_estimates[eNB_id][i], diff --git a/openair1/PHY/MODULATION/defs.h b/openair1/PHY/MODULATION/defs.h index 8d45c15e0031ddca60c3be49667f1c1c32d40d6a..6005d6d49accf71413e67ee33e470db42b6db29d 100644 --- a/openair1/PHY/MODULATION/defs.h +++ b/openair1/PHY/MODULATION/defs.h @@ -34,12 +34,12 @@ */ /** -\fn void PHY_ofdm_mod(int *input,int *output,unsigned char log2fftsize,unsigned char nb_symbols,unsigned short nb_prefix_samples,Extension_t etype) +\fn void PHY_ofdm_mod(int *input,int *output,int fftsize,unsigned char nb_symbols,unsigned short nb_prefix_samples,Extension_t etype) This function performs OFDM modulation with cyclic extension or zero-padding. @param input The sequence input samples in the frequency-domain. This is a concatenation of the input symbols in SIMD redundant format @param output The time-domain output signal -@param log2fftsize Base-2 logarithm of the OFDM symbol size (\f$N_d\f$) +@param fftsize size of OFDM symbol size (\f$N_d\f$) @param nb_symbols The number of OFDM symbols in the block @param nb_prefix_samples The number of prefix/suffix/zero samples @param etype Type of extension (CYCLIC_PREFIX,CYCLIC_SUFFIX,ZEROS) @@ -47,7 +47,7 @@ This function performs OFDM modulation with cyclic extension or zero-padding. */ void PHY_ofdm_mod(int *input, int *output, - unsigned char log2fftsize, + int fftsize, unsigned char nb_symbols, unsigned short nb_prefix_samples, Extension_t etype diff --git a/openair1/PHY/MODULATION/ofdm_mod.c b/openair1/PHY/MODULATION/ofdm_mod.c index 61e5f9fb5bc20c7bbd436419d7a8e9584351ceeb..3dd76c0fbbec394b6a62d71623e417be685d9a2c 100755 --- a/openair1/PHY/MODULATION/ofdm_mod.c +++ b/openair1/PHY/MODULATION/ofdm_mod.c @@ -61,9 +61,9 @@ void normal_prefix_mod(int32_t *txdataF,int32_t *txdata,uint8_t nsymb,LTE_DL_FRA txdata+(i*(frame_parms->samples_per_tti>>1))); #endif - PHY_ofdm_mod(txdataF+(i*NUMBER_OF_OFDM_CARRIERS*frame_parms->symbols_per_tti>>1), // input + PHY_ofdm_mod(txdataF+(i*frame_parms->ofdm_symbol_size*frame_parms->symbols_per_tti>>1), // input txdata+(i*frame_parms->samples_per_tti>>1), // output - frame_parms->log2_symbol_size, // log2_fft_size + frame_parms->ofdm_symbol_size, 1, // number of symbols frame_parms->nb_prefix_samples0, // number of prefix samples CYCLIC_PREFIX); @@ -71,9 +71,9 @@ void normal_prefix_mod(int32_t *txdataF,int32_t *txdata,uint8_t nsymb,LTE_DL_FRA printf("slot i %d (txdata offset %d)\n",i,OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES0+(i*frame_parms->samples_per_tti>>1)); #endif - PHY_ofdm_mod(txdataF+NUMBER_OF_OFDM_CARRIERS+(i*NUMBER_OF_OFDM_CARRIERS*(frame_parms->symbols_per_tti>>1)), // input + PHY_ofdm_mod(txdataF+frame_parms->ofdm_symbol_size+(i*frame_parms->ofdm_symbol_size*(frame_parms->symbols_per_tti>>1)), // input txdata+OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES0+(i*(frame_parms->samples_per_tti>>1)), // output - frame_parms->log2_symbol_size, // log2_fft_size + frame_parms->ofdm_symbol_size, (short_offset==1) ? 1 :(frame_parms->symbols_per_tti>>1)-1,//6, // number of symbols frame_parms->nb_prefix_samples, // number of prefix samples CYCLIC_PREFIX); @@ -84,7 +84,7 @@ void normal_prefix_mod(int32_t *txdataF,int32_t *txdata,uint8_t nsymb,LTE_DL_FRA void PHY_ofdm_mod(int *input, /// pointer to complex input int *output, /// pointer to complex output - unsigned char log2fftsize, /// log2(FFT_SIZE) + int fftsize, /// FFT_SIZE unsigned char nb_symbols, /// number of OFDM symbols unsigned short nb_prefix_samples, /// cyclic prefix length Extension_t etype /// type of extension @@ -100,24 +100,28 @@ void PHY_ofdm_mod(int *input, /// pointer to complex input int *temp_ptr=(int*)0; void (*idft)(int16_t *,int16_t *, int); - switch (log2fftsize) { - case 7: + switch (fftsize) { + case 128: idft = idft128; break; - case 8: + case 256: idft = idft256; break; - case 9: + case 512: idft = idft512; break; - case 10: + case 1024: idft = idft1024; break; - case 11: + case 1536: + idft = idft1536; + break; + + case 2048: idft = idft2048; break; @@ -127,8 +131,8 @@ void PHY_ofdm_mod(int *input, /// pointer to complex input } #ifdef DEBUG_OFDM_MOD - msg("[PHY] OFDM mod (size %d,prefix %d) Symbols %d, input %p, output %p\n", - 1<<log2fftsize,nb_prefix_samples,nb_symbols,input,output); + printf("[PHY] OFDM mod (size %d,prefix %d) Symbols %d, input %p, output %p\n", + fftsize,nb_prefix_samples,nb_symbols,input,output); #endif @@ -136,35 +140,31 @@ void PHY_ofdm_mod(int *input, /// pointer to complex input for (i=0; i<nb_symbols; i++) { #ifdef DEBUG_OFDM_MOD - msg("[PHY] symbol %d/%d (%p,%p -> %p)\n",i,nb_symbols,input,&input[i<<log2fftsize],&output[(i<<log2fftsize) + ((i)*nb_prefix_samples)]); + printf("[PHY] symbol %d/%d offset %d (%p,%p -> %p)\n",i,nb_symbols,i*fftsize+(i*nb_prefix_samples),input,&input[i*fftsize],&output[(i*fftsize) + ((i)*nb_prefix_samples)]); #endif - idft((int16_t *)&input[i<<log2fftsize], - (log2fftsize==7) ? (int16_t *)temp : (int16_t *)&output[(i<<log2fftsize) + ((1+i)*nb_prefix_samples)], + idft((int16_t *)&input[i*fftsize], + (fftsize==128) ? (int16_t *)temp : (int16_t *)&output[(i*fftsize) + ((1+i)*nb_prefix_samples)], 1); - // write_output("fft_out.m","fftout",temp,(1<<log2fftsize)*2,1,1); - - //memset(temp,0,1<<log2fftsize); - // Copy to frame buffer with Cyclic Extension // Note: will have to adjust for synchronization offset! switch (etype) { case CYCLIC_PREFIX: - output_ptr = &output[(i<<log2fftsize) + ((1+i)*nb_prefix_samples)]; + output_ptr = &output[(i*fftsize) + ((1+i)*nb_prefix_samples)]; temp_ptr = (int *)temp; // msg("Doing cyclic prefix method\n"); - if (log2fftsize==7) { - for (j=0; j<((1<<log2fftsize)) ; j++) { + if (fftsize==128) { + for (j=0; j<fftsize ; j++) { output_ptr[j] = temp_ptr[j]; } } - j=(1<<log2fftsize); + j=fftsize; for (k=-1; k>=-nb_prefix_samples; k--) { output_ptr[k] = output_ptr[--j]; @@ -175,19 +175,19 @@ void PHY_ofdm_mod(int *input, /// pointer to complex input case CYCLIC_SUFFIX: - output_ptr = &output[(i<<log2fftsize)+ (i*nb_prefix_samples)]; + output_ptr = &output[(i*fftsize)+ (i*nb_prefix_samples)]; temp_ptr = (int *)temp; // msg("Doing cyclic suffix method\n"); - for (j=0; j<(1<<log2fftsize) ; j++) { + for (j=0; j<fftsize ; j++) { output_ptr[j] = temp_ptr[2*j]; } for (j=0; j<nb_prefix_samples; j++) - output_ptr[(1<<log2fftsize)+j] = output_ptr[j]; + output_ptr[fftsize+j] = output_ptr[j]; break; @@ -198,11 +198,11 @@ void PHY_ofdm_mod(int *input, /// pointer to complex input case NONE: // msg("NO EXTENSION!\n"); - output_ptr = &output[(i<<log2fftsize)]; + output_ptr = &output[fftsize]; temp_ptr = (int *)temp; - for (j=0; j<(1<<log2fftsize) ; j++) { + for (j=0; j<fftsize ; j++) { output_ptr[j] = temp_ptr[2*j]; @@ -219,14 +219,7 @@ void PHY_ofdm_mod(int *input, /// pointer to complex input } - /* - printf("input %p, output %p, log2fftsize %d, nsymb %d\n",input,output,log2fftsize,nb_symbols); - for (i=0;i<16;i++) - printf("%d %d\n",((short *)input)[i<<1],((short *)input)[1+(i<<1)]); - printf("------\n"); - for (i=0;i<16;i++) - printf("%d %d\n",((short *)output)[i<<1],((short *)output)[1+(i<<1)]); - */ + } @@ -244,7 +237,7 @@ void do_OFDM_mod(mod_sym_t **txdataF, int32_t **txdata, uint32_t frame,uint16_t LOG_D(PHY,"Frame %d, subframe %d: Doing MBSFN modulation (slot_offset %d)\n",frame,next_slot>>1,slot_offset); PHY_ofdm_mod(&txdataF[aa][slot_offset_F], // input &txdata[aa][slot_offset], // output - frame_parms->log2_symbol_size, // log2_fft_size + frame_parms->ofdm_symbol_size, 12, // number of symbols frame_parms->ofdm_symbol_size>>2, // number of prefix samples CYCLIC_PREFIX); @@ -252,7 +245,7 @@ void do_OFDM_mod(mod_sym_t **txdataF, int32_t **txdata, uint32_t frame,uint16_t if (frame_parms->Ncp == EXTENDED) PHY_ofdm_mod(&txdataF[aa][slot_offset_F], // input &txdata[aa][slot_offset], // output - frame_parms->log2_symbol_size, // log2_fft_size + frame_parms->ofdm_symbol_size, 2, // number of symbols frame_parms->nb_prefix_samples, // number of prefix samples CYCLIC_PREFIX); @@ -268,7 +261,7 @@ void do_OFDM_mod(mod_sym_t **txdataF, int32_t **txdata, uint32_t frame,uint16_t if (frame_parms->Ncp == EXTENDED) PHY_ofdm_mod(&txdataF[aa][slot_offset_F], // input &txdata[aa][slot_offset], // output - frame_parms->log2_symbol_size, // log2_fft_size + frame_parms->ofdm_symbol_size, 6, // number of symbols frame_parms->nb_prefix_samples, // number of prefix samples CYCLIC_PREFIX); diff --git a/openair1/PHY/MODULATION/slot_fep.c b/openair1/PHY/MODULATION/slot_fep.c index feb2d885b2c1279c5a649dd0b12f82c10a0c3bc7..0d2389c2aecd6f8df13794da5e1f6ec2d8e6b4a6 100644 --- a/openair1/PHY/MODULATION/slot_fep.c +++ b/openair1/PHY/MODULATION/slot_fep.c @@ -58,24 +58,28 @@ int slot_fep(PHY_VARS_UE *phy_vars_ue, void (*dft)(int16_t *,int16_t *, int); int tmp_dft_in[256]; // This is for misalignment issues for 6 and 15 PRBs - switch (frame_parms->log2_symbol_size) { - case 7: + switch (frame_parms->ofdm_symbol_size) { + case 128: dft = dft128; break; - case 8: + case 256: dft = dft256; break; - case 9: + case 512: dft = dft512; break; - case 10: + case 1024: dft = dft1024; break; - case 11: + case 1536: + dft = dft1536; + break; + + case 2048: dft = dft2048; break; @@ -96,12 +100,12 @@ int slot_fep(PHY_VARS_UE *phy_vars_ue, if (l<0 || l>=7-frame_parms->Ncp) { - msg("slot_fep: l must be between 0 and %d\n",7-frame_parms->Ncp); + printf("slot_fep: l must be between 0 and %d\n",7-frame_parms->Ncp); return(-1); } if (Ns<0 || Ns>=20) { - msg("slot_fep: Ns must be between 0 and 19\n"); + printf("slot_fep: Ns must be between 0 and 19\n"); return(-1); } @@ -116,7 +120,7 @@ int slot_fep(PHY_VARS_UE *phy_vars_ue, #ifdef DEBUG_FEP // if (phy_vars_ue->frame <100) - msg("slot_fep: frame %d: slot %d, symbol %d, nb_prefix_samples %d, nb_prefix_samples0 %d, slot_offset %d, subframe_offset %d, sample_offset %d,rx_offset %d\n", phy_vars_ue->frame_rx,Ns, symbol, + printf("slot_fep: frame %d: slot %d, symbol %d, nb_prefix_samples %d, nb_prefix_samples0 %d, slot_offset %d, subframe_offset %d, sample_offset %d,rx_offset %d\n", phy_vars_ue->frame_rx,Ns, symbol, nb_prefix_samples,nb_prefix_samples0,slot_offset,subframe_offset,sample_offset,rx_offset); #endif @@ -147,7 +151,7 @@ int slot_fep(PHY_VARS_UE *phy_vars_ue, #ifdef DEBUG_FEP // if (phy_vars_ue->frame <100) - msg("slot_fep: frame %d: slot %d, symbol %d, nb_prefix_samples %d, nb_prefix_samples0 %d, slot_offset %d, subframe_offset %d, sample_offset %d,rx_offset %d\n", phy_vars_ue->frame_rx,Ns, symbol, + printf("slot_fep: frame %d: slot %d, symbol %d, nb_prefix_samples %d, nb_prefix_samples0 %d, slot_offset %d, subframe_offset %d, sample_offset %d,rx_offset %d\n", phy_vars_ue->frame_rx,Ns, symbol, nb_prefix_samples,nb_prefix_samples0,slot_offset,subframe_offset,sample_offset,rx_offset); #endif @@ -182,7 +186,7 @@ int slot_fep(PHY_VARS_UE *phy_vars_ue, for (aa=0; aa<frame_parms->nb_antennas_tx_eNB; aa++) { #ifdef DEBUG_FEP - msg("Channel estimation eNB %d, aatx %d, slot %d, symbol %d\n",eNB_id,aa,Ns,l); + printf("Channel estimation eNB %d, aatx %d, slot %d, symbol %d\n",eNB_id,aa,Ns,l); #endif start_meas(&phy_vars_ue->dlsch_channel_estimation_stats); lte_dl_channel_estimation(phy_vars_ue,eNB_id,0, @@ -205,7 +209,7 @@ int slot_fep(PHY_VARS_UE *phy_vars_ue, // do frequency offset estimation here! // use channel estimates from current symbol (=ch_t) and last symbol (ch_{t-1}) #ifdef DEBUG_FEP - msg("Frequency offset estimation\n"); + printf("Frequency offset estimation\n"); #endif if (l==(4-frame_parms->Ncp)) { @@ -222,7 +226,7 @@ int slot_fep(PHY_VARS_UE *phy_vars_ue, } #ifdef DEBUG_FEP - msg("slot_fep: done\n"); + printf("slot_fep: done\n"); #endif return(0); } diff --git a/openair1/PHY/MODULATION/slot_fep_mbsfn.c b/openair1/PHY/MODULATION/slot_fep_mbsfn.c index 94dc4b3ef162cc3b8d3e421de3e89d9745bf81e5..d71a9d04778a5dd60b7b5acac86669512d1e1254 100644 --- a/openair1/PHY/MODULATION/slot_fep_mbsfn.c +++ b/openair1/PHY/MODULATION/slot_fep_mbsfn.c @@ -54,25 +54,29 @@ int slot_fep_mbsfn(PHY_VARS_UE *phy_vars_ue, unsigned int frame_length_samples = frame_parms->samples_per_tti * 10; void (*dft)(int16_t *,int16_t *, int); - switch (frame_parms->log2_symbol_size) { + switch (frame_parms->ofdm_symbol_size) { - case 7: + case 128: dft = dft128; break; - case 8: + case 256: dft = dft256; break; - case 9: + case 512: dft = dft512; break; - case 10: + case 1024: dft = dft1024; break; - case 11: + case 1536: + dft = dft1536; + break; + + case 2048: dft = dft2048; break; diff --git a/openair1/PHY/MODULATION/slot_fep_ul.c b/openair1/PHY/MODULATION/slot_fep_ul.c index 32bae2c0360a5c1316c47ccda5cd66f86d012676..57f4a6f7ab983b27464a9592ad877fbbe423194d 100644 --- a/openair1/PHY/MODULATION/slot_fep_ul.c +++ b/openair1/PHY/MODULATION/slot_fep_ul.c @@ -50,24 +50,28 @@ int slot_fep_ul(LTE_DL_FRAME_PARMS *frame_parms, void (*dft)(int16_t *,int16_t *, int); - switch (frame_parms->log2_symbol_size) { - case 7: + switch (frame_parms->ofdm_symbol_size) { + case 128: dft = dft128; break; - case 8: + case 256: dft = dft256; break; - case 9: + case 512: dft = dft512; break; - case 10: + case 1024: dft = dft1024; break; - case 11: + case 1536: + dft = dft1536; + break; + + case 2048: dft = dft2048; break; diff --git a/openair1/PHY/TOOLS/cmult_mm.c b/openair1/PHY/TOOLS/cmult_mm.c deleted file mode 100644 index 328958af29605645183c7421dca863829eed3ab1..0000000000000000000000000000000000000000 --- a/openair1/PHY/TOOLS/cmult_mm.c +++ /dev/null @@ -1,200 +0,0 @@ -/******************************************************************************* - OpenAirInterface - Copyright(c) 1999 - 2014 Eurecom - - OpenAirInterface is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - - OpenAirInterface is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with OpenAirInterface.The full GNU General Public License is - included in this distribution in the file called "COPYING". If not, - see <http://www.gnu.org/licenses/>. - - Contact Information - OpenAirInterface Admin: openair_admin@eurecom.fr - OpenAirInterface Tech : openair_tech@eurecom.fr - OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr - - Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE - - *******************************************************************************/ -#include "defs.h" - -int mult_cpx_matrix_h(short *x1[2][2], - short *x2[2][2], - short *y[2][2], - unsigned int N, - unsigned short output_shift, - short hermitian) -{ - - if (hermitian) { - // this computes x1^H*x2 and stores it in y - mult_cpx_vector_h(x2[0][0],x1[0][0],y[0][0],N,output_shift,1); - mult_cpx_vector_h(x2[0][1],x1[0][1],y[0][0],N,output_shift,1); - mult_cpx_vector_h(x2[0][0],x1[1][0],y[1][0],N,output_shift,1); - mult_cpx_vector_h(x2[0][1],x1[1][1],y[1][0],N,output_shift,1); - mult_cpx_vector_h(x2[1][0],x1[0][0],y[0][1],N,output_shift,1); - mult_cpx_vector_h(x2[1][1],x1[0][1],y[0][1],N,output_shift,1); - mult_cpx_vector_h(x2[1][0],x1[1][0],y[1][1],N,output_shift,1); - mult_cpx_vector_h(x2[1][1],x1[1][1],y[1][1],N,output_shift,1); - } else { - // this computes x1*x2^H and stores it in y - mult_cpx_vector_h(x1[0][0],x2[0][0],y[0][0],N,output_shift,1); - mult_cpx_vector_h(x1[0][1],x2[0][1],y[0][0],N,output_shift,1); - mult_cpx_vector_h(x1[0][0],x2[1][0],y[0][1],N,output_shift,1); - mult_cpx_vector_h(x1[0][1],x2[1][1],y[0][1],N,output_shift,1); - mult_cpx_vector_h(x1[1][0],x2[0][0],y[1][0],N,output_shift,1); - mult_cpx_vector_h(x1[1][1],x2[0][1],y[1][0],N,output_shift,1); - mult_cpx_vector_h(x1[1][0],x2[1][0],y[1][1],N,output_shift,1); - mult_cpx_vector_h(x1[1][1],x2[1][1],y[1][1],N,output_shift,1); - } -} - -int mult_cpx_matrix_vector(int *x1[2][2], - int *x2[2], - int *y[2], - unsigned int N, - unsigned short output_shift) -{ - - Zero_Buffer(y[0],N*8); - Zero_Buffer(y[1],N*8); - - // this computes x1*x2 and stores it in y (32 bit) - mult_cpx_vector_add32((short*)x2[0],(short*)x1[0][0],(short*)y[0],N); - mult_cpx_vector_add32((short*)x2[1],(short*)x1[0][1],(short*)y[0],N); - mult_cpx_vector_add32((short*)x2[0],(short*)x1[1][0],(short*)y[1],N); - mult_cpx_vector_add32((short*)x2[1],(short*)x1[1][1],(short*)y[1],N); - - // shift and pack - shift_and_pack((short*)y[0],N,output_shift); - shift_and_pack((short*)y[1],N,output_shift); - -} - -#ifdef MAIN_MM -#include <stdio.h> -#include <stdlib.h> -main () -{ - short x1_00[256] __attribute__((aligned(16))); - short x1_10[256] __attribute__((aligned(16))); - short x1_01[256] __attribute__((aligned(16))); - short x1_11[256] __attribute__((aligned(16))); - short x2_0[256] __attribute__((aligned(16))); - short x2_1[256] __attribute__((aligned(16))); - short y_0[256] __attribute__((aligned(16))); - short y_1[256] __attribute__((aligned(16))); - - int *x1[2][2]; - int *x2[2]; - int *y[2]; - int i,m,n; - - x1[0][0] = (int*)x1_00; - x1[0][1] = (int*)x1_01; - x1[1][0] = (int*)x1_10; - x1[1][1] = (int*)x1_11; - x2[0] = (int*)x2_0; - x2[1] = (int*)x2_1; - y[0] = (int*)y_0; - y[1] = (int*)y_1; - - for(m=0; m<2; m++) { - for(n=0; n<2; n++) { - for(i=0; i<256; i+=4) { - ((short*)x1[m][n])[i] = ((short) rand())/4; - ((short*)x1[m][n])[i+1] = ((short) rand())/4; - ((short*)x1[m][n])[i+2] = -((short*)x1[m][n])[i+1]; - ((short*)x1[m][n])[i+3] = ((short*)x1[m][n])[i]; - } - } - - for(i=0; i<256; i+=4) { - ((short*)x2[m])[i] = ((short) rand())/4; - ((short*)x2[m])[i+1] = ((short) rand())/4; - ((short*)x2[m])[i+2] = ((short*)x2[m])[i]; - ((short*)x2[m])[i+3] = ((short*)x2[m])[i+1]; - } - - Zero_Buffer(y[m],512); - } - - /* - input[0] = 100; - input[1] = 200; - input[2] = -200; - input[3] = 100; - input[4] = 1000; - input[5] = 2000; - input[6] = -2000; - input[7] = 1000; - input[8] = 100; - input[9] = 200; - input[10] = -200; - input[11] = 100; - input[12] = 1000; - input[13] = 2000; - input[14] = -2000; - input[15] = 1000; - - input2[0] = 2; - input2[1] = 1; - input2[2] = 2; - input2[3] = 1; - input2[4] = 20; - input2[5] = 10; - input2[6] = 20; - input2[7] = 10; - input2[8] = 2; - input2[9] = 1; - input2[10] = 2; - input2[11] = 1; - input2[12] = 2000; - input2[13] = 1000; - input2[14] = 2000; - input2[15] = 1000; - - x1[0][0] = (int*)input; - x1[0][1] = (int*)input; - x1[1][0] = (int*)input; - x1[1][1] = (int*)input; - - x2[0] = (int*)input2; - x2[1] = (int*)input2; - - y[0] = (int*)output; - y[1] = (int*)output2; - */ - - mult_cpx_matrix_vector(x1,x2,y,64,15); - - //mult_cpx_vector_add32(x2[0],x1[0][0],y[0],64); - - for (i=0; i<128; i+=2) - printf("i=%d, x1 = [%d+1i*%d %d+1i*%d; %d+1i*%d %d+1i*%d]; x2 = [%d+1i*%d; %d+1i*%d]; y = [%d+1i*%d; %d+1i*%d]; y_m= round(x1*x2./pow2(15)); y-y_m \n", - i, - ((short*)x1[0][0])[2*i], ((short*)x1[0][0])[2*i+2], - ((short*)x1[0][1])[2*i], ((short*)x1[0][1])[2*i+2], - ((short*)x1[1][0])[2*i], ((short*)x1[1][0])[2*i+2], - ((short*)x1[1][1])[2*i], ((short*)x1[1][1])[2*i+2], - ((short*)x2[0])[2*i], ((short*)x2[0])[2*i+1], - ((short*)x2[1])[2*i], ((short*)x2[1])[2*i+1], - ((short*)y[0])[2*i], ((short*)y[0])[2*i+1], - ((short*)y[1])[2*i], ((short*)y[1])[2*i+1]); - - //((int*)y[0])[i], ((int*)y[0])[i+1], - //((int*)y[1])[i], ((int*)y[1])[i+1]); - -} - -#endif diff --git a/openair1/PHY/TOOLS/cmult_vv.c b/openair1/PHY/TOOLS/cmult_vv.c index d7b72755087cb3e3b343e79140a9935d208e9b56..f970d332248f47fd2109dc71515a8ce99a11ce27 100755 --- a/openair1/PHY/TOOLS/cmult_vv.c +++ b/openair1/PHY/TOOLS/cmult_vv.c @@ -50,7 +50,7 @@ int mult_cpx_conj_vector(int16_t *x1, uint32_t N, int output_shift) { - // Multiply elementwise two complex vectors of N elements with repeated formatted output + // Multiply elementwise the complex conjugate of x1 with x2. // x1 - input 1 in the format |Re0 Im0 Re1 Im1|,......,|Re(N-2) Im(N-2) Re(N-1) Im(N-1)| // We assume x1 with a dinamic of 15 bit maximum // @@ -90,7 +90,7 @@ int mult_cpx_conj_vector(int16_t *x1, tmp_im = _mm_shufflelo_epi16(*x1_128,_MM_SHUFFLE(2,3,0,1)); tmp_im = _mm_shufflehi_epi16(tmp_im,_MM_SHUFFLE(2,3,0,1)); tmp_im = _mm_sign_epi16(tmp_im,*(__m128i*)&conjug[0]); - tmp_im = _mm_madd_epi16(tmp_im,*x1_128); + tmp_im = _mm_madd_epi16(tmp_im,*x2_128); tmp_re = _mm_srai_epi32(tmp_re,output_shift); tmp_im = _mm_srai_epi32(tmp_im,output_shift); tmpy0 = _mm_unpacklo_epi32(tmp_re,tmp_im); @@ -130,3 +130,4 @@ int mult_cpx_conj_vector(int16_t *x1, return(0); } + diff --git a/openair1/PHY/TOOLS/cmult_vvh.c b/openair1/PHY/TOOLS/cmult_vvh.c deleted file mode 100644 index 64cf163d09c84c09c2afb1afd3aecd467c861a07..0000000000000000000000000000000000000000 --- a/openair1/PHY/TOOLS/cmult_vvh.c +++ /dev/null @@ -1,366 +0,0 @@ -/******************************************************************************* - OpenAirInterface - Copyright(c) 1999 - 2014 Eurecom - - OpenAirInterface is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - - OpenAirInterface is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with OpenAirInterface.The full GNU General Public License is - included in this distribution in the file called "COPYING". If not, - see <http://www.gnu.org/licenses/>. - - Contact Information - OpenAirInterface Admin: openair_admin@eurecom.fr - OpenAirInterface Tech : openair_tech@eurecom.fr - OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr - - Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE - - *******************************************************************************/ -#include "defs.h" - -static __m128i shift __attribute__ ((aligned(16))); - - -int mult_cpx_vector_h(short *x1, - short *x2, - short *y, - unsigned int N, - unsigned short output_shift, - short sign) -{ - // Multiply elementwise the complex vector x1 with the complex conjugate of the complex vecotr x2 of N elements and adds it to the vector y. - // x1 - input 1 in the format |Re0 Im0 Re0 Im0|,......,|Re(N-1) Im(N-1) Re(N-1) Im(N-1)| - // We assume x1 with a dinamic of 15 bit maximum - // - // x2 - input 2 in the format |Re0 Im0 Re0 Im0|,......,|Re(N-1) Im(N-1) Re(N-1) Im(N-1)| - // We assume x2 with a dinamic of 14 bit maximum - // - // y - output in the format |Re0 Im0 Re0 Im0|,......,|Re(N-1) Im(N-1) Re(N-1) Im(N-1)| - // - // N - the size f the vectors (this function does N cpx mpy. WARNING: N>=4; - // - // log2_amp - increase the output amplitude by a factor 2^log2_amp (default is 0) - // WARNING: log2_amp>0 can cause overflow!! - // sign - +1..add, -1..substract - - unsigned int i; // loop counter - - register __m128i m0,m1,m2; - - short *temps; - int *tempd; - - __m128i *x1_128; - __m128i *x2_128; - __m128i *y_128; - __m128i mask; - - __m128i temp; - - shift = _mm_cvtsi32_si128(output_shift); - x1_128 = (__m128i *)&x1[0]; - x2_128 = (__m128i *)&x2[0]; - y_128 = (__m128i *)&y[0]; - - if (sign == -1) - mask = (__m128i) _mm_set_epi16 (-1,1,-1,-1,-1,1,-1,-1); - else - mask = (__m128i) _mm_set_epi16 (1,-1,1,1,1,-1,1,1); - - // we compute 2*4 cpx multiply for each loop - for(i=0; i<(N>>3); i++) { - - // printf("i=%d\n",i); - - // unroll 1 - // temps = (short *)x1_128; - // printf("x1 : %d,%d,%d,%d,%d,%d,%d,%d\n",temps[0],temps[1],temps[2],temps[3],temps[4],temps[5],temps[6],temps[7]); - m1 = x1_128[0]; - m2 = x2_128[0]; - - // temps = (short *)&x2_128[0]; - // printf("x2 : %x,%x,%x,%x,%x,%x,%x,%x\n",temps[0],temps[1],temps[2],temps[3],temps[4],temps[5],temps[6],temps[7]); - - // bring x2 in conjugate form - // the first two instructions might be replaced with a single one in SSE3 - m2 = _mm_shufflelo_epi16(m2,_MM_SHUFFLE(0,1,3,2)); - m2 = _mm_shufflehi_epi16(m2,_MM_SHUFFLE(0,1,3,2)); - m2 = _mm_mullo_epi16(m2, mask); - - // temp = m2; - // temps = (short *)&temp; - // printf("x2 conj : %x,%x,%x,%x,%x,%x,%x,%x\n",temps[0],temps[1],temps[2],temps[3],temps[4],temps[5],temps[6],temps[7]); - - m0 = _mm_madd_epi16(m1,m2); //pmaddwd_r2r(mm1,mm0); // 1- compute x1[0]*x2[0] - - // temp = m0; - - // tempd = &temp; - // printf("m0 : %d,%d,%d,%d\n",tempd[0],tempd[1],tempd[2],tempd[3]); - - m0 = _mm_sra_epi32(m0,shift); // 1- shift right by shift in order to compensate for the input amplitude - - // temp = m0; - - // tempd = (int *)&temp; - // printf("m0 : %d,%d,%d,%d\n",tempd[0],tempd[1],tempd[2],tempd[3]); - - m0 = _mm_packs_epi32(m0,m0); // 1- pack in a 128 bit register [re im re im] - m0 = _mm_unpacklo_epi32(m0,m0); // 1- pack in a 128 bit register [re im re im] - - y_128[0] = _mm_add_epi16(m0,y_128[0]); - - // temps = (short *)&y_128[0]; - // printf("y0 : %d,%d,%d,%d,%d,%d,%d,%d\n",temps[0],temps[1],temps[2],temps[3],temps[4],temps[5],temps[6],temps[7]); - - // unroll 2 - m1 = x1_128[1]; - m2 = x2_128[1]; - - m2 = _mm_shufflelo_epi16(m2,_MM_SHUFFLE(0,1,3,2)); - m2 = _mm_shufflehi_epi16(m2,_MM_SHUFFLE(0,1,3,2)); - m2 = _mm_mullo_epi16(m2, mask); - - m0 = _mm_madd_epi16(m1,m2); //pmaddwd_r2r(mm1,mm0); // 1- compute x1[0]*x2[0] - - m0 = _mm_sra_epi32(m0,shift); // 1- shift right by shift in order to compensate for the input amplitude - - m0 = _mm_packs_epi32(m0,m0); // 1- pack in a 128 bit register [re im re im] - m0 = _mm_unpacklo_epi32(m0,m0); // 1- pack in a 128 bit register [re im re im] - - y_128[1] = _mm_add_epi16(m0,y_128[1]); - - // unroll 3 - m1 = x1_128[2]; - m2 = x2_128[2]; - - m2 = _mm_shufflelo_epi16(m2,_MM_SHUFFLE(0,1,3,2)); - m2 = _mm_shufflehi_epi16(m2,_MM_SHUFFLE(0,1,3,2)); - m2 = _mm_mullo_epi16(m2, mask); - - m0 = _mm_madd_epi16(m1,m2); //pmaddwd_r2r(mm1,mm0); // 1- compute x1[0]*x2[0] - - m0 = _mm_sra_epi32(m0,shift); // 1- shift right by shift in order to compensate for the input amplitude - - m0 = _mm_packs_epi32(m0,m0); // 1- pack in a 128 bit register [re im re im] - m0 = _mm_unpacklo_epi32(m0,m0); // 1- pack in a 128 bit register [re im re im] - - y_128[2] = _mm_add_epi16(m0,y_128[2]); - - - // unroll 4 - m1 = x1_128[3]; - m2 = x2_128[3]; - - m2 = _mm_shufflelo_epi16(m2,_MM_SHUFFLE(0,1,3,2)); - m2 = _mm_shufflehi_epi16(m2,_MM_SHUFFLE(0,1,3,2)); - m2 = _mm_mullo_epi16(m2, mask); - - m0 = _mm_madd_epi16(m1,m2); //pmaddwd_r2r(mm1,mm0); // 1- compute x1[0]*x2[0] - - m0 = _mm_sra_epi32(m0,shift); // 1- shift right by shift in order to compensate for the input amplitude - - m0 = _mm_packs_epi32(m0,m0); // 1- pack in a 128 bit register [re im re im] - m0 = _mm_unpacklo_epi32(m0,m0); // 1- pack in a 128 bit register [re im re im] - - y_128[3] = _mm_add_epi16(m0,y_128[3]); - - x1_128+=4; - x2_128+=4; - y_128 +=4; - // printf("x1_128 = %p, x2_128 =%p, y_128=%p\n",x1_128,x2_128,y_128); - - } - - - _mm_empty(); - _m_empty(); - - return(0); -} - - -int mult_cpx_vector_h_add32(short *x1, - short *x2, - short *y, - unsigned int N, - short sign) -{ - // Multiply elementwise the complex vector x1 with the complex conjugate of the complex vecotr x2 of N elements and adds it to the vector y. - // x1 - input 1 in 16bit format |Re0 Im0 Re0 Im0|,......,|Re(N-1) Im(N-1) Re(N-1) Im(N-1)| - // We assume x1 with a dinamic of 15 bit maximum - // - // x2 - input 2 in 16bit format |Re0 Im0 Re0 Im0|,......,|Re(N-1) Im(N-1) Re(N-1) Im(N-1)| - // We assume x2 with a dinamic of 14 bit maximum - // - // y - output in 32bit format |Re0 Im0|,......,|Re(N-1) Im(N-1)| - // - // N - the size f the vectors (this function does N cpx mpy. WARNING: N>=4; - // - // sign - +1..add, -1..substract - - unsigned int i; // loop counter - - register __m128i m0,m1,m2; - - short *temps; - int *tempd; - - __m128i *x1_128; - __m128i *x2_128; - __m128i *y_128; - __m128i mask; - - __m128i temp; - - x1_128 = (__m128i *)&x1[0]; - x2_128 = (__m128i *)&x2[0]; - y_128 = (__m128i *)&y[0]; - - if (sign == -1) - mask = (__m128i) _mm_set_epi16 (-1,1,-1,-1,-1,1,-1,-1); - else - mask = (__m128i) _mm_set_epi16 (1,-1,1,1,1,-1,1,1); - - // we compute 2*4 cpx multiply for each loop - for(i=0; i<(N>>3); i++) { - - m1 = x1_128[0]; - m2 = x2_128[0]; - - // bring x2 in conjugate form - // the first two instructions might be replaced with a single one in SSE3 - m2 = _mm_shufflelo_epi16(m2,_MM_SHUFFLE(0,1,3,2)); - m2 = _mm_shufflehi_epi16(m2,_MM_SHUFFLE(0,1,3,2)); - m2 = _mm_mullo_epi16(m2, mask); - - m0 = _mm_madd_epi16(m1,m2); // 1- compute x1[0]*x2[0], result is 32bit - - y_128[0] = _mm_add_epi32(m0,y_128[0]); - - // unroll 2 - m1 = x1_128[1]; - m2 = x2_128[1]; - - m2 = _mm_shufflelo_epi16(m2,_MM_SHUFFLE(0,1,3,2)); - m2 = _mm_shufflehi_epi16(m2,_MM_SHUFFLE(0,1,3,2)); - m2 = _mm_mullo_epi16(m2, mask); - - m0 = _mm_madd_epi16(m1,m2); - - y_128[1] = _mm_add_epi32(m0,y_128[1]); - - // unroll 3 - m1 = x1_128[2]; - m2 = x2_128[2]; - - m2 = _mm_shufflelo_epi16(m2,_MM_SHUFFLE(0,1,3,2)); - m2 = _mm_shufflehi_epi16(m2,_MM_SHUFFLE(0,1,3,2)); - m2 = _mm_mullo_epi16(m2, mask); - - m0 = _mm_madd_epi16(m1,m2); - - y_128[2] = _mm_add_epi32(m0,y_128[2]); - - - // unroll 4 - m1 = x1_128[3]; - m2 = x2_128[3]; - - m2 = _mm_shufflelo_epi16(m2,_MM_SHUFFLE(0,1,3,2)); - m2 = _mm_shufflehi_epi16(m2,_MM_SHUFFLE(0,1,3,2)); - m2 = _mm_mullo_epi16(m2, mask); - - m0 = _mm_madd_epi16(m1,m2); - - y_128[3] = _mm_add_epi32(m0,y_128[3]); - - x1_128+=4; - x2_128+=4; - y_128 +=4; - - } - - - _mm_empty(); - _m_empty(); - - return(0); -} - -#ifdef MAIN -#define L 16 - -main () -{ - - short input[256] __attribute__((aligned(16))); - short input2[256] __attribute__((aligned(16))); - short output[256] __attribute__((aligned(16))); - - int i; - - Zero_Buffer(output,256*2); - - for (i=0; i<16; i+=2) - printf("output[%d] = %d + %d i\n",i,output[i],output[i+1]); - - input[0] = 100; - input[1] = 200; - input[2] = 100; - input[3] = 200; - input[4] = 1234; - input[5] = -1234; - input[6] = 1234; - input[7] = -1234; - input[8] = 100; - input[9] = 200; - input[10] = 100; - input[11] = 200; - input[12] = 1000; - input[13] = 2000; - input[14] = 1000; - input[15] = 2000; - - input2[0] = 1; - input2[1] = 2; - input2[2] = 1; - input2[3] = 2; - input2[4] = 10; - input2[5] = 20; - input2[6] = 10; - input2[7] = 20; - input2[8] = 1; - input2[9] = 2; - input2[10] = 1; - input2[11] = 2; - input2[12] = 1000; - input2[13] = 2000; - input2[14] = 1000; - input2[15] = 2000; - - - mult_cpx_vector_h(input2,input2,output,8,0,1); - - for (i=0; i<16; i+=2) - printf("output[%d] = %d + %d i\n",i,output[i],output[i+1]); - - Zero_Buffer(output,256*2); - mult_cpx_vector_h(input2,input2,output,8,0,-1); - - for (i=0; i<16; i+=2) - printf("output[%d] = %d + %d i\n",i,output[i],output[i+1]); - -} - -#endif //MAIN diff --git a/openair1/PHY/TOOLS/defs.h b/openair1/PHY/TOOLS/defs.h index 6960fcda4c8793ff4920a0cc99edc60c5dddff42..963c1384b7f14321210168527146eb7e9f41a126 100644 --- a/openair1/PHY/TOOLS/defs.h +++ b/openair1/PHY/TOOLS/defs.h @@ -64,6 +64,8 @@ struct complex32 { int32_t i; }; +//cmult_sv.h + /*!\fn void multadd_real_vector_complex_scalar(int16_t *x,int16_t *alpha,int16_t *y,uint32_t N) This function performs componentwise multiplication and accumulation of a complex scalar and a real vector. @param x Vector input (Q1.15) @@ -95,192 +97,14 @@ void multadd_complex_vector_real_scalar(int16_t *x, uint8_t zero_flag, uint32_t N); - -/*!\fn int32_t mult_cpx_vector(int16_t *x1,int16_t *x2,int16_t *y,uint32_t N,int32_t output_shift) -This function performs optimized componentwise multiplication of two Q1.15 vectors in repeated format. - -@param x1 Input 1 in the format |Re0 Im0 Re0 Im0|,......,|Re(N-1) Im(N-1) Re(N-1) Im(N-1)| -@param x2 Input 2 in the format |Re0 -Im0 Im0 Re0|,......,|Re(N-1) -Im(N-1) Im(N-1) Re(N-1)| -@param y Output in the format |Re0 Im0 Re0 Im0|,......,|Re(N-1) Im(N-1) Re(N-1) Im(N-1)| -@param N Length of Vector WARNING: N must be a multiple of 8 (4x loop unrolling and two complex multiplies per cycle) -@param output_shift Number of bits to shift output down to Q1.15 (should be 15 for Q1.15 inputs) WARNING: log2_amp>0 can cause overflow!! - -The function implemented is : \f$\mathbf{y} = \mathbf{x_1}\odot\mathbf{x_2}\f$ -*/ -int32_t mult_cpx_vector(int16_t *x1, - int16_t *x2, - int16_t *y, - uint32_t N, - int32_t output_shift); - -/*!\fn int32_t mult_cpx_vector_norep(int16_t *x1,int16_t *x2,int16_t *y,uint32_t N,int32_t output_shift) -This function performs optimized componentwise multiplication of two Q1.15 vectors with normal formatted output. - -@param x1 Input 1 in the format |Re0 Im0 Re0 Im0|,......,|Re(N-1) Im(N-1) Re(N-1) Im(N-1)| -@param x2 Input 2 in the format |Re0 -Im0 Im0 Re0|,......,|Re(N-1) -Im(N-1) Im(N-1) Re(N-1)| -@param y Output in the format |Re0 Im0 Re1 Im1|,......,|Re(N-2) Im(N-2) Re(N-1) Im(N-1)| -@param N Length of Vector WARNING: N must be a multiple of 8 (4x loop unrolling and two complex multiplies per cycle) -@param output_shift Number of bits to shift output down to Q1.15 (should be 15 for Q1.15 inputs) WARNING: log2_amp>0 can cause overflow!! - -The function implemented is : \f$\mathbf{y} = \mathbf{x_1}\odot\mathbf{x_2}\f$ -*/ -int32_t mult_cpx_vector_norep(int16_t *x1, - int16_t *x2, - int16_t *y, - uint32_t N, - int32_t output_shift); - - -/*!\fn int32_t mult_cpx_vector_norep2(int16_t *x1,int16_t *x2,int16_t *y,uint32_t N,int32_t output_shift) -This function performs optimized componentwise multiplication of two Q1.15 vectors with normal formatted output. - -@param x1 Input 1 in the format |Re0 Im0 Re0 Im0|,......,|Re(N-1) Im(N-1) Re(N-1) Im(N-1)| -@param x2 Input 2 in the format |Re0 -Im0 Im0 Re0|,......,|Re(N-1) -Im(N-1) Im(N-1) Re(N-1)| -@param y Output in the format |Re0 Im0 Re1 Im1|,......,|Re(N-2) Im(N-2) Re(N-1) Im(N-1)| -@param N Length of Vector WARNING: N must be a multiple of 8 (no unrolling and two complex multiplies per cycle) -@param output_shift Number of bits to shift output down to Q1.15 (should be 15 for Q1.15 inputs) WARNING: log2_amp>0 can cause overflow!! - -The function implemented is : \f$\mathbf{y} = \mathbf{x_1}\odot\mathbf{x_2}\f$ -*/ -int32_t mult_cpx_vector_norep2(int16_t *x1, - int16_t *x2, - int16_t *y, - uint32_t N, - int32_t output_shift); - -int32_t mult_cpx_vector_norep_conj(int16_t *x1, - int16_t *x2, - int16_t *y, - uint32_t N, - int32_t output_shift); - -int32_t mult_cpx_vector_norep_conj2(int16_t *x1, - int16_t *x2, - int16_t *y, - uint32_t N, - int32_t output_shift); - -/*!\fn int32_t mult_cpx_vector2(int16_t *x1,int16_t *x2,int16_t *y,uint32_t N,int32_t output_shift) -This function performs optimized componentwise multiplication of two Q1.15 vectors. - -@param x1 Input 1 in the format |Re0 Im0 Re0 Im0|,......,|Re(N-1) Im(N-1) Re(N-1) Im(N-1)| -@param x2 Input 2 in the format |Re0 -Im0 Im0 Re0|,......,|Re(N-1) -Im(N-1) Im(N-1) Re(N-1)| -@param y Output in the format |Re0 Im0 Re0 Im0|,......,|Re(N-1) Im(N-1) Re(N-1) Im(N-1)| -@param N Length of Vector WARNING: N must be a multiple of 2 (2 complex multiplies per cycle) -@param output_shift Number of bits to shift output down to Q1.15 (should be 15 for Q1.15 inputs) WARNING: log2_amp>0 can cause overflow!! - -The function implemented is : \f$\mathbf{y} = \mathbf{x_1}\odot\mathbf{x_2}\f$ -*/ -int32_t mult_cpx_vector2(int16_t *x1, - int16_t *x2, - int16_t *y, - uint32_t N, - int32_t output_shift); - -/*!\fn int32_t mult_cpx_vector_add(int16_t *x1,int16_t *x2,int16_t *y,uint32_t N,int32_t output_shift) -This function performs optimized componentwise multiplication of two Q1.15 vectors. The output IS ADDED TO y. WARNING: make sure that output_shift is set to the right value, so that the result of the multiplication has the comma at the same place as y. - -@param x1 Input 1 in the format |Re0 Im0 Re0 Im0|,......,|Re(N-1) Im(N-1) Re(N-1) Im(N-1)| -@param x2 Input 2 in the format |Re0 -Im0 Im0 Re0|,......,|Re(N-1) -Im(N-1) Im(N-1) Re(N-1)| -@param y Output in the format |Re0 Im0 Re0 Im0|,......,|Re(N-1) Im(N-1) Re(N-1) Im(N-1)| -@param N Length of Vector WARNING: N>=4 -@param output_shift Number of bits to shift output down to Q1.15 (should be 15 for Q1.15 inputs) WARNING: log2_amp>0 can cause overflow!! - -The function implemented is : \f$\mathbf{y} += \mathbf{x_1}\odot\mathbf{x_2}\f$ -*/ - -int32_t mult_cpx_vector_add(int16_t *x1, - int16_t *x2, - int16_t *y, - uint32_t N, - int32_t output_shift); - - -int32_t mult_cpx_vector_h_add32(int16_t *x1, - int16_t *x2, - int16_t *y, - uint32_t N, - int16_t sign); - -int32_t mult_cpx_vector_add32(int16_t *x1, - int16_t *x2, - int16_t *y, - uint32_t N); - -int32_t mult_vector32(int16_t *x1, - int16_t *x2, +int rotate_cpx_vector(int16_t *x, + int16_t *alpha, int16_t *y, - uint32_t N); - -int32_t mult_vector32_scalar(int16_t *x1, - int32_t x2, - int16_t *y, - uint32_t N); + uint32_t N, + uint16_t output_shift); -int32_t mult_cpx_vector32_conj(int16_t *x, - int16_t *y, - uint32_t N); -int32_t mult_cpx_vector32_real(int16_t *x1, - int16_t *x2, - int16_t *y, - uint32_t N); -int32_t shift_and_pack(int16_t *y, - uint32_t N, - int32_t output_shift); - -/*!\fn int32_t mult_cpx_vector_h(int16_t *x1,int16_t *x2,int16_t *y,uint32_t N,int32_t output_shift,int16_t sign) -This function performs optimized componentwise multiplication of the vector x1 with the conjugate of the vector x2. The output IS ADDED TO y. WARNING: make sure that output_shift is set to the right value, so that the result of the multiplication has the comma at the same place as y. - -@param x1 Input 1 in the format |Re0 Im0 Re0 Im0|,......,|Re(N-1) Im(N-1) Re(N-1) Im(N-1)| -@param x2 Input 2 in the format |Re0 Im0 Re0 Im0|,......,|Re(N-1) Im(N-1) Re(N-1) Im(N-1)| -@param y Output in the format |Re0 Im0 Re0 Im0|,......,|Re(N-1) Im(N-1) Re(N-1) Im(N-1)| -@param N Length of Vector (complex samples) WARNING: N>=4 -@param output_shift Number of bits to shift output down to Q1.15 (should be 15 for Q1.15 inputs) WARNING: log2_amp>0 can cause overflow!! -@param sign +1..add, -1..substract - -The function implemented is : \f$\mathbf{y} = \mathbf{y} + \mathbf{x_1}\odot\mathbf{x_2}^*\f$ -*/ -int32_t mult_cpx_vector_h(int16_t *x1, - int16_t *x2, - int16_t *y, - uint32_t N, - int32_t output_shift, - int16_t sign); - -/*!\fn int32_t mult_cpx_matrix_h(int16_t *x1[2][2],int16_t *x2[2][2],int16_t *y[2][2],uint32_t N,uint16_t output_shift,int16_t hermitian) -This function performs optimized componentwise matrix multiplication of the 2x2 matrices x1 with the 2x2 matrices x2. The output IS ADDED TO y (i.e. make sure y is initilized correctly). WARNING: make sure that output_shift is set to the right value, so that the result of the multiplication has the comma at the same place as y. - -@param x1 Input 1 in the format |Re0 Im0 Re0 Im0|,......,|Re(N-1) Im(N-1) Re(N-1) Im(N-1)| -@param x2 Input 2 in the format |Re0 Im0 Re0 Im0|,......,|Re(N-1) Im(N-1) Re(N-1) Im(N-1)| -@param y Output in the format |Re0 Im0 Re0 Im0|,......,|Re(N-1) Im(N-1) Re(N-1) Im(N-1)| -@param N Length of Vector (complex samples) WARNING: N>=4 -@param output_shift Number of bits to shift output down to Q1.15 (should be 15 for Q1.15 inputs) WARNING: log2_amp>0 can cause overflow!! -@param hermitian if !=0 the hermitian transpose is returned (i.e. A^H*B instead of A*B^H) -*/ -int32_t mult_cpx_matrix_h(int16_t *x1[2][2], - int16_t *x2[2][2], - int16_t *y[2][2], - uint32_t N, - uint16_t output_shift, - int16_t hermitian); - - -/*!\fn int32_t mult_cpx_matrix_vector(int32_t *x1[2][2],int32_t *x2[2],int32_t *y[2],uint32_t N,uint16_t output_shift) -This function performs optimized componentwise matrix-vector multiplication of the 2x2 matrices x1 with the 2x1 vectors x2. The output IS ADDED TO y (i.e. make sure y is initilized correctly). WARNING: make sure that output_shift is set to the right value, so that the result of the multiplication has the comma at the same place as y. - -@param x1 Input 1 in the format |Re0 Im0 Re0 Im0|,......,|Re(N-1) Im(N-1) Re(N-1) Im(N-1)| -@param x2 Input 2 in the format |Re0 -Im0 Im0 Re0|,......,|Re(N-1) -Im(N-1) Im(N-1) Re(N-1)| -@param y Output in the format |Re0 Im0 Re0 Im0|,......,|Re(N-1) Im(N-1) Re(N-1) Im(N-1)| WARNING: y must be different for x2 -@param N Length of Vector (complex samples) WARNING: N>=4 -@param output_shift Number of bits to shift output down to Q1.15 (should be 15 for Q1.15 inputs) WARNING: log2_amp>0 can cause overflow!! -*/ -int32_t mult_cpx_matrix_vector(int32_t *x1[2][2], - int32_t *x2[2], - int32_t *y[2], - uint32_t N, - uint16_t output_shift); /*!\fn void init_fft(uint16_t size,uint8_t logsize,uint16_t *rev) \brief Initialize the FFT engine for a given size @@ -289,6 +113,25 @@ int32_t mult_cpx_matrix_vector(int32_t *x1[2][2], @param rev Pointer to bit-reversal permutation array */ +//cmult_vv.c +/*! + Multiply elementwise the complex conjugate of x1 with x2. + @param x1 - input 1 in the format |Re0 Im0 Re1 Im1|,......,|Re(N-2) Im(N-2) Re(N-1) Im(N-1)| + We assume x1 with a dinamic of 15 bit maximum + @param x2 - input 2 in the format |Re0 Im0 Re1 Im1|,......,|Re(N-2) Im(N-2) Re(N-1) Im(N-1)| + We assume x2 with a dinamic of 14 bit maximum + @param y - output in the format |Re0 Im0 Re1 Im1|,......,|Re(N-2) Im(N-2) Re(N-1) Im(N-1)| + @param N - the size f the vectors (this function does N cpx mpy. WARNING: N>=4; + @param output_shift - shift to be applied to generate output +*/ + +int mult_cpx_conj_vector(int16_t *x1, + int16_t *x2, + int16_t *y, + uint32_t N, + int output_shift); + +// lte_dfts.c void init_fft(uint16_t size, uint8_t logsize, uint16_t *rev); @@ -355,6 +198,7 @@ int32_t rotate_cpx_vector(int16_t *x, uint16_t output_shift); +//cadd_sv.c /*!\fn int32_t add_cpx_vector(int16_t *x,int16_t *alpha,int16_t *y,uint32_t N) This function performs componentwise addition of a vector with a complex scalar. diff --git a/openair1/PHY/TOOLS/lte_dfts.c b/openair1/PHY/TOOLS/lte_dfts.c index ec4577a67a170f5d453b6d3e8fe02318e4bbf16a..b010f93aabeebb614535686ee1ca350a89d0eb4b 100644 --- a/openair1/PHY/TOOLS/lte_dfts.c +++ b/openair1/PHY/TOOLS/lte_dfts.c @@ -45,8 +45,10 @@ #define debug_msg #define ONE_OVER_SQRT2_Q15 23170 + #endif +#define ONE_OVER_SQRT3_Q15 18919 #include "PHY/sse_intrin.h" @@ -3180,6 +3182,8 @@ void idft1536(int16_t *input, int16_t *output) int i,i2,j; uint32_t tmp[3][512 ]__attribute__((aligned(16))); uint32_t tmpo[3][512] __attribute__((aligned(16))); + simd_q15_t *y128p=(simd_q15_t*)output; + simd_q15_t ONE_OVER_SQRT3_Q15_128 = set1_int16(ONE_OVER_SQRT3_Q15); for (i=0,j=0; i<512; i++) { tmp[0][i] = ((uint32_t *)input)[j++]; @@ -3190,17 +3194,6 @@ void idft1536(int16_t *input, int16_t *output) idft512((int16_t*)(tmp[0]),(int16_t*)(tmpo[0]),1); idft512((int16_t*)(tmp[1]),(int16_t*)(tmpo[1]),1); idft512((int16_t*)(tmp[2]),(int16_t*)(tmpo[2]),1); - /* - for (i=1; i<512; i++) { - tmpo[0][i] = tmpo[0][i<<1]; - tmpo[1][i] = tmpo[1][i<<1]; - tmpo[2][i] = tmpo[2][i<<1]; - }*/ - - // write_output("in.m","in",input,6144,1,1); - // write_output("out0.m","o0",tmpo[0],2048,1,1); - // write_output("out1.m","o1",tmpo[1],2048,1,1); - // write_output("out2.m","o2",tmpo[2],2048,1,1); for (i=0,i2=0; i<1024; i+=8,i2+=4) { ibfly3((simd_q15_t*)(&tmpo[0][i2]),(simd_q15_t*)(&tmpo[1][i2]),((simd_q15_t*)&tmpo[2][i2]), @@ -3209,6 +3202,26 @@ void idft1536(int16_t *input, int16_t *output) } + for (i=0; i<24; i++) { + y128p[0] = mulhi_int16(y128p[0],ONE_OVER_SQRT3_Q15_128); + y128p[1] = mulhi_int16(y128p[1],ONE_OVER_SQRT3_Q15_128); + y128p[2] = mulhi_int16(y128p[2],ONE_OVER_SQRT3_Q15_128); + y128p[3] = mulhi_int16(y128p[3],ONE_OVER_SQRT3_Q15_128); + y128p[4] = mulhi_int16(y128p[4],ONE_OVER_SQRT3_Q15_128); + y128p[5] = mulhi_int16(y128p[5],ONE_OVER_SQRT3_Q15_128); + y128p[6] = mulhi_int16(y128p[6],ONE_OVER_SQRT3_Q15_128); + y128p[7] = mulhi_int16(y128p[7],ONE_OVER_SQRT3_Q15_128); + y128p[8] = mulhi_int16(y128p[8],ONE_OVER_SQRT3_Q15_128); + y128p[9] = mulhi_int16(y128p[9],ONE_OVER_SQRT3_Q15_128); + y128p[10] = mulhi_int16(y128p[10],ONE_OVER_SQRT3_Q15_128); + y128p[11] = mulhi_int16(y128p[11],ONE_OVER_SQRT3_Q15_128); + y128p[12] = mulhi_int16(y128p[12],ONE_OVER_SQRT3_Q15_128); + y128p[13] = mulhi_int16(y128p[13],ONE_OVER_SQRT3_Q15_128); + y128p[14] = mulhi_int16(y128p[14],ONE_OVER_SQRT3_Q15_128); + y128p[15] = mulhi_int16(y128p[15],ONE_OVER_SQRT3_Q15_128); + y128p+=16; + } + _mm_empty(); _m_empty(); diff --git a/openair1/PHY/TOOLS/lte_phy_scope.c b/openair1/PHY/TOOLS/lte_phy_scope.c index 49cafa19b591216fea2b9b8f3b0480940b1d2e45..843a77fe62a3a060c816c6e009e9699a71700045 100644 --- a/openair1/PHY/TOOLS/lte_phy_scope.c +++ b/openair1/PHY/TOOLS/lte_phy_scope.c @@ -88,7 +88,7 @@ FD_lte_phy_scope_enb *create_lte_phy_scope_enb( void ) fl_set_object_boxtype( fdui->rxsig_t, FL_EMBOSSED_BOX ); fl_set_object_color( fdui->rxsig_t, FL_BLACK, FL_RED ); fl_set_object_lcolor( fdui->rxsig_t, FL_WHITE ); // Label color - fl_set_xyplot_ybounds(fdui->rxsig_t,30,70); + fl_set_xyplot_ybounds(fdui->rxsig_t,10,70); // Time-domain channel response fdui->chest_t = fl_add_xyplot( FL_NORMAL_XYPLOT, 410, 20, 370, 100, "Channel Impulse Response (samples, abs)" ); @@ -119,7 +119,7 @@ FD_lte_phy_scope_enb *create_lte_phy_scope_enb( void ) fl_set_xyplot_xgrid( fdui->pusch_llr,FL_GRID_MAJOR); // I/Q PUCCH comp (format 1) - fdui->pucch_comp1 = fl_add_xyplot( FL_POINTS_XYPLOT, 540, 480, 240, 100, "PUCCH I/Q of MF Output" ); + fdui->pucch_comp1 = fl_add_xyplot( FL_POINTS_XYPLOT, 540, 480, 240, 100, "PUCCH1 Energy (SR)" ); fl_set_object_boxtype( fdui->pucch_comp1, FL_EMBOSSED_BOX ); fl_set_object_color( fdui->pucch_comp1, FL_BLACK, FL_YELLOW ); fl_set_object_lcolor( fdui->pucch_comp1, FL_WHITE ); // Label color @@ -160,7 +160,7 @@ void phy_scope_eNB(FD_lte_phy_scope_enb *form, int UE_id) { int eNB_id = 0; - int i,arx,atx,ind,k; + int i,i2,arx,atx,ind,k; LTE_DL_FRAME_PARMS *frame_parms = &phy_vars_enb->lte_frame_parms; int nsymb_ce = 12*frame_parms->N_RB_UL*frame_parms->symbols_per_tti; uint8_t nb_antennas_rx = frame_parms->nb_antennas_rx; @@ -171,15 +171,17 @@ void phy_scope_eNB(FD_lte_phy_scope_enb *form, int16_t *pusch_llr; int16_t *pusch_comp; int32_t *pucch1_comp; - int16_t *pucch1ab_comp; + int32_t *pucch1_thres; + int32_t *pucch1ab_comp; float Re,Im,ymax; float *llr, *bit; float I[nsymb_ce*2], Q[nsymb_ce*2]; - float I_pucch[10240],Q_pucch[10240],A_pucch[10240],B_pucch[10240]; + float I_pucch[10240],Q_pucch[10240],A_pucch[10240],B_pucch[10240],C_pucch[10240]; float rxsig_t_dB[nb_antennas_rx][FRAME_LENGTH_COMPLEX_SAMPLES]; float chest_t_abs[nb_antennas_rx][frame_parms->ofdm_symbol_size]; float *chest_f_abs; float time[FRAME_LENGTH_COMPLEX_SAMPLES]; + float time2[2048]; float freq[nsymb_ce*nb_antennas_rx*nb_antennas_tx]; int frame = phy_vars_enb->proc[0].frame_tx; uint32_t total_dlsch_bitrate = phy_vars_enb->total_dlsch_bitrate; @@ -206,7 +208,8 @@ void phy_scope_eNB(FD_lte_phy_scope_enb *form, pusch_llr = (int16_t*) phy_vars_enb->lte_eNB_pusch_vars[UE_id]->llr; pusch_comp = (int16_t*) phy_vars_enb->lte_eNB_pusch_vars[UE_id]->rxdataF_comp[eNB_id][0]; pucch1_comp = (int32_t*) phy_vars_enb->pucch1_stats[UE_id]; - pucch1ab_comp = (int16_t*) phy_vars_enb->pucch1ab_stats[UE_id]; + pucch1_thres = (int32_t*) phy_vars_enb->pucch1_stats_thres[UE_id]; + pucch1ab_comp = (int32_t*) phy_vars_enb->pucch1ab_stats[UE_id]; // Received signal in time domain of receive antenna 0 if (rxsig_t != NULL) { @@ -236,19 +239,21 @@ void phy_scope_eNB(FD_lte_phy_scope_enb *form, if (chest_t[0] !=NULL) { for (i=0; i<(frame_parms->ofdm_symbol_size); i++) { - chest_t_abs[0][i] = 10*log10((float) (chest_t[0][2*i]*chest_t[0][2*i]+chest_t[0][2*i+1]*chest_t[0][2*i+1])); + i2 = (i+(frame_parms->ofdm_symbol_size>>1))%frame_parms->ofdm_symbol_size; + time2[i] = (float)(i-(frame_parms->ofdm_symbol_size>>1)); + chest_t_abs[0][i] = 10*log10((float) (1+chest_t[0][2*i2]*chest_t[0][2*i2]+chest_t[0][2*i2+1]*chest_t[0][2*i2+1])); if (chest_t_abs[0][i] > ymax) ymax = chest_t_abs[0][i]; } - fl_set_xyplot_data(form->chest_t,time,chest_t_abs[0],(frame_parms->ofdm_symbol_size),"","",""); + fl_set_xyplot_data(form->chest_t,time2,chest_t_abs[0],(frame_parms->ofdm_symbol_size),"","",""); } for (arx=1; arx<nb_antennas_rx; arx++) { if (chest_t[arx] !=NULL) { for (i=0; i<(frame_parms->ofdm_symbol_size>>3); i++) { - chest_t_abs[arx][i] = 10*log10((float) (chest_t[arx][2*i]*chest_t[arx][2*i]+chest_t[arx][2*i+1]*chest_t[arx][2*i+1])); + chest_t_abs[arx][i] = 10*log10((float) (1+chest_t[arx][2*i]*chest_t[arx][2*i]+chest_t[arx][2*i+1]*chest_t[arx][2*i+1])); if (chest_t_abs[arx][i] > ymax) ymax = chest_t_abs[arx][i]; @@ -337,16 +342,20 @@ void phy_scope_eNB(FD_lte_phy_scope_enb *form, // PUSCH I/Q of MF Output if (pucch1ab_comp!=NULL) { for (ind=0; ind<10240; ind++) { - I_pucch[ind] = pucch1ab_comp[2*ind]; - Q_pucch[ind] = pucch1ab_comp[2*ind+1]; + + I_pucch[ind] = (float)pucch1ab_comp[2*(ind)]; + Q_pucch[ind] = (float)pucch1ab_comp[2*(ind)+1]; A_pucch[ind] = 10*log10(pucch1_comp[ind]); B_pucch[ind] = ind; + C_pucch[ind] = (float)pucch1_thres[ind]; } fl_set_xyplot_data(form->pucch_comp,I_pucch,Q_pucch,10240,"","",""); fl_set_xyplot_data(form->pucch_comp1,B_pucch,A_pucch,1024,"","",""); - fl_set_xyplot_xbounds(form->pucch_comp,-200,200); - fl_set_xyplot_ybounds(form->pucch_comp,-100,100); - fl_set_xyplot_ybounds(form->pucch_comp1,10,40); + fl_add_xyplot_overlay(form->pucch_comp1,1,B_pucch,C_pucch,1024,FL_RED); + fl_set_xyplot_ybounds(form->pucch_comp,-5000,5000); + fl_set_xyplot_xbounds(form->pucch_comp,-5000,5000); + + fl_set_xyplot_ybounds(form->pucch_comp1,20,80); } @@ -387,7 +396,7 @@ FD_lte_phy_scope_ue *create_lte_phy_scope_ue( void ) fl_set_object_boxtype( fdui->rxsig_t, FL_EMBOSSED_BOX ); fl_set_object_color( fdui->rxsig_t, FL_BLACK, FL_RED ); fl_set_object_lcolor( fdui->rxsig_t, FL_WHITE ); // Label color - fl_set_xyplot_ybounds(fdui->rxsig_t,30,70); + fl_set_xyplot_ybounds(fdui->rxsig_t,10,70); // Time-domain channel response fdui->chest_t = fl_add_xyplot( FL_NORMAL_XYPLOT, 410, 20, 370, 100, "Channel Impulse Response (samples, abs)" ); diff --git a/openair1/PHY/TOOLS/signal_energy.c b/openair1/PHY/TOOLS/signal_energy.c index 323a1831dc17cbf1f72fc7df9004fb83a2127113..373fdc0d90acbe35cd3095ee51c25d099e87d780 100755 --- a/openair1/PHY/TOOLS/signal_energy.c +++ b/openair1/PHY/TOOLS/signal_energy.c @@ -197,7 +197,7 @@ int32_t signal_energy(int32_t *input,uint32_t length) for (i=0; i<length>>1; i++) { tmpE = vqaddq_s32(tmpE,vshrq_n_s32(vmull_s16(*in,*in),shift)); - tmpDC = vaddw_s16(tmpDC,vshr_n_s16(*in++,shift_DC)); + //tmpDC = vaddw_s16(tmpDC,vshr_n_s16(*in++,shift_DC)); } diff --git a/openair1/PHY/TOOLS/time_meas.h b/openair1/PHY/TOOLS/time_meas.h index a3df8970535976cdbe1b235dd6ad56e4a588d38c..3e621ac281bb41dde0164b9ad848f87becfd9f0f 100644 --- a/openair1/PHY/TOOLS/time_meas.h +++ b/openair1/PHY/TOOLS/time_meas.h @@ -26,6 +26,9 @@ Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE *******************************************************************************/ +#ifndef __TIME_MEAS_DEFS__H__ +#define __TIME_MEAS_DEFS__H__ + #include <unistd.h> #include <math.h> #include <stdint.h> @@ -148,3 +151,4 @@ static inline void copy_meas(time_stats_t *dst_ts,time_stats_t *src_ts) dst_ts->max=src_ts->max; } } +#endif diff --git a/openair1/PHY/defs.h b/openair1/PHY/defs.h index 398861cabfc95eb2840b3be8b71951a32c4cc71a..f308c0500aca2bd6908625c9a63cee6947a21b1c 100755 --- a/openair1/PHY/defs.h +++ b/openair1/PHY/defs.h @@ -76,6 +76,13 @@ #define openair_free(y,x) free((y)) #define PAGE_SIZE 4096 +//#ifdef SHRLIBDEV +//extern int rxrescale; +//#define RX_IQRESCALELEN rxrescale +//#else +//#define RX_IQRESCALELEN 15 +//#endif + //! \brief Allocate \c size bytes of memory on the heap with alignment 16 and zero it afterwards. //! If no more memory is available, this function will terminate the program with an assertion error. static inline void* malloc16_clear( size_t size ) @@ -313,6 +320,8 @@ typedef struct PHY_VARS_eNB_s { struct PhysicalConfigDedicated *physicalConfigDedicated[NUMBER_OF_UE_MAX]; + uint32_t rb_mask_ul[4]; + /// Information regarding TM5 MU_MIMO_mode mu_mimo_mode[NUMBER_OF_UE_MAX]; @@ -374,12 +383,13 @@ typedef struct PHY_VARS_eNB_s { #ifdef LOCALIZATION /// time state for localization time_stats_t localization_stats; -#endif +#endif int32_t pucch1_stats_cnt[NUMBER_OF_UE_MAX][10]; int32_t pucch1_stats[NUMBER_OF_UE_MAX][10*1024]; + int32_t pucch1_stats_thres[NUMBER_OF_UE_MAX][10*1024]; int32_t pucch1ab_stats_cnt[NUMBER_OF_UE_MAX][10]; - int32_t pucch1ab_stats[NUMBER_OF_UE_MAX][10*1024]; + int32_t pucch1ab_stats[NUMBER_OF_UE_MAX][2*10*1024]; #if ENABLE_RAL hash_table_t *ral_thresholds_timed; diff --git a/openair1/PHY/impl_defs_lte.h b/openair1/PHY/impl_defs_lte.h index a0ef6c005a622d71121a26f47f904876f6c3eaa6..cd6ee4eccecf2a61d9c3d316676143c2f4764e6a 100644 --- a/openair1/PHY/impl_defs_lte.h +++ b/openair1/PHY/impl_defs_lte.h @@ -516,10 +516,10 @@ typedef struct { uint8_t dual_tx; /// flag to indicate SISO transmission uint8_t mode1_flag; + /// Indicator that 20 MHz channel uses 3/4 sampling frequency + uint8_t threequarter_fs; /// Size of FFT uint16_t ofdm_symbol_size; - /// log2(Size of FFT) - uint8_t log2_symbol_size; /// Number of prefix samples in all but first symbol of slot uint16_t nb_prefix_samples; /// Number of prefix samples in first symbol of slot diff --git a/openair1/PHY/impl_defs_top.h b/openair1/PHY/impl_defs_top.h index c84b7d3ece8544bb34e0c5b8b3134ea0e025bb66..18b16b8670b978bc00ef39363190c562f148569a 100755 --- a/openair1/PHY/impl_defs_top.h +++ b/openair1/PHY/impl_defs_top.h @@ -44,7 +44,14 @@ /** @defgroup _ref_implementation_ OpenAirInterface LTE Implementation * @{ - * @defgroup _PHY_RF_INTERFACE_ Generic PHY - RF Interface + * @defgroup _PHY_RF_INTERFACE_ PHY - RF Interface + * @ingroup _PHY_RF_INTERFACE_ + * @{ + * @defgroup _GENERIC_PHY_RF_INTERFACE_ Generic PHY - RF Interface + * @defgroup _USRP_PHY_RF_INTERFACE_ PHY - USRP RF Interface + * @defgroup _BLADERF_PHY_RF_INTERFACE_ PHY - BLADERF RF Interface + * @} + * * @ingroup _ref_implementation_ * @{ * This module is responsible for defining the generic interface between PHY and RF Target @@ -117,7 +124,6 @@ */ #define NUMBER_OF_OFDM_CARRIERS (frame_parms->ofdm_symbol_size) #define NUMBER_OF_SYMBOLS_PER_FRAME (frame_parms->symbols_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME) -#define LOG2_NUMBER_OF_OFDM_CARRIERS (frame_parms->log2_symbol_size) #define NUMBER_OF_USEFUL_CARRIERS (12*frame_parms->N_RB_DL) #define NUMBER_OF_ZERO_CARRIERS (NUMBER_OF_OFDM_CARRIERS-NUMBER_OF_USEFUL_CARRIERS) #define NUMBER_OF_USEFUL_CARRIERS_BYTES (NUMBER_OF_USEFUL_CARRIERS>>2) @@ -340,13 +346,12 @@ typedef struct { #define NUMBER_OF_SUBBANDS_MAX 13 #define NUMBER_OF_HARQ_PID_MAX 8 -#if defined(CBMIMO1) || defined(EXMIMO) || defined(OAI_USRP) #define MAX_FRAME_NUMBER 0x400 +#if defined(CBMIMO1) || defined(EXMIMO) || defined(OAI_USRP) #define NUMBER_OF_eNB_MAX 1 #define NUMBER_OF_UE_MAX 4 #define NUMBER_OF_CONNECTED_eNB_MAX 3 #else -#define MAX_FRAME_NUMBER 0xFFFF #ifdef LARGE_SCALE #define NUMBER_OF_eNB_MAX 2 #define NUMBER_OF_UE_MAX 120 @@ -471,13 +476,13 @@ typedef struct { //! estimated avg noise power (dB) short n0_power_tot_dBm; //! estimated avg noise power per RB per RX ant (lin) - unsigned short n0_subband_power[NB_ANTENNAS_RX][25]; + unsigned short n0_subband_power[NB_ANTENNAS_RX][100]; //! estimated avg noise power per RB per RX ant (dB) - unsigned short n0_subband_power_dB[NB_ANTENNAS_RX][25]; + unsigned short n0_subband_power_dB[NB_ANTENNAS_RX][100]; //! estimated avg noise power per RB (dB) - short n0_subband_power_tot_dB[25]; + short n0_subband_power_tot_dB[100]; //! estimated avg noise power per RB (dBm) - short n0_subband_power_tot_dBm[25]; + short n0_subband_power_tot_dBm[100]; // eNB measurements (per user) //! estimated received spatial signal power (linear) unsigned int rx_spatial_power[NUMBER_OF_UE_MAX][2][2]; @@ -497,13 +502,13 @@ typedef struct { /// Wideband CQI (sum of all RX antennas, in dB) char wideband_cqi_tot[NUMBER_OF_UE_MAX]; /// Subband CQI per RX antenna and RB (= SINR) - int subband_cqi[NUMBER_OF_UE_MAX][NB_ANTENNAS_RX][25]; + int subband_cqi[NUMBER_OF_UE_MAX][NB_ANTENNAS_RX][100]; /// Total Subband CQI and RB (= SINR) - int subband_cqi_tot[NUMBER_OF_UE_MAX][25]; + int subband_cqi_tot[NUMBER_OF_UE_MAX][100]; /// Subband CQI in dB and RB (= SINR dB) - int subband_cqi_dB[NUMBER_OF_UE_MAX][NB_ANTENNAS_RX][25]; + int subband_cqi_dB[NUMBER_OF_UE_MAX][NB_ANTENNAS_RX][100]; /// Total Subband CQI and RB - int subband_cqi_tot_dB[NUMBER_OF_UE_MAX][25]; + int subband_cqi_tot_dB[NUMBER_OF_UE_MAX][100]; } PHY_MEASUREMENTS_eNB; diff --git a/openair1/SCHED/defs.h b/openair1/SCHED/defs.h index a88327ba92e6b1ddc1e0121bb55b61d16a04a70a..8692a31f1249a49f390d26a3bd1ba13adf12f0e1 100644 --- a/openair1/SCHED/defs.h +++ b/openair1/SCHED/defs.h @@ -399,7 +399,6 @@ uint32_t pdcch_alloc2ul_frame(LTE_DL_FRAME_PARMS *frame_parms,uint32_t frame, ui uint16_t get_Np(uint8_t N_RB_DL,uint8_t nCCE,uint8_t plus1); -int get_nCCE_offset(unsigned char L, int nCCE, int common_dci, unsigned short rnti, unsigned char subframe); void put_harq_pid_in_freelist(LTE_eNB_DLSCH_t *DLSCH_ptr, int harq_pid); void remove_harq_pid_from_freelist(LTE_eNB_DLSCH_t *DLSCH_ptr, int harq_pid); diff --git a/openair1/SCHED/phy_procedures_lte_common.c b/openair1/SCHED/phy_procedures_lte_common.c index ce659a60f809605716452283577c9629de4802fe..c51bd82d8a7345009537fc89051100bfbecdb98b 100755 --- a/openair1/SCHED/phy_procedures_lte_common.c +++ b/openair1/SCHED/phy_procedures_lte_common.c @@ -405,8 +405,8 @@ uint8_t get_ack(LTE_DL_FRAME_PARMS *frame_parms, if (harq_ack[0].send_harq_status == 1) o_ACK[1] = harq_ack[0].ack; - } else if (harq_ack[8].send_harq_status == 1) - o_ACK[0] = harq_ack[8].ack; + } else if (harq_ack[0].send_harq_status == 1) + o_ACK[0] = harq_ack[0].ack; status = harq_ack[9].send_harq_status + (harq_ack[0].send_harq_status<<1); //printf("Subframe 4, TDD config 3: harq_ack[9] = %d,harq_ack[0] = %d\n",harq_ack[9].ack,harq_ack[0].ack); diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c index d0736575192e47fc1909572bb2e0ca84ad7d4afc..60cd0ec0f7515d23d510cdf0e81dbdba4c8ff702 100755 --- a/openair1/SCHED/phy_procedures_lte_eNb.c +++ b/openair1/SCHED/phy_procedures_lte_eNb.c @@ -104,7 +104,6 @@ extern uint8_t smbv_frame_cnt; #ifdef DIAG_PHY extern int rx_sig_fifo; #endif -static unsigned char I0_clear = 1; uint8_t is_SR_subframe(PHY_VARS_eNB *phy_vars_eNB,uint8_t UE_id,uint8_t sched_subframe) { @@ -322,100 +321,6 @@ int get_ue_active_harq_pid(const uint8_t Mod_id,const uint8_t CC_id,const uint16 return(0); } -int CCE_table[800]; - -void init_nCCE_table(void) -{ - memset(CCE_table,0,800*sizeof(int)); -} - - -int get_nCCE_offset(const unsigned char L, const int nCCE, const int common_dci, const unsigned short rnti, const unsigned char subframe) -{ - - int search_space_free,m,nb_candidates = 0,l,i; - unsigned int Yk; - - /* - printf("CCE Allocation: "); - for (i=0;i<nCCE;i++) - printf("%d.",CCE_table[i]); - printf("\n"); - */ - if (common_dci == 1) { - // check CCE(0 ... L-1) - nb_candidates = (L==4) ? 4 : 2; - nb_candidates = min(nb_candidates,nCCE/L); - - for (m = nb_candidates-1 ; m >=0 ; m--) { - search_space_free = 1; - for (l=0; l<L; l++) { - if (CCE_table[(m*L) + l] == 1) { - search_space_free = 0; - break; - } - } - - if (search_space_free == 1) { - for (l=0; l<L; l++) - CCE_table[(m*L)+l]=1; - return(m*L); - } - } - - return(-1); - - } else { // Find first available in ue specific search space - // according to procedure in Section 9.1.1 of 36.213 (v. 8.6) - // compute Yk - Yk = (unsigned int)rnti; - - for (i=0; i<=subframe; i++) - Yk = (Yk*39827)%65537; - - Yk = Yk % (nCCE/L); - - - switch (L) { - case 1: - case 2: - nb_candidates = 6; - break; - - case 4: - case 8: - nb_candidates = 2; - break; - - default: - DevParam(L, nCCE, rnti); - break; - } - - // LOG_I(PHY,"rnti %x, Yk = %d, nCCE %d (nCCE/L %d),nb_cand %d\n",rnti,Yk,nCCE,nCCE/L,nb_candidates); - - for (m = 0 ; m < nb_candidates ; m++) { - search_space_free = 1; - - for (l=0; l<L; l++) { - if (CCE_table[(((Yk+m)%(nCCE/L))*L) + l] == 1) { - search_space_free = 0; - break; - } - } - - if (search_space_free == 1) { - for (l=0; l<L; l++) - CCE_table[(((Yk+m)%(nCCE/L))*L)+l]=1; - - return(((Yk+m)%(nCCE/L))*L); - } - } - - return(-1); - } -} - int16_t get_target_pusch_rx_power(const module_id_t module_idP, const uint8_t CC_id) { //return PHY_vars_eNB_g[module_idP][CC_id]->PHY_measurements_eNB[0].n0_power_tot_dBm; @@ -501,6 +406,7 @@ void phy_procedures_eNB_S_RX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars if (abstraction_flag == 0) { lte_eNB_I0_measurements(phy_vars_eNB, + subframe, 0, phy_vars_eNB->first_run_I0_measurements); } @@ -514,8 +420,6 @@ void phy_procedures_eNB_S_RX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars #endif - if (I0_clear == 1) - I0_clear = 0; } @@ -1838,15 +1742,18 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e phy_vars_eNB->dlsch_eNB[i][0]->subframe_tx[subframe] = 0; } - init_nCCE_table(); + // init_nCCE_table(); - num_pdcch_symbols = get_num_pdcch_symbols(DCI_pdu->Num_common_dci + DCI_pdu->Num_ue_spec_dci, - DCI_pdu->dci_alloc, - &phy_vars_eNB->lte_frame_parms, - subframe); + num_pdcch_symbols = DCI_pdu->num_pdcch_symbols; + /*get_num_pdcch_symbols(DCI_pdu->Num_common_dci + DCI_pdu->Num_ue_spec_dci, + DCI_pdu->dci_alloc, + &phy_vars_eNB->lte_frame_parms, + subframe);*/ + /* DCI_pdu->nCCE = get_nCCE(num_pdcch_symbols, &phy_vars_eNB->lte_frame_parms, - get_mi(&phy_vars_eNB->lte_frame_parms,subframe)); + get_mi(&phy_vars_eNB->lte_frame_parms,subframe));*/ + LOG_D(PHY,"num_pdcch_symbols %"PRIu8", nCCE %u (dci commond %"PRIu8", dci uespec %"PRIu8"\n",num_pdcch_symbols,DCI_pdu->nCCE, DCI_pdu->Num_common_dci,DCI_pdu->Num_ue_spec_dci); @@ -1862,6 +1769,7 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e #endif for (i=0; i<DCI_pdu->Num_common_dci + DCI_pdu->Num_ue_spec_dci ; i++) { + LOG_D(PHY,"[eNB] Subframe %d: DCI %d/%d : rnti %x, CCEind %d\n",subframe,i,DCI_pdu->Num_common_dci+DCI_pdu->Num_ue_spec_dci,DCI_pdu->dci_alloc[i].rnti,DCI_pdu->dci_alloc[i].firstCCE); #ifdef DEBUG_PHY_PROC if (DCI_pdu->dci_alloc[i].rnti != SI_RNTI) { @@ -1889,28 +1797,21 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e phy_vars_eNB->eNB_UE_stats[0].DL_pmi_single); - int result = get_nCCE_offset(1<<DCI_pdu->dci_alloc[i].L, DCI_pdu->nCCE, 1, SI_RNTI, subframe); - phy_vars_eNB->dlsch_eNB_SI->nCCE[subframe] = result; - - if (result == -1) { - // FIXME what happens to phy_vars_eNB->dlsch_eNB_SI->nCCE[subframe]? - LOG_E(PHY,"[eNB %"PRIu8"] Frame %d subframe %d : No available CCE resources for common DCI (SI)!!!\n",phy_vars_eNB->Mod_id,phy_vars_eNB->proc[sched_subframe].frame_tx,subframe); - } else { - LOG_T(PHY,"[eNB %"PRIu8"] Frame %d subframe %d : CCE resource for common DCI (SI) => %"PRIu8"/%u\n",phy_vars_eNB->Mod_id,phy_vars_eNB->proc[sched_subframe].frame_tx,subframe, - phy_vars_eNB->dlsch_eNB_SI->nCCE[subframe],DCI_pdu->nCCE); + phy_vars_eNB->dlsch_eNB_SI->nCCE[subframe] = DCI_pdu->dci_alloc[i].firstCCE; + LOG_T(PHY,"[eNB %"PRIu8"] Frame %d subframe %d : CCE resource for common DCI (SI) => %"PRIu8"/%u\n",phy_vars_eNB->Mod_id,phy_vars_eNB->proc[sched_subframe].frame_tx,subframe, + phy_vars_eNB->dlsch_eNB_SI->nCCE[subframe],DCI_pdu->nCCE); + #if defined(SMBV) && !defined(EXMIMO) - // configure SI DCI - if (smbv_is_config_frame(phy_vars_eNB->proc[sched_subframe].frame_tx) && (smbv_frame_cnt < 4)) { - msg("[SMBV] Frame %3d, SI in SF %d DCI %"PRIu32"\n",phy_vars_eNB->proc[sched_subframe].frame_tx,subframe,i); - smbv_configure_common_dci(smbv_fname,(smbv_frame_cnt*10) + (subframe), "SI", &DCI_pdu->dci_alloc[i], i); - } - -#endif + // configure SI DCI + if (smbv_is_config_frame(phy_vars_eNB->proc[sched_subframe].frame_tx) && (smbv_frame_cnt < 4)) { + msg("[SMBV] Frame %3d, SI in SF %d DCI %"PRIu32"\n",phy_vars_eNB->proc[sched_subframe].frame_tx,subframe,i); + smbv_configure_common_dci(smbv_fname,(smbv_frame_cnt*10) + (subframe), "SI", &DCI_pdu->dci_alloc[i], i); } - - DCI_pdu->dci_alloc[i].nCCE = phy_vars_eNB->dlsch_eNB_SI->nCCE[subframe]; + +#endif + } else if (DCI_pdu->dci_alloc[i].ra_flag == 1) { #ifdef DEBUG_PHY_PROC @@ -1931,28 +1832,20 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e // mac_xface->macphy_exit("Transmitted RAR, exiting\n"); - int result = get_nCCE_offset(1<<DCI_pdu->dci_alloc[i].L, DCI_pdu->nCCE, 1, DCI_pdu->dci_alloc[i].rnti, subframe); - phy_vars_eNB->dlsch_eNB_ra->nCCE[subframe] = result; - - if (result == -1) { - // FIXME what happens to phy_vars_eNB->dlsch_eNB_ra->nCCE[subframe]? - LOG_E(PHY,"[eNB %"PRIu8"] Frame %d subframe %d : No available CCE resources for common DCI (RA) !!!\n",phy_vars_eNB->Mod_id,phy_vars_eNB->proc[sched_subframe].frame_tx,subframe); - } else { - LOG_D(PHY,"[eNB %"PRIu8"] Frame %d subframe %d : CCE resource for common DCI (RA) => %"PRIu8"/%u\n",phy_vars_eNB->Mod_id,phy_vars_eNB->proc[sched_subframe].frame_tx,subframe, - phy_vars_eNB->dlsch_eNB_ra->nCCE[subframe],DCI_pdu->nCCE); -#if defined(SMBV) && !defined(EXMIMO) - // configure RA DCI - if (smbv_is_config_frame(phy_vars_eNB->proc[sched_subframe].frame_tx) && (smbv_frame_cnt < 4)) { - msg("[SMBV] Frame %3d, RA in SF %d DCI %"PRIu32"\n",phy_vars_eNB->proc[sched_subframe].frame_tx,subframe,i); - smbv_configure_common_dci(smbv_fname,(smbv_frame_cnt*10) + (subframe), "RA", &DCI_pdu->dci_alloc[i], i); - } + phy_vars_eNB->dlsch_eNB_ra->nCCE[subframe] = DCI_pdu->dci_alloc[i].firstCCE; -#endif + LOG_D(PHY,"[eNB %"PRIu8"] Frame %d subframe %d : CCE resource for common DCI (RA) => %"PRIu8"/%u\n",phy_vars_eNB->Mod_id,phy_vars_eNB->proc[sched_subframe].frame_tx,subframe, + phy_vars_eNB->dlsch_eNB_ra->nCCE[subframe],DCI_pdu->nCCE); +#if defined(SMBV) && !defined(EXMIMO) + // configure RA DCI + if (smbv_is_config_frame(phy_vars_eNB->proc[sched_subframe].frame_tx) && (smbv_frame_cnt < 4)) { + msg("[SMBV] Frame %3d, RA in SF %d DCI %"PRIu32"\n",phy_vars_eNB->proc[sched_subframe].frame_tx,subframe,i); + smbv_configure_common_dci(smbv_fname,(smbv_frame_cnt*10) + (subframe), "RA", &DCI_pdu->dci_alloc[i], i); } - DCI_pdu->dci_alloc[i].nCCE = phy_vars_eNB->dlsch_eNB_ra->nCCE[subframe]; +#endif } @@ -1993,30 +1886,22 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e LOG_D(PHY,"[eNB %"PRIu8"][PDSCH %"PRIx16"/%"PRIu8"] Frame %d subframe %d: Generated dlsch params\n", phy_vars_eNB->Mod_id,DCI_pdu->dci_alloc[i].rnti,phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->current_harq_pid,phy_vars_eNB->proc[sched_subframe].frame_tx,subframe); - int result = get_nCCE_offset(1<<DCI_pdu->dci_alloc[i].L, DCI_pdu->nCCE, 0, DCI_pdu->dci_alloc[i].rnti, subframe); - phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->nCCE[subframe] = result; - if (result == -1) { - // FIXME what happens to phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->nCCE[subframe]? - LOG_E(PHY,"[eNB %"PRIu8"] Frame %d subframe %d : No available CCE resources for UE spec DCI (PDSCH %"PRIx16") !!!\n", - phy_vars_eNB->Mod_id,phy_vars_eNB->proc[sched_subframe].frame_tx,subframe,DCI_pdu->dci_alloc[i].rnti); - } else { - LOG_D(PHY,"[eNB %"PRIu8"] Frame %d subframe %d : CCE resource for ue DCI (PDSCH %"PRIx16") => %"PRIu8"/%u\n",phy_vars_eNB->Mod_id,phy_vars_eNB->proc[sched_subframe].frame_tx,subframe, - DCI_pdu->dci_alloc[i].rnti,phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->nCCE[subframe],DCI_pdu->nCCE); + phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->nCCE[subframe] = DCI_pdu->dci_alloc[i].firstCCE; -#if defined(SMBV) && !defined(EXMIMO) - DCI_pdu->dci_alloc[i].nCCE = phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->nCCE[subframe]; + LOG_D(PHY,"[eNB %"PRIu8"] Frame %d subframe %d : CCE resource for ue DCI (PDSCH %"PRIx16") => %"PRIu8"/%u\n",phy_vars_eNB->Mod_id,phy_vars_eNB->proc[sched_subframe].frame_tx,subframe, + DCI_pdu->dci_alloc[i].rnti,phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->nCCE[subframe],DCI_pdu->nCCE); - // configure UE-spec DCI - if (smbv_is_config_frame(phy_vars_eNB->proc[sched_subframe].frame_tx) && (smbv_frame_cnt < 4)) { - msg("[SMBV] Frame %3d, PDSCH in SF %d DCI %"PRIu32"\n",phy_vars_eNB->proc[sched_subframe].frame_tx,subframe,i); - smbv_configure_ue_spec_dci(smbv_fname,(smbv_frame_cnt*10) + (subframe), UE_id+1, &DCI_pdu->dci_alloc[i], i); - } +#if defined(SMBV) && !defined(EXMIMO) + + // configure UE-spec DCI + if (smbv_is_config_frame(phy_vars_eNB->proc[sched_subframe].frame_tx) && (smbv_frame_cnt < 4)) { + msg("[SMBV] Frame %3d, PDSCH in SF %d DCI %"PRIu32"\n",phy_vars_eNB->proc[sched_subframe].frame_tx,subframe,i); + smbv_configure_ue_spec_dci(smbv_fname,(smbv_frame_cnt*10) + (subframe), UE_id+1, &DCI_pdu->dci_alloc[i], i); + } #endif - } - DCI_pdu->dci_alloc[i].nCCE = phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->nCCE[subframe]; #ifdef DEBUG_PHY_PROC //if (phy_vars_eNB->proc[sched_subframe].frame_tx%100 == 0) LOG_D(PHY,"[eNB %"PRIu8"][DCI][PDSCH %"PRIx16"] Frame %d subframe %d UE_id %"PRId8" Generated DCI format %d, aggregation %d\n", @@ -2094,29 +1979,21 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e CBA_RNTI, 0); // do_srs - if ((DCI_pdu->dci_alloc[i].nCCE=get_nCCE_offset(1<<DCI_pdu->dci_alloc[i].L, - DCI_pdu->nCCE, - 0, - DCI_pdu->dci_alloc[i].rnti, - subframe)) == -1) { - LOG_E(PHY,"[eNB %"PRIu8"] Frame %d subframe %d : No available CCE resources (%u) for UE spec DCI (PUSCH %"PRIx16") !!!\n", - phy_vars_eNB->Mod_id,phy_vars_eNB->proc[sched_subframe].frame_tx,subframe,DCI_pdu->nCCE,DCI_pdu->dci_alloc[i].rnti); - } else { - LOG_T(PHY,"[eNB %"PRIu8"] Frame %d subframe %d : CCE resources for UE spec DCI (PUSCH %"PRIx16") => %d/%u\n", - phy_vars_eNB->Mod_id,phy_vars_eNB->proc[sched_subframe].frame_tx,subframe,DCI_pdu->dci_alloc[i].rnti, - DCI_pdu->dci_alloc[i].nCCE,DCI_pdu->nCCE); - + LOG_T(PHY,"[eNB %"PRIu8"] Frame %d subframe %d : CCE resources for UE spec DCI (PUSCH %"PRIx16") => %d/%u\n", + phy_vars_eNB->Mod_id,phy_vars_eNB->proc[sched_subframe].frame_tx,subframe,DCI_pdu->dci_alloc[i].rnti, + DCI_pdu->dci_alloc[i].firstCCE,DCI_pdu->nCCE); + #if defined(SMBV) && !defined(EXMIMO) // configure UE-spec DCI for UL Grant - if (smbv_is_config_frame(phy_vars_eNB->proc[sched_subframe].frame_tx) && (smbv_frame_cnt < 4)) { - msg("[SMBV] Frame %3d, SF %d UL DCI %"PRIu32"\n",phy_vars_eNB->proc[sched_subframe].frame_tx,subframe,i); - smbv_configure_ue_spec_dci(smbv_fname,(smbv_frame_cnt*10) + (subframe), UE_id+1, &DCI_pdu->dci_alloc[i], i); - } - + if (smbv_is_config_frame(phy_vars_eNB->proc[sched_subframe].frame_tx) && (smbv_frame_cnt < 4)) { + msg("[SMBV] Frame %3d, SF %d UL DCI %"PRIu32"\n",phy_vars_eNB->proc[sched_subframe].frame_tx,subframe,i); + smbv_configure_ue_spec_dci(smbv_fname,(smbv_frame_cnt*10) + (subframe), UE_id+1, &DCI_pdu->dci_alloc[i], i); + } + #endif - } + #ifdef DEBUG_PHY_PROC LOG_D(PHY,"[eNB %"PRIu8"][PUSCH %"PRIu8"] frame %d subframe %d Setting subframe_scheduling_flag for UE %"PRIu32" harq_pid %"PRIu8" (ul subframe %"PRIu8")\n", @@ -2147,13 +2024,13 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e } if (abstraction_flag == 0) { -#ifdef DEBUG_PHY_PROC + //#ifdef DEBUG_PHY_PROC if (DCI_pdu->Num_ue_spec_dci+DCI_pdu->Num_common_dci > 0) LOG_D(PHY,"[eNB %"PRIu8"] Frame %d, subframe %d: Calling generate_dci_top (pdcch) (common %"PRIu8",ue_spec %"PRIu8")\n",phy_vars_eNB->Mod_id,phy_vars_eNB->proc[sched_subframe].frame_tx, subframe, DCI_pdu->Num_common_dci,DCI_pdu->Num_ue_spec_dci); -#endif + //#endif // for (sect_id=0;sect_id<number_of_cards;sect_id++) num_pdcch_symbols = generate_dci_top(DCI_pdu->Num_ue_spec_dci, @@ -2436,7 +2313,7 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e input_buffer_length = phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->harq_processes[harq_pid]->TBS/8; -#ifdef DEBUG_PHY_PROC + //#ifdef DEBUG_PHY_PROC LOG_D(PHY, "[eNB %"PRIu8"][PDSCH %"PRIx16"/%"PRIu8"] Frame %d, subframe %d: Generating PDSCH/DLSCH with input size = %"PRIu16", G %d, nb_rb %"PRIu16", mcs %"PRIu8", pmi_alloc %"PRIx16", rv %"PRIu8" (round %"PRIu8")\n", phy_vars_eNB->Mod_id, phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->rnti,harq_pid, @@ -2452,7 +2329,7 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e pmi2hex_2Ar1(phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->harq_processes[harq_pid]->pmi_alloc), phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->harq_processes[harq_pid]->rvidx, phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->harq_processes[harq_pid]->round); -#endif + //#endif #if defined(MESSAGE_CHART_GENERATOR_PHY) MSC_LOG_TX_MESSAGE( MSC_PHY_ENB,MSC_PHY_UE, @@ -3245,7 +3122,7 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_ int16_t n1_pucch0,n1_pucch1,n1_pucch2,n1_pucch3; uint8_t do_SR = 0; uint8_t pucch_sel = 0; - int32_t metric0=0,metric1=0; + int32_t metric0=0,metric1=0,metric0_SR=0; ANFBmode_t bundling_flag; PUCCH_FMT_t format; uint8_t nPRS; @@ -3274,6 +3151,11 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_ phy_vars_eNB->lte_frame_parms.samples_per_tti); #endif */ + phy_vars_eNB->rb_mask_ul[0]=0; + phy_vars_eNB->rb_mask_ul[1]=0; + phy_vars_eNB->rb_mask_ul[2]=0; + phy_vars_eNB->rb_mask_ul[3]=0; + if (abstraction_flag == 0) { remove_7_5_kHz(phy_vars_eNB,subframe<<1); remove_7_5_kHz(phy_vars_eNB,(subframe<<1)+1); @@ -3422,6 +3304,12 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_ pusch_active = 1; round = phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->round; + for (int rb=0; + rb<=phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->nb_rb; + rb++) { + int rb2 = rb+phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->first_rb; + phy_vars_eNB->rb_mask_ul[rb2>>5] |= (1<<(rb2&31)); + } #ifdef DEBUG_PHY_PROC LOG_D(PHY,"[eNB %d][PUSCH %d] frame %d subframe %d Scheduling PUSCH/ULSCH Reception for rnti %x (UE_id %d)\n", phy_vars_eNB->Mod_id,harq_pid, @@ -3463,7 +3351,7 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_ } } -#ifdef DEBUG_PHY_PROC + //#ifdef DEBUG_PHY_PROC LOG_D(PHY, "[eNB %d][PUSCH %d] Frame %d Subframe %d Demodulating PUSCH: dci_alloc %d, rar_alloc %d, round %d, first_rb %d, nb_rb %d, mcs %d, TBS %d, rv %d, cyclic_shift %d (n_DMRS2 %d, cyclicShift_common %d, nprs %d), O_ACK %d \n", phy_vars_eNB->Mod_id,harq_pid,frame,subframe, @@ -3480,7 +3368,7 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_ phy_vars_eNB->lte_frame_parms.pusch_config_common.ul_ReferenceSignalsPUSCH.cyclicShift, nPRS, phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->O_ACK); -#endif + //#endif start_meas(&phy_vars_eNB->ulsch_demodulation_stats); if (abstraction_flag==0) { @@ -3526,7 +3414,7 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_ #endif stop_meas(&phy_vars_eNB->ulsch_decoding_stats); -#ifdef DEBUG_PHY_PROC + //#ifdef DEBUG_PHY_PROC LOG_D(PHY,"[eNB %d][PUSCH %d] frame %d subframe %d RNTI %x RX power (%d,%d) RSSI (%d,%d) N0 (%d,%d) dB ACK (%d,%d), decoding iter %d\n", phy_vars_eNB->Mod_id,harq_pid, frame,subframe, @@ -3540,7 +3428,7 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_ phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->o_ACK[0], phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->o_ACK[1], ret); -#endif //DEBUG_PHY_PROC + //#endif //DEBUG_PHY_PROC /* if ((two_ues_connected==1) && (phy_vars_eNB->cooperation_flag==2)) { for (j=0;j<phy_vars_eNB->lte_frame_parms.nb_antennas_rx;j++) { @@ -3742,13 +3630,19 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_ for (j=0; j<phy_vars_eNB->lte_frame_parms.nb_antennas_rx; j++) //this is the RSSI per RB phy_vars_eNB->eNB_UE_stats[i].UL_rssi[j] = + dB_fixed(phy_vars_eNB->lte_eNB_pusch_vars[i]->ulsch_power[j]* (phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->nb_rb*12)/ phy_vars_eNB->lte_frame_parms.ofdm_symbol_size) - phy_vars_eNB->rx_total_gain_eNB_dB - hundred_times_log10_NPRB[phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->nb_rb-1]/100 - get_hundred_times_delta_IF_eNB(phy_vars_eNB,i,harq_pid, 0)/100; - + + /* + dB_fixed(phy_vars_eNB->lte_eNB_pusch_vars[i]->ulsch_power[j]*phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->nb_rb) - + phy_vars_eNB->rx_total_gain_eNB_dB - + hundred_times_log10_NPRB[phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->nb_rb-1]/100 - + get_hundred_times_delta_IF_eNB(phy_vars_eNB,i,harq_pid, 0)/100;*/ phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->phich_active = 1; phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->phich_ACK = 1; phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->round = 0; @@ -3756,11 +3650,11 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_ if (phy_vars_eNB->ulsch_eNB[i]->Msg3_flag == 1) { #ifdef OPENAIR2 -#ifdef DEBUG_PHY_PROC + //#ifdef DEBUG_PHY_PROC LOG_I(PHY,"[eNB %d][RAPROC] Frame %d Terminating ra_proc for harq %d, UE %d\n", phy_vars_eNB->Mod_id, frame,harq_pid,i); -#endif + //#endif mac_xface->rx_sdu(phy_vars_eNB->Mod_id, phy_vars_eNB->CC_id, frame,subframe, @@ -3770,7 +3664,7 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_ harq_pid, &phy_vars_eNB->ulsch_eNB[i]->Msg3_flag); - // false msg3 detection by MAC: empty PDU + // one-shot msg3 detection by MAC: empty PDU (e.g. CRNTI) if (phy_vars_eNB->ulsch_eNB[i]->Msg3_flag == 0 ) { phy_vars_eNB->eNB_UE_stats[i].mode = PRACH; mac_xface->cancel_ra_proc(phy_vars_eNB->Mod_id, @@ -3793,9 +3687,9 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_ phy_vars_eNB->eNB_UE_stats[i].mode = PUSCH; phy_vars_eNB->ulsch_eNB[i]->Msg3_flag = 0; -#ifdef DEBUG_PHY_PROC - LOG_D(PHY,"[eNB %d][RAPROC] Frame %d : RX Subframe %d Setting UE %d mode to PUSCH\n",phy_vars_eNB->Mod_id,frame,subframe,i); -#endif //DEBUG_PHY_PROC + //#ifdef DEBUG_PHY_PROC + LOG_D(PHY,"[eNB %d][RAPROC] Frame %d : RX Subframe %d Setting UE %d mode to PUSCH\n",phy_vars_eNB->Mod_id,frame,subframe,i); + //#endif //DEBUG_PHY_PROC for (k=0; k<8; k++) { //harq_processes for (j=0; j<phy_vars_eNB->dlsch_eNB[i][0]->Mdlharq; j++) { @@ -3942,28 +3836,56 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_ } else { // otherwise we have some PUCCH detection to do + // Null out PUCCH PRBs for noise measurement + switch(phy_vars_eNB->lte_frame_parms.N_RB_UL) { + case 6: + phy_vars_eNB->rb_mask_ul[0] |= (0x1 | (1<<5)); //position 5 + break; + case 15: + phy_vars_eNB->rb_mask_ul[0] |= (0x1 | (1<<14)); // position 14 + break; + case 25: + phy_vars_eNB->rb_mask_ul[0] |= (0x1 | (1<<24)); // position 24 + break; + case 50: + phy_vars_eNB->rb_mask_ul[0] |= 0x1; + phy_vars_eNB->rb_mask_ul[1] |= (1<<17); // position 49 (49-32) + break; + case 75: + phy_vars_eNB->rb_mask_ul[0] |= 0x1; + phy_vars_eNB->rb_mask_ul[2] |= (1<<10); // position 74 (74-64) + break; + case 100: + phy_vars_eNB->rb_mask_ul[0] |= 0x1; + phy_vars_eNB->rb_mask_ul[3] |= (1<<3); // position 99 (99-96) + break; + default: + LOG_E(PHY,"Unknown number for N_RB_UL %d\n",phy_vars_eNB->lte_frame_parms.N_RB_UL); + break; + } + if (do_SR == 1) { phy_vars_eNB->eNB_UE_stats[i].sr_total++; if (abstraction_flag == 0) - metric0 = rx_pucch(phy_vars_eNB, - pucch_format1, - i, - phy_vars_eNB->scheduling_request_config[i].sr_PUCCH_ResourceIndex, - 0, // n2_pucch - 1, // shortened format - &SR_payload, - subframe, - PUCCH1_THRES); + metric0_SR = rx_pucch(phy_vars_eNB, + pucch_format1, + i, + phy_vars_eNB->scheduling_request_config[i].sr_PUCCH_ResourceIndex, + 0, // n2_pucch + 0, // shortened format, should be use_srs flag, later + &SR_payload, + subframe, + PUCCH1_THRES); #ifdef PHY_ABSTRACTION else { - metric0 = rx_pucch_emul(phy_vars_eNB, - i, - pucch_format1, - 0, - &SR_payload, - sched_subframe); + metric0_SR = rx_pucch_emul(phy_vars_eNB, + i, + pucch_format1, + 0, + &SR_payload, + sched_subframe); LOG_D(PHY,"[eNB %d][SR %x] Frame %d subframe %d Checking SR (UE SR %d/%d)\n",phy_vars_eNB->Mod_id, phy_vars_eNB->ulsch_eNB[i]->rnti,frame,subframe,SR_payload,phy_vars_eNB->scheduling_request_config[i].sr_PUCCH_ResourceIndex); } @@ -3999,20 +3921,35 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_ if ((n1_pucch0==-1) && (n1_pucch1==-1)) { // just check for SR } else if (phy_vars_eNB->lte_frame_parms.frame_type==FDD) { // FDD // if SR was detected, use the n1_pucch from SR, else use n1_pucch0 - n1_pucch0 = (SR_payload==1) ? phy_vars_eNB->scheduling_request_config[i].sr_PUCCH_ResourceIndex:n1_pucch0; + // n1_pucch0 = (SR_payload==1) ? phy_vars_eNB->scheduling_request_config[i].sr_PUCCH_ResourceIndex:n1_pucch0; LOG_D(PHY,"Demodulating PUCCH for ACK/NAK: n1_pucch0 %d (%d), SR_payload %d\n",n1_pucch0,phy_vars_eNB->scheduling_request_config[i].sr_PUCCH_ResourceIndex,SR_payload); - if (abstraction_flag == 0) + if (abstraction_flag == 0) { + + + metric0 = rx_pucch(phy_vars_eNB, pucch_format1a, i, (uint16_t)n1_pucch0, 0, //n2_pucch - 1, // shortened format + 0, // shortened format pucch_payload0, subframe, PUCCH1a_THRES); + + if (metric0 < metric0_SR) + metric0=rx_pucch(phy_vars_eNB, + pucch_format1a, + i, + phy_vars_eNB->scheduling_request_config[i].sr_PUCCH_ResourceIndex, + 0, //n2_pucch + 0, // shortened format + pucch_payload0, + subframe, + PUCCH1a_THRES); + } else { #ifdef PHY_ABSTRACTION metric0 = rx_pucch_emul(phy_vars_eNB,i, @@ -4064,15 +4001,15 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_ #endif if (abstraction_flag == 0) - metric0 = rx_pucch(phy_vars_eNB, - format, - i, - phy_vars_eNB->scheduling_request_config[i].sr_PUCCH_ResourceIndex, - 0, //n2_pucch - 1, // shortened format - pucch_payload0, - subframe, - PUCCH1a_THRES); + metric0_SR = rx_pucch(phy_vars_eNB, + format, + i, + phy_vars_eNB->scheduling_request_config[i].sr_PUCCH_ResourceIndex, + 0, //n2_pucch + 0, // shortened format + pucch_payload0, + subframe, + PUCCH1a_THRES); else { #ifdef PHY_ABSTRACTION metric0 = rx_pucch_emul(phy_vars_eNB,i, @@ -4100,7 +4037,7 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_ i, (uint16_t)n1_pucch0, 0, // n2_pucch - 1, // shortened format + 0, // shortened format pucch_payload0, subframe, PUCCH1a_THRES); @@ -4123,7 +4060,7 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_ i, (uint16_t)n1_pucch1, 0, //n2_pucch - 1, // shortened format + 0, // shortened format pucch_payload1, subframe, PUCCH1a_THRES); @@ -4366,13 +4303,15 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_ } // loop i=0 ... NUMBER_OF_UE_MAX-1 - if (pusch_active == 0) { + // if (pusch_active == 0) { if (abstraction_flag == 0) { // LOG_D(PHY,"[eNB] Frame %d, subframe %d Doing I0_measurements\n", // (((subframe)==9)?-1:0) + phy_vars_eNB->proc[sched_subframe].frame_tx,subframe); lte_eNB_I0_measurements(phy_vars_eNB, + subframe, 0, phy_vars_eNB->first_run_I0_measurements); + phy_vars_eNB->first_run_I0_measurements = 0; } #ifdef PHY_ABSTRACTION @@ -4384,9 +4323,7 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_ #endif - if (I0_clear == 1) - I0_clear = 0; - } + //} #ifdef EMOS phy_procedures_emos_eNB_RX(subframe,phy_vars_eNB); @@ -4625,11 +4562,11 @@ void phy_procedures_eNB_lte(unsigned char subframe,PHY_VARS_eNB **phy_vars_eNB,u phy_vars_eNB[CC_id]->proc[subframe].frame_tx++; phy_vars_eNB[CC_id]->proc[subframe].frame_rx++; - if (phy_vars_eNB[CC_id]->proc[subframe].frame_tx==MAX_FRAME_NUMBER) // defined in impl_defs_top.h - phy_vars_eNB[CC_id]->proc[subframe].frame_tx=0; + if (phy_vars_eNB[CC_id]->proc[subframe].frame_tx>=MAX_FRAME_NUMBER) // defined in impl_defs_top.h + phy_vars_eNB[CC_id]->proc[subframe].frame_tx-=MAX_FRAME_NUMBER; - if (phy_vars_eNB[CC_id]->proc[subframe].frame_rx==MAX_FRAME_NUMBER) - phy_vars_eNB[CC_id]->proc[subframe].frame_rx=0; + if (phy_vars_eNB[CC_id]->proc[subframe].frame_rx>=MAX_FRAME_NUMBER) + phy_vars_eNB[CC_id]->proc[subframe].frame_rx-=MAX_FRAME_NUMBER; } VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_LTE,0); diff --git a/openair1/SCHED/phy_procedures_lte_ue.c b/openair1/SCHED/phy_procedures_lte_ue.c index 7dcd71ce472b982b823b5f91751e17063f5850a6..afaecb7075de7524e11323c289edf8c0721f2c9b 100755 --- a/openair1/SCHED/phy_procedures_lte_ue.c +++ b/openair1/SCHED/phy_procedures_lte_ue.c @@ -121,7 +121,7 @@ extern int rx_sig_fifo; #endif -#if defined(EXMIMO) || defined(OAI_USRP) +#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR) extern uint32_t downlink_frequency[MAX_NUM_CCs][4]; #endif @@ -168,7 +168,7 @@ void dump_dlsch_SI(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t subframe) 1, phy_vars_ue->lte_ue_pdcch_vars[eNB_id]->num_pdcch_symbols, phy_vars_ue->frame_rx,subframe); - LOG_I(PHY,"[UE %d] Dumping dlsch_SI : ofdm_symbol_size %d, nsymb %d, nb_rb %d, mcs %d, nb_rb %d, num_pdcch_symbols %d,G %d\n", + LOG_D(PHY,"[UE %d] Dumping dlsch_SI : ofdm_symbol_size %d, nsymb %d, nb_rb %d, mcs %d, nb_rb %d, num_pdcch_symbols %d,G %d\n", phy_vars_ue->Mod_id, phy_vars_ue->lte_frame_parms.ofdm_symbol_size, nsymb, @@ -197,7 +197,7 @@ void dump_dlsch_SI(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t subframe) exit(-1); } -#if defined(EXMIMO) || defined(OAI_USRP) +#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR) //unsigned int gain_table[31] = {100,112,126,141,158,178,200,224,251,282,316,359,398,447,501,562,631,708,794,891,1000,1122,1258,1412,1585,1778,1995,2239,2512,2818,3162}; /* unsigned int get_tx_amp_prach(int power_dBm, int power_max_dBm, int N_RB_UL) @@ -669,7 +669,7 @@ void phy_procedures_UE_TX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstra uint8_t ack_status=0; int8_t Po_PUCCH; int32_t ulsch_start=0; -#if defined(EXMIMO) || defined(OAI_USRP) +#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR) int overflow=0; int k,l; #endif @@ -969,7 +969,7 @@ void phy_procedures_UE_TX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstra #endif phy_vars_ue->tx_total_RE = nb_rb*12; -#if defined(EXMIMO) || defined(OAI_USRP) +#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR) tx_amp = get_tx_amp(phy_vars_ue->tx_power_dBm, phy_vars_ue->tx_power_max_dBm, phy_vars_ue->lte_frame_parms.N_RB_UL, @@ -1065,7 +1065,7 @@ void phy_procedures_UE_TX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstra #endif phy_vars_ue->tx_total_RE = 12; -#if defined(EXMIMO) || defined(OAI_USRP) +#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR) tx_amp = get_tx_amp(Po_PUCCH, phy_vars_ue->tx_power_max_dBm, phy_vars_ue->lte_frame_parms.N_RB_UL, @@ -1128,7 +1128,7 @@ void phy_procedures_UE_TX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstra #endif phy_vars_ue->tx_total_RE = 12; -#if defined(EXMIMO) || defined(OAI_USRP) +#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR) tx_amp = get_tx_amp(Po_PUCCH, phy_vars_ue->tx_power_max_dBm, phy_vars_ue->lte_frame_parms.N_RB_UL, @@ -1230,7 +1230,7 @@ void phy_procedures_UE_TX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstra if (abstraction_flag == 0) { nsymb = (frame_parms->Ncp == 0) ? 14 : 12; -#if defined(EXMIMO) || defined(OAI_USRP) //this is the EXPRESS MIMO case +#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR)//this is the EXPRESS MIMO case ulsch_start = (phy_vars_ue->rx_offset+subframe_tx*frame_parms->samples_per_tti- openair_daq_vars.timing_advance- phy_vars_ue->timing_advance- @@ -1257,18 +1257,18 @@ void phy_procedures_UE_TX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstra for (aa=0; aa<frame_parms->nb_antennas_tx; aa++) { if (frame_parms->Ncp == 1) PHY_ofdm_mod(&phy_vars_ue->lte_ue_common_vars.txdataF[aa][subframe_tx*nsymb*frame_parms->ofdm_symbol_size], -#if defined(EXMIMO) || defined(OAI_USRP) +#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR) dummy_tx_buffer, #else &phy_vars_ue->lte_ue_common_vars.txdata[aa][ulsch_start], #endif - frame_parms->log2_symbol_size, + frame_parms->ofdm_symbol_size, nsymb, frame_parms->nb_prefix_samples, CYCLIC_PREFIX); else normal_prefix_mod(&phy_vars_ue->lte_ue_common_vars.txdataF[aa][subframe_tx*nsymb*frame_parms->ofdm_symbol_size], -#if defined(EXMIMO) || defined(OAI_USRP) +#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR) dummy_tx_buffer, #else &phy_vars_ue->lte_ue_common_vars.txdata[aa][ulsch_start], @@ -1289,7 +1289,7 @@ void phy_procedures_UE_TX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstra } */ #ifndef OFDMA_ULSCH -#if defined(EXMIMO) || defined(OAI_USRP) +#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR) apply_7_5_kHz(phy_vars_ue,dummy_tx_buffer,0); apply_7_5_kHz(phy_vars_ue,dummy_tx_buffer,1); #else @@ -1304,7 +1304,7 @@ void phy_procedures_UE_TX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstra */ #endif -#if defined(EXMIMO) || defined(OAI_USRP) +#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR) overflow = ulsch_start - 9*frame_parms->samples_per_tti; //if ((slot_tx==4) && (aa==0)) printf("ulsch_start %d, overflow %d\n",ulsch_start,overflow); @@ -1404,7 +1404,7 @@ void phy_procedures_UE_TX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstra phy_vars_ue->tx_total_RE = 96; -#if defined(EXMIMO) || defined(OAI_USRP) +#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR) phy_vars_ue->lte_ue_prach_vars[eNB_id]->amp = get_tx_amp(phy_vars_ue->tx_power_dBm, phy_vars_ue->tx_power_max_dBm, phy_vars_ue->lte_frame_parms.N_RB_UL, @@ -1553,8 +1553,12 @@ void lte_ue_measurement_procedures(uint16_t l, PHY_VARS_UE *phy_vars_ue,uint8_t #else #ifndef OAI_USRP +#ifndef OAI_BLADERF +#ifndef OAI_LMSSDR phy_adjust_gain (phy_vars_ue,0); #endif +#endif +#endif #endif VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_GAIN_CONTROL, VCD_FUNCTION_OUT); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_ADJUST_SYNCH, VCD_FUNCTION_IN); @@ -2061,9 +2065,9 @@ int lte_ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *phy_vars_ue,uint8_t abst #endif -#ifdef DEBUG_PHY_PROC + //#ifdef DEBUG_PHY_PROC LOG_D(PHY,"[UE %d] Frame %d, slot %d, Mode %s: DCI found %i\n",phy_vars_ue->Mod_id,frame_rx,slot_rx,mode_string[phy_vars_ue->UE_mode[eNB_id]],dci_cnt); -#endif + //#endif phy_vars_ue->lte_ue_pdcch_vars[eNB_id]->dci_received += dci_cnt; /* @@ -2101,10 +2105,10 @@ int lte_ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *phy_vars_ue,uint8_t abst #ifdef DEBUG_PHY_PROC - if (subframe_rx == 9) { //( frame_rx % 100 == 0) { + // if (subframe_rx == 9) { //( frame_rx % 100 == 0) { LOG_D(PHY,"frame %d, subframe %d, rnti %x: dci %d/%d\n",frame_rx,subframe_rx,phy_vars_ue->lte_ue_pdcch_vars[eNB_id]->crnti,i,dci_cnt); //dump_dci(&phy_vars_ue->lte_frame_parms, &dci_alloc_rx[i]); - } + // } #endif @@ -2444,7 +2448,7 @@ int phy_procedures_UE_RX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstrac else openair_daq_vars.use_ia_receiver = (openair_daq_vars.use_ia_receiver+1)%3; - LOG_I(PHY,"[MYEMOS] frame %d, IA receiver %d, MCS %d, bitrate %d\n", + LOG_D(PHY,"[MYEMOS] frame %d, IA receiver %d, MCS %d, bitrate %d\n", frame_rx, openair_daq_vars.use_ia_receiver, phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[phy_vars_ue->dlsch_ue[eNB_id][0]->current_harq_pid]->mcs, @@ -2622,13 +2626,13 @@ int phy_procedures_UE_RX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstrac phy_vars_ue->dlsch_ue[eNB_id][0]->active = 0; -#ifdef DEBUG_PHY_PROC + //#ifdef DEBUG_PHY_PROC LOG_D(PHY,"[UE %d][PDSCH %x/%d] Frame %d subframe %d Scheduling DLSCH decoding\n", phy_vars_ue->Mod_id, phy_vars_ue->dlsch_ue[eNB_id][0]->rnti, harq_pid, (subframe_prev == 9) ? (frame_rx-1) : frame_rx,subframe_prev); -#endif + //#endif if (phy_vars_ue->dlsch_ue[eNB_id][0]) { if (abstraction_flag == 0) { @@ -2675,15 +2679,16 @@ int phy_procedures_UE_RX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstrac phy_vars_ue->dlsch_errors[eNB_id]++; #ifdef DEBUG_PHY_PROC - LOG_D(PHY,"[UE %d][PDSCH %x/%d] Frame %d subframe %d DLSCH in error (rv %d,mcs %d)\n", + LOG_D(PHY,"[UE %d][PDSCH %x/%d] Frame %d subframe %d DLSCH in error (rv %d,mcs %d,TBS %d)\n", phy_vars_ue->Mod_id,phy_vars_ue->dlsch_ue[eNB_id][0]->rnti, harq_pid,frame_rx,subframe_prev, phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->rvidx, - phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->mcs); - - // if (abstraction_flag ==0 ) - //dump_dlsch(phy_vars_ue,eNB_id,subframe_prev,harq_pid); - //mac_xface->macphy_exit(""); + phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->mcs, + phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->TBS); +/* + if (abstraction_flag ==0 ) + dump_dlsch(phy_vars_ue,eNB_id,subframe_prev,harq_pid); + mac_xface->macphy_exit(""); */ #endif } else { LOG_D(PHY,"[UE %d][PDSCH %x/%d] Frame %d subframe %d (slot_rx %d): Received DLSCH (rv %d,mcs %d,TBS %d)\n", @@ -2799,7 +2804,7 @@ int phy_procedures_UE_RX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstrac frame_rx,subframe_prev); #ifdef DEBUG_PHY_PROC - LOG_I(PHY,"Decoding DLSCH_SI : rb_alloc %x : nb_rb %d G %d TBS %d, num_pdcch_sym %d\n",phy_vars_ue->dlsch_ue_SI[eNB_id]->harq_processes[0]->rb_alloc_even[0], + LOG_D(PHY,"Decoding DLSCH_SI : rb_alloc %x : nb_rb %d G %d TBS %d, num_pdcch_sym %d\n",phy_vars_ue->dlsch_ue_SI[eNB_id]->harq_processes[0]->rb_alloc_even[0], phy_vars_ue->dlsch_ue_SI[eNB_id]->harq_processes[0]->nb_rb, phy_vars_ue->dlsch_ue_SI[eNB_id]->harq_processes[0]->G, phy_vars_ue->dlsch_ue_SI[eNB_id]->harq_processes[0]->TBS, @@ -2847,7 +2852,7 @@ int phy_procedures_UE_RX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstrac if (ret == (1+phy_vars_ue->dlsch_ue_SI[eNB_id]->max_turbo_iterations)) { phy_vars_ue->dlsch_SI_errors[eNB_id]++; #ifdef DEBUG_PHY_PROC - LOG_I(PHY,"[UE %d] Frame %d, subframe %d, received SI in error (TBS %d, mcs %d, rvidx %d, rballoc %X.%X.%X.%X\n", + LOG_D(PHY,"[UE %d] Frame %d, subframe %d, received SI in error (TBS %d, mcs %d, rvidx %d, rballoc %X.%X.%X.%X\n", phy_vars_ue->Mod_id, frame_rx, subframe_prev, @@ -3280,7 +3285,7 @@ int phy_procedures_UE_RX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstrac } if (is_pmch_subframe((subframe_rx==9?-1:0)+frame_rx,subframe_rx,&phy_vars_ue->lte_frame_parms)) { - LOG_I(PHY,"ue calling pmch subframe ..\n "); + LOG_D(PHY,"ue calling pmch subframe ..\n "); if ((slot_rx%2)==1) { LOG_D(PHY,"[UE %d] Frame %d, subframe %d: Querying for PMCH demodulation(%d)\n", @@ -3428,7 +3433,7 @@ int phy_procedures_UE_RX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstrac phy_vars_rn->sync_area[subframe_rx] = sync_area; // this could also go the harq data struct phy_vars_rn->dlsch_rn_MCH[subframe_rx]->harq_processes[0]->TBS = phy_vars_ue->dlsch_ue_MCH[0]->harq_processes[0]->TBS; phy_vars_rn->dlsch_rn_MCH[subframe_rx]->harq_processes[0]->mcs = phy_vars_ue->dlsch_ue_MCH[0]->harq_processes[0]->mcs; - LOG_I(PHY,"[RN/UE %d] Frame %d subframe %d: store the MCH PDU for MBSFN sync area %d (MCS %d, TBS %d)\n", + LOG_D(PHY,"[RN/UE %d] Frame %d subframe %d: store the MCH PDU for MBSFN sync area %d (MCS %d, TBS %d)\n", phy_vars_ue->Mod_id, frame_rx,subframe_rx,sync_area, phy_vars_rn->dlsch_rn_MCH[subframe_rx]->harq_processes[0]->mcs, phy_vars_rn->dlsch_rn_MCH[subframe_rx]->harq_processes[0]->TBS>>3); diff --git a/openair1/SIMULATION/LTE_PHY/dlsim.c b/openair1/SIMULATION/LTE_PHY/dlsim.c index 6474e83dd91438e04a4b021d83637ff8ac2eda33..2c3d0848c2e90a5e19f63588d4ad2ffc85e8d995 100644 --- a/openair1/SIMULATION/LTE_PHY/dlsim.c +++ b/openair1/SIMULATION/LTE_PHY/dlsim.c @@ -107,88 +107,6 @@ void handler(int sig) exit(1); } -void lte_param_init(unsigned char N_tx, unsigned char N_rx,unsigned char transmission_mode,uint8_t extended_prefix_flag,uint8_t fdd_flag, uint16_t Nid_cell,uint8_t tdd_config,uint8_t N_RB_DL, - uint8_t osf,uint32_t perfect_ce) -{ - - LTE_DL_FRAME_PARMS *lte_frame_parms; - int i; - - - printf("Start lte_param_init\n"); - PHY_vars_eNB = malloc(sizeof(PHY_VARS_eNB)); - PHY_vars_UE = malloc(sizeof(PHY_VARS_UE)); - //PHY_config = malloc(sizeof(PHY_CONFIG)); - mac_xface = malloc(sizeof(MAC_xface)); - - srand(0); - randominit(0); - set_taus_seed(0); - - lte_frame_parms = &(PHY_vars_eNB->lte_frame_parms); - - lte_frame_parms->N_RB_DL = N_RB_DL; //50 for 10MHz and 25 for 5 MHz - lte_frame_parms->N_RB_UL = N_RB_DL; - lte_frame_parms->Ncp = extended_prefix_flag; - lte_frame_parms->Nid_cell = Nid_cell; - lte_frame_parms->nushift = Nid_cell%6; - lte_frame_parms->nb_antennas_tx = N_tx; - lte_frame_parms->nb_antennas_rx = N_rx; - lte_frame_parms->nb_antennas_tx_eNB = N_tx; - lte_frame_parms->phich_config_common.phich_resource = one; - lte_frame_parms->tdd_config = tdd_config; - lte_frame_parms->frame_type = (fdd_flag==1)?0 : 1; - // lte_frame_parms->Csrs = 2; - // lte_frame_parms->Bsrs = 0; - // lte_frame_parms->kTC = 0;44 - // lte_frame_parms->n_RRC = 0; - lte_frame_parms->mode1_flag = (transmission_mode == 1)? 1 : 0; - - init_frame_parms(lte_frame_parms,osf); - - //copy_lte_parms_to_phy_framing(lte_frame_parms, &(PHY_config->PHY_framing)); - - // phy_init_top(lte_frame_parms); //allocation - - PHY_vars_UE->is_secondary_ue = 0; - PHY_vars_UE->lte_frame_parms = *lte_frame_parms; - PHY_vars_eNB->lte_frame_parms = *lte_frame_parms; - - phy_init_lte_top(lte_frame_parms); - dump_frame_parms(lte_frame_parms); - - PHY_vars_UE->PHY_measurements.n_adj_cells=0; - PHY_vars_UE->PHY_measurements.adj_cell_id[0] = Nid_cell+1; - PHY_vars_UE->PHY_measurements.adj_cell_id[1] = Nid_cell+2; - - for (i=0; i<3; i++) - lte_gold(lte_frame_parms,PHY_vars_UE->lte_gold_table[i],Nid_cell+i); - - phy_init_lte_ue(PHY_vars_UE,1,0); - phy_init_lte_eNB(PHY_vars_eNB,0,0,0); - - generate_pcfich_reg_mapping(&PHY_vars_UE->lte_frame_parms); - generate_phich_reg_mapping(&PHY_vars_UE->lte_frame_parms); - - // DL power control init - if (transmission_mode == 1) { - PHY_vars_eNB->pdsch_config_dedicated->p_a = dB0; // 4 = 0dB - ((PHY_vars_eNB->lte_frame_parms).pdsch_config_common).p_b = 0; - PHY_vars_UE->pdsch_config_dedicated->p_a = dB0; // 4 = 0dB - ((PHY_vars_UE->lte_frame_parms).pdsch_config_common).p_b = 0; - } else { // rho_a = rhob - PHY_vars_eNB->pdsch_config_dedicated->p_a = dB0; // 4 = 0dB - ((PHY_vars_eNB->lte_frame_parms).pdsch_config_common).p_b = 1; - PHY_vars_UE->pdsch_config_dedicated->p_a = dB0; // 4 = 0dB - ((PHY_vars_UE->lte_frame_parms).pdsch_config_common).p_b = 1; - } - - PHY_vars_UE->perfect_ce = perfect_ce; - - printf("Done lte_param_init\n"); - - -} //DCI2_5MHz_2A_M10PRB_TDD_t DLSCH_alloc_pdu2_2A[2]; @@ -214,7 +132,7 @@ void do_OFDM_mod_l(mod_sym_t **txdataF, int32_t **txdata, uint16_t next_slot, LT if (frame_parms->Ncp == 1) PHY_ofdm_mod(&txdataF[aa][slot_offset_F], // input &txdata[aa][slot_offset], // output - frame_parms->log2_symbol_size, // log2_fft_size + frame_parms->ofdm_symbol_size, 6, // number of symbols frame_parms->nb_prefix_samples, // number of prefix samples CYCLIC_PREFIX); @@ -266,15 +184,15 @@ int main(int argc, char **argv) unsigned int ret; unsigned int coded_bits_per_codeword=0,nsymb,dci_cnt,tbs=0; - unsigned int tx_lev=0,tx_lev_dB=0,trials,errs[4]= {0,0,0,0},errs2[4]= {0,0,0,0},round_trials[4]= {0,0,0,0},dci_errors=0,dlsch_active=0,num_layers; + unsigned int tx_lev=0,tx_lev_dB=0,trials,errs[4]= {0,0,0,0},errs2[4]= {0,0,0,0},round_trials[4]= {0,0,0,0},dci_errors=0,dlsch_active=0;//,num_layers; int re_allocated; char fname[32],vname[32]; FILE *bler_fd; char bler_fname[256]; FILE *time_meas_fd; char time_meas_fname[256]; - FILE *tikz_fd; - char tikz_fname[256]; + // FILE *tikz_fd; + // char tikz_fname[256]; FILE *input_trch_fd=NULL; unsigned char input_trch_file=0; @@ -300,7 +218,7 @@ int main(int argc, char **argv) uint8_t rx_sample_offset = 0; //char stats_buffer[4096]; //int len; - uint8_t num_rounds = 4,fix_rounds=0; + uint8_t num_rounds = 4;//,fix_rounds=0; uint8_t subframe=7; int u; int n=0; @@ -314,11 +232,11 @@ int main(int argc, char **argv) // void *data; // int ii; - int bler; - double blerr[4],uncoded_ber,avg_ber; + // int bler; + double blerr[4],uncoded_ber;//,avg_ber; short *uncoded_ber_bit=NULL; uint8_t N_RB_DL=25,osf=1; - uint8_t fdd_flag = 0; + frame_t frame_type = FDD; #ifdef XFORMS FD_lte_phy_scope_ue *form_ue; char title[255]; @@ -330,7 +248,7 @@ int main(int argc, char **argv) int common_flag=0,TPC=0; double cpu_freq_GHz; - time_stats_t ts;//,sts,usts; + // time_stats_t ts;//,sts,usts; int avg_iter,iter_trials; int rballocset=0; int print_perf=0; @@ -344,15 +262,24 @@ int main(int argc, char **argv) int TB0_active = 1; uint32_t perfect_ce = 0; - LTE_DL_UE_HARQ_t *dlsch0_ue_harq; - LTE_DL_eNB_HARQ_t *dlsch0_eNB_harq; + // LTE_DL_UE_HARQ_t *dlsch0_ue_harq; + // LTE_DL_eNB_HARQ_t *dlsch0_eNB_harq; uint8_t Kmimo; - FILE *proc_fd = NULL; - char buf[64]; + uint8_t ue_category=4; + uint32_t Nsoft; + + + + int CCE_table[800]; + + int threequarter_fs=0; opp_enabled=1; // to enable the time meas #if defined(__arm__) + FILE *proc_fd = NULL; + char buf[64]; + proc_fd = fopen("/sys/devices/system/cpu/cpu4/cpufreq/cpuinfo_cur_freq", "r"); if(!proc_fd) printf("cannot open /sys/devices/system/cpu/cpu4/cpufreq/cpuinfo_cur_freq"); @@ -375,16 +302,20 @@ int main(int argc, char **argv) // default parameters n_frames = 1000; snr0 = 0; - num_layers = 1; + // num_layers = 1; perfect_ce = 0; - while ((c = getopt (argc, argv, "ahdpZDe:m:n:o:s:f:t:c:g:r:F:x:y:z:AM:N:I:i:O:R:S:C:T:b:u:v:w:B:PLl:Y")) != -1) { + while ((c = getopt (argc, argv, "ahdpZDe:Em:n:o:s:f:t:c:g:r:F:x:y:z:AM:N:I:i:O:R:S:C:T:b:u:v:w:B:PLl:Y")) != -1) { switch (c) { case 'a': awgn_flag = 1; channel_model = AWGN; break; + case 'A': + abstx = 1; + break; + case 'b': tdd_config=atoi(optarg); break; @@ -393,10 +324,59 @@ int main(int argc, char **argv) N_RB_DL=atoi(optarg); break; + case 'c': + num_pdcch_symbols=atoi(optarg); + break; + + case 'C': + Nid_cell = atoi(optarg); + break; + case 'd': dci_flag = 1; break; + case 'D': + frame_type=TDD; + break; + + case 'e': + num_rounds=1; + common_flag = 1; + TPC = atoi(optarg); + break; + + case 'E': + threequarter_fs=1; + break; + + case 'f': + input_snr_step= atof(optarg); + break; + + case 'F': + forgetting_factor = atof(optarg); + break; + + case 'i': + input_fd = fopen(optarg,"r"); + input_file=1; + dci_flag = 1; + break; + + case 'I': + input_trch_fd = fopen(optarg,"r"); + input_trch_file=1; + break; + + case 'L': + llr8_flag=1; + break; + + case 'l': + offset_mumimo_llr_drange_fix=atoi(optarg); + break; + case 'm': mcs1 = atoi(optarg); break; @@ -405,6 +385,11 @@ int main(int argc, char **argv) mcs2 = atoi(optarg); break; + case 'O': + test_perf=atoi(optarg); + //print_perf =1; + break; + case 't': mcs_i = atoi(optarg); i_mod = get_Qm(mcs_i); @@ -414,27 +399,16 @@ int main(int argc, char **argv) n_frames = atoi(optarg); break; - case 'C': - Nid_cell = atoi(optarg); - break; case 'o': rx_sample_offset = atoi(optarg); break; - case 'D': - fdd_flag = 1; - break; - case 'r': DLSCH_RB_ALLOC = atoi(optarg); rballocset = 1; break; - case 'F': - forgetting_factor = atof(optarg); - break; - case 's': snr0 = atof(optarg); break; @@ -443,13 +417,6 @@ int main(int argc, char **argv) snr_int = atof(optarg); break; - case 'f': - input_snr_step= atof(optarg); - break; - - case 'A': - abstx = 1; - break; case 'N': n_ch_rlz= atof(optarg); @@ -459,10 +426,6 @@ int main(int argc, char **argv) extended_prefix_flag=1; break; - case 'c': - num_pdcch_symbols=atoi(optarg); - break; - case 'g': memcpy(channel_model_input,optarg,10); @@ -522,70 +485,12 @@ int main(int argc, char **argv) case 'N': channel_model=AWGN; break; - default: msg("Unsupported channel model!\n"); exit(-1); } break; - - case 'x': - transmission_mode=atoi(optarg); - - if ((transmission_mode!=1) && - (transmission_mode!=2) && - (transmission_mode!=3) && - (transmission_mode!=4) && - (transmission_mode!=5) && - (transmission_mode!=6)) { - msg("Unsupported transmission mode %d\n",transmission_mode); - exit(-1); - } - - if (transmission_mode>1) { - n_tx = 2; - } - - break; - - case 'y': - n_tx=atoi(optarg); - - if ((n_tx==0) || (n_tx>2)) { - msg("Unsupported number of tx antennas %d\n",n_tx); - exit(-1); - } - - break; - - case 'z': - n_rx=atoi(optarg); - - if ((n_rx==0) || (n_rx>2)) { - msg("Unsupported number of rx antennas %d\n",n_rx); - exit(-1); - } - - break; - - case 'I': - input_trch_fd = fopen(optarg,"r"); - input_trch_file=1; - break; - - case 'i': - input_fd = fopen(optarg,"r"); - input_file=1; - dci_flag = 1; - break; - - case 'e': - num_rounds=1; - common_flag = 1; - TPC = atoi(optarg); - break; - case 'R': num_rounds=atoi(optarg); break; @@ -623,26 +528,54 @@ int main(int argc, char **argv) print_perf=1; break; - case 'L': - llr8_flag=1; + case 'x': + transmission_mode=atoi(optarg); + + if ((transmission_mode!=1) && + (transmission_mode!=2) && + (transmission_mode!=3) && + (transmission_mode!=4) && + (transmission_mode!=5) && + (transmission_mode!=6)) { + msg("Unsupported transmission mode %d\n",transmission_mode); + exit(-1); + } + + if (transmission_mode>1) { + n_tx = 2; + } + break; - case 'l': - offset_mumimo_llr_drange_fix=atoi(optarg); + case 'y': + n_tx=atoi(optarg); + + if ((n_tx==0) || (n_tx>2)) { + msg("Unsupported number of tx antennas %d\n",n_tx); + exit(-1); + } + break; - case 'O': - test_perf=atoi(optarg); - //print_perf =1; + case 'Y': + perfect_ce=1; + break; + + case 'z': + n_rx=atoi(optarg); + + if ((n_rx==0) || (n_rx>2)) { + msg("Unsupported number of rx antennas %d\n",n_rx); + exit(-1); + } + break; case 'Z': dump_table=1; break; - case 'Y': - perfect_ce=1; - break; + case 'h': default: @@ -723,8 +656,20 @@ int main(int argc, char **argv) printf("dual_stream_UE=%d\n", dual_stream_UE); } - lte_param_init(n_tx,n_rx,transmission_mode,extended_prefix_flag,fdd_flag,Nid_cell,tdd_config,N_RB_DL,osf,perfect_ce); + lte_param_init(n_tx, + n_rx, + transmission_mode, + extended_prefix_flag, + frame_type, + Nid_cell, + tdd_config, + N_RB_DL, + threequarter_fs, + osf, + perfect_ce); + + eNB_id_i = PHY_vars_UE->n_connected_eNB; printf("Setting mcs1 = %d\n",mcs1); @@ -985,10 +930,27 @@ int main(int argc, char **argv) else Kmimo=1; + switch (ue_category) { + case 1: + Nsoft = 250368; + break; + case 2: + case 3: + Nsoft = 1237248; + break; + case 4: + Nsoft = 1827072; + break; + default: + printf("Unsupported UE category %d\n",ue_category); + exit(-1); + break; + } + for (k=0; k<n_users; k++) { // Create transport channel structures for 2 transport blocks (MIMO) for (i=0; i<2; i++) { - PHY_vars_eNB->dlsch_eNB[k][i] = new_eNB_dlsch(Kmimo,8,N_RB_DL,0); + PHY_vars_eNB->dlsch_eNB[k][i] = new_eNB_dlsch(Kmimo,8,Nsoft,N_RB_DL,0); if (!PHY_vars_eNB->dlsch_eNB[k][i]) { printf("Can't get eNB dlsch structures\n"); @@ -1000,7 +962,7 @@ int main(int argc, char **argv) } for (i=0; i<2; i++) { - PHY_vars_UE->dlsch_ue[0][i] = new_ue_dlsch(Kmimo,8,MAX_TURBO_ITERATIONS,N_RB_DL,0); + PHY_vars_UE->dlsch_ue[0][i] = new_ue_dlsch(Kmimo,8,Nsoft,MAX_TURBO_ITERATIONS,N_RB_DL,0); if (!PHY_vars_UE->dlsch_ue[0][i]) { printf("Can't get ue dlsch structures\n"); @@ -1011,7 +973,7 @@ int main(int argc, char **argv) } // structure for SIC at UE - PHY_vars_UE->dlsch_eNB[0] = new_eNB_dlsch(Kmimo,8,N_RB_DL,0); + PHY_vars_UE->dlsch_eNB[0] = new_eNB_dlsch(Kmimo,8,Nsoft,N_RB_DL,0); if (DLSCH_alloc_pdu2_1E[0].tpmi == 5) { @@ -1298,7 +1260,7 @@ int main(int argc, char **argv) dci_alloc[num_dci].L = 1; dci_alloc[num_dci].rnti = SI_RNTI; dci_alloc[num_dci].format = format1A; - dci_alloc[num_dci].nCCE = 0; + dci_alloc[num_dci].firstCCE = 0; dump_dci(&PHY_vars_eNB->lte_frame_parms,&dci_alloc[num_dci]); printf("Generating dlsch params for user %d\n",k); @@ -1605,7 +1567,7 @@ int main(int argc, char **argv) dci_alloc[num_dci].L = 1; dci_alloc[num_dci].rnti = SI_RNTI; dci_alloc[num_dci].format = format1A; - dci_alloc[num_dci].nCCE = 0; + dci_alloc[num_dci].firstCCE = 0; dump_dci(&PHY_vars_eNB->lte_frame_parms,&dci_alloc[num_dci]); printf("Generating dlsch params for user %d\n",k); @@ -1913,7 +1875,7 @@ int main(int argc, char **argv) dci_alloc[num_dci].L = 1; dci_alloc[num_dci].rnti = SI_RNTI; dci_alloc[num_dci].format = format1A; - dci_alloc[num_dci].nCCE = 0; + dci_alloc[num_dci].firstCCE = 0; dump_dci(&PHY_vars_eNB->lte_frame_parms,&dci_alloc[num_dci]); printf("Generating dlsch params for user %d\n",k); @@ -1944,7 +1906,7 @@ int main(int argc, char **argv) dci_alloc[num_dci].L = 1; dci_alloc[num_dci].rnti = n_rnti+k; dci_alloc[num_dci].format = format1E_2A_M10PRB; - dci_alloc[num_dci].nCCE = 4*k; + dci_alloc[num_dci].firstCCE = 4*k; printf("Generating dlsch params for user %d\n",k); generate_eNB_dlsch_params_from_dci(0, subframe, @@ -1989,17 +1951,20 @@ int main(int argc, char **argv) if (n_frames==1) printf("%d\n",numCCE); // apply RNTI-based nCCE allocation + memset(CCE_table,0,800*sizeof(int)); + for (i=num_common_dci; i<num_dci; i++) { - dci_alloc[i].nCCE = get_nCCE_offset(1<<dci_alloc[i].L, - numCCE, - (dci_alloc[i].rnti==SI_RNTI)? 1 : 0, - dci_alloc[i].rnti, - subframe); + dci_alloc[i].firstCCE = get_nCCE_offset_l1(CCE_table, + 1<<dci_alloc[i].L, + numCCE, + (dci_alloc[i].rnti==SI_RNTI)? 1 : 0, + dci_alloc[i].rnti, + subframe); if (n_frames==1) printf("dci %d: rnti %x, format %d : nCCE %d/%d\n",i,dci_alloc[i].rnti, dci_alloc[i].format, - dci_alloc[i].nCCE,numCCE); + dci_alloc[i].firstCCE,numCCE); } for (k=0; k<n_users; k++) { @@ -2082,7 +2047,7 @@ int main(int argc, char **argv) round_trials[3] = 0; dci_errors=0; - avg_ber = 0; + // avg_ber = 0; round=0; avg_iter = 0; @@ -2553,7 +2518,7 @@ PMI_FEEDBACK: } } } - + num_pdcch_symbols_2 = generate_dci_top(num_ue_spec_dci, num_common_dci, dci_alloc, @@ -2562,7 +2527,7 @@ PMI_FEEDBACK: &PHY_vars_eNB->lte_frame_parms, PHY_vars_eNB->lte_eNB_common_vars.txdataF[eNB_id], subframe); - + if (num_pdcch_symbols_2 > num_pdcch_symbols) { msg("Error: given num_pdcch_symbols not big enough (%d > %d)\n",num_pdcch_symbols_2,num_pdcch_symbols); exit(-1); @@ -2667,13 +2632,15 @@ PMI_FEEDBACK: } start_meas(&PHY_vars_eNB->dlsch_modulation_stats); + re_allocated = dlsch_modulation(PHY_vars_eNB->lte_eNB_common_vars.txdataF[eNB_id], AMP, subframe, &PHY_vars_eNB->lte_frame_parms, num_pdcch_symbols, PHY_vars_eNB->dlsch_eNB[k][0], - PHY_vars_eNB->dlsch_eNB[k][1]); + PHY_vars_eNB->dlsch_eNB[k][1]); + stop_meas(&PHY_vars_eNB->dlsch_modulation_stats); /* if (trials==0 && round==0) @@ -2791,8 +2758,16 @@ PMI_FEEDBACK: random_channel(eNB2UE[2],0); random_channel(eNB2UE[3],0); } - } - + + if (PHY_vars_UE->perfect_ce==1) { + // fill in perfect channel estimates + freq_channel(eNB2UE[round],PHY_vars_UE->lte_frame_parms.N_RB_DL,12*PHY_vars_UE->lte_frame_parms.N_RB_DL + 1); + /* + write_output("channel.m","ch",eNB2UE[round]->ch[0],eNB2UE[round]->channel_length,1,8); + write_output("channelF.m","chF",eNB2UE[round]->chF[0],12*PHY_vars_UE->lte_frame_parms.N_RB_DL + 1,1,8); + */ + } + } if(abstx) { if (trials==0 && round==0) { @@ -2938,11 +2913,6 @@ PMI_FEEDBACK: if (PHY_vars_UE->perfect_ce==1) { if (awgn_flag==0) { - // fill in perfect channel estimates - freq_channel(eNB2UE[round],PHY_vars_UE->lte_frame_parms.N_RB_DL,12*PHY_vars_UE->lte_frame_parms.N_RB_DL + 1); - - //write_output("channel.m","ch",desc1->ch[0],desc1->channel_length,1,8); - //write_output("channelF.m","chF",desc1->chF[0],nb_samples,1,8); for(k=0; k<NUMBER_OF_eNB_MAX; k++) { for(aa=0; aa<frame_parms->nb_antennas_tx; aa++) { for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) { diff --git a/openair1/SIMULATION/LTE_PHY/mbmssim.c b/openair1/SIMULATION/LTE_PHY/mbmssim.c index b9be0b27e8163404ff3310894927385fe0d05121..98d1b68a1509c4b6f230f6221e9dd6de3cc55f0d 100644 --- a/openair1/SIMULATION/LTE_PHY/mbmssim.c +++ b/openair1/SIMULATION/LTE_PHY/mbmssim.c @@ -47,8 +47,7 @@ #include "LAYER2/MAC/vars.h" #ifdef XFORMS -#include <forms.h> -#include "../../USERSPACE_TOOLS/SCOPE/lte_scope.h" +#include "PHY/TOOLS/lte_phy_scope.h" #endif //XFORMS @@ -176,13 +175,13 @@ int main(int argc, char **argv) #ifdef XFORMS - FD_lte_scope *form_dl; + FD_lte_phy_scope_ue *form_ue; char title[255]; fl_initialize (&argc, argv, NULL, 0, 0); - form_dl = create_form_lte_scope(); + form_ue = create_lte_phy_scope_ue(); sprintf (title, "LTE DL SCOPE UE"); - fl_show_form (form_dl->lte_scope, FL_PLACE_HOTSPOT, FL_FULLBORDER, title); + fl_show_form (form_ue->lte_phy_scope_ue, FL_PLACE_HOTSPOT, FL_FULLBORDER, title); #endif logInit(); @@ -457,7 +456,7 @@ int main(int argc, char **argv) PHY_ofdm_mod(PHY_vars_eNB->lte_eNB_common_vars.txdataF[0][0], // input, txdata[0], // output - frame_parms->log2_symbol_size, // log2_fft_size + frame_parms->ofdm_symbol_size, LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*nsymb, // number of symbols frame_parms->nb_prefix_samples, // number of prefix samples CYCLIC_PREFIX); diff --git a/openair1/SIMULATION/LTE_PHY/pbchsim.c b/openair1/SIMULATION/LTE_PHY/pbchsim.c index b7f9f57b6bb1539b5b150dfb9dd5f51d3275f597..319c2ed008511124f84423aba9dac231cbc867b4 100644 --- a/openair1/SIMULATION/LTE_PHY/pbchsim.c +++ b/openair1/SIMULATION/LTE_PHY/pbchsim.c @@ -53,87 +53,11 @@ #include "OCG_vars.h" -PHY_VARS_eNB *PHY_vars_eNb,*PHY_vars_eNb1,*PHY_vars_eNb2; +PHY_VARS_eNB *PHY_vars_eNB,*PHY_vars_eNB1,*PHY_vars_eNB2; PHY_VARS_UE *PHY_vars_UE; #define DLSCH_RB_ALLOC 0x1fbf // igore DC component,RB13 -void lte_param_init(unsigned char N_tx, unsigned char N_rx,unsigned char transmission_mode,unsigned char extended_prefix_flag,unsigned char frame_type, uint16_t Nid_cell,uint8_t N_RB_DL,uint8_t osf) -{ - - // unsigned int ind; - LTE_DL_FRAME_PARMS *lte_frame_parms; - int i; - - printf("Start lte_param_init\n"); - PHY_vars_eNb = malloc(sizeof(PHY_VARS_eNB)); - PHY_vars_eNb1 = malloc(sizeof(PHY_VARS_eNB)); - PHY_vars_eNb2 = malloc(sizeof(PHY_VARS_eNB)); - - PHY_vars_UE = malloc(sizeof(PHY_VARS_UE)); - //PHY_config = malloc(sizeof(PHY_CONFIG)); - mac_xface = malloc(sizeof(MAC_xface)); - - randominit(0); - set_taus_seed(0); - - lte_frame_parms = &(PHY_vars_eNb->lte_frame_parms); - - lte_frame_parms->N_RB_DL = N_RB_DL; //50 for 10MHz and 25 for 5 MHz - lte_frame_parms->N_RB_UL = N_RB_DL; - lte_frame_parms->Ncp = extended_prefix_flag; - lte_frame_parms->Nid_cell = Nid_cell; - lte_frame_parms->nushift = Nid_cell%6; - lte_frame_parms->nb_antennas_tx = N_tx; - lte_frame_parms->nb_antennas_tx_eNB = N_tx; - lte_frame_parms->nb_antennas_rx = N_rx; - // lte_frame_parms->Csrs = 2; - // lte_frame_parms->Bsrs = 0; - // lte_frame_parms->kTC = 0; - // lte_frame_parms->n_RRC = 0; - lte_frame_parms->mode1_flag = (transmission_mode == 1)? 1 : 0; - lte_frame_parms->tdd_config = 3; - lte_frame_parms->frame_type = frame_type; - init_frame_parms(lte_frame_parms,osf); - - //copy_lte_parms_to_phy_framing(lte_frame_parms, &(PHY_config->PHY_framing)); - - PHY_vars_UE->lte_frame_parms = *lte_frame_parms; - - phy_init_lte_top(lte_frame_parms); - - PHY_vars_UE->PHY_measurements.n_adj_cells=2; - PHY_vars_UE->PHY_measurements.adj_cell_id[0] = Nid_cell+1; - PHY_vars_UE->PHY_measurements.adj_cell_id[1] = Nid_cell+2; - - for (i=0; i<3; i++) - lte_gold(lte_frame_parms,PHY_vars_UE->lte_gold_table[i],Nid_cell+i); - - phy_init_lte_ue(PHY_vars_UE,1,0); - - phy_init_lte_eNB(PHY_vars_eNb,0,0,0); - - memcpy((void*)&PHY_vars_eNb1->lte_frame_parms,(void*)&PHY_vars_eNb->lte_frame_parms,sizeof(LTE_DL_FRAME_PARMS)); - PHY_vars_eNb1->lte_frame_parms.Nid_cell=Nid_cell+1; - PHY_vars_eNb1->lte_frame_parms.nushift=(Nid_cell+1)%6; - PHY_vars_eNb1->Mod_id=1; - - memcpy((void*)&PHY_vars_eNb2->lte_frame_parms,(void*)&PHY_vars_eNb->lte_frame_parms,sizeof(LTE_DL_FRAME_PARMS)); - PHY_vars_eNb2->lte_frame_parms.Nid_cell=Nid_cell+2; - PHY_vars_eNb2->lte_frame_parms.nushift=(Nid_cell+2)%6; - PHY_vars_eNb2->Mod_id=2; - - phy_init_lte_eNB(PHY_vars_eNb1,0,0,0); - - phy_init_lte_eNB(PHY_vars_eNb2,0,0,0); - - phy_init_lte_top(lte_frame_parms); - - printf("Done lte_param_init\n"); - - -} - mod_sym_t *dummybuf[4]; mod_sym_t dummy0[2048*14]; mod_sym_t dummy1[2048*14]; @@ -420,6 +344,28 @@ int main(int argc, char **argv) lte_param_init(n_tx,n_rx,transmission_mode,extended_prefix_flag,frame_type,Nid_cell,N_RB_DL,osf); + PHY_vars_eNB1 = malloc(sizeof(PHY_VARS_eNB)); + PHY_vars_eNB2 = malloc(sizeof(PHY_VARS_eNB)); + PHY_vars_UE->PHY_measurements.n_adj_cells=2; + PHY_vars_UE->PHY_measurements.adj_cell_id[0] = Nid_cell+1; + PHY_vars_UE->PHY_measurements.adj_cell_id[1] = Nid_cell+2; + + for (i=0; i<3; i++) + lte_gold(&PHY_vars_eNB->lte_frame_parms,PHY_vars_UE->lte_gold_table[i],Nid_cell+i); + + memcpy((void*)&PHY_vars_eNB1->lte_frame_parms,(void*)&PHY_vars_eNB->lte_frame_parms,sizeof(LTE_DL_FRAME_PARMS)); + PHY_vars_eNB1->lte_frame_parms.Nid_cell=Nid_cell+1; + PHY_vars_eNB1->lte_frame_parms.nushift=(Nid_cell+1)%6; + PHY_vars_eNB1->Mod_id=1; + + memcpy((void*)&PHY_vars_eNB2->lte_frame_parms,(void*)&PHY_vars_eNB->lte_frame_parms,sizeof(LTE_DL_FRAME_PARMS)); + PHY_vars_eNB2->lte_frame_parms.Nid_cell=Nid_cell+2; + PHY_vars_eNB2->lte_frame_parms.nushift=(Nid_cell+2)%6; + PHY_vars_eNB2->Mod_id=2; + + phy_init_lte_eNB(PHY_vars_eNB1,0,0,0); + phy_init_lte_eNB(PHY_vars_eNB2,0,0,0); + #ifdef XFORMS fl_initialize (&argc, argv, NULL, 0, 0); form_ue = create_lte_phy_scope_ue(); @@ -436,13 +382,13 @@ int main(int argc, char **argv) printf("SNR0 %f, SNR1 %f\n",snr0,snr1); - frame_parms = &PHY_vars_eNb->lte_frame_parms; + frame_parms = &PHY_vars_eNB->lte_frame_parms; - txdata = PHY_vars_eNb->lte_eNB_common_vars.txdata[0]; - txdata1 = PHY_vars_eNb1->lte_eNB_common_vars.txdata[0]; - txdata2 = PHY_vars_eNb2->lte_eNB_common_vars.txdata[0]; + txdata = PHY_vars_eNB->lte_eNB_common_vars.txdata[0]; + txdata1 = PHY_vars_eNB1->lte_eNB_common_vars.txdata[0]; + txdata2 = PHY_vars_eNB2->lte_eNB_common_vars.txdata[0]; s_re = malloc(2*sizeof(double*)); @@ -463,8 +409,8 @@ int main(int argc, char **argv) printf("FFT Size %d, Extended Prefix %d, Samples per subframe %d, Symbols per subframe %d, interf (%d,%d)\n",NUMBER_OF_OFDM_CARRIERS, frame_parms->Ncp,frame_parms->samples_per_tti,nsymb,interf1,interf2); - printf("PHY_vars_eNb1->lte_eNB_common_vars.txdataF[0][0] = %p\n", - PHY_vars_eNb1->lte_eNB_common_vars.txdataF[0][0]); + printf("PHY_vars_eNB1->lte_eNB_common_vars.txdataF[0][0] = %p\n", + PHY_vars_eNB1->lte_eNB_common_vars.txdataF[0][0]); DLSCH_alloc_pdu2.rah = 0; @@ -479,31 +425,31 @@ int main(int argc, char **argv) // Forget second codeword DLSCH_alloc_pdu2.tpmi = (transmission_mode==6 ? 5 : 0) ; // precoding - eNB2UE = new_channel_desc_scm(PHY_vars_eNb->lte_frame_parms.nb_antennas_tx, + eNB2UE = new_channel_desc_scm(PHY_vars_eNB->lte_frame_parms.nb_antennas_tx, PHY_vars_UE->lte_frame_parms.nb_antennas_rx, channel_model, - N_RB2sampling_rate(PHY_vars_eNb->lte_frame_parms.N_RB_DL), - N_RB2channel_bandwidth(PHY_vars_eNb->lte_frame_parms.N_RB_DL), + N_RB2sampling_rate(PHY_vars_eNB->lte_frame_parms.N_RB_DL), + N_RB2channel_bandwidth(PHY_vars_eNB->lte_frame_parms.N_RB_DL), 0, 0, 0); if (interf1>-20) - eNB2UE1 = new_channel_desc_scm(PHY_vars_eNb->lte_frame_parms.nb_antennas_tx, + eNB2UE1 = new_channel_desc_scm(PHY_vars_eNB->lte_frame_parms.nb_antennas_tx, PHY_vars_UE->lte_frame_parms.nb_antennas_rx, channel_model, - N_RB2sampling_rate(PHY_vars_eNb->lte_frame_parms.N_RB_DL), - N_RB2channel_bandwidth(PHY_vars_eNb->lte_frame_parms.N_RB_DL), + N_RB2sampling_rate(PHY_vars_eNB->lte_frame_parms.N_RB_DL), + N_RB2channel_bandwidth(PHY_vars_eNB->lte_frame_parms.N_RB_DL), 0, 4, 0); if (interf2>-20) - eNB2UE2 = new_channel_desc_scm(PHY_vars_eNb->lte_frame_parms.nb_antennas_tx, + eNB2UE2 = new_channel_desc_scm(PHY_vars_eNB->lte_frame_parms.nb_antennas_tx, PHY_vars_UE->lte_frame_parms.nb_antennas_rx, channel_model, - N_RB2sampling_rate(PHY_vars_eNb->lte_frame_parms.N_RB_DL), - N_RB2channel_bandwidth(PHY_vars_eNb->lte_frame_parms.N_RB_DL), + N_RB2sampling_rate(PHY_vars_eNB->lte_frame_parms.N_RB_DL), + N_RB2channel_bandwidth(PHY_vars_eNB->lte_frame_parms.N_RB_DL), 0, 8, 0); @@ -567,47 +513,47 @@ int main(int argc, char **argv) pbch_pdu[1]=1; pbch_pdu[2]=0; - if (PHY_vars_eNb->lte_frame_parms.frame_type == 0) { - generate_pss(PHY_vars_eNb->lte_eNB_common_vars.txdataF[0], + if (PHY_vars_eNB->lte_frame_parms.frame_type == 0) { + generate_pss(PHY_vars_eNB->lte_eNB_common_vars.txdataF[0], AMP, - &PHY_vars_eNb->lte_frame_parms, - (PHY_vars_eNb->lte_frame_parms.Ncp==0) ? 6 : 5, + &PHY_vars_eNB->lte_frame_parms, + (PHY_vars_eNB->lte_frame_parms.Ncp==0) ? 6 : 5, 0); - generate_sss(PHY_vars_eNb->lte_eNB_common_vars.txdataF[0], + generate_sss(PHY_vars_eNB->lte_eNB_common_vars.txdataF[0], AMP, - &PHY_vars_eNb->lte_frame_parms, - (PHY_vars_eNb->lte_frame_parms.Ncp==0) ? 5 : 4, + &PHY_vars_eNB->lte_frame_parms, + (PHY_vars_eNB->lte_frame_parms.Ncp==0) ? 5 : 4, 0); - generate_pss(PHY_vars_eNb->lte_eNB_common_vars.txdataF[0], + generate_pss(PHY_vars_eNB->lte_eNB_common_vars.txdataF[0], AMP, - &PHY_vars_eNb->lte_frame_parms, - (PHY_vars_eNb->lte_frame_parms.Ncp==0) ? 6 : 5, + &PHY_vars_eNB->lte_frame_parms, + (PHY_vars_eNB->lte_frame_parms.Ncp==0) ? 6 : 5, 10); - generate_sss(PHY_vars_eNb->lte_eNB_common_vars.txdataF[0], + generate_sss(PHY_vars_eNB->lte_eNB_common_vars.txdataF[0], AMP, - &PHY_vars_eNb->lte_frame_parms, - (PHY_vars_eNb->lte_frame_parms.Ncp==0) ? 5 : 4, + &PHY_vars_eNB->lte_frame_parms, + (PHY_vars_eNB->lte_frame_parms.Ncp==0) ? 5 : 4, 10); } else { - generate_sss(PHY_vars_eNb->lte_eNB_common_vars.txdataF[0], + generate_sss(PHY_vars_eNB->lte_eNB_common_vars.txdataF[0], AMP, - &PHY_vars_eNb->lte_frame_parms, - (PHY_vars_eNb->lte_frame_parms.Ncp==0) ? 6 : 5, + &PHY_vars_eNB->lte_frame_parms, + (PHY_vars_eNB->lte_frame_parms.Ncp==0) ? 6 : 5, 1); - generate_pss(PHY_vars_eNb->lte_eNB_common_vars.txdataF[0], + generate_pss(PHY_vars_eNB->lte_eNB_common_vars.txdataF[0], AMP, - &PHY_vars_eNb->lte_frame_parms, + &PHY_vars_eNB->lte_frame_parms, 2, 2); - generate_sss(PHY_vars_eNb->lte_eNB_common_vars.txdataF[0], + generate_sss(PHY_vars_eNB->lte_eNB_common_vars.txdataF[0], AMP, - &PHY_vars_eNb->lte_frame_parms, - (PHY_vars_eNb->lte_frame_parms.Ncp==0) ? 6 : 5, + &PHY_vars_eNB->lte_frame_parms, + (PHY_vars_eNB->lte_frame_parms.Ncp==0) ? 6 : 5, 11); - generate_pss(PHY_vars_eNb->lte_eNB_common_vars.txdataF[0], + generate_pss(PHY_vars_eNB->lte_eNB_common_vars.txdataF[0], AMP, - &PHY_vars_eNb->lte_frame_parms, + &PHY_vars_eNB->lte_frame_parms, 2, 12); @@ -626,11 +572,11 @@ int main(int argc, char **argv) dci_alloc[1].rnti = 0x1234; */ - printf("Generating PBCH for mode1_flag = %d\n", PHY_vars_eNb->lte_frame_parms.mode1_flag); + printf("Generating PBCH for mode1_flag = %d\n", PHY_vars_eNB->lte_frame_parms.mode1_flag); - generate_pilots(PHY_vars_eNb, - PHY_vars_eNb->lte_eNB_common_vars.txdataF[0], + generate_pilots(PHY_vars_eNB, + PHY_vars_eNB->lte_eNB_common_vars.txdataF[0], AMP, LTE_NUMBER_OF_SUBFRAMES_PER_FRAME); @@ -641,8 +587,8 @@ int main(int argc, char **argv) dci_alloc, 0, 1024, - &PHY_vars_eNb->lte_frame_parms, - PHY_vars_eNb->lte_eNB_common_vars.txdataF[0], + &PHY_vars_eNB->lte_frame_parms, + PHY_vars_eNB->lte_eNB_common_vars.txdataF[0], 0); */ @@ -657,47 +603,47 @@ int main(int argc, char **argv) dummybuf[1] = dummy1; dummybuf[2] = dummy2; dummybuf[3] = dummy3; - generate_pbch(&PHY_vars_eNb->lte_eNB_pbch, + generate_pbch(&PHY_vars_eNB->lte_eNB_pbch, (mod_sym_t**)dummybuf, AMP, - &PHY_vars_eNb->lte_frame_parms, + &PHY_vars_eNB->lte_frame_parms, pbch_pdu, 0); } - generate_pbch(&PHY_vars_eNb->lte_eNB_pbch, - PHY_vars_eNb->lte_eNB_common_vars.txdataF[0], + generate_pbch(&PHY_vars_eNB->lte_eNB_pbch, + PHY_vars_eNB->lte_eNB_common_vars.txdataF[0], AMP, - &PHY_vars_eNb->lte_frame_parms, + &PHY_vars_eNB->lte_frame_parms, pbch_pdu, pbch_phase); /* - generate_pbch(&PHY_vars_eNb->lte_eNB_pbch, - PHY_vars_eNb->lte_eNB_common_vars.txdataF[0], + generate_pbch(&PHY_vars_eNB->lte_eNB_pbch, + PHY_vars_eNB->lte_eNB_common_vars.txdataF[0], AMP, - &PHY_vars_eNb->lte_frame_parms, + &PHY_vars_eNB->lte_frame_parms, pbch_pdu, 1); */ if (interf1>-20) { /* - generate_pss(PHY_vars_eNb1->lte_eNB_common_vars.txdataF[0], + generate_pss(PHY_vars_eNB1->lte_eNB_common_vars.txdataF[0], AMP, - &PHY_vars_eNb1->lte_frame_parms, - (PHY_vars_eNb1->lte_frame_parms.Ncp==0)?6:5, + &PHY_vars_eNB1->lte_frame_parms, + (PHY_vars_eNB1->lte_frame_parms.Ncp==0)?6:5, 0); */ - generate_pilots(PHY_vars_eNb1, - PHY_vars_eNb1->lte_eNB_common_vars.txdataF[0], + generate_pilots(PHY_vars_eNB1, + PHY_vars_eNB1->lte_eNB_common_vars.txdataF[0], AMP, LTE_NUMBER_OF_SUBFRAMES_PER_FRAME); - generate_pbch(&PHY_vars_eNb1->lte_eNB_pbch, - PHY_vars_eNb1->lte_eNB_common_vars.txdataF[0], + generate_pbch(&PHY_vars_eNB1->lte_eNB_pbch, + PHY_vars_eNB1->lte_eNB_common_vars.txdataF[0], AMP, - &PHY_vars_eNb1->lte_frame_parms, + &PHY_vars_eNB1->lte_frame_parms, pbch_pdu, 0); @@ -705,26 +651,26 @@ int main(int argc, char **argv) if (interf2>-20) { /* - generate_pss(PHY_vars_eNb2->lte_eNB_common_vars.txdataF[0], + generate_pss(PHY_vars_eNB2->lte_eNB_common_vars.txdataF[0], AMP, - &PHY_vars_eNb2->lte_frame_parms, - (PHY_vars_eNb2->lte_frame_parms.Ncp==0)?6:5, + &PHY_vars_eNB2->lte_frame_parms, + (PHY_vars_eNB2->lte_frame_parms.Ncp==0)?6:5, 0); */ - generate_pilots(PHY_vars_eNb2, - PHY_vars_eNb2->lte_eNB_common_vars.txdataF[0], + generate_pilots(PHY_vars_eNB2, + PHY_vars_eNB2->lte_eNB_common_vars.txdataF[0], AMP, LTE_NUMBER_OF_SUBFRAMES_PER_FRAME); - generate_pbch(&PHY_vars_eNb2->lte_eNB_pbch, - PHY_vars_eNb2->lte_eNB_common_vars.txdataF[0], + generate_pbch(&PHY_vars_eNB2->lte_eNB_pbch, + PHY_vars_eNB2->lte_eNB_common_vars.txdataF[0], AMP, - &PHY_vars_eNb2->lte_frame_parms, + &PHY_vars_eNB2->lte_frame_parms, pbch_pdu, 0); @@ -733,10 +679,10 @@ int main(int argc, char **argv) // write_output("pilotsF.m","rsF",txdataF[0],lte_frame_parms->ofdm_symbol_size,1,1); - write_output("txsigF0.m","txsF0", PHY_vars_eNb->lte_eNB_common_vars.txdataF[0][0],FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX,1,1); + write_output("txsigF0.m","txsF0", PHY_vars_eNB->lte_eNB_common_vars.txdataF[0][0],FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX,1,1); - if (PHY_vars_eNb->lte_frame_parms.nb_antennas_tx>1) - write_output("txsigF1.m","txsF1", PHY_vars_eNb->lte_eNB_common_vars.txdataF[0][1],FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX,1,1); + if (PHY_vars_eNB->lte_frame_parms.nb_antennas_tx>1) + write_output("txsigF1.m","txsF1", PHY_vars_eNB->lte_eNB_common_vars.txdataF[0][1],FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX,1,1); tx_lev = 0; tx_lev1 = 0; @@ -745,16 +691,16 @@ int main(int argc, char **argv) - for (aa=0; aa<PHY_vars_eNb->lte_frame_parms.nb_antennas_tx; aa++) { + for (aa=0; aa<PHY_vars_eNB->lte_frame_parms.nb_antennas_tx; aa++) { if (frame_parms->Ncp == 1) - PHY_ofdm_mod(PHY_vars_eNb->lte_eNB_common_vars.txdataF[0][aa], // input, + PHY_ofdm_mod(PHY_vars_eNB->lte_eNB_common_vars.txdataF[0][aa], // input, txdata[aa], // output - frame_parms->log2_symbol_size, // log2_fft_size + frame_parms->ofdm_symbol_size, LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*nsymb, // number of symbols frame_parms->nb_prefix_samples, // number of prefix samples CYCLIC_PREFIX); else { - normal_prefix_mod(PHY_vars_eNb->lte_eNB_common_vars.txdataF[0][aa], + normal_prefix_mod(PHY_vars_eNB->lte_eNB_common_vars.txdataF[0][aa], txdata[aa], LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*nsymb, frame_parms); @@ -765,17 +711,17 @@ int main(int argc, char **argv) } if (interf1>-20) { - for (aa=0; aa<PHY_vars_eNb1->lte_frame_parms.nb_antennas_tx; aa++) { + for (aa=0; aa<PHY_vars_eNB1->lte_frame_parms.nb_antennas_tx; aa++) { if (frame_parms->Ncp == 1) - PHY_ofdm_mod(PHY_vars_eNb1->lte_eNB_common_vars.txdataF[0][aa], // input, - PHY_vars_eNb1->lte_eNB_common_vars.txdata[0][aa], // output - frame_parms->log2_symbol_size, // log2_fft_size + PHY_ofdm_mod(PHY_vars_eNB1->lte_eNB_common_vars.txdataF[0][aa], // input, + PHY_vars_eNB1->lte_eNB_common_vars.txdata[0][aa], // output + frame_parms->ofdm_symbol_size, 2*nsymb, // number of symbols frame_parms->nb_prefix_samples, // number of prefix samples CYCLIC_PREFIX); else { - normal_prefix_mod(PHY_vars_eNb1->lte_eNB_common_vars.txdataF[0][aa], - PHY_vars_eNb1->lte_eNB_common_vars.txdata[0][aa], + normal_prefix_mod(PHY_vars_eNB1->lte_eNB_common_vars.txdataF[0][aa], + PHY_vars_eNB1->lte_eNB_common_vars.txdata[0][aa], 2*nsymb, frame_parms); } @@ -784,24 +730,24 @@ int main(int argc, char **argv) OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES); } - write_output("txsigF0_1.m","txsF0_1", PHY_vars_eNb1->lte_eNB_common_vars.txdataF[0][0],FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX,1,1); + write_output("txsigF0_1.m","txsF0_1", PHY_vars_eNB1->lte_eNB_common_vars.txdataF[0][0],FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX,1,1); - if (PHY_vars_eNb1->lte_frame_parms.nb_antennas_tx>1) - write_output("txsigF1_1.m","txsF1_1", PHY_vars_eNb1->lte_eNB_common_vars.txdataF[0][1],FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX,1,1); + if (PHY_vars_eNB1->lte_frame_parms.nb_antennas_tx>1) + write_output("txsigF1_1.m","txsF1_1", PHY_vars_eNB1->lte_eNB_common_vars.txdataF[0][1],FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX,1,1); } if (interf2>-20) { - for (aa=0; aa<PHY_vars_eNb2->lte_frame_parms.nb_antennas_tx; aa++) { + for (aa=0; aa<PHY_vars_eNB2->lte_frame_parms.nb_antennas_tx; aa++) { if (frame_parms->Ncp == 1) - PHY_ofdm_mod(PHY_vars_eNb2->lte_eNB_common_vars.txdataF[0][aa], // input, - PHY_vars_eNb2->lte_eNB_common_vars.txdata[0][aa], // output - frame_parms->log2_symbol_size, // log2_fft_size + PHY_ofdm_mod(PHY_vars_eNB2->lte_eNB_common_vars.txdataF[0][aa], // input, + PHY_vars_eNB2->lte_eNB_common_vars.txdata[0][aa], // output + frame_parms->ofdm_symbol_size, 2*nsymb, // number of symbols frame_parms->nb_prefix_samples, // number of prefix samples CYCLIC_PREFIX); else { - normal_prefix_mod(PHY_vars_eNb2->lte_eNB_common_vars.txdataF[0][aa], - PHY_vars_eNb2->lte_eNB_common_vars.txdata[0][aa], + normal_prefix_mod(PHY_vars_eNB2->lte_eNB_common_vars.txdataF[0][aa], + PHY_vars_eNB2->lte_eNB_common_vars.txdata[0][aa], 2*nsymb, frame_parms); } @@ -810,10 +756,10 @@ int main(int argc, char **argv) OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES); } - write_output("txsigF0_2.m","txsF0_2", PHY_vars_eNb2->lte_eNB_common_vars.txdataF[0][0],FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX,1,1); + write_output("txsigF0_2.m","txsF0_2", PHY_vars_eNB2->lte_eNB_common_vars.txdataF[0][0],FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX,1,1); - if (PHY_vars_eNb2->lte_frame_parms.nb_antennas_tx>1) - write_output("txsigF1_2.m","txsF1_2", PHY_vars_eNb2->lte_eNB_common_vars.txdataF[0][1],FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX,1,1); + if (PHY_vars_eNB2->lte_frame_parms.nb_antennas_tx>1) + write_output("txsigF1_2.m","txsF1_2", PHY_vars_eNB2->lte_eNB_common_vars.txdataF[0][1],FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX,1,1); } // tx_lev_dB = (unsigned int) dB_fixed(tx_lev); @@ -823,15 +769,15 @@ int main(int argc, char **argv) if (frame_parms->nb_antennas_tx>1) write_output("txsig1.m","txs1", txdata[1],FRAME_LENGTH_COMPLEX_SAMPLES,1,1); - write_output("txsig0_1.m","txs0_1", PHY_vars_eNb1->lte_eNB_common_vars.txdata[0][0],FRAME_LENGTH_COMPLEX_SAMPLES,1,1); + write_output("txsig0_1.m","txs0_1", PHY_vars_eNB1->lte_eNB_common_vars.txdata[0][0],FRAME_LENGTH_COMPLEX_SAMPLES,1,1); if (frame_parms->nb_antennas_tx>1) - write_output("txsig1_1.m","txs1_1", PHY_vars_eNb1->lte_eNB_common_vars.txdata[0][1],FRAME_LENGTH_COMPLEX_SAMPLES,1,1); + write_output("txsig1_1.m","txs1_1", PHY_vars_eNB1->lte_eNB_common_vars.txdata[0][1],FRAME_LENGTH_COMPLEX_SAMPLES,1,1); - write_output("txsig0_2.m","txs0_2", PHY_vars_eNb2->lte_eNB_common_vars.txdata[0][0],FRAME_LENGTH_COMPLEX_SAMPLES,1,1); + write_output("txsig0_2.m","txs0_2", PHY_vars_eNB2->lte_eNB_common_vars.txdata[0][0],FRAME_LENGTH_COMPLEX_SAMPLES,1,1); if (frame_parms->nb_antennas_tx>1) - write_output("txsig1_2.m","txs1_2", PHY_vars_eNb2->lte_eNB_common_vars.txdata[0][1],FRAME_LENGTH_COMPLEX_SAMPLES,1,1); + write_output("txsig1_2.m","txs1_2", PHY_vars_eNB2->lte_eNB_common_vars.txdata[0][1],FRAME_LENGTH_COMPLEX_SAMPLES,1,1); } else { //read in from file i=0; @@ -864,7 +810,7 @@ int main(int argc, char **argv) // multipath channel for (i=0; i<2*nsymb*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES; i++) { - for (aa=0; aa<PHY_vars_eNb->lte_frame_parms.nb_antennas_tx; aa++) { + for (aa=0; aa<PHY_vars_eNB->lte_frame_parms.nb_antennas_tx; aa++) { s_re[aa][i] = ((double)(((short *)txdata[aa]))[(i<<1)]); s_im[aa][i] = ((double)(((short *)txdata[aa]))[(i<<1)+1]); @@ -925,7 +871,7 @@ int main(int argc, char **argv) } } - sigma2_dB = 10*log10((double)tx_lev) +10*log10((double)PHY_vars_eNb->lte_frame_parms.ofdm_symbol_size/(double)(12*NB_RB)) - SNR; + sigma2_dB = 10*log10((double)tx_lev) +10*log10((double)PHY_vars_eNB->lte_frame_parms.ofdm_symbol_size/(double)(12*NB_RB)) - SNR; if (n_frames==1) printf("sigma2_dB %f (SNR %f dB) tx_lev_dB %f,%f,%f\n",sigma2_dB,SNR, @@ -947,7 +893,7 @@ int main(int argc, char **argv) for (n_trials=0; n_trials<ntrials; n_trials++) { //printf("n_trial %d\n",n_trials); for (i=0; i<2*nsymb*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES; i++) { - for (aa=0; aa<PHY_vars_eNb->lte_frame_parms.nb_antennas_rx; aa++) { + for (aa=0; aa<PHY_vars_eNB->lte_frame_parms.nb_antennas_rx; aa++) { if (n_trials==0) { r_re[aa][i] += (pow(10.0,.05*interf1)*r_re1[aa][i] + pow(10.0,.05*interf2)*r_re2[aa][i]); r_im[aa][i] += (pow(10.0,.05*interf1)*r_im1[aa][i] + pow(10.0,.05*interf2)*r_im2[aa][i]); @@ -983,14 +929,14 @@ int main(int argc, char **argv) */ - for (l=0; l<PHY_vars_eNb->lte_frame_parms.symbols_per_tti; l++) { + for (l=0; l<PHY_vars_eNB->lte_frame_parms.symbols_per_tti; l++) { - // subframe_offset = (l/PHY_vars_eNb->lte_frame_parms.symbols_per_tti)*PHY_vars_eNb->lte_frame_parms.samples_per_tti; + // subframe_offset = (l/PHY_vars_eNB->lte_frame_parms.symbols_per_tti)*PHY_vars_eNB->lte_frame_parms.samples_per_tti; // printf("subframe_offset = %d\n",subframe_offset); slot_fep(PHY_vars_UE, - l%(PHY_vars_eNb->lte_frame_parms.symbols_per_tti/2), - l/(PHY_vars_eNb->lte_frame_parms.symbols_per_tti/2), + l%(PHY_vars_eNB->lte_frame_parms.symbols_per_tti/2), + l/(PHY_vars_eNB->lte_frame_parms.symbols_per_tti/2), 0, 0, 0); @@ -1026,7 +972,7 @@ int main(int argc, char **argv) */ } - if (l==((PHY_vars_eNb->lte_frame_parms.Ncp==0)?4:3)) { + if (l==((PHY_vars_eNB->lte_frame_parms.Ncp==0)?4:3)) { //sprintf(fname,"dl_ch00_%d.m",l); //sprintf(vname,"dl_ch00_%d",l); //write_output(fname,vname,&(lte_ue_common_vars->dl_ch_estimates[0][lte_frame_parms->ofdm_symbol_size*(l%6)]),lte_frame_parms->ofdm_symbol_size,1,1); @@ -1038,7 +984,7 @@ int main(int argc, char **argv) 1); } - if (l==((PHY_vars_eNb->lte_frame_parms.Ncp==0)?10:9)) { + if (l==((PHY_vars_eNB->lte_frame_parms.Ncp==0)?10:9)) { for (frame_mod4=0; frame_mod4<4; frame_mod4++) { pbch_tx_ant = rx_pbch(&PHY_vars_UE->lte_ue_common_vars, @@ -1059,7 +1005,7 @@ int main(int argc, char **argv) pbch_tx_ant = rx_pbch(&PHY_vars_UE->lte_ue_common_vars, PHY_vars_UE->lte_ue_pbch_vars[0], - &PHY_vars_eNb->lte_frame_parms, + &PHY_vars_eNB->lte_frame_parms, 0, ALAMOUTI, PHY_vars_UE->high_speed_flag, @@ -1119,10 +1065,10 @@ int main(int argc, char **argv) if (n_frames==1) { - write_output("H00.m","h00",&(PHY_vars_UE->lte_ue_common_vars.dl_ch_estimates[0][0][0]),((frame_parms->Ncp==0)?7:6)*(PHY_vars_eNb->lte_frame_parms.ofdm_symbol_size),1,1); + write_output("H00.m","h00",&(PHY_vars_UE->lte_ue_common_vars.dl_ch_estimates[0][0][0]),((frame_parms->Ncp==0)?7:6)*(PHY_vars_eNB->lte_frame_parms.ofdm_symbol_size),1,1); if (n_tx==2) - write_output("H10.m","h10",&(PHY_vars_UE->lte_ue_common_vars.dl_ch_estimates[0][2][0]),((frame_parms->Ncp==0)?7:6)*(PHY_vars_eNb->lte_frame_parms.ofdm_symbol_size),1,1); + write_output("H10.m","h10",&(PHY_vars_UE->lte_ue_common_vars.dl_ch_estimates[0][2][0]),((frame_parms->Ncp==0)?7:6)*(PHY_vars_eNB->lte_frame_parms.ofdm_symbol_size),1,1); write_output("rxsig0.m","rxs0", PHY_vars_UE->lte_ue_common_vars.rxdata[0],FRAME_LENGTH_COMPLEX_SAMPLES,1,1); write_output("rxsigF0.m","rxsF0", PHY_vars_UE->lte_ue_common_vars.rxdataF[0],NUMBER_OF_OFDM_CARRIERS*2*((frame_parms->Ncp==0)?14:12),2,1); diff --git a/openair1/SIMULATION/LTE_PHY/pdcchsim.c b/openair1/SIMULATION/LTE_PHY/pdcchsim.c index 7a361329806eb8347805d6a04637b8b823f41248..3c717d2625bfea663c9d5df88bbf1927388f47c5 100644 --- a/openair1/SIMULATION/LTE_PHY/pdcchsim.c +++ b/openair1/SIMULATION/LTE_PHY/pdcchsim.c @@ -56,107 +56,15 @@ PHY_VARS_UE *PHY_vars_UE; #define UL_RB_ALLOC 0x1ff; #define CCCH_RB_ALLOC computeRIV(PHY_vars_eNB->lte_frame_parms.N_RB_UL,0,2) -#define DLSCH_RB_ALLOC 0x1fbf // igore DC component,RB13 - -void lte_param_init(unsigned char N_tx, unsigned char N_rx,unsigned char transmission_mode,unsigned char extended_prefix_flag,uint16_t Nid_cell,uint8_t tdd_config,uint8_t N_RB_DL, - lte_frame_type_t frame_type,uint8_t osf,uint32_t perfect_ce) -{ - - unsigned int i; - LTE_DL_FRAME_PARMS *lte_frame_parms; - - printf("Start lte_param_init (Nid_cell %d, extended_prefix %d, transmission_mode %d, N_tx %d, N_rx %d)\n", - Nid_cell, extended_prefix_flag,transmission_mode,N_tx,N_rx); - PHY_vars_eNB = malloc(sizeof(PHY_VARS_eNB)); - PHY_vars_eNB1 = malloc(sizeof(PHY_VARS_eNB)); - PHY_vars_eNB2 = malloc(sizeof(PHY_VARS_eNB)); - - PHY_vars_UE = malloc(sizeof(PHY_VARS_UE)); - //PHY_config = malloc(sizeof(PHY_CONFIG)); - mac_xface = malloc(sizeof(MAC_xface)); - - randominit(0); - set_taus_seed(0); - - lte_frame_parms = &(PHY_vars_eNB->lte_frame_parms); - - lte_frame_parms->N_RB_DL = N_RB_DL; //50 for 10MHz and 25 for 5 MHz - lte_frame_parms->N_RB_UL = N_RB_DL; - lte_frame_parms->Ncp = extended_prefix_flag; - lte_frame_parms->Nid_cell = Nid_cell; - lte_frame_parms->nushift = Nid_cell%6; - lte_frame_parms->nb_antennas_tx_eNB = N_tx; - lte_frame_parms->nb_antennas_tx = N_tx; - lte_frame_parms->nb_antennas_rx = N_rx; - lte_frame_parms->phich_config_common.phich_resource = one; //half - lte_frame_parms->tdd_config = tdd_config; - lte_frame_parms->frame_type = frame_type; - - // lte_frame_parms->Csrs = 2; - // lte_frame_parms->Bsrs = 0; - // lte_frame_parms->kTC = 0; - // lte_frame_parms->n_RRC = 0; - lte_frame_parms->mode1_flag = (transmission_mode == 1)? 1 : 0; - - init_frame_parms(lte_frame_parms,osf); - - //copy_lte_parms_to_phy_framing(lte_frame_parms, &(PHY_config->PHY_framing)); - - - memcpy(&PHY_vars_UE->lte_frame_parms,lte_frame_parms,sizeof(LTE_DL_FRAME_PARMS)); - - - phy_init_lte_top(lte_frame_parms); - - phy_init_lte_ue(PHY_vars_UE,1,0); - - phy_init_lte_eNB(PHY_vars_eNB,0,0,0); - - memcpy((void*)&PHY_vars_eNB1->lte_frame_parms,(void*)&PHY_vars_eNB->lte_frame_parms,sizeof(LTE_DL_FRAME_PARMS)); - PHY_vars_eNB1->lte_frame_parms.nushift=(Nid_cell+1)%6; - PHY_vars_eNB1->lte_frame_parms.Nid_cell=Nid_cell+1; - - memcpy((void*)&PHY_vars_eNB2->lte_frame_parms,(void*)&PHY_vars_eNB->lte_frame_parms,sizeof(LTE_DL_FRAME_PARMS)); - PHY_vars_eNB2->lte_frame_parms.nushift=(Nid_cell+2)%6; - PHY_vars_eNB2->lte_frame_parms.Nid_cell=Nid_cell+2; - - phy_init_lte_eNB(PHY_vars_eNB1,0,0,0); - - phy_init_lte_eNB(PHY_vars_eNB2,0,0,0); - - phy_init_lte_top(lte_frame_parms); - - PHY_vars_UE->PHY_measurements.n_adj_cells=2; - PHY_vars_UE->PHY_measurements.adj_cell_id[0] = Nid_cell+1; - PHY_vars_UE->PHY_measurements.adj_cell_id[1] = Nid_cell+2; - PHY_vars_UE->perfect_ce = perfect_ce; - - for (i=0; i<3; i++) - lte_gold(lte_frame_parms,PHY_vars_UE->lte_gold_table[i],Nid_cell+i); - - generate_pcfich_reg_mapping(&PHY_vars_UE->lte_frame_parms); - generate_phich_reg_mapping(&PHY_vars_UE->lte_frame_parms); - - printf("Done lte_param_init\n"); - - CCCH_alloc_pdu.type = 1; - CCCH_alloc_pdu.vrb_type = 0; - CCCH_alloc_pdu.rballoc = CCCH_RB_ALLOC; - CCCH_alloc_pdu.ndi = 1; - CCCH_alloc_pdu.mcs = 1; - CCCH_alloc_pdu.harq_pid = 0; - -} - - +#define DLSCH_RB_ALLOC ((uint16_t)0x1fbf) // igore DC component,RB13 DCI_PDU DCI_pdu; DCI_PDU *get_dci(LTE_DL_FRAME_PARMS *lte_frame_parms,uint8_t log2L, uint8_t log2Lcommon, uint8_t format_selector, uint32_t rnti) { - uint8_t BCCH_alloc_pdu[8]; - uint8_t DLSCH_alloc_pdu[8]; - uint8_t UL_alloc_pdu[8]; + uint32_t BCCH_alloc_pdu[2]; + uint32_t DLSCH_alloc_pdu[2]; + uint32_t UL_alloc_pdu[2]; int i; int dci_length_bytes,dci_length; @@ -462,31 +370,35 @@ DCI_PDU *get_dci(LTE_DL_FRAME_PARMS *lte_frame_parms,uint8_t log2L, uint8_t log2 DCI_pdu.dci_alloc[0].ra_flag = 0; memcpy((void*)&DCI_pdu.dci_alloc[0].dci_pdu[0], &BCCH_alloc_pdu[0], BCCH_pdu_size_bytes); DCI_pdu.Num_common_dci++; - /* + if (lte_frame_parms->N_RB_DL >= 25) { // add ue specific dci - DCI_pdu.dci_alloc[1].dci_length = dci_length; - DCI_pdu.dci_alloc[1].L = log2L; - DCI_pdu.dci_alloc[1].rnti = rnti; - DCI_pdu.dci_alloc[1].format = format1; - DCI_pdu.dci_alloc[1].ra_flag = 0; - memcpy((void*)&DCI_pdu.dci_alloc[1].dci_pdu[0], &DLSCH_alloc_pdu[0], dci_length_bytes); - DCI_pdu.Num_ue_spec_dci++; - - - DCI_pdu.dci_alloc[0].dci_length = UL_pdu_size_bits; - DCI_pdu.dci_alloc[0].L = log2L; - DCI_pdu.dci_alloc[0].rnti = rnti; - DCI_pdu.dci_alloc[0].format = format0; - DCI_pdu.dci_alloc[0].ra_flag = 0; - memcpy((void*)&DCI_pdu.dci_alloc[0].dci_pdu[0], &UL_alloc_pdu[0], UL_pdu_size_bytes); - DCI_pdu.Num_ue_spec_dci++; - */ + DCI_pdu.dci_alloc[1].dci_length = dci_length; + DCI_pdu.dci_alloc[1].L = log2L; + DCI_pdu.dci_alloc[1].rnti = rnti; + DCI_pdu.dci_alloc[1].format = format1; + DCI_pdu.dci_alloc[1].ra_flag = 0; + memcpy((void*)&DCI_pdu.dci_alloc[1].dci_pdu[0], &DLSCH_alloc_pdu[0], dci_length_bytes); + DCI_pdu.Num_ue_spec_dci++; + + if (lte_frame_parms->N_RB_DL >= 50) { + DCI_pdu.dci_alloc[2].dci_length = UL_pdu_size_bits; + DCI_pdu.dci_alloc[2].L = log2L; + DCI_pdu.dci_alloc[2].rnti = rnti; + DCI_pdu.dci_alloc[2].format = format0; + DCI_pdu.dci_alloc[2].ra_flag = 0; + memcpy((void*)&DCI_pdu.dci_alloc[0].dci_pdu[0], &UL_alloc_pdu[0], UL_pdu_size_bytes); + DCI_pdu.Num_ue_spec_dci++; + } + } + + + DCI_pdu.nCCE = 0; for (i=0; i<DCI_pdu.Num_common_dci+DCI_pdu.Num_ue_spec_dci; i++) { DCI_pdu.nCCE += (1<<(DCI_pdu.dci_alloc[i].L)); } - + return(&DCI_pdu); } @@ -523,10 +435,8 @@ int main(int argc, char **argv) uint8_t dci_cnt=0; LTE_DL_FRAME_PARMS *frame_parms; uint8_t log2L=2, log2Lcommon=2, format_selector=0; - uint8_t numCCE,nCCE_max,common_active=0,ul_active=0,dl_active=0; - uint32_t rv; + uint8_t numCCE,common_active=0,ul_active=0,dl_active=0; - DCI_format_t format = format1; uint32_t n_trials_common=0,n_trials_ul=0,n_trials_dl=0,false_detection_cnt=0; uint8_t common_rx,ul_rx,dl_rx; uint8_t tdd_config=3; @@ -540,19 +450,19 @@ int main(int argc, char **argv) DCI_ALLOC_t dci_alloc_rx[8]; - void* dlsch_pdu = NULL; - // int ret; + int ret; uint8_t harq_pid; uint8_t phich_ACK; uint8_t num_phich_interf = 0; lte_frame_type_t frame_type=TDD; - int re_offset; - uint32_t *txptr; + // int re_offset; + // uint32_t *txptr; int aarx; int k; uint32_t perfect_ce = 0; + int CCE_table[800]; number_of_cards = 1; openair_daq_vars.rx_rf_mode = 1; @@ -798,9 +708,10 @@ int main(int argc, char **argv) n_rx, transmission_mode, extended_prefix_flag, + frame_type, Nid_cell, tdd_config, - N_RB_DL,frame_type, + N_RB_DL, osf, perfect_ce); @@ -876,7 +787,7 @@ int main(int argc, char **argv) i=0; while (!feof(input_fd)) { - fscanf(input_fd,"%s %s",input_val_str,input_val_str2);//&input_val1,&input_val2); + ret=fscanf(input_fd,"%s %s",input_val_str,input_val_str2);//&input_val1,&input_val2); if ((i%4)==0) { ((short*)txdata[0])[i/2] = (short)((1<<15)*strtod(input_val_str,NULL)); @@ -903,7 +814,7 @@ int main(int argc, char **argv) PHY_vars_UE->UE_mode[0] = PUSCH; - nCCE_max = get_nCCE(3,&PHY_vars_eNB->lte_frame_parms,get_mi(&PHY_vars_eNB->lte_frame_parms,0)); + // nCCE_max = get_nCCE(3,&PHY_vars_eNB->lte_frame_parms,get_mi(&PHY_vars_eNB->lte_frame_parms,0)); //printf("nCCE_max %d\n",nCCE_max); //printf("num_phich interferers %d\n",num_phich_interf); @@ -955,55 +866,62 @@ int main(int argc, char **argv) numCCE=0; n_trials_common++; common_active = 1; - n_trials_ul++; - ul_active = 1; - n_trials_dl++; - dl_active = 1; + if (PHY_vars_eNB->lte_frame_parms.N_RB_DL >= 50) { + n_trials_ul++; + ul_active = 1; + } + if (PHY_vars_eNB->lte_frame_parms.N_RB_DL >= 25) { + n_trials_dl++; + dl_active = 1; + } - init_nCCE_table(); num_pdcch_symbols = get_num_pdcch_symbols(DCI_pdu.Num_common_dci+DCI_pdu.Num_ue_spec_dci, DCI_pdu.dci_alloc, frame_parms, subframe); - DCI_pdu.nCCE = get_nCCE(num_pdcch_symbols,&PHY_vars_eNB->lte_frame_parms,get_mi(&PHY_vars_eNB->lte_frame_parms,subframe)); + numCCE = get_nCCE(num_pdcch_symbols,&PHY_vars_eNB->lte_frame_parms,get_mi(&PHY_vars_eNB->lte_frame_parms,subframe)); if (n_frames==1) { printf("num_dci %d, num_pddch_symbols %d, nCCE %d\n", DCI_pdu.Num_common_dci+DCI_pdu.Num_ue_spec_dci, - num_pdcch_symbols, - DCI_pdu.nCCE); + num_pdcch_symbols,numCCE); } // apply RNTI-based nCCE allocation + memset(CCE_table,0,800*sizeof(int)); + for (i = 0; i < DCI_pdu.Num_common_dci + DCI_pdu.Num_ue_spec_dci; i++) { // SI RNTI if (DCI_pdu.dci_alloc[i].rnti == SI_RNTI) { - DCI_pdu.dci_alloc[i].nCCE = get_nCCE_offset(1<<DCI_pdu.dci_alloc[i].L, - DCI_pdu.nCCE, - 1, - SI_RNTI, - subframe); + DCI_pdu.dci_alloc[i].firstCCE = get_nCCE_offset_l1(CCE_table, + 1<<DCI_pdu.dci_alloc[i].L, + numCCE, + 1, + SI_RNTI, + subframe); } // RA RNTI else if (DCI_pdu.dci_alloc[i].ra_flag == 1) { - DCI_pdu.dci_alloc[i].nCCE = get_nCCE_offset(1<<DCI_pdu.dci_alloc[i].L, - DCI_pdu.nCCE, - 1, - DCI_pdu.dci_alloc[i].rnti, - subframe); + DCI_pdu.dci_alloc[i].firstCCE = get_nCCE_offset_l1(CCE_table, + 1<<DCI_pdu.dci_alloc[i].L, + numCCE, + 1, + DCI_pdu.dci_alloc[i].rnti, + subframe); } // C RNTI else { - DCI_pdu.dci_alloc[i].nCCE = get_nCCE_offset(1<<DCI_pdu.dci_alloc[i].L, - DCI_pdu.nCCE, - 0, - DCI_pdu.dci_alloc[i].rnti, - subframe); + DCI_pdu.dci_alloc[i].firstCCE = get_nCCE_offset_l1(CCE_table, + 1<<DCI_pdu.dci_alloc[i].L, + numCCE, + 0, + DCI_pdu.dci_alloc[i].rnti, + subframe); } if (n_frames==1) printf("dci %d: rnti 0x%x, format %d, L %d, nCCE %d/%d dci_length %d\n",i,DCI_pdu.dci_alloc[i].rnti, DCI_pdu.dci_alloc[i].format, - DCI_pdu.dci_alloc[i].L, DCI_pdu.dci_alloc[i].nCCE, DCI_pdu.nCCE, DCI_pdu.dci_alloc[i].dci_length); + DCI_pdu.dci_alloc[i].L, DCI_pdu.dci_alloc[i].firstCCE, numCCE, DCI_pdu.dci_alloc[i].dci_length); - if (DCI_pdu.dci_alloc[i].nCCE==-1) + if (DCI_pdu.dci_alloc[i].firstCCE==-1) exit(-1); } @@ -1037,7 +955,7 @@ int main(int argc, char **argv) generate_phich_top(PHY_vars_eNB, subframe,AMP,0,0); - /* + // generate 3 interfering PHICH if (num_phich_interf>0) { PHY_vars_eNB->ulsch_eNB[0]->harq_processes[harq_pid]->first_rb = 4; @@ -1064,7 +982,7 @@ int main(int argc, char **argv) } PHY_vars_eNB->ulsch_eNB[0]->harq_processes[harq_pid]->first_rb = 0; - */ + } // write_output("pilotsF.m","rsF",txdataF[0],lte_PHY_vars_eNB->lte_frame_parms.ofdm_symbol_size,1,1); @@ -1084,7 +1002,7 @@ int main(int argc, char **argv) if (PHY_vars_eNB->lte_frame_parms.Ncp == 1) PHY_ofdm_mod(&PHY_vars_eNB->lte_eNB_common_vars.txdataF[eNb_id][aa][subframe*nsymb*PHY_vars_eNB->lte_frame_parms.ofdm_symbol_size], // input, &txdata[aa][subframe*PHY_vars_eNB->lte_frame_parms.samples_per_tti], // output - PHY_vars_eNB->lte_frame_parms.log2_symbol_size, // log2_fft_size + PHY_vars_eNB->lte_frame_parms.ofdm_symbol_size, 2*nsymb, // number of symbols PHY_vars_eNB->lte_frame_parms.nb_prefix_samples, // number of prefix samples CYCLIC_PREFIX); @@ -1244,7 +1162,7 @@ int main(int argc, char **argv) for (i = 0; i < dci_cnt; i++) printf("dci %d: rnti 0x%x, format %d, L %d, nCCE %d/%d dci_length %d\n",i, dci_alloc_rx[i].rnti, dci_alloc_rx[i].format, - dci_alloc_rx[i].L, dci_alloc_rx[i].nCCE, numCCE, dci_alloc_rx[i].dci_length); + dci_alloc_rx[i].L, dci_alloc_rx[i].firstCCE, numCCE, dci_alloc_rx[i].dci_length); } for (i=0; i<dci_cnt; i++) { @@ -1319,8 +1237,8 @@ int main(int argc, char **argv) } //trials printf("SNR %f : n_errors_common = %d/%d (%e)\n", SNR,n_errors_common,n_trials_common,(double)n_errors_common/n_trials_common); - printf("SNR %f : n_errors_ul = %d/%d (%e)\n", SNR,n_errors_ul,n_trials_ul,(double)n_errors_ul/n_trials_ul); - printf("SNR %f : n_errors_dl = %d/%d (%e)\n", SNR,n_errors_dl,n_trials_dl,(double)n_errors_dl/n_trials_dl); + if (ul_active==1) printf("SNR %f : n_errors_ul = %d/%d (%e)\n", SNR,n_errors_ul,n_trials_ul,(double)n_errors_ul/n_trials_ul); + if (dl_active==1) printf("SNR %f : n_errors_dl = %d/%d (%e)\n", SNR,n_errors_dl,n_trials_dl,(double)n_errors_dl/n_trials_dl); printf("SNR %f : n_errors_cfi = %d/%d (%e)\n", SNR,n_errors_cfi,trial,(double)n_errors_cfi/trial); printf("SNR %f : n_errors_hi = %d/%d (%e)\n", SNR,n_errors_hi,trial,(double)n_errors_hi/trial); diff --git a/openair1/SIMULATION/LTE_PHY/prachsim.c b/openair1/SIMULATION/LTE_PHY/prachsim.c index 4df53b053f9b377569c7de648cd323bd12e51176..187a521e07307e0f871bbd1f77be27eeaa88c991 100644 --- a/openair1/SIMULATION/LTE_PHY/prachsim.c +++ b/openair1/SIMULATION/LTE_PHY/prachsim.c @@ -56,58 +56,6 @@ PHY_VARS_UE *PHY_vars_UE; -void lte_param_init(unsigned char N_tx, unsigned char N_rx,unsigned char transmission_mode,unsigned char extended_prefix_flag,uint16_t Nid_cell,uint8_t N_RB_DL,uint8_t osf) -{ - - LTE_DL_FRAME_PARMS *lte_frame_parms; - - printf("Start lte_param_init\n"); - PHY_vars_eNB = malloc(sizeof(PHY_VARS_eNB)); - - PHY_vars_UE = malloc(sizeof(PHY_VARS_UE)); - //PHY_config = malloc(sizeof(PHY_CONFIG)); - mac_xface = malloc(sizeof(MAC_xface)); - - randominit(0); - set_taus_seed(0); - - lte_frame_parms = &(PHY_vars_eNB->lte_frame_parms); - - lte_frame_parms->N_RB_DL = N_RB_DL; //50 for 10MHz and 25 for 5 MHz - lte_frame_parms->N_RB_UL = N_RB_DL; - lte_frame_parms->Ncp = extended_prefix_flag; - lte_frame_parms->Nid_cell = Nid_cell; - lte_frame_parms->nushift = 0; - lte_frame_parms->nb_antennas_tx = N_tx; - lte_frame_parms->nb_antennas_rx = N_rx; - // lte_frame_parms->Csrs = 2; - // lte_frame_parms->Bsrs = 0; - // lte_frame_parms->kTC = 0; - // lte_frame_parms->n_RRC = 0; - lte_frame_parms->mode1_flag = (transmission_mode == 1)? 1 : 0; - lte_frame_parms->tdd_config = 1; - lte_frame_parms->frame_type = 1; - init_frame_parms(lte_frame_parms,osf); - - //copy_lte_parms_to_phy_framing(lte_frame_parms, &(PHY_config->PHY_framing)); - - - PHY_vars_UE->lte_frame_parms = *lte_frame_parms; - - phy_init_lte_top(lte_frame_parms); - - phy_init_lte_ue(PHY_vars_UE,1,0); - - phy_init_lte_eNB(PHY_vars_eNB,0,0,0); - - - - - - printf("Done lte_param_init\n"); - -} - extern uint16_t prach_root_sequence_map0_3[838]; int main(int argc, char **argv) @@ -370,7 +318,16 @@ int main(int argc, char **argv) if (transmission_mode==2) n_tx=2; - lte_param_init(n_tx,n_rx,transmission_mode,extended_prefix_flag,Nid_cell,N_RB_DL,osf); + lte_param_init(n_tx, + n_rx, + transmission_mode, + extended_prefix_flag, + FDD, + Nid_cell, + 3, + N_RB_DL, + osf, + 0); if (snr1set==0) { diff --git a/openair1/SIMULATION/LTE_PHY/pucchsim.c b/openair1/SIMULATION/LTE_PHY/pucchsim.c index d9a3367b902c74b039fa524026a7a9078c2a94f2..42de78ac7428e0ad1334e06a6ef0721beefb034d 100644 --- a/openair1/SIMULATION/LTE_PHY/pucchsim.c +++ b/openair1/SIMULATION/LTE_PHY/pucchsim.c @@ -58,60 +58,6 @@ PHY_VARS_UE *PHY_vars_UE; -void lte_param_init(unsigned char N_tx, unsigned char N_rx,unsigned char transmission_mode,unsigned char extended_prefix_flag,uint16_t Nid_cell,uint8_t N_RB_DL,uint8_t osf) -{ - - LTE_DL_FRAME_PARMS *lte_frame_parms; - - printf("Start lte_param_init\n"); - PHY_vars_eNB = malloc(sizeof(PHY_VARS_eNB)); - - PHY_vars_UE = malloc(sizeof(PHY_VARS_UE)); - //PHY_config = malloc(sizeof(PHY_CONFIG)); - mac_xface = malloc(sizeof(MAC_xface)); - - randominit(0); - set_taus_seed(0); - - lte_frame_parms = &(PHY_vars_eNB->lte_frame_parms); - - lte_frame_parms->N_RB_DL = N_RB_DL; //50 for 10MHz and 25 for 5 MHz - lte_frame_parms->N_RB_UL = N_RB_DL; - lte_frame_parms->Ncp = extended_prefix_flag; - lte_frame_parms->Nid_cell = Nid_cell; - lte_frame_parms->nushift = 0; - lte_frame_parms->nb_antennas_tx = N_tx; - lte_frame_parms->nb_antennas_rx = N_rx; - // lte_frame_parms->Csrs = 2; - // lte_frame_parms->Bsrs = 0; - // lte_frame_parms->kTC = 0; - // lte_frame_parms->n_RRC = 0; - lte_frame_parms->mode1_flag = (transmission_mode == 1)? 1 : 0; - lte_frame_parms->tdd_config = 3; - lte_frame_parms->frame_type = 0; - init_frame_parms(lte_frame_parms,osf); - - //copy_lte_parms_to_phy_framing(lte_frame_parms, &(PHY_config->PHY_framing)); - -// phy_init_top(lte_frame_parms); //allocation - - PHY_vars_UE->lte_frame_parms = *lte_frame_parms; - - - phy_init_lte_ue(PHY_vars_UE,1,0); - - phy_init_lte_eNB(PHY_vars_eNB,0,0,0); - - phy_init_lte_top(lte_frame_parms); - - - - - printf("Done lte_param_init\n"); - -} - - int main(int argc, char **argv) { @@ -246,7 +192,7 @@ int main(int argc, char **argv) break; default: - msg("Unsupported channel model!\n"); + printf("Unsupported channel model!\n"); exit(-1); } @@ -258,13 +204,13 @@ int main(int argc, char **argv) case 's': snr0 = atof(optarg); - msg("Setting SNR0 to %f\n",snr0); + printf("Setting SNR0 to %f\n",snr0); break; case 'S': snr1 = atof(optarg); snr1set=1; - msg("Setting SNR1 to %f\n",snr1); + printf("Setting SNR1 to %f\n",snr1); break; case 'p': @@ -287,7 +233,7 @@ int main(int argc, char **argv) if ((transmission_mode!=1) && (transmission_mode!=2) && (transmission_mode!=6)) { - msg("Unsupported transmission mode %d\n",transmission_mode); + printf("Unsupported transmission mode %d\n",transmission_mode); exit(-1); } @@ -297,7 +243,7 @@ int main(int argc, char **argv) n_tx=atoi(optarg); if ((n_tx==0) || (n_tx>2)) { - msg("Unsupported number of tx antennas %d\n",n_tx); + printf("Unsupported number of tx antennas %d\n",n_tx); exit(-1); } @@ -307,7 +253,7 @@ int main(int argc, char **argv) n_rx=atoi(optarg); if ((n_rx==0) || (n_rx>2)) { - msg("Unsupported number of rx antennas %d\n",n_rx); + printf("Unsupported number of rx antennas %d\n",n_rx); exit(-1); } @@ -368,7 +314,16 @@ int main(int argc, char **argv) if (transmission_mode==2) n_tx=2; - lte_param_init(n_tx,n_rx,transmission_mode,extended_prefix_flag,Nid_cell,N_RB_DL,osf); + lte_param_init(n_tx, + n_rx, + transmission_mode, + extended_prefix_flag, + Nid_cell, + FDD, + 3, + N_RB_DL, + osf, + 0); if (snr1set==0) { @@ -412,7 +367,7 @@ int main(int argc, char **argv) - msg("[SIM] Using SCM/101\n"); + printf("[SIM] Using SCM/101\n"); UE2eNB = new_channel_desc_scm(PHY_vars_eNB->lte_frame_parms.nb_antennas_tx, PHY_vars_UE->lte_frame_parms.nb_antennas_rx, channel_model, @@ -424,7 +379,7 @@ int main(int argc, char **argv) if (UE2eNB==NULL) { - msg("Problem generating channel model. Exiting.\n"); + printf("Problem generating channel model. Exiting.\n"); exit(-1); } @@ -452,7 +407,7 @@ int main(int argc, char **argv) PHY_vars_UE->lte_frame_parms.pucch_config_common.nRB_CQI = 0; PHY_vars_UE->lte_frame_parms.pucch_config_common.nCS_AN = 0; - pucch_payload = 1; + pucch_payload = 0; generate_pucch(PHY_vars_UE->lte_ue_common_vars.txdataF, frame_parms, @@ -473,7 +428,7 @@ int main(int argc, char **argv) if (frame_parms->Ncp == 1) PHY_ofdm_mod(txdataF2[aa], // input txdata[aa], // output - frame_parms->log2_symbol_size, // log2_fft_size + frame_parms->ofdm_symbol_size, 2*nsymb, // number of symbols frame_parms->nb_prefix_samples, // number of prefix samples CYCLIC_PREFIX); @@ -496,7 +451,7 @@ int main(int argc, char **argv) if (frame_parms->Ncp == 1) PHY_ofdm_mod(&PHY_vars_UE->lte_ue_common_vars.txdataF[aa][2*subframe*nsymb*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES_NO_PREFIX], // input, &txdata[aa][PHY_vars_eNB->lte_frame_parms.samples_per_tti*subframe], // output - frame_parms->log2_symbol_size, // log2_fft_size + frame_parms->ofdm_symbol_size, nsymb, // number of symbols frame_parms->nb_prefix_samples, // number of prefix samples CYCLIC_PREFIX); @@ -595,9 +550,7 @@ int main(int argc, char **argv) } } - lte_eNB_I0_measurements(PHY_vars_eNB, - 0, - 1); + for (i=0; i<2*nsymb*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES; i++) { for (aa=0; aa<PHY_vars_eNB->lte_frame_parms.nb_antennas_rx; aa++) { @@ -645,6 +598,10 @@ int main(int argc, char **argv) // if (sig == 1) // printf("*"); + lte_eNB_I0_measurements(PHY_vars_eNB, + subframe, + 0, + 1); PHY_vars_eNB->PHY_measurements_eNB[0].n0_power_tot_dB = N0;//(int8_t)(sigma2_dB-10*log10(PHY_vars_eNB->lte_frame_parms.ofdm_symbol_size/(12*NB_RB))); stat = rx_pucch(PHY_vars_eNB, pucch_format, diff --git a/openair1/SIMULATION/LTE_PHY/scansim.c b/openair1/SIMULATION/LTE_PHY/scansim.c index c2ceb1c58d53813dd243e1d85a19323321e1627e..2cbb7b3e322522ef9ddcccfd4a78f29ca915d262 100644 --- a/openair1/SIMULATION/LTE_PHY/scansim.c +++ b/openair1/SIMULATION/LTE_PHY/scansim.c @@ -56,94 +56,11 @@ #define BW 20.0 -PHY_VARS_eNB *PHY_vars_eNb,*PHY_vars_eNb1,*PHY_vars_eNb2; +PHY_VARS_eNB *PHY_vars_eNB,*PHY_vars_eNB1,*PHY_vars_eNB2; PHY_VARS_UE *PHY_vars_UE; #define DLSCH_RB_ALLOC 0x1fbf // igore DC component,RB13 -void lte_param_init(unsigned char N_tx, unsigned char N_rx,unsigned char transmission_mode,unsigned char extended_prefix_flag,unsigned char frame_type, uint16_t Nid_cell,uint8_t N_RB_DL,uint8_t osf) -{ - - // unsigned int ind; - LTE_DL_FRAME_PARMS *lte_frame_parms; - int i; - - printf("Start lte_param_init\n"); - PHY_vars_eNb = malloc(sizeof(PHY_VARS_eNB)); - PHY_vars_eNb1 = malloc(sizeof(PHY_VARS_eNB)); - PHY_vars_eNb2 = malloc(sizeof(PHY_VARS_eNB)); - - PHY_vars_UE = malloc(sizeof(PHY_VARS_UE)); - //PHY_config = malloc(sizeof(PHY_CONFIG)); - mac_xface = malloc(sizeof(MAC_xface)); - - randominit(0); - set_taus_seed(0); - - lte_frame_parms = &(PHY_vars_eNb->lte_frame_parms); - - lte_frame_parms->N_RB_DL = N_RB_DL; //50 for 10MHz and 25 for 5 MHz - lte_frame_parms->N_RB_UL = N_RB_DL; - lte_frame_parms->Ncp = extended_prefix_flag; - lte_frame_parms->Nid_cell = Nid_cell; - lte_frame_parms->nushift = Nid_cell%6; - lte_frame_parms->nb_antennas_tx = N_tx; - lte_frame_parms->nb_antennas_tx_eNB = N_tx; - lte_frame_parms->nb_antennas_rx = N_rx; - // lte_frame_parms->Csrs = 2; - // lte_frame_parms->Bsrs = 0; - // lte_frame_parms->kTC = 0; - // lte_frame_parms->n_RRC = 0; - lte_frame_parms->mode1_flag = (transmission_mode == 1)? 1 : 0; - lte_frame_parms->tdd_config = 3; - lte_frame_parms->frame_type = frame_type; - init_frame_parms(lte_frame_parms,osf); - - //copy_lte_parms_to_phy_framing(lte_frame_parms, &(PHY_config->PHY_framing)); - - - PHY_vars_UE->lte_frame_parms = *lte_frame_parms; - - phy_init_lte_top(lte_frame_parms); - - PHY_vars_UE->PHY_measurements.n_adj_cells=2; - PHY_vars_UE->PHY_measurements.adj_cell_id[0] = Nid_cell+1; - PHY_vars_UE->PHY_measurements.adj_cell_id[1] = Nid_cell+2; - - for (i=0; i<3; i++) - lte_gold(lte_frame_parms,PHY_vars_UE->lte_gold_table[i],Nid_cell+i); - - phy_init_lte_ue(PHY_vars_UE,1,0); - - phy_init_lte_eNB(PHY_vars_eNb,0,0,0); - - for (i=0; i<10; i++) { - PHY_vars_UE->scan_info[0].amp[0][i] = 0; - PHY_vars_UE->scan_info[0].amp[1][i] = 0; - PHY_vars_UE->scan_info[0].amp[2][i] = 0; - } - - memcpy((void*)&PHY_vars_eNb1->lte_frame_parms,(void*)&PHY_vars_eNb->lte_frame_parms,sizeof(LTE_DL_FRAME_PARMS)); - PHY_vars_eNb1->lte_frame_parms.Nid_cell=Nid_cell+1; - PHY_vars_eNb1->lte_frame_parms.nushift=(Nid_cell+1)%6; - PHY_vars_eNb1->Mod_id=1; - - memcpy((void*)&PHY_vars_eNb2->lte_frame_parms,(void*)&PHY_vars_eNb->lte_frame_parms,sizeof(LTE_DL_FRAME_PARMS)); - PHY_vars_eNb2->lte_frame_parms.Nid_cell=Nid_cell+2; - PHY_vars_eNb2->lte_frame_parms.nushift=(Nid_cell+2)%6; - PHY_vars_eNb2->Mod_id=2; - - phy_init_lte_eNB(PHY_vars_eNb1,0,0,0); - - phy_init_lte_eNB(PHY_vars_eNb2,0,0,0); - - phy_init_lte_top(lte_frame_parms); - - printf("Done lte_param_init\n"); - - -} - mod_sym_t *dummybuf[4]; mod_sym_t dummy0[2048*14]; mod_sym_t dummy1[2048*14]; @@ -404,7 +321,16 @@ int main(int argc, char **argv) if (transmission_mode>=2) n_tx=2; - lte_param_init(n_tx,n_rx,transmission_mode,extended_prefix_flag,frame_type,Nid_cell,N_RB_DL,osf); + lte_param_init(n_tx, + n_rx, + transmission_mode, + extended_prefix_flag, + frame_type, + Nid_cell, + 3, + N_RB_DL, + osf, + 0); #ifdef XFORMS fl_initialize (&argc, argv, NULL, 0, 0); @@ -422,13 +348,13 @@ int main(int argc, char **argv) printf("SNR0 %f, SNR1 %f\n",snr0,snr1); - frame_parms = &PHY_vars_eNb->lte_frame_parms; + frame_parms = &PHY_vars_eNB->lte_frame_parms; - txdata = PHY_vars_eNb->lte_eNB_common_vars.txdata[0]; - txdata1 = PHY_vars_eNb1->lte_eNB_common_vars.txdata[0]; - txdata2 = PHY_vars_eNb2->lte_eNB_common_vars.txdata[0]; + txdata = PHY_vars_eNB->lte_eNB_common_vars.txdata[0]; + txdata1 = PHY_vars_eNB1->lte_eNB_common_vars.txdata[0]; + txdata2 = PHY_vars_eNB2->lte_eNB_common_vars.txdata[0]; s_re = malloc(2*sizeof(double*)); @@ -449,8 +375,8 @@ int main(int argc, char **argv) printf("FFT Size %d, Extended Prefix %d, Samples per subframe %d, Symbols per subframe %d\n",NUMBER_OF_OFDM_CARRIERS, frame_parms->Ncp,frame_parms->samples_per_tti,nsymb); - printf("PHY_vars_eNb1->lte_eNB_common_vars.txdataF[0][0] = %p\n", - PHY_vars_eNb1->lte_eNB_common_vars.txdataF[0][0]); + printf("PHY_vars_eNB1->lte_eNB_common_vars.txdataF[0][0] = %p\n", + PHY_vars_eNB1->lte_eNB_common_vars.txdataF[0][0]); DLSCH_alloc_pdu2.rah = 0; @@ -465,13 +391,14 @@ int main(int argc, char **argv) // Forget second codeword DLSCH_alloc_pdu2.tpmi = (transmission_mode==6 ? 5 : 0) ; // precoding - eNB2UE = new_channel_desc_scm(PHY_vars_eNb->lte_frame_parms.nb_antennas_tx, - PHY_vars_UE->lte_frame_parms.nb_antennas_rx, - channel_model, - BW, - 0, - 0, - 0); + eNB2UE = new_channel_desc_scm(PHY_vars_eNB->lte_frame_parms.nb_antennas_tx, + PHY_vars_UE->lte_frame_parms.nb_antennas_rx, + channel_model, + N_RB2sampling_rate(PHY_vars_eNB->lte_frame_parms.N_RB_DL), + N_RB2channel_bandwidth(PHY_vars_eNB->lte_frame_parms.N_RB_DL), + 0, + 0, + 0); if (eNB2UE==NULL) { @@ -512,51 +439,51 @@ int main(int argc, char **argv) pbch_pdu[1]=1; pbch_pdu[2]=0; - if (PHY_vars_eNb->lte_frame_parms.frame_type == FDD) { - generate_pss(PHY_vars_eNb->lte_eNB_common_vars.txdataF[0], + if (PHY_vars_eNB->lte_frame_parms.frame_type == FDD) { + generate_pss(PHY_vars_eNB->lte_eNB_common_vars.txdataF[0], AMP, - &PHY_vars_eNb->lte_frame_parms, - (PHY_vars_eNb->lte_frame_parms.Ncp==NORMAL) ? 6 : 5, + &PHY_vars_eNB->lte_frame_parms, + (PHY_vars_eNB->lte_frame_parms.Ncp==NORMAL) ? 6 : 5, 0); /* - generate_sss(PHY_vars_eNb->lte_eNB_common_vars.txdataF[0], + generate_sss(PHY_vars_eNB->lte_eNB_common_vars.txdataF[0], AMP, - &PHY_vars_eNb->lte_frame_parms, - (PHY_vars_eNb->lte_frame_parms.Ncp==0) ? 5 : 4, + &PHY_vars_eNB->lte_frame_parms, + (PHY_vars_eNB->lte_frame_parms.Ncp==0) ? 5 : 4, 0);*/ - generate_pss(PHY_vars_eNb->lte_eNB_common_vars.txdataF[0], + generate_pss(PHY_vars_eNB->lte_eNB_common_vars.txdataF[0], AMP, - &PHY_vars_eNb->lte_frame_parms, - (PHY_vars_eNb->lte_frame_parms.Ncp==0) ? 6 : 5, + &PHY_vars_eNB->lte_frame_parms, + (PHY_vars_eNB->lte_frame_parms.Ncp==0) ? 6 : 5, 10); /* - generate_sss(PHY_vars_eNb->lte_eNB_common_vars.txdataF[0], + generate_sss(PHY_vars_eNB->lte_eNB_common_vars.txdataF[0], AMP, - &PHY_vars_eNb->lte_frame_parms, - (PHY_vars_eNb->lte_frame_parms.Ncp==0) ? 5 : 4, + &PHY_vars_eNB->lte_frame_parms, + (PHY_vars_eNB->lte_frame_parms.Ncp==0) ? 5 : 4, 10); */ } else { - generate_sss(PHY_vars_eNb->lte_eNB_common_vars.txdataF[0], + generate_sss(PHY_vars_eNB->lte_eNB_common_vars.txdataF[0], AMP, - &PHY_vars_eNb->lte_frame_parms, - (PHY_vars_eNb->lte_frame_parms.Ncp==0) ? 6 : 5, + &PHY_vars_eNB->lte_frame_parms, + (PHY_vars_eNB->lte_frame_parms.Ncp==0) ? 6 : 5, 1); - generate_pss(PHY_vars_eNb->lte_eNB_common_vars.txdataF[0], + generate_pss(PHY_vars_eNB->lte_eNB_common_vars.txdataF[0], AMP, - &PHY_vars_eNb->lte_frame_parms, + &PHY_vars_eNB->lte_frame_parms, 2, 2); - generate_sss(PHY_vars_eNb->lte_eNB_common_vars.txdataF[0], + generate_sss(PHY_vars_eNB->lte_eNB_common_vars.txdataF[0], AMP, - &PHY_vars_eNb->lte_frame_parms, - (PHY_vars_eNb->lte_frame_parms.Ncp==0) ? 6 : 5, + &PHY_vars_eNB->lte_frame_parms, + (PHY_vars_eNB->lte_frame_parms.Ncp==0) ? 6 : 5, 11); - generate_pss(PHY_vars_eNb->lte_eNB_common_vars.txdataF[0], + generate_pss(PHY_vars_eNB->lte_eNB_common_vars.txdataF[0], AMP, - &PHY_vars_eNb->lte_frame_parms, + &PHY_vars_eNB->lte_frame_parms, 2, 12); @@ -565,8 +492,8 @@ int main(int argc, char **argv) /* - generate_pilots(PHY_vars_eNb, - PHY_vars_eNb->lte_eNB_common_vars.txdataF[0], + generate_pilots(PHY_vars_eNB, + PHY_vars_eNB->lte_eNB_common_vars.txdataF[0], AMP, LTE_NUMBER_OF_SUBFRAMES_PER_FRAME); @@ -577,8 +504,8 @@ int main(int argc, char **argv) dci_alloc, 0, 1024, - &PHY_vars_eNb->lte_frame_parms, - PHY_vars_eNb->lte_eNB_common_vars.txdataF[0], + &PHY_vars_eNB->lte_frame_parms, + PHY_vars_eNB->lte_eNB_common_vars.txdataF[0], 0); */ @@ -593,25 +520,25 @@ int main(int argc, char **argv) dummybuf[1] = dummy1; dummybuf[2] = dummy2; dummybuf[3] = dummy3; - generate_pbch(&PHY_vars_eNb->lte_eNB_pbch, + generate_pbch(&PHY_vars_eNB->lte_eNB_pbch, (mod_sym_t**)dummybuf, AMP, - &PHY_vars_eNb->lte_frame_parms, + &PHY_vars_eNB->lte_frame_parms, pbch_pdu, 0); } - generate_pbch(&PHY_vars_eNb->lte_eNB_pbch, - PHY_vars_eNb->lte_eNB_common_vars.txdataF[0], + generate_pbch(&PHY_vars_eNB->lte_eNB_pbch, + PHY_vars_eNB->lte_eNB_common_vars.txdataF[0], AMP, - &PHY_vars_eNb->lte_frame_parms, + &PHY_vars_eNB->lte_frame_parms, pbch_pdu, pbch_phase); */ - write_output("txsigF0.m","txsF0", PHY_vars_eNb->lte_eNB_common_vars.txdataF[0][0],FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX,1,1); + write_output("txsigF0.m","txsF0", PHY_vars_eNB->lte_eNB_common_vars.txdataF[0][0],FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX,1,1); - if (PHY_vars_eNb->lte_frame_parms.nb_antennas_tx>1) - write_output("txsigF1.m","txsF1", PHY_vars_eNb->lte_eNB_common_vars.txdataF[0][1],FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX,1,1); + if (PHY_vars_eNB->lte_frame_parms.nb_antennas_tx>1) + write_output("txsigF1.m","txsF1", PHY_vars_eNB->lte_eNB_common_vars.txdataF[0][1],FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX,1,1); tx_lev = 0; tx_lev1 = 0; @@ -620,16 +547,16 @@ int main(int argc, char **argv) - for (aa=0; aa<PHY_vars_eNb->lte_frame_parms.nb_antennas_tx; aa++) { + for (aa=0; aa<PHY_vars_eNB->lte_frame_parms.nb_antennas_tx; aa++) { if (frame_parms->Ncp == 1) - PHY_ofdm_mod(PHY_vars_eNb->lte_eNB_common_vars.txdataF[0][aa], // input, + PHY_ofdm_mod(PHY_vars_eNB->lte_eNB_common_vars.txdataF[0][aa], // input, txdata[aa], // output - frame_parms->log2_symbol_size, // log2_fft_size + frame_parms->ofdm_symbol_size, LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*nsymb, // number of symbols frame_parms->nb_prefix_samples, // number of prefix samples CYCLIC_PREFIX); else { - normal_prefix_mod(PHY_vars_eNb->lte_eNB_common_vars.txdataF[0][aa], + normal_prefix_mod(PHY_vars_eNB->lte_eNB_common_vars.txdataF[0][aa], txdata[aa], LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*nsymb, frame_parms); @@ -648,7 +575,7 @@ int main(int argc, char **argv) // multipath channel for (i=0; i<2*nsymb*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES; i++) { - for (aa=0; aa<PHY_vars_eNb->lte_frame_parms.nb_antennas_tx; aa++) { + for (aa=0; aa<PHY_vars_eNB->lte_frame_parms.nb_antennas_tx; aa++) { s_re[aa][i] = ((double)(((short *)txdata[aa]))[(i<<1)]); s_im[aa][i] = ((double)(((short *)txdata[aa]))[(i<<1)+1]); } @@ -667,7 +594,7 @@ int main(int argc, char **argv) multipath_channel(eNB2UE,s_re,s_im,r_re,r_im, 2*nsymb*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES,0); - sigma2_dB = 10*log10((double)tx_lev) +10*log10((double)PHY_vars_eNb->lte_frame_parms.ofdm_symbol_size/(double)(12*NB_RB)) - SNR; + sigma2_dB = 10*log10((double)tx_lev) +10*log10((double)PHY_vars_eNB->lte_frame_parms.ofdm_symbol_size/(double)(12*NB_RB)) - SNR; if (n_frames==1) printf("sigma2_dB %f (SNR %f dB) tx_lev_dB %f,%f,%f\n",sigma2_dB,SNR, @@ -689,7 +616,7 @@ int main(int argc, char **argv) for (n_trials=0; n_trials<ntrials; n_trials++) { //printf("n_trial %d\n",n_trials); for (i=0; i<2*nsymb*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES; i++) { - for (aa=0; aa<PHY_vars_eNb->lte_frame_parms.nb_antennas_rx; aa++) { + for (aa=0; aa<PHY_vars_eNB->lte_frame_parms.nb_antennas_rx; aa++) { ((short*) PHY_vars_UE->lte_ue_common_vars.rxdata[aa])[2*i] = (short) ((r_re[aa][i] +sqrt(sigma2/2)*gaussdouble(0.0,1.0))); ((short*) PHY_vars_UE->lte_ue_common_vars.rxdata[aa])[2*i+1] = (short) ((r_im[aa][i] + (iqim*r_re[aa][i]) + sqrt(sigma2/2)*gaussdouble(0.0,1.0))); } diff --git a/openair1/SIMULATION/LTE_PHY/syncsim.c b/openair1/SIMULATION/LTE_PHY/syncsim.c index a5f046da9352a4105acaafe8e291e24ab13271f4..45b69adcc544c0e1b6f89d25ad8be4ecf6e3314a 100644 --- a/openair1/SIMULATION/LTE_PHY/syncsim.c +++ b/openair1/SIMULATION/LTE_PHY/syncsim.c @@ -1189,7 +1189,7 @@ int main(int argc, char **argv) if (frame_parms->Ncp == 1) PHY_ofdm_mod(txdataF2[aa], // input txdata[aa], // output - PHY_vars_eNB->lte_frame_parms.log2_symbol_size, // log2_fft_size + PHY_vars_eNB->lte_frame_parms.ofdm_symbol_size, // log2_fft_size LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*nsymb, // number of symbols PHY_vars_eNB->lte_frame_parms.nb_prefix_samples, // number of prefix samples PHY_vars_eNB->lte_frame_parms.twiddle_ifft, // IFFT twiddle factors @@ -1218,7 +1218,7 @@ int main(int argc, char **argv) if (frame_parms->Ncp == 1) PHY_ofdm_mod(PHY_vars_eNB->lte_eNB_common_vars.txdataF[eNb_id][aa], // input, txdata[aa], // output - frame_parms->log2_symbol_size, // log2_fft_size + frame_parms->ofdm_symbol_size, // log2_fft_size LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*nsymb, // number of symbols frame_parms->nb_prefix_samples, // number of prefix samples frame_parms->twiddle_ifft, // IFFT twiddle factors @@ -1240,7 +1240,7 @@ int main(int argc, char **argv) if (frame_parms->Ncp == 1) PHY_ofdm_mod(PHY_vars_eNB1->lte_eNB_common_vars.txdataF[eNb_id][aa], // input, PHY_vars_eNB1->lte_eNB_common_vars.txdata[eNb_id][aa], // output - frame_parms->log2_symbol_size, // log2_fft_size + frame_parms->ofdm_symbol_size, // log2_fft_size LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*nsymb, // number of symbols frame_parms->nb_prefix_samples, // number of prefix samples frame_parms->twiddle_ifft, // IFFT twiddle factors @@ -1260,7 +1260,7 @@ int main(int argc, char **argv) if (frame_parms->Ncp == 1) PHY_ofdm_mod(PHY_vars_eNB2->lte_eNB_common_vars.txdataF[eNb_id][aa], // input, PHY_vars_eNB2->lte_eNB_common_vars.txdata[eNb_id][aa], // output - frame_parms->log2_symbol_size, // log2_fft_size + frame_parms->ofdm_symbol_size, // log2_fft_size LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*nsymb, // number of symbols frame_parms->nb_prefix_samples, // number of prefix samples frame_parms->twiddle_ifft, // IFFT twiddle factors diff --git a/openair1/SIMULATION/LTE_PHY/ulsim.c b/openair1/SIMULATION/LTE_PHY/ulsim.c index de2789acef4e6745e8ac92720d4a722c4ca78a1e..463c74c123b39cf428201d4a5c16be6d05f2308e 100644 --- a/openair1/SIMULATION/LTE_PHY/ulsim.c +++ b/openair1/SIMULATION/LTE_PHY/ulsim.c @@ -89,60 +89,6 @@ double t_rx_min = 1000000000; /*!< \brief initial min process time for tx */ int n_tx_dropped = 0; /*!< \brief initial max process time for tx */ int n_rx_dropped = 0; /*!< \brief initial max process time for rx */ -void lte_param_init(unsigned char N_tx, unsigned char N_rx,unsigned char transmission_mode,uint8_t extended_prefix_flag,uint8_t N_RB_DL,uint8_t frame_type,uint8_t tdd_config,uint8_t osf) -{ - - LTE_DL_FRAME_PARMS *lte_frame_parms; - - printf("Start lte_param_init\n"); - PHY_vars_eNB = malloc(sizeof(PHY_VARS_eNB)); - PHY_vars_UE = malloc(sizeof(PHY_VARS_UE)); - //PHY_config = malloc(sizeof(PHY_CONFIG)); - mac_xface = malloc(sizeof(MAC_xface)); - - randominit(0); - set_taus_seed(0); - - lte_frame_parms = &(PHY_vars_eNB->lte_frame_parms); - - lte_frame_parms->frame_type = frame_type; - lte_frame_parms->tdd_config = tdd_config; - lte_frame_parms->N_RB_DL = N_RB_DL; //50 for 10MHz and 25 for 5 MHz - lte_frame_parms->N_RB_UL = N_RB_DL; - lte_frame_parms->Ncp = extended_prefix_flag; - lte_frame_parms->Ncp_UL = extended_prefix_flag; - lte_frame_parms->Nid_cell = 10; - lte_frame_parms->nushift = 0; - lte_frame_parms->nb_antennas_tx = N_tx; - lte_frame_parms->nb_antennas_rx = N_rx; - // lte_frame_parms->Csrs = 2; - // lte_frame_parms->Bsrs = 0; - // lte_frame_parms->kTC = 0; - // lte_frame_parms->n_RRC = 0; - lte_frame_parms->mode1_flag = (transmission_mode == 1)? 1 : 0; - lte_frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.cyclicShift = 0;//n_DMRS1 set to 0 - - init_frame_parms(lte_frame_parms,osf); - - //copy_lte_parms_to_phy_framing(lte_frame_parms, &(PHY_config->PHY_framing)); - - - PHY_vars_UE->lte_frame_parms = *lte_frame_parms; - - phy_init_lte_top(lte_frame_parms); - - phy_init_lte_ue(PHY_vars_UE,1,0); - - phy_init_lte_eNB(PHY_vars_eNB,0,0,0); - - printf("Done lte_param_init\n"); - - -} - - - - int main(int argc, char **argv) { @@ -151,7 +97,7 @@ int main(int argc, char **argv) int aarx,aatx; double channelx,channely; - double sigma2, sigma2_dB=10,SNR,SNR2,snr0=-2.0,snr1,SNRmeas,rate,saving_bler; + double sigma2, sigma2_dB=10,SNR,SNR2,snr0=-2.0,snr1,SNRmeas,rate,saving_bler=0; double input_snr_step=.2,snr_int=30; double blerr; @@ -180,7 +126,7 @@ int main(int argc, char **argv) unsigned int coded_bits_per_codeword,nsymb; int subframe=3; unsigned int tx_lev=0,tx_lev_dB,trials,errs[4]= {0,0,0,0},round_trials[4]= {0,0,0,0}; - uint8_t transmission_mode=1,n_rx=1,n_tx=1; + uint8_t transmission_mode=1,n_rx=1; FILE *bler_fd=NULL; char bler_fname[512]; @@ -248,6 +194,7 @@ int main(int argc, char **argv) int nb_rb_set = 0; int sf; + int threequarter_fs=0; opp_enabled=1; // to enable the time meas cpu_freq_GHz = (double)get_cpu_freq_GHz(); @@ -257,7 +204,7 @@ int main(int argc, char **argv) logInit(); - while ((c = getopt (argc, argv, "hapZbm:n:Y:X:x:s:w:e:q:d:D:O:c:r:i:f:y:c:oA:C:R:g:N:l:S:T:QB:PI:L")) != -1) { + while ((c = getopt (argc, argv, "hapZEbm:n:Y:X:x:s:w:e:q:d:D:O:c:r:i:f:y:c:oA:C:R:g:N:l:S:T:QB:PI:L")) != -1) { switch (c) { case 'a': channel_model = AWGN; @@ -395,10 +342,6 @@ int main(int argc, char **argv) exit(-1); } - if (transmission_mode>1) { - n_tx = 1; - } - break; case 'y': @@ -431,6 +374,10 @@ int main(int argc, char **argv) cyclic_shift = atoi(optarg); break; + case 'E': + threequarter_fs=1; + break; + case 'N': N0 = atoi(optarg); break; @@ -520,7 +467,17 @@ int main(int argc, char **argv) } } - lte_param_init(1,n_rx,1,extended_prefix_flag,N_RB_DL,frame_type,tdd_config,osf); + lte_param_init(1, + n_rx, + 1, + extended_prefix_flag, + frame_type, + 0, + tdd_config, + N_RB_DL, + threequarter_fs, + osf, + 0); if (nb_rb_set == 0) nb_rb = PHY_vars_eNB->lte_frame_parms.N_RB_UL; @@ -690,8 +647,8 @@ int main(int argc, char **argv) // Create transport channel structures for 2 transport blocks (MIMO) for (i=0; i<2; i++) { - PHY_vars_eNB->dlsch_eNB[0][i] = new_eNB_dlsch(1,8,N_RB_DL,0); - PHY_vars_UE->dlsch_ue[0][i] = new_ue_dlsch(1,8,MAX_TURBO_ITERATIONS,N_RB_DL,0); + PHY_vars_eNB->dlsch_eNB[0][i] = new_eNB_dlsch(1,8,1827072,N_RB_DL,0); + PHY_vars_UE->dlsch_ue[0][i] = new_ue_dlsch(1,8,1827072,MAX_TURBO_ITERATIONS,N_RB_DL,0); if (!PHY_vars_eNB->dlsch_eNB[0][i]) { printf("Can't get eNB dlsch structures\n"); @@ -706,7 +663,7 @@ int main(int argc, char **argv) PHY_vars_eNB->dlsch_eNB[0][i]->rnti = 14; PHY_vars_UE->dlsch_ue[0][i]->rnti = 14; - } + } switch (PHY_vars_eNB->lte_frame_parms.N_RB_UL) { @@ -894,11 +851,11 @@ int main(int argc, char **argv) harq_pid = subframe2harq_pid(&PHY_vars_UE->lte_frame_parms,PHY_vars_UE->frame_tx,subframe); - + input_buffer_length = PHY_vars_UE->ulsch_ue[0]->harq_processes[harq_pid]->TBS/8; + input_buffer = (unsigned char *)malloc(input_buffer_length+4); // printf("UL frame %d/subframe %d, harq_pid %d\n",PHY_vars_UE->frame,subframe,harq_pid); if (input_fdUL == NULL) { - input_buffer_length = PHY_vars_UE->ulsch_ue[0]->harq_processes[harq_pid]->TBS/8; - input_buffer = (unsigned char *)malloc(input_buffer_length+4); + if (n_frames == 1) { trch_out_fdUL= fopen("ulsch_trchUL.txt","w"); @@ -920,7 +877,7 @@ int main(int argc, char **argv) i=0; while (!feof(input_fdUL)) { - fscanf(input_fdUL,"%s %s",input_val_str,input_val_str2);//&input_val1,&input_val2); + ret=fscanf(input_fdUL,"%s %s",input_val_str,input_val_str2);//&input_val1,&input_val2); if ((i%4)==0) { ((short*)txdata[0])[i/2] = (short)((1<<15)*strtod(input_val_str,NULL)); @@ -1109,7 +1066,7 @@ int main(int argc, char **argv) if (frame_parms->Ncp == 1) PHY_ofdm_mod(&PHY_vars_UE->lte_ue_common_vars.txdataF[aa][subframe*nsymb*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES_NO_PREFIX], // input &txdata[aa][PHY_vars_eNB->lte_frame_parms.samples_per_tti*subframe], // output - PHY_vars_UE->lte_frame_parms.log2_symbol_size, // log2_fft_size + PHY_vars_UE->lte_frame_parms.ofdm_symbol_size, nsymb, // number of symbols PHY_vars_UE->lte_frame_parms.nb_prefix_samples, // number of prefix samples CYCLIC_PREFIX); @@ -1250,6 +1207,7 @@ int main(int argc, char **argv) start_meas(&PHY_vars_eNB->phy_proc_rx); start_meas(&PHY_vars_eNB->ofdm_demod_stats); lte_eNB_I0_measurements(PHY_vars_eNB, + subframe, 0, 1); diff --git a/openair1/SIMULATION/TOOLS/abstraction.c b/openair1/SIMULATION/TOOLS/abstraction.c index 3720d9f99895becb2388bac4830cbb56ead1809a..591b238acfafdd32d00cddeccd2a66d42cbb308c 100644 --- a/openair1/SIMULATION/TOOLS/abstraction.c +++ b/openair1/SIMULATION/TOOLS/abstraction.c @@ -45,7 +45,7 @@ double **cos_lut=NULL,**sin_lut=NULL; -void init_freq_channel(channel_desc_t *desc,uint16_t nb_rb,int16_t n_samples) +int init_freq_channel(channel_desc_t *desc,uint16_t nb_rb,int16_t n_samples) { @@ -54,15 +54,17 @@ void init_freq_channel(channel_desc_t *desc,uint16_t nb_rb,int16_t n_samples) int16_t f; uint8_t l; + if ((n_samples&1)==0) { + fprintf(stderr, "freq_channel_init: n_samples has to be odd\n"); + return(-1); + } cos_lut = (double **)malloc(n_samples*sizeof(double*)); sin_lut = (double **)malloc(n_samples*sizeof(double*)); - - delta_f = nb_rb*180000/(n_samples-1); - for (f=-(n_samples>>1); f<(n_samples>>1); f++) { + for (f=-(n_samples>>1); f<=(n_samples>>1); f++) { freq=delta_f*(double)f*1e-6;// due to the fact that delays is in mus cos_lut[f+(n_samples>>1)] = (double *)malloc((int)desc->nb_taps*sizeof(double)); @@ -81,9 +83,11 @@ void init_freq_channel(channel_desc_t *desc,uint16_t nb_rb,int16_t n_samples) } } + + return(0); } -void freq_channel(channel_desc_t *desc,uint16_t nb_rb,int16_t n_samples) +int freq_channel(channel_desc_t *desc,uint16_t nb_rb,int16_t n_samples) { @@ -93,22 +97,32 @@ void freq_channel(channel_desc_t *desc,uint16_t nb_rb,int16_t n_samples) static int freq_channel_init=0; static int n_samples_max=0; - // printf("no of samples:%d,",n_samples); + // do some error checking + // n_samples has to be a odd number because we assume the spectrum is symmetric around the DC and includes the DC + if ((n_samples&1)==0) { + fprintf(stderr, "freq_channel: n_samples has to be odd\n"); + return(-1); + } + // printf("no of taps:%d,",(int)desc->nb_taps); if (freq_channel_init == 0) { // we are initializing the lut for the largets possible n_samples=12*nb_rb+1 // if called with n_samples<12*nb_rb+1, we decimate the lut n_samples_max=12*nb_rb+1; - init_freq_channel(desc,nb_rb,n_samples_max); - freq_channel_init=1; + if (init_freq_channel(desc,nb_rb,n_samples_max)==0) + freq_channel_init=1; + else + return(-1); } - d=n_samples_max/n_samples; + d=(n_samples_max-1)/(n_samples-1); + + //printf("no_samples=%d, n_samples_max=%d, d=%d\n",n_samples,n_samples_max,d); start_meas(&desc->interp_freq); - for (f=-n_samples_max/2,f2=-n_samples/2; f<n_samples_max/2; f+=d,f2++) { + for (f=-n_samples_max/2,f2=-n_samples/2; f<=n_samples_max/2; f+=d,f2++) { clut = cos_lut[n_samples_max/2+f]; slut = sin_lut[n_samples_max/2+f]; @@ -129,6 +143,8 @@ void freq_channel(channel_desc_t *desc,uint16_t nb_rb,int16_t n_samples) } stop_meas(&desc->interp_freq); + + return(0); } double compute_pbch_sinr(channel_desc_t *desc, diff --git a/openair1/SIMULATION/TOOLS/defs.h b/openair1/SIMULATION/TOOLS/defs.h index 0dfea70b890febf0a422674fb05dc33d2c13f95d..c72ea743b1e7a7cfadf39a525c8fd35a9862a090 100644 --- a/openair1/SIMULATION/TOOLS/defs.h +++ b/openair1/SIMULATION/TOOLS/defs.h @@ -354,8 +354,8 @@ int gauss(unsigned int *gauss_LUT,unsigned char Nbits); double gaussdouble(double,double); void randominit(unsigned int seed_init); double uniformrandom(void); -void freq_channel(channel_desc_t *desc,uint16_t nb_rb, int16_t n_samples); -void init_freq_channel(channel_desc_t *desc,uint16_t nb_rb,int16_t n_samples); +int freq_channel(channel_desc_t *desc,uint16_t nb_rb, int16_t n_samples); +int init_freq_channel(channel_desc_t *desc,uint16_t nb_rb,int16_t n_samples); uint8_t multipath_channel_nosigconv(channel_desc_t *desc); void multipath_tv_channel(channel_desc_t *desc, double **tx_sig_re, diff --git a/openair2/COMMON/commonDef.h b/openair2/COMMON/commonDef.h index e33e64ec063ef031cdb58e0339c42067660e3cfd..64216b009465119c56e0d357dab48875b7c4be08 100644 --- a/openair2/COMMON/commonDef.h +++ b/openair2/COMMON/commonDef.h @@ -48,7 +48,19 @@ Description Contains global common definitions #include <stdint.h> #include <stddef.h> +#include <stdbool.h> +typedef signed char boolean_t; + +#if !defined(TRUE) +#define TRUE (boolean_t)0x01 +#endif + +#if !defined(FALSE) +#define FALSE (boolean_t)0x00 +#endif + +#define BOOL_NOT(b) (b^TRUE) #define NAS_UE_ID_FMT "0x%06x" @@ -59,13 +71,6 @@ Description Contains global common definitions #define RETURNok (0) #define RETURNerror (-1) -#ifndef FALSE -#define FALSE (0) -#endif -#ifndef TRUE -#define TRUE (1) -#endif - /* * Name of the environment variable which defines the default directory * where the NAS application is executed and where are located files diff --git a/openair2/COMMON/platform_types.h b/openair2/COMMON/platform_types.h index a1af19fd0a1a1e5417d74470eb483dc7f9c44431..6f7722316fcdbe4d51e7442fff87459fd031d111 100755 --- a/openair2/COMMON/platform_types.h +++ b/openair2/COMMON/platform_types.h @@ -163,7 +163,13 @@ typedef uint32_t mbms_session_id_t; typedef uint16_t mbms_service_id_t; typedef uint16_t rnti_t; typedef uint8_t rrc_enb_index_t; +typedef uint8_t mme_code_t; +typedef uint32_t m_tmsi_t; +//Random UE identity length = 40 bits +#if ! defined(NOT_A_RANDOM_UE_IDENTITY) +#define NOT_A_RANDOM_UE_IDENTITY (uint64_t)0xFFFFFFFF +#endif #if ! defined(NOT_A_RNTI) #define NOT_A_RNTI (rnti_t)0 #endif diff --git a/openair2/ENB_APP/enb_config.c b/openair2/ENB_APP/enb_config.c index ad4dde7faa4f3383c06063a798b878f8a2ecf030..cc63eb8671dcb2e2a8f12bdb443ee26c393e9485 100755 --- a/openair2/ENB_APP/enb_config.c +++ b/openair2/ENB_APP/enb_config.c @@ -170,6 +170,18 @@ #define ENB_CONFIG_STRING_ENB_IPV4_ADDR_FOR_S1U "ENB_IPV4_ADDRESS_FOR_S1U" #define ENB_CONFIG_STRING_ENB_PORT_FOR_S1U "ENB_PORT_FOR_S1U" +#define ENB_CONFIG_STRING_RRH_GW_CONFIG "rrh_gw_config" +#define ENB_CONFIG_STRING_RRH_GW_LOCAL_IF_NAME "local_if_name" +#define ENB_CONFIG_STRING_RRH_GW_LOCAL_ADDRESS "local_address" +#define ENB_CONFIG_STRING_RRH_GW_REMOTE_ADDRESS "remote_address" +#define ENB_CONFIG_STRING_RRH_GW_LOCAL_PORT "local_port" +#define ENB_CONFIG_STRING_RRH_GW_REMOTE_PORT "remote_port" +#define ENB_CONFIG_STRING_RRH_GW_ACTIVE "rrh_gw_active" +#define ENB_CONFIG_STRING_RRH_GW_TRANSPORT_PREFERENCE "tr_preference" +#define ENB_CONFIG_STRING_RRH_GW_RF_TARGET_PREFERENCE "rf_preference" +#define ENB_CONFIG_STRING_RRH_GW_IQ_TXSHIFT "iq_txshift" +#define ENB_CONFIG_STRING_RRH_GW_TX_SAMPLE_ADVANCE "tx_sample_advance" +#define ENB_CONFIG_STRING_RRH_GW_TX_SCHEDULING_ADVANCE "tx_scheduling_advance" #define ENB_CONFIG_STRING_ASN1_VERBOSITY "Asn1_verbosity" #define ENB_CONFIG_STRING_ASN1_VERBOSITY_NONE "none" @@ -274,6 +286,34 @@ void enb_config_display(void) } else { printf( "\tMNC: \t%02"PRIu16":\n",enb_properties.properties[i]->mnc); } + + for (j=0; j< enb_properties.properties[i]->nb_rrh_gw; j++) { + if (enb_properties.properties[i]->rrh_gw_config[j].active == 1 ){ + printf( "\n\tRRH GW %d config for eNB %u:\n\n", j, i); + printf( "\tinterface name : \t%s:\n",enb_properties.properties[i]->rrh_gw_if_name); + printf( "\tlocal address : \t%s:\n",enb_properties.properties[i]->rrh_gw_config[j].local_address); + printf( "\tlocal port : \t%d:\n",enb_properties.properties[i]->rrh_gw_config[j].local_port); + printf( "\tremote address : \t%s:\n",enb_properties.properties[i]->rrh_gw_config[j].remote_address); + printf( "\tremote port : \t%d:\n",enb_properties.properties[i]->rrh_gw_config[j].remote_port); + printf( "\ttx_scheduling_advance :\t%d:\n",enb_properties.properties[i]->rrh_gw_config[j].tx_scheduling_advance); + printf( "\ttx_sample_advance : \t%d:\n",enb_properties.properties[i]->rrh_gw_config[j].tx_sample_advance); + printf( "\tiq_txshift : \t%d:\n",enb_properties.properties[i]->rrh_gw_config[j].iq_txshift); + printf( "\ttransport : \t%s Ethernet:\n",(enb_properties.properties[i]->rrh_gw_config[j].raw == 1)? "RAW" : "UDP"); + if (enb_properties.properties[i]->rrh_gw_config[j].exmimo == 1) { + printf( "\tRF target : \tEXMIMO:\n\n"); + } else if (enb_properties.properties[i]->rrh_gw_config[j].usrp_b200 == 1) { + printf( "\tRF target : \tUSRP_B200:\n\n"); + } else if (enb_properties.properties[i]->rrh_gw_config[j].usrp_x300 == 1) { + printf( "\tRF target : \tUSRP_X300:\n\n"); + } else if (enb_properties.properties[i]->rrh_gw_config[j].bladerf == 1) { + printf( "\tRF target : \tBLADERF:\n\n"); + } else if (enb_properties.properties[i]->rrh_gw_config[j].lmssdr == 1) { + printf( "\tRF target : \tLMSSDR:\n\n"); + } else { + printf( "\tRF target : \tNONE:\n\n"); + } + } + } for (j=0; j< enb_properties.properties[i]->nb_cc; j++) { printf( "\teutra band for CC %d: \t%"PRId16":\n",j,enb_properties.properties[i]->eutra_band[j]); @@ -455,15 +495,18 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP) config_setting_t *setting_srb1 = NULL; config_setting_t *setting_mme_addresses = NULL; config_setting_t *setting_mme_address = NULL; + config_setting_t *setting_rrh_gws = NULL; + config_setting_t *setting_rrh_gw = NULL; config_setting_t *setting_enb = NULL; config_setting_t *setting_otg = NULL; - config_setting_t *subsetting_otg = NULL; + config_setting_t *subsetting_otg = NULL; int num_enb_properties = 0; int enb_properties_index = 0; int num_enbs = 0; int num_mme_address = 0; - int num_otg_elements =0; - int num_component_carriers =0; + int num_rrh_gw = 0; + int num_otg_elements = 0; + int num_component_carriers = 0; int i = 0; int j = 0; int parse_errors = 0; @@ -558,10 +601,21 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP) libconfig_int my_int; + + char* if_name = NULL; char* ipv4 = NULL; + char* ipv4_remote = NULL; char* ipv6 = NULL; char* active = NULL; char* preference = NULL; + + char* tr_preference = NULL; + char* rf_preference = NULL; + libconfig_int tx_scheduling_advance = 0; + libconfig_int tx_sample_advance = 0; + libconfig_int iq_txshift = 0; + libconfig_int local_port = 0; + libconfig_int remote_port = 0; const char* active_enb[MAX_ENB]; char* enb_interface_name_for_S1U = NULL; char* enb_ipv4_address_for_S1U = NULL; @@ -965,7 +1019,7 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP) enb_properties.properties[enb_properties_index]->prach_zero_correlation[j] =prach_zero_correlation; - if ((prach_zero_correlation <0) || (prach_zero_correlation > 63)) + if ((prach_zero_correlation <0) || (prach_zero_correlation > 15)) AssertError (0, parse_errors ++, "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for prach_zero_correlation choice: 0..15!\n", lib_config_file_name_pP, i, prach_zero_correlation); @@ -2136,6 +2190,97 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP) enb_properties.properties[enb_properties_index]->mme_ip_address[j].ipv6 = 1; } } + // RRH Config + setting_rrh_gws = config_setting_get_member (setting_enb, ENB_CONFIG_STRING_RRH_GW_CONFIG); + if ( setting_rrh_gws != NULL) { + num_rrh_gw = config_setting_length(setting_rrh_gws); + enb_properties.properties[enb_properties_index]->nb_rrh_gw = 0; + + for (j = 0; j < num_rrh_gw; j++) { + setting_rrh_gw = config_setting_get_elem(setting_rrh_gws, j); + + if ( !( + config_setting_lookup_string(setting_rrh_gw, ENB_CONFIG_STRING_RRH_GW_LOCAL_IF_NAME, (const char **)&if_name) + && config_setting_lookup_string(setting_rrh_gw, ENB_CONFIG_STRING_RRH_GW_LOCAL_ADDRESS, (const char **)&ipv4) + && config_setting_lookup_string(setting_rrh_gw, ENB_CONFIG_STRING_RRH_GW_REMOTE_ADDRESS , (const char **)&ipv4_remote) + && config_setting_lookup_int(setting_rrh_gw, ENB_CONFIG_STRING_RRH_GW_LOCAL_PORT, &local_port) + && config_setting_lookup_int(setting_rrh_gw, ENB_CONFIG_STRING_RRH_GW_REMOTE_PORT, &remote_port) + && config_setting_lookup_string(setting_rrh_gw, ENB_CONFIG_STRING_RRH_GW_ACTIVE, (const char **)&active) + && config_setting_lookup_string(setting_rrh_gw, ENB_CONFIG_STRING_RRH_GW_TRANSPORT_PREFERENCE, (const char **)&tr_preference) + && config_setting_lookup_string(setting_rrh_gw, ENB_CONFIG_STRING_RRH_GW_RF_TARGET_PREFERENCE, (const char **)&rf_preference) + && config_setting_lookup_int(setting_rrh_gw, ENB_CONFIG_STRING_RRH_GW_IQ_TXSHIFT, &iq_txshift) + && config_setting_lookup_int(setting_rrh_gw, ENB_CONFIG_STRING_RRH_GW_TX_SAMPLE_ADVANCE, &tx_sample_advance) + && config_setting_lookup_int(setting_rrh_gw, ENB_CONFIG_STRING_RRH_GW_TX_SCHEDULING_ADVANCE, &tx_scheduling_advance) + ) + ) { + AssertError (0, parse_errors ++, + "Failed to parse eNB configuration file %s, %u th enb %u the RRH GW address !\n", + lib_config_file_name_pP, i, j); + continue; // FIXME will prevent segfaults below, not sure what happens at function exit... + } + + enb_properties.properties[enb_properties_index]->nb_rrh_gw += 1; + + enb_properties.properties[enb_properties_index]->rrh_gw_if_name = strdup(if_name); + enb_properties.properties[enb_properties_index]->rrh_gw_config[j].local_address = strdup(ipv4); + enb_properties.properties[enb_properties_index]->rrh_gw_config[j].remote_address = strdup(ipv4_remote); + enb_properties.properties[enb_properties_index]->rrh_gw_config[j].local_port = local_port; + enb_properties.properties[enb_properties_index]->rrh_gw_config[j].remote_port = remote_port; + enb_properties.properties[enb_properties_index]->rrh_gw_config[j].iq_txshift = iq_txshift; + enb_properties.properties[enb_properties_index]->rrh_gw_config[j].tx_sample_advance = tx_sample_advance; + enb_properties.properties[enb_properties_index]->rrh_gw_config[j].tx_scheduling_advance= tx_scheduling_advance; + + if (strcmp(active, "yes") == 0) { + enb_properties.properties[enb_properties_index]->rrh_gw_config[j].active = 1; + } + + if (strcmp(tr_preference, "udp") == 0) { + enb_properties.properties[enb_properties_index]->rrh_gw_config[j].udp = 1; + } else if (strcmp(tr_preference, "raw") == 0) { + enb_properties.properties[enb_properties_index]->rrh_gw_config[j].raw = 1; + } else {//if (strcmp(preference, "no") == 0) + enb_properties.properties[enb_properties_index]->rrh_gw_config[j].udp = 1; + enb_properties.properties[enb_properties_index]->rrh_gw_config[j].raw = 1; + } + + if (strcmp(rf_preference, "exmimo") == 0) { + enb_properties.properties[enb_properties_index]->rrh_gw_config[j].exmimo = 1; + } else if (strcmp(rf_preference, "usrp_b200") == 0) { + enb_properties.properties[enb_properties_index]->rrh_gw_config[j].usrp_b200 = 1; + } else if (strcmp(rf_preference, "usrp_x300") == 0) { + enb_properties.properties[enb_properties_index]->rrh_gw_config[j].usrp_x300 = 1; + } else if (strcmp(rf_preference, "bladerf") == 0) { + enb_properties.properties[enb_properties_index]->rrh_gw_config[j].bladerf = 1; + } else if (strcmp(rf_preference, "bladerf") == 0) { + enb_properties.properties[enb_properties_index]->rrh_gw_config[j].lmssdr = 1; + } else {//if (strcmp(preference, "no") == 0) + enb_properties.properties[enb_properties_index]->rrh_gw_config[j].exmimo = 1; + enb_properties.properties[enb_properties_index]->rrh_gw_config[j].usrp_b200 = 1; + enb_properties.properties[enb_properties_index]->rrh_gw_config[j].usrp_x300 = 1; + enb_properties.properties[enb_properties_index]->rrh_gw_config[j].bladerf = 1; + enb_properties.properties[enb_properties_index]->rrh_gw_config[j].lmssdr = 1; + + } + } + } else { + enb_properties.properties[enb_properties_index]->nb_rrh_gw = 0; + enb_properties.properties[enb_properties_index]->rrh_gw_if_name = "none"; + enb_properties.properties[enb_properties_index]->rrh_gw_config[j].local_address = "0.0.0.0"; + enb_properties.properties[enb_properties_index]->rrh_gw_config[j].remote_address = "0.0.0.0"; + enb_properties.properties[enb_properties_index]->rrh_gw_config[j].local_port= 0; + enb_properties.properties[enb_properties_index]->rrh_gw_config[j].remote_port= 0; + enb_properties.properties[enb_properties_index]->rrh_gw_config[j].active = 0; + enb_properties.properties[enb_properties_index]->rrh_gw_config[j].udp = 0; + enb_properties.properties[enb_properties_index]->rrh_gw_config[j].raw = 0; + enb_properties.properties[enb_properties_index]->rrh_gw_config[j].tx_scheduling_advance = 0; + enb_properties.properties[enb_properties_index]->rrh_gw_config[j].tx_sample_advance = 0; + enb_properties.properties[enb_properties_index]->rrh_gw_config[j].iq_txshift = 0; + enb_properties.properties[enb_properties_index]->rrh_gw_config[j].exmimo = 0; + enb_properties.properties[enb_properties_index]->rrh_gw_config[j].usrp_b200 = 0; + enb_properties.properties[enb_properties_index]->rrh_gw_config[j].usrp_x300 = 0; + enb_properties.properties[enb_properties_index]->rrh_gw_config[j].bladerf = 0; + enb_properties.properties[enb_properties_index]->rrh_gw_config[j].lmssdr = 0; + } // SCTP SETTING enb_properties.properties[enb_properties_index]->sctp_out_streams = SCTP_OUT_STREAMS; diff --git a/openair2/ENB_APP/enb_config.h b/openair2/ENB_APP/enb_config.h index de837303ea6da674682414523354f0ab8dc37156..5f7f2636a38ab49c7cfcbcfa5f6dc88103704d4e 100755 --- a/openair2/ENB_APP/enb_config.h +++ b/openair2/ENB_APP/enb_config.h @@ -78,6 +78,24 @@ typedef struct mme_ip_address_s { char *ipv6_address; } mme_ip_address_t; +typedef struct rrh_gw_config_s { + unsigned udp:1; + unsigned raw:1; + unsigned active:1; + char *local_address; + char *remote_address; + uint16_t local_port; + uint16_t remote_port; + int tx_scheduling_advance; + int tx_sample_advance; + int iq_txshift; + unsigned exmimo:1; + unsigned usrp_b200:1; + unsigned usrp_x300:1; + unsigned bladerf:1; + unsigned lmssdr:1; +} rrh_gw_config_t; + typedef struct Enb_properties_s { /* Unique eNB_id to identify the eNB within EPC. * For macro eNB ids this field should be 20 bits long. @@ -203,6 +221,13 @@ typedef struct Enb_properties_s { char *enb_interface_name_for_S1_MME; in_addr_t enb_ipv4_address_for_S1_MME; + + /* Nb of RRH to connect to */ + uint8_t nb_rrh_gw; + char *rrh_gw_if_name; + /* List of MME to connect to */ + rrh_gw_config_t rrh_gw_config[4]; + // otg config /* Nb of OTG elements */ uint8_t num_otg_elements; diff --git a/openair2/LAYER2/MAC/defs.h b/openair2/LAYER2/MAC/defs.h index a0a43b6d7951ea3f4eb9fa1cebb9aa2dad5e34d7..cd2d593726a22ab537a77aa0006f210cac8b4fc7 100644 --- a/openair2/LAYER2/MAC/defs.h +++ b/openair2/LAYER2/MAC/defs.h @@ -251,7 +251,8 @@ typedef struct { typedef struct { uint8_t Num_ue_spec_dci ; uint8_t Num_common_dci ; - unsigned int nCCE; + uint32_t nCCE; + uint32_t num_pdcch_symbols; DCI_ALLOC_t dci_alloc[NUM_DCI_MAX] ; } DCI_PDU; /*! \brief CCCH payload */ @@ -735,7 +736,8 @@ typedef struct { uint8_t dl_pow_off[MAX_NUM_CCs]; uint16_t pre_nb_available_rbs[MAX_NUM_CCs]; unsigned char rballoc_sub_UE[MAX_NUM_CCs][N_RBG_MAX]; - + uint16_t ta_timer; + int16_t ta_update; } UE_sched_ctrl; /*! \brief eNB template for the Random access information */ typedef struct { @@ -765,8 +767,6 @@ typedef struct { uint8_t Msg3_subframe; /// Flag to indicate the eNB should generate Msg4 upon reception of SDU from RRC. This is triggered by first ULSCH reception at eNB for new user. uint8_t generate_Msg4; - /// Flag to indicate the eNB should generate the DCI for Msg4, after getting the SDU from RRC. - uint8_t generate_Msg4_dci; /// Flag to indicate that eNB is waiting for ACK that UE has received Msg3. uint8_t wait_ack_Msg4; /// UE RNTI allocated during RAR @@ -835,8 +835,8 @@ typedef struct { /// Outgoing CCCH pdu for PHY CCCH_PDU CCCH_pdu; RA_TEMPLATE RA_template[NB_RA_PROC_MAX]; - /// BCCH active flag - uint8_t bcch_active; + /// VRB map for common channels + uint8_t vrb_map[100]; /// MBSFN SubframeConfig struct MBSFN_SubframeConfig *mbsfn_SubframeConfig[8]; /// number of subframe allocation pattern available for MBSFN sync area @@ -883,9 +883,11 @@ typedef struct { /// Common cell resources COMMON_channels_t common_channels[MAX_NUM_CCs]; UE_list_t UE_list; + ///subband bitmap configuration SBMAP_CONF sbmap_conf; - + /// CCE table used to build DCI scheduling information + int CCE_table[MAX_NUM_CCs][800]; /// active flag for Other lcid // uint8_t lcid_active[NB_RB_MAX]; /// eNB stats diff --git a/openair2/LAYER2/MAC/eNB_scheduler.c b/openair2/LAYER2/MAC/eNB_scheduler.c index 329c40be05e51ae85e005995f016c0a0294336ea..21e9337dbb156425e9d5aa4600c75d0c337acf2b 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler.c +++ b/openair2/LAYER2/MAC/eNB_scheduler.c @@ -77,13 +77,13 @@ + + + void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, frame_t frameP, sub_frame_t subframeP) //, int calibration_flag) { { - unsigned int nprb[MAX_NUM_CCs]; - unsigned int nCCE[MAX_NUM_CCs]; int mbsfn_status[MAX_NUM_CCs]; - uint32_t RBalloc[MAX_NUM_CCs]; protocol_ctxt_t ctxt; #ifdef EXMIMO int ret; @@ -106,10 +106,11 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) { DCI_pdu[CC_id] = &eNB_mac_inst[module_idP].common_channels[CC_id].DCI_pdu; - nCCE[CC_id]=0; - nprb[CC_id]=0; - RBalloc[CC_id]=0; + DCI_pdu[CC_id]->nCCE=0; + DCI_pdu[CC_id]->num_pdcch_symbols=1; mbsfn_status[CC_id]=0; + // clear vrb_map + memset(eNB_mac_inst[module_idP].common_channels[CC_id].vrb_map,0,100); } // refresh UE list based on UEs dropped by PHY in previous subframe @@ -186,7 +187,7 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) { DCI_pdu[CC_id]->Num_common_dci = 0; DCI_pdu[CC_id]->Num_ue_spec_dci = 0; - eNB_mac_inst[module_idP].common_channels[CC_id].bcch_active = 0; + #ifdef Rel10 eNB_mac_inst[module_idP].common_channels[CC_id].mcch_active =0; @@ -194,6 +195,8 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, eNB_mac_inst[module_idP].frame = frameP; eNB_mac_inst[module_idP].subframe = subframeP; + + } //if (subframeP%5 == 0) @@ -238,19 +241,20 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, // Schedule ULSCH for FDD or subframeP 4 (TDD config 0,3,6) // Schedule Normal DLSCH - schedule_RA(module_idP,frameP,subframeP,2,nprb,nCCE); + + schedule_RA(module_idP,frameP,subframeP,2); + if (mac_xface->lte_frame_parms->frame_type == FDD) { //FDD - schedule_ulsch(module_idP,frameP,cooperation_flag,0,4,nCCE);//,calibration_flag); + schedule_ulsch(module_idP,frameP,cooperation_flag,0,4);//,calibration_flag); } else if ((mac_xface->lte_frame_parms->tdd_config == TDD) || //TDD (mac_xface->lte_frame_parms->tdd_config == 3) || (mac_xface->lte_frame_parms->tdd_config == 6)) { - //schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,4,nCCE);//,calibration_flag); + //schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,4);//,calibration_flag); } - // schedule_ue_spec(module_idP,frameP,subframeP,nprb,nCCE,mbsfn_status); - - fill_DLSCH_dci(module_idP,frameP,subframeP,RBalloc,1,mbsfn_status); + schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status); + fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status); break; @@ -262,22 +266,22 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, switch (mac_xface->lte_frame_parms->tdd_config) { case 0: case 1: - schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,7,nCCE); - fill_DLSCH_dci(module_idP,frameP,subframeP,RBalloc,0,mbsfn_status); + schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,7); + fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status); break; case 6: - schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,8,nCCE); - fill_DLSCH_dci(module_idP,frameP,subframeP,RBalloc,0,mbsfn_status); + schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,8); + fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status); break; default: break; } } else { //FDD - schedule_ue_spec(module_idP,frameP,subframeP,nprb,nCCE,mbsfn_status); - fill_DLSCH_dci(module_idP,frameP,subframeP,RBalloc,0,mbsfn_status); - schedule_ulsch(module_idP,frameP,cooperation_flag,1,5,nCCE); + schedule_ulsch(module_idP,frameP,cooperation_flag,1,5); + schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status); + fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status); } break; @@ -287,9 +291,9 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, // TDD, nothing // FDD, normal UL/DLSCH if (mac_xface->lte_frame_parms->frame_type == FDD) { //FDD - schedule_ue_spec(module_idP,frameP,subframeP,nprb,nCCE,mbsfn_status); - fill_DLSCH_dci(module_idP,frameP,subframeP,RBalloc,0,mbsfn_status); - schedule_ulsch(module_idP,frameP,cooperation_flag,2,6,nCCE); + schedule_ulsch(module_idP,frameP,cooperation_flag,2,6); + schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status); + fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status); } break; @@ -302,22 +306,22 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, if (mac_xface->lte_frame_parms->frame_type == TDD) { switch (mac_xface->lte_frame_parms->tdd_config) { case 2: - schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,7,nCCE); + schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,7); // no break here! case 5: - schedule_ue_spec(module_idP,frameP,subframeP,nprb,nCCE,mbsfn_status); - fill_DLSCH_dci(module_idP,frameP,subframeP,RBalloc,0,mbsfn_status); + schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status); + fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status); break; default: break; } } else { //FDD - schedule_ue_spec(module_idP,frameP,subframeP,nprb,nCCE,mbsfn_status); - fill_DLSCH_dci(module_idP,frameP,subframeP,RBalloc,0,mbsfn_status); - schedule_ulsch(module_idP,frameP,cooperation_flag,3,7,nCCE); + schedule_ulsch(module_idP,frameP,cooperation_flag,3,7); + schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status); + fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status); } break; @@ -330,8 +334,8 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, if (mac_xface->lte_frame_parms->frame_type == 1) { // TDD switch (mac_xface->lte_frame_parms->tdd_config) { case 1: - // schedule_RA(module_idP,frameP,subframeP,nprb,nCCE); - schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,8,nCCE); + // schedule_RA(module_idP,frameP,subframeP); + schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,8); // no break here! case 2: @@ -341,8 +345,9 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, // no break here! case 5: - schedule_ue_spec(module_idP,frameP,subframeP,nprb,nCCE,mbsfn_status); - fill_DLSCH_dci(module_idP,frameP,subframeP,RBalloc,1,mbsfn_status); + + schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status); + fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status); break; default: @@ -350,11 +355,11 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, } } else { if (mac_xface->lte_frame_parms->frame_type == FDD) { //FDD - // schedule_RA(module_idP,frameP, subframeP, 0, nprb, nCCE); - // schedule_ulsch(module_idP, frameP, cooperation_flag, 4, 8, nCCE); - schedule_ue_spec(module_idP, frameP, subframeP, nprb, nCCE, mbsfn_status); - fill_DLSCH_dci(module_idP, frameP, subframeP, RBalloc, 1, mbsfn_status); + // schedule_RA(module_idP,frameP, subframeP, 0); + schedule_ulsch(module_idP, frameP, cooperation_flag, 4, 8); + schedule_ue_spec(module_idP, frameP, subframeP, mbsfn_status); + fill_DLSCH_dci(module_idP, frameP, subframeP, mbsfn_status); } } @@ -365,21 +370,21 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, // TDD Config 0,6 ULSCH for subframes 9,3 resp. // TDD normal DLSCH // FDD normal UL/DLSCH - schedule_SI(module_idP,frameP,nprb,nCCE); + schedule_SI(module_idP,frameP,subframeP); - //schedule_RA(module_idP,frameP,subframeP,5,nprb,nCCE); + //schedule_RA(module_idP,frameP,subframeP,5); if (mac_xface->lte_frame_parms->frame_type == FDD) { - schedule_RA(module_idP,frameP,subframeP,1,nprb,nCCE); - // schedule_ulsch(module_idP,frameP,cooperation_flag,5,9,nCCE); - fill_DLSCH_dci(module_idP,frameP,subframeP,RBalloc,1,mbsfn_status); - + schedule_RA(module_idP,frameP,subframeP,1); + schedule_ulsch(module_idP,frameP,cooperation_flag,5,9); + schedule_ue_spec(module_idP, frameP, subframeP, mbsfn_status); + fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status); } else if ((mac_xface->lte_frame_parms->tdd_config == 0) || // TDD Config 0 (mac_xface->lte_frame_parms->tdd_config == 6)) { // TDD Config 6 - //schedule_ulsch(module_idP,cooperation_flag,subframeP,nCCE); - fill_DLSCH_dci(module_idP,frameP,subframeP,RBalloc,0,mbsfn_status); + //schedule_ulsch(module_idP,cooperation_flag,subframeP); + fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status); } else { - //schedule_ue_spec(module_idP,frameP,subframeP,nprb,nCCE,mbsfn_status); - fill_DLSCH_dci(module_idP,frameP,subframeP,RBalloc,0,mbsfn_status); + schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status); + fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status); } break; @@ -395,36 +400,36 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, break; case 1: - schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,2,nCCE); - // schedule_ue_spec(module_idP,frameP,subframeP,nprb,nCCE,mbsfn_status); - fill_DLSCH_dci(module_idP,frameP,subframeP,RBalloc,0,mbsfn_status); + schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,2); + // schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status); + fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status); break; case 6: - schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,3,nCCE); - // schedule_ue_spec(module_idP,frameP,subframeP,nprb,nCCE,mbsfn_status); - fill_DLSCH_dci(module_idP,frameP,subframeP,RBalloc,0,mbsfn_status); + schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,3); + // schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status); + fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status); break; case 5: - schedule_RA(module_idP,frameP,subframeP,2,nprb,nCCE); - schedule_ue_spec(module_idP,frameP,subframeP,nprb,nCCE,mbsfn_status); - fill_DLSCH_dci(module_idP,frameP,subframeP,RBalloc,1,mbsfn_status); + schedule_RA(module_idP,frameP,subframeP,2); + schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status); + fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status); break; case 3: case 4: - schedule_ue_spec(module_idP,frameP,subframeP,nprb,nCCE,mbsfn_status); - fill_DLSCH_dci(module_idP,frameP,subframeP,RBalloc,0,mbsfn_status); + schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status); + fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status); break; default: break; } } else { //FDD - // schedule_ulsch(module_idP,frameP,cooperation_flag,6,0,nCCE); - schedule_ue_spec(module_idP,frameP,subframeP,nprb,nCCE,mbsfn_status); - fill_DLSCH_dci(module_idP,frameP,subframeP,RBalloc,0,mbsfn_status); + // schedule_ulsch(module_idP,frameP,cooperation_flag,6,0); + schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status); + fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status); } break; @@ -437,23 +442,23 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, switch (mac_xface->lte_frame_parms->tdd_config) { case 3: case 4: - schedule_RA(module_idP,frameP,subframeP,3,nprb,nCCE); // 3 = Msg3 subframeP, not - schedule_ue_spec(module_idP,frameP,subframeP,nprb,nCCE,mbsfn_status); - fill_DLSCH_dci(module_idP,frameP,subframeP,RBalloc,1,mbsfn_status); + schedule_RA(module_idP,frameP,subframeP,3); // 3 = Msg3 subframeP, not + schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status); + fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status); break; case 5: - schedule_ue_spec(module_idP,frameP,subframeP,nprb,nCCE,mbsfn_status); - fill_DLSCH_dci(module_idP,frameP,subframeP,RBalloc,0,mbsfn_status); + schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status); + fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status); break; default: break; } } else { //FDD - //schedule_ulsch(module_idP,frameP,cooperation_flag,7,1,nCCE); - schedule_ue_spec(module_idP,frameP,subframeP,nprb,nCCE,mbsfn_status); - fill_DLSCH_dci(module_idP,frameP,subframeP,RBalloc,0,mbsfn_status); + //schedule_ulsch(module_idP,frameP,cooperation_flag,7,1); + schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status); + fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status); } break; @@ -470,19 +475,19 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, case 4: case 5: - // schedule_RA(module_idP,subframeP,nprb,nCCE); - schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,2,nCCE); - schedule_ue_spec(module_idP,frameP,subframeP,nprb,nCCE,mbsfn_status); - fill_DLSCH_dci(module_idP,frameP,subframeP,RBalloc,0,mbsfn_status); + // schedule_RA(module_idP,subframeP); + schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,2); + schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status); + fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status); break; default: break; } } else { //FDD - //schedule_ulsch(module_idP,frameP,cooperation_flag,8,2,nCCE); - schedule_ue_spec(module_idP,frameP,subframeP,nprb,nCCE,mbsfn_status); - fill_DLSCH_dci(module_idP,frameP,subframeP,RBalloc,0,mbsfn_status); + //schedule_ulsch(module_idP,frameP,cooperation_flag,8,2); + schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status); + fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status); } break; @@ -493,51 +498,53 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, if (mac_xface->lte_frame_parms->frame_type == TDD) { switch (mac_xface->lte_frame_parms->tdd_config) { case 1: - schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,3,nCCE); - schedule_RA(module_idP,frameP,subframeP,7,nprb,nCCE); // 7 = Msg3 subframeP, not - schedule_ue_spec(module_idP,frameP,subframeP,nprb,nCCE,mbsfn_status); - fill_DLSCH_dci(module_idP,frameP,subframeP,RBalloc,1,mbsfn_status); + schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,3); + schedule_RA(module_idP,frameP,subframeP,7); // 7 = Msg3 subframeP, not + schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status); + fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status); break; case 3: case 4: - schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,3,nCCE); - schedule_ue_spec(module_idP,frameP,subframeP,nprb,nCCE,mbsfn_status); - fill_DLSCH_dci(module_idP,frameP,subframeP,RBalloc,0,mbsfn_status); + schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,3); + schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status); + fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status); break; case 6: - schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,4,nCCE); - //schedule_RA(module_idP,frameP,subframeP,nprb,nCCE); - schedule_ue_spec(module_idP,frameP,subframeP,nprb,nCCE,mbsfn_status); - fill_DLSCH_dci(module_idP,frameP,subframeP,RBalloc,0,mbsfn_status); + schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,4); + //schedule_RA(module_idP,frameP,subframeP); + schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status); + fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status); break; case 2: case 5: - //schedule_RA(module_idP,frameP,subframeP,nprb,nCCE); - schedule_ue_spec(module_idP,frameP,subframeP,nprb,nCCE,mbsfn_status); - fill_DLSCH_dci(module_idP,frameP,subframeP,RBalloc,0,mbsfn_status); + //schedule_RA(module_idP,frameP,subframeP); + schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status); + fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status); break; default: break; } } else { //FDD - // schedule_ulsch(module_idP,frameP,cooperation_flag,9,3,nCCE); - schedule_ue_spec(module_idP,frameP,subframeP,nprb,nCCE,mbsfn_status); - fill_DLSCH_dci(module_idP,frameP,subframeP,RBalloc,0,mbsfn_status); + // schedule_ulsch(module_idP,frameP,cooperation_flag,9,3); + schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status); + fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status); } break; } - for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) { - DCI_pdu[CC_id]->nCCE = nCCE[CC_id]; - } + LOG_D(MAC,"FrameP %d, subframeP %d : Scheduling CCEs\n",frameP,subframeP); + + // Allocate CCEs for good after scheduling is done + for (CC_id=0;CC_id<MAX_NUM_CCs;CC_id++) + allocate_CCEs(module_idP,CC_id,subframeP,0); - LOG_D(MAC,"frameP %d, subframeP %d nCCE %d\n",frameP,subframeP,nCCE[0]); + LOG_D(MAC,"frameP %d, subframeP %d\n",frameP,subframeP); stop_meas(&eNB_mac_inst[module_idP].eNB_scheduler); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_ULSCH_SCHEDULER,VCD_FUNCTION_OUT); diff --git a/openair2/LAYER2/MAC/eNB_scheduler_RA.c b/openair2/LAYER2/MAC/eNB_scheduler_RA.c index 361c0f461fb22c26922305927039dcb3d6c519c2..8cb6b913016d02c4a487e1de068c8077ac12a568 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_RA.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_RA.c @@ -68,7 +68,8 @@ #include "SIMULATION/TOOLS/defs.h" // for taus -void schedule_RA(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP,unsigned char Msg3_subframe,unsigned int *nprb,unsigned int *nCCE) + +void schedule_RA(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP,unsigned char Msg3_subframe) { int CC_id; @@ -76,34 +77,195 @@ void schedule_RA(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP,un RA_TEMPLATE *RA_template; - unsigned char i;//,harq_pid,round; + unsigned char i,harq_pid,round; int16_t rrc_sdu_length; unsigned char lcid,offset; module_id_t UE_id= UE_INDEX_INVALID; unsigned short TBsize = -1; unsigned short msg4_padding,msg4_post_padding,msg4_header; + uint8_t *vrb_map; + int first_rb; + int rballoc[MAX_NUM_CCs]; + DCI_PDU *DCI_pdu; start_meas(&eNB->schedule_ra); for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) { - RA_template = (RA_TEMPLATE *)&eNB->common_channels[CC_id].RA_template[0]; + + vrb_map = eNB->common_channels[CC_id].vrb_map; + DCI_pdu = &eNB->common_channels[CC_id].DCI_pdu; for (i=0; i<NB_RA_PROC_MAX; i++) { - if (RA_template[i].RA_active == TRUE) { + RA_template = (RA_TEMPLATE *)&eNB->common_channels[CC_id].RA_template[i]; + + if (RA_template->RA_active == TRUE) { LOG_D(MAC,"[eNB %d][RAPROC] CC_id %d RA %d is active (generate RAR %d, generate_Msg4 %d, wait_ack_Msg4 %d, rnti %x)\n", - module_idP,CC_id,i,RA_template[i].generate_rar,RA_template[i].generate_Msg4,RA_template[i].wait_ack_Msg4, RA_template[i].rnti); + module_idP,CC_id,i,RA_template->generate_rar,RA_template->generate_Msg4,RA_template->wait_ack_Msg4, RA_template->rnti); + + if (RA_template->generate_rar == 1) { + + LOG_D(MAC,"[eNB %d] CC_id %d Frame %d, subframeP %d: Generating RAR DCI (proc %d), RA_active %d format 1A (%d,%d))\n", + module_idP, CC_id, frameP, subframeP,i, + RA_template->RA_active, + RA_template->RA_dci_fmt1, + RA_template->RA_dci_size_bits1); + + + + if (PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.frame_type == TDD) { + switch(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL) { + case 6: + ((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->type=1; + ((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->vrb_type=0; + ((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->ndi=1; + ((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->rv=0; + ((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->mcs=0; + ((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->harq_pid=0; + ((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->TPC=1; + ((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->padding=0; + ((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->rballoc = mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL,first_rb,4); + rballoc[CC_id] |= mac_xface->get_rballoc(((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->vrb_type, + ((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->rballoc); + break; + + case 25: + ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->type=1; + ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->vrb_type=0; + ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->ndi=1; + ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->rv=0; + ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->mcs=0; + ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->harq_pid=0; + ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->TPC=1; + ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->padding=0; + ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->rballoc = mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL,first_rb,4); + rballoc[CC_id] |= mac_xface->get_rballoc(((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->vrb_type, + ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->rballoc); + break; + + case 50: + ((DCI1A_10MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->type=1; + ((DCI1A_10MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->vrb_type=0; + ((DCI1A_10MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->ndi=1; + ((DCI1A_10MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->rv=0; + ((DCI1A_10MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->mcs=0; + ((DCI1A_10MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->harq_pid=0; + ((DCI1A_10MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->TPC=1; + ((DCI1A_10MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->padding=0; + ((DCI1A_10MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->rballoc = mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL,first_rb,4); + rballoc[CC_id] |= mac_xface->get_rballoc(((DCI1A_10MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->vrb_type, + ((DCI1A_10MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->rballoc); + break; + + case 100: + ((DCI1A_20MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->type=1; + ((DCI1A_20MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->vrb_type=0; + ((DCI1A_20MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->ndi=1; + ((DCI1A_20MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->rv=0; + ((DCI1A_20MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->mcs=0; + ((DCI1A_20MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->harq_pid=0; + ((DCI1A_20MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->TPC=1; + ((DCI1A_20MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->padding=0; + ((DCI1A_20MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->rballoc = mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL,first_rb,4); + rballoc[CC_id] |= mac_xface->get_rballoc(((DCI1A_20MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->vrb_type, + ((DCI1A_20MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->rballoc); + break; + + default: + ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->type=1; + ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->vrb_type=0; + ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->ndi=1; + ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->rv=0; + ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->mcs=0; + ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->harq_pid=0; + ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->TPC=1; + ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->padding=0; + ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->rballoc = mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL,first_rb,4); + rballoc[CC_id] |= mac_xface->get_rballoc(((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->vrb_type, + ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->rballoc); + break; + } + } else { + switch(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL) { + case 6: + ((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->type=1; + ((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->vrb_type=0; + ((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->ndi=1; + ((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->rv=0; + ((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->mcs=0; + ((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->harq_pid=0; + ((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->TPC=1; + ((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->padding=0; + ((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->rballoc = mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL,first_rb,4); + rballoc[CC_id] |= mac_xface->get_rballoc(((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->vrb_type, + ((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->rballoc); + break; + + case 25: + ((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->type=1; + ((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->vrb_type=0; + ((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->ndi=1; + ((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->rv=0; + ((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->mcs=0; + ((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->harq_pid=0; + ((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->TPC=1; + ((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->padding=0; + ((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->rballoc = mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_UL,first_rb,4); + rballoc[CC_id] |= mac_xface->get_rballoc(((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->vrb_type, + ((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->rballoc); + break; + + case 50: + ((DCI1A_10MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->type=1; + ((DCI1A_10MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->vrb_type=0; + ((DCI1A_10MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->ndi=1; + ((DCI1A_10MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->rv=0; + ((DCI1A_10MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->mcs=0; + ((DCI1A_10MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->harq_pid=0; + ((DCI1A_10MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->TPC=1; + ((DCI1A_10MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->padding=0; + ((DCI1A_10MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->rballoc = mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL,first_rb,4); + rballoc[CC_id] |= mac_xface->get_rballoc(((DCI1A_10MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->vrb_type, + ((DCI1A_10MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->rballoc); + break; + + case 100: + ((DCI1A_20MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->type=1; + ((DCI1A_20MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->vrb_type=0; + ((DCI1A_20MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->ndi=1; + ((DCI1A_20MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->rv=0; + ((DCI1A_20MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->mcs=0; + ((DCI1A_20MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->harq_pid=0; + ((DCI1A_20MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->TPC=1; + ((DCI1A_20MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->padding=0; + ((DCI1A_20MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->rballoc = mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL,first_rb,4); + rballoc[CC_id] |= mac_xface->get_rballoc(((DCI1A_20MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->vrb_type, + ((DCI1A_20MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->rballoc); + break; + + default: + break; + } + } - if (RA_template[i].generate_rar == 1) { - nprb[CC_id]= nprb[CC_id] + 3; - nCCE[CC_id] = nCCE[CC_id] + 4; - RA_template[i].Msg3_subframe=Msg3_subframe; - } else if (RA_template[i].generate_Msg4 == 1) { + if (!CCE_allocation_infeasible(module_idP,CC_id,1,subframeP,2,RA_template->RA_rnti)) { + add_common_dci(DCI_pdu, + (void*)&RA_template->RA_alloc_pdu1[0], + RA_template->RA_rnti, + RA_template->RA_dci_size_bytes1, + 2, + RA_template->RA_dci_size_bits1, + RA_template->RA_dci_fmt1, + 1); + + RA_template->Msg3_subframe=Msg3_subframe; + } + } else if (RA_template->generate_Msg4 == 1) { // check for Msg4 Message - UE_id = find_UE_id(module_idP,RA_template[i].rnti); + UE_id = find_UE_id(module_idP,RA_template->rnti); if (Is_rrc_registered == 1) { @@ -131,7 +293,7 @@ void schedule_RA(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP,un if (rrc_sdu_length>0) { LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, subframeP %d: Generating Msg4 with RRC Piggyback (RA proc %d, RNTI %x)\n", - module_idP, CC_id, frameP, subframeP,i,RA_template[i].rnti); + module_idP, CC_id, frameP, subframeP,i,RA_template->rnti); //msg("[MAC][eNB %d][RAPROC] Frame %d, subframeP %d: Received %d bytes for Msg4: \n",module_idP,frameP,subframeP,rrc_sdu_length); // for (j=0;j<rrc_sdu_length;j++) @@ -140,6 +302,21 @@ void schedule_RA(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP,un // msg("[MAC][eNB] Frame %d, subframeP %d: Generated DLSCH (Msg4) DCI, format 1A, for UE %d\n",frameP, subframeP,UE_id); // Schedule Reflection of Connection request + /* + // randomize frequency allocation for RA + while (1) { + first_rb = (unsigned char)(taus()%(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL-4)); + + if ((vrb_map[first_rb] != 1) && (vrb_map[first_rb+3] != 1)) + break; + } + */ + first_rb=0; + + vrb_map[first_rb] = 1; + vrb_map[first_rb+1] = 1; + vrb_map[first_rb+2] = 1; + vrb_map[first_rb+3] = 1; // Compute MCS for 3 PRB @@ -149,273 +326,406 @@ void schedule_RA(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP,un switch (mac_xface->lte_frame_parms->N_RB_DL) { case 6: - ((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template[i].RA_alloc_pdu2[0])->ndi=1; + ((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->ndi=1; if ((rrc_sdu_length+msg4_header) <= 22) { - ((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template[i].RA_alloc_pdu2[0])->mcs=4; + ((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->mcs=4; TBsize = 22; } else if ((rrc_sdu_length+msg4_header) <= 28) { - ((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template[i].RA_alloc_pdu2[0])->mcs=5; + ((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->mcs=5; TBsize = 28; } else if ((rrc_sdu_length+msg4_header) <= 32) { - ((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template[i].RA_alloc_pdu2[0])->mcs=6; + ((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->mcs=6; TBsize = 32; } else if ((rrc_sdu_length+msg4_header) <= 41) { - ((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template[i].RA_alloc_pdu2[0])->mcs=7; + ((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->mcs=7; TBsize = 41; } else if ((rrc_sdu_length+msg4_header) <= 49) { - ((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template[i].RA_alloc_pdu2[0])->mcs=8; + ((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->mcs=8; TBsize = 49; } else if ((rrc_sdu_length+msg4_header) <= 57) { - ((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template[i].RA_alloc_pdu2[0])->mcs=9; + ((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->mcs=9; TBsize = 57; } - + ((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->type=1; + ((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->vrb_type=0; + ((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->rv=0; + ((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->harq_pid=0; + ((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->TPC=1; + ((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->padding=0; + ((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->rballoc= mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL,first_rb,4); + rballoc[CC_id] |= mac_xface->get_rballoc(((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->vrb_type, + ((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->rballoc); + break; case 25: - ((DCI1A_5MHz_TDD_1_6_t*)&RA_template[i].RA_alloc_pdu2[0])->ndi=1; + ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->ndi=1; if ((rrc_sdu_length+msg4_header) <= 22) { - ((DCI1A_5MHz_TDD_1_6_t*)&RA_template[i].RA_alloc_pdu2[0])->mcs=4; + ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->mcs=4; TBsize = 22; } else if ((rrc_sdu_length+msg4_header) <= 28) { - ((DCI1A_5MHz_TDD_1_6_t*)&RA_template[i].RA_alloc_pdu2[0])->mcs=5; + ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->mcs=5; TBsize = 28; } else if ((rrc_sdu_length+msg4_header) <= 32) { - ((DCI1A_5MHz_TDD_1_6_t*)&RA_template[i].RA_alloc_pdu2[0])->mcs=6; + ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->mcs=6; TBsize = 32; } else if ((rrc_sdu_length+msg4_header) <= 41) { - ((DCI1A_5MHz_TDD_1_6_t*)&RA_template[i].RA_alloc_pdu2[0])->mcs=7; + ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->mcs=7; TBsize = 41; } else if ((rrc_sdu_length+msg4_header) <= 49) { - ((DCI1A_5MHz_TDD_1_6_t*)&RA_template[i].RA_alloc_pdu2[0])->mcs=8; + ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->mcs=8; TBsize = 49; } else if ((rrc_sdu_length+msg4_header) <= 57) { - ((DCI1A_5MHz_TDD_1_6_t*)&RA_template[i].RA_alloc_pdu2[0])->mcs=9; + ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->mcs=9; TBsize = 57; } - + + ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->type=1; + ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->vrb_type=0; + ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->rv=0; + ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->harq_pid=0; + ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->TPC=1; + ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->padding=0; + ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->rballoc= mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL,first_rb,4); + rballoc[CC_id] |= mac_xface->get_rballoc(((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->vrb_type, + ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->rballoc); break; case 50: - ((DCI1A_10MHz_TDD_1_6_t*)&RA_template[i].RA_alloc_pdu2[0])->ndi=1; + ((DCI1A_10MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->ndi=1; if ((rrc_sdu_length+msg4_header) <= 22) { - ((DCI1A_10MHz_TDD_1_6_t*)&RA_template[i].RA_alloc_pdu2[0])->mcs=4; + ((DCI1A_10MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->mcs=4; TBsize = 22; } else if ((rrc_sdu_length+msg4_header) <= 28) { - ((DCI1A_10MHz_TDD_1_6_t*)&RA_template[i].RA_alloc_pdu2[0])->mcs=5; + ((DCI1A_10MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->mcs=5; TBsize = 28; } else if ((rrc_sdu_length+msg4_header) <= 32) { - ((DCI1A_10MHz_TDD_1_6_t*)&RA_template[i].RA_alloc_pdu2[0])->mcs=6; + ((DCI1A_10MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->mcs=6; TBsize = 32; } else if ((rrc_sdu_length+msg4_header) <= 41) { - ((DCI1A_10MHz_TDD_1_6_t*)&RA_template[i].RA_alloc_pdu2[0])->mcs=7; + ((DCI1A_10MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->mcs=7; TBsize = 41; } else if ((rrc_sdu_length+msg4_header) <= 49) { - ((DCI1A_10MHz_TDD_1_6_t*)&RA_template[i].RA_alloc_pdu2[0])->mcs=8; + ((DCI1A_10MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->mcs=8; TBsize = 49; } else if ((rrc_sdu_length+msg4_header) <= 57) { - ((DCI1A_10MHz_TDD_1_6_t*)&RA_template[i].RA_alloc_pdu2[0])->mcs=9; + ((DCI1A_10MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->mcs=9; TBsize = 57; } + ((DCI1A_10MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->type=1; + ((DCI1A_10MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->vrb_type=0; + ((DCI1A_10MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->rv=0; + ((DCI1A_10MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->harq_pid=0; + ((DCI1A_10MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->TPC=1; + ((DCI1A_10MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->padding=0; + ((DCI1A_10MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->rballoc= mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL,first_rb,4); + rballoc[CC_id] |= mac_xface->get_rballoc(((DCI1A_10MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->vrb_type, + ((DCI1A_10MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->rballoc); break; case 100: - ((DCI1A_20MHz_TDD_1_6_t*)&RA_template[i].RA_alloc_pdu2[0])->ndi=1; + ((DCI1A_20MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->ndi=1; if ((rrc_sdu_length+msg4_header) <= 22) { - ((DCI1A_20MHz_TDD_1_6_t*)&RA_template[i].RA_alloc_pdu2[0])->mcs=4; + ((DCI1A_20MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->mcs=4; TBsize = 22; } else if ((rrc_sdu_length+msg4_header) <= 28) { - ((DCI1A_20MHz_TDD_1_6_t*)&RA_template[i].RA_alloc_pdu2[0])->mcs=5; + ((DCI1A_20MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->mcs=5; TBsize = 28; } else if ((rrc_sdu_length+msg4_header) <= 32) { - ((DCI1A_20MHz_TDD_1_6_t*)&RA_template[i].RA_alloc_pdu2[0])->mcs=6; + ((DCI1A_20MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->mcs=6; TBsize = 32; } else if ((rrc_sdu_length+msg4_header) <= 41) { - ((DCI1A_20MHz_TDD_1_6_t*)&RA_template[i].RA_alloc_pdu2[0])->mcs=7; + ((DCI1A_20MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->mcs=7; TBsize = 41; } else if ((rrc_sdu_length+msg4_header) <= 49) { - ((DCI1A_20MHz_TDD_1_6_t*)&RA_template[i].RA_alloc_pdu2[0])->mcs=8; + ((DCI1A_20MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->mcs=8; TBsize = 49; } else if ((rrc_sdu_length+msg4_header) <= 57) { - ((DCI1A_20MHz_TDD_1_6_t*)&RA_template[i].RA_alloc_pdu2[0])->mcs=9; + ((DCI1A_20MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->mcs=9; TBsize = 57; } + ((DCI1A_20MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->type=1; + ((DCI1A_20MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->vrb_type=0; + ((DCI1A_20MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->rv=0; + ((DCI1A_20MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->harq_pid=0; + ((DCI1A_20MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->TPC=1; + ((DCI1A_20MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->rballoc= mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL,first_rb,4); + rballoc[CC_id] |= mac_xface->get_rballoc(((DCI1A_20MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->vrb_type, + ((DCI1A_20MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->rballoc); break; } } else { // FDD DCI switch (mac_xface->lte_frame_parms->N_RB_DL) { case 6: - ((DCI1A_1_5MHz_FDD_t*)&RA_template[i].RA_alloc_pdu2[0])->ndi=1; + ((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->ndi=1; if ((rrc_sdu_length+msg4_header) <= 22) { - ((DCI1A_1_5MHz_FDD_t*)&RA_template[i].RA_alloc_pdu2[0])->mcs=4; + ((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->mcs=4; TBsize = 22; } else if ((rrc_sdu_length+msg4_header) <= 28) { - ((DCI1A_1_5MHz_FDD_t*)&RA_template[i].RA_alloc_pdu2[0])->mcs=5; + ((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->mcs=5; TBsize = 28; } else if ((rrc_sdu_length+msg4_header) <= 32) { - ((DCI1A_1_5MHz_FDD_t*)&RA_template[i].RA_alloc_pdu2[0])->mcs=6; + ((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->mcs=6; TBsize = 32; } else if ((rrc_sdu_length+msg4_header) <= 41) { - ((DCI1A_1_5MHz_FDD_t*)&RA_template[i].RA_alloc_pdu2[0])->mcs=7; + ((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->mcs=7; TBsize = 41; } else if ((rrc_sdu_length+msg4_header) <= 49) { - ((DCI1A_1_5MHz_FDD_t*)&RA_template[i].RA_alloc_pdu2[0])->mcs=8; + ((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->mcs=8; TBsize = 49; } else if ((rrc_sdu_length+msg4_header) <= 57) { - ((DCI1A_1_5MHz_FDD_t*)&RA_template[i].RA_alloc_pdu2[0])->mcs=9; + ((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->mcs=9; TBsize = 57; } + ((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->type=1; + ((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->vrb_type=0; + ((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->rv=0; + ((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->harq_pid=0; + ((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->TPC=1; + ((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->padding=0; + ((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->rballoc= mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL,first_rb,4); + rballoc[CC_id] |= mac_xface->get_rballoc(((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->vrb_type, + ((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->rballoc); break; case 25: - ((DCI1A_5MHz_FDD_t*)&RA_template[i].RA_alloc_pdu2[0])->ndi=1; + ((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->ndi=1; if ((rrc_sdu_length+msg4_header) <= 22) { - ((DCI1A_5MHz_FDD_t*)&RA_template[i].RA_alloc_pdu2[0])->mcs=4; + ((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->mcs=4; TBsize = 22; } else if ((rrc_sdu_length+msg4_header) <= 28) { - ((DCI1A_5MHz_FDD_t*)&RA_template[i].RA_alloc_pdu2[0])->mcs=5; + ((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->mcs=5; TBsize = 28; } else if ((rrc_sdu_length+msg4_header) <= 32) { - ((DCI1A_5MHz_FDD_t*)&RA_template[i].RA_alloc_pdu2[0])->mcs=6; + ((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->mcs=6; TBsize = 32; } else if ((rrc_sdu_length+msg4_header) <= 41) { - ((DCI1A_5MHz_FDD_t*)&RA_template[i].RA_alloc_pdu2[0])->mcs=7; + ((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->mcs=7; TBsize = 41; } else if ((rrc_sdu_length+msg4_header) <= 49) { - ((DCI1A_5MHz_FDD_t*)&RA_template[i].RA_alloc_pdu2[0])->mcs=8; + ((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->mcs=8; TBsize = 49; } else if ((rrc_sdu_length+msg4_header) <= 57) { - ((DCI1A_5MHz_FDD_t*)&RA_template[i].RA_alloc_pdu2[0])->mcs=9; + ((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->mcs=9; TBsize = 57; } + ((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->type=1; + ((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->vrb_type=0; + ((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->rv=0; + ((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->harq_pid=0; + ((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->TPC=1; + ((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->padding=0; + ((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->rballoc= mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL,first_rb,4); + rballoc[CC_id] |= mac_xface->get_rballoc(((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->vrb_type, + ((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->rballoc); break; case 50: - ((DCI1A_10MHz_FDD_t*)&RA_template[i].RA_alloc_pdu2[0])->ndi=1; + ((DCI1A_10MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->ndi=1; if ((rrc_sdu_length+msg4_header) <= 22) { - ((DCI1A_10MHz_FDD_t*)&RA_template[i].RA_alloc_pdu2[0])->mcs=4; + ((DCI1A_10MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->mcs=4; TBsize = 22; } else if ((rrc_sdu_length+msg4_header) <= 28) { - ((DCI1A_10MHz_FDD_t*)&RA_template[i].RA_alloc_pdu2[0])->mcs=5; + ((DCI1A_10MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->mcs=5; TBsize = 28; } else if ((rrc_sdu_length+msg4_header) <= 32) { - ((DCI1A_10MHz_FDD_t*)&RA_template[i].RA_alloc_pdu2[0])->mcs=6; + ((DCI1A_10MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->mcs=6; TBsize = 32; } else if ((rrc_sdu_length+msg4_header) <= 41) { - ((DCI1A_10MHz_FDD_t*)&RA_template[i].RA_alloc_pdu2[0])->mcs=7; + ((DCI1A_10MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->mcs=7; TBsize = 41; } else if ((rrc_sdu_length+msg4_header) <= 49) { - ((DCI1A_10MHz_FDD_t*)&RA_template[i].RA_alloc_pdu2[0])->mcs=8; + ((DCI1A_10MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->mcs=8; TBsize = 49; } else if ((rrc_sdu_length+msg4_header) <= 57) { - ((DCI1A_10MHz_FDD_t*)&RA_template[i].RA_alloc_pdu2[0])->mcs=9; + ((DCI1A_10MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->mcs=9; TBsize = 57; } + ((DCI1A_10MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->type=1; + ((DCI1A_10MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->vrb_type=0; + ((DCI1A_10MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->rv=0; + ((DCI1A_10MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->harq_pid=0; + ((DCI1A_10MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->TPC=1; + ((DCI1A_10MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->padding=0; + ((DCI1A_10MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->rballoc= mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL,first_rb,4); + rballoc[CC_id] |= mac_xface->get_rballoc(((DCI1A_10MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->vrb_type, + ((DCI1A_10MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->rballoc); break; case 100: - ((DCI1A_20MHz_FDD_t*)&RA_template[i].RA_alloc_pdu2[0])->ndi=1; + ((DCI1A_20MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->ndi=1; if ((rrc_sdu_length+msg4_header) <= 22) { - ((DCI1A_20MHz_FDD_t*)&RA_template[i].RA_alloc_pdu2[0])->mcs=4; + ((DCI1A_20MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->mcs=4; TBsize = 22; } else if ((rrc_sdu_length+msg4_header) <= 28) { - ((DCI1A_20MHz_FDD_t*)&RA_template[i].RA_alloc_pdu2[0])->mcs=5; + ((DCI1A_20MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->mcs=5; TBsize = 28; } else if ((rrc_sdu_length+msg4_header) <= 32) { - ((DCI1A_20MHz_FDD_t*)&RA_template[i].RA_alloc_pdu2[0])->mcs=6; + ((DCI1A_20MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->mcs=6; TBsize = 32; } else if ((rrc_sdu_length+msg4_header) <= 41) { - ((DCI1A_20MHz_FDD_t*)&RA_template[i].RA_alloc_pdu2[0])->mcs=7; + ((DCI1A_20MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->mcs=7; TBsize = 41; } else if ((rrc_sdu_length+msg4_header) <= 49) { - ((DCI1A_20MHz_FDD_t*)&RA_template[i].RA_alloc_pdu2[0])->mcs=8; + ((DCI1A_20MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->mcs=8; TBsize = 49; } else if ((rrc_sdu_length+msg4_header) <= 57) { - ((DCI1A_20MHz_FDD_t*)&RA_template[i].RA_alloc_pdu2[0])->mcs=9; + ((DCI1A_20MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->mcs=9; TBsize = 57; } - + ((DCI1A_20MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->type=1; + ((DCI1A_20MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->vrb_type=0; + ((DCI1A_20MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->rv=0; + ((DCI1A_20MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->harq_pid=0; + ((DCI1A_20MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->TPC=1; + ((DCI1A_20MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->padding=0; + ((DCI1A_20MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->rballoc= mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL,first_rb,4); + rballoc[CC_id] |= mac_xface->get_rballoc(((DCI1A_20MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->vrb_type, + ((DCI1A_20MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->rballoc); break; } } - RA_template[i].generate_Msg4=0; - RA_template[i].generate_Msg4_dci=1; - RA_template[i].wait_ack_Msg4=1; - RA_template[i].RA_active = FALSE; - lcid=0; - - if ((TBsize - rrc_sdu_length - msg4_header) <= 2) { - msg4_padding = TBsize - rrc_sdu_length - msg4_header; - msg4_post_padding = 0; - } else { - msg4_padding = 0; - msg4_post_padding = TBsize - rrc_sdu_length - msg4_header -1; - } - - LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d subframeP %d Msg4 : TBS %d, sdu_len %d, msg4_header %d, msg4_padding %d, msg4_post_padding %d\n", - module_idP,CC_id,frameP,subframeP,TBsize,rrc_sdu_length,msg4_header,msg4_padding,msg4_post_padding); - DevAssert( UE_id != UE_INDEX_INVALID ); // FIXME not sure how to gracefully return - offset = generate_dlsch_header((unsigned char*)eNB->UE_list.DLSCH_pdu[CC_id][0][(unsigned char)UE_id].payload[0], - 1, //num_sdus - (unsigned short*)&rrc_sdu_length, // - &lcid, // sdu_lcid - 255, // no drx - 0, // no timing advance - RA_template[i].cont_res_id, // contention res id - msg4_padding, // no padding - msg4_post_padding); - - memcpy((void*)&eNB->UE_list.DLSCH_pdu[CC_id][0][(unsigned char)UE_id].payload[0][(unsigned char)offset], - &eNB->common_channels[CC_id].CCCH_pdu.payload[0], - rrc_sdu_length); - - if (opt_enabled==1) { - trace_pdu(1, (uint8_t *)eNB->UE_list.DLSCH_pdu[CC_id][0][(unsigned char)UE_id].payload[0], - rrc_sdu_length, UE_id, 3, UE_RNTI(module_idP, UE_id), - eNB->subframe,0,0); - LOG_D(OPT,"[eNB %d][DLSCH] CC_id %d Frame %d trace pdu for rnti %x with size %d\n", - module_idP, CC_id, frameP, UE_RNTI(module_idP,UE_id), rrc_sdu_length); - } - - nprb[CC_id]= nprb[CC_id] + 3; - nCCE[CC_id] = nCCE[CC_id] + 4; - } + if (!CCE_allocation_infeasible(module_idP,CC_id,0,subframeP,2,RA_template->rnti)) { + add_ue_spec_dci(DCI_pdu, + (void*)&RA_template->RA_alloc_pdu2[0], + RA_template->rnti, + RA_template->RA_dci_size_bytes2, + 2, + RA_template->RA_dci_size_bits2, + RA_template->RA_dci_fmt2, + 0); + + RA_template->generate_Msg4=0; + RA_template->wait_ack_Msg4=1; + RA_template->RA_active = FALSE; + lcid=0; + + if ((TBsize - rrc_sdu_length - msg4_header) <= 2) { + msg4_padding = TBsize - rrc_sdu_length - msg4_header; + msg4_post_padding = 0; + } else { + msg4_padding = 0; + msg4_post_padding = TBsize - rrc_sdu_length - msg4_header -1; + } + + LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d subframeP %d Msg4 : TBS %d, sdu_len %d, msg4_header %d, msg4_padding %d, msg4_post_padding %d\n", + module_idP,CC_id,frameP,subframeP,TBsize,rrc_sdu_length,msg4_header,msg4_padding,msg4_post_padding); + DevAssert( UE_id != UE_INDEX_INVALID ); // FIXME not sure how to gracefully return + offset = generate_dlsch_header((unsigned char*)eNB->UE_list.DLSCH_pdu[CC_id][0][(unsigned char)UE_id].payload[0], + 1, //num_sdus + (unsigned short*)&rrc_sdu_length, // + &lcid, // sdu_lcid + 255, // no drx + 0, // no timing advance + RA_template->cont_res_id, // contention res id + msg4_padding, // no padding + msg4_post_padding); + + memcpy((void*)&eNB->UE_list.DLSCH_pdu[CC_id][0][(unsigned char)UE_id].payload[0][(unsigned char)offset], + &eNB->common_channels[CC_id].CCCH_pdu.payload[0], + rrc_sdu_length); + + if (opt_enabled==1) { + trace_pdu(1, (uint8_t *)eNB->UE_list.DLSCH_pdu[CC_id][0][(unsigned char)UE_id].payload[0], + rrc_sdu_length, UE_id, 3, UE_RNTI(module_idP, UE_id), + eNB->subframe,0,0); + LOG_D(OPT,"[eNB %d][DLSCH] CC_id %d Frame %d trace pdu for rnti %x with size %d\n", + module_idP, CC_id, frameP, UE_RNTI(module_idP,UE_id), rrc_sdu_length); + } + + } + } //try here } - /* - else if (eNB_mac_inst[module_idP][CC_id].RA_template[i].wait_ack_Msg4==1) { - // check HARQ status and retransmit if necessary - LOG_I(MAC,"[eNB %d][RAPROC] Frame %d, subframeP %d: Checking if Msg4 was acknowledged :\n",module_idP,frameP,subframeP); - // Get candidate harq_pid from PHY - mac_xface->get_ue_active_harq_pid(module_idP,eNB_mac_inst[module_idP][CC_id].RA_template[i].rnti,subframeP,&harq_pid,&round,0); - if (round>0) { - *nprb= (*nprb) + 3; - *nCCE = (*nCCE) + 4; - } - } - */ + } else if (RA_template->wait_ack_Msg4==1) { + // check HARQ status and retransmit if necessary + LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, subframeP %d: Checking if Msg4 was acknowledged: \n", + module_idP,CC_id,frameP,subframeP); + // Get candidate harq_pid from PHY + mac_xface->get_ue_active_harq_pid(module_idP,CC_id,RA_template->rnti,frameP,subframeP,&harq_pid,&round,0); + + if (round>0) { + //RA_template->wait_ack_Msg4++; + // we have to schedule a retransmission + if (PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.frame_type == TDD) { + ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->ndi=1; + } else { + ((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->ndi=1; + } + + /* + // randomize frequency allocation for RA + while (1) { + first_rb = (unsigned char)(taus()%(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL-4)); + + if ((vrb_map[first_rb] != 1) && (vrb_map[first_rb+3] != 1)) + break; + } + */ + first_rb=0; + vrb_map[first_rb] = 1; + vrb_map[first_rb+1] = 1; + vrb_map[first_rb+2] = 1; + vrb_map[first_rb+3] = 1; + + if (PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.frame_type == TDD) { + ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->rballoc = mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_UL,first_rb,4); + rballoc[CC_id] |= mac_xface->get_rballoc(((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->vrb_type, + ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->rballoc); + } else { + ((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->rballoc = mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_UL,first_rb,4); + rballoc[CC_id] |= mac_xface->get_rballoc(((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->vrb_type, + ((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->rballoc); + } + + if (!CCE_allocation_infeasible(module_idP,CC_id,0,subframeP,2,RA_template->rnti)) { + add_ue_spec_dci(DCI_pdu, + (void*)&RA_template->RA_alloc_pdu2[0], + RA_template->rnti, + RA_template->RA_dci_size_bytes2, + 2, + RA_template->RA_dci_size_bits2, + RA_template->RA_dci_fmt2, + 0); + } + LOG_W(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, subframeP %d: Msg4 not acknowledged, adding ue specific dci (rnti %x) for RA (Msg4 Retransmission)\n", + module_idP,CC_id,frameP,subframeP,RA_template->rnti); + } else { + /* msg4 not received + if ((round == 0) && (RA_template->wait_ack_Msg4>1){ + remove UE instance across all the layers: mac_xface->cancel_RA(); + } + */ + LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, subframeP %d : Msg4 acknowledged\n",module_idP,CC_id,frameP,subframeP); + RA_template->wait_ack_Msg4=0; + RA_template->RA_active=FALSE; + UE_id = find_UE_id(module_idP,RA_template->rnti); + DevAssert( UE_id != -1 ); + eNB_mac_inst[module_idP].UE_list.UE_template[UE_PCCID(module_idP,UE_id)][UE_id].configured=TRUE; + + } } - } - } + } // for i=0 .. N_RA_PROC-1 + } // CC_id stop_meas(&eNB->schedule_ra); } diff --git a/openair2/LAYER2/MAC/eNB_scheduler_bch.c b/openair2/LAYER2/MAC/eNB_scheduler_bch.c index dd0890783e2116fd09dc9f8b97d9d552028fbf2e..65240356a75cab7ed709554b1c3160b8c18f12a8 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_bch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_bch.c @@ -72,9 +72,8 @@ void schedule_SI( module_id_t module_idP, frame_t frameP, - unsigned int* nprbP, - unsigned int* nCCEP -) + sub_frame_t subframeP) + //------------------------------------------------------------------------------ { @@ -85,12 +84,19 @@ schedule_SI( void *BCCH_alloc_pdu; int CC_id; eNB_MAC_INST *eNB = &eNB_mac_inst[module_idP]; + uint8_t *vrb_map; + int first_rb; + int rballoc[MAX_NUM_CCs]; + int sizeof1A_bytes,sizeof1A_bits; + DCI_PDU *DCI_pdu; start_meas(&eNB->schedule_si); for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) { - - BCCH_alloc_pdu=(void*)&eNB->common_channels[CC_id].BCCH_alloc_pdu; + + BCCH_alloc_pdu = (void*)&eNB->common_channels[CC_id].BCCH_alloc_pdu; + DCI_pdu = (void*)&eNB->common_channels[CC_id].DCI_pdu; + vrb_map = (void*)&eNB->common_channels[CC_id].vrb_map; bcch_sdu_length = mac_rrc_data_req(module_idP, CC_id, @@ -104,7 +110,41 @@ schedule_SI( if (bcch_sdu_length > 0) { LOG_D(MAC,"[eNB %d] Frame %d : BCCH->DLSCH CC_id %d, Received %d bytes \n",module_idP,frameP,CC_id,bcch_sdu_length); + // Allocate 4 PRBs in a random location + /* + while (1) { + first_rb = (unsigned char)(taus()%(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL-4)); + if ((vrb_map[first_rb] != 1) && + (vrb_map[first_rb+1] != 1) && + (vrb_map[first_rb+2] != 1) && + (vrb_map[first_rb+3] != 1)) + break; + } + */ + switch (PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL) { + case 6: + first_rb = 0; + break; + case 15: + first_rb = 6; + break; + case 25: + first_rb = 11; + break; + case 50: + first_rb = 23; + break; + case 100: + first_rb = 48; + break; + } + + vrb_map[first_rb] = 1; + vrb_map[first_rb+1] = 1; + vrb_map[first_rb+2] = 1; + vrb_map[first_rb+3] = 1; + // Get MCS for length of SI if (bcch_sdu_length <= (mac_xface->get_TBS_DL(0,3))) { mcs=0; } else if (bcch_sdu_length <= (mac_xface->get_TBS_DL(1,3))) { @@ -125,46 +165,153 @@ schedule_SI( mcs=8; } + + if (PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.frame_type == TDD) { switch (PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL) { case 6: ((DCI1A_1_5MHz_TDD_1_6_t*)BCCH_alloc_pdu)->mcs = mcs; + ((DCI1A_1_5MHz_TDD_1_6_t*)BCCH_alloc_pdu)->rballoc = mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL,first_rb,4); + ((DCI1A_1_5MHz_TDD_1_6_t*)BCCH_alloc_pdu)->type = 1; + ((DCI1A_1_5MHz_TDD_1_6_t*)BCCH_alloc_pdu)->vrb_type = 0; + ((DCI1A_1_5MHz_TDD_1_6_t*)BCCH_alloc_pdu)->ndi = 1; + ((DCI1A_1_5MHz_TDD_1_6_t*)BCCH_alloc_pdu)->rv = 1; + ((DCI1A_1_5MHz_TDD_1_6_t*)BCCH_alloc_pdu)->harq_pid = 0; + ((DCI1A_1_5MHz_TDD_1_6_t*)BCCH_alloc_pdu)->TPC = 1; + ((DCI1A_1_5MHz_TDD_1_6_t*)BCCH_alloc_pdu)->padding = 0; + rballoc[CC_id] |= mac_xface->get_rballoc(0,((DCI1A_1_5MHz_TDD_1_6_t*)BCCH_alloc_pdu)->rballoc); + sizeof1A_bytes = sizeof(DCI1A_1_5MHz_TDD_1_6_t); + sizeof1A_bits = sizeof_DCI1A_1_5MHz_TDD_1_6_t; break; case 25: ((DCI1A_5MHz_TDD_1_6_t*)BCCH_alloc_pdu)->mcs = mcs; - break; + ((DCI1A_5MHz_TDD_1_6_t*)BCCH_alloc_pdu)->rballoc = mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL,first_rb,4); + ((DCI1A_5MHz_TDD_1_6_t*)BCCH_alloc_pdu)->type = 1; + ((DCI1A_5MHz_TDD_1_6_t*)BCCH_alloc_pdu)->vrb_type = 0; + ((DCI1A_5MHz_TDD_1_6_t*)BCCH_alloc_pdu)->ndi = 1; + ((DCI1A_5MHz_TDD_1_6_t*)BCCH_alloc_pdu)->rv = 1; + ((DCI1A_5MHz_TDD_1_6_t*)BCCH_alloc_pdu)->harq_pid = 0; + ((DCI1A_5MHz_TDD_1_6_t*)BCCH_alloc_pdu)->TPC = 1; + ((DCI1A_5MHz_TDD_1_6_t*)BCCH_alloc_pdu)->padding = 0; + rballoc[CC_id] |= mac_xface->get_rballoc(0,((DCI1A_5MHz_TDD_1_6_t*)BCCH_alloc_pdu)->rballoc); + sizeof1A_bytes = sizeof(DCI1A_5MHz_TDD_1_6_t); + sizeof1A_bits = sizeof_DCI1A_5MHz_TDD_1_6_t; + break; case 50: ((DCI1A_10MHz_TDD_1_6_t*)BCCH_alloc_pdu)->mcs = mcs; + ((DCI1A_10MHz_TDD_1_6_t*)BCCH_alloc_pdu)->rballoc = mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL,first_rb,4); + ((DCI1A_10MHz_TDD_1_6_t*)BCCH_alloc_pdu)->type = 1; + ((DCI1A_10MHz_TDD_1_6_t*)BCCH_alloc_pdu)->vrb_type = 0; + ((DCI1A_10MHz_TDD_1_6_t*)BCCH_alloc_pdu)->ndi = 1; + ((DCI1A_10MHz_TDD_1_6_t*)BCCH_alloc_pdu)->rv = 1; + ((DCI1A_10MHz_TDD_1_6_t*)BCCH_alloc_pdu)->harq_pid = 0; + ((DCI1A_10MHz_TDD_1_6_t*)BCCH_alloc_pdu)->TPC = 1; + ((DCI1A_10MHz_TDD_1_6_t*)BCCH_alloc_pdu)->padding = 0; + rballoc[CC_id] |= mac_xface->get_rballoc(0,((DCI1A_10MHz_TDD_1_6_t*)BCCH_alloc_pdu)->rballoc); + sizeof1A_bytes = sizeof(DCI1A_10MHz_TDD_1_6_t); + sizeof1A_bits = sizeof_DCI1A_10MHz_TDD_1_6_t; break; case 100: ((DCI1A_20MHz_TDD_1_6_t*)BCCH_alloc_pdu)->mcs = mcs; - break; + ((DCI1A_20MHz_TDD_1_6_t*)BCCH_alloc_pdu)->rballoc = mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL,first_rb,4); + ((DCI1A_20MHz_TDD_1_6_t*)BCCH_alloc_pdu)->type = 1; + ((DCI1A_20MHz_TDD_1_6_t*)BCCH_alloc_pdu)->vrb_type = 0; + ((DCI1A_20MHz_TDD_1_6_t*)BCCH_alloc_pdu)->ndi = 1; + ((DCI1A_20MHz_TDD_1_6_t*)BCCH_alloc_pdu)->rv = 1; + ((DCI1A_20MHz_TDD_1_6_t*)BCCH_alloc_pdu)->harq_pid = 0; + ((DCI1A_20MHz_TDD_1_6_t*)BCCH_alloc_pdu)->TPC = 1; + ((DCI1A_20MHz_TDD_1_6_t*)BCCH_alloc_pdu)->padding = 0; + rballoc[CC_id] |= mac_xface->get_rballoc(0,((DCI1A_20MHz_TDD_1_6_t*)BCCH_alloc_pdu)->rballoc); + sizeof1A_bytes = sizeof(DCI1A_20MHz_TDD_1_6_t); + sizeof1A_bits = sizeof_DCI1A_20MHz_TDD_1_6_t; + break; } } else { switch (PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL) { case 6: ((DCI1A_1_5MHz_FDD_t*)BCCH_alloc_pdu)->mcs = mcs; + ((DCI1A_1_5MHz_FDD_t*)BCCH_alloc_pdu)->rballoc = mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL,first_rb,4); + ((DCI1A_1_5MHz_FDD_t*)BCCH_alloc_pdu)->type = 1; + ((DCI1A_1_5MHz_FDD_t*)BCCH_alloc_pdu)->vrb_type = 0; + ((DCI1A_1_5MHz_FDD_t*)BCCH_alloc_pdu)->ndi = 1; + ((DCI1A_1_5MHz_FDD_t*)BCCH_alloc_pdu)->rv = 1; + ((DCI1A_1_5MHz_FDD_t*)BCCH_alloc_pdu)->harq_pid = 0; + ((DCI1A_1_5MHz_FDD_t*)BCCH_alloc_pdu)->TPC = 1; + ((DCI1A_1_5MHz_FDD_t*)BCCH_alloc_pdu)->padding = 0; + + rballoc[CC_id] |= mac_xface->get_rballoc(0,((DCI1A_1_5MHz_FDD_t*)BCCH_alloc_pdu)->rballoc); + sizeof1A_bytes = sizeof(DCI1A_1_5MHz_FDD_t); + sizeof1A_bits = sizeof_DCI1A_1_5MHz_FDD_t; break; case 25: ((DCI1A_5MHz_FDD_t*)BCCH_alloc_pdu)->mcs = mcs; + ((DCI1A_5MHz_FDD_t*)BCCH_alloc_pdu)->rballoc = mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL,first_rb,4); + ((DCI1A_5MHz_FDD_t*)BCCH_alloc_pdu)->type = 1; + ((DCI1A_5MHz_FDD_t*)BCCH_alloc_pdu)->vrb_type = 0; + ((DCI1A_5MHz_FDD_t*)BCCH_alloc_pdu)->ndi = 1; + ((DCI1A_5MHz_FDD_t*)BCCH_alloc_pdu)->rv = 1; + ((DCI1A_5MHz_FDD_t*)BCCH_alloc_pdu)->harq_pid = 0; + ((DCI1A_5MHz_FDD_t*)BCCH_alloc_pdu)->TPC = 1; + ((DCI1A_5MHz_FDD_t*)BCCH_alloc_pdu)->padding = 0; + + rballoc[CC_id] |= mac_xface->get_rballoc(0,((DCI1A_5MHz_FDD_t*)BCCH_alloc_pdu)->rballoc); + sizeof1A_bytes = sizeof(DCI1A_5MHz_FDD_t); + sizeof1A_bits = sizeof_DCI1A_5MHz_FDD_t; break; case 50: ((DCI1A_10MHz_FDD_t*)BCCH_alloc_pdu)->mcs = mcs; + ((DCI1A_10MHz_FDD_t*)BCCH_alloc_pdu)->rballoc = mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL,first_rb,4); + ((DCI1A_10MHz_FDD_t*)BCCH_alloc_pdu)->type = 1; + ((DCI1A_10MHz_FDD_t*)BCCH_alloc_pdu)->vrb_type = 0; + ((DCI1A_10MHz_FDD_t*)BCCH_alloc_pdu)->ndi = 1; + ((DCI1A_10MHz_FDD_t*)BCCH_alloc_pdu)->rv = 1; + ((DCI1A_10MHz_FDD_t*)BCCH_alloc_pdu)->harq_pid = 0; + ((DCI1A_10MHz_FDD_t*)BCCH_alloc_pdu)->TPC = 1; + ((DCI1A_10MHz_FDD_t*)BCCH_alloc_pdu)->padding = 0; + + rballoc[CC_id] |= mac_xface->get_rballoc(0,((DCI1A_10MHz_FDD_t*)BCCH_alloc_pdu)->rballoc); + sizeof1A_bytes = sizeof(DCI1A_10MHz_FDD_t); + sizeof1A_bits = sizeof_DCI1A_10MHz_FDD_t; break; case 100: ((DCI1A_20MHz_FDD_t*)BCCH_alloc_pdu)->mcs = mcs; - break; + ((DCI1A_20MHz_FDD_t*)BCCH_alloc_pdu)->rballoc = mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL,first_rb,4); + ((DCI1A_20MHz_FDD_t*)BCCH_alloc_pdu)->type = 1; + ((DCI1A_20MHz_FDD_t*)BCCH_alloc_pdu)->vrb_type = 0; + ((DCI1A_20MHz_FDD_t*)BCCH_alloc_pdu)->ndi = 1; + ((DCI1A_20MHz_FDD_t*)BCCH_alloc_pdu)->rv = 1; + ((DCI1A_20MHz_FDD_t*)BCCH_alloc_pdu)->harq_pid = 0; + ((DCI1A_20MHz_FDD_t*)BCCH_alloc_pdu)->TPC = 1; + ((DCI1A_20MHz_FDD_t*)BCCH_alloc_pdu)->padding = 0; + + rballoc[CC_id] |= mac_xface->get_rballoc(0,((DCI1A_20MHz_FDD_t*)BCCH_alloc_pdu)->rballoc); + sizeof1A_bytes = sizeof(DCI1A_20MHz_FDD_t); + sizeof1A_bits = sizeof_DCI1A_20MHz_FDD_t; + break; } } + if (!CCE_allocation_infeasible(module_idP,CC_id,1,subframeP,2,SI_RNTI)) { + add_common_dci(DCI_pdu, + BCCH_alloc_pdu, + SI_RNTI, + sizeof1A_bytes, + 2, + sizeof1A_bits, + format1A,0); + } + else { + LOG_E(MAC,"[eNB %d] CCid %d Frame %d, subframe %d : Cannot add DCI 1A for SI\n",module_idP, CC_id,frameP,subframeP); + } + if (opt_enabled == 1) { trace_pdu(1, &eNB->common_channels[CC_id].BCCH_pdu.payload[0], @@ -194,17 +341,13 @@ schedule_SI( mac_xface->get_TBS_DL(mcs,3)); } - eNB->common_channels[CC_id].bcch_active=1; - nprbP[CC_id]=3; - nCCEP[CC_id]=4; + eNB->eNB_stats[CC_id].total_num_bcch_pdu+=1; eNB->eNB_stats[CC_id].bcch_buffer=bcch_sdu_length; eNB->eNB_stats[CC_id].total_bcch_buffer+=bcch_sdu_length; eNB->eNB_stats[CC_id].bcch_mcs=mcs; } else { - eNB->common_channels[CC_id].bcch_active=0; - nprbP[CC_id]=0; - nCCEP[CC_id]=0; + //LOG_D(MAC,"[eNB %d] Frame %d : BCCH not active \n",Mod_id,frame); } } diff --git a/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c b/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c index 52e0f60d65bdd7a7ede16b57c908cd5159b9a125..2a52d8779a3cdac8f7cce3af4ec258d21f306120 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c @@ -422,16 +422,13 @@ schedule_ue_spec( module_id_t module_idP, frame_t frameP, sub_frame_t subframeP, - unsigned int *nb_rb_used0, - unsigned int *nCCE_used, - int* mbsfn_flag + int* mbsfn_flag ) //------------------------------------------------------------------------------ { uint8_t CC_id; int UE_id; - uint16_t nCCE[MAX_NUM_CCs]; int N_RBG[MAX_NUM_CCs]; unsigned char aggregation; mac_rlc_status_resp_t rlc_status; @@ -450,7 +447,6 @@ schedule_ue_spec( // uint16_t pre_nb_available_rbs[MAX_NUM_CCs][NUMBER_OF_UE_MAX]; int mcs; uint16_t min_rb_unit[MAX_NUM_CCs]; - short ta_update = 0; eNB_MAC_INST *eNB = &eNB_mac_inst[module_idP]; UE_list_t *UE_list = &eNB->UE_list; LTE_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs]; @@ -459,6 +455,7 @@ schedule_ue_spec( int32_t tpc=1; static int32_t tpc_accumulated=0; UE_sched_ctrl *ue_sched_ctl; + int i; if (UE_list->head==-1) { return; @@ -473,15 +470,18 @@ schedule_ue_spec( for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) { min_rb_unit[CC_id]=get_min_rb_unit(module_idP,CC_id); frame_parms[CC_id] = mac_xface->get_lte_frame_parms(module_idP,CC_id); - total_nb_available_rb[CC_id] = frame_parms[CC_id]->N_RB_DL - nb_rb_used0[CC_id]; - nCCE[CC_id] = mac_xface->get_nCCE_max(module_idP,CC_id) - nCCE_used[CC_id]; + // get number of PRBs less those used by common channels + total_nb_available_rb[CC_id] = frame_parms[CC_id]->N_RB_DL; + for (i=0;i<frame_parms[CC_id]->N_RB_DL;i++) + if (eNB->common_channels[CC_id].vrb_map[i]!=0) + total_nb_available_rb[CC_id]--; + N_RBG[CC_id] = frame_parms[CC_id]->N_RBG; // store the global enb stats: eNB->eNB_stats[CC_id].num_dlactive_UEs = UE_list->num_UEs; eNB->eNB_stats[CC_id].available_prbs = total_nb_available_rb[CC_id]; eNB->eNB_stats[CC_id].total_available_prbs += total_nb_available_rb[CC_id]; - eNB->eNB_stats[CC_id].available_ncces = nCCE[CC_id]; eNB->eNB_stats[CC_id].dlsch_bytes_tx=0; eNB->eNB_stats[CC_id].dlsch_pdus_tx=0; } @@ -523,9 +523,11 @@ schedule_ue_spec( continue_flag=1; } - if ((ue_sched_ctl->pre_nb_available_rbs[CC_id] == 0) || (nCCE[CC_id] < (1<<aggregation))) { + if ((ue_sched_ctl->pre_nb_available_rbs[CC_id] == 0) || // no RBs allocated + CCE_allocation_infeasible(module_idP,CC_id,0,subframeP,aggregation,rnti) + ) { LOG_D(MAC,"[eNB %d] Frame %d : no RB allocated for UE %d on CC_id %d: continue \n", - module_idP, frameP, UE_id, CC_id, nb_rb_used0[CC_id], ue_sched_ctl->pre_nb_available_rbs[CC_id], nCCE[CC_id], aggregation); + module_idP, frameP, UE_id, CC_id); //if(mac_xface->get_transmission_mode(module_idP,rnti)==5) continue_flag=1; //to next user (there might be rbs availiable for other UEs in TM5 // else @@ -540,7 +542,6 @@ schedule_ue_spec( UE_list); // update UL DAI after DLSCH scheduling set_ul_DAI(module_idP,UE_id,CC_id,frameP,subframeP,frame_parms); - } if (continue_flag == 1 ) { @@ -587,11 +588,10 @@ schedule_ue_spec( UE_list->UE_template[CC_id][UE_id].rballoc_subband[harq_pid][j] = 0; } - LOG_D(MAC,"[eNB %d] Frame %d: Scheduling UE %d on CC_id %d (rnti %x, harq_pid %d, round %d, rb %d, cqi %d, mcs %d, ncc %d, rrc %d)\n", + LOG_D(MAC,"[eNB %d] Frame %d: Scheduling UE %d on CC_id %d (rnti %x, harq_pid %d, round %d, rb %d, cqi %d, mcs %d, rrc %d)\n", module_idP, frameP, UE_id,CC_id,rnti,harq_pid, round,nb_available_rb, eNB_UE_stats->DL_cqi[0], eNB_UE_stats->dlsch_mcs1, - nCCE[CC_id], - UE_list->eNB_UE_stats[CC_id][UE_id].rrc_status); + UE_list->eNB_UE_stats[CC_id][UE_id].rrc_status); // Note this code is for a specific DCI format @@ -641,8 +641,6 @@ schedule_ue_spec( nb_available_rb -= nb_rb; aggregation = process_ue_cqi(module_idP,UE_id); - nCCE[CC_id]-=(1<<aggregation); // adjust the remaining nCCE - nCCE_used[CC_id] += (1<<aggregation); PHY_vars_eNB_g[module_idP][CC_id]->mu_mimo_mode[UE_id].pre_nb_available_rbs = nb_rb; @@ -789,7 +787,6 @@ schedule_ue_spec( UE_list->eNB_UE_stats[CC_id][UE_id].num_retransmission+=1; UE_list->eNB_UE_stats[CC_id][UE_id].rbs_used_retx=nb_rb; UE_list->eNB_UE_stats[CC_id][UE_id].total_rbs_used_retx+=nb_rb; - UE_list->eNB_UE_stats[CC_id][UE_id].ncce_used_retx=nCCE[CC_id]; UE_list->eNB_UE_stats[CC_id][UE_id].dlsch_mcs1=eNB_UE_stats->dlsch_mcs1; UE_list->eNB_UE_stats[CC_id][UE_id].dlsch_mcs2=eNB_UE_stats->dlsch_mcs1; } else { @@ -806,29 +803,7 @@ schedule_ue_spec( // check first for RLC data on DCCH // add the length for all the control elements (timing adv, drx, etc) : header + payload - //#ifndef EXMIMO_IOT - // to be checked by RK, NN, FK - uint8_t update_TA=4; - - switch (frame_parms[CC_id]->N_RB_DL) { - case 6: - update_TA = 1; - break; - - case 25: - update_TA = 4; - break; - - case 50: - update_TA = 8; - break; - - case 100: - update_TA = 16; - break; - } - - ta_len = ((eNB_UE_stats->timing_advance_update/update_TA)!=0) ? 2 : 0; + ta_len = (ue_sched_ctl->ta_update!=0) ? 2 : 0; header_len_dcch = 2; // 2 bytes DCCH SDU subheader @@ -1076,11 +1051,6 @@ schedule_ue_spec( post_padding = TBS - sdu_length_total - header_len_dcch - header_len_dtch - ta_len ; // 1 is for the postpadding header } - //#ifndef EXMIMO_IOT - ta_update = eNB_UE_stats->timing_advance_update/update_TA; - /*#else - ta_update = 0; - #endif*/ offset = generate_dlsch_header((unsigned char*)UE_list->DLSCH_pdu[CC_id][0][UE_id].payload[0], // offset = generate_dlsch_header((unsigned char*)eNB_mac_inst[0].DLSCH_pdu[0][0].payload[0], @@ -1088,17 +1058,17 @@ schedule_ue_spec( sdu_lengths, // sdu_lcids, 255, // no drx - ta_update, // timing advance + ue_sched_ctl->ta_update, // timing advance NULL, // contention res id padding, post_padding); //#ifdef DEBUG_eNB_SCHEDULER - if (ta_update) { + if (ue_sched_ctl->ta_update) { LOG_I(MAC, "[eNB %d][DLSCH] Frame %d Generate header for UE_id %d on CC_id %d: sdu_length_total %d, num_sdus %d, sdu_lengths[0] %d, sdu_lcids[0] %d => payload offset %d,timing advance value : %d, padding %d,post_padding %d,(mcs %d, TBS %d, nb_rb %d),header_dcch %d, header_dtch %d\n", module_idP,frameP, UE_id, CC_id, sdu_length_total,num_sdus,sdu_lengths[0],sdu_lcids[0],offset, - ta_update,padding,post_padding,mcs,TBS,nb_rb,header_len_dcch,header_len_dtch); + ue_sched_ctl->ta_update,padding,post_padding,mcs,TBS,nb_rb,header_len_dcch,header_len_dtch); } //#endif @@ -1130,8 +1100,6 @@ schedule_ue_spec( } aggregation = process_ue_cqi(module_idP,UE_id); - nCCE[CC_id]-=(1<<aggregation); // adjust the remaining nCCE - nCCE_used[CC_id]+=(1<<aggregation); // adjust the remaining nCCE UE_list->UE_template[CC_id][UE_id].nb_rb[harq_pid] = nb_rb; add_ue_dlsch_info(module_idP, @@ -1145,7 +1113,6 @@ schedule_ue_spec( UE_list->eNB_UE_stats[CC_id][UE_id].rbs_used = nb_rb; UE_list->eNB_UE_stats[CC_id][UE_id].total_rbs_used += nb_rb; - UE_list->eNB_UE_stats[CC_id][UE_id].ncce_used = nCCE[CC_id]; UE_list->eNB_UE_stats[CC_id][UE_id].dlsch_mcs1=eNB_UE_stats->dlsch_mcs1; UE_list->eNB_UE_stats[CC_id][UE_id].dlsch_mcs2=mcs; UE_list->eNB_UE_stats[CC_id][UE_id].TBS = TBS; @@ -1166,7 +1133,7 @@ schedule_ue_spec( // this is the normalized RX power eNB_UE_stats = mac_xface->get_eNB_UE_stats(module_idP,CC_id,rnti); normalized_rx_power = eNB_UE_stats->Po_PUCCH_dBm; - target_rx_power = mac_xface->get_target_pucch_rx_power(module_idP,CC_id) + 10; + target_rx_power = mac_xface->get_target_pucch_rx_power(module_idP,CC_id) + 20; // this assumes accumulated tpc // make sure that we are only sending a tpc update once a frame, otherwise the control loop will freak out @@ -1178,6 +1145,7 @@ schedule_ue_spec( UE_list->UE_template[CC_id][UE_id].pucch_tpc_tx_frame=frameP; UE_list->UE_template[CC_id][UE_id].pucch_tpc_tx_subframe=subframeP; + if (normalized_rx_power>(target_rx_power+1)) { tpc = 0; //-1 tpc_accumulated--; @@ -1187,9 +1155,11 @@ schedule_ue_spec( } else { tpc = 1; //0 } - LOG_D(MAC,"[eNB %d] DLSCH scheduler: frame %d, subframe %d, harq_pid %d, tpc %d, accumulated %d, normalized/target rx power %d/%d\n", + /* + LOG_I(MAC,"[eNB %d] DLSCH scheduler: frame %d, subframe %d, harq_pid %d, tpc %d, accumulated %d, normalized/target rx power %d/%d\n", module_idP,frameP, subframeP,harq_pid,tpc, - tpc_accumulated,normalized_rx_power,target_rx_power); + tpc_accumulated,normalized_rx_power,target_rx_power);*/ + } // Po_PUCCH has been updated else { tpc = 1; //0 @@ -1495,10 +1465,9 @@ schedule_ue_spec( if (frame_parms[CC_id]->frame_type == TDD) { set_ul_DAI(module_idP,UE_id,CC_id,frameP,subframeP,frame_parms); } - } - } - //printf("MAC nCCE : %d\n",*nCCE_used); + } // UE_id loop + } // CC_id loop stop_meas(&eNB->schedule_dlsch); @@ -1509,13 +1478,11 @@ schedule_ue_spec( //------------------------------------------------------------------------------ void fill_DLSCH_dci( - module_id_t module_idP, - frame_t frameP, - sub_frame_t subframeP, - uint32_t* RBallocP, - uint8_t RA_scheduledP, - int* mbsfn_flagP -) + module_id_t module_idP, + frame_t frameP, + sub_frame_t subframeP, + int* mbsfn_flagP + ) //------------------------------------------------------------------------------ { @@ -1523,10 +1490,9 @@ fill_DLSCH_dci( int UE_id = -1; uint8_t first_rb,nb_rb=3; rnti_t rnti; - unsigned char vrb_map[100]; + unsigned char *vrb_map; uint8_t rballoc_sub[25]; //uint8_t number_of_subbands=13; - uint32_t *rballoc=RBallocP; unsigned char round; unsigned char harq_pid; @@ -1549,598 +1515,8 @@ fill_DLSCH_dci( if (mbsfn_flagP[CC_id]>0) continue; - DCI_pdu = &eNB->common_channels[CC_id].DCI_pdu; - BCCH_alloc_pdu=(void*)&eNB->common_channels[CC_id].BCCH_alloc_pdu; - // clear vrb_map - memset(vrb_map,0,100); - - - // SI DLSCH - // printf("BCCH check\n"); - if (eNB->common_channels[CC_id].bcch_active == 1) { - eNB->common_channels[CC_id].bcch_active = 0; - LOG_D(MAC,"[eNB %d] CC_id %d Frame %d subframeP %d: BCCH active\n", module_idP, CC_id, frameP, subframeP); - // randomize frequency allocation for SI - first_rb = 10;//(unsigned char)(taus()%(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL-4)); - - /* Where is this from, should be removed!!!! - - if (PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.frame_type == TDD) { - - } - else { - BCCH_alloc_pdu_fdd.rballoc = mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL,first_rb,4); - rballoc[CC_id] |= mac_xface->get_rballoc(BCCH_alloc_pdu_fdd.vrb_type,BCCH_alloc_pdu_fdd.rballoc); - } - */ - - - vrb_map[first_rb] = 1; - vrb_map[first_rb+1] = 1; - vrb_map[first_rb+2] = 1; - vrb_map[first_rb+3] = 1; - - if (PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.frame_type == TDD) { - switch (PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL) { - case 6: - ((DCI1A_1_5MHz_TDD_1_6_t*)BCCH_alloc_pdu)->rballoc = mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL,first_rb,4); - ((DCI1A_1_5MHz_TDD_1_6_t*)BCCH_alloc_pdu)->type = 1; - ((DCI1A_1_5MHz_TDD_1_6_t*)BCCH_alloc_pdu)->vrb_type = 0; - ((DCI1A_1_5MHz_TDD_1_6_t*)BCCH_alloc_pdu)->ndi = 1; - ((DCI1A_1_5MHz_TDD_1_6_t*)BCCH_alloc_pdu)->rv = 1; - ((DCI1A_1_5MHz_TDD_1_6_t*)BCCH_alloc_pdu)->harq_pid = 0; - ((DCI1A_1_5MHz_TDD_1_6_t*)BCCH_alloc_pdu)->TPC = 1; - ((DCI1A_1_5MHz_TDD_1_6_t*)BCCH_alloc_pdu)->padding = 0; - rballoc[CC_id] |= mac_xface->get_rballoc(0,((DCI1A_1_5MHz_TDD_1_6_t*)BCCH_alloc_pdu)->rballoc); - add_common_dci(DCI_pdu, - BCCH_alloc_pdu, - SI_RNTI, - sizeof(DCI1A_1_5MHz_TDD_1_6_t), - 2, - sizeof_DCI1A_1_5MHz_TDD_1_6_t, - format1A,0); - break; - - case 25: - ((DCI1A_5MHz_TDD_1_6_t*)BCCH_alloc_pdu)->rballoc = mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL,first_rb,4); - ((DCI1A_5MHz_TDD_1_6_t*)BCCH_alloc_pdu)->type = 1; - ((DCI1A_5MHz_TDD_1_6_t*)BCCH_alloc_pdu)->vrb_type = 0; - ((DCI1A_5MHz_TDD_1_6_t*)BCCH_alloc_pdu)->ndi = 1; - ((DCI1A_5MHz_TDD_1_6_t*)BCCH_alloc_pdu)->rv = 1; - ((DCI1A_5MHz_TDD_1_6_t*)BCCH_alloc_pdu)->harq_pid = 0; - ((DCI1A_5MHz_TDD_1_6_t*)BCCH_alloc_pdu)->TPC = 1; - ((DCI1A_5MHz_TDD_1_6_t*)BCCH_alloc_pdu)->padding = 0; - rballoc[CC_id] |= mac_xface->get_rballoc(0,((DCI1A_5MHz_TDD_1_6_t*)BCCH_alloc_pdu)->rballoc); - add_common_dci(DCI_pdu, - BCCH_alloc_pdu, - SI_RNTI, - sizeof(DCI1A_5MHz_TDD_1_6_t), - 2, - sizeof_DCI1A_5MHz_TDD_1_6_t, - format1A,0); - break; - - case 50: - ((DCI1A_10MHz_TDD_1_6_t*)BCCH_alloc_pdu)->rballoc = mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL,first_rb,4); - ((DCI1A_10MHz_TDD_1_6_t*)BCCH_alloc_pdu)->type = 1; - ((DCI1A_10MHz_TDD_1_6_t*)BCCH_alloc_pdu)->vrb_type = 0; - ((DCI1A_10MHz_TDD_1_6_t*)BCCH_alloc_pdu)->ndi = 1; - ((DCI1A_10MHz_TDD_1_6_t*)BCCH_alloc_pdu)->rv = 1; - ((DCI1A_10MHz_TDD_1_6_t*)BCCH_alloc_pdu)->harq_pid = 0; - ((DCI1A_10MHz_TDD_1_6_t*)BCCH_alloc_pdu)->TPC = 1; - ((DCI1A_10MHz_TDD_1_6_t*)BCCH_alloc_pdu)->padding = 0; - rballoc[CC_id] |= mac_xface->get_rballoc(0,((DCI1A_10MHz_TDD_1_6_t*)BCCH_alloc_pdu)->rballoc); - add_common_dci(DCI_pdu, - BCCH_alloc_pdu, - SI_RNTI, - sizeof(DCI1A_10MHz_TDD_1_6_t), - 2, - sizeof_DCI1A_10MHz_TDD_1_6_t, - format1A,0); - break; - - case 100: - ((DCI1A_20MHz_TDD_1_6_t*)BCCH_alloc_pdu)->rballoc = mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL,first_rb,4); - ((DCI1A_20MHz_TDD_1_6_t*)BCCH_alloc_pdu)->type = 1; - ((DCI1A_20MHz_TDD_1_6_t*)BCCH_alloc_pdu)->vrb_type = 0; - ((DCI1A_20MHz_TDD_1_6_t*)BCCH_alloc_pdu)->ndi = 1; - ((DCI1A_20MHz_TDD_1_6_t*)BCCH_alloc_pdu)->rv = 1; - ((DCI1A_20MHz_TDD_1_6_t*)BCCH_alloc_pdu)->harq_pid = 0; - ((DCI1A_20MHz_TDD_1_6_t*)BCCH_alloc_pdu)->TPC = 1; - ((DCI1A_20MHz_TDD_1_6_t*)BCCH_alloc_pdu)->padding = 0; - rballoc[CC_id] |= mac_xface->get_rballoc(0,((DCI1A_20MHz_TDD_1_6_t*)BCCH_alloc_pdu)->rballoc); - add_common_dci(DCI_pdu, - BCCH_alloc_pdu, - SI_RNTI, - sizeof(DCI1A_20MHz_TDD_1_6_t), - 2, - sizeof_DCI1A_20MHz_TDD_1_6_t, - format1A,0); - break; - } - } else { - switch (PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL) { - case 6: - ((DCI1A_1_5MHz_FDD_t*)BCCH_alloc_pdu)->rballoc = mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL,first_rb,4); - ((DCI1A_1_5MHz_FDD_t*)BCCH_alloc_pdu)->type = 1; - ((DCI1A_1_5MHz_FDD_t*)BCCH_alloc_pdu)->vrb_type = 0; - ((DCI1A_1_5MHz_FDD_t*)BCCH_alloc_pdu)->ndi = 1; - ((DCI1A_1_5MHz_FDD_t*)BCCH_alloc_pdu)->rv = 1; - ((DCI1A_1_5MHz_FDD_t*)BCCH_alloc_pdu)->harq_pid = 0; - ((DCI1A_1_5MHz_FDD_t*)BCCH_alloc_pdu)->TPC = 1; - ((DCI1A_1_5MHz_FDD_t*)BCCH_alloc_pdu)->padding = 0; - - rballoc[CC_id] |= mac_xface->get_rballoc(0,((DCI1A_1_5MHz_FDD_t*)BCCH_alloc_pdu)->rballoc); - add_common_dci(DCI_pdu, - BCCH_alloc_pdu, - SI_RNTI, - sizeof(DCI1A_1_5MHz_FDD_t), - 2, - sizeof_DCI1A_1_5MHz_FDD_t, - format1A,0); - break; - - case 25: - ((DCI1A_5MHz_FDD_t*)BCCH_alloc_pdu)->rballoc = mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL,first_rb,4); - ((DCI1A_5MHz_FDD_t*)BCCH_alloc_pdu)->type = 1; - ((DCI1A_5MHz_FDD_t*)BCCH_alloc_pdu)->vrb_type = 0; - ((DCI1A_5MHz_FDD_t*)BCCH_alloc_pdu)->ndi = 1; - ((DCI1A_5MHz_FDD_t*)BCCH_alloc_pdu)->rv = 1; - ((DCI1A_5MHz_FDD_t*)BCCH_alloc_pdu)->harq_pid = 0; - ((DCI1A_5MHz_FDD_t*)BCCH_alloc_pdu)->TPC = 1; - ((DCI1A_5MHz_FDD_t*)BCCH_alloc_pdu)->padding = 0; - - rballoc[CC_id] |= mac_xface->get_rballoc(0,((DCI1A_5MHz_FDD_t*)BCCH_alloc_pdu)->rballoc); - add_common_dci(DCI_pdu, - BCCH_alloc_pdu, - SI_RNTI, - sizeof(DCI1A_5MHz_FDD_t), - 2, - sizeof_DCI1A_5MHz_FDD_t, - format1A,0); - break; - - case 50: - ((DCI1A_10MHz_FDD_t*)BCCH_alloc_pdu)->rballoc = mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL,first_rb,4); - ((DCI1A_10MHz_FDD_t*)BCCH_alloc_pdu)->type = 1; - ((DCI1A_10MHz_FDD_t*)BCCH_alloc_pdu)->vrb_type = 0; - ((DCI1A_10MHz_FDD_t*)BCCH_alloc_pdu)->ndi = 1; - ((DCI1A_10MHz_FDD_t*)BCCH_alloc_pdu)->rv = 1; - ((DCI1A_10MHz_FDD_t*)BCCH_alloc_pdu)->harq_pid = 0; - ((DCI1A_10MHz_FDD_t*)BCCH_alloc_pdu)->TPC = 1; - ((DCI1A_10MHz_FDD_t*)BCCH_alloc_pdu)->padding = 0; - - rballoc[CC_id] |= mac_xface->get_rballoc(0,((DCI1A_10MHz_FDD_t*)BCCH_alloc_pdu)->rballoc); - add_common_dci(DCI_pdu, - BCCH_alloc_pdu, - SI_RNTI, - sizeof(DCI1A_10MHz_FDD_t), - 2, - sizeof_DCI1A_10MHz_FDD_t, - format1A,0); - break; - - case 100: - ((DCI1A_20MHz_FDD_t*)BCCH_alloc_pdu)->rballoc = mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL,first_rb,4); - ((DCI1A_20MHz_FDD_t*)BCCH_alloc_pdu)->type = 1; - ((DCI1A_20MHz_FDD_t*)BCCH_alloc_pdu)->vrb_type = 0; - ((DCI1A_20MHz_FDD_t*)BCCH_alloc_pdu)->ndi = 1; - ((DCI1A_20MHz_FDD_t*)BCCH_alloc_pdu)->rv = 1; - ((DCI1A_20MHz_FDD_t*)BCCH_alloc_pdu)->harq_pid = 0; - ((DCI1A_20MHz_FDD_t*)BCCH_alloc_pdu)->TPC = 1; - ((DCI1A_20MHz_FDD_t*)BCCH_alloc_pdu)->padding = 0; - - rballoc[CC_id] |= mac_xface->get_rballoc(0,((DCI1A_20MHz_FDD_t*)BCCH_alloc_pdu)->rballoc); - add_common_dci(DCI_pdu, - BCCH_alloc_pdu, - SI_RNTI, - sizeof(DCI1A_20MHz_FDD_t), - 2, - sizeof_DCI1A_20MHz_FDD_t, - format1A,0); - break; - } - } - } - - if (RA_scheduledP == 1) { - for (i=0; i<NB_RA_PROC_MAX; i++) { - - RA_template = &eNB->common_channels[CC_id].RA_template[i]; - - if (RA_template->generate_rar == 1) { - - //FK: postponed to fill_rar - //RA_template->generate_rar = 0; - - LOG_D(MAC,"[eNB %d] CC_id %d Frame %d, subframeP %d: Generating RAR DCI (proc %d), RA_active %d format 1A (%d,%d))\n", - module_idP, CC_id, frameP, subframeP,i, - RA_template->RA_active, - RA_template->RA_dci_fmt1, - RA_template->RA_dci_size_bits1); - - // randomize frequency allocation for RA - while (1) { - first_rb = (unsigned char)(taus()%(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL-4)); - - if ((vrb_map[first_rb] != 1) && (vrb_map[first_rb+3] != 1)) - break; - } - - vrb_map[first_rb] = 1; - vrb_map[first_rb+1] = 1; - vrb_map[first_rb+2] = 1; - vrb_map[first_rb+3] = 1; - - if (PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.frame_type == TDD) { - switch(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL) { - case 6: - ((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->type=1; - ((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->vrb_type=0; - ((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->ndi=1; - ((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->rv=0; - ((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->mcs=0; - ((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->harq_pid=0; - ((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->TPC=1; - ((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->padding=0; - ((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->rballoc = mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL,first_rb,4); - rballoc[CC_id] |= mac_xface->get_rballoc(((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->vrb_type, - ((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->rballoc); - break; - - case 25: - ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->type=1; - ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->vrb_type=0; - ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->ndi=1; - ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->rv=0; - ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->mcs=0; - ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->harq_pid=0; - ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->TPC=1; - ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->padding=0; - ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->rballoc = mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL,first_rb,4); - rballoc[CC_id] |= mac_xface->get_rballoc(((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->vrb_type, - ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->rballoc); - break; - - case 50: - ((DCI1A_10MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->type=1; - ((DCI1A_10MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->vrb_type=0; - ((DCI1A_10MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->ndi=1; - ((DCI1A_10MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->rv=0; - ((DCI1A_10MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->mcs=0; - ((DCI1A_10MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->harq_pid=0; - ((DCI1A_10MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->TPC=1; - ((DCI1A_10MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->padding=0; - ((DCI1A_10MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->rballoc = mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL,first_rb,4); - rballoc[CC_id] |= mac_xface->get_rballoc(((DCI1A_10MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->vrb_type, - ((DCI1A_10MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->rballoc); - break; - - case 100: - ((DCI1A_20MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->type=1; - ((DCI1A_20MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->vrb_type=0; - ((DCI1A_20MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->ndi=1; - ((DCI1A_20MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->rv=0; - ((DCI1A_20MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->mcs=0; - ((DCI1A_20MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->harq_pid=0; - ((DCI1A_20MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->TPC=1; - ((DCI1A_20MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->padding=0; - ((DCI1A_20MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->rballoc = mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL,first_rb,4); - rballoc[CC_id] |= mac_xface->get_rballoc(((DCI1A_20MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->vrb_type, - ((DCI1A_20MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->rballoc); - break; - - default: - ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->type=1; - ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->vrb_type=0; - ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->ndi=1; - ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->rv=0; - ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->mcs=0; - ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->harq_pid=0; - ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->TPC=1; - ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->padding=0; - ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->rballoc = mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL,first_rb,4); - rballoc[CC_id] |= mac_xface->get_rballoc(((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->vrb_type, - ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->rballoc); - break; - } - } else { - switch(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL) { - case 6: - ((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->type=1; - ((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->vrb_type=0; - ((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->ndi=1; - ((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->rv=0; - ((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->mcs=0; - ((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->harq_pid=0; - ((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->TPC=1; - ((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->padding=0; - ((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->rballoc = mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL,first_rb,4); - rballoc[CC_id] |= mac_xface->get_rballoc(((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->vrb_type, - ((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->rballoc); - break; - - case 25: - ((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->type=1; - ((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->vrb_type=0; - ((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->ndi=1; - ((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->rv=0; - ((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->mcs=0; - ((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->harq_pid=0; - ((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->TPC=1; - ((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->padding=0; - ((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->rballoc = mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_UL,first_rb,4); - rballoc[CC_id] |= mac_xface->get_rballoc(((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->vrb_type, - ((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->rballoc); - break; - - case 50: - ((DCI1A_10MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->type=1; - ((DCI1A_10MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->vrb_type=0; - ((DCI1A_10MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->ndi=1; - ((DCI1A_10MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->rv=0; - ((DCI1A_10MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->mcs=0; - ((DCI1A_10MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->harq_pid=0; - ((DCI1A_10MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->TPC=1; - ((DCI1A_10MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->padding=0; - ((DCI1A_10MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->rballoc = mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL,first_rb,4); - rballoc[CC_id] |= mac_xface->get_rballoc(((DCI1A_10MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->vrb_type, - ((DCI1A_10MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->rballoc); - break; - - case 100: - ((DCI1A_20MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->type=1; - ((DCI1A_20MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->vrb_type=0; - ((DCI1A_20MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->ndi=1; - ((DCI1A_20MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->rv=0; - ((DCI1A_20MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->mcs=0; - ((DCI1A_20MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->harq_pid=0; - ((DCI1A_20MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->TPC=1; - ((DCI1A_20MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->padding=0; - ((DCI1A_20MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->rballoc = mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL,first_rb,4); - rballoc[CC_id] |= mac_xface->get_rballoc(((DCI1A_20MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->vrb_type, - ((DCI1A_20MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->rballoc); - break; - - default: - break; - } - } - - add_common_dci(DCI_pdu, - (void*)&RA_template->RA_alloc_pdu1[0], - RA_template->RA_rnti, - RA_template->RA_dci_size_bytes1, - 2, - RA_template->RA_dci_size_bits1, - RA_template->RA_dci_fmt1, - 1); - - - - LOG_D(MAC,"[eNB %d] CC_id %d Frame %d: Adding common dci for RA%d (RAR) RA_active %d\n", - module_idP,CC_id,frameP,i, RA_template->RA_active); - } - - if (RA_template->generate_Msg4_dci == 1) { - - // randomize frequency allocation for RA - while (1) { - first_rb = (unsigned char)(taus()%(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL-4)); - - if ((vrb_map[first_rb] != 1) && (vrb_map[first_rb+3] != 1)) - break; - } - - vrb_map[first_rb] = 1; - vrb_map[first_rb+1] = 1; - vrb_map[first_rb+2] = 1; - vrb_map[first_rb+3] = 1; - - if (PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.frame_type == TDD) { - switch (PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL) { - case 6: - ((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->type=1; - ((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->vrb_type=0; - ((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->rv=0; - ((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->harq_pid=0; - ((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->TPC=1; - ((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->padding=0; - ((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->rballoc= mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL,first_rb,4); - rballoc[CC_id] |= mac_xface->get_rballoc(((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->vrb_type, - ((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->rballoc); - break; - - case 25: - ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->type=1; - ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->vrb_type=0; - ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->rv=0; - ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->harq_pid=0; - ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->TPC=1; - ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->padding=0; - ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->rballoc= mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL,first_rb,4); - rballoc[CC_id] |= mac_xface->get_rballoc(((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->vrb_type, - ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->rballoc); - break; - - case 50: - ((DCI1A_10MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->type=1; - ((DCI1A_10MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->vrb_type=0; - ((DCI1A_10MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->rv=0; - ((DCI1A_10MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->harq_pid=0; - ((DCI1A_10MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->TPC=1; - ((DCI1A_10MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->padding=0; - ((DCI1A_10MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->rballoc= mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL,first_rb,4); - rballoc[CC_id] |= mac_xface->get_rballoc(((DCI1A_10MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->vrb_type, - ((DCI1A_10MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->rballoc); - break; - - case 100: - ((DCI1A_20MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->type=1; - ((DCI1A_20MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->vrb_type=0; - ((DCI1A_20MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->rv=0; - ((DCI1A_20MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->harq_pid=0; - ((DCI1A_20MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->TPC=1; - ((DCI1A_20MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->rballoc= mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL,first_rb,4); - rballoc[CC_id] |= mac_xface->get_rballoc(((DCI1A_20MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->vrb_type, - ((DCI1A_20MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->rballoc); - break; - - default: - ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->type=1; - ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->vrb_type=0; - ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->rv=0; - ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->harq_pid=0; - ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->TPC=1; - ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->padding=0; - ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->rballoc= mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL,first_rb,4); - rballoc[CC_id] |= mac_xface->get_rballoc(((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->vrb_type, - ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->rballoc); - break; - } - } else { - switch (PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL) { - - case 6: - ((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->type=1; - ((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->vrb_type=0; - ((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->rv=0; - ((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->harq_pid=0; - ((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->TPC=1; - ((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->padding=0; - ((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->rballoc= mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL,first_rb,4); - rballoc[CC_id] |= mac_xface->get_rballoc(((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->vrb_type, - ((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->rballoc); - break; - - case 25: - ((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->type=1; - ((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->vrb_type=0; - ((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->rv=0; - ((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->harq_pid=0; - ((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->TPC=1; - ((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->padding=0; - ((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->rballoc= mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL,first_rb,4); - rballoc[CC_id] |= mac_xface->get_rballoc(((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->vrb_type, - ((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->rballoc); - break; - - case 50: - ((DCI1A_10MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->type=1; - ((DCI1A_10MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->vrb_type=0; - ((DCI1A_10MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->rv=0; - ((DCI1A_10MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->harq_pid=0; - ((DCI1A_10MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->TPC=1; - ((DCI1A_10MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->padding=0; - ((DCI1A_10MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->rballoc= mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL,first_rb,4); - rballoc[CC_id] |= mac_xface->get_rballoc(((DCI1A_10MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->vrb_type, - ((DCI1A_10MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->rballoc); - break; - - case 100: - ((DCI1A_20MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->type=1; - ((DCI1A_20MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->vrb_type=0; - ((DCI1A_20MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->rv=0; - ((DCI1A_20MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->harq_pid=0; - ((DCI1A_20MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->TPC=1; - ((DCI1A_20MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->padding=0; - ((DCI1A_20MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->rballoc= mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL,first_rb,4); - rballoc[CC_id] |= mac_xface->get_rballoc(((DCI1A_20MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->vrb_type, - ((DCI1A_20MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->rballoc); - break; - - default: - ((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->type=1; - ((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->vrb_type=0; - ((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->rv=0; - ((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->harq_pid=0; - ((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->TPC=1; - ((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->rballoc= mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL,first_rb,4); - rballoc[CC_id] |= mac_xface->get_rballoc(((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->vrb_type, - ((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->rballoc); - break; - } - } - - add_ue_spec_dci(DCI_pdu, - (void*)&RA_template->RA_alloc_pdu2[0], - RA_template->rnti, - RA_template->RA_dci_size_bytes2, - 1, - RA_template->RA_dci_size_bits2, - RA_template->RA_dci_fmt2, - 0); - LOG_D(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, subframeP %d: Adding ue specific dci (rnti %x) for Msg4\n", - module_idP,CC_id,frameP,subframeP,RA_template->rnti); - RA_template->generate_Msg4_dci=0; - - } else if (RA_template->wait_ack_Msg4==1) { - // check HARQ status and retransmit if necessary - LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, subframeP %d: Checking if Msg4 was acknowledged: \n", - module_idP,CC_id,frameP,subframeP); - // Get candidate harq_pid from PHY - mac_xface->get_ue_active_harq_pid(module_idP,CC_id,RA_template->rnti,frameP,subframeP,&harq_pid,&round,0); - - if (round>0) { - //RA_template->wait_ack_Msg4++; - // we have to schedule a retransmission - if (PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.frame_type == TDD) { - ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->ndi=1; - } else { - ((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->ndi=1; - } - - // randomize frequency allocation for RA - while (1) { - first_rb = (unsigned char)(taus()%(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL-4)); - - if ((vrb_map[first_rb] != 1) && (vrb_map[first_rb+3] != 1)) - break; - } - - vrb_map[first_rb] = 1; - vrb_map[first_rb+1] = 1; - vrb_map[first_rb+2] = 1; - vrb_map[first_rb+3] = 1; - - if (PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.frame_type == TDD) { - ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->rballoc = mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_UL,first_rb,4); - rballoc[CC_id] |= mac_xface->get_rballoc(((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->vrb_type, - ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->rballoc); - } else { - ((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->rballoc = mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_UL,first_rb,4); - rballoc[CC_id] |= mac_xface->get_rballoc(((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->vrb_type, - ((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->rballoc); - } - - add_ue_spec_dci(DCI_pdu, - (void*)&RA_template->RA_alloc_pdu2[0], - RA_template->rnti, - RA_template->RA_dci_size_bytes2, - 2, - RA_template->RA_dci_size_bits2, - RA_template->RA_dci_fmt2, - 0); - LOG_W(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, subframeP %d: Msg4 not acknowledged, adding ue specific dci (rnti %x) for RA (Msg4 Retransmission)\n", - module_idP,CC_id,frameP,subframeP,RA_template->rnti); - } else { - /* msg4 not received - if ((round == 0) && (RA_template->wait_ack_Msg4>1){ - remove UE instance across all the layers: mac_xface->cancel_RA(); - } - */ - LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, subframeP %d : Msg4 acknowledged\n",module_idP,CC_id,frameP,subframeP); - RA_template->wait_ack_Msg4=0; - RA_template->RA_active=FALSE; - UE_id = find_UE_id(module_idP,RA_template->rnti); - DevAssert( UE_id != -1 ); - eNB_mac_inst[module_idP].UE_list.UE_template[UE_PCCID(module_idP,UE_id)][UE_id].configured=TRUE; - - } - } - } - } // RA is scheduled in this subframeP - + DCI_pdu = &eNB->common_channels[CC_id].DCI_pdu; + // UE specific DCIs for (UE_id=UE_list->head; UE_id>=0; UE_id=UE_list->next[UE_id]) { @@ -2161,11 +1537,6 @@ fill_DLSCH_dci( /// Synchronizing rballoc with rballoc_sub for(i=0; i<PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RBG; i++) { rballoc_sub[i] = UE_list->UE_template[CC_id][UE_id].rballoc_subband[harq_pid][i]; - - if(rballoc_sub[i] == 1) { - rballoc[CC_id] |= (0x0001<<i); // TO be FIXED!!!!!! - } - } switch(mac_xface->get_transmission_mode(module_idP,CC_id,rnti)) { @@ -2174,7 +1545,7 @@ fill_DLSCH_dci( case 1: case 2: - LOG_D(MAC,"[eNB %d] CC_id %d Adding UE %d spec DCI for %d PRBS (rb alloc: %x) \n",module_idP, CC_id, UE_id, nb_rb,rballoc); + LOG_D(MAC,"[eNB %d] CC_id %d Adding UE %d spec DCI for %d PRBS \n",module_idP, CC_id, UE_id, nb_rb); if (PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.frame_type == TDD) { switch (PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL) { @@ -2267,7 +1638,7 @@ fill_DLSCH_dci( case 3: LOG_D(MAC,"[eNB %d] CC_id %d Adding Format 2A UE %d spec DCI for %d PRBS (rb alloc: %x) \n", - module_idP, CC_id, UE_id, nb_rb,rballoc); + module_idP, CC_id, UE_id, nb_rb); if (PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.frame_type == TDD) { switch (PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL) { diff --git a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c index 34169d902e3a75d800b6ad8885b68025eb440586..9cabd6b62233afe563028f478b909fe123dbf684 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c @@ -267,6 +267,7 @@ int add_new_ue(module_id_t mod_idP, int cc_idP, rnti_t rntiP,int harq_pidP) UE_list->ordered_ULCCids[0][UE_id] = cc_idP; UE_list->num_UEs++; UE_list->active[UE_id] = TRUE; + memset((void*)&UE_list->UE_sched_ctrl[UE_id],0,sizeof(UE_sched_ctrl)); for (j=0; j<8; j++) { UE_list->UE_template[cc_idP][UE_id].oldNDI[j] = (j==0)?1:0; // 1 because first transmission is with format1A (Msg4) for harq_pid 0 @@ -879,3 +880,230 @@ int get_nb_subband(void) return nb_sb; } + +void init_CCE_table(int module_idP,int CC_idP) +{ + memset(eNB_mac_inst[module_idP].CCE_table[CC_idP],0,800*sizeof(int)); +} + + +int get_nCCE_offset(int *CCE_table, + const unsigned char L, + const int nCCE, + const int common_dci, + const unsigned short rnti, + const unsigned char subframe) +{ + + int search_space_free,m,nb_candidates = 0,l,i; + unsigned int Yk; + /* + printf("CCE Allocation: "); + for (i=0;i<nCCE;i++) + printf("%d.",CCE_table[i]); + printf("\n"); + */ + if (common_dci == 1) { + // check CCE(0 ... L-1) + nb_candidates = (L==4) ? 4 : 2; + nb_candidates = min(nb_candidates,nCCE/L); + + // printf("Common DCI nb_candidates %d, L %d\n",nb_candidates,L); + + for (m = nb_candidates-1 ; m >=0 ; m--) { + + search_space_free = 1; + for (l=0; l<L; l++) { + + // printf("CCE_table[%d] %d\n",(m*L)+l,CCE_table[(m*L)+l]); + if (CCE_table[(m*L) + l] == 1) { + search_space_free = 0; + break; + } + } + + if (search_space_free == 1) { + + // printf("returning %d\n",m*L); + + for (l=0; l<L; l++) + CCE_table[(m*L)+l]=1; + return(m*L); + } + } + + return(-1); + + } else { // Find first available in ue specific search space + // according to procedure in Section 9.1.1 of 36.213 (v. 8.6) + // compute Yk + Yk = (unsigned int)rnti; + + for (i=0; i<=subframe; i++) + Yk = (Yk*39827)%65537; + + Yk = Yk % (nCCE/L); + + + switch (L) { + case 1: + case 2: + nb_candidates = 6; + break; + + case 4: + case 8: + nb_candidates = 2; + break; + + default: + DevParam(L, nCCE, rnti); + break; + } + + + LOG_D(MAC,"rnti %x, Yk = %d, nCCE %d (nCCE/L %d),nb_cand %d\n",rnti,Yk,nCCE,nCCE/L,nb_candidates); + + for (m = 0 ; m < nb_candidates ; m++) { + search_space_free = 1; + + for (l=0; l<L; l++) { + if (CCE_table[(((Yk+m)%(nCCE/L))*L) + l] == 1) { + search_space_free = 0; + break; + } + } + + if (search_space_free == 1) { + for (l=0; l<L; l++) + CCE_table[(((Yk+m)%(nCCE/L))*L)+l]=1; + + return(((Yk+m)%(nCCE/L))*L); + } + } + + return(-1); + } +} + +// Allocate the CCEs +int allocate_CCEs(int module_idP, + int CC_idP, + int subframeP, + int test_onlyP) { + + + int *CCE_table = eNB_mac_inst[module_idP].CCE_table[CC_idP]; + DCI_PDU *DCI_pdu = &eNB_mac_inst[module_idP].common_channels[CC_idP].DCI_pdu; + int nCCE_max = mac_xface->get_nCCE_max(module_idP,CC_idP,DCI_pdu->num_pdcch_symbols,subframeP); + int fCCE; + int i,j; + int allocation_is_feasible = 1; + DCI_ALLOC_t *dci_alloc; + + + LOG_D(MAC,"Allocate CCEs subframe %d, test %d : (common %d,uspec %d)\n",subframeP,test_onlyP,DCI_pdu->Num_common_dci,DCI_pdu->Num_ue_spec_dci); + + init_CCE_table(module_idP,CC_idP); + DCI_pdu->nCCE=0; + + while (allocation_is_feasible == 1) { + + for (i=0;i<DCI_pdu->Num_common_dci + DCI_pdu->Num_ue_spec_dci;i++) { + dci_alloc = &DCI_pdu->dci_alloc[i]; + LOG_D(MAC,"Trying to allocate DCI %d/%d (%d,%d) : rnti %x, aggreg %d nCCE %d / %d (num_pdcch_symbols %d)\n", + i,DCI_pdu->Num_common_dci+DCI_pdu->Num_ue_spec_dci, + DCI_pdu->Num_common_dci,DCI_pdu->Num_ue_spec_dci, + dci_alloc->rnti,1<<dci_alloc->L, + DCI_pdu->nCCE,nCCE_max,DCI_pdu->num_pdcch_symbols); + + if (DCI_pdu->nCCE + (1<<dci_alloc->L) > nCCE_max) { + if (DCI_pdu->num_pdcch_symbols == 3) + allocation_is_feasible = 0; + else { + DCI_pdu->num_pdcch_symbols++; + nCCE_max = mac_xface->get_nCCE_max(module_idP,CC_idP,DCI_pdu->num_pdcch_symbols,subframeP); + } + break; + } + else { // number of CCEs left can potentially hold this allocation + if ((fCCE = get_nCCE_offset(CCE_table, + 1<<(dci_alloc->L), + nCCE_max, + (i<DCI_pdu->Num_common_dci) ? 1 : 0, + dci_alloc->rnti, + subframeP))>=0) {// the allocation is feasible, rnti rule passes + + LOG_D(MAC,"Allocating at nCCE %d\n",fCCE); + if (test_onlyP == 0) { + DCI_pdu->nCCE += (1<<dci_alloc->L); + dci_alloc->firstCCE=fCCE; + LOG_D(MAC,"Allocate CCEs subframe %d, test %d\n",subframeP,test_onlyP); + } + } // fCCE>=0 + else { + if (DCI_pdu->num_pdcch_symbols == 3) { + allocation_is_feasible = 0; + LOG_I(MAC,"subframe %d: Dropping Allocation for RNTI %x\n", + subframeP,dci_alloc->rnti); + for (j=0;j<=i;j++){ + + LOG_I(MAC,"DCI %d/%d (%d,%d) : rnti %x dci format %d, aggreg %d nCCE %d / %d (num_pdcch_symbols %d)\n", + i,DCI_pdu->Num_common_dci+DCI_pdu->Num_ue_spec_dci, + DCI_pdu->Num_common_dci,DCI_pdu->Num_ue_spec_dci, + DCI_pdu->dci_alloc[j].rnti,DCI_pdu->dci_alloc[j].format, + 1<<DCI_pdu->dci_alloc[j].L, + DCI_pdu->nCCE,nCCE_max,DCI_pdu->num_pdcch_symbols); + } + } + else { + DCI_pdu->num_pdcch_symbols++; + nCCE_max = mac_xface->get_nCCE_max(module_idP,CC_idP,DCI_pdu->num_pdcch_symbols,subframeP); + } + break; + } // fCCE==-1 + } // nCCE <= nCCE_max + } // for i = 0 ... num_dcis + if (allocation_is_feasible==1) + return (0); + } // allocation_is_feasible == 1 + + return(-1); + + +} + +boolean_t CCE_allocation_infeasible(int module_idP, + int CC_idP, + int common_flag, + int subframe, + int aggregation, + int rnti) { + + + DCI_PDU *DCI_pdu = &eNB_mac_inst[module_idP].common_channels[CC_idP].DCI_pdu; + DCI_ALLOC_t *dci_alloc; + int ret; + boolean_t res=FALSE; + + if (common_flag==1) { + DCI_pdu->dci_alloc[DCI_pdu->Num_common_dci + DCI_pdu->Num_ue_spec_dci].rnti = rnti; + DCI_pdu->dci_alloc[DCI_pdu->Num_common_dci + DCI_pdu->Num_ue_spec_dci].L = aggregation; + DCI_pdu->Num_common_dci++; + ret = allocate_CCEs(module_idP,CC_idP,subframe,1); + if (ret==-1) + res = TRUE; + DCI_pdu->Num_common_dci--; + } + else { + DCI_pdu->dci_alloc[DCI_pdu->Num_common_dci + DCI_pdu->Num_ue_spec_dci].rnti = rnti; + DCI_pdu->dci_alloc[DCI_pdu->Num_common_dci + DCI_pdu->Num_ue_spec_dci].L = aggregation; + DCI_pdu->Num_ue_spec_dci++; + ret = allocate_CCEs(module_idP,CC_idP,subframe,1); + if (ret==-1) + res = TRUE; + DCI_pdu->Num_ue_spec_dci--; + } + return(res); +} + diff --git a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c index 1018c6e7d8483ff60121c33eb9007f337573ef0d..493ff11d33c6b4b9cd0d3473d5f73f178514e459 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c @@ -88,6 +88,7 @@ void rx_sdu( int ii,j; eNB_MAC_INST *eNB = &eNB_mac_inst[enb_mod_idP]; UE_list_t *UE_list= &eNB->UE_list; + int crnti_rx=0; start_meas(&eNB->rx_ulsch_sdu); @@ -126,13 +127,11 @@ void rx_sdu( break; case CRNTI: - LOG_D(MAC, "[eNB %d] CC_id %d MAC CE_LCID %d (ce %d/%d): Received CRNTI %2.2x%2.2x\n", - enb_mod_idP, CC_idP, rx_ces[i], i,num_ce, payload_ptr[0], payload_ptr[1]); UE_id = find_UE_id(enb_mod_idP,(((uint16_t)payload_ptr[0])<<8) + payload_ptr[1]); - LOG_I(MAC, "[eNB %d] CC_id %d MAC CE_LCID %d : CRNTI %x (UE_id %d) in Msg3\n",enb_mod_idP, CC_idP, rx_ces[i], (((uint16_t)payload_ptr[0])<<8) + payload_ptr[1],UE_id); - + LOG_I(MAC, "[eNB %d] CC_id %d MAC CE_LCID %d (ce %d/%d): CRNTI %x (UE_id %d) in Msg3\n",enb_mod_idP, CC_idP, rx_ces[i], i,num_ce,(((uint16_t)payload_ptr[0])<<8) + payload_ptr[1],UE_id); + crnti_rx=1; payload_ptr+=2; - /* we don't process this CE yet */ + if (msg3_flagP != NULL) { *msg3_flagP = 0; } @@ -146,6 +145,9 @@ void rx_sdu( LOG_D(MAC, "[eNB %d] CC_id %d MAC CE_LCID %d : Received short BSR LCGID = %u bsr = %d\n", enb_mod_idP, CC_idP, rx_ces[i], lcgid, payload_ptr[0] & 0x3f); + if (crnti_rx==1) + LOG_I(MAC, "[eNB %d] CC_id %d MAC CE_LCID %d : Received short BSR LCGID = %u bsr = %d\n", + enb_mod_idP, CC_idP, rx_ces[i], lcgid, payload_ptr[0] & 0x3f); if (UE_id != -1) { UE_list->UE_template[CC_idP][UE_id].bsr_info[lcgid] = (payload_ptr[0] & 0x3f); @@ -177,6 +179,15 @@ void rx_sdu( UE_list->UE_template[CC_idP][UE_id].bsr_info[LCGID1], UE_list->UE_template[CC_idP][UE_id].bsr_info[LCGID2], UE_list->UE_template[CC_idP][UE_id].bsr_info[LCGID3]); + if (crnti_rx==1) + LOG_I(MAC, "[eNB %d] CC_id %d MAC CE_LCID %d: Received long BSR LCGID0 = %u LCGID1 = " + "%u LCGID2 = %u LCGID3 = %u\n", + enb_mod_idP, CC_idP, + rx_ces[i], + UE_list->UE_template[CC_idP][UE_id].bsr_info[LCGID0], + UE_list->UE_template[CC_idP][UE_id].bsr_info[LCGID1], + UE_list->UE_template[CC_idP][UE_id].bsr_info[LCGID2], + UE_list->UE_template[CC_idP][UE_id].bsr_info[LCGID3]); if (UE_list->UE_template[CC_idP][UE_id].bsr_info[LCGID0] == 0 ) { UE_list->UE_template[CC_idP][UE_id].ul_buffer_creation_time[LCGID0]=0; @@ -223,7 +234,7 @@ void rx_sdu( payload_ptr[0],payload_ptr[1],payload_ptr[2],payload_ptr[3],payload_ptr[4], payload_ptr[5], rntiP); for (ii=0; ii<NB_RA_PROC_MAX; ii++) { - LOG_D(MAC,"[eNB %d][RAPROC] CC_id %p Checking proc %d : rnti (%x, %x), active %d\n", + LOG_D(MAC,"[eNB %d][RAPROC] CC_id %d Checking proc %d : rnti (%x, %x), active %d\n", enb_mod_idP, CC_idP, ii, eNB->common_channels[CC_idP].RA_template[ii].rnti, rntiP, eNB->common_channels[CC_idP].RA_template[ii].RA_active); @@ -236,7 +247,7 @@ void rx_sdu( if (UE_id < 0) { memcpy(&eNB->common_channels[CC_idP].RA_template[ii].cont_res_id[0],payload_ptr,6); LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d CCCH: Received Msg3: length %d, offset %d\n", - enb_mod_idP,CC_idP,frameP,rx_lengths[ii],payload_ptr-sduP); + enb_mod_idP,CC_idP,frameP,rx_lengths[i],payload_ptr-sduP); if ((UE_id=add_new_ue(enb_mod_idP,CC_idP,eNB->common_channels[CC_idP].RA_template[ii].rnti,harq_pidP)) == -1 ) { mac_xface->macphy_exit("[MAC][eNB] Max user count reached\n"); @@ -246,7 +257,7 @@ void rx_sdu( enb_mod_idP,CC_idP,frameP,eNB->common_channels[CC_idP].RA_template[ii].rnti,UE_id); } else { LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d CCCH: Received Msg3 from already registered UE %d: length %d, offset %d\n", - enb_mod_idP,CC_idP,frameP,UE_id,rx_lengths[ii],payload_ptr-sduP); + enb_mod_idP,CC_idP,frameP,UE_id,rx_lengths[i],payload_ptr-sduP); // kill RA procedure } @@ -258,7 +269,7 @@ void rx_sdu( rntiP, CCCH, (uint8_t*)payload_ptr, - rx_lengths[ii], + rx_lengths[i], ENB_FLAG_YES, enb_mod_idP, 0); @@ -297,17 +308,17 @@ void rx_sdu( enb_mod_idP,CC_idP,frameP, rx_lengths[i], UE_id, rx_lcids[i]); mac_rlc_data_ind( - enb_mod_idP, - rntiP, - enb_mod_idP, - frameP, - ENB_FLAG_YES, - MBMS_FLAG_NO, - rx_lcids[i], - (char *)payload_ptr, - rx_lengths[i], - 1, - NULL);//(unsigned int*)crc_status); + enb_mod_idP, + rntiP, + enb_mod_idP, + frameP, + ENB_FLAG_YES, + MBMS_FLAG_NO, + rx_lcids[i], + (char *)payload_ptr, + rx_lengths[i], + 1, + NULL);//(unsigned int*)crc_status); UE_list->eNB_UE_stats[CC_idP][UE_id].num_pdu_rx[rx_lcids[i]]+=1; UE_list->eNB_UE_stats[CC_idP][UE_id].num_bytes_rx[rx_lcids[i]]+=rx_lengths[i]; } @@ -596,12 +607,14 @@ unsigned char *parse_ulsch_header(unsigned char *mac_header, } -void schedule_ulsch(module_id_t module_idP, frame_t frameP,unsigned char cooperation_flag,sub_frame_t subframeP, unsigned char sched_subframe, - unsigned int *nCCE) //,int calibration_flag) { -{ +void schedule_ulsch(module_id_t module_idP, + frame_t frameP, + unsigned char cooperation_flag, + sub_frame_t subframeP, + unsigned char sched_subframe) { + - unsigned int nCCE_available[MAX_NUM_CCs]; uint16_t first_rb[MAX_NUM_CCs],i; int CC_id; eNB_MAC_INST *eNB=&eNB_mac_inst[module_idP]; @@ -612,7 +625,6 @@ void schedule_ulsch(module_id_t module_idP, frame_t frameP,unsigned char coopera for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) { first_rb[CC_id] = 1; - nCCE_available[CC_id] = mac_xface->get_nCCE_max(module_idP,CC_id) - nCCE[CC_id]; // UE data info; // check which UE has data to transmit @@ -644,10 +656,10 @@ void schedule_ulsch(module_id_t module_idP, frame_t frameP,unsigned char coopera } - schedule_ulsch_rnti(module_idP, cooperation_flag, frameP, subframeP, sched_subframe, nCCE, nCCE_available, first_rb); + schedule_ulsch_rnti(module_idP, cooperation_flag, frameP, subframeP, sched_subframe,first_rb); #ifdef CBA - schedule_ulsch_cba_rnti(module_idP, cooperation_flag, frameP, subframeP, sched_subframe, nCCE, nCCE_available, first_rb); + schedule_ulsch_cba_rnti(module_idP, cooperation_flag, frameP, subframeP, sched_subframe, first_rb); #endif @@ -662,8 +674,6 @@ void schedule_ulsch_rnti(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP, unsigned char sched_subframe, - unsigned int *nCCE, - unsigned int *nCCE_available, uint16_t *first_rb) { @@ -697,8 +707,7 @@ void schedule_ulsch_rnti(module_id_t module_idP, frameP, subframeP, first_rb, - aggregation, - nCCE); + aggregation); // LOG_I(MAC,"exiting ulsch preprocesor\n"); @@ -729,11 +738,12 @@ void schedule_ulsch_rnti(module_id_t module_idP, continue; // mac_xface->macphy_exit("[MAC][eNB] Cannot find eNB_UE_stats\n"); } - if (nCCE_available[CC_id] < (1<<aggregation)) { - LOG_W(MAC,"[eNB %d] frame %d subframe %d, UE %d CC %d: not enough nCCE (%d)\n", module_idP,frameP,subframeP,UE_id,CC_id,nCCE_available[CC_id]); + if (CCE_allocation_infeasible(module_idP,CC_id,0,subframeP,aggregation,rnti)) { + LOG_W(MAC,"[eNB %d] frame %d subframe %d, UE %d/%x CC %d: not enough nCCE\n", module_idP,frameP,subframeP,UE_id,rnti,CC_id); continue; // break; } + // printf("UE %d/%x is feasible, mode %s\n",UE_id,rnti,mode_string[eNB_UE_stats->mode]); if (eNB_UE_stats->mode == PUSCH) { // ue has a ulsch channel @@ -747,9 +757,10 @@ void schedule_ulsch_rnti(module_id_t module_idP, //should we continue or set harq_pid to 0? continue; } else - LOG_T(MAC,"[eNB %d] Frame %d, subframeP %d, UE %d CC %d : got harq pid %d round %d (nCCE %d, rnti %x,mode %s)\n", - module_idP,frameP,subframeP,UE_id,CC_id, harq_pid, round,nCCE[CC_id],rnti,mode_string[eNB_UE_stats->mode]); + LOG_T(MAC,"[eNB %d] Frame %d, subframeP %d, UE %d CC %d : got harq pid %d round %d (rnti %x,mode %s)\n", + module_idP,frameP,subframeP,UE_id,CC_id, harq_pid, round,rnti,mode_string[eNB_UE_stats->mode]); + //#undef EXMIMO_IOT #ifndef EXMIMO_IOT if (((UE_is_to_be_scheduled(module_idP,CC_id,UE_id)>0)) || (round>0) || ((frameP%10)==0)) @@ -1088,9 +1099,6 @@ void schedule_ulsch_rnti(module_id_t module_idP, subframeP, S_UL_SCHEDULED); - nCCE[CC_id] = nCCE[CC_id] + (1<<aggregation); - nCCE_available[CC_id] = mac_xface->get_nCCE_max(module_idP,CC_id) - nCCE[CC_id]; - LOG_D(MAC,"[eNB %d] CC_id %d Frame %d, subframeP %d: Generated ULSCH DCI for next UE_id %d, format 0\n", module_idP,CC_id,frameP,subframeP,UE_id); #ifdef DEBUG dump_dci(frame_parms, &DCI_pdu->dci_alloc[DCI_pdu->Num_common_dci+DCI_pdu->Num_ue_spec_dci-1]); @@ -1103,8 +1111,7 @@ void schedule_ulsch_rnti(module_id_t module_idP, } #ifdef CBA -void schedule_ulsch_cba_rnti(module_id_t module_idP, unsigned char cooperation_flag, frame_t frameP, sub_frame_t subframeP, unsigned char sched_subframe, unsigned int *nCCE, - unsigned int *nCCE_available, uint16_t *first_rb) +void schedule_ulsch_cba_rnti(module_id_t module_idP, unsigned char cooperation_flag, frame_t frameP, sub_frame_t subframeP, unsigned char sched_subframe, uint16_t *first_rb) { eNB_MAC_INST *eNB = &eNB_mac_inst[module_idP]; @@ -1163,11 +1170,11 @@ void schedule_ulsch_cba_rnti(module_id_t module_idP, unsigned char cooperation_f // cba group template uses the exisitng UE template, and thus if a UE // is scheduled, the correspodning group can't be used for CBA // this can be fixed later - if ((total_groups > 0) && (nCCE[CC_id] == 0)) { + if (total_groups > 0) { DCI_pdu = &eNB_mac_inst[module_idP].common_channels[CC_id].DCI_pdu; for (cba_group=0; - (cba_group<total_groups) && (nCCE_available[CC_id]* (total_cba_resources+1) > (1<<aggregation)); + (cba_group<total_groups) > (1<<aggregation)); cba_group++) { // equal weight //weight[cba_group] = floor(total_UEs/active_groups);//find_num_active_UEs_in_cbagroup(module_idP, cba_group); @@ -1255,13 +1262,6 @@ void schedule_ulsch_cba_rnti(module_id_t module_idP, unsigned char cooperation_f // phase 2 reduce the number of cba allocations among the groups cba_group=0; - while (nCCE[CC_id] + (1<<aggregation) * total_cba_resources >= nCCE_available[CC_id]) { - num_cba_resources[cba_group%total_groups]--; - total_cba_resources--; - // LOG_N(MAC,"reducing num cba resources to %d for group %d \n", num_cba_resources[cba_group%total_groups], cba_group%total_groups ); - cba_group++; - } - if (total_cba_resources <= 0) { return; } @@ -1279,11 +1279,11 @@ void schedule_ulsch_cba_rnti(module_id_t module_idP, unsigned char cooperation_f for (cba_group=0; cba_group<total_groups; cba_group++) { LOG_N(MAC, - "[eNB %d] CC_id %d Frame %d, subframe %d: cba group %d active_ues %d total groups %d mcs %d, available/required rb (%d/%d), num resources %d, ncce (%d/%d required %d \n", + "[eNB %d] CC_id %d Frame %d, subframe %d: cba group %d active_ues %d total groups %d mcs %d, available/required rb (%d/%d), num resources %d, ncce required %d \n", module_idP, CC_id, frameP, subframeP, cba_group,active_UEs[cba_group],total_groups, mcs[cba_group], available_rbs,required_rbs[cba_group], num_cba_resources[cba_group], - nCCE[CC_id],nCCE_available[CC_id],(1<<aggregation) * num_cba_resources[cba_group]); + (1<<aggregation) * num_cba_resources[cba_group]); for (cba_resources=0; cba_resources < num_cba_resources[cba_group]; cba_resources++) { rb_table_index =0; @@ -1309,10 +1309,10 @@ void schedule_ulsch_cba_rnti(module_id_t module_idP, unsigned char cooperation_f first_rb[CC_id]+=rb_table[rb_table_index]; LOG_N(MAC, - "[eNB %d] CC_id %d Frame %d, subframeP %d: schedule CBA access %d rnti %x, total/required/allocated/remaining rbs (%d/%d/%d/%d), mcs %d, rballoc %d, nCCE (%d/%d)\n", + "[eNB %d] CC_id %d Frame %d, subframeP %d: schedule CBA access %d rnti %x, total/required/allocated/remaining rbs (%d/%d/%d/%d), mcs %d, rballoc %d\n", module_idP, CC_id, frameP, subframeP, cba_group,eNB_mac_inst[module_idP].common_channels[CC_id].cba_rnti[cba_group], available_rbs, required_rbs[cba_group], allocated_rbs, remaining_rbs, - mcs[cba_group],rballoc,nCCE_available[CC_id],nCCE[CC_id]); + mcs[cba_group],rballoc); switch (frame_parms->N_RB_UL) { case 6: @@ -1425,8 +1425,6 @@ void schedule_ulsch_cba_rnti(module_id_t module_idP, unsigned char cooperation_f break; } - nCCE[CC_id] = nCCE[CC_id] + (1<<aggregation) ; - nCCE_available[CC_id] = mac_xface->get_nCCE_max(module_idP,CC_id) - nCCE[CC_id]; // break;// for the moment only schedule one } } diff --git a/openair2/LAYER2/MAC/main.c b/openair2/LAYER2/MAC/main.c index 5db78a30c294095f19a9fb0850eba44fca6d8822..0e8a65cf017cf1af7fa6e4158ecd4a47f53e9a27 100644 --- a/openair2/LAYER2/MAC/main.c +++ b/openair2/LAYER2/MAC/main.c @@ -468,6 +468,7 @@ int l2_init(LTE_DL_FRAME_PARMS *frame_parms,int eMBMS_active, char *uecap_xer,ui mac_xface->get_transmission_mode = get_transmission_mode; mac_xface->get_rballoc = get_rballoc; mac_xface->get_nb_rb = conv_nprb; + mac_xface->get_prb = get_prb; // mac_xface->get_SB_size = Get_SB_size; mac_xface->get_subframe_direction = get_subframe_direction; mac_xface->Msg3_transmitted = Msg3_tx; @@ -507,7 +508,7 @@ int l2_init(LTE_DL_FRAME_PARMS *frame_parms,int eMBMS_active, char *uecap_xer,ui mac_xface->computeRIV = computeRIV; mac_xface->get_TBS_DL = get_TBS_DL; mac_xface->get_TBS_UL = get_TBS_UL; - mac_xface->get_nCCE_max = get_nCCE_max; + mac_xface->get_nCCE_max = get_nCCE_mac; mac_xface->get_nCCE_offset = get_nCCE_offset; mac_xface->get_ue_mode = get_ue_mode; mac_xface->phy_config_sib1_eNB = phy_config_sib1_eNB; diff --git a/openair2/LAYER2/MAC/pre_processor.c b/openair2/LAYER2/MAC/pre_processor.c index 5a4caf82c40f98c3afaaadf1d9a96fe8fd7f3e57..410d45441944b2cfd12360b4024f5e1dd9d563a2 100644 --- a/openair2/LAYER2/MAC/pre_processor.c +++ b/openair2/LAYER2/MAC/pre_processor.c @@ -176,6 +176,7 @@ void assign_rbs_required (module_id_t Mod_id, eNB_UE_stats[CC_id]->DL_cqi[0], MIN_CQI_VALUE, MAX_CQI_VALUE); */ eNB_UE_stats[CC_id]->dlsch_mcs1=cqi_to_mcs[eNB_UE_stats[CC_id]->DL_cqi[0]]; + eNB_UE_stats[CC_id]->dlsch_mcs1 = cmin(eNB_UE_stats[CC_id]->dlsch_mcs1,openair_daq_vars.target_ue_dl_mcs); } @@ -729,38 +730,123 @@ void dlsch_scheduler_pre_processor (module_id_t Mod_id, } } +#define SF05_LIMIT 1 void dlsch_scheduler_pre_processor_reset (int module_idP, - int UE_id, - uint8_t CC_id, - int frameP, - int subframeP, - int N_RBG, - uint16_t nb_rbs_required[MAX_NUM_CCs][NUMBER_OF_UE_MAX], - uint16_t nb_rbs_required_remaining[MAX_NUM_CCs][NUMBER_OF_UE_MAX], - unsigned char rballoc_sub[MAX_NUM_CCs][N_RBG_MAX], - unsigned char MIMO_mode_indicator[MAX_NUM_CCs][N_RBG_MAX]) + int UE_id, + uint8_t CC_id, + int frameP, + int subframeP, + int N_RBG, + uint16_t nb_rbs_required[MAX_NUM_CCs][NUMBER_OF_UE_MAX], + uint16_t nb_rbs_required_remaining[MAX_NUM_CCs][NUMBER_OF_UE_MAX], + unsigned char rballoc_sub[MAX_NUM_CCs][N_RBG_MAX], + unsigned char MIMO_mode_indicator[MAX_NUM_CCs][N_RBG_MAX]) + { - int i; + int i,j; UE_list_t *UE_list=&eNB_mac_inst[module_idP].UE_list; UE_sched_ctrl *ue_sched_ctl = &UE_list->UE_sched_ctrl[UE_id]; rnti_t rnti = UE_RNTI(module_idP,UE_id); - + uint8_t *vrb_map = &eNB_mac_inst[module_idP].common_channels[CC_id].vrb_map; + int RBGsize = PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL/N_RBG; +#ifdef SF05_LIMIT + int subframe05_limit=0; + int sf05_upper=-1,sf05_lower=-1; +#endif + LTE_eNB_UE_stats *eNB_UE_stats = mac_xface->get_eNB_UE_stats(module_idP,CC_id,rnti); // initialize harq_pid and round mac_xface->get_ue_active_harq_pid(module_idP,CC_id,rnti, frameP,subframeP, &ue_sched_ctl->harq_pid[CC_id], &ue_sched_ctl->round[CC_id], 0); + if (ue_sched_ctl->ta_timer == 0) { + + // WE SHOULD PROTECT the eNB_UE_stats with a mutex here ... + ue_sched_ctl->ta_timer = 20; // wait 20 subframes before taking TA measurement from PHY + switch (PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL) { + case 6: + ue_sched_ctl->ta_update = eNB_UE_stats->timing_advance_update; + break; + + case 15: + ue_sched_ctl->ta_update = eNB_UE_stats->timing_advance_update/2; + break; + + case 25: + ue_sched_ctl->ta_update = eNB_UE_stats->timing_advance_update/4; + break; + + case 50: + ue_sched_ctl->ta_update = eNB_UE_stats->timing_advance_update/8; + break; + + case 75: + ue_sched_ctl->ta_update = eNB_UE_stats->timing_advance_update/12; + break; + + case 100: + ue_sched_ctl->ta_update = eNB_UE_stats->timing_advance_update/16; + break; + } + // clear the update in case PHY does not have a new measurement after timer expiry + eNB_UE_stats->timing_advance_update = 0; + } + else { + ue_sched_ctl->ta_timer--; + ue_sched_ctl->ta_update =0; // don't trigger a timing advance command + } nb_rbs_required[CC_id][UE_id]=0; ue_sched_ctl->pre_nb_available_rbs[CC_id] = 0; ue_sched_ctl->dl_pow_off[CC_id] = 2; nb_rbs_required_remaining[CC_id][UE_id] = 0; +#ifdef SF05_LIMIT + switch (N_RBG) { + case 6: + sf05_lower=0; + sf05_upper=5; + break; + case 8: + sf05_lower=2; + sf05_upper=5; + break; + case 13: + sf05_lower=4; + sf05_upper=7; + break; + case 17: + sf05_lower=7; + sf05_upper=9; + break; + case 25: + sf05_lower=11; + sf05_upper=13; + break; + } +#endif + // Initialize Subbands according to VRB map for (i=0; i<N_RBG; i++) { ue_sched_ctl->rballoc_sub_UE[CC_id][i] = 0; rballoc_sub[CC_id][i] = 0; +#ifdef SF05_LIMIT + // for avoiding 6+ PRBs around DC in subframe 0-5 (avoid excessive errors) + + if ((subframeP==0 || subframeP==5) && + (i>=sf05_lower && i<=sf05_upper)) + rballoc_sub[CC_id][i]=1; +#endif + // for SI-RNTI,RA-RNTI and P-RNTI allocations + for (j=0;j<RBGsize;j++) { + if (vrb_map[j+(i*RBGsize)]!=0) { + rballoc_sub[CC_id][i] = 1; + LOG_D(MAC,"Frame %d, subframe %d : vrb %d allocated\n",frameP,subframeP,j+(i*RBGsize)); + break; + } + } + LOG_D(MAC,"Frame %d Subframe %d CC_id %d RBG %i : rb_alloc %d\n",frameP,subframeP,CC_id,i,rballoc_sub[CC_id][i]); MIMO_mode_indicator[CC_id][i] = 2; } } @@ -828,8 +914,7 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP, int frameP, sub_frame_t subframeP, uint16_t *first_rb, - uint8_t aggregation, - uint32_t *nCCE) + uint8_t aggregation) { int16_t i; @@ -839,7 +924,6 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP, int16_t total_remaining_rbs[MAX_NUM_CCs]; uint16_t max_num_ue_to_be_scheduled=0,total_ue_count=0; rnti_t rnti= -1; - uint32_t nCCE_to_be_used[MAX_NUM_CCs]; UE_list_t *UE_list = &eNB_mac_inst[module_idP].UE_list; UE_TEMPLATE *UE_template = 0; LTE_DL_FRAME_PARMS *frame_parms = 0; @@ -860,7 +944,6 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP, // we need to distribute RBs among UEs // step1: reset the vars for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) { - nCCE_to_be_used[CC_id]= nCCE[CC_id]; total_allocated_rbs[CC_id]=0; total_remaining_rbs[CC_id]=0; average_rbs_per_user[CC_id]=0; @@ -894,11 +977,13 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP, if (UE_template->pre_allocated_nb_rb_ul > 0) { total_ue_count+=1; } - - if((mac_xface->get_nCCE_max(module_idP,CC_id) - nCCE_to_be_used[CC_id]) > (1<<aggregation)) { + /* + if((mac_xface->get_nCCE_max(module_idP,CC_id,3,subframeP) - nCCE_to_be_used[CC_id]) > (1<<aggregation)) { nCCE_to_be_used[CC_id] = nCCE_to_be_used[CC_id] + (1<<aggregation); max_num_ue_to_be_scheduled+=1; - } + }*/ + + max_num_ue_to_be_scheduled+=1; if (total_ue_count == 0) { average_rbs_per_user[CC_id] = 0; diff --git a/openair2/LAYER2/MAC/proto.h b/openair2/LAYER2/MAC/proto.h index d02e42ee16407b8aff87ffbb3ce098ded65cacf7..9afe098d77fe64df1abc7e66caffb3d762bb5ac4 100644 --- a/openair2/LAYER2/MAC/proto.h +++ b/openair2/LAYER2/MAC/proto.h @@ -47,26 +47,23 @@ void add_ue_spec_dci(DCI_PDU *DCI_pdu,void *pdu,rnti_t rnti,unsigned char dci_si //LG commented cause compilation error for RT eNB extern inline unsigned int taus(void); -/** \fn void schedule_RA(module_id_t module_idP,frame_t frameP,sub_frame_t subframe,uint8_t Msg3_subframe,unsigned int *nprb,unsigned int *nCCE); +/** \fn void schedule_RA(module_id_t module_idP,frame_t frameP,sub_frame_t subframe,uint8_t Msg3_subframe,unsigned int *nprb); \brief First stage of Random-Access Scheduling. Loops over the RA_templates and checks if RAR, Msg3 or its retransmission are to be scheduled in the subframe. It returns the total number of PRB used for RA SDUs. For Msg3 it retrieves the L3msg from RRC and fills the appropriate buffers. For the others it just computes the number of PRBs. Each DCI uses 3 PRBs (format 1A) for the message. @param Mod_id Instance ID of eNB @param frame Frame index @param subframe Subframe number on which to act -@param nprb Pointer to current PRB count -@param nCCE Pointer to current nCCE count + */ -void schedule_RA(module_id_t module_idP,frame_t frameP,sub_frame_t subframe,uint8_t Msg3_subframe,unsigned int *nprb,unsigned int *nCCE); +void schedule_RA(module_id_t module_idP,frame_t frameP,sub_frame_t subframe,uint8_t Msg3_subframe); /** \brief First stage of SI Scheduling. Gets a SI SDU from RRC if available and computes the MCS required to transport it as a function of the SDU length. It assumes a length less than or equal to 64 bytes (MCS 6, 3 PRBs). @param Mod_id Instance ID of eNB @param frame Frame index @param subframe Subframe number on which to act @param Msg3_subframe Subframe where Msg3 will be transmitted -@param nprb Pointer to current PRB count -@param nCCE Pointer to current nCCE count */ -void schedule_SI(module_id_t module_idP,frame_t frameP,unsigned int *nprb,unsigned int *nCCE); +void schedule_SI(module_id_t module_idP,frame_t frameP,sub_frame_t subframeP); /** \brief MBMS scheduling: Checking the position for MBSFN subframes. Create MSI, transfer MCCH from RRC to MAC, transfer MTCHs from RLC to MAC. Multiplexing MSI,MCCH&MTCHs. Return 1 if there are MBSFN data being allocated, otherwise return 0; @param Mod_id Instance ID of eNB @@ -95,49 +92,41 @@ int8_t ue_get_mbsfn_sf_alloction (module_id_t module_idP, uint8_t mbsfn_sync_are @param frame Frame index @param subframe Subframe number on which to act @param sched_subframe Subframe number where PUSCH is transmitted (for DAI lookup) -@param nCCE Pointer to current nCCE count */ -void schedule_ulsch(module_id_t module_idP,frame_t frameP,unsigned char cooperation_flag,sub_frame_t subframe,unsigned char sched_subframe,unsigned int *nCCE); +void schedule_ulsch(module_id_t module_idP,frame_t frameP,unsigned char cooperation_flag,sub_frame_t subframe,unsigned char sched_subframe); /** \brief ULSCH Scheduling per RNTI @param Mod_id Instance ID of eNB @param frame Frame index @param subframe Subframe number on which to act @param sched_subframe Subframe number where PUSCH is transmitted (for DAI lookup) -@param nCCE Pointer to current nCCE count */ -void schedule_ulsch_rnti(module_id_t module_idP, unsigned char cooperation_flag, frame_t frameP, sub_frame_t subframe, unsigned char sched_subframe, unsigned int *nCCE, unsigned int *nCCE_available, - uint16_t *first_rb); +void schedule_ulsch_rnti(module_id_t module_idP, unsigned char cooperation_flag, frame_t frameP, sub_frame_t subframe, unsigned char sched_subframe, uint16_t *first_rb); /** \brief ULSCH Scheduling for CBA RNTI @param Mod_id Instance ID of eNB @param frame Frame index @param subframe Subframe number on which to act @param sched_subframe Subframe number where PUSCH is transmitted (for DAI lookup) -@param nCCE Pointer to current nCCE count */ -void schedule_ulsch_cba_rnti(module_id_t module_idP, unsigned char cooperation_flag, frame_t frameP, sub_frame_t subframe, unsigned char sched_subframe, unsigned int *nCCE, - unsigned int *nCCE_available, uint16_t *first_rb); +void schedule_ulsch_cba_rnti(module_id_t module_idP, unsigned char cooperation_flag, frame_t frameP, sub_frame_t subframe, unsigned char sched_subframe, uint16_t *first_rb); /** \brief Second stage of DLSCH scheduling, after schedule_SI, schedule_RA and schedule_dlsch have been called. This routine first allocates random frequency assignments for SI and RA SDUs using distributed VRB allocations and adds the corresponding DCI SDU to the DCI buffer for PHY. It then loops over the UE specific DCIs previously allocated and fills in the remaining DCI fields related to frequency allocation. It assumes localized allocation of type 0 (DCI.rah=0). The allocation is done for tranmission modes 1,2,4. @param Mod_id Instance of eNB @param frame Frame index @param subframe Index of subframe -@param rballoc Bitmask for allowable subband allocations -@param RA_scheduled RA was scheduled in this subframe @param mbsfn_flag Indicates that this subframe is for MCH/MCCH */ -void fill_DLSCH_dci(module_id_t module_idP,frame_t frameP,sub_frame_t subframe,uint32_t *rballoc,uint8_t RA_scheduled,int *mbsfn_flag); +void fill_DLSCH_dci(module_id_t module_idP,frame_t frameP,sub_frame_t subframe,int *mbsfn_flag); /** \brief UE specific DLSCH scheduling. Retrieves next ue to be schduled from round-robin scheduler and gets the appropriate harq_pid for the subframe from PHY. If the process is active and requires a retransmission, it schedules the retransmission with the same PRB count and MCS as the first transmission. Otherwise it consults RLC for DCCH/DTCH SDUs (status with maximum number of available PRBS), builds the MAC header (timing advance sent by default) and copies @param Mod_id Instance ID of eNB @param frame Frame index @param subframe Subframe on which to act -@param nb_rb_used0 Number of PRB used by SI/RA -@param nCCE_used Number of CCE used by SI/RA + @param mbsfn_flag Indicates that MCH/MCCH is in this subframe */ -void schedule_ue_spec(module_id_t module_idP,frame_t frameP,sub_frame_t subframe,unsigned int *nb_rb_used0,unsigned int *nCCE_used,int *mbsfn_flag); +void schedule_ue_spec(module_id_t module_idP,frame_t frameP,sub_frame_t subframe,int *mbsfn_flag); /** \brief Function for UE/PHY to compute PUSCH transmit power in power-control procedure. @param Mod_id Module id of UE @@ -312,6 +301,27 @@ uint8_t process_ue_cqi (module_id_t module_idP, int UE_id); int8_t find_active_UEs_with_traffic(module_id_t module_idP); +void init_CCE_table(int module_idP,int CC_idP); + +int get_nCCE_offset(int *CCE_table, + const unsigned char L, + const int nCCE, + const int common_dci, + const unsigned short rnti, + const unsigned char subframe); + +int allocate_CCEs(int module_idP, + int CC_idP, + int subframe, + int test_only); + +boolean_t CCE_allocation_infeasible(int module_idP, + int CC_idP, + int common_flag, + int subframe, + int aggregation, + int rnti); + void set_ue_dai(sub_frame_t subframeP, uint8_t tdd_config, int UE_id, @@ -492,7 +502,7 @@ int UE_PCCID(module_id_t mod_idP,int ue_idP); rnti_t UE_RNTI(module_id_t mod_idP, int ue_idP); -void ulsch_scheduler_pre_processor(module_id_t module_idP, int frameP, sub_frame_t subframeP, uint16_t *first_rb, uint8_t aggregattion, uint32_t *nCCE); +void ulsch_scheduler_pre_processor(module_id_t module_idP, int frameP, sub_frame_t subframeP, uint16_t *first_rb, uint8_t aggregattion); void store_ulsch_buffer(module_id_t module_idP, int frameP, sub_frame_t subframeP); void sort_ue_ul (module_id_t module_idP,int frameP, sub_frame_t subframeP); void assign_max_mcs_min_rb(module_id_t module_idP,int frameP, sub_frame_t subframeP,uint16_t *first_rb); diff --git a/openair2/LAYER2/RLC/rlc.h b/openair2/LAYER2/RLC/rlc.h index 392ae88cf8577c94dbf639c6b2c726e02432d5b8..72fde0b7468bedf9d4c0bebe9db80d5974c6d531 100755 --- a/openair2/LAYER2/RLC/rlc.h +++ b/openair2/LAYER2/RLC/rlc.h @@ -60,6 +60,8 @@ # include "DRB-ToAddModList.h" # include "SRB-ToAddMod.h" # include "SRB-ToAddModList.h" +# include "DRB-ToReleaseList.h" + #ifdef Rel10 #include "PMCH-InfoList-r9.h" #endif diff --git a/openair2/PHY_INTERFACE/defs.h b/openair2/PHY_INTERFACE/defs.h index 20acba99e436dbc02d0006fa6f062c42cbcaad4c..7b0367f53791c0481d7af34aca2ce86c1b1e7ca4 100755 --- a/openair2/PHY_INTERFACE/defs.h +++ b/openair2/PHY_INTERFACE/defs.h @@ -238,14 +238,17 @@ typedef struct { int (*get_ue_active_harq_pid)(module_id_t Mod_id, uint8_t CC_id,rnti_t rnti, int frame, uint8_t subframe, uint8_t *harq_pid, uint8_t *round, uint8_t ul_flag); /// Function to retrieve number of CCE - uint16_t (*get_nCCE_max)(module_id_t Mod_id,uint8_t CC_id); + uint16_t (*get_nCCE_max)(module_id_t Mod_id,uint8_t CC_id,int num_pdcch_symbols,int subframe); + - /// Function to get the CCE offset int (*get_nCCE_offset)(unsigned char L, int nCCE, int common_dci, unsigned short rnti, unsigned char subframe); /// Function to retrieve number of PRB in an rb_alloc uint32_t (*get_nb_rb)(uint8_t ra_header, uint32_t rb_alloc, int n_rb_dl); + /// Function to convert VRB to PRB for distributed allocation + int (*get_prb)(int N_RB_DL,int odd_slot,int vrb,int Ngap); + /// Function to retrieve transmission mode for UE uint8_t (*get_transmission_mode)(module_id_t Mod_id,uint8_t CC_id,rnti_t rnti); @@ -312,8 +315,9 @@ typedef struct { /// get the delta TF for Uplink Power Control Calculation int16_t (*get_hundred_times_delta_TF) (module_id_t module_idP, uint8_t CC_id, rnti_t rnti, uint8_t harq_pid); - /// get target uplink received power + /// get target PUSCH received power int16_t (*get_target_pusch_rx_power) (module_id_t module_idP, uint8_t CC_id); + /// get target PUSCH received power int16_t (*get_target_pucch_rx_power) (module_id_t module_idP, uint8_t CC_id); unsigned char is_cluster_head; diff --git a/openair2/RRC/LITE/MESSAGES/asn1_msg.c b/openair2/RRC/LITE/MESSAGES/asn1_msg.c index 110dc6442da1e98b1d368f901f843b12f6363485..ff0adf713b04e4dd8edeb4cd878b51bba89f4b75 100644 --- a/openair2/RRC/LITE/MESSAGES/asn1_msg.c +++ b/openair2/RRC/LITE/MESSAGES/asn1_msg.c @@ -2110,6 +2110,67 @@ do_RRCConnectionReestablishmentReject( return((enc_rval.encoded+7)/8); } +//------------------------------------------------------------------------------ +uint8_t +do_RRCConnectionReject( + uint8_t Mod_id, + uint8_t* const buffer) +//------------------------------------------------------------------------------ +{ + + asn_enc_rval_t enc_rval; + + DL_CCCH_Message_t dl_ccch_msg; + RRCConnectionReject_t *rrcConnectionReject; + + memset((void *)&dl_ccch_msg,0,sizeof(DL_CCCH_Message_t)); + dl_ccch_msg.message.present = DL_CCCH_MessageType_PR_c1; + dl_ccch_msg.message.choice.c1.present = DL_CCCH_MessageType__c1_PR_rrcConnectionReject; + rrcConnectionReject = &dl_ccch_msg.message.choice.c1.choice.rrcConnectionReject; + + // RRCConnectionReject + rrcConnectionReject->criticalExtensions.present = RRCConnectionReject__criticalExtensions_PR_c1; + rrcConnectionReject->criticalExtensions.choice.c1.present = RRCConnectionReject__criticalExtensions__c1_PR_rrcConnectionReject_r8; + /* let's put a wait time of 1s for the moment */ + rrcConnectionReject->criticalExtensions.choice.c1.choice.rrcConnectionReject_r8.waitTime = 1; + +#ifdef XER_PRINT + xer_fprint(stdout, &asn_DEF_DL_CCCH_Message, (void*)&dl_ccch_msg); +#endif + enc_rval = uper_encode_to_buffer(&asn_DEF_DL_CCCH_Message, + (void*)&dl_ccch_msg, + buffer, + 100); + AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %ld)!\n", + enc_rval.failed_type->name, enc_rval.encoded); + +#if defined(ENABLE_ITTI) +# if !defined(DISABLE_XER_SPRINT) + { + char message_string[20000]; + size_t message_string_size; + + if ((message_string_size = xer_sprint(message_string, sizeof(message_string), &asn_DEF_DL_CCCH_Message, (void *) &dl_ccch_msg)) > 0) { + MessageDef *msg_p; + + msg_p = itti_alloc_new_message_sized (TASK_RRC_ENB, RRC_DL_CCCH, message_string_size + sizeof (IttiMsgText)); + msg_p->ittiMsg.rrc_dl_ccch.size = message_string_size; + memcpy(&msg_p->ittiMsg.rrc_dl_ccch.text, message_string, message_string_size); + + itti_send_msg_to_task(TASK_UNKNOWN, Mod_id, msg_p); + } + } +# endif +#endif + +#ifdef USER_MODE + LOG_D(RRC,"RRCConnectionReject Encoded %d bits (%d bytes)\n", + enc_rval.encoded,(enc_rval.encoded+7)/8); +#endif + + return((enc_rval.encoded+7)/8); +} + uint8_t do_RRCConnectionRelease( uint8_t Mod_id, uint8_t *buffer, diff --git a/openair2/RRC/LITE/MESSAGES/asn1_msg.h b/openair2/RRC/LITE/MESSAGES/asn1_msg.h index b5747cb94bc28d908bc9ab2c321246207535c070..9c5e72293a931ed70e738373867b67f538fe437a 100644 --- a/openair2/RRC/LITE/MESSAGES/asn1_msg.h +++ b/openair2/RRC/LITE/MESSAGES/asn1_msg.h @@ -218,6 +218,16 @@ do_RRCConnectionReestablishmentReject( uint8_t Mod_id, uint8_t* const buffer); +/** +\brief Generate an RRCConnectionReject DL-CCCH-Message (eNB). +@param Mod_id Module ID of eNB +@param buffer Pointer to PER-encoded ASN.1 description of DL-CCCH-Message PDU +@returns Size of encoded bit stream in bytes*/ +uint8_t +do_RRCConnectionReject( + uint8_t Mod_id, + uint8_t* const buffer); + /** \brief Generate an RRCConnectionRequest UL-CCCH-Message (UE) based on random string or S-TMSI. This routine only generates an mo-data establishment cause. diff --git a/openair2/RRC/LITE/defs.h b/openair2/RRC/LITE/defs.h index bae3dc887a7adfe1cfc5163d420a7b00d0f9dc48..78240de082602525457b5e49ca5118dadefbc47f 100644 --- a/openair2/RRC/LITE/defs.h +++ b/openair2/RRC/LITE/defs.h @@ -212,9 +212,9 @@ typedef struct UE_RRC_INFO_s { } __attribute__ ((__packed__)) UE_RRC_INFO; typedef struct UE_S_TMSI_s { - uint8_t presence; - uint8_t mme_code; - uint32_t m_tmsi; + boolean_t presence; + mme_code_t mme_code; + m_tmsi_t m_tmsi; } __attribute__ ((__packed__)) UE_S_TMSI; #if defined(ENABLE_ITTI) diff --git a/openair2/RRC/LITE/rrc_eNB.c b/openair2/RRC/LITE/rrc_eNB.c index f19c3bced4b9d9d7796b520a8de0a8fed4b87d74..1d0b5f290256d4fd3a095cd93271b702c2c8e817 100644 --- a/openair2/RRC/LITE/rrc_eNB.c +++ b/openair2/RRC/LITE/rrc_eNB.c @@ -540,8 +540,8 @@ rrc_eNB_get_next_transaction_identifier( //----------------------------------------------------------------------------- -// return 1 if there is already an UE with ue_identityP, 0 otherwise -static int +// return the ue context if there is already an UE with ue_identityP, NULL otherwise +static struct rrc_eNB_ue_context_s* rrc_eNB_ue_context_random_exist( const protocol_ctxt_t* const ctxt_pP, const uint64_t ue_identityP @@ -551,9 +551,28 @@ rrc_eNB_ue_context_random_exist( struct rrc_eNB_ue_context_s* ue_context_p = NULL; RB_FOREACH(ue_context_p, rrc_ue_tree_s, &(eNB_rrc_inst[ctxt_pP->module_id].rrc_ue_head)) { if (ue_context_p->ue_context.random_ue_identity == ue_identityP) - return 1; + return ue_context_p; } - return 0; + return NULL; +} +//----------------------------------------------------------------------------- +// return the ue context if there is already an UE with the same S-TMSI(MMEC+M-TMSI), NULL otherwise +static struct rrc_eNB_ue_context_s* +rrc_eNB_ue_context_stmsi_exist( + const protocol_ctxt_t* const ctxt_pP, + const mme_code_t mme_codeP, + const m_tmsi_t m_tmsiP +) +//----------------------------------------------------------------------------- +{ + struct rrc_eNB_ue_context_s* ue_context_p = NULL; + RB_FOREACH(ue_context_p, rrc_ue_tree_s, &(eNB_rrc_inst[ctxt_pP->module_id].rrc_ue_head)) { + if (ue_context_p->ue_context.Initialue_identity_s_TMSI.presence == TRUE) + if (ue_context_p->ue_context.Initialue_identity_s_TMSI.m_tmsi == m_tmsiP) + if (ue_context_p->ue_context.Initialue_identity_s_TMSI.mme_code == mme_codeP) + return ue_context_p; + } + return NULL; } //----------------------------------------------------------------------------- @@ -963,6 +982,49 @@ rrc_eNB_generate_UECapabilityEnquiry( } +//----------------------------------------------------------------------------- +void +rrc_eNB_generate_RRCConnectionReject( + const protocol_ctxt_t* const ctxt_pP, + rrc_eNB_ue_context_t* const ue_context_pP, + const int CC_id +) +//----------------------------------------------------------------------------- +{ +#ifdef RRC_MSG_PRINT + int cnt; +#endif + + eNB_rrc_inst[ctxt_pP->module_id].carrier[CC_id].Srb0.Tx_buffer.payload_size = + do_RRCConnectionReject(ctxt_pP->module_id, + (uint8_t*) eNB_rrc_inst[ctxt_pP->module_id].carrier[CC_id].Srb0.Tx_buffer.Payload); + +#ifdef RRC_MSG_PRINT + LOG_F(RRC,"[MSG] RRCConnectionReject\n"); + + for (cnt = 0; cnt < eNB_rrc_inst[ctxt_pP->module_id].carrier[CC_id].Srb0.Tx_buffer.payload_size; cnt++) { + LOG_F(RRC,"%02x ", ((uint8_t*)eNB_rrc_inst[ctxt_pP->module_id].Srb0.Tx_buffer.Payload)[cnt]); + } + + LOG_F(RRC,"\n"); +#endif + + MSC_LOG_TX_MESSAGE( + MSC_RRC_ENB, + MSC_RRC_UE, + eNB_rrc_inst[ctxt_pP->module_id].carrier[CC_id].Srb0.Tx_buffer.Header, + eNB_rrc_inst[ctxt_pP->module_id].carrier[CC_id].Srb0.Tx_buffer.payload_size, + MSC_AS_TIME_FMT" RRCConnectionReject UE %x size %u", + MSC_AS_TIME_ARGS(ctxt_pP), + ue_context_pP == NULL ? -1 : ue_context_pP->ue_context.rnti, + eNB_rrc_inst[ctxt_pP->module_id].carrier[CC_id].Srb0.Tx_buffer.payload_size); + + LOG_I(RRC, + PROTOCOL_RRC_CTXT_UE_FMT" [RAPROC] Logical Channel DL-CCCH, Generating RRCConnectionReject (bytes %d)\n", + PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP), + eNB_rrc_inst[ctxt_pP->module_id].carrier[CC_id].Srb0.Tx_buffer.payload_size); +} + //----------------------------------------------------------------------------- void rrc_eNB_generate_RRCConnectionReestablishmentReject( @@ -3627,47 +3689,41 @@ rrc_eNB_decode_ccch( } else { rrcConnectionRequest = &ul_ccch_msg->message.choice.c1.choice.rrcConnectionRequest.criticalExtensions.choice.rrcConnectionRequest_r8; { - AssertFatal(rrcConnectionRequest->ue_Identity.present == InitialUE_Identity_PR_randomValue, - "unsupported InitialUE-Identity in RRCConnectionRequest"); - AssertFatal(rrcConnectionRequest->ue_Identity.choice.randomValue.size == 5, - "wrong InitialUE-Identity randomValue size, expected 5, provided %d", - rrcConnectionRequest->ue_Identity.choice.randomValue.size); - memcpy(((uint8_t*) & random_value) + 3, - rrcConnectionRequest->ue_Identity.choice.randomValue.buf, - rrcConnectionRequest->ue_Identity.choice.randomValue.size); - /* if there is already a registered UE (with another RNTI) with this random_value, - * the current one must be removed from MAC/PHY (zombie UE) - */ - if (rrc_eNB_ue_context_random_exist(ctxt_pP, random_value)) { - AssertFatal(0 == 1, "TODO: remove UE fro MAC/PHY (how?)"); - ue_context_p = NULL; - } else { - ue_context_p = rrc_eNB_get_next_free_ue_context(ctxt_pP, random_value); - } - } - LOG_D(RRC, - PROTOCOL_RRC_CTXT_UE_FMT" UE context: %X\n", - PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP), - ue_context_p); - - if (ue_context_p != NULL) { - - -#if defined(ENABLE_ITTI) - /* Check s-TMSI presence in message */ - ue_context_p->ue_context.Initialue_identity_s_TMSI.presence = - (rrcConnectionRequest->ue_Identity.present == InitialUE_Identity_PR_s_TMSI); - - if (ue_context_p->ue_context.Initialue_identity_s_TMSI.presence) { + if (InitialUE_Identity_PR_randomValue == rrcConnectionRequest->ue_Identity.present) { + AssertFatal(rrcConnectionRequest->ue_Identity.choice.randomValue.size == 5, + "wrong InitialUE-Identity randomValue size, expected 5, provided %d", + rrcConnectionRequest->ue_Identity.choice.randomValue.size); + memcpy(((uint8_t*) & random_value) + 3, + rrcConnectionRequest->ue_Identity.choice.randomValue.buf, + rrcConnectionRequest->ue_Identity.choice.randomValue.size); + /* if there is already a registered UE (with another RNTI) with this random_value, + * the current one must be removed from MAC/PHY (zombie UE) + */ + if ((ue_context_p = rrc_eNB_ue_context_random_exist(ctxt_pP, random_value))) { +#warning "TODO: random_exist: remove UE from MAC/PHY (how?)" + // AssertFatal(0 == 1, "TODO: remove UE from MAC/PHY (how?)"); + ue_context_p = NULL; + } else { + ue_context_p = rrc_eNB_get_next_free_ue_context(ctxt_pP, random_value); + } + } else if (InitialUE_Identity_PR_s_TMSI == rrcConnectionRequest->ue_Identity.present) { /* Save s-TMSI */ - S_TMSI_t s_TMSI = rrcConnectionRequest->ue_Identity.choice.s_TMSI; - - ue_context_p->ue_context.Initialue_identity_s_TMSI.mme_code = - BIT_STRING_to_uint8(&s_TMSI.mmec); - ue_context_p->ue_context.Initialue_identity_s_TMSI.m_tmsi = - BIT_STRING_to_uint32(&s_TMSI.m_TMSI); - - MSC_LOG_RX_DISCARDED_MESSAGE( + S_TMSI_t s_TMSI = rrcConnectionRequest->ue_Identity.choice.s_TMSI; + mme_code_t mme_code = BIT_STRING_to_uint8(&s_TMSI.mmec); + m_tmsi_t m_tmsi = BIT_STRING_to_uint32(&s_TMSI.m_TMSI); + random_value = (((uint64_t)mme_code) << 32) | m_tmsi; + if ((ue_context_p = rrc_eNB_ue_context_stmsi_exist(ctxt_pP, mme_code, m_tmsi))) { +#warning "TODO: stmsi_exist: remove UE from MAC/PHY (how?)" + // AssertFatal(0 == 1, "TODO: remove UE from MAC/PHY (how?)"); + ue_context_p = NULL; + } else { + ue_context_p = rrc_eNB_get_next_free_ue_context(ctxt_pP, NOT_A_RANDOM_UE_IDENTITY); + } + ue_context_p->ue_context.Initialue_identity_s_TMSI.presence = TRUE; + ue_context_p->ue_context.Initialue_identity_s_TMSI.mme_code = mme_code; + ue_context_p->ue_context.Initialue_identity_s_TMSI.m_tmsi = m_tmsi; + + MSC_LOG_RX_MESSAGE( MSC_RRC_ENB, MSC_RRC_UE, Srb_info->Rx_buffer.Payload, @@ -3676,25 +3732,30 @@ rrc_eNB_decode_ccch( MSC_AS_TIME_ARGS(ctxt_pP), ue_context_p->ue_context.rnti, dec_rval.consumed, - s_TMSI.mmec, - s_TMSI.m_TMSI, + ue_context_p->ue_context.Initialue_identity_s_TMSI.mme_code, + ue_context_p->ue_context.Initialue_identity_s_TMSI.m_tmsi, ue_context_p->ue_context.random_ue_identity); - } else { - MSC_LOG_RX_DISCARDED_MESSAGE( - MSC_RRC_ENB, - MSC_RRC_UE, - Srb_info->Rx_buffer.Payload, - dec_rval.consumed, - MSC_AS_TIME_FMT" RRCConnectionRequest UE %x size %u random UE id (0x%" PRIx64 ")", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_p->ue_context.rnti, - dec_rval.consumed, - ue_context_p->ue_context.random_ue_identity); + LOG_E(RRC, + PROTOCOL_RRC_CTXT_UE_FMT" RRCConnectionRequest without random UE identity or S-TMSI not supported, let's reject the UE\n", + PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP)); + rrc_eNB_generate_RRCConnectionReject(ctxt_pP, + rrc_eNB_get_ue_context(&eNB_rrc_inst[ctxt_pP->module_id], ctxt_pP->rnti), + CC_id); + break; } - ue_context_p->ue_context.establishment_cause = - rrcConnectionRequest->establishmentCause; + } + LOG_D(RRC, + PROTOCOL_RRC_CTXT_UE_FMT" UE context: %X\n", + PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP), + ue_context_p); + + if (ue_context_p != NULL) { + + +#if defined(ENABLE_ITTI) + ue_context_p->ue_context.establishment_cause = rrcConnectionRequest->establishmentCause; LOG_I(RRC, PROTOCOL_RRC_CTXT_UE_FMT" Accept new connection from UE random UE identity (0x%" PRIx64 ") MME code %u TMSI %u cause %u\n", PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP), ue_context_p->ue_context.random_ue_identity, diff --git a/openair2/RRC/LITE/rrc_eNB_S1AP.c b/openair2/RRC/LITE/rrc_eNB_S1AP.c index 5c41658862149af84f0fd0a5ab48ed3a4070264d..d93b8eea2fd39d62c0705915eb565acc3b3134db 100644 --- a/openair2/RRC/LITE/rrc_eNB_S1AP.c +++ b/openair2/RRC/LITE/rrc_eNB_S1AP.c @@ -43,6 +43,7 @@ # include "RRC/LITE/defs.h" # include "rrc_eNB_UE_context.h" # include "rrc_eNB_S1AP.h" +# include "enb_config.h" # if defined(ENABLE_ITTI) # include "asn1_conversions.h" @@ -661,15 +662,16 @@ rrc_eNB_send_S1AP_NAS_FIRST_REQ( S1AP_NAS_FIRST_REQ (message_p).ue_identity.s_tmsi.mme_code = s_TMSI->mme_code; S1AP_NAS_FIRST_REQ (message_p).ue_identity.s_tmsi.m_tmsi = s_TMSI->m_tmsi; LOG_I(S1AP, "[eNB %d] Build S1AP_NAS_FIRST_REQ with s_TMSI: MME code %u M-TMSI %u ue %x\n", - ctxt_pP->module_id, - S1AP_NAS_FIRST_REQ (message_p).ue_identity.s_tmsi.mme_code, - S1AP_NAS_FIRST_REQ (message_p).ue_identity.s_tmsi.m_tmsi, - ue_context_pP->ue_context.rnti); + ctxt_pP->module_id, + S1AP_NAS_FIRST_REQ (message_p).ue_identity.s_tmsi.mme_code, + S1AP_NAS_FIRST_REQ (message_p).ue_identity.s_tmsi.m_tmsi, + ue_context_pP->ue_context.rnti); } if (rrcConnectionSetupComplete->registeredMME != NULL) { /* Fill GUMMEI */ struct RegisteredMME *r_mme = rrcConnectionSetupComplete->registeredMME; + int selected_plmn_identity = rrcConnectionSetupComplete->selectedPLMN_Identity; S1AP_NAS_FIRST_REQ (message_p).ue_identity.presenceMask |= UE_IDENTITIES_gummei; @@ -678,9 +680,9 @@ rrc_eNB_send_S1AP_NAS_FIRST_REQ( /* Use first indicated PLMN MCC if it is defined */ S1AP_NAS_FIRST_REQ (message_p).ue_identity.gummei.mcc = *r_mme->plmn_Identity->mcc->list.array[0]; LOG_I(S1AP, "[eNB %d] Build S1AP_NAS_FIRST_REQ adding in s_TMSI: GUMMEI MCC %u ue %x\n", - ctxt_pP->module_id, - S1AP_NAS_FIRST_REQ (message_p).ue_identity.gummei.mcc, - ue_context_pP->ue_context.rnti); + ctxt_pP->module_id, + S1AP_NAS_FIRST_REQ (message_p).ue_identity.gummei.mcc, + ue_context_pP->ue_context.rnti); } if (r_mme->plmn_Identity->mnc.list.count > 0) { @@ -691,6 +693,14 @@ rrc_eNB_send_S1AP_NAS_FIRST_REQ( S1AP_NAS_FIRST_REQ (message_p).ue_identity.gummei.mnc, ue_context_pP->ue_context.rnti); } + } else { + const Enb_properties_array_t *enb_properties_p = NULL; + enb_properties_p = enb_config_get(); + + // actually the eNB configuration contains only one PLMN (can be up to 6) + S1AP_NAS_FIRST_REQ (message_p).ue_identity.gummei.mcc = enb_properties_p->properties[ctxt_pP->module_id]->mcc; + S1AP_NAS_FIRST_REQ (message_p).ue_identity.gummei.mnc = enb_properties_p->properties[ctxt_pP->module_id]->mnc; + S1AP_NAS_FIRST_REQ (message_p).ue_identity.gummei.mnc_len = enb_properties_p->properties[ctxt_pP->module_id]->mnc_digit_length; } S1AP_NAS_FIRST_REQ (message_p).ue_identity.gummei.mme_code = BIT_STRING_to_uint8 (&r_mme->mmec); @@ -1178,7 +1188,7 @@ int rrc_eNB_process_S1AP_UE_CONTEXT_RELEASE_COMMAND (MessageDef *msg_p, const ch GTPV1U_ENB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p).rnti = ue_context_p->ue_context.rnti; for (e_rab = 0; e_rab < ue_context_p->ue_context.nb_of_e_rabs; e_rab++) { - GTPV1U_ENB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p).eps_bearer_id[GTPV1U_ENB_DELETE_TUNNEL_REQ(msg_p).num_erab++] = + GTPV1U_ENB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p).eps_bearer_id[GTPV1U_ENB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p).num_erab++] = ue_context_p->ue_context.enb_gtp_ebi[e_rab]; // erase data ue_context_p->ue_context.enb_gtp_teid[e_rab] = 0; diff --git a/openair2/UTIL/LOG/vcd_signal_dumper.c b/openair2/UTIL/LOG/vcd_signal_dumper.c index 8dfbfd6ef5cb9d9d666a9c4e09591fa164fbee3f..31ce2e0d71078bd4d12586db7a27ba861a61a6d9 100644 --- a/openair2/UTIL/LOG/vcd_signal_dumper.c +++ b/openair2/UTIL/LOG/vcd_signal_dumper.c @@ -106,6 +106,9 @@ const char* eurecomVariablesNames[] = { "lhw_cnt_tx", "pck_rx", "pck_tx", + "rx_seq_num", + "rx_seq_num_prv", + "tx_seq_num", "cnt", "dummy_dump", "itti_send_msg", diff --git a/openair2/UTIL/LOG/vcd_signal_dumper.h b/openair2/UTIL/LOG/vcd_signal_dumper.h index 68257484f0a1c141d3f1a2392f157d729b09d3f9..9ca55846fd2aef75d3da598dbdd4f250a6591db6 100644 --- a/openair2/UTIL/LOG/vcd_signal_dumper.h +++ b/openair2/UTIL/LOG/vcd_signal_dumper.h @@ -78,6 +78,9 @@ typedef enum { VCD_SIGNAL_DUMPER_VARIABLES_TX_LHWCNT, VCD_SIGNAL_DUMPER_VARIABLES_RX_PCK, VCD_SIGNAL_DUMPER_VARIABLES_TX_PCK, + VCD_SIGNAL_DUMPER_VARIABLES_RX_SEQ_NUM, + VCD_SIGNAL_DUMPER_VARIABLES_RX_SEQ_NUM_PRV, + VCD_SIGNAL_DUMPER_VARIABLES_TX_SEQ_NUM, VCD_SIGNAL_DUMPER_VARIABLES_CNT, VCD_SIGNAL_DUMPER_VARIABLES_DUMMY_DUMP, VCD_SIGNAL_DUMPER_VARIABLE_ITTI_SEND_MSG, diff --git a/openair2/UTIL/OCG/OCG_parse_XML.c b/openair2/UTIL/OCG/OCG_parse_XML.c index 5397cdbd98bab4ca67369cb812d5c8ab689aefe9..0100d742e1b03ce09c70901cae364cfac06d50d3 100644 --- a/openair2/UTIL/OCG/OCG_parse_XML.c +++ b/openair2/UTIL/OCG/OCG_parse_XML.c @@ -51,10 +51,6 @@ #include "UTIL/OPT/opt.h" /*----------------------------------------------------------------------------*/ -#ifndef HAVE_STRNDUP -char * strndup (const char *s, size_t size); -#endif - static int oai_emulation_; /*!< \brief indicating that the parsing position is now within OAI_Emulation_*/ static int environment_system_config_; /*!< \brief indicating that the parsing position is now within Envi_Config_*/ diff --git a/targets/ARCH/BLADERF/USERSPACE/LIB/bladerf_lib.c b/targets/ARCH/BLADERF/USERSPACE/LIB/bladerf_lib.c index d515a206ae8e0683ff5ba4529107fe6fbb0b6f5a..065b0bbad2143b50618ffeaa03aa0cf09fd10da6 100644 --- a/targets/ARCH/BLADERF/USERSPACE/LIB/bladerf_lib.c +++ b/targets/ARCH/BLADERF/USERSPACE/LIB/bladerf_lib.c @@ -38,57 +38,96 @@ #include <inttypes.h> #include "bladerf_lib.h" +/** @addtogroup _BLADERF_PHY_RF_INTERFACE_ + * @{ + */ + +//! Number of BladeRF devices +#ifdef __SSE4_1__ +# include <smmintrin.h> +#endif + +#ifdef __AVX2__ +# include <immintrin.h> +#endif + int num_devices=0; + /*These items configure the underlying asynch stream used by the the sync interface. */ -int trx_brf_init(openair0_device *openair0) { +/*! \brief BladeRF Init function (not used at the moment) + * \param device RF frontend parameters set by application + */ +int trx_brf_init(openair0_device *device) { } +/*! \brief get current timestamp + *\param device the hardware to use + *\param module the bladeRf module + */ -openair0_timestamp trx_get_timestamp(openair0_device *device) { +openair0_timestamp trx_get_timestamp(openair0_device *device, bladerf_module module) { int status; struct bladerf_metadata meta; brf_state_t *brf = (brf_state_t*)device->priv; + memset(&meta, 0, sizeof(meta)); - if ((status=bladerf_get_timestamp(brf->dev, BLADERF_MODULE_TX, &meta.timestamp)) != 0) { - fprintf(stderr,"Failed to get current RX timestamp: %s\n",bladerf_strerror(status)); - } else { - printf("Current TX timestampe 0x%016"PRIx64"\n", meta.timestamp); - } + if ((status=bladerf_get_timestamp(brf->dev, module, &meta.timestamp)) != 0) { + fprintf(stderr,"Failed to get current %s timestamp: %s\n",(module == BLADERF_MODULE_RX ) ? "RX" : "TX", bladerf_strerror(status)); + return -1; + } // else {printf("Current RX timestampe 0x%016"PRIx64"\n", meta.timestamp); } + return meta.timestamp; } - -int trx_brf_start(openair0_device *openair0) { +/*! \brief Start BladeRF + *\param device the hardware to use + */ +int trx_brf_start(openair0_device *device) { return 0; } +/*! \brief Get BladeRF stats + *\param device the hardware to use + */ static void trx_brf_stats(openair0_device *device){ } -static int trx_brf_write(openair0_device *device,openair0_timestamp ptimestamp, void **buff, int nsamps, int cc) { +/*! \brief Called to send samples to the BladeRF RF target + @param device pointer to the device structure specific to the RF hardware target + @param timestamp The timestamp at whicch the first sample MUST be sent + @param buff Buffer which holds the samples + @param nsamps number of samples to be sent + @param cc index of the component carrier + @param flags Ignored for the moment +*/ +static int trx_brf_write(openair0_device *device,openair0_timestamp ptimestamp, void **buff, int nsamps, int cc, int flags) { - int status, i; + int status; brf_state_t *brf = (brf_state_t*)device->priv; /* BRF has only 1 rx/tx chaine : is it correct? */ - void *samples = (void*)buff[0]; + int16_t *samples = (int16_t*)buff[0]; - //brf->meta_tx.flags &= ~BLADERF_META_FLAG_TX_NOW; - brf->meta_tx.flags = BLADERF_META_FLAG_TX_BURST_START | - BLADERF_META_FLAG_TX_NOW | - BLADERF_META_FLAG_TX_BURST_END; - - brf->meta_tx.timestamp= (uint64_t) ptimestamp; - + //memset(&brf->meta_tx, 0, sizeof(brf->meta_tx)); + // When BLADERF_META_FLAG_TX_NOW is used the timestamp is not used, so one can't schedule a tx + if (brf->meta_tx.flags == 0 ) + brf->meta_tx.flags = (BLADERF_META_FLAG_TX_BURST_START);// | BLADERF_META_FLAG_TX_BURST_END);// | BLADERF_META_FLAG_TX_NOW); + + + brf->meta_tx.timestamp= (uint64_t) (ptimestamp); status = bladerf_sync_tx(brf->dev, samples, (unsigned int) nsamps, &brf->meta_tx, 2*brf->tx_timeout_ms); + + if (brf->meta_tx.flags == BLADERF_META_FLAG_TX_BURST_START) + brf->meta_tx.flags = BLADERF_META_FLAG_TX_UPDATE_TIMESTAMP; + if (status != 0) { - fprintf(stderr,"Failed to TX sample: %s\n", bladerf_strerror(status)); + //fprintf(stderr,"Failed to TX sample: %s\n", bladerf_strerror(status)); brf->num_tx_errors++; brf_error(status); } else if (brf->meta_tx.status & BLADERF_META_STATUS_UNDERRUN){ @@ -96,6 +135,8 @@ static int trx_brf_write(openair0_device *device,openair0_timestamp ptimestamp, fprintf(stderr, "TX Underrun detected. %u valid samples were read.\n", brf->meta_tx.actual_count); brf->num_underflows++; } + //printf("Provided TX timestampe %u, meta timestame %u\n", ptimestamp,brf->meta_tx.timestamp); + // printf("tx status %d \n",brf->meta_tx.status); brf->tx_current_ts=brf->meta_tx.timestamp; brf->tx_actual_nsamps+=brf->meta_tx.actual_count; @@ -106,27 +147,39 @@ static int trx_brf_write(openair0_device *device,openair0_timestamp ptimestamp, return(0); } +/*! \brief Receive samples from hardware. + * Read \ref nsamps samples from each channel to buffers. buff[0] is the array for + * the first channel. *ptimestamp is the time at which the first sample + * was received. + * \param device the hardware to use + * \param[out] ptimestamp the time at which the first sample was received. + * \param[out] buff An array of pointers to buffers for received samples. The buffers must be large enough to hold the number of samples \ref nsamps. + * \param nsamps Number of samples. One sample is 2 byte I + 2 byte Q => 4 byte. + * \param cc Index of component carrier +*/ static int trx_brf_read(openair0_device *device, openair0_timestamp *ptimestamp, void **buff, int nsamps, int cc) { - int status, ret; - - unsigned int i; + + int status=0; brf_state_t *brf = (brf_state_t*)device->priv; // BRF has only one rx/tx chain - void *samples = (void*)buff[0]; - - brf->meta_rx.flags |= BLADERF_META_FLAG_RX_NOW; + int16_t *samples = (int16_t*)buff[0]; + + brf->meta_rx.flags = BLADERF_META_FLAG_RX_NOW; status = bladerf_sync_rx(brf->dev, samples, (unsigned int) nsamps, &brf->meta_rx, 2*brf->rx_timeout_ms); + // printf("Current RX timestampe %u, nsamps %u, actual %u, cc %d\n", brf->meta_rx.timestamp, nsamps, brf->meta_rx.actual_count, cc); + if (status != 0) { fprintf(stderr, "RX failed: %s\n", bladerf_strerror(status)); + // printf("RX failed: %s\n", bladerf_strerror(status)); brf->num_rx_errors++; } else if ( brf->meta_rx.status & BLADERF_META_STATUS_OVERRUN) { brf->num_overflows++; - fprintf(stderr, "RX overrun (%d) is detected. t=0x%"PRIu64". Got %u samples. nsymps %d\n", - brf->num_overflows,brf->meta_rx.timestamp, brf->meta_rx.actual_count, nsamps); - //brf->meta_rx.timestamp=(unsigned int)(nsamps-brf->meta_rx.actual_count); - } + printf("RX overrun (%d) is detected. t=%u. Got %u samples. nsymps %d\n", + brf->num_overflows,brf->meta_rx.timestamp, brf->meta_rx.actual_count, nsamps); + } + //printf("Current RX timestampe %u\n", brf->meta_rx.timestamp); //printf("[BRF] (buff %p) ts=0x%"PRIu64" %s\n",samples, brf->meta_rx.timestamp,bladerf_strerror(status)); brf->rx_current_ts=brf->meta_rx.timestamp; brf->rx_actual_nsamps+=brf->meta_rx.actual_count; @@ -135,11 +188,14 @@ static int trx_brf_read(openair0_device *device, openair0_timestamp *ptimestamp, *ptimestamp = brf->meta_rx.timestamp; - + return brf->meta_rx.actual_count; } +/*! \brief Terminate operation of the BladeRF transceiver -- free all associated resources + * \param device the hardware to use + */ int trx_brf_end(openair0_device *device) { int status; @@ -155,55 +211,739 @@ int trx_brf_end(openair0_device *device) { return 0; } - +/*! \brief print the BladeRF statistics +* \param device the hardware to use +* \returns 0 on success +*/ int trx_brf_get_stats(openair0_device* device) { return(0); } +/*! \brief Reset the BladeRF statistics +* \param device the hardware to use +* \returns 0 on success +*/ int trx_brf_reset_stats(openair0_device* device) { return(0); } +/*! \brief Stop USRP + * \param device the hardware to use + */ int trx_brf_stop(openair0_device* device) { return(0); } +/*! \brief Set frequencies (TX/RX) + * \param device the hardware to use + * \returns 0 in success + */ int trx_brf_set_freq(openair0_device* device) { + int status; + brf_state_t *brf = (brf_state_t *)device->priv; + openair0_config_t *openair0_cfg = (openair0_config_t *)device->openair0_cfg; + + + if ((status=bladerf_set_frequency(brf->dev, BLADERF_MODULE_TX, (unsigned int) openair0_cfg->tx_freq[0])) != 0){ + fprintf(stderr,"Failed to set TX frequency: %s\n",bladerf_strerror(status)); + brf_error(status); + }else + printf("[BRF] set TX Frequency to %u\n", (unsigned int) openair0_cfg->tx_freq[0]); + + if ((status=bladerf_set_frequency(brf->dev, BLADERF_MODULE_RX, (unsigned int) openair0_cfg->rx_freq[0])) != 0){ + fprintf(stderr,"Failed to set RX frequency: %s\n",bladerf_strerror(status)); + brf_error(status); + } else + printf("[BRF] set RX frequency to %u\n",(unsigned int)openair0_cfg->rx_freq[0]); + return(0); } + +/*! \brief Set Gains (TX/RX) + * \param device the hardware to use + * \returns 0 in success + */ int trx_brf_set_gains(openair0_device* device) { return(0); } -int openair0_dev_init_bladerf(openair0_device *device, openair0_config_t *openair0_cfg) { + +#define RXDCLENGTH 16384 +int16_t cos_fsover8[8] = {2047, 1447, 0, -1448, -2047, -1448, 0, 1447}; +int16_t cos_3fsover8[8] = {2047, -1448, 0, 1447, -2047, 1447, 0, -1448}; + +rx_gain_calib_table_t calib_table_fx4[] = { + {2300000000.0,53.5}, + {1880000000.0,57.0}, + {816000000.0,73.0}, + {-1,0}}; + +void set_rx_gain_offset(openair0_config_t *openair0_cfg, int chain_index) { + + int i=0; + // loop through calibration table to find best adjustment factor for RX frequency + double min_diff = 6e9,diff; + + while (openair0_cfg->rx_gain_calib_table[i].freq>0) { + diff = fabs(openair0_cfg->rx_freq[chain_index] - openair0_cfg->rx_gain_calib_table[i].freq); + printf("cal %d: freq %f, offset %f, diff %f\n", + i, + openair0_cfg->rx_gain_calib_table[i].freq, + openair0_cfg->rx_gain_calib_table[i].offset,diff); + if (min_diff > diff) { + min_diff = diff; + openair0_cfg->rx_gain_offset[chain_index] = openair0_cfg->rx_gain_calib_table[i].offset; + } + i++; + } + +} + +void calibrate_rf(openair0_device *device) { + + + brf_state_t *brf = (brf_state_t *)device->priv; + openair0_timestamp ptimestamp; + int16_t *calib_buffp,*calib_tx_buffp; + int16_t calib_buff[2*RXDCLENGTH]; + int16_t calib_tx_buff[2*RXDCLENGTH]; + int i,j,offI,offQ,offIold,offQold,offInew,offQnew,offphase,offphaseold,offphasenew,offgain,offgainold,offgainnew; + int32_t meanI,meanQ,meanIold,meanQold; + int cnt=0,loop; + + // put TX on a far-away frequency to avoid interference in RX band + bladerf_set_frequency(brf->dev,BLADERF_MODULE_TX, (unsigned int) device->openair0_cfg->rx_freq[0] + 200e6); + // Set gains to close to max + bladerf_set_gain(brf->dev, BLADERF_MODULE_RX, 60); + bladerf_set_gain(brf->dev, BLADERF_MODULE_TX, 60); + + // fill TX buffer with fs/8 complex sinusoid + j=0; + for (i=0;i<RXDCLENGTH;i++) { + calib_tx_buff[j++] = cos_fsover8[i&7]; + calib_tx_buff[j++] = cos_fsover8[(i+6)&7]; // sin + } + calib_buffp = &calib_buff[0]; + calib_tx_buffp = &calib_tx_buff[0]; + // Calibrate RX DC offset + + offIold=offQold=2048; + bladerf_set_correction(brf->dev,BLADERF_MODULE_RX,BLADERF_CORR_LMS_DCOFF_I,offIold); + bladerf_set_correction(brf->dev,BLADERF_MODULE_RX,BLADERF_CORR_LMS_DCOFF_Q,offQold); + for (i=0;i<10;i++) + trx_brf_read(device, &ptimestamp, (void **)&calib_buffp, RXDCLENGTH, 0); + + for (meanIold=meanQold=i=j=0;i<RXDCLENGTH;i++) { + meanIold+=calib_buff[j++]; + meanQold+=calib_buff[j++]; + } + meanIold/=RXDCLENGTH; + meanQold/=RXDCLENGTH; + printf("[BRF] RX DC: (%d,%d) => (%d,%d)\n",offIold,offQold,meanIold,meanQold); + + offI=offQ=-2048; + bladerf_set_correction(brf->dev,BLADERF_MODULE_RX,BLADERF_CORR_LMS_DCOFF_I,offI); + bladerf_set_correction(brf->dev,BLADERF_MODULE_RX,BLADERF_CORR_LMS_DCOFF_Q,offQ); + for (i=0;i<10;i++) + trx_brf_read(device, &ptimestamp, (void **)&calib_buffp, RXDCLENGTH, 0); + + for (meanI=meanQ=i=j=0;i<RXDCLENGTH;i++) { + meanI+=calib_buff[j++]; + meanQ+=calib_buff[j++]; + } + meanI/=RXDCLENGTH; + meanQ/=RXDCLENGTH; + // printf("[BRF] RX DC: (%d,%d) => (%d,%d)\n",offI,offQ,meanI,meanQ); + + while (cnt++ < 12) { + + offInew=(offIold+offI)>>1; + offQnew=(offQold+offQ)>>1; + + if (meanI*meanI < meanIold*meanIold) { + meanIold = meanI; + offIold = offI; + printf("[BRF] *** RX DC: offI %d => %d\n",offIold,meanI); + } + if (meanQ*meanQ < meanQold*meanQold) { + meanQold = meanQ; + offQold = offQ; + printf("[BRF] *** RX DC: offQ %d => %d\n",offQold,meanQ); + } + offI = offInew; + offQ = offQnew; + bladerf_set_correction(brf->dev,BLADERF_MODULE_RX,BLADERF_CORR_LMS_DCOFF_I,offI); + bladerf_set_correction(brf->dev,BLADERF_MODULE_RX,BLADERF_CORR_LMS_DCOFF_Q,offQ); + + for (i=0;i<10;i++) + trx_brf_read(device, &ptimestamp, (void **)&calib_buffp, RXDCLENGTH, 0); + + for (meanI=meanQ=i=j=0;i<RXDCLENGTH;i++) { + meanI+=calib_buff[j++]; + meanQ+=calib_buff[j++]; + } + meanI/=RXDCLENGTH; + meanQ/=RXDCLENGTH; + printf("[BRF] RX DC: (%d,%d) => (%d,%d)\n",offI,offQ,meanI,meanQ); + } + + printf("[BRF] RX DC: (%d,%d) => (%d,%d)\n",offIold,offQold,meanIold,meanQold); + bladerf_set_correction(brf->dev,BLADERF_MODULE_RX,BLADERF_CORR_LMS_DCOFF_I,offIold); + bladerf_set_correction(brf->dev,BLADERF_MODULE_RX,BLADERF_CORR_LMS_DCOFF_Q,offQold); + + // TX DC offset + // PUT TX as f_RX + fs/4 + // loop back BLADERF_LB_RF_LNA1 + bladerf_set_frequency(brf->dev,BLADERF_MODULE_TX, (unsigned int) device->openair0_cfg->rx_freq[0] + (unsigned int) device->openair0_cfg->sample_rate/4); + bladerf_set_loopback (brf->dev,BLADERF_LB_RF_LNA1); + + offIold=2048; + bladerf_set_correction(brf->dev,BLADERF_MODULE_TX,BLADERF_CORR_LMS_DCOFF_I,offIold); + for (i=0;i<10;i++) { + trx_brf_read(device, &ptimestamp, (void **)&calib_buffp, RXDCLENGTH, 0); + trx_brf_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0, 0); + } + for (meanIold=meanQold=i=j=0;i<RXDCLENGTH;i++) { + switch (i&3) { + case 0: + meanIold+=calib_buff[j++]; + break; + case 1: + meanQold+=calib_buff[j++]; + break; + case 2: + meanIold-=calib_buff[j++]; + break; + case 3: + meanQold-=calib_buff[j++]; + break; + } + } + // meanIold/=RXDCLENGTH; + // meanQold/=RXDCLENGTH; + printf("[BRF] TX DC (offI): %d => (%d,%d)\n",offIold,meanIold,meanQold); + + offI=-2048; + bladerf_set_correction(brf->dev,BLADERF_MODULE_TX,BLADERF_CORR_LMS_DCOFF_I,offI); + for (i=0;i<10;i++) { + trx_brf_read(device, &ptimestamp, (void **)&calib_buffp, RXDCLENGTH, 0); + trx_brf_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0, 0); + } + for (meanI=meanQ=i=j=0;i<RXDCLENGTH;i++) { + switch (i&3) { + case 0: + meanI+=calib_buff[j++]; + break; + case 1: + meanQ+=calib_buff[j++]; + break; + case 2: + meanI-=calib_buff[j++]; + break; + case 3: + meanQ-=calib_buff[j++]; + break; + } + } + // meanI/=RXDCLENGTH; + // meanQ/=RXDCLENGTH; + printf("[BRF] TX DC (offI): %d => (%d,%d)\n",offI,meanI,meanQ); + cnt = 0; + while (cnt++ < 12) { + + offInew=(offIold+offI)>>1; + if (meanI*meanI+meanQ*meanQ < meanIold*meanIold +meanQold*meanQold) { + printf("[BRF] TX DC (offI): ([%d,%d]) => %d : %d\n",offIold,offI,offInew,meanI*meanI+meanQ*meanQ); + meanIold = meanI; + meanQold = meanQ; + offIold = offI; + } + offI = offInew; + bladerf_set_correction(brf->dev,BLADERF_MODULE_TX,BLADERF_CORR_LMS_DCOFF_I,offI); + + for (i=0;i<10;i++) { + trx_brf_read(device, &ptimestamp, (void **)&calib_buffp, RXDCLENGTH, 0); + trx_brf_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0, 0); + } + for (meanI=meanQ=i=j=0;i<RXDCLENGTH;i++) { + switch (i&3) { + case 0: + meanI+=calib_buff[j++]; + break; + case 1: + meanQ+=calib_buff[j++]; + break; + case 2: + meanI-=calib_buff[j++]; + break; + case 3: + meanQ-=calib_buff[j++]; + break; + } + } + // meanI/=RXDCLENGTH; + // meanQ/=RXDCLENGTH; + // printf("[BRF] TX DC (offI): %d => (%d,%d)\n",offI,meanI,meanQ); + } + + bladerf_set_correction(brf->dev,BLADERF_MODULE_TX,BLADERF_CORR_LMS_DCOFF_I,offIold); + + offQold=2048; + bladerf_set_correction(brf->dev,BLADERF_MODULE_TX,BLADERF_CORR_LMS_DCOFF_Q,offQold); + for (i=0;i<10;i++) { + trx_brf_read(device, &ptimestamp, (void **)&calib_buffp, RXDCLENGTH, 0); + trx_brf_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0, 0); + } + // project on fs/4 + for (meanIold=meanQold=i=j=0;i<RXDCLENGTH;i++) { + switch (i&3) { + case 0: + meanIold+=calib_buff[j++]; + break; + case 1: + meanQold+=calib_buff[j++]; + break; + case 2: + meanIold-=calib_buff[j++]; + break; + case 3: + meanQold-=calib_buff[j++]; + break; + } + } + // meanIold/=RXDCLENGTH; + // meanQold/=RXDCLENGTH; + printf("[BRF] TX DC (offQ): %d => (%d,%d)\n",offQold,meanIold,meanQold); + + offQ=-2048; + bladerf_set_correction(brf->dev,BLADERF_MODULE_TX,BLADERF_CORR_LMS_DCOFF_Q,offQ); + for (i=0;i<10;i++) { + trx_brf_read(device, &ptimestamp, (void **)&calib_buffp, RXDCLENGTH, 0); + trx_brf_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0, 0); + } + for (meanI=meanQ=i=j=0;i<RXDCLENGTH;i++) { + switch (i&3) { + case 0: + meanI+=calib_buff[j++]; + break; + case 1: + meanQ+=calib_buff[j++]; + break; + case 2: + meanI-=calib_buff[j++]; + break; + case 3: + meanQ-=calib_buff[j++]; + break; + } + } + // meanI/=RXDCLENGTH; + // meanQ/=RXDCLENGTH; + printf("[BRF] TX DC (offQ): %d => (%d,%d)\n",offQ,meanI,meanQ); + + cnt=0; + while (cnt++ < 12) { + + offQnew=(offQold+offQ)>>1; + if (meanI*meanI+meanQ*meanQ < meanIold*meanIold +meanQold*meanQold) { + printf("[BRF] TX DC (offQ): ([%d,%d]) => %d : %d\n",offQold,offQ,offQnew,meanI*meanI+meanQ*meanQ); + + meanIold = meanI; + meanQold = meanQ; + offQold = offQ; + } + offQ = offQnew; + bladerf_set_correction(brf->dev,BLADERF_MODULE_TX,BLADERF_CORR_LMS_DCOFF_Q,offQ); + + for (i=0;i<10;i++) { + trx_brf_read(device, &ptimestamp, (void **)&calib_buffp, RXDCLENGTH, 0); + trx_brf_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0, 0); + } + for (meanI=meanQ=i=j=0;i<RXDCLENGTH;i++) { + switch (i&3) { + case 0: + meanI+=calib_buff[j++]; + break; + case 1: + meanQ+=calib_buff[j++]; + break; + case 2: + meanI-=calib_buff[j++]; + break; + case 3: + meanQ-=calib_buff[j++]; + break; + } + } + // meanI/=RXDCLENGTH; + // meanQ/=RXDCLENGTH; + // printf("[BRF] TX DC (offQ): %d => (%d,%d)\n",offQ,meanI,meanQ); + } + + printf("[BRF] TX DC: (%d,%d) => (%d,%d)\n",offIold,offQold,meanIold,meanQold); + + bladerf_set_correction(brf->dev,BLADERF_MODULE_TX,BLADERF_CORR_LMS_DCOFF_Q,offQold); + + // TX IQ imbalance + for (loop=0;loop<2;loop++) { + offphaseold=4096; + bladerf_set_correction(brf->dev,BLADERF_MODULE_TX,BLADERF_CORR_FPGA_PHASE,offphaseold); + for (i=0;i<10;i++) { + trx_brf_read(device, &ptimestamp, (void **)&calib_buffp, RXDCLENGTH, 0); + trx_brf_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0, 0); + } + // project on fs/8 (Image of TX signal in +ve frequencies) + for (meanIold=meanQold=i=j=0;i<RXDCLENGTH;i++) { + meanIold+= (calib_buff[j]*cos_fsover8[i&7] - calib_buff[j+1]*cos_fsover8[(i+2)&7])>>11; + meanQold+= (calib_buff[j]*cos_fsover8[(i+2)&7] + calib_buff[j+1]*cos_fsover8[i&7])>>11; + j+=2; + } + + meanIold/=RXDCLENGTH; + meanQold/=RXDCLENGTH; + printf("[BRF] TX IQ (offphase): %d => (%d,%d)\n",offphaseold,meanIold,meanQold); + + offphase=-4096; + bladerf_set_correction(brf->dev,BLADERF_MODULE_TX,BLADERF_CORR_FPGA_PHASE,offphase); + for (i=0;i<10;i++) { + trx_brf_read(device, &ptimestamp, (void **)&calib_buffp, RXDCLENGTH, 0); + trx_brf_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0, 0); + } + // project on fs/8 (Image of TX signal in +ve frequencies) + for (meanI=meanQ=i=j=0;i<RXDCLENGTH;i++) { + meanI+= (calib_buff[j]*cos_fsover8[i&7] - calib_buff[j+1]*cos_fsover8[(i+2)&7])>>11; + meanQ+= (calib_buff[j]*cos_fsover8[(i+2)&7] + calib_buff[j+1]*cos_fsover8[i&7])>>11; + j+=2; + } + + meanI/=RXDCLENGTH; + meanQ/=RXDCLENGTH; + printf("[BRF] TX IQ (offphase): %d => (%d,%d)\n",offphase,meanI,meanQ); + + cnt=0; + while (cnt++ < 13) { + + offphasenew=(offphaseold+offphase)>>1; + printf("[BRF] TX IQ (offphase): ([%d,%d]) => %d : %d\n",offphaseold,offphase,offphasenew,meanI*meanI+meanQ*meanQ); + if (meanI*meanI+meanQ*meanQ < meanIold*meanIold +meanQold*meanQold) { + + + meanIold = meanI; + meanQold = meanQ; + offphaseold = offphase; + } + offphase = offphasenew; + bladerf_set_correction(brf->dev,BLADERF_MODULE_TX,BLADERF_CORR_FPGA_PHASE,offphase); + + for (i=0;i<10;i++) { + trx_brf_read(device, &ptimestamp, (void **)&calib_buffp, RXDCLENGTH, 0); + trx_brf_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0, 0); + } + // project on fs/8 (Image of TX signal in +ve frequencies) + for (meanI=meanQ=i=j=0;i<RXDCLENGTH;i++) { + meanI+= (calib_buff[j]*cos_fsover8[i&7] - calib_buff[j+1]*cos_fsover8[(i+2)&7])>>11; + meanQ+= (calib_buff[j]*cos_fsover8[(i+2)&7] + calib_buff[j+1]*cos_fsover8[i&7])>>11; + j+=2; + } + meanI/=RXDCLENGTH; + meanQ/=RXDCLENGTH; + + // printf("[BRF] TX DC (offQ): %d => (%d,%d)\n",offQ,meanI,meanQ); + } + + printf("[BRF] TX IQ offphase: %d => (%d,%d)\n",offphaseold,meanIold,meanQold); + + bladerf_set_correction(brf->dev,BLADERF_MODULE_TX,BLADERF_CORR_FPGA_PHASE,offphaseold); + + offgainold=4096; + bladerf_set_correction(brf->dev,BLADERF_MODULE_TX,BLADERF_CORR_FPGA_GAIN,offgainold); + for (i=0;i<10;i++) { + trx_brf_read(device, &ptimestamp, (void **)&calib_buffp, RXDCLENGTH, 0); + trx_brf_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0, 0); + } + // project on fs/8 (Image of TX signal in +ve frequencies) + for (meanIold=meanQold=i=j=0;i<RXDCLENGTH;i++) { + meanIold+= (calib_buff[j]*cos_fsover8[i&7] - calib_buff[j+1]*cos_fsover8[(i+2)&7])>>11; + meanQold+= (calib_buff[j]*cos_fsover8[(i+2)&7] + calib_buff[j+1]*cos_fsover8[i&7])>>11; + j+=2; + } + + meanIold/=RXDCLENGTH; + meanQold/=RXDCLENGTH; + printf("[BRF] TX IQ (offgain): %d => (%d,%d)\n",offgainold,meanIold,meanQold); + + offgain=-4096; + bladerf_set_correction(brf->dev,BLADERF_MODULE_TX,BLADERF_CORR_FPGA_GAIN,offgain); + for (i=0;i<10;i++) { + trx_brf_read(device, &ptimestamp, (void **)&calib_buffp, RXDCLENGTH, 0); + trx_brf_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0, 0); + } + // project on fs/8 (Image of TX signal in +ve frequencies) + for (meanI=meanQ=i=j=0;i<RXDCLENGTH;i++) { + meanI+= (calib_buff[j]*cos_fsover8[i&7] - calib_buff[j+1]*cos_fsover8[(i+2)&7])>>11; + meanQ+= (calib_buff[j]*cos_fsover8[(i+2)&7] + calib_buff[j+1]*cos_fsover8[i&7])>>11; + j+=2; + } + + meanI/=RXDCLENGTH; + meanQ/=RXDCLENGTH; + printf("[BRF] TX IQ (offgain): %d => (%d,%d)\n",offgain,meanI,meanQ); + + cnt=0; + while (cnt++ < 13) { + + offgainnew=(offgainold+offgain)>>1; + if (meanI*meanI+meanQ*meanQ < meanIold*meanIold +meanQold*meanQold) { + printf("[BRF] TX IQ (offgain): ([%d,%d]) => %d : %d\n",offgainold,offgain,offgainnew,meanI*meanI+meanQ*meanQ); + + meanIold = meanI; + meanQold = meanQ; + offgainold = offgain; + } + offgain = offgainnew; + bladerf_set_correction(brf->dev,BLADERF_MODULE_TX,BLADERF_CORR_FPGA_GAIN,offgain); + + for (i=0;i<10;i++) { + trx_brf_read(device, &ptimestamp, (void **)&calib_buffp, RXDCLENGTH, 0); + trx_brf_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0, 0); + } + // project on fs/8 (Image of TX signal in +ve frequencies) + for (meanI=meanQ=i=j=0;i<RXDCLENGTH;i++) { + meanI+= (calib_buff[j]*cos_fsover8[i&7] - calib_buff[j+1]*cos_fsover8[(i+2)&7])>>11; + meanQ+= (calib_buff[j]*cos_fsover8[(i+2)&7] + calib_buff[j+1]*cos_fsover8[i&7])>>11; + j+=2; + } + meanI/=RXDCLENGTH; + meanQ/=RXDCLENGTH; + + // printf("[BRF] TX DC (offQ): %d => (%d,%d)\n",offQ,meanI,meanQ); + } + + printf("[BRF] TX IQ offgain: %d => (%d,%d)\n",offgainold,meanIold,meanQold); + + bladerf_set_correction(brf->dev,BLADERF_MODULE_TX,BLADERF_CORR_FPGA_GAIN,offgainold); + } + + // RX IQ imbalance + for (loop=0;loop<2;loop++) { + offphaseold=4096; + bladerf_set_correction(brf->dev,BLADERF_MODULE_RX,BLADERF_CORR_FPGA_PHASE,offphaseold); + for (i=0;i<10;i++) { + trx_brf_read(device, &ptimestamp, (void **)&calib_buffp, RXDCLENGTH, 0); + trx_brf_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0, 0); + } + // project on -3fs/8 (Image of TX signal in -ve frequencies) + for (meanIold=meanQold=i=j=0;i<RXDCLENGTH;i++) { + meanIold+= (calib_buff[j]*cos_3fsover8[i&7] - calib_buff[j+1]*cos_3fsover8[(i+2)&7])>>11; + meanQold+= (calib_buff[j]*cos_3fsover8[(i+2)&7] + calib_buff[j+1]*cos_3fsover8[i&7])>>11; + j+=2; + } + + meanIold/=RXDCLENGTH; + meanQold/=RXDCLENGTH; + printf("[BRF] RX IQ (offphase): %d => (%d,%d)\n",offphaseold,meanIold,meanQold); + + offphase=-4096; + bladerf_set_correction(brf->dev,BLADERF_MODULE_RX,BLADERF_CORR_FPGA_PHASE,offphase); + for (i=0;i<10;i++) { + trx_brf_read(device, &ptimestamp, (void **)&calib_buffp, RXDCLENGTH, 0); + trx_brf_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0, 0); + } + // project on -3fs/8 (Image of TX signal in -ve frequencies) + for (meanI=meanQ=i=j=0;i<RXDCLENGTH;i++) { + meanI+= (calib_buff[j]*cos_3fsover8[i&7] - calib_buff[j+1]*cos_3fsover8[(i+2)&7])>>11; + meanQ+= (calib_buff[j]*cos_3fsover8[(i+2)&7] + calib_buff[j+1]*cos_3fsover8[i&7])>>11; + j+=2; + } + + meanI/=RXDCLENGTH; + meanQ/=RXDCLENGTH; + printf("[BRF] RX IQ (offphase): %d => (%d,%d)\n",offphase,meanI,meanQ); + + cnt=0; + while (cnt++ < 13) { + + offphasenew=(offphaseold+offphase)>>1; + printf("[BRF] RX IQ (offphase): ([%d,%d]) => %d : %d\n",offphaseold,offphase,offphasenew,meanI*meanI+meanQ*meanQ); + if (meanI*meanI+meanQ*meanQ < meanIold*meanIold +meanQold*meanQold) { + + + meanIold = meanI; + meanQold = meanQ; + offphaseold = offphase; + } + offphase = offphasenew; + bladerf_set_correction(brf->dev,BLADERF_MODULE_RX,BLADERF_CORR_FPGA_PHASE,offphase); + + for (i=0;i<10;i++) { + trx_brf_read(device, &ptimestamp, (void **)&calib_buffp, RXDCLENGTH, 0); + trx_brf_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0, 0); + } + // project on -3fs/8 (Image of TX signal in -ve frequencies) + for (meanI=meanQ=i=j=0;i<RXDCLENGTH;i++) { + meanI+= (calib_buff[j]*cos_3fsover8[i&7] - calib_buff[j+1]*cos_3fsover8[(i+2)&7])>>11; + meanQ+= (calib_buff[j]*cos_3fsover8[(i+2)&7] + calib_buff[j+1]*cos_3fsover8[i&7])>>11; + j+=2; + } + meanI/=RXDCLENGTH; + meanQ/=RXDCLENGTH; + + // printf("[BRF] TX DC (offQ): %d => (%d,%d)\n",offQ,meanI,meanQ); + } + + printf("[BRF] RX IQ offphase: %d => (%d,%d)\n",offphaseold,meanIold,meanQold); + + bladerf_set_correction(brf->dev,BLADERF_MODULE_RX,BLADERF_CORR_FPGA_PHASE,offphaseold); + + offgainold=4096; + bladerf_set_correction(brf->dev,BLADERF_MODULE_RX,BLADERF_CORR_FPGA_GAIN,offgainold); + for (i=0;i<10;i++) { + trx_brf_read(device, &ptimestamp, (void **)&calib_buffp, RXDCLENGTH, 0); + trx_brf_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0,0); + } + // project on -3fs/8 (Image of TX signal in +ve frequencies) + for (meanIold=meanQold=i=j=0;i<RXDCLENGTH;i++) { + meanIold+= (calib_buff[j]*cos_3fsover8[i&7] - calib_buff[j+1]*cos_3fsover8[(i+2)&7])>>11; + meanQold+= (calib_buff[j]*cos_3fsover8[(i+2)&7] + calib_buff[j+1]*cos_3fsover8[i&7])>>11; + j+=2; + } + + meanIold/=RXDCLENGTH; + meanQold/=RXDCLENGTH; + printf("[BRF] RX IQ (offgain): %d => (%d,%d)\n",offgainold,meanIold,meanQold); + + offgain=-4096; + bladerf_set_correction(brf->dev,BLADERF_MODULE_RX,BLADERF_CORR_FPGA_GAIN,offgain); + for (i=0;i<10;i++) { + trx_brf_read(device, &ptimestamp, (void **)&calib_buffp, RXDCLENGTH, 0); + trx_brf_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0, 0); + } + // project on 3fs/8 (Image of TX signal in -ve frequencies) + for (meanI=meanQ=i=j=0;i<RXDCLENGTH;i++) { + meanI+= (calib_buff[j]*cos_3fsover8[i&7] - calib_buff[j+1]*cos_3fsover8[(i+2)&7])>>11; + meanQ+= (calib_buff[j]*cos_3fsover8[(i+2)&7] + calib_buff[j+1]*cos_3fsover8[i&7])>>11; + j+=2; + } + + meanI/=RXDCLENGTH; + meanQ/=RXDCLENGTH; + printf("[BRF] RX IQ (offgain): %d => (%d,%d)\n",offgain,meanI,meanQ); + + cnt=0; + while (cnt++ < 13) { + + offgainnew=(offgainold+offgain)>>1; + if (meanI*meanI+meanQ*meanQ < meanIold*meanIold +meanQold*meanQold) { + printf("[BRF] RX IQ (offgain): ([%d,%d]) => %d : %d\n",offgainold,offgain,offgainnew,meanI*meanI+meanQ*meanQ); + + meanIold = meanI; + meanQold = meanQ; + offgainold = offgain; + } + offgain = offgainnew; + bladerf_set_correction(brf->dev,BLADERF_MODULE_RX,BLADERF_CORR_FPGA_GAIN,offgain); + + for (i=0;i<10;i++) { + trx_brf_read(device, &ptimestamp, (void **)&calib_buffp, RXDCLENGTH, 0); + trx_brf_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0, 0); + } + // project on -3fs/8 (Image of TX signal in -ve frequencies) + for (meanI=meanQ=i=j=0;i<RXDCLENGTH;i++) { + meanI+= (calib_buff[j]*cos_3fsover8[i&7] - calib_buff[j+1]*cos_3fsover8[(i+2)&7])>>11; + meanQ+= (calib_buff[j]*cos_3fsover8[(i+2)&7] + calib_buff[j+1]*cos_3fsover8[i&7])>>11; + j+=2; + } + meanI/=RXDCLENGTH; + meanQ/=RXDCLENGTH; + + // printf("[BRF] TX DC (offQ): %d => (%d,%d)\n",offQ,meanI,meanQ); + } + + printf("[BRF] RX IQ offgain: %d => (%d,%d)\n",offgainold,meanIold,meanQold); + + bladerf_set_correction(brf->dev,BLADERF_MODULE_RX,BLADERF_CORR_FPGA_GAIN,offgainold); + } + + bladerf_set_frequency(brf->dev,BLADERF_MODULE_TX, (unsigned int) device->openair0_cfg->tx_freq[0]); + bladerf_set_loopback(brf->dev,BLADERF_LB_NONE); + bladerf_set_gain(brf->dev, BLADERF_MODULE_RX, (unsigned int) device->openair0_cfg->rx_gain[0]-device->openair0_cfg[0].rx_gain_offset[0]); + bladerf_set_gain(brf->dev, BLADERF_MODULE_TX, (unsigned int) device->openair0_cfg->tx_gain[0]); + // write_output("blade_rf_test.m","rxs",calib_buff,RXDCLENGTH,1,1); +} + +/*! \brief Initialize Openair BLADERF target. It returns 0 if OK + * \param device the hardware to use + * \param openair0_cfg RF frontend parameters set by application + */ +int device_init(openair0_device *device, openair0_config_t *openair0_cfg) { int status; int card=0; brf_state_t *brf = (brf_state_t*)malloc(sizeof(brf_state_t)); memset(brf, 0, sizeof(brf_state_t)); - // init required params for BRF - brf->num_buffers = 128; - brf->buffer_size = (unsigned int) openair0_cfg[card].samples_per_packet*sizeof(int32_t); // buffer size = 4096 for sample_len of 1024 - brf->num_transfers = 16; - brf->rx_timeout_ms = 0; - brf->tx_timeout_ms = 0; - brf->sample_rate=(unsigned int)openair0_cfg[card].sample_rate; + /* device specific */ + openair0_cfg->txlaunch_wait = 1;//manage when TX processing is triggered + openair0_cfg->txlaunch_wait_slotcount = 1; //manage when TX processing is triggered + openair0_cfg->iq_txshift = 0;// shift + openair0_cfg->iq_rxrescale = 15;//rescale iqs + + // init required params + switch ((int)openair0_cfg->sample_rate) { + case 30720000: + openair0_cfg->samples_per_packet = 2048; + openair0_cfg->tx_sample_advance = 0; + openair0_cfg->tx_scheduling_advance = 8*openair0_cfg->samples_per_packet; + break; + case 15360000: + openair0_cfg->samples_per_packet = 2048; + openair0_cfg->tx_sample_advance = 0; + openair0_cfg->tx_scheduling_advance = 4*openair0_cfg->samples_per_packet; + break; + case 7680000: + openair0_cfg->samples_per_packet = 1024; + openair0_cfg->tx_sample_advance = 0; + openair0_cfg->tx_scheduling_advance = 4*openair0_cfg->samples_per_packet; + break; + case 1920000: + openair0_cfg->samples_per_packet = 256; + openair0_cfg->tx_sample_advance = 50; + openair0_cfg->tx_scheduling_advance = 8*openair0_cfg->samples_per_packet; + break; + default: + printf("Error: unknown sampling rate %f\n",openair0_cfg->sample_rate); + exit(-1); + break; + } + openair0_cfg->iq_txshift= 0; + openair0_cfg->iq_rxrescale = 15; /*not sure*/ + openair0_cfg->rx_gain_calib_table = calib_table_fx4; - - printf("\n[BRF] sampling_rate %d, num_buffers %d, buffer_size %d, num transfer %d, timeout_ms (rx %d, tx %d)\n", - brf->sample_rate, brf->num_buffers, brf->buffer_size,brf->num_transfers, brf->rx_timeout_ms, brf->tx_timeout_ms); + // The number of buffers to use in the underlying data stream + brf->num_buffers = 128; + // the size of the underlying stream buffers, in samples + brf->buffer_size = (unsigned int) openair0_cfg->samples_per_packet;//*sizeof(int32_t); // buffer size = 4096 for sample_len of 1024 + brf->num_transfers = 16; + brf->rx_timeout_ms = 0; + brf->tx_timeout_ms = 0; + brf->sample_rate=(unsigned int)openair0_cfg->sample_rate; + memset(&brf->meta_rx, 0, sizeof(brf->meta_rx)); + memset(&brf->meta_tx, 0, sizeof(brf->meta_tx)); + + printf("\n[BRF] sampling_rate %d, num_buffers %d, buffer_size %d, num transfer %d, timeout_ms (rx %d, tx %d)\n", + brf->sample_rate, brf->num_buffers, brf->buffer_size,brf->num_transfers, brf->rx_timeout_ms, brf->tx_timeout_ms); + if ((status=bladerf_open(&brf->dev, "")) != 0 ) { fprintf(stderr,"Failed to open brf device: %s\n",bladerf_strerror(status)); brf_error(status); @@ -217,83 +957,81 @@ int openair0_dev_init_bladerf(openair0_device *device, openair0_config_t *openai printf("[BRF] Device does not operates at max speed, change the USB port\n"); brf_error(BLADERF_ERR_UNSUPPORTED); } - // RX + // RX // Example of CLI output: RX Frequency: 2539999999Hz - if ((status=bladerf_set_frequency(brf->dev, BLADERF_MODULE_RX, (unsigned int) openair0_cfg[card].rx_freq[0])) != 0){ + if ((status=bladerf_set_frequency(brf->dev, BLADERF_MODULE_RX, (unsigned int) openair0_cfg->rx_freq[0])) != 0){ fprintf(stderr,"Failed to set RX frequency: %s\n",bladerf_strerror(status)); brf_error(status); } else - printf("[BRF] set RX frequency to %f\n",openair0_cfg[card].rx_freq[0]); + printf("[BRF] set RX frequency to %u\n",(unsigned int)openair0_cfg->rx_freq[0]); - - if ((status=bladerf_set_sample_rate(brf->dev, BLADERF_MODULE_RX, (unsigned int)openair0_cfg[card].sample_rate, NULL)) != 0){ + + + unsigned int actual_value=0; + if ((status=bladerf_set_sample_rate(brf->dev, BLADERF_MODULE_RX, (unsigned int) openair0_cfg->sample_rate, &actual_value)) != 0){ fprintf(stderr,"Failed to set RX sample rate: %s\n", bladerf_strerror(status)); brf_error(status); - }else - printf("[BRF] set RX sample rate to %f\n",openair0_cfg[card].sample_rate); + }else + printf("[BRF] set RX sample rate to %u, %u\n", (unsigned int) openair0_cfg->sample_rate, actual_value); - if ((status=bladerf_set_bandwidth(brf->dev, BLADERF_MODULE_RX, (unsigned int) openair0_cfg[card].rx_bw, NULL)) != 0){ + + if ((status=bladerf_set_bandwidth(brf->dev, BLADERF_MODULE_RX, (unsigned int) openair0_cfg->rx_bw*2, &actual_value)) != 0){ fprintf(stderr,"Failed to set RX bandwidth: %s\n", bladerf_strerror(status)); brf_error(status); }else - printf("[BRF] set RX bandwidth to %f\n",openair0_cfg[card].rx_bw); + printf("[BRF] set RX bandwidth to %u, %u\n",(unsigned int)openair0_cfg->rx_bw*2, actual_value); - if ((status=bladerf_set_gain(brf->dev, BLADERF_MODULE_RX, (int) openair0_cfg[card].rx_gain[0])) != 0) { + set_rx_gain_offset(&openair0_cfg[0],0); + if ((status=bladerf_set_gain(brf->dev, BLADERF_MODULE_RX, (int) openair0_cfg->rx_gain[0]-openair0_cfg[0].rx_gain_offset[0])) != 0) { fprintf(stderr,"Failed to set RX gain: %s\n",bladerf_strerror(status)); brf_error(status); } else - printf("[BRF] set RX gain to %f\n",openair0_cfg[card].rx_gain[0]); + printf("[BRF] set RX gain to %d (%d)\n",(int)(openair0_cfg->rx_gain[0]-openair0_cfg[0].rx_gain_offset[0]),(int)openair0_cfg[0].rx_gain_offset[0]); - /* Configure the device's RX module for use with the sync interface. - * SC16 Q11 samples *with* metadata are used. */ - if ((status=bladerf_sync_config(brf->dev, BLADERF_MODULE_RX, BLADERF_FORMAT_SC16_Q11_META,brf->num_buffers,brf->buffer_size,brf->num_transfers,brf->rx_timeout_ms)) != 0 ) { - fprintf(stderr,"Failed to configure RX sync interface: %s\n", bladerf_strerror(status)); - brf_error(status); - }else - printf("[BRF] configured Rx for sync interface \n"); - - /* We must always enable the RX module after calling bladerf_sync_config(), and - * before attempting to RX samples via bladerf_sync_rx(). */ - if ((status=bladerf_enable_module(brf->dev, BLADERF_MODULE_RX, true)) != 0) { - fprintf(stderr,"Failed to enable RX module: %s\n", bladerf_strerror(status)); - brf_error(status); - }else - printf("[BRF] RX module enabled \n"); - // TX - if ((status=bladerf_set_frequency(brf->dev, BLADERF_MODULE_TX, (unsigned int) openair0_cfg[card].tx_freq[0])) != 0){ + + if ((status=bladerf_set_frequency(brf->dev, BLADERF_MODULE_TX, (unsigned int) openair0_cfg->tx_freq[0])) != 0){ fprintf(stderr,"Failed to set TX frequency: %s\n",bladerf_strerror(status)); brf_error(status); }else - printf("[BRF] set Tx Frequenct to %f \n", openair0_cfg[card].tx_freq[0]); + printf("[BRF] set TX Frequency to %u\n", (unsigned int) openair0_cfg->tx_freq[0]); - if ((status=bladerf_set_sample_rate(brf->dev, BLADERF_MODULE_TX, (unsigned int) openair0_cfg[card].sample_rate, NULL)) != 0){ + if ((status=bladerf_set_sample_rate(brf->dev, BLADERF_MODULE_TX, (unsigned int) openair0_cfg->sample_rate, NULL)) != 0){ fprintf(stderr,"Failed to set TX sample rate: %s\n", bladerf_strerror(status)); brf_error(status); }else - printf("[BRF] set Tx sampling rate to %f \n", openair0_cfg[card].sample_rate); + printf("[BRF] set TX sampling rate to %u \n", (unsigned int) openair0_cfg->sample_rate); - if ((status=bladerf_set_bandwidth(brf->dev, BLADERF_MODULE_TX,(unsigned int)openair0_cfg[card].tx_bw, NULL)) != 0){ - fprintf(stderr, "Failed to set RX bandwidth: %s\n", bladerf_strerror(status)); + if ((status=bladerf_set_bandwidth(brf->dev, BLADERF_MODULE_TX,(unsigned int)openair0_cfg->tx_bw*2, NULL)) != 0){ + fprintf(stderr, "Failed to set TX bandwidth: %s\n", bladerf_strerror(status)); brf_error(status); }else - printf("[BRF] set Tx sampling ratebandwidth to %f \n", openair0_cfg[card].tx_bw); + printf("[BRF] set TX bandwidth to %u \n", (unsigned int) openair0_cfg->tx_bw*2); - if ((status=bladerf_set_gain(brf->dev, BLADERF_MODULE_TX, (int)openair0_cfg[card].tx_gain[0])) != 0) { + if ((status=bladerf_set_gain(brf->dev, BLADERF_MODULE_TX, (int) openair0_cfg->tx_gain[0])) != 0) { fprintf(stderr,"Failed to set TX gain: %s\n",bladerf_strerror(status)); brf_error(status); }else - printf("[BRF] set the Tx gain to %f \n", openair0_cfg[card].tx_gain[0]); - + printf("[BRF] set the TX gain to %d\n", (int)openair0_cfg->tx_gain[0]); + - /* Configure the device's TX module for use with the sync interface. + /* Configure the device's TX module for use with the sync interface. * SC16 Q11 samples *with* metadata are used. */ if ((status=bladerf_sync_config(brf->dev, BLADERF_MODULE_TX,BLADERF_FORMAT_SC16_Q11_META,brf->num_buffers,brf->buffer_size,brf->num_transfers,brf->tx_timeout_ms)) != 0 ) { fprintf(stderr,"Failed to configure TX sync interface: %s\n", bladerf_strerror(status)); brf_error(status); }else - printf("[BRF] configured tx for sync interface \n"); + printf("[BRF] configured TX sync interface \n"); + +/* Configure the device's RX module for use with the sync interface. + * SC16 Q11 samples *with* metadata are used. */ + if ((status=bladerf_sync_config(brf->dev, BLADERF_MODULE_RX, BLADERF_FORMAT_SC16_Q11_META,brf->num_buffers,brf->buffer_size,brf->num_transfers,brf->rx_timeout_ms)) != 0 ) { + fprintf(stderr,"Failed to configure RX sync interface: %s\n", bladerf_strerror(status)); + brf_error(status); + }else + printf("[BRF] configured Rx sync interface \n"); + /* We must always enable the TX module after calling bladerf_sync_config(), and * before attempting to TX samples via bladerf_sync_tx(). */ @@ -303,11 +1041,35 @@ int openair0_dev_init_bladerf(openair0_device *device, openair0_config_t *openai } else printf("[BRF] TX module enabled \n"); - bladerf_log_set_verbosity(get_brf_log_level(openair0_cfg[card].log_level)); + /* We must always enable the RX module after calling bladerf_sync_config(), and + * before attempting to RX samples via bladerf_sync_rx(). */ + if ((status=bladerf_enable_module(brf->dev, BLADERF_MODULE_RX, true)) != 0) { + fprintf(stderr,"Failed to enable RX module: %s\n", bladerf_strerror(status)); + brf_error(status); + }else + printf("[BRF] RX module enabled \n"); + + // calibrate + + if ((status=bladerf_calibrate_dc(brf->dev, BLADERF_MODULE_TX)) != 0) { + fprintf(stderr,"Failed to calibrate TX DC: %s\n", bladerf_strerror(status)); + brf_error(status); + } else + printf("[BRF] TX module calibrated DC \n"); + + if ((status=bladerf_calibrate_dc(brf->dev, BLADERF_MODULE_RX)) != 0) { + fprintf(stderr,"Failed to calibrate RX DC: %s\n", bladerf_strerror(status)); + brf_error(status); + }else + printf("[BRF] RX module calibrated DC \n"); + + + + bladerf_log_set_verbosity(get_brf_log_level(openair0_cfg->log_level)); printf("BLADERF: Initializing openair0_device\n"); - device->priv = brf; device->Mod_id = num_devices++; + device->type = BLADERF_DEV; device->trx_start_func = trx_brf_start; device->trx_end_func = trx_brf_end; device->trx_read_func = trx_brf_read; @@ -317,11 +1079,18 @@ int openair0_dev_init_bladerf(openair0_device *device, openair0_config_t *openai device->trx_stop_func = trx_brf_stop; device->trx_set_freq_func = trx_brf_set_freq; device->trx_set_gains_func = trx_brf_set_gains; - memcpy((void*)&device->openair0_cfg,(void*)openair0_cfg,sizeof(openair0_config_t)); + device->openair0_cfg = openair0_cfg; + + calibrate_rf(device); + + // memcpy((void*)&device->openair0_cfg,(void*)&openair0_cfg[0],sizeof(openair0_config_t)); return 0; } +/*! \brief bladeRF error report + * \param status + */ int brf_error(int status) { //exit(-1); @@ -329,7 +1098,9 @@ int brf_error(int status) { } - +/*! \brief Open BladeRF from serial port + * \param serial name of serial port on which to open BladeRF device + */ struct bladerf * open_bladerf_from_serial(const char *serial) { int status; @@ -356,10 +1127,14 @@ struct bladerf * open_bladerf_from_serial(const char *serial) { return dev; } } + +/*! \brief Get BladeRF log level + * \param log_level log level + */ int get_brf_log_level(int log_level){ int level=BLADERF_LOG_LEVEL_INFO; - //return BLADERF_LOG_LEVEL_DEBUG; + return BLADERF_LOG_LEVEL_DEBUG; // BLADERF_LOG_LEVEL_VERBOSE;// BLADERF_LOG_LEVEL_DEBUG; // switch(log_level) { case LOG_DEBUG: level=BLADERF_LOG_LEVEL_DEBUG; @@ -384,3 +1159,4 @@ int get_brf_log_level(int log_level){ } return level; } +/*@}*/ diff --git a/targets/ARCH/BLADERF/USERSPACE/LIB/bladerf_lib.h b/targets/ARCH/BLADERF/USERSPACE/LIB/bladerf_lib.h index 15e1d39da744b508138763344ede60c2267f33fe..3a05c80e5c8f83e8d7e7434e3e5ead3484493709 100644 --- a/targets/ARCH/BLADERF/USERSPACE/LIB/bladerf_lib.h +++ b/targets/ARCH/BLADERF/USERSPACE/LIB/bladerf_lib.h @@ -37,45 +37,69 @@ #include "common_lib.h" #include "log.h" +/** @addtogroup _BLADERF_PHY_RF_INTERFACE_ + * @{ + */ + +/*! \brief BladeRF specific data structure */ typedef struct { - // opaque BRF data struct + //! opaque BladeRF device struct. An empty ("") or NULL device identifier will result in the first encountered device being opened (using the first discovered backend) struct bladerf *dev; - // An empty ("") or NULL device identifier will result in the first encountered device being opened (using the first discovered backend) - + + //! Number of buffers unsigned int num_buffers; + //! Buffer size unsigned int buffer_size; + //! Number of transfers unsigned int num_transfers; + //! RX timeout unsigned int rx_timeout_ms; + //! TX timeout unsigned int tx_timeout_ms; - + //! Metadata for RX struct bladerf_metadata meta_rx; + //!Metadata for TX struct bladerf_metadata meta_tx; - + //! Sample rate unsigned int sample_rate; - // time offset between transmiter timestamp and receiver timestamp; + //! time offset between transmiter timestamp and receiver timestamp; double tdiff; - // use brf_time_offset to get this value + //! TX number of forward samples use brf_time_offset to get this value int tx_forward_nsamps; //166 for 20Mhz // -------------------------------- // Debug and output control // -------------------------------- + //! Number of underflows int num_underflows; + //! Number of overflows int num_overflows; + //! number of sequential errors int num_seq_errors; + //! number of RX errors int num_rx_errors; + //! Number of TX errors int num_tx_errors; + //! timestamp of current TX uint64_t tx_current_ts; + //! timestamp of current RX uint64_t rx_current_ts; + //! number of actual samples transmitted uint64_t tx_actual_nsamps; + //! number of actual samples received uint64_t rx_actual_nsamps; + //! number of TX samples uint64_t tx_nsamps; + //! number of RX samples uint64_t rx_nsamps; + //! number of TX count uint64_t tx_count; + //! number of RX count uint64_t rx_count; + //! timestamp of RX packet openair0_timestamp rx_timestamp; } brf_state_t; @@ -84,3 +108,4 @@ typedef struct { */ int brf_error(int status); +/*@}*/ diff --git a/targets/ARCH/COMMON/common_lib.c b/targets/ARCH/COMMON/common_lib.c index b7700ec06fc04c3225c705739cca1320d2160e75..e4ee06d0a480ac8d86123cd6fe536745a381b360 100644 --- a/targets/ARCH/COMMON/common_lib.c +++ b/targets/ARCH/COMMON/common_lib.c @@ -37,28 +37,140 @@ * \warning */ #include <stdio.h> +#include <strings.h> +#include <dlfcn.h> +#include <errno.h> +#include <string.h> + #include "common_lib.h" +int set_device(openair0_device *device) { + + switch (device->type) { + + case EXMIMO_DEV: + printf("[%s] has loaded EXPRESS MIMO device.\n",((device->host_type == BBU_HOST) ? "BBU": "RRH")); + break; + case USRP_B200_DEV: + printf("[%s] has loaded USRP B200 device.\n",((device->host_type == BBU_HOST) ? "BBU": "RRH")); + break; +case USRP_X300_DEV: + printf("[%s] has loaded USRP X300 device.\n",((device->host_type == BBU_HOST) ? "BBU": "RRH")); + break; + case BLADERF_DEV: + printf("[%s] has loaded BLADERF device.\n",((device->host_type == BBU_HOST) ? "BBU": "RRH")); + break; + case LMSSDR_DEV: + printf("[%s] has loaded LMSSDR device.\n",((device->host_type == BBU_HOST) ? "BBU": "RRH")); + break; + case NONE_DEV: + printf("[%s] has not loaded a HW device.\n",((device->host_type == BBU_HOST) ? "BBU": "RRH")); + break; + default: + printf("[%s] invalid HW device.\n",((device->host_type == BBU_HOST) ? "BBU": "RRH")); + return -1; + } + return 0; +} + +int set_transport(openair0_device *device) { + + switch (device->transp_type) { + + case ETHERNET_TP: + printf("[%s] has loaded ETHERNET trasport protocol.\n",((device->host_type == BBU_HOST) ? "BBU": "RRH")); + return 0; + break; + case NONE_TP: + printf("[%s] has not loaded a transport protocol.\n",((device->host_type == BBU_HOST) ? "BBU": "RRH")); + return 0; + break; + default: + printf("[%s] invalid transport protocol.\n",((device->host_type == BBU_HOST) ? "BBU": "RRH")); + return -1; + break; + } + +} -int openair0_device_init(openair0_device *device, openair0_config_t *openair0_cfg) { +/* look for the interface library and load it */ +int load_lib(openair0_device *device, openair0_config_t *openair0_cfg, eth_params_t * cfg, uint8_t flag) { -#ifdef ETHERNET - device->type=ETH_IF; - device->func_type = BBU_FUNC; - openair0_dev_init_eth(device, openair0_cfg); - printf(" openair0_dev_init_eth ...\n"); -#elif EXMIMO - device->type=EXMIMO_IF; - openair0_dev_init_exmimo(device, openair0_cfg); - printf("openair0_dev_init_exmimo...\n"); -#elif OAI_USRP - device->type=USRP_B200_IF; - openair0_dev_init_usrp(device, openair0_cfg); - printf("openair0_dev_init_usrp ...\n"); -#elif OAI_BLADERF - device->type=BLADERF_IF; - openair0_dev_init_bladerf(device, openair0_cfg); - printf(" openair0_dev_init_bladerf ...\n"); -#endif - + void *lib_handle; + oai_device_initfunc_t dp ; + oai_transport_initfunc_t tp ; + + if (flag == BBU_LOCAL_RADIO_HEAD) { + lib_handle = dlopen(OAI_RF_LIBNAME, RTLD_LAZY); + if (!lib_handle) { + printf( "Unable to locate %s: HW device set to NONE_DEV.\n", OAI_RF_LIBNAME); + return 0; + } + + dp = dlsym(lib_handle,"device_init"); + + if (dp != NULL ) { + dp(device,openair0_cfg); + } else { + fprintf(stderr, "%s %d:oai device intializing function not found %s\n", __FILE__, __LINE__, dlerror()); + return -1; + } + } else { + lib_handle = dlopen(OAI_TP_LIBNAME, RTLD_LAZY); + if (!lib_handle) { + printf( "Unable to locate %s: transport protocol set to NONE_TP.\n", OAI_TP_LIBNAME); + return 0; + } + + tp = dlsym(lib_handle,"transport_init"); + + if (tp != NULL ) { + tp(device,openair0_cfg,cfg); + } else { + fprintf(stderr, "%s %d:oai device intializing function not found %s\n", __FILE__, __LINE__, dlerror()); + return -1; + } + } + + return 0; } + + + +int openair0_device_load(openair0_device *device, openair0_config_t *openair0_cfg) { + + int rc; + //ToDo: EXMIMO harmonization is not complete. That is the reason for this ifdef + #ifdef EXMIMO + device_init(device, openair0_cfg); + #else + rc=load_lib(device, openair0_cfg, NULL,BBU_LOCAL_RADIO_HEAD ); + if ( rc >= 0) { + if ( set_device(device) < 0) { + fprintf(stderr, "%s %d:Unsupported radio head\n",__FILE__, __LINE__); + return -1; + } + } + #endif + return 0; +} + +int openair0_transport_load(openair0_device *device, openair0_config_t *openair0_cfg, eth_params_t * eth_params) { + int rc; + rc=load_lib(device, openair0_cfg, eth_params, BBU_REMOTE_RADIO_HEAD); + if ( rc >= 0) { + if ( set_transport(device) < 0) { + fprintf(stderr, "%s %d:Unsupported transport protocol\n",__FILE__, __LINE__); + return -1; + } + } + return 0; + +} + + + + + + + diff --git a/targets/ARCH/COMMON/common_lib.h b/targets/ARCH/COMMON/common_lib.h index 156da0c4ce6991c3b54c4901650f34d826d8348f..dc0b31af58c0b974c4597f2d6b540a98c718b591 100644 --- a/targets/ARCH/COMMON/common_lib.h +++ b/targets/ARCH/COMMON/common_lib.h @@ -42,11 +42,20 @@ #include <stdint.h> #include <sys/types.h> +/* name of shared library implementing the radio front end */ +#define OAI_RF_LIBNAME "liboai_device.so" +/* name of shared library implementing the transport */ +#define OAI_TP_LIBNAME "liboai_transpro.so" + +/* flags for BBU to determine whether the attached radio head is local or remote */ +#define BBU_LOCAL_RADIO_HEAD 0 +#define BBU_REMOTE_RADIO_HEAD 1 + typedef int64_t openair0_timestamp; typedef volatile int64_t openair0_vtimestamp; -/* structrue holds the parameters to configure USRP devices*/ +/*!\brief structrue holds the parameters to configure USRP devices*/ typedef struct openair0_device_t openair0_device; @@ -65,10 +74,56 @@ typedef enum { } duplex_mode_t; -/** @addtogroup _PHY_RF_INTERFACE_ + +/** @addtogroup _GENERIC_PHY_RF_INTERFACE_ * @{ */ - +/*!\brief RF device types + */ +typedef enum { + MIN_RF_DEV_TYPE = 0, + /*!\brief device is ExpressMIMO */ + EXMIMO_DEV, + /*!\brief device is USRP B200/B210*/ + USRP_B200_DEV, + /*!\brief device is USRP X300/X310*/ + USRP_X300_DEV, + /*!\brief device is BLADE RF*/ + BLADERF_DEV, + /*!\brief device is LMSSDR (SoDeRa)*/ + LMSSDR_DEV, + /*!\brief device is NONE*/ + NONE_DEV, + MAX_RF_DEV_TYPE + +} dev_type_t; + +/*!\brief transport protocol types + */ +typedef enum { + MIN_TRANSP_TYPE = 0, + /*!\brief transport protocol ETHERNET */ + ETHERNET_TP, + /*!\brief no transport protocol*/ + NONE_TP, + MAX_TRANSP_TYPE + +} transport_type_t; + + +/*!\brief openair0 device host type */ +typedef enum { + MIN_HOST_TYPE = 0, + /*!\brief device functions within a BBU */ + BBU_HOST, + /*!\brief device functions within a RRH */ + RRH_HOST, + MAX_HOST_TYPE + +}host_type_t; + + +/*! \brief RF Gain clibration */ typedef struct { //! Frequency for which RX chain was calibrated double freq; @@ -76,10 +131,11 @@ typedef struct { double offset; } rx_gain_calib_table_t; +/*! \brief RF frontend parameters set by application */ typedef struct { //! Module ID for this configuration int Mod_id; - // device log level + //! device log level int log_level; //! duplexing mode duplex_mode_t duplex_mode; @@ -90,11 +146,15 @@ typedef struct { //! the sample rate for both transmit and receive. double sample_rate; //! number of samples per RX/TX packet (USRP + Ethernet) - int samples_per_packet; + unsigned int samples_per_packet; //! delay in sending samples (write) due to hardware access, softmodem processing and fronthaul delay if exist int tx_scheduling_advance; //! offset in samples between TX and RX paths int tx_sample_advance; + //! configurable tx thread lauch delay + int txlaunch_wait; /* 1 or 0 */ + //! configurable tx thread lauch delay + int txlaunch_wait_slotcount; //! number of RX channels (=RX antennas) int rx_num_channels; //! number of TX channels (=TX antennas) @@ -125,77 +185,72 @@ typedef struct { double tx_bw; //! Auto calibration flag int autocal[4]; - //! RRH IP addr for Ethernet interface - char *remote_ip; - //! RRH port number for Ethernet interface - int remote_port; - //! my IP addr for Ethernet interface (eNB/BBU, UE) - char *my_ip; - //! my port number for Ethernet interface (eNB/BBU, UE) - int my_port; - + //! rf devices work with x bits iqs when oai have its own iq format + //! the two following parameters are used to convert iqs + int iq_txshift; + int iq_rxrescale; + //! remote IP/MAC addr for Ethernet interface + char *remote_addr; + //! remote port number for Ethernet interface + unsigned int remote_port; + //! local IP/MAC addr for Ethernet interface (eNB/BBU, UE) + char *my_addr; + //! local port number for Ethernet interface (eNB/BBU, UE) + unsigned int my_port; + //! Configuration file for LMS7002M + char *configFilename; } openair0_config_t; +/*! \brief RF mapping */ typedef struct { - /* card id */ + //! card id int card; - /* rf chain id */ + //! rf chain id int chain; } openair0_rf_map; - -/*!\brief interface types that apply to modules (RRH_BBU/RRH_UE) created in RRH (rrh_gw.c) - and are defined with respect to the RF device that is present in RRH - -RRH_BBU modules have two devices, one is by default ETHERNET (will have ETH_IF) and the other one is a - RF device (EXMIMO,USRP,BLADERF) or no device (NONE_IF). - -RRH_UE modules have two devices one is by default ETHERNET (will have ETH_IF) - and the other one by default not present so it will have NONE_IF - */ -typedef enum { - MIN_DEV_TYPE = 0, - /*!\brief device is ETH */ - ETH_IF, - /*!\brief device is ExpressMIMO */ - EXMIMO_IF, - /*!\brief device is USRP B200/B210*/ - USRP_B200_IF, - /*!\brief device is USRP X300/X310*/ - USRP_X300_IF, - /*!\brief device is BLADE RF*/ - BLADERF_IF, - /*!\brief device is NONE*/ - NONE_IF, - MAX_DEV_TYPE - -} dev_type_t; - - -/*!\brief openair0 device host type */ -typedef enum { - MIN_FUNC_TYPE = 0, - /*!\brief device functions within a BBU */ - BBU_FUNC, - /*!\brief device functions within a RRH */ - RRH_FUNC, - MAX_FUNC_TYPE - -}func_type_t; - +typedef struct { + char *remote_addr; + //! remote port number for Ethernet interface + uint16_t remote_port; + //! local IP/MAC addr for Ethernet interface (eNB/BBU, UE) + char *my_addr; + //! local port number for Ethernet interface (eNB/BBU, UE) + uint16_t my_port; + //! local Ethernet interface (eNB/BBU, UE) + char *local_if_name; + //! tx_sample_advance for RF + ETH + uint8_t tx_sample_advance; + //! tx_scheduling_advance for RF + ETH + uint8_t tx_scheduling_advance; + //! iq_txshift for RF + ETH + uint8_t iq_txshift; + //! transport type preference (RAW/UDP) + uint8_t transp_preference; + //! radio front end preference (EXMIMO,USRP, BALDERF,LMSSDR) + uint8_t rf_preference; +} eth_params_t; + + +/*!\brief structure holds the parameters to configure USRP devices */ struct openair0_device_t { - /* Module ID of this device */ + /*!brief Module ID of this device */ int Mod_id; - /* Type of this device */ + /*!brief Type of this device */ dev_type_t type; - /* Type of the device's host (BBU/RRH) */ - func_type_t func_type; + /*!brief Transport protocol type that the device suppports (in case I/Q samples need to be transported) */ + transport_type_t transp_type; + + /*!brief Type of the device's host (BBU/RRH) */ + host_type_t host_type; - /* RF frontend parameters set by application */ - openair0_config_t openair0_cfg; + /* !brief RF frontend parameters set by application */ + openair0_config_t *openair0_cfg; - /* Can be used by driver to hold internal structure*/ + /*!brief Can be used by driver to hold internal structure*/ void *priv; /* Functions API, which are called by the application*/ @@ -217,7 +272,7 @@ struct openair0_device_t { @param msg pointer to the message structure passed between BBU-RRH @param msg_len length of the message */ - int (*trx_reply_func)(openair0_device *openair0, void *msg, ssize_t msg_len); + int (*trx_reply_func)(openair0_device *device, void *msg, ssize_t msg_len); /*! \brief Called to send samples to the RF target @param device pointer to the device structure specific to the RF hardware target @@ -235,9 +290,9 @@ struct openair0_device_t { * was received. * \param device the hardware to use * \param[out] ptimestamp the time at which the first sample was received. - * \param[out] An array of pointers to buffers for received samples. The buffers must be large enough to hold the number of samples \ref nsamps. + * \param[out] buff An array of pointers to buffers for received samples. The buffers must be large enough to hold the number of samples \ref nsamps. * \param nsamps Number of samples. One sample is 2 byte I + 2 byte Q => 4 byte. - * \param cc Number of channels. If cc == 1, only buff[0] is filled with samples. + * \param antenna_id Index of antenna for which to receive samples * \returns the number of sample read */ int (*trx_read_func)(openair0_device *device, openair0_timestamp *ptimestamp, void **buff, int nsamps,int antenna_id); @@ -254,49 +309,64 @@ struct openair0_device_t { */ int (*trx_reset_stats_func)(openair0_device *device); - /*! \brief Terminate operation of the transceiver -- free all associated resources */ + /*! \brief Terminate operation of the transceiver -- free all associated resources + * \param device the hardware to use + */ void (*trx_end_func)(openair0_device *device); - /* Terminate operation */ + /*! \brief Stop operation of the transceiver + * \param card RF Card to use + */ int (*trx_stop_func)(int card); /* Functions API related to UE*/ /*! \brief Set RX feaquencies - * \param + * \param device the hardware to use + * \param openair0_cfg RF frontend parameters set by application + * \param exmimo_dump_config dump EXMIMO configuration * \returns 0 in success */ int (*trx_set_freq_func)(openair0_device* device, openair0_config_t *openair0_cfg,int exmimo_dump_config); /*! \brief Set gains - * \param + * \param device the hardware to use + * \param openair0_cfg RF frontend parameters set by application * \returns 0 in success */ int (*trx_set_gains_func)(openair0_device* device, openair0_config_t *openair0_cfg); }; +/* type of device init function, implemented in shared lib */ +typedef int(*oai_device_initfunc_t)(openair0_device *device, openair0_config_t *openair0_cfg); +/* type of transport init function, implemented in shared lib */ +typedef int(*oai_transport_initfunc_t)(openair0_device *device, openair0_config_t *openair0_cfg, eth_params_t * eth_params); #ifdef __cplusplus extern "C" { #endif -/*! \brief Initialize Openair RF target. It returns 0 if OK */ - int openair0_device_init(openair0_device* device, openair0_config_t *openair0_cfg); + + /*! \brief Initialize openair RF target. It returns 0 if OK */ + int openair0_device_load(openair0_device *device, openair0_config_t *openair0_cfg); + /*! \brief Initialize transport protocol . It returns 0 if OK */ + int openair0_transport_load(openair0_device *device, openair0_config_t *openair0_cfg, eth_params_t * eth_params); + - //USRP -/*! \brief Get the current timestamp of USRP */ + /*! \brief Get current timestamp of USRP + * \param device the hardware to use + */ openair0_timestamp get_usrp_time(openair0_device *device); -/*! \brief Set the RX frequency of USRP RF TARGET */ + + /*! \brief Set RX frequencies + * \param device the hardware to use + * \param openair0_cfg RF frontend parameters set by application + * \returns 0 in success + */ int openair0_set_rx_frequencies(openair0_device* device, openair0_config_t *openair0_cfg); - -//extern -/*! \brief Initialize Openair ETHERNET target. It returns 0 if OK */ - int openair0_dev_init_eth(openair0_device *device, openair0_config_t *openair0_cfg); - int openair0_dev_init_bladerf(openair0_device *device, openair0_config_t *openair0_cfg); - int openair0_dev_init_usrp(openair0_device* device, openair0_config_t *openair0_cfg); - int openair0_dev_init_exmimo(openair0_device *device, openair0_config_t *openair0_cfg); + /*@}*/ #ifdef __cplusplus diff --git a/targets/ARCH/ETHERNET/USERSPACE/LIB/eth_raw.c b/targets/ARCH/ETHERNET/USERSPACE/LIB/eth_raw.c new file mode 100644 index 0000000000000000000000000000000000000000..a360f2655656906a885fde7281847ade2ecc8192 --- /dev/null +++ b/targets/ARCH/ETHERNET/USERSPACE/LIB/eth_raw.c @@ -0,0 +1,319 @@ +/******************************************************************************* + OpenAirInterface + Copyright(c) 1999 - 2014 Eurecom + + OpenAirInterface is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + + OpenAirInterface is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with OpenAirInterface.The full GNU General Public License is + included in this distribution in the file called "COPYING". If not, + see <http://www.gnu.org/licenses/>. + + Contact Information + OpenAirInterface Admin: openair_admin@eurecom.fr + OpenAirInterface Tech : openair_tech@eurecom.fr + OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr + + Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE + + *******************************************************************************/ +/*! \file ethernet_lib.c + * \brief API to stream I/Q samples over standard ethernet + * \author add alcatel Katerina Trilyraki, Navid Nikaein, Pedro Dinis, Lucio Ferreira, Raymond Knopp + * \date 2015 + * \version 0.2 + * \company Eurecom + * \maintainer: navid.nikaein@eurecom.fr + * \note + * \warning + */ + +#include <arpa/inet.h> +#include <linux/if_packet.h> +#include <stdio.h> +#include <string.h> +#include <stdlib.h> +#include <sys/ioctl.h> +#include <sys/socket.h> +#include <net/if.h> +#include <netinet/ether.h> +#include <unistd.h> +#include <errno.h> + +#include "common_lib.h" +#include "ethernet_lib.h" + +#define DEBUG 0 + +struct sockaddr_ll dest_addr[MAX_INST]; +struct sockaddr_ll local_addr[MAX_INST]; +int addr_len[MAX_INST]; +struct ifreq if_index[MAX_INST]; +struct ether_header eh; + +int eth_socket_init_raw(openair0_device *device) { + + int i = 0; + eth_state_t *eth = (eth_state_t*)device->priv; + int Mod_id = device->Mod_id; + const char *local_mac, *remote_mac; + int local_port=0, remote_port=0; + int sock_dom=0; + int sock_type=0; + int sock_proto=0; + + if (device->host_type == RRH_HOST ) { /* RRH doesn't know remote MAC(will be retrieved from first packet send from BBU) and remote port(don't care) */ + local_mac = device->openair0_cfg->my_addr; + local_port = device->openair0_cfg->my_port; + remote_mac = malloc(ETH_ALEN); + memset(remote_mac,0,ETH_ALEN); + remote_port = 0; + printf("[%s] local MAC addr %s remote MAC addr %s\n","RRH", local_mac,remote_mac); + } else { + local_mac = device->openair0_cfg->my_addr; + local_port = device->openair0_cfg->my_port; + remote_mac = device->openair0_cfg->remote_addr; + remote_port = device->openair0_cfg->remote_port; + printf("[%s] local MAC addr %s remote MAC addr %s\n","BBU", local_mac,remote_mac); + } + + + /* Open a RAW socket to send on */ + sock_dom=AF_PACKET; + sock_type=SOCK_RAW; + sock_proto=IPPROTO_RAW; + if ((eth->sockfd[Mod_id] = socket(sock_dom, sock_type, sock_proto)) == -1) { + perror("ETHERNET: Error opening RAW socket"); + exit(0); + } + + /* initialize destination address */ + for (i=0; i< MAX_INST; i++) { + bzero((void *)&(local_addr[i]), sizeof(struct sockaddr_ll)); + bzero((void *)&(if_index[i]), sizeof(struct ifreq)); + } + /* Get the index of the interface to send on */ + strcpy(if_index[Mod_id].ifr_name,eth->if_name[Mod_id]); + if (ioctl(eth->sockfd[Mod_id], SIOCGIFINDEX, &(if_index[Mod_id])) < 0) + perror("SIOCGIFINDEX"); + + local_addr[Mod_id].sll_family = AF_PACKET; + local_addr[Mod_id].sll_ifindex = if_index[Mod_id].ifr_ifindex; + /* hear traffic from specific protocol*/ + local_addr[Mod_id].sll_protocol = htons((short)device->openair0_cfg->my_port); + local_addr[Mod_id].sll_halen = ETH_ALEN; + local_addr[Mod_id].sll_pkttype = PACKET_OTHERHOST; + addr_len[Mod_id] = sizeof(struct sockaddr_ll); + + if (bind(eth->sockfd[Mod_id],(struct sockaddr *)&local_addr[Mod_id],addr_len[Mod_id])<0) { + perror("ETHERNET: Cannot bind to socket"); + exit(0); + } + + /* Construct the Ethernet header */ + ether_aton_r(local_mac, (struct ether_addr *)(&(eh.ether_shost))); + ether_aton_r(remote_mac, (struct ether_addr *)(&(eh.ether_dhost))); + eh.ether_type = htons((short)device->openair0_cfg->my_port); + + printf("[%s] binding mod_%d to hardware address %x:%x:%x:%x:%x:%x\n",((device->host_type == BBU_HOST) ? "BBU": "RRH"),Mod_id,eh.ether_shost[0],eh.ether_shost[1],eh.ether_shost[2],eh.ether_shost[3],eh.ether_shost[4],eh.ether_shost[5]); + + return 0; +} + + +int trx_eth_write_raw(openair0_device *device, openair0_timestamp timestamp, void **buff, int nsamps,int cc, int flags) { + + int bytes_sent=0; + eth_state_t *eth = (eth_state_t*)device->priv; + int Mod_id = device->Mod_id; + int sendto_flag =0; + int i=0; + //sendto_flag|=flags; + + eth->tx_nsamps=nsamps; + + for (i=0;i<cc;i++) { + /* buff[i] points to the position in tx buffer where the payload to be sent is + buff2 points to the position in tx buffer where the packet header will be placed */ + void *buff2 = (void*)(buff[i]-APP_HEADER_SIZE_BYTES-MAC_HEADER_SIZE_BYTES); + + /* we don't want to ovewrite with the header info the previous tx buffer data so we store it*/ + struct ether_header temp = *(struct ether_header *)buff2; + int32_t temp0 = *(int32_t *)(buff2 + MAC_HEADER_SIZE_BYTES); + openair0_timestamp temp1 = *(openair0_timestamp *)(buff2 + MAC_HEADER_SIZE_BYTES + sizeof(int32_t)); + + bytes_sent = 0; + memcpy(buff2,(void*)&eh,MAC_HEADER_SIZE_BYTES); + *(int16_t *)(buff2 + MAC_HEADER_SIZE_BYTES + sizeof(int16_t))=1+(i<<1); + *(openair0_timestamp *)(buff2 + MAC_HEADER_SIZE_BYTES + sizeof(int32_t)) = timestamp; + + /*printf("[RRH]write mod_%d %d , len %d, buff %p \n", + Mod_id,eth->sockfd[Mod_id],RAW_PACKET_SIZE_BYTES(nsamps), buff2);*/ + + while(bytes_sent < RAW_PACKET_SIZE_BYTES(nsamps)) { +#if DEBUG + printf("------- TX ------: buff2 current position=%d remaining_bytes=%d bytes_sent=%d \n", + (void *)(buff2+bytes_sent), + RAW_PACKET_SIZE_BYTES(nsamps) - bytes_sent, + bytes_sent); +#endif + /* Send packet */ + bytes_sent += send(eth->sockfd[Mod_id], + buff2, + RAW_PACKET_SIZE_BYTES(nsamps), + sendto_flag); + if ( bytes_sent == -1) { + eth->num_tx_errors++; + perror("ETHERNET WRITE: "); + exit(-1); + } else { +#if DEBUG + printf("------- TX ------: nu=%x an_id=%d ts%d bytes_sent=%d\n", + *(uint8_t *)(buff2+ETH_ALEN), + *(int16_t *)(buff2 + MAC_HEADER_SIZE_BYTES + sizeof(int16_t)), + *(openair0_timestamp *)(buff2 + MAC_HEADER_SIZE_BYTES + sizeof(int32_t)), + bytes_sent); + dump_packet((device->host_type == BBU_HOST)? "BBU":"RRH", buff2, RAW_PACKET_SIZE_BYTES(nsamps), TX_FLAG); +#endif + eth->tx_actual_nsamps=bytes_sent>>2; + eth->tx_count++; + } + } + + /* tx buffer values restored */ + *(struct ether_header *)buff2 = temp; + *(int32_t *)(buff2 + MAC_HEADER_SIZE_BYTES) = temp0; + *(openair0_timestamp *)(buff2 + MAC_HEADER_SIZE_BYTES + sizeof(int32_t)) = temp1; + } + return (bytes_sent-APP_HEADER_SIZE_BYTES-MAC_HEADER_SIZE_BYTES)>>2; +} + + +int trx_eth_read_raw(openair0_device *device, openair0_timestamp *timestamp, void **buff, int nsamps, int cc) { + + int bytes_received=0; + int i=0; + eth_state_t *eth = (eth_state_t*)device->priv; + int Mod_id = device->Mod_id; + int rcvfrom_flag =0; + + eth->rx_nsamps=nsamps; + + for (i=0;i<cc;i++) { + /* buff[i] points to the position in rx buffer where the payload to be received will be placed + buff2 points to the position in rx buffer where the packet header will be placed */ + void *buff2 = (void*)(buff[i]-APP_HEADER_SIZE_BYTES-MAC_HEADER_SIZE_BYTES); + + /* we don't want to ovewrite with the header info the previous rx buffer data so we store it*/ + struct ether_header temp = *(struct ether_header *)buff2; + int32_t temp0 = *(int32_t *)(buff2 + MAC_HEADER_SIZE_BYTES); + openair0_timestamp temp1 = *(openair0_timestamp *)(buff2 + MAC_HEADER_SIZE_BYTES + sizeof(int32_t)); + + bytes_received=0; + + while(bytes_received < RAW_PACKET_SIZE_BYTES(nsamps)) { + bytes_received +=recv(eth->sockfd[Mod_id], + buff2, + RAW_PACKET_SIZE_BYTES(nsamps), + rcvfrom_flag); + + if (bytes_received ==-1) { + eth->num_rx_errors++; + perror("ETHERNET READ: "); + exit(-1); + } else { + /* store the timestamp value from packet's header */ + *timestamp = *(openair0_timestamp *)(buff2 + MAC_HEADER_SIZE_BYTES + sizeof(int32_t)); + eth->rx_actual_nsamps=bytes_received>>2; + eth->rx_count++; + } + } + +#if DEBUG + printf("------- RX------: nu=%x an_id=%d ts%d bytes_recv=%d \n", + *(uint8_t *)(buff2+ETH_ALEN), + *(int16_t *)(buff2 + MAC_HEADER_SIZE_BYTES + sizeof(int16_t)), + *(openair0_timestamp *)(buff2 + MAC_HEADER_SIZE_BYTES + sizeof(int32_t)), + bytes_received); + dump_packet((device->host_type == BBU_HOST)? "BBU":"RRH", buff2, RAW_PACKET_SIZE_BYTES(nsamps),RX_FLAG); + +#endif + + /* tx buffer values restored */ + *(struct ether_header *)buff2 = temp; + *(int32_t *)(buff2 + MAC_HEADER_SIZE_BYTES) = temp0; + *(openair0_timestamp *)(buff2 + MAC_HEADER_SIZE_BYTES + sizeof(int32_t)) = temp1; + } + return (bytes_received-APP_HEADER_SIZE_BYTES-MAC_HEADER_SIZE_BYTES)>>2; +} + + + + +int eth_set_dev_conf_raw(openair0_device *device) { + + int Mod_id = device->Mod_id; + eth_state_t *eth = (eth_state_t*)device->priv; + void *msg; + ssize_t msg_len; + + /* a BBU client sends to RRH a set of configuration parameters (openair0_config_t) + so that RF front end is configured appropriately and + frame/packet size etc. can be set */ + + msg = malloc(MAC_HEADER_SIZE_BYTES + sizeof(openair0_config_t)); + msg_len = MAC_HEADER_SIZE_BYTES + sizeof(openair0_config_t); + + + memcpy(msg,(void*)&eh,MAC_HEADER_SIZE_BYTES); + memcpy((msg+MAC_HEADER_SIZE_BYTES),(void*)device->openair0_cfg,sizeof(openair0_config_t)); + + if (send(eth->sockfd[Mod_id], + msg, + msg_len, + 0)==-1) { + perror("ETHERNET: "); + exit(0); + } + + return 0; +} + + +int eth_get_dev_conf_raw(openair0_device *device) { + + eth_state_t *eth = (eth_state_t*)device->priv; + int Mod_id = device->Mod_id; + char str[INET_ADDRSTRLEN]; + void *msg; + ssize_t msg_len; + + msg = malloc(MAC_HEADER_SIZE_BYTES + sizeof(openair0_config_t)); + msg_len = MAC_HEADER_SIZE_BYTES + sizeof(openair0_config_t); + + /* RRH receives from BBU openair0_config_t */ + if (recv(eth->sockfd[Mod_id], + msg, + msg_len, + 0)==-1) { + perror("ETHERNET: "); + exit(0); + } + + /* RRH stores the remote MAC address */ + memcpy(eh.ether_dhost,(msg+ETH_ALEN),ETH_ALEN); + //memcpy((void*)&device->openair0_cfg,(msg + MAC_HEADER_SIZE_BYTES), sizeof(openair0_config_t)); + device->openair0_cfg=(openair0_config_t *)(msg + MAC_HEADER_SIZE_BYTES); + printf("[%s] binding mod_%d to hardware address %x:%x:%x:%x:%x:%x hardware address %x:%x:%x:%x:%x:%x\n",((device->host_type == BBU_HOST) ? "BBU": "RRH"),Mod_id,eh.ether_shost[0],eh.ether_shost[1],eh.ether_shost[2],eh.ether_shost[3],eh.ether_shost[4],eh.ether_shost[5],eh.ether_dhost[0],eh.ether_dhost[1],eh.ether_dhost[2],eh.ether_dhost[3],eh.ether_dhost[4],eh.ether_dhost[5]); + + return 0; +} diff --git a/targets/ARCH/ETHERNET/USERSPACE/LIB/eth_udp.c b/targets/ARCH/ETHERNET/USERSPACE/LIB/eth_udp.c new file mode 100644 index 0000000000000000000000000000000000000000..a9706c73bdd16dad3cce786ead09bca8700b65f2 --- /dev/null +++ b/targets/ARCH/ETHERNET/USERSPACE/LIB/eth_udp.c @@ -0,0 +1,383 @@ +/******************************************************************************* + OpenAirInterface + Copyright(c) 1999 - 2014 Eurecom + + OpenAirInterface is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + + OpenAirInterface is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with OpenAirInterface.The full GNU General Public License is + included in this distribution in the file called "COPYING". If not, + see <http://www.gnu.org/licenses/>. + + Contact Information + OpenAirInterface Admin: openair_admin@eurecom.fr + OpenAirInterface Tech : openair_tech@eurecom.fr + OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr + + Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE + + *******************************************************************************/ +/*! \file ethernet_lib.c + * \brief API to stream I/Q samples over standard ethernet + * \author add alcatel Katerina Trilyraki, Navid Nikaein, Pedro Dinis, Lucio Ferreira, Raymond Knopp + * \date 2015 + * \version 0.2 + * \company Eurecom + * \maintainer: navid.nikaein@eurecom.fr + * \note + * \warning + */ + +#include <arpa/inet.h> +#include <linux/if_packet.h> +#include <stdio.h> +#include <string.h> +#include <stdlib.h> +#include <sys/ioctl.h> +#include <sys/socket.h> +#include <net/if.h> +#include <netinet/ether.h> +#include <unistd.h> +#include <errno.h> +#include "vcd_signal_dumper.h" + +#include "common_lib.h" +#include "ethernet_lib.h" + +#define DEBUG 0 +struct sockaddr_in dest_addr[MAX_INST]; +struct sockaddr_in local_addr[MAX_INST]; +int addr_len[MAX_INST]; + + +uint16_t pck_seq_num = 1; +uint16_t pck_seq_num_cur=0; +uint16_t pck_seq_num_prev=0; + + int eth_socket_init_udp(openair0_device *device) { + + int i = 0; + eth_state_t *eth = (eth_state_t*)device->priv; + int Mod_id = device->Mod_id; + char str_local[INET_ADDRSTRLEN]; + char str_remote[INET_ADDRSTRLEN]; + const char *local_ip, *remote_ip; + int local_port=0, remote_port=0; + int sock_dom=0; + int sock_type=0; + int sock_proto=0; + int enable=1; + + if (device->host_type == RRH_HOST ) { + local_ip = device->openair0_cfg->my_addr; + local_port = device->openair0_cfg->my_port; + remote_ip = "0.0.0.0"; + remote_port = 0; + printf("[%s] local ip addr %s port %d\n", "RRH", local_ip, local_port); + } else { + local_ip = device->openair0_cfg->my_addr; + local_port = device->openair0_cfg->my_port; + remote_ip = device->openair0_cfg->remote_addr; + remote_port = device->openair0_cfg->remote_port; + printf("[%s] local ip addr %s port %d\n","BBU", local_ip, local_port); + } + + /* Open socket to send on */ + sock_dom=AF_INET; + sock_type=SOCK_DGRAM; + sock_proto=IPPROTO_UDP; + + if ((eth->sockfd[Mod_id] = socket(sock_dom, sock_type, sock_proto)) == -1) { + perror("ETHERNET: Error opening socket"); + exit(0); + } + + /* initialize addresses */ + for (i=0; i< MAX_INST; i++) { + bzero((void *)&(dest_addr[i]), sizeof(dest_addr[i])); + bzero((void *)&(local_addr[i]), sizeof(local_addr[i])); + } + + addr_len[Mod_id] = sizeof(struct sockaddr_in); + + dest_addr[Mod_id].sin_family = AF_INET; + inet_pton(AF_INET,remote_ip,&(dest_addr[Mod_id].sin_addr.s_addr)); + dest_addr[Mod_id].sin_port=htons(remote_port); + inet_ntop(AF_INET, &(dest_addr[Mod_id].sin_addr), str_remote, INET_ADDRSTRLEN); + + + local_addr[Mod_id].sin_family = AF_INET; + inet_pton(AF_INET,local_ip,&(local_addr[Mod_id].sin_addr.s_addr)); + local_addr[Mod_id].sin_port=htons(local_port); + inet_ntop(AF_INET, &(local_addr[Mod_id].sin_addr), str_local, INET_ADDRSTRLEN); + + + /* set reuse address flag */ + if (setsockopt(eth->sockfd[Mod_id], SOL_SOCKET, SO_REUSEADDR, &enable, sizeof(int))) { + perror("ETHERNET: Cannot set SO_REUSEADDR option on socket"); + exit(0); + } + + /* want to receive -> so bind */ + if (bind(eth->sockfd[Mod_id],(struct sockaddr *)&local_addr[Mod_id],addr_len[Mod_id])<0) { + perror("ETHERNET: Cannot bind to socket"); + exit(0); + } else { + printf("[%s] binding mod_%d to %s:%d\n","RRH",Mod_id,str_local,ntohs(local_addr[Mod_id].sin_port)); + } + + return 0; +} + +int trx_eth_write_udp(openair0_device *device, openair0_timestamp timestamp, void **buff, int nsamps,int cc, int flags) { + + int bytes_sent=0; + eth_state_t *eth = (eth_state_t*)device->priv; + int Mod_id = device->Mod_id; + int sendto_flag =0; + int i=0; + //sendto_flag|=flags; + eth->tx_nsamps=nsamps; + + for (i=0;i<cc;i++) { + /* buff[i] points to the position in tx buffer where the payload to be sent is + buff2 points to the position in tx buffer where the packet header will be placed */ + void *buff2 = (void*)(buff[i]- APP_HEADER_SIZE_BYTES); + + /* we don't want to ovewrite with the header info the previous tx buffer data so we store it*/ + int32_t temp0 = *(int32_t *)buff2; + openair0_timestamp temp1 = *(openair0_timestamp *)(buff2 + sizeof(int32_t)); + + bytes_sent = 0; + + /* constract application header */ + // eth->pck_header.seq_num = pck_seq_num; + //eth->pck_header.antenna_id = 1+(i<<1); + //eth->pck_header.timestamp = timestamp; + *(uint16_t *)buff2 = pck_seq_num; + *(uint16_t *)(buff2 + sizeof(uint16_t)) = 1+(i<<1); + *(openair0_timestamp *)(buff2 + sizeof(int32_t)) = timestamp; + VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TX_SEQ_NUM, pck_seq_num); + + while(bytes_sent < UDP_PACKET_SIZE_BYTES(nsamps)) { +#if DEBUG + printf("------- TX ------: buff2 current position=%d remaining_bytes=%d bytes_sent=%d \n", + (void *)(buff2+bytes_sent), + UDP_PACKET_SIZE_BYTES(nsamps) - bytes_sent, + bytes_sent); +#endif + /* Send packet */ + bytes_sent += sendto(eth->sockfd[Mod_id], + buff2, + UDP_PACKET_SIZE_BYTES(nsamps), + sendto_flag, + (struct sockaddr*)&dest_addr[Mod_id], + addr_len[Mod_id]); + + if ( bytes_sent == -1) { + eth->num_tx_errors++; + perror("ETHERNET WRITE: "); + exit(-1); + } else { +#if DEBUG + printf("------- TX ------: nu=%d an_id=%d ts%d bytes_send=%d\n", + *(int16_t *)buff2, + *(int16_t *)(buff2 + sizeof(int16_t)), + *(openair0_timestamp *)(buff2 + sizeof(int32_t)), + bytes_sent); + dump_packet((device->host_type == BBU_HOST)? "BBU":"RRH", buff2, UDP_PACKET_SIZE_BYTES(nsamps), TX_FLAG); +#endif + eth->tx_actual_nsamps=bytes_sent>>2; + eth->tx_count++; + pck_seq_num++; + if ( pck_seq_num > MAX_PACKET_SEQ_NUM(nsamps,76800) ) pck_seq_num = 1; + } + } + /* tx buffer values restored */ + *(int32_t *)buff2 = temp0; + *(openair0_timestamp *)(buff2 + sizeof(int32_t)) = temp1; + } + + return (bytes_sent-APP_HEADER_SIZE_BYTES)>>2; +} + + + +int trx_eth_read_udp(openair0_device *device, openair0_timestamp *timestamp, void **buff, int nsamps, int cc) { + + int bytes_received=0; + eth_state_t *eth = (eth_state_t*)device->priv; + openair0_timestamp prev_timestamp = -1; + int Mod_id = device->Mod_id; + int rcvfrom_flag =0; + int block_cnt=0; + int again_cnt=0; + int i=0; + + eth->rx_nsamps=nsamps; + + for (i=0;i<cc;i++) { + /* buff[i] points to the position in rx buffer where the payload to be received will be placed + buff2 points to the position in rx buffer where the packet header will be placed */ + void *buff2 = (void*)(buff[i]- APP_HEADER_SIZE_BYTES); + + /* we don't want to ovewrite with the header info the previous rx buffer data so we store it*/ + int32_t temp0 = *(int32_t *)buff2; + openair0_timestamp temp1 = *(openair0_timestamp *)(buff2 + sizeof(int32_t)); + + bytes_received=0; + block_cnt=0; + + + while(bytes_received < UDP_PACKET_SIZE_BYTES(nsamps)) { + again: +#if DEBUG + printf("------- RX------: buff2 current position=%d remaining_bytes=%d bytes_recv=%d \n", + (void *)(buff2+bytes_received), + UDP_PACKET_SIZE_BYTES(nsamps) - bytes_received, + bytes_received); +#endif + bytes_received +=recvfrom(eth->sockfd[Mod_id], + buff2, + UDP_PACKET_SIZE_BYTES(nsamps), + rcvfrom_flag, + (struct sockaddr *)&dest_addr[Mod_id], + (socklen_t *)&addr_len[Mod_id]); + + if (bytes_received ==-1) { + eth->num_rx_errors++; + if (errno == EAGAIN) { + again_cnt++; + usleep(10); + if (again_cnt == 1000) { + perror("ETHERNET READ: "); + exit(-1); + } else { + printf("AGAIN AGAIN AGAIN AGAIN AGAIN AGAIN AGAIN AGAIN AGAIN AGAIN AGAIN AGAIN \n"); + goto again; + } + } else if (errno == EWOULDBLOCK) { + block_cnt++; + usleep(10); + if (block_cnt == 1000) { + perror("ETHERNET READ: "); + exit(-1); + } else { + printf("BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK \n"); + goto again; + } + } + } else { +#if DEBUG + printf("------- RX------: nu=%d an_id=%d ts%d bytes_recv=%d\n", + *(int16_t *)buff2, + *(int16_t *)(buff2 + sizeof(int16_t)), + *(openair0_timestamp *)(buff2 + sizeof(int32_t)), + bytes_received); + dump_packet((device->host_type == BBU_HOST)? "BBU":"RRH", buff2, UDP_PACKET_SIZE_BYTES(nsamps),RX_FLAG); +#endif + + /* store the timestamp value from packet's header */ + *timestamp = *(openair0_timestamp *)(buff2 + sizeof(int32_t)); + /* store the sequence number of the previous packet received */ + if (pck_seq_num_cur == 0) { + pck_seq_num_prev = *(uint16_t *)buff2; + } else { + pck_seq_num_prev = pck_seq_num_cur; + } + /* get the packet sequence number from packet's header */ + pck_seq_num_cur = *(uint16_t *)buff2; + //printf("cur=%d prev=%d buff=%d\n",pck_seq_num_cur,pck_seq_num_prev,*(uint16_t *)(buff2)); + if ( ( pck_seq_num_cur != (pck_seq_num_prev + 1) ) && !((pck_seq_num_prev==75) && (pck_seq_num_cur==1 ))){ + printf("out of order packet received1! %d|%d|%d\n",pck_seq_num_cur,pck_seq_num_prev, *timestamp); + } + VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_RX_SEQ_NUM,pck_seq_num_cur); + VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_RX_SEQ_NUM_PRV,pck_seq_num_prev); + eth->rx_actual_nsamps=bytes_received>>2; + eth->rx_count++; + } + + } + /* tx buffer values restored */ + *(int32_t *)buff2 = temp0; + *(openair0_timestamp *)(buff2 + sizeof(int32_t)) = temp1; + + } + return (bytes_received-APP_HEADER_SIZE_BYTES)>>2; +} + + + + +int eth_set_dev_conf_udp(openair0_device *device) { + + int Mod_id = device->Mod_id; + eth_state_t *eth = (eth_state_t*)device->priv; + void *msg; + ssize_t msg_len; + + + /* a BBU client sents to RRH a set of configuration parameters (openair0_config_t) + so that RF front end is configured appropriately and + frame/packet size etc. can be set */ + + msg=malloc(sizeof(openair0_config_t)); + msg_len=sizeof(openair0_config_t); + memcpy(msg,(void*)device->openair0_cfg,msg_len); + + if (sendto(eth->sockfd[Mod_id],msg,msg_len,0,(struct sockaddr *)&dest_addr[Mod_id],addr_len[Mod_id])==-1) { + perror("ETHERNET: "); + exit(0); + } + + return 0; +} + +int eth_get_dev_conf_udp(openair0_device *device) { + + eth_state_t *eth = (eth_state_t*)device->priv; + int Mod_id = device->Mod_id; + char str1[INET_ADDRSTRLEN],str[INET_ADDRSTRLEN]; + void *msg; + ssize_t msg_len; + + msg=malloc(sizeof(openair0_config_t)); + msg_len=sizeof(openair0_config_t); + + inet_ntop(AF_INET, &(local_addr[Mod_id].sin_addr), str, INET_ADDRSTRLEN); + inet_ntop(AF_INET, &(dest_addr[Mod_id].sin_addr), str1, INET_ADDRSTRLEN); + + /* RRH receives from BBU openair0_config_t */ + if (recvfrom(eth->sockfd[Mod_id], + msg, + msg_len, + 0, + (struct sockaddr *)&dest_addr[Mod_id], + (socklen_t *)&addr_len[Mod_id])==-1) { + perror("ETHERNET: "); + exit(0); + } + device->openair0_cfg=(openair0_config_t *)msg; + + /* get remote ip address and port */ + /* inet_ntop(AF_INET, &(dest_addr[Mod_id].sin_addr), str1, INET_ADDRSTRLEN); */ + /* device->openair0_cfg->remote_port =ntohs(dest_addr[Mod_id].sin_port); */ + /* device->openair0_cfg->remote_addr =str1; */ + + /* /\* restore local ip address and port *\/ */ + /* inet_ntop(AF_INET, &(local_addr[Mod_id].sin_addr), str, INET_ADDRSTRLEN); */ + /* device->openair0_cfg->my_port =ntohs(local_addr[Mod_id].sin_port); */ + /* device->openair0_cfg->my_addr =str; */ + + /* printf("[RRH] mod_%d socket %d connected to BBU %s:%d %s:%d\n", Mod_id, eth->sockfd[Mod_id],str1, device->openair0_cfg->remote_port, str, device->openair0_cfg->my_port); */ + return 0; +} diff --git a/targets/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.c b/targets/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.c index ce90d2cff967e03d90d3c82bc401f3b93a156768..f15f2d98ebcabf715273fe03256319358d63b825 100644 --- a/targets/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.c +++ b/targets/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.c @@ -28,7 +28,7 @@ *******************************************************************************/ /*! \file ethernet_lib.c * \brief API to stream I/Q samples over standard ethernet - * \author Katerina Trilyraki, Navid Nikaein, Pedro Dinis, Lucio Ferreira, Raymond Knopp + * \author add alcatel Katerina Trilyraki, Navid Nikaein, Pedro Dinis, Lucio Ferreira, Raymond Knopp * \date 2015 * \version 0.2 * \company Eurecom @@ -52,196 +52,56 @@ #include "common_lib.h" #include "ethernet_lib.h" -//#define DEBUG 1 int num_devices_eth = 0; +struct sockaddr_in dest_addr[MAX_INST]; int dest_addr_len[MAX_INST]; -char sendbuf[MAX_INST][BUF_SIZ]; /*TODO*/ - - -/*! \fn static int eth_socket_init(openair0_device *device) -* \brief initialization of UDP Socket to communicate with one destination -* \param[in] *device openair device for which the socket will be created -* \param[out] -* \return 0 on success, otherwise -1 -* \note -* @ingroup _oai -*/ -static int eth_socket_init(openair0_device *device); - -/*! \fn static int eth_set_dev_conf(openair0_device *device) -* \brief -* \param[in] *device openair device -* \param[out] -* \return 0 on success, otherwise -1 -* \note -* @ingroup _oai -*/ -static int eth_set_dev_conf(openair0_device *device); - -/*! \fn static int eth_get_dev_conf(openair0_device *device) -* \brief -* \param[in] *device openair device -* \param[out] -* \return 0 on success, otherwise -1 -* \note -* @ingroup _oai -*/ -static int eth_get_dev_conf(openair0_device *device); - int trx_eth_start(openair0_device *device) { - - /* initialize socket */ - if (eth_socket_init(device)!=0) { - return -1; - } - - /* RRH gets openair0 device configuration BBU sets openair0 device configuration*/ - if (device->func_type == BBU_FUNC) { - return eth_set_dev_conf(device); - } else { - return eth_get_dev_conf(device); - } - - return 0; -} - -int trx_eth_write(openair0_device *device, openair0_timestamp timestamp, void **buff, int nsamps,int cc, int flags) { - - int n_written=0,i; - uint16_t header_size=sizeof(int32_t) + sizeof(openair0_timestamp); eth_state_t *eth = (eth_state_t*)device->priv; - int Mod_id = device->Mod_id; - int sendto_flag =0; - sendto_flag|=MSG_DONTWAIT; - for (i=0;i<cc;i++) { - /* buff[i] points to the position in tx buffer where the payload to be sent is - buff2 points to the position in tx buffer where the packet header will be placed */ - void *buff2 = (void*)(buff[i]-header_size); - - /* we don't want to ovewrite with the header info the previous tx buffer data so we store it*/ - int32_t temp0 = *(int32_t *)buff2; - openair0_timestamp temp1 = *(openair0_timestamp *)(buff2 + sizeof(int32_t)); - - n_written = 0; - - *(int16_t *)(buff2 + sizeof(int16_t))=1+(i<<1); - *(openair0_timestamp *)(buff2 + sizeof(int32_t)) = timestamp; - - /* printf("[RRH]write mod_%d %d , len %d, buff %p antenna %d\n", - Mod_id,eth->sockfd[Mod_id],(nsamps<<2)+header_size, buff2, antenna_id);*/ - - while(n_written < nsamps) { - /* Send packet */ - if ((n_written += sendto(eth->sockfd[Mod_id], - buff2, - (nsamps<<2)+header_size, - 0, - (struct sockaddr*)ð->dest_addr[Mod_id], - dest_addr_len[Mod_id])) < 0) { - perror("ETHERNET WRITE"); - exit(-1); - } + /* initialize socket */ + if ((eth->flags & ETH_RAW_MODE) != 0 ) { + if (eth_socket_init_raw(device)!=0) return -1; + /* RRH gets openair0 device configuration - BBU sets openair0 device configuration*/ + if (device->host_type == BBU_HOST) { + if(eth_set_dev_conf_raw(device)!=0) return -1; + } else { + if(eth_get_dev_conf_raw(device)!=0) return -1; } - -#if DEBUG - printf("Buffer head TX: nu=%d an_id=%d ts%d samples_send=%d i=%d data=%x\n", - *(int16_t *)buff2, - *(int16_t *)(buff2 + sizeof(int16_t)), - *(openair0_timestamp *)(buff2 + sizeof(int32_t)), - n_written>>2,i,*(int32_t *)(buff2 + 20*sizeof(int32_t))); -#endif - - /* tx buffer values restored */ - *(int32_t *)buff2 = temp0; - *(openair0_timestamp *)(buff2 + sizeof(int32_t)) = temp1; - } - return n_written; - -} - -int trx_eth_read(openair0_device *device, openair0_timestamp *timestamp, void **buff, int nsamps, int cc) { - - int bytes_received=0; - int block_cnt=0; - int ret=0,i; - uint16_t header_size=sizeof(int32_t) + sizeof(openair0_timestamp); - - eth_state_t *eth = (eth_state_t*)device->priv; - int Mod_id = device->Mod_id; - - for (i=0;i<cc;i++) { - /* buff[i] points to the position in rx buffer where the payload to be received will be placed - buff2 points to the position in rx buffer where the packet header will be placed */ - void *buff2 = (void*)(buff[i]-header_size); - - /* we don't want to ovewrite with the header info the previous rx buffer data so we store it*/ - int32_t temp0 = *(int32_t *)buff2; - openair0_timestamp temp1 = *(openair0_timestamp *)(buff2 + sizeof(int32_t)); - - bytes_received=0; - block_cnt=0; - ret=0; - - /* printf("[RRH] read mod_%d %d,len %d, buff %p antenna %d\n", - Mod_id,eth->sockfd[Mod_id],(nsamps<<2)+header_size, buff2, antenna_id);*/ - - while(bytes_received < (int)((nsamps<<2))) { - ret=recvfrom(eth->sockfd[Mod_id], - buff2+bytes_received, - (nsamps<<2)+header_size-bytes_received, - 0,//MSG_DONTWAIT, - (struct sockaddr *)ð->dest_addr[Mod_id], - (socklen_t *)&dest_addr_len[Mod_id]); - - if (ret==-1) { - if (errno == EAGAIN) { - perror("ETHERNET READ: "); - return((nsamps<<2) + header_size); - } else if (errno == EWOULDBLOCK) { - block_cnt++; - usleep(10); - - if (block_cnt == 100) return(-1); - } - } else { - bytes_received+=ret; - } + /* adjust MTU wrt number of samples per packet */ + if(ethernet_tune (device,MTU_SIZE,RAW_PACKET_SIZE_BYTES(device->openair0_cfg->samples_per_packet))!=0) return -1; + } else { + if (eth_socket_init_udp(device)!=0) return -1; + /* RRH gets openair0 device configuration - BBU sets openair0 device configuration*/ + if (device->host_type == BBU_HOST) { + if(eth_set_dev_conf_udp(device)!=0) return -1; + } else { + if(eth_get_dev_conf_udp(device)!=0) return -1; } - -#if DEBUG - printf("Buffer head RX: nu=%d an_id=%d ts%d samples_recv=%d i=%d data=%x\n", - *(int16_t *)buff2, - *(int16_t *)(buff2 + sizeof(int16_t)), - *(openair0_timestamp *)(buff2 + sizeof(int32_t)), - ret>>2,i,*(int32_t *)(buff2 + 20*sizeof(int32_t))); -#endif - - /* store the timestamp value from packet's header */ - *timestamp = *(openair0_timestamp *)(buff2 + sizeof(int32_t)); - - /* tx buffer values restored */ - *(int32_t *)buff2 = temp0; - *(openair0_timestamp *)(buff2 + sizeof(int32_t)) = temp1; + /* adjust MTU wrt number of samples per packet */ + //if(ethernet_tune (device,MTU_SIZE,UDP_PACKET_SIZE_BYTES(device->openair0_cfg->samples_per_packet))!=0) return -1; } - return nsamps; + /* apply additional configuration */ + if(ethernet_tune (device, SND_BUF_SIZE,2000000000)!=0) return -1; + if(ethernet_tune (device, RCV_BUF_SIZE,2000000000)!=0) return -1; + return 0; } + void trx_eth_end(openair0_device *device) { eth_state_t *eth = (eth_state_t*)device->priv; int Mod_id = device->Mod_id; - /*destroys socket only for the processes that call the eth_end fuction-- shutdown() for beaking the pipe */ + /* destroys socket only for the processes that call the eth_end fuction-- shutdown() for beaking the pipe */ if ( close(eth->sockfd[Mod_id]) <0 ) { perror("ETHERNET: Failed to close socket"); exit(0); } else { - printf("[RRH] socket for mod_id %d has been successfully closed.\n",Mod_id); + printf("[%s] socket for mod_id %d has been successfully closed.\n",(device->host_type == BBU_HOST)? "BBU":"RRH",Mod_id); } } @@ -253,7 +113,7 @@ int trx_eth_request(openair0_device *device, void *msg, ssize_t msg_len) { eth_state_t *eth = (eth_state_t*)device->priv; /* BBU sends a message to RRH */ - if (sendto(eth->sockfd[Mod_id],msg,msg_len,0,(struct sockaddr *)ð->dest_addr[Mod_id],dest_addr_len[Mod_id])==-1) { + if (sendto(eth->sockfd[Mod_id],msg,msg_len,0,(struct sockaddr *)&dest_addr[Mod_id],dest_addr_len[Mod_id])==-1) { perror("ETHERNET: "); exit(0); } @@ -262,7 +122,6 @@ int trx_eth_request(openair0_device *device, void *msg, ssize_t msg_len) { } - int trx_eth_reply(openair0_device *device, void *msg, ssize_t msg_len) { eth_state_t *eth = (eth_state_t*)device->priv; @@ -273,7 +132,7 @@ int trx_eth_reply(openair0_device *device, void *msg, ssize_t msg_len) { msg, msg_len, 0, - (struct sockaddr *)ð->dest_addr[Mod_id], + (struct sockaddr *)&dest_addr[Mod_id], (socklen_t *)&dest_addr_len[Mod_id])==-1) { perror("ETHERNET: "); exit(0); @@ -283,65 +142,6 @@ int trx_eth_reply(openair0_device *device, void *msg, ssize_t msg_len) { } -static int eth_set_dev_conf(openair0_device *device) { - - int Mod_id = device->Mod_id; - eth_state_t *eth = (eth_state_t*)device->priv; - void *msg; - ssize_t msg_len; - - - /* a BBU client sents to RRH a set of configuration parameters (openair0_config_t) - so that RF front end is configured appropriately and - frame/packet size etc. can be set */ - - msg=malloc(sizeof(openair0_config_t)); - msg_len=sizeof(openair0_config_t); - memcpy(msg,(void*)&device->openair0_cfg,msg_len); - - if (sendto(eth->sockfd[Mod_id],msg,msg_len,0,(struct sockaddr *)ð->dest_addr[Mod_id],dest_addr_len[Mod_id])==-1) { - perror("ETHERNET: "); - exit(0); - } - - return 0; -} - - -static int eth_get_dev_conf(openair0_device *device) { - - eth_state_t *eth = (eth_state_t*)device->priv; - int Mod_id = device->Mod_id; - char str[INET_ADDRSTRLEN]; - void *msg; - ssize_t msg_len; - - msg=malloc(sizeof(openair0_config_t)); - msg_len=sizeof(openair0_config_t); - - /* RRH receives from BBU openair0_config_t */ - if (recvfrom(eth->sockfd[Mod_id], - msg, - msg_len, - 0, - (struct sockaddr *)ð->dest_addr[Mod_id], - (socklen_t *)&dest_addr_len[Mod_id])==-1) { - perror("ETHERNET: "); - exit(0); - } - - memcpy((void*)&device->openair0_cfg,msg,msg_len); - inet_ntop(AF_INET, &(eth->dest_addr[Mod_id].sin_addr), str, INET_ADDRSTRLEN); - device->openair0_cfg.remote_port =ntohs(eth->dest_addr[Mod_id].sin_port); - device->openair0_cfg.remote_ip=str; - /*apply additional configuration*/ - //ethernet_tune (device, RING_PAR); - // printf("[RRH] write mod_%d %d to %s:%d\n",Mod_id,eth->sockfd[Mod_id],str,ntohs(eth->dest_addr[Mod_id].sin_port)); - - return 0; -} - - int trx_eth_stop(int card) { return(0); @@ -364,186 +164,307 @@ int trx_eth_reset_stats(openair0_device* device) { } -static int eth_socket_init(openair0_device *device) { - - int i = 0; - eth_state_t *eth = (eth_state_t*)device->priv; - int Mod_id = device->Mod_id; - char str[INET_ADDRSTRLEN]; - const char *dest_ip; - int dest_port=0; - - if (device->func_type == RRH_FUNC ) { - dest_ip = device->openair0_cfg.my_ip; - dest_port = device->openair0_cfg.my_port; - printf("[RRH] ip addr %s port %d\n",dest_ip, dest_port); - } else { - dest_ip = device->openair0_cfg.remote_ip; - dest_port = device->openair0_cfg.remote_port; - printf("[BBU] ip addr %s port %d\n",dest_ip, dest_port); - } - - /* Open RAW socket to send on */ - if ((eth->sockfd[Mod_id] = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)) == -1) { - perror("ETHERNET: Error opening socket"); - exit(0); - } - - /* initialize destination address */ - for (i=0; i< MAX_INST; i++) { - bzero((void *)&(eth->dest_addr[i]), sizeof(eth->dest_addr[i])); - } - - // bzero((void *)dest,sizeof(struct sockaddr_in)); - eth->dest_addr[Mod_id].sin_family = AF_INET; - inet_pton(AF_INET,dest_ip,&(eth->dest_addr[Mod_id].sin_addr.s_addr)); - eth->dest_addr[Mod_id].sin_port=htons(dest_port); - dest_addr_len[Mod_id] = sizeof(struct sockaddr_in); - inet_ntop(AF_INET, &(eth->dest_addr[Mod_id].sin_addr), str, INET_ADDRSTRLEN); - - /* if RRH, then I am the server, so bind */ - if (device->func_type == RRH_FUNC ) { - if (bind(eth->sockfd[Mod_id],(struct sockaddr *)ð->dest_addr[Mod_id], dest_addr_len[Mod_id])<0) { - perror("ETHERNET: Cannot bind to socket"); - exit(0); - } else { - printf("[RRH] binding mod_%d to %s:%d\n",Mod_id,str,ntohs(eth->dest_addr[Mod_id].sin_port)); - } - - } else { - printf("[BBU] Connecting to %s:%d\n",str,ntohs(eth->dest_addr[Mod_id].sin_port)); - } - - return 0; -} - - -int ethernet_tune(openair0_device *device , eth_opt_t option) { +int ethernet_tune(openair0_device *device, unsigned int option, int value) { eth_state_t *eth = (eth_state_t*)device->priv; int Mod_id=device->Mod_id; - - unsigned int sndbuf_size=0, rcvbuf_size=0; - struct timeval snd_timeout, rcv_timeout; + struct timeval timeout; struct ifreq ifr; char system_cmd[256]; char* if_name=DEFAULT_IF; - - /****************** socket level options ************************/ - if (option== SND_BUF_SIZE) { /* transmit socket buffer size */ + struct in_addr ia; + struct if_nameindex *ids; + int ret=0; + int i=0; + + /****************** socket level options ************************/ + switch(option) { + case SND_BUF_SIZE: /* transmit socket buffer size */ if (setsockopt(eth->sockfd[Mod_id], SOL_SOCKET, SO_SNDBUF, - &sndbuf_size,sizeof(sndbuf_size))) { + &value,sizeof(value))) { perror("[ETHERNET] setsockopt()"); } else { - printf( "sndbuf_size= %d bytes\n", sndbuf_size); - } - } else if (option== RCV_BUF_SIZE) { /* receive socket buffer size */ + printf("send buffer size= %d bytes\n",value); + } + break; + + case RCV_BUF_SIZE: /* receive socket buffer size */ if (setsockopt(eth->sockfd[Mod_id], SOL_SOCKET, SO_RCVBUF, - &rcvbuf_size,sizeof(rcvbuf_size))) { + &value,sizeof(value))) { perror("[ETHERNET] setsockopt()"); } else { - printf( "rcvbuf_size= %d bytes\n", rcvbuf_size); + printf("receive bufffer size= %d bytes\n",value); } - } else if (option==RCV_TIMEOUT) { - rcv_timeout.tv_sec = 0; - rcv_timeout.tv_usec = 180;//less than rt_period + break; + + case RCV_TIMEOUT: + timeout.tv_sec = value/1000000000; + timeout.tv_usec = value%1000000000;//less than rt_period? if (setsockopt(eth->sockfd[Mod_id], SOL_SOCKET, SO_RCVTIMEO, - (char *)&rcv_timeout,sizeof(rcv_timeout))) { + (char *)&timeout,sizeof(timeout))) { perror("[ETHERNET] setsockopt()"); } else { - printf( "rcv_timeout= %d usecs\n", rcv_timeout.tv_usec); + printf( "receive timeout= %d,%d sec\n",timeout.tv_sec,timeout.tv_usec); } - } else if (option==SND_TIMEOUT) { - snd_timeout.tv_sec = 0; - snd_timeout.tv_usec = 180;//less than rt_period + break; + + case SND_TIMEOUT: + timeout.tv_sec = value/1000000000; + timeout.tv_usec = value%1000000000;//less than rt_period? if (setsockopt(eth->sockfd[Mod_id], SOL_SOCKET, SO_SNDTIMEO, - (char *)&snd_timeout,sizeof(snd_timeout))) { + (char *)&timeout,sizeof(timeout))) { perror("[ETHERNET] setsockopt()"); } else { - printf( "snd_timeout= %d usecs\n", snd_timeout.tv_usec); + printf( "send timeout= %d,%d sec\n",timeout.tv_sec,timeout.tv_usec); } - } - - /******************* interface level options *************************/ - else if (option==MTU_SIZE) { /* change MTU of the eth interface */ + break; + + + /******************* interface level options *************************/ + case MTU_SIZE: /* change MTU of the eth interface */ ifr.ifr_addr.sa_family = AF_INET; - strncpy(ifr.ifr_name,if_name, sizeof(ifr.ifr_name)); - ifr.ifr_mtu =8960; + strncpy(ifr.ifr_name,eth->if_name[Mod_id], sizeof(ifr.ifr_name)); + ifr.ifr_mtu =value; if (ioctl(eth->sockfd[Mod_id],SIOCSIFMTU,(caddr_t)&ifr) < 0 ) perror ("[ETHERNET] Can't set the MTU"); else - printf("[ETHERNET] %s MTU size has changed to %d\n",DEFAULT_IF,ifr.ifr_mtu); - } else if (option==TX_Q_LEN) { /* change TX queue length of eth interface */ + printf("[ETHERNET] %s MTU size has changed to %d\n",eth->if_name[Mod_id],ifr.ifr_mtu); + break; + + case TX_Q_LEN: /* change TX queue length of eth interface */ ifr.ifr_addr.sa_family = AF_INET; - strncpy(ifr.ifr_name,if_name, sizeof(ifr.ifr_name)); - ifr.ifr_qlen =3000 ; + strncpy(ifr.ifr_name,eth->if_name[Mod_id], sizeof(ifr.ifr_name)); + ifr.ifr_qlen =value; if (ioctl(eth->sockfd[Mod_id],SIOCSIFTXQLEN,(caddr_t)&ifr) < 0 ) perror ("[ETHERNET] Can't set the txqueuelen"); else - printf("[ETHERNET] %s txqueuelen size has changed to %d\n",DEFAULT_IF,ifr.ifr_qlen); - - + printf("[ETHERNET] %s txqueuelen size has changed to %d\n",eth->if_name[Mod_id],ifr.ifr_qlen); + break; + /******************* device level options *************************/ - } else if (option==COALESCE_PAR) { - if (snprintf(system_cmd,sizeof(system_cmd),"ethtool -C %s rx-usecs 3",DEFAULT_IF) > 0) { - system(system_cmd); + case COALESCE_PAR: + ret=snprintf(system_cmd,sizeof(system_cmd),"ethtool -C %s rx-usecs %d",eth->if_name[Mod_id],value); + if (ret > 0) { + ret=system(system_cmd); + if (ret == -1) { + fprintf (stderr,"[ETHERNET] Can't start shell to execute %s %s",system_cmd, strerror(errno)); + } else { + printf ("[ETHERNET] status of %s is %i\n",WEXITSTATUS(ret)); + } printf("[ETHERNET] Coalesce parameters %s\n",system_cmd); } else { perror("[ETHERNET] Can't set coalesce parameters\n"); } + break; - } else if (option==PAUSE_PAR ) { - if (snprintf(system_cmd,sizeof(system_cmd),"ethtool -A %s autoneg off rx off tx off",DEFAULT_IF) > 0) { - system(system_cmd); + case PAUSE_PAR: + if (value==1) ret=snprintf(system_cmd,sizeof(system_cmd),"ethtool -A %s autoneg off rx off tx off",eth->if_name[Mod_id]); + else if (value==0) ret=snprintf(system_cmd,sizeof(system_cmd),"ethtool -A %s autoneg on rx on tx on",eth->if_name[Mod_id]); + else break; + if (ret > 0) { + ret=system(system_cmd); + if (ret == -1) { + fprintf (stderr,"[ETHERNET] Can't start shell to execute %s %s",system_cmd, strerror(errno)); + } else { + printf ("[ETHERNET] status of %s is %i\n",WEXITSTATUS(ret)); + } printf("[ETHERNET] Pause parameters %s\n",system_cmd); } else { perror("[ETHERNET] Can't set pause parameters\n"); } - } else if (option==RING_PAR ) { - if (snprintf(system_cmd,sizeof(system_cmd),"ethtool -G %s rx 4096 tx 4096",DEFAULT_IF) > 0) { - system(system_cmd); + break; + + case RING_PAR: + ret=snprintf(system_cmd,sizeof(system_cmd),"ethtool -G %s rx %d tx %d",eth->if_name[Mod_id],value); + if (ret > 0) { + ret=system(system_cmd); + if (ret == -1) { + fprintf (stderr,"[ETHERNET] Can't start shell to execute %s %s",system_cmd, strerror(errno)); + } else { + printf ("[ETHERNET] status of %s is %i\n",WEXITSTATUS(ret)); + } printf("[ETHERNET] Ring parameters %s\n",system_cmd); } else { perror("[ETHERNET] Can't set ring parameters\n"); } + break; + default: + break; } + return 0; } -int openair0_dev_init_eth(openair0_device *device, openair0_config_t *openair0_cfg) { +int transport_init(openair0_device *device, openair0_config_t *openair0_cfg, eth_params_t * eth_params ) { eth_state_t *eth = (eth_state_t*)malloc(sizeof(eth_state_t)); - int card = 0; memset(eth, 0, sizeof(eth_state_t)); - eth->buffer_size = (unsigned int)openair0_cfg[card].samples_per_packet*sizeof(int32_t); // buffer size = 4096 for sample_len of 1024 - eth->sample_rate = (unsigned int)openair0_cfg[card].sample_rate; - device->priv = eth; - printf("ETHERNET: Initializing openair0_device for %s ...\n", ((device->func_type == BBU_FUNC) ? "BBU": "RRH")); + if (eth_params->transp_preference == 1) { + eth->flags = ETH_RAW_MODE; + } else { + eth->flags = ETH_UDP_MODE; + } + + printf("[ETHERNET]: Initializing openair0_device for %s ...\n", ((device->host_type == BBU_HOST) ? "BBU": "RRH")); device->Mod_id = num_devices_eth++; + device->transp_type = ETHERNET_TP; device->trx_start_func = trx_eth_start; device->trx_request_func = trx_eth_request; device->trx_reply_func = trx_eth_reply; - device->trx_write_func = trx_eth_write; - device->trx_read_func = trx_eth_read; device->trx_get_stats_func = trx_eth_get_stats; device->trx_reset_stats_func = trx_eth_reset_stats; - device->trx_end_func = trx_eth_end; - device->trx_stop_func = trx_eth_stop; + device->trx_end_func = trx_eth_end; + device->trx_stop_func = trx_eth_stop; device->trx_set_freq_func = trx_eth_set_freq; device->trx_set_gains_func = trx_eth_set_gains; - - memcpy((void*)&device->openair0_cfg,(void*)openair0_cfg,sizeof(openair0_config_t)); + + if ((eth->flags & ETH_RAW_MODE) != 0 ) { + device->trx_write_func = trx_eth_write_raw; + device->trx_read_func = trx_eth_read_raw; + } else { + device->trx_write_func = trx_eth_write_udp; + device->trx_read_func = trx_eth_read_udp; + } + + eth->if_name[device->Mod_id] = eth_params->local_if_name; + device->priv = eth; + + /* device specific */ + openair0_cfg[0].txlaunch_wait = 0;//manage when TX processing is triggered + openair0_cfg[0].txlaunch_wait_slotcount = 0; //manage when TX processing is triggered + openair0_cfg[0].iq_rxrescale = 15;//rescale iqs + openair0_cfg[0].iq_txshift = eth_params->iq_txshift;// shift + openair0_cfg[0].tx_sample_advance = eth_params->tx_sample_advance; + + /* RRH does not have any information to make this configuration atm */ + if (device->host_type == BBU_HOST) { + /*Note scheduling advance values valid only for case 7680000 */ + switch ((int)openair0_cfg[0].sample_rate) { + case 30720000: + openair0_cfg[0].samples_per_packet = 4096; + break; + case 23040000: + openair0_cfg[0].samples_per_packet = 2048; + break; + case 15360000: + openair0_cfg[0].samples_per_packet = 2048; + break; + case 7680000: + openair0_cfg[0].samples_per_packet = 1024; + break; + case 1920000: + openair0_cfg[0].samples_per_packet = 256; + break; + default: + printf("Error: unknown sampling rate %f\n",openair0_cfg[0].sample_rate); + exit(-1); + break; + } + openair0_cfg[0].tx_scheduling_advance = eth_params->tx_scheduling_advance*openair0_cfg[0].samples_per_packet; + } + + device->openair0_cfg=&openair0_cfg[0]; return 0; } + + +/************************************************************************************************************************** + * DEBUGING-RELATED FUNCTIONS * + **************************************************************************************************************************/ +void dump_packet(char *title, unsigned char* pkt, int bytes, unsigned int tx_rx_flag) { + + static int numSend = 1; + static int numRecv = 1; + int num, k; + char tmp[48]; + unsigned short int cksum; + + num = (tx_rx_flag)? numSend++:numRecv++; + for (k = 0; k < 24; k++) sprintf(tmp+k, "%02X", pkt[k]); + cksum = calc_csum((unsigned short *)pkt, bytes>>2); + printf("%s-%s (%06d): %s 0x%04X\n", title,(tx_rx_flag)? "TX":"RX", num, tmp, cksum); +} + +unsigned short calc_csum (unsigned short *buf, int nwords) { + + unsigned long sum; + for (sum = 0; nwords > 0; nwords--) + sum += *buf++; + sum = (sum >> 16) + (sum & 0xffff); + sum += (sum >> 16); + return ~sum; +} + +void dump_dev(openair0_device *device) { + + eth_state_t *eth = (eth_state_t*)device->priv; + + printf("Ethernet device interface %i configuration:\n" ,device->openair0_cfg->Mod_id); + printf(" Log level is %i :\n" ,device->openair0_cfg->log_level); + printf(" RB number: %i, sample rate: %lf \n" , + device->openair0_cfg->num_rb_dl, device->openair0_cfg->sample_rate); + printf(" Scheduling_advance: %i, Sample_advance: %u \n" , + device->openair0_cfg->tx_scheduling_advance, device->openair0_cfg->tx_sample_advance); + printf(" BBU configured for %i tx/%i rx channels)\n", + device->openair0_cfg->tx_num_channels,device->openair0_cfg->rx_num_channels); + printf(" Running flags: %s %s %s\n", + ((eth->flags & ETH_RAW_MODE) ? "RAW socket mode - ":""), + ((eth->flags & ETH_UDP_MODE) ? "UDP socket mode - ":"")); + printf(" Number of iqs dumped when displaying packets: %i\n\n",eth->iqdumpcnt); + +} + +void inline dump_txcounters(openair0_device *device) { + eth_state_t *eth = (eth_state_t*)device->priv; + printf(" Ethernet device interface %i, tx counters:\n" ,device->openair0_cfg->Mod_id); + printf(" Sent packets: %llu send errors: %i\n", eth->tx_count, eth->num_tx_errors); +} + +void inline dump_rxcounters(openair0_device *device) { + + eth_state_t *eth = (eth_state_t*)device->priv; + printf(" Ethernet device interface %i rx counters:\n" ,device->openair0_cfg->Mod_id); + printf(" Received packets: %llu missed packets errors: %i\n", eth->rx_count, eth->num_underflows); +} + +void inline dump_buff(openair0_device *device, char *buff,unsigned int tx_rx_flag, int nsamps) { + + char *strptr; + eth_state_t *eth = (eth_state_t*)device->priv; + /*need to add ts number of iqs in printf need to fix dump iqs call */ + strptr = (( tx_rx_flag == TX_FLAG) ? "TX" : "RX"); + printf("\n %s, nsamps=%i \n" ,strptr,nsamps); + + if (tx_rx_flag == 1) { + dump_txcounters(device); + printf(" First %i iqs of TX buffer\n",eth->iqdumpcnt); + dump_iqs(buff,eth->iqdumpcnt); + } else { + dump_rxcounters(device); + printf(" First %i iqs of RX buffer\n",eth->iqdumpcnt); + dump_iqs(buff,eth->iqdumpcnt); + } + +} + +void dump_iqs(char * buff, int iq_cnt) { + int i; + for (i=0;i<iq_cnt;i++) { + printf("s%02i: Q=%+ij I=%+i%s",i, + ((iqoai_t *)(buff))[i].q, + ((iqoai_t *)(buff))[i].i, + ((i+1)%3 == 0) ? "\n" : " "); + } +} diff --git a/targets/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.h b/targets/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.h index eabec94ebcba082f1c72929664e452919f7cd5bd..b4618bb8254d4abccaf8808ad7024e6cbb53a6b6 100644 --- a/targets/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.h +++ b/targets/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.h @@ -36,6 +36,8 @@ * \note * \warning */ +#ifndef ETHERNET_LIB_H +#define ETHERNET_LIB_H #include <arpa/inet.h> #include <linux/if_packet.h> @@ -47,71 +49,90 @@ #include <net/if.h> #include <netinet/ether.h> -#define MAX_INST 4 -#define DEFAULT_IF "lo" -#define BUF_SIZ 8960 /*Jumbo frame size*/ +#define MAX_INST 4 +#define DEFAULT_IF "lo" -typedef struct { +#define ETH_RAW_MODE 1 +#define ETH_UDP_MODE 0 - // opaque eth data struct - //struct eth_if *dev; - // An empty ("") or NULL device identifier will result in the first encountered device being opened (using the first discovered backend) +#define TX_FLAG 1 +#define RX_FLAG 0 - int sockfd[MAX_INST]; - struct sockaddr_in dest_addr[MAX_INST]; +#define MAX_PACKET_SEQ_NUM(spp,spf) (spf/spp) +#define MAC_HEADER_SIZE_BYTES (sizeof(struct ether_header)) +#define APP_HEADER_SIZE_BYTES (sizeof(int32_t) + sizeof(openair0_timestamp)) +#define PAYLOAD_SIZE_BYTES(nsamps) (nsamps<<2) +#define UDP_PACKET_SIZE_BYTES(nsamps) (APP_HEADER_SIZE_BYTES + PAYLOAD_SIZE_BYTES(nsamps)) +#define RAW_PACKET_SIZE_BYTES(nsamps) (APP_HEADER_SIZE_BYTES + MAC_HEADER_SIZE_BYTES + PAYLOAD_SIZE_BYTES(nsamps)) - unsigned int buffer_size; - unsigned int timeout_ns; - //struct eth_metadata meta_rx; - //struct eth_metadata meta_tx; - - unsigned int sample_rate; - // time offset between transmiter timestamp and receiver timestamp; +/*!\brief opaque ethernet data structure */ +typedef struct { + + /*!\brief socket file desc */ + int sockfd[MAX_INST]; + /*!\brief interface name */ + char *if_name[MAX_INST]; + /*!\brief buffer size */ + unsigned int buffer_size; + /*!\brief timeout ms */ + unsigned int rx_timeout_ms; + /*!\brief timeout ms */ + unsigned int tx_timeout_ms; + /*!\brief runtime flags */ + uint32_t flags; + /*!\ time offset between transmiter timestamp and receiver timestamp */ double tdiff; - // use brf_time_offset to get this value - int tx_forward_nsamps; //166 for 20Mhz - - + /*!\ calibration */ + int tx_forward_nsamps; + // -------------------------------- // Debug and output control // -------------------------------- + + /*!\brief number of I/Q samples to be printed */ + int iqdumpcnt; + + /*!\brief number of underflows in interface */ int num_underflows; + /*!\brief number of overflows in interface */ int num_overflows; + /*!\brief number of concesutive errors in interface */ int num_seq_errors; + /*!\brief number of errors in interface's receiver */ int num_rx_errors; + /*!\brief umber of errors in interface's transmitter */ int num_tx_errors; - - uint64_t tx_actual_nsamps; // actual number of samples transmitted + + /*!\brief current TX timestamp */ + openair0_timestamp tx_current_ts; + /*!\brief socket file desc */ + openair0_timestamp rx_current_ts; + /*!\brief actual number of samples transmitted */ + uint64_t tx_actual_nsamps; + /*!\brief actual number of samples received */ uint64_t rx_actual_nsamps; - uint64_t tx_nsamps; // number of planned samples + /*!\brief number of samples to be transmitted */ + uint64_t tx_nsamps; + /*!\brief number of samples to be received */ uint64_t rx_nsamps; - uint64_t tx_count; // number pf packets + /*!\brief number of packets transmitted */ + uint64_t tx_count; + /*!\brief number of packets received */ uint64_t rx_count; - //openair0_timestamp rx_timestamp; } eth_state_t; -#define ETH_META_STATUS_OVERRUN (1 << 0) -#define ETH_META_STATUS_UNDERRUN (1 << 1) - -struct eth_meta_data{ - uint64_t timestamp; - uint32_t flags; - uint32_t status; - unsigned int actual_count; -}; - /*!\brief packet header */ typedef struct { + /*!\brief packet sequence number max value=packets per frame*/ + uint16_t seq_num ; + /*!\brief antenna port used to resynchronize */ + uint16_t antenna_id; /*!\brief packet's timestamp */ openair0_timestamp timestamp; - /*!\brief variable declared for alignment purposes (sample size=32 bit) */ - int16_t not_used; - /*!\brief antenna port used to resynchronize */ - int16_t antenna_id; } header_t; /*!\brief different options for ethernet tuning in socket and driver level */ @@ -138,9 +159,37 @@ typedef enum { MAX_OPT } eth_opt_t; +/* +#define SND_BUF_SIZE 1 +#define RCV_BUF_SIZE 1<<1 +#define SND_TIMEOUT 1<<2 +#define RCV_TIMEOUT 1<<3 +#define MTU_SIZE 1<<4 +#define TX_Q_LEN 1<<5 +#define RING_PAR 1<<5 +#define COALESCE_PAR 1<<6 +#define PAUSE_PAR 1<<7 +*/ +/*!\brief I/Q samples */ +typedef struct { + /*!\brief phase */ + short i; + /*!\brief quadrature */ + short q; +} iqoai_t ; -/*! \fn int ethernet_tune (openair0_device *device, eth_opt_t option) +void dump_packet(char *title, unsigned char* pkt, int bytes, unsigned int tx_rx_flag); +unsigned short calc_csum (unsigned short *buf, int nwords); +void dump_dev(openair0_device *device); +void inline dump_buff(openair0_device *device, char *buff,unsigned int tx_rx_flag,int nsamps); +void inline dump_rxcounters(openair0_device *device); +void inline dump_txcounters(openair0_device *device); +void dump_iqs(char * buff, int iq_cnt); + + + +/*! \fn int ethernet_tune (openair0_device *device, unsigned int option, int value); * \brief this function allows you to configure certain ethernet parameters in socket or device level * \param[in] openair0 device which bears the socket * \param[in] name of parameter to configure @@ -148,6 +197,37 @@ typedef enum { * \note * @ingroup _oai */ -int ethernet_tune (openair0_device *device, eth_opt_t option); -int ethernet_write_data(openair0_device *device, openair0_timestamp timestamp, void **buff, int nsamps,int cc) ; -int ethernet_read_data(openair0_device *device,openair0_timestamp *timestamp,void **buff, int nsamps,int cc); +int ethernet_tune(openair0_device *device, unsigned int option, int value); + + + +/*! \fn int eth_socket_init_udp(openair0_device *device) +* \brief initialization of UDP Socket to communicate with one destination +* \param[in] *device openair device for which the socket will be created +* \param[out] +* \return 0 on success, otherwise -1 +* \note +* @ingroup _oai +*/ +int eth_socket_init_udp(openair0_device *device); +int trx_eth_write_udp(openair0_device *device, openair0_timestamp timestamp, void **buff, int nsamps,int cc, int flags); +int trx_eth_read_udp(openair0_device *device, openair0_timestamp *timestamp, void **buff, int nsamps, int cc); +int eth_get_dev_conf_udp(openair0_device *device); + +/*! \fn static int eth_set_dev_conf_udp(openair0_device *device) +* \brief +* \param[in] *device openair device +* \param[out] +* \return 0 on success, otherwise -1 +* \note +* @ingroup _oai +*/ +int eth_set_dev_conf_udp(openair0_device *device); +int eth_socket_init_raw(openair0_device *device); +int trx_eth_write_raw(openair0_device *device, openair0_timestamp timestamp, void **buff, int nsamps,int cc, int flags); +int trx_eth_read_raw(openair0_device *device, openair0_timestamp *timestamp, void **buff, int nsamps, int cc); +int eth_get_dev_conf_raw(openair0_device *device); +int eth_set_dev_conf_raw(openair0_device *device); + + +#endif diff --git a/targets/ARCH/EXMIMO/USERSPACE/LIB/openair0_lib.c b/targets/ARCH/EXMIMO/USERSPACE/LIB/openair0_lib.c index 238c94bd7e97a6ce6d6330f260ca99c38e83e5b5..427cd47be831bd4f266789d1d1af1ebf34176f46 100644 --- a/targets/ARCH/EXMIMO/USERSPACE/LIB/openair0_lib.c +++ b/targets/ARCH/EXMIMO/USERSPACE/LIB/openair0_lib.c @@ -247,7 +247,7 @@ int openair0_stop_without_reset(int card) #define MY_RF_MODE (RXEN + TXEN + TXLPFNORM + TXLPFEN + TXLPF25 + RXLPFNORM + RXLPFEN + RXLPF25 + LNA1ON +LNAMax + RFBBNORM + DMAMODE_RX + DMAMODE_TX) #define RF_MODE_BASE (LNA1ON + RFBBNORM) -int openair0_dev_init_exmimo(openair0_device *device, openair0_config_t *openair0_cfg) { +int device_init(openair0_device *device, openair0_config_t *openair0_cfg) { // Initialize card // exmimo_config_t *p_exmimo_config; @@ -287,6 +287,8 @@ int openair0_dev_init_exmimo(openair0_device *device, openair0_config_t *openair return(-1); } + device->type = EXMIMO_DEV; + return(0); } @@ -323,6 +325,12 @@ int openair0_config(openair0_config_t *openair0_cfg, int UE_flag) else p_exmimo_config->framing.multicard_syncmode=SYNCMODE_SLAVE; + /* device specific */ + openair0_cfg[card].txlaunch_wait = 1;//manage when TX processing is triggered + openair0_cfg[card].txlaunch_wait_slotcount = 1; //manage when TX processing is triggered + openair0_cfg[card].iq_txshift = 4;//shift + openair0_cfg[card].iq_rxrescale = 15;//rescale iqs + if (openair0_cfg[card].sample_rate==30.72e6) { resampling_factor = 0; rx_filter = RXLPF10; diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/Si5351C/CMakeLists.txt b/targets/ARCH/LMSSDR/USERSPACE/LIB/Si5351C/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..88a021ae001b40c2992653227425b50a70de9f0e --- /dev/null +++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/Si5351C/CMakeLists.txt @@ -0,0 +1,11 @@ +set(si5351_src_files + Si5351C.cpp +) +set(CMAKE_CXX_FLAGS + "${CMAKE_CXX_FLAGS} ${C_FLAGS_PROCESSOR} -std=c++11 " +) + + +add_library(Si5351C STATIC ${si5351_src_files}) +target_include_directories(Si5351C PUBLIC ../lms7002m ${CMAKE_CURRENT_SOURCE_DIR}) +target_link_libraries(Si5351C LMS7002M) diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/Si5351C/Si5351C.cpp b/targets/ARCH/LMSSDR/USERSPACE/LIB/Si5351C/Si5351C.cpp new file mode 100644 index 0000000000000000000000000000000000000000..88bcb74f3d5c29e99495a773b757fd8355160ad4 --- /dev/null +++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/Si5351C/Si5351C.cpp @@ -0,0 +1,872 @@ +/** +@file Si5351C.cpp +@author Lime Microsystems +@brief Configuring of Si5351C +*/ + +#include "Si5351C.h" +#include "lmsComms.h" +#include <math.h> +#include <iomanip> +#include <fstream> +#include <sstream> +#include <set> +#include <string.h> +#include <assert.h> +#include <iostream> +using namespace std; + +#define Log(msg, type) cout << (msg) << endl; + +/// Splits float into fraction integers A + B/C +void realToFrac(const float real, int &A, int &B, int &C) +{ + A = (int)real; + B = (int)((real - A) * 1048576 + 0.5); + C = 1048576; + + int a = B; + int b = C; + int temp; + while( b!= 0) // greatest common divider + { + temp = a % b; + a = b; + b = temp; + } + B = B/a; + C = C/a; +} + +/// Default configuration +const unsigned char Si5351C::m_defaultConfiguration[] = +{ 0,0x00, + 1,0x00, + 2,0x08, + 3,0x00, + 4,0x00, + 5,0x00, + 6,0x00, + 7,0x00, + 8,0x00, + 9,0x00, + 10,0x00, + 11,0x00, + 12,0x00, + 13,0x00, + 14,0x00, + 15,0x04, + 16,0x4F, + 17,0x4F, + 18,0x4F, + 19,0x4F, + 20,0x4F, + 21,0x4F, + 22,0x0F, + 23,0x0F, + 24,0x00, + 25,0x00, + 26,0x00, + 27,0x80, + 28,0x00, + 29,0x0B, + 30,0x2F, + 31,0x00, + 32,0x00, + 33,0x00, + 34,0x00, + 35,0x00, + 36,0x00, + 37,0x00, + 38,0x00, + 39,0x00, + 40,0x00, + 41,0x00, + 42,0x00, + 43,0x01, + 44,0x00, + 45,0x0D, + 46,0x00, + 47,0x00, + 48,0x00, + 49,0x00, + 50,0x00, + 51,0x01, + 52,0x00, + 53,0x0D, + 54,0x00, + 55,0x00, + 56,0x00, + 57,0x00, + 58,0x00, + 59,0x01, + 60,0x00, + 61,0x0D, + 62,0x00, + 63,0x00, + 64,0x00, + 65,0x00, + 66,0x00, + 67,0x01, + 68,0x00, + 69,0x0D, + 70,0x00, + 71,0x00, + 72,0x00, + 73,0x00, + 74,0x00, + 75,0x01, + 76,0x00, + 77,0x0D, + 78,0x00, + 79,0x00, + 80,0x00, + 81,0x00, + 82,0x00, + 83,0x01, + 84,0x00, + 85,0x0D, + 86,0x00, + 87,0x00, + 88,0x00, + 89,0x00, + 90,0x1E, + 91,0x1E, + 92,0x00, + 93,0x00, + 94,0x00, + 95,0x00, + 96,0x00, + 97,0x00, + 98,0x00, + 99,0x00, +100,0x00, +101,0x00, +102,0x00, +103,0x00, +104,0x00, +105,0x00, +106,0x00, +107,0x00, +108,0x00, +109,0x00, +110,0x00, +111,0x00, +112,0x00, +113,0x00, +114,0x00, +115,0x00, +116,0x00, +117,0x00, +118,0x00, +119,0x00, +120,0x00, +121,0x00, +122,0x00, +123,0x00, +124,0x00, +125,0x00, +126,0x00, +127,0x00, +128,0x00, +129,0x00, +130,0x00, +131,0x00, +132,0x00, +133,0x00, +134,0x00, +135,0x00, +136,0x00, +137,0x00, +138,0x00, +139,0x00, +140,0x00, +141,0x00, +142,0x00, +143,0x00, +144,0x00, +145,0x00, +146,0x00, +147,0x00, +148,0x00, +149,0x00, +150,0x00, +151,0x00, +152,0x00, +153,0x00, +154,0x00, +155,0x00, +156,0x00, +157,0x00, +158,0x00, +159,0x00, +160,0x00, +161,0x00, +162,0x00, +163,0x00, +164,0x00, +165,0x00, +166,0x00, +167,0x00, +168,0x00, +169,0x00, +170,0x00, +171,0x00, +172,0x00, +173,0x00, +174,0x00, +175,0x00, +176,0x00, +177,0x00, +178,0x00, +179,0x00, +180,0x00, +181,0x30, +182,0x00, +183,0xD2, +184,0x60, +185,0x60, +186,0x00, +187,0xC0, +188,0x00, +189,0x00, +190,0x00, +191,0x00, +192,0x00, +193,0x00, +194,0x00, +195,0x00, +196,0x00, +197,0x00, +198,0x00, +199,0x00, +200,0x00, +201,0x00, +202,0x00, +203,0x00, +204,0x00, +205,0x00, +206,0x00, +207,0x00, +208,0x00, +209,0x00, +210,0x00, +211,0x00, +212,0x00, +213,0x00, +214,0x00, +215,0x00, +216,0x00, +217,0x00, +218,0x00, +219,0x00, +220,0x00, +221,0x0D, +222,0x00, +223,0x00, +224,0x00, +225,0x00, +226,0x00, +227,0x00, +228,0x00, +229,0x00, +230,0x00, +231,0x00, +232,0x00}; + +// --------------------------------------------------------------------------- +Si5351C::Si5351C() +{ + memset(m_newConfiguration, 0, 255); + for(unsigned int i=0; i<sizeof(m_defaultConfiguration); i+=2) + { + m_newConfiguration[m_defaultConfiguration[i]] = m_defaultConfiguration[i+1]; + } + device = NULL; +} +// --------------------------------------------------------------------------- + +Si5351C::~Si5351C() +{ + +} + +/** @brief Sends Configuration to Si5351C +*/ +Si5351C::Status Si5351C::UploadConfiguration() +{ + LMScomms::GenericPacket pkt; + pkt.cmd = CMD_SI5351_WR; + + if (!device) + return FAILED; + //Disable outputs + pkt.outBuffer.push_back(3); + pkt.outBuffer.push_back(0xFF); + //Power down all output drivers + for(int i=0; i<8; ++i) + { + pkt.outBuffer.push_back(16 + i); + pkt.outBuffer.push_back(0x84); + } + //write new configuration + for (int i = 15; i <= 92; ++i) + { + pkt.outBuffer.push_back(i); + pkt.outBuffer.push_back(m_newConfiguration[i]); + } + for (int i = 149; i <= 170; ++i) + { + pkt.outBuffer.push_back(i); + pkt.outBuffer.push_back(m_newConfiguration[i]); + } + //apply soft reset + pkt.outBuffer.push_back(177); + pkt.outBuffer.push_back(0xAC); + //Enabe desired outputs + pkt.outBuffer.push_back(3); + pkt.outBuffer.push_back(m_newConfiguration[3]); + + if( !device->IsOpen() ) + { + return FAILED; + } + LMScomms::TransferStatus status; + status = device->TransferPacket(pkt); + if (status != LMScomms::TRANSFER_SUCCESS || pkt.status != STATUS_COMPLETED_CMD) + { + return FAILED; + } + return SUCCESS; +} + +// --------------------------------------------------------------------------- +/** + @brief Sets connection manager to use for data transferring Si5351C + @param mng connection manager for data transferring +*/ +void Si5351C::Initialize(LMScomms *mng) +{ + assert(mng != nullptr); + device = mng; +} + +/** + @brief Loads register values for Si5356A from file + @param FName input filename +*/ +bool Si5351C::LoadRegValuesFromFile(string FName) +{ + fstream fin; + fin.open(FName.c_str(), ios::in); + + const int len = 1024; + char line[len]; + + int addr; + int value; + + while(!fin.eof()) + { + fin.getline(line, len); + if( line[0] == '#') + continue; + if( strcmp(line, "#END_PROFILE") == 0) + break; + sscanf(line, "%i,%x",&addr,&value); + m_newConfiguration[addr] = value; + } + + fin.close(); + return false; +}; + +/** @brief Calculates multisynth dividers and VCO frequencies + @param clocks output clocks configuration + @param plls plls configurations + @param Fmin lowest VCO frequency + @param Fmax highest VCO frequency +*/ +void Si5351C::FindVCO(Si5351_Channel *clocks, Si5351_PLL *plls, const unsigned long Fmin, const unsigned long Fmax) +{ + int clockCount = 8; + //reset output parameters + for(int i=0; i<clockCount; i++) + { + clocks[i].pllSource = 0; + clocks[i].int_mode = 0; + clocks[i].multisynthDivider = 8; + } + + bool clk6satisfied = !clocks[6].powered; + bool clk7satisfied = !clocks[7].powered; + + bool pllAused = false; + bool pllBused = false; + + map< unsigned long, int> availableFrequenciesPLLA; //all available frequencies for VCO + map< unsigned long, int> availableFrequenciesPLLB; //all available frequencies for VCO + + //if clk6 or clk7 is used make available frequencies according to them + if(clocks[6].powered || clocks[7].powered) + { + set<unsigned long> clk6freqs; + set<unsigned long> clk7freqs; + set<unsigned long> sharedFreqs; + unsigned int mult = 6; + if(!clk6satisfied) + { + unsigned long freq = clocks[6].outputFreqHz; + while(freq <= Fmax && mult <= 254) + { + freq = clocks[6].outputFreqHz*mult; + if(freq >= Fmin && freq <= Fmax) + { + clk6freqs.insert(freq); + } + mult += 2; + } + } + mult = 6; + if(!clk7satisfied) + { + unsigned long freq = clocks[7].outputFreqHz; + while(freq <= Fmax && mult <= 254) + { + freq = clocks[7].outputFreqHz*mult; + if(freq >= Fmin && freq <= Fmax) + { + clk7freqs.insert(freq); + } + mult += 2; + } + } + bool canShare = false; + //find if clk6 and clk7 can share the same pll + for (set<unsigned long>::iterator it6=clk6freqs.begin(); it6!=clk6freqs.end(); ++it6) + { + for (set<unsigned long>::iterator it7=clk7freqs.begin(); it7!=clk7freqs.end(); ++it7) + { + if(*it6 == *it7) + { + canShare = true; + sharedFreqs.insert(*it6); + } + } + } + if(canShare) //assign PLLA for both clocks + { + clocks[6].pllSource = 0; + clocks[7].pllSource = 0; + pllAused = true; + for (set<unsigned long>::iterator it=sharedFreqs.begin(); it!=sharedFreqs.end(); ++it) + { + availableFrequenciesPLLA.insert( pair<unsigned long, int> (*it, 0) ); + } + clk6satisfied = true; + clk7satisfied = true; + } + else //if clocks 6 and 7 can't share pll, assign pllA to clk6 and pllB to clk7 + { + if(!clk6satisfied) + { + clocks[6].pllSource = 0; + clk6satisfied = true; + pllAused = true; + for (set<unsigned long>::iterator it6=clk6freqs.begin(); it6!=clk6freqs.end(); ++it6) + { + availableFrequenciesPLLA.insert( pair<unsigned long, int>(*it6, 0) ); + } + } + if(!clk7satisfied) + { + clocks[7].pllSource = 1; + clk7satisfied = true; + pllBused = true; + for (set<unsigned long>::iterator it7=clk7freqs.begin(); it7!=clk7freqs.end(); ++it7) + { + availableFrequenciesPLLB.insert( pair<unsigned long, int> (*it7, 0) ); + } + } + } + } + + //PLLA stage, find all clocks that have integer coefficients with PLLA + //if pllA is not used by clk6 or clk7, fill available frequencies according to clk1-clk5 clocks + if( availableFrequenciesPLLA.size() == 0 && !pllAused) + { + for(int i=0; i<6; ++i) + { + unsigned long freq = clocks[i].outputFreqHz > Fmin ? clocks[i].outputFreqHz : (clocks[i].outputFreqHz*((Fmin/clocks[i].outputFreqHz) + ((Fmin%clocks[i].outputFreqHz)!=0))); + while(freq >= Fmin && freq <= Fmax) + { + //add all output frequency multiples that are in VCO interval + availableFrequenciesPLLA.insert( pair<unsigned long, int> (freq, 0)); + freq += clocks[i].outputFreqHz; + } + } + } + + unsigned int bestScore = 0; //score shows how many outputs have integer dividers + //calculate scores for all available frequencies + unsigned long bestVCOA = 0; + for (map<unsigned long, int>::iterator it=availableFrequenciesPLLA.begin(); it!=availableFrequenciesPLLA.end(); ++it) + { + for(int i=0; i<8; ++i) + { + if(clocks[i].outputFreqHz == 0 || !clocks[i].powered) + continue; + + if( (it->first % clocks[i].outputFreqHz) == 0) + { + it->second = it->second+1; + } + } + if(it->second >= bestScore) + { + bestScore = it->second; + bestVCOA = it->first; + } + } + //scores calculated + //cout << "PLLA stage: " << endl; + //cout << "best score: " << bestScore << " best VCO: " << bestVCOA << endl; + plls[0].VCO_Hz = bestVCOA; + plls[0].feedbackDivider = (double)bestVCOA/plls[0].inputFreqHz; + + for(int i=0; i<clockCount; ++i) + { + if(clocks[i].outputFreqHz == 0 || !clocks[i].powered) + continue; + + clocks[i].multisynthDivider = bestVCOA/clocks[i].outputFreqHz; + if(bestVCOA%clocks[i].outputFreqHz == 0) + { + clocks[i].int_mode = true; + clocks[i].multisynthDivider = bestVCOA/clocks[i].outputFreqHz; + } + else + { + clocks[i].int_mode = false; + clocks[i].multisynthDivider = (double)bestVCOA/clocks[i].outputFreqHz; + } + clocks[i].pllSource = 0; + } + + + //PLLB stage, find all clocks that have integer coefficients with PLLB + //if pllB is not used by clk6 or clk7, fill available frequencies according to clk1-clk5 clocks, that don't have integer dividers + if( availableFrequenciesPLLB.size() == 0 && !pllBused) + { + for(int i=0; i<6; ++i) + { + if(clocks[i].outputFreqHz == 0 || !clocks[i].powered) + continue; + + if(clocks[i].int_mode) //skip clocks with integer dividers + continue; + unsigned long freq = clocks[i].outputFreqHz > Fmin ? clocks[i].outputFreqHz : (clocks[i].outputFreqHz*((Fmin/clocks[i].outputFreqHz) + ((Fmin%clocks[i].outputFreqHz)!=0))); + while(freq >= Fmin && freq <= Fmax) + { + availableFrequenciesPLLB.insert( pair<unsigned long, int> (freq, 0)); + freq += clocks[i].outputFreqHz; + } + } + } + + bestScore = 0; + //calculate scores for all available frequencies + unsigned long bestVCOB = 0; + for (map<unsigned long, int>::iterator it=availableFrequenciesPLLB.begin(); it!=availableFrequenciesPLLB.end(); ++it) + { + for(int i=0; i<8; ++i) + { + if(clocks[i].outputFreqHz == 0 || !clocks[i].powered) + continue; + + if( (it->first % clocks[i].outputFreqHz) == 0) + { + it->second = it->second+1; + } + } + if(it->second >= bestScore) + { + bestScore = it->second; + bestVCOB = it->first; + } + } + //scores calculated +// cout << "PLLB stage: " << endl; +// cout << "best score: " << bestScore << " best VCO: " << bestVCOB << endl; + if(bestVCOB == 0) //just in case if pllb is not used make it the same frequency as plla + bestVCOB = bestVCOA; + plls[1].VCO_Hz = bestVCOB; + plls[1].feedbackDivider = (double)bestVCOB/plls[0].inputFreqHz; + for(int i=0; i<clockCount; ++i) + { + if(clocks[i].outputFreqHz == 0 || !clocks[i].powered) + continue; + + if(clocks[i].int_mode) + continue; + clocks[i].multisynthDivider = bestVCOB/clocks[i].outputFreqHz; + if(bestVCOB%clocks[i].outputFreqHz == 0) + { + clocks[i].int_mode = true; + clocks[i].multisynthDivider = bestVCOB/clocks[i].outputFreqHz; + } + else + { + clocks[i].int_mode = false; + clocks[i].multisynthDivider = (double)bestVCOB/clocks[i].outputFreqHz; + } + clocks[i].pllSource = 1; + } +} + + +/** @brief Modifies register map with clock settings + @return true if success +*/ +Si5351C::Status Si5351C::ConfigureClocks() +{ + FindVCO(CLK, PLL, 600000000, 900000000); + stringstream ss; + int addr; + m_newConfiguration[3] = 0; + for(int i=0; i<8; ++i) + { + m_newConfiguration[3] |= (!CLK[i].powered) << i; //enabled + m_newConfiguration[16+i] = 0; + m_newConfiguration[16+i] |= !CLK[i].powered << 7; // powered + + if(CLK[i].int_mode) + { + m_newConfiguration[16+i] |= 1 << 6; //integer mode + } + else + m_newConfiguration[16+i] |= 0 << 6; + + m_newConfiguration[16+i] |= CLK[i].pllSource << 5; //PLL source + m_newConfiguration[16+i] |= CLK[i].inverted << 4; // invert + m_newConfiguration[16+i] |= 3 << 2; + m_newConfiguration[16+i] |= 3; + + addr = 42+i*8; + ss.clear(); + ss.str( string() ); + ss << "CLK" << i << " fOut = " << CLK[i].outputFreqHz/1000000.0 << " MHz"; + int DivA; + int DivB; + int DivC; + + realToFrac(CLK[i].multisynthDivider, DivA, DivB, DivC); + ss << " Multisynth Divider " << DivA << " " << DivB << "/" << DivC; + ss << " R divider = " << CLK[i].outputDivider << " source = " << (CLK[i].pllSource == 0 ? "PLLA" : "PLLB") << endl; + + Log(ss.str(), LOG_INFO); + + if( CLK[i].multisynthDivider < 8 || 900 < CLK[i].multisynthDivider) + { + Log("Si5351C - Output multisynth divider is outside [8;900] interval.\n", LOG_ERROR); + return FAILED; + } + + if(i<6) + { + if(CLK[i].outputFreqHz <= 150000000) + { + unsigned MSX_P1 = 128 * DivA + floor(128 * ( (float)DivB/DivC)) - 512; + unsigned MSX_P2 = 128 * DivB - DivC * floor( 128 * DivB/DivC ); + unsigned MSX_P3 = DivC; + + m_newConfiguration[addr] = MSX_P3 >> 8; + m_newConfiguration[addr+1] = MSX_P3; + + m_newConfiguration[addr+2] = 0; + m_newConfiguration[addr+2] |= (MSX_P1 >> 16 ) & 0x03; + m_newConfiguration[addr+3] = MSX_P1 >> 8; + m_newConfiguration[addr+4] = MSX_P1; + + m_newConfiguration[addr+5] = 0; + m_newConfiguration[addr+5] = (MSX_P2 >> 16) & 0x0F; + m_newConfiguration[addr+5] |= (MSX_P3 >> 16) << 4; + + m_newConfiguration[addr+6] = MSX_P2; + m_newConfiguration[addr+7] = MSX_P2 >> 8; + } + else if( CLK[i].outputFreqHz <= 160000000) // AVAILABLE ONLY ON 0-5 MULTISYNTHS + { + Log("Si5351C - clock configuring for more than 150 MHz not implemented\n", LOG_ERROR); + return FAILED; + } + } + else // CLK6 and CLK7 only integer mode + { + if(CLK[i].outputFreqHz <= 150000000) + { + if(i==6) + { + m_newConfiguration[90] = DivA; + if(DivA%2 != 0) + { + Log("Si5351C - CLK6 multisynth divider is not even integer\n", LOG_ERROR); + return FAILED; + } + } + else + { + m_newConfiguration[91] = DivA; + if(DivA%2 != 0) + { + Log("Si5351C - CLK7 multisynth divider is not even integer\n", LOG_ERROR); + return FAILED; + } + } + } + else if( CLK[i].outputFreqHz <= 160000000) // AVAILABLE ONLY ON 0-5 MULTISYNTHS + { + Log("Si5351C - clock configuring for more than 150 MHz not implemented\n", LOG_ERROR); + return FAILED; + } + } + } + + //configure pll + //set input clk source + m_newConfiguration[15] = m_newConfiguration[15] & 0xF3; + m_newConfiguration[15] |= (PLL[0].CLK_SRC & 1) << 2; + m_newConfiguration[15] |= (PLL[1].CLK_SRC & 1) << 3; + for(int i=0; i<2; ++i) + { + addr = 26+i*8; + if(PLL[i].feedbackDivider < 15 || PLL[i].feedbackDivider > 90) + { + Log("Si5351C - VCO frequency divider out of range [15:90].\n", LOG_ERROR); + return FAILED; + } + if( PLL[i].VCO_Hz < 600000000 || PLL[i].VCO_Hz > 900000000) + { + Log("Si5351C - Can't calculate valid VCO frequency.\n", LOG_ERROR); + return FAILED; + } + ss.clear(); + ss.str(string()); + ss << "Si5351C : VCO" << (i==0 ? "A" : "B") << " = " << PLL[i].VCO_Hz/1000000.0 << " MHz"; + + //calculate MSNx_P1, MSNx_P2, MSNx_P3 + int MSNx_P1; + int MSNx_P2; + int MSNx_P3; + + int DivA; + int DivB; + int DivC; + realToFrac(PLL[i].feedbackDivider, DivA, DivB, DivC); + ss << " Feedback Divider " << DivA << " " << DivB << "/" << DivC << endl; + Log(ss.str(), LOG_INFO); + + MSNx_P1 = 128 * DivA + floor(128 * ( (float)DivB/DivC)) - 512; + MSNx_P2 = 128 * DivB - DivC * floor( 128 * DivB/DivC ); + MSNx_P3 = DivC; + + m_newConfiguration[addr+4] = MSNx_P1; + m_newConfiguration[addr+3] = MSNx_P1 >> 8; + m_newConfiguration[addr+2] = MSNx_P1 >> 16; + + m_newConfiguration[addr+7] = MSNx_P2; + m_newConfiguration[addr+6] = MSNx_P2 >> 8; + m_newConfiguration[addr+5] = 0; + m_newConfiguration[addr+5] = (MSNx_P2 >> 16) & 0x0F; + + m_newConfiguration[addr+5] |= (MSNx_P3 >> 16) << 4; + m_newConfiguration[addr+1] |= MSNx_P3; + m_newConfiguration[addr] |= MSNx_P3 >> 8; + } + return SUCCESS; +} + +/** @brief Sets output clock parameters + @param id clock id 0-CLK0 1-CLK1 ... + @param fOut_Hz output frequency in Hz + @param enabled is this output powered + @param inverted invert clock +*/ +void Si5351C::SetClock(unsigned char id, unsigned long fOut_Hz, bool enabled, bool inverted) +{ + if( id < 8) + { + if(fOut_Hz < 8000 || fOut_Hz > 160000000) + { + stringstream ss; + ss << "Si5351C - CLK" << (int)id << " output frequency must be between 8kHz and 160MHz. fOut_MHz = " << fOut_Hz/1000000.0 << endl; + Log(ss.str(), LOG_ERROR); + return; + } + CLK[id].powered = enabled; + CLK[id].inverted = inverted; + CLK[id].outputFreqHz = fOut_Hz; + } +} + +/** @brief Sets PLL input frequency + @param id PLL id 0-PLLA 1-PLLB + @param CLKIN_Hz clock input in Hz +*/ +void Si5351C::SetPLL(unsigned char id, unsigned long CLKIN_Hz, int CLK_SRC) +{ + if (id < 2) + { + PLL[id].inputFreqHz = CLKIN_Hz; + PLL[id].CLK_SRC = CLK_SRC; + } +} + +/** @brief Resets configuration registers to default values +*/ +void Si5351C::Reset() +{ + memset(m_newConfiguration, 0, 255); + for(unsigned int i=0; i<sizeof(m_defaultConfiguration); i+=2) + { + m_newConfiguration[m_defaultConfiguration[i]] = m_defaultConfiguration[i+1]; + } +} + +Si5351C::StatusBits Si5351C::GetStatusBits() +{ + StatusBits stat; + LMScomms::GenericPacket pkt; + pkt.cmd = CMD_SI5351_RD; + pkt.outBuffer.push_back(0); + pkt.outBuffer.push_back(1); + LMScomms::TransferStatus status; + status = device->TransferPacket(pkt); + if (status != LMScomms::TRANSFER_SUCCESS || pkt.status != STATUS_COMPLETED_CMD) + { + return stat; + } + + stat.sys_init = (pkt.inBuffer[0] >> 7); + stat.lol_b = (pkt.inBuffer[0] >> 6) & 0x1; + stat.lol_a = (pkt.inBuffer[0] >> 5) & 0x1; + stat.los = (pkt.inBuffer[0] >> 4) & 0x1; + stat.sys_init_stky = (pkt.inBuffer[1] >> 7); + stat.lol_b_stky = (pkt.inBuffer[1] >> 6) & 0x1; + stat.lol_a_stky = (pkt.inBuffer[1] >> 5) & 0x1; + stat.los_stky = (pkt.inBuffer[1] >> 4) & 0x1; + return stat; +} + +Si5351C::Status Si5351C::ClearStatus() +{ + LMScomms::GenericPacket pkt; + pkt.cmd = CMD_SI5351_WR; + pkt.outBuffer.push_back(1); + pkt.outBuffer.push_back(0x0); + LMScomms::TransferStatus status; + status = device->TransferPacket(pkt); + if (status != LMScomms::TRANSFER_SUCCESS || pkt.status != STATUS_COMPLETED_CMD) + return FAILED; + return SUCCESS; +} diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/Si5351C/Si5351C.h b/targets/ARCH/LMSSDR/USERSPACE/LIB/Si5351C/Si5351C.h new file mode 100644 index 0000000000000000000000000000000000000000..971a2d1d69a81a86a2eb67c01fb81aa9d93af2e1 --- /dev/null +++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/Si5351C/Si5351C.h @@ -0,0 +1,100 @@ +/** +@file Si5351C.h +@brief Header for Si5351C.cpp +@author Lime Microsystems +*/ + +#ifndef SI5351C_MODULE +#define SI5351C_MODULE + +#include <stdio.h> +#include <string> +using namespace std; +//--------------------------------------------------------------------------- + +enum eSi_CLOCK_INPUT +{ + Si_CLKIN, + Si_XTAL, + Si_CMOS +}; + +struct Si5351_Channel +{ + Si5351_Channel() : outputDivider(1), outputFreqHz(1), multisynthDivider(1), pllSource(0), + phaseOffset(0), powered(true), inverted(false), int_mode(false) {}; + int outputDivider; + unsigned long outputFreqHz; + float multisynthDivider; + int pllSource; + float phaseOffset; + bool powered; + bool inverted; + bool int_mode; +}; + +struct Si5351_PLL +{ + Si5351_PLL() : inputFreqHz(0), VCO_Hz(0), feedbackDivider(0), CLKIN_DIV(1), CLK_SRC(1) {} + unsigned long inputFreqHz; + float VCO_Hz; + float feedbackDivider; + int CLKIN_DIV; + int CLK_SRC; //0-XTAL, 1-CLKIN +}; + +class LMScomms; +class Si5351C +{ +public: + enum Status + { + SUCCESS, + FAILED, + }; + + struct StatusBits + { + StatusBits() : sys_init(0), sys_init_stky(0), lol_b(0), lol_b_stky(0), lol_a(0), lol_a_stky(0), los(0), los_stky(0) + { + + } + int sys_init; + int sys_init_stky; + int lol_b; + int lol_b_stky; + int lol_a; + int lol_a_stky; + int los; + int los_stky; + }; + + StatusBits GetStatusBits(); + Status ClearStatus(); + + Si5351C(); + ~Si5351C(); + void Initialize(LMScomms *mng); + bool LoadRegValuesFromFile(string FName); + + void SetPLL(unsigned char id, unsigned long CLKIN_Hz, int CLK_SRC); + void SetClock(unsigned char id, unsigned long fOut_Hz, bool enabled = true, bool inverted = false); + + Status UploadConfiguration(); + Status ConfigureClocks(); + void Reset(); + +private: + void FindVCO(Si5351_Channel *clocks, Si5351_PLL *plls, const unsigned long Fmin, const unsigned long Fmax); + LMScomms *device; + + Si5351_PLL PLL[2]; + Si5351_Channel CLK[8]; + + static const unsigned char m_defaultConfiguration[]; + unsigned char m_newConfiguration[255]; + + +}; + +#endif // SI5351C_MODULE diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/CMakeLists.txt b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..cea22ac8292c7cf8ca74e571df33cd774693667c --- /dev/null +++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/CMakeLists.txt @@ -0,0 +1,63 @@ +cmake_minimum_required(VERSION 2.8) +set(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE TYPE INTERNAL FORCE) +project("lms7api") +#include modules for finding FFTW and CyAPI +set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/") +cmake_policy(SET CMP0015 OLD) +if(${CMAKE_MAJOR_VERSION} GREATER 2) + cmake_policy(SET CMP0043 NEW) +endif() +ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS) +if(CMAKE_COMPILER_IS_GNUCXX) + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x") +endif() + +# set up include-directories +include_directories( + "${PROJECT_SOURCE_DIR}" + "${PROJECT_BINARY_DIR}" + cpp-feather-ini-parser + ) + +set(LMS7002M_src_files + LMS7002M.cpp + LMS7002M_parameters.cpp + LMS7002M_statuses.cpp + LMS7002M_filtersCalibration.cpp + lmsComms.cpp + LMS7002M_RegistersMap.cpp +) + +set(ENABLE_USB_CONNECTION "YES" CACHE BOOL INTERNAL) +set(ENABLE_SPI_CONNECTION "NO" CACHE BOOL INTERNAL) +set(CONNECTION_MANAGER_DIR connectionManager) +set(connectionManager_src_files + ${CONNECTION_MANAGER_DIR}/ConnectionManager.cpp + ${CONNECTION_MANAGER_DIR}/ConnectionCOM.cpp + ${CONNECTION_MANAGER_DIR}/ConnectionManager.h + ${CONNECTION_MANAGER_DIR}/ConnectionCOM.h +) +if(ENABLE_USB_CONNECTION) + list(APPEND connectionManager_src_files ${CONNECTION_MANAGER_DIR}/ConnectionUSB.cpp ${CONNECTION_MANAGER_DIR}/ConnectionUSB.h) + add_definitions(-DENABLE_USB_CONNECTION) +endif() +if(ENABLE_SPI_CONNECTION) + list(APPEND connectionManager_src_files ${CONNECTION_MANAGER_DIR}/ConnectionSPI.cpp ${CONNECTION_MANAGER_DIR}/ConnectionSPI.h) + add_definitions(-DENABLE_SPI_CONNECTION) +endif() + +add_library(LMS7002M STATIC ${LMS7002M_src_files} ${connectionManager_src_files}) +target_include_directories(LMS7002M PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) + +if(WIN32 AND ENABLE_USB_CONNECTION) + find_package(CyAPI REQUIRED) + LINK_DIRECTORIES(${CYAPI_LIBRARIES}) + include_directories(${CYAPI_INCLUDE_DIRS}) + set(CONNECTION_MANAGER_LIBS ${CYAPI_LIBRARIES} SetupAPI) + target_link_libraries(LMS7002M ${CONNECTION_MANAGER_LIBS}) +endif() +if(UNIX AND ENABLE_USB_CONNECTION) + set(CONNECTION_MANAGER_LIBS usb-1.0 -lpthread) + target_link_libraries(LMS7002M ${CONNECTION_MANAGER_LIBS}) +endif() + diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/LMS7002M.cpp b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/LMS7002M.cpp new file mode 100644 index 0000000000000000000000000000000000000000..ded70e114f706d60e981f340bef0f26652a387ab --- /dev/null +++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/LMS7002M.cpp @@ -0,0 +1,2612 @@ +/** +@file LMS7002M.cpp +@author Lime Microsystems (www.limemicro.com) +@brief Implementation of LMS7002M transceiver configuring +*/ + +#include "LMS7002M.h" +#include <stdio.h> +#include <set> +#include "lmsComms.h" +#include "INI.h" +#include <cmath> +#include <iostream> +#include <algorithm> +#include "LMS7002M_RegistersMap.h" + +#include <chrono> +#include <thread> + +float_type LMS7002M::gVCO_frequency_table[3][2] = { { 3800, 5222 }, { 4961, 6754 }, {6306, 7714} }; +float_type LMS7002M::gCGEN_VCO_frequencies[2] = {2000, 2700}; + +///define for parameter enumeration if prefix might be needed +#define LMS7param(id) id + +//module addresses needs to be sorted in ascending order +const uint16_t LMS7002M::readOnlyRegisters[] = { 0x002F, 0x008C, 0x00A8, 0x00A9, 0x00AA, 0x00AB, 0x00AC, 0x0123, 0x0209, 0x020A, 0x020B, 0x040E, 0x040F }; +const uint16_t LMS7002M::readOnlyRegistersMasks[] = { 0x0000, 0x0FFF, 0x007F, 0x0000, 0x0000, 0x0000, 0x0000, 0x003F, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 }; + +/** @brief Simple logging function to print status messages + @param text message to print + @param type message type for filtering specific information +*/ +void LMS7002M::Log(const char* text, LogType type) +{ + switch(type) + { + case LOG_INFO: + printf("%s\n", text); + break; + case LOG_WARNING: + printf("Warning: %s\n", text); + break; + case LOG_ERROR: + printf("ERROR: %s\n", text); + break; + case LOG_DATA: + printf("DATA: %s\n", text); + break; + } +} + +LMS7002M::LMS7002M() : controlPort(NULL), mRegistersMap(new LMS7002M_RegistersMap()) +{ + mRefClkSXR_MHz = 30.72; + mRefClkSXT_MHz = 30.72; +} + +/** @brief Creates LMS7002M main control object, it requires LMScomms to communicate with chip + @param controlPort data connection for controlling LMS7002 chip registers +*/ +LMS7002M::LMS7002M(LMScomms* controlPort) : + controlPort(controlPort), mRegistersMap(new LMS7002M_RegistersMap()) +{ + mRefClkSXR_MHz = 30.72; + mRefClkSXT_MHz = 30.72; + + //memory intervals for registers tests and calibration algorithms + MemorySectionAddresses[LimeLight][0] = 0x0020; + MemorySectionAddresses[LimeLight][1] = 0x002F; + MemorySectionAddresses[EN_DIR][0] = 0x0081; + MemorySectionAddresses[EN_DIR][1] = 0x0081; + MemorySectionAddresses[AFE][0] = 0x0082; + MemorySectionAddresses[AFE][1] = 0x0082; + MemorySectionAddresses[BIAS][0] = 0x0084; + MemorySectionAddresses[BIAS][1] = 0x0084; + MemorySectionAddresses[XBUF][0] = 0x0085; + MemorySectionAddresses[XBUF][1] = 0x0085; + MemorySectionAddresses[CGEN][0] = 0x0086; + MemorySectionAddresses[CGEN][1] = 0x008C; + MemorySectionAddresses[LDO][0] = 0x0092; + MemorySectionAddresses[LDO][1] = 0x00A7; + MemorySectionAddresses[BIST][0] = 0x00A8; + MemorySectionAddresses[BIST][1] = 0x00AC; + MemorySectionAddresses[CDS][0] = 0x00AD; + MemorySectionAddresses[CDS][1] = 0x00AE; + MemorySectionAddresses[TRF][0] = 0x0100; + MemorySectionAddresses[TRF][1] = 0x0104; + MemorySectionAddresses[TBB][0] = 0x0105; + MemorySectionAddresses[TBB][1] = 0x010A; + MemorySectionAddresses[RFE][0] = 0x010C; + MemorySectionAddresses[RFE][1] = 0x0114; + MemorySectionAddresses[RBB][0] = 0x0115; + MemorySectionAddresses[RBB][1] = 0x011A; + MemorySectionAddresses[SX][0] = 0x011C; + MemorySectionAddresses[SX][1] = 0x0124; + MemorySectionAddresses[TxTSP][0] = 0x0200; + MemorySectionAddresses[TxTSP][1] = 0x020C; + MemorySectionAddresses[TxNCO][0] = 0x0240; + MemorySectionAddresses[TxNCO][1] = 0x0261; + MemorySectionAddresses[TxGFIR1][0] = 0x0280; + MemorySectionAddresses[TxGFIR1][1] = 0x02A7; + MemorySectionAddresses[TxGFIR2][0] = 0x02C0; + MemorySectionAddresses[TxGFIR2][1] = 0x02E7; + MemorySectionAddresses[TxGFIR3a][0] = 0x0300; + MemorySectionAddresses[TxGFIR3a][1] = 0x0327; + MemorySectionAddresses[TxGFIR3b][0] = 0x0340; + MemorySectionAddresses[TxGFIR3b][1] = 0x0367; + MemorySectionAddresses[TxGFIR3c][0] = 0x0380; + MemorySectionAddresses[TxGFIR3c][1] = 0x03A7; + MemorySectionAddresses[RxTSP][0] = 0x0400; + MemorySectionAddresses[RxTSP][1] = 0x040F; + MemorySectionAddresses[RxNCO][0] = 0x0440; + MemorySectionAddresses[RxNCO][1] = 0x0461; + MemorySectionAddresses[RxGFIR1][0] = 0x0480; + MemorySectionAddresses[RxGFIR1][1] = 0x04A7; + MemorySectionAddresses[RxGFIR2][0] = 0x04C0; + MemorySectionAddresses[RxGFIR2][1] = 0x04E7; + MemorySectionAddresses[RxGFIR3a][0] = 0x0500; + MemorySectionAddresses[RxGFIR3a][1] = 0x0527; + MemorySectionAddresses[RxGFIR3b][0] = 0x0540; + MemorySectionAddresses[RxGFIR3b][1] = 0x0567; + MemorySectionAddresses[RxGFIR3c][0] = 0x0580; + MemorySectionAddresses[RxGFIR3c][1] = 0x05A7; + + mRegistersMap->InitializeDefaultValues(LMS7parameterList); +} + +LMS7002M::~LMS7002M() +{ + +} + +/** @brief Sends reset signal to chip, after reset enables B channel controls + @return 0-success, other-failure +*/ +liblms7_status LMS7002M::ResetChip() +{ + if (controlPort == NULL) + return LIBLMS7_NO_CONNECTION_MANAGER; + if (controlPort->IsOpen() == false) + return LIBLMS7_NOT_CONNECTED; + + LMScomms::GenericPacket pkt; + pkt.cmd = CMD_LMS7002_RST; + pkt.outBuffer.push_back(LMS_RST_PULSE); + controlPort->TransferPacket(pkt); + if (pkt.status == STATUS_COMPLETED_CMD) + { + Modify_SPI_Reg_bits(LMS7param(MIMO_SISO), 0); //enable B channel after reset + return LIBLMS7_SUCCESS; + } + else + return LIBLMS7_FAILURE; +} + +liblms7_status LMS7002M::LoadConfigLegacyFile(const char* filename) +{ + ifstream f(filename); + if (f.good() == false) //file not found + { + f.close(); + return LIBLMS7_FILE_NOT_FOUND; + } + f.close(); + uint16_t addr = 0; + uint16_t value = 0; + uint8_t ch = (uint8_t)Get_SPI_Reg_bits(LMS7param(MAC)); //remember used channel + liblms7_status status; + typedef INI<string, string, string> ini_t; + ini_t parser(filename, true); + if (parser.select("FILE INFO") == false) + return LIBLMS7_FILE_INVALID_FORMAT; + + string type = ""; + type = parser.get("type", "undefined"); + stringstream ss; + if (type.find("LMS7002 configuration") == string::npos) + { + ss << "File " << filename << " not recognized" << endl; + return LIBLMS7_FILE_INVALID_FORMAT; + } + + int fileVersion = 0; + fileVersion = parser.get("version", 0); + + vector<uint16_t> addrToWrite; + vector<uint16_t> dataToWrite; + if (fileVersion == 1) + { + if (parser.select("Reference clocks")) + { + mRefClkSXR_MHz = parser.get("SXR reference frequency MHz", 30.72); + mRefClkSXT_MHz = parser.get("SXT reference frequency MHz", 30.72); + } + + if (parser.select("LMS7002 registers ch.A") == true) + { + ini_t::sectionsit_t section = parser.sections.find("LMS7002 registers ch.A"); + + uint16_t x0020_value = 0; + Modify_SPI_Reg_bits(LMS7param(MAC), 1); //select A channel + for (ini_t::keysit_t pairs = section->second->begin(); pairs != section->second->end(); pairs++) + { + sscanf(pairs->first.c_str(), "%hx", &addr); + sscanf(pairs->second.c_str(), "%hx", &value); + if (addr == LMS7param(MAC).address) //skip register containing channel selection + { + x0020_value = value; + continue; + } + addrToWrite.push_back(addr); + dataToWrite.push_back(value); + } + status = SPI_write_batch(&addrToWrite[0], &dataToWrite[0], addrToWrite.size()); + if (status != LIBLMS7_SUCCESS && status != LIBLMS7_NOT_CONNECTED) + return status; + + //parse FCW or PHO + if (parser.select("NCO Rx ch.A") == true) + { + char varname[64]; + int mode = Get_SPI_Reg_bits(LMS7param(MODE_RX)); + if (mode == 0) //FCW + { + for (int i = 0; i < 16; ++i) + { + sprintf(varname, "FCW%02i", i); + SetNCOFrequency(LMS7002M::Rx, i, parser.get(varname, 0.0)); + } + } + else + { + for (int i = 0; i < 16; ++i) + { + sprintf(varname, "PHO%02i", i); + SetNCOPhaseOffset(LMS7002M::Rx, i, parser.get(varname, 0.0)); + } + } + } + if (parser.select("NCO Tx ch.A") == true) + { + char varname[64]; + int mode = Get_SPI_Reg_bits(LMS7param(MODE_TX)); + if (mode == 0) //FCW + { + for (int i = 0; i < 16; ++i) + { + sprintf(varname, "FCW%02i", i); + SetNCOFrequency(LMS7002M::Tx, i, parser.get(varname, 0.0)); + } + } + else + { + for (int i = 0; i < 16; ++i) + { + sprintf(varname, "PHO%02i", i); + SetNCOPhaseOffset(LMS7002M::Tx, i, parser.get(varname, 0.0)); + } + } + } + status = SPI_write(0x0020, x0020_value); + if (status != LIBLMS7_SUCCESS && status != LIBLMS7_NOT_CONNECTED) + return status; + } + + Modify_SPI_Reg_bits(LMS7param(MAC), 2); + + if (parser.select("LMS7002 registers ch.B") == true) + { + addrToWrite.clear(); + dataToWrite.clear(); + ini_t::sectionsit_t section = parser.sections.find("LMS7002 registers ch.B"); + for (ini_t::keysit_t pairs = section->second->begin(); pairs != section->second->end(); pairs++) + { + sscanf(pairs->first.c_str(), "%hx", &addr); + sscanf(pairs->second.c_str(), "%hx", &value); + addrToWrite.push_back(addr); + dataToWrite.push_back(value); + } + Modify_SPI_Reg_bits(LMS7param(MAC), 2); //select B channel + status = SPI_write_batch(&addrToWrite[0], &dataToWrite[0], addrToWrite.size()); + if (status != LIBLMS7_SUCCESS && status != LIBLMS7_NOT_CONNECTED) + return status; + + //parse FCW or PHO + if (parser.select("NCO Rx ch.B") == true) + { + char varname[64]; + int mode = Get_SPI_Reg_bits(LMS7param(MODE_RX)); + if (mode == 0) //FCW + { + for (int i = 0; i < 16; ++i) + { + sprintf(varname, "FCW%02i", i); + SetNCOFrequency(LMS7002M::Rx, i, parser.get(varname, 0.0)); + } + } + else + { + for (int i = 0; i < 16; ++i) + { + sprintf(varname, "PHO%02i", i); + SetNCOPhaseOffset(LMS7002M::Rx, i, parser.get(varname, 0.0)); + } + } + } + if (parser.select("NCO Tx ch.A") == true) + { + char varname[64]; + int mode = Get_SPI_Reg_bits(LMS7param(MODE_TX)); + if (mode == 0) //FCW + { + for (int i = 0; i < 16; ++i) + { + sprintf(varname, "FCW%02i", i); + SetNCOFrequency(LMS7002M::Tx, i, parser.get(varname, 0.0)); + } + } + else + { + for (int i = 0; i < 16; ++i) + { + sprintf(varname, "PHO%02i", i); + SetNCOPhaseOffset(LMS7002M::Tx, i, parser.get(varname, 0.0)); + } + } + } + } + Modify_SPI_Reg_bits(LMS7param(MAC), ch); + return LIBLMS7_SUCCESS; + } + else + return LIBLMS7_FILE_INVALID_FORMAT; + return LIBLMS7_FAILURE; +} + +/** @brief Reads configuration file and uploads registers to chip + @param filename Configuration source file + @return 0-success, other-failure +*/ +liblms7_status LMS7002M::LoadConfig(const char* filename) +{ + ifstream f(filename); + if (f.good() == false) //file not found + { + f.close(); + return LIBLMS7_FILE_NOT_FOUND; + } + f.close(); + uint16_t addr = 0; + uint16_t value = 0; + uint8_t ch = (uint8_t)Get_SPI_Reg_bits(LMS7param(MAC)); //remember used channel + + liblms7_status status; + typedef INI<string, string, string> ini_t; + ini_t parser(filename, true); + if (parser.select("file_info") == false) + { + //try loading as legacy format + status = LoadConfigLegacyFile(filename); + Modify_SPI_Reg_bits(MAC, 1); + return status; + } + string type = ""; + type = parser.get("type", "undefined"); + stringstream ss; + if (type.find("lms7002m_minimal_config") == string::npos) + { + ss << "File " << filename << " not recognized" << endl; + return LIBLMS7_FILE_INVALID_FORMAT; + } + + int fileVersion = 0; + fileVersion = parser.get("version", 0); + + vector<uint16_t> addrToWrite; + vector<uint16_t> dataToWrite; + + if (fileVersion == 1) + { + if(parser.select("lms7002_registers_a") == true) + { + ini_t::sectionsit_t section = parser.sections.find("lms7002_registers_a"); + + uint16_t x0020_value = 0; + Modify_SPI_Reg_bits(LMS7param(MAC), 1); //select A channel + for (ini_t::keysit_t pairs = section->second->begin(); pairs != section->second->end(); pairs++) + { + sscanf(pairs->first.c_str(), "%hx", &addr); + sscanf(pairs->second.c_str(), "%hx", &value); + if (addr == LMS7param(MAC).address) //skip register containing channel selection + { + x0020_value = value; + continue; + } + addrToWrite.push_back(addr); + dataToWrite.push_back(value); + } + status = SPI_write_batch(&addrToWrite[0], &dataToWrite[0], addrToWrite.size()); + if (status != LIBLMS7_SUCCESS && status != LIBLMS7_NOT_CONNECTED) + return status; + status = SPI_write(0x0020, x0020_value); + if (status != LIBLMS7_SUCCESS && status != LIBLMS7_NOT_CONNECTED) + return status; + Modify_SPI_Reg_bits(LMS7param(MAC), 2); + if (status != LIBLMS7_SUCCESS && status != LIBLMS7_NOT_CONNECTED) + return status; + } + + if (parser.select("lms7002_registers_b") == true) + { + addrToWrite.clear(); + dataToWrite.clear(); + ini_t::sectionsit_t section = parser.sections.find("lms7002_registers_b"); + for (ini_t::keysit_t pairs = section->second->begin(); pairs != section->second->end(); pairs++) + { + sscanf(pairs->first.c_str(), "%hx", &addr); + sscanf(pairs->second.c_str(), "%hx", &value); + addrToWrite.push_back(addr); + dataToWrite.push_back(value); + } + Modify_SPI_Reg_bits(LMS7param(MAC), 2); //select B channel + status = SPI_write_batch(&addrToWrite[0], &dataToWrite[0], addrToWrite.size()); + if (status != LIBLMS7_SUCCESS && status != LIBLMS7_NOT_CONNECTED) + return status; + } + Modify_SPI_Reg_bits(LMS7param(MAC), ch); + + parser.select("reference_clocks"); + mRefClkSXR_MHz = parser.get("sxr_ref_clk_mhz", 30.72); + mRefClkSXT_MHz = parser.get("sxt_ref_clk_mhz", 30.72); + } + + Modify_SPI_Reg_bits(MAC, 1); + if (controlPort == NULL) + return LIBLMS7_NO_CONNECTION_MANAGER; + if (controlPort->IsOpen() == false) + return LIBLMS7_NOT_CONNECTED; + return LIBLMS7_SUCCESS; +} + +/** @brief Reads all registers from chip and saves to file + @param filename destination filename + @return 0-success, other failure +*/ +liblms7_status LMS7002M::SaveConfig(const char* filename) +{ + liblms7_status status; + typedef INI<> ini_t; + ini_t parser(filename, true); + parser.create("file_info"); + parser.set("type", "lms7002m_minimal_config"); + parser.set("version", 1); + + char addr[80]; + char value[80]; + + uint8_t ch = (uint8_t)Get_SPI_Reg_bits(LMS7param(MAC)); + + vector<uint16_t> addrToRead; + for (uint8_t i = 0; i < MEMORY_SECTIONS_COUNT; ++i) + for (uint16_t addr = MemorySectionAddresses[i][0]; addr <= MemorySectionAddresses[i][1]; ++addr) + addrToRead.push_back(addr); + vector<uint16_t> dataReceived; + dataReceived.resize(addrToRead.size(), 0); + + parser.create("lms7002_registers_a"); + Modify_SPI_Reg_bits(LMS7param(MAC), 1); + for (uint16_t i = 0; i < addrToRead.size(); ++i) + { + dataReceived[i] = Get_SPI_Reg_bits(addrToRead[i], 15, 0, false); + sprintf(addr, "0x%04X", addrToRead[i]); + sprintf(value, "0x%04X", dataReceived[i]); + parser.set(addr, value); + } + + parser.create("lms7002_registers_b"); + addrToRead.clear(); //add only B channel addresses + for (uint8_t i = 0; i < MEMORY_SECTIONS_COUNT; ++i) + for (uint16_t addr = MemorySectionAddresses[i][0]; addr <= MemorySectionAddresses[i][1]; ++addr) + if (addr >= 0x0100) + addrToRead.push_back(addr); + + Modify_SPI_Reg_bits(LMS7param(MAC), 2); + for (uint16_t i = 0; i < addrToRead.size(); ++i) + { + dataReceived[i] = Get_SPI_Reg_bits(addrToRead[i], 15, 0, false); + sprintf(addr, "0x%04X", addrToRead[i]); + sprintf(value, "0x%04X", dataReceived[i]); + parser.set(addr, value); + } + + Modify_SPI_Reg_bits(LMS7param(MAC), ch); //retore previously used channel + + parser.create("reference_clocks"); + parser.set("sxt_ref_clk_mhz", mRefClkSXT_MHz); + parser.set("sxr_ref_clk_mhz", mRefClkSXR_MHz); + parser.save(filename); + return LIBLMS7_SUCCESS; +} + +/** @brief Returns reference clock in MHz used for SXT or SXR + @param Tx transmitter or receiver selection +*/ +float_type LMS7002M::GetReferenceClk_SX(bool tx) +{ + return tx ? mRefClkSXT_MHz : mRefClkSXR_MHz; +} + +/** @return Current CLKGEN frequency in MHz + Returned frequency depends on reference clock used for Receiver +*/ +float_type LMS7002M::GetFrequencyCGEN_MHz() +{ + float_type dMul = (mRefClkSXR_MHz/2.0)/(Get_SPI_Reg_bits(LMS7param(DIV_OUTCH_CGEN))+1); //DIV_OUTCH_CGEN + uint16_t gINT = Get_SPI_Reg_bits(0x0088, 13, 0); //read whole register to reduce SPI transfers + uint32_t gFRAC = ((gINT & 0xF) * 65536) | Get_SPI_Reg_bits(0x0087, 15, 0); + return dMul * (((gINT>>4) + 1 + gFRAC/1048576.0)); +} + +/** @brief Returns TSP reference frequency + @param tx TxTSP or RxTSP selection + @return TSP reference frequency in MHz +*/ +float_type LMS7002M::GetReferenceClk_TSP_MHz(bool tx) +{ + float_type cgenFreq = GetFrequencyCGEN_MHz(); + float_type clklfreq = cgenFreq/pow(2.0, Get_SPI_Reg_bits(LMS7param(CLKH_OV_CLKL_CGEN))); + if(Get_SPI_Reg_bits(LMS7param(EN_ADCCLKH_CLKGN)) == 0) + return tx ? clklfreq : cgenFreq/4.0; + else + return tx ? cgenFreq : clklfreq/4.0; +} + +/** @brief Sets CLKGEN frequency, calculations use receiver'r reference clock + @param freq_MHz desired frequency in MHz + @return 0-succes, other-cannot deliver desired frequency +*/ +liblms7_status LMS7002M::SetFrequencyCGEN(const float_type freq_MHz) +{ + float_type dFvco; + float_type dFrac; + int16_t iHdiv; + + //VCO frequency selection according to F_CLKH + iHdiv = (int16_t)((gCGEN_VCO_frequencies[1]/ 2) / freq_MHz) - 1; + dFvco = 2*(iHdiv+1) * freq_MHz; + + //Integer division + uint16_t gINT = (uint16_t)(dFvco/mRefClkSXR_MHz - 1); + + //Fractional division + dFrac = dFvco/mRefClkSXR_MHz - (uint32_t)(dFvco/mRefClkSXR_MHz); + uint32_t gFRAC = (uint32_t)(dFrac * 1048576); + + Modify_SPI_Reg_bits(LMS7param(INT_SDM_CGEN), gINT); //INT_SDM_CGEN + Modify_SPI_Reg_bits(0x0087, 15, 0, gFRAC&0xFFFF); //INT_SDM_CGEN[15:0] + Modify_SPI_Reg_bits(0x0088, 3, 0, gFRAC>>16); //INT_SDM_CGEN[19:16] + Modify_SPI_Reg_bits(LMS7param(DIV_OUTCH_CGEN), iHdiv); //DIV_OUTCH_CGEN + + return TuneVCO(VCO_CGEN); +} + +/** @brief Performs VCO tuning operations for CLKGEN, SXR, SXT modules + @param module module selection for tuning 0-cgen, 1-SXR, 2-SXT + @return 0-success, other-failure +*/ +liblms7_status LMS7002M::TuneVCO(VCO_Module module) // 0-cgen, 1-SXR, 2-SXT +{ + if (controlPort == NULL) + return LIBLMS7_NO_CONNECTION_MANAGER; + if (controlPort->IsOpen() == false) + return LIBLMS7_NOT_CONNECTED; + int8_t i; + uint8_t cmphl; //comparators + int16_t csw_lowest = -1; + uint16_t addrVCOpd; // VCO power down address + uint16_t addrCSW_VCO; + uint16_t addrCMP; //comparator address + uint8_t lsb; //SWC lsb index + uint8_t msb; //SWC msb index + + uint8_t ch = (uint8_t)Get_SPI_Reg_bits(LMS7param(MAC)); //remember used channel + + if(module != VCO_CGEN) //set addresses to SX module + { + Modify_SPI_Reg_bits(LMS7param(MAC), module); + addrVCOpd = LMS7param(PD_VCO).address; + addrCSW_VCO = LMS7param(CSW_VCO).address; + lsb = LMS7param(CSW_VCO).lsb; + msb = LMS7param(CSW_VCO).msb; + addrCMP = LMS7param(VCO_CMPHO).address; + } + else //set addresses to CGEN module + { + addrVCOpd = LMS7param(PD_VCO_CGEN).address; + addrCSW_VCO = LMS7param(CSW_VCO_CGEN).address; + lsb = LMS7param(CSW_VCO_CGEN).lsb; + msb = LMS7param(CSW_VCO_CGEN).msb; + addrCMP = LMS7param(VCO_CMPHO_CGEN).address; + } + // Initialization + Modify_SPI_Reg_bits (addrVCOpd, 2, 1, 0); //activate VCO and comparator + if (Get_SPI_Reg_bits(addrVCOpd, 2, 1) != 0) + return LIBLMS7_VCO_IS_POWERED_DOWN; + if(module == VCO_CGEN) + Modify_SPI_Reg_bits(LMS7param(SPDUP_VCO_CGEN), 1); //SHORT_NOISEFIL=1 SPDUP_VCO_ Short the noise filter resistor to speed up the settling time + else + Modify_SPI_Reg_bits(LMS7param(SPDUP_VCO), 1); //SHORT_NOISEFIL=1 SPDUP_VCO_ Short the noise filter resistor to speed up the settling time + Modify_SPI_Reg_bits (addrCSW_VCO , msb, lsb , 0); //Set SWC_VCO<7:0>=<00000000> + + i=7; + while(i>=0) + { + Modify_SPI_Reg_bits (addrCSW_VCO, lsb + i, lsb + i, 1); // CSW_VCO<i>=1 + std::this_thread::sleep_for(std::chrono::milliseconds(5)); + cmphl = (uint8_t)Get_SPI_Reg_bits(addrCMP, 13, 12); + if ( (cmphl&0x01) == 1) // reduce CSW + Modify_SPI_Reg_bits (addrCSW_VCO, lsb + i, lsb + i, 0); // CSW_VCO<i>=0 + if( cmphl == 2 && csw_lowest < 0) + csw_lowest = Get_SPI_Reg_bits(addrCSW_VCO, msb, lsb); + --i; + } + if(csw_lowest >= 0) + { + uint16_t csw_highest = Get_SPI_Reg_bits(addrCSW_VCO, msb, lsb); + if(csw_lowest == csw_highest) + { + while(csw_lowest>=0) + { + Modify_SPI_Reg_bits(addrCSW_VCO, msb, lsb, csw_lowest); + std::this_thread::sleep_for(std::chrono::milliseconds(5)); + if(Get_SPI_Reg_bits(addrCMP, 13, 12) == 0) + { + ++csw_lowest; + break; + } + else + --csw_lowest; + } + } + Modify_SPI_Reg_bits(addrCSW_VCO, msb, lsb, csw_lowest+(csw_highest-csw_lowest)/2); + } + if (module == VCO_CGEN) + Modify_SPI_Reg_bits(LMS7param(SPDUP_VCO_CGEN), 0); //SHORT_NOISEFIL=1 SPDUP_VCO_ Short the noise filter resistor to speed up the settling time + else + Modify_SPI_Reg_bits(LMS7param(SPDUP_VCO), 0); //SHORT_NOISEFIL=1 SPDUP_VCO_ Short the noise filter resistor to speed up the settling time + cmphl = (uint8_t)Get_SPI_Reg_bits(addrCMP, 13, 12); + Modify_SPI_Reg_bits(LMS7param(MAC), ch); //restore previously used channel + if(cmphl == 2) + return LIBLMS7_SUCCESS; + else + return LIBLMS7_FAILURE; +} + +/** @brief Returns given parameter value from chip register + @param param LMS7002M control parameter + @param fromChip read directly from chip + @return parameter value +*/ +uint16_t LMS7002M::Get_SPI_Reg_bits(const LMS7Parameter ¶m, bool fromChip) +{ + return Get_SPI_Reg_bits(param.address, param.msb, param.lsb, fromChip); +} + +/** @brief Returns given parameter value from chip register + @param address register address + @param msb most significant bit index + @param lsb least significant bit index + @param fromChip read directly from chip + @return register bits from selected interval, shifted to right by lsb bits +*/ +uint16_t LMS7002M::Get_SPI_Reg_bits(uint16_t address, uint8_t msb, uint8_t lsb, bool fromChip) +{ + return (SPI_read(address, fromChip) & (~(~0<<(msb+1)))) >> lsb; //shift bits to LSB +} + +/** @brief Change given parameter value + @param param LMS7002M control parameter + @param fromChip read initial value directly from chip + @param value new parameter value +*/ +liblms7_status LMS7002M::Modify_SPI_Reg_bits(const LMS7Parameter ¶m, const uint16_t value, bool fromChip) +{ + return Modify_SPI_Reg_bits(param.address, param.msb, param.lsb, value, fromChip); +} + +/** @brief Change given parameter value + @param address register address + @param value new bits value, the value is shifted left by lsb bits + @param fromChip read initial value directly from chip +*/ +liblms7_status LMS7002M::Modify_SPI_Reg_bits(const uint16_t address, const uint8_t msb, const uint8_t lsb, const uint16_t value, bool fromChip) +{ + uint16_t spiDataReg = SPI_read(address, fromChip); //read current SPI reg data + uint16_t spiMask = (~(~0 << (msb - lsb + 1))) << (lsb); // creates bit mask + spiDataReg = (spiDataReg & (~spiMask)) | ((value << lsb) & spiMask);//clear bits + return SPI_write(address, spiDataReg); //write modified data back to SPI reg +} + +/** @brief Modifies given registers with values applied using masks + @param addr array of register addresses + @param masks array of applied masks + @param values array of values to be written + @param start starting index of given arrays + @param stop end index of given arrays +*/ +liblms7_status LMS7002M::Modify_SPI_Reg_mask(const uint16_t *addr, const uint16_t *masks, const uint16_t *values, uint8_t start, uint8_t stop) +{ + liblms7_status status; + uint16_t reg_data; + vector<uint16_t> addresses; + vector<uint16_t> data; + while (start <= stop) + { + reg_data = SPI_read(addr[start], true, &status); //read current SPI reg data + reg_data &= ~masks[start];//clear bits + reg_data |= (values[start] & masks[start]); + addresses.push_back(addr[start]); + data.push_back(reg_data); + ++start; + } + if (status != LIBLMS7_SUCCESS) + return status; + SPI_write_batch(&addresses[0], &data[0], addresses.size()); + return status; +} + +/** @brief Sets SX frequency + @param Tx Rx/Tx module selection + @param freq_MHz desired frequency in MHz + @param refClk_MHz reference clock in MHz + @return 0-success, other-cannot deliver requested frequency +*/ +liblms7_status LMS7002M::SetFrequencySX(bool tx, float_type freq_MHz, float_type refClk_MHz) +{ + if (controlPort == NULL) + return LIBLMS7_NO_CONNECTION_MANAGER; + if (controlPort->IsOpen() == false) + return LIBLMS7_NOT_CONNECTED; + const uint8_t sxVCO_N = 2; //number of entries in VCO frequencies + const float_type m_dThrF = 5500; //threshold to enable additional divider + uint8_t ch; //remember used channel + float_type VCOfreq; + int8_t div_loch; + int8_t sel_vco; + bool canDeliverFrequency = false; + uint16_t integerPart; + uint32_t fractionalPart; + int8_t i; + + //find required VCO frequency + for (div_loch = 6; div_loch >= 0; --div_loch) + { + VCOfreq = (1 << (div_loch + 1)) * freq_MHz; + if ((VCOfreq >= gVCO_frequency_table[0][0]) && (VCOfreq <= gVCO_frequency_table[2][sxVCO_N - 1])) + { + canDeliverFrequency = true; + break; + } + } + if (canDeliverFrequency == false) + return LIBLMS7_CANNOT_DELIVER_FREQUENCY; + + integerPart = (uint16_t)(VCOfreq / (refClk_MHz * (1 + (VCOfreq > m_dThrF))) - 4); + fractionalPart = (uint32_t)((VCOfreq / (refClk_MHz * (1 + (VCOfreq > m_dThrF))) - (uint32_t)(VCOfreq / (refClk_MHz * (1 + (VCOfreq > m_dThrF))))) * 1048576); + + ch = (uint8_t)Get_SPI_Reg_bits(LMS7param(MAC)); + Modify_SPI_Reg_bits(LMS7param(MAC), tx + 1); + Modify_SPI_Reg_bits(LMS7param(INT_SDM), integerPart); //INT_SDM + Modify_SPI_Reg_bits(0x011D, 15, 0, fractionalPart & 0xFFFF); //FRAC_SDM[15:0] + Modify_SPI_Reg_bits(0x011E, 3, 0, (fractionalPart >> 16)); //FRAC_SDM[19:16] + Modify_SPI_Reg_bits(LMS7param(DIV_LOCH), div_loch); //DIV_LOCH + Modify_SPI_Reg_bits(LMS7param(EN_DIV2_DIVPROG), (VCOfreq > m_dThrF)); //EN_DIV2_DIVPROG + + //find which VCO supports required frequency + Modify_SPI_Reg_bits(LMS7param(PD_VCO), 0); // + Modify_SPI_Reg_bits(LMS7param(PD_VCO_COMP), 0); // + int cswBackup = Get_SPI_Reg_bits(LMS7param(CSW_VCO)); //remember to restore previous tune value + canDeliverFrequency = false; + int tuneScore[] = { -128, -128, -128 }; //best is closest to 0 + for (sel_vco = 0; sel_vco < 3; ++sel_vco) + { + Modify_SPI_Reg_bits(LMS7param(SEL_VCO), sel_vco); + liblms7_status status = TuneVCO(tx ? VCO_SXT : VCO_SXR); + int csw = Get_SPI_Reg_bits(LMS7param(CSW_VCO), true); + tuneScore[sel_vco] = -128 + csw; + if (status == LIBLMS7_SUCCESS) + canDeliverFrequency = true; + } + if (abs(tuneScore[0]) < abs(tuneScore[1])) + { + if (abs(tuneScore[0]) < abs(tuneScore[2])) + sel_vco = 0; + else + sel_vco = 2; + } + else + { + if (abs(tuneScore[1]) < abs(tuneScore[2])) + sel_vco = 1; + else + sel_vco = 2; + } + Modify_SPI_Reg_bits(LMS7param(SEL_VCO), sel_vco); + Modify_SPI_Reg_bits(LMS7param(CSW_VCO), cswBackup); + Modify_SPI_Reg_bits(LMS7param(MAC), ch); //restore used channel + if (tx) + mRefClkSXT_MHz = refClk_MHz; + else + mRefClkSXR_MHz = refClk_MHz; + if (canDeliverFrequency == false) + return LIBLMS7_CANNOT_DELIVER_FREQUENCY; + return TuneVCO( tx ? VCO_SXT : VCO_SXR); //Rx-1, Tx-2 +} + +/** @brief Returns currently set SXR/SXT frequency + @return SX frequency MHz +*/ +float_type LMS7002M::GetFrequencySX_MHz(bool Tx, float_type refClk_MHz) +{ + uint8_t ch = (uint8_t)Get_SPI_Reg_bits(LMS7param(MAC)); //remember previously used channel + float_type dMul; + if(Tx) + Modify_SPI_Reg_bits(LMS7param(MAC), 2); // Rx mac = 1, Tx max = 2 + else + Modify_SPI_Reg_bits(LMS7param(MAC), 1); // Rx mac = 1, Tx max = 2 + uint16_t gINT = Get_SPI_Reg_bits(0x011E, 13, 0); // read whole register to reduce SPI transfers + uint32_t gFRAC = ((gINT&0xF) * 65536) | Get_SPI_Reg_bits(0x011D, 15, 0); + + dMul = (float_type)refClk_MHz / (1 << (Get_SPI_Reg_bits(LMS7param(DIV_LOCH)) + 1)); + //Calculate real frequency according to the calculated parameters + dMul = dMul * ((gINT >> 4) + 4 + (float_type)gFRAC / 1048576.0) * (Get_SPI_Reg_bits(LMS7param(EN_DIV2_DIVPROG)) + 1); + Modify_SPI_Reg_bits(LMS7param(MAC), ch); //restore used channel + return dMul; +} + +/** @brief Loads given DC_REG values into registers + @param tx TxTSP or RxTSP selection + @param I DC_REG I value + @param Q DC_REG Q value +*/ +liblms7_status LMS7002M::LoadDC_REG_IQ(bool tx, int16_t I, int16_t Q) +{ + if(tx) + { + Modify_SPI_Reg_bits(LMS7param(DC_REG_TXTSP), I); + Modify_SPI_Reg_bits(LMS7param(TSGDCLDI_TXTSP), 0); + Modify_SPI_Reg_bits(LMS7param(TSGDCLDI_TXTSP), 1); + Modify_SPI_Reg_bits(LMS7param(TSGDCLDI_TXTSP), 0); + Modify_SPI_Reg_bits(LMS7param(DC_REG_TXTSP), Q); + Modify_SPI_Reg_bits(LMS7param(TSGDCLDQ_TXTSP), 0); + Modify_SPI_Reg_bits(LMS7param(TSGDCLDQ_TXTSP), 1); + Modify_SPI_Reg_bits(LMS7param(TSGDCLDQ_TXTSP), 0); + Modify_SPI_Reg_bits(LMS7param(DC_BYP_TXTSP), 0); //DC_BYP + } + else + { + Modify_SPI_Reg_bits(LMS7param(DC_REG_RXTSP), I); + Modify_SPI_Reg_bits(LMS7param(TSGDCLDI_RXTSP), 0); + Modify_SPI_Reg_bits(LMS7param(TSGDCLDI_RXTSP), 1); + Modify_SPI_Reg_bits(LMS7param(TSGDCLDI_RXTSP), 0); + Modify_SPI_Reg_bits(LMS7param(DC_REG_TXTSP), Q); + Modify_SPI_Reg_bits(LMS7param(TSGDCLDQ_RXTSP), 0); + Modify_SPI_Reg_bits(LMS7param(TSGDCLDQ_RXTSP), 1); + Modify_SPI_Reg_bits(LMS7param(TSGDCLDQ_RXTSP), 0); + Modify_SPI_Reg_bits(LMS7param(DC_BYP_RXTSP), 0); //DC_BYP + } + return LIBLMS7_SUCCESS; +} + +/** @brief Sets chosen NCO's frequency + @param tx transmitter or receiver selection + @param index NCO index from 0 to 15 + @param freq_MHz desired NCO frequency + @return 0-success, other-failure +*/ +liblms7_status LMS7002M::SetNCOFrequency(bool tx, uint8_t index, float_type freq_MHz) +{ + if(index > 15) + return LIBLMS7_INDEX_OUT_OF_RANGE; + float_type refClk_MHz = GetReferenceClk_TSP_MHz(tx); + uint16_t addr = tx ? 0x0240 : 0x0440; + uint32_t fcw = (uint32_t)((freq_MHz/refClk_MHz)*4294967296); + SPI_write(addr+2+index*2, (fcw >> 16)); //NCO frequency control word register MSB part. + SPI_write(addr+3+index*2, fcw); //NCO frequency control word register LSB part. + return LIBLMS7_SUCCESS; +} + +/** @brief Returns chosen NCO's frequency in MHz + @param tx transmitter or receiver selection + @param index NCO index from 0 to 15 + @param fromChip read frequency directly from chip or local registers + @return NCO frequency in MHz +*/ +float_type LMS7002M::GetNCOFrequency_MHz(bool tx, uint8_t index, const float_type refClk_MHz, bool fromChip) +{ + if(index > 15) + return LIBLMS7_INDEX_OUT_OF_RANGE; + uint16_t addr = tx ? 0x0240 : 0x0440; + uint32_t fcw = 0; + fcw |= SPI_read(addr + 2 + index * 2, fromChip) << 16; //NCO frequency control word register MSB part. + fcw |= SPI_read(addr + 3 + index * 2, fromChip); //NCO frequency control word register LSB part. + return refClk_MHz*(fcw/4294967296.0); +} + +/** @brief Sets chosen NCO phase offset angle when memory table MODE is 0 +@param tx transmitter or receiver selection +@param angle_deg phase offset angle in degrees +@return 0-success, other-failure +*/ +liblms7_status LMS7002M::SetNCOPhaseOffsetForMode0(bool tx, float_type angle_deg) +{ + uint16_t addr = tx ? 0x0241 : 0x0441; + uint16_t pho = (uint16_t)(65536 * (angle_deg / 360 )); + SPI_write(addr, pho); + return LIBLMS7_SUCCESS; +} + +/** @brief Sets chosen NCO's phase offset angle + @param tx transmitter or receiver selection + @param index PHO index from 0 to 15 + @param angle_deg phase offset angle in degrees + @return 0-success, other-failure +*/ +liblms7_status LMS7002M::SetNCOPhaseOffset(bool tx, uint8_t index, float_type angle_deg) +{ + if(index > 15) + return LIBLMS7_INDEX_OUT_OF_RANGE; + uint16_t addr = tx ? 0x0244 : 0x0444; + uint16_t pho = (uint16_t)(65536*(angle_deg / 360)); + SPI_write(addr+index, pho); + return LIBLMS7_SUCCESS; +} + +/** @brief Returns chosen NCO's phase offset angle in radians + @param tx transmitter or receiver selection + @param index PHO index from 0 to 15 + @return phase offset angle in degrees +*/ +float_type LMS7002M::GetNCOPhaseOffset_Deg(bool tx, uint8_t index) +{ + uint16_t addr = tx ? 0x0244 : 0x0444; + uint16_t pho = SPI_read(addr+index); + float_type angle = 360*pho/65536.0; + return angle; +} + +/** @brief Uploads given FIR coefficients to chip + @param tx Transmitter or receiver selection + @param GFIR_index GIR index from 0 to 2 + @param coef array of coefficients + @param coefCount number of coefficients + @return 0-success, other-failure + + This function does not change GFIR*_L or GFIR*_N parameters, they have to be set manually +*/ +liblms7_status LMS7002M::SetGFIRCoefficients(bool tx, uint8_t GFIR_index, const int16_t *coef, uint8_t coefCount) +{ + uint8_t index; + uint8_t coefLimit; + uint16_t startAddr; + if (GFIR_index == 0) + startAddr = 0x0280; + else if (GFIR_index == 1) + startAddr = 0x02C0; + else + startAddr = 0x0300; + + if (tx == false) + startAddr += 0x0200; + if (GFIR_index < 2) + coefLimit = 40; + else + coefLimit = 120; + if (coefCount > coefLimit) + return LIBLMS7_TOO_MANY_VALUES; + vector<uint16_t> addresses; + for (index = 0; index < coefCount; ++index) + addresses.push_back(startAddr + index + 24 * (index / 40)); + SPI_write_batch(&addresses[0], (uint16_t*)coef, coefCount); + return LIBLMS7_SUCCESS; +} + +/** @brief Returns currently loaded FIR coefficients + @param tx Transmitter or receiver selection + @param GFIR_index GIR index from 0 to 2 + @param coef array of returned coefficients + @param coefCount number of coefficients to read + @return 0-success, other-failure +*/ +liblms7_status LMS7002M::GetGFIRCoefficients(bool tx, uint8_t GFIR_index, int16_t *coef, uint8_t coefCount) +{ + liblms7_status status = LIBLMS7_FAILURE; + uint8_t index; + uint8_t coefLimit; + uint16_t startAddr; + if(GFIR_index == 0) + startAddr = 0x0280; + else if (GFIR_index == 1) + startAddr = 0x02C0; + else + startAddr = 0x0300; + + if (tx == false) + startAddr += 0x0200; + if (GFIR_index < 2) + coefLimit = 40; + else + coefLimit = 120; + if (coefCount > coefLimit) + return LIBLMS7_TOO_MANY_VALUES; + + std::vector<uint16_t> addresses; + for (index = 0; index < coefCount; ++index) + addresses.push_back(startAddr + index + 24 * (index / 40)); + uint16_t spiData[120]; + memset(spiData, 0, 120 * sizeof(uint16_t)); + if (controlPort->IsOpen()) + { + status = SPI_read_batch(&addresses[0], spiData, coefCount); + for (index = 0; index < coefCount; ++index) + coef[index] = spiData[index]; + } + else + { + const int channel = Get_SPI_Reg_bits(LMS7param(MAC), false) > 1 ? 1 : 0; + for (index = 0; index < coefCount; ++index) + coef[index] = mRegistersMap->GetValue(channel, addresses[index]); + status = LIBLMS7_SUCCESS; + } + + return status; +} + +/** @brief Write given data value to whole register + @param address SPI address + @param data new register value + @return 0-succes, other-failure +*/ +liblms7_status LMS7002M::SPI_write(uint16_t address, uint16_t data) +{ + if (controlPort == NULL) + return LIBLMS7_NO_CONNECTION_MANAGER; + + if ((mRegistersMap->GetValue(0, LMS7param(MAC).address) & 0x0003) > 1 && address >= 0x0100) + mRegistersMap->SetValue(1, address, data); + else + mRegistersMap->SetValue(0, address, data); + + if (controlPort->IsOpen() == false) + return LIBLMS7_NOT_CONNECTED; + + LMScomms::GenericPacket pkt; + pkt.cmd = CMD_LMS7002_WR; + pkt.outBuffer.push_back(address >> 8); + pkt.outBuffer.push_back(address & 0xFF); + pkt.outBuffer.push_back(data >> 8); + pkt.outBuffer.push_back(data & 0xFF); + controlPort->TransferPacket(pkt); + if (pkt.status == STATUS_COMPLETED_CMD) + return LIBLMS7_SUCCESS; + else + return LIBLMS7_FAILURE; +} + +/** @brief Reads whole register value from given address + @param address SPI address + @param status operation status(optional) + @param fromChip read value directly from chip + @return register value +*/ +uint16_t LMS7002M::SPI_read(uint16_t address, bool fromChip, liblms7_status *status) +{ + if (controlPort == NULL) + { + if (status) + *status = LIBLMS7_NO_CONNECTION_MANAGER; + } + if (controlPort->IsOpen() == false || fromChip == false) + { + if ((mRegistersMap->GetValue(0, LMS7param(MAC).address) & 0x0003) > 1 && address >= 0x0100) + return mRegistersMap->GetValue(1, address); + else + return mRegistersMap->GetValue(0, address); + } + + LMScomms::GenericPacket pkt; + pkt.cmd = CMD_LMS7002_RD; + pkt.outBuffer.push_back(address >> 8); + pkt.outBuffer.push_back(address & 0xFF); + if (controlPort->TransferPacket(pkt) == LMScomms::TRANSFER_SUCCESS) + { + if (status) + *status = (pkt.status == STATUS_COMPLETED_CMD ? LIBLMS7_SUCCESS : LIBLMS7_FAILURE); + return (pkt.inBuffer[2] << 8) | pkt.inBuffer[3]; + } + else + return 0; +} + +/** @brief Batches multiple register writes into least ammount of transactions + @param spiAddr spi register addresses to be written + @param spiData registers data to be written + @param cnt number of registers to write + @return 0-success, other-failure +*/ +liblms7_status LMS7002M::SPI_write_batch(const uint16_t* spiAddr, const uint16_t* spiData, uint16_t cnt) +{ + LMScomms::GenericPacket pkt; + pkt.cmd = CMD_LMS7002_WR; + uint32_t index = 0; + for (uint32_t i = 0; i < cnt; ++i) + { + pkt.outBuffer.push_back(spiAddr[i] >> 8); + pkt.outBuffer.push_back(spiAddr[i] & 0xFF); + pkt.outBuffer.push_back(spiData[i] >> 8); + pkt.outBuffer.push_back(spiData[i] & 0xFF); + + if ((mRegistersMap->GetValue(0, LMS7param(MAC).address) & 0x0003) > 1) + mRegistersMap->SetValue(1, spiAddr[i], spiData[i]); + else + mRegistersMap->SetValue(0, spiAddr[i], spiData[i]); + + } + if (controlPort == NULL) + return LIBLMS7_NO_CONNECTION_MANAGER; + if (controlPort->IsOpen() == false) + return LIBLMS7_NOT_CONNECTED; + + controlPort->TransferPacket(pkt); + if (pkt.status == STATUS_COMPLETED_CMD) + return LIBLMS7_SUCCESS; + else + return LIBLMS7_FAILURE; +} + +/** @brief Batches multiple register reads into least amount of transactions + @param spiAddr SPI addresses to read + @param spiData array for read data + @param cnt number of registers to read + @return 0-success, other-failure +*/ +liblms7_status LMS7002M::SPI_read_batch(const uint16_t* spiAddr, uint16_t* spiData, uint16_t cnt) +{ + LMScomms::GenericPacket pkt; + pkt.cmd = CMD_LMS7002_RD; + uint32_t index = 0; + for (uint32_t i = 0; i < cnt; ++i) + { + pkt.outBuffer.push_back(spiAddr[i] >> 8); + pkt.outBuffer.push_back(spiAddr[i] & 0xFF); + } + if (controlPort == NULL) + return LIBLMS7_NO_CONNECTION_MANAGER; + if (controlPort->IsOpen() == false) + return LIBLMS7_NOT_CONNECTED; + + LMScomms::TransferStatus status = controlPort->TransferPacket(pkt); + if (status != LMScomms::TRANSFER_SUCCESS) + return LIBLMS7_FAILURE; + + for (uint32_t i = 0; i < cnt; ++i) + { + spiData[i] = (pkt.inBuffer[2*sizeof(uint16_t)*i + 2] << 8) | pkt.inBuffer[2*sizeof(uint16_t)*i + 3]; + if ((mRegistersMap->GetValue(0, LMS7param(MAC).address) & 0x0003) > 1) + mRegistersMap->SetValue(1, spiAddr[i], spiData[i]); + else + mRegistersMap->SetValue(0, spiAddr[i], spiData[i]); + } + return pkt.status == STATUS_COMPLETED_CMD ? LIBLMS7_SUCCESS : LIBLMS7_FAILURE; + /* + for(int i=0; i<cnt; ++i) + { + spiData[i] = Get_SPI_Reg_bits(spiAddr[i], 15, 0); + if ((mRegistersMap->GetValue(0, LMS7param(MAC).address) & 0x0003) > 1) + mRegistersMap->SetValue(1, spiAddr[i], spiData[i]); + else + mRegistersMap->SetValue(0, spiAddr[i], spiData[i]); + } + return LIBLMS7_SUCCESS;*/ +} + +/** @brief Performs registers test by writing known data and confirming readback data + @return 0-registers test passed, other-failure +*/ +liblms7_status LMS7002M::RegistersTest() +{ + char chex[16]; + if (controlPort == NULL) + return LIBLMS7_NO_CONNECTION_MANAGER; + if (controlPort->IsOpen() == false) + return LIBLMS7_NOT_CONNECTED; + + liblms7_status status; + uint8_t ch = (uint8_t)Get_SPI_Reg_bits(LMS7param(MAC)); + + //backup both channel data for restoration after test + vector<uint16_t> ch1Addresses; + for (uint8_t i = 0; i < MEMORY_SECTIONS_COUNT; ++i) + for (uint16_t addr = MemorySectionAddresses[i][0]; addr <= MemorySectionAddresses[i][1]; ++addr) + ch1Addresses.push_back(addr); + vector<uint16_t> ch1Data; + ch1Data.resize(ch1Addresses.size(), 0); + + //backup A channel + Modify_SPI_Reg_bits(LMS7param(MAC), 1); + status = SPI_read_batch(&ch1Addresses[0], &ch1Data[0], ch1Addresses.size()); + if (status != LIBLMS7_SUCCESS) + return status; + + vector<uint16_t> ch2Addresses; + for (uint8_t i = 0; i < MEMORY_SECTIONS_COUNT; ++i) + for (uint16_t addr = MemorySectionAddresses[i][0]; addr <= MemorySectionAddresses[i][1]; ++addr) + if (addr >= 0x0100) + ch2Addresses.push_back(addr); + vector<uint16_t> ch2Data; + ch2Data.resize(ch2Addresses.size(), 0); + + Modify_SPI_Reg_bits(LMS7param(MAC), 2); + status = SPI_read_batch(&ch2Addresses[0], &ch2Data[0], ch2Addresses.size()); + if (status != LIBLMS7_SUCCESS) + return status; + + //test registers + ResetChip(); + Modify_SPI_Reg_bits(LMS7param(MIMO_SISO), 0); + Modify_SPI_Reg_bits(LMS7param(PD_RX_AFE2), 0); + Modify_SPI_Reg_bits(LMS7param(PD_TX_AFE2), 0); + Modify_SPI_Reg_bits(LMS7param(MAC), 1); + + stringstream ss; + + //check single channel memory sections + vector<MemorySection> modulesToCheck = { AFE, BIAS, XBUF, CGEN, LDO, BIST, CDS, TRF, TBB, RFE, RBB, SX, + TxTSP, TxNCO, TxGFIR1, TxGFIR2, TxGFIR3a, TxGFIR3b, TxGFIR3c, + RxTSP, RxNCO, RxGFIR1, RxGFIR2, RxGFIR3a, RxGFIR3b, RxGFIR3c, LimeLight }; + const char* moduleNames[] = { "AFE", "BIAS", "XBUF", "CGEN", "LDO", "BIST", "CDS", "TRF", "TBB", "RFE", "RBB", "SX", + "TxTSP", "TxNCO", "TxGFIR1", "TxGFIR2", "TxGFIR3a", "TxGFIR3b", "TxGFIR3c", + "RxTSP", "RxNCO", "RxGFIR1", "RxGFIR2", "RxGFIR3a", "RxGFIR3b", "RxGFIR3c", "LimeLight" }; + + const uint16_t patterns[] = { 0xAAAA, 0x5555 }; + const uint8_t patternsCount = 2; + + bool allTestSuccess = true; + + for (unsigned i = 0; i < modulesToCheck.size(); ++i) + { + bool moduleTestsSuccess = true; + uint16_t startAddr = MemorySectionAddresses[modulesToCheck[i]][0]; + uint16_t endAddr = MemorySectionAddresses[modulesToCheck[i]][1]; + uint8_t channelCount = startAddr >= 0x0100 ? 2 : 1; + for (int cc = 1; cc <= channelCount; ++cc) + { + Modify_SPI_Reg_bits(LMS7param(MAC), cc); + sprintf(chex, "0x%04X", startAddr); + ss << moduleNames[i] << " [" << chex << ":"; + sprintf(chex, "0x%04X", endAddr); + ss << chex << "]"; + if (startAddr >= 0x0100) + ss << " Ch." << (cc == 1 ? "A" : "B"); + ss << endl; + for (uint8_t p = 0; p < patternsCount; ++p) + moduleTestsSuccess &= RegistersTestInterval(startAddr, endAddr, patterns[p], ss) == LIBLMS7_SUCCESS; + } + allTestSuccess &= moduleTestsSuccess; + } + + //restore register values + Modify_SPI_Reg_bits(LMS7param(MAC), 1); + SPI_write_batch(&ch1Addresses[0], &ch1Data[0], ch1Addresses.size()); + Modify_SPI_Reg_bits(LMS7param(MAC), 2); + SPI_write_batch(&ch2Addresses[0], &ch2Data[0], ch2Addresses.size()); + Modify_SPI_Reg_bits(LMS7param(MAC), ch); + + fstream fout; + fout.open("registersTest.txt", ios::out); + fout << ss.str() << endl; + fout.close(); + + return allTestSuccess ? LIBLMS7_SUCCESS : LIBLMS7_FAILURE; +} + +/** @brief Performs registers test for given address interval by writing given pattern data + @param startAddr first register address + @param endAddr last reigster address + @param pattern data to be written into registers + @return 0-register test passed, other-failure +*/ +liblms7_status LMS7002M::RegistersTestInterval(uint16_t startAddr, uint16_t endAddr, uint16_t pattern, stringstream &ss) +{ + vector<uint16_t> addrToWrite; + vector<uint16_t> dataToWrite; + vector<uint16_t> dataReceived; + vector<uint16_t> dataMasks; + + for (uint16_t addr = startAddr; addr <= endAddr; ++addr) + { + addrToWrite.push_back(addr); + } + dataMasks.resize(addrToWrite.size(), 0xFFFF); + for (uint16_t j = 0; j < sizeof(readOnlyRegisters)/sizeof(uint16_t); ++j) + for (uint16_t k = 0; k < addrToWrite.size(); ++k) + if (readOnlyRegisters[j] == addrToWrite[k]) + { + dataMasks[k] = readOnlyRegistersMasks[j]; + break; + } + + dataToWrite.clear(); + dataReceived.clear(); + for (uint16_t j = 0; j < addrToWrite.size(); ++j) + { + if (addrToWrite[j] == 0x00A6) + dataToWrite.push_back(0x1 | pattern & ~0x2); + else if (addrToWrite[j] == 0x0084) + dataToWrite.push_back(pattern & ~0x19); + else + dataToWrite.push_back(pattern & dataMasks[j]); + } + dataReceived.resize(addrToWrite.size(), 0); + liblms7_status status; + status = SPI_write_batch(&addrToWrite[0], &dataToWrite[0], addrToWrite.size()); + if (status != LIBLMS7_SUCCESS) + return status; + status = SPI_read_batch(&addrToWrite[0], &dataReceived[0], addrToWrite.size()); + if (status != LIBLMS7_SUCCESS) + return status; + bool registersMatch = true; + char ctemp[16]; + for (uint16_t j = 0; j < dataToWrite.size(); ++j) + { + if (dataToWrite[j] != (dataReceived[j] & dataMasks[j])) + { + registersMatch = false; + sprintf(ctemp, "0x%04X", addrToWrite[j]); + ss << "\t" << ctemp << "(wr/rd): "; + sprintf(ctemp, "0x%04X", dataToWrite[j]); + ss << ctemp << "/"; + sprintf(ctemp, "0x%04X", dataReceived[j]); + ss << ctemp << endl; + } + } + if (registersMatch) + { + sprintf(ctemp, "0x%04X", pattern); + ss << "\tRegisters OK (" << ctemp << ")\n"; + } + return registersMatch ? LIBLMS7_SUCCESS : LIBLMS7_FAILURE; +} + +/** @brief Parameters setup instructions for Tx calibration + @return 0-success, other-failure +*/ +liblms7_status LMS7002M::CalibrateTxSetup(float_type bandwidth_MHz) +{ + //Stage 2 + uint8_t ch = (uint8_t)Get_SPI_Reg_bits(LMS7param(MAC)); + uint8_t sel_band1_trf = (uint8_t)Get_SPI_Reg_bits(LMS7param(SEL_BAND1_TRF)); + uint8_t sel_band2_trf = (uint8_t)Get_SPI_Reg_bits(LMS7param(SEL_BAND2_TRF)); + + //rfe + //reset RFE to defaults + SetDefaults(RFE); + if (sel_band1_trf == 1) + Modify_SPI_Reg_bits(LMS7param(SEL_PATH_RFE), 3); //SEL_PATH_RFE 3 + else if (sel_band2_trf == 1) + Modify_SPI_Reg_bits(LMS7param(SEL_PATH_RFE), 2); + else + return LIBLMS7_BAND_NOT_SELECTED; + + if (ch == 2) + Modify_SPI_Reg_bits(LMS7param(EN_NEXTRX_RFE), 1); // EN_NEXTTX_RFE 1 + + Modify_SPI_Reg_bits(LMS7param(G_RXLOOPB_RFE), 8); //G_RXLOOPB_RFE 8 + Modify_SPI_Reg_bits(0x010C, 4, 3, 0); //PD_MXLOBUF_RFE 0, PD_QGEN_RFE 0 + Modify_SPI_Reg_bits(LMS7param(CCOMP_TIA_RFE), 10); //CCOMP_TIA_RFE 10 + Modify_SPI_Reg_bits(LMS7param(CFB_TIA_RFE), 2600); //CFB_TIA_RFE 2600 + Modify_SPI_Reg_bits(LMS7param(ICT_LODC_RFE), 31); //ICT_LODC_RFE 31 + Modify_SPI_Reg_bits(LMS7param(PD_LNA_RFE), 1); + + //RBB + //reset RBB to defaults + SetDefaults(RBB); + Modify_SPI_Reg_bits(LMS7param(PD_LPFL_RBB), 0); //PD_LPFL_RBB 0 + Modify_SPI_Reg_bits(LMS7param(RCC_CTL_LPFL_RBB), 0); //RCC_CTL_LPFL_RBB 0 + Modify_SPI_Reg_bits(LMS7param(C_CTL_LPFL_RBB), 1500); //C_CTL_LPFL_RBB 1500 + Modify_SPI_Reg_bits(LMS7param(G_PGA_RBB), 22); //G_PGA_RBB 22 + + //TRF + //reset TRF to defaults + //SetDefaults(TRF); + Modify_SPI_Reg_bits(LMS7param(L_LOOPB_TXPAD_TRF), 0); //L_LOOPB_TXPAD_TRF 0 + Modify_SPI_Reg_bits(LMS7param(EN_LOOPB_TXPAD_TRF), 1); //EN_LOOPB_TXPAD_TRF 1 + Modify_SPI_Reg_bits(LMS7param(EN_G_TRF), 0); //EN_G_TRF 0 + if (ch == 2) + Modify_SPI_Reg_bits(LMS7param(EN_NEXTTX_TRF), 1); //EN_NEXTTX_TRF 1 + Modify_SPI_Reg_bits(LMS7param(LOSS_LIN_TXPAD_TRF), 0); //LOSS_LIN_TXPAD_TRF 5 + Modify_SPI_Reg_bits(LMS7param(LOSS_MAIN_TXPAD_TRF), 0); //LOSS_MAIN_TXPAD_TRF 5 + + //TBB + //reset TBB to defaults + /*SetDefaults(TBB); + Modify_SPI_Reg_bits(LMS7param(CG_IAMP_TBB), 9); //CG_IAMP_TBB 9 + Modify_SPI_Reg_bits(LMS7param(ICT_IAMP_FRP_TBB), 1); //ICT_IAMP_FRP_TBB 1 + Modify_SPI_Reg_bits(LMS7param(ICT_IAMP_GG_FRP_TBB), 6); //ICT_IAMP_GG_FRP_TBB 6 + Modify_SPI_Reg_bits(LMS7param(RCAL_LPFH_TBB), 125); //RCAL_LPFH_TBB 0 + */ + //AFE + //reset AFE to defaults + uint8_t isel_dac_afe =(uint8_t) Get_SPI_Reg_bits(LMS7param(ISEL_DAC_AFE)); + SetDefaults(AFE); + Modify_SPI_Reg_bits(LMS7param(PD_RX_AFE2), 0); //PD_RX_AFE2 0 + Modify_SPI_Reg_bits(LMS7param(ISEL_DAC_AFE), isel_dac_afe); + + if (ch == 2) + Modify_SPI_Reg_bits(LMS7param(PD_TX_AFE2), 0); + //BIAS + uint16_t backup = Get_SPI_Reg_bits(LMS7param(RP_CALIB_BIAS)); + SetDefaults(BIAS); + Modify_SPI_Reg_bits(LMS7param(RP_CALIB_BIAS), backup); //RP_CALIB_BIAS + + //XBUF + Modify_SPI_Reg_bits(0x0085, 2, 0, 1); //PD_XBUF_RX 0, PD_XBUF_TX 0, EN_G_XBUF 1 + + //CGEN + //reset CGEN to defaults + SetDefaults(CGEN); + //power up VCO + Modify_SPI_Reg_bits(LMS7param(PD_VCO_CGEN), 0); + + if (SetFrequencyCGEN(122.88) != LIBLMS7_SUCCESS) + return LIBLMS7_FAILURE; + if (TuneVCO(VCO_CGEN) != LIBLMS7_SUCCESS) + return LIBLMS7_FAILURE; + + //SXR + Modify_SPI_Reg_bits(LMS7param(MAC), 1); + SetDefaults(SX); + float_type SXTfreqMHz = GetFrequencySX_MHz(Tx, mRefClkSXT_MHz); + + float_type SXRfreqMHz = SXTfreqMHz - bandwidth_MHz / 4 - 1; + if (SetFrequencySX(Rx, SXRfreqMHz, mRefClkSXR_MHz) != LIBLMS7_SUCCESS) + return LIBLMS7_FAILURE; + if (TuneVCO(VCO_SXR) != LIBLMS7_SUCCESS) + return LIBLMS7_FAILURE; + + //SXT + Modify_SPI_Reg_bits(LMS7param(MAC), 2); + Modify_SPI_Reg_bits(LMS7param(PD_LOCH_T2RBUF), 1); //PD_LOCH_T2RBUF 1 + if (SetFrequencySX(Tx, SXTfreqMHz, mRefClkSXT_MHz) != LIBLMS7_SUCCESS) + return LIBLMS7_FAILURE; + if (TuneVCO(VCO_SXT) != LIBLMS7_SUCCESS) + return LIBLMS7_FAILURE; + Modify_SPI_Reg_bits(LMS7param(MAC), ch); + + //TXTSP + SetDefaults(TxTSP); + Modify_SPI_Reg_bits(0x0200, 3, 2, 0x3); //TSGMODE 1, INSEL 1 + Modify_SPI_Reg_bits(0x0208, 6, 4, 0x7); //GFIR3_BYP 1, GFIR2_BYP 1, GFIR1_BYP 1 + LoadDC_REG_IQ(Tx, (int16_t)0x7FFF, (int16_t)0x8000); + Modify_SPI_Reg_bits(LMS7param(MAC), ch); + Modify_SPI_Reg_bits(0x0440, 4, 0, 0); //TX SEL[3:0] = 0 & MODE = 0 + + float_type offset = 0.2; + if (bandwidth_MHz == 8) + { + //SXR + Modify_SPI_Reg_bits(LMS7param(MAC), 1); + SetDefaults(SX); + float_type SXTfreqMHz = GetFrequencySX_MHz(Tx, mRefClkSXT_MHz); + + float_type sxrFreq = SXTfreqMHz - bandwidth_MHz / 4 - 1 - offset; + if (SetFrequencySX(Rx, sxrFreq, mRefClkSXR_MHz) != LIBLMS7_SUCCESS) + return LIBLMS7_FAILURE; + SetNCOFrequency(Tx, 0, bandwidth_MHz / 4 + offset); + } + else + SetNCOFrequency(Tx, 0, bandwidth_MHz / 4); + + //RXTSP + SetDefaults(RxTSP); + Modify_SPI_Reg_bits(LMS7param(AGC_MODE_RXTSP), 1); //AGC_MODE 1 + Modify_SPI_Reg_bits(0x040C, 7, 0, 0xBF); + Modify_SPI_Reg_bits(LMS7param(CAPSEL), 0); + Modify_SPI_Reg_bits(LMS7param(HBD_OVR_RXTSP), 0); //Decimation HBD ratio + Modify_SPI_Reg_bits(LMS7param(AGC_AVG_RXTSP), 0x7); //agc_avg iq corr + + return LIBLMS7_SUCCESS; +} + +/** @brief Flips the CAPTURE bit and returns digital RSSI value +*/ +uint32_t LMS7002M::GetRSSI() +{ + Modify_SPI_Reg_bits(LMS7param(CAPTURE), 0); + Modify_SPI_Reg_bits(LMS7param(CAPTURE), 1); + return (Get_SPI_Reg_bits(0x040F, 15, 0) << 2) | Get_SPI_Reg_bits(0x040E, 1, 0); +} + +/** @brief Sets Rx Dc offsets by converting two's complementary numbers to sign and magnitude +*/ +void LMS7002M::SetRxDCOFF(int8_t offsetI, int8_t offsetQ) +{ + uint16_t valToSend = 0; + if (offsetI < 0) + valToSend |= 0x40; + valToSend |= labs(offsetI); + valToSend = valToSend << 7; + if (offsetQ < 0) + valToSend |= 0x40; + valToSend |= labs(offsetQ); + SPI_write(0x010E, valToSend); +} + +/** @brief Calibrates Transmitter. DC correction, IQ gains, IQ phase correction + @return 0-success, other-failure +*/ +liblms7_status LMS7002M::CalibrateTx(float_type bandwidth_MHz) +{ + liblms7_status status; + Log("Tx calibration started", LOG_INFO); + BackupAllRegisters(); + + int16_t iqcorr = 0; + uint16_t gcorrq = 0; + uint16_t gcorri = 0; + uint16_t dccorri; + uint16_t dccorrq; + int16_t corrI = 0; + int16_t corrQ = 0; + uint32_t minRSSI_i; + uint32_t minRSSI_q; + uint32_t minRSSI_iq; + int16_t i; + int16_t offsetI = 0; + int16_t offsetQ = 0; + + const short firCoefs[] = + { + -2531, + -517, + 2708, + 188, + -3059, + 216, + 3569, + -770, + -4199, + 1541, + 4886, + -2577, + -5552, + 3909, + 6108, + -5537, + -6457, + 7440, + 6507, + -9566, + -6174, + 11845, + 5391, + -14179, + -4110, + 16457, + 2310, + -18561, + 0, + 20369, + -2780, + -21752, + 5963, + 22610, + -9456, + -22859, + 13127, + 22444, + -16854, + -21319, + 20489, + 19492, + -23883, + -17002, + 26881, + 13902, + -29372, + -10313, + 31226, + 6345, + -32380, + -2141, + 32767, + -2141, + -32380, + 6345, + 31226, + -10313, + -29372, + 13902, + 26881, + -17002, + -23883, + 19492, + 20489, + -21319, + -16854, + 22444, + 13127, + -22859, + -9456, + 22610, + 5963, + -21752, + -2780, + 20369, + 0, + -18561, + 2310, + 16457, + -4110, + -14179, + 5391, + 11845, + -6174, + -9566, + 6507, + 7440, + -6457, + -5537, + 6108, + 3909, + -5552, + -2577, + 4886, + 1541, + -4199, + -770, + 3569, + 216, + -3059, + 188, + 2708, + -517, + -2531 + }; + + uint8_t ch = (uint8_t)Get_SPI_Reg_bits(LMS7param(MAC)); + //Stage 1 + uint8_t sel_band1_trf = (uint8_t)Get_SPI_Reg_bits(LMS7param(SEL_BAND1_TRF)); + uint8_t sel_band2_trf = (uint8_t)Get_SPI_Reg_bits(LMS7param(SEL_BAND2_TRF)); + Log("Setup stage", LOG_INFO); + status = CalibrateTxSetup(bandwidth_MHz); + if (status != LIBLMS7_SUCCESS) + goto TxCalibrationEnd; //go to ending stage to restore registers + + //Stage 3 + //Calibrate Rx DC + Log("Rx DC calibration", LOG_INFO); + { + uint16_t requiredRegs[] = { 0x0400, 0x040A, 0x010D, 0x040C }; + uint16_t requiredMask[] = { 0x6000, 0x3007, 0x0040, 0x00FF }; //CAPSEL, AGC_MODE, AGC_AVG, EN_DCOFF, Bypasses + uint16_t requiredValue[] = { 0x0000, 0x1007, 0x0040, 0x00BD }; + + Modify_SPI_Reg_mask(requiredRegs, requiredMask, requiredValue, 0, 3); + } + + for (i = 0; i<6; ++i) + { + FindMinRSSI(LMS7param(DCOFFI_RFE), offsetI, &offsetI, 3, 2, 32 >> i); + FindMinRSSI(LMS7param(DCOFFQ_RFE), offsetQ, &offsetQ, 3, 2, 32 >> i); + } + SetRxDCOFF((int8_t)offsetI, (int8_t)offsetQ); + Modify_SPI_Reg_bits(LMS7param(DC_BYP_RXTSP), 0); // DC_BYP 0 + + sel_band1_trf = (uint8_t)Get_SPI_Reg_bits(LMS7param(SEL_BAND1_TRF)); + sel_band2_trf = (uint8_t)Get_SPI_Reg_bits(LMS7param(SEL_BAND2_TRF)); + //B + Modify_SPI_Reg_bits(0x0100, 0, 0, 1); //EN_G_TRF 1 + if (sel_band1_trf == 1) + { + Modify_SPI_Reg_bits(LMS7param(PD_RLOOPB_1_RFE), 0); //PD_RLOOPB_1_RFE 0 + Modify_SPI_Reg_bits(LMS7param(EN_INSHSW_LB1_RFE), 0); //EN_INSHSW_LB1 0 + } + if (sel_band2_trf == 1) + { + Modify_SPI_Reg_bits(LMS7param(PD_RLOOPB_2_RFE), 0); //PD_RLOOPB_2_RFE 0 + Modify_SPI_Reg_bits(LMS7param(EN_INSHSW_LB2_RFE), 0); // EN_INSHSW_LB2 0 + } + FixRXSaturation(); + + Modify_SPI_Reg_bits(LMS7param(GFIR3_BYP_RXTSP), 0); //GFIR3_BYP 0 + Modify_SPI_Reg_bits(LMS7param(HBD_OVR_RXTSP), 2); + Modify_SPI_Reg_bits(LMS7param(GFIR3_L_RXTSP), 7); + Modify_SPI_Reg_bits(LMS7param(GFIR3_N_RXTSP), 7); + + SetGFIRCoefficients(Rx, 2, firCoefs, sizeof(firCoefs) / sizeof(int16_t)); + + Log("IQ correction stage", LOG_INFO); + Modify_SPI_Reg_bits(LMS7param(GCORRI_TXTSP), 2047); + Modify_SPI_Reg_bits(LMS7param(GCORRQ_TXTSP), 2047); + + Modify_SPI_Reg_bits(LMS7param(IQCORR_TXTSP), 0); + + Log("I gain", LOG_INFO); + minRSSI_i = FindMinRSSI_Gain(LMS7param(GCORRI_TXTSP), &gcorri); + + Modify_SPI_Reg_bits(LMS7param(GCORRI_TXTSP), 2047); + Modify_SPI_Reg_bits(LMS7param(GCORRQ_TXTSP), 2047); + + Log("Q gain", LOG_INFO); + minRSSI_q = FindMinRSSI_Gain(LMS7param(GCORRQ_TXTSP), &gcorrq); + + if (minRSSI_i < minRSSI_q) + gcorrq = 2047; + else + gcorri = 2047; + + Modify_SPI_Reg_bits(LMS7param(GCORRI_TXTSP), gcorri); + Modify_SPI_Reg_bits(LMS7param(GCORRQ_TXTSP), gcorrq); + + Log("Phase", LOG_INFO); + iqcorr = 0; + for (uint8_t i = 0; i<9; ++i) + minRSSI_iq = FindMinRSSI(LMS7param(IQCORR_TXTSP), iqcorr, &iqcorr, 3, 1, 256 >> i); + + Modify_SPI_Reg_bits(LMS7param(GCORRI_TXTSP), gcorri); + Modify_SPI_Reg_bits(LMS7param(GCORRQ_TXTSP), gcorrq); + Modify_SPI_Reg_bits(LMS7param(IQCORR_TXTSP), iqcorr); + + Modify_SPI_Reg_bits(LMS7param(MAC), 1); + status = SetFrequencySX(Rx, GetFrequencySX_MHz(Tx, mRefClkSXT_MHz)-1, mRefClkSXR_MHz); + if (status != LIBLMS7_SUCCESS) + goto TxCalibrationEnd; //go to ending stage to restore registers + + //C + Modify_SPI_Reg_bits(LMS7param(MAC), ch); + Modify_SPI_Reg_bits(LMS7param(AGC_MODE_RXTSP), 1); + Modify_SPI_Reg_bits(LMS7param(CAPSEL), 0); + + Log("TX LO calibration", LOG_INFO); + + //Calibrate Tx DC + for (uint8_t i = 0; i<7; ++i) + { + FindMinRSSI(LMS7param(DCCORRI_TXTSP), corrI, &corrI, 3, 1, 64 >> i); + FindMinRSSI(LMS7param(DCCORRQ_TXTSP), corrQ, &corrQ, 3, 1, 64 >> i); + } + + dccorri = Get_SPI_Reg_bits(LMS7param(DCCORRI_TXTSP)); + dccorrq = Get_SPI_Reg_bits(LMS7param(DCCORRQ_TXTSP)); + + // Stage 4 +TxCalibrationEnd: + Log("Restoring registers state", LOG_INFO); + Modify_SPI_Reg_bits(LMS7param(MAC), ch); + RestoreAllRegisters(); + if (status != LIBLMS7_SUCCESS) + { + Log("Tx calibration failed", LOG_WARNING); + return status; + } + + Modify_SPI_Reg_bits(LMS7param(MAC), ch); + Modify_SPI_Reg_bits(LMS7param(DCCORRI_TXTSP), dccorri); + Modify_SPI_Reg_bits(LMS7param(DCCORRQ_TXTSP), dccorrq); + Modify_SPI_Reg_bits(LMS7param(GCORRI_TXTSP), gcorri); + Modify_SPI_Reg_bits(LMS7param(GCORRQ_TXTSP), gcorrq); + Modify_SPI_Reg_bits(LMS7param(IQCORR_TXTSP), iqcorr); + + Modify_SPI_Reg_bits(LMS7param(DC_BYP_TXTSP), 0); //DC_BYP + Modify_SPI_Reg_bits(0x0208, 1, 0, 0); //GC_BYP PH_BYP + Log("Tx calibration finished", LOG_INFO); + return LIBLMS7_SUCCESS; +} + +/** @brief Performs Rx DC offsets calibration +*/ +void LMS7002M::CalibrateRxDC_RSSI() +{ + int16_t i; + int16_t offsetI = 0; + int16_t offsetQ = 0; + uint16_t requiredRegs[] = { 0x0400, 0x040A, 0x010D, 0x040C }; + uint16_t requiredMask[] = { 0x6000, 0x3007, 0x0040, 0x00FF }; //CAPSEL, AGC_MODE, AGC_AVG, EN_DCOFF, Bypasses + uint16_t requiredValue[] = { 0x0000, 0x1007, 0x0040, 0x00BD }; + + Modify_SPI_Reg_mask(requiredRegs, requiredMask, requiredValue, 0, 3); + for (i = 0; i<6; ++i) + { + FindMinRSSI(LMS7param(DCOFFI_RFE), offsetI, &offsetI, 3, 2, 32 >> i); + FindMinRSSI(LMS7param(DCOFFQ_RFE), offsetQ, &offsetQ, 3, 2, 32 >> i); + } + Modify_SPI_Reg_bits(LMS7param(EN_DCOFF_RXFE_RFE), 1); + SetRxDCOFF((int8_t)offsetI, (int8_t)offsetQ); + Modify_SPI_Reg_bits(LMS7param(DC_BYP_RXTSP), 0); // DC_BYP 0 +} + +/** @brief Tries to detect and fix gains if Rx is saturated + @return 0-success, other-failure +*/ +liblms7_status LMS7002M::FixRXSaturation() +{ + uint8_t g_rxloopb = 0; + Modify_SPI_Reg_bits(LMS7param(G_RXLOOPB_RFE), g_rxloopb); + Modify_SPI_Reg_bits(LMS7param(L_LOOPB_TXPAD_TRF), 3); + + int8_t lLoopb = 3; + const uint32_t rssi_saturation_level = 0xD000; + while (g_rxloopb < 15) + { + g_rxloopb += 1; + Modify_SPI_Reg_bits(LMS7param(G_RXLOOPB_RFE), g_rxloopb); + Modify_SPI_Reg_bits(LMS7param(L_LOOPB_TXPAD_TRF), 3); + if (GetRSSI() < rssi_saturation_level) + { + for (lLoopb = 3; lLoopb >= 0; --lLoopb) + { + Modify_SPI_Reg_bits(LMS7param(L_LOOPB_TXPAD_TRF), lLoopb); + if (GetRSSI() > rssi_saturation_level) + { + ++lLoopb; + Modify_SPI_Reg_bits(LMS7param(L_LOOPB_TXPAD_TRF), lLoopb); + goto finished; + } + } + } + else + { + g_rxloopb -= 1; + Modify_SPI_Reg_bits(LMS7param(G_RXLOOPB_RFE), g_rxloopb); + break; + } + } +finished: + return GetRSSI() < rssi_saturation_level ? LIBLMS7_SUCCESS : LIBLMS7_FAILURE; +} + +uint32_t LMS7002M::FindMinRSSI(const LMS7Parameter ¶m, const int16_t startValue, int16_t *result, const uint8_t scanWidth, const uint8_t twoCompl, int8_t stepMult) +{ + return FindMinRSSI(param.address, param.msb, param.lsb, startValue, result, scanWidth, twoCompl, stepMult); +} + +/** @brief Searches for minimal RSSI value while changing given address bits +@param addr address of parameter being changed +@param msb most significant bit index +@param lsb least significant bit index +@param startValue initial value where to start search +@param result found minimal parameter value will be set here +@param twoCompl varying parameter value is treated as two's complement +@return found minimal RSSI value +*/ +uint32_t LMS7002M::FindMinRSSI(const uint16_t addr, const uint8_t msb, const uint8_t lsb, const int16_t startValue, int16_t *result, const uint8_t scanWidth, const uint8_t twoCompl, int8_t stepMult) +{ + if (scanWidth < 1) + return ~0; + int minI; + int min = startValue; + int globMin = 0; + uint32_t minRSSI = ~0; + unsigned int *rssiField = new unsigned int[scanWidth]; + int minRSSIindex; + int i; + int maxVal; + int minVal = 0; + if (twoCompl) + { + maxVal = (~(~0x0 << (msb - lsb + 1))) / 2; + minVal = -(~(~0x0 << (msb - lsb + 1))) / 2 - 1; + } + else + maxVal = (~(~0x0 << (msb - lsb + 1))); + + Modify_SPI_Reg_bits(addr, msb, lsb, startValue); + + Modify_SPI_Reg_bits(LMS7param(AGC_MODE_RXTSP), 1); + Modify_SPI_Reg_bits(LMS7param(CAPSEL), 0); + + minRSSIindex = 0; + for (i = 0; i<scanWidth; ++i) + { + short currentValue = min + (i - scanWidth / 2)*stepMult; + if (currentValue < minVal) + currentValue = minVal; + else if (currentValue > maxVal) + currentValue = maxVal; + if (twoCompl == 2) + { + uint16_t valToSend = 0; + if (currentValue < 0) + valToSend |= 0x40; + valToSend |= labs(currentValue); + Modify_SPI_Reg_bits(addr, msb, lsb, valToSend); + } + else + Modify_SPI_Reg_bits(addr, msb, lsb, currentValue); + + rssiField[i] = GetRSSI(); + } + minI = min; + minRSSIindex = 0; + for (i = 0; i<scanWidth; ++i) + if (rssiField[i] < minRSSI) + { + minRSSI = rssiField[i]; + minRSSIindex = i; + minI = min + (i - scanWidth / 2)*stepMult; + if (minI > maxVal) + minI = maxVal; + else if (minI < minVal) + minI = minVal; + globMin = minI; + } + min = minI; + + Modify_SPI_Reg_bits(addr, msb, lsb, min); + + *result = min; + return minRSSI; +} + +/** @brief Sets given module registers to default values + @return 0-success, other-failure +*/ +liblms7_status LMS7002M::SetDefaults(MemorySection module) +{ + liblms7_status status = LIBLMS7_SUCCESS; + vector<uint16_t> addrs; + vector<uint16_t> values; + for(uint32_t address = MemorySectionAddresses[module][0]; address <= MemorySectionAddresses[module][1]; ++address) + { + addrs.push_back(address); + values.push_back(mRegistersMap->GetDefaultValue(address)); + } + status = SPI_write_batch(&addrs[0], &values[0], addrs.size()); + return status; +} + +/** @brief Parameters setup instructions for Rx calibration + @param bandwidth_MHz filter bandwidth in MHz + @return 0-success, other-failure +*/ +liblms7_status LMS7002M::CalibrateRxSetup(float_type bandwidth_MHz) +{ + uint8_t ch = (uint8_t)Get_SPI_Reg_bits(LMS7param(MAC)); + + //rfe + if (ch == 2) + Modify_SPI_Reg_bits(LMS7param(EN_NEXTTX_TRF), 1); // EN_NEXTTX_TRF 0 + + Modify_SPI_Reg_bits(LMS7param(G_RXLOOPB_RFE), 15); //G_RXLOOPB_RFE 15 + Modify_SPI_Reg_bits(0x010C, 4, 3, 0); //PD_MXLOBUF_RFE 0, PD_QGEN_RFE 0 + Modify_SPI_Reg_bits(0x010C, 1, 1, 0); //PD_TIA 0 + Modify_SPI_Reg_bits(0x010C, 7, 7, 1); //PD_LNA 1 + + Modify_SPI_Reg_bits(0x0110, 4, 0, 31); //ICT_LO_RFE 31 + Modify_SPI_Reg_bits(0x010D, 4, 1, 0xFF); // all short switches are enabled + + //RBB + Modify_SPI_Reg_bits(0x0115, 15, 14, 0); //Loopback switches disable + Modify_SPI_Reg_bits(0x0119, 15, 15, 0); //OSW_PGA 0 + + //TRF + //reset TRF to defaults + SetDefaults(TRF); + Modify_SPI_Reg_bits(LMS7param(L_LOOPB_TXPAD_TRF), 0); //L_LOOPB_TXPAD_TRF 0 + Modify_SPI_Reg_bits(LMS7param(EN_LOOPB_TXPAD_TRF), 1); //EN_LOOPB_TXPAD_TRF 1 + Modify_SPI_Reg_bits(LMS7param(EN_G_TRF), 0); //EN_G_TRF 0 + if (ch == 2) + Modify_SPI_Reg_bits(LMS7param(EN_NEXTTX_TRF), 1); //EN_NEXTTX_TRF 1 + Modify_SPI_Reg_bits(LMS7param(LOSS_LIN_TXPAD_TRF), 0); //LOSS_LIN_TXPAD_TRF 5 + Modify_SPI_Reg_bits(LMS7param(LOSS_MAIN_TXPAD_TRF), 0); //LOSS_MAIN_TXPAD_TRF 5 + + //TBB + //reset TBB to defaults + SetDefaults(TBB); + Modify_SPI_Reg_bits(LMS7param(CG_IAMP_TBB), 9); //CG_IAMP_TBB 9 + Modify_SPI_Reg_bits(LMS7param(ICT_IAMP_FRP_TBB), 1); //ICT_IAMP_FRP_TBB 1 + Modify_SPI_Reg_bits(LMS7param(ICT_IAMP_GG_FRP_TBB), 6); //ICT_IAMP_GG_FRP_TBB 6 + + //AFE + //reset AFE to defaults + SetDefaults(AFE); + Modify_SPI_Reg_bits(LMS7param(PD_RX_AFE2), 0); //PD_RX_AFE2 + if (ch == 2) + { + Modify_SPI_Reg_bits(LMS7param(PD_TX_AFE2), 0); //PD_TX_AFE2 + } + //BIAS + uint16_t backup = Get_SPI_Reg_bits(0x0084, 10, 6); + SetDefaults(BIAS); + Modify_SPI_Reg_bits(0x0084, 10, 6, backup); //RP_CALIB_BIAS + + //XBUF + Modify_SPI_Reg_bits(0x0085, 2, 0, 1); //PD_XBUF_RX 0, PD_XBUF_TX 0, EN_G_XBUF 1 + + //CGEN + //reset CGEN to defaults + SetDefaults(CGEN); + //power up VCO + Modify_SPI_Reg_bits(0x0086, 2, 2, 0); + + liblms7_status status = SetFrequencyCGEN(122.88); + if (status != LIBLMS7_SUCCESS) + return status; + + // //SXR + Modify_SPI_Reg_bits(LMS7param(MAC), 1); + float_type SXRfreqMHz = GetFrequencySX_MHz(Rx, mRefClkSXR_MHz); + + //SXT + Modify_SPI_Reg_bits(LMS7param(MAC), 2); + Modify_SPI_Reg_bits(LMS7param(PD_LOCH_T2RBUF), 1); //PD_LOCH_t2RBUF 1 + status = SetFrequencySX(Tx, SXRfreqMHz + bandwidth_MHz / 4, mRefClkSXT_MHz); + if ( status != LIBLMS7_SUCCESS) + return status; + Modify_SPI_Reg_bits(LMS7param(MAC), ch); + + //TXTSP + SetDefaults(TxTSP); + Modify_SPI_Reg_bits(0x0200, 3, 2, 0x3); //TSGMODE 1, INSEL 1 + //Modify_SPI_Reg_bits(0x0208, 6, 4, 0xFFFF); //GFIR3_BYP 1, GFIR2_BYP 1, GFIR1_BYP 1 + Modify_SPI_Reg_bits(0x0208, 6, 6, 1); //GFIR3_BYP 1, GFIR2_BYP 1, GFIR1_BYP 1 + Modify_SPI_Reg_bits(0x0208, 5, 5, 1); //GFIR3_BYP 1, GFIR2_BYP 1, GFIR1_BYP 1 + Modify_SPI_Reg_bits(0x0208, 4, 4, 1); //GFIR3_BYP 1, GFIR2_BYP 1, GFIR1_BYP 1 + LoadDC_REG_IQ(Tx, (int16_t)0x7FFF, (int16_t)0x8000); + SetNCOFrequency(Tx, 0, 0); + + //RXTSP + SetDefaults(RxTSP); + Modify_SPI_Reg_bits(LMS7param(AGC_MODE_RXTSP), 1); //AGC_MODE 1 + Modify_SPI_Reg_bits(0x040C, 7, 7, 0x1); //CMIX_BYP 1 + Modify_SPI_Reg_bits(0x040C, 6, 6, 0x0); //AGC_BYP 0 + Modify_SPI_Reg_bits(0x040C, 5, 5, 1); // + Modify_SPI_Reg_bits(0x040C, 4, 4, 1); // + Modify_SPI_Reg_bits(0x040C, 3, 3, 1); // + Modify_SPI_Reg_bits(0x040C, 2, 2, 1); // DC_BYP + Modify_SPI_Reg_bits(0x040C, 1, 1, 1); // + Modify_SPI_Reg_bits(0x040C, 0, 0, 1); // + + Modify_SPI_Reg_bits(LMS7param(CAPSEL), 0); + Modify_SPI_Reg_bits(LMS7param(HBD_OVR_RXTSP), 2); + Modify_SPI_Reg_bits(LMS7param(AGC_AVG_RXTSP), 0x7); //agc_avg iq corr + return LIBLMS7_SUCCESS; +} + +/** @brief Calibrates Receiver. DC offset, IQ gains, IQ phase correction + @return 0-success, other-failure +*/ +liblms7_status LMS7002M::CalibrateRx(float_type bandwidth_MHz) +{ + liblms7_status status; + uint32_t minRSSI_i; + uint32_t minRSSI_q; + int16_t iqcorr_rx = 0; + uint32_t minRSSI_iq; + int16_t dcoffi; + int16_t dcoffq; + + const int16_t firCoefs[] = + { + -2531, + -517, + 2708, + 188, + -3059, + 216, + 3569, + -770, + -4199, + 1541, + 4886, + -2577, + -5552, + 3909, + 6108, + -5537, + -6457, + 7440, + 6507, + -9566, + -6174, + 11845, + 5391, + -14179, + -4110, + 16457, + 2310, + -18561, + 0, + 20369, + -2780, + -21752, + 5963, + 22610, + -9456, + -22859, + 13127, + 22444, + -16854, + -21319, + 20489, + 19492, + -23883, + -17002, + 26881, + 13902, + -29372, + -10313, + 31226, + 6345, + -32380, + -2141, + 32767, + -2141, + -32380, + 6345, + 31226, + -10313, + -29372, + 13902, + 26881, + -17002, + -23883, + 19492, + 20489, + -21319, + -16854, + 22444, + 13127, + -22859, + -9456, + 22610, + 5963, + -21752, + -2780, + 20369, + 0, + -18561, + 2310, + 16457, + -4110, + -14179, + 5391, + 11845, + -6174, + -9566, + 6507, + 7440, + -6457, + -5537, + 6108, + 3909, + -5552, + -2577, + 4886, + 1541, + -4199, + -770, + 3569, + 216, + -3059, + 188, + 2708, + -517, + -2531 + }; + + Log("Rx calibration started", LOG_INFO); + uint8_t ch = (uint8_t)Get_SPI_Reg_bits(LMS7param(MAC)); + Log("Saving registers state", LOG_INFO); + BackupAllRegisters(); + uint8_t sel_path_rfe = (uint8_t)Get_SPI_Reg_bits(LMS7param(SEL_PATH_RFE)); + if (sel_path_rfe == 1 || sel_path_rfe == 0) + return LIBLMS7_BAD_SEL_PATH; + + Log("Setup stage", LOG_INFO); + status = CalibrateRxSetup(bandwidth_MHz); + if (status != LIBLMS7_SUCCESS) + goto RxCalibrationEndStage; + + Log("Rx DC calibration", LOG_INFO); + CalibrateRxDC_RSSI(); + dcoffi = Get_SPI_Reg_bits(LMS7param(DCOFFI_RFE)); + dcoffq = Get_SPI_Reg_bits(LMS7param(DCOFFQ_RFE)); + Modify_SPI_Reg_bits(LMS7param(EN_G_TRF), 1); + + if (sel_path_rfe == 2) + { + Modify_SPI_Reg_bits(LMS7param(PD_RLOOPB_2_RFE), 0); + Modify_SPI_Reg_bits(0x0103, 10, 10, 1); + Modify_SPI_Reg_bits(0x0103, 11, 11, 0); + Modify_SPI_Reg_bits(LMS7param(EN_INSHSW_LB2_RFE), 0); + } + if (sel_path_rfe == 3) + { + Modify_SPI_Reg_bits(LMS7param(PD_RLOOPB_1_RFE), 0); + Modify_SPI_Reg_bits(0x0103, 11, 11, 1); + Modify_SPI_Reg_bits(0x0103, 10, 10, 0); + Modify_SPI_Reg_bits(LMS7param(EN_INSHSW_LB1_RFE), 0); + } + + Modify_SPI_Reg_bits(0x040C, 7, 7, 0); //CMIX_BYP 0 + Modify_SPI_Reg_bits(0x040C, 2, 0, 0); //DC_BYP 0, GC_BYP 0, PH_BYP 0 + Modify_SPI_Reg_bits(LMS7param(CMIX_GAIN_RXTSP), 1); //CMIX_GAIN 1 +6 db + Modify_SPI_Reg_bits(0x040C, 13, 13, 1); //CMIX_SC 1 + + FixRXSaturation(); + + Modify_SPI_Reg_bits(0x040C, 5, 5, 0); //GFIR3_BYP 0 + Modify_SPI_Reg_bits(LMS7param(HBD_OVR_RXTSP), 2); + Modify_SPI_Reg_bits(LMS7param(GFIR3_L_RXTSP), 7); + Modify_SPI_Reg_bits(LMS7param(GFIR3_N_RXTSP), 7); + + SetGFIRCoefficients(Rx, 2, firCoefs, sizeof(firCoefs) / sizeof(int16_t)); + + SetNCOFrequency(Rx, 0, bandwidth_MHz / 4 + 1); + Modify_SPI_Reg_bits(LMS7param(GCORRI_RXTSP), 2047); + Modify_SPI_Reg_bits(LMS7param(GCORRQ_RXTSP), 2047); + + Log("IQ correction stage", LOG_INFO); + iqcorr_rx = 0; + for (int i = 0; i<9; ++i) + minRSSI_iq = FindMinRSSI(LMS7param(IQCORR_RXTSP), iqcorr_rx, &iqcorr_rx, 3, 1, 256 >> i); + Modify_SPI_Reg_bits(LMS7param(IQCORR_RXTSP), iqcorr_rx); + + uint16_t mingcorri; + Log("I gain", LOG_INFO); + minRSSI_i = FindMinRSSI_Gain(LMS7param(GCORRI_RXTSP), &mingcorri); + + Modify_SPI_Reg_bits(LMS7param(GCORRI_RXTSP), 2047); + Modify_SPI_Reg_bits(LMS7param(GCORRQ_RXTSP), 2047); + + Log("Q gain", LOG_INFO); + uint16_t mingcorrq; + minRSSI_q = FindMinRSSI_Gain(LMS7param(GCORRQ_RXTSP), &mingcorrq); + + if (minRSSI_i < minRSSI_q) + mingcorrq = 2047; + else + mingcorri = 2047; + + Modify_SPI_Reg_bits(LMS7param(GCORRI_RXTSP), mingcorri); + Modify_SPI_Reg_bits(LMS7param(GCORRQ_RXTSP), mingcorrq); + + Log("Phase", LOG_INFO); + for (int i = 0; i<9; ++i) + minRSSI_iq = FindMinRSSI(LMS7param(IQCORR_RXTSP), iqcorr_rx, &iqcorr_rx, 3, 1, 256 >> i); + +RxCalibrationEndStage: + Log("Restoring registers state", LOG_INFO); + RestoreAllRegisters(); + if (status != LIBLMS7_SUCCESS) + { + Log("Rx calibration failed", LOG_WARNING); + return status; + } + + Modify_SPI_Reg_bits(LMS7param(MAC), ch); + SetRxDCOFF((int8_t)dcoffi, (int8_t)dcoffq); + Modify_SPI_Reg_bits(LMS7param(EN_DCOFF_RXFE_RFE), 1); + Modify_SPI_Reg_bits(LMS7param(GCORRI_RXTSP), mingcorri); + Modify_SPI_Reg_bits(LMS7param(GCORRQ_RXTSP), mingcorrq); + Modify_SPI_Reg_bits(LMS7param(IQCORR_RXTSP), iqcorr_rx); + Modify_SPI_Reg_bits(0x040C, 2, 0, 0); //DC_BYP 0, GC_BYP 0, PH_BYP 0 + Modify_SPI_Reg_bits(0x0110, 4, 0, 31); //ICT_LO_RFE 31 + Log("Rx calibration finished", LOG_INFO); + return LIBLMS7_SUCCESS; +} + +const uint16_t backupAddrs[] = { + 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, + 0x0029, 0x002A, 0x002B, 0x002C, 0x002E, 0x0081, 0x0082, 0x0084, 0x0085, + 0x0086, 0x0087, 0x0088, 0x0089, 0x008A, 0x008B, 0x008C, 0x0092, 0x0093, 0x0094, + 0x0095, 0x0096, 0x0097, 0x0098, 0x0099, 0x009A, 0x009B, 0x009C, 0x009D, 0x009E, + 0x009F, 0x00A0, 0x00A1, 0x00A2, 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7, 0x00A8, + 0x00A9, 0x00AA, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x0100, 0x0101, 0x0102, 0x0103, + 0x0104, 0x0105, 0x0106, 0x0107, 0x0108, 0x0109, 0x010A, 0x010C, 0x010D, 0x010E, + 0x010F, 0x0110, 0x0111, 0x0112, 0x0113, 0x0114, 0x0115, 0x0116, 0x0117, 0x0118, + 0x0119, 0x011A, 0x011C, 0x011D, 0x011E, 0x011F, 0x0120, 0x0121, 0x0122, 0x0123, + 0x0124, 0x0200, 0x0201, 0x0202, 0x0203, 0x0204, 0x0205, 0x0206, 0x0207, 0x0208, + 0x0240, 0x0242, 0x0243, 0x0400, 0x0401, 0x0402, + 0x0403, 0x0404, 0x0405, 0x0406, 0x0407, 0x0408, 0x0409, 0x040A, 0x040B, 0x040C, + 0x0440, 0x0442, 0x0443 }; +uint16_t backupRegs[sizeof(backupAddrs) / 2]; +const uint16_t backupSXAddr[] = { 0x011C, 0x011D, 0x011E, 0x011F, 0x01200, 0x0121, 0x0122, 0x0123, 0x0124 }; +uint16_t backupRegsSXR[sizeof(backupSXAddr) / 2]; +uint16_t backupRegsSXT[sizeof(backupSXAddr) / 2]; + +/** @brief Stores chip current registers state into memory for later restoration +*/ +void LMS7002M::BackupAllRegisters() +{ + uint8_t ch = (uint8_t)Get_SPI_Reg_bits(LMS7param(MAC)); + SPI_read_batch(backupAddrs, backupRegs, sizeof(backupAddrs) / sizeof(uint16_t)); + Modify_SPI_Reg_bits(LMS7param(MAC), 1); // channel A + SPI_read_batch(backupSXAddr, backupRegsSXR, sizeof(backupRegsSXR) / sizeof(uint16_t)); + Modify_SPI_Reg_bits(LMS7param(MAC), 2); // channel B + SPI_read_batch(backupSXAddr, backupRegsSXT, sizeof(backupRegsSXR) / sizeof(uint16_t)); + Modify_SPI_Reg_bits(LMS7param(MAC), ch); +} + +/** @brief Sets chip registers to state that was stored in memory using BackupAllRegisters() +*/ +void LMS7002M::RestoreAllRegisters() +{ + uint8_t ch = (uint8_t)Get_SPI_Reg_bits(LMS7param(MAC)); + SPI_write_batch(backupAddrs, backupRegs, sizeof(backupAddrs) / sizeof(uint16_t)); + Modify_SPI_Reg_bits(LMS7param(MAC), 1); // channel A + SPI_write_batch(backupSXAddr, backupRegsSXR, sizeof(backupRegsSXR) / sizeof(uint16_t)); + Modify_SPI_Reg_bits(LMS7param(MAC), 2); // channel B + SPI_write_batch(backupSXAddr, backupRegsSXT, sizeof(backupRegsSXR) / sizeof(uint16_t)); + Modify_SPI_Reg_bits(LMS7param(MAC), ch); +} + +/** @brief Searches for minimal digital RSSI value by changing given gain parameter + @param param LMS7002M gain correction parameter + @param foundValue returns value which achieved minimal RSSI + @return minimal found RSSI value +*/ +uint32_t LMS7002M::FindMinRSSI_Gain(const LMS7Parameter ¶m, uint16_t *foundValue) +{ + uint32_t RSSI = ~0 - 2; + uint32_t prevRSSI = RSSI + 1; + uint8_t decrement = 2; + uint16_t gcorr = 2047; + while (gcorr > 1024) + { + Modify_SPI_Reg_bits(param, gcorr); + RSSI = GetRSSI(); + if (RSSI < prevRSSI) + { + prevRSSI = RSSI; + *foundValue = gcorr; + gcorr -= decrement; + decrement *= 2; + } + else + { + if (decrement == 2) + break; + gcorr -= decrement; + decrement = 2; + } + } + return prevRSSI; +} + +/** @brief Reads all chip configuration and checks if it matches with local registers copy +*/ +bool LMS7002M::IsSynced() +{ + if (controlPort->IsOpen() == false) + return false; + bool isSynced = true; + liblms7_status status; + + uint8_t ch = (uint8_t)Get_SPI_Reg_bits(LMS7param(MAC)); + + vector<uint16_t> addrToRead = mRegistersMap->GetUsedAddresses(0); + vector<uint16_t> dataReceived; + dataReceived.resize(addrToRead.size(), 0); + + Modify_SPI_Reg_bits(LMS7param(MAC), 1); + status = SPI_read_batch(&addrToRead[0], &dataReceived[0], addrToRead.size()); + if (status != LIBLMS7_SUCCESS) + { + isSynced = false; + goto isSyncedEnding; + } + + //mask out readonly bits + for (uint16_t j = 0; j < sizeof(readOnlyRegisters) / sizeof(uint16_t); ++j) + for (uint16_t k = 0; k < addrToRead.size(); ++k) + if (readOnlyRegisters[j] == addrToRead[k]) + { + dataReceived[k] &= readOnlyRegistersMasks[j]; + break; + } + + //check if local copy matches chip + for (uint16_t i = 0; i < addrToRead.size(); ++i) + { + if (dataReceived[i] != mRegistersMap->GetValue(0, addrToRead[i])) + { + isSynced = false; + goto isSyncedEnding; + } + } + + addrToRead.clear(); //add only B channel addresses + addrToRead = mRegistersMap->GetUsedAddresses(1); + + //mask out readonly bits + for (uint16_t j = 0; j < sizeof(readOnlyRegisters) / sizeof(uint16_t); ++j) + for (uint16_t k = 0; k < addrToRead.size(); ++k) + if (readOnlyRegisters[j] == addrToRead[k]) + { + dataReceived[k] &= readOnlyRegistersMasks[j]; + break; + } + + Modify_SPI_Reg_bits(LMS7param(MAC), 2); + status = SPI_read_batch(&addrToRead[0], &dataReceived[0], addrToRead.size()); + if (status != LIBLMS7_SUCCESS) + return false; + //check if local copy matches chip + for (uint16_t i = 0; i < addrToRead.size(); ++i) + if (dataReceived[i] != mRegistersMap->GetValue(1, addrToRead[i])) + { + isSynced = false; + break; + } + +isSyncedEnding: + Modify_SPI_Reg_bits(LMS7param(MAC), ch); //restore previously used channel + return isSynced; +} + +/** @brief Writes all registers from host to chip + +When used on Novena board, also changes gpios to match rx path and tx band selections +*/ +liblms7_status LMS7002M::UploadAll() +{ + if (controlPort == NULL) + return LIBLMS7_NO_CONNECTION_MANAGER; + if (controlPort->IsOpen() == false) + return LIBLMS7_NOT_CONNECTED; + + uint8_t ch = (uint8_t)Get_SPI_Reg_bits(LMS7param(MAC)); //remember used channel + + liblms7_status status; + + vector<uint16_t> addrToWrite; + vector<uint16_t> dataToWrite; + + uint16_t x0020_value = mRegistersMap->GetValue(0, 0x0020); + Modify_SPI_Reg_bits(LMS7param(MAC), 1); //select A channel + + addrToWrite = mRegistersMap->GetUsedAddresses(0); + //remove 0x0020 register from list, to not change MAC + addrToWrite.erase( find(addrToWrite.begin(), addrToWrite.end(), 0x0020) ); + for (auto address : addrToWrite) + dataToWrite.push_back(mRegistersMap->GetValue(0, address)); + + status = SPI_write_batch(&addrToWrite[0], &dataToWrite[0], addrToWrite.size()); + status = LIBLMS7_SUCCESS; + if (status != LIBLMS7_SUCCESS) + return status; + //after all channel A registers have been written, update 0x0020 register value + status = SPI_write(0x0020, x0020_value); + if (status != LIBLMS7_SUCCESS) + return status; + Modify_SPI_Reg_bits(LMS7param(MAC), 2); + if (status != LIBLMS7_SUCCESS) + return status; + + addrToWrite = mRegistersMap->GetUsedAddresses(1); + dataToWrite.clear(); + for (auto address : addrToWrite) + { + dataToWrite.push_back(mRegistersMap->GetValue(1, address)); + } + Modify_SPI_Reg_bits(LMS7param(MAC), 2); //select B channel + status = SPI_write_batch(&addrToWrite[0], &dataToWrite[0], addrToWrite.size()); + if (status != LIBLMS7_SUCCESS) + return status; + Modify_SPI_Reg_bits(LMS7param(MAC), ch); //restore last used channel + + //in case of Novena board, need to update GPIO + if(controlPort->GetInfo().device == LMS_DEV_NOVENA) + { + uint16_t regValue = SPI_read(0x0706) & 0xFFF8; + //lms_gpio2 - tx output selection: + // 0 - TX1_A and TX1_B (Band 1), + // 1 - TX2_A and TX2_B (Band 2) + regValue |= Get_SPI_Reg_bits(LMS7param(SEL_BAND2_TRF)) << 2; //gpio2 + //RX active paths + //lms_gpio0 | lms_gpio1 RX_A RX_B + // 0 0 => no active path + // 1 0 => LNAW_A LNAW_B + // 0 1 => LNAH_A LNAH_B + // 1 1 => LNAL_A LNAL_B + switch(Get_SPI_Reg_bits(LMS7param(SEL_PATH_RFE))) + { + //set gpio1:gpio0 + case 0: regValue |= 0x0; break; + case 1: regValue |= 0x2; break; + case 2: regValue |= 0x3; break; + case 3: regValue |= 0x1; break; + } + SPI_write(0x0706, regValue); + } + return LIBLMS7_SUCCESS; +} + +/** @brief Reads all registers from the chip to host + +When used on Novena board, also updates gpios to match rx path and tx band selections +*/ +liblms7_status LMS7002M::DownloadAll() +{ + if (controlPort == nullptr) + return LIBLMS7_NO_CONNECTION_MANAGER; + if (controlPort->IsOpen() == false) + return LIBLMS7_NOT_CONNECTED; + liblms7_status status; + uint8_t ch = (uint8_t)Get_SPI_Reg_bits(LMS7param(MAC), false); + + vector<uint16_t> addrToRead = mRegistersMap->GetUsedAddresses(0); + vector<uint16_t> dataReceived; + dataReceived.resize(addrToRead.size(), 0); + Modify_SPI_Reg_bits(LMS7param(MAC), 1); + status = SPI_read_batch(&addrToRead[0], &dataReceived[0], addrToRead.size()); + if (status != LIBLMS7_SUCCESS) + return status; + + for (uint16_t i = 0; i < addrToRead.size(); ++i) + { + uint16_t adr = addrToRead[i]; + uint16_t val = dataReceived[i]; + mRegistersMap->SetValue(0, addrToRead[i], dataReceived[i]); + } + + addrToRead.clear(); //add only B channel addresses + addrToRead = mRegistersMap->GetUsedAddresses(1); + dataReceived.resize(addrToRead.size(), 0); + + Modify_SPI_Reg_bits(LMS7param(MAC), 2); + status = SPI_read_batch(&addrToRead[0], &dataReceived[0], addrToRead.size()); + if (status != LIBLMS7_SUCCESS) + return status; + for (uint16_t i = 0; i < addrToRead.size(); ++i) + mRegistersMap->SetValue(1, addrToRead[i], dataReceived[i]); + + Modify_SPI_Reg_bits(LMS7param(MAC), ch); //retore previously used channel + + //in case of Novena board, update GPIO + if(controlPort->GetInfo().device == LMS_DEV_NOVENA) + { + uint16_t regValue = SPI_read(0x0706) & 0xFFF8; + //lms_gpio2 - tx output selection: + // 0 - TX1_A and TX1_B (Band 1), + // 1 - TX2_A and TX2_B (Band 2) + regValue |= Get_SPI_Reg_bits(LMS7param(SEL_BAND2_TRF)) << 2; //gpio2 + //RX active paths + //lms_gpio0 | lms_gpio1 RX_A RX_B + // 0 0 => no active path + // 1 0 => LNAW_A LNAW_B + // 0 1 => LNAH_A LNAH_B + // 1 1 => LNAL_A LNAL_B + switch(Get_SPI_Reg_bits(LMS7param(SEL_PATH_RFE))) + { + //set gpio1:gpio0 + case 0: regValue |= 0x0; break; + case 1: regValue |= 0x2; break; + case 2: regValue |= 0x3; break; + case 3: regValue |= 0x1; break; + } + SPI_write(0x0706, regValue); + } + + return LIBLMS7_SUCCESS; +} + +/** @brief Configures interfaces for desired frequency + Sets interpolation and decimation, changes MCLK sources and TSP clock dividers accordingly to selected interpolation and decimation +*/ +liblms7_status LMS7002M::SetInterfaceFrequency(float_type cgen_freq_MHz, const uint8_t interpolation, const uint8_t decimation) +{ + Modify_SPI_Reg_bits(LMS7param(HBD_OVR_RXTSP), decimation); + Modify_SPI_Reg_bits(LMS7param(HBI_OVR_TXTSP), interpolation); + liblms7_status status = SetFrequencyCGEN(cgen_freq_MHz); + if (status != LIBLMS7_SUCCESS) + return status; + + if (decimation == 7 || decimation == 0) //bypass + { + Modify_SPI_Reg_bits(LMS7param(RXTSPCLKA_DIV), 0); + Modify_SPI_Reg_bits(LMS7param(RXDIVEN), false); + Modify_SPI_Reg_bits(LMS7param(MCLK2SRC), 3); + } + else + { + uint8_t divider = (uint8_t)pow(2.0, decimation); + if (divider > 1) + Modify_SPI_Reg_bits(LMS7param(RXTSPCLKA_DIV), (divider / 2) - 1); + else + Modify_SPI_Reg_bits(LMS7param(RXTSPCLKA_DIV), 0); + Modify_SPI_Reg_bits(LMS7param(RXDIVEN), true); + Modify_SPI_Reg_bits(LMS7param(MCLK2SRC), 1); + } + if (interpolation == 7 || interpolation == 0) //bypass + { + Modify_SPI_Reg_bits(LMS7param(TXTSPCLKA_DIV), 0); + Modify_SPI_Reg_bits(LMS7param(TXDIVEN), false); + Modify_SPI_Reg_bits(LMS7param(MCLK1SRC), 2); + } + else + { + uint8_t divider = (uint8_t)pow(2.0, interpolation); + if (divider > 1) + Modify_SPI_Reg_bits(LMS7param(TXTSPCLKA_DIV), (divider / 2) - 1); + else + Modify_SPI_Reg_bits(LMS7param(TXTSPCLKA_DIV), 0); + Modify_SPI_Reg_bits(LMS7param(TXDIVEN), true); + Modify_SPI_Reg_bits(LMS7param(MCLK1SRC), 0); + } + return status; +} diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/LMS7002M.h b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/LMS7002M.h new file mode 100644 index 0000000000000000000000000000000000000000..81234c28a3fa7686041eaed5efc5c518e8f745d5 --- /dev/null +++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/LMS7002M.h @@ -0,0 +1,177 @@ +/** +@file LMS7002M.h +@author Lime Microsystems (www.limemicro.com) +@brief LMS7002M transceiver configuration interface +*/ + +#ifndef LMS7API_H +#define LMS7API_H + +#include "LMS7002M_statuses.h" +#include "LMS7002M_parameters.h" +#include "typedefs.h" + +#include <sstream> + +class LMScomms; +class LMS7002M_RegistersMap; + +class LMS7002M +{ +public: + enum + { + Rx, Tx + }; + + LMS7002M(); + LMS7002M(LMScomms* controlPort); + virtual ~LMS7002M(); + + ///@name Registers writing and reading + liblms7_status UploadAll(); + liblms7_status DownloadAll(); + bool IsSynced(); + + liblms7_status ResetChip(); + liblms7_status LoadConfig(const char* filename); + liblms7_status SaveConfig(const char* filename); + ///@} + + ///@name Registers writing and reading + uint16_t Get_SPI_Reg_bits(const LMS7Parameter ¶m, bool fromChip = true); + uint16_t Get_SPI_Reg_bits(uint16_t address, uint8_t msb, uint8_t lsb, bool fromChip = true); + liblms7_status Modify_SPI_Reg_bits(const LMS7Parameter ¶m, const uint16_t value, bool fromChip = true); + liblms7_status Modify_SPI_Reg_bits(uint16_t address, uint8_t msb, uint8_t lsb, uint16_t value, bool fromChip = true); + liblms7_status SPI_write(uint16_t address, uint16_t data); + uint16_t SPI_read(uint16_t address, bool fromChip = true, liblms7_status *status = 0); + liblms7_status RegistersTest(); + ///@} + + ///@name Transmitter, Receiver calibrations + liblms7_status CalibrateRx(float_type bandwidth_MHz); + liblms7_status CalibrateTx(float_type bandwidth_MHz); + ///@} + + ///@name Filters tuning + enum TxFilter + { + TX_LADDER, TX_REALPOLE, TX_HIGHBAND + }; + enum RxFilter + { + RX_TIA, RX_LPF_LOWBAND, RX_LPF_HIGHBAND + }; + liblms7_status TuneTxFilter(TxFilter filterType, float_type bandwidth_MHz); + liblms7_status TuneTxFilterLowBandChain(float_type ladder_bw_MHz, float_type realpole_bw_MHz); + liblms7_status TuneRxFilter(RxFilter filterType, float_type bandwidth_MHz); + ///@} + + ///@name CGEN and PLL + float_type GetReferenceClk_SX(bool tx); + float_type GetFrequencyCGEN_MHz(); + liblms7_status SetFrequencyCGEN(float_type freq_MHz); + float_type GetFrequencySX_MHz(bool tx, float_type refClk_MHz); + liblms7_status SetFrequencySX(bool tx, float_type freq_MHz, float_type refClk_MHz); + ///VCO modules available for tuning + enum VCO_Module + { + VCO_CGEN, VCO_SXR, VCO_SXT + }; + liblms7_status TuneVCO(VCO_Module module); + ///@} + + ///@name TSP + liblms7_status LoadDC_REG_IQ(bool tx, int16_t I, int16_t Q); + liblms7_status SetNCOFrequency(bool tx, uint8_t index, float_type freq_MHz); + float_type GetNCOFrequency_MHz(bool tx, uint8_t index, float_type refClk_MHz, bool fromChip = true); + liblms7_status SetNCOPhaseOffsetForMode0(bool tx, float_type angle_Deg); + liblms7_status SetNCOPhaseOffset(bool tx, uint8_t index, float_type angle_Deg); + float_type GetNCOPhaseOffset_Deg(bool tx, uint8_t index); + liblms7_status SetGFIRCoefficients(bool tx, uint8_t GFIR_index, const int16_t *coef, uint8_t coefCount); + liblms7_status GetGFIRCoefficients(bool tx, uint8_t GFIR_index, int16_t *coef, uint8_t coefCount); + float_type GetReferenceClk_TSP_MHz(bool tx); + ///@} + + liblms7_status SetInterfaceFrequency(float_type cgen_freq_MHz, const uint8_t interpolation, const uint8_t decimation); + + ///enumeration to indicate module registers intervals + enum MemorySection + { + LimeLight = 0, EN_DIR, AFE, BIAS, XBUF, CGEN, LDO, BIST, CDS, + TRF, TBB, RFE, RBB, SX, TxTSP, + TxNCO, TxGFIR1, TxGFIR2, TxGFIR3a, TxGFIR3b, TxGFIR3c, + RxTSP, RxNCO, RxGFIR1, RxGFIR2, RxGFIR3a, RxGFIR3b, RxGFIR3c, + MEMORY_SECTIONS_COUNT + }; + virtual liblms7_status SetDefaults(MemorySection module); + LMScomms* GetControlPort() const { return controlPort;}; + + static const float_type gLadder_lower_limit; + static const float_type gLadder_higher_limit; + static const float_type gRealpole_lower_limit; + static const float_type gRealpole_higher_limit; + static const float_type gHighband_lower_limit; + static const float_type gHighband_higher_limit; + + static const float_type gRxTIA_higher_limit; + static const float_type gRxTIA_lower_limit_g1; + static const float_type gRxTIA_lower_limit_g23; + static const float_type gRxLPF_low_lower_limit; + static const float_type gRxLPF_low_higher_limit; + static const float_type gRxLPF_high_lower_limit; + static const float_type gRxLPF_high_higher_limit; + + static float_type gVCO_frequency_table[3][2]; + static float_type gCGEN_VCO_frequencies[2]; + + //protected: + LMS7002M_RegistersMap *mRegistersMap; + static const uint16_t readOnlyRegisters[]; + static const uint16_t readOnlyRegistersMasks[]; + + uint16_t MemorySectionAddresses[MEMORY_SECTIONS_COUNT][2]; + ///@name Algorithms functions + void BackupAllRegisters(); + void RestoreAllRegisters(); + uint32_t GetRSSI(); + void SetRxDCOFF(int8_t offsetI, int8_t offsetQ); + uint32_t FindMinRSSI_Gain(const LMS7Parameter ¶m, uint16_t *foundValue); + uint32_t FindMinRSSI(const LMS7Parameter ¶m, const int16_t startValue, int16_t *result, const uint8_t scanWidth, const uint8_t twoCompl, int8_t stepMult = 1); + uint32_t FindMinRSSI(const uint16_t addr, const uint8_t msb, const uint8_t lsb, const int16_t startValue, int16_t *result, const uint8_t scanWidth, const uint8_t twoCompl, int8_t stepMult = 1); + void CalibrateRxDC_RSSI(); + liblms7_status CalibrateTxSetup(float_type bandwidth_MHz); + liblms7_status CalibrateRxSetup(float_type bandwidth_MHz); + liblms7_status FixRXSaturation(); + void FilterTuning_AdjustGains(); + liblms7_status TuneTxFilterSetup(TxFilter type, float_type cutoff_MHz); + liblms7_status TuneRxFilterSetup(RxFilter type, float_type cutoff_MHz); + liblms7_status RFE_TIA_Calibration(float_type TIA_freq_MHz); + liblms7_status RxLPFLow_Calibration(float_type RxLPFL_freq_MHz); + liblms7_status RxLPFHigh_Calibration(float_type RxLPFH_freq_MHz); + + liblms7_status RegistersTestInterval(uint16_t startAddr, uint16_t endAddr, uint16_t pattern, std::stringstream &ss); + liblms7_status SPI_write_batch(const uint16_t* spiAddr, const uint16_t* spiData, uint16_t cnt); + liblms7_status SPI_read_batch(const uint16_t* spiAddr, uint16_t* spiData, uint16_t cnt); + liblms7_status Modify_SPI_Reg_mask(const uint16_t *addr, const uint16_t *masks, const uint16_t *values, uint8_t start, uint8_t stop); + ///@} + ///Reference clock used for Receiver frequency calculations + float_type mRefClkSXR_MHz; + ///Reference clock used for Transmitter frequency calculations + float_type mRefClkSXT_MHz; + + enum LogType + { + LOG_INFO, + LOG_WARNING, + LOG_ERROR, + LOG_DATA + }; + virtual void Log(const char* text, LogType type); + + ///port used for communicating with LMS7002M + LMScomms* controlPort; + + liblms7_status LoadConfigLegacyFile(const char* filename); +}; +#endif diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/LMS7002M_RegistersMap.cpp b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/LMS7002M_RegistersMap.cpp new file mode 100644 index 0000000000000000000000000000000000000000..8c870ffcc0da6869ab73b8d6c734766554a5a65e --- /dev/null +++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/LMS7002M_RegistersMap.cpp @@ -0,0 +1,68 @@ +#include "LMS7002M_RegistersMap.h" +#include "LMS7002M_parameters.h" + +LMS7002M_RegistersMap::LMS7002M_RegistersMap() +{ + +} + +LMS7002M_RegistersMap::~LMS7002M_RegistersMap() +{ + +} + +uint16_t LMS7002M_RegistersMap::GetDefaultValue(uint16_t address) const +{ + std::map<uint16_t, Register>::const_iterator iter = mChannelA.find(address); + if( iter != mChannelA.end()) + return iter->second.defaultValue; + else + return 0; +} + +void LMS7002M_RegistersMap::InitializeDefaultValues(const std::vector<const LMS7Parameter*> parameterList) +{ + for(auto parameter : parameterList) + { + uint16_t regValue = mChannelA[parameter->address].defaultValue; + mChannelA[parameter->address].defaultValue = regValue | (parameter->defaultValue << parameter->lsb); + mChannelA[parameter->address].value = mChannelA[parameter->address].defaultValue; + if(parameter->address >= 0x0100) + mChannelB[parameter->address].value = mChannelA[parameter->address].value; + } +} + +void LMS7002M_RegistersMap::SetValue(uint8_t channel, const uint16_t address, const uint16_t value) +{ + if(channel == 0) + mChannelA[address].value = value; + else if(channel == 1) + mChannelB[address].value = value; +} + +uint16_t LMS7002M_RegistersMap::GetValue(uint8_t channel, uint16_t address) const +{ + const std::map<const uint16_t, Register> *regMap; + if(channel == 0) + regMap = &mChannelA; + else if(channel == 1) + regMap = &mChannelB; + std::map<const uint16_t, Register>::const_iterator iter; + iter = regMap->find(address); + if (iter != regMap->end()) + return iter->second.value; + else + return 0; +} + +std::vector<uint16_t> LMS7002M_RegistersMap::GetUsedAddresses(const uint8_t channel) const +{ + std::vector<uint16_t> addresses; + if(channel == 0) + for(auto iter : mChannelA) + addresses.push_back(iter.first); + else if(channel == 1) + for(auto iter : mChannelB) + addresses.push_back(iter.first); + return addresses; +} diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/LMS7002M_RegistersMap.h b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/LMS7002M_RegistersMap.h new file mode 100644 index 0000000000000000000000000000000000000000..5ccda752db36187ef2626f751df312af5d4f4663 --- /dev/null +++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/LMS7002M_RegistersMap.h @@ -0,0 +1,35 @@ +#ifndef LMS7002M_REGISTERS_MAP_H +#define LMS7002M_REGISTERS_MAP_H + +#include <vector> +#include <map> +#include <typedefs.h> + +struct LMS7Parameter; + +class LMS7002M_RegistersMap +{ +public: + struct Register + { + uint16_t value; + uint16_t defaultValue; + uint16_t mask; + }; + + LMS7002M_RegistersMap(); + ~LMS7002M_RegistersMap(); + + uint16_t GetValue(uint8_t channel, uint16_t address) const; + void SetValue(uint8_t channel, const uint16_t address, const uint16_t value); + + void InitializeDefaultValues(const std::vector<const LMS7Parameter*> parameterList); + uint16_t GetDefaultValue(uint16_t address) const; + std::vector<uint16_t> GetUsedAddresses(const uint8_t channel) const; + +protected: + std::map<const uint16_t, Register> mChannelA; + std::map<const uint16_t, Register> mChannelB; +}; + +#endif diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/LMS7002M_filtersCalibration.cpp b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/LMS7002M_filtersCalibration.cpp new file mode 100644 index 0000000000000000000000000000000000000000..2f3d38c1b587ae0cad7f5134857af0ffc444bb54 --- /dev/null +++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/LMS7002M_filtersCalibration.cpp @@ -0,0 +1,861 @@ +/** +@file LMS7002M_filtersCalibration.cpp +@author Lime Microsystems (www.limemicro.com) +@brief Implementation of LMS7002M transceiver filters calibration algorithms +*/ + +#include "LMS7002M.h" +#include <cmath> + +///define for parameter enumeration if prefix might be needed +#define LMS7param(id) id + +const float_type LMS7002M::gLadder_lower_limit = 2; +const float_type LMS7002M::gLadder_higher_limit = 16; +const float_type LMS7002M::gRealpole_lower_limit = 0.8; +const float_type LMS7002M::gRealpole_higher_limit = 3.2; +const float_type LMS7002M::gHighband_lower_limit = 28; +const float_type LMS7002M::gHighband_higher_limit = 70; + +const float_type LMS7002M::gRxTIA_higher_limit = 60; +const float_type LMS7002M::gRxTIA_lower_limit_g1 = 1.5; +const float_type LMS7002M::gRxTIA_lower_limit_g23 = 0.5; +const float_type LMS7002M::gRxLPF_low_lower_limit = 1; +const float_type LMS7002M::gRxLPF_low_higher_limit = 20; +const float_type LMS7002M::gRxLPF_high_lower_limit = 20; +const float_type LMS7002M::gRxLPF_high_higher_limit = 70; + +liblms7_status LMS7002M::TuneTxFilterSetup(LMS7002M::TxFilter type, float_type cutoff_MHz) +{ + Modify_SPI_Reg_bits(LMS7param(EN_G_RFE), 0); + Modify_SPI_Reg_bits(LMS7param(EN_G_TRF), 0); + + //RBB + SetDefaults(RBB); + Modify_SPI_Reg_bits(LMS7param(PD_LPFL_RBB), 1); + Modify_SPI_Reg_bits(LMS7param(INPUT_CTL_PGA_RBB), 3); + Modify_SPI_Reg_bits(LMS7param(ICT_PGA_OUT_RBB), 20); + Modify_SPI_Reg_bits(LMS7param(ICT_PGA_IN_RBB), 20); + Modify_SPI_Reg_bits(LMS7param(C_CTL_PGA_RBB), 3); + + //TBB + SetDefaults(TBB); + Modify_SPI_Reg_bits(LMS7param(CG_IAMP_TBB), 1); + Modify_SPI_Reg_bits(LMS7param(ICT_IAMP_FRP_TBB), 1); + Modify_SPI_Reg_bits(LMS7param(ICT_IAMP_GG_FRP_TBB), 6); + + //AFE + uint8_t isel_dac_afe = (uint8_t)Get_SPI_Reg_bits(0x0082, 15, 13); + SetDefaults(AFE); + if (Get_SPI_Reg_bits(LMS7param(MAC)) == 2) + { + Modify_SPI_Reg_bits(LMS7param(PD_TX_AFE2), 0); //PD_RX_AFE2 0 + Modify_SPI_Reg_bits(LMS7param(PD_RX_AFE2), 0); //PD_RX_AFE2 0 + } + Modify_SPI_Reg_bits(0x0082, 15, 13, isel_dac_afe); + + //BIAS + uint8_t rpcalib_bias = (uint8_t)Get_SPI_Reg_bits(LMS7param(RP_CALIB_BIAS)); + SetDefaults(BIAS); + Modify_SPI_Reg_bits(LMS7param(RP_CALIB_BIAS), rpcalib_bias); + + //XBUF + Modify_SPI_Reg_bits(LMS7param(PD_XBUF_RX), 0); + Modify_SPI_Reg_bits(LMS7param(PD_XBUF_TX), 0); + Modify_SPI_Reg_bits(LMS7param(EN_G_XBUF), 1); + + //CGEN + SetDefaults(CGEN); + + //txtsp + SetDefaults(TxTSP); + Modify_SPI_Reg_bits(LMS7param(TSGMODE_TXTSP), 1); + Modify_SPI_Reg_bits(LMS7param(INSEL_TXTSP), 1); + Modify_SPI_Reg_bits(0x0208, 6, 4, 7); + LoadDC_REG_IQ(Tx, (int16_t)0x7FFF, (int16_t)0x8000); + float_type txNCOfreq = 0.05; + SetNCOFrequency(Tx, 0, txNCOfreq); + + //rxtsp + SetDefaults(RxTSP); + SetNCOFrequency(Rx, 0, txNCOfreq - 1); + + Modify_SPI_Reg_bits(LMS7param(AGC_MODE_RXTSP), 1); + Modify_SPI_Reg_bits(0x040C, 6, 3, 0x07); + + Modify_SPI_Reg_bits(LMS7param(AGC_AVG_RXTSP), 7); + Modify_SPI_Reg_bits(LMS7param(CMIX_GAIN_RXTSP), 1); + + return LIBLMS7_SUCCESS; +} + + +liblms7_status LMS7002M::TuneTxFilter(LMS7002M::TxFilter type, float_type cutoff_MHz) +{ + liblms7_status status; + float_type lowLimit = 0; + float_type highLimit = 1000; + uint32_t rssi = 0; + int8_t dir; + uint8_t ccal_lpflad_tbb; + uint32_t rssi_value_100k; + int16_t rcal; + + float_type ncoFreq = 0.05; + float_type cgenFreq; + uint8_t loopb_tbb; + uint8_t cg_iamp_tbb = 1; + uint8_t bypladder_tbb; + uint8_t pd_lpfh_tbb; + uint8_t pd_lpflad_tbb; + uint8_t pd_lpfs5; + uint8_t en_g_tbb = 1; + uint8_t pd_iamp_tbb = 0; + uint8_t tstin_tbb = 0; + + BackupAllRegisters(); + //float_type userCLKGENfreq = GetFrequencyCGEN_MHz(); + + status = TuneTxFilterSetup(type, cutoff_MHz); + if (status != LIBLMS7_SUCCESS) + goto TxFilterTuneEnd; + cgenFreq = cutoff_MHz * 20; + if (cgenFreq < 60) + cgenFreq = 60; + if (cgenFreq > 640) + cgenFreq = 640; + if (type == TX_LADDER) + { + loopb_tbb = 2; + bypladder_tbb = 0; + pd_lpfh_tbb = 1; + pd_lpflad_tbb = 0; + pd_lpfs5 = 1; + lowLimit = gLadder_lower_limit; + highLimit = gLadder_higher_limit; + } + else if (type == TX_REALPOLE) + { + loopb_tbb = 3; + bypladder_tbb = 1; + pd_lpfh_tbb = 1; + pd_lpflad_tbb = 1; + pd_lpfs5 = 0; + lowLimit = gRealpole_lower_limit; + highLimit = gRealpole_higher_limit; + } + else if (type == TX_HIGHBAND) + { + loopb_tbb = 3; + bypladder_tbb = 0; + pd_lpfh_tbb = 0; + pd_lpflad_tbb = 1; + pd_lpfs5 = 1; + lowLimit = gHighband_lower_limit; + highLimit = gHighband_higher_limit; + } + if (cutoff_MHz == cgenFreq / 16) + cgenFreq -= 10; + + if (cutoff_MHz < lowLimit || cutoff_MHz > highLimit) + { + status = LIBLMS7_FREQUENCY_OUT_OF_RANGE; + goto TxFilterTuneEnd; + } + + status = SetFrequencyCGEN(cgenFreq); + if (status != LIBLMS7_SUCCESS) + goto TxFilterTuneEnd; + + Modify_SPI_Reg_bits(LMS7param(LOOPB_TBB), loopb_tbb); + Modify_SPI_Reg_bits(LMS7param(CG_IAMP_TBB), cg_iamp_tbb); + Modify_SPI_Reg_bits(LMS7param(BYPLADDER_TBB), bypladder_tbb); + Modify_SPI_Reg_bits(LMS7param(TSTIN_TBB), tstin_tbb); + Modify_SPI_Reg_bits(LMS7param(PD_LPFH_TBB), pd_lpfh_tbb); + Modify_SPI_Reg_bits(LMS7param(PD_LPFIAMP_TBB), pd_iamp_tbb); + Modify_SPI_Reg_bits(LMS7param(PD_LPFLAD_TBB), pd_lpflad_tbb); + Modify_SPI_Reg_bits(LMS7param(PD_LPFS5_TBB), pd_lpfs5); + Modify_SPI_Reg_bits(LMS7param(EN_G_TBB), en_g_tbb); + + //B + //LADDER coefficients + float_type p1, p2, p3, p4, p5; + switch (type) + { + case TX_LADDER: + p1 = 1.29858903647958E-16; + p2 = -0.000110746929967704; + p3 = 0.00277593485991029; + p4 = 21.0384293169607; + p5 = -48.4092606238297; + break; + case TX_REALPOLE: + p1 = 1.93821841029921E-15; + p2 = -0.0429694461214244; + p3 = 0.253501254059498; + p4 = 88.9545445989649; + p5 = -48.0847491316861; + break; + case TX_HIGHBAND: + p1 = 1.10383E-06; + p2 = -0.0002108; + p3 = 0.019049487; + p4 = 1.433174459; + p5 = -47.69507793; + break; + } + rcal = (int16_t)(pow(cutoff_MHz, 4)*p1 + pow(cutoff_MHz, 3)*p2 + pow(cutoff_MHz, 2)*p3 + cutoff_MHz * p4 + p5); + if (rcal < 0) + rcal = 0; + if (rcal > 255) + rcal = 255; + + if (type == TX_REALPOLE) + Modify_SPI_Reg_bits(LMS7param(RCAL_LPFS5_TBB), rcal); + else if (type == TX_LADDER) + Modify_SPI_Reg_bits(LMS7param(RCAL_LPFLAD_TBB), rcal); + else if (type == TX_HIGHBAND) + Modify_SPI_Reg_bits(LMS7param(RCAL_LPFH_TBB), rcal); + + FilterTuning_AdjustGains(); + + rssi_value_100k = (uint32_t)( GetRSSI()*0.707 ); + + SetNCOFrequency(Tx, 0, cutoff_MHz); + SetNCOFrequency(Rx, 0, cutoff_MHz - 1); + + for (ccal_lpflad_tbb = 31; ccal_lpflad_tbb > 0; --ccal_lpflad_tbb) + { + Modify_SPI_Reg_bits(LMS7param(CCAL_LPFLAD_TBB), ccal_lpflad_tbb); + rssi = GetRSSI(); + if (rssi > rssi_value_100k && ccal_lpflad_tbb == 31) + break; //skip this search, continue to advanced search + if (rssi > rssi_value_100k) + { + status = LIBLMS7_SUCCESS; + goto TxFilterTuneEnd; //found correct value + } + } + + + //advanced search for c and r values + status = LIBLMS7_FAILURE; + dir = ccal_lpflad_tbb == 31 ? -1 : 1; + while (rcal > 0 && rcal < 255) + { + rcal += 5 * dir; + if (rcal < 0 && rcal > 255) + break; + if (type == TX_REALPOLE) + Modify_SPI_Reg_bits(LMS7param(RCAL_LPFS5_TBB), rcal); + else if (type == TX_LADDER) + Modify_SPI_Reg_bits(LMS7param(RCAL_LPFLAD_TBB), rcal); + else if (type == TX_HIGHBAND) + Modify_SPI_Reg_bits(LMS7param(RCAL_LPFH_TBB), rcal); + SetNCOFrequency(Tx, 0, ncoFreq); + SetNCOFrequency(Rx, 0, ncoFreq - 1); + Modify_SPI_Reg_bits(LMS7param(CCAL_LPFLAD_TBB), 16); + rssi_value_100k = GetRSSI(); + SetNCOFrequency(Tx, 0, cutoff_MHz); + SetNCOFrequency(Rx, 0, cutoff_MHz - 1); + for (ccal_lpflad_tbb = 31; ccal_lpflad_tbb > 0; --ccal_lpflad_tbb) + { + Modify_SPI_Reg_bits(LMS7param(CCAL_LPFLAD_TBB), ccal_lpflad_tbb); + rssi = GetRSSI(); + if (rssi > rssi_value_100k*0.707 && ccal_lpflad_tbb == 31) + break; //skip c search, need to change r value + if (rssi > rssi_value_100k*0.707) + { + status = LIBLMS7_SUCCESS; + goto TxFilterTuneEnd; + } + } + } + + //end +TxFilterTuneEnd: + RestoreAllRegisters(); + if (status != LIBLMS7_SUCCESS) + return status; + Modify_SPI_Reg_bits(LMS7param(CCAL_LPFLAD_TBB), ccal_lpflad_tbb); + Modify_SPI_Reg_bits(LMS7param(ICT_IAMP_FRP_TBB), 1); + Modify_SPI_Reg_bits(LMS7param(ICT_IAMP_GG_FRP_TBB), 6); + + if (type == TX_REALPOLE) + Modify_SPI_Reg_bits(LMS7param(RCAL_LPFS5_TBB), rcal); + else if (type == TX_LADDER) + Modify_SPI_Reg_bits(LMS7param(RCAL_LPFLAD_TBB), rcal); + else if (type == TX_HIGHBAND) + { + Modify_SPI_Reg_bits(LMS7param(RCAL_LPFH_TBB), rcal); + Modify_SPI_Reg_bits(0x0105, 4, 0, 0x7); //set powerdowns + } + return LIBLMS7_SUCCESS; +} + +void LMS7002M::FilterTuning_AdjustGains() +{ + uint8_t cg_iamp_tbb; + uint32_t rssi = 0; + const uint32_t rssi_required = 0x8400; + uint8_t g_pga_rbb = (uint8_t)Get_SPI_Reg_bits(LMS7param(G_PGA_RBB)); + + while (g_pga_rbb < 31) + { + cg_iamp_tbb = 0; + while (cg_iamp_tbb < 63 && rssi < rssi_required) + { + Modify_SPI_Reg_bits(LMS7param(CG_IAMP_TBB), cg_iamp_tbb); + rssi = GetRSSI(); + if (rssi > rssi_required) + return; + ++cg_iamp_tbb; + } + g_pga_rbb += 6; + if (g_pga_rbb > 31) + g_pga_rbb = 31; + Modify_SPI_Reg_bits(LMS7param(G_PGA_RBB), g_pga_rbb); + } +} + +liblms7_status LMS7002M::TuneTxFilterLowBandChain(float_type bandwidth, float_type realpole_MHz) +{ + uint32_t rssi; + uint32_t rssi_value_10k; + bool prevRSSIbigger; + int16_t rcal; + float_type p1,p2,p3,p4,p5; + float_type ncoFreq = 0.05; + float_type cgenFreq; + BackupAllRegisters(); + + liblms7_status status = TuneTxFilter(TX_LADDER, bandwidth); + uint8_t ladder_c_value = (uint8_t)Get_SPI_Reg_bits(LMS7param(CCAL_LPFLAD_TBB)); + uint8_t ladder_r_value = (uint8_t)Get_SPI_Reg_bits(LMS7param(RCAL_LPFLAD_TBB)); + status = TuneTxFilterSetup(TX_LADDER, bandwidth); + + if (bandwidth < gLadder_lower_limit || bandwidth > gLadder_higher_limit) + { + status = LIBLMS7_FREQUENCY_OUT_OF_RANGE; + goto TxFilterLowBandChainEnd; + } + + //realpole calibration + //float userCLKGENfreq = GetFrequencyCGEN(); + + cgenFreq = realpole_MHz * 20; + if (cgenFreq < 60) + cgenFreq = 60; + if (cgenFreq > 640) + cgenFreq = 640; + + if (realpole_MHz < gRealpole_lower_limit || realpole_MHz > gRealpole_higher_limit) + { + status = LIBLMS7_FREQUENCY_OUT_OF_RANGE; + goto TxFilterLowBandChainEnd; + } + + status = SetFrequencyCGEN(cgenFreq); + if (status != LIBLMS7_SUCCESS) + goto TxFilterLowBandChainEnd; + + Modify_SPI_Reg_bits(LMS7param(LOOPB_TBB), 3); + Modify_SPI_Reg_bits(LMS7param(CG_IAMP_TBB), 1); + Modify_SPI_Reg_bits(LMS7param(BYPLADDER_TBB), 1); + Modify_SPI_Reg_bits(LMS7param(TSTIN_TBB), 0); + Modify_SPI_Reg_bits(LMS7param(PD_LPFH_TBB), 1); + Modify_SPI_Reg_bits(LMS7param(PD_LPFIAMP_TBB), 0); + Modify_SPI_Reg_bits(LMS7param(PD_LPFLAD_TBB), 1); + Modify_SPI_Reg_bits(LMS7param(PD_LPFS5_TBB), 0); + Modify_SPI_Reg_bits(LMS7param(EN_G_TBB), 1); + + //B + p1 = 1.93821841029921E-15; + p2 = -0.0429694461214244; + p3 = 0.253501254059498; + p4 = 88.9545445989649; + p5 = -48.0847491316861; + rcal = (int16_t)(pow(realpole_MHz, 4)*p1 + pow(realpole_MHz, 3)*p2 + pow(realpole_MHz, 2)*p3 + realpole_MHz * p4 + p5); + if (rcal < 0) + rcal = 0; + if (rcal > 255) + rcal = 255; + Modify_SPI_Reg_bits(LMS7param(RCAL_LPFS5_TBB), rcal); + + FilterTuning_AdjustGains(); + + rssi_value_10k = GetRSSI(); + SetNCOFrequency(Tx, 0, realpole_MHz); + SetNCOFrequency(Rx, 0, realpole_MHz - 1); + + prevRSSIbigger = GetRSSI() > rssi_value_10k*0.707; + status = LIBLMS7_FAILURE; //assuming r value is not found + while (rcal >= 0 && rcal < 256) + { + Modify_SPI_Reg_bits(LMS7param(RCAL_LPFS5_TBB), rcal); + SetNCOFrequency(Tx, 0, ncoFreq); + SetNCOFrequency(Rx, 0, ncoFreq - 1); + rssi_value_10k = (uint32_t)( GetRSSI()*0.707 ); + + SetNCOFrequency(Tx, 0, realpole_MHz); + SetNCOFrequency(Rx, 0, realpole_MHz - 1); + + rssi = GetRSSI(); + if (rssi > rssi_value_10k) + --rcal; + else + { + if (prevRSSIbigger) + { + --rcal; + status = LIBLMS7_SUCCESS; + goto TxFilterLowBandChainEnd; + } + ++rcal; + } + prevRSSIbigger = rssi > rssi_value_10k; + } + + //end +TxFilterLowBandChainEnd: + RestoreAllRegisters(); + if (status != LIBLMS7_SUCCESS) + return status; + + Modify_SPI_Reg_bits(LMS7param(CCAL_LPFLAD_TBB), ladder_c_value); + Modify_SPI_Reg_bits(LMS7param(RCAL_LPFLAD_TBB), ladder_r_value); + Modify_SPI_Reg_bits(LMS7param(ICT_IAMP_FRP_TBB), 1); + Modify_SPI_Reg_bits(LMS7param(ICT_IAMP_GG_FRP_TBB), 6); + Modify_SPI_Reg_bits(LMS7param(RCAL_LPFS5_TBB), rcal); + Modify_SPI_Reg_bits(0x0105, 4, 0, 0x11); //set powerdowns + + return LIBLMS7_SUCCESS; +} + +liblms7_status LMS7002M::TuneRxFilter(RxFilter filter, float_type bandwidth_MHz) +{ + liblms7_status status; + uint16_t cfb_tia_rfe; + uint16_t c_ctl_lpfl_rbb; + uint8_t ccomp_tia_rfe; + uint8_t rcomp_tia_rfe; + uint8_t c_ctl_lpfh_rbb; + uint8_t ict_pga_out; + uint8_t ict_pga_in; + uint8_t r_ctl_lpf_rbb; + uint8_t c_ctl_pga_rbb; + uint8_t rcc_ctl_lpfl_rbb; + uint8_t rcc_ctl_lpfh_rbb; + float_type lowerLimit; + float_type higherLimit; + if (filter == RX_TIA) + { + lowerLimit = Get_SPI_Reg_bits(LMS7param(G_TIA_RFE)) == 1 ? gRxTIA_lower_limit_g1 : gRxTIA_lower_limit_g23; + higherLimit = gRxTIA_higher_limit; + } + else if (filter == RX_LPF_LOWBAND) + { + lowerLimit = gRxLPF_low_lower_limit; + higherLimit = gRxLPF_low_higher_limit; + } + else if (filter == RX_LPF_HIGHBAND) + { + lowerLimit = gRxLPF_high_lower_limit; + higherLimit = gRxLPF_high_higher_limit; + } + if (bandwidth_MHz < lowerLimit || bandwidth_MHz > higherLimit) + return LIBLMS7_FREQUENCY_OUT_OF_RANGE; + + BackupAllRegisters(); + + status = TuneRxFilterSetup(filter, bandwidth_MHz); + if (status != LIBLMS7_SUCCESS) + goto RxFilterTuneEnd; + + if (filter == RX_TIA) + status = RFE_TIA_Calibration(bandwidth_MHz); + else if (filter == RX_LPF_LOWBAND) + status = RxLPFLow_Calibration(bandwidth_MHz); + else if (filter == RX_LPF_HIGHBAND) + status = RxLPFHigh_Calibration(bandwidth_MHz); + + cfb_tia_rfe = Get_SPI_Reg_bits(LMS7param(CFB_TIA_RFE)); + c_ctl_lpfl_rbb = Get_SPI_Reg_bits(LMS7param(C_CTL_LPFL_RBB)); + ccomp_tia_rfe = (int8_t)Get_SPI_Reg_bits(LMS7param(CCOMP_TIA_RFE)); + rcomp_tia_rfe = (int8_t)Get_SPI_Reg_bits(LMS7param(RCOMP_TIA_RFE)); + c_ctl_lpfh_rbb = (int8_t)Get_SPI_Reg_bits(LMS7param(C_CTL_LPFH_RBB)); + ict_pga_out = (int8_t)Get_SPI_Reg_bits(LMS7param(ICT_PGA_OUT_RBB)); + ict_pga_in = (int8_t)Get_SPI_Reg_bits(LMS7param(ICT_PGA_IN_RBB)); + r_ctl_lpf_rbb = (int8_t)Get_SPI_Reg_bits(LMS7param(R_CTL_LPF_RBB)); + c_ctl_pga_rbb = (int8_t)Get_SPI_Reg_bits(LMS7param(C_CTL_PGA_RBB)); + rcc_ctl_lpfl_rbb = (int8_t)Get_SPI_Reg_bits(LMS7param(RCC_CTL_LPFL_RBB)); + rcc_ctl_lpfh_rbb = (int8_t)Get_SPI_Reg_bits(LMS7param(RCC_CTL_LPFH_RBB)); + +RxFilterTuneEnd: + RestoreAllRegisters(); + if (status != LIBLMS7_SUCCESS) + return status; + + if (filter == RX_TIA) + { + Modify_SPI_Reg_bits(LMS7param(ICT_TIAMAIN_RFE), 2); + Modify_SPI_Reg_bits(LMS7param(ICT_TIAOUT_RFE), 2); + Modify_SPI_Reg_bits(LMS7param(RFB_TIA_RFE), 16); + Modify_SPI_Reg_bits(LMS7param(CFB_TIA_RFE), cfb_tia_rfe); + Modify_SPI_Reg_bits(LMS7param(CCOMP_TIA_RFE), ccomp_tia_rfe); + Modify_SPI_Reg_bits(LMS7param(RCOMP_TIA_RFE), rcomp_tia_rfe); + Modify_SPI_Reg_bits(0x010c, 1, 0, 0x1); + } + else if (filter == RX_LPF_LOWBAND) + { + Modify_SPI_Reg_bits(LMS7param(RCC_CTL_LPFL_RBB), rcc_ctl_lpfl_rbb); + Modify_SPI_Reg_bits(LMS7param(C_CTL_LPFL_RBB), c_ctl_lpfl_rbb); + Modify_SPI_Reg_bits(LMS7param(ICT_PGA_OUT_RBB), ict_pga_out); + Modify_SPI_Reg_bits(LMS7param(ICT_PGA_IN_RBB), ict_pga_in); + Modify_SPI_Reg_bits(LMS7param(R_CTL_LPF_RBB), r_ctl_lpf_rbb); + Modify_SPI_Reg_bits(LMS7param(C_CTL_PGA_RBB), c_ctl_pga_rbb); + Modify_SPI_Reg_bits(0x0115, 3, 0, 0x9); + Modify_SPI_Reg_bits(0x0118, 15, 13, 0x1); + } + else if (filter == RX_LPF_HIGHBAND) + { + Modify_SPI_Reg_bits(LMS7param(RCC_CTL_LPFH_RBB), rcc_ctl_lpfh_rbb); + Modify_SPI_Reg_bits(LMS7param(C_CTL_LPFH_RBB), c_ctl_lpfh_rbb); + Modify_SPI_Reg_bits(LMS7param(ICT_PGA_OUT_RBB), ict_pga_out); + Modify_SPI_Reg_bits(LMS7param(ICT_PGA_IN_RBB), ict_pga_in); + Modify_SPI_Reg_bits(LMS7param(R_CTL_LPF_RBB), r_ctl_lpf_rbb); + Modify_SPI_Reg_bits(LMS7param(C_CTL_PGA_RBB), c_ctl_pga_rbb); + Modify_SPI_Reg_bits(0x0115, 3, 0, 0x5); + Modify_SPI_Reg_bits(0x0118, 15, 13, 0x0); + } + return LIBLMS7_SUCCESS; +} + +liblms7_status LMS7002M::TuneRxFilterSetup(RxFilter type, float_type cutoff_MHz) +{ + liblms7_status status; + uint8_t ch = (uint8_t)Get_SPI_Reg_bits(LMS7param(MAC)); + + //RFE + uint8_t g_tia_rfe = (uint8_t)Get_SPI_Reg_bits(LMS7param(G_TIA_RFE)); + SetDefaults(RFE); + Modify_SPI_Reg_bits(LMS7param(SEL_PATH_RFE), 2); + + if (ch == 2) + Modify_SPI_Reg_bits(LMS7param(EN_NEXTRX_RFE), 1); + else + Modify_SPI_Reg_bits(LMS7param(EN_NEXTRX_RFE), 0); + + Modify_SPI_Reg_bits(LMS7param(G_RXLOOPB_RFE), 8); + Modify_SPI_Reg_bits(LMS7param(PD_RLOOPB_2_RFE), 0); + Modify_SPI_Reg_bits(LMS7param(EN_INSHSW_LB2_RFE), 0); + Modify_SPI_Reg_bits(LMS7param(PD_MXLOBUF_RFE), 0); + Modify_SPI_Reg_bits(LMS7param(PD_QGEN_RFE), 0); + Modify_SPI_Reg_bits(LMS7param(ICT_TIAMAIN_RFE), 2); + Modify_SPI_Reg_bits(LMS7param(ICT_TIAOUT_RFE), 2); + Modify_SPI_Reg_bits(LMS7param(RFB_TIA_RFE), 16); + Modify_SPI_Reg_bits(LMS7param(G_TIA_RFE), g_tia_rfe); + + //RBB + SetDefaults(RBB); + Modify_SPI_Reg_bits(LMS7param(ICT_PGA_OUT_RBB), 20); + Modify_SPI_Reg_bits(LMS7param(ICT_PGA_IN_RBB), 20); + Modify_SPI_Reg_bits(LMS7param(C_CTL_PGA_RBB), 3); + + //TRF + SetDefaults(TRF); + Modify_SPI_Reg_bits(LMS7param(L_LOOPB_TXPAD_TRF), 0); + Modify_SPI_Reg_bits(LMS7param(EN_LOOPB_TXPAD_TRF), 1); + if (ch == 2) + Modify_SPI_Reg_bits(LMS7param(EN_NEXTTX_TRF), 1); + else + Modify_SPI_Reg_bits(LMS7param(EN_NEXTTX_TRF), 0); + Modify_SPI_Reg_bits(LMS7param(SEL_BAND1_TRF), 0); + Modify_SPI_Reg_bits(LMS7param(SEL_BAND2_TRF), 1); + + //TBB + SetDefaults(TBB); + Modify_SPI_Reg_bits(LMS7param(CG_IAMP_TBB), 1); + Modify_SPI_Reg_bits(LMS7param(ICT_IAMP_FRP_TBB), 1); + Modify_SPI_Reg_bits(LMS7param(ICT_IAMP_GG_FRP_TBB), 6); + + //AFE + SetDefaults(AFE); + if (ch == 2) + { + Modify_SPI_Reg_bits(LMS7param(PD_TX_AFE2), 0); + Modify_SPI_Reg_bits(LMS7param(PD_RX_AFE2), 0); + } + //BIAS + uint8_t rp_calib_bias = (uint8_t)Get_SPI_Reg_bits(LMS7param(RP_CALIB_BIAS)); + SetDefaults(BIAS); + Modify_SPI_Reg_bits(LMS7param(RP_CALIB_BIAS), rp_calib_bias); + + //XBUF + Modify_SPI_Reg_bits(LMS7param(PD_XBUF_RX), 0); + Modify_SPI_Reg_bits(LMS7param(PD_XBUF_TX), 0); + Modify_SPI_Reg_bits(LMS7param(EN_G_TRF), 1); + + //CLKGEN + SetDefaults(CGEN); + + //SXR + Modify_SPI_Reg_bits(LMS7param(MAC), 1); + SetDefaults(SX); + status = SetFrequencySX(Rx, 499.95, mRefClkSXR_MHz); + if (status != LIBLMS7_SUCCESS) + return status; + Modify_SPI_Reg_bits(LMS7param(PD_VCO), 0); + + //SXT + Modify_SPI_Reg_bits(LMS7param(MAC), 2); + SetDefaults(SX); + status = SetFrequencySX(Tx, 500, mRefClkSXT_MHz); + if (status != LIBLMS7_SUCCESS) + return status; + Modify_SPI_Reg_bits(LMS7param(PD_VCO), 0); + + Modify_SPI_Reg_bits(LMS7param(MAC), ch); + //TxTSP + SetDefaults(TxTSP); + Modify_SPI_Reg_bits(LMS7param(TSGMODE_TXTSP), 1); + Modify_SPI_Reg_bits(LMS7param(INSEL_TXTSP), 1); + Modify_SPI_Reg_bits(0x0208, 8, 8, 1); + Modify_SPI_Reg_bits(0x0208, 6, 4, 0x7); + LoadDC_REG_IQ(Tx, (int16_t)0x7FFF, (int16_t)0x8000); + SetNCOFrequency(Tx, 0, 0); + + //RxTSP + SetDefaults(RxTSP); + Modify_SPI_Reg_bits(LMS7param(AGC_MODE_RXTSP), 1); + Modify_SPI_Reg_bits(0x040C, 5, 3, 0x7); + Modify_SPI_Reg_bits(LMS7param(AGC_AVG_RXTSP), 7); + Modify_SPI_Reg_bits(LMS7param(CMIX_GAIN_RXTSP), 1); + + float_type sxtfreq = GetFrequencySX_MHz(Tx, mRefClkSXT_MHz); + float_type sxrfreq = GetFrequencySX_MHz(Rx, mRefClkSXR_MHz); + SetNCOFrequency(Rx, 0, sxtfreq - sxrfreq - 1); + return LIBLMS7_SUCCESS; +} + +liblms7_status LMS7002M::RFE_TIA_Calibration(float_type TIA_freq_MHz) +{ + liblms7_status status; + bool prevRSSIbigger; + uint8_t ccomp_tia_rfe_value; + int16_t rcomp_tia_rfe; + float_type cgenFreq = TIA_freq_MHz * 20; + uint32_t rssi; + uint32_t rssi_value_50k; + //RFE + uint8_t g_tia_rfe = (uint8_t)Get_SPI_Reg_bits(LMS7param(G_TIA_RFE)); + int16_t cfb_tia_rfe_value; + if (g_tia_rfe == 1) + cfb_tia_rfe_value = (uint16_t)(5400 / TIA_freq_MHz - 15); + else if (g_tia_rfe > 1) + cfb_tia_rfe_value = (uint16_t)(1680 / TIA_freq_MHz - 10); + else + return LIBLMS7_FAILURE; + Modify_SPI_Reg_bits(LMS7param(CFB_TIA_RFE), cfb_tia_rfe_value); + + if (g_tia_rfe == 1) + ccomp_tia_rfe_value = (uint8_t)(cfb_tia_rfe_value / 100 + 1); + else if (g_tia_rfe > 1) + ccomp_tia_rfe_value = (uint8_t)(cfb_tia_rfe_value / 100); + else + return LIBLMS7_FAILURE; + if (ccomp_tia_rfe_value > 15) + ccomp_tia_rfe_value = 15; + + Modify_SPI_Reg_bits(LMS7param(CCOMP_TIA_RFE), ccomp_tia_rfe_value); + + rcomp_tia_rfe = (int16_t)(15 - cfb_tia_rfe_value * 2 / 100); + if (rcomp_tia_rfe < 0) + rcomp_tia_rfe = 0; + Modify_SPI_Reg_bits(LMS7param(RCOMP_TIA_RFE), rcomp_tia_rfe); + + //RBB + Modify_SPI_Reg_bits(LMS7param(INPUT_CTL_PGA_RBB), 2); + Modify_SPI_Reg_bits(LMS7param(PD_LPFL_RBB), 1); + + //CLKGEN + if (cgenFreq < 60) + cgenFreq = 60; + if (cgenFreq > 640) + cgenFreq = 640; + + if (cgenFreq / 16 == TIA_freq_MHz) + status = SetFrequencyCGEN(cgenFreq - 10); + else + status = SetFrequencyCGEN(cgenFreq); + if (status != LIBLMS7_SUCCESS) + return status; + + FilterTuning_AdjustGains(); + + rssi_value_50k = (uint32_t)( GetRSSI() * 0.707 ); + status = SetFrequencySX(Rx, GetFrequencySX_MHz(Tx, mRefClkSXT_MHz) - TIA_freq_MHz, mRefClkSXR_MHz); + if (status != LIBLMS7_SUCCESS) + return status; + SetNCOFrequency(Rx, 0, GetFrequencySX_MHz(Tx, mRefClkSXT_MHz) - GetFrequencySX_MHz(Rx, mRefClkSXR_MHz) - 1); + + prevRSSIbigger = GetRSSI() > rssi_value_50k; + while (cfb_tia_rfe_value >= 0 && cfb_tia_rfe_value < 4096) + { + Modify_SPI_Reg_bits(LMS7param(CFB_TIA_RFE), cfb_tia_rfe_value); + rssi = GetRSSI(); + if (rssi > rssi_value_50k) + ++cfb_tia_rfe_value; + else + { + --cfb_tia_rfe_value; + if (prevRSSIbigger) + return LIBLMS7_SUCCESS; //found correct value + } + prevRSSIbigger = rssi > rssi_value_50k; + } + return LIBLMS7_FAILURE; +} + +liblms7_status LMS7002M::RxLPFLow_Calibration(float_type RxLPFL_freq_MHz) +{ + liblms7_status status; + uint32_t rssi; + uint32_t rssi_value_50k; + int32_t c_ctl_lpfl_rbb; + bool prevRSSIbigger; + float_type cgenFreq_MHz = RxLPFL_freq_MHz * 20; + //RFE + Modify_SPI_Reg_bits(LMS7param(CFB_TIA_RFE), 15); + Modify_SPI_Reg_bits(LMS7param(CCOMP_TIA_RFE), 1); + Modify_SPI_Reg_bits(LMS7param(RCOMP_TIA_RFE), 15); + Modify_SPI_Reg_bits(LMS7param(G_TIA_RFE), 1); + + //RBB + c_ctl_lpfl_rbb = (int32_t)(2160 / RxLPFL_freq_MHz - 103); + if (c_ctl_lpfl_rbb < 0) + c_ctl_lpfl_rbb = 0; + if (c_ctl_lpfl_rbb > 2047) + c_ctl_lpfl_rbb = 2047; + Modify_SPI_Reg_bits(LMS7param(C_CTL_LPFL_RBB), c_ctl_lpfl_rbb); + + if (RxLPFL_freq_MHz >= 15) + Modify_SPI_Reg_bits(LMS7param(RCC_CTL_LPFL_RBB), 5); + else if (RxLPFL_freq_MHz >= 10) + Modify_SPI_Reg_bits(LMS7param(RCC_CTL_LPFL_RBB), 4); + else if (RxLPFL_freq_MHz >= 5) + Modify_SPI_Reg_bits(LMS7param(RCC_CTL_LPFL_RBB), 3); + else if (RxLPFL_freq_MHz >= 3) + Modify_SPI_Reg_bits(LMS7param(RCC_CTL_LPFL_RBB), 2); + else if (RxLPFL_freq_MHz >= 1.4) + Modify_SPI_Reg_bits(LMS7param(RCC_CTL_LPFL_RBB), 1); + else + Modify_SPI_Reg_bits(LMS7param(RCC_CTL_LPFL_RBB), 0); + + //CLKGEN + if (cgenFreq_MHz < 60) + cgenFreq_MHz = 60; + if (cgenFreq_MHz > 640) + cgenFreq_MHz = 640; + if (cgenFreq_MHz / 16 == RxLPFL_freq_MHz) + status = SetFrequencyCGEN(cgenFreq_MHz - 10); + else + status = SetFrequencyCGEN(cgenFreq_MHz); + if (status != LIBLMS7_SUCCESS) + return status; + + FilterTuning_AdjustGains(); + + rssi_value_50k = (uint32_t)( GetRSSI() * 0.707 ); + status = SetFrequencySX(Rx, GetFrequencySX_MHz(Tx, mRefClkSXT_MHz) - RxLPFL_freq_MHz, mRefClkSXR_MHz); + if (status != LIBLMS7_SUCCESS) + return status; + SetNCOFrequency(Rx, 0, GetFrequencySX_MHz(Tx, mRefClkSXT_MHz) - GetFrequencySX_MHz(Rx, mRefClkSXR_MHz) - 1); + + prevRSSIbigger = GetRSSI() > rssi_value_50k; + while (c_ctl_lpfl_rbb >= 0 && c_ctl_lpfl_rbb < 2048) + { + Modify_SPI_Reg_bits(LMS7param(C_CTL_LPFL_RBB), c_ctl_lpfl_rbb); + rssi = GetRSSI(); + if (rssi > rssi_value_50k) + ++c_ctl_lpfl_rbb; + else + { + --c_ctl_lpfl_rbb; + if (prevRSSIbigger) + return LIBLMS7_SUCCESS; //found correct value + } + prevRSSIbigger = rssi > rssi_value_50k; + } + return LIBLMS7_FAILURE; +} + +liblms7_status LMS7002M::RxLPFHigh_Calibration(float_type RxLPFH_freq_MHz) +{ + liblms7_status status; + int16_t c_ctl_lpfh_rbb; + int16_t rcc_ctl_lpfh_rbb; + float_type cgenFreq = RxLPFH_freq_MHz * 20; + uint32_t rssi; + uint32_t rssi_value_50k; + bool prevRSSIbigger; + //RFE + Modify_SPI_Reg_bits(LMS7param(CFB_TIA_RFE), 15); + Modify_SPI_Reg_bits(LMS7param(CCOMP_TIA_RFE), 1); + Modify_SPI_Reg_bits(LMS7param(RCOMP_TIA_RFE), 15); + Modify_SPI_Reg_bits(LMS7param(G_TIA_RFE), 1); + + //RBB + c_ctl_lpfh_rbb = (int16_t)(6000 / RxLPFH_freq_MHz - 50); + if (c_ctl_lpfh_rbb < 0) + c_ctl_lpfh_rbb = 0; + if (c_ctl_lpfh_rbb > 255) + c_ctl_lpfh_rbb = 255; + Modify_SPI_Reg_bits(LMS7param(C_CTL_LPFH_RBB), c_ctl_lpfh_rbb); + + rcc_ctl_lpfh_rbb = (int16_t)(RxLPFH_freq_MHz / 10 - 3); + if (rcc_ctl_lpfh_rbb < 0) + rcc_ctl_lpfh_rbb = 0; + Modify_SPI_Reg_bits(LMS7param(RCC_CTL_LPFH_RBB), rcc_ctl_lpfh_rbb); + + Modify_SPI_Reg_bits(LMS7param(INPUT_CTL_PGA_RBB), 1); + Modify_SPI_Reg_bits(LMS7param(PD_LPFL_RBB), 1); + Modify_SPI_Reg_bits(LMS7param(PD_LPFH_RBB), 0); + + //CLKGEN + if (cgenFreq < 60) + cgenFreq = 60; + if (cgenFreq > 640) + cgenFreq = 640; + if (cgenFreq / 16 == RxLPFH_freq_MHz) + status = SetFrequencyCGEN(cgenFreq - 10); + else + status = SetFrequencyCGEN(cgenFreq); + if (status != LIBLMS7_SUCCESS) + return status; + + FilterTuning_AdjustGains(); + + rssi_value_50k = (uint32_t)( GetRSSI() * 0.707); + status = SetFrequencySX(Rx, GetFrequencySX_MHz(Tx, mRefClkSXT_MHz) - RxLPFH_freq_MHz, mRefClkSXR_MHz); + if (status != LIBLMS7_SUCCESS) + return status; + SetNCOFrequency(Rx, 0, GetFrequencySX_MHz(Tx, mRefClkSXT_MHz) - GetFrequencySX_MHz(Rx, mRefClkSXR_MHz) - 1); + + prevRSSIbigger = GetRSSI() > rssi_value_50k; + while (c_ctl_lpfh_rbb >= 0 && c_ctl_lpfh_rbb < 256) + { + Modify_SPI_Reg_bits(LMS7param(C_CTL_LPFH_RBB), c_ctl_lpfh_rbb); + rssi = GetRSSI(); + if (rssi > rssi_value_50k) + ++c_ctl_lpfh_rbb; + else + { + --c_ctl_lpfh_rbb; + if (prevRSSIbigger) + return LIBLMS7_SUCCESS; //found correct value + } + prevRSSIbigger = rssi > rssi_value_50k; + } + return LIBLMS7_FAILURE; +} diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/LMS7002M_parameters.cpp b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/LMS7002M_parameters.cpp new file mode 100644 index 0000000000000000000000000000000000000000..b28887d776de04f458c823529a6697ebb425fc32 --- /dev/null +++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/LMS7002M_parameters.cpp @@ -0,0 +1,601 @@ +/** +@file LMS7002M_parameters.cpp +@author Lime Microsystems (www.limemicro.com) +@brief Definition of LMS7002M transceiver control parameters registers +*/ + +#include "LMS7002M_parameters.h" + +std::vector<const LMS7Parameter*> LMS7parameterList; + +const struct LMS7Parameter LRST_TX_B = { 0x0020, 15, 15, 1, "LRST_TX_B", "Resets all the logic registers to the default state for Tx MIMO channel B" }; +const struct LMS7Parameter MRST_TX_B = { 0x0020, 14, 14, 1, "MRST_TX_B", "Resets all the configuration memory to the default state for Tx MIMO channel B" }; +const struct LMS7Parameter LRST_TX_A = { 0x0020, 13, 13, 1, "LRST_TX_A", "Resets all the logic registers to the default state for Tx MIMO channel A" }; +const struct LMS7Parameter MRST_TX_A = { 0x0020, 12, 12, 1, "MRST_TX_A", "Resets all the configuration memory to the default state for Tx MIMO channel A" }; +const struct LMS7Parameter LRST_RX_B = { 0x0020, 11, 11, 1, "LRST_RX_B", "Resets all the logic registers to the default state for Rx MIMO channel B" }; +const struct LMS7Parameter MRST_RX_B = { 0x0020, 10, 10, 1, "MRST_RX_B", "Resets all the configuration memory to the default state for Rx MIMO channel B" }; +const struct LMS7Parameter LRST_RX_A = { 0x0020, 9, 9, 1, "LRST_RX_A", "Resets all the logic registers to the default state for Rx MIMO channel A" }; +const struct LMS7Parameter MRST_RX_A = { 0x0020, 8, 8, 1, "MRST_RX_A", "Resets all the configuration memory to the default state for Rx MIMO channel A" }; +const struct LMS7Parameter SRST_RXFIFO = { 0x0020, 7, 7, 1, "SRST_RXFIFO", "RX FIFO soft reset (LimeLight Interface)" }; +const struct LMS7Parameter SRST_TXFIFO = { 0x0020, 6, 6, 1, "SRST_TXFIFO", "TX FIFO soft reset (LimeLight Interface)" }; +const struct LMS7Parameter RXEN_B = { 0x0020, 5, 5, 1, "RXEN_B", "Power control for Rx MIMO channel B" }; +const struct LMS7Parameter RXEN_A = { 0x0020, 4, 4, 1, "RXEN_A", "Power control for Rx MIMO channel A" }; +const struct LMS7Parameter TXEN_B = { 0x0020, 3, 3, 1, "TXEN_B", "Power control for Tx MIMO channel B" }; +const struct LMS7Parameter TXEN_A = { 0x0020, 2, 2, 1, "TXEN_A", "Power control for Tx MIMO channel A" }; +const struct LMS7Parameter MAC = { 0x0020, 1, 0, 3, "MAC", "Selects MIMO channel for communication" }; +const struct LMS7Parameter TX_CLK_PE = { 0x0021, 11, 11, 1, "TX_CLK_PE", "Pull up control of TX_CLK pad" }; +const struct LMS7Parameter RX_CLK_PE = { 0x0021, 10, 10, 1, "RX_CLK_PE", "Pull up control of RX_CLK pad" }; +const struct LMS7Parameter SDA_PE = { 0x0021, 9, 9, 1, "SDA_PE", "Pull up control of SDA pad" }; +const struct LMS7Parameter SDA_DS = { 0x0021, 8, 8, 0, "SDA_DS", "Driver strength of SDA pad" }; +const struct LMS7Parameter SCL_PE = { 0x0021, 7, 7, 1, "SCL_PE", "Pull up control of SCL pad" }; +const struct LMS7Parameter SCL_DS = { 0x0021, 6, 6, 0, "SCL_DS", "Driver strength of SCL pad" }; +const struct LMS7Parameter SDIO_DS = { 0x0021, 5, 5, 0, "SDIO_DS", "Driver strength of SDIO pad" }; +const struct LMS7Parameter SDIO_PE = { 0x0021, 4, 4, 1, "SDIO_PE", "Pull up control of SDIO pad" }; +const struct LMS7Parameter SDO_PE = { 0x0021, 3, 3, 1, "SDO_PE", "Pull up control of SDO pad" }; +const struct LMS7Parameter SCLK_PE = { 0x0021, 2, 2, 1, "SCLK_PE", "Pull up control of SCLK pad" }; +const struct LMS7Parameter SEN_PE = { 0x0021, 1, 1, 1, "SEN_PE", "Pull up control of SEN pad" }; +const struct LMS7Parameter SPIMODE = { 0x0021, 0, 0, 1, "SPIMODE", "SPI communication mode" }; +const struct LMS7Parameter DIQ2_DS = { 0x0022, 11, 11, 0, "DIQ2_DS", "Driver strength of DIQ2 pad" }; +const struct LMS7Parameter DIQ2_PE = { 0x0022, 10, 10, 1, "DIQ2_PE", "Pull up control of DIQ2 pad" }; +const struct LMS7Parameter IQ_SEL_EN_2_PE = { 0x0022, 9, 9, 1, "IQ_SEL_EN_2_PE", "Pull up control of IQ_SEL_EN_2 pad" }; +const struct LMS7Parameter TXNRX2_PE = { 0x0022, 8, 8, 1, "TXNRX2_PE", "Pull up control of TXNRX2 pad" }; +const struct LMS7Parameter FCLK2_PE = { 0x0022, 7, 7, 1, "FCLK2_PE", "Pull up control of FCLK2 pad" }; +const struct LMS7Parameter MCLK2_PE = { 0x0022, 6, 6, 1, "MCLK2_PE", "Pull up control of MCLK2 pad" }; +const struct LMS7Parameter DIQ1_DS = { 0x0022, 5, 5, 0, "DIQ1_DS", "Pull up control of MCLK2 pad" }; +const struct LMS7Parameter DIQ1_PE = { 0x0022, 4, 4, 1, "DIQ1_PE", "Pull up control of DIQ1 pad" }; +const struct LMS7Parameter IQ_SEL_EN_1_PE = { 0x0022, 3, 3, 1, "IQ_SEL_EN_1_PE", "Pull up control of IQ_SEL_EN_1 pad" }; +const struct LMS7Parameter TXNRX1_PE = { 0x0022, 2, 2, 1, "TXNRX1_PE", "Pull up control of TXNRX1 pad" }; +const struct LMS7Parameter FCLK1_PE = { 0x0022, 1, 1, 1, "FCLK1_PE", "Pull up control of FCLK1 pad" }; +const struct LMS7Parameter MCLK1_PE = { 0x0022, 0, 0, 1, "MCLK1_PE", "Pull up control of MCLK1 pad" }; +const struct LMS7Parameter DIQDIRCTR2 = { 0x0023, 15, 15, 0, "DIQDIRCTR2", "DIQ2 direction control mode" }; +const struct LMS7Parameter DIQDIR2 = { 0x0023, 14, 14, 1, "DIQDIR2", "DIQ2 direction" }; +const struct LMS7Parameter DIQDIRCTR1 = { 0x0023, 13, 13, 0, "DIQDIRCTR1", "DIQ1 direction control mode" }; +const struct LMS7Parameter DIQDIR1 = { 0x0023, 12, 12, 1, "DIQDIR1", "DIQ1 direction" }; +const struct LMS7Parameter ENABLEDIRCTR2 = { 0x0023, 11, 11, 0, "ENABLEDIRCTR2", "ENABLE2 direction control mode" }; +const struct LMS7Parameter ENABLEDIR2 = { 0x0023, 10, 10, 1, "ENABLEDIR2", "ENABLE2 direction" }; +const struct LMS7Parameter ENABLEDIRCTR1 = { 0x0023, 9, 9, 0, "ENABLEDIRCTR1", "ENABLE1 direction control mode" }; +const struct LMS7Parameter ENABLEDIR1 = { 0x0023, 8, 8, 1, "ENABLEDIR1", "ENABLE1 direction." }; +const struct LMS7Parameter MOD_EN = { 0x0023, 6, 6, 1, "MOD_EN", "LimeLight interface enable" }; +const struct LMS7Parameter LML2_FIDM = { 0x0023, 5, 5, 0, "LML2_FIDM", "Frame start ID selection for Port 2 when LML_MODE2 = 0" }; +const struct LMS7Parameter LML2_TXNRXIQ = { 0x0023, 4, 4, 1, "LML2_TXNRXIQ", "TXIQ/RXIQ mode selection for Port 2 when LML_MODE2 = 0" }; +const struct LMS7Parameter LML2_MODE = { 0x0023, 3, 3, 1, "LML2_MODE", "Mode of LimeLight Port 2" }; +const struct LMS7Parameter LML1_FIDM = { 0x0023, 2, 2, 0, "LML1_FIDM", "Frame start ID selection for Port 1 when LML_MODE1 = 0" }; +const struct LMS7Parameter LML1_TXNRXIQ = { 0x0023, 1, 1, 0, "LML1_TXNRXIQ", "TXIQ/RXIQ mode selection for Port 1 when LML_MODE1 = 0" }; +const struct LMS7Parameter LML1_MODE = { 0x0023, 0, 0, 1, "LML1_MODE", "Mode of LimeLight Port 1" }; +const struct LMS7Parameter LML1_S3S = { 0x0024, 15, 14, 3, "LML1_S3S", "Sample source in position 3, when Port 1 is RF2BB" }; +const struct LMS7Parameter LML1_S2S = { 0x0024, 13, 12, 2, "LML1_S2S", "Sample source in position 2, when Port 1 is RF2BB" }; +const struct LMS7Parameter LML1_S1S = { 0x0024, 11, 10, 1, "LML1_S1S", "Sample source in position 1, when Port 1 is RF2BB" }; +const struct LMS7Parameter LML1_S0S = { 0x0024, 9, 8, 0, "LML1_S0S", "Sample source in position 0, when Port 1 is RF2BB" }; +const struct LMS7Parameter LML1_BQP = { 0x0024, 7, 6, 3, "LML1_BQP", "BQ sample position in frame, when Port 1 is BB2RF" }; +const struct LMS7Parameter LML1_BIP = { 0x0024, 5, 4, 2, "LML1_BIP", "BI sample position in frame, when Port 1 is BB2RF" }; +const struct LMS7Parameter LML1_AQP = { 0x0024, 3, 2, 1, "LML1_AQP", "AQ sample position in frame, when Port 1 is BB2RF" }; +const struct LMS7Parameter LML1_AIP = { 0x0024, 1, 0, 0, "LML1_AIP", "AI sample position in frame, when Port 1 is BB2RF" }; +const struct LMS7Parameter LML1_BB2RF_PST = { 0x0025, 15, 8, 1, "LML1_BB2RF_PST", "Number of clock cycles to wait before data drive stop after burst stop is detected in JESD207 mode on Port 1 and Port 1 BB2RF" }; +const struct LMS7Parameter LML1_BB2RF_PRE = { 0x0025, 7, 0, 1, "LML1_BB2RF_PRE", "Number of clock cycles to wait before data drive start after burst start is detected in JESD207 mode on Port 1 and Port 1 BB2RF" }; +const struct LMS7Parameter LML1_RF2BB_PST = { 0x0026, 15, 8, 1, "LML1_RF2BB_PST", "Number of clock cycles to wait before data capture stop after burst stop is detected in JESD207 mode on Port 1 and Port 1 is RF2BB" }; +const struct LMS7Parameter LML1_RF2BB_PRE = { 0x0026, 7, 0, 1, "LML1_RF2BB_PRE", "Number of clock cycles to wait before data capture start after burst start is detected in JESD207 mode on Port 1 and Port 1 RF2BB" }; +const struct LMS7Parameter LML2_S3S = { 0x0027, 15, 14, 3, "LML2_S3S", "Sample source in position 3, when Port 2 is RF2BB" }; +const struct LMS7Parameter LML2_S2S = { 0x0027, 13, 12, 2, "LML2_S2S", "Sample source in position 2, when Port 2 is RF2BB" }; +const struct LMS7Parameter LML2_S1S = { 0x0027, 11, 10, 1, "LML2_S1S", "Sample source in position 1, when Port 2 is RF2BB" }; +const struct LMS7Parameter LML2_S0S = { 0x0027, 9, 8, 0, "LML2_S0S", "Sample source in position 0, when Port 2 is RF2BB" }; +const struct LMS7Parameter LML2_BQP = { 0x0027, 7, 6, 3, "LML2_BQP", "BQ sample position in frame, when Port 2 is BB2RF" }; +const struct LMS7Parameter LML2_BIP = { 0x0027, 5, 4, 2, "LML2_BIP", "BI sample position in frame, when Port 2 is BB2RF" }; +const struct LMS7Parameter LML2_AQP = { 0x0027, 3, 2, 1, "LML2_AQP", "AQ sample position in frame, when Port 2 is BB2RF" }; +const struct LMS7Parameter LML2_AIP = { 0x0027, 1, 0, 0, "LML2_AIP", "AI sample position in frame, when Port 2 is BB2RF" }; +const struct LMS7Parameter LML2_BB2RF_PST = { 0x0028, 15, 8, 1, "LML2_BB2RF_PST", "Number of clock cycles to wait before data drive stop after burst stop is detected in JESD207 mode on Port 2 and Port 2 BB2RF" }; +const struct LMS7Parameter LML2_BB2RF_PRE = { 0x0028, 7, 0, 1, "LML2_BB2RF_PRE", "Number of clock cycles to wait before data drive start after burst start is detected in JESD207 mode on Port 2 and Port 2 BB2RF" }; +const struct LMS7Parameter LML2_RF2BB_PST = { 0x0029, 15, 8, 1, "LML2_RF2BB_PST", "Number of clock cycles to wait before data capture stop after burst stop is detected in JESD207 mode on Port 2 and Port 2 RF2BB" }; +const struct LMS7Parameter LML2_RF2BB_PRE = { 0x0029, 7, 0, 1, "LML2_RF2BB_PRE", "Number of clock cycles to wait before data capture start after burst start is detected in JESD207 mode on Port 2 and Port 2 RF2BB" }; +const struct LMS7Parameter FCLK2_DLY = { 0x002A, 15, 14, 0, "FCLK2_DLY", "" }; +const struct LMS7Parameter FCLK1_DLY = { 0x002A, 13, 12, 0, "FCLK1_DLY", "" }; +const struct LMS7Parameter RX_MUX = { 0x002A, 11, 10, 0, "RX_MUX", "RxFIFO data source selection" }; +const struct LMS7Parameter TX_MUX = { 0x002A, 9, 8, 0, "TX_MUX", "Port selection for data transmit to TSP" }; +const struct LMS7Parameter TXRDCLK_MUX = { 0x002A, 7, 6, 2, "TXRDCLK_MUX", "TX FIFO read clock selection" }; +const struct LMS7Parameter TXWRCLK_MUX = { 0x002A, 5, 4, 0, "TXWRCLK_MUX", "TX FIFO write clock selection" }; +const struct LMS7Parameter RXRDCLK_MUX = { 0x002A, 3, 2, 1, "RXRDCLK_MUX", "RX FIFO read clock selection" }; +const struct LMS7Parameter RXWRCLK_MUX = { 0x002A, 1, 0, 2, "RXWRCLK_MUX", "RX FIFO write clock selection" }; +const struct LMS7Parameter FCLK2_INV = { 0x002B, 15, 15, 0, "FCLK2_INV", "FCLK2 clock inversion" }; +const struct LMS7Parameter FCLK1_INV = { 0x002B, 14, 14, 0, "FCLK1_INV", "FCLK1 clock inversion" }; +const struct LMS7Parameter MCLK2DLY = { 0x002B, 13, 12, 0, "MCLK2DLY", "MCLK2 clock internal delay" }; +const struct LMS7Parameter MCLK1DLY = { 0x002B, 11, 10, 0, "MCLK1DLY", "MCLK1 clock internal delay" }; +const struct LMS7Parameter MCLK2SRC = { 0x002B, 5, 4, 1, "MCLK2SRC", "MCLK2 clock source" }; +const struct LMS7Parameter MCLK1SRC = { 0x002B, 3, 2, 0, "MCLK1SRC", "MCLK1 clock source" }; +const struct LMS7Parameter TXDIVEN = { 0x002B, 1, 1, 0, "TXDIVEN", "TX clock divider enable" }; +const struct LMS7Parameter RXDIVEN = { 0x002B, 0, 0, 0, "RXDIVEN", "RX clock divider enable" }; +const struct LMS7Parameter TXTSPCLKA_DIV = { 0x002C, 15, 8, 255, "TXTSPCLKA_DIV", "TxTSP clock divider, used to produce MCLK(1/2). Clock division ratio is 2(TXTSPCLKA_DIV + 1)"}; +const struct LMS7Parameter RXTSPCLKA_DIV = { 0x002C, 7, 0, 255, "RXTSPCLKA_DIV", "RxTSP clock divider, used to produce MCLK(1/2). Clock division ratio is 2(RXTSPCLKA_DIV + 1)"}; +const struct LMS7Parameter MIMO_SISO = { 0x002E, 15, 15, 0, "MIMO_SISO", "MIMO channel B enable control" }; +const struct LMS7Parameter VER = { 0x002F, 15, 11, 7, "VER", "" }; +const struct LMS7Parameter REV = { 0x002F, 10, 6, 1, "REV", "" }; +const struct LMS7Parameter MASK = { 0x002F, 5, 0, 0, "MASK", "" }; +const struct LMS7Parameter EN_DIR_LDO = { 0x0081, 3, 3, 0, "EN_DIR_LDO", "" }; +const struct LMS7Parameter EN_DIR_CGEN = { 0x0081, 2, 2, 0, "EN_DIR_CGEN", "" }; +const struct LMS7Parameter EN_DIR_XBUF = { 0x0081, 1, 1, 0, "EN_DIR_XBUF", "" }; +const struct LMS7Parameter EN_DIR_AFE = { 0x0081, 0, 0, 0, "EN_DIR_AFE", "" }; +const struct LMS7Parameter ISEL_DAC_AFE = { 0x0082, 15, 13, 4, "ISEL_DAC_AFE", "Controls the peak current of the DAC output current" }; +const struct LMS7Parameter MODE_INTERLEAVE_AFE = { 0x0082, 12, 12, 0, "MODE_INTERLEAVE_AFE", "time interleaves the two ADCs into one ADC" }; +const struct LMS7Parameter MUX_AFE_1 = { 0x0082, 11, 10, 0, "MUX_AFE_1", "Controls the MUX at the input of the ADC channel 1" }; +const struct LMS7Parameter MUX_AFE_2 = { 0x0082, 9, 8, 0, "MUX_AFE_2", "Controls the MUX at the input of the ADC channel 2" }; +const struct LMS7Parameter PD_AFE = { 0x0082, 5, 5, 0, "PD_AFE", "Power down control for the AFE current mirror in BIAS_TOP" }; +const struct LMS7Parameter PD_RX_AFE1 = { 0x0082, 4, 4, 0, "PD_RX_AFE1", "Power down control for the ADC of channel 1" }; +const struct LMS7Parameter PD_RX_AFE2 = { 0x0082, 3, 3, 1, "PD_RX_AFE2", "Power down control for the ADC of channel 2" }; +const struct LMS7Parameter PD_TX_AFE1 = { 0x0082, 2, 2, 0, "PD_TX_AFE1", "Power down control for the DAC of channel 1" }; +const struct LMS7Parameter PD_TX_AFE2 = { 0x0082, 1, 1, 1, "PD_TX_AFE2", "Power down control for the DAC of channel 2" }; +const struct LMS7Parameter EN_G_AFE = { 0x0082, 0, 0, 1, "EN_G_AFE", "Enable control for all the AFE power downs" }; +const struct LMS7Parameter MUX_BIAS_OUT = { 0x0084, 12, 11, 0, "MUX_BIAS_OUT", "Test mode of the BIAS_TOP" }; +const struct LMS7Parameter RP_CALIB_BIAS = { 0x0084, 10, 6, 16, "RP_CALIB_BIAS", "Calibration code for rppolywo. This code is set by the calibration algorithm: BIAS_RPPOLY_calibration" }; +const struct LMS7Parameter PD_FRP_BIAS = { 0x0084, 4, 4, 0, "PD_FRP_BIAS", "Power down signal for Fix/RP block" }; +const struct LMS7Parameter PD_F_BIAS = { 0x0084, 3, 3, 0, "PD_F_BIAS", "Power down signal for Fix" }; +const struct LMS7Parameter PD_PTRP_BIAS = { 0x0084, 2, 2, 0, "PD_PTRP_BIAS", "Power down signal for PTAT/RP block" }; +const struct LMS7Parameter PD_PT_BIAS = { 0x0084, 1, 1, 0, "PD_PT_BIAS", "Power down signal for PTAT block" }; +const struct LMS7Parameter PD_BIAS_MASTER = { 0x0084, 0, 0, 0, "PD_BIAS_MASTER", "Enable signal for central bias block" }; +const struct LMS7Parameter SLFB_XBUF_RX = { 0x0085, 8, 8, 0, "SLFB_XBUF_RX", "Self biasing digital contol SLFB_XBUF_RX" }; +const struct LMS7Parameter SLFB_XBUF_TX = { 0x0085, 7, 7, 0, "SLFB_XBUF_TX", "Self biasing digital contol SLFB_XBUF_TX" }; +const struct LMS7Parameter BYP_XBUF_RX = { 0x0085, 6, 6, 0, "BYP_XBUF_RX", "Shorts the Input 3.3V buffer in XBUF" }; +const struct LMS7Parameter BYP_XBUF_TX = { 0x0085, 5, 5, 0, "BYP_XBUF_TX", "Shorts the Input 3.3V buffer in XBUF" }; +const struct LMS7Parameter EN_OUT2_XBUF_TX = { 0x0085, 4, 4, 0, "EN_OUT2_XBUF_TX", "Enables the 2nd output of TX XBUF. This 2nd buffer goes to XBUF_RX. This should be active when only 1 XBUF is to be used" }; +const struct LMS7Parameter EN_TBUFIN_XBUF_RX = { 0x0085, 3, 3, 0, "EN_TBUFIN_XBUF_RX", "Disables the input from the external XOSC and buffers the 2nd input signal (from TX XBUF 2nd output) to the RX. This should be active when only 1 XBUF is to be used" }; +const struct LMS7Parameter PD_XBUF_RX = { 0x0085, 2, 2, 0, "PD_XBUF_RX", "Power down signal PD_XBUF_RX" }; +const struct LMS7Parameter PD_XBUF_TX = { 0x0085, 1, 1, 0, "PD_XBUF_TX", "Power down signal PD_XBUF_TX" }; +const struct LMS7Parameter EN_G_XBUF = { 0x0085, 0, 0, 1, "EN_G_XBUF", "Enable control for all the XBUF power downs" }; +const struct LMS7Parameter SPDUP_VCO_CGEN = { 0x0086, 15, 15, 0, "SPDUP_VCO_CGEN", "Bypasses the noise filter resistor for fast setlling time. It should be connected to a 1us pulse" }; +const struct LMS7Parameter RESET_N_CGEN = { 0x0086, 14, 14, 1, "RESET_N_CGEN", "A pulse should be used in the start-up to reset ( 1-normal operation)" }; +const struct LMS7Parameter EN_ADCCLKH_CLKGN = { 0x0086, 11, 11, 1, "EN_ADCCLKH_CLKGN", "Selects if F_CLKH or F_CLKL is connected to FCLK_ADC" }; +const struct LMS7Parameter EN_COARSE_CKLGEN = { 0x0086, 10, 10, 0, "EN_COARSE_CKLGEN", "Enable signal for coarse tuning block" }; +const struct LMS7Parameter EN_INTONLY_SDM_CGEN = { 0x0086, 9, 9, 0, "EN_INTONLY_SDM_CGEN", "Enables INTEGER-N mode of the SX " }; +const struct LMS7Parameter EN_SDM_CLK_CGEN = { 0x0086, 8, 8, 1, "EN_SDM_CLK_CGEN", "Enables/Disables SDM clock. In INT-N mode or for noise testing, SDM clock can be disabled" }; +const struct LMS7Parameter PD_CP_CGEN = { 0x0086, 6, 6, 0, "PD_CP_CGEN", "Power down for Charge Pump" }; +const struct LMS7Parameter PD_FDIV_FB_CGEN = { 0x0086, 5, 5, 0, "PD_FDIV_FB_CGEN", "Power down for feedback frequency divider" }; +const struct LMS7Parameter PD_FDIV_O_CGEN = { 0x0086, 4, 4, 0, "PD_FDIV_O_CGEN", "Power down for forward frequency divider of the CGEN block" }; +const struct LMS7Parameter PD_SDM_CGEN = { 0x0086, 3, 3, 0, "PD_SDM_CGEN", "Power down for SDM" }; +const struct LMS7Parameter PD_VCO_CGEN = { 0x0086, 2, 2, 0, "PD_VCO_CGEN", "Power down for VCO" }; +const struct LMS7Parameter PD_VCO_COMP_CGEN = { 0x0086, 1, 1, 0, "PD_VCO_COMP_CGEN", "Power down for VCO comparator" }; +const struct LMS7Parameter EN_G_CGEN = { 0x0086, 0, 0, 1, "EN_G_CGEN", "Enable control for all the CGEN power downs" }; +const struct LMS7Parameter FRAC_SDM_CGEN_LSB = { 0x0087, 15, 0, 0x0400, "FRAC_SDM_CGEN_LSB", "" }; +const struct LMS7Parameter INT_SDM_CGEN = { 0x0088, 13, 4, 120, "INT_SDM_CGEN", "" }; +const struct LMS7Parameter FRAC_SDM_CGEN_MSB = { 0x0088, 3, 0, 0, "FRAC_SDM_CGEN_MSB", "" }; +const struct LMS7Parameter REV_SDMCLK_CGEN = { 0x0089, 15, 15, 0, "REV_SDMCLK_CGEN", "Reverses the SDM clock" }; +const struct LMS7Parameter SEL_SDMCLK_CGEN = { 0x0089, 14, 14, 0, "SEL_SDMCLK_CGEN", "Selects between the feedback divider output and Fref for SDM" }; +const struct LMS7Parameter SX_DITHER_EN_CGEN = { 0x0089, 13, 13, 0, "SX_DITHER_EN_CGEN", "Enabled dithering in SDM" }; +const struct LMS7Parameter CLKH_OV_CLKL_CGEN = { 0x0089, 12, 11, 0, "CLKH_OV_CLKL_CGEN", "FCLKL here is ADC clock. FCLKH is the clock to the DAC and if no division is added to the ADC as well" }; +const struct LMS7Parameter DIV_OUTCH_CGEN = { 0x0089, 10, 3, 4, "DIV_OUTCH_CGEN", "" }; +const struct LMS7Parameter TST_CGEN = { 0x0089, 2, 0, 0, "TST_CGEN", +"Controls the test mode of the SX\n\ +0 - TST disabled; RSSI analog outputs enabled if RSSI blocks active and when all PLL test signals are off\n\ +1 - tstdo[0] = ADC clock; tstdo[1] = DAC clock; tstao = High impedance;\n\ +2 - tstdo[0] = SDM clock; tstdo[1] = feedback divider output; tstao = VCO tune through a 60kOhm resistor;\n\ +3 - tstdo[0] = Reference clock; tstdo[1] = feedback divider output; tstao = VCO tune through a 10kOhm resistor;\n\ +4 - tstdo[0] = High impedance; tstdo[1] = High impedance; tstao = High impedance;\n\ +5 - tstdo[0] = Charge pump Down signal; tstdo[1] = Charge pump Up signal; tstao = High impedance;\n\ +6 - tstdo[0] = High impedance; tstdo[1] = High impedance; tstao = VCO tune through a 60kOhm resistor;\n\ +7 - tstdo[0] = High impedance; tstdo[1] = High impedance; tstao = VCO tune through a 10kOhm resistor;\n\ +if TST_SX[2] = 1 --> VCO_TSTBUF active generating VCO_TST_DIV20 and VCO_TST_DIV40"}; +const struct LMS7Parameter REV_CLKDAC_CGEN = { 0x008A, 14, 14, 0, "REV_CLKDAC_CGEN", "Inverts the clock F_CLKL" }; +const struct LMS7Parameter CMPLO_CTRL_CGEN = { 0x008A, 27, 14, 0, "CMPLO_CTRL_CGEN", "" }; +const struct LMS7Parameter REV_CLKADC_CGEN = { 0x008A, 13, 13, 0, "REV_CLKADC_CGEN", "Inverts the clock F_CLKL" }; +const struct LMS7Parameter REVPH_PFD_CGEN = { 0x008A, 12, 12, 0, "REVPH_PFD_CGEN", "Reverse the pulses of PFD. It can be used to reverse the polarity of the PLL loop (positive feedback to negative feedback)" }; +const struct LMS7Parameter IOFFSET_CP_CGEN = { 0x008A, 11, 6, 20, "IOFFSET_CP_CGEN", "Scales the offset current of the charge pump, 0-->63. This current is used in Fran-N mode to create an offset in the CP response and avoide the non-linear section" }; +const struct LMS7Parameter IPULSE_CP_CGEN = { 0x008A, 5, 0, 20, "IPULSE_CP_CGEN", "Scales the pulse current of the charge pump" }; +const struct LMS7Parameter ICT_VCO_CGEN = { 0x008B, 13, 9, 16, "ICT_VCO_CGEN", "Scales the VCO bias current from 0 to 2.5xInom" }; +const struct LMS7Parameter CSW_VCO_CGEN = { 0x008B, 8, 1, 128, "CSW_VCO_CGEN", "" }; +const struct LMS7Parameter COARSE_START_CGEN = { 0x008B, 0, 0, 0, "COARSE_START_CGEN", "Control signal for coarse tuning algorithm (SX_SWC_calibration)" }; +const struct LMS7Parameter COARSE_STEPDONE_CGEN = { 0x008C, 15, 15, 0, "COARSE_STEPDONE_CGEN", "" }; +const struct LMS7Parameter COARSEPLL_COMPO_CGEN = { 0x008C, 14, 14, 0, "COARSEPLL_COMPO_CGEN", "" }; +const struct LMS7Parameter VCO_CMPHO_CGEN = { 0x008C, 13, 13, 0, "VCO_CMPHO_CGEN", "" }; +const struct LMS7Parameter VCO_CMPLO_CGEN = { 0x008C, 12, 12, 0, "VCO_CMPLO_CGEN", "" }; +const struct LMS7Parameter CP2_CGEN = { 0x008C, 11, 8, 6, "CP2_CGEN", "Controls the value of CP2 (cap from CP output to GND) in the PLL filter" }; +const struct LMS7Parameter CP3_CGEN = { 0x008C, 7, 4, 7, "CP3_CGEN", "Controls the value of CP3 (cap from VCO Vtune input to GND) in the PLL filter" }; +const struct LMS7Parameter CZ_CGEN = { 0x008C, 3, 0, 11, "CZ_CGEN", "Controls the value of CZ (Zero capacitor) in the PLL filter" }; +const struct LMS7Parameter EN_LDO_DIG = { 0x0092, 15, 15, 0, "EN_LDO_DIG", "Enables the LDO" }; +const struct LMS7Parameter EN_LDO_DIGGN = { 0x0092, 14, 14, 0, "EN_LDO_DIGGN", "Enables the LDO" }; +const struct LMS7Parameter EN_LDO_DIGSXR = { 0x0092, 13, 13, 0, "EN_LDO_DIGSXR", "Enables the LDO" }; +const struct LMS7Parameter EN_LDO_DIGSXT = { 0x0092, 12, 12, 0, "EN_LDO_DIGSXT", "Enables the LDO" }; +const struct LMS7Parameter EN_LDO_DIVGN = { 0x0092, 11, 11, 0, "EN_LDO_DIVGN", "Enables the LDO" }; +const struct LMS7Parameter EN_LDO_DIVSXR = { 0x0092, 10, 10, 0, "EN_LDO_DIVSXR", "Enables the LDO" }; +const struct LMS7Parameter EN_LDO_DIVSXT = { 0x0092, 9, 9, 0, "EN_LDO_DIVSXT", "Enables the LDO" }; +const struct LMS7Parameter EN_LDO_LNA12 = { 0x0092, 8, 8, 0, "EN_LDO_LNA12", "Enables the LDO" }; +const struct LMS7Parameter EN_LDO_LNA14 = { 0x0092, 7, 7, 0, "EN_LDO_LNA14", "Enables the LDO" }; +const struct LMS7Parameter EN_LDO_MXRFE = { 0x0092, 6, 6, 0, "EN_LDO_MXRFE", "Enables the LDO" }; +const struct LMS7Parameter EN_LDO_RBB = { 0x0092, 5, 5, 0, "EN_LDO_RBB", "Enables the LDO" }; +const struct LMS7Parameter EN_LDO_RXBUF = { 0x0092, 4, 4, 0, "EN_LDO_RXBUF", "Enables the LDO" }; +const struct LMS7Parameter EN_LDO_TBB = { 0x0092, 3, 3, 0, "EN_LDO_TBB", "Enables the LDO" }; +const struct LMS7Parameter EN_LDO_TIA12 = { 0x0092, 2, 2, 0, "EN_LDO_TIA12", "Enables the LDO" }; +const struct LMS7Parameter EN_LDO_TIA14 = { 0x0092, 1, 1, 0, "EN_LDO_TIA14", "Enables the LDO" }; +const struct LMS7Parameter EN_G_LDO = { 0x0092, 0, 0, 1, "EN_G_LDO", "Enable control for all the LDO power downs" }; +const struct LMS7Parameter EN_LOADIMP_LDO_TLOB = { 0x0093, 15, 15, 0, "EN_LOADIMP_LDO_TLOB", "Enables the load dependent bias to optimize the load regulation" }; +const struct LMS7Parameter EN_LOADIMP_LDO_TPAD = { 0x0093, 14, 14, 0, "EN_LOADIMP_LDO_TPAD", "Enables the load dependent bias to optimize the load regulation" }; +const struct LMS7Parameter EN_LOADIMP_LDO_TXBUF = { 0x0093, 13, 13, 0, "EN_LOADIMP_LDO_TXBUF", "Enables the load dependent bias to optimize the load regulation" }; +const struct LMS7Parameter EN_LOADIMP_LDO_VCOGN = { 0x0093, 12, 12, 0, "EN_LOADIMP_LDO_VCOGN", "Enables the load dependent bias to optimize the load regulation" }; +const struct LMS7Parameter EN_LOADIMP_LDO_VCOSXR = { 0x0093, 11, 11, 0, "EN_LOADIMP_LDO_VCOSXR", "Enables the load dependent bias to optimize the load regulation" }; +const struct LMS7Parameter EN_LOADIMP_LDO_VCOSXT = { 0x0093, 10, 10, 0, "EN_LOADIMP_LDO_VCOSXT", "Enables the load dependent bias to optimize the load regulation" }; +const struct LMS7Parameter EN_LDO_AFE = { 0x0093, 9, 9, 0, "EN_LDO_AFE", "Enables the LDO" }; +const struct LMS7Parameter EN_LDO_CPGN = { 0x0093, 8, 8, 0, "EN_LDO_CPGN", "Enables the LDO" }; +const struct LMS7Parameter EN_LDO_CPSXR = { 0x0093, 7, 7, 0, "EN_LDO_CPSXR", "Enables the LDO" }; +const struct LMS7Parameter EN_LDO_TLOB = { 0x0093, 6, 6, 0, "EN_LDO_TLOB", "Enables the LDO" }; +const struct LMS7Parameter EN_LDO_TPAD = { 0x0093, 5, 5, 0, "EN_LDO_TPAD", "Enables the LDO" }; +const struct LMS7Parameter EN_LDO_TXBUF = { 0x0093, 4, 4, 0, "EN_LDO_TXBUF", "Enables the LDO" }; +const struct LMS7Parameter EN_LDO_VCOGN = { 0x0093, 3, 3, 0, "EN_LDO_VCOGN", "Enables the LDO" }; +const struct LMS7Parameter EN_LDO_VCOSXR = { 0x0093, 2, 2, 0, "EN_LDO_VCOSXR", "Enables the LDO" }; +const struct LMS7Parameter EN_LDO_VCOSXT = { 0x0093, 1, 1, 0, "EN_LDO_VCOSXT", "Enables the LDO" }; +const struct LMS7Parameter EN_LDO_CPSXT = { 0x0093, 0, 0, 0, "EN_LDO_CPSXT", "Enables the LDO" }; +const struct LMS7Parameter EN_LOADIMP_LDO_CPSXT = { 0x0094, 15, 15, 0, "EN_LOADIMP_LDO_CPSXT", "Enables the load dependent bias to optimize the load regulation" }; +const struct LMS7Parameter EN_LOADIMP_LDO_DIG = { 0x0094, 14, 14, 0, "EN_LOADIMP_LDO_DIG", "Enables the load dependent bias to optimize the load regulation" }; +const struct LMS7Parameter EN_LOADIMP_LDO_DIGGN = { 0x0094, 13, 13, 0, "EN_LOADIMP_LDO_DIGGN", "Enables the load dependent bias to optimize the load regulation" }; +const struct LMS7Parameter EN_LOADIMP_LDO_DIGSXR = { 0x0094, 12, 12, 0, "EN_LOADIMP_LDO_DIGSXR", "Enables the load dependent bias to optimize the load regulation" }; +const struct LMS7Parameter EN_LOADIMP_LDO_DIGSXT = { 0x0094, 11, 11, 0, "EN_LOADIMP_LDO_DIGSXT", "Enables the load dependent bias to optimize the load regulation" }; +const struct LMS7Parameter EN_LOADIMP_LDO_DIVGN = { 0x0094, 10, 10, 0, "EN_LOADIMP_LDO_DIVGN", "Enables the load dependent bias to optimize the load regulation" }; +const struct LMS7Parameter EN_LOADIMP_LDO_DIVSXR = { 0x0094, 9, 9, 0, "EN_LOADIMP_LDO_DIVSXR", "Enables the load dependent bias to optimize the load regulation" }; +const struct LMS7Parameter EN_LOADIMP_LDO_DIVSXT = { 0x0094, 8, 8, 0, "EN_LOADIMP_LDO_DIVSXT", "Enables the load dependent bias to optimize the load regulation" }; +const struct LMS7Parameter EN_LOADIMP_LDO_LNA12 = { 0x0094, 7, 7, 0, "EN_LOADIMP_LDO_LNA12", "Enables the load dependent bias to optimize the load regulation" }; +const struct LMS7Parameter EN_LOADIMP_LDO_LNA14 = { 0x0094, 6, 6, 0, "EN_LOADIMP_LDO_LNA14", "Enables the load dependent bias to optimize the load regulation" }; +const struct LMS7Parameter EN_LOADIMP_LDO_MXRFE = { 0x0094, 5, 5, 0, "EN_LOADIMP_LDO_MXRFE", "Enables the load dependent bias to optimize the load regulation" }; +const struct LMS7Parameter EN_LOADIMP_LDO_RBB = { 0x0094, 4, 4, 0, "EN_LOADIMP_LDO_RBB", "Enables the load dependent bias to optimize the load regulation" }; +const struct LMS7Parameter EN_LOADIMP_LDO_RXBUF = { 0x0094, 3, 3, 0, "EN_LOADIMP_LDO_RXBUF", "Enables the load dependent bias to optimize the load regulation" }; +const struct LMS7Parameter EN_LOADIMP_LDO_TBB = { 0x0094, 2, 2, 0, "EN_LOADIMP_LDO_TBB", "Enables the load dependent bias to optimize the load regulation" }; +const struct LMS7Parameter EN_LOADIMP_LDO_TIA12 = { 0x0094, 1, 1, 0, "EN_LOADIMP_LDO_TIA12", "Enables the load dependent bias to optimize the load regulation" }; +const struct LMS7Parameter EN_LOADIMP_LDO_TIA14 = { 0x0094, 0, 0, 0, "EN_LOADIMP_LDO_TIA14", "Enables the load dependent bias to optimize the load regulation" }; +const struct LMS7Parameter BYP_LDO_TBB = { 0x0095, 15, 15, 0, "BYP_LDO_TBB", "Bypass signal for the LDO" }; +const struct LMS7Parameter BYP_LDO_TIA12 = { 0x0095, 14, 14, 0, "BYP_LDO_TIA12", "Bypass signal for the LDO" }; +const struct LMS7Parameter BYP_LDO_TIA14 = { 0x0095, 13, 13, 0, "BYP_LDO_TIA14", "Bypass signal for the LDO" }; +const struct LMS7Parameter BYP_LDO_TLOB = { 0x0095, 12, 12, 0, "BYP_LDO_TLOB", "Bypass signal for the LDO" }; +const struct LMS7Parameter BYP_LDO_TPAD = { 0x0095, 11, 11, 0, "BYP_LDO_TPAD", "Bypass signal for the LDO" }; +const struct LMS7Parameter BYP_LDO_TXBUF = { 0x0095, 10, 10, 0, "BYP_LDO_TXBUF", "Bypass signal for the LDO" }; +const struct LMS7Parameter BYP_LDO_VCOGN = { 0x0095, 9, 9, 0, "BYP_LDO_VCOGN", "Bypass signal for the LDO" }; +const struct LMS7Parameter BYP_LDO_VCOSXR = { 0x0095, 8, 8, 0, "BYP_LDO_VCOSXR", "Bypass signal for the LDO" }; +const struct LMS7Parameter BYP_LDO_VCOSXT = { 0x0095, 7, 7, 0, "BYP_LDO_VCOSXT", "Bypass signal for the LDO" }; +const struct LMS7Parameter EN_LOADIMP_LDO_AFE = { 0x0095, 2, 2, 0, "EN_LOADIMP_LDO_AFE", "Enables the load dependent bias to optimize the load regulation" }; +const struct LMS7Parameter EN_LOADIMP_LDO_CPGN = { 0x0095, 1, 1, 0, "EN_LOADIMP_LDO_CPGN", "Enables the load dependent bias to optimize the load regulation" }; +const struct LMS7Parameter EN_LOADIMP_LDO_CPSXR = { 0x0095, 0, 0, 0, "EN_LOADIMP_LDO_CPSXR", "Enables the load dependent bias to optimize the load regulation" }; +const struct LMS7Parameter BYP_LDO_AFE = { 0x0096, 15, 15, 0, "BYP_LDO_AFE", "Bypass signal for the LDO" }; +const struct LMS7Parameter BYP_LDO_CPGN = { 0x0096, 14, 14, 0, "BYP_LDO_CPGN", "Bypass signal for the LDO" }; +const struct LMS7Parameter BYP_LDO_CPSXR = { 0x0096, 13, 13, 0, "BYP_LDO_CPSXR", "Bypass signal for the LDO" }; +const struct LMS7Parameter BYP_LDO_CPSXT = { 0x0096, 12, 12, 0, "BYP_LDO_CPSXT", "Bypass signal for the LDO" }; +const struct LMS7Parameter BYP_LDO_DIG = { 0x0096, 11, 11, 0, "BYP_LDO_DIG", "Bypass signal for the LDO" }; +const struct LMS7Parameter BYP_LDO_DIGGN = { 0x0096, 10, 10, 0, "BYP_LDO_DIGGN", "Bypass signal for the LDO" }; +const struct LMS7Parameter BYP_LDO_DIGSXR = { 0x0096, 9, 9, 0, "BYP_LDO_DIGSXR", "Bypass signal for the LDO" }; +const struct LMS7Parameter BYP_LDO_DIGSXT = { 0x0096, 8, 8, 0, "BYP_LDO_DIGSXT", "Bypass signal for the LDO" }; +const struct LMS7Parameter BYP_LDO_DIVGN = { 0x0096, 7, 7, 0, "BYP_LDO_DIVGN", "Bypass signal for the LDO" }; +const struct LMS7Parameter BYP_LDO_DIVSXR = { 0x0096, 6, 6, 0, "BYP_LDO_DIVSXR", "Bypass signal for the LDO" }; +const struct LMS7Parameter BYP_LDO_DIVSXT = { 0x0096, 5, 5, 0, "BYP_LDO_DIVSXT", "Bypass signal for the LDO" }; +const struct LMS7Parameter BYP_LDO_LNA12 = { 0x0096, 4, 4, 0, "BYP_LDO_LNA12", "Bypass signal for the LDO" }; +const struct LMS7Parameter BYP_LDO_LNA14 = { 0x0096, 3, 3, 0, "BYP_LDO_LNA14", "Bypass signal for the LDO" }; +const struct LMS7Parameter BYP_LDO_MXRFE = { 0x0096, 2, 2, 0, "BYP_LDO_MXRFE", "Bypass signal for the LDO" }; +const struct LMS7Parameter BYP_LDO_RBB = { 0x0096, 1, 1, 0, "BYP_LDO_RBB", "Bypass signal for the LDO" }; +const struct LMS7Parameter BYP_LDO_RXBUF = { 0x0096, 0, 0, 0, "BYP_LDO_RXBUF", "Bypass signal for the LDO" }; +const struct LMS7Parameter SPDUP_LDO_DIVSXR = { 0x0097, 15, 15, 0, "SPDUP_LDO_DIVSXR", "Short the noise filter resistor to speed up the settling time" }; +const struct LMS7Parameter SPDUP_LDO_DIVSXT = { 0x0097, 14, 14, 0, "SPDUP_LDO_DIVSXT", "Short the noise filter resistor to speed up the settling time" }; +const struct LMS7Parameter SPDUP_LDO_LNA12 = { 0x0097, 13, 13, 0, "SPDUP_LDO_LNA12", "Short the noise filter resistor to speed up the settling time" }; +const struct LMS7Parameter SPDUP_LDO_LNA14 = { 0x0097, 12, 12, 0, "SPDUP_LDO_LNA14", "Short the noise filter resistor to speed up the settling time" }; +const struct LMS7Parameter SPDUP_LDO_MXRFE = { 0x0097, 11, 11, 0, "SPDUP_LDO_MXRFE", "Short the noise filter resistor to speed up the settling time" }; +const struct LMS7Parameter SPDUP_LDO_RBB = { 0x0097, 10, 10, 0, "SPDUP_LDO_RBB", "Short the noise filter resistor to speed up the settling time" }; +const struct LMS7Parameter SPDUP_LDO_RXBUF = { 0x0097, 9, 9, 0, "SPDUP_LDO_RXBUF", "Short the noise filter resistor to speed up the settling time" }; +const struct LMS7Parameter SPDUP_LDO_TBB = { 0x0097, 8, 8, 0, "SPDUP_LDO_TBB", "Short the noise filter resistor to speed up the settling time" }; +const struct LMS7Parameter SPDUP_LDO_TIA12 = { 0x0097, 7, 7, 0, "SPDUP_LDO_TIA12", "Short the noise filter resistor to speed up the settling time" }; +const struct LMS7Parameter SPDUP_LDO_TIA14 = { 0x0097, 6, 6, 0, "SPDUP_LDO_TIA14", "Short the noise filter resistor to speed up the settling time" }; +const struct LMS7Parameter SPDUP_LDO_TLOB = { 0x0097, 5, 5, 0, "SPDUP_LDO_TLOB", "Short the noise filter resistor to speed up the settling time" }; +const struct LMS7Parameter SPDUP_LDO_TPAD = { 0x0097, 4, 4, 0, "SPDUP_LDO_TPAD", "Short the noise filter resistor to speed up the settling time" }; +const struct LMS7Parameter SPDUP_LDO_TXBUF = { 0x0097, 3, 3, 0, "SPDUP_LDO_TXBUF", "Short the noise filter resistor to speed up the settling time" }; +const struct LMS7Parameter SPDUP_LDO_VCOGN = { 0x0097, 2, 2, 0, "SPDUP_LDO_VCOGN", "Short the noise filter resistor to speed up the settling time" }; +const struct LMS7Parameter SPDUP_LDO_VCOSXR = { 0x0097, 1, 1, 0, "SPDUP_LDO_VCOSXR", "Short the noise filter resistor to speed up the settling time" }; +const struct LMS7Parameter SPDUP_LDO_VCOSXT = { 0x0097, 0, 0, 0, "SPDUP_LDO_VCOSXT", "Short the noise filter resistor to speed up the settling time" }; +const struct LMS7Parameter SPDUP_LDO_AFE = { 0x0098, 8, 8, 0, "SPDUP_LDO_AFE", "Short the noise filter resistor to speed up the settling time" }; +const struct LMS7Parameter SPDUP_LDO_CPGN = { 0x0098, 7, 7, 0, "SPDUP_LDO_CPGN", "Short the noise filter resistor to speed up the settling time" }; +const struct LMS7Parameter SPDUP_LDO_CPSXR = { 0x0098, 6, 6, 0, "SPDUP_LDO_CPSXR", "Short the noise filter resistor to speed up the settling time" }; +const struct LMS7Parameter SPDUP_LDO_CPSXT = { 0x0098, 5, 5, 0, "SPDUP_LDO_CPSXT", "Short the noise filter resistor to speed up the settling time" }; +const struct LMS7Parameter SPDUP_LDO_DIG = { 0x0098, 4, 4, 0, "SPDUP_LDO_DIG", "Short the noise filter resistor to speed up the settling time" }; +const struct LMS7Parameter SPDUP_LDO_DIGGN = { 0x0098, 3, 3, 0, "SPDUP_LDO_DIGGN", "Short the noise filter resistor to speed up the settling time" }; +const struct LMS7Parameter SPDUP_LDO_DIGSXR = { 0x0098, 2, 2, 0, "SPDUP_LDO_DIGSXR", "Short the noise filter resistor to speed up the settling time" }; +const struct LMS7Parameter SPDUP_LDO_DIGSXT = { 0x0098, 1, 1, 0, "SPDUP_LDO_DIGSXT", "Short the noise filter resistor to speed up the settling time" }; +const struct LMS7Parameter SPDUP_LDO_DIVGN = { 0x0098, 0, 0, 0, "SPDUP_LDO_DIVGN", "Short the noise filter resistor to speed up the settling time" }; +const struct LMS7Parameter RDIV_VCOSXR = { 0x0099, 15, 8, 101, "RDIV_VCOSXR", "Controls the output voltage of the LDO by setting the resistive voltage divider ratio" }; +const struct LMS7Parameter RDIV_VCOSXT = { 0x0099, 7, 0, 101, "RDIV_VCOSXT", "Controls the output voltage of the LDO by setting the resistive voltage divider ratio" }; +const struct LMS7Parameter RDIV_TXBUF = { 0x009A, 15, 8, 101, "RDIV_TXBUF", "Controls the output voltage of the LDO by setting the resistive voltage divider ratio" }; +const struct LMS7Parameter RDIV_VCOGN = { 0x009A, 7, 0, 140, "RDIV_VCOGN", "Controls the output voltage of the LDO by setting the resistive voltage divider ratio" }; +const struct LMS7Parameter RDIV_TLOB = { 0x009B, 15, 8, 101, "RDIV_TLOB", "Controls the output voltage of the LDO by setting the resistive voltage divider ratio" }; +const struct LMS7Parameter RDIV_TPAD = { 0x009B, 7, 0, 101, "RDIV_TPAD", "Controls the output voltage of the LDO by setting the resistive voltage divider ratio" }; +const struct LMS7Parameter RDIV_TIA12 = { 0x009C, 15, 8, 101, "RDIV_TIA12", "Controls the output voltage of the LDO by setting the resistive voltage divider ratio" }; +const struct LMS7Parameter RDIV_TIA14 = { 0x009C, 7, 0, 140, "RDIV_TIA14", "Controls the output voltage of the LDO by setting the resistive voltage divider ratio" }; +const struct LMS7Parameter RDIV_RXBUF = { 0x009D, 15, 8, 101, "RDIV_RXBUF", "Controls the output voltage of the LDO by setting the resistive voltage divider ratio" }; +const struct LMS7Parameter RDIV_TBB = { 0x009D, 7, 0, 101, "RDIV_TBB", "Controls the output voltage of the LDO by setting the resistive voltage divider ratio" }; +const struct LMS7Parameter RDIV_MXRFE = { 0x009E, 15, 8, 101, "RDIV_MXRFE", "Controls the output voltage of the LDO by setting the resistive voltage divider ratio" }; +const struct LMS7Parameter RDIV_RBB = { 0x009E, 7, 0, 140, "RDIV_RBB", "Controls the output voltage of the LDO by setting the resistive voltage divider ratio" }; +const struct LMS7Parameter RDIV_LNA12 = { 0x009F, 15, 8, 101, "RDIV_LNA12", "Controls the output voltage of the LDO by setting the resistive voltage divider ratio" }; +const struct LMS7Parameter RDIV_LNA14 = { 0x009F, 7, 0, 140, "RDIV_LNA14", "Controls the output voltage of the LDO by setting the resistive voltage divider ratio" }; +const struct LMS7Parameter RDIV_DIVSXR = { 0x00A0, 15, 8, 101, "RDIV_DIVSXR", "Controls the output voltage of the LDO by setting the resistive voltage divider ratio" }; +const struct LMS7Parameter RDIV_DIVSXT = { 0x00A0, 7, 0, 101, "RDIV_DIVSXT", "Controls the output voltage of the LDO by setting the resistive voltage divider ratio" }; +const struct LMS7Parameter RDIV_DIGSXT = { 0x00A1, 15, 8, 101, "RDIV_DIGSXT", "Controls the output voltage of the LDO by setting the resistive voltage divider ratio" }; +const struct LMS7Parameter RDIV_DIVGN = { 0x00A1, 7, 0, 101, "RDIV_DIVGN", "Controls the output voltage of the LDO by setting the resistive voltage divider ratio" }; +const struct LMS7Parameter RDIV_DIGGN = { 0x00A2, 15, 8, 101, "RDIV_DIGGN", "Controls the output voltage of the LDO by setting the resistive voltage divider ratio" }; +const struct LMS7Parameter RDIV_DIGSXR = { 0x00A2, 7, 0, 101, "RDIV_DIGSXR", "Controls the output voltage of the LDO by setting the resistive voltage divider ratio" }; +const struct LMS7Parameter RDIV_CPSXT = { 0x00A3, 15, 8, 101, "RDIV_CPSXT", "Controls the output voltage of the LDO by setting the resistive voltage divider ratio" }; +const struct LMS7Parameter RDIV_DIG = { 0x00A3, 7, 0, 101, "RDIV_DIG", "Controls the output voltage of the LDO by setting the resistive voltage divider ratio" }; +const struct LMS7Parameter RDIV_CPGN = { 0x00A4, 15, 8, 101, "RDIV_CPGN", "Controls the output voltage of the LDO by setting the resistive voltage divider ratio" }; +const struct LMS7Parameter RDIV_CPSXR = { 0x00A4, 7, 0, 101, "RDIV_CPSXR", "Controls the output voltage of the LDO by setting the resistive voltage divider ratio" }; +const struct LMS7Parameter RDIV_SPIBUF = { 0x00A5, 15, 8, 101, "RDIV_SPIBUF", "Controls the output voltage of the LDO by setting the resistive voltage divider ratio" }; +const struct LMS7Parameter RDIV_AFE = { 0x00A5, 7, 0, 101, "RDIV_AFE", "Controls the output voltage of the LDO by setting the resistive voltage divider ratio" }; +const struct LMS7Parameter SPDUP_LDO_SPIBUF = { 0x00A6, 12, 12, 0, "SPDUP_LDO_SPIBUF", "Short the noise filter resistor to speed up the settling time" }; +const struct LMS7Parameter SPDUP_LDO_DIGIp2 = { 0x00A6, 11, 11, 0, "SPDUP_LDO_DIGIp2", "Short the noise filter resistor to speed up the settling time" }; +const struct LMS7Parameter SPDUP_LDO_DIGIp1 = { 0x00A6, 10, 10, 0, "SPDUP_LDO_DIGIp1", "Short the noise filter resistor to speed up the settling time" }; +const struct LMS7Parameter BYP_LDO_SPIBUF = { 0x00A6, 9, 9, 0, "BYP_LDO_SPIBUF", "Bypass signal for the LDO" }; +const struct LMS7Parameter BYP_LDO_DIGIp2 = { 0x00A6, 8, 8, 0, "BYP_LDO_DIGIp2", "Bypass signal for the LDO" }; +const struct LMS7Parameter BYP_LDO_DIGIp1 = { 0x00A6, 7, 7, 0, "BYP_LDO_DIGIp1", "Bypass signal for the LDO" }; +const struct LMS7Parameter EN_LOADIMP_LDO_SPIBUF = { 0x00A6, 6, 6, 0, "EN_LOADIMP_LDO_SPIBUF", "Enables the load dependent bias to optimize the load regulation" }; +const struct LMS7Parameter EN_LOADIMP_LDO_DIGIp2 = { 0x00A6, 5, 5, 0, "EN_LOADIMP_LDO_DIGIp2", "Enables the load dependent bias to optimize the load regulation" }; +const struct LMS7Parameter EN_LOADIMP_LDO_DIGIp1 = { 0x00A6, 4, 4, 0, "EN_LOADIMP_LDO_DIGIp1", "Enables the load dependent bias to optimize the load regulation" }; +const struct LMS7Parameter PD_LDO_SPIBUF = { 0x00A6, 3, 3, 1, "PD_LDO_SPIBUF", "Enables the LDO" }; +const struct LMS7Parameter PD_LDO_DIGIp2 = { 0x00A6, 2, 2, 1, "PD_LDO_DIGIp2", "Enables the LDO" }; +const struct LMS7Parameter PD_LDO_DIGIp1 = { 0x00A6, 1, 1, 1, "PD_LDO_DIGIp1", "Enables the LDO" }; +const struct LMS7Parameter EN_G_LDOP = { 0x00A6, 0, 0, 1, "EN_G_LDOP", "Enable control for all the LDO power downs" }; +const struct LMS7Parameter RDIV_DIGIp2 = { 0x00A7, 15, 8, 101, "RDIV_DIGIp2", "Controls the output voltage of the LDO by setting the resistive voltage divider ratio" }; +const struct LMS7Parameter RDIV_DIGIp1 = { 0x00A7, 7, 0, 101, "RDIV_DIGIp1", "Controls the output voltage of the LDO by setting the resistive voltage divider ratio" }; +const struct LMS7Parameter BSIGT = { 0x00A8, 31, 9, 0, "BSIGT", "" }; +const struct LMS7Parameter BSTATE = { 0x00A8, 8, 8, 0, "BSTATE", "" }; +const struct LMS7Parameter EN_SDM_TSTO_SXT = { 0x00A8, 6, 6, 0, "EN_SDM_TSTO_SXT", "Enables the SDM_TSTO_SXT" }; +const struct LMS7Parameter EN_SDM_TSTO_SXR = { 0x00A8, 5, 5, 0, "EN_SDM_TSTO_SXR", "Enables the SDM_TSTO_SXR" }; +const struct LMS7Parameter EN_SDM_TSTO_CGEN = { 0x00A8, 4, 4, 0, "EN_SDM_TSTO_CGEN", "Enables the SDM_TSTO_CGEN" }; +const struct LMS7Parameter BENC = { 0x00A8, 3, 3, 0, "BENC", "enables CGEN BIST" }; +const struct LMS7Parameter BENR = { 0x00A8, 2, 2, 0, "BENR", "enables SXR BIST" }; +const struct LMS7Parameter BENT = { 0x00A8, 1, 1, 0, "BENT", "enables SXT BIST" }; +const struct LMS7Parameter BSTART = { 0x00A8, 0, 0, 0, "BSTART", "Starts delta sigma built in self test. Keep it at 1 one at least three clock cycles" }; +const struct LMS7Parameter BSIGR = { 0x00AA, 22, 0, 0, "BSIGR", "" }; +const struct LMS7Parameter BSIGC = { 0x00AB, 29, 7, 0, "BSIGC", "" }; +const struct LMS7Parameter CDS_MCLK2 = { 0x00AD, 15, 14, 0, "CDS_MCLK2", "MCLK2 clock delay" }; +const struct LMS7Parameter CDS_MCLK1 = { 0x00AD, 13, 12, 0, "CDS_MCLK1", "MCLK1 clock delay" }; +const struct LMS7Parameter CDSN_TXBTSP = { 0x00AD, 9, 9, 1, "CDSN_TXBTSP", "TX TSPB clock inversion control" }; +const struct LMS7Parameter CDSN_TXATSP = { 0x00AD, 8, 8, 1, "CDSN_TXATSP", "TX TSPA clock inversion control" }; +const struct LMS7Parameter CDSN_RXBTSP = { 0x00AD, 7, 7, 1, "CDSN_RXBTSP", "RX TSPB clock inversion control" }; +const struct LMS7Parameter CDSN_RXATSP = { 0x00AD, 6, 6, 1, "CDSN_RXATSP", "RX TSPA clock inversion control" }; +const struct LMS7Parameter CDSN_TXBLML = { 0x00AD, 5, 5, 1, "CDSN_TXBLML", "TX LMLB clock inversion control" }; +const struct LMS7Parameter CDSN_TXALML = { 0x00AD, 4, 4, 1, "CDSN_TXALML", "TX LMLA clock inversion control" }; +const struct LMS7Parameter CDSN_RXBLML = { 0x00AD, 3, 3, 1, "CDSN_RXBLML", "RX LMLB clock inversion control" }; +const struct LMS7Parameter CDSN_RXALML = { 0x00AD, 2, 2, 1, "CDSN_RXALML", "RX LMLA clock inversion control" }; +const struct LMS7Parameter CDSN_MCLK2 = { 0x00AD, 1, 1, 1, "CDSN_MCLK2", "MCLK2 clock inversion control" }; +const struct LMS7Parameter CDSN_MCLK1 = { 0x00AD, 0, 0, 1, "CDSN_MCLK1", "MCLK1 clock inversion control" }; +const struct LMS7Parameter CDS_TXBTSP = { 0x00AE, 15, 14, 0, "CDS_TXBTSP", "TX TSP B clock delay" }; +const struct LMS7Parameter CDS_TXATSP = { 0x00AE, 13, 12, 0, "CDS_TXATSP", "TX TSP A clock delay" }; +const struct LMS7Parameter CDS_RXBTSP = { 0x00AE, 11, 10, 0, "CDS_RXBTSP", "RX TSP B clock delay" }; +const struct LMS7Parameter CDS_RXATSP = { 0x00AE, 9, 8, 0, "CDS_RXATSP", "RX TSP A clock delay" }; +const struct LMS7Parameter CDS_TXBLML = { 0x00AE, 7, 6, 0, "CDS_TXBLML", "TX LML B clock delay" }; +const struct LMS7Parameter CDS_TXALML = { 0x00AE, 5, 4, 0, "CDS_TXALML", "TX LML A clock delay" }; +const struct LMS7Parameter CDS_RXBLML = { 0x00AE, 3, 2, 0, "CDS_RXBLML", "RX LML B clock delay" }; +const struct LMS7Parameter CDS_RXALML = { 0x00AE, 1, 0, 0, "CDS_RXALML", "RX LML A clock delay" }; +const struct LMS7Parameter EN_LOWBWLOMX_TMX_TRF = { 0x0100, 15, 15, 0, "EN_LOWBWLOMX_TMX_TRF", "Controls the high pass pole frequency of the RC biasing the gate of the mixer switches" }; +const struct LMS7Parameter EN_NEXTTX_TRF = { 0x0100, 14, 14, 0, "EN_NEXTTX_TRF", "Enables the daisy change LO buffer going from TRF_1 to TRF2" }; +const struct LMS7Parameter EN_AMPHF_PDET_TRF = { 0x0100, 13, 12, 3, "EN_AMPHF_PDET_TRF", "Enables the TXPAD power detector preamplifier" }; +const struct LMS7Parameter LOADR_PDET_TRF = { 0x0100, 11, 10, 1, "LOADR_PDET_TRF", "Controls the resistive load of the Power detector" }; +const struct LMS7Parameter PD_PDET_TRF = { 0x0100, 3, 3, 1, "PD_PDET_TRF", "Powerdown signal for Power Detector" }; +const struct LMS7Parameter PD_TLOBUF_TRF = { 0x0100, 2, 2, 0, "PD_TLOBUF_TRF", "Powerdown signal for TX LO buffer" }; +const struct LMS7Parameter PD_TXPAD_TRF = { 0x0100, 1, 1, 0, "PD_TXPAD_TRF", "Powerdown signal for TXPAD" }; +const struct LMS7Parameter EN_G_TRF = { 0x0100, 0, 0, 1, "EN_G_TRF", "Enable control for all the TRF_1 power downs" }; +const struct LMS7Parameter F_TXPAD_TRF = { 0x0101, 15, 13, 3, "F_TXPAD_TRF", "Controls the switched capacitor at the TXPAD output. Is used for fine tuning of the TXPAD output" }; +const struct LMS7Parameter L_LOOPB_TXPAD_TRF = { 0x0101, 12, 11, 3, "L_LOOPB_TXPAD_TRF", "Controls the loss of the of the loopback path at the TX side" }; +const struct LMS7Parameter LOSS_LIN_TXPAD_TRF = { 0x0101, 10, 6, 0, "LOSS_LIN_TXPAD_TRF", "Controls the gain of the linearizing part of of the TXPAD" }; +const struct LMS7Parameter LOSS_MAIN_TXPAD_TRF = { 0x0101, 5, 1, 0, "LOSS_MAIN_TXPAD_TRF", "Controls the gain output power of the TXPAD" }; +const struct LMS7Parameter EN_LOOPB_TXPAD_TRF = { 0x0101, 0, 0, 0, "EN_LOOPB_TXPAD_TRF", "Enables the TXPAD loopback path" }; +const struct LMS7Parameter GCAS_GNDREF_TXPAD_TRF = { 0x0102, 15, 15, 0, "GCAS_GNDREF_TXPAD_TRF", "Controls if the TXPAD cascode transistor gate bias is referred to VDD or GND" }; +const struct LMS7Parameter ICT_LIN_TXPAD_TRF = { 0x0102, 14, 10, 12, "ICT_LIN_TXPAD_TRF", "Control the bias current of the linearization section of the TXPAD" }; +const struct LMS7Parameter ICT_MAIN_TXPAD_TRF = { 0x0102, 9, 5, 12, "ICT_MAIN_TXPAD_TRF", "Control the bias current of the main gm section of the TXPAD" }; +const struct LMS7Parameter VGCAS_TXPAD_TRF = { 0x0102, 4, 0, 0, "VGCAS_TXPAD_TRF", "Controls the bias voltage at the gate of TXPAD cascade" }; +const struct LMS7Parameter SEL_BAND1_TRF = { 0x0103, 11, 11, 1, "SEL_BAND1_TRF", "" }; +const struct LMS7Parameter SEL_BAND2_TRF = { 0x0103, 10, 10, 0, "SEL_BAND2_TRF", "" }; +const struct LMS7Parameter LOBIASN_TXM_TRF = { 0x0103, 9, 5, 16, "LOBIASN_TXM_TRF", "Controls the bias at the gate of the mixer NMOS" }; +const struct LMS7Parameter LOBIASP_TXX_TRF = { 0x0103, 4, 0, 18, "LOBIASP_TXX_TRF", "Controls the bias at the gate of the mixer PMOS" }; +const struct LMS7Parameter CDC_I_TRF = { 0x0104, 7, 4, 8, "CDC_I_TRF", "" }; +const struct LMS7Parameter CDC_Q_TRF = { 0x0104, 3, 0, 8, "CDC_Q_TRF", "" }; +const struct LMS7Parameter STATPULSE_TBB = { 0x0105, 15, 15, 0, "STATPULSE_TBB", "" }; +const struct LMS7Parameter LOOPB_TBB = { 0x0105, 14, 12, 0, "LOOPB_TBB", "This controls which signal is connected to the loopback output pins. Note: when both the lowpass ladder and real pole are powered down, the output of the active highband biquad is routed to the loopb output" }; +const struct LMS7Parameter PD_LPFH_TBB = { 0x0105, 4, 4, 0, "PD_LPFH_TBB", "This selectively powers down the LPFH_TBB biquad" }; +const struct LMS7Parameter PD_LPFIAMP_TBB = { 0x0105, 3, 3, 0, "PD_LPFIAMP_TBB", "selectively powers down the LPFIAMP_TBB front-end current amp of the transmitter baseband" }; +const struct LMS7Parameter PD_LPFLAD_TBB = { 0x0105, 2, 2, 1, "PD_LPFLAD_TBB", "This selectively powers down the LPFLAD_TBB low pass ladder filter of the transmitter baseband" }; +const struct LMS7Parameter PD_LPFS5_TBB = { 0x0105, 1, 1, 1, "PD_LPFS5_TBB", "This selectively powers down the LPFS5_TBB low pass real-pole filter of the transmitter baseband" }; +const struct LMS7Parameter EN_G_TBB = { 0x0105, 0, 0, 1, "EN_G_TBB", "Enable control for all the TBB_TOP power downs" }; +const struct LMS7Parameter ICT_LPFS5_F_TBB = { 0x0106, 14, 10, 12, "ICT_LPFS5_F_TBB", "This controls the operational amplifier's output stage bias current of the low band real pole filter of the transmitter's baseband" }; +const struct LMS7Parameter ICT_LPFS5_PT_TBB = { 0x0106, 9, 5, 12, "ICT_LPFS5_PT_TBB", "This controls the operational amplifier's input stage bias current of the low band real pole filter of the transmitter's baseband" }; +const struct LMS7Parameter ICT_LPF_H_PT_TBB = { 0x0106, 4, 0, 12, "ICT_LPF_H_PT_TBB", "This controls the operational amplifiers input stage bias reference current of the high band low pass filter of the transmitter's baseband " }; +const struct LMS7Parameter ICT_LPFH_F_TBB = { 0x0107, 14, 10, 12, "ICT_LPFH_F_TBB", "controls the operational amplifiers output stage bias reference current of the high band low pass filter of the transmitter's baseband (LPFH_TBB)" }; +const struct LMS7Parameter ICT_LPFLAD_F_TBB = { 0x0107, 9, 5, 12, "ICT_LPFLAD_F_TBB", "This controls the operational amplfiers' output stages bias referene current of the low band ladder filter of the transmisster's baseband" }; +const struct LMS7Parameter ICT_LPFLAD_PT_TBB = { 0x0107, 4, 0, 12, "ICT_LPFLAD_PT_TBB", "This controls the operational amplifers' input stages bias reference current of the low band ladder filter of the transmitter's baseband" }; +const struct LMS7Parameter CG_IAMP_TBB = { 0x0108, 15, 10, 37, "CG_IAMP_TBB", "This controls the frontend gain of the TBB. For a given gain value, this control value varies with the set TX mode. After resistance calibration, the following table gives the nominal values for each frequency setting. However, this table is to be updated and corrected after calibration" }; +const struct LMS7Parameter ICT_IAMP_FRP_TBB = { 0x0108, 9, 5, 1, "ICT_IAMP_FRP_TBB", "This controls the reference bias current of the IAMP main bias current sources" }; +const struct LMS7Parameter ICT_IAMP_GG_FRP_TBB = { 0x0108, 4, 0, 6, "ICT_IAMP_GG_FRP_TBB", "This controls the reference bias current of the IAMP's cascode transistors gate voltages that set the IAMP's input voltage level. The IAMP's input is connected to the DAC output" }; +const struct LMS7Parameter RCAL_LPFH_TBB = { 0x0109, 15, 8, 97, "RCAL_LPFH_TBB", "This controls the value of the equivalent resistance of the resistor banks of the biquad filter stage (of the high band section) of the transmitter baseband(TBB)" }; +const struct LMS7Parameter RCAL_LPFLAD_TBB = { 0x0109, 7, 0, 193, "RCAL_LPFLAD_TBB", "This controls the value of the equivalent resistance of the resistor banks of the low pass filter ladder (of the low band section) of the transmitter baseband(TBB)" }; +const struct LMS7Parameter TSTIN_TBB = { 0x010A, 15, 14, 0, "TSTIN_TBB", "This control selects where the input test signal (vinp/n_aux_bbq/i) is routed to as well as disabling the route." }; +const struct LMS7Parameter BYPLADDER_TBB = { 0x010A, 13, 13, 0, "BYPLADDER_TBB", "This signal bypasses the LPF ladder of TBB and directly connects the output of current amplifier to the null port of the real pole stage of TBB low pass filter" }; +const struct LMS7Parameter CCAL_LPFLAD_TBB = { 0x010A, 12, 8, 16, "CCAL_LPFLAD_TBB", "A common control signal for all the capacitor banks of TBB filters (including the ladder, real pole, and the high band biquad). It is the calibrated value of the banks control that sets the value of the banks' equivalent capacitor to their respective nominal values" }; +const struct LMS7Parameter RCAL_LPFS5_TBB = { 0x010A, 7, 0, 76, "RCAL_LPFS5_TBB", "This controls the value of the equivalent resistance of the resistor banks of the real pole filter stage (of the low band section) of the transmitter baseband (TBB). Following is a nominal values table that are corrected for any process variation after calibration" }; +const struct LMS7Parameter CDC_I_RFE = { 0x010C, 15, 12, 8, "CDC_I_RFE", "" }; +const struct LMS7Parameter CDC_Q_RFE = { 0x010C, 11, 8, 8, "CDC_Q_RFE", "" }; +const struct LMS7Parameter PD_LNA_RFE = { 0x010C, 7, 7, 1, "PD_LNA_RFE", "Power control signal for LNA_RFE" }; +const struct LMS7Parameter PD_RLOOPB_1_RFE = { 0x010C, 6, 6, 1, "PD_RLOOPB_1_RFE", "Power control signal for RXFE loopback 1" }; +const struct LMS7Parameter PD_RLOOPB_2_RFE = { 0x010C, 5, 5, 1, "PD_RLOOPB_2_RFE", "Power control signal for RXFE loopback 2" }; +const struct LMS7Parameter PD_MXLOBUF_RFE = { 0x010C, 4, 4, 1, "PD_MXLOBUF_RFE", "Power control signal for RXFE mixer lo buffer" }; +const struct LMS7Parameter PD_QGEN_RFE = { 0x010C, 3, 3, 1, "PD_QGEN_RFE", "Power control signal for RXFE Quadrature LO generator" }; +const struct LMS7Parameter PD_RSSI_RFE = { 0x010C, 2, 2, 1, "PD_RSSI_RFE", "Power control signal for RXFE RSSI" }; +const struct LMS7Parameter PD_TIA_RFE = { 0x010C, 1, 1, 0, "PD_TIA_RFE", "Power control signal for RXFE TIA" }; +const struct LMS7Parameter EN_G_RFE = { 0x010C, 0, 0, 1, "EN_G_RFE", "Enable control for all the RFE_1 power downs" }; +const struct LMS7Parameter SEL_PATH_RFE = { 0x010D, 8, 7, 1, "SEL_PATH_RFE", "Selects the active path of the RXFE" }; +const struct LMS7Parameter EN_DCOFF_RXFE_RFE = { 0x010D, 6, 6, 0, "EN_DCOFF_RXFE_RFE", "Enables the DCOFFSET block for the RXFE" }; +const struct LMS7Parameter EN_INSHSW_LB1_RFE = { 0x010D, 4, 4, 1, "EN_INSHSW_LB1_RFE", "Enables the input shorting switch at the input of the loopback 1 (in parallel with LNAL mixer)" }; +const struct LMS7Parameter EN_INSHSW_LB2_RFE = { 0x010D, 3, 3, 1, "EN_INSHSW_LB2_RFE", "Enables the input shorting switch at the input of the loopback 2 (in parallel with LNAW mixer)" }; +const struct LMS7Parameter EN_INSHSW_L_RFE = { 0x010D, 2, 2, 1, "EN_INSHSW_L_RFE", "Enables the input shorting switch at the input of the LNAL" }; +const struct LMS7Parameter EN_INSHSW_W_RFE = { 0x010D, 1, 1, 1, "EN_INSHSW_W_RFE", "Enables the input shorting switch at the input of the LNAW" }; +const struct LMS7Parameter EN_NEXTRX_RFE = { 0x010D, 0, 0, 0, "EN_NEXTRX_RFE", "Enables the daisy chain LO buffer going from RXFE1 to RXFE2" }; +const struct LMS7Parameter DCOFFI_RFE = { 0x010E, 13, 7, 64, "DCOFFI_RFE", "Controls DC offset at the output of the TIA by injecting current to the input of the TIA (I side)" }; +const struct LMS7Parameter DCOFFQ_RFE = { 0x010E, 6, 0, 64, "DCOFFQ_RFE", "Controls DC offset at the output of the TIA by injecting current to the input of the TIA (Q side)" }; +const struct LMS7Parameter ICT_LOOPB_RFE = { 0x010F, 14, 10, 12, "ICT_LOOPB_RFE", "Controls the reference current of the RXFE loopback amplifier" }; +const struct LMS7Parameter ICT_TIAMAIN_RFE = { 0x010F, 9, 5, 2, "ICT_TIAMAIN_RFE", "Controls the reference current of the RXFE TIA first stage" }; +const struct LMS7Parameter ICT_TIAOUT_RFE = { 0x010F, 4, 0, 2, "ICT_TIAOUT_RFE", "Controls the reference current of the RXFE TIA 2nd stage" }; +const struct LMS7Parameter ICT_LNACMO_RFE = { 0x0110, 14, 10, 2, "ICT_LNACMO_RFE", "Controls the current generating LNA output common mode voltage" }; +const struct LMS7Parameter ICT_LNA_RFE = { 0x0110, 9, 5, 31, "ICT_LNA_RFE", "Controls the current of the LNA core" }; +const struct LMS7Parameter ICT_LODC_RFE = { 0x0110, 4, 0, 20, "ICT_LODC_RFE", "Controls the DC of the mixer LO signal at the gate of the mixer switches" }; +const struct LMS7Parameter CAP_RXMXO_RFE = { 0x0111, 9, 5, 4, "CAP_RXMXO_RFE", "Control the decoupling cap at the output of the RX Mixer" }; +const struct LMS7Parameter CGSIN_LNA_RFE = { 0x0111, 4, 0, 3, "CGSIN_LNA_RFE", "Controls the cap parallel with the LNA input input NMOS CGS to control the Q of the maching circuit and provides trade off between gain/NF and IIP. The higher the frequency, the lower CGSIN_LNA_RFE should be. Also, the higher CGSIN, the lower the Q, The lower the gain, the higher the NF, and the higher the IIP3" }; +const struct LMS7Parameter CCOMP_TIA_RFE = { 0x0112, 15, 12, 12, "CCOMP_TIA_RFE", "Compensation capacitor for TIA" }; +const struct LMS7Parameter CFB_TIA_RFE = { 0x0112, 11, 0, 230, "CFB_TIA_RFE", "Feeback capacitor for TIA. Controls the 3dB BW of the TIA. Should be set with calibration through digital baseband" }; +const struct LMS7Parameter G_LNA_RFE = { 0x0113, 9, 6, 15, "G_LNA_RFE", "Controls the gain of the LNA" }; +const struct LMS7Parameter G_RXLOOPB_RFE = { 0x0113, 5, 2, 0, "G_RXLOOPB_RFE", "Controls RXFE loopback gain" }; +const struct LMS7Parameter G_TIA_RFE = { 0x0113, 1, 0, 3, "G_TIA_RFE", "Controls the Gain of the TIA" }; +const struct LMS7Parameter RCOMP_TIA_RFE = { 0x0114, 8, 5, 4, "RCOMP_TIA_RFE", "Controls the compensation resistors of the TIA opamp" }; +const struct LMS7Parameter RFB_TIA_RFE = { 0x0114, 4, 0, 13, "RFB_TIA_RFE", "Sets the feedback resistor to the nominal value" }; +const struct LMS7Parameter EN_LB_LPFH_RBB = { 0x0115, 15, 15, 0, "EN_LB_LPFH_RBB", "" }; +const struct LMS7Parameter EN_LB_LPFL_RBB = { 0x0115, 14, 14, 0, "EN_LB_LPFL_RBB", "" }; +const struct LMS7Parameter PD_LPFH_RBB = { 0x0115, 3, 3, 1, "PD_LPFH_RBB", "Power down of the LPFH block" }; +const struct LMS7Parameter PD_LPFL_RBB = { 0x0115, 2, 2, 0, "PD_LPFL_RBB", "Power down of the LPFL block" }; +const struct LMS7Parameter PD_PGA_RBB = { 0x0115, 1, 1, 0, "PD_PGA_RBB", "Power down of the PGA block" }; +const struct LMS7Parameter EN_G_RBB = { 0x0115, 0, 0, 1, "EN_G_RBB", "Enable control for all the RBB_1 power downs" }; +const struct LMS7Parameter R_CTL_LPF_RBB = { 0x0116, 15, 11, 16, "R_CTL_LPF_RBB", "Controls the absolute value of the resistance of the RC time constant of the RBB_LPF blocks (both Low and High)" }; +const struct LMS7Parameter RCC_CTL_LPFH_RBB = { 0x0116, 10, 8, 1, "RCC_CTL_LPFH_RBB", "Controls the stability passive compensation of the LPFH_RBB operational amplifier" }; +const struct LMS7Parameter C_CTL_LPFH_RBB = { 0x0116, 7, 0, 128, "C_CTL_LPFH_RBB", "Controls the capacitance value of the RC time constant of RBB_LPFH and it varies with the respective rxMode from 37MHz to 108MHz" }; +const struct LMS7Parameter RCC_CTL_LPFL_RBB = { 0x0117, 13, 11, 5, "RCC_CTL_LPFL_RBB", "Controls the stability passive compensation of the LPFL_RBB operational amplifier" }; +const struct LMS7Parameter C_CTL_LPFL_RBB = { 0x0117, 10, 0, 12, "C_CTL_LPFL_RBB", "Controls the capacitance value of the RC time constant of RBB_LPFH and it varies with the respective rxMode from 1.4MHz to 20MHz." }; +const struct LMS7Parameter INPUT_CTL_PGA_RBB = { 0x0118, 15, 13, 0, "INPUT_CTL_PGA_RBB", "There are a total of four different differential inputs to the PGA. Only one of them is active at a time" }; +const struct LMS7Parameter ICT_LPF_IN_RBB = { 0x0118, 9, 5, 12, "ICT_LPF_IN_RBB", "Controls the reference bias current of the input stage of the operational amplifier used in RBB_LPF blocks (Low or High). " }; +const struct LMS7Parameter ICT_LPF_OUT_RBB = { 0x0118, 4, 0, 12, "ICT_LPF_OUT_RBB", "The reference bias current of the output stage of the operational amplifier used in RBB_LPF blocks (low or High)" }; +const struct LMS7Parameter OSW_PGA_RBB = { 0x0119, 15, 15, 0, "OSW_PGA_RBB", "There are two instances of the PGA circuit in the design. The output of the RBB_LPF blocks are connected the input of these PGA blocks (common). The output of one of them is connected to two pads pgaoutn and pgaoutp and the output of the other PGA is connected directly to the ADC input" }; +const struct LMS7Parameter ICT_PGA_OUT_RBB = { 0x0119, 14, 10, 6, "ICT_PGA_OUT_RBB", "Controls the output stage reference bias current of the operational amplifier used in the PGA circuit" }; +const struct LMS7Parameter ICT_PGA_IN_RBB = { 0x0119, 9, 5, 6, "ICT_PGA_IN_RBB", "Controls the input stage reference bias current of the operational amplifier used in the PGA circuit" }; +const struct LMS7Parameter G_PGA_RBB = { 0x0119, 4, 0, 11, "G_PGA_RBB", "This is the gain of the PGA" }; +const struct LMS7Parameter RCC_CTL_PGA_RBB = { 0x011A, 13, 9, 23, "RCC_CTL_PGA_RBB", "Controls the stability passive compensation of the PGA_RBB operational amplifier" }; +const struct LMS7Parameter C_CTL_PGA_RBB = { 0x011A, 6, 0, 2, "C_CTL_PGA_RBB", "Control the value of the feedback capacitor of the PGA that is used to help against the parasitic cap at the virtual node for stability" }; +const struct LMS7Parameter RESET_N = { 0x011C, 15, 15, 1, "RESET_N", "Resets SX. A pulse should be used in the start-up to reset" }; +const struct LMS7Parameter SPDUP_VCO = { 0x011C, 14, 14, 0, "SPDUP_VCO", "Bypasses the noise filter resistor for fast settling time. It should be connected to a 1uS pulse" }; +const struct LMS7Parameter BYPLDO_VCO = { 0x011C, 13, 13, 1, "BYPLDO_VCO", "Controls the bypass signal for the SX LDO" }; +const struct LMS7Parameter EN_COARSEPLL = { 0x011C, 12, 12, 0, "EN_COARSEPLL", "Enable signal for coarse tuning block" }; +const struct LMS7Parameter CURLIM_VCO = { 0x011C, 11, 11, 1, "CURLIM_VCO", "Enables the output current limitation in the VCO regulator" }; +const struct LMS7Parameter EN_DIV2_DIVPROG = { 0x011C, 10, 10, 1, "EN_DIV2_DIVPROG", "" }; +const struct LMS7Parameter EN_INTONLY_SDM = { 0x011C, 9, 9, 0, "EN_INTONLY_SDM", "Enables INTEGER-N mode of the SX " }; +const struct LMS7Parameter EN_SDM_CLK = { 0x011C, 8, 8, 1, "EN_SDM_CLK", "Enables/Disables SDM clock. In INT-N mode or for noise testing, SDM clock can be disabled" }; +const struct LMS7Parameter PD_FBDIV = { 0x011C, 7, 7, 0, "PD_FBDIV", "Power down the feedback divider block" }; +const struct LMS7Parameter PD_LOCH_T2RBUF = { 0x011C, 6, 6, 1, "PD_LOCH_T2RBUF", "Power down for LO buffer from SXT to SXR. To be active only in the TDD mode" }; +const struct LMS7Parameter PD_CP = { 0x011C, 5, 5, 0, "PD_CP", "Power down for Charge Pump" }; +const struct LMS7Parameter PD_FDIV = { 0x011C, 4, 4, 0, "PD_FDIV", "Power down for feedback frequency and forward dividers" }; +const struct LMS7Parameter PD_SDM = { 0x011C, 3, 3, 0, "PD_SDM", "Power down for SDM" }; +const struct LMS7Parameter PD_VCO_COMP = { 0x011C, 2, 2, 0, "PD_VCO_COMP", "Power down for VCO comparator" }; +const struct LMS7Parameter PD_VCO = { 0x011C, 1, 1, 1, "PD_VCO", "Power down for VCO" }; +const struct LMS7Parameter EN_G = { 0x011C, 0, 0, 1, "EN_G", "Enable control for all the SXT power downs" }; +const struct LMS7Parameter FRAC_SDM_LSB = { 0x011D, 15, 0, 0x0400, "FRAC_SDM_LSB", "" }; +const struct LMS7Parameter INT_SDM = { 0x011E, 13, 4, 120, "INT_SDM", "" }; +const struct LMS7Parameter FRAC_SDM_MSB = { 0x011E, 3, 0, 0, "FRAC_SDM_MSB", "" }; +const struct LMS7Parameter PW_DIV2_LOCH = { 0x011F, 14, 12, 3, "PW_DIV2_LOCH", "trims the duty cycle of DIV2 LOCH. Only works when forward divider is dividing by at least 2 (excluding quadrature block division). If in bypass mode, this does not work" }; +const struct LMS7Parameter PW_DIV4_LOCH = { 0x011F, 11, 9, 3, "PW_DIV4_LOCH", "trims the duty cycle of DIV4 LOCH. Only works when forward divider is dividing by at least 4 (excluding quadrature block division). If in bypass mode, this does not work" }; +const struct LMS7Parameter DIV_LOCH = { 0x011F, 8, 6, 1, "DIV_LOCH", "Controls the division ratio in the LOCH_DIV" }; +const struct LMS7Parameter TST_SX = { 0x011F, 5, 3, 0, "TST_SX", +"Controls the test mode of PLLs. TST signal lines are shared between all PLLs (CGEN, RX and TX). Only one TST signal of any PLL should be active at a given time.\n\ +0 - TST disabled; RSSI analog outputs enabled if RSSI blocks active and when all PLL test signals are off(default)\n\ +1 - tstdo[0] = VCO / 20 clock*; tstdo[1] = VCO / 40 clock*; tstao = High impedance;\n\ +2 - tstdo[0] = SDM clock; tstdo[1] = feedback divider output; tstao = VCO tune through a 60kOhm resistor;\n\ +3 - tstdo[0] = Reference clock; tstdo[1] = feedback divider output; tstao = VCO tune through a 10kOhm resistor;\n\ +4 - tstdo[0] = High impedance; tstdo[1] = High impedance; tstao = High impedance;\n\ +5 - tstdo[0] = Charge pump Down signal; tstdo[1] = Charge pump Up signal; tstao = High impedance;\n\ +6 - tstdo[0] = High impedance; tstdo[1] = High impedance; tstao = VCO tune through a 60kOhm resistor;\n\ +7 - tstdo[0] = High impedance; tstdo[1] = High impedance; tstao = VCO tune through a 10kOhm resistor;\n\ +if TST_SX[2] = 1 --> VCO_TSTBUF active generating VCO_TST_DIV20 and VCO_TST_DIV40\n\ +* When EN_DIV2_DIVPROG_(SXR, SXT) is active, the division ratio must be multiplied by 2 (40 / 80)"}; +const struct LMS7Parameter SEL_SDMCLK = { 0x011F, 2, 2, 0, "SEL_SDMCLK", "Selects between the feedback divider output and Fref for SDM" }; +const struct LMS7Parameter SX_DITHER_EN = { 0x011F, 1, 1, 0, "SX_DITHER_EN", "Enabled dithering in SDM" }; +const struct LMS7Parameter REV_SDMCLK = { 0x011F, 0, 0, 0, "REV_SDMCLK", "Reverses the SDM clock" }; +const struct LMS7Parameter VDIV_VCO = { 0x0120, 15, 8, 185, "VDIV_VCO", "Controls VCO LDO output voltage" }; +const struct LMS7Parameter ICT_VCO = { 0x0120, 7, 0, 255, "ICT_VCO", "Scales the VCO bias current from 0 to 2.5xInom" }; +const struct LMS7Parameter RSEL_LDO_VCO = { 0x0121, 15, 11, 6, "RSEL_LDO_VCO", "Set the reference voltage that supplies bias voltage of switch-cap array and varactor" }; +const struct LMS7Parameter CSW_VCO = { 0x0121, 10, 3, 128, "CSW_VCO", "Coarse control of VCO frequency, 0 for lowest frequency and 255 for highest. This control is set by SX_SWC_calibration" }; +const struct LMS7Parameter SEL_VCO = { 0x0121, 2, 1, 2, "SEL_VCO", "Selects the active VCO. It is set by SX_SWC_calibration" }; +const struct LMS7Parameter COARSE_START = { 0x0121, 0, 0, 0, "COARSE_START", "" }; +const struct LMS7Parameter REVPH_PFD = { 0x0122, 12, 12, 0, "REVPH_PFD", "Reverse the pulses of PFD. It can be used to reverse the polarity of the PLL loop (positive feedback to negative feedback)" }; +const struct LMS7Parameter IOFFSET_CP = { 0x0122, 11, 6, 12, "IOFFSET_CP", "Scales the offset current of the charge pump, 0-->63. This current is used in Fran-N mode to create an offset in the CP response and avoid the non-linear section" }; +const struct LMS7Parameter IPULSE_CP = { 0x0122, 5, 0, 63, "IPULSE_CP", "Scales the pulse current of the charge pump" }; +const struct LMS7Parameter COARSE_STEPDONE = { 0x0123, 15, 15, 0, "COARSE_STEPDONE", "" }; +const struct LMS7Parameter COARSEPLL_COMPO = { 0x0123, 14, 14, 0, "COARSEPLL_COMPO", "" }; +const struct LMS7Parameter VCO_CMPHO = { 0x0123, 13, 13, 0, "VCO_CMPHO", "" }; +const struct LMS7Parameter VCO_CMPLO = { 0x0123, 12, 12, 0, "VCO_CMPLO", "" }; +const struct LMS7Parameter CP2_PLL = { 0x0123, 11, 8, 6, "CP2_PLL", "Controls the value of CP2 (cap from CP output to GND) in the PLL filter" }; +const struct LMS7Parameter CP3_PLL = { 0x0123, 7, 4, 7, "CP3_PLL", "Controls the value of CP3 (cap from VCO Vtune input to GND) in the PLL filter" }; +const struct LMS7Parameter CZ = { 0x0123, 3, 0, 11, "CZ", "Controls the value of CZ (Zero capacitor) in the PLL filter" }; +const struct LMS7Parameter EN_DIR_SXRSXT = { 0x0124, 4, 4, 0, "EN_DIR_SXRSXT", "Enables direct control of PDs and ENs for SXR/SXT module" }; +const struct LMS7Parameter EN_DIR_RBB = { 0x0124, 3, 3, 0, "EN_DIR_RBB", "Enables direct control of PDs and ENs for RBB module" }; +const struct LMS7Parameter EN_DIR_RFE = { 0x0124, 2, 2, 0, "EN_DIR_RFE", "Enables direct control of PDs and ENs for RFE module" }; +const struct LMS7Parameter EN_DIR_TBB = { 0x0124, 1, 1, 0, "EN_DIR_TBB", "Enables direct control of PDs and ENs for TBB module" }; +const struct LMS7Parameter EN_DIR_TRF = { 0x0124, 0, 0, 0, "EN_DIR_TRF", "Enables direct control of PDs and ENs for TRF module" }; +const struct LMS7Parameter TSGFC_TXTSP = { 0x0200, 9, 9, 0, "TSGFC_TXTSP", "TSG full scale control" }; +const struct LMS7Parameter TSGFCW_TXTSP = { 0x0200, 8, 7, 1, "TSGFCW_TXTSP", "Set frequency of TSG's NCO" }; +const struct LMS7Parameter TSGDCLDQ_TXTSP = { 0x0200, 6, 6, 0, "TSGDCLDQ_TXTSP", "" }; +const struct LMS7Parameter TSGDCLDI_TXTSP = { 0x0200, 5, 5, 0, "TSGDCLDI_TXTSP", "" }; +const struct LMS7Parameter TSGSWAPIQ_TXTSP = { 0x0200, 4, 4, 0, "TSGSWAPIQ_TXTSP", "Swap signals at test signal generator's output" }; +const struct LMS7Parameter TSGMODE_TXTSP = { 0x0200, 3, 3, 0, "TSGMODE_TXTSP", "Test signal generator mode" }; +const struct LMS7Parameter INSEL_TXTSP = { 0x0200, 2, 2, 0, "INSEL_TXTSP", "Input source of TxTSP" }; +const struct LMS7Parameter BSTART_TXTSP = { 0x0200, 1, 1, 0, "BSTART_TXTSP", "Starts delta sigma built in self test. Keep it at 1 one at least three clock cycles" }; +const struct LMS7Parameter EN_TXTSP = { 0x0200, 0, 0, 1, "EN_TXTSP", "TxTSP modules enable" }; +const struct LMS7Parameter GCORRQ_TXTSP = { 0x0201, 10, 0, 2047, "GCORRQ_TXTSP", "corrector value, channel Q Unsigned integer" }; +const struct LMS7Parameter GCORRI_TXTSP = { 0x0202, 10, 0, 2047, "GCORRI_TXTSP", "corrector value, channel I Unsigned integer" }; +const struct LMS7Parameter HBI_OVR_TXTSP = { 0x0203, 14, 12, 0, "HBI_OVR_TXTSP", "HBI interpolation ratio" }; +const struct LMS7Parameter IQCORR_TXTSP = { 0x0203, 11, 0, 0, "IQCORR_TXTSP", "Phase corrector value (tan(Alpha/2)). Integer, 2's complement" }; +const struct LMS7Parameter DCCORRI_TXTSP = { 0x0204, 15, 8, 0, "DCCORRI_TXTSP", "DC corrector value, channel I. Integer, 2's complement" }; +const struct LMS7Parameter DCCORRQ_TXTSP = { 0x0204, 7, 0, 0, "DCCORRQ_TXTSP", "DC corrector value, channel Q. Integer, 2's complement" }; +const struct LMS7Parameter GFIR1_L_TXTSP = { 0x0205, 10, 8, 0, "GFIR1_L_TXTSP", "Parameter l of GFIR1 (l = roundUp(CoeffN/5)-1). Unsigned integer" }; +const struct LMS7Parameter GFIR1_N_TXTSP = { 0x0205, 7, 0, 0, "GFIR1_N_TXTSP", "Clock division ratio of GFIR1 is GFIR1_N + 1. Unsigned integer" }; +const struct LMS7Parameter GFIR2_L_TXTSP = { 0x0206, 10, 8, 0, "GFIR2_L_TXTSP", "Parameter l of GFIR2 (l = roundUp(CoeffN/5)-1). Unsigned integer" }; +const struct LMS7Parameter GFIR2_N_TXTSP = { 0x0206, 7, 0, 0, "GFIR2_N_TXTSP", "Clock division ratio of GFIR2 is GFIR2_N + 1. Unsigned integer" }; +const struct LMS7Parameter GFIR3_L_TXTSP = { 0x0207, 10, 8, 0, "GFIR3_L_TXTSP", "Parameter l of GFIR3 (l = roundUp(CoeffN/5)-1). Unsigned integer" }; +const struct LMS7Parameter GFIR3_N_TXTSP = { 0x0207, 7, 0, 0, "GFIR3_N_TXTSP", "Clock division ratio of GFIR3 is GFIR3_N + 1. Unsigned integer" }; +const struct LMS7Parameter CMIX_GAIN_TXTSP = { 0x0208, 15, 14, 0, "CMIX_GAIN_TXTSP", "Gain of CMIX output" }; +const struct LMS7Parameter CMIX_SC_TXTSP = { 0x0208, 13, 13, 0, "CMIX_SC_TXTSP", "Spectrum control of CMIX" }; +const struct LMS7Parameter CMIX_BYP_TXTSP = { 0x0208, 8, 8, 0, "CMIX_BYP_TXTSP", "CMIX bypass" }; +const struct LMS7Parameter ISINC_BYP_TXTSP = { 0x0208, 7, 7, 0, "ISINC_BYP_TXTSP", "ISINC bypass" }; +const struct LMS7Parameter GFIR3_BYP_TXTSP = { 0x0208, 6, 6, 0, "GFIR3_BYP_TXTSP", "GFIR3 bypass" }; +const struct LMS7Parameter GFIR2_BYP_TXTSP = { 0x0208, 5, 5, 0, "GFIR2_BYP_TXTSP", "GFIR2 bypass" }; +const struct LMS7Parameter GFIR1_BYP_TXTSP = { 0x0208, 4, 4, 0, "GFIR1_BYP_TXTSP", "GFIR1 bypass" }; +const struct LMS7Parameter DC_BYP_TXTSP = { 0x0208, 3, 3, 0, "DC_BYP_TXTSP", "DC corrector bypass" }; +const struct LMS7Parameter GC_BYP_TXTSP = { 0x0208, 1, 1, 0, "GC_BYP_TXTSP", "Gain corrector bypass" }; +const struct LMS7Parameter PH_BYP_TXTSP = { 0x0208, 0, 0, 0, "PH_BYP_TXTSP", "Phase corrector bypass" }; +const struct LMS7Parameter BSIGI_TXTSP = { 0x0209, 23, 1, 0, "BSIGI_TXTSP", "" }; +const struct LMS7Parameter BSTATE_TXTSP = { 0x0209, 0, 0, 0, "BSTATE_TXTSP", "" }; +const struct LMS7Parameter BSIGQ_TXTSP = { 0x020A, 30, 8, 0, "BSIGQ_TXTSP", "" }; +const struct LMS7Parameter DC_REG_TXTSP = { 0x020C, 15, 0, 0, "DC_REG_TXTSP", "" }; +const struct LMS7Parameter DTHBIT_TX = { 0x0240, 8, 5, 1, "DTHBIT_TX", "NCO bits to dither" }; +const struct LMS7Parameter SEL_TX = { 0x0240, 4, 1, 0, "SEL_TX", "" }; +const struct LMS7Parameter MODE_TX = { 0x0240, 0, 0, 0, "MODE_TX", "" }; +const struct LMS7Parameter CAPTURE = { 0x0400, 15, 15, 0, "CAPTURE", "" }; +const struct LMS7Parameter CAPSEL = { 0x0400, 14, 13, 0, "CAPSEL", "" }; +const struct LMS7Parameter CAPSEL_ADC = { 0x0400, 12, 12, 0, "CAPSEL_ADC", "" }; +const struct LMS7Parameter TSGFC_RXTSP = { 0x0400, 9, 9, 0, "TSGFC_RXTSP", "TSG full scale control" }; +const struct LMS7Parameter TSGFCW_RXTSP = { 0x0400, 8, 7, 1, "TSGFCW_RXTSP", "Set frequency of TSG's NCO" }; +const struct LMS7Parameter TSGDCLDQ_RXTSP = { 0x0400, 6, 6, 0, "TSGDCLDQ_RXTSP", "" }; +const struct LMS7Parameter TSGDCLDI_RXTSP = { 0x0400, 5, 5, 0, "TSGDCLDI_RXTSP", "" }; +const struct LMS7Parameter TSGSWAPIQ_RXTSP = { 0x0400, 4, 4, 0, "TSGSWAPIQ_RXTSP", "Swap signals at test signal generator's output" }; +const struct LMS7Parameter TSGMODE_RXTSP = { 0x0400, 3, 3, 0, "TSGMODE_RXTSP", "Test signal generator mode" }; +const struct LMS7Parameter INSEL_RXTSP = { 0x0400, 2, 2, 0, "INSEL_RXTSP", "Input source of RxTSP" }; +const struct LMS7Parameter BSTART_RXTSP = { 0x0400, 1, 1, 0, "BSTART_RXTSP", "Starts delta sigma built in self test. Keep it at 1 one at least three clock cycles" }; +const struct LMS7Parameter EN_RXTSP = { 0x0400, 0, 0, 1, "EN_RXTSP", "RxTSP modules enable" }; +const struct LMS7Parameter GCORRQ_RXTSP = { 0x0401, 10, 0, 2047, "GCORRQ_RXTSP", "corrector value, channel Q Unsigned integer" }; +const struct LMS7Parameter GCORRI_RXTSP = { 0x0402, 10, 0, 2047, "GCORRI_RXTSP", "corrector value, channel I Unsigned integer" }; +const struct LMS7Parameter HBD_OVR_RXTSP = { 0x0403, 14, 12, 0, "HBD_OVR_RXTSP", "HBD interpolation ratio. Interpolation ratio is 2HBD_OVR+1" }; +const struct LMS7Parameter IQCORR_RXTSP = { 0x0403, 11, 0, 0, "IQCORR_RXTSP", "Phase corrector value (tan(Alpha/2)). Integer, 2's complement" }; +const struct LMS7Parameter HBD_DLY = { 0x0404, 15, 13, 0, "HBD_DLY", "" }; +const struct LMS7Parameter DCLOOP_BYP = { 0x0404, 8, 8, 0, "DCLOOP_BYP", "" }; +const struct LMS7Parameter DCCORR_AVG_RXTSP = { 0x0404, 2, 0, 0, "DCCORR_AVG_RXTSP", "Number of samples to average for Automatic DC corrector. Number of samples to average is 2DCCORR_AVG + 12" }; +const struct LMS7Parameter GFIR1_L_RXTSP = { 0x0405, 10, 8, 0, "GFIR1_L_RXTSP", "Parameter l of GFIR1 (l = roundUp(CoeffN/5)-1). Unsigned integer" }; +const struct LMS7Parameter GFIR1_N_RXTSP = { 0x0405, 7, 0, 0, "GFIR1_N_RXTSP", "Clock division ratio of GFIR1 is GFIR1_N + 1. Unsigned integer" }; +const struct LMS7Parameter GFIR2_L_RXTSP = { 0x0406, 10, 8, 0, "GFIR2_L_RXTSP", "Parameter l of GFIR2 (l = roundUp(CoeffN/5)-1). Unsigned integer" }; +const struct LMS7Parameter GFIR2_N_RXTSP = { 0x0406, 7, 0, 0, "GFIR2_N_RXTSP", "Clock division ratio of GFIR2 is GFIR2_N + 1. Unsigned integer" }; +const struct LMS7Parameter GFIR3_L_RXTSP = { 0x0407, 10, 8, 0, "GFIR3_L_RXTSP", "Parameter l of GFIR3 (l = roundUp(CoeffN/5)-1). Unsigned integer" }; +const struct LMS7Parameter GFIR3_N_RXTSP = { 0x0407, 7, 0, 0, "GFIR3_N_RXTSP", "Clock division ratio of GFIR3 is GFIR3_N + 1. Unsigned integer" }; +const struct LMS7Parameter AGC_K_RXTSP = { 0x0408, 17, 0, 0, "AGC_K_RXTSP", "AGC loop gain" }; +const struct LMS7Parameter AGC_ADESIRED_RXTSP = { 0x0409, 15, 4, 0, "AGC_ADESIRED_RXTSP", "AGC_ADESIRED" }; +const struct LMS7Parameter RSSI_MODE = { 0x040A, 15, 14, 0, "RSSI_MODE", "" }; +const struct LMS7Parameter AGC_MODE_RXTSP = { 0x040A, 13, 12, 0, "AGC_MODE_RXTSP", "" }; +const struct LMS7Parameter AGC_AVG_RXTSP = { 0x040A, 2, 0, 0, "AGC_AVG_RXTSP", "AGC Averaging window size" }; +const struct LMS7Parameter DC_REG_RXTSP = { 0x040B, 15, 0, 0, "DC_REG_RXTSP", "" }; +const struct LMS7Parameter CMIX_GAIN_RXTSP = { 0x040C, 15, 14, 0, "CMIX_GAIN_RXTSP", "Gain of CMIX output" }; +const struct LMS7Parameter CMIX_SC_RXTSP = { 0x040C, 13, 13, 0, "CMIX_SC_RXTSP", "Spectrum control of CMIX" }; +const struct LMS7Parameter CMIX_BYP_RXTSP = { 0x040C, 7, 7, 0, "CMIX_BYP_RXTSP", "CMIX bypass" }; +const struct LMS7Parameter AGC_BYP_RXTSP = { 0x040C, 6, 6, 0, "AGC_BYP_RXTSP", "AGC bypass" }; +const struct LMS7Parameter GFIR3_BYP_RXTSP = { 0x040C, 5, 5, 0, "GFIR3_BYP_RXTSP", "GFIR3 bypass" }; +const struct LMS7Parameter GFIR2_BYP_RXTSP = { 0x040C, 4, 4, 0, "GFIR2_BYP_RXTSP", "GFIR2 bypass" }; +const struct LMS7Parameter GFIR1_BYP_RXTSP = { 0x040C, 3, 3, 0, "GFIR1_BYP_RXTSP", "GFIR1 bypass" }; +const struct LMS7Parameter DC_BYP_RXTSP = { 0x040C, 2, 2, 0, "DC_BYP_RXTSP", "DC corrector bypass" }; +const struct LMS7Parameter GC_BYP_RXTSP = { 0x040C, 1, 1, 0, "GC_BYP_RXTSP", "Gain corrector bypass" }; +const struct LMS7Parameter PH_BYP_RXTSP = { 0x040C, 0, 0, 0, "PH_BYP_RXTSP", "Phase corrector bypass" }; +const struct LMS7Parameter CAPD = { 0x040E, 31, 0, 0, "CAPD", "" }; +const struct LMS7Parameter DTHBIT_RX = { 0x0440, 8, 5, 1, "DTHBIT_RX", "NCO bits to dither" }; +const struct LMS7Parameter SEL_RX = { 0x0440, 4, 1, 0, "SEL_RX", "" }; +const struct LMS7Parameter MODE_RX = { 0x0440, 0, 0, 0, "MODE_RX", "" }; diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/LMS7002M_parameters.h b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/LMS7002M_parameters.h new file mode 100644 index 0000000000000000000000000000000000000000..3fc4e0be6bbc956592d42cc99ae00b95851805af --- /dev/null +++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/LMS7002M_parameters.h @@ -0,0 +1,613 @@ +/** +@file LMS7002M_parameters.h +@author Lime Microsystems (www.limemicro.com) +@brief List of LMS7002M transceiver control parameters +*/ + +#ifndef LMS7002M_PARAMETERS_H +#define LMS7002M_PARAMETERS_H + +#include "typedefs.h" +#include <vector> + +struct LMS7Parameter; +extern std::vector<const LMS7Parameter*> LMS7parameterList; + +struct LMS7Parameter +{ + LMS7Parameter() : address(0), msb(0), lsb(0), defaultValue(0), name(nullptr), tooltip(nullptr) + { + } + + LMS7Parameter(uint16_t address, uint8_t msb, uint8_t lsb, uint16_t defaultValue, const char *name, const char* tooltip) + : address(address), msb(msb), lsb(lsb), defaultValue(defaultValue), name(name), tooltip(tooltip) + { + LMS7parameterList.push_back(this); + } + + uint16_t address; + uint8_t msb; + uint8_t lsb; + uint16_t defaultValue; + const char* name; + const char* tooltip; + inline bool operator==(const LMS7Parameter& obj) + { + if (address == obj.address && msb == obj.msb && lsb == obj.lsb) + return true; + return false; + }; +}; + +extern const struct LMS7Parameter LRST_TX_B; +extern const struct LMS7Parameter MRST_TX_B; +extern const struct LMS7Parameter LRST_TX_A; +extern const struct LMS7Parameter MRST_TX_A; +extern const struct LMS7Parameter LRST_RX_B; +extern const struct LMS7Parameter MRST_RX_B; +extern const struct LMS7Parameter LRST_RX_A; +extern const struct LMS7Parameter MRST_RX_A; +extern const struct LMS7Parameter SRST_RXFIFO; +extern const struct LMS7Parameter SRST_TXFIFO; +extern const struct LMS7Parameter RXEN_B; +extern const struct LMS7Parameter RXEN_A; +extern const struct LMS7Parameter TXEN_B; +extern const struct LMS7Parameter TXEN_A; +extern const struct LMS7Parameter MAC; +extern const struct LMS7Parameter TX_CLK_PE; +extern const struct LMS7Parameter RX_CLK_PE; +extern const struct LMS7Parameter SDA_PE; +extern const struct LMS7Parameter SDA_DS; +extern const struct LMS7Parameter SCL_PE; +extern const struct LMS7Parameter SCL_DS; +extern const struct LMS7Parameter SDIO_DS; +extern const struct LMS7Parameter SDIO_PE; +extern const struct LMS7Parameter SDO_PE; +extern const struct LMS7Parameter SCLK_PE; +extern const struct LMS7Parameter SEN_PE; +extern const struct LMS7Parameter SPIMODE; +extern const struct LMS7Parameter DIQ2_DS; +extern const struct LMS7Parameter DIQ2_PE; +extern const struct LMS7Parameter IQ_SEL_EN_2_PE; +extern const struct LMS7Parameter TXNRX2_PE; +extern const struct LMS7Parameter FCLK2_PE; +extern const struct LMS7Parameter MCLK2_PE; +extern const struct LMS7Parameter DIQ1_DS; +extern const struct LMS7Parameter DIQ1_PE; +extern const struct LMS7Parameter IQ_SEL_EN_1_PE; +extern const struct LMS7Parameter TXNRX1_PE; +extern const struct LMS7Parameter FCLK1_PE; +extern const struct LMS7Parameter MCLK1_PE; +extern const struct LMS7Parameter DIQDIRCTR2; +extern const struct LMS7Parameter DIQDIR2; +extern const struct LMS7Parameter DIQDIRCTR1; +extern const struct LMS7Parameter DIQDIR1; +extern const struct LMS7Parameter ENABLEDIRCTR2; +extern const struct LMS7Parameter ENABLEDIR2; +extern const struct LMS7Parameter ENABLEDIRCTR1; +extern const struct LMS7Parameter ENABLEDIR1; +extern const struct LMS7Parameter MOD_EN; +extern const struct LMS7Parameter LML2_FIDM; +extern const struct LMS7Parameter LML2_TXNRXIQ; +extern const struct LMS7Parameter LML2_MODE; +extern const struct LMS7Parameter LML1_FIDM; +extern const struct LMS7Parameter LML1_TXNRXIQ; +extern const struct LMS7Parameter LML1_MODE; +extern const struct LMS7Parameter LML1_S3S; +extern const struct LMS7Parameter LML1_S2S; +extern const struct LMS7Parameter LML1_S1S; +extern const struct LMS7Parameter LML1_S0S; +extern const struct LMS7Parameter LML1_BQP; +extern const struct LMS7Parameter LML1_BIP; +extern const struct LMS7Parameter LML1_AQP; +extern const struct LMS7Parameter LML1_AIP; +extern const struct LMS7Parameter LML1_BB2RF_PST; +extern const struct LMS7Parameter LML1_BB2RF_PRE; +extern const struct LMS7Parameter LML1_RF2BB_PST; +extern const struct LMS7Parameter LML1_RF2BB_PRE; +extern const struct LMS7Parameter LML2_S3S; +extern const struct LMS7Parameter LML2_S2S; +extern const struct LMS7Parameter LML2_S1S; +extern const struct LMS7Parameter LML2_S0S; +extern const struct LMS7Parameter LML2_BQP; +extern const struct LMS7Parameter LML2_BIP; +extern const struct LMS7Parameter LML2_AQP; +extern const struct LMS7Parameter LML2_AIP; +extern const struct LMS7Parameter LML2_BB2RF_PST; +extern const struct LMS7Parameter LML2_BB2RF_PRE; +extern const struct LMS7Parameter LML2_RF2BB_PST; +extern const struct LMS7Parameter LML2_RF2BB_PRE; +extern const struct LMS7Parameter FCLK2_DLY; +extern const struct LMS7Parameter FCLK1_DLY; +extern const struct LMS7Parameter RX_MUX; +extern const struct LMS7Parameter TX_MUX; +extern const struct LMS7Parameter TXRDCLK_MUX; +extern const struct LMS7Parameter TXWRCLK_MUX; +extern const struct LMS7Parameter RXRDCLK_MUX; +extern const struct LMS7Parameter RXWRCLK_MUX; +extern const struct LMS7Parameter FCLK2_INV; +extern const struct LMS7Parameter FCLK1_INV; +extern const struct LMS7Parameter MCLK2DLY; +extern const struct LMS7Parameter MCLK1DLY; +extern const struct LMS7Parameter MCLK2SRC; +extern const struct LMS7Parameter MCLK1SRC; +extern const struct LMS7Parameter TXDIVEN; +extern const struct LMS7Parameter RXDIVEN; +extern const struct LMS7Parameter TXTSPCLKA_DIV; +extern const struct LMS7Parameter RXTSPCLKA_DIV; +extern const struct LMS7Parameter MIMO_SISO; +extern const struct LMS7Parameter VER; +extern const struct LMS7Parameter REV; +extern const struct LMS7Parameter MASK; +extern const struct LMS7Parameter EN_DIR_LDO; +extern const struct LMS7Parameter EN_DIR_CGEN; +extern const struct LMS7Parameter EN_DIR_XBUF; +extern const struct LMS7Parameter EN_DIR_AFE; +extern const struct LMS7Parameter ISEL_DAC_AFE; +extern const struct LMS7Parameter MODE_INTERLEAVE_AFE; +extern const struct LMS7Parameter MUX_AFE_1; +extern const struct LMS7Parameter MUX_AFE_2; +extern const struct LMS7Parameter PD_AFE; +extern const struct LMS7Parameter PD_RX_AFE1; +extern const struct LMS7Parameter PD_RX_AFE2; +extern const struct LMS7Parameter PD_TX_AFE1; +extern const struct LMS7Parameter PD_TX_AFE2; +extern const struct LMS7Parameter EN_G_AFE; +extern const struct LMS7Parameter MUX_BIAS_OUT; +extern const struct LMS7Parameter RP_CALIB_BIAS; +extern const struct LMS7Parameter PD_FRP_BIAS; +extern const struct LMS7Parameter PD_F_BIAS; +extern const struct LMS7Parameter PD_PTRP_BIAS; +extern const struct LMS7Parameter PD_PT_BIAS; +extern const struct LMS7Parameter PD_BIAS_MASTER; +extern const struct LMS7Parameter SLFB_XBUF_RX; +extern const struct LMS7Parameter SLFB_XBUF_TX; +extern const struct LMS7Parameter BYP_XBUF_RX; +extern const struct LMS7Parameter BYP_XBUF_TX; +extern const struct LMS7Parameter EN_OUT2_XBUF_TX; +extern const struct LMS7Parameter EN_TBUFIN_XBUF_RX; +extern const struct LMS7Parameter PD_XBUF_RX; +extern const struct LMS7Parameter PD_XBUF_TX; +extern const struct LMS7Parameter EN_G_XBUF; +extern const struct LMS7Parameter SPDUP_VCO_CGEN; +extern const struct LMS7Parameter RESET_N_CGEN; +extern const struct LMS7Parameter EN_ADCCLKH_CLKGN; +extern const struct LMS7Parameter EN_COARSE_CKLGEN; +extern const struct LMS7Parameter EN_INTONLY_SDM_CGEN; +extern const struct LMS7Parameter EN_SDM_CLK_CGEN; +extern const struct LMS7Parameter PD_CP_CGEN; +extern const struct LMS7Parameter PD_FDIV_FB_CGEN; +extern const struct LMS7Parameter PD_FDIV_O_CGEN; +extern const struct LMS7Parameter PD_SDM_CGEN; +extern const struct LMS7Parameter PD_VCO_CGEN; +extern const struct LMS7Parameter PD_VCO_COMP_CGEN; +extern const struct LMS7Parameter EN_G_CGEN; +extern const struct LMS7Parameter FRAC_SDM_CGEN_LSB; +extern const struct LMS7Parameter INT_SDM_CGEN; +extern const struct LMS7Parameter FRAC_SDM_CGEN_MSB; +extern const struct LMS7Parameter REV_SDMCLK_CGEN; +extern const struct LMS7Parameter SEL_SDMCLK_CGEN; +extern const struct LMS7Parameter SX_DITHER_EN_CGEN; +extern const struct LMS7Parameter CLKH_OV_CLKL_CGEN; +extern const struct LMS7Parameter DIV_OUTCH_CGEN; +extern const struct LMS7Parameter TST_CGEN; +extern const struct LMS7Parameter REV_CLKDAC_CGEN; +extern const struct LMS7Parameter CMPLO_CTRL_CGEN; +extern const struct LMS7Parameter REV_CLKADC_CGEN; +extern const struct LMS7Parameter REVPH_PFD_CGEN; +extern const struct LMS7Parameter IOFFSET_CP_CGEN; +extern const struct LMS7Parameter IPULSE_CP_CGEN; +extern const struct LMS7Parameter ICT_VCO_CGEN; +extern const struct LMS7Parameter CSW_VCO_CGEN; +extern const struct LMS7Parameter COARSE_START_CGEN; +extern const struct LMS7Parameter COARSE_STEPDONE_CGEN; +extern const struct LMS7Parameter COARSEPLL_COMPO_CGEN; +extern const struct LMS7Parameter VCO_CMPHO_CGEN; +extern const struct LMS7Parameter VCO_CMPLO_CGEN; +extern const struct LMS7Parameter CP2_CGEN; +extern const struct LMS7Parameter CP3_CGEN; +extern const struct LMS7Parameter CZ_CGEN; +extern const struct LMS7Parameter EN_LDO_DIG; +extern const struct LMS7Parameter EN_LDO_DIGGN; +extern const struct LMS7Parameter EN_LDO_DIGSXR; +extern const struct LMS7Parameter EN_LDO_DIGSXT; +extern const struct LMS7Parameter EN_LDO_DIVGN; +extern const struct LMS7Parameter EN_LDO_DIVSXR; +extern const struct LMS7Parameter EN_LDO_DIVSXT; +extern const struct LMS7Parameter EN_LDO_LNA12; +extern const struct LMS7Parameter EN_LDO_LNA14; +extern const struct LMS7Parameter EN_LDO_MXRFE; +extern const struct LMS7Parameter EN_LDO_RBB; +extern const struct LMS7Parameter EN_LDO_RXBUF; +extern const struct LMS7Parameter EN_LDO_TBB; +extern const struct LMS7Parameter EN_LDO_TIA12; +extern const struct LMS7Parameter EN_LDO_TIA14; +extern const struct LMS7Parameter EN_G_LDO; +extern const struct LMS7Parameter EN_LOADIMP_LDO_TLOB; +extern const struct LMS7Parameter EN_LOADIMP_LDO_TPAD; +extern const struct LMS7Parameter EN_LOADIMP_LDO_TXBUF; +extern const struct LMS7Parameter EN_LOADIMP_LDO_VCOGN; +extern const struct LMS7Parameter EN_LOADIMP_LDO_VCOSXR; +extern const struct LMS7Parameter EN_LOADIMP_LDO_VCOSXT; +extern const struct LMS7Parameter EN_LDO_AFE; +extern const struct LMS7Parameter EN_LDO_CPGN; +extern const struct LMS7Parameter EN_LDO_CPSXR; +extern const struct LMS7Parameter EN_LDO_TLOB; +extern const struct LMS7Parameter EN_LDO_TPAD; +extern const struct LMS7Parameter EN_LDO_TXBUF; +extern const struct LMS7Parameter EN_LDO_VCOGN; +extern const struct LMS7Parameter EN_LDO_VCOSXR; +extern const struct LMS7Parameter EN_LDO_VCOSXT; +extern const struct LMS7Parameter EN_LDO_CPSXT; +extern const struct LMS7Parameter EN_LOADIMP_LDO_CPSXT; +extern const struct LMS7Parameter EN_LOADIMP_LDO_DIG; +extern const struct LMS7Parameter EN_LOADIMP_LDO_DIGGN; +extern const struct LMS7Parameter EN_LOADIMP_LDO_DIGSXR; +extern const struct LMS7Parameter EN_LOADIMP_LDO_DIGSXT; +extern const struct LMS7Parameter EN_LOADIMP_LDO_DIVGN; +extern const struct LMS7Parameter EN_LOADIMP_LDO_DIVSXR; +extern const struct LMS7Parameter EN_LOADIMP_LDO_DIVSXT; +extern const struct LMS7Parameter EN_LOADIMP_LDO_LNA12; +extern const struct LMS7Parameter EN_LOADIMP_LDO_LNA14; +extern const struct LMS7Parameter EN_LOADIMP_LDO_MXRFE; +extern const struct LMS7Parameter EN_LOADIMP_LDO_RBB; +extern const struct LMS7Parameter EN_LOADIMP_LDO_RXBUF; +extern const struct LMS7Parameter EN_LOADIMP_LDO_TBB; +extern const struct LMS7Parameter EN_LOADIMP_LDO_TIA12; +extern const struct LMS7Parameter EN_LOADIMP_LDO_TIA14; +extern const struct LMS7Parameter BYP_LDO_TBB; +extern const struct LMS7Parameter BYP_LDO_TIA12; +extern const struct LMS7Parameter BYP_LDO_TIA14; +extern const struct LMS7Parameter BYP_LDO_TLOB; +extern const struct LMS7Parameter BYP_LDO_TPAD; +extern const struct LMS7Parameter BYP_LDO_TXBUF; +extern const struct LMS7Parameter BYP_LDO_VCOGN; +extern const struct LMS7Parameter BYP_LDO_VCOSXR; +extern const struct LMS7Parameter BYP_LDO_VCOSXT; +extern const struct LMS7Parameter EN_LOADIMP_LDO_AFE; +extern const struct LMS7Parameter EN_LOADIMP_LDO_CPGN; +extern const struct LMS7Parameter EN_LOADIMP_LDO_CPSXR; +extern const struct LMS7Parameter BYP_LDO_AFE; +extern const struct LMS7Parameter BYP_LDO_CPGN; +extern const struct LMS7Parameter BYP_LDO_CPSXR; +extern const struct LMS7Parameter BYP_LDO_CPSXT; +extern const struct LMS7Parameter BYP_LDO_DIG; +extern const struct LMS7Parameter BYP_LDO_DIGGN; +extern const struct LMS7Parameter BYP_LDO_DIGSXR; +extern const struct LMS7Parameter BYP_LDO_DIGSXT; +extern const struct LMS7Parameter BYP_LDO_DIVGN; +extern const struct LMS7Parameter BYP_LDO_DIVSXR; +extern const struct LMS7Parameter BYP_LDO_DIVSXT; +extern const struct LMS7Parameter BYP_LDO_LNA12; +extern const struct LMS7Parameter BYP_LDO_LNA14; +extern const struct LMS7Parameter BYP_LDO_MXRFE; +extern const struct LMS7Parameter BYP_LDO_RBB; +extern const struct LMS7Parameter BYP_LDO_RXBUF; +extern const struct LMS7Parameter SPDUP_LDO_DIVSXR; +extern const struct LMS7Parameter SPDUP_LDO_DIVSXT; +extern const struct LMS7Parameter SPDUP_LDO_LNA12; +extern const struct LMS7Parameter SPDUP_LDO_LNA14; +extern const struct LMS7Parameter SPDUP_LDO_MXRFE; +extern const struct LMS7Parameter SPDUP_LDO_RBB; +extern const struct LMS7Parameter SPDUP_LDO_RXBUF; +extern const struct LMS7Parameter SPDUP_LDO_TBB; +extern const struct LMS7Parameter SPDUP_LDO_TIA12; +extern const struct LMS7Parameter SPDUP_LDO_TIA14; +extern const struct LMS7Parameter SPDUP_LDO_TLOB; +extern const struct LMS7Parameter SPDUP_LDO_TPAD; +extern const struct LMS7Parameter SPDUP_LDO_TXBUF; +extern const struct LMS7Parameter SPDUP_LDO_VCOGN; +extern const struct LMS7Parameter SPDUP_LDO_VCOSXR; +extern const struct LMS7Parameter SPDUP_LDO_VCOSXT; +extern const struct LMS7Parameter SPDUP_LDO_AFE; +extern const struct LMS7Parameter SPDUP_LDO_CPGN; +extern const struct LMS7Parameter SPDUP_LDO_CPSXR; +extern const struct LMS7Parameter SPDUP_LDO_CPSXT; +extern const struct LMS7Parameter SPDUP_LDO_DIG; +extern const struct LMS7Parameter SPDUP_LDO_DIGGN; +extern const struct LMS7Parameter SPDUP_LDO_DIGSXR; +extern const struct LMS7Parameter SPDUP_LDO_DIGSXT; +extern const struct LMS7Parameter SPDUP_LDO_DIVGN; +extern const struct LMS7Parameter RDIV_VCOSXR; +extern const struct LMS7Parameter RDIV_VCOSXT; +extern const struct LMS7Parameter RDIV_TXBUF; +extern const struct LMS7Parameter RDIV_VCOGN; +extern const struct LMS7Parameter RDIV_TLOB; +extern const struct LMS7Parameter RDIV_TPAD; +extern const struct LMS7Parameter RDIV_TIA12; +extern const struct LMS7Parameter RDIV_TIA14; +extern const struct LMS7Parameter RDIV_RXBUF; +extern const struct LMS7Parameter RDIV_TBB; +extern const struct LMS7Parameter RDIV_MXRFE; +extern const struct LMS7Parameter RDIV_RBB; +extern const struct LMS7Parameter RDIV_LNA12; +extern const struct LMS7Parameter RDIV_LNA14; +extern const struct LMS7Parameter RDIV_DIVSXR; +extern const struct LMS7Parameter RDIV_DIVSXT; +extern const struct LMS7Parameter RDIV_DIGSXT; +extern const struct LMS7Parameter RDIV_DIVGN; +extern const struct LMS7Parameter RDIV_DIGGN; +extern const struct LMS7Parameter RDIV_DIGSXR; +extern const struct LMS7Parameter RDIV_CPSXT; +extern const struct LMS7Parameter RDIV_DIG; +extern const struct LMS7Parameter RDIV_CPGN; +extern const struct LMS7Parameter RDIV_CPSXR; +extern const struct LMS7Parameter RDIV_SPIBUF; +extern const struct LMS7Parameter RDIV_AFE; +extern const struct LMS7Parameter SPDUP_LDO_SPIBUF; +extern const struct LMS7Parameter SPDUP_LDO_DIGIp2; +extern const struct LMS7Parameter SPDUP_LDO_DIGIp1; +extern const struct LMS7Parameter BYP_LDO_SPIBUF; +extern const struct LMS7Parameter BYP_LDO_DIGIp2; +extern const struct LMS7Parameter BYP_LDO_DIGIp1; +extern const struct LMS7Parameter EN_LOADIMP_LDO_SPIBUF; +extern const struct LMS7Parameter EN_LOADIMP_LDO_DIGIp2; +extern const struct LMS7Parameter EN_LOADIMP_LDO_DIGIp1; +extern const struct LMS7Parameter PD_LDO_SPIBUF; +extern const struct LMS7Parameter PD_LDO_DIGIp2; +extern const struct LMS7Parameter PD_LDO_DIGIp1; +extern const struct LMS7Parameter EN_G_LDOP; +extern const struct LMS7Parameter RDIV_DIGIp2; +extern const struct LMS7Parameter RDIV_DIGIp1; +extern const struct LMS7Parameter BSIGT; +extern const struct LMS7Parameter BSTATE; +extern const struct LMS7Parameter EN_SDM_TSTO_SXT; +extern const struct LMS7Parameter EN_SDM_TSTO_SXR; +extern const struct LMS7Parameter EN_SDM_TSTO_CGEN; +extern const struct LMS7Parameter BENC; +extern const struct LMS7Parameter BENR; +extern const struct LMS7Parameter BENT; +extern const struct LMS7Parameter BSTART; +extern const struct LMS7Parameter BSIGR; +extern const struct LMS7Parameter BSIGC; +extern const struct LMS7Parameter CDS_MCLK2; +extern const struct LMS7Parameter CDS_MCLK1; +extern const struct LMS7Parameter CDSN_TXBTSP; +extern const struct LMS7Parameter CDSN_TXATSP; +extern const struct LMS7Parameter CDSN_RXBTSP; +extern const struct LMS7Parameter CDSN_RXATSP; +extern const struct LMS7Parameter CDSN_TXBLML; +extern const struct LMS7Parameter CDSN_TXALML; +extern const struct LMS7Parameter CDSN_RXBLML; +extern const struct LMS7Parameter CDSN_RXALML; +extern const struct LMS7Parameter CDSN_MCLK2; +extern const struct LMS7Parameter CDSN_MCLK1; +extern const struct LMS7Parameter CDS_TXBTSP; +extern const struct LMS7Parameter CDS_TXATSP; +extern const struct LMS7Parameter CDS_RXBTSP; +extern const struct LMS7Parameter CDS_RXATSP; +extern const struct LMS7Parameter CDS_TXBLML; +extern const struct LMS7Parameter CDS_TXALML; +extern const struct LMS7Parameter CDS_RXBLML; +extern const struct LMS7Parameter CDS_RXALML; +extern const struct LMS7Parameter EN_LOWBWLOMX_TMX_TRF; +extern const struct LMS7Parameter EN_NEXTTX_TRF; +extern const struct LMS7Parameter EN_AMPHF_PDET_TRF; +extern const struct LMS7Parameter LOADR_PDET_TRF; +extern const struct LMS7Parameter PD_PDET_TRF; +extern const struct LMS7Parameter PD_TLOBUF_TRF; +extern const struct LMS7Parameter PD_TXPAD_TRF; +extern const struct LMS7Parameter EN_G_TRF; +extern const struct LMS7Parameter F_TXPAD_TRF; +extern const struct LMS7Parameter L_LOOPB_TXPAD_TRF; +extern const struct LMS7Parameter LOSS_LIN_TXPAD_TRF; +extern const struct LMS7Parameter LOSS_MAIN_TXPAD_TRF; +extern const struct LMS7Parameter EN_LOOPB_TXPAD_TRF; +extern const struct LMS7Parameter GCAS_GNDREF_TXPAD_TRF; +extern const struct LMS7Parameter ICT_LIN_TXPAD_TRF; +extern const struct LMS7Parameter ICT_MAIN_TXPAD_TRF; +extern const struct LMS7Parameter VGCAS_TXPAD_TRF; +extern const struct LMS7Parameter SEL_BAND1_TRF; +extern const struct LMS7Parameter SEL_BAND2_TRF; +extern const struct LMS7Parameter LOBIASN_TXM_TRF; +extern const struct LMS7Parameter LOBIASP_TXX_TRF; +extern const struct LMS7Parameter CDC_I_TRF; +extern const struct LMS7Parameter CDC_Q_TRF; +extern const struct LMS7Parameter STATPULSE_TBB; +extern const struct LMS7Parameter LOOPB_TBB; +extern const struct LMS7Parameter PD_LPFH_TBB; +extern const struct LMS7Parameter PD_LPFIAMP_TBB; +extern const struct LMS7Parameter PD_LPFLAD_TBB; +extern const struct LMS7Parameter PD_LPFS5_TBB; +extern const struct LMS7Parameter EN_G_TBB; +extern const struct LMS7Parameter ICT_LPFS5_F_TBB; +extern const struct LMS7Parameter ICT_LPFS5_PT_TBB; +extern const struct LMS7Parameter ICT_LPF_H_PT_TBB; +extern const struct LMS7Parameter ICT_LPFH_F_TBB; +extern const struct LMS7Parameter ICT_LPFLAD_F_TBB; +extern const struct LMS7Parameter ICT_LPFLAD_PT_TBB; +extern const struct LMS7Parameter CG_IAMP_TBB; +extern const struct LMS7Parameter ICT_IAMP_FRP_TBB; +extern const struct LMS7Parameter ICT_IAMP_GG_FRP_TBB; +extern const struct LMS7Parameter RCAL_LPFH_TBB; +extern const struct LMS7Parameter RCAL_LPFLAD_TBB; +extern const struct LMS7Parameter TSTIN_TBB; +extern const struct LMS7Parameter BYPLADDER_TBB; +extern const struct LMS7Parameter CCAL_LPFLAD_TBB; +extern const struct LMS7Parameter RCAL_LPFS5_TBB; +extern const struct LMS7Parameter CDC_I_RFE; +extern const struct LMS7Parameter CDC_Q_RFE; +extern const struct LMS7Parameter PD_LNA_RFE; +extern const struct LMS7Parameter PD_RLOOPB_1_RFE; +extern const struct LMS7Parameter PD_RLOOPB_2_RFE; +extern const struct LMS7Parameter PD_MXLOBUF_RFE; +extern const struct LMS7Parameter PD_QGEN_RFE; +extern const struct LMS7Parameter PD_RSSI_RFE; +extern const struct LMS7Parameter PD_TIA_RFE; +extern const struct LMS7Parameter EN_G_RFE; +extern const struct LMS7Parameter SEL_PATH_RFE; +extern const struct LMS7Parameter EN_DCOFF_RXFE_RFE; +extern const struct LMS7Parameter EN_INSHSW_LB1_RFE; +extern const struct LMS7Parameter EN_INSHSW_LB2_RFE; +extern const struct LMS7Parameter EN_INSHSW_L_RFE; +extern const struct LMS7Parameter EN_INSHSW_W_RFE; +extern const struct LMS7Parameter EN_NEXTRX_RFE; +extern const struct LMS7Parameter DCOFFI_RFE; +extern const struct LMS7Parameter DCOFFQ_RFE; +extern const struct LMS7Parameter ICT_LOOPB_RFE; +extern const struct LMS7Parameter ICT_TIAMAIN_RFE; +extern const struct LMS7Parameter ICT_TIAOUT_RFE; +extern const struct LMS7Parameter ICT_LNACMO_RFE; +extern const struct LMS7Parameter ICT_LNA_RFE; +extern const struct LMS7Parameter ICT_LODC_RFE; +extern const struct LMS7Parameter CAP_RXMXO_RFE; +extern const struct LMS7Parameter CGSIN_LNA_RFE; +extern const struct LMS7Parameter CCOMP_TIA_RFE; +extern const struct LMS7Parameter CFB_TIA_RFE; +extern const struct LMS7Parameter G_LNA_RFE; +extern const struct LMS7Parameter G_RXLOOPB_RFE; +extern const struct LMS7Parameter G_TIA_RFE; +extern const struct LMS7Parameter RCOMP_TIA_RFE; +extern const struct LMS7Parameter RFB_TIA_RFE; +extern const struct LMS7Parameter EN_LB_LPFH_RBB; +extern const struct LMS7Parameter EN_LB_LPFL_RBB; +extern const struct LMS7Parameter PD_LPFH_RBB; +extern const struct LMS7Parameter PD_LPFL_RBB; +extern const struct LMS7Parameter PD_PGA_RBB; +extern const struct LMS7Parameter EN_G_RBB; +extern const struct LMS7Parameter R_CTL_LPF_RBB; +extern const struct LMS7Parameter RCC_CTL_LPFH_RBB; +extern const struct LMS7Parameter C_CTL_LPFH_RBB; +extern const struct LMS7Parameter RCC_CTL_LPFL_RBB; +extern const struct LMS7Parameter C_CTL_LPFL_RBB; +extern const struct LMS7Parameter INPUT_CTL_PGA_RBB; +extern const struct LMS7Parameter ICT_LPF_IN_RBB; +extern const struct LMS7Parameter ICT_LPF_OUT_RBB; +extern const struct LMS7Parameter OSW_PGA_RBB; +extern const struct LMS7Parameter ICT_PGA_OUT_RBB; +extern const struct LMS7Parameter ICT_PGA_IN_RBB; +extern const struct LMS7Parameter G_PGA_RBB; +extern const struct LMS7Parameter RCC_CTL_PGA_RBB; +extern const struct LMS7Parameter C_CTL_PGA_RBB; +extern const struct LMS7Parameter RESET_N; +extern const struct LMS7Parameter SPDUP_VCO; +extern const struct LMS7Parameter BYPLDO_VCO; +extern const struct LMS7Parameter EN_COARSEPLL; +extern const struct LMS7Parameter CURLIM_VCO; +extern const struct LMS7Parameter EN_DIV2_DIVPROG; +extern const struct LMS7Parameter EN_INTONLY_SDM; +extern const struct LMS7Parameter EN_SDM_CLK; +extern const struct LMS7Parameter PD_FBDIV; +extern const struct LMS7Parameter PD_LOCH_T2RBUF; +extern const struct LMS7Parameter PD_CP; +extern const struct LMS7Parameter PD_FDIV; +extern const struct LMS7Parameter PD_SDM; +extern const struct LMS7Parameter PD_VCO_COMP; +extern const struct LMS7Parameter PD_VCO; +extern const struct LMS7Parameter EN_G; +extern const struct LMS7Parameter FRAC_SDM_LSB; +extern const struct LMS7Parameter INT_SDM; +extern const struct LMS7Parameter FRAC_SDM_MSB; +extern const struct LMS7Parameter PW_DIV2_LOCH; +extern const struct LMS7Parameter PW_DIV4_LOCH; +extern const struct LMS7Parameter DIV_LOCH; +extern const struct LMS7Parameter TST_SX; +extern const struct LMS7Parameter SEL_SDMCLK; +extern const struct LMS7Parameter SX_DITHER_EN; +extern const struct LMS7Parameter REV_SDMCLK; +extern const struct LMS7Parameter VDIV_VCO; +extern const struct LMS7Parameter ICT_VCO; +extern const struct LMS7Parameter RSEL_LDO_VCO; +extern const struct LMS7Parameter CSW_VCO; +extern const struct LMS7Parameter SEL_VCO; +extern const struct LMS7Parameter COARSE_START; +extern const struct LMS7Parameter REVPH_PFD; +extern const struct LMS7Parameter IOFFSET_CP; +extern const struct LMS7Parameter IPULSE_CP; +extern const struct LMS7Parameter COARSE_STEPDONE; +extern const struct LMS7Parameter COARSEPLL_COMPO; +extern const struct LMS7Parameter VCO_CMPHO; +extern const struct LMS7Parameter VCO_CMPLO; +extern const struct LMS7Parameter CP2_PLL; +extern const struct LMS7Parameter CP3_PLL; +extern const struct LMS7Parameter CZ; +extern const struct LMS7Parameter EN_DIR_SXRSXT; +extern const struct LMS7Parameter EN_DIR_RBB; +extern const struct LMS7Parameter EN_DIR_RFE; +extern const struct LMS7Parameter EN_DIR_TBB; +extern const struct LMS7Parameter EN_DIR_TRF; +extern const struct LMS7Parameter TSGFC_TXTSP; +extern const struct LMS7Parameter TSGFCW_TXTSP; +extern const struct LMS7Parameter TSGDCLDQ_TXTSP; +extern const struct LMS7Parameter TSGDCLDI_TXTSP; +extern const struct LMS7Parameter TSGSWAPIQ_TXTSP; +extern const struct LMS7Parameter TSGMODE_TXTSP; +extern const struct LMS7Parameter INSEL_TXTSP; +extern const struct LMS7Parameter BSTART_TXTSP; +extern const struct LMS7Parameter EN_TXTSP; +extern const struct LMS7Parameter GCORRQ_TXTSP; +extern const struct LMS7Parameter GCORRI_TXTSP; +extern const struct LMS7Parameter HBI_OVR_TXTSP; +extern const struct LMS7Parameter IQCORR_TXTSP; +extern const struct LMS7Parameter DCCORRI_TXTSP; +extern const struct LMS7Parameter DCCORRQ_TXTSP; +extern const struct LMS7Parameter GFIR1_L_TXTSP; +extern const struct LMS7Parameter GFIR1_N_TXTSP; +extern const struct LMS7Parameter GFIR2_L_TXTSP; +extern const struct LMS7Parameter GFIR2_N_TXTSP; +extern const struct LMS7Parameter GFIR3_L_TXTSP; +extern const struct LMS7Parameter GFIR3_N_TXTSP; +extern const struct LMS7Parameter CMIX_GAIN_TXTSP; +extern const struct LMS7Parameter CMIX_SC_TXTSP; +extern const struct LMS7Parameter CMIX_BYP_TXTSP; +extern const struct LMS7Parameter ISINC_BYP_TXTSP; +extern const struct LMS7Parameter GFIR3_BYP_TXTSP; +extern const struct LMS7Parameter GFIR2_BYP_TXTSP; +extern const struct LMS7Parameter GFIR1_BYP_TXTSP; +extern const struct LMS7Parameter DC_BYP_TXTSP; +extern const struct LMS7Parameter GC_BYP_TXTSP; +extern const struct LMS7Parameter PH_BYP_TXTSP; +extern const struct LMS7Parameter BSIGI_TXTSP; +extern const struct LMS7Parameter BSTATE_TXTSP; +extern const struct LMS7Parameter BSIGQ_TXTSP; +extern const struct LMS7Parameter DC_REG_TXTSP; +extern const struct LMS7Parameter DTHBIT_TX; +extern const struct LMS7Parameter SEL_TX; +extern const struct LMS7Parameter MODE_TX; +extern const struct LMS7Parameter CAPTURE; +extern const struct LMS7Parameter CAPSEL; +extern const struct LMS7Parameter CAPSEL_ADC; +extern const struct LMS7Parameter TSGFC_RXTSP; +extern const struct LMS7Parameter TSGFCW_RXTSP; +extern const struct LMS7Parameter TSGDCLDQ_RXTSP; +extern const struct LMS7Parameter TSGDCLDI_RXTSP; +extern const struct LMS7Parameter TSGSWAPIQ_RXTSP; +extern const struct LMS7Parameter TSGMODE_RXTSP; +extern const struct LMS7Parameter INSEL_RXTSP; +extern const struct LMS7Parameter BSTART_RXTSP; +extern const struct LMS7Parameter EN_RXTSP; +extern const struct LMS7Parameter GCORRQ_RXTSP; +extern const struct LMS7Parameter GCORRI_RXTSP; +extern const struct LMS7Parameter HBD_OVR_RXTSP; +extern const struct LMS7Parameter IQCORR_RXTSP; +extern const struct LMS7Parameter HBD_DLY; +extern const struct LMS7Parameter DCLOOP_BYP; +extern const struct LMS7Parameter DCCORR_AVG_RXTSP; +extern const struct LMS7Parameter GFIR1_L_RXTSP; +extern const struct LMS7Parameter GFIR1_N_RXTSP; +extern const struct LMS7Parameter GFIR2_L_RXTSP; +extern const struct LMS7Parameter GFIR2_N_RXTSP; +extern const struct LMS7Parameter GFIR3_L_RXTSP; +extern const struct LMS7Parameter GFIR3_N_RXTSP; +extern const struct LMS7Parameter AGC_K_RXTSP; +extern const struct LMS7Parameter AGC_ADESIRED_RXTSP; +extern const struct LMS7Parameter RSSI_MODE; +extern const struct LMS7Parameter AGC_MODE_RXTSP; +extern const struct LMS7Parameter AGC_AVG_RXTSP; +extern const struct LMS7Parameter DC_REG_RXTSP; +extern const struct LMS7Parameter CMIX_GAIN_RXTSP; +extern const struct LMS7Parameter CMIX_SC_RXTSP; +extern const struct LMS7Parameter CMIX_BYP_RXTSP; +extern const struct LMS7Parameter AGC_BYP_RXTSP; +extern const struct LMS7Parameter GFIR3_BYP_RXTSP; +extern const struct LMS7Parameter GFIR2_BYP_RXTSP; +extern const struct LMS7Parameter GFIR1_BYP_RXTSP; +extern const struct LMS7Parameter DC_BYP_RXTSP; +extern const struct LMS7Parameter GC_BYP_RXTSP; +extern const struct LMS7Parameter PH_BYP_RXTSP; +extern const struct LMS7Parameter CAPD; +extern const struct LMS7Parameter DTHBIT_RX; +extern const struct LMS7Parameter SEL_RX; +extern const struct LMS7Parameter MODE_RX; + +#endif diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/LMS7002M_statuses.cpp b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/LMS7002M_statuses.cpp new file mode 100644 index 0000000000000000000000000000000000000000..4e00854e1443956870826ab0830dbed0c9a52498 --- /dev/null +++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/LMS7002M_statuses.cpp @@ -0,0 +1,16 @@ +/** +@file LMS7002M_statuses.cpp +@author Lime Microsystems (www.limemicro.com) +*/ + +#include "LMS7002M_statuses.h" + +const char* undefinedStatusStr = "undefined status"; + +const char* liblms7_status2string(liblms7_status status) +{ + if (status >= 0 && status < LIBLMS7_STATUS_COUNT) + return liblms7_status_strings[status]; + else + return undefinedStatusStr; +} diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/LMS7002M_statuses.h b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/LMS7002M_statuses.h new file mode 100644 index 0000000000000000000000000000000000000000..43b736bfd52f541581742a703ba2010356ec6ce4 --- /dev/null +++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/LMS7002M_statuses.h @@ -0,0 +1,48 @@ +/** +@file LMS7002M_statuses.h +@author Lime Microsystems (www.limemicro.com) +@brief LMS7002M control library statuses enumerations +*/ + +#ifndef LMS7API_STATUSES_H +#define LMS7API_STATUSES_H + +const char liblms7_status_strings[][64] = +{ +"success", +"failure", +"index out of range", +"too many values", +"connection manager is NULL", +"port not connected", +"frequency out of range", +"cannot deliver frequency", +"VCO is powered down", +"Bad SEL_PATH_RFE", +"Band not selected", +"file not found", +"file invalid format", +}; + +enum liblms7_status +{ + LIBLMS7_SUCCESS = 0, + LIBLMS7_FAILURE, + LIBLMS7_INDEX_OUT_OF_RANGE, + LIBLMS7_TOO_MANY_VALUES, + LIBLMS7_NO_CONNECTION_MANAGER, + LIBLMS7_NOT_CONNECTED, + LIBLMS7_FREQUENCY_OUT_OF_RANGE, + LIBLMS7_CANNOT_DELIVER_FREQUENCY, + LIBLMS7_VCO_IS_POWERED_DOWN, + LIBLMS7_BAD_SEL_PATH, + LIBLMS7_BAND_NOT_SELECTED, + LIBLMS7_FILE_NOT_FOUND, + LIBLMS7_FILE_INVALID_FORMAT, + + LIBLMS7_STATUS_COUNT +}; + +const char* liblms7_status2string(liblms7_status status); + +#endif diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/connectionManager/ConnectionCOM.cpp b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/connectionManager/ConnectionCOM.cpp new file mode 100644 index 0000000000000000000000000000000000000000..6c7fc0d8290d5c26a8ae575fbcc98b4058cae124 --- /dev/null +++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/connectionManager/ConnectionCOM.cpp @@ -0,0 +1,596 @@ +/** + @file ConnectionCOM.cpp + @author Lime Microsystems (www.limemicro.com) + @brief Implementation of communications through COM port +*/ + +#include "ConnectionCOM.h" + +#include "string.h" +#ifdef __unix__ +#include <fstream> +#include <errno.h> +#include <unistd.h> +#include <termios.h> +#include <sys/types.h> +#include <sys/stat.h> +#include <fcntl.h> +#include <stdlib.h> +#include <iostream> +#include <stdio.h> +#endif // LINUX + +const int COM_RETRY_INTERVAL = 20; //ms +const int COM_TOTAL_TIMEOUT = 300; //ms + +/** @brief Initializes com port connection +*/ +ConnectionCOM::ConnectionCOM() +{ + currentDeviceIndex = -1; + connected = false; + comPortList.clear(); + m_deviceNames.clear(); + m_connectionType = COM_PORT; +#ifndef __unix__ + hComm = INVALID_HANDLE_VALUE; +#else + hComm = -1; +#endif + comBaudrate = 9600; +} + +/** @brief When object is destroyed it closes it's opened COM port +*/ +ConnectionCOM::~ConnectionCOM() +{ + Close(); +} + +/** @brief Opens connection to first found chip + @return 0-success +*/ +IConnection::DeviceStatus ConnectionCOM::Open() +{ + comPortList.clear(); + if(comPortList.size() == 0) + FindAllComPorts(); + + m_deviceNames.clear(); + if(m_deviceNames.size() == 0) + RefreshDeviceList(); + + for(unsigned int i=0; i<m_deviceNames.size(); i++) + { + if( Open(i) == SUCCESS) + { + currentDeviceIndex = i; + return SUCCESS; + } + } + return FAILURE; +} + +/** @brief Opens connection to selected chip + @param index chip index in device list + @return 0-success +*/ +IConnection::DeviceStatus ConnectionCOM::Open(unsigned index) +{ + unsigned int toOpen = index; + Close(); + if(toOpen < m_deviceNames.size() && m_deviceNames.size() > 0 ) + { + comPortName = m_deviceNames[toOpen]; + IConnection::DeviceStatus status = Open(comPortName.c_str(), comBaudrate); + if( status == SUCCESS ) + currentDeviceIndex = toOpen; + return status; + } + return FAILURE; +} + +/** @brief Closes connection to chip +*/ +void ConnectionCOM::Close() +{ + connected = false; + currentDeviceIndex = -1; +#ifndef __unix__ + if (hComm != INVALID_HANDLE_VALUE) + { + SetCommTimeouts(hComm, &m_ctmoOld); + CloseHandle(hComm); + } + hComm = INVALID_HANDLE_VALUE; +#else + if( hComm >= 0) + { + close(hComm); + } + hComm = -1; +#endif +} + +/** @brief Returns whether chip is connected + @return chip is connected +*/ +bool ConnectionCOM::IsOpen() +{ +#ifndef __unix__ + if (hComm != INVALID_HANDLE_VALUE && TestConnectivity() ) + return true; +#else + if( hComm != -1 && TestConnectivity() ) + return true; +#endif + return false; +} + +int ConnectionCOM::GetOpenedIndex() +{ + return currentDeviceIndex; +} + +/** @brief Sends data through COM port + @param buffer data buffer to send + @param length size of data buffer + @param timeout_ms timeout limit for operation in milliseconds + @return Number of bytes sent +*/ +int ConnectionCOM::Write(const unsigned char *buffer, int length, int timeout_ms) +{ + if(timeout_ms == 0) + { + timeout_ms = COM_TOTAL_TIMEOUT; + } + int retryCount = 0; + const int maxRetries = (timeout_ms/COM_RETRY_INTERVAL) > 1 ? (timeout_ms/COM_RETRY_INTERVAL) : 1; + bool status = false; +#ifndef __unix__ + unsigned long bytesWriten = 0; + m_osWOverlap.InternalHigh = 0; + + for(int i = 0; i<maxRetries && status == false; ++i) + { + if (!WriteFile(hComm, buffer, length , &bytesWriten, NULL)) + { + status = false; + } + else + status = true; + ++retryCount; + } +#else + long bytesWriten = 0; + for(int i = 0; i<maxRetries && bytesWriten == 0; ++i) + { + bytesWriten = write(hComm, buffer, length); + if(bytesWriten <= 0) + { +// if(bytesWriten < 0) +// MessageLog::getInstance()->write("COM PORT: error writing data\n", LOG_ERROR); +// if(bytesWriten == 0) +// MessageLog::getInstance()->write("COM PORT: data bytes sent 0\n", LOG_WARNING); + status = false; + } + else + status = true; + ++retryCount; + } +#endif + if(bytesWriten == length) + status = true; + + return bytesWriten; +} + +/** @brief Reads data from COM port + @param buffer pointer to data buffer for receiving + @param length number of bytes to read + @param timeout_ms timeout limit for operation in milliseconds + @return Number of bytes received +*/ +int ConnectionCOM::Read(unsigned char *buffer, int length, int timeout_ms) +{ + if(timeout_ms == 0) + { + timeout_ms = COM_TOTAL_TIMEOUT; + } + int retryCount = 0; + const int maxRetries = (timeout_ms/COM_RETRY_INTERVAL) > 1 ? (timeout_ms/COM_RETRY_INTERVAL) : 1; + bool status = false; + + memset(buffer, 0, length); + long bytesReaded = 0; + unsigned long totalBytesReaded = 0; + char cRawData[COM_BUFFER_LENGTH]; + unsigned long bytesToRead = length; + + memset(cRawData, '\0', sizeof(cRawData[0])*COM_BUFFER_LENGTH); + + for(int i=0; i<maxRetries && status == false; ++i) + { + memset(cRawData, '\0', sizeof(cRawData[0])*COM_BUFFER_LENGTH); +#ifndef __unix__ + + DWORD bytesReceived = 0; + if ( !ReadFile(hComm, cRawData, bytesToRead, &bytesReceived, NULL) ) + { + status = false; + } + + bytesReaded = bytesReceived; +#else + bytesReaded = read(hComm, cRawData, bytesToRead); + if(bytesReaded <= 0) + { +// if(bytesReaded < 0) +// MessageLog::getInstance()->write("COM PORT: error reading data\n", LOG_ERROR); +// if(bytesReaded == 0) +// MessageLog::getInstance()->write("COM PORT: reading 0 bytes\n", LOG_WARNING); + status = false; + } +#endif + retryCount++; + + for(int j=0; j<bytesReaded; ++j) + { + buffer[totalBytesReaded+j] = cRawData[j]; + } + + totalBytesReaded += bytesReaded; + if(totalBytesReaded == bytesToRead) + status = true; + } + +// ss << " read(" << totalBytesReaded << "): "; +// for(unsigned int i=0; i<64; ++i) +// ss << int2hex(buffer[i], 1) << " "; +// ss << " - retries: " << retryCount-1 << endl; + //MessageLog::getInstance()->write(ss.str(), LOG_DATA); + +// if(retryCount == maxRetries) +// MessageLog::getInstance()->write("COM PORT: read data timeout\n", LOG_WARNING); +// +// if(totalBytesReaded > length) +// MessageLog::getInstance()->write("COM PORT: read data corrupted, received length > requested length\n", LOG_ERROR); + return totalBytesReaded; +} + +/** @brief Searches for available COM ports and adds them to list +*/ +void ConnectionCOM::FindAllComPorts() +{ + Close(); + comPortList.clear(); +#ifndef __unix__ + HKEY hSERIALCOMM; + if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, TEXT("HARDWARE\\DEVICEMAP\\SERIALCOMM"), 0, KEY_QUERY_VALUE, &hSERIALCOMM) == ERROR_SUCCESS) + { + // Get the max value name and max value lengths + DWORD dwMaxValueNameLen; + DWORD dwMaxValueLen; + DWORD dwQueryInfo = RegQueryInfoKey(hSERIALCOMM, NULL, NULL, NULL, NULL, NULL, NULL, NULL, &dwMaxValueNameLen, &dwMaxValueLen, NULL, NULL); + if (dwQueryInfo == ERROR_SUCCESS) + { + DWORD dwMaxValueNameSizeInChars = dwMaxValueNameLen + 1; + // Include space for the NULL terminator + DWORD dwMaxValueNameSizeInBytes = dwMaxValueNameSizeInChars*sizeof(TCHAR); + DWORD dwMaxValueDataSizeInChars = dwMaxValueLen / sizeof(TCHAR) + 1; + // Include space for the NULL terminator + DWORD dwMaxValueDataSizeInBytes = dwMaxValueDataSizeInChars*sizeof(TCHAR); + + // Allocate some space for the value name and value data + TCHAR* szValueName = new TCHAR[dwMaxValueNameSizeInChars]; + TCHAR* byValue = new TCHAR[dwMaxValueDataSizeInBytes]; + if (szValueName && byValue) + { + // Enumerate all the values underneath HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM + DWORD dwIndex = 0; + DWORD dwType; + DWORD dwValueNameSize = dwMaxValueNameSizeInChars; + DWORD dwDataSize = dwMaxValueDataSizeInBytes; + memset(szValueName, 0, dwMaxValueNameSizeInBytes); + memset(byValue, 0, dwMaxValueDataSizeInBytes); + LONG nEnum = RegEnumValue(hSERIALCOMM, dwIndex, szValueName, &dwValueNameSize, NULL, &dwType, (LPBYTE)byValue, &dwDataSize); + while (nEnum == ERROR_SUCCESS) + { + // If the value is of the correct type, then add it to the array + if (dwType == REG_SZ) + { + char portname[512]; + TCHAR* szPort = byValue; + int nUserNameLenUnicode = lstrlen( szPort ); // Convert all UNICODE characters + int nUserNameLen = WideCharToMultiByte( CP_ACP, // ANSI Code Page + 0, // No special handling of unmapped chars + (LPCWSTR)szPort, // wide-character string to be converted + nUserNameLenUnicode, + NULL, 0, // No output buffer since we are calculating length + NULL, NULL ); // Unrepresented char replacement - Use Default + TCHAR* pszUserName = new TCHAR[ nUserNameLen ]; // nUserNameLen includes the NULL character + WideCharToMultiByte( CP_ACP, // ANSI Code Page + 0, // No special handling of unmapped chars + (LPCWSTR)szPort, // wide-character string to be converted + nUserNameLenUnicode, + portname, + nUserNameLen, + NULL, NULL ); // Unrepresented char replacement - Use Default + portname[nUserNameLen] = 0; +#ifdef UNICODE + comPortList.push_back(portname); +#else + comPortList.push_back(szPort); +#endif + } + // Prepare for the next time around + dwValueNameSize = dwMaxValueNameSizeInChars; + dwDataSize = dwMaxValueDataSizeInBytes; + memset(szValueName, 0, dwMaxValueNameSizeInBytes); + memset(byValue, 0, dwMaxValueDataSizeInBytes); + ++dwIndex; + nEnum = RegEnumValue(hSERIALCOMM, dwIndex, szValueName, &dwValueNameSize, NULL, &dwType, (LPBYTE)byValue, &dwDataSize); + } + } + delete szValueName; + delete byValue; + } + // Close the registry key now that we are finished with it + RegCloseKey(hSERIALCOMM); + + if (dwQueryInfo != ERROR_SUCCESS) + SetLastError(dwQueryInfo); + } +#else + char tempBuffer[256]; + string result = ""; +#warning Currently searching only for ACM connections + system( "ls /dev | grep ttyACM > /tmp/foundSerialPorts.txt"); + + fstream fin; + fin.open("/tmp/foundSerialPorts.txt", ios::in); + while(!fin.eof()) + { + fin.getline(tempBuffer, 256); + result = "/dev/"; + result.append(tempBuffer); + if( strlen(tempBuffer) > 3 ) //longer than tty + comPortList.push_back(result); + } + fin.close(); +#endif +} + +/** @brief Opens COM port + @param comName COM port name + @param baudrate COM port baudrate + @return 0 on success +*/ +IConnection::DeviceStatus ConnectionCOM::Open(const char *comName, int baudrate) +{ + Close(); + if (strlen(comName) == 0) + return FAILURE; + + DeviceStatus errorCode = SUCCESS; + +#ifndef __unix__ + // Initialize Overlap structures + m_osROverlap.Internal = 0; + m_osROverlap.InternalHigh = 0; + m_osROverlap.Offset = 0; + m_osROverlap.OffsetHigh = 0; + m_osROverlap.hEvent = CreateEvent(NULL, false, false, NULL); + + m_osWOverlap.Internal = 0; + m_osWOverlap.InternalHigh = 0; + m_osWOverlap.Offset = 0; + m_osWOverlap.OffsetHigh = 0; + m_osWOverlap.hEvent = CreateEvent(NULL, false, false, NULL); + + // Initialize DSB structure + memset(&m_dcbCommPort, 0, sizeof(m_dcbCommPort)); + + m_dcbCommPort.BaudRate = comBaudrate; + m_dcbCommPort.fBinary = 1; + m_dcbCommPort.fParity = 0; + m_dcbCommPort.fOutxCtsFlow = 0; + m_dcbCommPort.fOutxDsrFlow = 0; + m_dcbCommPort.fDtrControl = 0; + m_dcbCommPort.fDsrSensitivity = 0; + m_dcbCommPort.fTXContinueOnXoff = 0; + m_dcbCommPort.fOutX = 0; + m_dcbCommPort.fInX = 0; + m_dcbCommPort.fErrorChar = 0; + m_dcbCommPort.fNull = 0; + m_dcbCommPort.fRtsControl = 0; + m_dcbCommPort.fAbortOnError = 0; + m_dcbCommPort.fDummy2 = 0; + // m_dcbCommPort.wReserved = 0; + m_dcbCommPort.XonLim = 512; + m_dcbCommPort.XoffLim = 512; + m_dcbCommPort.ByteSize = 8; + m_dcbCommPort.Parity = 0; + m_dcbCommPort.StopBits = 0; + //m_dcbCommPort.StopBits = 1; + m_dcbCommPort.XonChar = 17; + m_dcbCommPort.XoffChar = 19; + m_dcbCommPort.ErrorChar = 0; + m_dcbCommPort.EofChar = 26; + m_dcbCommPort.EvtChar = 0; + m_dcbCommPort.wReserved1 = 0; + m_dcbCommPort.DCBlength = sizeof(DCB); + + // Initialize Timeout's + m_ctmoNew.ReadIntervalTimeout = 50; + m_ctmoNew.ReadTotalTimeoutMultiplier = 0; + m_ctmoNew.ReadTotalTimeoutConstant = 100; // 1; + m_ctmoNew.WriteTotalTimeoutMultiplier = 0; + m_ctmoNew.WriteTotalTimeoutConstant = 100; + + // Open COM port + string stmp; + stmp = "\\\\.\\"; + stmp.append(comName); + hComm = CreateFileA(stmp.c_str(), GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0); + + if (hComm != INVALID_HANDLE_VALUE) + { + // Set Events + if (!SetCommMask(hComm, 0)) + errorCode = FAILURE; + + // Set Timeouts + GetCommTimeouts(hComm, &m_ctmoOld); + if (!SetCommTimeouts(hComm, &m_ctmoNew)) + errorCode = FAILURE; + + // Set DCB + if (!SetCommState(hComm, &m_dcbCommPort)) + errorCode = FAILURE; + } + else + { + errorCode = FAILURE; + }; + + // Check the results + if (errorCode != 0) + { + //unsigned long err = GetLastError(); + CloseHandle(hComm); + hComm = INVALID_HANDLE_VALUE; + return errorCode; + } + else + { + PurgeComm(hComm, PURGE_TXCLEAR | PURGE_RXCLEAR); + return SUCCESS; + } +#else + hComm = open(comName, O_RDWR | O_NOCTTY | O_SYNC); + if(hComm < 0) + { +// printf("%s",strerror(errno)); +// MessageLog::getInstance()->write("Connection manager: failed opening COM port\n", LOG_ERROR); + return FAILURE; + } + + struct termios tty; + memset(&tty, 0, sizeof(tty)); + if( tcgetattr(hComm, &tty) != 0) + { +// MessageLog::getInstance()->write("Connection Manager: error from tcgetattr\n", LOG_ERROR); + return FAILURE; + } + int speed = B9600; + cfsetospeed(&tty, speed); + cfsetispeed(&tty, speed); + + tty.c_cflag = (tty.c_cflag & ~CSIZE) | CS8; + tty.c_iflag &= ~IGNBRK; + tty.c_lflag = 0; + tty.c_oflag = 0; + tty.c_cc[VMIN] = 0; // read non blocking + tty.c_cc[VTIME] = 5; // 0.5 seconds read timeout + + tty.c_iflag &= ~(IXON | IXOFF | IXANY); + tty.c_cflag |= (CLOCAL | CREAD); + + if(tcsetattr(hComm, TCSANOW, &tty) != 0) + { +// MessageLog::getInstance()->write("Connection manager: error from tcsetattr\n", LOG_ERROR); + return FAILURE; + } +#endif + return SUCCESS; +} + +/** @brief Checks if chip is connected to currently open port + @return chip is connected +*/ +bool ConnectionCOM::TestConnectivity() +{ +//currently set to always return true to show all com ports + return true; +#ifndef __unix__ + if (hComm != INVALID_HANDLE_VALUE) +#else + if( hComm >= 0) +#endif + { +// unsigned char out[64]; +// unsigned char in[64]; +// memset(in, 0, 64); +// out[0] = CMD_GET_INFO; +// SendData(out, 64); +// ReadData(in, 64); +// if(in[0] == CMD_GET_INFO && in[1] == 0x01) +// return true; +// else +// return false; + } + return false; +} + +/** @brief Finds all chips connected to com ports + @return number of devices found +*/ +int ConnectionCOM::RefreshDeviceList() +{ + int wasOpen = -1; + string wasOpenName = ""; + if(IsOpen()) + { + wasOpen = GetOpenedIndex(); + wasOpenName = comPortName; + } + Close(); + comPortList.clear(); + if(comPortList.size() == 0) + FindAllComPorts(); + + m_deviceNames.clear(); + string comName; + for(unsigned int i=0; i<comPortList.size(); i++) + { + comName = comPortList[i]; +#ifndef __unix__ + if( Open(comName.c_str(), comBaudrate) == SUCCESS) + { + if( TestConnectivity() ) //if responds add it to device list + m_deviceNames.push_back(comName); + } + Close(); +#else + m_deviceNames.push_back(comName); +#endif + } + if(wasOpen != -1) + { + for(unsigned i=0; i<m_deviceNames.size(); ++i) + if(m_deviceNames[i] == wasOpenName) + { + Open(i); + break; + } + } + return m_deviceNames.size(); +} + +/** @brief Returns found devices names + @return vector of device names +*/ +vector<string> ConnectionCOM::GetDeviceNames() +{ + return m_deviceNames; +} + +/** @brief Purges communication buffers +*/ +void ConnectionCOM::ClearComm() +{ +#ifndef __unix__ + PurgeComm(hComm, PURGE_TXCLEAR|PURGE_RXCLEAR); +#endif +} diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/connectionManager/ConnectionCOM.h b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/connectionManager/ConnectionCOM.h new file mode 100644 index 0000000000000000000000000000000000000000..0549472db1b9efb7312d75f906b3c7614e1455a7 --- /dev/null +++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/connectionManager/ConnectionCOM.h @@ -0,0 +1,62 @@ +/** +@file ConnectionCOM.h +@author Lime Microsystems (www.limemicro.com) +@brief Class for data communications through COM port +*/ + +#ifndef CONNECTION_COM_PORT_H +#define CONNECTION_COM_PORT_H + +#ifndef __unix__ + #include "windows.h" +#endif + +#include "IConnection.h" + +class ConnectionCOM : public IConnection +{ +public: + static const int COM_BUFFER_LENGTH = 1024; //max buffer size for data + + ConnectionCOM(); + ~ConnectionCOM(); + + DeviceStatus Open(); + DeviceStatus Open(unsigned i); + void Close(); + bool IsOpen(); + int GetOpenedIndex(); + + int Write(const unsigned char *buffer, int length, int timeout_ms = 0); + int Read(unsigned char *buffer, int length, int timeout_ms = 0); + + std::vector<std::string> GetDeviceNames(); + int RefreshDeviceList(); + void ClearComm(); +private: + void FindAllComPorts(); + DeviceStatus Open(const char *comName, int baudrate); + + bool TestConnectivity(); + + std::string comPortName; + int comBaudrate; + bool connected; + + int currentDeviceIndex; + std::vector<std::string> comPortList; + std::vector<std::string> m_deviceNames; + +#ifndef __unix__ + HANDLE hComm; + COMMTIMEOUTS m_ctmoNew; + COMMTIMEOUTS m_ctmoOld; + OVERLAPPED m_osROverlap; + OVERLAPPED m_osWOverlap; + DCB m_dcbCommPort; +#else + int hComm; //com port file descriptor +#endif + +}; +#endif diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/connectionManager/ConnectionManager.cpp b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/connectionManager/ConnectionManager.cpp new file mode 100644 index 0000000000000000000000000000000000000000..36f73da5d75af7f5ff15ceb64b6164fdcd5a8a1d --- /dev/null +++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/connectionManager/ConnectionManager.cpp @@ -0,0 +1,314 @@ +/** + @file ConnectionManager.cpp + @author Lime Microsystems (www.limemicro.com) + @brief Implementation of various connection types to devices +*/ + +#include "ConnectionManager.h" +#include "ConnectionCOM.h" + +#ifdef ENABLE_USB_CONNECTION + #include "ConnectionUSB.h" +#endif +#ifdef ENABLE_SPI_CONNECTION + #include "ConnectionSPI.h" +#endif + +#include <sstream> +#include <iomanip> +#include <iostream> + +/** @brief Creates connection interfaces +*/ +ConnectionManager::ConnectionManager() : activeControlPort(NULL) +{ + mLogData = false; + mOpenedDevice = -1; + m_connections[IConnection::COM_PORT] = new ConnectionCOM(); +#ifdef ENABLE_USB_CONNECTION + m_connections[IConnection::USB_PORT] = new ConnectionUSB(); +#endif +#ifdef ENABLE_SPI_CONNECTION + m_connections[IConnection::SPI_PORT] = new ConnectionSPI(); +#endif +} + +/** @brief Destroys connection interfaces +*/ +ConnectionManager::~ConnectionManager() +{ + for (auto iter = m_connections.begin(); iter != m_connections.end(); ++iter) + { + delete iter->second; + } +} + +/** @brief Checks if connection to device is opened + @return True if device is connected +*/ +bool ConnectionManager::IsOpen() +{ + return activeControlPort ? activeControlPort->IsOpen() : false; +} + +/** @brief Opens connection to first available device + @return True if connected to device +*/ +bool ConnectionManager::Open() +{ + return Open(0); +} + +/** @brief Connects to selected device + @param i device index from device list + @return 1:Success, 0:failure +*/ +int ConnectionManager::Open(unsigned i) +{ + if(i >= mDevices.size()) + return 0; + + if(activeControlPort) + activeControlPort->Close(); + switch(mDevices[i].port) + { + case IConnection::COM_PORT: + activeControlPort = m_connections[IConnection::COM_PORT]; + break; + case IConnection::USB_PORT: + activeControlPort = m_connections[IConnection::USB_PORT]; + break; + case IConnection::SPI_PORT: + activeControlPort = m_connections[IConnection::SPI_PORT]; + break; + default: + return 0; + } + mOpenedDevice = -1; + if( i < mDevices.size() ) + { + if( activeControlPort->Open(mDevices[i].portIndex) ) + { + mOpenedDevice = i; + return 1; + } + } + return 0; +} + +/** @brief Closes connection to device +*/ +void ConnectionManager::Close() +{ + if(activeControlPort) + { + activeControlPort->Close(); + //Notify(LMS_Message(MSG_BOARD_DISCONNECTED, "", 0, 0)); + } + mOpenedDevice = -1; +} + +/** @brief Finds all currently connected devices and forms device list + @return number of devices found +*/ +int ConnectionManager::RefreshDeviceList() +{ + mDeviceList.clear(); + mDevices.clear(); + DeviceInfo dev; + for (auto iter = m_connections.begin(); iter != m_connections.end(); ++iter) + { + vector<string> names; + IConnection *port = iter->second; + if(port->RefreshDeviceList() > 0) + { + names = port->GetDeviceNames(); + for(unsigned i=0; i<names.size(); ++i) + { + dev.name = names[i]; + dev.port = iter->first; + dev.portIndex = i; + mDevices.push_back(dev); + } + } + } + for(unsigned i=0; i<mDevices.size(); ++i) + mDeviceList.push_back(mDevices[i].name); + return mDevices.size(); +} + +/** @brief Returns currently opened connection index +*/ +int ConnectionManager::GetOpenedIndex() +{ + return mOpenedDevice; +} + +/** @brief Writes given data to currently opened connection + @param buffer outcomming data buffer + @param length bytes to write + @param timeout_ms timeout in milliseconds + @return number of bytes written, on failure negative values +*/ +int ConnectionManager::Write(const unsigned char *buffer, const int length, int timeout_ms) +{ + if(activeControlPort) + { + int bytesTransferred = activeControlPort->Write(buffer, length, timeout_ms); +#ifndef NDEBUG + if(mLogData) + { + stringstream ss; + ss << "WR(" << (bytesTransferred>=0?bytesTransferred: 0) << "): "; + ss << std::hex << std::setfill('0'); + int repeatedZeros = 0; + for(int i=length-1; i>=0; --i) + if(buffer[i] == 0) + ++repeatedZeros; + else break; + if(repeatedZeros == 1) + repeatedZeros = 0; + repeatedZeros = repeatedZeros - (repeatedZeros & 0x1); + for(int i=0; i<length-repeatedZeros; ++i) + //casting to short to print as numbers + ss << " " << std::setw(2) << (unsigned short)buffer[i]; + if(repeatedZeros > 1) + ss << " (00 x " << std::dec << repeatedZeros << " times)"; + cout << ss.str() << endl; + } +#endif + return bytesTransferred; + } + return -1; +} + +/** @brief Receives data from currently opened connection + @param buffer incomming data buffer, must be big enough for length bytes + @param length bytes to read + @param timeout_ms timeout in milliseconds + @return number of bytes received +*/ +int ConnectionManager::Read(unsigned char *buffer, int length, int timeout_ms) +{ + if(activeControlPort) + { + int bytesTransferred = activeControlPort->Read(buffer, length, timeout_ms); +#ifndef NDEBUG + if(mLogData) + { + stringstream ss; + ss << "RD(" << (bytesTransferred>=0?bytesTransferred: 0) << "): "; + ss << std::hex << std::setfill('0'); + int repeatedZeros = 0; + for(int i=length-1; i>=0; --i) + if(buffer[i] == 0) + ++repeatedZeros; + else break; + if(repeatedZeros == 2) + repeatedZeros = 0; + repeatedZeros = repeatedZeros - (repeatedZeros & 0x1); + for(int i=0; i<length-repeatedZeros; ++i) + //casting to short to print as numbers + ss << " " << std::setw(2) << (unsigned short)buffer[i]; + if(repeatedZeros > 2) + ss << " (00 x " << std::dec << repeatedZeros << " times)"; + cout << ss.str() << endl; + } +#endif + return bytesTransferred; + } + return -1; +} + +int ConnectionManager::WriteStream(const char *buffer, int length) +{ + return 0; +} + +int ConnectionManager::ReadStream(char *buffer, int length, unsigned int timeout_ms) +{ + /*int handle = activeControlPort->BeginDataReading(buffer, length); + activeControlPort->WaitForReading(handle, timeout_ms); + long received = length; + activeControlPort->FinishDataReading(buffer, received, handle); + return received; + */ + long len = length; + int status = activeControlPort->ReadDataBlocking(buffer, len, 0); + return len; +} + + +int ConnectionManager::BeginDataReading(char *buffer, long length) +{ + return activeControlPort->BeginDataReading(buffer, length); +} +/** +@brief Blocks until data is received or set number of milliseconds have passed. +@param contextHandle handle returned by BeginDataReading() +@param timeout_ms number of milliseconds to wait +@return 1-data received, 0-data not received +*/ +int ConnectionManager::WaitForReading(int contextHandle, unsigned int timeout_ms) +{ + return activeControlPort->WaitForReading(contextHandle, timeout_ms); +} +/** +@brief Finished asynchronous data reading. +@param buffer where to put received data +@param length number of bytes to read, will be changed to actual number of bytes received +@param contextHandle context handle returned by BeginDataReading() +@return received data length +*/ +int ConnectionManager::FinishDataReading(char *buffer, long &length, int contextHandle) +{ + return activeControlPort->FinishDataReading(buffer, length, contextHandle); +} + +/** +@brief Aborts reading operations +*/ +void ConnectionManager::AbortReading() +{ + activeControlPort->AbortReading(); +} + +/** +@brief Start asynchronous data sending. +@param buffer data buffer to be sent +@param length number of bytes to send. +@return context handle +*/ +int ConnectionManager::BeginDataSending(const char *buffer, long length) +{ + return activeControlPort->BeginDataSending(buffer, length); +} +/** +@brief Blocks until data is sent or set number of miliseconds have passed. +@param contextHandle handle returned by BeginDataReading() +@param timeout_ms number of miliseconds to wait +@return 1-data sent, 0-data not sent +*/ +int ConnectionManager::WaitForSending(int contextHandle, unsigned int timeout_ms) +{ + return activeControlPort->WaitForSending(contextHandle, timeout_ms); +} +/** +@brief Finished asynchronous data sending. +@param buffer where to put received data +@param length number of bytes to send, will be changed to actual number of bytes sent +@param contextHandle context handle returned by BeginDataReading() +@return sent data length +*/ +int ConnectionManager::FinishDataSending(const char *buffer, long &length, int contextHandle) +{ + return activeControlPort->FinishDataSending(buffer, length, contextHandle); +} + +/** +@brief Aborts sending operations +*/ +void ConnectionManager::AbortSending() +{ + activeControlPort->AbortSending(); +} diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/connectionManager/ConnectionManager.h b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/connectionManager/ConnectionManager.h new file mode 100644 index 0000000000000000000000000000000000000000..edd01d38332ae3b730f06a4e6c623f75fee10e0a --- /dev/null +++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/connectionManager/ConnectionManager.h @@ -0,0 +1,60 @@ +/** + @file ConnectionManager.h + @author Lime Microsystems (www.limemicro.com) + @brief Class for managing connection to devices +*/ + +#ifndef LMS_CONNECTION_MANAGER_H +#define LMS_CONNECTION_MANAGER_H + +#include "IConnection.h" +#include <map> + +class ConnectionManager +{ +public: + struct DeviceInfo + { + std::string name; + IConnection::eConnectionType port; + int portIndex; + }; + + ConnectionManager(); + ~ConnectionManager(); + bool IsOpen(); + bool Open(); + int Open(unsigned i); + void Close(); + int RefreshDeviceList(); + int GetOpenedIndex(); + std::vector<std::string> GetDeviceList(){return mDeviceList;}; + + int Write(const unsigned char *buffer, int length, int timeout_ms = 0); + int Read(unsigned char *buffer, int length, int timeout_ms = 0); + + int WriteStream(const char *buffer, int length); + int ReadStream(char *buffer, int length, unsigned int timeout_ms); + + int BeginDataReading(char *buffer, long length); + int WaitForReading(int contextHandle, unsigned int timeout_ms); + int FinishDataReading(char *buffer, long &length, int contextHandle); + void AbortReading(); + + int BeginDataSending(const char *buffer, long length); + int WaitForSending(int contextHandle, unsigned int timeout_ms); + int FinishDataSending(const char *buffer, long &length, int contextHandle); + void AbortSending(); + +protected: + bool mLogData; + /// Port used for communication. + IConnection *activeControlPort; + std::vector<DeviceInfo> mDevices; + std::vector<std::string> mDeviceList; + int mOpenedDevice; + std::map<IConnection::eConnectionType, IConnection*> m_connections; +}; + +#endif // LMS_CONNECTION_MANAGER_H + diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/connectionManager/ConnectionSPI.cpp b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/connectionManager/ConnectionSPI.cpp new file mode 100644 index 0000000000000000000000000000000000000000..e490db4dab480f4105e114809e11838cbd5e339d --- /dev/null +++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/connectionManager/ConnectionSPI.cpp @@ -0,0 +1,290 @@ +/** + @file ConnectionSPI.cpp + @author Lime Microsystems (www.limemicro.com) + @brief Implementation of communications through SPI port +*/ + +#include "ConnectionSPI.h" + +#include "string.h" +#ifdef __unix__ +#include <fstream> +#include <errno.h> +#include <unistd.h> +#include <termios.h> +#include <sys/types.h> +#include <sys/stat.h> +#include <fcntl.h> +#include <stdlib.h> +#include <stdio.h> +#include <sys/ioctl.h> +#include <linux/types.h> +#include <linux/spi/spidev.h> +#include <linux/i2c-dev.h> +#endif // LINUX + +#include <iostream> +#include <sstream> + +const int ConnectionSPI::cSPI_BUF_SIZE = 128; +const int ConnectionSPI::cSPI_SPEED_HZ = 2000000; + +/** @brief Tries to read EEPROM for Novena board signature + @return true if Novena board +*/ +bool IsNovenaBoard() +{ +#ifdef __unix__ + char data[8]; + int count = 6; + memset(data, 0, 8); + int addr = 0; + struct i2c_rdwr_ioctl_data session; + struct i2c_msg messages[2]; + char set_addr_buf[2]; + memset(set_addr_buf, 0, sizeof(set_addr_buf)); + memset(data, 0, count); + set_addr_buf[0] = addr>>8; + set_addr_buf[1] = addr; + messages[0].addr = 0xac>>1; + messages[0].flags = 0; + messages[0].len = sizeof(set_addr_buf); + messages[0].buf = set_addr_buf; + messages[1].addr = 0xac>>1; + messages[1].flags = I2C_M_RD; + messages[1].len = count; + messages[1].buf = data; + session.msgs = messages; + session.nmsgs = 2; + + bool isNovena = false; + + int fd = open("/dev/i2c-2", O_RDWR); + if(fd > 0) + { + if(ioctl(fd, I2C_RDWR, &session) < 0) + { + perror("Unable to communicate with i2c device"); + isNovena = false; + } + if(strcmp("Novena", data) == 0) + isNovena = true; + } + close(fd); + return isNovena; +#else + return false; +#endif +} + +/** @brief Initializes SPI port and exports needed GPIO +*/ +ConnectionSPI::ConnectionSPI() +{ + fd = -1; + m_connectionType = SPI_PORT; + std::fstream gpio; + //export SEN pin + gpio.open("/sys/class/gpio/export", ios::out); + if(gpio.good()) + { + gpio << 122; + gpio.flush(); + gpio.close(); + gpio.open("/sys/class/gpio/gpio122/direction", ios::out); + gpio << "out"; + gpio.flush(); + gpio.close(); + m_SEN.open("/sys/class/gpio/gpio122/value", ios::out); + m_SEN<< 1; + m_SEN.flush(); + cout << "GPIO122: set to 1" << endl; + } +} + +ConnectionSPI::~ConnectionSPI() +{ + Close(); + m_SEN.close(); +} + +/** @brief Opens connection to first found chip + @return 0-success +*/ +IConnection::DeviceStatus ConnectionSPI::Open() +{ + Close(); +#ifdef __unix__ + fd = open("/dev/spidev2.0", O_RDWR | O_SYNC); + if (fd < 0) + { + //MessageLog::getInstance()->write("SPI PORT: device not found\n", LOG_ERROR); + return IConnection::FAILURE; + } + int mode = SPI_MODE_0; + int ret = ioctl(fd, SPI_IOC_WR_MODE, &mode); + if (ret == -1) + printf("can't set spi mode"); + + ret = ioctl(fd, SPI_IOC_RD_MODE, &mode); + if (ret == -1) + printf("can't get spi mode"); + + /* + * bits per word + */ + int bits = 8; + ret = ioctl(fd, SPI_IOC_WR_BITS_PER_WORD, &bits); + if (ret == -1) + printf("can't set bits per word"); + + ret = ioctl(fd, SPI_IOC_RD_BITS_PER_WORD, &bits); + if (ret == -1) + printf("can't get bits per word"); + + /* + * max speed hz + */ + int speed = cSPI_SPEED_HZ; + ret = ioctl(fd, SPI_IOC_WR_MAX_SPEED_HZ, &speed); + if (ret == -1) + printf("can't set max speed hz"); + + ret = ioctl(fd, SPI_IOC_RD_MAX_SPEED_HZ, &speed); + if (ret == -1) + printf("can't get max speed hz"); + + printf("spi mode: 0x%x\n", mode); + printf("bits per word: %d\n", bits); + printf("max speed: %d Hz (%d KHz)\n", speed, speed/1000); + return IConnection::SUCCESS; +#else + return IConnection::FAILURE; +#endif +} + +/** @brief Opens connection to selected chip + @param index chip index in device list + @return 0-success +*/ +IConnection::DeviceStatus ConnectionSPI::Open(unsigned index) +{ + return Open(); +} + +/** @brief Closes connection to chip +*/ +void ConnectionSPI::Close() +{ +#ifdef __unix__ + close(fd); + fd = -1; +#endif +} + +/** @brief Returns whether chip is connected + @return chip is connected +*/ +bool ConnectionSPI::IsOpen() +{ + return (fd >= 0); +} + +/** @brief Sends data through SPI port + @param buffer data buffer to send + @param length size of data buffer + @param timeout_ms timeout limit for operation in milliseconds + @return Number of bytes sent +*/ +int ConnectionSPI::Write(const unsigned char *buffer, int length, int timeout_ms) +{ + #ifdef __unix__ + if(fd < 0) + return 0; + m_SEN << 0; + m_SEN.flush(); + unsigned long bytesWritten = 0; + rxbuf.clear(); + int bytesReceived = 0; + char rxbytes[2]; + while(bytesWritten < length) + { + int toWrite = length-bytesWritten > cSPI_BUF_SIZE ? cSPI_BUF_SIZE : length-bytesWritten; + for(int i=0; i<toWrite; i+=2) + { + if(buffer[i] < 0x80) //reading + { + write(fd, &buffer[i+bytesWritten], 2); + bytesReceived += read(fd, rxbytes, 2); + rxbuf.push_back(rxbytes[0]); + rxbuf.push_back(rxbytes[1]); + } + else //writing + { + write(fd, &buffer[i+bytesWritten], 4); + i+=2; //data bytes have been written + } + } + bytesWritten += toWrite; + } + m_SEN << 1; + m_SEN.flush(); + return bytesWritten; +#else + return 0; +#endif +} + +/** @brief Reads data from SPI port + @param buffer pointer to data buffer for receiving + @param length number of bytes to read + @param timeout_ms timeout limit for operation in milliseconds + @return Number of bytes received +*/ +int ConnectionSPI::Read(unsigned char *buffer, int length, int timeout_ms) +{ +#ifdef __unix__ + if(fd < 0) + return 0; + //because transfer is done in full duplex, function returns data from last transfer + int tocpy = length > rxbuf.size() ? rxbuf.size() : length; + memcpy(buffer, &rxbuf[0], tocpy); + rxbuf.clear(); + return tocpy; +#else + return 0; +#endif +} + +/** @brief Finds SPI port + @return number of devices found +*/ +int ConnectionSPI::RefreshDeviceList() +{ + m_deviceNames.clear(); +#ifdef __unix__ + int spidev = open("/dev/spidev2.0", O_RDWR); + if (spidev >= 0) + { + if(IsNovenaBoard() == true) + m_deviceNames.push_back("SPI (Novena)"); + else + m_deviceNames.push_back("SPI"); + } + close(spidev); +#endif + return m_deviceNames.size(); +} + +/** @brief Returns found devices names + @return vector of device names +*/ +vector<string> ConnectionSPI::GetDeviceNames() +{ + return m_deviceNames; +} + +int ConnectionSPI::GetOpenedIndex() +{ + return 0; +} diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/connectionManager/ConnectionSPI.h b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/connectionManager/ConnectionSPI.h new file mode 100644 index 0000000000000000000000000000000000000000..79d9bd9b9b690c470f156acfb1ebdd2a11e0b4ae --- /dev/null +++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/connectionManager/ConnectionSPI.h @@ -0,0 +1,41 @@ +/** +@file ConnectionSPI.h +@author Lime Microsystems (www.limemicro.com) +@brief Class for data communications through SPI port +*/ + +#ifndef CONNECTION_SPI_PORT_H +#define CONNECTION_SPI_PORT_H + +#include "IConnection.h" +#include <fstream> +#include <string> +#include <vector> + +class ConnectionSPI : public IConnection +{ +public: + static const int cSPI_BUF_SIZE; + static const int cSPI_SPEED_HZ; + + ConnectionSPI(); + ~ConnectionSPI(); + + DeviceStatus Open(); + DeviceStatus Open(unsigned i); + void Close(); + bool IsOpen(); + int GetOpenedIndex(); + + int Write(const unsigned char *buffer, int length, int timeout_ms = 0); + int Read(unsigned char *buffer, int length, int timeout_ms = 0); + + std::vector<std::string> GetDeviceNames(); + int RefreshDeviceList(); +protected: + std::vector<std::string> m_deviceNames; + std::vector<unsigned char> rxbuf; + int fd; + std::fstream m_SEN; +}; +#endif diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/connectionManager/ConnectionUSB.cpp b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/connectionManager/ConnectionUSB.cpp new file mode 100644 index 0000000000000000000000000000000000000000..b99fe6490bc30013bab77583e19deaa74b16c4b8 --- /dev/null +++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/connectionManager/ConnectionUSB.cpp @@ -0,0 +1,762 @@ +/** +@file ConnectionUSB.cpp +@author Lime Microsystems (www.limemicro.com) +@brief Data writing and reading through USB port +*/ + +#include "ConnectionUSB.h" +#include <string.h> + +#ifdef __unix__ + #include <thread> + #include <chrono> +#endif + +#define USB_TIMEOUT 1000 + +#define HW_LDIGIRED L"DigiRed" +#define HW_LDIGIGREEN L"DigiGreen" +#define HW_LSTREAMER L"Stream" + +#define HW_DIGIRED "DigiRed" +#define HW_DIGIGREEN "DigiGreen" +#define HW_STREAMER "Stream" + +#define CTR_W_REQCODE 0xC1 +#define CTR_W_VALUE 0x0000 +#define CTR_W_INDEX 0x0000 + +#define CTR_R_REQCODE 0xC0 +#define CTR_R_VALUE 0x0000 +#define CTR_R_INDEX 0x0000 + +/** @brief Initializes port type and object necessary to communicate to usb device. +*/ +ConnectionUSB::ConnectionUSB() +{ + m_hardwareName = ""; + isConnected = false; + m_connectionType = USB_PORT; +#ifndef __unix__ + USBDevicePrimary = new CCyUSBDevice(NULL); + OutCtrEndPt = NULL; + InCtrEndPt = NULL; + InCtrlEndPt3 = NULL; + OutCtrlEndPt3 = NULL; +#else + dev_handle = 0; + devs = 0; + int r = libusb_init(&ctx); //initialize the library for the session we just declared + if(r < 0) + printf("Init Error %i\n", r); //there was an error + libusb_set_debug(ctx, 3); //set verbosity level to 3, as suggested in the documentation +#endif + currentDeviceIndex = -1; +} + +/** @brief Closes connection to chip and deallocates used memory. +*/ +ConnectionUSB::~ConnectionUSB() +{ + Close(); +#ifndef __unix__ + delete USBDevicePrimary; +#else + libusb_exit(ctx); +#endif +} + +/** @brief Automatically open first available chip connected to usb port. + @return 0-success, other-failure +*/ +IConnection::DeviceStatus ConnectionUSB::Open() +{ + currentDeviceIndex = -1; + if(m_deviceNames.size() == 0) + RefreshDeviceList(); + +#ifndef __unix__ + for(int i=0; i<USBDevicePrimary->DeviceCount(); ++i) + if( Open(i) == SUCCESS) + { + currentDeviceIndex = i; + return SUCCESS; + } +#else + if(Open(0) == SUCCESS) + return SUCCESS; +#endif + return FAILURE; +} + +/** @brief Tries to open connected USB device and find communication endpoints. + @return Returns 1-Success, 0-EndPoints not found or device didn't connect. +*/ +IConnection::DeviceStatus ConnectionUSB::Open(unsigned index) +{ +#ifndef __unix__ + wstring m_hardwareDesc = L""; + if( index < USBDevicePrimary->DeviceCount()) + { + if(USBDevicePrimary->Open(index)) + { + m_hardwareDesc = USBDevicePrimary->Product; + unsigned int pos; + //determine connected board type + pos = m_hardwareDesc.find(HW_LDIGIRED, 0); + if( pos != wstring::npos ) + m_hardwareName = HW_DIGIRED; + else if (m_hardwareDesc.find(HW_LSTREAMER, 0) != wstring::npos) + m_hardwareName = HW_STREAMER; + else + m_hardwareName = HW_STREAMER; + + + if (InCtrlEndPt3) + { + delete InCtrlEndPt3; + InCtrlEndPt3 = NULL; + } + InCtrlEndPt3 = new CCyControlEndPoint(*USBDevicePrimary->ControlEndPt); + + if (OutCtrlEndPt3) + { + delete OutCtrlEndPt3; + OutCtrlEndPt3 = NULL; + } + OutCtrlEndPt3 = new CCyControlEndPoint(*USBDevicePrimary->ControlEndPt); + + InCtrlEndPt3->ReqCode = CTR_R_REQCODE; + InCtrlEndPt3->Value = CTR_R_VALUE; + InCtrlEndPt3->Index = CTR_R_INDEX; + + OutCtrlEndPt3->ReqCode = CTR_W_REQCODE; + OutCtrlEndPt3->Value = CTR_W_VALUE; + OutCtrlEndPt3->Index = CTR_W_INDEX; + + for (int i=0; i<USBDevicePrimary->EndPointCount(); i++) + if(USBDevicePrimary->EndPoints[i]->Address == 0x01) + { + OutEndPt = USBDevicePrimary->EndPoints[i]; + long len = OutEndPt->MaxPktSize * 64; + OutEndPt->SetXferSize(len); + break; + } + for (int i=0; i<USBDevicePrimary->EndPointCount(); i++) + if(USBDevicePrimary->EndPoints[i]->Address == 0x81) + { + InEndPt = USBDevicePrimary->EndPoints[i]; + long len = InEndPt->MaxPktSize * 64; + InEndPt->SetXferSize(len); + break; + } + isConnected = true; + return SUCCESS; + } //successfully opened device + } //if has devices + return FAILURE; +#else + if(index >= 0 && index < m_dev_pid_vid.size()) + { + dev_handle = libusb_open_device_with_vid_pid(ctx, m_dev_pid_vid[index].second, m_dev_pid_vid[index].first); + + if(dev_handle == 0) + return FAILURE; + if(libusb_kernel_driver_active(dev_handle, 0) == 1) //find out if kernel driver is attached + { + printf("Kernel Driver Active\n"); + if(libusb_detach_kernel_driver(dev_handle, 0) == 0) //detach it + printf("Kernel Driver Detached!\n"); + } + int r = libusb_claim_interface(dev_handle, 0); //claim interface 0 (the first) of device + if(r < 0) + { + printf("Cannot Claim Interface\n"); + return CANNOT_CLAIM_INTERFACE; + } + printf("Claimed Interface\n"); + isConnected = true; + return SUCCESS; + } + else + { + return FAILURE; + } +#endif +} + +/** @brief Closes communication to device. +*/ +void ConnectionUSB::Close() +{ + #ifndef __unix__ + USBDevicePrimary->Close(); + InEndPt = NULL; + OutEndPt = NULL; + if (InCtrlEndPt3) + { + delete InCtrlEndPt3; + InCtrlEndPt3 = NULL; + } + if (OutCtrlEndPt3) + { + delete OutCtrlEndPt3; + OutCtrlEndPt3 = NULL; + } + #else + if(dev_handle != 0) + { + libusb_release_interface(dev_handle, 0); + libusb_close(dev_handle); + dev_handle = 0; + } + #endif + isConnected = false; +} + +/** @brief Returns connection status + @return 1-connection open, 0-connection closed. +*/ +bool ConnectionUSB::IsOpen() +{ + #ifndef __unix__ + return USBDevicePrimary->IsOpen() && isConnected; + #else + return isConnected; + #endif +} + +/** @brief Sends given data buffer to chip through USB port. + @param buffer data buffer, must not be longer than 64 bytes. + @param length given buffer size. + @param timeout_ms timeout limit for operation in milliseconds + @return number of bytes sent. +*/ +int ConnectionUSB::Write(const unsigned char *buffer, const int length, int timeout_ms) +{ + long len = length; + if(IsOpen()) + { + unsigned char* wbuffer = new unsigned char[length]; + memcpy(wbuffer, buffer, length); + if(m_hardwareName == HW_DIGIRED || m_hardwareName == HW_STREAMER) + { + #ifndef __unix__ + if(OutCtrlEndPt3) + OutCtrlEndPt3->Write(wbuffer, len); + else + len = 0; + #else + len = libusb_control_transfer(dev_handle, LIBUSB_REQUEST_TYPE_VENDOR,CTR_W_REQCODE ,CTR_W_VALUE, CTR_W_INDEX, wbuffer, length, USB_TIMEOUT); + #endif + } + else + { + #ifndef __unix__ + if(OutCtrEndPt) + OutCtrEndPt->XferData(wbuffer, len); + else + len = 0; + #else + int actual = 0; + libusb_bulk_transfer(dev_handle, 0x01, wbuffer, len, &actual, USB_TIMEOUT); + len = actual; + #endif + } + delete wbuffer; + } + else + return 0; + return len; +} + +/** @brief Reads data coming from the chip through USB port. + @param buffer pointer to array where received data will be copied, array must be + big enough to fit received data. + @param length number of bytes to read from chip. + @param timeout_ms timeout limit for operation in milliseconds + @return number of bytes received. +*/ +int ConnectionUSB::Read(unsigned char *buffer, const int length, int timeout_ms) +{ + long len = length; + if(IsOpen()) + { + if(m_hardwareName == HW_DIGIRED || m_hardwareName == HW_STREAMER) + { + #ifndef __unix__ + if(InCtrlEndPt3) + InCtrlEndPt3->Read(buffer, len); + else + len = 0; + #else + len = libusb_control_transfer(dev_handle, LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_ENDPOINT_IN ,CTR_R_REQCODE ,CTR_R_VALUE, CTR_R_INDEX, buffer, len, USB_TIMEOUT); + #endif + } + else + { + #ifndef __unix__ + if(InCtrEndPt) + InCtrEndPt->XferData(buffer, len); + else + len = 0; + #else + int actual = 0; + libusb_bulk_transfer(dev_handle, 0x81, buffer, len, &actual, USB_TIMEOUT); + len = actual; + #endif + } + } + return len; +} + +#ifdef __unix__ +/** @brief Function for handling libusb callbacks +*/ +void callback_libusbtransfer(libusb_transfer *trans) +{ + USBTransferContext *context = reinterpret_cast<USBTransferContext*>(trans->user_data); + switch(trans->status) + { + case LIBUSB_TRANSFER_CANCELLED: + printf("Transfer canceled\n" ); + context->bytesXfered = trans->actual_length; + context->done = true; + context->used = false; + context->reset(); + break; + case LIBUSB_TRANSFER_COMPLETED: + if(trans->actual_length == context->bytesExpected) + { + context->bytesXfered = trans->actual_length; + context->done = true; + } + //printf("Transfer complete %i\n", trans->actual_length); + break; + case LIBUSB_TRANSFER_ERROR: + printf("TRANSFER ERRRO\n"); + break; + case LIBUSB_TRANSFER_TIMED_OUT: + printf("transfer timed out\n"); + + break; + case LIBUSB_TRANSFER_OVERFLOW: + printf("transfer overflow\n"); + + break; + case LIBUSB_TRANSFER_STALL: + printf("transfer stalled\n"); + break; + } + context->mPacketProcessed.notify_one(); +} +#endif + +/** @brief Finds all chips connected to usb ports + @return number of devices found +*/ +int ConnectionUSB::RefreshDeviceList() +{ + #ifndef __unix__ + USBDevicePrimary->Close(); + currentDeviceIndex = -1; + m_deviceNames.clear(); + string name; + if (USBDevicePrimary->DeviceCount()) + { + for (int i=0; i<USBDevicePrimary->DeviceCount(); ++i) + { + Open(i); + name = DeviceName(); + m_deviceNames.push_back(name); + } + currentDeviceIndex = -1; + } + #else + m_dev_pid_vid.clear(); + m_deviceNames.clear(); + int usbDeviceCount = libusb_get_device_list(ctx, &devs); + if(usbDeviceCount > 0) + { + libusb_device_descriptor desc; + for(int i=0; i<usbDeviceCount; ++i) + { + int r = libusb_get_device_descriptor(devs[i], &desc); + if(r<0) + printf("failed to get device description\n"); + int pid = desc.idProduct; + int vid = desc.idVendor; + + if( vid == 1204) + { + if(pid == 34323) + { + m_hardwareName = HW_DIGIGREEN; + m_deviceNames.push_back("DigiGreen"); + m_dev_pid_vid.push_back( pair<int,int>(pid,vid)); + } + else if(pid == 241) + { + m_hardwareName = HW_DIGIRED; + libusb_device_handle *tempDev_handle; + tempDev_handle = libusb_open_device_with_vid_pid(ctx, vid, pid); + if(libusb_kernel_driver_active(tempDev_handle, 0) == 1) //find out if kernel driver is attached + { + if(libusb_detach_kernel_driver(tempDev_handle, 0) == 0) //detach it + printf("Kernel Driver Detached!\n"); + } + if(libusb_claim_interface(tempDev_handle, 0) < 0) //claim interface 0 (the first) of device + { + printf("Cannot Claim Interface\n"); + } + + string fullName; + //check operating speed + int speed = libusb_get_device_speed(devs[i]); + if(speed == LIBUSB_SPEED_HIGH) + fullName = "USB 2.0"; + else if(speed == LIBUSB_SPEED_SUPER) + fullName = "USB 3.0"; + else + fullName = "USB"; + fullName += " ("; + //read device name + char data[255]; + memset(data, 0, 255); + int st = libusb_get_string_descriptor_ascii(tempDev_handle, 2, (unsigned char*)data, 255); + if(strlen(data) > 0) + fullName += data; + fullName += ")"; + libusb_close(tempDev_handle); + + m_deviceNames.push_back(fullName); + m_dev_pid_vid.push_back( pair<int,int>(pid,vid)); + } + } + } + } + else + { + libusb_free_device_list(devs, 1); + return 0; + } + #endif + return m_deviceNames.size(); +} + +void ConnectionUSB::ClearComm() +{ +} + +/** @return name of currently opened device as string. +*/ +string ConnectionUSB::DeviceName() +{ +#ifndef __unix__ + string name; + char tempName[USB_STRING_MAXLEN]; + //memcpy(tempName, USBDevicePrimary->FriendlyName, USB_STRING_MAXLEN); + //name = tempName; + + for (int i = 0; i < USB_STRING_MAXLEN; ++i) + tempName[i] = USBDevicePrimary->DeviceName[i]; + if (USBDevicePrimary->bSuperSpeed == true) + name = "USB 3.0"; + else if (USBDevicePrimary->bHighSpeed == true) + name = "USB 2.0"; + else + name = "USB"; + name += " ("; + name += tempName; + name += ")"; + return name; +#else + if(dev_handle != 0) + { + char data[255]; + int st = libusb_get_string_descriptor_ascii(dev_handle, 2, (unsigned char*)data, 255); + return string(data); + } + return "no name"; +#endif +} + +/** + @brief Starts asynchronous data reading from board + @param *buffer buffer where to store received data + @param length number of bytes to read + @return handle of transfer context +*/ +int ConnectionUSB::BeginDataReading(char *buffer, long length) +{ + int i = 0; + bool contextFound = false; + //find not used context + for(i = 0; i<USB_MAX_CONTEXTS; i++) + { + if(!contexts[i].used) + { + contextFound = true; + break; + } + } + if(!contextFound) + return -1; + contexts[i].used = true; + #ifndef __unix__ + if(InEndPt) + contexts[i].context = InEndPt->BeginDataXfer((unsigned char*)buffer, length, contexts[i].inOvLap); + return i; + #else + unsigned int Timeout = 1000; + libusb_transfer *tr = contexts[i].transfer; + libusb_fill_bulk_transfer(tr, dev_handle, 0x81, (unsigned char*)buffer, length, callback_libusbtransfer, &contexts[i], Timeout); + contexts[i].done = false; + contexts[i].bytesXfered = 0; + contexts[i].bytesExpected = length; + int status = libusb_submit_transfer(tr); + int actual = 0; + //int status = libusb_bulk_transfer(dev_handle, 0x81, (unsigned char*)buffer, length, &actual, USB_TIMEOUT); + if(status != 0) + printf("ERROR BEGIN DATA TRANSFER %s\n", libusb_error_name(status)); + #endif + return i; +} + +/** + @brief Waits for asynchronous data reception + @param contextHandle handle of which context data to wait + @param timeout_ms number of miliseconds to wait + @return 1-data received, 0-data not received +*/ +int ConnectionUSB::WaitForReading(int contextHandle, unsigned int timeout_ms) +{ + if( contexts[contextHandle].used == true && contextHandle >= 0) + { + int status = 0; + #ifndef __unix__ + if(InEndPt) + status = InEndPt->WaitForXfer(contexts[contextHandle].inOvLap, timeout_ms); + return status; + #else + auto t1 = chrono::high_resolution_clock::now(); + auto t2 = chrono::high_resolution_clock::now(); + while(contexts[contextHandle].done == false && std::chrono::duration_cast<std::chrono::milliseconds>(t2 - t1).count() < timeout_ms) + { + struct timeval tv; + tv.tv_sec = 1; + tv.tv_usec = 0; + //if(libusb_handle_events(ctx) != 0) + if(libusb_handle_events_timeout_completed(ctx, &tv, NULL) != 0) + printf("error libusb_handle_events %i\n", status); + t2 = chrono::high_resolution_clock::now(); + std::this_thread::sleep_for(std::chrono::milliseconds(1)); + } + std::unique_lock<std::mutex> lck(contexts[contextHandle].m_lock); + while(contexts[contextHandle].done == false) //is changed in libusb callback + { + if(contexts[contextHandle].mPacketProcessed.wait_for(lck, std::chrono::milliseconds(timeout_ms)) == std::cv_status::timeout) + return 0; + } + return contexts[contextHandle].done == true; + #endif + } + else + return 0; +} + +/** + @brief Finishes asynchronous data reading from board + @param buffer array where to store received data + @param length number of bytes to read, function changes this value to number of bytes actually received + @param contextHandle handle of which context to finish + @return false failure, true number of bytes received +*/ +int ConnectionUSB::FinishDataReading(char *buffer, long &length, int contextHandle) +{ + if( contexts[contextHandle].used == true && contextHandle >= 0) + { + #ifndef __unix__ + int status = 0; + if(InEndPt) + status = InEndPt->FinishDataXfer((unsigned char*)buffer, length, contexts[contextHandle].inOvLap, contexts[contextHandle].context); + contexts[contextHandle].used = false; + contexts[contextHandle].reset(); + return length; + #else + length = contexts[contextHandle].bytesXfered; + contexts[contextHandle].used = false; + contexts[contextHandle].reset(); + return length; + #endif + } + else + return 0; +} + +int ConnectionUSB::ReadDataBlocking(char *buffer, long &length, int timeout_ms) +{ +#ifndef __unix__ + return InEndPt->XferData((unsigned char*)buffer, length); +#else + return 0; +#endif +} + + +/** + @brief Aborts reading operations +*/ +void ConnectionUSB::AbortReading() +{ +#ifndef __unix__ + InEndPt->Abort(); +#else + for(int i=0; i<USB_MAX_CONTEXTS; ++i) + { + libusb_cancel_transfer( contexts[i].transfer ); + } +#endif +} + +/** + @brief Starts asynchronous data Sending to board + @param *buffer buffer to send + @param length number of bytes to send + @return handle of transfer context +*/ +int ConnectionUSB::BeginDataSending(const char *buffer, long length) +{ + int i = 0; + //find not used context + bool contextFound = false; + for(i = 0; i<USB_MAX_CONTEXTS; i++) + { + if(!contextsToSend[i].used) + { + contextFound = true; + break; + } + } + if(!contextFound) + return -1; + contextsToSend[i].used = true; + #ifndef __unix__ + if(OutEndPt) + contextsToSend[i].context = OutEndPt->BeginDataXfer((unsigned char*)buffer, length, contextsToSend[i].inOvLap); + return i; + #else + unsigned int Timeout = 1000; + libusb_transfer *tr = contextsToSend[i].transfer; + //libusb_set_iso_packet_lengths(contexts[i].transfer, 512*64); + libusb_fill_bulk_transfer(tr, dev_handle, 0x1, (unsigned char*)buffer, length, callback_libusbtransfer, &contextsToSend[i], Timeout); + contextsToSend[i].done = false; + contextsToSend[i].bytesXfered = 0; + contextsToSend[i].bytesExpected = length; + libusb_submit_transfer(tr); + #endif + return i; +} + +/** + @brief Waits for asynchronous data sending + @param contextHandle handle of which context data to wait + @param timeout_ms number of miliseconds to wait + @return 1-data received, 0-data not received +*/ +int ConnectionUSB::WaitForSending(int contextHandle, unsigned int timeout_ms) +{ + if( contextsToSend[contextHandle].used == true ) + { + #ifndef __unix__ + int status = 0; + if(OutEndPt) + status = OutEndPt->WaitForXfer(contextsToSend[contextHandle].inOvLap, timeout_ms); + return status; + #else + auto t1 = chrono::high_resolution_clock::now(); + auto t2 = chrono::high_resolution_clock::now(); + while(contextsToSend[contextHandle].done == false && std::chrono::duration_cast<std::chrono::milliseconds>(t2 - t1).count() < timeout_ms) + { + struct timeval tv; + tv.tv_sec = 1; + tv.tv_usec = 0; + int status = libusb_handle_events_timeout_completed(ctx, &tv, NULL); + if(status != 0) + printf("error libusb_handle_events %i\n", status); + t2 = chrono::high_resolution_clock::now(); + std::this_thread::sleep_for(std::chrono::milliseconds(1)); + } + std::unique_lock<std::mutex> lck(contextsToSend[contextHandle].m_lock); + while(contextsToSend[contextHandle].done == false) //is changed in libusb callback + { + if(contextsToSend[contextHandle].mPacketProcessed.wait_for(lck, std::chrono::milliseconds(timeout_ms)) == std::cv_status::timeout) + return 0; + } + return contextsToSend[contextHandle].done == true; + #endif + } + else + return 0; +} + +/** + @brief Finishes asynchronous data sending to board + @param buffer array where to store received data + @param length number of bytes to read, function changes this value to number of bytes acctually received + @param contextHandle handle of which context to finish + @return false failure, true number of bytes sent +*/ +int ConnectionUSB::FinishDataSending(const char *buffer, long &length, int contextHandle) +{ + if( contextsToSend[contextHandle].used == true) + { + #ifndef __unix__ + if(OutEndPt) + OutEndPt->FinishDataXfer((unsigned char*)buffer, length, contextsToSend[contextHandle].inOvLap, contextsToSend[contextHandle].context); + contextsToSend[contextHandle].used = false; + contextsToSend[contextHandle].reset(); + return length; + #else + length = contextsToSend[contextHandle].bytesXfered; + contextsToSend[contextHandle].used = false; + contextsToSend[contextHandle].reset(); + return length; + #endif + } + else + return 0; +} + +/** + @brief Aborts sending operations +*/ +void ConnectionUSB::AbortSending() +{ +#ifndef __unix__ + OutEndPt->Abort(); +#else + for (int i = 0; i<USB_MAX_CONTEXTS; ++i) + { + libusb_cancel_transfer(contextsToSend[i].transfer); + } + for(int i=0; i<USB_MAX_CONTEXTS; ++i) + { + contextsToSend[i].used = false; + contextsToSend[i].reset(); + } +#endif +} + +int ConnectionUSB::GetOpenedIndex() +{ + return currentDeviceIndex; +} + +/** @brief Returns found devices names + @return vector of device names +*/ +vector<string> ConnectionUSB::GetDeviceNames() +{ + return m_deviceNames; +} diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/connectionManager/ConnectionUSB.h b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/connectionManager/ConnectionUSB.h new file mode 100644 index 0000000000000000000000000000000000000000..f3048c184200e5bb5bdb875392c957ca45c75a7b --- /dev/null +++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/connectionManager/ConnectionUSB.h @@ -0,0 +1,144 @@ +/** +@file ConnectionUSB.h +@author Lime Microsystems (www.limemicro.com) +@brief Class for data writing and reading through USB port +*/ + +#ifndef USB_PORT_CONNECTION_H +#define USB_PORT_CONNECTION_H + +#include "IConnection.h" + +#ifndef __unix__ +#include "windows.h" +#include "CyAPI.h" +#else +#include <libusb-1.0/libusb.h> +#include <mutex> +#include <condition_variable> +#include <chrono> +#endif + +#define USB_MAX_CONTEXTS 64 //maximum number of contexts for asynchronous transfers + +/** @brief Wrapper class for holding USB asynchronous transfers contexts +*/ +class USBTransferContext +{ +public: + USBTransferContext() : used(false) + { + #ifndef __unix__ + inOvLap = new OVERLAPPED; + memset(inOvLap, 0, sizeof(OVERLAPPED)); + inOvLap->hEvent = CreateEvent(NULL, false, false, NULL); + context = NULL; + #else + transfer = libusb_alloc_transfer(0); + bytesXfered = 0; + bytesExpected = 0; + done = 0; + #endif + } + ~USBTransferContext() + { + #ifndef __unix__ + CloseHandle(inOvLap->hEvent); + delete inOvLap; + #else + libusb_free_transfer(transfer); + #endif + } + bool reset() + { + if(used) + return false; + #ifndef __unix__ + CloseHandle(inOvLap->hEvent); + memset(inOvLap, 0, sizeof(OVERLAPPED)); + inOvLap->hEvent = CreateEvent(NULL, false, false, NULL); + #endif + return true; + } + bool used; + #ifndef __unix__ + PUCHAR context; + OVERLAPPED *inOvLap; + #else + libusb_transfer* transfer; + long bytesXfered; + long bytesExpected; + bool done; + std::mutex m_lock; + std::condition_variable mPacketProcessed; + #endif +}; + +class ConnectionUSB : public IConnection +{ +public: + ConnectionUSB(); + ~ConnectionUSB(); + + void FindDevices(); + DeviceStatus Open(); + DeviceStatus Open(unsigned index); + void Close(); + bool IsOpen(); + int GetOpenedIndex(); + + int Write(const unsigned char *buffer, int length, int timeout_ms = 0); + int Read(unsigned char *buffer, int length, int timeout_ms = 0); + + virtual int BeginDataReading(char *buffer, long length); + virtual int WaitForReading(int contextHandle, unsigned int timeout_ms); + virtual int FinishDataReading(char *buffer, long &length, int contextHandle); + virtual void AbortReading(); + virtual int ReadDataBlocking(char *buffer, long &length, int timeout_ms); + + virtual int BeginDataSending(const char *buffer, long length); + virtual int WaitForSending(int contextHandle, unsigned int timeout_ms); + virtual int FinishDataSending(const char *buffer, long &length, int contextHandle); + virtual void AbortSending(); + + std::vector<std::string> GetDeviceNames(); + int RefreshDeviceList(); + void ClearComm(); +private: + int currentDeviceIndex; + std::string DeviceName(); + + std::vector<std::string> m_deviceNames; + std::string m_hardwareName; + int m_hardwareVer; + + USBTransferContext contexts[USB_MAX_CONTEXTS]; + USBTransferContext contextsToSend[USB_MAX_CONTEXTS]; + void Initialize(); + + bool isConnected; + int currentPortIndex; + + #ifndef __unix__ + CCyUSBDevice *USBDevicePrimary; + //control endpoints for DigiRed + CCyControlEndPoint *InCtrlEndPt3; + CCyControlEndPoint *OutCtrlEndPt3; + + //control endpoints for DigiGreen + CCyUSBEndPoint *OutCtrEndPt; + CCyUSBEndPoint *InCtrEndPt; + + //end points for samples reading and writing + CCyUSBEndPoint *InEndPt; + CCyUSBEndPoint *OutEndPt; + + #else + libusb_device **devs; //pointer to pointer of device, used to retrieve a list of devices + libusb_device_handle *dev_handle; //a device handle + libusb_context *ctx; //a libusb session + std::vector<std::pair<int,int> > m_dev_pid_vid; + #endif +}; + +#endif diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/connectionManager/IConnection.h b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/connectionManager/IConnection.h new file mode 100644 index 0000000000000000000000000000000000000000..5804f1149f104c4d834c710eaf6f38f75bc9a6d3 --- /dev/null +++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/connectionManager/IConnection.h @@ -0,0 +1,68 @@ +/** + @file IConnection.h + @author Lime Microsystems + @brief Interface class for connection types +*/ + +#ifndef ICONNECTION_H +#define ICONNECTION_H + +#include <string> +#include <vector> + +using namespace std; + +class IConnection +{ +public: + /// Supported connection types. + enum eConnectionType + { + CONNECTION_UNDEFINED = -1, + COM_PORT = 0, + USB_PORT = 1, + SPI_PORT = 2, + //insert new types here + CONNECTION_TYPES_COUNT //used only for memory allocation + }; + + enum DeviceStatus + { + SUCCESS, + FAILURE, + END_POINTS_NOT_FOUND, + CANNOT_CLAIM_INTERFACE + }; + + IConnection() : m_connectionType(CONNECTION_UNDEFINED){}; + virtual ~IConnection(){}; + virtual int RefreshDeviceList() = 0; + virtual DeviceStatus Open(unsigned i) = 0; + virtual void Close() = 0; + virtual bool IsOpen() = 0; + virtual int GetOpenedIndex() = 0; + + virtual int Write(const unsigned char *buffer, int length, int timeout_ms = 0) = 0; + virtual int Read(unsigned char *buffer, int length, int timeout_ms = 0) = 0; + + virtual std::vector<std::string> GetDeviceNames() = 0; + + virtual eConnectionType GetType() { return m_connectionType; }; + virtual bool SetParam(const char *name, const char* value) {return false;}; + + virtual int BeginDataReading(char *buffer, long length){ return -1; }; + virtual int WaitForReading(int contextHandle, unsigned int timeout_ms){ return 0;}; + virtual int FinishDataReading(char *buffer, long &length, int contextHandle){ return 0;} + virtual void AbortReading(){}; + virtual int ReadDataBlocking(char *buffer, long &length, int timeout_ms){ return 0; } + + virtual int BeginDataSending(const char *buffer, long length){ return -1; }; + virtual int WaitForSending(int contextHandle, unsigned int timeout_ms){ return 0;}; + virtual int FinishDataSending(const char *buffer, long &length, int contextHandle){ return 0;} + virtual void AbortSending(){}; +protected: + eConnectionType m_connectionType; +}; + +#endif + diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/cpp-feather-ini-parser/INI.h b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/cpp-feather-ini-parser/INI.h new file mode 100644 index 0000000000000000000000000000000000000000..de54b4e7b49d9b8b113aa5abf7cc2849dce4df53 --- /dev/null +++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/cpp-feather-ini-parser/INI.h @@ -0,0 +1,639 @@ +/* + Feather INI Parser - 1.40 + You are free to use this however you wish. + + If you find a bug, please attept to debug the cause. + Post your environment details and the cause or fix in the issues section of GitHub. + + Written by Turbine. + + Website: + https://github.com/Turbine1991/feather-ini-parser + http://code.google.com/p/feather-ini-parser/downloads + + Help: + Bundled example & readme. + http://code.google.com/p/feather-ini-parser/wiki/Tutorials +*/ + +#pragma once + +#include <string> +#include <fstream> +#include <sstream> +#include <stdint.h> +#include <stdio.h> +#include <stdlib.h> + +#define FINI_SAFE +#define FINI_BUFFER_SIZE 128 + +#if __cplusplus >= 201103L + #include <unordered_map> + #define FINI_CPP11 + #define ALLOCATE_SECTIONS 100 + #define ALLOCATE_KEYS 5 +#else + #include <map> +#endif + +#ifdef FINI_WIDE_SUPPORT + #include <wchar.h> + + typedef std::wstringstream fini_sstream_t; + typedef std::wstring fini_string_t; + typedef wchar_t fini_char_t; + typedef std::wifstream fini_ifstream_t; + typedef std::wofstream fini_ofstream_t; + + #define fini_strlen(a) wcslen(a) + #define fini_strncpy(a, b) wcscpy(a, b) + #define fini_strncpy(a, b, c) wcsncpy(a, b, c) + #define fini_strtok(a, b) wcstok(a, b) + + #define _T(x) L ##x +#else + #include <cstring> + + typedef std::stringstream fini_sstream_t; + typedef std::string fini_string_t; + typedef char fini_char_t; + typedef std::ifstream fini_ifstream_t; + typedef std::ofstream fini_ofstream_t; + + #define fini_strlen(a) strlen(a) + #define fini_strcpy(a, b) strcpy(a, b) + #define fini_strncpy(a, b, c) strncpy(a, b, c) + #define fini_strtok(a, b) strtok(a, b) + + #define _T(x) x +#endif + +#define CHAR_SIZE sizeof(fini_char_t) + +///Simple converter using templates and streams to effectively required for the flexibility of handling native types +class Converters +{ +public: + template <typename T, typename U> + static T Convert(U value); + template <typename T> + static void GetLine(fini_sstream_t& out, T& value); + static void GetLine(fini_sstream_t& out, fini_string_t& value); + template <typename T> + static size_t GetDataSize(T& value); + static size_t GetDataSize(fini_string_t value); +}; + +/// +template <typename T = fini_string_t, typename U = fini_string_t, typename V = fini_string_t> + class INI +{ +public: + typedef T section_t; + typedef U key_t; + typedef V value_t; + typedef INI<section_t, key_t, value_t> ini_t; + +///Type definition declarations +#ifdef FINI_CPP11 + typedef typename std::unordered_map<key_t, value_t> keys_t; + typedef typename std::unordered_map<section_t, keys_t*> sections_t; +#else + typedef typename std::map<key_t, value_t> keys_t; + typedef typename std::map<section_t, keys_t*> sections_t; +#endif + + typedef typename keys_t::iterator keysit_t; + typedef typename sections_t::iterator sectionsit_t; + + typedef typename std::pair<key_t, value_t> keyspair_t; + typedef typename std::pair<section_t, keys_t*> sectionspair_t; + + typedef char data_t; + + enum source_e {SOURCE_FILE, SOURCE_MEMORY}; + +///Data members + std::string filename; + data_t* data; + size_t dataSize; + keys_t* current; + sections_t sections; + source_e source; + +///Constuctor/Destructor + //Specify the filename to associate and whether to parse immediately + INI(const std::string filename, bool doParse): filename(filename) + { + init(SOURCE_FILE, doParse); + } + + //Used for loading INI from memory + INI(void* data, size_t dataSize, bool doParse): data((data_t*)data), dataSize(dataSize) + { + init(SOURCE_MEMORY, doParse); + } + + ~INI() + { + clear(); + } + +///Access Content + //Provide bracket access to section contents + keys_t& operator[](section_t section) + { + #ifdef FINI_SAFE + if (!sections[section]) + sections[section] = new keys_t; + #endif + + return *sections[section]; + } + + //Create a new section and select it + bool create(const section_t section) + { + if (select(section)) + return false; + + current = new keys_t; + sections[section] = current; + + reserveKeys(current); + + return true; + } + + //Select a section for performing operations + bool select(const section_t section) + { + sectionsit_t sectionsit = sections.find(section); + if (sectionsit == sections.end()) + return false; + + current = sectionsit->second; + + return true; + } + +///Set + //Assign a value for key under the selected section + bool set(const key_t key, const value_t value) + { + if (current == NULL) + return false; + + (*current)[key] = value; + + return true; + } + + template <typename W, typename X> + bool set(const W key, const X value) + { return set(Converters::Convert<key_t>(key), Converters::Convert<value_t>(value)); } + +///Get + value_t get(const key_t key, value_t def = value_t()) + { + keysit_t it = current->find(key); + if (current == NULL || it == current->end()) + return def; + + return it->second; + } + + value_t get(const section_t section, const key_t key, value_t def) + { + if (!select(section)) + return def; + + return get(key, def); + } + + template <typename W, typename X> + X get(const W key, const X def = value_t()) + { return Converters::Convert<X>(get(Converters::Convert<key_t>(key), Converters::Convert<value_t>(def))); } + + template <typename W> + fini_string_t get(const W key, const fini_char_t* def = _T("")) //Handle C string default value without casting + { return Converters::Convert<fini_string_t>(get(Converters::Convert<key_t>(key), Converters::Convert<value_t>(def))); } + + template <typename W, typename X, typename Y> + Y get(const W section, const X key, const Y def) + { return Converters::Convert<Y>(get(Converters::Convert<section_t>(section), Converters::Convert<key_t>(key), Converters::Convert<value_t>(def))); } + + template <typename W, typename X> + fini_string_t get(const W section, const X key, const fini_char_t* def) //Handle C string default value without casting + { return Converters::Convert<fini_string_t>(Converters::Convert<section_t>(section), get(Converters::Convert<key_t>(key), Converters::Convert<value_t>(def))); } + +///Functions + void parse(std::istream& file) + { + fini_char_t line[FINI_BUFFER_SIZE]; + bool first = true; + fini_sstream_t out; + + while(!file.eof()) + { + file.getline(line, FINI_BUFFER_SIZE); + + if (first) + { + first = false; + if (line[0] == 0xEF) //Allows handling of UTF-16/32 documents + { + memmove(line, line + (CHAR_SIZE * 3), CHAR_SIZE * (FINI_BUFFER_SIZE - 3)); + return; + } + } + + nake(line); + + if (line[0]) + { + size_t len = fini_strlen(line); + if (len > 0 && !((len >= 2 && (line[0] == '/' && line[1] == '/')) || (len >= 1 && line[0] == '#'))) //Ignore comment and empty lines + { + if (line[0] == '[') //Section + { + section_t section; + size_t length = fini_strlen(line) - 2; //Without section brackets + while(isspace(line[length + 1])) //Leave out any additional new line characters, not "spaces" as the name suggests + --length; + + fini_char_t* ssection = (fini_char_t*)calloc(CHAR_SIZE, length + 1); + fini_strncpy(ssection, line + 1, length); //Count after first bracket + + current = new keys_t; + + out << ssection; + free(ssection); + Converters::GetLine(out, section); + + sections[section] = current; + } + else //Key + { + key_t key; + value_t value; + + fini_char_t* skey; + fini_char_t* svalue; + + skey = fini_strtok(line, _T("=")); + svalue = fini_strtok(NULL, _T("\n")); + + if (skey && svalue) + { + size_t index = 0; //Without section brackets + while(isspace(skey[index])) //Leave out any additional new line characters, not "spaces" as the name suggests + index++; + + if (index != 0) //Has preceeding white space + fini_strcpy(skey, skey + index); + + out << skey; + + Converters::GetLine(out, key); + + out.clear(); + out.str(fini_string_t()); + + out << svalue; + Converters::GetLine(out, value); + + if (value != value_t()) + (*current)[key] = value; + } + } + + out.clear(); + out.str(fini_string_t()); //Clear existing stream; + } + } + } + } + + //Parse an INI's contents into memory from the filename given during construction + bool parse() + { + switch(source) + { + case SOURCE_FILE: { + fini_ifstream_t file(filename.c_str()); + + if (!file.is_open()) + return false; + + parse(file); + + file.close(); + } + break; + + case SOURCE_MEMORY: { + std::stringstream sstream; + sstream.rdbuf()->pubsetbuf(data, dataSize); + + parse(sstream); + } + break; + } + + return true; + } + + bool parseBinary() + { + fini_ifstream_t file(filename.c_str(), std::ios::binary); + if (!file.is_open()) + return false; + + size_t sectionCount; + size_t keyCount; + key_t key; + value_t value; + section_t section; + + //file.read((fini_char_t*)§ionCount, sizeof(sectionCount)); + file >> sectionCount; + + for(size_t i = 0; i < sectionCount; i++) + { + if (i > 0) + file.seekg(1 + file.tellg()); + + file.read((fini_char_t*)&keyCount, sizeof(keyCount)); + file >> section; + + create(section); + + for(size_t j = 0; j < keyCount; j++) + { + file >> key; + file >> value; + set(key, value); + } + } + + file.close(); + + return true; + } + + //Clear the contents from memory + void clear() + { + clean(); + sections.clear(); + } + +///Output + //Save from memory into file + bool save(const std::string filename = "") + { + if (!hasFileAssociation(filename)) + return false; + + fini_ofstream_t file(((filename == "")? this->filename: filename).c_str(), std::ios::trunc); + if (!file.is_open()) + return false; + + //Loop through sections + for(typename INI::sectionsit_t i = sections.begin(); i != sections.end(); i++) + { + if (i->second->size() == 0) //No keys/values in section, skip to next + continue; + + //Write section + const fini_string_t temp = makeSection(i->first); + const fini_char_t* line = temp.c_str(); + file.write(line, fini_strlen(line)); + + for(typename INI::keysit_t j = i->second->begin(); j != i->second->end(); j++) + { + //Write key and value + const fini_string_t temp = makeKeyValue(j->first, j->second); + const fini_char_t* line = temp.c_str(); + file.write(line, fini_strlen(line)); + } + } + + file.close(); + + return true; + } + + //Saves it without any conventional INI formatting characters, however it only uses string streams + bool saveBinary(const std::string filename = "") + { + if (!hasFileAssociation(filename)) + return false; + + fini_ofstream_t file(((filename == "")? this->filename: filename).c_str(), std::ios::trunc | std::ios::binary); + if (!file.is_open()) + return false; + + size_t sectionCount = sections.size(); + size_t keyCount; + + file.write((fini_char_t*)§ionCount, sizeof(sectionCount)); + + //Loop through sections + for(typename INI::sectionsit_t i = sections.begin(); i != sections.end(); i++) + { + keyCount = i->second->size(); + file.write((fini_char_t*)&keyCount, sizeof(keyCount)); + + file << i->first << std::endl; + + for(typename INI::keysit_t j = i->second->begin(); j != i->second->end(); j++) + { + file << j->first << std::endl; + file << j->second << std::endl; + } + } + + file.close(); + + return true; + } + + //Saves it as a true binary file, intended to replace the existing one. Don't bother using it with all strings. + bool saveBinaryExperimental(std::string filename = "") + { + if (!hasFileAssociation(filename)) + return false; + + fini_ofstream_t file(((filename == "")? this->filename: filename).c_str(), std::ios::trunc | std::ios::binary); + if (!file.is_open()) + return false; + + size_t sectionCount = sections.size(); + size_t keyCount; + + file.write((fini_char_t*)§ionCount, sizeof(sectionCount)); + + //Loop through sections + for(typename INI::sectionsit_t i = sections.begin(); i != sections.end(); i++) + { + keyCount = i->second->size(); + file.write((fini_char_t*)&keyCount, sizeof(keyCount)); + + file.write((fini_char_t*)&i->first, Converters::GetDataSize(i->first)); + + for(typename INI::keysit_t j = i->second->begin(); j != i->second->end(); j++) + { + file.write((fini_char_t*)&j->first, Converters::GetDataSize(j->first)); + file.write((fini_char_t*)&j->second, Converters::GetDataSize(j->second)); + } + } + + file.close(); + + return true; + } + + //Alows another INI's contents to be insert into another, with the ability to retain the original values + void merge(ini_t& other, bool retainValues = true) + { + for(typename INI::sectionsit_t i = other.sections.begin(); i != other.sections.end(); i++) + { + if (!select(i->first)) //Create and insert all key values into a missing section + { + keys_t* keys = new keys_t(*i->second); + sections.insert(std::make_pair(i->first, keys)); + } + else + { + for(typename INI::keysit_t j = i->second->begin(); j != i->second->end(); j++) + { + keysit_t it = current->find(j->first); + if (it == current->end()) + current->insert(std::make_pair(j->first, j->second)); + else if (!retainValues) + it->second = j->second; + } + } + } + } + +private: +///Functions + //Init the INI in with values set by constructor + void init(source_e source, bool doParse) + { + this->source = source; + + reserveSections(); + if (doParse) + parse(); + } + + //Clean the contents for descruction + void clean() + { + for(sectionsit_t i = sections.begin(); i != sections.end(); i++) + delete i->second; + + current = NULL; + } + + //Make any alterations to the raw line + void nake(const fini_char_t*) //Strip the line of any non-interpretable characters + { + + } + + void reserveSections() + { + #ifdef FINI_CPP11 + sections.reserve(ALLOCATE_SECTIONS); + #endif + } + + void reserveKeys(keys_t* current) + { + #ifdef FINI_CPP11 + current->reserve(ALLOCATE_KEYS); + #endif + } + + bool hasFileAssociation(std::string filename) + { + if (source == SOURCE_MEMORY && filename == "") //No association to a file + return false; + + return true; + } + +///Output + //Creates a section as a string + fini_string_t makeSection(const section_t& section) + { + fini_sstream_t line; + line << '[' << section << ']' << std::endl; + + return line.str(); + } + + //Creates a key and a value as a string + fini_string_t makeKeyValue(const key_t& key, const value_t& value) + { + fini_sstream_t line; + line << key << '=' << value << std::endl; + + return line.str(); + } +}; + +///Definitions +template <typename T, typename U> + inline T Converters::Convert(U value) +{ + fini_sstream_t sout; + T result; + + sout << value; + sout >> result; + + sout.str(fini_string_t()); + + return result; +} + +template <> + inline fini_string_t Converters::Convert<fini_string_t, fini_string_t>(fini_string_t value) +{ + return value; +} + +template <> + inline fini_string_t Converters::Convert<fini_string_t>(const fini_char_t* value) +{ + return value; +} + +template <typename T> + inline void Converters::GetLine(fini_sstream_t& out, T& value) +{ + out >> value; +} + +inline void Converters::GetLine(fini_sstream_t& out, fini_string_t& value) +{ + std::getline(out, value); +} + +template <typename T> + inline size_t Converters::GetDataSize(T& value) +{ + return sizeof(value); +} + +inline size_t Converters::GetDataSize(fini_string_t value) +{ + return value.size() + 1; +} diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/cpp-feather-ini-parser/LICENSE b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/cpp-feather-ini-parser/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..7d961cc6e56bcf624d2b15806266311da47fe28a --- /dev/null +++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/cpp-feather-ini-parser/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014 Turbine1991 + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/cpp-feather-ini-parser/README.md b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/cpp-feather-ini-parser/README.md new file mode 100644 index 0000000000000000000000000000000000000000..f1245971cd05a49f7c070347e304c444b003d480 --- /dev/null +++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/cpp-feather-ini-parser/README.md @@ -0,0 +1,47 @@ +feather-ini-parser +================== + +Simple like your girlfriend, fast, lightweight, header, portable INI parser for ANSI C++. + +Why use feather-ini-parser? It's a fast, intuitive, uses C++, supports native data types, wide char support (enable), converting to data types simply by setting a default value or providing the type as a template parameter. + +##Methods + +Statement | Return Type +------------- | ------------- +ini(filename, doParse)|constructor +ini(data, dataSize, doParse)|constructor +ini.parse()|bool +ini.merge(other INI, retainValues)|void +ini.create(section)|bool +ini.select(section)|bool +ini.set(key, value)|bool +ini.get(key, dvalue = value_t())|dvalue_t +ini.save(filename = "")|bool +ini.clear()|bool +ini[section][key]|value_t& +ini[section]|keys_t& + +##Example +``` +#include <iostream> +#include "INI.h" + +using namespace std; +``` +... +``` +typedef INI<> ini_t; +//or +//typedef INI<section_t, key_t, value_t> ini_t; + +ini_t ini("filename.ini", true); +ini.create("section1"); //Create and select section1 +ini.set("key", "value"); +cout << ini.get("keynumeric", -1) << endl; +ini["section2"]["key"] = "value"; +ini.save(); +``` + +##More +Please see the example .cpp file and Code::Blocks .cbp project for a compilable GCC and VSC++ example. Additionally includes enabling wide char support and iterating through contents. diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/cpp-feather-ini-parser/example/example.cpp b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/cpp-feather-ini-parser/example/example.cpp new file mode 100644 index 0000000000000000000000000000000000000000..462dd241dcd3525320d3d01001ea9ac209afccee --- /dev/null +++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/cpp-feather-ini-parser/example/example.cpp @@ -0,0 +1,130 @@ +#include <iostream> +#include <cstring> +#include <stdint.h> +#include "../INI.h" + +using namespace std; + +void centerString(string str); //Printing to console +std::string getStringFromFile(const std::string& path); //Source for data loading from memory. + +int main() +{ + ///Declare + typedef INI<> ini_t; //Makes things shorter/easier to write <Section, Key, Value> + //or + //typedef INI<string, string, string> ini_t; //Equivelant to previous line when wide characters are disabled + ini_t ini("file.ini", true); //File to open/default save filename. The constuctor is set to parse by default, unless specified as false + + ///Manipulate and access contents + centerString("########## Access & Manipulate Contents ##########"); + + //Common usage + ini.create("Section 1"); + ini.create("Section 2"); + ini.get("Key1", "DefaultValue"); + ini.select("Section 1"); + ini.set("Key2", "Value"); + ini.save(); //Save contents to file, optional filename parameter available + ini.clear(); //Clear INI contents from memory + + //Extended usage + ini["Section Name"]["Key"] = "Value"; //You are not required to create a section first + + ini.create("Section1"); //Also selects as current section + ini.create("Section2"); //Current + + ini.set("Key1", "Value1"); //Added pair under section "Section2" + + ini.select("Section1"); //Current + cout << ini.get("Key1", "-1") << endl; //Returns "-1" as no key exists, no default will return NULL for data type, eg int() is 0 + + ini.select("Section2"); + ini.set("Key1", "1.123"); + cout << ini.get("Key1", -1.0) << endl; //Return value as double + ini.set(123, 123); //Will convert to provided INI data type for key/value, in this case string for both + + ini.save(); + ini.clear(); + ini.parse(); //Parses file into objects in memory + + cout << ini["Section2"]["Key1"] << endl; //Returns "Value1", slightly more overhead involved seeking section, avoid using excessively + + ///Iterate through sections and keys for both C++11 and C++98 + centerString("########## Iterate Contents ##########"); + +#ifdef FINI_CPP11 + for(auto i: ini.sections) + { + cout << "[" << i.first << "]" << endl; + + //for(auto j = i.second->begin(); j != i.second->end(); j++) + for(auto j: *i.second) + { + cout << " " << j.first << "=" << j.second << endl; + } + } +#else + for(ini_t::sectionsit_t i = ini.sections.begin(); i != ini.sections.end(); i++) + { + //Section name as ini_t::section_t + cout << i->first << endl; + + if (i->second->size() == 0) //No keys/values in section, skip to next + continue; + + for(ini_t::keysit_t j = i->second->begin(); j != i->second->end(); j++) + { + //Name as ini_t::key_t & Value as ini_t::key_t + cout << " " << j->first << "=" << j->second << endl; + } + } +#endif + +///Example with different data types + typedef INI <unsigned char, string, float> ini_int_t; //Makes things shorter/easier to write <Section, Key, Value> + ini_int_t ini_int("file_ints.ini", false); //File to open/default save filename. The constuctor is set to parse by default, unless specified as false + for(int i = 1; i <= 200; i++) + { + ini_int.create(i); //Section + ini_int.set("Key", i / 2.f); + } + + ini_int.save(); + +///Wide char support example (please define FINI_WIDE_SUPPORT in project) + /* + ini_t ini_w("file.ini", true); + wcout << ini_w[L"Section2"][L"Key1"] << endl; + */ + +///Load from memory + std::string str = getStringFromFile("config/test.ini"); //Allows us to tap into a source for the purpose of this example + + ini_t ini_mem((void*)str.c_str(), str.size(), true); //This is the line which parses data from memory + +///Merge contents and keep values + ini_t inid("file.ini", true); + ini_t inis("merge.ini", true); + inid.merge(inis, true); + inid.save("merged.ini"); + + return EXIT_SUCCESS; +} + +void centerString(string str) +{ + const char* s = str.c_str(); + int l = strlen(s); + int pos = (int)((80 - l) / 2); + for(int i = 0; i < pos; i++) + cout << " "; + cout << s << endl; +} + +std::string getStringFromFile(const std::string& path) { + std::ostringstream buf; + std::ifstream input (path.c_str()); + buf << input.rdbuf(); + return buf.str(); +} diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/cpp-feather-ini-parser/example/file.ini b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/cpp-feather-ini-parser/example/file.ini new file mode 100644 index 0000000000000000000000000000000000000000..e1c485ba2a657cf56d497a7aefc6e51daf0f0608 --- /dev/null +++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/cpp-feather-ini-parser/example/file.ini @@ -0,0 +1,5 @@ +[Section2] +123=123 +Key1=1.123 +[Section Name] +Key=Value diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/cpp-feather-ini-parser/example/file_ints.ini b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/cpp-feather-ini-parser/example/file_ints.ini new file mode 100644 index 0000000000000000000000000000000000000000..3d71e76cae1ae33de74f9c0735021ea51e655b60 --- /dev/null +++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/cpp-feather-ini-parser/example/file_ints.ini @@ -0,0 +1,400 @@ +[200] +Key=100 +[199] +Key=99.5 +[198] +Key=99 +[197] +Key=98.5 +[196] +Key=98 +[195] +Key=97.5 +[194] +Key=97 +[193] +Key=96.5 +[192] +Key=96 +[191] +Key=95.5 +[190] +Key=95 +[189] +Key=94.5 +[188] +Key=94 +[187] +Key=93.5 +[186] +Key=93 +[185] +Key=92.5 +[184] +Key=92 +[183] +Key=91.5 +[182] +Key=91 +[181] +Key=90.5 +[180] +Key=90 +[179] +Key=89.5 +[178] +Key=89 +[177] +Key=88.5 +[176] +Key=88 +[175] +Key=87.5 +[174] +Key=87 +[173] +Key=86.5 +[172] +Key=86 +[171] +Key=85.5 +[170] +Key=85 +[169] +Key=84.5 +[168] +Key=84 +[167] +Key=83.5 +[166] +Key=83 +[165] +Key=82.5 +[164] +Key=82 +[163] +Key=81.5 +[162] +Key=81 +[161] +Key=80.5 +[160] +Key=80 +[159] +Key=79.5 +[158] +Key=79 +[157] +Key=78.5 +[156] +Key=78 +[155] +Key=77.5 +[154] +Key=77 +[153] +Key=76.5 +[152] +Key=76 +[151] +Key=75.5 +[150] +Key=75 +[149] +Key=74.5 +[148] +Key=74 +[147] +Key=73.5 +[146] +Key=73 +[145] +Key=72.5 +[144] +Key=72 +[143] +Key=71.5 +[142] +Key=71 +[141] +Key=70.5 +[140] +Key=70 +[139] +Key=69.5 +[138] +Key=69 +[137] +Key=68.5 +[136] +Key=68 +[135] +Key=67.5 +[134] +Key=67 +[133] +Key=66.5 +[132] +Key=66 +[131] +Key=65.5 +[130] +Key=65 +[129] +Key=64.5 +[128] +Key=64 +[127] +Key=63.5 +[126] +Key=63 +[125] +Key=62.5 +[124] +Key=62 +[123] +Key=61.5 +[122] +Key=61 +[121] +Key=60.5 +[120] +Key=60 +[119] +Key=59.5 +[118] +Key=59 +[117] +Key=58.5 +[116] +Key=58 +[115] +Key=57.5 +[114] +Key=57 +[113] +Key=56.5 +[112] +Key=56 +[111] +Key=55.5 +[110] +Key=55 +[109] +Key=54.5 +[108] +Key=54 +[107] +Key=53.5 +[106] +Key=53 +[105] +Key=52.5 +[104] +Key=52 +[103] +Key=51.5 +[1] +Key=0.5 +[2] +Key=1 +[3] +Key=1.5 +[4] +Key=2 +[5] +Key=2.5 +[6] +Key=3 +[7] +Key=3.5 +[8] +Key=4 +[9] +Key=4.5 +[10] +Key=5 +[11] +Key=5.5 +[12] +Key=6 +[13] +Key=6.5 +[14] +Key=7 +[15] +Key=7.5 +[16] +Key=8 +[17] +Key=8.5 +[18] +Key=9 +[19] +Key=9.5 +[20] +Key=10 +[21] +Key=10.5 +[22] +Key=11 +[23] +Key=11.5 +[24] +Key=12 +[25] +Key=12.5 +[26] +Key=13 +[27] +Key=13.5 +[28] +Key=14 +[29] +Key=14.5 +[30] +Key=15 +[31] +Key=15.5 +[32] +Key=16 +[33] +Key=16.5 +[34] +Key=17 +[35] +Key=17.5 +[36] +Key=18 +[37] +Key=18.5 +[38] +Key=19 +[39] +Key=19.5 +[40] +Key=20 +[41] +Key=20.5 +[42] +Key=21 +[43] +Key=21.5 +[44] +Key=22 +[45] +Key=22.5 +[46] +Key=23 +[47] +Key=23.5 +[48] +Key=24 +[49] +Key=24.5 +[50] +Key=25 +[51] +Key=25.5 +[52] +Key=26 +[53] +Key=26.5 +[54] +Key=27 +[55] +Key=27.5 +[56] +Key=28 +[57] +Key=28.5 +[58] +Key=29 +[59] +Key=29.5 +[60] +Key=30 +[61] +Key=30.5 +[62] +Key=31 +[63] +Key=31.5 +[64] +Key=32 +[65] +Key=32.5 +[66] +Key=33 +[67] +Key=33.5 +[68] +Key=34 +[69] +Key=34.5 +[70] +Key=35 +[71] +Key=35.5 +[72] +Key=36 +[73] +Key=36.5 +[74] +Key=37 +[75] +Key=37.5 +[76] +Key=38 +[77] +Key=38.5 +[78] +Key=39 +[79] +Key=39.5 +[80] +Key=40 +[81] +Key=40.5 +[82] +Key=41 +[83] +Key=41.5 +[84] +Key=42 +[85] +Key=42.5 +[86] +Key=43 +[87] +Key=43.5 +[88] +Key=44 +[89] +Key=44.5 +[90] +Key=45 +[91] +Key=45.5 +[92] +Key=46 +[93] +Key=46.5 +[94] +Key=47 +[95] +Key=47.5 +[96] +Key=48 +[97] +Key=48.5 +[98] +Key=49 +[99] +Key=49.5 +[100] +Key=50 +[101] +Key=50.5 +[102] +Key=51 diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/cpp-feather-ini-parser/example/merge.ini b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/cpp-feather-ini-parser/example/merge.ini new file mode 100644 index 0000000000000000000000000000000000000000..dfdc38108414680c510f65309feed47bf3e6c4d5 --- /dev/null +++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/cpp-feather-ini-parser/example/merge.ini @@ -0,0 +1,5 @@ +[NewSection] +Key=Value +[Section2] +NewKey=Value +123=456 \ No newline at end of file diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/cpp-feather-ini-parser/example/project.cbp b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/cpp-feather-ini-parser/example/project.cbp new file mode 100644 index 0000000000000000000000000000000000000000..913928a1159426daa67f8f0b6cfaa71596d6ca1f --- /dev/null +++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/cpp-feather-ini-parser/example/project.cbp @@ -0,0 +1,57 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> +<CodeBlocks_project_file> + <FileVersion major="1" minor="6" /> + <Project> + <Option title="project" /> + <Option pch_mode="2" /> + <Option compiler="gcc" /> + <Build> + <Target title="gcc_mingw"> + <Option output="bin/gcc_mingw/example" prefix_auto="1" extension_auto="1" /> + <Option object_output="obj/gcc_mingw/" /> + <Option type="1" /> + <Option compiler="gcc" /> + <Compiler> + <Add option="-O2" /> + <Add option="-Wall" /> + <Add option="-std=c++0x" /> + </Compiler> + </Target> + <Target title="vs_2013"> + <Option output="bin/vs/example" prefix_auto="1" extension_auto="1" /> + <Option object_output="obj/vs_2013/" /> + <Option type="1" /> + <Option compiler="microsoft_visual_c_2013" /> + <Compiler> + <Add option="/EHa" /> + <Add option="/W2" /> + <Add directory="C:/Program Files (x86)/Microsoft Visual Studio 12.0/VC/include" /> + </Compiler> + <Linker> + <Add directory="C:/Program Files (x86)/Microsoft Visual Studio 12.0/VC/lib" /> + <Add directory="C:/Program Files (x86)/Microsoft SDKs/Windows/v7.0A/Lib" /> + </Linker> + </Target> + <Target title="vs_2010"> + <Option output="bin/vs/example" prefix_auto="1" extension_auto="1" /> + <Option object_output="obj/vs_2010/" /> + <Option type="1" /> + <Option compiler="msvc10" /> + <Compiler> + <Add option="/EHa" /> + <Add option="/W2" /> + </Compiler> + <Linker> + <Add directory="C:/Program Files (x86)/Microsoft SDKs/Windows/v7.0A/Lib" /> + </Linker> + </Target> + </Build> + <Unit filename="../INI.h" /> + <Unit filename="example.cpp" /> + <Extensions> + <code_completion /> + <envvars /> + <debugger /> + </Extensions> + </Project> +</CodeBlocks_project_file> diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/cpp-feather-ini-parser/example/project.depend b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/cpp-feather-ini-parser/example/project.depend new file mode 100644 index 0000000000000000000000000000000000000000..02c743092d1328388f1f3db9b6b14c7dc2ac01bb --- /dev/null +++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/cpp-feather-ini-parser/example/project.depend @@ -0,0 +1,802 @@ +# depslib dependency file v1.0 +1399614205 source:d:\projects\feather-ini-parser\example\example.cpp + <iostream> + <cstring> + <stdint.h> + "../INI.h" + +1399625159 d:\projects\feather-ini-parser\ini.h + <string> + <fstream> + <sstream> + <stdint.h> + <stdio.h> + <stdlib.h> + <unordered_map> + <map> + <wchar.h> + <cstring> + +1374412936 c:\program files (x86)\microsoft visual studio 12.0\vc\include\iostream + <istream> + +1374726946 c:\program files (x86)\microsoft visual studio 12.0\vc\include\istream + <ostream> + +1374726946 c:\program files (x86)\microsoft visual studio 12.0\vc\include\ostream + <ios> + +1374726946 c:\program files (x86)\microsoft visual studio 12.0\vc\include\ios + <xlocnum> + +1374410776 c:\program files (x86)\microsoft visual studio 12.0\vc\include\xlocnum + <climits> + <cmath> + <cstdio> + <cstdlib> + <streambuf> + +1374410776 c:\program files (x86)\microsoft visual studio 12.0\vc\include\climits + <yvals.h> + <limits.h> + +1374726946 c:\program files (x86)\microsoft visual studio 12.0\vc\include\yvals.h + <xkeycheck.h> + <crtdefs.h> + <use_ansi.h> + <crtwrn.h> + +1374410776 c:\program files (x86)\microsoft visual studio 12.0\vc\include\xkeycheck.h + +1374412934 c:\program files (x86)\microsoft visual studio 12.0\vc\include\crtdefs.h + <sal.h> + <vadefs.h> + <winapifamily.h> + +1374412934 c:\program files (x86)\microsoft visual studio 12.0\vc\include\sal.h + "codeanalysis\sourceannotations.h" + <ConcurrencySal.h> + +1374412934 c:\program files (x86)\microsoft visual studio 12.0\vc\include\codeanalysis\sourceannotations.h + +1374410776 c:\program files (x86)\microsoft visual studio 12.0\vc\include\concurrencysal.h + +1374412934 c:\program files (x86)\microsoft visual studio 12.0\vc\include\vadefs.h + <cruntime.h> + +1379495880 c:\program files (x86)\microsoft visual studio 12.0\vc\include\use_ansi.h + +1374412934 c:\program files (x86)\microsoft visual studio 12.0\vc\include\crtwrn.h + <crtdefs.h> + +1374412934 c:\program files (x86)\microsoft visual studio 12.0\vc\include\limits.h + <crtdefs.h> + +1375351090 c:\program files (x86)\microsoft visual studio 12.0\vc\include\cmath + <yvals.h> + <math.h> + <xtgmath.h> + <math.h> + <xtgmath.h> + +1379495880 c:\program files (x86)\microsoft visual studio 12.0\vc\include\math.h + <crtdefs.h> + +1379495880 c:\program files (x86)\microsoft visual studio 12.0\vc\include\xtgmath.h + <xtr1common> + +1374412938 c:\program files (x86)\microsoft visual studio 12.0\vc\include\xtr1common + <yvals.h> + +1375351090 c:\program files (x86)\microsoft visual studio 12.0\vc\include\cstdio + <yvals.h> + <stdio.h> + <stdio.h> + +1374410776 c:\program files (x86)\microsoft visual studio 12.0\vc\include\stdio.h + <crtdefs.h> + <swprintf.inl> + +1374726946 c:\program files (x86)\microsoft visual studio 12.0\vc\include\swprintf.inl + <vadefs.h> + +1375351090 c:\program files (x86)\microsoft visual studio 12.0\vc\include\cstdlib + <yvals.h> + <stdlib.h> + <stdlib.h> + +1374410776 c:\program files (x86)\microsoft visual studio 12.0\vc\include\stdlib.h + <crtdefs.h> + <limits.h> + +1374412936 c:\program files (x86)\microsoft visual studio 12.0\vc\include\streambuf + <xiosbase> + +1374726946 c:\program files (x86)\microsoft visual studio 12.0\vc\include\xiosbase + <xlocale> + <system_error> + <share.h> + +1374726946 c:\program files (x86)\microsoft visual studio 12.0\vc\include\xlocale + <climits> + <cstring> + <stdexcept> + <typeinfo> + <xlocinfo> + <xdebug> + <xfacet> + +1375351090 c:\program files (x86)\microsoft visual studio 12.0\vc\include\cstring + <yvals.h> + <string.h> + <string.h> + +1374410776 c:\program files (x86)\microsoft visual studio 12.0\vc\include\string.h + <crtdefs.h> + +1374412936 c:\program files (x86)\microsoft visual studio 12.0\vc\include\stdexcept + <exception> + <xstring> + +1374412936 c:\program files (x86)\microsoft visual studio 12.0\vc\include\exception + <xstddef> + <eh.h> + <malloc.h> + <string.h> + +1374412938 c:\program files (x86)\microsoft visual studio 12.0\vc\include\xstddef + <stdlib.h> + <cstddef> + <initializer_list> + <xtr1common> + +1374412936 c:\program files (x86)\microsoft visual studio 12.0\vc\include\cstddef + <yvals.h> + <stddef.h> + <stddef.h> + +1374410776 c:\program files (x86)\microsoft visual studio 12.0\vc\include\stddef.h + <crtdefs.h> + +1374412936 c:\program files (x86)\microsoft visual studio 12.0\vc\include\initializer_list + <cstddef> + +1374412934 c:\program files (x86)\microsoft visual studio 12.0\vc\include\eh.h + <crtdefs.h> + +1374412934 c:\program files (x86)\microsoft visual studio 12.0\vc\include\malloc.h + <crtdefs.h> + +1374412938 c:\program files (x86)\microsoft visual studio 12.0\vc\include\xstring + <xmemory0> + +1374726946 c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory0 + <cstdlib> + <limits> + <new> + <xutility> + <xatomic0.h> + <intrin.h> + <xatomic.h> + +1374412936 c:\program files (x86)\microsoft visual studio 12.0\vc\include\limits + <ymath.h> + <cfloat> + <climits> + <cmath> + <cwchar> + <xstddef> + +1374410776 c:\program files (x86)\microsoft visual studio 12.0\vc\include\ymath.h + <yvals.h> + +1374412936 c:\program files (x86)\microsoft visual studio 12.0\vc\include\cfloat + <yvals.h> + <float.h> + +1374410776 c:\program files (x86)\microsoft visual studio 12.0\vc\include\float.h + <crtdefs.h> + <crtwrn.h> + +1375351090 c:\program files (x86)\microsoft visual studio 12.0\vc\include\cwchar + <yvals.h> + <wchar.h> + <wchar.h> + +1374726946 c:\program files (x86)\microsoft visual studio 12.0\vc\include\wchar.h + <crtdefs.h> + <swprintf.inl> + <wtime.inl> + +1374412934 c:\program files (x86)\microsoft visual studio 12.0\vc\include\wtime.inl + +1374412936 c:\program files (x86)\microsoft visual studio 12.0\vc\include\new + <exception> + +1374726946 c:\program files (x86)\microsoft visual studio 12.0\vc\include\xutility + <climits> + <cstdlib> + <utility> + +1374412938 c:\program files (x86)\microsoft visual studio 12.0\vc\include\utility + <xstddef> + <iosfwd> + <type_traits> + +1374412936 c:\program files (x86)\microsoft visual studio 12.0\vc\include\iosfwd + <cstdio> + <cstring> + <cwchar> + <xstddef> + <crtdbg.h> + +1374412934 c:\program files (x86)\microsoft visual studio 12.0\vc\include\crtdbg.h + <crtdefs.h> + +1374726946 c:\program files (x86)\microsoft visual studio 12.0\vc\include\type_traits + <xstddef> + <xrefwrap> + +1374726946 c:\program files (x86)\microsoft visual studio 12.0\vc\include\xrefwrap + +1374412938 c:\program files (x86)\microsoft visual studio 12.0\vc\include\xatomic0.h + <yvals.h> + +1379495880 c:\program files (x86)\microsoft visual studio 12.0\vc\include\intrin.h + <crtdefs.h> + <setjmp.h> + <stddef.h> + <immintrin.h> + <ammintrin.h> + <mm3dnow.h> + <armintr.h> + +1374412934 c:\program files (x86)\microsoft visual studio 12.0\vc\include\setjmp.h + <crtdefs.h> + <setjmpex.h> + +1374412934 c:\program files (x86)\microsoft visual studio 12.0\vc\include\setjmpex.h + <setjmp.h> + +1374412934 c:\program files (x86)\microsoft visual studio 12.0\vc\include\immintrin.h + <wmmintrin.h> + +1374412934 c:\program files (x86)\microsoft visual studio 12.0\vc\include\wmmintrin.h + <nmmintrin.h> + +1374412934 c:\program files (x86)\microsoft visual studio 12.0\vc\include\nmmintrin.h + <smmintrin.h> + +1374412934 c:\program files (x86)\microsoft visual studio 12.0\vc\include\smmintrin.h + <tmmintrin.h> + +1374412934 c:\program files (x86)\microsoft visual studio 12.0\vc\include\tmmintrin.h + <pmmintrin.h> + +1374412934 c:\program files (x86)\microsoft visual studio 12.0\vc\include\pmmintrin.h + <emmintrin.h> + +1374412934 c:\program files (x86)\microsoft visual studio 12.0\vc\include\emmintrin.h + <xmmintrin.h> + +1374410776 c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmmintrin.h + <mmintrin.h> + "xmm_func.h" + <malloc.h> + +1374412934 c:\program files (x86)\microsoft visual studio 12.0\vc\include\mmintrin.h + <crtdefs.h> + +1374412934 c:\program files (x86)\microsoft visual studio 12.0\vc\include\ammintrin.h + +1374412934 c:\program files (x86)\microsoft visual studio 12.0\vc\include\mm3dnow.h + <crtdefs.h> + <mmintrin.h> + <xmmintrin.h> + +1374412934 c:\program files (x86)\microsoft visual studio 12.0\vc\include\armintr.h + +1374412938 c:\program files (x86)\microsoft visual studio 12.0\vc\include\xatomic.h + <xatomic0.h> + <stddef.h> + <stdlib.h> + <string.h> + <intrin.h> + <xutility> + +1374726946 c:\program files (x86)\microsoft visual studio 12.0\vc\include\typeinfo + <xstddef> + <string.h> + <exception> + +1374726946 c:\program files (x86)\microsoft visual studio 12.0\vc\include\xlocinfo + <xlocinfo.h> + <cstdlib> + <xstddef> + +1374410776 c:\program files (x86)\microsoft visual studio 12.0\vc\include\xlocinfo.h + <ctype.h> + <locale.h> + <wchar.h> + <yvals.h> + +1374412934 c:\program files (x86)\microsoft visual studio 12.0\vc\include\ctype.h + <crtdefs.h> + +1374412934 c:\program files (x86)\microsoft visual studio 12.0\vc\include\locale.h + <crtdefs.h> + +1374412938 c:\program files (x86)\microsoft visual studio 12.0\vc\include\xdebug + <yvals.h> + <crtdbg.h> + <xmemory> + +1374410776 c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory + <xmemory0> + +1374410776 c:\program files (x86)\microsoft visual studio 12.0\vc\include\xfacet + <yvals.h> + +1374726946 c:\program files (x86)\microsoft visual studio 12.0\vc\include\system_error + <cerrno> + <cstdlib> + <stdexcept> + +1374412936 c:\program files (x86)\microsoft visual studio 12.0\vc\include\cerrno + <yvals.h> + <errno.h> + <errno.h> + +1374410776 c:\program files (x86)\microsoft visual studio 12.0\vc\include\errno.h + <crtdefs.h> + +1374412934 c:\program files (x86)\microsoft visual studio 12.0\vc\include\share.h + +1374412936 c:\program files (x86)\microsoft visual studio 12.0\vc\include\stdint.h + <crtdefs.h> + +1374412936 c:\program files (x86)\microsoft visual studio 12.0\vc\include\string + <iterator> + +1374412936 c:\program files (x86)\microsoft visual studio 12.0\vc\include\iterator + <istream> + <xutility> + +1374726946 c:\program files (x86)\microsoft visual studio 12.0\vc\include\fstream + <istream> + +1374726946 c:\program files (x86)\microsoft visual studio 12.0\vc\include\sstream + <string> + +1374412938 c:\program files (x86)\microsoft visual studio 12.0\vc\include\unordered_map + <xhash> + <tuple> + +1374410776 c:\program files (x86)\microsoft visual studio 12.0\vc\include\xhash + <cstring> + <cwchar> + <list> + <vector> + +1374412936 c:\program files (x86)\microsoft visual studio 12.0\vc\include\list + <xmemory> + <stdexcept> + +1374410776 c:\program files (x86)\microsoft visual studio 12.0\vc\include\vector + <xmemory> + <stdexcept> + +1374412938 c:\program files (x86)\microsoft visual studio 12.0\vc\include\tuple + <type_traits> + <xutility> + <new> + +1374412936 c:\program files (x86)\microsoft visual studio 12.0\vc\include\map + <xtree> + <tuple> + +1374726946 c:\program files (x86)\microsoft visual studio 12.0\vc\include\xtree + <xmemory> + <stdexcept> + +1254299028 c:\program files (x86)\microsoft visual studio 10.0\vc\include\iostream + <istream> + +1257671184 c:\program files (x86)\microsoft visual studio 10.0\vc\include\istream + <ostream> + +1257671184 c:\program files (x86)\microsoft visual studio 10.0\vc\include\ostream + <ios> + +1257671184 c:\program files (x86)\microsoft visual studio 10.0\vc\include\ios + <xlocnum> + +1251642866 c:\program files (x86)\microsoft visual studio 10.0\vc\include\xlocnum + <climits> + <cmath> + <cstdio> + <cstdlib> + <streambuf> + +1251642866 c:\program files (x86)\microsoft visual studio 10.0\vc\include\climits + <yvals.h> + <limits.h> + +1258271576 c:\program files (x86)\microsoft visual studio 10.0\vc\include\yvals.h + <crtdefs.h> + <xkeycheck.h> + <crtwrn.h> + <use_ansi.h> + <crtwrn.h> + <crtwrn.h> + +1260264954 c:\program files (x86)\microsoft visual studio 10.0\vc\include\crtdefs.h + <sal.h> + <vadefs.h> + +1263987576 c:\program files (x86)\microsoft visual studio 10.0\vc\include\sal.h + "codeanalysis\sourceannotations.h" + +1263303828 c:\program files (x86)\microsoft visual studio 10.0\vc\include\codeanalysis\sourceannotations.h + +1251642866 c:\program files (x86)\microsoft visual studio 10.0\vc\include\vadefs.h + +1251647994 c:\program files (x86)\microsoft visual studio 10.0\vc\include\xkeycheck.h + +1257671184 c:\program files (x86)\microsoft visual studio 10.0\vc\include\crtwrn.h + <crtdefs.h> + +1254299028 c:\program files (x86)\microsoft visual studio 10.0\vc\include\use_ansi.h + +1251642866 c:\program files (x86)\microsoft visual studio 10.0\vc\include\limits.h + <crtdefs.h> + +1251642866 c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath + <yvals.h> + <math.h> + <math.h> + +1251642866 c:\program files (x86)\microsoft visual studio 10.0\vc\include\math.h + <crtdefs.h> + +1251642866 c:\program files (x86)\microsoft visual studio 10.0\vc\include\cstdio + <yvals.h> + <stdio.h> + <stdio.h> + +1257335008 c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h + <crtdefs.h> + <swprintf.inl> + +1256197836 c:\program files (x86)\microsoft visual studio 10.0\vc\include\swprintf.inl + <vadefs.h> + +1251642866 c:\program files (x86)\microsoft visual studio 10.0\vc\include\cstdlib + <yvals.h> + <stdlib.h> + <stdlib.h> + +1257671184 c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdlib.h + <crtdefs.h> + <limits.h> + +1254299028 c:\program files (x86)\microsoft visual studio 10.0\vc\include\streambuf + <xiosbase> + +1254299028 c:\program files (x86)\microsoft visual studio 10.0\vc\include\xiosbase + <xlocale> + <system_error> + <share.h> + +1263118342 c:\program files (x86)\microsoft visual studio 10.0\vc\include\xlocale + <climits> + <cstring> + <stdexcept> + <typeinfo> + <xlocinfo> + <xdebug> + +1251642866 c:\program files (x86)\microsoft visual studio 10.0\vc\include\cstring + <yvals.h> + <string.h> + <string.h> + +1260264954 c:\program files (x86)\microsoft visual studio 10.0\vc\include\string.h + <crtdefs.h> + +1251642866 c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdexcept + <exception> + <xstring> + +1254299028 c:\program files (x86)\microsoft visual studio 10.0\vc\include\exception + <xstddef> + <eh.h> + <malloc.h> + <string.h> + +1254299028 c:\program files (x86)\microsoft visual studio 10.0\vc\include\xstddef + <yvals.h> + <cstddef> + +1251642866 c:\program files (x86)\microsoft visual studio 10.0\vc\include\cstddef + <yvals.h> + <stddef.h> + <stddef.h> + +1254299028 c:\program files (x86)\microsoft visual studio 10.0\vc\include\stddef.h + <crtdefs.h> + +1254299028 c:\program files (x86)\microsoft visual studio 10.0\vc\include\eh.h + <crtdefs.h> + +1251642866 c:\program files (x86)\microsoft visual studio 10.0\vc\include\malloc.h + <crtdefs.h> + +1257671184 c:\program files (x86)\microsoft visual studio 10.0\vc\include\xstring + <xmemory> + +1254299028 c:\program files (x86)\microsoft visual studio 10.0\vc\include\xmemory + <cstdlib> + <new> + <xutility> + +1251642866 c:\program files (x86)\microsoft visual studio 10.0\vc\include\new + <exception> + +1258271576 c:\program files (x86)\microsoft visual studio 10.0\vc\include\xutility + <climits> + <cstdlib> + <utility> + +1257671184 c:\program files (x86)\microsoft visual studio 10.0\vc\include\utility + <xstddef> + <iosfwd> + <type_traits> + +1254299028 c:\program files (x86)\microsoft visual studio 10.0\vc\include\iosfwd + <cstdio> + <cstring> + <cwchar> + <xstddef> + <crtdbg.h> + +1251642866 c:\program files (x86)\microsoft visual studio 10.0\vc\include\cwchar + <yvals.h> + <wchar.h> + <wchar.h> + +1257335008 c:\program files (x86)\microsoft visual studio 10.0\vc\include\wchar.h + <crtdefs.h> + <swprintf.inl> + <wtime.inl> + +1251642866 c:\program files (x86)\microsoft visual studio 10.0\vc\include\wtime.inl + +1254299028 c:\program files (x86)\microsoft visual studio 10.0\vc\include\crtdbg.h + <crtdefs.h> + +1263118342 c:\program files (x86)\microsoft visual studio 10.0\vc\include\type_traits + <limits> + <xtr1common> + <xfwrap> + +1251642866 c:\program files (x86)\microsoft visual studio 10.0\vc\include\limits + <ymath.h> + <cfloat> + <climits> + <cmath> + <cwchar> + <xstddef> + +1251642866 c:\program files (x86)\microsoft visual studio 10.0\vc\include\ymath.h + <yvals.h> + +1251642866 c:\program files (x86)\microsoft visual studio 10.0\vc\include\cfloat + <yvals.h> + <float.h> + +1251642866 c:\program files (x86)\microsoft visual studio 10.0\vc\include\float.h + <crtdefs.h> + <crtwrn.h> + +1254299028 c:\program files (x86)\microsoft visual studio 10.0\vc\include\xtr1common + <yvals.h> + +1263118342 c:\program files (x86)\microsoft visual studio 10.0\vc\include\xfwrap + <xfwrap1> + <xfwrap1> + <xfwrap1> + <xfwrap1> + <xfwrap1> + <xfwrap1> + <xfwrap1> + <xfwrap1> + <xfwrap1> + <xfwrap1> + <xfwrap1> + +1263118342 c:\program files (x86)\microsoft visual studio 10.0\vc\include\xfwrap1 + <xxbind1> + <xxcallfun> + <xxcallobj> + <xxcallpmf> + <xxfunction> + <xxmem_fn> + <xxpmfcaller> + <xxrefwrap> + <xxresult> + <xxshared> + <xxtuple0> + <xxtuple1> + <xxtype_traits> + +1254299028 c:\program files (x86)\microsoft visual studio 10.0\vc\include\xxbind1 + +1254299028 c:\program files (x86)\microsoft visual studio 10.0\vc\include\xxcallfun + +1254299028 c:\program files (x86)\microsoft visual studio 10.0\vc\include\xxcallobj + +1254299028 c:\program files (x86)\microsoft visual studio 10.0\vc\include\xxcallpmf + +1257671184 c:\program files (x86)\microsoft visual studio 10.0\vc\include\xxfunction + +1251647994 c:\program files (x86)\microsoft visual studio 10.0\vc\include\xxmem_fn + +1254299028 c:\program files (x86)\microsoft visual studio 10.0\vc\include\xxpmfcaller + +1254299028 c:\program files (x86)\microsoft visual studio 10.0\vc\include\xxrefwrap + +1254299028 c:\program files (x86)\microsoft visual studio 10.0\vc\include\xxresult + +1251647994 c:\program files (x86)\microsoft visual studio 10.0\vc\include\xxshared + +1254299028 c:\program files (x86)\microsoft visual studio 10.0\vc\include\xxtuple0 + +1251647994 c:\program files (x86)\microsoft visual studio 10.0\vc\include\xxtuple1 + +1251647994 c:\program files (x86)\microsoft visual studio 10.0\vc\include\xxtype_traits + +1257671184 c:\program files (x86)\microsoft visual studio 10.0\vc\include\typeinfo + <xstddef> + <string.h> + <exception> + +1254299028 c:\program files (x86)\microsoft visual studio 10.0\vc\include\xlocinfo + <xlocinfo.h> + <cstdlib> + <xstddef> + +1254299028 c:\program files (x86)\microsoft visual studio 10.0\vc\include\xlocinfo.h + <ctype.h> + <locale.h> + <wchar.h> + <yvals.h> + +1251642866 c:\program files (x86)\microsoft visual studio 10.0\vc\include\ctype.h + <crtdefs.h> + +1251642866 c:\program files (x86)\microsoft visual studio 10.0\vc\include\locale.h + <crtdefs.h> + +1263118342 c:\program files (x86)\microsoft visual studio 10.0\vc\include\xdebug + <yvals.h> + <crtdbg.h> + <xmemory> + +1260264954 c:\program files (x86)\microsoft visual studio 10.0\vc\include\system_error + <cerrno> + <cstdlib> + <stdexcept> + +1251642866 c:\program files (x86)\microsoft visual studio 10.0\vc\include\cerrno + <yvals.h> + <errno.h> + <errno.h> + +1251642866 c:\program files (x86)\microsoft visual studio 10.0\vc\include\errno.h + <crtdefs.h> + +1251642866 c:\program files (x86)\microsoft visual studio 10.0\vc\include\share.h + +1254299028 c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdint.h + <yvals.h> + +1257671184 c:\program files (x86)\microsoft visual studio 10.0\vc\include\string + <istream> + +1263118342 c:\program files (x86)\microsoft visual studio 10.0\vc\include\fstream + <istream> + +1254299028 c:\program files (x86)\microsoft visual studio 10.0\vc\include\sstream + <string> + +1254299028 c:\program files (x86)\microsoft visual studio 10.0\vc\include\unordered_map + <xhash> + +1263720180 c:\program files (x86)\microsoft visual studio 10.0\vc\include\xhash + <cstring> + <cwchar> + <xfunctional> + <list> + <vector> + +1251647994 c:\program files (x86)\microsoft visual studio 10.0\vc\include\xfunctional + <cstdlib> + <xstring> + +1254299028 c:\program files (x86)\microsoft visual studio 10.0\vc\include\list + <xfunctional> + <memory> + <stdexcept> + +1267607544 c:\program files (x86)\microsoft visual studio 10.0\vc\include\memory + <xmemory> + <exception> + <typeinfo> + <type_traits> + <intrin.h> + <xfwrap> + <xfwrap> + <xfwrap> + +1263118342 c:\program files (x86)\microsoft visual studio 10.0\vc\include\intrin.h + <crtdefs.h> + <setjmp.h> + <stddef.h> + <immintrin.h> + <mm3dnow.h> + +1251642866 c:\program files (x86)\microsoft visual studio 10.0\vc\include\setjmp.h + <crtdefs.h> + <setjmpex.h> + +1251642866 c:\program files (x86)\microsoft visual studio 10.0\vc\include\setjmpex.h + <setjmp.h> + +1251647992 c:\program files (x86)\microsoft visual studio 10.0\vc\include\immintrin.h + <wmmintrin.h> + +1251642866 c:\program files (x86)\microsoft visual studio 10.0\vc\include\wmmintrin.h + <nmmintrin.h> + +1251642866 c:\program files (x86)\microsoft visual studio 10.0\vc\include\nmmintrin.h + <smmintrin.h> + +1251642866 c:\program files (x86)\microsoft visual studio 10.0\vc\include\smmintrin.h + <tmmintrin.h> + +1251642866 c:\program files (x86)\microsoft visual studio 10.0\vc\include\tmmintrin.h + <pmmintrin.h> + +1251642866 c:\program files (x86)\microsoft visual studio 10.0\vc\include\pmmintrin.h + <emmintrin.h> + +1251642866 c:\program files (x86)\microsoft visual studio 10.0\vc\include\emmintrin.h + <xmmintrin.h> + +1251642866 c:\program files (x86)\microsoft visual studio 10.0\vc\include\xmmintrin.h + <mmintrin.h> + "xmm_func.h" + <malloc.h> + +1251642866 c:\program files (x86)\microsoft visual studio 10.0\vc\include\mmintrin.h + <crtdefs.h> + +1251642866 c:\program files (x86)\microsoft visual studio 10.0\vc\include\mm3dnow.h + <crtdefs.h> + <mmintrin.h> + <xmmintrin.h> + +1258271576 c:\program files (x86)\microsoft visual studio 10.0\vc\include\vector + <memory> + <stdexcept> + <xfunctional> + +1254299028 c:\program files (x86)\microsoft visual studio 10.0\vc\include\map + <xtree> + +1258271576 c:\program files (x86)\microsoft visual studio 10.0\vc\include\xtree + <xfunctional> + <memory> + <stdexcept> + diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/lms7002_defines.h b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/lms7002_defines.h new file mode 100644 index 0000000000000000000000000000000000000000..6b06a51c7eda7c8add40ccfe19f60adde64b4053 --- /dev/null +++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/lms7002_defines.h @@ -0,0 +1,218 @@ +/** +@file lms7002_defines.h +@author Lime Microsystems +@brief enumerations of available LMS7002M commands and statuses +*/ +#pragma once + +const int LMS_RST_DEACTIVATE = 0; +const int LMS_RST_ACTIVATE = 1; +const int LMS_RST_PULSE = 2; + +enum eLMS_DEV +{ + LMS_DEV_UNKNOWN, + LMS_DEV_EVB6, + LMS_DEV_DIGIGREEN, + LMS_DEV_DIGIRED, + LMS_DEV_EVB7, + LMS_DEV_ZIPPER, + LMS_DEV_SOCKETBOARD, + LMS_DEV_EVB7V2, + LMS_DEV_STREAM, + LMS_DEV_NOVENA, + LMS_DEV_DATASPARK, + LMS_DEV_RFSPARK, + LMS_DEV_LMS6002USB, + LMS_DEV_RFESPARK, + LMS_DEV_SODERA, + + LMS_DEV_COUNT +}; + +const char LMS_DEV_NAMES[][80] = +{ + "UNKNOWN", + "EVB6", + "DigiGreen", + "DigiRed", + "EVB7", + "ZIPPER", + "Socket Board", + "EVB7_v2", + "Stream", + "Novena", + "DataSpark", + "RF-Spark", + "LMS6002-USB Stick", + "RF-ESpark", + "SoDeRa", +}; + +static const char* GetDeviceName(const eLMS_DEV device) +{ + if (LMS_DEV_UNKNOWN < device && device < LMS_DEV_COUNT) + return LMS_DEV_NAMES[device]; + else + return LMS_DEV_NAMES[LMS_DEV_UNKNOWN]; +} + +enum eEXP_BOARD +{ + EXP_BOARD_UNKNOWN, + EXP_BOARD_UNSUPPORTED, + EXP_BOARD_NO, + EXP_BOARD_MYRIAD1, + EXP_BOARD_MYRIAD2, + EXP_BOARD_MYRIAD_NOVENA, + EXP_BOARD_HPM1000, + EXP_BOARD_MYRIAD7, + EXP_BOARD_HPM7, + + EXP_BOARD_COUNT +}; + +const char EXP_BOARD_NAMES[][80] = +{ + "UNKNOWN", + "UNSUPPORTED", + "NOT AVAILABLE", + "Myriad1", + "Myriad2", + "Novena", + "HPM1000", + "Myriad7", + "HMP7" +}; + +static const char* GetExpansionBoardName(const eEXP_BOARD board) +{ + if (EXP_BOARD_UNKNOWN < board && board < EXP_BOARD_COUNT) + return EXP_BOARD_NAMES[board]; + else + return EXP_BOARD_NAMES[EXP_BOARD_UNKNOWN]; +} + +struct LMS64C_Info +{ + unsigned char firmware; + unsigned char deviceType; + unsigned char protocol; + unsigned char hardware; + unsigned char expansionBoard; +}; + +enum eCMD_LMS +{ + CMD_GET_INFO = 0x00, + CMD_LMS6002_RST = 0x10, + ///Writes data to SI5356 synthesizer via I2C + CMD_SI5356_WR = 0x11, + ///Reads data from SI5356 synthesizer via I2C + CMD_SI5356_RD = 0x12, + ///Writes data to SI5351 synthesizer via I2C + CMD_SI5351_WR = 0x13, + ///Reads data from SI5351 synthesizer via I2C + CMD_SI5351_RD = 0x14, + ///PanelBus DVI (HDMI) Transmitter control + CMD_TFP410_WR = 0x15, + ///PanelBus DVI (HDMI) Transmitter control + CMD_TFP410_RD = 0x16, + ///Sets new LMS7002M chip’s RESET pin level (0, 1, pulse) + CMD_LMS7002_RST = 0x20, + ///Writes data to LMS7002M chip via SPI + CMD_LMS7002_WR = 0x21, + ///Reads data from LMS7002M chip via SPI + CMD_LMS7002_RD = 0x22, + ///Writes data to LMS6002 chip via SPI + CMD_LMS6002_WR = 0x23, + ///Reads data from LMS6002 chip via SPI + CMD_LMS6002_RD = 0x24, + + CMD_LMS_LNA = 0x2A, + CMD_LMS_PA = 0x2B, + + CMD_PROG_MCU = 0x2C, + ///Writes data to ADF4002 chip via SPI + CMD_ADF4002_WR = 0x31, + + CMD_USB_FIFO_RST = 0x40, + CMD_PE636040_WR = 0x41, + CMD_PE636040_RD = 0x42, + + CMD_GPIO_WR = 0x51, + CMD_GPIO_RD = 0x52, + + CMD_ALTERA_FPGA_GW_WR = 0x53, + CMD_ALTERA_FPGA_GW_RD = 0x54, + + CMD_BRDSPI_WR = 0x55,//16 bit spi for stream, dataspark control + CMD_BRDSPI_RD = 0x56,//16 bit spi for stream, dataspark control + CMD_BRDSPI8_WR = 0x57, //8 + 8 bit spi for stream, dataspark control + CMD_BRDSPI8_RD = 0x58, //8 + 8 bit spi for stream, dataspark control + + CMD_BRDCONF_WR = 0x5D, //write config data to board + CMD_BRDCONF_RD = 0x5E, //read config data from board + + CMD_ANALOG_VAL_WR = 0x61, //write analog value + CMD_ANALOG_VAL_RD = 0x62, //read analog value + + CMD_MYRIAD_RST = 0x80, + CMD_MYRIAD_WR = 0x81, + CMD_MYRIAD_RD = 0x82, + CMD_MYRIAD_PROG = 0x8C +}; + +enum eCMD_STATUS +{ + STATUS_UNDEFINED, + STATUS_COMPLETED_CMD, + STATUS_UNKNOWN_CMD, + STATUS_BUSY_CMD, + STATUS_MANY_BLOCKS_CMD, + STATUS_ERROR_CMD, + STATUS_WRONG_ORDER_CMD, + STATUS_RESOURCE_DENIED_CMD, + STATUS_COUNT +}; + +static const char status_text[][32]= +{ + "Undefined/Failure", + "Completed", + "Unknown command", + "Busy", + "Too many blocks", + "Error", + "Wrong order", + "Resource denied" +}; + +static const char* status2string(const int status) +{ + if(status >= 0 && status < STATUS_COUNT) + return status_text[status]; + else + return "Unknown status"; +} + +enum eADC_UNITS +{ + RAW, + VOLTAGE, + CURRENT, + RESISTANCE, + POWER, + TEMPERATURE, + ADC_UNITS_COUNT +}; + +static const char adc_units_text[][8] = {"", "V", "A", "Ohm", "W", "C"}; + +static const char* adcUnits2string(const unsigned units) +{ + if (units < ADC_UNITS_COUNT) + return adc_units_text[units]; + else + return " unknown"; +} diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/lmsComms.cpp b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/lmsComms.cpp new file mode 100644 index 0000000000000000000000000000000000000000..5b74ef8975782a56f4c386714a48431e78ff2a1a --- /dev/null +++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/lmsComms.cpp @@ -0,0 +1,326 @@ +/** +@file LMScomms.cpp +@author Lime Microsystems (www.limemicro.com) +@brief Implementation of data transmission to LMS boards +*/ + +#include "lmsComms.h" + +LMScomms::LMScomms() +{ + callback_logData = nullptr; + unsigned short test = 0x1234; + unsigned char* bytes = (unsigned char*)&test; + if(bytes[0] == 0x12 && bytes[1] == 0x34) + mSystemBigEndian = true; + else + mSystemBigEndian = false; +} + +LMScomms::~LMScomms() +{ +} + +/** @brief Transfers data between packet and connected device + @param pkt packet containing output data and to receive incomming data + @return 0: success, other: failure +*/ +LMScomms::TransferStatus LMScomms::TransferPacket(GenericPacket& pkt) +{ + std::lock_guard<std::mutex> lock(mControlPortLock); + TransferStatus status = TRANSFER_SUCCESS; + if(IsOpen() == false) + return NOT_CONNECTED; + + int packetLen; + eLMS_PROTOCOL protocol = LMS_PROTOCOL_UNDEFINED; + if(activeControlPort->GetType() == IConnection::SPI_PORT) + protocol = LMS_PROTOCOL_NOVENA; + else + protocol = LMS_PROTOCOL_LMS64C; + switch(protocol) + { + case LMS_PROTOCOL_UNDEFINED: + return TRANSFER_FAILED; + case LMS_PROTOCOL_LMS64C: + packetLen = ProtocolLMS64C::pktLength; + break; + case LMS_PROTOCOL_NOVENA: + packetLen = pkt.outBuffer.size() > ProtocolNovena::pktLength ? ProtocolNovena::pktLength : pkt.outBuffer.size(); + break; + default: + packetLen = 0; + return TRANSFER_FAILED; + } + int outLen = 0; + unsigned char* outBuffer = NULL; + outBuffer = PreparePacket(pkt, outLen, protocol); + unsigned char* inBuffer = new unsigned char[outLen]; + memset(inBuffer, 0, outLen); + + int outBufPos = 0; + int inDataPos = 0; + if(outLen == 0) + { + //printf("packet outlen = 0\n"); + outLen = 1; + } + + if(protocol == LMS_PROTOCOL_NOVENA) + { + bool transferData = true; //some commands are fake, so don't need transferring + if(pkt.cmd == CMD_GET_INFO) + { + //spi does not have GET INFO, fake it to inform what device it is + pkt.status = STATUS_COMPLETED_CMD; + pkt.inBuffer.clear(); + pkt.inBuffer.resize(64, 0); + pkt.inBuffer[0] = 0; //firmware + pkt.inBuffer[1] = LMS_DEV_NOVENA; //device + pkt.inBuffer[2] = 0; //protocol + pkt.inBuffer[3] = 0; //hardware + pkt.inBuffer[4] = EXP_BOARD_UNSUPPORTED; //expansion + transferData = false; + } + + if(transferData) + { + if (callback_logData) + callback_logData(true, outBuffer, outLen); + int bytesWritten = Write(outBuffer, outLen); + if( bytesWritten == outLen) + { + if(pkt.cmd == CMD_LMS7002_RD) + { + inDataPos = Read(&inBuffer[inDataPos], outLen); + if(inDataPos != outLen) + status = TRANSFER_FAILED; + else + { + if (callback_logData) + callback_logData(false, inBuffer, inDataPos); + } + } + ParsePacket(pkt, inBuffer, inDataPos, protocol); + } + else + status = TRANSFER_FAILED; + } + } + else + { + for(int i=0; i<outLen; i+=packetLen) + { + int bytesToSend = packetLen; + if (callback_logData) + callback_logData(true, &outBuffer[outBufPos], bytesToSend); + if( Write(&outBuffer[outBufPos], bytesToSend) ) + { + outBufPos += packetLen; + long readLen = packetLen; + int bread = Read(&inBuffer[inDataPos], readLen); + if(bread != readLen && protocol != LMS_PROTOCOL_NOVENA) + { + status = TRANSFER_FAILED; + break; + } + if (callback_logData) + callback_logData(false, &inBuffer[inDataPos], bread); + inDataPos += bread; + } + else + { + status = TRANSFER_FAILED; + break; + } + } + ParsePacket(pkt, inBuffer, inDataPos, protocol); + } + delete outBuffer; + delete inBuffer; + return status; +} + +/** @brief Returns connected device information +*/ +LMSinfo LMScomms::GetInfo() +{ + LMSinfo info; + info.device = LMS_DEV_UNKNOWN; + info.expansion = EXP_BOARD_UNKNOWN; + info.firmware = 0; + info.hardware = 0; + info.protocol = 0; + GenericPacket pkt; + pkt.cmd = CMD_GET_INFO; + LMScomms::TransferStatus status = TransferPacket(pkt); + if (status == LMScomms::TRANSFER_SUCCESS && pkt.inBuffer.size() >= 5) + { + info.firmware = pkt.inBuffer[0]; + info.device = pkt.inBuffer[1] < LMS_DEV_COUNT ? (eLMS_DEV)pkt.inBuffer[1] : LMS_DEV_UNKNOWN; + info.protocol = pkt.inBuffer[2]; + info.hardware = pkt.inBuffer[3]; + info.expansion = pkt.inBuffer[4] < EXP_BOARD_COUNT ? (eEXP_BOARD)pkt.inBuffer[4] : EXP_BOARD_UNKNOWN; + } + return info; +} + +/** @brief Takes generic packet and converts to specific protocol buffer + @param pkt generic data packet to convert + @param length returns length of returned buffer + @param protocol which protocol to use for data + @return pointer to data buffer, must be manually deleted after use +*/ +unsigned char* LMScomms::PreparePacket(const GenericPacket& pkt, int& length, const eLMS_PROTOCOL protocol) +{ + unsigned char* buffer = NULL; + if(protocol == LMS_PROTOCOL_UNDEFINED) + return NULL; + + if(protocol == LMS_PROTOCOL_LMS64C) + { + ProtocolLMS64C packet; + int maxDataLength = packet.maxDataLength; + packet.cmd = pkt.cmd; + packet.status = pkt.status; + int byteBlockRatio = 1; //block ratio - how many bytes in one block + switch( packet.cmd ) + { + case CMD_PROG_MCU: + case CMD_GET_INFO: + case CMD_SI5351_RD: + case CMD_SI5356_RD: + byteBlockRatio = 1; + break; + case CMD_SI5351_WR: + case CMD_SI5356_WR: + byteBlockRatio = 2; + break; + case CMD_LMS7002_RD: + case CMD_BRDSPI_RD: + case CMD_BRDSPI8_RD: + byteBlockRatio = 2; + break; + case CMD_ADF4002_WR: + byteBlockRatio = 3; + break; + case CMD_LMS7002_WR: + case CMD_BRDSPI_WR: + case CMD_ANALOG_VAL_WR: + byteBlockRatio = 4; + break; + default: + byteBlockRatio = 1; + } + if (packet.cmd == CMD_LMS7002_RD || packet.cmd == CMD_BRDSPI_RD) + maxDataLength = maxDataLength/2; + if (packet.cmd == CMD_ANALOG_VAL_RD) + maxDataLength = maxDataLength / 4; + int blockCount = pkt.outBuffer.size()/byteBlockRatio; + int bufLen = blockCount/(maxDataLength/byteBlockRatio) + +(blockCount%(maxDataLength/byteBlockRatio)!=0); + bufLen *= packet.pktLength; + if(bufLen == 0) + bufLen = packet.pktLength; + buffer = new unsigned char[bufLen]; + memset(buffer, 0, bufLen); + int srcPos = 0; + for(int j=0; j*packet.pktLength<bufLen; ++j) + { + int pktPos = j*packet.pktLength; + buffer[pktPos] = packet.cmd; + buffer[pktPos+1] = packet.status; + if(blockCount > (maxDataLength/byteBlockRatio)) + { + buffer[pktPos+2] = maxDataLength/byteBlockRatio; + blockCount -= buffer[pktPos+2]; + } + else + buffer[pktPos+2] = blockCount; + memcpy(&buffer[pktPos+3], packet.reserved, sizeof(packet.reserved)); + int bytesToPack = (maxDataLength/byteBlockRatio)*byteBlockRatio; + for (int k = 0; k<bytesToPack && srcPos < pkt.outBuffer.size(); ++srcPos, ++k) + buffer[pktPos + 8 + k] = pkt.outBuffer[srcPos]; + } + length = bufLen; + } + else if(protocol == LMS_PROTOCOL_NOVENA) + { + const uint16_t NOVENA_GPIO_ADDR = 0x0706; + if(pkt.cmd == CMD_LMS7002_RST) + { + buffer = new unsigned char[8]; + buffer[0] = (NOVENA_GPIO_ADDR >> 8) | 0x80; + buffer[1] = NOVENA_GPIO_ADDR & 0xFF; + buffer[2] = 0x00; + buffer[3] = 0x18; + buffer[4] = (NOVENA_GPIO_ADDR >> 8) | 0x80; + buffer[5] = NOVENA_GPIO_ADDR & 0xFF; + buffer[6] = 0x00; + buffer[7] = 0x38; + length = 8; + } + else + { + buffer = new unsigned char[pkt.outBuffer.size()]; + memcpy(buffer, &pkt.outBuffer[0], pkt.outBuffer.size()); + if (pkt.cmd == CMD_LMS7002_WR) + { + for(int i=0; i<pkt.outBuffer.size(); i+=4) + buffer[i] |= 0x80; + } + length = pkt.outBuffer.size(); + } + } + return buffer; +} + +/** @brief Parses given data buffer into generic packet + @param pkt destination packet + @param buffer received data from board + @param length received buffer length + @param protocol which protocol to use for data parsing + @return 1:success, 0:failure +*/ +int LMScomms::ParsePacket(GenericPacket& pkt, const unsigned char* buffer, const int length, const eLMS_PROTOCOL protocol) +{ + if(protocol == LMS_PROTOCOL_UNDEFINED) + return -1; + + if(protocol == LMS_PROTOCOL_LMS64C) + { + ProtocolLMS64C packet; + int inBufPos = 0; + pkt.inBuffer.resize(packet.maxDataLength*(length / packet.pktLength + (length % packet.pktLength)), 0); + for(int i=0; i<length; i+=packet.pktLength) + { + pkt.cmd = (eCMD_LMS)buffer[i]; + pkt.status = (eCMD_STATUS)buffer[i+1]; + memcpy(&pkt.inBuffer[inBufPos], &buffer[i+8], packet.maxDataLength); + inBufPos += packet.maxDataLength; + } + } + else if(protocol == LMS_PROTOCOL_NOVENA) + { + pkt.cmd = CMD_LMS7002_RD; + pkt.status = STATUS_COMPLETED_CMD; + pkt.inBuffer.clear(); + for(int i=0; i<length; i+=2) + { + //reading from spi returns only registers values + //fill addresses as zeros to match generic format of address, value pairs + pkt.inBuffer.push_back(0); //should be address msb + pkt.inBuffer.push_back(0); //should be address lsb + pkt.inBuffer.push_back(buffer[i]); + pkt.inBuffer.push_back(buffer[i+1]); + } + } + return 1; +} + +/** @brief Sets callback function which gets called each time data is sent or received +*/ +void LMScomms::SetDataLogCallback(std::function<void(bool, const unsigned char*, const unsigned int)> callback) +{ + callback_logData = callback; +} diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/lmsComms.h b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/lmsComms.h new file mode 100644 index 0000000000000000000000000000000000000000..3d94d8ece236d3e96dfb1484dd31263c4d440492 --- /dev/null +++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/lmsComms.h @@ -0,0 +1,111 @@ +/** +@file LMScomms.h +@author Lime Microsystems (www.limemicro.com) +@brief Class for handling data transmission to LMS boards +*/ + +#ifndef LMS_COMMS_H +#define LMS_COMMS_H + +#include "lms7002_defines.h" +#include "connectionManager/ConnectionManager.h" +#include <string.h> +#include <mutex> + +struct LMSinfo +{ + eLMS_DEV device; + eEXP_BOARD expansion; + int firmware; + int hardware; + int protocol; +}; + +/* @brief Class for abstracting transfering data to and from chip +*/ +class LMScomms : public ConnectionManager +{ +public: + enum TransferStatus + { + TRANSFER_SUCCESS, + TRANSFER_FAILED, + NOT_CONNECTED + }; + + enum eLMS_PROTOCOL + { + LMS_PROTOCOL_UNDEFINED = 0, + LMS_PROTOCOL_DIGIC, + LMS_PROTOCOL_LMS64C, + LMS_PROTOCOL_NOVENA, + }; + struct ProtocolDIGIC + { + static const int pktLength = 64; + static const int maxDataLength = 60; + ProtocolDIGIC() : cmd(0), i2cAddr(0), blockCount(0) {}; + unsigned char cmd; + unsigned char i2cAddr; + unsigned char blockCount; + unsigned char reserved; + unsigned char data[maxDataLength]; + }; + + struct ProtocolLMS64C + { + static const int pktLength = 64; + static const int maxDataLength = 56; + ProtocolLMS64C() :cmd(0),status(STATUS_UNDEFINED),blockCount(0) + { + memset(reserved, 0, 5); + }; + unsigned char cmd; + unsigned char status; + unsigned char blockCount; + unsigned char reserved[5]; + unsigned char data[maxDataLength]; + }; + + struct ProtocolNovena + { + static const int pktLength = 128; + static const int maxDataLength = 128; + ProtocolNovena() :cmd(0),status(0) {}; + unsigned char cmd; + unsigned char status; + unsigned char blockCount; + unsigned char data[maxDataLength]; + }; + + struct GenericPacket + { + GenericPacket() + { + cmd = CMD_GET_INFO; + status = STATUS_UNDEFINED; + } + + eCMD_LMS cmd; + eCMD_STATUS status; + vector<unsigned char> outBuffer; + vector<unsigned char> inBuffer; + }; + + LMScomms(); + ~LMScomms(); + + virtual TransferStatus TransferPacket(GenericPacket &pkt); + LMSinfo GetInfo(); + void SetDataLogCallback(std::function<void(bool, const unsigned char*, const unsigned int)> callback); +protected: + std::function<void(bool, const unsigned char*, const unsigned int)> callback_logData; + std::mutex mControlPortLock; + unsigned char* PreparePacket(const GenericPacket &pkt, int &length, const eLMS_PROTOCOL protocol); + int ParsePacket(GenericPacket &pkt, const unsigned char* buffer, const int length, const eLMS_PROTOCOL protocol); +protected: + bool mSystemBigEndian; +}; + +#endif // LMS_COMMS_H + diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/typedefs.h b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/typedefs.h new file mode 100644 index 0000000000000000000000000000000000000000..9ae0c25d93843298f9a95236aa2e10c3272ac3db --- /dev/null +++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/typedefs.h @@ -0,0 +1,18 @@ +/** +@file typedefs.h +@author Lime Microsystems (www.limemicro.com) +@brief Variables types definitions +*/ + +#ifndef LMS7002M_TYPEDEFS_H +#define LMS7002M_TYPEDEFS_H + +typedef unsigned int uint32_t; +typedef int int32_t; +typedef unsigned short uint16_t; +typedef short int16_t; +typedef signed char int8_t; +typedef unsigned char uint8_t; +typedef double float_type; + +#endif diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/CMakeLists.txt b/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..0225e1d4d6148af3df4055101eadb954c86768d8 --- /dev/null +++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/CMakeLists.txt @@ -0,0 +1,58 @@ +cmake_minimum_required(VERSION 2.8) +set(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE TYPE INTERNAL FORCE) +project("matlab_StreamDLL") +#include modules for finding CyAPI +set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/") +cmake_policy(SET CMP0015 OLD) +if(${CMAKE_MAJOR_VERSION} GREATER 2) + cmake_policy(SET CMP0043 NEW) +endif() +ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS) +if(CMAKE_COMPILER_IS_GNUCXX) + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x -fPIC") +endif() + +# Add sub-directories +add_subdirectory(LMS_StreamBoard) +include_directories(LMS_StreamBoard) +add_subdirectory(connectionManager) +include_directories(connectionManager) + +set(BINARY_OUTPUT_DIR "${CMAKE_BINARY_DIR}/bin") + +if (MSVC) + SET( MSVC_MULTITHREAD_COMPILE_FLAGS "/MP") + SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${MSVC_MULTITHREAD_COMPILE_FLAGS}" ) +endif(MSVC) + +set(Library_file_list LMS_SDR.cpp ) + +set(BUILD_STATIC_LIB OFF CACHE BOOL "Build static or dynamic library") +if( BUILD_STATIC_LIB ) + add_library(LMS_SDR STATIC ${Library_file_list}) +else() + add_library(LMS_SDR SHARED ${Library_file_list}) +endif(BUILD_STATIC_LIB) + +set(AUTO_UPDATE_VERSION OFF CACHE BOOL "Uses python script to increment version") +if(AUTO_UPDATE_VERSION) + add_custom_target(updateVersion ALL COMMAND python ${CMAKE_CURRENT_SOURCE_DIR}/auto_version.py WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) + add_dependencies(LMS_SDR updateVersion) +endif() + +target_link_libraries(LMS_SDR + LMS_StreamBoard + ${CYAPI_LIBRARIES} + ) + +if(WIN32) + find_package(CyAPI REQUIRED) + LINK_DIRECTORIES(${CYAPI_LIBRARIES}) + include_directories(${CYAPI_INCLUDE_DIRS}) + set(CONNECTION_MANAGER_LIBS ${CYAPI_LIBRARIES} SetupAPI) +endif() +if(UNIX) + set(CONNECTION_MANAGER_LIBS usb-1.0 -lpthread) +endif() + +target_link_libraries(LMS_SDR ${CONNECTION_MANAGER_LIBS}) diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/LMS_SDR.cpp b/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/LMS_SDR.cpp new file mode 100644 index 0000000000000000000000000000000000000000..1ff4bbf1de7b1a3f9587f8183a74b14e53c8f2b9 --- /dev/null +++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/LMS_SDR.cpp @@ -0,0 +1,334 @@ +/** +@author Lime Microsystems +@brief Stream board communications for Matlab +*/ + +#include "LMS_SDR.h" + +#include "lmsComms.h" +#include "LMS_StreamBoard.h" +#include "ringBuffer.h" +#include "IConnection.h" +#include "fifo.h" +#include "dataTypes.h" +#include <unistd.h> +#include <thread> + +#include <vector> +#include <atomic> +#include <thread> +#include <mutex> +#include <chrono> + +#define _USE_MATH_DEFINES +#include <math.h> + +using namespace std; + +typedef enum +{ + LMS_SUCCESS = 0, + LMS_ERROR +} LMS_STATUS; + +LMS_SamplesFIFO rxBuffer(1); +static thread rxThread; +atomic<bool> rxStop(1); +atomic<bool> rxRunning(0); +atomic<unsigned long> rxDroppedSamples(0); +atomic<long> RxDataRate(0); +atomic<uint32_t> rxSamplingRate(0); + +LMS_SamplesFIFO txBuffer(1); +static thread txThread; +atomic<bool> txStop(1); +atomic<bool> txRunning(0); +atomic<long> txDroppedSamples(0); +atomic<long> TxDataRate(0); +atomic<uint32_t> txSamplingRate(0); + +LMScomms comPort(IConnection::COM_PORT); +LMScomms usbPort(IConnection::USB_PORT); +LMS_StreamBoard streamer(&usbPort); + +const int samplesInPacket = 1024; +unsigned int opMode = 0; + +DLL_EXPORT void LMS_Stats(uint32_t *RxBufSize, uint32_t *RxBufFilled, uint32_t *RxSamplingRate, uint32_t *TxBufSize, uint32_t *TxBufFilled, uint32_t *TxSamplingRate) +{ + LMS_SamplesFIFO::BufferInfo rxStats = rxBuffer.GetInfo(); + LMS_SamplesFIFO::BufferInfo txStats = txBuffer.GetInfo(); + if (RxBufSize) + *RxBufSize = rxStats.size*samplesInPacket; + if (RxBufFilled) + *RxBufFilled = rxStats.itemsFilled*samplesInPacket; + if (TxBufSize) + *TxBufSize = txStats.size*samplesInPacket; + if (TxBufFilled) + *TxBufFilled = txStats.itemsFilled*samplesInPacket; + if (TxSamplingRate) + *TxSamplingRate = txSamplingRate.load(); + if (RxSamplingRate) + *RxSamplingRate = rxSamplingRate.load(); +} + +DLL_EXPORT int LMS_Init(const int OperationMode, uint32_t trxBuffersLength) +{ + opMode = OperationMode; + unsigned int packetsNeeded = trxBuffersLength / samplesInPacket; + if (trxBuffersLength % samplesInPacket != 0) + ++packetsNeeded; + if (packetsNeeded >= (uint32_t)(1 << 31)) + packetsNeeded = (uint32_t)(1 << 31); + for (int i = 0; i < 32; ++i) + if ((1 << i) >= packetsNeeded) + { + packetsNeeded = (1 << i); + break; + } + rxBuffer.Reset(packetsNeeded); + txBuffer.Reset(packetsNeeded); + return LMS_SUCCESS; +} + +DLL_EXPORT int LMS_Destroy() +{ + LMS_RxStop(); + //buffers size is reduced to lower memory consumption when not used + rxBuffer.Reset(1); + txBuffer.Reset(1); + return LMS_SUCCESS; +} + +DLL_EXPORT LMScomms* LMS_GetUSBPort() +{ + return &usbPort; +} + +DLL_EXPORT LMScomms* LMS_GetCOMPort() +{ + return &comPort; +} + +const int maxDevListLen = 32; +const int maxDevNameLen = 256; //each device name not longer than 256 +static char DeviceNames[maxDevListLen][maxDevNameLen]; + +DLL_EXPORT int LMS_UpdateDeviceList(LMScomms* port) +{ + memset(DeviceNames, 0, maxDevListLen*maxDevNameLen); + port->Close(); + int devCount = port->RefreshDeviceList(); + vector<string> names = port->GetDeviceList(); + int charsWritten = 0; + for (unsigned int i = 0; i < names.size() && i < maxDevListLen; ++i) + { + charsWritten += sprintf(DeviceNames[i], "[%i] %.*s", i, maxDevNameLen, names[i].c_str()); + } + return devCount; +} + +DLL_EXPORT const char* LMS_GetDeviceName(LMScomms* port, unsigned int deviceIndex) +{ + if (deviceIndex < maxDevListLen) + return DeviceNames[deviceIndex]; + else + return ""; +} + +DLL_EXPORT int LMS_DeviceOpen(LMScomms* port, const uint32_t deviceIndex) +{ + port->Close(); + int status = port->Open(deviceIndex); + if (status == 1) + { + return LMS_SUCCESS; + } + else + { + return LMS_ERROR; + } +} + +DLL_EXPORT void LMS_DeviceClose(LMScomms* port) +{ + port->Close(); +} + +DLL_EXPORT uint32_t LMS_ControlWrite(LMScomms* port, const uint8_t *buffer, const uint16_t bufLen) +{ + return port->Write(buffer, bufLen, 0); +} + +DLL_EXPORT uint32_t LMS_ControlRead(LMScomms* port, uint8_t* buffer, const uint16_t bufLen) +{ + return port->Read(buffer, bufLen, 0); +} + + + +const int RX_BUFF_SZ (1020*1024/4); +uint32_t rx_buffer[RX_BUFF_SZ]; +uint64_t start_timestamp = 0;; +uint32_t wr_pos = 0; +uint32_t rd_pos = 0; + +void ReceivePackets() +{ + rxRunning.store(true); + uint32_t samplesCollected = 0; + + const int bufferSize = 4096;// 4096; + const int buffersCount = 32; // must be power of 2 + const int buffersCountMask = buffersCount - 1; + int handles[buffersCount]= {0}; + char buffers[buffersCount*bufferSize]={0}; + + struct sched_param sp; + sp.sched_priority = sched_get_priority_max(SCHED_FIFO); + if (pthread_setschedparam(pthread_self(),SCHED_FIFO,&sp)!=0) + { + printf("Shed prams failed\n"); + } + + //switch off Rx + uint16_t regVal = streamer.SPI_read(0x0005); + streamer.SPI_write(0x0005, regVal & ~0x6); + //USB FIFO reset + LMScomms::GenericPacket ctrPkt; + ctrPkt.cmd = CMD_USB_FIFO_RST; + ctrPkt.outBuffer.push_back(0x01); + usbPort.TransferPacket(ctrPkt); + ctrPkt.outBuffer[0] = 0x00; + usbPort.TransferPacket(ctrPkt); + + streamer.SPI_write(0x0005, regVal | 0x6); + + streamer.SPI_write(0x0001, 0x0001); + streamer.SPI_write(0x0007, 0x0000); + + for (int i = 0; i<buffersCount; ++i) + handles[i] = usbPort.BeginDataReading(&buffers[i*bufferSize], bufferSize); + + int bi = 0; + + while (rxStop.load() != true) + { + if (usbPort.WaitForReading(handles[bi], 1000) == false) + break; + + long bytesToRead = bufferSize; + long bytesReceived = usbPort.FinishDataReading(&buffers[bi*bufferSize], bytesToRead, handles[bi]); + if (bytesReceived > 0) + { + PacketLTE* pkt = (PacketLTE*)&buffers[bi*bufferSize]; + for(uint16_t sampleIndex = 0; sampleIndex < sizeof(pkt->samples)/sizeof(int16_t); sampleIndex++) + { + pkt->samples[sampleIndex] <<= 4; + pkt->samples[sampleIndex] >>= 4; + } + + rxBuffer.push_samples((complex16_t*)pkt->samples, 1020, pkt->counter, 100); + } + // Re-submit this request to keep the queue full + memset(&buffers[bi*bufferSize], 0, bufferSize); + handles[bi] = usbPort.BeginDataReading(&buffers[bi*bufferSize], bufferSize); + bi = (bi + 1) & buffersCountMask; + pthread_yield(); + } + + usbPort.AbortReading(); + for (int j = 0; j<buffersCount; j++) + { + long bytesToRead = bufferSize; + usbPort.WaitForReading(handles[j], 1000); + usbPort.FinishDataReading(&buffers[j*bufferSize], bytesToRead, handles[j]); + } + rxRunning.store(false); +} + + +DLL_EXPORT uint32_t LMS_TRxWrite(const int16_t *data, const uint32_t samplesCount, const uint32_t antenna_id, uint64_t timestamp) +{ + static uint32_t tx_buffer[1020]; + static int index = 0; + + const int bufferSize = 1024 * 4; + const int buffersCount = 32; // must be power of 2 + const int buffersCountMask = buffersCount - 1; + + static int handles[buffersCount] = {0}; + static char buffers[buffersCount*bufferSize]={0}; + static bool bufferUsed[buffersCount] = {0}; + static int bi = 0; //buffer index + PacketLTE* pkt; + + uint64_t ts = timestamp - index; + + pkt = (PacketLTE*)&buffers[bi*bufferSize]; + + for (int i=0;i<samplesCount;i++) + { + ((uint32_t*)pkt->samples)[index++]=(((uint32_t*)data)[i]& 0xFFF0FFF) | 0x1000; + + if (index == 1020) + { + pkt->counter = ts; + + if (bufferUsed[bi]) + { + if (usbPort.WaitForSending(handles[bi], 1000) == false) + return -1; + // Must always call FinishDataXfer to release memory of contexts[i] + long tempToSend = sizeof(PacketLTE); + usbPort.FinishDataSending(&buffers[bi*bufferSize], tempToSend, handles[bi]); + + bufferUsed[bi] = false; + } + handles[bi] = usbPort.BeginDataSending(&buffers[bi*bufferSize], sizeof(PacketLTE)); + bufferUsed[bi] = true; + bi = (bi + 1) & buffersCountMask; + pkt = (PacketLTE*)&buffers[bi*bufferSize]; + ts += 1020; + index = 0; + } + } +} + +vector<PacketLTE> PacketsBuffer(2048, PacketLTE()); +DLL_EXPORT uint32_t LMS_TRxRead(int16_t *buffer, const uint32_t samplesCount, const uint32_t antenna_id, uint64_t *timestamp, const uint32_t timeout_ms) +{ + if (usbPort.IsOpen() == false && opMode != -1) + return 0; + pthread_yield(); + uint32_t samplesPopped = rxBuffer.pop_samples((complex16_t*)buffer, samplesCount, timestamp, timeout_ms); + return samplesPopped; +} + + +DLL_EXPORT int LMS_RxStart() +{ + if (rxRunning.load()) + return 1; + if (usbPort.IsOpen() == false && opMode != -1) + return 1; + rxStop.store(false); + unsigned int bufSz = rxBuffer.GetInfo().size; + rxBuffer.Reset(bufSz); + rxThread = thread(ReceivePackets); + return 0; +} + +DLL_EXPORT int LMS_RxStop() +{ + if (rxRunning.load()) + { + if (rxThread.joinable()) + { + rxStop.store(true); + rxThread.join(); + } + rxStop.store(true); + } + return 0; +} diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/LMS_SDR.h b/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/LMS_SDR.h new file mode 100644 index 0000000000000000000000000000000000000000..27a72e351a63ba5b71e2b92add5614a40ef654b9 --- /dev/null +++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/LMS_SDR.h @@ -0,0 +1,143 @@ +/** +@author Lime Microsystems +@brief Interface for implementing SDR using Lime microsystems boards +*/ + +#ifndef LMS_SDR_INTERFACE_H +#define LMS_SDR_INTERFACE_H + +#include <stdint.h> + +#ifdef __cplusplus +class LMScomms; +#else +typedef void LMScomms; +#endif + +#define BUILD_DLL +#ifndef __unix__ +#ifdef BUILD_DLL + #define DLL_EXPORT __declspec(dllexport) +#else + #define DLL_EXPORT __declspec(dllimport) +#endif +#else +#define DLL_EXPORT +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/** @brief Returns stats of internal buffers + @param RxBufSize Receiver buffer size in samples + @param RxBufFilled Number of samples currently in the receiver buffer + @param RxSamplingRate Approximate receiver sampling rate, calculated from incomming data + @param TxBufSize Transmitter buffer size in samples + @param TxBufFilled Number of samples currently in the transmitter buffer + @param TxSamplingRate Approximate transmitter sampling rate, calculated from incomming data +*/ +DLL_EXPORT void LMS_Stats(uint32_t *RxBufSize, uint32_t *RxBufFilled, uint32_t *RxSamplingRate, uint32_t *TxBufSize, uint32_t *TxBufFilled, uint32_t *TxSamplingRate); + +/** @brief Initializes internal memory for samples buffering to hardware + @param OperationMode samples transfering mode: 0-packets synchronized, 1-packets not synchronized + @param trxBuffersLength Rx and Tx internal buffers size in samples + @return 0 success, -1 failure + + Generally trxBuffersSamplesCount should be more than 65536 +*/ +DLL_EXPORT int LMS_Init(const int OperationMode, uint32_t trxBuffersLength); + +/** @brief Stops internal threads and frees internal buffers memory + @return 0 success, -1 failure +*/ +DLL_EXPORT int LMS_Destroy(); + +///@name Device connection +/** @return object for communicating over USB port +*/ +DLL_EXPORT LMScomms* LMS_GetUSBPort(); + +/** @return object for communicating over COM port +*/ +DLL_EXPORT LMScomms* LMS_GetCOMPort(); + +/** @brief Refreshes currently connected device list + @param port Communications port to update + @return number of devices connected +*/ +DLL_EXPORT int LMS_UpdateDeviceList(LMScomms* port); + +/** @brief Returns pointer to static null terminated c-string name of selected device + @param port Communications port object + @param deviceIndex index from communications port device list +*/ +DLL_EXPORT const char* LMS_GetDeviceName(LMScomms* port, unsigned int deviceIndex); + +/** @brief Connects to selected device on given port + @param port Communications port object + @param deviceIndex index from communications port device list + @return 0-success +*/ +DLL_EXPORT int LMS_DeviceOpen(LMScomms* port, const uint32_t deviceIndex); + +/** @brief Closes connection on given port + @param port Communications port to close +*/ +DLL_EXPORT void LMS_DeviceClose(LMScomms* port); +///@} + +///@name Communications +/** @brief Writes given data to control port + @param port Port for communications + @param buffer data to be written + @param bufLen buffer length in bytes + @return number of bytes written +*/ +DLL_EXPORT uint32_t LMS_ControlWrite(LMScomms* port, const uint8_t *buffer, const uint16_t bufLen); + +/** @brief Reads given data from SPI regiter + @param port Port for communications + @param buffer destination buffer for data + @param bufLen number of bytes to read + @return number of bytes read +*/ +DLL_EXPORT uint32_t LMS_ControlRead(LMScomms* port, uint8_t* buffer, const uint16_t bufLen); + +/** @brief Starts thread for samples receiving + @return 0-success +*/ +DLL_EXPORT int LMS_RxStart(); + +/** @brief Stops samples receiving thread + @return 0:success, 1:failed +*/ +DLL_EXPORT int LMS_RxStop(); + +/** @brief Adds given samples to transmitter buffer, to be sent at specified timestamp +@param buffer source array for interleaved values (IQIQIQ...), each value amplitude should be from -2048 to 2047 +@param samplesCount number of samples in buffer, 1 sample = 2 bytes I + 2 bytes Q +@param channel_id destination channel +@param timestamp timestamp when the first sample in buffer should be transmitted (used only in synchronized operating mode) +@param timeout_ms time amount in milliseconds to try adding samples +@return number of samples written +*/ +DLL_EXPORT uint32_t LMS_TRxWrite(const int16_t *buffer, const uint32_t samplesCount, const uint32_t channel_id, uint64_t timestamp); + +/** @brief Reads samples from receiver buffer +@param buffer destination array for interleaved values (IQIQIQ...), must be big enough to store requested number of samples, each value amplitude will be from -2048 to 2047 +@param samplesCount number of samples to read, 1 sample = 2 bytes I + 2 bytes Q +@param antenna_id source channel +@param timestamp returns timestamp of the first sample in the buffer (used only in synchronized operating mode) +@param timeout_ms time amount in milliseconds to try reading samples +@return number of samples read +*/ +DLL_EXPORT uint32_t LMS_TRxRead(int16_t *buffer, const uint32_t samplesCount, const uint32_t channel_id, uint64_t *timestamp, const uint32_t timeout_ms); + +///@} + +#ifdef __cplusplus +} //extern "C" +#endif + +#endif //LMS_SDR_INTERFACE_H diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/LMS_StreamBoard/CMakeLists.txt b/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/LMS_StreamBoard/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..02e6bb5ab92be2e0ea821285697f5dd771fc189a --- /dev/null +++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/LMS_StreamBoard/CMakeLists.txt @@ -0,0 +1,22 @@ +set(streamBoard_src_files + LMS_StreamBoard.cpp +) + +add_library(LMS_StreamBoard STATIC ${streamBoard_src_files}) +target_include_directories(LMS_StreamBoard PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) + +target_link_libraries(LMS_StreamBoard ConnectionManager) + +if(WIN32 AND ENABLE_USB_CONNECTION) + find_package(CyAPI REQUIRED) + LINK_DIRECTORIES(${CYAPI_LIBRARIES}) + include_directories(${CYAPI_INCLUDE_DIRS}) + set(CONNECTION_MANAGER_LIBS ${CYAPI_LIBRARIES} SetupAPI) + target_link_libraries(LMS_StreamBoard ${CONNECTION_MANAGER_LIBS}) +endif() +if(UNIX AND ENABLE_USB_CONNECTION) + set(CONNECTION_MANAGER_LIBS usb-1.0 -lpthread) + target_link_libraries(LMS_StreamBoard ${CONNECTION_MANAGER_LIBS}) +endif() + + diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/LMS_StreamBoard/LMS_StreamBoard.cpp b/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/LMS_StreamBoard/LMS_StreamBoard.cpp new file mode 100644 index 0000000000000000000000000000000000000000..da9e4a7b8e6e97ab27c22f4757bd7ddba3141cf9 --- /dev/null +++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/LMS_StreamBoard/LMS_StreamBoard.cpp @@ -0,0 +1,770 @@ +#include "LMS_StreamBoard.h" +#include "lmsComms.h" +#include "lms7002_defines.h" +#include <assert.h> +#include <iostream> + +/** @brief Configures Stream board FPGA clocks + @param serPort Communications port to send data + @param fOutTx_MHz transmitter frequency in MHz + @param fOutRx_MHz receiver frequency in MHz + @param phaseShift_deg IQ phase shift in degrees + @return 0-success, other-failure +*/ +LMS_StreamBoard::Status LMS_StreamBoard::ConfigurePLL(LMScomms *serPort, const float fOutTx_MHz, const float fOutRx_MHz, const float phaseShift_deg) +{ + assert(serPort != nullptr); + if (serPort == NULL) + return FAILURE; + if (serPort->IsOpen() == false) + return FAILURE; + const float vcoLimits_MHz[2] = { 600, 1300 }; + int M, C; + const short bufSize = 64; + + float fOut_MHz = fOutTx_MHz; + float coef = 0.8*vcoLimits_MHz[1] / fOut_MHz; + M = C = (int)coef; + int chigh = (((int)coef) / 2) + ((int)(coef) % 2); + int clow = ((int)coef) / 2; + + LMScomms::GenericPacket pkt; + pkt.cmd = CMD_BRDSPI_WR; + + if (fOut_MHz*M > vcoLimits_MHz[0] && fOut_MHz*M < vcoLimits_MHz[1]) + { + pkt.outBuffer.push_back(0x00); + pkt.outBuffer.push_back(0x0F); + pkt.outBuffer.push_back(0x15); //c4-c2_bypassed + pkt.outBuffer.push_back(0x01 | ((M % 2 != 0) ? 0x08 : 0x00) | ((C % 2 != 0) ? 0x20 : 0x00)); //N_bypassed + + pkt.outBuffer.push_back(0x00); + pkt.outBuffer.push_back(0x08); + pkt.outBuffer.push_back(1); //N_high_cnt + pkt.outBuffer.push_back(1);//N_low_cnt + pkt.outBuffer.push_back(0x00); + pkt.outBuffer.push_back(0x09); + pkt.outBuffer.push_back(chigh); //M_high_cnt + pkt.outBuffer.push_back(clow); //M_low_cnt + for (int i = 0; i <= 1; ++i) + { + pkt.outBuffer.push_back(0x00); + pkt.outBuffer.push_back(0x0A + i); + pkt.outBuffer.push_back(chigh); //cX_high_cnt + pkt.outBuffer.push_back(clow); //cX_low_cnt + } + + float Fstep_us = 1 / (8 * fOutTx_MHz*C); + float Fstep_deg = (360 * Fstep_us) / (1 / fOutTx_MHz); + short nSteps = phaseShift_deg / Fstep_deg; + unsigned short reg2 = 0x0400 | (nSteps & 0x3FF); + pkt.outBuffer.push_back(0x00); + pkt.outBuffer.push_back(0x02); + pkt.outBuffer.push_back((reg2 >> 8)); + pkt.outBuffer.push_back(reg2); //phase + + pkt.outBuffer.push_back(0x00); + pkt.outBuffer.push_back(0x03); + pkt.outBuffer.push_back(0x00); + pkt.outBuffer.push_back(0x01); + + pkt.outBuffer.push_back(0x00); + pkt.outBuffer.push_back(0x03); + pkt.outBuffer.push_back(0x00); + pkt.outBuffer.push_back(0x00); + + reg2 = reg2 | 0x800; + pkt.outBuffer.push_back(0x00); + pkt.outBuffer.push_back(0x02); + pkt.outBuffer.push_back((reg2 >> 8)); + pkt.outBuffer.push_back(reg2); + + if(serPort->TransferPacket(pkt) != LMScomms::TRANSFER_SUCCESS || pkt.status != STATUS_COMPLETED_CMD) + return FAILURE; + } + else + return FAILURE; + + fOut_MHz = fOutRx_MHz; + coef = 0.8*vcoLimits_MHz[1] / fOut_MHz; + M = C = (int)coef; + chigh = (((int)coef) / 2) + ((int)(coef) % 2); + clow = ((int)coef) / 2; + if (fOut_MHz*M > vcoLimits_MHz[0] && fOut_MHz*M < vcoLimits_MHz[1]) + { + short index = 0; + pkt.outBuffer.clear(); + pkt.outBuffer.push_back(0x00); + pkt.outBuffer.push_back(0x0F); + pkt.outBuffer.push_back(0x15); //c4-c2_bypassed + pkt.outBuffer.push_back(0x41 | ((M % 2 != 0) ? 0x08 : 0x00) | ((C % 2 != 0) ? 0x20 : 0x00)); //N_bypassed, c1 bypassed + + pkt.outBuffer.push_back(0x00); + pkt.outBuffer.push_back(0x08); + pkt.outBuffer.push_back(1); //N_high_cnt + pkt.outBuffer.push_back(1);//N_low_cnt + pkt.outBuffer.push_back(0x00); + pkt.outBuffer.push_back(0x09); + pkt.outBuffer.push_back(chigh); //M_high_cnt + pkt.outBuffer.push_back(clow); //M_low_cnt + for (int i = 0; i <= 1; ++i) + { + pkt.outBuffer.push_back(0x00); + pkt.outBuffer.push_back(0x0A + i); + pkt.outBuffer.push_back(chigh); //cX_high_cnt + pkt.outBuffer.push_back(clow); //cX_low_cnt + } + + pkt.outBuffer.push_back(0x00); + pkt.outBuffer.push_back(0x03); + pkt.outBuffer.push_back(0x00); + pkt.outBuffer.push_back(0x02); + + pkt.outBuffer.push_back(0x00); + pkt.outBuffer.push_back(0x03); + pkt.outBuffer.push_back(0x00); + pkt.outBuffer.push_back(0x00); + + if (serPort->TransferPacket(pkt) != LMScomms::TRANSFER_SUCCESS || pkt.status != STATUS_COMPLETED_CMD) + return FAILURE; + } + else + return FAILURE; + return SUCCESS; +} + +/** @brief Captures IQ samples from Stream board, this is blocking function, it blocks until desired frames count is captured + @param isamples destination array for I samples, must be big enough to contain samplesCount + @param qsamples destination array for Q samples, must be big enough to contain samplesCount + @param framesCount number of IQ frames to capture + @param frameStart frame start indicator 0 or 1 + @return 0-success, other-failure +*/ +LMS_StreamBoard::Status LMS_StreamBoard::CaptureIQSamples(LMScomms *dataPort, int16_t *isamples, int16_t *qsamples, const uint32_t framesCount, const bool frameStart) +{ + assert(dataPort != nullptr); + if (dataPort == NULL) + return FAILURE; + if (dataPort->IsOpen() == false) + return FAILURE; + + int16_t sample_value; + const uint32_t bufSize = framesCount * 2 * sizeof(uint16_t); + char *buffer = new char[bufSize]; + if (buffer == 0) + { +#ifndef NDEBUG + std::cout << "Failed to allocate memory for samples buffer" << std::endl; +#endif + return FAILURE; + } + memset(buffer, 0, bufSize); + + LMScomms::GenericPacket pkt; + pkt.cmd = CMD_BRDSPI_RD; + pkt.outBuffer.push_back(0x00); + pkt.outBuffer.push_back(0x05); + dataPort->TransferPacket(pkt); + if (pkt.status != STATUS_COMPLETED_CMD) + return FAILURE; + + uint16_t regVal = (pkt.inBuffer[2] * 256) + pkt.inBuffer[3]; + pkt.cmd = CMD_BRDSPI_WR; + pkt.outBuffer.clear(); + pkt.outBuffer.push_back(0x00); + pkt.outBuffer.push_back(0x05); + pkt.outBuffer.push_back(0); + pkt.outBuffer.push_back(regVal | 0x4); + dataPort->TransferPacket(pkt); + if (pkt.status != STATUS_COMPLETED_CMD) + return FAILURE; + + int bytesReceived = 0; + for(int i = 0; i<3; ++i) + bytesReceived = dataPort->ReadStream(buffer, bufSize, 5000); + if (bytesReceived > 0) + { + bool iqSelect = false; + int16_t frameCounter = 0; + for (uint32_t b = 0; b < bufSize;) + { + sample_value = buffer[b++] & 0xFF; + sample_value |= (buffer[b++] & 0x0F) << 8; + sample_value = sample_value << 4; //shift left then right to fill sign bits + sample_value = sample_value >> 4; + if (iqSelect == false) + isamples[frameCounter] = sample_value; + else + qsamples[frameCounter] = sample_value; + frameCounter += iqSelect; + iqSelect = !iqSelect; + } + } + pkt.cmd = CMD_BRDSPI_RD; + pkt.outBuffer.clear(); + pkt.outBuffer.push_back(0x00); + pkt.outBuffer.push_back(0x01); + pkt.outBuffer.push_back(0x00); + pkt.outBuffer.push_back(0x05); + dataPort->TransferPacket(pkt); + + regVal = (pkt.inBuffer[2] * 256) + pkt.inBuffer[3]; + pkt.cmd = CMD_BRDSPI_WR; + pkt.outBuffer.clear(); + pkt.outBuffer.push_back(0x00); + pkt.outBuffer.push_back(0x05); + pkt.outBuffer.push_back(0); + pkt.outBuffer.push_back(regVal & ~0x4); + dataPort->TransferPacket(pkt); + + delete[] buffer; + return SUCCESS; +} + +/** @brief Blocking operation to upload IQ samples to Stream board RAM + @param serPort port to use for communication + @param isamples I channel samples + @param qsamples Q channel samples + @param framesCount number of samples in arrays + @return 0-success, other-failure +*/ +LMS_StreamBoard::Status LMS_StreamBoard::UploadIQSamples(LMScomms* serPort, int16_t *isamples, int16_t *qsamples, const uint32_t framesCount) +{ + int bufferSize = framesCount * 2; + uint16_t *buffer = new uint16_t[bufferSize]; + memset(buffer, 0, bufferSize*sizeof(uint16_t)); + int bufPos = 0; + for (unsigned i = 0; i<framesCount; ++i) + { + buffer[bufPos] = (isamples[i] & 0xFFF); + buffer[bufPos + 1] = (qsamples[i] & 0xFFF) | 0x1000; + bufPos += 2; + } + const long outLen = bufPos * 2; + int packetSize = 65536; + int sent = 0; + bool success = true; + + LMScomms::GenericPacket pkt; + pkt.cmd = CMD_BRDSPI_RD; + pkt.outBuffer.push_back(0x00); + pkt.outBuffer.push_back(0x05); + + serPort->TransferPacket(pkt); + pkt.cmd = CMD_BRDSPI_WR; + pkt.outBuffer.clear(); + pkt.outBuffer.push_back(0x00); + pkt.outBuffer.push_back(0x05); + pkt.outBuffer.push_back(pkt.inBuffer[2]); + pkt.outBuffer.push_back(pkt.inBuffer[3] & ~0x7); + serPort->TransferPacket(pkt); + + while (sent<outLen) + { + char *outBuf = (char*)buffer; + const long toSendBytes = outLen - sent > packetSize ? packetSize : outLen - sent; + long toSend = toSendBytes; + int context = serPort->BeginDataSending(&outBuf[sent], toSend); + if (serPort->WaitForSending(context, 5000) == false) + { + success = false; + serPort->FinishDataSending(&outBuf[sent], toSend, context); + break; + } + sent += serPort->FinishDataSending(&outBuf[sent], toSend, context); + } + + pkt.cmd = CMD_BRDSPI_RD; + pkt.outBuffer.push_back(0x00); + pkt.outBuffer.push_back(0x05); + + serPort->TransferPacket(pkt); + pkt.cmd = CMD_BRDSPI_WR; + pkt.outBuffer.clear(); + pkt.outBuffer.push_back(0x00); + pkt.outBuffer.push_back(0x05); + pkt.outBuffer.push_back(pkt.inBuffer[2]); + pkt.outBuffer.push_back(pkt.inBuffer[3] | 0x3); + serPort->TransferPacket(pkt); + return success ? SUCCESS : FAILURE; +} + +LMS_StreamBoard::LMS_StreamBoard(LMScomms* dataPort) +{ + mRxFrameStart.store(true); + mDataPort = dataPort; + mRxFIFO = new LMS_StreamBoard_FIFO<SamplesPacket>(1024*4); + mTxFIFO = new LMS_StreamBoard_FIFO<SamplesPacket>(1024*4); + mStreamRunning.store(false); + mTxCyclicRunning.store(false); +} + +LMS_StreamBoard::~LMS_StreamBoard() +{ + StopReceiving(); + delete mRxFIFO; + delete mTxFIFO; +} + +/** @brief Crates threads for packets receiving, processing and transmitting +*/ +LMS_StreamBoard::Status LMS_StreamBoard::StartReceiving(unsigned int fftSize) +{ + if (mStreamRunning.load() == true) + return FAILURE; + if (mDataPort->IsOpen() == false) + return FAILURE; + mRxFIFO->reset(); + stopRx.store(false); + threadRx = std::thread(ReceivePackets, this); + mStreamRunning.store(true); + return SUCCESS; +} + +/** @brief Stops receiving, processing and transmitting threads +*/ +LMS_StreamBoard::Status LMS_StreamBoard::StopReceiving() +{ + if (mStreamRunning.load() == false) + return FAILURE; + stopTx.store(true); + stopRx.store(true); + threadRx.join(); + mStreamRunning.store(false); + return SUCCESS; +} + +/** @brief Function dedicated for receiving data samples from board +*/ +void LMS_StreamBoard::ReceivePackets(LMS_StreamBoard* pthis) +{ + SamplesPacket pkt; + int samplesCollected = 0; + auto t1 = chrono::high_resolution_clock::now(); + auto t2 = chrono::high_resolution_clock::now(); + + const int buffer_size = 65536;// 4096; + const int buffers_count = 16; // must be power of 2 + const int buffers_count_mask = buffers_count - 1; + int handles[buffers_count]; + memset(handles, 0, sizeof(int)*buffers_count); + char *buffers = NULL; + buffers = new char[buffers_count*buffer_size]; + if (buffers == 0) + { + printf("error allocating buffers\n"); + return; + } + memset(buffers, 0, buffers_count*buffer_size); + + //USB FIFO reset + LMScomms::GenericPacket ctrPkt; + ctrPkt.cmd = CMD_USB_FIFO_RST; + ctrPkt.outBuffer.push_back(0x01); + pthis->mDataPort->TransferPacket(ctrPkt); + ctrPkt.outBuffer[0] = 0x00; + pthis->mDataPort->TransferPacket(ctrPkt); + + uint16_t regVal = pthis->SPI_read(0x0005); + pthis->SPI_write(0x0005, regVal | 0x4); + + for (int i = 0; i<buffers_count; ++i) + handles[i] = pthis->mDataPort->BeginDataReading(&buffers[i*buffer_size], buffer_size); + + int bi = 0; + int packetsReceived = 0; + unsigned long BytesReceived = 0; + int m_bufferFailures = 0; + short sample; + + bool frameStart = pthis->mRxFrameStart.load(); + while (pthis->stopRx.load() == false) + { + if (pthis->mDataPort->WaitForReading(handles[bi], 1000) == false) + ++m_bufferFailures; + + long bytesToRead = buffer_size; + long bytesReceived = pthis->mDataPort->FinishDataReading(&buffers[bi*buffer_size], bytesToRead, handles[bi]); + if (bytesReceived > 0) + { + ++packetsReceived; + BytesReceived += bytesReceived; + char* bufStart = &buffers[bi*buffer_size]; + + for (int p = 0; p < bytesReceived; p+=2) + { + if (samplesCollected == 0) //find frame start + { + int frameStartOffset = FindFrameStart(&bufStart[p], bytesReceived-p, frameStart); + if (frameStartOffset < 0) + break; //frame start was not found, move on to next buffer + p += frameStartOffset; + } + sample = (bufStart[p+1] & 0x0F); + sample = sample << 8; + sample |= (bufStart[p] & 0xFF); + sample = sample << 4; + sample = sample >> 4; + pkt.iqdata[samplesCollected] = sample; + ++samplesCollected; + if (pkt.samplesCount == samplesCollected) + { + samplesCollected = 0; + if (pthis->mRxFIFO->push_back(pkt, 200) == false) + ++m_bufferFailures; + } + } + } + else + { + ++m_bufferFailures; + } + + t2 = chrono::high_resolution_clock::now(); + long timePeriod = std::chrono::duration_cast<std::chrono::milliseconds>(t2 - t1).count(); + if (timePeriod >= 1000) + { + // periodically update frame start, user might change it during operation + frameStart = pthis->mRxFrameStart.load(); + float m_dataRate = 1000.0*BytesReceived / timePeriod; + t1 = t2; + BytesReceived = 0; + LMS_StreamBoard_FIFO<SamplesPacket>::Status rxstats = pthis->mRxFIFO->GetStatus(); + + pthis->mRxDataRate.store(m_dataRate); + pthis->mRxFIFOfilled.store(100.0*rxstats.filledElements / rxstats.maxElements); +#ifndef NDEBUG + printf("Rx: %.1f%% \t rate: %.0f kB/s failures:%i\n", 100.0*rxstats.filledElements / rxstats.maxElements, m_dataRate / 1000.0, m_bufferFailures); +#endif + m_bufferFailures = 0; + } + + // Re-submit this request to keep the queue full + memset(&buffers[bi*buffer_size], 0, buffer_size); + handles[bi] = pthis->mDataPort->BeginDataReading(&buffers[bi*buffer_size], buffer_size); + bi = (bi + 1) & buffers_count_mask; + } + pthis->mDataPort->AbortReading(); + for (int j = 0; j<buffers_count; j++) + { + long bytesToRead = buffer_size; + pthis->mDataPort->WaitForReading(handles[j], 1000); + pthis->mDataPort->FinishDataReading(&buffers[j*buffer_size], bytesToRead, handles[j]); + } + + regVal = pthis->SPI_read(0x0005); + pthis->SPI_write(0x0005, regVal & ~0x4); + + delete[] buffers; +#ifndef NDEBUG + printf("Rx finished\n"); +#endif +} + +/** @brief Function dedicated for transmitting samples to board +*/ +void LMS_StreamBoard::TransmitPackets(LMS_StreamBoard* pthis) +{ + const int packetsToBatch = 16; + const int buffer_size = sizeof(SamplesPacket)*packetsToBatch; + const int buffers_count = 16; // must be power of 2 + const int buffers_count_mask = buffers_count - 1; + int handles[buffers_count]; + memset(handles, 0, sizeof(int)*buffers_count); + char *buffers = NULL; + buffers = new char[buffers_count*buffer_size]; + if (buffers == 0) + { + printf("error allocating buffers\n"); + } + memset(buffers, 0, buffers_count*buffer_size); + bool *bufferUsed = new bool[buffers_count]; + memset(bufferUsed, 0, sizeof(bool)*buffers_count); + + int bi = 0; //buffer index + + SamplesPacket* pkt = new SamplesPacket[packetsToBatch]; + int m_bufferFailures = 0; + long bytesSent = 0; + auto t1 = chrono::high_resolution_clock::now(); + auto t2 = chrono::high_resolution_clock::now(); + long totalBytesSent = 0; + + unsigned long outputCounter = 0; + + while (pthis->stopTx.load() == false) + { + for (int i = 0; i < packetsToBatch; ++i) + { + if (pthis->mTxFIFO->pop_front(&pkt[i], 200) == false) + { + printf("Error popping from TX\n"); + if (pthis->stopTx.load() == false) + break; + continue; + } + } + //wait for desired slot buffer to be transferred + if (bufferUsed[bi]) + { + if (pthis->mDataPort->WaitForSending(handles[bi], 1000) == false) + { + ++m_bufferFailures; + } + // Must always call FinishDataXfer to release memory of contexts[i] + long bytesToSend = buffer_size; + bytesSent = pthis->mDataPort->FinishDataSending(&buffers[bi*buffer_size], bytesToSend, handles[bi]); + if (bytesSent > 0) + totalBytesSent += bytesSent; + else + ++m_bufferFailures; + bufferUsed[bi] = false; + } + + memcpy(&buffers[bi*buffer_size], &pkt[0], sizeof(SamplesPacket)*packetsToBatch); + handles[bi] = pthis->mDataPort->BeginDataSending(&buffers[bi*buffer_size], buffer_size); + bufferUsed[bi] = true; + + t2 = chrono::high_resolution_clock::now(); + long timePeriod = std::chrono::duration_cast<std::chrono::milliseconds>(t2 - t1).count(); + if (timePeriod >= 1000) + { + float m_dataRate = 1000.0*totalBytesSent / timePeriod; + t1 = t2; + totalBytesSent = 0; +#ifndef NDEBUG + cout << "Tx rate: " << m_dataRate / 1000 << " kB/s\t failures: " << m_bufferFailures << endl; +#endif + LMS_StreamBoard_FIFO<SamplesPacket>::Status txstats = pthis->mTxFIFO->GetStatus(); + pthis->mTxDataRate.store(m_dataRate); + pthis->mTxFIFOfilled.store(100.0*txstats.filledElements / txstats.maxElements); + m_bufferFailures = 0; + } + bi = (bi + 1) & buffers_count_mask; + } + + // Wait for all the queued requests to be cancelled + pthis->mDataPort->AbortSending(); + for (int j = 0; j<buffers_count; j++) + { + long bytesToSend = buffer_size; + if (bufferUsed[bi]) + { + pthis->mDataPort->WaitForSending(handles[j], 1000); + pthis->mDataPort->FinishDataSending(&buffers[j*buffer_size], bytesToSend, handles[j]); + } + } + + delete[] buffers; + delete[] bufferUsed; + delete[] pkt; +#ifndef NDEBUG + printf("Tx finished\n"); +#endif +} + +/** @brief Returns current data state for user interface +*/ +LMS_StreamBoard::DataToGUI LMS_StreamBoard::GetIncomingData() +{ + std::unique_lock<std::mutex> lck(mLockIncomingPacket); + return mIncomingPacket; +} + +/** @brief Returns data rate info and Tx Rx FIFO fill percentage +*/ +LMS_StreamBoard::ProgressStats LMS_StreamBoard::GetStats() +{ + ProgressStats stats; + stats.RxRate_Bps = mRxDataRate.load(); + stats.TxRate_Bps = mTxDataRate.load(); + stats.RxFIFOfilled = mRxFIFOfilled.load(); + stats.TxFIFOfilled = mTxFIFOfilled.load(); + return stats; +} + +/** @brief Helper function to write board spi regiters + @param address spi address + @param data register value +*/ +LMS_StreamBoard::Status LMS_StreamBoard::SPI_write(uint16_t address, uint16_t data) +{ + assert(mDataPort != nullptr); + LMScomms::GenericPacket ctrPkt; + ctrPkt.cmd = CMD_BRDSPI_WR; + ctrPkt.outBuffer.push_back((address >> 8) & 0xFF); + ctrPkt.outBuffer.push_back(address & 0xFF); + ctrPkt.outBuffer.push_back((data >> 8) & 0xFF); + ctrPkt.outBuffer.push_back(data & 0xFF); + mDataPort->TransferPacket(ctrPkt); + return ctrPkt.status == 1 ? SUCCESS : FAILURE; +} + +/** @brief Helper function to read board spi registers + @param address spi address + @return register value +*/ +uint16_t LMS_StreamBoard::SPI_read(uint16_t address) +{ + assert(mDataPort != nullptr); + LMScomms::GenericPacket ctrPkt; + ctrPkt.cmd = CMD_BRDSPI_RD; + ctrPkt.outBuffer.push_back((address >> 8) & 0xFF); + ctrPkt.outBuffer.push_back(address & 0xFF); + mDataPort->TransferPacket(ctrPkt); + if (ctrPkt.status == STATUS_COMPLETED_CMD && ctrPkt.inBuffer.size() >= 4) + return ctrPkt.inBuffer[2] * 256 + ctrPkt.inBuffer[3]; + else + return 0; +} + +/** @brief Changes which frame start to look for when receiving data +*/ +void LMS_StreamBoard::SetRxFrameStart(const bool startValue) +{ + mRxFrameStart.store(startValue); +} + +/** @brief Searches for frame start index in given buffer + @return frameStart index in buffer, -1 if frame start was not found + Frame start indicator is 13th bit inside each I and Q sample +*/ +int LMS_StreamBoard::FindFrameStart(const char* buffer, const int bufLen, const bool frameStart) +{ + int startIndex = -1; + for (int i = 0; i < bufLen; i+=2) + if ((buffer[i+1] & 0x10)>0 == frameStart) + { + startIndex = i; + break; + } + return startIndex; +} + +/** @brief Starts a thread for continuous cyclic transmitting of given samples + @param isamples I channel samples + @param qsamples Q channel samples + @param framesCount number of samples in given arrays + @return 0:success, other:failure +*/ +LMS_StreamBoard::Status LMS_StreamBoard::StartCyclicTransmitting(const int16_t* isamples, const int16_t* qsamples, uint32_t framesCount) +{ + if (mDataPort->IsOpen() == false) + return FAILURE; + + stopTxCyclic.store(false); + threadTxCyclic = std::thread([](LMS_StreamBoard* pthis) + { + const int buffer_size = 65536; + const int buffers_count = 16; // must be power of 2 + const int buffers_count_mask = buffers_count - 1; + int handles[buffers_count]; + memset(handles, 0, sizeof(int)*buffers_count); + char *buffers = NULL; + buffers = new char[buffers_count*buffer_size]; + if (buffers == 0) + { + printf("error allocating buffers\n"); + return 0; + } + memset(buffers, 0, buffers_count*buffer_size); + + //timers for data rate calculation + auto t1 = chrono::high_resolution_clock::now(); + auto t2 = chrono::high_resolution_clock::now(); + + int bi = 0; //buffer index + + //setup output data + int dataIndex = 0; + for (int i = 0; i < buffers_count; ++i) + { + for (int j = 0; j < buffer_size; ++j) + { + buffers[i*buffer_size + j] = pthis->mCyclicTransmittingSourceData[dataIndex]; + ++dataIndex; + if (dataIndex > pthis->mCyclicTransmittingSourceData.size()) + dataIndex = 0; + } + } + + for (int i = 0; i < buffers_count; ++i) + handles[i] = pthis->mDataPort->BeginDataSending(&buffers[i*buffer_size], buffer_size); + + int m_bufferFailures = 0; + int bytesSent = 0; + int totalBytesSent = 0; + int sleepTime = 200; + while (pthis->stopTxCyclic.load() != true) + { + if (pthis->mDataPort->WaitForSending(handles[bi], 1000) == false) + { + ++m_bufferFailures; + } + long bytesToSend = buffer_size; + bytesSent = pthis->mDataPort->FinishDataSending(&buffers[bi*buffer_size], bytesToSend, handles[bi]); + if (bytesSent > 0) + totalBytesSent += bytesSent; + else + { + ++m_bufferFailures; + } + + t2 = chrono::high_resolution_clock::now(); + long timePeriod = std::chrono::duration_cast<std::chrono::milliseconds>(t2 - t1).count(); + if (timePeriod >= 1000) + { + pthis->mTxDataRate.store(1000.0*totalBytesSent / timePeriod); + t1 = t2; + totalBytesSent = 0; +#ifndef NDEBUG + printf("Upload rate: %f\t failures:%li\n", 1000.0*totalBytesSent / timePeriod, m_bufferFailures); +#endif + m_bufferFailures = 0; + } + + //fill up next buffer + for (int j = 0; j < buffer_size; ++j) + { + buffers[bi*buffer_size + j] = pthis->mCyclicTransmittingSourceData[dataIndex]; + ++dataIndex; + if (dataIndex >= pthis->mCyclicTransmittingSourceData.size()) + dataIndex = 0; + } + + // Re-submit this request to keep the queue full + handles[bi] = pthis->mDataPort->BeginDataSending(&buffers[bi*buffer_size], buffer_size); + bi = (bi + 1) & buffers_count_mask; + } + + // Wait for all the queued requests to be cancelled + pthis->mDataPort->AbortSending(); + for (int j = 0; j < buffers_count; j++) + { + long bytesToSend = buffer_size; + pthis->mDataPort->WaitForSending(handles[j], 1000); + pthis->mDataPort->FinishDataSending(&buffers[j*buffer_size], bytesToSend, handles[j]); + } +#ifndef NDEBUG + printf("Cyclic transmitting FULLY STOPPED\n"); +#endif + delete[] buffers; + return 0; + }, this); + mTxCyclicRunning.store(true); + + return LMS_StreamBoard::SUCCESS; +} + +/** @brief Stops cyclic transmitting thread +*/ +LMS_StreamBoard::Status LMS_StreamBoard::StopCyclicTransmitting() +{ + stopTxCyclic.store(true); + if (mTxCyclicRunning.load() == true) + { + threadTxCyclic.join(); + mTxCyclicRunning.store(false); + } + return LMS_StreamBoard::SUCCESS; +} diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/LMS_StreamBoard/LMS_StreamBoard.h b/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/LMS_StreamBoard/LMS_StreamBoard.h new file mode 100644 index 0000000000000000000000000000000000000000..99b363633607c8fb7d8b88c316bb1c44cfd68da8 --- /dev/null +++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/LMS_StreamBoard/LMS_StreamBoard.h @@ -0,0 +1,107 @@ +#ifndef STREAM_BOARD_API_H +#define STREAM_BOARD_API_H + +#include <stdint.h> +#include <mutex> +#include <atomic> +#include <thread> +#include "LMS_StreamBoard_FIFO.h" + +class LMScomms; + +class LMS_StreamBoard +{ +public: + struct SamplesPacket + { + public: + SamplesPacket() : channel(0) + {} + ~SamplesPacket() + {} + + SamplesPacket& operator=(const SamplesPacket& obj) + { + memcpy(this->iqdata, obj.iqdata, sizeof(float)*samplesCount); + this->channel = obj.channel; + return *this; + } + const static int samplesCount = 32768; + float iqdata[samplesCount]; + int channel; + }; + + + enum Status + { + SUCCESS, + FAILURE, + }; + + static Status CaptureIQSamples(LMScomms* serPort, int16_t *isamples, int16_t *qsamples, uint32_t framesCount, bool frameStart); + static Status UploadIQSamples(LMScomms* serPort, int16_t *isamples, int16_t *qsamples, uint32_t framesCount); + static Status ConfigurePLL(LMScomms *serPort, const float fOutTx_MHz, const float fOutRx_MHz, const float phaseShift_deg); + + struct DataToGUI + { + std::vector<double> samplesI; + std::vector<double> samplesQ; + std::vector<double> fftBins_dbFS; + float nyquist_MHz; + }; + + struct ProgressStats + { + float RxRate_Bps; + float TxRate_Bps; + float RxFIFOfilled; + float TxFIFOfilled; + }; + + LMS_StreamBoard(LMScomms* dataPort); + virtual ~LMS_StreamBoard(); + + void SetRxFrameStart(const bool startValue); + virtual Status StartReceiving(unsigned int fftSize); + virtual Status StopReceiving(); + + virtual Status StartCyclicTransmitting(const int16_t* isamples, const int16_t* qsamples, uint32_t framesCount); + virtual Status StopCyclicTransmitting(); + + DataToGUI GetIncomingData(); + ProgressStats GetStats(); + + Status SPI_write(uint16_t address, uint16_t data); + uint16_t SPI_read(uint16_t address); +protected: + static int FindFrameStart(const char* buffer, const int bufLen, const bool frameStart); + std::mutex mLockIncomingPacket; + DataToGUI mIncomingPacket; + + LMS_StreamBoard_FIFO<SamplesPacket> *mRxFIFO; + LMS_StreamBoard_FIFO<SamplesPacket> *mTxFIFO; + + static void ReceivePackets(LMS_StreamBoard* pthis); + static void TransmitPackets(LMS_StreamBoard* pthis); + + std::atomic_bool mRxFrameStart; + std::atomic_bool mStreamRunning; + std::atomic_bool stopRx; + std::atomic_bool stopTx; + + std::thread threadRx; + std::thread threadTx; + LMScomms* mDataPort; + + std::atomic<unsigned long> mRxDataRate; + std::atomic<unsigned long> mTxDataRate; + std::atomic<int> mRxFIFOfilled; + std::atomic<int> mTxFIFOfilled; + + std::vector<int16_t> mCyclicTransmittingSourceData; + std::atomic_bool mTxCyclicRunning; + std::thread threadTxCyclic; + std::atomic_bool stopTxCyclic; +}; +#endif + diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/LMS_StreamBoard/LMS_StreamBoard_FIFO.h b/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/LMS_StreamBoard/LMS_StreamBoard_FIFO.h new file mode 100644 index 0000000000000000000000000000000000000000..833f7a37c008c63123ca4774e8477b78037ca8a8 --- /dev/null +++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/LMS_StreamBoard/LMS_StreamBoard_FIFO.h @@ -0,0 +1,122 @@ +/** +@file LMS_StreamBoard_FIFO.h +@author Lime Microsystems (www.limemicro.com) +@brief blocking FIFO for packets storing +*/ + +#ifndef LMS_STREAMBOARD_FIFO_H +#define LMS_STREAMBOARD_FIFO_H + +#include <string.h> +#include <stdio.h> +#include <assert.h> +#include <vector> +#include <mutex> +#include <chrono> +#include <condition_variable> + +template<class T> +class LMS_StreamBoard_FIFO +{ +private: + LMS_StreamBoard_FIFO(){}; +public: + struct Status + { + uint32_t maxElements; + uint32_t filledElements; + uint32_t head; + uint32_t tail; + }; + + LMS_StreamBoard_FIFO(uint64_t FIFO_length) + { + mHead = 0; + mTail = 0; + mElements.resize(FIFO_length); + mElementsFilled = 0; + } + + ~LMS_StreamBoard_FIFO() + { + + } + + /** @brief Copies given src element to queue. + @param src Source data + @return true if element was inserted + + Copies element to queue. This function blocks until element is copied to + queue or certain amount of time has passed. + */ + bool push_back(const T &src, unsigned int timeout_ms = 200) + { + std::unique_lock<std::mutex> lck(mElementsLock); + while (mElementsFilled == mElements.size()) + { + if (canWrite.wait_for(lck, std::chrono::milliseconds(timeout_ms)) == std::cv_status::timeout) + return false; + } + memcpy(&mElements[mTail], &src, sizeof(T)); + mTail = (mTail+1) % mElements.size(); + ++mElementsFilled; + canRead.notify_one(); + return true; + } + + /** @brief Copies and removes first element from queue to dest. + @param dest destination container for data + @return true if element was copied + Copies element from queue to destination and then removes it. + This function blocks until element is returned, or certain amount of time + has passed. + */ + bool pop_front(T *dest, unsigned int timeout_ms = 200) + { + assert(dest != nullptr); + std::unique_lock<std::mutex> lck(mElementsLock); + while (mElementsFilled == 0) + { + if (canRead.wait_for(lck, std::chrono::milliseconds(timeout_ms)) == std::cv_status::timeout) + return false; + } + if (mElementsFilled == 0) + return false; + *dest = mElements[mHead]; + memcpy(dest, &mElements[mHead], sizeof(T)); + mHead = (mHead + 1) % mElements.size(); + --mElementsFilled; + canWrite.notify_one(); + return true; + } + void reset() + { + std::unique_lock<std::mutex> lck(mElementsLock); + mElementsFilled = 0; + mHead = 0; + mTail = 0; + } + + Status GetStatus() + { + Status stats; + std::unique_lock<std::mutex> lck(mElementsLock); + stats.maxElements = mElements.size(); + stats.filledElements = mElementsFilled; + stats.head = mHead; + stats.tail = mTail; + return stats; + }; + +protected: + uint32_t mHead; //reading pos + uint32_t mTail; //writing pos + uint32_t mElementsFilled; + + std::mutex mElementsLock; // condition variable for critical section + std::vector<T> mElements; + std::condition_variable canWrite; + std::condition_variable canRead; +}; + +#endif // LMS_STREAMBOARD_FIFO_H diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/LMS_StreamBoard/lms7002_defines.h b/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/LMS_StreamBoard/lms7002_defines.h new file mode 100644 index 0000000000000000000000000000000000000000..c098dfe9657d2e80be7ad38599124090ed96cfae --- /dev/null +++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/LMS_StreamBoard/lms7002_defines.h @@ -0,0 +1,215 @@ +/** +@file lms7002_defines.h +@author Lime Microsystems +@brief enumerations of available LMS7002M commands and statuses +*/ +#pragma once + +const int LMS_RST_DEACTIVATE = 0; +const int LMS_RST_ACTIVATE = 1; +const int LMS_RST_PULSE = 2; + +enum eLMS_DEV +{ + LMS_DEV_UNKNOWN, + LMS_DEV_EVB6, + LMS_DEV_DIGIGREEN, + LMS_DEV_DIGIRED, + LMS_DEV_EVB7, + LMS_DEV_ZIPPER, + LMS_DEV_SOCKETBOARD, + LMS_DEV_EVB7V2, + LMS_DEV_STREAM, + LMS_DEV_NOVENA, + LMS_DEV_DATASPARK, + LMS_DEV_RFSPARK, + LMS_DEV_LMS6002USB, + LMS_DEV_RFESPARK, + + LMS_DEV_COUNT +}; + +const char LMS_DEV_NAMES[][80] = +{ + "UNKNOWN", + "EVB6", + "DigiGreen", + "DigiRed", + "EVB7", + "ZIPPER", + "Socket Board", + "EVB7_v2", + "Stream", + "Novena", + "DataSpark", + "RF-Spark", + "LMS6002-USB Stick", + "RF-ESpark" +}; + +static const char* GetDeviceName(const eLMS_DEV device) +{ + if (LMS_DEV_UNKNOWN < device && device < LMS_DEV_COUNT) + return LMS_DEV_NAMES[device]; + else + return LMS_DEV_NAMES[LMS_DEV_UNKNOWN]; +} + +enum eEXP_BOARD +{ + EXP_BOARD_UNKNOWN, + EXP_BOARD_UNSUPPORTED, + EXP_BOARD_NO, + EXP_BOARD_MYRIAD1, + EXP_BOARD_MYRIAD2, + EXP_BOARD_MYRIAD_NOVENA, + EXP_BOARD_HPM1000, + EXP_BOARD_MYRIAD7, + EXP_BOARD_HPM7, + + EXP_BOARD_COUNT +}; + +const char EXP_BOARD_NAMES[][80] = +{ + "UNKNOWN", + "UNSUPPORTED", + "NOT AVAILABLE", + "Myriad1", + "Myriad2", + "Novena", + "HPM1000", + "Myriad7", + "HMP7" +}; + +static const char* GetExpansionBoardName(const eEXP_BOARD board) +{ + if (EXP_BOARD_UNKNOWN < board && board < EXP_BOARD_COUNT) + return EXP_BOARD_NAMES[board]; + else + return EXP_BOARD_NAMES[EXP_BOARD_UNKNOWN]; +} + +struct LMS64C_Info +{ + unsigned char firmware; + unsigned char deviceType; + unsigned char protocol; + unsigned char hardware; + unsigned char expansionBoard; +}; + +enum eCMD_LMS +{ + CMD_GET_INFO = 0x00, + CMD_LMS6002_RST = 0x10, + ///Writes data to SI5356 synthesizer via I2C + CMD_SI5356_WR = 0x11, + ///Reads data from SI5356 synthesizer via I2C + CMD_SI5356_RD = 0x12, + ///Writes data to SI5351 synthesizer via I2C + CMD_SI5351_WR = 0x13, + ///Reads data from SI5351 synthesizer via I2C + CMD_SI5351_RD = 0x14, + ///PanelBus DVI (HDMI) Transmitter control + CMD_TFP410_WR = 0x15, + ///PanelBus DVI (HDMI) Transmitter control + CMD_TFP410_RD = 0x16, + ///Sets new LMS7002M chip’s RESET pin level (0, 1, pulse) + CMD_LMS7002_RST = 0x20, + ///Writes data to LMS7002M chip via SPI + CMD_LMS7002_WR = 0x21, + ///Reads data from LMS7002M chip via SPI + CMD_LMS7002_RD = 0x22, + ///Writes data to LMS6002 chip via SPI + CMD_LMS6002_WR = 0x23, + ///Reads data from LMS6002 chip via SPI + CMD_LMS6002_RD = 0x24, + + CMD_LMS_LNA = 0x2A, + CMD_LMS_PA = 0x2B, + + CMD_PROG_MCU = 0x2C, + ///Writes data to ADF4002 chip via SPI + CMD_ADF4002_WR = 0x31, + + CMD_USB_FIFO_RST = 0x40, + CMD_PE636040_WR = 0x41, + CMD_PE636040_RD = 0x42, + + CMD_GPIO_WR = 0x51, + CMD_GPIO_RD = 0x52, + + CMD_ALTERA_FPGA_GW_WR = 0x53, + CMD_ALTERA_FPGA_GW_RD = 0x54, + + CMD_BRDSPI_WR = 0x55,//16 bit spi for stream, dataspark control + CMD_BRDSPI_RD = 0x56,//16 bit spi for stream, dataspark control + CMD_BRDSPI8_WR = 0x57, //8 + 8 bit spi for stream, dataspark control + CMD_BRDSPI8_RD = 0x58, //8 + 8 bit spi for stream, dataspark control + + CMD_BRDCONF_WR = 0x5D, //write config data to board + CMD_BRDCONF_RD = 0x5E, //read config data from board + + CMD_ANALOG_VAL_WR = 0x61, //write analog value + CMD_ANALOG_VAL_RD = 0x62, //read analog value + + CMD_MYRIAD_RST = 0x80, + CMD_MYRIAD_WR = 0x81, + CMD_MYRIAD_RD = 0x82, + CMD_MYRIAD_PROG = 0x8C +}; + +enum eCMD_STATUS +{ + STATUS_UNDEFINED, + STATUS_COMPLETED_CMD, + STATUS_UNKNOWN_CMD, + STATUS_BUSY_CMD, + STATUS_MANY_BLOCKS_CMD, + STATUS_ERROR_CMD, + STATUS_WRONG_ORDER_CMD, + STATUS_RESOURCE_DENIED_CMD, + STATUS_COUNT +}; + +static const char status_text[][32]= +{ + "Undefined/Failure", + "Completed", + "Unknown command", + "Busy", + "Too many blocks", + "Error", + "Wrong order", + "Resource denied" +}; + +static const char* status2string(const int status) +{ + if(status >= 0 && status < STATUS_COUNT) + return status_text[status]; + else + return "Unknown status"; +} + +enum eADC_UNITS +{ + RAW, + VOLTAGE, + CURRENT, + RESISTANCE, + POWER, + ADC_UNITS_COUNT +}; + +static const char adc_units_text[][8] = {"", "V", "A", "Ohm", "W"}; + +static const char* adcUnits2string(const unsigned units) +{ + if (units < ADC_UNITS_COUNT) + return adc_units_text[units]; + else + return " unknown"; +} diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/connectionManager/CMakeLists.txt b/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/connectionManager/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..d9124aaef13d009fedc0b4fb5dc7b1998701fde2 --- /dev/null +++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/connectionManager/CMakeLists.txt @@ -0,0 +1,34 @@ +set(ENABLE_USB_CONNECTION "YES" CACHE BOOL INTERNAL) +set(ENABLE_SPI_CONNECTION "NO" CACHE BOOL INTERNAL) +set(CONNECTION_MANAGER_DIR connectionManager) +set(connectionManager_src_files + ConnectionManager.cpp + ConnectionCOM.cpp + ConnectionManager.h + ConnectionCOM.h + lmsComms.h + lmsComms.cpp +) +if(ENABLE_USB_CONNECTION) + list(APPEND connectionManager_src_files ConnectionUSB.cpp ConnectionUSB.h) + add_definitions(-DENABLE_USB_CONNECTION) +endif() +if(ENABLE_SPI_CONNECTION) + list(APPEND connectionManager_src_files ConnectionSPI.cpp ConnectionSPI.h) + add_definitions(-DENABLE_SPI_CONNECTION) +endif() + +add_library(ConnectionManager STATIC ${connectionManager_src_files}) +target_include_directories(ConnectionManager PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) + +if(WIN32 AND ENABLE_USB_CONNECTION) + find_package(CyAPI REQUIRED) + LINK_DIRECTORIES(${CYAPI_LIBRARIES}) + include_directories(${CYAPI_INCLUDE_DIRS}) + set(CONNECTION_MANAGER_LIBS ${CYAPI_LIBRARIES} SetupAPI) + target_link_libraries(ConnectionManager ${CONNECTION_MANAGER_LIBS}) +endif() +if(UNIX AND ENABLE_USB_CONNECTION) + set(CONNECTION_MANAGER_LIBS usb-1.0 -lpthread) + target_link_libraries(ConnectionManager ${CONNECTION_MANAGER_LIBS}) +endif() diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/connectionManager/ConnectionCOM.cpp b/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/connectionManager/ConnectionCOM.cpp new file mode 100644 index 0000000000000000000000000000000000000000..6c7fc0d8290d5c26a8ae575fbcc98b4058cae124 --- /dev/null +++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/connectionManager/ConnectionCOM.cpp @@ -0,0 +1,596 @@ +/** + @file ConnectionCOM.cpp + @author Lime Microsystems (www.limemicro.com) + @brief Implementation of communications through COM port +*/ + +#include "ConnectionCOM.h" + +#include "string.h" +#ifdef __unix__ +#include <fstream> +#include <errno.h> +#include <unistd.h> +#include <termios.h> +#include <sys/types.h> +#include <sys/stat.h> +#include <fcntl.h> +#include <stdlib.h> +#include <iostream> +#include <stdio.h> +#endif // LINUX + +const int COM_RETRY_INTERVAL = 20; //ms +const int COM_TOTAL_TIMEOUT = 300; //ms + +/** @brief Initializes com port connection +*/ +ConnectionCOM::ConnectionCOM() +{ + currentDeviceIndex = -1; + connected = false; + comPortList.clear(); + m_deviceNames.clear(); + m_connectionType = COM_PORT; +#ifndef __unix__ + hComm = INVALID_HANDLE_VALUE; +#else + hComm = -1; +#endif + comBaudrate = 9600; +} + +/** @brief When object is destroyed it closes it's opened COM port +*/ +ConnectionCOM::~ConnectionCOM() +{ + Close(); +} + +/** @brief Opens connection to first found chip + @return 0-success +*/ +IConnection::DeviceStatus ConnectionCOM::Open() +{ + comPortList.clear(); + if(comPortList.size() == 0) + FindAllComPorts(); + + m_deviceNames.clear(); + if(m_deviceNames.size() == 0) + RefreshDeviceList(); + + for(unsigned int i=0; i<m_deviceNames.size(); i++) + { + if( Open(i) == SUCCESS) + { + currentDeviceIndex = i; + return SUCCESS; + } + } + return FAILURE; +} + +/** @brief Opens connection to selected chip + @param index chip index in device list + @return 0-success +*/ +IConnection::DeviceStatus ConnectionCOM::Open(unsigned index) +{ + unsigned int toOpen = index; + Close(); + if(toOpen < m_deviceNames.size() && m_deviceNames.size() > 0 ) + { + comPortName = m_deviceNames[toOpen]; + IConnection::DeviceStatus status = Open(comPortName.c_str(), comBaudrate); + if( status == SUCCESS ) + currentDeviceIndex = toOpen; + return status; + } + return FAILURE; +} + +/** @brief Closes connection to chip +*/ +void ConnectionCOM::Close() +{ + connected = false; + currentDeviceIndex = -1; +#ifndef __unix__ + if (hComm != INVALID_HANDLE_VALUE) + { + SetCommTimeouts(hComm, &m_ctmoOld); + CloseHandle(hComm); + } + hComm = INVALID_HANDLE_VALUE; +#else + if( hComm >= 0) + { + close(hComm); + } + hComm = -1; +#endif +} + +/** @brief Returns whether chip is connected + @return chip is connected +*/ +bool ConnectionCOM::IsOpen() +{ +#ifndef __unix__ + if (hComm != INVALID_HANDLE_VALUE && TestConnectivity() ) + return true; +#else + if( hComm != -1 && TestConnectivity() ) + return true; +#endif + return false; +} + +int ConnectionCOM::GetOpenedIndex() +{ + return currentDeviceIndex; +} + +/** @brief Sends data through COM port + @param buffer data buffer to send + @param length size of data buffer + @param timeout_ms timeout limit for operation in milliseconds + @return Number of bytes sent +*/ +int ConnectionCOM::Write(const unsigned char *buffer, int length, int timeout_ms) +{ + if(timeout_ms == 0) + { + timeout_ms = COM_TOTAL_TIMEOUT; + } + int retryCount = 0; + const int maxRetries = (timeout_ms/COM_RETRY_INTERVAL) > 1 ? (timeout_ms/COM_RETRY_INTERVAL) : 1; + bool status = false; +#ifndef __unix__ + unsigned long bytesWriten = 0; + m_osWOverlap.InternalHigh = 0; + + for(int i = 0; i<maxRetries && status == false; ++i) + { + if (!WriteFile(hComm, buffer, length , &bytesWriten, NULL)) + { + status = false; + } + else + status = true; + ++retryCount; + } +#else + long bytesWriten = 0; + for(int i = 0; i<maxRetries && bytesWriten == 0; ++i) + { + bytesWriten = write(hComm, buffer, length); + if(bytesWriten <= 0) + { +// if(bytesWriten < 0) +// MessageLog::getInstance()->write("COM PORT: error writing data\n", LOG_ERROR); +// if(bytesWriten == 0) +// MessageLog::getInstance()->write("COM PORT: data bytes sent 0\n", LOG_WARNING); + status = false; + } + else + status = true; + ++retryCount; + } +#endif + if(bytesWriten == length) + status = true; + + return bytesWriten; +} + +/** @brief Reads data from COM port + @param buffer pointer to data buffer for receiving + @param length number of bytes to read + @param timeout_ms timeout limit for operation in milliseconds + @return Number of bytes received +*/ +int ConnectionCOM::Read(unsigned char *buffer, int length, int timeout_ms) +{ + if(timeout_ms == 0) + { + timeout_ms = COM_TOTAL_TIMEOUT; + } + int retryCount = 0; + const int maxRetries = (timeout_ms/COM_RETRY_INTERVAL) > 1 ? (timeout_ms/COM_RETRY_INTERVAL) : 1; + bool status = false; + + memset(buffer, 0, length); + long bytesReaded = 0; + unsigned long totalBytesReaded = 0; + char cRawData[COM_BUFFER_LENGTH]; + unsigned long bytesToRead = length; + + memset(cRawData, '\0', sizeof(cRawData[0])*COM_BUFFER_LENGTH); + + for(int i=0; i<maxRetries && status == false; ++i) + { + memset(cRawData, '\0', sizeof(cRawData[0])*COM_BUFFER_LENGTH); +#ifndef __unix__ + + DWORD bytesReceived = 0; + if ( !ReadFile(hComm, cRawData, bytesToRead, &bytesReceived, NULL) ) + { + status = false; + } + + bytesReaded = bytesReceived; +#else + bytesReaded = read(hComm, cRawData, bytesToRead); + if(bytesReaded <= 0) + { +// if(bytesReaded < 0) +// MessageLog::getInstance()->write("COM PORT: error reading data\n", LOG_ERROR); +// if(bytesReaded == 0) +// MessageLog::getInstance()->write("COM PORT: reading 0 bytes\n", LOG_WARNING); + status = false; + } +#endif + retryCount++; + + for(int j=0; j<bytesReaded; ++j) + { + buffer[totalBytesReaded+j] = cRawData[j]; + } + + totalBytesReaded += bytesReaded; + if(totalBytesReaded == bytesToRead) + status = true; + } + +// ss << " read(" << totalBytesReaded << "): "; +// for(unsigned int i=0; i<64; ++i) +// ss << int2hex(buffer[i], 1) << " "; +// ss << " - retries: " << retryCount-1 << endl; + //MessageLog::getInstance()->write(ss.str(), LOG_DATA); + +// if(retryCount == maxRetries) +// MessageLog::getInstance()->write("COM PORT: read data timeout\n", LOG_WARNING); +// +// if(totalBytesReaded > length) +// MessageLog::getInstance()->write("COM PORT: read data corrupted, received length > requested length\n", LOG_ERROR); + return totalBytesReaded; +} + +/** @brief Searches for available COM ports and adds them to list +*/ +void ConnectionCOM::FindAllComPorts() +{ + Close(); + comPortList.clear(); +#ifndef __unix__ + HKEY hSERIALCOMM; + if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, TEXT("HARDWARE\\DEVICEMAP\\SERIALCOMM"), 0, KEY_QUERY_VALUE, &hSERIALCOMM) == ERROR_SUCCESS) + { + // Get the max value name and max value lengths + DWORD dwMaxValueNameLen; + DWORD dwMaxValueLen; + DWORD dwQueryInfo = RegQueryInfoKey(hSERIALCOMM, NULL, NULL, NULL, NULL, NULL, NULL, NULL, &dwMaxValueNameLen, &dwMaxValueLen, NULL, NULL); + if (dwQueryInfo == ERROR_SUCCESS) + { + DWORD dwMaxValueNameSizeInChars = dwMaxValueNameLen + 1; + // Include space for the NULL terminator + DWORD dwMaxValueNameSizeInBytes = dwMaxValueNameSizeInChars*sizeof(TCHAR); + DWORD dwMaxValueDataSizeInChars = dwMaxValueLen / sizeof(TCHAR) + 1; + // Include space for the NULL terminator + DWORD dwMaxValueDataSizeInBytes = dwMaxValueDataSizeInChars*sizeof(TCHAR); + + // Allocate some space for the value name and value data + TCHAR* szValueName = new TCHAR[dwMaxValueNameSizeInChars]; + TCHAR* byValue = new TCHAR[dwMaxValueDataSizeInBytes]; + if (szValueName && byValue) + { + // Enumerate all the values underneath HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM + DWORD dwIndex = 0; + DWORD dwType; + DWORD dwValueNameSize = dwMaxValueNameSizeInChars; + DWORD dwDataSize = dwMaxValueDataSizeInBytes; + memset(szValueName, 0, dwMaxValueNameSizeInBytes); + memset(byValue, 0, dwMaxValueDataSizeInBytes); + LONG nEnum = RegEnumValue(hSERIALCOMM, dwIndex, szValueName, &dwValueNameSize, NULL, &dwType, (LPBYTE)byValue, &dwDataSize); + while (nEnum == ERROR_SUCCESS) + { + // If the value is of the correct type, then add it to the array + if (dwType == REG_SZ) + { + char portname[512]; + TCHAR* szPort = byValue; + int nUserNameLenUnicode = lstrlen( szPort ); // Convert all UNICODE characters + int nUserNameLen = WideCharToMultiByte( CP_ACP, // ANSI Code Page + 0, // No special handling of unmapped chars + (LPCWSTR)szPort, // wide-character string to be converted + nUserNameLenUnicode, + NULL, 0, // No output buffer since we are calculating length + NULL, NULL ); // Unrepresented char replacement - Use Default + TCHAR* pszUserName = new TCHAR[ nUserNameLen ]; // nUserNameLen includes the NULL character + WideCharToMultiByte( CP_ACP, // ANSI Code Page + 0, // No special handling of unmapped chars + (LPCWSTR)szPort, // wide-character string to be converted + nUserNameLenUnicode, + portname, + nUserNameLen, + NULL, NULL ); // Unrepresented char replacement - Use Default + portname[nUserNameLen] = 0; +#ifdef UNICODE + comPortList.push_back(portname); +#else + comPortList.push_back(szPort); +#endif + } + // Prepare for the next time around + dwValueNameSize = dwMaxValueNameSizeInChars; + dwDataSize = dwMaxValueDataSizeInBytes; + memset(szValueName, 0, dwMaxValueNameSizeInBytes); + memset(byValue, 0, dwMaxValueDataSizeInBytes); + ++dwIndex; + nEnum = RegEnumValue(hSERIALCOMM, dwIndex, szValueName, &dwValueNameSize, NULL, &dwType, (LPBYTE)byValue, &dwDataSize); + } + } + delete szValueName; + delete byValue; + } + // Close the registry key now that we are finished with it + RegCloseKey(hSERIALCOMM); + + if (dwQueryInfo != ERROR_SUCCESS) + SetLastError(dwQueryInfo); + } +#else + char tempBuffer[256]; + string result = ""; +#warning Currently searching only for ACM connections + system( "ls /dev | grep ttyACM > /tmp/foundSerialPorts.txt"); + + fstream fin; + fin.open("/tmp/foundSerialPorts.txt", ios::in); + while(!fin.eof()) + { + fin.getline(tempBuffer, 256); + result = "/dev/"; + result.append(tempBuffer); + if( strlen(tempBuffer) > 3 ) //longer than tty + comPortList.push_back(result); + } + fin.close(); +#endif +} + +/** @brief Opens COM port + @param comName COM port name + @param baudrate COM port baudrate + @return 0 on success +*/ +IConnection::DeviceStatus ConnectionCOM::Open(const char *comName, int baudrate) +{ + Close(); + if (strlen(comName) == 0) + return FAILURE; + + DeviceStatus errorCode = SUCCESS; + +#ifndef __unix__ + // Initialize Overlap structures + m_osROverlap.Internal = 0; + m_osROverlap.InternalHigh = 0; + m_osROverlap.Offset = 0; + m_osROverlap.OffsetHigh = 0; + m_osROverlap.hEvent = CreateEvent(NULL, false, false, NULL); + + m_osWOverlap.Internal = 0; + m_osWOverlap.InternalHigh = 0; + m_osWOverlap.Offset = 0; + m_osWOverlap.OffsetHigh = 0; + m_osWOverlap.hEvent = CreateEvent(NULL, false, false, NULL); + + // Initialize DSB structure + memset(&m_dcbCommPort, 0, sizeof(m_dcbCommPort)); + + m_dcbCommPort.BaudRate = comBaudrate; + m_dcbCommPort.fBinary = 1; + m_dcbCommPort.fParity = 0; + m_dcbCommPort.fOutxCtsFlow = 0; + m_dcbCommPort.fOutxDsrFlow = 0; + m_dcbCommPort.fDtrControl = 0; + m_dcbCommPort.fDsrSensitivity = 0; + m_dcbCommPort.fTXContinueOnXoff = 0; + m_dcbCommPort.fOutX = 0; + m_dcbCommPort.fInX = 0; + m_dcbCommPort.fErrorChar = 0; + m_dcbCommPort.fNull = 0; + m_dcbCommPort.fRtsControl = 0; + m_dcbCommPort.fAbortOnError = 0; + m_dcbCommPort.fDummy2 = 0; + // m_dcbCommPort.wReserved = 0; + m_dcbCommPort.XonLim = 512; + m_dcbCommPort.XoffLim = 512; + m_dcbCommPort.ByteSize = 8; + m_dcbCommPort.Parity = 0; + m_dcbCommPort.StopBits = 0; + //m_dcbCommPort.StopBits = 1; + m_dcbCommPort.XonChar = 17; + m_dcbCommPort.XoffChar = 19; + m_dcbCommPort.ErrorChar = 0; + m_dcbCommPort.EofChar = 26; + m_dcbCommPort.EvtChar = 0; + m_dcbCommPort.wReserved1 = 0; + m_dcbCommPort.DCBlength = sizeof(DCB); + + // Initialize Timeout's + m_ctmoNew.ReadIntervalTimeout = 50; + m_ctmoNew.ReadTotalTimeoutMultiplier = 0; + m_ctmoNew.ReadTotalTimeoutConstant = 100; // 1; + m_ctmoNew.WriteTotalTimeoutMultiplier = 0; + m_ctmoNew.WriteTotalTimeoutConstant = 100; + + // Open COM port + string stmp; + stmp = "\\\\.\\"; + stmp.append(comName); + hComm = CreateFileA(stmp.c_str(), GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0); + + if (hComm != INVALID_HANDLE_VALUE) + { + // Set Events + if (!SetCommMask(hComm, 0)) + errorCode = FAILURE; + + // Set Timeouts + GetCommTimeouts(hComm, &m_ctmoOld); + if (!SetCommTimeouts(hComm, &m_ctmoNew)) + errorCode = FAILURE; + + // Set DCB + if (!SetCommState(hComm, &m_dcbCommPort)) + errorCode = FAILURE; + } + else + { + errorCode = FAILURE; + }; + + // Check the results + if (errorCode != 0) + { + //unsigned long err = GetLastError(); + CloseHandle(hComm); + hComm = INVALID_HANDLE_VALUE; + return errorCode; + } + else + { + PurgeComm(hComm, PURGE_TXCLEAR | PURGE_RXCLEAR); + return SUCCESS; + } +#else + hComm = open(comName, O_RDWR | O_NOCTTY | O_SYNC); + if(hComm < 0) + { +// printf("%s",strerror(errno)); +// MessageLog::getInstance()->write("Connection manager: failed opening COM port\n", LOG_ERROR); + return FAILURE; + } + + struct termios tty; + memset(&tty, 0, sizeof(tty)); + if( tcgetattr(hComm, &tty) != 0) + { +// MessageLog::getInstance()->write("Connection Manager: error from tcgetattr\n", LOG_ERROR); + return FAILURE; + } + int speed = B9600; + cfsetospeed(&tty, speed); + cfsetispeed(&tty, speed); + + tty.c_cflag = (tty.c_cflag & ~CSIZE) | CS8; + tty.c_iflag &= ~IGNBRK; + tty.c_lflag = 0; + tty.c_oflag = 0; + tty.c_cc[VMIN] = 0; // read non blocking + tty.c_cc[VTIME] = 5; // 0.5 seconds read timeout + + tty.c_iflag &= ~(IXON | IXOFF | IXANY); + tty.c_cflag |= (CLOCAL | CREAD); + + if(tcsetattr(hComm, TCSANOW, &tty) != 0) + { +// MessageLog::getInstance()->write("Connection manager: error from tcsetattr\n", LOG_ERROR); + return FAILURE; + } +#endif + return SUCCESS; +} + +/** @brief Checks if chip is connected to currently open port + @return chip is connected +*/ +bool ConnectionCOM::TestConnectivity() +{ +//currently set to always return true to show all com ports + return true; +#ifndef __unix__ + if (hComm != INVALID_HANDLE_VALUE) +#else + if( hComm >= 0) +#endif + { +// unsigned char out[64]; +// unsigned char in[64]; +// memset(in, 0, 64); +// out[0] = CMD_GET_INFO; +// SendData(out, 64); +// ReadData(in, 64); +// if(in[0] == CMD_GET_INFO && in[1] == 0x01) +// return true; +// else +// return false; + } + return false; +} + +/** @brief Finds all chips connected to com ports + @return number of devices found +*/ +int ConnectionCOM::RefreshDeviceList() +{ + int wasOpen = -1; + string wasOpenName = ""; + if(IsOpen()) + { + wasOpen = GetOpenedIndex(); + wasOpenName = comPortName; + } + Close(); + comPortList.clear(); + if(comPortList.size() == 0) + FindAllComPorts(); + + m_deviceNames.clear(); + string comName; + for(unsigned int i=0; i<comPortList.size(); i++) + { + comName = comPortList[i]; +#ifndef __unix__ + if( Open(comName.c_str(), comBaudrate) == SUCCESS) + { + if( TestConnectivity() ) //if responds add it to device list + m_deviceNames.push_back(comName); + } + Close(); +#else + m_deviceNames.push_back(comName); +#endif + } + if(wasOpen != -1) + { + for(unsigned i=0; i<m_deviceNames.size(); ++i) + if(m_deviceNames[i] == wasOpenName) + { + Open(i); + break; + } + } + return m_deviceNames.size(); +} + +/** @brief Returns found devices names + @return vector of device names +*/ +vector<string> ConnectionCOM::GetDeviceNames() +{ + return m_deviceNames; +} + +/** @brief Purges communication buffers +*/ +void ConnectionCOM::ClearComm() +{ +#ifndef __unix__ + PurgeComm(hComm, PURGE_TXCLEAR|PURGE_RXCLEAR); +#endif +} diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/connectionManager/ConnectionCOM.h b/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/connectionManager/ConnectionCOM.h new file mode 100644 index 0000000000000000000000000000000000000000..0549472db1b9efb7312d75f906b3c7614e1455a7 --- /dev/null +++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/connectionManager/ConnectionCOM.h @@ -0,0 +1,62 @@ +/** +@file ConnectionCOM.h +@author Lime Microsystems (www.limemicro.com) +@brief Class for data communications through COM port +*/ + +#ifndef CONNECTION_COM_PORT_H +#define CONNECTION_COM_PORT_H + +#ifndef __unix__ + #include "windows.h" +#endif + +#include "IConnection.h" + +class ConnectionCOM : public IConnection +{ +public: + static const int COM_BUFFER_LENGTH = 1024; //max buffer size for data + + ConnectionCOM(); + ~ConnectionCOM(); + + DeviceStatus Open(); + DeviceStatus Open(unsigned i); + void Close(); + bool IsOpen(); + int GetOpenedIndex(); + + int Write(const unsigned char *buffer, int length, int timeout_ms = 0); + int Read(unsigned char *buffer, int length, int timeout_ms = 0); + + std::vector<std::string> GetDeviceNames(); + int RefreshDeviceList(); + void ClearComm(); +private: + void FindAllComPorts(); + DeviceStatus Open(const char *comName, int baudrate); + + bool TestConnectivity(); + + std::string comPortName; + int comBaudrate; + bool connected; + + int currentDeviceIndex; + std::vector<std::string> comPortList; + std::vector<std::string> m_deviceNames; + +#ifndef __unix__ + HANDLE hComm; + COMMTIMEOUTS m_ctmoNew; + COMMTIMEOUTS m_ctmoOld; + OVERLAPPED m_osROverlap; + OVERLAPPED m_osWOverlap; + DCB m_dcbCommPort; +#else + int hComm; //com port file descriptor +#endif + +}; +#endif diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/connectionManager/ConnectionManager.cpp b/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/connectionManager/ConnectionManager.cpp new file mode 100644 index 0000000000000000000000000000000000000000..9ec16e0d8845a9902ce9bffa4ea9b5e1309a91a4 --- /dev/null +++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/connectionManager/ConnectionManager.cpp @@ -0,0 +1,319 @@ +/** + @file ConnectionManager.cpp + @author Lime Microsystems (www.limemicro.com) + @brief Implementation of various connection types to devices +*/ + +#include "ConnectionManager.h" +#include "ConnectionCOM.h" + +#ifdef ENABLE_USB_CONNECTION + #include "ConnectionUSB.h" +#endif +#ifdef ENABLE_SPI_CONNECTION + #include "ConnectionSPI.h" +#endif + +#include <sstream> +#include <iomanip> +#include <iostream> + +/** @brief Creates connection interfaces +*/ +ConnectionManager::ConnectionManager(const IConnection::eConnectionType port_type) : activeControlPort(NULL) +{ + mLogData = false; + mOpenedDevice = -1; + if (port_type == IConnection::COM_PORT) + m_connections[IConnection::COM_PORT] = new ConnectionCOM(); +#ifdef ENABLE_USB_CONNECTION + if (port_type == IConnection::USB_PORT) + m_connections[IConnection::USB_PORT] = new ConnectionUSB(); +#endif +#ifdef ENABLE_SPI_CONNECTION + m_connections[IConnection::SPI_PORT] = new ConnectionSPI(); +#endif +} + +/** @brief Destroys connection interfaces +*/ +ConnectionManager::~ConnectionManager() +{ + for (auto iter = m_connections.begin(); iter != m_connections.end(); ++iter) + { + delete iter->second; + } +} + +/** @brief Checks if connection to device is opened + @return True if device is connected +*/ +bool ConnectionManager::IsOpen() +{ + return activeControlPort ? activeControlPort->IsOpen() : false; +} + +/** @brief Opens connection to first available device + @return True if connected to device +*/ +bool ConnectionManager::Open() +{ + return Open(0); +} + +/** @brief Connects to selected device + @param i device index from device list + @return 1:Success, 0:failure +*/ +int ConnectionManager::Open(unsigned i) +{ + if(i >= mDevices.size()) + return 0; + + if(activeControlPort) + activeControlPort->Close(); + switch(mDevices[i].port) + { + case IConnection::COM_PORT: + activeControlPort = m_connections[IConnection::COM_PORT]; + break; + case IConnection::USB_PORT: + activeControlPort = m_connections[IConnection::USB_PORT]; + break; + case IConnection::SPI_PORT: + activeControlPort = m_connections[IConnection::SPI_PORT]; + break; + default: + return 0; + } + mOpenedDevice = -1; + if( i < mDevices.size() ) + { + if (activeControlPort->Open(mDevices[i].portIndex) == IConnection::SUCCESS) + { + mOpenedDevice = i; + return 1; + } + } + return 0; +} + +/** @brief Closes connection to device +*/ +void ConnectionManager::Close() +{ + if(activeControlPort) + { + activeControlPort->Close(); + //Notify(LMS_Message(MSG_BOARD_DISCONNECTED, "", 0, 0)); + } + mOpenedDevice = -1; +} + +/** @brief Finds all currently connected devices and forms device list + @return number of devices found +*/ +int ConnectionManager::RefreshDeviceList() +{ + mDeviceList.clear(); + mDevices.clear(); + DeviceInfo dev; + for (auto iter = m_connections.begin(); iter != m_connections.end(); ++iter) + { + vector<string> names; + IConnection *port = iter->second; + if(port->RefreshDeviceList() > 0) + { + names = port->GetDeviceNames(); + for(unsigned i=0; i<names.size(); ++i) + { + dev.name = names[i]; + dev.port = iter->first; + dev.portIndex = i; + mDevices.push_back(dev); + } + } + } + for(unsigned i=0; i<mDevices.size(); ++i) + mDeviceList.push_back(mDevices[i].name); + return mDevices.size(); +} + +/** @brief Returns currently opened connection index +*/ +int ConnectionManager::GetOpenedIndex() +{ + return mOpenedDevice; +} + +/** @brief Writes given data to currently opened connection + @param buffer outcomming data buffer + @param length bytes to write + @param timeout_ms timeout in milliseconds + @return number of bytes written, on failure negative values +*/ +int ConnectionManager::Write(const unsigned char *buffer, const int length, int timeout_ms) +{ + if(activeControlPort) + { + int bytesTransferred = activeControlPort->Write(buffer, length, timeout_ms); +#ifndef NDEBUG + if(mLogData) + { + stringstream ss; + ss << "WR(" << (bytesTransferred>=0?bytesTransferred: 0) << "): "; + ss << std::hex << std::setfill('0'); + int repeatedZeros = 0; + for(int i=length-1; i>=0; --i) + if(buffer[i] == 0) + ++repeatedZeros; + else break; + if(repeatedZeros == 1) + repeatedZeros = 0; + repeatedZeros = repeatedZeros - (repeatedZeros & 0x1); + for(int i=0; i<length-repeatedZeros; ++i) + //casting to short to print as numbers + ss << " " << std::setw(2) << (unsigned short)buffer[i]; + if(repeatedZeros > 1) + ss << " (00 x " << std::dec << repeatedZeros << " times)"; + cout << ss.str() << endl; +#ifndef __unix__ + OutputDebugString(ss.str().c_str()); +#endif + } +#endif + return bytesTransferred; + } + return -1; +} + +/** @brief Receives data from currently opened connection + @param buffer incomming data buffer, must be big enough for length bytes + @param length bytes to read + @param timeout_ms timeout in milliseconds + @return number of bytes received +*/ +int ConnectionManager::Read(unsigned char *buffer, int length, int timeout_ms) +{ + if(activeControlPort) + { + int bytesTransferred = activeControlPort->Read(buffer, length, timeout_ms); +#ifndef NDEBUG + if(mLogData) + { + stringstream ss; + ss << "RD(" << (bytesTransferred>=0?bytesTransferred: 0) << "): "; + ss << std::hex << std::setfill('0'); + int repeatedZeros = 0; + for(int i=length-1; i>=0; --i) + if(buffer[i] == 0) + ++repeatedZeros; + else break; + if(repeatedZeros == 2) + repeatedZeros = 0; + repeatedZeros = repeatedZeros - (repeatedZeros & 0x1); + for(int i=0; i<length-repeatedZeros; ++i) + //casting to short to print as numbers + ss << " " << std::setw(2) << (unsigned short)buffer[i]; + if(repeatedZeros > 2) + ss << " (00 x " << std::dec << repeatedZeros << " times)"; + cout << ss.str() << endl; + } +#endif + return bytesTransferred; + } + return -1; +} + +int ConnectionManager::WriteStream(const char *buffer, int length) +{ + return 0; +} + +int ConnectionManager::ReadStream(char *buffer, int length, unsigned int timeout_ms) +{ + /*int handle = activeControlPort->BeginDataReading(buffer, length); + activeControlPort->WaitForReading(handle, timeout_ms); + long received = length; + activeControlPort->FinishDataReading(buffer, received, handle); + return received; + */ + long len = length; + int status = activeControlPort->ReadDataBlocking(buffer, len, 0); + return len; +} + + +int ConnectionManager::BeginDataReading(char *buffer, long length) +{ + return activeControlPort->BeginDataReading(buffer, length); +} +/** +@brief Blocks until data is received or set number of milliseconds have passed. +@param contextHandle handle returned by BeginDataReading() +@param timeout_ms number of milliseconds to wait +@return 1-data received, 0-data not received +*/ +int ConnectionManager::WaitForReading(int contextHandle, unsigned int timeout_ms) +{ + return activeControlPort->WaitForReading(contextHandle, timeout_ms); +} +/** +@brief Finished asynchronous data reading. +@param buffer where to put received data +@param length number of bytes to read, will be changed to actual number of bytes received +@param contextHandle context handle returned by BeginDataReading() +@return received data length +*/ +int ConnectionManager::FinishDataReading(char *buffer, long &length, int contextHandle) +{ + return activeControlPort->FinishDataReading(buffer, length, contextHandle); +} + +/** +@brief Aborts reading operations +*/ +void ConnectionManager::AbortReading() +{ + activeControlPort->AbortReading(); +} + +/** +@brief Start asynchronous data sending. +@param buffer data buffer to be sent +@param length number of bytes to send. +@return context handle +*/ +int ConnectionManager::BeginDataSending(const char *buffer, long length) +{ + return activeControlPort->BeginDataSending(buffer, length); +} +/** +@brief Blocks until data is sent or set number of miliseconds have passed. +@param contextHandle handle returned by BeginDataReading() +@param timeout_ms number of miliseconds to wait +@return 1-data sent, 0-data not sent +*/ +int ConnectionManager::WaitForSending(int contextHandle, unsigned int timeout_ms) +{ + return activeControlPort->WaitForSending(contextHandle, timeout_ms); +} +/** +@brief Finished asynchronous data sending. +@param buffer where to put received data +@param length number of bytes to send, will be changed to actual number of bytes sent +@param contextHandle context handle returned by BeginDataReading() +@return sent data length +*/ +int ConnectionManager::FinishDataSending(const char *buffer, long &length, int contextHandle) +{ + return activeControlPort->FinishDataSending(buffer, length, contextHandle); +} + +/** +@brief Aborts sending operations +*/ +void ConnectionManager::AbortSending() +{ + activeControlPort->AbortSending(); +} diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/connectionManager/ConnectionManager.h b/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/connectionManager/ConnectionManager.h new file mode 100644 index 0000000000000000000000000000000000000000..68819011ffaca85af49acc67956937144f8dab36 --- /dev/null +++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/connectionManager/ConnectionManager.h @@ -0,0 +1,60 @@ +/** + @file ConnectionManager.h + @author Lime Microsystems (www.limemicro.com) + @brief Class for managing connection to devices +*/ + +#ifndef LMS_CONNECTION_MANAGER_H +#define LMS_CONNECTION_MANAGER_H + +#include "IConnection.h" +#include <map> + +class ConnectionManager +{ +public: + struct DeviceInfo + { + std::string name; + IConnection::eConnectionType port; + int portIndex; + }; + + ConnectionManager(const IConnection::eConnectionType port_type); + ~ConnectionManager(); + bool IsOpen(); + bool Open(); + int Open(unsigned i); + void Close(); + int RefreshDeviceList(); + int GetOpenedIndex(); + std::vector<std::string> GetDeviceList(){return mDeviceList;}; + + int Write(const unsigned char *buffer, int length, int timeout_ms = 0); + int Read(unsigned char *buffer, int length, int timeout_ms = 0); + + int WriteStream(const char *buffer, int length); + int ReadStream(char *buffer, int length, unsigned int timeout_ms); + + int BeginDataReading(char *buffer, long length); + int WaitForReading(int contextHandle, unsigned int timeout_ms); + int FinishDataReading(char *buffer, long &length, int contextHandle); + void AbortReading(); + + int BeginDataSending(const char *buffer, long length); + int WaitForSending(int contextHandle, unsigned int timeout_ms); + int FinishDataSending(const char *buffer, long &length, int contextHandle); + void AbortSending(); + +protected: + bool mLogData; + /// Port used for communication. + IConnection *activeControlPort; + std::vector<DeviceInfo> mDevices; + std::vector<std::string> mDeviceList; + int mOpenedDevice; + std::map<IConnection::eConnectionType, IConnection*> m_connections; +}; + +#endif // LMS_CONNECTION_MANAGER_H + diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/connectionManager/ConnectionSPI.cpp b/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/connectionManager/ConnectionSPI.cpp new file mode 100644 index 0000000000000000000000000000000000000000..fb305f9c1ccfe627c70006f96d84dbc758310056 --- /dev/null +++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/connectionManager/ConnectionSPI.cpp @@ -0,0 +1,313 @@ +/** + @file ConnectionSPI.cpp + @author Lime Microsystems (www.limemicro.com) + @brief Implementation of communications through SPI port +*/ + +#include "ConnectionSPI.h" + +#include "string.h" +#ifdef __unix__ +#include <fstream> +#include <errno.h> +#include <unistd.h> +#include <termios.h> +#include <sys/types.h> +#include <sys/stat.h> +#include <fcntl.h> +#include <stdlib.h> +#include <stdio.h> +#include <sys/ioctl.h> +#include <linux/types.h> +#include <linux/spi/spidev.h> +#include <linux/i2c-dev.h> +#endif // LINUX + +#include <iostream> +#include <sstream> + +const int ConnectionSPI::cSPI_BUF_SIZE = 128; +const int ConnectionSPI::cSPI_SPEED_HZ = 2000000; + +/** @brief Tries to read EEPROM for Novena board signature + @return true if Novena board +*/ +bool IsNovenaBoard() +{ +#ifdef __unix__ + char data[8]; + int count = 6; + memset(data, 0, 8); + int addr = 0; + struct i2c_rdwr_ioctl_data session; + struct i2c_msg messages[2]; + char set_addr_buf[2]; + memset(set_addr_buf, 0, sizeof(set_addr_buf)); + memset(data, 0, count); + set_addr_buf[0] = addr>>8; + set_addr_buf[1] = addr; + messages[0].addr = 0xac>>1; + messages[0].flags = 0; + messages[0].len = sizeof(set_addr_buf); + messages[0].buf = set_addr_buf; + messages[1].addr = 0xac>>1; + messages[1].flags = I2C_M_RD; + messages[1].len = count; + messages[1].buf = data; + session.msgs = messages; + session.nmsgs = 2; + + bool isNovena = false; + + int fd = open("/dev/i2c-2", O_RDWR); + if(fd > 0) + { + if(ioctl(fd, I2C_RDWR, &session) < 0) + { + perror("Unable to communicate with i2c device"); + isNovena = false; + } + if(strcmp("Novena", data) == 0) + isNovena = true; + } + close(fd); + return isNovena; +#else + return false; +#endif +} + +/** @brief Initializes SPI port and exports needed GPIO +*/ +ConnectionSPI::ConnectionSPI() +{ + fd = -1; + m_connectionType = SPI_PORT; + std::fstream gpio; + //export SEN pin + gpio.open("/sys/class/gpio/export", ios::out); + if(gpio.good()) + { + gpio << 122; + gpio.flush(); + gpio.close(); + gpio.open("/sys/class/gpio/gpio122/direction", ios::out); + gpio << "out"; + gpio.flush(); + gpio.close(); + m_SEN.open("/sys/class/gpio/gpio122/value", ios::out); + m_SEN<< 1; + m_SEN.flush(); + cout << "GPIO122: set to 1" << endl; + } +} + +ConnectionSPI::~ConnectionSPI() +{ + Close(); + m_SEN.close(); +} + +/** @brief Opens connection to first found chip + @return 0-success +*/ +IConnection::DeviceStatus ConnectionSPI::Open() +{ + Close(); +#ifdef __unix__ + fd = open("/dev/spidev2.0", O_RDWR | O_SYNC); + if (fd < 0) + { + //MessageLog::getInstance()->write("SPI PORT: device not found\n", LOG_ERROR); + return IConnection::FAILURE; + } + int mode = SPI_MODE_0; + int ret = ioctl(fd, SPI_IOC_WR_MODE, &mode); + if (ret == -1) + printf("can't set spi mode"); + + ret = ioctl(fd, SPI_IOC_RD_MODE, &mode); + if (ret == -1) + printf("can't get spi mode"); + + /* + * bits per word + */ + int bits = 8; + ret = ioctl(fd, SPI_IOC_WR_BITS_PER_WORD, &bits); + if (ret == -1) + printf("can't set bits per word"); + + ret = ioctl(fd, SPI_IOC_RD_BITS_PER_WORD, &bits); + if (ret == -1) + printf("can't get bits per word"); + + /* + * max speed hz + */ + int speed = cSPI_SPEED_HZ; + ret = ioctl(fd, SPI_IOC_WR_MAX_SPEED_HZ, &speed); + if (ret == -1) + printf("can't set max speed hz"); + + ret = ioctl(fd, SPI_IOC_RD_MAX_SPEED_HZ, &speed); + if (ret == -1) + printf("can't get max speed hz"); + + printf("spi mode: 0x%x\n", mode); + printf("bits per word: %d\n", bits); + printf("max speed: %d Hz (%d KHz)\n", speed, speed/1000); + return IConnection::SUCCESS; +#else + return IConnection::FAILURE; +#endif +} + +/** @brief Opens connection to selected chip + @param index chip index in device list + @return 0-success +*/ +IConnection::DeviceStatus ConnectionSPI::Open(unsigned index) +{ + return Open(); +} + +/** @brief Closes connection to chip +*/ +void ConnectionSPI::Close() +{ +#ifdef __unix__ + close(fd); + fd = -1; +#endif +} + +/** @brief Returns whether chip is connected + @return chip is connected +*/ +bool ConnectionSPI::IsOpen() +{ + return (fd >= 0); +} + +/** @brief Sends data through COM port + @param buffer data buffer to send + @param length size of data buffer + @param timeout_ms timeout limit for operation in milliseconds + @return Number of bytes sent +*/ +int ConnectionSPI::Write(const unsigned char *buffer, int length, int timeout_ms) +{ + #ifdef __unix__ + if(fd < 0) + return 0; + m_SEN << 0; + m_SEN.flush(); + unsigned long bytesWritten = 0; + rxbuf.clear(); + int bytesReceived = 0; + char rxbytes[2]; + while(bytesWritten < length) + { + int toWrite = length-bytesWritten > cSPI_BUF_SIZE ? cSPI_BUF_SIZE : length-bytesWritten; + for(int i=0; i<toWrite; i+=2) + { + if(buffer[i] < 0x80) //reading + { + write(fd, &buffer[i+bytesWritten], 2); + bytesReceived += read(fd, rxbytes, 2); + rxbuf.push_back(rxbytes[0]); + rxbuf.push_back(rxbytes[1]); + } + else //writing + { + write(fd, &buffer[i+bytesWritten], 4); + i+=2; //data bytes have been written + } + } +// stringstream ss; +// ss << "write(" << toWrite << "): "; +// for(int i=0; i<toWrite; ++i) +// { +// char ctemp[16]; +// sprintf(ctemp, "%02X", buffer[bytesWritten+i]); +// ss << ctemp << " "; +// } +// ss << endl; +// if(bytesReceived > 0) +// { +// ss << " re443ad(" << toWrite << "): "; +// for(int i=0; i<toWrite; ++i) +// { +// char ctemp[16]; +// sprintf(ctemp, "%02X", rxbuf[bytesWritten+i]); +// ss << ctemp << " "; +// } +// ss << endl; +// } +// cout << ss.str() << endl; +// MessageLog::getInstance()->write(ss.str(), LOG_DATA); + + bytesWritten += toWrite; + } + m_SEN << 1; + m_SEN.flush(); + return bytesWritten; +#else + return 0; +#endif +} + +/** @brief Reads data from COM port + @param buffer pointer to data buffer for receiving + @param length number of bytes to read + @param timeout_ms timeout limit for operation in milliseconds + @return Number of bytes received +*/ +int ConnectionSPI::Read(unsigned char *buffer, int length, int timeout_ms) +{ +#ifdef __unix__ + if(fd < 0) + return 0; + //because transfer is done in full duplex, function returns data from last transfer + int tocpy = length > rxbuf.size() ? rxbuf.size() : length; + memcpy(buffer, &rxbuf[0], tocpy); + rxbuf.clear(); + return tocpy; +#else + return 0; +#endif +} + +/** @brief Finds all chips connected to com ports + @return number of devices found +*/ +int ConnectionSPI::RefreshDeviceList() +{ + m_deviceNames.clear(); +#ifdef __unix__ + int spidev = open("/dev/spidev2.0", O_RDWR); + if (spidev >= 0) + { + if(IsNovenaBoard() == true) + m_deviceNames.push_back("SPI (Novena)"); + else + m_deviceNames.push_back("SPI"); + } + close(spidev); +#endif + return m_deviceNames.size(); +} + +/** @brief Returns found devices names + @return vector of device names +*/ +vector<string> ConnectionSPI::GetDeviceNames() +{ + return m_deviceNames; +} + +int ConnectionSPI::GetOpenedIndex() +{ + return 0; +} diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/connectionManager/ConnectionSPI.h b/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/connectionManager/ConnectionSPI.h new file mode 100644 index 0000000000000000000000000000000000000000..79d9bd9b9b690c470f156acfb1ebdd2a11e0b4ae --- /dev/null +++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/connectionManager/ConnectionSPI.h @@ -0,0 +1,41 @@ +/** +@file ConnectionSPI.h +@author Lime Microsystems (www.limemicro.com) +@brief Class for data communications through SPI port +*/ + +#ifndef CONNECTION_SPI_PORT_H +#define CONNECTION_SPI_PORT_H + +#include "IConnection.h" +#include <fstream> +#include <string> +#include <vector> + +class ConnectionSPI : public IConnection +{ +public: + static const int cSPI_BUF_SIZE; + static const int cSPI_SPEED_HZ; + + ConnectionSPI(); + ~ConnectionSPI(); + + DeviceStatus Open(); + DeviceStatus Open(unsigned i); + void Close(); + bool IsOpen(); + int GetOpenedIndex(); + + int Write(const unsigned char *buffer, int length, int timeout_ms = 0); + int Read(unsigned char *buffer, int length, int timeout_ms = 0); + + std::vector<std::string> GetDeviceNames(); + int RefreshDeviceList(); +protected: + std::vector<std::string> m_deviceNames; + std::vector<unsigned char> rxbuf; + int fd; + std::fstream m_SEN; +}; +#endif diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/connectionManager/ConnectionUSB.cpp b/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/connectionManager/ConnectionUSB.cpp new file mode 100644 index 0000000000000000000000000000000000000000..148b7b776bc776c8ac5f7fbd2bb1bc923a98dbb4 --- /dev/null +++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/connectionManager/ConnectionUSB.cpp @@ -0,0 +1,771 @@ +/** +@file ConnectionUSB.cpp +@author Lime Microsystems (www.limemicro.com) +@brief Data writing and reading through USB port +*/ + +#include "ConnectionUSB.h" +#include <string.h> + +#ifdef __unix__ + #include <thread> + #include <chrono> +#endif + +#define USB_TIMEOUT 1000 + +#define HW_LDIGIRED L"DigiRed" +#define HW_LDIGIGREEN L"DigiGreen" +#define HW_LSTREAMER L"Stream" + +#define HW_DIGIRED "DigiRed" +#define HW_DIGIGREEN "DigiGreen" +#define HW_STREAMER "Stream" + +#define CTR_W_REQCODE 0xC1 +#define CTR_W_VALUE 0x0000 +#define CTR_W_INDEX 0x0000 + +#define CTR_R_REQCODE 0xC0 +#define CTR_R_VALUE 0x0000 +#define CTR_R_INDEX 0x0000 + +/** @brief Initializes port type and object necessary to communicate to usb device. +*/ +ConnectionUSB::ConnectionUSB() +{ + m_hardwareName = ""; + isConnected = false; + m_connectionType = USB_PORT; +#ifndef __unix__ + USBDevicePrimary = new CCyUSBDevice(NULL); + OutCtrEndPt = NULL; + InCtrEndPt = NULL; + InCtrlEndPt3 = NULL; + OutCtrlEndPt3 = NULL; +#else + dev_handle = 0; + devs = 0; + int r = libusb_init(&ctx); //initialize the library for the session we just declared + if(r < 0) + printf("Init Error %i\n", r); //there was an error + libusb_set_debug(ctx, 3); //set verbosity level to 3, as suggested in the documentation +#endif + currentDeviceIndex = -1; +} + +/** @brief Closes connection to chip and deallocates used memory. +*/ +ConnectionUSB::~ConnectionUSB() +{ + Close(); +#ifndef __unix__ + delete USBDevicePrimary; +#else + libusb_exit(ctx); +#endif +} + +/** @brief Automatically open first available chip connected to usb port. + @return 0-success, other-failure +*/ +IConnection::DeviceStatus ConnectionUSB::Open() +{ + currentDeviceIndex = -1; + if(m_deviceNames.size() == 0) + RefreshDeviceList(); + +#ifndef __unix__ + for(int i=0; i<USBDevicePrimary->DeviceCount(); ++i) + if( Open(i) == SUCCESS) + { + currentDeviceIndex = i; + return SUCCESS; + } +#else + if(Open(0) == SUCCESS) + return SUCCESS; +#endif + return FAILURE; +} + +/** @brief Tries to open connected USB device and find communication endpoints. + @return Returns 1-Success, 0-EndPoints not found or device didn't connect. +*/ +IConnection::DeviceStatus ConnectionUSB::Open(unsigned index) +{ +#ifndef __unix__ + wstring m_hardwareDesc = L""; + if( index < USBDevicePrimary->DeviceCount()) + { + if(USBDevicePrimary->Open(index)) + { + m_hardwareDesc = USBDevicePrimary->Product; + unsigned int pos; + //determine connected board type + pos = m_hardwareDesc.find(HW_LDIGIRED, 0); + if( pos != wstring::npos ) + m_hardwareName = HW_DIGIRED; + else if (m_hardwareDesc.find(HW_LSTREAMER, 0) != wstring::npos) + m_hardwareName = HW_STREAMER; + else + m_hardwareName = HW_STREAMER; + + + if (InCtrlEndPt3) + { + delete InCtrlEndPt3; + InCtrlEndPt3 = NULL; + } + InCtrlEndPt3 = new CCyControlEndPoint(*USBDevicePrimary->ControlEndPt); + + if (OutCtrlEndPt3) + { + delete OutCtrlEndPt3; + OutCtrlEndPt3 = NULL; + } + OutCtrlEndPt3 = new CCyControlEndPoint(*USBDevicePrimary->ControlEndPt); + + InCtrlEndPt3->ReqCode = CTR_R_REQCODE; + InCtrlEndPt3->Value = CTR_R_VALUE; + InCtrlEndPt3->Index = CTR_R_INDEX; + + OutCtrlEndPt3->ReqCode = CTR_W_REQCODE; + OutCtrlEndPt3->Value = CTR_W_VALUE; + OutCtrlEndPt3->Index = CTR_W_INDEX; + + for (int i=0; i<USBDevicePrimary->EndPointCount(); i++) + if(USBDevicePrimary->EndPoints[i]->Address == 0x01) + { + OutEndPt = USBDevicePrimary->EndPoints[i]; + long len = OutEndPt->MaxPktSize * 64; + OutEndPt->SetXferSize(len); + break; + } + for (int i=0; i<USBDevicePrimary->EndPointCount(); i++) + if(USBDevicePrimary->EndPoints[i]->Address == 0x81) + { + InEndPt = USBDevicePrimary->EndPoints[i]; + long len = InEndPt->MaxPktSize * 64; + InEndPt->SetXferSize(len); + break; + } + isConnected = true; + return SUCCESS; + } //successfully opened device + } //if has devices + return FAILURE; +#else + if(index >= 0 && index < m_dev_pid_vid.size()) + { + dev_handle = libusb_open_device_with_vid_pid(ctx, m_dev_pid_vid[index].second, m_dev_pid_vid[index].first); + + if(dev_handle == 0) + return FAILURE; + if(libusb_kernel_driver_active(dev_handle, 0) == 1) //find out if kernel driver is attached + { + printf("Kernel Driver Active\n"); + if(libusb_detach_kernel_driver(dev_handle, 0) == 0) //detach it + printf("Kernel Driver Detached!\n"); + } + int r = libusb_claim_interface(dev_handle, 0); //claim interface 0 (the first) of device + if(r < 0) + { + printf("Cannot Claim Interface\n"); + return CANNOT_CLAIM_INTERFACE; + } + printf("Claimed Interface\n"); + isConnected = true; + return SUCCESS; + } + else + { + return FAILURE; + } +#endif +} + +/** @brief Closes communication to device. +*/ +void ConnectionUSB::Close() +{ + #ifndef __unix__ + USBDevicePrimary->Close(); + InEndPt = NULL; + OutEndPt = NULL; + if (InCtrlEndPt3) + { + delete InCtrlEndPt3; + InCtrlEndPt3 = NULL; + } + if (OutCtrlEndPt3) + { + delete OutCtrlEndPt3; + OutCtrlEndPt3 = NULL; + } + #else + if(dev_handle != 0) + { + libusb_release_interface(dev_handle, 0); + libusb_close(dev_handle); + dev_handle = 0; + } + #endif + isConnected = false; +} + +/** @brief Returns connection status + @return 1-connection open, 0-connection closed. +*/ +bool ConnectionUSB::IsOpen() +{ + #ifndef __unix__ + return USBDevicePrimary->IsOpen() && isConnected; + #else + return isConnected; + #endif +} + +/** @brief Sends given data buffer to chip through USB port. + @param buffer data buffer, must not be longer than 64 bytes. + @param length given buffer size. + @param timeout_ms timeout limit for operation in milliseconds + @return number of bytes sent. +*/ +int ConnectionUSB::Write(const unsigned char *buffer, const int length, int timeout_ms) +{ + long len = length; + if(IsOpen()) + { + unsigned char* wbuffer = new unsigned char[length]; + memcpy(wbuffer, buffer, length); + if(m_hardwareName == HW_DIGIRED || m_hardwareName == HW_STREAMER) + { + #ifndef __unix__ + if(OutCtrlEndPt3) + OutCtrlEndPt3->Write(wbuffer, len); + else + len = 0; + #else + len = libusb_control_transfer(dev_handle, LIBUSB_REQUEST_TYPE_VENDOR,CTR_W_REQCODE ,CTR_W_VALUE, CTR_W_INDEX, wbuffer, length, USB_TIMEOUT); + #endif + } + else + { + #ifndef __unix__ + if(OutCtrEndPt) + OutCtrEndPt->XferData(wbuffer, len); + else + len = 0; + #else + int actual = 0; + libusb_bulk_transfer(dev_handle, 0x01, wbuffer, len, &actual, USB_TIMEOUT); + len = actual; + #endif + } + delete wbuffer; + } + else + return 0; + return len; +} + +/** @brief Reads data coming from the chip through USB port. + @param buffer pointer to array where received data will be copied, array must be + big enough to fit received data. + @param length number of bytes to read from chip. + @param timeout_ms timeout limit for operation in milliseconds + @return number of bytes received. +*/ +int ConnectionUSB::Read(unsigned char *buffer, const int length, int timeout_ms) +{ + long len = length; + if(IsOpen()) + { + if(m_hardwareName == HW_DIGIRED || m_hardwareName == HW_STREAMER) + { + #ifndef __unix__ + if(InCtrlEndPt3) + InCtrlEndPt3->Read(buffer, len); + else + len = 0; + #else + len = libusb_control_transfer(dev_handle, LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_ENDPOINT_IN ,CTR_R_REQCODE ,CTR_R_VALUE, CTR_R_INDEX, buffer, len, USB_TIMEOUT); + #endif + } + else + { + #ifndef __unix__ + if(InCtrEndPt) + InCtrEndPt->XferData(buffer, len); + else + len = 0; + #else + int actual = 0; + libusb_bulk_transfer(dev_handle, 0x81, buffer, len, &actual, USB_TIMEOUT); + len = actual; + #endif + } + } + return len; +} + +#ifdef __unix__ +/** @brief Function for handling libusb callbacks +*/ +void callback_libusbtransfer(libusb_transfer *trans) +{ + USBTransferContext *context = reinterpret_cast<USBTransferContext*>(trans->user_data); + switch(trans->status) + { + case LIBUSB_TRANSFER_CANCELLED: + printf("Transfer canceled\n" ); + context->bytesXfered = trans->actual_length; + context->done = true; + context->used = false; + context->reset(); + break; + case LIBUSB_TRANSFER_COMPLETED: + if(trans->actual_length == context->bytesExpected) + { + context->bytesXfered = trans->actual_length; + context->done = true; + } + //printf("Transfer complete %i\n", trans->actual_length); + break; + case LIBUSB_TRANSFER_ERROR: + printf("TRANSFER ERRRO\n"); + break; + case LIBUSB_TRANSFER_TIMED_OUT: + printf("transfer timed out\n"); + + break; + case LIBUSB_TRANSFER_OVERFLOW: + printf("transfer overflow\n"); + + break; + case LIBUSB_TRANSFER_STALL: + printf("transfer stalled\n"); + break; + } + context->mPacketProcessed.notify_one(); +} +#endif + +/** @brief Finds all chips connected to usb ports + @return number of devices found +*/ +int ConnectionUSB::RefreshDeviceList() +{ + #ifndef __unix__ + USBDevicePrimary->Close(); + currentDeviceIndex = -1; + m_deviceNames.clear(); + string name; + if (USBDevicePrimary->DeviceCount()) + { + for (int i=0; i<USBDevicePrimary->DeviceCount(); ++i) + { + Open(i); + name = DeviceName(); + m_deviceNames.push_back(name); + } + currentDeviceIndex = -1; + } + #else + m_dev_pid_vid.clear(); + m_deviceNames.clear(); + int usbDeviceCount = libusb_get_device_list(ctx, &devs); + if(usbDeviceCount > 0) + { + libusb_device_descriptor desc; + for(int i=0; i<usbDeviceCount; ++i) + { + int r = libusb_get_device_descriptor(devs[i], &desc); + if(r<0) + printf("failed to get device description\n"); + int pid = desc.idProduct; + int vid = desc.idVendor; + + if( vid == 1204) + { + if(pid == 34323) + { + m_hardwareName = HW_DIGIGREEN; + m_deviceNames.push_back("DigiGreen"); + m_dev_pid_vid.push_back( pair<int,int>(pid,vid)); + } + else if(pid == 241) + { + m_hardwareName = HW_DIGIRED; + libusb_device_handle *tempDev_handle; + tempDev_handle = libusb_open_device_with_vid_pid(ctx, vid, pid); + if(libusb_kernel_driver_active(tempDev_handle, 0) == 1) //find out if kernel driver is attached + { + if(libusb_detach_kernel_driver(tempDev_handle, 0) == 0) //detach it + printf("Kernel Driver Detached!\n"); + } + if(libusb_claim_interface(tempDev_handle, 0) < 0) //claim interface 0 (the first) of device + { + printf("Cannot Claim Interface\n"); + } + + string fullName; + //check operating speed + int speed = libusb_get_device_speed(devs[i]); + if(speed == LIBUSB_SPEED_HIGH) + fullName = "USB 2.0"; + else if(speed == LIBUSB_SPEED_SUPER) + fullName = "USB 3.0"; + else + fullName = "USB"; + fullName += " ("; + //read device name + char data[255]; + memset(data, 0, 255); + int st = libusb_get_string_descriptor_ascii(tempDev_handle, 2, (unsigned char*)data, 255); + if(strlen(data) > 0) + fullName += data; + fullName += ")"; + libusb_close(tempDev_handle); + + m_deviceNames.push_back(fullName); + m_dev_pid_vid.push_back( pair<int,int>(pid,vid)); + } + } + } + } + else + { + libusb_free_device_list(devs, 1); + return 0; + } + #endif + return m_deviceNames.size(); +} + +void ConnectionUSB::ClearComm() +{ +} + +/** @return name of currently opened device as string. +*/ +string ConnectionUSB::DeviceName() +{ +#ifndef __unix__ + string name; + char tempName[USB_STRING_MAXLEN]; + //memcpy(tempName, USBDevicePrimary->FriendlyName, USB_STRING_MAXLEN); + //name = tempName; + + for (int i = 0; i < USB_STRING_MAXLEN; ++i) + tempName[i] = USBDevicePrimary->DeviceName[i]; + if (USBDevicePrimary->bSuperSpeed == true) + name = "USB 3.0"; + else if (USBDevicePrimary->bHighSpeed == true) + name = "USB 2.0"; + else + name = "USB"; + name += " ("; + name += tempName; + name += ")"; + return name; +#else + if(dev_handle != 0) + { + char data[255]; + int st = libusb_get_string_descriptor_ascii(dev_handle, 2, (unsigned char*)data, 255); + return string(data); + } + return "no name"; +#endif +} + +/** + @brief Starts asynchronous data reading from board + @param *buffer buffer where to store received data + @param length number of bytes to read + @return handle of transfer context +*/ +int ConnectionUSB::BeginDataReading(char *buffer, long length) +{ + int i = 0; + bool contextFound = false; + //find not used context + for(i = 0; i<USB_MAX_CONTEXTS; i++) + { + if(!contexts[i].used) + { + contextFound = true; + break; + } + } + if(!contextFound) + return -1; + contexts[i].used = true; + #ifndef __unix__ + if(InEndPt) + contexts[i].context = InEndPt->BeginDataXfer((unsigned char*)buffer, length, contexts[i].inOvLap); + return i; + #else + unsigned int Timeout = 1000; + libusb_transfer *tr = contexts[i].transfer; + libusb_fill_bulk_transfer(tr, dev_handle, 0x81, (unsigned char*)buffer, length, callback_libusbtransfer, &contexts[i], Timeout); + contexts[i].done = false; + contexts[i].bytesXfered = 0; + contexts[i].bytesExpected = length; + int status = libusb_submit_transfer(tr); + int actual = 0; + //int status = libusb_bulk_transfer(dev_handle, 0x81, (unsigned char*)buffer, length, &actual, USB_TIMEOUT); + if(status != 0) + printf("ERROR BEGIN DATA TRANSFER %s\n", libusb_error_name(status)); + #endif + return i; +} + +/** + @brief Waits for asynchronous data reception + @param contextHandle handle of which context data to wait + @param timeout_ms number of miliseconds to wait + @return 1-data received, 0-data not received +*/ +int ConnectionUSB::WaitForReading(int contextHandle, unsigned int timeout_ms) +{ + if( contexts[contextHandle].used == true && contextHandle >= 0) + { + int status = 0; + #ifndef __unix__ + if(InEndPt) + status = InEndPt->WaitForXfer(contexts[contextHandle].inOvLap, timeout_ms); + return status; + #else + + struct timeval tv; + tv.tv_sec = 0; + tv.tv_usec = 0; + if(libusb_handle_events_timeout_completed(ctx, &tv, NULL) != 0) + printf("error libusb_handle_events %i\n", status); + + auto t1 = chrono::high_resolution_clock::now(); + auto t2 = chrono::high_resolution_clock::now(); + + while(contexts[contextHandle].done == false && std::chrono::duration_cast<std::chrono::milliseconds>(t2 - t1).count() < timeout_ms) + { + struct timeval tv; + tv.tv_sec = 0; + tv.tv_usec = 300; + std::this_thread::yield(); + //if(libusb_handle_events(ctx) != 0) + if(libusb_handle_events_timeout_completed(ctx, &tv, NULL) != 0) + printf("error libusb_handle_events %i\n", status); + t2 = chrono::high_resolution_clock::now(); + //std::this_thread::sleep_for(std::chrono::milliseconds(1)); + } + std::unique_lock<std::mutex> lck(contexts[contextHandle].m_lock); + while(contexts[contextHandle].done == false) //is changed in libusb callback + { + if(contexts[contextHandle].mPacketProcessed.wait_for(lck, std::chrono::milliseconds(timeout_ms)) == std::cv_status::timeout) + return 0; + } + return contexts[contextHandle].done == true; + #endif + } + else + return 0; +} + +/** + @brief Finishes asynchronous data reading from board + @param buffer array where to store received data + @param length number of bytes to read, function changes this value to number of bytes actually received + @param contextHandle handle of which context to finish + @return false failure, true number of bytes received +*/ +int ConnectionUSB::FinishDataReading(char *buffer, long &length, int contextHandle) +{ + if( contexts[contextHandle].used == true && contextHandle >= 0) + { + #ifndef __unix__ + int status = 0; + if(InEndPt) + status = InEndPt->FinishDataXfer((unsigned char*)buffer, length, contexts[contextHandle].inOvLap, contexts[contextHandle].context); + contexts[contextHandle].used = false; + contexts[contextHandle].reset(); + return length; + #else + length = contexts[contextHandle].bytesXfered; + contexts[contextHandle].used = false; + contexts[contextHandle].reset(); + return length; + #endif + } + else + return 0; +} + +int ConnectionUSB::ReadDataBlocking(char *buffer, long &length, int timeout_ms) +{ +#ifndef __unix__ + return InEndPt->XferData((unsigned char*)buffer, length); +#else + return 0; +#endif +} + + +/** + @brief Aborts reading operations +*/ +void ConnectionUSB::AbortReading() +{ +#ifndef __unix__ + InEndPt->Abort(); +#else + for(int i=0; i<USB_MAX_CONTEXTS; ++i) + { + libusb_cancel_transfer( contexts[i].transfer ); + } +#endif +} + +/** + @brief Starts asynchronous data Sending to board + @param *buffer buffer to send + @param length number of bytes to send + @return handle of transfer context +*/ +int ConnectionUSB::BeginDataSending(const char *buffer, long length) +{ + int i = 0; + //find not used context + bool contextFound = false; + for(i = 0; i<USB_MAX_CONTEXTS; i++) + { + if(!contextsToSend[i].used) + { + contextFound = true; + break; + } + } + if(!contextFound) + return -1; + contextsToSend[i].used = true; + #ifndef __unix__ + if(OutEndPt) + contextsToSend[i].context = OutEndPt->BeginDataXfer((unsigned char*)buffer, length, contextsToSend[i].inOvLap); + return i; + #else + unsigned int Timeout = 1000; + libusb_transfer *tr = contextsToSend[i].transfer; + //libusb_set_iso_packet_lengths(contexts[i].transfer, 512*64); + libusb_fill_bulk_transfer(tr, dev_handle, 0x1, (unsigned char*)buffer, length, callback_libusbtransfer, &contextsToSend[i], Timeout); + contextsToSend[i].done = false; + contextsToSend[i].bytesXfered = 0; + contextsToSend[i].bytesExpected = length; + libusb_submit_transfer(tr); + #endif + return i; +} + +/** + @brief Waits for asynchronous data sending + @param contextHandle handle of which context data to wait + @param timeout_ms number of miliseconds to wait + @return 1-data received, 0-data not received +*/ +int ConnectionUSB::WaitForSending(int contextHandle, unsigned int timeout_ms) +{ + if( contextsToSend[contextHandle].used == true ) + { + #ifndef __unix__ + int status = 0; + if(OutEndPt) + status = OutEndPt->WaitForXfer(contextsToSend[contextHandle].inOvLap, timeout_ms); + return status; + #else + auto t1 = chrono::high_resolution_clock::now(); + auto t2 = chrono::high_resolution_clock::now(); + while(contextsToSend[contextHandle].done == false && std::chrono::duration_cast<std::chrono::milliseconds>(t2 - t1).count() < timeout_ms) + { + /* struct timeval tv; + tv.tv_sec = 1; + tv.tv_usec = 0; + int status = libusb_handle_events_timeout_completed(ctx, &tv, NULL); + if(status != 0) + printf("error libusb_handle_events %i\n", status);*/ + t2 = chrono::high_resolution_clock::now(); + //std::this_thread::sleep_for(std::chrono::milliseconds(1)); + } + std::unique_lock<std::mutex> lck(contextsToSend[contextHandle].m_lock); + while(contextsToSend[contextHandle].done == false) //is changed in libusb callback + { + if(contextsToSend[contextHandle].mPacketProcessed.wait_for(lck, std::chrono::milliseconds(timeout_ms)) == std::cv_status::timeout) + return 0; + } + return contextsToSend[contextHandle].done == true; + #endif + } + else + return 0; +} + +/** + @brief Finishes asynchronous data sending to board + @param buffer array where to store received data + @param length number of bytes to read, function changes this value to number of bytes acctually received + @param contextHandle handle of which context to finish + @return false failure, true number of bytes sent +*/ +int ConnectionUSB::FinishDataSending(const char *buffer, long &length, int contextHandle) +{ + if( contextsToSend[contextHandle].used == true) + { + #ifndef __unix__ + if(OutEndPt) + OutEndPt->FinishDataXfer((unsigned char*)buffer, length, contextsToSend[contextHandle].inOvLap, contextsToSend[contextHandle].context); + contextsToSend[contextHandle].used = false; + contextsToSend[contextHandle].reset(); + return length; + #else + length = contextsToSend[contextHandle].bytesXfered; + contextsToSend[contextHandle].used = false; + contextsToSend[contextHandle].reset(); + return length; + #endif + } + else + return 0; +} + +/** + @brief Aborts sending operations +*/ +void ConnectionUSB::AbortSending() +{ +#ifndef __unix__ + OutEndPt->Abort(); +#else + for (int i = 0; i<USB_MAX_CONTEXTS; ++i) + { + libusb_cancel_transfer(contextsToSend[i].transfer); + } + for(int i=0; i<USB_MAX_CONTEXTS; ++i) + { + contextsToSend[i].used = false; + contextsToSend[i].reset(); + } +#endif +} + +int ConnectionUSB::GetOpenedIndex() +{ + return currentDeviceIndex; +} + +/** @brief Returns found devices names + @return vector of device names +*/ +vector<string> ConnectionUSB::GetDeviceNames() +{ + return m_deviceNames; +} diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/connectionManager/ConnectionUSB.h b/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/connectionManager/ConnectionUSB.h new file mode 100644 index 0000000000000000000000000000000000000000..f3048c184200e5bb5bdb875392c957ca45c75a7b --- /dev/null +++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/connectionManager/ConnectionUSB.h @@ -0,0 +1,144 @@ +/** +@file ConnectionUSB.h +@author Lime Microsystems (www.limemicro.com) +@brief Class for data writing and reading through USB port +*/ + +#ifndef USB_PORT_CONNECTION_H +#define USB_PORT_CONNECTION_H + +#include "IConnection.h" + +#ifndef __unix__ +#include "windows.h" +#include "CyAPI.h" +#else +#include <libusb-1.0/libusb.h> +#include <mutex> +#include <condition_variable> +#include <chrono> +#endif + +#define USB_MAX_CONTEXTS 64 //maximum number of contexts for asynchronous transfers + +/** @brief Wrapper class for holding USB asynchronous transfers contexts +*/ +class USBTransferContext +{ +public: + USBTransferContext() : used(false) + { + #ifndef __unix__ + inOvLap = new OVERLAPPED; + memset(inOvLap, 0, sizeof(OVERLAPPED)); + inOvLap->hEvent = CreateEvent(NULL, false, false, NULL); + context = NULL; + #else + transfer = libusb_alloc_transfer(0); + bytesXfered = 0; + bytesExpected = 0; + done = 0; + #endif + } + ~USBTransferContext() + { + #ifndef __unix__ + CloseHandle(inOvLap->hEvent); + delete inOvLap; + #else + libusb_free_transfer(transfer); + #endif + } + bool reset() + { + if(used) + return false; + #ifndef __unix__ + CloseHandle(inOvLap->hEvent); + memset(inOvLap, 0, sizeof(OVERLAPPED)); + inOvLap->hEvent = CreateEvent(NULL, false, false, NULL); + #endif + return true; + } + bool used; + #ifndef __unix__ + PUCHAR context; + OVERLAPPED *inOvLap; + #else + libusb_transfer* transfer; + long bytesXfered; + long bytesExpected; + bool done; + std::mutex m_lock; + std::condition_variable mPacketProcessed; + #endif +}; + +class ConnectionUSB : public IConnection +{ +public: + ConnectionUSB(); + ~ConnectionUSB(); + + void FindDevices(); + DeviceStatus Open(); + DeviceStatus Open(unsigned index); + void Close(); + bool IsOpen(); + int GetOpenedIndex(); + + int Write(const unsigned char *buffer, int length, int timeout_ms = 0); + int Read(unsigned char *buffer, int length, int timeout_ms = 0); + + virtual int BeginDataReading(char *buffer, long length); + virtual int WaitForReading(int contextHandle, unsigned int timeout_ms); + virtual int FinishDataReading(char *buffer, long &length, int contextHandle); + virtual void AbortReading(); + virtual int ReadDataBlocking(char *buffer, long &length, int timeout_ms); + + virtual int BeginDataSending(const char *buffer, long length); + virtual int WaitForSending(int contextHandle, unsigned int timeout_ms); + virtual int FinishDataSending(const char *buffer, long &length, int contextHandle); + virtual void AbortSending(); + + std::vector<std::string> GetDeviceNames(); + int RefreshDeviceList(); + void ClearComm(); +private: + int currentDeviceIndex; + std::string DeviceName(); + + std::vector<std::string> m_deviceNames; + std::string m_hardwareName; + int m_hardwareVer; + + USBTransferContext contexts[USB_MAX_CONTEXTS]; + USBTransferContext contextsToSend[USB_MAX_CONTEXTS]; + void Initialize(); + + bool isConnected; + int currentPortIndex; + + #ifndef __unix__ + CCyUSBDevice *USBDevicePrimary; + //control endpoints for DigiRed + CCyControlEndPoint *InCtrlEndPt3; + CCyControlEndPoint *OutCtrlEndPt3; + + //control endpoints for DigiGreen + CCyUSBEndPoint *OutCtrEndPt; + CCyUSBEndPoint *InCtrEndPt; + + //end points for samples reading and writing + CCyUSBEndPoint *InEndPt; + CCyUSBEndPoint *OutEndPt; + + #else + libusb_device **devs; //pointer to pointer of device, used to retrieve a list of devices + libusb_device_handle *dev_handle; //a device handle + libusb_context *ctx; //a libusb session + std::vector<std::pair<int,int> > m_dev_pid_vid; + #endif +}; + +#endif diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/connectionManager/IConnection.h b/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/connectionManager/IConnection.h new file mode 100644 index 0000000000000000000000000000000000000000..5804f1149f104c4d834c710eaf6f38f75bc9a6d3 --- /dev/null +++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/connectionManager/IConnection.h @@ -0,0 +1,68 @@ +/** + @file IConnection.h + @author Lime Microsystems + @brief Interface class for connection types +*/ + +#ifndef ICONNECTION_H +#define ICONNECTION_H + +#include <string> +#include <vector> + +using namespace std; + +class IConnection +{ +public: + /// Supported connection types. + enum eConnectionType + { + CONNECTION_UNDEFINED = -1, + COM_PORT = 0, + USB_PORT = 1, + SPI_PORT = 2, + //insert new types here + CONNECTION_TYPES_COUNT //used only for memory allocation + }; + + enum DeviceStatus + { + SUCCESS, + FAILURE, + END_POINTS_NOT_FOUND, + CANNOT_CLAIM_INTERFACE + }; + + IConnection() : m_connectionType(CONNECTION_UNDEFINED){}; + virtual ~IConnection(){}; + virtual int RefreshDeviceList() = 0; + virtual DeviceStatus Open(unsigned i) = 0; + virtual void Close() = 0; + virtual bool IsOpen() = 0; + virtual int GetOpenedIndex() = 0; + + virtual int Write(const unsigned char *buffer, int length, int timeout_ms = 0) = 0; + virtual int Read(unsigned char *buffer, int length, int timeout_ms = 0) = 0; + + virtual std::vector<std::string> GetDeviceNames() = 0; + + virtual eConnectionType GetType() { return m_connectionType; }; + virtual bool SetParam(const char *name, const char* value) {return false;}; + + virtual int BeginDataReading(char *buffer, long length){ return -1; }; + virtual int WaitForReading(int contextHandle, unsigned int timeout_ms){ return 0;}; + virtual int FinishDataReading(char *buffer, long &length, int contextHandle){ return 0;} + virtual void AbortReading(){}; + virtual int ReadDataBlocking(char *buffer, long &length, int timeout_ms){ return 0; } + + virtual int BeginDataSending(const char *buffer, long length){ return -1; }; + virtual int WaitForSending(int contextHandle, unsigned int timeout_ms){ return 0;}; + virtual int FinishDataSending(const char *buffer, long &length, int contextHandle){ return 0;} + virtual void AbortSending(){}; +protected: + eConnectionType m_connectionType; +}; + +#endif + diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/connectionManager/lmsComms.cpp b/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/connectionManager/lmsComms.cpp new file mode 100644 index 0000000000000000000000000000000000000000..0e5ec667621f7b3c797aacba8ffc89742645c96f --- /dev/null +++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/connectionManager/lmsComms.cpp @@ -0,0 +1,325 @@ +/** +@file LMScomms.cpp +@author Lime Microsystems (www.limemicro.com) +@brief Implementation of data transmission to LMS boards +*/ + +#include "lmsComms.h" + +LMScomms::LMScomms(const IConnection::eConnectionType port_type) : ConnectionManager(port_type) +{ + callback_logData = nullptr; + unsigned short test = 0x1234; + unsigned char* bytes = (unsigned char*)&test; + if(bytes[0] == 0x12 && bytes[1] == 0x34) + mSystemBigEndian = true; + else + mSystemBigEndian = false; +} + +LMScomms::~LMScomms() +{ +} + +/** @brief Transfers data between packet and connected device + @param pkt packet containing output data and to receive incomming data + @return 0: success, other: failure +*/ +LMScomms::TransferStatus LMScomms::TransferPacket(GenericPacket& pkt) +{ + std::lock_guard<std::mutex> lock(mControlPortLock); + TransferStatus status = TRANSFER_SUCCESS; + if(IsOpen() == false) + return NOT_CONNECTED; + + int packetLen; + eLMS_PROTOCOL protocol = LMS_PROTOCOL_UNDEFINED; + if(activeControlPort->GetType() == IConnection::SPI_PORT) + protocol = LMS_PROTOCOL_NOVENA; + else + protocol = LMS_PROTOCOL_LMS64C; + switch(protocol) + { + case LMS_PROTOCOL_UNDEFINED: + return TRANSFER_FAILED; + case LMS_PROTOCOL_LMS64C: + packetLen = ProtocolLMS64C::pktLength; + break; + case LMS_PROTOCOL_NOVENA: + packetLen = pkt.outBuffer.size() > ProtocolNovena::pktLength ? ProtocolNovena::pktLength : pkt.outBuffer.size(); + break; + default: + packetLen = 0; + return TRANSFER_FAILED; + } + int outLen = 0; + unsigned char* outBuffer = NULL; + outBuffer = PreparePacket(pkt, outLen, protocol); + unsigned char* inBuffer = new unsigned char[outLen]; + memset(inBuffer, 0, outLen); + + int outBufPos = 0; + int inDataPos = 0; + if(outLen == 0) + { + //printf("packet outlen = 0\n"); + outLen = 1; + } + + if(protocol == LMS_PROTOCOL_NOVENA) + { + bool transferData = true; //some commands are fake, so don't need transferring + if(pkt.cmd == CMD_GET_INFO) + { + //spi does not have GET INFO, fake it to inform what device it is + pkt.status = STATUS_COMPLETED_CMD; + pkt.inBuffer.clear(); + pkt.inBuffer.resize(64, 0); + pkt.inBuffer[0] = 0; //firmware + pkt.inBuffer[1] = LMS_DEV_NOVENA; //device + pkt.inBuffer[2] = 0; //protocol + pkt.inBuffer[3] = 0; //hardware + pkt.inBuffer[4] = EXP_BOARD_UNSUPPORTED; //expansion + transferData = false; + } + + if(transferData) + { + if (callback_logData) + callback_logData(true, outBuffer, outLen); + int bytesWritten = Write(outBuffer, outLen); + if( bytesWritten == outLen) + { + if(pkt.cmd == CMD_LMS7002_RD) + { + inDataPos = Read(&inBuffer[inDataPos], outLen); + if(inDataPos != outLen) + status = TRANSFER_FAILED; + else + { + if (callback_logData) + callback_logData(false, inBuffer, inDataPos); + } + } + ParsePacket(pkt, inBuffer, inDataPos, protocol); + } + else + status = TRANSFER_FAILED; + } + } + else + { + for(int i=0; i<outLen; i+=packetLen) + { + int bytesToSend = packetLen; + if (callback_logData) + callback_logData(true, &outBuffer[outBufPos], bytesToSend); + if( Write(&outBuffer[outBufPos], bytesToSend) ) + { + outBufPos += packetLen; + long readLen = packetLen; + int bread = Read(&inBuffer[inDataPos], readLen); + if(bread != readLen && protocol != LMS_PROTOCOL_NOVENA) + { + status = TRANSFER_FAILED; + break; + } + if (callback_logData) + callback_logData(false, &inBuffer[inDataPos], bread); + inDataPos += bread; + } + else + { + status = TRANSFER_FAILED; + break; + } + } + ParsePacket(pkt, inBuffer, inDataPos, protocol); + } + delete outBuffer; + delete inBuffer; + return status; +} + +/** @brief Returns connected device information +*/ +LMSinfo LMScomms::GetInfo() +{ + LMSinfo info; + info.device = LMS_DEV_UNKNOWN; + info.expansion = EXP_BOARD_UNKNOWN; + info.firmware = 0; + info.hardware = 0; + info.protocol = 0; + GenericPacket pkt; + pkt.cmd = CMD_GET_INFO; + LMScomms::TransferStatus status = TransferPacket(pkt); + if (status == LMScomms::TRANSFER_SUCCESS && pkt.inBuffer.size() >= 5) + { + info.firmware = pkt.inBuffer[0]; + info.device = pkt.inBuffer[1] < LMS_DEV_COUNT ? (eLMS_DEV)pkt.inBuffer[1] : LMS_DEV_UNKNOWN; + info.protocol = pkt.inBuffer[2]; + info.hardware = pkt.inBuffer[3]; + info.expansion = pkt.inBuffer[4] < EXP_BOARD_COUNT ? (eEXP_BOARD)pkt.inBuffer[4] : EXP_BOARD_UNKNOWN; + } + return info; +} + +/** @brief Takes generic packet and converts to specific protocol buffer + @param pkt generic data packet to convert + @param length returns length of returned buffer + @param protocol which protocol to use for data + @return pointer to data buffer, must be manually deleted after use +*/ +unsigned char* LMScomms::PreparePacket(const GenericPacket& pkt, int& length, const eLMS_PROTOCOL protocol) +{ + unsigned char* buffer = NULL; + if(protocol == LMS_PROTOCOL_UNDEFINED) + return NULL; + + if(protocol == LMS_PROTOCOL_LMS64C) + { + ProtocolLMS64C packet; + int maxDataLength = packet.maxDataLength; + packet.cmd = pkt.cmd; + packet.status = pkt.status; + int byteBlockRatio = 1; //block ratio - how many bytes in one block + switch( packet.cmd ) + { + case CMD_PROG_MCU: + case CMD_GET_INFO: + case CMD_SI5351_RD: + case CMD_SI5356_RD: + byteBlockRatio = 1; + break; + case CMD_SI5351_WR: + case CMD_SI5356_WR: + byteBlockRatio = 2; + break; + case CMD_LMS7002_RD: + case CMD_BRDSPI_RD: + case CMD_BRDSPI8_RD: + byteBlockRatio = 2; + break; + case CMD_ADF4002_WR: + byteBlockRatio = 3; + break; + case CMD_LMS7002_WR: + case CMD_BRDSPI_WR: + case CMD_ANALOG_VAL_WR: + byteBlockRatio = 4; + break; + default: + byteBlockRatio = 1; + } + if (packet.cmd == CMD_LMS7002_RD || packet.cmd == CMD_BRDSPI_RD) + maxDataLength = maxDataLength/2; + if (packet.cmd == CMD_ANALOG_VAL_RD) + maxDataLength = maxDataLength / 4; + int blockCount = pkt.outBuffer.size()/byteBlockRatio; + int bufLen = blockCount/(maxDataLength/byteBlockRatio) + +(blockCount%(maxDataLength/byteBlockRatio)!=0); + bufLen *= packet.pktLength; + if(bufLen == 0) + bufLen = packet.pktLength; + buffer = new unsigned char[bufLen]; + memset(buffer, 0, bufLen); + int srcPos = 0; + for(int j=0; j*packet.pktLength<bufLen; ++j) + { + int pktPos = j*packet.pktLength; + buffer[pktPos] = packet.cmd; + buffer[pktPos+1] = packet.status; + if(blockCount > (maxDataLength/byteBlockRatio)) + { + buffer[pktPos+2] = maxDataLength/byteBlockRatio; + blockCount -= buffer[pktPos+2]; + } + else + buffer[pktPos+2] = blockCount; + memcpy(&buffer[pktPos+3], packet.reserved, sizeof(packet.reserved)); + int bytesToPack = (maxDataLength/byteBlockRatio)*byteBlockRatio; + for (int k = 0; k<bytesToPack && srcPos < pkt.outBuffer.size(); ++srcPos, ++k) + buffer[pktPos + 8 + k] = pkt.outBuffer[srcPos]; + } + length = bufLen; + } + else if(protocol == LMS_PROTOCOL_NOVENA) + { + if(pkt.cmd == CMD_LMS7002_RST) + { + buffer = new unsigned char[8]; + buffer[0] = 0x88; + buffer[1] = 0x06; + buffer[2] = 0x00; + buffer[3] = 0x18; + buffer[4] = 0x88; + buffer[5] = 0x06; + buffer[6] = 0x00; + buffer[7] = 0x38; + length = 8; + } + else + { + buffer = new unsigned char[pkt.outBuffer.size()]; + memcpy(buffer, &pkt.outBuffer[0], pkt.outBuffer.size()); + if (pkt.cmd == CMD_LMS7002_WR) + { + for(int i=0; i<pkt.outBuffer.size(); i+=4) + buffer[i] |= 0x80; + } + length = pkt.outBuffer.size(); + } + } + return buffer; +} + +/** @brief Parses given data buffer into generic packet + @param pkt destination packet + @param buffer received data from board + @param length received buffer length + @param protocol which protocol to use for data parsing + @return 1:success, 0:failure +*/ +int LMScomms::ParsePacket(GenericPacket& pkt, const unsigned char* buffer, const int length, const eLMS_PROTOCOL protocol) +{ + if(protocol == LMS_PROTOCOL_UNDEFINED) + return -1; + + if(protocol == LMS_PROTOCOL_LMS64C) + { + ProtocolLMS64C packet; + int inBufPos = 0; + pkt.inBuffer.resize(packet.maxDataLength*(length / packet.pktLength + (length % packet.pktLength)), 0); + for(int i=0; i<length; i+=packet.pktLength) + { + pkt.cmd = (eCMD_LMS)buffer[i]; + pkt.status = (eCMD_STATUS)buffer[i+1]; + memcpy(&pkt.inBuffer[inBufPos], &buffer[i+8], packet.maxDataLength); + inBufPos += packet.maxDataLength; + } + } + else if(protocol == LMS_PROTOCOL_NOVENA) + { + pkt.cmd = CMD_LMS7002_RD; + pkt.status = STATUS_COMPLETED_CMD; + pkt.inBuffer.clear(); + for(int i=0; i<length; i+=2) + { + //reading from spi returns only registers values + //fill addresses as zeros to match generic format of address, value pairs + pkt.inBuffer.push_back(0); //should be address msb + pkt.inBuffer.push_back(0); //should be address lsb + pkt.inBuffer.push_back(buffer[i]); + pkt.inBuffer.push_back(buffer[i+1]); + } + } + return 1; +} + +/** @brief Sets callback function which gets called each time data is sent or received +*/ +void LMScomms::SetDataLogCallback(std::function<void(bool, const unsigned char*, const unsigned int)> callback) +{ + callback_logData = callback; +} diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/connectionManager/lmsComms.h b/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/connectionManager/lmsComms.h new file mode 100644 index 0000000000000000000000000000000000000000..f811d293025e0e7c2dce6289dd6e0cbaf04ba278 --- /dev/null +++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/connectionManager/lmsComms.h @@ -0,0 +1,111 @@ +/** +@file LMScomms.h +@author Lime Microsystems (www.limemicro.com) +@brief Class for handling data transmission to LMS boards +*/ + +#ifndef LMS_COMMS_H +#define LMS_COMMS_H + +#include "lms7002_defines.h" +#include "ConnectionManager.h" +#include <string.h> +#include <mutex> + +struct LMSinfo +{ + eLMS_DEV device; + eEXP_BOARD expansion; + int firmware; + int hardware; + int protocol; +}; + +/* @brief Class for abstracting transfering data to and from chip +*/ +class LMScomms : public ConnectionManager +{ +public: + enum TransferStatus + { + TRANSFER_SUCCESS, + TRANSFER_FAILED, + NOT_CONNECTED + }; + + enum eLMS_PROTOCOL + { + LMS_PROTOCOL_UNDEFINED = 0, + LMS_PROTOCOL_DIGIC, + LMS_PROTOCOL_LMS64C, + LMS_PROTOCOL_NOVENA, + }; + struct ProtocolDIGIC + { + static const int pktLength = 64; + static const int maxDataLength = 60; + ProtocolDIGIC() : cmd(0), i2cAddr(0), blockCount(0) {}; + unsigned char cmd; + unsigned char i2cAddr; + unsigned char blockCount; + unsigned char reserved; + unsigned char data[maxDataLength]; + }; + + struct ProtocolLMS64C + { + static const int pktLength = 64; + static const int maxDataLength = 56; + ProtocolLMS64C() :cmd(0),status(STATUS_UNDEFINED),blockCount(0) + { + memset(reserved, 0, 5); + }; + unsigned char cmd; + unsigned char status; + unsigned char blockCount; + unsigned char reserved[5]; + unsigned char data[maxDataLength]; + }; + + struct ProtocolNovena + { + static const int pktLength = 128; + static const int maxDataLength = 128; + ProtocolNovena() :cmd(0),status(0) {}; + unsigned char cmd; + unsigned char status; + unsigned char blockCount; + unsigned char data[maxDataLength]; + }; + + struct GenericPacket + { + GenericPacket() + { + cmd = CMD_GET_INFO; + status = STATUS_UNDEFINED; + } + + eCMD_LMS cmd; + eCMD_STATUS status; + vector<unsigned char> outBuffer; + vector<unsigned char> inBuffer; + }; + + LMScomms(const IConnection::eConnectionType port_type); + ~LMScomms(); + + virtual TransferStatus TransferPacket(GenericPacket &pkt); + LMSinfo GetInfo(); + void SetDataLogCallback(std::function<void(bool, const unsigned char*, const unsigned int)> callback); +protected: + std::function<void(bool, const unsigned char*, const unsigned int)> callback_logData; + std::mutex mControlPortLock; + unsigned char* PreparePacket(const GenericPacket &pkt, int &length, const eLMS_PROTOCOL protocol); + int ParsePacket(GenericPacket &pkt, const unsigned char* buffer, const int length, const eLMS_PROTOCOL protocol); +protected: + bool mSystemBigEndian; +}; + +#endif // LMS_COMMS_H + diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/dataTypes.h b/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/dataTypes.h new file mode 100644 index 0000000000000000000000000000000000000000..cba2b7341e2ad89ccdb8047d5fbb9628674e629e --- /dev/null +++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/dataTypes.h @@ -0,0 +1,33 @@ +#ifndef LMS_DATA_TYPES_H +#define LMS_DATA_TYPES_H + +typedef struct +{ + uint8_t reserved[8]; + uint64_t counter; + int16_t samples[2040]; +} PacketLTE; + +typedef struct +{ + int16_t i; + int16_t q; +} complex16_t; + +typedef struct +{ + uint64_t timestamp; //timestamp of the packet + uint16_t first; //index of first unused sample in samples[] + uint16_t last; //end index of samples + static const uint16_t samplesCount = 1024; //maximum number of samples in packet + complex16_t samples[samplesCount]; //must be power of two +} SamplesPacket; + +complex16_t operator &=(complex16_t & other1, const complex16_t & other) // copy assignment +{ + other1.i = other.i; + other1.q = other.q; + return other1; +} + +#endif \ No newline at end of file diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/fifo.h b/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/fifo.h new file mode 100644 index 0000000000000000000000000000000000000000..1868c64af71d1205e0aeb422c9ab9ea87635a747 --- /dev/null +++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/fifo.h @@ -0,0 +1,180 @@ +#ifndef LMS_FIFO_BUFFER_H +#define LMS_FIFO_BUFFER_H + +#include <mutex> +#include <atomic> +#include <vector> +#include <thread> +#include <condition_variable> +#include "dataTypes.h" + +class LMS_SamplesFIFO +{ +public: + struct BufferInfo + { + uint32_t size; + uint32_t itemsFilled; + }; + + BufferInfo GetInfo() + { + std::unique_lock<std::mutex> lck2(readLock); + std::unique_lock<std::mutex> lck(writeLock); + BufferInfo stats; + stats.size = (uint32_t)mBuffer.size(); + stats.itemsFilled = mElementsFilled.load(); + return stats; + } + + LMS_SamplesFIFO(uint32_t bufLength) + { + Reset(bufLength); + } + + ~LMS_SamplesFIFO(){}; + + /** @brief inserts items to ring buffer + @param buffer data source + @param itemCount number of buffer items to insert + @param timeout_ms timeout duration for operation + @param overwrite enable to overwrite oldest items inside the buffer + @return number of items added + */ + uint32_t push_packet(SamplesPacket *buffer, const uint32_t itemCount, const uint32_t timeout_ms, const bool overwrite = true) + { + uint32_t addedItems = 0; + std::unique_lock<std::mutex> lck(writeLock); + while (addedItems < itemCount) + { + while (mElementsFilled.load() >= mBuffer.size()) //wait for free space to insert items + { + if (canWrite.wait_for(lck, std::chrono::milliseconds(timeout_ms)) == std::cv_status::timeout) + return addedItems; //dropped all items + } + + uint32_t itemsToInsert = itemCount - addedItems; + uint32_t itemsToEnd = (uint32_t)mBuffer.size() - mTail.load(); //might need to split memcpy into two operations + if (itemsToInsert > itemsToEnd) + { + memcpy(&mBuffer[mTail], &buffer[addedItems], itemsToEnd*sizeof(SamplesPacket)); + memcpy(&mBuffer[0], &buffer[addedItems+itemsToEnd], (itemsToInsert - itemsToEnd)*sizeof(SamplesPacket)); + } + else + memcpy(&mBuffer[mTail], &buffer[addedItems], itemsToInsert*sizeof(SamplesPacket)); + mTail.store((mTail.load() + itemsToInsert) & (mBuffer.size() - 1)); + mElementsFilled.fetch_add(itemsToInsert); + canRead.notify_one(); + addedItems += itemsToInsert; + } + return addedItems; + } + + /** @brief inserts items to ring buffer + @param buffer data source + @param itemCount number of buffer items to insert + @param timeout_ms timeout duration for operation + @param overwrite enable to overwrite oldest items inside the buffer + @return number of items added + */ + uint32_t push_samples(const complex16_t *buffer, const uint32_t samplesCount, uint64_t timestamp, const uint32_t timeout_ms, const bool overwrite = true) + { + assert(buffer != nullptr); + const int samplesInPacket = SamplesPacket::samplesCount; + uint32_t samplesTaken = 0; + std::unique_lock<std::mutex> lck(writeLock); + while (samplesTaken < samplesCount) + { + while (mElementsFilled.load() >= mBuffer.size()) //buffer might be full, wait for free slots + { + if (canWrite.wait_for(lck, std::chrono::milliseconds(timeout_ms)) == std::cv_status::timeout) + return samplesTaken; + } + + int tailIndex = mTail.load(); //which element to fill + while (mElementsFilled.load() < mBuffer.size() && samplesTaken < samplesCount) // not to release lock too often + { + mBuffer[tailIndex].timestamp = timestamp + samplesTaken; + mBuffer[tailIndex].first = 0; + mBuffer[tailIndex].last = 0; + while (mBuffer[tailIndex].last < samplesInPacket && samplesTaken < samplesCount) + { + mBuffer[tailIndex].samples[mBuffer[tailIndex].last++] = buffer[samplesTaken++]; + } + mTail.store((tailIndex + 1) & (mBuffer.size() - 1));//advance to next one + tailIndex = mTail.load(); + mElementsFilled.fetch_add(1); + canRead.notify_one(); + } + } + return samplesTaken; + } + + /** @brief Takes items out of ring buffer + @param buffer data destination + @param samplesCount number of samples to pop + @param timestamp returns timestamp of the first sample in buffer + @param timeout_ms timeout duration for operation + @return number of samples returned + */ + uint32_t pop_samples(complex16_t* buffer, const uint32_t samplesCount, uint64_t *timestamp, const uint32_t timeout_ms) + { + assert(buffer != nullptr); + const int samplesInPacket = SamplesPacket::samplesCount; + uint32_t samplesFilled = 0; + *timestamp = 0; + std::unique_lock<std::mutex> lck(readLock); + while (samplesFilled < samplesCount) + { + while (mElementsFilled.load() == 0) //buffer might be empty, wait for packets + { + if (canRead.wait_for(lck, std::chrono::milliseconds(timeout_ms)) == std::cv_status::timeout) + return samplesFilled; + } + if(samplesFilled == 0) + *timestamp = mBuffer[mHead.load()].timestamp + mBuffer[mHead.load()].first; + + while(mElementsFilled.load() > 0 && samplesFilled < samplesCount) + { + int headIndex = mHead.load(); + while (mBuffer[headIndex].first < mBuffer[headIndex].last && samplesFilled < samplesCount) + { + buffer[samplesFilled++] = mBuffer[headIndex].samples[mBuffer[headIndex].first++]; + } + if (mBuffer[headIndex].first == mBuffer[headIndex].last) //packet depleated + { + mBuffer[headIndex].first = 0; + mBuffer[headIndex].last = 0; + mBuffer[headIndex].timestamp = 0; + mHead.store( (headIndex + 1) & (mBuffer.size() - 1) );//advance to next one + headIndex = mHead.load(); + mElementsFilled.fetch_sub(1); + canWrite.notify_one(); + } + } + } + return samplesFilled; + } + + void Reset(uint32_t bufLength) + { + std::unique_lock<std::mutex> lck(writeLock); + std::unique_lock<std::mutex> lck2(readLock); + mBuffer.resize(bufLength); + mHead.store(0); + mTail.store(0); + mElementsFilled.store(0); + } + +protected: + std::vector<SamplesPacket> mBuffer; + std::atomic<uint32_t> mHead; + std::atomic<uint32_t> mTail; + std::mutex writeLock; + std::mutex readLock; + std::atomic<uint32_t> mElementsFilled; + std::condition_variable canWrite; + std::condition_variable canRead; +}; + +#endif diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/ringBuffer.h b/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/ringBuffer.h new file mode 100644 index 0000000000000000000000000000000000000000..e4882f8924cf624b6554b6e04aa95898ff40d66d --- /dev/null +++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/ringBuffer.h @@ -0,0 +1,143 @@ +#ifndef LMS_RING_BUFFER_H +#define LMS_RING_BUFFER_H + +#include <mutex> +#include <atomic> +#include <vector> +#include <condition_variable> + +template<class T> +class RingBuffer +{ +public: + struct BufferInfo + { + uint32_t size; + uint32_t itemsFilled; + }; + + BufferInfo GetInfo() + { + unique_lock<mutex> lck(mLock); + BufferInfo stats; + stats.size = (uint32_t)mBuffer.size(); + stats.itemsFilled = mElementsFilled; + return stats; + } + + RingBuffer(uint32_t bufLength) + { + Reset(bufLength); + } + ~RingBuffer(){}; + + /** @brief inserts items to ring buffer + @param buffer data source + @param itemCount number of buffer items to insert + @param timeout_ms timeout duration for operation + @return number of items added + */ + uint32_t push_back(const T* buffer, const uint32_t itemCount, const uint32_t timeout_ms) + { + uint32_t addedItems = 0; + while (addedItems < itemCount) + { + unique_lock<mutex> lck(mLock); + while (mElementsFilled >= mBuffer.size()) //wait for free space to insert items + { + if (canWrite.wait_for(lck, std::chrono::milliseconds(timeout_ms)) == std::cv_status::timeout) + return addedItems; //dropped all items + } + + uint32_t itemsToInsert = itemCount - addedItems; + uint32_t itemsToEnd = (uint32_t)mBuffer.size() - mTail.load(); //might need to split memcpy into two operations + if (itemsToInsert > itemsToEnd) + { + memcpy(&mBuffer[mTail], &buffer[addedItems], itemsToEnd*sizeof(T)); + memcpy(&mBuffer[0], &buffer[addedItems+itemsToEnd], (itemsToInsert - itemsToEnd)*sizeof(T)); + } + else + memcpy(&mBuffer[mTail], &buffer[addedItems], itemsToInsert*sizeof(T)); + mTail.store((mTail.load() + itemsToInsert) & (mBuffer.size() - 1)); + mElementsFilled += itemsToInsert; + lck.unlock(); + canRead.notify_one(); + addedItems += itemsToInsert; + } + return addedItems; + } + + /** @brief Takes items out of ring buffer + @param buffer data destination + @param itemCount number of items to extract from ring buffer + @param timeout_ms timeout duration for operation + @return number of items returned + */ + uint32_t pop_front(T* buffer, const uint32_t itemCount, const uint32_t timeout_ms) + { + assert(buffer != nullptr); + uint32_t itemsTaken = 0; + T* destBuffer = buffer; + while (itemsTaken < itemCount) + { + unique_lock<mutex> lck(mLock); + while (mElementsFilled == 0) //buffer might be empty, wait for items + { + if (canRead.wait_for(lck, std::chrono::milliseconds(timeout_ms)) == std::cv_status::timeout) + return itemsTaken; + } + + unsigned int itemsToCopy = itemCount - itemsTaken; + if (itemsToCopy > mElementsFilled) + itemsToCopy = mElementsFilled; + unsigned int itemsToEnd = (uint32_t)mBuffer.size() - mHead.load(); //migth need to split memcpy into two operations + if (itemsToEnd < itemsToCopy) + { + memcpy(&destBuffer[itemsTaken], &mBuffer[mHead.load()], sizeof(T)*itemsToEnd); + memcpy(&destBuffer[itemsTaken+itemsToEnd], &mBuffer[0], sizeof(T)*(itemsToCopy - itemsToEnd)); + mHead.store((itemsToCopy - itemsToEnd) & (mBuffer.size() - 1)); + } + else + { + memcpy(&destBuffer[itemsTaken], &mBuffer[mHead.load()], sizeof(T)*itemsToCopy); + int headVal = mHead.load(); + int valueToStore = (headVal + itemsToCopy) & (mBuffer.size() - 1); + mHead.store(valueToStore); + headVal = mHead.load(); + } + mElementsFilled -= itemsToCopy; + lck.unlock(); + canWrite.notify_one(); + itemsTaken += itemsToCopy; + } + return itemsTaken; + } + + void Reset(uint32_t bufLength) + { + std::unique_lock<std::mutex> lck(mLock); + if (bufLength >= (uint32_t)(1 << 31)) + bufLength = (uint32_t)(1 << 31); + for (int i = 0; i < 32; ++i) + if ((1 << i) >= bufLength) + { + bufLength = (1 << i); + break; + } + mBuffer.resize(bufLength); + mHead.store(0); + mTail.store(0); + mElementsFilled = 0; + } + +protected: + std::vector<T> mBuffer; + std::atomic<uint32_t> mHead; + std::atomic<uint32_t> mTail; + std::mutex mLock; + uint32_t mElementsFilled; + std::condition_variable canWrite; + std::condition_variable canRead; +}; + +#endif diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp new file mode 100644 index 0000000000000000000000000000000000000000..3ca15c66602c7760a563df391de9a8ba2f09a453 --- /dev/null +++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp @@ -0,0 +1,879 @@ +/******************************************************************************* + OpenAirInterface + Copyright(c) 1999 - 2014 Eurecom + + OpenAirInterface is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + + OpenAirInterface is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with OpenAirInterface.The full GNU General Public License is + included in this distribution in the file called "COPYING". If not, + see <http://www.gnu.org/licenses/>. + + Contact Information + OpenAirInterface Admin: openair_admin@eurecom.fr + OpenAirInterface Tech : openair_tech@eurecom.fr + OpenAirInterface Dev : openair4g-devel@eurecom.fr + + Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE + + *******************************************************************************/ + + +#include <arpa/inet.h> +#include <linux/if_packet.h> +#include <stdio.h> +#include <string.h> +#include <stdlib.h> +#include <sys/ioctl.h> +#include <sys/socket.h> +#include <net/if.h> +#include <netinet/ether.h> +#include <unistd.h> +#include <errno.h> + +#include "common_lib.h" +#include "LMS_SDR.h" +#include "LMS7002M.h" +#include "Si5351C.h" +#include "LMS_StreamBoard.h" +#include "LMS7002M_RegistersMap.h" + +#include <cmath> + + +///define for parameter enumeration if prefix might be needed +#define LMS7param(id) id + +LMScomms* usbport; +LMScomms* comport; +LMS7002M* lms7; +Si5351C* Si; +LMS_StreamBoard *lmsStream; + +#define RXDCLENGTH 4096 +#define NUMBUFF 40 +int16_t cos_fsover8[8] = {2047, 1447, 0, -1448, -2047, -1448, 0, 1447}; +int16_t cos_3fsover8[8] = {2047, -1448, 0, 1447, -2047, 1447, 0, -1448}; + +extern "C" +{ +int write_output(const char *fname,const char *vname,void *data,int length,int dec,char format); +} + +int trx_lms_write(openair0_device *device, openair0_timestamp timestamp, void **buff, int nsamps, int antenna_id, int flags) { + + LMS_TRxWrite((int16_t*)buff[0], nsamps,0, timestamp); + + return nsamps; +} + + +int trx_lms_read(openair0_device *device, openair0_timestamp *ptimestamp, void **buff, int nsamps, int antenna_id) { + + uint64_t timestamp; + int16_t *dst_ptr = (int16_t*) buff[0]; + int ret; + ret = LMS_TRxRead(dst_ptr, nsamps,0,×tamp, 10); + *ptimestamp=timestamp; + + return ret; +} +void set_rx_gain_offset(openair0_config_t *openair0_cfg, int chain_index) { + + int i=0; + // loop through calibration table to find best adjustment factor for RX frequency + double min_diff = 6e9,diff; + + while (openair0_cfg->rx_gain_calib_table[i].freq>0) { + diff = fabs(openair0_cfg->rx_freq[chain_index] - openair0_cfg->rx_gain_calib_table[i].freq); + printf("cal %d: freq %f, offset %f, diff %f\n", + i, + openair0_cfg->rx_gain_calib_table[i].freq, + openair0_cfg->rx_gain_calib_table[i].offset,diff); + if (min_diff > diff) { + min_diff = diff; + openair0_cfg->rx_gain_offset[chain_index] = openair0_cfg->rx_gain_calib_table[i].offset; + } + i++; + } + +} +/* +void calibrate_rf(openair0_device *device) { + + openair0_timestamp ptimestamp; + int16_t *calib_buffp,*calib_tx_buffp; + int16_t calib_buff[2*RXDCLENGTH]; + int16_t calib_tx_buff[2*RXDCLENGTH]; + int i,j; + int8_t offI,offQ,offIold,offQold,offInew,offQnew,offphase,offphaseold,offphasenew,offgain,offgainold,offgainnew; + int32_t meanI,meanQ,meanIold,meanQold; + int cnt=0,loop; + liblms7_status opStatus; + int16_t dcoffi; + int16_t dcoffq; + int16_t dccorri; + int16_t dccorrq; + const int16_t firCoefs[] = + { + -2531, + -517, + 2708, + 188, + -3059, + 216, + 3569, + -770, + -4199, + 1541, + 4886, + -2577, + -5552, + 3909, + 6108, + -5537, + -6457, + 7440, + 6507, + -9566, + -6174, + 11845, + 5391, + -14179, + -4110, + 16457, + 2310, + -18561, + 0, + 20369, + -2780, + -21752, + 5963, + 22610, + -9456, + -22859, + 13127, + 22444, + -16854, + -21319, + 20489, + 19492, + -23883, + -17002, + 26881, + 13902, + -29372, + -10313, + 31226, + 6345, + -32380, + -2141, + 32767, + -2141, + -32380, + 6345, + 31226, + -10313, + -29372, + 13902, + 26881, + -17002, + -23883, + 19492, + 20489, + -21319, + -16854, + 22444, + 13127, + -22859, + -9456, + 22610, + 5963, + -21752, + -2780, + 20369, + 0, + -18561, + 2310, + 16457, + -4110, + -14179, + 5391, + 11845, + -6174, + -9566, + 6507, + 7440, + -6457, + -5537, + 6108, + 3909, + -5552, + -2577, + 4886, + 1541, + -4199, + -770, + 3569, + 216, + -3059, + 188, + 2708, + -517, + -2531 + }; + + j=0; + for (i=0;i<RXDCLENGTH;i++) { + calib_tx_buff[j++] = cos_fsover8[i&7]; + calib_tx_buff[j++] = cos_fsover8[(i+6)&7]; // sin + } + calib_buffp = &calib_buff[0]; + calib_tx_buffp = &calib_tx_buff[0]; + + lms7->BackupAllRegisters(); + uint8_t ch = (uint8_t)lms7->Get_SPI_Reg_bits(LMS7param(MAC)); + //Stage 1 + uint8_t sel_band1_trf = (uint8_t)lms7->Get_SPI_Reg_bits(LMS7param(SEL_BAND1_TRF)); + uint8_t sel_band2_trf = (uint8_t)lms7->Get_SPI_Reg_bits(LMS7param(SEL_BAND2_TRF)); + { + uint16_t requiredRegs[] = { 0x0400, 0x040A, 0x010D, 0x040C }; + uint16_t requiredMask[] = { 0x6000, 0x3007, 0x0040, 0x00FF }; //CAPSEL, AGC_MODE, AGC_AVG, EN_DCOFF, Bypasses + uint16_t requiredValue[] = { 0x0000, 0x1007, 0x0040, 0x00BD }; + + lms7->Modify_SPI_Reg_mask(requiredRegs, requiredMask, requiredValue, 0, 3); + } + + // opStatus = lms7->SetFrequencySX(LMS7002M::Rx, device->openair0_cfg[0].tx_freq[0]/1e6,30.72); + // put TX on fs/4 + opStatus = lms7->CalibrateRxSetup(device->openair0_cfg[0].sample_rate/1e6); + if (opStatus != LIBLMS7_SUCCESS) { + printf("Cannot calibrate for %f MHz\n",device->openair0_cfg[0].sample_rate/1e6); + exit(-1); + } + // fill TX buffer with fs/8 complex sinusoid + offIold=offQold=64; + lms7->SetRxDCOFF(offIold,offQold); + LMS_RxStart(); + for (i=0;i<NUMBUFF;i++) + trx_lms_read(device, &ptimestamp, (void **)&calib_buffp, RXDCLENGTH, 0); + + for (meanIold=meanQold=i=j=0;i<RXDCLENGTH;i++) { + meanIold+=calib_buff[j++]; + meanQold+=calib_buff[j++]; + } + meanIold/=RXDCLENGTH; + meanQold/=RXDCLENGTH; + printf("[LMS] RX DC: (%d,%d) => (%d,%d)\n",offIold,offQold,meanIold,meanQold); + + offI=offQ=-64; + lms7->SetRxDCOFF(offI,offQ); + + for (i=0;i<NUMBUFF;i++) + trx_lms_read(device, &ptimestamp, (void **)&calib_buffp, RXDCLENGTH, 0); + + for (meanI=meanQ=i=j=0;i<RXDCLENGTH;i++) { + meanI+=calib_buff[j++]; + meanQ+=calib_buff[j++]; + } + meanI/=RXDCLENGTH; + meanQ/=RXDCLENGTH; + printf("[LMS] RX DC: (%d,%d) => (%d,%d)\n",offI,offQ,meanI,meanQ); + + while (cnt++ < 7) { + + offInew=(offIold+offI)>>1; + offQnew=(offQold+offQ)>>1; + + if (meanI*meanI < meanIold*meanIold) { + meanIold = meanI; + offIold = offI; + printf("[LMS] *** RX DC: offI %d => %d\n",offIold,meanI); + } + if (meanQ*meanQ < meanQold*meanQold) { + meanQold = meanQ; + offQold = offQ; + printf("[LMS] *** RX DC: offQ %d => %d\n",offQold,meanQ); + } + offI = offInew; + offQ = offQnew; + + lms7->SetRxDCOFF(offI,offQ); + + for (i=0;i<NUMBUFF;i++) + trx_lms_read(device, &ptimestamp, (void **)&calib_buffp, RXDCLENGTH, 0); + + for (meanI=meanQ=i=j=0;i<RXDCLENGTH;i++) { + meanI+=calib_buff[j++]; + meanQ+=calib_buff[j++]; + } + meanI/=RXDCLENGTH; + meanQ/=RXDCLENGTH; + printf("[LMS] RX DC: (%d,%d) => (%d,%d)\n",offI,offQ,meanI,meanQ); + } + + if (meanI*meanI < meanIold*meanIold) { + meanIold = meanI; + offIold = offI; + printf("[LMS] *** RX DC: offI %d => %d\n",offIold,meanI); + } + if (meanQ*meanQ < meanQold*meanQold) { + meanQold = meanQ; + offQold = offQ; + printf("[LMS] *** RX DC: offQ %d => %d\n",offQold,meanQ); + } + + printf("[LMS] RX DC: (%d,%d) => (%d,%d)\n",offIold,offQold,meanIold,meanQold); + + lms7->SetRxDCOFF(offIold,offQold); + + dcoffi = offIold; + dcoffq = offQold; + + lms7->Modify_SPI_Reg_bits(LMS7param(MAC), ch); + lms7->Modify_SPI_Reg_bits(LMS7param(AGC_MODE_RXTSP), 1); + lms7->Modify_SPI_Reg_bits(LMS7param(CAPSEL), 0); + + // TX LO leakage + offQold=offIold=127; + lms7->SPI_write(0x0204,(((int16_t)offIold)<<7)|offQold); + + { + uint16_t requiredRegs[] = { 0x0400, 0x040A, 0x010D, 0x040C }; + uint16_t requiredMask[] = { 0x6000, 0x3007, 0x0040, 0x00FF }; //CAPSEL, AGC_MODE, AGC_AVG, EN_DCOFF, Bypasses + uint16_t requiredValue[] = { 0x0000, 0x1007, 0x0040, 0x00BD }; + + lms7->Modify_SPI_Reg_mask(requiredRegs, requiredMask, requiredValue, 0, 3); + } + sel_band1_trf = (uint8_t)lms7->Get_SPI_Reg_bits(LMS7param(SEL_BAND1_TRF)); + sel_band2_trf = (uint8_t)lms7->Get_SPI_Reg_bits(LMS7param(SEL_BAND2_TRF)); + //B + lms7->Modify_SPI_Reg_bits(0x0100, 0, 0, 1); //EN_G_TRF 1 + if (sel_band1_trf == 1) + { + lms7->Modify_SPI_Reg_bits(LMS7param(PD_RLOOPB_1_RFE), 0); //PD_RLOOPB_1_RFE 0 + lms7->Modify_SPI_Reg_bits(LMS7param(EN_INSHSW_LB1_RFE), 0); //EN_INSHSW_LB1 0 + } + if (sel_band2_trf == 1) + { + lms7->Modify_SPI_Reg_bits(LMS7param(PD_RLOOPB_2_RFE), 0); //PD_RLOOPB_2_RFE 0 + lms7->Modify_SPI_Reg_bits(LMS7param(EN_INSHSW_LB2_RFE), 0); // EN_INSHSW_LB2 0 + } + // FixRXSaturation(); + + lms7->Modify_SPI_Reg_bits(LMS7param(GFIR3_BYP_RXTSP), 0); //GFIR3_BYP 0 + lms7->Modify_SPI_Reg_bits(LMS7param(HBD_OVR_RXTSP), 2); + lms7->Modify_SPI_Reg_bits(LMS7param(GFIR3_L_RXTSP), 7); + lms7->Modify_SPI_Reg_bits(LMS7param(GFIR3_N_RXTSP), 7); + + lms7->SetGFIRCoefficients(LMS7002M::Rx, 2, firCoefs, sizeof(firCoefs) / sizeof(int16_t)); + + for (i=0;i<NUMBUFF;i++) { + trx_lms_read(device, &ptimestamp, (void **)&calib_buffp, RXDCLENGTH, 0); + trx_lms_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0, 0); + } + + write_output("calibrx.m","rxs",calib_buffp,RXDCLENGTH,1,1); + exit(-1); + for (meanIold=meanQold=i=j=0;i<RXDCLENGTH;i++) { + switch (i&3) { + case 0: + meanIold+=calib_buff[j++]; + break; + case 1: + meanQold+=calib_buff[j++]; + break; + case 2: + meanIold-=calib_buff[j++]; + break; + case 3: + meanQold-=calib_buff[j++]; + break; + } + } + // meanIold/=RXDCLENGTH; + // meanQold/=RXDCLENGTH; + printf("[LMS] TX DC (offI): %d => (%d,%d)\n",offIold,meanIold,meanQold); + + offI=-128; + lms7->SPI_write(0x0204,(((int16_t)offI)<<7)|offQold); + + for (i=0;i<NUMBUFF;i++) { + trx_lms_read(device, &ptimestamp, (void **)&calib_buffp, RXDCLENGTH, 0); + trx_lms_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0, 0); + } + + for (meanI=meanQ=i=j=0;i<RXDCLENGTH;i++) { + switch (i&3) { + case 0: + meanI+=calib_buff[j++]; + break; + case 1: + meanQ+=calib_buff[j++]; + break; + case 2: + meanI-=calib_buff[j++]; + break; + case 3: + meanQ-=calib_buff[j++]; + break; + } + } + // meanI/=RXDCLENGTH; + // meanQ/=RXDCLENGTH; + printf("[LMS] TX DC (offI): %d => (%d,%d)\n",offI,meanI,meanQ); + cnt = 0; + while (cnt++ < 8) { + + offInew=(offIold+offI)>>1; + if (meanI*meanI+meanQ*meanQ < meanIold*meanIold +meanQold*meanQold) { + printf("[LMS] TX DC (offI): ([%d,%d]) => %d : %d\n",offIold,offI,offInew,meanI*meanI+meanQ*meanQ); + meanIold = meanI; + meanQold = meanQ; + offIold = offI; + } + offI = offInew; + lms7->SPI_write(0x0204,(((int16_t)offI)<<7)|offQold); + + for (i=0;i<NUMBUFF;i++) { + trx_lms_read(device, &ptimestamp, (void **)&calib_buffp, RXDCLENGTH, 0); + trx_lms_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0, 0); + } + + for (meanI=meanQ=i=j=0;i<RXDCLENGTH;i++) { + switch (i&3) { + case 0: + meanI+=calib_buff[j++]; + break; + case 1: + meanQ+=calib_buff[j++]; + break; + case 2: + meanI-=calib_buff[j++]; + break; + case 3: + meanQ-=calib_buff[j++]; + break; + } + } + // meanI/=RXDCLENGTH; + // meanQ/=RXDCLENGTH; + // printf("[LMS] TX DC (offI): %d => (%d,%d)\n",offI,meanI,meanQ); + } + + + if (meanI*meanI+meanQ*meanQ < meanIold*meanIold +meanQold*meanQold) { + printf("[LMS] TX DC (offI): ([%d,%d]) => %d : %d\n",offIold,offI,offInew,meanI*meanI+meanQ*meanQ); + meanIold = meanI; + meanQold = meanQ; + offIold = offI; + } + offQ=-128; + lms7->SPI_write(0x0204,(((int16_t)offIold)<<7)|offQ); + + for (i=0;i<NUMBUFF;i++) { + trx_lms_read(device, &ptimestamp, (void **)&calib_buffp, RXDCLENGTH, 0); + trx_lms_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0, 0); + } + + for (meanI=meanQ=i=j=0;i<RXDCLENGTH;i++) { + switch (i&3) { + case 0: + meanI+=calib_buff[j++]; + break; + case 1: + meanQ+=calib_buff[j++]; + break; + case 2: + meanI-=calib_buff[j++]; + break; + case 3: + meanQ-=calib_buff[j++]; + break; + } + } + // meanI/=RXDCLENGTH; + // meanQ/=RXDCLENGTH; + printf("[LMS] TX DC (offQ): %d => (%d,%d)\n",offQ,meanI,meanQ); + + cnt=0; + while (cnt++ < 8) { + + offQnew=(offQold+offQ)>>1; + if (meanI*meanI+meanQ*meanQ < meanIold*meanIold +meanQold*meanQold) { + printf("[LMS] TX DC (offQ): ([%d,%d]) => %d : %d\n",offQold,offQ,offQnew,meanI*meanI+meanQ*meanQ); + + meanIold = meanI; + meanQold = meanQ; + offQold = offQ; + } + offQ = offQnew; + lms7->SPI_write(0x0204,(((int16_t)offIold)<<7)|offQ); + + + for (i=0;i<NUMBUFF;i++) { + trx_lms_read(device, &ptimestamp, (void **)&calib_buffp, RXDCLENGTH, 0); + trx_lms_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0, 0); + } + + for (meanI=meanQ=i=j=0;i<RXDCLENGTH;i++) { + switch (i&3) { + case 0: + meanI+=calib_buff[j++]; + break; + case 1: + meanQ+=calib_buff[j++]; + break; + case 2: + meanI-=calib_buff[j++]; + break; + case 3: + meanQ-=calib_buff[j++]; + break; + } + } + // meanI/=RXDCLENGTH; + // meanQ/=RXDCLENGTH; + // printf("[LMS] TX DC (offQ): %d => (%d,%d)\n",offQ,meanI,meanQ); + } + + LMS_RxStop(); + + printf("[LMS] TX DC: (%d,%d) => (%d,%d)\n",offIold,offQold,meanIold,meanQold); + + dccorri = offIold; + dccorrq = offQold; + + + lms7->RestoreAllRegisters(); + lms7->Modify_SPI_Reg_bits(LMS7param(MAC), ch); + + lms7->Modify_SPI_Reg_bits(LMS7param(DCOFFI_RFE), dcoffi); + lms7->Modify_SPI_Reg_bits(LMS7param(DCOFFQ_RFE), dcoffq); + lms7->Modify_SPI_Reg_bits(LMS7param(DCCORRI_TXTSP), dccorri); + lms7->Modify_SPI_Reg_bits(LMS7param(DCCORRQ_TXTSP), dccorrq); + // lms7->Modify_SPI_Reg_bits(LMS7param(GCORRI_TXTSP), gcorri); + // lms7->Modify_SPI_Reg_bits(LMS7param(GCORRQ_TXTSP), gcorrq); + // lms7->Modify_SPI_Reg_bits(LMS7param(IQCORR_TXTSP), iqcorr); + + // lms7->Modify_SPI_Reg_bits(LMS7param(DC_BYP_TXTSP), 0); //DC_BYP + lms7->Modify_SPI_Reg_bits(0x0208, 1, 0, 0); //GC_BYP PH_BYP + +} +*/ + +int trx_lms_set_gains(openair0_device* device, openair0_config_t *openair0_cfg) { + + double gv = openair0_cfg[0].rx_gain[0] - openair0_cfg[0].rx_gain_offset[0]; + + if (gv > 31) { + printf("RX Gain 0 too high, reduce by %f dB\n",gv-31); + gv = 31; + } + if (gv < 0) { + printf("RX Gain 0 too low, increase by %f dB\n",-gv); + gv = 0; + } + printf("[LMS] Setting 7002M G_PGA_RBB to %d\n", (int16_t)gv); + lms7->Modify_SPI_Reg_bits(LMS7param(G_PGA_RBB),(int16_t)gv); + + return(0); +} + +int trx_lms_start(openair0_device *device){ + + + LMS_Init(0, 128*1024); + usbport = LMS_GetUSBPort(); + //connect data stream port + LMS_UpdateDeviceList(usbport); + const char *name = LMS_GetDeviceName(usbport, 0); + printf("Connecting to device: %s\n",name); + + + + if (LMS_DeviceOpen(usbport, 0)==0) + { + Si = new Si5351C(); + lms7 = new LMS7002M(usbport); + liblms7_status opStatus; + + printf("Configuring Si5351C\n"); + Si->Initialize(usbport); + Si->SetPLL(0, 25000000, 0); + Si->SetPLL(1, 25000000, 0); + Si->SetClock(0, 27000000, true, false); + Si->SetClock(1, 27000000, true, false); + for (int i = 2; i < 8; ++i) + Si->SetClock(i, 27000000, false, false); + Si5351C::Status status = Si->ConfigureClocks(); + if (status != Si5351C::SUCCESS) + { + printf("Failed to configure Si5351C"); + exit(-1); + } + status = Si->UploadConfiguration(); + if (status != Si5351C::SUCCESS) + printf("Failed to upload Si5351C configuration"); + + + + lms7->ResetChip(); + + opStatus = lms7->LoadConfig(device->openair0_cfg[0].configFilename); + + if (opStatus != LIBLMS7_SUCCESS) { + printf("Failed to load configuration file %s\n",device->openair0_cfg[0].configFilename); + exit(-1); + } + opStatus = lms7->UploadAll(); + + if (opStatus != LIBLMS7_SUCCESS) { + printf("Failed to upload configuration file\n"); + exit(-1); + } + + // Set TX filter + + printf("Tuning TX filter\n"); + opStatus = lms7->TuneTxFilter(LMS7002M::TxFilter::TX_HIGHBAND,device->openair0_cfg[0].tx_bw/1e6); + + if (opStatus != LIBLMS7_SUCCESS) { + printf("Warning: Could not tune TX filter to %f MHz\n",device->openair0_cfg[0].tx_bw/1e6); + } + + printf("Tuning RX filter\n"); + + opStatus = lms7->TuneRxFilter(LMS7002M::RxFilter::RX_LPF_LOWBAND,device->openair0_cfg[0].rx_bw/1e6); + + if (opStatus != LIBLMS7_SUCCESS) { + printf("Warning: Could not tune RX filter to %f MHz\n",device->openair0_cfg[0].rx_bw/1e6); + } + + /* printf("Tuning TIA filter\n"); + opStatus = lms7->TuneRxFilter(LMS7002M::RxFilter::RX_TIA,7.0); + + if (opStatus != LIBLMS7_SUCCESS) { + printf("Warning: Could not tune RX TIA filter\n"); + }*/ + + opStatus = lms7->SetInterfaceFrequency(lms7->GetFrequencyCGEN_MHz(), + lms7->Get_SPI_Reg_bits(HBI_OVR_TXTSP), + lms7->Get_SPI_Reg_bits(HBD_OVR_RXTSP)); + if (opStatus != LIBLMS7_SUCCESS) { + printf("SetInterfaceFrequency failed: %f,%d,%d\n", + lms7->GetFrequencyCGEN_MHz(), + lms7->Get_SPI_Reg_bits(HBI_OVR_TXTSP), + lms7->Get_SPI_Reg_bits(HBD_OVR_RXTSP)); + } + else { + printf("SetInterfaceFrequency as %f,%d,%d\n", + lms7->GetFrequencyCGEN_MHz(), + lms7->Get_SPI_Reg_bits(HBI_OVR_TXTSP), + lms7->Get_SPI_Reg_bits(HBD_OVR_RXTSP)); + } + lmsStream = new LMS_StreamBoard(usbport); + LMS_StreamBoard::Status opStreamStatus; + // this will configure that sampling rate at output of FPGA + opStreamStatus = lmsStream->ConfigurePLL(usbport, + device->openair0_cfg[0].sample_rate, + device->openair0_cfg[0].sample_rate,90); + if (opStatus != LIBLMS7_SUCCESS){ + printf("Sample rate programming failed\n"); + exit(-1); + } + + opStatus = lms7->SetFrequencySX(LMS7002M::Tx, device->openair0_cfg[0].tx_freq[0]/1e6,30.72); + + if (opStatus != LIBLMS7_SUCCESS) { + printf("Cannot set TX frequency %f MHz\n",device->openair0_cfg[0].tx_freq[0]/1e6); + exit(-1); + } + else { + printf("Set TX frequency %f MHz\n",device->openair0_cfg[0].tx_freq[0]/1e6); + } + opStatus = lms7->SetFrequencySX(LMS7002M::Rx, device->openair0_cfg[0].rx_freq[0]/1e6,30.72); + + if (opStatus != LIBLMS7_SUCCESS) { + printf("Cannot set RX frequency %f MHz\n",device->openair0_cfg[0].rx_freq[0]/1e6); + exit(-1); + } + else { + printf("Set RX frequency %f MHz\n",device->openair0_cfg[0].rx_freq[0]/1e6); + } + + trx_lms_set_gains(device, device->openair0_cfg); + // Run calibration procedure + // calibrate_rf(device); + //lms7->CalibrateTx(5.0); + LMS_RxStart(); + } + else + { + return(-1); + } + + //connect control port + + /* comport = LMS_GetCOMPort(); + LMS_UpdateDeviceList(comport); + name = LMS_GetDeviceName(comport, 0); + if (*name == 0) + comport = usbport; //attempt to use data port + else + { + printf("Connecting to device: %s\n",name); + if (LMS_DeviceOpen(comport, 0)!=0) + return (-1); + } + lms7 = new LMS7002M(comport); + if( access( "./config.ini", F_OK ) != -1 ) //load config file + lms7->LoadConfig("./config.ini"); + //calibration takes too long + //lms7->CalibrateRx(5.0); + //lms7->CalibrateTx(5.0); + */ + + return 0; +} + + +int trx_lms_stop(int card) { + /* + LMS_DeviceClose(usbport); + LMS_DeviceClose(comport); + delete lms7; + return LMS_Destroy(); + */ +} + +int trx_lms_set_freq(openair0_device* device, openair0_config_t *openair0_cfg,int exmimo_dump_config) { + //Control port must be connected + + lms7->SetFrequencySX(LMS7002M::Tx,openair0_cfg->tx_freq[0]/1e6,30.72); + lms7->SetFrequencySX(LMS7002M::Rx,openair0_cfg->rx_freq[0]/1e6,30.72); + printf ("[LMS] rx frequency:%f;\n",openair0_cfg->rx_freq[0]/1e6); + set_rx_gain_offset(openair0_cfg,0); + return(0); + +} + +// 31 = 19 dB => 105 dB total gain @ 2.6 GHz +rx_gain_calib_table_t calib_table_sodera[] = { + {3500000000.0,70.0}, + {2660000000.0,80.0}, + {2300000000.0,80.0}, + {1880000000.0,74.0}, // on W PAD + {816000000.0,76.0}, // on W PAD + {-1,0}}; + + + + + + + +int trx_lms_get_stats(openair0_device* device) { + + return(0); + +} + +int trx_lms_reset_stats(openair0_device* device) { + + return(0); + +} + +int openair0_set_gains(openair0_device* device, + openair0_config_t *openair0_cfg) { + + return(0); +} + +int openair0_set_frequencies(openair0_device* device, openair0_config_t *openair0_cfg, int dummy) { + + return(0); +} + + + +void trx_lms_end(openair0_device *device) { + + +} + +extern "C" { +/*! \brief Initialize Openair LMSSDR target. It returns 0 if OK +* \param device the hardware to use +* \param openair0_cfg RF frontend parameters set by application +*/ +int device_init(openair0_device *device, openair0_config_t *openair0_cfg){ + + device->type=LMSSDR_DEV; + printf("LMSSDR: Initializing openair0_device for %s ...\n", ((device->host_type == BBU_HOST) ? "BBU": "RRH")); + + switch ((int)openair0_cfg[0].sample_rate) { + case 30720000: + // from usrp_time_offset + openair0_cfg[0].samples_per_packet = 2048; + openair0_cfg[0].tx_sample_advance = 15; + openair0_cfg[0].tx_bw = 30.72e6; + openair0_cfg[0].rx_bw = 30.72e6; + openair0_cfg[0].tx_scheduling_advance = 8*openair0_cfg[0].samples_per_packet; + break; + case 15360000: + openair0_cfg[0].samples_per_packet = 2048; + openair0_cfg[0].tx_sample_advance = 45; + openair0_cfg[0].tx_bw = 28e6; + openair0_cfg[0].rx_bw = 10e6; + openair0_cfg[0].tx_scheduling_advance = 8*openair0_cfg[0].samples_per_packet; + break; + case 7680000: + openair0_cfg[0].samples_per_packet = 1024; + openair0_cfg[0].tx_sample_advance = 70; + openair0_cfg[0].tx_bw = 28e6; + openair0_cfg[0].rx_bw = 5.0e6; + openair0_cfg[0].tx_scheduling_advance = 8*openair0_cfg[0].samples_per_packet; + break; + case 1920000: + openair0_cfg[0].samples_per_packet = 256; + openair0_cfg[0].tx_sample_advance = 50; + openair0_cfg[0].tx_bw = 1.25e6; + openair0_cfg[0].rx_bw = 1.25e6; + openair0_cfg[0].tx_scheduling_advance = 8*openair0_cfg[0].samples_per_packet; + break; + default: + printf("Error: unknown sampling rate %f\n",openair0_cfg[0].sample_rate); + exit(-1); + break; + } + + openair0_cfg[0].rx_gain_calib_table = calib_table_sodera; + set_rx_gain_offset(openair0_cfg,0); + + device->Mod_id = 1; + device->trx_start_func = trx_lms_start; + device->trx_write_func = trx_lms_write; + device->trx_read_func = trx_lms_read; + device->trx_get_stats_func = trx_lms_get_stats; + device->trx_reset_stats_func = trx_lms_reset_stats; + device->trx_end_func = trx_lms_end; + device->trx_stop_func = trx_lms_stop; + device->trx_set_freq_func = trx_lms_set_freq; + device->trx_set_gains_func = trx_lms_set_gains; + + device->openair0_cfg = openair0_cfg; + + return 0; +} +} diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/sodera_lib.cpp b/targets/ARCH/LMSSDR/USERSPACE/LIB/sodera_lib.cpp new file mode 100644 index 0000000000000000000000000000000000000000..30a2106b340b047c98942b5818bc547930b95166 --- /dev/null +++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/sodera_lib.cpp @@ -0,0 +1,723 @@ +/******************************************************************************* + OpenAirInterface + Copyright(c) 1999 - 2014 Eurecom + + OpenAirInterface is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + + OpenAirInterface is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with OpenAirInterface.The full GNU General Public License is + included in this distribution in the file called "COPYING". If not, + see <http://www.gnu.org/licenses/>. + + Contact Information + OpenAirInterface Admin: openair_admin@eurecom.fr + OpenAirInterface Tech : openair_tech@eurecom.fr + OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr + + Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE + + *******************************************************************************/ + +/** sodera_lib.c + * + * Author: Raymond Knopp + */ + +#include <vector> +#include <string> +#include <stdio.h> +#include <stdlib.h> +#include <inttypes.h> +#include <string.h> +#include <pthread.h> +#include <unistd.h> + + +#include <iostream> +#include <complex> +#include <fstream> +#include <cmath> + +#include "common_lib.h" + +#include "lmsComms.h" +#include "LMS7002M.h" +#include "Si5351C.h" +#include "LMS_StreamBoard.h" + +#ifdef __SSE4_1__ +# include <smmintrin.h> +#endif + +#ifdef __AVX2__ +# include <immintrin.h> +#endif + +using namespace std; + +int num_devices=0; +/*These items configure the underlying asynch stream used by the the sync interface. + */ + +#define BUFFERSIZE 4096 +#define BUFFERSCOUNT 32 +typedef struct +{ + + // -------------------------------- + // variables for SoDeRa configuration + // -------------------------------- + + LMScomms Port; + Si5351C Si; + LMS7002M lmsControl; + LMS_StreamBoard *lmsStream; + + char buffers_rx[BUFFERSIZE*BUFFERSCOUNT]; + int handles[BUFFERSCOUNT]; + int current_handle; + int samples_left_buffer; + + double sample_rate; + // time offset between transmiter timestamp and receiver timestamp; + double tdiff; + + int channelscount; + // -------------------------------- + // Debug and output control + // -------------------------------- + int num_underflows; + int num_overflows; + int num_seq_errors; + + int64_t tx_count; + int64_t rx_count; + openair0_timestamp rx_timestamp; + +} sodera_t; + +typedef struct { + uint8_t reserved[8]; + uint64_t counter; + char data[4080]; +} StreamPacket_t; + +sodera_t sodera_state; + +enum STATUS { + SUCCESS, + FAILURE +}; + +STATUS SPI_write(LMScomms* dataPort, uint16_t address, uint16_t data) +{ + assert(dataPort != nullptr); + LMScomms::GenericPacket ctrPkt; + ctrPkt.cmd = CMD_BRDSPI_WR; + ctrPkt.outBuffer.push_back((address >> 8) & 0xFF); + ctrPkt.outBuffer.push_back(address & 0xFF); + ctrPkt.outBuffer.push_back((data >> 8) & 0xFF); + ctrPkt.outBuffer.push_back(data & 0xFF); + dataPort->TransferPacket(ctrPkt); + return ctrPkt.status == 1 ? SUCCESS : FAILURE; +} + +uint16_t SPI_read(LMScomms* dataPort, uint16_t address) +{ + assert(dataPort != nullptr); + LMScomms::GenericPacket ctrPkt; + ctrPkt.cmd = CMD_BRDSPI_RD; + ctrPkt.outBuffer.push_back((address >> 8) & 0xFF); + ctrPkt.outBuffer.push_back(address & 0xFF); + dataPort->TransferPacket(ctrPkt); + if (ctrPkt.inBuffer.size() > 4) + return ctrPkt.inBuffer[2] * 256 + ctrPkt.inBuffer[3]; + else + return 0; +} + +static int trx_sodera_start(openair0_device *device) +{ + sodera_t *s = (sodera_t*)device->priv; + + + // init recv and send streaming + + printf("Starting LMS Streaming\n"); + s->rx_count = 0; + s->tx_count = 0; + s->rx_timestamp = 0; + s->current_handle = 0; + + // switch off RX + uint16_t regVal = SPI_read(&s->Port,0x0005); + SPI_write(&s->Port,0x0005,regVal & ~0x6); + + + + + + + // USB FIFO reset + LMScomms::GenericPacket ctrPkt; + ctrPkt.cmd = CMD_USB_FIFO_RST; + ctrPkt.outBuffer.push_back(0x01); + s->Port.TransferPacket(ctrPkt); + ctrPkt.outBuffer[0]=0x00; + s->Port.TransferPacket(ctrPkt); + + regVal = SPI_read(&s->Port,0x0005); + // provide timestamp, set streamTXEN, set TX/RX enable + SPI_write(&s->Port,0x0005,(regVal & ~0x20) | 0x6); + + + if (s->channelscount==2) { + SPI_write(&s->Port,0x0001,0x0003); + SPI_write(&s->Port,0x0007,0x000A); + } + else { + SPI_write(&s->Port,0x0001,0x0001); + SPI_write(&s->Port,0x0007,0x0008); + } + + + for (int i=0; i< BUFFERSCOUNT ; i++) + s->handles[i] = s->Port.BeginDataReading(&s->buffers_rx[i*BUFFERSIZE],BUFFERSIZE); + printf("Armed %d transfers\n",BUFFERSCOUNT); + return 0; +} + +static void trx_sodera_end(openair0_device *device) +{ + sodera_t *s = (sodera_t*)device->priv; + + + // stop TX/RX if they were active + uint16_t regVal = SPI_read(&s->Port,0x0005); + SPI_write(&s->Port,0x0005,regVal & ~0x6); + +} + +static int trx_sodera_write(openair0_device *device, openair0_timestamp timestamp, void **buff, int nsamps, int cc, int flags) +{ + sodera_t *s = (sodera_t*)device->priv; + + + return 0; +} + +#define DEBUG_READ 1 + +static int trx_sodera_read(openair0_device *device, openair0_timestamp *ptimestamp, void **buff, int nsamps, int cc) +{ + sodera_t *s = (sodera_t*)device->priv; + int samples_received=0,i,j; + int nsamps2; // aligned to upper 32 or 16 byte boundary + StreamPacket_t *p; + int16_t sampleI,sampleQ; + char *pktStart; + int offset = 0; + int num_p; + int ind=0; + int buffsize; + int spp; + int bufindex; + + // this assumes that each request is of size 4096 bytes (spp = 4080/4/channelscount) + spp = sizeof(p->data)>>2; // spp = size of payload in samples + spp /= s->channelscount; + +#ifdef DEBUG_READ + printf("\nIn trx_read\n"); + printf("s->current_handle %d\n", s->current_handle); + printf("s->samples_left_buffer %d\n",s->samples_left_buffer); +#endif + // first get rid of remaining samples + if (s->samples_left_buffer > 0) { + buffsize = min(s->samples_left_buffer,nsamps); + pktStart = ((StreamPacket_t*)&s->buffers_rx[s->current_handle*BUFFERSIZE])->data; + pktStart += (spp-s->samples_left_buffer); + const int stepSize = s->channelscount * 3; + + for (int b=0;b<buffsize<<2;b+=stepSize) { + for (int ch=0;ch<s->channelscount;ch++) { + // I sample + sampleI = (pktStart[b + 1 + 3*ch]&0x0F)<<8; + sampleI |= (pktStart[b + 3*ch]&0xFF); + sampleI = (sampleI<<4)>>4; + // Q sample + sampleQ = (pktStart[b + 2 + 3*ch]&0x0F)<<8; + sampleQ |= (pktStart[b + 1 + 3*ch]&0xFF); + sampleQ = (sampleQ<<4)>>4; + ((uint32_t*)buff[ch])[ind] = ((uint32_t)sampleI) | (((uint32_t)sampleQ)<<16); + } + ind++; + } + } + if (ind == nsamps) { + s->samples_left_buffer -= nsamps; + s->rx_count += nsamps; + *ptimestamp = s->rx_timestamp; + s->rx_timestamp+=nsamps; + + return(nsamps); + } + else { + s->samples_left_buffer = 0; + nsamps -= ind; + samples_received = ind; + } + + // This is for the left-over part => READ from USB + + + + num_p = nsamps / spp; + if ((nsamps%spp) > 0) + num_p++; + s->samples_left_buffer = (num_p*spp)-nsamps; + + +#ifdef DEBUG_READ + printf("num_p %d\n",num_p); +#endif + const int stepSize = s->channelscount * 3; + + for (i=0;i<num_p;i++) { + + bufindex = (s->current_handle+i)&(BUFFERSCOUNT-1); + if (s->Port.WaitForReading(s->handles[bufindex],1000) == false) { + printf("[recv] Error: request %d samples (%d/%d) WaitForReading timed out\n",nsamps,bufindex,num_p); + *ptimestamp = s->rx_timestamp; + s->rx_timestamp+=samples_received; + return(samples_received); + } + long bytesToRead=BUFFERSIZE; + if (s->Port.FinishDataReading(&s->buffers_rx[bufindex*BUFFERSIZE],bytesToRead,s->handles[bufindex]) != BUFFERSIZE) { + printf("[recv] Error: request %d samples (%d/%d) WaitForReading timed out\n",nsamps,bufindex,num_p); + *ptimestamp = s->rx_timestamp; + s->rx_timestamp+=samples_received; + return(samples_received); + } + + p = (StreamPacket_t*)&s->buffers_rx[bufindex*BUFFERSIZE]; + // handle timestamp + if ((i==0) & (ind==0)) { // grab the timestamp from HW + *ptimestamp = p->counter; + s->rx_timestamp = p->counter+nsamps; // for next time +#ifdef DEBUG_READ + printf("RX timestamp %d\n",s->rx_timestamp); +#endif + } + else { // check the timestamp + if (i==0) { + if ((s->rx_timestamp + ind) != p->counter) { + printf("Error, RX timestamp error, got %llu, should be %llu\n",p->counter,s->rx_timestamp+ind); + return(ind); + } + } + *ptimestamp = s->rx_timestamp; + s->rx_timestamp+=nsamps; + } + pktStart = p->data; + for (uint16_t b=0;b<sizeof(p->data);b+=stepSize) { + for (int ch=0;ch < s->channelscount;ch++) { + // I sample + sampleI = (pktStart[b + 1 + 3*ch]&0x0F)<<8; + sampleI |= (pktStart[b + 3*ch]&0xFF); + sampleI = (sampleI<<4)>>4; + // Q sample + sampleQ = (pktStart[b + 2 + 3*ch]&0x0F)<<8; + sampleQ |= (pktStart[b + 1 + 3*ch]&0xFF); + sampleQ = (sampleQ<<4)>>4; + ((uint32_t*)buff[ch])[ind] = ((uint32_t)sampleI) | (((uint32_t)sampleQ)<<16); + } + ind++; + } + samples_received+=spp; + // schedule a new transmission for this index + s->handles[bufindex] = s->Port.BeginDataReading(&s->buffers_rx[bufindex*BUFFERSIZE],BUFFERSIZE); + s->current_handle=(s->current_handle+1)&(BUFFERSCOUNT-1); + } + + //handle the error code + + s->rx_count += samples_received; + // s->rx_timestamp = s->rx_md.time_spec.to_ticks(s->sample_rate); + + return samples_received; +} + + + +static bool is_equal(double a, double b) +{ + return fabs(a-b) < 1e-6; +} + +int trx_sodera_set_freq(openair0_device* device, openair0_config_t *openair0_cfg, int dummy) { + + sodera_t *s = (sodera_t*)device->priv; + + // s->usrp->set_tx_freq(openair0_cfg[0].tx_freq[0]); + // s->usrp->set_rx_freq(openair0_cfg[0].rx_freq[0]); + + return(0); + +} + +int openair0_set_rx_frequencies(openair0_device* device, openair0_config_t *openair0_cfg) { + + sodera_t *s = (sodera_t*)device->priv; + static int first_call=1; + static double rf_freq,diff; + + // uhd::tune_request_t rx_tune_req(openair0_cfg[0].rx_freq[0]); + + // rx_tune_req.rf_freq_policy = uhd::tune_request_t::POLICY_MANUAL; + // rx_tune_req.rf_freq = openair0_cfg[0].rx_freq[0]; + // rf_freq=openair0_cfg[0].rx_freq[0]; + // s->usrp->set_rx_freq(rx_tune_req); + + return(0); + +} + +int trx_sodera_set_gains(openair0_device* device, + openair0_config_t *openair0_cfg) { + + sodera_t *s = (sodera_t*)device->priv; + + // s->usrp->set_tx_gain(openair0_cfg[0].tx_gain[0]); + // ::uhd::gain_range_t gain_range = s->usrp->get_rx_gain_range(0); + // limit to maximum gain + /* if (openair0_cfg[0].rx_gain[0]-openair0_cfg[0].rx_gain_offset[0] > gain_range.stop()) { + + printf("RX Gain 0 too high, reduce by %f dB\n", + openair0_cfg[0].rx_gain[0]-openair0_cfg[0].rx_gain_offset[0] - gain_range.stop()); + exit(-1); + } + s->usrp->set_rx_gain(openair0_cfg[0].rx_gain[0]-openair0_cfg[0].rx_gain_offset[0]); + printf("Setting SODERA RX gain to %f (rx_gain %f,gain_range.stop() %f)\n", openair0_cfg[0].rx_gain[0]-openair0_cfg[0].rx_gain_offset[0],openair0_cfg[0].rx_gain[0],gain_range.stop()); + */ + return(0); +} + +int trx_sodera_stop(int card) { + return(0); +} + + +rx_gain_calib_table_t calib_table_sodera[] = { + {3500000000.0,44.0}, + {2660000000.0,49.0}, + {2300000000.0,50.0}, + {1880000000.0,53.0}, + {816000000.0,58.0}, + {-1,0}}; + +void set_rx_gain_offset(openair0_config_t *openair0_cfg, int chain_index,int bw_gain_adjust) { + + int i=0; + // loop through calibration table to find best adjustment factor for RX frequency + double min_diff = 6e9,diff,gain_adj=0.0; + if (bw_gain_adjust==1) { + switch ((int)openair0_cfg[0].sample_rate) { + case 30720000: + break; + case 23040000: + gain_adj=1.25; + break; + case 15360000: + gain_adj=3.0; + break; + case 7680000: + gain_adj=6.0; + break; + case 3840000: + gain_adj=9.0; + break; + case 1920000: + gain_adj=12.0; + break; + default: + printf("unknown sampling rate %d\n",(int)openair0_cfg[0].sample_rate); + exit(-1); + break; + } + } + while (openair0_cfg->rx_gain_calib_table[i].freq>0) { + diff = fabs(openair0_cfg->rx_freq[chain_index] - openair0_cfg->rx_gain_calib_table[i].freq); + printf("cal %d: freq %f, offset %f, diff %f\n", + i, + openair0_cfg->rx_gain_calib_table[i].freq, + openair0_cfg->rx_gain_calib_table[i].offset,diff); + if (min_diff > diff) { + min_diff = diff; + openair0_cfg->rx_gain_offset[chain_index] = openair0_cfg->rx_gain_calib_table[i].offset+gain_adj; + } + i++; + } + +} + + +int trx_sodera_get_stats(openair0_device* device) { + + return(0); + +} +int trx_sodera_reset_stats(openair0_device* device) { + + return(0); + +} + + +int openair0_dev_init_sodera(openair0_device* device, openair0_config_t *openair0_cfg) +{ + + sodera_t *s=&sodera_state; + + size_t i; + + // Initialize SODERA device + s->Port.RefreshDeviceList(); + vector<string> deviceNames=s->Port.GetDeviceList(); + + if (deviceNames.size() == 1) { + if (s->Port.Open(0) != IConnection::SUCCESS) { + printf("Cannot open SoDeRa\n"); + exit(-1); + } + LMSinfo devInfo = s->Port.GetInfo(); + printf("Device %s, HW: %d, FW: %d, Protocol %d\n", + GetDeviceName(devInfo.device), + (int)devInfo.hardware, + (int)devInfo.firmware, + (int)devInfo.protocol); + + printf("Configuring Si5351C\n"); + s->Si.Initialize(&s->Port); + s->Si.SetPLL(0, 25000000, 0); + s->Si.SetPLL(1, 25000000, 0); + s->Si.SetClock(0, 27000000, true, false); + s->Si.SetClock(1, 27000000, true, false); + for (int i = 2; i < 8; ++i) + s->Si.SetClock(i, 27000000, false, false); + Si5351C::Status status = s->Si.ConfigureClocks(); + if (status != Si5351C::SUCCESS) + { + printf("Failed to configure Si5351C"); + exit(-1); + } + status = s->Si.UploadConfiguration(); + if (status != Si5351C::SUCCESS) + printf("Failed to upload Si5351C configuration"); + + + printf("Configuring LMS7002\n"); + + int bw_gain_adjust=0; + + + openair0_cfg[0].rx_gain_calib_table = calib_table_sodera; + + switch ((int)openair0_cfg[0].sample_rate) { + case 30720000: + // from usrp_time_offset + openair0_cfg[0].samples_per_packet = 2048; + openair0_cfg[0].tx_sample_advance = 15; + openair0_cfg[0].tx_bw = 20e6; + openair0_cfg[0].rx_bw = 20e6; + openair0_cfg[0].tx_scheduling_advance = 8*openair0_cfg[0].samples_per_packet; + break; + case 15360000: + openair0_cfg[0].samples_per_packet = 2048; + openair0_cfg[0].tx_sample_advance = 45; + openair0_cfg[0].tx_bw = 10e6; + openair0_cfg[0].rx_bw = 10e6; + openair0_cfg[0].tx_scheduling_advance = 5*openair0_cfg[0].samples_per_packet; + break; + case 7680000: + openair0_cfg[0].samples_per_packet = 1024; + openair0_cfg[0].tx_sample_advance = 50; + openair0_cfg[0].tx_bw = 5e6; + openair0_cfg[0].rx_bw = 5e6; + openair0_cfg[0].tx_scheduling_advance = 5*openair0_cfg[0].samples_per_packet; + break; + case 1920000: + openair0_cfg[0].samples_per_packet = 256; + openair0_cfg[0].tx_sample_advance = 50; + openair0_cfg[0].tx_bw = 1.25e6; + openair0_cfg[0].rx_bw = 1.25e6; + openair0_cfg[0].tx_scheduling_advance = 8*openair0_cfg[0].samples_per_packet; + break; + default: + printf("Error: unknown sampling rate %f\n",openair0_cfg[0].sample_rate); + exit(-1); + break; + + } + + s->lmsControl = LMS7002M(&s->Port); + + liblms7_status opStatus; + s->lmsControl.ResetChip(); + opStatus = s->lmsControl.LoadConfig(openair0_cfg[0].configFilename); + + if (opStatus != LIBLMS7_SUCCESS) { + printf("Failed to load configuration file %s\n",openair0_cfg[0].configFilename); + exit(-1); + } + opStatus = s->lmsControl.UploadAll(); + + if (opStatus != LIBLMS7_SUCCESS) { + printf("Failed to upload configuration file\n"); + exit(-1); + } + + opStatus = s->lmsControl.SetFrequencySX(LMS7002M::Tx, openair0_cfg[0].tx_freq[0]/1e6,30.72); + + if (opStatus != LIBLMS7_SUCCESS) { + printf("Cannot set TX frequency %f MHz\n",openair0_cfg[0].tx_freq[0]/1e6); + exit(-1); + } + + opStatus = s->lmsControl.SetFrequencySX(LMS7002M::Rx, openair0_cfg[0].rx_freq[0]/1e6,30.72); + + if (opStatus != LIBLMS7_SUCCESS) { + printf("Cannot set RX frequency %f MHz\n",openair0_cfg[0].rx_freq[0]/1e6); + exit(-1); + } + + + + // this makes RX/TX sampling rates equal + opStatus = s->lmsControl.Modify_SPI_Reg_bits(EN_ADCCLKH_CLKGN,0); + if (opStatus != LIBLMS7_SUCCESS) { + printf("Cannot modify SPI (EN_ADCCLKH_CLKGN)\n"); + exit(-1); + } + opStatus = s->lmsControl.Modify_SPI_Reg_bits(CLKH_OV_CLKL_CGEN,2); + if (opStatus != LIBLMS7_SUCCESS) { + printf("Cannot modify SPI (CLKH_OV_CLKL_CGEN)\n"); + exit(-1); + } + + const float cgen_freq_MHz = 245.76; + const int interpolation = 0; // real interpolation = 2 + const int decimation = 0; // real decimation = 2 + opStatus = s->lmsControl.SetInterfaceFrequency(cgen_freq_MHz,interpolation,decimation); + if (opStatus != LIBLMS7_SUCCESS) { + printf("Cannot SetInterfaceFrequency (%f,%d,%d)\n",cgen_freq_MHz,interpolation,decimation); + exit(-1); + } + /* + // Run calibration procedure + float txrx_calibrationBandwidth_MHz = 5; + opStatus = s->lmsControl.CalibrateTx(txrx_calibrationBandwidth_MHz); + if (opStatus != LIBLMS7_SUCCESS){ + printf("TX Calibration failed\n"); + exit(-1); + } + opStatus = s->lmsControl.CalibrateRx(txrx_calibrationBandwidth_MHz); + if (opStatus != LIBLMS7_SUCCESS){ + printf("RX Calibration failed\n"); + exit(-1); + } + */ + + s->lmsStream = new LMS_StreamBoard(&s->Port); + LMS_StreamBoard::Status opStreamStatus; + // this will configure that sampling rate at output of FPGA + opStreamStatus = s->lmsStream->ConfigurePLL(&s->Port,openair0_cfg[0].sample_rate,openair0_cfg[0].sample_rate,90); + if (opStatus != LIBLMS7_SUCCESS){ + printf("Sample rate programming failed\n"); + exit(-1); + } + + /* + ::uhd::gain_range_t gain_range = s->usrp->get_rx_gain_range(i); + // limit to maximum gain + if (openair0_cfg[0].rx_gain[i]-openair0_cfg[0].rx_gain_offset[i] > gain_range.stop()) { + + printf("RX Gain %lu too high, lower by %f dB\n",i,openair0_cfg[0].rx_gain[i]-openair0_cfg[0].rx_gain_offset[i] - gain_range.stop()); + exit(-1); + } + s->usrp->set_rx_gain(openair0_cfg[0].rx_gain[i]-openair0_cfg[0].rx_gain_offset[i],i); + printf("RX Gain %lu %f (%f) => %f (max %f)\n",i, + openair0_cfg[0].rx_gain[i],openair0_cfg[0].rx_gain_offset[i], + openair0_cfg[0].rx_gain[i]-openair0_cfg[0].rx_gain_offset[i],gain_range.stop()); + } + } + for(i=0;i<s->usrp->get_tx_num_channels();i++) { + if (i<openair0_cfg[0].tx_num_channels) { + s->usrp->set_tx_rate(openair0_cfg[0].sample_rate,i); + s->usrp->set_tx_bandwidth(openair0_cfg[0].tx_bw,i); + printf("Setting tx freq/gain on channel %lu/%lu: BW %f (readback %f)\n",i,s->usrp->get_tx_num_channels(),openair0_cfg[0].tx_bw/1e6,s->usrp->get_tx_bandwidth(i)/1e6); + s->usrp->set_tx_freq(openair0_cfg[0].tx_freq[i],i); + s->usrp->set_tx_gain(openair0_cfg[0].tx_gain[i],i); + } + } + */ + + // create tx & rx streamer + + //stream_args_rx.args["spp"] = str(boost::format("%d") % 2048);//(openair0_cfg[0].rx_num_channels*openair0_cfg[0].samples_per_packet)); + + /* + for (i=0;i<openair0_cfg[0].rx_num_channels;i++) { + if (i<openair0_cfg[0].rx_num_channels) { + printf("RX Channel %lu\n",i); + std::cout << boost::format("Actual RX sample rate: %fMSps...") % (s->usrp->get_rx_rate(i)/1e6) << std::endl; + std::cout << boost::format("Actual RX frequency: %fGHz...") % (s->usrp->get_rx_freq(i)/1e9) << std::endl; + std::cout << boost::format("Actual RX gain: %f...") % (s->usrp->get_rx_gain(i)) << std::endl; + std::cout << boost::format("Actual RX bandwidth: %fM...") % (s->usrp->get_rx_bandwidth(i)/1e6) << std::endl; + std::cout << boost::format("Actual RX antenna: %s...") % (s->usrp->get_rx_antenna(i)) << std::endl; + } + } + + for (i=0;i<openair0_cfg[0].tx_num_channels;i++) { + + if (i<openair0_cfg[0].tx_num_channels) { + printf("TX Channel %lu\n",i); + std::cout << std::endl<<boost::format("Actual TX sample rate: %fMSps...") % (s->usrp->get_tx_rate(i)/1e6) << std::endl; + std::cout << boost::format("Actual TX frequency: %fGHz...") % (s->usrp->get_tx_freq(i)/1e9) << std::endl; + std::cout << boost::format("Actual TX gain: %f...") % (s->usrp->get_tx_gain(i)) << std::endl; + std::cout << boost::format("Actual TX bandwidth: %fM...") % (s->usrp->get_tx_bandwidth(i)/1e6) << std::endl; + std::cout << boost::format("Actual TX antenna: %s...") % (s->usrp->get_tx_antenna(i)) << std::endl; + } + */ + } + else { + printf("Please connect SoDeRa\n"); + exit(-1); + } + + device->priv = s; + device->trx_start_func = trx_sodera_start; + device->trx_write_func = trx_sodera_write; + device->trx_read_func = trx_sodera_read; + device->trx_get_stats_func = trx_sodera_get_stats; + device->trx_reset_stats_func = trx_sodera_reset_stats; + device->trx_end_func = trx_sodera_end; + device->trx_stop_func = trx_sodera_stop; + device->trx_set_freq_func = trx_sodera_set_freq; + device->trx_set_gains_func = trx_sodera_set_gains; + + s->sample_rate = openair0_cfg[0].sample_rate; + s->channelscount = openair0_cfg[0].rx_num_channels; + + // TODO: + return 0; +} diff --git a/targets/ARCH/LMSSDR/enb_sodera_highband_10MHz_rx19dB_txfull.ini b/targets/ARCH/LMSSDR/enb_sodera_highband_10MHz_rx19dB_txfull.ini new file mode 100644 index 0000000000000000000000000000000000000000..e4e420c33435b03ab74cd530465f70c11f20854d --- /dev/null +++ b/targets/ARCH/LMSSDR/enb_sodera_highband_10MHz_rx19dB_txfull.ini @@ -0,0 +1,1128 @@ +[file_info] +type=lms7002m_minimal_config +version=1 +[lms7002_registers_a] +0x0493=0x0000 +0x0492=0x0000 +0x0491=0x0000 +0x029B=0x0000 +0x048E=0x0000 +0x0022=0x07FF +0x0283=0x0000 +0x0487=0x0000 +0x0486=0x0000 +0x045F=0x0000 +0x0480=0x0000 +0x0460=0x0000 +0x0447=0x0000 +0x045A=0x0000 +0x02DA=0x0000 +0x0458=0x0000 +0x0314=0x0000 +0x0456=0x0000 +0x0559=0xACB9 +0x0451=0x0000 +0x0390=0x0000 +0x044B=0x0000 +0x0448=0x0000 +0x0454=0x0000 +0x0446=0x0000 +0x04CA=0x0000 +0x0444=0x0000 +0x0443=0x0000 +0x0508=0xEF99 +0x0441=0x0000 +0x040D=0x0000 +0x040B=0x000F +0x0409=0x0000 +0x0580=0xEFF2 +0x0407=0x0000 +0x0405=0x0000 +0x0254=0x0000 +0x0404=0x0000 +0x00A0=0x6565 +0x0560=0x174B +0x0403=0x0013 +0x0402=0x07D9 +0x055E=0xDB10 +0x03A7=0x0000 +0x0520=0x174B +0x03A5=0x0000 +0x03A4=0x0000 +0x03A3=0x0000 +0x03A2=0x0000 +0x051C=0x0000 +0x048D=0x0000 +0x059A=0x0000 +0x03A1=0x0000 +0x02A2=0x0000 +0x04E1=0x0000 +0x039F=0x0000 +0x0248=0x0000 +0x039B=0x0000 +0x0408=0x0000 +0x0398=0x0000 +0x0393=0x0000 +0x0305=0x0000 +0x038E=0x0000 +0x0324=0x0000 +0x02E7=0x0000 +0x038D=0x0000 +0x0387=0x0000 +0x03A0=0x0000 +0x02D0=0x0000 +0x009A=0x658C +0x054E=0x8184 +0x0386=0x0000 +0x040F=0x43E4 +0x04E3=0x0000 +0x0389=0x0000 +0x054F=0x18C9 +0x0385=0x0000 +0x0315=0x0000 +0x0384=0x0000 +0x0382=0x0000 +0x0288=0x0000 +0x0366=0x0000 +0x0365=0x0000 +0x0364=0x0000 +0x0325=0x0000 +0x0081=0x0000 +0x0362=0x0000 +0x038A=0x0000 +0x035E=0x0000 +0x035D=0x0000 +0x0442=0x0000 +0x0449=0x0000 +0x035A=0x0000 +0x02C8=0x0000 +0x0452=0x0000 +0x0299=0x0000 +0x0359=0x0000 +0x0358=0x0000 +0x048B=0x0000 +0x0354=0x0000 +0x0351=0x0000 +0x03A6=0x0000 +0x0293=0x0000 +0x034E=0x0000 +0x035C=0x0000 +0x034D=0x0000 +0x034B=0x0000 +0x011A=0x2E14 +0x0455=0x0000 +0x034A=0x0000 +0x0348=0x0000 +0x0084=0x0400 +0x0498=0x0000 +0x035B=0x0000 +0x0505=0x00D8 +0x0345=0x0000 +0x0484=0x0000 +0x0586=0x196B +0x0344=0x0000 +0x0561=0xAB08 +0x0343=0x0000 +0x0342=0x0000 +0x0380=0x0000 +0x0327=0x0000 +0x0322=0x0000 +0x059B=0x0000 +0x0321=0x0000 +0x045E=0x0000 +0x0440=0x0024 +0x031D=0x0000 +0x0363=0x0000 +0x031A=0x0000 +0x031C=0x0000 +0x028F=0x0000 +0x0341=0x0000 +0x0287=0x0000 +0x0318=0x0000 +0x031F=0x0000 +0x0316=0x0000 +0x030D=0x0000 +0x040E=0x0003 +0x0352=0x0000 +0x028C=0x0000 +0x0360=0x0000 +0x0313=0x0000 +0x0461=0x0000 +0x010A=0x104C +0x051B=0xB77F +0x0312=0x0000 +0x0346=0x0000 +0x024E=0x0000 +0x0311=0x0000 +0x02D6=0x0000 +0x030C=0x0000 +0x04DF=0x0000 +0x030B=0x0000 +0x0392=0x0000 +0x030A=0x0000 +0x029F=0x0000 +0x0309=0x0000 +0x048A=0x0000 +0x0308=0x0000 +0x0588=0xE6C7 +0x0397=0x0000 +0x02E3=0x0000 +0x049C=0x0000 +0x044A=0x0000 +0x04A4=0x0000 +0x0306=0x0000 +0x0304=0x0000 +0x04D5=0x0000 +0x0303=0x0000 +0x0302=0x0000 +0x0510=0xE6C7 +0x044E=0x0000 +0x0300=0x0000 +0x034F=0x0000 +0x045B=0x0000 +0x02E6=0x0000 +0x00A3=0x6565 +0x04DA=0x0000 +0x025E=0x0000 +0x020A=0x0080 +0x0102=0x3180 +0x020C=0x8000 +0x05A2=0x0000 +0x040A=0x1000 +0x0556=0xA2B5 +0x0243=0x0000 +0x051D=0x4F91 +0x0259=0x0000 +0x02D5=0x0000 +0x02E1=0x0000 +0x011D=0xAAAA +0x039E=0x0000 +0x0252=0x0000 +0x0204=0xC016 +0x0255=0x0000 +0x0281=0x0000 +0x0200=0x0301 +0x0594=0xF40D +0x02C5=0x0000 +0x0406=0x0000 +0x030F=0x0000 +0x025D=0x0000 +0x0319=0x0000 +0x0121=0x3760 +0x0101=0x7800 +0x025B=0x0000 +0x02C6=0x0000 +0x0558=0x5009 +0x0021=0x0E9F +0x04C2=0x0000 +0x0290=0x0000 +0x02DF=0x0000 +0x0291=0x0000 +0x0296=0x0000 +0x029C=0x0000 +0x028D=0x0000 +0x02A1=0x0000 +0x008B=0x2756 +0x02A3=0x0000 +0x05A4=0x0000 +0x02A7=0x0000 +0x0483=0x0000 +0x0201=0x07FF +0x02C2=0x0000 +0x02C4=0x0000 +0x044D=0x0000 +0x02E2=0x0000 +0x02D1=0x0000 +0x0546=0x8D44 +0x04C8=0x0000 +0x0207=0x0000 +0x04C6=0x0000 +0x0096=0x0000 +0x0093=0x0000 +0x0250=0x0000 +0x02CB=0x0000 +0x02D3=0x0000 +0x0494=0x0000 +0x04CF=0x0000 +0x025F=0x0000 +0x0251=0x0000 +0x0488=0x0000 +0x0496=0x0000 +0x04C3=0x0000 +0x0100=0x3409 +0x04CC=0x0000 +0x02A5=0x0000 +0x0257=0x0000 +0x04D6=0x0000 +0x04A6=0x0000 +0x049A=0x0000 +0x049B=0x0000 +0x0097=0x0000 +0x011E=0x0A2A +0x0285=0x0000 +0x0280=0x0000 +0x049E=0x0000 +0x0020=0xFFFD +0x02DD=0x0000 +0x0297=0x0000 +0x049F=0x0000 +0x0522=0xDB10 +0x044C=0x0000 +0x0355=0x0000 +0x04A0=0x0000 +0x02CF=0x0000 +0x04D1=0x0000 +0x0526=0xBE2A +0x0092=0x0001 +0x031B=0x0000 +0x0541=0x4C24 +0x0518=0xEFF2 +0x0543=0xBD96 +0x02C0=0x0000 +0x0499=0x0000 +0x04A1=0x0000 +0x058D=0xF5EF +0x02D7=0x0000 +0x0513=0xDAA2 +0x0549=0x18C9 +0x0552=0x8D44 +0x0521=0x5852 +0x0509=0x0605 +0x0286=0x0000 +0x024F=0x0000 +0x04E0=0x0000 +0x0545=0x364E +0x0349=0x0000 +0x0555=0xBD96 +0x04E4=0x0000 +0x02E4=0x0000 +0x0551=0xD7B7 +0x055D=0xA6B5 +0x0298=0x0000 +0x055F=0x5852 +0x009E=0x658C +0x0547=0xD7B7 +0x0598=0xF61D +0x0123=0x067B +0x0497=0x0000 +0x04A5=0x0000 +0x0565=0xB77F +0x0124=0x0000 +0x0592=0x0DF1 +0x0591=0xFCFE +0x0548=0x79FA +0x04D2=0x0000 +0x0599=0x0000 +0x0511=0x1D10 +0x0506=0x0DF1 +0x0595=0x00BC +0x0584=0xE7E2 +0x0242=0x0000 +0x025A=0x0000 +0x04E2=0x0000 +0x04C5=0x0000 +0x058C=0xEA50 +0x0450=0x0000 +0x0596=0x0A94 +0x05A7=0x0000 +0x058A=0x17DC +0x059D=0x0000 +0x0485=0x0000 +0x058E=0x1316 +0x0550=0x79FA +0x0554=0x6901 +0x0593=0x00D8 +0x0542=0xA2B5 +0x0553=0x364E +0x0563=0x4F91 +0x024D=0x0000 +0x0567=0x4049 +0x055A=0xBE2A +0x0295=0x0000 +0x0566=0x0906 +0x028A=0x0000 +0x059C=0x0000 +0x04DD=0x0000 +0x054C=0x7FFF +0x0582=0x150F +0x0585=0xDAA2 +0x0109=0x8CC1 +0x04A2=0x0000 +0x0292=0x0000 +0x059F=0x0000 +0x0583=0x2E45 +0x050E=0x17DC +0x0516=0x150F +0x0523=0xA6B5 +0x0525=0x57AC +0x0206=0x0000 +0x051A=0x0906 +0x055C=0x3347 +0x0514=0xE7E2 +0x050F=0xEA5F +0x05A6=0x0000 +0x051E=0xF524 +0x050A=0x1316 +0x04C7=0x0000 +0x049D=0x0000 +0x0527=0xACB9 +0x050C=0xEA50 +0x0087=0x0000 +0x0399=0x0000 +0x050B=0xF5EF +0x0507=0xFCFE +0x010D=0x00DE +0x04C4=0x0000 +0x0495=0x0000 +0x0246=0x0000 +0x0503=0x00BC +0x0320=0x0000 +0x0323=0x0000 +0x02E5=0x0000 +0x055B=0x57AC +0x0114=0x0110 +0x04D8=0x0000 +0x04E7=0x0000 +0x04D0=0x0000 +0x04E6=0x0000 +0x00AE=0x0000 +0x0544=0x6901 +0x0258=0x0000 +0x0502=0x0A94 +0x04DE=0x0000 +0x058B=0x0F45 +0x0028=0x0101 +0x029E=0x0000 +0x04DC=0x0000 +0x04D9=0x0000 +0x0557=0x4C24 +0x058F=0x0605 +0x04DB=0x0000 +0x04D7=0x0000 +0x059E=0x0000 +0x024C=0x0000 +0x02DC=0x0000 +0x04D4=0x0000 +0x0504=0xF40D +0x02C3=0x0000 +0x04C1=0x0000 +0x04D3=0x0000 +0x0590=0xEF99 +0x04CE=0x0000 +0x05A5=0x0000 +0x04A7=0x0000 +0x0489=0x0000 +0x02E0=0x0000 +0x0118=0x018C +0x002A=0x0086 +0x0245=0x0000 +0x045D=0x0000 +0x0581=0xC89D +0x02D2=0x0000 +0x039C=0x0000 +0x002B=0x4032 +0x02A0=0x0000 +0x010E=0x0285 +0x0394=0x0000 +0x0459=0x0000 +0x0088=0x04F0 +0x0085=0x0001 +0x0089=0x0048 +0x0256=0x0000 +0x0111=0x0099 +0x0095=0x0000 +0x0203=0x2F99 +0x030E=0x0000 +0x0482=0x0000 +0x05A0=0x0000 +0x009C=0x658C +0x0381=0x0000 +0x0122=0x033F +0x0110=0x0BFF +0x0026=0x0101 +0x0294=0x0000 +0x009D=0x6565 +0x0524=0x3347 +0x0106=0x3182 +0x028E=0x0000 +0x0326=0x0000 +0x0113=0x03C3 +0x0391=0x0000 +0x04CB=0x0000 +0x010F=0x3042 +0x0119=0x18DF +0x02A6=0x0000 +0x05A1=0x0000 +0x02C9=0x0000 +0x0500=0xF61D +0x039D=0x0000 +0x011F=0x3600 +0x0395=0x0000 +0x024B=0x0000 +0x045C=0x0000 +0x0247=0x0000 +0x0512=0x196B +0x04E5=0x0000 +0x0024=0x50D8 +0x0353=0x0000 +0x050D=0x0F45 +0x02CD=0x0000 +0x0490=0x0000 +0x0501=0xFDFB +0x034C=0x0000 +0x00AA=0x0000 +0x0350=0x0000 +0x0445=0x0000 +0x048F=0x0000 +0x008A=0x0491 +0x0453=0x0000 +0x0260=0x0000 +0x00A1=0x6565 +0x0356=0x0000 +0x0241=0x0000 +0x008C=0x267B +0x038F=0x0000 +0x054A=0x8184 +0x00A4=0x6565 +0x0401=0x07FF +0x04CD=0x0000 +0x0249=0x0000 +0x002C=0x0000 +0x054D=0xF7A3 +0x00A6=0x0001 +0x002D=0xFFFF +0x00AC=0x2000 +0x0253=0x0000 +0x028B=0x0000 +0x040C=0x40F8 +0x0310=0x0000 +0x0099=0x6565 +0x00A2=0x6565 +0x0589=0xEA5F +0x002F=0x3840 +0x035F=0x0000 +0x0597=0xFDFB +0x0116=0x8180 +0x02CC=0x0000 +0x0025=0x0101 +0x0562=0xF524 +0x011C=0xA941 +0x0289=0x0000 +0x0282=0x0000 +0x0307=0x0000 +0x038C=0x0000 +0x02C7=0x0000 +0x054B=0xF7A3 +0x0519=0x4049 +0x009F=0x658C +0x025C=0x0000 +0x0515=0x2E45 +0x00A5=0x6565 +0x0301=0x0000 +0x02C1=0x0000 +0x0481=0x0000 +0x0517=0xC89D +0x00A8=0x0000 +0x0564=0x0000 +0x00AB=0x0040 +0x0261=0x0000 +0x002E=0x0000 +0x02DE=0x0000 +0x02A4=0x0000 +0x0540=0x5009 +0x00AD=0x03FF +0x0029=0x0101 +0x024A=0x0000 +0x00A7=0x6565 +0x0027=0x05E4 +0x0117=0x100C +0x0098=0x0000 +0x0108=0xFC26 +0x020B=0x4000 +0x0383=0x0000 +0x0202=0x0794 +0x0086=0x4101 +0x010C=0x8865 +0x02D8=0x0000 +0x0347=0x0000 +0x0457=0x0000 +0x0103=0x0612 +0x0104=0x0088 +0x0357=0x0000 +0x02DB=0x0000 +0x0400=0x0101 +0x009B=0x6565 +0x0105=0x0007 +0x05A3=0x0000 +0x0240=0x0028 +0x0367=0x0000 +0x044F=0x0000 +0x038B=0x0000 +0x02D9=0x0000 +0x02CE=0x0000 +0x0284=0x0000 +0x0396=0x0000 +0x029A=0x0000 +0x051F=0xAB08 +0x0361=0x0000 +0x0205=0x0000 +0x031E=0x0000 +0x04C0=0x0000 +0x0587=0x1D10 +0x0023=0x5550 +0x048C=0x0000 +0x0112=0x3171 +0x039A=0x0000 +0x0115=0x0009 +0x00A9=0x8000 +0x0317=0x0000 +0x0244=0x0000 +0x0094=0x0000 +0x0340=0x0000 +0x0208=0x0170 +0x04A3=0x0000 +0x029D=0x0000 +0x0388=0x0000 +0x0120=0xB9FF +0x04C9=0x0000 +0x02CA=0x0000 +0x0209=0x0000 +0x0082=0x8001 +0x02D4=0x0000 +0x0107=0x318C +[lms7002_registers_b] +0x04E1=0x0000 +0x03A1=0x0000 +0x02A2=0x0000 +0x04E0=0x0000 +0x04DE=0x0000 +0x058B=0x0000 +0x04DC=0x0000 +0x04DB=0x0000 +0x04D9=0x0000 +0x04D5=0x0000 +0x0304=0x0000 +0x04D4=0x0000 +0x0504=0x0000 +0x04D3=0x0000 +0x04D2=0x0000 +0x0548=0x0000 +0x04D0=0x0000 +0x04CF=0x0000 +0x025F=0x0000 +0x04CE=0x0000 +0x04CC=0x0000 +0x02A5=0x0000 +0x04C6=0x0000 +0x0207=0x0000 +0x04C1=0x0000 +0x02C3=0x0000 +0x04C9=0x0000 +0x02CA=0x0000 +0x04C0=0x0000 +0x031E=0x0000 +0x04D6=0x0000 +0x0257=0x0000 +0x04A6=0x0000 +0x04A5=0x0000 +0x04A2=0x0000 +0x0109=0x61C1 +0x049D=0x0000 +0x04C7=0x0000 +0x049C=0x0000 +0x0397=0x0000 +0x02E3=0x0000 +0x0499=0x0000 +0x02C0=0x0000 +0x0496=0x0000 +0x04C3=0x0000 +0x0493=0x0000 +0x04A1=0x0000 +0x0492=0x0000 +0x0491=0x0000 +0x029B=0x0000 +0x048E=0x0000 +0x0283=0x0000 +0x048C=0x0000 +0x048B=0x0000 +0x0358=0x0000 +0x0487=0x0000 +0x0486=0x0000 +0x045F=0x0000 +0x0480=0x0000 +0x0460=0x0000 +0x0447=0x0000 +0x045A=0x0000 +0x02DA=0x0000 +0x0458=0x0000 +0x0314=0x0000 +0x0456=0x0000 +0x0559=0x0000 +0x0453=0x0000 +0x0451=0x0000 +0x0390=0x0000 +0x044D=0x0000 +0x02E2=0x0000 +0x044B=0x0000 +0x0448=0x0000 +0x0454=0x0000 +0x0446=0x0000 +0x04CA=0x0000 +0x0444=0x0000 +0x0443=0x0000 +0x0508=0x0000 +0x0441=0x0000 +0x040D=0x0000 +0x040B=0x7FFF +0x0409=0x0000 +0x0580=0x0000 +0x0407=0x0000 +0x0405=0x0000 +0x0254=0x0000 +0x0404=0x0000 +0x0560=0x0000 +0x04D8=0x0000 +0x0403=0x0000 +0x0402=0x07FF +0x055E=0x0000 +0x03A7=0x0000 +0x0520=0x0000 +0x03A5=0x0000 +0x03A4=0x0000 +0x03A3=0x0000 +0x03A2=0x0000 +0x051C=0x0000 +0x048D=0x0000 +0x059A=0x0000 +0x049E=0x0000 +0x039F=0x0000 +0x0248=0x0000 +0x039B=0x0000 +0x0399=0x0000 +0x0408=0x0000 +0x0398=0x0000 +0x0497=0x0000 +0x0123=0x267B +0x0394=0x0000 +0x0459=0x0000 +0x0393=0x0000 +0x0305=0x0000 +0x038E=0x0000 +0x0324=0x0000 +0x02E7=0x0000 +0x038D=0x0000 +0x0395=0x0000 +0x038A=0x0000 +0x0362=0x0000 +0x0387=0x0000 +0x0200=0x0081 +0x0594=0x0000 +0x02C5=0x0000 +0x02A7=0x0000 +0x0318=0x0000 +0x0544=0x0000 +0x049A=0x0000 +0x0388=0x0000 +0x0120=0xB9FF +0x020A=0x0080 +0x0102=0x3180 +0x0290=0x0000 +0x02DF=0x0000 +0x0291=0x0000 +0x0295=0x0000 +0x055A=0x0000 +0x029C=0x0000 +0x010E=0x2040 +0x02A0=0x0000 +0x010F=0x3042 +0x02A6=0x0000 +0x0119=0x18CB +0x02D2=0x0000 +0x039C=0x0000 +0x028D=0x0000 +0x02A1=0x0000 +0x02C2=0x0000 +0x045E=0x0000 +0x031D=0x0000 +0x0440=0x0020 +0x02C4=0x0000 +0x04D1=0x0000 +0x02CF=0x0000 +0x02C1=0x0000 +0x02C7=0x0000 +0x054B=0x0000 +0x02D3=0x0000 +0x04C8=0x0000 +0x02D1=0x0000 +0x0546=0x0000 +0x0306=0x0000 +0x02D7=0x0000 +0x058D=0x0000 +0x0457=0x0000 +0x02D8=0x0000 +0x0347=0x0000 +0x0103=0x0A12 +0x0104=0x0088 +0x0357=0x0000 +0x02DB=0x0000 +0x0400=0x0081 +0x0209=0x0000 +0x0297=0x0000 +0x02DD=0x0000 +0x029E=0x0000 +0x02DE=0x0000 +0x0527=0x0000 +0x02D5=0x0000 +0x02E1=0x0000 +0x0259=0x0000 +0x0481=0x0000 +0x0517=0x0000 +0x029A=0x0000 +0x051F=0x0000 +0x0483=0x0000 +0x0201=0x07FF +0x0507=0x0000 +0x0321=0x0000 +0x034F=0x0000 +0x0296=0x0000 +0x0510=0x0000 +0x0302=0x0000 +0x038C=0x0000 +0x0307=0x0000 +0x0282=0x0000 +0x0392=0x0000 +0x030B=0x0000 +0x0588=0x0000 +0x0308=0x0000 +0x048A=0x0000 +0x044A=0x0000 +0x04A4=0x0000 +0x04C4=0x0000 +0x010D=0x009E +0x0300=0x0000 +0x0587=0x0000 +0x044E=0x0000 +0x0309=0x0000 +0x0585=0x0000 +0x02E5=0x0000 +0x055B=0x0000 +0x0114=0x008D +0x0323=0x0000 +0x0320=0x0000 +0x0503=0x0000 +0x0513=0x0000 +0x0319=0x0000 +0x0260=0x0000 +0x0549=0x0000 +0x0552=0x0000 +0x0509=0x0000 +0x0521=0x0000 +0x0286=0x0000 +0x04D7=0x0000 +0x059E=0x0000 +0x0557=0x0000 +0x058F=0x0000 +0x0322=0x0000 +0x059B=0x0000 +0x0545=0x0000 +0x0349=0x0000 +0x0555=0x0000 +0x02E4=0x0000 +0x04E4=0x0000 +0x0551=0x0000 +0x0312=0x0000 +0x055D=0x0000 +0x0298=0x0000 +0x055F=0x0000 +0x011D=0xAAAA +0x039E=0x0000 +0x0547=0x0000 +0x0598=0x0000 +0x0449=0x0000 +0x0564=0x0000 +0x0242=0x0000 +0x0525=0x0000 +0x0523=0x0000 +0x0565=0x0000 +0x0124=0x0000 +0x0592=0x0000 +0x0591=0x0000 +0x0563=0x0000 +0x024D=0x0000 +0x0567=0x0000 +0x05A5=0x0000 +0x0566=0x0000 +0x030A=0x0000 +0x029F=0x0000 +0x054C=0x0000 +0x0582=0x0000 +0x0599=0x0000 +0x0511=0x0000 +0x0506=0x0000 +0x0301=0x0000 +0x0595=0x0000 +0x0584=0x0000 +0x058C=0x0000 +0x051E=0x0000 +0x05A6=0x0000 +0x050F=0x0000 +0x0590=0x0000 +0x05A0=0x0000 +0x0596=0x0000 +0x05A7=0x0000 +0x0562=0x0000 +0x058A=0x0000 +0x059D=0x0000 +0x0485=0x0000 +0x0581=0x0000 +0x045D=0x0000 +0x0245=0x0000 +0x0310=0x0000 +0x058E=0x0000 +0x05A2=0x0000 +0x054D=0x0000 +0x020C=0x7FFF +0x0589=0x0000 +0x0522=0x0000 +0x049F=0x0000 +0x031F=0x0000 +0x0292=0x0000 +0x059F=0x0000 +0x0583=0x0000 +0x0543=0x0000 +0x0317=0x0000 +0x0244=0x0000 +0x0554=0x0000 +0x0593=0x0000 +0x05A4=0x0000 +0x02A3=0x0000 +0x0553=0x0000 +0x0542=0x0000 +0x0519=0x0000 +0x024F=0x0000 +0x0524=0x0000 +0x0518=0x0000 +0x0354=0x0000 +0x0526=0x0000 +0x031B=0x0000 +0x050E=0x0000 +0x0516=0x0000 +0x02CB=0x0000 +0x0250=0x0000 +0x031C=0x0000 +0x028F=0x0000 +0x051A=0x0000 +0x055C=0x0000 +0x0514=0x0000 +0x050A=0x0000 +0x050C=0x0000 +0x050B=0x0000 +0x04E7=0x0000 +0x04E6=0x0000 +0x04E5=0x0000 +0x0512=0x0000 +0x0206=0x0000 +0x0550=0x0000 +0x0360=0x0000 +0x030E=0x0000 +0x0203=0x0000 +0x0482=0x0000 +0x0541=0x0000 +0x0122=0x033F +0x0110=0x0BF4 +0x0204=0x0000 +0x0252=0x0000 +0x011E=0x0AA7 +0x049B=0x0000 +0x0294=0x0000 +0x011C=0xA941 +0x02D6=0x0000 +0x0311=0x0000 +0x0117=0x280C +0x02A4=0x0000 +0x0540=0x0000 +0x02E0=0x0000 +0x0118=0x018C +0x0489=0x0000 +0x04A7=0x0000 +0x0101=0x7800 +0x0558=0x0000 +0x02C6=0x0000 +0x05A1=0x0000 +0x02C9=0x0000 +0x039D=0x0000 +0x0500=0x0000 +0x0450=0x0000 +0x011F=0x3600 +0x030C=0x0000 +0x04DF=0x0000 +0x0281=0x0000 +0x0106=0x3182 +0x028E=0x0000 +0x0326=0x0000 +0x0113=0x03C3 +0x04CB=0x0000 +0x0391=0x0000 +0x0105=0x0007 +0x02D9=0x0000 +0x02CE=0x0000 +0x038B=0x0000 +0x044F=0x0000 +0x02D4=0x0000 +0x0107=0x318C +0x0495=0x0000 +0x0246=0x0000 +0x0303=0x0000 +0x02E6=0x0000 +0x045B=0x0000 +0x0100=0x3409 +0x0340=0x0000 +0x0208=0x0070 +0x0111=0x0083 +0x0247=0x0000 +0x024B=0x0000 +0x045C=0x0000 +0x0383=0x0000 +0x0202=0x07FF +0x054A=0x0000 +0x0401=0x07FF +0x0341=0x0000 +0x0287=0x0000 +0x034C=0x0000 +0x0501=0x0000 +0x030F=0x0000 +0x025D=0x0000 +0x0406=0x0000 +0x0313=0x0000 +0x010A=0x104C +0x0461=0x0000 +0x051B=0x0000 +0x0121=0x31FA +0x0115=0x0009 +0x0112=0xC0E6 +0x039A=0x0000 +0x02CC=0x0000 +0x0116=0x8180 +0x04A0=0x0000 +0x0108=0x9442 +0x020B=0x4000 +0x0251=0x0000 +0x0488=0x0000 +0x0241=0x0000 +0x038F=0x0000 +0x02DC=0x0000 +0x024C=0x0000 +0x0494=0x0000 +0x051D=0x0000 +0x0243=0x0000 +0x0556=0x0000 +0x040A=0x0000 +0x04CD=0x0000 +0x0249=0x0000 +0x0261=0x0000 +0x024A=0x0000 +0x0285=0x0000 +0x0280=0x0000 +0x0346=0x0000 +0x024E=0x0000 +0x0253=0x0000 +0x028B=0x0000 +0x040C=0x0000 +0x0255=0x0000 +0x0258=0x0000 +0x0502=0x0000 +0x05A3=0x0000 +0x0367=0x0000 +0x0240=0x0020 +0x0256=0x0000 +0x025A=0x0000 +0x04E2=0x0000 +0x04C5=0x0000 +0x025B=0x0000 +0x0205=0x0000 +0x0361=0x0000 +0x0515=0x0000 +0x025C=0x0000 +0x0355=0x0000 +0x044C=0x0000 +0x010C=0x88FD +0x0284=0x0000 +0x0396=0x0000 +0x0363=0x0000 +0x031A=0x0000 +0x0289=0x0000 +0x028A=0x0000 +0x04DD=0x0000 +0x059C=0x0000 +0x0352=0x0000 +0x028C=0x0000 +0x04C2=0x0000 +0x04DA=0x0000 +0x025E=0x0000 +0x0327=0x0000 +0x0380=0x0000 +0x0342=0x0000 +0x0343=0x0000 +0x0344=0x0000 +0x0561=0x0000 +0x035A=0x0000 +0x02C8=0x0000 +0x0484=0x0000 +0x0586=0x0000 +0x0597=0x0000 +0x035F=0x0000 +0x0345=0x0000 +0x0505=0x0000 +0x035B=0x0000 +0x034A=0x0000 +0x0455=0x0000 +0x011A=0x2E02 +0x034B=0x0000 +0x034D=0x0000 +0x035C=0x0000 +0x034E=0x0000 +0x0293=0x0000 +0x03A6=0x0000 +0x0350=0x0000 +0x0445=0x0000 +0x048F=0x0000 +0x0351=0x0000 +0x0353=0x0000 +0x050D=0x0000 +0x02CD=0x0000 +0x0490=0x0000 +0x0498=0x0000 +0x0348=0x0000 +0x0356=0x0000 +0x030D=0x0000 +0x0316=0x0000 +0x040E=0x0000 +0x04A3=0x0000 +0x029D=0x0000 +0x0359=0x0000 +0x0299=0x0000 +0x0452=0x0000 +0x0442=0x0000 +0x035D=0x0000 +0x035E=0x0000 +0x0325=0x0000 +0x0364=0x0000 +0x0365=0x0000 +0x0366=0x0000 +0x0381=0x0000 +0x0288=0x0000 +0x0382=0x0000 +0x0384=0x0000 +0x0315=0x0000 +0x0385=0x0000 +0x04E3=0x0000 +0x040F=0x0000 +0x0389=0x0000 +0x054F=0x0000 +0x0386=0x0000 +0x02D0=0x0000 +0x054E=0x0000 +0x03A0=0x0000 +[reference_clocks] +sxt_ref_clk_mhz=30.72 +sxr_ref_clk_mhz=30.72 diff --git a/targets/ARCH/LMSSDR/enb_sodera_highband_5MHz_rx19dB_txfull.ini b/targets/ARCH/LMSSDR/enb_sodera_highband_5MHz_rx19dB_txfull.ini new file mode 100644 index 0000000000000000000000000000000000000000..a3c1aa2e6f40fb1bd38e3fb22aa5706905ec8724 --- /dev/null +++ b/targets/ARCH/LMSSDR/enb_sodera_highband_5MHz_rx19dB_txfull.ini @@ -0,0 +1,1128 @@ +[reference_clocks] +sxr_ref_clk_mhz=30.72 +sxt_ref_clk_mhz=30.72 +[lms7002_registers_b] +0x03A0=0x0000 +0x054E=0x0000 +0x02D0=0x0000 +0x0386=0x0000 +0x054F=0x0000 +0x0389=0x0000 +0x040F=0x0000 +0x04E3=0x0000 +0x0385=0x0000 +0x0315=0x0000 +0x0384=0x0000 +0x0382=0x0000 +0x0288=0x0000 +0x0381=0x0000 +0x0366=0x0000 +0x0365=0x0000 +0x0364=0x0000 +0x0325=0x0000 +0x035E=0x0000 +0x035D=0x0000 +0x0442=0x0000 +0x0452=0x0000 +0x0299=0x0000 +0x0359=0x0000 +0x029D=0x0000 +0x04A3=0x0000 +0x040E=0x0000 +0x0316=0x0000 +0x030D=0x0000 +0x0356=0x0000 +0x0348=0x0000 +0x0498=0x0000 +0x0490=0x0000 +0x02CD=0x0000 +0x050D=0x0000 +0x0353=0x0000 +0x0351=0x0000 +0x048F=0x0000 +0x0445=0x0000 +0x0350=0x0000 +0x03A6=0x0000 +0x0293=0x0000 +0x034E=0x0000 +0x035C=0x0000 +0x034D=0x0000 +0x034B=0x0000 +0x011A=0x2E02 +0x0455=0x0000 +0x034A=0x0000 +0x035B=0x0000 +0x0505=0x0000 +0x0345=0x0000 +0x035F=0x0000 +0x0597=0x0000 +0x0586=0x0000 +0x0484=0x0000 +0x02C8=0x0000 +0x035A=0x0000 +0x0561=0x0000 +0x0344=0x0000 +0x0343=0x0000 +0x0342=0x0000 +0x0380=0x0000 +0x0327=0x0000 +0x025E=0x0000 +0x04DA=0x0000 +0x04C2=0x0000 +0x028C=0x0000 +0x0352=0x0000 +0x059C=0x0000 +0x04DD=0x0000 +0x028A=0x0000 +0x0289=0x0000 +0x031A=0x0000 +0x0363=0x0000 +0x0396=0x0000 +0x0284=0x0000 +0x010C=0x88FD +0x044C=0x0000 +0x0355=0x0000 +0x025C=0x0000 +0x0515=0x0000 +0x0361=0x0000 +0x0205=0x0000 +0x025B=0x0000 +0x04C5=0x0000 +0x04E2=0x0000 +0x025A=0x0000 +0x0256=0x0000 +0x0240=0x0020 +0x0367=0x0000 +0x05A3=0x0000 +0x0502=0x0000 +0x0258=0x0000 +0x0255=0x0000 +0x040C=0x0000 +0x028B=0x0000 +0x0253=0x0000 +0x024E=0x0000 +0x0346=0x0000 +0x0280=0x0000 +0x0285=0x0000 +0x024A=0x0000 +0x0261=0x0000 +0x0249=0x0000 +0x04CD=0x0000 +0x040A=0x0000 +0x0556=0x0000 +0x0243=0x0000 +0x051D=0x0000 +0x0494=0x0000 +0x024C=0x0000 +0x02DC=0x0000 +0x038F=0x0000 +0x0241=0x0000 +0x0488=0x0000 +0x0251=0x0000 +0x020B=0x4000 +0x0108=0x9442 +0x04A0=0x0000 +0x0116=0x8180 +0x02CC=0x0000 +0x039A=0x0000 +0x0112=0xC0E6 +0x0307=0x0000 +0x038C=0x0000 +0x0282=0x0000 +0x0321=0x0000 +0x0507=0x0000 +0x0483=0x0000 +0x0201=0x07FF +0x02E1=0x0000 +0x0517=0x0000 +0x0481=0x0000 +0x02D5=0x0000 +0x0259=0x0000 +0x0527=0x0000 +0x02DD=0x0000 +0x0209=0x0000 +0x0297=0x0000 +0x0400=0x0081 +0x0104=0x0088 +0x0103=0x0A12 +0x0347=0x0000 +0x02D8=0x0000 +0x0457=0x0000 +0x0306=0x0000 +0x02D1=0x0000 +0x04C8=0x0000 +0x0546=0x0000 +0x0440=0x0020 +0x045E=0x0000 +0x031D=0x0000 +0x039C=0x0000 +0x02D2=0x0000 +0x010E=0x2040 +0x02A0=0x0000 +0x0544=0x0000 +0x029C=0x0000 +0x055A=0x0000 +0x0295=0x0000 +0x02CF=0x0000 +0x04D1=0x0000 +0x0291=0x0000 +0x02DF=0x0000 +0x0290=0x0000 +0x020A=0x0080 +0x0102=0x3180 +0x0120=0xB9FF +0x0388=0x0000 +0x0318=0x0000 +0x02A7=0x0000 +0x0200=0x0081 +0x0594=0x0000 +0x02C5=0x0000 +0x028D=0x0000 +0x02A1=0x0000 +0x0362=0x0000 +0x038A=0x0000 +0x0395=0x0000 +0x058D=0x0000 +0x02D7=0x0000 +0x0305=0x0000 +0x0393=0x0000 +0x0398=0x0000 +0x0408=0x0000 +0x039B=0x0000 +0x049E=0x0000 +0x02DB=0x0000 +0x0357=0x0000 +0x02C2=0x0000 +0x0514=0x0000 +0x051C=0x0000 +0x03A2=0x0000 +0x03A4=0x0000 +0x03A3=0x0000 +0x0493=0x0000 +0x0454=0x0000 +0x0448=0x0000 +0x0397=0x0000 +0x02E3=0x0000 +0x049C=0x0000 +0x040D=0x0000 +0x0281=0x0000 +0x048C=0x0000 +0x049A=0x0000 +0x0119=0x18CB +0x010F=0x3042 +0x02A6=0x0000 +0x0257=0x0000 +0x04D6=0x0000 +0x04A6=0x0000 +0x0324=0x0000 +0x038E=0x0000 +0x02E7=0x0000 +0x034F=0x0000 +0x04E0=0x0000 +0x0123=0x267B +0x0497=0x0000 +0x0459=0x0000 +0x0394=0x0000 +0x04A5=0x0000 +0x04D9=0x0000 +0x0304=0x0000 +0x04D5=0x0000 +0x0508=0x0000 +0x0443=0x0000 +0x0301=0x0000 +0x0548=0x0000 +0x04D2=0x0000 +0x0592=0x0000 +0x0591=0x0000 +0x04C7=0x0000 +0x049D=0x0000 +0x029A=0x0000 +0x051F=0x0000 +0x0309=0x0000 +0x0585=0x0000 +0x03A5=0x0000 +0x02D3=0x0000 +0x0451=0x0000 +0x0390=0x0000 +0x0562=0x0000 +0x02C4=0x0000 +0x029E=0x0000 +0x031E=0x0000 +0x04C0=0x0000 +0x04DC=0x0000 +0x04DE=0x0000 +0x058B=0x0000 +0x04DB=0x0000 +0x04D0=0x0000 +0x0492=0x0000 +0x04A1=0x0000 +0x054B=0x0000 +0x02C7=0x0000 +0x05A0=0x0000 +0x044B=0x0000 +0x0100=0x3409 +0x04CA=0x0000 +0x0446=0x0000 +0x02E4=0x0000 +0x04E4=0x0000 +0x04C3=0x0000 +0x0496=0x0000 +0x04CF=0x0000 +0x025F=0x0000 +0x04D4=0x0000 +0x0504=0x0000 +0x04CE=0x0000 +0x02DE=0x0000 +0x0399=0x0000 +0x050C=0x0000 +0x02A5=0x0000 +0x04CC=0x0000 +0x03A1=0x0000 +0x04E1=0x0000 +0x02A2=0x0000 +0x040B=0x7FFF +0x0283=0x0000 +0x048E=0x0000 +0x0580=0x0000 +0x0409=0x0000 +0x039F=0x0000 +0x0248=0x0000 +0x048B=0x0000 +0x0358=0x0000 +0x0589=0x0000 +0x038D=0x0000 +0x0487=0x0000 +0x0510=0x0000 +0x0302=0x0000 +0x0486=0x0000 +0x045F=0x0000 +0x0480=0x0000 +0x0567=0x0000 +0x02DA=0x0000 +0x045A=0x0000 +0x0254=0x0000 +0x0405=0x0000 +0x0387=0x0000 +0x0458=0x0000 +0x0314=0x0000 +0x0360=0x0000 +0x0559=0x0000 +0x0456=0x0000 +0x0453=0x0000 +0x02E2=0x0000 +0x044D=0x0000 +0x0441=0x0000 +0x02C3=0x0000 +0x04C1=0x0000 +0x04D3=0x0000 +0x0444=0x0000 +0x0207=0x0000 +0x04C6=0x0000 +0x0296=0x0000 +0x0555=0x0000 +0x0349=0x0000 +0x0109=0x61C1 +0x04A2=0x0000 +0x0447=0x0000 +0x0460=0x0000 +0x048D=0x0000 +0x059A=0x0000 +0x0407=0x0000 +0x02C0=0x0000 +0x0499=0x0000 +0x0543=0x0000 +0x04C9=0x0000 +0x02CA=0x0000 +0x0404=0x0000 +0x0560=0x0000 +0x02C1=0x0000 +0x04D8=0x0000 +0x0403=0x0000 +0x0491=0x0000 +0x029B=0x0000 +0x04C4=0x0000 +0x010D=0x009E +0x0402=0x07FF +0x055E=0x0000 +0x03A7=0x0000 +0x0520=0x0000 +0x0392=0x0000 +0x030B=0x0000 +0x0588=0x0000 +0x0308=0x0000 +0x048A=0x0000 +0x044A=0x0000 +0x04A4=0x0000 +0x0300=0x0000 +0x0587=0x0000 +0x044E=0x0000 +0x055B=0x0000 +0x02E5=0x0000 +0x0114=0x008D +0x0323=0x0000 +0x0320=0x0000 +0x0503=0x0000 +0x0513=0x0000 +0x0319=0x0000 +0x0260=0x0000 +0x0549=0x0000 +0x0552=0x0000 +0x0509=0x0000 +0x0521=0x0000 +0x0286=0x0000 +0x04D7=0x0000 +0x059E=0x0000 +0x058F=0x0000 +0x0557=0x0000 +0x0322=0x0000 +0x059B=0x0000 +0x049F=0x0000 +0x0522=0x0000 +0x0545=0x0000 +0x0551=0x0000 +0x0312=0x0000 +0x055D=0x0000 +0x0298=0x0000 +0x055F=0x0000 +0x011D=0xAAAA +0x039E=0x0000 +0x0547=0x0000 +0x0598=0x0000 +0x0449=0x0000 +0x0564=0x0000 +0x0242=0x0000 +0x0525=0x0000 +0x0523=0x0000 +0x0565=0x0000 +0x0124=0x0000 +0x0563=0x0000 +0x024D=0x0000 +0x05A5=0x0000 +0x0566=0x0000 +0x030A=0x0000 +0x029F=0x0000 +0x054C=0x0000 +0x0582=0x0000 +0x0599=0x0000 +0x0511=0x0000 +0x0506=0x0000 +0x0595=0x0000 +0x0584=0x0000 +0x058C=0x0000 +0x05A6=0x0000 +0x051E=0x0000 +0x050F=0x0000 +0x0590=0x0000 +0x0596=0x0000 +0x05A7=0x0000 +0x058A=0x0000 +0x059D=0x0000 +0x0485=0x0000 +0x0581=0x0000 +0x045D=0x0000 +0x0245=0x0000 +0x0310=0x0000 +0x058E=0x0000 +0x05A2=0x0000 +0x054D=0x0000 +0x020C=0x7FFF +0x031F=0x0000 +0x0292=0x0000 +0x059F=0x0000 +0x0583=0x0000 +0x0317=0x0000 +0x0244=0x0000 +0x0554=0x0000 +0x0593=0x0000 +0x05A4=0x0000 +0x02A3=0x0000 +0x0553=0x0000 +0x0542=0x0000 +0x0519=0x0000 +0x024F=0x0000 +0x0524=0x0000 +0x0518=0x0000 +0x0354=0x0000 +0x0526=0x0000 +0x031B=0x0000 +0x050E=0x0000 +0x0516=0x0000 +0x02CB=0x0000 +0x0250=0x0000 +0x031C=0x0000 +0x028F=0x0000 +0x051A=0x0000 +0x055C=0x0000 +0x050A=0x0000 +0x050B=0x0000 +0x04E7=0x0000 +0x04E6=0x0000 +0x04E5=0x0000 +0x0512=0x0000 +0x0206=0x0000 +0x0550=0x0000 +0x030E=0x0000 +0x0203=0x0000 +0x0482=0x0000 +0x0541=0x0000 +0x0122=0x033F +0x0110=0x0BF4 +0x0204=0x0000 +0x0252=0x0000 +0x011E=0x0AA7 +0x049B=0x0000 +0x0294=0x0000 +0x011C=0xA941 +0x02D6=0x0000 +0x0311=0x0000 +0x0117=0x280C +0x02A4=0x0000 +0x0540=0x0000 +0x02E0=0x0000 +0x0118=0x018C +0x0489=0x0000 +0x04A7=0x0000 +0x0101=0x7800 +0x0558=0x0000 +0x02C6=0x0000 +0x05A1=0x0000 +0x02C9=0x0000 +0x039D=0x0000 +0x0500=0x0000 +0x0450=0x0000 +0x011F=0x3600 +0x030C=0x0000 +0x04DF=0x0000 +0x0106=0x3182 +0x028E=0x0000 +0x0326=0x0000 +0x0113=0x03C3 +0x04CB=0x0000 +0x0391=0x0000 +0x0105=0x0007 +0x02D9=0x0000 +0x02CE=0x0000 +0x044F=0x0000 +0x038B=0x0000 +0x02D4=0x0000 +0x0107=0x318C +0x0495=0x0000 +0x0246=0x0000 +0x0303=0x0000 +0x02E6=0x0000 +0x045B=0x0000 +0x0340=0x0000 +0x0208=0x0070 +0x0111=0x0083 +0x0247=0x0000 +0x024B=0x0000 +0x045C=0x0000 +0x0383=0x0000 +0x0202=0x07FF +0x054A=0x0000 +0x0401=0x07FF +0x0341=0x0000 +0x0287=0x0000 +0x034C=0x0000 +0x0501=0x0000 +0x030F=0x0000 +0x025D=0x0000 +0x0406=0x0000 +0x0313=0x0000 +0x010A=0x104C +0x0461=0x0000 +0x051B=0x0000 +0x0121=0x31FA +0x0115=0x0009 +[lms7002_registers_a] +0x0107=0x318C +0x02D4=0x0000 +0x0082=0x8001 +0x0209=0x0000 +0x02CA=0x0000 +0x04C9=0x0000 +0x0120=0xB9FF +0x0388=0x0000 +0x029D=0x0000 +0x04A3=0x0000 +0x0208=0x0170 +0x0340=0x0000 +0x0094=0x0000 +0x0244=0x0000 +0x0317=0x0000 +0x00A9=0x8000 +0x0115=0x0009 +0x039A=0x0000 +0x0112=0x3171 +0x048C=0x0000 +0x0023=0x5550 +0x0587=0x1D10 +0x04C0=0x0000 +0x031E=0x0000 +0x0205=0x0000 +0x0361=0x0000 +0x051F=0xAB08 +0x029A=0x0000 +0x0396=0x0000 +0x0284=0x0000 +0x02CE=0x0000 +0x02D9=0x0000 +0x038B=0x0000 +0x044F=0x0000 +0x0367=0x0000 +0x0240=0x0028 +0x05A3=0x0000 +0x0105=0x0007 +0x009B=0x6565 +0x0400=0x0101 +0x02DB=0x0000 +0x0357=0x0000 +0x0104=0x0088 +0x0103=0x0612 +0x0457=0x0000 +0x0347=0x0000 +0x02D8=0x0000 +0x010C=0x8865 +0x0086=0x4101 +0x0202=0x0794 +0x0383=0x0000 +0x020B=0x4000 +0x0108=0xFC26 +0x0098=0x0000 +0x0117=0x100C +0x0027=0x05E4 +0x00A7=0x6565 +0x024A=0x0000 +0x0029=0x0101 +0x00AD=0x03FF +0x0540=0x5009 +0x02A4=0x0000 +0x02DE=0x0000 +0x002E=0x0000 +0x0261=0x0000 +0x00AB=0x0040 +0x0564=0x0000 +0x00A8=0x0000 +0x0517=0xC89D +0x0481=0x0000 +0x02C1=0x0000 +0x0301=0x0000 +0x00A5=0x6565 +0x0515=0x2E45 +0x025C=0x0000 +0x009F=0x658C +0x0519=0x4049 +0x054B=0xF7A3 +0x02C7=0x0000 +0x038C=0x0000 +0x0307=0x0000 +0x0282=0x0000 +0x0289=0x0000 +0x011C=0xA941 +0x0562=0xF524 +0x0025=0x0101 +0x02CC=0x0000 +0x0116=0x8180 +0x0597=0xFDFB +0x035F=0x0000 +0x002F=0x3840 +0x0589=0xEA5F +0x00A2=0x6565 +0x0099=0x6565 +0x0310=0x0000 +0x040C=0x40F8 +0x028B=0x0000 +0x0253=0x0000 +0x00AC=0x2000 +0x002D=0xFFFF +0x00A6=0x0001 +0x054D=0xF7A3 +0x002C=0x0000 +0x0249=0x0000 +0x04CD=0x0000 +0x0401=0x07FF +0x00A4=0x6565 +0x054A=0x8184 +0x038F=0x0000 +0x008C=0x267B +0x0241=0x0000 +0x0356=0x0000 +0x00A1=0x6565 +0x0260=0x0000 +0x0453=0x0000 +0x008A=0x0491 +0x048F=0x0000 +0x0445=0x0000 +0x0350=0x0000 +0x00AA=0x0000 +0x034C=0x0000 +0x0501=0xFDFB +0x0490=0x0000 +0x02CD=0x0000 +0x050D=0x0F45 +0x0353=0x0000 +0x0024=0x50D8 +0x04E5=0x0000 +0x0512=0x196B +0x0247=0x0000 +0x045C=0x0000 +0x024B=0x0000 +0x0395=0x0000 +0x011F=0x3600 +0x039D=0x0000 +0x0500=0xF61D +0x02C9=0x0000 +0x05A1=0x0000 +0x02A6=0x0000 +0x0119=0x18DF +0x010F=0x3042 +0x04CB=0x0000 +0x0391=0x0000 +0x0113=0x03C3 +0x0326=0x0000 +0x028E=0x0000 +0x0106=0x3182 +0x0524=0x3347 +0x009D=0x6565 +0x0294=0x0000 +0x0026=0x0101 +0x0110=0x0BFF +0x0122=0x033F +0x0381=0x0000 +0x009C=0x658C +0x05A0=0x0000 +0x0482=0x0000 +0x030E=0x0000 +0x0203=0x2F99 +0x0095=0x0000 +0x0111=0x0099 +0x0256=0x0000 +0x0089=0x00A0 +0x0085=0x0001 +0x0088=0x0530 +0x0459=0x0000 +0x0394=0x0000 +0x010E=0x0285 +0x02A0=0x0000 +0x002B=0x4038 +0x039C=0x0000 +0x02D2=0x0000 +0x0581=0xC89D +0x045D=0x0000 +0x0245=0x0000 +0x002A=0x0086 +0x0118=0x018C +0x02E0=0x0000 +0x0489=0x0000 +0x04A7=0x0000 +0x039E=0x0000 +0x011D=0xAAAA +0x02E1=0x0000 +0x0259=0x0000 +0x02D5=0x0000 +0x051D=0x4F91 +0x0243=0x0000 +0x0556=0xA2B5 +0x040A=0x1000 +0x05A2=0x0000 +0x020C=0x8000 +0x020A=0x0080 +0x0102=0x3180 +0x034F=0x0000 +0x0303=0x0000 +0x0306=0x0000 +0x0255=0x0000 +0x0300=0x0000 +0x044E=0x0000 +0x0309=0x0000 +0x0585=0xDAA2 +0x0527=0xACB9 +0x044A=0x0000 +0x04A4=0x0000 +0x048A=0x0000 +0x0392=0x0000 +0x030B=0x0000 +0x05A7=0x0000 +0x0252=0x0000 +0x0204=0xC016 +0x0308=0x0000 +0x0588=0xE6C7 +0x0321=0x0000 +0x0507=0xFCFE +0x0312=0x0000 +0x050B=0xF5EF +0x0360=0x0000 +0x0021=0x0E9F +0x04C2=0x0000 +0x030D=0x0000 +0x040E=0x0003 +0x0316=0x0000 +0x031F=0x0000 +0x030C=0x0000 +0x04DF=0x0000 +0x0318=0x0000 +0x0250=0x0000 +0x02CB=0x0000 +0x045E=0x0000 +0x0440=0x0024 +0x031D=0x0000 +0x058D=0xF5EF +0x02D7=0x0000 +0x0380=0x0000 +0x0342=0x0000 +0x0343=0x0000 +0x0566=0x0906 +0x0345=0x0000 +0x049C=0x0000 +0x02E3=0x0000 +0x0397=0x0000 +0x035B=0x0000 +0x0505=0x00D8 +0x028D=0x0000 +0x02A1=0x0000 +0x028F=0x0000 +0x031C=0x0000 +0x031A=0x0000 +0x0363=0x0000 +0x0596=0x0A94 +0x0354=0x0000 +0x0518=0xEFF2 +0x035C=0x0000 +0x034D=0x0000 +0x0344=0x0000 +0x0561=0xAB08 +0x0096=0x0000 +0x010D=0x00DE +0x04C4=0x0000 +0x0351=0x0000 +0x0311=0x0000 +0x02D6=0x0000 +0x02D1=0x0000 +0x0546=0x8D44 +0x04C8=0x0000 +0x048B=0x0000 +0x0358=0x0000 +0x0522=0xDB10 +0x049F=0x0000 +0x034A=0x0000 +0x0455=0x0000 +0x0359=0x0000 +0x03A4=0x0000 +0x03A3=0x0000 +0x0341=0x0000 +0x0287=0x0000 +0x04DA=0x0000 +0x025E=0x0000 +0x0580=0xEFF2 +0x0409=0x0000 +0x059A=0x0000 +0x048D=0x0000 +0x0514=0xE7E2 +0x039B=0x0000 +0x0101=0x7800 +0x0558=0x5009 +0x02C6=0x0000 +0x051B=0xB77F +0x0313=0x0000 +0x010A=0x104C +0x0461=0x0000 +0x0406=0x0000 +0x030F=0x0000 +0x025D=0x0000 +0x034B=0x0000 +0x011A=0x2E14 +0x029F=0x0000 +0x030A=0x0000 +0x034E=0x0000 +0x0293=0x0000 +0x03A6=0x0000 +0x0560=0x174B +0x0404=0x0000 +0x00A0=0x6565 +0x0547=0xD7B7 +0x0454=0x0000 +0x0448=0x0000 +0x0327=0x0000 +0x0305=0x0000 +0x0393=0x0000 +0x0510=0xE6C7 +0x0302=0x0000 +0x0486=0x0000 +0x045F=0x0000 +0x0365=0x0000 +0x048E=0x0000 +0x0022=0x07FF +0x0283=0x0000 +0x044B=0x0000 +0x045A=0x0000 +0x02DA=0x0000 +0x04E4=0x0000 +0x02E4=0x0000 +0x03A5=0x0000 +0x040B=0x000F +0x0366=0x0000 +0x0443=0x0000 +0x0508=0xEF99 +0x00A3=0x6565 +0x02E2=0x0000 +0x044D=0x0000 +0x0314=0x0000 +0x0458=0x0000 +0x0493=0x0000 +0x0346=0x0000 +0x024E=0x0000 +0x055E=0xDB10 +0x0402=0x07D9 +0x0384=0x0000 +0x02E6=0x0000 +0x045B=0x0000 +0x0480=0x0000 +0x0567=0x4049 +0x04CA=0x0000 +0x0446=0x0000 +0x0447=0x0000 +0x0460=0x0000 +0x0559=0xACB9 +0x0456=0x0000 +0x0441=0x0000 +0x0444=0x0000 +0x0390=0x0000 +0x0451=0x0000 +0x049E=0x0000 +0x0324=0x0000 +0x02E7=0x0000 +0x038E=0x0000 +0x0403=0x0013 +0x04D8=0x0000 +0x029B=0x0000 +0x0491=0x0000 +0x03A1=0x0000 +0x04E1=0x0000 +0x02A2=0x0000 +0x051C=0x0000 +0x03A2=0x0000 +0x0407=0x0000 +0x0258=0x0000 +0x0502=0x0A94 +0x038A=0x0000 +0x0362=0x0000 +0x028C=0x0000 +0x0352=0x0000 +0x0385=0x0000 +0x0315=0x0000 +0x040D=0x0000 +0x039F=0x0000 +0x0248=0x0000 +0x0405=0x0000 +0x0254=0x0000 +0x0398=0x0000 +0x0408=0x0000 +0x0487=0x0000 +0x038D=0x0000 +0x035E=0x0000 +0x03A7=0x0000 +0x0520=0x174B +0x0449=0x0000 +0x02C8=0x0000 +0x035A=0x0000 +0x0387=0x0000 +0x0386=0x0000 +0x0452=0x0000 +0x0299=0x0000 +0x0084=0x0400 +0x0498=0x0000 +0x0348=0x0000 +0x02D0=0x0000 +0x054E=0x8184 +0x03A0=0x0000 +0x009A=0x658C +0x055D=0xA6B5 +0x0298=0x0000 +0x0364=0x0000 +0x0081=0x0000 +0x0325=0x0000 +0x040F=0x43E4 +0x04E3=0x0000 +0x050E=0x17DC +0x0516=0x150F +0x0389=0x0000 +0x054F=0x18C9 +0x0304=0x0000 +0x04D5=0x0000 +0x059B=0x0000 +0x0322=0x0000 +0x0442=0x0000 +0x035D=0x0000 +0x0492=0x0000 +0x04A1=0x0000 +0x0382=0x0000 +0x0288=0x0000 +0x0296=0x0000 +0x0555=0xBD96 +0x0349=0x0000 +0x0484=0x0000 +0x0586=0x196B +0x0281=0x0000 +0x0200=0x0301 +0x0594=0xF40D +0x02C5=0x0000 +0x0319=0x0000 +0x0121=0x3760 +0x025B=0x0000 +0x0290=0x0000 +0x02DF=0x0000 +0x0291=0x0000 +0x029C=0x0000 +0x008B=0x278A +0x02A3=0x0000 +0x05A4=0x0000 +0x02A7=0x0000 +0x0483=0x0000 +0x0201=0x07FF +0x02C2=0x0000 +0x02C4=0x0000 +0x0207=0x0000 +0x04C6=0x0000 +0x0093=0x0000 +0x02D3=0x0000 +0x0494=0x0000 +0x04CF=0x0000 +0x025F=0x0000 +0x0251=0x0000 +0x0488=0x0000 +0x0496=0x0000 +0x04C3=0x0000 +0x0100=0x3409 +0x04CC=0x0000 +0x02A5=0x0000 +0x0257=0x0000 +0x04D6=0x0000 +0x04A6=0x0000 +0x049A=0x0000 +0x049B=0x0000 +0x0097=0x0000 +0x011E=0x0A2A +0x0285=0x0000 +0x0280=0x0000 +0x0020=0xFFFD +0x02DD=0x0000 +0x0297=0x0000 +0x044C=0x0000 +0x0355=0x0000 +0x04A0=0x0000 +0x02CF=0x0000 +0x04D1=0x0000 +0x0526=0xBE2A +0x0092=0x0001 +0x031B=0x0000 +0x0541=0x4C24 +0x0543=0xBD96 +0x02C0=0x0000 +0x0499=0x0000 +0x0513=0xDAA2 +0x0549=0x18C9 +0x0552=0x8D44 +0x0521=0x5852 +0x0509=0x0605 +0x0286=0x0000 +0x024F=0x0000 +0x04E0=0x0000 +0x0545=0x364E +0x0551=0xD7B7 +0x055F=0x5852 +0x009E=0x658C +0x0598=0xF61D +0x0123=0x067B +0x0497=0x0000 +0x04A5=0x0000 +0x0565=0xB77F +0x0124=0x0000 +0x0592=0x0DF1 +0x0591=0xFCFE +0x0548=0x79FA +0x04D2=0x0000 +0x0599=0x0000 +0x0511=0x1D10 +0x0506=0x0DF1 +0x0595=0x00BC +0x0584=0xE7E2 +0x0242=0x0000 +0x025A=0x0000 +0x04E2=0x0000 +0x04C5=0x0000 +0x058C=0xEA50 +0x0450=0x0000 +0x058A=0x17DC +0x059D=0x0000 +0x0485=0x0000 +0x058E=0x1316 +0x0550=0x79FA +0x0554=0x6901 +0x0593=0x00D8 +0x0553=0x364E +0x0542=0xA2B5 +0x0563=0x4F91 +0x024D=0x0000 +0x055A=0xBE2A +0x0295=0x0000 +0x028A=0x0000 +0x059C=0x0000 +0x04DD=0x0000 +0x054C=0x7FFF +0x0582=0x150F +0x0109=0x8CC1 +0x04A2=0x0000 +0x0292=0x0000 +0x0583=0x2E45 +0x059F=0x0000 +0x0525=0x57AC +0x0523=0xA6B5 +0x0206=0x0000 +0x051A=0x0906 +0x055C=0x3347 +0x05A6=0x0000 +0x050F=0xEA5F +0x051E=0xF524 +0x050A=0x1316 +0x04C7=0x0000 +0x049D=0x0000 +0x050C=0xEA50 +0x0087=0x0000 +0x0399=0x0000 +0x0495=0x0000 +0x0246=0x0000 +0x0503=0x00BC +0x0320=0x0000 +0x0323=0x0000 +0x055B=0x57AC +0x0114=0x0110 +0x02E5=0x0000 +0x04E7=0x0000 +0x04D0=0x0000 +0x04E6=0x0000 +0x00AE=0x0000 +0x0544=0x6901 +0x04DE=0x0000 +0x058B=0x0F45 +0x0028=0x0101 +0x029E=0x0000 +0x04DC=0x0000 +0x04D9=0x0000 +0x058F=0x0605 +0x0557=0x4C24 +0x04DB=0x0000 +0x04D7=0x0000 +0x059E=0x0000 +0x024C=0x0000 +0x02DC=0x0000 +0x04D4=0x0000 +0x0504=0xF40D +0x02C3=0x0000 +0x04C1=0x0000 +0x04D3=0x0000 +0x0590=0xEF99 +0x04CE=0x0000 +0x05A5=0x0000 +[file_info] +version=1 +type=lms7002m_minimal_config diff --git a/targets/ARCH/LMSSDR/enb_sodera_lowband_Wrx_10MHz_rx19dB_txfull.ini b/targets/ARCH/LMSSDR/enb_sodera_lowband_Wrx_10MHz_rx19dB_txfull.ini new file mode 100644 index 0000000000000000000000000000000000000000..a0793ad395949aa35627581aa24d9a004f56792d --- /dev/null +++ b/targets/ARCH/LMSSDR/enb_sodera_lowband_Wrx_10MHz_rx19dB_txfull.ini @@ -0,0 +1,1128 @@ +[reference_clocks] +sxr_ref_clk_mhz=30.72 +sxt_ref_clk_mhz=30.72 +[lms7002_registers_b] +0x03A0=0x0000 +0x054E=0x0000 +0x02D0=0x0000 +0x0386=0x0000 +0x054F=0x0000 +0x0389=0x0000 +0x040F=0x0000 +0x04E3=0x0000 +0x0385=0x0000 +0x0315=0x0000 +0x0384=0x0000 +0x0382=0x0000 +0x0288=0x0000 +0x0381=0x0000 +0x0366=0x0000 +0x0365=0x0000 +0x0364=0x0000 +0x0325=0x0000 +0x035E=0x0000 +0x035D=0x0000 +0x0442=0x0000 +0x0452=0x0000 +0x0299=0x0000 +0x0359=0x0000 +0x029D=0x0000 +0x04A3=0x0000 +0x040E=0x0000 +0x0316=0x0000 +0x030D=0x0000 +0x0356=0x0000 +0x0348=0x0000 +0x0498=0x0000 +0x0490=0x0000 +0x02CD=0x0000 +0x050D=0x0000 +0x0353=0x0000 +0x0351=0x0000 +0x048F=0x0000 +0x0445=0x0000 +0x0350=0x0000 +0x03A6=0x0000 +0x0293=0x0000 +0x034E=0x0000 +0x035C=0x0000 +0x034D=0x0000 +0x034B=0x0000 +0x011A=0x2E02 +0x0455=0x0000 +0x034A=0x0000 +0x035B=0x0000 +0x0505=0x0000 +0x0345=0x0000 +0x035F=0x0000 +0x0597=0x0000 +0x0586=0x0000 +0x0484=0x0000 +0x02C8=0x0000 +0x035A=0x0000 +0x0561=0x0000 +0x0344=0x0000 +0x0343=0x0000 +0x0342=0x0000 +0x0380=0x0000 +0x0327=0x0000 +0x025E=0x0000 +0x04DA=0x0000 +0x04C2=0x0000 +0x028C=0x0000 +0x0352=0x0000 +0x059C=0x0000 +0x04DD=0x0000 +0x028A=0x0000 +0x0289=0x0000 +0x031A=0x0000 +0x0363=0x0000 +0x0396=0x0000 +0x0284=0x0000 +0x010C=0x88FD +0x044C=0x0000 +0x0355=0x0000 +0x025C=0x0000 +0x0515=0x0000 +0x0361=0x0000 +0x0205=0x0000 +0x025B=0x0000 +0x04C5=0x0000 +0x04E2=0x0000 +0x025A=0x0000 +0x0256=0x0000 +0x0240=0x0020 +0x0367=0x0000 +0x05A3=0x0000 +0x0502=0x0000 +0x0258=0x0000 +0x0255=0x0000 +0x040C=0x0000 +0x028B=0x0000 +0x0253=0x0000 +0x024E=0x0000 +0x0346=0x0000 +0x0280=0x0000 +0x0285=0x0000 +0x024A=0x0000 +0x0261=0x0000 +0x0249=0x0000 +0x04CD=0x0000 +0x040A=0x0000 +0x0556=0x0000 +0x0243=0x0000 +0x051D=0x0000 +0x0494=0x0000 +0x024C=0x0000 +0x02DC=0x0000 +0x038F=0x0000 +0x0241=0x0000 +0x0488=0x0000 +0x0251=0x0000 +0x020B=0x4000 +0x0108=0x9442 +0x04A0=0x0000 +0x0116=0x8180 +0x02CC=0x0000 +0x039A=0x0000 +0x0112=0xC0E6 +0x0307=0x0000 +0x038C=0x0000 +0x0282=0x0000 +0x0321=0x0000 +0x0507=0x0000 +0x0483=0x0000 +0x0201=0x07FF +0x02E1=0x0000 +0x0517=0x0000 +0x0481=0x0000 +0x02D5=0x0000 +0x0259=0x0000 +0x0527=0x0000 +0x02DD=0x0000 +0x0209=0x0000 +0x0297=0x0000 +0x0400=0x0081 +0x0104=0x0088 +0x0103=0x0A12 +0x0347=0x0000 +0x02D8=0x0000 +0x0457=0x0000 +0x0306=0x0000 +0x02D1=0x0000 +0x04C8=0x0000 +0x0546=0x0000 +0x0440=0x0020 +0x045E=0x0000 +0x031D=0x0000 +0x039C=0x0000 +0x02D2=0x0000 +0x010E=0x2040 +0x02A0=0x0000 +0x0544=0x0000 +0x029C=0x0000 +0x055A=0x0000 +0x0295=0x0000 +0x02CF=0x0000 +0x04D1=0x0000 +0x0291=0x0000 +0x02DF=0x0000 +0x0290=0x0000 +0x020A=0x0080 +0x0102=0x3180 +0x0120=0xB9FF +0x0388=0x0000 +0x0318=0x0000 +0x02A7=0x0000 +0x0200=0x0081 +0x0594=0x0000 +0x02C5=0x0000 +0x028D=0x0000 +0x02A1=0x0000 +0x0362=0x0000 +0x038A=0x0000 +0x0395=0x0000 +0x058D=0x0000 +0x02D7=0x0000 +0x0305=0x0000 +0x0393=0x0000 +0x0398=0x0000 +0x0408=0x0000 +0x039B=0x0000 +0x049E=0x0000 +0x02DB=0x0000 +0x0357=0x0000 +0x02C2=0x0000 +0x0514=0x0000 +0x051C=0x0000 +0x03A2=0x0000 +0x03A4=0x0000 +0x03A3=0x0000 +0x0493=0x0000 +0x0454=0x0000 +0x0448=0x0000 +0x0397=0x0000 +0x02E3=0x0000 +0x049C=0x0000 +0x040D=0x0000 +0x0281=0x0000 +0x048C=0x0000 +0x049A=0x0000 +0x0119=0x18CB +0x010F=0x3042 +0x02A6=0x0000 +0x0257=0x0000 +0x04D6=0x0000 +0x04A6=0x0000 +0x0324=0x0000 +0x038E=0x0000 +0x02E7=0x0000 +0x034F=0x0000 +0x04E0=0x0000 +0x0123=0x267B +0x0497=0x0000 +0x0459=0x0000 +0x0394=0x0000 +0x04A5=0x0000 +0x04D9=0x0000 +0x0304=0x0000 +0x04D5=0x0000 +0x0508=0x0000 +0x0443=0x0000 +0x0301=0x0000 +0x0548=0x0000 +0x04D2=0x0000 +0x0592=0x0000 +0x0591=0x0000 +0x04C7=0x0000 +0x049D=0x0000 +0x029A=0x0000 +0x051F=0x0000 +0x0309=0x0000 +0x0585=0x0000 +0x03A5=0x0000 +0x02D3=0x0000 +0x0451=0x0000 +0x0390=0x0000 +0x0562=0x0000 +0x02C4=0x0000 +0x029E=0x0000 +0x031E=0x0000 +0x04C0=0x0000 +0x04DC=0x0000 +0x04DE=0x0000 +0x058B=0x0000 +0x04DB=0x0000 +0x04D0=0x0000 +0x0492=0x0000 +0x04A1=0x0000 +0x054B=0x0000 +0x02C7=0x0000 +0x05A0=0x0000 +0x044B=0x0000 +0x0100=0x3409 +0x04CA=0x0000 +0x0446=0x0000 +0x02E4=0x0000 +0x04E4=0x0000 +0x04C3=0x0000 +0x0496=0x0000 +0x04CF=0x0000 +0x025F=0x0000 +0x04D4=0x0000 +0x0504=0x0000 +0x04CE=0x0000 +0x02DE=0x0000 +0x0399=0x0000 +0x050C=0x0000 +0x02A5=0x0000 +0x04CC=0x0000 +0x03A1=0x0000 +0x04E1=0x0000 +0x02A2=0x0000 +0x040B=0x7FFF +0x0283=0x0000 +0x048E=0x0000 +0x0580=0x0000 +0x0409=0x0000 +0x039F=0x0000 +0x0248=0x0000 +0x048B=0x0000 +0x0358=0x0000 +0x0589=0x0000 +0x038D=0x0000 +0x0487=0x0000 +0x0510=0x0000 +0x0302=0x0000 +0x0486=0x0000 +0x045F=0x0000 +0x0480=0x0000 +0x0567=0x0000 +0x02DA=0x0000 +0x045A=0x0000 +0x0254=0x0000 +0x0405=0x0000 +0x0387=0x0000 +0x0458=0x0000 +0x0314=0x0000 +0x0360=0x0000 +0x0559=0x0000 +0x0456=0x0000 +0x0453=0x0000 +0x02E2=0x0000 +0x044D=0x0000 +0x0441=0x0000 +0x02C3=0x0000 +0x04C1=0x0000 +0x04D3=0x0000 +0x0444=0x0000 +0x0207=0x0000 +0x04C6=0x0000 +0x0296=0x0000 +0x0555=0x0000 +0x0349=0x0000 +0x0109=0x61C1 +0x04A2=0x0000 +0x0447=0x0000 +0x0460=0x0000 +0x048D=0x0000 +0x059A=0x0000 +0x0407=0x0000 +0x02C0=0x0000 +0x0499=0x0000 +0x0543=0x0000 +0x04C9=0x0000 +0x02CA=0x0000 +0x0404=0x0000 +0x0560=0x0000 +0x02C1=0x0000 +0x04D8=0x0000 +0x0403=0x0000 +0x0491=0x0000 +0x029B=0x0000 +0x04C4=0x0000 +0x010D=0x009E +0x0402=0x07FF +0x055E=0x0000 +0x03A7=0x0000 +0x0520=0x0000 +0x0392=0x0000 +0x030B=0x0000 +0x0588=0x0000 +0x0308=0x0000 +0x048A=0x0000 +0x044A=0x0000 +0x04A4=0x0000 +0x0300=0x0000 +0x0587=0x0000 +0x044E=0x0000 +0x055B=0x0000 +0x02E5=0x0000 +0x0114=0x008D +0x0323=0x0000 +0x0320=0x0000 +0x0503=0x0000 +0x0513=0x0000 +0x0319=0x0000 +0x0260=0x0000 +0x0549=0x0000 +0x0552=0x0000 +0x0509=0x0000 +0x0521=0x0000 +0x0286=0x0000 +0x04D7=0x0000 +0x059E=0x0000 +0x058F=0x0000 +0x0557=0x0000 +0x0322=0x0000 +0x059B=0x0000 +0x049F=0x0000 +0x0522=0x0000 +0x0545=0x0000 +0x0551=0x0000 +0x0312=0x0000 +0x055D=0x0000 +0x0298=0x0000 +0x055F=0x0000 +0x011D=0x9555 +0x039E=0x0000 +0x0547=0x0000 +0x0598=0x0000 +0x0449=0x0000 +0x0564=0x0000 +0x0242=0x0000 +0x0525=0x0000 +0x0523=0x0000 +0x0565=0x0000 +0x0124=0x0000 +0x0563=0x0000 +0x024D=0x0000 +0x05A5=0x0000 +0x0566=0x0000 +0x030A=0x0000 +0x029F=0x0000 +0x054C=0x0000 +0x0582=0x0000 +0x0599=0x0000 +0x0511=0x0000 +0x0506=0x0000 +0x0595=0x0000 +0x0584=0x0000 +0x058C=0x0000 +0x05A6=0x0000 +0x051E=0x0000 +0x050F=0x0000 +0x0590=0x0000 +0x0596=0x0000 +0x05A7=0x0000 +0x058A=0x0000 +0x059D=0x0000 +0x0485=0x0000 +0x0581=0x0000 +0x045D=0x0000 +0x0245=0x0000 +0x0310=0x0000 +0x058E=0x0000 +0x05A2=0x0000 +0x054D=0x0000 +0x020C=0x7FFF +0x031F=0x0000 +0x0292=0x0000 +0x059F=0x0000 +0x0583=0x0000 +0x0317=0x0000 +0x0244=0x0000 +0x0554=0x0000 +0x0593=0x0000 +0x05A4=0x0000 +0x02A3=0x0000 +0x0553=0x0000 +0x0542=0x0000 +0x0519=0x0000 +0x024F=0x0000 +0x0524=0x0000 +0x0518=0x0000 +0x0354=0x0000 +0x0526=0x0000 +0x031B=0x0000 +0x050E=0x0000 +0x0516=0x0000 +0x02CB=0x0000 +0x0250=0x0000 +0x031C=0x0000 +0x028F=0x0000 +0x051A=0x0000 +0x055C=0x0000 +0x050A=0x0000 +0x050B=0x0000 +0x04E7=0x0000 +0x04E6=0x0000 +0x04E5=0x0000 +0x0512=0x0000 +0x0206=0x0000 +0x0550=0x0000 +0x030E=0x0000 +0x0203=0x0000 +0x0482=0x0000 +0x0541=0x0000 +0x0122=0x033F +0x0110=0x0BF4 +0x0204=0x0000 +0x0252=0x0000 +0x011E=0x05DC +0x049B=0x0000 +0x0294=0x0000 +0x011C=0xAD41 +0x02D6=0x0000 +0x0311=0x0000 +0x0117=0x280C +0x02A4=0x0000 +0x0540=0x0000 +0x02E0=0x0000 +0x0118=0x018C +0x0489=0x0000 +0x04A7=0x0000 +0x0101=0x7800 +0x0558=0x0000 +0x02C6=0x0000 +0x05A1=0x0000 +0x02C9=0x0000 +0x039D=0x0000 +0x0500=0x0000 +0x0450=0x0000 +0x011F=0x3680 +0x030C=0x0000 +0x04DF=0x0000 +0x0106=0x3182 +0x028E=0x0000 +0x0326=0x0000 +0x0113=0x03C3 +0x04CB=0x0000 +0x0391=0x0000 +0x0105=0x0007 +0x02D9=0x0000 +0x02CE=0x0000 +0x044F=0x0000 +0x038B=0x0000 +0x02D4=0x0000 +0x0107=0x318C +0x0495=0x0000 +0x0246=0x0000 +0x0303=0x0000 +0x02E6=0x0000 +0x045B=0x0000 +0x0340=0x0000 +0x0208=0x0070 +0x0111=0x0083 +0x0247=0x0000 +0x024B=0x0000 +0x045C=0x0000 +0x0383=0x0000 +0x0202=0x07FF +0x054A=0x0000 +0x0401=0x07FF +0x0341=0x0000 +0x0287=0x0000 +0x034C=0x0000 +0x0501=0x0000 +0x030F=0x0000 +0x025D=0x0000 +0x0406=0x0000 +0x0313=0x0000 +0x010A=0x104C +0x0461=0x0000 +0x051B=0x0000 +0x0121=0x356A +0x0115=0x0009 +[lms7002_registers_a] +0x0107=0x318C +0x02D4=0x0000 +0x0082=0x8001 +0x0209=0x0000 +0x02CA=0x0000 +0x04C9=0x0000 +0x0120=0xB9FF +0x0388=0x0000 +0x029D=0x0000 +0x04A3=0x0000 +0x0208=0x0170 +0x0340=0x0000 +0x0094=0x0000 +0x0244=0x0000 +0x0317=0x0000 +0x00A9=0x8000 +0x0115=0x0009 +0x039A=0x0000 +0x0112=0x3171 +0x048C=0x0000 +0x0023=0x5550 +0x0587=0x1D10 +0x04C0=0x0000 +0x031E=0x0000 +0x0205=0x0000 +0x0361=0x0000 +0x051F=0xAB08 +0x029A=0x0000 +0x0396=0x0000 +0x0284=0x0000 +0x02CE=0x0000 +0x02D9=0x0000 +0x038B=0x0000 +0x044F=0x0000 +0x0367=0x0000 +0x0240=0x0028 +0x05A3=0x0000 +0x0105=0x0007 +0x009B=0x6565 +0x0400=0x0101 +0x02DB=0x0000 +0x0357=0x0000 +0x0104=0x0088 +0x0103=0x0A12 +0x0457=0x0000 +0x0347=0x0000 +0x02D8=0x0000 +0x010C=0x8865 +0x0086=0x4101 +0x0202=0x0794 +0x0383=0x0000 +0x020B=0x4000 +0x0108=0xFC26 +0x0098=0x0000 +0x0117=0x100C +0x0027=0x05E4 +0x00A7=0x6565 +0x024A=0x0000 +0x0029=0x0101 +0x00AD=0x03FF +0x0540=0x5009 +0x02A4=0x0000 +0x02DE=0x0000 +0x002E=0x0000 +0x0261=0x0000 +0x00AB=0x0040 +0x0564=0x0000 +0x00A8=0x0000 +0x0517=0xC89D +0x0481=0x0000 +0x02C1=0x0000 +0x0301=0x0000 +0x00A5=0x6565 +0x0515=0x2E45 +0x025C=0x0000 +0x009F=0x658C +0x0519=0x4049 +0x054B=0xF7A3 +0x02C7=0x0000 +0x038C=0x0000 +0x0307=0x0000 +0x0282=0x0000 +0x0289=0x0000 +0x011C=0xAD41 +0x0562=0xF524 +0x0025=0x0101 +0x02CC=0x0000 +0x0116=0x8180 +0x0597=0xFDFB +0x035F=0x0000 +0x002F=0x3840 +0x0589=0xEA5F +0x00A2=0x6565 +0x0099=0x6565 +0x0310=0x0000 +0x040C=0x40F8 +0x028B=0x0000 +0x0253=0x0000 +0x00AC=0x2000 +0x002D=0xFFFF +0x00A6=0x0001 +0x054D=0xF7A3 +0x002C=0x0000 +0x0249=0x0000 +0x04CD=0x0000 +0x0401=0x07FF +0x00A4=0x6565 +0x054A=0x8184 +0x038F=0x0000 +0x008C=0x267B +0x0241=0x0000 +0x0356=0x0000 +0x00A1=0x6565 +0x0260=0x0000 +0x0453=0x0000 +0x008A=0x0491 +0x048F=0x0000 +0x0445=0x0000 +0x0350=0x0000 +0x00AA=0x0000 +0x034C=0x0000 +0x0501=0xFDFB +0x0490=0x0000 +0x02CD=0x0000 +0x050D=0x0F45 +0x0353=0x0000 +0x0024=0x50D8 +0x04E5=0x0000 +0x0512=0x196B +0x0247=0x0000 +0x045C=0x0000 +0x024B=0x0000 +0x0395=0x0000 +0x011F=0x3680 +0x039D=0x0000 +0x0500=0xF61D +0x02C9=0x0000 +0x05A1=0x0000 +0x02A6=0x0000 +0x0119=0x18DF +0x010F=0x3042 +0x04CB=0x0000 +0x0391=0x0000 +0x0113=0x03C3 +0x0326=0x0000 +0x028E=0x0000 +0x0106=0x3182 +0x0524=0x3347 +0x009D=0x6565 +0x0294=0x0000 +0x0026=0x0101 +0x0110=0x0BFF +0x0122=0x033F +0x0381=0x0000 +0x009C=0x658C +0x05A0=0x0000 +0x0482=0x0000 +0x030E=0x0000 +0x0203=0x2F99 +0x0095=0x0000 +0x0111=0x0099 +0x0256=0x0000 +0x0089=0x0048 +0x0085=0x0001 +0x0088=0x04F0 +0x0459=0x0000 +0x0394=0x0000 +0x010E=0x0285 +0x02A0=0x0000 +0x002B=0x4032 +0x039C=0x0000 +0x02D2=0x0000 +0x0581=0xC89D +0x045D=0x0000 +0x0245=0x0000 +0x002A=0x0086 +0x0118=0x018C +0x02E0=0x0000 +0x0489=0x0000 +0x04A7=0x0000 +0x039E=0x0000 +0x011D=0x2AAA +0x02E1=0x0000 +0x0259=0x0000 +0x02D5=0x0000 +0x051D=0x4F91 +0x0243=0x0000 +0x0556=0xA2B5 +0x040A=0x1000 +0x05A2=0x0000 +0x020C=0x8000 +0x020A=0x0080 +0x0102=0x3180 +0x034F=0x0000 +0x0303=0x0000 +0x0306=0x0000 +0x0255=0x0000 +0x0300=0x0000 +0x044E=0x0000 +0x0309=0x0000 +0x0585=0xDAA2 +0x0527=0xACB9 +0x044A=0x0000 +0x04A4=0x0000 +0x048A=0x0000 +0x0392=0x0000 +0x030B=0x0000 +0x05A7=0x0000 +0x0252=0x0000 +0x0204=0xC016 +0x0308=0x0000 +0x0588=0xE6C7 +0x0321=0x0000 +0x0507=0xFCFE +0x0312=0x0000 +0x050B=0xF5EF +0x0360=0x0000 +0x0021=0x0E9F +0x04C2=0x0000 +0x030D=0x0000 +0x040E=0x0003 +0x0316=0x0000 +0x031F=0x0000 +0x030C=0x0000 +0x04DF=0x0000 +0x0318=0x0000 +0x0250=0x0000 +0x02CB=0x0000 +0x045E=0x0000 +0x0440=0x0024 +0x031D=0x0000 +0x058D=0xF5EF +0x02D7=0x0000 +0x0380=0x0000 +0x0342=0x0000 +0x0343=0x0000 +0x0566=0x0906 +0x0345=0x0000 +0x049C=0x0000 +0x02E3=0x0000 +0x0397=0x0000 +0x035B=0x0000 +0x0505=0x00D8 +0x028D=0x0000 +0x02A1=0x0000 +0x028F=0x0000 +0x031C=0x0000 +0x031A=0x0000 +0x0363=0x0000 +0x0596=0x0A94 +0x0354=0x0000 +0x0518=0xEFF2 +0x035C=0x0000 +0x034D=0x0000 +0x0344=0x0000 +0x0561=0xAB08 +0x0096=0x0000 +0x010D=0x01DC +0x04C4=0x0000 +0x0351=0x0000 +0x0311=0x0000 +0x02D6=0x0000 +0x02D1=0x0000 +0x0546=0x8D44 +0x04C8=0x0000 +0x048B=0x0000 +0x0358=0x0000 +0x0522=0xDB10 +0x049F=0x0000 +0x034A=0x0000 +0x0455=0x0000 +0x0359=0x0000 +0x03A4=0x0000 +0x03A3=0x0000 +0x0341=0x0000 +0x0287=0x0000 +0x04DA=0x0000 +0x025E=0x0000 +0x0580=0xEFF2 +0x0409=0x0000 +0x059A=0x0000 +0x048D=0x0000 +0x0514=0xE7E2 +0x039B=0x0000 +0x0101=0x7800 +0x0558=0x5009 +0x02C6=0x0000 +0x051B=0xB77F +0x0313=0x0000 +0x010A=0x104C +0x0461=0x0000 +0x0406=0x0000 +0x030F=0x0000 +0x025D=0x0000 +0x034B=0x0000 +0x011A=0x2E14 +0x029F=0x0000 +0x030A=0x0000 +0x034E=0x0000 +0x0293=0x0000 +0x03A6=0x0000 +0x0560=0x174B +0x0404=0x0000 +0x00A0=0x6565 +0x0547=0xD7B7 +0x0454=0x0000 +0x0448=0x0000 +0x0327=0x0000 +0x0305=0x0000 +0x0393=0x0000 +0x0510=0xE6C7 +0x0302=0x0000 +0x0486=0x0000 +0x045F=0x0000 +0x0365=0x0000 +0x048E=0x0000 +0x0022=0x07FF +0x0283=0x0000 +0x044B=0x0000 +0x045A=0x0000 +0x02DA=0x0000 +0x04E4=0x0000 +0x02E4=0x0000 +0x03A5=0x0000 +0x040B=0x000F +0x0366=0x0000 +0x0443=0x0000 +0x0508=0xEF99 +0x00A3=0x6565 +0x02E2=0x0000 +0x044D=0x0000 +0x0314=0x0000 +0x0458=0x0000 +0x0493=0x0000 +0x0346=0x0000 +0x024E=0x0000 +0x055E=0xDB10 +0x0402=0x07D9 +0x0384=0x0000 +0x02E6=0x0000 +0x045B=0x0000 +0x0480=0x0000 +0x0567=0x4049 +0x04CA=0x0000 +0x0446=0x0000 +0x0447=0x0000 +0x0460=0x0000 +0x0559=0xACB9 +0x0456=0x0000 +0x0441=0x0000 +0x0444=0x0000 +0x0390=0x0000 +0x0451=0x0000 +0x049E=0x0000 +0x0324=0x0000 +0x02E7=0x0000 +0x038E=0x0000 +0x0403=0x0013 +0x04D8=0x0000 +0x029B=0x0000 +0x0491=0x0000 +0x03A1=0x0000 +0x04E1=0x0000 +0x02A2=0x0000 +0x051C=0x0000 +0x03A2=0x0000 +0x0407=0x0000 +0x0258=0x0000 +0x0502=0x0A94 +0x038A=0x0000 +0x0362=0x0000 +0x028C=0x0000 +0x0352=0x0000 +0x0385=0x0000 +0x0315=0x0000 +0x040D=0x0000 +0x039F=0x0000 +0x0248=0x0000 +0x0405=0x0000 +0x0254=0x0000 +0x0398=0x0000 +0x0408=0x0000 +0x0487=0x0000 +0x038D=0x0000 +0x035E=0x0000 +0x03A7=0x0000 +0x0520=0x174B +0x0449=0x0000 +0x02C8=0x0000 +0x035A=0x0000 +0x0387=0x0000 +0x0386=0x0000 +0x0452=0x0000 +0x0299=0x0000 +0x0084=0x0400 +0x0498=0x0000 +0x0348=0x0000 +0x02D0=0x0000 +0x054E=0x8184 +0x03A0=0x0000 +0x009A=0x658C +0x055D=0xA6B5 +0x0298=0x0000 +0x0364=0x0000 +0x0081=0x0000 +0x0325=0x0000 +0x040F=0x43E4 +0x04E3=0x0000 +0x050E=0x17DC +0x0516=0x150F +0x0389=0x0000 +0x054F=0x18C9 +0x0304=0x0000 +0x04D5=0x0000 +0x059B=0x0000 +0x0322=0x0000 +0x0442=0x0000 +0x035D=0x0000 +0x0492=0x0000 +0x04A1=0x0000 +0x0382=0x0000 +0x0288=0x0000 +0x0296=0x0000 +0x0555=0xBD96 +0x0349=0x0000 +0x0484=0x0000 +0x0586=0x196B +0x0281=0x0000 +0x0200=0x0301 +0x0594=0xF40D +0x02C5=0x0000 +0x0319=0x0000 +0x0121=0x3652 +0x025B=0x0000 +0x0290=0x0000 +0x02DF=0x0000 +0x0291=0x0000 +0x029C=0x0000 +0x008B=0x2756 +0x02A3=0x0000 +0x05A4=0x0000 +0x02A7=0x0000 +0x0483=0x0000 +0x0201=0x07FF +0x02C2=0x0000 +0x02C4=0x0000 +0x0207=0x0000 +0x04C6=0x0000 +0x0093=0x0000 +0x02D3=0x0000 +0x0494=0x0000 +0x04CF=0x0000 +0x025F=0x0000 +0x0251=0x0000 +0x0488=0x0000 +0x0496=0x0000 +0x04C3=0x0000 +0x0100=0xB409 +0x04CC=0x0000 +0x02A5=0x0000 +0x0257=0x0000 +0x04D6=0x0000 +0x04A6=0x0000 +0x049A=0x0000 +0x049B=0x0000 +0x0097=0x0000 +0x011E=0x061D +0x0285=0x0000 +0x0280=0x0000 +0x0020=0xFFFD +0x02DD=0x0000 +0x0297=0x0000 +0x044C=0x0000 +0x0355=0x0000 +0x04A0=0x0000 +0x02CF=0x0000 +0x04D1=0x0000 +0x0526=0xBE2A +0x0092=0x0001 +0x031B=0x0000 +0x0541=0x4C24 +0x0543=0xBD96 +0x02C0=0x0000 +0x0499=0x0000 +0x0513=0xDAA2 +0x0549=0x18C9 +0x0552=0x8D44 +0x0521=0x5852 +0x0509=0x0605 +0x0286=0x0000 +0x024F=0x0000 +0x04E0=0x0000 +0x0545=0x364E +0x0551=0xD7B7 +0x055F=0x5852 +0x009E=0x658C +0x0598=0xF61D +0x0123=0x067B +0x0497=0x0000 +0x04A5=0x0000 +0x0565=0xB77F +0x0124=0x0000 +0x0592=0x0DF1 +0x0591=0xFCFE +0x0548=0x79FA +0x04D2=0x0000 +0x0599=0x0000 +0x0511=0x1D10 +0x0506=0x0DF1 +0x0595=0x00BC +0x0584=0xE7E2 +0x0242=0x0000 +0x025A=0x0000 +0x04E2=0x0000 +0x04C5=0x0000 +0x058C=0xEA50 +0x0450=0x0000 +0x058A=0x17DC +0x059D=0x0000 +0x0485=0x0000 +0x058E=0x1316 +0x0550=0x79FA +0x0554=0x6901 +0x0593=0x00D8 +0x0553=0x364E +0x0542=0xA2B5 +0x0563=0x4F91 +0x024D=0x0000 +0x055A=0xBE2A +0x0295=0x0000 +0x028A=0x0000 +0x059C=0x0000 +0x04DD=0x0000 +0x054C=0x7FFF +0x0582=0x150F +0x0109=0x8CC1 +0x04A2=0x0000 +0x0292=0x0000 +0x0583=0x2E45 +0x059F=0x0000 +0x0525=0x57AC +0x0523=0xA6B5 +0x0206=0x0000 +0x051A=0x0906 +0x055C=0x3347 +0x05A6=0x0000 +0x050F=0xEA5F +0x051E=0xF524 +0x050A=0x1316 +0x04C7=0x0000 +0x049D=0x0000 +0x050C=0xEA50 +0x0087=0x0000 +0x0399=0x0000 +0x0495=0x0000 +0x0246=0x0000 +0x0503=0x00BC +0x0320=0x0000 +0x0323=0x0000 +0x055B=0x57AC +0x0114=0x0110 +0x02E5=0x0000 +0x04E7=0x0000 +0x04D0=0x0000 +0x04E6=0x0000 +0x00AE=0x0000 +0x0544=0x6901 +0x04DE=0x0000 +0x058B=0x0F45 +0x0028=0x0101 +0x029E=0x0000 +0x04DC=0x0000 +0x04D9=0x0000 +0x058F=0x0605 +0x0557=0x4C24 +0x04DB=0x0000 +0x04D7=0x0000 +0x059E=0x0000 +0x024C=0x0000 +0x02DC=0x0000 +0x04D4=0x0000 +0x0504=0xF40D +0x02C3=0x0000 +0x04C1=0x0000 +0x04D3=0x0000 +0x0590=0xEF99 +0x04CE=0x0000 +0x05A5=0x0000 +[file_info] +version=1 +type=lms7002m_minimal_config diff --git a/targets/ARCH/LMSSDR/enb_sodera_lowband_Wrx_5MHz_rx19dB_txfull.ini b/targets/ARCH/LMSSDR/enb_sodera_lowband_Wrx_5MHz_rx19dB_txfull.ini new file mode 100644 index 0000000000000000000000000000000000000000..0243742f32e2297a96e2cf49f8ca19545cfee859 --- /dev/null +++ b/targets/ARCH/LMSSDR/enb_sodera_lowband_Wrx_5MHz_rx19dB_txfull.ini @@ -0,0 +1,1128 @@ +[file_info] +type=lms7002m_minimal_config +version=1 +[lms7002_registers_a] +0x0493=0x0000 +0x0492=0x0000 +0x0491=0x0000 +0x029B=0x0000 +0x048E=0x0000 +0x0022=0x07FF +0x0283=0x0000 +0x0487=0x0000 +0x0486=0x0000 +0x045F=0x0000 +0x0480=0x0000 +0x0460=0x0000 +0x0447=0x0000 +0x045A=0x0000 +0x02DA=0x0000 +0x0458=0x0000 +0x0314=0x0000 +0x0456=0x0000 +0x0559=0xACB9 +0x0451=0x0000 +0x0390=0x0000 +0x044B=0x0000 +0x0448=0x0000 +0x0454=0x0000 +0x0446=0x0000 +0x04CA=0x0000 +0x0444=0x0000 +0x0443=0x0000 +0x0508=0xEF99 +0x0441=0x0000 +0x040D=0x0000 +0x040B=0x000F +0x0409=0x0000 +0x0580=0xEFF2 +0x0407=0x0000 +0x0405=0x0000 +0x0254=0x0000 +0x0404=0x0000 +0x00A0=0x6565 +0x0560=0x174B +0x0403=0x009C +0x0402=0x07FF +0x055E=0xDB10 +0x03A7=0x0000 +0x0520=0x174B +0x03A5=0x0000 +0x03A4=0x0000 +0x03A3=0x0000 +0x03A2=0x0000 +0x051C=0x0000 +0x048D=0x0000 +0x059A=0x0000 +0x03A1=0x0000 +0x02A2=0x0000 +0x04E1=0x0000 +0x039F=0x0000 +0x0248=0x0000 +0x039B=0x0000 +0x0408=0x0000 +0x0398=0x0000 +0x0393=0x0000 +0x0305=0x0000 +0x038E=0x0000 +0x0324=0x0000 +0x02E7=0x0000 +0x038D=0x0000 +0x0387=0x0000 +0x03A0=0x0000 +0x02D0=0x0000 +0x009A=0x658C +0x054E=0x8184 +0x0386=0x0000 +0x040F=0x0000 +0x04E3=0x0000 +0x0389=0x0000 +0x054F=0x18C9 +0x0385=0x0000 +0x0315=0x0000 +0x0384=0x0000 +0x0382=0x0000 +0x0288=0x0000 +0x0366=0x0000 +0x0365=0x0000 +0x0364=0x0000 +0x0325=0x0000 +0x0081=0x0000 +0x0362=0x0000 +0x038A=0x0000 +0x035E=0x0000 +0x035D=0x0000 +0x0442=0x0000 +0x0449=0x0000 +0x035A=0x0000 +0x02C8=0x0000 +0x0452=0x0000 +0x0299=0x0000 +0x0359=0x0000 +0x0358=0x0000 +0x048B=0x0000 +0x0354=0x0000 +0x0351=0x0000 +0x03A6=0x0000 +0x0293=0x0000 +0x034E=0x0000 +0x035C=0x0000 +0x034D=0x0000 +0x034B=0x0000 +0x011A=0x2E03 +0x0455=0x0000 +0x034A=0x0000 +0x0348=0x0000 +0x0084=0x0400 +0x0498=0x0000 +0x035B=0x0000 +0x0505=0x00D8 +0x0345=0x0000 +0x0484=0x0000 +0x0586=0x196B +0x0344=0x0000 +0x0561=0xAB08 +0x0343=0x0000 +0x0342=0x0000 +0x0380=0x0000 +0x0327=0x0000 +0x0322=0x0000 +0x059B=0x0000 +0x0321=0x0000 +0x045E=0x0000 +0x0440=0x0024 +0x031D=0x0000 +0x0363=0x0000 +0x031A=0x0000 +0x031C=0x0000 +0x028F=0x0000 +0x0341=0x0000 +0x0287=0x0000 +0x0318=0x0000 +0x031F=0x0000 +0x0316=0x0000 +0x030D=0x0000 +0x040E=0x0000 +0x0352=0x0000 +0x028C=0x0000 +0x0360=0x0000 +0x0313=0x0000 +0x0461=0x0000 +0x010A=0x184C +0x051B=0xB77F +0x0312=0x0000 +0x0346=0x0000 +0x024E=0x0000 +0x0311=0x0000 +0x02D6=0x0000 +0x030C=0x0000 +0x04DF=0x0000 +0x030B=0x0000 +0x0392=0x0000 +0x030A=0x0000 +0x029F=0x0000 +0x0309=0x0000 +0x048A=0x0000 +0x0308=0x0000 +0x0588=0xE6C7 +0x0397=0x0000 +0x02E3=0x0000 +0x049C=0x0000 +0x044A=0x0000 +0x04A4=0x0000 +0x0306=0x0000 +0x0304=0x0000 +0x04D5=0x0000 +0x0303=0x0000 +0x0302=0x0000 +0x0510=0xE6C7 +0x044E=0x0000 +0x0300=0x0000 +0x034F=0x0000 +0x045B=0x0000 +0x02E6=0x0000 +0x00A3=0x6565 +0x04DA=0x0000 +0x025E=0x0000 +0x020A=0x0000 +0x0102=0x3180 +0x020C=0x8000 +0x05A2=0x0000 +0x040A=0x1000 +0x0556=0xA2B5 +0x0243=0x0000 +0x051D=0x4F91 +0x0259=0x0000 +0x02D5=0x0000 +0x02E1=0x0000 +0x011D=0xFEEE +0x039E=0x0000 +0x0252=0x0000 +0x0204=0xFFAD +0x0255=0x0000 +0x0281=0x0000 +0x0200=0x0301 +0x0594=0xF40D +0x02C5=0x0000 +0x0406=0x0000 +0x030F=0x0000 +0x025D=0x0000 +0x0319=0x0000 +0x0121=0x313C +0x0101=0x7800 +0x025B=0x0000 +0x02C6=0x0000 +0x0558=0x5009 +0x0021=0x0E9F +0x04C2=0x0000 +0x0290=0x0000 +0x02DF=0x0000 +0x0291=0x0000 +0x0296=0x0000 +0x029C=0x0000 +0x028D=0x0000 +0x02A1=0x0000 +0x008B=0x278A +0x02A3=0x0000 +0x05A4=0x0000 +0x02A7=0x0000 +0x0483=0x0000 +0x0201=0x07FF +0x02C2=0x0000 +0x02C4=0x0000 +0x044D=0x0000 +0x02E2=0x0000 +0x02D1=0x0000 +0x0546=0x8D44 +0x04C8=0x0000 +0x0207=0x0000 +0x04C6=0x0000 +0x0096=0x0000 +0x0093=0x0000 +0x0250=0x0000 +0x02CB=0x0000 +0x02D3=0x0000 +0x0494=0x0000 +0x04CF=0x0000 +0x025F=0x0000 +0x0251=0x0000 +0x0488=0x0000 +0x0496=0x0000 +0x04C3=0x0000 +0x0100=0xB409 +0x04CC=0x0000 +0x02A5=0x0000 +0x0257=0x0000 +0x04D6=0x0000 +0x04A6=0x0000 +0x049A=0x0000 +0x049B=0x0000 +0x0097=0x0000 +0x011E=0x0663 +0x0285=0x0000 +0x0280=0x0000 +0x049E=0x0000 +0x0020=0xFFFD +0x02DD=0x0000 +0x0297=0x0000 +0x049F=0x0000 +0x0522=0xDB10 +0x044C=0x0000 +0x0355=0x0000 +0x04A0=0x0000 +0x02CF=0x0000 +0x04D1=0x0000 +0x0526=0xBE2A +0x0092=0x0001 +0x031B=0x0000 +0x0541=0x4C24 +0x0518=0xEFF2 +0x0543=0xBD96 +0x02C0=0x0000 +0x0499=0x0000 +0x04A1=0x0000 +0x058D=0xF5EF +0x02D7=0x0000 +0x0513=0xDAA2 +0x0549=0x18C9 +0x0552=0x8D44 +0x0521=0x5852 +0x0509=0x0605 +0x0286=0x0000 +0x024F=0x0000 +0x04E0=0x0000 +0x0545=0x364E +0x0349=0x0000 +0x0555=0xBD96 +0x04E4=0x0000 +0x02E4=0x0000 +0x0551=0xD7B7 +0x055D=0xA6B5 +0x0298=0x0000 +0x055F=0x5852 +0x009E=0x658C +0x0547=0xD7B7 +0x0598=0xF61D +0x0123=0x267B +0x0497=0x0000 +0x04A5=0x0000 +0x0565=0xB77F +0x0124=0x0000 +0x0592=0x0DF1 +0x0591=0xFCFE +0x0548=0x79FA +0x04D2=0x0000 +0x0599=0x0000 +0x0511=0x1D10 +0x0506=0x0DF1 +0x0595=0x00BC +0x0584=0xE7E2 +0x0242=0x0000 +0x025A=0x0000 +0x04E2=0x0000 +0x04C5=0x0000 +0x058C=0xEA50 +0x0450=0x0000 +0x0596=0x0A94 +0x05A7=0x0000 +0x058A=0x17DC +0x059D=0x0000 +0x0485=0x0000 +0x058E=0x1316 +0x0550=0x79FA +0x0554=0x6901 +0x0593=0x00D8 +0x0542=0xA2B5 +0x0553=0x364E +0x0563=0x4F91 +0x024D=0x0000 +0x0567=0x4049 +0x055A=0xBE2A +0x0295=0x0000 +0x0566=0x0906 +0x028A=0x0000 +0x059C=0x0000 +0x04DD=0x0000 +0x054C=0x7FFF +0x0582=0x150F +0x0585=0xDAA2 +0x0109=0x03C1 +0x04A2=0x0000 +0x0292=0x0000 +0x059F=0x0000 +0x0583=0x2E45 +0x050E=0x17DC +0x0516=0x150F +0x0523=0xA6B5 +0x0525=0x57AC +0x0206=0x0000 +0x051A=0x0906 +0x055C=0x3347 +0x0514=0xE7E2 +0x050F=0xEA5F +0x05A6=0x0000 +0x051E=0xF524 +0x050A=0x1316 +0x04C7=0x0000 +0x049D=0x0000 +0x0527=0xACB9 +0x050C=0xEA50 +0x0087=0x0000 +0x0399=0x0000 +0x050B=0xF5EF +0x0507=0xFCFE +0x010D=0x01DC +0x04C4=0x0000 +0x0495=0x0000 +0x0246=0x0000 +0x0503=0x00BC +0x0320=0x0000 +0x0323=0x0000 +0x02E5=0x0000 +0x055B=0x57AC +0x0114=0x0170 +0x04D8=0x0000 +0x04E7=0x0000 +0x04D0=0x0000 +0x04E6=0x0000 +0x00AE=0x0000 +0x0544=0x6901 +0x0258=0x0000 +0x0502=0x0A94 +0x04DE=0x0000 +0x058B=0x0F45 +0x0028=0x0101 +0x029E=0x0000 +0x04DC=0x0000 +0x04D9=0x0000 +0x0557=0x4C24 +0x058F=0x0605 +0x04DB=0x0000 +0x04D7=0x0000 +0x059E=0x0000 +0x024C=0x0000 +0x02DC=0x0000 +0x04D4=0x0000 +0x0504=0xF40D +0x02C3=0x0000 +0x04C1=0x0000 +0x04D3=0x0000 +0x0590=0xEF99 +0x04CE=0x0000 +0x05A5=0x0000 +0x04A7=0x0000 +0x0489=0x0000 +0x02E0=0x0000 +0x0118=0x218C +0x002A=0x0086 +0x0245=0x0000 +0x045D=0x0000 +0x0581=0xC89D +0x02D2=0x0000 +0x039C=0x0000 +0x002B=0x4032 +0x02A0=0x0000 +0x010E=0x070C +0x0394=0x0000 +0x0459=0x0000 +0x0088=0x0530 +0x0085=0x0001 +0x0089=0x00A0 +0x0256=0x0000 +0x0111=0x0099 +0x0095=0x0000 +0x0203=0x2F6C +0x030E=0x0000 +0x0482=0x0000 +0x05A0=0x0000 +0x009C=0x658C +0x0381=0x0000 +0x0122=0x033F +0x0110=0x0BFF +0x0026=0x0101 +0x0294=0x0000 +0x009D=0x6565 +0x0524=0x3347 +0x0106=0x3182 +0x028E=0x0000 +0x0326=0x0000 +0x0113=0x03C3 +0x0391=0x0000 +0x04CB=0x0000 +0x010F=0x3042 +0x0119=0x529F +0x02A6=0x0000 +0x05A1=0x0000 +0x02C9=0x0000 +0x0500=0xF61D +0x039D=0x0000 +0x011F=0x3680 +0x0395=0x0000 +0x024B=0x0000 +0x045C=0x0000 +0x0247=0x0000 +0x0512=0x196B +0x04E5=0x0000 +0x0024=0x50D8 +0x0353=0x0000 +0x050D=0x0F45 +0x02CD=0x0000 +0x0490=0x0000 +0x0501=0xFDFB +0x034C=0x0000 +0x00AA=0x0000 +0x0350=0x0000 +0x0445=0x0000 +0x048F=0x0000 +0x008A=0x0491 +0x0453=0x0000 +0x0260=0x0000 +0x00A1=0x6565 +0x0356=0x0000 +0x0241=0x0000 +0x008C=0x267B +0x038F=0x0000 +0x054A=0x8184 +0x00A4=0x6565 +0x0401=0x07ED +0x04CD=0x0000 +0x0249=0x0000 +0x002C=0x0100 +0x054D=0xF7A3 +0x00A6=0x0001 +0x002D=0xFFFF +0x00AC=0x2000 +0x0253=0x0000 +0x028B=0x0000 +0x040C=0x40F8 +0x0310=0x0000 +0x0099=0x6565 +0x00A2=0x6565 +0x0589=0xEA5F +0x002F=0x3840 +0x035F=0x0000 +0x0597=0xFDFB +0x0116=0x8180 +0x02CC=0x0000 +0x0025=0x0101 +0x0562=0xF524 +0x011C=0xAD41 +0x0289=0x0000 +0x0282=0x0000 +0x0307=0x0000 +0x038C=0x0000 +0x02C7=0x0000 +0x054B=0xF7A3 +0x0519=0x4049 +0x009F=0x658C +0x025C=0x0000 +0x0515=0x2E45 +0x00A5=0x6565 +0x0301=0x0000 +0x02C1=0x0000 +0x0481=0x0000 +0x0517=0xC89D +0x00A8=0x0000 +0x0564=0x0000 +0x00AB=0x0040 +0x0261=0x0000 +0x002E=0x0000 +0x02DE=0x0000 +0x02A4=0x0000 +0x0540=0x5009 +0x00AD=0x03FF +0x0029=0x0101 +0x024A=0x0000 +0x00A7=0x6565 +0x0027=0x05E4 +0x0117=0x1939 +0x0098=0x0000 +0x0108=0xFC26 +0x020B=0x0000 +0x0383=0x0000 +0x0202=0x07F9 +0x0086=0x4101 +0x010C=0x8865 +0x02D8=0x0000 +0x0347=0x0000 +0x0457=0x0000 +0x0103=0x0A12 +0x0104=0x0088 +0x0357=0x0000 +0x02DB=0x0000 +0x0400=0x0101 +0x009B=0x6565 +0x0105=0x0007 +0x05A3=0x0000 +0x0240=0x0028 +0x0367=0x0000 +0x044F=0x0000 +0x038B=0x0000 +0x02D9=0x0000 +0x02CE=0x0000 +0x0284=0x0000 +0x0396=0x0000 +0x029A=0x0000 +0x051F=0xAB08 +0x0361=0x0000 +0x0205=0x0000 +0x031E=0x0000 +0x04C0=0x0000 +0x0587=0x1D10 +0x0023=0x5550 +0x048C=0x0000 +0x0112=0x20E5 +0x039A=0x0000 +0x0115=0x0009 +0x00A9=0x8000 +0x0317=0x0000 +0x0244=0x0000 +0x0094=0x0000 +0x0340=0x0000 +0x0208=0x0170 +0x04A3=0x0000 +0x029D=0x0000 +0x0388=0x0000 +0x0120=0xB9FF +0x04C9=0x0000 +0x02CA=0x0000 +0x0209=0x0000 +0x0082=0x8001 +0x02D4=0x0000 +0x0107=0x318C +[lms7002_registers_b] +0x04E1=0x0000 +0x03A1=0x0000 +0x02A2=0x0000 +0x04E0=0x0000 +0x04DE=0x0000 +0x058B=0x0000 +0x04DC=0x0000 +0x04DB=0x0000 +0x04D9=0x0000 +0x04D5=0x0000 +0x0304=0x0000 +0x04D4=0x0000 +0x0504=0x0000 +0x04D3=0x0000 +0x04D2=0x0000 +0x0548=0x0000 +0x04D0=0x0000 +0x04CF=0x0000 +0x025F=0x0000 +0x04CE=0x0000 +0x04CC=0x0000 +0x02A5=0x0000 +0x04C6=0x0000 +0x0207=0x0000 +0x04C1=0x0000 +0x02C3=0x0000 +0x04C9=0x0000 +0x02CA=0x0000 +0x04C0=0x0000 +0x031E=0x0000 +0x04D6=0x0000 +0x0257=0x0000 +0x04A6=0x0000 +0x04A5=0x0000 +0x04A2=0x0000 +0x0109=0x61C1 +0x049D=0x0000 +0x04C7=0x0000 +0x049C=0x0000 +0x0397=0x0000 +0x02E3=0x0000 +0x0499=0x0000 +0x02C0=0x0000 +0x0496=0x0000 +0x04C3=0x0000 +0x0493=0x0000 +0x04A1=0x0000 +0x0492=0x0000 +0x0491=0x0000 +0x029B=0x0000 +0x048E=0x0000 +0x0283=0x0000 +0x048C=0x0000 +0x048B=0x0000 +0x0358=0x0000 +0x0487=0x0000 +0x0486=0x0000 +0x045F=0x0000 +0x0480=0x0000 +0x0460=0x0000 +0x0447=0x0000 +0x045A=0x0000 +0x02DA=0x0000 +0x0458=0x0000 +0x0314=0x0000 +0x0456=0x0000 +0x0559=0x0000 +0x0453=0x0000 +0x0451=0x0000 +0x0390=0x0000 +0x044D=0x0000 +0x02E2=0x0000 +0x044B=0x0000 +0x0448=0x0000 +0x0454=0x0000 +0x0446=0x0000 +0x04CA=0x0000 +0x0444=0x0000 +0x0443=0x0000 +0x0508=0x0000 +0x0441=0x0000 +0x040D=0x0000 +0x040B=0x7FFF +0x0409=0x0000 +0x0580=0x0000 +0x0407=0x0000 +0x0405=0x0000 +0x0254=0x0000 +0x0404=0x0000 +0x0560=0x0000 +0x04D8=0x0000 +0x0403=0x0000 +0x0402=0x07FF +0x055E=0x0000 +0x03A7=0x0000 +0x0520=0x0000 +0x03A5=0x0000 +0x03A4=0x0000 +0x03A3=0x0000 +0x03A2=0x0000 +0x051C=0x0000 +0x048D=0x0000 +0x059A=0x0000 +0x049E=0x0000 +0x039F=0x0000 +0x0248=0x0000 +0x039B=0x0000 +0x0399=0x0000 +0x0408=0x0000 +0x0398=0x0000 +0x0497=0x0000 +0x0123=0x267B +0x0394=0x0000 +0x0459=0x0000 +0x0393=0x0000 +0x0305=0x0000 +0x038E=0x0000 +0x0324=0x0000 +0x02E7=0x0000 +0x038D=0x0000 +0x0395=0x0000 +0x038A=0x0000 +0x0362=0x0000 +0x0387=0x0000 +0x0200=0x0081 +0x0594=0x0000 +0x02C5=0x0000 +0x02A7=0x0000 +0x0318=0x0000 +0x0544=0x0000 +0x049A=0x0000 +0x0388=0x0000 +0x0120=0xB9FF +0x020A=0x0080 +0x0102=0x3180 +0x0290=0x0000 +0x02DF=0x0000 +0x0291=0x0000 +0x0295=0x0000 +0x055A=0x0000 +0x029C=0x0000 +0x010E=0x2040 +0x02A0=0x0000 +0x010F=0x3042 +0x02A6=0x0000 +0x0119=0x18CB +0x02D2=0x0000 +0x039C=0x0000 +0x028D=0x0000 +0x02A1=0x0000 +0x02C2=0x0000 +0x045E=0x0000 +0x031D=0x0000 +0x0440=0x0020 +0x02C4=0x0000 +0x04D1=0x0000 +0x02CF=0x0000 +0x02C1=0x0000 +0x02C7=0x0000 +0x054B=0x0000 +0x02D3=0x0000 +0x04C8=0x0000 +0x02D1=0x0000 +0x0546=0x0000 +0x0306=0x0000 +0x02D7=0x0000 +0x058D=0x0000 +0x0457=0x0000 +0x02D8=0x0000 +0x0347=0x0000 +0x0103=0x0A12 +0x0104=0x0088 +0x0357=0x0000 +0x02DB=0x0000 +0x0400=0x0081 +0x0209=0x0000 +0x0297=0x0000 +0x02DD=0x0000 +0x029E=0x0000 +0x02DE=0x0000 +0x0527=0x0000 +0x02D5=0x0000 +0x02E1=0x0000 +0x0259=0x0000 +0x0481=0x0000 +0x0517=0x0000 +0x029A=0x0000 +0x051F=0x0000 +0x0483=0x0000 +0x0201=0x07FF +0x0507=0x0000 +0x0321=0x0000 +0x034F=0x0000 +0x0296=0x0000 +0x0510=0x0000 +0x0302=0x0000 +0x038C=0x0000 +0x0307=0x0000 +0x0282=0x0000 +0x0392=0x0000 +0x030B=0x0000 +0x0588=0x0000 +0x0308=0x0000 +0x048A=0x0000 +0x044A=0x0000 +0x04A4=0x0000 +0x04C4=0x0000 +0x010D=0x009E +0x0300=0x0000 +0x0587=0x0000 +0x044E=0x0000 +0x0309=0x0000 +0x0585=0x0000 +0x02E5=0x0000 +0x055B=0x0000 +0x0114=0x008D +0x0323=0x0000 +0x0320=0x0000 +0x0503=0x0000 +0x0513=0x0000 +0x0319=0x0000 +0x0260=0x0000 +0x0549=0x0000 +0x0552=0x0000 +0x0509=0x0000 +0x0521=0x0000 +0x0286=0x0000 +0x04D7=0x0000 +0x059E=0x0000 +0x0557=0x0000 +0x058F=0x0000 +0x0322=0x0000 +0x059B=0x0000 +0x0545=0x0000 +0x0349=0x0000 +0x0555=0x0000 +0x02E4=0x0000 +0x04E4=0x0000 +0x0551=0x0000 +0x0312=0x0000 +0x055D=0x0000 +0x0298=0x0000 +0x055F=0x0000 +0x011D=0x699D +0x039E=0x0000 +0x0547=0x0000 +0x0598=0x0000 +0x0449=0x0000 +0x0564=0x0000 +0x0242=0x0000 +0x0525=0x0000 +0x0523=0x0000 +0x0565=0x0000 +0x0124=0x0000 +0x0592=0x0000 +0x0591=0x0000 +0x0563=0x0000 +0x024D=0x0000 +0x0567=0x0000 +0x05A5=0x0000 +0x0566=0x0000 +0x030A=0x0000 +0x029F=0x0000 +0x054C=0x0000 +0x0582=0x0000 +0x0599=0x0000 +0x0511=0x0000 +0x0506=0x0000 +0x0301=0x0000 +0x0595=0x0000 +0x0584=0x0000 +0x058C=0x0000 +0x051E=0x0000 +0x05A6=0x0000 +0x050F=0x0000 +0x0590=0x0000 +0x05A0=0x0000 +0x0596=0x0000 +0x05A7=0x0000 +0x0562=0x0000 +0x058A=0x0000 +0x059D=0x0000 +0x0485=0x0000 +0x0581=0x0000 +0x045D=0x0000 +0x0245=0x0000 +0x0310=0x0000 +0x058E=0x0000 +0x05A2=0x0000 +0x054D=0x0000 +0x020C=0x7FFF +0x0589=0x0000 +0x0522=0x0000 +0x049F=0x0000 +0x031F=0x0000 +0x0292=0x0000 +0x059F=0x0000 +0x0583=0x0000 +0x0543=0x0000 +0x0317=0x0000 +0x0244=0x0000 +0x0554=0x0000 +0x0593=0x0000 +0x05A4=0x0000 +0x02A3=0x0000 +0x0553=0x0000 +0x0542=0x0000 +0x0519=0x0000 +0x024F=0x0000 +0x0524=0x0000 +0x0518=0x0000 +0x0354=0x0000 +0x0526=0x0000 +0x031B=0x0000 +0x050E=0x0000 +0x0516=0x0000 +0x02CB=0x0000 +0x0250=0x0000 +0x031C=0x0000 +0x028F=0x0000 +0x051A=0x0000 +0x055C=0x0000 +0x0514=0x0000 +0x050A=0x0000 +0x050C=0x0000 +0x050B=0x0000 +0x04E7=0x0000 +0x04E6=0x0000 +0x04E5=0x0000 +0x0512=0x0000 +0x0206=0x0000 +0x0550=0x0000 +0x0360=0x0000 +0x030E=0x0000 +0x0203=0x0000 +0x0482=0x0000 +0x0541=0x0000 +0x0122=0x033F +0x0110=0x0BF4 +0x0204=0x0000 +0x0252=0x0000 +0x011E=0x06B9 +0x049B=0x0000 +0x0294=0x0000 +0x011C=0xAD41 +0x02D6=0x0000 +0x0311=0x0000 +0x0117=0x280C +0x02A4=0x0000 +0x0540=0x0000 +0x02E0=0x0000 +0x0118=0x018C +0x0489=0x0000 +0x04A7=0x0000 +0x0101=0x7800 +0x0558=0x0000 +0x02C6=0x0000 +0x05A1=0x0000 +0x02C9=0x0000 +0x039D=0x0000 +0x0500=0x0000 +0x0450=0x0000 +0x011F=0x3680 +0x030C=0x0000 +0x04DF=0x0000 +0x0281=0x0000 +0x0106=0x3182 +0x028E=0x0000 +0x0326=0x0000 +0x0113=0x03C3 +0x04CB=0x0000 +0x0391=0x0000 +0x0105=0x0007 +0x02D9=0x0000 +0x02CE=0x0000 +0x038B=0x0000 +0x044F=0x0000 +0x02D4=0x0000 +0x0107=0x318C +0x0495=0x0000 +0x0246=0x0000 +0x0303=0x0000 +0x02E6=0x0000 +0x045B=0x0000 +0x0100=0x3409 +0x0340=0x0000 +0x0208=0x0070 +0x0111=0x0083 +0x0247=0x0000 +0x024B=0x0000 +0x045C=0x0000 +0x0383=0x0000 +0x0202=0x07FF +0x054A=0x0000 +0x0401=0x07FF +0x0341=0x0000 +0x0287=0x0000 +0x034C=0x0000 +0x0501=0x0000 +0x030F=0x0000 +0x025D=0x0000 +0x0406=0x0000 +0x0313=0x0000 +0x010A=0x104C +0x0461=0x0000 +0x051B=0x0000 +0x0121=0x333C +0x0115=0x0009 +0x0112=0xC0E6 +0x039A=0x0000 +0x02CC=0x0000 +0x0116=0x8180 +0x04A0=0x0000 +0x0108=0x9442 +0x020B=0x4000 +0x0251=0x0000 +0x0488=0x0000 +0x0241=0x0000 +0x038F=0x0000 +0x02DC=0x0000 +0x024C=0x0000 +0x0494=0x0000 +0x051D=0x0000 +0x0243=0x0000 +0x0556=0x0000 +0x040A=0x0000 +0x04CD=0x0000 +0x0249=0x0000 +0x0261=0x0000 +0x024A=0x0000 +0x0285=0x0000 +0x0280=0x0000 +0x0346=0x0000 +0x024E=0x0000 +0x0253=0x0000 +0x028B=0x0000 +0x040C=0x0000 +0x0255=0x0000 +0x0258=0x0000 +0x0502=0x0000 +0x05A3=0x0000 +0x0367=0x0000 +0x0240=0x0020 +0x0256=0x0000 +0x025A=0x0000 +0x04E2=0x0000 +0x04C5=0x0000 +0x025B=0x0000 +0x0205=0x0000 +0x0361=0x0000 +0x0515=0x0000 +0x025C=0x0000 +0x0355=0x0000 +0x044C=0x0000 +0x010C=0x88FD +0x0284=0x0000 +0x0396=0x0000 +0x0363=0x0000 +0x031A=0x0000 +0x0289=0x0000 +0x028A=0x0000 +0x04DD=0x0000 +0x059C=0x0000 +0x0352=0x0000 +0x028C=0x0000 +0x04C2=0x0000 +0x04DA=0x0000 +0x025E=0x0000 +0x0327=0x0000 +0x0380=0x0000 +0x0342=0x0000 +0x0343=0x0000 +0x0344=0x0000 +0x0561=0x0000 +0x035A=0x0000 +0x02C8=0x0000 +0x0484=0x0000 +0x0586=0x0000 +0x0597=0x0000 +0x035F=0x0000 +0x0345=0x0000 +0x0505=0x0000 +0x035B=0x0000 +0x034A=0x0000 +0x0455=0x0000 +0x011A=0x2E02 +0x034B=0x0000 +0x034D=0x0000 +0x035C=0x0000 +0x034E=0x0000 +0x0293=0x0000 +0x03A6=0x0000 +0x0350=0x0000 +0x0445=0x0000 +0x048F=0x0000 +0x0351=0x0000 +0x0353=0x0000 +0x050D=0x0000 +0x02CD=0x0000 +0x0490=0x0000 +0x0498=0x0000 +0x0348=0x0000 +0x0356=0x0000 +0x030D=0x0000 +0x0316=0x0000 +0x040E=0x0000 +0x04A3=0x0000 +0x029D=0x0000 +0x0359=0x0000 +0x0299=0x0000 +0x0452=0x0000 +0x0442=0x0000 +0x035D=0x0000 +0x035E=0x0000 +0x0325=0x0000 +0x0364=0x0000 +0x0365=0x0000 +0x0366=0x0000 +0x0381=0x0000 +0x0288=0x0000 +0x0382=0x0000 +0x0384=0x0000 +0x0315=0x0000 +0x0385=0x0000 +0x04E3=0x0000 +0x040F=0x0000 +0x0389=0x0000 +0x054F=0x0000 +0x0386=0x0000 +0x02D0=0x0000 +0x054E=0x0000 +0x03A0=0x0000 +[reference_clocks] +sxt_ref_clk_mhz=30.72 +sxr_ref_clk_mhz=30.72 diff --git a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp index b12f7397f01160dafd9b3fbff8c43410b381f2e4..ece81dc7c3ba1c061983cb04daa797ff60e19f1a 100644 --- a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp +++ b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp @@ -29,7 +29,7 @@ /** usrp_lib.cpp * - * Author: HongliangXU : hong-liang-xu@agilent.com + * \author: HongliangXU : hong-liang-xu@agilent.com */ #include <string.h> @@ -38,6 +38,7 @@ #include <stdio.h> #include <uhd/utils/thread_priority.hpp> #include <uhd/usrp/multi_usrp.hpp> +#include <uhd/version.hpp> #include <boost/lexical_cast.hpp> #include <boost/algorithm/string.hpp> #include <iostream> @@ -54,47 +55,71 @@ # include <immintrin.h> #endif +/** @addtogroup _USRP_PHY_RF_INTERFACE_ + * @{ + */ + +/*! \brief USRP Configuration */ typedef struct { // -------------------------------- // variables for USRP configuration // -------------------------------- + //! USRP device pointer uhd::usrp::multi_usrp::sptr usrp; //uhd::usrp::multi_usrp::sptr rx_usrp; //create a send streamer and a receive streamer + //! USRP TX Stream uhd::tx_streamer::sptr tx_stream; + //! USRP RX Stream uhd::rx_streamer::sptr rx_stream; + //! USRP TX Metadata uhd::tx_metadata_t tx_md; + //! USRP RX Metadata uhd::rx_metadata_t rx_md; + //! USRP Timestamp Information uhd::time_spec_t tm_spec; + //setup variables and allocate buffer + //! USRP Metadata uhd::async_metadata_t async_md; + //! Sampling rate double sample_rate; - // time offset between transmiter timestamp and receiver timestamp; + + //! time offset between transmiter timestamp and receiver timestamp; double tdiff; - // use usrp_time_offset to get this value + + //! TX forward samples. We use usrp_time_offset to get this value int tx_forward_nsamps; //166 for 20Mhz // -------------------------------- // Debug and output control // -------------------------------- + //! Number of underflows int num_underflows; + //! Number of overflows int num_overflows; + + //! Number of sequential errors int num_seq_errors; - + //! tx count int64_t tx_count; + //! rx count int64_t rx_count; + //! timestamp of RX packet openair0_timestamp rx_timestamp; } usrp_state_t; - +/*! \brief Called to start the USRP transceiver. Return 0 if OK, < 0 if error + @param device pointer to the device structure specific to the RF hardware target +*/ static int trx_usrp_start(openair0_device *device) { usrp_state_t *s = (usrp_state_t*)device->priv; @@ -117,7 +142,9 @@ static int trx_usrp_start(openair0_device *device) return 0; } - +/*! \brief Terminate operation of the USRP transceiver -- free all associated resources + * \param device the hardware to use + */ static void trx_usrp_end(openair0_device *device) { usrp_state_t *s = (usrp_state_t*)device->priv; @@ -131,6 +158,14 @@ static void trx_usrp_end(openair0_device *device) } +/*! \brief Called to send samples to the USRP RF target + @param device pointer to the device structure specific to the RF hardware target + @param timestamp The timestamp at whicch the first sample MUST be sent + @param buff Buffer which holds the samples + @param nsamps number of samples to be sent + @param antenna_id index of the antenna if the device has multiple anteannas + @param flags flags must be set to TRUE if timestamp parameter needs to be applied +*/ static int trx_usrp_write(openair0_device *device, openair0_timestamp timestamp, void **buff, int nsamps, int cc, int flags) { usrp_state_t *s = (usrp_state_t*)device->priv; @@ -152,6 +187,17 @@ static int trx_usrp_write(openair0_device *device, openair0_timestamp timestamp, return 0; } +/*! \brief Receive samples from hardware. + * Read \ref nsamps samples from each channel to buffers. buff[0] is the array for + * the first channel. *ptimestamp is the time at which the first sample + * was received. + * \param device the hardware to use + * \param[out] ptimestamp the time at which the first sample was received. + * \param[out] buff An array of pointers to buffers for received samples. The buffers must be large enough to hold the number of samples \ref nsamps. + * \param nsamps Number of samples. One sample is 2 byte I + 2 byte Q => 4 byte. + * \param antenna_id Index of antenna for which to receive samples + * \returns the number of sample read +*/ static int trx_usrp_read(openair0_device *device, openair0_timestamp *ptimestamp, void **buff, int nsamps, int cc) { usrp_state_t *s = (usrp_state_t*)device->priv; @@ -171,7 +217,7 @@ static int trx_usrp_read(openair0_device *device, openair0_timestamp *ptimestamp #endif - if (device->type == USRP_B200_IF) { + if (device->type == USRP_B200_DEV) { if (cc>1) { // receive multiple channels (e.g. RF A and RF B) std::vector<void *> buff_ptrs; @@ -197,7 +243,7 @@ static int trx_usrp_read(openair0_device *device, openair0_timestamp *ptimestamp #endif } } - } else if (device->type == USRP_X300_IF) { + } else if (device->type == USRP_X300_DEV) { if (cc>1) { // receive multiple channels (e.g. RF A and RF B) std::vector<void *> buff_ptrs; @@ -237,6 +283,9 @@ static int trx_usrp_read(openair0_device *device, openair0_timestamp *ptimestamp return samples_received; } +/*! \brief Get current timestamp of USRP + * \param device the hardware to use +*/ openair0_timestamp get_usrp_time(openair0_device *device) { @@ -245,11 +294,21 @@ openair0_timestamp get_usrp_time(openair0_device *device) return s->usrp->get_time_now().to_ticks(s->sample_rate); } +/*! \brief Compares two variables within precision + * \param a first variable + * \param b second variable +*/ static bool is_equal(double a, double b) { return std::fabs(a-b) < std::numeric_limits<double>::epsilon(); } +/*! \brief Set frequencies (TX/RX) + * \param device the hardware to use + * \param openair0_cfg RF frontend parameters set by application + * \param dummy dummy variable not used + * \returns 0 in success + */ int trx_usrp_set_freq(openair0_device* device, openair0_config_t *openair0_cfg, int dummy) { usrp_state_t *s = (usrp_state_t*)device->priv; @@ -261,6 +320,11 @@ int trx_usrp_set_freq(openair0_device* device, openair0_config_t *openair0_cfg, } +/*! \brief Set RX frequencies + * \param device the hardware to use + * \param openair0_cfg RF frontend parameters set by application + * \returns 0 in success + */ int openair0_set_rx_frequencies(openair0_device* device, openair0_config_t *openair0_cfg) { usrp_state_t *s = (usrp_state_t*)device->priv; @@ -278,6 +342,11 @@ int openair0_set_rx_frequencies(openair0_device* device, openair0_config_t *open } +/*! \brief Set Gains (TX/RX) + * \param device the hardware to use + * \param openair0_cfg RF frontend parameters set by application + * \returns 0 in success + */ int trx_usrp_set_gains(openair0_device* device, openair0_config_t *openair0_cfg) { @@ -298,33 +367,75 @@ int trx_usrp_set_gains(openair0_device* device, return(0); } +/*! \brief Stop USRP + * \param card refers to the hardware index to use + */ int trx_usrp_stop(int card) { return(0); } - +/*! \brief USRPB210 RX calibration table */ rx_gain_calib_table_t calib_table_b210[] = { - {3500000000.0,46.0}, - {2660000000.0,53.0}, - {2300000000.0,54.0}, - {1880000000.0,55.0}, - {816000000.0,62.0}, + {3500000000.0,44.0}, + {2660000000.0,49.0}, + {2300000000.0,50.0}, + {1880000000.0,53.0}, + {816000000.0,58.0}, {-1,0}}; +/*! \brief USRPB210 RX calibration table */ +rx_gain_calib_table_t calib_table_b210_38[] = { + {3500000000.0,44.0}, + {2660000000.0,49.8}, + {2300000000.0,51.0}, + {1880000000.0,53.0}, + {816000000.0,57.0}, + {-1,0}}; + +/*! \brief USRPx310 RX calibration table */ rx_gain_calib_table_t calib_table_x310[] = { {3500000000.0,77.0}, - {2660000000.0,80.0}, + {2660000000.0,81.0}, {2300000000.0,81.0}, {1880000000.0,82.0}, {816000000.0,85.0}, {-1,0}}; -void set_rx_gain_offset(openair0_config_t *openair0_cfg, int chain_index) { +/*! \brief Set RX gain offset + * \param openair0_cfg RF frontend parameters set by application + * \param chain_index RF chain to apply settings to + * \returns 0 in success + */ +void set_rx_gain_offset(openair0_config_t *openair0_cfg, int chain_index,int bw_gain_adjust) { int i=0; // loop through calibration table to find best adjustment factor for RX frequency - double min_diff = 6e9,diff; - + double min_diff = 6e9,diff,gain_adj=0.0; + if (bw_gain_adjust==1) { + switch ((int)openair0_cfg[0].sample_rate) { + case 30720000: + break; + case 23040000: + gain_adj=1.25; + break; + case 15360000: + gain_adj=3.0; + break; + case 7680000: + gain_adj=6.0; + break; + case 3840000: + gain_adj=9.0; + break; + case 1920000: + gain_adj=12.0; + break; + default: + printf("unknown sampling rate %d\n",(int)openair0_cfg[0].sample_rate); + exit(-1); + break; + } + } while (openair0_cfg->rx_gain_calib_table[i].freq>0) { diff = fabs(openair0_cfg->rx_freq[chain_index] - openair0_cfg->rx_gain_calib_table[i].freq); printf("cal %d: freq %f, offset %f, diff %f\n", @@ -333,19 +444,27 @@ void set_rx_gain_offset(openair0_config_t *openair0_cfg, int chain_index) { openair0_cfg->rx_gain_calib_table[i].offset,diff); if (min_diff > diff) { min_diff = diff; - openair0_cfg->rx_gain_offset[chain_index] = openair0_cfg->rx_gain_calib_table[i].offset; + openair0_cfg->rx_gain_offset[chain_index] = openair0_cfg->rx_gain_calib_table[i].offset+gain_adj; } i++; } } - +/*! \brief print the USRP statistics +* \param device the hardware to use +* \returns 0 on success +*/ int trx_usrp_get_stats(openair0_device* device) { return(0); } + +/*! \brief Reset the USRP statistics +* \param device the hardware to use +* \returns 0 on success +*/ int trx_usrp_reset_stats(openair0_device* device) { return(0); @@ -353,21 +472,33 @@ int trx_usrp_reset_stats(openair0_device* device) { } -int openair0_dev_init_usrp(openair0_device* device, openair0_config_t *openair0_cfg) -{ - uhd::set_thread_priority_safe(1.0); - usrp_state_t *s = (usrp_state_t*)malloc(sizeof(usrp_state_t)); - memset(s, 0, sizeof(usrp_state_t)); - // Initialize USRP device +extern "C" { +/*! \brief Initialize Openair USRP target. It returns 0 if OK +* \param device the hardware to use +* \param openair0_cfg RF frontend parameters set by application +*/ + int device_init(openair0_device* device, openair0_config_t *openair0_cfg) { + + uhd::set_thread_priority_safe(1.0); + usrp_state_t *s = (usrp_state_t*)malloc(sizeof(usrp_state_t)); + memset(s, 0, sizeof(usrp_state_t)); + + // Initialize USRP device + std::string args = "type=b200"; uhd::device_addrs_t device_adds = uhd::device::find(args); size_t i; + + int vers=0,subvers=0,subsubvers=0; + int bw_gain_adjust=0; - printf("Checking for USRPs\n"); + sscanf(uhd::get_version_string().c_str(),"%d.%d.%d",&vers,&subvers,&subsubvers); + + printf("Checking for USRPs : UHD %s (%d.%d.%d)\n",uhd::get_version_string().c_str(),vers,subvers,subsubvers); if(device_adds.size() == 0) { @@ -388,6 +519,7 @@ int openair0_dev_init_usrp(openair0_device* device, openair0_config_t *openair0_ } + printf("Found USRP X300\n"); s->usrp = uhd::usrp::multi_usrp::make(args); // s->usrp->set_rx_subdev_spec(rx_subdev); @@ -397,34 +529,42 @@ int openair0_dev_init_usrp(openair0_device* device, openair0_config_t *openair0_ s->usrp->set_clock_source("internal"); //Setting device type to USRP X300/X310 - device->type=USRP_X300_IF; + device->type=USRP_X300_DEV; // this is not working yet, master clock has to be set via constructor // set master clock rate and sample rate for tx & rx for streaming //s->usrp->set_master_clock_rate(usrp_master_clock); openair0_cfg[0].rx_gain_calib_table = calib_table_x310; - + switch ((int)openair0_cfg[0].sample_rate) { case 30720000: // from usrp_time_offset openair0_cfg[0].samples_per_packet = 2048; openair0_cfg[0].tx_sample_advance = 15; + openair0_cfg[0].tx_bw = 20e6; + openair0_cfg[0].rx_bw = 20e6; openair0_cfg[0].tx_scheduling_advance = 8*openair0_cfg[0].samples_per_packet; break; case 15360000: openair0_cfg[0].samples_per_packet = 2048; openair0_cfg[0].tx_sample_advance = 45; + openair0_cfg[0].tx_bw = 10e6; + openair0_cfg[0].rx_bw = 10e6; openair0_cfg[0].tx_scheduling_advance = 5*openair0_cfg[0].samples_per_packet; break; case 7680000: openair0_cfg[0].samples_per_packet = 1024; openair0_cfg[0].tx_sample_advance = 50; + openair0_cfg[0].tx_bw = 5e6; + openair0_cfg[0].rx_bw = 5e6; openair0_cfg[0].tx_scheduling_advance = 5*openair0_cfg[0].samples_per_packet; break; case 1920000: openair0_cfg[0].samples_per_packet = 256; openair0_cfg[0].tx_sample_advance = 50; + openair0_cfg[0].tx_bw = 1.25e6; + openair0_cfg[0].rx_bw = 1.25e6; openair0_cfg[0].tx_scheduling_advance = 8*openair0_cfg[0].samples_per_packet; break; default: @@ -435,41 +575,68 @@ int openair0_dev_init_usrp(openair0_device* device, openair0_config_t *openair0_ } else { printf("Found USRP B200"); + args += ",num_recv_frames=256" ; s->usrp = uhd::usrp::multi_usrp::make(args); // s->usrp->set_rx_subdev_spec(rx_subdev); // s->usrp->set_tx_subdev_spec(tx_subdev); - -// do not explicitly set the clock to "internal", because this will disable the gpsdo -// // lock mboard clocks -// s->usrp->set_clock_source("internal"); + + // do not explicitly set the clock to "internal", because this will disable the gpsdo + // // lock mboard clocks + // s->usrp->set_clock_source("internal"); // set master clock rate and sample rate for tx & rx for streaming - device->type = USRP_B200_IF; - s->usrp->set_master_clock_rate(30.72e6); + device->type = USRP_B200_DEV; - openair0_cfg[0].rx_gain_calib_table = calib_table_b210; + if ((vers == 3) && (subvers == 9) && (subsubvers>=2)) { + openair0_cfg[0].rx_gain_calib_table = calib_table_b210; + bw_gain_adjust=0; + } + else { + openair0_cfg[0].rx_gain_calib_table = calib_table_b210_38; + bw_gain_adjust=1; + } switch ((int)openair0_cfg[0].sample_rate) { case 30720000: + s->usrp->set_master_clock_rate(30.72e6); // from usrp_time_offset - openair0_cfg[0].samples_per_packet = 2048; + openair0_cfg[0].samples_per_packet = 4096; openair0_cfg[0].tx_sample_advance = 115; + openair0_cfg[0].tx_bw = 20e6; + openair0_cfg[0].rx_bw = 20e6; openair0_cfg[0].tx_scheduling_advance = 11*openair0_cfg[0].samples_per_packet; break; + case 23040000: + s->usrp->set_master_clock_rate(46.08e6); + openair0_cfg[0].samples_per_packet = 2048; + openair0_cfg[0].tx_sample_advance = 113; + openair0_cfg[0].tx_bw = 20e6; + openair0_cfg[0].rx_bw = 20e6; + openair0_cfg[0].tx_scheduling_advance = 8*openair0_cfg[0].samples_per_packet; + break; case 15360000: + s->usrp->set_master_clock_rate(30.72e6); openair0_cfg[0].samples_per_packet = 2048; openair0_cfg[0].tx_sample_advance = 113; + openair0_cfg[0].tx_bw = 10e6; + openair0_cfg[0].rx_bw = 10e6; openair0_cfg[0].tx_scheduling_advance = 5*openair0_cfg[0].samples_per_packet; break; case 7680000: + s->usrp->set_master_clock_rate(30.72e6); openair0_cfg[0].samples_per_packet = 1024; openair0_cfg[0].tx_sample_advance = 70;//103; + openair0_cfg[0].tx_bw = 5e6; + openair0_cfg[0].rx_bw = 5e6; openair0_cfg[0].tx_scheduling_advance = 5*openair0_cfg[0].samples_per_packet; break; case 1920000: + s->usrp->set_master_clock_rate(30.72e6); openair0_cfg[0].samples_per_packet = 256; openair0_cfg[0].tx_sample_advance = 40; + openair0_cfg[0].tx_bw = 1.25e6; + openair0_cfg[0].rx_bw = 1.25e6; openair0_cfg[0].tx_scheduling_advance = 8*openair0_cfg[0].samples_per_packet; break; default: @@ -479,13 +646,19 @@ int openair0_dev_init_usrp(openair0_device* device, openair0_config_t *openair0_ } } + /* device specific */ + openair0_cfg[0].txlaunch_wait = 1;//manage when TX processing is triggered + openair0_cfg[0].txlaunch_wait_slotcount = 1; //manage when TX processing is triggered + openair0_cfg[0].iq_txshift = 4;//shift + openair0_cfg[0].iq_rxrescale = 15;//rescale iqs + for(i=0;i<s->usrp->get_rx_num_channels();i++) { if (i<openair0_cfg[0].rx_num_channels) { s->usrp->set_rx_rate(openair0_cfg[0].sample_rate,i); s->usrp->set_rx_bandwidth(openair0_cfg[0].rx_bw,i); printf("Setting rx freq/gain on channel %lu/%lu : BW %f (readback %f)\n",i,s->usrp->get_rx_num_channels(),openair0_cfg[0].rx_bw/1e6,s->usrp->get_rx_bandwidth(i)/1e6); s->usrp->set_rx_freq(openair0_cfg[0].rx_freq[i],i); - set_rx_gain_offset(&openair0_cfg[0],i); + set_rx_gain_offset(&openair0_cfg[0],i,bw_gain_adjust); ::uhd::gain_range_t gain_range = s->usrp->get_rx_gain_range(i); // limit to maximum gain @@ -532,10 +705,7 @@ int openair0_dev_init_usrp(openair0_device* device, openair0_config_t *openair0_ s->usrp->set_time_now(uhd::time_spec_t(0.0)); - - - - + for (i=0;i<openair0_cfg[0].rx_num_channels;i++) { if (i<openair0_cfg[0].rx_num_channels) { @@ -583,4 +753,6 @@ int openair0_dev_init_usrp(openair0_device* device, openair0_config_t *openair0_ if(is_equal(s->sample_rate, (double)7.68e6)) s->tx_forward_nsamps = 50; return 0; + } } +/*@}*/ diff --git a/targets/DOCS/Doxyfile b/targets/DOCS/Doxyfile index 0d32a3ffad73ffc7d69b0870a28f2fd394979ef9..ac6ee99480063889df7bec664722b23229e47ff9 100644 --- a/targets/DOCS/Doxyfile +++ b/targets/DOCS/Doxyfile @@ -793,7 +793,10 @@ INPUT = $(OPENAIR1_DIR)/PHY/defs.h \ $(OPENAIR2_DIR)/LAYER2/RLC/UM_v9.3.0/rlc_um.h \ $(OPENAIR2_DIR)/LAYER2/RLC/UM_v9.3.0/rlc_um_entity.h \ $(OPENAIR2_DIR)/NETWORK_DRIVER/MESH/proto_extern.h \ - $(OPENAIR_TARGETS)/ARCH/COMMON/common_lib.h + $(OPENAIR_TARGETS)/ARCH/COMMON/common_lib.h \ + $(OPENAIR_TARGETS)/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp \ + $(OPENAIR_TARGETS)/ARCH/BLADERF/USERSPACE/LIB/bladerf_lib.c \ + $(OPENAIR_TARGETS)/ARCH/BLADERF/USERSPACE/LIB/bladerf_lib.h # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.50PRB.lmssdr.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.50PRB.lmssdr.conf new file mode 100644 index 0000000000000000000000000000000000000000..6b93021426a3345c2b382ac582c7288310ae471b --- /dev/null +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.50PRB.lmssdr.conf @@ -0,0 +1,171 @@ +Active_eNBs = ( "eNB_Eurecom_LTEBox"); +# Asn1_verbosity, choice in: none, info, annoying +Asn1_verbosity = "none"; + +eNBs = +( + { + ////////// Identification parameters: + eNB_ID = 0xe00; + + cell_type = "CELL_MACRO_ENB"; + + eNB_name = "eNB_Eurecom_LTEBox"; + + // Tracking area code, 0x0000 and 0xfffe are reserved values + tracking_area_code = "1"; + + mobile_country_code = "208"; + + mobile_network_code = "95"; + + ////////// Physical parameters: + + component_carriers = ( + { + frame_type = "FDD"; + tdd_config = 3; + tdd_config_s = 0; + prefix_type = "NORMAL"; + eutra_band = 13; + downlink_frequency = 751000000L; + uplink_frequency_offset = 31000000; + Nid_cell = 0; + N_RB_DL = 50; + Nid_cell_mbsfn = 0; + nb_antennas_tx = 1; + nb_antennas_rx = 1; + tx_gain = 90; + rx_gain = 125; + prach_root = 0; + prach_config_index = 0; + prach_high_speed = "DISABLE"; + prach_zero_correlation = 1; + prach_freq_offset = 2; + pucch_delta_shift = 1; + pucch_nRB_CQI = 1; + pucch_nCS_AN = 0; + pucch_n1_AN = 32; + pdsch_referenceSignalPower = -20; + pdsch_p_b = 0; + pusch_n_SB = 1; + pusch_enable64QAM = "DISABLE"; + pusch_hoppingMode = "interSubFrame"; + pusch_hoppingOffset = 0; + pusch_groupHoppingEnabled = "ENABLE"; + pusch_groupAssignment = 0; + pusch_sequenceHoppingEnabled = "DISABLE"; + pusch_nDMRS1 = 1; + phich_duration = "NORMAL"; + phich_resource = "ONESIXTH"; + srs_enable = "DISABLE"; + /* srs_BandwidthConfig =; + srs_SubframeConfig =; + srs_ackNackST =; + srs_MaxUpPts =;*/ + + pusch_p0_Nominal = -90; + pusch_alpha = "AL1"; + pucch_p0_Nominal = -96; + msg3_delta_Preamble = 6; + pucch_deltaF_Format1 = "deltaF2"; + pucch_deltaF_Format1b = "deltaF3"; + pucch_deltaF_Format2 = "deltaF0"; + pucch_deltaF_Format2a = "deltaF0"; + pucch_deltaF_Format2b = "deltaF0"; + + rach_numberOfRA_Preambles = 64; + rach_preamblesGroupAConfig = "DISABLE"; + /* + rach_sizeOfRA_PreamblesGroupA = ; + rach_messageSizeGroupA = ; + rach_messagePowerOffsetGroupB = ; + */ + rach_powerRampingStep = 4; + rach_preambleInitialReceivedTargetPower = -108; + rach_preambleTransMax = 10; + rach_raResponseWindowSize = 10; + rach_macContentionResolutionTimer = 48; + rach_maxHARQ_Msg3Tx = 4; + + pcch_default_PagingCycle = 128; + pcch_nB = "oneT"; + bcch_modificationPeriodCoeff = 2; + ue_TimersAndConstants_t300 = 1000; + ue_TimersAndConstants_t301 = 1000; + ue_TimersAndConstants_t310 = 1000; + ue_TimersAndConstants_t311 = 10000; + ue_TimersAndConstants_n310 = 20; + ue_TimersAndConstants_n311 = 1; + + } + ); + + + srb1_parameters : + { + # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] + timer_poll_retransmit = 80; + + # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] + timer_reordering = 35; + + # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] + timer_status_prohibit = 0; + + # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] + poll_pdu = 4; + + # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] + poll_byte = 99999; + + # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] + max_retx_threshold = 4; + } + + # ------- SCTP definitions + SCTP : + { + # Number of streams to use in input/output + SCTP_INSTREAMS = 2; + SCTP_OUTSTREAMS = 2; + }; + + + ////////// MME parameters: + mme_ip_address = ( { ipv4 = "192.168.12.62"; + ipv6 = "192:168:30::17"; + active = "yes"; + preference = "ipv4"; + } + ); + + NETWORK_INTERFACES : + { + ENB_INTERFACE_NAME_FOR_S1_MME = "eth4"; + ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.242/24"; + + ENB_INTERFACE_NAME_FOR_S1U = "eth4"; + ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.242/24"; + ENB_PORT_FOR_S1U = 2152; # Spec 2152 + }; + + log_config : + { + global_log_level ="info"; + global_log_verbosity ="medium"; + hw_log_level ="info"; + hw_log_verbosity ="medium"; + phy_log_level ="info"; + phy_log_verbosity ="medium"; + mac_log_level ="info"; + mac_log_verbosity ="high"; + rlc_log_level ="info"; + rlc_log_verbosity ="medium"; + pdcp_log_level ="info"; + pdcp_log_verbosity ="medium"; + rrc_log_level ="info"; + rrc_log_verbosity ="medium"; + }; + } +); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.50PRB.sedora.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.50PRB.sedora.conf new file mode 100644 index 0000000000000000000000000000000000000000..2d0b63e4b0a2f1135cb420b14d066006d2c2337e --- /dev/null +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.50PRB.sedora.conf @@ -0,0 +1,171 @@ +Active_eNBs = ( "eNB_Eurecom_LTEBox"); +# Asn1_verbosity, choice in: none, info, annoying +Asn1_verbosity = "none"; + +eNBs = +( + { + ////////// Identification parameters: + eNB_ID = 0xe00; + + cell_type = "CELL_MACRO_ENB"; + + eNB_name = "eNB_Eurecom_LTEBox"; + + // Tracking area code, 0x0000 and 0xfffe are reserved values + tracking_area_code = "1"; + + mobile_country_code = "208"; + + mobile_network_code = "93"; + + ////////// Physical parameters: + + component_carriers = ( + { + frame_type = "FDD"; + tdd_config = 3; + tdd_config_s = 0; + prefix_type = "NORMAL"; + eutra_band = 7; + downlink_frequency = 751000000L; + uplink_frequency_offset = 30000000; + Nid_cell = 0; + N_RB_DL = 50; + Nid_cell_mbsfn = 0; + nb_antennas_tx = 1; + nb_antennas_rx = 1; + tx_gain = 60; + rx_gain = 111; + prach_root = 0; + prach_config_index = 0; + prach_high_speed = "DISABLE"; + prach_zero_correlation = 1; + prach_freq_offset = 2; + pucch_delta_shift = 1; + pucch_nRB_CQI = 1; + pucch_nCS_AN = 0; + pucch_n1_AN = 32; + pdsch_referenceSignalPower = -29; + pdsch_p_b = 0; + pusch_n_SB = 1; + pusch_enable64QAM = "DISABLE"; + pusch_hoppingMode = "interSubFrame"; + pusch_hoppingOffset = 0; + pusch_groupHoppingEnabled = "ENABLE"; + pusch_groupAssignment = 0; + pusch_sequenceHoppingEnabled = "DISABLE"; + pusch_nDMRS1 = 1; + phich_duration = "NORMAL"; + phich_resource = "ONESIXTH"; + srs_enable = "DISABLE"; + /* srs_BandwidthConfig =; + srs_SubframeConfig =; + srs_ackNackST =; + srs_MaxUpPts =;*/ + + pusch_p0_Nominal = -85; + pusch_alpha = "AL1"; + pucch_p0_Nominal = -96; + msg3_delta_Preamble = 6; + pucch_deltaF_Format1 = "deltaF2"; + pucch_deltaF_Format1b = "deltaF3"; + pucch_deltaF_Format2 = "deltaF0"; + pucch_deltaF_Format2a = "deltaF0"; + pucch_deltaF_Format2b = "deltaF0"; + + rach_numberOfRA_Preambles = 64; + rach_preamblesGroupAConfig = "DISABLE"; +/* + rach_sizeOfRA_PreamblesGroupA = ; + rach_messageSizeGroupA = ; + rach_messagePowerOffsetGroupB = ; +*/ + rach_powerRampingStep = 4; + rach_preambleInitialReceivedTargetPower = -100; + rach_preambleTransMax = 10; + rach_raResponseWindowSize = 10; + rach_macContentionResolutionTimer = 48; + rach_maxHARQ_Msg3Tx = 4; + + pcch_default_PagingCycle = 128; + pcch_nB = "oneT"; + bcch_modificationPeriodCoeff = 2; + ue_TimersAndConstants_t300 = 1000; + ue_TimersAndConstants_t301 = 1000; + ue_TimersAndConstants_t310 = 1000; + ue_TimersAndConstants_t311 = 10000; + ue_TimersAndConstants_n310 = 20; + ue_TimersAndConstants_n311 = 1; + + } + ); + + + srb1_parameters : + { + # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] + timer_poll_retransmit = 80; + + # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] + timer_reordering = 35; + + # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] + timer_status_prohibit = 0; + + # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] + poll_pdu = 4; + + # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] + poll_byte = 99999; + + # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] + max_retx_threshold = 4; + } + + # ------- SCTP definitions + SCTP : + { + # Number of streams to use in input/output + SCTP_INSTREAMS = 2; + SCTP_OUTSTREAMS = 2; + }; + + ////////// MME parameters: + mme_ip_address = ( { ipv4 = "192.168.12.11"; + ipv6 = "192:168:30::17"; + active = "yes"; + preference = "ipv4"; + } + ); + + NETWORK_INTERFACES : + { + ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; + ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.215/24"; + + ENB_INTERFACE_NAME_FOR_S1U = "eth0"; + ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.215/24"; + ENB_PORT_FOR_S1U = 2152; # Spec 2152 + }; + + log_config : + { + global_log_level ="info"; + global_log_verbosity ="medium"; + hw_log_level ="info"; + hw_log_verbosity ="medium"; + phy_log_level ="info"; + phy_log_verbosity ="medium"; + mac_log_level ="info"; + mac_log_verbosity ="high"; + rlc_log_level ="info"; + rlc_log_verbosity ="medium"; + pdcp_log_level ="info"; + pdcp_log_verbosity ="medium"; + rrc_log_level ="info"; + rrc_log_verbosity ="medium"; + }; + + } +); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.lmssdr.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.lmssdr.conf new file mode 100644 index 0000000000000000000000000000000000000000..dacc3e8664801ae030d54555984e83536ec1af8a --- /dev/null +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.lmssdr.conf @@ -0,0 +1,171 @@ +Active_eNBs = ( "eNB_Eurecom_LTEBox"); +# Asn1_verbosity, choice in: none, info, annoying +Asn1_verbosity = "none"; + +eNBs = +( + { + ////////// Identification parameters: + eNB_ID = 0xe00; + + cell_type = "CELL_MACRO_ENB"; + + eNB_name = "eNB_Eurecom_LTEBox"; + + // Tracking area code, 0x0000 and 0xfffe are reserved values + tracking_area_code = "1"; + + mobile_country_code = "208"; + + mobile_network_code = "95"; + + ////////// Physical parameters: + + component_carriers = ( + { + frame_type = "FDD"; + tdd_config = 3; + tdd_config_s = 0; + prefix_type = "NORMAL"; + eutra_band = 13; + downlink_frequency = 751000000L; + uplink_frequency_offset = 31000000; + Nid_cell = 0; + N_RB_DL = 25; + Nid_cell_mbsfn = 0; + nb_antennas_tx = 1; + nb_antennas_rx = 1; + tx_gain = 90; + rx_gain = 125; + prach_root = 0; + prach_config_index = 0; + prach_high_speed = "DISABLE"; + prach_zero_correlation = 1; + prach_freq_offset = 2; + pucch_delta_shift = 1; + pucch_nRB_CQI = 1; + pucch_nCS_AN = 0; + pucch_n1_AN = 32; + pdsch_referenceSignalPower = -17; + pdsch_p_b = 0; + pusch_n_SB = 1; + pusch_enable64QAM = "DISABLE"; + pusch_hoppingMode = "interSubFrame"; + pusch_hoppingOffset = 0; + pusch_groupHoppingEnabled = "ENABLE"; + pusch_groupAssignment = 0; + pusch_sequenceHoppingEnabled = "DISABLE"; + pusch_nDMRS1 = 1; + phich_duration = "NORMAL"; + phich_resource = "ONESIXTH"; + srs_enable = "DISABLE"; + /* srs_BandwidthConfig =; + srs_SubframeConfig =; + srs_ackNackST =; + srs_MaxUpPts =;*/ + + pusch_p0_Nominal = -90; + pusch_alpha = "AL1"; + pucch_p0_Nominal = -96; + msg3_delta_Preamble = 6; + pucch_deltaF_Format1 = "deltaF2"; + pucch_deltaF_Format1b = "deltaF3"; + pucch_deltaF_Format2 = "deltaF0"; + pucch_deltaF_Format2a = "deltaF0"; + pucch_deltaF_Format2b = "deltaF0"; + + rach_numberOfRA_Preambles = 64; + rach_preamblesGroupAConfig = "DISABLE"; + /* + rach_sizeOfRA_PreamblesGroupA = ; + rach_messageSizeGroupA = ; + rach_messagePowerOffsetGroupB = ; + */ + rach_powerRampingStep = 4; + rach_preambleInitialReceivedTargetPower = -108; + rach_preambleTransMax = 10; + rach_raResponseWindowSize = 10; + rach_macContentionResolutionTimer = 48; + rach_maxHARQ_Msg3Tx = 4; + + pcch_default_PagingCycle = 128; + pcch_nB = "oneT"; + bcch_modificationPeriodCoeff = 2; + ue_TimersAndConstants_t300 = 1000; + ue_TimersAndConstants_t301 = 1000; + ue_TimersAndConstants_t310 = 1000; + ue_TimersAndConstants_t311 = 10000; + ue_TimersAndConstants_n310 = 20; + ue_TimersAndConstants_n311 = 1; + + } + ); + + + srb1_parameters : + { + # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] + timer_poll_retransmit = 80; + + # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] + timer_reordering = 35; + + # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] + timer_status_prohibit = 0; + + # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] + poll_pdu = 4; + + # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] + poll_byte = 99999; + + # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] + max_retx_threshold = 4; + } + + # ------- SCTP definitions + SCTP : + { + # Number of streams to use in input/output + SCTP_INSTREAMS = 2; + SCTP_OUTSTREAMS = 2; + }; + + + ////////// MME parameters: + mme_ip_address = ( { ipv4 = "192.168.12.62"; + ipv6 = "192:168:30::17"; + active = "yes"; + preference = "ipv4"; + } + ); + + NETWORK_INTERFACES : + { + ENB_INTERFACE_NAME_FOR_S1_MME = "eth4"; + ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.242/24"; + + ENB_INTERFACE_NAME_FOR_S1U = "eth4"; + ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.242/24"; + ENB_PORT_FOR_S1U = 2152; # Spec 2152 + }; + + log_config : + { + global_log_level ="info"; + global_log_verbosity ="medium"; + hw_log_level ="info"; + hw_log_verbosity ="medium"; + phy_log_level ="info"; + phy_log_verbosity ="medium"; + mac_log_level ="info"; + mac_log_verbosity ="high"; + rlc_log_level ="info"; + rlc_log_verbosity ="medium"; + pdcp_log_level ="info"; + pdcp_log_verbosity ="medium"; + rrc_log_level ="info"; + rrc_log_verbosity ="medium"; + }; + } +); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.rrh.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.rrh.usrpb210.conf new file mode 100644 index 0000000000000000000000000000000000000000..98226144ab062cbef4a3b0835b524d7cea58a765 --- /dev/null +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.rrh.usrpb210.conf @@ -0,0 +1,190 @@ +Active_eNBs = ( "eNB_Eurecom_LTEBox"); +# Asn1_verbosity, choice in: none, info, annoying +Asn1_verbosity = "none"; + +eNBs = +( + { + ////////// Identification parameters: + eNB_ID = 0xe00; + + cell_type = "CELL_MACRO_ENB"; + + eNB_name = "eNB_Eurecom_LTEBox"; + + // Tracking area code, 0x0000 and 0xfffe are reserved values + tracking_area_code = "1"; + + mobile_country_code = "208"; + + mobile_network_code = "95"; + + ////////// Physical parameters: + + component_carriers = ( + { + frame_type = "FDD"; + tdd_config = 3; + tdd_config_s = 0; + prefix_type = "NORMAL"; + eutra_band = 13; + downlink_frequency = 751000000L; + uplink_frequency_offset = 31000000; + Nid_cell = 0; + N_RB_DL = 25; + Nid_cell_mbsfn = 0; + nb_antennas_tx = 1; + nb_antennas_rx = 1; + tx_gain = 90; + rx_gain = 100; + prach_root = 0; + prach_config_index = 0; + prach_high_speed = "DISABLE"; + prach_zero_correlation = 1; + prach_freq_offset = 2; + pucch_delta_shift = 1; + pucch_nRB_CQI = 1; + pucch_nCS_AN = 0; + pucch_n1_AN = 32; + pdsch_referenceSignalPower = -15; + pdsch_p_b = 0; + pusch_n_SB = 1; + pusch_enable64QAM = "DISABLE"; + pusch_hoppingMode = "interSubFrame"; + pusch_hoppingOffset = 0; + pusch_groupHoppingEnabled = "ENABLE"; + pusch_groupAssignment = 0; + pusch_sequenceHoppingEnabled = "DISABLE"; + pusch_nDMRS1 = 1; + phich_duration = "NORMAL"; + phich_resource = "ONESIXTH"; + srs_enable = "DISABLE"; + /* srs_BandwidthConfig =; + srs_SubframeConfig =; + srs_ackNackST =; + srs_MaxUpPts =;*/ + + pusch_p0_Nominal = -86; + pusch_alpha = "AL1"; + pucch_p0_Nominal = -96; + msg3_delta_Preamble = 6; + pucch_deltaF_Format1 = "deltaF2"; + pucch_deltaF_Format1b = "deltaF3"; + pucch_deltaF_Format2 = "deltaF0"; + pucch_deltaF_Format2a = "deltaF0"; + pucch_deltaF_Format2b = "deltaF0"; + + rach_numberOfRA_Preambles = 64; + rach_preamblesGroupAConfig = "DISABLE"; + /* + rach_sizeOfRA_PreamblesGroupA = ; + rach_messageSizeGroupA = ; + rach_messagePowerOffsetGroupB = ; + */ + rach_powerRampingStep = 4; + rach_preambleInitialReceivedTargetPower = -108; + rach_preambleTransMax = 10; + rach_raResponseWindowSize = 10; + rach_macContentionResolutionTimer = 48; + rach_maxHARQ_Msg3Tx = 4; + + pcch_default_PagingCycle = 128; + pcch_nB = "oneT"; + bcch_modificationPeriodCoeff = 2; + ue_TimersAndConstants_t300 = 1000; + ue_TimersAndConstants_t301 = 1000; + ue_TimersAndConstants_t310 = 1000; + ue_TimersAndConstants_t311 = 10000; + ue_TimersAndConstants_n310 = 20; + ue_TimersAndConstants_n311 = 1; + + } + ); + + + srb1_parameters : + { + # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] + timer_poll_retransmit = 80; + + # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] + timer_reordering = 35; + + # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] + timer_status_prohibit = 0; + + # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] + poll_pdu = 4; + + # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] + poll_byte = 99999; + + # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] + max_retx_threshold = 4; + } + + # ------- SCTP definitions + SCTP : + { + # Number of streams to use in input/output + SCTP_INSTREAMS = 2; + SCTP_OUTSTREAMS = 2; + }; + + + ////////// MME parameters: + mme_ip_address = ( { ipv4 = "192.168.12.62"; + ipv6 = "192:168:30::17"; + active = "yes"; + preference = "ipv4"; + } + ); + +rrh_gw_config = ( + { + local_if_name = "eth0"; + #remote_address = "169.254.10.158"; + #local_address = "169.254.8.15"; + remote_address = "74:d4:35:cc:88:45"; + local_address = "98:90:96:df:66:07"; + local_port = 50000; #for raw option local port must be the same to remote + remote_port = 50000; + rrh_gw_active = "yes"; + tr_preference = "raw"; + rf_preference = "usrp_b200"; + iq_txshift = 5; + tx_sample_advance = 70; + tx_scheduling_advance = 9; + +} +); + + NETWORK_INTERFACES : + { + ENB_INTERFACE_NAME_FOR_S1_MME = "eth4"; + ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.242/24"; + + ENB_INTERFACE_NAME_FOR_S1U = "eth4"; + ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.242/24"; + ENB_PORT_FOR_S1U = 2152; # Spec 2152 + }; + + log_config : + { + global_log_level ="info"; + global_log_verbosity ="medium"; + hw_log_level ="info"; + hw_log_verbosity ="medium"; + phy_log_level ="info"; + phy_log_verbosity ="medium"; + mac_log_level ="info"; + mac_log_verbosity ="high"; + rlc_log_level ="info"; + rlc_log_verbosity ="medium"; + pdcp_log_level ="info"; + pdcp_log_verbosity ="medium"; + rrc_log_level ="info"; + rrc_log_verbosity ="medium"; + }; + } +); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.usrpb210.conf new file mode 100644 index 0000000000000000000000000000000000000000..1bf3c6fbf29d6e4edab9162ee392857eee526f7f --- /dev/null +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.usrpb210.conf @@ -0,0 +1,171 @@ +Active_eNBs = ( "eNB_Eurecom_LTEBox"); +# Asn1_verbosity, choice in: none, info, annoying +Asn1_verbosity = "none"; + +eNBs = +( + { + ////////// Identification parameters: + eNB_ID = 0xe00; + + cell_type = "CELL_MACRO_ENB"; + + eNB_name = "eNB_Eurecom_LTEBox"; + + // Tracking area code, 0x0000 and 0xfffe are reserved values + tracking_area_code = "1"; + + mobile_country_code = "208"; + + mobile_network_code = "95"; + + ////////// Physical parameters: + + component_carriers = ( + { + frame_type = "FDD"; + tdd_config = 3; + tdd_config_s = 0; + prefix_type = "NORMAL"; + eutra_band = 13; + downlink_frequency = 751000000L; + uplink_frequency_offset = 31000000; + Nid_cell = 0; + N_RB_DL = 50; + Nid_cell_mbsfn = 0; + nb_antennas_tx = 1; + nb_antennas_rx = 1; + tx_gain = 90; + rx_gain = 110; + prach_root = 0; + prach_config_index = 0; + prach_high_speed = "DISABLE"; + prach_zero_correlation = 1; + prach_freq_offset = 2; + pucch_delta_shift = 1; + pucch_nRB_CQI = 1; + pucch_nCS_AN = 0; + pucch_n1_AN = 32; + pdsch_referenceSignalPower = -15; + pdsch_p_b = 0; + pusch_n_SB = 1; + pusch_enable64QAM = "DISABLE"; + pusch_hoppingMode = "interSubFrame"; + pusch_hoppingOffset = 0; + pusch_groupHoppingEnabled = "ENABLE"; + pusch_groupAssignment = 0; + pusch_sequenceHoppingEnabled = "DISABLE"; + pusch_nDMRS1 = 1; + phich_duration = "NORMAL"; + phich_resource = "ONESIXTH"; + srs_enable = "DISABLE"; + /* srs_BandwidthConfig =; + srs_SubframeConfig =; + srs_ackNackST =; + srs_MaxUpPts =;*/ + + pusch_p0_Nominal = -90; + pusch_alpha = "AL1"; + pucch_p0_Nominal = -96; + msg3_delta_Preamble = 6; + pucch_deltaF_Format1 = "deltaF2"; + pucch_deltaF_Format1b = "deltaF3"; + pucch_deltaF_Format2 = "deltaF0"; + pucch_deltaF_Format2a = "deltaF0"; + pucch_deltaF_Format2b = "deltaF0"; + + rach_numberOfRA_Preambles = 64; + rach_preamblesGroupAConfig = "DISABLE"; + /* + rach_sizeOfRA_PreamblesGroupA = ; + rach_messageSizeGroupA = ; + rach_messagePowerOffsetGroupB = ; + */ + rach_powerRampingStep = 4; + rach_preambleInitialReceivedTargetPower = -100; + rach_preambleTransMax = 10; + rach_raResponseWindowSize = 10; + rach_macContentionResolutionTimer = 48; + rach_maxHARQ_Msg3Tx = 4; + + pcch_default_PagingCycle = 128; + pcch_nB = "oneT"; + bcch_modificationPeriodCoeff = 2; + ue_TimersAndConstants_t300 = 1000; + ue_TimersAndConstants_t301 = 1000; + ue_TimersAndConstants_t310 = 1000; + ue_TimersAndConstants_t311 = 10000; + ue_TimersAndConstants_n310 = 20; + ue_TimersAndConstants_n311 = 1; + + } + ); + + + srb1_parameters : + { + # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] + timer_poll_retransmit = 80; + + # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] + timer_reordering = 35; + + # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] + timer_status_prohibit = 0; + + # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] + poll_pdu = 4; + + # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] + poll_byte = 99999; + + # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] + max_retx_threshold = 4; + } + + # ------- SCTP definitions + SCTP : + { + # Number of streams to use in input/output + SCTP_INSTREAMS = 2; + SCTP_OUTSTREAMS = 2; + }; + + + ////////// MME parameters: + mme_ip_address = ( { ipv4 = "172.27.8.52"; + ipv6 = "192:168:30::17"; + active = "yes"; + preference = "ipv4"; + } + ); + + NETWORK_INTERFACES : + { + ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; + ENB_IPV4_ADDRESS_FOR_S1_MME = "172.27.8.51/23"; + + ENB_INTERFACE_NAME_FOR_S1U = "eth0"; + ENB_IPV4_ADDRESS_FOR_S1U = "172.27.8.51/23"; + ENB_PORT_FOR_S1U = 2152; # Spec 2152 + }; + + log_config : + { + global_log_level ="info"; + global_log_verbosity ="medium"; + hw_log_level ="info"; + hw_log_verbosity ="medium"; + phy_log_level ="info"; + phy_log_verbosity ="medium"; + mac_log_level ="info"; + mac_log_verbosity ="high"; + rlc_log_level ="info"; + rlc_log_verbosity ="medium"; + pdcp_log_level ="info"; + pdcp_log_verbosity ="medium"; + rrc_log_level ="info"; + rrc_log_verbosity ="medium"; + }; + } +); \ No newline at end of file diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band4.tm1.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band4.tm1.usrpb210.conf index ee4700c771fd8343246cf7f4b7ebfce230736585..853db14393ea2a084eb42866cdb26beb13ac9e14 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band4.tm1.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band4.tm1.usrpb210.conf @@ -17,7 +17,7 @@ eNBs = mobile_country_code = "208"; - mobile_network_code = "92"; + mobile_network_code = "93"; ////////// Physical parameters: @@ -36,7 +36,7 @@ eNBs = nb_antennas_tx = 1; nb_antennas_rx = 1; tx_gain = 90; - rx_gain = 120; + rx_gain = 128; prach_root = 0; prach_config_index = 0; prach_high_speed = "DISABLE"; @@ -66,7 +66,7 @@ eNBs = pusch_p0_Nominal = -90; pusch_alpha = "AL1"; - pucch_p0_Nominal = -108; + pucch_p0_Nominal = -96; msg3_delta_Preamble = 6; pucch_deltaF_Format1 = "deltaF2"; pucch_deltaF_Format1b = "deltaF3"; @@ -131,7 +131,7 @@ eNBs = }; ////////// MME parameters: - mme_ip_address = ( { ipv4 = "192.168.13.11"; + mme_ip_address = ( { ipv4 = "192.168.12.11"; ipv6 = "192:168:30::17"; active = "yes"; preference = "ipv4"; @@ -141,10 +141,10 @@ eNBs = NETWORK_INTERFACES : { ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.13.10/24"; + ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.215/24"; ENB_INTERFACE_NAME_FOR_S1U = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.168.13.10/24"; + ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.215/24"; ENB_PORT_FOR_S1U = 2152; # Spec 2152 }; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpb210.conf index 1d47abdd60841208eded5833d54685844981c5f1..e083ea0f4ef8d4a6d545cb15334d227c3ab3f583 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpb210.conf @@ -17,7 +17,7 @@ eNBs = mobile_country_code = "208"; - mobile_network_code = "92"; + mobile_network_code = "93"; ////////// Physical parameters: @@ -28,7 +28,7 @@ eNBs = tdd_config_s = 0; prefix_type = "NORMAL"; eutra_band = 7; - downlink_frequency = 2660000000L; + downlink_frequency = 2680000000L; uplink_frequency_offset = -120000000; Nid_cell = 0; N_RB_DL = 100; @@ -36,7 +36,7 @@ eNBs = nb_antennas_tx = 1; nb_antennas_rx = 1; tx_gain = 90; - rx_gain = 120; + rx_gain = 127; prach_root = 0; prach_config_index = 0; prach_high_speed = "DISABLE"; @@ -130,7 +130,7 @@ eNBs = }; ////////// MME parameters: - mme_ip_address = ( { ipv4 = "192.168.13.11"; + mme_ip_address = ( { ipv4 = "192.168.12.11"; ipv6 = "192:168:30::17"; active = "yes"; preference = "ipv4"; @@ -140,10 +140,10 @@ eNBs = NETWORK_INTERFACES : { ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.13.10/24"; + ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.213/24"; ENB_INTERFACE_NAME_FOR_S1U = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.168.13.10/24"; + ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.213/24"; ENB_PORT_FOR_S1U = 2152; # Spec 2152 }; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.bladerfx40.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.bladerfx40.conf new file mode 100644 index 0000000000000000000000000000000000000000..eb3895dc6d60a82465550128a353274cfb00595e --- /dev/null +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.bladerfx40.conf @@ -0,0 +1,171 @@ +Active_eNBs = ( "eNB_Eurecom_LTEBox"); +# Asn1_verbosity, choice in: none, info, annoying +Asn1_verbosity = "none"; + +eNBs = +( + { + ////////// Identification parameters: + eNB_ID = 0xe00; + + cell_type = "CELL_MACRO_ENB"; + + eNB_name = "eNB_Eurecom_LTEBox"; + + // Tracking area code, 0x0000 and 0xfffe are reserved values + tracking_area_code = "1"; + + mobile_country_code = "208"; + + mobile_network_code = "93"; + + ////////// Physical parameters: + + component_carriers = ( + { + frame_type = "FDD"; + tdd_config = 3; + tdd_config_s = 0; + prefix_type = "NORMAL"; + eutra_band = 7; + downlink_frequency = 2680000000L; + uplink_frequency_offset = -120000000; + Nid_cell = 0; + N_RB_DL = 50; + Nid_cell_mbsfn = 0; + nb_antennas_tx = 1; + nb_antennas_rx = 1; + tx_gain = 60; + rx_gain = 60; + prach_root = 0; + prach_config_index = 0; + prach_high_speed = "DISABLE"; + prach_zero_correlation = 1; + prach_freq_offset = 2; + pucch_delta_shift = 1; + pucch_nRB_CQI = 1; + pucch_nCS_AN = 0; + pucch_n1_AN = 32; + pdsch_referenceSignalPower = -26; + pdsch_p_b = 0; + pusch_n_SB = 1; + pusch_enable64QAM = "DISABLE"; + pusch_hoppingMode = "interSubFrame"; + pusch_hoppingOffset = 0; + pusch_groupHoppingEnabled = "ENABLE"; + pusch_groupAssignment = 0; + pusch_sequenceHoppingEnabled = "DISABLE"; + pusch_nDMRS1 = 1; + phich_duration = "NORMAL"; + phich_resource = "ONESIXTH"; + srs_enable = "DISABLE"; + /* srs_BandwidthConfig =; + srs_SubframeConfig =; + srs_ackNackST =; + srs_MaxUpPts =;*/ + + pusch_p0_Nominal = -90; + pusch_alpha = "AL1"; + pucch_p0_Nominal = -108; + msg3_delta_Preamble = 6; + pucch_deltaF_Format1 = "deltaF2"; + pucch_deltaF_Format1b = "deltaF3"; + pucch_deltaF_Format2 = "deltaF0"; + pucch_deltaF_Format2a = "deltaF0"; + pucch_deltaF_Format2b = "deltaF0"; + + rach_numberOfRA_Preambles = 64; + rach_preamblesGroupAConfig = "DISABLE"; +/* + rach_sizeOfRA_PreamblesGroupA = ; + rach_messageSizeGroupA = ; + rach_messagePowerOffsetGroupB = ; +*/ + rach_powerRampingStep = 4; + rach_preambleInitialReceivedTargetPower = -108; + rach_preambleTransMax = 10; + rach_raResponseWindowSize = 10; + rach_macContentionResolutionTimer = 48; + rach_maxHARQ_Msg3Tx = 4; + + pcch_default_PagingCycle = 128; + pcch_nB = "oneT"; + bcch_modificationPeriodCoeff = 2; + ue_TimersAndConstants_t300 = 1000; + ue_TimersAndConstants_t301 = 1000; + ue_TimersAndConstants_t310 = 1000; + ue_TimersAndConstants_t311 = 10000; + ue_TimersAndConstants_n310 = 20; + ue_TimersAndConstants_n311 = 1; + + } + ); + + + srb1_parameters : + { + # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] + timer_poll_retransmit = 80; + + # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] + timer_reordering = 35; + + # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] + timer_status_prohibit = 0; + + # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] + poll_pdu = 4; + + # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] + poll_byte = 99999; + + # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] + max_retx_threshold = 4; + } + + # ------- SCTP definitions + SCTP : + { + # Number of streams to use in input/output + SCTP_INSTREAMS = 2; + SCTP_OUTSTREAMS = 2; + }; + + ////////// MME parameters: + mme_ip_address = ( { ipv4 = "192.168.12.11"; + ipv6 = "192:168:30::17"; + active = "yes"; + preference = "ipv4"; + } + ); + + NETWORK_INTERFACES : + { + ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; + ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.215/24"; + + ENB_INTERFACE_NAME_FOR_S1U = "eth0"; + ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.215/24"; + ENB_PORT_FOR_S1U = 2152; # Spec 2152 + }; + + log_config : + { + global_log_level ="info"; + global_log_verbosity ="medium"; + hw_log_level ="info"; + hw_log_verbosity ="medium"; + phy_log_level ="info"; + phy_log_verbosity ="medium"; + mac_log_level ="info"; + mac_log_verbosity ="high"; + rlc_log_level ="info"; + rlc_log_verbosity ="medium"; + pdcp_log_level ="info"; + pdcp_log_verbosity ="medium"; + rrc_log_level ="info"; + rrc_log_verbosity ="medium"; + }; + + } +); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.lmssdr.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.lmssdr.conf new file mode 100644 index 0000000000000000000000000000000000000000..dae0187f18732e178551ff69747a772f8c145e33 --- /dev/null +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.lmssdr.conf @@ -0,0 +1,171 @@ +Active_eNBs = ( "eNB_Eurecom_LTEBox"); +# Asn1_verbosity, choice in: none, info, annoying +Asn1_verbosity = "none"; + +eNBs = +( + { + ////////// Identification parameters: + eNB_ID = 0xe00; + + cell_type = "CELL_MACRO_ENB"; + + eNB_name = "eNB_Eurecom_LTEBox"; + + // Tracking area code, 0x0000 and 0xfffe are reserved values + tracking_area_code = "1"; + + mobile_country_code = "208"; + + mobile_network_code = "95"; + + ////////// Physical parameters: + + component_carriers = ( + { + frame_type = "FDD"; + tdd_config = 3; + tdd_config_s = 0; + prefix_type = "NORMAL"; + eutra_band = 7; + downlink_frequency = 2660000000L; + uplink_frequency_offset = -120000000; + Nid_cell = 0; + N_RB_DL = 50; + Nid_cell_mbsfn = 0; + nb_antennas_tx = 1; + nb_antennas_rx = 1; + tx_gain = 60; + rx_gain = 111; + prach_root = 0; + prach_config_index = 0; + prach_high_speed = "DISABLE"; + prach_zero_correlation = 1; + prach_freq_offset = 2; + pucch_delta_shift = 1; + pucch_nRB_CQI = 1; + pucch_nCS_AN = 0; + pucch_n1_AN = 32; + pdsch_referenceSignalPower = -29; + pdsch_p_b = 0; + pusch_n_SB = 1; + pusch_enable64QAM = "DISABLE"; + pusch_hoppingMode = "interSubFrame"; + pusch_hoppingOffset = 0; + pusch_groupHoppingEnabled = "ENABLE"; + pusch_groupAssignment = 0; + pusch_sequenceHoppingEnabled = "DISABLE"; + pusch_nDMRS1 = 1; + phich_duration = "NORMAL"; + phich_resource = "ONESIXTH"; + srs_enable = "DISABLE"; + /* srs_BandwidthConfig =; + srs_SubframeConfig =; + srs_ackNackST =; + srs_MaxUpPts =;*/ + + pusch_p0_Nominal = -85; + pusch_alpha = "AL1"; + pucch_p0_Nominal = -96; + msg3_delta_Preamble = 6; + pucch_deltaF_Format1 = "deltaF2"; + pucch_deltaF_Format1b = "deltaF3"; + pucch_deltaF_Format2 = "deltaF0"; + pucch_deltaF_Format2a = "deltaF0"; + pucch_deltaF_Format2b = "deltaF0"; + + rach_numberOfRA_Preambles = 64; + rach_preamblesGroupAConfig = "DISABLE"; +/* + rach_sizeOfRA_PreamblesGroupA = ; + rach_messageSizeGroupA = ; + rach_messagePowerOffsetGroupB = ; +*/ + rach_powerRampingStep = 4; + rach_preambleInitialReceivedTargetPower = -100; + rach_preambleTransMax = 10; + rach_raResponseWindowSize = 10; + rach_macContentionResolutionTimer = 48; + rach_maxHARQ_Msg3Tx = 4; + + pcch_default_PagingCycle = 128; + pcch_nB = "oneT"; + bcch_modificationPeriodCoeff = 2; + ue_TimersAndConstants_t300 = 1000; + ue_TimersAndConstants_t301 = 1000; + ue_TimersAndConstants_t310 = 1000; + ue_TimersAndConstants_t311 = 10000; + ue_TimersAndConstants_n310 = 20; + ue_TimersAndConstants_n311 = 1; + + } + ); + + + srb1_parameters : + { + # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] + timer_poll_retransmit = 80; + + # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] + timer_reordering = 35; + + # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] + timer_status_prohibit = 0; + + # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] + poll_pdu = 4; + + # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] + poll_byte = 99999; + + # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] + max_retx_threshold = 4; + } + + # ------- SCTP definitions + SCTP : + { + # Number of streams to use in input/output + SCTP_INSTREAMS = 2; + SCTP_OUTSTREAMS = 2; + }; + + ////////// MME parameters: + mme_ip_address = ( { ipv4 = "192.168.12.62"; + ipv6 = "192:168:30::17"; + active = "yes"; + preference = "ipv4"; + } + ); + + NETWORK_INTERFACES : + { + ENB_INTERFACE_NAME_FOR_S1_MME = "eth4"; + ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.242/24"; + + ENB_INTERFACE_NAME_FOR_S1U = "eth4"; + ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.242/24"; + ENB_PORT_FOR_S1U = 2152; # Spec 2152 + }; + + log_config : + { + global_log_level ="info"; + global_log_verbosity ="medium"; + hw_log_level ="info"; + hw_log_verbosity ="medium"; + phy_log_level ="info"; + phy_log_verbosity ="medium"; + mac_log_level ="info"; + mac_log_verbosity ="high"; + rlc_log_level ="info"; + rlc_log_verbosity ="medium"; + pdcp_log_level ="info"; + pdcp_log_verbosity ="medium"; + rrc_log_level ="info"; + rrc_log_verbosity ="medium"; + }; + + } +); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.rrh.lmssdr.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.rrh.lmssdr.conf new file mode 100644 index 0000000000000000000000000000000000000000..4cd761645b3e339c9b4cff404e974352a5f1f832 --- /dev/null +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.rrh.lmssdr.conf @@ -0,0 +1,192 @@ +Active_eNBs = ( "eNB_Eurecom_LTEBox"); +# Asn1_verbosity, choice in: none, info, annoying +Asn1_verbosity = "none"; + +eNBs = +( + { + ////////// Identification parameters: + eNB_ID = 0xe00; + + cell_type = "CELL_MACRO_ENB"; + + eNB_name = "eNB_Eurecom_LTEBox"; + + // Tracking area code, 0x0000 and 0xfffe are reserved values + tracking_area_code = "1"; + + mobile_country_code = "208"; + + mobile_network_code = "93"; + + ////////// Physical parameters: + + component_carriers = ( + { + frame_type = "FDD"; + tdd_config = 3; + tdd_config_s = 0; + prefix_type = "NORMAL"; + eutra_band = 7; + downlink_frequency = 2660000000L; + uplink_frequency_offset = -120000000; + Nid_cell = 0; + N_RB_DL = 50; + Nid_cell_mbsfn = 0; + nb_antennas_tx = 1; + nb_antennas_rx = 1; + tx_gain = 60; + rx_gain = 111; + prach_root = 0; + prach_config_index = 0; + prach_high_speed = "DISABLE"; + prach_zero_correlation = 1; + prach_freq_offset = 2; + pucch_delta_shift = 1; + pucch_nRB_CQI = 1; + pucch_nCS_AN = 0; + pucch_n1_AN = 32; + pdsch_referenceSignalPower = -29; + pdsch_p_b = 0; + pusch_n_SB = 1; + pusch_enable64QAM = "DISABLE"; + pusch_hoppingMode = "interSubFrame"; + pusch_hoppingOffset = 0; + pusch_groupHoppingEnabled = "ENABLE"; + pusch_groupAssignment = 0; + pusch_sequenceHoppingEnabled = "DISABLE"; + pusch_nDMRS1 = 1; + phich_duration = "NORMAL"; + phich_resource = "ONESIXTH"; + srs_enable = "DISABLE"; + /* srs_BandwidthConfig =; + srs_SubframeConfig =; + srs_ackNackST =; + srs_MaxUpPts =;*/ + + pusch_p0_Nominal = -85; + pusch_alpha = "AL1"; + pucch_p0_Nominal = -96; + msg3_delta_Preamble = 6; + pucch_deltaF_Format1 = "deltaF2"; + pucch_deltaF_Format1b = "deltaF3"; + pucch_deltaF_Format2 = "deltaF0"; + pucch_deltaF_Format2a = "deltaF0"; + pucch_deltaF_Format2b = "deltaF0"; + + rach_numberOfRA_Preambles = 64; + rach_preamblesGroupAConfig = "DISABLE"; +/* + rach_sizeOfRA_PreamblesGroupA = ; + rach_messageSizeGroupA = ; + rach_messagePowerOffsetGroupB = ; +*/ + rach_powerRampingStep = 4; + rach_preambleInitialReceivedTargetPower = -100; + rach_preambleTransMax = 10; + rach_raResponseWindowSize = 10; + rach_macContentionResolutionTimer = 48; + rach_maxHARQ_Msg3Tx = 4; + + pcch_default_PagingCycle = 128; + pcch_nB = "oneT"; + bcch_modificationPeriodCoeff = 2; + ue_TimersAndConstants_t300 = 1000; + ue_TimersAndConstants_t301 = 1000; + ue_TimersAndConstants_t310 = 1000; + ue_TimersAndConstants_t311 = 10000; + ue_TimersAndConstants_n310 = 20; + ue_TimersAndConstants_n311 = 1; + + } + ); + + + srb1_parameters : + { + # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] + timer_poll_retransmit = 80; + + # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] + timer_reordering = 35; + + # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] + timer_status_prohibit = 0; + + # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] + poll_pdu = 4; + + # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] + poll_byte = 99999; + + # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] + max_retx_threshold = 4; + } + + # ------- SCTP definitions + SCTP : + { + # Number of streams to use in input/output + SCTP_INSTREAMS = 2; + SCTP_OUTSTREAMS = 2; + }; + + + ////////// MME parameters: + mme_ip_address = ( { ipv4 = "192.168.12.170"; + ipv6 = "192:168:30::17"; + active = "yes"; + preference = "ipv4"; + } + ); + +rrh_gw_config = ( + { + local_if_name = "eth0"; + #remote_address = "169.254.10.158"; + #local_address = "169.254.8.15"; + remote_address = "74:d4:35:cc:88:45"; + local_address = "d4:be:d9:22:0a:ac"; + local_port = 50000; #for raw option local port must be the same to remote + remote_port = 50000; + rrh_gw_active = "yes"; + tr_preference = "raw"; + rf_preference = "lmssdr"; + iq_txshift = 0; + tx_sample_advance = 45; + tx_scheduling_advance = 8; + +} +); + + NETWORK_INTERFACES : + { + ENB_INTERFACE_NAME_FOR_S1_MME = "eth6"; + ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.118/24"; + + ENB_INTERFACE_NAME_FOR_S1U = "eth6"; + + + ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.118/24"; + ENB_PORT_FOR_S1U = 2152; # Spec 2152 + }; + + log_config : + { + global_log_level ="info"; + global_log_verbosity ="medium"; + hw_log_level ="info"; + hw_log_verbosity ="medium"; + phy_log_level ="info"; + phy_log_verbosity ="medium"; + mac_log_level ="info"; + mac_log_verbosity ="high"; + rlc_log_level ="info"; + rlc_log_verbosity ="medium"; + pdcp_log_level ="info"; + pdcp_log_verbosity ="medium"; + rrc_log_level ="info"; + rrc_log_verbosity ="medium"; + }; + } +); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.rrh.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.rrh.usrpb210.conf new file mode 100644 index 0000000000000000000000000000000000000000..004af14749518fb6d75a95b466988fe15c589d6a --- /dev/null +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.rrh.usrpb210.conf @@ -0,0 +1,188 @@ +Active_eNBs = ( "eNB_Eurecom_LTEBox"); +# Asn1_verbosity, choice in: none, info, annoying +Asn1_verbosity = "none"; + +eNBs = +( + { + ////////// Identification parameters: + eNB_ID = 0xe00; + + cell_type = "CELL_MACRO_ENB"; + + eNB_name = "eNB_Eurecom_LTEBox"; + + // Tracking area code, 0x0000 and 0xfffe are reserved values + tracking_area_code = "1"; + + mobile_country_code = "208"; + + mobile_network_code = "92"; + + ////////// Physical parameters: + + component_carriers = ( + { + frame_type = "FDD"; + tdd_config = 3; + tdd_config_s = 0; + prefix_type = "NORMAL"; + eutra_band = 7; + downlink_frequency = 2680000000L; + uplink_frequency_offset = -120000000; + Nid_cell = 0; + N_RB_DL = 50; + Nid_cell_mbsfn = 0; + nb_antennas_tx = 1; + nb_antennas_rx = 1; + tx_gain = 90; + rx_gain = 125; + prach_root = 0; + prach_config_index = 0; + prach_high_speed = "DISABLE"; + prach_zero_correlation = 1; + prach_freq_offset = 2; + pucch_delta_shift = 1; + pucch_nRB_CQI = 1; + pucch_nCS_AN = 0; + pucch_n1_AN = 32; + pdsch_referenceSignalPower = -29; + pdsch_p_b = 0; + pusch_n_SB = 1; + pusch_enable64QAM = "DISABLE"; + pusch_hoppingMode = "interSubFrame"; + pusch_hoppingOffset = 0; + pusch_groupHoppingEnabled = "ENABLE"; + pusch_groupAssignment = 0; + pusch_sequenceHoppingEnabled = "DISABLE"; + pusch_nDMRS1 = 1; + phich_duration = "NORMAL"; + phich_resource = "ONESIXTH"; + srs_enable = "DISABLE"; + /* srs_BandwidthConfig =; + srs_SubframeConfig =; + srs_ackNackST =; + srs_MaxUpPts =;*/ + + pusch_p0_Nominal = -90; + pusch_alpha = "AL1"; + pucch_p0_Nominal = -96; + msg3_delta_Preamble = 6; + pucch_deltaF_Format1 = "deltaF2"; + pucch_deltaF_Format1b = "deltaF3"; + pucch_deltaF_Format2 = "deltaF0"; + pucch_deltaF_Format2a = "deltaF0"; + pucch_deltaF_Format2b = "deltaF0"; + + rach_numberOfRA_Preambles = 64; + rach_preamblesGroupAConfig = "DISABLE"; + /* + rach_sizeOfRA_PreamblesGroupA = ; + rach_messageSizeGroupA = ; + rach_messagePowerOffsetGroupB = ; + */ + rach_powerRampingStep = 4; + rach_preambleInitialReceivedTargetPower = -108; + rach_preambleTransMax = 10; + rach_raResponseWindowSize = 10; + rach_macContentionResolutionTimer = 48; + rach_maxHARQ_Msg3Tx = 4; + + pcch_default_PagingCycle = 128; + pcch_nB = "oneT"; + bcch_modificationPeriodCoeff = 2; + ue_TimersAndConstants_t300 = 1000; + ue_TimersAndConstants_t301 = 1000; + ue_TimersAndConstants_t310 = 1000; + ue_TimersAndConstants_t311 = 10000; + ue_TimersAndConstants_n310 = 20; + ue_TimersAndConstants_n311 = 1; + } + ); + + srb1_parameters : + { + # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] + timer_poll_retransmit = 80; + + # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] + timer_reordering = 35; + + # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] + timer_status_prohibit = 0; + + # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] + poll_pdu = 4; + + # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] + poll_byte = 99999; + + # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] + max_retx_threshold = 4; + } + + # ------- SCTP definitions + SCTP : + { + # Number of streams to use in input/output + SCTP_INSTREAMS = 2; + SCTP_OUTSTREAMS = 2; + }; + + + ////////// MME parameters: + mme_ip_address = ( { ipv4 = "192.168.12.26"; + ipv6 = "192:168:30::17"; + active = "yes"; + preference = "ipv4"; + } + ); + +rrh_gw_config = ( + { + local_if_name = "eth0"; + #remote_address = "169.254.10.158"; + #local_address = "169.254.8.15"; + remote_address = "74:d4:35:cc:88:45"; + local_address = "98:90:96:df:66:07"; + local_port = 50000; #for raw option local port must be the same to remote + remote_port = 50000; + rrh_gw_active = "yes"; + tr_preference = "raw"; + rf_preference = "usrp_b200"; + iq_txshift = 4; + tx_sample_advance = 113; + tx_scheduling_advance = 9; + +} +); + + NETWORK_INTERFACES : + { + ENB_INTERFACE_NAME_FOR_S1_MME = "eth4"; + ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.111/24"; + + ENB_INTERFACE_NAME_FOR_S1U = "eth4"; + ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.111/24"; + ENB_PORT_FOR_S1U = 2152; # Spec 2152 + }; + + log_config : + { + global_log_level ="info"; + global_log_verbosity ="medium"; + hw_log_level ="info"; + hw_log_verbosity ="medium"; + phy_log_level ="info"; + phy_log_verbosity ="medium"; + mac_log_level ="info"; + mac_log_verbosity ="high"; + rlc_log_level ="info"; + rlc_log_verbosity ="medium"; + pdcp_log_level ="info"; + pdcp_log_verbosity ="medium"; + rrc_log_level ="info"; + rrc_log_verbosity ="medium"; + }; + } +); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf index 8f9dc280ae1c2e1746176bcf887e4ac6f635481b..2ce9598129b4f34c45cb36564fccf4783299c53b 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf @@ -28,7 +28,7 @@ eNBs = tdd_config_s = 0; prefix_type = "NORMAL"; eutra_band = 7; - downlink_frequency = 2660000000L; + downlink_frequency = 2680000000L; uplink_frequency_offset = -120000000; Nid_cell = 0; N_RB_DL = 50; @@ -36,7 +36,7 @@ eNBs = nb_antennas_tx = 1; nb_antennas_rx = 1; tx_gain = 90; - rx_gain = 118; + rx_gain = 125; prach_root = 0; prach_config_index = 0; prach_high_speed = "DISABLE"; @@ -66,7 +66,7 @@ eNBs = pusch_p0_Nominal = -90; pusch_alpha = "AL1"; - pucch_p0_Nominal = -108; + pucch_p0_Nominal = -96; msg3_delta_Preamble = 6; pucch_deltaF_Format1 = "deltaF2"; pucch_deltaF_Format1b = "deltaF3"; @@ -140,10 +140,10 @@ eNBs = NETWORK_INTERFACES : { ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.213/24"; + ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.215/24"; ENB_INTERFACE_NAME_FOR_S1U = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.213/24"; + ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.215/24"; ENB_PORT_FOR_S1U = 2152; # Spec 2152 }; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf index 4c760e19c2ca4f362c55278a9791d38ab18786aa..d0488f2d37b3812faf9887ceb60781a8a278b631 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf @@ -35,7 +35,7 @@ eNBs = nb_antennas_tx = 1; nb_antennas_rx = 1; tx_gain = 32; - rx_gain = 120; + rx_gain = 118; prach_root = 0; prach_config_index = 0; prach_high_speed = "DISABLE"; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf index bdbb46a98b40fc7e3c272b116b3f1514fab20cec..5a6a9a462bdeabd1fde804c0788cc52f7366c427 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf @@ -17,7 +17,7 @@ eNBs = mobile_country_code = "208"; - mobile_network_code = "92"; + mobile_network_code = "93"; ////////// Physical parameters: @@ -35,8 +35,8 @@ eNBs = Nid_cell_mbsfn = 0; nb_antennas_tx = 1; nb_antennas_rx = 1; - tx_gain = 20; - rx_gain = 20; + tx_gain = 60; + rx_gain = 120; prach_root = 0; prach_config_index = 0; prach_high_speed = "DISABLE"; @@ -46,7 +46,7 @@ eNBs = pucch_nRB_CQI = 1; pucch_nCS_AN = 0; pucch_n1_AN = 32; - pdsch_referenceSignalPower = -26; + pdsch_referenceSignalPower = -29; pdsch_p_b = 0; pusch_n_SB = 1; pusch_enable64QAM = "DISABLE"; @@ -132,7 +132,7 @@ eNBs = }; ////////// MME parameters: - mme_ip_address = ( { ipv4 = "192.168.13.11"; + mme_ip_address = ( { ipv4 = "192.168.12.11"; ipv6 = "192:168:30::17"; active = "yes"; preference = "ipv4"; @@ -142,10 +142,10 @@ eNBs = NETWORK_INTERFACES : { ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.13.10/24"; + ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.215/24"; ENB_INTERFACE_NAME_FOR_S1U = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.168.13.10/24"; + ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.215/24"; ENB_PORT_FOR_S1U = 2152; # Spec 2152 }; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf new file mode 100644 index 0000000000000000000000000000000000000000..47e2179d18a264782163ec0ecae9ceceddb6a495 --- /dev/null +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf @@ -0,0 +1,171 @@ +Active_eNBs = ( "eNB_Eurecom_LTEBox"); +# Asn1_verbosity, choice in: none, info, annoying +Asn1_verbosity = "none"; + +eNBs = +( + { + ////////// Identification parameters: + eNB_ID = 0xe00; + + cell_type = "CELL_MACRO_ENB"; + + eNB_name = "eNB_Eurecom_LTEBox"; + + // Tracking area code, 0x0000 and 0xfffe are reserved values + tracking_area_code = "1"; + + mobile_country_code = "208"; + + mobile_network_code = "92"; + + ////////// Physical parameters: + + component_carriers = ( + { + frame_type = "FDD"; + tdd_config = 3; + tdd_config_s = 0; + prefix_type = "NORMAL"; + eutra_band = 7; + downlink_frequency = 2660000000L; + uplink_frequency_offset = -120000000; + Nid_cell = 0; + N_RB_DL = 25; + Nid_cell_mbsfn = 0; + nb_antennas_tx = 1; + nb_antennas_rx = 1; + tx_gain = 60; + rx_gain = 111; + prach_root = 0; + prach_config_index = 0; + prach_high_speed = "DISABLE"; + prach_zero_correlation = 1; + prach_freq_offset = 2; + pucch_delta_shift = 1; + pucch_nRB_CQI = 1; + pucch_nCS_AN = 0; + pucch_n1_AN = 32; + pdsch_referenceSignalPower = -29; + pdsch_p_b = 0; + pusch_n_SB = 1; + pusch_enable64QAM = "DISABLE"; + pusch_hoppingMode = "interSubFrame"; + pusch_hoppingOffset = 0; + pusch_groupHoppingEnabled = "ENABLE"; + pusch_groupAssignment = 0; + pusch_sequenceHoppingEnabled = "DISABLE"; + pusch_nDMRS1 = 1; + phich_duration = "NORMAL"; + phich_resource = "ONESIXTH"; + srs_enable = "DISABLE"; + /* srs_BandwidthConfig =; + srs_SubframeConfig =; + srs_ackNackST =; + srs_MaxUpPts =;*/ + + pusch_p0_Nominal = -85; + pusch_alpha = "AL1"; + pucch_p0_Nominal = -96; + msg3_delta_Preamble = 6; + pucch_deltaF_Format1 = "deltaF2"; + pucch_deltaF_Format1b = "deltaF3"; + pucch_deltaF_Format2 = "deltaF0"; + pucch_deltaF_Format2a = "deltaF0"; + pucch_deltaF_Format2b = "deltaF0"; + + rach_numberOfRA_Preambles = 64; + rach_preamblesGroupAConfig = "DISABLE"; +/* + rach_sizeOfRA_PreamblesGroupA = ; + rach_messageSizeGroupA = ; + rach_messagePowerOffsetGroupB = ; +*/ + rach_powerRampingStep = 4; + rach_preambleInitialReceivedTargetPower = -100; + rach_preambleTransMax = 10; + rach_raResponseWindowSize = 10; + rach_macContentionResolutionTimer = 48; + rach_maxHARQ_Msg3Tx = 4; + + pcch_default_PagingCycle = 128; + pcch_nB = "oneT"; + bcch_modificationPeriodCoeff = 2; + ue_TimersAndConstants_t300 = 1000; + ue_TimersAndConstants_t301 = 1000; + ue_TimersAndConstants_t310 = 1000; + ue_TimersAndConstants_t311 = 10000; + ue_TimersAndConstants_n310 = 20; + ue_TimersAndConstants_n311 = 1; + + } + ); + + + srb1_parameters : + { + # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] + timer_poll_retransmit = 80; + + # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] + timer_reordering = 35; + + # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] + timer_status_prohibit = 0; + + # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] + poll_pdu = 4; + + # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] + poll_byte = 99999; + + # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] + max_retx_threshold = 4; + } + + # ------- SCTP definitions + SCTP : + { + # Number of streams to use in input/output + SCTP_INSTREAMS = 2; + SCTP_OUTSTREAMS = 2; + }; + + ////////// MME parameters: + mme_ip_address = ( { ipv4 = "192.168.12.170"; + ipv6 = "192:168:30::17"; + active = "yes"; + preference = "ipv4"; + } + ); + + NETWORK_INTERFACES : + { + ENB_INTERFACE_NAME_FOR_S1_MME = "eth4"; + ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.242/24"; + + ENB_INTERFACE_NAME_FOR_S1U = "eth4"; + ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.242/24"; + ENB_PORT_FOR_S1U = 2152; # Spec 2152 + }; + + log_config : + { + global_log_level ="info"; + global_log_verbosity ="medium"; + hw_log_level ="info"; + hw_log_verbosity ="medium"; + phy_log_level ="info"; + phy_log_verbosity ="medium"; + mac_log_level ="info"; + mac_log_verbosity ="high"; + rlc_log_level ="info"; + rlc_log_verbosity ="medium"; + pdcp_log_level ="info"; + pdcp_log_verbosity ="medium"; + rrc_log_level ="info"; + rrc_log_verbosity ="medium"; + }; + + } +); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.lmssdr.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.lmssdr.conf new file mode 100644 index 0000000000000000000000000000000000000000..9b052bf7ba9a888bb1b26cc8f654191513524982 --- /dev/null +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.lmssdr.conf @@ -0,0 +1,192 @@ +Active_eNBs = ( "eNB_Eurecom_LTEBox"); +# Asn1_verbosity, choice in: none, info, annoying +Asn1_verbosity = "none"; + +eNBs = +( + { + ////////// Identification parameters: + eNB_ID = 0xe00; + + cell_type = "CELL_MACRO_ENB"; + + eNB_name = "eNB_Eurecom_LTEBox"; + + // Tracking area code, 0x0000 and 0xfffe are reserved values + tracking_area_code = "1"; + + mobile_country_code = "208"; + + mobile_network_code = "92"; + + ////////// Physical parameters: + + component_carriers = ( + { + frame_type = "FDD"; + tdd_config = 3; + tdd_config_s = 0; + prefix_type = "NORMAL"; + eutra_band = 7; + downlink_frequency = 2660000000L; + uplink_frequency_offset = -120000000; + Nid_cell = 0; + N_RB_DL = 25; + Nid_cell_mbsfn = 0; + nb_antennas_tx = 1; + nb_antennas_rx = 1; + tx_gain = 60; + rx_gain = 111; + prach_root = 0; + prach_config_index = 0; + prach_high_speed = "DISABLE"; + prach_zero_correlation = 1; + prach_freq_offset = 2; + pucch_delta_shift = 1; + pucch_nRB_CQI = 1; + pucch_nCS_AN = 0; + pucch_n1_AN = 32; + pdsch_referenceSignalPower = -29; + pdsch_p_b = 0; + pusch_n_SB = 1; + pusch_enable64QAM = "DISABLE"; + pusch_hoppingMode = "interSubFrame"; + pusch_hoppingOffset = 0; + pusch_groupHoppingEnabled = "ENABLE"; + pusch_groupAssignment = 0; + pusch_sequenceHoppingEnabled = "DISABLE"; + pusch_nDMRS1 = 1; + phich_duration = "NORMAL"; + phich_resource = "ONESIXTH"; + srs_enable = "DISABLE"; + /* srs_BandwidthConfig =; + srs_SubframeConfig =; + srs_ackNackST =; + srs_MaxUpPts =;*/ + + pusch_p0_Nominal = -85; + pusch_alpha = "AL1"; + pucch_p0_Nominal = -96; + msg3_delta_Preamble = 6; + pucch_deltaF_Format1 = "deltaF2"; + pucch_deltaF_Format1b = "deltaF3"; + pucch_deltaF_Format2 = "deltaF0"; + pucch_deltaF_Format2a = "deltaF0"; + pucch_deltaF_Format2b = "deltaF0"; + + rach_numberOfRA_Preambles = 64; + rach_preamblesGroupAConfig = "DISABLE"; +/* + rach_sizeOfRA_PreamblesGroupA = ; + rach_messageSizeGroupA = ; + rach_messagePowerOffsetGroupB = ; +*/ + rach_powerRampingStep = 4; + rach_preambleInitialReceivedTargetPower = -100; + rach_preambleTransMax = 10; + rach_raResponseWindowSize = 10; + rach_macContentionResolutionTimer = 48; + rach_maxHARQ_Msg3Tx = 4; + + pcch_default_PagingCycle = 128; + pcch_nB = "oneT"; + bcch_modificationPeriodCoeff = 2; + ue_TimersAndConstants_t300 = 1000; + ue_TimersAndConstants_t301 = 1000; + ue_TimersAndConstants_t310 = 1000; + ue_TimersAndConstants_t311 = 10000; + ue_TimersAndConstants_n310 = 20; + ue_TimersAndConstants_n311 = 1; + + } + ); + + + srb1_parameters : + { + # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] + timer_poll_retransmit = 80; + + # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] + timer_reordering = 35; + + # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] + timer_status_prohibit = 0; + + # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] + poll_pdu = 4; + + # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] + poll_byte = 99999; + + # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] + max_retx_threshold = 4; + } + + # ------- SCTP definitions + SCTP : + { + # Number of streams to use in input/output + SCTP_INSTREAMS = 2; + SCTP_OUTSTREAMS = 2; + }; + + + ////////// MME parameters: + mme_ip_address = ( { ipv4 = "192.168.12.170"; + ipv6 = "192:168:30::17"; + active = "yes"; + preference = "ipv4"; + } + ); + +rrh_gw_config = ( + { + local_if_name = "eth0"; + #remote_address = "169.254.10.158"; + #local_address = "169.254.8.15"; + remote_address = "74:d4:35:cc:88:45"; + local_address = "d4:be:d9:22:0a:ac"; + local_port = 50000; #for raw option local port must be the same to remote + remote_port = 50000; + rrh_gw_active = "yes"; + tr_preference = "raw"; + rf_preference = "lmssdr"; + iq_txshift = 0; + tx_sample_advance = 70; + tx_scheduling_advance = 8; + +} +); + + NETWORK_INTERFACES : + { + ENB_INTERFACE_NAME_FOR_S1_MME = "eth6"; + ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.118/24"; + + ENB_INTERFACE_NAME_FOR_S1U = "eth6"; + + + ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.118/24"; + ENB_PORT_FOR_S1U = 2152; # Spec 2152 + }; + + log_config : + { + global_log_level ="info"; + global_log_verbosity ="medium"; + hw_log_level ="info"; + hw_log_verbosity ="medium"; + phy_log_level ="info"; + phy_log_verbosity ="medium"; + mac_log_level ="info"; + mac_log_verbosity ="high"; + rlc_log_level ="info"; + rlc_log_verbosity ="medium"; + pdcp_log_level ="info"; + pdcp_log_verbosity ="medium"; + rrc_log_level ="info"; + rrc_log_verbosity ="medium"; + }; + } +); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf new file mode 100644 index 0000000000000000000000000000000000000000..37880a29068a889909b2388b500e079dfd1aaead --- /dev/null +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf @@ -0,0 +1,191 @@ +Active_eNBs = ( "eNB_Eurecom_LTEBox"); +# Asn1_verbosity, choice in: none, info, annoying +Asn1_verbosity = "none"; + +eNBs = +( + { + ////////// Identification parameters: + eNB_ID = 0xe00; + + cell_type = "CELL_MACRO_ENB"; + + eNB_name = "eNB_Eurecom_LTEBox"; + + // Tracking area code, 0x0000 and 0xfffe are reserved values + tracking_area_code = "1"; + + mobile_country_code = "208"; + + mobile_network_code = "92"; + + ////////// Physical parameters: + + component_carriers = ( + { + frame_type = "FDD"; + tdd_config = 3; + tdd_config_s = 0; + prefix_type = "NORMAL"; + eutra_band = 7; + downlink_frequency = 2660000000L; + uplink_frequency_offset = -120000000; + Nid_cell = 0; + N_RB_DL = 25; + Nid_cell_mbsfn = 0; + nb_antennas_tx = 1; + nb_antennas_rx = 1; + tx_gain = 90; + rx_gain = 125; + prach_root = 0; + prach_config_index = 0; + prach_high_speed = "DISABLE"; + prach_zero_correlation = 1; + prach_freq_offset = 2; + pucch_delta_shift = 1; + pucch_nRB_CQI = 1; + pucch_nCS_AN = 0; + pucch_n1_AN = 32; + pdsch_referenceSignalPower = -29; + pdsch_p_b = 0; + pusch_n_SB = 1; + pusch_enable64QAM = "DISABLE"; + pusch_hoppingMode = "interSubFrame"; + pusch_hoppingOffset = 0; + pusch_groupHoppingEnabled = "ENABLE"; + pusch_groupAssignment = 0; + pusch_sequenceHoppingEnabled = "DISABLE"; + pusch_nDMRS1 = 1; + phich_duration = "NORMAL"; + phich_resource = "ONESIXTH"; + srs_enable = "DISABLE"; + /* srs_BandwidthConfig =; + srs_SubframeConfig =; + srs_ackNackST =; + srs_MaxUpPts =;*/ + + pusch_p0_Nominal = -90; + pusch_alpha = "AL1"; + pucch_p0_Nominal = -96; + msg3_delta_Preamble = 6; + pucch_deltaF_Format1 = "deltaF2"; + pucch_deltaF_Format1b = "deltaF3"; + pucch_deltaF_Format2 = "deltaF0"; + pucch_deltaF_Format2a = "deltaF0"; + pucch_deltaF_Format2b = "deltaF0"; + + rach_numberOfRA_Preambles = 64; + rach_preamblesGroupAConfig = "DISABLE"; + /* + rach_sizeOfRA_PreamblesGroupA = ; + rach_messageSizeGroupA = ; + rach_messagePowerOffsetGroupB = ; + */ + rach_powerRampingStep = 4; + rach_preambleInitialReceivedTargetPower = -108; + rach_preambleTransMax = 10; + rach_raResponseWindowSize = 10; + rach_macContentionResolutionTimer = 48; + rach_maxHARQ_Msg3Tx = 4; + + pcch_default_PagingCycle = 128; + pcch_nB = "oneT"; + bcch_modificationPeriodCoeff = 2; + ue_TimersAndConstants_t300 = 1000; + ue_TimersAndConstants_t301 = 1000; + ue_TimersAndConstants_t310 = 1000; + ue_TimersAndConstants_t311 = 10000; + ue_TimersAndConstants_n310 = 20; + ue_TimersAndConstants_n311 = 1; + + } + ); + + + srb1_parameters : + { + # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] + timer_poll_retransmit = 80; + + # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] + timer_reordering = 35; + + # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] + timer_status_prohibit = 0; + + # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] + poll_pdu = 4; + + # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] + poll_byte = 99999; + + # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] + max_retx_threshold = 4; + } + + # ------- SCTP definitions + SCTP : + { + # Number of streams to use in input/output + SCTP_INSTREAMS = 2; + SCTP_OUTSTREAMS = 2; + }; + + + ////////// MME parameters: + mme_ip_address = ( { ipv4 = "192.168.12.170"; + ipv6 = "192:168:30::17"; + active = "yes"; + preference = "ipv4"; + } + ); + +rrh_gw_config = ( + { + local_if_name = "eth0"; + #remote_address = "169.254.10.158"; + #local_address = "169.254.8.15"; + remote_address = "74:d4:35:cc:88:e3"; + local_address = "74:d4:35:cc:88:d1"; + local_port = 50000; #for raw option local port must be the same to remote + remote_port = 50000; + rrh_gw_active = "yes"; + tr_preference = "raw"; + rf_preference = "usrp_b200"; + iq_txshift = 4; + tx_sample_advance = 70; + tx_scheduling_advance = 9; + +} +); + + NETWORK_INTERFACES : + { + ENB_INTERFACE_NAME_FOR_S1_MME = "eth4"; + ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.240/24"; + + ENB_INTERFACE_NAME_FOR_S1U = "eth4"; + + ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.240/24"; + ENB_PORT_FOR_S1U = 2152; # Spec 2152 + }; + + log_config : + { + global_log_level ="info"; + global_log_verbosity ="medium"; + hw_log_level ="info"; + hw_log_verbosity ="medium"; + phy_log_level ="info"; + phy_log_verbosity ="medium"; + mac_log_level ="info"; + mac_log_verbosity ="high"; + rlc_log_level ="info"; + rlc_log_verbosity ="medium"; + pdcp_log_level ="info"; + pdcp_log_verbosity ="medium"; + rrc_log_level ="info"; + rrc_log_verbosity ="medium"; + }; + } +); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf index d8ea58910a66cfb45eeb394b6c2556295b32bb40..f1cd67b196163406f87c406167d4b8fa626ed016 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf @@ -17,7 +17,7 @@ eNBs = mobile_country_code = "208"; - mobile_network_code = "93"; + mobile_network_code = "95"; ////////// Physical parameters: @@ -28,7 +28,7 @@ eNBs = tdd_config_s = 0; prefix_type = "NORMAL"; eutra_band = 7; - downlink_frequency = 2680000000L; + downlink_frequency = 2685000000L; uplink_frequency_offset = -120000000; Nid_cell = 0; N_RB_DL = 25; @@ -36,7 +36,7 @@ eNBs = nb_antennas_tx = 1; nb_antennas_rx = 1; tx_gain = 90; - rx_gain = 132; + rx_gain = 125; prach_root = 0; prach_config_index = 0; prach_high_speed = "DISABLE"; @@ -133,7 +133,7 @@ eNBs = ////////// MME parameters: - mme_ip_address = ( { ipv4 = "192.168.12.11"; + mme_ip_address = ( { ipv4 = "172.27.8.52"; ipv6 = "192:168:30::17"; active = "yes"; preference = "ipv4"; @@ -143,10 +143,10 @@ eNBs = NETWORK_INTERFACES : { ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.213/24"; + ENB_IPV4_ADDRESS_FOR_S1_MME = "172.27.8.51/23"; ENB_INTERFACE_NAME_FOR_S1U = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.213/24"; + ENB_IPV4_ADDRESS_FOR_S1U = "172.27.8.51/23"; ENB_PORT_FOR_S1U = 2152; # Spec 2152 }; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf index fc70a8ca8dd2bd2cd13a3f86d963b3c5ada9fc80..3043256628a092f51a9ca5b6121b029a298eb362 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf @@ -16,50 +16,49 @@ eNBs = tracking_area_code = "1"; mobile_country_code = "208"; - mobile_network_code = "95"; ////////// Physical parameters: component_carriers = ( { - frame_type = "FDD"; - tdd_config = 3; - tdd_config_s = 0; - prefix_type = "NORMAL"; - eutra_band = 7; - downlink_frequency = 2660000000L; - uplink_frequency_offset = -120000000; - Nid_cell = 0; - N_RB_DL = 25; - Nid_cell_mbsfn = 0; - nb_antennas_tx = 1; - nb_antennas_rx = 1; - tx_gain = 90; - rx_gain = 132; - prach_root = 0; - prach_config_index = 0; - prach_high_speed = "DISABLE"; - prach_zero_correlation = 1; - prach_freq_offset = 2; - pucch_delta_shift = 1; - pucch_nRB_CQI = 1; - pucch_nCS_AN = 0; - pucch_n1_AN = 32; - pdsch_referenceSignalPower = -26; - pdsch_p_b = 0; - pusch_n_SB = 1; - pusch_enable64QAM = "DISABLE"; - pusch_hoppingMode = "interSubFrame"; - pusch_hoppingOffset = 0; - pusch_groupHoppingEnabled = "ENABLE"; - pusch_groupAssignment = 0; - pusch_sequenceHoppingEnabled = "DISABLE"; - pusch_nDMRS1 = 1; - phich_duration = "NORMAL"; - phich_resource = "ONESIXTH"; + frame_type = "FDD"; + tdd_config = 3; + tdd_config_s = 0; + prefix_type = "NORMAL"; + eutra_band = 7; + downlink_frequency = 2660000000L; + uplink_frequency_offset = -120000000; + Nid_cell = 0; + N_RB_DL = 25; + Nid_cell_mbsfn = 0; + nb_antennas_tx = 1; + nb_antennas_rx = 1; + tx_gain = 90; + rx_gain = 132; + prach_root = 0; + prach_config_index = 0; + prach_high_speed = "DISABLE"; + prach_zero_correlation = 1; + prach_freq_offset = 2; + pucch_delta_shift = 1; + pucch_nRB_CQI = 1; + pucch_nCS_AN = 0; + pucch_n1_AN = 32; + pdsch_referenceSignalPower = -26; + pdsch_p_b = 0; + pusch_n_SB = 1; + pusch_enable64QAM = "DISABLE"; + pusch_hoppingMode = "interSubFrame"; + pusch_hoppingOffset = 0; + pusch_groupHoppingEnabled = "ENABLE"; + pusch_groupAssignment = 0; + pusch_sequenceHoppingEnabled = "DISABLE"; + pusch_nDMRS1 = 1; + phich_duration = "NORMAL"; + phich_resource = "ONESIXTH"; srs_enable = "DISABLE"; - /* srs_BandwidthConfig =; + /* srs_BandwidthConfig =; srs_SubframeConfig =; srs_ackNackST =; srs_MaxUpPts =;*/ @@ -72,15 +71,15 @@ eNBs = pucch_deltaF_Format1b = "deltaF3"; pucch_deltaF_Format2 = "deltaF0"; pucch_deltaF_Format2a = "deltaF0"; - pucch_deltaF_Format2b = "deltaF0"; + pucch_deltaF_Format2b = "deltaF0"; rach_numberOfRA_Preambles = 64; rach_preamblesGroupAConfig = "DISABLE"; - /* + /* rach_sizeOfRA_PreamblesGroupA = ; rach_messageSizeGroupA = ; rach_messagePowerOffsetGroupB = ; - */ + */ rach_powerRampingStep = 4; rach_preambleInitialReceivedTargetPower = -108; rach_preambleTransMax = 10; @@ -90,16 +89,17 @@ eNBs = pcch_default_PagingCycle = 128; pcch_nB = "oneT"; - bcch_modificationPeriodCoeff = 2; - ue_TimersAndConstants_t300 = 1000; - ue_TimersAndConstants_t301 = 1000; - ue_TimersAndConstants_t310 = 1000; - ue_TimersAndConstants_t311 = 10000; - ue_TimersAndConstants_n310 = 20; - ue_TimersAndConstants_n311 = 1; + bcch_modificationPeriodCoeff = 2; + ue_TimersAndConstants_t300 = 1000; + ue_TimersAndConstants_t301 = 1000; + ue_TimersAndConstants_t310 = 1000; + ue_TimersAndConstants_t311 = 10000; + ue_TimersAndConstants_n310 = 20; + ue_TimersAndConstants_n311 = 1; } ); + srb1_parameters : { # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] @@ -129,7 +129,6 @@ eNBs = SCTP_OUTSTREAMS = 2; }; - ////////// MME parameters: mme_ip_address = ( { ipv4 = "192.170.0.1"; ipv6 = "192:168:30::17"; @@ -145,12 +144,13 @@ eNBs = ENB_INTERFACE_NAME_FOR_S1U = "eth0:4"; ENB_IPV4_ADDRESS_FOR_S1U = "192.170.1.2/24"; + ENB_IPV4_ADDRESS_FOR_S1U = "192.170.0.2/24"; ENB_PORT_FOR_S1U = 2152; # Spec 2152 }; log_config : { - global_log_level ="info"; + global_log_level ="debug"; global_log_verbosity ="medium"; hw_log_level ="info"; hw_log_verbosity ="medium"; @@ -164,10 +164,6 @@ eNBs = pdcp_log_verbosity ="medium"; rrc_log_level ="info"; rrc_log_verbosity ="medium"; - gtpu_log_level ="info"; - gtpu_log_verbosity ="medium"; - udp_log_level ="info"; - udp_log_verbosity ="medium"; }; } diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf index 4722040b07638f68bbdbcf2905499ffa32d499ea..83b08cb4e0b50a409a26315331323627854b78ae 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf @@ -35,7 +35,7 @@ eNBs = nb_antennas_tx = 1; nb_antennas_rx = 1; tx_gain = 90; - rx_gain = 132; + rx_gain = 125; prach_root = 0; prach_config_index = 0; prach_high_speed = "DISABLE"; @@ -130,18 +130,18 @@ eNBs = }; ////////// MME parameters: - mme_ip_address = ( {ipv4 = "192.168.12.26"; + mme_ip_address = ( {ipv4 = "192.168.12.170"; ipv6="192:168:30::17"; active="yes"; preference="ipv4";}); NETWORK_INTERFACES : { - ENB_INTERFACE_NAME_FOR_S1_MME = "eth1"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.82/24"; + ENB_INTERFACE_NAME_FOR_S1_MME = "eth4"; + ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.242/24"; - ENB_INTERFACE_NAME_FOR_S1U = "eth1"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.82/24"; + ENB_INTERFACE_NAME_FOR_S1U = "eth4"; + ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.242/24"; ENB_PORT_FOR_S1U = 2152; # Spec 2152 }; diff --git a/targets/RT/USER/UE_transport_IQ.c b/targets/RT/USER/UE_transport_IQ.c index a52e3654aec845ab9666e7402fc0db65f2db81d1..a45b8ba43b40171e106689ea91ef32d90fdbb852 100644 --- a/targets/RT/USER/UE_transport_IQ.c +++ b/targets/RT/USER/UE_transport_IQ.c @@ -148,7 +148,7 @@ void *rrh_proc_UE_thread(void * arg) { unsigned int samples_per_frame=0; rrh_module_t *dev=(rrh_module_t *)arg; - samples_per_frame= dev->eth_dev.openair0_cfg.samples_per_frame; + samples_per_frame= dev->eth_dev.openair0_cfg->samples_per_frame; AssertFatal(samples_per_frame <=0, "invalide samples_per_frame !%u\n",samples_per_frame); time_req.tv_sec = 0; @@ -260,7 +260,7 @@ void *rrh_UE_thread(void *arg) { void *tmp; unsigned int samples_per_frame=0; - samples_per_frame= dev->eth_dev.openair0_cfg.samples_per_frame; + samples_per_frame= dev->eth_dev.openair0_cfg->samples_per_frame; time_req_1us.tv_sec = 0; time_req_1us.tv_nsec = 1000; @@ -269,26 +269,26 @@ void *rrh_UE_thread(void *arg) { cmd=dev->eth_dev.trx_start_func(&dev->eth_dev); /* allocate memory for TX/RX buffers */ - rx_buffer_UE = (int32_t**)malloc16(dev->eth_dev.openair0_cfg.rx_num_channels*sizeof(int32_t*)); - tx_buffer_UE = (int32_t**)malloc16(dev->eth_dev.openair0_cfg.tx_num_channels*sizeof(int32_t*)); + rx_buffer_UE = (int32_t**)malloc16(dev->eth_dev.openair0_cfg->rx_num_channels*sizeof(int32_t*)); + tx_buffer_UE = (int32_t**)malloc16(dev->eth_dev.openair0_cfg->tx_num_channels*sizeof(int32_t*)); - for (i=0; i<dev->eth_dev.openair0_cfg.rx_num_channels; i++) { + for (i=0; i<dev->eth_dev.openair0_cfg->rx_num_channels; i++) { tmp=(void *)malloc(sizeof(int32_t)*(samples_per_frame+4)); memset(tmp,0,sizeof(int32_t)*(samples_per_frame+4)); rx_buffer_UE[i]=(tmp+4*sizeof(int32_t)); } - for (i=0; i<dev->eth_dev.openair0_cfg.tx_num_channels; i++) { + for (i=0; i<dev->eth_dev.openair0_cfg->tx_num_channels; i++) { tmp=(void *)malloc(sizeof(int32_t)*(samples_per_frame+4)); memset(tmp,0,sizeof(int32_t)*(samples_per_frame+4)); tx_buffer_UE[i]=(tmp+4*sizeof(int32_t)); } - printf("Client %s:%d is connected (DL_RB=%d) rt=%d|%d. \n" , dev->eth_dev.openair0_cfg.remote_ip, - dev->eth_dev.openair0_cfg.remote_port, - dev->eth_dev.openair0_cfg.num_rb_dl, - dev->eth_dev.openair0_cfg.rx_num_channels, - dev->eth_dev.openair0_cfg.tx_num_channels); + printf("Client %s:%d is connected (DL_RB=%d) rt=%d|%d. \n" , dev->eth_dev.openair0_cfg->remote_addr, + dev->eth_dev.openair0_cfg->remote_port, + dev->eth_dev.openair0_cfg->num_rb_dl, + dev->eth_dev.openair0_cfg->rx_num_channels, + dev->eth_dev.openair0_cfg->tx_num_channels); if (cmd==START_CMD) { @@ -348,8 +348,8 @@ void *rrh_UE_rx_thread(void *arg) { openair0_timestamp temp, last_hw_counter=0; antenna_index = 0; - nsamps = dev->eth_dev.openair0_cfg.samples_per_packet; - samples_per_frame = dev->eth_dev.openair0_cfg.samples_per_frame; + nsamps = dev->eth_dev.openair0_cfg->samples_per_packet; + samples_per_frame = dev->eth_dev.openair0_cfg->samples_per_frame; while (rrh_exit == 0) { if (!UE_rx_started) { @@ -492,8 +492,8 @@ void *rrh_UE_tx_thread(void *arg) { unsigned int samples_per_frame=0; antenna_index = 0; - nsamps = dev->eth_dev.openair0_cfg.samples_per_packet; - samples_per_frame = dev->eth_dev.openair0_cfg.samples_per_frame; + nsamps = dev->eth_dev.openair0_cfg->samples_per_packet; + samples_per_frame = dev->eth_dev.openair0_cfg->samples_per_frame; while (rrh_exit == 0) { diff --git a/targets/RT/USER/dot11.c b/targets/RT/USER/dot11.c deleted file mode 100644 index 00e535a21d4304bee99a00424dfbeb723e2a13cb..0000000000000000000000000000000000000000 --- a/targets/RT/USER/dot11.c +++ /dev/null @@ -1,1275 +0,0 @@ -/******************************************************************************* - - Eurecom OpenAirInterface - Copyright(c) 1999 - 2011 Eurecom - - This program is free software; you can redistribute it and/or modify it - under the terms and conditions of the GNU General Public License, - version 2, as published by the Free Software Foundation. - - This program is distributed in the hope it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - more details. - - You should have received a copy of the GNU General Public License along with - this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. - - The full GNU General Public License is included in this distribution in - the file called "COPYING". - - Contact Information - Openair Admin: openair_admin@eurecom.fr - Openair Tech : openair_tech@eurecom.fr - Forums : http://forums.eurecom.fsr/openairinterface - Address : Eurecom, 2229, route des crêtes, 06560 Valbonne Sophia Antipolis, France - -*******************************************************************************/ - -<<<<<<< .mine -/*! \file dot11.c -* \brief main program to control HW and scheduling for openairITS dot11 MODEM -* \author R. Knopp, F. Kaltenberger -* \date 2012 -* \version 0.1 -* \company Eurecom -* \email: knopp@eurecom.fr,florian.kaltenberger@eurecom.fr -* \note -* \warning -*/ -======= - /*! \file dot11.c - * \brief main program to control HW and scheduling for openairITS dot11 MODEM - * \author R. Knopp, F. Kaltenberger - * \date 2012 - * \version 0.1 - * \company Eurecom - * \email: knopp@eurecom.fr,florian.kaltenberger@eurecom.fr - * \note - * \warning - */ - >>>>>>> .r3153 -#include <stdio.h> -#include <stdlib.h> -#include <unistd.h> -#include <string.h> -#include <sys/ioctl.h> -#include <sys/types.h> -#include <sys/mman.h> -#include <sys/stat.h> -#include <fcntl.h> -#include <sched.h> -#include <signal.h> -#include <execinfo.h> -#include <getopt.h> - -#include <rtai_lxrt.h> -#include <rtai_sem.h> -#include <rtai_msg.h> - -#include "PHY/types.h" -#include "PHY/defs.h" - -#include "ARCH/COMMON/defs.h" -#include "ARCH/CBMIMO1/DEVICE_DRIVER/cbmimo1_device.h" -#include "ARCH/CBMIMO1/DEVICE_DRIVER/cbmimo1_pci.h" -#include "SIMULATION/LTE_PHY/openair_hw.h" - -#include "ARCH/CBMIMO1/DEVICE_DRIVER/vars.h" -#include "SCHED/defs.h" -#include "SCHED/vars.h" - - - <<<<<<< .mine -#include "phy/DOT11/defs.h" -#include "phy/DOT11/commonvars.h" -#include <malloc.h> - ======= -#include "phy/DOT11/defs.h" -#include "phy/DOT11/commonvars.h" -#include "PHY/TOOLS/defs.h" - >>>>>>> .r3153 - - <<<<<<< .mine - ======= -#include <malloc.h> - >>>>>>> .r3153 - - <<<<<<< .mine -#include "UTIL/LOG/log.h" - ======= - >>>>>>> .r3153 - - <<<<<<< .mine -#define FRAME_LENGTH_SAMPLES_MAX 100000 - - uint16_t rev64[64]; - -int generate_test_tx=0; - - - - -======= -#include "UTIL/LOG/log.h" -#include "ieee80211p-netlinkapi.h" - -#define FRAME_LENGTH_SAMPLES_MAX 100000 - - uint16_t rev64[64]; - -int generate_test_tx=0; - - - - ->>>>>>> .r3153 -#define FRAME_PERIOD 100000000ULL -#define DAQ_PERIOD 66666ULL - - -#undef MALLOC //there are two conflicting definitions, so we better make sure we don't use it at all -enum nl80211_band { - NL80211_BAND_2GHZ, - NL80211_BAND_5GHZ, - NL80211_BAND_5_9GHZ, - NL80211_BAND_0_8GHZ, -}; - -<<<<<<< .mine - -======= - enum ieee80211_band { - IEEE80211_BAND_2GHZ = NL80211_BAND_2GHZ, - IEEE80211_BAND_5GHZ = NL80211_BAND_5GHZ, - IEEE80211_BAND_5_9GHZ = NL80211_BAND_5_9GHZ, - IEEE80211_BAND_0_8GHZ = NL80211_BAND_0_8GHZ, - }; - -struct ieee80211p_rx_status { - short data_len; //frame data length in bytes - char rssi; //received power in dBm - char rate; //reveived data rate in units of 100 kbps - enum ieee80211_band band; - char flags; //RX flags -}; /* struct ieee80211p_rx_status */ - - ->>>>>>> .r3153 -//static CND *cond; - -static int thread1; -static int thread2; - -static int sync_thread; - - -static int instance_cnt=-1; //0 means worker is busy, -1 means its free -int instance_cnt_ptr_kern,*instance_cnt_ptr_user; -int pci_interface_ptr_kern; - -extern unsigned int bigphys_top; -extern unsigned int mem_base; - -int openair_fd = 0; - -int oai_exit = 0; - -//PCI_interface_t *pci_interface[3]; - -unsigned int *DAQ_MBOX; - -unsigned int time_offset[4] = {0,0,0,0}; - -int fs4_test=0; -char UE_flag=0; - -struct timing_info_t { - unsigned int frame, hw_slot, last_slot, next_slot; - RTIME time0, time1, time2; - unsigned int mbox0, mbox1, mbox2, mbox_target; -} timing_info[20]; - -extern s16* sync_corr_ue0; -extern s16 prach_ifft[4][1024*2]; - -typedef enum {normal_txrx=0,rx_calib_ue=1,rx_calib_ue_med=2,rx_calib_ue_byp=3} runmode_t; - -runmode_t mode; -int rx_input_level_dBm; - - -int otg_enabled = 0; - -TX_RX_VARS dummy_tx_rx_vars; -unsigned int bigphys_top; -unsigned int mem_base; - -<<<<<<< .mine -uint32_t *txdata[2],*rxdata[2]; - -uint8_t *data_ind = NULL; - -extern int dot11_netlink_init(); -extern void *rx_thread(void *); -extern void *tx_thread(void *); - - -void dot11_init() -{ - - - - set_taus_seed(0); - - // Basic initializations - init_fft(64,6,rev64); - init_interleavers(); - ccodedot11_init(); - ccodedot11_init_inv(); - phy_generate_viterbi_tables(); - - init_crc32(); - -} -======= - uint32_t *txdata[2],*rxdata[2]; ->>>>>>> .r3153 - -<<<<<<< .mine -void generate_test_tx_signal() -{ - ======= - uint8_t *data_ind = NULL; - >>>>>>> .r3153 - - <<<<<<< .mine - TX_VECTOR_t tx_vector; - int i; - - if (data_ind == NULL) { - data_ind = (uint8_t*)malloc(4095+2+1); - data_ind[0] = 0; - data_ind[1] = 0; - } - - - tx_vector.rate=1; - tx_vector.sdu_length=512; - tx_vector.service=0; - - for (i=0; i<tx_vector.sdu_length; i++) - data_ind[i+2] = taus(); // randomize packet - - data_ind[tx_vector.sdu_length+2+4]=0; // Tail byte - - - printf("Generating signal at %p\n",txdata[0]); - phy_tx_start(&tx_vector,txdata[0],0,data_ind); - -} - -void signal_handler(int sig) -{ - void *array[10]; - size_t size; - ======= - CHANNEL_STATUS_t dot11_state = IDLE; - extern int Ndbps[8]; - >>>>>>> .r3153 - - extern int32_t rxDATA_F_comp_aggreg3[48*1024]; - extern int32_t rxDATA_F_comp_aggreg2[48*1024]; - -#define FRAME_LENGTH_SAMPLES 76800 -#define RX_THRES 60 - -#define SLOT_DURATION_5MHz 105 -#define RX_THRES_dB 300 - - u32 rxgain[4]= {30,30,30,30}; - unsigned int rxg_max[4]= {133,133,133,133}, rxg_med[4]= {127,127,127,127}, rxg_byp[4]= {120,120,120,120}; - - extern int tx_sdu_active; - extern int tx_sdu_length; - extern char rxsdu[2000]; - int n; - - static void *rx_thread(void *arg) { - - int fd = *((int*)arg); - int rx_offset; - RX_VECTOR_t *rxv; - uint8_t *data_ind_rx; - int i; - struct ieee80211p_rx_status *rs; - int ret,frame; - RT_TASK *task; - int16_t rx_energy; - int initial_sample_offset = 0,off=0; - int dlen,dlen_symb; - int mbox_off = 0,old_mbox,mbox_diff; - int rt_skip_cond; - int pos_crc=0,neg_crc=0; - int sdu_received; - int sample_threshold; - int log2_maxh; - struct sched_param mysched; - int skip=0; - int txlen; - - /* mysched.sched_priority = 99; - - sched_setscheduler( 0, SCHED_FIFO, &mysched); - */ - char dummy_data[16]; - - - if (fd>0) { - printf("rx_thread starting, fd %d\n",fd); - - data_ind_rx = (uint8_t*)malloc(4095+2+1+12); - - task = rt_task_init_schmod(nam2num("TASK0"), 0, 0, 0, SCHED_FIFO, 0xF); - mlockall(MCL_CURRENT | MCL_FUTURE); - - // rt_make_hard_real_time(); - - - // printf("Started rx_thread ... MBOX %d\n",((unsigned int *)DAQ_MBOX)[0]); - // wait until MBOX gets around to zero - i=0; - - while (((volatile unsigned int *)DAQ_MBOX)[0] != 0) { - rt_sleep(nano2count(10000)); - - if (i>1000) { - printf("HW not counting,exiting rx_thread\n"); - return(0); - } - } - - // printf("Got first MBOX = 0\n"); - // wait for first 120us - while (((unsigned int *)DAQ_MBOX)[0] < 2) - rt_sleep(nano2count(2*66666)); - - old_mbox = ((unsigned int *)DAQ_MBOX)[0]; - - // printf("MBOX = %d\n",((unsigned int *)DAQ_MBOX)[0]); - i = 0; - frame = 0; - // oai_exit=1; - rt_skip_cond=0; - - while (!oai_exit) { - - // printf("While in ... mbox %d\n",((unsigned int *)DAQ_MBOX)[0]); - - rx_energy = dB_fixed_times10(signal_energy((int32_t*)(rxdata[0]+(initial_sample_offset&(~0x1))), - SLOT_DURATION_5MHz - (SLOT_DURATION_5MHz&1))); - - sdu_received = 0; - - if (rx_energy>RX_THRES_dB) { - if (initial_sample_offset < SLOT_DURATION_5MHz) - off = initial_sample_offset + FRAME_LENGTH_SAMPLES - SLOT_DURATION_5MHz; - else - off = initial_sample_offset - SLOT_DURATION_5MHz; - - if (((dot11_state = initial_sync(&rxv, - &rx_offset, - &log2_maxh, - rxdata[0], - FRAME_LENGTH_SAMPLES, - off, - 1)) == BUSY)) { - - - //if ((frame % 100) == 0) - // printf("Channel is busy, rxv %p, offset %d\n",(void*)rxv,rx_offset); - - if (rxv) { - rx_energy = dB_fixed_times10(signal_energy((int32_t*)(rxdata[0]+rx_offset), - 80)); - // if ((frame%100) == 0) - printf("Frame %d: Rate %d, SDU_LENGTH %d,rx_offset %d,log2_maxh %d, rxp %f dBm (dig %f,rxgain %d)\n", - frame,rxv->rate,rxv->sdu_length,rx_offset,log2_maxh,(rx_energy/10.0)-rxg_max[0]+30-rxgain[0], - rx_energy/10.0,rxg_max[0]-30+rxgain[0]); - - if ((rxv->sdu_length > 1500) || (rxv->rate > 3) ) - printf("ERROR: Frame %d: Rate %d, SDU_LENGTH %d,rx_offset %d,log2_maxh %d, rxp %f dBm (dig %f,rxgain %d)\n", - frame,rxv->rate,rxv->sdu_length,rx_offset,log2_maxh,(rx_energy/10.0)-rxg_max[0]+30-rxgain[0], - rx_energy/10.0,rxg_max[0]-30+rxgain[0]); - else { - memset((void*)&data_ind_rx[10],0,rxv->sdu_length+4+2+1+16); - - <<<<<<< .mine - ======= - - if (data_detection(rxv,&data_ind_rx[10], - (uint32_t*)rxdata[0], - 76800,rx_offset,log2_maxh,NULL)) { - pos_crc++; - printf("Received SDU with positive CRC\n"); - - if (fd) { - rs = (struct ieee80211p_rx_status *)&data_ind_rx[0]; - rs->data_len = rxv->sdu_length; - rs->rssi = (char)((rx_energy/10.0)-rxg_max[0]+30-rxgain[0]); - rs->rate = 60; - rs->band = IEEE80211_BAND_0_8GHZ; - rs->flags = 0; - ret = netlink_send(fd,NLCMD_DATA,128,&data_ind_rx[0]); - } - - } else { - neg_crc++; - printf("Received SDU with negative CRC\n"); - oai_exit=1; - write_output("rxDATA_F_comp_aggreg3.m","rxDAT_F_comp_aggreg3", rxDATA_F_comp_aggreg3,48*200,1,1); - write_output("rxsig_sdu.m","rxsig_sdu",&rxdata[0][rx_offset],80*40,1,1); - - // write_output("rxDATA_F_comp_aggreg2.m","rxDAT_F_comp_aggreg2", rxDATA_F_comp_aggreg2,48*200,1,1); - } - - sdu_received = 1; - - // oai_exit = 1; - dlen = 32+16+6+(rxv->sdu_length<<3); // data length is 32-bits CRC + sdu + 16 service + 6 tail - dlen_symb = dlen/Ndbps[rxv->rate]; - - if ((dlen%Ndbps[rxv->rate])>0) - dlen_symb++; - - // printf("after dd: initial_sample_offset %d =>",initial_sample_offset); - initial_sample_offset = rx_offset + (80*dlen_symb); - // printf("%d\n",initial_sample_offset); - } - } else { - printf("BUSY, no synch (off %d) Frame %d (%llu us): rxp %f dBm (dig %f,rxgain %d)\n", - off,frame,rt_get_time_ns()/1000,(rx_energy/10.0)-rxg_max[0]+30-rxgain[0], - rx_energy/10.0,rxg_max[0]-30+rxgain[0]); - } - } else { - /* printf("Frame %d (%llu us): rxp %d dBm (dig %d,rxgain %d)\n", - frame,rt_get_time_ns()/1000,rx_energy-rxg_max[0]+30-rxgain[0], - rx_energy,rxg_max[0]-30+rxgain[0]); - */ - } - - } else { - - if (((frame%100) == 0) && (initial_sample_offset < 2*SLOT_DURATION_5MHz)) { - printf("Frame %d (%llu us): rxp %f dBm (dig %f,rxgain %d)\n", - frame,rt_get_time_ns()/1000,(rx_energy/10.0)-rxg_max[0]+30-rxgain[0], - rx_energy/10.0,rxg_max[0]-30+rxgain[0]); - - } - - if ((frame > 100) && - (tx_sdu_active == 1) && - (initial_sample_offset < 60000)) { - - printf("Frame %d: Generating SDU of length %d (%p), initial_sample_offset %d, MBOX <<9 %d\n",frame,tx_sdu_length,rxsdu,initial_sample_offset,DAQ_MBOX[0]<<9); /* - for (n=0;n<tx_sdu_length;n++) - printf("%2hhx.",rxsdu[n]); - printf("\n"); - */ - initial_sample_offset += (8*512); - - if (initial_sample_offset > FRAME_LENGTH_SAMPLES) - initial_sample_offset -= FRAME_LENGTH_SAMPLES; - - - - txlen= generate_tx_signal(initial_sample_offset); - // wait until TX is finished - - printf("TX: txlen %d, initial_sample_offset %d\n",txlen,initial_sample_offset); - //oai_exit=1; - - rt_sleep(nano2count((66666*8)+((txlen*66666)>>9))); - skip = initial_sample_offset+txlen-FRAME_LENGTH_SAMPLES; - - if (skip < 0) - skip = 0; - - printf("TX: erasing signal, MBOX %d (%d)\n",DAQ_MBOX[0],DAQ_MBOX[0]<<9); - - // erase TX signal - for (i=0; i<(txlen-skip); i++) - txdata[0][initial_sample_offset+i] = 0x00010001; - - for (i=0; i<skip; i++) - txdata[0][i] = 0x00010001; - - - initial_sample_offset += txlen; - - if (initial_sample_offset > FRAME_LENGTH_SAMPLES) { - initial_sample_offset -= FRAME_LENGTH_SAMPLES; - frame++; - mbox_off = 0; - } - - tx_sdu_active = 0; - old_mbox = DAQ_MBOX[0]; - - } - - - //rt_sleep(nano2count(10000)); - // printf("back from sleep 10000 ... mbox %d\n",((unsigned int *)DAQ_MBOX)[0]); - - } - - - initial_sample_offset+=SLOT_DURATION_5MHz; - - if (initial_sample_offset>FRAME_LENGTH_SAMPLES) { - initial_sample_offset-=FRAME_LENGTH_SAMPLES; - mbox_off = 0; - frame++; - // if ((frame%100) == 0) - //printf("**** New frame %d\n",frame); - - if (frame == 100000) - oai_exit = 1; - } - - // sleep until HW has filled enough samples - - - mbox_diff = ((unsigned int*)DAQ_MBOX)[0]-old_mbox; - // if ((frame%100) == 0) - // printf("frame %d, old_mbox %d, mbox %d (initial_sample_offset %d : mbox<<9 %d)\n",frame,old_mbox,((unsigned int*)DAQ_MBOX)[0],initial_sample_offset,((unsigned int*)DAQ_MBOX)[0]<<9); - - - if ((mbox_diff>10) && (sdu_received == 0)) { - mbox_off = 0; - initial_sample_offset = ((unsigned int*)DAQ_MBOX)[0]<<9; - // printf("initial_sample_offset adjusted %d\n",initial_sample_offset); - rt_skip_cond++; - // printf("old_mbox %d, mbox %d (initial_sample_offset %d : mbox<<9 %d)\n", - // old_mbox,((unsigned int*)DAQ_MBOX)[0],initial_sample_offset,((unsigned int*)DAQ_MBOX)[0]<<9); - old_mbox = ((unsigned int *)DAQ_MBOX)[0]; - - } else { - if (old_mbox > ((unsigned int *)DAQ_MBOX)[0]) - mbox_off = 150; - - old_mbox = ((unsigned int *)DAQ_MBOX)[0]; - } - - /* - printf("off: %d (%d,%d), mbox_off %d => rx_energy %d\n",initial_sample_offset, - ((unsigned int *)DAQ_MBOX)[0], - (initial_sample_offset>>9),mbox_off, - rx_energy); - */ - - sample_threshold = initial_sample_offset+1024; - - if (sample_threshold > FRAME_LENGTH_SAMPLES) - sample_threshold -= FRAME_LENGTH_SAMPLES; - - while (old_mbox+mbox_off <= (sample_threshold>>9)) { - // if ((frame % 100) == 0) - // printf("sleeping (mbox %d, mbox_off %d, initial_sample_offset>>9 %d\n", - // old_mbox,mbox_off,(initial_sample_offset>>9)); - rt_sleep(nano2count(66666)); - - if (old_mbox > ((unsigned int *)DAQ_MBOX)[0]) - mbox_off = 150; - - old_mbox = ((unsigned int *)DAQ_MBOX)[0]; - } - - // printf("While out ... mbox %d\n",((unsigned int *)DAQ_MBOX)[0]); - - } - - printf("rt_skip_cond %d, frames %d, pos_crc %d, neg_crc %d\n", - rt_skip_cond,frame,pos_crc,neg_crc); - - printf("Dumping IS stats\n"); - print_is_stats(); - print_dd_stats(); - - write_output("rxsig0.m","rxs", rxdata[0],76800,1,1); - write_output("txsig0.m","txs", txdata[0],76800,1,1); - write_output("rxDATA_F_comp_aggreg3.m","rxDAT_F_comp_aggreg3", rxDATA_F_comp_aggreg3,48*200,1,1); - write_output("rxDATA_F_comp_aggreg2.m","rxDAT_F_comp_aggreg2", rxDATA_F_comp_aggreg2,48*200,1,1); - - printf("[DOT11][PHY] Leaving rx_thread\n"); - free(data_ind_rx); - } else { - printf("[DOT11][PHY] No netlink, exiting\n"); - } - - return(0); - - - } - - //extern int dot11_netlink_init(); - //extern int dot11_rx_thread_init(); - - //extern void *rx_thread(void *); - extern void *tx_thread(void *); - - - void dot11_init() { - - - - set_taus_seed(0); - - // Basic initializations - init_fft(64,6,rev64); - init_interleavers(); - ccodedot11_init(); - ccodedot11_init_inv(); - phy_generate_viterbi_tables(); - - init_crc32(); - - } - - int generate_tx_signal(int tx_offset) { - - TX_VECTOR_t tx_vector; - int i; - - printf("Generating Signal @ %d (MBOX << 9 = %d)\n", - tx_offset,DAQ_MBOX[0]<<9); - - if (data_ind == NULL) { - data_ind = (uint8_t*)malloc(4095+2+1); - data_ind[0] = 0; - data_ind[1] = 0; - } - - - tx_vector.rate=1; - tx_vector.sdu_length=tx_sdu_length; - tx_vector.service=0; - - for (i=0; i<tx_vector.sdu_length; i++) - data_ind[i+2] = rxsdu[i]; - - data_ind[tx_vector.sdu_length+2+4]=0; // Tail byte - - >>>>>>> .r3153 - - // printf("Generating signal at %p\n",txdata[0]); - return(phy_tx_start(&tx_vector,txdata[0],tx_offset,FRAME_LENGTH_SAMPLES,data_ind)); - - } - - void signal_handler(int sig) { - void *array[10]; - size_t size; - - oai_exit=1; - - // get void*'s for all entries on the stack - size = backtrace(array, 10); - - // print out all the frames to stderr - fprintf(stderr, "Error: signal %d:\n", sig); - backtrace_symbols_fd(array, size, 2); - exit(-1); - } - - void exit_fun(const char* s) { - void *array[10]; - size_t size; - int fd; - - printf("Exiting: %s\n",s); - - oai_exit=1; - rt_sleep(nano2count(FRAME_PERIOD)); - - // cleanup - stop_rt_timer(); - - fd = 0; - ioctl(openair_fd,openair_STOP,&fd); - munmap((void*)mem_base, BIGPHYS_NUMPAGES*4096); - - exit (-1); - } - - int dummy_tx_buffer[3840*4] __attribute__((aligned(16))); - - /* This is the main dot11 thread. */ - static void *dot11_thread(void *arg) { - RT_TASK *task; - int slot=0,hw_slot,last_slot, next_slot,frame=0; - unsigned int msg1; - unsigned int aa,slot_offset, slot_offset_F; - int diff; - int delay_cnt; - RTIME time_in; - int mbox_target=0,mbox_current=0; - int i; - - task = rt_task_init_schmod(nam2num("TASK0"), 0, 0, 0, SCHED_FIFO, 0xF); - mlockall(MCL_CURRENT | MCL_FUTURE); - -#ifdef HARD_RT - <<<<<<< .mine - rt_printk("Started dot11 thread (id %p)\n",task); - - - rt_make_hard_real_time(); -#else - - printf("Started dot11 thread (id %p)\n",task); -#endif - ======= - rt_printk("Started dot11 thread (id %p)\n",task); - >>>>>>> .r3153 - - <<<<<<< .mine - - while (!oai_exit) { - // rt_printk("eNB: slot %d\n",slot); - ======= - >>>>>>> .r3153 - - <<<<<<< .mine - ======= - rt_make_hard_real_time(); -#else - >>>>>>> .r3153 - - printf("Started dot11 thread (id %p)\n",task); - - - <<<<<<< .mine - - if (frame>5) { - if ((frame%100)==0) -#ifdef HARD_RT - rt_printk("slot %d, hw_slot %d, next_slot %d (before): DAQ_MBOX %d\n", slot, hw_slot,next_slot,DAQ_MBOX[0]); - -#else - printf("frame %d slot %d, hw_slot %d, next_slot %d (before): DAQ_MBOX %d\n", frame,slot, hw_slot,next_slot,DAQ_MBOX[0]); -#endif - - if (fs4_test==0) { - if ((next_slot == 0) && (generate_test_tx==1) && ((frame%100)==0)) { - printf("Generating tx_signal in frame %d ...",frame); - generate_test_tx_signal(); - printf("done\n"); - - } else { // Check for normal TX packet - /*for (i=0;i<3840;i++) { - ((uint32_t *)txdata[0] + (3840*next_slot))[i] = 0x00010001; - }*/ - } - } - - - } - - - - ======= - - while (!oai_exit) { - // rt_printk("eNB: slot %d\n",slot); - - hw_slot = (((((unsigned int *)DAQ_MBOX)[0]+1)%150)<<1)/15; - //this is the mbox counter where we should be - mbox_target = ((((slot+1)%20)*15+1)>>1)%150; - //this is the mbox counter where we are - mbox_current = ((unsigned int *)DAQ_MBOX)[0]; - - //this is the time we need to sleep in order to synchronize with the hw (in multiples of DAQ_PERIOD) - if ((mbox_current>=135) && (mbox_target<15)) //handle the frame wrap-arround - diff = 150-mbox_current+mbox_target; - else if ((mbox_current<15) && (mbox_target>=135)) - diff = -150+mbox_target-mbox_current; - else - diff = mbox_target - mbox_current; - - if (diff < (-5)) { - printf("[dot11_thread] Frame %d: missed slot, proceeding with next one (slot %d, hw_slot %d, diff %d)\n",frame, slot, hw_slot, diff); - >>>>>>> .r3153 - slot++; - - if (slot==20) - <<<<<<< .mine - slot=0; - - //slot++; - if ((slot%20)==0) - frame++; - - ======= - slot=0; - continue; - >>>>>>> .r3153 - } - - if (diff>8) - printf("[dot11_thread] eNB Frame %d: skipped slot, waiting for hw to catch up (slot %d, hw_slot %d, mbox_current %d, mbox_target %d, diff %d)\n",frame, slot, hw_slot, mbox_current, mbox_target, diff); - - delay_cnt = 0; - - while ((diff>0) && (!oai_exit)) { - time_in = rt_get_time_ns(); - //rt_printk("eNB Frame %d delaycnt %d : hw_slot %d (%d), slot %d, (slot+1)*15=%d, diff %d, time %llu\n",frame,delay_cnt,hw_slot,((unsigned int *)DAQ_MBOX)[0],slot,(((slot+1)*15)>>1),diff,time_in); - //rt_printk("Frame %d: slot %d, sleeping for %llu\n", frame, slot, diff*DAQ_PERIOD); - rt_sleep(nano2count(diff*DAQ_PERIOD)); - hw_slot = (((((unsigned int *)DAQ_MBOX)[0]+1)%150)<<1)/15; - //rt_printk("eNB Frame %d : hw_slot %d, time %llu\n",frame,hw_slot,rt_get_time_ns()); - delay_cnt++; - - if (delay_cnt == 10) { - oai_exit = 1; - printf("[dot11_thread]eNB Frame %d: HW stopped ... \n",frame); - } - - mbox_current = ((unsigned int *)DAQ_MBOX)[0]; - - if ((mbox_current>=135) && (mbox_target<15)) //handle the frame wrap-arround - diff = 150-mbox_current+mbox_target; - else - diff = mbox_target - mbox_current; - } - - - last_slot = (slot)%LTE_SLOTS_PER_FRAME; - - if (last_slot <0) - last_slot+=20; - - next_slot = (slot+3)%LTE_SLOTS_PER_FRAME; - - <<<<<<< .mine - - - ======= - - if (frame>5) { - if ((frame%100)==0) -#ifdef HARD_RT - rt_printk("slot %d, hw_slot %d, next_slot %d (before): DAQ_MBOX %d\n", slot, hw_slot,next_slot,DAQ_MBOX[0]); - -#else - printf("frame %d slot %d, hw_slot %d, next_slot %d (before): DAQ_MBOX %d\n", frame,slot, hw_slot,next_slot,DAQ_MBOX[0]); -#endif - - if (fs4_test==0) { - if ((next_slot == 0) && (generate_test_tx==1) && ((frame%100)==0)) { - printf("Generating tx_signal in frame %d ...",frame); - //generate_test_tx_signal(); - printf("done\n"); - - } else { // Check for normal TX packet - /*for (i=0;i<3840;i++) { - ((uint32_t *)txdata[0] + (3840*next_slot))[i] = 0x00010001; - }*/ - } - } - - - } - - - - slot++; - - if (slot==20) - slot=0; - - //slot++; - if ((slot%20)==0) - frame++; - } - - rt_printk("fun0: finished, ran %d times.\n",slot); - -#ifdef HARD_RT - rt_make_soft_real_time(); -#endif - - // clean task - rt_task_delete(task); - rt_printk("Task deleted. returning\n"); - return 0; - } - - - - >>>>>>> .r3153 - int main(int argc, char **argv) { - - RT_TASK *task; - int i,j,aa; - - LTE_DL_FRAME_PARMS *frame_parms; - - u32 carrier_freq[4]= {1907600000,1907600000,1907600000,1907600000}; - u32 rf_mode_max[4] = {55231,55231,55231,55231}; - u32 rf_mode_med[4] = {39375,39375,39375,39375}; - u32 rf_mode_byp[4] = {22991,22991,22991,22991}; - - u32 rf_local[4] = {8255000,8255000,8255000,8255000}; // UE zepto - //{8254617, 8254617, 8254617, 8254617}; //eNB khalifa - //{8255067,8254810,8257340,8257340}; // eNB PETRONAS - - u32 rf_vcocal[4] = {2340,2340,2340,2340}; - u32 rf_rxdc[4] = {32896,32896,32896,32896}; - <<<<<<< .mine - u32 rxgain[4]= {20,20,20,20}; - ======= - >>>>>>> .r3153 - - <<<<<<< .mine - - ======= - - - >>>>>>> .r3153 - u8 eNB_id=0,UE_id=0; - u16 Nid_cell = 0; - u8 cooperation_flag=0, transmission_mode=1, abstraction_flag=0; - u8 beta_ACK=0,beta_RI=0,beta_CQI=2; - - int c; - char do_forms=0; - unsigned int fd,dot11_netlink_fd; - unsigned int tcxo = 114; - - int amp; - - char rxg_fname[100]; - char rflo_fname[100]; - FILE *rxg_fd=NULL; - FILE *rflo_fd=NULL; - - <<<<<<< .mine - ======= - - >>>>>>> .r3153 - const struct option long_options[] = { - {"calib-rx", required_argument, NULL, 256}, - {"calib-rx-med", required_argument, NULL, 257}, - {"calib-rx-byp", required_argument, NULL, 258}, - {NULL, 0, NULL, 0} - }; - - mode = normal_txrx; - - - while ((c = getopt_long (argc, argv, "C:ST:dF:t",long_options,NULL)) != -1) { - switch (c) { - case 'd': - do_forms=1; - break; - - case 't': - generate_test_tx = 1; - break; - - case 'C': - carrier_freq[0] = atoi(optarg); - carrier_freq[1] = atoi(optarg); - carrier_freq[2] = atoi(optarg); - carrier_freq[3] = atoi(optarg); - break; - - case 'S': - fs4_test=1; - break; - - case 'T': - tcxo=atoi(optarg); - break; - - case 'F': - sprintf(rxg_fname,"%srxg.lime",optarg); - rxg_fd = fopen(rxg_fname,"r"); - - if (rxg_fd) { - printf("Loading RX Gain parameters from %s\n",rxg_fname); - fscanf(rxg_fd,"%d %d %d %d",&rxg_max[0],&rxg_max[1],&rxg_max[2],&rxg_max[3]); - fscanf(rxg_fd,"%d %d %d %d",&rxg_med[0],&rxg_med[1],&rxg_med[2],&rxg_med[3]); - fscanf(rxg_fd,"%d %d %d %d",&rxg_byp[0],&rxg_byp[1],&rxg_byp[2],&rxg_byp[3]); - } else - printf("%s not found, running with defaults\n",rxg_fname); - - sprintf(rflo_fname,"%srflo.lime",optarg); - rflo_fd = fopen(rflo_fname,"r"); - - if (rflo_fd) { - printf("Loading RF LO parameters from %s\n",rflo_fname); - fscanf(rflo_fd,"%d %d %d %d",&rf_local[0],&rf_local[1],&rf_local[2],&rf_local[3]); - } else - printf("%s not found, running with defaults\n",rflo_fname); - - break; - - case 256: - mode = rx_calib_ue; - rx_input_level_dBm = atoi(optarg); - printf("Running with UE calibration on (LNA max), input level %d dBm\n",rx_input_level_dBm); - break; - - case 257: - mode = rx_calib_ue_med; - rx_input_level_dBm = atoi(optarg); - printf("Running with UE calibration on (LNA med), input level %d dBm\n",rx_input_level_dBm); - break; - - case 258: - mode = rx_calib_ue_byp; - rx_input_level_dBm = atoi(optarg); - printf("Running with UE calibration on (LNA byp), input level %d dBm\n",rx_input_level_dBm); - break; - - default: - break; - } - } - - - // to make a graceful exit when ctrl-c is pressed - signal(SIGSEGV, signal_handler); - - // init the parameters - frame_parms = (LTE_DL_FRAME_PARMS*) malloc(sizeof(LTE_DL_FRAME_PARMS)); - frame_parms->N_RB_DL = 25; - frame_parms->N_RB_UL = 25; - frame_parms->Ncp = 0; - frame_parms->Ncp_UL = 0; - frame_parms->Nid_cell = Nid_cell; - frame_parms->nushift = 0; - frame_parms->nb_antennas_tx = 1; - frame_parms->nb_antennas_rx = 1; - frame_parms->mode1_flag = 1; //default == SISO - frame_parms->frame_type = 1; - - if (fs4_test==1) - frame_parms->tdd_config = 255; - else - frame_parms->tdd_config = 3; - - frame_parms->tdd_config_S = 0; - frame_parms->phich_config_common.phich_resource = oneSixth; - frame_parms->phich_config_common.phich_duration = normal; - frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.cyclicShift = 0;//n_DMRS1 set to 0 - - frame_parms->node_id = NODE; - - // for Express MIMO - for (i=0; i<4; i++) { - frame_parms->carrier_freq[i] = carrier_freq[i]; - frame_parms->carrier_freqtx[i] = carrier_freq[i]; - - <<<<<<< .mine - frame_parms->rxgain[i] = rxgain[i]; - ======= - frame_parms->rxgain[i] = rxgain[i]; - - frame_parms->rflocal[i] = rf_local[i]; - frame_parms->rfvcolocal[i] = rf_vcocal[i]; - frame_parms->rxdc[i] = rf_rxdc[i]; - frame_parms->rfmode[i] = rf_mode_max[i]; - - >>>>>>> .r3153 - } - - printf("Freq %d,%d,%d,%d, Gain %d,%d,%d,%d, RFmode %d, RXDC %d, RF_local %d, rf_vcocal %d\n", - frame_parms->carrier_freq[0],frame_parms->carrier_freq[1],frame_parms->carrier_freq[2],frame_parms->carrier_freq[3], - frame_parms->rxgain[0],frame_parms->rxgain[1],frame_parms->rxgain[2],frame_parms->rxgain[3], - frame_parms->rfmode[0],frame_parms->rflocal[0], - frame_parms->rxdc[0],frame_parms->rfvcolocal[0]); - - - frame_parms->nb_prefix_samples0 = 40; - frame_parms->nb_prefix_samples = 36; - frame_parms->symbols_per_tti = 14; - frame_parms->ofdm_symbol_size = 512; - - frame_parms->log2_symbol_size = 9; - frame_parms->samples_per_tti = 7680; - frame_parms->first_carrier_offset = frame_parms->ofdm_symbol_size - 150; - - openair_fd = setup_oai_hw(frame_parms); - printf("Setting up buffers for Antenna port 0\n"); - setup_dot11_buffers(&(rxdata[0]),&(txdata[0]),0); - printf("Setting up buffers for Antenna port 1\n"); - setup_dot11_buffers(&(rxdata[1]),&(txdata[1]),1); - - <<<<<<< .mine - printf("Initializing dot11 DSP functions\n"); - dot11_init(); - dot11_netlink_fd = dot11_netlink_init(); - ======= - >>>>>>> .r3153 - - <<<<<<< .mine - - for (j=0; j<76800; j+=4) - for (aa=0; aa<frame_parms->nb_antennas_tx; aa++) { - amp = 0x8000; - // ((short*)PHY_vars_eNB_g[0]->lte_eNB_common_vars.txdata[0][aa])[2*j+1] = 0; - //((short*)PHY_vars_eNB_g[0]->lte_eNB_common_vars.txdata[0][aa])[2*j+3] = amp-1; - //((short*)PHY_vars_eNB_g[0]->lte_eNB_common_vars.txdata[0][aa])[2*j+5] = 0; - //((short*)PHY_vars_eNB_g[0]->lte_eNB_common_vars.txdata[0][aa])[2*j+7] = amp; - //((short*)PHY_vars_eNB_g[0]->lte_eNB_common_vars.txdata[0][aa])[2*j] = amp-1; - //((short*)PHY_vars_eNB_g[0]->lte_eNB_common_vars.txdata[0][aa])[2*j+2] = 0; - //((short*)PHY_vars_eNB_g[0]->lte_eNB_common_vars.txdata[0][aa])[2*j+4] = amp; - //((short*)PHY_vars_eNB_g[0]->lte_eNB_common_vars.txdata[0][aa])[2*j+6] = 0; - } - - sleep(1); - printf("Calling openair_GET_PCI_INTERFACE %x\n",openair_GET_PCI_INTERFACE); - ioctl(openair_fd,openair_GET_PCI_INTERFACE,&pci_interface_ptr_kern); - - if (pci_interface_ptr_kern == 0) { - printf("null pci_interface_ptr, exiting\n"); - exit(-1); - } - - ======= - - for (j=0; j<76800; j+=4) - for (aa=0; aa<frame_parms->nb_antennas_tx; aa++) { - amp = 0x8000; - // ((short*)PHY_vars_eNB_g[0]->lte_eNB_common_vars.txdata[0][aa])[2*j+1] = 0; - //((short*)PHY_vars_eNB_g[0]->lte_eNB_common_vars.txdata[0][aa])[2*j+3] = amp-1; - //((short*)PHY_vars_eNB_g[0]->lte_eNB_common_vars.txdata[0][aa])[2*j+5] = 0; - //((short*)PHY_vars_eNB_g[0]->lte_eNB_common_vars.txdata[0][aa])[2*j+7] = amp; - //((short*)PHY_vars_eNB_g[0]->lte_eNB_common_vars.txdata[0][aa])[2*j] = amp-1; - //((short*)PHY_vars_eNB_g[0]->lte_eNB_common_vars.txdata[0][aa])[2*j+2] = 0; - //((short*)PHY_vars_eNB_g[0]->lte_eNB_common_vars.txdata[0][aa])[2*j+4] = amp; - //((short*)PHY_vars_eNB_g[0]->lte_eNB_common_vars.txdata[0][aa])[2*j+6] = 0; - } - - sleep(1); - printf("Calling openair_GET_PCI_INTERFACE %x\n",openair_GET_PCI_INTERFACE); - ioctl(openair_fd,openair_GET_PCI_INTERFACE,&pci_interface_ptr_kern); - - if (pci_interface_ptr_kern == 0) { - printf("null pci_interface_ptr, exiting\n"); - exit(-1); - } - - exmimo_pci_interface = (exmimo_pci_interface_t*) (pci_interface_ptr_kern-bigphys_top+mem_base); - printf("pci_interface_ptr_kern = %p, exmimo_pci_interface = %p\n", (void*) pci_interface_ptr_kern, exmimo_pci_interface); - DAQ_MBOX = (unsigned int *)(0xc0000000+exmimo_pci_interface->rf.mbox-bigphys_top+mem_base); - - printf("Initializing dot11 DSP functions\n"); - dot11_init(); - dot11_netlink_fd = netlink_init(); - >>>>>>> .r3153 - exmimo_pci_interface = (exmimo_pci_interface_t*) (pci_interface_ptr_kern-bigphys_top+mem_base); - printf("pci_interface_ptr_kern = %p, exmimo_pci_interface = %p\n", (void*) pci_interface_ptr_kern, exmimo_pci_interface); - DAQ_MBOX = (unsigned int *)(0xc0000000+exmimo_pci_interface->rf.mbox-bigphys_top+mem_base); - - <<<<<<< .mine - ======= - printf("dot11_netlink_fd %d\n",dot11_netlink_fd); - - - - >>>>>>> .r3153 - // make main thread LXRT soft realtime - printf("Starting LXRT ..."); - task = rt_task_init_schmod(nam2num("MYTASK"), 9, 0, 0, SCHED_FIFO, 0xF); - mlockall(MCL_CURRENT | MCL_FUTURE); - - // start realtime timer and scheduler - //rt_set_oneshot_mode(); - rt_set_periodic_mode(); - start_rt_timer(0); - <<<<<<< .mine - printf(" done\n"); - ======= - printf(" done\n"); - - >>>>>>> .r3153 - <<<<<<< .mine - //now = rt_get_time() + 10*PERIOD; - //rt_task_make_periodic(task, now, PERIOD); - - // initialize the instance cnt before starting the thread - // instance_cnt_ptr_user = &instance_cnt; - - - - // signal the driver to set up for user-space operation - // this will initialize the semaphore and the task pointers in the kernel - // further we receive back the pointer to the shared instance counter which is used to signal if the thread is busy or not. This pointer needs to be mapped to user space. - /* - ioctl(openair_fd,openair_START_LXRT,&instance_cnt_ptr_kern); - instance_cnt_ptr_user = (int*) (instance_cnt_ptr_kern -bigphys_top+mem_base); - *instance_cnt_ptr_user = -1; - printf("instance_cnt_ptr_kern %p, instance_cnt_ptr_user %p, *instance_cnt_ptr_user %d\n", (void*) instance_cnt_ptr_kern, (void*) instance_cnt_ptr_user,*instance_cnt_ptr_user); - */ - - ======= - >>>>>>> .r3153 - - <<<<<<< .mine - - - rt_sleep(nano2count(FRAME_PERIOD)); - ======= - >>>>>>> .r3153 - // this starts the DMA transfers - <<<<<<< .mine - ======= - ioctl(openair_fd,openair_START_TX_SIG,NULL); - //ioctl(openair_fd,openair_GET_BUFFER,NULL); - >>>>>>> .r3153 - - <<<<<<< .mine - ioctl(openair_fd,openair_START_TX_SIG,NULL); - - - ======= - >>>>>>> .r3153 - rt_sleep(nano2count(10*FRAME_PERIOD)); - - - <<<<<<< .mine - thread1 = rt_thread_create(dot11_thread, NULL, 100000000); - ======= - //thread1 = rt_thread_create(dot11_thread, NULL, 100000000); - >>>>>>> .r3153 - - - <<<<<<< .mine - printf("thread created\n"); - ======= - thread1 = rt_thread_create(rx_thread, &dot11_netlink_fd, 10000000); - >>>>>>> .r3153 - - thread2 = rt_thread_create(tx_thread, &dot11_netlink_fd, 10000000); - - // wait for end of program - printf("TYPE <ENTER> TO TERMINATE main thread\n"); - getchar(); - - // stop threads - rt_sleep(nano2count(FRAME_PERIOD)); - - stop_rt_timer(); - - fd = 0; - ioctl(openair_fd,openair_STOP,&fd); - munmap((void*)mem_base, BIGPHYS_NUMPAGES*4096); - - return 0; - } diff --git a/targets/RT/USER/eNB_transport_IQ.c b/targets/RT/USER/eNB_transport_IQ.c index af3873ef76cfd4b940988333c93f4c9d586f5fb7..acb382386e4ef680414d69a55416498eee5ebb87 100644 --- a/targets/RT/USER/eNB_transport_IQ.c +++ b/targets/RT/USER/eNB_transport_IQ.c @@ -127,7 +127,7 @@ static void check_dev_config( rrh_module_t *mod_enb); * \note * @ingroup _oai */ -static void calc_rt_period_ns( openair0_config_t openair0_cfg); +static void calc_rt_period_ns( openair0_config_t *openair0_cfg); @@ -140,104 +140,37 @@ void config_BBU_mod( rrh_module_t *mod_enb, uint8_t RT_flag, uint8_t NRT_flag) { RT_flag_eNB=RT_flag; NRT_flag_eNB=NRT_flag; - - /* handshake with client to exchange parameters */ + + /* init socket and have handshake-like msg with client to exchange parameters */ mod_enb->eth_dev.trx_start_func(&mod_enb->eth_dev);//change port make it plus_id - - /* if a RF iterface is added to RRH module get the configuration parameters sent from eNB */ - if (mod_enb->devs->type != NONE_IF ) { - memcpy((void*)&mod_enb->devs->openair0_cfg,(void *)&mod_enb->eth_dev.openair0_cfg,sizeof(openair0_config_t)); - - /* certain parameters have to be updated (calibration related)*/ - if ( mod_enb->devs->type == EXMIMO_IF ) { - if ( mod_enb->devs->openair0_cfg.num_rb_dl == 100 ) { - mod_enb->devs->openair0_cfg.samples_per_packet = 2048; - mod_enb->devs->openair0_cfg.tx_forward_nsamps = 175; - mod_enb->devs->openair0_cfg.tx_delay = 8; - } - else if ( mod_enb->devs->openair0_cfg.num_rb_dl == 50 ) { - mod_enb->devs->openair0_cfg.samples_per_packet = 2048; - mod_enb->devs->openair0_cfg.tx_forward_nsamps = 95; - mod_enb->devs->openair0_cfg.tx_delay = 5; - } - else if ( mod_enb->devs->openair0_cfg.num_rb_dl == 25 ) { - mod_enb->devs->openair0_cfg.samples_per_packet = 1024; - mod_enb->devs->openair0_cfg.tx_forward_nsamps = 70; - mod_enb->devs->openair0_cfg.tx_delay = 6; - } - else if ( mod_enb->devs->openair0_cfg.num_rb_dl == 6 ) { - mod_enb->devs->openair0_cfg.samples_per_packet = 256; - mod_enb->devs->openair0_cfg.tx_forward_nsamps = 40; - mod_enb->devs->openair0_cfg.tx_delay = 8; - } - } - else if ((mod_enb->devs->type == USRP_B200_IF )||(mod_enb->devs->type == USRP_X300_IF )) { - if ( mod_enb->devs->openair0_cfg.num_rb_dl == 100 ) { - mod_enb->devs->openair0_cfg.samples_per_packet = 2048; - mod_enb->devs->openair0_cfg.tx_forward_nsamps = 175; - mod_enb->devs->openair0_cfg.tx_delay = 8; - } - else if ( mod_enb->devs->openair0_cfg.num_rb_dl == 50 ) { - mod_enb->devs->openair0_cfg.samples_per_packet = 2048; - mod_enb->devs->openair0_cfg.tx_forward_nsamps = 95; - mod_enb->devs->openair0_cfg.tx_delay = 5; - } - else if ( mod_enb->devs->openair0_cfg.num_rb_dl == 25 ) { - mod_enb->devs->openair0_cfg.samples_per_packet = 1024; - mod_enb->devs->openair0_cfg.tx_forward_nsamps = 70; - mod_enb->devs->openair0_cfg.tx_delay = 6; - } - else if ( mod_enb->devs->openair0_cfg.num_rb_dl == 6 ) { - mod_enb->devs->openair0_cfg.samples_per_packet = 256; - mod_enb->devs->openair0_cfg.tx_forward_nsamps = 40; - mod_enb->devs->openair0_cfg.tx_delay = 8; - } - } - else if(mod_enb->devs->type == BLADERF_IF) { - if ( mod_enb->devs->openair0_cfg.num_rb_dl == 100 ) { - mod_enb->devs->openair0_cfg.samples_per_packet = 2048; - mod_enb->devs->openair0_cfg.tx_forward_nsamps = 175; - mod_enb->devs->openair0_cfg.tx_delay = 8; - } - else if ( mod_enb->devs->openair0_cfg.num_rb_dl == 50 ) { - mod_enb->devs->openair0_cfg.samples_per_packet = 2048; - mod_enb->devs->openair0_cfg.tx_forward_nsamps = 95; - mod_enb->devs->openair0_cfg.tx_delay = 5; - } - else if ( mod_enb->devs->openair0_cfg.num_rb_dl == 25 ) { - mod_enb->devs->openair0_cfg.samples_per_packet = 1024; - mod_enb->devs->openair0_cfg.tx_forward_nsamps = 70; - mod_enb->devs->openair0_cfg.tx_delay = 6; + mod_enb->devs->openair0_cfg = mod_enb->eth_dev.openair0_cfg; + + /* check sanity of configuration parameters and print */ + check_dev_config(mod_enb); + if (rf_config_file[0] == '\0') + mod_enb->devs->openair0_cfg->configFilename = NULL; + else + mod_enb->devs->openair0_cfg->configFilename = rf_config_file; + /* initialize and configure the RF device */ + if (openair0_device_load(mod_enb->devs, mod_enb->devs->openair0_cfg)<0) { + LOG_E(RRH,"Exiting, cannot initialize RF device.\n"); + exit(-1); + } else { + if (mod_enb->devs->type != NONE_DEV) { + /* start RF device */ + if (mod_enb->devs->type == EXMIMO_DEV) { + //call start function for exmino + } else { + + if (mod_enb->devs->trx_start_func(mod_enb->devs)!=0) + LOG_E(RRH,"Unable to initiate RF device.\n"); + else + LOG_I(RRH,"RF device has been initiated.\n"); } - else if ( mod_enb->devs->openair0_cfg.num_rb_dl == 6 ) { - mod_enb->devs->openair0_cfg.samples_per_packet = 256; - mod_enb->devs->openair0_cfg.tx_forward_nsamps = 40; - mod_enb->devs->openair0_cfg.tx_delay = 8; - } - } - - /* check sanity of configuration parameters and print */ - check_dev_config(mod_enb); - - /* initialize and configure the RF device */ - if (openair0_device_init(mod_enb->devs, &mod_enb->devs->openair0_cfg)<0){ - LOG_E(RRH,"Exiting, cannot initialize RF device.\n"); - exit(-1); - } - else { - LOG_I(RRH,"RF device has been successfully initialized.\n"); - } - - /* start RF device */ - if (mod_enb->devs->type == EXMIMO_IF ) { - } else { - if (mod_enb->devs->trx_start_func(mod_enb->devs)!=0) - LOG_E(RRH,"Unable to initiate RF device.\n"); } - LOG_I(RRH,"RF device has been initiated.\n"); - } + } /* create main eNB module thread main_rrh_eNB_thread allocates memory @@ -266,7 +199,7 @@ void *rrh_eNB_thread(void *arg) { void *tmp; unsigned int samples_per_frame=0; - samples_per_frame = dev->eth_dev.openair0_cfg.samples_per_frame; + samples_per_frame = dev->eth_dev.openair0_cfg->samples_per_frame; while (rrh_exit==0) { @@ -278,42 +211,42 @@ void *rrh_eNB_thread(void *arg) { /* allocate memory for TX/RX buffers each antenna port has a TX and a RX buffer each TX and RX buffer is of (samples_per_frame + HEADER_SIZE) samples (size of samples is 4 bytes) */ - rx_buffer_eNB = (int32_t**)malloc16(dev->eth_dev.openair0_cfg.rx_num_channels*sizeof(int32_t*)); - tx_buffer_eNB = (int32_t**)malloc16(dev->eth_dev.openair0_cfg.tx_num_channels*sizeof(int32_t*)); + rx_buffer_eNB = (int32_t**)malloc16(dev->eth_dev.openair0_cfg->rx_num_channels*sizeof(int32_t*)); + tx_buffer_eNB = (int32_t**)malloc16(dev->eth_dev.openair0_cfg->tx_num_channels*sizeof(int32_t*)); LOG_D(RRH,"rx_buffer_eNB address =%p tx_buffer_eNB address =%p \n",rx_buffer_eNB,tx_buffer_eNB); /* rx_buffer_eNB points to the beginning of data */ - for (i=0; i<dev->eth_dev.openair0_cfg.rx_num_channels; i++) { + for (i=0; i<dev->eth_dev.openair0_cfg->rx_num_channels; i++) { tmp=(void *)malloc16(sizeof(int32_t)*(samples_per_frame + 32)); memset(tmp,0,sizeof(int32_t)*(samples_per_frame + 32)); rx_buffer_eNB[i]=( tmp + (32*sizeof(int32_t)) ); LOG_D(RRH,"i=%d rx_buffer_eNB[i]=%p tmp= %p\n",i,rx_buffer_eNB[i],tmp); } /* tx_buffer_eNB points to the beginning of data */ - for (i=0; i<dev->eth_dev.openair0_cfg.tx_num_channels; i++) { + for (i=0; i<dev->eth_dev.openair0_cfg->tx_num_channels; i++) { tmp=(void *)malloc16(sizeof(int32_t)*(samples_per_frame + 32)); memset(tmp,0,sizeof(int32_t)*(samples_per_frame + 32)); tx_buffer_eNB[i]=( tmp + (32*sizeof(int32_t)) ); LOG_D(RRH,"i= %d tx_buffer_eNB[i]=%p tmp= %p \n",i,tx_buffer_eNB[i],tmp); } /* dummy initialization for TX/RX buffers */ - for (i=0; i<dev->eth_dev.openair0_cfg.rx_num_channels; i++) { + for (i=0; i<dev->eth_dev.openair0_cfg->rx_num_channels; i++) { for (j=0; j<samples_per_frame; j++) { rx_buffer_eNB[i][j]=32+i; } } /* dummy initialization for TX/RX buffers */ - for (i=0; i<dev->eth_dev.openair0_cfg.tx_num_channels; i++) { + for (i=0; i<dev->eth_dev.openair0_cfg->tx_num_channels; i++) { for (j=0; j<samples_per_frame; j++) { tx_buffer_eNB[i][j]=12+i; } } /* allocate TX/RX buffers pointers used in write/read operations */ - rx_eNB = (void**)malloc16(dev->eth_dev.openair0_cfg.rx_num_channels*sizeof(int32_t*)); - tx_eNB = (void**)malloc16(dev->eth_dev.openair0_cfg.tx_num_channels*sizeof(int32_t*)); + rx_eNB = (void**)malloc16(dev->eth_dev.openair0_cfg->rx_num_channels*sizeof(int32_t*)); + tx_eNB = (void**)malloc16(dev->eth_dev.openair0_cfg->tx_num_channels*sizeof(int32_t*)); /* init mutexes */ - for (i=0; i<dev->eth_dev.openair0_cfg.tx_num_channels; i++) { + for (i=0; i<dev->eth_dev.openair0_cfg->tx_num_channels; i++) { pthread_mutex_init(&sync_eNB_mutex[i],NULL); pthread_cond_init(&sync_eNB_cond[i],NULL); } @@ -353,7 +286,7 @@ void *rrh_eNB_thread(void *arg) { } /* create timer thread; when no RF device is present a software clock is generated */ - if (dev->devs->type == NONE_IF) { + if (dev->devs->type == NONE_DEV) { int error_code_timer; pthread_t main_timer_proc_thread; @@ -405,10 +338,11 @@ void *rrh_eNB_thread(void *arg) { return(0); } +/* Receive from RF and transmit to RRH */ void *rrh_eNB_rx_thread(void *arg) { - /* measuremnt related vars */ + /* measurement related vars */ struct timespec time0,time1,time2; unsigned long long max_rx_time=0, min_rx_time=rt_period, total_rx_time=0, average_rx_time=rt_period, s_period=0, trial=0; int trace_cnt=0; @@ -425,10 +359,10 @@ void *rrh_eNB_rx_thread(void *arg) { time_req_1us.tv_sec = 0; time_req_1us.tv_nsec =1000; //time_req_1us.tv_nsec = (int)rt_period/2;--->granularity issue - spp_eth = dev->eth_dev.openair0_cfg.samples_per_packet; - spp_rf = dev->devs->openair0_cfg.samples_per_packet; + spp_eth = dev->eth_dev.openair0_cfg->samples_per_packet; + spp_rf = dev->devs->openair0_cfg->samples_per_packet; - samples_per_frame = dev->eth_dev.openair0_cfg.samples_per_frame; + samples_per_frame = dev->eth_dev.openair0_cfg->samples_per_frame; samples_per_subframe = (unsigned int)samples_per_frame/10; loopback = dev->loopback; measurements = dev->measurements; @@ -456,14 +390,14 @@ void *rrh_eNB_rx_thread(void *arg) { while (rrh_exit == 0) { while (rx_pos <(1 + subframe)*samples_per_subframe) { - LOG_D(RRH,"starting a new send:%d %d\n",sync_trx,frame); + //LOG_D(RRH,"starting a new send:%d %d\n",sync_trx,frame); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_RX, 1 ); VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_HW_FRAME_RX, frame); VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_HW_SUBFRAME_RX, subframe ); VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_RX_PCK, pck_rx ); LOG_D(RRH,"pack=%d rx_pos=%d subframe=%d frame=%d\n ",pck_rx, rx_pos, subframe,frame); - if (dev->devs->type == NONE_IF) { + if (dev->devs->type == NONE_DEV) { VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_RX_HWCNT, hw_counter ); VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_RX_LHWCNT, last_hw_counter ); VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_CNT, s_cnt ); @@ -501,19 +435,19 @@ void *rrh_eNB_rx_thread(void *arg) { } } - for (i=0; i<dev->eth_dev.openair0_cfg.rx_num_channels; i++) { + for (i=0; i<dev->eth_dev.openair0_cfg->rx_num_channels; i++) { rx_eNB[i] = (void*)&rx_buffer_eNB[i][rx_pos]; LOG_D(RRH," rx_eNB[i]=%p rx_buffer_eNB[i][rx_pos]=%p ,rx_pos=%d, i=%d ts=%d\n",rx_eNB[i],&rx_buffer_eNB[i][rx_pos],rx_pos,i,timestamp_rx); } VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_RXCNT, rx_pos ); - if (dev->devs->type != NONE_IF) { + if (dev->devs->type != NONE_DEV) { VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_READ_RF, 1 ); /* Read operation to RF device (RX)*/ if ( dev->devs->trx_read_func (dev->devs, ×tamp_rx, rx_eNB, spp_rf, - dev->devs->openair0_cfg.rx_num_channels + dev->devs->openair0_cfg->rx_num_channels )<0) { perror("RRH eNB : USRP read"); } @@ -526,14 +460,14 @@ void *rrh_eNB_rx_thread(void *arg) { timestamp_rx, rx_eNB, spp_eth, - dev->eth_dev.openair0_cfg.rx_num_channels, + dev->eth_dev.openair0_cfg->rx_num_channels, 0))<0) { perror("RRH eNB : ETHERNET write"); } VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE, 0 ); /* when there is no RF timestamp is updated by number of samples */ - if (dev->devs->type == NONE_IF) { + if (dev->devs->type == NONE_DEV) { timestamp_rx+=spp_eth; last_hw_counter=hw_counter; } @@ -559,7 +493,7 @@ void *rrh_eNB_rx_thread(void *arg) { } if (s_period++ == PRINTF_PERIOD) { s_period=0; - LOG_I(RRH,"Average eNB RX time : %lu\tMax RX time : %lu\tMin RX time : %lu\n",average_rx_time,max_rx_time,min_rx_time); + LOG_I(RRH,"Average eNB RX time : %lu ns\tMax RX time : %lu ns\tMin RXX time : %lu ns\n",average_rx_time,max_rx_time,min_rx_time); } } @@ -577,7 +511,7 @@ void *rrh_eNB_rx_thread(void *arg) { next_rx_pos=(rx_pos+spp_eth); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_RX, 0 ); - /**/ + /* if (frame>50) { pthread_mutex_lock(&sync_trx_mutex); while (sync_trx) { @@ -587,7 +521,7 @@ void *rrh_eNB_rx_thread(void *arg) { LOG_D(RRH,"out of while send:%d %d\n",sync_trx,frame); pthread_cond_signal(&sync_trx_cond); pthread_mutex_unlock(&sync_trx_mutex); - } + }*/ } // while subframe++; @@ -609,6 +543,7 @@ void *rrh_eNB_rx_thread(void *arg) { return 0; } +/* Receive from eNB and transmit to RF */ void *rrh_eNB_tx_thread(void *arg) { @@ -647,60 +582,34 @@ void *rrh_eNB_tx_thread(void *arg) { time_req_1us.tv_sec = 1; time_req_1us.tv_nsec = 0; - spp_eth = dev->eth_dev.openair0_cfg.samples_per_packet; - spp_rf = dev->devs->openair0_cfg.samples_per_packet; - samples_per_frame = dev->eth_dev.openair0_cfg.samples_per_frame; + spp_eth = dev->eth_dev.openair0_cfg->samples_per_packet; + spp_rf = dev->devs->openair0_cfg->samples_per_packet; + samples_per_frame = dev->eth_dev.openair0_cfg->samples_per_frame; samples_per_subframe = (unsigned int)samples_per_frame/10; tx_pos=0; - //tx_pos_rf=spp_rf*dev->devs->openair0_cfg.tx_delay; - + loopback = dev->loopback; measurements = dev->measurements; while (rrh_exit == 0) { while (tx_pos < (1 + subframe)*samples_per_subframe) { - LOG_D(RRH,"bef lock read:%d %d\n",sync_trx,frame); - pthread_mutex_lock(&sync_trx_mutex); + //LOG_D(RRH,"bef lock read:%d %d\n",sync_trx,frame); + //pthread_mutex_lock(&sync_trx_mutex); - while (!sync_trx) { - LOG_D(RRH,"in sync read:%d %d\n",sync_trx,frame); - pthread_cond_wait(&sync_trx_cond,&sync_trx_mutex); - } - LOG_D(RRH,"out of while read:%d %d\n",sync_trx,frame); + //while (!sync_trx) { + //LOG_D(RRH,"in sync read:%d %d\n",sync_trx,frame); + //pthread_cond_wait(&sync_trx_cond,&sync_trx_mutex); + //} + //LOG_D(RRH,"out of while read:%d %d\n",sync_trx,frame); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_TX, 1 ); VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_HW_FRAME, frame); VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_HW_SUBFRAME, subframe ); VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TX_PCK, pck_tx ); - - /* - if (dev->devs->type == NONE_IF) { - VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TX_HWCNT, hw_counter ); - VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TX_LHWCNT, last_hw_counter ); - - if (!eNB_tx_started) { - eNB_tx_started=1; // set this flag to 1 to indicate that eNB started - if (RT_flag_eNB==1) { - last_hw_counter=hw_counter; - } - } else { - if (RT_flag_eNB==1) { - if (hw_counter > last_hw_counter+1) { - printf("LT"); - } else { - while ((hw_counter < last_hw_counter+1)) { - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_TX_SLEEP, 1 ); - nanosleep(&time_req_1us,&time_rem_1us); - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_TX_SLEEP, 0 ); - } - } - } - } - } */ - + if (measurements == 1 ) clock_gettime(CLOCK_MONOTONIC,&time1); - for (i=0; i<dev->eth_dev.openair0_cfg.tx_num_channels; i++) tx_eNB[i] = (void*)&tx_buffer_eNB[i][tx_pos]; //RF!!!!! + for (i=0; i<dev->eth_dev.openair0_cfg->tx_num_channels; i++) tx_eNB[i] = (void*)&tx_buffer_eNB[i][tx_pos]; VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TXCNT, tx_pos ); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_READ, 1 ); @@ -710,12 +619,12 @@ void *rrh_eNB_tx_thread(void *arg) { ×tamp_tx, tx_eNB, spp_eth, - dev->eth_dev.openair0_cfg.tx_num_channels))<0) { + dev->eth_dev.openair0_cfg->tx_num_channels))<0) { perror("RRH eNB : ETHERNET read"); } VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_READ, 0 ); - if (dev->devs->type != NONE_IF) { + if (dev->devs->type != NONE_DEV) { LOG_D(RRH," tx_buffer_eNB[i][tx_pos]=%x t_buffer_eNB[i][tx_pos+1]=%x t_buffer_eNB[i][tx_pos+2]=%x \n",tx_buffer_eNB[0][tx_pos],tx_buffer_eNB[0][tx_pos+1],tx_buffer_eNB[0][tx_pos+2]); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE_RF, 1 ); /* Write operation to RF device (TX)*/ @@ -723,8 +632,8 @@ void *rrh_eNB_tx_thread(void *arg) { timestamp_tx, tx_eNB, spp_rf, - dev->devs->openair0_cfg.tx_num_channels, - 0)<0){ + dev->devs->openair0_cfg->tx_num_channels, + 1)<0){ perror("RRH eNB : USRP write"); } VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE_RF, 0 ); @@ -733,7 +642,7 @@ void *rrh_eNB_tx_thread(void *arg) { VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TX_TS, timestamp_tx&0xffffffff ); - if (dev->devs->type == NONE_IF) last_hw_counter=hw_counter; + if (dev->devs->type == NONE_DEV) last_hw_counter=hw_counter; if (loopback ==1 ) { @@ -754,10 +663,10 @@ void *rrh_eNB_tx_thread(void *arg) { tx_pos += spp_eth; pck_tx++; - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_TX, 0 ); - sync_trx=0; - pthread_cond_signal(&sync_trx_cond); - pthread_mutex_unlock(&sync_trx_mutex); + //VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_TX, 0 ); + //sync_trx=0; + //pthread_cond_signal(&sync_trx_cond); + //pthread_mutex_unlock(&sync_trx_mutex); } /* wrap around tx buffer index */ @@ -775,72 +684,67 @@ void *rrh_eNB_tx_thread(void *arg) { } -static void calc_rt_period_ns( openair0_config_t openair0_cfg) { +static void calc_rt_period_ns( openair0_config_t *openair0_cfg) { - rt_period= (double)(openair0_cfg.samples_per_packet/(openair0_cfg.samples_per_frame/10.0)*1000000); + rt_period= (double)(openair0_cfg->samples_per_packet/(openair0_cfg->samples_per_frame/10.0)*1000000); AssertFatal(rt_period > 0, "Invalid rt period !%u\n", rt_period); LOG_I(RRH,"[eNB] Real time period is set to %u ns\n", rt_period); } static void check_dev_config( rrh_module_t *mod_enb) { - - - AssertFatal( (mod_enb->devs->openair0_cfg.num_rb_dl==100 || mod_enb->devs->openair0_cfg.num_rb_dl==50 || mod_enb->devs->openair0_cfg.num_rb_dl==25 || mod_enb->devs->openair0_cfg.num_rb_dl==6) , "Invalid number of resource blocks! %d\n", mod_enb->devs->openair0_cfg.num_rb_dl); - AssertFatal( mod_enb->devs->openair0_cfg.samples_per_frame > 0 , "Invalid number of samples per frame! %d\n",mod_enb->devs->openair0_cfg.samples_per_frame); - AssertFatal( mod_enb->devs->openair0_cfg.sample_rate > 0.0, "Invalid sample rate! %f\n", mod_enb->devs->openair0_cfg.sample_rate); - AssertFatal( mod_enb->devs->openair0_cfg.samples_per_packet > 0 , "Invalid number of samples per packet! %d\n",mod_enb->devs->openair0_cfg.samples_per_packet); - AssertFatal( mod_enb->devs->openair0_cfg.rx_num_channels > 0 , "Invalid number of RX antennas! %d\n", mod_enb->devs->openair0_cfg.rx_num_channels); - AssertFatal( mod_enb->devs->openair0_cfg.tx_num_channels > 0 , "Invalid number of TX antennas! %d\n", mod_enb->devs->openair0_cfg.tx_num_channels); - AssertFatal( mod_enb->devs->openair0_cfg.rx_freq[0] > 0.0 ,"Invalid RX frequency! %f\n", mod_enb->devs->openair0_cfg.rx_freq[0]); - AssertFatal( mod_enb->devs->openair0_cfg.tx_freq[0] > 0.0 ,"Invalid TX frequency! %f\n", mod_enb->devs->openair0_cfg.tx_freq[0]); - AssertFatal( mod_enb->devs->openair0_cfg.rx_gain[0] > 0.0 ,"Invalid RX gain! %f\n", mod_enb->devs->openair0_cfg.rx_gain[0]); - AssertFatal( mod_enb->devs->openair0_cfg.tx_gain[0] > 0.0 ,"Invalid TX gain! %f\n", mod_enb->devs->openair0_cfg.tx_gain[0]); - AssertFatal( mod_enb->devs->openair0_cfg.rx_bw > 0.0 ,"Invalid RX bw! %f\n", mod_enb->devs->openair0_cfg.rx_bw); - AssertFatal( mod_enb->devs->openair0_cfg.tx_bw > 0.0 ,"Invalid RX bw! %f\n", mod_enb->devs->openair0_cfg.tx_bw); - AssertFatal( mod_enb->devs->openair0_cfg.autocal[0] > 0 , "Invalid auto calibration choice! %d\n", mod_enb->devs->openair0_cfg.autocal[0]); + + AssertFatal( (mod_enb->devs->openair0_cfg->num_rb_dl==100 || mod_enb->devs->openair0_cfg->num_rb_dl==50 || mod_enb->devs->openair0_cfg->num_rb_dl==25 || mod_enb->devs->openair0_cfg->num_rb_dl==6) , "Invalid number of resource blocks! %d\n", mod_enb->devs->openair0_cfg->num_rb_dl); + AssertFatal( mod_enb->devs->openair0_cfg->samples_per_frame > 0 , "Invalid number of samples per frame! %d\n",mod_enb->devs->openair0_cfg->samples_per_frame); + AssertFatal( mod_enb->devs->openair0_cfg->sample_rate > 0.0, "Invalid sample rate! %f\n", mod_enb->devs->openair0_cfg->sample_rate); + AssertFatal( mod_enb->devs->openair0_cfg->samples_per_packet > 0 , "Invalid number of samples per packet! %d\n",mod_enb->devs->openair0_cfg->samples_per_packet); + AssertFatal( mod_enb->devs->openair0_cfg->rx_num_channels > 0 , "Invalid number of RX antennas! %d\n", mod_enb->devs->openair0_cfg->rx_num_channels); + AssertFatal( mod_enb->devs->openair0_cfg->tx_num_channels > 0 , "Invalid number of TX antennas! %d\n", mod_enb->devs->openair0_cfg->tx_num_channels); + AssertFatal( mod_enb->devs->openair0_cfg->rx_freq[0] > 0.0 ,"Invalid RX frequency! %f\n", mod_enb->devs->openair0_cfg->rx_freq[0]); + AssertFatal( mod_enb->devs->openair0_cfg->tx_freq[0] > 0.0 ,"Invalid TX frequency! %f\n", mod_enb->devs->openair0_cfg->tx_freq[0]); + AssertFatal( mod_enb->devs->openair0_cfg->rx_gain[0] > 0.0 ,"Invalid RX gain! %f\n", mod_enb->devs->openair0_cfg->rx_gain[0]); + AssertFatal( mod_enb->devs->openair0_cfg->tx_gain[0] > 0.0 ,"Invalid TX gain! %f\n", mod_enb->devs->openair0_cfg->tx_gain[0]); + AssertFatal( mod_enb->devs->openair0_cfg->rx_bw > 0.0 ,"Invalid RX bw! %f\n", mod_enb->devs->openair0_cfg->rx_bw); + AssertFatal( mod_enb->devs->openair0_cfg->tx_bw > 0.0 ,"Invalid RX bw! %f\n", mod_enb->devs->openair0_cfg->tx_bw); + AssertFatal( mod_enb->devs->openair0_cfg->autocal[0] > 0 , "Invalid auto calibration choice! %d\n", mod_enb->devs->openair0_cfg->autocal[0]); printf("\n---------------------RF device configuration parameters---------------------\n"); - printf("\tMod_id=%d\n \tlog level=%d\n \tDL_RB=%d\n \tsamples_per_frame=%d\n \tsample_rate=%f\n \tsamples_per_packet=%d\n \ttx_delay=%d\n \ttx_forward_nsamps=%d\n \trx_num_channels=%d\n \ttx_num_channels=%d\n \trx_freq_0=%f\n \ttx_freq_0=%f\n \trx_freq_1=%f\n \ttx_freq_1=%f\n \trx_freq_2=%f\n \ttx_freq_2=%f\n \trx_freq_3=%f\n \ttx_freq_3=%f\n \trxg_mode=%d\n \trx_gain_0=%f\n \ttx_gain_0=%f\n \trx_gain_1=%f\n \ttx_gain_1=%f\n \trx_gain_2=%f\n \ttx_gain_2=%f\n \trx_gain_3=%f\n \ttx_gain_3=%f\n \trx_gain_offset_2=%f\n \ttx_gain_offset_3=%f\n \trx_bw=%f\n \ttx_bw=%f\n \tautocal=%d\n \trem_addr %s:%d\n \tmy_addr %s:%d\n", - mod_enb->devs->openair0_cfg.Mod_id, - mod_enb->devs->openair0_cfg.log_level, - mod_enb->devs->openair0_cfg.num_rb_dl, - mod_enb->devs->openair0_cfg.samples_per_frame, - mod_enb->devs->openair0_cfg.sample_rate, - mod_enb->devs->openair0_cfg.samples_per_packet, - mod_enb->devs->openair0_cfg.tx_delay, - mod_enb->devs->openair0_cfg.tx_forward_nsamps, - mod_enb->devs->openair0_cfg.rx_num_channels, - mod_enb->devs->openair0_cfg.tx_num_channels, - mod_enb->devs->openair0_cfg.rx_freq[0], - mod_enb->devs->openair0_cfg.tx_freq[0], - mod_enb->devs->openair0_cfg.rx_freq[1], - mod_enb->devs->openair0_cfg.tx_freq[1], - mod_enb->devs->openair0_cfg.rx_freq[2], - mod_enb->devs->openair0_cfg.tx_freq[2], - mod_enb->devs->openair0_cfg.rx_freq[3], - mod_enb->devs->openair0_cfg.tx_freq[3], - mod_enb->devs->openair0_cfg.rxg_mode[0], - mod_enb->devs->openair0_cfg.rx_gain[0], - mod_enb->devs->openair0_cfg.tx_gain[0], - mod_enb->devs->openair0_cfg.rx_gain[1], - mod_enb->devs->openair0_cfg.tx_gain[1], - mod_enb->devs->openair0_cfg.rx_gain[2], - mod_enb->devs->openair0_cfg.tx_gain[2], - mod_enb->devs->openair0_cfg.rx_gain[3], - mod_enb->devs->openair0_cfg.tx_gain[3], - //mod_enb->devs->openair0_cfg.rx_gain_offset[0], - //mod_enb->devs->openair0_cfg.rx_gain_offset[1], - mod_enb->devs->openair0_cfg.rx_gain_offset[2], - mod_enb->devs->openair0_cfg.rx_gain_offset[3], - mod_enb->devs->openair0_cfg.rx_bw, - mod_enb->devs->openair0_cfg.tx_bw, - mod_enb->devs->openair0_cfg.autocal[0], - mod_enb->devs->openair0_cfg.remote_ip, - mod_enb->devs->openair0_cfg.remote_port, - mod_enb->devs->openair0_cfg.my_ip, - mod_enb->devs->openair0_cfg.my_port + printf("\tMod_id=%d\n \tlog level=%d\n \tDL_RB=%d\n \tsamples_per_frame=%d\n \tsample_rate=%f\n \tsamples_per_packet=%d\n \ttx_scheduling_advance=%d\n \ttx_sample_advance=%d\n \trx_num_channels=%d\n \ttx_num_channels=%d\n \trx_freq_0=%f\n \ttx_freq_0=%f\n \trx_freq_1=%f\n \ttx_freq_1=%f\n \trx_freq_2=%f\n \ttx_freq_2=%f\n \trx_freq_3=%f\n \ttx_freq_3=%f\n \trxg_mode=%d\n \trx_gain_0=%f\n \ttx_gain_0=%f\n \trx_gain_1=%f\n \ttx_gain_1=%f\n \trx_gain_2=%f\n \ttx_gain_2=%f\n \trx_gain_3=%f\n \ttx_gain_3=%f\n \trx_gain_offset_2=%f\n \ttx_gain_offset_3=%f\n \trx_bw=%f\n \ttx_bw=%f\n \tautocal=%d\n", + mod_enb->devs->openair0_cfg->Mod_id, + mod_enb->devs->openair0_cfg->log_level, + mod_enb->devs->openair0_cfg->num_rb_dl, + mod_enb->devs->openair0_cfg->samples_per_frame, + mod_enb->devs->openair0_cfg->sample_rate, + mod_enb->devs->openair0_cfg->samples_per_packet, + mod_enb->devs->openair0_cfg->tx_scheduling_advance, + mod_enb->devs->openair0_cfg->tx_sample_advance, + mod_enb->devs->openair0_cfg->rx_num_channels, + mod_enb->devs->openair0_cfg->tx_num_channels, + mod_enb->devs->openair0_cfg->rx_freq[0], + mod_enb->devs->openair0_cfg->tx_freq[0], + mod_enb->devs->openair0_cfg->rx_freq[1], + mod_enb->devs->openair0_cfg->tx_freq[1], + mod_enb->devs->openair0_cfg->rx_freq[2], + mod_enb->devs->openair0_cfg->tx_freq[2], + mod_enb->devs->openair0_cfg->rx_freq[3], + mod_enb->devs->openair0_cfg->tx_freq[3], + mod_enb->devs->openair0_cfg->rxg_mode[0], + mod_enb->devs->openair0_cfg->tx_gain[0], + mod_enb->devs->openair0_cfg->tx_gain[0], + mod_enb->devs->openair0_cfg->rx_gain[1], + mod_enb->devs->openair0_cfg->tx_gain[1], + mod_enb->devs->openair0_cfg->rx_gain[2], + mod_enb->devs->openair0_cfg->tx_gain[2], + mod_enb->devs->openair0_cfg->rx_gain[3], + mod_enb->devs->openair0_cfg->tx_gain[3], + //mod_enb->devs->openair0_cfg->rx_gain_offset[0], + //mod_enb->devs->openair0_cfg->rx_gain_offset[1], + mod_enb->devs->openair0_cfg->rx_gain_offset[2], + mod_enb->devs->openair0_cfg->rx_gain_offset[3], + mod_enb->devs->openair0_cfg->rx_bw, + mod_enb->devs->openair0_cfg->tx_bw, + mod_enb->devs->openair0_cfg->autocal[0] ); printf("----------------------------------------------------------------------------\n"); diff --git a/targets/RT/USER/ieee80211p-softmodem.c b/targets/RT/USER/ieee80211p-softmodem.c deleted file mode 100644 index ffd630d40bc710738d5cc06ddc02c9978de62694..0000000000000000000000000000000000000000 --- a/targets/RT/USER/ieee80211p-softmodem.c +++ /dev/null @@ -1,185 +0,0 @@ -/****************************************************************************** - * - * Copyright(c) EURECOM / Thales Communications & Security - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of version 2 of the GNU General Public License as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along with - * this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA - * - * The full GNU General Public License is included in this distribution in the - * file called LICENSE. - * - * Contact Information: - * Thales Communications & Security <philippe.agostini@thalesgroup.com> - * - *****************************************************************************/ - -/****************************************************************************** - * - * Includes - * - *****************************************************************************/ - -#include <stdio.h> -#include <unistd.h> -#include <stdlib.h> -#include "ieee80211p-netlinkapi.h" -#include "phy/DOT11/defs.h" -#include "PHY/TOOLS/defs.h" -#include <stdint.h> -#include <string.h> -#include <pthread.h> - -#include <rtai_lxrt.h> -#include <rtai_sem.h> -#include <rtai_msg.h> - - -/****************************************************************************** - * - * Definitions - * - *****************************************************************************/ - -enum nl80211_band { - NL80211_BAND_2GHZ, - NL80211_BAND_5GHZ, - NL80211_BAND_5_9GHZ, - NL80211_BAND_0_8GHZ, -}; - -enum ieee80211_band { - IEEE80211_BAND_2GHZ = NL80211_BAND_2GHZ, - IEEE80211_BAND_5GHZ = NL80211_BAND_5GHZ, - IEEE80211_BAND_5_9GHZ = NL80211_BAND_5_9GHZ, - IEEE80211_BAND_0_8GHZ = NL80211_BAND_0_8GHZ, -}; - -struct ieee80211p_rx_status { - short data_len; //frame data length in bytes - char rssi; //received power in dBm - char rate; //reveived data rate in units of 100 kbps - enum ieee80211_band band; - char flags; //RX flags -}; /* struct ieee80211p_rx_status */ - -extern uint32_t *txdata[2],*rxdata[2]; -//CHANNEL_STATUS_t dot11_state = IDLE; -extern int oai_exit; - -extern unsigned int *DAQ_MBOX; - -extern int Ndbps[8]; - -extern int32_t rxDATA_F_comp_aggreg2[48*1024]; -extern int32_t rxDATA_F_comp_aggreg3[48*1024]; - -extern uint32_t rxgain[4]; -extern uint32_t rxg_max[4], rxg_med[4], rxg_byp[4]; - -#define FRAME_LENGTH_SAMPLES 76800 -#define RX_THRES 60 - -#define SLOT_DURATION_5MHz 105 -#define RX_THRES_dB 40 - -int tx_sdu_active = 0; -int tx_sdu_length = 0; -char rxsdu[2000]; - -void *tx_thread(void *arg) -{ - - int fd=*((int*)arg); - RT_TASK *task; - int ret; - int i; - char dummy_data[10]; - - - if (fd > 0) { - - ret = netlink_send(fd,NLCMD_INIT,10,&dummy_data[0]); - - printf("tx_thread starting, fd %d\n",fd); - - task = rt_task_init_schmod(nam2num("TASK1"), 0, 0, 0, SCHED_FIFO, 0xF); - mlockall(MCL_CURRENT | MCL_FUTURE); - // rt_make_hard_real_time(); - - while (!oai_exit) { - - if (tx_sdu_active == 1) - printf("tx_thread: waiting (MBOX %d)\n",((unsigned int*)DAQ_MBOX)[0]); - - while(((volatile int)tx_sdu_active) != 0) { - rt_sleep(nano2count(66666)); - } - - printf("tx_thread: calling netlink\n"); - ret = netlink_recv(fd,rxsdu); - tx_sdu_active = 1; - tx_sdu_length = ret; - - /* - if (ret > 0) { - - printf("received TX SDU: "); - for (i=0;i<ret;i++) { - printf("%02hhx ",rxsdu[i]); - } - - printf("\n"); - - } - */ - - } - } else { - printf("tx_thread: no netlink\n"); - } - - printf("tx_thread exiting\n"); - - return(0); -} - - -/****************************************************************************** - * - * Main - * - *****************************************************************************/ - -/* -int dot11_netlink_init() { - - int fd; - int ret; - int i; - char txdata[10]; - - fd = netlink_init(); - - if (fd < 0) { - return -1; - } - - ret = netlink_send(fd,NLCMD_INIT,10,&txdata[0]); - - - - return(fd); -} - -*/ - diff --git a/targets/RT/USER/lte-softmodem.c b/targets/RT/USER/lte-softmodem.c index 2409f102a4c506649651a8e2ecd6d1cd944c59ad..1409e031fe5a6beccacd1a4d9a872a67646d450a 100644 --- a/targets/RT/USER/lte-softmodem.c +++ b/targets/RT/USER/lte-softmodem.c @@ -235,6 +235,7 @@ static int time_offset[4] = {0,0,0,0}; static char UE_flag=0; //static uint8_t eNB_id=0,UE_id=0; +static char threequarter_fs=0; uint32_t downlink_frequency[MAX_NUM_CCs][4]; int32_t uplink_frequency_offset[MAX_NUM_CCs][4]; @@ -289,6 +290,8 @@ double bw = 10.0e6; static int tx_max_power[MAX_NUM_CCs]; /* = {0,0}*/; +char rf_config_file[1024]; + int chain_offset=0; #ifndef EXMIMO @@ -329,7 +332,6 @@ void reset_opp_meas(void); void print_opp_meas(void); int transmission_mode=1; - int16_t glog_level = LOG_INFO; int16_t glog_verbosity = LOG_MED; int16_t hw_log_level = LOG_INFO; @@ -360,16 +362,60 @@ int16_t osa_log_verbosity = LOG_MED; #ifdef ETHERNET -char rrh_eNB_ip[20] = "127.0.0.1"; -int rrh_eNB_port = 50000; char *rrh_UE_ip = "127.0.0.1"; int rrh_UE_port = 51000; #endif +/* flag set by eNB conf file to specify if the radio head is local or remote (default option is local) */ +uint8_t local_remote_radio = BBU_LOCAL_RADIO_HEAD; +/* struct for ethernet specific parameters given in eNB conf file */ +eth_params_t *eth_params; + char uecap_xer[1024],uecap_xer_in=0; extern void *UE_thread(void *arg); extern void init_UE_threads(void); +/*---------------------BMC: timespec helpers -----------------------------*/ + +struct timespec min_diff_time = { .tv_sec = 0, .tv_nsec = 0 }; +struct timespec max_diff_time = { .tv_sec = 0, .tv_nsec = 0 }; + +struct timespec clock_difftime(struct timespec start, struct timespec end) +{ + struct timespec temp; + if ((end.tv_nsec-start.tv_nsec)<0) { + temp.tv_sec = end.tv_sec-start.tv_sec-1; + temp.tv_nsec = 1000000000+end.tv_nsec-start.tv_nsec; + } else { + temp.tv_sec = end.tv_sec-start.tv_sec; + temp.tv_nsec = end.tv_nsec-start.tv_nsec; + } + return temp; +} + +void print_difftimes() +{ +#ifdef DEBUG + printf("difftimes min = %lu ns ; max = %lu ns\n", min_diff_time.tv_nsec, max_diff_time.tv_nsec); +#else + LOG_I(HW,"difftimes min = %lu ns ; max = %lu ns\n", min_diff_time.tv_nsec, max_diff_time.tv_nsec); +#endif +} + +void update_difftimes(struct timespec start, struct timespec end) +{ + struct timespec diff_time = { .tv_sec = 0, .tv_nsec = 0 }; + int changed = 0; + diff_time = clock_difftime(start, end); + if ((min_diff_time.tv_nsec == 0) || (diff_time.tv_nsec < min_diff_time.tv_nsec)) { min_diff_time.tv_nsec = diff_time.tv_nsec; changed = 1; } + if ((max_diff_time.tv_nsec == 0) || (diff_time.tv_nsec > max_diff_time.tv_nsec)) { max_diff_time.tv_nsec = diff_time.tv_nsec; changed = 1; } +#if 1 + if (changed) print_difftimes(); +#endif +} + +/*------------------------------------------------------------------------*/ + unsigned int build_rflocal(int txi, int txq, int rxi, int rxq) { return (txi + (txq<<6) + (rxi<<12) + (rxq<<18)); @@ -410,6 +456,7 @@ void help (void) { printf(" sudo -E lte-softmodem [options]\n"); printf(" sudo -E ./lte-softmodem -O ../../../targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.openEPC.conf -S -V -m 26 -t 16 -x 1 --ulsch-max-errors 100 -W\n\n"); printf("Options:\n"); + printf(" --rf-config-file Configuration file for front-end (e.g. LMS7002M)\n"); printf(" --ulsch-max-errors set the max ULSCH erros\n"); printf(" --calib-ue-rx set UE RX calibration\n"); printf(" --calib-ue-rx-med \n"); @@ -429,7 +476,6 @@ void help (void) { printf(" -h provides this help message!\n"); printf(" -K Generate ITTI analyzser logs (similar to wireshark logs but with more details)\n"); printf(" -m Set the maximum downlink MCS\n"); - printf(" -M IP address of RRH\n"); printf(" -O eNB configuration file (located in targets/PROJECTS/GENERIC-LTE-EPC/CONF\n"); printf(" -q Enable processing timing measurement of lte softmodem on per subframe basis \n"); printf(" -r Set the PRB, valid values: 6, 25, 50, 100 \n"); @@ -909,13 +955,13 @@ void do_OFDM_mod_rt(int subframe,PHY_VARS_eNB *phy_vars_eNB) if (phy_vars_eNB->lte_frame_parms.Ncp == EXTENDED) { PHY_ofdm_mod(&phy_vars_eNB->lte_eNB_common_vars.txdataF[0][aa][slot_offset_F], dummy_tx_b, - phy_vars_eNB->lte_frame_parms.log2_symbol_size, + phy_vars_eNB->lte_frame_parms.ofdm_symbol_size, 6, phy_vars_eNB->lte_frame_parms.nb_prefix_samples, CYCLIC_PREFIX); PHY_ofdm_mod(&phy_vars_eNB->lte_eNB_common_vars.txdataF[0][aa][slot_offset_F+slot_sizeF], dummy_tx_b+(phy_vars_eNB->lte_frame_parms.samples_per_tti>>1), - phy_vars_eNB->lte_frame_parms.log2_symbol_size, + phy_vars_eNB->lte_frame_parms.ofdm_symbol_size, 6, phy_vars_eNB->lte_frame_parms.nb_prefix_samples, CYCLIC_PREFIX); @@ -937,32 +983,26 @@ void do_OFDM_mod_rt(int subframe,PHY_VARS_eNB *phy_vars_eNB) len = phy_vars_eNB->lte_frame_parms.samples_per_tti>>1; else len = phy_vars_eNB->lte_frame_parms.samples_per_tti; - - for (i=0; i<len; i++) { + /* + for (i=0;i<len;i+=4) { + dummy_tx_b[i] = 0x100; + dummy_tx_b[i+1] = 0x01000000; + dummy_tx_b[i+2] = 0xff00; + dummy_tx_b[i+3] = 0xff000000; + }*/ + for (i=0; i<len; i++) { tx_offset = (int)slot_offset+time_offset[aa]+i; + if (tx_offset<0) tx_offset += LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*phy_vars_eNB->lte_frame_parms.samples_per_tti; if (tx_offset>=(LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*phy_vars_eNB->lte_frame_parms.samples_per_tti)) tx_offset -= LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*phy_vars_eNB->lte_frame_parms.samples_per_tti; - ((short*)&phy_vars_eNB->lte_eNB_common_vars.txdata[0][aa][tx_offset])[0]= -#ifdef EXMIMO - ((short*)dummy_tx_b)[2*i]<<4; -#elif OAI_BLADRF - ((short*)dummy_tx_b)[2*i]; -#else - ((short*)dummy_tx_b)[2*i]<<4; -#endif - ((short*)&phy_vars_eNB->lte_eNB_common_vars.txdata[0][aa][tx_offset])[1]= -#ifdef EXMIMO - ((short*)dummy_tx_b)[2*i+1]<<4; -#elif OAI_BLADRF - ((short*)dummy_tx_b)[2*i+1]; -#else - ((short*)dummy_tx_b)[2*i+1]<<4; -#endif + ((short*)&phy_vars_eNB->lte_eNB_common_vars.txdata[0][aa][tx_offset])[0] = ((short*)dummy_tx_b)[2*i]<<openair0_cfg[0].iq_txshift; + + ((short*)&phy_vars_eNB->lte_eNB_common_vars.txdata[0][aa][tx_offset])[1] = ((short*)dummy_tx_b)[2*i+1]<<openair0_cfg[0].iq_txshift; } // if S-subframe switch to RX in second subframe if (subframe_select(&phy_vars_eNB->lte_frame_parms,subframe) == SF_S) { @@ -1016,6 +1056,7 @@ static void* eNB_thread_tx( void* param ) eNB_proc_t *proc = (eNB_proc_t*)param; FILE *tx_time_file; char tx_time_name[101]; + if (opp_enabled == 1) { snprintf(tx_time_name, 100,"/tmp/%s_tx_time_thread_sf_%d", "eNB", proc->subframe); tx_time_file = fopen(tx_time_name,"w"); @@ -1155,7 +1196,20 @@ static void* eNB_thread_tx( void* param ) } do_OFDM_mod_rt( proc->subframe_tx, PHY_vars_eNB_g[0][proc->CC_id] ); - + /* + short *txdata = (short*)&PHY_vars_eNB_g[0][proc->CC_id]->lte_eNB_common_vars.txdata[0][0][proc->subframe_tx*PHY_vars_eNB_g[0][proc->CC_id]->lte_frame_parms.samples_per_tti]; + int i; + for (i=0;i<7680*2;i+=8) { + txdata[i] = 2047; + txdata[i+1] = 0; + txdata[i+2] = 0; + txdata[i+3] = 2047; + txdata[i+4] = -2047; + txdata[i+5] = 0; + txdata[i+6] = 0; + txdata[i+7] = -2047; + } + */ if (pthread_mutex_lock(&proc->mutex_tx) != 0) { LOG_E( PHY, "[SCHED][eNB] error locking mutex for eNB TX proc %d\n", proc->subframe ); exit_fun("nothing to add"); @@ -1650,6 +1704,8 @@ static void* eNB_thread( void* arg ) pthread_mutex_unlock(&sync_mutex); + printf( "got sync (eNB_thread)\n" ); + int frame = 0; #ifndef EXMIMO @@ -1657,6 +1713,10 @@ static void* eNB_thread( void* arg ) tx_pos = openair0_cfg[0].tx_scheduling_advance; #endif +#if defined(ENABLE_ITTI) + wait_system_ready ("Waiting for eNB application to be ready %s\r", &start_eNB); +#endif + while (!oai_exit) { start_meas( &softmodem_stats_mt ); @@ -1799,7 +1859,9 @@ static void* eNB_thread( void* arg ) PHY_vars_eNB_g[0][0]->lte_frame_parms.nb_antennas_rx); stop_meas( &softmodem_stats_hw ); - clock_gettime( CLOCK_MONOTONIC, &trx_time1 ); + if (frame > 50) { + clock_gettime( CLOCK_MONOTONIC, &trx_time1 ); + } if (frame > 20){ if (rxs != spp) @@ -1808,8 +1870,6 @@ static void* eNB_thread( void* arg ) VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_READ, 0 ); // Transmit TX buffer based on timestamp from RX - - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE, 1 ); // prepare tx buffer pointers @@ -1829,16 +1889,28 @@ static void* eNB_thread( void* arg ) VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_TST, (timestamp+(openair0_cfg[card].tx_scheduling_advance)-openair0_cfg[card].tx_sample_advance)&0xffffffff ); stop_meas( &softmodem_stats_mt ); - clock_gettime( CLOCK_MONOTONIC, &trx_time2 ); + if (frame > 50) { + clock_gettime( CLOCK_MONOTONIC, &trx_time2 ); + //update_difftimes(trx_time1, trx_time2); + } + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE,0); #else // USRP_DEBUG is active rt_sleep_ns(1000000); #endif - - if ((tx_launched == 0) && - (rx_pos >= (((2*hw_subframe)+1)*PHY_vars_eNB_g[0][0]->lte_frame_parms.samples_per_tti>>1))) { + /* FT configurable tx lauch delay (in slots): txlaunch_wait, txlaunch_wait_slotcount is device specific and + set in the corresponding library (with txlaunch_wait=1 and txlaunch_wait_slotcount=1 the check is as it previously was) */ + /* old check: + if ((frame>50) && + (tx_launched == 0) && + (rx_pos >= (((2*hw_subframe)+1)*PHY_vars_eNB_g[0][0]->lte_frame_parms.samples_per_tti>>1))) {*/ + if ( (frame>50) && (tx_launched == 0) && + ((openair0_cfg[card].txlaunch_wait == 0) || + ((openair0_cfg[card].txlaunch_wait == 1) && + (rx_pos >= (((2*hw_subframe)+openair0_cfg[card].txlaunch_wait_slotcount)*PHY_vars_eNB_g[0][0]->lte_frame_parms.samples_per_tti>>1))))) { + tx_launched = 1; for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) { @@ -1906,52 +1978,53 @@ static void* eNB_thread( void* arg ) #else int sf = hw_subframe; #endif - - for (int CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) { + if (frame>50) { + for (int CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) { #ifdef EXMIMO - - if (pthread_mutex_lock(&PHY_vars_eNB_g[0][CC_id]->proc[sf].mutex_tx) != 0) { - LOG_E(PHY,"[eNB] ERROR pthread_mutex_lock for eNB TX thread %d (IC %d)\n",sf,PHY_vars_eNB_g[0][CC_id]->proc[sf].instance_cnt_tx); - } else { - // LOG_I(PHY,"[eNB] Waking up eNB process %d (IC %d)\n",sf,PHY_vars_eNB_g[0][CC_id]->proc[sf].instance_cnt); - PHY_vars_eNB_g[0][CC_id]->proc[sf].instance_cnt_tx++; - pthread_mutex_unlock(&PHY_vars_eNB_g[0][CC_id]->proc[sf].mutex_tx); - - if (PHY_vars_eNB_g[0][CC_id]->proc[sf].instance_cnt_tx == 0) { - if (pthread_cond_signal(&PHY_vars_eNB_g[0][CC_id]->proc[sf].cond_tx) != 0) { - LOG_E(PHY,"[eNB] ERROR pthread_cond_signal for eNB TX thread %d\n",sf); + + if (pthread_mutex_lock(&PHY_vars_eNB_g[0][CC_id]->proc[sf].mutex_tx) != 0) { + LOG_E(PHY,"[eNB] ERROR pthread_mutex_lock for eNB TX thread %d (IC %d)\n",sf,PHY_vars_eNB_g[0][CC_id]->proc[sf].instance_cnt_tx); + } else { + // LOG_I(PHY,"[eNB] Waking up eNB process %d (IC %d)\n",sf,PHY_vars_eNB_g[0][CC_id]->proc[sf].instance_cnt); + PHY_vars_eNB_g[0][CC_id]->proc[sf].instance_cnt_tx++; + pthread_mutex_unlock(&PHY_vars_eNB_g[0][CC_id]->proc[sf].mutex_tx); + + if (PHY_vars_eNB_g[0][CC_id]->proc[sf].instance_cnt_tx == 0) { + if (pthread_cond_signal(&PHY_vars_eNB_g[0][CC_id]->proc[sf].cond_tx) != 0) { + LOG_E(PHY,"[eNB] ERROR pthread_cond_signal for eNB TX thread %d\n",sf); + exit_fun("nothing to add"); + } + } else { + LOG_W(PHY,"[eNB] Frame %d, eNB TX thread %d busy!!\n",PHY_vars_eNB_g[0][CC_id]->proc[sf].frame_tx,sf); exit_fun("nothing to add"); - } - } else { - LOG_W(PHY,"[eNB] Frame %d, eNB TX thread %d busy!!\n",PHY_vars_eNB_g[0][CC_id]->proc[sf].frame_tx,sf); - exit_fun("nothing to add"); - } - } - + } + } + #endif - if (pthread_mutex_lock(&PHY_vars_eNB_g[0][CC_id]->proc[sf].mutex_rx) != 0) { - LOG_E( PHY, "[eNB] ERROR pthread_mutex_lock for eNB RX thread %d (IC %d)\n", sf, PHY_vars_eNB_g[0][CC_id]->proc[sf].instance_cnt_rx ); - exit_fun( "error locking mutex_rx" ); - break; - } - - int cnt_rx = ++PHY_vars_eNB_g[0][CC_id]->proc[sf].instance_cnt_rx; - - pthread_mutex_unlock( &PHY_vars_eNB_g[0][CC_id]->proc[sf].mutex_rx ); - - if (cnt_rx == 0) { - // the thread was presumably waiting where it should and can now be woken up - if (pthread_cond_signal(&PHY_vars_eNB_g[0][CC_id]->proc[sf].cond_rx) != 0) { - LOG_E( PHY, "[eNB] ERROR pthread_cond_signal for eNB RX thread %d\n", sf ); - exit_fun( "ERROR pthread_cond_signal" ); - break; - } - } else { - LOG_W( PHY, "[eNB] Frame %d, eNB RX thread %d busy!! instance_cnt %d CC_id %d\n", PHY_vars_eNB_g[0][CC_id]->proc[sf].frame_rx, sf, PHY_vars_eNB_g[0][CC_id]->proc[sf].instance_cnt_rx, CC_id ); - exit_fun( "RX thread busy" ); - break; - } + if (pthread_mutex_lock(&PHY_vars_eNB_g[0][CC_id]->proc[sf].mutex_rx) != 0) { + LOG_E( PHY, "[eNB] ERROR pthread_mutex_lock for eNB RX thread %d (IC %d)\n", sf, PHY_vars_eNB_g[0][CC_id]->proc[sf].instance_cnt_rx ); + exit_fun( "error locking mutex_rx" ); + break; + } + + int cnt_rx = ++PHY_vars_eNB_g[0][CC_id]->proc[sf].instance_cnt_rx; + + pthread_mutex_unlock( &PHY_vars_eNB_g[0][CC_id]->proc[sf].mutex_rx ); + + if (cnt_rx == 0) { + // the thread was presumably waiting where it should and can now be woken up + if (pthread_cond_signal(&PHY_vars_eNB_g[0][CC_id]->proc[sf].cond_rx) != 0) { + LOG_E( PHY, "[eNB] ERROR pthread_cond_signal for eNB RX thread %d\n", sf ); + exit_fun( "ERROR pthread_cond_signal" ); + break; + } + } else { + LOG_W( PHY, "[eNB] Frame %d, eNB RX thread %d busy!! instance_cnt %d CC_id %d\n", PHY_vars_eNB_g[0][CC_id]->proc[sf].frame_rx, sf, PHY_vars_eNB_g[0][CC_id]->proc[sf].instance_cnt_rx, CC_id ); + exit_fun( "RX thread busy" ); + break; + } + } } } @@ -1999,6 +2072,9 @@ eNB_thread_cleanup: #endif eNB_thread_status = 0; + + // print_difftimes(); + return &eNB_thread_status; } @@ -2028,6 +2104,7 @@ static void get_options (int argc, char **argv) enum long_option_e { LONG_OPTION_START = 0x100, /* Start after regular single char options */ + LONG_OPTION_RF_CONFIG_FILE, LONG_OPTION_ULSCH_MAX_CONSECUTIVE_ERRORS, LONG_OPTION_CALIB_UE_RX, LONG_OPTION_CALIB_UE_RX_MED, @@ -2044,6 +2121,7 @@ static void get_options (int argc, char **argv) }; static const struct option long_options[] = { + {"rf-config-file",required_argument, NULL, LONG_OPTION_RF_CONFIG_FILE}, {"ulsch-max-errors",required_argument, NULL, LONG_OPTION_ULSCH_MAX_CONSECUTIVE_ERRORS}, {"calib-ue-rx", required_argument, NULL, LONG_OPTION_CALIB_UE_RX}, {"calib-ue-rx-med", required_argument, NULL, LONG_OPTION_CALIB_UE_RX_MED}, @@ -2060,13 +2138,21 @@ static void get_options (int argc, char **argv) {NULL, 0, NULL, 0} }; - while ((c = getopt_long (argc, argv, "A:a:C:dK:g:F:G:hqO:m:SUVRM:r:P:Ws:t:Tx:",long_options,NULL)) != -1) { + while ((c = getopt_long (argc, argv, "A:a:C:dEK:g:F:G:hqO:m:SUVRM:r:P:Ws:t:Tx:",long_options,NULL)) != -1) { switch (c) { + case LONG_OPTION_RF_CONFIG_FILE: + if (strlen(optarg)<=1024) + strcpy(rf_config_file,optarg); + else { + printf("Configuration filename is too long\n"); + exit(-1); + } + break; case LONG_OPTION_MAXPOWER: tx_max_power[0]=atoi(optarg); for (CC_id=1;CC_id<MAX_NUM_CCs;CC_id++) tx_max_power[CC_id]=tx_max_power[0]; - + break; case LONG_OPTION_ULSCH_MAX_CONSECUTIVE_ERRORS: ULSCH_max_consecutive_errors = atoi(optarg); printf("Set ULSCH_max_consecutive_errors = %d\n",ULSCH_max_consecutive_errors); @@ -2127,14 +2213,7 @@ static void get_options (int argc, char **argv) case LONG_OPTION_DUMP_FRAME: mode = rx_dump_frame; - break; - - case 'M': -#ifdef ETHERNET - strcpy(rrh_eNB_ip,optarg); -#endif - break; - + break; case 'A': timing_advance = atoi (optarg); break; @@ -2162,6 +2241,10 @@ static void get_options (int argc, char **argv) printf("Running with XFORMS!\n"); #endif break; + + case 'E': + threequarter_fs=1; + break; case 'K': #if defined(ENABLE_ITTI) @@ -2373,6 +2456,41 @@ static void get_options (int argc, char **argv) "lte-softmodem compiled with MAX_NUM_CCs=%d, but only %d CCs configured for eNB %d!", MAX_NUM_CCs, enb_properties->properties[i]->nb_cc, i); + for (j=0; j<enb_properties->properties[i]->nb_rrh_gw; j++) { + + if (enb_properties->properties[i]->rrh_gw_config[j].active == 1 ) { + local_remote_radio = BBU_REMOTE_RADIO_HEAD; + eth_params = (eth_params_t*)malloc(sizeof(eth_params_t)); + memset(eth_params, 0, sizeof(eth_params_t)); + + eth_params->local_if_name = enb_properties->properties[i]->rrh_gw_if_name; + eth_params->my_addr = enb_properties->properties[i]->rrh_gw_config[j].local_address; + eth_params->my_port = enb_properties->properties[i]->rrh_gw_config[j].local_port; + eth_params->remote_addr = enb_properties->properties[i]->rrh_gw_config[j].remote_address; + eth_params->remote_port = enb_properties->properties[i]->rrh_gw_config[j].remote_port; + eth_params->transp_preference = enb_properties->properties[i]->rrh_gw_config[j].raw; + eth_params->iq_txshift = enb_properties->properties[i]->rrh_gw_config[j].iq_txshift; + eth_params->tx_sample_advance = enb_properties->properties[i]->rrh_gw_config[j].tx_sample_advance; + eth_params->tx_scheduling_advance = enb_properties->properties[i]->rrh_gw_config[j].tx_scheduling_advance; + if (enb_properties->properties[i]->rrh_gw_config[j].exmimo == 1) { + eth_params->rf_preference = EXMIMO_DEV; + } else if (enb_properties->properties[i]->rrh_gw_config[j].usrp_b200 == 1) { + eth_params->rf_preference = USRP_B200_DEV; + } else if (enb_properties->properties[i]->rrh_gw_config[j].usrp_x300 == 1) { + eth_params->rf_preference = USRP_X300_DEV; + } else if (enb_properties->properties[i]->rrh_gw_config[j].bladerf == 1) { + eth_params->rf_preference = BLADERF_DEV; + } else if (enb_properties->properties[i]->rrh_gw_config[j].lmssdr == 1) { + //eth_params->rf_preference = LMSSDR_DEV; + } else { + eth_params->rf_preference = 0; + } + } else { + local_remote_radio = BBU_LOCAL_RADIO_HEAD; + } + + } + for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) { frame_parms[CC_id]->frame_type = enb_properties->properties[i]->frame_type[CC_id]; frame_parms[CC_id]->tdd_config = enb_properties->properties[i]->tdd_config[CC_id]; @@ -2525,8 +2643,12 @@ int main( int argc, char **argv ) } logInit(); + rf_config_file[0]='\0'; get_options (argc, argv); //Command-line options - + if (rf_config_file[0] == '\0') + openair0_cfg[0].configFilename = NULL; + else + openair0_cfg[0].configFilename = rf_config_file; // initialize the log (see log.h for details) set_glog(glog_level, glog_verbosity); @@ -2671,6 +2793,7 @@ int main( int argc, char **argv ) frame_parms[CC_id]->pusch_config_common.ul_ReferenceSignalsPUSCH.groupHoppingEnabled = 0; frame_parms[CC_id]->pusch_config_common.ul_ReferenceSignalsPUSCH.sequenceHoppingEnabled = 0; frame_parms[CC_id]->pusch_config_common.ul_ReferenceSignalsPUSCH.groupAssignmentPUSCH = 0; + frame_parms[CC_id]->threequarter_fs = threequarter_fs; init_ul_hopping(frame_parms[CC_id]); init_frame_parms(frame_parms[CC_id],1); // phy_init_top(frame_parms[CC_id]); @@ -2876,10 +2999,18 @@ int main( int argc, char **argv ) for (card=0; card<MAX_CARDS; card++) { if(frame_parms[0]->N_RB_DL == 100) { - openair0_cfg[card].sample_rate=30.72e6; - openair0_cfg[card].samples_per_frame = 307200; - openair0_cfg[card].tx_bw = 10e6; - openair0_cfg[card].rx_bw = 10e6; + if (frame_parms[0]->threequarter_fs) { + openair0_cfg[card].sample_rate=23.04e6; + openair0_cfg[card].samples_per_frame = 230400; + openair0_cfg[card].tx_bw = 10e6; + openair0_cfg[card].rx_bw = 10e6; + } + else { + openair0_cfg[card].sample_rate=30.72e6; + openair0_cfg[card].samples_per_frame = 307200; + openair0_cfg[card].tx_bw = 10e6; + openair0_cfg[card].rx_bw = 10e6; + } } else if(frame_parms[0]->N_RB_DL == 50) { openair0_cfg[card].sample_rate=15.36e6; openair0_cfg[card].samples_per_frame = 153600; @@ -2888,9 +3019,8 @@ int main( int argc, char **argv ) } else if (frame_parms[0]->N_RB_DL == 25) { openair0_cfg[card].sample_rate=7.68e6; openair0_cfg[card].samples_per_frame = 76800; - openair0_cfg[card].tx_bw = 5e6; - openair0_cfg[card].rx_bw = 5e6; - + openair0_cfg[card].tx_bw = 2.5e6; + openair0_cfg[card].rx_bw = 2.5e6; } else if (frame_parms[0]->N_RB_DL == 6) { openair0_cfg[card].sample_rate=1.92e6; openair0_cfg[card].samples_per_frame = 19200; @@ -2903,20 +3033,13 @@ int main( int argc, char **argv ) else //FDD openair0_cfg[card].duplex_mode = duplex_mode_FDD; -#ifdef ETHERNET - - //calib needed - openair0_cfg[card].tx_scheduling_advance = 0; - openair0_cfg[card].tx_sample_advance = 0; - - if (frame_parms[0]->N_RB_DL == 6) - openair0_cfg[card].samples_per_packet = 256; - else - openair0_cfg[card].samples_per_packet = 1024; - - printf("HW: samples_per_packet %d\n",openair0_cfg[card].samples_per_packet); -#endif + if (local_remote_radio == BBU_REMOTE_RADIO_HEAD) { + openair0_cfg[card].remote_addr = eth_params->remote_addr; + openair0_cfg[card].remote_port = eth_params->remote_port; + openair0_cfg[card].my_addr = eth_params->my_addr; + openair0_cfg[card].my_port = eth_params->my_port; + } printf("HW: Configuring card %d, nb_antennas_tx/rx %d/%d\n",card, ((UE_flag==0) ? PHY_vars_eNB_g[0][0]->lte_frame_parms.nb_antennas_tx : PHY_vars_UE_g[0][0]->lte_frame_parms.nb_antennas_tx), @@ -2926,13 +3049,10 @@ int main( int argc, char **argv ) if (UE_flag) { printf("ETHERNET: Configuring UE ETH for %s:%d\n",rrh_UE_ip,rrh_UE_port); - openair0_cfg[card].remote_ip = &rrh_UE_ip[0]; + openair0_cfg[card].remote_addr = &rrh_UE_ip[0]; openair0_cfg[card].remote_port = rrh_UE_port; - } else { - printf("ETHERNET: Configuring eNB ETH for %s:%d\n",rrh_eNB_ip,rrh_eNB_port); - openair0_cfg[card].remote_ip = &rrh_eNB_ip[0]; - openair0_cfg[card].remote_port = rrh_eNB_port; - } + } + openair0_cfg[card].num_rb_dl=frame_parms[0]->N_RB_DL; #endif @@ -2959,9 +3079,10 @@ int main( int argc, char **argv ) openair0_cfg[card].rx_gain[i] = PHY_vars_eNB_g[0][0]->rx_total_gain_eNB_dB; } else { - openair0_cfg[card].rx_gain[i] = PHY_vars_UE_g[0][0]->rx_total_gain_dB;// - USRP_GAIN_OFFSET; // calibrated for USRP B210 @ 2.6 GHz, 30.72 MS/s + openair0_cfg[card].rx_gain[i] = PHY_vars_UE_g[0][0]->rx_total_gain_dB; } - + +#if 0 // UHD 3.8 switch(frame_parms[0]->N_RB_DL) { case 6: openair0_cfg[card].rx_gain[i] -= 12; @@ -2982,24 +3103,46 @@ int main( int argc, char **argv ) default: break; } - +#endif } #endif } - - openair0.func_type = BBU_FUNC; + /* device host type is set*/ + openair0.host_type = BBU_HOST; + /* device type is initialized NONE_DEV (no RF device) when the RF device will be initiated device type will be set */ + openair0.type = NONE_DEV; + /* transport type is initialized NONE_TP (no transport protocol) when the transport protocol will be initiated transport protocol type will be set */ + openair0.transp_type = NONE_TP; openair0_cfg[0].log_level = glog_level; - if ((mode!=loop_through_memory) && - (openair0_device_init(&openair0, &openair0_cfg[0]) <0)) { - printf("Exiting, cannot initialize device\n"); - exit(-1); - } - else if (mode==loop_through_memory) { - } - + int returns=-1; + /* BBU can have either a local or a remote radio head */ + if (local_remote_radio == BBU_LOCAL_RADIO_HEAD) { //local radio head active - load library of radio head and initiate it + if (mode!=loop_through_memory) { + returns=openair0_device_load(&openair0, &openair0_cfg[0]); + printf("openair0_device_init returns %d\n",returns); + if (returns<0) { + printf("Exiting, cannot initialize device\n"); + exit(-1); + } + } + else if (mode==loop_through_memory) { + } + } else { //remote radio head active - load library of transport protocol and initiate it + if (mode!=loop_through_memory) { + returns=openair0_transport_load(&openair0, &openair0_cfg[0], eth_params); + printf("openair0_transport_init returns %d\n",returns); + if (returns<0) { + printf("Exiting, cannot initialize transport protocol\n"); + exit(-1); + } + } + else if (mode==loop_through_memory) { + } + } + printf("Done\n"); mac_xface = malloc(sizeof(MAC_xface)); @@ -3152,15 +3295,15 @@ int main( int argc, char **argv ) pthread_cond_init(&sync_cond,NULL); pthread_mutex_init(&sync_mutex, NULL); -#if defined(ENABLE_ITTI) + /* this is moved to the eNB main thread */ +//#if defined(ENABLE_ITTI) // Wait for eNB application initialization to be complete (eNB registration to MME) - if (UE_flag==0) { - printf("Waiting for eNB application to be ready\n"); - wait_system_ready ("Waiting for eNB application to be ready %s\r", &start_eNB); - } - -#endif + // if (UE_flag==0) { + // printf("Waiting for eNB application to be ready\n"); + //wait_system_ready ("Waiting for eNB application to be ready %s\r", &start_eNB); + // } + //#endif // this starts the DMA transfers @@ -3279,6 +3422,16 @@ int main( int argc, char **argv ) #endif printf("UE threads created\n"); +#ifdef USE_MME + + while (start_UE == 0) { + sleep(1); + } + +#endif + + + } else { if (multi_thread>0) { init_eNB_proc(); @@ -3306,13 +3459,7 @@ int main( int argc, char **argv ) // Sleep to allow all threads to setup sleep(1); -#ifdef USE_MME - - while (start_UE == 0) { - sleep(1); - } -#endif #ifndef EXMIMO @@ -3325,6 +3472,7 @@ int main( int argc, char **argv ) #endif + printf("Sending sync to all threads\n"); pthread_mutex_lock(&sync_mutex); sync_var=0; @@ -3417,7 +3565,6 @@ int main( int argc, char **argv ) if (multi_thread>0) { printf("Killing eNB processing threads\n"); kill_eNB_proc(); - } } @@ -3509,10 +3656,6 @@ int setup_eNB_buffers(PHY_VARS_eNB **phy_vars_eNB, openair0_config_t *openair0_c #endif - - - - // replace RX signal buffers with mmaped HW versions #ifdef EXMIMO openair0_cfg[CC_id].tx_num_channels = 0; diff --git a/targets/RT/USER/lte-ue.c b/targets/RT/USER/lte-ue.c index 9930f677c102a22eb09060c35fdfcea3bb940d63..c31ad32009636b99f281bf28c71aa1b993bef82c 100644 --- a/targets/RT/USER/lte-ue.c +++ b/targets/RT/USER/lte-ue.c @@ -279,7 +279,7 @@ static void *UE_thread_synch(void *arg) #ifdef OAI_USRP openair0_cfg[card].rx_gain[i] = UE->rx_total_gain_dB;//-USRP_GAIN_OFFSET; - +#if 0 // UHD 3.8 switch(UE->lte_frame_parms.N_RB_DL) { case 6: openair0_cfg[card].rx_gain[i] -= 12; @@ -301,7 +301,7 @@ static void *UE_thread_synch(void *arg) printf( "Unknown number of RBs %d\n", UE->lte_frame_parms.N_RB_DL ); break; } - +#endif printf( "UE synch: setting RX gain (%d,%d) to %f\n", card, i, openair0_cfg[card].rx_gain[i] ); #endif } @@ -357,7 +357,8 @@ static void *UE_thread_synch(void *arg) openair0_cfg[card].tx_freq[i] = downlink_frequency[card][i]+uplink_frequency_offset[card][i]; #ifdef OAI_USRP openair0_cfg[card].rx_gain[i] = UE->rx_total_gain_dB;//-USRP_GAIN_OFFSET; // 65 calibrated for USRP B210 @ 2.6 GHz - + +#if 0 // UHD 3.8 switch(UE->lte_frame_parms.N_RB_DL) { case 6: openair0_cfg[card].rx_gain[i] -= 12; @@ -379,7 +380,7 @@ static void *UE_thread_synch(void *arg) printf("Unknown number of RBs %d\n",UE->lte_frame_parms.N_RB_DL); break; } - +#endif printf("UE synch: setting RX gain (%d,%d) to %f\n",card,i,openair0_cfg[card].rx_gain[i]); #endif @@ -400,7 +401,7 @@ static void *UE_thread_synch(void *arg) case pbch: - + LOG_I(PHY,"[UE thread Synch] Running Initial Synch\n"); if (initial_sync( UE, UE->mode ) == 0) { hw_slot_offset = (UE->rx_offset<<1) / UE->lte_frame_parms.samples_per_tti; @@ -423,25 +424,25 @@ static void *UE_thread_synch(void *arg) openair0_cfg[0].sample_rate =1.92e6; openair0_cfg[0].rx_bw =.96e6; openair0_cfg[0].tx_bw =.96e6; - openair0_cfg[0].rx_gain[0] -= 12; + // openair0_cfg[0].rx_gain[0] -= 12; break; case 25: openair0_cfg[0].sample_rate =7.68e6; openair0_cfg[0].rx_bw =2.5e6; openair0_cfg[0].tx_bw =2.5e6; - openair0_cfg[0].rx_gain[0] -= 6; + // openair0_cfg[0].rx_gain[0] -= 6; break; case 50: openair0_cfg[0].sample_rate =15.36e6; openair0_cfg[0].rx_bw =5.0e6; openair0_cfg[0].tx_bw =5.0e6; - openair0_cfg[0].rx_gain[0] -= 3; + // openair0_cfg[0].rx_gain[0] -= 3; break; case 100: openair0_cfg[0].sample_rate=30.72e6; openair0_cfg[0].rx_bw=10.0e6; openair0_cfg[0].tx_bw=10.0e6; - openair0_cfg[0].rx_gain[0] -= 0; + // openair0_cfg[0].rx_gain[0] -= 0; break; } #ifndef EXMIMO @@ -520,10 +521,6 @@ static void *UE_thread_synch(void *arg) for (i=0; i<openair0_cfg[card].rx_num_channels; i++) { openair0_cfg[card].rx_freq[i] = downlink_frequency[card][i]+freq_offset; openair0_cfg[card].tx_freq[i] = downlink_frequency[card][i]+uplink_frequency_offset[card][i]+freq_offset; -#ifdef OAI_USRP - openair0_cfg[card].rx_gain[i] = UE->rx_total_gain_dB;//-USRP_GAIN_OFFSET; - - #ifndef EXMIMO openair0.trx_set_freq_func(&openair0,&openair0_cfg[0],0); @@ -531,6 +528,12 @@ static void *UE_thread_synch(void *arg) openair0_set_frequencies(&openair0,&openair0_cfg[0],0); #endif + +#if defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR) + openair0_cfg[card].rx_gain[i] = UE->rx_total_gain_dB;//-USRP_GAIN_OFFSET; + + +#if 0 switch(UE->lte_frame_parms.N_RB_DL) { case 6: openair0_cfg[card].rx_gain[i] -= 12; @@ -552,7 +555,7 @@ static void *UE_thread_synch(void *arg) printf("Unknown number of RBs %d\n",UE->lte_frame_parms.N_RB_DL); break; } - +#endif #endif } } @@ -1104,10 +1107,10 @@ void *UE_thread(void *arg) for (int i=0; i<UE->lte_frame_parms.nb_antennas_rx; i++) rxp[i] = (dummy_dump==0) ? (void*)&rxdata[i][rxpos] : (void*)dummy[i]; - /* - if (dummy_dump == 0) - printf("writing %d samples to %d (first_rx %d)\n",spp - ((first_rx==1) ? rx_off_diff : 0),rxpos,first_rx); - */ + + /* if (dummy_dump == 0) + printf("writing %d samples to %d (first_rx %d)\n",spp - ((first_rx==1) ? rx_off_diff : 0),rxpos,first_rx);*/ + if (UE->mode != loop_through_memory) { rxs = openair0.trx_read_func(&openair0, ×tamp, @@ -1116,8 +1119,11 @@ void *UE_thread(void *arg) UE->lte_frame_parms.nb_antennas_rx); if (rxs != (spp- ((first_rx==1) ? rx_off_diff : 0))) { - exit_fun("problem in rx"); - return &UE_thread_retval; + printf("rx error: asked %d got %d ",spp - ((first_rx==1) ? rx_off_diff : 0),rxs); + if (UE->is_synchronized == 1) { + exit_fun("problem in rx"); + return &UE_thread_retval; + } } } @@ -1334,6 +1340,7 @@ void *UE_thread(void *arg) #ifndef USRP_DEBUG if (UE->mode != loop_through_memory) { + LOG_I(PHY,"Resynchronizing RX by %d samples\n",UE->rx_offset); rxs = openair0.trx_read_func(&openair0, ×tamp, (void**)rxdata, diff --git a/targets/RT/USER/rrh.gtkw b/targets/RT/USER/rrh.gtkw index 22a5a9f575b252528a9bb701ba3940c826296adc..891f23ada52417ffd360f617eab2eeecd2ef16cd 100644 --- a/targets/RT/USER/rrh.gtkw +++ b/targets/RT/USER/rrh.gtkw @@ -1,19 +1,19 @@ [*] [*] GTKWave Analyzer v3.3.58 (w)1999-2014 BSI -[*] Thu Sep 17 14:23:43 2015 +[*] Fri Jan 29 16:34:46 2016 [*] [dumpfile] "/tmp/openair_dump_rrh.vcd" -[dumpfile_mtime] "Thu Sep 17 14:21:43 2015" -[dumpfile_size] 636509125 -[savefile] "/home/guepe/openair4G/targets/RT/USER/rrh.gtkw" -[timestart] 17746655400 -[size] 1855 1056 -[pos] -1 -1 -*-15.826077 17746846200 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 +[dumpfile_mtime] "Fri Jan 29 16:20:55 2016" +[dumpfile_size] 224259458 +[savefile] "/home/guepe/openairinterface5g_rrh/openairinterface5g/targets/RT/USER/rrh.gtkw" +[timestart] 31315875900 +[size] 1004 1028 +[pos] 926 -1 +*-17.429794 31316090054 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 [sst_width] 224 -[signals_width] 230 +[signals_width] 261 [sst_expanded] 1 -[sst_vpaned_height] 287 +[sst_vpaned_height] 278 @24 [color] 1 variables.hw_frame_rx[63:0] @@ -23,7 +23,10 @@ variables.hw_subframe_rx[63:0] [color] 1 functions.eNB_rx functions.eNB_rx_sleep -functions.trx_write_rf +[color] 3 +functions.trx_read_rf +[color] 7 +functions.trx_write @c00024 variables.rxcnt[63:0] @28 @@ -95,24 +98,97 @@ variables.rxcnt[63:0] -group_end @24 variables.pck_rx[63:0] +variables.rx_ts[63:0] +@c00024 +variables.tx_seq_num[63:0] +@28 +(0)variables.tx_seq_num[63:0] +(1)variables.tx_seq_num[63:0] +(2)variables.tx_seq_num[63:0] +(3)variables.tx_seq_num[63:0] +(4)variables.tx_seq_num[63:0] +(5)variables.tx_seq_num[63:0] +(6)variables.tx_seq_num[63:0] +(7)variables.tx_seq_num[63:0] +(8)variables.tx_seq_num[63:0] +(9)variables.tx_seq_num[63:0] +(10)variables.tx_seq_num[63:0] +(11)variables.tx_seq_num[63:0] +(12)variables.tx_seq_num[63:0] +(13)variables.tx_seq_num[63:0] +(14)variables.tx_seq_num[63:0] +(15)variables.tx_seq_num[63:0] +(16)variables.tx_seq_num[63:0] +(17)variables.tx_seq_num[63:0] +(18)variables.tx_seq_num[63:0] +(19)variables.tx_seq_num[63:0] +(20)variables.tx_seq_num[63:0] +(21)variables.tx_seq_num[63:0] +(22)variables.tx_seq_num[63:0] +(23)variables.tx_seq_num[63:0] +(24)variables.tx_seq_num[63:0] +(25)variables.tx_seq_num[63:0] +(26)variables.tx_seq_num[63:0] +(27)variables.tx_seq_num[63:0] +(28)variables.tx_seq_num[63:0] +(29)variables.tx_seq_num[63:0] +(30)variables.tx_seq_num[63:0] +(31)variables.tx_seq_num[63:0] +(32)variables.tx_seq_num[63:0] +(33)variables.tx_seq_num[63:0] +(34)variables.tx_seq_num[63:0] +(35)variables.tx_seq_num[63:0] +(36)variables.tx_seq_num[63:0] +(37)variables.tx_seq_num[63:0] +(38)variables.tx_seq_num[63:0] +(39)variables.tx_seq_num[63:0] +(40)variables.tx_seq_num[63:0] +(41)variables.tx_seq_num[63:0] +(42)variables.tx_seq_num[63:0] +(43)variables.tx_seq_num[63:0] +(44)variables.tx_seq_num[63:0] +(45)variables.tx_seq_num[63:0] +(46)variables.tx_seq_num[63:0] +(47)variables.tx_seq_num[63:0] +(48)variables.tx_seq_num[63:0] +(49)variables.tx_seq_num[63:0] +(50)variables.tx_seq_num[63:0] +(51)variables.tx_seq_num[63:0] +(52)variables.tx_seq_num[63:0] +(53)variables.tx_seq_num[63:0] +(54)variables.tx_seq_num[63:0] +(55)variables.tx_seq_num[63:0] +(56)variables.tx_seq_num[63:0] +(57)variables.tx_seq_num[63:0] +(58)variables.tx_seq_num[63:0] +(59)variables.tx_seq_num[63:0] +(60)variables.tx_seq_num[63:0] +(61)variables.tx_seq_num[63:0] +(62)variables.tx_seq_num[63:0] +(63)variables.tx_seq_num[63:0] +@1401200 +-group_end +@24 variables.hw_frame[63:0] variables.hw_subframe[63:0] @28 [color] 1 functions.eNB_tx functions.eNB_tx_sleep -functions.trx_read_rf -[color] 7 -functions.trx_write [color] 7 functions.trx_read +[color] 3 +functions.trx_write_rf @24 variables.txcnt[63:0] -variables.rx_ts[63:0] +variables.pck_tx[63:0] variables.tx_ts[63:0] +@25 +variables.rx_seq_num_prv[63:0] +@24 +variables.rx_seq_num[63:0] variables.hw_cnt_rx[63:0] variables.lhw_cnt_rx[63:0] -@25 [color] 3 variables.cnt[63:0] [pattern_trace] 1 diff --git a/targets/RT/USER/rrh_gw.c b/targets/RT/USER/rrh_gw.c index 89c8679554ef7053b2853dc8b10d4ea01145ded9..8084644b853e0b538968bedba3d40f625824344b 100644 --- a/targets/RT/USER/rrh_gw.c +++ b/targets/RT/USER/rrh_gw.c @@ -51,9 +51,9 @@ #include <time.h> #include "common_lib.h" -#include "rrh_gw.h" // change to rrh_new.h, put externs in rrh_extern.h +#include "rrh_gw.h" #include "rt_wrapper.h" -#include "rrh_gw_externs.h" // change to rrh_new.h, put externs in rrh_extern.h +#include "rrh_gw_externs.h" #include "log_if.h" @@ -71,8 +71,9 @@ *****************************************************************************************/ - -char rrh_ip[20] = "192.168.12.242"; // there is code to detect the my ip address +/* local IP/MAC address is detected*/ +char rrh_ip[20] = "0.0.0.0"; +unsigned char rrh_mac[6] = "0:0:0:0:0:0"; int rrh_port = 50000; // has to be an option /* log */ @@ -86,7 +87,7 @@ int16_t ue_log_level = LOG_INFO; int16_t ue_log_verbosity = LOG_MED; -/* flags definitions */ +/* flag definitions */ uint8_t eNB_flag=0; uint8_t UE_flag=0; uint8_t EXMIMO_flag=0; @@ -102,18 +103,15 @@ uint8_t measurements_flag=0; - default ethernet interface is local */ uint8_t num_eNB_mod=0; uint8_t num_UE_mod=0; -uint8_t num_EXMIMO_mod=0; -uint8_t num_USRP_mod=0; -uint8_t hardware_target=NONE_IF; -char* if_name="lo"; +char* if_name="lo"; +uint8_t eth_mode=ETH_UDP_MODE; rrh_module_t *enb_array; rrh_module_t *ue_array; openair0_vtimestamp hw_counter=0; - - +char rf_config_file[1024]; static void debug_init(void); static void get_options(int argc, char *argv[]); @@ -128,14 +126,14 @@ static void print_help(void); */ static rrh_module_t new_module(unsigned int id); -/*!\fn static int get_ip_address(char* if_name) +/*!\fn static int get_address(char* if_name, uint8_t flag); * \brief retrieves IP address from the specified network interface * \param[in] name of network interface * \return 0 * \note * @ingroup _oai */ -static int get_ip_address(char* if_name); +static int get_address(char* if_name, uint8_t flag); @@ -144,7 +142,7 @@ static int get_ip_address(char* if_name); int main(int argc, char **argv) { unsigned int i; - + rf_config_file[0]='\0'; /* parse input arguments */ get_options(argc, argv); /* initialize logger and signal analyzer */ @@ -192,48 +190,53 @@ static rrh_module_t new_module (unsigned int id) { rrh_mod.measurements=measurements_flag; /* each module is associated with an ethernet device */ - rrh_mod.eth_dev.type=ETH_IF; + rrh_mod.eth_dev.type=NONE_DEV; + rrh_mod.eth_dev.transp_type=NONE_TP; /* ethernet device is functioning within RRH */ - rrh_mod.eth_dev.func_type=RRH_FUNC; - /* specify IP address */ - get_ip_address(if_name); - openair0_cfg.my_ip=&rrh_ip[0]; - openair0_cfg.my_port=rrh_port; + rrh_mod.eth_dev.host_type=RRH_HOST; + /* */ + rrh_mod.eth_dev.openair0_cfg = (openair0_config_t*)malloc(sizeof(openair0_config_t)); + memset(rrh_mod.eth_dev.openair0_cfg,0,sizeof(openair0_config_t)); + /* get IP and MAC address */ + get_address(if_name,eth_mode); + + if(eth_mode==ETH_UDP_MODE) { + openair0_cfg.my_addr = &rrh_ip[0]; + openair0_cfg.my_port = rrh_port; + LOG_I(RRH,"UDP mode selected for ethernet.\n"); + } else if (eth_mode==ETH_RAW_MODE) { + openair0_cfg.my_addr = &rrh_mac[0]; + openair0_cfg.my_port = rrh_port; + LOG_I(RRH,"RAW mode selected for ethernet.\n"); + } + + /* */ + eth_params_t *eth_params = (eth_params_t*)malloc(sizeof(eth_params_t)); + memset(eth_params, 0, sizeof(eth_params_t)); + eth_params->local_if_name = if_name; + eth_params->transp_preference = eth_mode; /* ethernet device initialization */ - if (openair0_dev_init_eth(&rrh_mod.eth_dev, &openair0_cfg)<0){ + if (openair0_transport_load(&rrh_mod.eth_dev, &openair0_cfg,eth_params)<0) { LOG_E(RRH,"Exiting, cannot initialize ethernet interface.\n"); exit(-1); } /* allocate space and specify associated RF device */ openair0_device *oai_dv = (openair0_device *)malloc(sizeof(openair0_device)); - memset(oai_dv,0, sizeof(openair0_device)); + memset(oai_dv,0,sizeof(openair0_device)); -#ifdef EXMIMO rrh_mod.devs=oai_dv; - rrh_mod.devs->type=EXMIMO_IF; - LOG_I(RRH,"Setting RF device to EXMIMO\n"); -#elif OAI_USRP - rrh_mod.devs=oai_dv; - rrh_mod.devs->type=USRP_B200_IF; - LOG_I(RRH,"Setting RF device to USRP\n"); -#elif OAI_BLADERF - rrh_mod.devs=oai_dv; - rrh_mod.devs->type=BLADERF_IF; - LOG_I(RRH,"Setting RF device to BLADERF\n"); -#else - rrh_mod.devs=oai_dv; - rrh_mod.devs->type=NONE_IF; - LOG_I(RRH,"Setting RF interface to NONE_IF... \n"); -#endif - + rrh_mod.devs->type=NONE_DEV; + rrh_mod.devs->transp_type=NONE_TP; + rrh_mod.devs->host_type=RRH_HOST; + return rrh_mod; } static void debug_init(void) { - // log initialization + /* log initialization */ logInit(); set_glog(glog_level, glog_verbosity); @@ -241,7 +244,7 @@ static void debug_init(void) { //set_comp_log(ENB_LOG, enb_log_level, enb_log_verbosity, 1); //set_comp_log(UE_LOG, ue_log_level, ue_log_verbosity, 1); - // vcd initialization + /* vcd initialization */ if (ouput_vcd) { vcd_signal_dumper_init("/tmp/openair_dump_rrh.vcd"); @@ -253,7 +256,7 @@ static void get_options(int argc, char *argv[]) { int opt; - while ((opt = getopt(argc, argv, "xvhlte:n:u:g:r:w:i:")) != -1) { + while ((opt = getopt(argc, argv, "xvhlte:n:u:g:r:m:i:f:")) != -1) { switch (opt) { case 'n': @@ -273,6 +276,9 @@ static void get_options(int argc, char *argv[]) { printf("RRH interface name is set to %s\n", if_name); } break; + case 'm': + eth_mode=atoi(optarg); + break; case 'r': //rrh_log_level=atoi(optarg); break; @@ -292,17 +298,27 @@ static void get_options(int argc, char *argv[]) { /*In loopback mode rrh sends back to bbu what it receives*/ loopback_flag=1; break; + case 'f': + if (optarg){ + if ((strcmp("null", optarg) == 0) || (strcmp("NULL", optarg) == 0)) { + printf("no configuration filename is provided\n"); + } + else if (strlen(optarg)<=1024){ + // rf_config_file = strdup(optarg); + strcpy(rf_config_file,optarg); + }else { + printf("Configuration filename is too long\n"); + exit(-1); + } + } + break; case 't': - /*When measurements are enabled statistics related to TX/RX time are printed*/ + /* When measurements are enabled statistics related to TX/RX time are printed */ measurements_flag=1; - break; - case 'w': - /* force to use this target*/ - hardware_target=1; - break; - case 'h': - print_help(); - exit(-1); + break; + case 'h': + print_help(); + exit(-1); default: /* '?' */ //fprintf(stderr, "Usage: \n", argv[0]); exit(-1); @@ -311,31 +327,34 @@ static void get_options(int argc, char *argv[]) { } -static int get_ip_address(char* if_name) { +static int get_address(char* if_name, uint8_t flag) { int fd; struct ifreq ifr; - - - fd = socket(AF_INET, SOCK_DGRAM, 0); - + + fd = socket(AF_INET, SOCK_DGRAM, 0); /* I want to get an IPv4 IP address */ - ifr.ifr_addr.sa_family = AF_INET; - + ifr.ifr_addr.sa_family = AF_INET; /* I want IP address attached to "if_name" */ strncpy(ifr.ifr_name, if_name, IFNAMSIZ-1); - - if ( ioctl(fd, SIOCGIFADDR, &ifr)<0 ) { - perror("IOCTL:"); - exit(-1); - } + + if (flag==ETH_UDP_MODE) { + if ( ioctl(fd, SIOCGIFADDR, &ifr)<0 ) { + perror("IOCTL:"); + exit(-1); + } + snprintf(&rrh_ip[0],20,"%s", inet_ntoa(((struct sockaddr_in *)&ifr.ifr_addr)->sin_addr)); + LOG_I(RRH,"%s: IP address: %s\n",if_name,rrh_ip); + } else if (flag==ETH_RAW_MODE) { + if ( ioctl(fd, SIOCGIFHWADDR, &ifr)<0 ) { + perror("IOCTL:"); + exit(-1); + } + ether_ntoa_r ((unsigned char *)ifr.ifr_hwaddr.sa_data, rrh_mac); + LOG_I(RRH,"%s: MAC address: %s\n",if_name,rrh_mac); + } close(fd); - - /* display result */ - snprintf(&rrh_ip[0],20,"%s", inet_ntoa(((struct sockaddr_in *)&ifr.ifr_addr)->sin_addr)); - LOG_I(RRH,"Got IP address %s from interface %s\n", rrh_ip,if_name); - return 0; } @@ -343,19 +362,19 @@ static int get_ip_address(char* if_name) { static void print_help(void) { puts("Usage: \n"); - puts(" sudo -E chrt 99 ./rrh -n1 -g6 -v -t"); + puts(" sudo -E chrt 99 ./rrh -n1 -g6 -v -t -i lo -m1"); puts("Options:\n"); puts("\t -n create eNB module\n"); puts("\t -u create UE module\n"); puts("\t -g define global log level\n"); puts("\t -i set the RRH interface (default lo)\n"); + puts("\t -m set ethernet mode to be used by RRH, valid options: (1:raw, 0:udp) \n"); puts("\t -r define rrh log level\n"); puts("\t -e define eNB log level\n"); puts("\t -x enable real time bahaviour\n"); puts("\t -v enable vcd dump\n"); puts("\t -l enable loopback mode\n"); puts("\t -t enable measurements\n"); - puts("\t -w force to use specified HW\n"); puts("\t -h display info\n"); } diff --git a/targets/RT/USER/rrh_gw_externs.h b/targets/RT/USER/rrh_gw_externs.h index 8d2d1d7e5e8484a8bc697efc297d7404e24355a0..df59b9b1af323e4786a1280bc129dd582241318f 100644 --- a/targets/RT/USER/rrh_gw_externs.h +++ b/targets/RT/USER/rrh_gw_externs.h @@ -39,6 +39,7 @@ #ifndef RRH_GW_EXTERNS_H_ #define RRH_GW_EXTERNS_H_ +extern char rf_config_file[1024]; extern openair0_timestamp timestamp_UE_tx[4] ,timestamp_UE_rx[4] ,timestamp_eNB_rx[4],timestamp_eNB_tx[4]; extern openair0_vtimestamp hw_counter; diff --git a/targets/SIMU/USER/init_lte.c b/targets/SIMU/USER/init_lte.c index d798b0968a1d6a36a7dba32c5187c6add11d96b9..bbb99260ebc0842c65783e9a465bbdfc1c1b9ce6 100644 --- a/targets/SIMU/USER/init_lte.c +++ b/targets/SIMU/USER/init_lte.c @@ -76,7 +76,7 @@ PHY_VARS_eNB* init_lte_eNB(LTE_DL_FRAME_PARMS *frame_parms, for (i=0; i<NUMBER_OF_UE_MAX; i++) { for (j=0; j<2; j++) { - PHY_vars_eNB->dlsch_eNB[i][j] = new_eNB_dlsch(1,NUMBER_OF_HARQ_PID_MAX,frame_parms->N_RB_DL,abstraction_flag); + PHY_vars_eNB->dlsch_eNB[i][j] = new_eNB_dlsch(1,NUMBER_OF_HARQ_PID_MAX,NSOFT,frame_parms->N_RB_DL,abstraction_flag); if (!PHY_vars_eNB->dlsch_eNB[i][j]) { LOG_E(PHY,"Can't get eNB dlsch structures for UE %d \n", i); @@ -128,11 +128,11 @@ PHY_VARS_eNB* init_lte_eNB(LTE_DL_FRAME_PARMS *frame_parms, exit(-1); } - PHY_vars_eNB->dlsch_eNB_SI = new_eNB_dlsch(1,1,frame_parms->N_RB_DL, abstraction_flag); + PHY_vars_eNB->dlsch_eNB_SI = new_eNB_dlsch(1,1,NSOFT,frame_parms->N_RB_DL, abstraction_flag); LOG_D(PHY,"eNB %d : SI %p\n",eNB_id,PHY_vars_eNB->dlsch_eNB_SI); - PHY_vars_eNB->dlsch_eNB_ra = new_eNB_dlsch(1,1,frame_parms->N_RB_DL, abstraction_flag); + PHY_vars_eNB->dlsch_eNB_ra = new_eNB_dlsch(1,1,NSOFT,frame_parms->N_RB_DL, abstraction_flag); LOG_D(PHY,"eNB %d : RA %p\n",eNB_id,PHY_vars_eNB->dlsch_eNB_ra); - PHY_vars_eNB->dlsch_eNB_MCH = new_eNB_dlsch(1,NUMBER_OF_HARQ_PID_MAX,frame_parms->N_RB_DL, 0); + PHY_vars_eNB->dlsch_eNB_MCH = new_eNB_dlsch(1,NUMBER_OF_HARQ_PID_MAX,NSOFT,frame_parms->N_RB_DL, 0); LOG_D(PHY,"eNB %d : MCH %p\n",eNB_id,PHY_vars_eNB->dlsch_eNB_MCH); @@ -169,7 +169,7 @@ PHY_VARS_UE* init_lte_UE(LTE_DL_FRAME_PARMS *frame_parms, for (i=0; i<NUMBER_OF_CONNECTED_eNB_MAX; i++) { for (j=0; j<2; j++) { - PHY_vars_UE->dlsch_ue[i][j] = new_ue_dlsch(1,NUMBER_OF_HARQ_PID_MAX,MAX_TURBO_ITERATIONS,frame_parms->N_RB_DL, abstraction_flag); + PHY_vars_UE->dlsch_ue[i][j] = new_ue_dlsch(1,NUMBER_OF_HARQ_PID_MAX,NSOFT,MAX_TURBO_ITERATIONS,frame_parms->N_RB_DL, abstraction_flag); if (!PHY_vars_UE->dlsch_ue[i][j]) { LOG_E(PHY,"Can't get ue dlsch structures\n"); @@ -187,15 +187,15 @@ PHY_VARS_UE* init_lte_UE(LTE_DL_FRAME_PARMS *frame_parms, exit(-1); } - PHY_vars_UE->dlsch_ue_SI[i] = new_ue_dlsch(1,1,MAX_TURBO_ITERATIONS,frame_parms->N_RB_DL, abstraction_flag); - PHY_vars_UE->dlsch_ue_ra[i] = new_ue_dlsch(1,1,MAX_TURBO_ITERATIONS,frame_parms->N_RB_DL, abstraction_flag); + PHY_vars_UE->dlsch_ue_SI[i] = new_ue_dlsch(1,1,NSOFT,MAX_TURBO_ITERATIONS,frame_parms->N_RB_DL, abstraction_flag); + PHY_vars_UE->dlsch_ue_ra[i] = new_ue_dlsch(1,1,NSOFT,MAX_TURBO_ITERATIONS,frame_parms->N_RB_DL, abstraction_flag); PHY_vars_UE->transmission_mode[i] = transmission_mode; } PHY_vars_UE->lte_frame_parms.pucch_config_common.deltaPUCCH_Shift = 1; - PHY_vars_UE->dlsch_ue_MCH[0] = new_ue_dlsch(1,NUMBER_OF_HARQ_PID_MAX,MAX_TURBO_ITERATIONS_MBSFN,frame_parms->N_RB_DL,0); + PHY_vars_UE->dlsch_ue_MCH[0] = new_ue_dlsch(1,NUMBER_OF_HARQ_PID_MAX,NSOFT,MAX_TURBO_ITERATIONS_MBSFN,frame_parms->N_RB_DL,0); return (PHY_vars_UE); } @@ -211,11 +211,11 @@ PHY_VARS_RN* init_lte_RN(LTE_DL_FRAME_PARMS *frame_parms, if (eMBMS_active_state == multicast_relay) { for (i=0; i < 10 ; i++) { // num SF in a frame - PHY_vars_RN->dlsch_rn_MCH[i] = new_ue_dlsch(1,1,MAX_TURBO_ITERATIONS_MBSFN,frame_parms->N_RB_DL, 0); + PHY_vars_RN->dlsch_rn_MCH[i] = new_ue_dlsch(1,1,MAX_TURBO_ITERATIONS_MBSFN,NSOFT,frame_parms->N_RB_DL, 0); LOG_D(PHY,"eNB %d : MCH[%d] %p\n",RN_id,i,PHY_vars_RN->dlsch_rn_MCH[i]); } } else { - PHY_vars_RN->dlsch_rn_MCH[0] = new_ue_dlsch(1,1,MAX_TURBO_ITERATIONS,frame_parms->N_RB_DL, 0); + PHY_vars_RN->dlsch_rn_MCH[0] = new_ue_dlsch(1,1,MAX_TURBO_ITERATIONS,NSOFT,frame_parms->N_RB_DL, 0); LOG_D(PHY,"eNB %d : MCH[0] %p\n",RN_id,PHY_vars_RN->dlsch_rn_MCH[0]); }