diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8947453454a22f324339aaf991d02bbc9fcc6965..d35de04b122bf77f1de6155557309cdba92413ff 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -7,6 +7,7 @@ job1: - echo $NFS_SHARE_DIR - echo $EXTERNAL_SHARE_DIR - echo $SHELL + - echo $OAI_TEST_CASE_GROUP - git rev-parse --abbrev-ref HEAD - git_repo=`git config --get remote.origin.url` - git_head=`git rev-parse HEAD` @@ -31,3 +32,8 @@ job1: - 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 + - exce_log=`egrep -i 'warning|error|critical|exception' $NFS_TEST_RESULTS_DIR/log/python_autotest.log ` + - if [ -n "$exce_log" ]; then echo -e "\e[31mThere are errors in $NFS_TEST_RESULTS_DIR/log/python_autotest.log. Please check the logs\e[0m" ; fi + - exce_log=`egrep -i 'warning|error|critical|exception' $NFS_TEST_RESULTS_DIR/log/python_autotest_cleanup.log ` + - if [ -n "$exce_log" ]; then echo -e "\e[31mThere are errors in $NFS_TEST_RESULTS_DIR/log/python_autotest_cleanup.log. Please check the logs\e[0m" ; fi + diff --git a/README.txt b/README.txt index 2ff2e02190d5b2c628e793e5d2f0e7b19eedd4de..b549f8122f80144d30eabb07a10fbbbf18a6bc0f 100644 --- a/README.txt +++ b/README.txt @@ -1,19 +1,27 @@ -OpenAirInterface is under GNU GPLv3 license. The full GNU General Public License is included in this distribution in the file called "COPYING". - -The OpenAirInterface (OAI) software is composed of six different parts: - -openair1: 3GPP LTE Rel-8 PHY layer + PHY RF simulation - -openair2: 3GPP LTE Rel-9 RLC/MAC/PDCP/RRC implementations, eNB application, X2AP. Note that for RLC, the following versions are userL UM_v9.3.0, TM_v9.3.0, and AM_v9.3.0. For PDCP, PDCP_v10.1.0 is used. For RRC, only LITE is used. - -openair3: 3GPP LTE Rel9 and 10 MME/NAS, S+P-GW, HSS, S1AP (ENB and MME). - -common: some common OAI utilities, other tools can be found at openair2/UTILS - -targets: scripts to compile and lauch different system targets (simulation, emulation and real-time platforms, user-space tools for these platforms (tbd)) - -see README files in these subdirectories for more information - -see also https://twiki.eurecom.fr/twiki/bin/view/OpenAirInterface/WebHome - - +OpenAirInterface is under OpenAirInterface Software Alliance license. +├── http://www.openairinterface.org/?page_id=101 +├── http://www.openairinterface.org/?page_id=698 + +The OpenAirInterface (OAI) software is composed of the following parts: + +openairinterface5g +├── cmake_targets: build utilities to compile (simulation, emulation and real-time platforms), and generated build files +├── common : some common OAI utilities, other tools can be found at openair2/UTILS +├── COPYING +├── maketags : script to generate emacs tags +├── openair1 : 3GPP LTE Rel-10 PHY layer + PHY RF simulation and a subset of Rel 12 Features. +├── openair2 :3GPP LTE Rel-10 RLC/MAC/PDCP/RRC/X2AP implementation. + ├── LAYER2/RLC/ with the following subdirectories: UM_v9.3.0, TM_v9.3.0, and AM_v9.3.0. + ├── LAYER2/PDCP/PDCP_v10.1.0. + ├── RRC/LITE + ├── PHY_INTERFACE + ├── X2AP + ├── ENB_APP +├── openair3: 3GPP LTE Rel10 for S1AP, NAS GTPV1-U for both ENB and UE. + ├── GTPV1-U + ├── NAS + ├── S1AP + ├── SCTP + ├── SECU + ├── UDP +└── targets: top level wrapper for unitary simulation for PHY channels, system-level emulation (eNB-UE with and without S1), and realtime eNB and UE and RRH GW. diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index 0b2a9c0b93ccf72b2730054ced0afb057d459f62..c23b0d1a91471d406910790e3c54dddb42dbc9d3 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -238,6 +238,7 @@ add_boolean_option(TEST_OMG False "???") add_boolean_option(DEBUG_OMG False "???") add_boolean_option(XFORMS False "This adds the possibility to see the signal oscilloscope") add_boolean_option(PRINT_STATS False "This adds the possibility to see the status") +add_boolean_option(T_TRACER False "Activate the T tracer, a debugging/monitoring framework" ) add_boolean_option(DEBUG_CONSOLE False "makes debugging easier, disables stdout/stderr buffering") @@ -260,7 +261,8 @@ endif (${ENABLE_ITTI}) add_boolean_option(RTAI False "Use RTAI") if (${RTAI}) - set(LOWLATENCY False) + set(DEADLINE_SCHEDULER False) + set(CPU_AFFINITY False) add_definitions("-DENABLE_RTAI_CLOCK") add_definitions("-DCONFIG_RTAI_LXRT_INLINE") include_directories ("/usr/realtime/include") @@ -564,7 +566,6 @@ elseif (${RF_BOARD} STREQUAL "OAI_BLADERF") LINK_DIRECTORIES("/usr/lib/x86_64-linux-gnu") set(option_HW_lib "bladeRF -rdynamic -ldl") - #set(LOWLATENCY False) elseif (${RF_BOARD} STREQUAL "OAI_LMSSDR") include_directories("${OPENAIR_TARGETS}/ARCH/LMSSDR/USERSPACE/LIB") @@ -577,7 +578,6 @@ elseif (${RF_BOARD} STREQUAL "OAI_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") @@ -606,7 +606,8 @@ endif (${TRANSP_PRO} STREQUAL "ETHERNET") include_directories ("${OPENAIR_TARGETS}/ARCH/COMMON") -Message("LOWLATENCY flag is ${LOWLATENCY}") +Message("DEADLINE_SCHEDULER flag is ${DEADLINE_SCHEDULER}") +Message("CPU_Affinity flag is ${CPU_AFFINITY}") ############################################################## # ???!!! TO BE DOCUMENTED OPTIONS !!!??? @@ -619,7 +620,8 @@ add_boolean_option(RRC_DEFAULT_RAB_IS_AM False "set the RLC mode to AM for the d add_boolean_option(OAI_NW_DRIVER_TYPE_ETHERNET False "????") add_boolean_option(DISABLE_USE_NAS False "???") -add_boolean_option(LOWLATENCY True "Use the Linux scheduler SCHED_DEADLINE: kernel >= 3.14") +add_boolean_option(DEADLINE_SCHEDULER True "Use the Linux scheduler SCHED_DEADLINE: kernel >= 3.14") +add_boolean_option(CPU_AFFINITY False "Enable CPU Affinity of threads (only valid without deadline scheduler). It is enabled only with >2 CPUs") add_boolean_option(NAS_ADDRESS_FIX False "specific to oaisim: for nasmesh driver") add_boolean_option(NAS_NETLINK False "???? Must be True to compile nasmesh driver without rtai") add_boolean_option(OAISIM False "specific to oaisim") @@ -996,6 +998,7 @@ set(PHY_SRC ${OPENAIR1_DIR}/PHY/CODING/crc_byte.c ${OPENAIR1_DIR}/PHY/CODING/3gpplte_turbo_decoder_sse_8bit.c ${OPENAIR1_DIR}/PHY/CODING/3gpplte_turbo_decoder_sse_16bit.c + ${OPENAIR1_DIR}/PHY/CODING/3gpplte_turbo_decoder_avx2_16bit.c ${OPENAIR1_DIR}/PHY/CODING/lte_rate_matching.c ${OPENAIR1_DIR}/PHY/CODING/rate_matching.c ${OPENAIR1_DIR}/PHY/CODING/viterbi.c @@ -1098,8 +1101,8 @@ set (ENB_APP_SRC add_library(L2 ${L2_SRC} ${MAC_SRC} - ${ENB_APP_SRC} - ${OPENAIR2_DIR}/RRC/L2_INTERFACE/openair_rrc_L2_interface.c) + ${ENB_APP_SRC}) +# ${OPENAIR2_DIR}/RRC/L2_INTERFACE/openair_rrc_L2_interface.c) # L3 Libs ########################## @@ -1557,6 +1560,36 @@ endif (${XFORMS}) set(CMAKE_MODULE_PATH "${OPENAIR_DIR}/cmake_targets/tools/MODULES" "${CMAKE_MODULE_PATH}") +#include T directory even if the T is off because T macros are in the code +#no matter what +include_directories("${OPENAIR_DIR}/common/utils/T") + +if (${T_TRACER}) + set(T_SOURCE + ${OPENAIR_DIR}/common/utils/T/T.c + ${OPENAIR_DIR}/common/utils/T/local_tracer.c) + set (T_LIB "rt") +endif (${T_TRACER}) + +#Some files in the T directory are generated. +#This rule and the following deal with it. +add_custom_command ( + OUTPUT ${OPENAIR_DIR}/common/utils/T/T_IDs.h + COMMAND make + WORKING_DIRECTORY ${OPENAIR_DIR}/common/utils/T + DEPENDS ${OPENAIR_DIR}/common/utils/T/T_messages.txt + ) + +#This rule is specifically needed to generate T files +#before anything else in a project that uses the T. +#See below, there are some 'add_dependencies' showing that. +#Basically we create a custom target and we make other +#targets depend on it. That forces cmake to generate +#T files before anything else. +add_custom_target ( + generate_T + DEPENDS ${OPENAIR_DIR}/common/utils/T/T_IDs.h +) # Hack on a test of asn1c version (already dirty) add_definitions(-DASN1_MINIMUM_VERSION=924) @@ -1589,6 +1622,7 @@ add_executable(lte-softmodem ${RTAI_SOURCE} ${XFORMS_SOURCE} ${XFORMS_SOURCE_SOFTMODEM} + ${T_SOURCE} ) target_link_libraries (lte-softmodem @@ -1601,6 +1635,7 @@ 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} ${option_TP_lib} ${XFORMS_LIBRARIES} ) target_link_libraries (lte-softmodem ${LIBBOOST_LIBRARIES}) target_link_libraries (lte-softmodem ${LIB_LMS_LIBRARIES}) +target_link_libraries (lte-softmodem ${T_LIB}) # lte-softmodem-nos1 is both eNB and UE implementation ################################################### @@ -1625,6 +1660,7 @@ add_executable(lte-softmodem-nos1 ${RTAI_SOURCE} ${XFORMS_SOURCE} ${XFORMS_SOURCE_SOFTMODEM} + ${T_SOURCE} ) target_link_libraries (lte-softmodem-nos1 -Wl,--start-group @@ -1635,6 +1671,7 @@ 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} ${option_TP_lib} ${XFORMS_LIBRARIES} ) target_link_libraries (lte-softmodem-nos1 ${LIBBOOST_LIBRARIES}) target_link_libraries (lte-softmodem-nos1 ${LIB_LMS_LIBRARIES}) +target_link_libraries (lte-softmodem ${T_LIB}) # rrh ################################ @@ -1647,6 +1684,7 @@ add_executable(rrh_gw ${OPENAIR_TARGETS}/ARCH/COMMON/common_lib.c ${HW_SOURCE} ${TRANSPORT_SOURCE} + ${T_SOURCE} ) target_include_directories(rrh_gw PRIVATE ${OPENAIR_DIR}/common/utils/itti) target_link_libraries(rrh_gw @@ -1656,6 +1694,7 @@ target_link_libraries(rrh_gw target_link_libraries (rrh_gw rt pthread m ) target_link_libraries (rrh_gw ${option_HW_lib} ${option_TP_lib} ${LIBBOOST_LIBRARIES} ) target_link_libraries (rrh_gw ${LIB_LMS_LIBRARIES}) +target_link_libraries (rrh_gw ${T_LIB}) Message("-- option_HW_lib=${option_HW_lib}") Message("-- HW_SOURCE=${HW_SOURCE}") @@ -1721,6 +1760,7 @@ add_executable(oaisim ${HW_SOURCE} ${TRANSPORT_SOURCE} ${XFORMS_SOURCE} + ${T_SOURCE} ) @@ -1735,6 +1775,7 @@ target_link_libraries (oaisim pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LI ${ATLAS_LIBRARIES} ${XFORMS_LIBRARIES} ${OPENPGM_LIBRARIES}) #Force link with forms, regardless XFORMS option target_link_libraries (oaisim forms) +target_link_libraries (oaisim ${T_LIB}) @@ -1760,6 +1801,7 @@ add_executable(oaisim_nos1 ${HW_SOURCE} ${TRANSPORT_SOURCE} ${XFORMS_SOURCE} + ${T_SOURCE} ) target_include_directories(oaisim_nos1 PUBLIC ${OPENAIR_TARGETS}/SIMU/USER) target_link_libraries (oaisim_nos1 @@ -1772,7 +1814,7 @@ target_link_libraries (oaisim_nos1 pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYP ${ATLAS_LIBRARIES} ${XFORMS_LIBRARIES} ${OPENPGM_LIBRARIES}) #Force link with forms, regardless XFORMS option target_link_libraries (oaisim_nos1 forms) - +target_link_libraries (oaisim_nos1 ${T_LIB}) # Unitary tests for each piece of L1: example, mbmssim is MBMS L1 simulator ##################################### @@ -1782,10 +1824,11 @@ foreach(myExe dlsim ulsim pbchsim scansim mbmssim pdcchsim pucchsim prachsim syn ${OPENAIR_BIN_DIR}/messages_xml.h ${OPENAIR1_DIR}/SIMULATION/LTE_PHY/${myExe}.c ${XFORMS_SOURCE} + ${T_SOURCE} ) target_link_libraries (${myExe} -Wl,--start-group SIMU UTIL SCHED_LIB PHY LFDS ${ITTI_LIB} -Wl,--end-group - pthread m rt ${CONFIG_LIBRARIES} ${ATLAS_LIBRARIES} ${XFORMS_LIBRARIES} + pthread m rt ${CONFIG_LIBRARIES} ${ATLAS_LIBRARIES} ${XFORMS_LIBRARIES} ${T_LIB} ) endforeach(myExe) @@ -1850,8 +1893,23 @@ endforeach(myExe) #../targets/TEST/PDCP/test_pdcp.c #../targets/TEST/PDCP/with_rlc/test_pdcp_rlc.c - - +#ensure that the T header files are generated before targets depending on them +if (${T_TRACER}) + add_dependencies(lte-softmodem generate_T) + add_dependencies(lte-softmodem-nos1 generate_T) + add_dependencies(rrh_gw generate_T) + add_dependencies(oaisim generate_T) + add_dependencies(oaisim_nos1 generate_T) + add_dependencies(dlsim generate_T) + add_dependencies(ulsim generate_T) + add_dependencies(pbchsim generate_T) + add_dependencies(scansim generate_T) + add_dependencies(mbmssim generate_T) + add_dependencies(pdcchsim generate_T) + add_dependencies(pucchsim generate_T) + add_dependencies(prachsim generate_T) + add_dependencies(syncsim generate_T) +endif (${T_TRACER}) ################################################## # Generated specific cases is not regular code @@ -2013,38 +2071,4 @@ endforeach(file) ADD_CUSTOM_TARGET(oarf DEPENDS ${OCT_FILES} ) - -#CMAKE INSTALL and CPACK - -#INSTALL(PROGRAMS lte-softmodem ${OPENAIR_DIR}/targets DESTINATION bin) -#INSTALL(PROGRAMS oaisim ${OPENAIR_DIR}/targets DESTINATION bin) - - -#SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "OpenAirInterface") -#SET(CPACK_PACKAGE_VENDOR "Eurecom") -#SET(CPACK_PACKAGE_DESCRIPTION_FILE "${OPENAIR_DIR}/README.txt") -#SET(CPACK_RESOURCE_FILE_LICENSE "${OPENAIR_DIR}/COPYING") -#SET(CPACK_PACKAGE_VERSION_MAJOR "1") -#SET(CPACK_PACKAGE_VERSION_MINOR "1") -#SET(CPACK_PACKAGE_VERSION_PATCH "1") - -#SET(CPACK_PACKAGE_INSTALL_DIRECTORY "CMake ${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}") -#SET(CPACK_STRIP_FILES "${OPENAIR_TARGETS}/bin") -#SET(CPACK_SOURCE_STRIP_FILES "") - -##debian specific -#SET(CPACK_DEBIAN_PACKAGE_NAME "OAI") -#SET(CPACK_DEBIAN_PACKAGE_VERSION "${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}") -##dpkg --print-architecture (do not use i686 -#SET(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "amd64") - -#SET(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6 (>= 2.3.1-6), libgcc1 (>= 1:3.4.2-12)") -#SET(CPACK_DEBIAN_PACKAGE_DEPENDS "libpthread.so.0 libm.so.6 libconfig.so.9 librt.so.1 libcrypt.so.1 libcrypto.so.1.0.0 libnettle.so.4 libsctp.so.1 libc.so.6") -#SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "EURECOM-OSA") - -#SET(CPACK_PACKAGE_EXECUTABLES "lte-softmodem" "mme_gw.Rel10" "openair-hss") - -#SET(CPACK_DEBIAN_PACKAGE_DESCRIPTION "OpenAirInterface") -#SET(CPACK_DEBIAN_PACKAGE_Section "Beta-Release") -#INCLUDE(CPack) diff --git a/cmake_targets/autotests/run_exec_lte-softmodem_tests.py b/cmake_targets/autotests/run_exec_lte-softmodem_tests.py index f1c165acbfe7537518b0f9c969b57d9c1eaaa38b..77c3006fea9a54a16dab673d8bfa4fde9c365fe9 100755 --- a/cmake_targets/autotests/run_exec_lte-softmodem_tests.py +++ b/cmake_targets/autotests/run_exec_lte-softmodem_tests.py @@ -29,10 +29,7 @@ # *******************************************************************************/ -# \file test01.py -# \brief test 01 for OAI -# \author Navid Nikaein -# \date 2013 - 2015 +# \author Rohit Gupta # \version 0.1 # @ingroup _test @@ -316,18 +313,24 @@ def SSHSessionWrapper(machine, username, key_file, password, logdir_remote, logd # \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 + cmd = 'killall -9 -q -r ' + programList result = oai.send(cmd, True) print "Killing old programs..." + result programArray = programList.split() programListJoin = '|'.join(programArray) + cmd = " ( date ;echo \"Starting cleaning old programs.. \" ; dmesg|tail ; echo \"Current disk space.. \" ; df -h )>& $HOME/.oai_test_setup_cleanup.log.`hostname` 2>&1 ; sync" + result=oai.send_recv(cmd) cmd = cleanupOldProgramsScript + ' ' + '\''+programListJoin+'\'' #result = oai.send_recv(cmd) #print result result = oai.send_expect_false(cmd, 'Match found', False) print "Looking for old programs..." + result res=oai.send_recv(CleanUpAluLteBox, True) - res = oai.send_recv(ExmimoRfStop, False) + cmd = "( " + ExmimoRfStop + " ) >> $HOME/.oai_test_setup_cleanup.log.`hostname` ; sync " + res=oai.send_recv(cmd, False, timeout=600) + #res = oai.send_recv(ExmimoRfStop, False) + cmd = " ( date ;echo \"Finished cleaning old programs.. \" ; dmesg | tail)>> $HOME/.oai_test_setup_cleanup.log.`hostname` 2>&1 ; sync" + res=oai.send_recv(cmd) # \brief Class thread to launch a generic command on remote machine # \param threadID number of thread (for book keeping) @@ -1514,6 +1517,22 @@ for testcase in testcaseList: threadListGlobal = wait_testcaseclass_generic_threads(threadListGlobal, Timeout_execution) #cleanOldProgramsAllMachines(oai_list, CleanUpOldProgs, CleanUpAluLteBox, ExmimoRfStop) handle_testcaseclass_softmodem (testcase, CleanUpOldProgs, logdirOAI5GRepo, logdirOpenaircnRepo, MachineList, user, pw, CleanUpAluLteBox, ExmimoRfStop, nruns_lte_softmodem, Timeout_cmd ) + + #The lines below are copied from below to trace the failure of some of the machines in test setup. These lines below need to be removed in long term + 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) + os.system('sync') + print "Now copying files to NFS Share" + oai_localhost = openair('localdomain','localhost') + oai_localhost.connect(user,pw) + cmd = ' mkdir -p ' + NFSTestsResultsDir + res = oai_localhost.send_recv(cmd) + + print "Copying files from GilabCI Runner Machine : " + host + " .locallogdir = " + locallogdir + ", NFSTestsResultsDir = " + NFSTestsResultsDir + SSHSessionWrapper('localhost', user, None, pw , NFSTestsResultsDir , locallogdir, "put_all") + oai_localhost.disconnect() + elif (testcaseclass == 'compilation'): threadListGlobal = handle_testcaseclass_generic (testcasename, threadListGlobal, CleanUpOldProgs, logdirOAI5GRepo, MachineListGeneric, user, pw, CleanUpAluLteBox,Timeout_execution, ExmimoRfStop) elif (testcaseclass == 'execution'): @@ -1545,11 +1564,15 @@ 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 +cmd = 'mkdir -p ' + NFSTestsResultsDir res = oai_localhost.send_recv(cmd) -print "Deleting NFSTestResults Dir..." + res print "Copying files from GilabCI Runner Machine : " + host + " .locallogdir = " + locallogdir + ", NFSTestsResultsDir = " + NFSTestsResultsDir SSHSessionWrapper('localhost', user, None, pw , NFSTestsResultsDir , locallogdir, "put_all") +cmd = "cat " + NFSTestsResultsDir + "/log/*/*.xml > " + NFSTestsResultsDir + "/log/results_autotests.xml" +res = oai_localhost.send_recv(cmd) + +oai_localhost.disconnect() + sys.exit() diff --git a/cmake_targets/autotests/test_case_list.xml b/cmake_targets/autotests/test_case_list.xml index 4aaf84e2b9fbc2fa7db5c786f8138a2d9e4e4cd8..0104e912f969a2978a1e8a7aa9f13fc4a74ad381 100644 --- a/cmake_targets/autotests/test_case_list.xml +++ b/cmake_targets/autotests/test_case_list.xml @@ -6,11 +6,11 @@ <GitOpenair-cnRepo>https://gitlab.eurecom.fr/oai/openair-cn.git</GitOpenair-cnRepo> <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* wvdial* iperf iperf_script ping tshark rrh_gw</CleanUpOldProgs> + <CleanUpOldProgs>oaisim oaisim_nos1 lte-softmodem lte-softmodem-nos1 mme_gw run_epc auth_request run_hss oai_hss mme spgw hss hss_sim configure_cots* wvdial iperf iperf_script iperf_script_phone ping tshark rrh_gw iperf3 iperf3_script iperf3_script_phone</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; sudo -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_huaweiE398_ue.py --stop-ue; sudo -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue; sudo -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --stop-ue; uname -a; sudo -E dmesg|tail</ExmimoRfStop> +<ExmimoRfStop>$OPENAIR_DIR/cmake_targets/build_oai -w EXMIMO -c; sudo -S -E $OPENAIR_DIR/cmake_targets/tools/stop_exmimo2; sudo -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; sudo -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_huaweiE398_ue.py --reset-ue; sudo -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --stop-ue; uname -a; sudo -E dmesg</ExmimoRfStop> <Timeout_execution>36000</Timeout_execution> - <TestCaseExclusionList>0102+ 010304 010305 0104+ 015502 015505 015506 015507 015508 015509 015510 015511 015602 015605 015702 015705 015802 015805 016102 016105 016502 016505 0170+ 017502 017505 018002 018005 018502 018505 025502 025505</TestCaseExclusionList> + <TestCaseExclusionList>010141 0102+ 010304 010305 0104+ 015502 015505 015506 015507 015508 015509 015510 015511 015602 015605 015702 015705 015802 015805 016102 016105 016502 016505 017002 017005 017502 017505 018002 018005 018502 018505 025502 025505</TestCaseExclusionList> <nruns_lte-softmodem>3</nruns_lte-softmodem> <MachineListGeneric>mozart calisson stevens nano amerique</MachineListGeneric> <testCase id="010101" > @@ -879,29 +879,29 @@ <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.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_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf N_RB_DL 25 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.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.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tx_gain 90 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf rx_gain 125 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.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>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</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_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.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> @@ -916,7 +916,7 @@ <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>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 7Mbits/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> @@ -936,7 +936,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>$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>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m </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> @@ -954,29 +954,29 @@ <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.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_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf N_RB_DL 50 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.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.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tx_gain 90 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf rx_gain 125 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.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>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</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_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.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> @@ -991,7 +991,7 @@ <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>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 14Mbits/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> @@ -1011,7 +1011,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>$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>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m </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> @@ -1028,29 +1028,29 @@ <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.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_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf N_RB_DL 100 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.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.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tx_gain 90 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf rx_gain 125 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.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>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</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_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.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> @@ -1085,7 +1085,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>$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>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m </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> @@ -1102,29 +1102,29 @@ <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.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_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf N_RB_DL 25 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.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.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tx_gain 90 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf rx_gain 125 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.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>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</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_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.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> @@ -1139,7 +1139,7 @@ <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>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf3_script 1 ppp0 -c 192.172.0.1 -i 1 -u -f m -B 192.172.0.2 -b 10M -R</UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> <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> @@ -1159,7 +1159,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>$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>$OPENAIRCN_DIR/TEST/autotests/tools/iperf3_script 5 lo -s -i 1 -f m </EPC_traffic_exec> <EPC_traffic_exec_args></EPC_traffic_exec_args> <EPC_search_expr_false></EPC_search_expr_false> <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs> @@ -1175,29 +1175,29 @@ <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.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_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf N_RB_DL 50 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.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.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tx_gain 90 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf rx_gain 125 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.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>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</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_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.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> @@ -1211,7 +1211,7 @@ <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>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf3_script 1 ppp0 -c 192.172.0.1 -i 1 -u -f m -B 192.172.0.2 -b 30M -R</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 </UE_search_expr_true> <UE_search_expr_false></UE_search_expr_false> @@ -1232,7 +1232,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>$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>$OPENAIRCN_DIR/TEST/autotests/tools/iperf3_script 5 lo -s -i 1 -f m </EPC_traffic_exec> <EPC_traffic_exec_args></EPC_traffic_exec_args> <EPC_search_expr_false></EPC_search_expr_false> <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs> @@ -1248,29 +1248,29 @@ <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.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_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf N_RB_DL 100 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.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.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tx_gain 90 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf rx_gain 125 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.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>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</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_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.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> @@ -1306,7 +1306,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>$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>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s </EPC_traffic_exec> <EPC_traffic_exec_args></EPC_traffic_exec_args> <EPC_search_expr_false></EPC_search_expr_false> <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs> @@ -1323,29 +1323,29 @@ <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.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 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 \"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_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf N_RB_DL 25 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.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.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tx_gain 90 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf rx_gain 125 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_rx 2 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_tx 2 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.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>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</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_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.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> @@ -1380,7 +1380,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>$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>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m </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> @@ -1398,29 +1398,29 @@ <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.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 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 \"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_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf N_RB_DL 50 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.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.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tx_gain 90 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf rx_gain 125 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_rx 2 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_tx 2 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.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>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</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_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.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> @@ -1454,7 +1454,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>$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>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m </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 </EPC_search_expr_true> <EPC_search_expr_false></EPC_search_expr_false> @@ -1471,29 +1471,29 @@ <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.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 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 \"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_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf N_RB_DL 100 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.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.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tx_gain 90 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf rx_gain 125 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_rx 2 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_tx 2 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.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>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</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_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.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> @@ -1528,7 +1528,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>$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>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m</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 </EPC_search_expr_true> <EPC_search_expr_false></EPC_search_expr_false> @@ -1545,29 +1545,29 @@ <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.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 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 \"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_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf N_RB_DL 25 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.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.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tx_gain 90 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf rx_gain 125 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_rx 2 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_tx 2 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.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>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</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_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.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> @@ -1603,7 +1603,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>$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>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s</EPC_traffic_exec> <EPC_traffic_exec_args></EPC_traffic_exec_args> <EPC_search_expr_false></EPC_search_expr_false> <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs> @@ -1619,29 +1619,29 @@ <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.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 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 \"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_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf N_RB_DL 50 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.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.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tx_gain 90 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf rx_gain 125 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_rx 2 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_tx 2 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.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>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</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_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.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> @@ -1677,7 +1677,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>$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>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s </EPC_traffic_exec> <EPC_traffic_exec_args></EPC_traffic_exec_args> <EPC_search_expr_false></EPC_search_expr_false> <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs> @@ -1693,29 +1693,29 @@ <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.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 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 \"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_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf N_RB_DL 100 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.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.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tx_gain 90 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf rx_gain 125 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_rx 2 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_tx 2 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.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>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</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_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.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> @@ -1751,7 +1751,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>$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>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s </EPC_traffic_exec> <EPC_traffic_exec_args></EPC_traffic_exec_args> <EPC_search_expr_false></EPC_search_expr_false> <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs> @@ -1806,12 +1806,12 @@ <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>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 7Mbits/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> + <UE_stop_script>sudo -S -E $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\" @@ -1835,7 +1835,7 @@ <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>$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>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m </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> @@ -1890,12 +1890,12 @@ <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>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 14Mbits/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> + <UE_stop_script>sudo -S -E $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\" @@ -1919,7 +1919,7 @@ <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>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m </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> @@ -1979,7 +1979,7 @@ <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> + <UE_stop_script>sudo -S -E $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\" @@ -2003,7 +2003,7 @@ <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>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m </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> @@ -2063,7 +2063,7 @@ <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> + <UE_stop_script>sudo -S -E $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\" @@ -2087,7 +2087,7 @@ <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>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s </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> @@ -2147,7 +2147,7 @@ <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> + <UE_stop_script>sudo -S -E $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\" @@ -2171,7 +2171,7 @@ <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>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s </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> @@ -2231,7 +2231,7 @@ <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> + <UE_stop_script>sudo -S -E $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\" @@ -2255,7 +2255,7 @@ <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>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s </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> @@ -2272,30 +2272,30 @@ <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_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf N_RB_DL 25 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf pdsch_referenceSignalPower -26 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.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.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tx_gain 90 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf rx_gain 125 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.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; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash; 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>sleep 15; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash; ifconfig ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.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_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.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> @@ -2310,37 +2310,46 @@ <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>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 7Mbits/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> + <UE_stop_script>sudo -S -E $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_config_file>ETC/hss.conf MYSQL_user \"root\" + ETC/hss.conf MYSQL_pass \"linux\" + ETC/mme.conf GUMMEI_LIST "{MCC=\"208\";MNC=\"92\";MME_GID=\"4\";MME_CODE=\"1\";}" + ETC/mme.conf TAI_LIST "{MCC=\"208\";MNC=\"92\";TAC=\"1\";}" + ETC/mme.conf MME_INTERFACE_NAME_FOR_S1_MME \"eth0\" + ETC/mme.conf MME_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.62/24\" + ETC/mme.conf MME_INTERFACE_NAME_FOR_S11_MME \"lo\" + ETC/mme.conf MME_IPV4_ADDRESS_FOR_S11_MME \"127.0.11.1/8\" + ETC/mme.conf MME_PORT_FOR_S11_MME 2123 + ETC/mme.conf SGW_IPV4_ADDRESS_FOR_S11 \"127.0.11.2/8\" + ETC/mme.conf OUTPUT \"CONSOLE\" + ETC/mme.conf HSS_HOSTNAME \"hss\" + ETC/mme_fd.conf Identity \"nano.openair4G.eur\" + ETC/hss_fd.conf Identity \"hss.openair4G.eur\" + ETC/spgw.conf SGW_INTERFACE_NAME_FOR_S11 \"lo\" + ETC/spgw.conf SGW_IPV4_ADDRESS_FOR_S11 \"127.0.11.2/8\" + ETC/spgw.conf SGW_IPV4_ADDRESS_FOR_S1U_S12_S4_UP \"192.168.12.62/24\" + ETC/spgw.conf SGW_IPV4_PORT_FOR_S1U_S12_S4_UP 2152 + ETC/spgw.conf PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.62/24\" + ETC/spgw.conf IPV4_LIST \"192.172.0.0/24\",\"192.172.1.0/24\" </EPC_config_file> + <EPC_compile_prog>sudo mkdir -p /usr/local/etc/oai/freeDiameter; sudo cp -vf $OPENAIRCN_DIR/ETC/mme.conf /usr/local/etc/oai/ ; sudo cp -vf $OPENAIRCN_DIR/ETC/mme_fd.conf /usr/local/etc/oai/freeDiameter; sudo cp $OPENAIRCN_DIR/ETC/spgw.conf /usr/local/etc/oai -vf; $OPENAIRCN_DIR/SCRIPTS/./check_mme_s6a_certificate /usr/local/etc/oai/freeDiameter/ nano.openair4G.eur ; $OPENAIRCN_DIR/SCRIPTS/build_mme -c ; $OPENAIRCN_DIR/SCRIPTS/build_spgw -c </EPC_compile_prog> + <EPC_compile_prog_args></EPC_compile_prog_args> + <HSS_compile_prog>sudo mkdir -p /usr/local/etc/oai/freeDiamter; sudo cp -vf $OPENAIRCN_DIR/ETC/hss.conf /usr/local/etc/oai ; sudo cp -vf $OPENAIRCN_DIR/ETC/hss_fd.conf /usr/local/etc/oai/freeDiameter ; $OPENAIRCN_DIR/SCRIPTS/check_hss_s6a_certificate /usr/local/etc/oai/freeDiameter/ hss.openair4G.eur; $OPENAIRCN_DIR/SCRIPTS/build_hss -c </HSS_compile_prog> + <HSS_compile_prog_args></HSS_compile_prog_args> +c <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; 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> + <EPC_main_exec>sleep 10;$OPENAIRCN_DIR/TEST/autotests/tools/run_epc </EPC_main_exec> + <EPC_main_exec_args> </EPC_main_exec_args> + <HSS_main_exec>cp -vf $OPENAIRCN_DIR/ETC/*.conf $OPENAIRCN_TESTDIR/; $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>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m </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> @@ -2357,30 +2366,30 @@ <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_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf N_RB_DL 50 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf pdsch_referenceSignalPower -29 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.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.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tx_gain 90 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf rx_gain 125 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.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; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; 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>sleep 15; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; ifconfig ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.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_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.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> @@ -2395,36 +2404,46 @@ <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>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 14Mbits/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> + <UE_stop_script>sudo -S -E $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>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ;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_config_file>ETC/hss.conf MYSQL_user \"root\" + ETC/hss.conf MYSQL_pass \"linux\" + ETC/mme.conf GUMMEI_LIST "{MCC=\"208\";MNC=\"92\";MME_GID=\"4\";MME_CODE=\"1\";}" + ETC/mme.conf TAI_LIST "{MCC=\"208\";MNC=\"92\";TAC=\"1\";}" + ETC/mme.conf MME_INTERFACE_NAME_FOR_S1_MME \"eth0\" + ETC/mme.conf MME_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.62/24\" + ETC/mme.conf MME_INTERFACE_NAME_FOR_S11_MME \"lo\" + ETC/mme.conf MME_IPV4_ADDRESS_FOR_S11_MME \"127.0.11.1/8\" + ETC/mme.conf MME_PORT_FOR_S11_MME 2123 + ETC/mme.conf SGW_IPV4_ADDRESS_FOR_S11 \"127.0.11.2/8\" + ETC/mme.conf OUTPUT \"CONSOLE\" + ETC/mme.conf HSS_HOSTNAME \"hss\" + ETC/mme_fd.conf Identity \"nano.openair4G.eur\" + ETC/hss_fd.conf Identity \"hss.openair4G.eur\" + ETC/spgw.conf SGW_INTERFACE_NAME_FOR_S11 \"lo\" + ETC/spgw.conf SGW_IPV4_ADDRESS_FOR_S11 \"127.0.11.2/8\" + ETC/spgw.conf SGW_IPV4_ADDRESS_FOR_S1U_S12_S4_UP \"192.168.12.62/24\" + ETC/spgw.conf SGW_IPV4_PORT_FOR_S1U_S12_S4_UP 2152 + ETC/spgw.conf PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.62/24\" + ETC/spgw.conf IPV4_LIST \"192.172.0.0/24\",\"192.172.1.0/24\" </EPC_config_file> + <EPC_compile_prog>sudo mkdir -p /usr/local/etc/oai/freeDiameter; sudo cp -vf $OPENAIRCN_DIR/ETC/mme.conf /usr/local/etc/oai/ ; sudo cp -vf $OPENAIRCN_DIR/ETC/mme_fd.conf /usr/local/etc/oai/freeDiameter; sudo cp $OPENAIRCN_DIR/ETC/spgw.conf /usr/local/etc/oai -vf; $OPENAIRCN_DIR/SCRIPTS/./check_mme_s6a_certificate /usr/local/etc/oai/freeDiameter/ nano.openair4G.eur ; $OPENAIRCN_DIR/SCRIPTS/build_mme -c ; $OPENAIRCN_DIR/SCRIPTS/build_spgw -c </EPC_compile_prog> + <EPC_compile_prog_args></EPC_compile_prog_args> + <HSS_compile_prog>sudo mkdir -p /usr/local/etc/oai/freeDiamter; sudo cp -vf $OPENAIRCN_DIR/ETC/hss.conf /usr/local/etc/oai ; sudo cp -vf $OPENAIRCN_DIR/ETC/hss_fd.conf /usr/local/etc/oai/freeDiameter ; $OPENAIRCN_DIR/SCRIPTS/check_hss_s6a_certificate /usr/local/etc/oai/freeDiameter/ hss.openair4G.eur; $OPENAIRCN_DIR/SCRIPTS/build_hss -c </HSS_compile_prog> + <HSS_compile_prog_args></HSS_compile_prog_args> +c + <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; 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> + <EPC_main_exec>sleep 10;$OPENAIRCN_DIR/TEST/autotests/tools/run_epc </EPC_main_exec> + <EPC_main_exec_args> </EPC_main_exec_args> + <HSS_main_exec>cp -vf $OPENAIRCN_DIR/ETC/*.conf $OPENAIRCN_TESTDIR/; $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>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m </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> @@ -2441,30 +2460,30 @@ <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_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf N_RB_DL 100 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf pdsch_referenceSignalPower -29 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.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.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tx_gain 90 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf rx_gain 125 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.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; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ;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>sleep 15; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ;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.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_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.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> @@ -2484,31 +2503,41 @@ <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> + <UE_stop_script>sudo -S -E $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>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; 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_config_file>ETC/hss.conf MYSQL_user \"root\" + ETC/hss.conf MYSQL_pass \"linux\" + ETC/mme.conf GUMMEI_LIST "{MCC=\"208\";MNC=\"92\";MME_GID=\"4\";MME_CODE=\"1\";}" + ETC/mme.conf TAI_LIST "{MCC=\"208\";MNC=\"92\";TAC=\"1\";}" + ETC/mme.conf MME_INTERFACE_NAME_FOR_S1_MME \"eth0\" + ETC/mme.conf MME_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.62/24\" + ETC/mme.conf MME_INTERFACE_NAME_FOR_S11_MME \"lo\" + ETC/mme.conf MME_IPV4_ADDRESS_FOR_S11_MME \"127.0.11.1/8\" + ETC/mme.conf MME_PORT_FOR_S11_MME 2123 + ETC/mme.conf SGW_IPV4_ADDRESS_FOR_S11 \"127.0.11.2/8\" + ETC/mme.conf OUTPUT \"CONSOLE\" + ETC/mme.conf HSS_HOSTNAME \"hss\" + ETC/mme_fd.conf Identity \"nano.openair4G.eur\" + ETC/hss_fd.conf Identity \"hss.openair4G.eur\" + ETC/spgw.conf SGW_INTERFACE_NAME_FOR_S11 \"lo\" + ETC/spgw.conf SGW_IPV4_ADDRESS_FOR_S11 \"127.0.11.2/8\" + ETC/spgw.conf SGW_IPV4_ADDRESS_FOR_S1U_S12_S4_UP \"192.168.12.62/24\" + ETC/spgw.conf SGW_IPV4_PORT_FOR_S1U_S12_S4_UP 2152 + ETC/spgw.conf PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.62/24\" + ETC/spgw.conf IPV4_LIST \"192.172.0.0/24\",\"192.172.1.0/24\" </EPC_config_file> + <EPC_compile_prog>sudo mkdir -p /usr/local/etc/oai/freeDiameter; sudo cp -vf $OPENAIRCN_DIR/ETC/mme.conf /usr/local/etc/oai/ ; sudo cp -vf $OPENAIRCN_DIR/ETC/mme_fd.conf /usr/local/etc/oai/freeDiameter; sudo cp $OPENAIRCN_DIR/ETC/spgw.conf /usr/local/etc/oai -vf; $OPENAIRCN_DIR/SCRIPTS/./check_mme_s6a_certificate /usr/local/etc/oai/freeDiameter/ nano.openair4G.eur ; $OPENAIRCN_DIR/SCRIPTS/build_mme -c ; $OPENAIRCN_DIR/SCRIPTS/build_spgw -c </EPC_compile_prog> + <EPC_compile_prog_args></EPC_compile_prog_args> + <HSS_compile_prog>sudo mkdir -p /usr/local/etc/oai/freeDiamter; sudo cp -vf $OPENAIRCN_DIR/ETC/hss.conf /usr/local/etc/oai ; sudo cp -vf $OPENAIRCN_DIR/ETC/hss_fd.conf /usr/local/etc/oai/freeDiameter ; $OPENAIRCN_DIR/SCRIPTS/check_hss_s6a_certificate /usr/local/etc/oai/freeDiameter/ hss.openair4G.eur; $OPENAIRCN_DIR/SCRIPTS/build_hss -c </HSS_compile_prog> + <HSS_compile_prog_args></HSS_compile_prog_args> +c + <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; 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> + <EPC_main_exec>sleep 10;$OPENAIRCN_DIR/TEST/autotests/tools/run_epc </EPC_main_exec> + <EPC_main_exec_args> </EPC_main_exec_args> + <HSS_main_exec>cp -vf $OPENAIRCN_DIR/ETC/*.conf $OPENAIRCN_TESTDIR/; $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>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m </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> @@ -2525,30 +2554,30 @@ <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_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf N_RB_DL 25 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf pdsch_referenceSignalPower -26 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.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.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tx_gain 90 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf rx_gain 125 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.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; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; 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>sleep 15; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; ifconfig ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.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_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.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> @@ -2563,36 +2592,46 @@ <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>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf3_script 1 ppp0 -c 192.172.0.1 -i 1 -u -f m -B 192.172.0.2 -b 10M -R </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_true>throughput_test min=9.0Mbits/sec max=9Mbits/sec average=9Mbits/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> + <UE_stop_script>sudo -S -E $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>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ;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_config_file>ETC/hss.conf MYSQL_user \"root\" + ETC/hss.conf MYSQL_pass \"linux\" + ETC/mme.conf GUMMEI_LIST "{MCC=\"208\";MNC=\"92\";MME_GID=\"4\";MME_CODE=\"1\";}" + ETC/mme.conf TAI_LIST "{MCC=\"208\";MNC=\"92\";TAC=\"1\";}" + ETC/mme.conf MME_INTERFACE_NAME_FOR_S1_MME \"eth0\" + ETC/mme.conf MME_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.62/24\" + ETC/mme.conf MME_INTERFACE_NAME_FOR_S11_MME \"lo\" + ETC/mme.conf MME_IPV4_ADDRESS_FOR_S11_MME \"127.0.11.1/8\" + ETC/mme.conf MME_PORT_FOR_S11_MME 2123 + ETC/mme.conf SGW_IPV4_ADDRESS_FOR_S11 \"127.0.11.2/8\" + ETC/mme.conf OUTPUT \"CONSOLE\" + ETC/mme.conf HSS_HOSTNAME \"hss\" + ETC/mme_fd.conf Identity \"nano.openair4G.eur\" + ETC/hss_fd.conf Identity \"hss.openair4G.eur\" + ETC/spgw.conf SGW_INTERFACE_NAME_FOR_S11 \"lo\" + ETC/spgw.conf SGW_IPV4_ADDRESS_FOR_S11 \"127.0.11.2/8\" + ETC/spgw.conf SGW_IPV4_ADDRESS_FOR_S1U_S12_S4_UP \"192.168.12.62/24\" + ETC/spgw.conf SGW_IPV4_PORT_FOR_S1U_S12_S4_UP 2152 + ETC/spgw.conf PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.62/24\" + ETC/spgw.conf IPV4_LIST \"192.172.0.0/24\",\"192.172.1.0/24\" </EPC_config_file> + <EPC_compile_prog>sudo mkdir -p /usr/local/etc/oai/freeDiameter; sudo cp -vf $OPENAIRCN_DIR/ETC/mme.conf /usr/local/etc/oai/ ; sudo cp -vf $OPENAIRCN_DIR/ETC/mme_fd.conf /usr/local/etc/oai/freeDiameter; sudo cp $OPENAIRCN_DIR/ETC/spgw.conf /usr/local/etc/oai -vf; $OPENAIRCN_DIR/SCRIPTS/./check_mme_s6a_certificate /usr/local/etc/oai/freeDiameter/ nano.openair4G.eur ; $OPENAIRCN_DIR/SCRIPTS/build_mme -c ; $OPENAIRCN_DIR/SCRIPTS/build_spgw -c </EPC_compile_prog> + <EPC_compile_prog_args></EPC_compile_prog_args> + <HSS_compile_prog>sudo mkdir -p /usr/local/etc/oai/freeDiamter; sudo cp -vf $OPENAIRCN_DIR/ETC/hss.conf /usr/local/etc/oai ; sudo cp -vf $OPENAIRCN_DIR/ETC/hss_fd.conf /usr/local/etc/oai/freeDiameter ; $OPENAIRCN_DIR/SCRIPTS/check_hss_s6a_certificate /usr/local/etc/oai/freeDiameter/ hss.openair4G.eur; $OPENAIRCN_DIR/SCRIPTS/build_hss -c </HSS_compile_prog> + <HSS_compile_prog_args></HSS_compile_prog_args> +c + <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; 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> + <EPC_main_exec>sleep 10;$OPENAIRCN_DIR/TEST/autotests/tools/run_epc </EPC_main_exec> + <EPC_main_exec_args> </EPC_main_exec_args> + <HSS_main_exec>cp -vf $OPENAIRCN_DIR/ETC/*.conf $OPENAIRCN_TESTDIR/; $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>$OPENAIRCN_DIR/TEST/autotests/tools/iperf3_script 5 lo -s -i 1 -f m </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> @@ -2609,30 +2648,30 @@ <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_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf N_RB_DL 50 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf pdsch_referenceSignalPower -29 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.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.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tx_gain 90 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf rx_gain 125 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.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; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; 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>sleep 15; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; ifconfig ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.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_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.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> @@ -2647,36 +2686,46 @@ <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>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf3_script 1 ppp0 -c 192.172.0.1 -i 1 -u -f m -B 192.172.0.2 -b 10M -R </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_true>throughput_test min=9Mbits/sec max=9Mbits/sec average=9Mbits/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> + <UE_stop_script>sudo -S -E $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>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ;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_config_file>ETC/hss.conf MYSQL_user \"root\" + ETC/hss.conf MYSQL_pass \"linux\" + ETC/mme.conf GUMMEI_LIST "{MCC=\"208\";MNC=\"92\";MME_GID=\"4\";MME_CODE=\"1\";}" + ETC/mme.conf TAI_LIST "{MCC=\"208\";MNC=\"92\";TAC=\"1\";}" + ETC/mme.conf MME_INTERFACE_NAME_FOR_S1_MME \"eth0\" + ETC/mme.conf MME_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.62/24\" + ETC/mme.conf MME_INTERFACE_NAME_FOR_S11_MME \"lo\" + ETC/mme.conf MME_IPV4_ADDRESS_FOR_S11_MME \"127.0.11.1/8\" + ETC/mme.conf MME_PORT_FOR_S11_MME 2123 + ETC/mme.conf SGW_IPV4_ADDRESS_FOR_S11 \"127.0.11.2/8\" + ETC/mme.conf OUTPUT \"CONSOLE\" + ETC/mme.conf HSS_HOSTNAME \"hss\" + ETC/mme_fd.conf Identity \"nano.openair4G.eur\" + ETC/hss_fd.conf Identity \"hss.openair4G.eur\" + ETC/spgw.conf SGW_INTERFACE_NAME_FOR_S11 \"lo\" + ETC/spgw.conf SGW_IPV4_ADDRESS_FOR_S11 \"127.0.11.2/8\" + ETC/spgw.conf SGW_IPV4_ADDRESS_FOR_S1U_S12_S4_UP \"192.168.12.62/24\" + ETC/spgw.conf SGW_IPV4_PORT_FOR_S1U_S12_S4_UP 2152 + ETC/spgw.conf PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.62/24\" + ETC/spgw.conf IPV4_LIST \"192.172.0.0/24\",\"192.172.1.0/24\" </EPC_config_file> + <EPC_compile_prog>sudo mkdir -p /usr/local/etc/oai/freeDiameter; sudo cp -vf $OPENAIRCN_DIR/ETC/mme.conf /usr/local/etc/oai/ ; sudo cp -vf $OPENAIRCN_DIR/ETC/mme_fd.conf /usr/local/etc/oai/freeDiameter; sudo cp $OPENAIRCN_DIR/ETC/spgw.conf /usr/local/etc/oai -vf; $OPENAIRCN_DIR/SCRIPTS/./check_mme_s6a_certificate /usr/local/etc/oai/freeDiameter/ nano.openair4G.eur ; $OPENAIRCN_DIR/SCRIPTS/build_mme -c ; $OPENAIRCN_DIR/SCRIPTS/build_spgw -c </EPC_compile_prog> + <EPC_compile_prog_args></EPC_compile_prog_args> + <HSS_compile_prog>sudo mkdir -p /usr/local/etc/oai/freeDiamter; sudo cp -vf $OPENAIRCN_DIR/ETC/hss.conf /usr/local/etc/oai ; sudo cp -vf $OPENAIRCN_DIR/ETC/hss_fd.conf /usr/local/etc/oai/freeDiameter ; $OPENAIRCN_DIR/SCRIPTS/check_hss_s6a_certificate /usr/local/etc/oai/freeDiameter/ hss.openair4G.eur; $OPENAIRCN_DIR/SCRIPTS/build_hss -c </HSS_compile_prog> + <HSS_compile_prog_args></HSS_compile_prog_args> +c + <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; 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> + <EPC_main_exec>sleep 10;$OPENAIRCN_DIR/TEST/autotests/tools/run_epc </EPC_main_exec> + <EPC_main_exec_args> </EPC_main_exec_args> + <HSS_main_exec>cp -vf $OPENAIRCN_DIR/ETC/*.conf $OPENAIRCN_TESTDIR/; $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>$OPENAIRCN_DIR/TEST/autotests/tools/iperf3_script 5 lo -s -i 1 -f m </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> @@ -2693,30 +2742,30 @@ <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_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf N_RB_DL 100 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf pdsch_referenceSignalPower -29 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.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.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tx_gain 90 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf rx_gain 125 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.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; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; 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>sleep 15; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; ifconfig ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.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_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.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> @@ -2731,36 +2780,46 @@ <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>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf3_script 1 ppp0 -c 192.172.0.1 -i 1 -u -f m -B 192.172.0.2 -b 9M -R </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_true>throughput_test min=9Mbits/sec max=9Mbits/sec average=9Mbits/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> + <UE_stop_script>sudo -S -E $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>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ;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_config_file>ETC/hss.conf MYSQL_user \"root\" + ETC/hss.conf MYSQL_pass \"linux\" + ETC/mme.conf GUMMEI_LIST "{MCC=\"208\";MNC=\"92\";MME_GID=\"4\";MME_CODE=\"1\";}" + ETC/mme.conf TAI_LIST "{MCC=\"208\";MNC=\"92\";TAC=\"1\";}" + ETC/mme.conf MME_INTERFACE_NAME_FOR_S1_MME \"eth0\" + ETC/mme.conf MME_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.62/24\" + ETC/mme.conf MME_INTERFACE_NAME_FOR_S11_MME \"lo\" + ETC/mme.conf MME_IPV4_ADDRESS_FOR_S11_MME \"127.0.11.1/8\" + ETC/mme.conf MME_PORT_FOR_S11_MME 2123 + ETC/mme.conf SGW_IPV4_ADDRESS_FOR_S11 \"127.0.11.2/8\" + ETC/mme.conf OUTPUT \"CONSOLE\" + ETC/mme.conf HSS_HOSTNAME \"hss\" + ETC/mme_fd.conf Identity \"nano.openair4G.eur\" + ETC/hss_fd.conf Identity \"hss.openair4G.eur\" + ETC/spgw.conf SGW_INTERFACE_NAME_FOR_S11 \"lo\" + ETC/spgw.conf SGW_IPV4_ADDRESS_FOR_S11 \"127.0.11.2/8\" + ETC/spgw.conf SGW_IPV4_ADDRESS_FOR_S1U_S12_S4_UP \"192.168.12.62/24\" + ETC/spgw.conf SGW_IPV4_PORT_FOR_S1U_S12_S4_UP 2152 + ETC/spgw.conf PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.62/24\" + ETC/spgw.conf IPV4_LIST \"192.172.0.0/24\",\"192.172.1.0/24\" </EPC_config_file> + <EPC_compile_prog>sudo mkdir -p /usr/local/etc/oai/freeDiameter; sudo cp -vf $OPENAIRCN_DIR/ETC/mme.conf /usr/local/etc/oai/ ; sudo cp -vf $OPENAIRCN_DIR/ETC/mme_fd.conf /usr/local/etc/oai/freeDiameter; sudo cp $OPENAIRCN_DIR/ETC/spgw.conf /usr/local/etc/oai -vf; $OPENAIRCN_DIR/SCRIPTS/./check_mme_s6a_certificate /usr/local/etc/oai/freeDiameter/ nano.openair4G.eur ; $OPENAIRCN_DIR/SCRIPTS/build_mme -c ; $OPENAIRCN_DIR/SCRIPTS/build_spgw -c </EPC_compile_prog> + <EPC_compile_prog_args></EPC_compile_prog_args> + <HSS_compile_prog>sudo mkdir -p /usr/local/etc/oai/freeDiamter; sudo cp -vf $OPENAIRCN_DIR/ETC/hss.conf /usr/local/etc/oai ; sudo cp -vf $OPENAIRCN_DIR/ETC/hss_fd.conf /usr/local/etc/oai/freeDiameter ; $OPENAIRCN_DIR/SCRIPTS/check_hss_s6a_certificate /usr/local/etc/oai/freeDiameter/ hss.openair4G.eur; $OPENAIRCN_DIR/SCRIPTS/build_hss -c </HSS_compile_prog> + <HSS_compile_prog_args></HSS_compile_prog_args> +c + <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; 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> + <EPC_main_exec>sleep 10;$OPENAIRCN_DIR/TEST/autotests/tools/run_epc </EPC_main_exec> + <EPC_main_exec_args> </EPC_main_exec_args> + <HSS_main_exec>cp -vf $OPENAIRCN_DIR/ETC/*.conf $OPENAIRCN_TESTDIR/; $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>$OPENAIRCN_DIR/TEST/autotests/tools/iperf3_script 5 lo -s -i 1 -f m </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> @@ -2778,27 +2837,27 @@ <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_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf N_RB_DL 25 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.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.usrpx310.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_INTERFACE_NAME_FOR_S1U \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.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>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; 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_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.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> @@ -2812,7 +2871,7 @@ <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>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 7Mbits/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> @@ -2832,7 +2891,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>$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>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -f m -u</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> @@ -2850,27 +2909,27 @@ <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_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf N_RB_DL 50 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.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.usrpx310.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_INTERFACE_NAME_FOR_S1U \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.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>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; 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_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.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> @@ -2884,7 +2943,7 @@ <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>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 14Mbits/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> @@ -2904,7 +2963,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>$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>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m </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> @@ -2921,27 +2980,27 @@ <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_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf N_RB_DL 100 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.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.usrpx310.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_INTERFACE_NAME_FOR_S1U \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.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>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; 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_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.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> @@ -2976,7 +3035,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>$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>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m </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> @@ -2993,27 +3052,27 @@ <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_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf N_RB_DL 25 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.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.usrpx310.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_INTERFACE_NAME_FOR_S1U \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.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>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; 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_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.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> @@ -3028,7 +3087,7 @@ <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>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf3_script 1 ppp0 -c 192.172.0.1 -i 1 -u -f m -B 192.172.0.2 -b 10M -R</UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> <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> @@ -3048,7 +3107,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>$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>$OPENAIRCN_DIR/TEST/autotests/tools/iperf3_script 5 lo -s -i 1 -f m </EPC_traffic_exec> <EPC_traffic_exec_args></EPC_traffic_exec_args> <EPC_search_expr_false></EPC_search_expr_false> <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs> @@ -3064,27 +3123,27 @@ <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_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf N_RB_DL 50 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.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.usrpx310.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_INTERFACE_NAME_FOR_S1U \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.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>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; 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_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.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> @@ -3099,7 +3158,7 @@ <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>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf3_script 1 ppp0 -c 192.172.0.1 -i 1 -u -f m -B 192.172.0.2 -b 20M -R</UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> <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> @@ -3119,7 +3178,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>$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>$OPENAIRCN_DIR/TEST/autotests/tools/iperf3_script 5 lo -s -i 1 -f m </EPC_traffic_exec> <EPC_traffic_exec_args></EPC_traffic_exec_args> <EPC_search_expr_false></EPC_search_expr_false> <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs> @@ -3135,27 +3194,27 @@ <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_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf N_RB_DL 100 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.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.usrpx310.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_INTERFACE_NAME_FOR_S1U \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.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_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.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> @@ -3190,7 +3249,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>$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>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s </EPC_traffic_exec> <EPC_traffic_exec_args></EPC_traffic_exec_args> <EPC_search_expr_false></EPC_search_expr_false> <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs> @@ -3209,27 +3268,27 @@ <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_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf N_RB_DL 25 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.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.usrpx310.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_INTERFACE_NAME_FOR_S1U \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.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; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; 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>sleep 15; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.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_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.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> @@ -3249,7 +3308,7 @@ <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> + <UE_stop_script>sudo -S -E $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\" @@ -3273,7 +3332,7 @@ <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>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m </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> @@ -3292,27 +3351,27 @@ <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_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf N_RB_DL 50 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.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.usrpx310.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_INTERFACE_NAME_FOR_S1U \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.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; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; 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>sleep 15; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.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_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.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> @@ -3332,7 +3391,7 @@ <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> + <UE_stop_script>sudo -S -E $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\" @@ -3356,7 +3415,7 @@ <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>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m </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> @@ -3373,27 +3432,27 @@ <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_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf N_RB_DL 100 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.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.usrpx310.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_INTERFACE_NAME_FOR_S1U \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.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; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; 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>sleep 15; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.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_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.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> @@ -3413,7 +3472,7 @@ <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> + <UE_stop_script>sudo -S -E $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\" @@ -3437,7 +3496,7 @@ <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>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m </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> @@ -3454,27 +3513,27 @@ <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_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf N_RB_DL 25 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.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.usrpx310.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_INTERFACE_NAME_FOR_S1U \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.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; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; 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>sleep 15; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.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_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.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> @@ -3494,7 +3553,7 @@ <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> + <UE_stop_script>sudo -S -E $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\" @@ -3518,7 +3577,7 @@ <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>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s </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> @@ -3535,27 +3594,27 @@ <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_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf N_RB_DL 50 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.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.usrpx310.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_INTERFACE_NAME_FOR_S1U \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.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;$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; 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>sleep 15;$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.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_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.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> @@ -3575,7 +3634,7 @@ <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> + <UE_stop_script>sudo -S -E $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\" @@ -3599,7 +3658,7 @@ <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>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s </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> @@ -3616,27 +3675,27 @@ <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_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf N_RB_DL 100 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.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.usrpx310.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_INTERFACE_NAME_FOR_S1U \"eth6\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.111/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.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; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; 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>sleep 15; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.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_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.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> @@ -3656,7 +3715,7 @@ <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> + <UE_stop_script>sudo -S -E $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\" @@ -3680,7 +3739,7 @@ <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>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s </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> @@ -3714,7 +3773,7 @@ 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>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S $OPENAIR_DIR/cmake_targets/tools/init_exmimo2; dmesg|tail </eNB_pre_exec> + <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S $OPENAIR_DIR/cmake_targets/tools/stop_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> @@ -3731,7 +3790,7 @@ <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>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 7Mbits/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> @@ -3751,7 +3810,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>$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>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m </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> @@ -3786,7 +3845,7 @@ 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>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S $OPENAIR_DIR/cmake_targets/tools/init_exmimo2 ; dmesg|tail</eNB_pre_exec> + <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S $OPENAIR_DIR/cmake_targets/tools/stop_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> @@ -3804,7 +3863,7 @@ <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>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c 192.172.0.1 -b 14Mbits/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> @@ -3824,7 +3883,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>$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>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m </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> @@ -3858,7 +3917,7 @@ 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>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S $OPENAIR_DIR/cmake_targets/tools/init_exmimo2 ; dmesg|tail</eNB_pre_exec> + <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S $OPENAIR_DIR/cmake_targets/tools/stop_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> @@ -3896,7 +3955,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>$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>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m </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> @@ -3930,7 +3989,7 @@ 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>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S $OPENAIR_DIR/cmake_targets/tools/init_exmimo2 ; dmesg|tail</eNB_pre_exec> + <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S $OPENAIR_DIR/cmake_targets/tools/stop_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> @@ -3948,7 +4007,7 @@ <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>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf3_script 1 ppp0 -c 192.172.0.1 -i 1 -u -f m -B 192.172.0.2 -b 10M -R</UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> <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> @@ -3968,7 +4027,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>$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>$OPENAIRCN_DIR/TEST/autotests/tools/iperf3_script 5 lo -s -i 1 -f m </EPC_traffic_exec> <EPC_traffic_exec_args></EPC_traffic_exec_args> <EPC_search_expr_false></EPC_search_expr_false> <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs> @@ -4001,7 +4060,7 @@ 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>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S $OPENAIR_DIR/cmake_targets/tools/init_exmimo2 ; dmesg|tail</eNB_pre_exec> + <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S $OPENAIR_DIR/cmake_targets/tools/stop_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> @@ -4019,7 +4078,7 @@ <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>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf3_script 1 ppp0 -c 192.172.0.1 -i 1 -u -f m -B 192.172.0.2 -b 20M -R</UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> <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> @@ -4039,7 +4098,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>$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>$OPENAIRCN_DIR/TEST/autotests/tools/iperf3_script 5 lo -s -i 1 -f m </EPC_traffic_exec> <EPC_traffic_exec_args></EPC_traffic_exec_args> <EPC_search_expr_false></EPC_search_expr_false> <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs> @@ -4072,7 +4131,7 @@ 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>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S $OPENAIR_DIR/cmake_targets/tools/init_exmimo2 ; dmesg|tail</eNB_pre_exec> + <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S $OPENAIR_DIR/cmake_targets/tools/stop_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> @@ -4110,7 +4169,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>$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>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s </EPC_traffic_exec> <EPC_traffic_exec_args></EPC_traffic_exec_args> <EPC_search_expr_false></EPC_search_expr_false> <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs> @@ -4145,7 +4204,7 @@ 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;$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; 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>sleep 15;$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S $OPENAIR_DIR/cmake_targets/tools/stop_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> @@ -4169,7 +4228,7 @@ <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> + <UE_stop_script>sudo -S -E $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\" @@ -4193,7 +4252,7 @@ <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>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m </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> @@ -4229,7 +4288,7 @@ 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; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; 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>sleep 15; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S $OPENAIR_DIR/cmake_targets/tools/stop_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> @@ -4252,7 +4311,7 @@ <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> + <UE_stop_script>sudo -S -E $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\" @@ -4276,7 +4335,7 @@ <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>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m </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> @@ -4310,7 +4369,7 @@ 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;$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; 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>sleep 15;$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S $OPENAIR_DIR/cmake_targets/tools/stop_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> @@ -4333,7 +4392,7 @@ <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> + <UE_stop_script>sudo -S -E $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\" @@ -4357,7 +4416,7 @@ <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>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m </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> @@ -4391,7 +4450,7 @@ 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;$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; 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>sleep 15;$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S $OPENAIR_DIR/cmake_targets/tools/stop_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> @@ -4414,7 +4473,7 @@ <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> + <UE_stop_script>sudo -S -E $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\" @@ -4438,7 +4497,7 @@ <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>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s </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> @@ -4472,7 +4531,7 @@ 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;$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; 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>sleep 15;$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S $OPENAIR_DIR/cmake_targets/tools/stop_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> @@ -4495,7 +4554,7 @@ <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> + <UE_stop_script>sudo -S -E $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\" @@ -4519,7 +4578,7 @@ <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>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s </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> @@ -4553,7 +4612,7 @@ 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; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; 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>sleep 15; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S $OPENAIR_DIR/cmake_targets/tools/stop_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> @@ -4576,7 +4635,7 @@ <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> + <UE_stop_script>sudo -S -E $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\" @@ -4600,7 +4659,7 @@ <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>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s ; 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> @@ -4676,7 +4735,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>$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>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m </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> @@ -4752,7 +4811,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>$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>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m </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> @@ -4827,7 +4886,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>$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>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m </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> @@ -4902,7 +4961,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>$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>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s </EPC_traffic_exec> <EPC_traffic_exec_args></EPC_traffic_exec_args> <EPC_search_expr_false></EPC_search_expr_false> <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs> @@ -4976,7 +5035,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>$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>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s </EPC_traffic_exec> <EPC_traffic_exec_args></EPC_traffic_exec_args> <EPC_search_expr_false></EPC_search_expr_false> <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs> @@ -5051,7 +5110,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>$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>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s </EPC_traffic_exec> <EPC_traffic_exec_args></EPC_traffic_exec_args> <EPC_search_expr_false></EPC_search_expr_false> <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs> @@ -5090,7 +5149,7 @@ <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</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_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf --rf-config-file $OPENAIR_DIR/targets/ARCH/LMSSDR/enb_sodera_highband_5MHz_rx19dB_txfull.ini -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> @@ -5125,12 +5184,12 @@ <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>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m </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>SoDeRa.ALU_EPC.Bandrich.5MHz.FDD.Band_7.UL.1TX.1RX</tags> + <tags>LMSSDR.ALU_EPC.Bandrich.5MHz.FDD.Band_7.UL.1TX.1RX</tags> <nruns>10</nruns> </testCase> @@ -5166,7 +5225,7 @@ <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</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_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf --rf-config-file $OPENAIR_DIR/targets/ARCH/LMSSDR/enb_sodera_highband_10MHz_rx19dB_txfull.ini -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> @@ -5201,12 +5260,12 @@ <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>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m </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>SoDeRa.ALU_EPC.Bandrich.10MHz.FDD.Band_7.UL.1TX.1RX</tags> + <tags>LMSSDR.ALU_EPC.Bandrich.10MHz.FDD.Band_7.UL.1TX.1RX</tags> <nruns>10</nruns> </testCase> @@ -5241,7 +5300,7 @@ <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</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_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf -W --rf-config-file $OPENAIR_DIR/targets/ARCH/LMSSDR/enb_sodera_highband_20MHz_rx19dB_txfull.ini </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> @@ -5276,12 +5335,12 @@ <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>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m </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>SoDeRa.ALU_EPC.Bandrich.20MHz.FDD.Band_7.UL.1TX.1RX</tags> + <tags>LMSSDR.ALU_EPC.Bandrich.20MHz.FDD.Band_7.UL.1TX.1RX</tags> <nruns>10</nruns> </testCase> @@ -5316,7 +5375,7 @@ <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</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_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf -W --rf-config-file $OPENAIR_DIR/targets/ARCH/LMSSDR/enb_sodera_highband_5MHz_rx19dB_txfull.ini </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> @@ -5351,11 +5410,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>$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>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s </EPC_traffic_exec> <EPC_traffic_exec_args></EPC_traffic_exec_args> <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.DL.1TX.1RX</tags> + <tags>LMSSDR.ALU_EPC.Bandrich.5MHz.FDD.Band_7.DL.1TX.1RX</tags> <nruns>10</nruns> </testCase> @@ -5390,7 +5449,7 @@ <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</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_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf -W --rf-config-file $OPENAIR_DIR/targets/ARCH/LMSSDR/enb_sodera_highband_10MHz_rx19dB_txfull.ini</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> @@ -5425,7 +5484,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>$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>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s </EPC_traffic_exec> <EPC_traffic_exec_args></EPC_traffic_exec_args> <EPC_search_expr_false></EPC_search_expr_false> <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs> @@ -5464,7 +5523,7 @@ <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</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_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf -W --rf-config-file $OPENAIR_DIR/targets/ARCH/LMSSDR/enb_sodera_highband_20MHz_rx19dB_txfull.ini</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> @@ -5500,7 +5559,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>$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>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s </EPC_traffic_exec> <EPC_traffic_exec_args></EPC_traffic_exec_args> <EPC_search_expr_false></EPC_search_expr_false> <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs> @@ -5586,7 +5645,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>$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>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m </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> @@ -5672,7 +5731,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>$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>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m </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> @@ -5757,7 +5816,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>$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>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m </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> @@ -5842,7 +5901,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>$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>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s </EPC_traffic_exec> <EPC_traffic_exec_args></EPC_traffic_exec_args> <EPC_search_expr_false></EPC_search_expr_false> <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs> @@ -5926,7 +5985,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>$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>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s </EPC_traffic_exec> <EPC_traffic_exec_args></EPC_traffic_exec_args> <EPC_search_expr_false></EPC_search_expr_false> <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs> @@ -6011,7 +6070,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>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 15Mbits/s -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 15Mbits/s </EPC_traffic_exec> <EPC_traffic_exec_args></EPC_traffic_exec_args> <EPC_search_expr_false></EPC_search_expr_false> <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs> @@ -6028,29 +6087,29 @@ <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.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_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf N_RB_DL 25 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.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.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tx_gain 90 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf rx_gain 125 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.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>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</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_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.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> @@ -6065,7 +6124,7 @@ <UE_pre_exec_args></UE_pre_exec_args> <UE_main_exec>sleep 50; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_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_phone 1 YT9115PX1E -u -c 192.172.0.1 -b 10Mbits/s -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script_phone 1 YT9115PX1E -u -c 192.172.0.1 -b 7Mbits/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> @@ -6085,9 +6144,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>$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>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m </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_true>throughput_test min=5.0Mbits/sec max=5.0Mbits/sec average=5.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.ALU_EPC.SonyExperiaM4.5MHz.FDD.Band_7.UL.1TX.1RX</tags> @@ -6103,29 +6162,29 @@ <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.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_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf N_RB_DL 50 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.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.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tx_gain 90 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf rx_gain 125 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.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>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</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_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.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> @@ -6140,7 +6199,7 @@ <UE_pre_exec_args></UE_pre_exec_args> <UE_main_exec>sleep 50; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_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_phone 1 YT9115PX1E -u -c 192.172.0.1 -b 10Mbits/s -B 192.172.0.2</UE_traffic_exec> + <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script_phone 1 YT9115PX1E -u -c 192.172.0.1 -b 14Mbits/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> @@ -6160,9 +6219,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>$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>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m </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_true>throughput_test min=10.0Mbits/sec max=10.0Mbits/sec average=10.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.ALU_EPC.SonyExperiaM4.10MHz.FDD.Band_7.UL.1TX.1RX</tags> @@ -6177,29 +6236,29 @@ <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.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_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf N_RB_DL 100 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.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.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tx_gain 90 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf rx_gain 125 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.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>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</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_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.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> @@ -6234,7 +6293,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>$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>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m </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> @@ -6251,29 +6310,29 @@ <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.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_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf N_RB_DL 25 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.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.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tx_gain 90 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf rx_gain 125 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.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>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</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_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.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> @@ -6288,7 +6347,7 @@ <UE_pre_exec_args></UE_pre_exec_args> <UE_main_exec>sleep 50; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_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_phone 1 YT9115PX1E -u -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_phone 1 YT9115PX1E -s -i 1 -u -f m </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 </UE_search_expr_true> <UE_search_expr_false></UE_search_expr_false> @@ -6309,7 +6368,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>$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>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 65 lo -c 192.172.0.2 -b 10Mbits/s -i 1 -f m -u</EPC_traffic_exec> <EPC_traffic_exec_args></EPC_traffic_exec_args> <EPC_search_expr_false></EPC_search_expr_false> <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs> @@ -6325,29 +6384,29 @@ <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.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_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf N_RB_DL 50 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.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.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tx_gain 90 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf rx_gain 125 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.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>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</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_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.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> @@ -6362,7 +6421,7 @@ <UE_pre_exec_args></UE_pre_exec_args> <UE_main_exec>sleep 50; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_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_phone 1 YT9115PX1E -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_phone 1 YT9115PX1E -s -i 1 -u -f m </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</UE_search_expr_true> <UE_search_expr_false></UE_search_expr_false> @@ -6383,7 +6442,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>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 15Mbits/s -B 192.172.0.1</EPC_traffic_exec> + <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 65 lo -c 192.172.0.2 -b 20Mbits/s -i 1 -f m -u </EPC_traffic_exec> <EPC_traffic_exec_args></EPC_traffic_exec_args> <EPC_search_expr_false></EPC_search_expr_false> <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs> @@ -6399,29 +6458,29 @@ <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.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_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tracking_area_code \"1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_country_code \"208\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf mobile_network_code \"92\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf N_RB_DL 100 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.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.conf downlink_frequency 2660000000L + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf uplink_frequency_offset -120000000 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf tx_gain 90 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf rx_gain 125 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf frame_type \"FDD\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_rx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_tx 1 + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.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>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</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_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.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> @@ -6436,7 +6495,7 @@ <UE_pre_exec_args></UE_pre_exec_args> <UE_main_exec>sleep 50; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_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_phone 1 YT9115PX1E -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_phone 1 YT9115PX1E -s -i 1 -u -f m </UE_traffic_exec> <UE_traffic_exec_args></UE_traffic_exec_args> <UE_search_expr_true>throughput_test min=10.0Mbits/sec max=10.0Mbits/sec average=10.0Mbits/sec</UE_search_expr_true> <UE_search_expr_false></UE_search_expr_false> @@ -6457,7 +6516,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>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 15Mbits/s -B 192.172.0.1</EPC_traffic_exec> + <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 65 lo -c 192.172.0.2 -b 40Mbits/s -i 1 -f m -u </EPC_traffic_exec> <EPC_traffic_exec_args></EPC_traffic_exec_args> <EPC_search_expr_false></EPC_search_expr_false> <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs> diff --git a/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py b/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py index 3921afd8f25f0f41badb5ce9f2c040fab866b7d6..768b88aa289038d7c97e912a3e4fa806d078df31 100755 --- a/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py +++ b/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py @@ -141,6 +141,7 @@ def send_command (cmd, response, timeout): error = error + ' In function: ' + sys._getframe().f_code.co_name + ': *** Caught exception: ' + str(e.__class__) + " : " + str( e) error = error + traceback.format_exc() print error + time.sleep(1) def start_ue () : @@ -200,10 +201,12 @@ def reset_ue(): ProductId=res[0][3] usb_dir= find_usb_path(VendorId, ProductId) print "Bandrich 4G LTE Adapter found in..." + usb_dir + print "Sleeping now for 45 seconds...please wait..." 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" ) + stop_ue() i=1 gw='192.172.0.1' @@ -218,6 +221,7 @@ while i < len(sys.argv): print 'Using Serial port : ' + serial_port stop_ue() elif arg == '--reset-ue' : + find_open_port() reset_ue() elif arg == '-gw' : gw = sys.argv[i+1] diff --git a/cmake_targets/autotests/tools/configure_cots_huaweiE398_ue.py b/cmake_targets/autotests/tools/configure_cots_huaweiE398_ue.py index b173d6157c002c9b76cb66c5e490162c6210a0de..929cc1c0a5246e0db485bb077878ed108aafcd49 100755 --- a/cmake_targets/autotests/tools/configure_cots_huaweiE398_ue.py +++ b/cmake_targets/autotests/tools/configure_cots_huaweiE398_ue.py @@ -143,6 +143,7 @@ def send_command (cmd, response, timeout): error = error + ' In function: ' + sys._getframe().f_code.co_name + ': *** Caught exception: ' + str(e.__class__) + " : " + str( e) error = error + traceback.format_exc() print error + time.sleep(1) def start_ue () : @@ -211,6 +212,7 @@ def reset_ue(): os.system(cmd + " ; sleep 15" ) cmd = "sudo sh -c \"echo 1 > " + usb_dir + "/authorized\"" os.system(cmd + " ; sleep 30" ) + stop_ue() i=1 gw='192.172.0.1' @@ -225,6 +227,7 @@ while i < len(sys.argv): print 'Using Serial port : ' + serial_port stop_ue() elif arg == '--reset-ue' : + find_open_port() reset_ue() elif arg == '-gw' : gw = sys.argv[i+1] diff --git a/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py b/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py index eba3156976544cea776a3b001b0b8dcb3d3f45cc..c136067a61525b591c487ef00f72392f18d895a1 100755 --- a/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py +++ b/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py @@ -43,7 +43,8 @@ def kill_processes(name): cmd = 'sudo adb -s ' + device_id +' shell "ps |grep ' + name + '"' status, out = commands.getstatusoutput(cmd) if status != 0: - print "Error execting command to kill process " + name + print "Error executing command to kill process " + name + print "Error =" + out sys.exit(1) print "Out = " + out if out=='': @@ -51,7 +52,7 @@ def kill_processes(name): out_arr = out.split() pid_to_kill = out_arr[1] print "Now killing process ID " + pid_to_kill + " on Phone" - cmd = 'sudo adb -s ' + device_id +' shell "kill ' + pid_to_kill + '"' + cmd = 'sudo adb -s ' + device_id +' shell "kill -9 ' + pid_to_kill + '"' status, out = commands.getstatusoutput(cmd) if status != 0: print "Error execting command to kill process " + name @@ -62,6 +63,7 @@ def start_ue () : #print 'Enter your commands below.\r\nInsert "exit" to leave the application.' print 'Killing old iperf/ping sessions' kill_processes('iperf') + kill_processes('iperf3') kill_processes('ping') print "Turning off airplane mode" os.system('sudo -E adb devices') @@ -93,6 +95,7 @@ def stop_ue(): os.system('sudo adb -s ' + device_id + ' shell \"settings put global airplane_mode_on 1; am broadcast -a android.intent.action.AIRPLANE_MODE --ez state true\" ') print "Killing iperf/ping sessions" kill_processes('iperf') + kill_processes('iperf3') kill_processes('ping') i=1 diff --git a/cmake_targets/autotests/tools/iperf3_script b/cmake_targets/autotests/tools/iperf3_script new file mode 100755 index 0000000000000000000000000000000000000000..e82816f6e140a3981536a13c7dd3ae23d6f3dc9f --- /dev/null +++ b/cmake_targets/autotests/tools/iperf3_script @@ -0,0 +1,52 @@ +#!/bin/bash +#****************************************************************************** + +# 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 + +# *******************************************************************************/ +# \author Navid Nikaein, Rohit Gupta + +#arg1 timeout to wait before running the script +#arg2 interface +#arg3 iperf arguments + +args=($*) +timeout=${args[0]} +iface=${args[1]} +iperf3_args=(${args[@]:2}) + +#array=${1:-1} +echo "args = ${args[@]}" +echo "timeout = $timeout" +echo "iface = $iface" +echo "iperf3_args = ${iperf3_args[@]}" + +sleep $timeout + +while true; do var=`ifconfig $iface` ;sleep 1; if [ "$var" != "" ]; then break; fi ; done ; sleep 5 + +iperf3 ${iperf3_args[@]} diff --git a/cmake_targets/autotests/tools/iperf3_script_phone b/cmake_targets/autotests/tools/iperf3_script_phone new file mode 100755 index 0000000000000000000000000000000000000000..c191f72ec3ce20d5a582ec3cb4bfc30ff184bf1b --- /dev/null +++ b/cmake_targets/autotests/tools/iperf3_script_phone @@ -0,0 +1,63 @@ +#!/bin/bash +#****************************************************************************** + +# 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 + +# *******************************************************************************/ +# \author Navid Nikaein, Rohit Gupta + +#arg1 timeout to wait before running the script +#arg2 interface +#arg3 iperf3 arguments + +args=($*) +timeout=${args[0]} +device_id=${args[1]} +iperf3_args=(${args[@]:2}) + +#array=${1:-1} +echo "args = ${args[@]}" +echo "timeout = $timeout" +echo "device_id = $device_id" +echo "iperf3_args = ${iperf3_args[@]}" + +sleep $timeout + +while true ; do + cmd=`sudo adb -s $device_id shell netcfg |grep 192.` + if [ -z "$cmd" ]; then + echo "Wating for UE to connect and get IP Address..." + sleep 1 + else + echo "UE is now connected. IP Address settings are... $cmd" + break + fi +done + +echo "Starting iperf3 now..." + +sudo adb -s $device_id shell /data/local/tmp/iperf3 ${iperf3_args[@]} diff --git a/cmake_targets/autotests/tools/search_repl.py b/cmake_targets/autotests/tools/search_repl.py index e43feccfb373a088b8a8f5f11098be6adcac0f06..fefc142f087e00a71a6ff5e67b28953a81abb01f 100755 --- a/cmake_targets/autotests/tools/search_repl.py +++ b/cmake_targets/autotests/tools/search_repl.py @@ -54,9 +54,9 @@ file.close() if keyword == 'mme_ip_address': replacement_text = keyword + ' = ( { ' + replacement_text + ' } ) ; ' string = re.sub(r"mme_ip_address\s*=\s*\(([^\$]+?)\)\s*;", replacement_text, string, re.M) -elif keyword == 'IPV4_LIST': +elif keyword == 'IPV4_LIST' or keyword=='GUMMEI_LIST' or keyword == 'TAI_LIST': replacement_text = keyword + ' = ( ' + replacement_text + ' ) ; ' - string = re.sub(r"IPV4_LIST\s*=\s*\(([^\$]+?)\)\s*;", replacement_text, string, re.M) + string = re.sub(r"%s\s*=\s*\(([^\$]+?)\)\s*;" % keyword, 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) diff --git a/cmake_targets/build_oai b/cmake_targets/build_oai index 821b3bca274cf0f08affbbd337511e6fd015c7fa..d1306b804b3073f35c7b30a2bf8d15fbdc816793 100755 --- a/cmake_targets/build_oai +++ b/cmake_targets/build_oai @@ -45,8 +45,9 @@ MSC_GEN="False" XFORMS="True" PRINT_STATS="False" VCD_TIMING="False" -LOWLATENCY_FLAG_USER="False" -FORCE_LOWLATENCY_FLAG_USER="" +DEADLINE_SCHEDULER_FLAG_USER="False" +FORCE_DEADLINE_SCHEDULER_FLAG_USER="" +CPU_AFFINITY_FLAG_USER="True" #Only valid when lowlatecy flag is set to False REL="Rel10" HW="None" TP="None" @@ -57,6 +58,7 @@ CFLAGS_PROCESSOR_USER="" RUN_GROUP=0 TEST_CASE_GROUP="" BUILD_DOXYGEN=0 +T_TRACER="False" trap handle_ctrl_c INT function print_help() { @@ -124,7 +126,11 @@ Options --disable-deadline Disables deadline scheduler of Linux kernel (>=3.14.x). --enable-deadline - Disables deadline scheduler of Linux kernel (>=3.14.x). + Enable deadline scheduler of Linux kernel (>=3.14.x). +--disable-cpu-affinity + Disables CPU Affinity between UHD/TX/RX Threads (Valid only when deadline scheduler is disabled). By defaulT, CPU Affinity is enabled when not using deadline scheduler. It is enabled only with >2 CPUs. For eNB, CPU_0-> Device library (UHD), CPU_1->TX Threads, CPU_2...CPU_MAX->Rx Threads. For UE, CPU_0->Device Library(UHD), CPU_1..CPU_MAX -> All the UE threads +--T-tracer + Enables the T tracer. 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 @@ -256,13 +262,21 @@ function main() { echo_info "Will build doxygen support" shift;; --disable-deadline) - FORCE_LOWLATENCY_FLAG_USER="False" + FORCE_DEADLINE_SCHEDULER_FLAG_USER="False" echo_info "Disabling the usage of deadline scheduler" shift 1;; --enable-deadline) - FORCE_LOWLATENCY_FLAG_USER="True" + FORCE_DEADLINE_SCHEDULER_FLAG_USER="True" echo_info "Enabling the usage of deadline scheduler" shift 1;; + --disable-cpu-affinity) + CPU_AFFINITY_FLAG_USER="False" + echo_info "Disabling CPU Affinity (only valid when not using deadline scheduler)" + shift 1;; + --T-tracer) + T_TRACER="True" + echo_info "Enabling the T tracer" + shift 1;; -h | --help) print_help exit 1;; @@ -307,29 +321,34 @@ function main() { #By default: USRP: disable, #By default: BLADERF: enable, #By default: EXMIMO: enable - if [ "$FORCE_LOWLATENCY_FLAG_USER" = "" ]; then + if [ "$FORCE_DEADLINE_SCHEDULER_FLAG_USER" = "" ]; then if [ "$HW" = "EXMIMO" ] ; then - LOWLATENCY_FLAG_USER="True" + DEADLINE_SCHEDULER_FLAG_USER="False" elif [ "$HW" = "ETHERNET" ] ; then - LOWLATENCY_FLAG_USER="True" + DEADLINE_SCHEDULER_FLAG_USER="True" elif [ "$HW" = "OAI_USRP" ] ; then - LOWLATENCY_FLAG_USER="False" + DEADLINE_SCHEDULER_FLAG_USER="False" elif [ "$HW" = "OAI_BLADERF" ] ; then - LOWLATENCY_FLAG_USER="False" + DEADLINE_SCHEDULER_FLAG_USER="False" elif [ "$HW" = "OAI_LMSSDR" ] ; then - LOWLATENCY_FLAG_USER="False" + DEADLINE_SCHEDULER_FLAG_USER="False" elif [ "$HW" = "None" ] ; then - LOWLATENCY_FLAG_USER="False" + DEADLINE_SCHEDULER_FLAG_USER="False" else echo_error "Unknown HW type $HW. Exiting now..." exit fi else - LOWLATENCY_FLAG_USER=$FORCE_LOWLATENCY_FLAG_USER + DEADLINE_SCHEDULER_FLAG_USER=$FORCE_DEADLINE_SCHEDULER_FLAG_USER fi - echo_info "Flags for Deadline scheduler: $LOWLATENCY_FLAG_USER" + #Disable CPU Affinity for deadline scheduler + if [ "$DEADLINE_SCHEDULER_FLAG_USER" = "True" ] ; then + CPU_AFFINITY_FLAG_USER="False" + fi + echo_info "Flags for Deadline scheduler: $DEADLINE_SCHEDULER_FLAG_USER" + echo_info "Flags for CPU Affinity: $CPU_AFFINITY_FLAG_USER" ############################################ # setting and printing OAI envs, we should check here @@ -420,7 +439,9 @@ function main() { echo "set ( RF_BOARD \"${HW}\")" >> $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 "set (DEADLINE_SCHEDULER \"${DEADLINE_SCHEDULER_FLAG_USER}\" )" >>$cmake_file + echo "set (CPU_AFFINITY \"${CPU_AFFINITY_FLAG_USER}\" )" >>$cmake_file + echo "set ( T_TRACER $T_TRACER )" >> $cmake_file echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)' >> $cmake_file cd $DIR/$lte_build_dir/build cmake .. @@ -449,7 +470,7 @@ function main() { compilations \ $lte_build_dir ue_ip \ CMakeFiles/ue_ip/ue_ip.ko $dbin/ue_ip.ko - + # mkdir -p $DIR/at_commands/build # cd $DIR/at_commands/build # cmake .. @@ -472,6 +493,11 @@ function main() { # generate USIM data if [ -f $dbin/nvram ]; then install_nas_tools $dbin $dconf + echo_info "Copying UE specific part to $DIR/$lte_build_dir/build" + cp -Rvf $dbin/.ue_emm.nvram $DIR/$lte_build_dir/build + cp -Rvf $dbin/.ue.nvram $DIR/$lte_build_dir/build + cp -Rvf $dbin/.usim.nvram $DIR/$lte_build_dir/build + else echo_warning "not generated UE NAS files: binaries not found" fi @@ -549,6 +575,7 @@ function main() { echo "set ( PRINT_STATS $PRINT_STATS )" >> $cmake_file echo "set ( RRC_ASN1_VERSION \"${REL}\")" >> $cmake_file echo "set ( ENABLE_VCD_FIFO $VCD_TIMING )" >> $cmake_file + echo "set ( T_TRACER $T_TRACER )" >> $cmake_file echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)' >> $cmake_file [ "$CLEAN" = "1" ] && rm -rf $DIR/$oaisim_build_dir/build mkdir -p $DIR/$oaisim_build_dir/build @@ -614,6 +641,7 @@ function main() { echo "set(XFORMS $XFORMS )" >> $cmake_file echo "set(RRC_ASN1_VERSION \"${REL}\")" >> $cmake_file echo "set(ENABLE_VCD_FIFO $VCD_TIMING )" >> $cmake_file + echo "set ( T_TRACER $T_TRACER )" >> $cmake_file echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)' >> $cmake_file #[ "$CLEAN" = "1" ] && rm -rf $DIR/oaisim_mme_build_oai/build #mkdir -p $DIR/oaisim_mme_build_oai/build @@ -642,7 +670,9 @@ function main() { 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 "set (DEADLINE_SCHEDULER \"${DEADLINE_SCHEDULER_FLAG_USER}\" )" >>$cmake_file + echo "set (CPU_AFFINITY \"${CPU_AFFINITY_FLAG_USER}\" )" >>$cmake_file + echo "set ( T_TRACER $T_TRACER )" >> $cmake_file echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)' >> $cmake_file cd $DIR/$rrh_build_dir/build cmake .. diff --git a/cmake_targets/epc_test/CMakeLists.template b/cmake_targets/epc_test/CMakeLists.template index 8a8223e4ae66741d33bcecc4de44a98c52412068..76defbc7d7f1318602aa6c9ecbc85be4169a94ff 100644 --- a/cmake_targets/epc_test/CMakeLists.template +++ b/cmake_targets/epc_test/CMakeLists.template @@ -29,7 +29,7 @@ set ( LINUX_LIST False ) set ( LINUX True ) set ( LOCALIZATION False ) set ( LOG_NO_THREAD True ) -set ( LOWLATENCY False ) +set ( DEADLINE_SCHEDULER False ) set ( MAC_CONTEXT 1 ) set ( MAX_NUM_CCs 1 ) set ( MESSAGE_CHART_GENERATOR False) diff --git a/cmake_targets/oaisim_build_oai/CMakeLists.template b/cmake_targets/oaisim_build_oai/CMakeLists.template index 76564d8fdd77954a80dea1a63823d3c375924a72..0a05d68d10d5d6ce758e8aa17588c444632bf700 100644 --- a/cmake_targets/oaisim_build_oai/CMakeLists.template +++ b/cmake_targets/oaisim_build_oai/CMakeLists.template @@ -28,7 +28,7 @@ set ( LINUX_LIST False ) set ( LINUX True ) set ( LOCALIZATION False ) set ( LOG_NO_THREAD True ) -set ( LOWLATENCY False ) +set ( DEADLINE_SCHEDULER False ) set ( MAC_CONTEXT 1 ) set ( MAX_NUM_CCs 1 ) set ( MESSAGE_CHART_GENERATOR False) diff --git a/cmake_targets/oaisim_mme_build_oai/CMakeLists.template b/cmake_targets/oaisim_mme_build_oai/CMakeLists.template index 1035a2859958a4b9e801746529f943a6b0171851..69fa209b16d266e5a5d846facba62904bd11143b 100644 --- a/cmake_targets/oaisim_mme_build_oai/CMakeLists.template +++ b/cmake_targets/oaisim_mme_build_oai/CMakeLists.template @@ -29,7 +29,7 @@ set ( LINUX_LIST False ) set ( LINUX False ) set ( LOCALIZATION False ) set ( LOG_NO_THREAD False ) -set ( LOWLATENCY False ) +set ( DEADLINE_SCHEDULER False ) set ( MAC_CONTEXT 1 ) set ( MAX_NUM_CCs 1 ) set ( MIH_C_MEDIEVAL_EXTENSIONS False ) diff --git a/cmake_targets/oaisim_noS1_build_oai/CMakeLists.template b/cmake_targets/oaisim_noS1_build_oai/CMakeLists.template index a9055101501a3c6a5ee1212e7c8f50258274dc1b..6d8fc6d26a77c3420673b341b2ebcfec22a7fe73 100644 --- a/cmake_targets/oaisim_noS1_build_oai/CMakeLists.template +++ b/cmake_targets/oaisim_noS1_build_oai/CMakeLists.template @@ -28,7 +28,7 @@ set ( LINUX_LIST False ) set ( LINUX True ) set ( LOCALIZATION False ) set ( LOG_NO_THREAD 1 ) -set ( LOWLATENCY False ) +set ( DEADLINE_SCHEDULER False ) set ( MAC_CONTEXT 1 ) set ( MAX_NUM_CCs 1 ) set ( MESSAGE_CHART_GENERATOR False ) diff --git a/cmake_targets/s1c_mme_test/CMakeLists.template b/cmake_targets/s1c_mme_test/CMakeLists.template index 4067202df16d6036e6354b0ca4d1eff851d74576..994edf835232401dbc9f41e70ae8b8e9e47e4740 100644 --- a/cmake_targets/s1c_mme_test/CMakeLists.template +++ b/cmake_targets/s1c_mme_test/CMakeLists.template @@ -29,7 +29,7 @@ set ( LINUX_LIST False ) set ( LINUX True ) set ( LOCALIZATION False ) set ( LOG_NO_THREAD True ) -set ( LOWLATENCY False ) +set ( DEADLINE_SCHEDULER False ) set ( MAC_CONTEXT 1 ) set ( MAX_NUM_CCs 1 ) set ( MESSAGE_CHART_GENERATOR False) diff --git a/cmake_targets/tools/build_helper b/cmake_targets/tools/build_helper index a40bd8c9962d489e7a563bbde295ed93ff36f594..00f6842ffddff67bf8fb5f161dbebb7e7e359062 100755 --- a/cmake_targets/tools/build_helper +++ b/cmake_targets/tools/build_helper @@ -293,7 +293,8 @@ check_install_oai_software() { python-numpy \ sshpass \ libxslt1-dev \ - android-tools-adb + android-tools-adb \ + iperf3 $SUDO update-alternatives --set liblapack.so /usr/lib/atlas-base/atlas/liblapack.so diff --git a/cmake_targets/tools/stop_exmimo2 b/cmake_targets/tools/stop_exmimo2 index a68fdb7d57d9a4e8c1457d5bdcccd67f2e42c64d..102c9e068094e6a998a9f36339044f7214283874 100755 --- a/cmake_targets/tools/stop_exmimo2 +++ b/cmake_targets/tools/stop_exmimo2 @@ -8,8 +8,12 @@ if [ "$OPENAIR_DIR" == "" ]; then fi sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches' -#load the module -sudo -E $OPENAIR_DIR/cmake_targets/tools/init_exmimo2 +exmimo_mod=`lsmod |grep openair_rf` +#load the module only if absent to avoid kernel crashes +if [ -z "$exmimo_mod" ] +then + sudo -E $OPENAIR_DIR/cmake_targets/tools/init_exmimo2 +fi #now we stop the card from transmitting anything cd $OPENAIR_DIR/targets/bin diff --git a/common/utils/T/Makefile b/common/utils/T/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..dcb0d12fab9e638f49e812255e29cf61c058b755 --- /dev/null +++ b/common/utils/T/Makefile @@ -0,0 +1,23 @@ +CC=gcc +CFLAGS=-Wall -g + +GENIDS=genids +GENIDS_OBJS=genids.o + +all : $(GENIDS) T_messages.txt.h T_IDs.h + +$(GENIDS): $(GENIDS_OBJS) + $(CC) $(CFLAGS) -o $(GENIDS) $(GENIDS_OBJS) + +%.o: %.c + $(CC) $(CFLAGS) -c -o $@ $< + +T_messages.txt.h: T_messages.txt + xxd -i T_messages.txt > T_messages.txt.h + +T_IDs.h: $(GENIDS) T_messages.txt + ./$(GENIDS) T_messages.txt T_IDs.h + +clean: + rm -f *.o $(GENIDS) core T_IDs.h T_messages.txt.h + cd tracer && make clean diff --git a/common/utils/T/T.c b/common/utils/T/T.c new file mode 100644 index 0000000000000000000000000000000000000000..786b3722ed21c98b2734a126b077ed42a3f2295c --- /dev/null +++ b/common/utils/T/T.c @@ -0,0 +1,181 @@ +#include "T.h" +#include "T_messages.txt.h" +#include <string.h> +#include <stdlib.h> +#include <unistd.h> +#include <pthread.h> +#include <stdio.h> +#include <sys/mman.h> +#include <sys/stat.h> +#include <fcntl.h> +#include <sys/socket.h> + +#define QUIT(x) do { \ + printf("T tracer: QUIT: %s\n", x); \ + exit(1); \ +} while (0) + +/* array used to activate/disactivate a log */ +static int T_IDs[T_NUMBER_OF_IDS]; +int *T_active = T_IDs; + +static int T_socket; + +/* T_cache + * - the T macro picks up the head of freelist and marks it busy + * - the T sender thread periodically wakes up and sends what's to be sent + */ +volatile int _T_freelist_head; +volatile int *T_freelist_head = &_T_freelist_head; +T_cache_t *T_cache; + +static void get_message(int s) +{ + char t; + int l; + int id; + int is_on; + + if (read(s, &t, 1) != 1) QUIT("get_message fails"); +printf("got mess %d\n", t); + switch (t) { + case 0: + /* toggle all those IDs */ + /* optimze? (too much syscalls) */ + if (read(s, &l, sizeof(int)) != sizeof(int)) QUIT("get_message fails"); + while (l) { + if (read(s, &id, sizeof(int)) != sizeof(int)) QUIT("get_message fails"); + T_IDs[id] = 1 - T_IDs[id]; + l--; + } + break; + case 1: + /* set IDs as given */ + /* optimize? */ + if (read(s, &l, sizeof(int)) != sizeof(int)) QUIT("get_message fails"); + id = 0; + while (l) { + if (read(s, &is_on, sizeof(int)) != sizeof(int)) + QUIT("get_message fails"); + T_IDs[id] = is_on; + id++; + l--; + } + break; + case 2: break; /* do nothing, this message is to wait for local tracer */ + } +} + +static void *T_receive_thread(void *_) +{ + while (1) get_message(T_socket); + return NULL; +} + +static void new_thread(void *(*f)(void *), void *data) +{ + pthread_t t; + pthread_attr_t att; + + if (pthread_attr_init(&att)) + { fprintf(stderr, "pthread_attr_init err\n"); exit(1); } + if (pthread_attr_setdetachstate(&att, PTHREAD_CREATE_DETACHED)) + { fprintf(stderr, "pthread_attr_setdetachstate err\n"); exit(1); } + if (pthread_create(&t, &att, f, data)) + { fprintf(stderr, "pthread_create err\n"); exit(1); } + if (pthread_attr_destroy(&att)) + { fprintf(stderr, "pthread_attr_destroy err\n"); exit(1); } +} + +/* defined in local_tracer.c */ +void T_local_tracer_main(int remote_port, int wait_for_tracer, + int local_socket); + +/* We monitor the tracee and the local tracer processes. + * When one dies we forcefully kill the other. + */ +#include <sys/types.h> +#include <sys/wait.h> +static void monitor_and_kill(int child1, int child2) +{ + int child; + int status; + + child = wait(&status); + if (child == -1) perror("wait"); + kill(child1, SIGKILL); + kill(child2, SIGKILL); + exit(0); +} + +void T_init(int remote_port, int wait_for_tracer) +{ + int socket_pair[2]; + int s; + int T_shm_fd; + unsigned char *buf; + int len; + int child1, child2; + + if (socketpair(AF_UNIX, SOCK_STREAM, 0, socket_pair)) + { perror("socketpair"); abort(); } + + /* child1 runs the local tracer and child2 runs the tracee */ + + child1 = fork(); if (child1 == -1) abort(); + if (child1 == 0) { + close(socket_pair[1]); + T_local_tracer_main(remote_port, wait_for_tracer, socket_pair[0]); + exit(0); + } + close(socket_pair[0]); + + child2 = fork(); if (child2 == -1) abort(); + if (child2 != 0) { + close(socket_pair[1]); + monitor_and_kill(child1, child2); + } + + s = socket_pair[1]; + /* wait for first message - initial list of active T events */ + get_message(s); + + T_socket = s; + + /* setup shared memory */ + T_shm_fd = shm_open(T_SHM_FILENAME, O_RDWR /*| O_SYNC*/, 0666); + shm_unlink(T_SHM_FILENAME); + if (T_shm_fd == -1) { perror(T_SHM_FILENAME); abort(); } + T_cache = mmap(NULL, T_CACHE_SIZE * sizeof(T_cache_t), + PROT_READ | PROT_WRITE, MAP_SHARED, T_shm_fd, 0); + if (T_cache == NULL) + { perror(T_SHM_FILENAME); abort(); } + close(T_shm_fd); + + new_thread(T_receive_thread, NULL); + + /* trace T_message.txt + * Send several messages -1 with content followed by message -2. + * We can't use the T macro directly, events -1 and -2 are special. + */ + buf = T_messages_txt; + len = T_messages_txt_len; + while (len) { + int send_size = len; + if (send_size > T_PAYLOAD_MAXSIZE - sizeof(int)) + send_size = T_PAYLOAD_MAXSIZE - sizeof(int); + do { + T_LOCAL_DATA + T_HEADER(T_ID(-1)); + T_PUT_buffer(1, ((T_buffer){addr:(buf), length:(len)})); + T_COMMIT(); + } while (0); + buf += send_size; + len -= send_size; + } + do { + T_LOCAL_DATA + T_HEADER(T_ID(-2)); + T_COMMIT(); + } while (0); +} diff --git a/common/utils/T/T.h b/common/utils/T/T.h new file mode 100644 index 0000000000000000000000000000000000000000..a5aacb4b4f8e7ba121eb29078992e9a890740829 --- /dev/null +++ b/common/utils/T/T.h @@ -0,0 +1,574 @@ +#ifndef _T_T_T_ +#define _T_T_T_ + +#if T_TRACER + +#include <stdint.h> + +#include "T_defs.h" + +#ifdef T_SEND_TIME +#include <time.h> +#endif + +/* T message IDs */ +#include "T_IDs.h" + +/* known type - this is where you add new types */ + +#define T_INT(x) int, (x) +#define T_FLOAT(x) float, (x) +#define T_BUFFER(x, len) buffer, ((T_buffer){addr:(x), length:(len)}) +#define T_STRING(x) string, (x) +#define T_PRINTF(...) printf, (__VA_ARGS__) + +/* for each known type a T_PUT_XX macro is defined */ + +#define T_PUT_int(argnum, val) \ + do { \ + int T_PUT_var = (val); \ + T_CHECK_SIZE(sizeof(int), argnum); \ + memcpy(T_LOCAL_buf + T_LOCAL_size, &T_PUT_var, sizeof(int)); \ + T_LOCAL_size += sizeof(int); \ + } while (0) + +#define T_PUT_ulong(argnum, val) \ + do { \ + unsigned long T_PUT_var = (val); \ + T_CHECK_SIZE(sizeof(unsigned long), argnum); \ + memcpy(T_LOCAL_buf + T_LOCAL_size, &T_PUT_var, sizeof(unsigned long)); \ + T_LOCAL_size += sizeof(unsigned long); \ + } while (0) + +#define T_PUT_float(argnum, val) \ + do { \ + float T_PUT_var = (val); \ + T_CHECK_SIZE(sizeof(float), argnum); \ + memcpy(T_LOCAL_buf + T_LOCAL_size, &T_PUT_var, sizeof(float)); \ + T_LOCAL_size += sizeof(float); \ + } while (0) + +#define T_PUT_buffer(argnum, val) \ + do { \ + T_buffer T_PUT_buffer_var = (val); \ + T_PUT_int(argnum, T_PUT_buffer_var.length); \ + T_CHECK_SIZE(T_PUT_buffer_var.length, argnum); \ + memcpy(T_LOCAL_buf + T_LOCAL_size, T_PUT_buffer_var.addr, \ + T_PUT_buffer_var.length); \ + T_LOCAL_size += T_PUT_buffer_var.length; \ + } while (0) + +#define T_PUT_string(argnum, val) \ + do { \ + char *T_PUT_var = (val); \ + int T_PUT_len = strlen(T_PUT_var) + 1; \ + T_CHECK_SIZE(T_PUT_len, argnum); \ + memcpy(T_LOCAL_buf + T_LOCAL_size, T_PUT_var, T_PUT_len); \ + T_LOCAL_size += T_PUT_len; \ + } while (0) + +#define T_PUT_printf_deref(...) __VA_ARGS__ + +#define T_PUT_printf(argnum, x) \ + do { \ + int T_PUT_len = snprintf(T_LOCAL_buf + T_LOCAL_size, \ + T_BUFFER_MAX - T_LOCAL_size, T_PUT_printf_deref x); \ + if (T_PUT_len < 0) { \ + printf("%s:%d:%s: you can't read this, or can you?", \ + __FILE__, __LINE__, __FUNCTION__); \ + abort(); \ + } \ + if (T_PUT_len >= T_BUFFER_MAX - T_LOCAL_size) { \ + printf("%s:%d:%s: cannot put argument %d in T macro, not enough space" \ + ", consider increasing T_BUFFER_MAX (%d)\n", \ + __FILE__, __LINE__, __FUNCTION__, argnum, T_BUFFER_MAX); \ + abort(); \ + } \ + T_LOCAL_size += T_PUT_len + 1; \ + } while (0) + +/* structure type to detect that you pass a known type as first arg of T */ +struct T_header; + +/* to define message ID */ +#define T_ID(x) ((struct T_header *)(uintptr_t)(x)) + +/* T macro tricks */ + +#define TN(...) TN_N(__VA_ARGS__,33,32,31,30,29,28,27,26,25,24,23,22,21,\ + 20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0)(__VA_ARGS__) +#define TN_N(n0,n1,n2,n3,n4,n5,n6,n7,n8,n9,n10,n11,n12,n13,n14,n15,n16,n17,\ + n18,n19,n20,n21,n22,n23,n24,n25,n26,n27,n28,n29,n30,n31,n32,n,...) T##n +#define T(...) TN(__VA_ARGS__) + +/* type used to send arbitrary buffer data */ +typedef struct { + void *addr; + int length; +} T_buffer; + +extern volatile int *T_freelist_head; +extern T_cache_t *T_cache; + +/* used at header of Tn, allocates buffer */ +#define T_LOCAL_DATA \ + char *T_LOCAL_buf; \ + int T_LOCAL_size = 0; \ + int T_LOCAL_slot; \ + T_LOCAL_slot = __sync_fetch_and_add(T_freelist_head, 1) \ + & (T_CACHE_SIZE - 1); \ + (void)__sync_fetch_and_and(T_freelist_head, T_CACHE_SIZE - 1); \ + if (T_cache[T_LOCAL_slot].busy) { \ + printf("%s:%d:%s: T cache is full - consider increasing its size\n", \ + __FILE__, __LINE__, __FUNCTION__); \ + abort(); \ + } \ + T_LOCAL_buf = T_cache[T_LOCAL_slot].buffer; + +#define T_ACTIVE(x) T_active[(intptr_t)x] + +#define T_COMMIT() \ + T_cache[T_LOCAL_slot].length = T_LOCAL_size; \ + __sync_synchronize(); \ + T_cache[T_LOCAL_slot].busy = 1; \ + +#define T_CHECK_SIZE(len, argnum) \ + if (T_LOCAL_size + (len) > T_BUFFER_MAX) { \ + printf("%s:%d:%s: cannot put argument %d in T macro, not enough space" \ + ", consider increasing T_BUFFER_MAX (%d)\n", \ + __FILE__, __LINE__, __FUNCTION__, argnum, T_BUFFER_MAX); \ + abort(); \ + } + +#if 0 +#define T_PUT(type, var, argnum) \ + do { \ + if (T_LOCAL_size + sizeof(var) > T_BUFFER_MAX) { \ + printf("%s:%d:%s: cannot put argument %d in T macro, not enough space" \ + ", consider increasing T_BUFFER_MAX (%d)\n", \ + __FILE__, __LINE__, __FUNCTION__, argnum, T_BUFFER_MAX); \ + abort(); \ + } \ + memcpy(T_LOCAL_buf + T_LOCAL_size, &var, sizeof(var)); \ + T_LOCAL_size += sizeof(var); \ + } while (0) +#endif + +#if 0 +#define T_PROCESS(x, argnum) \ + do { \ + T_PUT(typeof(x), x, argnum); \ + } while (0) +#endif + +#if 0 +#define T_PROCESS(x, argnum) \ + do { \ + if (__builtin_types_compatible_p(typeof(x), int)) \ + { T_PUT(int, (intptr_t)(x), argnum); printf("int\n"); } \ + else if (__builtin_types_compatible_p(typeof(x), short)) \ + { T_PUT(short, (intptr_t)(x), argnum); printf("short\n"); } \ + else if (__builtin_types_compatible_p(typeof(x), float)) \ + { T_PUT(float, (x), argnum); printf("float\n"); } \ + else if (__builtin_types_compatible_p(typeof(x), char *)) \ + { T_PUT(char *, (char *)(intptr_t)(x), argnum); printf("char *\n"); } \ + else if (__builtin_types_compatible_p(typeof(x), float *)) \ + { T_PUT(float *, (float *)(intptr_t)(x), argnum); printf("float *\n"); } \ + else if (__builtin_types_compatible_p(typeof(x), void *)) \ + { T_PUT(void *, (void *)(intptr_t)(x), argnum); printf("void *\n"); } \ + else { \ + printf("%s:%d:%s: unsupported type for argument %d in T macro\n", \ + __FILE__, __LINE__, __FUNCTION__, argnum); \ + abort(); \ + } \ + } while (0) +#endif + +#ifdef T_SEND_TIME + +#define T_HEADER(x) \ + do { \ + if (!__builtin_types_compatible_p(typeof(x), struct T_header *)) { \ + printf("%s:%d:%s: " \ + "bad use of T, pass a message ID as first parameter\n", \ + __FILE__, __LINE__, __FUNCTION__); \ + abort(); \ + } \ + struct timespec T_HEADER_time; \ + if (clock_gettime(CLOCK_REALTIME, &T_HEADER_time)) abort(); \ + memcpy(T_LOCAL_buf, &T_HEADER_time, sizeof(struct timespec)); \ + T_LOCAL_size += sizeof(struct timespec); \ + T_PUT_int(1, (int)(uintptr_t)(x)); \ + } while (0) + +#else /* #ifdef T_SEND_TIME */ + +#define T_HEADER(x) \ + do { \ + if (!__builtin_types_compatible_p(typeof(x), struct T_header *)) { \ + printf("%s:%d:%s: " \ + "bad use of T, pass a message ID as first parameter\n", \ + __FILE__, __LINE__, __FUNCTION__); \ + abort(); \ + } \ + T_PUT_int(1, (int)(uintptr_t)(x)); \ + } while (0) + +#endif /* #ifdef T_SEND_TIME */ + +#define T1(t) \ + do { \ + if (T_ACTIVE(t)) { \ + T_LOCAL_DATA \ + T_HEADER(t); \ + T_COMMIT(); \ + } \ + } while (0) + +#define T3(t,t0,x0) \ + do { \ + if (T_ACTIVE(t)) { \ + T_LOCAL_DATA \ + T_HEADER(t); \ + T_PUT_##t0(2, x0); \ + T_COMMIT(); \ + } \ + } while (0) + +#define T5(t,t0,x0,t1,x1) \ + do { \ + if (T_ACTIVE(t)) { \ + T_LOCAL_DATA \ + T_HEADER(t); \ + T_PUT_##t0(2, x0); \ + T_PUT_##t1(3, x1); \ + T_COMMIT(); \ + } \ + } while (0) + +#define T7(t,t0,x0,t1,x1,t2,x2) \ + do { \ + if (T_ACTIVE(t)) { \ + T_LOCAL_DATA \ + T_HEADER(t); \ + T_PUT_##t0(2, x0); \ + T_PUT_##t1(3, x1); \ + T_PUT_##t2(4, x2); \ + T_COMMIT(); \ + } \ + } while (0) + +#define T9(t,t0,x0,t1,x1,t2,x2,t3,x3) \ + do { \ + if (T_ACTIVE(t)) { \ + T_LOCAL_DATA \ + T_HEADER(t); \ + T_PUT_##t0(2, x0); \ + T_PUT_##t1(3, x1); \ + T_PUT_##t2(4, x2); \ + T_PUT_##t3(5, x3); \ + T_COMMIT(); \ + } \ + } while (0) + +#define T11(t,t0,x0,t1,x1,t2,x2,t3,x3,t4,x4) \ + do { \ + if (T_ACTIVE(t)) { \ + T_LOCAL_DATA \ + T_HEADER(t); \ + T_PUT_##t0(2, x0); \ + T_PUT_##t1(3, x1); \ + T_PUT_##t2(4, x2); \ + T_PUT_##t3(5, x3); \ + T_PUT_##t4(6, x4); \ + T_COMMIT(); \ + } \ + } while (0) + +#define T13(t,t0,x0,t1,x1,t2,x2,t3,x3,t4,x4,t5,x5) \ + do { \ + if (T_ACTIVE(t)) { \ + T_LOCAL_DATA \ + T_HEADER(t); \ + T_PUT_##t0(2, x0); \ + T_PUT_##t1(3, x1); \ + T_PUT_##t2(4, x2); \ + T_PUT_##t3(5, x3); \ + T_PUT_##t4(6, x4); \ + T_PUT_##t5(7, x5); \ + T_COMMIT(); \ + } \ + } while (0) + +#define T15(t,t0,x0,t1,x1,t2,x2,t3,x3,t4,x4,t5,x5,t6,x6) \ + do { \ + if (T_ACTIVE(t)) { \ + T_LOCAL_DATA \ + T_HEADER(t); \ + T_PUT_##t0(2, x0); \ + T_PUT_##t1(3, x1); \ + T_PUT_##t2(4, x2); \ + T_PUT_##t3(5, x3); \ + T_PUT_##t4(6, x4); \ + T_PUT_##t5(7, x5); \ + T_PUT_##t6(8, x6); \ + T_COMMIT(); \ + } \ + } while (0) + +#define T17(t,t0,x0,t1,x1,t2,x2,t3,x3,t4,x4,t5,x5,t6,x6,t7,x7) \ + do { \ + if (T_ACTIVE(t)) { \ + T_LOCAL_DATA \ + T_HEADER(t); \ + T_PUT_##t0(2, x0); \ + T_PUT_##t1(3, x1); \ + T_PUT_##t2(4, x2); \ + T_PUT_##t3(5, x3); \ + T_PUT_##t4(6, x4); \ + T_PUT_##t5(7, x5); \ + T_PUT_##t6(8, x6); \ + T_PUT_##t7(9, x7); \ + T_COMMIT(); \ + } \ + } while (0) + +#define T19(t,t0,x0,t1,x1,t2,x2,t3,x3,t4,x4,t5,x5,t6,x6,t7,x7,t8,x8) \ + do { \ + if (T_ACTIVE(t)) { \ + T_LOCAL_DATA \ + T_HEADER(t); \ + T_PUT_##t0(2, x0); \ + T_PUT_##t1(3, x1); \ + T_PUT_##t2(4, x2); \ + T_PUT_##t3(5, x3); \ + T_PUT_##t4(6, x4); \ + T_PUT_##t5(7, x5); \ + T_PUT_##t6(8, x6); \ + T_PUT_##t7(9, x7); \ + T_PUT_##t8(10, x8); \ + T_COMMIT(); \ + } \ + } while (0) + +#define T21(t,t0,x0,t1,x1,t2,x2,t3,x3,t4,x4,t5,x5,t6,x6,t7,x7,t8,x8,t9,x9) \ + do { \ + if (T_ACTIVE(t)) { \ + T_LOCAL_DATA \ + T_HEADER(t); \ + T_PUT_##t0(2, x0); \ + T_PUT_##t1(3, x1); \ + T_PUT_##t2(4, x2); \ + T_PUT_##t3(5, x3); \ + T_PUT_##t4(6, x4); \ + T_PUT_##t5(7, x5); \ + T_PUT_##t6(8, x6); \ + T_PUT_##t7(9, x7); \ + T_PUT_##t8(10, x8); \ + T_PUT_##t9(11, x9); \ + T_COMMIT(); \ + } \ + } while (0) + +#define T23(t,t0,x0,t1,x1,t2,x2,t3,x3,t4,x4,t5,x5,t6,x6,t7,x7,t8,x8,t9,x9,t10,x10) \ + do { \ + if (T_ACTIVE(t)) { \ + T_LOCAL_DATA \ + T_HEADER(t); \ + T_PUT_##t0(2, x0); \ + T_PUT_##t1(3, x1); \ + T_PUT_##t2(4, x2); \ + T_PUT_##t3(5, x3); \ + T_PUT_##t4(6, x4); \ + T_PUT_##t5(7, x5); \ + T_PUT_##t6(8, x6); \ + T_PUT_##t7(9, x7); \ + T_PUT_##t8(10, x8); \ + T_PUT_##t9(11, x9); \ + T_PUT_##t10(12, x10); \ + T_COMMIT(); \ + } \ + } while (0) + +#define T25(t,t0,x0,t1,x1,t2,x2,t3,x3,t4,x4,t5,x5,t6,x6,t7,x7,t8,x8,t9,x9,t10,x10,t11,x11) \ + do { \ + if (T_ACTIVE(t)) { \ + T_LOCAL_DATA \ + T_HEADER(t); \ + T_PUT_##t0(2, x0); \ + T_PUT_##t1(3, x1); \ + T_PUT_##t2(4, x2); \ + T_PUT_##t3(5, x3); \ + T_PUT_##t4(6, x4); \ + T_PUT_##t5(7, x5); \ + T_PUT_##t6(8, x6); \ + T_PUT_##t7(9, x7); \ + T_PUT_##t8(10, x8); \ + T_PUT_##t9(11, x9); \ + T_PUT_##t10(12, x10); \ + T_PUT_##t11(13, x11); \ + T_COMMIT(); \ + } \ + } while (0) + +#define T27(t,t0,x0,t1,x1,t2,x2,t3,x3,t4,x4,t5,x5,t6,x6,t7,x7,t8,x8,t9,x9,t10,x10,t11,x11,t12,x12) \ + do { \ + if (T_ACTIVE(t)) { \ + T_LOCAL_DATA \ + T_HEADER(t); \ + T_PUT_##t0(2, x0); \ + T_PUT_##t1(3, x1); \ + T_PUT_##t2(4, x2); \ + T_PUT_##t3(5, x3); \ + T_PUT_##t4(6, x4); \ + T_PUT_##t5(7, x5); \ + T_PUT_##t6(8, x6); \ + T_PUT_##t7(9, x7); \ + T_PUT_##t8(10, x8); \ + T_PUT_##t9(11, x9); \ + T_PUT_##t10(12, x10); \ + T_PUT_##t11(13, x11); \ + T_PUT_##t12(14, x12); \ + T_COMMIT(); \ + } \ + } while (0) + +#define T29(t,t0,x0,t1,x1,t2,x2,t3,x3,t4,x4,t5,x5,t6,x6,t7,x7,t8,x8,t9,x9,t10,x10,t11,x11,t12,x12,t13,x13) \ + do { \ + if (T_ACTIVE(t)) { \ + T_LOCAL_DATA \ + T_HEADER(t); \ + T_PUT_##t0(2, x0); \ + T_PUT_##t1(3, x1); \ + T_PUT_##t2(4, x2); \ + T_PUT_##t3(5, x3); \ + T_PUT_##t4(6, x4); \ + T_PUT_##t5(7, x5); \ + T_PUT_##t6(8, x6); \ + T_PUT_##t7(9, x7); \ + T_PUT_##t8(10, x8); \ + T_PUT_##t9(11, x9); \ + T_PUT_##t10(12, x10); \ + T_PUT_##t11(13, x11); \ + T_PUT_##t12(14, x12); \ + T_PUT_##t13(15, x13); \ + T_COMMIT(); \ + } \ + } while (0) + +#define T31(t,t0,x0,t1,x1,t2,x2,t3,x3,t4,x4,t5,x5,t6,x6,t7,x7,t8,x8,t9,x9,t10,x10,t11,x11,t12,x12,t13,x13,t14,x14) \ + do { \ + if (T_ACTIVE(t)) { \ + T_LOCAL_DATA \ + T_HEADER(t); \ + T_PUT_##t0(2, x0); \ + T_PUT_##t1(3, x1); \ + T_PUT_##t2(4, x2); \ + T_PUT_##t3(5, x3); \ + T_PUT_##t4(6, x4); \ + T_PUT_##t5(7, x5); \ + T_PUT_##t6(8, x6); \ + T_PUT_##t7(9, x7); \ + T_PUT_##t8(10, x8); \ + T_PUT_##t9(11, x9); \ + T_PUT_##t10(12, x10); \ + T_PUT_##t11(13, x11); \ + T_PUT_##t12(14, x12); \ + T_PUT_##t13(15, x13); \ + T_PUT_##t14(16, x14); \ + T_COMMIT(); \ + } \ + } while (0) + +#define T33(t,t0,x0,t1,x1,t2,x2,t3,x3,t4,x4,t5,x5,t6,x6,t7,x7,t8,x8,t9,x9,t10,x10,t11,x11,t12,x12,t13,x13,t14,x14,t15,x15) \ + do { \ + if (T_ACTIVE(t)) { \ + T_LOCAL_DATA \ + T_HEADER(t); \ + T_PUT_##t0(2, x0); \ + T_PUT_##t1(3, x1); \ + T_PUT_##t2(4, x2); \ + T_PUT_##t3(5, x3); \ + T_PUT_##t4(6, x4); \ + T_PUT_##t5(7, x5); \ + T_PUT_##t6(8, x6); \ + T_PUT_##t7(9, x7); \ + T_PUT_##t8(10, x8); \ + T_PUT_##t9(11, x9); \ + T_PUT_##t10(12, x10); \ + T_PUT_##t11(13, x11); \ + T_PUT_##t12(14, x12); \ + T_PUT_##t13(15, x13); \ + T_PUT_##t14(16, x14); \ + T_PUT_##t15(17, x15); \ + T_COMMIT(); \ + } \ + } while (0) + +#define T_CALL_ERROR \ + do { \ + printf("%s:%d:%s: error calling T, you have to use T_INT() or T_XX()\n", \ + __FILE__, __LINE__, __FUNCTION__); \ + } while (0) + +#define T2(...) T_CALL_ERROR +#define T4(...) T_CALL_ERROR +#define T6(...) T_CALL_ERROR +#define T8(...) T_CALL_ERROR +#define T10(...) T_CALL_ERROR +#define T12(...) T_CALL_ERROR +#define T14(...) T_CALL_ERROR +#define T16(...) T_CALL_ERROR +#define T18(...) T_CALL_ERROR +#define T20(...) T_CALL_ERROR +#define T22(...) T_CALL_ERROR +#define T24(...) T_CALL_ERROR +#define T26(...) T_CALL_ERROR +#define T28(...) T_CALL_ERROR +#define T30(...) T_CALL_ERROR +#define T32(...) T_CALL_ERROR + +/* special cases for VCD logs */ + +#define T_VCD_VARIABLE(var, val) \ + do { \ + if (T_ACTIVE(((var) + VCD_FIRST_VARIABLE))) { \ + if ((var) > VCD_NUM_VARIABLES) { \ + printf("%s:%d:%s: VCD data out of synch for the T, contact" \ + " the authors!\n", __FILE__, __LINE__, __FUNCTION__); \ + abort(); \ + } \ + T_LOCAL_DATA \ + T_HEADER(T_ID((var) + VCD_FIRST_VARIABLE)); \ + T_PUT_ulong(1, (val)); \ + T_COMMIT(); \ + } \ + } while (0) + +#define T_VCD_FUNCTION(fun, val) \ + do { \ + if (T_ACTIVE(((fun) + VCD_FIRST_FUNCTION))) { \ + if ((fun) > VCD_NUM_FUNCTIONS) { \ + printf("%s:%d:%s: VCD data out of synch for the T, contact" \ + " the authors!\n", __FILE__, __LINE__, __FUNCTION__); \ + abort(); \ + } \ + T_LOCAL_DATA \ + T_HEADER(T_ID((fun) + VCD_FIRST_FUNCTION)); \ + T_PUT_int(1, (val)); \ + T_COMMIT(); \ + } \ + } while (0) + +extern int *T_active; + +void T_init(int remote_port, int wait_for_tracer); + +#else /* T_TRACER */ + +/* if T_TRACER is not defined or is 0, the T is deactivated */ +#define T(...) /**/ + +#endif /* T_TRACER */ + +#endif /* _T_T_T_ */ diff --git a/common/utils/T/T_defs.h b/common/utils/T/T_defs.h new file mode 100644 index 0000000000000000000000000000000000000000..b4fd47c0a5134f64257ef781f6a0daf9182182e9 --- /dev/null +++ b/common/utils/T/T_defs.h @@ -0,0 +1,43 @@ +#ifndef _T_defs_H_ +#define _T_defs_H_ + +/* comment (and recompile everything) to not send time in events */ +#define T_SEND_TIME + +/* maximum number of arguments for the T macro */ +#define T_MAX_ARGS 16 + +/* maximum size of a message - increase if needed */ +#define T_BUFFER_MAX (1024*64) + +/* size of the local cache for messages (must be pow(2,something)) */ +#define T_CACHE_SIZE (8192 * 2) + +/* maximum number of bytes a message can contain */ +#ifdef T_SEND_TIME +# define T_PAYLOAD_MAXSIZE (T_BUFFER_MAX-sizeof(int)-sizeof(struct timespec)) +#else +# define T_PAYLOAD_MAXSIZE (T_BUFFER_MAX-sizeof(int)) +#endif + +typedef struct { + volatile int busy; + char buffer[T_BUFFER_MAX]; + int length; +} T_cache_t; + +#define T_SHM_FILENAME "/T_shm_segment" + +/* number of VCD functions (to be kept up to date! see in T_messages.txt) */ +#define VCD_NUM_FUNCTIONS 139 + +/* number of VCD variables (to be kept up to date! see in T_messages.txt) */ +#define VCD_NUM_VARIABLES 45 + +/* first VCD function (to be kept up to date! see in T_messages.txt) */ +#define VCD_FIRST_FUNCTION ((uintptr_t)T_VCD_FUNCTION_RT_SLEEP) + +/* first VCD variable (to be kept up to date! see in T_messages.txt) */ +#define VCD_FIRST_VARIABLE ((uintptr_t)T_VCD_VARIABLE_FRAME_NUMBER_TX_ENB) + +#endif /* _T_defs_H_ */ diff --git a/common/utils/T/T_messages.txt b/common/utils/T/T_messages.txt new file mode 100644 index 0000000000000000000000000000000000000000..ab3928f419c83a61bba3ff96059ae19291544fae --- /dev/null +++ b/common/utils/T/T_messages.txt @@ -0,0 +1,1527 @@ +#general logs +ID = ENB_MASTER_TICK + DESC = eNodeB master tick - one tick per ms, to be used as "reference clock", mostly for ticktime view + GROUP = ALL:GENERAL:ENB + FORMAT = int,eNB_ID : int,frame : int,subframe + +#PHY logs +ID = ENB_UL_TICK + DESC = eNodeB uplink tick - one tick per ms at start of uplink processing + GROUP = ALL:PHY:GRAPHIC:ENB + FORMAT = int,eNB_ID : int,frame : int,subframe +ID = ENB_DL_TICK + DESC = eNodeB downlink tick - one tick per ms at start of downlink processing + GROUP = ALL:PHY:GRAPHIC:ENB + FORMAT = int,eNB_ID : int,frame : int,subframe +ID = ENB_DLSCH_UE_DCI + DESC = eNodeB downlink UE specific DCI as sent by the PHY layer + GROUP = ALL:PHY:GRAPHIC:ENB + FORMAT = int,eNB_ID : int,frame : int,subframe : int,UE_id : int,rnti : int,dci_format : int,harq_pid +ID = ENB_DLSCH_UE_ACK + DESC = eNodeB downlink UE ACK as seen by the PHY layer in process_HARQ_feedback + GROUP = ALL:PHY:GRAPHIC:ENB + FORMAT = int,eNB_ID : int,frame : int,subframe : int,UE_id : int,rnti : int,harq_pid +ID = ENB_DLSCH_UE_NACK + DESC = eNodeB downlink UE NACK as seen by the PHY layer in process_HARQ_feedback + GROUP = ALL:PHY:GRAPHIC:ENB + FORMAT = int,eNB_ID : int,frame : int,subframe : int,UE_id : int,rnti : int,harq_pid +ID = ENB_ULSCH_UE_DCI + DESC = eNodeB uplink UE specific DCI as sent by the PHY layer + GROUP = ALL:PHY:GRAPHIC:ENB + FORMAT = int,eNB_ID : int,frame : int,subframe : int,UE_id : int,rnti : int,harq_pid +ID = ENB_ULSCH_UE_NO_DCI_RETRANSMISSION + DESC = eNodeB uplink UE retransmission due to PHICH NACK (see generate_phich_top) + GROUP = ALL:PHY:GRAPHIC:ENB + FORMAT = int,eNB_ID : int,frame : int,subframe : int,UE_id : int,rnti : int,harq_pid +ID = ENB_ULSCH_UE_ACK + DESC = eNodeB uplink UE ACK as seen by the PHY layer + GROUP = ALL:PHY:GRAPHIC:ENB + FORMAT = int,eNB_ID : int,frame : int,subframe : int,UE_id : int,rnti : int,harq_pid +ID = ENB_ULSCH_UE_NACK + DESC = eNodeB uplink UE NACK as seen by the PHY layer + GROUP = ALL:PHY:GRAPHIC:ENB + FORMAT = int,eNB_ID : int,frame : int,subframe : int,UE_id : int,rnti : int,harq_pid +ID = ENB_INPUT_SIGNAL + DESC = eNodeB received signal in the time domain for a duration of 1ms + GROUP = ALL:PHY:GRAPHIC:HEAVY:ENB + FORMAT = int,eNB_ID : int,frame : int,subframe : int,antenna : buffer,rxdata +ID = ENB_UL_CHANNEL_ESTIMATE + DESC = eNodeB channel estimation in the time domain + GROUP = ALL:PHY:GRAPHIC:HEAVY:ENB + FORMAT = int,eNB_ID : int,UE_ID : int,frame : int,subframe : int,antenna : buffer,chest_t +ID = PUSCH_IQ + DESC = eNodeB PUSCH received IQ data + GROUP = ALL:PHY:GRAPHIC:HEAVY:ENB + FORMAT = int,eNB_ID : int,UE_ID : int,frame : int,subframe : int,nb_rb : buffer,pusch_comp +ID = PUCCH_1AB_IQ + DESC = eNodeB PUCCH received IQ data + GROUP = ALL:PHY:GRAPHIC:HEAVY:ENB + FORMAT = int,eNB_ID : int,UE_ID : int,frame : int,subframe : int,I : int,Q +ID = PUCCH_1_ENERGY + DESC = eNodeB PUCCH 1 energy and threshold + GROUP = ALL:PHY:GRAPHIC:HEAVY:ENB + FORMAT = int,eNB_ID : int,UE_ID : int,frame : int,subframe : int,energy : int,threshold + +#MAC logs +ID = ENB_MAC_UE_DL_SDU + DESC = MAC downlink SDU for an UE coming from RLC to MAC + GROUP = ALL:MAC:ENB + FORMAT = int,eNB_ID : int,CC_id : int,rnti : int,frame : int,subframe : int,harq_pid : int,lcid : int,length +ID = ENB_MAC_UE_UL_SCHEDULE + DESC = MAC uplink UE scheduling decision + GROUP = ALL:MAC:ENB + FORMAT = int,eNB_ID : int,CC_id : int,rnti : int,frame : int,subframe : int,harq_pid : int,mcs : int,first_rb : int,nb_rb : int,TBS +ID = ENB_MAC_UE_UL_SCHEDULE_RETRANSMISSION + DESC = MAC uplink UE scheduling retransmission decision + GROUP = ALL:MAC:ENB + FORMAT = int,eNB_ID : int,CC_id : int,rnti : int,frame : int,subframe : int,harq_pid : int,mcs : int,first_rb : int,nb_rb : int,round +ID = ENB_MAC_UE_UL_PDU + DESC = MAC uplink UE received PDU + GROUP = ALL:MAC:ENB + FORMAT = int,eNB_ID : int,CC_id : int,rnti : int,frame : int,subframe : int,harq_pid : int,sdu_length : int,num_ce : int,num_sdu +ID = ENB_MAC_UE_UL_SDU + DESC = MAC uplink UE received SDU + GROUP = ALL:MAC:ENB + FORMAT = int,eNB_ID : int,CC_id : int,rnti : int,frame : int,subframe : int,lcid : int,length +ID = ENB_MAC_UE_UL_CE + DESC = MAC uplink UE received control element + GROUP = ALL:MAC:ENB + FORMAT = int,eNB_ID : int,CC_id : int,rnti : int,frame : int,subframe : int,ce + +#RLC logs +ID = ENB_RLC_DL + DESC = RLC downlink data + GROUP = ALL:RLC:ENB + FORMAT = int,eNB_ID : int,rnti : int,rb_id : int,length +ID = ENB_RLC_UL + DESC = RLC uplink data + GROUP = ALL:RLC:ENB + FORMAT = int,eNB_ID : int,rnti : int,rb_id : int,length +ID = ENB_RLC_MAC_DL + DESC = RLC downlink data + GROUP = ALL:RLC:ENB + FORMAT = int,eNB_ID : int,rnti : int,rb_id : int,length +ID = ENB_RLC_MAC_UL + DESC = RLC uplink data + GROUP = ALL:RLC:ENB + FORMAT = int,eNB_ID : int,rnti : int,rb_id : int,length + +#PDCP logs +ID = ENB_PDCP_UL + DESC = PDCP uplink data + GROUP = ALL:PDCP:ENB + FORMAT = int,eNB_ID : int,rnti : int,rb_id : int,length +ID = ENB_PDCP_DL + DESC = PDCP uplink data + GROUP = ALL:PDCP:ENB + FORMAT = int,eNB_ID : int,rnti : int,rb_id : int,length + +#RRC logs +ID = ENB_RRC_CONNECTION_SETUP_COMPLETE + DESC = RRC connection setup complete + GROUP = ALL:RRC:ENB + FORMAT = int,eNB_ID : int,frame : int,subframe : int,rnti +ID = ENB_RRC_SECURITY_MODE_COMMAND + DESC = RRC security mode command + GROUP = ALL:RRC:ENB + FORMAT = int,eNB_ID : int,frame : int,subframe : int,rnti +ID = ENB_RRC_SECURITY_MODE_COMPLETE + DESC = RRC security mode complete + GROUP = ALL:RRC:ENB + FORMAT = int,eNB_ID : int,frame : int,subframe : int,rnti +ID = ENB_RRC_SECURITY_MODE_FAILURE + DESC = RRC security mode failure + GROUP = ALL:RRC:ENB + FORMAT = int,eNB_ID : int,frame : int,subframe : int,rnti +ID = ENB_RRC_UE_CAPABILITY_ENQUIRY + DESC = RRC UE capability enquiry + GROUP = ALL:RRC:ENB + FORMAT = int,eNB_ID : int,frame : int,subframe : int,rnti +ID = ENB_RRC_UE_CAPABILITY_INFORMATION + DESC = RRC UE capability information + GROUP = ALL:RRC:ENB + FORMAT = int,eNB_ID : int,frame : int,subframe : int,rnti +ID = ENB_RRC_CONNECTION_REQUEST + DESC = RRC connection request + GROUP = ALL:RRC:ENB + FORMAT = int,eNB_ID : int,frame : int,subframe : int,rnti +ID = ENB_RRC_CONNECTION_REJECT + DESC = RRC connection reject + GROUP = ALL:RRC:ENB + FORMAT = int,eNB_ID : int,frame : int,subframe : int,rnti +ID = ENB_RRC_CONNECTION_REESTABLISHMENT_REQUEST + DESC = RRC connection reestablishment request + GROUP = ALL:RRC:ENB + FORMAT = int,eNB_ID : int,frame : int,subframe : int,rnti +ID = ENB_RRC_CONNECTION_REESTABLISHMENT_COMPLETE + DESC = RRC connection reestablishment complete + GROUP = ALL:RRC:ENB + FORMAT = int,eNB_ID : int,frame : int,subframe : int,rnti +ID = ENB_RRC_CONNECTION_REESTABLISHMENT_REJECT + DESC = RRC connection reestablishment reject + GROUP = ALL:RRC:ENB + FORMAT = int,eNB_ID : int,frame : int,subframe : int,rnti +ID = ENB_RRC_CONNECTION_RELEASE + DESC = RRC connection release + GROUP = ALL:RRC:ENB + FORMAT = int,eNB_ID : int,frame : int,subframe : int,rnti +ID = ENB_RRC_CONNECTION_RECONFIGURATION + DESC = RRC connection reconfiguration + GROUP = ALL:RRC:ENB + FORMAT = int,eNB_ID : int,frame : int,subframe : int,rnti +ID = ENB_RRC_MEASUREMENT_REPORT + DESC = RRC measurement report + GROUP = ALL:RRC:ENB + FORMAT = int,eNB_ID : int,frame : int,subframe : int,rnti +ID = ENB_RRC_HANDOVER_PREPARATION_INFORMATION + DESC = RRC handover preparation information + GROUP = ALL:RRC:ENB + FORMAT = int,eNB_ID : int,frame : int,subframe : int,rnti +ID = ENB_RRC_CONNECTION_RECONFIGURATION_COMPLETE + DESC = RRC connection reconfiguration complete + GROUP = ALL:RRC:ENB + FORMAT = int,eNB_ID : int,frame : int,subframe : int,rnti +ID = ENB_RRC_CONNECTION_SETUP + DESC = RRC connection setup + GROUP = ALL:RRC:ENB + FORMAT = int,eNB_ID : int,frame : int,subframe : int,rnti +ID = ENB_RRC_UL_CCCH_DATA_IN + DESC = RRC uplink CCCH data in + GROUP = ALL:RRC:ENB + FORMAT = int,eNB_ID : int,frame : int,subframe : int,rnti +ID = ENB_RRC_UL_DCCH_DATA_IN + DESC = RRC uplink DCCH data in + GROUP = ALL:RRC:ENB + FORMAT = int,eNB_ID : int,frame : int,subframe : int,rnti +ID = ENB_RRC_UL_HANDOVER_PREPARATION_TRANSFER + DESC = RRC uplink handover preparation transfer + GROUP = ALL:RRC:ENB + FORMAT = int,eNB_ID : int,frame : int,subframe : int,rnti +ID = ENB_RRC_UL_INFORMATION_TRANSFER + DESC = RRC uplink information transfer + GROUP = ALL:RRC:ENB + FORMAT = int,eNB_ID : int,frame : int,subframe : int,rnti +ID = ENB_RRC_COUNTER_CHECK_RESPONSE + DESC = RRC counter check response + GROUP = ALL:RRC:ENB + FORMAT = int,eNB_ID : int,frame : int,subframe : int,rnti +ID = ENB_RRC_UE_INFORMATION_RESPONSE_R9 + DESC = RRC UE information response r9 + GROUP = ALL:RRC:ENB + FORMAT = int,eNB_ID : int,frame : int,subframe : int,rnti +ID = ENB_RRC_PROXIMITY_INDICATION_R9 + DESC = RRC proximity indication r9 + GROUP = ALL:RRC:ENB + FORMAT = int,eNB_ID : int,frame : int,subframe : int,rnti +ID = ENB_RRC_RECONFIGURATION_COMPLETE_R10 + DESC = RRC reconfiguration complete r10 + GROUP = ALL:RRC:ENB + FORMAT = int,eNB_ID : int,frame : int,subframe : int,rnti +ID = ENB_RRC_MBMS_COUNTING_RESPONSE_R10 + DESC = RRC MBMS counting response r10 + GROUP = ALL:RRC:ENB + FORMAT = int,eNB_ID : int,frame : int,subframe : int,rnti +ID = ENB_RRC_INTER_FREQ_RSTD_MEASUREMENT_INDICATION + DESC = RRC inter frequency RSTD measurement indication + GROUP = ALL:RRC:ENB + FORMAT = int,eNB_ID : int,frame : int,subframe : int,rnti +ID = ENB_RRC_UNKNOW_MESSAGE + DESC = RRC unknown message + GROUP = ALL:RRC:ENB + FORMAT = int,eNB_ID : int,frame : int,subframe : int,rnti + +#legacy logs +ID = LEGACY_MAC_INFO + DESC = MAC legacy logs - info level + GROUP = ALL:LEGACY_MAC:INFO:LEGACY + FORMAT = string,log +ID = LEGACY_MAC_ERROR + DESC = MAC legacy logs - error level + GROUP = ALL:LEGACY_MAC:ERROR:LEGACY + FORMAT = string,log +ID = LEGACY_MAC_WARNING + DESC = MAC legacy logs - warning level + GROUP = ALL:LEGACY_MAC:WARNING:LEGACY + FORMAT = string,log +ID = LEGACY_MAC_DEBUG + DESC = MAC legacy logs - debug level + GROUP = ALL:LEGACY_MAC:DEBUG:LEGACY + FORMAT = string,log +ID = LEGACY_MAC_TRACE + DESC = MAC legacy logs - trace level + GROUP = ALL:LEGACY_MAC:TRACE:LEGACY + FORMAT = string,log + +ID = LEGACY_PHY_INFO + DESC = PHY legacy logs - info level + GROUP = ALL:LEGACY_PHY:INFO:LEGACY + FORMAT = string,log +ID = LEGACY_PHY_ERROR + DESC = PHY legacy logs - error level + GROUP = ALL:LEGACY_PHY:ERROR:LEGACY + FORMAT = string,log +ID = LEGACY_PHY_WARNING + DESC = PHY legacy logs - warning level + GROUP = ALL:LEGACY_PHY:WARNING:LEGACY + FORMAT = string,log +ID = LEGACY_PHY_DEBUG + DESC = PHY legacy logs - debug level + GROUP = ALL:LEGACY_PHY:DEBUG:LEGACY + FORMAT = string,log +ID = LEGACY_PHY_TRACE + DESC = PHY legacy logs - trace level + GROUP = ALL:LEGACY_PHY:TRACE:LEGACY + FORMAT = string,log + +ID = LEGACY_S1AP_INFO + DESC = S1AP legacy logs - info level + GROUP = ALL:LEGACY_S1AP:INFO:LEGACY + FORMAT = string,log +ID = LEGACY_S1AP_ERROR + DESC = S1AP legacy logs - error level + GROUP = ALL:LEGACY_S1AP:ERROR:LEGACY + FORMAT = string,log +ID = LEGACY_S1AP_WARNING + DESC = S1AP legacy logs - warning level + GROUP = ALL:LEGACY_S1AP:WARNING:LEGACY + FORMAT = string,log +ID = LEGACY_S1AP_DEBUG + DESC = S1AP legacy logs - debug level + GROUP = ALL:LEGACY_S1AP:DEBUG:LEGACY + FORMAT = string,log +ID = LEGACY_S1AP_TRACE + DESC = S1AP legacy logs - trace level + GROUP = ALL:LEGACY_S1AP:TRACE:LEGACY + FORMAT = string,log + +ID = LEGACY_X2AP_INFO + DESC = X2AP legacy logs - info level + GROUP = ALL:LEGACY_X2AP:INFO:LEGACY + FORMAT = string,log +ID = LEGACY_X2AP_ERROR + DESC = X2AP legacy logs - error level + GROUP = ALL:LEGACY_X2AP:ERROR:LEGACY + FORMAT = string,log +ID = LEGACY_X2AP_WARNING + DESC = X2AP legacy logs - warning level + GROUP = ALL:LEGACY_X2AP:WARNING:LEGACY + FORMAT = string,log +ID = LEGACY_X2AP_DEBUG + DESC = X2AP legacy logs - debug level + GROUP = ALL:LEGACY_X2AP:DEBUG:LEGACY + FORMAT = string,log +ID = LEGACY_X2AP_TRACE + DESC = X2AP legacy logs - trace level + GROUP = ALL:LEGACY_X2AP:TRACE:LEGACY + FORMAT = string,log + +ID = LEGACY_RRC_INFO + DESC = RRC legacy logs - info level + GROUP = ALL:LEGACY_RRC:INFO:LEGACY + FORMAT = string,log +ID = LEGACY_RRC_ERROR + DESC = RRC legacy logs - error level + GROUP = ALL:LEGACY_RRC:ERROR:LEGACY + FORMAT = string,log +ID = LEGACY_RRC_WARNING + DESC = RRC legacy logs - warning level + GROUP = ALL:LEGACY_RRC:WARNING:LEGACY + FORMAT = string,log +ID = LEGACY_RRC_DEBUG + DESC = RRC legacy logs - debug level + GROUP = ALL:LEGACY_RRC:DEBUG:LEGACY + FORMAT = string,log +ID = LEGACY_RRC_TRACE + DESC = RRC legacy logs - trace level + GROUP = ALL:LEGACY_RRC:TRACE:LEGACY + FORMAT = string,log + +ID = LEGACY_RLC_INFO + DESC = RLC legacy logs - info level + GROUP = ALL:LEGACY_RLC:INFO:LEGACY + FORMAT = string,log +ID = LEGACY_RLC_ERROR + DESC = RLC legacy logs - error level + GROUP = ALL:LEGACY_RLC:ERROR:LEGACY + FORMAT = string,log +ID = LEGACY_RLC_WARNING + DESC = RLC legacy logs - warning level + GROUP = ALL:LEGACY_RLC:WARNING:LEGACY + FORMAT = string,log +ID = LEGACY_RLC_DEBUG + DESC = RLC legacy logs - debug level + GROUP = ALL:LEGACY_RLC:DEBUG:LEGACY + FORMAT = string,log +ID = LEGACY_RLC_TRACE + DESC = RLC legacy logs - trace level + GROUP = ALL:LEGACY_RLC:TRACE:LEGACY + FORMAT = string,log + +ID = LEGACY_PDCP_INFO + DESC = PDCP legacy logs - info level + GROUP = ALL:LEGACY_PDCP:INFO:LEGACY + FORMAT = string,log +ID = LEGACY_PDCP_ERROR + DESC = PDCP legacy logs - error level + GROUP = ALL:LEGACY_PDCP:ERROR:LEGACY + FORMAT = string,log +ID = LEGACY_PDCP_WARNING + DESC = PDCP legacy logs - warning level + GROUP = ALL:LEGACY_PDCP:WARNING:LEGACY + FORMAT = string,log +ID = LEGACY_PDCP_DEBUG + DESC = PDCP legacy logs - debug level + GROUP = ALL:LEGACY_PDCP:DEBUG:LEGACY + FORMAT = string,log +ID = LEGACY_PDCP_TRACE + DESC = PDCP legacy logs - trace level + GROUP = ALL:LEGACY_PDCP:TRACE:LEGACY + FORMAT = string,log + +ID = LEGACY_ENB_APP_INFO + DESC = ENB_APP legacy logs - info level + GROUP = ALL:LEGACY_ENB_APP:INFO:LEGACY + FORMAT = string,log +ID = LEGACY_ENB_APP_ERROR + DESC = ENB_APP legacy logs - error level + GROUP = ALL:LEGACY_ENB_APP:ERROR:LEGACY + FORMAT = string,log +ID = LEGACY_ENB_APP_WARNING + DESC = ENB_APP legacy logs - warning level + GROUP = ALL:LEGACY_ENB_APP:WARNING:LEGACY + FORMAT = string,log +ID = LEGACY_ENB_APP_DEBUG + DESC = ENB_APP legacy logs - debug level + GROUP = ALL:LEGACY_ENB_APP:DEBUG:LEGACY + FORMAT = string,log +ID = LEGACY_ENB_APP_TRACE + DESC = ENB_APP legacy logs - trace level + GROUP = ALL:LEGACY_ENB_APP:TRACE:LEGACY + FORMAT = string,log + +ID = LEGACY_SCTP_INFO + DESC = SCTP legacy logs - info level + GROUP = ALL:LEGACY_SCTP:INFO:LEGACY + FORMAT = string,log +ID = LEGACY_SCTP_ERROR + DESC = SCTP legacy logs - error level + GROUP = ALL:LEGACY_SCTP:ERROR:LEGACY + FORMAT = string,log +ID = LEGACY_SCTP_WARNING + DESC = SCTP legacy logs - warning level + GROUP = ALL:LEGACY_SCTP:WARNING:LEGACY + FORMAT = string,log +ID = LEGACY_SCTP_DEBUG + DESC = SCTP legacy logs - debug level + GROUP = ALL:LEGACY_SCTP:DEBUG:LEGACY + FORMAT = string,log +ID = LEGACY_SCTP_TRACE + DESC = SCTP legacy logs - trace level + GROUP = ALL:LEGACY_SCTP:TRACE:LEGACY + FORMAT = string,log + +ID = LEGACY_UDP__INFO + DESC = UDP_ legacy logs - info level + GROUP = ALL:LEGACY_UDP_:INFO:LEGACY + FORMAT = string,log +ID = LEGACY_UDP__ERROR + DESC = UDP_ legacy logs - error level + GROUP = ALL:LEGACY_UDP_:ERROR:LEGACY + FORMAT = string,log +ID = LEGACY_UDP__WARNING + DESC = UDP_ legacy logs - warning level + GROUP = ALL:LEGACY_UDP_:WARNING:LEGACY + FORMAT = string,log +ID = LEGACY_UDP__DEBUG + DESC = UDP_ legacy logs - debug level + GROUP = ALL:LEGACY_UDP_:DEBUG:LEGACY + FORMAT = string,log +ID = LEGACY_UDP__TRACE + DESC = UDP_ legacy logs - trace level + GROUP = ALL:LEGACY_UDP_:TRACE:LEGACY + FORMAT = string,log + +ID = LEGACY_NAS_INFO + DESC = NAS legacy logs - info level + GROUP = ALL:LEGACY_NAS:INFO:LEGACY + FORMAT = string,log +ID = LEGACY_NAS_ERROR + DESC = NAS legacy logs - error level + GROUP = ALL:LEGACY_NAS:ERROR:LEGACY + FORMAT = string,log +ID = LEGACY_NAS_WARNING + DESC = NAS legacy logs - warning level + GROUP = ALL:LEGACY_NAS:WARNING:LEGACY + FORMAT = string,log +ID = LEGACY_NAS_DEBUG + DESC = NAS legacy logs - debug level + GROUP = ALL:LEGACY_NAS:DEBUG:LEGACY + FORMAT = string,log +ID = LEGACY_NAS_TRACE + DESC = NAS legacy logs - trace level + GROUP = ALL:LEGACY_NAS:TRACE:LEGACY + FORMAT = string,log + +ID = LEGACY_HW_INFO + DESC = HW legacy logs - info level + GROUP = ALL:LEGACY_HW:INFO:LEGACY + FORMAT = string,log +ID = LEGACY_HW_ERROR + DESC = HW legacy logs - error level + GROUP = ALL:LEGACY_HW:ERROR:LEGACY + FORMAT = string,log +ID = LEGACY_HW_WARNING + DESC = HW legacy logs - warning level + GROUP = ALL:LEGACY_HW:WARNING:LEGACY + FORMAT = string,log +ID = LEGACY_HW_DEBUG + DESC = HW legacy logs - debug level + GROUP = ALL:LEGACY_HW:DEBUG:LEGACY + FORMAT = string,log +ID = LEGACY_HW_TRACE + DESC = HW legacy logs - trace level + GROUP = ALL:LEGACY_HW:TRACE:LEGACY + FORMAT = string,log + +ID = LEGACY_EMU_INFO + DESC = EMU legacy logs - info level + GROUP = ALL:LEGACY_EMU:INFO:LEGACY + FORMAT = string,log +ID = LEGACY_EMU_ERROR + DESC = EMU legacy logs - error level + GROUP = ALL:LEGACY_EMU:ERROR:LEGACY + FORMAT = string,log +ID = LEGACY_EMU_WARNING + DESC = EMU legacy logs - warning level + GROUP = ALL:LEGACY_EMU:WARNING:LEGACY + FORMAT = string,log +ID = LEGACY_EMU_DEBUG + DESC = EMU legacy logs - debug level + GROUP = ALL:LEGACY_EMU:DEBUG:LEGACY + FORMAT = string,log +ID = LEGACY_EMU_TRACE + DESC = EMU legacy logs - trace level + GROUP = ALL:LEGACY_EMU:TRACE:LEGACY + FORMAT = string,log + +ID = LEGACY_OTG_INFO + DESC = OTG legacy logs - info level + GROUP = ALL:LEGACY_OTG:INFO:LEGACY + FORMAT = string,log +ID = LEGACY_OTG_ERROR + DESC = OTG legacy logs - error level + GROUP = ALL:LEGACY_OTG:ERROR:LEGACY + FORMAT = string,log +ID = LEGACY_OTG_WARNING + DESC = OTG legacy logs - warning level + GROUP = ALL:LEGACY_OTG:WARNING:LEGACY + FORMAT = string,log +ID = LEGACY_OTG_DEBUG + DESC = OTG legacy logs - debug level + GROUP = ALL:LEGACY_OTG:DEBUG:LEGACY + FORMAT = string,log +ID = LEGACY_OTG_TRACE + DESC = OTG legacy logs - trace level + GROUP = ALL:LEGACY_OTG:TRACE:LEGACY + FORMAT = string,log + +ID = LEGACY_OCG_INFO + DESC = OCG legacy logs - info level + GROUP = ALL:LEGACY_OCG:INFO:LEGACY + FORMAT = string,log +ID = LEGACY_OCG_ERROR + DESC = OCG legacy logs - error level + GROUP = ALL:LEGACY_OCG:ERROR:LEGACY + FORMAT = string,log +ID = LEGACY_OCG_WARNING + DESC = OCG legacy logs - warning level + GROUP = ALL:LEGACY_OCG:WARNING:LEGACY + FORMAT = string,log +ID = LEGACY_OCG_DEBUG + DESC = OCG legacy logs - debug level + GROUP = ALL:LEGACY_OCG:DEBUG:LEGACY + FORMAT = string,log +ID = LEGACY_OCG_TRACE + DESC = OCG legacy logs - trace level + GROUP = ALL:LEGACY_OCG:TRACE:LEGACY + FORMAT = string,log + +ID = LEGACY_OCM_INFO + DESC = OCM legacy logs - info level + GROUP = ALL:LEGACY_OCM:INFO:LEGACY + FORMAT = string,log +ID = LEGACY_OCM_ERROR + DESC = OCM legacy logs - error level + GROUP = ALL:LEGACY_OCM:ERROR:LEGACY + FORMAT = string,log +ID = LEGACY_OCM_WARNING + DESC = OCM legacy logs - warning level + GROUP = ALL:LEGACY_OCM:WARNING:LEGACY + FORMAT = string,log +ID = LEGACY_OCM_DEBUG + DESC = OCM legacy logs - debug level + GROUP = ALL:LEGACY_OCM:DEBUG:LEGACY + FORMAT = string,log +ID = LEGACY_OCM_TRACE + DESC = OCM legacy logs - trace level + GROUP = ALL:LEGACY_OCM:TRACE:LEGACY + FORMAT = string,log + +ID = LEGACY_OIP_INFO + DESC = OIP legacy logs - info level + GROUP = ALL:LEGACY_OIP:INFO:LEGACY + FORMAT = string,log +ID = LEGACY_OIP_ERROR + DESC = OIP legacy logs - error level + GROUP = ALL:LEGACY_OIP:ERROR:LEGACY + FORMAT = string,log +ID = LEGACY_OIP_WARNING + DESC = OIP legacy logs - warning level + GROUP = ALL:LEGACY_OIP:WARNING:LEGACY + FORMAT = string,log +ID = LEGACY_OIP_DEBUG + DESC = OIP legacy logs - debug level + GROUP = ALL:LEGACY_OIP:DEBUG:LEGACY + FORMAT = string,log +ID = LEGACY_OIP_TRACE + DESC = OIP legacy logs - trace level + GROUP = ALL:LEGACY_OIP:TRACE:LEGACY + FORMAT = string,log + +ID = LEGACY_OMG_INFO + DESC = OMG legacy logs - info level + GROUP = ALL:LEGACY_OMG:INFO:LEGACY + FORMAT = string,log +ID = LEGACY_OMG_ERROR + DESC = OMG legacy logs - error level + GROUP = ALL:LEGACY_OMG:ERROR:LEGACY + FORMAT = string,log +ID = LEGACY_OMG_WARNING + DESC = OMG legacy logs - warning level + GROUP = ALL:LEGACY_OMG:WARNING:LEGACY + FORMAT = string,log +ID = LEGACY_OMG_DEBUG + DESC = OMG legacy logs - debug level + GROUP = ALL:LEGACY_OMG:DEBUG:LEGACY + FORMAT = string,log +ID = LEGACY_OMG_TRACE + DESC = OMG legacy logs - trace level + GROUP = ALL:LEGACY_OMG:TRACE:LEGACY + FORMAT = string,log + +ID = LEGACY_OPT_INFO + DESC = OPT legacy logs - info level + GROUP = ALL:LEGACY_OPT:INFO:LEGACY + FORMAT = string,log +ID = LEGACY_OPT_ERROR + DESC = OPT legacy logs - error level + GROUP = ALL:LEGACY_OPT:ERROR:LEGACY + FORMAT = string,log +ID = LEGACY_OPT_WARNING + DESC = OPT legacy logs - warning level + GROUP = ALL:LEGACY_OPT:WARNING:LEGACY + FORMAT = string,log +ID = LEGACY_OPT_DEBUG + DESC = OPT legacy logs - debug level + GROUP = ALL:LEGACY_OPT:DEBUG:LEGACY + FORMAT = string,log +ID = LEGACY_OPT_TRACE + DESC = OPT legacy logs - trace level + GROUP = ALL:LEGACY_OPT:TRACE:LEGACY + FORMAT = string,log + +ID = LEGACY_GTPU_INFO + DESC = GTPU legacy logs - info level + GROUP = ALL:LEGACY_GTPU:INFO:LEGACY + FORMAT = string,log +ID = LEGACY_GTPU_ERROR + DESC = GTPU legacy logs - error level + GROUP = ALL:LEGACY_GTPU:ERROR:LEGACY + FORMAT = string,log +ID = LEGACY_GTPU_WARNING + DESC = GTPU legacy logs - warning level + GROUP = ALL:LEGACY_GTPU:WARNING:LEGACY + FORMAT = string,log +ID = LEGACY_GTPU_DEBUG + DESC = GTPU legacy logs - debug level + GROUP = ALL:LEGACY_GTPU:DEBUG:LEGACY + FORMAT = string,log +ID = LEGACY_GTPU_TRACE + DESC = GTPU legacy logs - trace level + GROUP = ALL:LEGACY_GTPU:TRACE:LEGACY + FORMAT = string,log + +ID = LEGACY_TMR_INFO + DESC = TMR legacy logs - info level + GROUP = ALL:LEGACY_TMR:INFO:LEGACY + FORMAT = string,log +ID = LEGACY_TMR_ERROR + DESC = TMR legacy logs - error level + GROUP = ALL:LEGACY_TMR:ERROR:LEGACY + FORMAT = string,log +ID = LEGACY_TMR_WARNING + DESC = TMR legacy logs - warning level + GROUP = ALL:LEGACY_TMR:WARNING:LEGACY + FORMAT = string,log +ID = LEGACY_TMR_DEBUG + DESC = TMR legacy logs - debug level + GROUP = ALL:LEGACY_TMR:DEBUG:LEGACY + FORMAT = string,log +ID = LEGACY_TMR_TRACE + DESC = TMR legacy logs - trace level + GROUP = ALL:LEGACY_TMR:TRACE:LEGACY + FORMAT = string,log + +ID = LEGACY_OSA_INFO + DESC = OSA legacy logs - info level + GROUP = ALL:LEGACY_OSA:INFO:LEGACY + FORMAT = string,log +ID = LEGACY_OSA_ERROR + DESC = OSA legacy logs - error level + GROUP = ALL:LEGACY_OSA:ERROR:LEGACY + FORMAT = string,log +ID = LEGACY_OSA_WARNING + DESC = OSA legacy logs - warning level + GROUP = ALL:LEGACY_OSA:WARNING:LEGACY + FORMAT = string,log +ID = LEGACY_OSA_DEBUG + DESC = OSA legacy logs - debug level + GROUP = ALL:LEGACY_OSA:DEBUG:LEGACY + FORMAT = string,log +ID = LEGACY_OSA_TRACE + DESC = OSA legacy logs - trace level + GROUP = ALL:LEGACY_OSA:TRACE:LEGACY + FORMAT = string,log + +# this is a bad hack but I won't fix (function util_print_hex_octets +# in openairinterface5g/openair2/LAYER2/PDCP_v10.1.0/pdcp_util.c +# does funky things with the LOG_x macros but we work on the C pre-processor +# level and this funkyness is not easily dealable with, so be it...) +ID = LEGACY_component_INFO + DESC = component legacy logs - info level + GROUP = ALL:LEGACY_component:INFO:LEGACY + FORMAT = string,log +ID = LEGACY_component_ERROR + DESC = component legacy logs - error level + GROUP = ALL:LEGACY_component:ERROR:LEGACY + FORMAT = string,log +ID = LEGACY_component_WARNING + DESC = component legacy logs - warning level + GROUP = ALL:LEGACY_component:WARNING:LEGACY + FORMAT = string,log +ID = LEGACY_component_DEBUG + DESC = component legacy logs - debug level + GROUP = ALL:LEGACY_component:DEBUG:LEGACY + FORMAT = string,log +ID = LEGACY_component_TRACE + DESC = component legacy logs - trace level + GROUP = ALL:LEGACY_component:TRACE:LEGACY + FORMAT = string,log +ID = LEGACY_componentP_INFO + DESC = componentP legacy logs - info level + GROUP = ALL:LEGACY_componentP:INFO:LEGACY + FORMAT = string,log +ID = LEGACY_componentP_ERROR + DESC = componentP legacy logs - error level + GROUP = ALL:LEGACY_componentP:ERROR:LEGACY + FORMAT = string,log +ID = LEGACY_componentP_WARNING + DESC = componentP legacy logs - warning level + GROUP = ALL:LEGACY_componentP:WARNING:LEGACY + FORMAT = string,log +ID = LEGACY_componentP_DEBUG + DESC = componentP legacy logs - debug level + GROUP = ALL:LEGACY_componentP:DEBUG:LEGACY + FORMAT = string,log +ID = LEGACY_componentP_TRACE + DESC = componentP legacy logs - trace level + GROUP = ALL:LEGACY_componentP:TRACE:LEGACY + FORMAT = string,log + +#needed? +ID = LEGACY_CLI_INFO + DESC = CLI legacy logs - info level + GROUP = ALL:LEGACY_CLI:INFO:LEGACY + FORMAT = string,log +ID = LEGACY_CLI_ERROR + DESC = CLI legacy logs - error level + GROUP = ALL:LEGACY_CLI:ERROR:LEGACY + FORMAT = string,log +ID = LEGACY_CLI_WARNING + DESC = CLI legacy logs - warning level + GROUP = ALL:LEGACY_CLI:WARNING:LEGACY + FORMAT = string,log +ID = LEGACY_CLI_DEBUG + DESC = CLI legacy logs - debug level + GROUP = ALL:LEGACY_CLI:DEBUG:LEGACY + FORMAT = string,log +ID = LEGACY_CLI_TRACE + DESC = CLI legacy logs - trace level + GROUP = ALL:LEGACY_CLI:TRACE:LEGACY + FORMAT = string,log + +#for debug/test - not used +ID = first +ID = buf_test + +#VCD variables and functions + +#be careful! this must be synchronized with the code! +#also keep up to date VCD_NUM_VARIABLES and VCD_NUM_FUNCTIONS in T_defs.h + +#to synchronize: copy/paste from openair2/UTIL/LOG/vcd_signal_dumper.h +#the variables and functions name, replace "SIGNAL_DUMPER_VARIABLES" by +#"VARIABLE" and "SIGNAL_DUMPER_FUNCTIONS" by "FUNCTION" (check that +#everything is fine! for example we have +#VCD_SIGNAL_DUMPER_VARIABLE_ITTI_SEND_MSG that has VARIABLE without S) +#and then process with sed + +#to generate variables: +#sed -e "s/ VCD_VARIABLE_\(.*\)/ID = VCD_VARIABLE_\1\n DESC = VCD variable \1\n GROUP = ALL:VCD:ENB\n FORMAT = ulong,value/" < VCD >> T_messages.txt + +#to generate functions: +#sed -e "s/ VCD_FUNCTION_\(.*\)/ID = VCD_FUNCTION_\1\n DESC = VCD function \1\n GROUP = ALL:VCD:ENB\n FORMAT = int,value/" < VCD.functions >> T_messages.txt + +#you may want to manually edit groups for UE instead of eNB + +#then count functions and variables and update VCD_NUM_FUNCTIONS and +#VCD_NUM_VARIABLES in T_defs.h + +#also verify that VCD_FIRST_FUNCTION and VCD_FIRST_VARIABLE are correct +#in T_defs.h. They have to point to the first function and variable +#as defined below. Note also that the order of the VCD functions +#and variables must be the same as in the code. + +#variables + +ID = VCD_VARIABLE_FRAME_NUMBER_TX_ENB + DESC = VCD variable FRAME_NUMBER_TX_ENB + GROUP = ALL:VCD:ENB:VCD_VARIABLE + FORMAT = ulong,value +ID = VCD_VARIABLE_FRAME_NUMBER_RX_ENB + DESC = VCD variable FRAME_NUMBER_RX_ENB + GROUP = ALL:VCD:ENB:VCD_VARIABLE + FORMAT = ulong,value +ID = VCD_VARIABLE_RUNTIME_TX_ENB + DESC = VCD variable RUNTIME_TX_ENB + GROUP = ALL:VCD:ENB:VCD_VARIABLE + FORMAT = ulong,value +ID = VCD_VARIABLE_RUNTIME_RX_ENB + DESC = VCD variable RUNTIME_RX_ENB + GROUP = ALL:VCD:ENB:VCD_VARIABLE + FORMAT = ulong,value +ID = VCD_VARIABLE_FRAME_NUMBER_TX_UE + DESC = VCD variable FRAME_NUMBER_TX_UE + GROUP = ALL:VCD:UE:VCD_VARIABLE + FORMAT = ulong,value +ID = VCD_VARIABLE_FRAME_NUMBER_RX_UE + DESC = VCD variable FRAME_NUMBER_RX_UE + GROUP = ALL:VCD:UE:VCD_VARIABLE + FORMAT = ulong,value +ID = VCD_VARIABLE_SLOT_NUMBER_TX_UE + DESC = VCD variable SLOT_NUMBER_TX_UE + GROUP = ALL:VCD:UE:VCD_VARIABLE + FORMAT = ulong,value +ID = VCD_VARIABLE_SLOT_NUMBER_RX_UE + DESC = VCD variable SLOT_NUMBER_RX_UE + GROUP = ALL:VCD:UE:VCD_VARIABLE + FORMAT = ulong,value +ID = VCD_VARIABLE_SUBFRAME_NUMBER_TX_UE + DESC = VCD variable SUBFRAME_NUMBER_TX_UE + GROUP = ALL:VCD:UE:VCD_VARIABLE + FORMAT = ulong,value +ID = VCD_VARIABLE_SUBFRAME_NUMBER_RX_UE + DESC = VCD variable SUBFRAME_NUMBER_RX_UE + GROUP = ALL:VCD:UE:VCD_VARIABLE + FORMAT = ulong,value +ID = VCD_VARIABLE_MISSED_SLOTS_ENB + DESC = VCD variable MISSED_SLOTS_ENB + GROUP = ALL:VCD:ENB:VCD_VARIABLE + FORMAT = ulong,value +ID = VCD_VARIABLE_DAQ_MBOX + DESC = VCD variable DAQ_MBOX + GROUP = ALL:VCD:ENB:VCD_VARIABLE + FORMAT = ulong,value +ID = VCD_VARIABLE_UE_OFFSET_MBOX + DESC = VCD variable UE_OFFSET_MBOX + GROUP = ALL:VCD:UE:VCD_VARIABLE + FORMAT = ulong,value +ID = VCD_VARIABLE_UE_RX_OFFSET + DESC = VCD variable UE_RX_OFFSET + GROUP = ALL:VCD:UE:VCD_VARIABLE + FORMAT = ulong,value +ID = VCD_VARIABLE_DIFF + DESC = VCD variable DIFF + GROUP = ALL:VCD:ENB:VCD_VARIABLE + FORMAT = ulong,value +ID = VCD_VARIABLE_HW_SUBFRAME + DESC = VCD variable HW_SUBFRAME + GROUP = ALL:VCD:ENB:VCD_VARIABLE + FORMAT = ulong,value +ID = VCD_VARIABLE_HW_FRAME + DESC = VCD variable HW_FRAME + GROUP = ALL:VCD:ENB:VCD_VARIABLE + FORMAT = ulong,value +ID = VCD_VARIABLE_HW_SUBFRAME_RX + DESC = VCD variable HW_SUBFRAME_RX + GROUP = ALL:VCD:ENB:VCD_VARIABLE + FORMAT = ulong,value +ID = VCD_VARIABLE_HW_FRAME_RX + DESC = VCD variable HW_FRAME_RX + GROUP = ALL:VCD:ENB:VCD_VARIABLE + FORMAT = ulong,value +ID = VCD_VARIABLE_TXCNT + DESC = VCD variable TXCNT + GROUP = ALL:VCD:ENB:VCD_VARIABLE + FORMAT = ulong,value +ID = VCD_VARIABLE_RXCNT + DESC = VCD variable RXCNT + GROUP = ALL:VCD:ENB:VCD_VARIABLE + FORMAT = ulong,value +ID = VCD_VARIABLE_TRX_TS + DESC = VCD variable TRX_TS + GROUP = ALL:VCD:ENB:VCD_VARIABLE + FORMAT = ulong,value +ID = VCD_VARIABLE_TRX_TST + DESC = VCD variable TRX_TST + GROUP = ALL:VCD:ENB:VCD_VARIABLE + FORMAT = ulong,value +ID = VCD_VARIABLE_TX_TS + DESC = VCD variable TX_TS + GROUP = ALL:VCD:ENB:VCD_VARIABLE + FORMAT = ulong,value +ID = VCD_VARIABLE_RX_TS + DESC = VCD variable RX_TS + GROUP = ALL:VCD:ENB:VCD_VARIABLE + FORMAT = ulong,value +ID = VCD_VARIABLE_RX_HWCNT + DESC = VCD variable RX_HWCNT + GROUP = ALL:VCD:ENB:VCD_VARIABLE + FORMAT = ulong,value +ID = VCD_VARIABLE_RX_LHWCNT + DESC = VCD variable RX_LHWCNT + GROUP = ALL:VCD:ENB:VCD_VARIABLE + FORMAT = ulong,value +ID = VCD_VARIABLE_TX_HWCNT + DESC = VCD variable TX_HWCNT + GROUP = ALL:VCD:ENB:VCD_VARIABLE + FORMAT = ulong,value +ID = VCD_VARIABLE_TX_LHWCNT + DESC = VCD variable TX_LHWCNT + GROUP = ALL:VCD:ENB:VCD_VARIABLE + FORMAT = ulong,value +ID = VCD_VARIABLE_RX_PCK + DESC = VCD variable RX_PCK + GROUP = ALL:VCD:ENB:VCD_VARIABLE + FORMAT = ulong,value +ID = VCD_VARIABLE_TX_PCK + DESC = VCD variable TX_PCK + GROUP = ALL:VCD:ENB:VCD_VARIABLE + FORMAT = ulong,value +ID = VCD_VARIABLE_RX_SEQ_NUM + DESC = VCD variable RX_SEQ_NUM + GROUP = ALL:VCD:ENB:VCD_VARIABLE + FORMAT = ulong,value +ID = VCD_VARIABLE_RX_SEQ_NUM_PRV + DESC = VCD variable RX_SEQ_NUM_PRV + GROUP = ALL:VCD:ENB:VCD_VARIABLE + FORMAT = ulong,value +ID = VCD_VARIABLE_TX_SEQ_NUM + DESC = VCD variable TX_SEQ_NUM + GROUP = ALL:VCD:ENB:VCD_VARIABLE + FORMAT = ulong,value +ID = VCD_VARIABLE_CNT + DESC = VCD variable CNT + GROUP = ALL:VCD:ENB:VCD_VARIABLE + FORMAT = ulong,value +ID = VCD_VARIABLE_DUMMY_DUMP + DESC = VCD variable DUMMY_DUMP + GROUP = ALL:VCD:ENB:VCD_VARIABLE + FORMAT = ulong,value +ID = VCD_VARIABLE_ITTI_SEND_MSG + DESC = VCD variable ITTI_SEND_MSG + GROUP = ALL:VCD:ENB:VCD_VARIABLE + FORMAT = ulong,value +ID = VCD_VARIABLE_ITTI_POLL_MSG + DESC = VCD variable ITTI_POLL_MSG + GROUP = ALL:VCD:ENB:VCD_VARIABLE + FORMAT = ulong,value +ID = VCD_VARIABLE_ITTI_RECV_MSG + DESC = VCD variable ITTI_RECV_MSG + GROUP = ALL:VCD:ENB:VCD_VARIABLE + FORMAT = ulong,value +ID = VCD_VARIABLE_ITTI_ALLOC_MSG + DESC = VCD variable ITTI_ALLOC_MSG + GROUP = ALL:VCD:ENB:VCD_VARIABLE + FORMAT = ulong,value +ID = VCD_VARIABLE_MP_ALLOC + DESC = VCD variable MP_ALLOC + GROUP = ALL:VCD:ENB:VCD_VARIABLE + FORMAT = ulong,value +ID = VCD_VARIABLE_MP_FREE + DESC = VCD variable MP_FREE + GROUP = ALL:VCD:ENB:VCD_VARIABLE + FORMAT = ulong,value +ID = VCD_VARIABLE_UE_INST_CNT_RX + DESC = VCD variable UE_INST_CNT_RX + GROUP = ALL:VCD:UE:VCD_VARIABLE + FORMAT = ulong,value +ID = VCD_VARIABLE_UE_INST_CNT_TX + DESC = VCD variable UE_INST_CNT_TX + GROUP = ALL:VCD:UE:VCD_VARIABLE + FORMAT = ulong,value + +#functions + +ID = VCD_FUNCTION_RT_SLEEP + DESC = VCD function RT_SLEEP + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_TRX_READ + DESC = VCD function TRX_READ + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_TRX_WRITE + DESC = VCD function TRX_WRITE + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_eNB_PROC_TX0 + DESC = VCD function eNB_PROC_TX0 + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_eNB_PROC_RX0 + DESC = VCD function eNB_PROC_RX0 + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_eNB_PROC_TX1 + DESC = VCD function eNB_PROC_TX1 + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_eNB_PROC_RX1 + DESC = VCD function eNB_PROC_RX1 + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_eNB_PROC_TX2 + DESC = VCD function eNB_PROC_TX2 + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_eNB_PROC_RX2 + DESC = VCD function eNB_PROC_RX2 + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_eNB_PROC_TX3 + DESC = VCD function eNB_PROC_TX3 + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_eNB_PROC_RX3 + DESC = VCD function eNB_PROC_RX3 + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_eNB_PROC_TX4 + DESC = VCD function eNB_PROC_TX4 + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_eNB_PROC_RX4 + DESC = VCD function eNB_PROC_RX4 + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_eNB_PROC_TX5 + DESC = VCD function eNB_PROC_TX5 + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_eNB_PROC_RX5 + DESC = VCD function eNB_PROC_RX5 + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_eNB_PROC_TX6 + DESC = VCD function eNB_PROC_TX6 + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_eNB_PROC_RX6 + DESC = VCD function eNB_PROC_RX6 + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_eNB_PROC_TX7 + DESC = VCD function eNB_PROC_TX7 + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_eNB_PROC_RX7 + DESC = VCD function eNB_PROC_RX7 + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_eNB_PROC_TX8 + DESC = VCD function eNB_PROC_TX8 + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_eNB_PROC_RX8 + DESC = VCD function eNB_PROC_RX8 + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_eNB_PROC_TX9 + DESC = VCD function eNB_PROC_TX9 + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_eNB_PROC_RX9 + DESC = VCD function eNB_PROC_RX9 + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_UE_THREAD_TX + DESC = VCD function UE_THREAD_TX + GROUP = ALL:VCD:UE:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_UE_THREAD_RX + DESC = VCD function UE_THREAD_RX + GROUP = ALL:VCD:UE:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_eNB_TX + DESC = VCD function eNB_TX + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_eNB_RX + DESC = VCD function eNB_RX + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_eNB_TRX + DESC = VCD function eNB_TRX + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_eNB_TM + DESC = VCD function eNB_TM + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_eNB_RX_SLEEP + DESC = VCD function eNB_RX_SLEEP + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_eNB_TX_SLEEP + DESC = VCD function eNB_TX_SLEEP + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_eNB_PROC_SLEEP + DESC = VCD function eNB_PROC_SLEEP + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_TRX_READ_RF + DESC = VCD function TRX_READ_RF + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_TRX_WRITE_RF + DESC = VCD function TRX_WRITE_RF + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_UE_SYNCH + DESC = VCD function UE_SYNCH + GROUP = ALL:VCD:UE:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_UE_SLOT_FEP + DESC = VCD function UE_SLOT_FEP + GROUP = ALL:VCD:UE:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_UE_RRC_MEASUREMENTS + DESC = VCD function UE_RRC_MEASUREMENTS + GROUP = ALL:VCD:UE:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_UE_GAIN_CONTROL + DESC = VCD function UE_GAIN_CONTROL + GROUP = ALL:VCD:UE:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_UE_ADJUST_SYNCH + DESC = VCD function UE_ADJUST_SYNCH + GROUP = ALL:VCD:UE:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_UE_MEASUREMENT_PROCEDURES + DESC = VCD function UE_MEASUREMENT_PROCEDURES + GROUP = ALL:VCD:UE:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_UE_PDCCH_PROCEDURES + DESC = VCD function UE_PDCCH_PROCEDURES + GROUP = ALL:VCD:UE:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_UE_PBCH_PROCEDURES + DESC = VCD function UE_PBCH_PROCEDURES + GROUP = ALL:VCD:UE:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_PHY_PROCEDURES_ENB_TX + DESC = VCD function PHY_PROCEDURES_ENB_TX + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_PHY_PROCEDURES_ENB_RX + DESC = VCD function PHY_PROCEDURES_ENB_RX + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_PHY_PROCEDURES_UE_TX + DESC = VCD function PHY_PROCEDURES_UE_TX + GROUP = ALL:VCD:UE:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_PHY_PROCEDURES_UE_RX + DESC = VCD function PHY_PROCEDURES_UE_RX + GROUP = ALL:VCD:UE:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_PHY_PROCEDURES_ENB_LTE + DESC = VCD function PHY_PROCEDURES_ENB_LTE + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_PHY_PROCEDURES_UE_LTE + DESC = VCD function PHY_PROCEDURES_UE_LTE + GROUP = ALL:VCD:UE:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_PDSCH_THREAD + DESC = VCD function PDSCH_THREAD + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_DLSCH_THREAD0 + DESC = VCD function DLSCH_THREAD0 + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_DLSCH_THREAD1 + DESC = VCD function DLSCH_THREAD1 + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_DLSCH_THREAD2 + DESC = VCD function DLSCH_THREAD2 + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_DLSCH_THREAD3 + DESC = VCD function DLSCH_THREAD3 + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_DLSCH_THREAD4 + DESC = VCD function DLSCH_THREAD4 + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_DLSCH_THREAD5 + DESC = VCD function DLSCH_THREAD5 + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_DLSCH_THREAD6 + DESC = VCD function DLSCH_THREAD6 + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_DLSCH_THREAD7 + DESC = VCD function DLSCH_THREAD7 + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_DLSCH_DECODING0 + DESC = VCD function DLSCH_DECODING0 + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_DLSCH_DECODING1 + DESC = VCD function DLSCH_DECODING1 + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_DLSCH_DECODING2 + DESC = VCD function DLSCH_DECODING2 + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_DLSCH_DECODING3 + DESC = VCD function DLSCH_DECODING3 + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_DLSCH_DECODING4 + DESC = VCD function DLSCH_DECODING4 + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_DLSCH_DECODING5 + DESC = VCD function DLSCH_DECODING5 + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_DLSCH_DECODING6 + DESC = VCD function DLSCH_DECODING6 + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_DLSCH_DECODING7 + DESC = VCD function DLSCH_DECODING7 + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_RX_PDCCH + DESC = VCD function RX_PDCCH + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_DCI_DECODING + DESC = VCD function DCI_DECODING + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_RX_PHICH + DESC = VCD function RX_PHICH + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_PHY_UE_CONFIG_SIB2 + DESC = VCD function PHY_UE_CONFIG_SIB2 + GROUP = ALL:VCD:UE:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_PHY_CONFIG_SIB1_ENB + DESC = VCD function PHY_CONFIG_SIB1_ENB + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_PHY_CONFIG_SIB2_ENB + DESC = VCD function PHY_CONFIG_SIB2_ENB + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_PHY_CONFIG_DEDICATED_ENB + DESC = VCD function PHY_CONFIG_DEDICATED_ENB + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_PHY_UE_COMPUTE_PRACH + DESC = VCD function PHY_UE_COMPUTE_PRACH + GROUP = ALL:VCD:UE:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_PHY_ENB_ULSCH_DECODING + DESC = VCD function PHY_ENB_ULSCH_DECODING + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_PHY_ENB_SFGEN + DESC = VCD function PHY_ENB_SFGEN + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_PHY_ENB_PRACH_RX + DESC = VCD function PHY_ENB_PRACH_RX + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_PHY_ENB_PDCCH_TX + DESC = VCD function PHY_ENB_PDCCH_TX + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_PHY_ENB_RS_TX + DESC = VCD function PHY_ENB_RS_TX + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_UE_GENERATE_PRACH + DESC = VCD function UE_GENERATE_PRACH + GROUP = ALL:VCD:UE:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_UE_ULSCH_MODULATION + DESC = VCD function UE_ULSCH_MODULATION + GROUP = ALL:VCD:UE:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_UE_ULSCH_ENCODING + DESC = VCD function UE_ULSCH_ENCODING + GROUP = ALL:VCD:UE:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_UE_ULSCH_SCRAMBLING + DESC = VCD function UE_ULSCH_SCRAMBLING + GROUP = ALL:VCD:UE:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_ENB_DLSCH_MODULATION + DESC = VCD function ENB_DLSCH_MODULATION + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_ENB_DLSCH_ENCODING + DESC = VCD function ENB_DLSCH_ENCODING + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_ENB_DLSCH_SCRAMBLING + DESC = VCD function ENB_DLSCH_SCRAMBLING + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_MACPHY_INIT + DESC = VCD function MACPHY_INIT + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_MACPHY_EXIT + DESC = VCD function MACPHY_EXIT + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_ENB_DLSCH_ULSCH_SCHEDULER + DESC = VCD function ENB_DLSCH_ULSCH_SCHEDULER + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_FILL_RAR + DESC = VCD function FILL_RAR + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_TERMINATE_RA_PROC + DESC = VCD function TERMINATE_RA_PROC + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_INITIATE_RA_PROC + DESC = VCD function INITIATE_RA_PROC + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_CANCEL_RA_PROC + DESC = VCD function CANCEL_RA_PROC + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_GET_DCI_SDU + DESC = VCD function GET_DCI_SDU + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_GET_DLSCH_SDU + DESC = VCD function GET_DLSCH_SDU + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_RX_SDU + DESC = VCD function RX_SDU + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_MRBCH_PHY_SYNC_FAILURE + DESC = VCD function MRBCH_PHY_SYNC_FAILURE + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_SR_INDICATION + DESC = VCD function SR_INDICATION + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_DLSCH_PREPROCESSOR + DESC = VCD function DLSCH_PREPROCESSOR + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_SCHEDULE_DLSCH + DESC = VCD function SCHEDULE_DLSCH + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_FILL_DLSCH_DCI + DESC = VCD function FILL_DLSCH_DCI + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_OUT_OF_SYNC_IND + DESC = VCD function OUT_OF_SYNC_IND + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_UE_DECODE_SI + DESC = VCD function UE_DECODE_SI + GROUP = ALL:VCD:UE:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_UE_DECODE_CCCH + DESC = VCD function UE_DECODE_CCCH + GROUP = ALL:VCD:UE:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_UE_DECODE_BCCH + DESC = VCD function UE_DECODE_BCCH + GROUP = ALL:VCD:UE:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_UE_SEND_SDU + DESC = VCD function UE_SEND_SDU + GROUP = ALL:VCD:UE:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_UE_GET_SDU + DESC = VCD function UE_GET_SDU + GROUP = ALL:VCD:UE:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_UE_GET_RACH + DESC = VCD function UE_GET_RACH + GROUP = ALL:VCD:UE:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_UE_PROCESS_RAR + DESC = VCD function UE_PROCESS_RAR + GROUP = ALL:VCD:UE:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_UE_SCHEDULER + DESC = VCD function UE_SCHEDULER + GROUP = ALL:VCD:UE:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_UE_GET_SR + DESC = VCD function UE_GET_SR + GROUP = ALL:VCD:UE:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_UE_SEND_MCH_SDU + DESC = VCD function UE_SEND_MCH_SDU + GROUP = ALL:VCD:UE:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_RLC_DATA_REQ + DESC = VCD function RLC_DATA_REQ + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_MAC_RLC_STATUS_IND + DESC = VCD function MAC_RLC_STATUS_IND + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_MAC_RLC_DATA_REQ + DESC = VCD function MAC_RLC_DATA_REQ + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_MAC_RLC_DATA_IND + DESC = VCD function MAC_RLC_DATA_IND + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_RLC_UM_TRY_REASSEMBLY + DESC = VCD function RLC_UM_TRY_REASSEMBLY + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_RLC_UM_CHECK_TIMER_DAR_TIME_OUT + DESC = VCD function RLC_UM_CHECK_TIMER_DAR_TIME_OUT + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_RLC_UM_RECEIVE_PROCESS_DAR + DESC = VCD function RLC_UM_RECEIVE_PROCESS_DAR + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_PDCP_RUN + DESC = VCD function PDCP_RUN + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_PDCP_DATA_REQ + DESC = VCD function PDCP_DATA_REQ + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_PDCP_DATA_IND + DESC = VCD function PDCP_DATA_IND + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_PDCP_APPLY_SECURITY + DESC = VCD function PDCP_APPLY_SECURITY + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_PDCP_VALIDATE_SECURITY + DESC = VCD function PDCP_VALIDATE_SECURITY + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_RRC_RX_TX + DESC = VCD function RRC_RX_TX + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_RRC_MAC_CONFIG + DESC = VCD function RRC_MAC_CONFIG + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_RRC_UE_DECODE_SIB1 + DESC = VCD function RRC_UE_DECODE_SIB1 + GROUP = ALL:VCD:UE:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_RRC_UE_DECODE_SI + DESC = VCD function RRC_UE_DECODE_SI + GROUP = ALL:VCD:UE:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_GTPV1U_ENB_TASK + DESC = VCD function GTPV1U_ENB_TASK + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_GTPV1U_PROCESS_UDP_REQ + DESC = VCD function GTPV1U_PROCESS_UDP_REQ + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_GTPV1U_PROCESS_TUNNEL_DATA_REQ + DESC = VCD function GTPV1U_PROCESS_TUNNEL_DATA_REQ + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_UDP_ENB_TASK + DESC = VCD function UDP_ENB_TASK + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_EMU_TRANSPORT + DESC = VCD function EMU_TRANSPORT + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_LOG_RECORD + DESC = VCD function LOG_RECORD + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_ITTI_ENQUEUE_MESSAGE + DESC = VCD function ITTI_ENQUEUE_MESSAGE + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_ITTI_DUMP_ENQUEUE_MESSAGE + DESC = VCD function ITTI_DUMP_ENQUEUE_MESSAGE + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_ITTI_DUMP_ENQUEUE_MESSAGE_MALLOC + DESC = VCD function ITTI_DUMP_ENQUEUE_MESSAGE_MALLOC + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_ITTI_RELAY_THREAD + DESC = VCD function ITTI_RELAY_THREAD + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value +ID = VCD_FUNCTION_TEST + DESC = VCD function TEST + GROUP = ALL:VCD:ENB:VCD_FUNCTION + FORMAT = int,value diff --git a/common/utils/T/defs.h b/common/utils/T/defs.h new file mode 100644 index 0000000000000000000000000000000000000000..69b379ce0b3c3963475622ec3ed6d66b472ed97b --- /dev/null +++ b/common/utils/T/defs.h @@ -0,0 +1,30 @@ +#ifndef _TRACER_DEFS_H_ +#define _TRACER_DEFS_H_ + +/* types of plots */ +#define PLOT_VS_TIME 0 +#define PLOT_IQ_POINTS 1 +#define PLOT_MINMAX 2 + +void new_thread(void *(*f)(void *), void *data); + +/* ... is { int count; int type; char *color; } for 'nplots' plots */ +void *make_plot(int width, int height, char *title, int nplots, ...); +void plot_set(void *plot, float *data, int len, int pos, int pp); +void iq_plot_set(void *plot, short *data, int len, int pos, int pp); +void iq_plot_set_sized(void *_plot, short *data, int len, int pp); +void iq_plot_add_iq_point_loop(void *_plot, short i, short q, int pp); +void iq_plot_add_energy_point_loop(void *_plot, int e, int pp); + +/* returns an opaque pointer - truly a 'database *', see t_data.c */ +void *parse_database(char *filename); +void dump_database(void *database); +void list_ids(void *database); +void list_groups(void *database); +void on_off(void *d, char *item, int *a, int onoff); + +void *forwarder(char *ip, int port); +void forward(void *forwarder, char *buf, int size); +void forward_start_client(void *forwarder, int socket); + +#endif /* _TRACER_DEFS_H_ */ diff --git a/common/utils/T/generate_Txx.c b/common/utils/T/generate_Txx.c new file mode 100644 index 0000000000000000000000000000000000000000..a32b554a718fd27fc56cbc8249ffd5094af44cb5 --- /dev/null +++ b/common/utils/T/generate_Txx.c @@ -0,0 +1,25 @@ +#include <stdio.h> + +void print(int n) +{ + int i; + printf("#define T%d(t", n); + for(i=0; i<(n-1)/2; i++) printf(",t%d,x%d", i, i); + printf(") \\\n"); + printf(" do { \\\n"); + printf(" if (T_ACTIVE(t)) { \\\n"); + printf(" T_LOCAL_DATA \\\n"); + printf(" T_HEADER(t); \\\n"); + for(i=0; i<(n-1)/2; i++) printf(" T_PUT_##t%d(%d, x%d); \\\n", i, i+2, i); + printf(" T_COMMIT(); \\\n"); + printf(" } \\\n"); + printf(" } while (0)\n"); + printf("\n"); +} + +int main(void) +{ + int i; + for (i = 11; i <= 33; i+=2) print(i); + return 0; +} diff --git a/common/utils/T/genids.c b/common/utils/T/genids.c new file mode 100644 index 0000000000000000000000000000000000000000..734c506368ac348ba9db9ae2eae8048fcec929d6 --- /dev/null +++ b/common/utils/T/genids.c @@ -0,0 +1,155 @@ +#include <stdio.h> +#include <ctype.h> +#include <stdlib.h> +#include <string.h> +#include <unistd.h> + +char **unique_ids; +int unique_ids_size; +int unique_ids_maxsize; + +int cmp(const void *p1, const void *p2) +{ + return strcmp(*(char * const *)p1, *(char * const *)p2); +} + +/* return 1 if s was not already known, 0 if it was */ +int new_unique_id(char *s) +{ + if (unique_ids_size) + if (bsearch(&s, unique_ids, unique_ids_size, sizeof(char *), cmp) != NULL) { + printf("FATAL: ID %s is not unique\n", s); + return 0; + } + if (unique_ids_size == unique_ids_maxsize) { + unique_ids_maxsize += 256; + unique_ids = realloc(unique_ids, unique_ids_maxsize * sizeof(char *)); + if (unique_ids == NULL) { printf("out of memory\n"); abort(); } + } + unique_ids[unique_ids_size] = strdup(s); + if (unique_ids[unique_ids_size] == NULL) + { printf("out of memory\n"); abort(); } + unique_ids_size++; + qsort(unique_ids, unique_ids_size, sizeof(char *), cmp); + return 1; +} + +char *bufname; +int bufname_size; +int bufname_maxsize; + +void putname(int c) +{ + if (bufname_size == bufname_maxsize) { + bufname_maxsize += 256; + bufname = realloc(bufname, bufname_maxsize); + if (bufname == NULL) { printf("memory allocation error\n"); exit(1); } + } + bufname[bufname_size] = c; + bufname_size++; +} + +char *bufvalue; +int bufvalue_size; +int bufvalue_maxsize; + +void putvalue(int c) +{ + if (bufvalue_size == bufvalue_maxsize) { + bufvalue_maxsize += 256; + bufvalue = realloc(bufvalue, bufvalue_maxsize); + if (bufvalue == NULL) { printf("memory allocation error\n"); exit(1); } + } + bufvalue[bufvalue_size] = c; + bufvalue_size++; +} + +void smash_spaces(FILE *f) +{ + int c; + while (1) { + c = fgetc(f); + if (isspace(c)) continue; + if (c == ' ') continue; + if (c == '\t') continue; + if (c == '\n') continue; + if (c == 10 || c == 13) continue; + if (c == '#') { + while (1) { + c = fgetc(f); + if (c == '\n' || c == EOF) break; + } + continue; + } + break; + } + if (c != EOF) ungetc(c, f); +} + +void get_line(FILE *f, char **name, char **value) +{ + int c; + bufname_size = 0; + bufvalue_size = 0; + *name = NULL; + *value = NULL; + smash_spaces(f); + c = fgetc(f); + while (!(c == '=' || isspace(c) || c == EOF)) { putname(c); c = fgetc(f); } + if (c == EOF) return; + putname(0); + while (!(c == EOF || c == '=')) c = fgetc(f); + if (c == EOF) return; + smash_spaces(f); + c = fgetc(f); + while (!(c == 10 || c == 13 || c == EOF)) { putvalue(c); c = fgetc(f); } + putvalue(0); + if (bufname_size <= 1) return; + if (bufvalue_size <= 1) return; + *name = bufname; + *value = bufvalue; +} + +int main(int n, char **v) +{ + FILE *in; + FILE *out; + char *name; + char *value; + char *in_name; + char *out_name; + + if (n != 3) { printf("gimme <source> <dest>\n"); exit(1); } + + n = 0; + + in_name = v[1]; + out_name = v[2]; + + in = fopen(in_name, "r"); if (in == NULL) { perror(in_name); exit(1); } + out = fopen(out_name, "w"); if (out == NULL) { perror(out_name); exit(1); } + + fprintf(out, "/* generated file, do not edit by hand */\n\n"); + + while (1) { + get_line(in, &name, &value); + if (name == NULL) break; + printf("name '%s' value '%s'\n", name, value); + if (isspace(value[strlen(value)-1])) { + printf("bad value '%s' (no space at the end please!)\n", value); + unlink(out_name); + exit(1); + } + if (!strcmp(name, "ID")) { + if (!new_unique_id(value)) { unlink(out_name); exit(1); } + fprintf(out, "#define T_%s T_ID(%d)\n", value, n); + n++; + } + } + fprintf(out, "#define T_NUMBER_OF_IDS %d\n", n); + + fclose(in); + fclose(out); + + return 0; +} diff --git a/common/utils/T/local_tracer.c b/common/utils/T/local_tracer.c new file mode 100644 index 0000000000000000000000000000000000000000..93a56a9e3d41aa2ecd8f41aa617fe55c292c055e --- /dev/null +++ b/common/utils/T/local_tracer.c @@ -0,0 +1,344 @@ +#include <stdio.h> +#include <string.h> +#include <netinet/ip.h> +#include <arpa/inet.h> +#include <stdlib.h> +#include <unistd.h> +#include <sys/mman.h> +#include <sys/stat.h> +#include <fcntl.h> +#include <pthread.h> +#include <inttypes.h> +#include <signal.h> + +#include "T_defs.h" +#include "T_IDs.h" + +static T_cache_t *T_cache; +static int T_busylist_head; + +typedef struct databuf { + char *d; + int l; + struct databuf *next; +} databuf; + +typedef struct { + int socket_local; + volatile int socket_remote; + int remote_port; + pthread_mutex_t lock; + pthread_cond_t cond; + databuf * volatile head, *tail; + uint64_t memusage; + uint64_t last_warning_memusage; +} forward_data; + +/****************************************************************************/ +/* utility functions */ +/****************************************************************************/ + +static void new_thread(void *(*f)(void *), void *data) +{ + pthread_t t; + pthread_attr_t att; + + if (pthread_attr_init(&att)) + { fprintf(stderr, "pthread_attr_init err\n"); exit(1); } + if (pthread_attr_setdetachstate(&att, PTHREAD_CREATE_DETACHED)) + { fprintf(stderr, "pthread_attr_setdetachstate err\n"); exit(1); } + if (pthread_attr_setstacksize(&att, 10000000)) + { fprintf(stderr, "pthread_attr_setstacksize err\n"); exit(1); } + if (pthread_create(&t, &att, f, data)) + { fprintf(stderr, "pthread_create err\n"); exit(1); } + if (pthread_attr_destroy(&att)) + { fprintf(stderr, "pthread_attr_destroy err\n"); exit(1); } +} + +static int get_connection(char *addr, int port) +{ + struct sockaddr_in a; + socklen_t alen; + int s, t; + + printf("waiting for connection on %s:%d\n", addr, port); + + s = socket(AF_INET, SOCK_STREAM, 0); + if (s == -1) { perror("socket"); exit(1); } + t = 1; + if (setsockopt(s, SOL_SOCKET, SO_REUSEADDR, &t, sizeof(int))) + { perror("setsockopt"); exit(1); } + + a.sin_family = AF_INET; + a.sin_port = htons(port); + a.sin_addr.s_addr = inet_addr(addr); + + if (bind(s, (struct sockaddr *)&a, sizeof(a))) { perror("bind"); exit(1); } + if (listen(s, 5)) { perror("bind"); exit(1); } + alen = sizeof(a); + t = accept(s, (struct sockaddr *)&a, &alen); + if (t == -1) { perror("accept"); exit(1); } + close(s); + + printf("connected\n"); + + return t; +} + +/****************************************************************************/ +/* forward functions */ +/****************************************************************************/ + +static void *data_sender(void *_f) +{ + forward_data *f = _f; + databuf *cur; + char *buf, *b; + int size; + +wait: + if (pthread_mutex_lock(&f->lock)) abort(); + while (f->head == NULL) + if (pthread_cond_wait(&f->cond, &f->lock)) abort(); + cur = f->head; + buf = cur->d; + size = cur->l; + f->head = cur->next; + f->memusage -= size; + if (f->head == NULL) f->tail = NULL; + if (pthread_mutex_unlock(&f->lock)) abort(); + free(cur); + goto process; + +process: + b = buf; + if (f->socket_remote != -1) + while (size) { + int l = write(f->socket_remote, b, size); + if (l <= 0) { + printf("forward error\n"); + close(f->socket_remote); + f->socket_remote = -1; + break; + } + size -= l; + b += l; + } + + free(buf); + + goto wait; +} + +static void *forward_remote_messages(void *_f) +{ +#define PUT(x) do { \ + if (bufsize == bufmaxsize) { \ + bufmaxsize += 4096; \ + buf = realloc(buf, bufmaxsize); \ + if (buf == NULL) abort(); \ + } \ + buf[bufsize] = x; \ + bufsize++; \ + } while (0) +#define PUT_BUF(x, l) do { \ + char *zz = (char *)(x); \ + int len = l; \ + while (len) { PUT(*zz); zz++; len--; } \ + } while (0) + + forward_data *f = _f; + int from; + int to; + int l, len; + char *b; + char *buf = NULL; + int bufsize = 0; + int bufmaxsize = 0; + char t; + +again: + + while (1) { + from = f->socket_remote; + to = f->socket_local; + + bufsize = 0; + + /* let's read and process messages */ + len = read(from, &t, 1); if (len <= 0) goto dead; + PUT(t); + + switch (t) { + case 0: + case 1: + /* message 0 and 1: get a length and then 'length' numbers */ + if (read(from, &len, sizeof(int)) != sizeof(int)) goto dead; + PUT_BUF(&len, 4); + while (len) { + if (read(from, &l, sizeof(int)) != sizeof(int)) goto dead; + PUT_BUF(&l, 4); + len--; + } + break; + + case 2: break; + default: + printf("%s:%d:%s: unhandled message type %d\n", + __FILE__, __LINE__, __FUNCTION__, t); + abort(); + } + + b = buf; + while (bufsize) { + l = write(to, b, bufsize); + if (l <= 0) abort(); + bufsize -= l; + b += l; + } + } + +dead: + /* socket died, let's stop all traces and wait for another tracer */ + /* TODO: be careful with those write, they might write less than wanted */ + buf[0] = 1; + if (write(to, buf, 1) != 1) abort(); + len = T_NUMBER_OF_IDS; + if (write(to, &len, sizeof(int)) != sizeof(int)) abort(); + l = 0; + while (len) { + if (write(to, &l, sizeof(int)) != sizeof(int)) abort(); + len--; + }; + + close(f->socket_remote); + f->socket_remote = get_connection("0.0.0.0", f->remote_port); + goto again; + + return NULL; +} + +static void *forwarder(int port, int s) +{ + forward_data *f; + + f = malloc(sizeof(*f)); if (f == NULL) abort(); + + pthread_mutex_init(&f->lock, NULL); + pthread_cond_init(&f->cond, NULL); + + f->socket_local = s; + f->head = f->tail = NULL; + + f->memusage = 0; + f->last_warning_memusage = 0; + + printf("waiting for remote tracer on port %d\n", port); + + f->remote_port = port; + f->socket_remote = get_connection("0.0.0.0", port); + + new_thread(data_sender, f); + new_thread(forward_remote_messages, f); + + return f; +} + +static void forward(void *_forwarder, char *buf, int size) +{ + forward_data *f = _forwarder; + int32_t ssize = size; + databuf *new; + + new = malloc(sizeof(*new)); if (new == NULL) abort(); + + if (pthread_mutex_lock(&f->lock)) abort(); + + new->d = malloc(size + 4); if (new->d == NULL) abort(); + /* put the size of the message at the head */ + memcpy(new->d, &ssize, 4); + memcpy(new->d+4, buf, size); + new->l = size+4; + new->next = NULL; + if (f->head == NULL) f->head = new; + if (f->tail != NULL) f->tail->next = new; + f->tail = new; + + f->memusage += size+4; + /* warn every 100MB */ + if (f->memusage > f->last_warning_memusage && + f->memusage - f->last_warning_memusage > 100000000) { + f->last_warning_memusage += 100000000; + printf("WARNING: memory usage is over %"PRIu64"MB\n", + f->last_warning_memusage / 1000000); + } else + if (f->memusage < f->last_warning_memusage && + f->last_warning_memusage - f->memusage > 100000000) { + f->last_warning_memusage = (f->memusage/100000000) * 100000000; + } + + if (pthread_cond_signal(&f->cond)) abort(); + if (pthread_mutex_unlock(&f->lock)) abort(); +} + +/****************************************************************************/ +/* local functions */ +/****************************************************************************/ + +static void wait_message(void) +{ + while (T_cache[T_busylist_head].busy == 0) usleep(1000); +} + +static void init_shm(void) +{ + int i; + int s = shm_open(T_SHM_FILENAME, O_RDWR | O_CREAT /*| O_SYNC*/, 0666); + if (s == -1) { perror(T_SHM_FILENAME); abort(); } + if (ftruncate(s, T_CACHE_SIZE * sizeof(T_cache_t))) + { perror(T_SHM_FILENAME); abort(); } + T_cache = mmap(NULL, T_CACHE_SIZE * sizeof(T_cache_t), + PROT_READ | PROT_WRITE, MAP_SHARED, s, 0); + if (T_cache == NULL) + { perror(T_SHM_FILENAME); abort(); } + close(s); + + /* let's garbage the memory to catch some potential problems + * (think multiprocessor sync issues, barriers, etc.) + */ + memset(T_cache, 0x55, T_CACHE_SIZE * sizeof(T_cache_t)); + for (i = 0; i < T_CACHE_SIZE; i++) T_cache[i].busy = 0; +} + +void T_local_tracer_main(int remote_port, int wait_for_tracer, + int local_socket) +{ + int s; + int port = remote_port; + int dont_wait = wait_for_tracer ? 0 : 1; + void *f; + + /* write on a socket fails if the other end is closed and we get SIGPIPE */ + if (signal(SIGPIPE, SIG_IGN) == SIG_ERR) abort(); + + init_shm(); + s = local_socket; + + if (dont_wait) { + char t = 2; + if (write(s, &t, 1) != 1) abort(); + } + + f = forwarder(port, s); + + /* read messages */ + while (1) { + wait_message(); + __sync_synchronize(); + forward(f, T_cache[T_busylist_head].buffer, + T_cache[T_busylist_head].length); + T_cache[T_busylist_head].busy = 0; + T_busylist_head++; + T_busylist_head &= T_CACHE_SIZE - 1; + } +} diff --git a/common/utils/T/plot.c b/common/utils/T/plot.c new file mode 100644 index 0000000000000000000000000000000000000000..74473842883c7e968ecf3c84079c4645e18f2467 --- /dev/null +++ b/common/utils/T/plot.c @@ -0,0 +1,291 @@ +#include "defs.h" +#include <X11/Xlib.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <pthread.h> +#include <math.h> +#include <unistd.h> +#include <sys/select.h> +#include <stdarg.h> + +typedef struct { + float *buf; + short *iqbuf; + int count; + int type; + volatile int iq_count; /* for ULSCH IQ data */ + int iq_insert_pos; + GC g; +} data; + +typedef struct { + Display *d; + Window w; + Pixmap px; + GC bg; + int width; + int height; + pthread_mutex_t lock; + float zoom; + int timer_pipe[2]; + data *p; /* list of plots */ + int nplots; +} plot; + +static void *timer_thread(void *_p) +{ + plot *p = _p; + char c; + + while (1) { + /* more or less 10Hz */ + usleep(100*1000); + c = 1; + if (write(p->timer_pipe[1], &c, 1) != 1) abort(); + } + + return NULL; +} + +static void *plot_thread(void *_p) +{ + float v; + float *s; + int i, j; + plot *p = _p; + int redraw = 0; + int replot = 0; + fd_set rset; + int xfd = ConnectionNumber(p->d); + int maxfd = xfd > p->timer_pipe[0] ? xfd : p->timer_pipe[0]; + int pp; + + while (1) { + while (XPending(p->d)) { + XEvent e; + XNextEvent(p->d, &e); + switch (e.type) { + case ButtonPress: + /* button 4: zoom out */ + if (e.xbutton.button == 4) { p->zoom = p->zoom * 1.25; replot = 1; } + /* button 5: zoom in */ + if (e.xbutton.button == 5) { p->zoom = p->zoom * 0.8; replot = 1; } + printf("zoom: %f\n", p->zoom); + break; + case Expose: redraw = 1; break; + } + } + + if (replot == 1) { + replot = 0; + redraw = 1; + + if (pthread_mutex_lock(&p->lock)) abort(); + + XFillRectangle(p->d, p->px, p->bg, 0, 0, p->width, p->height); + + for (pp = 0; pp < p->nplots; pp++) { + if (p->p[pp].type == PLOT_MINMAX) { + s = p->p[pp].buf; + for (i = 0; i < 512; i++) { + int min = *s; + int max = *s; + for (j = 0; j < p->p[pp].count/512; j++, s++) { + if (*s < min) min = *s; + if (*s > max) max = *s; + } + XDrawLine(p->d, p->px, p->p[pp].g, i, 100-min, i, 100-max); + } + } else if (p->p[pp].type == PLOT_VS_TIME) { + for (i = 0; i < p->p[pp].count; i++) + p->p[pp].buf[i] = + 10*log10(1.0+(float)(p->p[pp].iqbuf[2*i]*p->p[pp].iqbuf[2*i]+ + p->p[pp].iqbuf[2*i+1]*p->p[pp].iqbuf[2*i+1])); + s = p->p[pp].buf; + for (i = 0; i < 512; i++) { + v = 0; + for (j = 0; j < p->p[pp].count/512; j++, s++) v += *s; + v /= p->p[pp].count/512; + XDrawLine(p->d, p->px, p->p[pp].g, i, 100, i, 100-v); + } + } else if (p->p[pp].type == PLOT_IQ_POINTS) { + XPoint pts[p->p[pp].iq_count]; + int count = p->p[pp].iq_count; + for (i = 0; i < count; i++) { + pts[i].x = p->p[pp].iqbuf[2*i]*p->zoom/20+50; + pts[i].y = -p->p[pp].iqbuf[2*i+1]*p->zoom/20+50; + } + XDrawPoints(p->d, p->px, p->p[pp].g, pts, count, CoordModeOrigin); + } + } + + if (pthread_mutex_unlock(&p->lock)) abort(); + } + + if (redraw) { + redraw = 0; + XCopyArea(p->d, p->px, p->w, DefaultGC(p->d, DefaultScreen(p->d)), + 0, 0, p->width, p->height, 0, 0); + } + + XFlush(p->d); + + FD_ZERO(&rset); + FD_SET(p->timer_pipe[0], &rset); + FD_SET(xfd, &rset); + if (select(maxfd+1, &rset, NULL, NULL, NULL) == -1) abort(); + if (FD_ISSET(p->timer_pipe[0], &rset)) { + char b[512]; + if (read(p->timer_pipe[0], b, 512) <= 0) abort(); + replot = 1; + } + } + + return NULL; +} + +void *make_plot(int width, int height, char *title, int nplots, ...) +{ + plot *p; + Display *d; + Window w; + Pixmap pm; + int i; + va_list ap; + XGCValues gcv; + + p = malloc(sizeof(*p)); if (p == NULL) abort(); + + d = XOpenDisplay(0); if (d == NULL) abort(); + w = XCreateSimpleWindow(d, DefaultRootWindow(d), 0, 0, width, height, + 0, WhitePixel(d, DefaultScreen(d)), WhitePixel(d, DefaultScreen(d))); + XSelectInput(d, w, ExposureMask | ButtonPressMask); + XMapWindow(d, w); + + { + XSetWindowAttributes att; + att.backing_store = Always; + XChangeWindowAttributes(d, w, CWBackingStore, &att); + } + + XStoreName(d, w, title); + + p->bg = XCreateGC(d, w, 0, NULL); + XCopyGC(d, DefaultGC(d, DefaultScreen(d)), -1L, p->bg); + gcv.foreground = WhitePixel(d, DefaultScreen(d)); + XChangeGC(d, p->bg, GCForeground, &gcv); + + pm = XCreatePixmap(d, w, width, height, DefaultDepth(d, DefaultScreen(d))); + + p->width = width; + p->height = height; + p->p = malloc(nplots * sizeof(data)); if (p->p == NULL) abort(); + + va_start(ap, nplots); + for (i = 0; i < nplots; i++) { + int count; + int type; + char *color; + XColor rcol, scol; + + count = va_arg(ap, int); + type = va_arg(ap, int); + color = va_arg(ap, char *); + + p->p[i].g = XCreateGC(d, w, 0, NULL); + XCopyGC(d, DefaultGC(d, DefaultScreen(d)), -1L, p->p[i].g); + if (XAllocNamedColor(d, DefaultColormap(d, DefaultScreen(d)), + color, &scol, &rcol)) { + gcv.foreground = scol.pixel; + XChangeGC(d, p->p[i].g, GCForeground, &gcv); + } else { + printf("could not allocate color '%s'\n", color); + abort(); + } + + if (type == PLOT_VS_TIME) { + p->p[i].buf = malloc(sizeof(float) * count); + if (p->p[i].buf == NULL) abort(); + p->p[i].iqbuf = malloc(sizeof(short) * count * 2); + if(p->p[i].iqbuf==NULL)abort(); + } else if (type == PLOT_MINMAX) { + p->p[i].buf = malloc(sizeof(float) * count); + if (p->p[i].buf == NULL) abort(); + p->p[i].iqbuf = NULL; + } else { + p->p[i].buf = NULL; + p->p[i].iqbuf = malloc(sizeof(short) * count * 2); + if(p->p[i].iqbuf==NULL)abort(); + } + p->p[i].count = count; + p->p[i].type = type; + p->p[i].iq_count = 0; + p->p[i].iq_insert_pos = 0; + } + va_end(ap); + + p->d = d; + p->w = w; + p->px = pm; + + p->zoom = 1; + p->nplots = nplots; + + pthread_mutex_init(&p->lock, NULL); + + if (pipe(p->timer_pipe)) abort(); + + new_thread(plot_thread, p); + new_thread(timer_thread, p); + + return p; +} + +void plot_set(void *_plot, float *data, int len, int pos, int pp) +{ + plot *p = _plot; + if (pthread_mutex_lock(&p->lock)) abort(); + memcpy(p->p[pp].buf + pos, data, len * sizeof(float)); + if (pthread_mutex_unlock(&p->lock)) abort(); +} + +void iq_plot_set(void *_plot, short *data, int count, int pos, int pp) +{ + plot *p = _plot; + if (pthread_mutex_lock(&p->lock)) abort(); + memcpy(p->p[pp].iqbuf + pos * 2, data, count * 2 * sizeof(short)); + if (pthread_mutex_unlock(&p->lock)) abort(); +} + +void iq_plot_set_sized(void *_plot, short *data, int count, int pp) +{ + plot *p = _plot; + if (pthread_mutex_lock(&p->lock)) abort(); + memcpy(p->p[pp].iqbuf, data, count * 2 * sizeof(short)); + p->p[pp].iq_count = count; + if (pthread_mutex_unlock(&p->lock)) abort(); +} + +void iq_plot_add_iq_point_loop(void *_plot, short i, short q, int pp) +{ + plot *p = _plot; + if (pthread_mutex_lock(&p->lock)) abort(); + p->p[pp].iqbuf[p->p[pp].iq_insert_pos*2] = i; + p->p[pp].iqbuf[p->p[pp].iq_insert_pos*2+1] = q; + if (p->p[pp].iq_count != p->p[pp].count) p->p[pp].iq_count++; + p->p[pp].iq_insert_pos++; + if (p->p[pp].iq_insert_pos == p->p[pp].count) p->p[pp].iq_insert_pos = 0; + if (pthread_mutex_unlock(&p->lock)) abort(); +} + +void iq_plot_add_energy_point_loop(void *_plot, int e, int pp) +{ + plot *p = _plot; + if (pthread_mutex_lock(&p->lock)) abort(); + p->p[pp].buf[p->p[pp].iq_insert_pos] = e; + if (p->p[pp].iq_count != p->p[pp].count) p->p[pp].iq_count++; + p->p[pp].iq_insert_pos++; + if (p->p[pp].iq_insert_pos == p->p[pp].count) p->p[pp].iq_insert_pos = 0; + if (pthread_mutex_unlock(&p->lock)) abort(); +} diff --git a/common/utils/T/tracee/Makefile b/common/utils/T/tracee/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..703d49d029ae914638b0c1fd2ba7e56dbc349216 --- /dev/null +++ b/common/utils/T/tracee/Makefile @@ -0,0 +1,14 @@ +CC=gcc +CFLAGS=-Wall -g -pthread -DT_TRACER -I. + +PROG=tracee +OBJS=tracee.o ../T.o + +$(PROG): $(OBJS) + $(CC) $(CFLAGS) -o $(PROG) $(OBJS) -lrt + +tracee.o: tracee.c + $(CC) $(CFLAGS) -c -o $@ $< + +clean: + rm -f *.o $(PROG) core diff --git a/common/utils/T/tracee/README b/common/utils/T/tracee/README new file mode 100644 index 0000000000000000000000000000000000000000..f18dda85ac3ad3ad2e129acc7f986893655d93dd --- /dev/null +++ b/common/utils/T/tracee/README @@ -0,0 +1 @@ +this is a very basic tracee, used to debug the tracer diff --git a/common/utils/T/tracee/tracee.c b/common/utils/T/tracee/tracee.c new file mode 100644 index 0000000000000000000000000000000000000000..86cf3012aa2df061d9596556db8e8ea7e6cd78cb --- /dev/null +++ b/common/utils/T/tracee/tracee.c @@ -0,0 +1,16 @@ +#include "../T.h" +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +int main(void) +{ + int frame = 0; + T_connect_to_tracer("127.0.0.1", 2020); + while (1) { + getchar(); + T(T_PUCCH_1AB_IQ, T_INT(0), T_INT(0), T_INT(frame), T_INT(0), T_INT(0), T_INT(0)); + frame++; + } + return 0; +} diff --git a/common/utils/T/tracer/Makefile b/common/utils/T/tracer/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..bf0f72710cd04b4c4cb4a170a1a89fa51be5f2d8 --- /dev/null +++ b/common/utils/T/tracer/Makefile @@ -0,0 +1,47 @@ +CC=gcc +CFLAGS=-Wall -g -pthread -DT_TRACER -I. + +#CFLAGS += -O3 -ffast-math -fomit-frame-pointer + +LIBS=-lX11 -lm -lpng -lXft + +all: textlog enb vcd + +textlog: utils.o textlog.o database.o event.o handler.o config.o \ + event_selector.o view/view.a gui/gui.a logger/logger.a \ + filter/filter.a + $(CC) $(CFLAGS) -o textlog $^ $(LIBS) + +enb: utils.o enb.o database.o event.o handler.o config.o \ + event_selector.o view/view.a gui/gui.a logger/logger.a \ + filter/filter.a + $(CC) $(CFLAGS) -o enb $^ $(LIBS) + +vcd: utils.o vcd.o database.o event.o handler.o config.o \ + event_selector.o view/view.a gui/gui.a logger/logger.a \ + filter/filter.a + $(CC) $(CFLAGS) -o vcd $^ $(LIBS) + +.PHONY: all gui/gui.a view/view.a logger/logger.a filter/filter.a + +gui/gui.a: + cd gui && make + +view/view.a: + cd view && make + +logger/logger.a: + cd logger && make + +filter/filter.a: + cd filter && make + +%.o: %.c + $(CC) $(CFLAGS) -c -o $@ $< + +clean: + rm -f *.o core tracer_remote textlog enb vcd + cd gui && make clean + cd view && make clean + cd logger && make clean + cd filter && make clean diff --git a/common/utils/T/tracer/config.c b/common/utils/T/tracer/config.c new file mode 100644 index 0000000000000000000000000000000000000000..f88966ed79a111b2ab2d09d7110ae9da0c3781ea --- /dev/null +++ b/common/utils/T/tracer/config.c @@ -0,0 +1,62 @@ +#include "config.h" +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +static char *local; +static int local_size; +static char *remote; +static int remote_size; + +static char *PUT(char *to, int tosize, char c) +{ + if ((tosize & 4095) == 0) { + to = realloc(to, tosize + 4096); if (to == NULL) abort(); + } + to[tosize] = c; + return to; +} + +void clear_remote_config(void) +{ + free(remote); + remote = NULL; + remote_size = 0; +} + +void append_received_config_chunk(char *buf, int length) +{ + int buflen = *(int *)buf; + if (buflen != length - sizeof(int)) { + printf("ERROR: bad trace -1, should not happen...\n"); + abort(); + } + buf += sizeof(int); + while (buflen) { + remote = PUT(remote, remote_size, *buf); + remote_size++; + buf++; + buflen--; + } +} + +void load_config_file(char *filename) +{ + int c; + FILE *f = fopen(filename, "r"); + if (f == NULL) { perror(filename); abort(); } + while (1) { + c = fgetc(f); if (c == EOF) break; + local = PUT(local, local_size, c); + local_size++; + } + fclose(f); +} + +void verify_config(void) +{ + if (local_size != remote_size || memcmp(local, remote, local_size) != 0) { + printf("ERROR: local and remote T_messages.txt not identical\n"); + abort(); + } +} diff --git a/common/utils/T/tracer/config.h b/common/utils/T/tracer/config.h new file mode 100644 index 0000000000000000000000000000000000000000..f90869eb6621f89c5be80fc012e4edc7102a4652 --- /dev/null +++ b/common/utils/T/tracer/config.h @@ -0,0 +1,9 @@ +#ifndef _CONFIG_H_ +#define _CONFIG_H_ + +void clear_remote_config(void); +void append_received_config_chunk(char *buf, int length); +void load_config_file(char *filename); +void verify_config(void); + +#endif /* _CONFIG_H_ */ diff --git a/common/utils/T/tracer/database.c b/common/utils/T/tracer/database.c new file mode 100644 index 0000000000000000000000000000000000000000..f0908948e23cb81ac2809faa14b8856f53492075 --- /dev/null +++ b/common/utils/T/tracer/database.c @@ -0,0 +1,503 @@ +#include "database.h" +#include "utils.h" +#include <stdlib.h> +#include <string.h> +#include <stdio.h> +#include <ctype.h> + +typedef struct { + char *name; + char *desc; + char **groups; + int gsize; + char **arg_type; + char **arg_name; + int asize; + int id; +} id; + +typedef struct { + char *name; + char **ids; + int size; +} group; + +typedef struct { + char *name; + id *i; + int isize; + group *g; + int gsize; + int *id_to_pos; +} database; + +typedef struct { + char *data; + int size; + int maxsize; +} buffer; + +typedef struct { + buffer name; + buffer value; +} parser; + +void put(buffer *b, int c) +{ + if (b->size == b->maxsize) { + b->maxsize += 256; + b->data = realloc(b->data, b->maxsize); + if (b->data == NULL) { printf("memory allocation error\n"); exit(1); } + } + b->data[b->size] = c; + b->size++; +} + +void smash_spaces(FILE *f) +{ + int c; + while (1) { + c = fgetc(f); + if (isspace(c)) continue; + if (c == ' ') continue; + if (c == '\t') continue; + if (c == '\n') continue; + if (c == 10 || c == 13) continue; + if (c == '#') { + while (1) { + c = fgetc(f); + if (c == '\n' || c == EOF) break; + } + continue; + } + break; + } + if (c != EOF) ungetc(c, f); +} + +void get_line(parser *p, FILE *f, char **name, char **value) +{ + int c; + p->name.size = 0; + p->value.size = 0; + *name = NULL; + *value = NULL; + smash_spaces(f); + c = fgetc(f); + while (!(c == '=' || isspace(c) || c == EOF)) + { put(&p->name, c); c = fgetc(f); } + if (c == EOF) return; + put(&p->name, 0); + while (!(c == EOF || c == '=')) c = fgetc(f); + if (c == EOF) return; + smash_spaces(f); + c = fgetc(f); + while (!(c == 10 || c == 13 || c == EOF)) + { put(&p->value, c); c = fgetc(f); } + put(&p->value, 0); + if (p->name.size <= 1) return; + if (p->value.size <= 1) return; + *name = p->name.data; + *value = p->value.data; +} + +int group_cmp(const void *_p1, const void *_p2) +{ + const group *p1 = _p1; + const group *p2 = _p2; + return strcmp(p1->name, p2->name); +} + +int id_cmp(const void *_p1, const void *_p2) +{ + const id *p1 = _p1; + const id *p2 = _p2; + return strcmp(p1->name, p2->name); +} + +int string_cmp(const void *_p1, const void *_p2) +{ + char * const *p1 = _p1; + char * const *p2 = _p2; + return strcmp(*p1, *p2); +} + +id *add_id(database *r, char *idname, int i) +{ + if (bsearch(&(id){name:idname}, r->i, r->isize, sizeof(id), id_cmp) != NULL) + { printf("ERROR: ID '%s' declared more than once\n", idname); exit(1); } + if ((r->isize & 1023) == 0) { + r->i = realloc(r->i, (r->isize + 1024) * sizeof(id)); + if (r->i == NULL) { printf("out of memory\n"); exit(1); } + } + r->i[r->isize].name = strdup(idname); + if (r->i[r->isize].name == NULL) { printf("out of memory\n"); exit(1); } + r->i[r->isize].desc = NULL; + r->i[r->isize].groups = NULL; + r->i[r->isize].gsize = 0; + r->i[r->isize].arg_type = NULL; + r->i[r->isize].arg_name = NULL; + r->i[r->isize].asize = 0; + r->i[r->isize].id = i; + r->isize++; + qsort(r->i, r->isize, sizeof(id), id_cmp); + return (id*)bsearch(&(id){name:idname}, r->i, r->isize, sizeof(id), id_cmp); +} + +group *get_group(database *r, char *group_name) +{ + group *ret; + + ret = bsearch(&(group){name:group_name}, + r->g, r->gsize, sizeof(group), group_cmp); + if (ret != NULL) return ret; + + if ((r->gsize & 1023) == 0) { + r->g = realloc(r->g, (r->gsize + 1024) * sizeof(group)); + if (r->g == NULL) abort(); + } + r->g[r->gsize].name = strdup(group_name); + if (r->g[r->gsize].name == NULL) abort(); + r->g[r->gsize].ids = NULL; + r->g[r->gsize].size = 0; + r->gsize++; + + qsort(r->g, r->gsize, sizeof(group), group_cmp); + + return bsearch(&(group){name:group_name}, + r->g, r->gsize, sizeof(group), group_cmp); +} + +void group_add_id(group *g, char *id) +{ + if ((g->size & 1023) == 0) { + g->ids = realloc(g->ids, (g->size + 1024) * sizeof(char *)); + if (g->ids == NULL) abort(); + } + g->ids[g->size] = id; + g->size++; +} + +void id_add_group(id *i, char *group) +{ + char *g = bsearch(&group, i->groups, i->gsize, sizeof(char *), string_cmp); + if (g != NULL) return; + + if ((i->gsize & 1023) == 0) { + i->groups = realloc(i->groups, (i->gsize+1024) * sizeof(char *)); + if (i->groups == NULL) abort(); + } + i->groups[i->gsize] = group; + i->gsize++; + qsort(i->groups, i->gsize, sizeof(char *), string_cmp); +} + +void add_groups(database *r, id *i, char *groups) +{ + group *g; + if (i == NULL) {printf("ERROR: GROUP line before ID line\n");exit(1);} + while (1) { + char *start = groups; + char *end = start; + while (!isspace(*end) && *end != ':' && *end != 0) end++; + if (end == start) { + printf("bad group line: groups are seperated by ':'\n"); + abort(); + } + if (*end == 0) end = NULL; else *end = 0; + + g = get_group(r, start); + group_add_id(g, i->name); + id_add_group(i, g->name); + + if (end == NULL) break; + end++; + while ((isspace(*end) || *end == ':') && *end != 0) end++; + if (*end == 0) break; + groups = end; + } +} + +void add_desc(id *i, char *desc) +{ + if (i == NULL) {printf("ERROR: DESC line before ID line\n");exit(1);} + i->desc = strdup(desc); if (i->desc == NULL) abort(); +} + +char *format_get_next_token(char **cur) +{ + char *start; + char *end; + char *ret; + + start = *cur; + + /* remove spaces */ + while (*start && isspace(*start)) start ++; + if (*start == 0) return NULL; + + /* special cases: ',' and ':' */ + if (*start == ',' || *start == ':') { end = start + 1; goto special; } + + end = start; + + /* go to end of token */ + while (*end && !isspace(*end) && *end != ',' && *end != ':') end++; + +special: + ret = malloc(end-start+1); if (ret == NULL) abort(); + memcpy(ret, start, end-start); + ret[end-start] = 0; + + *cur = end; + return ret; +} + +void add_format(id *id, char *format) +{ + char *cur = format; + char *type; + char *name; + char *sep; + while (1) { + /* parse next type/name: expected " <type> , <name> :" */ + /* get type */ + type = format_get_next_token(&cur); + if (type == NULL) break; + /* get comma */ + sep = format_get_next_token(&cur); + if (sep == NULL || strcmp(sep, ",") != 0) goto error; + free(sep); + /* get name */ + name = format_get_next_token(&cur); + if (name == NULL) goto error; + /* if there is a next token it has to be : */ + sep = format_get_next_token(&cur); + if (sep != NULL && strcmp(sep, ":") != 0) goto error; + free(sep); + + /* add type/name */ + if (id->asize % 64 == 0) { + id->arg_type = realloc(id->arg_type, (id->asize + 64) * sizeof(char *)); + if (id->arg_type == NULL) abort(); + id->arg_name = realloc(id->arg_name, (id->asize + 64) * sizeof(char *)); + if (id->arg_name == NULL) abort(); + } + id->arg_type[id->asize] = type; + id->arg_name[id->asize] = name; + id->asize++; + } + return; + +error: + printf("bad format '%s'\n", format); + abort(); +} + +void *parse_database(char *filename) +{ + FILE *in; + parser p; + database *r; + char *name, *value; + id *last_id = NULL; + int i; + + r = calloc(1, sizeof(*r)); if (r == NULL) abort(); + memset(&p, 0, sizeof(p)); + + r->name = strdup(filename); if (r->name == NULL) abort(); + + in = fopen(filename, "r"); if (in == NULL) { perror(filename); abort(); } + + i = 0; + + while (1) { + get_line(&p, in, &name, &value); + if (name == NULL) break; +//printf("%s %s\n", name, value); + if (!strcmp(name, "ID")) { last_id = add_id(r, value, i); i++; } + if (!strcmp(name, "GROUP")) add_groups(r, last_id, value); + if (!strcmp(name, "DESC")) add_desc(last_id, value); + if (!strcmp(name, "FORMAT")) add_format(last_id, value); + } + + fclose(in); + free(p.name.data); + free(p.value.data); + + /* setup id_to_pos */ + r->id_to_pos = malloc(sizeof(int) * r->isize); + if (r->id_to_pos == NULL) abort(); + for (i = 0; i < r->isize; i++) + r->id_to_pos[r->i[i].id] = i; + + return r; +} + +void dump_database(void *_d) +{ + database *d = _d; + int i; + + printf("database %s: %d IDs, %d GROUPs\n", d->name, d->isize, d->gsize); + for (i = 0; i < d->isize; i++) { + int j; + printf("ID %s [%s] [in %d group%s]\n", + d->i[i].name, d->i[i].desc ? d->i[i].desc : "", + d->i[i].gsize, d->i[i].gsize > 1 ? "s" : ""); + for (j = 0; j < d->i[i].gsize; j++) + printf(" in GROUP: %s\n", d->i[i].groups[j]); + if (d->i[i].asize == 0) printf(" no FORMAT\n"); + else { + int j; + printf(" FORMAT: "); + for (j = 0; j < d->i[i].asize; j++) + printf("'%s' , '%s' %s", d->i[i].arg_type[j], d->i[i].arg_name[j], + j == d->i[i].asize-1 ? "" : " : "); + printf("\n"); + } + } + for (i = 0; i < d->gsize; i++) { + int j; + printf("GROUP %s [size %d]\n", d->g[i].name, d->g[i].size); + for (j = 0; j < d->g[i].size; j++) + printf(" contains ID: %s\n", d->g[i].ids[j]); + } +} + +void list_ids(void *_d) +{ + database *d = _d; + int i; + for (i = 0; i < d->isize; i++) printf("%s\n", d->i[i].name); +} + +void list_groups(void *_d) +{ + database *d = _d; + int i; + for (i = 0; i < d->gsize; i++) printf("%s\n", d->g[i].name); +} + +static int onoff_id(database *d, char *name, int *a, int onoff) +{ + id *i; + i = bsearch(&(id){name:name}, d->i, d->isize, sizeof(id), id_cmp); + if (i == NULL) return 0; + a[i->id] = onoff; + printf("turning %s %s\n", onoff ? "ON" : "OFF", name); + return 1; +} + +static int onoff_group(database *d, char *name, int *a, int onoff) +{ + group *g; + int i; + g = bsearch(&(group){name:name}, d->g, d->gsize, sizeof(group), group_cmp); + if (g == NULL) return 0; + for (i = 0; i < g->size; i++) onoff_id(d, g->ids[i], a, onoff); + return 1; +} + +void on_off(void *_d, char *item, int *a, int onoff) +{ + int done; + database *d = _d; + int i; + if (item == NULL) { + for (i = 0; i < d->isize; i++) a[i] = onoff; + printf("turning %s all traces\n", onoff ? "ON" : "OFF"); + return; + } + done = onoff_group(d, item, a, onoff); + done += onoff_id(d, item, a, onoff); + if (done == 0) { + printf("ERROR: ID/group '%s' not found in database\n", item); + exit(1); + } +} + +char *event_name_from_id(void *_database, int id) +{ + database *d = _database; + return d->i[d->id_to_pos[id]].name; +} + +int event_id_from_name(void *_database, char *name) +{ + database *d = _database; + id *i = (id*)bsearch(&(id){name:name}, d->i, d->isize, sizeof(id), id_cmp); + if (i == NULL) + { printf("%s:%d: '%s' not found\n", __FILE__, __LINE__, name); abort(); } + return i->id; +} + +database_event_format get_format(void *_database, int event_id) +{ + database *d = _database; + database_event_format ret; + + if (event_id < 0 || event_id >= d->isize) { + printf("%s:%d: bad event ID (%d)\n", __FILE__, __LINE__, event_id); + abort(); + } + + ret.type = d->i[d->id_to_pos[event_id]].arg_type; + ret.name = d->i[d->id_to_pos[event_id]].arg_name; + ret.count = d->i[d->id_to_pos[event_id]].asize; + + return ret; +} + +int number_of_ids(void *_d) +{ + database *d = _d; + return d->isize; +} + +int database_get_ids(void *_d, char ***ids) +{ + database *d = _d; + int i; + *ids = malloc(d->isize * sizeof(char **)); if (*ids == NULL) abort(); + for (i = 0; i < d->isize; i++) (*ids)[i] = d->i[i].name; + return d->isize; +} + +int database_get_groups(void *_d, char ***groups) +{ + database *d = _d; + int i; + *groups = malloc(d->gsize * sizeof(char **)); if (*groups == NULL) abort(); + for (i = 0; i < d->gsize; i++) (*groups)[i] = d->g[i].name; + return d->gsize; +} + +int database_pos_to_id(void *_d, int pos) +{ + database *d = _d; + return d->i[pos].id; +} + +void database_get_generic_description(void *_d, int id, + char **name, char **desc) +{ + database *d = _d; + int pos = d->id_to_pos[id]; + OBUF o; + int i; + *name = strdup(d->i[pos].name); if (*name == NULL) abort(); + o.osize = o.omaxsize = 0; + o.obuf = NULL; + PUTS(&o, *name); + for (i = 0; i < d->i[pos].asize; i++) { + PUTC(&o, ' '); + PUTS(&o, d->i[pos].arg_name[i]); + PUTS(&o, " ["); + PUTS(&o, d->i[pos].arg_name[i]); + PUTS(&o, "]"); + } + PUTC(&o, 0); + *desc = o.obuf; +} diff --git a/common/utils/T/tracer/database.h b/common/utils/T/tracer/database.h new file mode 100644 index 0000000000000000000000000000000000000000..c5cab05d9f7be0da0cc8d50fcf3fda243aec556a --- /dev/null +++ b/common/utils/T/tracer/database.h @@ -0,0 +1,31 @@ +#ifndef _DATABASE_H_ +#define _DATABASE_H_ + +/* returns an opaque pointer - truly a 'database *', see database.c */ +void *parse_database(char *filename); +void dump_database(void *database); +void list_ids(void *database); +void list_groups(void *database); +void on_off(void *d, char *item, int *a, int onoff); +char *event_name_from_id(void *database, int id); +int event_id_from_name(void *database, char *name); +int number_of_ids(void *database); +int database_get_ids(void *database, char ***ids); +int database_get_groups(void *database, char ***groups); +int database_pos_to_id(void *database, int pos); +void database_get_generic_description(void *database, int id, + char **name, char **desc); + +/****************************************************************************/ +/* get format of an event */ +/****************************************************************************/ + +typedef struct { + char **type; + char **name; + int count; +} database_event_format; + +database_event_format get_format(void *database, int event_id); + +#endif /* _DATABASE_H_ */ diff --git a/common/utils/T/tracer/defs.h b/common/utils/T/tracer/defs.h new file mode 100644 index 0000000000000000000000000000000000000000..443fabdde8423ed744d1739f54acc82cef1c5c50 --- /dev/null +++ b/common/utils/T/tracer/defs.h @@ -0,0 +1,24 @@ +#ifndef _TRACER_DEFS_H_ +#define _TRACER_DEFS_H_ + +/* types of plots */ +#define PLOT_VS_TIME 0 +#define PLOT_IQ_POINTS 1 +#define PLOT_MINMAX 2 + +void new_thread(void *(*f)(void *), void *data); + +/* ... is { int count; int type; char *color; } for 'nplots' plots */ +void *make_plot(int width, int height, char *title, int nplots, ...); +void plot_set(void *plot, float *data, int len, int pos, int pp); +void iq_plot_set(void *plot, short *data, int len, int pos, int pp); +void iq_plot_set_sized(void *_plot, short *data, int len, int pp); +void iq_plot_add_iq_point_loop(void *_plot, short i, short q, int pp); +void iq_plot_add_energy_point_loop(void *_plot, int e, int pp); + +/* T gui functions */ +void t_gui_start(void); +void t_gui_set_input_signal(int eNB, int frame, int subframe, int antenna, + int size, void *buf); + +#endif /* _TRACER_DEFS_H_ */ diff --git a/common/utils/T/tracer/enb.c b/common/utils/T/tracer/enb.c new file mode 100644 index 0000000000000000000000000000000000000000..8e8f3d8e7277844028d50c2951974e1363cb098d --- /dev/null +++ b/common/utils/T/tracer/enb.c @@ -0,0 +1,573 @@ +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <unistd.h> +#include <pthread.h> +#include <signal.h> +#include "database.h" +#include "event.h" +#include "handler.h" +#include "logger/logger.h" +#include "view/view.h" +#include "gui/gui.h" +#include "filter/filter.h" +#include "utils.h" +#include "../T_defs.h" +#include "event_selector.h" +#include "openair_logo.h" +#include "config.h" + +typedef struct { + view *phyview; + view *macview; + view *rlcview; + view *pdcpview; + view *rrcview; + view *legacy; +} enb_gui; + +typedef struct { + int socket; + int *is_on; + int nevents; + pthread_mutex_t lock; +} enb_data; + +#define DEFAULT_REMOTE_IP "127.0.0.1" +#define DEFAULT_REMOTE_PORT 2021 + +void is_on_changed(void *_d) +{ + enb_data *d = _d; + char t; + + if (pthread_mutex_lock(&d->lock)) abort(); + + if (d->socket == -1) goto no_connection; + + t = 1; + if (socket_send(d->socket, &t, 1) == -1 || + socket_send(d->socket, &d->nevents, sizeof(int)) == -1 || + socket_send(d->socket, d->is_on, d->nevents * sizeof(int)) == -1) + goto connection_dies; + +no_connection: + if (pthread_mutex_unlock(&d->lock)) abort(); + return; + +connection_dies: + close(d->socket); + d->socket = -1; + if (pthread_mutex_unlock(&d->lock)) abort(); +} + +void usage(void) +{ + printf( +"options:\n" +" -d <database file> this option is mandatory\n" +" -on <GROUP or ID> turn log ON for given GROUP or ID\n" +" -off <GROUP or ID> turn log OFF for given GROUP or ID\n" +" -ON turn all logs ON\n" +" -OFF turn all logs OFF\n" +" note: you may pass several -on/-off/-ON/-OFF,\n" +" they will be processed in order\n" +" by default, all is off\n" +" -ip <host> connect to given IP address (default %s)\n" +" -p <port> connect to given port (default %d)\n" +" -debug-gui activate GUI debug logs\n", + DEFAULT_REMOTE_IP, + DEFAULT_REMOTE_PORT + ); + exit(1); +} + +static void *gui_thread(void *_g) +{ + gui *g = _g; + gui_loop(g); + return NULL; +} + +static filter *ticktime_filter(void *database, char *event, int i) +{ + /* filter is "harq_pid == i && UE_id == 0 && eNB_id == 0" */ + return + filter_and( + filter_eq(filter_evarg(database, event, "harq_pid"), filter_int(i)), + filter_and( + filter_eq(filter_evarg(database, event, "UE_id"), filter_int(0)), + filter_eq(filter_evarg(database, event, "eNB_ID"), filter_int(0)))); +} + +static void enb_main_gui(enb_gui *e, gui *g, event_handler *h, void *database) +{ + widget *main_window; + widget *top_container; + widget *line, *col; + widget *logo; + widget *input_signal_plot; + logger *input_signal_log; + view *input_signal_view; + widget *timeline_plot; + logger *timelog; + view *timeview; + view *subview; + widget *text; + view *textview; + int i; + + main_window = new_toplevel_window(g, 800, 600, "eNB tracer"); + top_container = new_container(g, VERTICAL); + widget_add_child(g, main_window, top_container, -1); + + line = new_container(g, HORIZONTAL); + widget_add_child(g, top_container, line, -1); + logo = new_image(g, openair_logo_png, openair_logo_png_len); + widget_add_child(g, line, logo, -1); + input_signal_plot = new_xy_plot(g, 256, 55, "input signal", 20); + widget_add_child(g, line, input_signal_plot, -1); + xy_plot_set_range(g, input_signal_plot, 0, 7680*10, 20, 70); + input_signal_log = new_framelog(h, database, + "ENB_INPUT_SIGNAL", "subframe", "rxdata"); + /* a skip value of 10 means to process 1 frame over 10, that is + * more or less 10 frames per second + */ + framelog_set_skip(input_signal_log, 10); + input_signal_view = new_view_xy(7680*10, 10, + g, input_signal_plot, new_color(g, "#0c0c72")); + logger_add_view(input_signal_log, input_signal_view); + + /* downlink/uplink UE DCIs */ + widget_add_child(g, top_container, + new_label(g,"DL/UL TICK/DCI/ACK/NACK "), -1); + line = new_container(g, HORIZONTAL); + widget_add_child(g, top_container, line, -1); + timeline_plot = new_timeline(g, 512, 8, 5); + widget_add_child(g, line, timeline_plot, -1); + container_set_child_growable(g, line, timeline_plot, 1); + for (i = 0; i < 8; i++) + timeline_set_subline_background_color(g, timeline_plot, i, + new_color(g, i==0 || i==4 ? "#aaf" : "#eee")); + timeview = new_view_time(3600, 10, g, timeline_plot); + /* DL tick logging */ + timelog = new_timelog(h, database, "ENB_DL_TICK"); + subview = new_subview_time(timeview, 0, new_color(g, "#77c"), 3600*1000); + logger_add_view(timelog, subview); + /* DL DCI logging */ + timelog = new_timelog(h, database, "ENB_DLSCH_UE_DCI"); + subview = new_subview_time(timeview, 1, new_color(g, "#228"), 3600*1000); + logger_add_view(timelog, subview); + /* DL ACK */ + timelog = new_timelog(h, database, "ENB_DLSCH_UE_ACK"); + subview = new_subview_time(timeview, 2, new_color(g, "#282"), 3600*1000); + logger_add_view(timelog, subview); + /* DL NACK */ + timelog = new_timelog(h, database, "ENB_DLSCH_UE_NACK"); + subview = new_subview_time(timeview, 3, new_color(g, "#f22"), 3600*1000); + logger_add_view(timelog, subview); + + /* UL tick logging */ + timelog = new_timelog(h, database, "ENB_UL_TICK"); + subview = new_subview_time(timeview, 4, new_color(g, "#77c"), 3600*1000); + logger_add_view(timelog, subview); + /* UL DCI logging */ + timelog = new_timelog(h, database, "ENB_ULSCH_UE_DCI"); + subview = new_subview_time(timeview, 5, new_color(g, "#228"), 3600*1000); + logger_add_view(timelog, subview); + /* UL retransmission without DCI logging */ + timelog = new_timelog(h, database, "ENB_ULSCH_UE_NO_DCI_RETRANSMISSION"); + subview = new_subview_time(timeview, 5, new_color(g, "#f22"), 3600*1000); + logger_add_view(timelog, subview); + /* UL ACK */ + timelog = new_timelog(h, database, "ENB_ULSCH_UE_ACK"); + subview = new_subview_time(timeview, 6, new_color(g, "#282"), 3600*1000); + logger_add_view(timelog, subview); + /* UL NACK */ + timelog = new_timelog(h, database, "ENB_ULSCH_UE_NACK"); + subview = new_subview_time(timeview, 7, new_color(g, "#f22"), 3600*1000); + logger_add_view(timelog, subview); + + /* harq processes' ticktime view */ + widget_add_child(g, top_container, + new_label(g,"DL/UL HARQ (x8) "), -1); + line = new_container(g, HORIZONTAL); + widget_add_child(g, top_container, line, -1); + timeline_plot = new_timeline(g, 512, 2*8+2, 3); + widget_add_child(g, line, timeline_plot, -1); + container_set_child_growable(g, line, timeline_plot, 1); + for (i = 0; i < 2*8+2; i++) + timeline_set_subline_background_color(g, timeline_plot, i, + new_color(g, i==0 || i==9 ? "#ddd" : (i%9)&1 ? "#e6e6e6" : "#eee")); + timeview = new_view_ticktime(10, g, timeline_plot); + ticktime_set_tick(timeview, + new_ticklog(h, database, "ENB_MASTER_TICK", "frame", "subframe")); + /* tick */ + timelog = new_ticklog(h, database, "ENB_MASTER_TICK", "frame", "subframe"); + /* tick on DL view */ + subview = new_subview_ticktime(timeview, 0, new_color(g,"#bbb"), 3600*1000); + logger_add_view(timelog, subview); + /* tick on UL view */ + subview = new_subview_ticktime(timeview, 9, new_color(g,"#bbb"), 3600*1000); + logger_add_view(timelog, subview); + /* DL harq pids */ + for (i = 0; i < 8; i++) { + timelog = new_ticklog(h, database, "ENB_DLSCH_UE_DCI", + "frame", "subframe"); + subview = new_subview_ticktime(timeview, i+1, + new_color(g,"#55f"), 3600*1000); + logger_add_view(timelog, subview); + logger_set_filter(timelog, + ticktime_filter(database, "ENB_DLSCH_UE_DCI", i)); + } + /* DL ACK */ + for (i = 0; i < 8; i++) { + timelog = new_ticklog(h, database, "ENB_DLSCH_UE_ACK", + "frame", "subframe"); + subview = new_subview_ticktime(timeview, i+1, + new_color(g,"#282"), 3600*1000); + logger_add_view(timelog, subview); + logger_set_filter(timelog, + ticktime_filter(database, "ENB_DLSCH_UE_ACK", i)); + } + /* DL NACK */ + for (i = 0; i < 8; i++) { + timelog = new_ticklog(h, database, "ENB_DLSCH_UE_NACK", + "frame", "subframe"); + subview = new_subview_ticktime(timeview, i+1, + new_color(g,"#f22"), 3600*1000); + logger_add_view(timelog, subview); + logger_set_filter(timelog, + ticktime_filter(database, "ENB_DLSCH_UE_NACK", i)); + } + /* UL harq pids */ + for (i = 0; i < 8; i++) { + /* first transmission */ + timelog = new_ticklog(h, database, "ENB_ULSCH_UE_DCI", + "frame", "subframe"); + subview = new_subview_ticktime(timeview, i+9+1, + new_color(g,"#55f"), 3600*1000); + logger_add_view(timelog, subview); + logger_set_filter(timelog, + ticktime_filter(database, "ENB_ULSCH_UE_DCI", i)); + /* retransmission */ + timelog = new_ticklog(h, database, "ENB_ULSCH_UE_NO_DCI_RETRANSMISSION", + "frame", "subframe"); + subview = new_subview_ticktime(timeview, i+9+1, + new_color(g,"#99f"), 3600*1000); + logger_add_view(timelog, subview); + logger_set_filter(timelog, + ticktime_filter(database, "ENB_ULSCH_UE_NO_DCI_RETRANSMISSION", i)); + } + /* UL ACK */ + for (i = 0; i < 8; i++) { + timelog = new_ticklog(h, database, "ENB_ULSCH_UE_ACK", + "frame", "subframe"); + subview = new_subview_ticktime(timeview, i+9+1, + new_color(g,"#282"), 3600*1000); + logger_add_view(timelog, subview); + logger_set_filter(timelog, + ticktime_filter(database, "ENB_ULSCH_UE_ACK", i)); + } + /* UL NACK */ + for (i = 0; i < 8; i++) { + timelog = new_ticklog(h, database, "ENB_ULSCH_UE_NACK", + "frame", "subframe"); + subview = new_subview_ticktime(timeview, i+9+1, + new_color(g,"#f22"), 3600*1000); + logger_add_view(timelog, subview); + logger_set_filter(timelog, + ticktime_filter(database, "ENB_ULSCH_UE_NACK", i)); + } + + /* phy/mac/rlc/pdcp/rrc textlog */ + line = new_container(g, HORIZONTAL); + widget_add_child(g, top_container, line, -1); + container_set_child_growable(g, top_container, line, 1); + + /* phy */ + col = new_container(g, VERTICAL); + widget_add_child(g, line, col, -1); + container_set_child_growable(g, line, col, 1); + widget_add_child(g, col, new_label(g, "PHY"), -1); + text = new_textlist(g, 100, 10, new_color(g, "#afa")); + widget_add_child(g, col, text, -1); + container_set_child_growable(g, col, text, 1); + textview = new_view_textlist(10000, 10, g, text); + e->phyview = textview; + + /* mac */ + col = new_container(g, VERTICAL); + widget_add_child(g, line, col, -1); + container_set_child_growable(g, line, col, 1); + widget_add_child(g, col, new_label(g, "MAC"), -1); + text = new_textlist(g, 100, 10, new_color(g, "#adf")); + widget_add_child(g, col, text, -1); + container_set_child_growable(g, col, text, 1); + textview = new_view_textlist(10000, 10, g, text); + e->macview = textview; + + line = new_container(g, HORIZONTAL); + widget_add_child(g, top_container, line, -1); + container_set_child_growable(g, top_container, line, 1); + + /* rlc */ + col = new_container(g, VERTICAL); + widget_add_child(g, line, col, -1); + container_set_child_growable(g, line, col, 1); + widget_add_child(g, col, new_label(g, "RLC"), -1); + text = new_textlist(g, 100, 10, new_color(g, "#aff")); + widget_add_child(g, col, text, -1); + container_set_child_growable(g, col, text, 1); + textview = new_view_textlist(10000, 10, g, text); + e->rlcview = textview; + + /* pdcp */ + col = new_container(g, VERTICAL); + widget_add_child(g, line, col, -1); + container_set_child_growable(g, line, col, 1); + widget_add_child(g, col, new_label(g, "PDCP"), -1); + text = new_textlist(g, 100, 10, new_color(g, "#ed9")); + widget_add_child(g, col, text, -1); + container_set_child_growable(g, col, text, 1); + textview = new_view_textlist(10000, 10, g, text); + e->pdcpview = textview; + + line = new_container(g, HORIZONTAL); + widget_add_child(g, top_container, line, -1); + container_set_child_growable(g, top_container, line, 1); + + /* rrc */ + col = new_container(g, VERTICAL); + widget_add_child(g, line, col, -1); + container_set_child_growable(g, line, col, 1); + widget_add_child(g, col, new_label(g, "RRC"), -1); + text = new_textlist(g, 100, 10, new_color(g, "#fdb")); + widget_add_child(g, col, text, -1); + container_set_child_growable(g, col, text, 1); + textview = new_view_textlist(10000, 10, g, text); + e->rrcview = textview; + + /* legacy logs (LOG_I, LOG_D, ...) */ + widget_add_child(g, top_container, new_label(g, "LEGACY"), -1); + text = new_textlist(g, 100, 10, new_color(g, "#eeb")); + widget_add_child(g, top_container, text, -1); + container_set_child_growable(g, top_container, text, 1); + e->legacy = new_view_textlist(10000, 10, g, text); +} + +void view_add_log(view *v, char *log, event_handler *h, void *database, + int *is_on) +{ + logger *textlog; + char *name, *desc; + + database_get_generic_description(database, + event_id_from_name(database, log), &name, &desc); + textlog = new_textlog(h, database, name, desc); + logger_add_view(textlog, v); + free(name); + free(desc); + + on_off(database, log, is_on, 1); +} + +int main(int n, char **v) +{ + extern int volatile gui_logd; + char *database_filename = NULL; + void *database; + char *ip = DEFAULT_REMOTE_IP; + int port = DEFAULT_REMOTE_PORT; + char **on_off_name; + int *on_off_action; + int on_off_n = 0; + int *is_on; + int number_of_events; + int i; + event_handler *h; + gui *g; + enb_gui eg; + enb_data enb_data; + + /* write on a socket fails if the other end is closed and we get SIGPIPE */ + if (signal(SIGPIPE, SIG_IGN) == SIG_ERR) abort(); + + on_off_name = malloc(n * sizeof(char *)); if (on_off_name == NULL) abort(); + on_off_action = malloc(n * sizeof(int)); if (on_off_action == NULL) abort(); + + for (i = 1; i < n; i++) { + if (!strcmp(v[i], "-h") || !strcmp(v[i], "--help")) usage(); + if (!strcmp(v[i], "-d")) + { if (i > n-2) usage(); database_filename = v[++i]; continue; } + if (!strcmp(v[i], "-ip")) { if (i > n-2) usage(); ip = v[++i]; continue; } + if (!strcmp(v[i], "-p")) + { if (i > n-2) usage(); port = atoi(v[++i]); continue; } + if (!strcmp(v[i], "-on")) { if (i > n-2) usage(); + on_off_name[on_off_n]=v[++i]; on_off_action[on_off_n++]=1; continue; } + if (!strcmp(v[i], "-off")) { if (i > n-2) usage(); + on_off_name[on_off_n]=v[++i]; on_off_action[on_off_n++]=0; continue; } + if (!strcmp(v[i], "-ON")) + { on_off_name[on_off_n]=NULL; on_off_action[on_off_n++]=1; continue; } + if (!strcmp(v[i], "-OFF")) + { on_off_name[on_off_n]=NULL; on_off_action[on_off_n++]=0; continue; } + if (!strcmp(v[i], "-debug-gui")) { gui_logd = 1; continue; } + usage(); + } + + if (database_filename == NULL) { + printf("ERROR: provide a database file (-d)\n"); + exit(1); + } + + database = parse_database(database_filename); + + load_config_file(database_filename); + + number_of_events = number_of_ids(database); + is_on = calloc(number_of_events, sizeof(int)); + if (is_on == NULL) abort(); + + h = new_handler(database); + + g = gui_init(); + new_thread(gui_thread, g); + + enb_main_gui(&eg, g, h, database); + + for (i = 0; i < number_of_events; i++) { + logger *textlog; + char *name, *desc; + database_get_generic_description(database, i, &name, &desc); + if (strncmp(name, "LEGACY_", 7) != 0) continue; + textlog = new_textlog(h, database, name, desc); + logger_add_view(textlog, eg.legacy); + free(name); + free(desc); + } + + on_off(database, "ENB_INPUT_SIGNAL", is_on, 1); + on_off(database, "ENB_DL_TICK", is_on, 1); + on_off(database, "ENB_DLSCH_UE_DCI", is_on, 1); + on_off(database, "ENB_DLSCH_UE_ACK", is_on, 1); + on_off(database, "ENB_DLSCH_UE_NACK", is_on, 1); + on_off(database, "ENB_UL_TICK", is_on, 1); + on_off(database, "ENB_ULSCH_UE_DCI", is_on, 1); + on_off(database, "ENB_ULSCH_UE_NO_DCI_RETRANSMISSION", is_on, 1); + on_off(database, "ENB_ULSCH_UE_ACK", is_on, 1); + on_off(database, "ENB_ULSCH_UE_NACK", is_on, 1); + on_off(database, "ENB_MASTER_TICK", is_on, 1); + + on_off(database, "LEGACY_RRC_INFO", is_on, 1); + on_off(database, "LEGACY_RRC_ERROR", is_on, 1); + on_off(database, "LEGACY_RRC_WARNING", is_on, 1); + + view_add_log(eg.phyview, "ENB_DLSCH_UE_DCI", h, database, is_on); + view_add_log(eg.phyview, "ENB_DLSCH_UE_ACK", h, database, is_on); + view_add_log(eg.phyview, "ENB_DLSCH_UE_NACK", h, database, is_on); + view_add_log(eg.phyview, "ENB_ULSCH_UE_DCI", h, database, is_on); + view_add_log(eg.phyview, "ENB_ULSCH_UE_NO_DCI_RETRANSMISSION", + h, database, is_on); + view_add_log(eg.phyview, "ENB_ULSCH_UE_ACK", h, database, is_on); + view_add_log(eg.phyview, "ENB_ULSCH_UE_NACK", h, database, is_on); + + view_add_log(eg.macview, "ENB_MAC_UE_DL_SDU", h, database, is_on); + view_add_log(eg.macview, "ENB_MAC_UE_UL_SCHEDULE", h, database, is_on); + view_add_log(eg.macview, "ENB_MAC_UE_UL_SCHEDULE_RETRANSMISSION", + h, database, is_on); + view_add_log(eg.macview, "ENB_MAC_UE_UL_PDU", h, database, is_on); + view_add_log(eg.macview, "ENB_MAC_UE_UL_SDU", h, database, is_on); + view_add_log(eg.macview, "ENB_MAC_UE_UL_CE", h, database, is_on); + + view_add_log(eg.rlcview, "ENB_RLC_DL", h, database, is_on); + view_add_log(eg.rlcview, "ENB_RLC_UL", h, database, is_on); + view_add_log(eg.rlcview, "ENB_RLC_MAC_DL", h, database, is_on); + view_add_log(eg.rlcview, "ENB_RLC_MAC_UL", h, database, is_on); + + view_add_log(eg.pdcpview, "ENB_PDCP_UL", h, database, is_on); + view_add_log(eg.pdcpview, "ENB_PDCP_DL", h, database, is_on); + + view_add_log(eg.rrcview, "ENB_RRC_CONNECTION_SETUP_COMPLETE", + h, database, is_on); + view_add_log(eg.rrcview, "ENB_RRC_SECURITY_MODE_COMMAND", + h, database, is_on); + view_add_log(eg.rrcview, "ENB_RRC_UE_CAPABILITY_ENQUIRY", + h, database, is_on); + view_add_log(eg.rrcview, "ENB_RRC_CONNECTION_REJECT", + h, database, is_on); + view_add_log(eg.rrcview, "ENB_RRC_CONNECTION_REESTABLISHMENT_REJECT", + h, database, is_on); + view_add_log(eg.rrcview, "ENB_RRC_CONNECTION_RELEASE", + h, database, is_on); + view_add_log(eg.rrcview, "ENB_RRC_CONNECTION_RECONFIGURATION", + h, database, is_on); + view_add_log(eg.rrcview, "ENB_RRC_MEASUREMENT_REPORT", + h, database, is_on); + view_add_log(eg.rrcview, "ENB_RRC_HANDOVER_PREPARATION_INFORMATION", + h, database, is_on); + view_add_log(eg.rrcview, "ENB_RRC_CONNECTION_RECONFIGURATION_COMPLETE", + h, database, is_on); + view_add_log(eg.rrcview, "ENB_RRC_CONNECTION_SETUP", + h, database, is_on); + view_add_log(eg.rrcview, "ENB_RRC_UL_CCCH_DATA_IN", + h, database, is_on); + view_add_log(eg.rrcview, "ENB_RRC_UL_DCCH_DATA_IN", + h, database, is_on); + view_add_log(eg.rrcview, "ENB_RRC_SECURITY_MODE_COMPLETE", + h, database, is_on); + view_add_log(eg.rrcview, "ENB_RRC_SECURITY_MODE_FAILURE", + h, database, is_on); + view_add_log(eg.rrcview, "ENB_RRC_UE_CAPABILITY_INFORMATION", + h, database, is_on); + view_add_log(eg.rrcview, "ENB_RRC_CONNECTION_REQUEST", + h, database, is_on); + view_add_log(eg.rrcview, "ENB_RRC_CONNECTION_REESTABLISHMENT_REQUEST", + h, database, is_on); + view_add_log(eg.rrcview, "ENB_RRC_CONNECTION_REESTABLISHMENT_COMPLETE", + h, database, is_on); + view_add_log(eg.rrcview, "ENB_RRC_UL_HANDOVER_PREPARATION_TRANSFER", + h, database, is_on); + view_add_log(eg.rrcview, "ENB_RRC_UL_INFORMATION_TRANSFER", + h, database, is_on); + view_add_log(eg.rrcview, "ENB_RRC_COUNTER_CHECK_RESPONSE", + h, database, is_on); + view_add_log(eg.rrcview, "ENB_RRC_UE_INFORMATION_RESPONSE_R9", + h, database, is_on); + view_add_log(eg.rrcview, "ENB_RRC_PROXIMITY_INDICATION_R9", + h, database, is_on); + view_add_log(eg.rrcview, "ENB_RRC_RECONFIGURATION_COMPLETE_R10", + h, database, is_on); + view_add_log(eg.rrcview, "ENB_RRC_MBMS_COUNTING_RESPONSE_R10", + h, database, is_on); + view_add_log(eg.rrcview, "ENB_RRC_INTER_FREQ_RSTD_MEASUREMENT_INDICATION", + h, database, is_on); + view_add_log(eg.rrcview, "ENB_RRC_UNKNOW_MESSAGE", + h, database, is_on); + + for (i = 0; i < on_off_n; i++) + on_off(database, on_off_name[i], is_on, on_off_action[i]); + + enb_data.socket = -1; + enb_data.is_on = is_on; + enb_data.nevents = number_of_events; + if (pthread_mutex_init(&enb_data.lock, NULL)) abort(); + setup_event_selector(g, database, is_on, is_on_changed, &enb_data); + +restart: + clear_remote_config(); + enb_data.socket = connect_to(ip, port); + + /* send the first message - activate selected traces */ + is_on_changed(&enb_data); + + /* read messages */ + while (1) { + char v[T_BUFFER_MAX]; + event e; + e = get_event(enb_data.socket, v, database); + if (e.type == -1) goto restart; + handle_event(h, e); + } + + return 0; +} diff --git a/common/utils/T/tracer/event.c b/common/utils/T/tracer/event.c new file mode 100644 index 0000000000000000000000000000000000000000..0917c010b3852a95a6e0fa6f56e48315c1d19b2b --- /dev/null +++ b/common/utils/T/tracer/event.c @@ -0,0 +1,106 @@ +#include "event.h" +#include "database.h" +#include "utils.h" +#include "config.h" +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +event get_event(int socket, char *event_buffer, void *database) +{ +#ifdef T_SEND_TIME + struct timespec t; +#endif + int type; + int32_t length; + + /* Events type -1 and -2 are special: the tracee sends its version + * of T_messages.txt using those events. + * We have to check that the local version of T_messages.txt is identical + * to the one the tracee uses. We don't report those events to the + * application. + */ + +again: + if (fullread(socket, &length, 4) == -1) goto read_error; +#ifdef T_SEND_TIME + if (fullread(socket, &t, sizeof(struct timespec)) == -1) goto read_error; + length -= sizeof(struct timespec); +#endif + if (fullread(socket, &type, sizeof(int)) == -1) goto read_error; + length -= sizeof(int); + if (fullread(socket, event_buffer, length) == -1) goto read_error; + + if (type == -1) append_received_config_chunk(event_buffer, length); + if (type == -2) verify_config(); + + if (type == -1 || type == -2) goto again; + +#ifdef T_SEND_TIME + return new_event(t, type, length, event_buffer, database); +#else + return new_event(type, length, event_buffer, database); +#endif + +read_error: + return (event){type: -1}; +} + +#ifdef T_SEND_TIME +event new_event(struct timespec sending_time, int type, + int length, char *buffer, void *database) +#else +event new_event(int type, int length, char *buffer, void *database) +#endif +{ + database_event_format f; + event e; + int i; + int offset; + +#ifdef T_SEND_TIME + e.sending_time = sending_time; +#endif + e.type = type; + e.buffer = buffer; + + f = get_format(database, type); + + e.ecount = f.count; + + offset = 0; + + /* setup offsets */ + /* TODO: speedup (no strcmp, string event to include length at head) */ + for (i = 0; i < f.count; i++) { + //e.e[i].offset = offset; + if (!strcmp(f.type[i], "int")) { + e.e[i].type = EVENT_INT; + e.e[i].i = *(int *)(&buffer[offset]); + offset += 4; + } else if (!strcmp(f.type[i], "ulong")) { + e.e[i].type = EVENT_ULONG; + e.e[i].ul = *(unsigned long *)(&buffer[offset]); + offset += sizeof(unsigned long); + } else if (!strcmp(f.type[i], "string")) { + e.e[i].type = EVENT_STRING; + e.e[i].s = &buffer[offset]; + while (buffer[offset]) offset++; + offset++; + } else if (!strcmp(f.type[i], "buffer")) { + int len; + e.e[i].type = EVENT_BUFFER; + len = *(int *)(&buffer[offset]); + e.e[i].bsize = len; + e.e[i].b = &buffer[offset+sizeof(int)]; + offset += len+sizeof(int); + } else { + printf("unhandled type '%s'\n", f.type[i]); + abort(); + } + } + + if (e.ecount==0) { printf("FORMAT not set in event %d\n", type); abort(); } + + return e; +} diff --git a/common/utils/T/tracer/event.h b/common/utils/T/tracer/event.h new file mode 100644 index 0000000000000000000000000000000000000000..6272baf1a8f13216959db18951b606690315d46e --- /dev/null +++ b/common/utils/T/tracer/event.h @@ -0,0 +1,49 @@ +#ifndef _EVENT_H_ +#define _EVENT_H_ + +#include "../T_defs.h" +#ifdef T_SEND_TIME +#include <time.h> +#endif + +enum event_arg_type { + EVENT_INT, + EVENT_ULONG, + EVENT_STRING, + EVENT_BUFFER +}; + +typedef struct { + enum event_arg_type type; + //int offset; + union { + int i; + unsigned long ul; + char *s; + struct { + int bsize; + void *b; + }; + }; +} event_arg; + +typedef struct { +#ifdef T_SEND_TIME + struct timespec sending_time; +#endif + int type; + char *buffer; + event_arg e[T_MAX_ARGS]; + int ecount; +} event; + +event get_event(int s, char *v, void *d); + +#ifdef T_SEND_TIME +event new_event(struct timespec sending_time, int type, + int length, char *buffer, void *database); +#else +event new_event(int type, int length, char *buffer, void *database); +#endif + +#endif /* _EVENT_H_ */ diff --git a/common/utils/T/tracer/event_selector.c b/common/utils/T/tracer/event_selector.c new file mode 100644 index 0000000000000000000000000000000000000000..a03846c0566a98faef440f7eb991793209d676e4 --- /dev/null +++ b/common/utils/T/tracer/event_selector.c @@ -0,0 +1,231 @@ +#include "event_selector.h" +#include "gui/gui.h" +#include "database.h" +#include "utils.h" +#include <stdlib.h> +#include <string.h> + +struct event_selector { + int *is_on; + int *is_on_paused; /* when pausing, is_on is set to all 0, this one + * is used to copy back data when un-pausing */ + int red; + int green; + gui *g; + widget *events; + widget *groups; + void *database; + int nevents; + int ngroups; + int paused; + /* those three widgets used to pause/unpause reception of events */ + widget *parent_widget; + widget *normal_widget; + widget *pause_widget; + void (*change_callback)(void *change_callback_data); + void *change_callback_data; +}; + +static void scroll(void *private, gui *g, + char *notification, widget *w, void *notification_data) +{ + int visible_lines; + int start_line; + int number_of_lines; + int new_line; + int inc; + + textlist_state(g, w, &visible_lines, &start_line, &number_of_lines); + inc = 10; + if (inc > visible_lines - 2) inc = visible_lines - 2; + if (inc < 1) inc = 1; + if (!strcmp(notification, "scrollup")) inc = -inc; + + new_line = start_line + inc; + if (new_line > number_of_lines - visible_lines) + new_line = number_of_lines - visible_lines; + if (new_line < 0) new_line = 0; + + textlist_set_start_line(g, w, new_line); +} + +static void click(void *private, gui *g, + char *notification, widget *w, void *notification_data) +{ + int *d = notification_data; + struct event_selector *this = private; + int set_on; + int line = d[0]; + int button = d[1]; + char *text; + int color; + int i; + + /* notification_data depends on the kind of widget */ + if (w == this->pause_widget) { + line = 0; + button = d[0]; + } else { + line = d[0]; + button = d[1]; + } + + /* middle-button toggles - redo with SPACE when keyboard is processed */ + if (button == 2) { + if (this->paused == 0) { + widget_del_child(g, this->parent_widget, this->normal_widget); + widget_add_child(g, this->parent_widget, this->pause_widget, 0); + container_set_child_growable(g, this->parent_widget, + this->pause_widget, 1); + /* pause */ + memcpy(this->is_on_paused, this->is_on, this->nevents * sizeof(int)); + memset(this->is_on, 0, this->nevents * sizeof(int)); + this->change_callback(this->change_callback_data); + } else { + widget_del_child(g, this->parent_widget, this->pause_widget); + widget_add_child(g, this->parent_widget, this->normal_widget, 0); + container_set_child_growable(g, this->parent_widget, + this->normal_widget, 1); + /* un-pause */ + memcpy(this->is_on, this->is_on_paused, this->nevents * sizeof(int)); + this->change_callback(this->change_callback_data); + } + this->paused = 1 - this->paused; + return; + } + + if (w == this->pause_widget) return; + + if (button != 1 && button != 3) return; + + if (button == 1) set_on = 1; else set_on = 0; + + if (w == this->events) + textlist_get_line(this->g, this->events, line, &text, &color); + else + textlist_get_line(this->g, this->groups, line, &text, &color); + + on_off(this->database, text, this->is_on, set_on); + + for (i = 0; i < this->nevents; i++) + textlist_set_color(this->g, this->events, i, + this->is_on[database_pos_to_id(this->database, i)] ? + this->green : this->red); + + for (i = 0; i < this->ngroups; i++) + textlist_set_color(this->g, this->groups, i, FOREGROUND_COLOR); + if (w == this->groups) + textlist_set_color(this->g, this->groups, line, + set_on ? this->green : this->red); + + this->change_callback(this->change_callback_data); +} + +event_selector *setup_event_selector(gui *g, void *database, int *is_on, + void (*change_callback)(void *), void *change_callback_data) +{ + struct event_selector *ret; + widget *win; + widget *win_container; + widget *main_container; + widget *container; + widget *left, *right; + widget *events, *groups; + widget *pause_container; + char **ids; + char **gps; + int n; + int i; + int red, green; + + ret = calloc(1, sizeof(struct event_selector)); if (ret == NULL) abort(); + + red = new_color(g, "#c93535"); + green = new_color(g, "#2f9e2a"); + + win = new_toplevel_window(g, 470, 300, "event selector"); + win_container = new_container(g, VERTICAL); + widget_add_child(g, win, win_container, -1); + + main_container = new_container(g, VERTICAL); + widget_add_child(g, win_container, main_container, -1); + container_set_child_growable(g, win_container, main_container, 1); + + container = new_container(g, HORIZONTAL); + widget_add_child(g, main_container, container, -1); + container_set_child_growable(g, main_container, container, 1); + widget_add_child(g, main_container, + new_label(g, "mouse scroll to scroll - " + "left click to activate - " + "right click to deactivate"), -1); + + left = new_container(g, VERTICAL); + right = new_container(g, VERTICAL); + widget_add_child(g, container, left, -1); + widget_add_child(g, container, right, -1); + container_set_child_growable(g, container, left, 1); + container_set_child_growable(g, container, right, 1); + + widget_add_child(g, left, new_label(g, "Events"), -1); + widget_add_child(g, right, new_label(g, "Groups"), -1); + + events = new_textlist(g, 235, 10, new_color(g, "#b3c1e1")); + groups = new_textlist(g, 235, 10, new_color(g, "#edd6cb")); + + widget_add_child(g, left, events, -1); + widget_add_child(g, right, groups, -1); + container_set_child_growable(g, left, events, 1); + container_set_child_growable(g, right, groups, 1); + + pause_container = new_positioner(g); + widget_add_child(g, pause_container, + new_label(g, + "events' reception paused - click middle button to resume"), -1); + label_set_clickable(g, pause_container, 1); + + n = database_get_ids(database, &ids); + for (i = 0; i < n; i++) { + textlist_add(g, events, ids[i], -1, + is_on[database_pos_to_id(database, i)] ? green : red); + } + free(ids); + + ret->nevents = n; + + ret->is_on_paused = calloc(n, sizeof(int)); + if (ret->is_on_paused == NULL) abort(); + + n = database_get_groups(database, &gps); + for (i = 0; i < n; i++) { + textlist_add(g, groups, gps[i], -1, FOREGROUND_COLOR); + } + free(gps); + + ret->ngroups = n; + + ret->g = g; + ret->is_on = is_on; + ret->red = red; + ret->green = green; + ret->events = events; + ret->groups = groups; + ret->database = database; + ret->change_callback = change_callback; + ret->change_callback_data = change_callback_data; + + ret->parent_widget = win_container; + ret->normal_widget = main_container; + ret->pause_widget = pause_container; + + register_notifier(g, "scrollup", events, scroll, ret); + register_notifier(g, "scrolldown", events, scroll, ret); + register_notifier(g, "click", events, click, ret); + + register_notifier(g, "scrollup", groups, scroll, ret); + register_notifier(g, "scrolldown", groups, scroll, ret); + register_notifier(g, "click", groups, click, ret); + + register_notifier(g, "click", pause_container, click, ret); + + return ret; +} diff --git a/common/utils/T/tracer/event_selector.h b/common/utils/T/tracer/event_selector.h new file mode 100644 index 0000000000000000000000000000000000000000..dedd79965c5096a5e2dce8ad13d61f11fbdda42e --- /dev/null +++ b/common/utils/T/tracer/event_selector.h @@ -0,0 +1,11 @@ +#ifndef _EVENT_SELECTOR_H_ +#define _EVENT_SELECTOR_H_ + +#include "gui/gui.h" + +typedef void event_selector; + +event_selector *setup_event_selector(gui *g, void *database, int *is_on, + void (*change_callback)(void *), void *change_callback_data); + +#endif /* _EVENT_SELECTOR_H_ */ diff --git a/common/utils/T/tracer/filter/Makefile b/common/utils/T/tracer/filter/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..fb1427ca6ac101188c2fee0625314e80e635fa3b --- /dev/null +++ b/common/utils/T/tracer/filter/Makefile @@ -0,0 +1,13 @@ +CC=gcc +CFLAGS=-Wall -g -pthread -I.. + +OBJS=filter.o + +filter.a: $(OBJS) + ar cr filter.a $(OBJS) + +%.o: %.c + $(CC) $(CFLAGS) -o $@ -c $< + +clean: + rm -f *.a *.o diff --git a/common/utils/T/tracer/filter/filter.c b/common/utils/T/tracer/filter/filter.c new file mode 100644 index 0000000000000000000000000000000000000000..b09b01259d91bf96dd8d886aee433000897d909c --- /dev/null +++ b/common/utils/T/tracer/filter/filter.c @@ -0,0 +1,125 @@ +#include "filter.h" +#include "event.h" +#include "database.h" +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +struct filter { + union { + struct { struct filter *a, *b; } op2; + int v; + struct { int event_type; int arg_index; } evarg; + } v; + + int (*eval)(struct filter *this, event e); +}; + +/****************************************************************************/ +/* evaluation functions */ +/****************************************************************************/ + +int eval_and(struct filter *f, event e) +{ + if (f->v.op2.a->eval(f->v.op2.a, e) == 0) return 0; + return f->v.op2.b->eval(f->v.op2.b, e); +} + +int eval_eq(struct filter *f, event e) +{ + int a = f->v.op2.a->eval(f->v.op2.a, e); + int b = f->v.op2.b->eval(f->v.op2.b, e); + return a == b; +} + +int eval_int(struct filter *f, event e) +{ + return f->v.v; +} + +int eval_evarg(struct filter *f, event e) +{ + if (e.type != f->v.evarg.event_type) { + printf("%s:%d:%s: bad event type\n", __FILE__, __LINE__, __FUNCTION__); + abort(); + } + if (e.e[f->v.evarg.arg_index].type != EVENT_INT) { + printf("%s:%d:%s: bad event argtype; has to be 'int'\n", + __FILE__, __LINE__, __FUNCTION__); + abort(); + } + return e.e[f->v.evarg.arg_index].i; +} + +/****************************************************************************/ +/* filter construction functions */ +/****************************************************************************/ + +filter *filter_and(filter *a, filter *b) +{ + struct filter *ret = calloc(1, sizeof(struct filter)); + if (ret == NULL) abort(); + ret->eval = eval_and; + ret->v.op2.a = a; + ret->v.op2.b = b; + return ret; +} + +filter *filter_eq(filter *a, filter *b) +{ + struct filter *ret = calloc(1, sizeof(struct filter)); + if (ret == NULL) abort(); + ret->eval = eval_eq; + ret->v.op2.a = a; + ret->v.op2.b = b; + return ret; +} + +filter *filter_int(int v) +{ + struct filter *ret = calloc(1, sizeof(struct filter)); + if (ret == NULL) abort(); + ret->eval = eval_int; + ret->v.v = v; + return ret; +} + +filter *filter_evarg(void *database, char *event_name, char *varname) +{ + struct filter *ret; + int event_id; + database_event_format f; + int i; + + ret = calloc(1, sizeof(struct filter)); if (ret == NULL) abort(); + + event_id = event_id_from_name(database, event_name); + f = get_format(database, event_id); + + ret->eval = eval_evarg; + ret->v.evarg.event_type = event_id; + ret->v.evarg.arg_index = -1; + + for (i = 0; i < f.count; i++) { + if (strcmp(f.name[i], varname) != 0) continue; + ret->v.evarg.arg_index = i; + break; + } + if (ret->v.evarg.arg_index == -1) { + printf("%s:%d:%s: event '%s' has no argument '%s'\n", + __FILE__, __LINE__, __FUNCTION__, event_name, varname); + abort(); + } + + return ret; +} + +/****************************************************************************/ +/* eval function */ +/****************************************************************************/ + +int filter_eval(filter *_f, event e) +{ + struct filter *f = _f; + return f->eval(f, e); +} diff --git a/common/utils/T/tracer/filter/filter.h b/common/utils/T/tracer/filter/filter.h new file mode 100644 index 0000000000000000000000000000000000000000..eba02d7fb7f9975709c60f167c267c1c3ce43c6b --- /dev/null +++ b/common/utils/T/tracer/filter/filter.h @@ -0,0 +1,15 @@ +#ifndef _FILTER_H_ +#define _FILTER_H_ + +#include "event.h" + +typedef void filter; + +filter *filter_and(filter *a, filter *b); +filter *filter_eq(filter *a, filter *b); +filter *filter_int(int v); +filter *filter_evarg(void *database, char *event_name, char *varname); + +int filter_eval(filter *f, event e); + +#endif /* _FILTER_H_ */ diff --git a/common/utils/T/tracer/gui.c b/common/utils/T/tracer/gui.c new file mode 100644 index 0000000000000000000000000000000000000000..46e06d2e1f0579fbabc4473e9d035acd847350bf --- /dev/null +++ b/common/utils/T/tracer/gui.c @@ -0,0 +1,102 @@ +#include "defs.h" +#include "gui/gui.h" +#include <stdio.h> +#include <stdlib.h> +#include <pthread.h> +#include <unistd.h> +#include <string.h> +#include <math.h> + +static struct { + gui *g; + widget *input_signal; /* CC_id 0 antenna 0 */ + volatile int input_signal_length; /* unit: byte */ + void *input_signal_iq; + pthread_mutex_t input_signal_lock; +} eNB_data; + +static void *gui_thread(void *g) +{ + gui_loop(g); + exit(0); +} + +static void *input_signal_plotter(void *_) +{ + short *iqbuf; + float *x; + float *y; + int i; + int length = eNB_data.input_signal_length / 4; + + x = calloc(1, sizeof(float) * eNB_data.input_signal_length / 4); + y = calloc(1, sizeof(float) * eNB_data.input_signal_length / 4); + if (x == NULL || y == NULL) abort(); + + while (1) { + usleep(100 * 1000); + + if (pthread_mutex_lock(&eNB_data.input_signal_lock)) abort(); + + if (length * 4 != eNB_data.input_signal_length) { + free(x); + free(y); + x = calloc(1, sizeof(float) * eNB_data.input_signal_length / 4); + y = calloc(1, sizeof(float) * eNB_data.input_signal_length / 4); + if (x == NULL || y == NULL) abort(); + length = eNB_data.input_signal_length / 4; + } + + iqbuf = eNB_data.input_signal_iq; + + for (i = 0; i < length; i++) { + x[i] = i; + y[i] = 10*log10(1.0+(float)(iqbuf[2*i]*iqbuf[2*i]+ + iqbuf[2*i+1]*iqbuf[2*i+1])); + } + + xy_plot_set_points(eNB_data.g, eNB_data.input_signal, 0, + length, x, y); + + if (pthread_mutex_unlock(&eNB_data.input_signal_lock)) abort(); + } +} + +void t_gui_start(void) +{ + gui *g = gui_init(); + + widget *win = new_toplevel_window(g, 550, 140, "input signal"); + widget *plot = new_xy_plot(g, 512, 100, "eNB 0 input signal", 20); + widget_add_child(g, win, plot, -1); + xy_plot_set_range(g, plot, 0, 76800, 30, 70); + xy_plot_new_plot(g, plot, FOREGROUND_COLOR); + + eNB_data.input_signal = plot; + eNB_data.input_signal_length = 76800 * 4; + eNB_data.input_signal_iq = calloc(1, 76800 * 4); + if (eNB_data.input_signal_iq == NULL) abort(); + pthread_mutex_init(&eNB_data.input_signal_lock, NULL); + + eNB_data.g = g; + + new_thread(gui_thread, g); + new_thread(input_signal_plotter, NULL); +} + +void t_gui_set_input_signal(int eNB, int frame, int subframe, int antenna, + int size, void *buf) +{ + if (pthread_mutex_lock(&eNB_data.input_signal_lock)) abort(); + + if (eNB_data.input_signal_length != size * 10) { + free(eNB_data.input_signal_iq); + eNB_data.input_signal_length = size * 10; + eNB_data.input_signal_iq = calloc(1, eNB_data.input_signal_length); + if (eNB_data.input_signal_iq == NULL) abort(); + } + + memcpy((char *)eNB_data.input_signal_iq + subframe * size, buf, size); + + if (pthread_mutex_unlock(&eNB_data.input_signal_lock)) abort(); +} diff --git a/common/utils/T/tracer/gui/Makefile b/common/utils/T/tracer/gui/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..53f2077eaccb2ae7aab01ee1ff5c5635cd207395 --- /dev/null +++ b/common/utils/T/tracer/gui/Makefile @@ -0,0 +1,18 @@ +CC=gcc +CFLAGS=-Wall -g -pthread -I/usr/include/X11/Xft -I/usr/include/freetype2 + +OBJS=init.o loop.o toplevel_window.o x.o container.o widget.o \ + gui.o label.o event.o xy_plot.o textlist.o notify.o positioner.o \ + timeline.o space.o image.o + +gui.a: $(OBJS) + ar cr gui.a $(OBJS) + +test: test.o gui.a + $(CC) -o test $(OBJS) test.o -lX11 -pthread -lm + +%.o: %.c + $(CC) $(CFLAGS) -o $@ -c $< + +clean: + rm -f *.a *.o test diff --git a/common/utils/T/tracer/gui/container.c b/common/utils/T/tracer/gui/container.c new file mode 100644 index 0000000000000000000000000000000000000000..8de43479332390a91294c62ff71ca8bd9ef5db9f --- /dev/null +++ b/common/utils/T/tracer/gui/container.c @@ -0,0 +1,339 @@ +#include "gui.h" +#include "gui_defs.h" +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +#define MAX(a, b) ((a)>(b)?(a):(b)) + +static void repack(gui *g, widget *_this) +{ + LOGD("REPACK container %p\n", _this); + struct container_widget *this = _this; + this->hints_are_valid = 0; + return this->common.parent->repack(g, this->common.parent); +} + +static void add_child(gui *g, widget *_this, widget *child, int position) +{ + LOGD("ADD_CHILD container\n"); + struct container_widget *this = _this; + + this->hints_are_valid = 0; + widget_add_child_internal(g, this, child, position); + + /* initially not growable */ + this->growable = realloc(this->growable, (this->nchildren+1)*sizeof(int)); + if (this->growable == NULL) abort(); + + if (position == -1) position = this->nchildren; + + memmove(this->growable + position+1, this->growable + position, + (this->nchildren - position) * sizeof(int)); + + this->growable[position] = 0; + + this->nchildren++; +} + +static void del_child(gui *g, widget *_this, widget *child) +{ + LOGD("DEL_CHILD container\n"); + struct container_widget *this = _this; + int position = widget_get_child_position(g, _this, child); + + this->hints_are_valid = 0; + widget_del_child_internal(g, this, child); + + memmove(this->growable + position, this->growable + position+1, + (this->nchildren - position - 1) * sizeof(int)); + + this->growable = realloc(this->growable, (this->nchildren-1)*sizeof(int)); + if (this->nchildren != 1 && this->growable == NULL) abort(); + + this->nchildren--; +} + +static void compute_vertical_hints(struct gui *g, + struct container_widget *this) +{ + struct widget_list *l; + int cwidth, cheight; + int allocated_width = 0, allocated_height = 0; + + /* get largest width */ + l = this->common.children; + while (l) { + l->item->hints(g, l->item, &cwidth, &cheight); + if (cwidth > allocated_width) allocated_width = cwidth; + allocated_height += cheight; + l = l->next; + } + this->hint_width = allocated_width; + this->hint_height = allocated_height; + this->hints_are_valid = 1; +} + +static void compute_horizontal_hints(struct gui *g, + struct container_widget *this) +{ + struct widget_list *l; + int cwidth, cheight; + int allocated_width = 0, allocated_height = 0; + + /* get largest height */ + l = this->common.children; + while (l) { + l->item->hints(g, l->item, &cwidth, &cheight); + if (cheight > allocated_height) allocated_height = cheight; + allocated_width += cwidth; + l = l->next; + } + this->hint_width = allocated_width; + this->hint_height = allocated_height; + this->hints_are_valid = 1; +} + +static void vertical_allocate(gui *_gui, widget *_this, + int x, int y, int width, int height) +{ + LOGD("ALLOCATE container vertical %p\n", _this); + int cy = 0; + int cwidth, cheight; + struct gui *g = _gui; + struct container_widget *this = _this; + struct widget_list *l; + int over_pixels = 0; + int i; + + if (this->hints_are_valid == 1) goto hints_ok; + + compute_vertical_hints(g, this); + +hints_ok: + + this->common.x = x; + this->common.y = y; + this->common.width = width; + this->common.height = height; + + /* TODO: some pixels won't be allocated, take care of it? */ + if (height > this->hint_height) { + int ngrowable = 0; + for (i = 0; i < this->nchildren; i++) if (this->growable[i]) ngrowable++; + if (ngrowable) + over_pixels = (height - this->hint_height) / ngrowable; + } + + /* allocate */ + l = this->common.children; + i = 0; + while (l) { + int allocated_height; + l->item->hints(g, l->item, &cwidth, &cheight); + allocated_height = cheight + (this->growable[i] ? over_pixels : 0); + l->item->allocate(g, l->item, this->common.x, this->common.y + cy, + MAX(width, cwidth), allocated_height); + cy += allocated_height; + l = l->next; + i++; + } + +// if (cy != this->hint_height) ERR("reachable?\n"); +} + +static void horizontal_allocate(gui *_gui, widget *_this, + int x, int y, int width, int height) +{ + LOGD("ALLOCATE container horizontal %p\n", _this); + int cx = 0; + int cwidth, cheight; + struct gui *g = _gui; + struct container_widget *this = _this; + struct widget_list *l; + int over_pixels = 0; + int i; + + if (this->hints_are_valid == 1) goto hints_ok; + + compute_horizontal_hints(g, this); + +hints_ok: + + this->common.x = x; + this->common.y = y; + this->common.width = width; + this->common.height = height; + + /* TODO: some pixels won't be allocated, take care of it? */ + if (width > this->hint_width) { + int ngrowable = 0; + for (i = 0; i < this->nchildren; i++) if (this->growable[i]) ngrowable++; + if (ngrowable) + over_pixels = (width - this->hint_width) / ngrowable; + } + + /* allocate */ + l = this->common.children; + i = 0; + while (l) { + int allocated_width; + l->item->hints(g, l->item, &cwidth, &cheight); + allocated_width = cwidth + (this->growable[i] ? over_pixels : 0); + l->item->allocate(g, l->item, this->common.x + cx, this->common.y, + allocated_width, MAX(height, cheight)/* this->hint_height */); + cx += allocated_width; + l = l->next; + i++; + } + +// if (cx != this->hint_width) ERR("reachable?\n"); +} + +static void vertical_hints(gui *_gui, widget *_w, int *width, int *height) +{ + LOGD("HINTS container vertical %p\n", _w); + struct gui *g = _gui; + struct container_widget *this = _w; + + if (this->hints_are_valid) { + *width = this->hint_width; + *height = this->hint_height; + return; + } + + compute_vertical_hints(g, this); + + *width = this->hint_width; + *height = this->hint_height; +} + +static void horizontal_hints(gui *_gui, widget *_w, int *width, int *height) +{ + LOGD("HINTS container horizontal %p\n", _w); + struct gui *g = _gui; + struct container_widget *this = _w; + + if (this->hints_are_valid) { + *width = this->hint_width; + *height = this->hint_height; + return; + } + + compute_horizontal_hints(g, this); + + *width = this->hint_width; + *height = this->hint_height; +} + +static void horizontal_button(gui *_g, widget *_this, int x, int y, + int key_modifiers, int button, int up) +{ + LOGD("BUTTON container horizontal %p xy %d %d button %d up %d\n", _this, x, y, button, up); + struct gui *g = _g; + struct container_widget *this = _this; + struct widget_list *l; + + l = this->common.children; + while (l) { + if (l->item->x <= x && x < l->item->x + l->item->width) { + l->item->button(g, l->item, x, y, key_modifiers, button, up); + break; + } + l = l->next; + } +} + +static void vertical_button(gui *_g, widget *_this, int x, int y, + int key_modifiers, int button, int up) +{ + LOGD("BUTTON container vertical %p xy %d %d button %d up %d\n", _this, x, y, button, up); + struct gui *g = _g; + struct container_widget *this = _this; + struct widget_list *l; + + l = this->common.children; + while (l) { + if (l->item->y <= y && y < l->item->y + l->item->height) { + l->item->button(g, l->item, x, y, key_modifiers, button, up); + break; + } + l = l->next; + } +} + +static void paint(gui *_gui, widget *_this) +{ + LOGD("PAINT container\n"); + struct gui *g = _gui; + struct widget *this = _this; + struct widget_list *l; + + l = this->children; + while (l) { + l->item->paint(g, l->item); + l = l->next; + } +} + +widget *new_container(gui *_gui, int vertical) +{ + struct gui *g = _gui; + struct container_widget *w; + + glock(g); + + w = new_widget(g, CONTAINER, sizeof(struct container_widget)); + + w->vertical = vertical; + w->hints_are_valid = 0; + + w->common.paint = paint; + w->common.add_child = add_child; + w->common.del_child = del_child; + w->common.repack = repack; + + if (vertical) { + w->common.allocate = vertical_allocate; + w->common.hints = vertical_hints; + w->common.button = vertical_button; + } else { + w->common.allocate = horizontal_allocate; + w->common.hints = horizontal_hints; + w->common.button = horizontal_button; + } + + gunlock(g); + + return w; +} + +/*************************************************************************/ +/* public functions */ +/*************************************************************************/ + +void container_set_child_growable(gui *_gui, widget *_this, + widget *child, int growable) +{ + gui *g = _gui; + struct container_widget *this = _this; + struct widget_list *lcur; + int i; + + glock(g); + + lcur = this->common.children; + i = 0; + while (lcur) { + if (lcur->item == child) break; + lcur = lcur->next; + i++; + } + if (lcur == NULL) ERR("%s:%d: child not found\n", __FILE__, __LINE__); + + this->growable[i] = growable; + + send_event(g, REPACK, this->common.id); + + gunlock(g); +} diff --git a/common/utils/T/tracer/gui/event.c b/common/utils/T/tracer/gui/event.c new file mode 100644 index 0000000000000000000000000000000000000000..842318fcea5aff8e468b835429ff19bab3de45ad --- /dev/null +++ b/common/utils/T/tracer/gui/event.c @@ -0,0 +1,209 @@ +#include "gui.h" +#include "gui_defs.h" +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <errno.h> +#include <unistd.h> +#include <stdarg.h> + +/*****************************************************************/ +/* generic functions */ +/*****************************************************************/ + +static void event_list_append(struct gui *g, struct event *e) +{ + struct event_list *new; + + new = calloc(1, sizeof(struct event_list)); + if (new == NULL) OOM; + + new->item = e; + + if (g->queued_events == NULL) { + g->queued_events = new; + new->last = new; + return; + } + + g->queued_events->last->next = new; + g->queued_events->last = new; +} + +static void free_event(struct event *e) +{ + switch (e->type) { + case REPACK: /* nothing */ break; + case DIRTY: /* nothing */ break; + } + free(e); +} + +static int events_equal(struct event *e1, struct event *e2) +{ + if (e1->type != e2->type) return 0; + switch (e1->type) { + case REPACK: { + struct repack_event *re1 = (struct repack_event *)e1; + struct repack_event *re2 = (struct repack_event *)e2; + return re1->id == re2->id; + } + case DIRTY: { + struct dirty_event *re1 = (struct dirty_event *)e1; + struct dirty_event *re2 = (struct dirty_event *)e2; + return re1->id == re2->id; + }} + /* unreachable */ + abort(); +} + +/*****************************************************************/ +/* sending events */ +/*****************************************************************/ + +static event *new_event_repack(int id) +{ + struct repack_event *ret; + ret = calloc(1, sizeof(struct repack_event)); + if (ret == NULL) OOM; + ret->id = id; + return ret; +} + +static event *new_event_dirty(int id) +{ + struct dirty_event *ret; + ret = calloc(1, sizeof(struct dirty_event)); + if (ret == NULL) OOM; + ret->id = id; + return ret; +} + +static void compress_event_list(struct gui *g) +{ + struct event *last; + struct event_list *cur; + /* basic compression, to be refined */ + + /* pickup last event and remove every copy of it found before + * if it's DIRTY or REPACK + */ + last = g->queued_events->last->item; + if (last->type == DIRTY || last->type == REPACK) { + cur = g->queued_events; + while (cur->item != last) { + if (cur->item != NULL && events_equal(cur->item, last)) { + free_event(cur->item); + cur->item = NULL; + } + cur = cur->next; + } + } +} + +void send_event(gui *_gui, enum event_type type, ...) +{ + LOGD("send_event %d\n", type); + struct gui *g = _gui; + int do_write = 0; + va_list ap; + struct event *e; + + if (g->queued_events == NULL) do_write = 1; + + va_start(ap, type); + + switch (type) { + case REPACK: { + int id; + id = va_arg(ap, int); + e = new_event_repack(id); + break; + } + case DIRTY: { + int id; + id = va_arg(ap, int); + e = new_event_dirty(id); + break; + } + } + + va_end(ap); + + e->type = type; + + event_list_append(g, e); + compress_event_list(g); + + if (do_write) { + char c = 1; + if (write(g->event_pipe[1], &c, 1) != 1) + ERR("error writing to pipe: %s\n", strerror(errno)); + } +} + +/*****************************************************************/ +/* processing events */ +/*****************************************************************/ + +static void repack_event(struct gui *g, int id) +{ + struct widget *w = find_widget(g, id); + if (w == NULL) { WARN("widget id %d not found\n", id); return; } + w->repack(g, w); +} + +/* TODO: put that function somewhere else? */ +static struct toplevel_window_widget *get_toplevel_window(struct widget *w) +{ + while (w != NULL) { + if (w->type == TOPLEVEL_WINDOW) + return (struct toplevel_window_widget *)w; + w = w->parent; + } + return NULL; +} + +static void dirty_event(struct gui *g, int id) +{ + struct widget *w = find_widget(g, id); + struct toplevel_window_widget *win; + if (w == NULL) { WARN("widget id %d not found\n", id); return; } + win = get_toplevel_window(w); + if (win == NULL) + { WARN("widget id %d not contained in a window\n", id); return; } + g->xwin = win->x; + w->clear(g, w); + w->paint(g, w); + g->xwin = NULL; + g->repainted = 1; +} + +static void process_event(struct gui *g, struct event *e) +{ + LOGD("processing event type %d\n", e->type); + switch (e->type) { + case REPACK: repack_event(g, ((struct repack_event *)e)->id); break; + case DIRTY: dirty_event(g, ((struct dirty_event *)e)->id); break; + } +} + +/* TODO: events' compression */ +void gui_events(gui *_gui) +{ + struct gui *g = _gui; + + LOGD("gui_events START: head %p\n", g->queued_events); + + while (g->queued_events) { + struct event_list *cur = g->queued_events; + g->queued_events = cur->next; + if (g->queued_events) g->queued_events->last = cur->last; + if (cur->item != NULL) { + process_event(g, cur->item); + free_event(cur->item); + } + free(cur); + } + LOGD("gui_events DONE\n"); +} diff --git a/common/utils/T/tracer/gui/gui.c b/common/utils/T/tracer/gui/gui.c new file mode 100644 index 0000000000000000000000000000000000000000..f0d7dcbcb1faf04a7157cb7f763937403281d250 --- /dev/null +++ b/common/utils/T/tracer/gui/gui.c @@ -0,0 +1,34 @@ +#include "gui.h" +#include "gui_defs.h" +#include "x.h" +#include <stdio.h> +#include <stdlib.h> +#include <pthread.h> + +int volatile gui_logd; + +void glock(gui *_gui) +{ + struct gui *g = _gui; + if (pthread_mutex_lock(g->lock)) ERR("mutex error\n"); +} + +void gunlock(gui *_gui) +{ + struct gui *g = _gui; + if (pthread_mutex_unlock(g->lock)) ERR("mutex error\n"); +} + +int new_color(gui *_gui, char *color) +{ + struct gui *g = _gui; + int ret; + + glock(g); + + ret = x_new_color(g->x, color); + + gunlock(g); + + return ret; +} diff --git a/common/utils/T/tracer/gui/gui.h b/common/utils/T/tracer/gui/gui.h new file mode 100644 index 0000000000000000000000000000000000000000..673514f138ec88c58fa4a88b6487cbb3db9f0578 --- /dev/null +++ b/common/utils/T/tracer/gui/gui.h @@ -0,0 +1,105 @@ +#ifndef _GUI_H_ +#define _GUI_H_ + +/* defines the public API of the GUI */ + +typedef void gui; +typedef void widget; + +#define HORIZONTAL 0 +#define VERTICAL 1 + +#define BACKGROUND_COLOR 0 +#define FOREGROUND_COLOR 1 + +#define DEFAULT_FONT 0 + +/* key modifiers */ +#define KEY_SHIFT (1<<0) +#define KEY_CONTROL (1<<1) +#define KEY_ALT (1<<2) + +gui *gui_init(void); + +/* position = -1 to put at the end */ +void widget_add_child(gui *gui, widget *parent, widget *child, int position); +void widget_del_child(gui *gui, widget *parent, widget *child); +void widget_dirty(gui *gui, widget *this); + +widget *new_toplevel_window(gui *gui, int width, int height, char *title); +widget *new_container(gui *gui, int vertical); +widget *new_positioner(gui *gui); +widget *new_label(gui *gui, const char *text); +widget *new_xy_plot(gui *gui, int width, int height, char *label, + int vruler_width); +widget *new_textlist(gui *gui, int width, int nlines, int background_color); +widget *new_timeline(gui *gui, int width, int number_of_sublines, + int subline_height); +widget *new_space(gui *gui, int width, int height); +widget *new_image(gui *gui, unsigned char *data, int length); + +void label_set_clickable(gui *gui, widget *label, int clickable); + +void container_set_child_growable(gui *_gui, widget *_this, + widget *child, int growable); + +int xy_plot_new_plot(gui *gui, widget *this, int color); +void xy_plot_set_range(gui *gui, widget *this, + float xmin, float xmax, float ymin, float ymax); +void xy_plot_set_points(gui *gui, widget *this, + int plot, int npoints, float *x, float *y); +void xy_plot_get_dimensions(gui *gui, widget *this, int *width, int *height); + +void textlist_add(gui *gui, widget *this, const char *text, int position, + int color); +void textlist_del(gui *gui, widget *this, int position); +void textlist_add_silent(gui *gui, widget *this, const char *text, + int position, int color); +void textlist_del_silent(gui *gui, widget *this, int position); +void textlist_state(gui *_gui, widget *_this, + int *visible_lines, int *start_line, int *number_of_lines); +void textlist_set_start_line(gui *gui, widget *this, int line); +void textlist_get_line(gui *gui, widget *this, int line, + char **text, int *color); +void textlist_set_color(gui *gui, widget *this, int line, int color); + +void timeline_clear(gui *gui, widget *this); +void timeline_clear_silent(gui *gui, widget *this); +void timeline_add_points(gui *gui, widget *this, int subline, int color, + int *x, int len); +void timeline_add_points_silent(gui *gui, widget *this, int subline, + int color, int *x, int len); +void timeline_set_subline_background_color(gui *gui, widget *this, + int subline, int color); +void timeline_get_width(gui *gui, widget *this, int *width); + +void gui_loop(gui *gui); + +void glock(gui *gui); +void gunlock(gui *gui); + +int new_color(gui *gui, char *color); + +/* notifications */ +/* known notifications: + * - textlist: + * - scrollup { void *: NULL } + * - scrolldown { void *: NULL } + * - click { int [2]: line, button } + * - label: + * - click { int: button } (if enabled) + * - timeline + * - resize { int: width } + * - scrollup { int [3]: x, y, key_modifiers } + * - scrolldown { int [3]: x, y, key_modifiers } + * - click { int: button } + */ + +/* same type as in gui_defs.h */ +typedef void (*notifier)(void *private, gui *g, + char *notification, widget *w, void *notification_data); +unsigned long register_notifier(gui *g, char *notification, widget *w, + notifier handler, void *private); +void unregister_notifier(gui *g, unsigned long notifier_id); + +#endif /* _GUI_H_ */ diff --git a/common/utils/T/tracer/gui/gui_defs.h b/common/utils/T/tracer/gui/gui_defs.h new file mode 100644 index 0000000000000000000000000000000000000000..ec72bb0e2bb14e8951f8bf7e5d3acda960109de8 --- /dev/null +++ b/common/utils/T/tracer/gui/gui_defs.h @@ -0,0 +1,255 @@ +#ifndef _GUI_DEFS_H_ +#define _GUI_DEFS_H_ + +/* defines the private API of the GUI */ + +extern int volatile gui_logd; +#define LOGD(...) do { if (gui_logd) printf(__VA_ARGS__); } while (0) + +/*************************************************************************/ +/* logging macros */ +/*************************************************************************/ + +#define ERR(...) \ + do { \ + printf("%s:%d:%s: ERROR: ", __FILE__, __LINE__, __FUNCTION__); \ + printf(__VA_ARGS__); \ + abort(); \ + } while (0) + +#define WARN(...) \ + do { \ + printf("%s:%d:%s: WARNING: ", __FILE__, __LINE__, __FUNCTION__); \ + printf(__VA_ARGS__); \ + } while (0) + +#define OOM ERR("out of memory\n") + +/*************************************************************************/ +/* widgets */ +/*************************************************************************/ + +enum widget_type { + TOPLEVEL_WINDOW, CONTAINER, POSITIONER, TEXT_LIST, XY_PLOT, BUTTON, LABEL, + TIMELINE, SPACE, IMAGE +}; + +struct widget_list; + +struct widget { + enum widget_type type; + int id; + int x; /* allocated x after packing */ + int y; /* allocated y after packing */ + int width; /* allocated width after packing */ + int height; /* allocated height after packing */ + struct widget_list *children; + struct widget *parent; + void (*repack)(gui *g, widget *this); + void (*add_child)(gui *g, widget *this, widget *child, int position); + void (*del_child)(gui *g, widget *this, widget *child); + void (*allocate)(gui *g, widget *this, int x, int y, int width, int height); + void (*hints)(gui *g, widget *this, int *width, int *height); + void (*paint)(gui *g, widget *this); + void (*clear)(gui *g, widget *this); + /* user input */ + void (*button)(gui *g, widget *this, int x, int y, int key_modifiers, + int button, int up); +}; + +struct widget_list { + struct widget *item; + struct widget_list *next; + //struct widget_list *prev; /* unused? */ + struct widget_list *last; /* valid only for the head of the list */ +}; + +struct toplevel_window_widget { + struct widget common; + void *x; /* opaque X data (type x_window), used in x.c */ +}; + +struct container_widget { + struct widget common; + int vertical; + int hints_are_valid; /* used to cache hints values */ + int hint_width; /* cached hint values - invalid if */ + int hint_height; /* repack_was_called == 1 */ + int *growable; + int nchildren; +}; + +struct positioner_widget { + struct widget common; +}; + +struct textlist_widget { + struct widget common; + char **text; + int *color; + int text_count; + int wanted_width; + int wanted_nlines; /* number of lines of text the user wants to see */ + int allocated_nlines; /* actual number of visible lines */ + int starting_line; /* points to the first visible line of text */ + int line_height; + int baseline; + int background_color; +}; + +struct xy_plot_plot { + float *x; + float *y; + int npoints; + int color; +}; + +struct xy_plot_widget { + struct widget common; + char *label; + int label_width; + int label_height; + int label_baseline; + int vrule_width; /* the width of the vertical ruler text zone */ + float xmin, xmax; + float ymin, ymax; + int wanted_width; + int wanted_height; + struct xy_plot_plot *plots; + int nplots; +}; + +struct timeline_subline { + int *color; /* length = width of timeline widget + * value = -1 if no color + */ + int width; + int background; /* background color of the subline */ +}; + +struct timeline_widget { + struct widget common; + int n; /* number of sublines */ + struct timeline_subline *s; + int subline_height; + int wanted_width; +}; + +struct button_widget { + struct widget common; +}; + +struct label_widget { + struct widget common; + const char *t; + int color; + int width; /* as given by the graphic's backend */ + int height; /* as given by the graphic's backend */ + int baseline; /* as given by the graphic's backend */ +}; + +struct space_widget { + struct widget common; + int wanted_width; + int wanted_height; +}; + +struct image_widget { + struct widget common; + int width; + int height; + void *x; /* opaque X data (type x_image), used in x.c */ +}; + +/*************************************************************************/ +/* events */ +/*************************************************************************/ + +typedef void event; + +enum event_type { + DIRTY, REPACK +}; + +struct event { + enum event_type type; +}; + +struct event_list { + struct event *item; + struct event_list *next; + struct event_list *last; +}; + +struct dirty_event { + struct event common; + int id; +}; + +struct repack_event { + struct event common; + int id; +}; + +/*************************************************************************/ +/* notifications */ +/*************************************************************************/ + +/* same type as in gui.h */ +typedef void (*notifier)(void *private, gui *g, + char *notification, widget *w, void *notification_data); + +struct notifier { + notifier handler; + unsigned long id; + char *notification; + widget *w; + void *private; + /* done is used bu gui_notify */ + int done; +}; + +/*************************************************************************/ +/* main structure */ +/*************************************************************************/ + +struct gui { + void *lock; + void *x; /* opaque X data (type x_connection), used in x.c */ + struct widget_list *toplevel; + struct event_list *queued_events; + int event_pipe[2]; + int next_id; /* tells what is the ID of + the next created widget */ + int repainted; /* set to 1 when some widget has + * been repainted (TODO: can be any, + * to be optimized) */ + void *xwin; /* set by a toplevel_window when + * it paints itself, to be used + * by its children */ + struct notifier *notifiers; + int notifiers_count; + unsigned long next_notifier_id; +}; + +/*************************************************************************/ +/* internal functions */ +/*************************************************************************/ + +widget *new_widget(struct gui *g, enum widget_type type, int size); +void widget_add_child_internal( + gui *_gui, widget *parent, widget *child, int position); +void widget_del_child_internal(gui *_gui, widget *parent, widget *child); +int widget_get_child_position(gui *_gui, widget *parent, widget *child); + +const char *widget_name(enum widget_type type); + +void send_event(gui *gui, enum event_type type, ...); +void gui_events(gui *gui); + +struct widget *find_widget(struct gui *g, int id); + +void gui_notify(struct gui *g, char *notification, widget *w, + void *notification_data); + +#endif /* _GUI_DEFS_H_ */ diff --git a/common/utils/T/tracer/gui/image.c b/common/utils/T/tracer/gui/image.c new file mode 100644 index 0000000000000000000000000000000000000000..df9a7b8296ae40ea19221a4b1f8d65c20a899178 --- /dev/null +++ b/common/utils/T/tracer/gui/image.c @@ -0,0 +1,114 @@ +#include "gui.h" +#include "gui_defs.h" +#include "x.h" +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <png.h> + +static void paint(gui *_gui, widget *_w) +{ + struct gui *g = _gui; + struct image_widget *w = _w; + LOGD("PAINT image %p\n", w); + x_draw_image(g->x, g->xwin, w->x, w->common.x, w->common.y); +} + +static void hints(gui *_gui, widget *_w, int *width, int *height) +{ + struct image_widget *w = _w; + LOGD("HINTS image %p\n", w); + *width = w->width; + *height = w->height; +} + +struct png_reader { + unsigned char *data; + int size; + int pos; +}; + +static void png_readfn(png_structp png_ptr, png_bytep data, png_size_t length) +{ + struct png_reader *r = png_get_io_ptr(png_ptr); + if (length > r->size - r->pos) png_error(png_ptr, "bad png image"); + memcpy(data, r->data + r->pos, length); + r->pos += length; +} + +static void load_image(struct gui *g, struct image_widget *w, + unsigned char *data, int length) +{ + png_structp png_ptr; + png_infop info_ptr; + png_bytepp image; + int width, height, bit_depth, color_type, channels; + unsigned char *img_data; + struct png_reader r; + int i; + + /* unpack PNG data */ + + r.data = data; + r.size = length; + r.pos = 0; + + png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); + if (png_ptr == NULL) abort(); + + info_ptr = png_create_info_struct(png_ptr); + if (info_ptr == NULL) abort(); + + if (setjmp(png_jmpbuf(png_ptr))) abort(); + + png_set_read_fn(png_ptr, &r, png_readfn); + + png_read_png(png_ptr, info_ptr, + PNG_TRANSFORM_STRIP_16 | PNG_TRANSFORM_EXPAND | PNG_TRANSFORM_PACKING | + PNG_TRANSFORM_GRAY_TO_RGB | PNG_TRANSFORM_BGR, NULL); + + image = png_get_rows(png_ptr, info_ptr); + + width = png_get_image_width(png_ptr, info_ptr); + height = png_get_image_height(png_ptr, info_ptr); + bit_depth = png_get_bit_depth(png_ptr, info_ptr); + color_type = png_get_color_type(png_ptr, info_ptr); + channels = png_get_channels(png_ptr, info_ptr); + + if (width < 1 || width > 1000 || height < 1 || height > 1000 || + bit_depth != 8 || color_type != PNG_COLOR_TYPE_RGBA || channels != 4) + { printf("bad image\n"); abort(); } + + img_data = malloc(4 * width * height); if (img_data == NULL) abort(); + for (i = 0; i < height; i++) + memcpy(img_data+i*4*width, image[i], width*4); + + png_destroy_read_struct(&png_ptr, &info_ptr, NULL); + + /* create the X image */ + w->x = x_create_image(g->x, img_data, width, height); + + free(img_data); + + w->width = width; + w->height = height; +} + +widget *new_image(gui *_gui, unsigned char *data, int length) +{ + struct gui *g = _gui; + struct image_widget *w; + + glock(g); + + w = new_widget(g, IMAGE, sizeof(struct image_widget)); + + load_image(g, w, data, length); + + w->common.paint = paint; + w->common.hints = hints; + + gunlock(g); + + return w; +} diff --git a/common/utils/T/tracer/gui/init.c b/common/utils/T/tracer/gui/init.c new file mode 100644 index 0000000000000000000000000000000000000000..c6d5e3e435366b574b3495ee41b9c6df45621744 --- /dev/null +++ b/common/utils/T/tracer/gui/init.c @@ -0,0 +1,34 @@ +#include "gui.h" +#include "gui_defs.h" +#include "x.h" +#include <stdio.h> +#include <stdlib.h> +#include <pthread.h> +#include <unistd.h> +#include <errno.h> +#include <string.h> + +gui *gui_init(void) +{ + struct gui *ret; + + ret = calloc(1, sizeof(struct gui)); + if (ret == NULL) OOM; + + ret->lock = malloc(sizeof(pthread_mutex_t)); + if (ret->lock == NULL) OOM; + if (pthread_mutex_init(ret->lock, NULL)) + ERR("mutex initialization failed\n"); + + if (pipe(ret->event_pipe)) + ERR("%s\n", strerror(errno)); + + /* lock not necessary but there for consistency (when instrumenting x.c + * we need the gui to be locked when calling any function in x.c) + */ + glock(ret); + ret->x = x_open(); + gunlock(ret); + + return ret; +} diff --git a/common/utils/T/tracer/gui/label.c b/common/utils/T/tracer/gui/label.c new file mode 100644 index 0000000000000000000000000000000000000000..f649fa520147cb1bde0099bd9bab2f1330813423 --- /dev/null +++ b/common/utils/T/tracer/gui/label.c @@ -0,0 +1,83 @@ +#include "gui.h" +#include "gui_defs.h" +#include "x.h" +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +static void paint(gui *_gui, widget *_w) +{ + struct gui *g = _gui; + struct label_widget *l = _w; + LOGD("PAINT label '%s'\n", l->t); + x_draw_string(g->x, g->xwin, DEFAULT_FONT, l->color, + l->common.x, l->common.y + l->baseline, l->t); +} + +static void hints(gui *_gui, widget *_w, int *width, int *height) +{ + struct label_widget *l = _w; + LOGD("HINTS label '%s'\n", l->t); + *width = l->width; + *height = l->height; +} + +widget *new_label(gui *_gui, const char *label) +{ + struct gui *g = _gui; + struct label_widget *w; + + glock(g); + + w = new_widget(g, LABEL, sizeof(struct label_widget)); + + w->t = strdup(label); + if (w->t == NULL) OOM; + w->color = FOREGROUND_COLOR; + + x_text_get_dimensions(g->x, DEFAULT_FONT, label, + &w->width, &w->height, &w->baseline); + + w->common.paint = paint; + w->common.hints = hints; + + gunlock(g); + + return w; +} + +static void button(gui *gui, widget *_this, int x, int y, + int key_modifiers, int button, int up) +{ + LOGD("BUTTON label %p xy %d %d button %d up %d\n", _this, x, y, button, up); + + if (up != 0) return; + + gui_notify(gui, "click", _this, &button); +} + +/* we could use default_button, but it's in widget.c, so, well... */ +static void no_button(gui *gui, widget *_this, int x, int y, + int key_modifiers, int button, int up) +{ + /* do nothing */ +} + +/*************************************************************************/ +/* public functions */ +/*************************************************************************/ + +void label_set_clickable(gui *_g, widget *_this, int clickable) +{ + struct gui *g = _g; + struct label_widget *this = _this; + + glock(g); + + if (clickable) + this->common.button = button; + else + this->common.button = no_button; + + gunlock(g); +} diff --git a/common/utils/T/tracer/gui/loop.c b/common/utils/T/tracer/gui/loop.c new file mode 100644 index 0000000000000000000000000000000000000000..8ceb3c06e1c4936dc508fea8e1ce8dc33b0d99c3 --- /dev/null +++ b/common/utils/T/tracer/gui/loop.c @@ -0,0 +1,66 @@ +#include "gui.h" +#include "gui_defs.h" +#include "x.h" +#include <sys/select.h> +#include <stdio.h> +#include <stdlib.h> +#include <errno.h> +#include <string.h> +#include <unistd.h> + +void gui_loop(gui *_gui) +{ + struct gui *g = _gui; + int xfd; + int eventfd; + int maxfd; + fd_set rd; + + /* lock not necessary but there for consistency (when instrumenting x.c + * we need the gui to be locked when calling any function in x.c) + */ + glock(g); + xfd = x_connection_fd(g->x); + gunlock(g); + eventfd = g->event_pipe[0]; + + if (eventfd > xfd) maxfd = eventfd; + else maxfd = xfd; + + while (1) { + glock(g); + x_flush(g->x); + gunlock(g); + FD_ZERO(&rd); + FD_SET(xfd, &rd); + FD_SET(eventfd, &rd); + if (select(maxfd+1, &rd, NULL, NULL, NULL) == -1) + ERR("select: %s\n", strerror(errno)); + + glock(g); + + if (FD_ISSET(xfd, &rd)) + x_events(g); + + if (FD_ISSET(eventfd, &rd)) { + char c[256]; + if (read(eventfd, c, 256)); /* for no gcc warnings */ + } + + gui_events(g); + + if (g->repainted) { + struct widget_list *cur; + g->repainted = 0; + cur = g->toplevel; + while (cur) { + struct toplevel_window_widget *w = + (struct toplevel_window_widget *)cur->item; + x_draw(g->x, w->x); + cur = cur->next; + } + } + + gunlock(g); + } +} diff --git a/common/utils/T/tracer/gui/notify.c b/common/utils/T/tracer/gui/notify.c new file mode 100644 index 0000000000000000000000000000000000000000..7ff40069411a1bd9bae7d0106b686c41b04b6ef6 --- /dev/null +++ b/common/utils/T/tracer/gui/notify.c @@ -0,0 +1,116 @@ +#include "gui.h" +#include "gui_defs.h" +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +unsigned long register_notifier(gui *_g, char *notification, widget *w, + notifier handler, void *private) +{ + struct gui *g = _g; + unsigned long ret; + + glock(g); + + if (g->next_notifier_id == 2UL * 1024 * 1024 * 1024) + ERR("%s:%d: report a bug\n", __FILE__, __LINE__); + + g->notifiers = realloc(g->notifiers, + (g->notifiers_count+1) * sizeof(struct notifier)); + if (g->notifiers == NULL) abort(); + + ret = g->next_notifier_id; + + g->notifiers[g->notifiers_count].handler = handler; + g->notifiers[g->notifiers_count].id = g->next_notifier_id; + g->next_notifier_id++; + g->notifiers[g->notifiers_count].notification = strdup(notification); + if (g->notifiers[g->notifiers_count].notification == NULL) abort(); + g->notifiers[g->notifiers_count].w = w; + g->notifiers[g->notifiers_count].private = private; + /* initialize done to 1 so as not to call the handler if it's created + * by the call of another one that is in progress + */ + g->notifiers[g->notifiers_count].done = 1; + + g->notifiers_count++; + + gunlock(g); + + return ret; +} + +void unregister_notifier(gui *_g, unsigned long notifier_id) +{ + struct gui *g = _g; + int i; + + glock(g); + + for (i = 0; i < g->notifiers_count; i++) + if (g->notifiers[i].id == notifier_id) break; + + if (i == g->notifiers_count) + ERR("%s:%d: notifier_id %ld not found\n", __FILE__,__LINE__,notifier_id); + + free(g->notifiers[i].notification); + + memmove(g->notifiers + i, g->notifiers + i + 1, + (g->notifiers_count-1 - i) * sizeof(struct notifier)); + + g->notifiers_count--; + g->notifiers = realloc(g->notifiers, + g->notifiers_count * sizeof(struct notifier)); + if (g->notifiers == NULL) abort(); + + gunlock(g); +} + +/* called with lock ON */ +void gui_notify(struct gui *g, char *notification, widget *w, + void *notification_data) +{ + void *private; + notifier handler; + int i; + + /* this function is not re-entrant, for the moment keep as is + * and if the need is there, we'll make a new thread to handle + * notifications (or something) + * for now let's crash in case of recursive call + */ + static int inside = 0; + if (inside) ERR("%s:%d: BUG! contact the authors\n", __FILE__, __LINE__); + inside = 1; + + /* clear all handlers */ + /* TODO: speedup */ + for (i = 0; i < g->notifiers_count; i++) g->notifiers[i].done = 0; + + /* calling the handler may modify the list of notifiers, we + * need to be careful here + */ +loop: + for (i = 0; i < g->notifiers_count; i++) { + if (g->notifiers[i].done == 1 || + g->notifiers[i].w != w || + strcmp(g->notifiers[i].notification, notification) != 0) + continue; + break; + } + if (i == g->notifiers_count) goto done; + + g->notifiers[i].done = 1; + + handler = g->notifiers[i].handler; + private = g->notifiers[i].private; + + gunlock(g); + handler(private, g, notification, w, notification_data); + glock(g); + + goto loop; + +done: + inside = 0; +} diff --git a/common/utils/T/tracer/gui/positioner.c b/common/utils/T/tracer/gui/positioner.c new file mode 100644 index 0000000000000000000000000000000000000000..673ffb32ded28295032e76e96626a179f11d8d23 --- /dev/null +++ b/common/utils/T/tracer/gui/positioner.c @@ -0,0 +1,93 @@ +#include "gui.h" +#include "gui_defs.h" +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +static void add_child(gui *g, widget *_this, widget *child, int position) +{ + LOGD("ADD_CHILD positioner\n"); + struct positioner_widget *this = _this; + widget_add_child_internal(g, this, child, position); +} + +static void del_child(gui *g, widget *_this, widget *child) +{ + LOGD("DEL_CHILD positioner\n"); + struct positioner_widget *this = _this; + widget_del_child_internal(g, this, child); +} + +static void allocate( + gui *_g, widget *_this, int x, int y, int width, int height) +{ + LOGD("ALLOCATE positioner %p\n", _this); + struct gui *g = _g; + struct positioner_widget *this = _this; + struct widget_list *l = this->common.children; + int cwidth, cheight; + + this->common.x = x; + this->common.y = y; + this->common.width = width; + this->common.height = height; + + if (l != NULL) { + l->item->hints(g, l->item, &cwidth, &cheight); + l->item->allocate(g, l->item, x+(width-cwidth)/2, y+(height-cheight)/2, + cwidth, cheight); + } +} + +static void hints(gui *_gui, widget *_w, int *width, int *height) +{ + LOGD("HINTS positioner %p\n", _w); + struct gui *g = _gui; + struct positioner_widget *this = _w; + struct widget_list *l = this->common.children; + if (l != NULL) + l->item->hints(g, l->item, width, height); + else { *width = *height = 1; } +} + +static void button(gui *_g, widget *_this, int x, int y, + int key_modifiers, int button, int up) +{ + LOGD("BUTTON positioner %p xy %d %d button %d up %d\n", _this, x, y, button, up); + struct gui *g = _g; + struct positioner_widget *this = _this; + struct widget_list *l = this->common.children; + if (l != NULL) + l->item->button(g, l->item, x, y, key_modifiers, button, up); +} + +static void paint(gui *_gui, widget *_this) +{ + LOGD("PAINT positioner\n"); + struct gui *g = _gui; + struct widget *this = _this; + struct widget_list *l = this->children; + if (l != NULL) + l->item->paint(g, l->item); +} + +widget *new_positioner(gui *_gui) +{ + struct gui *g = _gui; + struct positioner_widget *w; + + glock(g); + + w = new_widget(g, POSITIONER, sizeof(struct positioner_widget)); + + w->common.paint = paint; + w->common.add_child = add_child; + w->common.del_child = del_child; + w->common.allocate = allocate; + w->common.hints = hints; + w->common.button = button; + + gunlock(g); + + return w; +} diff --git a/common/utils/T/tracer/gui/space.c b/common/utils/T/tracer/gui/space.c new file mode 100644 index 0000000000000000000000000000000000000000..c98600b88dc6edecac53d1e0417d533a312c1c4e --- /dev/null +++ b/common/utils/T/tracer/gui/space.c @@ -0,0 +1,36 @@ +#include "gui.h" +#include "gui_defs.h" +#include <stdio.h> + +static void paint(gui *_gui, widget *_w) +{ + /* nothing */ +} + +static void hints(gui *_gui, widget *_w, int *width, int *height) +{ + struct space_widget *w = _w; + LOGD("HINTS space %p\n", w); + *width = w->wanted_width; + *height = w->wanted_height; +} + +widget *new_space(gui *_gui, int width, int height) +{ + struct gui *g = _gui; + struct space_widget *w; + + glock(g); + + w = new_widget(g, SPACE, sizeof(struct space_widget)); + + w->wanted_width = width; + w->wanted_height = height; + + w->common.paint = paint; + w->common.hints = hints; + + gunlock(g); + + return w; +} diff --git a/common/utils/T/tracer/gui/test.c b/common/utils/T/tracer/gui/test.c new file mode 100644 index 0000000000000000000000000000000000000000..f64d02347e3383eb7b039156fc07db4585df5d6a --- /dev/null +++ b/common/utils/T/tracer/gui/test.c @@ -0,0 +1,46 @@ +#include "gui.h" + +int main(void) +{ + gui *g; + widget *w, *c1, *c2, *l, *plot, *tl; + int tlcol; + + g = gui_init(); + + c1 = new_container(g, VERTICAL); + c2 = new_container(g, HORIZONTAL); + + l = new_label(g, "this is a good label"); + widget_add_child(g, c2, l, 0); + l = new_label(g, "this is another good label"); + widget_add_child(g, c2, l, -1); + + l = new_label(g, "OH! WHAT A LABEL!"); + widget_add_child(g, c1, l, -1); + + widget_add_child(g, c1, c2, 0); + + plot = new_xy_plot(g, 100, 100, "xy plot test", 30); +#if 0 + c2 = new_container(g, HORIZONTAL); + widget_add_child(g, c2, plot, -1); + widget_add_child(g, c1, c2, -1); +#else + widget_add_child(g, c1, plot, -1); +#endif + + tlcol = new_color(g, "#ddf"); + tl = new_textlist(g, 300, 10, tlcol); + widget_add_child(g, c1, tl, -1); + + textlist_add(g, tl, "hello", -1, FOREGROUND_COLOR); + textlist_add(g, tl, "world", -1, FOREGROUND_COLOR); + + w = new_toplevel_window(g, 500, 400, "test window"); + widget_add_child(g, w, c1, 0); + + gui_loop(g); + + return 0; +} diff --git a/common/utils/T/tracer/gui/textlist.c b/common/utils/T/tracer/gui/textlist.c new file mode 100644 index 0000000000000000000000000000000000000000..896cba5b9e8b6949321af0789214780552fede12 --- /dev/null +++ b/common/utils/T/tracer/gui/textlist.c @@ -0,0 +1,248 @@ +#include "gui.h" +#include "gui_defs.h" +#include "x.h" +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +static void paint(gui *_gui, widget *_this) +{ + struct gui *g = _gui; + struct textlist_widget *this = _this; + int i, j; + LOGD("PAINT textlist %p xywh %d %d %d %d starting line %d allocated nlines %d text_count %d\n", _this, this->common.x, this->common.y, this->common.width, this->common.height, this->starting_line, this->allocated_nlines, this->text_count); + x_fill_rectangle(g->x, g->xwin, this->background_color, + this->common.x, this->common.y, + this->common.width, this->common.height); + for (i = 0, j = this->starting_line; + i < this->allocated_nlines && j < this->text_count; i++, j++) + x_draw_clipped_string(g->x, g->xwin, DEFAULT_FONT, this->color[j], + this->common.x, + this->common.y + i * this->line_height + this->baseline, + this->text[j], + this->common.x, this->common.y, + this->common.width, this->common.height); +} + +static void hints(gui *_gui, widget *_w, int *width, int *height) +{ + struct textlist_widget *w = _w; + *width = w->wanted_width; + *height = w->wanted_nlines * w->line_height; + LOGD("HINTS textlist wh %d %d\n", *width, *height); +} + +static void allocate( + gui *gui, widget *_this, int x, int y, int width, int height) +{ + struct textlist_widget *this = _this; + this->common.x = x; + this->common.y = y; + this->common.width = width; + this->common.height = height; + this->allocated_nlines = height / this->line_height; + LOGD("ALLOCATE textlist %p xywh %d %d %d %d nlines %d\n", this, x, y, width, height, this->allocated_nlines); +} + +static void button(gui *_g, widget *_this, int x, int y, + int key_modifiers, int button, int up) +{ + struct gui *g = _g; + struct textlist_widget *this = _this; + LOGD("BUTTON textlist %p xy %d %d button %d up %d\n", _this, x, y, button, up); + y -= this->common.y; + x -= this->common.x; + /* scroll up */ + if (button == 4 && up == 0) { + gui_notify(g, "scrollup", _this, NULL); + } + /* scroll down */ + if (button == 5 && up == 0) { + gui_notify(g, "scrolldown", _this, NULL); + } + /* button 1/2/3 click */ + if (button >= 1 && button <= 3 && up == 0) { + int line = this->starting_line + y / this->line_height; + if (line >= 0 && line < this->text_count) + gui_notify(g, "click", _this, (int[2]){ line, button }); + } +} + +widget *new_textlist(gui *_gui, int width, int nlines, int bgcol) +{ + struct gui *g = _gui; + struct textlist_widget *w; + int dummy; + + glock(g); + + w = new_widget(g, TEXT_LIST, sizeof(struct textlist_widget)); + + w->wanted_nlines = nlines; + x_text_get_dimensions(g->x, DEFAULT_FONT, ".", + &dummy, &w->line_height, &w->baseline); + w->background_color = bgcol; + w->wanted_width = width; + + w->common.paint = paint; + w->common.hints = hints; + w->common.allocate = allocate; + + w->common.button = button; + + gunlock(g); + + return w; +} + +/*************************************************************************/ +/* public functions */ +/*************************************************************************/ + +static void _textlist_add(gui *_gui, widget *_this, const char *text, + int position, int color, int silent) +{ + struct gui *g = _gui; + struct textlist_widget *this = _this; + + glock(g); + + if (position < 0) position = this->text_count; + if (position > this->text_count) position = this->text_count; + + this->text_count++; + this->text = realloc(this->text, this->text_count * sizeof(char *)); + if (this->text == NULL) OOM; + this->color = realloc(this->color, this->text_count * sizeof(int)); + if (this->color == NULL) OOM; + + memmove(this->text + position + 1, this->text + position, + (this->text_count-1 - position) * sizeof(char *)); + memmove(this->color + position + 1, this->color + position, + (this->text_count-1 - position) * sizeof(int)); + + this->text[position] = strdup(text); if (this->text[position] == NULL) OOM; + this->color[position] = color; + + if (!silent) send_event(g, DIRTY, this->common.id); + + gunlock(g); +} + +static void _textlist_del(gui *_gui, widget *_this, int position, int silent) +{ + struct gui *g = _gui; + struct textlist_widget *this = _this; + + glock(g); + + /* TODO: useful check? */ + if (this->text_count == 0) goto done; + + if (position < 0) position = this->text_count; + if (position > this->text_count-1) position = this->text_count-1; + + free(this->text[position]); + + memmove(this->text + position, this->text + position + 1, + (this->text_count-1 - position) * sizeof(char *)); + memmove(this->color + position, this->color + position + 1, + (this->text_count-1 - position) * sizeof(int)); + + this->text_count--; + this->text = realloc(this->text, this->text_count * sizeof(char *)); + if (this->text == NULL) OOM; + this->color = realloc(this->color, this->text_count * sizeof(int)); + if (this->color == NULL) OOM; + + if (!silent) send_event(g, DIRTY, this->common.id); + +done: + gunlock(g); +} + +void textlist_add(gui *gui, widget *this, const char *text, int position, + int color) +{ + _textlist_add(gui, this, text, position, color, 0); +} + +void textlist_del(gui *gui, widget *this, int position) +{ + _textlist_del(gui, this, position, 0); +} + +void textlist_add_silent(gui *gui, widget *this, const char *text, + int position, int color) +{ + _textlist_add(gui, this, text, position, color, 1); +} + +void textlist_del_silent(gui *gui, widget *this, int position) +{ + _textlist_del(gui, this, position, 1); +} + +void textlist_state(gui *_gui, widget *_this, + int *visible_lines, int *start_line, int *number_of_lines) +{ + struct gui *g = _gui; + struct textlist_widget *this = _this; + + glock(g); + + *visible_lines = this->allocated_nlines; + *start_line = this->starting_line; + *number_of_lines = this->text_count; + + gunlock(g); +} + +void textlist_set_start_line(gui *_gui, widget *_this, int line) +{ + struct gui *g = _gui; + struct textlist_widget *this = _this; + + glock(g); + + this->starting_line = line; + + send_event(g, DIRTY, this->common.id); + + gunlock(g); +} + +void textlist_get_line(gui *_gui, widget *_this, int line, + char **text, int *color) +{ + struct gui *g = _gui; + struct textlist_widget *this = _this; + + glock(g); + + if (line < 0 || line >= this->text_count) { + *text = NULL; + *color = -1; + } else { + *text = this->text[line]; + *color = this->color[line]; + } + + gunlock(g); +} + +void textlist_set_color(gui *_gui, widget *_this, int line, int color) +{ + struct gui *g = _gui; + struct textlist_widget *this = _this; + + glock(g); + + if (line >= 0 && line < this->text_count) { + this->color[line] = color; + + send_event(g, DIRTY, this->common.id); + } + + gunlock(g); +} diff --git a/common/utils/T/tracer/gui/timeline.c b/common/utils/T/tracer/gui/timeline.c new file mode 100644 index 0000000000000000000000000000000000000000..d2373ff60a4007f856c4349b339438852446b1bf --- /dev/null +++ b/common/utils/T/tracer/gui/timeline.c @@ -0,0 +1,214 @@ +#include "gui.h" +#include "gui_defs.h" +#include "x.h" +#include <stdio.h> +#include <stdlib.h> + +static void paint(gui *_gui, widget *_this) +{ + struct gui *g = _gui; + struct timeline_widget *this = _this; + int i; + int j; + + for (i = 0; i < this->n; i++) { + x_fill_rectangle(g->x, g->xwin, this->s[i].background, + this->common.x, this->common.y + i * this->subline_height, + this->common.width, this->subline_height); + for (j = 0; j < this->s[i].width; j++) + if (this->s[i].color[j] != -1) + x_draw_line(g->x, g->xwin, this->s[i].color[j], + this->common.x + j, this->common.y + i * this->subline_height, + this->common.x + j, this->common.y + this->subline_height -1 + + i * this->subline_height); + } + + LOGD("PAINT timeline xywh %d %d %d %d\n", this->common.x, this->common.y, this->common.width, this->common.height); +} + +static void hints(gui *_gui, widget *_w, int *width, int *height) +{ + struct timeline_widget *w = _w; + *width = w->wanted_width; + *height = w->n * w->subline_height; + LOGD("HINTS timeline wh %d %d\n", *width, *height); +} + +static void allocate(gui *_gui, widget *_this, + int x, int y, int width, int height) +{ + struct timeline_widget *this = _this; + int i; + int j; + this->common.x = x; + this->common.y = y; + this->common.width = width; + this->common.height = height; + LOGD("ALLOCATE timeline %p xywh %d %d %d %d\n", this, x, y, width, height); + for (i = 0; i < this->n; i++) { + this->s[i].width = width; + this->s[i].color = realloc(this->s[i].color, width * sizeof(int)); + if (this->s[i].color == NULL) abort(); + for (j = 0; j < width; j++) this->s[i].color[j] = -1; + } + gui_notify(_gui, "resize", _this, &width); +} + +static void button(gui *_g, widget *_this, int x, int y, + int key_modifiers, int button, int up) +{ + struct gui *g = _g; + struct timeline_widget *w = _this; + int d[3]; + LOGD("BUTTON timeline %p xy %d %d button %d up %d\n", _this, x, y, button, up); + /* scroll up */ + if (button == 4 && up == 0) { + d[0] = x - w->common.x; + d[1] = y - w->common.y; + d[2] = key_modifiers; + gui_notify(g, "scrollup", _this, d); + } + /* scroll down */ + if (button == 5 && up == 0) { + d[0] = x - w->common.x; + d[1] = y - w->common.y; + d[2] = key_modifiers; + gui_notify(g, "scrolldown", _this, d); + } + /* button 1/2/3 */ + if ((button == 1 || button == 2 || button == 3) && up == 0) { + gui_notify(g, "click", _this, &button); + } +} + +/*************************************************************************/ +/* creation function */ +/*************************************************************************/ + +widget *new_timeline(gui *_gui, int width, int number_of_sublines, + int subline_height) +{ + struct gui *g = _gui; + struct timeline_widget *w; + int i; + int j; + + glock(g); + + w = new_widget(g, TIMELINE, sizeof(struct timeline_widget)); + + w->wanted_width = width; + w->n = number_of_sublines; + w->s = calloc(w->n, sizeof(struct timeline_subline)); if (w->s == NULL) OOM; + w->subline_height = subline_height; + + /* initialize colors */ + for (i = 0; i < w->n; i++) { + w->s[i].width = width; + w->s[i].color = calloc(width, sizeof(int)); + if (w->s[i].color == NULL) abort(); + for (j = 0; j < width; j++) w->s[i].color[j] = -1; + w->s[i].background = BACKGROUND_COLOR; + } + + w->common.paint = paint; + w->common.hints = hints; + w->common.allocate = allocate; + w->common.button = button; + + gunlock(g); + + return w; +} + +/*************************************************************************/ +/* public functions */ +/*************************************************************************/ + +static void _timeline_clear(gui *_gui, widget *_this, int silent) +{ + struct gui *g = _gui; + struct timeline_widget *this = _this; + int i; + int j; + + glock(g); + + for (i = 0; i < this->n; i++) + for (j = 0; j < this->s[i].width; j++) + this->s[i].color[j] = -1; + + if (silent == 0) + send_event(g, DIRTY, this->common.id); + + gunlock(g); +} + +void timeline_clear(gui *_gui, widget *_this) +{ + _timeline_clear(_gui, _this, 0); +} + +void timeline_clear_silent(gui *_gui, widget *_this) +{ + _timeline_clear(_gui, _this, 1); +} + +static void _timeline_add_points(gui *_gui, widget *_this, int subline, + int color, int *x, int len, int silent) +{ + struct gui *g = _gui; + struct timeline_widget *this = _this; + int i; + + glock(g); + + for (i = 0; i < len; i++) { + if (x[i] >= this->s[subline].width) { WARN("out of bounds\n"); continue; } + this->s[subline].color[x[i]] = color; + } + + if (silent == 0) + send_event(g, DIRTY, this->common.id); + + gunlock(g); +} + +void timeline_add_points(gui *_gui, widget *_this, int subline, int color, + int *x, int len) +{ + _timeline_add_points(_gui, _this, subline, color, x, len, 0); +} + +void timeline_add_points_silent(gui *_gui, widget *_this, int subline, + int color, int *x, int len) +{ + _timeline_add_points(_gui, _this, subline, color, x, len, 1); +} + +void timeline_set_subline_background_color(gui *_gui, widget *_this, + int subline, int color) +{ + struct gui *g = _gui; + struct timeline_widget *this = _this; + + glock(g); + + this->s[subline].background = color; + + send_event(g, DIRTY, this->common.id); + + gunlock(g); +} + +void timeline_get_width(gui *_gui, widget *_this, int *width) +{ + struct gui *g = _gui; + struct timeline_widget *this = _this; + + glock(g); + + *width = this->common.width == 0 ? this->wanted_width : this->common.width; + + gunlock(g); +} diff --git a/common/utils/T/tracer/gui/toplevel_window.c b/common/utils/T/tracer/gui/toplevel_window.c new file mode 100644 index 0000000000000000000000000000000000000000..d2436c84f9a0b2dcea2442d07c2ba528d294bd57 --- /dev/null +++ b/common/utils/T/tracer/gui/toplevel_window.c @@ -0,0 +1,97 @@ +#include "gui.h" +#include "gui_defs.h" +#include "x.h" +#include <stdio.h> +#include <stdlib.h> + +/**********************************************************************/ +/* callback functions */ +/**********************************************************************/ + +static void repack(gui *g, widget *_this) +{ + LOGD("REPACK toplevel_window\n"); + struct toplevel_window_widget *this = _this; + if (this->common.children == NULL) ERR("toplevel window has no child\n"); + if (this->common.children->next != NULL) + ERR("toplevel window has too much children\n"); + this->common.children->item->allocate(g, this->common.children->item, + 0 /* x */, 0 /* y */, this->common.width, this->common.height); + send_event(g, DIRTY, this->common.id); +} + +static void add_child(gui *_gui, widget *_this, widget *child, int position) +{ + LOGD("ADD_CHILD toplevel_window\n"); + struct widget *this = _this; + if (this->children != NULL) { + WARN("toplevel window already has a child\n"); + return; + } + widget_add_child_internal(_gui, _this, child, 0); /* this does the REPACK */ +} + +/* called when the underlying window is resized by the user or the system */ +static void allocate( + gui *_gui, widget *_this, int x, int y, int width, int height) +{ + LOGD("ALLOCATE toplevel_window\n"); + struct toplevel_window_widget *this = _this; + this->common.width = width; + this->common.height = height; +// repack(_gui, _this); + send_event(_gui, REPACK, this->common.id); +} + +static void paint(gui *_gui, widget *_this) +{ + struct gui *g = _gui; + struct toplevel_window_widget *this = _this; + LOGD("PAINT toplevel_window (%d %d)\n", this->common.width, this->common.height); + x_fill_rectangle(g->x, this->x, BACKGROUND_COLOR, + 0, 0, this->common.width, this->common.height); + g->xwin = this->x; + this->common.children->item->paint(_gui, this->common.children->item); + g->xwin = NULL; /* TODO: remove? it's just in case */ +} + +static void button(gui *_g, widget *_this, int x, int y, + int key_modifiers, int button, int up) +{ + struct gui *g = _g; + struct toplevel_window_widget *this = _this; + g->xwin = this->x; + this->common.children->item->button(_g, this->common.children->item, + x, y, key_modifiers, button, up); + g->xwin = NULL; /* TODO: remove? it's just in case */ +} + +/**********************************************************************/ +/* creation */ +/**********************************************************************/ + +widget *new_toplevel_window(gui *_gui, int width, int height, char *title) +{ + struct gui *g = _gui; + struct toplevel_window_widget *w; + + glock(g); + + w = new_widget(g, TOPLEVEL_WINDOW, sizeof(struct toplevel_window_widget)); + + w->common.width = width; + w->common.height = height; + + w->x = x_create_window(g->x, width, height, title); + + w->common.repack = repack; + w->common.add_child = add_child; + w->common.allocate = allocate; + w->common.paint = paint; + + w->common.button = button; + + gunlock(g); + + return w; +} diff --git a/common/utils/T/tracer/gui/widget.c b/common/utils/T/tracer/gui/widget.c new file mode 100644 index 0000000000000000000000000000000000000000..362d2e1e4898c39960033fe206518d902a3ba897 --- /dev/null +++ b/common/utils/T/tracer/gui/widget.c @@ -0,0 +1,322 @@ +#include "gui.h" +#include "gui_defs.h" +#include "x.h" +#include <stdio.h> +#include <stdlib.h> +#include <stdarg.h> +#include <string.h> + +static void default_clear(gui *gui, widget *_this); +static void default_repack(gui *gui, widget *_this); +static void default_allocate( + gui *gui, widget *_this, int x, int y, int width, int height); +static void default_add_child( + gui *_gui, widget *_this, widget *child, int position); +static void default_del_child(gui *_gui, widget *_this, widget *child); +static void default_hints(gui *g, widget *this, int *width, int *height); +static void default_button(gui *gui, widget *_this, int x, int y, + int key_modifiers, int button, int up); + +static void toplevel_list_append(struct gui *g, struct widget *e) +{ + struct widget_list *new; + + new = calloc(1, sizeof(struct widget_list)); + if (new == NULL) OOM; + + new->item = e; + + if (g->toplevel == NULL) { + g->toplevel = new; + new->last = new; + return; + } + + g->toplevel->last->next = new; + g->toplevel->last = new; +} + +widget *new_widget(struct gui *g, enum widget_type type, int size) +{ + struct widget *ret; + + //glock(g); + + ret = calloc(1, size); + if (ret == NULL) OOM; + + ret->clear = default_clear; + ret->repack = default_repack; + ret->add_child = default_add_child; + ret->del_child = default_del_child; + ret->allocate = default_allocate; + ret->hints = default_hints; + ret->button = default_button; + /* there is no default paint, on purpose */ + + ret->type = type; + ret->id = g->next_id; + g->next_id++; + ret->width = 0; + ret->height = 0; + + /* add toplevel windows to g->toplevel */ + if (type == TOPLEVEL_WINDOW) + toplevel_list_append(g, ret); + + //gunlock(g); + + return ret; +} + +/*************************************************************************/ +/* internal functions */ +/*************************************************************************/ + +void widget_add_child_internal( + gui *_gui, widget *parent, widget *child, int position) +{ + struct widget *p = parent; + struct widget *c = child; + struct widget_list *new; + struct widget_list *prev, *cur; + int i; + + new = calloc(1, sizeof(struct widget_list)); + if (new == NULL) OOM; + + new->item = c; + c->parent = p; + + prev = NULL; + cur = p->children; + + for (i = 0; position < 0 || i < position; i++) { + if (cur == NULL) break; + prev = cur; + cur = cur->next; + } + + /* TODO: warn/err if i != position+1? */ + + if (prev == NULL) { + /* new is at head */ + new->next = p->children; + if (p->children != NULL) new->last = p->children->last; + else new->last = new; + p->children = new; + goto repack; + } + + if (cur == NULL) { + /* new is at tail */ + prev->next = new; + p->children->last = new; + goto repack; + } + + /* new is between two existing items */ + prev->next = new; + new->next = cur; + +repack: + send_event(_gui, REPACK, p->id); +} + +void widget_del_child_internal(gui *_gui, widget *parent, widget *child) +{ + struct widget *p = parent; + struct widget *c = child; + struct widget_list *prev, *cur; + + c->parent = NULL; + + prev = NULL; + cur = p->children; + + while (cur != NULL && cur->item != c) { + prev = cur; + cur = cur->next; + } + + if (cur == NULL) ERR("child not found\n"); + + if (prev == NULL) { + /* child is at head */ + p->children = cur->next; + if (p->children != NULL) p->children->last = cur->last; + goto done; + } + + if (cur->next == NULL) { + /* child is last (and prev is != NULL) */ + prev->next = NULL; + p->children->last = prev; + goto done; + } + + /* child is between two existing items */ + prev->next = cur->next; + +done: + free(cur); + send_event(_gui, REPACK, p->id); +} + +int widget_get_child_position(gui *_gui, widget *parent, widget *child) +{ + struct widget *p = parent; + struct widget *c = child; + struct widget_list *cur; + int i = 0; + + cur = p->children; + + while (cur != NULL && cur->item != c) { + cur = cur->next; + i++; + } + + if (cur == NULL) return -1; + return i; +} + +/*************************************************************************/ +/* default functions */ +/*************************************************************************/ + +static void default_clear(gui *_gui, widget *_this) +{ + struct gui *g = _gui; + struct widget *this = _this; + x_fill_rectangle(g->x, g->xwin, BACKGROUND_COLOR, + this->x, this->y, this->width, this->height); +} + +static void default_repack(gui *gui, widget *_this) +{ + struct widget *this = _this; + return this->parent->repack(gui, this->parent); +} + +static void default_add_child( + gui *_gui, widget *_this, widget *child, int position) +{ + struct widget *this = _this; + WARN("cannot add child to widget %s\n", widget_name(this->type)); +} + +static void default_del_child( gui *_gui, widget *_this, widget *child) +{ + struct widget *this = _this; + WARN("cannot del child from widget %s\n", widget_name(this->type)); +} + +static void default_allocate( + gui *gui, widget *_this, int x, int y, int width, int height) +{ + struct widget *this = _this; + this->x = x; + this->y = y; + this->width = width; + this->height = height; +} + +static void default_hints(gui *g, widget *this, int *width, int *height) +{ + *width = 1; + *height = 1; +} + +static void default_button(gui *gui, widget *_this, int x, int y, + int key_modifiers, int button, int up) +{ + /* nothing */ +} + +/*************************************************************************/ +/* utils functions */ +/*************************************************************************/ + +void widget_add_child(gui *_gui, widget *parent, widget *child, int position) +{ + struct widget *this = parent; + glock(_gui); + this->add_child(_gui, parent, child, position); + gunlock(_gui); +} + +void widget_del_child(gui *_gui, widget *parent, widget *child) +{ + struct widget *this = parent; + glock(_gui); + this->del_child(_gui, parent, child); + gunlock(_gui); +} + +void widget_dirty(gui *_gui, widget *_this) +{ + struct gui *g = _gui; + struct widget *this = _this; + glock(g); + send_event(g, DIRTY, this->id); + gunlock(g); +} + +static const char *names[] = { + "TOPLEVEL_WINDOW", "CONTAINER", "POSITIONER", "TEXT_LIST", + "XY_PLOT", "BUTTON", "LABEL", "TIMELINE", "SPACE", "IMAGE" +}; +const char *widget_name(enum widget_type type) +{ + switch (type) { + case TOPLEVEL_WINDOW: + case CONTAINER: + case POSITIONER: + case TEXT_LIST: + case XY_PLOT: + case BUTTON: + case LABEL: + case TIMELINE: + case SPACE: + case IMAGE: + return names[type]; + } + return "UNKNOWN (error)"; +} + +/*************************************************************************/ +/* find a widget */ +/*************************************************************************/ + +/* TODO: optimize traversal and also use a cache */ +struct widget *_find_widget(struct widget *c, int id) +{ + struct widget_list *l; + struct widget *ret; + if (c == NULL) return NULL; + if (c->id == id) return c; + l = c->children; + while (l) { + ret = _find_widget(l->item, id); + if (ret != NULL) return ret; + l = l->next; + } + return NULL; +} + +struct widget *find_widget(struct gui *g, int id) +{ + struct widget_list *l; + struct widget *ret; + + l = g->toplevel; + + while (l) { + ret = _find_widget(l->item, id); + if (ret != NULL) return ret; + l = l->next; + } + + return NULL; +} diff --git a/common/utils/T/tracer/gui/x.c b/common/utils/T/tracer/gui/x.c new file mode 100644 index 0000000000000000000000000000000000000000..af3d05cc14b68936fa6be574e35b8e53f0201e21 --- /dev/null +++ b/common/utils/T/tracer/gui/x.c @@ -0,0 +1,435 @@ +#include "x.h" +#include "x_defs.h" +#include "gui_defs.h" +#include <X11/Xlib.h> +#include <X11/Xutil.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +int x_connection_fd(x_connection *_x) +{ + struct x_connection *x = _x; + return ConnectionNumber(x->d); +} + +static GC create_gc(Display *d, char *color) +{ + GC ret = XCreateGC(d, DefaultRootWindow(d), 0, NULL); + XGCValues gcv; + XColor rcol, scol; + + XCopyGC(d, DefaultGC(d, DefaultScreen(d)), -1L, ret); + if (XAllocNamedColor(d, DefaultColormap(d, DefaultScreen(d)), + color, &scol, &rcol)) { + gcv.foreground = scol.pixel; + XChangeGC(d, ret, GCForeground, &gcv); + } else ERR("X: could not allocate color '%s'\n", color); + + return ret; +} + +int x_new_color(x_connection *_x, char *color) +{ + struct x_connection *x = _x; + x->ncolors++; + + x->colors = realloc(x->colors, x->ncolors * sizeof(GC)); + if (x->colors == NULL) OOM; + x->colors[x->ncolors-1] = create_gc(x->d, color); + + x->xft_colors = realloc(x->xft_colors, x->ncolors * sizeof(XftColor)); + if (x->xft_colors == NULL) OOM; + if (XftColorAllocName(x->d, DefaultVisual(x->d, DefaultScreen(x->d)), + DefaultColormap(x->d, DefaultScreen(x->d)), + color, &x->xft_colors[x->ncolors-1]) == False) + ERR("could not allocate color '%s'\n", color); + + return x->ncolors - 1; +} + +int x_new_font(x_connection *_x, char *font) +{ + struct x_connection *x = _x; + /* TODO: allocate fonts only once */ + x->nfonts++; + x->fonts = realloc(x->fonts, x->nfonts * sizeof(XftFont *)); + if (x->fonts == NULL) OOM; + x->fonts[x->nfonts-1] = XftFontOpenName(x->d, DefaultScreen(x->d), font); + if (x->fonts[x->nfonts-1] == NULL) + ERR("failed allocating font '%s'\n", font); + return x->nfonts - 1; +} + +x_connection *x_open(void) +{ + struct x_connection *ret; + + ret = calloc(1, sizeof(struct x_connection)); + if (ret == NULL) OOM; + + ret->d = XOpenDisplay(0); + LOGD("XOpenDisplay display %p return x_connection %p\n", ret->d, ret); + if (ret->d == NULL) ERR("error calling XOpenDisplay: no X? you root?\n"); + + x_new_color(ret, "white"); /* background color */ + x_new_color(ret, "black"); /* foreground color */ + + x_new_font(ret, "sans-8"); + + return ret; +} + +x_window *x_create_window(x_connection *_x, int width, int height, + char *title) +{ + struct x_connection *x = _x; + struct x_window *ret; + + ret = calloc(1, sizeof(struct x_window)); + if (ret == NULL) OOM; + + ret->w = XCreateSimpleWindow(x->d, DefaultRootWindow(x->d), 0, 0, + width, height, 0, WhitePixel(x->d, DefaultScreen(x->d)), + WhitePixel(x->d, DefaultScreen(x->d))); + ret->width = width; + ret->height = height; + + XStoreName(x->d, ret->w, title); + + ret->p = XCreatePixmap(x->d, ret->w, width, height, + DefaultDepth(x->d, DefaultScreen(x->d))); + XFillRectangle(x->d, ret->p, x->colors[BACKGROUND_COLOR], + 0, 0, width, height); + + ret->xft = XftDrawCreate(x->d, ret->p, + DefaultVisual(x->d, DefaultScreen(x->d)), + DefaultColormap(x->d, DefaultScreen(x->d))); + if (ret->xft == NULL) ERR("XftDrawCreate failed\n"); + + /* enable backing store */ + { + XSetWindowAttributes att; + att.backing_store = Always; + XChangeWindowAttributes(x->d, ret->w, CWBackingStore, &att); + } + + XSelectInput(x->d, ret->w, + KeyPressMask | + ButtonPressMask | + ButtonReleaseMask | + PointerMotionMask | + ExposureMask | + StructureNotifyMask); + + XMapWindow(x->d, ret->w); + +#if 0 + /* wait for window to be mapped */ + LOGD("wait for map\n"); + while (1) { + XEvent ev; + //XWindowEvent(x->d, ret->w, StructureNotifyMask, &ev); + XWindowEvent(x->d, ret->w, ExposureMask, &ev); + LOGD("got ev %d\n", ev.type); + //if (ev.type == MapNotify) break; + if (ev.type == Expose) break; + } + LOGD("XXX create connection %p window %p (win id %d pixmap %d) w h %d %d\n", x, ret, (int)ret->w, (int)ret->p, width, height); +#endif + + return ret; +} + +x_image *x_create_image(x_connection *_x, unsigned char *data, + int width, int height) +{ + struct x_connection *x = _x; + struct x_image *ret; + XImage *ximage; + XVisualInfo *vs; + XVisualInfo template; + int nvs; + Visual *v; + + ret = calloc(1, sizeof(struct x_image)); if (ret == NULL) OOM; + + template.class = TrueColor; + template.depth = 24; + template.red_mask = 0xff0000; + template.green_mask = 0x00ff00; + template.blue_mask = 0x0000ff; + template.bits_per_rgb = 8; + + vs = XGetVisualInfo(x->d, VisualDepthMask | VisualClassMask | + VisualRedMaskMask | VisualGreenMaskMask | VisualBlueMaskMask | + VisualBitsPerRGBMask, &template, &nvs); + if (vs == NULL || nvs == 0) ERR("no good visual found\n"); + v = vs[0].visual; + XFree(vs); + + ximage = XCreateImage(x->d, v, 24, ZPixmap, 0, + (char*)data, width, height, 32, 0); + if (ximage == NULL) ERR("image creation failed\n"); + + ret->p = XCreatePixmap(x->d, DefaultRootWindow(x->d), width, height, 24); + + XPutImage(x->d, ret->p, DefaultGC(x->d, DefaultScreen(x->d)), + ximage, 0, 0, 0, 0, width, height); + + /* TODO: be sure it's fine to set data to NULL */ + ximage->data = NULL; + XDestroyImage(ximage); + + ret->width = width; + ret->height = height; + + return ret; +} + +static struct toplevel_window_widget *find_x_window(struct gui *g, Window id) +{ + struct widget_list *cur; + struct toplevel_window_widget *w; + struct x_window *xw; + cur = g->toplevel; + while (cur) { + w = (struct toplevel_window_widget *)cur->item; + xw = w->x; + if (xw->w == id) return w; + cur = cur->next; + } + return NULL; +} + +void x_events(gui *_gui) +{ + struct gui *g = _gui; + struct widget_list *cur; + struct x_connection *x = g->x; + struct toplevel_window_widget *w; + + LOGD("x_events START\n"); + /* preprocessing (to "compress" events) */ + cur = g->toplevel; + while (cur) { + struct x_window *xw; + w = (struct toplevel_window_widget *)cur->item; + xw = w->x; + xw->redraw = 0; + xw->repaint = 0; + xw->resize = 0; + cur = cur->next; + } + + while (XPending(x->d)) { + XEvent ev; + XNextEvent(x->d, &ev); + LOGD("XEV %d\n", ev.type); + switch (ev.type) { + case MapNotify: + case Expose: + if ((w = find_x_window(g, ev.xexpose.window)) != NULL) { + struct x_window *xw = w->x; + xw->redraw = 1; + } + break; + case ConfigureNotify: + if ((w = find_x_window(g, ev.xconfigure.window)) != NULL) { + struct x_window *xw = w->x; + xw->resize = 1; + xw->new_width = ev.xconfigure.width; + xw->new_height = ev.xconfigure.height; + if (xw->new_width < 10) xw->new_width = 10; + if (xw->new_height < 10) xw->new_height = 10; + LOGD("ConfigureNotify %d %d\n", ev.xconfigure.width, ev.xconfigure.height); + } + break; + case ButtonPress: + if ((w = find_x_window(g, ev.xbutton.window)) != NULL) { + int key_modifiers = 0; + if (ev.xbutton.state & ShiftMask) key_modifiers |= KEY_SHIFT; + if (ev.xbutton.state & Mod1Mask) key_modifiers |= KEY_ALT; + if (ev.xbutton.state & ControlMask) key_modifiers |= KEY_CONTROL; + w->common.button(g, w, ev.xbutton.x, ev.xbutton.y, key_modifiers, + ev.xbutton.button, 0); + } + break; + case ButtonRelease: + if ((w = find_x_window(g, ev.xbutton.window)) != NULL) { + int key_modifiers = 0; + if (ev.xbutton.state & ShiftMask) key_modifiers |= KEY_SHIFT; + if (ev.xbutton.state & Mod1Mask) key_modifiers |= KEY_ALT; + if (ev.xbutton.state & ControlMask) key_modifiers |= KEY_CONTROL; + w->common.button(g, w, ev.xbutton.x, ev.xbutton.y, key_modifiers, + ev.xbutton.button, 1); + } + break; +#if 0 + case MapNotify: + if ((w = find_x_window(g, ev.xmap.window)) != NULL) { + struct x_window *xw = w->x; + xw->repaint = 1; + } + break; +#endif + default: if (gui_logd) WARN("TODO: X event type %d\n", ev.type); break; + } + } + + /* postprocessing */ + LOGD("post processing\n"); + cur = g->toplevel; + while (cur) { + struct toplevel_window_widget *w = + (struct toplevel_window_widget *)cur->item; + struct x_window *xw = w->x; + if (xw->resize) { + LOGD("resize old %d %d new %d %d\n", xw->width, xw->height, xw->new_width, xw->new_height); + if (xw->width != xw->new_width || xw->height != xw->new_height) { + w->common.allocate(g, w, 0, 0, xw->new_width, xw->new_height); + xw->width = xw->new_width; + xw->height = xw->new_height; + XftDrawDestroy(xw->xft); + XFreePixmap(x->d, xw->p); + xw->p = XCreatePixmap(x->d, xw->w, xw->width, xw->height, + DefaultDepth(x->d, DefaultScreen(x->d))); + XFillRectangle(x->d, xw->p, x->colors[BACKGROUND_COLOR], + 0, 0, xw->width, xw->height); + xw->xft = XftDrawCreate(x->d, xw->p, + DefaultVisual(x->d, DefaultScreen(x->d)), + DefaultColormap(x->d, DefaultScreen(x->d))); + if (xw->xft == NULL) ERR("XftDrawCreate failed\n"); + + //xw->repaint = 1; + } + } + if (xw->repaint) { + w->common.paint(g, w); + xw->redraw = 1; + } + if (xw->redraw) { + struct x_connection *x = g->x; + LOGD("XCopyArea w h %d %d\n", xw->width, xw->height); + XCopyArea(x->d, xw->p, xw->w, x->colors[1], + 0, 0, xw->width, xw->height, 0, 0); + } + cur = cur->next; + } + LOGD("x_events DONE\n"); +} + +void x_flush(x_connection *_x) +{ + struct x_connection *x = _x; + XFlush(x->d); +} + +void x_text_get_dimensions(x_connection *_c, int font, const char *t, + int *width, int *height, int *baseline) +{ + struct x_connection *c = _c; + XGlyphInfo ext; + + XftTextExtentsUtf8(c->d, c->fonts[font], (FcChar8 *)t, strlen(t), &ext); + + *width = ext.width; + *height = c->fonts[font]->height; + *baseline = c->fonts[font]->ascent; +} + +/***********************************************************************/ +/* public drawing functions */ +/***********************************************************************/ + +void x_draw_line(x_connection *_c, x_window *_w, int color, + int x1, int y1, int x2, int y2) +{ + struct x_connection *c = _c; + struct x_window *w = _w; + XDrawLine(c->d, w->p, c->colors[color], x1, y1, x2, y2); +} + +void x_draw_rectangle(x_connection *_c, x_window *_w, int color, + int x, int y, int width, int height) +{ + struct x_connection *c = _c; + struct x_window *w = _w; + XDrawRectangle(c->d, w->p, c->colors[color], x, y, width, height); +} + +void x_fill_rectangle(x_connection *_c, x_window *_w, int color, + int x, int y, int width, int height) +{ + struct x_connection *c = _c; + struct x_window *w = _w; + XFillRectangle(c->d, w->p, c->colors[color], x, y, width, height); +} + +void x_draw_string(x_connection *_c, x_window *_w, int font, int color, + int x, int y, const char *t) +{ + struct x_connection *c = _c; + struct x_window *w = _w; + int tlen = strlen(t); + XftDrawStringUtf8(w->xft, &c->xft_colors[color], c->fonts[font], + x, y, (const unsigned char *)t, tlen); +} + +void x_draw_clipped_string(x_connection *_c, x_window *_w, int font, + int color, int x, int y, const char *t, + int clipx, int clipy, int clipwidth, int clipheight) +{ + struct x_window *w = _w; + + XRectangle clip = { clipx, clipy, clipwidth, clipheight }; + if (XftDrawSetClipRectangles(w->xft, 0, 0, &clip, 1) == False) abort(); + x_draw_string(_c, _w, font, color, x, y, t); + if (XftDrawSetClip(w->xft, NULL) == False) abort(); +} + +void x_draw_image(x_connection *_c, x_window *_w, x_image *_img, int x, int y) +{ + struct x_connection *c = _c; + struct x_window *w = _w; + struct x_image *img = _img; + + XCopyArea(c->d, img->p, w->p, DefaultGC(c->d, DefaultScreen(c->d)), + 0, 0, img->width, img->height, x, y); +} + +void x_draw(x_connection *_c, x_window *_w) +{ + struct x_connection *c = _c; + struct x_window *w = _w; + LOGD("x_draw XCopyArea w h %d %d display %p window %d pixmap %d\n", w->width, w->height, c->d, (int)w->w, (int)w->p); + XCopyArea(c->d, w->p, w->w, c->colors[1], 0, 0, w->width, w->height, 0, 0); +} + +/* those two special functions are to plot many points + * first call x_add_point many times then x_plot_points once + */ +void x_add_point(x_connection *_c, int x, int y) +{ + struct x_connection *c = _c; + + if (c->pts_size == c->pts_maxsize) { + c->pts_maxsize += 65536; + c->pts = realloc(c->pts, c->pts_maxsize * sizeof(XPoint)); + if (c->pts == NULL) OOM; + } + + c->pts[c->pts_size].x = x; + c->pts[c->pts_size].y = y; + c->pts_size++; +} + +void x_plot_points(x_connection *_c, x_window *_w, int color) +{ + struct x_connection *c = _c; + LOGD("x_plot_points %d points\n", c->pts_size); + struct x_window *w = _w; + XDrawPoints(c->d, w->p, c->colors[color], c->pts, c->pts_size, + CoordModeOrigin); + c->pts_size = 0; +} diff --git a/common/utils/T/tracer/gui/x.h b/common/utils/T/tracer/gui/x.h new file mode 100644 index 0000000000000000000000000000000000000000..d749d9acc4d9532891eea1931ed0447a197e9231 --- /dev/null +++ b/common/utils/T/tracer/gui/x.h @@ -0,0 +1,61 @@ +#ifndef _X_H_ +#define _X_H_ + +/* public X interface */ + +typedef void x_connection; +typedef void x_window; +typedef void x_image; + +x_connection *x_open(void); + +x_window *x_create_window(x_connection *x, int width, int height, + char *title); + +x_image *x_create_image(x_connection *x, unsigned char *data, + int width, int height); + +int x_connection_fd(x_connection *x); + +void x_flush(x_connection *x); + +int x_new_color(x_connection *x, char *color); +int x_new_font(x_connection *x, char *font); + +/* for x_events, we pass the gui */ +#include "gui.h" +void x_events(gui *gui); + +void x_text_get_dimensions(x_connection *, int font, const char *t, + int *width, int *height, int *baseline); + +/* drawing functions */ + +void x_draw_line(x_connection *c, x_window *w, int color, + int x1, int y1, int x2, int y2); + +void x_draw_rectangle(x_connection *c, x_window *w, int color, + int x, int y, int width, int height); + +void x_fill_rectangle(x_connection *c, x_window *w, int color, + int x, int y, int width, int height); + +void x_draw_string(x_connection *_c, x_window *_w, int font, int color, + int x, int y, const char *t); + +void x_draw_clipped_string(x_connection *_c, x_window *_w, int font, + int color, int x, int y, const char *t, + int clipx, int clipy, int clipwidth, int clipheight); + +void x_draw_image(x_connection *c, x_window *w, x_image *img, int x, int y); + +/* specials functions to plot many points + * you call several times x_add_point() then x_plot_points() + */ +void x_add_point(x_connection *c, int x, int y); +void x_plot_points(x_connection *c, x_window *w, int color); + +/* this function copies the pixmap to the window */ +void x_draw(x_connection *c, x_window *w); + +#endif /* _X_H_ */ diff --git a/common/utils/T/tracer/gui/x_defs.h b/common/utils/T/tracer/gui/x_defs.h new file mode 100644 index 0000000000000000000000000000000000000000..d0595ef51de128e191ae1c2a931cb422ef1b1cff --- /dev/null +++ b/common/utils/T/tracer/gui/x_defs.h @@ -0,0 +1,37 @@ +#ifndef _X_DEFS_H_ +#define _X_DEFS_H_ + +#include <X11/Xlib.h> +#include <Xft.h> + +struct x_connection { + Display *d; + GC *colors; + XftColor *xft_colors; + int ncolors; + XPoint *pts; + int pts_size; + int pts_maxsize; + XftFont **fonts; + int nfonts; +}; + +struct x_window { + Window w; + Pixmap p; + int width; + int height; + XftDraw *xft; + /* below: internal data used for X events handling */ + int redraw; + int repaint; + int resize, new_width, new_height; +}; + +struct x_image { + Pixmap p; + int width; + int height; +}; + +#endif /* _X_DEFS_H_ */ diff --git a/common/utils/T/tracer/gui/xy_plot.c b/common/utils/T/tracer/gui/xy_plot.c new file mode 100644 index 0000000000000000000000000000000000000000..7d20a027a155524481d6aab45c2ada8361b83180 --- /dev/null +++ b/common/utils/T/tracer/gui/xy_plot.c @@ -0,0 +1,292 @@ +#include "gui.h" +#include "gui_defs.h" +#include "x.h" +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <math.h> + +static void paint(gui *_gui, widget *_this) +{ + struct gui *g = _gui; + struct xy_plot_widget *this = _this; + int wanted_plot_width, allocated_plot_width; + int wanted_plot_height, allocated_plot_height; + float pxsize; + float ticdist; + float tic; + float ticstep; + int k, kmin, kmax; + float allocated_xmin, allocated_xmax; + float allocated_ymin, allocated_ymax; + float center; + int i; + int n; + +# define FLIP(v) (-(v) + allocated_plot_height-1) + + LOGD("PAINT xy plot xywh %d %d %d %d\n", this->common.x, this->common.y, this->common.width, this->common.height); + +//x_draw_rectangle(g->x, g->xwin, 1, this->common.x, this->common.y, this->common.width, this->common.height); + + wanted_plot_width = this->wanted_width; + allocated_plot_width = this->common.width - this->vrule_width; + wanted_plot_height = this->wanted_height; + allocated_plot_height = this->common.height - this->label_height * 2; + + /* plot zone */ + /* TODO: refine height - height of hrule text may be != from label */ + x_draw_rectangle(g->x, g->xwin, 1, + this->common.x + this->vrule_width, + this->common.y, + this->common.width - this->vrule_width -1, /* -1 to see right border */ + this->common.height - this->label_height * 2); + + /* horizontal tics */ + pxsize = (this->xmax - this->xmin) / wanted_plot_width; + ticdist = 100; + tic = floor(log10(ticdist * pxsize)); + ticstep = powf(10, tic); + center = (this->xmax + this->xmin) / 2; + allocated_xmin = center - ((this->xmax - this->xmin) * + allocated_plot_width / wanted_plot_width) / 2; + allocated_xmax = center + ((this->xmax - this->xmin) * + allocated_plot_width / wanted_plot_width) / 2; + /* adjust tic if too tight */ + LOGD("pre x ticstep %g\n", ticstep); + while (1) { + if (ticstep / (allocated_xmax - allocated_xmin) + * (allocated_plot_width - 1) > 40) break; + ticstep *= 2; + } + LOGD("post x ticstep %g\n", ticstep); + LOGD("xmin/max %g %g width wanted allocated %d %d alloc xmin/max %g %g ticstep %g\n", this->xmin, this->xmax, wanted_plot_width, allocated_plot_width, allocated_xmin, allocated_xmax, ticstep); + kmin = ceil(allocated_xmin / ticstep); + kmax = floor(allocated_xmax / ticstep); + for (k = kmin; k <= kmax; k++) { +/* + (k * ticstep - allocated_xmin) / (allocated_max - allocated_xmin) = + (x - 0) / (allocated_plot_width-1 - 0) + */ + char v[64]; + int vwidth, dummy; + float x = (k * ticstep - allocated_xmin) / + (allocated_xmax - allocated_xmin) * + (allocated_plot_width - 1); + x_draw_line(g->x, g->xwin, FOREGROUND_COLOR, + this->common.x + this->vrule_width + x, + this->common.y + this->common.height - this->label_height * 2, + this->common.x + this->vrule_width + x, + this->common.y + this->common.height - this->label_height * 2 - 5); + sprintf(v, "%g", k * ticstep); + x_text_get_dimensions(g->x, DEFAULT_FONT, v, &vwidth, &dummy, &dummy); + x_draw_string(g->x, g->xwin, DEFAULT_FONT, FOREGROUND_COLOR, + this->common.x + this->vrule_width + x - vwidth/2, + this->common.y + this->common.height - this->label_height * 2 + + this->label_baseline, + v); + LOGD("tic k %d val %g x %g\n", k, k * ticstep, x); + } + + /* vertical tics */ + pxsize = (this->ymax - this->ymin) / wanted_plot_height; + ticdist = 30; + tic = floor(log10(ticdist * pxsize)); + ticstep = powf(10, tic); + center = (this->ymax + this->ymin) / 2; + allocated_ymin = center - ((this->ymax - this->ymin) * + allocated_plot_height / wanted_plot_height) / 2; + allocated_ymax = center + ((this->ymax - this->ymin) * + allocated_plot_height / wanted_plot_height) / 2; + /* adjust tic if too tight */ + LOGD("pre y ticstep %g\n", ticstep); + while (1) { + if (ticstep / (allocated_ymax - allocated_ymin) + * (allocated_plot_height - 1) > 20) break; + ticstep *= 2; + } + LOGD("post y ticstep %g\n", ticstep); + LOGD("ymin/max %g %g height wanted allocated %d %d alloc ymin/max %g %g ticstep %g\n", this->ymin, this->ymax, wanted_plot_height, allocated_plot_height, allocated_ymin, allocated_ymax, ticstep); + kmin = ceil(allocated_ymin / ticstep); + kmax = floor(allocated_ymax / ticstep); + for (k = kmin; k <= kmax; k++) { + char v[64]; + int vwidth, dummy; + float y = (k * ticstep - allocated_ymin) / + (allocated_ymax - allocated_ymin) * + (allocated_plot_height - 1); + sprintf(v, "%g", k * ticstep); + x_text_get_dimensions(g->x, DEFAULT_FONT, v, &vwidth, &dummy, &dummy); + x_draw_line(g->x, g->xwin, FOREGROUND_COLOR, + this->common.x + this->vrule_width, + this->common.y + FLIP(y), + this->common.x + this->vrule_width + 5, + this->common.y + FLIP(y)); + x_draw_string(g->x, g->xwin, DEFAULT_FONT, FOREGROUND_COLOR, + this->common.x + this->vrule_width - vwidth - 2, + this->common.y + FLIP(y) - this->label_height/2+this->label_baseline, + v); + } + + /* label at bottom, in the middle */ + x_draw_string(g->x, g->xwin, DEFAULT_FONT, FOREGROUND_COLOR, + this->common.x + (this->common.width - this->label_width) / 2, + this->common.y + this->common.height - this->label_height + + this->label_baseline, + this->label); + + for (n = 0; n < this->nplots; n++) { + /* points */ + float ax, bx, ay, by; + ax = (allocated_plot_width-1) / (allocated_xmax - allocated_xmin); + bx = -ax * allocated_xmin; + ay = (allocated_plot_height-1) / (allocated_ymax - allocated_ymin); + by = -ay * allocated_ymin; + for (i = 0; i < this->plots[n].npoints; i++) { + int x, y; + x = ax * this->plots[n].x[i] + bx; + y = ay * this->plots[n].y[i] + by; + if (x >= 0 && x < allocated_plot_width && + y >= 0 && y < allocated_plot_height) + x_add_point(g->x, + this->common.x + this->vrule_width + x, + this->common.y + FLIP(y)); + } + x_plot_points(g->x, g->xwin, this->plots[n].color); + } +} + +static void hints(gui *_gui, widget *_w, int *width, int *height) +{ + struct xy_plot_widget *w = _w; + *width = w->wanted_width + w->vrule_width; + *height = w->wanted_height + w->label_height * 2; /* TODO: refine */ + LOGD("HINTS xy plot wh %d %d (vrule_width %d) (wanted wh %d %d)\n", *width, *height, w->vrule_width, w->wanted_width, w->wanted_height); +} + +widget *new_xy_plot(gui *_gui, int width, int height, char *label, + int vruler_width) +{ + struct gui *g = _gui; + struct xy_plot_widget *w; + + glock(g); + + w = new_widget(g, XY_PLOT, sizeof(struct xy_plot_widget)); + + w->label = strdup(label); if (w->label == NULL) OOM; + /* TODO: be sure calling X there is valid wrt "global model" (we are + * not in the "gui thread") */ + x_text_get_dimensions(g->x, DEFAULT_FONT, label, + &w->label_width, &w->label_height, &w->label_baseline); + LOGD("XY PLOT label wh %d %d\n", w->label_width, w->label_height); + + w->wanted_width = width; + w->wanted_height = height; + w->vrule_width = vruler_width; + + w->xmin = -1; + w->xmax = 1; + w->ymin = -1; + w->ymax = 1; + w->plots = NULL; + w->nplots = 0; + + w->common.paint = paint; + w->common.hints = hints; + + gunlock(g); + + return w; +} + +/*************************************************************************/ +/* public functions */ +/*************************************************************************/ + +int xy_plot_new_plot(gui *_gui, widget *_this, int color) +{ + int ret; + struct gui *g = _gui; + struct xy_plot_widget *this = _this; + + glock(g); + + ret = this->nplots; + + this->nplots++; + this->plots = realloc(this->plots, + this->nplots * sizeof(struct xy_plot_plot)); + if (this->plots == NULL) abort(); + + this->plots[ret].x = NULL; + this->plots[ret].y = NULL; + this->plots[ret].npoints = 0; + this->plots[ret].color = color; + + gunlock(g); + + return ret; +} + +void xy_plot_set_range(gui *_gui, widget *_this, + float xmin, float xmax, float ymin, float ymax) +{ + struct gui *g = _gui; + struct xy_plot_widget *this = _this; + + glock(g); + + this->xmin = xmin; + this->xmax = xmax; + this->ymin = ymin; + this->ymax = ymax; + + send_event(g, DIRTY, this->common.id); + + gunlock(g); +} + +void xy_plot_set_points(gui *_gui, widget *_this, int plot, + int npoints, float *x, float *y) +{ + struct gui *g = _gui; + struct xy_plot_widget *this = _this; + + glock(g); + + if (npoints != this->plots[plot].npoints) { + free(this->plots[plot].x); + free(this->plots[plot].y); + this->plots[plot].x = calloc(npoints, sizeof(float)); + if (this->plots[plot].x == NULL) abort(); + this->plots[plot].y = calloc(npoints, sizeof(float)); + if (this->plots[plot].y == NULL) abort(); + this->plots[plot].npoints = npoints; + } + + memcpy(this->plots[plot].x, x, npoints * sizeof(float)); + memcpy(this->plots[plot].y, y, npoints * sizeof(float)); + + send_event(g, DIRTY, this->common.id); + + gunlock(g); +} + +void xy_plot_get_dimensions(gui *_gui, widget *_this, int *width, int *height) +{ + struct gui *g = _gui; + struct xy_plot_widget *this = _this; + + glock(g); + + if (this->common.width == 0 || this->common.height == 0) { + *width = this->wanted_width; + *height = this->wanted_height; + } else { + *width = this->common.width - this->vrule_width; + *height = this->common.height - this->label_height * 2; + } + + gunlock(g); +} diff --git a/common/utils/T/tracer/handler.c b/common/utils/T/tracer/handler.c new file mode 100644 index 0000000000000000000000000000000000000000..1ee9db1adee05d299c164abfddf96e6908e759b8 --- /dev/null +++ b/common/utils/T/tracer/handler.c @@ -0,0 +1,82 @@ +#include "handler.h" +#include "event.h" +#include "database.h" +#include <stdlib.h> +#include <stdio.h> + +typedef void (*handler_function)(void *p, event e); + +struct handler_data { + handler_function f; + void *p; + unsigned long id; +}; + +struct handler_list { + struct handler_data *f; + int size; + int maxsize; +}; + +/* internal definition of an event handler */ +struct _event_handler { + void *database; + struct handler_list *events; + unsigned long next_id; +}; + +void handle_event(event_handler *_h, event e) +{ + struct _event_handler *h = _h; + int i; + for (i = 0; i < h->events[e.type].size; i++) + h->events[e.type].f[i].f(h->events[e.type].f[i].p, e); +} + +event_handler *new_handler(void *database) +{ + struct _event_handler *ret = calloc(1, sizeof(struct _event_handler)); + if (ret == NULL) abort(); + + ret->database = database; + + ret->events = calloc(number_of_ids(database), sizeof(struct handler_list)); + if (ret->events == NULL) abort(); + + ret->next_id = 1; + + return ret; +} + +unsigned long register_handler_function(event_handler *_h, int event_id, + void (*f)(void *, event), void *p) +{ + struct _event_handler *h = _h; + unsigned long ret = h->next_id; + struct handler_list *l; + + h->next_id++; + if (h->next_id == 2UL * 1024 * 1024 * 1024) + { printf("%s:%d: this is bad...\n", __FILE__, __LINE__); abort(); } + + l = &h->events[event_id]; + if (l->size == l->maxsize) { + l->maxsize += 16; + l->f = realloc(l->f, l->maxsize * sizeof(struct handler_data)); + if (l->f == NULL) abort(); + } + l->f[l->size].f = f; + l->f[l->size].p = p; + l->f[l->size].id = ret; + + l->size++; + + return ret; +} + +void remove_handler_function(event_handler *h, int event_id, + unsigned long handler_id) +{ + printf("%s:%d: TODO\n", __FILE__, __LINE__); + abort(); +} diff --git a/common/utils/T/tracer/handler.h b/common/utils/T/tracer/handler.h new file mode 100644 index 0000000000000000000000000000000000000000..5934e1704c52ff3ee9b5fb2239e2f2a602bc5bb9 --- /dev/null +++ b/common/utils/T/tracer/handler.h @@ -0,0 +1,16 @@ +#ifndef _HANDLER_H_ +#define _HANDLER_H_ + +typedef void event_handler; + +#include "event.h" + +event_handler *new_handler(void *database); +void handle_event(event_handler *h, event e); + +unsigned long register_handler_function(event_handler *_h, int event_id, + void (*f)(void *, event), void *p); +void remove_handler_function(event_handler *h, int event_id, + unsigned long handler_id); + +#endif /* _HANDLER_H_ */ diff --git a/common/utils/T/tracer/logger/Makefile b/common/utils/T/tracer/logger/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..e5391008380ccb32410dcc92a3a0788bd3ad8a45 --- /dev/null +++ b/common/utils/T/tracer/logger/Makefile @@ -0,0 +1,13 @@ +CC=gcc +CFLAGS=-Wall -g -pthread -I.. + +OBJS=logger.o textlog.o framelog.o ttilog.o timelog.o ticklog.o + +logger.a: $(OBJS) + ar cr logger.a $(OBJS) + +%.o: %.c + $(CC) $(CFLAGS) -o $@ -c $< + +clean: + rm -f *.a *.o diff --git a/common/utils/T/tracer/logger/framelog.c b/common/utils/T/tracer/logger/framelog.c new file mode 100644 index 0000000000000000000000000000000000000000..057960c38246b98b0e4c7be1225ec02dc9238495 --- /dev/null +++ b/common/utils/T/tracer/logger/framelog.c @@ -0,0 +1,146 @@ +#include "logger.h" +#include "logger_defs.h" +#include "handler.h" +#include "database.h" +#include "filter/filter.h" +#include <stdlib.h> +#include <string.h> +#include <stdio.h> +#include <math.h> + +struct framelog { + struct logger common; + void *database; + int subframe_arg; + int buffer_arg; + float *x; + float *buffer; + int blength; + int skip_delay; /* one frame over 'skip_delay' is truly processed + * 0 to disable (process all data) + */ + int skip_current; /* internal data for the skip mechanism */ + int skip_on; /* internal data for the skip mechanism */ +}; + +static void _event(void *p, event e) +{ + struct framelog *l = p; + int i; + int subframe; + void *buffer; + int bsize; + int nsamples; + + if (l->common.filter != NULL && filter_eval(l->common.filter, e) == 0) + return; + + subframe = e.e[l->subframe_arg].i; + buffer = e.e[l->buffer_arg].b; + bsize = e.e[l->buffer_arg].bsize; + + if (l->skip_delay != 0) { + if (subframe == 0) { + l->skip_current++; + if (l->skip_current >= l->skip_delay) { + l->skip_on = 0; + l->skip_current = 0; + } else + l->skip_on = 1; + } + } + if (l->skip_on) return; + + nsamples = bsize / (2*sizeof(int16_t)); + + if (l->blength != nsamples * 10) { + l->blength = nsamples * 10; + free(l->x); + free(l->buffer); + l->x = calloc(l->blength, sizeof(float)); + if (l->x == NULL) abort(); + l->buffer = calloc(l->blength, sizeof(float)); + if (l->buffer == NULL) abort(); + /* update 'x' */ + for (i = 0; i < l->blength; i++) + l->x[i] = i; + /* update 'length' of views */ + for (i = 0; i < l->common.vsize; i++) + l->common.v[i]->set(l->common.v[i], "length", l->blength); + } + + /* TODO: compute the LOGs in the plotter (too much useless computations) */ + for (i = 0; i < nsamples; i++) { + int I = ((int16_t *)buffer)[i*2]; + int Q = ((int16_t *)buffer)[i*2+1]; + l->buffer[subframe * nsamples + i] = 10*log10(1.0+(float)(I*I+Q*Q)); + } + + if (subframe == 9) + for (i = 0; i < l->common.vsize; i++) + l->common.v[i]->append(l->common.v[i], l->x, l->buffer, l->blength); +} + +logger *new_framelog(event_handler *h, void *database, + char *event_name, char *subframe_varname, char *buffer_varname) +{ + struct framelog *ret; + int event_id; + database_event_format f; + int i; + + ret = calloc(1, sizeof(struct framelog)); if (ret == NULL) abort(); + + ret->common.event_name = strdup(event_name); + if (ret->common.event_name == NULL) abort(); + ret->database = database; + + event_id = event_id_from_name(database, event_name); + + ret->common.handler_id = register_handler_function(h,event_id,_event,ret); + + f = get_format(database, event_id); + + /* look for subframe and buffer args */ + ret->subframe_arg = -1; + ret->buffer_arg = -1; + for (i = 0; i < f.count; i++) { + if (!strcmp(f.name[i], subframe_varname)) ret->subframe_arg = i; + if (!strcmp(f.name[i], buffer_varname)) ret->buffer_arg = i; + } + if (ret->subframe_arg == -1) { + printf("%s:%d: subframe argument '%s' not found in event '%s'\n", + __FILE__, __LINE__, subframe_varname, event_name); + abort(); + } + if (ret->buffer_arg == -1) { + printf("%s:%d: buffer argument '%s' not found in event '%s'\n", + __FILE__, __LINE__, buffer_varname, event_name); + abort(); + } + if (strcmp(f.type[ret->subframe_arg], "int") != 0) { + printf("%s:%d: argument '%s' has wrong type (should be 'int')\n", + __FILE__, __LINE__, subframe_varname); + abort(); + } + if (strcmp(f.type[ret->buffer_arg], "buffer") != 0) { + printf("%s:%d: argument '%s' has wrong type (should be 'buffer')\n", + __FILE__, __LINE__, buffer_varname); + abort(); + } + + return ret; +} + +/****************************************************************************/ +/* public functions */ +/****************************************************************************/ + +void framelog_set_skip(logger *_this, int skip_delay) +{ + struct framelog *l = _this; + /* TODO: protect with a lock? */ + l->skip_delay = skip_delay; + l->skip_current = 0; + l->skip_on = 0; +} diff --git a/common/utils/T/tracer/logger/logger.c b/common/utils/T/tracer/logger/logger.c new file mode 100644 index 0000000000000000000000000000000000000000..ab6fb8bc625e97bc0f5b7ea848a8c25c422b463e --- /dev/null +++ b/common/utils/T/tracer/logger/logger.c @@ -0,0 +1,17 @@ +#include "logger.h" +#include "logger_defs.h" +#include <stdlib.h> + +void logger_add_view(logger *_l, view *v) +{ + struct logger *l = _l; + l->vsize++; + l->v = realloc(l->v, l->vsize * sizeof(view *)); if (l->v == NULL) abort(); + l->v[l->vsize-1] = v; +} + +void logger_set_filter(logger *_l, void *filter) +{ + struct logger *l = _l; + l->filter = filter; +} diff --git a/common/utils/T/tracer/logger/logger.h b/common/utils/T/tracer/logger/logger.h new file mode 100644 index 0000000000000000000000000000000000000000..e3e4b97aa5e4e85844376c61663036d3f7a78b5b --- /dev/null +++ b/common/utils/T/tracer/logger/logger.h @@ -0,0 +1,24 @@ +#ifndef _LOGGER_H_ +#define _LOGGER_H_ + +typedef void logger; + +logger *new_framelog(void *event_handler, void *database, + char *event_name, char *subframe_varname, char *buffer_varname); +logger *new_textlog(void *event_handler, void *database, + char *event_name, char *format); +logger *new_ttilog(void *event_handler, void *database, + char *event_name, char *frame_varname, char *subframe_varname, + char *data_varname, int convert_to_dB); +logger *new_timelog(void *event_handler, void *database, char *event_name); +logger *new_ticklog(void *event_handler, void *database, + char *event_name, char *frame_name, char *subframe_name); + +void framelog_set_skip(logger *_this, int skip_delay); + +#include "view/view.h" + +void logger_add_view(logger *l, view *v); +void logger_set_filter(logger *l, void *filter); + +#endif /* _LOGGER_H_ */ diff --git a/common/utils/T/tracer/logger/logger_defs.h b/common/utils/T/tracer/logger/logger_defs.h new file mode 100644 index 0000000000000000000000000000000000000000..8e8d6a2d3e8e59d939114e8f490c7c79185667d1 --- /dev/null +++ b/common/utils/T/tracer/logger/logger_defs.h @@ -0,0 +1,16 @@ +#ifndef _LOGGER_DEFS_H_ +#define _LOGGER_DEFS_H_ + +#include "view/view.h" + +struct logger { + char *event_name; + unsigned long handler_id; + /* list of views */ + view **v; + int vsize; + /* filter - NULL if no filter set */ + void *filter; +}; + +#endif /* _LOGGER_DEFS_H_ */ diff --git a/common/utils/T/tracer/logger/textlog.c b/common/utils/T/tracer/logger/textlog.c new file mode 100644 index 0000000000000000000000000000000000000000..e80af7813e014c5174a01b83853a58d55179cd7c --- /dev/null +++ b/common/utils/T/tracer/logger/textlog.c @@ -0,0 +1,198 @@ +#include "logger.h" +#include "logger_defs.h" +#include "handler.h" +#include "database.h" +#include "view/view.h" +#include "utils.h" +#include "filter/filter.h" +#include <stdlib.h> +#include <string.h> +#include <stdio.h> + +enum format_item_type { + INSTRING, + INT, ULONG, STRING, BUFFER }; + +struct format_item { + enum format_item_type type; + union { + /* INSTRING */ + char *s; + /* others */ + int event_arg; + }; +}; + +struct textlog { + struct logger common; + char *format; + void *database; + /* parsed format string */ + struct format_item *f; + int fsize; + /* local output buffer */ + OBUF o; +}; + +static void _event(void *p, event e) +{ + struct textlog *l = p; + int i; +#ifdef T_SEND_TIME + struct tm *t; + char tt[64]; +#endif + + if (l->common.filter != NULL && filter_eval(l->common.filter, e) == 0) + return; + + l->o.osize = 0; + +#ifdef T_SEND_TIME + t = localtime(&e.sending_time.tv_sec); + /* round tv_nsec to nearest millisecond */ + sprintf(tt, "%2.2d:%2.2d:%2.2d.%9.9ld: ", t->tm_hour, t->tm_min, t->tm_sec, + e.sending_time.tv_nsec); + PUTS(&l->o, tt); +#endif + + for (i = 0; i < l->fsize; i++) + switch(l->f[i].type) { + case INSTRING: PUTS(&l->o, l->f[i].s); break; + case INT: PUTI(&l->o, e.e[l->f[i].event_arg].i); break; + case ULONG: PUTUL(&l->o, e.e[l->f[i].event_arg].ul); break; + case STRING: PUTS_CLEAN(&l->o, e.e[l->f[i].event_arg].s); break; + case BUFFER: + PUTS(&l->o, "{buffer size:"); + PUTI(&l->o, e.e[l->f[i].event_arg].bsize); + PUTS(&l->o, "}"); + break; + } + PUTC(&l->o, 0); + + for (i = 0; i < l->common.vsize; i++) + l->common.v[i]->append(l->common.v[i], l->o.obuf); +} + +enum chunk_type { C_ERROR, C_STRING, C_ARG_NAME, C_EVENT_NAME }; +struct chunk { + enum chunk_type type; + char *s; + enum format_item_type it; + int event_arg; +}; + +/* TODO: speed it up? */ +static int find_argument(char *name, database_event_format f, + enum format_item_type *it, int *event_arg) +{ + int i; + for (i = 0; i < f.count; i++) if (!strcmp(name, f.name[i])) break; + if (i == f.count) return 0; + *event_arg = i; + if (!strcmp(f.type[i], "int")) *it = INT; + else if (!strcmp(f.type[i], "ulong")) *it = ULONG; + else if (!strcmp(f.type[i], "string")) *it = STRING; + else if (!strcmp(f.type[i], "buffer")) *it = BUFFER; + else return 0; + return 1; +} + +static struct chunk next_chunk(char **s, database_event_format f) +{ + char *cur = *s; + char *name; + enum format_item_type it; + int event_arg; + + /* argument in [ ] */ + if (*cur == '[') { + *cur = 0; + cur++; + name = cur; + /* no \ allowed there */ + while (*cur && *cur != ']' && *cur != '\\') cur++; + if (*cur != ']') goto error; + *cur = 0; + cur++; + *s = cur; + if (find_argument(name, f, &it, &event_arg) == 0) goto error; + return (struct chunk){type:C_ARG_NAME, s:name, it:it, event_arg:event_arg}; + } + + /* { } is name of event (anything in between is smashed) */ + if (*cur == '{') { + *cur = 0; + cur++; + while (*cur && *cur != '}') cur++; + if (*cur != '}') goto error; + *cur = 0; + cur++; + *s = cur; + return (struct chunk){type:C_EVENT_NAME}; + } + + /* anything but [ and { is raw string */ + /* TODO: deal with \ */ + name = cur; + while (*cur && *cur != '[' && *cur != '{') cur++; + *s = cur; + return (struct chunk){type:C_STRING, s:name}; + +error: + return (struct chunk){type:C_ERROR}; +} + +logger *new_textlog(event_handler *h, void *database, + char *event_name, char *format) +{ + struct textlog *ret; + int event_id; + database_event_format f; + char *cur; + + ret = calloc(1, sizeof(struct textlog)); if (ret == NULL) abort(); + + ret->common.event_name = strdup(event_name); + if (ret->common.event_name == NULL) abort(); + ret->format = strdup(format); if (ret->format == NULL) abort(); + ret->database = database; + + event_id = event_id_from_name(database, event_name); + + ret->common.handler_id = register_handler_function(h,event_id,_event,ret); + + f = get_format(database, event_id); + + /* we won't get more than strlen(format) "chunks" */ + ret->f = malloc(sizeof(struct format_item) * strlen(format)); + if (ret->f == NULL) abort(); + + cur = ret->format; + + while (*cur) { + struct chunk c = next_chunk(&cur, f); + switch (c.type) { + case C_ERROR: goto error; + case C_STRING: + ret->f[ret->fsize].type = INSTRING; + ret->f[ret->fsize].s = c.s; + break; + case C_ARG_NAME: + ret->f[ret->fsize].type = c.it; + ret->f[ret->fsize].event_arg = c.event_arg; + break; + case C_EVENT_NAME: + ret->f[ret->fsize].type = INSTRING; + ret->f[ret->fsize].s = ret->common.event_name; + break; + } + ret->fsize++; + } + + return ret; + +error: + printf("%s:%d: bad format '%s'\n", __FILE__, __LINE__, format); + abort(); +} diff --git a/common/utils/T/tracer/logger/ticklog.c b/common/utils/T/tracer/logger/ticklog.c new file mode 100644 index 0000000000000000000000000000000000000000..7a3bc45338858a953182fcb81d99d86a73b7a3de --- /dev/null +++ b/common/utils/T/tracer/logger/ticklog.c @@ -0,0 +1,84 @@ +#include "logger.h" +#include "logger_defs.h" +#include "event.h" +#include "database.h" +#include "handler.h" +#include "filter/filter.h" +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +struct ticklog { + struct logger common; + void *database; + int frame_arg; + int subframe_arg; +}; + +static void _event(void *p, event e) +{ + struct ticklog *l = p; + int i; + int frame; + int subframe; + + if (l->common.filter != NULL && filter_eval(l->common.filter, e) == 0) + return; + + frame = e.e[l->frame_arg].i; + subframe = e.e[l->subframe_arg].i; + + for (i = 0; i < l->common.vsize; i++) + l->common.v[i]->append(l->common.v[i], e.sending_time, frame, subframe); +} + +logger *new_ticklog(event_handler *h, void *database, + char *event_name, char *frame_varname, char *subframe_varname) +{ + struct ticklog *ret; + int event_id; + database_event_format f; + int i; + + ret = calloc(1, sizeof(struct ticklog)); if (ret == NULL) abort(); + + ret->common.event_name = strdup(event_name); + if (ret->common.event_name == NULL) abort(); + ret->database = database; + + event_id = event_id_from_name(database, event_name); + + ret->common.handler_id = register_handler_function(h,event_id,_event,ret); + + f = get_format(database, event_id); + + /* look for frame and subframe args */ + ret->frame_arg = -1; + ret->subframe_arg = -1; + for (i = 0; i < f.count; i++) { + if (!strcmp(f.name[i], frame_varname)) ret->frame_arg = i; + if (!strcmp(f.name[i], subframe_varname)) ret->subframe_arg = i; + } + if (ret->frame_arg == -1) { + printf("%s:%d: frame argument '%s' not found in event '%s'\n", + __FILE__, __LINE__, frame_varname, event_name); + abort(); + } + if (ret->subframe_arg == -1) { + printf("%s:%d: subframe argument '%s' not found in event '%s'\n", + __FILE__, __LINE__, subframe_varname, event_name); + abort(); + } + if (strcmp(f.type[ret->frame_arg], "int") != 0) { + printf("%s:%d: argument '%s' has wrong type (should be 'int')\n", + __FILE__, __LINE__, frame_varname); + abort(); + } + if (strcmp(f.type[ret->subframe_arg], "int") != 0) { + printf("%s:%d: argument '%s' has wrong type (should be 'int')\n", + __FILE__, __LINE__, subframe_varname); + abort(); + } + + return ret; +} diff --git a/common/utils/T/tracer/logger/timelog.c b/common/utils/T/tracer/logger/timelog.c new file mode 100644 index 0000000000000000000000000000000000000000..b474c8200d16cbdac17c6be4ed847b0d11bfe19a --- /dev/null +++ b/common/utils/T/tracer/logger/timelog.c @@ -0,0 +1,41 @@ +#include "logger.h" +#include "logger_defs.h" +#include "event.h" +#include "database.h" +#include "handler.h" +#include "filter/filter.h" +#include <stdlib.h> +#include <string.h> + +struct timelog { + struct logger common; +}; + +static void _event(void *p, event e) +{ + struct timelog *l = p; + int i; + + if (l->common.filter != NULL && filter_eval(l->common.filter, e) == 0) + return; + + for (i = 0; i < l->common.vsize; i++) + l->common.v[i]->append(l->common.v[i], e.sending_time); +} + +logger *new_timelog(event_handler *h, void *database, char *event_name) +{ + struct timelog *ret; + int event_id; + + ret = calloc(1, sizeof(struct timelog)); if (ret == NULL) abort(); + + ret->common.event_name = strdup(event_name); + if (ret->common.event_name == NULL) abort(); + + event_id = event_id_from_name(database, event_name); + + ret->common.handler_id = register_handler_function(h,event_id,_event,ret); + + return ret; +} diff --git a/common/utils/T/tracer/logger/ttilog.c b/common/utils/T/tracer/logger/ttilog.c new file mode 100644 index 0000000000000000000000000000000000000000..29e22fbf10e97e8df1e32929320108e3601d1f24 --- /dev/null +++ b/common/utils/T/tracer/logger/ttilog.c @@ -0,0 +1,111 @@ +#include "logger.h" +#include "logger_defs.h" +#include "event.h" +#include "database.h" +#include "handler.h" +#include "filter/filter.h" +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <math.h> + +struct ttilog { + struct logger common; + void *database; + int frame_arg; + int subframe_arg; + int data_arg; + int convert_to_dB; +}; + +static void _event(void *p, event e) +{ + struct ttilog *l = p; + int i; + int frame; + int subframe; + float value; + + if (l->common.filter != NULL && filter_eval(l->common.filter, e) == 0) + return; + + frame = e.e[l->frame_arg].i; + subframe = e.e[l->subframe_arg].i; + switch (e.e[l->data_arg].type) { + case EVENT_INT: value = e.e[l->data_arg].i; break; + case EVENT_ULONG: value = e.e[l->data_arg].ul; break; + default: printf("%s:%d: unsupported type\n", __FILE__, __LINE__); abort(); + } + + if (l->convert_to_dB) value = 10 * log10(value); + + for (i = 0; i < l->common.vsize; i++) + l->common.v[i]->append(l->common.v[i], frame, subframe, value); +} + +logger *new_ttilog(event_handler *h, void *database, + char *event_name, char *frame_varname, char *subframe_varname, + char *data_varname, int convert_to_dB) +{ + struct ttilog *ret; + int event_id; + database_event_format f; + int i; + + ret = calloc(1, sizeof(struct ttilog)); if (ret == NULL) abort(); + + ret->common.event_name = strdup(event_name); + if (ret->common.event_name == NULL) abort(); + ret->database = database; + ret->convert_to_dB = convert_to_dB; + + event_id = event_id_from_name(database, event_name); + + ret->common.handler_id = register_handler_function(h,event_id,_event,ret); + + f = get_format(database, event_id); + + /* look for frame, subframe and data args */ + ret->frame_arg = -1; + ret->subframe_arg = -1; + ret->data_arg = -1; + for (i = 0; i < f.count; i++) { + if (!strcmp(f.name[i], frame_varname)) ret->frame_arg = i; + if (!strcmp(f.name[i], subframe_varname)) ret->subframe_arg = i; + if (!strcmp(f.name[i], data_varname)) ret->data_arg = i; + } + if (ret->frame_arg == -1) { + printf("%s:%d: frame argument '%s' not found in event '%s'\n", + __FILE__, __LINE__, frame_varname, event_name); + abort(); + } + if (ret->subframe_arg == -1) { + printf("%s:%d: subframe argument '%s' not found in event '%s'\n", + __FILE__, __LINE__, subframe_varname, event_name); + abort(); + } + if (ret->data_arg == -1) { + printf("%s:%d: data argument '%s' not found in event '%s'\n", + __FILE__, __LINE__, data_varname, event_name); + abort(); + } + if (strcmp(f.type[ret->frame_arg], "int") != 0) { + printf("%s:%d: argument '%s' has wrong type (should be 'int')\n", + __FILE__, __LINE__, frame_varname); + abort(); + } + if (strcmp(f.type[ret->subframe_arg], "int") != 0) { + printf("%s:%d: argument '%s' has wrong type (should be 'int')\n", + __FILE__, __LINE__, subframe_varname); + abort(); + } + if (strcmp(f.type[ret->data_arg], "int") != 0 && + strcmp(f.type[ret->data_arg], "float") != 0) { + printf("%s:%d: argument '%s' has wrong type" + " (should be 'int' or 'float')\n", + __FILE__, __LINE__, data_varname); + abort(); + } + + return ret; +} diff --git a/common/utils/T/tracer/openair_logo.h b/common/utils/T/tracer/openair_logo.h new file mode 100644 index 0000000000000000000000000000000000000000..4a98c3d871623984c99236d276fd68a8183da879 --- /dev/null +++ b/common/utils/T/tracer/openair_logo.h @@ -0,0 +1,395 @@ +/* this file (minus this comment) was obtained by running: + * xxd -i openair_logo.png > openair_logo.h + */ +unsigned char openair_logo_png[] = { + 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, + 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0x28, + 0x08, 0x06, 0x00, 0x00, 0x00, 0x08, 0x78, 0x5f, 0x43, 0x00, 0x00, 0x00, + 0x06, 0x62, 0x4b, 0x47, 0x44, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0xa0, + 0xbd, 0xa7, 0x93, 0x00, 0x00, 0x00, 0x09, 0x70, 0x48, 0x59, 0x73, 0x00, + 0x00, 0x0b, 0x13, 0x00, 0x00, 0x0b, 0x13, 0x01, 0x00, 0x9a, 0x9c, 0x18, + 0x00, 0x00, 0x00, 0x07, 0x74, 0x49, 0x4d, 0x45, 0x07, 0xe0, 0x05, 0x17, + 0x0e, 0x30, 0x2a, 0xd1, 0xdd, 0x83, 0x5b, 0x00, 0x00, 0x11, 0xc5, 0x49, + 0x44, 0x41, 0x54, 0x68, 0xde, 0xed, 0x9b, 0x79, 0x70, 0x94, 0xe7, 0x7d, + 0xc7, 0x3f, 0xcf, 0xf3, 0xbe, 0xbb, 0x2b, 0xed, 0xea, 0xbe, 0xef, 0x03, + 0x24, 0x10, 0x08, 0x8c, 0xb9, 0x31, 0x06, 0x73, 0xd4, 0xd8, 0x4e, 0x38, + 0x62, 0x63, 0x77, 0x92, 0x90, 0xcb, 0x9d, 0x34, 0x19, 0x27, 0xce, 0xa4, + 0xed, 0x8c, 0xd3, 0x78, 0xd2, 0x64, 0xd2, 0x36, 0x9d, 0x34, 0xa9, 0xdb, + 0xa6, 0x99, 0xb6, 0x49, 0x67, 0x82, 0xe3, 0x24, 0x76, 0x9a, 0x34, 0x76, + 0x5c, 0x1f, 0x18, 0x8f, 0x31, 0xc4, 0xc6, 0x06, 0xcc, 0x69, 0x21, 0xb0, + 0x05, 0x08, 0x1d, 0x80, 0x2e, 0x74, 0xae, 0xa4, 0xbd, 0xb4, 0xbb, 0xef, + 0xfb, 0x3c, 0xfd, 0x63, 0x57, 0x2b, 0xd6, 0x12, 0x58, 0x60, 0x32, 0x74, + 0xb0, 0x9f, 0x99, 0x1d, 0x69, 0x9f, 0xe7, 0xf9, 0x3d, 0xd7, 0xf7, 0x77, + 0x3f, 0xcf, 0x0a, 0xad, 0xb5, 0xe6, 0x43, 0x5a, 0x94, 0xd6, 0xf4, 0x07, + 0xc3, 0xf8, 0xa3, 0x51, 0x3a, 0x47, 0xfc, 0xf4, 0x05, 0x82, 0x0c, 0xf8, + 0x43, 0x98, 0x52, 0x50, 0xec, 0x49, 0xa5, 0x38, 0xdd, 0x4d, 0x71, 0xba, + 0x87, 0x34, 0x97, 0x93, 0x74, 0x97, 0x13, 0x21, 0xc4, 0x1f, 0x7d, 0x4d, + 0xe2, 0xc3, 0x0a, 0xc8, 0xde, 0xce, 0x3e, 0xde, 0xea, 0x1e, 0x60, 0x45, + 0x51, 0x2e, 0x45, 0x9e, 0x14, 0x72, 0x52, 0x9c, 0xa4, 0x3b, 0x1d, 0x38, + 0x0d, 0x03, 0x04, 0x44, 0x6d, 0x9b, 0x50, 0xc4, 0xc2, 0x1f, 0x8e, 0x30, + 0x1c, 0x0a, 0xd1, 0xed, 0x1d, 0xa1, 0x36, 0x3f, 0x97, 0x19, 0x05, 0xb9, + 0x1f, 0x01, 0x72, 0x3d, 0xcb, 0x68, 0x24, 0xca, 0x7f, 0x34, 0xb6, 0x30, + 0x37, 0x27, 0x83, 0x7b, 0x67, 0x96, 0x5e, 0x15, 0x6d, 0x63, 0x47, 0x0f, + 0x03, 0x23, 0x3e, 0x6e, 0x9f, 0x5d, 0x4d, 0x8a, 0xc3, 0xf1, 0x11, 0x20, + 0x1f, 0xb4, 0xbc, 0x7c, 0xbe, 0x97, 0x0e, 0x9f, 0x9f, 0x7b, 0x67, 0x94, + 0x51, 0xe0, 0x76, 0x5d, 0xd3, 0x18, 0xc1, 0x48, 0x84, 0x53, 0x1d, 0xdd, + 0xe4, 0x78, 0xdc, 0x54, 0x17, 0x15, 0x7c, 0x04, 0xc8, 0xb5, 0x96, 0x86, + 0xfe, 0x61, 0x0e, 0x5c, 0x1c, 0xe4, 0xe1, 0xf9, 0x33, 0xaf, 0xcb, 0x78, + 0xa7, 0x2e, 0x74, 0x91, 0x9b, 0x91, 0x46, 0x41, 0x56, 0xe6, 0x75, 0x5d, + 0xa7, 0xfc, 0x30, 0x80, 0xb1, 0xaf, 0x67, 0x90, 0x97, 0xcf, 0xf7, 0x4d, + 0x0b, 0x8c, 0xd1, 0x70, 0x04, 0x7f, 0x38, 0xfa, 0xbe, 0xfd, 0xe6, 0x54, + 0x94, 0xd2, 0x33, 0xe8, 0x65, 0x60, 0x78, 0xe4, 0xba, 0xae, 0xd5, 0xbc, + 0xd9, 0xc1, 0x08, 0x5a, 0x36, 0xfb, 0x7b, 0x86, 0xf8, 0xd6, 0x92, 0x59, + 0x97, 0xed, 0xd3, 0xe1, 0x0b, 0xf2, 0xf8, 0x89, 0xb3, 0x48, 0x65, 0x33, + 0x33, 0xc3, 0x83, 0x43, 0x08, 0x46, 0x82, 0x21, 0xd2, 0x1d, 0x06, 0x1b, + 0xea, 0x66, 0x90, 0xeb, 0x71, 0x4f, 0x49, 0xb7, 0x60, 0x66, 0x15, 0x0d, + 0x67, 0x5a, 0xc8, 0xf0, 0xb8, 0x71, 0x5e, 0x27, 0x9b, 0x72, 0xd3, 0xab, + 0xac, 0x7f, 0x6a, 0x38, 0xcb, 0xa6, 0xaa, 0x22, 0xe6, 0x66, 0xa7, 0x4f, + 0x6a, 0x3b, 0x37, 0x1a, 0x64, 0xe7, 0xb9, 0x6e, 0xb2, 0x9d, 0x0e, 0xb6, + 0xd6, 0x96, 0xe3, 0x32, 0x92, 0x15, 0x86, 0x65, 0x2b, 0x1a, 0x3b, 0xba, + 0x51, 0xb6, 0xa2, 0xb6, 0x28, 0x8f, 0xac, 0x29, 0x80, 0x09, 0x85, 0xc3, + 0xf4, 0x0d, 0x0e, 0x53, 0x59, 0x52, 0xf8, 0x91, 0x84, 0xbc, 0x5f, 0x79, + 0x77, 0xc8, 0x87, 0x37, 0x6c, 0x4d, 0x09, 0x46, 0x87, 0x2f, 0xc4, 0x4f, + 0xdf, 0x69, 0xe3, 0x6f, 0x97, 0xcd, 0x21, 0xd5, 0x34, 0xa6, 0x3e, 0x1c, + 0x43, 0xb2, 0xb8, 0xaa, 0x8c, 0xa8, 0x6d, 0xd3, 0xd8, 0x7a, 0x9e, 0xb9, + 0x95, 0xa5, 0xb8, 0x5d, 0xc9, 0xce, 0x40, 0xaa, 0xcb, 0xc5, 0xa8, 0xdf, + 0x8f, 0x52, 0xf9, 0x48, 0x79, 0x1d, 0x2c, 0x80, 0xbe, 0x89, 0xcb, 0x5f, + 0xee, 0x3b, 0xa9, 0xb5, 0x9a, 0x5c, 0xdf, 0x1f, 0x0a, 0xeb, 0x07, 0x77, + 0x1f, 0x9b, 0x54, 0xef, 0x1d, 0x0b, 0xeb, 0xd6, 0xa1, 0x11, 0x7d, 0xde, + 0x3b, 0xaa, 0xfd, 0xe1, 0x48, 0x52, 0x9b, 0xd2, 0x4a, 0xbf, 0x71, 0xfc, + 0x1d, 0x1d, 0x89, 0x46, 0x27, 0xd1, 0x05, 0x82, 0x21, 0x7d, 0xa6, 0xa5, + 0xed, 0xba, 0xac, 0xf9, 0xa6, 0x95, 0x90, 0xd1, 0x88, 0x45, 0x65, 0x7a, + 0x2a, 0x4c, 0x11, 0x5c, 0x3f, 0xdd, 0xd2, 0xc5, 0xbf, 0xae, 0x9a, 0x9f, + 0x54, 0xf7, 0xc3, 0xa3, 0xa7, 0x29, 0x48, 0x71, 0xb0, 0xa2, 0x30, 0x07, + 0x5b, 0xc0, 0xa1, 0xf6, 0x0e, 0xa4, 0xb2, 0x59, 0x3b, 0xa7, 0x36, 0xa6, + 0xdb, 0x11, 0xac, 0x9c, 0x3f, 0x87, 0xd3, 0xed, 0xe7, 0xa9, 0x9f, 0x59, + 0x9d, 0x44, 0xeb, 0x4e, 0x4d, 0x21, 0x1c, 0x8d, 0x60, 0xdb, 0x0a, 0xc3, + 0x90, 0xfc, 0x67, 0x63, 0x1b, 0xbf, 0x69, 0xef, 0x27, 0x64, 0xab, 0xd8, + 0xf4, 0xd2, 0x60, 0xd7, 0xc7, 0x17, 0x91, 0xe3, 0x8a, 0x1d, 0xf7, 0xe3, + 0xef, 0x9c, 0xe3, 0x17, 0x67, 0x7b, 0xc9, 0x4e, 0x75, 0xf1, 0xcd, 0x85, + 0xd5, 0xdc, 0x5e, 0x98, 0x79, 0xf3, 0xab, 0xac, 0xe1, 0x48, 0x74, 0x4a, + 0x55, 0x15, 0xb2, 0x6d, 0xbc, 0x91, 0x28, 0xd9, 0xae, 0x09, 0x23, 0xfc, + 0x58, 0x43, 0x33, 0x9b, 0x67, 0x94, 0x32, 0x37, 0x67, 0xa2, 0x7f, 0x6d, + 0x5e, 0x36, 0x43, 0xfe, 0x20, 0x0d, 0x2d, 0xed, 0x2c, 0xac, 0x89, 0x01, + 0x60, 0x48, 0x49, 0xa6, 0xc7, 0x43, 0x24, 0x1a, 0x9d, 0x64, 0xc4, 0x0b, + 0x72, 0x73, 0x09, 0x04, 0x83, 0x64, 0xa4, 0xa7, 0xd1, 0x36, 0x1a, 0xa4, + 0x69, 0x38, 0xcc, 0x33, 0x1b, 0xea, 0x09, 0x5a, 0x0a, 0x1b, 0xf0, 0x98, + 0x12, 0xb4, 0x66, 0xcb, 0x8b, 0x87, 0x79, 0x7b, 0x34, 0xc2, 0xf7, 0x97, + 0xd5, 0xd0, 0x33, 0xea, 0xe7, 0xae, 0x17, 0x8e, 0xf0, 0xe4, 0x5d, 0x8b, + 0xd8, 0x5a, 0x99, 0x73, 0x73, 0x03, 0x32, 0x12, 0x89, 0x92, 0xee, 0x9c, + 0xbc, 0xbd, 0x5f, 0x9e, 0xee, 0x60, 0x55, 0xf1, 0x44, 0xfa, 0xe3, 0xdf, + 0x1a, 0x5b, 0x59, 0x92, 0x9f, 0x93, 0x04, 0xc6, 0x78, 0xc9, 0x49, 0x73, + 0x13, 0xcc, 0x48, 0xa7, 0x7f, 0xc8, 0x4b, 0x7e, 0x4e, 0x36, 0x00, 0x69, + 0xee, 0x54, 0x02, 0x81, 0x20, 0xce, 0xf7, 0xc4, 0x1f, 0x99, 0xe9, 0xe9, + 0xf8, 0xfc, 0x7e, 0x74, 0x9a, 0x07, 0x7f, 0xd4, 0x26, 0xc3, 0x65, 0x72, + 0xbc, 0x6f, 0x04, 0xbf, 0xd2, 0x3c, 0x30, 0xa3, 0x18, 0x97, 0x21, 0x19, + 0x0c, 0x8e, 0x71, 0xc6, 0x1f, 0x66, 0x43, 0x65, 0x11, 0x9f, 0x9f, 0x55, + 0x0c, 0xc0, 0x17, 0xeb, 0x2b, 0x89, 0xe8, 0x0f, 0x41, 0x1c, 0xd2, 0x13, + 0x1c, 0x23, 0x63, 0x0a, 0x57, 0xf4, 0xe5, 0x0b, 0xbd, 0xdc, 0x56, 0x18, + 0xe3, 0x46, 0x0d, 0x1c, 0xe9, 0x1f, 0x66, 0x5d, 0x59, 0x5e, 0xcc, 0xab, + 0xd2, 0x9a, 0xed, 0xa7, 0x3a, 0xd9, 0x7e, 0xaa, 0x13, 0x3b, 0xee, 0x7c, + 0x96, 0x15, 0xe4, 0xd1, 0x76, 0xa1, 0x73, 0xc2, 0x88, 0xa7, 0xb8, 0x18, + 0x1e, 0xf5, 0x4d, 0x0e, 0xe8, 0x0c, 0x09, 0x08, 0x34, 0x10, 0x88, 0x5a, + 0x78, 0x43, 0x21, 0x5e, 0xec, 0x18, 0x62, 0x5f, 0xe7, 0x20, 0x8b, 0x9f, + 0x39, 0xc0, 0x6f, 0xdb, 0x07, 0x70, 0x4a, 0x81, 0x00, 0x0c, 0x21, 0xe8, + 0x1d, 0xf1, 0xb1, 0xf8, 0x99, 0xb7, 0xd8, 0xb8, 0xf3, 0x18, 0x47, 0x07, + 0xfc, 0x37, 0x3f, 0x20, 0x1e, 0xc3, 0x24, 0xcb, 0x35, 0x19, 0x90, 0xd9, + 0x59, 0x69, 0x38, 0xa4, 0x48, 0xe4, 0xb5, 0xee, 0xad, 0x2e, 0x4e, 0xb4, + 0xf5, 0x06, 0x23, 0xbc, 0x70, 0xae, 0x8f, 0x1d, 0xe7, 0xfb, 0x39, 0xed, + 0x0d, 0x24, 0xea, 0x73, 0x33, 0x33, 0x12, 0xff, 0x3b, 0x4c, 0x13, 0xa7, + 0x39, 0x59, 0xf2, 0xa4, 0x90, 0x38, 0x1c, 0x26, 0x42, 0x08, 0xfe, 0xe2, + 0xd6, 0x99, 0xfc, 0x6e, 0xc3, 0xad, 0xbc, 0xb6, 0x65, 0x09, 0xbb, 0x3e, + 0xb1, 0x8c, 0xfb, 0xcb, 0xb3, 0xf8, 0x61, 0xc3, 0xb9, 0x84, 0x37, 0x27, + 0x80, 0x5c, 0x4f, 0x2a, 0xdf, 0x5e, 0x3c, 0x83, 0x40, 0x34, 0xca, 0xf6, + 0xa6, 0xee, 0x9b, 0xdf, 0x86, 0xdc, 0x5e, 0x9c, 0x33, 0x75, 0x5c, 0x72, + 0x5b, 0xfd, 0x84, 0x9a, 0x71, 0x3a, 0xf8, 0xd3, 0x99, 0x25, 0x89, 0xef, + 0xa5, 0x1e, 0x17, 0x2f, 0x7c, 0x6c, 0xd1, 0x24, 0x9a, 0x9a, 0xea, 0xca, + 0x89, 0x83, 0x97, 0x92, 0xd2, 0x92, 0xa2, 0xc9, 0x2e, 0xb2, 0x69, 0x90, + 0x95, 0x99, 0x81, 0xd2, 0x9a, 0x1d, 0x6d, 0x17, 0x39, 0xe8, 0x0d, 0xb1, + 0xa1, 0x2c, 0x17, 0x8d, 0x26, 0x60, 0xd9, 0xb8, 0x1d, 0x4e, 0x24, 0x60, + 0x4a, 0xc1, 0xc5, 0xe0, 0x18, 0xd2, 0x30, 0x59, 0x5d, 0x94, 0x85, 0x29, + 0x48, 0x30, 0xc8, 0xa4, 0xc0, 0x30, 0x14, 0x0a, 0xd2, 0xd1, 0xd1, 0x85, + 0xdf, 0xef, 0xc7, 0x30, 0x0c, 0x72, 0x73, 0x73, 0x28, 0x2b, 0x2b, 0x9b, + 0x34, 0x79, 0x67, 0x67, 0x27, 0x7d, 0x7d, 0x7d, 0xc9, 0x11, 0xa6, 0x10, + 0xa4, 0xa5, 0xa5, 0x51, 0x56, 0x56, 0x4e, 0x6a, 0x6a, 0xca, 0x24, 0x9a, + 0xf6, 0xf6, 0x76, 0xbc, 0x5e, 0xef, 0x94, 0x87, 0xa4, 0x94, 0xa2, 0xb8, + 0xb8, 0x98, 0xd2, 0xd2, 0x58, 0xf6, 0xb5, 0xbf, 0xbf, 0x9f, 0x8e, 0x8e, + 0x0e, 0x4a, 0x4b, 0x4b, 0x29, 0x2c, 0x2c, 0xbc, 0xd4, 0x45, 0xa7, 0xb9, + 0xb9, 0x99, 0x40, 0x20, 0x80, 0xd3, 0xe9, 0xa4, 0xbe, 0xbe, 0xfe, 0xaa, + 0xee, 0x28, 0x0e, 0x5c, 0x1c, 0xe6, 0xf8, 0xa0, 0x8f, 0x95, 0x85, 0x59, + 0xdc, 0x9a, 0x37, 0xd9, 0x66, 0x74, 0x07, 0xc2, 0x3c, 0xdd, 0x7a, 0x11, + 0x29, 0x04, 0x1b, 0xca, 0x73, 0xa9, 0xcb, 0xf2, 0x4c, 0xd0, 0x0d, 0x8c, + 0xa2, 0x92, 0x24, 0x42, 0x50, 0x90, 0xe2, 0x64, 0x79, 0x61, 0x26, 0xe5, + 0x69, 0xc9, 0xfb, 0x7d, 0x77, 0x60, 0x84, 0x47, 0xde, 0x3a, 0xc3, 0xbb, + 0xc3, 0x21, 0x9c, 0x02, 0x8a, 0xd3, 0xdd, 0xfc, 0xe4, 0x8e, 0x7a, 0xe6, + 0x67, 0xbb, 0xd9, 0xd1, 0xda, 0xc3, 0x3f, 0x34, 0xb4, 0x33, 0x10, 0xb6, + 0x89, 0xda, 0x36, 0x17, 0x02, 0x63, 0x6c, 0xa8, 0x28, 0x61, 0xd7, 0xc6, + 0x5b, 0x92, 0x25, 0xe4, 0xb5, 0xd7, 0x5e, 0xa7, 0xb1, 0xb1, 0x71, 0xd2, + 0x22, 0x0d, 0xc3, 0x60, 0xf3, 0xe6, 0x4d, 0x54, 0x55, 0x55, 0x01, 0xd0, + 0xd2, 0xd2, 0xca, 0x73, 0xcf, 0x3d, 0x87, 0x69, 0x5e, 0x5e, 0xb8, 0xe6, + 0xcd, 0x9b, 0xc7, 0x9d, 0x77, 0xfe, 0x49, 0xe2, 0xfb, 0xd1, 0xa3, 0x47, + 0xd9, 0xbb, 0xf7, 0x0d, 0x0c, 0x63, 0xea, 0x00, 0xcc, 0xb6, 0x6d, 0x56, + 0xac, 0x58, 0x4e, 0x69, 0x69, 0x29, 0xd1, 0x68, 0x94, 0x27, 0x9e, 0xf8, + 0x05, 0x4e, 0xa7, 0x13, 0x87, 0xc3, 0xc1, 0xb6, 0x6d, 0x9f, 0x26, 0x3b, + 0x3b, 0x3b, 0x01, 0xdc, 0xf1, 0xe3, 0x8d, 0xf4, 0xf4, 0xf4, 0x90, 0x99, + 0x99, 0x49, 0x7d, 0x7d, 0xfd, 0xb4, 0xc1, 0xd8, 0xdb, 0x33, 0xc4, 0xdd, + 0x3b, 0x8e, 0xe1, 0x36, 0x0d, 0xa2, 0x4a, 0x73, 0xf4, 0xfe, 0x15, 0xcc, + 0x8e, 0x1f, 0xf8, 0x78, 0x39, 0xef, 0x0f, 0xf1, 0xe8, 0xa1, 0xb3, 0xb8, + 0x0c, 0x41, 0x5e, 0x8a, 0x83, 0xba, 0x2c, 0x0f, 0xbb, 0x3b, 0x07, 0xf9, + 0xe4, 0xee, 0x46, 0xa6, 0xca, 0x67, 0x8c, 0xb3, 0xc2, 0x7d, 0xd5, 0x85, + 0x6c, 0x5f, 0x3b, 0xb1, 0x96, 0xfa, 0xbc, 0x4c, 0x76, 0x6e, 0x5e, 0xc6, + 0x38, 0xaf, 0x0b, 0x21, 0x12, 0x7d, 0x37, 0xcd, 0x2c, 0x66, 0xe3, 0x8c, + 0x62, 0x34, 0xfa, 0x92, 0x71, 0x26, 0x98, 0xca, 0xb4, 0x6d, 0x9b, 0x17, + 0x5e, 0x78, 0x91, 0xd6, 0xd6, 0x56, 0x84, 0x10, 0x54, 0x54, 0x94, 0x53, + 0x54, 0x54, 0x44, 0x24, 0x12, 0xa5, 0xad, 0xad, 0x8d, 0x40, 0x20, 0xc0, + 0xef, 0x7f, 0xff, 0x2c, 0x5b, 0xb7, 0xde, 0x47, 0x75, 0x75, 0x35, 0x3e, + 0x9f, 0x0f, 0x21, 0x04, 0x4a, 0x29, 0x66, 0xcc, 0x98, 0x41, 0x41, 0x41, + 0x01, 0x5a, 0x2b, 0x6c, 0x5b, 0xd1, 0xd3, 0xd3, 0x43, 0x57, 0x57, 0x17, + 0x8d, 0x8d, 0x8d, 0x8c, 0x8e, 0xfa, 0xb8, 0xf7, 0xde, 0x2d, 0x48, 0x29, + 0xf1, 0x7a, 0x87, 0x13, 0x34, 0x75, 0x75, 0x75, 0x64, 0x65, 0x65, 0x72, + 0x69, 0xc6, 0x46, 0x29, 0x4d, 0x69, 0x69, 0x4c, 0x12, 0xfd, 0x7e, 0x7f, + 0xa2, 0x2d, 0x1c, 0x0e, 0xb3, 0x67, 0xcf, 0x6b, 0x3c, 0xf0, 0xc0, 0xd6, + 0x0f, 0xac, 0xc2, 0xbe, 0xf6, 0xe6, 0x69, 0x52, 0xe2, 0xa9, 0x11, 0x01, + 0xfc, 0xd5, 0xfe, 0x33, 0xec, 0xdc, 0x98, 0xac, 0x9e, 0xf4, 0x7b, 0xfe, + 0x02, 0x0c, 0x86, 0xa3, 0x68, 0x1d, 0x33, 0xf8, 0x6b, 0x8b, 0x73, 0x58, + 0x51, 0x98, 0x89, 0xa5, 0x35, 0x96, 0xd2, 0x9c, 0x1c, 0xf2, 0xb1, 0xab, + 0x63, 0x90, 0xff, 0x6e, 0xe9, 0xe1, 0x1d, 0xaf, 0x8f, 0x5d, 0x1b, 0x97, + 0x90, 0x11, 0xf7, 0xec, 0x44, 0x1c, 0x88, 0x29, 0xf3, 0x55, 0x22, 0x19, + 0x84, 0x24, 0xd5, 0x37, 0x3a, 0x3a, 0x4a, 0x47, 0x47, 0x07, 0x86, 0x61, + 0x24, 0x38, 0x7b, 0x7c, 0xa0, 0x45, 0x8b, 0x16, 0xf2, 0xd4, 0x53, 0xbf, + 0x46, 0x6b, 0xcd, 0xab, 0xaf, 0xee, 0xe6, 0xcb, 0x5f, 0xfe, 0x52, 0xa2, + 0x4d, 0x29, 0x45, 0x4d, 0xcd, 0x4c, 0xe6, 0xcd, 0x9b, 0x97, 0xc4, 0xe9, + 0x3b, 0x77, 0xbe, 0x4c, 0x6b, 0x6b, 0x2b, 0xed, 0xed, 0xed, 0x84, 0xc3, + 0x61, 0x52, 0x53, 0x53, 0x13, 0x34, 0xb6, 0x6d, 0x53, 0x5f, 0x3f, 0x97, + 0xca, 0xca, 0xca, 0xcb, 0x27, 0xd7, 0x2e, 0xd9, 0x84, 0x94, 0x92, 0xf3, + 0xe7, 0xcf, 0x71, 0xe2, 0xc4, 0x49, 0x6e, 0xb9, 0x65, 0xfe, 0x35, 0x83, + 0xb1, 0xb7, 0xdb, 0xcb, 0x05, 0x7f, 0x08, 0x43, 0x08, 0x6c, 0xad, 0x31, + 0xa5, 0xe0, 0x8d, 0x8b, 0x5e, 0xce, 0x8e, 0x04, 0xa9, 0xcd, 0x74, 0x5f, + 0x39, 0xd9, 0x17, 0x3f, 0x38, 0x4b, 0x69, 0xee, 0x2c, 0xcb, 0xe1, 0xeb, + 0xf3, 0x93, 0xd7, 0xfe, 0x9d, 0xc3, 0x67, 0xf9, 0xf1, 0xc9, 0x0b, 0x9c, + 0x1d, 0x0e, 0x72, 0xa0, 0x77, 0x98, 0x7b, 0xca, 0xf3, 0x3e, 0x58, 0xfa, + 0x5d, 0x29, 0x85, 0x6d, 0xdb, 0x00, 0x14, 0x16, 0x16, 0x24, 0x1d, 0x48, + 0x76, 0x76, 0x36, 0x5a, 0x6b, 0x84, 0x10, 0x04, 0x83, 0xc1, 0xe9, 0xa4, + 0x61, 0x88, 0x46, 0x63, 0xa9, 0xeb, 0x71, 0x8f, 0x63, 0x2a, 0xee, 0xb8, + 0x9a, 0x62, 0x18, 0x06, 0xfb, 0xf7, 0xef, 0x23, 0x18, 0x0c, 0x5d, 0x5b, + 0x6a, 0x08, 0x78, 0xaa, 0xb9, 0x1b, 0x43, 0x08, 0x94, 0xd6, 0x3c, 0xb2, + 0xa0, 0x8a, 0x90, 0x65, 0xe3, 0x90, 0x82, 0xff, 0x6a, 0xba, 0xf0, 0x81, + 0x25, 0x2f, 0x60, 0xd9, 0x89, 0x7d, 0xa5, 0x1a, 0x1f, 0xdc, 0x69, 0x35, + 0x93, 0x8d, 0xab, 0x9e, 0x16, 0xe7, 0x4e, 0x78, 0x16, 0x31, 0xf2, 0xa1, + 0xa1, 0x21, 0x4e, 0x9d, 0x3a, 0x4d, 0x53, 0x53, 0x13, 0x81, 0x40, 0x80, + 0x68, 0x34, 0xca, 0xaa, 0x55, 0xb7, 0x93, 0x92, 0x92, 0x32, 0x69, 0x0c, + 0x9f, 0x2f, 0xc0, 0xe8, 0xe8, 0x08, 0x4a, 0x69, 0xb4, 0x56, 0x64, 0x66, + 0x66, 0x5d, 0x36, 0x29, 0xe7, 0x74, 0x3a, 0xb1, 0x2c, 0x8b, 0xb1, 0xb1, + 0x30, 0x47, 0x8e, 0x1c, 0x61, 0xcd, 0x9a, 0x3b, 0xae, 0xfe, 0xc0, 0xa2, + 0x36, 0x7b, 0xba, 0x06, 0x01, 0x58, 0x55, 0x9c, 0xcd, 0xb7, 0x17, 0xcd, + 0xe4, 0x7f, 0xdb, 0xfb, 0x38, 0xe7, 0x0b, 0xf1, 0x87, 0xae, 0x21, 0x7c, + 0x51, 0x8b, 0x74, 0xc7, 0xd5, 0x3b, 0x9b, 0xaf, 0x74, 0x0c, 0xf0, 0xfd, + 0xb7, 0xdb, 0x38, 0x39, 0xe4, 0xc7, 0xd2, 0x9a, 0xf5, 0x45, 0x39, 0xac, + 0x29, 0xc9, 0xb9, 0x71, 0xd9, 0x5e, 0xd3, 0x34, 0xd9, 0xbd, 0x7b, 0x0f, + 0xcf, 0x3f, 0xff, 0x02, 0x5a, 0x6b, 0xa4, 0x94, 0x78, 0x3c, 0x1e, 0x0a, + 0x0b, 0x0b, 0x58, 0xb1, 0xe2, 0x36, 0xaa, 0xab, 0xab, 0xa6, 0xa4, 0x79, + 0xe9, 0xa5, 0x9d, 0xd8, 0xb6, 0x8d, 0x10, 0x82, 0x50, 0x28, 0xc4, 0x37, + 0xbe, 0xf1, 0x08, 0x69, 0x69, 0x9e, 0x29, 0xe7, 0x28, 0x2c, 0x2c, 0xc4, + 0xb2, 0xa2, 0xf4, 0xf4, 0x5c, 0xe4, 0xd0, 0xa1, 0x43, 0xd4, 0xd6, 0xd6, + 0x5c, 0x75, 0x46, 0xf5, 0x77, 0x2d, 0x17, 0xe9, 0x0e, 0x86, 0xf1, 0x98, + 0x06, 0x5b, 0xab, 0x0b, 0x11, 0x02, 0x3e, 0x5b, 0x5b, 0xc2, 0x3f, 0xbc, + 0xdd, 0xca, 0x69, 0x6f, 0x90, 0xe3, 0x03, 0x3e, 0x56, 0x17, 0x67, 0x4f, + 0xef, 0xae, 0x02, 0xc1, 0x33, 0x6d, 0xbd, 0x3c, 0xfc, 0x66, 0x13, 0xde, + 0xb0, 0x85, 0x43, 0x0a, 0x72, 0x53, 0x1c, 0x7c, 0x69, 0x4e, 0x19, 0x3f, + 0x5c, 0x31, 0xeb, 0xc6, 0xa7, 0xdf, 0x23, 0x91, 0x08, 0x85, 0x85, 0x05, + 0x14, 0x17, 0x17, 0x53, 0x55, 0x55, 0x4d, 0x7e, 0x7e, 0x1e, 0x59, 0x59, + 0x97, 0xe7, 0x78, 0xa5, 0x14, 0x95, 0x95, 0xe5, 0xa4, 0xa6, 0xba, 0x01, + 0x4d, 0x24, 0x12, 0xc1, 0x71, 0x05, 0xee, 0x34, 0x4d, 0x93, 0x75, 0xeb, + 0xd6, 0xf2, 0xb3, 0x9f, 0x6d, 0xc7, 0xe5, 0x72, 0xb1, 0x63, 0xc7, 0x0e, + 0xdc, 0x6e, 0xcf, 0x55, 0xad, 0xf1, 0x9b, 0x87, 0x9a, 0x71, 0x9b, 0x06, + 0x52, 0x08, 0xb6, 0xd5, 0xc6, 0x82, 0xc0, 0xad, 0x33, 0x0a, 0x78, 0xac, + 0xb1, 0x1d, 0x5b, 0x6b, 0xfe, 0xe6, 0xf0, 0x59, 0xde, 0xf8, 0xc4, 0xb2, + 0x69, 0x8d, 0xe5, 0x34, 0x04, 0x0f, 0xbd, 0xd1, 0x84, 0xad, 0x35, 0x45, + 0x6e, 0x27, 0xdf, 0x5b, 0x5a, 0xcb, 0x1d, 0x25, 0xd9, 0x54, 0xa7, 0xa7, + 0x5e, 0xb7, 0xf8, 0xc9, 0xbc, 0x56, 0xfd, 0x6e, 0x59, 0x16, 0x9b, 0x36, + 0x6d, 0xa4, 0xae, 0xae, 0x6e, 0xda, 0x34, 0xb6, 0x6d, 0xb3, 0x72, 0xe5, + 0x4a, 0xca, 0xcb, 0xcb, 0xa7, 0x7b, 0x35, 0x40, 0x4e, 0x4e, 0x0e, 0xb7, + 0xdf, 0xbe, 0x92, 0xc3, 0x87, 0x8f, 0x10, 0x0c, 0x86, 0x08, 0x04, 0x82, + 0xd3, 0x8e, 0x3d, 0x9e, 0x38, 0xdd, 0xc5, 0x98, 0xad, 0x30, 0xa5, 0xc0, + 0xed, 0x30, 0x78, 0x68, 0x6f, 0x13, 0x11, 0x15, 0xfb, 0x6e, 0x6b, 0x8d, + 0x21, 0x04, 0x07, 0xfb, 0x46, 0x38, 0xd2, 0x37, 0xc2, 0xd2, 0x82, 0xf7, + 0xbf, 0x1b, 0xb7, 0x94, 0xe6, 0xcf, 0xea, 0x4a, 0xf8, 0x59, 0x53, 0x17, + 0xde, 0x70, 0x94, 0x53, 0x5e, 0x3f, 0x5f, 0x98, 0x5d, 0x72, 0x5d, 0x03, + 0xda, 0xf7, 0x95, 0xff, 0xf1, 0xcd, 0x4f, 0x75, 0xb1, 0x68, 0x59, 0xd6, + 0x55, 0x4f, 0xa8, 0x94, 0xba, 0x6a, 0x9a, 0x65, 0xcb, 0x96, 0x91, 0x99, + 0x99, 0x79, 0x59, 0x5b, 0x36, 0xa5, 0xf4, 0x2a, 0xc5, 0x6f, 0x5b, 0x2f, + 0xe2, 0x90, 0x02, 0x4b, 0x69, 0x2e, 0x8c, 0x86, 0xf8, 0xe5, 0xe9, 0x4e, + 0x7e, 0xd3, 0xdc, 0xcd, 0x93, 0xa7, 0xbb, 0xe8, 0x0f, 0x45, 0xb0, 0xb5, + 0xc6, 0x63, 0x1a, 0x7c, 0xbf, 0xa1, 0x6d, 0x7a, 0x0c, 0xa5, 0x35, 0x8f, + 0xad, 0x98, 0xcd, 0x9a, 0x92, 0x6c, 0x94, 0x86, 0x1f, 0x9f, 0xbc, 0xc0, + 0xd7, 0xf6, 0x9d, 0xba, 0xae, 0x80, 0x98, 0x2e, 0x97, 0x0b, 0xb7, 0xdb, + 0x4d, 0x28, 0x14, 0x62, 0xff, 0xfe, 0xfd, 0x54, 0x54, 0x54, 0x90, 0x91, + 0x91, 0x81, 0x52, 0x8a, 0x86, 0x86, 0x06, 0x94, 0x52, 0x28, 0xa5, 0xa8, + 0xad, 0xad, 0xbd, 0x2e, 0x13, 0xda, 0xb6, 0x9d, 0x18, 0x33, 0x89, 0x33, + 0xa4, 0xbc, 0xa2, 0x71, 0x5f, 0xbe, 0x7c, 0x39, 0xbb, 0x76, 0xed, 0x9a, + 0xb6, 0x0d, 0xe9, 0x0a, 0x84, 0x69, 0x18, 0x18, 0x45, 0x03, 0x1f, 0xab, + 0xc8, 0xe3, 0x89, 0x75, 0xf3, 0xb0, 0x2f, 0xe1, 0x29, 0xa7, 0x14, 0xdc, + 0xf3, 0xd2, 0x31, 0x1a, 0x07, 0x7d, 0x34, 0x0e, 0xf8, 0xe8, 0x0c, 0x8c, + 0x31, 0x5d, 0x05, 0xf1, 0xfc, 0x3d, 0x0b, 0xb9, 0xfb, 0xa5, 0x63, 0x1c, + 0xee, 0x1d, 0xe1, 0xc9, 0xe6, 0x6e, 0x66, 0x65, 0x7a, 0xf8, 0xfa, 0xfc, + 0x8a, 0xeb, 0x03, 0x48, 0x5a, 0x5a, 0x1a, 0x6b, 0xd6, 0xac, 0x61, 0xd7, + 0xae, 0x5d, 0x04, 0x83, 0x21, 0xb6, 0x6f, 0x7f, 0x9c, 0x9c, 0x9c, 0x1c, + 0xa2, 0xd1, 0x28, 0x3e, 0x5f, 0x2c, 0xab, 0x59, 0x5a, 0x5a, 0xc2, 0x86, + 0x0d, 0x77, 0x5e, 0xf3, 0x24, 0x4a, 0x29, 0xb4, 0xd6, 0x98, 0xa6, 0xc9, + 0x9e, 0x3d, 0x7f, 0x98, 0x14, 0xe5, 0xdb, 0xb6, 0xcd, 0xad, 0xb7, 0x2e, + 0x60, 0xc9, 0x92, 0x25, 0x57, 0x88, 0xfe, 0xeb, 0x69, 0x69, 0x69, 0xa5, + 0xa5, 0xe5, 0x2c, 0xa6, 0x69, 0xbe, 0xaf, 0xa4, 0xfd, 0xe2, 0x74, 0x17, + 0xc1, 0xa8, 0x4d, 0x8a, 0x69, 0xf0, 0x99, 0xda, 0x62, 0x3c, 0x53, 0x5c, + 0xd3, 0x7e, 0xb1, 0xae, 0x94, 0xaf, 0xef, 0x3b, 0x4d, 0xdf, 0x58, 0x84, + 0xd7, 0xbb, 0xbc, 0xcc, 0xca, 0x72, 0x27, 0x45, 0xe0, 0x57, 0x04, 0xe5, + 0xee, 0x85, 0xdc, 0xb3, 0xf3, 0x18, 0x6f, 0xf7, 0x8f, 0xf2, 0xd7, 0x07, + 0xcf, 0x20, 0x05, 0x7c, 0x6d, 0x5e, 0xc5, 0xf5, 0x51, 0x59, 0x75, 0x75, + 0xb3, 0xf9, 0xea, 0x57, 0x1f, 0x62, 0xe9, 0xd2, 0x25, 0xa4, 0xa4, 0xa4, + 0x30, 0x32, 0x32, 0x42, 0x30, 0x18, 0xa4, 0x20, 0xbf, 0x80, 0xcd, 0x9b, + 0x37, 0xb3, 0x6d, 0xdb, 0xb6, 0x84, 0x0b, 0xab, 0xb5, 0x4e, 0xfa, 0x4c, + 0xa7, 0xac, 0x5e, 0xbd, 0x8a, 0xf4, 0xf4, 0x74, 0xb4, 0xd6, 0xf8, 0xfd, + 0x7e, 0x86, 0x87, 0x87, 0x27, 0x7d, 0xc6, 0x42, 0xa1, 0xf8, 0xf8, 0x5c, + 0x76, 0xfc, 0x4d, 0x9b, 0x3e, 0x4e, 0x41, 0x41, 0x21, 0x4a, 0x69, 0xe6, + 0xce, 0x9d, 0x73, 0x45, 0xf5, 0xf5, 0x83, 0x86, 0x76, 0x4c, 0x29, 0x71, + 0x9b, 0x92, 0x75, 0xa5, 0x53, 0xbb, 0xa3, 0xab, 0x8b, 0xb3, 0xc9, 0x70, + 0x9a, 0x18, 0x42, 0xf2, 0xdd, 0xa3, 0x2d, 0xa4, 0x1a, 0x12, 0xa5, 0x35, + 0x4a, 0x5f, 0x1a, 0xb5, 0x6b, 0xb4, 0x26, 0xa9, 0x0e, 0x20, 0xc5, 0x94, + 0xbc, 0xbe, 0x65, 0x29, 0x15, 0x69, 0x29, 0xb8, 0xa4, 0xc1, 0x77, 0x8e, + 0xb4, 0xf0, 0x54, 0x73, 0xf7, 0x07, 0x06, 0x44, 0x04, 0x7c, 0x83, 0xda, + 0xb6, 0x2d, 0x94, 0xb6, 0x30, 0xe2, 0x1b, 0x0c, 0xf8, 0x7d, 0x18, 0x12, + 0x4c, 0xd3, 0x41, 0x24, 0x12, 0xc6, 0xb2, 0x22, 0x68, 0xad, 0xd0, 0x4a, + 0x13, 0xb5, 0xa2, 0xd8, 0xd1, 0x28, 0x5a, 0xdb, 0x48, 0x19, 0x7b, 0x07, + 0x8b, 0x56, 0x09, 0x29, 0x40, 0xab, 0x58, 0xdf, 0xd8, 0xc9, 0xc6, 0x0f, + 0x55, 0xe3, 0x30, 0x4d, 0x82, 0xa1, 0x20, 0xca, 0xb6, 0xe3, 0xdb, 0x14, + 0xb1, 0xbf, 0xf1, 0x76, 0x29, 0x24, 0x86, 0x61, 0xa0, 0xb4, 0xc6, 0x8a, + 0x07, 0x97, 0x42, 0x08, 0x4c, 0xc3, 0x84, 0xf1, 0xb4, 0x9e, 0x10, 0x18, + 0x86, 0x41, 0x34, 0x12, 0xa1, 0x7c, 0xc6, 0x2d, 0xe4, 0x16, 0x4f, 0xed, + 0x6a, 0xaa, 0x78, 0xaa, 0xc3, 0x52, 0x0a, 0x43, 0x88, 0x49, 0xaf, 0x49, + 0xde, 0x6b, 0x17, 0xb4, 0x86, 0x90, 0xad, 0x48, 0x77, 0x18, 0x58, 0xf1, + 0x58, 0xcc, 0x8c, 0x67, 0x60, 0xc7, 0x01, 0xba, 0xb4, 0x6e, 0x2a, 0x63, + 0xaf, 0xb4, 0x66, 0xcc, 0x56, 0x89, 0xd4, 0xc9, 0x35, 0xab, 0x2c, 0xad, + 0x35, 0x1a, 0x85, 0x56, 0x8a, 0xa8, 0x6d, 0x61, 0x2b, 0x1b, 0x69, 0x08, + 0x94, 0x6d, 0x13, 0x0a, 0x85, 0xd0, 0xda, 0x46, 0x29, 0x3b, 0x01, 0x88, + 0x40, 0x23, 0x24, 0x08, 0x25, 0x50, 0xda, 0x42, 0xdb, 0x3a, 0x0e, 0x88, + 0x1d, 0xe7, 0x6a, 0x95, 0x00, 0x05, 0x0d, 0x4a, 0x2b, 0x34, 0x60, 0x45, + 0x42, 0x71, 0x90, 0x6c, 0x40, 0xa1, 0x11, 0x08, 0x4d, 0xec, 0xb0, 0x75, + 0x6c, 0xe3, 0xb6, 0x15, 0x0b, 0xad, 0xa5, 0x14, 0x38, 0xa4, 0x40, 0x6b, + 0x8d, 0x1d, 0x89, 0xa0, 0xb1, 0x27, 0x0e, 0x30, 0xae, 0x54, 0x0c, 0xe3, + 0xf2, 0xef, 0xa0, 0x9a, 0x87, 0x03, 0xbc, 0xd5, 0x3b, 0xcc, 0x67, 0x67, + 0x95, 0xd0, 0x19, 0x18, 0x23, 0x64, 0xd9, 0xcc, 0xcd, 0x4e, 0xa3, 0x71, + 0xd0, 0xc7, 0x81, 0x8b, 0xc3, 0x6c, 0xae, 0xcc, 0xe7, 0xc5, 0xf3, 0xfd, + 0x49, 0xa0, 0x6c, 0xab, 0x2d, 0xe6, 0xed, 0x81, 0x00, 0x07, 0x2e, 0x0e, + 0x23, 0x85, 0x60, 0xcc, 0xb2, 0x79, 0x78, 0x5e, 0x05, 0xbe, 0xa8, 0xcd, + 0x33, 0xad, 0x17, 0xb1, 0xb5, 0xa6, 0x30, 0xd5, 0xc5, 0x03, 0x33, 0x63, + 0xd9, 0x67, 0x5f, 0xd4, 0xe2, 0xe9, 0xd6, 0x5e, 0xc6, 0xec, 0x18, 0xf3, + 0x95, 0xa7, 0xa7, 0xb0, 0xa5, 0xb2, 0x00, 0x0d, 0x3c, 0x7f, 0xae, 0x97, + 0x8d, 0x15, 0x05, 0x49, 0x69, 0xf5, 0x86, 0x81, 0x51, 0x8e, 0xf4, 0x8d, + 0xf0, 0xa9, 0xda, 0x62, 0x32, 0xe2, 0xae, 0xfe, 0xab, 0x9d, 0x83, 0x34, + 0x0f, 0x07, 0x10, 0x42, 0xa0, 0xd1, 0x3c, 0x5c, 0x5f, 0x81, 0xe9, 0x49, + 0xff, 0xe3, 0xbe, 0xe6, 0xbe, 0x96, 0xf2, 0x64, 0xdb, 0x20, 0x0f, 0xbe, + 0xf6, 0x2e, 0xa6, 0x10, 0x68, 0x31, 0x2e, 0x4d, 0xc9, 0xf9, 0x10, 0xeb, + 0x74, 0x2b, 0xa8, 0xe6, 0x09, 0xce, 0x32, 0x24, 0xed, 0x9f, 0x59, 0x4d, + 0x99, 0x27, 0x85, 0xc3, 0x7d, 0x23, 0x7c, 0xfb, 0x48, 0x0b, 0x0f, 0xd6, + 0x95, 0x72, 0xf7, 0x8e, 0xa3, 0x8c, 0x46, 0x2d, 0x5a, 0x3e, 0x7d, 0x07, + 0x7b, 0xbb, 0x87, 0x78, 0xe4, 0x60, 0x33, 0x1b, 0x2b, 0xf2, 0x69, 0x19, + 0x09, 0xf2, 0x6a, 0xd7, 0x20, 0x29, 0x52, 0xb2, 0xb2, 0x28, 0x0b, 0xa7, + 0x94, 0x2c, 0x7f, 0xf6, 0x20, 0xf7, 0x56, 0x15, 0x52, 0xea, 0x71, 0x11, + 0xb0, 0x6c, 0x94, 0xd6, 0xfc, 0xf3, 0xf1, 0x73, 0xfc, 0xaa, 0xb9, 0x8b, + 0xcf, 0xcf, 0x2a, 0xe1, 0xad, 0xde, 0x61, 0xbe, 0x79, 0xf0, 0x0c, 0x87, + 0xef, 0xbf, 0x8d, 0x57, 0x3a, 0x06, 0x78, 0xf4, 0x50, 0x33, 0x5f, 0x98, + 0x55, 0x42, 0x44, 0xa9, 0xc4, 0x0a, 0xf7, 0xf5, 0x78, 0xb9, 0x6f, 0xc7, + 0x31, 0xd6, 0x57, 0x14, 0xb0, 0x67, 0x4b, 0xcc, 0x26, 0x3e, 0xb4, 0xb7, + 0x89, 0xc6, 0x21, 0x1f, 0x8b, 0xf3, 0x33, 0xf8, 0xd6, 0xaf, 0xdf, 0xe4, + 0xdf, 0x57, 0xd5, 0xf1, 0xc9, 0x9a, 0x62, 0xee, 0x7a, 0xee, 0x30, 0x0f, + 0xcc, 0x2a, 0xa1, 0xd4, 0xe3, 0xfa, 0xff, 0x73, 0x41, 0x35, 0xd4, 0x77, + 0x1e, 0xad, 0xed, 0x84, 0x29, 0x95, 0x02, 0x22, 0xfd, 0x7d, 0x3c, 0x98, + 0x37, 0xc6, 0x54, 0x1a, 0x42, 0x03, 0xa6, 0xe1, 0x20, 0x33, 0xaf, 0x2a, + 0x26, 0x85, 0xf1, 0x92, 0xe3, 0x72, 0x90, 0xeb, 0x72, 0xc6, 0xf2, 0x5f, + 0x42, 0xc4, 0x32, 0xbb, 0x1a, 0xdc, 0xa6, 0x41, 0x87, 0x7f, 0x8c, 0xfb, + 0x77, 0x35, 0xf0, 0xe9, 0x9a, 0x12, 0x52, 0x0d, 0x49, 0x45, 0x7a, 0x0a, + 0xff, 0xb2, 0x72, 0x36, 0x5f, 0x79, 0xa3, 0x89, 0x2c, 0x97, 0x83, 0x7f, + 0x5c, 0x1e, 0xf3, 0x20, 0x53, 0x0d, 0x83, 0x47, 0x17, 0x56, 0xb3, 0x38, + 0x7f, 0xe2, 0x86, 0xd0, 0x90, 0x82, 0xca, 0xf4, 0x54, 0x7e, 0xb0, 0x62, + 0x16, 0x27, 0x87, 0x7c, 0x2c, 0x79, 0xe6, 0x20, 0x61, 0x5b, 0x21, 0x04, + 0xcc, 0xca, 0xf4, 0xf0, 0xd8, 0x6d, 0xb3, 0xdf, 0x93, 0x55, 0x3e, 0xc5, + 0xdd, 0xd5, 0x85, 0x1c, 0xea, 0x1b, 0xe1, 0xc4, 0xa0, 0x8f, 0x5b, 0x72, + 0xd3, 0x79, 0xb6, 0xbd, 0x97, 0x03, 0x5b, 0x97, 0x53, 0x93, 0xe1, 0xe6, + 0xbb, 0x8b, 0x67, 0x22, 0x85, 0xc0, 0x56, 0x1a, 0xa7, 0xcb, 0x9c, 0x34, + 0xdf, 0x0d, 0x05, 0x44, 0x6b, 0xcd, 0xbb, 0x47, 0x77, 0x20, 0x44, 0xb2, + 0x8e, 0x5f, 0xec, 0x30, 0x58, 0x96, 0x26, 0x2e, 0xe3, 0xb1, 0xd9, 0x94, + 0x54, 0x2d, 0x20, 0xbf, 0xb6, 0x66, 0x7a, 0x1e, 0x1e, 0xf0, 0xb9, 0x59, + 0x25, 0xfc, 0xbe, 0xbd, 0x37, 0x61, 0x23, 0x2f, 0x05, 0x57, 0x5d, 0xe2, + 0x38, 0x08, 0x01, 0x9f, 0xd9, 0x73, 0x82, 0x2c, 0xa7, 0xc9, 0xcf, 0xd7, + 0xcd, 0x63, 0x6e, 0x76, 0x5a, 0xa2, 0x6d, 0xdb, 0xee, 0x13, 0x1c, 0xe8, + 0x1d, 0xe6, 0xb7, 0x1b, 0x16, 0x50, 0xe2, 0x71, 0x21, 0x85, 0xa0, 0xc9, + 0xeb, 0x67, 0xc1, 0xd3, 0x07, 0xf8, 0xca, 0xdc, 0x72, 0x1e, 0xaa, 0x2f, + 0xe7, 0xad, 0xde, 0x61, 0xce, 0xf9, 0x43, 0x3c, 0xbe, 0xb6, 0x9e, 0x4f, + 0xed, 0x3e, 0xc1, 0x13, 0x67, 0xba, 0xf8, 0xd1, 0xca, 0x3a, 0x10, 0x24, + 0xe6, 0xce, 0x4f, 0x8d, 0x31, 0x4d, 0xc4, 0x56, 0x58, 0x4a, 0xf3, 0xd9, + 0x3d, 0x27, 0xc8, 0x74, 0x99, 0x3c, 0x7b, 0xd7, 0x42, 0x4a, 0x3c, 0xae, + 0x1b, 0x0d, 0x88, 0xcd, 0x82, 0xdb, 0x92, 0xef, 0x3a, 0x1c, 0x52, 0xf2, + 0xc0, 0x2b, 0xc7, 0x71, 0x3b, 0x8c, 0xcb, 0x82, 0x98, 0xda, 0x66, 0xe2, + 0xe8, 0x7a, 0xe7, 0x12, 0x23, 0xae, 0xb9, 0xaf, 0xba, 0x90, 0x4f, 0x54, + 0x4d, 0xfd, 0xf3, 0x80, 0x5b, 0xf3, 0x32, 0x58, 0x5a, 0x90, 0xc9, 0xc3, + 0x6f, 0x9e, 0x22, 0xd5, 0x94, 0x57, 0x58, 0x0f, 0xfc, 0x74, 0xf5, 0x5c, + 0xee, 0x28, 0xc9, 0x9e, 0x04, 0xde, 0x2d, 0x39, 0x69, 0x1c, 0xeb, 0x1f, + 0x65, 0x6d, 0x49, 0x76, 0x62, 0xce, 0x9a, 0x4c, 0x37, 0x87, 0xb7, 0xae, + 0x20, 0x1a, 0x77, 0xc1, 0x7f, 0x7e, 0xaa, 0x0b, 0x0d, 0xfc, 0xf9, 0xde, + 0x26, 0xc6, 0x6c, 0xc5, 0x73, 0xe7, 0xfa, 0xf8, 0xd1, 0xca, 0x3a, 0x2c, + 0xa5, 0x13, 0xf6, 0x64, 0x77, 0xe7, 0x20, 0x11, 0x5b, 0x71, 0x77, 0x79, + 0x1e, 0x86, 0x10, 0xfc, 0xe4, 0x3d, 0xf3, 0xdd, 0x50, 0x40, 0x84, 0x30, + 0x48, 0xcf, 0x2a, 0x4c, 0xca, 0x0a, 0x9c, 0x1c, 0xf0, 0xf1, 0x87, 0x61, + 0x41, 0x86, 0xf3, 0xf2, 0x07, 0x27, 0x7c, 0x01, 0x60, 0xe2, 0x11, 0x42, + 0x54, 0x29, 0x3e, 0x57, 0x5b, 0x9a, 0xc4, 0xe9, 0x46, 0xec, 0x16, 0x28, + 0xa6, 0x02, 0x6d, 0xc5, 0x57, 0xeb, 0x2b, 0xf9, 0xd5, 0x99, 0x6e, 0xda, + 0x46, 0x43, 0x97, 0x5c, 0xc3, 0xc6, 0xae, 0x62, 0xc7, 0x4b, 0x9a, 0xc3, + 0xe0, 0xa9, 0xb3, 0x3d, 0xbc, 0xde, 0x3d, 0x44, 0xd0, 0xb2, 0xf9, 0xde, + 0xb2, 0xda, 0x78, 0x1f, 0x78, 0x74, 0xd1, 0x0c, 0x0e, 0xf4, 0x8d, 0x70, + 0xff, 0x2b, 0xc7, 0x79, 0xe9, 0xe3, 0x8b, 0x11, 0x62, 0xc2, 0xeb, 0x72, + 0x48, 0x89, 0x37, 0x1c, 0x65, 0x77, 0xd7, 0x20, 0x2f, 0xde, 0xb3, 0x88, + 0x35, 0x71, 0xd0, 0x2a, 0x9e, 0xdc, 0xcb, 0xce, 0xf3, 0xfd, 0x7c, 0x69, + 0x4e, 0x19, 0x5b, 0x5e, 0x6e, 0x60, 0x7d, 0x49, 0x0e, 0xff, 0xd3, 0x76, + 0x91, 0xbf, 0x5b, 0x52, 0x83, 0x21, 0x63, 0xde, 0xdf, 0x53, 0x67, 0xbb, + 0x79, 0xbd, 0x7b, 0x08, 0x0d, 0xfc, 0xfd, 0xd2, 0x9a, 0x1b, 0xfb, 0xd8, + 0xba, 0xfb, 0x5c, 0x23, 0xde, 0x81, 0x8e, 0xa4, 0x2b, 0xd1, 0xa1, 0x31, + 0x8b, 0x36, 0x5f, 0x68, 0x12, 0x87, 0x26, 0x24, 0xc8, 0x99, 0xca, 0xac, + 0x05, 0xeb, 0x93, 0x62, 0x14, 0xad, 0xa1, 0x3e, 0x27, 0x2d, 0xe1, 0xde, + 0xf6, 0x06, 0xc3, 0xb4, 0xfb, 0xc6, 0x58, 0x51, 0x98, 0xc9, 0x91, 0xbe, + 0x11, 0x8a, 0xdd, 0x2e, 0xca, 0xd2, 0x52, 0xe8, 0xf0, 0x8f, 0xe1, 0x8b, + 0x5a, 0x09, 0x55, 0xd4, 0x3c, 0x1c, 0xc0, 0x90, 0x82, 0x99, 0x19, 0xb1, + 0x80, 0xf0, 0xdd, 0x21, 0x3f, 0xfd, 0xa1, 0x08, 0x3a, 0x0e, 0xf2, 0xfa, + 0xd2, 0x5c, 0x3a, 0xfc, 0x63, 0x78, 0xc3, 0x51, 0x16, 0xe5, 0x67, 0x60, + 0x6b, 0xcd, 0xde, 0x6e, 0x2f, 0x4b, 0xf2, 0x33, 0x18, 0xb3, 0x15, 0x9d, + 0xfe, 0x31, 0x16, 0xc5, 0xf5, 0x7f, 0xd0, 0xb2, 0x39, 0xd8, 0x3b, 0xc2, + 0xfa, 0x4b, 0x62, 0x9e, 0x53, 0xde, 0x00, 0xa0, 0x99, 0x93, 0x9d, 0xc6, + 0x89, 0x41, 0x1f, 0xde, 0x70, 0x94, 0xaa, 0x74, 0x37, 0x95, 0xe9, 0xb1, + 0x98, 0xee, 0x68, 0xff, 0x28, 0xfe, 0xa8, 0x15, 0x8b, 0xbd, 0x80, 0xf5, + 0xa5, 0x39, 0x37, 0x0e, 0x10, 0xad, 0x15, 0x67, 0x4f, 0xbc, 0xc6, 0x88, + 0x37, 0x39, 0x98, 0x0a, 0x59, 0x2a, 0xe9, 0xbe, 0x39, 0x39, 0x6e, 0xd6, + 0xe4, 0xe4, 0x55, 0x50, 0x33, 0x7f, 0xed, 0x15, 0x52, 0xe4, 0xd3, 0xa8, + 0x13, 0x53, 0xd5, 0x8b, 0x2b, 0x46, 0xe9, 0xd3, 0x1b, 0xe3, 0x72, 0xf7, + 0x8d, 0x5c, 0x79, 0xbd, 0x22, 0x6e, 0xd0, 0xc4, 0x0d, 0xfe, 0x39, 0x82, + 0x6d, 0x45, 0x92, 0x0e, 0x5f, 0x69, 0x58, 0xb7, 0xe3, 0x18, 0x41, 0xdb, + 0xc6, 0x10, 0x32, 0xa1, 0x52, 0x0c, 0x29, 0xd1, 0x42, 0x60, 0x0a, 0x81, + 0x34, 0x0d, 0x4c, 0xd3, 0x81, 0x94, 0x02, 0xa7, 0x90, 0x08, 0xa1, 0x71, + 0x08, 0x89, 0x29, 0x63, 0xed, 0xa6, 0x10, 0x98, 0x52, 0x20, 0xa5, 0xc0, + 0x10, 0x02, 0x87, 0x20, 0x51, 0x6f, 0x88, 0x98, 0xd7, 0x64, 0x08, 0x19, + 0x7b, 0x7e, 0x13, 0x57, 0x6d, 0x26, 0x02, 0x43, 0x82, 0x21, 0x0d, 0x0c, + 0x21, 0x30, 0x0c, 0x30, 0x90, 0x31, 0x3a, 0x34, 0x86, 0x90, 0x13, 0xb4, + 0xd2, 0x48, 0x3c, 0xe7, 0x31, 0x20, 0x56, 0x2f, 0x04, 0x32, 0x3e, 0xe6, + 0xf8, 0xbc, 0x32, 0x51, 0x1f, 0x03, 0x25, 0x36, 0xbf, 0x8e, 0xed, 0x47, + 0xc4, 0xd6, 0x27, 0x11, 0xf1, 0xf5, 0x80, 0x88, 0xc7, 0x5f, 0x37, 0xd4, + 0x86, 0x18, 0xa6, 0x33, 0xe9, 0x7b, 0xfb, 0x68, 0x88, 0x8e, 0x90, 0xcd, + 0x98, 0x52, 0x18, 0x09, 0x30, 0xc0, 0x90, 0x1a, 0x25, 0xc1, 0x29, 0x80, + 0xa8, 0x85, 0x29, 0x15, 0xd2, 0x90, 0x38, 0xa5, 0xc0, 0x14, 0xe0, 0x94, + 0x32, 0x01, 0x84, 0x63, 0x1c, 0x10, 0xc3, 0xc0, 0x21, 0x62, 0x34, 0x86, + 0x90, 0x38, 0x25, 0x48, 0x62, 0x6d, 0x46, 0xbc, 0xdf, 0xa5, 0x60, 0x99, + 0x02, 0x4c, 0x43, 0xc7, 0x0e, 0x4e, 0x09, 0x0c, 0x14, 0x26, 0xe3, 0x6d, + 0xb1, 0x88, 0xdf, 0x21, 0x05, 0x52, 0xc6, 0x40, 0x70, 0x48, 0x89, 0x8c, + 0x03, 0x62, 0x0a, 0x81, 0x21, 0x63, 0xb4, 0x52, 0x49, 0x0c, 0x19, 0x4b, + 0xed, 0x1b, 0x82, 0x58, 0x7f, 0x40, 0x09, 0x1d, 0x03, 0x4c, 0x80, 0x8a, + 0x83, 0x65, 0xa0, 0xd1, 0x0a, 0xb4, 0x88, 0x8d, 0xa3, 0x15, 0xfc, 0x1f, + 0xd7, 0xc0, 0x3b, 0xab, 0xdb, 0x65, 0xb1, 0x8a, 0x00, 0x00, 0x00, 0x00, + 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82 +}; +unsigned int openair_logo_png_len = 4664; diff --git a/common/utils/T/tracer/openair_logo.png b/common/utils/T/tracer/openair_logo.png new file mode 100644 index 0000000000000000000000000000000000000000..8b3dcfe46ef222f6b21f7d7517914b3e6019873f Binary files /dev/null and b/common/utils/T/tracer/openair_logo.png differ diff --git a/common/utils/T/tracer/plot.c b/common/utils/T/tracer/plot.c new file mode 100644 index 0000000000000000000000000000000000000000..74473842883c7e968ecf3c84079c4645e18f2467 --- /dev/null +++ b/common/utils/T/tracer/plot.c @@ -0,0 +1,291 @@ +#include "defs.h" +#include <X11/Xlib.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <pthread.h> +#include <math.h> +#include <unistd.h> +#include <sys/select.h> +#include <stdarg.h> + +typedef struct { + float *buf; + short *iqbuf; + int count; + int type; + volatile int iq_count; /* for ULSCH IQ data */ + int iq_insert_pos; + GC g; +} data; + +typedef struct { + Display *d; + Window w; + Pixmap px; + GC bg; + int width; + int height; + pthread_mutex_t lock; + float zoom; + int timer_pipe[2]; + data *p; /* list of plots */ + int nplots; +} plot; + +static void *timer_thread(void *_p) +{ + plot *p = _p; + char c; + + while (1) { + /* more or less 10Hz */ + usleep(100*1000); + c = 1; + if (write(p->timer_pipe[1], &c, 1) != 1) abort(); + } + + return NULL; +} + +static void *plot_thread(void *_p) +{ + float v; + float *s; + int i, j; + plot *p = _p; + int redraw = 0; + int replot = 0; + fd_set rset; + int xfd = ConnectionNumber(p->d); + int maxfd = xfd > p->timer_pipe[0] ? xfd : p->timer_pipe[0]; + int pp; + + while (1) { + while (XPending(p->d)) { + XEvent e; + XNextEvent(p->d, &e); + switch (e.type) { + case ButtonPress: + /* button 4: zoom out */ + if (e.xbutton.button == 4) { p->zoom = p->zoom * 1.25; replot = 1; } + /* button 5: zoom in */ + if (e.xbutton.button == 5) { p->zoom = p->zoom * 0.8; replot = 1; } + printf("zoom: %f\n", p->zoom); + break; + case Expose: redraw = 1; break; + } + } + + if (replot == 1) { + replot = 0; + redraw = 1; + + if (pthread_mutex_lock(&p->lock)) abort(); + + XFillRectangle(p->d, p->px, p->bg, 0, 0, p->width, p->height); + + for (pp = 0; pp < p->nplots; pp++) { + if (p->p[pp].type == PLOT_MINMAX) { + s = p->p[pp].buf; + for (i = 0; i < 512; i++) { + int min = *s; + int max = *s; + for (j = 0; j < p->p[pp].count/512; j++, s++) { + if (*s < min) min = *s; + if (*s > max) max = *s; + } + XDrawLine(p->d, p->px, p->p[pp].g, i, 100-min, i, 100-max); + } + } else if (p->p[pp].type == PLOT_VS_TIME) { + for (i = 0; i < p->p[pp].count; i++) + p->p[pp].buf[i] = + 10*log10(1.0+(float)(p->p[pp].iqbuf[2*i]*p->p[pp].iqbuf[2*i]+ + p->p[pp].iqbuf[2*i+1]*p->p[pp].iqbuf[2*i+1])); + s = p->p[pp].buf; + for (i = 0; i < 512; i++) { + v = 0; + for (j = 0; j < p->p[pp].count/512; j++, s++) v += *s; + v /= p->p[pp].count/512; + XDrawLine(p->d, p->px, p->p[pp].g, i, 100, i, 100-v); + } + } else if (p->p[pp].type == PLOT_IQ_POINTS) { + XPoint pts[p->p[pp].iq_count]; + int count = p->p[pp].iq_count; + for (i = 0; i < count; i++) { + pts[i].x = p->p[pp].iqbuf[2*i]*p->zoom/20+50; + pts[i].y = -p->p[pp].iqbuf[2*i+1]*p->zoom/20+50; + } + XDrawPoints(p->d, p->px, p->p[pp].g, pts, count, CoordModeOrigin); + } + } + + if (pthread_mutex_unlock(&p->lock)) abort(); + } + + if (redraw) { + redraw = 0; + XCopyArea(p->d, p->px, p->w, DefaultGC(p->d, DefaultScreen(p->d)), + 0, 0, p->width, p->height, 0, 0); + } + + XFlush(p->d); + + FD_ZERO(&rset); + FD_SET(p->timer_pipe[0], &rset); + FD_SET(xfd, &rset); + if (select(maxfd+1, &rset, NULL, NULL, NULL) == -1) abort(); + if (FD_ISSET(p->timer_pipe[0], &rset)) { + char b[512]; + if (read(p->timer_pipe[0], b, 512) <= 0) abort(); + replot = 1; + } + } + + return NULL; +} + +void *make_plot(int width, int height, char *title, int nplots, ...) +{ + plot *p; + Display *d; + Window w; + Pixmap pm; + int i; + va_list ap; + XGCValues gcv; + + p = malloc(sizeof(*p)); if (p == NULL) abort(); + + d = XOpenDisplay(0); if (d == NULL) abort(); + w = XCreateSimpleWindow(d, DefaultRootWindow(d), 0, 0, width, height, + 0, WhitePixel(d, DefaultScreen(d)), WhitePixel(d, DefaultScreen(d))); + XSelectInput(d, w, ExposureMask | ButtonPressMask); + XMapWindow(d, w); + + { + XSetWindowAttributes att; + att.backing_store = Always; + XChangeWindowAttributes(d, w, CWBackingStore, &att); + } + + XStoreName(d, w, title); + + p->bg = XCreateGC(d, w, 0, NULL); + XCopyGC(d, DefaultGC(d, DefaultScreen(d)), -1L, p->bg); + gcv.foreground = WhitePixel(d, DefaultScreen(d)); + XChangeGC(d, p->bg, GCForeground, &gcv); + + pm = XCreatePixmap(d, w, width, height, DefaultDepth(d, DefaultScreen(d))); + + p->width = width; + p->height = height; + p->p = malloc(nplots * sizeof(data)); if (p->p == NULL) abort(); + + va_start(ap, nplots); + for (i = 0; i < nplots; i++) { + int count; + int type; + char *color; + XColor rcol, scol; + + count = va_arg(ap, int); + type = va_arg(ap, int); + color = va_arg(ap, char *); + + p->p[i].g = XCreateGC(d, w, 0, NULL); + XCopyGC(d, DefaultGC(d, DefaultScreen(d)), -1L, p->p[i].g); + if (XAllocNamedColor(d, DefaultColormap(d, DefaultScreen(d)), + color, &scol, &rcol)) { + gcv.foreground = scol.pixel; + XChangeGC(d, p->p[i].g, GCForeground, &gcv); + } else { + printf("could not allocate color '%s'\n", color); + abort(); + } + + if (type == PLOT_VS_TIME) { + p->p[i].buf = malloc(sizeof(float) * count); + if (p->p[i].buf == NULL) abort(); + p->p[i].iqbuf = malloc(sizeof(short) * count * 2); + if(p->p[i].iqbuf==NULL)abort(); + } else if (type == PLOT_MINMAX) { + p->p[i].buf = malloc(sizeof(float) * count); + if (p->p[i].buf == NULL) abort(); + p->p[i].iqbuf = NULL; + } else { + p->p[i].buf = NULL; + p->p[i].iqbuf = malloc(sizeof(short) * count * 2); + if(p->p[i].iqbuf==NULL)abort(); + } + p->p[i].count = count; + p->p[i].type = type; + p->p[i].iq_count = 0; + p->p[i].iq_insert_pos = 0; + } + va_end(ap); + + p->d = d; + p->w = w; + p->px = pm; + + p->zoom = 1; + p->nplots = nplots; + + pthread_mutex_init(&p->lock, NULL); + + if (pipe(p->timer_pipe)) abort(); + + new_thread(plot_thread, p); + new_thread(timer_thread, p); + + return p; +} + +void plot_set(void *_plot, float *data, int len, int pos, int pp) +{ + plot *p = _plot; + if (pthread_mutex_lock(&p->lock)) abort(); + memcpy(p->p[pp].buf + pos, data, len * sizeof(float)); + if (pthread_mutex_unlock(&p->lock)) abort(); +} + +void iq_plot_set(void *_plot, short *data, int count, int pos, int pp) +{ + plot *p = _plot; + if (pthread_mutex_lock(&p->lock)) abort(); + memcpy(p->p[pp].iqbuf + pos * 2, data, count * 2 * sizeof(short)); + if (pthread_mutex_unlock(&p->lock)) abort(); +} + +void iq_plot_set_sized(void *_plot, short *data, int count, int pp) +{ + plot *p = _plot; + if (pthread_mutex_lock(&p->lock)) abort(); + memcpy(p->p[pp].iqbuf, data, count * 2 * sizeof(short)); + p->p[pp].iq_count = count; + if (pthread_mutex_unlock(&p->lock)) abort(); +} + +void iq_plot_add_iq_point_loop(void *_plot, short i, short q, int pp) +{ + plot *p = _plot; + if (pthread_mutex_lock(&p->lock)) abort(); + p->p[pp].iqbuf[p->p[pp].iq_insert_pos*2] = i; + p->p[pp].iqbuf[p->p[pp].iq_insert_pos*2+1] = q; + if (p->p[pp].iq_count != p->p[pp].count) p->p[pp].iq_count++; + p->p[pp].iq_insert_pos++; + if (p->p[pp].iq_insert_pos == p->p[pp].count) p->p[pp].iq_insert_pos = 0; + if (pthread_mutex_unlock(&p->lock)) abort(); +} + +void iq_plot_add_energy_point_loop(void *_plot, int e, int pp) +{ + plot *p = _plot; + if (pthread_mutex_lock(&p->lock)) abort(); + p->p[pp].buf[p->p[pp].iq_insert_pos] = e; + if (p->p[pp].iq_count != p->p[pp].count) p->p[pp].iq_count++; + p->p[pp].iq_insert_pos++; + if (p->p[pp].iq_insert_pos == p->p[pp].count) p->p[pp].iq_insert_pos = 0; + if (pthread_mutex_unlock(&p->lock)) abort(); +} diff --git a/common/utils/T/tracer/textlog.c b/common/utils/T/tracer/textlog.c new file mode 100644 index 0000000000000000000000000000000000000000..f3d0b34831dbe8e72d2f9553f4672fbdd6af436b --- /dev/null +++ b/common/utils/T/tracer/textlog.c @@ -0,0 +1,194 @@ +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <pthread.h> +#include <signal.h> +#include "database.h" +#include "event.h" +#include "handler.h" +#include "logger/logger.h" +#include "view/view.h" +#include "gui/gui.h" +#include "utils.h" +#include "../T_defs.h" +#include "event_selector.h" +#include "config.h" + +#define DEFAULT_REMOTE_IP "127.0.0.1" +#define DEFAULT_REMOTE_PORT 2021 + +typedef struct { + int socket; + int *is_on; + int nevents; + pthread_mutex_t lock; +} textlog_data; + +void is_on_changed(void *_d) +{ + textlog_data *d = _d; + char t; + + if (pthread_mutex_lock(&d->lock)) abort(); + + if (d->socket == -1) goto no_connection; + + t = 1; + if (socket_send(d->socket, &t, 1) == -1 || + socket_send(d->socket, &d->nevents, sizeof(int)) == -1 || + socket_send(d->socket, d->is_on, d->nevents * sizeof(int)) == -1) + abort(); + +no_connection: + if (pthread_mutex_unlock(&d->lock)) abort(); +} + +void usage(void) +{ + printf( +"options:\n" +" -d <database file> this option is mandatory\n" +" -on <GROUP or ID> turn log ON for given GROUP or ID\n" +" -off <GROUP or ID> turn log OFF for given GROUP or ID\n" +" -ON turn all logs ON\n" +" -OFF turn all logs OFF\n" +" note: you may pass several -on/-off/-ON/-OFF,\n" +" they will be processed in order\n" +" by default, all is off\n" +" -ip <host> connect to given IP address (default %s)\n" +" -p <port> connect to given port (default %d)\n" +" -x GUI output\n" +" -debug-gui activate GUI debug logs\n" +" -no-gui disable GUI entirely\n", + DEFAULT_REMOTE_IP, + DEFAULT_REMOTE_PORT + ); + exit(1); +} + +static void *gui_thread(void *_g) +{ + gui *g = _g; + gui_loop(g); + return NULL; +} + +int main(int n, char **v) +{ + extern int volatile gui_logd; + char *database_filename = NULL; + void *database; + char *ip = DEFAULT_REMOTE_IP; + int port = DEFAULT_REMOTE_PORT; + char **on_off_name; + int *on_off_action; + int on_off_n = 0; + int *is_on; + int number_of_events; + int i; + event_handler *h; + logger *textlog; + gui *g; + int gui_mode = 0; + view *out; + int gui_active = 1; + textlog_data textlog_data; + + /* write on a socket fails if the other end is closed and we get SIGPIPE */ + if (signal(SIGPIPE, SIG_IGN) == SIG_ERR) abort(); + + on_off_name = malloc(n * sizeof(char *)); if (on_off_name == NULL) abort(); + on_off_action = malloc(n * sizeof(int)); if (on_off_action == NULL) abort(); + + for (i = 1; i < n; i++) { + if (!strcmp(v[i], "-h") || !strcmp(v[i], "--help")) usage(); + if (!strcmp(v[i], "-d")) + { if (i > n-2) usage(); database_filename = v[++i]; continue; } + if (!strcmp(v[i], "-ip")) { if (i > n-2) usage(); ip = v[++i]; continue; } + if (!strcmp(v[i], "-p")) + { if (i > n-2) usage(); port = atoi(v[++i]); continue; } + if (!strcmp(v[i], "-on")) { if (i > n-2) usage(); + on_off_name[on_off_n]=v[++i]; on_off_action[on_off_n++]=1; continue; } + if (!strcmp(v[i], "-off")) { if (i > n-2) usage(); + on_off_name[on_off_n]=v[++i]; on_off_action[on_off_n++]=0; continue; } + if (!strcmp(v[i], "-ON")) + { on_off_name[on_off_n]=NULL; on_off_action[on_off_n++]=1; continue; } + if (!strcmp(v[i], "-OFF")) + { on_off_name[on_off_n]=NULL; on_off_action[on_off_n++]=0; continue; } + if (!strcmp(v[i], "-x")) { gui_mode = 1; continue; } + if (!strcmp(v[i], "-debug-gui")) { gui_logd = 1; continue; } + if (!strcmp(v[i], "-no-gui")) { gui_active = 0; continue; } + usage(); + } + + if (gui_active == 0) gui_mode = 0; + + if (database_filename == NULL) { + printf("ERROR: provide a database file (-d)\n"); + exit(1); + } + + database = parse_database(database_filename); + + load_config_file(database_filename); + + number_of_events = number_of_ids(database); + is_on = calloc(number_of_events, sizeof(int)); + if (is_on == NULL) abort(); + + h = new_handler(database); + + if (gui_active) { + g = gui_init(); + new_thread(gui_thread, g); + } + + if (gui_mode) { + widget *w, *win; +// w = new_textlist(g, 600, 20, 0); + w = new_textlist(g, 800, 50, BACKGROUND_COLOR); + win = new_toplevel_window(g, 800, 50*12, "textlog"); + widget_add_child(g, win, w, -1); + out = new_view_textlist(1000, 10, g, w); + //tout = new_view_textlist(7, 4, g, w); + } else { + out = new_view_stdout(); + } + + for (i = 0; i < number_of_events; i++) { + char *name, *desc; + database_get_generic_description(database, i, &name, &desc); + textlog = new_textlog(h, database, name, desc); +// "ENB_UL_CHANNEL_ESTIMATE", +// "ev: {} eNB_id [eNB_ID] frame [frame] subframe [subframe]"); + logger_add_view(textlog, out); + free(name); + free(desc); + } + + for (i = 0; i < on_off_n; i++) + on_off(database, on_off_name[i], is_on, on_off_action[i]); + + textlog_data.socket = -1; + textlog_data.is_on = is_on; + textlog_data.nevents = number_of_events; + if (pthread_mutex_init(&textlog_data.lock, NULL)) abort(); + if (gui_active) + setup_event_selector(g, database, is_on, is_on_changed, &textlog_data); + + textlog_data.socket = connect_to(ip, port); + + /* send the first message - activate selected traces */ + is_on_changed(&textlog_data); + + /* read messages */ + while (1) { + char v[T_BUFFER_MAX]; + event e; + e = get_event(textlog_data.socket, v, database); + if (e.type == -1) abort(); + handle_event(h, e); + } + + return 0; +} diff --git a/common/utils/T/tracer/utils.c b/common/utils/T/tracer/utils.c new file mode 100644 index 0000000000000000000000000000000000000000..3ebc000c671b62799c330775e0804e9ba8279d95 --- /dev/null +++ b/common/utils/T/tracer/utils.c @@ -0,0 +1,198 @@ +#include "utils.h" +#include <stdio.h> +#include <stdlib.h> +#include <pthread.h> +#include <time.h> +#include <unistd.h> +#include <ctype.h> +#include <netinet/in.h> +#include <arpa/inet.h> + +void new_thread(void *(*f)(void *), void *data) +{ + pthread_t t; + pthread_attr_t att; + + if (pthread_attr_init(&att)) + { fprintf(stderr, "pthread_attr_init err\n"); exit(1); } + if (pthread_attr_setdetachstate(&att, PTHREAD_CREATE_DETACHED)) + { fprintf(stderr, "pthread_attr_setdetachstate err\n"); exit(1); } + if (pthread_attr_setstacksize(&att, 10000000)) + { fprintf(stderr, "pthread_attr_setstacksize err\n"); exit(1); } + if (pthread_create(&t, &att, f, data)) + { fprintf(stderr, "pthread_create err\n"); exit(1); } + if (pthread_attr_destroy(&att)) + { fprintf(stderr, "pthread_attr_destroy err\n"); exit(1); } +} + +void sleepms(int ms) +{ + struct timespec t; + + t.tv_sec = ms / 1000; + t.tv_nsec = (ms % 1000) * 1000000L; + + /* TODO: deal with EINTR */ + if (nanosleep(&t, NULL)) abort(); +} + +/****************************************************************************/ +/* list */ +/****************************************************************************/ + +list *list_remove_head(list *l) +{ + list *ret; + if (l == NULL) return NULL; + ret = l->next; + if (ret != NULL) ret->last = l->last; + free(l); + return ret; +} + +list *list_append(list *l, void *data) +{ + list *new = calloc(1, sizeof(list)); + if (new == NULL) abort(); + new->data = data; + if (l == NULL) { + new->last = new; + return new; + } + l->last->next = new; + l->last = new; + return l; +} + +/****************************************************************************/ +/* socket */ +/****************************************************************************/ + +int socket_send(int socket, void *buffer, int size) +{ + char *x = buffer; + int ret; + while (size) { + ret = write(socket, x, size); + if (ret <= 0) return -1; + size -= ret; + x += ret; + } + return 0; +} + +int get_connection(char *addr, int port) +{ + struct sockaddr_in a; + socklen_t alen; + int s, t; + + printf("waiting for connection on %s:%d\n", addr, port); + + s = socket(AF_INET, SOCK_STREAM, 0); + if (s == -1) { perror("socket"); exit(1); } + t = 1; + if (setsockopt(s, SOL_SOCKET, SO_REUSEADDR, &t, sizeof(int))) + { perror("setsockopt"); exit(1); } + + a.sin_family = AF_INET; + a.sin_port = htons(port); + a.sin_addr.s_addr = inet_addr(addr); + + if (bind(s, (struct sockaddr *)&a, sizeof(a))) { perror("bind"); exit(1); } + if (listen(s, 5)) { perror("bind"); exit(1); } + alen = sizeof(a); + t = accept(s, (struct sockaddr *)&a, &alen); + if (t == -1) { perror("accept"); exit(1); } + close(s); + + printf("connected\n"); + + return t; +} + +int fullread(int fd, void *_buf, int count) +{ + char *buf = _buf; + int ret = 0; + int l; + while (count) { + l = read(fd, buf, count); + if (l <= 0) return -1; + count -= l; + buf += l; + ret += l; + } + return ret; +} + +int connect_to(char *addr, int port) +{ + int s; + struct sockaddr_in a; + + printf("connecting to %s:%d\n", addr, port); + +again: + s = socket(AF_INET, SOCK_STREAM, 0); + if (s == -1) { perror("socket"); exit(1); } + + a.sin_family = AF_INET; + a.sin_port = htons(port); + a.sin_addr.s_addr = inet_addr(addr); + + if (connect(s, (struct sockaddr *)&a, sizeof(a)) == -1) { + perror("connect"); + close(s); + printf("trying again in 1s\n"); + sleep(1); + goto again; + } + + return s; +} + +/****************************************************************************/ +/* buffer */ +/****************************************************************************/ + +void PUTC(OBUF *o, char c) +{ + if (o->osize == o->omaxsize) { + o->omaxsize += 512; + o->obuf = realloc(o->obuf, o->omaxsize); + if (o->obuf == NULL) abort(); + } + o->obuf[o->osize] = c; + o->osize++; +} + +void PUTS(OBUF *o, char *s) +{ + while (*s) PUTC(o, *s++); +} + +static int clean(char c) +{ + if (!isprint(c)) c = ' '; + return c; +} + +void PUTS_CLEAN(OBUF *o, char *s) +{ + while (*s) PUTC(o, clean(*s++)); +} + +void PUTI(OBUF *o, int i) +{ + char s[64]; + sprintf(s, "%d", i); + PUTS(o, s); +} + +void PUTUL(OBUF *o, unsigned long l) +{ + char s[128]; + sprintf(s, "%ld", l); + PUTS(o, s); +} diff --git a/common/utils/T/tracer/utils.h b/common/utils/T/tracer/utils.h new file mode 100644 index 0000000000000000000000000000000000000000..e15a8d2fbad5c6e910e3ba3e21c6b0cc219a9952 --- /dev/null +++ b/common/utils/T/tracer/utils.h @@ -0,0 +1,46 @@ +#ifndef _UTILS_H_ +#define _UTILS_H_ + +void new_thread(void *(*f)(void *), void *data); +void sleepms(int ms); + +/****************************************************************************/ +/* list */ +/****************************************************************************/ + +typedef struct list { + struct list *last, *next; + void *data; +} list; + +list *list_remove_head(list *l); +list *list_append(list *l, void *data); + +/****************************************************************************/ +/* socket */ +/****************************************************************************/ + +/* socket_send: return 0 if okay, -1 on error */ +int socket_send(int socket, void *buffer, int size); +int get_connection(char *addr, int port); +/* fullread: return length read if okay (that is: 'count'), -1 on error */ +int fullread(int fd, void *_buf, int count); +int connect_to(char *addr, int port); + +/****************************************************************************/ +/* buffer */ +/****************************************************************************/ + +typedef struct { + int osize; + int omaxsize; + char *obuf; +} OBUF; + +void PUTC(OBUF *o, char c); +void PUTS(OBUF *o, char *s); +void PUTS_CLEAN(OBUF *o, char *s); +void PUTI(OBUF *o, int i); +void PUTUL(OBUF *o, unsigned long i); + +#endif /* _UTILS_H_ */ diff --git a/common/utils/T/tracer/vcd.c b/common/utils/T/tracer/vcd.c new file mode 100644 index 0000000000000000000000000000000000000000..45aa4e26e2ae332586a143c1ebf680fcd34c9d1d --- /dev/null +++ b/common/utils/T/tracer/vcd.c @@ -0,0 +1,204 @@ +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <pthread.h> +#include <signal.h> +#include "database.h" +#include "event.h" +#include "handler.h" +#include "logger/logger.h" +#include "view/view.h" +#include "gui/gui.h" +#include "utils.h" +#include "../T_defs.h" +#include "event_selector.h" +#include "config.h" + +typedef struct { + int socket; + int *is_on; + int nevents; + pthread_mutex_t lock; +} vcd_data; + +void is_on_changed(void *_d) +{ + vcd_data *d = _d; + char t; + + if (pthread_mutex_lock(&d->lock)) abort(); + + if (d->socket == -1) goto no_connection; + + t = 1; + if (socket_send(d->socket, &t, 1) == -1 || + socket_send(d->socket, &d->nevents, sizeof(int)) == -1 || + socket_send(d->socket, d->is_on, d->nevents * sizeof(int)) == -1) + abort(); + +no_connection: + if (pthread_mutex_unlock(&d->lock)) abort(); +} + +#define DEFAULT_REMOTE_IP "127.0.0.1" +#define DEFAULT_REMOTE_PORT 2021 + +void usage(void) +{ + printf( +"options:\n" +" -d <database file> this option is mandatory\n" +" -on <GROUP or ID> turn log ON for given GROUP or ID\n" +" -off <GROUP or ID> turn log OFF for given GROUP or ID\n" +" -ON turn all logs ON\n" +" -OFF turn all logs OFF\n" +" note: you may pass several -on/-off/-ON/-OFF,\n" +" they will be processed in order\n" +" by default, all is off\n" +" -ip <host> connect to given IP address (default %s)\n" +" -p <port> connect to given port (default %d)\n" +" -debug-gui activate GUI debug logs\n", + DEFAULT_REMOTE_IP, + DEFAULT_REMOTE_PORT + ); + exit(1); +} + +static void *gui_thread(void *_g) +{ + gui *g = _g; + gui_loop(g); + return NULL; +} + +static void vcd_main_gui(gui *g, event_handler *h, void *database) +{ + int i, j; + int n; + int nb_functions = 0; + char **ids; + widget *win; + widget *container; + widget *w; + view *timeview; + view *subview; + logger *timelog; + + /* get number of vcd functions - look for all events VCD_FUNCTION_xxx */ + n = database_get_ids(database, &ids); + for (i = 0; i < n; i++) { + if (strncmp(ids[i], "VCD_FUNCTION_", 13) != 0) continue; + nb_functions++; + } + + win = new_toplevel_window(g, 1000, 5 * nb_functions, "VCD tracer"); + container = new_container(g, VERTICAL); + widget_add_child(g, win, container, -1); + + w = new_timeline(g, 1000, nb_functions, 5); + widget_add_child(g, container, w, -1); + for (i = 0; i < nb_functions; i++) + timeline_set_subline_background_color(g, w, i, + new_color(g, i & 1 ? "#ddd" : "#eee")); + timeview = new_view_time(3600, 10, g, w); + i = 0; + for (j = 0; j < n; j++) { + if (strncmp(ids[j], "VCD_FUNCTION_", 13) != 0) continue; + timelog = new_timelog(h, database, ids[j]); + subview = new_subview_time(timeview, i, FOREGROUND_COLOR, 3600*1000); + logger_add_view(timelog, subview); + i++; + } + + free(ids); +} + +int main(int n, char **v) +{ + extern int volatile gui_logd; + char *database_filename = NULL; + void *database; + char *ip = DEFAULT_REMOTE_IP; + int port = DEFAULT_REMOTE_PORT; + char **on_off_name; + int *on_off_action; + int on_off_n = 0; + int *is_on; + int number_of_events; + int i; + event_handler *h; + gui *g; + vcd_data vcd_data; + + /* write on a socket fails if the other end is closed and we get SIGPIPE */ + if (signal(SIGPIPE, SIG_IGN) == SIG_ERR) abort(); + + on_off_name = malloc(n * sizeof(char *)); if (on_off_name == NULL) abort(); + on_off_action = malloc(n * sizeof(int)); if (on_off_action == NULL) abort(); + + for (i = 1; i < n; i++) { + if (!strcmp(v[i], "-h") || !strcmp(v[i], "--help")) usage(); + if (!strcmp(v[i], "-d")) + { if (i > n-2) usage(); database_filename = v[++i]; continue; } + if (!strcmp(v[i], "-ip")) { if (i > n-2) usage(); ip = v[++i]; continue; } + if (!strcmp(v[i], "-p")) + { if (i > n-2) usage(); port = atoi(v[++i]); continue; } + if (!strcmp(v[i], "-on")) { if (i > n-2) usage(); + on_off_name[on_off_n]=v[++i]; on_off_action[on_off_n++]=1; continue; } + if (!strcmp(v[i], "-off")) { if (i > n-2) usage(); + on_off_name[on_off_n]=v[++i]; on_off_action[on_off_n++]=0; continue; } + if (!strcmp(v[i], "-ON")) + { on_off_name[on_off_n]=NULL; on_off_action[on_off_n++]=1; continue; } + if (!strcmp(v[i], "-OFF")) + { on_off_name[on_off_n]=NULL; on_off_action[on_off_n++]=0; continue; } + if (!strcmp(v[i], "-debug-gui")) { gui_logd = 1; continue; } + usage(); + } + + if (database_filename == NULL) { + printf("ERROR: provide a database file (-d)\n"); + exit(1); + } + + database = parse_database(database_filename); + + load_config_file(database_filename); + + number_of_events = number_of_ids(database); + is_on = calloc(number_of_events, sizeof(int)); + if (is_on == NULL) abort(); + + h = new_handler(database); + + g = gui_init(); + new_thread(gui_thread, g); + + vcd_main_gui(g, h, database); + + on_off(database, "VCD_FUNCTION", is_on, 1); + + for (i = 0; i < on_off_n; i++) + on_off(database, on_off_name[i], is_on, on_off_action[i]); + + vcd_data.socket = -1; + vcd_data.is_on = is_on; + vcd_data.nevents = number_of_events; + if (pthread_mutex_init(&vcd_data.lock, NULL)) abort(); + setup_event_selector(g, database, is_on, is_on_changed, &vcd_data); + + vcd_data.socket = connect_to(ip, port); + + /* send the first message - activate selected traces */ + is_on_changed(&vcd_data); + + /* read messages */ + while (1) { + char v[T_BUFFER_MAX]; + event e; + e = get_event(vcd_data.socket, v, database); + if (e.type == -1) abort(); + handle_event(h, e); + } + + return 0; +} diff --git a/common/utils/T/tracer/view/Makefile b/common/utils/T/tracer/view/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..32b267ec24d60c25bf1650e5b60250579c6be871 --- /dev/null +++ b/common/utils/T/tracer/view/Makefile @@ -0,0 +1,13 @@ +CC=gcc +CFLAGS=-Wall -g -pthread -I.. -I../logger + +OBJS=stdout.o textlist.o xy.o tti.o time.o ticktime.o + +view.a: $(OBJS) + ar cr view.a $(OBJS) + +%.o: %.c + $(CC) $(CFLAGS) -o $@ -c $< + +clean: + rm -f *.a *.o diff --git a/common/utils/T/tracer/view/stdout.c b/common/utils/T/tracer/view/stdout.c new file mode 100644 index 0000000000000000000000000000000000000000..93223e59d81d2591a9a317f75c84cd7f57b32d33 --- /dev/null +++ b/common/utils/T/tracer/view/stdout.c @@ -0,0 +1,35 @@ +#include "view.h" +#include <stdlib.h> +#include <stdio.h> +#include <pthread.h> + +struct stdout { + view common; + pthread_mutex_t lock; +}; + +static void clear(view *this) +{ + /* do nothing */ +} + +static void append(view *_this, char *s) +{ + struct stdout *this = (struct stdout *)_this; + if (pthread_mutex_lock(&this->lock)) abort(); + printf("%s\n", s); + if (pthread_mutex_unlock(&this->lock)) abort(); +} + +view *new_view_stdout(void) +{ + struct stdout *ret = calloc(1, sizeof(struct stdout)); + if (ret == NULL) abort(); + + ret->common.clear = clear; + ret->common.append = (void (*)(view *, ...))append; + + if (pthread_mutex_init(&ret->lock, NULL)) abort(); + + return (view *)ret; +} diff --git a/common/utils/T/tracer/view/textlist.c b/common/utils/T/tracer/view/textlist.c new file mode 100644 index 0000000000000000000000000000000000000000..5227900e4ef36d241b8fd62c2233d0d7ba9a2620 --- /dev/null +++ b/common/utils/T/tracer/view/textlist.c @@ -0,0 +1,154 @@ +#include "view.h" +#include "../utils.h" +#include "gui/gui.h" +#include <stdlib.h> +#include <pthread.h> +#include <string.h> + +struct textlist { + view common; + gui *g; + widget *w; + int maxsize; + int cursize; + float refresh_rate; + int autoscroll; + pthread_mutex_t lock; + list * volatile to_append; +}; + +static void _append(struct textlist *this, char *s, int *deleted) +{ + if (this->cursize == this->maxsize) { + textlist_del_silent(this->g, this->w, 0); + this->cursize--; + (*deleted)++; + } + textlist_add_silent(this->g, this->w, s, -1, FOREGROUND_COLOR); + this->cursize++; +} + +static void *textlist_thread(void *_this) +{ + struct textlist *this = _this; + int dirty; + int deleted; + int visible_lines, start_line, number_of_lines; + + while (1) { + if (pthread_mutex_lock(&this->lock)) abort(); + dirty = this->to_append == NULL ? 0 : 1; + deleted = 0; + while (this->to_append != NULL) { + char *s = this->to_append->data; + this->to_append = list_remove_head(this->to_append); + _append(this, s, &deleted); + free(s); + } + if (dirty) { + textlist_state(this->g, this->w, &visible_lines, &start_line, + &number_of_lines); + if (this->autoscroll) + start_line = number_of_lines - visible_lines; + else + start_line -= deleted; + if (start_line < 0) start_line = 0; + textlist_set_start_line(this->g, this->w, start_line); + /* this call is not necessary, but if things change in textlist... */ + widget_dirty(this->g, this->w); + } + if (pthread_mutex_unlock(&this->lock)) abort(); + sleepms(1000/this->refresh_rate); + } + + return 0; +} + +static void clear(view *this) +{ + /* TODO */ +} + +static void append(view *_this, char *s) +{ + struct textlist *this = (struct textlist *)_this; + char *dup; + + if (pthread_mutex_lock(&this->lock)) abort(); + dup = strdup(s); if (dup == NULL) abort(); + this->to_append = list_append(this->to_append, dup); + if (pthread_mutex_unlock(&this->lock)) abort(); +} + +static void scroll(void *private, gui *g, + char *notification, widget *w, void *notification_data) +{ + struct textlist *this = private; + int visible_lines; + int start_line; + int number_of_lines; + int new_line; + int inc; + + if (pthread_mutex_lock(&this->lock)) abort(); + + textlist_state(g, w, &visible_lines, &start_line, &number_of_lines); + inc = 10; + if (inc > visible_lines - 2) inc = visible_lines - 2; + if (inc < 1) inc = 1; + if (!strcmp(notification, "scrollup")) inc = -inc; + + new_line = start_line + inc; + if (new_line > number_of_lines - visible_lines) + new_line = number_of_lines - visible_lines; + if (new_line < 0) new_line = 0; + + textlist_set_start_line(g, w, new_line); + + if (new_line + visible_lines < number_of_lines) + this->autoscroll = 0; + else + this->autoscroll = 1; + + if (pthread_mutex_unlock(&this->lock)) abort(); +} + +static void click(void *private, gui *g, + char *notification, widget *w, void *notification_data) +{ + struct textlist *this = private; + int *d = notification_data; + int button = d[1]; + + if (pthread_mutex_lock(&this->lock)) abort(); + + if (button == 1) this->autoscroll = 1 - this->autoscroll; + + if (pthread_mutex_unlock(&this->lock)) abort(); +} + +view *new_view_textlist(int maxsize, float refresh_rate, gui *g, widget *w) +{ + struct textlist *ret = calloc(1, sizeof(struct textlist)); + if (ret == NULL) abort(); + + ret->common.clear = clear; + ret->common.append = (void (*)(view *, ...))append; + + ret->cursize = 0; + ret->maxsize = maxsize; + ret->refresh_rate = refresh_rate; + ret->g = g; + ret->w = w; + ret->autoscroll = 1; + + if (pthread_mutex_init(&ret->lock, NULL)) abort(); + + register_notifier(g, "scrollup", w, scroll, ret); + register_notifier(g, "scrolldown", w, scroll, ret); + register_notifier(g, "click", w, click, ret); + + new_thread(textlist_thread, ret); + + return (view *)ret; +} diff --git a/common/utils/T/tracer/view/ticktime.c b/common/utils/T/tracer/view/ticktime.c new file mode 100644 index 0000000000000000000000000000000000000000..1e1c7352a07a1acafe1f57681e8925a099fcd6ef --- /dev/null +++ b/common/utils/T/tracer/view/ticktime.c @@ -0,0 +1,411 @@ +#include "view.h" +#include "../utils.h" +#include "logger.h" +#include <stdio.h> +#include <stdlib.h> +#include <pthread.h> +#include <string.h> + +/* TODO: some code is identical/almost identical to time.c, merge/factorize */ + +/****************************************************************************/ +/* tick timeview */ +/****************************************************************************/ + +struct plot { + struct timespec *tick; + int ticksize; + int tickmaxsize; + int tickstart; + int line; + int color; +}; + +struct ticktime { + view common; + gui *g; + widget *w; + float refresh_rate; + pthread_mutex_t lock; + struct plot *p; + int psize; + double pixel_length; /* unit: nanosecond (maximum 1 hour/pixel) */ + struct timespec latest_time; + struct timespec start_time; + int autoscroll; + struct timespec tick_latest_time; + int tick_latest_frame; + int tick_latest_subframe; + void *clock_ticktime; /* data for the clock tick, see below */ +}; + +/* TODO: put that function somewhere else (utils.c) */ +static struct timespec time_add(struct timespec a, struct timespec b) +{ + struct timespec ret; + ret.tv_sec = a.tv_sec + b.tv_sec; + ret.tv_nsec = a.tv_nsec + b.tv_nsec; + if (ret.tv_nsec > 1000000000) { + ret.tv_sec++; + ret.tv_nsec -= 1000000000; + } + return ret; +} + +/* TODO: put that function somewhere else (utils.c) */ +static struct timespec time_sub(struct timespec a, struct timespec b) +{ + struct timespec ret; + if (a.tv_nsec < b.tv_nsec) { + ret.tv_nsec = (int64_t)a.tv_nsec - (int64_t)b.tv_nsec + 1000000000; + ret.tv_sec = a.tv_sec - b.tv_sec - 1; + } else { + ret.tv_nsec = a.tv_nsec - b.tv_nsec; + ret.tv_sec = a.tv_sec - b.tv_sec; + } + return ret; +} + +/* TODO: put that function somewhere else (utils.c) */ +static struct timespec nano_to_time(int64_t n) +{ + struct timespec ret; + ret.tv_sec = n / 1000000000; + ret.tv_nsec = n % 1000000000; + return ret; +} + +/* TODO: put that function somewhere else (utils.c) */ +static int time_cmp(struct timespec a, struct timespec b) +{ + if (a.tv_sec < b.tv_sec) return -1; + if (a.tv_sec > b.tv_sec) return 1; + if (a.tv_nsec < b.tv_nsec) return -1; + if (a.tv_nsec > b.tv_nsec) return 1; + return 0; +} + +static int interval_empty(struct ticktime *this, int sub, + struct timespec start, struct timespec end) +{ + int a, b, mid; + int i; + + if (this->p[sub].ticksize == 0) return 1; + + /* look for a tick larger than start and smaller than end */ + a = 0; + b = this->p[sub].ticksize - 1; + while (b >= a) { + mid = (a+b) / 2; + i = (this->p[sub].tickstart + mid) % this->p[sub].ticksize; + if (time_cmp(this->p[sub].tick[i], start) < 0) a = mid + 1; + else if (time_cmp(this->p[sub].tick[i], end) > 0) b = mid - 1; + else return 0; + } + return 1; +} + +static void *ticktime_thread(void *_this) +{ + struct ticktime *this = _this; + int width; + int l; + int i; + struct timespec tstart; + struct timespec tnext; + struct plot *p; + int64_t pixel_length; + + while (1) { + if (pthread_mutex_lock(&this->lock)) abort(); + + timeline_get_width(this->g, this->w, &width); + timeline_clear_silent(this->g, this->w); + + /* TODO: optimize? */ + + /* use rounded pixel_length */ + pixel_length = this->pixel_length; + + if (this->autoscroll) { + tnext = time_add(this->latest_time, + (struct timespec){tv_sec:0,tv_nsec:1}); + tstart = time_sub(tnext, nano_to_time(pixel_length * width)); + this->start_time = tstart; + } else { + tstart = this->start_time; + tnext = time_add(tstart, nano_to_time(pixel_length * width)); + } + + for (l = 0; l < this->psize; l++) { + for (i = 0; i < width; i++) { + struct timespec tick_start, tick_end; + tick_start = time_add(tstart, nano_to_time(pixel_length * i)); + tick_end = time_add(tick_start, nano_to_time(pixel_length-1)); + if (interval_empty(this, l, tick_start, tick_end)) + continue; + p = &this->p[l]; + /* TODO: only one call */ + int x[3] = {i==0?i:i-1, i, i==width-1?i:i+1}; + timeline_add_points_silent(this->g, this->w, p->line, p->color, x, 3); + } + } + + widget_dirty(this->g, this->w); + + if (pthread_mutex_unlock(&this->lock)) abort(); + sleepms(1000 / this->refresh_rate); + } + + return 0; +} + +static void scroll(void *private, gui *g, + char *notification, widget *w, void *notification_data) +{ + struct ticktime *this = private; + int *d = notification_data; + int x = d[0]; + int key_modifiers = d[2]; + double mul = 1.2; + double pixel_length; + int64_t old_px_len_rounded; + struct timespec t; + int scroll_px; + int width; + + if (pthread_mutex_lock(&this->lock)) abort(); + + old_px_len_rounded = this->pixel_length; + + /* scroll if control+wheel, zoom otherwise */ + + if (key_modifiers & KEY_CONTROL) { + timeline_get_width(this->g, this->w, &width); + if (width < 2) width = 2; + scroll_px = 100; + if (scroll_px > width - 1) scroll_px = width - 1; + if (!strcmp(notification, "scrolldown")) + this->start_time = time_add(this->start_time, + nano_to_time(scroll_px * old_px_len_rounded)); + else + this->start_time = time_sub(this->start_time, + nano_to_time(scroll_px * old_px_len_rounded)); + goto end; + } + + if (!strcmp(notification, "scrollup")) mul = 1 / mul; + +again: + pixel_length = this->pixel_length * mul; + if (pixel_length < 1) pixel_length = 1; + if (pixel_length > (double)3600 * 1000000000) + pixel_length = (double)3600 * 1000000000; + + this->pixel_length = pixel_length; + + /* due to rounding, we may need to zoom by more than 1.2 with + * very close lookup, otherwise the user zooming command won't + * be visible (say length is 2.7, zoom in, new length is 2.25, + * and rounding is 2, same value, no change, no feedback to user => bad) + * TODO: make all this cleaner + */ + if (pixel_length != 1 && pixel_length != (double)3600 * 1000000000 && + (int64_t)pixel_length == old_px_len_rounded) + goto again; + + t = time_add(this->start_time, nano_to_time(x * old_px_len_rounded)); + this->start_time = time_sub(t, nano_to_time(x * (int64_t)pixel_length)); + +end: + if (pthread_mutex_unlock(&this->lock)) abort(); +} + +static void click(void *private, gui *g, + char *notification, widget *w, void *notification_data) +{ + struct ticktime *this = private; + int *d = notification_data; + int button = *d; + + if (button == 3) this->autoscroll = 0; + if (button == 1) this->autoscroll = 1; +} + +view *new_view_ticktime(float refresh_rate, gui *g, widget *w) +{ + struct ticktime *ret = calloc(1, sizeof(struct ticktime)); + if (ret == NULL) abort(); + + ret->refresh_rate = refresh_rate; + ret->g = g; + ret->w = w; + + ret->p = NULL; + ret->psize = 0; + + ret->autoscroll = 1; + + ret->tick_latest_time.tv_sec = 1; + + /* default pixel length: 10ms */ + ret->pixel_length = 10 * 1000000; + + register_notifier(g, "scrollup", w, scroll, ret); + register_notifier(g, "scrolldown", w, scroll, ret); + register_notifier(g, "click", w, click, ret); + + if (pthread_mutex_init(&ret->lock, NULL)) abort(); + + new_thread(ticktime_thread, ret); + + return (view *)ret; +} + +/****************************************************************************/ +/* subticktimeview */ +/****************************************************************************/ + +struct subticktime { + view common; + struct ticktime *parent; + int line; + int color; + int subview; +}; + +static void append(view *_this, struct timespec t, int frame, int subframe) +{ + struct subticktime *this = (struct subticktime *)_this; + struct ticktime *ticktime = this->parent; + struct plot *p = &ticktime->p[this->subview]; + int i; + struct timespec swap; + int64_t diff; + + if (pthread_mutex_lock(&ticktime->lock)) abort(); + + /* get time with respect to latest known tick time */ + diff = (frame*10 + subframe) - + (ticktime->tick_latest_frame*10 + ticktime->tick_latest_subframe); + if (diff > 1024*10/2) diff -= 1024*10; + else if (diff < -1024*10/2) diff += 1024*10; + if (diff < 0) + t = time_sub(ticktime->tick_latest_time, nano_to_time(-diff * 1000000)); + else + t = time_add(ticktime->tick_latest_time, nano_to_time(diff * 1000000)); + + if (p->ticksize < p->tickmaxsize) { + p->tick[p->ticksize] = t; + p->ticksize++; + } else { + p->tick[p->tickstart] = t; + p->tickstart = (p->tickstart + 1) % p->ticksize; + } + + /* due to adjustment of the time, array may not be ordered anymore */ + for (i = p->ticksize-2; i >= 0; i--) { + int prev = (p->tickstart + i) % p->ticksize; + int cur = (prev + 1) % p->ticksize; + if (time_cmp(p->tick[prev], p->tick[cur]) <= 0) break; + swap = p->tick[prev]; + p->tick[prev] = p->tick[cur]; + p->tick[cur] = swap; + } + + if (time_cmp(ticktime->latest_time, t) < 0) + ticktime->latest_time = t; + + if (pthread_mutex_unlock(&ticktime->lock)) abort(); +} + +view *new_subview_ticktime(view *_time, int line, int color, int size) +{ + struct ticktime *ticktime = (struct ticktime *)_time; + struct subticktime *ret = calloc(1, sizeof(struct subticktime)); + if (ret == NULL) abort(); + + ret->common.append = (void (*)(view *, ...))append; + + if (pthread_mutex_lock(&ticktime->lock)) abort(); + + ret->parent = ticktime; + ret->line = line; + ret->color = color; + ret->subview = ticktime->psize; + + ticktime->p = realloc(ticktime->p, + (ticktime->psize + 1) * sizeof(struct plot)); + if (ticktime->p == NULL) abort(); + ticktime->p[ticktime->psize].tick = calloc(size, sizeof(struct timespec)); + if (ticktime->p[ticktime->psize].tick == NULL) abort(); + ticktime->p[ticktime->psize].ticksize = 0; + ticktime->p[ticktime->psize].tickmaxsize = size; + ticktime->p[ticktime->psize].tickstart = 0; + ticktime->p[ticktime->psize].line = line; + ticktime->p[ticktime->psize].color = color; + + ticktime->psize++; + + if (pthread_mutex_unlock(&ticktime->lock)) abort(); + + return (view *)ret; +} + +/****************************************************************************/ +/* clock tick */ +/****************************************************************************/ + +struct clock_ticktime { + view common; + struct ticktime *parent; +}; + +static void clock_append(view *_this, struct timespec t, + int frame, int subframe) +{ + struct clock_ticktime *this = (struct clock_ticktime *)_this; + struct ticktime *tt = this->parent; + int64_t diff; + + if (subframe == 10) { subframe = 0; frame = (frame + 1) % 1024; } + + if (pthread_mutex_lock(&tt->lock)) abort(); + + /* get time relative to latest known tick time */ + /* In normal conditions diff is 1 but if the user pauses reception of events + * it may be anything. Let's take only positive values. + */ + diff = (frame*10 + subframe) - + (tt->tick_latest_frame*10 + tt->tick_latest_subframe); + if (diff < 0) diff += 1024*10; + tt->tick_latest_time = time_add(tt->tick_latest_time, + nano_to_time(diff * 1000000)); + tt->tick_latest_frame = frame; + tt->tick_latest_subframe = subframe; + + if (time_cmp(tt->latest_time, tt->tick_latest_time) < 0) + tt->latest_time = tt->tick_latest_time; + + if (pthread_mutex_unlock(&tt->lock)) abort(); +} + +void ticktime_set_tick(view *_ticktime, void *logger) +{ + struct ticktime *ticktime = (struct ticktime *)_ticktime; + struct clock_ticktime *n; + + if (pthread_mutex_lock(&ticktime->lock)) abort(); + + free(ticktime->clock_ticktime); + n = ticktime->clock_ticktime = calloc(1, sizeof(struct clock_ticktime)); + if (n == NULL) abort(); + + n->common.append = (void (*)(view *, ...))clock_append; + n->parent = ticktime; + + logger_add_view(logger, (view *)n); + + if (pthread_mutex_unlock(&ticktime->lock)) abort(); +} diff --git a/common/utils/T/tracer/view/time.c b/common/utils/T/tracer/view/time.c new file mode 100644 index 0000000000000000000000000000000000000000..287e7b1c7be029af0a815febb271938d888857a4 --- /dev/null +++ b/common/utils/T/tracer/view/time.c @@ -0,0 +1,322 @@ +#include "view.h" +#include "../utils.h" +#include <stdio.h> +#include <stdlib.h> +#include <pthread.h> +#include <string.h> + +/****************************************************************************/ +/* timeview */ +/****************************************************************************/ + +struct plot { + struct timespec *tick; + int ticksize; + int tickmaxsize; + int tickstart; + int line; + int color; +}; + +struct time { + view common; + gui *g; + widget *w; + float refresh_rate; + pthread_mutex_t lock; + struct plot *p; + int psize; + double pixel_length; /* unit: nanosecond (maximum 1 hour/pixel) */ + struct timespec latest_time; + struct timespec start_time; + int autoscroll; +}; + +/* TODO: put that function somewhere else (utils.c) */ +static struct timespec time_add(struct timespec a, struct timespec b) +{ + struct timespec ret; + ret.tv_sec = a.tv_sec + b.tv_sec; + ret.tv_nsec = a.tv_nsec + b.tv_nsec; + if (ret.tv_nsec > 1000000000) { + ret.tv_sec++; + ret.tv_nsec -= 1000000000; + } + return ret; +} + +/* TODO: put that function somewhere else (utils.c) */ +static struct timespec time_sub(struct timespec a, struct timespec b) +{ + struct timespec ret; + if (a.tv_nsec < b.tv_nsec) { + ret.tv_nsec = (int64_t)a.tv_nsec - (int64_t)b.tv_nsec + 1000000000; + ret.tv_sec = a.tv_sec - b.tv_sec - 1; + } else { + ret.tv_nsec = a.tv_nsec - b.tv_nsec; + ret.tv_sec = a.tv_sec - b.tv_sec; + } + return ret; +} + +/* TODO: put that function somewhere else (utils.c) */ +static struct timespec nano_to_time(int64_t n) +{ + struct timespec ret; + ret.tv_sec = n / 1000000000; + ret.tv_nsec = n % 1000000000; + return ret; +} + +/* TODO: put that function somewhere else (utils.c) */ +static int time_cmp(struct timespec a, struct timespec b) +{ + if (a.tv_sec < b.tv_sec) return -1; + if (a.tv_sec > b.tv_sec) return 1; + if (a.tv_nsec < b.tv_nsec) return -1; + if (a.tv_nsec > b.tv_nsec) return 1; + return 0; +} + +static int interval_empty(struct time *this, int sub, + struct timespec start, struct timespec end) +{ + int a, b, mid; + int i; + + if (this->p[sub].ticksize == 0) return 1; + + /* look for a tick larger than start and smaller than end */ + a = 0; + b = this->p[sub].ticksize - 1; + while (b >= a) { + mid = (a+b) / 2; + i = (this->p[sub].tickstart + mid) % this->p[sub].ticksize; + if (time_cmp(this->p[sub].tick[i], start) < 0) a = mid + 1; + else if (time_cmp(this->p[sub].tick[i], end) > 0) b = mid - 1; + else return 0; + } + return 1; +} + +static void *time_thread(void *_this) +{ + struct time *this = _this; + int width; + int l; + int i; + struct timespec tstart; + struct timespec tnext; + struct plot *p; + int64_t pixel_length; + + while (1) { + if (pthread_mutex_lock(&this->lock)) abort(); + + timeline_get_width(this->g, this->w, &width); + timeline_clear_silent(this->g, this->w); + + /* TODO: optimize? */ + + /* use rounded pixel_length */ + pixel_length = this->pixel_length; + + if (this->autoscroll) { + tnext = time_add(this->latest_time, + (struct timespec){tv_sec:0,tv_nsec:1}); + tstart = time_sub(tnext, nano_to_time(pixel_length * width)); + this->start_time = tstart; + } else { + tstart = this->start_time; + tnext = time_add(tstart, nano_to_time(pixel_length * width)); + } + + for (l = 0; l < this->psize; l++) { + for (i = 0; i < width; i++) { + struct timespec tick_start, tick_end; + tick_start = time_add(tstart, nano_to_time(pixel_length * i)); + tick_end = time_add(tick_start, nano_to_time(pixel_length-1)); + if (interval_empty(this, l, tick_start, tick_end)) + continue; + p = &this->p[l]; + /* TODO: only one call */ + timeline_add_points_silent(this->g, this->w, p->line, p->color, &i, 1); + } + } + + widget_dirty(this->g, this->w); + + if (pthread_mutex_unlock(&this->lock)) abort(); + sleepms(1000 / this->refresh_rate); + } + + return 0; +} + +static void scroll(void *private, gui *g, + char *notification, widget *w, void *notification_data) +{ + struct time *this = private; + int *d = notification_data; + int x = d[0]; + int key_modifiers = d[2]; + double mul = 1.2; + double pixel_length; + int64_t old_px_len_rounded; + struct timespec t; + int scroll_px; + int width; + + if (pthread_mutex_lock(&this->lock)) abort(); + + old_px_len_rounded = this->pixel_length; + + /* scroll if control+wheel, zoom otherwise */ + + if (key_modifiers & KEY_CONTROL) { + timeline_get_width(this->g, this->w, &width); + if (width < 2) width = 2; + scroll_px = 100; + if (scroll_px > width - 1) scroll_px = width - 1; + if (!strcmp(notification, "scrolldown")) + this->start_time = time_add(this->start_time, + nano_to_time(scroll_px * old_px_len_rounded)); + else + this->start_time = time_sub(this->start_time, + nano_to_time(scroll_px * old_px_len_rounded)); + goto end; + } + + if (!strcmp(notification, "scrollup")) mul = 1 / mul; + +again: + pixel_length = this->pixel_length * mul; + if (pixel_length < 1) pixel_length = 1; + if (pixel_length > (double)3600 * 1000000000) + pixel_length = (double)3600 * 1000000000; + + this->pixel_length = pixel_length; + + /* due to rounding, we may need to zoom by more than 1.2 with + * very close lookup, otherwise the user zooming command won't + * be visible (say length is 2.7, zoom in, new length is 2.25, + * and rounding is 2, same value, no change, no feedback to user => bad) + * TODO: make all this cleaner + */ + if (pixel_length != 1 && pixel_length != (double)3600 * 1000000000 && + (int64_t)pixel_length == old_px_len_rounded) + goto again; + + t = time_add(this->start_time, nano_to_time(x * old_px_len_rounded)); + this->start_time = time_sub(t, nano_to_time(x * (int64_t)pixel_length)); + +end: + if (pthread_mutex_unlock(&this->lock)) abort(); +} + +static void click(void *private, gui *g, + char *notification, widget *w, void *notification_data) +{ + struct time *this = private; + int *d = notification_data; + int button = *d; + + if (button == 3) this->autoscroll = 0; + if (button == 1) this->autoscroll = 1; +} + +view *new_view_time(int number_of_seconds, float refresh_rate, + gui *g, widget *w) +{ + struct time *ret = calloc(1, sizeof(struct time)); + if (ret == NULL) abort(); + + ret->refresh_rate = refresh_rate; + ret->g = g; + ret->w = w; + + ret->p = NULL; + ret->psize = 0; + + ret->autoscroll = 1; + + /* default pixel length: 10ms */ + ret->pixel_length = 10 * 1000000; + + register_notifier(g, "scrollup", w, scroll, ret); + register_notifier(g, "scrolldown", w, scroll, ret); + register_notifier(g, "click", w, click, ret); + + if (pthread_mutex_init(&ret->lock, NULL)) abort(); + + new_thread(time_thread, ret); + + return (view *)ret; +} + +/****************************************************************************/ +/* subtimeview */ +/****************************************************************************/ + +struct subtime { + view common; + struct time *parent; + int line; + int color; + int subview; +}; + +static void append(view *_this, struct timespec t) +{ + struct subtime *this = (struct subtime *)_this; + struct time *time = this->parent; + struct plot *p = &time->p[this->subview]; + + if (pthread_mutex_lock(&time->lock)) abort(); + + if (p->ticksize < p->tickmaxsize) { + p->tick[p->ticksize] = t; + p->ticksize++; + } else { + p->tick[p->tickstart] = t; + p->tickstart = (p->tickstart + 1) % p->ticksize; + } + + if (time_cmp(time->latest_time, t) < 0) + time->latest_time = t; + + if (pthread_mutex_unlock(&time->lock)) abort(); +} + +view *new_subview_time(view *_time, int line, int color, int size) +{ + struct time *time = (struct time *)_time; + struct subtime *ret = calloc(1, sizeof(struct subtime)); + if (ret == NULL) abort(); + + ret->common.append = (void (*)(view *, ...))append; + + if (pthread_mutex_lock(&time->lock)) abort(); + + ret->parent = time; + ret->line = line; + ret->color = color; + ret->subview = time->psize; + + time->p = realloc(time->p, + (time->psize + 1) * sizeof(struct plot)); + if (time->p == NULL) abort(); + time->p[time->psize].tick = calloc(size, sizeof(struct timespec)); + if (time->p[time->psize].tick == NULL) abort(); + time->p[time->psize].ticksize = 0; + time->p[time->psize].tickmaxsize = size; + time->p[time->psize].tickstart = 0; + time->p[time->psize].line = line; + time->p[time->psize].color = color; + + time->psize++; + + if (pthread_mutex_unlock(&time->lock)) abort(); + + return (view *)ret; +} diff --git a/common/utils/T/tracer/view/tti.c b/common/utils/T/tracer/view/tti.c new file mode 100644 index 0000000000000000000000000000000000000000..ebf9fc657cb5f1cf581d93dcb7553254e9dfbf66 --- /dev/null +++ b/common/utils/T/tracer/view/tti.c @@ -0,0 +1,121 @@ +#include "view.h" +#include "../utils.h" +#include <stdio.h> +#include <stdlib.h> +#include <pthread.h> +#include <stdarg.h> +#include <string.h> + +struct tti { + view common; + gui *g; + widget *w; + int plot; + float refresh_rate; + pthread_mutex_t lock; + float data[1024*10]; + int valid[1024*10]; + float xout[1024*10]; + float yout[1024*10]; + int last_insert_point; +}; + +static int far_enough(int i, int last_insert, int plot_width) +{ + int p1; + int p2; + int hole_size_px; + int hole_size_tti; + hole_size_px = 10; + hole_size_tti = 10240 * hole_size_px / plot_width; + p1 = last_insert; + p2 = (last_insert + hole_size_tti) % (1024*10); + if (p1 < p2) { + return !(i > p1 && i < p2); + } + return i > p2 && i <= p1; +} + +static void *tti_thread(void *_this) +{ + struct tti *this = _this; + int i; + int length; + int plot_width; + int plot_height; + + while (1) { + if (pthread_mutex_lock(&this->lock)) abort(); + xy_plot_get_dimensions(this->g, this->w, &plot_width, &plot_height); + length = 0; + /* TODO: optimize */ + for (i = 0; i < 1024*10; i++) + /* do not take points too close after last insertion point */ + if (this->valid[i] && + far_enough(i, this->last_insert_point, plot_width)) { + this->xout[length] = i; + this->yout[length] = this->data[i]; + length++; + } + xy_plot_set_points(this->g, this->w, this->plot, + length, this->xout, this->yout); + if (pthread_mutex_unlock(&this->lock)) abort(); + sleepms(1000/this->refresh_rate); + } + + return 0; +} + +static void clear(view *this) +{ + /* TODO */ +} + +static void append(view *_this, int frame, int subframe, double value) +{ + struct tti *this = (struct tti *)_this; + int i; + int index = frame * 10 + subframe; + + if (pthread_mutex_lock(&this->lock)) abort(); + + /* TODO: optimize */ + /* clear all between last insert point and current one + * this may be wrong if delay between two append is + * greater than 1024 frames (something like that) + */ + i = (this->last_insert_point + 1) % (1024*10); + while (i != index) { + this->valid[i] = 0; + i = (i + 1) % (1024*10); + } + + this->data[index] = value; + this->valid[index] = 1; + + this->last_insert_point = index; + + if (pthread_mutex_unlock(&this->lock)) abort(); +} + +view *new_view_tti(float refresh_rate, gui *g, widget *w, int color) +{ + struct tti *ret = calloc(1, sizeof(struct tti)); + if (ret == NULL) abort(); + + ret->common.clear = clear; + ret->common.append = (void (*)(view *, ...))append; + + ret->refresh_rate = refresh_rate; + ret->g = g; + ret->w = w; + ret->plot = xy_plot_new_plot(g, w, color); + + ret->last_insert_point = 0; + + if (pthread_mutex_init(&ret->lock, NULL)) abort(); + + new_thread(tti_thread, ret); + + return (view *)ret; +} diff --git a/common/utils/T/tracer/view/view.h b/common/utils/T/tracer/view/view.h new file mode 100644 index 0000000000000000000000000000000000000000..cbc5e21b73d95fb3b15524977663a6054846fc5f --- /dev/null +++ b/common/utils/T/tracer/view/view.h @@ -0,0 +1,27 @@ +#ifndef _VIEW_H_ +#define _VIEW_H_ + +#include "gui/gui.h" + +/* defines the public API of views */ + +typedef struct view { + void (*clear)(struct view *this); + void (*append)(struct view *this, ...); + void (*set)(struct view *this, char *name, ...); +} view; + +view *new_view_stdout(void); +view *new_view_textlist(int maxsize, float refresh_rate, gui *g, widget *w); +view *new_view_xy(int length, float refresh_rate, gui *g, widget *w, + int color); +view *new_view_tti(float refresh_rate, gui *g, widget *w, + int color); +view *new_view_time(int number_of_seconds, float refresh_rate, + gui *g, widget *w); +view *new_subview_time(view *time, int line, int color, int size); +view *new_view_ticktime(float refresh_rate, gui *g, widget *w); +view *new_subview_ticktime(view *ticktime, int line, int color, int size); +void ticktime_set_tick(view *ticktime, void *logger); + +#endif /* _VIEW_H_ */ diff --git a/common/utils/T/tracer/view/xy.c b/common/utils/T/tracer/view/xy.c new file mode 100644 index 0000000000000000000000000000000000000000..1407a16a0e44614c8e86b05569712d738439cfc2 --- /dev/null +++ b/common/utils/T/tracer/view/xy.c @@ -0,0 +1,116 @@ +#include "view.h" +#include "../utils.h" +#include <stdio.h> +#include <stdlib.h> +#include <pthread.h> +#include <stdarg.h> +#include <string.h> + +struct xy { + view common; + gui *g; + widget *w; + int plot; + float refresh_rate; + pthread_mutex_t lock; + int length; + float *x; + float *y; + int insert_point; +}; + +static void *xy_thread(void *_this) +{ + struct xy *this = _this; + + while (1) { + if (pthread_mutex_lock(&this->lock)) abort(); + xy_plot_set_points(this->g, this->w, this->plot, + this->length, this->x, this->y); + if (pthread_mutex_unlock(&this->lock)) abort(); + sleepms(1000/this->refresh_rate); + } + + return 0; +} + +static void clear(view *this) +{ + /* TODO */ +} + +static void append(view *_this, float *x, float *y, int length) +{ + struct xy *this = (struct xy *)_this; + int i; + int ip; + + if (pthread_mutex_lock(&this->lock)) abort(); + + ip = this->insert_point; + + /* TODO: optimize the copy */ + for (i = 0; i < length; i++) { + this->x[ip] = x[i]; + this->y[ip] = y[i]; + ip++; if (ip == this->length) ip = 0; + } + + this->insert_point = ip; + + if (pthread_mutex_unlock(&this->lock)) abort(); +} + +static void set(view *_this, char *name, ...) +{ + struct xy *this = (struct xy *)_this; + va_list ap; + + if (!strcmp(name, "length")) { + if (pthread_mutex_lock(&this->lock)) abort(); + + va_start(ap, name); + + free(this->x); + free(this->y); + this->length = va_arg(ap, int); + this->x = calloc(this->length, sizeof(float)); if (this->x==NULL)abort(); + this->y = calloc(this->length, sizeof(float)); if (this->y==NULL)abort(); + this->insert_point = 0; + + va_end(ap); + + if (pthread_mutex_unlock(&this->lock)) abort(); + return; + } + + printf("%s:%d: unkown setting '%s'\n", __FILE__, __LINE__, name); + abort(); +} + +view *new_view_xy(int length, float refresh_rate, gui *g, widget *w, + int color) +{ + struct xy *ret = calloc(1, sizeof(struct xy)); + if (ret == NULL) abort(); + + ret->common.clear = clear; + ret->common.append = (void (*)(view *, ...))append; + ret->common.set = set; + + ret->refresh_rate = refresh_rate; + ret->g = g; + ret->w = w; + ret->plot = xy_plot_new_plot(g, w, color); + + ret->length = length; + ret->x = calloc(length, sizeof(float)); if (ret->x == NULL) abort(); + ret->y = calloc(length, sizeof(float)); if (ret->y == NULL) abort(); + ret->insert_point = 0; + + if (pthread_mutex_init(&ret->lock, NULL)) abort(); + + new_thread(xy_thread, ret); + + return (view *)ret; +} diff --git a/common/utils/itti/intertask_interface.c b/common/utils/itti/intertask_interface.c index 572c207b3fc7e639671a584b3b6c11241b521ca6..6789dadce60629b14ea493b9148ba2e6882ddd4e 100644 --- a/common/utils/itti/intertask_interface.c +++ b/common/utils/itti/intertask_interface.c @@ -58,6 +58,10 @@ # include "vcd_signal_dumper.h" #endif +#if T_TRACER +#include "T.h" +#endif + /* Includes "intertask_interface_init.h" to check prototype coherence, but * disable threads and messages information generation. */ diff --git a/common/utils/itti/intertask_interface_dump.c b/common/utils/itti/intertask_interface_dump.c index 491bff59b0fcc5aab29116be171daa710504c365..30d92e3a292595ff036cff3fc869ec23aec01081 100644 --- a/common/utils/itti/intertask_interface_dump.c +++ b/common/utils/itti/intertask_interface_dump.c @@ -64,6 +64,10 @@ #include "vcd_signal_dumper.h" #endif +#if T_TRACER +#include "T.h" +#endif + static const int itti_dump_debug = 0; // 0x8 | 0x4 | 0x2; #ifdef RTAI diff --git a/common/utils/itti/memory_pools.c b/common/utils/itti/memory_pools.c index 97ec7d8e3886823b5458db6ccaff071400c68777..a7d3448352e569423ad56b9c4dc3bb4c992c7c45 100644 --- a/common/utils/itti/memory_pools.c +++ b/common/utils/itti/memory_pools.c @@ -37,6 +37,11 @@ # include "vcd_signal_dumper.h" #endif +#if T_TRACER +#include <string.h> +#include "T.h" +#endif + /*------------------------------------------------------------------------------*/ const static int mp_debug = 0; diff --git a/openair1/MAC_INTERFACE/COPYING b/openair1/MAC_INTERFACE/COPYING deleted file mode 100644 index 818433ecc0e094a4db1023c68b33f24344643ad8..0000000000000000000000000000000000000000 --- a/openair1/MAC_INTERFACE/COPYING +++ /dev/null @@ -1,674 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - <one line to give the program's name and a brief idea of what it does.> - Copyright (C) <year> <name of author> - - This program 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. - - 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, see <http://www.gnu.org/licenses/>. - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - <program> Copyright (C) <year> <name of author> - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -<http://www.gnu.org/licenses/>. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -<http://www.gnu.org/philosophy/why-not-lgpl.html>. diff --git a/openair1/MAC_INTERFACE/Makefile.inc b/openair1/MAC_INTERFACE/Makefile.inc deleted file mode 100644 index 5dcd2a3ffe8cab7618aa97c083bce1f369ce38e7..0000000000000000000000000000000000000000 --- a/openair1/MAC_INTERFACE/Makefile.inc +++ /dev/null @@ -1,2 +0,0 @@ -#MAC_XFACE_OBJS = $(OPENAIR1_TOP)/MAC_INTERFACE/register.o -MAC_XFACE_OBJS += $(OPENAIR1_TOP)/MAC_INTERFACE/init.o diff --git a/openair1/MAC_INTERFACE/defs.h b/openair1/MAC_INTERFACE/defs.h deleted file mode 100755 index dbaab57fcc5fff946067431d63612426cdcd5613..0000000000000000000000000000000000000000 --- a/openair1/MAC_INTERFACE/defs.h +++ /dev/null @@ -1,42 +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 - - *******************************************************************************/ -/*________________________mac_defs.h________________________ - - Authors : Hicham Anouar, Raymond Knopp - Company : EURECOM - Emails : anouar@eurecom.fr, knopp@eurecom.fr - ________________________________________________________________*/ - -#ifndef __MAC_INTERFACE_DEFS_H__ -#define __MAC_INTERFACE_DEFS_H__ - - -#include "PHY_INTERFACE/defs.h" - -#endif diff --git a/openair1/MAC_INTERFACE/extern.h b/openair1/MAC_INTERFACE/extern.h deleted file mode 100755 index a7444939eee33837f6a8a0a20ea47fc3f14eac4f..0000000000000000000000000000000000000000 --- a/openair1/MAC_INTERFACE/extern.h +++ /dev/null @@ -1,55 +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 - - *******************************************************************************/ -/*________________________mac_extern.h________________________ - - Authors : Hicham Anouar, Raymond Knopp - Company : EURECOM - Emails : anouar@eurecom.fr, knopp@eurecom.fr -________________________________________________________________*/ - - -/*! \file mac_extern.h -* \brief Generic mac interface external variable definitions -* \author R. Knopp -* \date March 2006 -* \note -* \warning -* @ingroup macxface -*/ - -#ifndef __MAC_INTERFACE_EXTERN_H__ -#define __MAC_INTERFACE_EXTERN_H__ - -#include "defs.h" - - -extern MAC_xface *mac_xface; - - -#endif /*__MAC_INTERFACE_EXTERN_H__ */ diff --git a/openair1/MAC_INTERFACE/init.c b/openair1/MAC_INTERFACE/init.c deleted file mode 100644 index 480d365f099b8c7c58811f9e9d7eda2aec35844a..0000000000000000000000000000000000000000 --- a/openair1/MAC_INTERFACE/init.c +++ /dev/null @@ -1,76 +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 - - *******************************************************************************/ -/*________________________mac_init.c________________________ - - Authors : Hicham Anouar, Raymond Knopp - Company : EURECOM - Emails : anouar@eurecom.fr, knopp@eurecom.fr -________________________________________________________________*/ - -/*!\brief Initilization and reconfiguration routines for generic MAC interface */ - -#include "defs.h" -#include "extern.h" -#include "SCHED/defs.h" - -int mac_init(void) -{ - int i; - -#ifndef USER_MODE - // mac_xface->macphy_init(); - mac_xface->macphy_exit = openair_sched_exit; -#else - mac_xface->macphy_exit=(void (*)(void)) exit; -#endif - - /* this is done in cbmimo1_fileops - #ifdef OPENAIR2 - mac_xface->macphy_init(); - #endif //OPENAIR2 - */ - - return(1); -} - -void mac_cleanup(void) -{ - -} - -void mac_resynch(void) -{ - -} - -/* -#ifdef OPENAIR2 -EXPORT_SYMBOL(frame); -#endif //OPENAIR2 -*/ diff --git a/openair1/MAC_INTERFACE/register.c b/openair1/MAC_INTERFACE/register.c deleted file mode 100644 index 0c3c611817296a812313fdc93ab781d6690aecb6..0000000000000000000000000000000000000000 --- a/openair1/MAC_INTERFACE/register.c +++ /dev/null @@ -1,121 +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 - - *******************************************************************************/ -/*________________________mac_register.c________________________ - - Authors : Hicham Anouar, Raymond Knopp - Company : EURECOM - Emails : anouar@eurecom.fr, knopp@eurecom.fr -________________________________________________________________*/ - - -/*!\brief Registration routines for generic MAC interface. Register/unregister a MAC. -Upon registration, the MAC retrieves the transport channel (MAC_tch) data structure and provides the -pointer to the macphy_scheduler() routine*/ -#define __NO_VERSION__ - -#undef __PHY_IMPLEMENTATION_DEFS_H__ - -#include "ARCH/CBMIMO1/DEVICE_DRIVER/defs.h" -#include "defs.h" -#include "extern.h" -#include "SCHED/extern.h" - -#ifndef USER_MODE - - - - - -void dummy_macphy_scheduler(uint8_t last_slot) -{ - //if (last_slot == 0) - // mac_xface->frame++; - - msg("[OPENAIR][MAC XFACE] in dummy_macphy_scheduler(): MAC no yet registered!\n"); - - //#ifdef EMOS - // phy_procedures(last_slot); - //#endif - -} - -void dummy_macphy_setparams(void *params) -{ - msg("[OPENAIR][MAC XFACE] dummy_macphy_setparams(): no MAC registered!\n"); -} - -void dummy_macphy_init(void ) -{ - msg("[OPENAIR][MAC XFACE] dummy_macphy_init(): no MAC registered!\n"); -} - -MAC_xface *mac_register(void macphy_scheduler(uint8_t last_slot), void macphy_setparams(void *),void macphy_init(void ),void mrbch_phy_sync_failure(unsigned char,unsigned char), - void chbch_phy_sync_success(unsigned char,unsigned char)) -{ - - if (openair_daq_vars.mac_registered == 0) { - - msg("[OPENAIR][MAC XFACE] Registering new MAC interface at %p, scheduler %p, setparams at %p, init at %p\n", - mac_xface,macphy_scheduler,macphy_setparams,macphy_init); - mac_xface->macphy_scheduler = macphy_scheduler; - mac_xface->macphy_setparams = macphy_setparams; - mac_xface->macphy_init = macphy_init; -#ifndef PC_TARGET - // mac_xface->ublaze_mac_xface = ublaze_mac_xface; -#endif - openair_daq_vars.mac_registered=1; - return(mac_xface); - } else { - msg("[OPENAIR][MAC XFACE] MAC interface already registered, aborting ...\n"); - return NULL; - } - - -} - -int mac_unregister(MAC_xface *mac_xface_rx) -{ - - if (mac_xface_rx == mac_xface) { - msg("[OPENAIR][MAC XFACE] Unregistering MAC interface\n"); - mac_xface->macphy_scheduler = dummy_macphy_scheduler; - mac_xface->macphy_setparams = dummy_macphy_setparams; - mac_xface->macphy_init = dummy_macphy_init; - openair_daq_vars.mac_registered=0; - return(0); - } else { - msg("[OPENAIR][MAC XFACE] Not the right interface descriptor pointer!!!, aborting ...\n"); - return (-1); - } - -} - -EXPORT_SYMBOL(mac_register); -EXPORT_SYMBOL(mac_unregister); -#endif //USER_MODE diff --git a/openair1/MAC_INTERFACE/vars.h b/openair1/MAC_INTERFACE/vars.h deleted file mode 100755 index e3ef7f6ab18bb7dad4376df62679f7562a941e4a..0000000000000000000000000000000000000000 --- a/openair1/MAC_INTERFACE/vars.h +++ /dev/null @@ -1,52 +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 - - *******************************************************************************/ -/*________________________mac_vars.h________________________ - - Authors : Hicham Anouar, Raymond Knopp - Company : EURECOM - Emails : anouar@eurecom.fr, knopp@eurecom.fr -________________________________________________________________*/ - - -/*! \file mac_vars.h -* \brief generic mac interface variable definitions -* \author R. Knopp -* \version 1 -* \date March 2006 -* @ingroup macxface -*/ - -#ifndef __MAC_INTERFACE_VARS_H__ -#define __MAC_INTERFACE_VARS_H__ - -#include "defs.h" - -MAC_xface *mac_xface; - -#endif //__MAC_INTERFACE_VARS_H__ diff --git a/openair1/PHY/CODING/3gpplte_sse.c b/openair1/PHY/CODING/3gpplte_sse.c index 41c0f65dc35f15dfa5e6f1d83a8fae39f0fa1d8c..34fcbef6d65485502023d43bdaae9c31de1b9fe4 100755 --- a/openair1/PHY/CODING/3gpplte_sse.c +++ b/openair1/PHY/CODING/3gpplte_sse.c @@ -37,6 +37,7 @@ #include "extern_3GPPinterleaver.h" #else #include "vars.h" +#include <stdint.h> #endif #include <stdio.h> #include <string.h> @@ -48,6 +49,7 @@ #define print_shorts(s,x) printf("%s %x,%x,%x,%x,%x,%x,%x,%x\n",s,(x)[0],(x)[1],(x)[2],(x)[3],(x)[4],(x)[5],(x)[6],(x)[7]) #define print_ints(s,x) printf("%s %x %x %x %x\n",s,(x)[0],(x)[1],(x)[2],(x)[3]) +#define print_bytes2(s,x) printf("%s %x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x\n",s,(x)[0],(x)[1],(x)[2],(x)[3],(x)[4],(x)[5],(x)[6],(x)[7],(x)[8],(x)[9],(x)[10],(x)[11],(x)[12],(x)[13],(x)[14],(x)[15],(x)[16],(x)[17],(x)[18],(x)[19],(x)[20],(x)[21],(x)[22],(x)[23],(x)[24],(x)[25],(x)[26],(x)[27],(x)[28],(x)[29],(x)[30],(x)[31]) //#define DEBUG_TURBO_ENCODER 1 #define CALLGRIND 1 @@ -57,16 +59,12 @@ unsigned long long threegpplte_interleaver_tmp; #if defined(__x86_64__) || defined(__i386__) struct treillis { union { - __m64 systematic_64[3]; - char systematic_8[24]; - }; - union { - __m64 parity1_64[3]; - char parity1_8[24]; + __m64 systematic_andp1_64[3]; + uint8_t systematic_andp1_8[24]; }; union { __m64 parity2_64[3]; - char parity2_8[24]; + uint8_t parity2_8[24]; }; int exit_state; } __attribute__ ((aligned(64))); @@ -75,12 +73,8 @@ struct treillis { struct treillis { union { - uint8x8_t systematic_64[3]; - char systematic_8[24]; - }__attribute__((aligned(64))); - union { - uint8x8_t parity1_64[3]; - char parity1_8[24]; + uint8x8_t systematic_andp1_64[3]; + char systematic_andp1_8[24]; }__attribute__((aligned(64))); union { uint8x8_t parity2_64[3]; @@ -91,6 +85,7 @@ struct treillis { #endif struct treillis all_treillis[8][256]; + int all_treillis_initialized=0; static inline unsigned char threegpplte_rsc(unsigned char input,unsigned char *state) @@ -116,18 +111,20 @@ void treillis_table_init(void) unsigned char v, current_state; // clear all_treillis - for (i=0; i<8; i++) + for (i=0; i<8; i++) { bzero( all_treillis[i], sizeof(all_treillis[0]) ); + } for (i=0; i<8; i++) { //all possible initial states for (j=0; j<=255; j++) { // all possible values of a byte current_state=i; for (b=0; b<8 ; b++ ) { // pre-compute the image of the byte j in _m128i vector right place - all_treillis[i][j].systematic_8[b*3]= (j&(1<<(7-b)))>>(7-b); - v=threegpplte_rsc( all_treillis[i][j].systematic_8[b*3] , + all_treillis[i][j].systematic_andp1_8[b*3]= (j&(1<<(7-b)))>>(7-b); + v=threegpplte_rsc( all_treillis[i][j].systematic_andp1_8[b*3] , ¤t_state); - all_treillis[i][j].parity1_8[b*3+1]=v; // for the yparity1 + all_treillis[i][j].systematic_andp1_8[b*3+1]=v; // for the yparity1 + // all_treillis[i][j].parity1_8[b*3+1]=v; // for the yparity1 all_treillis[i][j].parity2_8[b*3+2]=v; // for the yparity2 } @@ -143,9 +140,10 @@ void treillis_table_init(void) char interleave_compact_byte(short * base_interleaver,unsigned char * input, unsigned char * output, int n) { - char expandInput[768*8] __attribute__((aligned(16))); + char expandInput[768*8] __attribute__((aligned(32))); int i,loop=n>>4; #if defined(__x86_64__) || defined(__i386__) +#ifndef __AVX2__ __m128i *i_128=(__m128i *)input, *o_128=(__m128i*)expandInput; __m128i tmp1, tmp2, tmp3, tmp4; __m128i BIT_MASK = _mm_set_epi8( 0b00000001, @@ -164,6 +162,43 @@ char interleave_compact_byte(short * base_interleaver,unsigned char * input, uns 0b00100000, 0b01000000, 0b10000000); + +#else + __m256i *i_256=(__m256i *)input, *o_256=(__m256i*)expandInput; + __m256i tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; + __m256i BIT_MASK = _mm256_set_epi8( 0b00000001, + 0b00000010, + 0b00000100, + 0b00001000, + 0b00010000, + 0b00100000, + 0b01000000, + 0b10000000, + 0b00000001, + 0b00000010, + 0b00000100, + 0b00001000, + 0b00010000, + 0b00100000, + 0b01000000, + 0b10000000, + 0b00000001, + 0b00000010, + 0b00000100, + 0b00001000, + 0b00010000, + 0b00100000, + 0b01000000, + 0b10000000, + 0b00000001, + 0b00000010, + 0b00000100, + 0b00001000, + 0b00010000, + 0b00100000, + 0b01000000, + 0b10000000); +#endif #elif defined(__arm__) uint8x16_t *i_128=(uint8x16_t *)input, *o_128=(uint8x16_t *)expandInput; uint8x16_t tmp1,tmp2; @@ -187,46 +222,126 @@ char interleave_compact_byte(short * base_interleaver,unsigned char * input, uns 0b00000010, 0b00000001}; #endif + + +#ifndef __AVX2__ if ((n&15) > 0) loop++; +#else + loop=n>>5; + if ((n&31) > 0) + loop++; +#endif + for (i=0; i<loop ; i++ ) { - /* int cur_byte=i<<3; */ - /* for (b=0;b<8;b++) */ - /* expandInput[cur_byte+b] = (input[i]&(1<<(7-b)))>>(7-b); */ + // int cur_byte=i<<3; + // for (b=0;b<8;b++) + // expandInput[cur_byte+b] = (input[i]&(1<<(7-b)))>>(7-b); #if defined(__x86_64__) || defined(__i386__) - tmp1=_mm_load_si128(i_128++); - tmp2=_mm_unpacklo_epi8(tmp1,tmp1); - tmp3=_mm_unpacklo_epi16(tmp2,tmp2); - tmp4=_mm_unpacklo_epi32(tmp3,tmp3); +#ifndef __AVX2__ + tmp1=_mm_load_si128(i_128++); // tmp1 = B0,B1,...,B15 + tmp2=_mm_unpacklo_epi8(tmp1,tmp1); // tmp2 = B0,B0,B1,B1,...,B7,B7 + tmp3=_mm_unpacklo_epi16(tmp2,tmp2); // tmp3 = B0,B0,B0,B0,B1,B1,B1,B1,B2,B2,B2,B2,B3,B3,B3,B3 + tmp4=_mm_unpacklo_epi32(tmp3,tmp3); // tmp4 - B0,B0,B0,B0,B0,B0,B0,B0,B1,B1,B1,B1,B1,B1,B1,B1 *o_128++=_mm_cmpeq_epi8(_mm_and_si128(tmp4,BIT_MASK),BIT_MASK); - tmp4=_mm_unpackhi_epi32(tmp3,tmp3); + tmp4=_mm_unpackhi_epi32(tmp3,tmp3); // tmp4 - B2,B2,B2,B2,B2,B2,B2,B2,B3,B3,B3,B3,B3,B3,B3,B3 *o_128++=_mm_cmpeq_epi8(_mm_and_si128(tmp4,BIT_MASK),BIT_MASK);; - tmp3=_mm_unpackhi_epi16(tmp2,tmp2); - tmp4=_mm_unpacklo_epi32(tmp3,tmp3); + tmp3=_mm_unpackhi_epi16(tmp2,tmp2); // tmp3 = B4,B4,B4,B4,B5,B5,B5,B5,B6,B6,B6,B6,B7,B7,B7,B7 + tmp4=_mm_unpacklo_epi32(tmp3,tmp3); // tmp4 - B4,B4,B4,B4,B4,B4,B4,B4,B5,B5,B5,B5,B5,B5,B5,B5 *o_128++=_mm_cmpeq_epi8(_mm_and_si128(tmp4,BIT_MASK),BIT_MASK);; - tmp4=_mm_unpackhi_epi32(tmp3,tmp3); + tmp4=_mm_unpackhi_epi32(tmp3,tmp3); // tmp4 - B6,B6,B6,B6,B6,B6,B6,B6,B7,B7,B7,B7,B7,B7,B7,B7 *o_128++=_mm_cmpeq_epi8(_mm_and_si128(tmp4,BIT_MASK),BIT_MASK);; - tmp2=_mm_unpackhi_epi8(tmp1,tmp1); - tmp3=_mm_unpacklo_epi16(tmp2,tmp2); - tmp4=_mm_unpacklo_epi32(tmp3,tmp3); + tmp2=_mm_unpackhi_epi8(tmp1,tmp1); // tmp2 = B8,B8,B9,B9,...,B15,B15 + tmp3=_mm_unpacklo_epi16(tmp2,tmp2); // tmp3 = B8,B8,B8,B8,B9,B9,B9,B9,B10,B10,B10,B10,B11,B11,B11,B11 + tmp4=_mm_unpacklo_epi32(tmp3,tmp3); // tmp4 = B8,B8,B8,B8,B8,B8,B8,B8,B9,B9,B9,B9,B9,B9,B9,B9 *o_128++=_mm_cmpeq_epi8(_mm_and_si128(tmp4,BIT_MASK),BIT_MASK);; - tmp4=_mm_unpackhi_epi32(tmp3,tmp3); + tmp4=_mm_unpackhi_epi32(tmp3,tmp3); // tmp4 = B10,B10,B10,B10,B10,B10,B10,B10,B11,B11,B11,B11,B11,B11,B11,B11 *o_128++=_mm_cmpeq_epi8(_mm_and_si128(tmp4,BIT_MASK),BIT_MASK);; - tmp3=_mm_unpackhi_epi16(tmp2,tmp2); - tmp4=_mm_unpacklo_epi32(tmp3,tmp3); + tmp3=_mm_unpackhi_epi16(tmp2,tmp2); // tmp3 = B12,B12,B12,B12,B13,B13,B13,B13,B14,B14,B14,B14,B15,B15,B15,B15 + tmp4=_mm_unpacklo_epi32(tmp3,tmp3); // tmp4 = B12,B12,B12,B12,B12,B12,B12,B12,B13,B13,B13,B13,B13,B13,B13,B13 *o_128++=_mm_cmpeq_epi8(_mm_and_si128(tmp4,BIT_MASK),BIT_MASK);; - tmp4=_mm_unpackhi_epi32(tmp3,tmp3); + tmp4=_mm_unpackhi_epi32(tmp3,tmp3); // tmp4 = B14,B14,B14,B14,B14,B14,B14,B14,B15,B15,B15,B15,B15,B15,B15,B15 *o_128++=_mm_cmpeq_epi8(_mm_and_si128(tmp4,BIT_MASK),BIT_MASK);; - +#else + tmp1=_mm256_load_si256(i_256++); // tmp1 = B0,B1,...,B15,...,B31 + //print_bytes2("in",(uint8_t*)&tmp1); + tmp2=_mm256_unpacklo_epi8(tmp1,tmp1); // tmp2 = B0,B0,B1,B1,...,B7,B7,B16,B16,B17,B17,...,B23,B23 + tmp3=_mm256_unpacklo_epi16(tmp2,tmp2); // tmp3 = B0,B0,B0,B0,B1,B1,B1,B1,B2,B2,B2,B2,B3,B3,B3,B3,B16,B16,B16,B16,...,B19,B19,B19,B19 + tmp4=_mm256_unpacklo_epi32(tmp3,tmp3); // tmp4 - B0,B0,B0,B0,B0,B0,B0,B0,B1,B1,B1,B1,B1,B1,B1,B1,B16,B16...,B17..,B17 + tmp5=_mm256_unpackhi_epi32(tmp3,tmp3); // tmp5 - B2,B2,B2,B2,B2,B2,B2,B2,B3,B3,B3,B3,B3,B3,B3,B3,B18...,B18,B19,...,B19 + tmp6=_mm256_insertf128_si256(tmp4,_mm256_extracti128_si256(tmp5,0),1); // tmp6 = B0 B1 B2 B3 + tmp7=_mm256_insertf128_si256(tmp5,_mm256_extracti128_si256(tmp4,1),0); // tmp7 = B16 B17 B18 B19 + //print_bytes2("tmp2",(uint8_t*)&tmp2); + //print_bytes2("tmp3",(uint8_t*)&tmp3); + //print_bytes2("tmp4",(uint8_t*)&tmp4); + //print_bytes2("tmp5",(uint8_t*)&tmp4); + //print_bytes2("tmp6",(uint8_t*)&tmp6); + //print_bytes2("tmp7",(uint8_t*)&tmp7); + o_256[0]=_mm256_cmpeq_epi8(_mm256_and_si256(tmp6,BIT_MASK),BIT_MASK); + //print_bytes2("out",(uint8_t*)o_256); + o_256[4]=_mm256_cmpeq_epi8(_mm256_and_si256(tmp7,BIT_MASK),BIT_MASK);; + //print_bytes2("out",(uint8_t*)(o_256+4)); + + tmp3=_mm256_unpackhi_epi16(tmp2,tmp2); // tmp3 = B4,B4,B4,B4,B5,B5,B5,B5,B6,B6,B6,B6,B7,B7,B7,B7,B20,B20,B20,B20,...,B23,B23,B23,B23 + tmp4=_mm256_unpacklo_epi32(tmp3,tmp3); // tmp4 - B4,B4,B4,B4,B4,B4,B4,B4,B5,B5,B5,B5,B5,B5,B5,B5,B20,B20...,B21..,B21 + tmp5=_mm256_unpackhi_epi32(tmp3,tmp3); // tmp5 - B6,B6,B6,B6,B6,B6,B6,B6,B7,B7,B7,B7,B7,B7,B7,B7,B22...,B22,B23,...,B23 + tmp6=_mm256_insertf128_si256(tmp4,_mm256_extracti128_si256(tmp5,0),1); // tmp6 = B4 B5 B6 B7 + tmp7=_mm256_insertf128_si256(tmp5,_mm256_extracti128_si256(tmp4,1),0); // tmp7 = B20 B21 B22 B23 + //print_bytes2("tmp2",(uint8_t*)&tmp2); + //print_bytes2("tmp3",(uint8_t*)&tmp3); + //print_bytes2("tmp4",(uint8_t*)&tmp4); + //print_bytes2("tmp5",(uint8_t*)&tmp4); + //print_bytes2("tmp6",(uint8_t*)&tmp6); + //print_bytes2("tmp7",(uint8_t*)&tmp7); + o_256[1]=_mm256_cmpeq_epi8(_mm256_and_si256(tmp6,BIT_MASK),BIT_MASK); + //print_bytes2("out",(uint8_t*)(o_256+1)); + o_256[5]=_mm256_cmpeq_epi8(_mm256_and_si256(tmp7,BIT_MASK),BIT_MASK);; + //print_bytes2("out",(uint8_t*)(o_256+4)); + + tmp2=_mm256_unpackhi_epi8(tmp1,tmp1); // tmp2 = B8 B9 B10 B11 B12 B13 B14 B15 B25 B26 B27 B28 B29 B30 B31 + tmp3=_mm256_unpacklo_epi16(tmp2,tmp2); // tmp3 = B8,B9,B10,B11,B26,B27,B28,B29 + tmp4=_mm256_unpacklo_epi32(tmp3,tmp3); // tmp4 - B8,B9,B26,B27 + tmp5=_mm256_unpackhi_epi32(tmp3,tmp3); // tmp5 - B10,B11,B28,B29 + tmp6=_mm256_insertf128_si256(tmp4,_mm256_extracti128_si256(tmp5,0),1); // tmp6 = B8 B9 B10 B11 + tmp7=_mm256_insertf128_si256(tmp5,_mm256_extracti128_si256(tmp4,1),0); // tmp7 = B26 B27 B28 B29 + //print_bytes2("tmp2",(uint8_t*)&tmp2); + //print_bytes2("tmp3",(uint8_t*)&tmp3); + //print_bytes2("tmp4",(uint8_t*)&tmp4); + //print_bytes2("tmp5",(uint8_t*)&tmp4); + //print_bytes2("tmp6",(uint8_t*)&tmp6); + //print_bytes2("tmp7",(uint8_t*)&tmp7); + o_256[2]=_mm256_cmpeq_epi8(_mm256_and_si256(tmp6,BIT_MASK),BIT_MASK); + //print_bytes2("out",(uint8_t*)(o_256+2)); + o_256[6]=_mm256_cmpeq_epi8(_mm256_and_si256(tmp7,BIT_MASK),BIT_MASK);; + //print_bytes2("out",(uint8_t*)(o_256+4)); + + tmp3=_mm256_unpackhi_epi16(tmp2,tmp2); // tmp3 = B12 B13 B14 B15 B28 B29 B30 B31 + tmp4=_mm256_unpacklo_epi32(tmp3,tmp3); // tmp4 = B12 B13 B28 B29 + tmp5=_mm256_unpackhi_epi32(tmp3,tmp3); // tmp5 = B14 B15 B30 B31 + tmp6=_mm256_insertf128_si256(tmp4,_mm256_extracti128_si256(tmp5,0),1); // tmp6 = B12 B13 B14 B15 + tmp7=_mm256_insertf128_si256(tmp5,_mm256_extracti128_si256(tmp4,1),0); // tmp7 = B28 B29 B30 B31 + //print_bytes2("tmp2",(uint8_t*)&tmp2); + //print_bytes2("tmp3",(uint8_t*)&tmp3); + //print_bytes2("tmp4",(uint8_t*)&tmp4); + //print_bytes2("tmp5",(uint8_t*)&tmp4); + //print_bytes2("tmp6",(uint8_t*)&tmp6); + //print_bytes2("tmp7",(uint8_t*)&tmp7); + o_256[3]=_mm256_cmpeq_epi8(_mm256_and_si256(tmp6,BIT_MASK),BIT_MASK); + //print_bytes2("out",(uint8_t*)(o_256+3)); + o_256[7]=_mm256_cmpeq_epi8(_mm256_and_si256(tmp7,BIT_MASK),BIT_MASK);; + //print_bytes2("out",(uint8_t*)(o_256+7)); + + o_256+=8; +#endif #elif defined(__arm__) tmp1=vld1q_u8((uint8_t*)i_128); //print_bytes("tmp1:",(uint8_t*)&tmp1); @@ -302,11 +417,17 @@ char interleave_compact_byte(short * base_interleaver,unsigned char * input, uns i_128++; #endif } + short * ptr_intl=base_interleaver; #if defined(__x86_64) || defined(__i386__) +#ifndef __AVX2__ __m128i tmp; - uint16_t *systematic2_ptr=(unsigned short *) output; + uint16_t *systematic2_ptr=(uint16_t *) output; +#else + __m256i tmp; + uint32_t *systematic2_ptr=(uint32_t *) output; +#endif #elif defined(__arm__) uint8x16_t tmp; const uint8_t __attribute__ ((aligned (16))) _Powers[16]= @@ -316,11 +437,15 @@ char interleave_compact_byte(short * base_interleaver,unsigned char * input, uns uint8x16_t Powers= vld1q_u8(_Powers); uint8_t *systematic2_ptr=(uint8_t *) output; #endif - int input_length_words=n>>1; - +#ifndef __AVX2__ + int input_length_words=1+((n-1)>>1); +#else + int input_length_words=1+((n-1)>>2); +#endif for ( i=0; i< input_length_words ; i ++ ) { #if defined(__x86_64__) || defined(__i386__) +#ifndef __AVX2__ tmp=_mm_insert_epi8(tmp,expandInput[*ptr_intl++],7); tmp=_mm_insert_epi8(tmp,expandInput[*ptr_intl++],6); tmp=_mm_insert_epi8(tmp,expandInput[*ptr_intl++],5); @@ -338,6 +463,45 @@ char interleave_compact_byte(short * base_interleaver,unsigned char * input, uns tmp=_mm_insert_epi8(tmp,expandInput[*ptr_intl++],8+1); tmp=_mm_insert_epi8(tmp,expandInput[*ptr_intl++],8+0); *systematic2_ptr++=(unsigned short)_mm_movemask_epi8(tmp); +#else + tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],7); + tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],6); + tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],5); + tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],4); + tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],3); + tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],2); + tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],1); + tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],0); + + tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],8+7); + tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],8+6); + tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],8+5); + tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],8+4); + tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],8+3); + tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],8+2); + tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],8+1); + tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],8+0); + + tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],16+7); + tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],16+6); + tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],16+5); + tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],16+4); + tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],16+3); + tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],16+2); + tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],16+1); + tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],16+0); + + tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],24+7); + tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],24+6); + tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],24+5); + tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],24+4); + tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],24+3); + tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],24+2); + tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],24+1); + tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],24+0); + + *systematic2_ptr++=(unsigned int)_mm256_movemask_epi8(tmp); +#endif #elif defined(__arm__) tmp=vsetq_lane_u8(expandInput[*ptr_intl++],tmp,7); tmp=vsetq_lane_u8(expandInput[*ptr_intl++],tmp,6); @@ -391,8 +555,9 @@ void threegpplte_turbo_encoder(unsigned char *input, unsigned short input_length_bits = input_length_bytes<<3; short * base_interleaver; - if ( all_treillis_initialized == 0 ) + if ( all_treillis_initialized == 0 ) { treillis_table_init(); + } // look for f1 and f2 precomputed interleaver values for (i=0; i < 188 && f1f2mat[i].nb_bits != input_length_bits; i++); @@ -405,7 +570,7 @@ void threegpplte_turbo_encoder(unsigned char *input, } - unsigned char systematic2[768]; + unsigned char systematic2[768] __attribute__((aligned(32))); interleave_compact_byte(base_interleaver,input,systematic2,input_length_bytes); #if defined(__x86_64__) || defined(__i386__) @@ -419,22 +584,26 @@ void threegpplte_turbo_encoder(unsigned char *input, for ( state0=state1=i=0 ; i<input_length_bytes; i++ ) { cur_s1=input[i]; cur_s2=systematic2[i]; - + for ( code_rate=0; code_rate<3; code_rate++) { #if defined(__x86_64__) || defined(__i386__) - *ptr_output++ = _mm_add_pi8(all_treillis[state0][cur_s1].systematic_64[code_rate], - _mm_add_pi8(all_treillis[state0][cur_s1].parity1_64[code_rate], - all_treillis[state1][cur_s2].parity2_64[code_rate])); + /* + *ptr_output++ = _mm_add_pi8(all_treillis[state0][cur_s1].systematic_64[code_rate], + _mm_add_pi8(all_treillis[state0][cur_s1].parity1_64[code_rate], + all_treillis[state1][cur_s2].parity2_64[code_rate])); + */ + *ptr_output++ = _mm_add_pi8(all_treillis[state0][cur_s1].systematic_andp1_64[code_rate], + all_treillis[state1][cur_s2].parity2_64[code_rate]); + + #elif defined(__arm__) - uint8x8_t ptmp = vadd_u8(all_treillis[state0][cur_s1].parity1_64[code_rate], - all_treillis[state1][cur_s2].parity2_64[code_rate]); - *ptr_output++ = vadd_u8(all_treillis[state0][cur_s1].systematic_64[code_rate], - ptmp); + *ptr_output++ = vadd_u8(all_treillis[state0][cur_s1].systematic_andp1_64[code_rate], + all_treillis[state0][cur_s1].parity2_64[code_rate]); #endif - } - - state0=all_treillis[state0][cur_s1].exit_state; - state1=all_treillis[state1][cur_s2].exit_state; + } + + state0=all_treillis[state0][cur_s1].exit_state; + state1=all_treillis[state1][cur_s2].exit_state; } x=output+(input_length_bits*3); @@ -485,7 +654,7 @@ void threegpplte_turbo_encoder(unsigned char *input, int main(int argc,char **argv) { - unsigned char input[INPUT_LENGTH+16],state,state2; + unsigned char input[INPUT_LENGTH+32],state,state2; unsigned char output[12+(3*(INPUT_LENGTH<<3))],x,z; int i; unsigned char out; @@ -510,7 +679,7 @@ int main(int argc,char **argv) memset((void*)input,0,INPUT_LENGTH+16); for (i=0; i<INPUT_LENGTH; i++) { input[i] = i*219; - printf("Input %d : %x\n",i,input[i]); + printf("Input %d : %d\n",i,input[i]); } threegpplte_turbo_encoder(&input[0], diff --git a/openair1/PHY/CODING/3gpplte_turbo_decoder_avx2_16bit.c b/openair1/PHY/CODING/3gpplte_turbo_decoder_avx2_16bit.c new file mode 100644 index 0000000000000000000000000000000000000000..24f399a2b20ce643ac2142f222cbbdae95176bef --- /dev/null +++ b/openair1/PHY/CODING/3gpplte_turbo_decoder_avx2_16bit.c @@ -0,0 +1,1421 @@ +/******************************************************************************* + 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: 3gpplte_turbo_decoder_sse_16bit.c + purpose: Routines for implementing max-logmap decoding of Turbo-coded (DLSCH) transport channels from 36-212, V8.6 2009-03 + authors: raymond.knopp@eurecom.fr, Laurent Thomas (Alcatel-Lucent) + date: 21.10.2009 + + Note: This version of the routine currently requires SSE2,SSSE3 and SSE4.1 equipped computers. It uses 16-bit inputs for + LLRS and uses 16-bit arithmetic for the internal computations! + + Changelog: 17.11.2009 FK SSE4.1 not required anymore + Aug. 2012 new parallelization options for higher speed (8-way parallelization) + Jan. 2013 8-bit LLR support with 16-way parallelization + Feb. 2013 New interleaving and hard-decision optimizations (L. Thomas) + May 2013 Extracted 16bit code +*/ + +/// +/// + +#ifdef __AVX2__ + +#include "PHY/sse_intrin.h" + +#ifndef TEST_DEBUG +#include "PHY/defs.h" +#include "PHY/CODING/defs.h" +#include "PHY/CODING/lte_interleaver_inline.h" +#include "extern_3GPPinterleaver.h" +#else + +#include "defs.h" +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#endif + +#ifdef MEX +#include "mex.h" +#endif + + +//#define DEBUG_LOGMAP + +#ifdef DEBUG_LOGMAP +#define print_shorts(s,x) fprintf(fdavx2,"%s %d,%d,%d,%d,%d,%d,%d,%d\n",s,(x)[0],(x)[1],(x)[2],(x)[3],(x)[4],(x)[5],(x)[6],(x)[7]);fprintf(fdavx2b,"%s %d,%d,%d,%d,%d,%d,%d,%d\n",s,(x)[8],(x)[9],(x)[10],(x)[11],(x)[12],(x)[13],(x)[14],(x)[15]) +FILE *fdavx2,*fdavx2b; +#else + +#endif + + +#define print_bytes(s,x) printf("%s %d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d\n",s,(x)[0],(x)[1],(x)[2],(x)[3],(x)[4],(x)[5],(x)[6],(x)[7],(x)[8],(x)[9],(x)[10],(x)[11],(x)[12],(x)[13],(x)[14],(x)[15],(x)[16],(x)[17],(x)[18],(x)[19],(x)[20],(x)[21],(x)[22],(x)[23],(x)[24],(x)[25],(x)[26],(x)[27],(x)[28],(x)[29],(x)[30],(x)[31]) + + + + +typedef int16_t llr_t; // internal decoder LLR data is 16-bit fixed +typedef int16_t channel_t; +#define MAX 256 + +void log_map16avx2(llr_t* systematic,channel_t* y_parity, llr_t* m11, llr_t* m10, llr_t *alpha, llr_t *beta, llr_t* ext,uint16_t frame_length,unsigned char term_flag,unsigned char F,int offset8_flag,time_stats_t *alpha_stats,time_stats_t *beta_stats,time_stats_t *gamma_stats,time_stats_t *ext_stats); +void compute_gamma16avx2(llr_t* m11,llr_t* m10,llr_t* systematic, channel_t* y_parity, uint16_t frame_length,unsigned char term_flag); +void compute_alpha16avx2(llr_t*alpha,llr_t *beta, llr_t* m11,llr_t* m10, uint16_t frame_length,unsigned char F); +void compute_beta16avx2(llr_t*alpha, llr_t* beta,llr_t* m11,llr_t* m10, uint16_t frame_length,unsigned char F,int offset8_flag); +void compute_ext16avx2(llr_t* alpha,llr_t* beta,llr_t* m11,llr_t* m10,llr_t* extrinsic, llr_t* ap, uint16_t frame_length); + + +void log_map16avx2(llr_t* systematic, + channel_t* y_parity, + llr_t* m11, + llr_t* m10, + llr_t *alpha, + llr_t *beta, + llr_t* ext, + uint16_t frame_length, + unsigned char term_flag, + unsigned char F, + int offset8_flag, + time_stats_t *alpha_stats, + time_stats_t *beta_stats, + time_stats_t *gamma_stats, + time_stats_t *ext_stats) +{ + +#ifdef DEBUG_LOGMAP + fprintf(fdavx2,"log_map (avx2_16bit), frame_length %d\n",frame_length); + fprintf(fdavx2b,"log_map (avx2_16bit), frame_length %d\n",frame_length); +#endif + + start_meas(gamma_stats) ; + compute_gamma16avx2(m11,m10,systematic,y_parity,frame_length,term_flag) ; + stop_meas(gamma_stats); + start_meas(alpha_stats) ; + compute_alpha16avx2(alpha,beta,m11,m10,frame_length,F) ; + stop_meas(alpha_stats); + start_meas(beta_stats) ; + compute_beta16avx2(alpha,beta,m11,m10,frame_length,F,offset8_flag) ; + stop_meas(beta_stats); + start_meas(ext_stats) ; + compute_ext16avx2(alpha,beta,m11,m10,ext,systematic,frame_length) ; + stop_meas(ext_stats); + + +} + +void compute_gamma16avx2(llr_t* m11,llr_t* m10,llr_t* systematic,channel_t* y_parity, + uint16_t frame_length,unsigned char term_flag) +{ + int k,K1; + + __m256i *systematic128 = (__m256i *)systematic; + __m256i *y_parity128 = (__m256i *)y_parity; + __m256i *m10_128 = (__m256i *)m10; + __m256i *m11_128 = (__m256i *)m11; + +#ifdef DEBUG_LOGMAP + fprintf(fdavx2,"compute_gamma (avx2_16bit), %p,%p,%p,%p,framelength %d\n",m11,m10,systematic,y_parity,frame_length); + fprintf(fdavx2b,"compute_gamma (avx2_16bit), %p,%p,%p,%p,framelength %d\n",m11,m10,systematic,y_parity,frame_length); +#endif + + K1=frame_length>>3; + + for (k=0; k<K1; k++) { + m11_128[k] = _mm256_srai_epi16(_mm256_adds_epi16(systematic128[k],y_parity128[k]),1); + m10_128[k] = _mm256_srai_epi16(_mm256_subs_epi16(systematic128[k],y_parity128[k]),1); +#ifdef DEBUG_LOGMAP + fprintf(fdavx2,"Loop index k %d\n",k); + fprintf(fdavx2b,"Loop index k %d\n",k); + print_shorts("sys",(int16_t*)&systematic128[k]); + print_shorts("yp",(int16_t*)&y_parity128[k]); + print_shorts("m11",(int16_t*)&m11_128[k]); + print_shorts("m10",(int16_t*)&m10_128[k]); +#endif + } + + // Termination + m11_128[k] = _mm256_srai_epi16(_mm256_adds_epi16(systematic128[k+term_flag],y_parity128[k]),1); + m10_128[k] = _mm256_srai_epi16(_mm256_subs_epi16(systematic128[k+term_flag],y_parity128[k]),1); + +#ifdef DEBUG_LOGMAP + fprintf(fdavx2,"Loop index k %d (term flag %d)\n",k,term_flag); + fprintf(fdavx2b,"Loop index k %d (term flag %d)\n",k,term_flag); + print_shorts("sys",(int16_t*)&systematic128[k+term_flag]); + print_shorts("yp",(int16_t*)&y_parity128[k]); + print_shorts("m11",(int16_t*)&m11_128[k]); + print_shorts("m10",(int16_t*)&m10_128[k]); +#endif +} + +#define L 40 + +void compute_alpha16avx2(llr_t* alpha,llr_t* beta,llr_t* m_11,llr_t* m_10,uint16_t frame_length,unsigned char F) +{ + int k,l,l2,K1,rerun_flag=0; + + __m256i *alpha128=(__m256i *)alpha,*alpha_ptr; + __m256i a0,a1,a2,a3,a4,a5,a6,a7,*m11p,*m10p; + __m256i m_b0,m_b1,m_b2,m_b3,m_b4,m_b5,m_b6,m_b7; + __m256i new0,new1,new2,new3,new4,new5,new6,new7; + __m256i alpha_max; + + unsigned long long timein,timeout; + + l2 = L>>3; + K1 = (frame_length>>3); +#ifdef DEBUG_LOGMAP + fprintf(fdavx2,"Compute alpha (avx2_16bit)\n"); + fprintf(fdavx2b,"Compute alpha (avx2_16bit)\n"); +#endif + timein = rdtsc_oai(); + + for (l=K1;; l=l2,rerun_flag=1) { + alpha128 = (__m256i *)alpha; + + if (rerun_flag == 0) { + + alpha128[0] = _mm256_set_epi16(-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,0,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,0); + alpha128[1] = _mm256_set_epi16(-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2); + alpha128[2] = _mm256_set_epi16(-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2); + alpha128[3] = _mm256_set_epi16(-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2); + alpha128[4] = _mm256_set_epi16(-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2); + alpha128[5] = _mm256_set_epi16(-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2); + alpha128[6] = _mm256_set_epi16(-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2); + alpha128[7] = _mm256_set_epi16(-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2); +#ifdef DEBUG_LOGMAP + fprintf(fdavx2,"Initial alpha\n"); + fprintf(fdavx2b,"Initial alpha\n"); + print_shorts("a0",(int16_t*)&alpha128[0]); + print_shorts("a1",(int16_t*)&alpha128[1]); + print_shorts("a2",(int16_t*)&alpha128[2]); + print_shorts("a3",(int16_t*)&alpha128[3]); + print_shorts("a4",(int16_t*)&alpha128[4]); + print_shorts("a5",(int16_t*)&alpha128[5]); + print_shorts("a6",(int16_t*)&alpha128[6]); + print_shorts("a7",(int16_t*)&alpha128[7]); +#endif + } else { + //set initial alpha in columns 1-7 from final alpha from last run in columns 0-6 + alpha128[0] = _mm256_slli_si256(alpha128[frame_length],2); + alpha128[1] = _mm256_slli_si256(alpha128[1+frame_length],2); + alpha128[2] = _mm256_slli_si256(alpha128[2+frame_length],2); + alpha128[3] = _mm256_slli_si256(alpha128[3+frame_length],2); + alpha128[4] = _mm256_slli_si256(alpha128[4+frame_length],2); + alpha128[5] = _mm256_slli_si256(alpha128[5+frame_length],2); + alpha128[6] = _mm256_slli_si256(alpha128[6+frame_length],2); + alpha128[7] = _mm256_slli_si256(alpha128[7+frame_length],2); + // set initial alpha in column 0 to (0,-MAX/2,...,-MAX/2) + alpha[16] = -MAX/2; + alpha[32] = -MAX/2; + alpha[48] = -MAX/2; + alpha[64] = -MAX/2; + alpha[80] = -MAX/2; + alpha[96] = -MAX/2; + alpha[112] = -MAX/2; + + alpha[24] = -MAX/2; + alpha[40] = -MAX/2; + alpha[56] = -MAX/2; + alpha[72] = -MAX/2; + alpha[88] = -MAX/2; + alpha[104] = -MAX/2; + alpha[120] = -MAX/2; +#ifdef DEBUG_LOGMAP + fprintf(fdavx2,"Second run\n"); + fprintf(fdavx2b,"Second run\n"); + print_shorts("a0",(int16_t*)&alpha128[0]); + print_shorts("a1",(int16_t*)&alpha128[1]); + print_shorts("a2",(int16_t*)&alpha128[2]); + print_shorts("a3",(int16_t*)&alpha128[3]); + print_shorts("a4",(int16_t*)&alpha128[4]); + print_shorts("a5",(int16_t*)&alpha128[5]); + print_shorts("a6",(int16_t*)&alpha128[6]); + print_shorts("a7",(int16_t*)&alpha128[7]); +#endif + + } + + alpha_ptr = &alpha128[0]; + m11p = (__m256i*)m_11; + m10p = (__m256i*)m_10; + + for (k=0; + k<l; + k++) { + + + a1=_mm256_load_si256(&alpha_ptr[1]); + a3=_mm256_load_si256(&alpha_ptr[3]); + a5=_mm256_load_si256(&alpha_ptr[5]); + a7=_mm256_load_si256(&alpha_ptr[7]); + + m_b0 = _mm256_adds_epi16(a1,*m11p); // m11 + m_b4 = _mm256_subs_epi16(a1,*m11p); // m00=-m11 + m_b1 = _mm256_subs_epi16(a3,*m10p); // m01=-m10 + m_b5 = _mm256_adds_epi16(a3,*m10p); // m10 + m_b2 = _mm256_adds_epi16(a5,*m10p); // m10 + m_b6 = _mm256_subs_epi16(a5,*m10p); // m01=-m10 + m_b3 = _mm256_subs_epi16(a7,*m11p); // m00=-m11 + m_b7 = _mm256_adds_epi16(a7,*m11p); // m11 + + a0=_mm256_load_si256(&alpha_ptr[0]); + a2=_mm256_load_si256(&alpha_ptr[2]); + a4=_mm256_load_si256(&alpha_ptr[4]); + a6=_mm256_load_si256(&alpha_ptr[6]); + + new0 = _mm256_subs_epi16(a0,*m11p); // m00=-m11 + new4 = _mm256_adds_epi16(a0,*m11p); // m11 + new1 = _mm256_adds_epi16(a2,*m10p); // m10 + new5 = _mm256_subs_epi16(a2,*m10p); // m01=-m10 + new2 = _mm256_subs_epi16(a4,*m10p); // m01=-m10 + new6 = _mm256_adds_epi16(a4,*m10p); // m10 + new3 = _mm256_adds_epi16(a6,*m11p); // m11 + new7 = _mm256_subs_epi16(a6,*m11p); // m00=-m11 + + a0 = _mm256_max_epi16(m_b0,new0); + a1 = _mm256_max_epi16(m_b1,new1); + a2 = _mm256_max_epi16(m_b2,new2); + a3 = _mm256_max_epi16(m_b3,new3); + a4 = _mm256_max_epi16(m_b4,new4); + a5 = _mm256_max_epi16(m_b5,new5); + a6 = _mm256_max_epi16(m_b6,new6); + a7 = _mm256_max_epi16(m_b7,new7); + + alpha_max = _mm256_max_epi16(a0,a1); + alpha_max = _mm256_max_epi16(alpha_max,a2); + alpha_max = _mm256_max_epi16(alpha_max,a3); + alpha_max = _mm256_max_epi16(alpha_max,a4); + alpha_max = _mm256_max_epi16(alpha_max,a5); + alpha_max = _mm256_max_epi16(alpha_max,a6); + alpha_max = _mm256_max_epi16(alpha_max,a7); + + alpha_ptr+=8; + m11p++; + m10p++; + + alpha_ptr[0] = _mm256_subs_epi16(a0,alpha_max); + alpha_ptr[1] = _mm256_subs_epi16(a1,alpha_max); + alpha_ptr[2] = _mm256_subs_epi16(a2,alpha_max); + alpha_ptr[3] = _mm256_subs_epi16(a3,alpha_max); + alpha_ptr[4] = _mm256_subs_epi16(a4,alpha_max); + alpha_ptr[5] = _mm256_subs_epi16(a5,alpha_max); + alpha_ptr[6] = _mm256_subs_epi16(a6,alpha_max); + alpha_ptr[7] = _mm256_subs_epi16(a7,alpha_max); + +#ifdef DEBUG_LOGMAP + fprintf(fdavx2,"Loop index %d\n",k); + fprintf(fdavx2b,"Loop index %d\n",k); + print_shorts("mb0",(int16_t*)&m_b0); + print_shorts("mb1",(int16_t*)&m_b1); + print_shorts("mb2",(int16_t*)&m_b2); + print_shorts("mb3",(int16_t*)&m_b3); + print_shorts("mb4",(int16_t*)&m_b4); + print_shorts("mb5",(int16_t*)&m_b5); + print_shorts("mb6",(int16_t*)&m_b6); + print_shorts("mb7",(int16_t*)&m_b7); + + fprintf(fdavx2,"Loop index %d, new\n",k); + fprintf(fdavx2b,"Loop index %d, new\n",k); + print_shorts("new0",(int16_t*)&new0); + print_shorts("new1",(int16_t*)&new1); + print_shorts("new2",(int16_t*)&new2); + print_shorts("new3",(int16_t*)&new3); + print_shorts("new4",(int16_t*)&new4); + print_shorts("new5",(int16_t*)&new5); + print_shorts("new6",(int16_t*)&new6); + print_shorts("new7",(int16_t*)&new7); + + fprintf(fdavx2,"Loop index %d, after max\n",k); + fprintf(fdavx2b,"Loop index %d, after max\n",k); + print_shorts("a0",(int16_t*)&a0); + print_shorts("a1",(int16_t*)&a1); + print_shorts("a2",(int16_t*)&a2); + print_shorts("a3",(int16_t*)&a3); + print_shorts("a4",(int16_t*)&a4); + print_shorts("a5",(int16_t*)&a5); + print_shorts("a6",(int16_t*)&a6); + print_shorts("a7",(int16_t*)&a7); + + fprintf(fdavx2,"Loop index %d\n",k); + fprintf(fdavx2b,"Loop index %d\n",k); + print_shorts("a0",(int16_t*)&alpha_ptr[0]); + print_shorts("a1",(int16_t*)&alpha_ptr[1]); + print_shorts("a2",(int16_t*)&alpha_ptr[2]); + print_shorts("a3",(int16_t*)&alpha_ptr[3]); + print_shorts("a4",(int16_t*)&alpha_ptr[4]); + print_shorts("a5",(int16_t*)&alpha_ptr[5]); + print_shorts("a6",(int16_t*)&alpha_ptr[6]); + print_shorts("a7",(int16_t*)&alpha_ptr[7]); + + +#endif + + } + + if (rerun_flag==1) + break; + } + timeout = rdtsc_oai(); + printf("alpha: inner loop time %llu\n",timeout-timein); + +} + + +void compute_beta16avx2(llr_t* alpha,llr_t* beta,llr_t *m_11,llr_t* m_10,uint16_t frame_length,unsigned char F,int offset8_flag) +{ + + int k,rerun_flag=0; + + __m256i *m11p,*m10p; + register __m256i b0,b1,b2,b3,b4,b5,b6,b7; + register __m256i m_b0,m_b1,m_b2,m_b3,m_b4,m_b5,m_b6,m_b7; + register __m256i new0,new1,new2,new3,new4,new5,new6,new7; + + __m256i *beta128,*alpha128,*beta_ptr; + __m256i beta_max; + + llr_t m11,m10,beta0_16,beta1_16,beta2_16,beta3_16,beta4_16,beta5_16,beta6_16,beta7_16,beta0_2,beta1_2,beta2_2,beta3_2,beta_m; + llr_t m11_cw2,m10_cw2,beta0_cw2_16,beta1_cw2_16,beta2_cw2_16,beta3_cw2_16,beta4_cw2_16,beta5_cw2_16,beta6_cw2_16,beta7_cw2_16,beta0_2_cw2,beta1_2_cw2,beta2_2_cw2,beta3_2_cw2,beta_m_cw2; + llr_t beta0,beta1; + llr_t beta0_cw2,beta1_cw2; + + unsigned long long timein,timeout; + +#ifdef DEBUG_LOGMAP + fprintf(fdavx2,"compute_beta (avx2_16bit), %p,%p,%p,%p,framelength %d,F %d\n", + beta,m_11,m_10,alpha,frame_length,F); + fprintf(fdavx2b,"compute_beta (avx2_16bit), %p,%p,%p,%p,framelength %d,F %d\n", + beta,m_11,m_10,alpha,frame_length,F); +#endif + + + // termination for beta initialization + + // fprintf(fdavx2,"beta init: offset8 %d\n",offset8_flag); + m11=(int16_t)m_11[(frame_length<<1)+2]; + m10=(int16_t)m_10[(frame_length<<1)+2]; + + m11_cw2=(int16_t)m_11[(frame_length<<1)+8+2]; + m10_cw2=(int16_t)m_10[(frame_length<<1)+8+2]; + +#ifdef DEBUG_LOGMAP + fprintf(fdavx2,"m11,m10 %d,%d\n",m11,m10); + fprintf(fdavx2b,"m11,m10 %d,%d\n",m11_cw2,m10_cw2); +#endif + + beta0 = -m11;//M0T_TERM; + beta1 = m11;//M1T_TERM; + beta0_cw2 = -m11_cw2;//M0T_TERM; + beta1_cw2 = m11_cw2;//M1T_TERM; + + m11=(int16_t)m_11[(frame_length<<1)+1]; + m10=(int16_t)m_10[(frame_length<<1)+1]; + m11_cw2=(int16_t)m_11[(frame_length<<1)+1+8]; + m10_cw2=(int16_t)m_10[(frame_length<<1)+1+8]; + +#ifdef DEBUG_LOGMAP + fprintf(fdavx2,"m11,m10 %d,%d\n",m11,m10); + fprintf(fdavx2b,"m11,m10 %d,%d\n",m11_cw2,m10_cw2); +#endif + beta0_2 = beta0-m11;//+M0T_TERM; + beta1_2 = beta0+m11;//+M1T_TERM; + beta2_2 = beta1+m10;//M2T_TERM; + beta3_2 = beta1-m10;//+M3T_TERM; + beta0_2_cw2 = beta0_cw2-m11_cw2;//+M0T_TERM; + beta1_2_cw2 = beta0_cw2+m11_cw2;//+M1T_TERM; + beta2_2_cw2 = beta1_cw2+m10_cw2;//M2T_TERM; + beta3_2_cw2 = beta1_cw2-m10_cw2;//+M3T_TERM; + + m11=(int16_t)m_11[frame_length<<1]; + m10=(int16_t)m_10[frame_length<<1]; + m11_cw2=(int16_t)m_11[(frame_length<<1)+8]; + m10_cw2=(int16_t)m_10[(frame_length<<1)+8]; +#ifdef DEBUG_LOGMAP + fprintf(fdavx2,"m11,m10 %d,%d\n",m11,m10); + fprintf(fdavx2b,"m11,m10 %d,%d\n",m11_cw2,m10_cw2); +#endif + beta0_16 = beta0_2-m11;//+M0T_TERM; + beta1_16 = beta0_2+m11;//+M1T_TERM; + beta2_16 = beta1_2+m10;//+M2T_TERM; + beta3_16 = beta1_2-m10;//+M3T_TERM; + beta4_16 = beta2_2-m10;//+M4T_TERM; + beta5_16 = beta2_2+m10;//+M5T_TERM; + beta6_16 = beta3_2+m11;//+M6T_TERM; + beta7_16 = beta3_2-m11;//+M7T_TERM; + + beta0_cw2_16 = beta0_2_cw2-m11_cw2;//+M0T_TERM; + beta1_cw2_16 = beta0_2_cw2+m11_cw2;//+M1T_TERM; + beta2_cw2_16 = beta1_2_cw2+m10_cw2;//+M2T_TERM; + beta3_cw2_16 = beta1_2_cw2-m10_cw2;//+M3T_TERM; + beta4_cw2_16 = beta2_2_cw2-m10_cw2;//+M4T_TERM; + beta5_cw2_16 = beta2_2_cw2+m10_cw2;//+M5T_TERM; + beta6_cw2_16 = beta3_2_cw2+m11_cw2;//+M6T_TERM; + beta7_cw2_16 = beta3_2_cw2-m11_cw2;//+M7T_TERM; + + + beta_m = (beta0_16>beta1_16) ? beta0_16 : beta1_16; + beta_m = (beta_m>beta2_16) ? beta_m : beta2_16; + beta_m = (beta_m>beta3_16) ? beta_m : beta3_16; + beta_m = (beta_m>beta4_16) ? beta_m : beta4_16; + beta_m = (beta_m>beta5_16) ? beta_m : beta5_16; + beta_m = (beta_m>beta6_16) ? beta_m : beta6_16; + beta_m = (beta_m>beta7_16) ? beta_m : beta7_16; + + beta_m_cw2 = (beta0_cw2_16>beta1_cw2_16) ? beta0_cw2_16 : beta1_cw2_16; + beta_m_cw2 = (beta_m_cw2>beta2_cw2_16) ? beta_m_cw2 : beta2_cw2_16; + beta_m_cw2 = (beta_m_cw2>beta3_cw2_16) ? beta_m_cw2 : beta3_cw2_16; + beta_m_cw2 = (beta_m_cw2>beta4_cw2_16) ? beta_m_cw2 : beta4_cw2_16; + beta_m_cw2 = (beta_m_cw2>beta5_cw2_16) ? beta_m_cw2 : beta5_cw2_16; + beta_m_cw2 = (beta_m_cw2>beta6_cw2_16) ? beta_m_cw2 : beta6_cw2_16; + beta_m_cw2 = (beta_m_cw2>beta7_cw2_16) ? beta_m_cw2 : beta7_cw2_16; + + + beta0_16=beta0_16-beta_m; + beta1_16=beta1_16-beta_m; + beta2_16=beta2_16-beta_m; + beta3_16=beta3_16-beta_m; + beta4_16=beta4_16-beta_m; + beta5_16=beta5_16-beta_m; + beta6_16=beta6_16-beta_m; + beta7_16=beta7_16-beta_m; + + beta0_cw2_16=beta0_cw2_16-beta_m_cw2; + beta1_cw2_16=beta1_cw2_16-beta_m_cw2; + beta2_cw2_16=beta2_cw2_16-beta_m_cw2; + beta3_cw2_16=beta3_cw2_16-beta_m_cw2; + beta4_cw2_16=beta4_cw2_16-beta_m_cw2; + beta5_cw2_16=beta5_cw2_16-beta_m_cw2; + beta6_cw2_16=beta6_cw2_16-beta_m_cw2; + beta7_cw2_16=beta7_cw2_16-beta_m_cw2; + + for (rerun_flag=0;; rerun_flag=1) { + + beta_ptr = (__m256i*)&beta[frame_length<<4]; + alpha128 = (__m256i*)&alpha[0]; + + if (rerun_flag == 0) { + beta_ptr[0] = alpha128[(frame_length)]; + beta_ptr[1] = alpha128[1+(frame_length)]; + beta_ptr[2] = alpha128[2+(frame_length)]; + beta_ptr[3] = alpha128[3+(frame_length)]; + beta_ptr[4] = alpha128[4+(frame_length)]; + beta_ptr[5] = alpha128[5+(frame_length)]; + beta_ptr[6] = alpha128[6+(frame_length)]; + beta_ptr[7] = alpha128[7+(frame_length)]; + +#ifdef DEBUG_LOGMAP + fprintf(fdavx2,"beta init \n"); + fprintf(fdavx2b,"beta init \n"); + print_shorts("b0",(int16_t*)&beta_ptr[0]); + print_shorts("b1",(int16_t*)&beta_ptr[1]); + print_shorts("b2",(int16_t*)&beta_ptr[2]); + print_shorts("b3",(int16_t*)&beta_ptr[3]); + print_shorts("b4",(int16_t*)&beta_ptr[4]); + print_shorts("b5",(int16_t*)&beta_ptr[5]); + print_shorts("b6",(int16_t*)&beta_ptr[6]); + print_shorts("b7",(int16_t*)&beta_ptr[7]); +#endif + } else { + + beta128 = (__m256i*)&beta[0]; + beta_ptr[0] = _mm256_srli_si256(beta128[0],2); + beta_ptr[1] = _mm256_srli_si256(beta128[1],2); + beta_ptr[2] = _mm256_srli_si256(beta128[2],2); + beta_ptr[3] = _mm256_srli_si256(beta128[3],2); + beta_ptr[4] = _mm256_srli_si256(beta128[4],2); + beta_ptr[5] = _mm256_srli_si256(beta128[5],2); + beta_ptr[6] = _mm256_srli_si256(beta128[6],2); + beta_ptr[7] = _mm256_srli_si256(beta128[7],2); +#ifdef DEBUG_LOGMAP + fprintf(fdavx2,"beta init (second run)\n"); + fprintf(fdavx2b,"beta init (second run)\n"); + print_shorts("b0",(int16_t*)&beta_ptr[0]); + print_shorts("b1",(int16_t*)&beta_ptr[1]); + print_shorts("b2",(int16_t*)&beta_ptr[2]); + print_shorts("b3",(int16_t*)&beta_ptr[3]); + print_shorts("b4",(int16_t*)&beta_ptr[4]); + print_shorts("b5",(int16_t*)&beta_ptr[5]); + print_shorts("b6",(int16_t*)&beta_ptr[6]); + print_shorts("b7",(int16_t*)&beta_ptr[7]); +#endif + } + + + beta_ptr[0] = _mm256_insert_epi16(beta_ptr[0],beta0_16,7); + beta_ptr[1] = _mm256_insert_epi16(beta_ptr[1],beta1_16,7); + beta_ptr[2] = _mm256_insert_epi16(beta_ptr[2],beta2_16,7); + beta_ptr[3] = _mm256_insert_epi16(beta_ptr[3],beta3_16,7); + beta_ptr[4] = _mm256_insert_epi16(beta_ptr[4],beta4_16,7); + beta_ptr[5] = _mm256_insert_epi16(beta_ptr[5],beta5_16,7); + beta_ptr[6] = _mm256_insert_epi16(beta_ptr[6],beta6_16,7); + beta_ptr[7] = _mm256_insert_epi16(beta_ptr[7],beta7_16,7); + + beta_ptr[0] = _mm256_insert_epi16(beta_ptr[0],beta0_cw2_16,15); + beta_ptr[1] = _mm256_insert_epi16(beta_ptr[1],beta1_cw2_16,15); + beta_ptr[2] = _mm256_insert_epi16(beta_ptr[2],beta2_cw2_16,15); + beta_ptr[3] = _mm256_insert_epi16(beta_ptr[3],beta3_cw2_16,15); + beta_ptr[4] = _mm256_insert_epi16(beta_ptr[4],beta4_cw2_16,15); + beta_ptr[5] = _mm256_insert_epi16(beta_ptr[5],beta5_cw2_16,15); + beta_ptr[6] = _mm256_insert_epi16(beta_ptr[6],beta6_cw2_16,15); + beta_ptr[7] = _mm256_insert_epi16(beta_ptr[7],beta7_cw2_16,15); + +#ifdef DEBUG_LOGMAP + fprintf(fdavx2,"beta init (after insert) \n"); + fprintf(fdavx2b,"beta init (after insert) \n"); + print_shorts("b0",(int16_t*)&beta_ptr[0]); + print_shorts("b1",(int16_t*)&beta_ptr[1]); + print_shorts("b2",(int16_t*)&beta_ptr[2]); + print_shorts("b3",(int16_t*)&beta_ptr[3]); + print_shorts("b4",(int16_t*)&beta_ptr[4]); + print_shorts("b5",(int16_t*)&beta_ptr[5]); + print_shorts("b6",(int16_t*)&beta_ptr[6]); + print_shorts("b7",(int16_t*)&beta_ptr[7]); +#endif + int loopval=((rerun_flag==0)?0:((frame_length-L)>>3)); + + printf("beta: rerun %d => loopval %d\n",rerun_flag,loopval); + + timein = rdtsc_oai(); + + m11p = (frame_length>>3)-1+(__m256i*)m_11; + m10p = (frame_length>>3)-1+(__m256i*)m_10; + + for (k=(frame_length>>3)-1; k>=loopval; k--) { + + + b4 = _mm256_load_si256(&beta_ptr[4]); + b5 = _mm256_load_si256(&beta_ptr[5]); + b6 = _mm256_load_si256(&beta_ptr[6]); + b7 = _mm256_load_si256(&beta_ptr[7]); + + m_b0 = _mm256_adds_epi16(b4,*m11p); //m11 + m_b1 = _mm256_subs_epi16(b4,*m11p); //m00 + m_b2 = _mm256_subs_epi16(b5,*m10p); //m01 + m_b3 = _mm256_adds_epi16(b5,*m10p); //m10 + m_b4 = _mm256_adds_epi16(b6,*m10p); //m10 + m_b5 = _mm256_subs_epi16(b6,*m10p); //m01 + m_b6 = _mm256_subs_epi16(b7,*m11p); //m00 + m_b7 = _mm256_adds_epi16(b7,*m11p); //m11 + + b0 = _mm256_load_si256(&beta_ptr[0]); + b1 = _mm256_load_si256(&beta_ptr[1]); + b2 = _mm256_load_si256(&beta_ptr[2]); + b3 = _mm256_load_si256(&beta_ptr[3]); + + new0 = _mm256_subs_epi16(b0,*m11p); //m00 + new1 = _mm256_adds_epi16(b0,*m11p); //m11 + new2 = _mm256_adds_epi16(b1,*m10p); //m10 + new3 = _mm256_subs_epi16(b1,*m10p); //m01 + new4 = _mm256_subs_epi16(b2,*m10p); //m01 + new5 = _mm256_adds_epi16(b2,*m10p); //m10 + new6 = _mm256_adds_epi16(b3,*m11p); //m11 + new7 = _mm256_subs_epi16(b3,*m11p); //m00 + + + b0 = _mm256_max_epi16(m_b0,new0); + b1 = _mm256_max_epi16(m_b1,new1); + b2 = _mm256_max_epi16(m_b2,new2); + b3 = _mm256_max_epi16(m_b3,new3); + b4 = _mm256_max_epi16(m_b4,new4); + b5 = _mm256_max_epi16(m_b5,new5); + b6 = _mm256_max_epi16(m_b6,new6); + b7 = _mm256_max_epi16(m_b7,new7); + + beta_max = _mm256_max_epi16(b0,b1); + beta_max = _mm256_max_epi16(beta_max ,b2); + beta_max = _mm256_max_epi16(beta_max ,b3); + beta_max = _mm256_max_epi16(beta_max ,b4); + beta_max = _mm256_max_epi16(beta_max ,b5); + beta_max = _mm256_max_epi16(beta_max ,b6); + beta_max = _mm256_max_epi16(beta_max ,b7); + + beta_ptr-=8; + m11p--; + m10p--; + + beta_ptr[0] = _mm256_subs_epi16(b0,beta_max); + beta_ptr[1] = _mm256_subs_epi16(b1,beta_max); + beta_ptr[2] = _mm256_subs_epi16(b2,beta_max); + beta_ptr[3] = _mm256_subs_epi16(b3,beta_max); + beta_ptr[4] = _mm256_subs_epi16(b4,beta_max); + beta_ptr[5] = _mm256_subs_epi16(b5,beta_max); + beta_ptr[6] = _mm256_subs_epi16(b6,beta_max); + beta_ptr[7] = _mm256_subs_epi16(b7,beta_max); + +#ifdef DEBUG_LOGMAP + fprintf(fdavx2,"Loop index %d, mb\n",k); + fprintf(fdavx2,"beta init (after max)\n"); + fprintf(fdavx2b,"Loop index %d, mb\n",k); + fprintf(fdavx2b,"beta init (after max)\n"); + + print_shorts("b0",(int16_t*)&beta_ptr[0]); + print_shorts("b1",(int16_t*)&beta_ptr[1]); + print_shorts("b2",(int16_t*)&beta_ptr[2]); + print_shorts("b3",(int16_t*)&beta_ptr[3]); + print_shorts("b4",(int16_t*)&beta_ptr[4]); + print_shorts("b5",(int16_t*)&beta_ptr[5]); + print_shorts("b6",(int16_t*)&beta_ptr[6]); + print_shorts("b7",(int16_t*)&beta_ptr[7]); + +#endif + } + timeout = rdtsc_oai(); + printf("beta: inner loop time %llu\n",timeout-timein); + + if (rerun_flag==1) + break; + } +} + +void compute_ext16avx2(llr_t* alpha,llr_t* beta,llr_t* m_11,llr_t* m_10,llr_t* ext, llr_t* systematic,uint16_t frame_length) +{ + + __m256i *alpha128=(__m256i *)alpha; + __m256i *beta128=(__m256i *)beta; + __m256i *m11_128,*m10_128,*ext_128; + __m256i *alpha_ptr,*beta_ptr; + __m256i m00_1,m00_2,m00_3,m00_4; + __m256i m01_1,m01_2,m01_3,m01_4; + __m256i m10_1,m10_2,m10_3,m10_4; + __m256i m11_1,m11_2,m11_3,m11_4; + + int k; + + // + // LLR computation, 8 consequtive bits per loop + // + +#ifdef DEBUG_LOGMAP + fprintf(fdavx2,"compute_ext (avx2_16bit), %p, %p, %p, %p, %p, %p ,framelength %d\n",alpha,beta,m_11,m_10,ext,systematic,frame_length); + fprintf(fdavx2b,"compute_ext (avx2_16bit), %p, %p, %p, %p, %p, %p ,framelength %d\n",alpha,beta,m_11,m_10,ext,systematic,frame_length); +#endif + + alpha_ptr = alpha128; + beta_ptr = &beta128[8]; + + + for (k=0; k<(frame_length>>3); k++) { + + + m11_128 = (__m256i*)&m_11[k<<4]; + m10_128 = (__m256i*)&m_10[k<<4]; + ext_128 = (__m256i*)&ext[k<<4]; + + /* + fprintf(fdavx2,"EXT %03d\n",k); + print_shorts("a0:",&alpha_ptr[0]); + print_shorts("a1:",&alpha_ptr[1]); + print_shorts("a2:",&alpha_ptr[2]); + print_shorts("a3:",&alpha_ptr[3]); + print_shorts("a4:",&alpha_ptr[4]); + print_shorts("a5:",&alpha_ptr[5]); + print_shorts("a6:",&alpha_ptr[6]); + print_shorts("a7:",&alpha_ptr[7]); + print_shorts("b0:",&beta_ptr[0]); + print_shorts("b1:",&beta_ptr[1]); + print_shorts("b2:",&beta_ptr[2]); + print_shorts("b3:",&beta_ptr[3]); + print_shorts("b4:",&beta_ptr[4]); + print_shorts("b5:",&beta_ptr[5]); + print_shorts("b6:",&beta_ptr[6]); + print_shorts("b7:",&beta_ptr[7]); + */ + m00_4 = _mm256_adds_epi16(alpha_ptr[7],beta_ptr[3]); //ALPHA_BETA_4m00; + m11_4 = _mm256_adds_epi16(alpha_ptr[7],beta_ptr[7]); //ALPHA_BETA_4m11; + m00_3 = _mm256_adds_epi16(alpha_ptr[6],beta_ptr[7]); //ALPHA_BETA_3m00; + m11_3 = _mm256_adds_epi16(alpha_ptr[6],beta_ptr[3]); //ALPHA_BETA_3m11; + m00_2 = _mm256_adds_epi16(alpha_ptr[1],beta_ptr[4]); //ALPHA_BETA_2m00; + m11_2 = _mm256_adds_epi16(alpha_ptr[1],beta_ptr[0]); //ALPHA_BETA_2m11; + m11_1 = _mm256_adds_epi16(alpha_ptr[0],beta_ptr[4]); //ALPHA_BETA_1m11; + m00_1 = _mm256_adds_epi16(alpha_ptr[0],beta_ptr[0]); //ALPHA_BETA_1m00; + m01_4 = _mm256_adds_epi16(alpha_ptr[5],beta_ptr[6]); //ALPHA_BETA_4m01; + m10_4 = _mm256_adds_epi16(alpha_ptr[5],beta_ptr[2]); //ALPHA_BETA_4m10; + m01_3 = _mm256_adds_epi16(alpha_ptr[4],beta_ptr[2]); //ALPHA_BETA_3m01; + m10_3 = _mm256_adds_epi16(alpha_ptr[4],beta_ptr[6]); //ALPHA_BETA_3m10; + m01_2 = _mm256_adds_epi16(alpha_ptr[3],beta_ptr[1]); //ALPHA_BETA_2m01; + m10_2 = _mm256_adds_epi16(alpha_ptr[3],beta_ptr[5]); //ALPHA_BETA_2m10; + m10_1 = _mm256_adds_epi16(alpha_ptr[2],beta_ptr[1]); //ALPHA_BETA_1m10; + m01_1 = _mm256_adds_epi16(alpha_ptr[2],beta_ptr[5]); //ALPHA_BETA_1m01; + /* + print_shorts("m11_1:",&m11_1); + print_shorts("m11_2:",&m11_2); + print_shorts("m11_3:",&m11_3); + print_shorts("m11_4:",&m11_4); + print_shorts("m00_1:",&m00_1); + print_shorts("m00_2:",&m00_2); + print_shorts("m00_3:",&m00_3); + print_shorts("m00_4:",&m00_4); + print_shorts("m10_1:",&m10_1); + print_shorts("m10_2:",&m10_2); + print_shorts("m10_3:",&m10_3); + print_shorts("m10_4:",&m10_4); + print_shorts("m01_1:",&m01_1); + print_shorts("m01_2:",&m01_2); + print_shorts("m01_3:",&m01_3); + print_shorts("m01_4:",&m01_4); + */ + m01_1 = _mm256_max_epi16(m01_1,m01_2); + m01_1 = _mm256_max_epi16(m01_1,m01_3); + m01_1 = _mm256_max_epi16(m01_1,m01_4); + m00_1 = _mm256_max_epi16(m00_1,m00_2); + m00_1 = _mm256_max_epi16(m00_1,m00_3); + m00_1 = _mm256_max_epi16(m00_1,m00_4); + m10_1 = _mm256_max_epi16(m10_1,m10_2); + m10_1 = _mm256_max_epi16(m10_1,m10_3); + m10_1 = _mm256_max_epi16(m10_1,m10_4); + m11_1 = _mm256_max_epi16(m11_1,m11_2); + m11_1 = _mm256_max_epi16(m11_1,m11_3); + m11_1 = _mm256_max_epi16(m11_1,m11_4); + + // print_shorts("m11_1:",&m11_1); + + m01_1 = _mm256_subs_epi16(m01_1,*m10_128); + m00_1 = _mm256_subs_epi16(m00_1,*m11_128); + m10_1 = _mm256_adds_epi16(m10_1,*m10_128); + m11_1 = _mm256_adds_epi16(m11_1,*m11_128); + + // print_shorts("m10_1:",&m10_1); + // print_shorts("m11_1:",&m11_1); + m01_1 = _mm256_max_epi16(m01_1,m00_1); + m10_1 = _mm256_max_epi16(m10_1,m11_1); + // print_shorts("m01_1:",&m01_1); + // print_shorts("m10_1:",&m10_1); + + *ext_128 = _mm256_subs_epi16(m10_1,m01_1); + +#ifdef DEBUG_LOGMAP + fprintf(fdavx2,"ext %p\n",ext_128); + fprintf(fdavx2b,"ext %p\n",ext_128); + print_shorts("ext:",(int16_t*)ext_128); + print_shorts("m11:",(int16_t*)m11_128); + print_shorts("m10:",(int16_t*)m10_128); + print_shorts("m10_1:",(int16_t*)&m10_1); + print_shorts("m01_1:",(int16_t*)&m01_1); + + +#endif + + alpha_ptr+=8; + beta_ptr+=8; + } +} + + + +//int pi2[n],pi3[n+8],pi5[n+8],pi4[n+8],pi6[n+8], +int *pi2tab16avx2[188],*pi5tab16avx2[188],*pi4tab16avx2[188],*pi6tab16avx2[188]; + +void free_td16avx2(void) +{ + int ind; + + for (ind=0; ind<188; ind++) { + free(pi2tab16avx2[ind]); + free(pi5tab16avx2[ind]); + free(pi4tab16avx2[ind]); + free(pi6tab16avx2[ind]); + } +} + +void init_td16avx2() +{ + + int ind,i,i2,i3,j,n,pi,pi2_i,pi2_pi; + short * base_interleaver; + + for (ind=0; ind<188; ind++) { + n = f1f2mat[ind].nb_bits; + base_interleaver=il_tb+f1f2mat[ind].beg_index; +#ifdef MEX + // This is needed for the Mex implementation to make the memory persistent + pi2tab16[ind] = mxMalloc((n+8)*sizeof(int)); + pi5tab16[ind] = mxMalloc((n+8)*sizeof(int)); + pi4tab16[ind] = mxMalloc((n+8)*sizeof(int)); + pi6tab16[ind] = mxMalloc((n+8)*sizeof(int)); +#else + pi2tab16avx2[ind] = malloc((n+8)*sizeof(int)); + pi5tab16avx2[ind] = malloc((n+8)*sizeof(int)); + pi4tab16avx2[ind] = malloc((n+8)*sizeof(int)); + pi6tab16avx2[ind] = malloc((n+8)*sizeof(int)); +#endif + + // fprintf(fdavx2,"Interleaver index %d\n",ind); + for (i=i2=0; i2<8; i2++) { + j=i2; + + for (i3=0; i3<(n>>3); i3++,i++,j+=8) { + + // if (j>=n) + // j-=(n-1); + + pi2tab16avx2[ind][i] = ((j>>3)<<4) + (j&7); // 16*floor(j/8) + j mod8, which allows the second codeword to be in pi[i] + 8 + // fprintf(fdavx2,"pi2[%d] = %d(%d)\n",i, pi2tab16avx2[ind][i],j); + } + } + + for (i=0; i<n; i++) { + pi = base_interleaver[i];//(uint32_t)threegpplte_interleaver(f1,f2,n); + pi2_i = ((pi2tab16avx2[ind][i]>>4)<<3)+(pi2tab16avx2[ind][i]&7); + pi2_pi = ((pi2tab16avx2[ind][pi]>>4)<<3)+(pi2tab16avx2[ind][pi]&7); + pi4tab16avx2[ind][pi2_i] = pi2tab16avx2[ind][pi]; + pi5tab16avx2[ind][pi2_pi] = pi2tab16avx2[ind][i]; + pi6tab16avx2[ind][pi] = pi2tab16avx2[ind][i]; + } + + } +} + +unsigned char phy_threegpplte_turbo_decoder16avx2(int16_t *y, + int16_t *y2, + uint8_t *decoded_bytes, + uint8_t *decoded_bytes2, + uint16_t n, + uint16_t f1, + uint16_t f2, + uint8_t max_iterations, + uint8_t crc_type, + uint8_t F, + time_stats_t *init_stats, + time_stats_t *alpha_stats, + time_stats_t *beta_stats, + time_stats_t *gamma_stats, + time_stats_t *ext_stats, + time_stats_t *intl1_stats, + time_stats_t *intl2_stats) +{ + + /* y is a pointer to the input + decoded_bytes is a pointer to the decoded output + n is the size in bits of the coded block, with the tail */ + + + llr_t systematic0[2*(n+16)] __attribute__ ((aligned(32))); + llr_t systematic1[2*(n+16)] __attribute__ ((aligned(32))); + llr_t systematic2[2*(n+16)] __attribute__ ((aligned(32))); + llr_t yparity1[2*(n+16)] __attribute__ ((aligned(32))); + llr_t yparity2[2*(n+16)] __attribute__ ((aligned(32))); + + llr_t ext[2*(n+128)] __attribute__((aligned(32))); + llr_t ext2[2*(n+128)] __attribute__((aligned(32))); + + llr_t alpha[(n+16)*16] __attribute__ ((aligned(32))); + llr_t beta[(n+16)*16] __attribute__ ((aligned(32))); + llr_t m11[2*(n+16)] __attribute__ ((aligned(32))); + llr_t m10[2*(n+16)] __attribute__ ((aligned(32))); + + + int *pi2_p,*pi4_p,*pi5_p,*pi6_p; + llr_t *s,*s1,*s2,*yp1,*yp2,*yp,*yp_cw2; + uint32_t i,j,iind;//,pi; + uint8_t iteration_cnt=0; + uint32_t crc,oldcrc,crc_cw2,oldcrc_cw2,crc_len; + uint8_t temp; + uint32_t db; + + + __m256i tmp, zeros=_mm256_setzero_si256(); + + + int offset8_flag=0; + +#ifdef DEBUG_LOGMAP + fdavx2 = fopen("dump_avx2.txt","w"); + fdavx2b = fopen("dump_avx2b.txt","w"); + + printf("tc avx2_16 (y,y2) %p,%p\n",y,y2); +#endif + if (crc_type > 3) { + printf("Illegal crc length!\n"); + return 255; + } + + + start_meas(init_stats); + + + + for (iind=0; iind < 188 && f1f2mat[iind].nb_bits != n; iind++); + + if ( iind == 188 ) { + printf("Illegal frame length!\n"); + return 255; + } + + switch (crc_type) { + case CRC24_A: + case CRC24_B: + crc_len=3; + break; + + case CRC16: + crc_len=2; + break; + + case CRC8: + crc_len=1; + break; + + default: + crc_len=3; + } + + + s = systematic0; + s1 = systematic1; + s2 = systematic2; + yp1 = yparity1; + yp2 = yparity2; + + +#if 0 + __m128i *yp128,*yp128_cw2; + __m128i tmpe,tmpe_cw2; + yp128 = (__m128i*)y; + yp128_cw2 = (__m128i*)y2; + + + + for (i=0; i<n; i+=8) { + pi2_p = &pi2tab16avx2[iind][i]; + + j=pi2_p[0]; + + + tmpe = _mm_load_si128(yp128); + tmpe_cw2 = _mm_load_si128(yp128_cw2); + // fprintf(fdavx2,"yp128 %p\n",yp128); + // print_shorts("tmpe",(int16_t*)&tmpe); + + s[j] = _mm_extract_epi16(tmpe,0); + yp1[j] = _mm_extract_epi16(tmpe,1); + yp2[j] = _mm_extract_epi16(tmpe,2); + s[j+8] = _mm_extract_epi16(tmpe_cw2,0); + yp1[j+8] = _mm_extract_epi16(tmpe_cw2,1); + yp2[j+8] = _mm_extract_epi16(tmpe_cw2,2); + +#ifdef DEBUG_LOGMAP + fprintf(fdavx2,"init0: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",((j>>4)<<3)+(j&7),s[j],yp1[j],yp2[j]); + fprintf(fdavx2b,"init0: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",((j>>4)<<3)+(j&7),s[j+8],yp1[j+8],yp2[j+8]); +#endif + + j=pi2_p[1]; + + s[j] = _mm_extract_epi16(tmpe,3); + yp1[j] = _mm_extract_epi16(tmpe,4); + yp2[j] = _mm_extract_epi16(tmpe,5); + s[j+8] = _mm_extract_epi16(tmpe_cw2,3); + yp1[j+8] = _mm_extract_epi16(tmpe_cw2,4); + yp2[j+8] = _mm_extract_epi16(tmpe_cw2,5); +#ifdef DEBUG_LOGMAP + fprintf(fdavx2,"init1: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",((j>>4)<<3)+(j&7),s[j],yp1[j],yp2[j]); + fprintf(fdavx2b,"init1: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",((j>>4)<<3)+(j&7),s[j+8],yp1[j+8],yp2[j+8]); +#endif + j=pi2_p[2]; + + s[j] = _mm_extract_epi16(tmpe,6); + yp1[j] = _mm_extract_epi16(tmpe,7); + tmpe = _mm_load_si128(&yp128[1]); + yp2[j] = _mm_extract_epi16(tmpe,0); + s[j+8] = _mm_extract_epi16(tmpe_cw2,6); + yp1[j+8] = _mm_extract_epi16(tmpe_cw2,7); + tmpe_cw2 = _mm_load_si128(&yp128_cw2[1]); + yp2[j+8] = _mm_extract_epi16(tmpe_cw2,0); +#ifdef DEBUG_LOGMAP + fprintf(fdavx2,"init2: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",((j>>4)<<3)+(j&7),s[j],yp1[j],yp2[j]); + fprintf(fdavx2b,"init2: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",((j>>4)<<3)+(j&7),s[j+8],yp1[j+8],yp2[j+8]); +#endif + j=pi2_p[3]; + + s[j] = _mm_extract_epi16(tmpe,1); + yp1[j] = _mm_extract_epi16(tmpe,2); + yp2[j] = _mm_extract_epi16(tmpe,3); + s[j+8] = _mm_extract_epi16(tmpe_cw2,1); + yp1[j+8] = _mm_extract_epi16(tmpe_cw2,2); + yp2[j+8] = _mm_extract_epi16(tmpe_cw2,3); +#ifdef DEBUG_LOGMAP + fprintf(fdavx2,"init3: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",((j>>4)<<3)+(j&7),s[j],yp1[j],yp2[j]); + fprintf(fdavx2b,"init3: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",((j>>4)<<3)+(j&7),s[j+8],yp1[j+8],yp2[j+8]); +#endif + j=pi2_p[4]; + + s[j] = _mm_extract_epi16(tmpe,4); + yp1[j] = _mm_extract_epi16(tmpe,5); + yp2[j] = _mm_extract_epi16(tmpe,6); + s[j+8] = _mm_extract_epi16(tmpe_cw2,4); + yp1[j+8] = _mm_extract_epi16(tmpe_cw2,5); + yp2[j+8] = _mm_extract_epi16(tmpe_cw2,6); +#ifdef DEBUG_LOGMAP + fprintf(fdavx2,"init4: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",((j>>4)<<3)+(j&7),s[j],yp1[j],yp2[j]); + fprintf(fdavx2b,"init4: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",((j>>4)<<3)+(j&7),s[j+8],yp1[j+8],yp2[j+8]); +#endif + j=pi2_p[5]; + + s[j] = _mm_extract_epi16(tmpe,7); + tmpe = _mm_load_si128(&yp128[2]); + yp1[j] = _mm_extract_epi16(tmpe,0); + yp2[j] = _mm_extract_epi16(tmpe,1); + s[j+8] = _mm_extract_epi16(tmpe_cw2,7); + tmpe_cw2 = _mm_load_si128(&yp128_cw2[2]); + yp1[j+8] = _mm_extract_epi16(tmpe_cw2,0); + yp2[j+8] = _mm_extract_epi16(tmpe_cw2,1); +#ifdef DEBUG_LOGMAP + fprintf(fdavx2,"init5: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",((j>>4)<<3)+(j&7),s[j],yp1[j],yp2[j]); + fprintf(fdavx2b,"init5: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",((j>>4)<<3)+(j&7),s[j+8],yp1[j+8],yp2[j+8]); +#endif + j=pi2_p[6]; + + s[j] = _mm_extract_epi16(tmpe,2); + yp1[j] = _mm_extract_epi16(tmpe,3); + yp2[j] = _mm_extract_epi16(tmpe,4); + s[j+8] = _mm_extract_epi16(tmpe_cw2,2); + yp1[j+8] = _mm_extract_epi16(tmpe_cw2,3); + yp2[j+8] = _mm_extract_epi16(tmpe_cw2,4); +#ifdef DEBUG_LOGMAP + fprintf(fdavx2,"init6: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",((j>>4)<<3)+(j&7),s[j],yp1[j],yp2[j]); + fprintf(fdavx2b,"init6: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",((j>>4)<<3)+(j&7),s[j+8],yp1[j+8],yp2[j+8]); +#endif + j=pi2_p[7]; + + s[j] = _mm_extract_epi16(tmpe,5); + yp1[j] = _mm_extract_epi16(tmpe,6); + yp2[j] = _mm_extract_epi16(tmpe,7); + s[j+8] = _mm_extract_epi16(tmpe_cw2,5); + yp1[j+8] = _mm_extract_epi16(tmpe_cw2,6); + yp2[j+8] = _mm_extract_epi16(tmpe_cw2,7); +#ifdef DEBUG_LOGMAP + fprintf(fdavx2,"init7: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",((j>>4)<<3)+(j&7),s[j],yp1[j],yp2[j]); + fprintf(fdavx2b,"init7: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",((j>>4)<<3)+(j&7),s[j+8],yp1[j+8],yp2[j+8]); +#endif + yp128+=3; + yp128_cw2+=3; + + } + yp=(llr_t*)yp128; + yp_cw2=(llr_t*)yp128_cw2; +#else + + pi2_p = &pi2tab16avx2[iind][0]; + for (i=0,j=0; i<n; i++) { + s[*pi2_p] = y[j]; + s[*pi2_p+8] = y2[j++]; + yp1[*pi2_p] = y[j]; + yp1[*pi2_p+8] = y2[j++]; + yp2[*pi2_p] = y[j]; + yp2[(*pi2_p++)+8] = y2[j++]; + } + yp=(llr_t*)&y[j]; + yp_cw2=(llr_t*)&y2[j]; +#endif + + + // Termination + for (i=0; i<3; i++) { + s[(n<<1)+i] = *yp; + s1[(n<<1)+i] = *yp; + s2[(n<<1)+i] = *yp; + yp++; + yp1[(n<<1)+i] = *yp; + yp++; + + s[(n<<1)+i+8] = *yp_cw2; + s1[(n<<1)+i+8] = *yp_cw2; + s2[(n<<1)+i+8] = *yp_cw2; + yp_cw2++; + yp1[(n<<1)+i+8] = *yp_cw2; + yp_cw2++; +#ifdef DEBUG_LOGMAP + fprintf(fdavx2,"Term 1 (%d): %d %d\n",n+i,s[(n<<1)+i],yp1[(n<<1)+i]); + fprintf(fdavx2b,"Term 1 (%d): %d %d\n",n+i,s[(n<<1)+i+8],yp1[(n<<1)+i+8]); +#endif //DEBUG_LOGMAP + } + + for (i=16; i<19; i++) { + s[(n<<1)+i] = *yp; + s1[(n<<1)+i] = *yp; + s2[(n<<1)+i] = *yp; + yp++; + yp2[(n<<1)+(i-16)] = *yp; + yp++; + + s[(n<<1)+i+8]= *yp_cw2; + s1[(n<<1)+i+8] = *yp_cw2 ; + s2[(n<<1)+i+8] = *yp_cw2; + yp_cw2++; + yp2[(n<<1)+i-16+8] = *yp_cw2; + yp_cw2++; +#ifdef DEBUG_LOGMAP + fprintf(fdavx2,"Term 2 (%d): %d %d\n",n+i-3-8,s[(n<<1)+i],yp2[(n<<1)+i-16]); + fprintf(fdavx2b,"Term 2 (%d): %d %d\n",n+i-3-8,s[(n<<1)+i+8],yp2[(n<<1)+i-16+8]); +#endif //DEBUG_LOGMAP + } + +#ifdef DEBUG_LOGMAP + fprintf(fdavx2,"\n"); + fprintf(fdavx2b,"\n"); +#endif //DEBUG_LOGMAP + + stop_meas(init_stats); + + // do log_map from first parity bit + + log_map16avx2(systematic0,yparity1,m11,m10,alpha,beta,ext,n,0,F,offset8_flag,alpha_stats,beta_stats,gamma_stats,ext_stats); + + while (iteration_cnt++ < max_iterations) { + +#ifdef DEBUG_LOGMAP + fprintf(fdavx2,"\n*******************ITERATION %d (n %d), ext %p\n\n",iteration_cnt,n,ext); + fprintf(fdavx2b,"\n*******************ITERATION %d (n %d), ext %p\n\n",iteration_cnt,n,ext); +#endif //DEBUG_LOGMAP + + start_meas(intl1_stats); + + pi4_p=pi4tab16avx2[iind]; + + for (i=0; i<(n>>3); i++) { // steady-state portion + + ((__m256i *)systematic2)[i]=_mm256_insert_epi16(((__m256i *)systematic2)[i],ext[*pi4_p],0); + ((__m256i *)systematic2)[i]=_mm256_insert_epi16(((__m256i *)systematic2)[i],ext[8+*pi4_p++],8); + ((__m256i *)systematic2)[i]=_mm256_insert_epi16(((__m256i *)systematic2)[i],ext[*pi4_p],1); + ((__m256i *)systematic2)[i]=_mm256_insert_epi16(((__m256i *)systematic2)[i],ext[8+*pi4_p++],9); + ((__m256i *)systematic2)[i]=_mm256_insert_epi16(((__m256i *)systematic2)[i],ext[*pi4_p],2); + ((__m256i *)systematic2)[i]=_mm256_insert_epi16(((__m256i *)systematic2)[i],ext[8+*pi4_p++],10); + ((__m256i *)systematic2)[i]=_mm256_insert_epi16(((__m256i *)systematic2)[i],ext[*pi4_p],3); + ((__m256i *)systematic2)[i]=_mm256_insert_epi16(((__m256i *)systematic2)[i],ext[8+*pi4_p++],11); + ((__m256i *)systematic2)[i]=_mm256_insert_epi16(((__m256i *)systematic2)[i],ext[*pi4_p],4); + ((__m256i *)systematic2)[i]=_mm256_insert_epi16(((__m256i *)systematic2)[i],ext[8+*pi4_p++],12); + ((__m256i *)systematic2)[i]=_mm256_insert_epi16(((__m256i *)systematic2)[i],ext[*pi4_p],5); + ((__m256i *)systematic2)[i]=_mm256_insert_epi16(((__m256i *)systematic2)[i],ext[8+*pi4_p++],13); + ((__m256i *)systematic2)[i]=_mm256_insert_epi16(((__m256i *)systematic2)[i],ext[*pi4_p],6); + ((__m256i *)systematic2)[i]=_mm256_insert_epi16(((__m256i *)systematic2)[i],ext[8+*pi4_p++],14); + ((__m256i *)systematic2)[i]=_mm256_insert_epi16(((__m256i *)systematic2)[i],ext[*pi4_p],7); + ((__m256i *)systematic2)[i]=_mm256_insert_epi16(((__m256i *)systematic2)[i],ext[8+*pi4_p++],15); +#ifdef DEBUG_LOGMAP + print_shorts("syst2",(int16_t*)&((__m256i *)systematic2)[i]); +#endif + } + + stop_meas(intl1_stats); + + // do log_map from second parity bit + + log_map16avx2(systematic2,yparity2,m11,m10,alpha,beta,ext2,n,1,F,offset8_flag,alpha_stats,beta_stats,gamma_stats,ext_stats); + + + + pi5_p=pi5tab16avx2[iind]; + + for (i=0; i<(n>>3); i++) { + + tmp=_mm256_insert_epi16(tmp,ext2[*pi5_p],0); + tmp=_mm256_insert_epi16(tmp,ext2[8+*pi5_p++],8); + tmp=_mm256_insert_epi16(tmp,ext2[*pi5_p],1); + tmp=_mm256_insert_epi16(tmp,ext2[8+*pi5_p++],9); + tmp=_mm256_insert_epi16(tmp,ext2[*pi5_p],2); + tmp=_mm256_insert_epi16(tmp,ext2[8+*pi5_p++],10); + tmp=_mm256_insert_epi16(tmp,ext2[*pi5_p],3); + tmp=_mm256_insert_epi16(tmp,ext2[8+*pi5_p++],11); + tmp=_mm256_insert_epi16(tmp,ext2[*pi5_p],4); + tmp=_mm256_insert_epi16(tmp,ext2[8+*pi5_p++],12); + tmp=_mm256_insert_epi16(tmp,ext2[*pi5_p],5); + tmp=_mm256_insert_epi16(tmp,ext2[8+*pi5_p++],13); + tmp=_mm256_insert_epi16(tmp,ext2[*pi5_p],6); + tmp=_mm256_insert_epi16(tmp,ext2[8+*pi5_p++],14); + tmp=_mm256_insert_epi16(tmp,ext2[*pi5_p],7); + tmp=_mm256_insert_epi16(tmp,ext2[8+*pi5_p++],15); + ((__m256i *)systematic1)[i] = _mm256_adds_epi16(_mm256_subs_epi16(tmp,((__m256i*)ext)[i]),((__m256i *)systematic0)[i]); +#ifdef DEBUG_LOGMAP + print_shorts("syst1",(int16_t*)&((__m256i *)systematic1)[i]); +#endif + } + + if (iteration_cnt>1) { + start_meas(intl2_stats); + pi6_p=pi6tab16avx2[iind]; + + for (i=0; i<(n>>3); i++) { + + tmp=_mm256_insert_epi16(tmp, ((llr_t*)ext2)[*pi6_p],7); + tmp=_mm256_insert_epi16(tmp, ((llr_t*)ext2)[8+*pi6_p++],15); + tmp=_mm256_insert_epi16(tmp, ((llr_t*)ext2)[*pi6_p],6); + tmp=_mm256_insert_epi16(tmp, ((llr_t*)ext2)[8+*pi6_p++],14); + tmp=_mm256_insert_epi16(tmp, ((llr_t*)ext2)[*pi6_p],5); + tmp=_mm256_insert_epi16(tmp, ((llr_t*)ext2)[8+*pi6_p++],13); + tmp=_mm256_insert_epi16(tmp, ((llr_t*)ext2)[*pi6_p],4); + tmp=_mm256_insert_epi16(tmp, ((llr_t*)ext2)[8+*pi6_p++],12); + tmp=_mm256_insert_epi16(tmp, ((llr_t*)ext2)[*pi6_p],3); + tmp=_mm256_insert_epi16(tmp, ((llr_t*)ext2)[8+*pi6_p++],11); + tmp=_mm256_insert_epi16(tmp, ((llr_t*)ext2)[*pi6_p],2); + tmp=_mm256_insert_epi16(tmp, ((llr_t*)ext2)[8+*pi6_p++],10); + tmp=_mm256_insert_epi16(tmp, ((llr_t*)ext2)[*pi6_p],1); + tmp=_mm256_insert_epi16(tmp, ((llr_t*)ext2)[8+*pi6_p++],9); + tmp=_mm256_insert_epi16(tmp, ((llr_t*)ext2)[*pi6_p],0); + tmp=_mm256_insert_epi16(tmp, ((llr_t*)ext2)[8+*pi6_p++],8); +#ifdef DEBUG_LOGMAP + print_shorts("tmp",(int16_t*)&tmp); +#endif + tmp=_mm256_cmpgt_epi8(_mm256_packs_epi16(tmp,zeros),zeros); + db=(uint32_t)_mm256_movemask_epi8(tmp); + decoded_bytes[i]=db&0xff; + decoded_bytes2[i]=(uint8_t)(db>>16)&0xff; +#ifdef DEBUG_LOGMAP + print_shorts("tmp",(int16_t*)&tmp); + fprintf(fdavx2,"decoded_bytes[%d] %x (%x)\n",i,decoded_bytes[i],db); + fprintf(fdavx2b,"decoded_bytes[%d] %x (%x)\n",i,decoded_bytes2[i],db); +#endif + } + } + + // check status on output + if (iteration_cnt>1) { + oldcrc= *((uint32_t *)(&decoded_bytes[(n>>3)-crc_len])); + + switch (crc_type) { + + case CRC24_A: + oldcrc&=0x00ffffff; + crc = crc24a(&decoded_bytes[F>>3], + n-24-F)>>8; + temp=((uint8_t *)&crc)[2]; + ((uint8_t *)&crc)[2] = ((uint8_t *)&crc)[0]; + ((uint8_t *)&crc)[0] = temp; + break; + + case CRC24_B: + oldcrc&=0x00ffffff; + crc = crc24b(decoded_bytes, + n-24)>>8; + temp=((uint8_t *)&crc)[2]; + ((uint8_t *)&crc)[2] = ((uint8_t *)&crc)[0]; + ((uint8_t *)&crc)[0] = temp; + break; + + case CRC16: + oldcrc&=0x0000ffff; + crc = crc16(decoded_bytes, + n-16)>>16; + break; + + case CRC8: + oldcrc&=0x000000ff; + crc = crc8(decoded_bytes, + n-8)>>24; + break; + + default: + printf("FATAL: 3gpplte_turbo_decoder_sse.c: Unknown CRC\n"); + return(255); + break; + } + + // second CW + oldcrc_cw2= *((uint32_t *)(&decoded_bytes2[(n>>3)-crc_len])); + + switch (crc_type) { + + case CRC24_A: + oldcrc_cw2&=0x00ffffff; + crc_cw2 = crc24a(&decoded_bytes2[F>>3], + n-24-F)>>8; + temp=((uint8_t *)&crc_cw2)[2]; + ((uint8_t *)&crc_cw2)[2] = ((uint8_t *)&crc_cw2)[0]; + ((uint8_t *)&crc_cw2)[0] = temp; + break; + + case CRC24_B: + oldcrc_cw2&=0x00ffffff; + crc_cw2 = crc24b(decoded_bytes2, + n-24)>>8; + temp=((uint8_t *)&crc_cw2)[2]; + ((uint8_t *)&crc_cw2)[2] = ((uint8_t *)&crc_cw2)[0]; + ((uint8_t *)&crc_cw2)[0] = temp; + break; + + case CRC16: + oldcrc_cw2&=0x0000ffff; + crc_cw2 = crc16(decoded_bytes2, + n-16)>>16; + break; + + case CRC8: + oldcrc_cw2&=0x000000ff; + crc_cw2 = crc8(decoded_bytes2, + n-8)>>24; + break; + + default: + printf("FATAL: 3gpplte_turbo_decoder_sse.c: Unknown CRC\n"); + return(255); + break; + } + + stop_meas(intl2_stats); + +#ifdef DEBUG_LOGMAP + fprintf(fdavx2,"oldcrc %x, crc %x, oldcrc_cw2 %x, crc_cw2 %x\n",oldcrc,crc,oldcrc_cw2,crc_cw2); + fprintf(fdavx2b,"oldcrc %x, crc %x, oldcrc_cw2 %x, crc_cw2 %x\n",oldcrc,crc,oldcrc_cw2,crc_cw2); +#endif + + if ((crc == oldcrc) && (crc!=0) && (crc_cw2 == oldcrc_cw2) && (crc_cw2!=0)) { + return(iteration_cnt); + } + } + + // do log_map from first parity bit + if (iteration_cnt < max_iterations) { + log_map16avx2(systematic1,yparity1,m11,m10,alpha,beta,ext,n,0,F,offset8_flag,alpha_stats,beta_stats,gamma_stats,ext_stats); + + __m256i* ext_128=(__m256i*) ext; + __m256i* s1_128=(__m256i*) systematic1; + __m256i* s0_128=(__m256i*) systematic0; + int myloop=n>>3; + + for (i=0; i<myloop; i++) { + + *ext_128=_mm256_adds_epi16(_mm256_subs_epi16(*ext_128,*s1_128++),*s0_128++); + ext_128++; + } + } + } + + // fprintf(fdavx2,"crc %x, oldcrc %x\n",crc,oldcrc); + + + _mm_empty(); + _m_empty(); + +#ifdef DEBUG_LOGMAP + fclose(fdavx2); +#endif + return(iteration_cnt); +} + +#endif //__AVX2__ + + diff --git a/openair1/PHY/CODING/3gpplte_turbo_decoder_sse_16bit.c b/openair1/PHY/CODING/3gpplte_turbo_decoder_sse_16bit.c index 702aee86567e5ec1e5ae47ac7c3c6bb5eed5e1f5..ab7d19407e4a3058510a60b5d8cf9d74268033d5 100644 --- a/openair1/PHY/CODING/3gpplte_turbo_decoder_sse_16bit.c +++ b/openair1/PHY/CODING/3gpplte_turbo_decoder_sse_16bit.c @@ -63,11 +63,17 @@ #include "mex.h" #endif +//#define DEBUG_LOGMAP -#define print_shorts(s,x) printf("%s %d,%d,%d,%d,%d,%d,%d,%d\n",s,(x)[0],(x)[1],(x)[2],(x)[3],(x)[4],(x)[5],(x)[6],(x)[7]) +#ifdef DEBUG_LOGMAP +#define print_shorts(s,x) fprintf(fdsse4,"%s %d,%d,%d,%d,%d,%d,%d,%d\n",s,(x)[0],(x)[1],(x)[2],(x)[3],(x)[4],(x)[5],(x)[6],(x)[7]) +#endif -//#define DEBUG_LOGMAP +#undef __AVX2__ +#ifdef DEBUG_LOGMAP +FILE *fdsse4; +#endif typedef int16_t llr_t; // internal decoder LLR data is 16-bit fixed typedef int16_t channel_t; @@ -99,7 +105,7 @@ void log_map16(llr_t* systematic, { #ifdef DEBUG_LOGMAP - msg("log_map, frame_length %d\n",frame_length); + fprintf(fdsse4,"log_map, frame_length %d\n",frame_length); #endif start_meas(gamma_stats) ; @@ -135,22 +141,35 @@ void compute_gamma16(llr_t* m11,llr_t* m10,llr_t* systematic,channel_t* y_parity #endif #ifdef DEBUG_LOGMAP - msg("compute_gamma, %p,%p,%p,%p,framelength %d\n",m11,m10,systematic,y_parity,frame_length); + fprintf(fdsse4,"compute_gamma (sse_16bit), %p,%p,%p,%p,framelength %d\n",m11,m10,systematic,y_parity,frame_length); #endif +#ifndef __AVX2__ K1=frame_length>>3; +#else + if ((frame_length&15) > 0) + K1=(frame_length+1)>>4; + else + K1=frame_length>>4; +#endif for (k=0; k<K1; k++) { #if defined(__x86_64__) || defined(__i386__) +#ifndef __AVX2__ m11_128[k] = _mm_srai_epi16(_mm_adds_epi16(systematic128[k],y_parity128[k]),1); m10_128[k] = _mm_srai_epi16(_mm_subs_epi16(systematic128[k],y_parity128[k]),1); +#else + ((__m256i*)m11_128)[k] = _mm256_srai_epi16(_mm256_adds_epi16(((__m256i*)systematic128)[k],((__m256i*)y_parity128)[k]),1); + // ((__m256i*)m10_128)[k] = _mm256_srai_epi16(_mm256_subs_epi16(((__m256i*)y_parity128)[k],((__m256i*)systematic128)[k]),1); + ((__m256i*)m10_128)[k] = _mm256_srai_epi16(_mm256_subs_epi16(((__m256i*)systematic128)[k],((__m256i*)y_parity128)[k]),1); +#endif #elif defined(__arm__) m11_128[k] = vhaddq_s16(systematic128[k],y_parity128[k]); m10_128[k] = vhsubq_s16(systematic128[k],y_parity128[k]); #endif #ifdef DEBUG_LOGMAP - printf("Loop index k, m11,m10\n"); + fprintf(fdsse4,"Loop index k %d\n", k); print_shorts("sys",(int16_t*)&systematic128[k]); print_shorts("yp",(int16_t*)&y_parity128[k]); print_shorts("m11",(int16_t*)&m11_128[k]); @@ -158,14 +177,28 @@ void compute_gamma16(llr_t* m11,llr_t* m10,llr_t* systematic,channel_t* y_parity #endif } + k=frame_length>>3; // Termination #if defined(__x86_64__) || defined(__i386__) m11_128[k] = _mm_srai_epi16(_mm_adds_epi16(systematic128[k+term_flag],y_parity128[k]),1); + //#ifndef __AVX2__ +#if 1 m10_128[k] = _mm_srai_epi16(_mm_subs_epi16(systematic128[k+term_flag],y_parity128[k]),1); +#else + m10_128[k] = _mm_srai_epi16(_mm_subs_epi16(y_parity128[k],systematic128[k+term_flag]),1); +#endif #elif defined(__arm__) m11_128[k] = vhaddq_s16(systematic128[k+term_flag],y_parity128[k]); m10_128[k] = vhsubq_s16(systematic128[k+term_flag],y_parity128[k]); #endif + +#ifdef DEBUG_LOGMAP +fprintf(fdsse4,"Loop index k %d (term flag %d)\n", k,term_flag); +print_shorts("sys",(int16_t*)&systematic128[k]); + print_shorts("yp",(int16_t*)&y_parity128[k]); + print_shorts("m11",(int16_t*)&m11_128[k]); + print_shorts("m10",(int16_t*)&m10_128[k]); +#endif } #define L 40 @@ -174,11 +207,21 @@ void compute_alpha16(llr_t* alpha,llr_t* beta,llr_t* m_11,llr_t* m_10,unsigned s { int k,l,l2,K1,rerun_flag=0; #if defined(__x86_64__) || defined(__i386__) - __m128i *alpha128=(__m128i *)alpha,*alpha_ptr; - __m128i a0,a1,a2,a3,a4,a5,a6,a7,*m11p,*m10p; + __m128i *alpha128=(__m128i *)alpha,*alpha_ptr,*m11p,*m10p; + //#ifndef __AVX2__ +#if 1 + __m128i a0,a1,a2,a3,a4,a5,a6,a7; __m128i m_b0,m_b1,m_b2,m_b3,m_b4,m_b5,m_b6,m_b7; __m128i new0,new1,new2,new3,new4,new5,new6,new7; __m128i alpha_max; +#else + __m256i *alpha256=(__m256i *)alpha,*alpha_ptr256,m11,m10; + __m256i a01,a23,a45,a67,a02,a13,a64,a75; + __m256i m_b01,m_b23,m_b45,m_b67,new01,new23,new45,new67; + __m256i m11m10_256; + __m256i alpha_max; +#endif + #elif defined(__arm__) int16x8_t *alpha128=(int16x8_t *)alpha,*alpha_ptr; int16x8_t a0,a1,a2,a3,a4,a5,a6,a7,*m11p,*m10p; @@ -188,10 +231,16 @@ void compute_alpha16(llr_t* alpha,llr_t* beta,llr_t* m_11,llr_t* m_10,unsigned s #endif l2 = L>>3; K1 = (frame_length>>3); - +#ifdef DEBUG_LOGMAP + fprintf(fdsse4,"compute_alpha (sse_16bit)\n"); +#endif for (l=K1;; l=l2,rerun_flag=1) { #if defined(__x86_64__) || defined(__i386__) alpha128 = (__m128i *)alpha; + //#ifdef __AVX2__ +#if 0 + alpha256 = (__m256i *)alpha; +#endif #elif defined(__arm__) alpha128 = (int16x8_t *)alpha; #endif @@ -218,7 +267,7 @@ void compute_alpha16(llr_t* alpha,llr_t* beta,llr_t* m_11,llr_t* m_10,unsigned s alpha128[7] = vdupq_n_s16(-MAX/2); #endif #ifdef DEBUG_LOGMAP - printf("Initial alpha\n"); + fprintf(fdsse4,"Initial alpha\n"); print_shorts("a0",(int16_t*)&alpha128[0]); print_shorts("a1",(int16_t*)&alpha128[1]); print_shorts("a2",(int16_t*)&alpha128[2]); @@ -258,7 +307,7 @@ void compute_alpha16(llr_t* alpha,llr_t* beta,llr_t* m_11,llr_t* m_10,unsigned s alpha[48] = -MAX/2; alpha[56] = -MAX/2; #ifdef DEBUG_LOGMAP - printf("Second run\n"); + fprintf(fdsse4,"Second run\n"); print_shorts("a0",(int16_t*)&alpha128[0]); print_shorts("a1",(int16_t*)&alpha128[1]); print_shorts("a2",(int16_t*)&alpha128[2]); @@ -272,6 +321,11 @@ void compute_alpha16(llr_t* alpha,llr_t* beta,llr_t* m_11,llr_t* m_10,unsigned s } alpha_ptr = &alpha128[0]; + //#ifdef __AVX2__ +#if 0 + alpha_ptr256 = &alpha256[0]; +#endif + #if defined(__x86_64__) || defined(__i386__) m11p = (__m128i*)m_11; m10p = (__m128i*)m_10; @@ -284,6 +338,8 @@ void compute_alpha16(llr_t* alpha,llr_t* beta,llr_t* m_11,llr_t* m_10,unsigned s k++) { #if defined(__x86_64__) || defined(__i386__) + //#ifndef __AVX2__ +#if 1 a1=_mm_load_si128(&alpha_ptr[1]); a3=_mm_load_si128(&alpha_ptr[3]); a5=_mm_load_si128(&alpha_ptr[5]); @@ -328,6 +384,37 @@ void compute_alpha16(llr_t* alpha,llr_t* beta,llr_t* m_11,llr_t* m_10,unsigned s alpha_max = _mm_max_epi16(alpha_max,a5); alpha_max = _mm_max_epi16(alpha_max,a6); alpha_max = _mm_max_epi16(alpha_max,a7); +#else + a02=_mm256_load_si256(&alpha_ptr256[0]); + a13=_mm256_load_si256(&alpha_ptr256[1]); + a64=_mm256_load_si256(&alpha_ptr256[2]); + a75=_mm256_load_si256(&alpha_ptr256[3]); + m11m10_256 = _mm256_insertf128_si256(m11m10_256,*m11p,0); + m11m10_256 = _mm256_insertf128_si256(m11m10_256,*m10p,1); + + + m_b01 = _mm256_adds_epi16(a13,m11m10_256); //negative m10 + m_b23 = _mm256_subs_epi16(a75,m11m10_256); //negative m10 + m_b45 = _mm256_subs_epi16(a13,m11m10_256); //negative m10 + m_b67 = _mm256_adds_epi16(a75,m11m10_256); //negative m10 + + new01 = _mm256_subs_epi16(a02,m11m10_256); //negative m10 + new23 = _mm256_adds_epi16(a64,m11m10_256); //negative m10 + new45 = _mm256_adds_epi16(a02,m11m10_256); //negative m10 + new67 = _mm256_subs_epi16(a64,m11m10_256); //negative m10 + + a01 = _mm256_max_epi16(m_b01,new01); + a23 = _mm256_max_epi16(m_b23,new23); + a45 = _mm256_max_epi16(m_b45,new45); + a67 = _mm256_max_epi16(m_b67,new67); + + alpha_max = _mm256_max_epi16(a01,a23); + alpha_max = _mm256_max_epi16(alpha_max,a45); + alpha_max = _mm256_max_epi16(alpha_max,a67); + alpha_max = _mm256_max_epi16(alpha_max,_mm256_permutevar8x32_epi32(alpha_max,_mm256_set_epi32(3,2,1,0,7,6,5,4))); + + +#endif #elif defined(__arm__) m_b0 = vqaddq_s16(alpha_ptr[1],*m11p); // m11 m_b4 = vqsubq_s16(alpha_ptr[1],*m11p); // m00=-m11 @@ -367,9 +454,15 @@ void compute_alpha16(llr_t* alpha,llr_t* beta,llr_t* m_11,llr_t* m_10,unsigned s #endif alpha_ptr+=8; + //#ifdef __AVX2__ +#if 0 + alpha_ptr256+=4; +#endif m11p++; m10p++; #if defined(__x86_64__) || defined(__i386__) + //#ifndef __AVX2__ +#if 1 alpha_ptr[0] = _mm_subs_epi16(a0,alpha_max); alpha_ptr[1] = _mm_subs_epi16(a1,alpha_max); alpha_ptr[2] = _mm_subs_epi16(a2,alpha_max); @@ -378,6 +471,18 @@ void compute_alpha16(llr_t* alpha,llr_t* beta,llr_t* m_11,llr_t* m_10,unsigned s alpha_ptr[5] = _mm_subs_epi16(a5,alpha_max); alpha_ptr[6] = _mm_subs_epi16(a6,alpha_max); alpha_ptr[7] = _mm_subs_epi16(a7,alpha_max); +#else + + a01 = _mm256_subs_epi16(a01,alpha_max); + a23 = _mm256_subs_epi16(a23,alpha_max); + a45 = _mm256_subs_epi16(a45,alpha_max); + a67 = _mm256_subs_epi16(a67,alpha_max); + + alpha_ptr256[0] = _mm256_permute2x128_si256(a01,a23,0x20); //a02 + alpha_ptr256[1] = _mm256_permute2x128_si256(a01,a23,0x13); //a13 + alpha_ptr256[2] = _mm256_permute2x128_si256(a45,a67,0x02); //a64 + alpha_ptr256[3] = _mm256_permute2x128_si256(a45,a67,0x31); //a75 +#endif #elif defined(__arm__) alpha_ptr[0] = vqsubq_s16(a0,alpha_max); alpha_ptr[1] = vqsubq_s16(a1,alpha_max); @@ -390,7 +495,7 @@ void compute_alpha16(llr_t* alpha,llr_t* beta,llr_t* m_11,llr_t* m_10,unsigned s #endif #ifdef DEBUG_LOGMAP - printf("Loop index %d, mb\n",k); + fprintf(fdsse4,"Loop index %d\n",k); print_shorts("mb0",(int16_t*)&m_b0); print_shorts("mb1",(int16_t*)&m_b1); print_shorts("mb2",(int16_t*)&m_b2); @@ -400,7 +505,7 @@ void compute_alpha16(llr_t* alpha,llr_t* beta,llr_t* m_11,llr_t* m_10,unsigned s print_shorts("mb6",(int16_t*)&m_b6); print_shorts("mb7",(int16_t*)&m_b7); - printf("Loop index %d, new\n",k); + fprintf(fdsse4,"Loop index %d, new\n",k); print_shorts("new0",(int16_t*)&new0); print_shorts("new1",(int16_t*)&new1); print_shorts("new2",(int16_t*)&new2); @@ -410,7 +515,7 @@ void compute_alpha16(llr_t* alpha,llr_t* beta,llr_t* m_11,llr_t* m_10,unsigned s print_shorts("new6",(int16_t*)&new6); print_shorts("new7",(int16_t*)&new7); - printf("Loop index %d, after max\n",k); + fprintf(fdsse4,"Loop index %d, after max\n",k); print_shorts("a0",(int16_t*)&a0); print_shorts("a1",(int16_t*)&a1); print_shorts("a2",(int16_t*)&a2); @@ -420,7 +525,7 @@ void compute_alpha16(llr_t* alpha,llr_t* beta,llr_t* m_11,llr_t* m_10,unsigned s print_shorts("a6",(int16_t*)&a6); print_shorts("a7",(int16_t*)&a7); - printf("Loop index %d\n",k); + fprintf(fdsse4,"Loop index %d\n",k); print_shorts("a0",(int16_t*)&alpha_ptr[0]); print_shorts("a1",(int16_t*)&alpha_ptr[1]); print_shorts("a2",(int16_t*)&alpha_ptr[2]); @@ -463,25 +568,33 @@ void compute_beta16(llr_t* alpha,llr_t* beta,llr_t *m_11,llr_t* m_10,unsigned sh llr_t beta0,beta1; #ifdef DEBUG_LOGMAP - msg("compute_beta, %p,%p,%p,%p,framelength %d,F %d\n", - beta,m_11,m_10,alpha,frame_length,F); + fprintf(fdsse4,"compute_beta, %p,%p,%p,%p,framelength %d,F %d\n", + beta,m_11,m_10,alpha,frame_length,F); #endif // termination for beta initialization - // printf("beta init: offset8 %d\n",offset8_flag); + // fprintf(fdsse4,"beta init: offset8 %d\n",offset8_flag); m11=(int16_t)m_11[2+frame_length]; + //#ifndef __AVX2__ +#if 1 m10=(int16_t)m_10[2+frame_length]; - - // printf("m11,m10 %d,%d\n",m11,m10); +#else + m10=-(int16_t)m_10[2+frame_length]; +#endif +#ifdef DEBUG_LOGMAP + fprintf(fdsse4,"m11,m10 %d,%d\n",m11,m10); +#endif beta0 = -m11;//M0T_TERM; beta1 = m11;//M1T_TERM; m11=(int16_t)m_11[1+frame_length]; m10=(int16_t)m_10[1+frame_length]; - // printf("m11,m10 %d,%d\n",m11,m10); +#ifdef DEBUG_LOGMAP + fprintf(fdsse4,"m11,m10 %d,%d\n",m11,m10); +#endif beta0_2 = beta0-m11;//+M0T_TERM; beta1_2 = beta0+m11;//+M1T_TERM; @@ -489,8 +602,9 @@ void compute_beta16(llr_t* alpha,llr_t* beta,llr_t *m_11,llr_t* m_10,unsigned sh beta3_2 = beta1-m10;//+M3T_TERM; m11=(int16_t)m_11[frame_length]; m10=(int16_t)m_10[frame_length]; - // printf("m11,m10 %d,%d (%p)\n",m11,m10,m_11+frame_length); - +#ifdef DEBUG_LOGMAP + fprintf(fdsse4,"m11,m10 %d,%d\n",m11,m10); +#endif beta0_16 = beta0_2-m11;//+M0T_TERM; beta1_16 = beta0_2+m11;//+M1T_TERM; beta2_16 = beta1_2+m10;//+M2T_TERM; @@ -536,6 +650,17 @@ void compute_beta16(llr_t* alpha,llr_t* beta,llr_t *m_11,llr_t* m_10,unsigned sh beta_ptr[5] = alpha128[5+(frame_length)]; beta_ptr[6] = alpha128[6+(frame_length)]; beta_ptr[7] = alpha128[7+(frame_length)]; +#ifdef DEBUG_LOGMAP + fprintf(fdsse4,"beta init \n"); + print_shorts("b0",(int16_t*)&beta_ptr[0]); + print_shorts("b1",(int16_t*)&beta_ptr[1]); + print_shorts("b2",(int16_t*)&beta_ptr[2]); + print_shorts("b3",(int16_t*)&beta_ptr[3]); + print_shorts("b4",(int16_t*)&beta_ptr[4]); + print_shorts("b5",(int16_t*)&beta_ptr[5]); + print_shorts("b6",(int16_t*)&beta_ptr[6]); + print_shorts("b7",(int16_t*)&beta_ptr[7]); +#endif } else { #if defined(__x86_64__) || defined(__i386__) beta128 = (__m128i*)&beta[0]; @@ -558,6 +683,17 @@ void compute_beta16(llr_t* alpha,llr_t* beta,llr_t *m_11,llr_t* m_10,unsigned sh beta_ptr[5] = (int16x8_t)vshrq_n_s64((int64x2_t)beta128[5],16); beta_ptr[5] = vsetq_lane_s16(beta[43],beta_ptr[5],4); beta_ptr[6] = (int16x8_t)vshrq_n_s64((int64x2_t)beta128[6],16); beta_ptr[6] = vsetq_lane_s16(beta[51],beta_ptr[6],4); beta_ptr[7] = (int16x8_t)vshrq_n_s64((int64x2_t)beta128[7],16); beta_ptr[7] = vsetq_lane_s16(beta[59],beta_ptr[7],4); +#endif +#ifdef DEBUG_LOGMAP + fprintf(fdsse4,"beta init (second run) \n"); + print_shorts("b0",(int16_t*)&beta_ptr[0]); + print_shorts("b1",(int16_t*)&beta_ptr[1]); + print_shorts("b2",(int16_t*)&beta_ptr[2]); + print_shorts("b3",(int16_t*)&beta_ptr[3]); + print_shorts("b4",(int16_t*)&beta_ptr[4]); + print_shorts("b5",(int16_t*)&beta_ptr[5]); + print_shorts("b6",(int16_t*)&beta_ptr[6]); + print_shorts("b7",(int16_t*)&beta_ptr[7]); #endif } @@ -582,6 +718,17 @@ void compute_beta16(llr_t* alpha,llr_t* beta,llr_t *m_11,llr_t* m_10,unsigned sh beta_ptr[7] = vsetq_lane_s16(beta7_16,beta_ptr[7],7); #endif +#ifdef DEBUG_LOGMAP + fprintf(fdsse4,"beta init (after insert) \n"); + print_shorts("b0",(int16_t*)&beta_ptr[0]); + print_shorts("b1",(int16_t*)&beta_ptr[1]); + print_shorts("b2",(int16_t*)&beta_ptr[2]); + print_shorts("b3",(int16_t*)&beta_ptr[3]); + print_shorts("b4",(int16_t*)&beta_ptr[4]); + print_shorts("b5",(int16_t*)&beta_ptr[5]); + print_shorts("b6",(int16_t*)&beta_ptr[6]); + print_shorts("b7",(int16_t*)&beta_ptr[7]); +#endif int loopval=((rerun_flag==0)?0:((frame_length-L)>>3)); for (k=(frame_length>>3)-1; k>=loopval; k--) { @@ -589,6 +736,9 @@ void compute_beta16(llr_t* alpha,llr_t* beta,llr_t *m_11,llr_t* m_10,unsigned sh m11_128=((__m128i*)m_11)[k]; m10_128=((__m128i*)m_10)[k]; + + //#ifndef __AVX2__ +#if 1 m_b0 = _mm_adds_epi16(beta_ptr[4],m11_128); //m11 m_b1 = _mm_subs_epi16(beta_ptr[4],m11_128); //m00 m_b2 = _mm_subs_epi16(beta_ptr[5],m10_128); //m01 @@ -598,6 +748,7 @@ void compute_beta16(llr_t* alpha,llr_t* beta,llr_t *m_11,llr_t* m_10,unsigned sh m_b6 = _mm_subs_epi16(beta_ptr[7],m11_128); //m00 m_b7 = _mm_adds_epi16(beta_ptr[7],m11_128); //m11 + new0 = _mm_subs_epi16(beta_ptr[0],m11_128); //m00 new1 = _mm_adds_epi16(beta_ptr[0],m11_128); //m11 new2 = _mm_adds_epi16(beta_ptr[1],m10_128); //m10 @@ -607,8 +758,29 @@ void compute_beta16(llr_t* alpha,llr_t* beta,llr_t *m_11,llr_t* m_10,unsigned sh new6 = _mm_adds_epi16(beta_ptr[3],m11_128); //m11 new7 = _mm_subs_epi16(beta_ptr[3],m11_128); //m00 +#else + b01=_mm256_load_si256(&((_m256i*)beta_ptr)[0]); + b23=_mm256_load_si256(&((_m256i*)beta_ptr)[1]); + b45=_mm256_load_si256(&((_m256i*)beta_ptr)[2]); + b67=_mm256_load_si256(&((_m256i*)beta_ptr)[3]); + m11m10_256 = _mm256_insertf128_si256(m11m10_256,m11_128,0); + m11m10_256 = _mm256_insertf128_si256(m11m10_256,m10_128,1); + + + m_b02 = _mm256_adds_epi16(b45,m11m10_256); //negative m10 + m_b13 = _mm256_subs_epi16(b45,m11m10_256); //negative m10 + m_b64 = _mm256_subs_epi16(b67,m11m10_256); //negative m10 + m_b75 = _mm256_adds_epi16(b67,m11m10_256); //negative m10 + new02 = _mm256_subs_epi16(b01,m11m10_256); //negative m10 + new13 = _mm256_adds_epi16(b01,m11m10_256); //negative m10 + new64 = _mm256_adds_epi16(b23,m11m10_256); //negative m10 + new75 = _mm256_subs_epi16(b24,m11m10_256); //negative m10 +#endif + beta_ptr-=8; + //#ifndef __AVX2__ +#if 1 beta_ptr[0] = _mm_max_epi16(m_b0,new0); beta_ptr[1] = _mm_max_epi16(m_b1,new1); beta_ptr[2] = _mm_max_epi16(m_b2,new2); @@ -634,6 +806,28 @@ void compute_beta16(llr_t* alpha,llr_t* beta,llr_t *m_11,llr_t* m_10,unsigned sh beta_ptr[5] = _mm_subs_epi16(beta_ptr[5],beta_max); beta_ptr[6] = _mm_subs_epi16(beta_ptr[6],beta_max); beta_ptr[7] = _mm_subs_epi16(beta_ptr[7],beta_max); +#else + b02 = _mm256_max_epi16(m_b02,new02); + b13 = _mm256_max_epi16(m_b13,new13); + b64 = _mm256_max_epi16(m_b64,new64); + b75 = _mm256_max_epi16(m_b75,new75); + + beta_max = _mm256_max_epi16(b02,b13); + beta_max = _mm256_max_epi16(beta_max,b64); + beta_max = _mm256_max_epi16(beta_max,b75); + beta_max = _mm256_max_epi16(beta_max,_mm256_permutevar8x32_epi32(betaa_max,_mm256_set_epi32(3,2,1,0,7,6,5,4))); + + b02 = _mm256_subs_epi16(b02,beta_max); + b13 = _mm256_subs_epi16(b13,beta_max); + b64 = _mm256_subs_epi16(b64,beta_max); + b75 = _mm256_subs_epi16(b75,beta_max); + + ((_m256i*)beta_ptr)[0]) = _mm256_permute2x128_si256(b02,b13,0x02); //b01 + ((_m256i*)beta_ptr)[1]) = _mm256_permute2x128_si256(b02,b13,0x31); //b23 + ((_m256i*)beta_ptr)[2]) = _mm256_permute2x128_si256(b64,b75,0x13); //b45 + ((_m256i*)beta_ptr)[3]) = _mm256_permute2x128_si256(b64,b75,0x20); //b67 +#endif + #elif defined(__arm__) m11_128=((int16x8_t*)m_11)[k]; m10_128=((int16x8_t*)m_10)[k]; @@ -684,6 +878,18 @@ void compute_beta16(llr_t* alpha,llr_t* beta,llr_t *m_11,llr_t* m_10,unsigned sh beta_ptr[7] = vqsubq_s16(beta_ptr[7],beta_max); #endif +#ifdef DEBUG_LOGMAP + fprintf(fdsse4,"Loop index %d, mb\n",k); + fprintf(fdsse4,"beta init (after max)\n"); + print_shorts("b0",(int16_t*)&beta_ptr[0]); + print_shorts("b1",(int16_t*)&beta_ptr[1]); + print_shorts("b2",(int16_t*)&beta_ptr[2]); + print_shorts("b3",(int16_t*)&beta_ptr[3]); + print_shorts("b4",(int16_t*)&beta_ptr[4]); + print_shorts("b5",(int16_t*)&beta_ptr[5]); + print_shorts("b6",(int16_t*)&beta_ptr[6]); + print_shorts("b7",(int16_t*)&beta_ptr[7]); +#endif } @@ -721,7 +927,7 @@ void compute_ext16(llr_t* alpha,llr_t* beta,llr_t* m_11,llr_t* m_10,llr_t* ext, // #ifdef DEBUG_LOGMAP - msg("compute_ext, %p, %p, %p, %p, %p, %p ,framelength %d\n",alpha,beta,m_11,m_10,ext,systematic,frame_length); + fprintf(fdsse4,"compute_ext (sse_16bit), %p, %p, %p, %p, %p, %p ,framelength %d\n",alpha,beta,m_11,m_10,ext,systematic,frame_length); #endif alpha_ptr = alpha128; @@ -736,7 +942,7 @@ void compute_ext16(llr_t* alpha,llr_t* beta,llr_t* m_11,llr_t* m_10,llr_t* ext, ext_128 = (__m128i*)&ext[k<<3]; /* - printf("EXT %03d\n",k); + fprintf(fdsse4,"EXT %03d\n",k); print_shorts("a0:",&alpha_ptr[0]); print_shorts("a1:",&alpha_ptr[1]); print_shorts("a2:",&alpha_ptr[2]); @@ -754,6 +960,9 @@ void compute_ext16(llr_t* alpha,llr_t* beta,llr_t* m_11,llr_t* m_10,llr_t* ext, print_shorts("b6:",&beta_ptr[6]); print_shorts("b7:",&beta_ptr[7]); */ + + //#ifndef __AVX2__ +#if 1 m00_4 = _mm_adds_epi16(alpha_ptr[7],beta_ptr[3]); //ALPHA_BETA_4m00; m11_4 = _mm_adds_epi16(alpha_ptr[7],beta_ptr[7]); //ALPHA_BETA_4m11; m00_3 = _mm_adds_epi16(alpha_ptr[6],beta_ptr[7]); //ALPHA_BETA_3m00; @@ -770,6 +979,32 @@ void compute_ext16(llr_t* alpha,llr_t* beta,llr_t* m_11,llr_t* m_10,llr_t* ext, m10_2 = _mm_adds_epi16(alpha_ptr[3],beta_ptr[5]); //ALPHA_BETA_2m10; m10_1 = _mm_adds_epi16(alpha_ptr[2],beta_ptr[1]); //ALPHA_BETA_1m10; m01_1 = _mm_adds_epi16(alpha_ptr[2],beta_ptr[5]); //ALPHA_BETA_1m01; +#else + + + m00_1 = _mm_adds_epi16(alpha_ptr[0],beta_ptr[0]); //ALPHA_BETA_1m00; + m10_1 = _mm_adds_epi16(alpha_ptr[2],beta_ptr[1]); //ALPHA_BETA_1m10; + m11_1 = _mm_adds_epi16(alpha_ptr[0],beta_ptr[4]); //ALPHA_BETA_1m11; + m01_1 = _mm_adds_epi16(alpha_ptr[2],beta_ptr[5]); //ALPHA_BETA_1m01; + + m11_2 = _mm_adds_epi16(alpha_ptr[1],beta_ptr[0]); //ALPHA_BETA_2m11; + m01_2 = _mm_adds_epi16(alpha_ptr[3],beta_ptr[1]); //ALPHA_BETA_2m01; + m00_2 = _mm_adds_epi16(alpha_ptr[1],beta_ptr[4]); //ALPHA_BETA_2m00; + m10_2 = _mm_adds_epi16(alpha_ptr[3],beta_ptr[5]); //ALPHA_BETA_2m10; + + m11_3 = _mm_adds_epi16(alpha_ptr[6],beta_ptr[3]); //ALPHA_BETA_3m11; + m01_3 = _mm_adds_epi16(alpha_ptr[4],beta_ptr[2]); //ALPHA_BETA_3m01; + m00_3 = _mm_adds_epi16(alpha_ptr[6],beta_ptr[7]); //ALPHA_BETA_3m00; + m10_3 = _mm_adds_epi16(alpha_ptr[4],beta_ptr[6]); //ALPHA_BETA_3m10; + + m00_4 = _mm_adds_epi16(alpha_ptr[7],beta_ptr[3]); //ALPHA_BETA_4m00; + m10_4 = _mm_adds_epi16(alpha_ptr[5],beta_ptr[2]); //ALPHA_BETA_4m10; + m11_4 = _mm_adds_epi16(alpha_ptr[7],beta_ptr[7]); //ALPHA_BETA_4m11; + m01_4 = _mm_adds_epi16(alpha_ptr[5],beta_ptr[6]); //ALPHA_BETA_4m01; + + +#endif + /* print_shorts("m11_1:",&m11_1); print_shorts("m11_2:",&m11_2); @@ -816,15 +1051,15 @@ void compute_ext16(llr_t* alpha,llr_t* beta,llr_t* m_11,llr_t* m_10,llr_t* ext, // print_shorts("m10_1:",&m10_1); *ext_128 = _mm_subs_epi16(m10_1,m01_1); +#ifdef DEBUG_LOGMAP + fprintf(fdsse4,"ext %p\n",ext_128); + print_shorts("ext:",(int16_t*)ext_128); + print_shorts("m11:",(int16_t*)m11_128); + print_shorts("m10:",(int16_t*)m10_128); + print_shorts("m10_1:",(int16_t*)&m10_1); + print_shorts("m01_1:",(int16_t*)&m01_1); +#endif - /* - print_shorts("ext:",ext_128); - print_shorts("m11:",m11_128); - print_shorts("m10:",m10_128); - print_shorts("m10_1:",&m10_1); - print_shorts("m01_1:",&m01_1); - print_shorts("syst:",systematic_128); - */ #elif defined(__arm__) m11_128 = (int16x8_t*)&m_11[k<<3]; m10_128 = (int16x8_t*)&m_10[k<<3]; @@ -927,7 +1162,7 @@ void init_td16() // j-=(n-1); pi2tab16[ind][i] = j; - // printf("pi2[%d] = %d\n",i,j); + // fprintf(fdsse4,"pi2[%d] = %d\n",i,j); } } @@ -964,19 +1199,19 @@ unsigned char phy_threegpplte_turbo_decoder16(short *y, n is the size in bits of the coded block, with the tail */ - llr_t systematic0[n+16] __attribute__ ((aligned(16))); - llr_t systematic1[n+16] __attribute__ ((aligned(16))); - llr_t systematic2[n+16] __attribute__ ((aligned(16))); - llr_t yparity1[n+16] __attribute__ ((aligned(16))); - llr_t yparity2[n+16] __attribute__ ((aligned(16))); + llr_t systematic0[n+16] __attribute__ ((aligned(32))); + llr_t systematic1[n+16] __attribute__ ((aligned(32))); + llr_t systematic2[n+16] __attribute__ ((aligned(32))); + llr_t yparity1[n+16] __attribute__ ((aligned(32))); + llr_t yparity2[n+16] __attribute__ ((aligned(32))); - llr_t ext[n+128] __attribute__((aligned(16))); - llr_t ext2[n+128] __attribute__((aligned(16))); + llr_t ext[n+128] __attribute__((aligned(32))); + llr_t ext2[n+128] __attribute__((aligned(32))); - llr_t alpha[(n+16)*8] __attribute__ ((aligned(16))); - llr_t beta[(n+16)*8] __attribute__ ((aligned(16))); - llr_t m11[n+16] __attribute__ ((aligned(16))); - llr_t m10[n+16] __attribute__ ((aligned(16))); + llr_t alpha[(n+16)*8] __attribute__ ((aligned(32))); + llr_t beta[(n+16)*8] __attribute__ ((aligned(32))); + llr_t m11[n+32] __attribute__ ((aligned(32))); + llr_t m10[n+32] __attribute__ ((aligned(32))); int *pi2_p,*pi4_p,*pi5_p,*pi6_p; @@ -989,7 +1224,7 @@ unsigned char phy_threegpplte_turbo_decoder16(short *y, #if defined(__x86_64__) || defined(__i386__) __m128i *yp128; __m128i tmp, zeros=_mm_setzero_si128(); - register __m128i tmpe; + __m128i tmpe; #elif defined(__arm__) int16x8_t *yp128; // int16x8_t tmp128[(n+8)>>3]; @@ -1000,12 +1235,20 @@ unsigned char phy_threegpplte_turbo_decoder16(short *y, #endif int offset8_flag=0; +#ifdef DEBUG_LOGMAP + fdsse4 = fopen("dump_sse4.txt","w"); + + + printf("tc sse4_16 (y) %p\n",y); +#endif + if (crc_type > 3) { - msg("Illegal crc length!\n"); + printf("Illegal crc length!\n"); return 255; } + start_meas(init_stats); @@ -1013,7 +1256,7 @@ unsigned char phy_threegpplte_turbo_decoder16(short *y, for (iind=0; iind < 188 && f1f2mat[iind].nb_bits != n; iind++); if ( iind == 188 ) { - msg("Illegal frame length!\n"); + printf("Illegal frame length!\n"); return 255; } @@ -1059,62 +1302,74 @@ unsigned char phy_threegpplte_turbo_decoder16(short *y, #if defined(__x86_64__) || defined(__i386__) tmpe = _mm_load_si128(yp128); + // fprintf(fdsse4,"yp128 %p\n",yp128); + // print_shorts("tmpe",(int16_t *)&tmpe); s[j] = _mm_extract_epi16(tmpe,0); yp1[j] = _mm_extract_epi16(tmpe,1); yp2[j] = _mm_extract_epi16(tmpe,2); - // printf("init: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",j,s[j],yp1[j],yp2[j]); - +#ifdef DEBUG_LOGMAP + fprintf(fdsse4,"init0: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",j,s[j],yp1[j],yp2[j]); +#endif j=pi2_p[1]; s[j] = _mm_extract_epi16(tmpe,3); yp1[j] = _mm_extract_epi16(tmpe,4); yp2[j] = _mm_extract_epi16(tmpe,5); - // printf("init: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",j,s[j],yp1[j],yp2[j]); - +#ifdef DEBUG_LOGMAP + fprintf(fdsse4,"init1: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",j,s[j],yp1[j],yp2[j]); +#endif j=pi2_p[2]; s[j] = _mm_extract_epi16(tmpe,6); yp1[j] = _mm_extract_epi16(tmpe,7); tmpe = _mm_load_si128(&yp128[1]); yp2[j] = _mm_extract_epi16(tmpe,0); - // printf("init: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",j,s[j],yp1[j],yp2[j]); - +#ifdef DEBUG_LOGMAP + fprintf(fdsse4,"init2: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",j,s[j],yp1[j],yp2[j]); +#endif j=pi2_p[3]; s[j] = _mm_extract_epi16(tmpe,1); yp1[j] = _mm_extract_epi16(tmpe,2); yp2[j] = _mm_extract_epi16(tmpe,3); - // printf("init: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",j,s[j],yp1[j],yp2[j]); - +#ifdef DEBUG_LOGMAP + fprintf(fdsse4,"init3: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",j,s[j],yp1[j],yp2[j]); +#endif j=pi2_p[4]; s[j] = _mm_extract_epi16(tmpe,4); yp1[j] = _mm_extract_epi16(tmpe,5); yp2[j] = _mm_extract_epi16(tmpe,6); - // printf("init: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",j,s[j],yp1[j],yp2[j]); - +#ifdef DEBUG_LOGMAP + fprintf(fdsse4,"init4: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",j,s[j],yp1[j],yp2[j]); +#endif j=pi2_p[5]; s[j] = _mm_extract_epi16(tmpe,7); tmpe = _mm_load_si128(&yp128[2]); yp1[j] = _mm_extract_epi16(tmpe,0); yp2[j] = _mm_extract_epi16(tmpe,1); - // printf("init: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",j,s[j],yp1[j],yp2[j]); +#ifdef DEBUG_LOGMAP + fprintf(fdsse4,"init5: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",j,s[j],yp1[j],yp2[j]); +#endif j=pi2_p[6]; s[j] = _mm_extract_epi16(tmpe,2); yp1[j] = _mm_extract_epi16(tmpe,3); yp2[j] = _mm_extract_epi16(tmpe,4); - // printf("init: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",j,s[j],yp1[j],yp2[j]); - +#ifdef DEBUG_LOGMAP + fprintf(fdsse4,"init6: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",j,s[j],yp1[j],yp2[j]); +#endif j=pi2_p[7]; s[j] = _mm_extract_epi16(tmpe,5); yp1[j] = _mm_extract_epi16(tmpe,6); yp2[j] = _mm_extract_epi16(tmpe,7); - // printf("init: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",j,s[j],yp1[j],yp2[j]); +#ifdef DEBUG_LOGMAP + fprintf(fdsse4,"init7: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",j,s[j],yp1[j],yp2[j]); +#endif #elif defined(__arm__) s[j] = vgetq_lane_s16(yp128[0],0); @@ -1172,7 +1427,7 @@ unsigned char phy_threegpplte_turbo_decoder16(short *y, yp1[i] = *yp; yp++; #ifdef DEBUG_LOGMAP - msg("Term 1 (%d): %d %d\n",i,s[i],yp1[i]); + fprintf(fdsse4,"Term 1 (%d): %d %d\n",i,s[i],yp1[i]); #endif //DEBUG_LOGMAP } @@ -1184,12 +1439,12 @@ unsigned char phy_threegpplte_turbo_decoder16(short *y, yp2[i-8] = *yp; yp++; #ifdef DEBUG_LOGMAP - msg("Term 2 (%d): %d %d\n",i-3,s[i],yp2[i-8]); + fprintf(fdsse4,"Term 2 (%d): %d %d\n",i-3,s[i],yp2[i-8]); #endif //DEBUG_LOGMAP } #ifdef DEBUG_LOGMAP - msg("\n"); + fprintf(fdsse4,"\n"); #endif //DEBUG_LOGMAP stop_meas(init_stats); @@ -1201,7 +1456,7 @@ unsigned char phy_threegpplte_turbo_decoder16(short *y, while (iteration_cnt++ < max_iterations) { #ifdef DEBUG_LOGMAP - printf("\n*******************ITERATION %d (n %d), ext %p\n\n",iteration_cnt,n,ext); + fprintf(fdsse4,"\n*******************ITERATION %d (n %d), ext %p\n\n",iteration_cnt,n,ext); #endif //DEBUG_LOGMAP start_meas(intl1_stats); @@ -1209,24 +1464,29 @@ unsigned char phy_threegpplte_turbo_decoder16(short *y, pi4_p=pi4tab16[iind]; for (i=0; i<(n>>3); i++) { // steady-state portion + #if defined(__x86_64__) || defined(__i386__) - ((__m128i *)systematic2)[i]=_mm_insert_epi16(((__m128i *)systematic2)[i],((llr_t*)ext)[*pi4_p++],0); - ((__m128i *)systematic2)[i]=_mm_insert_epi16(((__m128i *)systematic2)[i],((llr_t*)ext)[*pi4_p++],1); - ((__m128i *)systematic2)[i]=_mm_insert_epi16(((__m128i *)systematic2)[i],((llr_t*)ext)[*pi4_p++],2); - ((__m128i *)systematic2)[i]=_mm_insert_epi16(((__m128i *)systematic2)[i],((llr_t*)ext)[*pi4_p++],3); - ((__m128i *)systematic2)[i]=_mm_insert_epi16(((__m128i *)systematic2)[i],((llr_t*)ext)[*pi4_p++],4); - ((__m128i *)systematic2)[i]=_mm_insert_epi16(((__m128i *)systematic2)[i],((llr_t*)ext)[*pi4_p++],5); - ((__m128i *)systematic2)[i]=_mm_insert_epi16(((__m128i *)systematic2)[i],((llr_t*)ext)[*pi4_p++],6); - ((__m128i *)systematic2)[i]=_mm_insert_epi16(((__m128i *)systematic2)[i],((llr_t*)ext)[*pi4_p++],7); + ((__m128i *)systematic2)[i]=_mm_insert_epi16(((__m128i *)systematic2)[i],ext[*pi4_p++],0); + ((__m128i *)systematic2)[i]=_mm_insert_epi16(((__m128i *)systematic2)[i],ext[*pi4_p++],1); + ((__m128i *)systematic2)[i]=_mm_insert_epi16(((__m128i *)systematic2)[i],ext[*pi4_p++],2); + ((__m128i *)systematic2)[i]=_mm_insert_epi16(((__m128i *)systematic2)[i],ext[*pi4_p++],3); + ((__m128i *)systematic2)[i]=_mm_insert_epi16(((__m128i *)systematic2)[i],ext[*pi4_p++],4); + ((__m128i *)systematic2)[i]=_mm_insert_epi16(((__m128i *)systematic2)[i],ext[*pi4_p++],5); + ((__m128i *)systematic2)[i]=_mm_insert_epi16(((__m128i *)systematic2)[i],ext[*pi4_p++],6); + ((__m128i *)systematic2)[i]=_mm_insert_epi16(((__m128i *)systematic2)[i],ext[*pi4_p++],7); + #elif defined(__arm__) - ((int16x8_t*)systematic2)[i]=vsetq_lane_s16(((llr_t*)ext)[*pi4_p++],((int16x8_t*)systematic2)[i],0); - ((int16x8_t*)systematic2)[i]=vsetq_lane_s16(((llr_t*)ext)[*pi4_p++],((int16x8_t*)systematic2)[i],1); - ((int16x8_t*)systematic2)[i]=vsetq_lane_s16(((llr_t*)ext)[*pi4_p++],((int16x8_t*)systematic2)[i],2); - ((int16x8_t*)systematic2)[i]=vsetq_lane_s16(((llr_t*)ext)[*pi4_p++],((int16x8_t*)systematic2)[i],3); - ((int16x8_t*)systematic2)[i]=vsetq_lane_s16(((llr_t*)ext)[*pi4_p++],((int16x8_t*)systematic2)[i],4); - ((int16x8_t*)systematic2)[i]=vsetq_lane_s16(((llr_t*)ext)[*pi4_p++],((int16x8_t*)systematic2)[i],5); - ((int16x8_t*)systematic2)[i]=vsetq_lane_s16(((llr_t*)ext)[*pi4_p++],((int16x8_t*)systematic2)[i],6); - ((int16x8_t*)systematic2)[i]=vsetq_lane_s16(((llr_t*)ext)[*pi4_p++],((int16x8_t*)systematic2)[i],7); + ((int16x8_t*)systematic2)[i]=vsetq_lane_s16(ext[*pi4_p++],((int16x8_t*)systematic2)[i],0); + ((int16x8_t*)systematic2)[i]=vsetq_lane_s16(ext[*pi4_p++],((int16x8_t*)systematic2)[i],1); + ((int16x8_t*)systematic2)[i]=vsetq_lane_s16(ext[*pi4_p++],((int16x8_t*)systematic2)[i],2); + ((int16x8_t*)systematic2)[i]=vsetq_lane_s16(ext[*pi4_p++],((int16x8_t*)systematic2)[i],3); + ((int16x8_t*)systematic2)[i]=vsetq_lane_s16(ext[*pi4_p++],((int16x8_t*)systematic2)[i],4); + ((int16x8_t*)systematic2)[i]=vsetq_lane_s16(ext[*pi4_p++],((int16x8_t*)systematic2)[i],5); + ((int16x8_t*)systematic2)[i]=vsetq_lane_s16(ext[*pi4_p++],((int16x8_t*)systematic2)[i],6); + ((int16x8_t*)systematic2)[i]=vsetq_lane_s16(ext[*pi4_p++],((int16x8_t*)systematic2)[i],7); +#endif +#ifdef DEBUG_LOGMAP + print_shorts("syst2",(int16_t*)&((__m128i *)systematic2)[i]); #endif } @@ -1261,6 +1521,9 @@ unsigned char phy_threegpplte_turbo_decoder16(short *y, tmp=vsetq_lane_s16(ext2[*pi5_p++],tmp,6); tmp=vsetq_lane_s16(ext2[*pi5_p++],tmp,7); ((int16x8_t *)systematic1)[i] = vqaddq_s16(vqsubq_s16(tmp,((int16x8_t*)ext)[i]),((int16x8_t *)systematic0)[i]); +#endif +#ifdef DEBUG_LOGMAP + print_shorts("syst1",(int16_t*)&((__m128i *)systematic1)[i]); #endif } @@ -1278,6 +1541,9 @@ unsigned char phy_threegpplte_turbo_decoder16(short *y, tmp=_mm_insert_epi16(tmp, ((llr_t*)ext2)[*pi6_p++],2); tmp=_mm_insert_epi16(tmp, ((llr_t*)ext2)[*pi6_p++],1); tmp=_mm_insert_epi16(tmp, ((llr_t*)ext2)[*pi6_p++],0); +#ifdef DEBUG_LOGMAP + print_shorts("tmp",(int16_t*)&tmp); +#endif tmp=_mm_cmpgt_epi8(_mm_packs_epi16(tmp,zeros),zeros); decoded_bytes[i]=(unsigned char)_mm_movemask_epi8(tmp); #elif defined(__arm__) @@ -1297,6 +1563,10 @@ unsigned char phy_threegpplte_turbo_decoder16(short *y, uint64x2_t Mask = vpaddlq_u32(vpaddlq_u16(vandq_u16(vcgtq_s16(tmp,zeros), Powers))); uint64x1_t Mask64 = vget_high_u64(Mask)+vget_low_u64(Mask); decoded_bytes[i] = (uint8_t)Mask64; +#endif +#ifdef DEBUG_LOGMAP + print_shorts("tmp",(int16_t*)&tmp); + fprintf(fdsse4,"decoded_bytes[%d] %x\n",i,decoded_bytes[i]); #endif } } @@ -1344,6 +1614,9 @@ unsigned char phy_threegpplte_turbo_decoder16(short *y, } stop_meas(intl2_stats); +#ifdef DEBUG_LOGMAP + fprintf(fdsse4,"oldcrc %x, crc %x\n",oldcrc,crc); +#endif if ((crc == oldcrc) && (crc!=0)) { return(iteration_cnt); @@ -1374,8 +1647,12 @@ unsigned char phy_threegpplte_turbo_decoder16(short *y, } } } + + // fprintf(fdsse4,"crc %x, oldcrc %x\n",crc,oldcrc); - // printf("crc %x, oldcrc %x\n",crc,oldcrc); +#ifdef DEBUG_LOGMAP + fclose(fdsse4); +#endif #if defined(__x86_64__) || defined(__i386__) _mm_empty(); diff --git a/openair1/PHY/CODING/3gpplte_turbo_decoder_sse_8bit.c b/openair1/PHY/CODING/3gpplte_turbo_decoder_sse_8bit.c index ee78dd07732ac5a0d70222530a46d2ed90bb7ae6..0227a45a3de8d3e32fa5e0ba290240342cf2c391 100644 --- a/openair1/PHY/CODING/3gpplte_turbo_decoder_sse_8bit.c +++ b/openair1/PHY/CODING/3gpplte_turbo_decoder_sse_8bit.c @@ -1000,6 +1000,7 @@ unsigned char phy_threegpplte_turbo_decoder8(short *y, #if defined(__x86_64__) || defined(__i386__) + // note: this makes valgrind freak __m128i avg=_mm_set1_epi32(0); for (i=0; i<(3*(n>>4))+1; i++) { @@ -1503,6 +1504,7 @@ unsigned char phy_threegpplte_turbo_decoder8(short *y, tmp2=_mm_and_si128(tmp,mask); tmp2=_mm_cmpeq_epi16(tmp2,mask); + // printf("decoded_bytes %p\n",decoded_bytes); decoded_bytes[n_128*0+i]=(uint8_t) _mm_movemask_epi8(_mm_packs_epi16(tmp2,zeros)); int j; diff --git a/openair1/PHY/CODING/Makefile b/openair1/PHY/CODING/Makefile index b323c479d323ca88f5599613f4b8a1bacf95092b..d12689e1cc101051e081805084c28d68392f98f5 100644 --- a/openair1/PHY/CODING/Makefile +++ b/openair1/PHY/CODING/Makefile @@ -5,7 +5,7 @@ RATE12CC_SRC = ccoding_byte.c viterbi.c crc_byte.c all: 3gpplte_sse 3gpplte_sse: $(TURBO_SRC) - gcc -o 3gpplte_sse 3gpplte_sse.c -msse4 -Wall -g -ggdb -DMAIN + gcc -o 3gpplte_sse 3gpplte_sse.c -msse4 -Wall -g -ggdb -DTC_MAIN -I../.. diff --git a/openair1/PHY/CODING/defs.h b/openair1/PHY/CODING/defs.h index acb6e8dd29b32793eec8ffba8c716ebdb30007a2..c0f6091dfddc7262e9918afcb9ca40fc50efe095 100644 --- a/openair1/PHY/CODING/defs.h +++ b/openair1/PHY/CODING/defs.h @@ -303,6 +303,10 @@ void ccodedot11_init(void); \brief This function initializes the trellis structure for decoding an 802.11 convolutional code.*/ void ccodedot11_init_inv(void); +/*!\fn void teillis_table_init(void) +\brief This function initializes the trellis structure for 3GPP LTE Turbo code.*/ +void treillis_table_init(void); + /*\fn void threegpplte_turbo_encoder(uint8_t *input,uint16_t input_length_bytes,uint8_t *output,uint8_t F,uint16_t interleaver_f1,uint16_t interleaver_f2) \brief This function implements a rate 1/3 8-state parralel concatenated turbo code (3GPP-LTE). @param input Pointer to input buffer @@ -353,6 +357,8 @@ void ccodedab_init(void); \brief This function initializes the trellis structure for decoding an DAB convolutional code (first 3 bits).*/ void ccodedab_init_inv(void); + + /*!\fn void crcTableInit(void) \brief This function initializes the different crc tables.*/ void crcTableInit (void); @@ -366,6 +372,17 @@ void init_td8 (void); \brief This function initializes the tables for 16-bit LLR Turbo decoder.*/ void init_td16 (void); +#ifdef __AVX2__ +/*!\fn void init_td8(void) +\brief This function initializes the tables for 8-bit LLR Turbo decoder (AVX2).*/ +void init_td8avx2 (void); + + +/*!\fn void init_td16(void) +\brief This function initializes the tables for 16-bit LLR Turbo decoder (AVX2).*/ +void init_td16avx2 (void); +#endif + /*!\fn uint32_t crc24a(uint8_t *inPtr, int32_t bitlen) \brief This computes a 24-bit crc ('a' variant for overall transport block) based on 3GPP UMTS/LTE specifications. @@ -483,6 +500,24 @@ uint8_t phy_threegpplte_turbo_decoder16(int16_t *y, time_stats_t *intl1_stats, time_stats_t *intl2_stats); +uint8_t phy_threegpplte_turbo_decoder16avx2(int16_t *y, + int16_t *y2, + uint8_t *decoded_bytes, + uint8_t *decoded_bytes2, + uint16_t n, + uint16_t interleaver_f1, + uint16_t interleaver_f2, + uint8_t max_iterations, + uint8_t crc_type, + uint8_t F, + time_stats_t *init_stats, + time_stats_t *alpha_stats, + time_stats_t *beta_stats, + time_stats_t *gamma_stats, + time_stats_t *ext_stats, + time_stats_t *intl1_stats, + time_stats_t *intl2_stats); + /*! \brief This routine performs max-logmap detection for the 3GPP turbo code (with termination). It is optimized for SIMD processing and 8-bit LLR arithmetic, and requires SSE2,SSSE3 and SSE4.1 (gcc >=4.3 and appropriate CPU) diff --git a/openair1/PHY/CODING/lte_rate_matching.c b/openair1/PHY/CODING/lte_rate_matching.c index 96663bd8a6f8829b23a73c05700371ed0ef5f1a9..2dbf92d751be76f8baf53ced356db1f2c5c2f7e2 100644 --- a/openair1/PHY/CODING/lte_rate_matching.c +++ b/openair1/PHY/CODING/lte_rate_matching.c @@ -495,8 +495,14 @@ uint32_t lte_rate_matching_turbo(uint32_t RTC, char fname[512]; #endif - Nir = Nsoft/Kmimo/cmin(8,Mdlharq); - Ncb = cmin(Nir/C,3*(RTC<<5)); + if (Mdlharq>0) { // Downlink + Nir = Nsoft/Kmimo/cmin(8,Mdlharq); + Ncb = cmin(Nir/C,3*(RTC<<5)); + } + else { // Uplink + Nir=0; + Ncb = 3*(RTC<<5); // Kw + } #ifdef RM_DEBUG_TX if (rvidx==0 && r==0) { @@ -709,15 +715,20 @@ int lte_rate_matching_turbo_rx(uint32_t RTC, int nulled=0; #endif - if (Kmimo==0 || Mdlharq==0 || C==0 || Qm==0 || Nl==0) { + if (Kmimo==0 || C==0 || Qm==0 || Nl==0) { printf("lte_rate_matching.c: invalid parameters (Kmimo %d, Mdlharq %d, C %d, Qm %d, Nl %d\n", Kmimo,Mdlharq,C,Qm,Nl); return(-1); } - Nir = Nsoft/Kmimo/cmin(8,Mdlharq); - Ncb = cmin(Nir/C,3*(RTC<<5)); - + if (Mdlharq>0) { // Downlink + Nir = Nsoft/Kmimo/cmin(8,Mdlharq); + Ncb = cmin(Nir/C,3*(RTC<<5)); + } + else { // Uplink + Nir=0; + Ncb = 3*(RTC<<5); + } Gp = G/Nl/Qm; GpmodC = Gp%C; diff --git a/openair1/PHY/INIT/lte_init.c b/openair1/PHY/INIT/lte_init.c index 1f98a0eecca0fcf498083de909d74d6cdf8957e9..6a50c2d113a6042656da4a1361b253c7132328f1 100644 --- a/openair1/PHY/INIT/lte_init.c +++ b/openair1/PHY/INIT/lte_init.c @@ -26,17 +26,6 @@ Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE *******************************************************************************/ -/* -#ifdef CBMIMO1 -#include "ARCH/COMMON/defs.h" -#include "ARCH/CBMIMO1/DEVICE_DRIVER/from_grlib_softconfig.h" -#include "ARCH/CBMIMO1/DEVICE_DRIVER/cbmimo1_device.h" -#include "ARCH/CBMIMO1/DEVICE_DRIVER/defs.h" -#include "ARCH/CBMIMO1/DEVICE_DRIVER/extern.h" -#include "ARCH/CBMIMO1/DEVICE_DRIVER/cbmimo1_pci.h" -//#include "pci_commands.h" -#endif //CBMIMO1 -*/ #ifdef EXMIMO #include "openair0_lib.h" #endif @@ -888,12 +877,16 @@ void phy_init_lte_top(LTE_DL_FRAME_PARMS *lte_frame_parms) ccodelte_init(); ccodelte_init_inv(); + treillis_table_init(); + phy_generate_viterbi_tables(); phy_generate_viterbi_tables_lte(); init_td8(); init_td16(); - +#ifdef __AVX2__ + init_td16avx2(); +#endif lte_sync_time_init(lte_frame_parms); @@ -1049,7 +1042,7 @@ int phy_init_lte_ue(PHY_VARS_UE *phy_vars_ue, // init TX buffers ue_common_vars->txdata = (int32_t**)malloc16( frame_parms->nb_antennas_tx*sizeof(int32_t*) ); - ue_common_vars->txdataF = (mod_sym_t **)malloc16( frame_parms->nb_antennas_tx*sizeof(mod_sym_t*) ); + ue_common_vars->txdataF = (int32_t **)malloc16( frame_parms->nb_antennas_tx*sizeof(int32_t*) ); for (i=0; i<frame_parms->nb_antennas_tx; i++) { #ifdef USER_MODE @@ -1057,7 +1050,7 @@ int phy_init_lte_ue(PHY_VARS_UE *phy_vars_ue, #else //USER_MODE ue_common_vars->txdata[i] = TX_DMA_BUFFER[0][i]; #endif //USER_MODE - ue_common_vars->txdataF[i] = (mod_sym_t *)malloc16_clear( FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX*sizeof(mod_sym_t) ); + ue_common_vars->txdataF[i] = (int32_t *)malloc16_clear( FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX*sizeof(int32_t) ); } // init RX buffers @@ -1270,21 +1263,21 @@ int phy_init_lte_eNB(PHY_VARS_eNB *phy_vars_eNB, // TX vars eNB_common_vars->txdata[eNB_id] = (int32_t**)malloc16( frame_parms->nb_antennas_tx*sizeof(int32_t*) ); - eNB_common_vars->txdataF[eNB_id] = (mod_sym_t **)malloc16( frame_parms->nb_antennas_tx*sizeof(mod_sym_t*) ); + eNB_common_vars->txdataF[eNB_id] = (int32_t **)malloc16( frame_parms->nb_antennas_tx*sizeof(int32_t*) ); for (i=0; i<frame_parms->nb_antennas_tx; i++) { #ifdef USER_MODE eNB_common_vars->txdata[eNB_id][i] = (int32_t*)malloc16_clear( FRAME_LENGTH_COMPLEX_SAMPLES*sizeof(int32_t) ); - eNB_common_vars->txdataF[eNB_id][i] = (mod_sym_t*)malloc16_clear( FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX*sizeof(mod_sym_t) ); + eNB_common_vars->txdataF[eNB_id][i] = (int32_t*)malloc16_clear( FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX*sizeof(int32_t) ); #else // USER_MODE eNB_common_vars->txdata[eNB_id][i] = TX_DMA_BUFFER[eNB_id][i]; - eNB_common_vars->txdataF[eNB_id][i] = (mod_sym_t *)malloc16_clear( FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX*sizeof(mod_sym_t) ); + eNB_common_vars->txdataF[eNB_id][i] = (int32_t *)malloc16_clear( FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX*sizeof(int32_t) ); #endif //USER_MODE #ifdef DEBUG_PHY msg("[openair][LTE_PHY][INIT] lte_eNB_common_vars->txdata[%d][%d] = %p\n",eNB_id,i,eNB_common_vars->txdata[eNB_id][i]); msg("[openair][LTE_PHY][INIT] lte_eNB_common_vars->txdataF[%d][%d] = %p (%d bytes)\n", eNB_id,i,eNB_common_vars->txdataF[eNB_id][i], - FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX*sizeof(mod_sym_t)); + FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX*sizeof(int32_t)); #endif } diff --git a/openair1/PHY/INIT/lte_param_init.c b/openair1/PHY/INIT/lte_param_init.c index 2b827dcb0e0c8a8a760c94d66854de8e03b4182a..0db51e8b170c001e8f221b3b6acde2993ee297c8 100644 --- a/openair1/PHY/INIT/lte_param_init.c +++ b/openair1/PHY/INIT/lte_param_init.c @@ -45,6 +45,7 @@ void lte_param_init(unsigned char N_tx, 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->Ncp_UL = 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; diff --git a/openair1/PHY/LTE_ESTIMATION/adjust_gain.c b/openair1/PHY/LTE_ESTIMATION/adjust_gain.c index ead0ed7d99288beee7d910e36389931113153f6e..af72bce967cfa8c27465f36fc44b348197ad4bf3 100644 --- a/openair1/PHY/LTE_ESTIMATION/adjust_gain.c +++ b/openair1/PHY/LTE_ESTIMATION/adjust_gain.c @@ -29,8 +29,6 @@ #include "PHY/types.h" #include "PHY/defs.h" #include "PHY/extern.h" -#include "MAC_INTERFACE/defs.h" -#include "MAC_INTERFACE/extern.h" #ifdef EXMIMO #include "openair0_lib.h" diff --git a/openair1/PHY/LTE_ESTIMATION/filt96_32.h b/openair1/PHY/LTE_ESTIMATION/filt96_32.h index a29a8c26fb20746613397ddee2b5bc07735ad408..61225974bc406568f39d54ce356f3eafee3f2058 100644 --- a/openair1/PHY/LTE_ESTIMATION/filt96_32.h +++ b/openair1/PHY/LTE_ESTIMATION/filt96_32.h @@ -26,187 +26,187 @@ Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE *******************************************************************************/ -short filt24_0[24] __attribute__((aligned(16))) ={ +short filt24_0[24] __attribute__((aligned(32))) ={ 2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0,0,0,0,0,0 }; -short filt24_0_dcl[24] __attribute__((aligned(16))) ={ +short filt24_0_dcl[24] __attribute__((aligned(32))) ={ 2341,4681,7022,9362,11703,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0,0,0,0,0,0 }; -short filt24_0_dcr[24] __attribute__((aligned(16))) ={ +short filt24_0_dcr[24] __attribute__((aligned(32))) ={ 2730,5461,8192,10922,13653,16384,14043,11703,9362,7022,4681,0,0,0,0,0,0,0,0,0,0,0,0 }; -short filt24_1[24] __attribute__((aligned(16))) ={ +short filt24_1[24] __attribute__((aligned(32))) ={ 0,2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0,0,0,0,0 }; -short filt24_1_dcl[24] __attribute__((aligned(16))) ={ +short filt24_1_dcl[24] __attribute__((aligned(32))) ={ 0,4681,7022,9362,11703,14043,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0,0,0,0,0 }; -short filt24_1_dcr[24] __attribute__((aligned(16))) ={ +short filt24_1_dcr[24] __attribute__((aligned(32))) ={ 0,2730,5461,8192,10922,13653,16384,14043,11703,9362,7022,4681,0,0,0,0,0,0,0,0,0,0,0,0 }; -short filt24_2[24] __attribute__((aligned(16))) ={ +short filt24_2[24] __attribute__((aligned(32))) ={ 0,0,2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0,0,0,0 }; -short filt24_2_dcl[24] __attribute__((aligned(16))) ={ +short filt24_2_dcl[24] __attribute__((aligned(32))) ={ 0,0,2341,4681,7022,9362, 11703,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0,0,0,0 }; -short filt24_2_dcr[24] __attribute__((aligned(16))) ={ +short filt24_2_dcr[24] __attribute__((aligned(32))) ={ 0,0,2730,5461,8192,10922,13653,16384,14043,11703,9362,4681,2341,0,0,0,0,0,0,0,0,0,0,0 }; // X X X Y | X X X X | X Y X X -short filt24_3[24] __attribute__((aligned(16))) ={ +short filt24_3[24] __attribute__((aligned(32))) ={ 0,0,0,2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0,0,0 }; -short filt24_3_dcl[24] __attribute__((aligned(16))) ={ +short filt24_3_dcl[24] __attribute__((aligned(32))) ={ 0,0,0,2341,4681,7022,9362,14043,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0,0,0 }; // X X X Y | X X DC X X | X Y X X -short filt24_3_dcr[24] __attribute__((aligned(16))) ={ +short filt24_3_dcr[24] __attribute__((aligned(32))) ={ 0,0,0,2730,5461,8192,10922,13653,16384,14043,11703,7022,4681,2341,0,0,0,0,0,0,0,0,0,0 }; -short filt24_4[24] __attribute__((aligned(16))) ={ +short filt24_4[24] __attribute__((aligned(32))) ={ 0,0,0,0,2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0,0 }; -short filt24_4_dcl[24] __attribute__((aligned(16))) ={ +short filt24_4_dcl[24] __attribute__((aligned(32))) ={ 0,0,0,0,2341,7022,9362,11703,14043,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0,0 }; -short filt24_4_dcr[24] __attribute__((aligned(16))) ={ +short filt24_4_dcr[24] __attribute__((aligned(32))) ={ 0,0,0,0,2730,5461,8192,10922,13653,16384,14043,11703,7022,4681,2341,0,0,0,0,0,0,0,0,0 }; -short filt24_5[24] __attribute__((aligned(16))) ={ +short filt24_5[24] __attribute__((aligned(32))) ={ 0,0,0,0,0,2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0 }; // X X X Y | X X DC X X | X Y X X -short filt24_5_dcl[24] __attribute__((aligned(16))) ={ +short filt24_5_dcl[24] __attribute__((aligned(32))) ={ 0,0,0,0,0,2341,4681,9362,11703,14043,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0 }; -short filt24_5_dcr[24] __attribute__((aligned(16))) ={ +short filt24_5_dcr[24] __attribute__((aligned(32))) ={ 0,0,0,0,0,2730,5461,8192,10922,13653,16384,11703,9362,7022,4681,2730,0,0,0,0,0,0,0,0 }; -short filt24_6[24] __attribute__((aligned(16))) ={ +short filt24_6[24] __attribute__((aligned(32))) ={ 0,0,0,0,0,0,2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0 }; -short filt24_6_dcl[24] __attribute__((aligned(16))) ={ +short filt24_6_dcl[24] __attribute__((aligned(32))) ={ 0,0,0,0,0,0,4681,7022,9362,11703,14043,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0 }; -short filt24_6_dcr[24] __attribute__((aligned(16))) ={ +short filt24_6_dcr[24] __attribute__((aligned(32))) ={ 0,0,0,0,0,0,2730,5461,8192,10922,13653,16384,14043,11703,9362,7022,4681,0,0,0,0,0,0,0 }; -short filt24_7[24] __attribute__((aligned(16))) ={ +short filt24_7[24] __attribute__((aligned(32))) ={ 0,0,0,0,0,0,0,2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0 }; -short filt24_7_dcl[24] __attribute__((aligned(16))) ={ +short filt24_7_dcl[24] __attribute__((aligned(32))) ={ 0,0,0,0,0,0,0,4681,7022,9362,11703,14043,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0 }; -short filt24_7_dcr[24] __attribute__((aligned(16))) ={ +short filt24_7_dcr[24] __attribute__((aligned(32))) ={ 0,0,0,0,0,0,0,2730,5461,8192,10922,13653,16384,14043,11703,9362,7022,4681,0,0,0,0,0,0 }; -short filt24_0l[24] __attribute__((aligned(16))) ={ +short filt24_0l[24] __attribute__((aligned(32))) ={ 30037,27306,24576,21845,19114,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0,0,0,0,0,0 }; -short filt24_1l[24] __attribute__((aligned(16))) ={ +short filt24_1l[24] __attribute__((aligned(32))) ={ 0,30037,27306,24576,21845,19114,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0,0,0,0,0 }; -short filt24_2l[24] __attribute__((aligned(16))) ={ +short filt24_2l[24] __attribute__((aligned(32))) ={ 0,0,30037,27306,24576,21845,19114,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0,0,0,0 }; -short filt24_3l[24] __attribute__((aligned(16))) ={ +short filt24_3l[24] __attribute__((aligned(32))) ={ //0,0,0,30037,27306,24576,21845,19114,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0,0,0}; 0,0,0,0,0,24576,21845,19114,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0,0,0 }; -short filt24_4l[24] __attribute__((aligned(16))) ={ +short filt24_4l[24] __attribute__((aligned(32))) ={ 0,0,0,0,30037,27306,24576,21845,19114,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0,0 }; -short filt24_5l[24] __attribute__((aligned(16))) ={ +short filt24_5l[24] __attribute__((aligned(32))) ={ 0,0,0,0,0,30037,27306,24576,21845,19114,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0 }; -short filt24_6l[24] __attribute__((aligned(16))) ={ +short filt24_6l[24] __attribute__((aligned(32))) ={ 0,0,0,0,0,0,30037,27306,24576,21845,19114,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0 }; -short filt24_7l[24] __attribute__((aligned(16))) ={ +short filt24_7l[24] __attribute__((aligned(32))) ={ 0,0,0,0,0,0,0,30037,27306,24576,21845,19114,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0 }; -short filt24_0l2[24] __attribute__((aligned(16))) ={ +short filt24_0l2[24] __attribute__((aligned(32))) ={ 2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0,0,0,0,0,0 }; -short filt24_1l2[24] __attribute__((aligned(16))) ={ +short filt24_1l2[24] __attribute__((aligned(32))) ={ 0,2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0,0,0,0,0 }; -short filt24_2l2[24] __attribute__((aligned(16))) ={ +short filt24_2l2[24] __attribute__((aligned(32))) ={ -2730,0,2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0,0,0,0 }; -short filt24_3l2[24] __attribute__((aligned(16))) ={ +short filt24_3l2[24] __attribute__((aligned(32))) ={ -5461,-2730,0,2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0,0,0 }; -short filt24_4l2[24] __attribute__((aligned(16))) ={ +short filt24_4l2[24] __attribute__((aligned(32))) ={ -8192,-5461,-2730,0,2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0,0 }; -short filt24_5l2[24] __attribute__((aligned(16))) ={ +short filt24_5l2[24] __attribute__((aligned(32))) ={ 0,-8192,-5461,-2730,0,2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0 }; -short filt24_6l2[24] __attribute__((aligned(16))) ={ +short filt24_6l2[24] __attribute__((aligned(32))) ={ -13653,-10922,-8192,-5461,-2730,0,2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0 }; -short filt24_7l2[24] __attribute__((aligned(16))) ={ +short filt24_7l2[24] __attribute__((aligned(32))) ={ 0,-13653,-10922,-8192,-5461,-2730,0,2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0 }; -short filt24_0r[24] __attribute__((aligned(16))) ={ +short filt24_0r[24] __attribute__((aligned(32))) ={ 2730,5461,8192,10922,13653,16384,19114,21845,24576,27306,30037,0,0,0,0,0,0,0,0,0,0,0,0,0 }; -short filt24_1r[24] __attribute__((aligned(16))) ={ +short filt24_1r[24] __attribute__((aligned(32))) ={ 0,2730,5461,8192,10922,13653,16384,19114,21845,24576,27306,30037,0,0,0,0,0,0,0,0,0,0,0,0 }; -short filt24_2r[24] __attribute__((aligned(16))) ={ +short filt24_2r[24] __attribute__((aligned(32))) ={ 0,0,2730,5461,8192,10922,13653,16384,19114,21845,24576,27306,30037,0,0,0,0,0,0,0,0,0,0,0 }; -short filt24_3r[24] __attribute__((aligned(16))) ={ +short filt24_3r[24] __attribute__((aligned(32))) ={ 0,0,0,2730,5461,8192,10922,13653,16384,19114,21845,24576,27306,30037,0,0,0,0,0,0,0,0,0,0 }; -short filt24_4r[24] __attribute__((aligned(16))) ={ +short filt24_4r[24] __attribute__((aligned(32))) ={ 0,0,0,0,2730,5461,8192,10922,13653,16384,19114,21845,24576,27306,30037,0,0,0,0,0,0,0,0,0 }; -short filt24_5r[24] __attribute__((aligned(16))) ={ +short filt24_5r[24] __attribute__((aligned(32))) ={ 0,0,0,0,0,2730,5461,8192,10922,13653,16384,19114,21845,24576,27306,30037,0,0,0,0,0,0,0,0 }; -short filt24_6r[24] __attribute__((aligned(16))) ={ +short filt24_6r[24] __attribute__((aligned(32))) ={ 0,0,0,0,0,0,2730,5461,8192,10922,13653,16384,19114,21845,24576,27306,30037,0,0,0,0,0,0,0 }; -short filt24_7r[24] __attribute__((aligned(16))) ={ +short filt24_7r[24] __attribute__((aligned(32))) ={ 0,0,0,0,0,0,0,2730,5461,8192,10922,13653,16384,19114,21845,24576,27306,30037,0,0,0,0,0,0 }; -short filt24_0r2[24] __attribute__((aligned(16))) ={ /****/ +short filt24_0r2[24] __attribute__((aligned(32))) ={ /****/ 2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,-2730,-5461,-8192,-10922,-13653,0,0,0,0,0,0,0 }; -short filt24_1r2[24] __attribute__((aligned(16))) ={ +short filt24_1r2[24] __attribute__((aligned(32))) ={ 0,2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,-2730,-5461,-8192,-10922,-13653,0,0,0,0,0,0 }; -short filt24_2r2[24] __attribute__((aligned(16))) ={ +short filt24_2r2[24] __attribute__((aligned(32))) ={ 0,0,2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,-2730,-5461,-8192,-10922,-13653,0,0,0,0,0 }; -short filt24_3r2[24] __attribute__((aligned(16))) ={ +short filt24_3r2[24] __attribute__((aligned(32))) ={ 0,0,0,2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,-2730,-5461,-8192,-10922,-13653,0,0,0,0 }; -short filt24_4r2[24] __attribute__((aligned(16))) ={ +short filt24_4r2[24] __attribute__((aligned(32))) ={ 0,0,0,0,2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,-2730,-5461,-8192,-10922,-13653,0,0,0 }; -short filt24_5r2[24] __attribute__((aligned(16))) ={ +short filt24_5r2[24] __attribute__((aligned(32))) ={ 0,0,0,0,0,2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,-2730,-5461,-8192,-10922,-13653,0,0 }; -short filt24_6r2[24] __attribute__((aligned(16))) ={ +short filt24_6r2[24] __attribute__((aligned(32))) ={ 0,0,0,0,0,0,2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,-2730,-5461,-8192,-10922,-13653,0 }; -short filt24_7r2[24] __attribute__((aligned(16))) ={ +short filt24_7r2[24] __attribute__((aligned(32))) ={ 0,0,0,0,0,0,0,2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,-2730,-5461,-8192,-10922,-13653 }; diff --git a/openair1/PHY/LTE_ESTIMATION/lte_adjust_sync.c b/openair1/PHY/LTE_ESTIMATION/lte_adjust_sync.c index 9425e94d025edb33d97ff937d0fbef412d9ad7f6..059119c605536e1d599c657737e1d14ffd0a626b 100644 --- a/openair1/PHY/LTE_ESTIMATION/lte_adjust_sync.c +++ b/openair1/PHY/LTE_ESTIMATION/lte_adjust_sync.c @@ -29,8 +29,6 @@ #include "PHY/types.h" #include "PHY/defs.h" #include "PHY/extern.h" -#include "MAC_INTERFACE/defs.h" -#include "MAC_INTERFACE/extern.h" #define DEBUG_PHY diff --git a/openair1/PHY/LTE_ESTIMATION/lte_dl_channel_estimation.c b/openair1/PHY/LTE_ESTIMATION/lte_dl_channel_estimation.c index cfc2d929f1cb75b1edf53cbf92ad2b24e4e363a5..bfbe94bb6118ae686a7cae69df6c2f2a608db246 100644 --- a/openair1/PHY/LTE_ESTIMATION/lte_dl_channel_estimation.c +++ b/openair1/PHY/LTE_ESTIMATION/lte_dl_channel_estimation.c @@ -203,8 +203,9 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue, multadd_complex_vector_real_scalar(dl_ch-(phy_vars_ue->lte_frame_parms.ofdm_symbol_size<<1), phy_vars_ue->ch_est_alpha,dl_ch-(phy_vars_ue->lte_frame_parms.ofdm_symbol_size<<1), 1,phy_vars_ue->lte_frame_parms.ofdm_symbol_size); - - +#ifdef DEBUG_CH + printf("k %d, first_carrier %d\n",k,phy_vars_ue->lte_frame_parms.first_carrier_offset); +#endif if ((phy_vars_ue->lte_frame_parms.N_RB_DL==6) || (phy_vars_ue->lte_frame_parms.N_RB_DL==50) || (phy_vars_ue->lte_frame_parms.N_RB_DL==100)) { @@ -213,7 +214,9 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue, // Treat first 2 pilots specially (left edge) ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15); ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15); - // printf("pilot 0 : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]); +#ifdef DEBUG_CH + printf("pilot 0 : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]); +#endif multadd_real_vector_complex_scalar(fl, ch, dl_ch, @@ -224,7 +227,9 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue, ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15); ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15); - // printf("pilot 1 : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]); +#ifdef DEBUG_CH + printf("pilot 1 : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]); +#endif multadd_real_vector_complex_scalar(f2l2, ch, dl_ch, @@ -235,15 +240,13 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue, for (pilot_cnt=2; pilot_cnt<((phy_vars_ue->lte_frame_parms.N_RB_DL)-1); pilot_cnt+=2) { - // printf("%d\n",dl_ch-(int16_t *)&dl_ch_estimates[(p<<1)+aarx][ch_offset]); - - // printf("pilot[%d][%d] (%d,%d)\n",p,pilot_cnt,pil[0],pil[1]); - // printf("rx[%d] -> (%d,%d)\n", k, rxF[0], rxF[1]); ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15); //Re ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15); //Im - // printf("**rb %d %d\n",rb,dl_ch-(int16_t *)&dl_ch_estimates[(p<<1)+aarx][ch_offset]); +#ifdef DEBUG_CH + printf("pilot %d : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]); +#endif multadd_real_vector_complex_scalar(f, ch, dl_ch, @@ -254,13 +257,11 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue, rxF+=12; dl_ch+=8; - // printf("pilot[%d][%d] (%d,%d)\n",p,rb,pil[0],pil[1]); - // printf("rx[%d] -> (%d,%d)\n", k+6, rxF[0], rxF[1]); - - ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15); ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15); - // printf("**rb %d %d\n",rb,dl_ch-(int16_t *)&dl_ch_estimates[(p<<1)+aarx][ch_offset]); +#ifdef DEBUG_CH + printf("pilot %d : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt+1,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]); +#endif multadd_real_vector_complex_scalar(f2, ch, dl_ch, @@ -281,15 +282,17 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue, rxF = (int16_t *)&rxdataF[aarx][((symbol_offset+1+k))]; +#ifdef DEBUG_CH + printf("second half k %d\n",k); +#endif for (pilot_cnt=0; pilot_cnt<((phy_vars_ue->lte_frame_parms.N_RB_DL)-3); pilot_cnt+=2) { - // printf("pilot[%d][%d] (%d,%d)\n",p,pilot_cnt,pil[0],pil[1]); - // printf("rx[%d] -> (%d,%d)\n", k+6, rxF[0], rxF[1]); ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15); ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15); - - // printf("**rb %d %d\n",rb,dl_ch-(int16_t *)&dl_ch_estimates[(p<<1)+aarx][ch_offset]); +#ifdef DEBUG_CH + printf("pilot %d : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]); +#endif multadd_real_vector_complex_scalar(f, ch, dl_ch, @@ -300,8 +303,9 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue, ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15); ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15); - - // printf("**rb %d %d\n",rb,dl_ch-(int16_T *)&dl_ch_estimates[(p<<1)+aarx][ch_offset]); +#ifdef DEBUG_CH + printf("pilot %d : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt+1,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]); +#endif multadd_real_vector_complex_scalar(f2, ch, dl_ch, @@ -314,8 +318,9 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue, ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15); ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15); - // printf("pilot 49: rxF -> (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]); - +#ifdef DEBUG_CH + printf("pilot %d: rxF -> (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]); +#endif multadd_real_vector_complex_scalar(fr, ch, dl_ch, @@ -326,7 +331,9 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue, ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15); ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15); - // printf("pilot 50: rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]); +#ifdef DEBUG_CH + printf("pilot %d: rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt+1,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]); +#endif multadd_real_vector_complex_scalar(f2r2, ch, dl_ch, diff --git a/openair1/PHY/LTE_ESTIMATION/lte_dl_mbsfn_channel_estimation.c b/openair1/PHY/LTE_ESTIMATION/lte_dl_mbsfn_channel_estimation.c index e79392e0fe1705a9f60af12f0522476ee83df80b..1dbafdb911154760bcf283e738219901aa9a7d86 100644 --- a/openair1/PHY/LTE_ESTIMATION/lte_dl_mbsfn_channel_estimation.c +++ b/openair1/PHY/LTE_ESTIMATION/lte_dl_mbsfn_channel_estimation.c @@ -771,7 +771,8 @@ int lte_dl_mbsfn_channel_estimation(PHY_VARS_UE *phy_vars_ue, break; case 75: idft1536((int16_t*) &phy_vars_ue->lte_ue_common_vars.dl_ch_estimates[eNB_offset][aa][8], - (int16_t*) phy_vars_ue->lte_ue_common_vars.dl_ch_estimates_time[eNB_offset][aa]); + (int16_t*) phy_vars_ue->lte_ue_common_vars.dl_ch_estimates_time[eNB_offset][aa], + 1); break; case 100: idft2048((int16_t*) &phy_vars_ue->lte_ue_common_vars.dl_ch_estimates[eNB_offset][aa][8], diff --git a/openair1/PHY/LTE_ESTIMATION/lte_eNB_measurements.c b/openair1/PHY/LTE_ESTIMATION/lte_eNB_measurements.c index d5bfee81edc127c124aef25eead5cacc68812738..8b5c1a1806cb572f99b033eb955902d0697f78c5 100644 --- a/openair1/PHY/LTE_ESTIMATION/lte_eNB_measurements.c +++ b/openair1/PHY/LTE_ESTIMATION/lte_eNB_measurements.c @@ -56,7 +56,6 @@ void lte_eNB_I0_measurements(PHY_VARS_eNB *phy_vars_eNB, 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) @@ -68,8 +67,8 @@ void lte_eNB_I0_measurements(PHY_VARS_eNB *phy_vars_eNB, 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; - phy_measurements->n0_power[aarx] = (phy_measurements->n0_power[aarx] * 12*frame_parms->N_RB_DL)/(frame_parms->ofdm_symbol_size); + frame_parms->ofdm_symbol_size)) + k2*phy_measurements->n0_power[aarx])>>10; + //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]; } @@ -88,7 +87,7 @@ void lte_eNB_I0_measurements(PHY_VARS_eNB *phy_vars_eNB, // 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); + offset += (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 diff --git a/openair1/PHY/LTE_ESTIMATION/lte_sync_time.c b/openair1/PHY/LTE_ESTIMATION/lte_sync_time.c index edbdbda2d1986d915f195a9e544149a673e02afb..dfb39a510f0faac40d8598bbc6a286908c627b66 100644 --- a/openair1/PHY/LTE_ESTIMATION/lte_sync_time.c +++ b/openair1/PHY/LTE_ESTIMATION/lte_sync_time.c @@ -37,8 +37,6 @@ #include "PHY/defs.h" #include "PHY/extern.h" #include "SCHED/extern.h" -#include "MAC_INTERFACE/defs.h" -#include "MAC_INTERFACE/extern.h" #include <math.h> #ifdef OPENAIR2 @@ -52,8 +50,8 @@ int* sync_corr_ue0 = NULL; int* sync_corr_ue1 = NULL; int* sync_corr_ue2 = NULL; -int sync_tmp[2048*4] __attribute__((aligned(16))); -short syncF_tmp[2048*2] __attribute__((aligned(16))); +int sync_tmp[2048*4] __attribute__((aligned(32))); +short syncF_tmp[2048*2] __attribute__((aligned(32))); @@ -172,12 +170,13 @@ int lte_sync_time_init(LTE_DL_FRAME_PARMS *frame_parms ) // LTE_UE_COMMON *com case 75: idft1536((short*)syncF_tmp, /// complex input - (short*)sync_tmp); /// complex output + (short*)sync_tmp, + 1); /// complex output break; case 100: idft2048((short*)syncF_tmp, /// complex input - (short*)sync_tmp, /// complex output - 1); + (short*)sync_tmp, /// complex output + 1); break; default: LOG_E(PHY,"Unsupported N_RB_DL %d\n",frame_parms->N_RB_DL); @@ -219,8 +218,8 @@ int lte_sync_time_init(LTE_DL_FRAME_PARMS *frame_parms ) // LTE_UE_COMMON *com case 75: idft1536((short*)syncF_tmp, /// complex input - (short*)sync_tmp /// complex output - ); + (short*)sync_tmp, /// complex output + 1); break; case 100: idft2048((short*)syncF_tmp, /// complex input @@ -267,8 +266,8 @@ int lte_sync_time_init(LTE_DL_FRAME_PARMS *frame_parms ) // LTE_UE_COMMON *com case 75: idft1536((short*)syncF_tmp, /// complex input - (short*)sync_tmp /// complex output - ); + (short*)sync_tmp, /// complex output + 1); break; case 100: idft2048((short*)syncF_tmp, /// complex input @@ -346,6 +345,8 @@ static inline int abs32(int x) int debug_cnt=0; #endif +#define SHIFT 17 + int lte_sync_time(int **rxdata, ///rx data in time domain LTE_DL_FRAME_PARMS *frame_parms, int *eNB_id) @@ -414,8 +415,8 @@ int lte_sync_time(int **rxdata, ///rx data in time domain //calculate dot product of primary_synch0_time and rxdata[ar][n] (ar=0..nb_ant_rx) and store the sum in temp[n]; for (ar=0; ar<frame_parms->nb_antennas_rx; ar++) { - result = dot_product((short*)primary_synch0_time, (short*) &(rxdata[ar][n]), frame_parms->ofdm_symbol_size, 15); - result2 = dot_product((short*)primary_synch0_time, (short*) &(rxdata[ar][n+length]), frame_parms->ofdm_symbol_size, 15); + result = dot_product((short*)primary_synch0_time, (short*) &(rxdata[ar][n]), frame_parms->ofdm_symbol_size, SHIFT); + result2 = dot_product((short*)primary_synch0_time, (short*) &(rxdata[ar][n+length]), frame_parms->ofdm_symbol_size, SHIFT); ((short*)sync_corr_ue0)[2*n] += ((short*) &result)[0]; ((short*)sync_corr_ue0)[2*n+1] += ((short*) &result)[1]; @@ -428,8 +429,8 @@ int lte_sync_time(int **rxdata, ///rx data in time domain } for (ar=0; ar<frame_parms->nb_antennas_rx; ar++) { - result = dot_product((short*)primary_synch1_time, (short*) &(rxdata[ar][n]), frame_parms->ofdm_symbol_size, 15); - result2 = dot_product((short*)primary_synch1_time, (short*) &(rxdata[ar][n+length]), frame_parms->ofdm_symbol_size, 15); + result = dot_product((short*)primary_synch1_time, (short*) &(rxdata[ar][n]), frame_parms->ofdm_symbol_size, SHIFT); + result2 = dot_product((short*)primary_synch1_time, (short*) &(rxdata[ar][n+length]), frame_parms->ofdm_symbol_size, SHIFT); ((short*)sync_corr_ue1)[2*n] += ((short*) &result)[0]; ((short*)sync_corr_ue1)[2*n+1] += ((short*) &result)[1]; ((short*)sync_corr_ue1)[2*(length+n)] += ((short*) &result2)[0]; @@ -443,8 +444,8 @@ int lte_sync_time(int **rxdata, ///rx data in time domain for (ar=0; ar<frame_parms->nb_antennas_rx; ar++) { - result = dot_product((short*)primary_synch2_time, (short*) &(rxdata[ar][n]), frame_parms->ofdm_symbol_size, 15); - result2 = dot_product((short*)primary_synch2_time, (short*) &(rxdata[ar][n+length]), frame_parms->ofdm_symbol_size, 15); + result = dot_product((short*)primary_synch2_time, (short*) &(rxdata[ar][n]), frame_parms->ofdm_symbol_size, SHIFT); + result2 = dot_product((short*)primary_synch2_time, (short*) &(rxdata[ar][n+length]), frame_parms->ofdm_symbol_size, SHIFT); ((short*)sync_corr_ue2)[2*n] += ((short*) &result)[0]; ((short*)sync_corr_ue2)[2*n+1] += ((short*) &result)[1]; ((short*)sync_corr_ue2)[2*(length+n)] += ((short*) &result2)[0]; @@ -558,7 +559,7 @@ int lte_sync_time_eNB(int32_t **rxdata, ///rx data in time domain //calculate dot product of primary_synch0_time and rxdata[ar][n] (ar=0..nb_ant_rx) and store the sum in temp[n]; for (ar=0; ar<frame_parms->nb_antennas_rx; ar++) { - result = dot_product((short*)primary_synch_time, (short*) &(rxdata[ar][n]), frame_parms->ofdm_symbol_size, 15); + result = dot_product((short*)primary_synch_time, (short*) &(rxdata[ar][n]), frame_parms->ofdm_symbol_size, SHIFT); //((short*)sync_corr)[2*n] += ((short*) &result)[0]; //((short*)sync_corr)[2*n+1] += ((short*) &result)[1]; sync_corr_eNB[n] += abs32(result); diff --git a/openair1/PHY/LTE_ESTIMATION/lte_sync_timefreq.c b/openair1/PHY/LTE_ESTIMATION/lte_sync_timefreq.c index 493583214a3b5206d1f5a4b0d0903e5da4dd07ec..74b46c5eb65e79c0c7adad0d04c38ffa95e6d34e 100644 --- a/openair1/PHY/LTE_ESTIMATION/lte_sync_timefreq.c +++ b/openair1/PHY/LTE_ESTIMATION/lte_sync_timefreq.c @@ -56,8 +56,8 @@ void lte_sync_timefreq(PHY_VARS_UE *ue,int band,unsigned int DL_freq) { #if defined(__x86_64__) || defined(__i386__) UE_SCAN_INFO_t *scan_info = &ue->scan_info[band]; - int16_t spectrum[12288] __attribute__((aligned(16))); - int16_t spectrum_p5ms[12288] __attribute__((aligned(16))); + int16_t spectrum[12288] __attribute__((aligned(32))); + int16_t spectrum_p5ms[12288] __attribute__((aligned(32))); int i,f,band_idx; __m128i autocorr0[256/4],autocorr1[256/4],autocorr2[256/4]; __m128i autocorr0_t[256/4],autocorr1_t[256/4],autocorr2_t[256/4]; diff --git a/openair1/PHY/LTE_ESTIMATION/lte_ul_channel_estimation.c b/openair1/PHY/LTE_ESTIMATION/lte_ul_channel_estimation.c index 1eb663ec89e844a2adc171ecdc818e912a97d81c..2bfa6e3f60fbb3997c080e2f27da0acd871011db 100644 --- a/openair1/PHY/LTE_ESTIMATION/lte_ul_channel_estimation.c +++ b/openair1/PHY/LTE_ESTIMATION/lte_ul_channel_estimation.c @@ -31,6 +31,7 @@ #include "PHY/sse_intrin.h" //#define DEBUG_CH +#include "T.h" // For Channel Estimation in Distributed Alamouti Scheme //static int16_t temp_out_ifft[2048*4] __attribute__((aligned(16))); @@ -331,6 +332,13 @@ int32_t lte_ul_channel_estimation(PHY_VARS_eNB *phy_vars_eNB, break; } +#if T_TRACER + if (aa == 0) + T(T_ENB_UL_CHANNEL_ESTIMATE, T_INT(eNB_id), T_INT(UE_id), + T_INT(phy_vars_eNB->proc[sched_subframe].frame_rx), T_INT(subframe), + T_INT(0), T_BUFFER(ul_ch_estimates_time[0], 512 * 4)); +#endif + #ifdef DEBUG_CH if (aa==0) { diff --git a/openair1/PHY/LTE_REFSIG/defs.h b/openair1/PHY/LTE_REFSIG/defs.h index b48403ff9973cfc1890dbd0019767e42e0b5f29a..f8701a63a82e0c4e1b38bde5a8388703590ec88e 100644 --- a/openair1/PHY/LTE_REFSIG/defs.h +++ b/openair1/PHY/LTE_REFSIG/defs.h @@ -73,7 +73,7 @@ void lte_gold_mbsfn(LTE_DL_FRAME_PARMS *frame_parms,uint32_t lte_gold_mbsfn_tabl int lte_dl_cell_spec(PHY_VARS_eNB *phy_vars_eNB, - mod_sym_t *output, + int32_t *output, short amp, unsigned char Ns, unsigned char l, @@ -89,7 +89,7 @@ int lte_dl_cell_spec(PHY_VARS_eNB *phy_vars_eNB, */ int lte_dl_ue_spec(PHY_VARS_eNB *phy_vars_eNB, uint8_t UE_id, - mod_sym_t *output, + int32_t *output, short amp, uint8_t Ns, uint8_t p, @@ -102,7 +102,7 @@ int lte_dl_ue_spec(PHY_VARS_eNB *phy_vars_eNB, @param Ns Slot number (0..19) @param l symbol (0,1,2) */ -int lte_dl_mbsfn(PHY_VARS_eNB *phy_vars_eNB, mod_sym_t *output, +int lte_dl_mbsfn(PHY_VARS_eNB *phy_vars_eNB, int32_t *output, short amp, int subframe, unsigned char l); @@ -148,7 +148,7 @@ void free_ul_ref_sigs(void); @sub_frame_offset Offset of this subframe in units of subframes */ -int lte_generate_srs(mod_sym_t **txdataF, +int lte_generate_srs(int32_t **txdataF, short amp, LTE_DL_FRAME_PARMS *frame_parms, unsigned int sub_frame_offset); diff --git a/openair1/PHY/LTE_REFSIG/lte_dl_cell_spec.c b/openair1/PHY/LTE_REFSIG/lte_dl_cell_spec.c index 8e64275b41f22ffeeeeaa9f0368c3b8ed895a6e6..9ffda3a83d914e001a07d561a314f1e21fe7a77c 100644 --- a/openair1/PHY/LTE_REFSIG/lte_dl_cell_spec.c +++ b/openair1/PHY/LTE_REFSIG/lte_dl_cell_spec.c @@ -41,7 +41,7 @@ //Calibration int lte_dl_cell_spec_SS(PHY_VARS_eNB *phy_vars_eNB, - mod_sym_t *output, + int32_t *output, short amp, unsigned char Ns, unsigned char l,//nb of sym per slot @@ -50,7 +50,7 @@ int lte_dl_cell_spec_SS(PHY_VARS_eNB *phy_vars_eNB, unsigned char nu,mprime,mprime_dword,mprime_qpsk_symb,m; unsigned short k,a; - mod_sym_t qpsk[4]; + int32_t qpsk[4]; a = (amp*ONE_OVER_SQRT2_Q15)>>15; ((short *)&qpsk[0])[0] = a; @@ -121,7 +121,7 @@ int lte_dl_cell_spec_SS(PHY_VARS_eNB *phy_vars_eNB, int lte_dl_cell_spec(PHY_VARS_eNB *phy_vars_eNB, - mod_sym_t *output, + int32_t *output, short amp, unsigned char Ns, unsigned char l, @@ -130,7 +130,7 @@ int lte_dl_cell_spec(PHY_VARS_eNB *phy_vars_eNB, unsigned char nu,mprime,mprime_dword,mprime_qpsk_symb,m; unsigned short k,a; - mod_sym_t qpsk[4]; + int32_t qpsk[4]; a = (amp*ONE_OVER_SQRT2_Q15)>>15; ((short *)&qpsk[0])[0] = a; diff --git a/openair1/PHY/LTE_REFSIG/lte_dl_mbsfn.c b/openair1/PHY/LTE_REFSIG/lte_dl_mbsfn.c index c3b141841a9d2fba22cf27e66601f32c37d91d43..9c3269b863b9c5ae8de92b8248b6968f2fee25cd 100644 --- a/openair1/PHY/LTE_REFSIG/lte_dl_mbsfn.c +++ b/openair1/PHY/LTE_REFSIG/lte_dl_mbsfn.c @@ -39,7 +39,7 @@ //extern unsigned int lte_gold_table[10][3][42]; //#define DEBUG_DL_MBSFN -int lte_dl_mbsfn(PHY_VARS_eNB *phy_vars_eNB, mod_sym_t *output, +int lte_dl_mbsfn(PHY_VARS_eNB *phy_vars_eNB, int32_t *output, short amp, int subframe, unsigned char l) @@ -47,7 +47,7 @@ int lte_dl_mbsfn(PHY_VARS_eNB *phy_vars_eNB, mod_sym_t *output, unsigned int mprime,mprime_dword,mprime_qpsk_symb,m; unsigned short k=0,a; - mod_sym_t qpsk[4]; + int32_t qpsk[4]; a = (amp*ONE_OVER_SQRT2_Q15)>>15; ((short *)&qpsk[0])[0] = a; diff --git a/openair1/PHY/LTE_REFSIG/lte_dl_uespec.c b/openair1/PHY/LTE_REFSIG/lte_dl_uespec.c index e7b3dd2ed1826bab0b2ac5f49be0a3323cec367d..9b094393c7cbb0fbff56dec693377cd4c0ae7bc5 100644 --- a/openair1/PHY/LTE_REFSIG/lte_dl_uespec.c +++ b/openair1/PHY/LTE_REFSIG/lte_dl_uespec.c @@ -54,14 +54,14 @@ int Wbar_NCP[8][4] = {{1,1,1,1},{1,-1,1,-1},{1,1,1,1},{1,-1,1,-1},{1,1,-1,-1},{- int lte_dl_ue_spec(PHY_VARS_eNB *phy_vars_eNB, uint8_t UE_id, - mod_sym_t *output, + int32_t *output, short amp, uint8_t Ns, uint8_t p, int SS_flag ) { - mod_sym_t qpsk[4],nqpsk[4],*qpsk_p,*output_p; + int32_t qpsk[4],nqpsk[4],*qpsk_p,*output_p; int16_t a; int w,lprime,ind,l,ind_dword,ind_qpsk_symb,nPRB; // LTE_eNB_DLSCH_t *dlsch = phy_vars_eNB->dlsch_eNB[UE_id][0]; diff --git a/openair1/PHY/LTE_REFSIG/lte_gold.c b/openair1/PHY/LTE_REFSIG/lte_gold.c index 567851a51a6cd376f2cd6841782dd7fb374b402d..bfd67166408a9e3a1e777cd30ffcbd6118812a9b 100644 --- a/openair1/PHY/LTE_REFSIG/lte_gold.c +++ b/openair1/PHY/LTE_REFSIG/lte_gold.c @@ -61,21 +61,18 @@ void lte_gold(LTE_DL_FRAME_PARMS *frame_parms,uint32_t lte_gold_table[20][2][14] x2 = Ncp + (Nid_cell<<1) + - (((1+(Nid_cell<<1))*(1 + (((frame_parms->Ncp==0)?4:3)*l) + (7*(1+ns))))<<10); //cinit + (((1+(Nid_cell<<1))*(1 + (((frame_parms->Ncp==0)?4:3)*l) + (7*(1+ns))))<<10); //cinit //x2 = frame_parms->Ncp + (Nid_cell<<1) + (1+(Nid_cell<<1))*(1 + (3*l) + (7*(1+ns))); //cinit //n = 0 - // printf("cinit (ns %d, l %d) => %d\n",ns,l,x2); x1 = 1+ (1<<31); x2=x2 ^ ((x2 ^ (x2>>1) ^ (x2>>2) ^ (x2>>3))<<31); // skip first 50 double words (1600 bits) - //printf("n=0 : x1 %x, x2 %x\n",x1,x2); for (n=1; n<50; n++) { x1 = (x1>>1) ^ (x1>>4); x1 = x1 ^ (x1<<31) ^ (x1<<28); x2 = (x2>>1) ^ (x2>>2) ^ (x2>>3) ^ (x2>>4); x2 = x2 ^ (x2<<31) ^ (x2<<30) ^ (x2<<29) ^ (x2<<28); - // printf("x1 : %x, x2 : %x\n",x1,x2); } for (n=0; n<14; n++) { @@ -84,7 +81,6 @@ void lte_gold(LTE_DL_FRAME_PARMS *frame_parms,uint32_t lte_gold_table[20][2][14] x2 = (x2>>1) ^ (x2>>2) ^ (x2>>3) ^ (x2>>4); x2 = x2 ^ (x2<<31) ^ (x2<<30) ^ (x2<<29) ^ (x2<<28); lte_gold_table[ns][l][n] = x1^x2; - // printf("n=%d : c %x\n",n,x1^x2); } } diff --git a/openair1/PHY/LTE_TRANSPORT/dci.c b/openair1/PHY/LTE_TRANSPORT/dci.c index 70761ac5aea2fd11d921dafcc27662e58e4744aa..e79f603a49c5245f5bc761ffc808b51b0aacfe68 100644 --- a/openair1/PHY/LTE_TRANSPORT/dci.c +++ b/openair1/PHY/LTE_TRANSPORT/dci.c @@ -272,12 +272,12 @@ uint32_t Y; //#define Mquad (Msymb/4) static uint32_t bitrev_cc_dci[32] = {1,17,9,25,5,21,13,29,3,19,11,27,7,23,15,31,0,16,8,24,4,20,12,28,2,18,10,26,6,22,14,30}; -static mod_sym_t wtemp[2][Msymb]; +static int32_t wtemp[2][Msymb]; -void pdcch_interleaving(LTE_DL_FRAME_PARMS *frame_parms,mod_sym_t **z, mod_sym_t **wbar,uint8_t n_symbols_pdcch,uint8_t mi) +void pdcch_interleaving(LTE_DL_FRAME_PARMS *frame_parms,int32_t **z, int32_t **wbar,uint8_t n_symbols_pdcch,uint8_t mi) { - mod_sym_t *wptr,*wptr2,*zptr; + int32_t *wptr,*wptr2,*zptr; uint32_t Mquad = get_nquad(n_symbols_pdcch,frame_parms,mi); uint32_t RCC = (Mquad>>5), ND; uint32_t row,col,Kpi,index; @@ -2027,7 +2027,7 @@ uint8_t generate_dci_top(uint8_t num_ue_spec_dci, uint32_t n_rnti, int16_t amp, LTE_DL_FRAME_PARMS *frame_parms, - mod_sym_t **txdataF, + int32_t **txdataF, uint32_t subframe) { @@ -2038,10 +2038,10 @@ uint8_t generate_dci_top(uint8_t num_ue_spec_dci, int16_t re_offset; uint8_t mi = get_mi(frame_parms,subframe); static uint8_t e[DCI_BITS_MAX]; - static mod_sym_t yseq0[Msymb],yseq1[Msymb],wbar0[Msymb],wbar1[Msymb]; + static int32_t yseq0[Msymb],yseq1[Msymb],wbar0[Msymb],wbar1[Msymb]; - mod_sym_t *y[2]; - mod_sym_t *wbar[2]; + int32_t *y[2]; + int32_t *wbar[2]; int nushiftmod3 = frame_parms->nushift%3; diff --git a/openair1/PHY/LTE_TRANSPORT/dci_tools.c b/openair1/PHY/LTE_TRANSPORT/dci_tools.c index c9d68cd0aad7b4f3ade100c940d3ea8e658f81b9..a163225f03c77dac72e1d808221c577e6bc53dbe 100644 --- a/openair1/PHY/LTE_TRANSPORT/dci_tools.c +++ b/openair1/PHY/LTE_TRANSPORT/dci_tools.c @@ -40,8 +40,6 @@ #include "PHY/defs.h" #include "PHY/extern.h" #include "SCHED/defs.h" -#include "MAC_INTERFACE/defs.h" -#include "MAC_INTERFACE/extern.h" #ifdef DEBUG_DCI_TOOLS #include "PHY/vars.h" #endif @@ -253,8 +251,8 @@ void conv_rballoc(uint8_t ra_header,uint32_t rb_alloc,uint32_t N_RB_DL,uint32_t */ // printf("rb_alloc[1]=%x,rb_alloc[0]=%x\n",rb_alloc2[1],rb_alloc2[0]); } else { - LOG_E(PHY,"resource type 1 not supported for N_RB_DL=100\n"); - mac_xface->macphy_exit("resource type 1 not supported for N_RB_DL=100\n"); + LOG_E(PHY,"resource type 1 not supported for N_RB_DL=50\n"); + // mac_xface->macphy_exit("resource type 1 not supported for N_RB_DL=100\n"); /* subset = rb_alloc&1; shift = (rb_alloc>>1)&1; @@ -284,7 +282,7 @@ void conv_rballoc(uint8_t ra_header,uint32_t rb_alloc,uint32_t N_RB_DL,uint32_t } } else { LOG_E(PHY,"resource type 1 not supported for N_RB_DL=100\n"); - mac_xface->macphy_exit("resource type 1 not supported for N_RB_DL=100\n"); + // mac_xface->macphy_exit("resource type 1 not supported for N_RB_DL=100\n"); /* subset = rb_alloc&1; shift = (rb_alloc>>1)&1; @@ -734,11 +732,11 @@ void generate_RIV_tables() if (nVRB<32) alloc0 |= (1<<nVRB); else if (nVRB<64) - alloc1 |= (1<<(nVRB-33)); + alloc1 |= (1<<(nVRB-32)); else if (nVRB<96) - alloc2 |= (1<<(nVRB-65)); + alloc2 |= (1<<(nVRB-64)); else - alloc3 |= (1<<(nVRB-97)); + alloc3 |= (1<<(nVRB-96)); // Distributed Gap1, even slot nVRB_even_dist = get_prb(100,0,nVRB,0); @@ -770,9 +768,9 @@ void generate_RIV_tables() else if (nVRB_odd_dist<64) allocdist1_0_odd |= (1<<(nVRB_odd_dist-32)); else if (nVRB_odd_dist<96) - allocdist2_0_odd |= (1<<(nVRB_odd_dist-65)); + allocdist2_0_odd |= (1<<(nVRB_odd_dist-64)); else - allocdist3_0_odd |= (1<<(nVRB_odd_dist-97)); + allocdist3_0_odd |= (1<<(nVRB_odd_dist-96)); // Distributed Gap2, even slot @@ -4467,7 +4465,7 @@ int generate_ue_dlsch_params_from_dci(int frame, dlsch[0]->g_pucch += delta_PUCCH_lut[TPC&3]; if (TPC!=1) - LOG_I(PHY,"format1 TPC %d, dlsch0_harq->delta_PUCCH %d\n",TPC,dlsch0_harq->delta_PUCCH); + LOG_D(PHY,"format1 TPC %d, dlsch0_harq->delta_PUCCH %d\n",TPC,dlsch0_harq->delta_PUCCH); dlsch0_harq->rvidx = rv; @@ -4476,7 +4474,7 @@ int generate_ue_dlsch_params_from_dci(int frame, dlsch0_harq->dl_power_off = 1; //no power offset - LOG_D(PHY,"UE (%x/%d): Subframe %d Format2 DCI: ndi %d, old_ndi %d (first tx %d) harq_status %d\n",dlsch[0]->rnti,harq_pid,subframe,ndi,dlsch0_harq->DCINdi, + LOG_D(PHY,"UE (%x/%d): Subframe %d Format1 DCI: ndi %d, old_ndi %d (first tx %d) harq_status %d\n",dlsch[0]->rnti,harq_pid,subframe,ndi,dlsch0_harq->DCINdi, dlsch0_harq->first_tx,dlsch0_harq->status); // printf("Format2 DCI (UE, hard pid %d): ndi %d, old_ndi %d (first tx %d)\n",harq_pid,ndi,dlsch0_harq->DCINdi, @@ -7129,10 +7127,10 @@ int generate_eNB_ulsch_params_from_dci(void *dci_pdu, harq_pid = subframe2harq_pid(frame_parms, pdcch_alloc2ul_frame(frame_parms, - phy_vars_eNB->proc[sched_subframe].frame_tx, - subframe), + phy_vars_eNB->proc[sched_subframe].frame_tx, + subframe), pdcch_alloc2ul_subframe(frame_parms,subframe)); - + // printf("eNB: sched_subframe %d, subframe %d, frame_tx %d\n",sched_subframe,subframe,phy_vars_eNB->proc[sched_subframe].frame_tx); switch (frame_parms->N_RB_DL) { @@ -7600,9 +7598,9 @@ int generate_eNB_ulsch_params_from_dci(void *dci_pdu, break; } } else { - ulsch->harq_processes[harq_pid]->O_RI = 0;//1; + ulsch->harq_processes[harq_pid]->O_RI = 0; ulsch->harq_processes[harq_pid]->Or2 = 0; - ulsch->harq_processes[harq_pid]->Or1 = 0;//sizeof_HLC_subband_cqi_nopmi_5MHz; + ulsch->harq_processes[harq_pid]->Or1 = 0; ulsch->harq_processes[harq_pid]->uci_format = HLC_subband_cqi_nopmi; } diff --git a/openair1/PHY/LTE_TRANSPORT/defs.h b/openair1/PHY/LTE_TRANSPORT/defs.h index 3cd608aa149b5268eb78ba26d6c7fbb53136aeea..43bc7e3515975548bc4b2220febb89a5fd7ff171 100644 --- a/openair1/PHY/LTE_TRANSPORT/defs.h +++ b/openair1/PHY/LTE_TRANSPORT/defs.h @@ -269,8 +269,10 @@ typedef struct { uint32_t G; /// Codebook index for this dlsch (0,1,2,3) uint8_t codebook_index; - /// Maximum number of HARQ rounds (for definition see 36-212 V8.6 2009-03, p.17) + /// Maximum number of HARQ processes (for definition see 36-212 V8.6 2009-03, p.17) uint8_t Mdlharq; + /// Maximum number of HARQ rounds + uint8_t Mlimit; /// 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 @@ -315,11 +317,9 @@ typedef struct { /// Scrambled "b"-sequences (for definition see 36-211 V8.6 2009-03, p.14) uint8_t b_tilde[MAX_NUM_CHANNEL_BITS]; /// Modulated "d"-sequences (for definition see 36-211 V8.6 2009-03, p.14) - mod_sym_t d[MAX_NUM_RE]; + int32_t d[MAX_NUM_RE]; /// Transform-coded "z"-sequences (for definition see 36-211 V8.6 2009-03, p.14-15) - mod_sym_t z[MAX_NUM_RE]; - /// Maximum number of HARQ rounds (for definition see 36-212 V8.6 2009-03, p.17) - uint8_t Mdlharq; + int32_t z[MAX_NUM_RE]; /// "q" sequences for CQI/PMI (for definition see 36-212 V8.6 2009-03, p.27) uint8_t q[MAX_CQI_PAYLOAD]; /// coded and interleaved CQI bits @@ -468,8 +468,8 @@ typedef struct { typedef struct { /// Pointers to 8 HARQ processes for the ULSCH LTE_UL_eNB_HARQ_t *harq_processes[8]; - /// Maximum number of HARQ rounds (for definition see 36-212 V8.6 2009-03, p.17) - uint8_t Mdlharq; + /// Maximum number of HARQ rounds + uint8_t Mlimit; /// Maximum number of iterations used in eNB turbo decoder uint8_t max_turbo_iterations; /// ACK/NAK Bundling flag @@ -572,6 +572,10 @@ typedef struct { vrb_t vrb_type; /// downlink power offset field uint8_t dl_power_off; + /// trials per round statistics + uint32_t trials[8]; + /// error statistics per round + uint32_t errors[8]; } LTE_DL_UE_HARQ_t; typedef struct { @@ -698,7 +702,7 @@ typedef struct { harq_status_t harq_ack[10]; /// Pointers to up to 8 HARQ processes LTE_DL_UE_HARQ_t *harq_processes[8]; - /// Maximum number of HARQ rounds (for definition see 36-212 V8.6 2009-03, p.17 + /// Maximum number of HARQ processes(for definition see 36-212 V8.6 2009-03, p.17 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; diff --git a/openair1/PHY/LTE_TRANSPORT/dlsch_coding.c b/openair1/PHY/LTE_TRANSPORT/dlsch_coding.c index bf422fc37a5748b45942726c6cc6ce904f96834e..622ff51531525f1dd0e477090a8ff8ae624660b7 100644 --- a/openair1/PHY/LTE_TRANSPORT/dlsch_coding.c +++ b/openair1/PHY/LTE_TRANSPORT/dlsch_coding.c @@ -44,6 +44,7 @@ #include "PHY/CODING/extern.h" #include "PHY/CODING/lte_interleaver_inline.h" #include "PHY/LTE_TRANSPORT/defs.h" +#include "PHY/LTE_TRANSPORT/proto.h" #include "SCHED/defs.h" #include "defs.h" #include "UTIL/LOG/vcd_signal_dumper.h" @@ -92,11 +93,11 @@ void free_eNB_dlsch(LTE_eNB_DLSCH_t *dlsch) #endif for (r=0; r<MAX_NUM_DLSCH_SEGMENTS; r++) { - + #ifdef DEBUG_DLSCH_FREE msg("Freeing dlsch process %d c[%d] (%p)\n",i,r,dlsch->harq_processes[i]->c[r]); #endif - + if (dlsch->harq_processes[i]->c[r]) { free16(dlsch->harq_processes[i]->c[r],((r==0)?8:0) + 3+768); dlsch->harq_processes[i]->c[r] = NULL; @@ -105,17 +106,17 @@ void free_eNB_dlsch(LTE_eNB_DLSCH_t *dlsch) free16(dlsch->harq_processes[i]->d[r],(96+12+3+(3*6144))); dlsch->harq_processes[i]->d[r] = NULL; } - } - - free16(dlsch->harq_processes[i],sizeof(LTE_DL_eNB_HARQ_t)); - dlsch->harq_processes[i] = NULL; + + } + free16(dlsch->harq_processes[i],sizeof(LTE_DL_eNB_HARQ_t)); + dlsch->harq_processes[i] = NULL; } } - + free16(dlsch,sizeof(LTE_eNB_DLSCH_t)); dlsch = NULL; - } - + } + } 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) @@ -149,6 +150,7 @@ LTE_eNB_DLSCH_t *new_eNB_dlsch(unsigned char Kmimo,unsigned char Mdlharq,uint32_ bzero(dlsch,sizeof(LTE_eNB_DLSCH_t)); dlsch->Kmimo = Kmimo; dlsch->Mdlharq = Mdlharq; + dlsch->Mlimit = 4; dlsch->Nsoft = Nsoft; for (i=0; i<10; i++) @@ -205,28 +207,28 @@ LTE_eNB_DLSCH_t *new_eNB_dlsch(unsigned char Kmimo,unsigned char Mdlharq,uint32_ for (i=0; i<Mdlharq; i++) { dlsch->harq_processes[i]->round=0; - if (abstraction_flag==0) { - for (j=0; j<96; j++) - for (r=0; r<MAX_NUM_DLSCH_SEGMENTS/bw_scaling; r++) { - // printf("dlsch->harq_processes[%d]->d[%d] %p\n",i,r,dlsch->harq_processes[i]->d[r]); - dlsch->harq_processes[i]->d[r][j] = LTE_NULL; - } - } + for (j=0; j<96; j++) + for (r=0; r<MAX_NUM_DLSCH_SEGMENTS/bw_scaling; r++) { + // printf("dlsch->harq_processes[%d]->d[%d] %p\n",i,r,dlsch->harq_processes[i]->d[r]); + if (dlsch->harq_processes[i]->d[r]) + dlsch->harq_processes[i]->d[r][j] = LTE_NULL; + } + } return(dlsch); } } - LOG_D(PHY, "new_eNB_dlsch exit flag %d, size of %ld\n", - exit_flag, sizeof(LTE_eNB_DLSCH_t)); + LOG_D(PHY,"new_eNB_dlsch exit flag %d, size of %ld\n", + exit_flag, sizeof(LTE_eNB_DLSCH_t)); free_eNB_dlsch(dlsch); return(NULL); } -void clean_eNb_dlsch(LTE_eNB_DLSCH_t *dlsch, uint8_t abstraction_flag) +void clean_eNb_dlsch(LTE_eNB_DLSCH_t *dlsch) { unsigned char Mdlharq; @@ -246,12 +248,11 @@ void clean_eNb_dlsch(LTE_eNB_DLSCH_t *dlsch, uint8_t abstraction_flag) dlsch->harq_processes[i]->status = 0; dlsch->harq_processes[i]->round = 0; - if (abstraction_flag==0) { - for (j=0; j<96; j++) - for (r=0; r<MAX_NUM_DLSCH_SEGMENTS; r++) - if (dlsch->harq_processes[i]->d[r]) - dlsch->harq_processes[i]->d[r][j] = LTE_NULL; - } + for (j=0; j<96; j++) + for (r=0; r<MAX_NUM_DLSCH_SEGMENTS; r++) + if (dlsch->harq_processes[i]->d[r]) + dlsch->harq_processes[i]->d[r][j] = LTE_NULL; + } } } diff --git a/openair1/PHY/LTE_TRANSPORT/dlsch_decoding.c b/openair1/PHY/LTE_TRANSPORT/dlsch_decoding.c index efcd868338602a7d49cba70a1709073d8efdbad2..2e8d70102ffec29619a46849b7d3d80cbae43f86 100644 --- a/openair1/PHY/LTE_TRANSPORT/dlsch_decoding.c +++ b/openair1/PHY/LTE_TRANSPORT/dlsch_decoding.c @@ -117,7 +117,7 @@ LTE_UE_DLSCH_t *new_ue_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint32_t Nsoft,uint8_ dlsch->max_turbo_iterations = max_turbo_iterations; for (i=0; i<Mdlharq; i++) { - // msg("new_ue_dlsch: Harq process %d\n",i); + // printf("new_ue_dlsch: Harq process %d\n",i); dlsch->harq_processes[i] = (LTE_DL_UE_HARQ_t *)malloc16(sizeof(LTE_DL_UE_HARQ_t)); if (dlsch->harq_processes[i]) { @@ -156,7 +156,7 @@ LTE_UE_DLSCH_t *new_ue_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint32_t Nsoft,uint8_ return(dlsch); } - msg("new_ue_dlsch with size %zu: exit_flag = %u\n",sizeof(LTE_DL_UE_HARQ_t), exit_flag); + printf("new_ue_dlsch with size %zu: exit_flag = %u\n",sizeof(LTE_DL_UE_HARQ_t), exit_flag); free_ue_dlsch(dlsch); return(NULL); @@ -187,6 +187,27 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue, uint8_t crc_type; #ifdef DEBUG_DLSCH_DECODING uint16_t i; +#endif +#ifdef __AVX2__ + int Kr_last,skipped_last=0; + uint8_t (*tc_2cw)(int16_t *y, + int16_t *y2, + uint8_t *, + uint8_t *, + uint16_t, + uint16_t, + uint16_t, + uint8_t, + uint8_t, + uint8_t, + time_stats_t *, + time_stats_t *, + time_stats_t *, + time_stats_t *, + time_stats_t *, + time_stats_t *, + time_stats_t *); + #endif uint8_t (*tc)(int16_t *y, uint8_t *, @@ -204,28 +225,35 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue, time_stats_t *, time_stats_t *); + + + if (!dlsch_llr) { - msg("dlsch_decoding.c: NULL dlsch_llr pointer\n"); + printf("dlsch_decoding.c: NULL dlsch_llr pointer\n"); return(dlsch->max_turbo_iterations); } if (!harq_process) { - msg("dlsch_decoding.c: NULL harq_process pointer\n"); + printf("dlsch_decoding.c: NULL harq_process pointer\n"); return(dlsch->max_turbo_iterations); } if (!frame_parms) { - msg("dlsch_decoding.c: NULL frame_parms pointer\n"); + printf("dlsch_decoding.c: NULL frame_parms pointer\n"); return(dlsch->max_turbo_iterations); } if (subframe>9) { - msg("dlsch_decoding.c: Illegal subframe index %d\n",subframe); + printf("dlsch_decoding.c: Illegal subframe index %d\n",subframe); return(dlsch->max_turbo_iterations); } - if (llr8_flag == 0) + if (llr8_flag == 0) { +#ifdef __AVX2__ + tc_2cw = phy_threegpplte_turbo_decoder16avx2; +#endif tc = phy_threegpplte_turbo_decoder16; + } else tc = phy_threegpplte_turbo_decoder8; @@ -233,16 +261,19 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue, /* if (nb_rb > frame_parms->N_RB_DL) { - msg("dlsch_decoding.c: Illegal nb_rb %d\n",nb_rb); + printf("dlsch_decoding.c: Illegal nb_rb %d\n",nb_rb); return(max_turbo_iterations); }*/ /*harq_pid = dlsch->current_harq_pid; if (harq_pid >= 8) { - msg("dlsch_decoding.c: Illegal harq_pid %d\n",harq_pid); + printf("dlsch_decoding.c: Illegal harq_pid %d\n",harq_pid); return(max_turbo_iterations); } */ + + harq_process->trials[harq_process->round]++; + A = harq_process->TBS; //2072 for QPSK 1/3 ret = dlsch->max_turbo_iterations; @@ -251,7 +282,7 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue, G = harq_process->G; //get_G(frame_parms,nb_rb,dlsch->rb_alloc,mod_order,num_pdcch_symbols,phy_vars_ue->frame,subframe); - // msg("DLSCH Decoding, harq_pid %d Ndi %d\n",harq_pid,harq_process->Ndi); + // printf("DLSCH Decoding, harq_pid %d Ndi %d\n",harq_pid,harq_process->Ndi); if (harq_process->round == 0) { // This is a new packet, so compute quantities regarding segmentation @@ -270,7 +301,7 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue, /* else { - msg("dlsch_decoding.c: Ndi>0 not checked yet!!\n"); + printf("dlsch_decoding.c: Ndi>0 not checked yet!!\n"); return(max_turbo_iterations); } */ @@ -297,10 +328,14 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue, break; } - if (harq_process->C >= MAX_NUM_DLSCH_SEGMENTS/bw_scaling) { + if (harq_process->C > MAX_NUM_DLSCH_SEGMENTS/bw_scaling) { LOG_E(PHY,"Illegal harq_process->C %d > %d\n",harq_process->C,MAX_NUM_DLSCH_SEGMENTS/bw_scaling); return((1+dlsch->max_turbo_iterations)); } +#ifdef DEBUG_DLSCH_DECODING + printf("Segmentation: C %d, Cminus %d, Kminus %d, Kplus %d\n",harq_process->C,harq_process->Cminus,harq_process->Kminus,harq_process->Kplus); +#endif + for (r=0; r<harq_process->C; r++) { @@ -321,7 +356,7 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue, else if (Kr_bytes <= 768) iind = 123 + ((Kr_bytes-256)>>3); else { - msg("dlsch_decoding: Illegal codeword size %d!!!\n",Kr_bytes); + printf("dlsch_decoding: Illegal codeword size %d!!!\n",Kr_bytes); return(dlsch->max_turbo_iterations); } @@ -415,15 +450,12 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue, printf("\n"); */ + //#ifndef __AVX2__ +#if 1 if (err_flag == 0) { start_meas(dlsch_turbo_decoding_stats); -#ifdef TURBO_S - ret = phy_threegpplte_turbo_decoder_scalar -#else - ret = tc -#endif (&harq_process->d[r][96], harq_process->c[r], Kr, @@ -443,7 +475,130 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue, stop_meas(dlsch_turbo_decoding_stats); } +#else + if ((harq_process->C == 1) || + ((r==harq_process->C-1) && (skipped_last==0))) { // last segment with odd number of segments + + start_meas(dlsch_turbo_decoding_stats); + ret = tc + (&harq_process->d[r][96], + harq_process->c[r], + Kr, + f1f2mat_old[iind*2], + f1f2mat_old[(iind*2)+1], + dlsch->max_turbo_iterations, + crc_type, + (r==0) ? harq_process->F : 0, + &phy_vars_ue->dlsch_tc_init_stats, + &phy_vars_ue->dlsch_tc_alpha_stats, + &phy_vars_ue->dlsch_tc_beta_stats, + &phy_vars_ue->dlsch_tc_gamma_stats, + &phy_vars_ue->dlsch_tc_ext_stats, + &phy_vars_ue->dlsch_tc_intl1_stats, + &phy_vars_ue->dlsch_tc_intl2_stats); //(is_crnti==0)?harq_pid:harq_pid+1); + stop_meas(dlsch_turbo_decoding_stats); + // printf("single decode, exit\n"); + // exit(-1); + } + else { + // we can merge code segments + if ((skipped_last == 0) && (r<harq_process->C-1)) { + skipped_last = 1; + Kr_last = Kr; + } + else { + skipped_last=0; + + if (Kr_last == Kr) { // decode 2 code segments with AVX2 version +#ifdef DEBUG_DLSCH_DECODING + printf("single decoding segment %d (%p)\n",r-1,&harq_process->d[r-1][96]); +#endif + start_meas(dlsch_turbo_decoding_stats); +#ifdef DEBUG_DLSCH_DECODING + printf("double decoding segments %d,%d (%p,%p)\n",r-1,r,&harq_process->d[r-1][96],&harq_process->d[r][96]); +#endif + ret = tc_2cw + (&harq_process->d[r-1][96], + &harq_process->d[r][96], + harq_process->c[r-1], + harq_process->c[r], + Kr, + f1f2mat_old[iind*2], + f1f2mat_old[(iind*2)+1], + dlsch->max_turbo_iterations, + crc_type, + (r==0) ? harq_process->F : 0, + &phy_vars_ue->dlsch_tc_init_stats, + &phy_vars_ue->dlsch_tc_alpha_stats, + &phy_vars_ue->dlsch_tc_beta_stats, + &phy_vars_ue->dlsch_tc_gamma_stats, + &phy_vars_ue->dlsch_tc_ext_stats, + &phy_vars_ue->dlsch_tc_intl1_stats, + &phy_vars_ue->dlsch_tc_intl2_stats); //(is_crnti==0)?harq_pid:harq_pid+1); + /* + ret = tc + (&harq_process->d[r-1][96], + harq_process->c[r-1], + Kr_last, + f1f2mat_old[iind*2], + f1f2mat_old[(iind*2)+1], + dlsch->max_turbo_iterations, + crc_type, + (r==0) ? harq_process->F : 0, + &phy_vars_ue->dlsch_tc_init_stats, + &phy_vars_ue->dlsch_tc_alpha_stats, + &phy_vars_ue->dlsch_tc_beta_stats, + &phy_vars_ue->dlsch_tc_gamma_stats, + &phy_vars_ue->dlsch_tc_ext_stats, + &phy_vars_ue->dlsch_tc_intl1_stats, + &phy_vars_ue->dlsch_tc_intl2_stats); //(is_crnti==0)?harq_pid:harq_pid+1); + exit(-1);*/ + stop_meas(dlsch_turbo_decoding_stats); + } + else { // Kr_last != Kr + start_meas(dlsch_turbo_decoding_stats); + ret = tc + (&harq_process->d[r-1][96], + harq_process->c[r-1], + Kr_last, + f1f2mat_old[iind*2], + f1f2mat_old[(iind*2)+1], + dlsch->max_turbo_iterations, + crc_type, + (r==0) ? harq_process->F : 0, + &phy_vars_ue->dlsch_tc_init_stats, + &phy_vars_ue->dlsch_tc_alpha_stats, + &phy_vars_ue->dlsch_tc_beta_stats, + &phy_vars_ue->dlsch_tc_gamma_stats, + &phy_vars_ue->dlsch_tc_ext_stats, + &phy_vars_ue->dlsch_tc_intl1_stats, + &phy_vars_ue->dlsch_tc_intl2_stats); //(is_crnti==0)?harq_pid:harq_pid+1); + stop_meas(dlsch_turbo_decoding_stats); + + start_meas(dlsch_turbo_decoding_stats); + ret = tc + (&harq_process->d[r][96], + harq_process->c[r], + Kr, + f1f2mat_old[iind*2], + f1f2mat_old[(iind*2)+1], + dlsch->max_turbo_iterations, + crc_type, + (r==0) ? harq_process->F : 0, + &phy_vars_ue->dlsch_tc_init_stats, + &phy_vars_ue->dlsch_tc_alpha_stats, + &phy_vars_ue->dlsch_tc_beta_stats, + &phy_vars_ue->dlsch_tc_gamma_stats, + &phy_vars_ue->dlsch_tc_ext_stats, + &phy_vars_ue->dlsch_tc_intl1_stats, + &phy_vars_ue->dlsch_tc_intl2_stats); //(is_crnti==0)?harq_pid:harq_pid+1); + stop_meas(dlsch_turbo_decoding_stats); + + } + } + } +#endif if ((err_flag == 0) && (ret>=(1+dlsch->max_turbo_iterations))) {// a Code segment is in error so break; @@ -457,6 +612,7 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue, dlsch->harq_ack[subframe].ack = 0; dlsch->harq_ack[subframe].harq_id = harq_pid; dlsch->harq_ack[subframe].send_harq_status = 1; + harq_process->errors[harq_process->round]++; harq_process->round++; // LOG_D(PHY,"[UE %d] DLSCH: Setting NACK for subframe %d (pid %d, round %d)\n",phy_vars_ue->Mod_id,subframe,harq_pid,harq_process->round); diff --git a/openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c b/openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c index de9acefb6ee3696609ff0001f915f209364bebc3..19ce6b9edc8ed2879c26fbbe7acb2aae35507398 100644 --- a/openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c +++ b/openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c @@ -281,7 +281,7 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue, // avgs = cmax(avgs,avg[(aarx<<1)+aatx]); - lte_ue_pdsch_vars[eNB_id]->log2_maxh = (log2_approx(avgs)/2); + lte_ue_pdsch_vars[eNB_id]->log2_maxh = (log2_approx(avgs)/2)+1; // + log2_approx(frame_parms->nb_antennas_tx_eNB-1) //-1 because log2_approx counts the number of bits // + log2_approx(frame_parms->nb_antennas_rx-1); @@ -1898,17 +1898,17 @@ void dlsch_channel_compensation_TM3(LTE_DL_FRAME_PARMS *frame_parms, for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) { - dl_ch0_128 = (__m128i *)&dl_ch_estimates_ext[aarx][symbol*frame_parms->N_RB_DL*12]; - dl_ch1_128 = (__m128i *)&dl_ch_estimates_ext[2+aarx][symbol*frame_parms->N_RB_DL*12]; + dl_ch0_128 = (__m128i *)&dl_ch_estimates_ext[aarx][symbol*frame_parms->N_RB_DL*12]; // hr,0 + dl_ch1_128 = (__m128i *)&dl_ch_estimates_ext[2+aarx][symbol*frame_parms->N_RB_DL*12]; // hr,1 dl_ch_mag0_128 = (__m128i *)&dl_ch_mag0[aarx][symbol*frame_parms->N_RB_DL*12]; dl_ch_mag0_128b = (__m128i *)&dl_ch_magb0[aarx][symbol*frame_parms->N_RB_DL*12]; dl_ch_mag1_128 = (__m128i *)&dl_ch_mag1[aarx][symbol*frame_parms->N_RB_DL*12]; dl_ch_mag1_128b = (__m128i *)&dl_ch_magb1[aarx][symbol*frame_parms->N_RB_DL*12]; - rxdataF128 = (__m128i *)&rxdataF_ext[aarx][symbol*frame_parms->N_RB_DL*12]; - rxdataF_comp0_128 = (__m128i *)&rxdataF_comp0[aarx][symbol*frame_parms->N_RB_DL*12]; - rxdataF_comp1_128 = (__m128i *)&rxdataF_comp1[aarx][symbol*frame_parms->N_RB_DL*12]; + rxdataF128 = (__m128i *)&rxdataF_ext[aarx][symbol*frame_parms->N_RB_DL*12]; // yr + rxdataF_comp0_128 = (__m128i *)&rxdataF_comp0[aarx][symbol*frame_parms->N_RB_DL*12]; // yr,0 = yr * conj(hr,0) + rxdataF_comp1_128 = (__m128i *)&rxdataF_comp1[aarx][symbol*frame_parms->N_RB_DL*12]; // yr,1 = yr * conj(hr,1) for (rb=0; rb<nb_rb; rb++) { diff --git a/openair1/PHY/LTE_TRANSPORT/dlsch_modulation.c b/openair1/PHY/LTE_TRANSPORT/dlsch_modulation.c index 3b9c58ca1bdd03ee55ca7606dadcb665014916a6..06aa2656be32001cc08a37f24dcb05a50598ab20 100644 --- a/openair1/PHY/LTE_TRANSPORT/dlsch_modulation.c +++ b/openair1/PHY/LTE_TRANSPORT/dlsch_modulation.c @@ -137,7 +137,7 @@ void layer1prec2A(int32_t *antenna0_sample, int32_t *antenna1_sample, uint8_t pr } int allocate_REs_in_RB(LTE_DL_FRAME_PARMS *frame_parms, - mod_sym_t **txdataF, + int32_t **txdataF, uint32_t *jj, uint32_t *jj2, uint16_t re_offset, @@ -981,7 +981,7 @@ int allocate_REs_in_RB(LTE_DL_FRAME_PARMS *frame_parms, return(0); } -int allocate_REs_in_RB_MCH(mod_sym_t **txdataF, +int allocate_REs_in_RB_MCH(int32_t **txdataF, uint32_t *jj, uint16_t re_offset, uint32_t symbol_offset, @@ -1178,7 +1178,7 @@ uint8_t get_pmi(uint8_t N_RB_DL,LTE_DL_eNB_HARQ_t *dlsch_harq,uint16_t rb) } -int dlsch_modulation(mod_sym_t **txdataF, +int dlsch_modulation(int32_t **txdataF, int16_t amp, uint32_t subframe_offset, LTE_DL_FRAME_PARMS *frame_parms, @@ -1492,7 +1492,7 @@ int dlsch_modulation(mod_sym_t **txdataF, return (re_allocated); } -int mch_modulation(mod_sym_t **txdataF, +int mch_modulation(int32_t **txdataF, int16_t amp, uint32_t subframe_offset, LTE_DL_FRAME_PARMS *frame_parms, diff --git a/openair1/PHY/LTE_TRANSPORT/drs_modulation.c b/openair1/PHY/LTE_TRANSPORT/drs_modulation.c index 1b9df8046f81ad1d4d72f2c7ea79a10d8fc0d767..097bcdd691cde68864bb22b4e064b9679a43c7db 100644 --- a/openair1/PHY/LTE_TRANSPORT/drs_modulation.c +++ b/openair1/PHY/LTE_TRANSPORT/drs_modulation.c @@ -63,7 +63,7 @@ int generate_drs_pusch(PHY_VARS_UE *phy_vars_ue, uint8_t cyclic_shift,cyclic_shift0,cyclic_shift1; LTE_DL_FRAME_PARMS *frame_parms = &phy_vars_ue->lte_frame_parms; - mod_sym_t *txdataF = phy_vars_ue->lte_ue_common_vars.txdataF[ant]; + int32_t *txdataF = phy_vars_ue->lte_ue_common_vars.txdataF[ant]; uint32_t u,v,alpha_ind; uint32_t u0=frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.grouphop[subframe<<1]; uint32_t u1=frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.grouphop[1+(subframe<<1)]; @@ -147,13 +147,13 @@ int generate_drs_pusch(PHY_VARS_UE *phy_vars_ue, if (cyclic_shift == 0) { for (k=0; k<12; k++) { if ((ul_ref_sigs[u][v][Msc_RS_idx][drs_offset<<1] >= 0) && (ul_ref_sigs[u][v][Msc_RS_idx][(drs_offset<<1)+1] >= 0)) - txdataF[symbol_offset+re_offset] = (mod_sym_t) 1; + txdataF[symbol_offset+re_offset] = (int32_t) 1; else if ((ul_ref_sigs[u][v][Msc_RS_idx][drs_offset<<1] >= 0) && (ul_ref_sigs[u][v][Msc_RS_idx][(drs_offset<<1)+1] < 0)) - txdataF[symbol_offset+re_offset] = (mod_sym_t) 2; + txdataF[symbol_offset+re_offset] = (int32_t) 2; else if ((ul_ref_sigs[u][v][Msc_RS_idx][drs_offset<<1] < 0) && (ul_ref_sigs[u][v][Msc_RS_idx][(drs_offset<<1)+1] >= 0)) - txdataF[symbol_offset+re_offset] = (mod_sym_t) 3; + txdataF[symbol_offset+re_offset] = (int32_t) 3; else if ((ul_ref_sigs[u][v][Msc_RS_idx][drs_offset<<1] < 0) && (ul_ref_sigs[u][v][Msc_RS_idx][(drs_offset<<1)+1] < 0)) - txdataF[symbol_offset+re_offset] = (mod_sym_t) 4; + txdataF[symbol_offset+re_offset] = (int32_t) 4; re_offset++; drs_offset++; @@ -165,22 +165,22 @@ int generate_drs_pusch(PHY_VARS_UE *phy_vars_ue, for (k=0; k<12; k++) { if(k%2 == 0) { if ((ul_ref_sigs[u][v][Msc_RS_idx][drs_offset<<1] >= 0) && (ul_ref_sigs[u][v][Msc_RS_idx][(drs_offset<<1)+1] >= 0)) - txdataF[symbol_offset+re_offset] = (mod_sym_t) 4; + txdataF[symbol_offset+re_offset] = (int32_t) 4; else if ((ul_ref_sigs[u][v][Msc_RS_idx][drs_offset<<1] >= 0) && (ul_ref_sigs[u][v][Msc_RS_idx][(drs_offset<<1)+1] < 0)) - txdataF[symbol_offset+re_offset] = (mod_sym_t) 3; + txdataF[symbol_offset+re_offset] = (int32_t) 3; else if ((ul_ref_sigs[u][v][Msc_RS_idx][drs_offset<<1] < 0) && (ul_ref_sigs[u][v][Msc_RS_idx][(drs_offset<<1)+1] >= 0)) - txdataF[symbol_offset+re_offset] = (mod_sym_t) 2; + txdataF[symbol_offset+re_offset] = (int32_t) 2; else if ((ul_ref_sigs[u][v][Msc_RS_idx][drs_offset<<1] < 0) && (ul_ref_sigs[u][v][Msc_RS_idx][(drs_offset<<1)+1] < 0)) - txdataF[symbol_offset+re_offset] = (mod_sym_t) 1; + txdataF[symbol_offset+re_offset] = (int32_t) 1; } else { if ((ul_ref_sigs[u][v][Msc_RS_idx][drs_offset<<1] >= 0) && (ul_ref_sigs[u][v][Msc_RS_idx][(drs_offset<<1)+1] >= 0)) - txdataF[symbol_offset+re_offset] = (mod_sym_t) 1; + txdataF[symbol_offset+re_offset] = (int32_t) 1; else if ((ul_ref_sigs[u][v][Msc_RS_idx][drs_offset<<1] >= 0) && (ul_ref_sigs[u][v][Msc_RS_idx][(drs_offset<<1)+1] < 0)) - txdataF[symbol_offset+re_offset] = (mod_sym_t) 2; + txdataF[symbol_offset+re_offset] = (int32_t) 2; else if ((ul_ref_sigs[u][v][Msc_RS_idx][drs_offset<<1] < 0) && (ul_ref_sigs[u][v][Msc_RS_idx][(drs_offset<<1)+1] >= 0)) - txdataF[symbol_offset+re_offset] = (mod_sym_t) 3; + txdataF[symbol_offset+re_offset] = (int32_t) 3; else if ((ul_ref_sigs[u][v][Msc_RS_idx][drs_offset<<1] < 0) && (ul_ref_sigs[u][v][Msc_RS_idx][(drs_offset<<1)+1] < 0)) - txdataF[symbol_offset+re_offset] = (mod_sym_t) 4; + txdataF[symbol_offset+re_offset] = (int32_t) 4; } re_offset++; diff --git a/openair1/PHY/LTE_TRANSPORT/group_hopping.c b/openair1/PHY/LTE_TRANSPORT/group_hopping.c index 992ac3088d316662cd9fbeebd48f6710e8e69e35..64c0830386faabed6f6d028a28edad8c42acbbeb 100644 --- a/openair1/PHY/LTE_TRANSPORT/group_hopping.c +++ b/openair1/PHY/LTE_TRANSPORT/group_hopping.c @@ -52,7 +52,7 @@ void generate_grouphop(LTE_DL_FRAME_PARMS *frame_parms) x2 = frame_parms->Nid_cell/30; #ifdef DEBUG_GROUPHOP - msg("[PHY] GroupHop:"); + printf("[PHY] GroupHop:"); #endif for (ns=0; ns<20; ns++) { @@ -68,12 +68,12 @@ void generate_grouphop(LTE_DL_FRAME_PARMS *frame_parms) } #ifdef DEBUG_GROUPHOP - msg("%d.",frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.grouphop[ns]); + printf("%d.",frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.grouphop[ns]); #endif } #ifdef DEBUG_GROUPHOP - msg("\n"); + printf("\n"); #endif } @@ -89,7 +89,7 @@ void generate_seqhop(LTE_DL_FRAME_PARMS *frame_parms) s = lte_gold_generic(&x1,&x2,reset); #ifdef DEBUG_GROUPHOP - msg("[PHY] SeqHop:"); + printf("[PHY] SeqHop:"); #endif for (ns=0; ns<20; ns++) { @@ -100,12 +100,12 @@ void generate_seqhop(LTE_DL_FRAME_PARMS *frame_parms) frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.seqhop[ns] = 0; #ifdef DEBUG_GROUPHOP - msg("%d.",frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.seqhop[ns]); + printf("%d.",frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.seqhop[ns]); #endif } #ifdef DEBUG_GROUPHOP - msg("\n"); + printf("\n"); #endif } @@ -116,7 +116,7 @@ void generate_nPRS(LTE_DL_FRAME_PARMS *frame_parms) uint8_t reset=1; uint32_t x1, x2, s=0; // This is from Section 5.5.1.3 - uint8_t Nsymb_UL = (frame_parms->Ncp_UL == 0) ? 7 : 6; + uint8_t Nsymb_UL = (frame_parms->Ncp_UL == NORMAL) ? 7 : 6; uint16_t next = 0; uint8_t ns=0; @@ -124,7 +124,7 @@ void generate_nPRS(LTE_DL_FRAME_PARMS *frame_parms) x2 = (32*(uint32_t)(frame_parms->Nid_cell/30)) + fss_pusch; #ifdef DEBUG_GROUPHOP - msg("[PHY] nPRS:"); + printf("[PHY] nPRS:"); #endif for (n=0; n<(20*Nsymb_UL); n++) { //loop over total number of bytes to generate @@ -137,7 +137,7 @@ void generate_nPRS(LTE_DL_FRAME_PARMS *frame_parms) if (n == next) { frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.nPRS[ns] = ((uint8_t*)&s)[next&3]; #ifdef DEBUG_GROUPHOP - msg("%d.",frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.nPRS[ns]); + printf("%d.",frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.nPRS[ns]); #endif ns++; next+=Nsymb_UL; @@ -145,7 +145,7 @@ void generate_nPRS(LTE_DL_FRAME_PARMS *frame_parms) } #ifdef DEBUG_GROUPHOP - msg("\n"); + printf("\n"); #endif } diff --git a/openair1/PHY/LTE_TRANSPORT/pbch.c b/openair1/PHY/LTE_TRANSPORT/pbch.c index 0eee263a10f14aea989bd05f6d8e89bd962a9028..b7b7149c627750c6c40e7dc13b2e1cfe943aad43 100755 --- a/openair1/PHY/LTE_TRANSPORT/pbch.c +++ b/openair1/PHY/LTE_TRANSPORT/pbch.c @@ -61,7 +61,7 @@ #define PBCH_A 24 int allocate_pbch_REs_in_RB(LTE_DL_FRAME_PARMS *frame_parms, - mod_sym_t **txdataF, + int32_t **txdataF, uint32_t *jj, uint16_t re_offset, uint32_t symbol_offset, @@ -160,7 +160,7 @@ int allocate_pbch_REs_in_RB(LTE_DL_FRAME_PARMS *frame_parms, //uint8_t pbch_d[96+(3*(16+PBCH_A))], pbch_w[3*3*(16+PBCH_A)],pbch_e[1920]; //one bit per byte int generate_pbch(LTE_eNB_PBCH *eNB_pbch, - mod_sym_t **txdataF, + int32_t **txdataF, int amp, LTE_DL_FRAME_PARMS *frame_parms, uint8_t *pbch_pdu, diff --git a/openair1/PHY/LTE_TRANSPORT/pcfich.c b/openair1/PHY/LTE_TRANSPORT/pcfich.c index f289fd3bd078afed7dbb67f65d5cee1859552564..915ce17a45c1016cc454f21970d67d4a5220e7af 100644 --- a/openair1/PHY/LTE_TRANSPORT/pcfich.c +++ b/openair1/PHY/LTE_TRANSPORT/pcfich.c @@ -38,7 +38,6 @@ * \warning */ #include "PHY/defs.h" -#include "MAC_INTERFACE/extern.h" //uint16_t pcfich_reg[4]; //uint8_t pcfich_first_reg_idx = 0; @@ -144,12 +143,12 @@ uint8_t pcfich_b[4][32]= {{0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1 void generate_pcfich(uint8_t num_pdcch_symbols, int16_t amp, LTE_DL_FRAME_PARMS *frame_parms, - mod_sym_t **txdataF, + int32_t **txdataF, uint8_t subframe) { uint8_t pcfich_bt[32],nsymb,pcfich_quad; - mod_sym_t pcfich_d[2][16]; + int32_t pcfich_d[2][16]; uint8_t i; uint32_t symbol_offset,m,re_offset,reg_offset; int16_t gain_lin_QPSK; diff --git a/openair1/PHY/LTE_TRANSPORT/phich.c b/openair1/PHY/LTE_TRANSPORT/phich.c index e08ad239bdc9a9c0a83e57dcfca799ebb56d4a4c..c9ce0cbb9a2524e3a5ea21be497e07f192a11ba8 100644 --- a/openair1/PHY/LTE_TRANSPORT/phich.c +++ b/openair1/PHY/LTE_TRANSPORT/phich.c @@ -46,6 +46,8 @@ #include "ARCH/CBMIMO1/DEVICE_DRIVER/extern.h" #endif +#include "T.h" + //#define DEBUG_PHICH 1 //extern unsigned short pcfich_reg[4]; @@ -393,8 +395,8 @@ void generate_phich_emul(LTE_DL_FRAME_PARMS *frame_parms, } -mod_sym_t alam_bpsk_perm1[4] = {2,1,4,3}; // -conj(x) 1 (-1-j) -> 2 (1-j), 2->1, 3 (-1+j) -> (4) 1+j, 4->3 -mod_sym_t alam_bpsk_perm2[4] = {3,4,2,1}; // conj(x) 1 (-1-j) -> 3 (-1+j), 3->1, 2 (1-j) -> 4 (1+j), 4->2 +int32_t alam_bpsk_perm1[4] = {2,1,4,3}; // -conj(x) 1 (-1-j) -> 2 (1-j), 2->1, 3 (-1+j) -> (4) 1+j, 4->3 +int32_t alam_bpsk_perm2[4] = {3,4,2,1}; // conj(x) 1 (-1-j) -> 3 (-1+j), 3->1, 2 (1-j) -> 4 (1+j), 4->2 // This routine generates the PHICH @@ -404,7 +406,7 @@ void generate_phich(LTE_DL_FRAME_PARMS *frame_parms, uint8_t ngroup_PHICH, uint8_t HI, uint8_t subframe, - mod_sym_t **y) + int32_t **y) { int16_t d[24],*dp; @@ -1425,7 +1427,7 @@ void generate_phich_top(PHY_VARS_eNB *phy_vars_eNB, LTE_DL_FRAME_PARMS *frame_parms=&phy_vars_eNB->lte_frame_parms; LTE_eNB_ULSCH_t **ulsch_eNB = phy_vars_eNB->ulsch_eNB; - mod_sym_t **txdataF = phy_vars_eNB->lte_eNB_common_vars.txdataF[sect_id]; + int32_t **txdataF = phy_vars_eNB->lte_eNB_common_vars.txdataF[sect_id]; uint8_t harq_pid; uint8_t Ngroup_PHICH,ngroup_PHICH,nseq_PHICH; uint8_t NSF_PHICH = 4; @@ -1466,7 +1468,6 @@ void generate_phich_top(PHY_VARS_eNB *phy_vars_eNB, nseq_PHICH = ((ulsch_eNB[UE_id]->harq_processes[harq_pid]->first_rb/Ngroup_PHICH) + ulsch_eNB[UE_id]->harq_processes[harq_pid]->n_DMRS)%(2*NSF_PHICH); - //#ifdef DEBUG_PHICH LOG_D(PHY,"[eNB %d][PUSCH %d] Frame %d subframe %d Generating PHICH, ngroup_PHICH %d/%d, nseq_PHICH %d : HI %d, first_rb %d dci_alloc %d)\n", phy_vars_eNB->Mod_id,harq_pid,phy_vars_eNB->proc[sched_subframe].frame_tx, subframe,ngroup_PHICH,Ngroup_PHICH,nseq_PHICH, @@ -1474,7 +1475,6 @@ void generate_phich_top(PHY_VARS_eNB *phy_vars_eNB, ulsch_eNB[UE_id]->harq_processes[harq_pid]->first_rb, ulsch_eNB[UE_id]->harq_processes[harq_pid]->dci_alloc); - //#endif if (ulsch_eNB[UE_id]->Msg3_active == 1) { LOG_D(PHY,"[eNB %d][PUSCH %d][RAPROC] Frame %d, subframe %d: Generating Msg3 PHICH for UE %d, ngroup_PHICH %d/%d, nseq_PHICH %d : HI %d, first_rb %d\n", phy_vars_eNB->Mod_id,harq_pid,phy_vars_eNB->proc[sched_subframe].frame_tx,subframe, @@ -1506,15 +1506,15 @@ void generate_phich_top(PHY_VARS_eNB *phy_vars_eNB, if ((ulsch_eNB[UE_id]->harq_processes[harq_pid]->dci_alloc == 0) && (ulsch_eNB[UE_id]->harq_processes[harq_pid]->rar_alloc == 0) ) { if (ulsch_eNB[UE_id]->harq_processes[harq_pid]->phich_ACK==0 ) { + T(T_ENB_ULSCH_UE_NO_DCI_RETRANSMISSION, T_INT(phy_vars_eNB->Mod_id), T_INT(phy_vars_eNB->proc[sched_subframe].frame_tx), + T_INT(subframe), T_INT(UE_id), T_INT(ulsch_eNB[UE_id]->rnti), T_INT(harq_pid)); LOG_D(PHY,"[eNB %d][PUSCH %d] frame %d, subframe %d : PHICH NACK / (no format0 DCI) Setting subframe_scheduling_flag\n", phy_vars_eNB->Mod_id,harq_pid,phy_vars_eNB->proc[sched_subframe].frame_tx,subframe); ulsch_eNB[UE_id]->harq_processes[harq_pid]->subframe_scheduling_flag = 1; - // ulsch_eNB[UE_id]->harq_processes[harq_pid]->Ndi = 0; - // ulsch_eNB[UE_id]->harq_processes[harq_pid]->round++; //this is already done in phy_procedures ulsch_eNB[UE_id]->harq_processes[harq_pid]->rvidx = rv_table[ulsch_eNB[UE_id]->harq_processes[harq_pid]->round&3]; ulsch_eNB[UE_id]->harq_processes[harq_pid]->O_RI = 0; ulsch_eNB[UE_id]->harq_processes[harq_pid]->Or2 = 0; - ulsch_eNB[UE_id]->harq_processes[harq_pid]->Or1 = 0;//sizeof_HLC_subband_cqi_nopmi_5MHz; + ulsch_eNB[UE_id]->harq_processes[harq_pid]->Or1 = 0; ulsch_eNB[UE_id]->harq_processes[harq_pid]->uci_format = HLC_subband_cqi_nopmi; } else { diff --git a/openair1/PHY/LTE_TRANSPORT/pilots.c b/openair1/PHY/LTE_TRANSPORT/pilots.c index ba1eee293dc53819458bcb5cef645734806ee61d..66e32fcb4977cfac5dac2534f180534ae6abe6d1 100644 --- a/openair1/PHY/LTE_TRANSPORT/pilots.c +++ b/openair1/PHY/LTE_TRANSPORT/pilots.c @@ -41,7 +41,7 @@ #include "PHY/defs.h" void generate_pilots(PHY_VARS_eNB *phy_vars_eNB, - mod_sym_t **txdataF, + int32_t **txdataF, int16_t amp, uint16_t Ntti) { @@ -168,7 +168,7 @@ void generate_pilots(PHY_VARS_eNB *phy_vars_eNB, } int generate_pilots_slot(PHY_VARS_eNB *phy_vars_eNB, - mod_sym_t **txdataF, + int32_t **txdataF, int16_t amp, uint16_t slot, int first_pilot_only) diff --git a/openair1/PHY/LTE_TRANSPORT/pilots_mbsfn.c b/openair1/PHY/LTE_TRANSPORT/pilots_mbsfn.c index a81eb3848070490dcc84414ccee67b2a49440e6c..168f3db17c08354d20cdb677b290e7d97878f9ec 100644 --- a/openair1/PHY/LTE_TRANSPORT/pilots_mbsfn.c +++ b/openair1/PHY/LTE_TRANSPORT/pilots_mbsfn.c @@ -42,7 +42,7 @@ int generate_mbsfn_pilot(PHY_VARS_eNB *phy_vars_eNB, - mod_sym_t **txdataF, + int32_t **txdataF, int16_t amp, uint16_t subframe) { diff --git a/openair1/PHY/LTE_TRANSPORT/prach.c b/openair1/PHY/LTE_TRANSPORT/prach.c index 25ecc392e80a3cb64c69e5f6c819f118862043bd..b93519d393ba58673ea3ed0d8993f99ff6663edd 100644 --- a/openair1/PHY/LTE_TRANSPORT/prach.c +++ b/openair1/PHY/LTE_TRANSPORT/prach.c @@ -608,7 +608,7 @@ int32_t generate_prach( PHY_VARS_UE *phy_vars_ue, uint8_t eNB_id, uint8_t subfra uint8_t preamble_index = phy_vars_ue->prach_resources[eNB_id]->ra_PreambleIndex; uint8_t tdd_mapindex = phy_vars_ue->prach_resources[eNB_id]->ra_TDD_map_index; int16_t *prachF = phy_vars_ue->lte_ue_prach_vars[eNB_id]->prachF; - static int16_t prach_tmp[45600*2] __attribute__((aligned(16))); + static int16_t prach_tmp[45600*2] __attribute__((aligned(32))); int16_t *prach = prach_tmp; int16_t *prach2; int16_t amp = phy_vars_ue->lte_ue_prach_vars[eNB_id]->amp; @@ -898,7 +898,7 @@ int32_t generate_prach( PHY_VARS_UE *phy_vars_ue, uint8_t eNB_id, uint8_t subfra memmove( prach, prach+512, Ncp<<2 ); prach_len = 256+Ncp; } else { - idft1536(prachF,prach2); + idft1536(prachF,prach2,1); memmove( prach, prach+3072, Ncp<<2 ); prach_len = 1536+Ncp; @@ -1058,21 +1058,24 @@ int32_t generate_prach( PHY_VARS_UE *phy_vars_ue, uint8_t eNB_id, uint8_t subfra } //__m128i mmtmpX0,mmtmpX1,mmtmpX2,mmtmpX3; -void rx_prach(PHY_VARS_eNB *phy_vars_eNB,uint8_t subframe,uint16_t *preamble_energy_list, uint16_t *preamble_delay_list, uint16_t Nf, uint8_t tdd_mapindex) +void rx_prach(PHY_VARS_eNB *phy_vars_eNB, + uint8_t subframe, + uint16_t *preamble_energy_list, + uint16_t *preamble_delay_list, + uint16_t Nf, + uint8_t tdd_mapindex) { int i; - lte_frame_type_t frame_type = phy_vars_eNB->lte_frame_parms.frame_type; - - //uint8_t tdd_config = phy_vars_eNB->lte_frame_parms.tdd_config; - uint16_t rootSequenceIndex = phy_vars_eNB->lte_frame_parms.prach_config_common.rootSequenceIndex; - uint8_t prach_ConfigIndex = phy_vars_eNB->lte_frame_parms.prach_config_common.prach_ConfigInfo.prach_ConfigIndex; - uint8_t Ncs_config = phy_vars_eNB->lte_frame_parms.prach_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig; - uint8_t restricted_set = phy_vars_eNB->lte_frame_parms.prach_config_common.prach_ConfigInfo.highSpeedFlag; - //uint8_t n_ra_prboffset = phy_vars_eNB->lte_frame_parms.prach_config_common.prach_ConfigInfo.prach_FreqOffset; - int16_t *prachF = phy_vars_eNB->lte_eNB_prach_vars.prachF; - int16_t **rxsigF = phy_vars_eNB->lte_eNB_prach_vars.rxsigF; - int16_t **prach_ifft = phy_vars_eNB->lte_eNB_prach_vars.prach_ifft; + lte_frame_type_t frame_type = phy_vars_eNB->lte_frame_parms.frame_type; + + uint16_t rootSequenceIndex = phy_vars_eNB->lte_frame_parms.prach_config_common.rootSequenceIndex; + uint8_t prach_ConfigIndex = phy_vars_eNB->lte_frame_parms.prach_config_common.prach_ConfigInfo.prach_ConfigIndex; + uint8_t Ncs_config = phy_vars_eNB->lte_frame_parms.prach_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig; + uint8_t restricted_set = phy_vars_eNB->lte_frame_parms.prach_config_common.prach_ConfigInfo.highSpeedFlag; + int16_t *prachF = phy_vars_eNB->lte_eNB_prach_vars.prachF; + int16_t **rxsigF = phy_vars_eNB->lte_eNB_prach_vars.rxsigF; + int16_t **prach_ifft = phy_vars_eNB->lte_eNB_prach_vars.prach_ifft; int16_t *prach[4]; int16_t *prach2; uint8_t n_ra_prb; @@ -1086,12 +1089,8 @@ void rx_prach(PHY_VARS_eNB *phy_vars_eNB,uint8_t subframe,uint16_t *preamble_ene uint16_t numshift=0; uint16_t *prach_root_sequence_map; uint8_t prach_fmt = get_prach_fmt(prach_ConfigIndex,frame_type); - //uint8_t Nsp=2; - //uint8_t f_ra,t1_ra; uint16_t N_ZC = (prach_fmt <4)?839:139; uint8_t not_found; - // LTE_DL_FRAME_PARMS *frame_parms = &phy_vars_eNB->lte_frame_parms; - // uint16_t subframe_offset; int k; uint16_t u; int16_t *Xu; @@ -1107,7 +1106,6 @@ void rx_prach(PHY_VARS_eNB *phy_vars_eNB,uint8_t subframe,uint16_t *preamble_ene for (aa=0; aa<nb_ant_rx; aa++) { prach[aa] = (int16_t*)&phy_vars_eNB->lte_eNB_common_vars.rxdata[0][aa][subframe*phy_vars_eNB->lte_frame_parms.samples_per_tti-phy_vars_eNB->N_TA_offset]; - // remove_625_Hz(phy_vars_eNB,prach[aa]); } // First compute physical root sequence @@ -1134,37 +1132,6 @@ void rx_prach(PHY_VARS_eNB *phy_vars_eNB,uint8_t subframe,uint16_t *preamble_ene n_ra_prb = get_prach_prb_offset(&(phy_vars_eNB->lte_frame_parms),tdd_mapindex,Nf); prach_root_sequence_map = (prach_fmt < 4) ? prach_root_sequence_map0_3 : prach_root_sequence_map4; - /* - // this code is now part of get_prach_prb_offset - if (frame_type == TDD) { // TDD - // adjust n_ra_prboffset for frequency multiplexing (p.36 36.211) - - f_ra = tdd_preamble_map[prach_ConfigIndex][tdd_config].map[tdd_mapindex].f_ra; - - if (prach_fmt < 4) { - if ((f_ra&1) == 0) { - n_ra_prb = n_ra_prboffset + 6*(f_ra>>1); - } else { - n_ra_prb = phy_vars_eNB->lte_frame_parms.N_RB_UL - 6 - n_ra_prboffset + 6*(f_ra>>1); - } - - } else { - if ((tdd_config >2) && (tdd_config<6)) - Nsp = 2; - - t1_ra = tdd_preamble_map[prach_ConfigIndex][tdd_config].map[0].t1_ra; - - if ((((Nf&1)*(2-Nsp)+t1_ra)&1) == 0) { - n_ra_prb = 6*f_ra; - } else { - n_ra_prb = phy_vars_eNB->lte_frame_parms.N_RB_UL - 6*(f_ra+1); - } - - } - } - */ - - // printf("NCS %d\n",NCS); // PDP is oversampled, e.g. 1024 sample instead of 839 // Adapt the NCS (zero-correlation zones) with oversampling factor e.g. 1024/839 NCS2 = (N_ZC==839) ? ((NCS<<10)/839) : ((NCS<<8)/139); @@ -1217,9 +1184,6 @@ void rx_prach(PHY_VARS_eNB *phy_vars_eNB,uint8_t subframe,uint16_t *preamble_ene break; } - // nsymb = (frame_parms->Ncp==0) ? 14:12; - // subframe_offset = (unsigned int)frame_parms->ofdm_symbol_size*subframe*nsymb; - preamble_offset_old = 99; for (preamble_index=0 ; preamble_index<64 ; preamble_index++) { @@ -1338,10 +1302,10 @@ void rx_prach(PHY_VARS_eNB *phy_vars_eNB,uint8_t subframe,uint16_t *preamble_ene if (prach_fmt == 4) { dft256(prach2,rxsigF[aa],1); } else { - dft1536(prach2,rxsigF[aa]); + dft1536(prach2,rxsigF[aa],1); if (prach_fmt>1) - dft1536(prach2+3072,rxsigF[aa]+3072); + dft1536(prach2+3072,rxsigF[aa]+3072,1); } break; diff --git a/openair1/PHY/LTE_TRANSPORT/print_stats.c b/openair1/PHY/LTE_TRANSPORT/print_stats.c index de5f05c879f8f46d4610e86b22c40b4fe9da97d8..7445fca40f62c1b79314678008d67921079c0b10 100644 --- a/openair1/PHY/LTE_TRANSPORT/print_stats.c +++ b/openair1/PHY/LTE_TRANSPORT/print_stats.c @@ -61,6 +61,7 @@ int dump_ue_stats(PHY_VARS_UE *phy_vars_ue, char* buffer, int length, runmode_t uint8_t eNB=0; uint32_t RRC_status; int len=length; + int harq_pid,round; if (phy_vars_ue==NULL) return 0; @@ -488,13 +489,27 @@ int dump_ue_stats(PHY_VARS_UE *phy_vars_ue, char* buffer, int length, runmode_t if (phy_vars_ue->transmission_mode[eNB] == 6) len += sprintf(&buffer[len], "[UE PROC] Mode 6 Wideband CQI eNB %d : %d dB\n",eNB,phy_vars_ue->PHY_measurements.precoded_cqi_dB[eNB][0]); + for (harq_pid=0;harq_pid<8;harq_pid++) { + len+=sprintf(&buffer[len],"[UE PROC] eNB %d: CW 0 harq_pid %d, mcs %d:",eNB,harq_pid,phy_vars_ue->dlsch_ue[0][0]->harq_processes[harq_pid]->mcs); + for (round=0;round<8;round++) + len+=sprintf(&buffer[len],"%d/%d ", + phy_vars_ue->dlsch_ue[0][0]->harq_processes[harq_pid]->errors[round], + phy_vars_ue->dlsch_ue[0][0]->harq_processes[harq_pid]->trials[round]); + len+=sprintf(&buffer[len],"\n"); + } if (phy_vars_ue->dlsch_ue[0] && phy_vars_ue->dlsch_ue[0][0] && phy_vars_ue->dlsch_ue[0][1]) { len += sprintf(&buffer[len], "[UE PROC] Saved PMI for DLSCH eNB %d : %jx (%p)\n",eNB,pmi2hex_2Ar1(phy_vars_ue->dlsch_ue[0][0]->pmi_alloc),phy_vars_ue->dlsch_ue[0][0]); len += sprintf(&buffer[len], "[UE PROC] eNB %d: dl_power_off = %d\n",eNB,phy_vars_ue->dlsch_ue[0][0]->harq_processes[0]->dl_power_off); - len += sprintf(&buffer[len], "[UE PROC] DL mcs1 (dlsch cw1) %d\n",phy_vars_ue->dlsch_ue[0][0]->harq_processes[0]->mcs); - len += sprintf(&buffer[len], "[UE PROC] DL mcs2 (dlsch cw2) %d\n",phy_vars_ue->dlsch_ue[0][1]->harq_processes[0]->mcs); + for (harq_pid=0;harq_pid<8;harq_pid++) { + len+=sprintf(&buffer[len],"[UE PROC] eNB %d: CW 1 harq_pid %d, mcs %d:",eNB,harq_pid,phy_vars_ue->dlsch_ue[0][1]->harq_processes[0]->mcs); + for (round=0;round<8;round++) + len+=sprintf(&buffer[len],"%d/%d ", + phy_vars_ue->dlsch_ue[0][1]->harq_processes[harq_pid]->errors[round], + phy_vars_ue->dlsch_ue[0][1]->harq_processes[harq_pid]->trials[round]); + len+=sprintf(&buffer[len],"\n"); + } } len += sprintf(&buffer[len], "[UE PROC] DLSCH Total %d, Error %d, FER %d\n",phy_vars_ue->dlsch_received[0],phy_vars_ue->dlsch_errors[0],phy_vars_ue->dlsch_fer[0]); @@ -566,7 +581,7 @@ int dump_eNB_stats(PHY_VARS_eNB *phy_vars_eNB, char* buffer, int length) // } for (eNB=0; eNB<number_of_cards_l; eNB++) { - len += sprintf(&buffer[len],"[eNB PROC] eNB %d/%d Frame %d: RX Gain %d dB, I0 %d dBm (%d,%d) dB \n", + len += sprintf(&buffer[len],"eNB %d/%d Frame %d: RX Gain %d dB, I0 %d dBm (%d,%d) dB \n", eNB,number_of_cards_l, phy_vars_eNB->proc[0].frame_tx, phy_vars_eNB->rx_total_gain_eNB_dB, @@ -574,7 +589,7 @@ 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] PRB I0 (%X.%X.%X.%X): ", + len += sprintf(&buffer[len],"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]); @@ -585,7 +600,7 @@ int dump_eNB_stats(PHY_VARS_eNB *phy_vars_eNB, char* buffer, int length) len += sprintf(&buffer[len],"\n"); } len += sprintf(&buffer[len],"\n"); - len += sprintf(&buffer[len],"\n[eNB PROC] PERFORMANCE PARAMETERS\n"); + len += sprintf(&buffer[len],"\nPERFORMANCE PARAMETERS\n"); /* len += sprintf(&buffer[len],"[eNB PROC] Total DLSCH Bitrate for the System %dkbps\n",((phy_vars_eNB->eNB_UE_stats[0].dlsch_bitrate + phy_vars_eNB->eNB_UE_stats[1].dlsch_bitrate)/1000)); len += sprintf(&buffer[len],"[eNB PROC] Total Bits successfully transitted %dKbits in %dframe(s)\n",((phy_vars_eNB->eNB_UE_stats[0].total_transmitted_bits + phy_vars_eNB->eNB_UE_stats[1].total_transmitted_bits)/1000),phy_vars_eNB->frame+1); @@ -593,118 +608,115 @@ int dump_eNB_stats(PHY_VARS_eNB *phy_vars_eNB, char* buffer, int length) */ for (UE_id=0; UE_id<NUMBER_OF_UE_MAX; UE_id++) { -#ifdef OPENAIR2 + if ((phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->rnti>0)&& + (phy_vars_eNB->eNB_UE_stats[UE_id].mode == PUSCH)) { - if (phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->rnti>0) { phy_vars_eNB->total_dlsch_bitrate = phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_bitrate + phy_vars_eNB->total_dlsch_bitrate; phy_vars_eNB->total_transmitted_bits = phy_vars_eNB->eNB_UE_stats[UE_id].total_TBS + phy_vars_eNB->total_transmitted_bits; //phy_vars_eNB->total_system_throughput = phy_vars_eNB->eNB_UE_stats[UE_id].total_transmitted_bits + phy_vars_eNB->total_system_throughput; - if (phy_vars_eNB->eNB_UE_stats[UE_id].mode == PUSCH) - for (i=0; i<8; i++) - success = success + (phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_trials[i][0] - phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_l2_errors[i]); - } - -#else - phy_vars_eNB->total_dlsch_bitrate = phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_bitrate + phy_vars_eNB->total_dlsch_bitrate; - phy_vars_eNB->total_transmitted_bits = phy_vars_eNB->eNB_UE_stats[UE_id].total_TBS + phy_vars_eNB->total_transmitted_bits; - - //phy_vars_eNB->total_system_throughput = phy_vars_eNB->eNB_UE_stats[UE_id].total_transmitted_bits + phy_vars_eNB->total_system_throughput; - for (i=0; i<8; i++) - success = success + (phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_trials[i][0] - phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_l2_errors[i]); - -#endif - } - - len += sprintf(&buffer[len],"[eNB PROC] Total DLSCH bits successfully transmitted %d kbits in %d frame(s)\n",(phy_vars_eNB->total_transmitted_bits/1000),phy_vars_eNB->proc[0].frame_tx+1); - len += sprintf(&buffer[len],"[eNB PROC] Total DLSCH average system throughput %d kbps\n",(phy_vars_eNB->total_dlsch_bitrate/1000)); - len += sprintf(&buffer[len],"[eNB PROC] Total DLSCH successful transmissions %d in %d frame(s)\n",success,phy_vars_eNB->proc[0].frame_tx+1); - //len += sprintf(&buffer[len],"[eNB PROC] FULL MU-MIMO Transmissions/Total Transmissions = %d/%d\n",phy_vars_eNB->FULL_MUMIMO_transmissions,phy_vars_eNB->check_for_total_transmissions); - //len += sprintf(&buffer[len],"[eNB PROC] MU-MIMO Transmissions/Total Transmissions = %d/%d\n",phy_vars_eNB->check_for_MUMIMO_transmissions,phy_vars_eNB->check_for_total_transmissions); - //len += sprintf(&buffer[len],"[eNB PROC] SU-MIMO Transmissions/Total Transmissions = %d/%d\n",phy_vars_eNB->check_for_SUMIMO_transmissions,phy_vars_eNB->check_for_total_transmissions); - - } - - len += sprintf(&buffer[len],"\n"); - - for (UE_id=0; UE_id<NUMBER_OF_UE_MAX; UE_id++) { -#ifdef OPENAIR2 - - if (phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->rnti>0) { -#endif - len += sprintf(&buffer[len],"[eNB PROC] UE %d (%x) Power: (%d,%d) dB, Po_PUSCH: (%d,%d) dBm, Po_PUCCH (%d/%d) dBm, Po_PUCCH1 (%d,%d) dBm, PUCCH1 Thres %d dBm \n", - UE_id, - phy_vars_eNB->eNB_UE_stats[UE_id].crnti, - dB_fixed(phy_vars_eNB->lte_eNB_pusch_vars[UE_id]->ulsch_power[0]), - 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->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->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++) - len+= sprintf(&buffer[len]," harq %d: DL mcs %d, UL mcs %d, UL rb %d, delta_TF %d\n", - i, - phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->harq_processes[i]->mcs, - phy_vars_eNB->ulsch_eNB[(uint8_t)UE_id]->harq_processes[i]->mcs, - phy_vars_eNB->ulsch_eNB[(uint8_t)UE_id]->harq_processes[i]->nb_rb, - phy_vars_eNB->ulsch_eNB[(uint8_t)UE_id]->harq_processes[i]->delta_TF); - - len += sprintf(&buffer[len],"[eNB PROC] Wideband CQI: (%d,%d) dB\n", - phy_vars_eNB->PHY_measurements_eNB[eNB].wideband_cqi_dB[UE_id][0], - phy_vars_eNB->PHY_measurements_eNB[eNB].wideband_cqi_dB[UE_id][1]); - - len += sprintf(&buffer[len],"[eNB PROC] Subband CQI: "); - - for (i=0; i<25; i++) - len += sprintf(&buffer[len],"%2d ", - phy_vars_eNB->PHY_measurements_eNB[eNB].subband_cqi_tot_dB[UE_id][i]); - - len += sprintf(&buffer[len],"\n"); - - len += sprintf(&buffer[len],"[eNB PROC] DL TM %d, DL_cqi %d, DL_pmi_single %jx\n", - phy_vars_eNB->transmission_mode[UE_id], - phy_vars_eNB->eNB_UE_stats[UE_id].DL_cqi[0], - pmi2hex_2Ar1(phy_vars_eNB->eNB_UE_stats[UE_id].DL_pmi_single)); - - len += sprintf(&buffer[len],"[eNB PROC] DL Subband CQI: "); - - for (i=0; i<13; i++) - len += sprintf(&buffer[len],"%2d ", - phy_vars_eNB->eNB_UE_stats[UE_id].DL_subband_cqi[0][i]); - - len += sprintf(&buffer[len],"\n"); - - len += sprintf(&buffer[len],"[eNB PROC] Timing advance %d samples (%d 16Ts), update %d\n", - phy_vars_eNB->eNB_UE_stats[UE_id].UE_timing_offset, - phy_vars_eNB->eNB_UE_stats[UE_id].UE_timing_offset>>2, - phy_vars_eNB->eNB_UE_stats[UE_id].timing_advance_update); - - len += sprintf(&buffer[len],"[eNB PROC] Mode = %s(%d)\n", - mode_string[phy_vars_eNB->eNB_UE_stats[UE_id].mode], - phy_vars_eNB->eNB_UE_stats[UE_id].mode); -#ifdef OPENAIR2 - UE_id_mac = find_UE_id(phy_vars_eNB->Mod_id,phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->rnti); - - if (UE_id_mac != -1) { - RRC_status = mac_eNB_get_rrc_status(phy_vars_eNB->Mod_id,phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->rnti); - len += sprintf(&buffer[len],"[eNB PROC] UE_id_mac = %d, RRC status = %d\n",UE_id_mac,RRC_status); - } else - len += sprintf(&buffer[len],"[eNB PROC] UE_id_mac = -1\n"); - -#endif - -#ifdef OPENAIR2 - - if (phy_vars_eNB->eNB_UE_stats[UE_id].mode == PUSCH) { -#endif - len += sprintf(&buffer[len],"[eNB PROC] SR received/total: %d/%d (diff %d)\n", + + for (i=0; i<8; i++) + success = success + (phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_trials[i][0] - phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_l2_errors[i]); + + + + len += sprintf(&buffer[len],"Total DLSCH %d kbits / %d frames ",(phy_vars_eNB->total_transmitted_bits/1000),phy_vars_eNB->proc[0].frame_tx+1); + len += sprintf(&buffer[len],"Total DLSCH throughput %d kbps ",(phy_vars_eNB->total_dlsch_bitrate/1000)); + len += sprintf(&buffer[len],"Total DLSCH trans %d / %d frames\n",success,phy_vars_eNB->proc[0].frame_tx+1); + //len += sprintf(&buffer[len],"[eNB PROC] FULL MU-MIMO Transmissions/Total Transmissions = %d/%d\n",phy_vars_eNB->FULL_MUMIMO_transmissions,phy_vars_eNB->check_for_total_transmissions); + //len += sprintf(&buffer[len],"[eNB PROC] MU-MIMO Transmissions/Total Transmissions = %d/%d\n",phy_vars_eNB->check_for_MUMIMO_transmissions,phy_vars_eNB->check_for_total_transmissions); + //len += sprintf(&buffer[len],"[eNB PROC] SU-MIMO Transmissions/Total Transmissions = %d/%d\n",phy_vars_eNB->check_for_SUMIMO_transmissions,phy_vars_eNB->check_for_total_transmissions); + + len += sprintf(&buffer[len],"UE %d (%x) Power: (%d,%d) dB, Po_PUSCH: (%d,%d) dBm, Po_PUCCH (%d/%d) dBm, Po_PUCCH1 (%d,%d) dBm, PUCCH1 Thres %d dBm \n", + UE_id, + phy_vars_eNB->eNB_UE_stats[UE_id].crnti, + dB_fixed(phy_vars_eNB->lte_eNB_pusch_vars[UE_id]->ulsch_power[0]), + 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->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->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)); + + len+= sprintf(&buffer[len],"DL mcs %d, UL mcs %d, UL rb %d, delta_TF %d, ", + phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->harq_processes[0]->mcs, + phy_vars_eNB->ulsch_eNB[(uint8_t)UE_id]->harq_processes[0]->mcs, + phy_vars_eNB->ulsch_eNB[(uint8_t)UE_id]->harq_processes[0]->nb_rb, + phy_vars_eNB->ulsch_eNB[(uint8_t)UE_id]->harq_processes[0]->delta_TF); + + len += sprintf(&buffer[len],"Wideband CQI: (%d,%d) dB\n", + phy_vars_eNB->PHY_measurements_eNB[eNB].wideband_cqi_dB[UE_id][0], + phy_vars_eNB->PHY_measurements_eNB[eNB].wideband_cqi_dB[UE_id][1]); + + /* len += sprintf(&buffer[len],"[eNB PROC] Subband CQI: "); + + for (i=0; i<phy_vars_eNB->lte_frame_parms.N_RB_DL; i++) + len += sprintf(&buffer[len],"%2d ", + phy_vars_eNB->PHY_measurements_eNB[eNB].subband_cqi_tot_dB[UE_id][i]); + + len += sprintf(&buffer[len],"\n"); + */ + + len += sprintf(&buffer[len],"DL TM %d, DL_cqi %d, DL_pmi_single %jx ", + phy_vars_eNB->transmission_mode[UE_id], + phy_vars_eNB->eNB_UE_stats[UE_id].DL_cqi[0], + pmi2hex_2Ar1(phy_vars_eNB->eNB_UE_stats[UE_id].DL_pmi_single)); + + len += sprintf(&buffer[len],"Timing advance %d samples (%d 16Ts), update %d ", + phy_vars_eNB->eNB_UE_stats[UE_id].UE_timing_offset, + phy_vars_eNB->eNB_UE_stats[UE_id].UE_timing_offset>>2, + phy_vars_eNB->eNB_UE_stats[UE_id].timing_advance_update); + + len += sprintf(&buffer[len],"Mode = %s(%d) ", + mode_string[phy_vars_eNB->eNB_UE_stats[UE_id].mode], + phy_vars_eNB->eNB_UE_stats[UE_id].mode); + UE_id_mac = find_UE_id(phy_vars_eNB->Mod_id,phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->rnti); + + if (UE_id_mac != -1) { + RRC_status = mac_eNB_get_rrc_status(phy_vars_eNB->Mod_id,phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->rnti); + len += sprintf(&buffer[len],"UE_id_mac = %d, RRC status = %d\n",UE_id_mac,RRC_status); + } else + len += sprintf(&buffer[len],"UE_id_mac = -1\n"); + + len += sprintf(&buffer[len],"SR received/total: %d/%d (diff %d)\n", phy_vars_eNB->eNB_UE_stats[UE_id].sr_received, phy_vars_eNB->eNB_UE_stats[UE_id].sr_total, phy_vars_eNB->eNB_UE_stats[UE_id].sr_total-phy_vars_eNB->eNB_UE_stats[UE_id].sr_received); + + len += sprintf(&buffer[len],"DL Subband CQI: "); + + int nb_sb; + switch (phy_vars_eNB->lte_frame_parms.N_RB_DL) { + case 6: + nb_sb=0; + break; + case 15: + nb_sb = 4; + case 25: + nb_sb = 7; + break; + case 50: + nb_sb = 9; + break; + case 75: + nb_sb = 10; + break; + case 100: + nb_sb = 13; + break; + default: + nb_sb=0; + break; + } + for (i=0; i<nb_sb; i++) + len += sprintf(&buffer[len],"%2d ", + phy_vars_eNB->eNB_UE_stats[UE_id].DL_subband_cqi[0][i]); + len += sprintf(&buffer[len],"\n"); + + ulsch_errors = 0; @@ -713,10 +725,10 @@ int dump_eNB_stats(PHY_VARS_eNB *phy_vars_eNB, char* buffer, int length) ulsch_round_errors[j]=0; } - len += sprintf(&buffer[len],"[eNB PROC] ULSCH errors/attempts per harq (per round): \n"); + len += sprintf(&buffer[len],"ULSCH errors/attempts per harq (per round): \n"); for (i=0; i<8; i++) { - len += sprintf(&buffer[len]," harq %d: %d/%d (fer %d) (%d/%d, %d/%d, %d/%d, %d/%d)\n", + len += sprintf(&buffer[len]," harq %d: %d/%d (fer %d) (%d/%d, %d/%d, %d/%d, %d/%d) ", i, phy_vars_eNB->eNB_UE_stats[UE_id].ulsch_errors[i], phy_vars_eNB->eNB_UE_stats[UE_id].ulsch_decoding_attempts[i][0], @@ -729,6 +741,9 @@ int dump_eNB_stats(PHY_VARS_eNB *phy_vars_eNB, char* buffer, int length) phy_vars_eNB->eNB_UE_stats[UE_id].ulsch_decoding_attempts[i][2], phy_vars_eNB->eNB_UE_stats[UE_id].ulsch_round_errors[i][3], phy_vars_eNB->eNB_UE_stats[UE_id].ulsch_decoding_attempts[i][3]); + if ((i&1) == 1) + len += sprintf(&buffer[len],"\n"); + ulsch_errors+=phy_vars_eNB->eNB_UE_stats[UE_id].ulsch_errors[i]; for (j=0; j<4; j++) { @@ -737,7 +752,7 @@ int dump_eNB_stats(PHY_VARS_eNB *phy_vars_eNB, char* buffer, int length) } } - len += sprintf(&buffer[len],"[eNB PROC] ULSCH errors/attempts total %d/%d (%d/%d, %d/%d, %d/%d, %d/%d): \n", + len += sprintf(&buffer[len],"ULSCH errors/attempts total %d/%d (%d/%d, %d/%d, %d/%d, %d/%d)\n", ulsch_errors,ulsch_round_attempts[0], ulsch_round_errors[0],ulsch_round_attempts[0], @@ -752,10 +767,10 @@ int dump_eNB_stats(PHY_VARS_eNB *phy_vars_eNB, char* buffer, int length) dlsch_round_errors[j]=0; } - len += sprintf(&buffer[len],"[eNB PROC] DLSCH errors/attempts per harq (per round): \n"); + len += sprintf(&buffer[len],"DLSCH errors/attempts per harq (per round): \n"); for (i=0; i<8; i++) { - len += sprintf(&buffer[len]," harq %d: %d/%d (%d/%d/%d, %d/%d/%d, %d/%d/%d, %d/%d/%d)\n", + len += sprintf(&buffer[len]," harq %d: %d/%d (%d/%d/%d, %d/%d/%d, %d/%d/%d, %d/%d/%d) ", i, phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_l2_errors[i], phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_trials[i][0], @@ -771,6 +786,10 @@ int dump_eNB_stats(PHY_VARS_eNB *phy_vars_eNB, char* buffer, int length) phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_ACK[i][3], phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_NAK[i][3], phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_trials[i][3]); + if ((i&1) == 1) + len += sprintf(&buffer[len],"\n"); + + dlsch_errors+=phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_l2_errors[i]; for (j=0; j<4; j++) { @@ -779,7 +798,7 @@ int dump_eNB_stats(PHY_VARS_eNB *phy_vars_eNB, char* buffer, int length) } } - len += sprintf(&buffer[len],"[eNB PROC] DLSCH errors/attempts total %d/%d (%d/%d, %d/%d, %d/%d, %d/%d): \n", + len += sprintf(&buffer[len],"DLSCH errors/attempts total %d/%d (%d/%d, %d/%d, %d/%d, %d/%d): \n", dlsch_errors,dlsch_round_attempts[0], dlsch_round_errors[0],dlsch_round_attempts[0], dlsch_round_errors[1],dlsch_round_attempts[1], @@ -787,11 +806,11 @@ int dump_eNB_stats(PHY_VARS_eNB *phy_vars_eNB, char* buffer, int length) dlsch_round_errors[3],dlsch_round_attempts[3]); - len += sprintf(&buffer[len],"[eNB PROC] DLSCH total bits from MAC: %dkbit\n",(phy_vars_eNB->eNB_UE_stats[UE_id].total_TBS_MAC)/1000); - len += sprintf(&buffer[len],"[eNB PROC] DLSCH total bits ack'ed: %dkbit\n",(phy_vars_eNB->eNB_UE_stats[UE_id].total_TBS)/1000); - len += sprintf(&buffer[len],"[eNB PROC] DLSCH Average throughput (100 frames): %dkbps\n",(phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_bitrate/1000)); - len += sprintf(&buffer[len],"[eNB PROC] Transmission Mode %d\n",phy_vars_eNB->transmission_mode[UE_id]); - + len += sprintf(&buffer[len],"DLSCH total bits from MAC: %dkbit ",(phy_vars_eNB->eNB_UE_stats[UE_id].total_TBS_MAC)/1000); + len += sprintf(&buffer[len],"DLSCH total bits ack'ed: %dkbit ",(phy_vars_eNB->eNB_UE_stats[UE_id].total_TBS)/1000); + len += sprintf(&buffer[len],"DLSCH Average throughput (100 frames): %dkbps\n",(phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_bitrate/1000)); + // len += sprintf(&buffer[len],"[eNB PROC] Transmission Mode %d\n",phy_vars_eNB->transmission_mode[UE_id]); + /* if(phy_vars_eNB->transmission_mode[UE_id] == 5) { if(phy_vars_eNB->mu_mimo_mode[UE_id].dl_pow_off == 0) len += sprintf(&buffer[len],"[eNB PROC] ****UE %d is in MU-MIMO mode****\n",UE_id); @@ -800,7 +819,8 @@ int dump_eNB_stats(PHY_VARS_eNB *phy_vars_eNB, char* buffer, int length) else len += sprintf(&buffer[len],"[eNB PROC] ****UE %d is not scheduled****\n",UE_id); } - + */ + /* len += sprintf(&buffer[len],"[eNB PROC] RB Allocation on Sub-bands: "); // for (j=0;j< mac_xface->lte_frame_parms->N_RBGS;j++) @@ -810,16 +830,14 @@ int dump_eNB_stats(PHY_VARS_eNB *phy_vars_eNB, char* buffer, int length) len += sprintf(&buffer[len],"\n"); len += sprintf(&buffer[len],"[eNB PROC] Total Number of Allocated PRBs = %d\n",phy_vars_eNB->mu_mimo_mode[UE_id].pre_nb_available_rbs); - -#ifdef OPENAIR2 + */ } } -#endif len += sprintf(&buffer[len],"\n"); } - + len += sprintf(&buffer[len],"EOF\n"); - + return len; } diff --git a/openair1/PHY/LTE_TRANSPORT/proto.h b/openair1/PHY/LTE_TRANSPORT/proto.h index 9afea790b327c6efd15a53949a979f74243c8f7d..411c058c3e26e1f94bbc4786e196663e20c426c5 100644 --- a/openair1/PHY/LTE_TRANSPORT/proto.h +++ b/openair1/PHY/LTE_TRANSPORT/proto.h @@ -54,7 +54,7 @@ */ void free_eNB_dlsch(LTE_eNB_DLSCH_t *dlsch); -void clean_eNb_dlsch(LTE_eNB_DLSCH_t *dlsch, uint8_t abstraction_flag); +void clean_eNb_dlsch(LTE_eNB_DLSCH_t *dlsch); /** \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 @@ -85,13 +85,13 @@ void free_ue_dlsch(LTE_UE_DLSCH_t *dlsch); 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); +void clean_eNb_ulsch(LTE_eNB_ULSCH_t *ulsch); void free_ue_ulsch(LTE_UE_ULSCH_t *ulsch); -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_eNB_ULSCH_t *new_eNB_ulsch(uint8_t max_turbo_iterations,uint8_t N_RB_UL, uint8_t abstraction_flag); -LTE_UE_ULSCH_t *new_ue_ulsch(uint8_t Mdlharq, unsigned char N_RB_UL, uint8_t abstraction_flag); +LTE_UE_ULSCH_t *new_ue_ulsch(unsigned char N_RB_UL, uint8_t abstraction_flag); /** \fn dlsch_encoding(uint8_t *input_buffer, LTE_DL_FRAME_PARMS *frame_parms, @@ -133,7 +133,7 @@ void dlsch_encoding_emul(PHY_VARS_eNB *phy_vars_eNB, // Functions below implement 36-211 -/** \fn allocate_REs_in_RB(mod_sym_t **txdataF, +/** \fn allocate_REs_in_RB(int32_t **txdataF, uint32_t *jj, uint32_t *jj2, uint16_t re_offset, @@ -169,7 +169,7 @@ void dlsch_encoding_emul(PHY_VARS_eNB *phy_vars_eNB, */ int32_t allocate_REs_in_RB(LTE_DL_FRAME_PARMS *frame_parms, - mod_sym_t **txdataF, + int32_t **txdataF, uint32_t *jj, uint32_t *jj2, uint16_t re_offset, @@ -186,7 +186,7 @@ int32_t allocate_REs_in_RB(LTE_DL_FRAME_PARMS *frame_parms, uint8_t skip_half); -/** \fn int32_t dlsch_modulation(mod_sym_t **txdataF, +/** \fn int32_t dlsch_modulation(int32_t **txdataF, int16_t amp, uint32_t sub_frame_offset, LTE_DL_FRAME_PARMS *frame_parms, @@ -203,7 +203,7 @@ int32_t allocate_REs_in_RB(LTE_DL_FRAME_PARMS *frame_parms, @param dlsch1 Pointer to Transport Block 0 DLSCH descriptor for this allocation */ -int32_t dlsch_modulation(mod_sym_t **txdataF, +int32_t dlsch_modulation(int32_t **txdataF, int16_t amp, uint32_t sub_frame_offset, LTE_DL_FRAME_PARMS *frame_parms, @@ -218,7 +218,7 @@ int32_t dlsch_modulation(mod_sym_t **txdataF, @param frame_parms Pointer to frame descriptor @param dlsch Pointer to DLSCH descriptor for this allocation */ -int mch_modulation(mod_sym_t **txdataF, +int mch_modulation(int32_t **txdataF, int16_t amp, uint32_t subframe_offset, LTE_DL_FRAME_PARMS *frame_parms, @@ -279,7 +279,7 @@ void dump_mch(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint16_t coded_bits_per_co @param N Number of sub-frames to generate */ void generate_pilots(PHY_VARS_eNB *phy_vars_eNB, - mod_sym_t **txdataF, + int32_t **txdataF, int16_t amp, uint16_t N); @@ -292,17 +292,17 @@ void generate_pilots(PHY_VARS_eNB *phy_vars_eNB, @param first_pilot_only (0 no) */ int32_t generate_pilots_slot(PHY_VARS_eNB *phy_vars_eNB, - mod_sym_t **txdataF, + int32_t **txdataF, int16_t amp, uint16_t slot, int first_pilot_only); int32_t generate_mbsfn_pilot(PHY_VARS_eNB *phy_vars_eNB, - mod_sym_t **txdataF, + int32_t **txdataF, int16_t amp, uint16_t subframe); -int32_t generate_pss(mod_sym_t **txdataF, +int32_t generate_pss(int32_t **txdataF, int16_t amp, LTE_DL_FRAME_PARMS *frame_parms, uint16_t l, @@ -310,14 +310,14 @@ int32_t generate_pss(mod_sym_t **txdataF, int32_t generate_pss_emul(PHY_VARS_eNB *phy_vars_eNB,uint8_t sect_id); -int32_t generate_sss(mod_sym_t **txdataF, +int32_t generate_sss(int32_t **txdataF, short amp, LTE_DL_FRAME_PARMS *frame_parms, unsigned short symbol, unsigned short slot_offset); int32_t generate_pbch(LTE_eNB_PBCH *eNB_pbch, - mod_sym_t **txdataF, + int32_t **txdataF, int32_t amp, LTE_DL_FRAME_PARMS *frame_parms, uint8_t *pbch_pdu, @@ -1148,7 +1148,7 @@ uint8_t generate_dci_top(uint8_t num_ue_spec_dci, uint32_t n_rnti, int16_t amp, LTE_DL_FRAME_PARMS *frame_parms, - mod_sym_t **txdataF, + int32_t **txdataF, uint32_t sub_frame_offset); uint8_t generate_dci_top_emul(PHY_VARS_eNB *phy_vars_eNB, @@ -1341,7 +1341,7 @@ void init_ul_hopping(LTE_DL_FRAME_PARMS *frame_parms); int32_t compareints (const void * a, const void * b); -void ulsch_modulation(mod_sym_t **txdataF, +void ulsch_modulation(int32_t **txdataF, int16_t amp, frame_t frame, uint32_t subframe, @@ -1450,7 +1450,7 @@ void pcfich_unscrambling(LTE_DL_FRAME_PARMS *frame_parms, void generate_pcfich(uint8_t num_pdcch_symbols, int16_t amp, LTE_DL_FRAME_PARMS *frame_parms, - mod_sym_t **txdataF, + int32_t **txdataF, uint8_t subframe); uint8_t rx_pcfich(LTE_DL_FRAME_PARMS *frame_parms, @@ -1609,7 +1609,7 @@ uint16_t get_nCCE_mac(uint8_t Mod_id,uint8_t CC_id,int num_pdcch_symbols,int sub uint8_t get_num_pdcch_symbols(uint8_t num_dci,DCI_ALLOC_t *dci_alloc,LTE_DL_FRAME_PARMS *frame_parms,uint8_t subframe); -void pdcch_interleaving(LTE_DL_FRAME_PARMS *frame_parms,mod_sym_t **z, mod_sym_t **wbar,uint8_t n_symbols_pdcch,uint8_t mi); +void pdcch_interleaving(LTE_DL_FRAME_PARMS *frame_parms,int32_t **z, int32_t **wbar,uint8_t n_symbols_pdcch,uint8_t mi); void pdcch_unscrambling(LTE_DL_FRAME_PARMS *frame_parms, uint8_t subframe, @@ -1638,7 +1638,7 @@ void dlsch_unscrambling(LTE_DL_FRAME_PARMS *frame_parms, void init_ncs_cell(LTE_DL_FRAME_PARMS *frame_parms,uint8_t ncs_cell[20][7]); -void generate_pucch(mod_sym_t **txdataF, +void generate_pucch(int32_t **txdataF, LTE_DL_FRAME_PARMS *frame_parms, uint8_t ncs_cell[20][7], PUCCH_FMT_t fmt, @@ -1665,6 +1665,7 @@ uint32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB, uint16_t n2_pucch, uint8_t shortened_format, uint8_t *payload, + int frame, uint8_t subframe, uint8_t pucch1_thres); diff --git a/openair1/PHY/LTE_TRANSPORT/pss.c b/openair1/PHY/LTE_TRANSPORT/pss.c index cb954dedb4d57de40f0a9d30bc2c163cb6df13e5..e2a4c549da2ee939a01428c09fe6fe4ade6b6d7c 100644 --- a/openair1/PHY/LTE_TRANSPORT/pss.c +++ b/openair1/PHY/LTE_TRANSPORT/pss.c @@ -47,7 +47,7 @@ #include "PHY/defs.h" #include "PHY/extern.h" -int generate_pss(mod_sym_t **txdataF, +int generate_pss(int32_t **txdataF, short amp, LTE_DL_FRAME_PARMS *frame_parms, unsigned short symbol, diff --git a/openair1/PHY/LTE_TRANSPORT/pucch.c b/openair1/PHY/LTE_TRANSPORT/pucch.c index 837c99b07371110fc5a2c89c6b3e2fc6dadff4f9..9dfc1bb358c3afb7fc4715ba9127ba3e5b6b8a46 100644 --- a/openair1/PHY/LTE_TRANSPORT/pucch.c +++ b/openair1/PHY/LTE_TRANSPORT/pucch.c @@ -41,6 +41,11 @@ #include "PHY/extern.h" #include "LAYER2/MAC/extern.h" +#include "UTIL/LOG/log.h" +#include "UTIL/LOG/vcd_signal_dumper.h" + +#include "T.h" + //uint8_t ncs_cell[20][7]; //#define DEBUG_PUCCH_TX //#define DEBUG_PUCCH_RX @@ -118,7 +123,7 @@ int16_t W3_im[3][6] = {{0 ,0 ,0 }, char pucch_format_string[6][20] = {"format 1\0","format 1a\0","format 1b\0","format 2\0","format 2a\0","format 2b\0"}; -void generate_pucch(mod_sym_t **txdataF, +void generate_pucch(int32_t **txdataF, LTE_DL_FRAME_PARMS *frame_parms, uint8_t ncs_cell[20][7], PUCCH_FMT_t fmt, @@ -142,7 +147,7 @@ void generate_pucch(mod_sym_t **txdataF, uint8_t m,l,refs; uint8_t n_cs,S,alpha_ind,rem; int16_t tmp_re,tmp_im,ref_re,ref_im,W_re=0,W_im=0; - mod_sym_t *txptr; + int32_t *txptr; uint32_t symbol_offset; uint8_t deltaPUCCH_Shift = frame_parms->pucch_config_common.deltaPUCCH_Shift; @@ -437,6 +442,7 @@ uint32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB, uint16_t n2_pucch, uint8_t shortened_format, uint8_t *payload, + int frame, uint8_t subframe, uint8_t pucch1_thres) { @@ -446,7 +452,7 @@ uint32_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_subband_power_tot_dB[6]; + int8_t sigma2_dB = phy_vars_eNB->PHY_measurements_eNB[0].n0_subband_power_tot_dB[0]-10; 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); uint32_t *Po_PUCCH1_below = &(phy_vars_eNB->eNB_UE_stats[UE_id].Po_PUCCH1_below); @@ -793,6 +799,9 @@ uint32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB, 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; + T(T_PUCCH_1_ENERGY, T_INT(phy_vars_eNB->Mod_id), T_INT(UE_id), T_INT(frame), T_INT(subframe), + T_INT(stat_max), T_INT(sigma2_dB+pucch1_thres)); + /* if (phy_vars_eNB->pucch1_stats_cnt[UE_id][subframe] == 0) { write_output("pucch_debug.m","pucch_energy", @@ -815,7 +824,10 @@ uint32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB, } 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; - + if (UE_id==0) { + VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_UE0_SR_ENERGY,dB_fixed(stat_max)); + VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_UE0_SR_THRES,sigma2_dB+pucch1_thres); + } } else if ((fmt == pucch_format1a)||(fmt == pucch_format1b)) { stat_max = 0; #ifdef DEBUG_PUCCH_RX @@ -1031,6 +1043,8 @@ uint32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB, 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; + /* frame not available here - set to -1 for the moment */ + T(T_PUCCH_1AB_IQ, T_INT(phy_vars_eNB->Mod_id), T_INT(UE_id), T_INT(-1), T_INT(subframe), T_INT(stat_re), T_INT(stat_im)); *payload = (stat_re<0) ? 1 : 0; diff --git a/openair1/PHY/LTE_TRANSPORT/rar_tools.c b/openair1/PHY/LTE_TRANSPORT/rar_tools.c index 1b789e114435269d9b3a3d476c67d7ae4dad9c9e..40dec0ec6f4eca97d85620557855c6642cce3d3f 100644 --- a/openair1/PHY/LTE_TRANSPORT/rar_tools.c +++ b/openair1/PHY/LTE_TRANSPORT/rar_tools.c @@ -40,12 +40,8 @@ #include "PHY/defs.h" #include "PHY/extern.h" #include "SCHED/extern.h" -#ifdef OPENAIR2 #include "LAYER2/MAC/defs.h" -#include "MAC_INTERFACE/defs.h" -#include "MAC_INTERFACE/extern.h" #include "SCHED/defs.h" -#endif #include "assertions.h" @@ -81,7 +77,7 @@ int generate_eNB_ulsch_params_from_rar(unsigned char *rar_pdu, uint16_t *RIV2nb_rb_LUT, *RIV2first_rb_LUT; uint16_t RIV_max; - LOG_I(PHY,"[eNB][RAPROC] generate_eNB_ulsch_params_from_rar: subframe %d (harq_pid %d)\n",subframe,harq_pid); + LOG_D(PHY,"[eNB][RAPROC] generate_eNB_ulsch_params_from_rar: subframe %d (harq_pid %d)\n",subframe,harq_pid); switch (frame_parms->N_RB_DL) { case 6: diff --git a/openair1/PHY/LTE_TRANSPORT/srs_modulation.c b/openair1/PHY/LTE_TRANSPORT/srs_modulation.c index 1edc98cf2cb6c1bf54456d23843720acb7f0d9d8..249fd81ee45d2547f3633156c7c8a0d4ae313168 100644 --- a/openair1/PHY/LTE_TRANSPORT/srs_modulation.c +++ b/openair1/PHY/LTE_TRANSPORT/srs_modulation.c @@ -137,7 +137,7 @@ int32_t generate_srs_tx(PHY_VARS_UE *phy_vars_ue, LTE_DL_FRAME_PARMS *frame_parms=&phy_vars_ue->lte_frame_parms; SOUNDINGRS_UL_CONFIG_DEDICATED *soundingrs_ul_config_dedicated=&phy_vars_ue->soundingrs_ul_config_dedicated[eNB_id]; - mod_sym_t *txdataF = phy_vars_ue->lte_ue_common_vars.txdataF[0]; + int32_t *txdataF = phy_vars_ue->lte_ue_common_vars.txdataF[0]; uint16_t msrsb=0,Nb=0,nb,b,msrs0=0,k,Msc_RS,Msc_RS_idx,carrier_pos,symbol_offset; uint16_t *Msc_idx_ptr; int32_t k0; @@ -237,13 +237,13 @@ int32_t generate_srs_tx(PHY_VARS_UE *phy_vars_ue, for (k=0; k<Msc_RS; k++) { if ((ul_ref_sigs[0][0][Msc_RS_idx][k<<1] >= 0) && (ul_ref_sigs[0][0][Msc_RS_idx][(k<<1)+1] >= 0)) - txdataF[symbol_offset+carrier_pos] = (mod_sym_t) 4; + txdataF[symbol_offset+carrier_pos] = (int32_t) 4; else if ((ul_ref_sigs[0][0][Msc_RS_idx][k<<1] >= 0) && (ul_ref_sigs[0][0][Msc_RS_idx][(k<<1)+1] < 0)) - txdataF[symbol_offset+carrier_pos] = (mod_sym_t) 2; + txdataF[symbol_offset+carrier_pos] = (int32_t) 2; else if ((ul_ref_sigs[0][0][Msc_RS_idx][k<<1] < 0) && (ul_ref_sigs[0][0][Msc_RS_idx][(k<<1)+1] >= 0)) - txdataF[symbol_offset+carrier_pos] = (mod_sym_t) 3; + txdataF[symbol_offset+carrier_pos] = (int32_t) 3; else if ((ul_ref_sigs[0][0][Msc_RS_idx][k<<1] < 0) && (ul_ref_sigs[0][0][Msc_RS_idx][(k<<1)+1] < 0)) - txdataF[symbol_offset+carrier_pos] = (mod_sym_t) 1; + txdataF[symbol_offset+carrier_pos] = (int32_t) 1; carrier_pos+=2; diff --git a/openair1/PHY/LTE_TRANSPORT/sss.c b/openair1/PHY/LTE_TRANSPORT/sss.c index e1e6463b3700cff2edd8fcca9bab496a877f3f65..34d55daaea4fc66c9a4abf8626753097d34a2035 100644 --- a/openair1/PHY/LTE_TRANSPORT/sss.c +++ b/openair1/PHY/LTE_TRANSPORT/sss.c @@ -44,7 +44,7 @@ //#define DEBUG_SSS -int generate_sss(mod_sym_t **txdataF, +int generate_sss(int32_t **txdataF, int16_t amp, LTE_DL_FRAME_PARMS *frame_parms, uint16_t symbol, diff --git a/openair1/PHY/LTE_TRANSPORT/uci_tools.c b/openair1/PHY/LTE_TRANSPORT/uci_tools.c index 1cccc4aaac34bc39571c009f1c9587048974c3d7..6a475d52ee6e4f9ee9f85f1910822bf57f7494e9 100644 --- a/openair1/PHY/LTE_TRANSPORT/uci_tools.c +++ b/openair1/PHY/LTE_TRANSPORT/uci_tools.c @@ -39,8 +39,6 @@ */ #include "PHY/defs.h" #include "PHY/extern.h" -#include "MAC_INTERFACE/defs.h" -#include "MAC_INTERFACE/extern.h" #ifdef DEBUG_UCI_TOOLS #include "PHY/vars.h" #endif diff --git a/openair1/PHY/LTE_TRANSPORT/ulsch_coding.c b/openair1/PHY/LTE_TRANSPORT/ulsch_coding.c index 606f2d8dfc66d2a38e18dc5cd807a586cdc326ff..1004cfa192d482a2cf2d8df8ba131db2310165c0 100644 --- a/openair1/PHY/LTE_TRANSPORT/ulsch_coding.c +++ b/openair1/PHY/LTE_TRANSPORT/ulsch_coding.c @@ -73,7 +73,7 @@ void free_ue_ulsch(LTE_UE_ULSCH_t *ulsch) msg("Freeing ulsch %p\n",ulsch); #endif - for (i=0; i<ulsch->Mdlharq; i++) { + for (i=0; i<8; i++) { #ifdef DEBUG_ULSCH_FREE msg("Freeing ulsch process %d\n",i); #endif @@ -118,7 +118,7 @@ void free_ue_ulsch(LTE_UE_ULSCH_t *ulsch) } -LTE_UE_ULSCH_t *new_ue_ulsch(unsigned char Mdlharq,unsigned char N_RB_UL, uint8_t abstraction_flag) +LTE_UE_ULSCH_t *new_ue_ulsch(unsigned char N_RB_UL, uint8_t abstraction_flag) { LTE_UE_ULSCH_t *ulsch; @@ -147,9 +147,8 @@ LTE_UE_ULSCH_t *new_ue_ulsch(unsigned char Mdlharq,unsigned char N_RB_UL, uint8_ if (ulsch) { memset(ulsch,0,sizeof(LTE_UE_ULSCH_t)); - ulsch->Mdlharq = Mdlharq; - for (i=0; i<Mdlharq; i++) { + for (i=0; i<8; i++) { ulsch->harq_processes[i] = (LTE_UL_UE_HARQ_t *)malloc16(sizeof(LTE_UL_UE_HARQ_t)); @@ -187,7 +186,7 @@ LTE_UE_ULSCH_t *new_ue_ulsch(unsigned char Mdlharq,unsigned char N_RB_UL, uint8_ } if ((abstraction_flag == 0) && (exit_flag==0)) { - for (i=0; i<Mdlharq; i++) + for (i=0; i<8; i++) for (j=0; j<96; j++) for (r=0; r<MAX_NUM_ULSCH_SEGMENTS; r++) ulsch->harq_processes[i]->d[r][j] = LTE_NULL; @@ -541,7 +540,7 @@ uint32_t ulsch_encoding(uint8_t *a, ulsch->e+r_offset, ulsch->harq_processes[harq_pid]->C, // C NSOFT, // Nsoft, - ulsch->Mdlharq, + 0, // this means UL 1, ulsch->harq_processes[harq_pid]->rvidx, get_Qm_ul(ulsch->harq_processes[harq_pid]->mcs), diff --git a/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c b/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c index 25dae3ed63646da5a632e3eed86b6b56f7916284..a0a5602261ceb4015104d3e94ef12be220bab228 100644 --- a/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c +++ b/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c @@ -44,8 +44,6 @@ #include "PHY/extern.h" #include "PHY/CODING/extern.h" #include "extern.h" -#include "MAC_INTERFACE/defs.h" -#include "MAC_INTERFACE/extern.h" #include "SCHED/extern.h" #ifdef OPENAIR2 #include "LAYER2/MAC/defs.h" @@ -54,10 +52,6 @@ #include "PHY_INTERFACE/extern.h" #endif -#ifdef OMP -#include <omp.h> -#endif - #ifdef PHY_ABSTRACTION #include "UTIL/OCG/OCG.h" #include "UTIL/OCG/OCG_extern.h" @@ -72,7 +66,7 @@ void free_eNB_ulsch(LTE_eNB_ULSCH_t *ulsch) int i,r; if (ulsch) { - for (i=0; i<ulsch->Mdlharq; i++) { + for (i=0; i<8; i++) { if (ulsch->harq_processes[i]) { if (ulsch->harq_processes[i]->b) { free16(ulsch->harq_processes[i]->b,MAX_ULSCH_PAYLOAD_BYTES); @@ -100,7 +94,7 @@ void free_eNB_ulsch(LTE_eNB_ULSCH_t *ulsch) } } -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_eNB_ULSCH_t *new_eNB_ulsch(uint8_t max_turbo_iterations,uint8_t N_RB_UL, uint8_t abstraction_flag) { LTE_eNB_ULSCH_t *ulsch; @@ -129,10 +123,10 @@ LTE_eNB_ULSCH_t *new_eNB_ulsch(uint8_t Mdlharq,uint8_t max_turbo_iterations,uint if (ulsch) { memset(ulsch,0,sizeof(LTE_eNB_ULSCH_t)); - ulsch->Mdlharq = Mdlharq; ulsch->max_turbo_iterations = max_turbo_iterations; + ulsch->Mlimit = 4; - for (i=0; i<Mdlharq; i++) { + for (i=0; i<8; i++) { // msg("new_ue_ulsch: Harq process %d\n",i); ulsch->harq_processes[i] = (LTE_UL_eNB_HARQ_t *)malloc16(sizeof(LTE_UL_eNB_HARQ_t)); @@ -148,7 +142,6 @@ LTE_eNB_ULSCH_t *new_eNB_ulsch(uint8_t Mdlharq,uint8_t max_turbo_iterations,uint if (abstraction_flag==0) { for (r=0; r<MAX_NUM_ULSCH_SEGMENTS/bw_scaling; r++) { ulsch->harq_processes[i]->c[r] = (uint8_t*)malloc16(((r==0)?8:0) + 3+768); - if (ulsch->harq_processes[i]->c[r]) memset(ulsch->harq_processes[i]->c[r],0,((r==0)?8:0) + 3+768); else @@ -179,18 +172,16 @@ LTE_eNB_ULSCH_t *new_eNB_ulsch(uint8_t Mdlharq,uint8_t max_turbo_iterations,uint return(NULL); } -void clean_eNb_ulsch(LTE_eNB_ULSCH_t *ulsch, uint8_t abstraction_flag) +void clean_eNb_ulsch(LTE_eNB_ULSCH_t *ulsch) { - unsigned char Mdlharq; unsigned char i; //ulsch = (LTE_eNB_ULSCH_t *)malloc16(sizeof(LTE_eNB_ULSCH_t)); if (ulsch) { - Mdlharq = ulsch->Mdlharq; ulsch->rnti = 0; - for (i=0; i<Mdlharq; i++) { + for (i=0; i<8; i++) { if (ulsch->harq_processes[i]) { // ulsch->harq_processes[i]->Ndi = 0; ulsch->harq_processes[i]->status = 0; @@ -254,7 +245,7 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB, uint8_t *columnset; unsigned int sumKr=0; unsigned int Qprime,L,G,Q_CQI,Q_RI,H,Hprime,Hpp,Cmux,Rmux_prime,O_RCC; - unsigned int Qprime_ACK,Qprime_CQI,Qprime_RI,len_ACK=0,len_RI=0; + unsigned int Qprime_ACK,Qprime_RI,len_ACK=0,len_RI=0; // uint8_t q_ACK[MAX_ACK_PAYLOAD],q_RI[MAX_RI_PAYLOAD]; int metric,metric_new; uint8_t o_flip[8]; @@ -288,13 +279,12 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB, time_stats_t *, time_stats_t *); - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_ULSCH_DECODING,1); + harq_pid = subframe2harq_pid(frame_parms,phy_vars_eNB->proc[sched_subframe].frame_rx,subframe); + + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_ULSCH_DECODING0+harq_pid,1); // x1 is set in lte_gold_generic x2 = ((uint32_t)ulsch->rnti<<14) + ((uint32_t)subframe<<9) + frame_parms->Nid_cell; //this is c_init in 36.211 Sec 6.3.1 - - // harq_pid = (ulsch->RRCConnRequest_flag == 0) ? subframe2harq_pid_tdd(frame_parms->tdd_config,subframe) : 0; - harq_pid = subframe2harq_pid(frame_parms,phy_vars_eNB->proc[sched_subframe].frame_rx,subframe); ulsch_harq = ulsch->harq_processes[harq_pid]; if (harq_pid==255) { @@ -347,6 +337,7 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB, // CLEAR LLR's HERE for first packet in process } + // printf("after segmentation c[%d] = %p\n",0,ulsch_harq->c[0]); sumKr = 0; @@ -419,12 +410,13 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB, else L=8; + // NOTE: we have to handle the case where we have a very small number of bits (condition on pg. 26 36.212) if (ulsch_harq->Or1 > 0) Qprime = (ulsch_harq->Or1 + L) * ulsch_harq->Msc_initial*ulsch_harq->Nsymb_initial * ulsch->beta_offset_cqi_times8; else Qprime=0; - if (Qprime > 0) { + if (Qprime > 0) { // check if ceiling is larger than floor in Q' expression if ((Qprime % (8*sumKr)) > 0) Qprime = 1+(Qprime/(8*sumKr)); else @@ -435,14 +427,10 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB, - if (Qprime > (G - ulsch_harq->O_RI)) - Qprime = G - ulsch_harq->O_RI; - Q_CQI = Q_m * Qprime; #ifdef DEBUG_ULSCH_DECODING msg("ulsch_decoding: G %d, Q_RI %d, Q_CQI %d (L %d, Or1 %d) O_ACK %d\n",G,Q_RI,Q_CQI,L,ulsch_harq->Or1,ulsch_harq->O_ACK); #endif - Qprime_CQI = Qprime; G = G - Q_RI - Q_CQI; @@ -461,9 +449,7 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB, // Rmux = Hpp*Q_m/Cmux; Rmux_prime = Hpp/Cmux; -#ifdef DEBUG_ULSCH_DECODING - msg("ulsch_decoding.c: G raw %d (%d symb), Hpp %d, Cmux %d, Rmux_prime %d\n",G,ulsch_harq->Nsymb_pusch,Hpp,Cmux,Rmux_prime); -#endif + // Clear "tag" interleaving matrix to allow for CQI/DATA identification memset(ytag,0,Cmux*Rmux_prime); @@ -471,128 +457,8 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB, i=0; memset(y,LTE_NULL,Q_m*Hpp); - /* - // Do RI coding - if (ulsch->O_RI == 1) { - switch (Q_m) { - case 2: - q_RI[0] = 0; - q_RI[1] = PUSCH_y; - len_RI=2; - break; - case 4: - q_RI[0] = 0; - q_RI[1] = PUSCH_y;//1; - q_RI[2] = PUSCH_x;//o_RI[0]; - q_RI[3] = PUSCH_x;//1; - len_RI=4; - break; - case 6: - q_RI[0] = 0; - q_RI[1] = PUSCH_y;//1; - q_RI[2] = PUSCH_x;//1; - q_RI[3] = PUSCH_x;//ulsch->o_RI[0]; - q_RI[4] = PUSCH_x;//1; - q_RI[5] = PUSCH_x;//1; - len_RI=6; - break; - } - } - else if (ulsch->O_RI > 1){ - LOG_E(PHY,"ulsch_decoding: FATAL, RI cannot be more than 1 bit yet\n"); - return(-1); - } - // 1-bit ACK/NAK - if (ulsch_harq->O_ACK == 1) { - switch (Q_m) { - case 2: - q_ACK[0] = 0; - q_ACK[1] = (ulsch->bundling==0)? PUSCH_y : 0; - len_ACK = 2; - break; - case 4: - q_ACK[0] = 0; - q_ACK[1] = (ulsch->bundling==0)? PUSCH_y : 0; - q_ACK[2] = PUSCH_x; - q_ACK[3] = PUSCH_x; - len_ACK = 4; - break; - case 6: - q_ACK[0] = 0; - q_ACK[1] = (ulsch->bundling==0)? PUSCH_y : 0; - q_ACK[2] = PUSCH_x; - q_ACK[3] = PUSCH_x; - q_ACK[4] = PUSCH_x; - q_ACK[6] = PUSCH_x; - len_ACK = 6; - break; - } - } - // two-bit ACK/NAK - if (ulsch_harq->O_ACK == 2) { - switch (Q_m) { - case 2: - q_ACK[0] = 0; - q_ACK[1] = 0; - q_ACK[2] = 0; - q_ACK[3] = 0; - q_ACK[4] = 0; - q_ACK[5] = 0; - len_ACK = 6; - break; - case 4: - q_ACK[0] = 0; - q_ACK[1] = 0; - q_ACK[2] = PUSCH_x; - q_ACK[3] = PUSCH_x;//1; - q_ACK[4] = 0; - q_ACK[5] = 0; - q_ACK[6] = PUSCH_x; - q_ACK[7] = PUSCH_x;//1; - q_ACK[8] = 0; - q_ACK[9] = 0; - q_ACK[10] = PUSCH_x; - q_ACK[11] = PUSCH_x;//1; - len_ACK = 12; - break; - case 6: - q_ACK[0] = 0; - q_ACK[1] = 0; - q_ACK[2] = PUSCH_x; - q_ACK[3] = PUSCH_x; - q_ACK[4] = PUSCH_x; - q_ACK[5] = PUSCH_x; - - q_ACK[6] = 0; - q_ACK[7] = 0; - q_ACK[8] = PUSCH_x; - q_ACK[9] = PUSCH_x; - q_ACK[10] = PUSCH_x; - q_ACK[11] = PUSCH_x; - - q_ACK[12] = 0; - q_ACK[13] = 0; - q_ACK[14] = PUSCH_x; - q_ACK[15] = PUSCH_x; - q_ACK[16] = PUSCH_x; - q_ACK[17] = PUSCH_x; - len_ACK = 18; - - break; - } - } - if (ulsch_harq->O_ACK > 2) { - LOG_E(PHY,"ulsch_decoding: FATAL, ACK cannot be more than 2 bits yet\n"); - return(-1); - } - - - // RI BITS - - // memset(ytag2,0,Q_m*Hpp); - - */ + // printf("before unscrambling c[%d] = %p\n",0,ulsch_harq->c[0]); // read in buffer and unscramble llrs for everything but placeholder bits // llrs stored per symbol correspond to columns of interleaving matrix @@ -608,6 +474,8 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB, s = lte_gold_generic(&x1, &x2, 0); } + // printf("after unscrambling c[%d] = %p\n",0,ulsch_harq->c[0]); + if (frame_parms->Ncp == 0) columnset = cs_ri_normal; else @@ -631,6 +499,8 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB, } + // printf("after RI c[%d] = %p\n",0,ulsch_harq->c[0]); + // HARQ-ACK Bits (Note these overwrite some bits) if (frame_parms->Ncp == 0) columnset = cs_ack_normal; @@ -733,40 +603,6 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB, } - // for (q=0;q<Q_m;q++) { - /* - if ((i&0x1f)==0) { - s = lte_gold_generic(&x1, &x2, reset); - // msg("lte_gold[%d]=%x\n",i,s); - reset = 0; - } - c = (uint8_t)((s>>(i&0x1f))&1); - - - - // if bits are tagged as placeholders (RI,ACK) - - if (ytag2[q+(Q_m*((r*Cmux)+j))] == PUSCH_y) { - - c=c_prev; - } - else if (ytag2[q+(Q_m*((r*Cmux)+j))] == PUSCH_x) { - c = 0; - #ifdef DEBUG_ULSCH_DECODING - // msg("ulsch_decoding.c: PUSCH_x in row %d, col %d: llr %d\n",r,j,ulsch_llr[i]); - #endif - } - c_prev = c; - #ifdef DEBUG_ULSCH_DECODING - // msg("llr[%d] = %d (c %d, ytag2 %d) ==> ",i,ulsch_llr[i],c,ytag2[q+(Q_m*((r*Cmux)+j))]); - #endif - // note flipped here for reverse polarity in 3GPP bit mapping - y[q+(Q_m*((r*Cmux)+j))] = (c==0) ? -ulsch_llr[i] : ulsch_llr[i]; - i++; - #ifdef DEBUG_ULSCH_DECODING - // msg("%d\n",y[q+(Q_m*((r*Cmux)+j))]); - #endif - */ stop_meas(&phy_vars_eNB->ulsch_demultiplexing_stats); if (i!=(H+Q_RI)) @@ -828,17 +664,13 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB, for (q=0; q<Q_m; q++) { if (y[q+(Q_m*((r*Cmux) + columnset[j]))]!=0) ulsch_harq->q_ACK[(q+(Q_m*i))%len_ACK] += y[q+(Q_m*((r*Cmux) + columnset[j]))]; - -#ifdef DEBUG_ULSCH_DECODING - // LOG_D(PHY,"ACK %d => %d (%d,%d,%d)\n",(q+(Q_m*i))%len_ACK,ulsch_harq->q_ACK[(q+(Q_m*i))%len_ACK],q+(Q_m*((r*Cmux) + columnset[j])),r,columnset[j]); - printf("ACK %d => %d (%d,%d,%d)\n",(q+(Q_m*i))%len_ACK,ulsch_harq->q_ACK[(q+(Q_m*i))%len_ACK],q+(Q_m*((r*Cmux) + columnset[j])),r,columnset[j]); -#endif y[q+(Q_m*((r*Cmux) + columnset[j]))]=0; // NULL LLRs in ACK positions } j=(j+3)&3; } + // printf("after ACKNAK c[%d] = %p\n",0,ulsch_harq->c[0]); // RI BITS @@ -883,178 +715,141 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB, j=(j+3)&3; } + // printf("after RI2 c[%d] = %p\n",0,ulsch_harq->c[0]); + // CQI and Data bits j=0; j2=0; // r=0; - for (i=0; i<Qprime_CQI; i++) { - - /* - while (ytag[(r*Cmux)+j]==LTE_NULL) { - #ifdef DEBUG_ULSCH_DECODING - msg("ulsch_decoding.c: r %d, j %d: LTE_NULL\n",r,j); - #endif - j++; - if (j==Cmux) { - j=0; - r++; + if (Q_RI>0) { + for (i=0; i<(Q_CQI/Q_m); i++) { + + while (ytag[j]==LTE_NULL) { + j++; + j2+=Q_m; } - } - for (q=0;q<Q_m;q++) { - ys = y[q+(Q_m*((r*Cmux)+j))]; - if (ys>127) - ulsch_harq->q[q+(Q_m*i)] = 127; - else if (ys<-128) - ulsch_harq->q[q+(Q_m*i)] = -128; - else - ulsch_harq->q[q+(Q_m*i)] = ys; - #ifdef DEBUG_ULSCH_DECODING - msg("ulsch_decoding.c: CQI %d, r %d, j %d, y[%d] %d\n",q+(Q_m*i),r,j, q+(Q_m*((r*Cmux) + j)),ys); - #endif - } - */ - while (ytag[j]==LTE_NULL) { - j++; + + for (q=0; q<Q_m; q++) { + // ys = y[q+(Q_m*((r*Cmux)+j))]; + ys = y[q+j2]; + + if (ys>127) + ulsch_harq->q[q+(Q_m*i)] = 127; + else if (ys<-128) + ulsch_harq->q[q+(Q_m*i)] = -128; + else + ulsch_harq->q[q+(Q_m*i)] = ys; + } + j2+=Q_m; } - - for (q=0; q<Q_m; q++) { - // ys = y[q+(Q_m*((r*Cmux)+j))]; - ys = y[q+j2]; - - if (ys>127) - ulsch_harq->q[q+(Q_m*i)] = 127; - else if (ys<-128) - ulsch_harq->q[q+(Q_m*i)] = -128; - else - ulsch_harq->q[q+(Q_m*i)] = ys; - -#ifdef DEBUG_ULSCH_DECODING - msg("ulsch_decoding.c: CQI %d, q %d, y[%d] %d\n",q+(Q_m*i),q,j2, q+j2,ys); -#endif - } - - j2+=Q_m; - } - - // j2=j*Q_m; - - switch (Q_m) { - case 2: - for (iprime=0; iprime<(Hprime-Qprime_CQI)<<1;) { - while (ytag[j]==LTE_NULL) { - j++; - j2+=2; + + + switch (Q_m) { + case 2: + for (iprime=0; iprime<G;) { + while (ytag[j]==LTE_NULL) { + j++; + j2+=2; + } + + ulsch_harq->e[iprime++] = y[j2++]; + ulsch_harq->e[iprime++] = y[j2++]; + } - - ulsch_harq->e[iprime++] = y[j2++]; - ulsch_harq->e[iprime++] = y[j2++]; -#ifdef DEBUG_ULSCH_DECODING - // msg("ulsch_decoding.c: e %d, r %d, j %d, y[%d] %d\n",g,r,j,q+(Q_m*((r*Cmux) + j)),y[q+(Q_m*((r*Cmux)+j))]); -#endif - - } - - // write_output("/tmp/ulsch_e.m","ulsch_e",ulsch->e,iprime,1,0); - break; - - case 4: - for (iprime=0; iprime<(Hprime-Qprime_CQI)<<2;) { - while (ytag[j]==LTE_NULL) { - j++; - j2+=4; + + + break; + + case 4: + for (iprime=0; iprime<G;) { + while (ytag[j]==LTE_NULL) { + j++; + j2+=4; + } + + ulsch_harq->e[iprime++] = y[j2++]; + ulsch_harq->e[iprime++] = y[j2++]; + ulsch_harq->e[iprime++] = y[j2++]; + ulsch_harq->e[iprime++] = y[j2++]; + } - - ulsch_harq->e[iprime++] = y[j2++]; - ulsch_harq->e[iprime++] = y[j2++]; - ulsch_harq->e[iprime++] = y[j2++]; - ulsch_harq->e[iprime++] = y[j2++]; -#ifdef DEBUG_ULSCH_DECODING - // msg("ulsch_decoding.c: e %d, r %d, j %d, y[%d] %d\n",g,r,j,q+(Q_m*((r*Cmux) + j)),y[q+(Q_m*((r*Cmux)+j))]); -#endif - - } - - break; - - case 6: - for (iprime=0; iprime<(Hprime-Qprime_CQI)*6;) { - while (ytag[j]==LTE_NULL) { - j++; - j2+=6; + + break; + + case 6: + for (iprime=0; iprime<G;) { + while (ytag[j]==LTE_NULL) { + j++; + j2+=6; + } + + ulsch_harq->e[iprime++] = y[j2++]; + ulsch_harq->e[iprime++] = y[j2++]; + ulsch_harq->e[iprime++] = y[j2++]; + ulsch_harq->e[iprime++] = y[j2++]; + ulsch_harq->e[iprime++] = y[j2++]; + ulsch_harq->e[iprime++] = y[j2++]; + } - - ulsch_harq->e[iprime++] = y[j2++]; - ulsch_harq->e[iprime++] = y[j2++]; - ulsch_harq->e[iprime++] = y[j2++]; - ulsch_harq->e[iprime++] = y[j2++]; - ulsch_harq->e[iprime++] = y[j2++]; - ulsch_harq->e[iprime++] = y[j2++]; -#ifdef DEBUG_ULSCH_DECODING - // msg("ulsch_decoding.c: e %d, r %d, j %d, y[%d] %d\n",g,r,j,q+(Q_m*((r*Cmux) + j)),y[q+(Q_m*((r*Cmux)+j))]); -#endif + + break; } - - break; - - } - - /* - for (i=0,iprime=-Qprime_CQI;i<Hprime;i++,iprime++) { - - while (ytag[(r*Cmux)+j]==LTE_NULL) { - #ifdef DEBUG_ULSCH_DECODING - msg("ulsch_decoding.c: r %d, j %d: LTE_NULL\n",r,j); - #endif - j++; - if (j==Cmux) { - j=0; - r++; + + + } // Q_RI>0 + else { + + for (i=0; i<(Q_CQI/Q_m); i++) { + + for (q=0; q<Q_m; q++) { + ys = y[q+j2]; + if (ys>127) + ulsch_harq->q[q+(Q_m*i)] = 127; + else if (ys<-128) + ulsch_harq->q[q+(Q_m*i)] = -128; + else + ulsch_harq->q[q+(Q_m*i)] = ys; } + + j2+=Q_m; } - - if (i<Qprime_CQI) { - - for (q=0;q<Q_m;q++) { - ys = y[q+(Q_m*((r*Cmux)+j))]; - if (ys>127) - ulsch_harq->q[q+(Q_m*i)] = 127; - else if (ys<-128) - ulsch_harq->q[q+(Q_m*i)] = -128; - else - ulsch_harq->q[q+(Q_m*i)] = ys; - #ifdef DEBUG_ULSCH_DECODING - msg("ulsch_decoding.c: CQI %d, r %d, j %d, y[%d] %d\n",q+(Q_m*i),r,j, q+(Q_m*((r*Cmux) + j)),ys); - #endif + // printf("after CQI0 c[%d] = %p\n",0,ulsch_harq->c[0]); + switch (Q_m) { + case 2: + for (iprime=0; iprime<G;) { + ulsch_harq->e[iprime++] = y[j2++]; + ulsch_harq->e[iprime++] = y[j2++]; } - } - else { - for (q=0;q<Q_m;q++) { - g = q+(Q_m*iprime); - ulsch->e[g] = y[q+(Q_m*((r*Cmux)+j))]; - #ifdef DEBUG_ULSCH_DECODING - // msg("ulsch_decoding.c: e %d, r %d, j %d, y[%d] %d\n",g,r,j,q+(Q_m*((r*Cmux) + j)),y[q+(Q_m*((r*Cmux)+j))]); - #endif + break; + case 4: + for (iprime=0; iprime<G;) { + ulsch_harq->e[iprime++] = y[j2++]; + ulsch_harq->e[iprime++] = y[j2++]; + ulsch_harq->e[iprime++] = y[j2++]; + ulsch_harq->e[iprime++] = y[j2++]; } - } - j++; - if (j==Cmux) { - j=0; - r++; + break; + case 6: + for (iprime=0; iprime<G;) { + ulsch_harq->e[iprime++] = y[j2++]; + ulsch_harq->e[iprime++] = y[j2++]; + ulsch_harq->e[iprime++] = y[j2++]; + ulsch_harq->e[iprime++] = y[j2++]; + ulsch_harq->e[iprime++] = y[j2++]; + ulsch_harq->e[iprime++] = y[j2++]; + } + break; } } - */ + // printf("after ACKNAK2 c[%d] = %p (iprime %d, G %d)\n",0,ulsch_harq->c[0],iprime,G); // Do CQI/RI/HARQ-ACK Decoding first and pass to MAC // HARQ-ACK wACK_idx = (ulsch->bundling==0) ? 4 : ((Nbundled-1)&3); -#ifdef DEBUG_ULSCH_DECODING - msg("ulsch_decoding.c: Bundling %d, Nbundled %d, wACK_idx %d\n", - ulsch->bundling,Nbundled,wACK_idx); -#endif if (ulsch_harq->O_ACK == 1) { ulsch_harq->q_ACK[0] *= wACK_RX[wACK_idx][0]; @@ -1064,10 +859,6 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB, ulsch_harq->o_ACK[0] = 0; else ulsch_harq->o_ACK[0] = 1; - -#ifdef DEBUG_ULSCH_DECODING - msg("ulsch_decoding.c: ulsch_q_ACK[0] %d (%d,%d)\n",ulsch_harq->q_ACK[0],wACK_RX[wACK_idx][0],wACK_RX[wACK_idx][1]); -#endif } if (ulsch_harq->O_ACK == 2) { @@ -1077,16 +868,12 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB, ulsch_harq->q_ACK[0] = ulsch_harq->q_ACK[0]*wACK_RX[wACK_idx][0] + ulsch_harq->q_ACK[3]*wACK_RX[wACK_idx][1]; ulsch_harq->q_ACK[1] = ulsch_harq->q_ACK[1]*wACK_RX[wACK_idx][0] + ulsch_harq->q_ACK[4]*wACK_RX[wACK_idx][1]; ulsch_harq->q_ACK[2] = ulsch_harq->q_ACK[2]*wACK_RX[wACK_idx][0] + ulsch_harq->q_ACK[5]*wACK_RX[wACK_idx][1]; - break; - case 4: ulsch_harq->q_ACK[0] = ulsch_harq->q_ACK[0]*wACK_RX[wACK_idx][0] + ulsch_harq->q_ACK[5]*wACK_RX[wACK_idx][1]; ulsch_harq->q_ACK[1] = ulsch_harq->q_ACK[1]*wACK_RX[wACK_idx][0] + ulsch_harq->q_ACK[8]*wACK_RX[wACK_idx][1]; ulsch_harq->q_ACK[2] = ulsch_harq->q_ACK[4]*wACK_RX[wACK_idx][0] + ulsch_harq->q_ACK[9]*wACK_RX[wACK_idx][1]; - break; - case 6: ulsch_harq->q_ACK[0] = ulsch_harq->q_ACK[0]*wACK_RX[wACK_idx][0] + ulsch_harq->q_ACK[7]*wACK_RX[wACK_idx][1]; ulsch_harq->q_ACK[1] = ulsch_harq->q_ACK[1]*wACK_RX[wACK_idx][0] + ulsch_harq->q_ACK[12]*wACK_RX[wACK_idx][1]; @@ -1123,37 +910,16 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB, } } -#ifdef DEBUG_ULSCH_DECODING - - for (i=0; i<ulsch_harq->O_ACK; i++) - msg("ulsch_decoding: O_ACK[%d] %d, q_ACK => (%d,%d,%d)\n",i,ulsch_harq->o_ACK[i],ulsch_harq->q_ACK[0],ulsch_harq->q_ACK[1],ulsch_harq->q_ACK[2]); - -#endif - // RI if ((ulsch_harq->O_RI == 1) && (Qprime_RI > 0)) { ulsch_harq->o_RI[0] = ((ulsch_harq->q_RI[0] + ulsch_harq->q_RI[Q_m/2]) > 0) ? 0 : 1; } -#ifdef DEBUG_ULSCH_DECODING - - if (Qprime_RI > 0) { - for (i=0; i<2*ulsch_harq->O_RI; i++) - msg("ulsch_decoding: q_RI[%d] %d\n",i,ulsch_harq->q_RI[i]); - } - - if (Qprime_CQI > 0) { - for (i=0; i<ulsch_harq->O_RI; i++) - LOG_D(PHY,"ulsch_decoding: O_RI[%d] %d\n",i,ulsch_harq->o_RI[i]); - } - -#endif - - // CQI - if (Qprime_CQI>0) { + // printf("before cqi c[%d] = %p\n",0,ulsch_harq->c[0]); + if (Q_CQI>0) { memset((void *)&dummy_w_cc[0],0,3*(ulsch_harq->Or1+8+32)); O_RCC = generate_dummy_w_cc(ulsch_harq->Or1+8, @@ -1178,7 +944,6 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB, else ulsch_harq->cqi_crc_status = 0; - //printf("crc(cqi) rx: %x\n",(crc8(o_flip,ulsch->Or1)>>24)); if (ulsch->harq_processes[harq_pid]->Or1<=32) { ulsch_harq->o[3] = o_flip[0] ; @@ -1221,6 +986,7 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB, for (r=0; r<ulsch_harq->C; r++) { + // printf("before subblock deinterleaving c[%d] = %p\n",r,ulsch_harq->c[r]); // Get Turbo interleaver parameters if (r<ulsch_harq->Cminus) Kr = ulsch_harq->Kminus; @@ -1269,7 +1035,7 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB, ulsch_harq->e+r_offset, ulsch_harq->C, NSOFT, - ulsch->Mdlharq, + 0, //Uplink 1, ulsch_harq->rvidx, (ulsch_harq->round==0)?1:0, // clear @@ -1283,50 +1049,25 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB, stop_meas(&phy_vars_eNB->ulsch_rate_unmatching_stats); r_offset += E; - /* - msg("Subblock deinterleaving, d %p w %p\n", - ulsch_harq->d[r], - ulsch_harq->w); - */ + start_meas(&phy_vars_eNB->ulsch_deinterleaving_stats); sub_block_deinterleaving_turbo(4+Kr, &ulsch_harq->d[r][96], ulsch_harq->w[r]); stop_meas(&phy_vars_eNB->ulsch_deinterleaving_stats); - /* - #ifdef DEBUG_ULSCH_DECODING - msg("decoder input(segment %d) :",r); - for (i=0;i<(3*8*Kr_bytes)+12;i++) - msg("%d : %d\n",i,ulsch_harq->d[r][96+i]); - msg("\n"); - #endif - */ } -#ifdef OMP - #pragma omp parallel private(r,ret) shared(ulsch,harq_pid,crc_type,Kr,f1f2mat_old,phy_vars_eNB,status,iind,) - { - #pragma omp for nowait -#endif - for (r=0; r<ulsch_harq->C; r++) { - // msg("Clearing c, %p\n",ulsch_harq->c[r]); - // memset(ulsch_harq->c[r],0,16);//block_length); - // msg("done\n"); + + /* printf("c[%d] : %p\n",r, + ulsch_harq->c[r]); + */ + if (ulsch_harq->C == 1) crc_type = CRC24_A; else crc_type = CRC24_B; - /* - msg("decoder input(segment %d)\n",r); - for (i=0;i<(3*8*Kr_bytes)+12;i++) - if ((ulsch_harq->d[r][96+i]>7) || - (ulsch_harq->d[r][96+i] < -8)) - msg("%d : %d\n",i,ulsch_harq->d[r][96+i]); - msg("\n"); - */ - start_meas(&phy_vars_eNB->ulsch_turbo_decoding_stats); ret = tc(&ulsch_harq->d[r][96], @@ -1349,31 +1090,10 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB, status[r] = ret; - if (ret==(1+ulsch->max_turbo_iterations)) {// a Code segment is in error so break; -#ifdef DEBUG_ULSCH_DECODING - msg("ULSCH harq_pid %d CRC failed\n",harq_pid); -#endif - /* - for (i=0;i<Kr_bytes;i++) - printf("segment %d : byte %d => %d\n",r,i,ulsch_harq->c[r][i]); - return(ret); - */ - } - -#ifdef DEBUG_ULSCH_DECODING - else - msg("ULSCH harq_pid %d CRC OK : %d iterations\n",harq_pid, ret); - -#endif - } -#ifdef OMP - } -#endif // Reassembly of Transport block here offset = 0; - // msg("F %d, Fbytes %d\n",ulsch_harq->F,ulsch_harq->F>>3); ret = 1; @@ -1391,8 +1111,6 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB, &ulsch_harq->c[0][(ulsch_harq->F>>3)], Kr_bytes - (ulsch_harq->F>>3) - ((ulsch_harq->C>1)?3:0)); offset = Kr_bytes - (ulsch_harq->F>>3) - ((ulsch_harq->C>1)?3:0); - // msg("copied %d bytes to b sequence\n", - // Kr_bytes - (ulsch_harq->F>>3)); } else { memcpy(ulsch_harq->b+offset, ulsch_harq->c[r], @@ -1408,7 +1126,7 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB, } - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_ULSCH_DECODING,0); + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_ULSCH_DECODING0+harq_pid,0); return(ret); } diff --git a/openair1/PHY/LTE_TRANSPORT/ulsch_demodulation.c b/openair1/PHY/LTE_TRANSPORT/ulsch_demodulation.c index f2e4dea58aa75c2264ef7d502e7a169d1ec3e7e1..cc79488e37dd9a22166d8fdbb2f76ec65817050b 100644 --- a/openair1/PHY/LTE_TRANSPORT/ulsch_demodulation.c +++ b/openair1/PHY/LTE_TRANSPORT/ulsch_demodulation.c @@ -40,13 +40,13 @@ #include "PHY/defs.h" #include "PHY/extern.h" -#include "MAC_INTERFACE/defs.h" -#include "MAC_INTERFACE/extern.h" #include "defs.h" #include "extern.h" //#define DEBUG_ULSCH #include "PHY/sse_intrin.h" +#include "T.h" + //extern char* namepointer_chMag ; //eren //extern int **ulchmag_eren; @@ -1617,7 +1617,7 @@ void rx_ulsch(PHY_VARS_eNB *phy_vars_eNB, rx_power_correction = 1; if (ulsch[UE_id]->harq_processes[harq_pid]->nb_rb == 0) { - LOG_E(PHY,"PUSCH (%d/%x) nb_rb=0!\n", harq_pid,ulsch[UE_id]->rnti,harq_pid); + LOG_E(PHY,"PUSCH (%d/%x) nb_rb=0!\n", harq_pid,ulsch[UE_id]->rnti); return; } @@ -1840,6 +1840,11 @@ void rx_ulsch(PHY_VARS_eNB *phy_vars_eNB, #endif + T(T_PUSCH_IQ, T_INT(eNB_id), T_INT(UE_id), T_INT(phy_vars_eNB->proc[sched_subframe].frame_rx), + T_INT(subframe), T_INT(ulsch[UE_id]->harq_processes[harq_pid]->nb_rb), + T_BUFFER(eNB_pusch_vars->rxdataF_comp[eNB_id][0], + 2 * /* ulsch[UE_id]->harq_processes[harq_pid]->nb_rb */ frame_parms->N_RB_UL *12*frame_parms->symbols_per_tti*2)); + llrp = (int16_t*)&eNB_pusch_vars->llr[0]; for (l=0; l<frame_parms->symbols_per_tti-ulsch[UE_id]->harq_processes[harq_pid]->srs_active; l++) { diff --git a/openair1/PHY/LTE_TRANSPORT/ulsch_modulation.c b/openair1/PHY/LTE_TRANSPORT/ulsch_modulation.c index e9780ee92b20f2f5dbe9a455215d0b6a135fb088..b4f7f024803d0595c1fa0d674fae81d5cb3f5559 100644 --- a/openair1/PHY/LTE_TRANSPORT/ulsch_modulation.c +++ b/openair1/PHY/LTE_TRANSPORT/ulsch_modulation.c @@ -50,7 +50,7 @@ //#define DEBUG_ULSCH_MODULATION #ifndef OFDMA_ULSCH -void dft_lte(mod_sym_t *z,mod_sym_t *d, int32_t Msc_PUSCH, uint8_t Nsymb) +void dft_lte(int32_t *z,int32_t *d, int32_t Msc_PUSCH, uint8_t Nsymb) { #if defined(__x86_64__) || defined(__i386__) @@ -373,7 +373,7 @@ void dft_lte(mod_sym_t *z,mod_sym_t *d, int32_t Msc_PUSCH, uint8_t Nsymb) } #endif -void ulsch_modulation(mod_sym_t **txdataF, +void ulsch_modulation(int32_t **txdataF, short amp, uint32_t frame, uint32_t subframe, @@ -393,7 +393,7 @@ void ulsch_modulation(mod_sym_t **txdataF, // uint8_t harq_pid = (rag_flag == 1) ? 0 : subframe2harq_pid_tdd(frame_parms->tdd_config,subframe); uint8_t harq_pid = subframe2harq_pid(frame_parms,frame,subframe); uint8_t Q_m; - mod_sym_t *txptr; + int32_t *txptr; uint32_t symbol_offset; uint16_t first_rb; uint16_t nb_rb; diff --git a/openair1/PHY/MODULATION/defs.h b/openair1/PHY/MODULATION/defs.h index 6005d6d49accf71413e67ee33e470db42b6db29d..8b92e3886e403b4cd826b947421203d1cdb111de 100644 --- a/openair1/PHY/MODULATION/defs.h +++ b/openair1/PHY/MODULATION/defs.h @@ -87,7 +87,7 @@ int slot_fep_ul(LTE_DL_FRAME_PARMS *frame_parms, void normal_prefix_mod(int32_t *txdataF,int32_t *txdata,uint8_t nsymb,LTE_DL_FRAME_PARMS *frame_parms); -void do_OFDM_mod(mod_sym_t **txdataF, int32_t **txdata, uint32_t frame,uint16_t next_slot, LTE_DL_FRAME_PARMS *frame_parms); +void do_OFDM_mod(int32_t **txdataF, int32_t **txdata, uint32_t frame,uint16_t next_slot, LTE_DL_FRAME_PARMS *frame_parms); void remove_7_5_kHz(PHY_VARS_eNB *phy_vars_eNB,uint8_t subframe); diff --git a/openair1/PHY/MODULATION/ofdm_mod.c b/openair1/PHY/MODULATION/ofdm_mod.c index 3dd76c0fbbec394b6a62d71623e417be685d9a2c..d7dd141fb56d1063cf8b158759781046fa1f6521 100755 --- a/openair1/PHY/MODULATION/ofdm_mod.c +++ b/openair1/PHY/MODULATION/ofdm_mod.c @@ -91,7 +91,7 @@ void PHY_ofdm_mod(int *input, /// pointer to complex input ) { - static short temp[2048*4] __attribute__((aligned(16))); + static short temp[2048*4] __attribute__((aligned(32))); unsigned short i,j; short k; @@ -143,9 +143,18 @@ void PHY_ofdm_mod(int *input, /// pointer to complex input 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 +#ifndef __AVX2__ + // handle 128-bit alignment for 128-bit SIMD (SSE4,NEON,AltiVEC) idft((int16_t *)&input[i*fftsize], (fftsize==128) ? (int16_t *)temp : (int16_t *)&output[(i*fftsize) + ((1+i)*nb_prefix_samples)], 1); +#else + // on AVX2 need 256-bit alignment + idft((int16_t *)&input[i*fftsize], + (fftsize<=512) ? (int16_t *)temp : (int16_t *)&output[(i*fftsize) + ((1+i)*nb_prefix_samples)], + 1); + +#endif // Copy to frame buffer with Cyclic Extension // Note: will have to adjust for synchronization offset! @@ -158,7 +167,12 @@ void PHY_ofdm_mod(int *input, /// pointer to complex input // msg("Doing cyclic prefix method\n"); - if (fftsize==128) { +#ifndef __AVX2__ + if (fftsize==128) +#else + if (fftsize<=512) +#endif + { for (j=0; j<fftsize ; j++) { output_ptr[j] = temp_ptr[j]; } @@ -223,7 +237,7 @@ void PHY_ofdm_mod(int *input, /// pointer to complex input } -void do_OFDM_mod(mod_sym_t **txdataF, int32_t **txdata, uint32_t frame,uint16_t next_slot, LTE_DL_FRAME_PARMS *frame_parms) +void do_OFDM_mod(int32_t **txdataF, int32_t **txdata, uint32_t frame,uint16_t next_slot, LTE_DL_FRAME_PARMS *frame_parms) { int aa, slot_offset, slot_offset_F; diff --git a/openair1/PHY/MODULATION/slot_fep.c b/openair1/PHY/MODULATION/slot_fep.c index 0d2389c2aecd6f8df13794da5e1f6ec2d8e6b4a6..6a63043e9c1d0d04dad9c2731925edba4c3a916e 100644 --- a/openair1/PHY/MODULATION/slot_fep.c +++ b/openair1/PHY/MODULATION/slot_fep.c @@ -27,7 +27,6 @@ *******************************************************************************/ #include "PHY/defs.h" -#include "MAC_INTERFACE/extern.h" #include "defs.h" //#define DEBUG_FEP @@ -56,7 +55,7 @@ int slot_fep(PHY_VARS_UE *phy_vars_ue, unsigned int rx_offset; void (*dft)(int16_t *,int16_t *, int); - int tmp_dft_in[256]; // This is for misalignment issues for 6 and 15 PRBs + int tmp_dft_in[2048]; // This is for misalignment issues for 6 and 15 PRBs switch (frame_parms->ofdm_symbol_size) { case 128: @@ -115,8 +114,8 @@ int slot_fep(PHY_VARS_UE *phy_vars_ue, memset(&ue_common_vars->rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],0,frame_parms->ofdm_symbol_size*sizeof(int)); rx_offset = sample_offset + slot_offset + nb_prefix_samples0 + subframe_offset - SOFFSET; - // Align with 128 bit - rx_offset = rx_offset - rx_offset % 4; + // Align with 256 bit + // rx_offset = rx_offset&0xfffffff8; #ifdef DEBUG_FEP // if (phy_vars_ue->frame <100) @@ -131,9 +130,9 @@ int slot_fep(PHY_VARS_UE *phy_vars_ue, (short *)&ue_common_vars->rxdata[aa][0], frame_parms->ofdm_symbol_size*sizeof(int)); - if ((rx_offset&3)!=0) { // if input to dft is not 128-bit aligned, issue for size 6 and 15 PRBs + if ((rx_offset&7)!=0) { // if input to dft is not 256-bit aligned, issue for size 6,15 and 25 PRBs memcpy((void *)tmp_dft_in, - (void *)&ue_common_vars->rxdata[aa][(rx_offset-nb_prefix_samples0) % frame_length_samples], + (void *)&ue_common_vars->rxdata[aa][rx_offset % frame_length_samples], frame_parms->ofdm_symbol_size*sizeof(int)); dft((int16_t *)tmp_dft_in, (int16_t *)&ue_common_vars->rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1); @@ -146,8 +145,8 @@ int slot_fep(PHY_VARS_UE *phy_vars_ue, } } else { - rx_offset += (frame_parms->ofdm_symbol_size+nb_prefix_samples) + - (frame_parms->ofdm_symbol_size+nb_prefix_samples)*(l-1); + rx_offset += (frame_parms->ofdm_symbol_size+nb_prefix_samples)*l;// + + // (frame_parms->ofdm_symbol_size+nb_prefix_samples)*(l-1); #ifdef DEBUG_FEP // if (phy_vars_ue->frame <100) @@ -162,7 +161,7 @@ int slot_fep(PHY_VARS_UE *phy_vars_ue, start_meas(&phy_vars_ue->rx_dft_stats); - if ((rx_offset&3)!=0) { // if input to dft is not 128-bit aligned, issue for size 6 and 15 PRBs + if ((rx_offset&7)!=0) { // if input to dft is not 128-bit aligned, issue for size 6 and 15 PRBs memcpy((void *)tmp_dft_in, (void *)&ue_common_vars->rxdata[aa][(rx_offset) % frame_length_samples], frame_parms->ofdm_symbol_size*sizeof(int)); diff --git a/openair1/PHY/MODULATION/slot_fep_mbsfn.c b/openair1/PHY/MODULATION/slot_fep_mbsfn.c index d71a9d04778a5dd60b7b5acac86669512d1e1254..f6ca4aa2f41db203fb69a80f84fbc1bfe68e8343 100644 --- a/openair1/PHY/MODULATION/slot_fep_mbsfn.c +++ b/openair1/PHY/MODULATION/slot_fep_mbsfn.c @@ -27,7 +27,6 @@ *******************************************************************************/ #include "PHY/defs.h" -#include "MAC_INTERFACE/extern.h" #include "defs.h" //#define DEBUG_FEP diff --git a/openair1/PHY/TOOLS/Makefile b/openair1/PHY/TOOLS/Makefile index 908c1b6f14c89b1f388dd033a2b5409e4bf12b0c..eee9d7834426077de14d2b71b80d7011283ce276 100644 --- a/openair1/PHY/TOOLS/Makefile +++ b/openair1/PHY/TOOLS/Makefile @@ -1,8 +1,14 @@ -lte_dfts: lte_dfts.c - gcc -O2 -mavx2 -g -ggdb -o lte_dfts lte_dfts.c time_meas.c file_output.c ../../SIMULATION/TOOLS/taus.c -I$$OPENAIR1_DIR -I$$OPENAIR_TARGETS -I$$OPENAIR2_DIR/COMMON -DUSER_MODE -DMR_MAIN -DNB_ANTENNAS_RX=1 # -DD256STATS #-DD64STATS +lte_dfts_sse4: lte_dfts.c + gcc -O2 -msse4.1 -g -ggdb -o lte_dfts_sse4 lte_dfts.c time_meas.c file_output.c ../../SIMULATION/TOOLS/taus.c -I$$OPENAIR1_DIR -I$$OPENAIR_TARGETS -I$$OPENAIR2_DIR/COMMON -DUSER_MODE -DMR_MAIN -DNB_ANTENNAS_RX=1 # -DD256STATS #-DD64STATS -lte_dfts.s: lte_dfts.c +lte_dfts_avx2: lte_dfts.c + gcc -O2 -mavx2 -g -ggdb -o lte_dfts_avx2 lte_dfts.c time_meas.c file_output.c ../../SIMULATION/TOOLS/taus.c -I$$OPENAIR1_DIR -I$$OPENAIR_TARGETS -I$$OPENAIR2_DIR/COMMON -DUSER_MODE -DMR_MAIN -DNB_ANTENNAS_RX=1 # -DD256STATS #-DD64STATS + +lte_dfts_avx2.s: lte_dfts.c gcc -O2 -mavx2 -S lte_dfts.c time_meas.c file_output.c ../../SIMULATION/TOOLS/taus.c -I$$OPENAIR1_DIR -I$$OPENAIR_TARGETS -I$$OPENAIR2_DIR/COMMON -DUSER_MODE -DMR_MAIN -DNB_ANTENNAS_RX=1 # -DD256STATS #-DD64STATS -dft_cycles: lte_dfts - ./lte_dfts | egrep cycles +lte_dfts_sse4.s: lte_dfts.c + gcc -O2 -msse4.1 -S lte_dfts.c time_meas.c file_output.c ../../SIMULATION/TOOLS/taus.c -I$$OPENAIR1_DIR -I$$OPENAIR_TARGETS -I$$OPENAIR2_DIR/COMMON -DUSER_MODE -DMR_MAIN -DNB_ANTENNAS_RX=1 # -DD256STATS #-DD64STATS + +dft_cycles_avx2: lte_dfts_avx2 + ./lte_dfts_avx2 | egrep cycles diff --git a/openair1/PHY/TOOLS/defs.h b/openair1/PHY/TOOLS/defs.h index 963c1384b7f14321210168527146eb7e9f41a126..8d30a7ea1004004505afb44bd589c9130626c0bb 100644 --- a/openair1/PHY/TOOLS/defs.h +++ b/openair1/PHY/TOOLS/defs.h @@ -156,7 +156,7 @@ This function performs optimized fixed-point radix-2 FFT/IFFT. ); */ -void idft1536(int16_t *sigF,int16_t *sig); +void idft1536(int16_t *sigF,int16_t *sig,int scale); void idft6144(int16_t *sigF,int16_t *sig); @@ -168,7 +168,7 @@ void idft3072(int16_t *sigF,int16_t *sig); void idft24576(int16_t *sigF,int16_t *sig); -void dft1536(int16_t *sigF,int16_t *sig); +void dft1536(int16_t *sigF,int16_t *sig,int scale); void dft6144(int16_t *sigF,int16_t *sig); diff --git a/openair1/PHY/TOOLS/lte_dfts.c b/openair1/PHY/TOOLS/lte_dfts.c index b010f93aabeebb614535686ee1ca350a89d0eb4b..1bdcb3ad6022605bcf88564e87044d08e6664f52 100644 --- a/openair1/PHY/TOOLS/lte_dfts.c +++ b/openair1/PHY/TOOLS/lte_dfts.c @@ -5,7 +5,7 @@ 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. + (at your option) any lat_er version. OpenAirInterface is distributed in the hope that it will be useful, @@ -53,15 +53,15 @@ #include "PHY/sse_intrin.h" #define print_shorts(s,x) printf("%s %d,%d,%d,%d,%d,%d,%d,%d\n",s,(x)[0],(x)[1],(x)[2],(x)[3],(x)[4],(x)[5],(x)[6],(x)[7]) +#define print_shorts256(s,x) printf("%s %d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d\n",s,(x)[0],(x)[1],(x)[2],(x)[3],(x)[4],(x)[5],(x)[6],(x)[7],(x)[8],(x)[9],(x)[10],(x)[11],(x)[12],(x)[13],(x)[14],(x)[15]) + #define print_ints(s,x) printf("%s %d %d %d %d\n",s,(x)[0],(x)[1],(x)[2],(x)[3]) -#ifdef AVX2 -static int16_t conjugatedft2[16] __attribute__((aligned(32))) = {1,1,1,1,1,1,1,1,-1,1,-1,1,-1,1,-1,1,-1,1}; -#endif -static int16_t conjugatedft[8] __attribute__((aligned(16))) = {-1,1,-1,1,-1,1,-1,1} ; +static int16_t conjugatedft[32] __attribute__((aligned(32))) = {-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1}; -static short reflip[8] __attribute__((aligned(16))) = {1,-1,1,-1,1,-1,1,-1}; + +static int16_t reflip[32] __attribute__((aligned(32))) = {1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1}; #if defined(__x86_64__) || defined(__i386__) static inline void cmac(__m128i a,__m128i b, __m128i *re32, __m128i *im32) __attribute__((always_inline)); @@ -103,8 +103,43 @@ static inline void cmacc(__m128i a,__m128i b, __m128i *re32, __m128i *im32) *im32 = _mm_add_epi32(*im32,cmac_tmp_im32); } +#ifdef __AVX2__ +static inline void cmac_256(__m256i a,__m256i b, __m256i *re32, __m256i *im32) __attribute__((always_inline)); +static inline void cmac_256(__m256i a,__m256i b, __m256i *re32, __m256i *im32) +{ + + __m256i cmac_tmp,cmac_tmp_re32,cmac_tmp_im32; + __m256i imshuffle = _mm256_set_epi8(29,28,31,30,25,24,27,26,21,20,19,18,17,16,19,18,13,12,15,14,9,8,11,10,5,4,7,6,1,0,3,2); + + cmac_tmp = _mm256_sign_epi16(b,*(__m256i*)reflip); + cmac_tmp_re32 = _mm256_madd_epi16(a,cmac_tmp); + + cmac_tmp = _mm256_shuffle_epi8(b,imshuffle); + cmac_tmp_im32 = _mm256_madd_epi16(cmac_tmp,a); + + *re32 = _mm256_add_epi32(*re32,cmac_tmp_re32); + *im32 = _mm256_add_epi32(*im32,cmac_tmp_im32); +} + +static inline void cmacc_256(__m256i a,__m256i b, __m256i *re32, __m256i *im32) __attribute__((always_inline)); +static inline void cmacc_256(__m256i a,__m256i b, __m256i *re32, __m256i *im32) +{ + + __m256i cmac_tmp,cmac_tmp_re32,cmac_tmp_im32; + __m256i imshuffle = _mm256_set_epi8(29,28,31,30,25,24,27,26,21,20,19,18,17,16,19,18,13,12,15,14,9,8,11,10,5,4,7,6,1,0,3,2); + cmac_tmp_re32 = _mm256_madd_epi16(a,b); + + + cmac_tmp = _mm256_sign_epi16(b,*(__m256i*)reflip); + cmac_tmp = _mm256_shuffle_epi8(b,imshuffle); + cmac_tmp_im32 = _mm256_madd_epi16(cmac_tmp,a); + + *re32 = _mm256_add_epi32(*re32,cmac_tmp_re32); + *im32 = _mm256_add_epi32(*im32,cmac_tmp_im32); +} +#endif static inline void cmult(__m128i a,__m128i b, __m128i *re32, __m128i *im32) __attribute__((always_inline)); @@ -122,6 +157,24 @@ static inline void cmult(__m128i a,__m128i b, __m128i *re32, __m128i *im32) } +#ifdef __AVX2__ +static inline void cmult_256(__m256i a,__m256i b, __m256i *re32, __m256i *im32) __attribute__((always_inline)); + +static inline void cmult_256(__m256i a,__m256i b, __m256i *re32, __m256i *im32) +{ + + register __m256i mmtmpb; + __m256i const perm_mask = _mm256_set_epi8(29,28,31,30,25,24,27,26,21,20,23,22,17,16,19,18,13,12,15,14,9,8,11,10,5,4,7,6,1,0,3,2); + + mmtmpb = _mm256_sign_epi16(b,*(__m256i*)reflip); + *re32 = _mm256_madd_epi16(a,mmtmpb); + mmtmpb = _mm256_shuffle_epi8(b,perm_mask); + *im32 = _mm256_madd_epi16(a,mmtmpb); + +} + +#endif + static inline void cmultc(__m128i a,__m128i b, __m128i *re32, __m128i *im32) __attribute__((always_inline)); static inline void cmultc(__m128i a,__m128i b, __m128i *re32, __m128i *im32) @@ -136,6 +189,23 @@ static inline void cmultc(__m128i a,__m128i b, __m128i *re32, __m128i *im32) } +#ifdef __AVX2__ +static inline void cmultc_256(__m256i a,__m256i b, __m256i *re32, __m256i *im32) __attribute__((always_inline)); + +static inline void cmultc_256(__m256i a,__m256i b, __m256i *re32, __m256i *im32) +{ + + register __m256i mmtmpb; + __m256i const perm_mask = _mm256_set_epi8(29,28,31,30,25,24,27,26,21,20,23,22,17,16,19,18,13,12,15,14,9,8,11,10,5,4,7,6,1,0,3,2); + + *re32 = _mm256_madd_epi16(a,b); + mmtmpb = _mm256_sign_epi16(b,*(__m256i*)reflip); + mmtmpb = _mm256_shuffle_epi8(mmtmpb,perm_mask); + *im32 = _mm256_madd_epi16(a,mmtmpb); + +} + +#endif static inline __m128i cpack(__m128i xre,__m128i xim) __attribute__((always_inline)); @@ -150,6 +220,21 @@ static inline __m128i cpack(__m128i xre,__m128i xim) } +#ifdef __AVX2__ +static inline __m256i cpack_256(__m256i xre,__m256i xim) __attribute__((always_inline)); + +static inline __m256i cpack_256(__m256i xre,__m256i xim) +{ + + register __m256i cpack_tmp1,cpack_tmp2; + + cpack_tmp1 = _mm256_unpacklo_epi32(xre,xim); + cpack_tmp2 = _mm256_unpackhi_epi32(xre,xim); + return(_mm256_packs_epi32(_mm256_srai_epi32(cpack_tmp1,15),_mm256_srai_epi32(cpack_tmp2,15))); + +} + +#endif static inline void packed_cmult(__m128i a,__m128i b, __m128i *c) __attribute__((always_inline)); @@ -162,6 +247,18 @@ static inline void packed_cmult(__m128i a,__m128i b, __m128i *c) } +#ifdef __AVX2__ +static inline void packed_cmult_256(__m256i a,__m256i b, __m256i *c) __attribute__((always_inline)); + +static inline void packed_cmult_256(__m256i a,__m256i b, __m256i *c) +{ + + __m256i cre,cim; + cmult_256(a,b,&cre,&cim); + *c = cpack_256(cre,cim); + +} +#endif static inline void packed_cmultc(__m128i a,__m128i b, __m128i *c) __attribute__((always_inline)); @@ -175,6 +272,20 @@ static inline void packed_cmultc(__m128i a,__m128i b, __m128i *c) } +#ifdef __AVX2__ +static inline void packed_cmultc_256(__m256i a,__m256i b, __m256i *c) __attribute__((always_inline)); + +static inline void packed_cmultc_256(__m256i a,__m256i b, __m256i *c) +{ + + __m256i cre,cim; + + cmultc_256(a,b,&cre,&cim); + *c = cpack_256(cre,cim); + +} +#endif + static inline __m128i packed_cmult2(__m128i a,__m128i b,__m128i b2) __attribute__((always_inline)); static inline __m128i packed_cmult2(__m128i a,__m128i b,__m128i b2) @@ -190,6 +301,23 @@ static inline __m128i packed_cmult2(__m128i a,__m128i b,__m128i b2) } +#ifdef __AVX2__ +static inline __m256i packed_cmult2_256(__m256i a,__m256i b,__m256i b2) __attribute__((always_inline)); + +static inline __m256i packed_cmult2_256(__m256i a,__m256i b,__m256i b2) +{ + + + register __m256i cre,cim; + + cre = _mm256_madd_epi16(a,b); + cim = _mm256_madd_epi16(a,b2); + + return(cpack_256(cre,cim)); + +} +#endif + #elif defined (__arm__) static inline void cmac(int16x8_t a,int16x8_t b, int32x4_t *re32, int32x4_t *im32) __attribute__((always_inline)); static inline void cmac(int16x8_t a,int16x8_t b, int32x4_t *re32, int32x4_t *im32) @@ -346,15 +474,15 @@ static inline int16x8_t packed_cmult2(int16x8_t a,int16x8_t b, int16x8_t b2) #endif -static int16_t W0s[8]__attribute__((aligned(16))) = {32767,0,32767,0,32767,0,32767,0}; +static int16_t W0s[16]__attribute__((aligned(32))) = {32767,0,32767,0,32767,0,32767,0,32767,0,32767,0,32767,0,32767,0}; -static int16_t W13s[8]__attribute__((aligned(16))) = {-16384,-28378,-16384,-28378,-16384,-28378,-16384,-28378}; -static int16_t W23s[8]__attribute__((aligned(16))) = {-16384,28378,-16384,28378,-16384,28378,-16384,28378}; +static int16_t W13s[16]__attribute__((aligned(32))) = {-16384,-28378,-16384,-28378,-16384,-28378,-16384,-28378,-16384,-28378,-16384,-28378,-16384,-28378,-16384,-28378}; +static int16_t W23s[16]__attribute__((aligned(32))) = {-16384,28378,-16384,28378,-16384,28378,-16384,28378,-16384,28378,-16384,28378,-16384,28378,-16384,28378}; -static int16_t W15s[8]__attribute__((aligned(16))) = {10126,-31163,10126,-31163,10126,-31163,10126,-31163}; -static int16_t W25s[8]__attribute__((aligned(16))) = {-26509,-19260,-26509,-19260,-26509,-19260,-26509,-19260}; -static int16_t W35s[8]__attribute__((aligned(16))) = {-26510,19260,-26510,19260,-26510,19260,-26510,19260}; -static int16_t W45s[8]__attribute__((aligned(16))) = {10126,31163,10126,31163,10126,31163,10126,31163}; +static int16_t W15s[16]__attribute__((aligned(32))) = {10126,-31163,10126,-31163,10126,-31163,10126,-31163,10126,-31163,10126,-31163,10126,-31163,10126,-31163}; +static int16_t W25s[16]__attribute__((aligned(32))) = {-26509,-19260,-26509,-19260,-26509,-19260,-26509,-19260,-26509,-19260,-26509,-19260,-26509,-19260,-26509,-19260}; +static int16_t W35s[16]__attribute__((aligned(32))) = {-26510,19260,-26510,19260,-26510,19260,-26510,19260,-26510,19260,-26510,19260,-26510,19260,-26510,19260}; +static int16_t W45s[16]__attribute__((aligned(32))) = {10126,31163,10126,31163,10126,31163,10126,31163,10126,31163,10126,31163,10126,31163,10126,31163}; #if defined(__x86_64__) || defined(__i386__) __m128i *W0 = (__m128i *)W0s; @@ -364,6 +492,17 @@ __m128i *W15 = (__m128i *)W15s; __m128i *W25 = (__m128i *)W25s; __m128i *W35 = (__m128i *)W35s; __m128i *W45 = (__m128i *)W45s; + +#ifdef __AVX2__ +__m256i *W0_256 = (__m256i *)W0s; +__m256i *W13_256 = (__m256i *)W13s; +__m256i *W23_256 = (__m256i *)W23s; +__m256i *W15_256 = (__m256i *)W15s; +__m256i *W25_256 = (__m256i *)W25s; +__m256i *W35_256 = (__m256i *)W35s; +__m256i *W45_256 = (__m256i *)W45s; +#endif + #elif defined(__arm__) int16x8_t *W0 = (int16x8_t *)W0s; int16x8_t *W13 = (int16x8_t *)W13s; @@ -376,7 +515,7 @@ int16x8_t *W45 = (int16x8_t *)W45s; static int16_t dft_norm_table[16] = {9459, //12 6689,//24 5461,//36 - 4729,//48 + 4729,//482 4230,//60 23170,//72 3344,//96 @@ -419,6 +558,36 @@ static inline void bfly2(__m128i *x0, __m128i *x1,__m128i *y0, __m128i *y1,__m12 *y1 = _mm_packs_epi32(bfly2_tmp1,bfly2_tmp2); } +#ifdef __AVX2__ + +static inline void bfly2_256(__m256i *x0, __m256i *x1,__m256i *y0, __m256i *y1,__m256i *tw)__attribute__((always_inline)); + +static inline void bfly2_256(__m256i *x0, __m256i *x1,__m256i *y0, __m256i *y1,__m256i *tw) +{ + + __m256i x0r_2,x0i_2,x1r_2,x1i_2,dy0r,dy1r,dy0i,dy1i; + __m256i bfly2_tmp1,bfly2_tmp2; + + cmult_256(*(x0),*(W0_256),&x0r_2,&x0i_2); + cmult_256(*(x1),*(tw),&x1r_2,&x1i_2); + + dy0r = _mm256_srai_epi32(_mm256_add_epi32(x0r_2,x1r_2),15); + dy1r = _mm256_srai_epi32(_mm256_sub_epi32(x0r_2,x1r_2),15); + dy0i = _mm256_srai_epi32(_mm256_add_epi32(x0i_2,x1i_2),15); + // printf("y0i %d\n",((int16_t *)y0i)[0]); + dy1i = _mm256_srai_epi32(_mm256_sub_epi32(x0i_2,x1i_2),15); + + bfly2_tmp1 = _mm256_unpacklo_epi32(dy0r,dy0i); + bfly2_tmp2 = _mm256_unpackhi_epi32(dy0r,dy0i); + *y0 = _mm256_packs_epi32(bfly2_tmp1,bfly2_tmp2); + + bfly2_tmp1 = _mm256_unpacklo_epi32(dy1r,dy1i); + bfly2_tmp2 = _mm256_unpackhi_epi32(dy1r,dy1i); + *y1 = _mm256_packs_epi32(bfly2_tmp1,bfly2_tmp2); +} + +#endif + #elif defined(__arm__) static inline void bfly2(int16x8_t *x0, int16x8_t *x1,int16x8_t *y0, int16x8_t *y1,int16x8_t *tw)__attribute__((always_inline)); @@ -466,21 +635,56 @@ static inline void bfly2_tw1(int16x8_t *x0, int16x8_t *x1, int16x8_t *y0, int16x } #endif - + #if defined(__x86_64__) || defined(__i386__) + + + static inline void bfly2_16(__m128i *x0, __m128i *x1, __m128i *y0, __m128i *y1, __m128i *tw, __m128i *twb)__attribute__((always_inline)); static inline void bfly2_16(__m128i *x0, __m128i *x1, __m128i *y0, __m128i *y1, __m128i *tw, __m128i *twb) { - register __m128i x1t; + // register __m128i x1t; + __m128i x1t; x1t = packed_cmult2(*(x1),*(tw),*(twb)); - + /* + print_shorts("x0",(int16_t*)x0); + print_shorts("x1",(int16_t*)x1); + print_shorts("tw",(int16_t*)tw); + print_shorts("twb",(int16_t*)twb); + print_shorts("x1t",(int16_t*)&x1t);*/ *y0 = _mm_adds_epi16(*x0,x1t); *y1 = _mm_subs_epi16(*x0,x1t); + /* print_shorts("y0",(int16_t*)y0); + print_shorts("y1",(int16_t*)y1);*/ +} + +#ifdef __AVX2__ + +static inline void bfly2_16_256(__m256i *x0, __m256i *x1, __m256i *y0, __m256i *y1, __m256i *tw, __m256i *twb)__attribute__((always_inline)); +static inline void bfly2_16_256(__m256i *x0, __m256i *x1, __m256i *y0, __m256i *y1, __m256i *tw, __m256i *twb) +{ + + // register __m256i x1t; + __m256i x1t; + + x1t = packed_cmult2_256(*(x1),*(tw),*(twb)); + /* + print_shorts256("x0",(int16_t*)x0); + print_shorts256("x1",(int16_t*)x1); + print_shorts256("tw",(int16_t*)tw); + print_shorts256("twb",(int16_t*)twb); + print_shorts256("x1t",(int16_t*)&x1t);*/ + *y0 = _mm256_adds_epi16(*x0,x1t); + *y1 = _mm256_subs_epi16(*x0,x1t); + + /*print_shorts256("y0",(int16_t*)y0); + print_shorts256("y1",(int16_t*)y1);*/ } +#endif #elif defined(__arm__) @@ -490,15 +694,10 @@ static inline void bfly2_16(int16x8_t *x0, int16x8_t *x1, int16x8_t *y0, int16x8 static inline void bfly2_16(int16x8_t *x0, int16x8_t *x1, int16x8_t *y0, int16x8_t *y1, int16x8_t *tw, int16x8_t *twb) { - register int16x8_t x1t; - - x1t = packed_cmult2(*(x1),*(tw),*(twb)); - - *y0 = vqaddq_s16(*x0,x1t); - *y1 = vqsubq_s16(*x0,x1t); + *y0 = vqaddq_s16(*x0,*x1); + *y1 = vqsubq_s16(*x0,*x1); } - #endif #if defined(__x86_64__) || defined(__i386__) @@ -527,6 +726,35 @@ static inline void ibfly2(__m128i *x0, __m128i *x1,__m128i *y0, __m128i *y1,__m1 bfly2_tmp2 = _mm_unpackhi_epi32(dy1r,dy1i); *y1 = _mm_packs_epi32(bfly2_tmp1,bfly2_tmp2); } + +#ifdef __AVX2__ +static inline void ibfly2_256(__m256i *x0, __m256i *x1,__m256i *y0, __m256i *y1,__m256i *tw)__attribute__((always_inline)); + +static inline void ibfly2_256(__m256i *x0, __m256i *x1,__m256i *y0, __m256i *y1,__m256i *tw) +{ + + __m256i x0r_2,x0i_2,x1r_2,x1i_2,dy0r,dy1r,dy0i,dy1i; + __m256i bfly2_tmp1,bfly2_tmp2; + + cmultc_256(*(x0),*(W0_256),&x0r_2,&x0i_2); + cmultc_256(*(x1),*(tw),&x1r_2,&x1i_2); + + dy0r = _mm256_srai_epi32(_mm256_add_epi32(x0r_2,x1r_2),15); + dy1r = _mm256_srai_epi32(_mm256_sub_epi32(x0r_2,x1r_2),15); + dy0i = _mm256_srai_epi32(_mm256_add_epi32(x0i_2,x1i_2),15); + // printf("y0i %d\n",((int16_t *)y0i)[0]); + dy1i = _mm256_srai_epi32(_mm256_sub_epi32(x0i_2,x1i_2),15); + + bfly2_tmp1 = _mm256_unpacklo_epi32(dy0r,dy0i); + bfly2_tmp2 = _mm256_unpackhi_epi32(dy0r,dy0i); + *y0 = _mm256_packs_epi32(bfly2_tmp1,bfly2_tmp2); + + bfly2_tmp1 = _mm256_unpacklo_epi32(dy1r,dy1i); + bfly2_tmp2 = _mm256_unpackhi_epi32(dy1r,dy1i); + *y1 = _mm256_packs_epi32(bfly2_tmp1,bfly2_tmp2); +} +#endif + #elif defined(__arm__) static inline void ibfly2(int16x8_t *x0, int16x8_t *x1,int16x8_t *y0, int16x8_t *y1,int16x8_t *tw) { @@ -579,6 +807,33 @@ static inline void bfly3(__m128i *x0,__m128i *x1,__m128i *x2, *(y2) = _mm_adds_epi16(*(x0),*(y2)); } +#ifdef __AVX2__ + +static inline void bfly3_256(__m256i *x0,__m256i *x1,__m256i *x2, + __m256i *y0,__m256i *y1,__m256i *y2, + __m256i *tw1,__m256i *tw2) __attribute__((always_inline)); + +static inline void bfly3_256(__m256i *x0,__m256i *x1,__m256i *x2, + __m256i *y0,__m256i *y1,__m256i *y2, + __m256i *tw1,__m256i *tw2) +{ + + __m256i tmpre,tmpim,x1_2,x2_2; + + packed_cmult_256(*(x1),*(tw1),&x1_2); + packed_cmult_256(*(x2),*(tw2),&x2_2); + *(y0) = _mm256_adds_epi16(*(x0),_mm256_adds_epi16(x1_2,x2_2)); + cmult_256(x1_2,*(W13_256),&tmpre,&tmpim); + cmac_256(x2_2,*(W23_256),&tmpre,&tmpim); + *(y1) = cpack_256(tmpre,tmpim); + *(y1) = _mm256_adds_epi16(*(x0),*(y1)); + cmult_256(x1_2,*(W23_256),&tmpre,&tmpim); + cmac_256(x2_2,*(W13_256),&tmpre,&tmpim); + *(y2) = cpack_256(tmpre,tmpim); + *(y2) = _mm256_adds_epi16(*(x0),*(y2)); +} +#endif + #elif defined(__arm__) static inline void bfly3(int16x8_t *x0,int16x8_t *x1,int16x8_t *x2, int16x8_t *y0,int16x8_t *y1,int16x8_t *y2, @@ -632,6 +887,33 @@ static inline void ibfly3(__m128i *x0,__m128i *x1,__m128i *x2, *(y2) = _mm_adds_epi16(*(x0),*(y2)); } +#ifdef __AVX2__ + +static inline void ibfly3_256(__m256i *x0,__m256i *x1,__m256i *x2, + __m256i *y0,__m256i *y1,__m256i *y2, + __m256i *tw1,__m256i *tw2) __attribute__((always_inline)); + +static inline void ibfly3_256(__m256i *x0,__m256i *x1,__m256i *x2, + __m256i *y0,__m256i *y1,__m256i *y2, + __m256i *tw1,__m256i *tw2) +{ + + __m256i tmpre,tmpim,x1_2,x2_2; + + packed_cmultc_256(*(x1),*(tw1),&x1_2); + packed_cmultc_256(*(x2),*(tw2),&x2_2); + *(y0) = _mm256_adds_epi16(*(x0),_mm256_adds_epi16(x1_2,x2_2)); + cmultc_256(x1_2,*(W13_256),&tmpre,&tmpim); + cmacc_256(x2_2,*(W23_256),&tmpre,&tmpim); + *(y1) = cpack_256(tmpre,tmpim); + *(y1) = _mm256_adds_epi16(*(x0),*(y1)); + cmultc_256(x1_2,*(W23_256),&tmpre,&tmpim); + cmacc_256(x2_2,*(W13_256),&tmpre,&tmpim); + *(y2) = cpack_256(tmpre,tmpim); + *(y2) = _mm256_adds_epi16(*(x0),*(y2)); +} +#endif + #elif defined(__arm__) static inline void ibfly3(int16x8_t *x0,int16x8_t *x1,int16x8_t *x2, int16x8_t *y0,int16x8_t *y1,int16x8_t *y2, @@ -679,6 +961,30 @@ static inline void bfly3_tw1(__m128i *x0,__m128i *x1,__m128i *x2, *(y2) = cpack(tmpre,tmpim); *(y2) = _mm_adds_epi16(*(x0),*(y2)); } + +#ifdef __AVX2__ + +static inline void bfly3_tw1_256(__m256i *x0,__m256i *x1,__m256i *x2, + __m256i *y0,__m256i *y1,__m256i *y2) __attribute__((always_inline)); + +static inline void bfly3_tw1_256(__m256i *x0,__m256i *x1,__m256i *x2, + __m256i *y0,__m256i *y1,__m256i *y2) +{ + + __m256i tmpre,tmpim; + + *(y0) = _mm256_adds_epi16(*(x0),_mm256_adds_epi16(*(x1),*(x2))); + cmult_256(*(x1),*(W13_256),&tmpre,&tmpim); + cmac_256(*(x2),*(W23_256),&tmpre,&tmpim); + *(y1) = cpack_256(tmpre,tmpim); + *(y1) = _mm256_adds_epi16(*(x0),*(y1)); + cmult_256(*(x1),*(W23_256),&tmpre,&tmpim); + cmac_256(*(x2),*(W13_256),&tmpre,&tmpim); + *(y2) = cpack_256(tmpre,tmpim); + *(y2) = _mm256_adds_epi16(*(x0),*(y2)); +} +#endif + #elif defined(__arm__) static inline void bfly3_tw1(int16x8_t *x0,int16x8_t *x1,int16x8_t *x2, int16x8_t *y0,int16x8_t *y1,int16x8_t *y2) __attribute__((always_inline)); @@ -745,6 +1051,48 @@ static inline void bfly4(__m128i *x0,__m128i *x1,__m128i *x2,__m128i *x3, *(y3) = _mm_add_epi16(*(x0),cpack(dy3r,dy3i)); } +#ifdef __AVX2__ +static inline void bfly4_256(__m256i *x0,__m256i *x1,__m256i *x2,__m256i *x3, + __m256i *y0,__m256i *y1,__m256i *y2,__m256i *y3, + __m256i *tw1,__m256i *tw2,__m256i *tw3)__attribute__((always_inline)); + +static inline void bfly4_256(__m256i *x0,__m256i *x1,__m256i *x2,__m256i *x3, + __m256i *y0,__m256i *y1,__m256i *y2,__m256i *y3, + __m256i *tw1,__m256i *tw2,__m256i *tw3) +{ + + __m256i x1r_2,x1i_2,x2r_2,x2i_2,x3r_2,x3i_2,dy0r,dy0i,dy1r,dy1i,dy2r,dy2i,dy3r,dy3i; + + // cmult(*(x0),*(W0),&x0r_2,&x0i_2); + cmult_256(*(x1),*(tw1),&x1r_2,&x1i_2); + cmult_256(*(x2),*(tw2),&x2r_2,&x2i_2); + cmult_256(*(x3),*(tw3),&x3r_2,&x3i_2); + // dy0r = _mm_add_epi32(x0r_2,_mm_add_epi32(x1r_2,_mm_add_epi32(x2r_2,x3r_2))); + // dy0i = _mm_add_epi32(x0i_2,_mm_add_epi32(x1i_2,_mm_add_epi32(x2i_2,x3i_2))); + // *(y0) = cpack(dy0r,dy0i); + dy0r = _mm256_add_epi32(x1r_2,_mm256_add_epi32(x2r_2,x3r_2)); + dy0i = _mm256_add_epi32(x1i_2,_mm256_add_epi32(x2i_2,x3i_2)); + *(y0) = _mm256_add_epi16(*(x0),cpack_256(dy0r,dy0i)); + // dy1r = _mm_add_epi32(x0r_2,_mm_sub_epi32(x1i_2,_mm_add_epi32(x2r_2,x3i_2))); + // dy1i = _mm_sub_epi32(x0i_2,_mm_add_epi32(x1r_2,_mm_sub_epi32(x2i_2,x3r_2))); + // *(y1) = cpack(dy1r,dy1i); + dy1r = _mm256_sub_epi32(x1i_2,_mm256_add_epi32(x2r_2,x3i_2)); + dy1i = _mm256_sub_epi32(_mm256_sub_epi32(x3r_2,x2i_2),x1r_2); + *(y1) = _mm256_add_epi16(*(x0),cpack_256(dy1r,dy1i)); + // dy2r = _mm_sub_epi32(x0r_2,_mm_sub_epi32(x1r_2,_mm_sub_epi32(x2r_2,x3r_2))); + // dy2i = _mm_sub_epi32(x0i_2,_mm_sub_epi32(x1i_2,_mm_sub_epi32(x2i_2,x3i_2))); + // *(y2) = cpack(dy2r,dy2i); + dy2r = _mm256_sub_epi32(_mm256_sub_epi32(x2r_2,x3r_2),x1r_2); + dy2i = _mm256_sub_epi32(_mm256_sub_epi32(x2i_2,x3i_2),x1i_2); + *(y2) = _mm256_add_epi16(*(x0),cpack_256(dy2r,dy2i)); + // dy3r = _mm_sub_epi32(x0r_2,_mm_add_epi32(x1i_2,_mm_sub_epi32(x2r_2,x3i_2))); + // dy3i = _mm_add_epi32(x0i_2,_mm_sub_epi32(x1r_2,_mm_add_epi32(x2i_2,x3r_2))); + // *(y3) = cpack(dy3r,dy3i); + dy3r = _mm256_sub_epi32(_mm256_sub_epi32(x3i_2,x2r_2),x1i_2); + dy3i = _mm256_sub_epi32(x1r_2,_mm256_add_epi32(x2i_2,x3r_2)); + *(y3) = _mm256_add_epi16(*(x0),cpack_256(dy3r,dy3i)); +} +#endif #elif defined(__arm__) static inline void bfly4(int16x8_t *x0,int16x8_t *x1,int16x8_t *x2,int16x8_t *x3, int16x8_t *y0,int16x8_t *y1,int16x8_t *y2,int16x8_t *y3, @@ -820,6 +1168,39 @@ static inline void ibfly4(__m128i *x0,__m128i *x1,__m128i *x2,__m128i *x3, *(y1) = _mm_add_epi16(*(x0),cpack(dy1r,dy1i)); } +#ifdef __AVX2__ + +static inline void ibfly4_256(__m256i *x0,__m256i *x1,__m256i *x2,__m256i *x3, + __m256i *y0,__m256i *y1,__m256i *y2,__m256i *y3, + __m256i *tw1,__m256i *tw2,__m256i *tw3)__attribute__((always_inline)); + +static inline void ibfly4_256(__m256i *x0,__m256i *x1,__m256i *x2,__m256i *x3, + __m256i *y0,__m256i *y1,__m256i *y2,__m256i *y3, + __m256i *tw1,__m256i *tw2,__m256i *tw3) +{ + + __m256i x1r_2,x1i_2,x2r_2,x2i_2,x3r_2,x3i_2,dy0r,dy0i,dy1r,dy1i,dy2r,dy2i,dy3r,dy3i; + + + cmultc_256(*(x1),*(tw1),&x1r_2,&x1i_2); + cmultc_256(*(x2),*(tw2),&x2r_2,&x2i_2); + cmultc_256(*(x3),*(tw3),&x3r_2,&x3i_2); + + dy0r = _mm256_add_epi32(x1r_2,_mm256_add_epi32(x2r_2,x3r_2)); + dy0i = _mm256_add_epi32(x1i_2,_mm256_add_epi32(x2i_2,x3i_2)); + *(y0) = _mm256_add_epi16(*(x0),cpack_256(dy0r,dy0i)); + dy3r = _mm256_sub_epi32(x1i_2,_mm256_add_epi32(x2r_2,x3i_2)); + dy3i = _mm256_sub_epi32(_mm256_sub_epi32(x3r_2,x2i_2),x1r_2); + *(y3) = _mm256_add_epi16(*(x0),cpack_256(dy3r,dy3i)); + dy2r = _mm256_sub_epi32(_mm256_sub_epi32(x2r_2,x3r_2),x1r_2); + dy2i = _mm256_sub_epi32(_mm256_sub_epi32(x2i_2,x3i_2),x1i_2); + *(y2) = _mm256_add_epi16(*(x0),cpack_256(dy2r,dy2i)); + dy1r = _mm256_sub_epi32(_mm256_sub_epi32(x3i_2,x2r_2),x1i_2); + dy1i = _mm256_sub_epi32(x1r_2,_mm256_add_epi32(x2i_2,x3r_2)); + *(y1) = _mm256_add_epi16(*(x0),cpack_256(dy1r,dy1i)); +} + +#endif #elif defined(__arm__) static inline void ibfly4(int16x8_t *x0,int16x8_t *x1,int16x8_t *x2,int16x8_t *x3, @@ -890,6 +1271,32 @@ static inline void bfly4_tw1(__m128i *x0,__m128i *x1,__m128i *x2,__m128i *x3, */ } +#ifdef __AVX2__ + +static inline void bfly4_tw1_256(__m256i *x0,__m256i *x1,__m256i *x2,__m256i *x3, + __m256i *y0,__m256i *y1,__m256i *y2,__m256i *y3)__attribute__((always_inline)); + +static inline void bfly4_tw1_256(__m256i *x0,__m256i *x1,__m256i *x2,__m256i *x3, + __m256i *y0,__m256i *y1,__m256i *y2,__m256i *y3) +{ + register __m256i x1_flip,x3_flip,x02t,x13t; + register __m256i complex_shuffle = _mm256_set_epi8(29,28,31,30,25,24,27,26,21,20,23,22,17,16,19,18,13,12,15,14,9,8,11,10,5,4,7,6,1,0,3,2); + + x02t = _mm256_adds_epi16(*(x0),*(x2)); + x13t = _mm256_adds_epi16(*(x1),*(x3)); + *(y0) = _mm256_adds_epi16(x02t,x13t); + *(y2) = _mm256_subs_epi16(x02t,x13t); + x1_flip = _mm256_sign_epi16(*(x1),*(__m256i*)conjugatedft); + x1_flip = _mm256_shuffle_epi8(x1_flip,complex_shuffle); + x3_flip = _mm256_sign_epi16(*(x3),*(__m256i*)conjugatedft); + x3_flip = _mm256_shuffle_epi8(x3_flip,complex_shuffle); + x02t = _mm256_subs_epi16(*(x0),*(x2)); + x13t = _mm256_subs_epi16(x1_flip,x3_flip); + *(y1) = _mm256_adds_epi16(x02t,x13t); // x0 + x1f - x2 - x3f + *(y3) = _mm256_subs_epi16(x02t,x13t); // x0 - x1f - x2 + x3f +} +#endif + #elif defined(__arm__) static inline void bfly4_tw1(int16x8_t *x0,int16x8_t *x1,int16x8_t *x2,int16x8_t *x3, @@ -1007,6 +1414,48 @@ static inline void bfly4_16(__m128i *x0,__m128i *x1,__m128i *x2,__m128i *x3, } +#ifdef __AVX2__ +static inline void bfly4_16_256(__m256i *x0,__m256i *x1,__m256i *x2,__m256i *x3, + __m256i *y0,__m256i *y1,__m256i *y2,__m256i *y3, + __m256i *tw1,__m256i *tw2,__m256i *tw3, + __m256i *tw1b,__m256i *tw2b,__m256i *tw3b)__attribute__((always_inline)); + +static inline void bfly4_16_256(__m256i *x0,__m256i *x1,__m256i *x2,__m256i *x3, + __m256i *y0,__m256i *y1,__m256i *y2,__m256i *y3, + __m256i *tw1,__m256i *tw2,__m256i *tw3, + __m256i *tw1b,__m256i *tw2b,__m256i *tw3b) +{ + + register __m256i x1t,x2t,x3t,x02t,x13t; + register __m256i x1_flip,x3_flip; + register __m256i complex_shuffle = _mm256_set_epi8(29,28,31,30,25,24,27,26,21,20,23,22,17,16,19,18,13,12,15,14,9,8,11,10,5,4,7,6,1,0,3,2); + + // each input xi is assumed to be to consecutive vectors xi0 xi1 on which to perform the 8 butterflies + // [xi00 xi01 xi02 xi03 xi10 xi20 xi30 xi40] + // each output yi is the same + + x1t = packed_cmult2_256(*(x1),*(tw1),*(tw1b)); + x2t = packed_cmult2_256(*(x2),*(tw2),*(tw2b)); + x3t = packed_cmult2_256(*(x3),*(tw3),*(tw3b)); + + x02t = _mm256_adds_epi16(*(x0),x2t); + x13t = _mm256_adds_epi16(x1t,x3t); + *(y0) = _mm256_adds_epi16(x02t,x13t); + *(y2) = _mm256_subs_epi16(x02t,x13t); + + x1_flip = _mm256_sign_epi16(x1t,*(__m256i*)conjugatedft); + x1_flip = _mm256_shuffle_epi8(x1_flip,complex_shuffle); + x3_flip = _mm256_sign_epi16(x3t,*(__m256i*)conjugatedft); + x3_flip = _mm256_shuffle_epi8(x3_flip,complex_shuffle); + x02t = _mm256_subs_epi16(*(x0),x2t); + x13t = _mm256_subs_epi16(x1_flip,x3_flip); + *(y1) = _mm256_adds_epi16(x02t,x13t); // x0 + x1f - x2 - x3f + *(y3) = _mm256_subs_epi16(x02t,x13t); // x0 - x1f - x2 + x3f + +} + +#endif + #elif defined(__arm__) static inline void bfly4_16(int16x8_t *x0,int16x8_t *x1,int16x8_t *x2,int16x8_t *x3, @@ -1091,6 +1540,47 @@ static inline void ibfly4_16(__m128i *x0,__m128i *x1,__m128i *x2,__m128i *x3, } +#ifdef __AVX2__ +static inline void ibfly4_16_256(__m256i *x0,__m256i *x1,__m256i *x2,__m256i *x3, + __m256i *y0,__m256i *y1,__m256i *y2,__m256i *y3, + __m256i *tw1,__m256i *tw2,__m256i *tw3, + __m256i *tw1b,__m256i *tw2b,__m256i *tw3b)__attribute__((always_inline)); + +static inline void ibfly4_16_256(__m256i *x0,__m256i *x1,__m256i *x2,__m256i *x3, + __m256i *y0,__m256i *y1,__m256i *y2,__m256i *y3, + __m256i *tw1,__m256i *tw2,__m256i *tw3, + __m256i *tw1b,__m256i *tw2b,__m256i *tw3b) +{ + + register __m256i x1t,x2t,x3t,x02t,x13t; + register __m256i x1_flip,x3_flip; + register __m256i complex_shuffle = _mm256_set_epi8(29,28,31,30,25,24,27,26,21,20,23,22,17,16,19,18,13,12,15,14,9,8,11,10,5,4,7,6,1,0,3,2); + + // each input xi is assumed to be to consecutive vectors xi0 xi1 on which to perform the 8 butterflies + // [xi00 xi01 xi02 xi03 xi10 xi20 xi30 xi40] + // each output yi is the same + + x1t = packed_cmult2_256(*(x1),*(tw1),*(tw1b)); + x2t = packed_cmult2_256(*(x2),*(tw2),*(tw2b)); + x3t = packed_cmult2_256(*(x3),*(tw3),*(tw3b)); + + x02t = _mm256_adds_epi16(*(x0),x2t); + x13t = _mm256_adds_epi16(x1t,x3t); + *(y0) = _mm256_adds_epi16(x02t,x13t); + *(y2) = _mm256_subs_epi16(x02t,x13t); + + x1_flip = _mm256_sign_epi16(x1t,*(__m256i*)conjugatedft); + x1_flip = _mm256_shuffle_epi8(x1_flip,complex_shuffle); + x3_flip = _mm256_sign_epi16(x3t,*(__m256i*)conjugatedft); + x3_flip = _mm256_shuffle_epi8(x3_flip,complex_shuffle); + x02t = _mm256_subs_epi16(*(x0),x2t); + x13t = _mm256_subs_epi16(x1_flip,x3_flip); + *(y3) = _mm256_adds_epi16(x02t,x13t); // x0 + x1f - x2 - x3f + *(y1) = _mm256_subs_epi16(x02t,x13t); // x0 - x1f - x2 + x3f + +} +#endif + #elif defined(__arm__) static inline void ibfly4_16(int16x8_t *x0,int16x8_t *x1,int16x8_t *x2,int16x8_t *x3, int16x8_t *y0,int16x8_t *y1,int16x8_t *y2,int16x8_t *y3, @@ -1175,6 +1665,59 @@ static inline void bfly5(__m128i *x0, __m128i *x1, __m128i *x2, __m128i *x3,__m1 } +#ifdef __AVX2__ + +static inline void bfly5_256(__m256i *x0, __m256i *x1, __m256i *x2, __m256i *x3,__m256i *x4, + __m256i *y0, __m256i *y1, __m256i *y2, __m256i *y3,__m256i *y4, + __m256i *tw1,__m256i *tw2,__m256i *tw3,__m256i *tw4)__attribute__((always_inline)); + +static inline void bfly5_256(__m256i *x0, __m256i *x1, __m256i *x2, __m256i *x3,__m256i *x4, + __m256i *y0, __m256i *y1, __m256i *y2, __m256i *y3,__m256i *y4, + __m256i *tw1,__m256i *tw2,__m256i *tw3,__m256i *tw4) +{ + + + + __m256i x1_2,x2_2,x3_2,x4_2,tmpre,tmpim; + + packed_cmult_256(*(x1),*(tw1),&x1_2); + packed_cmult_256(*(x2),*(tw2),&x2_2); + packed_cmult_256(*(x3),*(tw3),&x3_2); + packed_cmult_256(*(x4),*(tw4),&x4_2); + + *(y0) = _mm256_adds_epi16(*(x0),_mm256_adds_epi16(x1_2,_mm256_adds_epi16(x2_2,_mm256_adds_epi16(x3_2,x4_2)))); + cmult_256(x1_2,*(W15_256),&tmpre,&tmpim); + cmac_256(x2_2,*(W25_256),&tmpre,&tmpim); + cmac_256(x3_2,*(W35_256),&tmpre,&tmpim); + cmac_256(x4_2,*(W45_256),&tmpre,&tmpim); + *(y1) = cpack_256(tmpre,tmpim); + *(y1) = _mm256_adds_epi16(*(x0),*(y1)); + + cmult_256(x1_2,*(W25_256),&tmpre,&tmpim); + cmac_256(x2_2,*(W45_256),&tmpre,&tmpim); + cmac_256(x3_2,*(W15_256),&tmpre,&tmpim); + cmac_256(x4_2,*(W35_256),&tmpre,&tmpim); + *(y2) = cpack_256(tmpre,tmpim); + *(y2) = _mm256_adds_epi16(*(x0),*(y2)); + + cmult_256(x1_2,*(W35_256),&tmpre,&tmpim); + cmac_256(x2_2,*(W15_256),&tmpre,&tmpim); + cmac_256(x3_2,*(W45_256),&tmpre,&tmpim); + cmac_256(x4_2,*(W25_256),&tmpre,&tmpim); + *(y3) = cpack_256(tmpre,tmpim); + *(y3) = _mm256_adds_epi16(*(x0),*(y3)); + + cmult_256(x1_2,*(W45_256),&tmpre,&tmpim); + cmac_256(x2_2,*(W35_256),&tmpre,&tmpim); + cmac_256(x3_2,*(W25_256),&tmpre,&tmpim); + cmac_256(x4_2,*(W15_256),&tmpre,&tmpim); + *(y4) = cpack_256(tmpre,tmpim); + *(y4) = _mm256_adds_epi16(*(x0),*(y4)); + + +} +#endif + #elif defined(__arm__) static inline void bfly5(int16x8_t *x0, int16x8_t *x1, int16x8_t *x2, int16x8_t *x3,int16x8_t *x4, int16x8_t *y0, int16x8_t *y1, int16x8_t *y2, int16x8_t *y3,int16x8_t *y4, @@ -1267,6 +1810,43 @@ static inline void bfly5_tw1(__m128i *x0, __m128i *x1, __m128i *x2, __m128i *x3, *(y4) = _mm_adds_epi16(*(x0),*(y4)); } +#ifdef __AVX2__ +static inline void bfly5_tw1_256(__m256i *x0, __m256i *x1, __m256i *x2, __m256i *x3,__m256i *x4, + __m256i *y0, __m256i *y1, __m256i *y2, __m256i *y3,__m256i *y4) __attribute__((always_inline)); + +static inline void bfly5_tw1_256(__m256i *x0, __m256i *x1, __m256i *x2, __m256i *x3,__m256i *x4, + __m256i *y0, __m256i *y1, __m256i *y2, __m256i *y3,__m256i *y4) +{ + + __m256i tmpre,tmpim; + + *(y0) = _mm256_adds_epi16(*(x0),_mm256_adds_epi16(*(x1),_mm256_adds_epi16(*(x2),_mm256_adds_epi16(*(x3),*(x4))))); + cmult_256(*(x1),*(W15_256),&tmpre,&tmpim); + cmac_256(*(x2),*(W25_256),&tmpre,&tmpim); + cmac_256(*(x3),*(W35_256),&tmpre,&tmpim); + cmac_256(*(x4),*(W45_256),&tmpre,&tmpim); + *(y1) = cpack_256(tmpre,tmpim); + *(y1) = _mm256_adds_epi16(*(x0),*(y1)); + cmult_256(*(x1),*(W25_256),&tmpre,&tmpim); + cmac_256(*(x2),*(W45_256),&tmpre,&tmpim); + cmac_256(*(x3),*(W15_256),&tmpre,&tmpim); + cmac_256(*(x4),*(W35_256),&tmpre,&tmpim); + *(y2) = cpack_256(tmpre,tmpim); + *(y2) = _mm256_adds_epi16(*(x0),*(y2)); + cmult_256(*(x1),*(W35_256),&tmpre,&tmpim); + cmac_256(*(x2),*(W15_256),&tmpre,&tmpim); + cmac_256(*(x3),*(W45_256),&tmpre,&tmpim); + cmac_256(*(x4),*(W25_256),&tmpre,&tmpim); + *(y3) = cpack_256(tmpre,tmpim); + *(y3) = _mm256_adds_epi16(*(x0),*(y3)); + cmult_256(*(x1),*(W45_256),&tmpre,&tmpim); + cmac_256(*(x2),*(W35_256),&tmpre,&tmpim); + cmac_256(*(x3),*(W25_256),&tmpre,&tmpim); + cmac_256(*(x4),*(W15_256),&tmpre,&tmpim); + *(y4) = cpack_256(tmpre,tmpim); + *(y4) = _mm256_adds_epi16(*(x0),*(y4)); +} +#endif #elif defined(__arm__) static inline void bfly5_tw1(int16x8_t *x0, int16x8_t *x1, int16x8_t *x2, int16x8_t *x3,int16x8_t *x4, int16x8_t *y0, int16x8_t *y1, int16x8_t *y2, int16x8_t *y3,int16x8_t *y4) __attribute__((always_inline)); @@ -1349,18 +1929,46 @@ static inline void transpose16_ooff(__m128i *x,__m128i *y,int off) register __m128i ytmp0,ytmp1,ytmp2,ytmp3; __m128i *y2=y; - ytmp0 = _mm_unpacklo_epi32(x[0],x[1]); - ytmp1 = _mm_unpackhi_epi32(x[0],x[1]); - ytmp2 = _mm_unpacklo_epi32(x[2],x[3]); - ytmp3 = _mm_unpackhi_epi32(x[2],x[3]); - *y2 = _mm_unpacklo_epi64(ytmp0,ytmp2); + ytmp0 = _mm_unpacklo_epi32(x[0],x[1]); // x00 x10 x01 x11 + ytmp1 = _mm_unpackhi_epi32(x[0],x[1]); // x02 x12 x03 x13 + ytmp2 = _mm_unpacklo_epi32(x[2],x[3]); // x20 x30 x21 x31 + ytmp3 = _mm_unpackhi_epi32(x[2],x[3]); // x22 x32 x23 x33 + *y2 = _mm_unpacklo_epi64(ytmp0,ytmp2); // x00 x10 x20 x30 y2+=off; - *y2 = _mm_unpackhi_epi64(ytmp0,ytmp2); + *y2 = _mm_unpackhi_epi64(ytmp0,ytmp2); // x01 x11 x21 x31 y2+=off; - *y2 = _mm_unpacklo_epi64(ytmp1,ytmp3); + *y2 = _mm_unpacklo_epi64(ytmp1,ytmp3); // x02 x12 x22 x32 y2+=off; - *y2 = _mm_unpackhi_epi64(ytmp1,ytmp3); + *y2 = _mm_unpackhi_epi64(ytmp1,ytmp3); // x03 x13 x23 x33 +} + +#ifdef __AVX2__ + +static inline void transpose16_ooff_simd256(__m256i *x,__m256i *y,int off) __attribute__((always_inline)); +static inline void transpose16_ooff_simd256(__m256i *x,__m256i *y,int off) +{ + register __m256i ytmp0,ytmp1,ytmp2,ytmp3,ytmp4,ytmp5,ytmp6,ytmp7; + __m256i *y2=y; + __m256i const perm_mask = _mm256_set_epi32(7, 3, 5, 1, 6, 2, 4, 0); + + ytmp0 = _mm256_permutevar8x32_epi32(x[0],perm_mask); // x00 x10 x01 x11 x02 x12 x03 x13 + ytmp1 = _mm256_permutevar8x32_epi32(x[1],perm_mask); // x20 x30 x21 x31 x22 x32 x23 x33 + ytmp2 = _mm256_permutevar8x32_epi32(x[2],perm_mask); // x40 x50 x41 x51 x42 x52 x43 x53 + ytmp3 = _mm256_permutevar8x32_epi32(x[3],perm_mask); // x60 x70 x61 x71 x62 x72 x63 x73 + ytmp4 = _mm256_unpacklo_epi64(ytmp0,ytmp1); // x00 x10 x20 x30 x01 x11 x21 x31 + ytmp5 = _mm256_unpackhi_epi64(ytmp0,ytmp1); // x02 x12 x22 x32 x03 x13 x23 x33 + ytmp6 = _mm256_unpacklo_epi64(ytmp2,ytmp3); // x40 x50 x60 x70 x41 x51 x61 x71 + ytmp7 = _mm256_unpackhi_epi64(ytmp2,ytmp3); // x42 x52 x62 x72 x43 x53 x63 x73 + + *y2 = _mm256_insertf128_si256(ytmp4,_mm256_extracti128_si256(ytmp6,0),1); //x00 x10 x20 x30 x40 x50 x60 x70 + y2+=off; + *y2 = _mm256_insertf128_si256(ytmp6,_mm256_extracti128_si256(ytmp4,1),0); //x01 x11 x21 x31 x41 x51 x61 x71 + y2+=off; + *y2 = _mm256_insertf128_si256(ytmp5,_mm256_extracti128_si256(ytmp7,0),1); //x00 x10 x20 x30 x40 x50 x60 x70 + y2+=off; + *y2 = _mm256_insertf128_si256(ytmp7,_mm256_extracti128_si256(ytmp5,1),0); //x01 x11 x21 x31 x41 x51 x61 x71 } +#endif #elif defined(__arm__) static inline void transpose16_ooff(int16x8_t *x,int16x8_t *y,int off) __attribute__((always_inline)); @@ -1390,7 +1998,29 @@ static inline void transpose4_ooff(__m64 *x,__m64 *y,int off) { y[0] = _mm_unpacklo_pi32(x[0],x[1]); y[off] = _mm_unpackhi_pi32(x[0],x[1]); + + // x[0] = [x0 x1] + // x[1] = [x2 x3] + // y[0] = [x0 x2] + // y[off] = [x1 x3] } +#ifdef __AVX2__ +static inline void transpose4_ooff_simd256(__m256i *x,__m256i *y,int off)__attribute__((always_inline)); +static inline void transpose4_ooff_simd256(__m256i *x,__m256i *y,int off) +{ + __m256i const perm_mask = _mm256_set_epi32(7, 5, 3, 1, 6, 4, 2, 0); + __m256i perm_tmp0,perm_tmp1; + + // x[0] = [x0 x1 x2 x3 x4 x5 x6 x7] + // x[1] = [x8 x9 x10 x11 x12 x13 x14] + // y[0] = [x0 x2 x4 x6 x8 x10 x12 x14] + // y[off] = [x1 x3 x5 x7 x9 x11 x13 x15] + perm_tmp0 = _mm256_permutevar8x32_epi32(x[0],perm_mask); + perm_tmp1 = _mm256_permutevar8x32_epi32(x[1],perm_mask); + y[0] = _mm256_insertf128_si256(perm_tmp0,_mm256_extracti128_si256(perm_tmp1,0),1); + y[off] = _mm256_insertf128_si256(perm_tmp1,_mm256_extracti128_si256(perm_tmp0,1),0); +} +#endif #elif (__arm__) static inline void transpose4_ooff(int16x4_t *x,int16x4_t *y,int off)__attribute__((always_inline)); @@ -1406,26 +2036,46 @@ static inline void transpose4_ooff(int16x4_t *x,int16x4_t *y,int off) // 16-point optimized DFT kernel -int16_t tw16[24] __attribute__((aligned(16))) = { 32767,0,30272,-12540,23169 ,-23170,12539 ,-30273, +int16_t tw16[24] __attribute__((aligned(32))) = { 32767,0,30272,-12540,23169 ,-23170,12539 ,-30273, 32767,0,23169,-23170,0 ,-32767,-23170,-23170, 32767,0,12539,-30273,-23170,-23170,-30273,12539 }; -int16_t tw16a[24] __attribute__((aligned(16))) = {32767,0,30272,12540,23169 ,23170,12539 ,30273, +int16_t tw16a[24] __attribute__((aligned(32))) = {32767,0,30272,12540,23169 ,23170,12539 ,30273, 32767,0,23169,23170,0 ,32767,-23170,23170, 32767,0,12539,30273,-23170,23170,-30273,-12539 }; -int16_t tw16b[24] __attribute__((aligned(16))) = { 0,32767,-12540,30272,-23170,23169 ,-30273,12539, +int16_t tw16b[24] __attribute__((aligned(32))) = { 0,32767,-12540,30272,-23170,23169 ,-30273,12539, 0,32767,-23170,23169,-32767,0 ,-23170,-23170, 0,32767,-30273,12539,-23170,-23170,12539 ,-30273 }; -int16_t tw16c[24] __attribute__((aligned(16))) = { 0,32767,12540,30272,23170,23169 ,30273 ,12539, +int16_t tw16c[24] __attribute__((aligned(32))) = { 0,32767,12540,30272,23170,23169 ,30273 ,12539, 0,32767,23170,23169,32767,0 ,23170 ,-23170, 0,32767,30273,12539,23170,-23170,-12539,-30273 }; +int16_t tw16rep[48] __attribute__((aligned(32))) = { 32767,0,30272,-12540,23169 ,-23170,12539 ,-30273,32767,0,30272,-12540,23169 ,-23170,12539 ,-30273, + 32767,0,23169,-23170,0 ,-32767,-23170,-23170,32767,0,23169,-23170,0 ,-32767,-23170,-23170, + 32767,0,12539,-30273,-23170,-23170,-30273,12539,32767,0,12539,-30273,-23170,-23170,-30273,12539 + }; + +int16_t tw16arep[48] __attribute__((aligned(32))) = {32767,0,30272,12540,23169 ,23170,12539 ,30273,32767,0,30272,12540,23169 ,23170,12539 ,30273, + 32767,0,23169,23170,0 ,32767,-23170,23170,32767,0,23169,23170,0 ,32767,-23170,23170, + 32767,0,12539,30273,-23170,23170,-30273,-12539,32767,0,12539,30273,-23170,23170,-30273,-12539 + }; + +int16_t tw16brep[48] __attribute__((aligned(32))) = { 0,32767,-12540,30272,-23170,23169 ,-30273,12539,0,32767,-12540,30272,-23170,23169 ,-30273,12539, + 0,32767,-23170,23169,-32767,0 ,-23170,-23170,0,32767,-23170,23169,-32767,0 ,-23170,-23170, + 0,32767,-30273,12539,-23170,-23170,12539 ,-30273,0,32767,-30273,12539,-23170,-23170,12539 ,-30273 + }; + +int16_t tw16crep[48] __attribute__((aligned(32))) = { 0,32767,12540,30272,23170,23169 ,30273 ,12539,0,32767,12540,30272,23170,23169 ,30273 ,12539, + 0,32767,23170,23169,32767,0 ,23170 ,-23170,0,32767,23170,23169,32767,0 ,23170 ,-23170, + 0,32767,30273,12539,23170,-23170,-12539,-30273,0,32767,30273,12539,23170,-23170,-12539,-30273 + }; + static inline void dft16(int16_t *x,int16_t *y) __attribute__((always_inline)); @@ -1439,7 +2089,6 @@ static inline void dft16(int16_t *x,int16_t *y) -#ifndef AVX2 /* This is the original version before unrolling bfly4_tw1(x128,x128+1,x128+2,x128+3, @@ -1498,32 +2147,6 @@ static inline void dft16(int16_t *x,int16_t *y) y128[1] = _mm_adds_epi16(x02t,x13t); // x0 + x1f - x2 - x3f y128[3] = _mm_subs_epi16(x02t,x13t); // x0 - x1f - x2 + x3f -#else - - // x02t = _mm_adds_epi16(x128[0],x128[2]); - // x13t = _mm_adds_epi16(x128[1],x128[3]); - - xt = _mm256_adds_epi16(x256[0],x256[1]); - - xtmp0 = _mm_adds_epi16(x02t,x13t); - xtmp2 = _mm_subs_epi16(x02t,x13t); - - x13_flip - x1_flip = _mm_sign_epi16(x128[1],*(__m128i*)conjugatedft); - x1_flip = _mm_shuffle_epi8(x1_flip,_mm_set_epi8(13,12,15,14,9,8,11,10,5,4,7,6,1,0,3,2)); - x3_flip = _mm_sign_epi16(x128[3],*(__m128i*)conjugatedft); - x3_flip = _mm_shuffle_epi8(x3_flip,_mm_set_epi8(13,12,15,14,9,8,11,10,5,4,7,6,1,0,3,2)); - - // x02t = _mm_subs_epi16(x128[0],x128[2]); - // x13t = _mm_subs_epi16(x1_flip,x3_flip); - xt = _mm256_subs_epi16(x256flip0,x256flip1); - - xtmp1 = _mm_adds_epi16(x02t,x13t); // x0 + x1f - x2 - x3f - xtmp3 = _mm_subs_epi16(x02t,x13t); // x0 - x1f - x2 + x3f - - -#endif - #elif defined(__arm__) int16x8_t *tw16a_128=(int16x8_t *)tw16a,*tw16b_128=(int16x8_t *)tw16b,*x128=(int16x8_t *)x,*y128=(int16x8_t *)y; @@ -1594,19 +2217,103 @@ static inline void dft16(int16_t *x,int16_t *y) #endif } -static inline void idft16(int16_t *x,int16_t *y) __attribute__((always_inline)); - -static inline void idft16(int16_t *x,int16_t *y) +#if defined(__x86_64__) || defined(__i386__) +#ifdef __AVX2__ +// Does two 16-point DFTS (x[0 .. 15] is 128 LSBs of input vector, x[16..31] is in 128 MSBs) +static inline void dft16_simd256(int16_t *x,int16_t *y) __attribute__((always_inline)); +static inline void dft16_simd256(int16_t *x,int16_t *y) { -#if defined(__x86_64__) || defined(__i386__) - __m128i *tw16a_128=(__m128i *)tw16,*tw16b_128=(__m128i *)tw16c,*x128=(__m128i *)x,*y128=(__m128i *)y; + __m256i *tw16a_256=(__m256i *)tw16arep,*tw16b_256=(__m256i *)tw16brep,*x256=(__m256i *)x,*y256=(__m256i *)y; - /* - bfly4_tw1(x128,x128+1,x128+2,x128+3, - y128,y128+1,y128+2,y128+3); + __m256i x1_flip,x3_flip,x02t,x13t; + __m256i ytmp0,ytmp1,ytmp2,ytmp3,xtmp0,xtmp1,xtmp2,xtmp3; + register __m256i complex_shuffle = _mm256_set_epi8(29,28,31,30,25,24,27,26,21,20,23,22,17,16,19,18,13,12,15,14,9,8,11,10,5,4,7,6,1,0,3,2); - transpose16(y128,ytmp); + // First stage : 4 Radix-4 butterflies without input twiddles + + x02t = _mm256_adds_epi16(x256[0],x256[2]); + x13t = _mm256_adds_epi16(x256[1],x256[3]); + xtmp0 = _mm256_adds_epi16(x02t,x13t); + xtmp2 = _mm256_subs_epi16(x02t,x13t); + x1_flip = _mm256_sign_epi16(x256[1],*(__m256i*)conjugatedft); + x1_flip = _mm256_shuffle_epi8(x1_flip,complex_shuffle); + x3_flip = _mm256_sign_epi16(x256[3],*(__m256i*)conjugatedft); + x3_flip = _mm256_shuffle_epi8(x3_flip,complex_shuffle); + x02t = _mm256_subs_epi16(x256[0],x256[2]); + x13t = _mm256_subs_epi16(x1_flip,x3_flip); + xtmp1 = _mm256_adds_epi16(x02t,x13t); // x0 + x1f - x2 - x3f + xtmp3 = _mm256_subs_epi16(x02t,x13t); // x0 - x1f - x2 + x3f + + /* print_shorts256("xtmp0",(int16_t*)&xtmp0); + print_shorts256("xtmp1",(int16_t*)&xtmp1); + print_shorts256("xtmp2",(int16_t*)&xtmp2); + print_shorts256("xtmp3",(int16_t*)&xtmp3);*/ + + ytmp0 = _mm256_unpacklo_epi32(xtmp0,xtmp1); + ytmp1 = _mm256_unpackhi_epi32(xtmp0,xtmp1); + ytmp2 = _mm256_unpacklo_epi32(xtmp2,xtmp3); + ytmp3 = _mm256_unpackhi_epi32(xtmp2,xtmp3); + xtmp0 = _mm256_unpacklo_epi64(ytmp0,ytmp2); + xtmp1 = _mm256_unpackhi_epi64(ytmp0,ytmp2); + xtmp2 = _mm256_unpacklo_epi64(ytmp1,ytmp3); + xtmp3 = _mm256_unpackhi_epi64(ytmp1,ytmp3); + + // Second stage : 4 Radix-4 butterflies with input twiddles + xtmp1 = packed_cmult2_256(xtmp1,tw16a_256[0],tw16b_256[0]); + xtmp2 = packed_cmult2_256(xtmp2,tw16a_256[1],tw16b_256[1]); + xtmp3 = packed_cmult2_256(xtmp3,tw16a_256[2],tw16b_256[2]); + + /* print_shorts256("xtmp0",(int16_t*)&xtmp0); + print_shorts256("xtmp1",(int16_t*)&xtmp1); + print_shorts256("xtmp2",(int16_t*)&xtmp2); + print_shorts256("xtmp3",(int16_t*)&xtmp3);*/ + + x02t = _mm256_adds_epi16(xtmp0,xtmp2); + x13t = _mm256_adds_epi16(xtmp1,xtmp3); + ytmp0 = _mm256_adds_epi16(x02t,x13t); + ytmp2 = _mm256_subs_epi16(x02t,x13t); + x1_flip = _mm256_sign_epi16(xtmp1,*(__m256i*)conjugatedft); + x1_flip = _mm256_shuffle_epi8(x1_flip,complex_shuffle); + x3_flip = _mm256_sign_epi16(xtmp3,*(__m256i*)conjugatedft); + x3_flip = _mm256_shuffle_epi8(x3_flip,complex_shuffle); + x02t = _mm256_subs_epi16(xtmp0,xtmp2); + x13t = _mm256_subs_epi16(x1_flip,x3_flip); + ytmp1 = _mm256_adds_epi16(x02t,x13t); // x0 + x1f - x2 - x3f + ytmp3 = _mm256_subs_epi16(x02t,x13t); // x0 - x1f - x2 + x3f + + + // [y0 y1 y2 y3 y16 y17 y18 y19] + // [y4 y5 y6 y7 y20 y21 y22 y23] + // [y8 y9 y10 y11 y24 y25 y26 y27] + // [y12 y13 y14 y15 y28 y29 y30 y31] + + y256[0] = _mm256_insertf128_si256(ytmp0,_mm256_extracti128_si256(ytmp1,0),1); + y256[1] = _mm256_insertf128_si256(ytmp2,_mm256_extracti128_si256(ytmp3,0),1); + y256[2] = _mm256_insertf128_si256(ytmp1,_mm256_extracti128_si256(ytmp0,1),0); + y256[3] = _mm256_insertf128_si256(ytmp3,_mm256_extracti128_si256(ytmp2,1),0); + + // [y0 y1 y2 y3 y4 y5 y6 y7] + // [y8 y9 y10 y11 y12 y13 y14 y15] + // [y16 y17 y18 y19 y20 y21 y22 y23] + // [y24 y25 y26 y27 y28 y29 y30 y31] +} + +#endif +#endif +static inline void idft16(int16_t *x,int16_t *y) __attribute__((always_inline)); + +static inline void idft16(int16_t *x,int16_t *y) +{ + +#if defined(__x86_64__) || defined(__i386__) + __m128i *tw16a_128=(__m128i *)tw16,*tw16b_128=(__m128i *)tw16c,*x128=(__m128i *)x,*y128=(__m128i *)y; + + /* + bfly4_tw1(x128,x128+1,x128+2,x128+3, + y128,y128+1,y128+2,y128+3); + + transpose16(y128,ytmp); bfly4_16(ytmp,ytmp+1,ytmp+2,ytmp+3, y128,y128+1,y128+2,y128+3, @@ -1725,27 +2432,193 @@ static inline void idft16(int16_t *x,int16_t *y) #endif } +#if defined(__x86_64__) || defined(__i386__) +#ifdef __AVX2__ +// Does two 16-point IDFTS (x[0 .. 15] is 128 LSBs of input vector, x[16..31] is in 128 MSBs) +static inline void idft16_simd256(int16_t *x,int16_t *y) __attribute__((always_inline)); +static inline void idft16_simd256(int16_t *x,int16_t *y) +{ + + __m256i *tw16a_256=(__m256i *)tw16rep,*tw16b_256=(__m256i *)tw16crep,*x256=(__m256i *)x,*y256=(__m256i *)y; + register __m256i x1_flip,x3_flip,x02t,x13t; + register __m256i ytmp0,ytmp1,ytmp2,ytmp3,xtmp0,xtmp1,xtmp2,xtmp3; + register __m256i complex_shuffle = _mm256_set_epi8(29,28,31,30,25,24,27,26,21,20,23,22,17,16,19,18,13,12,15,14,9,8,11,10,5,4,7,6,1,0,3,2); + + // First stage : 4 Radix-4 butterflies without input twiddles + + x02t = _mm256_adds_epi16(x256[0],x256[2]); + x13t = _mm256_adds_epi16(x256[1],x256[3]); + xtmp0 = _mm256_adds_epi16(x02t,x13t); + xtmp2 = _mm256_subs_epi16(x02t,x13t); + x1_flip = _mm256_sign_epi16(x256[1],*(__m256i*)conjugatedft); + x1_flip = _mm256_shuffle_epi8(x1_flip,complex_shuffle); + x3_flip = _mm256_sign_epi16(x256[3],*(__m256i*)conjugatedft); + x3_flip = _mm256_shuffle_epi8(x3_flip,complex_shuffle); + x02t = _mm256_subs_epi16(x256[0],x256[2]); + x13t = _mm256_subs_epi16(x1_flip,x3_flip); + xtmp3 = _mm256_adds_epi16(x02t,x13t); // x0 + x1f - x2 - x3f + xtmp1 = _mm256_subs_epi16(x02t,x13t); // x0 - x1f - x2 + x3f + + ytmp0 = _mm256_unpacklo_epi32(xtmp0,xtmp1); + ytmp1 = _mm256_unpackhi_epi32(xtmp0,xtmp1); + ytmp2 = _mm256_unpacklo_epi32(xtmp2,xtmp3); + ytmp3 = _mm256_unpackhi_epi32(xtmp2,xtmp3); + xtmp0 = _mm256_unpacklo_epi64(ytmp0,ytmp2); + xtmp1 = _mm256_unpackhi_epi64(ytmp0,ytmp2); + xtmp2 = _mm256_unpacklo_epi64(ytmp1,ytmp3); + xtmp3 = _mm256_unpackhi_epi64(ytmp1,ytmp3); + + // Second stage : 4 Radix-4 butterflies with input twiddles + xtmp1 = packed_cmult2_256(xtmp1,tw16a_256[0],tw16b_256[0]); + xtmp2 = packed_cmult2_256(xtmp2,tw16a_256[1],tw16b_256[1]); + xtmp3 = packed_cmult2_256(xtmp3,tw16a_256[2],tw16b_256[2]); + + x02t = _mm256_adds_epi16(xtmp0,xtmp2); + x13t = _mm256_adds_epi16(xtmp1,xtmp3); + ytmp0 = _mm256_adds_epi16(x02t,x13t); + ytmp2 = _mm256_subs_epi16(x02t,x13t); + x1_flip = _mm256_sign_epi16(xtmp1,*(__m256i*)conjugatedft); + x1_flip = _mm256_shuffle_epi8(x1_flip,complex_shuffle); + x3_flip = _mm256_sign_epi16(xtmp3,*(__m256i*)conjugatedft); + x3_flip = _mm256_shuffle_epi8(x3_flip,complex_shuffle); + x02t = _mm256_subs_epi16(xtmp0,xtmp2); + x13t = _mm256_subs_epi16(x1_flip,x3_flip); + ytmp3 = _mm256_adds_epi16(x02t,x13t); // x0 + x1f - x2 - x3f + ytmp1 = _mm256_subs_epi16(x02t,x13t); // x0 - x1f - x2 + x3f + + // [y0 y1 y2 y3 y16 y17 y18 y19] + // [y4 y5 y6 y7 y20 y21 y22 y23] + // [y8 y9 y10 y11 y24 y25 y26 y27] + // [y12 y13 y14 y15 y28 y29 y30 y31] + + y256[0] = _mm256_insertf128_si256(ytmp0,_mm256_extracti128_si256(ytmp1,0),1); + y256[1] = _mm256_insertf128_si256(ytmp2,_mm256_extracti128_si256(ytmp3,0),1); + y256[2] = _mm256_insertf128_si256(ytmp1,_mm256_extracti128_si256(ytmp0,1),0); + y256[3] = _mm256_insertf128_si256(ytmp3,_mm256_extracti128_si256(ytmp2,1),0); + +} +#endif +#endif // 64-point optimized DFT -int16_t tw64[96] __attribute__((aligned(16))) = { 32767,0,32609,-3212,32137,-6393,31356,-9512,30272,-12540,28897,-15447,27244,-18205,25329,-20788,23169,-23170,20787,-25330,18204,-27245,15446,-28898,12539,-30273,9511,-31357,6392,-32138,3211,-32610, - 32767,0,32137,-6393,30272,-12540,27244,-18205,23169,-23170,18204,-27245,12539,-30273,6392,-32138,0,-32767,-6393,-32138,-12540,-30273,-18205,-27245,-23170,-23170,-27245,-18205,-30273,-12540,-32138,-6393, - 32767,0,31356,-9512,27244,-18205,20787,-25330,12539,-30273,3211,-32610,-6393,-32138,-15447,-28898,-23170,-23170,-28898,-15447,-32138,-6393,-32610,3211,-30273,12539,-25330,20787,-18205,27244,-9512,31356 +int16_t tw64[96] __attribute__((aligned(32))) = { +32767,0,32609,-3212,32137,-6393,31356,-9512, +30272,-12540,28897,-15447,27244,-18205,25329,-20788, +23169,-23170,20787,-25330,18204,-27245,15446,-28898, +12539,-30273,9511,-31357,6392,-32138,3211,-32610, +32767,0,32137,-6393,30272,-12540,27244,-18205, +23169,-23170,18204,-27245,12539,-30273,6392,-32138, +0,-32767,-6393,-32138,-12540,-30273,-18205,-27245, +-23170,-23170,-27245,-18205,-30273,-12540,-32138,-6393, +32767,0,31356,-9512,27244,-18205,20787,-25330, +12539,-30273,3211,-32610,-6393,-32138,-15447,-28898, +-23170,-23170,-28898,-15447,-32138,-6393,-32610,3211, +-30273,12539,-25330,20787,-18205,27244,-9512,31356 + }; + +int16_t tw64rep[192] __attribute__((aligned(32))) = { +32767,0,32609,-3212,32137,-6393,31356,-9512,32767,0,32609,-3212,32137,-6393,31356,-9512, +30272,-12540,28897,-15447,27244,-18205,25329,-20788,30272,-12540,28897,-15447,27244,-18205,25329,-20788, +23169,-23170,20787,-25330,18204,-27245,15446,-28898,23169,-23170,20787,-25330,18204,-27245,15446,-28898, +12539,-30273,9511,-31357,6392,-32138,3211,-32610,12539,-30273,9511,-31357,6392,-32138,3211,-32610, +32767,0,32137,-6393,30272,-12540,27244,-18205,32767,0,32137,-6393,30272,-12540,27244,-18205, +23169,-23170,18204,-27245,12539,-30273,6392,-32138,23169,-23170,18204,-27245,12539,-30273,6392,-32138, +0,-32767,-6393,-32138,-12540,-30273,-18205,-27245,0,-32767,-6393,-32138,-12540,-30273,-18205,-27245, +-23170,-23170,-27245,-18205,-30273,-12540,-32138,-6393,-23170,-23170,-27245,-18205,-30273,-12540,-32138,-6393, +32767,0,31356,-9512,27244,-18205,20787,-25330,32767,0,31356,-9512,27244,-18205,20787,-25330, +12539,-30273,3211,-32610,-6393,-32138,-15447,-28898,12539,-30273,3211,-32610,-6393,-32138,-15447,-28898, +-23170,-23170,-28898,-15447,-32138,-6393,-32610,3211,-23170,-23170,-28898,-15447,-32138,-6393,-32610,3211, +-30273,12539,-25330,20787,-18205,27244,-9512,31356,-30273,12539,-25330,20787,-18205,27244,-9512,31356 }; -int16_t tw64a[96] __attribute__((aligned(16))) = { 32767,0,32609,3212,32137,6393,31356,9512,30272,12540,28897,15447,27244,18205,25329,20788,23169,23170,20787,25330,18204,27245,15446,28898,12539,30273,9511,31357,6392,32138,3211,32610, - 32767,0,32137,6393,30272,12540,27244,18205,23169,23170,18204,27245,12539,30273,6392,32138,0,32767,-6393,32138,-12540,30273,-18205,27245,-23170,23170,-27245,18205,-30273,12540,-32138,6393, - 32767,0,31356,9512,27244,18205,20787,25330,12539,30273,3211,32610,-6393,32138,-15447,28898,-23170,23170,-28898,15447,-32138,6393,-32610,-3211,-30273,-12539,-25330,-20787,-18205,-27244,-9512,-31356 +int16_t tw64a[96] __attribute__((aligned(32))) = { +32767,0,32609,3212,32137,6393,31356,9512, +30272,12540,28897,15447,27244,18205,25329,20788, +23169,23170,20787,25330,18204,27245,15446,28898, +12539,30273,9511,31357,6392,32138,3211,32610, +32767,0,32137,6393,30272,12540,27244,18205, +23169,23170,18204,27245,12539,30273,6392,32138, +0,32767,-6393,32138,-12540,30273,-18205,27245, +-23170,23170,-27245,18205,-30273,12540,-32138,6393, +32767,0,31356,9512,27244,18205,20787,25330, +12539,30273,3211,32610,-6393,32138,-15447,28898, +-23170,23170,-28898,15447,-32138,6393,-32610,-3211, +-30273,-12539,-25330,-20787,-18205,-27244,-9512,-31356 + }; +int16_t tw64arep[192] __attribute__((aligned(32))) = { +32767,0,32609,3212,32137,6393,31356,9512,32767,0,32609,3212,32137,6393,31356,9512, +30272,12540,28897,15447,27244,18205,25329,20788,30272,12540,28897,15447,27244,18205,25329,20788, +23169,23170,20787,25330,18204,27245,15446,28898,23169,23170,20787,25330,18204,27245,15446,28898, +12539,30273,9511,31357,6392,32138,3211,32610,12539,30273,9511,31357,6392,32138,3211,32610, +32767,0,32137,6393,30272,12540,27244,18205,32767,0,32137,6393,30272,12540,27244,18205, +23169,23170,18204,27245,12539,30273,6392,32138,23169,23170,18204,27245,12539,30273,6392,32138, +0,32767,-6393,32138,-12540,30273,-18205,27245,0,32767,-6393,32138,-12540,30273,-18205,27245, +-23170,23170,-27245,18205,-30273,12540,-32138,6393,-23170,23170,-27245,18205,-30273,12540,-32138,6393, +32767,0,31356,9512,27244,18205,20787,25330,32767,0,31356,9512,27244,18205,20787,25330, +12539,30273,3211,32610,-6393,32138,-15447,28898,12539,30273,3211,32610,-6393,32138,-15447,28898, +-23170,23170,-28898,15447,-32138,6393,-32610,-3211,-23170,23170,-28898,15447,-32138,6393,-32610,-3211, +-30273,-12539,-25330,-20787,-18205,-27244,-9512,-31356,-30273,-12539,-25330,-20787,-18205,-27244,-9512,-31356 }; -int16_t tw64b[96] __attribute__((aligned(16))) = { 0,32767,-3212,32609,-6393,32137,-9512,31356,-12540,30272,-15447,28897,-18205,27244,-20788,25329,-23170,23169,-25330,20787,-27245,18204,-28898,15446,-30273,12539,-31357,9511,-32138,6392,-32610,3211, - 0,32767,-6393,32137,-12540,30272,-18205,27244,-23170,23169,-27245,18204,-30273,12539,-32138,6392,-32767,0,-32138,-6393,-30273,-12540,-27245,-18205,-23170,-23170,-18205,-27245,-12540,-30273,-6393,-32138, - 0,32767,-9512,31356,-18205,27244,-25330,20787,-30273,12539,-32610,3211,-32138,-6393,-28898,-15447,-23170,-23170,-15447,-28898,-6393,-32138,3211,-32610,12539,-30273,20787,-25330,27244,-18205,31356,-9512 +int16_t tw64b[96] __attribute__((aligned(32))) = { +0,32767,-3212,32609,-6393,32137,-9512,31356, +-12540,30272,-15447,28897,-18205,27244,-20788,25329, +-23170,23169,-25330,20787,-27245,18204,-28898,15446, +-30273,12539,-31357,9511,-32138,6392,-32610,3211, +0,32767,-6393,32137,-12540,30272,-18205,27244, +-23170,23169,-27245,18204,-30273,12539,-32138,6392, +-32767,0,-32138,-6393,-30273,-12540,-27245,-18205, +-23170,-23170,-18205,-27245,-12540,-30273,-6393,-32138, +0,32767,-9512,31356,-18205,27244,-25330,20787, +-30273,12539,-32610,3211,-32138,-6393,-28898,-15447, +-23170,-23170,-15447,-28898,-6393,-32138,3211,-32610, +12539,-30273,20787,-25330,27244,-18205,31356,-9512 }; -int16_t tw64c[96] __attribute__((aligned(16))) = { 0,32767,3212,32609,6393,32137,9512,31356,12540,30272,15447,28897,18205,27244,20788,25329,23170,23169,25330,20787,27245,18204,28898,15446,30273,12539,31357,9511,32138,6392,32610,3211, - 0,32767,6393,32137,12540,30272,18205,27244,23170,23169,27245,18204,30273,12539,32138,6392,32767,0,32138,-6393,30273,-12540,27245,-18205,23170,-23170,18205,-27245,12540,-30273,6393,-32138, - 0,32767,9512,31356,18205,27244,25330,20787,30273,12539,32610,3211,32138,-6393,28898,-15447,23170,-23170,15447,-28898,6393,-32138,-3211,-32610,-12539,-30273,-20787,-25330,-27244,-18205,-31356,-9512 +int16_t tw64brep[192] __attribute__((aligned(32))) = { +0,32767,-3212,32609,-6393,32137,-9512,31356,0,32767,-3212,32609,-6393,32137,-9512,31356, +-12540,30272,-15447,28897,-18205,27244,-20788,25329,-12540,30272,-15447,28897,-18205,27244,-20788,25329, +-23170,23169,-25330,20787,-27245,18204,-28898,15446,-23170,23169,-25330,20787,-27245,18204,-28898,15446, +-30273,12539,-31357,9511,-32138,6392,-32610,3211,-30273,12539,-31357,9511,-32138,6392,-32610,3211, +0,32767,-6393,32137,-12540,30272,-18205,27244,0,32767,-6393,32137,-12540,30272,-18205,27244, +-23170,23169,-27245,18204,-30273,12539,-32138,6392,-23170,23169,-27245,18204,-30273,12539,-32138,6392, +-32767,0,-32138,-6393,-30273,-12540,-27245,-18205,-32767,0,-32138,-6393,-30273,-12540,-27245,-18205, +-23170,-23170,-18205,-27245,-12540,-30273,-6393,-32138,-23170,-23170,-18205,-27245,-12540,-30273,-6393,-32138, +0,32767,-9512,31356,-18205,27244,-25330,20787,0,32767,-9512,31356,-18205,27244,-25330,20787, +-30273,12539,-32610,3211,-32138,-6393,-28898,-15447,-30273,12539,-32610,3211,-32138,-6393,-28898,-15447, +-23170,-23170,-15447,-28898,-6393,-32138,3211,-32610,-23170,-23170,-15447,-28898,-6393,-32138,3211,-32610, +12539,-30273,20787,-25330,27244,-18205,31356,-9512,12539,-30273,20787,-25330,27244,-18205,31356,-9512 + }; + +int16_t tw64c[96] __attribute__((aligned(32))) = { +0,32767,3212,32609,6393,32137,9512,31356, +12540,30272,15447,28897,18205,27244,20788,25329, +23170,23169,25330,20787,27245,18204,28898,15446, +30273,12539,31357,9511,32138,6392,32610,3211, +0,32767,6393,32137,12540,30272,18205,27244, +23170,23169,27245,18204,30273,12539,32138,6392, +32767,0,32138,-6393,30273,-12540,27245,-18205, +23170,-23170,18205,-27245,12540,-30273,6393,-32138, +0,32767,9512,31356,18205,27244,25330,20787, +30273,12539,32610,3211,32138,-6393,28898,-15447, +23170,-23170,15447,-28898,6393,-32138,-3211,-32610, +-12539,-30273,-20787,-25330,-27244,-18205,-31356,-9512 + }; + +int16_t tw64crep[192] __attribute__((aligned(32))) = { +0,32767,3212,32609,6393,32137,9512,31356,0,32767,3212,32609,6393,32137,9512,31356, +12540,30272,15447,28897,18205,27244,20788,25329,12540,30272,15447,28897,18205,27244,20788,25329, +23170,23169,25330,20787,27245,18204,28898,15446,23170,23169,25330,20787,27245,18204,28898,15446, +30273,12539,31357,9511,32138,6392,32610,3211,30273,12539,31357,9511,32138,6392,32610,3211, +0,32767,6393,32137,12540,30272,18205,27244,0,32767,6393,32137,12540,30272,18205,27244, +23170,23169,27245,18204,30273,12539,32138,6392,23170,23169,27245,18204,30273,12539,32138,6392, +32767,0,32138,-6393,30273,-12540,27245,-18205,32767,0,32138,-6393,30273,-12540,27245,-18205, +23170,-23170,18205,-27245,12540,-30273,6393,-32138,23170,-23170,18205,-27245,12540,-30273,6393,-32138, +0,32767,9512,31356,18205,27244,25330,20787,0,32767,9512,31356,18205,27244,25330,20787, +30273,12539,32610,3211,32138,-6393,28898,-15447,30273,12539,32610,3211,32138,-6393,28898,-15447, +23170,-23170,15447,-28898,6393,-32138,-3211,-32610,23170,-23170,15447,-28898,6393,-32138,-3211,-32610, +-12539,-30273,-20787,-25330,-27244,-18205,-31356,-9512,-12539,-30273,-20787,-25330,-27244,-18205,-31356,-9512 }; @@ -1755,6 +2628,13 @@ int16_t tw64c[96] __attribute__((aligned(16))) = { 0,32767,3212,32609,6393,32137 #define shiftright_int16(a,shift) _mm_srai_epi16(a,shift) #define set1_int16(a) _mm_set1_epi16(a); #define mulhi_int16(a,b) _mm_slli_epi16(_mm_mulhi_epi16(a,b),1); +#ifdef __AVX2__ +#define simd256_q15_t __m256i +#define shiftright_int16_simd256(a,shift) _mm256_srai_epi16(a,shift) +#define set1_int16_simd256(a) _mm256_set1_epi16(a); +#define mulhi_int16_simd256(a,b) _mm256_slli_epi16(_mm256_mulhi_epi16(a,b),1); +#endif + #elif defined(__arm__) #define simd_q15_t int16x8_t #define simdshort_q15_t int16x4_t @@ -1763,8 +2643,10 @@ int16_t tw64c[96] __attribute__((aligned(16))) = { 0,32767,3212,32609,6393,32137 #define mulhi_int16(a,b) vqdmulhq_s16(a,b); #define _mm_empty() #define _m_empty() + #endif +#ifndef __AVX2__ void dft64(int16_t *x,int16_t *y,int scale) { @@ -1782,18 +2664,41 @@ void dft64(int16_t *x,int16_t *y,int scale) transpose16_ooff(x128,xtmp,4); + // xtmp0 = x00 x10 x20 x30 + // xtmp4 = x01 x11 x21 x31 + // xtmp8 = x02 x12 x22 x32 + // xtmp12 = x03 x13 x23 x33 transpose16_ooff(x128+4,xtmp+1,4); + // xtmp1 = x40 x50 x60 x70 + // xtmp5 = x41 x51 x61 x71 + // xtmp9 = x42 x52 x62 x72 + // xtmp13 = x43 x53 x63 x73 transpose16_ooff(x128+8,xtmp+2,4); + // xtmp2 = x80 x90 xa0 xb0 + // xtmp6 = x41 x51 x61 x71 + // xtmp10 = x82 x92 xa2 xb2 + // xtmp14 = x83 x93 xa3 xb3 transpose16_ooff(x128+12,xtmp+3,4); - + // xtmp3 = xc0 xd0 xe0 xf0 + // xtmp7 = xc1 xd1 xe1 xf1 + // xtmp11 = xc2 xd2 xe2 xf2 + // xtmp15 = xc3 xd3 xe3 xf3 #ifdef D64STATS stop_meas(&ts_t); start_meas(&ts_d); #endif - + // xtmp0 = x00 x10 x20 x30 + // xtmp1 = x40 x50 x60 x70 + // xtmp2 = x80 x90 xa0 xb0 + // xtmp3 = xc0 xd0 xe0 xf0 dft16((int16_t*)(xtmp),(int16_t*)ytmp); + + // xtmp4 = x01 x11 x21 x31 + // xtmp5 = x41 x51 x61 x71 + // xtmp6 = x81 x91 xa1 xb1 + // xtmp7 = xc1 xd1 xe1 xf1 dft16((int16_t*)(xtmp+4),(int16_t*)(ytmp+4)); dft16((int16_t*)(xtmp+8),(int16_t*)(ytmp+8)); dft16((int16_t*)(xtmp+12),(int16_t*)(ytmp+12)); @@ -1855,6 +2760,155 @@ void dft64(int16_t *x,int16_t *y,int scale) } +#else // __AVX2__ +void dft64(int16_t *x,int16_t *y,int scale) +{ + + simd256_q15_t xtmp[16],ytmp[16],*tw64a_256=(simd256_q15_t *)tw64a,*tw64b_256=(simd256_q15_t *)tw64b,*x256=(simd256_q15_t *)x,*y256=(simd256_q15_t *)y; + simd256_q15_t xintl0,xintl1,xintl2,xintl3,xintl4,xintl5,xintl6,xintl7; + simd256_q15_t const perm_mask = _mm256_set_epi32(7, 3, 5, 1, 6, 2, 4, 0); + + +#ifdef D64STATS + time_stats_t ts_t,ts_d,ts_b; + + reset_meas(&ts_t); + reset_meas(&ts_d); + reset_meas(&ts_b); + start_meas(&ts_t); +#endif + +#ifdef D64STATS + stop_meas(&ts_t); + start_meas(&ts_d); +#endif + /* + print_shorts256("x2560",(int16_t*)x256); + print_shorts256("x2561",(int16_t*)(x256+1)); + print_shorts256("x2562",(int16_t*)(x256+2)); + print_shorts256("x2563",(int16_t*)(x256+3)); + print_shorts256("x2564",(int16_t*)(x256+4)); + print_shorts256("x2565",(int16_t*)(x256+5)); + print_shorts256("x2566",(int16_t*)(x256+6)); + print_shorts256("x2567",(int16_t*)(x256+7)); + */ + xintl0 = _mm256_permutevar8x32_epi32(x256[0],perm_mask); // x0 x4 x1 x5 x2 x6 x3 x7 + xintl1 = _mm256_permutevar8x32_epi32(x256[1],perm_mask); // x8 x12 x9 x13 x10 x14 x11 x15 + xintl2 = _mm256_permutevar8x32_epi32(x256[2],perm_mask); // x16 x20 x17 x21 x18 x22 x19 x23 + xintl3 = _mm256_permutevar8x32_epi32(x256[3],perm_mask); // x24 x28 x25 x29 x26 x30 x27 x31 + xintl4 = _mm256_permutevar8x32_epi32(x256[4],perm_mask); // x32 x28 x25 x29 x26 x30 x27 x31 + xintl5 = _mm256_permutevar8x32_epi32(x256[5],perm_mask); // x40 x28 x25 x29 x26 x30 x27 x31 + xintl6 = _mm256_permutevar8x32_epi32(x256[6],perm_mask); // x48 x28 x25 x29 x26 x30 x27 x31 + xintl7 = _mm256_permutevar8x32_epi32(x256[7],perm_mask); // x56 x28 x25 x29 x26 x30 x27 x31 + /* + print_shorts256("xintl0",(int16_t*)&xintl0); + print_shorts256("xintl1",(int16_t*)&xintl1); + print_shorts256("xintl2",(int16_t*)&xintl2); + print_shorts256("xintl3",(int16_t*)&xintl3); + print_shorts256("xintl4",(int16_t*)&xintl4); + print_shorts256("xintl5",(int16_t*)&xintl5); + print_shorts256("xintl6",(int16_t*)&xintl6); + print_shorts256("xintl7",(int16_t*)&xintl7); + */ + xtmp[0] = _mm256_unpacklo_epi64(xintl0,xintl1); // x0 x4 x8 x12 x1 x5 x9 x13 + xtmp[4] = _mm256_unpackhi_epi64(xintl0,xintl1); // x2 x6 x10 x14 x3 x7 x11 x15 + xtmp[1] = _mm256_unpacklo_epi64(xintl2,xintl3); // x16 x20 x24 x28 x17 x21 x25 x29 + xtmp[5] = _mm256_unpackhi_epi64(xintl2,xintl3); // x18 x22 x26 x30 x19 x23 x27 x31 + xtmp[2] = _mm256_unpacklo_epi64(xintl4,xintl5); // x32 x36 x40 x44 x33 x37 x41 x45 + xtmp[6] = _mm256_unpackhi_epi64(xintl4,xintl5); // x34 x38 x42 x46 x35 x39 x43 x47 + xtmp[3] = _mm256_unpacklo_epi64(xintl6,xintl7); // x48 x52 x56 x60 x49 x53 x57 x61 + xtmp[7] = _mm256_unpackhi_epi64(xintl6,xintl7); // x50 x54 x58 x62 x51 x55 x59 x63 + /* + print_shorts256("xtmp0",(int16_t*)xtmp); + print_shorts256("xtmp1",(int16_t*)(xtmp+1)); + print_shorts256("xtmp2",(int16_t*)(xtmp+2)); + print_shorts256("xtmp3",(int16_t*)(xtmp+3)); + print_shorts256("xtmp4",(int16_t*)(xtmp+4)); + print_shorts256("xtmp5",(int16_t*)(xtmp+5)); + print_shorts256("xtmp6",(int16_t*)(xtmp+6)); + print_shorts256("xtmp7",(int16_t*)(xtmp+7)); + */ + dft16_simd256((int16_t*)(xtmp),(int16_t*)ytmp); + // [y0 y1 y2 y3 y4 y5 y6 y7] + // [y8 y9 y10 y11 y12 y13 y14 y15] + // [y16 y17 y18 y19 y20 y21 y22 y23] + // [y24 y25 y26 y27 y28 y29 y30 y31] + /* + print_shorts256("ytmp0",(int16_t*)ytmp); + print_shorts256("ytmp1",(int16_t*)(ytmp+1)); + print_shorts256("ytmp2",(int16_t*)(ytmp+2)); + print_shorts256("ytmp3",(int16_t*)(ytmp+3)); + */ + dft16_simd256((int16_t*)(xtmp+4),(int16_t*)(ytmp+4)); + // [y32 y33 y34 y35 y36 y37 y38 y39] + // [y40 y41 y42 y43 y44 y45 y46 y47] + // [y48 y49 y50 y51 y52 y53 y54 y55] + // [y56 y57 y58 y59 y60 y61 y62 y63] + /* + print_shorts256("ytmp4",(int16_t*)(ytmp+4)); + print_shorts256("ytmp5",(int16_t*)(ytmp+5)); + print_shorts256("ytmp6",(int16_t*)(ytmp+6)); + print_shorts256("ytmp7",(int16_t*)(ytmp+7)); + */ +#ifdef D64STATS + stop_meas(&ts_d); + start_meas(&ts_b); +#endif + + + bfly4_16_256(ytmp,ytmp+2,ytmp+4,ytmp+6, + y256,y256+2,y256+4,y256+6, + tw64a_256,tw64a_256+2,tw64a_256+4, + tw64b_256,tw64b_256+2,tw64b_256+4); + // [y0 y1 y2 y3 y4 y5 y6 y7] + // [y16 y17 y18 y19 y20 y21 y22 y23] + // [y32 y33 y34 y35 y36 y37 y38 y39] + // [y48 y49 y50 y51 y52 y53 y54 y55] + + bfly4_16_256(ytmp+1,ytmp+3,ytmp+5,ytmp+7, + y256+1,y256+3,y256+5,y256+7, + tw64a_256+1,tw64a_256+3,tw64a_256+5, + tw64b_256+1,tw64b_256+3,tw64b_256+5); + // [y8 y9 y10 y11 y12 y13 y14 y15] + // [y24 y25 y26 y27 y28 y29 y30 y31] + // [y40 y41 y42 y43 y44 y45 y46 y47] + // [y56 y57 y58 y59 y60 y61 y62 y63] + /* + print_shorts256("y256_0",(int16_t*)&y256[0]); + print_shorts256("y256_1",(int16_t*)&y256[1]); + print_shorts256("y256_2",(int16_t*)&y256[2]); + print_shorts256("y256_3",(int16_t*)&y256[3]); + print_shorts256("y256_4",(int16_t*)&y256[4]); + print_shorts256("y256_5",(int16_t*)&y256[5]); + print_shorts256("y256_6",(int16_t*)&y256[6]); + print_shorts256("y256_7",(int16_t*)&y256[7]); + */ + +#ifdef D64STATS + stop_meas(&ts_b); + printf("t: %llu cycles, d: %llu cycles, b: %llu cycles\n",ts_t.diff,ts_d.diff,ts_b.diff); +#endif + + + if (scale>0) { + y256[0] = shiftright_int16_simd256(y256[0],3); + y256[1] = shiftright_int16_simd256(y256[1],3); + y256[2] = shiftright_int16_simd256(y256[2],3); + y256[3] = shiftright_int16_simd256(y256[3],3); + y256[4] = shiftright_int16_simd256(y256[4],3); + y256[5] = shiftright_int16_simd256(y256[5],3); + y256[6] = shiftright_int16_simd256(y256[6],3); + y256[7] = shiftright_int16_simd256(y256[7],3); + } + + _mm_empty(); + _m_empty(); + + +} +#endif + +#ifndef __AVX2__ void idft64(int16_t *x,int16_t *y,int scale) { @@ -1899,7 +2953,6 @@ void idft64(int16_t *x,int16_t *y,int scale) y128,y128+4,y128+8,y128+12, tw64a_128,tw64a_128+4,tw64a_128+8, tw64b_128,tw64b_128+4,tw64b_128+8); - ibfly4_16(ytmp+1,ytmp+5,ytmp+9,ytmp+13, y128+1,y128+5,y128+9,y128+13, tw64a_128+1,tw64a_128+5,tw64a_128+9, @@ -1947,15 +3000,117 @@ void idft64(int16_t *x,int16_t *y,int scale) } +#else // __AVX2__ +void idft64(int16_t *x,int16_t *y,int scale) +{ -int16_t tw128[128] __attribute__((aligned(16))) = { 32767,0,32727,-1608,32609,-3212,32412,-4808,32137,-6393,31785,-7962,31356,-9512,30851,-11039,30272,-12540,29621,-14010,28897,-15447,28105,-16846,27244,-18205,26318,-19520,25329,-20788,24278,-22005,23169,-23170,22004,-24279,20787,-25330,19519,-26319,18204,-27245,16845,-28106,15446,-28898,14009,-29622,12539,-30273,11038,-30852,9511,-31357,7961,-31786,6392,-32138,4807,-32413,3211,-32610,1607,-32728,0,-32767,-1608,-32728,-3212,-32610,-4808,-32413,-6393,-32138,-7962,-31786,-9512,-31357,-11039,-30852,-12540,-30273,-14010,-29622,-15447,-28898,-16846,-28106,-18205,-27245,-19520,-26319,-20788,-25330,-22005,-24279,-23170,-23170,-24279,-22005,-25330,-20788,-26319,-19520,-27245,-18205,-28106,-16846,-28898,-15447,-29622,-14010,-30273,-12540,-30852,-11039,-31357,-9512,-31786,-7962,-32138,-6393,-32413,-4808,-32610,-3212,-32728,-1608}; + simd256_q15_t xtmp[16],ytmp[16],*tw64a_256=(simd256_q15_t *)tw64,*tw64b_256=(simd256_q15_t *)tw64c,*x256=(simd256_q15_t *)x,*y256=(simd256_q15_t *)y; + register simd256_q15_t xintl0,xintl1,xintl2,xintl3,xintl4,xintl5,xintl6,xintl7; + simd256_q15_t const perm_mask = _mm256_set_epi32(7, 3, 5, 1, 6, 2, 4, 0); -int16_t tw128a[128] __attribute__((aligned(16))) = { 32767,0,32727,1608,32609,3212,32412,4808,32137,6393,31785,7962,31356,9512,30851,11039,30272,12540,29621,14010,28897,15447,28105,16846,27244,18205,26318,19520,25329,20788,24278,22005,23169,23170,22004,24279,20787,25330,19519,26319,18204,27245,16845,28106,15446,28898,14009,29622,12539,30273,11038,30852,9511,31357,7961,31786,6392,32138,4807,32413,3211,32610,1607,32728,0,32767,-1608,32728,-3212,32610,-4808,32413,-6393,32138,-7962,31786,-9512,31357,-11039,30852,-12540,30273,-14010,29622,-15447,28898,-16846,28106,-18205,27245,-19520,26319,-20788,25330,-22005,24279,-23170,23170,-24279,22005,-25330,20788,-26319,19520,-27245,18205,-28106,16846,-28898,15447,-29622,14010,-30273,12540,-30852,11039,-31357,9512,-31786,7962,-32138,6393,-32413,4808,-32610,3212,-32728,1608}; -int16_t tw128b[128] __attribute__((aligned(16))) = {0,32767,-1608,32727,-3212,32609,-4808,32412,-6393,32137,-7962,31785,-9512,31356,-11039,30851,-12540,30272,-14010,29621,-15447,28897,-16846,28105,-18205,27244,-19520,26318,-20788,25329,-22005,24278,-23170,23169,-24279,22004,-25330,20787,-26319,19519,-27245,18204,-28106,16845,-28898,15446,-29622,14009,-30273,12539,-30852,11038,-31357,9511,-31786,7961,-32138,6392,-32413,4807,-32610,3211,-32728,1607,-32767,0,-32728,-1608,-32610,-3212,-32413,-4808,-32138,-6393,-31786,-7962,-31357,-9512,-30852,-11039,-30273,-12540,-29622,-14010,-28898,-15447,-28106,-16846,-27245,-18205,-26319,-19520,-25330,-20788,-24279,-22005,-23170,-23170,-22005,-24279,-20788,-25330,-19520,-26319,-18205,-27245,-16846,-28106,-15447,-28898,-14010,-29622,-12540,-30273,-11039,-30852,-9512,-31357,-7962,-31786,-6393,-32138,-4808,-32413,-3212,-32610,-1608,-32728}; +#ifdef D64STATS + time_stats_t ts_t,ts_d,ts_b; + + reset_meas(&ts_t); + reset_meas(&ts_d); + reset_meas(&ts_b); + start_meas(&ts_t); +#endif + +#ifdef D64STATS + stop_meas(&ts_t); + start_meas(&ts_d); +#endif + + xintl0 = _mm256_permutevar8x32_epi32(x256[0],perm_mask); // x0 x4 x1 x5 x2 x6 x3 x7 + xintl1 = _mm256_permutevar8x32_epi32(x256[1],perm_mask); // x8 x12 x9 x13 x10 x14 x11 x15 + xintl2 = _mm256_permutevar8x32_epi32(x256[2],perm_mask); // x16 x20 x17 x21 x18 x22 x19 x23 + xintl3 = _mm256_permutevar8x32_epi32(x256[3],perm_mask); // x24 x28 x25 x29 x26 x30 x27 x31 + xintl4 = _mm256_permutevar8x32_epi32(x256[4],perm_mask); // x24 x28 x25 x29 x26 x30 x27 x31 + xintl5 = _mm256_permutevar8x32_epi32(x256[5],perm_mask); // x24 x28 x25 x29 x26 x30 x27 x31 + xintl6 = _mm256_permutevar8x32_epi32(x256[6],perm_mask); // x24 x28 x25 x29 x26 x30 x27 x31 + xintl7 = _mm256_permutevar8x32_epi32(x256[7],perm_mask); // x24 x28 x25 x29 x26 x30 x27 x31 + + xtmp[0] = _mm256_unpacklo_epi64(xintl0,xintl1); // x0 x4 x8 x12 x1 x5 x9 x13 + xtmp[4] = _mm256_unpackhi_epi64(xintl0,xintl1); // x2 x6 x10 x14 x3 x7 x11 x15 + xtmp[1] = _mm256_unpacklo_epi64(xintl2,xintl3); // x16 x20 x24 x28 x17 x21 x25 x29 + xtmp[5] = _mm256_unpackhi_epi64(xintl2,xintl3); // x18 x22 x26 x30 x19 x23 x27 x31 + xtmp[2] = _mm256_unpacklo_epi64(xintl4,xintl5); // x32 x36 x40 x44 x33 x37 x41 x45 + xtmp[6] = _mm256_unpackhi_epi64(xintl4,xintl5); // x34 x38 x42 x46 x35 x39 x43 x47 + xtmp[3] = _mm256_unpacklo_epi64(xintl6,xintl7); // x48 x52 x56 x60 x49 x53 x57 x61 + xtmp[7] = _mm256_unpackhi_epi64(xintl6,xintl7); // x50 x54 x58 x62 x51 x55 x59 x63 + + + idft16_simd256((int16_t*)(xtmp),(int16_t*)ytmp); + // [y0 y1 y2 y3 y16 y17 y18 y19] + // [y4 y5 y6 y7 y20 y21 y22 y23] + // [y8 y9 y10 y11 y24 y25 y26 y27] + // [y12 y13 y14 y15 y28 y29 y30 y31] + + idft16_simd256((int16_t*)(xtmp+4),(int16_t*)(ytmp+4)); + // [y32 y33 y34 y35 y48 y49 y50 y51] + // [y36 y37 y38 y39 y52 y53 y54 y55] + // [y40 y41 y42 y43 y56 y57 y58 y59] + // [y44 y45 y46 y47 y60 y61 y62 y63] -int16_t tw128c[128] __attribute__((aligned(16))) = {0,32767,1608,32727,3212,32609,4808,32412,6393,32137,7962,31785,9512,31356,11039,30851,12540,30272,14010,29621,15447,28897,16846,28105,18205,27244,19520,26318,20788,25329,22005,24278,23170,23169,24279,22004,25330,20787,26319,19519,27245,18204,28106,16845,28898,15446,29622,14009,30273,12539,30852,11038,31357,9511,31786,7961,32138,6392,32413,4807,32610,3211,32728,1607,32767,0,32728,-1608,32610,-3212,32413,-4808,32138,-6393,31786,-7962,31357,-9512,30852,-11039,30273,-12540,29622,-14010,28898,-15447,28106,-16846,27245,-18205,26319,-19520,25330,-20788,24279,-22005,23170,-23170,22005,-24279,20788,-25330,19520,-26319,18205,-27245,16846,-28106,15447,-28898,14010,-29622,12540,-30273,11039,-30852,9512,-31357,7962,-31786,6393,-32138,4808,-32413,3212,-32610,1608,-32728}; +#ifdef D64STATS + stop_meas(&ts_d); + start_meas(&ts_b); +#endif + + + ibfly4_16_256(ytmp,ytmp+2,ytmp+4,ytmp+6, + y256,y256+2,y256+4,y256+6, + tw64a_256,tw64a_256+2,tw64a_256+4, + tw64b_256,tw64b_256+2,tw64b_256+4); + // [y0 y1 y2 y3 y4 y5 y6 y7] + // [y16 y17 y18 y19 y20 y21 y22 y23] + // [y32 y33 y34 y35 y36 y37 y38 y39] + // [y48 y49 y50 y51 y52 y53 y54 y55] + + ibfly4_16_256(ytmp+1,ytmp+3,ytmp+5,ytmp+7, + y256+1,y256+3,y256+5,y256+7, + tw64a_256+1,tw64a_256+3,tw64a_256+5, + tw64b_256+1,tw64b_256+3,tw64b_256+5); + // [y8 y9 y10 y11 y12 y13 y14 y15] + // [y24 y25 y26 y27 y28 y29 y30 y31] + // [y40 y41 y42 y43 y44 y45 y46 y47] + // [y56 y57 y58 y59 y60 y61 y62 y63] + + +#ifdef D64STATS + stop_meas(&ts_b); + printf("t: %llu cycles, d: %llu cycles, b: %llu cycles\n",ts_t.diff,ts_d.diff,ts_b.diff); +#endif + + if (scale>0) { + y256[0] = shiftright_int16_simd256(y256[0],3); + y256[1] = shiftright_int16_simd256(y256[1],3); + y256[2] = shiftright_int16_simd256(y256[2],3); + y256[3] = shiftright_int16_simd256(y256[3],3); + y256[4] = shiftright_int16_simd256(y256[4],3); + y256[5] = shiftright_int16_simd256(y256[5],3); + y256[6] = shiftright_int16_simd256(y256[6],3); + y256[7] = shiftright_int16_simd256(y256[7],3); + } + + _mm_empty(); + _m_empty(); + +} +#endif + +int16_t tw128[128] __attribute__((aligned(32))) = { 32767,0,32727,-1608,32609,-3212,32412,-4808,32137,-6393,31785,-7962,31356,-9512,30851,-11039,30272,-12540,29621,-14010,28897,-15447,28105,-16846,27244,-18205,26318,-19520,25329,-20788,24278,-22005,23169,-23170,22004,-24279,20787,-25330,19519,-26319,18204,-27245,16845,-28106,15446,-28898,14009,-29622,12539,-30273,11038,-30852,9511,-31357,7961,-31786,6392,-32138,4807,-32413,3211,-32610,1607,-32728,0,-32767,-1608,-32728,-3212,-32610,-4808,-32413,-6393,-32138,-7962,-31786,-9512,-31357,-11039,-30852,-12540,-30273,-14010,-29622,-15447,-28898,-16846,-28106,-18205,-27245,-19520,-26319,-20788,-25330,-22005,-24279,-23170,-23170,-24279,-22005,-25330,-20788,-26319,-19520,-27245,-18205,-28106,-16846,-28898,-15447,-29622,-14010,-30273,-12540,-30852,-11039,-31357,-9512,-31786,-7962,-32138,-6393,-32413,-4808,-32610,-3212,-32728,-1608}; + +int16_t tw128a[128] __attribute__((aligned(32))) = { 32767,0,32727,1608,32609,3212,32412,4808,32137,6393,31785,7962,31356,9512,30851,11039,30272,12540,29621,14010,28897,15447,28105,16846,27244,18205,26318,19520,25329,20788,24278,22005,23169,23170,22004,24279,20787,25330,19519,26319,18204,27245,16845,28106,15446,28898,14009,29622,12539,30273,11038,30852,9511,31357,7961,31786,6392,32138,4807,32413,3211,32610,1607,32728,0,32767,-1608,32728,-3212,32610,-4808,32413,-6393,32138,-7962,31786,-9512,31357,-11039,30852,-12540,30273,-14010,29622,-15447,28898,-16846,28106,-18205,27245,-19520,26319,-20788,25330,-22005,24279,-23170,23170,-24279,22005,-25330,20788,-26319,19520,-27245,18205,-28106,16846,-28898,15447,-29622,14010,-30273,12540,-30852,11039,-31357,9512,-31786,7962,-32138,6393,-32413,4808,-32610,3212,-32728,1608}; + +int16_t tw128b[128] __attribute__((aligned(32))) = {0,32767,-1608,32727,-3212,32609,-4808,32412,-6393,32137,-7962,31785,-9512,31356,-11039,30851,-12540,30272,-14010,29621,-15447,28897,-16846,28105,-18205,27244,-19520,26318,-20788,25329,-22005,24278,-23170,23169,-24279,22004,-25330,20787,-26319,19519,-27245,18204,-28106,16845,-28898,15446,-29622,14009,-30273,12539,-30852,11038,-31357,9511,-31786,7961,-32138,6392,-32413,4807,-32610,3211,-32728,1607,-32767,0,-32728,-1608,-32610,-3212,-32413,-4808,-32138,-6393,-31786,-7962,-31357,-9512,-30852,-11039,-30273,-12540,-29622,-14010,-28898,-15447,-28106,-16846,-27245,-18205,-26319,-19520,-25330,-20788,-24279,-22005,-23170,-23170,-22005,-24279,-20788,-25330,-19520,-26319,-18205,-27245,-16846,-28106,-15447,-28898,-14010,-29622,-12540,-30273,-11039,-30852,-9512,-31357,-7962,-31786,-6393,-32138,-4808,-32413,-3212,-32610,-1608,-32728}; + +int16_t tw128c[128] __attribute__((aligned(32))) = {0,32767,1608,32727,3212,32609,4808,32412,6393,32137,7962,31785,9512,31356,11039,30851,12540,30272,14010,29621,15447,28897,16846,28105,18205,27244,19520,26318,20788,25329,22005,24278,23170,23169,24279,22004,25330,20787,26319,19519,27245,18204,28106,16845,28898,15446,29622,14009,30273,12539,30852,11038,31357,9511,31786,7961,32138,6392,32413,4807,32610,3211,32728,1607,32767,0,32728,-1608,32610,-3212,32413,-4808,32138,-6393,31786,-7962,31357,-9512,30852,-11039,30273,-12540,29622,-14010,28898,-15447,28106,-16846,27245,-18205,26319,-19520,25330,-20788,24279,-22005,23170,-23170,22005,-24279,20788,-25330,19520,-26319,18205,-27245,16846,-28106,15447,-28898,14010,-29622,12540,-30273,11039,-30852,9512,-31357,7962,-31786,6393,-32138,4808,-32413,3212,-32610,1608,-32728}; + +#ifndef __AVX2__ void dft128(int16_t *x,int16_t *y,int scale) { @@ -2002,6 +3157,8 @@ void dft128(int16_t *x,int16_t *y,int scale) dft64((int16_t*)(xtmp),(int16_t*)ytmp,1); dft64((int16_t*)(xtmp+32),(int16_t*)(ytmp+16),1); + /* write_output("dft128a.m","dfta",ytmp,64,1,1); + write_output("dft128b.m","dftb",ytmp+16,64,1,1);*/ for (i=0; i<16; i++) { bfly2_16(ytmpp,ytmpp+16, @@ -2052,11 +3209,83 @@ void dft128(int16_t *x,int16_t *y,int scale) } + /* write_output("dft128out.m","dft128",y,128,1,1); + exit(-1);*/ _mm_empty(); _m_empty(); } +#else // __AVX2__ +void dft128(int16_t *x,int16_t *y,int scale) +{ + + simd256_q15_t xtmp[16],*x256 = (simd256_q15_t *)x; + simd256_q15_t ytmp[16],*y256=(simd256_q15_t*)y; + simd256_q15_t *tw128a_256p=(simd256_q15_t *)tw128a,*tw128b_256p=(simd256_q15_t *)tw128b,*y256p=(simd256_q15_t *)y; + simd256_q15_t *ytmpp = &ytmp[0]; + int i; + simd256_q15_t ONE_OVER_SQRT2_Q15_256 = set1_int16_simd256(ONE_OVER_SQRT2_Q15); + + transpose4_ooff_simd256(x256 ,xtmp,8); + transpose4_ooff_simd256(x256+2,xtmp+1,8); + transpose4_ooff_simd256(x256+4,xtmp+2,8); + transpose4_ooff_simd256(x256+6,xtmp+3,8); + transpose4_ooff_simd256(x256+8,xtmp+4,8); + transpose4_ooff_simd256(x256+10,xtmp+5,8); + transpose4_ooff_simd256(x256+12,xtmp+6,8); + transpose4_ooff_simd256(x256+14,xtmp+7,8); + + /* write_output("dft128ina_256.m","dftina",xtmp,64,1,1); + write_output("dft128inb_256.m","dftinb",xtmp+8,64,1,1); + */ + + dft64((int16_t*)(xtmp),(int16_t*)ytmp,1); + dft64((int16_t*)(xtmp+8),(int16_t*)(ytmp+8),1); + + /*write_output("dft128outa_256.m","dftouta",ytmp,64,1,1); + write_output("dft128outb_256.m","dftoutb",ytmp+8,64,1,1); + */ + + for (i=0; i<8; i++) { + bfly2_16_256(ytmpp,ytmpp+8, + y256p,y256p+8, + tw128a_256p, + tw128b_256p); + tw128a_256p++; + tw128b_256p++; + y256p++; + ytmpp++; + } + + if (scale>0) { + + y256[0] = mulhi_int16_simd256(y256[0],ONE_OVER_SQRT2_Q15_256); + y256[1] = mulhi_int16_simd256(y256[1],ONE_OVER_SQRT2_Q15_256); + y256[2] = mulhi_int16_simd256(y256[2],ONE_OVER_SQRT2_Q15_256); + y256[3] = mulhi_int16_simd256(y256[3],ONE_OVER_SQRT2_Q15_256); + y256[4] = mulhi_int16_simd256(y256[4],ONE_OVER_SQRT2_Q15_256); + y256[5] = mulhi_int16_simd256(y256[5],ONE_OVER_SQRT2_Q15_256); + y256[6] = mulhi_int16_simd256(y256[6],ONE_OVER_SQRT2_Q15_256); + y256[7] = mulhi_int16_simd256(y256[7],ONE_OVER_SQRT2_Q15_256); + y256[8] = mulhi_int16_simd256(y256[8],ONE_OVER_SQRT2_Q15_256); + y256[9] = mulhi_int16_simd256(y256[9],ONE_OVER_SQRT2_Q15_256); + y256[10] = mulhi_int16_simd256(y256[10],ONE_OVER_SQRT2_Q15_256); + y256[11] = mulhi_int16_simd256(y256[11],ONE_OVER_SQRT2_Q15_256); + y256[12] = mulhi_int16_simd256(y256[12],ONE_OVER_SQRT2_Q15_256); + y256[13] = mulhi_int16_simd256(y256[13],ONE_OVER_SQRT2_Q15_256); + y256[14] = mulhi_int16_simd256(y256[14],ONE_OVER_SQRT2_Q15_256); + y256[15] = mulhi_int16_simd256(y256[15],ONE_OVER_SQRT2_Q15_256); + + } + + /* write_output("dft128.m","dft",y256,128,1,1); + exit(-1);*/ +} + +#endif + +#ifndef __AVX2__ void idft128(int16_t *x,int16_t *y,int scale) { @@ -2155,22 +3384,80 @@ void idft128(int16_t *x,int16_t *y,int scale) } +#else // __AVX2__ +void idft128(int16_t *x,int16_t *y,int scale) +{ + + simd256_q15_t xtmp[16],*x256 = (simd256_q15_t *)x; + simd256_q15_t ytmp[16],*y256=(simd256_q15_t*)y; + simd256_q15_t *tw128_256p=(simd256_q15_t *)tw128,*y256p=(simd256_q15_t *)y; + simd256_q15_t *ytmpp = &ytmp[0]; + int i; + simd256_q15_t ONE_OVER_SQRT2_Q15_256 = set1_int16_simd256(ONE_OVER_SQRT2_Q15); + + + transpose4_ooff_simd256(x256 ,xtmp,8); + transpose4_ooff_simd256(x256+2,xtmp+1,8); + transpose4_ooff_simd256(x256+4,xtmp+2,8); + transpose4_ooff_simd256(x256+6,xtmp+3,8); + transpose4_ooff_simd256(x256+8,xtmp+4,8); + transpose4_ooff_simd256(x256+10,xtmp+5,8); + transpose4_ooff_simd256(x256+12,xtmp+6,8); + transpose4_ooff_simd256(x256+14,xtmp+7,8); + + idft64((int16_t*)(xtmp),(int16_t*)ytmp,1); + idft64((int16_t*)(xtmp+8),(int16_t*)(ytmp+8),1); + + + for (i=0; i<8; i++) { + ibfly2_256(ytmpp,ytmpp+8, + y256p,y256p+8, + tw128_256p); + tw128_256p++; + y256p++; + ytmpp++; + } + + if (scale>0) { + + y256[0] = mulhi_int16_simd256(y256[0],ONE_OVER_SQRT2_Q15_256); + y256[1] = mulhi_int16_simd256(y256[1],ONE_OVER_SQRT2_Q15_256); + y256[2] = mulhi_int16_simd256(y256[2],ONE_OVER_SQRT2_Q15_256); + y256[3] = mulhi_int16_simd256(y256[3],ONE_OVER_SQRT2_Q15_256); + y256[4] = mulhi_int16_simd256(y256[4],ONE_OVER_SQRT2_Q15_256); + y256[5] = mulhi_int16_simd256(y256[5],ONE_OVER_SQRT2_Q15_256); + y256[6] = mulhi_int16_simd256(y256[6],ONE_OVER_SQRT2_Q15_256); + y256[7] = mulhi_int16_simd256(y256[7],ONE_OVER_SQRT2_Q15_256); + y256[8] = mulhi_int16_simd256(y256[8],ONE_OVER_SQRT2_Q15_256); + y256[9] = mulhi_int16_simd256(y256[9],ONE_OVER_SQRT2_Q15_256); + y256[10] = mulhi_int16_simd256(y256[10],ONE_OVER_SQRT2_Q15_256); + y256[11] = mulhi_int16_simd256(y256[11],ONE_OVER_SQRT2_Q15_256); + y256[12] = mulhi_int16_simd256(y256[12],ONE_OVER_SQRT2_Q15_256); + y256[13] = mulhi_int16_simd256(y256[13],ONE_OVER_SQRT2_Q15_256); + y256[14] = mulhi_int16_simd256(y256[14],ONE_OVER_SQRT2_Q15_256); + y256[15] = mulhi_int16_simd256(y256[15],ONE_OVER_SQRT2_Q15_256); + + } + +} + +#endif -int16_t tw256[384] __attribute__((aligned(16))) = { 32767,0,32757,-805,32727,-1608,32678,-2411,32609,-3212,32520,-4012,32412,-4808,32284,-5602,32137,-6393,31970,-7180,31785,-7962,31580,-8740,31356,-9512,31113,-10279,30851,-11039,30571,-11793,30272,-12540,29955,-13279,29621,-14010,29268,-14733,28897,-15447,28510,-16151,28105,-16846,27683,-17531,27244,-18205,26789,-18868,26318,-19520,25831,-20160,25329,-20788,24811,-21403,24278,-22005,23731,-22595,23169,-23170,22594,-23732,22004,-24279,21402,-24812,20787,-25330,20159,-25832,19519,-26319,18867,-26790,18204,-27245,17530,-27684,16845,-28106,16150,-28511,15446,-28898,14732,-29269,14009,-29622,13278,-29956,12539,-30273,11792,-30572,11038,-30852,10278,-31114,9511,-31357,8739,-31581,7961,-31786,7179,-31971,6392,-32138,5601,-32285,4807,-32413,4011,-32521,3211,-32610,2410,-32679,1607,-32728,804,-32758, +int16_t tw256[384] __attribute__((aligned(32))) = { 32767,0,32757,-805,32727,-1608,32678,-2411,32609,-3212,32520,-4012,32412,-4808,32284,-5602,32137,-6393,31970,-7180,31785,-7962,31580,-8740,31356,-9512,31113,-10279,30851,-11039,30571,-11793,30272,-12540,29955,-13279,29621,-14010,29268,-14733,28897,-15447,28510,-16151,28105,-16846,27683,-17531,27244,-18205,26789,-18868,26318,-19520,25831,-20160,25329,-20788,24811,-21403,24278,-22005,23731,-22595,23169,-23170,22594,-23732,22004,-24279,21402,-24812,20787,-25330,20159,-25832,19519,-26319,18867,-26790,18204,-27245,17530,-27684,16845,-28106,16150,-28511,15446,-28898,14732,-29269,14009,-29622,13278,-29956,12539,-30273,11792,-30572,11038,-30852,10278,-31114,9511,-31357,8739,-31581,7961,-31786,7179,-31971,6392,-32138,5601,-32285,4807,-32413,4011,-32521,3211,-32610,2410,-32679,1607,-32728,804,-32758, 32767,0,32727,-1608,32609,-3212,32412,-4808,32137,-6393,31785,-7962,31356,-9512,30851,-11039,30272,-12540,29621,-14010,28897,-15447,28105,-16846,27244,-18205,26318,-19520,25329,-20788,24278,-22005,23169,-23170,22004,-24279,20787,-25330,19519,-26319,18204,-27245,16845,-28106,15446,-28898,14009,-29622,12539,-30273,11038,-30852,9511,-31357,7961,-31786,6392,-32138,4807,-32413,3211,-32610,1607,-32728,0,-32767,-1608,-32728,-3212,-32610,-4808,-32413,-6393,-32138,-7962,-31786,-9512,-31357,-11039,-30852,-12540,-30273,-14010,-29622,-15447,-28898,-16846,-28106,-18205,-27245,-19520,-26319,-20788,-25330,-22005,-24279,-23170,-23170,-24279,-22005,-25330,-20788,-26319,-19520,-27245,-18205,-28106,-16846,-28898,-15447,-29622,-14010,-30273,-12540,-30852,-11039,-31357,-9512,-31786,-7962,-32138,-6393,-32413,-4808,-32610,-3212,-32728,-1608, 32767,0,32678,-2411,32412,-4808,31970,-7180,31356,-9512,30571,-11793,29621,-14010,28510,-16151,27244,-18205,25831,-20160,24278,-22005,22594,-23732,20787,-25330,18867,-26790,16845,-28106,14732,-29269,12539,-30273,10278,-31114,7961,-31786,5601,-32285,3211,-32610,804,-32758,-1608,-32728,-4012,-32521,-6393,-32138,-8740,-31581,-11039,-30852,-13279,-29956,-15447,-28898,-17531,-27684,-19520,-26319,-21403,-24812,-23170,-23170,-24812,-21403,-26319,-19520,-27684,-17531,-28898,-15447,-29956,-13279,-30852,-11039,-31581,-8740,-32138,-6393,-32521,-4012,-32728,-1608,-32758,804,-32610,3211,-32285,5601,-31786,7961,-31114,10278,-30273,12539,-29269,14732,-28106,16845,-26790,18867,-25330,20787,-23732,22594,-22005,24278,-20160,25831,-18205,27244,-16151,28510,-14010,29621,-11793,30571,-9512,31356,-7180,31970,-4808,32412,-2411,32678 }; -int16_t tw256a[384] __attribute__((aligned(16))) = { 32767,0,32757,804,32727,1607,32678,2410,32609,3211,32520,4011,32412,4807,32284,5601,32137,6392,31970,7179,31785,7961,31580,8739,31356,9511,31113,10278,30851,11038,30571,11792,30272,12539,29955,13278,29621,14009,29268,14732,28897,15446,28510,16150,28105,16845,27683,17530,27244,18204,26789,18867,26318,19519,25831,20159,25329,20787,24811,21402,24278,22004,23731,22594,23169,23169,22594,23731,22004,24278,21402,24811,20787,25329,20159,25831,19519,26318,18867,26789,18204,27244,17530,27683,16845,28105,16150,28510,15446,28897,14732,29268,14009,29621,13278,29955,12539,30272,11792,30571,11038,30851,10278,31113,9511,31356,8739,31580,7961,31785,7179,31970,6392,32137,5601,32284,4807,32412,4011,32520,3211,32609,2410,32678,1607,32727,804,32757, +int16_t tw256a[384] __attribute__((aligned(32))) = { 32767,0,32757,804,32727,1607,32678,2410,32609,3211,32520,4011,32412,4807,32284,5601,32137,6392,31970,7179,31785,7961,31580,8739,31356,9511,31113,10278,30851,11038,30571,11792,30272,12539,29955,13278,29621,14009,29268,14732,28897,15446,28510,16150,28105,16845,27683,17530,27244,18204,26789,18867,26318,19519,25831,20159,25329,20787,24811,21402,24278,22004,23731,22594,23169,23169,22594,23731,22004,24278,21402,24811,20787,25329,20159,25831,19519,26318,18867,26789,18204,27244,17530,27683,16845,28105,16150,28510,15446,28897,14732,29268,14009,29621,13278,29955,12539,30272,11792,30571,11038,30851,10278,31113,9511,31356,8739,31580,7961,31785,7179,31970,6392,32137,5601,32284,4807,32412,4011,32520,3211,32609,2410,32678,1607,32727,804,32757, 32767,0,32727,1607,32609,3211,32412,4807,32137,6392,31785,7961,31356,9511,30851,11038,30272,12539,29621,14009,28897,15446,28105,16845,27244,18204,26318,19519,25329,20787,24278,22004,23169,23169,22004,24278,20787,25329,19519,26318,18204,27244,16845,28105,15446,28897,14009,29621,12539,30272,11038,30851,9511,31356,7961,31785,6392,32137,4807,32412,3211,32609,1607,32727,0,32767,-1608,32727,-3212,32609,-4808,32412,-6393,32137,-7962,31785,-9512,31356,-11039,30851,-12540,30272,-14010,29621,-15447,28897,-16846,28105,-18205,27244,-19520,26318,-20788,25329,-22005,24278,-23170,23169,-24279,22004,-25330,20787,-26319,19519,-27245,18204,-28106,16845,-28898,15446,-29622,14009,-30273,12539,-30852,11038,-31357,9511,-31786,7961,-32138,6392,-32413,4807,-32610,3211,-32728,1607, 32767,0,32678,2410,32412,4807,31970,7179,31356,9511,30571,11792,29621,14009,28510,16150,27244,18204,25831,20159,24278,22004,22594,23731,20787,25329,18867,26789,16845,28105,14732,29268,12539,30272,10278,31113,7961,31785,5601,32284,3211,32609,804,32757,-1608,32727,-4012,32520,-6393,32137,-8740,31580,-11039,30851,-13279,29955,-15447,28897,-17531,27683,-19520,26318,-21403,24811,-23170,23169,-24812,21402,-26319,19519,-27684,17530,-28898,15446,-29956,13278,-30852,11038,-31581,8739,-32138,6392,-32521,4011,-32728,1607,-32758,-805,-32610,-3212,-32285,-5602,-31786,-7962,-31114,-10279,-30273,-12540,-29269,-14733,-28106,-16846,-26790,-18868,-25330,-20788,-23732,-22595,-22005,-24279,-20160,-25832,-18205,-27245,-16151,-28511,-14010,-29622,-11793,-30572,-9512,-31357,-7180,-31971,-4808,-32413,-2411,-32679 }; -int16_t tw256b[384] __attribute__((aligned(16))) = {0,32767,-805,32757,-1608,32727,-2411,32678,-3212,32609,-4012,32520,-4808,32412,-5602,32284,-6393,32137,-7180,31970,-7962,31785,-8740,31580,-9512,31356,-10279,31113,-11039,30851,-11793,30571,-12540,30272,-13279,29955,-14010,29621,-14733,29268,-15447,28897,-16151,28510,-16846,28105,-17531,27683,-18205,27244,-18868,26789,-19520,26318,-20160,25831,-20788,25329,-21403,24811,-22005,24278,-22595,23731,-23170,23169,-23732,22594,-24279,22004,-24812,21402,-25330,20787,-25832,20159,-26319,19519,-26790,18867,-27245,18204,-27684,17530,-28106,16845,-28511,16150,-28898,15446,-29269,14732,-29622,14009,-29956,13278,-30273,12539,-30572,11792,-30852,11038,-31114,10278,-31357,9511,-31581,8739,-31786,7961,-31971,7179,-32138,6392,-32285,5601,-32413,4807,-32521,4011,-32610,3211,-32679,2410,-32728,1607,-32758,804, +int16_t tw256b[384] __attribute__((aligned(32))) = {0,32767,-805,32757,-1608,32727,-2411,32678,-3212,32609,-4012,32520,-4808,32412,-5602,32284,-6393,32137,-7180,31970,-7962,31785,-8740,31580,-9512,31356,-10279,31113,-11039,30851,-11793,30571,-12540,30272,-13279,29955,-14010,29621,-14733,29268,-15447,28897,-16151,28510,-16846,28105,-17531,27683,-18205,27244,-18868,26789,-19520,26318,-20160,25831,-20788,25329,-21403,24811,-22005,24278,-22595,23731,-23170,23169,-23732,22594,-24279,22004,-24812,21402,-25330,20787,-25832,20159,-26319,19519,-26790,18867,-27245,18204,-27684,17530,-28106,16845,-28511,16150,-28898,15446,-29269,14732,-29622,14009,-29956,13278,-30273,12539,-30572,11792,-30852,11038,-31114,10278,-31357,9511,-31581,8739,-31786,7961,-31971,7179,-32138,6392,-32285,5601,-32413,4807,-32521,4011,-32610,3211,-32679,2410,-32728,1607,-32758,804, 0,32767,-1608,32727,-3212,32609,-4808,32412,-6393,32137,-7962,31785,-9512,31356,-11039,30851,-12540,30272,-14010,29621,-15447,28897,-16846,28105,-18205,27244,-19520,26318,-20788,25329,-22005,24278,-23170,23169,-24279,22004,-25330,20787,-26319,19519,-27245,18204,-28106,16845,-28898,15446,-29622,14009,-30273,12539,-30852,11038,-31357,9511,-31786,7961,-32138,6392,-32413,4807,-32610,3211,-32728,1607,-32767,0,-32728,-1608,-32610,-3212,-32413,-4808,-32138,-6393,-31786,-7962,-31357,-9512,-30852,-11039,-30273,-12540,-29622,-14010,-28898,-15447,-28106,-16846,-27245,-18205,-26319,-19520,-25330,-20788,-24279,-22005,-23170,-23170,-22005,-24279,-20788,-25330,-19520,-26319,-18205,-27245,-16846,-28106,-15447,-28898,-14010,-29622,-12540,-30273,-11039,-30852,-9512,-31357,-7962,-31786,-6393,-32138,-4808,-32413,-3212,-32610,-1608,-32728, 0,32767,-2411,32678,-4808,32412,-7180,31970,-9512,31356,-11793,30571,-14010,29621,-16151,28510,-18205,27244,-20160,25831,-22005,24278,-23732,22594,-25330,20787,-26790,18867,-28106,16845,-29269,14732,-30273,12539,-31114,10278,-31786,7961,-32285,5601,-32610,3211,-32758,804,-32728,-1608,-32521,-4012,-32138,-6393,-31581,-8740,-30852,-11039,-29956,-13279,-28898,-15447,-27684,-17531,-26319,-19520,-24812,-21403,-23170,-23170,-21403,-24812,-19520,-26319,-17531,-27684,-15447,-28898,-13279,-29956,-11039,-30852,-8740,-31581,-6393,-32138,-4012,-32521,-1608,-32728,804,-32758,3211,-32610,5601,-32285,7961,-31786,10278,-31114,12539,-30273,14732,-29269,16845,-28106,18867,-26790,20787,-25330,22594,-23732,24278,-22005,25831,-20160,27244,-18205,28510,-16151,29621,-14010,30571,-11793,31356,-9512,31970,-7180,32412,-4808,32678,-2411 }; - +#ifndef __AVX2__ void dft256(int16_t *x,int16_t *y,int scale) { @@ -2339,25 +3626,205 @@ void idft256(int16_t *x,int16_t *y,int scale) } -int16_t tw512[512] __attribute__((aligned(16))) = { +#else //__AVX2__ + +void dft256(int16_t *x,int16_t *y,int scale) +{ + + simd256_q15_t xtmp[32],ytmp[32],*tw256a_256p=(simd256_q15_t *)tw256a,*tw256b_256p=(simd256_q15_t *)tw256b,*x256=(simd256_q15_t *)x,*y256=(simd256_q15_t *)y,*y256p=(simd256_q15_t *)y; + simd256_q15_t *ytmpp = &ytmp[0]; + int i; + + transpose16_ooff_simd256(x256+0,xtmp+0,8); + transpose16_ooff_simd256(x256+4,xtmp+1,8); + transpose16_ooff_simd256(x256+8,xtmp+2,8); + transpose16_ooff_simd256(x256+12,xtmp+3,8); + transpose16_ooff_simd256(x256+16,xtmp+4,8); + transpose16_ooff_simd256(x256+20,xtmp+5,8); + transpose16_ooff_simd256(x256+24,xtmp+6,8); + transpose16_ooff_simd256(x256+28,xtmp+7,8); + /* + char vname[10]; + for (i=0;i<32;i++) { + sprintf(vname,"xtmp%d",i); + print_shorts256(vname,(int16_t*)(xtmp+i)); + } + exit(-1);*/ + + dft64((int16_t*)(xtmp),(int16_t*)(ytmp),1); + dft64((int16_t*)(xtmp+8),(int16_t*)(ytmp+8),1); + dft64((int16_t*)(xtmp+16),(int16_t*)(ytmp+16),1); + dft64((int16_t*)(xtmp+24),(int16_t*)(ytmp+24),1); + + + bfly4_16_256(ytmpp,ytmpp+8,ytmpp+16,ytmpp+24, + y256p,y256p+8,y256p+16,y256p+24, + tw256a_256p,tw256a_256p+8,tw256a_256p+16, + tw256b_256p,tw256b_256p+8,tw256b_256p+16); + bfly4_16_256(ytmpp+1,ytmpp+9,ytmpp+17,ytmpp+25, + y256p+1,y256p+9,y256p+17,y256p+25, + tw256a_256p+1,tw256a_256p+9,tw256a_256p+17, + tw256b_256p+1,tw256b_256p+9,tw256b_256p+17); + bfly4_16_256(ytmpp+2,ytmpp+10,ytmpp+18,ytmpp+26, + y256p+2,y256p+10,y256p+18,y256p+26, + tw256a_256p+2,tw256a_256p+10,tw256a_256p+18, + tw256b_256p+2,tw256b_256p+10,tw256b_256p+18); + bfly4_16_256(ytmpp+3,ytmpp+11,ytmpp+19,ytmpp+27, + y256p+3,y256p+11,y256p+19,y256p+27, + tw256a_256p+3,tw256a_256p+11,tw256a_256p+19, + tw256b_256p+3,tw256b_256p+11,tw256b_256p+19); + bfly4_16_256(ytmpp+4,ytmpp+12,ytmpp+20,ytmpp+28, + y256p+4,y256p+12,y256p+20,y256p+28, + tw256a_256p+4,tw256a_256p+12,tw256a_256p+20, + tw256b_256p+4,tw256b_256p+12,tw256b_256p+20); + bfly4_16_256(ytmpp+5,ytmpp+13,ytmpp+21,ytmpp+29, + y256p+5,y256p+13,y256p+21,y256p+29, + tw256a_256p+5,tw256a_256p+13,tw256a_256p+21, + tw256b_256p+5,tw256b_256p+13,tw256b_256p+21); + bfly4_16_256(ytmpp+6,ytmpp+14,ytmpp+22,ytmpp+30, + y256p+6,y256p+14,y256p+22,y256p+30, + tw256a_256p+6,tw256a_256p+14,tw256a_256p+22, + tw256b_256p+6,tw256b_256p+14,tw256b_256p+22); + bfly4_16_256(ytmpp+7,ytmpp+15,ytmpp+23,ytmpp+31, + y256p+7,y256p+15,y256p+23,y256p+31, + tw256a_256p+7,tw256a_256p+15,tw256a_256p+23, + tw256b_256p+7,tw256b_256p+15,tw256b_256p+23); + + if (scale>0) { + + for (i=0; i<2; i++) { + y256[0] = shiftright_int16_simd256(y256[0],1); + y256[1] = shiftright_int16_simd256(y256[1],1); + y256[2] = shiftright_int16_simd256(y256[2],1); + y256[3] = shiftright_int16_simd256(y256[3],1); + y256[4] = shiftright_int16_simd256(y256[4],1); + y256[5] = shiftright_int16_simd256(y256[5],1); + y256[6] = shiftright_int16_simd256(y256[6],1); + y256[7] = shiftright_int16_simd256(y256[7],1); + y256[8] = shiftright_int16_simd256(y256[8],1); + y256[9] = shiftright_int16_simd256(y256[9],1); + y256[10] = shiftright_int16_simd256(y256[10],1); + y256[11] = shiftright_int16_simd256(y256[11],1); + y256[12] = shiftright_int16_simd256(y256[12],1); + y256[13] = shiftright_int16_simd256(y256[13],1); + y256[14] = shiftright_int16_simd256(y256[14],1); + y256[15] = shiftright_int16_simd256(y256[15],1); + + y256+=16; + } + + } + + _mm_empty(); + _m_empty(); + +} + +void idft256(int16_t *x,int16_t *y,int scale) +{ + + simd256_q15_t xtmp[32],ytmp[32],*tw256_256p=(simd256_q15_t *)tw256,*x256=(simd256_q15_t *)x,*y256=(simd256_q15_t *)y,*y256p=(simd256_q15_t *)y; + simd256_q15_t *ytmpp = &ytmp[0]; + int i; + + transpose16_ooff_simd256(x256+0,xtmp+0,8); + transpose16_ooff_simd256(x256+4,xtmp+1,8); + transpose16_ooff_simd256(x256+8,xtmp+2,8); + transpose16_ooff_simd256(x256+12,xtmp+3,8); + transpose16_ooff_simd256(x256+16,xtmp+4,8); + transpose16_ooff_simd256(x256+20,xtmp+5,8); + transpose16_ooff_simd256(x256+24,xtmp+6,8); + transpose16_ooff_simd256(x256+28,xtmp+7,8); + + idft64((int16_t*)(xtmp),(int16_t*)(ytmp),1); + idft64((int16_t*)(xtmp+8),(int16_t*)(ytmp+8),1); + idft64((int16_t*)(xtmp+16),(int16_t*)(ytmp+16),1); + idft64((int16_t*)(xtmp+24),(int16_t*)(ytmp+24),1); + + + ibfly4_256(ytmpp,ytmpp+8,ytmpp+16,ytmpp+24, + y256p,y256p+8,y256p+16,y256p+24, + tw256_256p,tw256_256p+8,tw256_256p+16); + + ibfly4_256(ytmpp+1,ytmpp+9,ytmpp+17,ytmpp+25, + y256p+1,y256p+9,y256p+17,y256p+25, + tw256_256p+1,tw256_256p+9,tw256_256p+17); + + ibfly4_256(ytmpp+2,ytmpp+10,ytmpp+18,ytmpp+26, + y256p+2,y256p+10,y256p+18,y256p+26, + tw256_256p+2,tw256_256p+10,tw256_256p+18); + + ibfly4_256(ytmpp+3,ytmpp+11,ytmpp+19,ytmpp+27, + y256p+3,y256p+11,y256p+19,y256p+27, + tw256_256p+3,tw256_256p+11,tw256_256p+19); + + ibfly4_256(ytmpp+4,ytmpp+12,ytmpp+20,ytmpp+28, + y256p+4,y256p+12,y256p+20,y256p+28, + tw256_256p+4,tw256_256p+12,tw256_256p+20); + + ibfly4_256(ytmpp+5,ytmpp+13,ytmpp+21,ytmpp+29, + y256p+5,y256p+13,y256p+21,y256p+29, + tw256_256p+5,tw256_256p+13,tw256_256p+21); + + ibfly4_256(ytmpp+6,ytmpp+14,ytmpp+22,ytmpp+30, + y256p+6,y256p+14,y256p+22,y256p+30, + tw256_256p+6,tw256_256p+14,tw256_256p+22); + + ibfly4_256(ytmpp+7,ytmpp+15,ytmpp+23,ytmpp+31, + y256p+7,y256p+15,y256p+23,y256p+31, + tw256_256p+7,tw256_256p+15,tw256_256p+23); + + + if (scale>0) { + + for (i=0; i<2; i++) { + y256[0] = shiftright_int16_simd256(y256[0],1); + y256[1] = shiftright_int16_simd256(y256[1],1); + y256[2] = shiftright_int16_simd256(y256[2],1); + y256[3] = shiftright_int16_simd256(y256[3],1); + y256[4] = shiftright_int16_simd256(y256[4],1); + y256[5] = shiftright_int16_simd256(y256[5],1); + y256[6] = shiftright_int16_simd256(y256[6],1); + y256[7] = shiftright_int16_simd256(y256[7],1); + y256[8] = shiftright_int16_simd256(y256[8],1); + y256[9] = shiftright_int16_simd256(y256[9],1); + y256[10] = shiftright_int16_simd256(y256[10],1); + y256[11] = shiftright_int16_simd256(y256[11],1); + y256[12] = shiftright_int16_simd256(y256[12],1); + y256[13] = shiftright_int16_simd256(y256[13],1); + y256[14] = shiftright_int16_simd256(y256[14],1); + y256[15] = shiftright_int16_simd256(y256[15],1); + + y256+=16; + } + + } + + _mm_empty(); + _m_empty(); + +} + +#endif +int16_t tw512[512] __attribute__((aligned(32))) = { 32767,0,32764,-403,32757,-805,32744,-1207,32727,-1608,32705,-2010,32678,-2411,32646,-2812,32609,-3212,32567,-3612,32520,-4012,32468,-4410,32412,-4808,32350,-5206,32284,-5602,32213,-5998,32137,-6393,32056,-6787,31970,-7180,31880,-7572,31785,-7962,31684,-8352,31580,-8740,31470,-9127,31356,-9512,31236,-9896,31113,-10279,30984,-10660,30851,-11039,30713,-11417,30571,-11793,30424,-12167,30272,-12540,30116,-12910,29955,-13279,29790,-13646,29621,-14010,29446,-14373,29268,-14733,29085,-15091,28897,-15447,28706,-15800,28510,-16151,28309,-16500,28105,-16846,27896,-17190,27683,-17531,27466,-17869,27244,-18205,27019,-18538,26789,-18868,26556,-19195,26318,-19520,26077,-19841,25831,-20160,25582,-20475,25329,-20788,25072,-21097,24811,-21403,24546,-21706,24278,-22005,24006,-22302,23731,-22595,23452,-22884,23169,-23170,22883,-23453,22594,-23732,22301,-24007,22004,-24279,21705,-24547,21402,-24812,21096,-25073,20787,-25330,20474,-25583,20159,-25832,19840,-26078,19519,-26319,19194,-26557,18867,-26790,18537,-27020,18204,-27245,17868,-27467,17530,-27684,17189,-27897,16845,-28106,16499,-28310,16150,-28511,15799,-28707,15446,-28898,15090,-29086,14732,-29269,14372,-29447,14009,-29622,13645,-29791,13278,-29956,12909,-30117,12539,-30273,12166,-30425,11792,-30572,11416,-30714,11038,-30852,10659,-30985,10278,-31114,9895,-31237,9511,-31357,9126,-31471,8739,-31581,8351,-31685,7961,-31786,7571,-31881,7179,-31971,6786,-32057,6392,-32138,5997,-32214,5601,-32285,5205,-32351,4807,-32413,4409,-32469,4011,-32521,3611,-32568,3211,-32610,2811,-32647,2410,-32679,2009,-32706,1607,-32728,1206,-32745,804,-32758,402,-32765,0,-32767,-403,-32765,-805,-32758,-1207,-32745,-1608,-32728,-2010,-32706,-2411,-32679,-2812,-32647,-3212,-32610,-3612,-32568,-4012,-32521,-4410,-32469,-4808,-32413,-5206,-32351,-5602,-32285,-5998,-32214,-6393,-32138,-6787,-32057,-7180,-31971,-7572,-31881,-7962,-31786,-8352,-31685,-8740,-31581,-9127,-31471,-9512,-31357,-9896,-31237,-10279,-31114,-10660,-30985,-11039,-30852,-11417,-30714,-11793,-30572,-12167,-30425,-12540,-30273,-12910,-30117,-13279,-29956,-13646,-29791,-14010,-29622,-14373,-29447,-14733,-29269,-15091,-29086,-15447,-28898,-15800,-28707,-16151,-28511,-16500,-28310,-16846,-28106,-17190,-27897,-17531,-27684,-17869,-27467,-18205,-27245,-18538,-27020,-18868,-26790,-19195,-26557,-19520,-26319,-19841,-26078,-20160,-25832,-20475,-25583,-20788,-25330,-21097,-25073,-21403,-24812,-21706,-24547,-22005,-24279,-22302,-24007,-22595,-23732,-22884,-23453,-23170,-23170,-23453,-22884,-23732,-22595,-24007,-22302,-24279,-22005,-24547,-21706,-24812,-21403,-25073,-21097,-25330,-20788,-25583,-20475,-25832,-20160,-26078,-19841,-26319,-19520,-26557,-19195,-26790,-18868,-27020,-18538,-27245,-18205,-27467,-17869,-27684,-17531,-27897,-17190,-28106,-16846,-28310,-16500,-28511,-16151,-28707,-15800,-28898,-15447,-29086,-15091,-29269,-14733,-29447,-14373,-29622,-14010,-29791,-13646,-29956,-13279,-30117,-12910,-30273,-12540,-30425,-12167,-30572,-11793,-30714,-11417,-30852,-11039,-30985,-10660,-31114,-10279,-31237,-9896,-31357,-9512,-31471,-9127,-31581,-8740,-31685,-8352,-31786,-7962,-31881,-7572,-31971,-7180,-32057,-6787,-32138,-6393,-32214,-5998,-32285,-5602,-32351,-5206,-32413,-4808,-32469,-4410,-32521,-4012,-32568,-3612,-32610,-3212,-32647,-2812,-32679,-2411,-32706,-2010,-32728,-1608,-32745,-1207,-32758,-805,-32765,-403 }; -int16_t tw512a[512] __attribute__((aligned(16))) = { +int16_t tw512a[512] __attribute__((aligned(32))) = { 32767,0,32764,403,32757,805,32744,1207,32727,1608,32705,2010,32678,2411,32646,2812,32609,3212,32567,3612,32520,4012,32468,4410,32412,4808,32350,5206,32284,5602,32213,5998,32137,6393,32056,6787,31970,7180,31880,7572,31785,7962,31684,8352,31580,8740,31470,9127,31356,9512,31236,9896,31113,10279,30984,10660,30851,11039,30713,11417,30571,11793,30424,12167,30272,12540,30116,12910,29955,13279,29790,13646,29621,14010,29446,14373,29268,14733,29085,15091,28897,15447,28706,15800,28510,16151,28309,16500,28105,16846,27896,17190,27683,17531,27466,17869,27244,18205,27019,18538,26789,18868,26556,19195,26318,19520,26077,19841,25831,20160,25582,20475,25329,20788,25072,21097,24811,21403,24546,21706,24278,22005,24006,22302,23731,22595,23452,22884,23169,23170,22883,23453,22594,23732,22301,24007,22004,24279,21705,24547,21402,24812,21096,25073,20787,25330,20474,25583,20159,25832,19840,26078,19519,26319,19194,26557,18867,26790,18537,27020,18204,27245,17868,27467,17530,27684,17189,27897,16845,28106,16499,28310,16150,28511,15799,28707,15446,28898,15090,29086,14732,29269,14372,29447,14009,29622,13645,29791,13278,29956,12909,30117,12539,30273,12166,30425,11792,30572,11416,30714,11038,30852,10659,30985,10278,31114,9895,31237,9511,31357,9126,31471,8739,31581,8351,31685,7961,31786,7571,31881,7179,31971,6786,32057,6392,32138,5997,32214,5601,32285,5205,32351,4807,32413,4409,32469,4011,32521,3611,32568,3211,32610,2811,32647,2410,32679,2009,32706,1607,32728,1206,32745,804,32758,402,32765,0,32767,-403,32765,-805,32758,-1207,32745,-1608,32728,-2010,32706,-2411,32679,-2812,32647,-3212,32610,-3612,32568,-4012,32521,-4410,32469,-4808,32413,-5206,32351,-5602,32285,-5998,32214,-6393,32138,-6787,32057,-7180,31971,-7572,31881,-7962,31786,-8352,31685,-8740,31581,-9127,31471,-9512,31357,-9896,31237,-10279,31114,-10660,30985,-11039,30852,-11417,30714,-11793,30572,-12167,30425,-12540,30273,-12910,30117,-13279,29956,-13646,29791,-14010,29622,-14373,29447,-14733,29269,-15091,29086,-15447,28898,-15800,28707,-16151,28511,-16500,28310,-16846,28106,-17190,27897,-17531,27684,-17869,27467,-18205,27245,-18538,27020,-18868,26790,-19195,26557,-19520,26319,-19841,26078,-20160,25832,-20475,25583,-20788,25330,-21097,25073,-21403,24812,-21706,24547,-22005,24279,-22302,24007,-22595,23732,-22884,23453,-23170,23170,-23453,22884,-23732,22595,-24007,22302,-24279,22005,-24547,21706,-24812,21403,-25073,21097,-25330,20788,-25583,20475,-25832,20160,-26078,19841,-26319,19520,-26557,19195,-26790,18868,-27020,18538,-27245,18205,-27467,17869,-27684,17531,-27897,17190,-28106,16846,-28310,16500,-28511,16151,-28707,15800,-28898,15447,-29086,15091,-29269,14733,-29447,14373,-29622,14010,-29791,13646,-29956,13279,-30117,12910,-30273,12540,-30425,12167,-30572,11793,-30714,11417,-30852,11039,-30985,10660,-31114,10279,-31237,9896,-31357,9512,-31471,9127,-31581,8740,-31685,8352,-31786,7962,-31881,7572,-31971,7180,-32057,6787,-32138,6393,-32214,5998,-32285,5602,-32351,5206,-32413,4808,-32469,4410,-32521,4012,-32568,3612,-32610,3212,-32647,2812,-32679,2411,-32706,2010,-32728,1608,-32745,1207,-32758,805,-32765,403 }; -int16_t tw512b[512] __attribute__((aligned(16))) = { +int16_t tw512b[512] __attribute__((aligned(32))) = { 0,32767,-403,32764,-805,32757,-1207,32744,-1608,32727,-2010,32705,-2411,32678,-2812,32646,-3212,32609,-3612,32567,-4012,32520,-4410,32468,-4808,32412,-5206,32350,-5602,32284,-5998,32213,-6393,32137,-6787,32056,-7180,31970,-7572,31880,-7962,31785,-8352,31684,-8740,31580,-9127,31470,-9512,31356,-9896,31236,-10279,31113,-10660,30984,-11039,30851,-11417,30713,-11793,30571,-12167,30424,-12540,30272,-12910,30116,-13279,29955,-13646,29790,-14010,29621,-14373,29446,-14733,29268,-15091,29085,-15447,28897,-15800,28706,-16151,28510,-16500,28309,-16846,28105,-17190,27896,-17531,27683,-17869,27466,-18205,27244,-18538,27019,-18868,26789,-19195,26556,-19520,26318,-19841,26077,-20160,25831,-20475,25582,-20788,25329,-21097,25072,-21403,24811,-21706,24546,-22005,24278,-22302,24006,-22595,23731,-22884,23452,-23170,23169,-23453,22883,-23732,22594,-24007,22301,-24279,22004,-24547,21705,-24812,21402,-25073,21096,-25330,20787,-25583,20474,-25832,20159,-26078,19840,-26319,19519,-26557,19194,-26790,18867,-27020,18537,-27245,18204,-27467,17868,-27684,17530,-27897,17189,-28106,16845,-28310,16499,-28511,16150,-28707,15799,-28898,15446,-29086,15090,-29269,14732,-29447,14372,-29622,14009,-29791,13645,-29956,13278,-30117,12909,-30273,12539,-30425,12166,-30572,11792,-30714,11416,-30852,11038,-30985,10659,-31114,10278,-31237,9895,-31357,9511,-31471,9126,-31581,8739,-31685,8351,-31786,7961,-31881,7571,-31971,7179,-32057,6786,-32138,6392,-32214,5997,-32285,5601,-32351,5205,-32413,4807,-32469,4409,-32521,4011,-32568,3611,-32610,3211,-32647,2811,-32679,2410,-32706,2009,-32728,1607,-32745,1206,-32758,804,-32765,402,-32767,0,-32765,-403,-32758,-805,-32745,-1207,-32728,-1608,-32706,-2010,-32679,-2411,-32647,-2812,-32610,-3212,-32568,-3612,-32521,-4012,-32469,-4410,-32413,-4808,-32351,-5206,-32285,-5602,-32214,-5998,-32138,-6393,-32057,-6787,-31971,-7180,-31881,-7572,-31786,-7962,-31685,-8352,-31581,-8740,-31471,-9127,-31357,-9512,-31237,-9896,-31114,-10279,-30985,-10660,-30852,-11039,-30714,-11417,-30572,-11793,-30425,-12167,-30273,-12540,-30117,-12910,-29956,-13279,-29791,-13646,-29622,-14010,-29447,-14373,-29269,-14733,-29086,-15091,-28898,-15447,-28707,-15800,-28511,-16151,-28310,-16500,-28106,-16846,-27897,-17190,-27684,-17531,-27467,-17869,-27245,-18205,-27020,-18538,-26790,-18868,-26557,-19195,-26319,-19520,-26078,-19841,-25832,-20160,-25583,-20475,-25330,-20788,-25073,-21097,-24812,-21403,-24547,-21706,-24279,-22005,-24007,-22302,-23732,-22595,-23453,-22884,-23170,-23170,-22884,-23453,-22595,-23732,-22302,-24007,-22005,-24279,-21706,-24547,-21403,-24812,-21097,-25073,-20788,-25330,-20475,-25583,-20160,-25832,-19841,-26078,-19520,-26319,-19195,-26557,-18868,-26790,-18538,-27020,-18205,-27245,-17869,-27467,-17531,-27684,-17190,-27897,-16846,-28106,-16500,-28310,-16151,-28511,-15800,-28707,-15447,-28898,-15091,-29086,-14733,-29269,-14373,-29447,-14010,-29622,-13646,-29791,-13279,-29956,-12910,-30117,-12540,-30273,-12167,-30425,-11793,-30572,-11417,-30714,-11039,-30852,-10660,-30985,-10279,-31114,-9896,-31237,-9512,-31357,-9127,-31471,-8740,-31581,-8352,-31685,-7962,-31786,-7572,-31881,-7180,-31971,-6787,-32057,-6393,-32138,-5998,-32214,-5602,-32285,-5206,-32351,-4808,-32413,-4410,-32469,-4012,-32521,-3612,-32568,-3212,-32610,-2812,-32647,-2411,-32679,-2010,-32706,-1608,-32728,-1207,-32745,-805,-32758,-403,-32765 }; -int16_t tw512c[512] __attribute__((aligned(16))) = { +int16_t tw512c[512] __attribute__((aligned(32))) = { 0,32767,403,32764,805,32757,1207,32744,1608,32727,2010,32705,2411,32678,2812,32646,3212,32609,3612,32567,4012,32520,4410,32468,4808,32412,5206,32350,5602,32284,5998,32213,6393,32137,6787,32056,7180,31970,7572,31880,7962,31785,8352,31684,8740,31580,9127,31470,9512,31356,9896,31236,10279,31113,10660,30984,11039,30851,11417,30713,11793,30571,12167,30424,12540,30272,12910,30116,13279,29955,13646,29790,14010,29621,14373,29446,14733,29268,15091,29085,15447,28897,15800,28706,16151,28510,16500,28309,16846,28105,17190,27896,17531,27683,17869,27466,18205,27244,18538,27019,18868,26789,19195,26556,19520,26318,19841,26077,20160,25831,20475,25582,20788,25329,21097,25072,21403,24811,21706,24546,22005,24278,22302,24006,22595,23731,22884,23452,23170,23169,23453,22883,23732,22594,24007,22301,24279,22004,24547,21705,24812,21402,25073,21096,25330,20787,25583,20474,25832,20159,26078,19840,26319,19519,26557,19194,26790,18867,27020,18537,27245,18204,27467,17868,27684,17530,27897,17189,28106,16845,28310,16499,28511,16150,28707,15799,28898,15446,29086,15090,29269,14732,29447,14372,29622,14009,29791,13645,29956,13278,30117,12909,30273,12539,30425,12166,30572,11792,30714,11416,30852,11038,30985,10659,31114,10278,31237,9895,31357,9511,31471,9126,31581,8739,31685,8351,31786,7961,31881,7571,31971,7179,32057,6786,32138,6392,32214,5997,32285,5601,32351,5205,32413,4807,32469,4409,32521,4011,32568,3611,32610,3211,32647,2811,32679,2410,32706,2009,32728,1607,32745,1206,32758,804,32765,402,32767,0,32765,-403,32758,-805,32745,-1207,32728,-1608,32706,-2010,32679,-2411,32647,-2812,32610,-3212,32568,-3612,32521,-4012,32469,-4410,32413,-4808,32351,-5206,32285,-5602,32214,-5998,32138,-6393,32057,-6787,31971,-7180,31881,-7572,31786,-7962,31685,-8352,31581,-8740,31471,-9127,31357,-9512,31237,-9896,31114,-10279,30985,-10660,30852,-11039,30714,-11417,30572,-11793,30425,-12167,30273,-12540,30117,-12910,29956,-13279,29791,-13646,29622,-14010,29447,-14373,29269,-14733,29086,-15091,28898,-15447,28707,-15800,28511,-16151,28310,-16500,28106,-16846,27897,-17190,27684,-17531,27467,-17869,27245,-18205,27020,-18538,26790,-18868,26557,-19195,26319,-19520,26078,-19841,25832,-20160,25583,-20475,25330,-20788,25073,-21097,24812,-21403,24547,-21706,24279,-22005,24007,-22302,23732,-22595,23453,-22884,23170,-23170,22884,-23453,22595,-23732,22302,-24007,22005,-24279,21706,-24547,21403,-24812,21097,-25073,20788,-25330,20475,-25583,20160,-25832,19841,-26078,19520,-26319,19195,-26557,18868,-26790,18538,-27020,18205,-27245,17869,-27467,17531,-27684,17190,-27897,16846,-28106,16500,-28310,16151,-28511,15800,-28707,15447,-28898,15091,-29086,14733,-29269,14373,-29447,14010,-29622,13646,-29791,13279,-29956,12910,-30117,12540,-30273,12167,-30425,11793,-30572,11417,-30714,11039,-30852,10660,-30985,10279,-31114,9896,-31237,9512,-31357,9127,-31471,8740,-31581,8352,-31685,7962,-31786,7572,-31881,7180,-31971,6787,-32057,6393,-32138,5998,-32214,5602,-32285,5206,-32351,4808,-32413,4410,-32469,4012,-32521,3612,-32568,3212,-32610,2812,-32647,2411,-32679,2010,-32706,1608,-32728,1207,-32745,805,-32758,403,-32765 }; - +#ifndef __AVX2__ void dft512(int16_t *x,int16_t *y,int scale) { @@ -2568,11 +4035,179 @@ void idft512(int16_t *x,int16_t *y,int scale) } -int16_t tw1024[1536] __attribute__((aligned(16))) = { 32767,0,32766,-202,32764,-403,32761,-604,32757,-805,32751,-1006,32744,-1207,32736,-1407,32727,-1608,32717,-1809,32705,-2010,32692,-2210,32678,-2411,32662,-2611,32646,-2812,32628,-3012,32609,-3212,32588,-3412,32567,-3612,32544,-3812,32520,-4012,32495,-4211,32468,-4410,32441,-4609,32412,-4808,32382,-5007,32350,-5206,32318,-5404,32284,-5602,32249,-5800,32213,-5998,32176,-6196,32137,-6393,32097,-6590,32056,-6787,32014,-6983,31970,-7180,31926,-7376,31880,-7572,31833,-7767,31785,-7962,31735,-8157,31684,-8352,31633,-8546,31580,-8740,31525,-8933,31470,-9127,31413,-9320,31356,-9512,31297,-9704,31236,-9896,31175,-10088,31113,-10279,31049,-10470,30984,-10660,30918,-10850,30851,-11039,30783,-11228,30713,-11417,30643,-11605,30571,-11793,30498,-11981,30424,-12167,30349,-12354,30272,-12540,30195,-12725,30116,-12910,30036,-13095,29955,-13279,29873,-13463,29790,-13646,29706,-13828,29621,-14010,29534,-14192,29446,-14373,29358,-14553,29268,-14733,29177,-14912,29085,-15091,28992,-15269,28897,-15447,28802,-15624,28706,-15800,28608,-15976,28510,-16151,28410,-16326,28309,-16500,28208,-16673,28105,-16846,28001,-17018,27896,-17190,27790,-17361,27683,-17531,27575,-17700,27466,-17869,27355,-18037,27244,-18205,27132,-18372,27019,-18538,26905,-18703,26789,-18868,26673,-19032,26556,-19195,26437,-19358,26318,-19520,26198,-19681,26077,-19841,25954,-20001,25831,-20160,25707,-20318,25582,-20475,25456,-20632,25329,-20788,25201,-20943,25072,-21097,24942,-21250,24811,-21403,24679,-21555,24546,-21706,24413,-21856,24278,-22005,24143,-22154,24006,-22302,23869,-22449,23731,-22595,23592,-22740,23452,-22884,23311,-23028,23169,-23170,23027,-23312,22883,-23453,22739,-23593,22594,-23732,22448,-23870,22301,-24007,22153,-24144,22004,-24279,21855,-24414,21705,-24547,21554,-24680,21402,-24812,21249,-24943,21096,-25073,20942,-25202,20787,-25330,20631,-25457,20474,-25583,20317,-25708,20159,-25832,20000,-25955,19840,-26078,19680,-26199,19519,-26319,19357,-26438,19194,-26557,19031,-26674,18867,-26790,18702,-26906,18537,-27020,18371,-27133,18204,-27245,18036,-27356,17868,-27467,17699,-27576,17530,-27684,17360,-27791,17189,-27897,17017,-28002,16845,-28106,16672,-28209,16499,-28310,16325,-28411,16150,-28511,15975,-28609,15799,-28707,15623,-28803,15446,-28898,15268,-28993,15090,-29086,14911,-29178,14732,-29269,14552,-29359,14372,-29447,14191,-29535,14009,-29622,13827,-29707,13645,-29791,13462,-29874,13278,-29956,13094,-30037,12909,-30117,12724,-30196,12539,-30273,12353,-30350,12166,-30425,11980,-30499,11792,-30572,11604,-30644,11416,-30714,11227,-30784,11038,-30852,10849,-30919,10659,-30985,10469,-31050,10278,-31114,10087,-31176,9895,-31237,9703,-31298,9511,-31357,9319,-31414,9126,-31471,8932,-31526,8739,-31581,8545,-31634,8351,-31685,8156,-31736,7961,-31786,7766,-31834,7571,-31881,7375,-31927,7179,-31971,6982,-32015,6786,-32057,6589,-32098,6392,-32138,6195,-32177,5997,-32214,5799,-32250,5601,-32285,5403,-32319,5205,-32351,5006,-32383,4807,-32413,4608,-32442,4409,-32469,4210,-32496,4011,-32521,3811,-32545,3611,-32568,3411,-32589,3211,-32610,3011,-32629,2811,-32647,2610,-32663,2410,-32679,2209,-32693,2009,-32706,1808,-32718,1607,-32728,1406,-32737,1206,-32745,1005,-32752,804,-32758,603,-32762,402,-32765,201,-32767, +#else //__AVX2__ + +void dft512(int16_t *x,int16_t *y,int scale) +{ + + simd256_q15_t xtmp[64],*x256 = (simd256_q15_t *)x; + simd256_q15_t ytmp[64],*y256=(simd256_q15_t*)y; + simd256_q15_t *tw512_256p=(simd256_q15_t*)tw512,*y256p=(simd256_q15_t *)y; + simd256_q15_t *ytmpp = &ytmp[0]; + int i; + simd256_q15_t ONE_OVER_SQRT2_Q15_256 = set1_int16_simd256(ONE_OVER_SQRT2_Q15); + + + transpose4_ooff_simd256(x256 ,xtmp,32); + transpose4_ooff_simd256(x256+2,xtmp+1,32); + transpose4_ooff_simd256(x256+4,xtmp+2,32); + transpose4_ooff_simd256(x256+6,xtmp+3,32); + transpose4_ooff_simd256(x256+8,xtmp+4,32); + transpose4_ooff_simd256(x256+10,xtmp+5,32); + transpose4_ooff_simd256(x256+12,xtmp+6,32); + transpose4_ooff_simd256(x256+14,xtmp+7,32); + transpose4_ooff_simd256(x256+16,xtmp+8,32); + transpose4_ooff_simd256(x256+18,xtmp+9,32); + transpose4_ooff_simd256(x256+20,xtmp+10,32); + transpose4_ooff_simd256(x256+22,xtmp+11,32); + transpose4_ooff_simd256(x256+24,xtmp+12,32); + transpose4_ooff_simd256(x256+26,xtmp+13,32); + transpose4_ooff_simd256(x256+28,xtmp+14,32); + transpose4_ooff_simd256(x256+30,xtmp+15,32); + transpose4_ooff_simd256(x256+32,xtmp+16,32); + transpose4_ooff_simd256(x256+34,xtmp+17,32); + transpose4_ooff_simd256(x256+36,xtmp+18,32); + transpose4_ooff_simd256(x256+38,xtmp+19,32); + transpose4_ooff_simd256(x256+40,xtmp+20,32); + transpose4_ooff_simd256(x256+42,xtmp+21,32); + transpose4_ooff_simd256(x256+44,xtmp+22,32); + transpose4_ooff_simd256(x256+46,xtmp+23,32); + transpose4_ooff_simd256(x256+48,xtmp+24,32); + transpose4_ooff_simd256(x256+50,xtmp+25,32); + transpose4_ooff_simd256(x256+52,xtmp+26,32); + transpose4_ooff_simd256(x256+54,xtmp+27,32); + transpose4_ooff_simd256(x256+56,xtmp+28,32); + transpose4_ooff_simd256(x256+58,xtmp+29,32); + transpose4_ooff_simd256(x256+60,xtmp+30,32); + transpose4_ooff_simd256(x256+62,xtmp+31,32); + + dft256((int16_t*)(xtmp),(int16_t*)ytmp,1); + dft256((int16_t*)(xtmp+32),(int16_t*)(ytmp+32),1); + + + for (i=0; i<32; i++) { + bfly2_256(ytmpp,ytmpp+32, + y256p,y256p+32, + tw512_256p); + tw512_256p++; + y256p++; + ytmpp++; + } + + if (scale>0) { + + for (i=0;i<4;i++) { + y256[0] = mulhi_int16_simd256(y256[0],ONE_OVER_SQRT2_Q15_256); + y256[1] = mulhi_int16_simd256(y256[1],ONE_OVER_SQRT2_Q15_256); + y256[2] = mulhi_int16_simd256(y256[2],ONE_OVER_SQRT2_Q15_256); + y256[3] = mulhi_int16_simd256(y256[3],ONE_OVER_SQRT2_Q15_256); + y256[4] = mulhi_int16_simd256(y256[4],ONE_OVER_SQRT2_Q15_256); + y256[5] = mulhi_int16_simd256(y256[5],ONE_OVER_SQRT2_Q15_256); + y256[6] = mulhi_int16_simd256(y256[6],ONE_OVER_SQRT2_Q15_256); + y256[7] = mulhi_int16_simd256(y256[7],ONE_OVER_SQRT2_Q15_256); + y256[8] = mulhi_int16_simd256(y256[8],ONE_OVER_SQRT2_Q15_256); + y256[9] = mulhi_int16_simd256(y256[9],ONE_OVER_SQRT2_Q15_256); + y256[10] = mulhi_int16_simd256(y256[10],ONE_OVER_SQRT2_Q15_256); + y256[11] = mulhi_int16_simd256(y256[11],ONE_OVER_SQRT2_Q15_256); + y256[12] = mulhi_int16_simd256(y256[12],ONE_OVER_SQRT2_Q15_256); + y256[13] = mulhi_int16_simd256(y256[13],ONE_OVER_SQRT2_Q15_256); + y256[14] = mulhi_int16_simd256(y256[14],ONE_OVER_SQRT2_Q15_256); + y256[15] = mulhi_int16_simd256(y256[15],ONE_OVER_SQRT2_Q15_256); + y256+=16; + } + } + +} + +void idft512(int16_t *x,int16_t *y,int scale) +{ + + simd256_q15_t xtmp[64],*x256 = (simd256_q15_t *)x; + simd256_q15_t ytmp[64],*y256=(simd256_q15_t*)y; + simd256_q15_t *tw512_256p=(simd256_q15_t *)tw512,*y256p=(simd256_q15_t *)y; + simd256_q15_t *ytmpp = &ytmp[0]; + int i; + simd256_q15_t ONE_OVER_SQRT2_Q15_256 = set1_int16_simd256(ONE_OVER_SQRT2_Q15); + + + transpose4_ooff_simd256(x256 ,xtmp,32); + transpose4_ooff_simd256(x256+2,xtmp+1,32); + transpose4_ooff_simd256(x256+4,xtmp+2,32); + transpose4_ooff_simd256(x256+6,xtmp+3,32); + transpose4_ooff_simd256(x256+8,xtmp+4,32); + transpose4_ooff_simd256(x256+10,xtmp+5,32); + transpose4_ooff_simd256(x256+12,xtmp+6,32); + transpose4_ooff_simd256(x256+14,xtmp+7,32); + transpose4_ooff_simd256(x256+16,xtmp+8,32); + transpose4_ooff_simd256(x256+18,xtmp+9,32); + transpose4_ooff_simd256(x256+20,xtmp+10,32); + transpose4_ooff_simd256(x256+22,xtmp+11,32); + transpose4_ooff_simd256(x256+24,xtmp+12,32); + transpose4_ooff_simd256(x256+26,xtmp+13,32); + transpose4_ooff_simd256(x256+28,xtmp+14,32); + transpose4_ooff_simd256(x256+30,xtmp+15,32); + transpose4_ooff_simd256(x256+32,xtmp+16,32); + transpose4_ooff_simd256(x256+34,xtmp+17,32); + transpose4_ooff_simd256(x256+36,xtmp+18,32); + transpose4_ooff_simd256(x256+38,xtmp+19,32); + transpose4_ooff_simd256(x256+40,xtmp+20,32); + transpose4_ooff_simd256(x256+42,xtmp+21,32); + transpose4_ooff_simd256(x256+44,xtmp+22,32); + transpose4_ooff_simd256(x256+46,xtmp+23,32); + transpose4_ooff_simd256(x256+48,xtmp+24,32); + transpose4_ooff_simd256(x256+50,xtmp+25,32); + transpose4_ooff_simd256(x256+52,xtmp+26,32); + transpose4_ooff_simd256(x256+54,xtmp+27,32); + transpose4_ooff_simd256(x256+56,xtmp+28,32); + transpose4_ooff_simd256(x256+58,xtmp+29,32); + transpose4_ooff_simd256(x256+60,xtmp+30,32); + transpose4_ooff_simd256(x256+62,xtmp+31,32); + + idft256((int16_t*)(xtmp),(int16_t*)ytmp,1); + idft256((int16_t*)(xtmp+32),(int16_t*)(ytmp+32),1); + + + for (i=0; i<32; i++) { + ibfly2_256(ytmpp,ytmpp+32, + y256p,y256p+32, + tw512_256p); + tw512_256p++; + y256p++; + ytmpp++; + } + + if (scale>0) { + + for (i=0;i<4;i++) { + y256[0] = mulhi_int16_simd256(y256[0],ONE_OVER_SQRT2_Q15_256); + y256[1] = mulhi_int16_simd256(y256[1],ONE_OVER_SQRT2_Q15_256); + y256[2] = mulhi_int16_simd256(y256[2],ONE_OVER_SQRT2_Q15_256); + y256[3] = mulhi_int16_simd256(y256[3],ONE_OVER_SQRT2_Q15_256); + y256[4] = mulhi_int16_simd256(y256[4],ONE_OVER_SQRT2_Q15_256); + y256[5] = mulhi_int16_simd256(y256[5],ONE_OVER_SQRT2_Q15_256); + y256[6] = mulhi_int16_simd256(y256[6],ONE_OVER_SQRT2_Q15_256); + y256[7] = mulhi_int16_simd256(y256[7],ONE_OVER_SQRT2_Q15_256); + y256[8] = mulhi_int16_simd256(y256[8],ONE_OVER_SQRT2_Q15_256); + y256[9] = mulhi_int16_simd256(y256[9],ONE_OVER_SQRT2_Q15_256); + y256[10] = mulhi_int16_simd256(y256[10],ONE_OVER_SQRT2_Q15_256); + y256[11] = mulhi_int16_simd256(y256[11],ONE_OVER_SQRT2_Q15_256); + y256[12] = mulhi_int16_simd256(y256[12],ONE_OVER_SQRT2_Q15_256); + y256[13] = mulhi_int16_simd256(y256[13],ONE_OVER_SQRT2_Q15_256); + y256[14] = mulhi_int16_simd256(y256[14],ONE_OVER_SQRT2_Q15_256); + y256[15] = mulhi_int16_simd256(y256[15],ONE_OVER_SQRT2_Q15_256); + y256+=16; + } + } + +} + +#endif + +int16_t tw1024[1536] __attribute__((aligned(32))) = { 32767,0,32766,-202,32764,-403,32761,-604,32757,-805,32751,-1006,32744,-1207,32736,-1407,32727,-1608,32717,-1809,32705,-2010,32692,-2210,32678,-2411,32662,-2611,32646,-2812,32628,-3012,32609,-3212,32588,-3412,32567,-3612,32544,-3812,32520,-4012,32495,-4211,32468,-4410,32441,-4609,32412,-4808,32382,-5007,32350,-5206,32318,-5404,32284,-5602,32249,-5800,32213,-5998,32176,-6196,32137,-6393,32097,-6590,32056,-6787,32014,-6983,31970,-7180,31926,-7376,31880,-7572,31833,-7767,31785,-7962,31735,-8157,31684,-8352,31633,-8546,31580,-8740,31525,-8933,31470,-9127,31413,-9320,31356,-9512,31297,-9704,31236,-9896,31175,-10088,31113,-10279,31049,-10470,30984,-10660,30918,-10850,30851,-11039,30783,-11228,30713,-11417,30643,-11605,30571,-11793,30498,-11981,30424,-12167,30349,-12354,30272,-12540,30195,-12725,30116,-12910,30036,-13095,29955,-13279,29873,-13463,29790,-13646,29706,-13828,29621,-14010,29534,-14192,29446,-14373,29358,-14553,29268,-14733,29177,-14912,29085,-15091,28992,-15269,28897,-15447,28802,-15624,28706,-15800,28608,-15976,28510,-16151,28410,-16326,28309,-16500,28208,-16673,28105,-16846,28001,-17018,27896,-17190,27790,-17361,27683,-17531,27575,-17700,27466,-17869,27355,-18037,27244,-18205,27132,-18372,27019,-18538,26905,-18703,26789,-18868,26673,-19032,26556,-19195,26437,-19358,26318,-19520,26198,-19681,26077,-19841,25954,-20001,25831,-20160,25707,-20318,25582,-20475,25456,-20632,25329,-20788,25201,-20943,25072,-21097,24942,-21250,24811,-21403,24679,-21555,24546,-21706,24413,-21856,24278,-22005,24143,-22154,24006,-22302,23869,-22449,23731,-22595,23592,-22740,23452,-22884,23311,-23028,23169,-23170,23027,-23312,22883,-23453,22739,-23593,22594,-23732,22448,-23870,22301,-24007,22153,-24144,22004,-24279,21855,-24414,21705,-24547,21554,-24680,21402,-24812,21249,-24943,21096,-25073,20942,-25202,20787,-25330,20631,-25457,20474,-25583,20317,-25708,20159,-25832,20000,-25955,19840,-26078,19680,-26199,19519,-26319,19357,-26438,19194,-26557,19031,-26674,18867,-26790,18702,-26906,18537,-27020,18371,-27133,18204,-27245,18036,-27356,17868,-27467,17699,-27576,17530,-27684,17360,-27791,17189,-27897,17017,-28002,16845,-28106,16672,-28209,16499,-28310,16325,-28411,16150,-28511,15975,-28609,15799,-28707,15623,-28803,15446,-28898,15268,-28993,15090,-29086,14911,-29178,14732,-29269,14552,-29359,14372,-29447,14191,-29535,14009,-29622,13827,-29707,13645,-29791,13462,-29874,13278,-29956,13094,-30037,12909,-30117,12724,-30196,12539,-30273,12353,-30350,12166,-30425,11980,-30499,11792,-30572,11604,-30644,11416,-30714,11227,-30784,11038,-30852,10849,-30919,10659,-30985,10469,-31050,10278,-31114,10087,-31176,9895,-31237,9703,-31298,9511,-31357,9319,-31414,9126,-31471,8932,-31526,8739,-31581,8545,-31634,8351,-31685,8156,-31736,7961,-31786,7766,-31834,7571,-31881,7375,-31927,7179,-31971,6982,-32015,6786,-32057,6589,-32098,6392,-32138,6195,-32177,5997,-32214,5799,-32250,5601,-32285,5403,-32319,5205,-32351,5006,-32383,4807,-32413,4608,-32442,4409,-32469,4210,-32496,4011,-32521,3811,-32545,3611,-32568,3411,-32589,3211,-32610,3011,-32629,2811,-32647,2610,-32663,2410,-32679,2209,-32693,2009,-32706,1808,-32718,1607,-32728,1406,-32737,1206,-32745,1005,-32752,804,-32758,603,-32762,402,-32765,201,-32767, 32767,0,32764,-403,32757,-805,32744,-1207,32727,-1608,32705,-2010,32678,-2411,32646,-2812,32609,-3212,32567,-3612,32520,-4012,32468,-4410,32412,-4808,32350,-5206,32284,-5602,32213,-5998,32137,-6393,32056,-6787,31970,-7180,31880,-7572,31785,-7962,31684,-8352,31580,-8740,31470,-9127,31356,-9512,31236,-9896,31113,-10279,30984,-10660,30851,-11039,30713,-11417,30571,-11793,30424,-12167,30272,-12540,30116,-12910,29955,-13279,29790,-13646,29621,-14010,29446,-14373,29268,-14733,29085,-15091,28897,-15447,28706,-15800,28510,-16151,28309,-16500,28105,-16846,27896,-17190,27683,-17531,27466,-17869,27244,-18205,27019,-18538,26789,-18868,26556,-19195,26318,-19520,26077,-19841,25831,-20160,25582,-20475,25329,-20788,25072,-21097,24811,-21403,24546,-21706,24278,-22005,24006,-22302,23731,-22595,23452,-22884,23169,-23170,22883,-23453,22594,-23732,22301,-24007,22004,-24279,21705,-24547,21402,-24812,21096,-25073,20787,-25330,20474,-25583,20159,-25832,19840,-26078,19519,-26319,19194,-26557,18867,-26790,18537,-27020,18204,-27245,17868,-27467,17530,-27684,17189,-27897,16845,-28106,16499,-28310,16150,-28511,15799,-28707,15446,-28898,15090,-29086,14732,-29269,14372,-29447,14009,-29622,13645,-29791,13278,-29956,12909,-30117,12539,-30273,12166,-30425,11792,-30572,11416,-30714,11038,-30852,10659,-30985,10278,-31114,9895,-31237,9511,-31357,9126,-31471,8739,-31581,8351,-31685,7961,-31786,7571,-31881,7179,-31971,6786,-32057,6392,-32138,5997,-32214,5601,-32285,5205,-32351,4807,-32413,4409,-32469,4011,-32521,3611,-32568,3211,-32610,2811,-32647,2410,-32679,2009,-32706,1607,-32728,1206,-32745,804,-32758,402,-32765,0,-32767,-403,-32765,-805,-32758,-1207,-32745,-1608,-32728,-2010,-32706,-2411,-32679,-2812,-32647,-3212,-32610,-3612,-32568,-4012,-32521,-4410,-32469,-4808,-32413,-5206,-32351,-5602,-32285,-5998,-32214,-6393,-32138,-6787,-32057,-7180,-31971,-7572,-31881,-7962,-31786,-8352,-31685,-8740,-31581,-9127,-31471,-9512,-31357,-9896,-31237,-10279,-31114,-10660,-30985,-11039,-30852,-11417,-30714,-11793,-30572,-12167,-30425,-12540,-30273,-12910,-30117,-13279,-29956,-13646,-29791,-14010,-29622,-14373,-29447,-14733,-29269,-15091,-29086,-15447,-28898,-15800,-28707,-16151,-28511,-16500,-28310,-16846,-28106,-17190,-27897,-17531,-27684,-17869,-27467,-18205,-27245,-18538,-27020,-18868,-26790,-19195,-26557,-19520,-26319,-19841,-26078,-20160,-25832,-20475,-25583,-20788,-25330,-21097,-25073,-21403,-24812,-21706,-24547,-22005,-24279,-22302,-24007,-22595,-23732,-22884,-23453,-23170,-23170,-23453,-22884,-23732,-22595,-24007,-22302,-24279,-22005,-24547,-21706,-24812,-21403,-25073,-21097,-25330,-20788,-25583,-20475,-25832,-20160,-26078,-19841,-26319,-19520,-26557,-19195,-26790,-18868,-27020,-18538,-27245,-18205,-27467,-17869,-27684,-17531,-27897,-17190,-28106,-16846,-28310,-16500,-28511,-16151,-28707,-15800,-28898,-15447,-29086,-15091,-29269,-14733,-29447,-14373,-29622,-14010,-29791,-13646,-29956,-13279,-30117,-12910,-30273,-12540,-30425,-12167,-30572,-11793,-30714,-11417,-30852,-11039,-30985,-10660,-31114,-10279,-31237,-9896,-31357,-9512,-31471,-9127,-31581,-8740,-31685,-8352,-31786,-7962,-31881,-7572,-31971,-7180,-32057,-6787,-32138,-6393,-32214,-5998,-32285,-5602,-32351,-5206,-32413,-4808,-32469,-4410,-32521,-4012,-32568,-3612,-32610,-3212,-32647,-2812,-32679,-2411,-32706,-2010,-32728,-1608,-32745,-1207,-32758,-805,-32765,-403, 32767,0,32761,-604,32744,-1207,32717,-1809,32678,-2411,32628,-3012,32567,-3612,32495,-4211,32412,-4808,32318,-5404,32213,-5998,32097,-6590,31970,-7180,31833,-7767,31684,-8352,31525,-8933,31356,-9512,31175,-10088,30984,-10660,30783,-11228,30571,-11793,30349,-12354,30116,-12910,29873,-13463,29621,-14010,29358,-14553,29085,-15091,28802,-15624,28510,-16151,28208,-16673,27896,-17190,27575,-17700,27244,-18205,26905,-18703,26556,-19195,26198,-19681,25831,-20160,25456,-20632,25072,-21097,24679,-21555,24278,-22005,23869,-22449,23452,-22884,23027,-23312,22594,-23732,22153,-24144,21705,-24547,21249,-24943,20787,-25330,20317,-25708,19840,-26078,19357,-26438,18867,-26790,18371,-27133,17868,-27467,17360,-27791,16845,-28106,16325,-28411,15799,-28707,15268,-28993,14732,-29269,14191,-29535,13645,-29791,13094,-30037,12539,-30273,11980,-30499,11416,-30714,10849,-30919,10278,-31114,9703,-31298,9126,-31471,8545,-31634,7961,-31786,7375,-31927,6786,-32057,6195,-32177,5601,-32285,5006,-32383,4409,-32469,3811,-32545,3211,-32610,2610,-32663,2009,-32706,1406,-32737,804,-32758,201,-32767,-403,-32765,-1006,-32752,-1608,-32728,-2210,-32693,-2812,-32647,-3412,-32589,-4012,-32521,-4609,-32442,-5206,-32351,-5800,-32250,-6393,-32138,-6983,-32015,-7572,-31881,-8157,-31736,-8740,-31581,-9320,-31414,-9896,-31237,-10470,-31050,-11039,-30852,-11605,-30644,-12167,-30425,-12725,-30196,-13279,-29956,-13828,-29707,-14373,-29447,-14912,-29178,-15447,-28898,-15976,-28609,-16500,-28310,-17018,-28002,-17531,-27684,-18037,-27356,-18538,-27020,-19032,-26674,-19520,-26319,-20001,-25955,-20475,-25583,-20943,-25202,-21403,-24812,-21856,-24414,-22302,-24007,-22740,-23593,-23170,-23170,-23593,-22740,-24007,-22302,-24414,-21856,-24812,-21403,-25202,-20943,-25583,-20475,-25955,-20001,-26319,-19520,-26674,-19032,-27020,-18538,-27356,-18037,-27684,-17531,-28002,-17018,-28310,-16500,-28609,-15976,-28898,-15447,-29178,-14912,-29447,-14373,-29707,-13828,-29956,-13279,-30196,-12725,-30425,-12167,-30644,-11605,-30852,-11039,-31050,-10470,-31237,-9896,-31414,-9320,-31581,-8740,-31736,-8157,-31881,-7572,-32015,-6983,-32138,-6393,-32250,-5800,-32351,-5206,-32442,-4609,-32521,-4012,-32589,-3412,-32647,-2812,-32693,-2210,-32728,-1608,-32752,-1006,-32765,-403,-32767,201,-32758,804,-32737,1406,-32706,2009,-32663,2610,-32610,3211,-32545,3811,-32469,4409,-32383,5006,-32285,5601,-32177,6195,-32057,6786,-31927,7375,-31786,7961,-31634,8545,-31471,9126,-31298,9703,-31114,10278,-30919,10849,-30714,11416,-30499,11980,-30273,12539,-30037,13094,-29791,13645,-29535,14191,-29269,14732,-28993,15268,-28707,15799,-28411,16325,-28106,16845,-27791,17360,-27467,17868,-27133,18371,-26790,18867,-26438,19357,-26078,19840,-25708,20317,-25330,20787,-24943,21249,-24547,21705,-24144,22153,-23732,22594,-23312,23027,-22884,23452,-22449,23869,-22005,24278,-21555,24679,-21097,25072,-20632,25456,-20160,25831,-19681,26198,-19195,26556,-18703,26905,-18205,27244,-17700,27575,-17190,27896,-16673,28208,-16151,28510,-15624,28802,-15091,29085,-14553,29358,-14010,29621,-13463,29873,-12910,30116,-12354,30349,-11793,30571,-11228,30783,-10660,30984,-10088,31175,-9512,31356,-8933,31525,-8352,31684,-7767,31833,-7180,31970,-6590,32097,-5998,32213,-5404,32318,-4808,32412,-4211,32495,-3612,32567,-3012,32628,-2411,32678,-1809,32717,-1207,32744,-604,32761 }; - +#ifndef __AVX2__ void dft1024(int16_t *x,int16_t *y,int scale) { @@ -2685,13 +4320,127 @@ void idft1024(int16_t *x,int16_t *y,int scale) } -int16_t tw2048[2048] __attribute__((aligned(16))) = {32767,0,32766,-101,32766,-202,32765,-302,32764,-403,32763,-503,32761,-604,32759,-704,32757,-805,32754,-905,32751,-1006,32748,-1106,32744,-1207,32740,-1307,32736,-1407,32732,-1508,32727,-1608,32722,-1709,32717,-1809,32711,-1909,32705,-2010,32699,-2110,32692,-2210,32685,-2311,32678,-2411,32670,-2511,32662,-2611,32654,-2712,32646,-2812,32637,-2912,32628,-3012,32618,-3112,32609,-3212,32599,-3312,32588,-3412,32578,-3512,32567,-3612,32556,-3712,32544,-3812,32532,-3912,32520,-4012,32508,-4111,32495,-4211,32482,-4311,32468,-4410,32455,-4510,32441,-4609,32426,-4709,32412,-4808,32397,-4908,32382,-5007,32366,-5107,32350,-5206,32334,-5305,32318,-5404,32301,-5503,32284,-5602,32267,-5701,32249,-5800,32231,-5899,32213,-5998,32194,-6097,32176,-6196,32156,-6294,32137,-6393,32117,-6492,32097,-6590,32077,-6689,32056,-6787,32035,-6885,32014,-6983,31992,-7082,31970,-7180,31948,-7278,31926,-7376,31903,-7474,31880,-7572,31856,-7669,31833,-7767,31809,-7865,31785,-7962,31760,-8060,31735,-8157,31710,-8254,31684,-8352,31659,-8449,31633,-8546,31606,-8643,31580,-8740,31553,-8837,31525,-8933,31498,-9030,31470,-9127,31442,-9223,31413,-9320,31385,-9416,31356,-9512,31326,-9608,31297,-9704,31267,-9800,31236,-9896,31206,-9992,31175,-10088,31144,-10183,31113,-10279,31081,-10374,31049,-10470,31017,-10565,30984,-10660,30951,-10755,30918,-10850,30885,-10945,30851,-11039,30817,-11134,30783,-11228,30748,-11323,30713,-11417,30678,-11511,30643,-11605,30607,-11699,30571,-11793,30535,-11887,30498,-11981,30461,-12074,30424,-12167,30386,-12261,30349,-12354,30311,-12447,30272,-12540,30234,-12633,30195,-12725,30156,-12818,30116,-12910,30076,-13003,30036,-13095,29996,-13187,29955,-13279,29915,-13371,29873,-13463,29832,-13554,29790,-13646,29748,-13737,29706,-13828,29663,-13919,29621,-14010,29577,-14101,29534,-14192,29490,-14282,29446,-14373,29402,-14463,29358,-14553,29313,-14643,29268,-14733,29222,-14823,29177,-14912,29131,-15002,29085,-15091,29038,-15180,28992,-15269,28945,-15358,28897,-15447,28850,-15535,28802,-15624,28754,-15712,28706,-15800,28657,-15888,28608,-15976,28559,-16064,28510,-16151,28460,-16239,28410,-16326,28360,-16413,28309,-16500,28259,-16587,28208,-16673,28156,-16760,28105,-16846,28053,-16932,28001,-17018,27948,-17104,27896,-17190,27843,-17275,27790,-17361,27736,-17446,27683,-17531,27629,-17616,27575,-17700,27520,-17785,27466,-17869,27411,-17953,27355,-18037,27300,-18121,27244,-18205,27188,-18288,27132,-18372,27076,-18455,27019,-18538,26962,-18621,26905,-18703,26847,-18786,26789,-18868,26731,-18950,26673,-19032,26615,-19114,26556,-19195,26497,-19277,26437,-19358,26378,-19439,26318,-19520,26258,-19600,26198,-19681,26137,-19761,26077,-19841,26016,-19921,25954,-20001,25893,-20080,25831,-20160,25769,-20239,25707,-20318,25645,-20397,25582,-20475,25519,-20554,25456,-20632,25392,-20710,25329,-20788,25265,-20865,25201,-20943,25136,-21020,25072,-21097,25007,-21174,24942,-21250,24877,-21327,24811,-21403,24745,-21479,24679,-21555,24613,-21630,24546,-21706,24480,-21781,24413,-21856,24346,-21931,24278,-22005,24211,-22080,24143,-22154,24075,-22228,24006,-22302,23938,-22375,23869,-22449,23800,-22522,23731,-22595,23661,-22667,23592,-22740,23522,-22812,23452,-22884,23382,-22956,23311,-23028,23240,-23099,23169,-23170,23098,-23241,23027,-23312,22955,-23383,22883,-23453,22811,-23523,22739,-23593,22666,-23662,22594,-23732,22521,-23801,22448,-23870,22374,-23939,22301,-24007,22227,-24076,22153,-24144,22079,-24212,22004,-24279,21930,-24347,21855,-24414,21780,-24481,21705,-24547,21629,-24614,21554,-24680,21478,-24746,21402,-24812,21326,-24878,21249,-24943,21173,-25008,21096,-25073,21019,-25137,20942,-25202,20864,-25266,20787,-25330,20709,-25393,20631,-25457,20553,-25520,20474,-25583,20396,-25646,20317,-25708,20238,-25770,20159,-25832,20079,-25894,20000,-25955,19920,-26017,19840,-26078,19760,-26138,19680,-26199,19599,-26259,19519,-26319,19438,-26379,19357,-26438,19276,-26498,19194,-26557,19113,-26616,19031,-26674,18949,-26732,18867,-26790,18785,-26848,18702,-26906,18620,-26963,18537,-27020,18454,-27077,18371,-27133,18287,-27189,18204,-27245,18120,-27301,18036,-27356,17952,-27412,17868,-27467,17784,-27521,17699,-27576,17615,-27630,17530,-27684,17445,-27737,17360,-27791,17274,-27844,17189,-27897,17103,-27949,17017,-28002,16931,-28054,16845,-28106,16759,-28157,16672,-28209,16586,-28260,16499,-28310,16412,-28361,16325,-28411,16238,-28461,16150,-28511,16063,-28560,15975,-28609,15887,-28658,15799,-28707,15711,-28755,15623,-28803,15534,-28851,15446,-28898,15357,-28946,15268,-28993,15179,-29039,15090,-29086,15001,-29132,14911,-29178,14822,-29223,14732,-29269,14642,-29314,14552,-29359,14462,-29403,14372,-29447,14281,-29491,14191,-29535,14100,-29578,14009,-29622,13918,-29664,13827,-29707,13736,-29749,13645,-29791,13553,-29833,13462,-29874,13370,-29916,13278,-29956,13186,-29997,13094,-30037,13002,-30077,12909,-30117,12817,-30157,12724,-30196,12632,-30235,12539,-30273,12446,-30312,12353,-30350,12260,-30387,12166,-30425,12073,-30462,11980,-30499,11886,-30536,11792,-30572,11698,-30608,11604,-30644,11510,-30679,11416,-30714,11322,-30749,11227,-30784,11133,-30818,11038,-30852,10944,-30886,10849,-30919,10754,-30952,10659,-30985,10564,-31018,10469,-31050,10373,-31082,10278,-31114,10182,-31145,10087,-31176,9991,-31207,9895,-31237,9799,-31268,9703,-31298,9607,-31327,9511,-31357,9415,-31386,9319,-31414,9222,-31443,9126,-31471,9029,-31499,8932,-31526,8836,-31554,8739,-31581,8642,-31607,8545,-31634,8448,-31660,8351,-31685,8253,-31711,8156,-31736,8059,-31761,7961,-31786,7864,-31810,7766,-31834,7668,-31857,7571,-31881,7473,-31904,7375,-31927,7277,-31949,7179,-31971,7081,-31993,6982,-32015,6884,-32036,6786,-32057,6688,-32078,6589,-32098,6491,-32118,6392,-32138,6293,-32157,6195,-32177,6096,-32195,5997,-32214,5898,-32232,5799,-32250,5700,-32268,5601,-32285,5502,-32302,5403,-32319,5304,-32335,5205,-32351,5106,-32367,5006,-32383,4907,-32398,4807,-32413,4708,-32427,4608,-32442,4509,-32456,4409,-32469,4310,-32483,4210,-32496,4110,-32509,4011,-32521,3911,-32533,3811,-32545,3711,-32557,3611,-32568,3511,-32579,3411,-32589,3311,-32600,3211,-32610,3111,-32619,3011,-32629,2911,-32638,2811,-32647,2711,-32655,2610,-32663,2510,-32671,2410,-32679,2310,-32686,2209,-32693,2109,-32700,2009,-32706,1908,-32712,1808,-32718,1708,-32723,1607,-32728,1507,-32733,1406,-32737,1306,-32741,1206,-32745,1105,-32749,1005,-32752,904,-32755,804,-32758,703,-32760,603,-32762,502,-32764,402,-32765,301,-32766,201,-32767,100,-32767,0,-32767,-101,-32767,-202,-32767,-302,-32766,-403,-32765,-503,-32764,-604,-32762,-704,-32760,-805,-32758,-905,-32755,-1006,-32752,-1106,-32749,-1207,-32745,-1307,-32741,-1407,-32737,-1508,-32733,-1608,-32728,-1709,-32723,-1809,-32718,-1909,-32712,-2010,-32706,-2110,-32700,-2210,-32693,-2311,-32686,-2411,-32679,-2511,-32671,-2611,-32663,-2712,-32655,-2812,-32647,-2912,-32638,-3012,-32629,-3112,-32619,-3212,-32610,-3312,-32600,-3412,-32589,-3512,-32579,-3612,-32568,-3712,-32557,-3812,-32545,-3912,-32533,-4012,-32521,-4111,-32509,-4211,-32496,-4311,-32483,-4410,-32469,-4510,-32456,-4609,-32442,-4709,-32427,-4808,-32413,-4908,-32398,-5007,-32383,-5107,-32367,-5206,-32351,-5305,-32335,-5404,-32319,-5503,-32302,-5602,-32285,-5701,-32268,-5800,-32250,-5899,-32232,-5998,-32214,-6097,-32195,-6196,-32177,-6294,-32157,-6393,-32138,-6492,-32118,-6590,-32098,-6689,-32078,-6787,-32057,-6885,-32036,-6983,-32015,-7082,-31993,-7180,-31971,-7278,-31949,-7376,-31927,-7474,-31904,-7572,-31881,-7669,-31857,-7767,-31834,-7865,-31810,-7962,-31786,-8060,-31761,-8157,-31736,-8254,-31711,-8352,-31685,-8449,-31660,-8546,-31634,-8643,-31607,-8740,-31581,-8837,-31554,-8933,-31526,-9030,-31499,-9127,-31471,-9223,-31443,-9320,-31414,-9416,-31386,-9512,-31357,-9608,-31327,-9704,-31298,-9800,-31268,-9896,-31237,-9992,-31207,-10088,-31176,-10183,-31145,-10279,-31114,-10374,-31082,-10470,-31050,-10565,-31018,-10660,-30985,-10755,-30952,-10850,-30919,-10945,-30886,-11039,-30852,-11134,-30818,-11228,-30784,-11323,-30749,-11417,-30714,-11511,-30679,-11605,-30644,-11699,-30608,-11793,-30572,-11887,-30536,-11981,-30499,-12074,-30462,-12167,-30425,-12261,-30387,-12354,-30350,-12447,-30312,-12540,-30273,-12633,-30235,-12725,-30196,-12818,-30157,-12910,-30117,-13003,-30077,-13095,-30037,-13187,-29997,-13279,-29956,-13371,-29916,-13463,-29874,-13554,-29833,-13646,-29791,-13737,-29749,-13828,-29707,-13919,-29664,-14010,-29622,-14101,-29578,-14192,-29535,-14282,-29491,-14373,-29447,-14463,-29403,-14553,-29359,-14643,-29314,-14733,-29269,-14823,-29223,-14912,-29178,-15002,-29132,-15091,-29086,-15180,-29039,-15269,-28993,-15358,-28946,-15447,-28898,-15535,-28851,-15624,-28803,-15712,-28755,-15800,-28707,-15888,-28658,-15976,-28609,-16064,-28560,-16151,-28511,-16239,-28461,-16326,-28411,-16413,-28361,-16500,-28310,-16587,-28260,-16673,-28209,-16760,-28157,-16846,-28106,-16932,-28054,-17018,-28002,-17104,-27949,-17190,-27897,-17275,-27844,-17361,-27791,-17446,-27737,-17531,-27684,-17616,-27630,-17700,-27576,-17785,-27521,-17869,-27467,-17953,-27412,-18037,-27356,-18121,-27301,-18205,-27245,-18288,-27189,-18372,-27133,-18455,-27077,-18538,-27020,-18621,-26963,-18703,-26906,-18786,-26848,-18868,-26790,-18950,-26732,-19032,-26674,-19114,-26616,-19195,-26557,-19277,-26498,-19358,-26438,-19439,-26379,-19520,-26319,-19600,-26259,-19681,-26199,-19761,-26138,-19841,-26078,-19921,-26017,-20001,-25955,-20080,-25894,-20160,-25832,-20239,-25770,-20318,-25708,-20397,-25646,-20475,-25583,-20554,-25520,-20632,-25457,-20710,-25393,-20788,-25330,-20865,-25266,-20943,-25202,-21020,-25137,-21097,-25073,-21174,-25008,-21250,-24943,-21327,-24878,-21403,-24812,-21479,-24746,-21555,-24680,-21630,-24614,-21706,-24547,-21781,-24481,-21856,-24414,-21931,-24347,-22005,-24279,-22080,-24212,-22154,-24144,-22228,-24076,-22302,-24007,-22375,-23939,-22449,-23870,-22522,-23801,-22595,-23732,-22667,-23662,-22740,-23593,-22812,-23523,-22884,-23453,-22956,-23383,-23028,-23312,-23099,-23241,-23170,-23170,-23241,-23099,-23312,-23028,-23383,-22956,-23453,-22884,-23523,-22812,-23593,-22740,-23662,-22667,-23732,-22595,-23801,-22522,-23870,-22449,-23939,-22375,-24007,-22302,-24076,-22228,-24144,-22154,-24212,-22080,-24279,-22005,-24347,-21931,-24414,-21856,-24481,-21781,-24547,-21706,-24614,-21630,-24680,-21555,-24746,-21479,-24812,-21403,-24878,-21327,-24943,-21250,-25008,-21174,-25073,-21097,-25137,-21020,-25202,-20943,-25266,-20865,-25330,-20788,-25393,-20710,-25457,-20632,-25520,-20554,-25583,-20475,-25646,-20397,-25708,-20318,-25770,-20239,-25832,-20160,-25894,-20080,-25955,-20001,-26017,-19921,-26078,-19841,-26138,-19761,-26199,-19681,-26259,-19600,-26319,-19520,-26379,-19439,-26438,-19358,-26498,-19277,-26557,-19195,-26616,-19114,-26674,-19032,-26732,-18950,-26790,-18868,-26848,-18786,-26906,-18703,-26963,-18621,-27020,-18538,-27077,-18455,-27133,-18372,-27189,-18288,-27245,-18205,-27301,-18121,-27356,-18037,-27412,-17953,-27467,-17869,-27521,-17785,-27576,-17700,-27630,-17616,-27684,-17531,-27737,-17446,-27791,-17361,-27844,-17275,-27897,-17190,-27949,-17104,-28002,-17018,-28054,-16932,-28106,-16846,-28157,-16760,-28209,-16673,-28260,-16587,-28310,-16500,-28361,-16413,-28411,-16326,-28461,-16239,-28511,-16151,-28560,-16064,-28609,-15976,-28658,-15888,-28707,-15800,-28755,-15712,-28803,-15624,-28851,-15535,-28898,-15447,-28946,-15358,-28993,-15269,-29039,-15180,-29086,-15091,-29132,-15002,-29178,-14912,-29223,-14823,-29269,-14733,-29314,-14643,-29359,-14553,-29403,-14463,-29447,-14373,-29491,-14282,-29535,-14192,-29578,-14101,-29622,-14010,-29664,-13919,-29707,-13828,-29749,-13737,-29791,-13646,-29833,-13554,-29874,-13463,-29916,-13371,-29956,-13279,-29997,-13187,-30037,-13095,-30077,-13003,-30117,-12910,-30157,-12818,-30196,-12725,-30235,-12633,-30273,-12540,-30312,-12447,-30350,-12354,-30387,-12261,-30425,-12167,-30462,-12074,-30499,-11981,-30536,-11887,-30572,-11793,-30608,-11699,-30644,-11605,-30679,-11511,-30714,-11417,-30749,-11323,-30784,-11228,-30818,-11134,-30852,-11039,-30886,-10945,-30919,-10850,-30952,-10755,-30985,-10660,-31018,-10565,-31050,-10470,-31082,-10374,-31114,-10279,-31145,-10183,-31176,-10088,-31207,-9992,-31237,-9896,-31268,-9800,-31298,-9704,-31327,-9608,-31357,-9512,-31386,-9416,-31414,-9320,-31443,-9223,-31471,-9127,-31499,-9030,-31526,-8933,-31554,-8837,-31581,-8740,-31607,-8643,-31634,-8546,-31660,-8449,-31685,-8352,-31711,-8254,-31736,-8157,-31761,-8060,-31786,-7962,-31810,-7865,-31834,-7767,-31857,-7669,-31881,-7572,-31904,-7474,-31927,-7376,-31949,-7278,-31971,-7180,-31993,-7082,-32015,-6983,-32036,-6885,-32057,-6787,-32078,-6689,-32098,-6590,-32118,-6492,-32138,-6393,-32157,-6294,-32177,-6196,-32195,-6097,-32214,-5998,-32232,-5899,-32250,-5800,-32268,-5701,-32285,-5602,-32302,-5503,-32319,-5404,-32335,-5305,-32351,-5206,-32367,-5107,-32383,-5007,-32398,-4908,-32413,-4808,-32427,-4709,-32442,-4609,-32456,-4510,-32469,-4410,-32483,-4311,-32496,-4211,-32509,-4111,-32521,-4012,-32533,-3912,-32545,-3812,-32557,-3712,-32568,-3612,-32579,-3512,-32589,-3412,-32600,-3312,-32610,-3212,-32619,-3112,-32629,-3012,-32638,-2912,-32647,-2812,-32655,-2712,-32663,-2611,-32671,-2511,-32679,-2411,-32686,-2311,-32693,-2210,-32700,-2110,-32706,-2010,-32712,-1909,-32718,-1809,-32723,-1709,-32728,-1608,-32733,-1508,-32737,-1407,-32741,-1307,-32745,-1207,-32749,-1106,-32752,-1006,-32755,-905,-32758,-805,-32760,-704,-32762,-604,-32764,-503,-32765,-403,-32766,-302,-32767,-202,-32767,-101}; +#else //__AVX2__ +void dft1024(int16_t *x,int16_t *y,int scale) +{ + + simd256_q15_t xtmp[128],ytmp[128],*tw1024_256p=(simd256_q15_t *)tw1024,*x256=(simd256_q15_t *)x,*y256=(simd256_q15_t *)y,*y256p=(simd256_q15_t *)y; + simd256_q15_t *ytmpp = &ytmp[0]; + int i,j; + + for (i=0,j=0; i<128; i+=4,j++) { + transpose16_ooff_simd256(x256+i,xtmp+j,32); + } + + + dft256((int16_t*)(xtmp),(int16_t*)(ytmp),1); + dft256((int16_t*)(xtmp+32),(int16_t*)(ytmp+32),1); + dft256((int16_t*)(xtmp+64),(int16_t*)(ytmp+64),1); + dft256((int16_t*)(xtmp+96),(int16_t*)(ytmp+96),1); + + for (i=0; i<32; i++) { + bfly4_256(ytmpp,ytmpp+32,ytmpp+64,ytmpp+96, + y256p,y256p+32,y256p+64,y256p+96, + tw1024_256p,tw1024_256p+32,tw1024_256p+64); + tw1024_256p++; + y256p++; + ytmpp++; + } + + if (scale>0) { + + for (i=0; i<8; i++) { + y256[0] = shiftright_int16_simd256(y256[0],1); + y256[1] = shiftright_int16_simd256(y256[1],1); + y256[2] = shiftright_int16_simd256(y256[2],1); + y256[3] = shiftright_int16_simd256(y256[3],1); + y256[4] = shiftright_int16_simd256(y256[4],1); + y256[5] = shiftright_int16_simd256(y256[5],1); + y256[6] = shiftright_int16_simd256(y256[6],1); + y256[7] = shiftright_int16_simd256(y256[7],1); + y256[8] = shiftright_int16_simd256(y256[8],1); + y256[9] = shiftright_int16_simd256(y256[9],1); + y256[10] = shiftright_int16_simd256(y256[10],1); + y256[11] = shiftright_int16_simd256(y256[11],1); + y256[12] = shiftright_int16_simd256(y256[12],1); + y256[13] = shiftright_int16_simd256(y256[13],1); + y256[14] = shiftright_int16_simd256(y256[14],1); + y256[15] = shiftright_int16_simd256(y256[15],1); + + y256+=16; + } + + } + + _mm_empty(); + _m_empty(); + +} + +void idft1024(int16_t *x,int16_t *y,int scale) +{ + + simd256_q15_t xtmp[128],ytmp[128],*tw1024_256p=(simd256_q15_t *)tw1024,*x256=(simd256_q15_t *)x,*y256=(simd256_q15_t *)y,*y256p=(simd256_q15_t *)y; + simd256_q15_t *ytmpp = &ytmp[0]; + int i,j; + + for (i=0,j=0; i<128; i+=4,j++) { + transpose16_ooff_simd256(x256+i,xtmp+j,32); + } + + + idft256((int16_t*)(xtmp),(int16_t*)(ytmp),1); + idft256((int16_t*)(xtmp+32),(int16_t*)(ytmp+32),1); + idft256((int16_t*)(xtmp+64),(int16_t*)(ytmp+64),1); + idft256((int16_t*)(xtmp+96),(int16_t*)(ytmp+96),1); + + for (i=0; i<32; i++) { + ibfly4_256(ytmpp,ytmpp+32,ytmpp+64,ytmpp+96, + y256p,y256p+32,y256p+64,y256p+96, + tw1024_256p,tw1024_256p+32,tw1024_256p+64); + tw1024_256p++; + y256p++; + ytmpp++; + } + + if (scale>0) { + for (i=0; i<8; i++) { + y256[0] = shiftright_int16_simd256(y256[0],1); + y256[1] = shiftright_int16_simd256(y256[1],1); + y256[2] = shiftright_int16_simd256(y256[2],1); + y256[3] = shiftright_int16_simd256(y256[3],1); + y256[4] = shiftright_int16_simd256(y256[4],1); + y256[5] = shiftright_int16_simd256(y256[5],1); + y256[6] = shiftright_int16_simd256(y256[6],1); + y256[7] = shiftright_int16_simd256(y256[7],1); + y256[8] = shiftright_int16_simd256(y256[8],1); + y256[9] = shiftright_int16_simd256(y256[9],1); + y256[10] = shiftright_int16_simd256(y256[10],1); + y256[11] = shiftright_int16_simd256(y256[11],1); + y256[12] = shiftright_int16_simd256(y256[12],1); + y256[13] = shiftright_int16_simd256(y256[13],1); + y256[14] = shiftright_int16_simd256(y256[14],1); + y256[15] = shiftright_int16_simd256(y256[15],1); + + y256+=16; + } + } + + _mm_empty(); + _m_empty(); + +} +#endif + +int16_t tw2048[2048] __attribute__((aligned(32))) = {32767,0,32766,-101,32766,-202,32765,-302,32764,-403,32763,-503,32761,-604,32759,-704,32757,-805,32754,-905,32751,-1006,32748,-1106,32744,-1207,32740,-1307,32736,-1407,32732,-1508,32727,-1608,32722,-1709,32717,-1809,32711,-1909,32705,-2010,32699,-2110,32692,-2210,32685,-2311,32678,-2411,32670,-2511,32662,-2611,32654,-2712,32646,-2812,32637,-2912,32628,-3012,32618,-3112,32609,-3212,32599,-3312,32588,-3412,32578,-3512,32567,-3612,32556,-3712,32544,-3812,32532,-3912,32520,-4012,32508,-4111,32495,-4211,32482,-4311,32468,-4410,32455,-4510,32441,-4609,32426,-4709,32412,-4808,32397,-4908,32382,-5007,32366,-5107,32350,-5206,32334,-5305,32318,-5404,32301,-5503,32284,-5602,32267,-5701,32249,-5800,32231,-5899,32213,-5998,32194,-6097,32176,-6196,32156,-6294,32137,-6393,32117,-6492,32097,-6590,32077,-6689,32056,-6787,32035,-6885,32014,-6983,31992,-7082,31970,-7180,31948,-7278,31926,-7376,31903,-7474,31880,-7572,31856,-7669,31833,-7767,31809,-7865,31785,-7962,31760,-8060,31735,-8157,31710,-8254,31684,-8352,31659,-8449,31633,-8546,31606,-8643,31580,-8740,31553,-8837,31525,-8933,31498,-9030,31470,-9127,31442,-9223,31413,-9320,31385,-9416,31356,-9512,31326,-9608,31297,-9704,31267,-9800,31236,-9896,31206,-9992,31175,-10088,31144,-10183,31113,-10279,31081,-10374,31049,-10470,31017,-10565,30984,-10660,30951,-10755,30918,-10850,30885,-10945,30851,-11039,30817,-11134,30783,-11228,30748,-11323,30713,-11417,30678,-11511,30643,-11605,30607,-11699,30571,-11793,30535,-11887,30498,-11981,30461,-12074,30424,-12167,30386,-12261,30349,-12354,30311,-12447,30272,-12540,30234,-12633,30195,-12725,30156,-12818,30116,-12910,30076,-13003,30036,-13095,29996,-13187,29955,-13279,29915,-13371,29873,-13463,29832,-13554,29790,-13646,29748,-13737,29706,-13828,29663,-13919,29621,-14010,29577,-14101,29534,-14192,29490,-14282,29446,-14373,29402,-14463,29358,-14553,29313,-14643,29268,-14733,29222,-14823,29177,-14912,29131,-15002,29085,-15091,29038,-15180,28992,-15269,28945,-15358,28897,-15447,28850,-15535,28802,-15624,28754,-15712,28706,-15800,28657,-15888,28608,-15976,28559,-16064,28510,-16151,28460,-16239,28410,-16326,28360,-16413,28309,-16500,28259,-16587,28208,-16673,28156,-16760,28105,-16846,28053,-16932,28001,-17018,27948,-17104,27896,-17190,27843,-17275,27790,-17361,27736,-17446,27683,-17531,27629,-17616,27575,-17700,27520,-17785,27466,-17869,27411,-17953,27355,-18037,27300,-18121,27244,-18205,27188,-18288,27132,-18372,27076,-18455,27019,-18538,26962,-18621,26905,-18703,26847,-18786,26789,-18868,26731,-18950,26673,-19032,26615,-19114,26556,-19195,26497,-19277,26437,-19358,26378,-19439,26318,-19520,26258,-19600,26198,-19681,26137,-19761,26077,-19841,26016,-19921,25954,-20001,25893,-20080,25831,-20160,25769,-20239,25707,-20318,25645,-20397,25582,-20475,25519,-20554,25456,-20632,25392,-20710,25329,-20788,25265,-20865,25201,-20943,25136,-21020,25072,-21097,25007,-21174,24942,-21250,24877,-21327,24811,-21403,24745,-21479,24679,-21555,24613,-21630,24546,-21706,24480,-21781,24413,-21856,24346,-21931,24278,-22005,24211,-22080,24143,-22154,24075,-22228,24006,-22302,23938,-22375,23869,-22449,23800,-22522,23731,-22595,23661,-22667,23592,-22740,23522,-22812,23452,-22884,23382,-22956,23311,-23028,23240,-23099,23169,-23170,23098,-23241,23027,-23312,22955,-23383,22883,-23453,22811,-23523,22739,-23593,22666,-23662,22594,-23732,22521,-23801,22448,-23870,22374,-23939,22301,-24007,22227,-24076,22153,-24144,22079,-24212,22004,-24279,21930,-24347,21855,-24414,21780,-24481,21705,-24547,21629,-24614,21554,-24680,21478,-24746,21402,-24812,21326,-24878,21249,-24943,21173,-25008,21096,-25073,21019,-25137,20942,-25202,20864,-25266,20787,-25330,20709,-25393,20631,-25457,20553,-25520,20474,-25583,20396,-25646,20317,-25708,20238,-25770,20159,-25832,20079,-25894,20000,-25955,19920,-26017,19840,-26078,19760,-26138,19680,-26199,19599,-26259,19519,-26319,19438,-26379,19357,-26438,19276,-26498,19194,-26557,19113,-26616,19031,-26674,18949,-26732,18867,-26790,18785,-26848,18702,-26906,18620,-26963,18537,-27020,18454,-27077,18371,-27133,18287,-27189,18204,-27245,18120,-27301,18036,-27356,17952,-27412,17868,-27467,17784,-27521,17699,-27576,17615,-27630,17530,-27684,17445,-27737,17360,-27791,17274,-27844,17189,-27897,17103,-27949,17017,-28002,16931,-28054,16845,-28106,16759,-28157,16672,-28209,16586,-28260,16499,-28310,16412,-28361,16325,-28411,16238,-28461,16150,-28511,16063,-28560,15975,-28609,15887,-28658,15799,-28707,15711,-28755,15623,-28803,15534,-28851,15446,-28898,15357,-28946,15268,-28993,15179,-29039,15090,-29086,15001,-29132,14911,-29178,14822,-29223,14732,-29269,14642,-29314,14552,-29359,14462,-29403,14372,-29447,14281,-29491,14191,-29535,14100,-29578,14009,-29622,13918,-29664,13827,-29707,13736,-29749,13645,-29791,13553,-29833,13462,-29874,13370,-29916,13278,-29956,13186,-29997,13094,-30037,13002,-30077,12909,-30117,12817,-30157,12724,-30196,12632,-30235,12539,-30273,12446,-30312,12353,-30350,12260,-30387,12166,-30425,12073,-30462,11980,-30499,11886,-30536,11792,-30572,11698,-30608,11604,-30644,11510,-30679,11416,-30714,11322,-30749,11227,-30784,11133,-30818,11038,-30852,10944,-30886,10849,-30919,10754,-30952,10659,-30985,10564,-31018,10469,-31050,10373,-31082,10278,-31114,10182,-31145,10087,-31176,9991,-31207,9895,-31237,9799,-31268,9703,-31298,9607,-31327,9511,-31357,9415,-31386,9319,-31414,9222,-31443,9126,-31471,9029,-31499,8932,-31526,8836,-31554,8739,-31581,8642,-31607,8545,-31634,8448,-31660,8351,-31685,8253,-31711,8156,-31736,8059,-31761,7961,-31786,7864,-31810,7766,-31834,7668,-31857,7571,-31881,7473,-31904,7375,-31927,7277,-31949,7179,-31971,7081,-31993,6982,-32015,6884,-32036,6786,-32057,6688,-32078,6589,-32098,6491,-32118,6392,-32138,6293,-32157,6195,-32177,6096,-32195,5997,-32214,5898,-32232,5799,-32250,5700,-32268,5601,-32285,5502,-32302,5403,-32319,5304,-32335,5205,-32351,5106,-32367,5006,-32383,4907,-32398,4807,-32413,4708,-32427,4608,-32442,4509,-32456,4409,-32469,4310,-32483,4210,-32496,4110,-32509,4011,-32521,3911,-32533,3811,-32545,3711,-32557,3611,-32568,3511,-32579,3411,-32589,3311,-32600,3211,-32610,3111,-32619,3011,-32629,2911,-32638,2811,-32647,2711,-32655,2610,-32663,2510,-32671,2410,-32679,2310,-32686,2209,-32693,2109,-32700,2009,-32706,1908,-32712,1808,-32718,1708,-32723,1607,-32728,1507,-32733,1406,-32737,1306,-32741,1206,-32745,1105,-32749,1005,-32752,904,-32755,804,-32758,703,-32760,603,-32762,502,-32764,402,-32765,301,-32766,201,-32767,100,-32767,0,-32767,-101,-32767,-202,-32767,-302,-32766,-403,-32765,-503,-32764,-604,-32762,-704,-32760,-805,-32758,-905,-32755,-1006,-32752,-1106,-32749,-1207,-32745,-1307,-32741,-1407,-32737,-1508,-32733,-1608,-32728,-1709,-32723,-1809,-32718,-1909,-32712,-2010,-32706,-2110,-32700,-2210,-32693,-2311,-32686,-2411,-32679,-2511,-32671,-2611,-32663,-2712,-32655,-2812,-32647,-2912,-32638,-3012,-32629,-3112,-32619,-3212,-32610,-3312,-32600,-3412,-32589,-3512,-32579,-3612,-32568,-3712,-32557,-3812,-32545,-3912,-32533,-4012,-32521,-4111,-32509,-4211,-32496,-4311,-32483,-4410,-32469,-4510,-32456,-4609,-32442,-4709,-32427,-4808,-32413,-4908,-32398,-5007,-32383,-5107,-32367,-5206,-32351,-5305,-32335,-5404,-32319,-5503,-32302,-5602,-32285,-5701,-32268,-5800,-32250,-5899,-32232,-5998,-32214,-6097,-32195,-6196,-32177,-6294,-32157,-6393,-32138,-6492,-32118,-6590,-32098,-6689,-32078,-6787,-32057,-6885,-32036,-6983,-32015,-7082,-31993,-7180,-31971,-7278,-31949,-7376,-31927,-7474,-31904,-7572,-31881,-7669,-31857,-7767,-31834,-7865,-31810,-7962,-31786,-8060,-31761,-8157,-31736,-8254,-31711,-8352,-31685,-8449,-31660,-8546,-31634,-8643,-31607,-8740,-31581,-8837,-31554,-8933,-31526,-9030,-31499,-9127,-31471,-9223,-31443,-9320,-31414,-9416,-31386,-9512,-31357,-9608,-31327,-9704,-31298,-9800,-31268,-9896,-31237,-9992,-31207,-10088,-31176,-10183,-31145,-10279,-31114,-10374,-31082,-10470,-31050,-10565,-31018,-10660,-30985,-10755,-30952,-10850,-30919,-10945,-30886,-11039,-30852,-11134,-30818,-11228,-30784,-11323,-30749,-11417,-30714,-11511,-30679,-11605,-30644,-11699,-30608,-11793,-30572,-11887,-30536,-11981,-30499,-12074,-30462,-12167,-30425,-12261,-30387,-12354,-30350,-12447,-30312,-12540,-30273,-12633,-30235,-12725,-30196,-12818,-30157,-12910,-30117,-13003,-30077,-13095,-30037,-13187,-29997,-13279,-29956,-13371,-29916,-13463,-29874,-13554,-29833,-13646,-29791,-13737,-29749,-13828,-29707,-13919,-29664,-14010,-29622,-14101,-29578,-14192,-29535,-14282,-29491,-14373,-29447,-14463,-29403,-14553,-29359,-14643,-29314,-14733,-29269,-14823,-29223,-14912,-29178,-15002,-29132,-15091,-29086,-15180,-29039,-15269,-28993,-15358,-28946,-15447,-28898,-15535,-28851,-15624,-28803,-15712,-28755,-15800,-28707,-15888,-28658,-15976,-28609,-16064,-28560,-16151,-28511,-16239,-28461,-16326,-28411,-16413,-28361,-16500,-28310,-16587,-28260,-16673,-28209,-16760,-28157,-16846,-28106,-16932,-28054,-17018,-28002,-17104,-27949,-17190,-27897,-17275,-27844,-17361,-27791,-17446,-27737,-17531,-27684,-17616,-27630,-17700,-27576,-17785,-27521,-17869,-27467,-17953,-27412,-18037,-27356,-18121,-27301,-18205,-27245,-18288,-27189,-18372,-27133,-18455,-27077,-18538,-27020,-18621,-26963,-18703,-26906,-18786,-26848,-18868,-26790,-18950,-26732,-19032,-26674,-19114,-26616,-19195,-26557,-19277,-26498,-19358,-26438,-19439,-26379,-19520,-26319,-19600,-26259,-19681,-26199,-19761,-26138,-19841,-26078,-19921,-26017,-20001,-25955,-20080,-25894,-20160,-25832,-20239,-25770,-20318,-25708,-20397,-25646,-20475,-25583,-20554,-25520,-20632,-25457,-20710,-25393,-20788,-25330,-20865,-25266,-20943,-25202,-21020,-25137,-21097,-25073,-21174,-25008,-21250,-24943,-21327,-24878,-21403,-24812,-21479,-24746,-21555,-24680,-21630,-24614,-21706,-24547,-21781,-24481,-21856,-24414,-21931,-24347,-22005,-24279,-22080,-24212,-22154,-24144,-22228,-24076,-22302,-24007,-22375,-23939,-22449,-23870,-22522,-23801,-22595,-23732,-22667,-23662,-22740,-23593,-22812,-23523,-22884,-23453,-22956,-23383,-23028,-23312,-23099,-23241,-23170,-23170,-23241,-23099,-23312,-23028,-23383,-22956,-23453,-22884,-23523,-22812,-23593,-22740,-23662,-22667,-23732,-22595,-23801,-22522,-23870,-22449,-23939,-22375,-24007,-22302,-24076,-22228,-24144,-22154,-24212,-22080,-24279,-22005,-24347,-21931,-24414,-21856,-24481,-21781,-24547,-21706,-24614,-21630,-24680,-21555,-24746,-21479,-24812,-21403,-24878,-21327,-24943,-21250,-25008,-21174,-25073,-21097,-25137,-21020,-25202,-20943,-25266,-20865,-25330,-20788,-25393,-20710,-25457,-20632,-25520,-20554,-25583,-20475,-25646,-20397,-25708,-20318,-25770,-20239,-25832,-20160,-25894,-20080,-25955,-20001,-26017,-19921,-26078,-19841,-26138,-19761,-26199,-19681,-26259,-19600,-26319,-19520,-26379,-19439,-26438,-19358,-26498,-19277,-26557,-19195,-26616,-19114,-26674,-19032,-26732,-18950,-26790,-18868,-26848,-18786,-26906,-18703,-26963,-18621,-27020,-18538,-27077,-18455,-27133,-18372,-27189,-18288,-27245,-18205,-27301,-18121,-27356,-18037,-27412,-17953,-27467,-17869,-27521,-17785,-27576,-17700,-27630,-17616,-27684,-17531,-27737,-17446,-27791,-17361,-27844,-17275,-27897,-17190,-27949,-17104,-28002,-17018,-28054,-16932,-28106,-16846,-28157,-16760,-28209,-16673,-28260,-16587,-28310,-16500,-28361,-16413,-28411,-16326,-28461,-16239,-28511,-16151,-28560,-16064,-28609,-15976,-28658,-15888,-28707,-15800,-28755,-15712,-28803,-15624,-28851,-15535,-28898,-15447,-28946,-15358,-28993,-15269,-29039,-15180,-29086,-15091,-29132,-15002,-29178,-14912,-29223,-14823,-29269,-14733,-29314,-14643,-29359,-14553,-29403,-14463,-29447,-14373,-29491,-14282,-29535,-14192,-29578,-14101,-29622,-14010,-29664,-13919,-29707,-13828,-29749,-13737,-29791,-13646,-29833,-13554,-29874,-13463,-29916,-13371,-29956,-13279,-29997,-13187,-30037,-13095,-30077,-13003,-30117,-12910,-30157,-12818,-30196,-12725,-30235,-12633,-30273,-12540,-30312,-12447,-30350,-12354,-30387,-12261,-30425,-12167,-30462,-12074,-30499,-11981,-30536,-11887,-30572,-11793,-30608,-11699,-30644,-11605,-30679,-11511,-30714,-11417,-30749,-11323,-30784,-11228,-30818,-11134,-30852,-11039,-30886,-10945,-30919,-10850,-30952,-10755,-30985,-10660,-31018,-10565,-31050,-10470,-31082,-10374,-31114,-10279,-31145,-10183,-31176,-10088,-31207,-9992,-31237,-9896,-31268,-9800,-31298,-9704,-31327,-9608,-31357,-9512,-31386,-9416,-31414,-9320,-31443,-9223,-31471,-9127,-31499,-9030,-31526,-8933,-31554,-8837,-31581,-8740,-31607,-8643,-31634,-8546,-31660,-8449,-31685,-8352,-31711,-8254,-31736,-8157,-31761,-8060,-31786,-7962,-31810,-7865,-31834,-7767,-31857,-7669,-31881,-7572,-31904,-7474,-31927,-7376,-31949,-7278,-31971,-7180,-31993,-7082,-32015,-6983,-32036,-6885,-32057,-6787,-32078,-6689,-32098,-6590,-32118,-6492,-32138,-6393,-32157,-6294,-32177,-6196,-32195,-6097,-32214,-5998,-32232,-5899,-32250,-5800,-32268,-5701,-32285,-5602,-32302,-5503,-32319,-5404,-32335,-5305,-32351,-5206,-32367,-5107,-32383,-5007,-32398,-4908,-32413,-4808,-32427,-4709,-32442,-4609,-32456,-4510,-32469,-4410,-32483,-4311,-32496,-4211,-32509,-4111,-32521,-4012,-32533,-3912,-32545,-3812,-32557,-3712,-32568,-3612,-32579,-3512,-32589,-3412,-32600,-3312,-32610,-3212,-32619,-3112,-32629,-3012,-32638,-2912,-32647,-2812,-32655,-2712,-32663,-2611,-32671,-2511,-32679,-2411,-32686,-2311,-32693,-2210,-32700,-2110,-32706,-2010,-32712,-1909,-32718,-1809,-32723,-1709,-32728,-1608,-32733,-1508,-32737,-1407,-32741,-1307,-32745,-1207,-32749,-1106,-32752,-1006,-32755,-905,-32758,-805,-32760,-704,-32762,-604,-32764,-503,-32765,-403,-32766,-302,-32767,-202,-32767,-101}; + +#ifndef __AVX2__ void dft2048(int16_t *x,int16_t *y,int scale) { - simdshort_q15_t xtmp[2048],*xtmpp,*x64 = (simdshort_q15_t *)x; + simdshort_q15_t xtmp[1024],*xtmpp,*x64 = (simdshort_q15_t *)x; simd_q15_t ytmp[512],*tw2048_128p=(simd_q15_t *)tw2048,*y128=(simd_q15_t *)y,*y128p=(simd_q15_t *)y; simd_q15_t *ytmpp = &ytmp[0]; int i; @@ -2781,7 +4530,7 @@ void dft2048(int16_t *x,int16_t *y,int scale) void idft2048(int16_t *x,int16_t *y,int scale) { - simdshort_q15_t xtmp[2048],*xtmpp,*x64 = (simdshort_q15_t *)x; + simdshort_q15_t xtmp[1024],*xtmpp,*x64 = (simdshort_q15_t *)x; simd_q15_t ytmp[512],*tw2048_128p=(simd_q15_t *)tw2048,*y128=(simd_q15_t *)y,*y128p=(simd_q15_t *)y; simd_q15_t *ytmpp = &ytmp[0]; int i; @@ -2827,39 +4576,221 @@ void idft2048(int16_t *x,int16_t *y,int scale) } idft1024((int16_t*)(xtmp),(int16_t*)ytmp,1); - idft1024((int16_t*)(xtmp+512),(int16_t*)(ytmp+256),1); + idft1024((int16_t*)(xtmp+512),(int16_t*)(ytmp+256),1); + + + for (i=0; i<256; i++) { + ibfly2(ytmpp,ytmpp+256, + y128p,y128p+256, + tw2048_128p); + tw2048_128p++; + y128p++; + ytmpp++; + } + + if (scale>0) { + y128p = y128; + + for (i=0; i<32; i++) { + y128p[0] = mulhi_int16(y128p[0],ONE_OVER_SQRT2_Q15_128); + y128p[1] = mulhi_int16(y128p[1],ONE_OVER_SQRT2_Q15_128); + y128p[2] = mulhi_int16(y128p[2],ONE_OVER_SQRT2_Q15_128); + y128p[3] = mulhi_int16(y128p[3],ONE_OVER_SQRT2_Q15_128); + y128p[4] = mulhi_int16(y128p[4],ONE_OVER_SQRT2_Q15_128); + y128p[5] = mulhi_int16(y128p[5],ONE_OVER_SQRT2_Q15_128); + y128p[6] = mulhi_int16(y128p[6],ONE_OVER_SQRT2_Q15_128); + y128p[7] = mulhi_int16(y128p[7],ONE_OVER_SQRT2_Q15_128); + y128p[8] = mulhi_int16(y128p[8],ONE_OVER_SQRT2_Q15_128); + y128p[9] = mulhi_int16(y128p[9],ONE_OVER_SQRT2_Q15_128); + y128p[10] = mulhi_int16(y128p[10],ONE_OVER_SQRT2_Q15_128); + y128p[11] = mulhi_int16(y128p[11],ONE_OVER_SQRT2_Q15_128); + y128p[12] = mulhi_int16(y128p[12],ONE_OVER_SQRT2_Q15_128); + y128p[13] = mulhi_int16(y128p[13],ONE_OVER_SQRT2_Q15_128); + y128p[14] = mulhi_int16(y128p[14],ONE_OVER_SQRT2_Q15_128); + y128p[15] = mulhi_int16(y128p[15],ONE_OVER_SQRT2_Q15_128); + y128p+=16; + } + } + + _mm_empty(); + _m_empty(); + +} + +#else // __AVX2__ + +void dft2048(int16_t *x,int16_t *y,int scale) +{ + + simd256_q15_t xtmp[256],*xtmpp,*x256 = (simd256_q15_t *)x; + simd256_q15_t ytmp[256],*tw2048_256p=(simd256_q15_t *)tw2048,*y256=(simd256_q15_t *)y,*y256p=(simd256_q15_t *)y; + simd256_q15_t *ytmpp = &ytmp[0]; + int i; + simd256_q15_t ONE_OVER_SQRT2_Q15_128 = set1_int16_simd256(ONE_OVER_SQRT2_Q15); + + xtmpp = xtmp; + + for (i=0; i<4; i++) { + transpose4_ooff_simd256(x256 ,xtmpp,128); + transpose4_ooff_simd256(x256+2,xtmpp+1,128); + transpose4_ooff_simd256(x256+4,xtmpp+2,128); + transpose4_ooff_simd256(x256+6,xtmpp+3,128); + transpose4_ooff_simd256(x256+8,xtmpp+4,128); + transpose4_ooff_simd256(x256+10,xtmpp+5,128); + transpose4_ooff_simd256(x256+12,xtmpp+6,128); + transpose4_ooff_simd256(x256+14,xtmpp+7,128); + transpose4_ooff_simd256(x256+16,xtmpp+8,128); + transpose4_ooff_simd256(x256+18,xtmpp+9,128); + transpose4_ooff_simd256(x256+20,xtmpp+10,128); + transpose4_ooff_simd256(x256+22,xtmpp+11,128); + transpose4_ooff_simd256(x256+24,xtmpp+12,128); + transpose4_ooff_simd256(x256+26,xtmpp+13,128); + transpose4_ooff_simd256(x256+28,xtmpp+14,128); + transpose4_ooff_simd256(x256+30,xtmpp+15,128); + transpose4_ooff_simd256(x256+32,xtmpp+16,128); + transpose4_ooff_simd256(x256+34,xtmpp+17,128); + transpose4_ooff_simd256(x256+36,xtmpp+18,128); + transpose4_ooff_simd256(x256+38,xtmpp+19,128); + transpose4_ooff_simd256(x256+40,xtmpp+20,128); + transpose4_ooff_simd256(x256+42,xtmpp+21,128); + transpose4_ooff_simd256(x256+44,xtmpp+22,128); + transpose4_ooff_simd256(x256+46,xtmpp+23,128); + transpose4_ooff_simd256(x256+48,xtmpp+24,128); + transpose4_ooff_simd256(x256+50,xtmpp+25,128); + transpose4_ooff_simd256(x256+52,xtmpp+26,128); + transpose4_ooff_simd256(x256+54,xtmpp+27,128); + transpose4_ooff_simd256(x256+56,xtmpp+28,128); + transpose4_ooff_simd256(x256+58,xtmpp+29,128); + transpose4_ooff_simd256(x256+60,xtmpp+30,128); + transpose4_ooff_simd256(x256+62,xtmpp+31,128); + x256+=64; + xtmpp+=32; + } + + dft1024((int16_t*)(xtmp),(int16_t*)ytmp,1); + dft1024((int16_t*)(xtmp+128),(int16_t*)(ytmp+128),1); + + + for (i=0; i<128; i++) { + bfly2_256(ytmpp,ytmpp+128, + y256p,y256p+128, + tw2048_256p); + tw2048_256p++; + y256p++; + ytmpp++; + } + + if (scale>0) { + y256p = y256; + + for (i=0; i<16; i++) { + y256p[0] = mulhi_int16_simd256(y256p[0],ONE_OVER_SQRT2_Q15_128); + y256p[1] = mulhi_int16_simd256(y256p[1],ONE_OVER_SQRT2_Q15_128); + y256p[2] = mulhi_int16_simd256(y256p[2],ONE_OVER_SQRT2_Q15_128); + y256p[3] = mulhi_int16_simd256(y256p[3],ONE_OVER_SQRT2_Q15_128); + y256p[4] = mulhi_int16_simd256(y256p[4],ONE_OVER_SQRT2_Q15_128); + y256p[5] = mulhi_int16_simd256(y256p[5],ONE_OVER_SQRT2_Q15_128); + y256p[6] = mulhi_int16_simd256(y256p[6],ONE_OVER_SQRT2_Q15_128); + y256p[7] = mulhi_int16_simd256(y256p[7],ONE_OVER_SQRT2_Q15_128); + y256p[8] = mulhi_int16_simd256(y256p[8],ONE_OVER_SQRT2_Q15_128); + y256p[9] = mulhi_int16_simd256(y256p[9],ONE_OVER_SQRT2_Q15_128); + y256p[10] = mulhi_int16_simd256(y256p[10],ONE_OVER_SQRT2_Q15_128); + y256p[11] = mulhi_int16_simd256(y256p[11],ONE_OVER_SQRT2_Q15_128); + y256p[12] = mulhi_int16_simd256(y256p[12],ONE_OVER_SQRT2_Q15_128); + y256p[13] = mulhi_int16_simd256(y256p[13],ONE_OVER_SQRT2_Q15_128); + y256p[14] = mulhi_int16_simd256(y256p[14],ONE_OVER_SQRT2_Q15_128); + y256p[15] = mulhi_int16_simd256(y256p[15],ONE_OVER_SQRT2_Q15_128); + y256p+=16; + } + } + + _mm_empty(); + _m_empty(); + +} + +void idft2048(int16_t *x,int16_t *y,int scale) +{ + + simd256_q15_t xtmp[256],*xtmpp,*x256 = (simd256_q15_t *)x; + simd256_q15_t ytmp[256],*tw2048_256p=(simd256_q15_t *)tw2048,*y256=(simd256_q15_t *)y,*y256p=(simd256_q15_t *)y; + simd256_q15_t *ytmpp = &ytmp[0]; + int i; + simd256_q15_t ONE_OVER_SQRT2_Q15_128 = set1_int16_simd256(ONE_OVER_SQRT2_Q15); + + xtmpp = xtmp; + + for (i=0; i<4; i++) { + transpose4_ooff_simd256(x256 ,xtmpp,128); + transpose4_ooff_simd256(x256+2,xtmpp+1,128); + transpose4_ooff_simd256(x256+4,xtmpp+2,128); + transpose4_ooff_simd256(x256+6,xtmpp+3,128); + transpose4_ooff_simd256(x256+8,xtmpp+4,128); + transpose4_ooff_simd256(x256+10,xtmpp+5,128); + transpose4_ooff_simd256(x256+12,xtmpp+6,128); + transpose4_ooff_simd256(x256+14,xtmpp+7,128); + transpose4_ooff_simd256(x256+16,xtmpp+8,128); + transpose4_ooff_simd256(x256+18,xtmpp+9,128); + transpose4_ooff_simd256(x256+20,xtmpp+10,128); + transpose4_ooff_simd256(x256+22,xtmpp+11,128); + transpose4_ooff_simd256(x256+24,xtmpp+12,128); + transpose4_ooff_simd256(x256+26,xtmpp+13,128); + transpose4_ooff_simd256(x256+28,xtmpp+14,128); + transpose4_ooff_simd256(x256+30,xtmpp+15,128); + transpose4_ooff_simd256(x256+32,xtmpp+16,128); + transpose4_ooff_simd256(x256+34,xtmpp+17,128); + transpose4_ooff_simd256(x256+36,xtmpp+18,128); + transpose4_ooff_simd256(x256+38,xtmpp+19,128); + transpose4_ooff_simd256(x256+40,xtmpp+20,128); + transpose4_ooff_simd256(x256+42,xtmpp+21,128); + transpose4_ooff_simd256(x256+44,xtmpp+22,128); + transpose4_ooff_simd256(x256+46,xtmpp+23,128); + transpose4_ooff_simd256(x256+48,xtmpp+24,128); + transpose4_ooff_simd256(x256+50,xtmpp+25,128); + transpose4_ooff_simd256(x256+52,xtmpp+26,128); + transpose4_ooff_simd256(x256+54,xtmpp+27,128); + transpose4_ooff_simd256(x256+56,xtmpp+28,128); + transpose4_ooff_simd256(x256+58,xtmpp+29,128); + transpose4_ooff_simd256(x256+60,xtmpp+30,128); + transpose4_ooff_simd256(x256+62,xtmpp+31,128); + x256+=64; + xtmpp+=32; + } + + idft1024((int16_t*)(xtmp),(int16_t*)ytmp,1); + idft1024((int16_t*)(xtmp+128),(int16_t*)(ytmp+128),1); - for (i=0; i<256; i++) { - ibfly2(ytmpp,ytmpp+256, - y128p,y128p+256, - tw2048_128p); - tw2048_128p++; - y128p++; + for (i=0; i<128; i++) { + ibfly2_256(ytmpp,ytmpp+128, + y256p,y256p+128, + tw2048_256p); + tw2048_256p++; + y256p++; ytmpp++; } if (scale>0) { - y128p = y128; + y256p = y256; - for (i=0; i<32; i++) { - y128p[0] = mulhi_int16(y128p[0],ONE_OVER_SQRT2_Q15_128); - y128p[1] = mulhi_int16(y128p[1],ONE_OVER_SQRT2_Q15_128); - y128p[2] = mulhi_int16(y128p[2],ONE_OVER_SQRT2_Q15_128); - y128p[3] = mulhi_int16(y128p[3],ONE_OVER_SQRT2_Q15_128); - y128p[4] = mulhi_int16(y128p[4],ONE_OVER_SQRT2_Q15_128); - y128p[5] = mulhi_int16(y128p[5],ONE_OVER_SQRT2_Q15_128); - y128p[6] = mulhi_int16(y128p[6],ONE_OVER_SQRT2_Q15_128); - y128p[7] = mulhi_int16(y128p[7],ONE_OVER_SQRT2_Q15_128); - y128p[8] = mulhi_int16(y128p[8],ONE_OVER_SQRT2_Q15_128); - y128p[9] = mulhi_int16(y128p[9],ONE_OVER_SQRT2_Q15_128); - y128p[10] = mulhi_int16(y128p[10],ONE_OVER_SQRT2_Q15_128); - y128p[11] = mulhi_int16(y128p[11],ONE_OVER_SQRT2_Q15_128); - y128p[12] = mulhi_int16(y128p[12],ONE_OVER_SQRT2_Q15_128); - y128p[13] = mulhi_int16(y128p[13],ONE_OVER_SQRT2_Q15_128); - y128p[14] = mulhi_int16(y128p[14],ONE_OVER_SQRT2_Q15_128); - y128p[15] = mulhi_int16(y128p[15],ONE_OVER_SQRT2_Q15_128); - y128p+=16; + for (i=0; i<16; i++) { + y256p[0] = mulhi_int16_simd256(y256p[0],ONE_OVER_SQRT2_Q15_128); + y256p[1] = mulhi_int16_simd256(y256p[1],ONE_OVER_SQRT2_Q15_128); + y256p[2] = mulhi_int16_simd256(y256p[2],ONE_OVER_SQRT2_Q15_128); + y256p[3] = mulhi_int16_simd256(y256p[3],ONE_OVER_SQRT2_Q15_128); + y256p[4] = mulhi_int16_simd256(y256p[4],ONE_OVER_SQRT2_Q15_128); + y256p[5] = mulhi_int16_simd256(y256p[5],ONE_OVER_SQRT2_Q15_128); + y256p[6] = mulhi_int16_simd256(y256p[6],ONE_OVER_SQRT2_Q15_128); + y256p[7] = mulhi_int16_simd256(y256p[7],ONE_OVER_SQRT2_Q15_128); + y256p[8] = mulhi_int16_simd256(y256p[8],ONE_OVER_SQRT2_Q15_128); + y256p[9] = mulhi_int16_simd256(y256p[9],ONE_OVER_SQRT2_Q15_128); + y256p[10] = mulhi_int16_simd256(y256p[10],ONE_OVER_SQRT2_Q15_128); + y256p[11] = mulhi_int16_simd256(y256p[11],ONE_OVER_SQRT2_Q15_128); + y256p[12] = mulhi_int16_simd256(y256p[12],ONE_OVER_SQRT2_Q15_128); + y256p[13] = mulhi_int16_simd256(y256p[13],ONE_OVER_SQRT2_Q15_128); + y256p[14] = mulhi_int16_simd256(y256p[14],ONE_OVER_SQRT2_Q15_128); + y256p[15] = mulhi_int16_simd256(y256p[15],ONE_OVER_SQRT2_Q15_128); + y256p+=16; } } @@ -2868,12 +4799,15 @@ void idft2048(int16_t *x,int16_t *y,int scale) } +#endif + #include "twiddles4096.h" +#ifndef __AVX2__ void dft4096(int16_t *x,int16_t *y,int scale) { - simd_q15_t xtmp[4096],ytmp[4096],*tw4096_128p=(simd_q15_t *)tw4096,*x128=(simd_q15_t *)x,*y128=(simd_q15_t *)y,*y128p=(simd_q15_t *)y; + simd_q15_t xtmp[1024],ytmp[1024],*tw4096_128p=(simd_q15_t *)tw4096,*x128=(simd_q15_t *)x,*y128=(simd_q15_t *)y,*y128p=(simd_q15_t *)y; simd_q15_t *ytmpp = &ytmp[0]; int i,j; @@ -2926,10 +4860,12 @@ void dft4096(int16_t *x,int16_t *y,int scale) } + + void idft4096(int16_t *x,int16_t *y,int scale) { - simd_q15_t xtmp[4096],ytmp[4096],*tw4096_128p=(simd_q15_t *)tw4096,*x128=(simd_q15_t *)x,*y128=(simd_q15_t *)y,*y128p=(simd_q15_t *)y; + simd_q15_t xtmp[1024],ytmp[1024],*tw4096_128p=(simd_q15_t *)tw4096,*x128=(simd_q15_t *)x,*y128=(simd_q15_t *)y,*y128p=(simd_q15_t *)y; simd_q15_t *ytmpp = &ytmp[0]; int i,j; @@ -2982,19 +4918,125 @@ void idft4096(int16_t *x,int16_t *y,int scale) } -/* Twiddles generated with -twa = floor(32767*exp(-sqrt(-1)*2*pi*(0:4095)/8192)); -twa2 = zeros(1,2*4096); -twa2(1:2:end) = real(twa); -twa2(2:2:end) = imag(twa); -fd=fopen("twiddle_tmp.txt","w"); -fprintf(fd,"static int16_t tw8192[4096*2] = {"); -fprintf(fd,"%d,",twa2(1:(4096*2)-1)); -fprintf(fd,"%d};\n",twa2(end)); -fclose(fd); -*/ -static int16_t tw8192[4096*2] = {32767,0,32766,-26,32766,-51,32766,-76,32766,-101,32766,-126,32766,-151,32766,-176,32766,-202,32766,-227,32766,-252,32765,-277,32765,-302,32765,-327,32765,-352,32764,-377,32764,-403,32764,-428,32763,-453,32763,-478,32763,-503,32762,-528,32762,-553,32761,-579,32761,-604,32760,-629,32760,-654,32759,-679,32759,-704,32758,-729,32758,-754,32757,-780,32757,-805,32756,-830,32755,-855,32755,-880,32754,-905,32753,-930,32753,-955,32752,-981,32751,-1006,32750,-1031,32750,-1056,32749,-1081,32748,-1106,32747,-1131,32746,-1156,32745,-1181,32744,-1207,32743,-1232,32742,-1257,32741,-1282,32740,-1307,32739,-1332,32738,-1357,32737,-1382,32736,-1407,32735,-1433,32734,-1458,32733,-1483,32732,-1508,32731,-1533,32729,-1558,32728,-1583,32727,-1608,32726,-1633,32725,-1659,32723,-1684,32722,-1709,32721,-1734,32719,-1759,32718,-1784,32717,-1809,32715,-1834,32714,-1859,32712,-1884,32711,-1909,32709,-1935,32708,-1960,32706,-1985,32705,-2010,32703,-2035,32702,-2060,32700,-2085,32699,-2110,32697,-2135,32695,-2160,32694,-2185,32692,-2210,32690,-2236,32688,-2261,32687,-2286,32685,-2311,32683,-2336,32681,-2361,32680,-2386,32678,-2411,32676,-2436,32674,-2461,32672,-2486,32670,-2511,32668,-2536,32666,-2561,32664,-2586,32662,-2611,32660,-2637,32658,-2662,32656,-2687,32654,-2712,32652,-2737,32650,-2762,32648,-2787,32646,-2812,32644,-2837,32641,-2862,32639,-2887,32637,-2912,32635,-2937,32632,-2962,32630,-2987,32628,-3012,32625,-3037,32623,-3062,32621,-3087,32618,-3112,32616,-3137,32614,-3162,32611,-3187,32609,-3212,32606,-3237,32604,-3262,32601,-3287,32599,-3312,32596,-3337,32594,-3362,32591,-3387,32588,-3412,32586,-3437,32583,-3462,32580,-3487,32578,-3512,32575,-3537,32572,-3562,32570,-3587,32567,-3612,32564,-3637,32561,-3662,32558,-3687,32556,-3712,32553,-3737,32550,-3762,32547,-3787,32544,-3812,32541,-3837,32538,-3862,32535,-3887,32532,-3912,32529,-3937,32526,-3962,32523,-3987,32520,-4012,32517,-4036,32514,-4061,32511,-4086,32508,-4111,32504,-4136,32501,-4161,32498,-4186,32495,-4211,32492,-4236,32488,-4261,32485,-4286,32482,-4311,32478,-4336,32475,-4360,32472,-4385,32468,-4410,32465,-4435,32462,-4460,32458,-4485,32455,-4510,32451,-4535,32448,-4560,32444,-4585,32441,-4609,32437,-4634,32434,-4659,32430,-4684,32426,-4709,32423,-4734,32419,-4759,32416,-4784,32412,-4808,32408,-4833,32404,-4858,32401,-4883,32397,-4908,32393,-4933,32389,-4958,32386,-4982,32382,-5007,32378,-5032,32374,-5057,32370,-5082,32366,-5107,32362,-5131,32358,-5156,32354,-5181,32350,-5206,32346,-5231,32342,-5255,32338,-5280,32334,-5305,32330,-5330,32326,-5355,32322,-5379,32318,-5404,32314,-5429,32310,-5454,32305,-5479,32301,-5503,32297,-5528,32293,-5553,32288,-5578,32284,-5602,32280,-5627,32275,-5652,32271,-5677,32267,-5701,32262,-5726,32258,-5751,32254,-5776,32249,-5800,32245,-5825,32240,-5850,32236,-5875,32231,-5899,32227,-5924,32222,-5949,32218,-5973,32213,-5998,32208,-6023,32204,-6048,32199,-6072,32194,-6097,32190,-6122,32185,-6146,32180,-6171,32176,-6196,32171,-6220,32166,-6245,32161,-6270,32156,-6294,32152,-6319,32147,-6344,32142,-6368,32137,-6393,32132,-6418,32127,-6442,32122,-6467,32117,-6492,32112,-6516,32107,-6541,32102,-6565,32097,-6590,32092,-6615,32087,-6639,32082,-6664,32077,-6689,32072,-6713,32066,-6738,32061,-6762,32056,-6787,32051,-6812,32046,-6836,32040,-6861,32035,-6885,32030,-6910,32024,-6934,32019,-6959,32014,-6983,32008,-7008,32003,-7033,31998,-7057,31992,-7082,31987,-7106,31981,-7131,31976,-7155,31970,-7180,31965,-7204,31959,-7229,31954,-7253,31948,-7278,31943,-7302,31937,-7327,31931,-7351,31926,-7376,31920,-7400,31914,-7425,31909,-7449,31903,-7474,31897,-7498,31891,-7523,31886,-7547,31880,-7572,31874,-7596,31868,-7620,31862,-7645,31856,-7669,31851,-7694,31845,-7718,31839,-7743,31833,-7767,31827,-7791,31821,-7816,31815,-7840,31809,-7865,31803,-7889,31797,-7913,31791,-7938,31785,-7962,31778,-7987,31772,-8011,31766,-8035,31760,-8060,31754,-8084,31748,-8108,31741,-8133,31735,-8157,31729,-8181,31723,-8206,31716,-8230,31710,-8254,31704,-8279,31697,-8303,31691,-8327,31684,-8352,31678,-8376,31672,-8400,31665,-8425,31659,-8449,31652,-8473,31646,-8497,31639,-8522,31633,-8546,31626,-8570,31619,-8594,31613,-8619,31606,-8643,31600,-8667,31593,-8691,31586,-8716,31580,-8740,31573,-8764,31566,-8788,31559,-8813,31553,-8837,31546,-8861,31539,-8885,31532,-8909,31525,-8933,31518,-8958,31512,-8982,31505,-9006,31498,-9030,31491,-9054,31484,-9078,31477,-9103,31470,-9127,31463,-9151,31456,-9175,31449,-9199,31442,-9223,31435,-9247,31428,-9271,31420,-9296,31413,-9320,31406,-9344,31399,-9368,31392,-9392,31385,-9416,31377,-9440,31370,-9464,31363,-9488,31356,-9512,31348,-9536,31341,-9560,31334,-9584,31326,-9608,31319,-9632,31311,-9656,31304,-9680,31297,-9704,31289,-9728,31282,-9752,31274,-9776,31267,-9800,31259,-9824,31252,-9848,31244,-9872,31236,-9896,31229,-9920,31221,-9944,31214,-9968,31206,-9992,31198,-10016,31191,-10040,31183,-10064,31175,-10088,31167,-10112,31160,-10136,31152,-10160,31144,-10183,31136,-10207,31128,-10231,31121,-10255,31113,-10279,31105,-10303,31097,-10327,31089,-10350,31081,-10374,31073,-10398,31065,-10422,31057,-10446,31049,-10470,31041,-10493,31033,-10517,31025,-10541,31017,-10565,31009,-10589,31001,-10612,30992,-10636,30984,-10660,30976,-10684,30968,-10707,30960,-10731,30951,-10755,30943,-10779,30935,-10802,30927,-10826,30918,-10850,30910,-10874,30902,-10897,30893,-10921,30885,-10945,30876,-10968,30868,-10992,30860,-11016,30851,-11039,30843,-11063,30834,-11087,30826,-11110,30817,-11134,30809,-11158,30800,-11181,30791,-11205,30783,-11228,30774,-11252,30766,-11276,30757,-11299,30748,-11323,30739,-11346,30731,-11370,30722,-11394,30713,-11417,30705,-11441,30696,-11464,30687,-11488,30678,-11511,30669,-11535,30660,-11558,30652,-11582,30643,-11605,30634,-11629,30625,-11652,30616,-11676,30607,-11699,30598,-11723,30589,-11746,30580,-11770,30571,-11793,30562,-11817,30553,-11840,30544,-11863,30535,-11887,30525,-11910,30516,-11934,30507,-11957,30498,-11981,30489,-12004,30480,-12027,30470,-12051,30461,-12074,30452,-12097,30442,-12121,30433,-12144,30424,-12167,30415,-12191,30405,-12214,30396,-12237,30386,-12261,30377,-12284,30368,-12307,30358,-12331,30349,-12354,30339,-12377,30330,-12400,30320,-12424,30311,-12447,30301,-12470,30291,-12493,30282,-12517,30272,-12540,30263,-12563,30253,-12586,30243,-12610,30234,-12633,30224,-12656,30214,-12679,30205,-12702,30195,-12725,30185,-12749,30175,-12772,30165,-12795,30156,-12818,30146,-12841,30136,-12864,30126,-12887,30116,-12910,30106,-12934,30096,-12957,30086,-12980,30076,-13003,30066,-13026,30056,-13049,30046,-13072,30036,-13095,30026,-13118,30016,-13141,30006,-13164,29996,-13187,29986,-13210,29976,-13233,29966,-13256,29955,-13279,29945,-13302,29935,-13325,29925,-13348,29915,-13371,29904,-13394,29894,-13417,29884,-13440,29873,-13463,29863,-13486,29853,-13508,29842,-13531,29832,-13554,29822,-13577,29811,-13600,29801,-13623,29790,-13646,29780,-13668,29769,-13691,29759,-13714,29748,-13737,29738,-13760,29727,-13783,29717,-13805,29706,-13828,29695,-13851,29685,-13874,29674,-13896,29663,-13919,29653,-13942,29642,-13965,29631,-13987,29621,-14010,29610,-14033,29599,-14056,29588,-14078,29577,-14101,29567,-14124,29556,-14146,29545,-14169,29534,-14192,29523,-14214,29512,-14237,29501,-14260,29490,-14282,29479,-14305,29468,-14327,29457,-14350,29446,-14373,29435,-14395,29424,-14418,29413,-14440,29402,-14463,29391,-14485,29380,-14508,29369,-14531,29358,-14553,29346,-14576,29335,-14598,29324,-14621,29313,-14643,29302,-14666,29290,-14688,29279,-14710,29268,-14733,29256,-14755,29245,-14778,29234,-14800,29222,-14823,29211,-14845,29200,-14867,29188,-14890,29177,-14912,29165,-14935,29154,-14957,29142,-14979,29131,-15002,29119,-15024,29108,-15046,29096,-15069,29085,-15091,29073,-15113,29062,-15136,29050,-15158,29038,-15180,29027,-15202,29015,-15225,29003,-15247,28992,-15269,28980,-15291,28968,-15314,28956,-15336,28945,-15358,28933,-15380,28921,-15402,28909,-15425,28897,-15447,28886,-15469,28874,-15491,28862,-15513,28850,-15535,28838,-15557,28826,-15580,28814,-15602,28802,-15624,28790,-15646,28778,-15668,28766,-15690,28754,-15712,28742,-15734,28730,-15756,28718,-15778,28706,-15800,28694,-15822,28681,-15844,28669,-15866,28657,-15888,28645,-15910,28633,-15932,28620,-15954,28608,-15976,28596,-15998,28584,-16020,28571,-16042,28559,-16064,28547,-16086,28534,-16108,28522,-16129,28510,-16151,28497,-16173,28485,-16195,28472,-16217,28460,-16239,28447,-16261,28435,-16282,28423,-16304,28410,-16326,28397,-16348,28385,-16369,28372,-16391,28360,-16413,28347,-16435,28335,-16456,28322,-16478,28309,-16500,28297,-16522,28284,-16543,28271,-16565,28259,-16587,28246,-16608,28233,-16630,28220,-16652,28208,-16673,28195,-16695,28182,-16717,28169,-16738,28156,-16760,28143,-16781,28131,-16803,28118,-16825,28105,-16846,28092,-16868,28079,-16889,28066,-16911,28053,-16932,28040,-16954,28027,-16975,28014,-16997,28001,-17018,27988,-17040,27975,-17061,27962,-17083,27948,-17104,27935,-17125,27922,-17147,27909,-17168,27896,-17190,27883,-17211,27869,-17233,27856,-17254,27843,-17275,27830,-17297,27816,-17318,27803,-17339,27790,-17361,27777,-17382,27763,-17403,27750,-17424,27736,-17446,27723,-17467,27710,-17488,27696,-17510,27683,-17531,27669,-17552,27656,-17573,27642,-17594,27629,-17616,27615,-17637,27602,-17658,27588,-17679,27575,-17700,27561,-17721,27548,-17743,27534,-17764,27520,-17785,27507,-17806,27493,-17827,27479,-17848,27466,-17869,27452,-17890,27438,-17911,27424,-17932,27411,-17953,27397,-17974,27383,-17995,27369,-18016,27355,-18037,27342,-18058,27328,-18079,27314,-18100,27300,-18121,27286,-18142,27272,-18163,27258,-18184,27244,-18205,27230,-18226,27216,-18247,27202,-18268,27188,-18288,27174,-18309,27160,-18330,27146,-18351,27132,-18372,27118,-18393,27104,-18413,27090,-18434,27076,-18455,27061,-18476,27047,-18496,27033,-18517,27019,-18538,27005,-18559,26990,-18579,26976,-18600,26962,-18621,26948,-18641,26933,-18662,26919,-18683,26905,-18703,26890,-18724,26876,-18745,26861,-18765,26847,-18786,26833,-18806,26818,-18827,26804,-18847,26789,-18868,26775,-18889,26760,-18909,26746,-18930,26731,-18950,26717,-18971,26702,-18991,26688,-19012,26673,-19032,26658,-19052,26644,-19073,26629,-19093,26615,-19114,26600,-19134,26585,-19155,26570,-19175,26556,-19195,26541,-19216,26526,-19236,26512,-19256,26497,-19277,26482,-19297,26467,-19317,26452,-19338,26437,-19358,26423,-19378,26408,-19398,26393,-19419,26378,-19439,26363,-19459,26348,-19479,26333,-19500,26318,-19520,26303,-19540,26288,-19560,26273,-19580,26258,-19600,26243,-19621,26228,-19641,26213,-19661,26198,-19681,26183,-19701,26168,-19721,26153,-19741,26137,-19761,26122,-19781,26107,-19801,26092,-19821,26077,-19841,26061,-19861,26046,-19881,26031,-19901,26016,-19921,26000,-19941,25985,-19961,25970,-19981,25954,-20001,25939,-20021,25924,-20041,25908,-20061,25893,-20080,25878,-20100,25862,-20120,25847,-20140,25831,-20160,25816,-20180,25800,-20199,25785,-20219,25769,-20239,25754,-20259,25738,-20278,25723,-20298,25707,-20318,25691,-20338,25676,-20357,25660,-20377,25645,-20397,25629,-20416,25613,-20436,25598,-20456,25582,-20475,25566,-20495,25550,-20514,25535,-20534,25519,-20554,25503,-20573,25487,-20593,25472,-20612,25456,-20632,25440,-20651,25424,-20671,25408,-20690,25392,-20710,25376,-20729,25361,-20749,25345,-20768,25329,-20788,25313,-20807,25297,-20826,25281,-20846,25265,-20865,25249,-20885,25233,-20904,25217,-20923,25201,-20943,25185,-20962,25169,-20981,25152,-21001,25136,-21020,25120,-21039,25104,-21058,25088,-21078,25072,-21097,25056,-21116,25039,-21135,25023,-21155,25007,-21174,24991,-21193,24974,-21212,24958,-21231,24942,-21250,24926,-21269,24909,-21289,24893,-21308,24877,-21327,24860,-21346,24844,-21365,24827,-21384,24811,-21403,24795,-21422,24778,-21441,24762,-21460,24745,-21479,24729,-21498,24712,-21517,24696,-21536,24679,-21555,24663,-21574,24646,-21593,24630,-21612,24613,-21630,24596,-21649,24580,-21668,24563,-21687,24546,-21706,24530,-21725,24513,-21744,24496,-21762,24480,-21781,24463,-21800,24446,-21819,24430,-21837,24413,-21856,24396,-21875,24379,-21894,24362,-21912,24346,-21931,24329,-21950,24312,-21968,24295,-21987,24278,-22005,24261,-22024,24244,-22043,24228,-22061,24211,-22080,24194,-22098,24177,-22117,24160,-22136,24143,-22154,24126,-22173,24109,-22191,24092,-22210,24075,-22228,24058,-22246,24041,-22265,24023,-22283,24006,-22302,23989,-22320,23972,-22339,23955,-22357,23938,-22375,23921,-22394,23903,-22412,23886,-22430,23869,-22449,23852,-22467,23835,-22485,23817,-22504,23800,-22522,23783,-22540,23766,-22558,23748,-22576,23731,-22595,23714,-22613,23696,-22631,23679,-22649,23661,-22667,23644,-22686,23627,-22704,23609,-22722,23592,-22740,23574,-22758,23557,-22776,23539,-22794,23522,-22812,23504,-22830,23487,-22848,23469,-22866,23452,-22884,23434,-22902,23417,-22920,23399,-22938,23382,-22956,23364,-22974,23346,-22992,23329,-23010,23311,-23028,23293,-23046,23276,-23063,23258,-23081,23240,-23099,23223,-23117,23205,-23135,23187,-23152,23169,-23170,23151,-23188,23134,-23206,23116,-23224,23098,-23241,23080,-23259,23062,-23277,23045,-23294,23027,-23312,23009,-23330,22991,-23347,22973,-23365,22955,-23383,22937,-23400,22919,-23418,22901,-23435,22883,-23453,22865,-23470,22847,-23488,22829,-23505,22811,-23523,22793,-23540,22775,-23558,22757,-23575,22739,-23593,22721,-23610,22703,-23628,22685,-23645,22666,-23662,22648,-23680,22630,-23697,22612,-23715,22594,-23732,22575,-23749,22557,-23767,22539,-23784,22521,-23801,22503,-23818,22484,-23836,22466,-23853,22448,-23870,22429,-23887,22411,-23904,22393,-23922,22374,-23939,22356,-23956,22338,-23973,22319,-23990,22301,-24007,22282,-24024,22264,-24042,22245,-24059,22227,-24076,22209,-24093,22190,-24110,22172,-24127,22153,-24144,22135,-24161,22116,-24178,22097,-24195,22079,-24212,22060,-24229,22042,-24245,22023,-24262,22004,-24279,21986,-24296,21967,-24313,21949,-24330,21930,-24347,21911,-24363,21893,-24380,21874,-24397,21855,-24414,21836,-24431,21818,-24447,21799,-24464,21780,-24481,21761,-24497,21743,-24514,21724,-24531,21705,-24547,21686,-24564,21667,-24581,21648,-24597,21629,-24614,21611,-24631,21592,-24647,21573,-24664,21554,-24680,21535,-24697,21516,-24713,21497,-24730,21478,-24746,21459,-24763,21440,-24779,21421,-24796,21402,-24812,21383,-24828,21364,-24845,21345,-24861,21326,-24878,21307,-24894,21288,-24910,21268,-24927,21249,-24943,21230,-24959,21211,-24975,21192,-24992,21173,-25008,21154,-25024,21134,-25040,21115,-25057,21096,-25073,21077,-25089,21057,-25105,21038,-25121,21019,-25137,21000,-25153,20980,-25170,20961,-25186,20942,-25202,20922,-25218,20903,-25234,20884,-25250,20864,-25266,20845,-25282,20825,-25298,20806,-25314,20787,-25330,20767,-25346,20748,-25362,20728,-25377,20709,-25393,20689,-25409,20670,-25425,20650,-25441,20631,-25457,20611,-25473,20592,-25488,20572,-25504,20553,-25520,20533,-25536,20513,-25551,20494,-25567,20474,-25583,20455,-25599,20435,-25614,20415,-25630,20396,-25646,20376,-25661,20356,-25677,20337,-25692,20317,-25708,20297,-25724,20277,-25739,20258,-25755,20238,-25770,20218,-25786,20198,-25801,20179,-25817,20159,-25832,20139,-25848,20119,-25863,20099,-25879,20079,-25894,20060,-25909,20040,-25925,20020,-25940,20000,-25955,19980,-25971,19960,-25986,19940,-26001,19920,-26017,19900,-26032,19880,-26047,19860,-26062,19840,-26078,19820,-26093,19800,-26108,19780,-26123,19760,-26138,19740,-26154,19720,-26169,19700,-26184,19680,-26199,19660,-26214,19640,-26229,19620,-26244,19599,-26259,19579,-26274,19559,-26289,19539,-26304,19519,-26319,19499,-26334,19478,-26349,19458,-26364,19438,-26379,19418,-26394,19397,-26409,19377,-26424,19357,-26438,19337,-26453,19316,-26468,19296,-26483,19276,-26498,19255,-26513,19235,-26527,19215,-26542,19194,-26557,19174,-26571,19154,-26586,19133,-26601,19113,-26616,19092,-26630,19072,-26645,19051,-26659,19031,-26674,19011,-26689,18990,-26703,18970,-26718,18949,-26732,18929,-26747,18908,-26761,18888,-26776,18867,-26790,18846,-26805,18826,-26819,18805,-26834,18785,-26848,18764,-26862,18744,-26877,18723,-26891,18702,-26906,18682,-26920,18661,-26934,18640,-26949,18620,-26963,18599,-26977,18578,-26991,18558,-27006,18537,-27020,18516,-27034,18495,-27048,18475,-27062,18454,-27077,18433,-27091,18412,-27105,18392,-27119,18371,-27133,18350,-27147,18329,-27161,18308,-27175,18287,-27189,18267,-27203,18246,-27217,18225,-27231,18204,-27245,18183,-27259,18162,-27273,18141,-27287,18120,-27301,18099,-27315,18078,-27329,18057,-27343,18036,-27356,18015,-27370,17994,-27384,17973,-27398,17952,-27412,17931,-27425,17910,-27439,17889,-27453,17868,-27467,17847,-27480,17826,-27494,17805,-27508,17784,-27521,17763,-27535,17742,-27549,17720,-27562,17699,-27576,17678,-27589,17657,-27603,17636,-27616,17615,-27630,17593,-27643,17572,-27657,17551,-27670,17530,-27684,17509,-27697,17487,-27711,17466,-27724,17445,-27737,17423,-27751,17402,-27764,17381,-27778,17360,-27791,17338,-27804,17317,-27817,17296,-27831,17274,-27844,17253,-27857,17232,-27870,17210,-27884,17189,-27897,17167,-27910,17146,-27923,17124,-27936,17103,-27949,17082,-27963,17060,-27976,17039,-27989,17017,-28002,16996,-28015,16974,-28028,16953,-28041,16931,-28054,16910,-28067,16888,-28080,16867,-28093,16845,-28106,16824,-28119,16802,-28132,16780,-28144,16759,-28157,16737,-28170,16716,-28183,16694,-28196,16672,-28209,16651,-28221,16629,-28234,16607,-28247,16586,-28260,16564,-28272,16542,-28285,16521,-28298,16499,-28310,16477,-28323,16455,-28336,16434,-28348,16412,-28361,16390,-28373,16368,-28386,16347,-28398,16325,-28411,16303,-28424,16281,-28436,16260,-28448,16238,-28461,16216,-28473,16194,-28486,16172,-28498,16150,-28511,16128,-28523,16107,-28535,16085,-28548,16063,-28560,16041,-28572,16019,-28585,15997,-28597,15975,-28609,15953,-28621,15931,-28634,15909,-28646,15887,-28658,15865,-28670,15843,-28682,15821,-28695,15799,-28707,15777,-28719,15755,-28731,15733,-28743,15711,-28755,15689,-28767,15667,-28779,15645,-28791,15623,-28803,15601,-28815,15579,-28827,15556,-28839,15534,-28851,15512,-28863,15490,-28875,15468,-28887,15446,-28898,15424,-28910,15401,-28922,15379,-28934,15357,-28946,15335,-28957,15313,-28969,15290,-28981,15268,-28993,15246,-29004,15224,-29016,15201,-29028,15179,-29039,15157,-29051,15135,-29063,15112,-29074,15090,-29086,15068,-29097,15045,-29109,15023,-29120,15001,-29132,14978,-29143,14956,-29155,14934,-29166,14911,-29178,14889,-29189,14866,-29201,14844,-29212,14822,-29223,14799,-29235,14777,-29246,14754,-29257,14732,-29269,14709,-29280,14687,-29291,14665,-29303,14642,-29314,14620,-29325,14597,-29336,14575,-29347,14552,-29359,14530,-29370,14507,-29381,14484,-29392,14462,-29403,14439,-29414,14417,-29425,14394,-29436,14372,-29447,14349,-29458,14326,-29469,14304,-29480,14281,-29491,14259,-29502,14236,-29513,14213,-29524,14191,-29535,14168,-29546,14145,-29557,14123,-29568,14100,-29578,14077,-29589,14055,-29600,14032,-29611,14009,-29622,13986,-29632,13964,-29643,13941,-29654,13918,-29664,13895,-29675,13873,-29686,13850,-29696,13827,-29707,13804,-29718,13782,-29728,13759,-29739,13736,-29749,13713,-29760,13690,-29770,13667,-29781,13645,-29791,13622,-29802,13599,-29812,13576,-29823,13553,-29833,13530,-29843,13507,-29854,13485,-29864,13462,-29874,13439,-29885,13416,-29895,13393,-29905,13370,-29916,13347,-29926,13324,-29936,13301,-29946,13278,-29956,13255,-29967,13232,-29977,13209,-29987,13186,-29997,13163,-30007,13140,-30017,13117,-30027,13094,-30037,13071,-30047,13048,-30057,13025,-30067,13002,-30077,12979,-30087,12956,-30097,12933,-30107,12909,-30117,12886,-30127,12863,-30137,12840,-30147,12817,-30157,12794,-30166,12771,-30176,12748,-30186,12724,-30196,12701,-30206,12678,-30215,12655,-30225,12632,-30235,12609,-30244,12585,-30254,12562,-30264,12539,-30273,12516,-30283,12492,-30292,12469,-30302,12446,-30312,12423,-30321,12399,-30331,12376,-30340,12353,-30350,12330,-30359,12306,-30369,12283,-30378,12260,-30387,12236,-30397,12213,-30406,12190,-30416,12166,-30425,12143,-30434,12120,-30443,12096,-30453,12073,-30462,12050,-30471,12026,-30481,12003,-30490,11980,-30499,11956,-30508,11933,-30517,11909,-30526,11886,-30536,11862,-30545,11839,-30554,11816,-30563,11792,-30572,11769,-30581,11745,-30590,11722,-30599,11698,-30608,11675,-30617,11651,-30626,11628,-30635,11604,-30644,11581,-30653,11557,-30661,11534,-30670,11510,-30679,11487,-30688,11463,-30697,11440,-30706,11416,-30714,11393,-30723,11369,-30732,11345,-30740,11322,-30749,11298,-30758,11275,-30767,11251,-30775,11227,-30784,11204,-30792,11180,-30801,11157,-30810,11133,-30818,11109,-30827,11086,-30835,11062,-30844,11038,-30852,11015,-30861,10991,-30869,10967,-30877,10944,-30886,10920,-30894,10896,-30903,10873,-30911,10849,-30919,10825,-30928,10801,-30936,10778,-30944,10754,-30952,10730,-30961,10706,-30969,10683,-30977,10659,-30985,10635,-30993,10611,-31002,10588,-31010,10564,-31018,10540,-31026,10516,-31034,10492,-31042,10469,-31050,10445,-31058,10421,-31066,10397,-31074,10373,-31082,10349,-31090,10326,-31098,10302,-31106,10278,-31114,10254,-31122,10230,-31129,10206,-31137,10182,-31145,10159,-31153,10135,-31161,10111,-31168,10087,-31176,10063,-31184,10039,-31192,10015,-31199,9991,-31207,9967,-31215,9943,-31222,9919,-31230,9895,-31237,9871,-31245,9847,-31253,9823,-31260,9799,-31268,9775,-31275,9751,-31283,9727,-31290,9703,-31298,9679,-31305,9655,-31312,9631,-31320,9607,-31327,9583,-31335,9559,-31342,9535,-31349,9511,-31357,9487,-31364,9463,-31371,9439,-31378,9415,-31386,9391,-31393,9367,-31400,9343,-31407,9319,-31414,9295,-31421,9270,-31429,9246,-31436,9222,-31443,9198,-31450,9174,-31457,9150,-31464,9126,-31471,9102,-31478,9077,-31485,9053,-31492,9029,-31499,9005,-31506,8981,-31513,8957,-31519,8932,-31526,8908,-31533,8884,-31540,8860,-31547,8836,-31554,8812,-31560,8787,-31567,8763,-31574,8739,-31581,8715,-31587,8690,-31594,8666,-31601,8642,-31607,8618,-31614,8593,-31620,8569,-31627,8545,-31634,8521,-31640,8496,-31647,8472,-31653,8448,-31660,8424,-31666,8399,-31673,8375,-31679,8351,-31685,8326,-31692,8302,-31698,8278,-31705,8253,-31711,8229,-31717,8205,-31724,8180,-31730,8156,-31736,8132,-31742,8107,-31749,8083,-31755,8059,-31761,8034,-31767,8010,-31773,7986,-31779,7961,-31786,7937,-31792,7912,-31798,7888,-31804,7864,-31810,7839,-31816,7815,-31822,7790,-31828,7766,-31834,7742,-31840,7717,-31846,7693,-31852,7668,-31857,7644,-31863,7619,-31869,7595,-31875,7571,-31881,7546,-31887,7522,-31892,7497,-31898,7473,-31904,7448,-31910,7424,-31915,7399,-31921,7375,-31927,7350,-31932,7326,-31938,7301,-31944,7277,-31949,7252,-31955,7228,-31960,7203,-31966,7179,-31971,7154,-31977,7130,-31982,7105,-31988,7081,-31993,7056,-31999,7032,-32004,7007,-32009,6982,-32015,6958,-32020,6933,-32025,6909,-32031,6884,-32036,6860,-32041,6835,-32047,6811,-32052,6786,-32057,6761,-32062,6737,-32067,6712,-32073,6688,-32078,6663,-32083,6638,-32088,6614,-32093,6589,-32098,6564,-32103,6540,-32108,6515,-32113,6491,-32118,6466,-32123,6441,-32128,6417,-32133,6392,-32138,6367,-32143,6343,-32148,6318,-32153,6293,-32157,6269,-32162,6244,-32167,6219,-32172,6195,-32177,6170,-32181,6145,-32186,6121,-32191,6096,-32195,6071,-32200,6047,-32205,6022,-32209,5997,-32214,5972,-32219,5948,-32223,5923,-32228,5898,-32232,5874,-32237,5849,-32241,5824,-32246,5799,-32250,5775,-32255,5750,-32259,5725,-32263,5700,-32268,5676,-32272,5651,-32276,5626,-32281,5601,-32285,5577,-32289,5552,-32294,5527,-32298,5502,-32302,5478,-32306,5453,-32311,5428,-32315,5403,-32319,5378,-32323,5354,-32327,5329,-32331,5304,-32335,5279,-32339,5254,-32343,5230,-32347,5205,-32351,5180,-32355,5155,-32359,5130,-32363,5106,-32367,5081,-32371,5056,-32375,5031,-32379,5006,-32383,4981,-32387,4957,-32390,4932,-32394,4907,-32398,4882,-32402,4857,-32405,4832,-32409,4807,-32413,4783,-32417,4758,-32420,4733,-32424,4708,-32427,4683,-32431,4658,-32435,4633,-32438,4608,-32442,4584,-32445,4559,-32449,4534,-32452,4509,-32456,4484,-32459,4459,-32463,4434,-32466,4409,-32469,4384,-32473,4359,-32476,4335,-32479,4310,-32483,4285,-32486,4260,-32489,4235,-32493,4210,-32496,4185,-32499,4160,-32502,4135,-32505,4110,-32509,4085,-32512,4060,-32515,4035,-32518,4011,-32521,3986,-32524,3961,-32527,3936,-32530,3911,-32533,3886,-32536,3861,-32539,3836,-32542,3811,-32545,3786,-32548,3761,-32551,3736,-32554,3711,-32557,3686,-32559,3661,-32562,3636,-32565,3611,-32568,3586,-32571,3561,-32573,3536,-32576,3511,-32579,3486,-32581,3461,-32584,3436,-32587,3411,-32589,3386,-32592,3361,-32595,3336,-32597,3311,-32600,3286,-32602,3261,-32605,3236,-32607,3211,-32610,3186,-32612,3161,-32615,3136,-32617,3111,-32619,3086,-32622,3061,-32624,3036,-32626,3011,-32629,2986,-32631,2961,-32633,2936,-32636,2911,-32638,2886,-32640,2861,-32642,2836,-32645,2811,-32647,2786,-32649,2761,-32651,2736,-32653,2711,-32655,2686,-32657,2661,-32659,2636,-32661,2610,-32663,2585,-32665,2560,-32667,2535,-32669,2510,-32671,2485,-32673,2460,-32675,2435,-32677,2410,-32679,2385,-32681,2360,-32682,2335,-32684,2310,-32686,2285,-32688,2260,-32689,2235,-32691,2209,-32693,2184,-32695,2159,-32696,2134,-32698,2109,-32700,2084,-32701,2059,-32703,2034,-32704,2009,-32706,1984,-32707,1959,-32709,1934,-32710,1908,-32712,1883,-32713,1858,-32715,1833,-32716,1808,-32718,1783,-32719,1758,-32720,1733,-32722,1708,-32723,1683,-32724,1658,-32726,1632,-32727,1607,-32728,1582,-32729,1557,-32730,1532,-32732,1507,-32733,1482,-32734,1457,-32735,1432,-32736,1406,-32737,1381,-32738,1356,-32739,1331,-32740,1306,-32741,1281,-32742,1256,-32743,1231,-32744,1206,-32745,1180,-32746,1155,-32747,1130,-32748,1105,-32749,1080,-32750,1055,-32751,1030,-32751,1005,-32752,980,-32753,954,-32754,929,-32754,904,-32755,879,-32756,854,-32756,829,-32757,804,-32758,779,-32758,753,-32759,728,-32759,703,-32760,678,-32760,653,-32761,628,-32761,603,-32762,578,-32762,552,-32763,527,-32763,502,-32764,477,-32764,452,-32764,427,-32765,402,-32765,376,-32765,351,-32766,326,-32766,301,-32766,276,-32766,251,-32767,226,-32767,201,-32767,175,-32767,150,-32767,125,-32767,100,-32767,75,-32767,50,-32767,25,-32767,0,-32767,-26,-32767,-51,-32767,-76,-32767,-101,-32767,-126,-32767,-151,-32767,-176,-32767,-202,-32767,-227,-32767,-252,-32767,-277,-32766,-302,-32766,-327,-32766,-352,-32766,-377,-32765,-403,-32765,-428,-32765,-453,-32764,-478,-32764,-503,-32764,-528,-32763,-553,-32763,-579,-32762,-604,-32762,-629,-32761,-654,-32761,-679,-32760,-704,-32760,-729,-32759,-754,-32759,-780,-32758,-805,-32758,-830,-32757,-855,-32756,-880,-32756,-905,-32755,-930,-32754,-955,-32754,-981,-32753,-1006,-32752,-1031,-32751,-1056,-32751,-1081,-32750,-1106,-32749,-1131,-32748,-1156,-32747,-1181,-32746,-1207,-32745,-1232,-32744,-1257,-32743,-1282,-32742,-1307,-32741,-1332,-32740,-1357,-32739,-1382,-32738,-1407,-32737,-1433,-32736,-1458,-32735,-1483,-32734,-1508,-32733,-1533,-32732,-1558,-32730,-1583,-32729,-1608,-32728,-1633,-32727,-1659,-32726,-1684,-32724,-1709,-32723,-1734,-32722,-1759,-32720,-1784,-32719,-1809,-32718,-1834,-32716,-1859,-32715,-1884,-32713,-1909,-32712,-1935,-32710,-1960,-32709,-1985,-32707,-2010,-32706,-2035,-32704,-2060,-32703,-2085,-32701,-2110,-32700,-2135,-32698,-2160,-32696,-2185,-32695,-2210,-32693,-2236,-32691,-2261,-32689,-2286,-32688,-2311,-32686,-2336,-32684,-2361,-32682,-2386,-32681,-2411,-32679,-2436,-32677,-2461,-32675,-2486,-32673,-2511,-32671,-2536,-32669,-2561,-32667,-2586,-32665,-2611,-32663,-2637,-32661,-2662,-32659,-2687,-32657,-2712,-32655,-2737,-32653,-2762,-32651,-2787,-32649,-2812,-32647,-2837,-32645,-2862,-32642,-2887,-32640,-2912,-32638,-2937,-32636,-2962,-32633,-2987,-32631,-3012,-32629,-3037,-32626,-3062,-32624,-3087,-32622,-3112,-32619,-3137,-32617,-3162,-32615,-3187,-32612,-3212,-32610,-3237,-32607,-3262,-32605,-3287,-32602,-3312,-32600,-3337,-32597,-3362,-32595,-3387,-32592,-3412,-32589,-3437,-32587,-3462,-32584,-3487,-32581,-3512,-32579,-3537,-32576,-3562,-32573,-3587,-32571,-3612,-32568,-3637,-32565,-3662,-32562,-3687,-32559,-3712,-32557,-3737,-32554,-3762,-32551,-3787,-32548,-3812,-32545,-3837,-32542,-3862,-32539,-3887,-32536,-3912,-32533,-3937,-32530,-3962,-32527,-3987,-32524,-4012,-32521,-4036,-32518,-4061,-32515,-4086,-32512,-4111,-32509,-4136,-32505,-4161,-32502,-4186,-32499,-4211,-32496,-4236,-32493,-4261,-32489,-4286,-32486,-4311,-32483,-4336,-32479,-4360,-32476,-4385,-32473,-4410,-32469,-4435,-32466,-4460,-32463,-4485,-32459,-4510,-32456,-4535,-32452,-4560,-32449,-4585,-32445,-4609,-32442,-4634,-32438,-4659,-32435,-4684,-32431,-4709,-32427,-4734,-32424,-4759,-32420,-4784,-32417,-4808,-32413,-4833,-32409,-4858,-32405,-4883,-32402,-4908,-32398,-4933,-32394,-4958,-32390,-4982,-32387,-5007,-32383,-5032,-32379,-5057,-32375,-5082,-32371,-5107,-32367,-5131,-32363,-5156,-32359,-5181,-32355,-5206,-32351,-5231,-32347,-5255,-32343,-5280,-32339,-5305,-32335,-5330,-32331,-5355,-32327,-5379,-32323,-5404,-32319,-5429,-32315,-5454,-32311,-5479,-32306,-5503,-32302,-5528,-32298,-5553,-32294,-5578,-32289,-5602,-32285,-5627,-32281,-5652,-32276,-5677,-32272,-5701,-32268,-5726,-32263,-5751,-32259,-5776,-32255,-5800,-32250,-5825,-32246,-5850,-32241,-5875,-32237,-5899,-32232,-5924,-32228,-5949,-32223,-5973,-32219,-5998,-32214,-6023,-32209,-6048,-32205,-6072,-32200,-6097,-32195,-6122,-32191,-6146,-32186,-6171,-32181,-6196,-32177,-6220,-32172,-6245,-32167,-6270,-32162,-6294,-32157,-6319,-32153,-6344,-32148,-6368,-32143,-6393,-32138,-6418,-32133,-6442,-32128,-6467,-32123,-6492,-32118,-6516,-32113,-6541,-32108,-6565,-32103,-6590,-32098,-6615,-32093,-6639,-32088,-6664,-32083,-6689,-32078,-6713,-32073,-6738,-32067,-6762,-32062,-6787,-32057,-6812,-32052,-6836,-32047,-6861,-32041,-6885,-32036,-6910,-32031,-6934,-32025,-6959,-32020,-6983,-32015,-7008,-32009,-7033,-32004,-7057,-31999,-7082,-31993,-7106,-31988,-7131,-31982,-7155,-31977,-7180,-31971,-7204,-31966,-7229,-31960,-7253,-31955,-7278,-31949,-7302,-31944,-7327,-31938,-7351,-31932,-7376,-31927,-7400,-31921,-7425,-31915,-7449,-31910,-7474,-31904,-7498,-31898,-7523,-31892,-7547,-31887,-7572,-31881,-7596,-31875,-7620,-31869,-7645,-31863,-7669,-31857,-7694,-31852,-7718,-31846,-7743,-31840,-7767,-31834,-7791,-31828,-7816,-31822,-7840,-31816,-7865,-31810,-7889,-31804,-7913,-31798,-7938,-31792,-7962,-31786,-7987,-31779,-8011,-31773,-8035,-31767,-8060,-31761,-8084,-31755,-8108,-31749,-8133,-31742,-8157,-31736,-8181,-31730,-8206,-31724,-8230,-31717,-8254,-31711,-8279,-31705,-8303,-31698,-8327,-31692,-8352,-31685,-8376,-31679,-8400,-31673,-8425,-31666,-8449,-31660,-8473,-31653,-8497,-31647,-8522,-31640,-8546,-31634,-8570,-31627,-8594,-31620,-8619,-31614,-8643,-31607,-8667,-31601,-8691,-31594,-8716,-31587,-8740,-31581,-8764,-31574,-8788,-31567,-8813,-31560,-8837,-31554,-8861,-31547,-8885,-31540,-8909,-31533,-8933,-31526,-8958,-31519,-8982,-31513,-9006,-31506,-9030,-31499,-9054,-31492,-9078,-31485,-9103,-31478,-9127,-31471,-9151,-31464,-9175,-31457,-9199,-31450,-9223,-31443,-9247,-31436,-9271,-31429,-9296,-31421,-9320,-31414,-9344,-31407,-9368,-31400,-9392,-31393,-9416,-31386,-9440,-31378,-9464,-31371,-9488,-31364,-9512,-31357,-9536,-31349,-9560,-31342,-9584,-31335,-9608,-31327,-9632,-31320,-9656,-31312,-9680,-31305,-9704,-31298,-9728,-31290,-9752,-31283,-9776,-31275,-9800,-31268,-9824,-31260,-9848,-31253,-9872,-31245,-9896,-31237,-9920,-31230,-9944,-31222,-9968,-31215,-9992,-31207,-10016,-31199,-10040,-31192,-10064,-31184,-10088,-31176,-10112,-31168,-10136,-31161,-10160,-31153,-10183,-31145,-10207,-31137,-10231,-31129,-10255,-31122,-10279,-31114,-10303,-31106,-10327,-31098,-10350,-31090,-10374,-31082,-10398,-31074,-10422,-31066,-10446,-31058,-10470,-31050,-10493,-31042,-10517,-31034,-10541,-31026,-10565,-31018,-10589,-31010,-10612,-31002,-10636,-30993,-10660,-30985,-10684,-30977,-10707,-30969,-10731,-30961,-10755,-30952,-10779,-30944,-10802,-30936,-10826,-30928,-10850,-30919,-10874,-30911,-10897,-30903,-10921,-30894,-10945,-30886,-10968,-30877,-10992,-30869,-11016,-30861,-11039,-30852,-11063,-30844,-11087,-30835,-11110,-30827,-11134,-30818,-11158,-30810,-11181,-30801,-11205,-30792,-11228,-30784,-11252,-30775,-11276,-30767,-11299,-30758,-11323,-30749,-11346,-30740,-11370,-30732,-11394,-30723,-11417,-30714,-11441,-30706,-11464,-30697,-11488,-30688,-11511,-30679,-11535,-30670,-11558,-30661,-11582,-30653,-11605,-30644,-11629,-30635,-11652,-30626,-11676,-30617,-11699,-30608,-11723,-30599,-11746,-30590,-11770,-30581,-11793,-30572,-11817,-30563,-11840,-30554,-11863,-30545,-11887,-30536,-11910,-30526,-11934,-30517,-11957,-30508,-11981,-30499,-12004,-30490,-12027,-30481,-12051,-30471,-12074,-30462,-12097,-30453,-12121,-30443,-12144,-30434,-12167,-30425,-12191,-30416,-12214,-30406,-12237,-30397,-12261,-30387,-12284,-30378,-12307,-30369,-12331,-30359,-12354,-30350,-12377,-30340,-12400,-30331,-12424,-30321,-12447,-30312,-12470,-30302,-12493,-30292,-12517,-30283,-12540,-30273,-12563,-30264,-12586,-30254,-12610,-30244,-12633,-30235,-12656,-30225,-12679,-30215,-12702,-30206,-12725,-30196,-12749,-30186,-12772,-30176,-12795,-30166,-12818,-30157,-12841,-30147,-12864,-30137,-12887,-30127,-12910,-30117,-12934,-30107,-12957,-30097,-12980,-30087,-13003,-30077,-13026,-30067,-13049,-30057,-13072,-30047,-13095,-30037,-13118,-30027,-13141,-30017,-13164,-30007,-13187,-29997,-13210,-29987,-13233,-29977,-13256,-29967,-13279,-29956,-13302,-29946,-13325,-29936,-13348,-29926,-13371,-29916,-13394,-29905,-13417,-29895,-13440,-29885,-13463,-29874,-13486,-29864,-13508,-29854,-13531,-29843,-13554,-29833,-13577,-29823,-13600,-29812,-13623,-29802,-13646,-29791,-13668,-29781,-13691,-29770,-13714,-29760,-13737,-29749,-13760,-29739,-13783,-29728,-13805,-29718,-13828,-29707,-13851,-29696,-13874,-29686,-13896,-29675,-13919,-29664,-13942,-29654,-13965,-29643,-13987,-29632,-14010,-29622,-14033,-29611,-14056,-29600,-14078,-29589,-14101,-29578,-14124,-29568,-14146,-29557,-14169,-29546,-14192,-29535,-14214,-29524,-14237,-29513,-14260,-29502,-14282,-29491,-14305,-29480,-14327,-29469,-14350,-29458,-14373,-29447,-14395,-29436,-14418,-29425,-14440,-29414,-14463,-29403,-14485,-29392,-14508,-29381,-14531,-29370,-14553,-29359,-14576,-29347,-14598,-29336,-14621,-29325,-14643,-29314,-14666,-29303,-14688,-29291,-14710,-29280,-14733,-29269,-14755,-29257,-14778,-29246,-14800,-29235,-14823,-29223,-14845,-29212,-14867,-29201,-14890,-29189,-14912,-29178,-14935,-29166,-14957,-29155,-14979,-29143,-15002,-29132,-15024,-29120,-15046,-29109,-15069,-29097,-15091,-29086,-15113,-29074,-15136,-29063,-15158,-29051,-15180,-29039,-15202,-29028,-15225,-29016,-15247,-29004,-15269,-28993,-15291,-28981,-15314,-28969,-15336,-28957,-15358,-28946,-15380,-28934,-15402,-28922,-15425,-28910,-15447,-28898,-15469,-28887,-15491,-28875,-15513,-28863,-15535,-28851,-15557,-28839,-15580,-28827,-15602,-28815,-15624,-28803,-15646,-28791,-15668,-28779,-15690,-28767,-15712,-28755,-15734,-28743,-15756,-28731,-15778,-28719,-15800,-28707,-15822,-28695,-15844,-28682,-15866,-28670,-15888,-28658,-15910,-28646,-15932,-28634,-15954,-28621,-15976,-28609,-15998,-28597,-16020,-28585,-16042,-28572,-16064,-28560,-16086,-28548,-16108,-28535,-16129,-28523,-16151,-28511,-16173,-28498,-16195,-28486,-16217,-28473,-16239,-28461,-16261,-28448,-16282,-28436,-16304,-28424,-16326,-28411,-16348,-28398,-16369,-28386,-16391,-28373,-16413,-28361,-16435,-28348,-16456,-28336,-16478,-28323,-16500,-28310,-16522,-28298,-16543,-28285,-16565,-28272,-16587,-28260,-16608,-28247,-16630,-28234,-16652,-28221,-16673,-28209,-16695,-28196,-16717,-28183,-16738,-28170,-16760,-28157,-16781,-28144,-16803,-28132,-16825,-28119,-16846,-28106,-16868,-28093,-16889,-28080,-16911,-28067,-16932,-28054,-16954,-28041,-16975,-28028,-16997,-28015,-17018,-28002,-17040,-27989,-17061,-27976,-17083,-27963,-17104,-27949,-17125,-27936,-17147,-27923,-17168,-27910,-17190,-27897,-17211,-27884,-17233,-27870,-17254,-27857,-17275,-27844,-17297,-27831,-17318,-27817,-17339,-27804,-17361,-27791,-17382,-27778,-17403,-27764,-17424,-27751,-17446,-27737,-17467,-27724,-17488,-27711,-17510,-27697,-17531,-27684,-17552,-27670,-17573,-27657,-17594,-27643,-17616,-27630,-17637,-27616,-17658,-27603,-17679,-27589,-17700,-27576,-17721,-27562,-17743,-27549,-17764,-27535,-17785,-27521,-17806,-27508,-17827,-27494,-17848,-27480,-17869,-27467,-17890,-27453,-17911,-27439,-17932,-27425,-17953,-27412,-17974,-27398,-17995,-27384,-18016,-27370,-18037,-27356,-18058,-27343,-18079,-27329,-18100,-27315,-18121,-27301,-18142,-27287,-18163,-27273,-18184,-27259,-18205,-27245,-18226,-27231,-18247,-27217,-18268,-27203,-18288,-27189,-18309,-27175,-18330,-27161,-18351,-27147,-18372,-27133,-18393,-27119,-18413,-27105,-18434,-27091,-18455,-27077,-18476,-27062,-18496,-27048,-18517,-27034,-18538,-27020,-18559,-27006,-18579,-26991,-18600,-26977,-18621,-26963,-18641,-26949,-18662,-26934,-18683,-26920,-18703,-26906,-18724,-26891,-18745,-26877,-18765,-26862,-18786,-26848,-18806,-26834,-18827,-26819,-18847,-26805,-18868,-26790,-18889,-26776,-18909,-26761,-18930,-26747,-18950,-26732,-18971,-26718,-18991,-26703,-19012,-26689,-19032,-26674,-19052,-26659,-19073,-26645,-19093,-26630,-19114,-26616,-19134,-26601,-19155,-26586,-19175,-26571,-19195,-26557,-19216,-26542,-19236,-26527,-19256,-26513,-19277,-26498,-19297,-26483,-19317,-26468,-19338,-26453,-19358,-26438,-19378,-26424,-19398,-26409,-19419,-26394,-19439,-26379,-19459,-26364,-19479,-26349,-19500,-26334,-19520,-26319,-19540,-26304,-19560,-26289,-19580,-26274,-19600,-26259,-19621,-26244,-19641,-26229,-19661,-26214,-19681,-26199,-19701,-26184,-19721,-26169,-19741,-26154,-19761,-26138,-19781,-26123,-19801,-26108,-19821,-26093,-19841,-26078,-19861,-26062,-19881,-26047,-19901,-26032,-19921,-26017,-19941,-26001,-19961,-25986,-19981,-25971,-20001,-25955,-20021,-25940,-20041,-25925,-20061,-25909,-20080,-25894,-20100,-25879,-20120,-25863,-20140,-25848,-20160,-25832,-20180,-25817,-20199,-25801,-20219,-25786,-20239,-25770,-20259,-25755,-20278,-25739,-20298,-25724,-20318,-25708,-20338,-25692,-20357,-25677,-20377,-25661,-20397,-25646,-20416,-25630,-20436,-25614,-20456,-25599,-20475,-25583,-20495,-25567,-20514,-25551,-20534,-25536,-20554,-25520,-20573,-25504,-20593,-25488,-20612,-25473,-20632,-25457,-20651,-25441,-20671,-25425,-20690,-25409,-20710,-25393,-20729,-25377,-20749,-25362,-20768,-25346,-20788,-25330,-20807,-25314,-20826,-25298,-20846,-25282,-20865,-25266,-20885,-25250,-20904,-25234,-20923,-25218,-20943,-25202,-20962,-25186,-20981,-25170,-21001,-25153,-21020,-25137,-21039,-25121,-21058,-25105,-21078,-25089,-21097,-25073,-21116,-25057,-21135,-25040,-21155,-25024,-21174,-25008,-21193,-24992,-21212,-24975,-21231,-24959,-21250,-24943,-21269,-24927,-21289,-24910,-21308,-24894,-21327,-24878,-21346,-24861,-21365,-24845,-21384,-24828,-21403,-24812,-21422,-24796,-21441,-24779,-21460,-24763,-21479,-24746,-21498,-24730,-21517,-24713,-21536,-24697,-21555,-24680,-21574,-24664,-21593,-24647,-21612,-24631,-21630,-24614,-21649,-24597,-21668,-24581,-21687,-24564,-21706,-24547,-21725,-24531,-21744,-24514,-21762,-24497,-21781,-24481,-21800,-24464,-21819,-24447,-21837,-24431,-21856,-24414,-21875,-24397,-21894,-24380,-21912,-24363,-21931,-24347,-21950,-24330,-21968,-24313,-21987,-24296,-22005,-24279,-22024,-24262,-22043,-24245,-22061,-24229,-22080,-24212,-22098,-24195,-22117,-24178,-22136,-24161,-22154,-24144,-22173,-24127,-22191,-24110,-22210,-24093,-22228,-24076,-22246,-24059,-22265,-24042,-22283,-24024,-22302,-24007,-22320,-23990,-22339,-23973,-22357,-23956,-22375,-23939,-22394,-23922,-22412,-23904,-22430,-23887,-22449,-23870,-22467,-23853,-22485,-23836,-22504,-23818,-22522,-23801,-22540,-23784,-22558,-23767,-22576,-23749,-22595,-23732,-22613,-23715,-22631,-23697,-22649,-23680,-22667,-23662,-22686,-23645,-22704,-23628,-22722,-23610,-22740,-23593,-22758,-23575,-22776,-23558,-22794,-23540,-22812,-23523,-22830,-23505,-22848,-23488,-22866,-23470,-22884,-23453,-22902,-23435,-22920,-23418,-22938,-23400,-22956,-23383,-22974,-23365,-22992,-23347,-23010,-23330,-23028,-23312,-23046,-23294,-23063,-23277,-23081,-23259,-23099,-23241,-23117,-23224,-23135,-23206,-23152,-23188,-23170,-23170,-23188,-23152,-23206,-23135,-23224,-23117,-23241,-23099,-23259,-23081,-23277,-23063,-23294,-23046,-23312,-23028,-23330,-23010,-23347,-22992,-23365,-22974,-23383,-22956,-23400,-22938,-23418,-22920,-23435,-22902,-23453,-22884,-23470,-22866,-23488,-22848,-23505,-22830,-23523,-22812,-23540,-22794,-23558,-22776,-23575,-22758,-23593,-22740,-23610,-22722,-23628,-22704,-23645,-22686,-23662,-22667,-23680,-22649,-23697,-22631,-23715,-22613,-23732,-22595,-23749,-22576,-23767,-22558,-23784,-22540,-23801,-22522,-23818,-22504,-23836,-22485,-23853,-22467,-23870,-22449,-23887,-22430,-23904,-22412,-23922,-22394,-23939,-22375,-23956,-22357,-23973,-22339,-23990,-22320,-24007,-22302,-24024,-22283,-24042,-22265,-24059,-22246,-24076,-22228,-24093,-22210,-24110,-22191,-24127,-22173,-24144,-22154,-24161,-22136,-24178,-22117,-24195,-22098,-24212,-22080,-24229,-22061,-24245,-22043,-24262,-22024,-24279,-22005,-24296,-21987,-24313,-21968,-24330,-21950,-24347,-21931,-24363,-21912,-24380,-21894,-24397,-21875,-24414,-21856,-24431,-21837,-24447,-21819,-24464,-21800,-24481,-21781,-24497,-21762,-24514,-21744,-24531,-21725,-24547,-21706,-24564,-21687,-24581,-21668,-24597,-21649,-24614,-21630,-24631,-21612,-24647,-21593,-24664,-21574,-24680,-21555,-24697,-21536,-24713,-21517,-24730,-21498,-24746,-21479,-24763,-21460,-24779,-21441,-24796,-21422,-24812,-21403,-24828,-21384,-24845,-21365,-24861,-21346,-24878,-21327,-24894,-21308,-24910,-21289,-24927,-21269,-24943,-21250,-24959,-21231,-24975,-21212,-24992,-21193,-25008,-21174,-25024,-21155,-25040,-21135,-25057,-21116,-25073,-21097,-25089,-21078,-25105,-21058,-25121,-21039,-25137,-21020,-25153,-21001,-25170,-20981,-25186,-20962,-25202,-20943,-25218,-20923,-25234,-20904,-25250,-20885,-25266,-20865,-25282,-20846,-25298,-20826,-25314,-20807,-25330,-20788,-25346,-20768,-25362,-20749,-25377,-20729,-25393,-20710,-25409,-20690,-25425,-20671,-25441,-20651,-25457,-20632,-25473,-20612,-25488,-20593,-25504,-20573,-25520,-20554,-25536,-20534,-25551,-20514,-25567,-20495,-25583,-20475,-25599,-20456,-25614,-20436,-25630,-20416,-25646,-20397,-25661,-20377,-25677,-20357,-25692,-20338,-25708,-20318,-25724,-20298,-25739,-20278,-25755,-20259,-25770,-20239,-25786,-20219,-25801,-20199,-25817,-20180,-25832,-20160,-25848,-20140,-25863,-20120,-25879,-20100,-25894,-20080,-25909,-20061,-25925,-20041,-25940,-20021,-25955,-20001,-25971,-19981,-25986,-19961,-26001,-19941,-26017,-19921,-26032,-19901,-26047,-19881,-26062,-19861,-26078,-19841,-26093,-19821,-26108,-19801,-26123,-19781,-26138,-19761,-26154,-19741,-26169,-19721,-26184,-19701,-26199,-19681,-26214,-19661,-26229,-19641,-26244,-19621,-26259,-19600,-26274,-19580,-26289,-19560,-26304,-19540,-26319,-19520,-26334,-19500,-26349,-19479,-26364,-19459,-26379,-19439,-26394,-19419,-26409,-19398,-26424,-19378,-26438,-19358,-26453,-19338,-26468,-19317,-26483,-19297,-26498,-19277,-26513,-19256,-26527,-19236,-26542,-19216,-26557,-19195,-26571,-19175,-26586,-19155,-26601,-19134,-26616,-19114,-26630,-19093,-26645,-19073,-26659,-19052,-26674,-19032,-26689,-19012,-26703,-18991,-26718,-18971,-26732,-18950,-26747,-18930,-26761,-18909,-26776,-18889,-26790,-18868,-26805,-18847,-26819,-18827,-26834,-18806,-26848,-18786,-26862,-18765,-26877,-18745,-26891,-18724,-26906,-18703,-26920,-18683,-26934,-18662,-26949,-18641,-26963,-18621,-26977,-18600,-26991,-18579,-27006,-18559,-27020,-18538,-27034,-18517,-27048,-18496,-27062,-18476,-27077,-18455,-27091,-18434,-27105,-18413,-27119,-18393,-27133,-18372,-27147,-18351,-27161,-18330,-27175,-18309,-27189,-18288,-27203,-18268,-27217,-18247,-27231,-18226,-27245,-18205,-27259,-18184,-27273,-18163,-27287,-18142,-27301,-18121,-27315,-18100,-27329,-18079,-27343,-18058,-27356,-18037,-27370,-18016,-27384,-17995,-27398,-17974,-27412,-17953,-27425,-17932,-27439,-17911,-27453,-17890,-27467,-17869,-27480,-17848,-27494,-17827,-27508,-17806,-27521,-17785,-27535,-17764,-27549,-17743,-27562,-17721,-27576,-17700,-27589,-17679,-27603,-17658,-27616,-17637,-27630,-17616,-27643,-17594,-27657,-17573,-27670,-17552,-27684,-17531,-27697,-17510,-27711,-17488,-27724,-17467,-27737,-17446,-27751,-17424,-27764,-17403,-27778,-17382,-27791,-17361,-27804,-17339,-27817,-17318,-27831,-17297,-27844,-17275,-27857,-17254,-27870,-17233,-27884,-17211,-27897,-17190,-27910,-17168,-27923,-17147,-27936,-17125,-27949,-17104,-27963,-17083,-27976,-17061,-27989,-17040,-28002,-17018,-28015,-16997,-28028,-16975,-28041,-16954,-28054,-16932,-28067,-16911,-28080,-16889,-28093,-16868,-28106,-16846,-28119,-16825,-28132,-16803,-28144,-16781,-28157,-16760,-28170,-16738,-28183,-16717,-28196,-16695,-28209,-16673,-28221,-16652,-28234,-16630,-28247,-16608,-28260,-16587,-28272,-16565,-28285,-16543,-28298,-16522,-28310,-16500,-28323,-16478,-28336,-16456,-28348,-16435,-28361,-16413,-28373,-16391,-28386,-16369,-28398,-16348,-28411,-16326,-28424,-16304,-28436,-16282,-28448,-16261,-28461,-16239,-28473,-16217,-28486,-16195,-28498,-16173,-28511,-16151,-28523,-16129,-28535,-16108,-28548,-16086,-28560,-16064,-28572,-16042,-28585,-16020,-28597,-15998,-28609,-15976,-28621,-15954,-28634,-15932,-28646,-15910,-28658,-15888,-28670,-15866,-28682,-15844,-28695,-15822,-28707,-15800,-28719,-15778,-28731,-15756,-28743,-15734,-28755,-15712,-28767,-15690,-28779,-15668,-28791,-15646,-28803,-15624,-28815,-15602,-28827,-15580,-28839,-15557,-28851,-15535,-28863,-15513,-28875,-15491,-28887,-15469,-28898,-15447,-28910,-15425,-28922,-15402,-28934,-15380,-28946,-15358,-28957,-15336,-28969,-15314,-28981,-15291,-28993,-15269,-29004,-15247,-29016,-15225,-29028,-15202,-29039,-15180,-29051,-15158,-29063,-15136,-29074,-15113,-29086,-15091,-29097,-15069,-29109,-15046,-29120,-15024,-29132,-15002,-29143,-14979,-29155,-14957,-29166,-14935,-29178,-14912,-29189,-14890,-29201,-14867,-29212,-14845,-29223,-14823,-29235,-14800,-29246,-14778,-29257,-14755,-29269,-14733,-29280,-14710,-29291,-14688,-29303,-14666,-29314,-14643,-29325,-14621,-29336,-14598,-29347,-14576,-29359,-14553,-29370,-14531,-29381,-14508,-29392,-14485,-29403,-14463,-29414,-14440,-29425,-14418,-29436,-14395,-29447,-14373,-29458,-14350,-29469,-14327,-29480,-14305,-29491,-14282,-29502,-14260,-29513,-14237,-29524,-14214,-29535,-14192,-29546,-14169,-29557,-14146,-29568,-14124,-29578,-14101,-29589,-14078,-29600,-14056,-29611,-14033,-29622,-14010,-29632,-13987,-29643,-13965,-29654,-13942,-29664,-13919,-29675,-13896,-29686,-13874,-29696,-13851,-29707,-13828,-29718,-13805,-29728,-13783,-29739,-13760,-29749,-13737,-29760,-13714,-29770,-13691,-29781,-13668,-29791,-13646,-29802,-13623,-29812,-13600,-29823,-13577,-29833,-13554,-29843,-13531,-29854,-13508,-29864,-13486,-29874,-13463,-29885,-13440,-29895,-13417,-29905,-13394,-29916,-13371,-29926,-13348,-29936,-13325,-29946,-13302,-29956,-13279,-29967,-13256,-29977,-13233,-29987,-13210,-29997,-13187,-30007,-13164,-30017,-13141,-30027,-13118,-30037,-13095,-30047,-13072,-30057,-13049,-30067,-13026,-30077,-13003,-30087,-12980,-30097,-12957,-30107,-12934,-30117,-12910,-30127,-12887,-30137,-12864,-30147,-12841,-30157,-12818,-30166,-12795,-30176,-12772,-30186,-12749,-30196,-12725,-30206,-12702,-30215,-12679,-30225,-12656,-30235,-12633,-30244,-12610,-30254,-12586,-30264,-12563,-30273,-12540,-30283,-12517,-30292,-12493,-30302,-12470,-30312,-12447,-30321,-12424,-30331,-12400,-30340,-12377,-30350,-12354,-30359,-12331,-30369,-12307,-30378,-12284,-30387,-12261,-30397,-12237,-30406,-12214,-30416,-12191,-30425,-12167,-30434,-12144,-30443,-12121,-30453,-12097,-30462,-12074,-30471,-12051,-30481,-12027,-30490,-12004,-30499,-11981,-30508,-11957,-30517,-11934,-30526,-11910,-30536,-11887,-30545,-11863,-30554,-11840,-30563,-11817,-30572,-11793,-30581,-11770,-30590,-11746,-30599,-11723,-30608,-11699,-30617,-11676,-30626,-11652,-30635,-11629,-30644,-11605,-30653,-11582,-30661,-11558,-30670,-11535,-30679,-11511,-30688,-11488,-30697,-11464,-30706,-11441,-30714,-11417,-30723,-11394,-30732,-11370,-30740,-11346,-30749,-11323,-30758,-11299,-30767,-11276,-30775,-11252,-30784,-11228,-30792,-11205,-30801,-11181,-30810,-11158,-30818,-11134,-30827,-11110,-30835,-11087,-30844,-11063,-30852,-11039,-30861,-11016,-30869,-10992,-30877,-10968,-30886,-10945,-30894,-10921,-30903,-10897,-30911,-10874,-30919,-10850,-30928,-10826,-30936,-10802,-30944,-10779,-30952,-10755,-30961,-10731,-30969,-10707,-30977,-10684,-30985,-10660,-30993,-10636,-31002,-10612,-31010,-10589,-31018,-10565,-31026,-10541,-31034,-10517,-31042,-10493,-31050,-10470,-31058,-10446,-31066,-10422,-31074,-10398,-31082,-10374,-31090,-10350,-31098,-10327,-31106,-10303,-31114,-10279,-31122,-10255,-31129,-10231,-31137,-10207,-31145,-10183,-31153,-10160,-31161,-10136,-31168,-10112,-31176,-10088,-31184,-10064,-31192,-10040,-31199,-10016,-31207,-9992,-31215,-9968,-31222,-9944,-31230,-9920,-31237,-9896,-31245,-9872,-31253,-9848,-31260,-9824,-31268,-9800,-31275,-9776,-31283,-9752,-31290,-9728,-31298,-9704,-31305,-9680,-31312,-9656,-31320,-9632,-31327,-9608,-31335,-9584,-31342,-9560,-31349,-9536,-31357,-9512,-31364,-9488,-31371,-9464,-31378,-9440,-31386,-9416,-31393,-9392,-31400,-9368,-31407,-9344,-31414,-9320,-31421,-9296,-31429,-9271,-31436,-9247,-31443,-9223,-31450,-9199,-31457,-9175,-31464,-9151,-31471,-9127,-31478,-9103,-31485,-9078,-31492,-9054,-31499,-9030,-31506,-9006,-31513,-8982,-31519,-8958,-31526,-8933,-31533,-8909,-31540,-8885,-31547,-8861,-31554,-8837,-31560,-8813,-31567,-8788,-31574,-8764,-31581,-8740,-31587,-8716,-31594,-8691,-31601,-8667,-31607,-8643,-31614,-8619,-31620,-8594,-31627,-8570,-31634,-8546,-31640,-8522,-31647,-8497,-31653,-8473,-31660,-8449,-31666,-8425,-31673,-8400,-31679,-8376,-31685,-8352,-31692,-8327,-31698,-8303,-31705,-8279,-31711,-8254,-31717,-8230,-31724,-8206,-31730,-8181,-31736,-8157,-31742,-8133,-31749,-8108,-31755,-8084,-31761,-8060,-31767,-8035,-31773,-8011,-31779,-7987,-31786,-7962,-31792,-7938,-31798,-7913,-31804,-7889,-31810,-7865,-31816,-7840,-31822,-7816,-31828,-7791,-31834,-7767,-31840,-7743,-31846,-7718,-31852,-7694,-31857,-7669,-31863,-7645,-31869,-7620,-31875,-7596,-31881,-7572,-31887,-7547,-31892,-7523,-31898,-7498,-31904,-7474,-31910,-7449,-31915,-7425,-31921,-7400,-31927,-7376,-31932,-7351,-31938,-7327,-31944,-7302,-31949,-7278,-31955,-7253,-31960,-7229,-31966,-7204,-31971,-7180,-31977,-7155,-31982,-7131,-31988,-7106,-31993,-7082,-31999,-7057,-32004,-7033,-32009,-7008,-32015,-6983,-32020,-6959,-32025,-6934,-32031,-6910,-32036,-6885,-32041,-6861,-32047,-6836,-32052,-6812,-32057,-6787,-32062,-6762,-32067,-6738,-32073,-6713,-32078,-6689,-32083,-6664,-32088,-6639,-32093,-6615,-32098,-6590,-32103,-6565,-32108,-6541,-32113,-6516,-32118,-6492,-32123,-6467,-32128,-6442,-32133,-6418,-32138,-6393,-32143,-6368,-32148,-6344,-32153,-6319,-32157,-6294,-32162,-6270,-32167,-6245,-32172,-6220,-32177,-6196,-32181,-6171,-32186,-6146,-32191,-6122,-32195,-6097,-32200,-6072,-32205,-6048,-32209,-6023,-32214,-5998,-32219,-5973,-32223,-5949,-32228,-5924,-32232,-5899,-32237,-5875,-32241,-5850,-32246,-5825,-32250,-5800,-32255,-5776,-32259,-5751,-32263,-5726,-32268,-5701,-32272,-5677,-32276,-5652,-32281,-5627,-32285,-5602,-32289,-5578,-32294,-5553,-32298,-5528,-32302,-5503,-32306,-5479,-32311,-5454,-32315,-5429,-32319,-5404,-32323,-5379,-32327,-5355,-32331,-5330,-32335,-5305,-32339,-5280,-32343,-5255,-32347,-5231,-32351,-5206,-32355,-5181,-32359,-5156,-32363,-5131,-32367,-5107,-32371,-5082,-32375,-5057,-32379,-5032,-32383,-5007,-32387,-4982,-32390,-4958,-32394,-4933,-32398,-4908,-32402,-4883,-32405,-4858,-32409,-4833,-32413,-4808,-32417,-4784,-32420,-4759,-32424,-4734,-32427,-4709,-32431,-4684,-32435,-4659,-32438,-4634,-32442,-4609,-32445,-4585,-32449,-4560,-32452,-4535,-32456,-4510,-32459,-4485,-32463,-4460,-32466,-4435,-32469,-4410,-32473,-4385,-32476,-4360,-32479,-4336,-32483,-4311,-32486,-4286,-32489,-4261,-32493,-4236,-32496,-4211,-32499,-4186,-32502,-4161,-32505,-4136,-32509,-4111,-32512,-4086,-32515,-4061,-32518,-4036,-32521,-4012,-32524,-3987,-32527,-3962,-32530,-3937,-32533,-3912,-32536,-3887,-32539,-3862,-32542,-3837,-32545,-3812,-32548,-3787,-32551,-3762,-32554,-3737,-32557,-3712,-32559,-3687,-32562,-3662,-32565,-3637,-32568,-3612,-32571,-3587,-32573,-3562,-32576,-3537,-32579,-3512,-32581,-3487,-32584,-3462,-32587,-3437,-32589,-3412,-32592,-3387,-32595,-3362,-32597,-3337,-32600,-3312,-32602,-3287,-32605,-3262,-32607,-3237,-32610,-3212,-32612,-3187,-32615,-3162,-32617,-3137,-32619,-3112,-32622,-3087,-32624,-3062,-32626,-3037,-32629,-3012,-32631,-2987,-32633,-2962,-32636,-2937,-32638,-2912,-32640,-2887,-32642,-2862,-32645,-2837,-32647,-2812,-32649,-2787,-32651,-2762,-32653,-2737,-32655,-2712,-32657,-2687,-32659,-2662,-32661,-2637,-32663,-2611,-32665,-2586,-32667,-2561,-32669,-2536,-32671,-2511,-32673,-2486,-32675,-2461,-32677,-2436,-32679,-2411,-32681,-2386,-32682,-2361,-32684,-2336,-32686,-2311,-32688,-2286,-32689,-2261,-32691,-2236,-32693,-2210,-32695,-2185,-32696,-2160,-32698,-2135,-32700,-2110,-32701,-2085,-32703,-2060,-32704,-2035,-32706,-2010,-32707,-1985,-32709,-1960,-32710,-1935,-32712,-1909,-32713,-1884,-32715,-1859,-32716,-1834,-32718,-1809,-32719,-1784,-32720,-1759,-32722,-1734,-32723,-1709,-32724,-1684,-32726,-1659,-32727,-1633,-32728,-1608,-32729,-1583,-32730,-1558,-32732,-1533,-32733,-1508,-32734,-1483,-32735,-1458,-32736,-1433,-32737,-1407,-32738,-1382,-32739,-1357,-32740,-1332,-32741,-1307,-32742,-1282,-32743,-1257,-32744,-1232,-32745,-1207,-32746,-1181,-32747,-1156,-32748,-1131,-32749,-1106,-32750,-1081,-32751,-1056,-32751,-1031,-32752,-1006,-32753,-981,-32754,-955,-32754,-930,-32755,-905,-32756,-880,-32756,-855,-32757,-830,-32758,-805,-32758,-780,-32759,-754,-32759,-729,-32760,-704,-32760,-679,-32761,-654,-32761,-629,-32762,-604,-32762,-579,-32763,-553,-32763,-528,-32764,-503,-32764,-478,-32764,-453,-32765,-428,-32765,-403,-32765,-377,-32766,-352,-32766,-327,-32766,-302,-32766,-277,-32767,-252,-32767,-227,-32767,-202,-32767,-176,-32767,-151,-32767,-126,-32767,-101,-32767,-76,-32767,-51,-32767,-26}; +#else //__AVX2__ +void dft4096(int16_t *x,int16_t *y,int scale) +{ + + simd256_q15_t xtmp[512],ytmp[512],*tw4096_256p=(simd256_q15_t *)tw4096,*x256=(simd256_q15_t *)x,*y256=(simd256_q15_t *)y,*y256p=(simd256_q15_t *)y; + simd256_q15_t *ytmpp = &ytmp[0]; + int i,j; + + for (i=0,j=0; i<512; i+=4,j++) { + transpose16_ooff_simd256(x256+i,xtmp+j,128); + } + + + dft1024((int16_t*)(xtmp),(int16_t*)(ytmp),1); + dft1024((int16_t*)(xtmp+128),(int16_t*)(ytmp+128),1); + dft1024((int16_t*)(xtmp+256),(int16_t*)(ytmp+256),1); + dft1024((int16_t*)(xtmp+384),(int16_t*)(ytmp+384),1); + + for (i=0; i<128; i++) { + bfly4_256(ytmpp,ytmpp+128,ytmpp+256,ytmpp+384, + y256p,y256p+128,y256p+256,y256p+384, + tw4096_256p,tw4096_256p+128,tw4096_256p+256); + tw4096_256p++; + y256p++; + ytmpp++; + } + + if (scale>0) { + + for (i=0; i<32; i++) { + y256[0] = shiftright_int16_simd256(y256[0],1); + y256[1] = shiftright_int16_simd256(y256[1],1); + y256[2] = shiftright_int16_simd256(y256[2],1); + y256[3] = shiftright_int16_simd256(y256[3],1); + y256[4] = shiftright_int16_simd256(y256[4],1); + y256[5] = shiftright_int16_simd256(y256[5],1); + y256[6] = shiftright_int16_simd256(y256[6],1); + y256[7] = shiftright_int16_simd256(y256[7],1); + y256[8] = shiftright_int16_simd256(y256[8],1); + y256[9] = shiftright_int16_simd256(y256[9],1); + y256[10] = shiftright_int16_simd256(y256[10],1); + y256[11] = shiftright_int16_simd256(y256[11],1); + y256[12] = shiftright_int16_simd256(y256[12],1); + y256[13] = shiftright_int16_simd256(y256[13],1); + y256[14] = shiftright_int16_simd256(y256[14],1); + y256[15] = shiftright_int16_simd256(y256[15],1); + + y256+=16; + } + + } + + _mm_empty(); + _m_empty(); + +} + +void idft4096(int16_t *x,int16_t *y,int scale) +{ + + simd256_q15_t xtmp[512],ytmp[512],*tw4096_256p=(simd256_q15_t *)tw4096,*x256=(simd256_q15_t *)x,*y256=(simd256_q15_t *)y,*y256p=(simd256_q15_t *)y; + simd256_q15_t *ytmpp = &ytmp[0]; + int i,j; + + for (i=0,j=0; i<512; i+=4,j++) { + transpose16_ooff_simd256(x256+i,xtmp+j,128); + } + + + idft1024((int16_t*)(xtmp),(int16_t*)(ytmp),1); + idft1024((int16_t*)(xtmp+128),(int16_t*)(ytmp+128),1); + idft1024((int16_t*)(xtmp+256),(int16_t*)(ytmp+256),1); + idft1024((int16_t*)(xtmp+384),(int16_t*)(ytmp+384),1); + + for (i=0; i<128; i++) { + ibfly4_256(ytmpp,ytmpp+128,ytmpp+256,ytmpp+384, + y256p,y256p+128,y256p+256,y256p+384, + tw4096_256p,tw4096_256p+128,tw4096_256p+256); + tw4096_256p++; + y256p++; + ytmpp++; + } + + if (scale>0) { + + for (i=0; i<32; i++) { + y256[0] = shiftright_int16_simd256(y256[0],1); + y256[1] = shiftright_int16_simd256(y256[1],1); + y256[2] = shiftright_int16_simd256(y256[2],1); + y256[3] = shiftright_int16_simd256(y256[3],1); + y256[4] = shiftright_int16_simd256(y256[4],1); + y256[5] = shiftright_int16_simd256(y256[5],1); + y256[6] = shiftright_int16_simd256(y256[6],1); + y256[7] = shiftright_int16_simd256(y256[7],1); + y256[8] = shiftright_int16_simd256(y256[8],1); + y256[9] = shiftright_int16_simd256(y256[9],1); + y256[10] = shiftright_int16_simd256(y256[10],1); + y256[11] = shiftright_int16_simd256(y256[11],1); + y256[12] = shiftright_int16_simd256(y256[12],1); + y256[13] = shiftright_int16_simd256(y256[13],1); + y256[14] = shiftright_int16_simd256(y256[14],1); + y256[15] = shiftright_int16_simd256(y256[15],1); + + y256+=16; + } + + } + + _mm_empty(); + _m_empty(); + +} + +#endif //__AVX2__ + +#include "twiddles8192.h" + +#ifndef __AVX2__ void dft8192(int16_t *x,int16_t *y,int scale) { @@ -3175,13 +5217,197 @@ void idft8192(int16_t *x,int16_t *y,int scale) } +#else // __AVX2__ +void dft8192(int16_t *x,int16_t *y,int scale) +{ + + simd256_q15_t xtmp[1024],*xtmpp,*x256 = (simd256_q15_t *)x; + simd256_q15_t ytmp[1024],*tw8192_256p=(simd256_q15_t *)tw8192,*y256=(simd256_q15_t *)y,*y256p=(simd256_q15_t *)y; + simd256_q15_t *ytmpp = &ytmp[0]; + int i; + simd256_q15_t ONE_OVER_SQRT2_Q15_128 = set1_int16_simd256(ONE_OVER_SQRT2_Q15); + + xtmpp = xtmp; + + for (i=0; i<32; i++) { + transpose4_ooff_simd256(x256 ,xtmpp,512); + transpose4_ooff_simd256(x256+2,xtmpp+1,512); + transpose4_ooff_simd256(x256+4,xtmpp+2,512); + transpose4_ooff_simd256(x256+6,xtmpp+3,512); + transpose4_ooff_simd256(x256+8,xtmpp+4,512); + transpose4_ooff_simd256(x256+10,xtmpp+5,512); + transpose4_ooff_simd256(x256+12,xtmpp+6,512); + transpose4_ooff_simd256(x256+14,xtmpp+7,512); + transpose4_ooff_simd256(x256+16,xtmpp+8,512); + transpose4_ooff_simd256(x256+18,xtmpp+9,512); + transpose4_ooff_simd256(x256+20,xtmpp+10,512); + transpose4_ooff_simd256(x256+22,xtmpp+11,512); + transpose4_ooff_simd256(x256+24,xtmpp+12,512); + transpose4_ooff_simd256(x256+26,xtmpp+13,512); + transpose4_ooff_simd256(x256+28,xtmpp+14,512); + transpose4_ooff_simd256(x256+30,xtmpp+15,512); + transpose4_ooff_simd256(x256+32,xtmpp+16,512); + transpose4_ooff_simd256(x256+34,xtmpp+17,512); + transpose4_ooff_simd256(x256+36,xtmpp+18,512); + transpose4_ooff_simd256(x256+38,xtmpp+19,512); + transpose4_ooff_simd256(x256+40,xtmpp+20,512); + transpose4_ooff_simd256(x256+42,xtmpp+21,512); + transpose4_ooff_simd256(x256+44,xtmpp+22,512); + transpose4_ooff_simd256(x256+46,xtmpp+23,512); + transpose4_ooff_simd256(x256+48,xtmpp+24,512); + transpose4_ooff_simd256(x256+50,xtmpp+25,512); + transpose4_ooff_simd256(x256+52,xtmpp+26,512); + transpose4_ooff_simd256(x256+54,xtmpp+27,512); + transpose4_ooff_simd256(x256+56,xtmpp+28,512); + transpose4_ooff_simd256(x256+58,xtmpp+29,512); + transpose4_ooff_simd256(x256+60,xtmpp+30,512); + transpose4_ooff_simd256(x256+62,xtmpp+31,512); + x256+=64; + xtmpp+=32; + } + + dft4096((int16_t*)(xtmp),(int16_t*)ytmp,1); + dft4096((int16_t*)(xtmp+1024),(int16_t*)(ytmp+512),1); + + + for (i=0; i<512; i++) { + bfly2_256(ytmpp,ytmpp+512, + y256p,y256p+512, + tw8192_256p); + tw8192_256p++; + y256p++; + ytmpp++; + } + + if (scale>0) { + y256p = y256; + + for (i=0; i<64; i++) { + y256p[0] = mulhi_int16_simd256(y256p[0],ONE_OVER_SQRT2_Q15_128); + y256p[1] = mulhi_int16_simd256(y256p[1],ONE_OVER_SQRT2_Q15_128); + y256p[2] = mulhi_int16_simd256(y256p[2],ONE_OVER_SQRT2_Q15_128); + y256p[3] = mulhi_int16_simd256(y256p[3],ONE_OVER_SQRT2_Q15_128); + y256p[4] = mulhi_int16_simd256(y256p[4],ONE_OVER_SQRT2_Q15_128); + y256p[5] = mulhi_int16_simd256(y256p[5],ONE_OVER_SQRT2_Q15_128); + y256p[6] = mulhi_int16_simd256(y256p[6],ONE_OVER_SQRT2_Q15_128); + y256p[7] = mulhi_int16_simd256(y256p[7],ONE_OVER_SQRT2_Q15_128); + y256p[8] = mulhi_int16_simd256(y256p[8],ONE_OVER_SQRT2_Q15_128); + y256p[9] = mulhi_int16_simd256(y256p[9],ONE_OVER_SQRT2_Q15_128); + y256p[10] = mulhi_int16_simd256(y256p[10],ONE_OVER_SQRT2_Q15_128); + y256p[11] = mulhi_int16_simd256(y256p[11],ONE_OVER_SQRT2_Q15_128); + y256p[12] = mulhi_int16_simd256(y256p[12],ONE_OVER_SQRT2_Q15_128); + y256p[13] = mulhi_int16_simd256(y256p[13],ONE_OVER_SQRT2_Q15_128); + y256p[14] = mulhi_int16_simd256(y256p[14],ONE_OVER_SQRT2_Q15_128); + y256p[15] = mulhi_int16_simd256(y256p[15],ONE_OVER_SQRT2_Q15_128); + y256p+=16; + } + } + + _mm_empty(); + _m_empty(); + +} + +void idft8192(int16_t *x,int16_t *y,int scale) +{ + + simd256_q15_t xtmp[1024],*xtmpp,*x256 = (simd256_q15_t *)x; + simd256_q15_t ytmp[1024],*tw8192_256p=(simd256_q15_t *)tw8192,*y256=(simd256_q15_t *)y,*y256p=(simd256_q15_t *)y; + simd256_q15_t *ytmpp = &ytmp[0]; + int i; + simd256_q15_t ONE_OVER_SQRT2_Q15_128 = set1_int16_simd256(ONE_OVER_SQRT2_Q15); + + xtmpp = xtmp; + + for (i=0; i<32; i++) { + transpose4_ooff_simd256(x256 ,xtmpp,512); + transpose4_ooff_simd256(x256+2,xtmpp+1,512); + transpose4_ooff_simd256(x256+4,xtmpp+2,512); + transpose4_ooff_simd256(x256+6,xtmpp+3,512); + transpose4_ooff_simd256(x256+8,xtmpp+4,512); + transpose4_ooff_simd256(x256+10,xtmpp+5,512); + transpose4_ooff_simd256(x256+12,xtmpp+6,512); + transpose4_ooff_simd256(x256+14,xtmpp+7,512); + transpose4_ooff_simd256(x256+16,xtmpp+8,512); + transpose4_ooff_simd256(x256+18,xtmpp+9,512); + transpose4_ooff_simd256(x256+20,xtmpp+10,512); + transpose4_ooff_simd256(x256+22,xtmpp+11,512); + transpose4_ooff_simd256(x256+24,xtmpp+12,512); + transpose4_ooff_simd256(x256+26,xtmpp+13,512); + transpose4_ooff_simd256(x256+28,xtmpp+14,512); + transpose4_ooff_simd256(x256+30,xtmpp+15,512); + transpose4_ooff_simd256(x256+32,xtmpp+16,512); + transpose4_ooff_simd256(x256+34,xtmpp+17,512); + transpose4_ooff_simd256(x256+36,xtmpp+18,512); + transpose4_ooff_simd256(x256+38,xtmpp+19,512); + transpose4_ooff_simd256(x256+40,xtmpp+20,512); + transpose4_ooff_simd256(x256+42,xtmpp+21,512); + transpose4_ooff_simd256(x256+44,xtmpp+22,512); + transpose4_ooff_simd256(x256+46,xtmpp+23,512); + transpose4_ooff_simd256(x256+48,xtmpp+24,512); + transpose4_ooff_simd256(x256+50,xtmpp+25,512); + transpose4_ooff_simd256(x256+52,xtmpp+26,512); + transpose4_ooff_simd256(x256+54,xtmpp+27,512); + transpose4_ooff_simd256(x256+56,xtmpp+28,512); + transpose4_ooff_simd256(x256+58,xtmpp+29,512); + transpose4_ooff_simd256(x256+60,xtmpp+30,512); + transpose4_ooff_simd256(x256+62,xtmpp+31,512); + x256+=64; + xtmpp+=32; + } + + idft4096((int16_t*)(xtmp),(int16_t*)ytmp,1); + idft4096((int16_t*)(xtmp+1024),(int16_t*)(ytmp+512),1); + + + for (i=0; i<512; i++) { + ibfly2_256(ytmpp,ytmpp+512, + y256p,y256p+512, + tw8192_256p); + tw8192_256p++; + y256p++; + ytmpp++; + } + + if (scale>0) { + y256p = y256; + + for (i=0; i<64; i++) { + y256p[0] = mulhi_int16_simd256(y256p[0],ONE_OVER_SQRT2_Q15_128); + y256p[1] = mulhi_int16_simd256(y256p[1],ONE_OVER_SQRT2_Q15_128); + y256p[2] = mulhi_int16_simd256(y256p[2],ONE_OVER_SQRT2_Q15_128); + y256p[3] = mulhi_int16_simd256(y256p[3],ONE_OVER_SQRT2_Q15_128); + y256p[4] = mulhi_int16_simd256(y256p[4],ONE_OVER_SQRT2_Q15_128); + y256p[5] = mulhi_int16_simd256(y256p[5],ONE_OVER_SQRT2_Q15_128); + y256p[6] = mulhi_int16_simd256(y256p[6],ONE_OVER_SQRT2_Q15_128); + y256p[7] = mulhi_int16_simd256(y256p[7],ONE_OVER_SQRT2_Q15_128); + y256p[8] = mulhi_int16_simd256(y256p[8],ONE_OVER_SQRT2_Q15_128); + y256p[9] = mulhi_int16_simd256(y256p[9],ONE_OVER_SQRT2_Q15_128); + y256p[10] = mulhi_int16_simd256(y256p[10],ONE_OVER_SQRT2_Q15_128); + y256p[11] = mulhi_int16_simd256(y256p[11],ONE_OVER_SQRT2_Q15_128); + y256p[12] = mulhi_int16_simd256(y256p[12],ONE_OVER_SQRT2_Q15_128); + y256p[13] = mulhi_int16_simd256(y256p[13],ONE_OVER_SQRT2_Q15_128); + y256p[14] = mulhi_int16_simd256(y256p[14],ONE_OVER_SQRT2_Q15_128); + y256p[15] = mulhi_int16_simd256(y256p[15],ONE_OVER_SQRT2_Q15_128); + y256p+=16; + } + } + + _mm_empty(); + _m_empty(); + +} + + +#endif + #include "twiddle1536.h" // 512 x 3 -void idft1536(int16_t *input, int16_t *output) +void idft1536(int16_t *input, int16_t *output, int scale) { int i,i2,j; - uint32_t tmp[3][512 ]__attribute__((aligned(16))); - uint32_t tmpo[3][512] __attribute__((aligned(16))); + uint32_t tmp[3][512 ]__attribute__((aligned(32))); + uint32_t tmpo[3][512] __attribute__((aligned(32))); simd_q15_t *y128p=(simd_q15_t*)output; simd_q15_t ONE_OVER_SQRT3_Q15_128 = set1_int16(ONE_OVER_SQRT3_Q15); @@ -3202,24 +5428,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; + if (scale==1) { + 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(); @@ -3227,11 +5455,13 @@ void idft1536(int16_t *input, int16_t *output) } -void dft1536(int16_t *input, int16_t *output) +void dft1536(int16_t *input, int16_t *output, int scale) { int i,i2,j; - uint32_t tmp[3][512] __attribute__((aligned(16))); - uint32_t tmpo[3][512] __attribute__((aligned(16))); + uint32_t tmp[3][512] __attribute__((aligned(32))); + uint32_t tmpo[3][512] __attribute__((aligned(32))); + 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++]; @@ -3259,6 +5489,28 @@ void dft1536(int16_t *input, int16_t *output) (simd_q15_t*)(twa1536+i),(simd_q15_t*)(twb1536+i)); } + if (scale==1) { + 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(); @@ -3280,8 +5532,8 @@ void idft3072(int16_t *input, int16_t *output) void idft6144(int16_t *input, int16_t *output) { int i,i2,j; - uint32_t tmp[3][2048] __attribute__((aligned(16))); - uint32_t tmpo[3][2048] __attribute__((aligned(16))); + uint32_t tmp[3][2048] __attribute__((aligned(32))); + uint32_t tmpo[3][2048] __attribute__((aligned(32))); for (i=0,j=0; i<2048; i++) { tmp[0][i] = ((uint32_t *)input)[j++]; @@ -3321,8 +5573,8 @@ void idft6144(int16_t *input, int16_t *output) void dft6144(int16_t *input, int16_t *output) { int i,i2,j; - uint32_t tmp[3][2048] __attribute__((aligned(16))); - uint32_t tmpo[3][2048] __attribute__((aligned(16))); + uint32_t tmp[3][2048] __attribute__((aligned(32))); + uint32_t tmpo[3][2048] __attribute__((aligned(32))); for (i=0,j=0; i<2048; i++) { tmp[0][i] = ((uint32_t *)input)[j++]; @@ -3361,8 +5613,8 @@ void dft6144(int16_t *input, int16_t *output) void dft12288(int16_t *input, int16_t *output) { int i,i2,j; - uint32_t tmp[3][4096] __attribute__((aligned(16))); - uint32_t tmpo[3][4096] __attribute__((aligned(16))); + uint32_t tmp[3][4096] __attribute__((aligned(32))); + uint32_t tmpo[3][4096] __attribute__((aligned(32))); for (i=0,j=0; i<4096; i++) { tmp[0][i] = ((uint32_t *)input)[j++]; @@ -3397,8 +5649,8 @@ void dft12288(int16_t *input, int16_t *output) void idft12288(int16_t *input, int16_t *output) { int i,i2,j; - uint32_t tmp[3][4096] __attribute__((aligned(16))); - uint32_t tmpo[3][4096] __attribute__((aligned(16))); + uint32_t tmp[3][4096] __attribute__((aligned(32))); + uint32_t tmpo[3][4096] __attribute__((aligned(32))); for (i=0,j=0; i<4096; i++) { tmp[0][i] = ((uint32_t *)input)[j++]; @@ -3444,8 +5696,8 @@ void idft18432(int16_t *input, int16_t *output) void dft24576(int16_t *input, int16_t *output) { int i,i2,j; - uint32_t tmp[3][8192] __attribute__((aligned(16))); - uint32_t tmpo[3][8192] __attribute__((aligned(16))); + uint32_t tmp[3][8192] __attribute__((aligned(32))); + uint32_t tmpo[3][8192] __attribute__((aligned(32))); for (i=0,j=0; i<8192; i++) { tmp[0][i] = ((uint32_t *)input)[j++]; @@ -3481,8 +5733,8 @@ void dft24576(int16_t *input, int16_t *output) void idft24576(int16_t *input, int16_t *output) { int i,i2,j; - uint32_t tmp[3][16384] __attribute__((aligned(16))); - uint32_t tmpo[3][16384] __attribute__((aligned(16))); + uint32_t tmp[3][16384] __attribute__((aligned(32))); + uint32_t tmpo[3][16384] __attribute__((aligned(32))); for (i=0,j=0; i<8192; i++) { tmp[0][i] = ((uint32_t *)input)[j++]; @@ -3523,11 +5775,11 @@ void idft24576(int16_t *input, int16_t *output) /// THIS SECTION IS FOR ALL PUSCH DFTS (i.e. radix 2^a * 3^b * 4^c * 5^d) /// They use twiddles for 4-way parallel DFTS (i.e. 4 DFTS with interleaved input/output) -static int16_t W1_12s[8]__attribute__((aligned(16))) = {28377,-16383,28377,-16383,28377,-16383,28377,-16383}; -static int16_t W2_12s[8]__attribute__((aligned(16))) = {16383,-28377,16383,-28377,16383,-28377,16383,-28377}; -static int16_t W3_12s[8]__attribute__((aligned(16))) = {0,-32767,0,-32767,0,-32767,0,-32767}; -static int16_t W4_12s[8]__attribute__((aligned(16))) = {-16383,-28377,-16383,-28377,-16383,-28377,-16383,-28377}; -static int16_t W6_12s[8]__attribute__((aligned(16))) = {-32767,0,-32767,0,-32767,0,-32767,0}; +static int16_t W1_12s[8]__attribute__((aligned(32))) = {28377,-16383,28377,-16383,28377,-16383,28377,-16383}; +static int16_t W2_12s[8]__attribute__((aligned(32))) = {16383,-28377,16383,-28377,16383,-28377,16383,-28377}; +static int16_t W3_12s[8]__attribute__((aligned(32))) = {0,-32767,0,-32767,0,-32767,0,-32767}; +static int16_t W4_12s[8]__attribute__((aligned(32))) = {-16383,-28377,-16383,-28377,-16383,-28377,-16383,-28377}; +static int16_t W6_12s[8]__attribute__((aligned(32))) = {-32767,0,-32767,0,-32767,0,-32767,0}; simd_q15_t *W1_12=(simd_q15_t *)W1_12s; simd_q15_t *W2_12=(simd_q15_t *)W2_12s; @@ -3706,7 +5958,193 @@ void dft12(int16_t *x,int16_t *y) } -static int16_t tw24[88]__attribute__((aligned(16))) = {31650,-8480,31650,-8480,31650,-8480,31650,-8480, +#ifdef __AVX2__ + +static int16_t W1_12s_256[16]__attribute__((aligned(32))) = {28377,-16383,28377,-16383,28377,-16383,28377,-16383,28377,-16383,28377,-16383,28377,-16383,28377,-16383}; +static int16_t W2_12s_256[16]__attribute__((aligned(32))) = {16383,-28377,16383,-28377,16383,-28377,16383,-28377,16383,-28377,16383,-28377,16383,-28377,16383,-28377}; +static int16_t W3_12s_256[16]__attribute__((aligned(32))) = {0,-32767,0,-32767,0,-32767,0,-32767,0,-32767,0,-32767,0,-32767,0,-32767}; +static int16_t W4_12s_256[16]__attribute__((aligned(32))) = {-16383,-28377,-16383,-28377,-16383,-28377,-16383,-28377,-16383,-28377,-16383,-28377,-16383,-28377,-16383,-28377}; +static int16_t W6_12s_256[16]__attribute__((aligned(32))) = {-32767,0,-32767,0,-32767,0,-32767,0,-32767,0,-32767,0,-32767,0,-32767,0}; + +simd256_q15_t *W1_12_256=(simd256_q15_t *)W1_12s_256; +simd256_q15_t *W2_12_256=(simd256_q15_t *)W2_12s_256; +simd256_q15_t *W3_12_256=(simd256_q15_t *)W3_12s_256; +simd256_q15_t *W4_12_256=(simd256_q15_t *)W4_12s_256; +simd256_q15_t *W6_12_256=(simd256_q15_t *)W6_12s_256; + + + +static inline void dft12f_simd256(simd256_q15_t *x0, + simd256_q15_t *x1, + simd256_q15_t *x2, + simd256_q15_t *x3, + simd256_q15_t *x4, + simd256_q15_t *x5, + simd256_q15_t *x6, + simd256_q15_t *x7, + simd256_q15_t *x8, + simd256_q15_t *x9, + simd256_q15_t *x10, + simd256_q15_t *x11, + simd256_q15_t *y0, + simd256_q15_t *y1, + simd256_q15_t *y2, + simd256_q15_t *y3, + simd256_q15_t *y4, + simd256_q15_t *y5, + simd256_q15_t *y6, + simd256_q15_t *y7, + simd256_q15_t *y8, + simd256_q15_t *y9, + simd256_q15_t *y10, + simd256_q15_t *y11) __attribute__((always_inline)); + +static inline void dft12f_simd256(simd256_q15_t *x0, + simd256_q15_t *x1, + simd256_q15_t *x2, + simd256_q15_t *x3, + simd256_q15_t *x4, + simd256_q15_t *x5, + simd256_q15_t *x6, + simd256_q15_t *x7, + simd256_q15_t *x8, + simd256_q15_t *x9, + simd256_q15_t *x10, + simd256_q15_t *x11, + simd256_q15_t *y0, + simd256_q15_t *y1, + simd256_q15_t *y2, + simd256_q15_t *y3, + simd256_q15_t *y4, + simd256_q15_t *y5, + simd256_q15_t *y6, + simd256_q15_t *y7, + simd256_q15_t *y8, + simd256_q15_t *y9, + simd256_q15_t *y10, + simd256_q15_t *y11) +{ + + + simd256_q15_t tmp_dft12[12]; + + simd256_q15_t *tmp_dft12_ptr = &tmp_dft12[0]; + + // msg("dft12\n"); + + bfly4_tw1_256(x0, + x3, + x6, + x9, + tmp_dft12_ptr, + tmp_dft12_ptr+3, + tmp_dft12_ptr+6, + tmp_dft12_ptr+9); + + + bfly4_tw1_256(x1, + x4, + x7, + x10, + tmp_dft12_ptr+1, + tmp_dft12_ptr+4, + tmp_dft12_ptr+7, + tmp_dft12_ptr+10); + + + bfly4_tw1_256(x2, + x5, + x8, + x11, + tmp_dft12_ptr+2, + tmp_dft12_ptr+5, + tmp_dft12_ptr+8, + tmp_dft12_ptr+11); + + // k2=0; + bfly3_tw1_256(tmp_dft12_ptr, + tmp_dft12_ptr+1, + tmp_dft12_ptr+2, + y0, + y4, + y8); + + + + // k2=1; + bfly3_256(tmp_dft12_ptr+3, + tmp_dft12_ptr+4, + tmp_dft12_ptr+5, + y1, + y5, + y9, + W1_12_256, + W2_12_256); + + + + // k2=2; + bfly3_256(tmp_dft12_ptr+6, + tmp_dft12_ptr+7, + tmp_dft12_ptr+8, + y2, + y6, + y10, + W2_12_256, + W4_12_256); + + // k2=3; + bfly3_256(tmp_dft12_ptr+9, + tmp_dft12_ptr+10, + tmp_dft12_ptr+11, + y3, + y7, + y11, + W3_12_256, + W6_12_256); + +} + + + + +void dft12_simd256(int16_t *x,int16_t *y) +{ + + simd256_q15_t *x256 = (simd256_q15_t *)x,*y256 = (simd256_q15_t *)y; + dft12f_simd256(&x256[0], + &x256[1], + &x256[2], + &x256[3], + &x256[4], + &x256[5], + &x256[6], + &x256[7], + &x256[8], + &x256[9], + &x256[10], + &x256[11], + &y256[0], + &y256[1], + &y256[2], + &y256[3], + &y256[4], + &y256[5], + &y256[6], + &y256[7], + &y256[8], + &y256[9], + &y256[10], + &y256[11]); + + _mm_empty(); + _m_empty(); + +} + +#endif + +static int16_t tw24[88]__attribute__((aligned(32))) = {31650,-8480,31650,-8480,31650,-8480,31650,-8480, 28377,-16383,28377,-16383,28377,-16383,28377,-16383, 23169,-23169,23169,-23169,23169,-23169,23169,-23169, 16383,-28377,16383,-28377,16383,-28377,16383,-28377, @@ -3817,7 +6255,7 @@ void dft24(int16_t *x,int16_t *y,unsigned char scale_flag) } -static int16_t twa36[88]__attribute__((aligned(16))) = {32269,-5689,32269,-5689,32269,-5689,32269,-5689, +static int16_t twa36[88]__attribute__((aligned(32))) = {32269,-5689,32269,-5689,32269,-5689,32269,-5689, 30790,-11206,30790,-11206,30790,-11206,30790,-11206, 28377,-16383,28377,-16383,28377,-16383,28377,-16383, 25100,-21062,25100,-21062,25100,-21062,25100,-21062, @@ -3830,7 +6268,7 @@ static int16_t twa36[88]__attribute__((aligned(16))) = {32269,-5689,32269,-5689, -11206,-30790,-11206,-30790,-11206,-30790,-11206,-30790 }; -static int16_t twb36[88]__attribute__((aligned(16))) = {30790,-11206,30790,-11206,30790,-11206,30790,-11206, +static int16_t twb36[88]__attribute__((aligned(32))) = {30790,-11206,30790,-11206,30790,-11206,30790,-11206, 25100,-21062,25100,-21062,25100,-21062,25100,-21062, 16383,-28377,16383,-28377,16383,-28377,16383,-28377, 5689,-32269,5689,-32269,5689,-32269,5689,-32269, @@ -3963,7 +6401,7 @@ void dft36(int16_t *x,int16_t *y,unsigned char scale_flag) } -static int16_t twa48[88]__attribute__((aligned(16))) = {32486,-4276,32486,-4276,32486,-4276,32486,-4276, +static int16_t twa48[88]__attribute__((aligned(32))) = {32486,-4276,32486,-4276,32486,-4276,32486,-4276, 31650,-8480,31650,-8480,31650,-8480,31650,-8480, 30272,-12539,30272,-12539,30272,-12539,30272,-12539, 28377,-16383,28377,-16383,28377,-16383,28377,-16383, @@ -3976,7 +6414,7 @@ static int16_t twa48[88]__attribute__((aligned(16))) = {32486,-4276,32486,-4276, 4276,-32486,4276,-32486,4276,-32486,4276,-32486 }; -static int16_t twb48[88]__attribute__((aligned(16))) = {31650,-8480,31650,-8480,31650,-8480,31650,-8480, +static int16_t twb48[88]__attribute__((aligned(32))) = {31650,-8480,31650,-8480,31650,-8480,31650,-8480, 28377,-16383,28377,-16383,28377,-16383,28377,-16383, 23169,-23169,23169,-23169,23169,-23169,23169,-23169, 16383,-28377,16383,-28377,16383,-28377,16383,-28377, @@ -3989,7 +6427,7 @@ static int16_t twb48[88]__attribute__((aligned(16))) = {31650,-8480,31650,-8480, -31650,-8480,-31650,-8480,-31650,-8480,-31650,-8480 }; -static int16_t twc48[88]__attribute__((aligned(16))) = {30272,-12539,30272,-12539,30272,-12539,30272,-12539, +static int16_t twc48[88]__attribute__((aligned(32))) = {30272,-12539,30272,-12539,30272,-12539,30272,-12539, 23169,-23169,23169,-23169,23169,-23169,23169,-23169, 12539,-30272,12539,-30272,12539,-30272,12539,-30272, 0,-32767,0,-32767,0,-32767,0,-32767, @@ -4159,7 +6597,7 @@ void dft48(int16_t *x, int16_t *y,unsigned char scale_flag) } -static int16_t twa60[88]__attribute__((aligned(16))) = {32587,-3425,32587,-3425,32587,-3425,32587,-3425, +static int16_t twa60[88]__attribute__((aligned(32))) = {32587,-3425,32587,-3425,32587,-3425,32587,-3425, 32050,-6812,32050,-6812,32050,-6812,32050,-6812, 31163,-10125,31163,-10125,31163,-10125,31163,-10125, 29934,-13327,29934,-13327,29934,-13327,29934,-13327, @@ -4171,7 +6609,7 @@ static int16_t twa60[88]__attribute__((aligned(16))) = {32587,-3425,32587,-3425, 16383,-28377,16383,-28377,16383,-28377,16383,-28377, 13327,-29934,13327,-29934,13327,-29934,13327,-29934 }; -static int16_t twb60[88]__attribute__((aligned(16))) = {32050,-6812,32050,-6812,32050,-6812,32050,-6812, +static int16_t twb60[88]__attribute__((aligned(32))) = {32050,-6812,32050,-6812,32050,-6812,32050,-6812, 29934,-13327,29934,-13327,29934,-13327,29934,-13327, 26509,-19259,26509,-19259,26509,-19259,26509,-19259, 21925,-24350,21925,-24350,21925,-24350,21925,-24350, @@ -4183,7 +6621,7 @@ static int16_t twb60[88]__attribute__((aligned(16))) = {32050,-6812,32050,-6812, -16383,-28377,-16383,-28377,-16383,-28377,-16383,-28377, -21925,-24350,-21925,-24350,-21925,-24350,-21925,-24350 }; -static int16_t twc60[88]__attribute__((aligned(16))) = {31163,-10125,31163,-10125,31163,-10125,31163,-10125, +static int16_t twc60[88]__attribute__((aligned(32))) = {31163,-10125,31163,-10125,31163,-10125,31163,-10125, 26509,-19259,26509,-19259,26509,-19259,26509,-19259, 19259,-26509,19259,-26509,19259,-26509,19259,-26509, 10125,-31163,10125,-31163,10125,-31163,10125,-31163, @@ -4195,7 +6633,7 @@ static int16_t twc60[88]__attribute__((aligned(16))) = {31163,-10125,31163,-1012 -32767,0,-32767,0,-32767,0,-32767,0, -31163,10125,-31163,10125,-31163,10125,-31163,10125 }; -static int16_t twd60[88]__attribute__((aligned(16))) = {29934,-13327,29934,-13327,29934,-13327,29934,-13327, +static int16_t twd60[88]__attribute__((aligned(32))) = {29934,-13327,29934,-13327,29934,-13327,29934,-13327, 21925,-24350,21925,-24350,21925,-24350,21925,-24350, 10125,-31163,10125,-31163,10125,-31163,10125,-31163, -3425,-32587,-3425,-32587,-3425,-32587,-3425,-32587, @@ -4387,7 +6825,7 @@ void dft60(int16_t *x,int16_t *y,unsigned char scale) } -static int16_t tw72[280]__attribute__((aligned(16))) = {32642,-2855,32642,-2855,32642,-2855,32642,-2855, +static int16_t tw72[280]__attribute__((aligned(32))) = {32642,-2855,32642,-2855,32642,-2855,32642,-2855, 32269,-5689,32269,-5689,32269,-5689,32269,-5689, 31650,-8480,31650,-8480,31650,-8480,31650,-8480, 30790,-11206,30790,-11206,30790,-11206,30790,-11206, @@ -4466,7 +6904,7 @@ void dft72(int16_t *x,int16_t *y,unsigned char scale_flag) } -static int16_t tw96[376]__attribute__((aligned(16))) = {32696,-2143,32696,-2143,32696,-2143,32696,-2143, +static int16_t tw96[376]__attribute__((aligned(32))) = {32696,-2143,32696,-2143,32696,-2143,32696,-2143, 32486,-4276,32486,-4276,32486,-4276,32486,-4276, 32137,-6392,32137,-6392,32137,-6392,32137,-6392, 31650,-8480,31650,-8480,31650,-8480,31650,-8480, @@ -4559,7 +6997,7 @@ void dft96(int16_t *x,int16_t *y,unsigned char scale_flag) } -static int16_t twa108[280]__attribute__((aligned(16))) = {32711,-1905,32711,-1905,32711,-1905,32711,-1905, +static int16_t twa108[280]__attribute__((aligned(32))) = {32711,-1905,32711,-1905,32711,-1905,32711,-1905, 32545,-3804,32545,-3804,32545,-3804,32545,-3804, 32269,-5689,32269,-5689,32269,-5689,32269,-5689, 31883,-7556,31883,-7556,31883,-7556,31883,-7556, @@ -4596,7 +7034,7 @@ static int16_t twa108[280]__attribute__((aligned(16))) = {32711,-1905,32711,-190 -14705,-29281,-14705,-29281,-14705,-29281,-14705,-29281 }; -static int16_t twb108[280]__attribute__((aligned(16))) = {32545,-3804,32545,-3804,32545,-3804,32545,-3804, +static int16_t twb108[280]__attribute__((aligned(32))) = {32545,-3804,32545,-3804,32545,-3804,32545,-3804, 31883,-7556,31883,-7556,31883,-7556,31883,-7556, 30790,-11206,30790,-11206,30790,-11206,30790,-11206, 29281,-14705,29281,-14705,29281,-14705,29281,-14705, @@ -4683,7 +7121,7 @@ void dft108(int16_t *x,int16_t *y,unsigned char scale_flag) } -static int16_t tw120[472]__attribute__((aligned(16))) = {32722,-1714,32722,-1714,32722,-1714,32722,-1714, +static int16_t tw120[472]__attribute__((aligned(32))) = {32722,-1714,32722,-1714,32722,-1714,32722,-1714, 32587,-3425,32587,-3425,32587,-3425,32587,-3425, 32363,-5125,32363,-5125,32363,-5125,32363,-5125, 32050,-6812,32050,-6812,32050,-6812,32050,-6812, @@ -4788,7 +7226,7 @@ void dft120(int16_t *x,int16_t *y, unsigned char scale_flag) } -static int16_t twa144[376]__attribute__((aligned(16))) = {32735,-1429,32735,-1429,32735,-1429,32735,-1429, +static int16_t twa144[376]__attribute__((aligned(32))) = {32735,-1429,32735,-1429,32735,-1429,32735,-1429, 32642,-2855,32642,-2855,32642,-2855,32642,-2855, 32486,-4276,32486,-4276,32486,-4276,32486,-4276, 32269,-5689,32269,-5689,32269,-5689,32269,-5689, @@ -4837,7 +7275,7 @@ static int16_t twa144[376]__attribute__((aligned(16))) = {32735,-1429,32735,-142 -15130,-29064,-15130,-29064,-15130,-29064,-15130,-29064 }; -static int16_t twb144[376]__attribute__((aligned(16))) = {32642,-2855,32642,-2855,32642,-2855,32642,-2855, +static int16_t twb144[376]__attribute__((aligned(32))) = {32642,-2855,32642,-2855,32642,-2855,32642,-2855, 32269,-5689,32269,-5689,32269,-5689,32269,-5689, 31650,-8480,31650,-8480,31650,-8480,31650,-8480, 30790,-11206,30790,-11206,30790,-11206,30790,-11206, @@ -4935,7 +7373,7 @@ void dft144(int16_t *x,int16_t *y,unsigned char scale_flag) } -static int16_t twa180[472]__attribute__((aligned(16))) = {32747,-1143,32747,-1143,32747,-1143,32747,-1143, +static int16_t twa180[472]__attribute__((aligned(32))) = {32747,-1143,32747,-1143,32747,-1143,32747,-1143, 32687,-2285,32687,-2285,32687,-2285,32687,-2285, 32587,-3425,32587,-3425,32587,-3425,32587,-3425, 32448,-4560,32448,-4560,32448,-4560,32448,-4560, @@ -4996,7 +7434,7 @@ static int16_t twa180[472]__attribute__((aligned(16))) = {32747,-1143,32747,-114 -15383,-28931,-15383,-28931,-15383,-28931,-15383,-28931 }; -static int16_t twb180[472]__attribute__((aligned(16))) = {32687,-2285,32687,-2285,32687,-2285,32687,-2285, +static int16_t twb180[472]__attribute__((aligned(32))) = {32687,-2285,32687,-2285,32687,-2285,32687,-2285, 32448,-4560,32448,-4560,32448,-4560,32448,-4560, 32050,-6812,32050,-6812,32050,-6812,32050,-6812, 31497,-9031,31497,-9031,31497,-9031,31497,-9031, @@ -5106,7 +7544,7 @@ void dft180(int16_t *x,int16_t *y,unsigned char scale_flag) } -static int16_t twa192[376]__attribute__((aligned(16))) = {32749,-1072,32749,-1072,32749,-1072,32749,-1072, +static int16_t twa192[376]__attribute__((aligned(32))) = {32749,-1072,32749,-1072,32749,-1072,32749,-1072, 32696,-2143,32696,-2143,32696,-2143,32696,-2143, 32609,-3211,32609,-3211,32609,-3211,32609,-3211, 32486,-4276,32486,-4276,32486,-4276,32486,-4276, @@ -5155,7 +7593,7 @@ static int16_t twa192[376]__attribute__((aligned(16))) = {32749,-1072,32749,-107 1072,-32749,1072,-32749,1072,-32749,1072,-32749 }; -static int16_t twb192[376]__attribute__((aligned(16))) = {32696,-2143,32696,-2143,32696,-2143,32696,-2143, +static int16_t twb192[376]__attribute__((aligned(32))) = {32696,-2143,32696,-2143,32696,-2143,32696,-2143, 32486,-4276,32486,-4276,32486,-4276,32486,-4276, 32137,-6392,32137,-6392,32137,-6392,32137,-6392, 31650,-8480,31650,-8480,31650,-8480,31650,-8480, @@ -5204,7 +7642,7 @@ static int16_t twb192[376]__attribute__((aligned(16))) = {32696,-2143,32696,-214 -32696,-2143,-32696,-2143,-32696,-2143,-32696,-2143 }; -static int16_t twc192[376]__attribute__((aligned(16))) = {32609,-3211,32609,-3211,32609,-3211,32609,-3211, +static int16_t twc192[376]__attribute__((aligned(32))) = {32609,-3211,32609,-3211,32609,-3211,32609,-3211, 32137,-6392,32137,-6392,32137,-6392,32137,-6392, 31356,-9511,31356,-9511,31356,-9511,31356,-9511, 30272,-12539,30272,-12539,30272,-12539,30272,-12539, @@ -5308,7 +7746,7 @@ void dft192(int16_t *x,int16_t *y,unsigned char scale_flag) } -static int16_t twa216[568]__attribute__((aligned(16))) = {32753,-953,32753,-953,32753,-953,32753,-953, +static int16_t twa216[568]__attribute__((aligned(32))) = {32753,-953,32753,-953,32753,-953,32753,-953, 32711,-1905,32711,-1905,32711,-1905,32711,-1905, 32642,-2855,32642,-2855,32642,-2855,32642,-2855, 32545,-3804,32545,-3804,32545,-3804,32545,-3804, @@ -5381,7 +7819,7 @@ static int16_t twa216[568]__attribute__((aligned(16))) = {32753,-953,32753,-953, -15551,-28841,-15551,-28841,-15551,-28841,-15551,-28841 }; -static int16_t twb216[568]__attribute__((aligned(16))) = {32711,-1905,32711,-1905,32711,-1905,32711,-1905, +static int16_t twb216[568]__attribute__((aligned(32))) = {32711,-1905,32711,-1905,32711,-1905,32711,-1905, 32545,-3804,32545,-3804,32545,-3804,32545,-3804, 32269,-5689,32269,-5689,32269,-5689,32269,-5689, 31883,-7556,31883,-7556,31883,-7556,31883,-7556, @@ -5503,7 +7941,7 @@ void dft216(int16_t *x,int16_t *y,unsigned char scale_flag) } -static int16_t twa240[472]__attribute__((aligned(16))) = {32755,-857,32755,-857,32755,-857,32755,-857, +static int16_t twa240[472]__attribute__((aligned(32))) = {32755,-857,32755,-857,32755,-857,32755,-857, 32722,-1714,32722,-1714,32722,-1714,32722,-1714, 32665,-2570,32665,-2570,32665,-2570,32665,-2570, 32587,-3425,32587,-3425,32587,-3425,32587,-3425, @@ -5564,7 +8002,7 @@ static int16_t twa240[472]__attribute__((aligned(16))) = {32755,-857,32755,-857, 857,-32755,857,-32755,857,-32755,857,-32755 }; -static int16_t twb240[472]__attribute__((aligned(16))) = {32722,-1714,32722,-1714,32722,-1714,32722,-1714, +static int16_t twb240[472]__attribute__((aligned(32))) = {32722,-1714,32722,-1714,32722,-1714,32722,-1714, 32587,-3425,32587,-3425,32587,-3425,32587,-3425, 32363,-5125,32363,-5125,32363,-5125,32363,-5125, 32050,-6812,32050,-6812,32050,-6812,32050,-6812, @@ -5625,7 +8063,7 @@ static int16_t twb240[472]__attribute__((aligned(16))) = {32722,-1714,32722,-171 -32722,-1714,-32722,-1714,-32722,-1714,-32722,-1714 }; -static int16_t twc240[472]__attribute__((aligned(16))) = {32665,-2570,32665,-2570,32665,-2570,32665,-2570, +static int16_t twc240[472]__attribute__((aligned(32))) = {32665,-2570,32665,-2570,32665,-2570,32665,-2570, 32363,-5125,32363,-5125,32363,-5125,32363,-5125, 31861,-7649,31861,-7649,31861,-7649,31861,-7649, 31163,-10125,31163,-10125,31163,-10125,31163,-10125, @@ -5753,7 +8191,7 @@ twb2(2:2:end) = imag(twb); */ -static int16_t twa288[760]__attribute__((aligned(16))) = {32759,-714,32759,-714,32759,-714,32759,-714, +static int16_t twa288[760]__attribute__((aligned(32))) = {32759,-714,32759,-714,32759,-714,32759,-714, 32735,-1429,32735,-1429,32735,-1429,32735,-1429, 32696,-2143,32696,-2143,32696,-2143,32696,-2143, 32642,-2855,32642,-2855,32642,-2855,32642,-2855, @@ -5850,7 +8288,7 @@ static int16_t twa288[760]__attribute__((aligned(16))) = {32759,-714,32759,-714, -15760,-28727,-15760,-28727,-15760,-28727,-15760,-28727 }; -static int16_t twb288[760]__attribute__((aligned(16))) = {32735,-1429,32735,-1429,32735,-1429,32735,-1429, +static int16_t twb288[760]__attribute__((aligned(32))) = {32735,-1429,32735,-1429,32735,-1429,32735,-1429, 32642,-2855,32642,-2855,32642,-2855,32642,-2855, 32486,-4276,32486,-4276,32486,-4276,32486,-4276, 32269,-5689,32269,-5689,32269,-5689,32269,-5689, @@ -5996,7 +8434,7 @@ void dft288(int16_t *x,int16_t *y,unsigned char scale_flag) } -static int16_t twa300[472]__attribute__((aligned(16))) = {32759,-686,32759,-686,32759,-686,32759,-686, +static int16_t twa300[472]__attribute__((aligned(32))) = {32759,-686,32759,-686,32759,-686,32759,-686, 32738,-1372,32738,-1372,32738,-1372,32738,-1372, 32702,-2057,32702,-2057,32702,-2057,32702,-2057, 32652,-2741,32652,-2741,32652,-2741,32652,-2741, @@ -6057,7 +8495,7 @@ static int16_t twa300[472]__attribute__((aligned(16))) = {32759,-686,32759,-686, 10775,-30944,10775,-30944,10775,-30944,10775,-30944 }; -static int16_t twb300[472]__attribute__((aligned(16))) = {32738,-1372,32738,-1372,32738,-1372,32738,-1372, +static int16_t twb300[472]__attribute__((aligned(32))) = {32738,-1372,32738,-1372,32738,-1372,32738,-1372, 32652,-2741,32652,-2741,32652,-2741,32652,-2741, 32508,-4106,32508,-4106,32508,-4106,32508,-4106, 32308,-5464,32308,-5464,32308,-5464,32308,-5464, @@ -6118,7 +8556,7 @@ static int16_t twb300[472]__attribute__((aligned(16))) = {32738,-1372,32738,-137 -25679,-20353,-25679,-20353,-25679,-20353,-25679,-20353 }; -static int16_t twc300[472]__attribute__((aligned(16))) = {32702,-2057,32702,-2057,32702,-2057,32702,-2057, +static int16_t twc300[472]__attribute__((aligned(32))) = {32702,-2057,32702,-2057,32702,-2057,32702,-2057, 32508,-4106,32508,-4106,32508,-4106,32508,-4106, 32186,-6139,32186,-6139,32186,-6139,32186,-6139, 31737,-8148,31737,-8148,31737,-8148,31737,-8148, @@ -6179,7 +8617,7 @@ static int16_t twc300[472]__attribute__((aligned(16))) = {32702,-2057,32702,-205 -27666,17557,-27666,17557,-27666,17557,-27666,17557 }; -static int16_t twd300[472]__attribute__((aligned(16))) = {32652,-2741,32652,-2741,32652,-2741,32652,-2741, +static int16_t twd300[472]__attribute__((aligned(32))) = {32652,-2741,32652,-2741,32652,-2741,32652,-2741, 32308,-5464,32308,-5464,32308,-5464,32308,-5464, 31737,-8148,31737,-8148,31737,-8148,31737,-8148, 30944,-10775,30944,-10775,30944,-10775,30944,-10775, @@ -16088,7 +18526,6 @@ void dft1200(int16_t *x,int16_t *y,unsigned char scale_flag) if (scale_flag==1) { norm128 = set1_int16(16384);//dft_norm_table[13]); - for (i=0; i<1200; i++) { y128[i] = mulhi_int16(y128[i],norm128); } @@ -16110,9 +18547,11 @@ int main(int argc, char**argv) time_stats_t ts; - simd_q15_t x[2048],y[2048],tw0,tw1,tw2,tw3; - - +#ifdef __AVX2__ + simd256_q15_t x[2048],y[2048],tw0,tw1,tw2,tw3; +#else + simd_q15_t x[4096],y[4096],tw0,tw1,tw2,tw3; +#endif int i; set_taus_seed(0); @@ -16439,10 +18878,10 @@ int main(int argc, char**argv) for (i=0;i<4;i++) printf("%d,%d,%d,%d,%d,%d,%d,%d,",((int16_t*)&y[i])[0],((int16_t *)&y[i])[1],((int16_t*)&y[i])[2],((int16_t *)&y[i])[3],((int16_t*)&y[i])[4],((int16_t *)&y[i])[5],((int16_t*)&y[i])[6],((int16_t *)&y[i])[7]); printf("\n"); - */ - memset((void*)&x[0],0,64*4); -/* - for (i=0; i<64; i+=4) { + */ + memset((void*)&x[0],0,2048*4); + + for (i=0; i<2048; i+=4) { ((int16_t*)x)[i<<1] = 1024; ((int16_t*)x)[1+(i<<1)] = 0; ((int16_t*)x)[2+(i<<1)] = 0; @@ -16451,40 +18890,65 @@ int main(int argc, char**argv) ((int16_t*)x)[5+(i<<1)] = 0; ((int16_t*)x)[6+(i<<1)] = 0; ((int16_t*)x)[7+(i<<1)] = -1024; + } + /* + for (i=0; i<2048; i+=2) { + ((int16_t*)x)[i<<1] = 1024; + ((int16_t*)x)[1+(i<<1)] = 0; + ((int16_t*)x)[2+(i<<1)] = -1024; + ((int16_t*)x)[3+(i<<1)] = 0; + } + + for (i=0;i<2048*2;i++) { + ((int16_t*)x)[i] = i/2;//(int16_t)((taus()&0xffff))>>5; } -*/ - for (i=0;i<64;i++) { - ((int16_t*)x)[i] = (int16_t)((taus()&0xffff))>>5; + */ + memset((void*)&x[0],0,64*sizeof(int32_t)); + for (i=2;i<36;i++) { + if ((taus() & 1)==0) + ((int16_t*)x)[i] = 364; + else + ((int16_t*)x)[i] = -364; } - memset((void*)&y[0],0,64*4); -/* - dft16((int16_t *)x,(int16_t *)y); - printf("16-point\n"); + for (i=(128-36);i<128;i++) { + if ((taus() & 1)==0) + ((int16_t*)x)[i] = 364; + else + ((int16_t*)x)[i] = -364; + } + idft64((int16_t *)x,(int16_t *)y,1); + + + printf("64-point\n"); printf("X: "); - for (i=0;i<4;i++) - printf("%d,%d,%d,%d,%d,%d,%d,%d,",((int16_t*)&x[i])[0],((int16_t *)&x[i])[1],((int16_t*)&x[i])[2],((int16_t *)&x[i])[3],((int16_t*)&x[i])[4],((int16_t*)&x[i])[5],((int16_t*)&x[i])[6],((int16_t*)&x[i])[7]); + for (i=0;i<8;i++) + print_shorts256("",((int16_t *)x)+(i*16)); + printf("\nY:"); - for (i=0;i<4;i++) - printf("%d,%d,%d,%d,%d,%d,%d,%d,",((int16_t*)&y[i])[0],((int16_t *)&y[i])[1],((int16_t*)&y[i])[2],((int16_t *)&y[i])[3],((int16_t*)&y[i])[4],((int16_t *)&y[i])[5],((int16_t*)&y[i])[6],((int16_t *)&y[i])[7]); + for (i=0;i<8;i++) + print_shorts256("",((int16_t *)y)+(i*16)); printf("\n"); - exit(-1); -*/ - dft64((int16_t *)x,(int16_t *)y,1); - dft64((int16_t *)x,(int16_t *)y,1); - dft64((int16_t *)x,(int16_t *)y,1); + + + + + idft64((int16_t *)x,(int16_t *)y,1); + idft64((int16_t *)x,(int16_t *)y,1); + idft64((int16_t *)x,(int16_t *)y,1); reset_meas(&ts); for (i=0; i<10000000; i++) { start_meas(&ts); - dft64((int16_t *)x,(int16_t *)y,1); + idft64((int16_t *)x,(int16_t *)y,1); stop_meas(&ts); } printf("\n\n64-point (%f cycles, #trials %d)\n",(double)ts.diff/(double)ts.trials,ts.trials); - write_output("x64.m","x64",x,64,1,1); + // write_output("x64.m","x64",x,64,1,1); write_output("y64.m","y64",y,64,1,1); + write_output("x64.m","x64",x,64,1,1); /* printf("X: "); @@ -16506,18 +18970,32 @@ int main(int argc, char**argv) } */ - memset((void*)&y[0],0,128*4); + memset((void*)&x[0],0,128*4); + for (i=2;i<72;i++) { + if ((taus() & 1)==0) + ((int16_t*)x)[i] = 364; + else + ((int16_t*)x)[i] = -364; + } + for (i=(256-72);i<256;i++) { + if ((taus() & 1)==0) + ((int16_t*)x)[i] = 364; + else + ((int16_t*)x)[i] = -364; + } reset_meas(&ts); for (i=0; i<10000; i++) { start_meas(&ts); - dft128((int16_t *)x,(int16_t *)y,0); + idft128((int16_t *)x,(int16_t *)y,1); stop_meas(&ts); } printf("\n\n128-point(%f cycles)\n",(double)ts.diff/(double)ts.trials); - - /* printf("X: "); + write_output("y128.m","y128",y,128,1,1); + write_output("x128.m","x128",x,128,1,1); +/* + printf("X: "); for (i=0;i<32;i++) printf("%d,%d,%d,%d,%d,%d,%d,%d,",((int16_t*)&x[i])[0],((int16_t *)&x[i])[1],((int16_t*)&x[i])[2],((int16_t *)&x[i])[3],((int16_t*)&x[i])[4],((int16_t*)&x[i])[5],((int16_t*)&x[i])[6],((int16_t*)&x[i])[7]); printf("\nY:"); @@ -16525,35 +19003,64 @@ int main(int argc, char**argv) for (i=0;i<32;i++) printf("%d,%d,%d,%d,%d,%d,%d,%d,",((int16_t*)&y[i])[0],((int16_t *)&y[i])[1],((int16_t*)&y[i])[2],((int16_t *)&y[i])[3],((int16_t*)&y[i])[4],((int16_t *)&y[i])[5],((int16_t*)&y[i])[6],((int16_t *)&y[i])[7]); printf("\n"); - */ +*/ + + /* for (i=0; i<512; i++) { ((int16_t*)x)[i] = (int16_t)((taus()&0xffff))>>5; } - + memset((void*)&y[0],0,256*4); + */ + memset((void*)&x[0],0,256*sizeof(int32_t)); + for (i=2;i<144;i++) { + if ((taus() & 1)==0) + ((int16_t*)x)[i] = 364; + else + ((int16_t*)x)[i] = -364; + } + for (i=(512-144);i<512;i++) { + if ((taus() & 1)==0) + ((int16_t*)x)[i] = 364; + else + ((int16_t*)x)[i] = -364; + } reset_meas(&ts); for (i=0; i<10000; i++) { start_meas(&ts); - dft256((int16_t *)x,(int16_t *)y,1); + idft256((int16_t *)x,(int16_t *)y,1); stop_meas(&ts); } printf("\n\n256-point(%f cycles)\n",(double)ts.diff/(double)ts.trials); + write_output("y256.m","y256",y,256,1,1); + write_output("x256.m","x256",x,256,1,1); + + memset((void*)&x[0],0,512*sizeof(int32_t)); + for (i=2;i<302;i++) { + if ((taus() & 1)==0) + ((int16_t*)x)[i] = 364; + else + ((int16_t*)x)[i] = -364; + } + for (i=(1024-300);i<1024;i++) { + if ((taus() & 1)==0) + ((int16_t*)x)[i] = 364; + else + ((int16_t*)x)[i] = -364; + } reset_meas(&ts); - for (i=0; i<10000; i++) { start_meas(&ts); - dft512((int16_t *)x,(int16_t *)y,1); + idft512((int16_t *)x,(int16_t *)y,1); stop_meas(&ts); } printf("\n\n512-point(%f cycles)\n",(double)ts.diff/(double)ts.trials); - - write_output("x.m","x",x,512,1,1); - write_output("y.m","y",y,512,1,1); - + write_output("y512.m","y512",y,512,1,1); + write_output("x512.m","x512",x,512,1,1); /* printf("X: "); for (i=0;i<64;i++) @@ -16565,25 +19072,56 @@ int main(int argc, char**argv) printf("\n"); */ + memset((void*)x,0,1024*sizeof(int32_t)); + for (i=2;i<602;i++) { + if ((taus() & 1)==0) + ((int16_t*)x)[i] = 364; + else + ((int16_t*)x)[i] = -364; + } + for (i=2*724;i<2048;i++) { + if ((taus() & 1)==0) + ((int16_t*)x)[i] = 364; + else + ((int16_t*)x)[i] = -364; + } reset_meas(&ts); for (i=0; i<10000; i++) { start_meas(&ts); - dft1024((int16_t *)x,(int16_t *)y,1); + idft1024((int16_t *)x,(int16_t *)y,1); stop_meas(&ts); } printf("\n\n1024-point(%f cycles)\n",(double)ts.diff/(double)ts.trials); - + write_output("y1024.m","y1024",y,1024,1,1); + write_output("x1024.m","x1024",x,1024,1,1); + + memset((void*)x,0,2048*sizeof(int32_t)); + for (i=2;i<1202;i++) { + if ((taus() & 1)==0) + ((int16_t*)x)[i] = 364; + else + ((int16_t*)x)[i] = -364; + } + for (i=2*(2048-600);i<4096;i++) { + if ((taus() & 1)==0) + ((int16_t*)x)[i] = 364; + else + ((int16_t*)x)[i] = -364; + } reset_meas(&ts); for (i=0; i<10000; i++) { start_meas(&ts); - dft2048((int16_t *)x,(int16_t *)y,1); + idft2048((int16_t *)x,(int16_t *)y,1); stop_meas(&ts); } printf("\n\n2048-point(%f cycles)\n",(double)ts.diff/(double)ts.trials); + write_output("y2048.m","y2048",y,2048,1,1); + write_output("x2048.m","x2048",x,2048,1,1); + return(0); } diff --git a/openair1/PHY/TOOLS/lte_phy_scope.c b/openair1/PHY/TOOLS/lte_phy_scope.c index a1478c45ab802755d705223d8c7452463d10186a..4b623fb9dc09cd58436e6884b951357b6b3e5450 100644 --- a/openair1/PHY/TOOLS/lte_phy_scope.c +++ b/openair1/PHY/TOOLS/lte_phy_scope.c @@ -355,7 +355,7 @@ void phy_scope_eNB(FD_lte_phy_scope_enb *form, 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); + fl_set_xyplot_ybounds(form->pucch_comp1,0,80); } diff --git a/openair1/PHY/TOOLS/twiddles8192.h b/openair1/PHY/TOOLS/twiddles8192.h new file mode 100644 index 0000000000000000000000000000000000000000..ddb8ab227310e98896282c9d7e624d87954ad89c --- /dev/null +++ b/openair1/PHY/TOOLS/twiddles8192.h @@ -0,0 +1,12 @@ +/* Twiddles generated with +twa = floor(32767*exp(-sqrt(-1)*2*pi*(0:4095)/8192)); +twa2 = zeros(1,2*4096); +twa2(1:2:end) = real(twa); +twa2(2:2:end) = imag(twa); +fd=fopen("twiddle_tmp.txt","w"); +fprintf(fd,"static int16_t tw8192[4096*2] = {"); +fprintf(fd,"%d,",twa2(1:(4096*2)-1)); +fprintf(fd,"%d};\n",twa2(end)); +fclose(fd); +*/ +static int16_t tw8192[4096*2] = {32767,0,32766,-26,32766,-51,32766,-76,32766,-101,32766,-126,32766,-151,32766,-176,32766,-202,32766,-227,32766,-252,32765,-277,32765,-302,32765,-327,32765,-352,32764,-377,32764,-403,32764,-428,32763,-453,32763,-478,32763,-503,32762,-528,32762,-553,32761,-579,32761,-604,32760,-629,32760,-654,32759,-679,32759,-704,32758,-729,32758,-754,32757,-780,32757,-805,32756,-830,32755,-855,32755,-880,32754,-905,32753,-930,32753,-955,32752,-981,32751,-1006,32750,-1031,32750,-1056,32749,-1081,32748,-1106,32747,-1131,32746,-1156,32745,-1181,32744,-1207,32743,-1232,32742,-1257,32741,-1282,32740,-1307,32739,-1332,32738,-1357,32737,-1382,32736,-1407,32735,-1433,32734,-1458,32733,-1483,32732,-1508,32731,-1533,32729,-1558,32728,-1583,32727,-1608,32726,-1633,32725,-1659,32723,-1684,32722,-1709,32721,-1734,32719,-1759,32718,-1784,32717,-1809,32715,-1834,32714,-1859,32712,-1884,32711,-1909,32709,-1935,32708,-1960,32706,-1985,32705,-2010,32703,-2035,32702,-2060,32700,-2085,32699,-2110,32697,-2135,32695,-2160,32694,-2185,32692,-2210,32690,-2236,32688,-2261,32687,-2286,32685,-2311,32683,-2336,32681,-2361,32680,-2386,32678,-2411,32676,-2436,32674,-2461,32672,-2486,32670,-2511,32668,-2536,32666,-2561,32664,-2586,32662,-2611,32660,-2637,32658,-2662,32656,-2687,32654,-2712,32652,-2737,32650,-2762,32648,-2787,32646,-2812,32644,-2837,32641,-2862,32639,-2887,32637,-2912,32635,-2937,32632,-2962,32630,-2987,32628,-3012,32625,-3037,32623,-3062,32621,-3087,32618,-3112,32616,-3137,32614,-3162,32611,-3187,32609,-3212,32606,-3237,32604,-3262,32601,-3287,32599,-3312,32596,-3337,32594,-3362,32591,-3387,32588,-3412,32586,-3437,32583,-3462,32580,-3487,32578,-3512,32575,-3537,32572,-3562,32570,-3587,32567,-3612,32564,-3637,32561,-3662,32558,-3687,32556,-3712,32553,-3737,32550,-3762,32547,-3787,32544,-3812,32541,-3837,32538,-3862,32535,-3887,32532,-3912,32529,-3937,32526,-3962,32523,-3987,32520,-4012,32517,-4036,32514,-4061,32511,-4086,32508,-4111,32504,-4136,32501,-4161,32498,-4186,32495,-4211,32492,-4236,32488,-4261,32485,-4286,32482,-4311,32478,-4336,32475,-4360,32472,-4385,32468,-4410,32465,-4435,32462,-4460,32458,-4485,32455,-4510,32451,-4535,32448,-4560,32444,-4585,32441,-4609,32437,-4634,32434,-4659,32430,-4684,32426,-4709,32423,-4734,32419,-4759,32416,-4784,32412,-4808,32408,-4833,32404,-4858,32401,-4883,32397,-4908,32393,-4933,32389,-4958,32386,-4982,32382,-5007,32378,-5032,32374,-5057,32370,-5082,32366,-5107,32362,-5131,32358,-5156,32354,-5181,32350,-5206,32346,-5231,32342,-5255,32338,-5280,32334,-5305,32330,-5330,32326,-5355,32322,-5379,32318,-5404,32314,-5429,32310,-5454,32305,-5479,32301,-5503,32297,-5528,32293,-5553,32288,-5578,32284,-5602,32280,-5627,32275,-5652,32271,-5677,32267,-5701,32262,-5726,32258,-5751,32254,-5776,32249,-5800,32245,-5825,32240,-5850,32236,-5875,32231,-5899,32227,-5924,32222,-5949,32218,-5973,32213,-5998,32208,-6023,32204,-6048,32199,-6072,32194,-6097,32190,-6122,32185,-6146,32180,-6171,32176,-6196,32171,-6220,32166,-6245,32161,-6270,32156,-6294,32152,-6319,32147,-6344,32142,-6368,32137,-6393,32132,-6418,32127,-6442,32122,-6467,32117,-6492,32112,-6516,32107,-6541,32102,-6565,32097,-6590,32092,-6615,32087,-6639,32082,-6664,32077,-6689,32072,-6713,32066,-6738,32061,-6762,32056,-6787,32051,-6812,32046,-6836,32040,-6861,32035,-6885,32030,-6910,32024,-6934,32019,-6959,32014,-6983,32008,-7008,32003,-7033,31998,-7057,31992,-7082,31987,-7106,31981,-7131,31976,-7155,31970,-7180,31965,-7204,31959,-7229,31954,-7253,31948,-7278,31943,-7302,31937,-7327,31931,-7351,31926,-7376,31920,-7400,31914,-7425,31909,-7449,31903,-7474,31897,-7498,31891,-7523,31886,-7547,31880,-7572,31874,-7596,31868,-7620,31862,-7645,31856,-7669,31851,-7694,31845,-7718,31839,-7743,31833,-7767,31827,-7791,31821,-7816,31815,-7840,31809,-7865,31803,-7889,31797,-7913,31791,-7938,31785,-7962,31778,-7987,31772,-8011,31766,-8035,31760,-8060,31754,-8084,31748,-8108,31741,-8133,31735,-8157,31729,-8181,31723,-8206,31716,-8230,31710,-8254,31704,-8279,31697,-8303,31691,-8327,31684,-8352,31678,-8376,31672,-8400,31665,-8425,31659,-8449,31652,-8473,31646,-8497,31639,-8522,31633,-8546,31626,-8570,31619,-8594,31613,-8619,31606,-8643,31600,-8667,31593,-8691,31586,-8716,31580,-8740,31573,-8764,31566,-8788,31559,-8813,31553,-8837,31546,-8861,31539,-8885,31532,-8909,31525,-8933,31518,-8958,31512,-8982,31505,-9006,31498,-9030,31491,-9054,31484,-9078,31477,-9103,31470,-9127,31463,-9151,31456,-9175,31449,-9199,31442,-9223,31435,-9247,31428,-9271,31420,-9296,31413,-9320,31406,-9344,31399,-9368,31392,-9392,31385,-9416,31377,-9440,31370,-9464,31363,-9488,31356,-9512,31348,-9536,31341,-9560,31334,-9584,31326,-9608,31319,-9632,31311,-9656,31304,-9680,31297,-9704,31289,-9728,31282,-9752,31274,-9776,31267,-9800,31259,-9824,31252,-9848,31244,-9872,31236,-9896,31229,-9920,31221,-9944,31214,-9968,31206,-9992,31198,-10016,31191,-10040,31183,-10064,31175,-10088,31167,-10112,31160,-10136,31152,-10160,31144,-10183,31136,-10207,31128,-10231,31121,-10255,31113,-10279,31105,-10303,31097,-10327,31089,-10350,31081,-10374,31073,-10398,31065,-10422,31057,-10446,31049,-10470,31041,-10493,31033,-10517,31025,-10541,31017,-10565,31009,-10589,31001,-10612,30992,-10636,30984,-10660,30976,-10684,30968,-10707,30960,-10731,30951,-10755,30943,-10779,30935,-10802,30927,-10826,30918,-10850,30910,-10874,30902,-10897,30893,-10921,30885,-10945,30876,-10968,30868,-10992,30860,-11016,30851,-11039,30843,-11063,30834,-11087,30826,-11110,30817,-11134,30809,-11158,30800,-11181,30791,-11205,30783,-11228,30774,-11252,30766,-11276,30757,-11299,30748,-11323,30739,-11346,30731,-11370,30722,-11394,30713,-11417,30705,-11441,30696,-11464,30687,-11488,30678,-11511,30669,-11535,30660,-11558,30652,-11582,30643,-11605,30634,-11629,30625,-11652,30616,-11676,30607,-11699,30598,-11723,30589,-11746,30580,-11770,30571,-11793,30562,-11817,30553,-11840,30544,-11863,30535,-11887,30525,-11910,30516,-11934,30507,-11957,30498,-11981,30489,-12004,30480,-12027,30470,-12051,30461,-12074,30452,-12097,30442,-12121,30433,-12144,30424,-12167,30415,-12191,30405,-12214,30396,-12237,30386,-12261,30377,-12284,30368,-12307,30358,-12331,30349,-12354,30339,-12377,30330,-12400,30320,-12424,30311,-12447,30301,-12470,30291,-12493,30282,-12517,30272,-12540,30263,-12563,30253,-12586,30243,-12610,30234,-12633,30224,-12656,30214,-12679,30205,-12702,30195,-12725,30185,-12749,30175,-12772,30165,-12795,30156,-12818,30146,-12841,30136,-12864,30126,-12887,30116,-12910,30106,-12934,30096,-12957,30086,-12980,30076,-13003,30066,-13026,30056,-13049,30046,-13072,30036,-13095,30026,-13118,30016,-13141,30006,-13164,29996,-13187,29986,-13210,29976,-13233,29966,-13256,29955,-13279,29945,-13302,29935,-13325,29925,-13348,29915,-13371,29904,-13394,29894,-13417,29884,-13440,29873,-13463,29863,-13486,29853,-13508,29842,-13531,29832,-13554,29822,-13577,29811,-13600,29801,-13623,29790,-13646,29780,-13668,29769,-13691,29759,-13714,29748,-13737,29738,-13760,29727,-13783,29717,-13805,29706,-13828,29695,-13851,29685,-13874,29674,-13896,29663,-13919,29653,-13942,29642,-13965,29631,-13987,29621,-14010,29610,-14033,29599,-14056,29588,-14078,29577,-14101,29567,-14124,29556,-14146,29545,-14169,29534,-14192,29523,-14214,29512,-14237,29501,-14260,29490,-14282,29479,-14305,29468,-14327,29457,-14350,29446,-14373,29435,-14395,29424,-14418,29413,-14440,29402,-14463,29391,-14485,29380,-14508,29369,-14531,29358,-14553,29346,-14576,29335,-14598,29324,-14621,29313,-14643,29302,-14666,29290,-14688,29279,-14710,29268,-14733,29256,-14755,29245,-14778,29234,-14800,29222,-14823,29211,-14845,29200,-14867,29188,-14890,29177,-14912,29165,-14935,29154,-14957,29142,-14979,29131,-15002,29119,-15024,29108,-15046,29096,-15069,29085,-15091,29073,-15113,29062,-15136,29050,-15158,29038,-15180,29027,-15202,29015,-15225,29003,-15247,28992,-15269,28980,-15291,28968,-15314,28956,-15336,28945,-15358,28933,-15380,28921,-15402,28909,-15425,28897,-15447,28886,-15469,28874,-15491,28862,-15513,28850,-15535,28838,-15557,28826,-15580,28814,-15602,28802,-15624,28790,-15646,28778,-15668,28766,-15690,28754,-15712,28742,-15734,28730,-15756,28718,-15778,28706,-15800,28694,-15822,28681,-15844,28669,-15866,28657,-15888,28645,-15910,28633,-15932,28620,-15954,28608,-15976,28596,-15998,28584,-16020,28571,-16042,28559,-16064,28547,-16086,28534,-16108,28522,-16129,28510,-16151,28497,-16173,28485,-16195,28472,-16217,28460,-16239,28447,-16261,28435,-16282,28423,-16304,28410,-16326,28397,-16348,28385,-16369,28372,-16391,28360,-16413,28347,-16435,28335,-16456,28322,-16478,28309,-16500,28297,-16522,28284,-16543,28271,-16565,28259,-16587,28246,-16608,28233,-16630,28220,-16652,28208,-16673,28195,-16695,28182,-16717,28169,-16738,28156,-16760,28143,-16781,28131,-16803,28118,-16825,28105,-16846,28092,-16868,28079,-16889,28066,-16911,28053,-16932,28040,-16954,28027,-16975,28014,-16997,28001,-17018,27988,-17040,27975,-17061,27962,-17083,27948,-17104,27935,-17125,27922,-17147,27909,-17168,27896,-17190,27883,-17211,27869,-17233,27856,-17254,27843,-17275,27830,-17297,27816,-17318,27803,-17339,27790,-17361,27777,-17382,27763,-17403,27750,-17424,27736,-17446,27723,-17467,27710,-17488,27696,-17510,27683,-17531,27669,-17552,27656,-17573,27642,-17594,27629,-17616,27615,-17637,27602,-17658,27588,-17679,27575,-17700,27561,-17721,27548,-17743,27534,-17764,27520,-17785,27507,-17806,27493,-17827,27479,-17848,27466,-17869,27452,-17890,27438,-17911,27424,-17932,27411,-17953,27397,-17974,27383,-17995,27369,-18016,27355,-18037,27342,-18058,27328,-18079,27314,-18100,27300,-18121,27286,-18142,27272,-18163,27258,-18184,27244,-18205,27230,-18226,27216,-18247,27202,-18268,27188,-18288,27174,-18309,27160,-18330,27146,-18351,27132,-18372,27118,-18393,27104,-18413,27090,-18434,27076,-18455,27061,-18476,27047,-18496,27033,-18517,27019,-18538,27005,-18559,26990,-18579,26976,-18600,26962,-18621,26948,-18641,26933,-18662,26919,-18683,26905,-18703,26890,-18724,26876,-18745,26861,-18765,26847,-18786,26833,-18806,26818,-18827,26804,-18847,26789,-18868,26775,-18889,26760,-18909,26746,-18930,26731,-18950,26717,-18971,26702,-18991,26688,-19012,26673,-19032,26658,-19052,26644,-19073,26629,-19093,26615,-19114,26600,-19134,26585,-19155,26570,-19175,26556,-19195,26541,-19216,26526,-19236,26512,-19256,26497,-19277,26482,-19297,26467,-19317,26452,-19338,26437,-19358,26423,-19378,26408,-19398,26393,-19419,26378,-19439,26363,-19459,26348,-19479,26333,-19500,26318,-19520,26303,-19540,26288,-19560,26273,-19580,26258,-19600,26243,-19621,26228,-19641,26213,-19661,26198,-19681,26183,-19701,26168,-19721,26153,-19741,26137,-19761,26122,-19781,26107,-19801,26092,-19821,26077,-19841,26061,-19861,26046,-19881,26031,-19901,26016,-19921,26000,-19941,25985,-19961,25970,-19981,25954,-20001,25939,-20021,25924,-20041,25908,-20061,25893,-20080,25878,-20100,25862,-20120,25847,-20140,25831,-20160,25816,-20180,25800,-20199,25785,-20219,25769,-20239,25754,-20259,25738,-20278,25723,-20298,25707,-20318,25691,-20338,25676,-20357,25660,-20377,25645,-20397,25629,-20416,25613,-20436,25598,-20456,25582,-20475,25566,-20495,25550,-20514,25535,-20534,25519,-20554,25503,-20573,25487,-20593,25472,-20612,25456,-20632,25440,-20651,25424,-20671,25408,-20690,25392,-20710,25376,-20729,25361,-20749,25345,-20768,25329,-20788,25313,-20807,25297,-20826,25281,-20846,25265,-20865,25249,-20885,25233,-20904,25217,-20923,25201,-20943,25185,-20962,25169,-20981,25152,-21001,25136,-21020,25120,-21039,25104,-21058,25088,-21078,25072,-21097,25056,-21116,25039,-21135,25023,-21155,25007,-21174,24991,-21193,24974,-21212,24958,-21231,24942,-21250,24926,-21269,24909,-21289,24893,-21308,24877,-21327,24860,-21346,24844,-21365,24827,-21384,24811,-21403,24795,-21422,24778,-21441,24762,-21460,24745,-21479,24729,-21498,24712,-21517,24696,-21536,24679,-21555,24663,-21574,24646,-21593,24630,-21612,24613,-21630,24596,-21649,24580,-21668,24563,-21687,24546,-21706,24530,-21725,24513,-21744,24496,-21762,24480,-21781,24463,-21800,24446,-21819,24430,-21837,24413,-21856,24396,-21875,24379,-21894,24362,-21912,24346,-21931,24329,-21950,24312,-21968,24295,-21987,24278,-22005,24261,-22024,24244,-22043,24228,-22061,24211,-22080,24194,-22098,24177,-22117,24160,-22136,24143,-22154,24126,-22173,24109,-22191,24092,-22210,24075,-22228,24058,-22246,24041,-22265,24023,-22283,24006,-22302,23989,-22320,23972,-22339,23955,-22357,23938,-22375,23921,-22394,23903,-22412,23886,-22430,23869,-22449,23852,-22467,23835,-22485,23817,-22504,23800,-22522,23783,-22540,23766,-22558,23748,-22576,23731,-22595,23714,-22613,23696,-22631,23679,-22649,23661,-22667,23644,-22686,23627,-22704,23609,-22722,23592,-22740,23574,-22758,23557,-22776,23539,-22794,23522,-22812,23504,-22830,23487,-22848,23469,-22866,23452,-22884,23434,-22902,23417,-22920,23399,-22938,23382,-22956,23364,-22974,23346,-22992,23329,-23010,23311,-23028,23293,-23046,23276,-23063,23258,-23081,23240,-23099,23223,-23117,23205,-23135,23187,-23152,23169,-23170,23151,-23188,23134,-23206,23116,-23224,23098,-23241,23080,-23259,23062,-23277,23045,-23294,23027,-23312,23009,-23330,22991,-23347,22973,-23365,22955,-23383,22937,-23400,22919,-23418,22901,-23435,22883,-23453,22865,-23470,22847,-23488,22829,-23505,22811,-23523,22793,-23540,22775,-23558,22757,-23575,22739,-23593,22721,-23610,22703,-23628,22685,-23645,22666,-23662,22648,-23680,22630,-23697,22612,-23715,22594,-23732,22575,-23749,22557,-23767,22539,-23784,22521,-23801,22503,-23818,22484,-23836,22466,-23853,22448,-23870,22429,-23887,22411,-23904,22393,-23922,22374,-23939,22356,-23956,22338,-23973,22319,-23990,22301,-24007,22282,-24024,22264,-24042,22245,-24059,22227,-24076,22209,-24093,22190,-24110,22172,-24127,22153,-24144,22135,-24161,22116,-24178,22097,-24195,22079,-24212,22060,-24229,22042,-24245,22023,-24262,22004,-24279,21986,-24296,21967,-24313,21949,-24330,21930,-24347,21911,-24363,21893,-24380,21874,-24397,21855,-24414,21836,-24431,21818,-24447,21799,-24464,21780,-24481,21761,-24497,21743,-24514,21724,-24531,21705,-24547,21686,-24564,21667,-24581,21648,-24597,21629,-24614,21611,-24631,21592,-24647,21573,-24664,21554,-24680,21535,-24697,21516,-24713,21497,-24730,21478,-24746,21459,-24763,21440,-24779,21421,-24796,21402,-24812,21383,-24828,21364,-24845,21345,-24861,21326,-24878,21307,-24894,21288,-24910,21268,-24927,21249,-24943,21230,-24959,21211,-24975,21192,-24992,21173,-25008,21154,-25024,21134,-25040,21115,-25057,21096,-25073,21077,-25089,21057,-25105,21038,-25121,21019,-25137,21000,-25153,20980,-25170,20961,-25186,20942,-25202,20922,-25218,20903,-25234,20884,-25250,20864,-25266,20845,-25282,20825,-25298,20806,-25314,20787,-25330,20767,-25346,20748,-25362,20728,-25377,20709,-25393,20689,-25409,20670,-25425,20650,-25441,20631,-25457,20611,-25473,20592,-25488,20572,-25504,20553,-25520,20533,-25536,20513,-25551,20494,-25567,20474,-25583,20455,-25599,20435,-25614,20415,-25630,20396,-25646,20376,-25661,20356,-25677,20337,-25692,20317,-25708,20297,-25724,20277,-25739,20258,-25755,20238,-25770,20218,-25786,20198,-25801,20179,-25817,20159,-25832,20139,-25848,20119,-25863,20099,-25879,20079,-25894,20060,-25909,20040,-25925,20020,-25940,20000,-25955,19980,-25971,19960,-25986,19940,-26001,19920,-26017,19900,-26032,19880,-26047,19860,-26062,19840,-26078,19820,-26093,19800,-26108,19780,-26123,19760,-26138,19740,-26154,19720,-26169,19700,-26184,19680,-26199,19660,-26214,19640,-26229,19620,-26244,19599,-26259,19579,-26274,19559,-26289,19539,-26304,19519,-26319,19499,-26334,19478,-26349,19458,-26364,19438,-26379,19418,-26394,19397,-26409,19377,-26424,19357,-26438,19337,-26453,19316,-26468,19296,-26483,19276,-26498,19255,-26513,19235,-26527,19215,-26542,19194,-26557,19174,-26571,19154,-26586,19133,-26601,19113,-26616,19092,-26630,19072,-26645,19051,-26659,19031,-26674,19011,-26689,18990,-26703,18970,-26718,18949,-26732,18929,-26747,18908,-26761,18888,-26776,18867,-26790,18846,-26805,18826,-26819,18805,-26834,18785,-26848,18764,-26862,18744,-26877,18723,-26891,18702,-26906,18682,-26920,18661,-26934,18640,-26949,18620,-26963,18599,-26977,18578,-26991,18558,-27006,18537,-27020,18516,-27034,18495,-27048,18475,-27062,18454,-27077,18433,-27091,18412,-27105,18392,-27119,18371,-27133,18350,-27147,18329,-27161,18308,-27175,18287,-27189,18267,-27203,18246,-27217,18225,-27231,18204,-27245,18183,-27259,18162,-27273,18141,-27287,18120,-27301,18099,-27315,18078,-27329,18057,-27343,18036,-27356,18015,-27370,17994,-27384,17973,-27398,17952,-27412,17931,-27425,17910,-27439,17889,-27453,17868,-27467,17847,-27480,17826,-27494,17805,-27508,17784,-27521,17763,-27535,17742,-27549,17720,-27562,17699,-27576,17678,-27589,17657,-27603,17636,-27616,17615,-27630,17593,-27643,17572,-27657,17551,-27670,17530,-27684,17509,-27697,17487,-27711,17466,-27724,17445,-27737,17423,-27751,17402,-27764,17381,-27778,17360,-27791,17338,-27804,17317,-27817,17296,-27831,17274,-27844,17253,-27857,17232,-27870,17210,-27884,17189,-27897,17167,-27910,17146,-27923,17124,-27936,17103,-27949,17082,-27963,17060,-27976,17039,-27989,17017,-28002,16996,-28015,16974,-28028,16953,-28041,16931,-28054,16910,-28067,16888,-28080,16867,-28093,16845,-28106,16824,-28119,16802,-28132,16780,-28144,16759,-28157,16737,-28170,16716,-28183,16694,-28196,16672,-28209,16651,-28221,16629,-28234,16607,-28247,16586,-28260,16564,-28272,16542,-28285,16521,-28298,16499,-28310,16477,-28323,16455,-28336,16434,-28348,16412,-28361,16390,-28373,16368,-28386,16347,-28398,16325,-28411,16303,-28424,16281,-28436,16260,-28448,16238,-28461,16216,-28473,16194,-28486,16172,-28498,16150,-28511,16128,-28523,16107,-28535,16085,-28548,16063,-28560,16041,-28572,16019,-28585,15997,-28597,15975,-28609,15953,-28621,15931,-28634,15909,-28646,15887,-28658,15865,-28670,15843,-28682,15821,-28695,15799,-28707,15777,-28719,15755,-28731,15733,-28743,15711,-28755,15689,-28767,15667,-28779,15645,-28791,15623,-28803,15601,-28815,15579,-28827,15556,-28839,15534,-28851,15512,-28863,15490,-28875,15468,-28887,15446,-28898,15424,-28910,15401,-28922,15379,-28934,15357,-28946,15335,-28957,15313,-28969,15290,-28981,15268,-28993,15246,-29004,15224,-29016,15201,-29028,15179,-29039,15157,-29051,15135,-29063,15112,-29074,15090,-29086,15068,-29097,15045,-29109,15023,-29120,15001,-29132,14978,-29143,14956,-29155,14934,-29166,14911,-29178,14889,-29189,14866,-29201,14844,-29212,14822,-29223,14799,-29235,14777,-29246,14754,-29257,14732,-29269,14709,-29280,14687,-29291,14665,-29303,14642,-29314,14620,-29325,14597,-29336,14575,-29347,14552,-29359,14530,-29370,14507,-29381,14484,-29392,14462,-29403,14439,-29414,14417,-29425,14394,-29436,14372,-29447,14349,-29458,14326,-29469,14304,-29480,14281,-29491,14259,-29502,14236,-29513,14213,-29524,14191,-29535,14168,-29546,14145,-29557,14123,-29568,14100,-29578,14077,-29589,14055,-29600,14032,-29611,14009,-29622,13986,-29632,13964,-29643,13941,-29654,13918,-29664,13895,-29675,13873,-29686,13850,-29696,13827,-29707,13804,-29718,13782,-29728,13759,-29739,13736,-29749,13713,-29760,13690,-29770,13667,-29781,13645,-29791,13622,-29802,13599,-29812,13576,-29823,13553,-29833,13530,-29843,13507,-29854,13485,-29864,13462,-29874,13439,-29885,13416,-29895,13393,-29905,13370,-29916,13347,-29926,13324,-29936,13301,-29946,13278,-29956,13255,-29967,13232,-29977,13209,-29987,13186,-29997,13163,-30007,13140,-30017,13117,-30027,13094,-30037,13071,-30047,13048,-30057,13025,-30067,13002,-30077,12979,-30087,12956,-30097,12933,-30107,12909,-30117,12886,-30127,12863,-30137,12840,-30147,12817,-30157,12794,-30166,12771,-30176,12748,-30186,12724,-30196,12701,-30206,12678,-30215,12655,-30225,12632,-30235,12609,-30244,12585,-30254,12562,-30264,12539,-30273,12516,-30283,12492,-30292,12469,-30302,12446,-30312,12423,-30321,12399,-30331,12376,-30340,12353,-30350,12330,-30359,12306,-30369,12283,-30378,12260,-30387,12236,-30397,12213,-30406,12190,-30416,12166,-30425,12143,-30434,12120,-30443,12096,-30453,12073,-30462,12050,-30471,12026,-30481,12003,-30490,11980,-30499,11956,-30508,11933,-30517,11909,-30526,11886,-30536,11862,-30545,11839,-30554,11816,-30563,11792,-30572,11769,-30581,11745,-30590,11722,-30599,11698,-30608,11675,-30617,11651,-30626,11628,-30635,11604,-30644,11581,-30653,11557,-30661,11534,-30670,11510,-30679,11487,-30688,11463,-30697,11440,-30706,11416,-30714,11393,-30723,11369,-30732,11345,-30740,11322,-30749,11298,-30758,11275,-30767,11251,-30775,11227,-30784,11204,-30792,11180,-30801,11157,-30810,11133,-30818,11109,-30827,11086,-30835,11062,-30844,11038,-30852,11015,-30861,10991,-30869,10967,-30877,10944,-30886,10920,-30894,10896,-30903,10873,-30911,10849,-30919,10825,-30928,10801,-30936,10778,-30944,10754,-30952,10730,-30961,10706,-30969,10683,-30977,10659,-30985,10635,-30993,10611,-31002,10588,-31010,10564,-31018,10540,-31026,10516,-31034,10492,-31042,10469,-31050,10445,-31058,10421,-31066,10397,-31074,10373,-31082,10349,-31090,10326,-31098,10302,-31106,10278,-31114,10254,-31122,10230,-31129,10206,-31137,10182,-31145,10159,-31153,10135,-31161,10111,-31168,10087,-31176,10063,-31184,10039,-31192,10015,-31199,9991,-31207,9967,-31215,9943,-31222,9919,-31230,9895,-31237,9871,-31245,9847,-31253,9823,-31260,9799,-31268,9775,-31275,9751,-31283,9727,-31290,9703,-31298,9679,-31305,9655,-31312,9631,-31320,9607,-31327,9583,-31335,9559,-31342,9535,-31349,9511,-31357,9487,-31364,9463,-31371,9439,-31378,9415,-31386,9391,-31393,9367,-31400,9343,-31407,9319,-31414,9295,-31421,9270,-31429,9246,-31436,9222,-31443,9198,-31450,9174,-31457,9150,-31464,9126,-31471,9102,-31478,9077,-31485,9053,-31492,9029,-31499,9005,-31506,8981,-31513,8957,-31519,8932,-31526,8908,-31533,8884,-31540,8860,-31547,8836,-31554,8812,-31560,8787,-31567,8763,-31574,8739,-31581,8715,-31587,8690,-31594,8666,-31601,8642,-31607,8618,-31614,8593,-31620,8569,-31627,8545,-31634,8521,-31640,8496,-31647,8472,-31653,8448,-31660,8424,-31666,8399,-31673,8375,-31679,8351,-31685,8326,-31692,8302,-31698,8278,-31705,8253,-31711,8229,-31717,8205,-31724,8180,-31730,8156,-31736,8132,-31742,8107,-31749,8083,-31755,8059,-31761,8034,-31767,8010,-31773,7986,-31779,7961,-31786,7937,-31792,7912,-31798,7888,-31804,7864,-31810,7839,-31816,7815,-31822,7790,-31828,7766,-31834,7742,-31840,7717,-31846,7693,-31852,7668,-31857,7644,-31863,7619,-31869,7595,-31875,7571,-31881,7546,-31887,7522,-31892,7497,-31898,7473,-31904,7448,-31910,7424,-31915,7399,-31921,7375,-31927,7350,-31932,7326,-31938,7301,-31944,7277,-31949,7252,-31955,7228,-31960,7203,-31966,7179,-31971,7154,-31977,7130,-31982,7105,-31988,7081,-31993,7056,-31999,7032,-32004,7007,-32009,6982,-32015,6958,-32020,6933,-32025,6909,-32031,6884,-32036,6860,-32041,6835,-32047,6811,-32052,6786,-32057,6761,-32062,6737,-32067,6712,-32073,6688,-32078,6663,-32083,6638,-32088,6614,-32093,6589,-32098,6564,-32103,6540,-32108,6515,-32113,6491,-32118,6466,-32123,6441,-32128,6417,-32133,6392,-32138,6367,-32143,6343,-32148,6318,-32153,6293,-32157,6269,-32162,6244,-32167,6219,-32172,6195,-32177,6170,-32181,6145,-32186,6121,-32191,6096,-32195,6071,-32200,6047,-32205,6022,-32209,5997,-32214,5972,-32219,5948,-32223,5923,-32228,5898,-32232,5874,-32237,5849,-32241,5824,-32246,5799,-32250,5775,-32255,5750,-32259,5725,-32263,5700,-32268,5676,-32272,5651,-32276,5626,-32281,5601,-32285,5577,-32289,5552,-32294,5527,-32298,5502,-32302,5478,-32306,5453,-32311,5428,-32315,5403,-32319,5378,-32323,5354,-32327,5329,-32331,5304,-32335,5279,-32339,5254,-32343,5230,-32347,5205,-32351,5180,-32355,5155,-32359,5130,-32363,5106,-32367,5081,-32371,5056,-32375,5031,-32379,5006,-32383,4981,-32387,4957,-32390,4932,-32394,4907,-32398,4882,-32402,4857,-32405,4832,-32409,4807,-32413,4783,-32417,4758,-32420,4733,-32424,4708,-32427,4683,-32431,4658,-32435,4633,-32438,4608,-32442,4584,-32445,4559,-32449,4534,-32452,4509,-32456,4484,-32459,4459,-32463,4434,-32466,4409,-32469,4384,-32473,4359,-32476,4335,-32479,4310,-32483,4285,-32486,4260,-32489,4235,-32493,4210,-32496,4185,-32499,4160,-32502,4135,-32505,4110,-32509,4085,-32512,4060,-32515,4035,-32518,4011,-32521,3986,-32524,3961,-32527,3936,-32530,3911,-32533,3886,-32536,3861,-32539,3836,-32542,3811,-32545,3786,-32548,3761,-32551,3736,-32554,3711,-32557,3686,-32559,3661,-32562,3636,-32565,3611,-32568,3586,-32571,3561,-32573,3536,-32576,3511,-32579,3486,-32581,3461,-32584,3436,-32587,3411,-32589,3386,-32592,3361,-32595,3336,-32597,3311,-32600,3286,-32602,3261,-32605,3236,-32607,3211,-32610,3186,-32612,3161,-32615,3136,-32617,3111,-32619,3086,-32622,3061,-32624,3036,-32626,3011,-32629,2986,-32631,2961,-32633,2936,-32636,2911,-32638,2886,-32640,2861,-32642,2836,-32645,2811,-32647,2786,-32649,2761,-32651,2736,-32653,2711,-32655,2686,-32657,2661,-32659,2636,-32661,2610,-32663,2585,-32665,2560,-32667,2535,-32669,2510,-32671,2485,-32673,2460,-32675,2435,-32677,2410,-32679,2385,-32681,2360,-32682,2335,-32684,2310,-32686,2285,-32688,2260,-32689,2235,-32691,2209,-32693,2184,-32695,2159,-32696,2134,-32698,2109,-32700,2084,-32701,2059,-32703,2034,-32704,2009,-32706,1984,-32707,1959,-32709,1934,-32710,1908,-32712,1883,-32713,1858,-32715,1833,-32716,1808,-32718,1783,-32719,1758,-32720,1733,-32722,1708,-32723,1683,-32724,1658,-32726,1632,-32727,1607,-32728,1582,-32729,1557,-32730,1532,-32732,1507,-32733,1482,-32734,1457,-32735,1432,-32736,1406,-32737,1381,-32738,1356,-32739,1331,-32740,1306,-32741,1281,-32742,1256,-32743,1231,-32744,1206,-32745,1180,-32746,1155,-32747,1130,-32748,1105,-32749,1080,-32750,1055,-32751,1030,-32751,1005,-32752,980,-32753,954,-32754,929,-32754,904,-32755,879,-32756,854,-32756,829,-32757,804,-32758,779,-32758,753,-32759,728,-32759,703,-32760,678,-32760,653,-32761,628,-32761,603,-32762,578,-32762,552,-32763,527,-32763,502,-32764,477,-32764,452,-32764,427,-32765,402,-32765,376,-32765,351,-32766,326,-32766,301,-32766,276,-32766,251,-32767,226,-32767,201,-32767,175,-32767,150,-32767,125,-32767,100,-32767,75,-32767,50,-32767,25,-32767,0,-32767,-26,-32767,-51,-32767,-76,-32767,-101,-32767,-126,-32767,-151,-32767,-176,-32767,-202,-32767,-227,-32767,-252,-32767,-277,-32766,-302,-32766,-327,-32766,-352,-32766,-377,-32765,-403,-32765,-428,-32765,-453,-32764,-478,-32764,-503,-32764,-528,-32763,-553,-32763,-579,-32762,-604,-32762,-629,-32761,-654,-32761,-679,-32760,-704,-32760,-729,-32759,-754,-32759,-780,-32758,-805,-32758,-830,-32757,-855,-32756,-880,-32756,-905,-32755,-930,-32754,-955,-32754,-981,-32753,-1006,-32752,-1031,-32751,-1056,-32751,-1081,-32750,-1106,-32749,-1131,-32748,-1156,-32747,-1181,-32746,-1207,-32745,-1232,-32744,-1257,-32743,-1282,-32742,-1307,-32741,-1332,-32740,-1357,-32739,-1382,-32738,-1407,-32737,-1433,-32736,-1458,-32735,-1483,-32734,-1508,-32733,-1533,-32732,-1558,-32730,-1583,-32729,-1608,-32728,-1633,-32727,-1659,-32726,-1684,-32724,-1709,-32723,-1734,-32722,-1759,-32720,-1784,-32719,-1809,-32718,-1834,-32716,-1859,-32715,-1884,-32713,-1909,-32712,-1935,-32710,-1960,-32709,-1985,-32707,-2010,-32706,-2035,-32704,-2060,-32703,-2085,-32701,-2110,-32700,-2135,-32698,-2160,-32696,-2185,-32695,-2210,-32693,-2236,-32691,-2261,-32689,-2286,-32688,-2311,-32686,-2336,-32684,-2361,-32682,-2386,-32681,-2411,-32679,-2436,-32677,-2461,-32675,-2486,-32673,-2511,-32671,-2536,-32669,-2561,-32667,-2586,-32665,-2611,-32663,-2637,-32661,-2662,-32659,-2687,-32657,-2712,-32655,-2737,-32653,-2762,-32651,-2787,-32649,-2812,-32647,-2837,-32645,-2862,-32642,-2887,-32640,-2912,-32638,-2937,-32636,-2962,-32633,-2987,-32631,-3012,-32629,-3037,-32626,-3062,-32624,-3087,-32622,-3112,-32619,-3137,-32617,-3162,-32615,-3187,-32612,-3212,-32610,-3237,-32607,-3262,-32605,-3287,-32602,-3312,-32600,-3337,-32597,-3362,-32595,-3387,-32592,-3412,-32589,-3437,-32587,-3462,-32584,-3487,-32581,-3512,-32579,-3537,-32576,-3562,-32573,-3587,-32571,-3612,-32568,-3637,-32565,-3662,-32562,-3687,-32559,-3712,-32557,-3737,-32554,-3762,-32551,-3787,-32548,-3812,-32545,-3837,-32542,-3862,-32539,-3887,-32536,-3912,-32533,-3937,-32530,-3962,-32527,-3987,-32524,-4012,-32521,-4036,-32518,-4061,-32515,-4086,-32512,-4111,-32509,-4136,-32505,-4161,-32502,-4186,-32499,-4211,-32496,-4236,-32493,-4261,-32489,-4286,-32486,-4311,-32483,-4336,-32479,-4360,-32476,-4385,-32473,-4410,-32469,-4435,-32466,-4460,-32463,-4485,-32459,-4510,-32456,-4535,-32452,-4560,-32449,-4585,-32445,-4609,-32442,-4634,-32438,-4659,-32435,-4684,-32431,-4709,-32427,-4734,-32424,-4759,-32420,-4784,-32417,-4808,-32413,-4833,-32409,-4858,-32405,-4883,-32402,-4908,-32398,-4933,-32394,-4958,-32390,-4982,-32387,-5007,-32383,-5032,-32379,-5057,-32375,-5082,-32371,-5107,-32367,-5131,-32363,-5156,-32359,-5181,-32355,-5206,-32351,-5231,-32347,-5255,-32343,-5280,-32339,-5305,-32335,-5330,-32331,-5355,-32327,-5379,-32323,-5404,-32319,-5429,-32315,-5454,-32311,-5479,-32306,-5503,-32302,-5528,-32298,-5553,-32294,-5578,-32289,-5602,-32285,-5627,-32281,-5652,-32276,-5677,-32272,-5701,-32268,-5726,-32263,-5751,-32259,-5776,-32255,-5800,-32250,-5825,-32246,-5850,-32241,-5875,-32237,-5899,-32232,-5924,-32228,-5949,-32223,-5973,-32219,-5998,-32214,-6023,-32209,-6048,-32205,-6072,-32200,-6097,-32195,-6122,-32191,-6146,-32186,-6171,-32181,-6196,-32177,-6220,-32172,-6245,-32167,-6270,-32162,-6294,-32157,-6319,-32153,-6344,-32148,-6368,-32143,-6393,-32138,-6418,-32133,-6442,-32128,-6467,-32123,-6492,-32118,-6516,-32113,-6541,-32108,-6565,-32103,-6590,-32098,-6615,-32093,-6639,-32088,-6664,-32083,-6689,-32078,-6713,-32073,-6738,-32067,-6762,-32062,-6787,-32057,-6812,-32052,-6836,-32047,-6861,-32041,-6885,-32036,-6910,-32031,-6934,-32025,-6959,-32020,-6983,-32015,-7008,-32009,-7033,-32004,-7057,-31999,-7082,-31993,-7106,-31988,-7131,-31982,-7155,-31977,-7180,-31971,-7204,-31966,-7229,-31960,-7253,-31955,-7278,-31949,-7302,-31944,-7327,-31938,-7351,-31932,-7376,-31927,-7400,-31921,-7425,-31915,-7449,-31910,-7474,-31904,-7498,-31898,-7523,-31892,-7547,-31887,-7572,-31881,-7596,-31875,-7620,-31869,-7645,-31863,-7669,-31857,-7694,-31852,-7718,-31846,-7743,-31840,-7767,-31834,-7791,-31828,-7816,-31822,-7840,-31816,-7865,-31810,-7889,-31804,-7913,-31798,-7938,-31792,-7962,-31786,-7987,-31779,-8011,-31773,-8035,-31767,-8060,-31761,-8084,-31755,-8108,-31749,-8133,-31742,-8157,-31736,-8181,-31730,-8206,-31724,-8230,-31717,-8254,-31711,-8279,-31705,-8303,-31698,-8327,-31692,-8352,-31685,-8376,-31679,-8400,-31673,-8425,-31666,-8449,-31660,-8473,-31653,-8497,-31647,-8522,-31640,-8546,-31634,-8570,-31627,-8594,-31620,-8619,-31614,-8643,-31607,-8667,-31601,-8691,-31594,-8716,-31587,-8740,-31581,-8764,-31574,-8788,-31567,-8813,-31560,-8837,-31554,-8861,-31547,-8885,-31540,-8909,-31533,-8933,-31526,-8958,-31519,-8982,-31513,-9006,-31506,-9030,-31499,-9054,-31492,-9078,-31485,-9103,-31478,-9127,-31471,-9151,-31464,-9175,-31457,-9199,-31450,-9223,-31443,-9247,-31436,-9271,-31429,-9296,-31421,-9320,-31414,-9344,-31407,-9368,-31400,-9392,-31393,-9416,-31386,-9440,-31378,-9464,-31371,-9488,-31364,-9512,-31357,-9536,-31349,-9560,-31342,-9584,-31335,-9608,-31327,-9632,-31320,-9656,-31312,-9680,-31305,-9704,-31298,-9728,-31290,-9752,-31283,-9776,-31275,-9800,-31268,-9824,-31260,-9848,-31253,-9872,-31245,-9896,-31237,-9920,-31230,-9944,-31222,-9968,-31215,-9992,-31207,-10016,-31199,-10040,-31192,-10064,-31184,-10088,-31176,-10112,-31168,-10136,-31161,-10160,-31153,-10183,-31145,-10207,-31137,-10231,-31129,-10255,-31122,-10279,-31114,-10303,-31106,-10327,-31098,-10350,-31090,-10374,-31082,-10398,-31074,-10422,-31066,-10446,-31058,-10470,-31050,-10493,-31042,-10517,-31034,-10541,-31026,-10565,-31018,-10589,-31010,-10612,-31002,-10636,-30993,-10660,-30985,-10684,-30977,-10707,-30969,-10731,-30961,-10755,-30952,-10779,-30944,-10802,-30936,-10826,-30928,-10850,-30919,-10874,-30911,-10897,-30903,-10921,-30894,-10945,-30886,-10968,-30877,-10992,-30869,-11016,-30861,-11039,-30852,-11063,-30844,-11087,-30835,-11110,-30827,-11134,-30818,-11158,-30810,-11181,-30801,-11205,-30792,-11228,-30784,-11252,-30775,-11276,-30767,-11299,-30758,-11323,-30749,-11346,-30740,-11370,-30732,-11394,-30723,-11417,-30714,-11441,-30706,-11464,-30697,-11488,-30688,-11511,-30679,-11535,-30670,-11558,-30661,-11582,-30653,-11605,-30644,-11629,-30635,-11652,-30626,-11676,-30617,-11699,-30608,-11723,-30599,-11746,-30590,-11770,-30581,-11793,-30572,-11817,-30563,-11840,-30554,-11863,-30545,-11887,-30536,-11910,-30526,-11934,-30517,-11957,-30508,-11981,-30499,-12004,-30490,-12027,-30481,-12051,-30471,-12074,-30462,-12097,-30453,-12121,-30443,-12144,-30434,-12167,-30425,-12191,-30416,-12214,-30406,-12237,-30397,-12261,-30387,-12284,-30378,-12307,-30369,-12331,-30359,-12354,-30350,-12377,-30340,-12400,-30331,-12424,-30321,-12447,-30312,-12470,-30302,-12493,-30292,-12517,-30283,-12540,-30273,-12563,-30264,-12586,-30254,-12610,-30244,-12633,-30235,-12656,-30225,-12679,-30215,-12702,-30206,-12725,-30196,-12749,-30186,-12772,-30176,-12795,-30166,-12818,-30157,-12841,-30147,-12864,-30137,-12887,-30127,-12910,-30117,-12934,-30107,-12957,-30097,-12980,-30087,-13003,-30077,-13026,-30067,-13049,-30057,-13072,-30047,-13095,-30037,-13118,-30027,-13141,-30017,-13164,-30007,-13187,-29997,-13210,-29987,-13233,-29977,-13256,-29967,-13279,-29956,-13302,-29946,-13325,-29936,-13348,-29926,-13371,-29916,-13394,-29905,-13417,-29895,-13440,-29885,-13463,-29874,-13486,-29864,-13508,-29854,-13531,-29843,-13554,-29833,-13577,-29823,-13600,-29812,-13623,-29802,-13646,-29791,-13668,-29781,-13691,-29770,-13714,-29760,-13737,-29749,-13760,-29739,-13783,-29728,-13805,-29718,-13828,-29707,-13851,-29696,-13874,-29686,-13896,-29675,-13919,-29664,-13942,-29654,-13965,-29643,-13987,-29632,-14010,-29622,-14033,-29611,-14056,-29600,-14078,-29589,-14101,-29578,-14124,-29568,-14146,-29557,-14169,-29546,-14192,-29535,-14214,-29524,-14237,-29513,-14260,-29502,-14282,-29491,-14305,-29480,-14327,-29469,-14350,-29458,-14373,-29447,-14395,-29436,-14418,-29425,-14440,-29414,-14463,-29403,-14485,-29392,-14508,-29381,-14531,-29370,-14553,-29359,-14576,-29347,-14598,-29336,-14621,-29325,-14643,-29314,-14666,-29303,-14688,-29291,-14710,-29280,-14733,-29269,-14755,-29257,-14778,-29246,-14800,-29235,-14823,-29223,-14845,-29212,-14867,-29201,-14890,-29189,-14912,-29178,-14935,-29166,-14957,-29155,-14979,-29143,-15002,-29132,-15024,-29120,-15046,-29109,-15069,-29097,-15091,-29086,-15113,-29074,-15136,-29063,-15158,-29051,-15180,-29039,-15202,-29028,-15225,-29016,-15247,-29004,-15269,-28993,-15291,-28981,-15314,-28969,-15336,-28957,-15358,-28946,-15380,-28934,-15402,-28922,-15425,-28910,-15447,-28898,-15469,-28887,-15491,-28875,-15513,-28863,-15535,-28851,-15557,-28839,-15580,-28827,-15602,-28815,-15624,-28803,-15646,-28791,-15668,-28779,-15690,-28767,-15712,-28755,-15734,-28743,-15756,-28731,-15778,-28719,-15800,-28707,-15822,-28695,-15844,-28682,-15866,-28670,-15888,-28658,-15910,-28646,-15932,-28634,-15954,-28621,-15976,-28609,-15998,-28597,-16020,-28585,-16042,-28572,-16064,-28560,-16086,-28548,-16108,-28535,-16129,-28523,-16151,-28511,-16173,-28498,-16195,-28486,-16217,-28473,-16239,-28461,-16261,-28448,-16282,-28436,-16304,-28424,-16326,-28411,-16348,-28398,-16369,-28386,-16391,-28373,-16413,-28361,-16435,-28348,-16456,-28336,-16478,-28323,-16500,-28310,-16522,-28298,-16543,-28285,-16565,-28272,-16587,-28260,-16608,-28247,-16630,-28234,-16652,-28221,-16673,-28209,-16695,-28196,-16717,-28183,-16738,-28170,-16760,-28157,-16781,-28144,-16803,-28132,-16825,-28119,-16846,-28106,-16868,-28093,-16889,-28080,-16911,-28067,-16932,-28054,-16954,-28041,-16975,-28028,-16997,-28015,-17018,-28002,-17040,-27989,-17061,-27976,-17083,-27963,-17104,-27949,-17125,-27936,-17147,-27923,-17168,-27910,-17190,-27897,-17211,-27884,-17233,-27870,-17254,-27857,-17275,-27844,-17297,-27831,-17318,-27817,-17339,-27804,-17361,-27791,-17382,-27778,-17403,-27764,-17424,-27751,-17446,-27737,-17467,-27724,-17488,-27711,-17510,-27697,-17531,-27684,-17552,-27670,-17573,-27657,-17594,-27643,-17616,-27630,-17637,-27616,-17658,-27603,-17679,-27589,-17700,-27576,-17721,-27562,-17743,-27549,-17764,-27535,-17785,-27521,-17806,-27508,-17827,-27494,-17848,-27480,-17869,-27467,-17890,-27453,-17911,-27439,-17932,-27425,-17953,-27412,-17974,-27398,-17995,-27384,-18016,-27370,-18037,-27356,-18058,-27343,-18079,-27329,-18100,-27315,-18121,-27301,-18142,-27287,-18163,-27273,-18184,-27259,-18205,-27245,-18226,-27231,-18247,-27217,-18268,-27203,-18288,-27189,-18309,-27175,-18330,-27161,-18351,-27147,-18372,-27133,-18393,-27119,-18413,-27105,-18434,-27091,-18455,-27077,-18476,-27062,-18496,-27048,-18517,-27034,-18538,-27020,-18559,-27006,-18579,-26991,-18600,-26977,-18621,-26963,-18641,-26949,-18662,-26934,-18683,-26920,-18703,-26906,-18724,-26891,-18745,-26877,-18765,-26862,-18786,-26848,-18806,-26834,-18827,-26819,-18847,-26805,-18868,-26790,-18889,-26776,-18909,-26761,-18930,-26747,-18950,-26732,-18971,-26718,-18991,-26703,-19012,-26689,-19032,-26674,-19052,-26659,-19073,-26645,-19093,-26630,-19114,-26616,-19134,-26601,-19155,-26586,-19175,-26571,-19195,-26557,-19216,-26542,-19236,-26527,-19256,-26513,-19277,-26498,-19297,-26483,-19317,-26468,-19338,-26453,-19358,-26438,-19378,-26424,-19398,-26409,-19419,-26394,-19439,-26379,-19459,-26364,-19479,-26349,-19500,-26334,-19520,-26319,-19540,-26304,-19560,-26289,-19580,-26274,-19600,-26259,-19621,-26244,-19641,-26229,-19661,-26214,-19681,-26199,-19701,-26184,-19721,-26169,-19741,-26154,-19761,-26138,-19781,-26123,-19801,-26108,-19821,-26093,-19841,-26078,-19861,-26062,-19881,-26047,-19901,-26032,-19921,-26017,-19941,-26001,-19961,-25986,-19981,-25971,-20001,-25955,-20021,-25940,-20041,-25925,-20061,-25909,-20080,-25894,-20100,-25879,-20120,-25863,-20140,-25848,-20160,-25832,-20180,-25817,-20199,-25801,-20219,-25786,-20239,-25770,-20259,-25755,-20278,-25739,-20298,-25724,-20318,-25708,-20338,-25692,-20357,-25677,-20377,-25661,-20397,-25646,-20416,-25630,-20436,-25614,-20456,-25599,-20475,-25583,-20495,-25567,-20514,-25551,-20534,-25536,-20554,-25520,-20573,-25504,-20593,-25488,-20612,-25473,-20632,-25457,-20651,-25441,-20671,-25425,-20690,-25409,-20710,-25393,-20729,-25377,-20749,-25362,-20768,-25346,-20788,-25330,-20807,-25314,-20826,-25298,-20846,-25282,-20865,-25266,-20885,-25250,-20904,-25234,-20923,-25218,-20943,-25202,-20962,-25186,-20981,-25170,-21001,-25153,-21020,-25137,-21039,-25121,-21058,-25105,-21078,-25089,-21097,-25073,-21116,-25057,-21135,-25040,-21155,-25024,-21174,-25008,-21193,-24992,-21212,-24975,-21231,-24959,-21250,-24943,-21269,-24927,-21289,-24910,-21308,-24894,-21327,-24878,-21346,-24861,-21365,-24845,-21384,-24828,-21403,-24812,-21422,-24796,-21441,-24779,-21460,-24763,-21479,-24746,-21498,-24730,-21517,-24713,-21536,-24697,-21555,-24680,-21574,-24664,-21593,-24647,-21612,-24631,-21630,-24614,-21649,-24597,-21668,-24581,-21687,-24564,-21706,-24547,-21725,-24531,-21744,-24514,-21762,-24497,-21781,-24481,-21800,-24464,-21819,-24447,-21837,-24431,-21856,-24414,-21875,-24397,-21894,-24380,-21912,-24363,-21931,-24347,-21950,-24330,-21968,-24313,-21987,-24296,-22005,-24279,-22024,-24262,-22043,-24245,-22061,-24229,-22080,-24212,-22098,-24195,-22117,-24178,-22136,-24161,-22154,-24144,-22173,-24127,-22191,-24110,-22210,-24093,-22228,-24076,-22246,-24059,-22265,-24042,-22283,-24024,-22302,-24007,-22320,-23990,-22339,-23973,-22357,-23956,-22375,-23939,-22394,-23922,-22412,-23904,-22430,-23887,-22449,-23870,-22467,-23853,-22485,-23836,-22504,-23818,-22522,-23801,-22540,-23784,-22558,-23767,-22576,-23749,-22595,-23732,-22613,-23715,-22631,-23697,-22649,-23680,-22667,-23662,-22686,-23645,-22704,-23628,-22722,-23610,-22740,-23593,-22758,-23575,-22776,-23558,-22794,-23540,-22812,-23523,-22830,-23505,-22848,-23488,-22866,-23470,-22884,-23453,-22902,-23435,-22920,-23418,-22938,-23400,-22956,-23383,-22974,-23365,-22992,-23347,-23010,-23330,-23028,-23312,-23046,-23294,-23063,-23277,-23081,-23259,-23099,-23241,-23117,-23224,-23135,-23206,-23152,-23188,-23170,-23170,-23188,-23152,-23206,-23135,-23224,-23117,-23241,-23099,-23259,-23081,-23277,-23063,-23294,-23046,-23312,-23028,-23330,-23010,-23347,-22992,-23365,-22974,-23383,-22956,-23400,-22938,-23418,-22920,-23435,-22902,-23453,-22884,-23470,-22866,-23488,-22848,-23505,-22830,-23523,-22812,-23540,-22794,-23558,-22776,-23575,-22758,-23593,-22740,-23610,-22722,-23628,-22704,-23645,-22686,-23662,-22667,-23680,-22649,-23697,-22631,-23715,-22613,-23732,-22595,-23749,-22576,-23767,-22558,-23784,-22540,-23801,-22522,-23818,-22504,-23836,-22485,-23853,-22467,-23870,-22449,-23887,-22430,-23904,-22412,-23922,-22394,-23939,-22375,-23956,-22357,-23973,-22339,-23990,-22320,-24007,-22302,-24024,-22283,-24042,-22265,-24059,-22246,-24076,-22228,-24093,-22210,-24110,-22191,-24127,-22173,-24144,-22154,-24161,-22136,-24178,-22117,-24195,-22098,-24212,-22080,-24229,-22061,-24245,-22043,-24262,-22024,-24279,-22005,-24296,-21987,-24313,-21968,-24330,-21950,-24347,-21931,-24363,-21912,-24380,-21894,-24397,-21875,-24414,-21856,-24431,-21837,-24447,-21819,-24464,-21800,-24481,-21781,-24497,-21762,-24514,-21744,-24531,-21725,-24547,-21706,-24564,-21687,-24581,-21668,-24597,-21649,-24614,-21630,-24631,-21612,-24647,-21593,-24664,-21574,-24680,-21555,-24697,-21536,-24713,-21517,-24730,-21498,-24746,-21479,-24763,-21460,-24779,-21441,-24796,-21422,-24812,-21403,-24828,-21384,-24845,-21365,-24861,-21346,-24878,-21327,-24894,-21308,-24910,-21289,-24927,-21269,-24943,-21250,-24959,-21231,-24975,-21212,-24992,-21193,-25008,-21174,-25024,-21155,-25040,-21135,-25057,-21116,-25073,-21097,-25089,-21078,-25105,-21058,-25121,-21039,-25137,-21020,-25153,-21001,-25170,-20981,-25186,-20962,-25202,-20943,-25218,-20923,-25234,-20904,-25250,-20885,-25266,-20865,-25282,-20846,-25298,-20826,-25314,-20807,-25330,-20788,-25346,-20768,-25362,-20749,-25377,-20729,-25393,-20710,-25409,-20690,-25425,-20671,-25441,-20651,-25457,-20632,-25473,-20612,-25488,-20593,-25504,-20573,-25520,-20554,-25536,-20534,-25551,-20514,-25567,-20495,-25583,-20475,-25599,-20456,-25614,-20436,-25630,-20416,-25646,-20397,-25661,-20377,-25677,-20357,-25692,-20338,-25708,-20318,-25724,-20298,-25739,-20278,-25755,-20259,-25770,-20239,-25786,-20219,-25801,-20199,-25817,-20180,-25832,-20160,-25848,-20140,-25863,-20120,-25879,-20100,-25894,-20080,-25909,-20061,-25925,-20041,-25940,-20021,-25955,-20001,-25971,-19981,-25986,-19961,-26001,-19941,-26017,-19921,-26032,-19901,-26047,-19881,-26062,-19861,-26078,-19841,-26093,-19821,-26108,-19801,-26123,-19781,-26138,-19761,-26154,-19741,-26169,-19721,-26184,-19701,-26199,-19681,-26214,-19661,-26229,-19641,-26244,-19621,-26259,-19600,-26274,-19580,-26289,-19560,-26304,-19540,-26319,-19520,-26334,-19500,-26349,-19479,-26364,-19459,-26379,-19439,-26394,-19419,-26409,-19398,-26424,-19378,-26438,-19358,-26453,-19338,-26468,-19317,-26483,-19297,-26498,-19277,-26513,-19256,-26527,-19236,-26542,-19216,-26557,-19195,-26571,-19175,-26586,-19155,-26601,-19134,-26616,-19114,-26630,-19093,-26645,-19073,-26659,-19052,-26674,-19032,-26689,-19012,-26703,-18991,-26718,-18971,-26732,-18950,-26747,-18930,-26761,-18909,-26776,-18889,-26790,-18868,-26805,-18847,-26819,-18827,-26834,-18806,-26848,-18786,-26862,-18765,-26877,-18745,-26891,-18724,-26906,-18703,-26920,-18683,-26934,-18662,-26949,-18641,-26963,-18621,-26977,-18600,-26991,-18579,-27006,-18559,-27020,-18538,-27034,-18517,-27048,-18496,-27062,-18476,-27077,-18455,-27091,-18434,-27105,-18413,-27119,-18393,-27133,-18372,-27147,-18351,-27161,-18330,-27175,-18309,-27189,-18288,-27203,-18268,-27217,-18247,-27231,-18226,-27245,-18205,-27259,-18184,-27273,-18163,-27287,-18142,-27301,-18121,-27315,-18100,-27329,-18079,-27343,-18058,-27356,-18037,-27370,-18016,-27384,-17995,-27398,-17974,-27412,-17953,-27425,-17932,-27439,-17911,-27453,-17890,-27467,-17869,-27480,-17848,-27494,-17827,-27508,-17806,-27521,-17785,-27535,-17764,-27549,-17743,-27562,-17721,-27576,-17700,-27589,-17679,-27603,-17658,-27616,-17637,-27630,-17616,-27643,-17594,-27657,-17573,-27670,-17552,-27684,-17531,-27697,-17510,-27711,-17488,-27724,-17467,-27737,-17446,-27751,-17424,-27764,-17403,-27778,-17382,-27791,-17361,-27804,-17339,-27817,-17318,-27831,-17297,-27844,-17275,-27857,-17254,-27870,-17233,-27884,-17211,-27897,-17190,-27910,-17168,-27923,-17147,-27936,-17125,-27949,-17104,-27963,-17083,-27976,-17061,-27989,-17040,-28002,-17018,-28015,-16997,-28028,-16975,-28041,-16954,-28054,-16932,-28067,-16911,-28080,-16889,-28093,-16868,-28106,-16846,-28119,-16825,-28132,-16803,-28144,-16781,-28157,-16760,-28170,-16738,-28183,-16717,-28196,-16695,-28209,-16673,-28221,-16652,-28234,-16630,-28247,-16608,-28260,-16587,-28272,-16565,-28285,-16543,-28298,-16522,-28310,-16500,-28323,-16478,-28336,-16456,-28348,-16435,-28361,-16413,-28373,-16391,-28386,-16369,-28398,-16348,-28411,-16326,-28424,-16304,-28436,-16282,-28448,-16261,-28461,-16239,-28473,-16217,-28486,-16195,-28498,-16173,-28511,-16151,-28523,-16129,-28535,-16108,-28548,-16086,-28560,-16064,-28572,-16042,-28585,-16020,-28597,-15998,-28609,-15976,-28621,-15954,-28634,-15932,-28646,-15910,-28658,-15888,-28670,-15866,-28682,-15844,-28695,-15822,-28707,-15800,-28719,-15778,-28731,-15756,-28743,-15734,-28755,-15712,-28767,-15690,-28779,-15668,-28791,-15646,-28803,-15624,-28815,-15602,-28827,-15580,-28839,-15557,-28851,-15535,-28863,-15513,-28875,-15491,-28887,-15469,-28898,-15447,-28910,-15425,-28922,-15402,-28934,-15380,-28946,-15358,-28957,-15336,-28969,-15314,-28981,-15291,-28993,-15269,-29004,-15247,-29016,-15225,-29028,-15202,-29039,-15180,-29051,-15158,-29063,-15136,-29074,-15113,-29086,-15091,-29097,-15069,-29109,-15046,-29120,-15024,-29132,-15002,-29143,-14979,-29155,-14957,-29166,-14935,-29178,-14912,-29189,-14890,-29201,-14867,-29212,-14845,-29223,-14823,-29235,-14800,-29246,-14778,-29257,-14755,-29269,-14733,-29280,-14710,-29291,-14688,-29303,-14666,-29314,-14643,-29325,-14621,-29336,-14598,-29347,-14576,-29359,-14553,-29370,-14531,-29381,-14508,-29392,-14485,-29403,-14463,-29414,-14440,-29425,-14418,-29436,-14395,-29447,-14373,-29458,-14350,-29469,-14327,-29480,-14305,-29491,-14282,-29502,-14260,-29513,-14237,-29524,-14214,-29535,-14192,-29546,-14169,-29557,-14146,-29568,-14124,-29578,-14101,-29589,-14078,-29600,-14056,-29611,-14033,-29622,-14010,-29632,-13987,-29643,-13965,-29654,-13942,-29664,-13919,-29675,-13896,-29686,-13874,-29696,-13851,-29707,-13828,-29718,-13805,-29728,-13783,-29739,-13760,-29749,-13737,-29760,-13714,-29770,-13691,-29781,-13668,-29791,-13646,-29802,-13623,-29812,-13600,-29823,-13577,-29833,-13554,-29843,-13531,-29854,-13508,-29864,-13486,-29874,-13463,-29885,-13440,-29895,-13417,-29905,-13394,-29916,-13371,-29926,-13348,-29936,-13325,-29946,-13302,-29956,-13279,-29967,-13256,-29977,-13233,-29987,-13210,-29997,-13187,-30007,-13164,-30017,-13141,-30027,-13118,-30037,-13095,-30047,-13072,-30057,-13049,-30067,-13026,-30077,-13003,-30087,-12980,-30097,-12957,-30107,-12934,-30117,-12910,-30127,-12887,-30137,-12864,-30147,-12841,-30157,-12818,-30166,-12795,-30176,-12772,-30186,-12749,-30196,-12725,-30206,-12702,-30215,-12679,-30225,-12656,-30235,-12633,-30244,-12610,-30254,-12586,-30264,-12563,-30273,-12540,-30283,-12517,-30292,-12493,-30302,-12470,-30312,-12447,-30321,-12424,-30331,-12400,-30340,-12377,-30350,-12354,-30359,-12331,-30369,-12307,-30378,-12284,-30387,-12261,-30397,-12237,-30406,-12214,-30416,-12191,-30425,-12167,-30434,-12144,-30443,-12121,-30453,-12097,-30462,-12074,-30471,-12051,-30481,-12027,-30490,-12004,-30499,-11981,-30508,-11957,-30517,-11934,-30526,-11910,-30536,-11887,-30545,-11863,-30554,-11840,-30563,-11817,-30572,-11793,-30581,-11770,-30590,-11746,-30599,-11723,-30608,-11699,-30617,-11676,-30626,-11652,-30635,-11629,-30644,-11605,-30653,-11582,-30661,-11558,-30670,-11535,-30679,-11511,-30688,-11488,-30697,-11464,-30706,-11441,-30714,-11417,-30723,-11394,-30732,-11370,-30740,-11346,-30749,-11323,-30758,-11299,-30767,-11276,-30775,-11252,-30784,-11228,-30792,-11205,-30801,-11181,-30810,-11158,-30818,-11134,-30827,-11110,-30835,-11087,-30844,-11063,-30852,-11039,-30861,-11016,-30869,-10992,-30877,-10968,-30886,-10945,-30894,-10921,-30903,-10897,-30911,-10874,-30919,-10850,-30928,-10826,-30936,-10802,-30944,-10779,-30952,-10755,-30961,-10731,-30969,-10707,-30977,-10684,-30985,-10660,-30993,-10636,-31002,-10612,-31010,-10589,-31018,-10565,-31026,-10541,-31034,-10517,-31042,-10493,-31050,-10470,-31058,-10446,-31066,-10422,-31074,-10398,-31082,-10374,-31090,-10350,-31098,-10327,-31106,-10303,-31114,-10279,-31122,-10255,-31129,-10231,-31137,-10207,-31145,-10183,-31153,-10160,-31161,-10136,-31168,-10112,-31176,-10088,-31184,-10064,-31192,-10040,-31199,-10016,-31207,-9992,-31215,-9968,-31222,-9944,-31230,-9920,-31237,-9896,-31245,-9872,-31253,-9848,-31260,-9824,-31268,-9800,-31275,-9776,-31283,-9752,-31290,-9728,-31298,-9704,-31305,-9680,-31312,-9656,-31320,-9632,-31327,-9608,-31335,-9584,-31342,-9560,-31349,-9536,-31357,-9512,-31364,-9488,-31371,-9464,-31378,-9440,-31386,-9416,-31393,-9392,-31400,-9368,-31407,-9344,-31414,-9320,-31421,-9296,-31429,-9271,-31436,-9247,-31443,-9223,-31450,-9199,-31457,-9175,-31464,-9151,-31471,-9127,-31478,-9103,-31485,-9078,-31492,-9054,-31499,-9030,-31506,-9006,-31513,-8982,-31519,-8958,-31526,-8933,-31533,-8909,-31540,-8885,-31547,-8861,-31554,-8837,-31560,-8813,-31567,-8788,-31574,-8764,-31581,-8740,-31587,-8716,-31594,-8691,-31601,-8667,-31607,-8643,-31614,-8619,-31620,-8594,-31627,-8570,-31634,-8546,-31640,-8522,-31647,-8497,-31653,-8473,-31660,-8449,-31666,-8425,-31673,-8400,-31679,-8376,-31685,-8352,-31692,-8327,-31698,-8303,-31705,-8279,-31711,-8254,-31717,-8230,-31724,-8206,-31730,-8181,-31736,-8157,-31742,-8133,-31749,-8108,-31755,-8084,-31761,-8060,-31767,-8035,-31773,-8011,-31779,-7987,-31786,-7962,-31792,-7938,-31798,-7913,-31804,-7889,-31810,-7865,-31816,-7840,-31822,-7816,-31828,-7791,-31834,-7767,-31840,-7743,-31846,-7718,-31852,-7694,-31857,-7669,-31863,-7645,-31869,-7620,-31875,-7596,-31881,-7572,-31887,-7547,-31892,-7523,-31898,-7498,-31904,-7474,-31910,-7449,-31915,-7425,-31921,-7400,-31927,-7376,-31932,-7351,-31938,-7327,-31944,-7302,-31949,-7278,-31955,-7253,-31960,-7229,-31966,-7204,-31971,-7180,-31977,-7155,-31982,-7131,-31988,-7106,-31993,-7082,-31999,-7057,-32004,-7033,-32009,-7008,-32015,-6983,-32020,-6959,-32025,-6934,-32031,-6910,-32036,-6885,-32041,-6861,-32047,-6836,-32052,-6812,-32057,-6787,-32062,-6762,-32067,-6738,-32073,-6713,-32078,-6689,-32083,-6664,-32088,-6639,-32093,-6615,-32098,-6590,-32103,-6565,-32108,-6541,-32113,-6516,-32118,-6492,-32123,-6467,-32128,-6442,-32133,-6418,-32138,-6393,-32143,-6368,-32148,-6344,-32153,-6319,-32157,-6294,-32162,-6270,-32167,-6245,-32172,-6220,-32177,-6196,-32181,-6171,-32186,-6146,-32191,-6122,-32195,-6097,-32200,-6072,-32205,-6048,-32209,-6023,-32214,-5998,-32219,-5973,-32223,-5949,-32228,-5924,-32232,-5899,-32237,-5875,-32241,-5850,-32246,-5825,-32250,-5800,-32255,-5776,-32259,-5751,-32263,-5726,-32268,-5701,-32272,-5677,-32276,-5652,-32281,-5627,-32285,-5602,-32289,-5578,-32294,-5553,-32298,-5528,-32302,-5503,-32306,-5479,-32311,-5454,-32315,-5429,-32319,-5404,-32323,-5379,-32327,-5355,-32331,-5330,-32335,-5305,-32339,-5280,-32343,-5255,-32347,-5231,-32351,-5206,-32355,-5181,-32359,-5156,-32363,-5131,-32367,-5107,-32371,-5082,-32375,-5057,-32379,-5032,-32383,-5007,-32387,-4982,-32390,-4958,-32394,-4933,-32398,-4908,-32402,-4883,-32405,-4858,-32409,-4833,-32413,-4808,-32417,-4784,-32420,-4759,-32424,-4734,-32427,-4709,-32431,-4684,-32435,-4659,-32438,-4634,-32442,-4609,-32445,-4585,-32449,-4560,-32452,-4535,-32456,-4510,-32459,-4485,-32463,-4460,-32466,-4435,-32469,-4410,-32473,-4385,-32476,-4360,-32479,-4336,-32483,-4311,-32486,-4286,-32489,-4261,-32493,-4236,-32496,-4211,-32499,-4186,-32502,-4161,-32505,-4136,-32509,-4111,-32512,-4086,-32515,-4061,-32518,-4036,-32521,-4012,-32524,-3987,-32527,-3962,-32530,-3937,-32533,-3912,-32536,-3887,-32539,-3862,-32542,-3837,-32545,-3812,-32548,-3787,-32551,-3762,-32554,-3737,-32557,-3712,-32559,-3687,-32562,-3662,-32565,-3637,-32568,-3612,-32571,-3587,-32573,-3562,-32576,-3537,-32579,-3512,-32581,-3487,-32584,-3462,-32587,-3437,-32589,-3412,-32592,-3387,-32595,-3362,-32597,-3337,-32600,-3312,-32602,-3287,-32605,-3262,-32607,-3237,-32610,-3212,-32612,-3187,-32615,-3162,-32617,-3137,-32619,-3112,-32622,-3087,-32624,-3062,-32626,-3037,-32629,-3012,-32631,-2987,-32633,-2962,-32636,-2937,-32638,-2912,-32640,-2887,-32642,-2862,-32645,-2837,-32647,-2812,-32649,-2787,-32651,-2762,-32653,-2737,-32655,-2712,-32657,-2687,-32659,-2662,-32661,-2637,-32663,-2611,-32665,-2586,-32667,-2561,-32669,-2536,-32671,-2511,-32673,-2486,-32675,-2461,-32677,-2436,-32679,-2411,-32681,-2386,-32682,-2361,-32684,-2336,-32686,-2311,-32688,-2286,-32689,-2261,-32691,-2236,-32693,-2210,-32695,-2185,-32696,-2160,-32698,-2135,-32700,-2110,-32701,-2085,-32703,-2060,-32704,-2035,-32706,-2010,-32707,-1985,-32709,-1960,-32710,-1935,-32712,-1909,-32713,-1884,-32715,-1859,-32716,-1834,-32718,-1809,-32719,-1784,-32720,-1759,-32722,-1734,-32723,-1709,-32724,-1684,-32726,-1659,-32727,-1633,-32728,-1608,-32729,-1583,-32730,-1558,-32732,-1533,-32733,-1508,-32734,-1483,-32735,-1458,-32736,-1433,-32737,-1407,-32738,-1382,-32739,-1357,-32740,-1332,-32741,-1307,-32742,-1282,-32743,-1257,-32744,-1232,-32745,-1207,-32746,-1181,-32747,-1156,-32748,-1131,-32749,-1106,-32750,-1081,-32751,-1056,-32751,-1031,-32752,-1006,-32753,-981,-32754,-955,-32754,-930,-32755,-905,-32756,-880,-32756,-855,-32757,-830,-32758,-805,-32758,-780,-32759,-754,-32759,-729,-32760,-704,-32760,-679,-32761,-654,-32761,-629,-32762,-604,-32762,-579,-32763,-553,-32763,-528,-32764,-503,-32764,-478,-32764,-453,-32765,-428,-32765,-403,-32765,-377,-32766,-352,-32766,-327,-32766,-302,-32766,-277,-32767,-252,-32767,-227,-32767,-202,-32767,-176,-32767,-151,-32767,-126,-32767,-101,-32767,-76,-32767,-51,-32767,-26}; diff --git a/openair1/PHY/defs.h b/openair1/PHY/defs.h index 3c16ce0cd3eaa18e3271eb18710d2548d6f254c3..26239b024c40e9743ca5bfb445a46efab03f34d8 100755 --- a/openair1/PHY/defs.h +++ b/openair1/PHY/defs.h @@ -122,7 +122,6 @@ static inline void* malloc16_clear( size_t size ) #define UNUSED(x) (void)x; -#include "spec_defs_top.h" #include "impl_defs_top.h" #include "impl_defs_lte.h" @@ -395,7 +394,11 @@ typedef struct PHY_VARS_eNB_s { 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][2*10*1024]; - + int32_t pusch_stats_rb[NUMBER_OF_UE_MAX][10240]; + int32_t pusch_stats_round[NUMBER_OF_UE_MAX][10240]; + int32_t pusch_stats_mcs[NUMBER_OF_UE_MAX][10240]; + int32_t pusch_stats_bsr[NUMBER_OF_UE_MAX][10240]; + int32_t pusch_stats_BO[NUMBER_OF_UE_MAX][10240]; #if ENABLE_RAL hash_table_t *ral_thresholds_timed; SLIST_HEAD(ral_thresholds_gen_poll_enb_s, ral_threshold_phy_t) ral_thresholds_gen_polled[RAL_LINK_PARAM_GEN_MAX]; diff --git a/openair1/PHY/extern.h b/openair1/PHY/extern.h index a7450e3e21cf14eec465082758db07d2c218d200..4c9e2706c78a6055a72546c6c7d102bf87399b98 100755 --- a/openair1/PHY/extern.h +++ b/openair1/PHY/extern.h @@ -30,7 +30,7 @@ #define __PHY_EXTERN_H__ #include "PHY/defs.h" - +#include "PHY_INTERFACE/defs.h" extern char* namepointer_chMag ; extern char* namepointer_log2; @@ -39,10 +39,7 @@ extern char fmageren_name2[512]; extern unsigned int RX_DMA_BUFFER[4][NB_ANTENNAS_RX]; extern unsigned int TX_DMA_BUFFER[4][NB_ANTENNAS_TX]; -#ifdef OPENAIR_LTE #include "PHY/LTE_TRANSPORT/extern.h" -#include "MAC_INTERFACE/defs.h" -#include "MAC_INTERFACE/extern.h" #include "SIMULATION/ETH_TRANSPORT/extern.h" extern unsigned int DAQ_MBOX; @@ -56,6 +53,7 @@ extern PHY_VARS_eNB ***PHY_vars_eNB_g; extern PHY_VARS_RN **PHY_vars_RN_g; extern LTE_DL_FRAME_PARMS *lte_frame_parms_g; +extern MAC_xface *mac_xface; extern short primary_synch0[144]; @@ -78,7 +76,6 @@ extern char mode_string[4][20]; #include "PHY/LTE_TRANSPORT/extern.h" -#endif #ifndef OPENAIR2 extern unsigned char NB_eNB_INST; diff --git a/openair1/PHY/impl_defs_lte.h b/openair1/PHY/impl_defs_lte.h index cd6ee4eccecf2a61d9c3d316676143c2f4764e6a..7c38048a55ef71e6a014d7fd446c203b90e278ff 100644 --- a/openair1/PHY/impl_defs_lte.h +++ b/openair1/PHY/impl_defs_lte.h @@ -43,7 +43,6 @@ #include "types.h" -#include "spec_defs_top.h" //#include "defs.h" #define LTE_NUMBER_OF_SUBFRAMES_PER_FRAME 10 @@ -605,7 +604,7 @@ typedef struct { /// - first index: eNB id [0..2] (hard coded) /// - second index: tx antenna [0..nb_antennas_tx[ /// - third index: sample [0..] - mod_sym_t **txdataF[3]; + int32_t **txdataF[3]; /// \brief Holds the received data in time domain. /// Should point to the same memory as PHY_vars->rx_vars[a].RX_DMA_BUFFER. /// - first index: eNB id [0..2] (hard coded) @@ -749,7 +748,7 @@ typedef struct { /// For IFFT_FPGA this points to the same memory as PHY_vars->rx_vars[a].RX_DMA_BUFFER. /// - first index: tx antenna [0..nb_antennas_tx[ /// - second index: sample [0..FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX[ - mod_sym_t **txdataF; + int32_t **txdataF; /// \brief Holds the received data in time domain. /// Should point to the same memory as PHY_vars->rx_vars[a].RX_DMA_BUFFER. /// - first index: rx antenna [0..nb_antennas_rx[ diff --git a/openair1/PHY/impl_defs_top.h b/openair1/PHY/impl_defs_top.h index 18b16b8670b978bc00ef39363190c562f148569a..98615d6f6e8ede879cf25abd86006b6c875c8721 100755 --- a/openair1/PHY/impl_defs_top.h +++ b/openair1/PHY/impl_defs_top.h @@ -50,6 +50,7 @@ * @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 + * @defgroup _LMSSDR_PHY_RF_INTERFACE_ PHY - LMSSDR RF Interface * @} * * @ingroup _ref_implementation_ @@ -115,7 +116,6 @@ */ #include "types.h" -#include "spec_defs_top.h" @@ -130,11 +130,7 @@ #define HALF_NUMBER_OF_USEFUL_CARRIERS (NUMBER_OF_USEFUL_CARRIERS>>1) #define HALF_NUMBER_OF_USEFUL_CARRIERS_BYTES (HALF_NUMBER_OF_USEFUL_CARRIERS>>2) #define FIRST_CARRIER_OFFSET (HALF_NUMBER_OF_USEFUL_CARRIERS+NUMBER_OF_ZERO_CARRIERS) -#ifdef OPENAIR_LTE #define NUMBER_OF_OFDM_SYMBOLS_PER_SLOT (NUMBER_OF_SYMBOLS_PER_FRAME/LTE_SLOTS_PER_FRAME) -#else -#define NUMBER_OF_OFDM_SYMBOLS_PER_SLOT 16 -#endif #ifdef EMOS #define EMOS_SCH_INDEX 1 @@ -263,70 +259,10 @@ #define AMP_OVER_2 (AMP>>1) /// Threshold for PUCCH Format 1 detection -#define PUCCH1_THRES 10 +#define PUCCH1_THRES 0 /// Threshold for PUCCH Format 1a/1b detection #define PUCCH1a_THRES 4 -#ifndef OPENAIR_LTE -/// -/// PHY-MAC Interface Defs -/// - -/// Maximum number of parallel streams per slot -#define NB_STREAMS_MAX 4 - -/// Maximum number of frequency groups per slot -#define NB_GROUPS_MAX 16 - -/// Maximum number of control bytes per slot -#define NB_CNTL_BYTES_MAX 8 - -/// Maximum number of data bytes per slot -#define NB_DATA_BYTES_MAX 256 - -#define MAX_NUM_TB 32 -#define MAX_TB_SIZE_BYTES 128 - -/// Size of SACCH PDU in Bytes -#define SACCH_SIZE_BYTES (sizeof(UL_SACCH_PDU)+4) -/// Size of SACCH PDU in Bytes -#define SACCH_SIZE_BITS (SACCH_SIZE_BYTES<<3) - -#define MAX_SACH_SIZE_BYTES 1024 - - -#define SACH_ERROR 1 -#define SACCH_ERROR 2 -#define SACH_MISSING 3 -#define SACH_PARAM_INVALID 10 - -#endif //OPENAIR_LTE - -/* -enum STATUS_RX {STATUS_RX_OFF, - STATUS_RX_ON, - STATUS_RX_SYNCING, - STATUS_RX_CANNOT_SYNC, - STATUS_RX_DATA_PROBLEM, - STATUS_RX_LOST_SYNC, - STATUS_RX_ABORT, - STATUS_RX_TOO_LATE, - STATUS_RX_CLOCK_STOPPED}; - -enum STATUS_TX { - STATUS_TX_OFF, - STATUS_TX_ON, - STATUS_TX_INPUT_CORRUPT, - STATUS_TX_ABORT, - STATUS_TX_TOO_LATE, - STATUS_TX_CLOCK_STOPPED}; - -enum MODE { - SYNCHED, - SYNCHING, - NOT_SYNCHED}; -*/ - /// Data structure for transmission. typedef struct { /// RAW TX sample buffer @@ -341,6 +277,14 @@ typedef struct { int *RX_DMA_BUFFER[2]; } TX_RX_VARS; +/*! \brief Extension Type */ +typedef enum { + CYCLIC_PREFIX, + CYCLIC_SUFFIX, + ZEROS, + NONE +} Extension_t; + /// Measurement Variables #define NUMBER_OF_SUBBANDS_MAX 13 @@ -349,7 +293,7 @@ typedef struct { #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_UE_MAX 16 #define NUMBER_OF_CONNECTED_eNB_MAX 3 #else #ifdef LARGE_SCALE diff --git a/openair1/PHY/spec_defs.h b/openair1/PHY/spec_defs.h deleted file mode 100755 index c8a1e86e5e9ce4661d3ea049aa860b2b8fcf15ed..0000000000000000000000000000000000000000 --- a/openair1/PHY/spec_defs.h +++ /dev/null @@ -1,745 +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 - - *******************************************************************************/ -#ifndef __PHY_DEFS_SPEC_H__ -#define __PHY_DEFS_SPEC_H__ - -#include "types.h" - - -/*! \mainpage OpenAirInterface.org Specifications - -\section scope_openair Scope - -The present document specifies the architecture of the following components of a OpenAirInterface network --# \ref _RN_TOPOLOGY_ --# \ref _PHY_PROCEDURES_MESH_ --# \ref _PHY_PROCEDURES_CELL_ --# \ref _L2_PROTOCOLS -\subsection _RN_TOPOLOGY_ Radio Network Topology and Components -This section describes the different components which constitute the OpenAirInterface. Two types of network topologies are supported, mesh and cellular. -The mesh topology is depicted as: - -\image html mesh_topology_small.png "OpenAirInterface Mesh Topology" width=5cm -\image latex mesh_topology.pdf "OpenAirInterface Mesh Topology" - -The cellular topology is depicted as: - -\image html cellular_topology_small.png "OpenAirInterface Cellular Topology" width=5cm -\image latex cellular_topology.pdf "OpenAirInterface Cellular Topology" - -The mesh topology contains Clusterheads (CH) and Mesh Routers (MR) whereas the cellular topology contains Clusterheads/NodeB (CH/NodeB) and User Equipment (UE). -The main difference at the physical layer between the two topologies is that direct communications between UE is not permitted in a cellular topology. Other major -differences exist at layers 2 and 3. In both topologies, MR/UE can be connected to more than one CH at any time, if radio connectivity is possible. - -The two types of physical networking devices are specified as follows: - -- Cluster-head (CH or NodeB): A cluster-head can be defined as a node with a maximum visibility/connectivity in terms of number of nodes in its neighborhood. -From the point-of-view of the MAC layer, it assumes the fine-grain management of radio resources in the cluster (cell). It determines the frame partitioning -(see \ref _framing_modulation) and bandwidth allocation and communicates this information to nodes in the cluster through a beacon. At the -physical layer, the cluster-head provides mechanisms for timing and carrier frequency synchronization. The primary role of the CH is to manage radio resources in their cluster. The cluster is defined as the set of nodes which are characterized by one-hop connectivity with the clusterhead. One-hop connectivity is further defined as the capacity to reliably receive and transmit basic signaling channels with the clusterhead using at least at the lowest datarate communication mode. Reliable communication is defined by a transmission which falls below a maximal error probability threshold. -CH can only be connected to MR on the same frequency-carrier since they use the same temporal resources as other CH. Thus direct CH<->CH communication is not possible on the same frequency carrier. -The downlink (CH -> MR) signaling channels allow for the CH to schedule transmission of labels (in the form of time and frequency mappings on the radio resource) which each carry different types of traffic throughout the mesh network. The Uplink (UL) signaling channels (MR -> CH) are used for relaying bandwidth requirement indicators and channel quality measurements from nodes within the cluster. These feed the scheduling algorithms residing in the CH and allow for proper resource allocation satisfying quality-of-service (QoS) negotiations carried out using Layer 3 (L3) signaling. - -The CH further provides mechanisms for measurement reporting to L3 (for routing, QoS management, labeling, etc...). This is achieved by a set of signaling channels which relay measurement information (UL) for the nodes in the cluster to the CH. The CH processes these raw measurements into a form which is expected by L3 mechanisms. -Some CH can assume the role of network synchronization by sending special synchronization pilots (see Section 1.1.5). These will be called Primary CH when network synchronization is achieved using this method. Other CH using this method are called Secondary CH. - - - Regular node/Mesh Router (UE): All nodes have the ability to play at the same time the role of a host and of a router, although this functionality is not activated -in a cellular topology. - -The primary role of an MR is to interpret the scheduling information from the CH on the DL signaling channels in order to route the traffic corresponding to the -scheduled labels on the allocated physical resources. MR can be connected to other MR (direct link) in the same cluster. MR can also be connected to more than one cluster -at the same time. It is also expected to using the UL signaling channels to relay measurements to the CH with which is connected. -A secondary role of some MR is to search, on behalf of the CH, for isolated nodes which need to be connected to the mesh. These MR use a special signaling resource (MRBCH) to -exchange basic topological parameters with the IN which then results in overall network topology updates. If several IN are contending for access with the cluster, -joint processing of the requests will be performed by the mesh during topology adjustments. The most likely nodes to assume this role will be those at the extremities -of the mesh. - -Either type of equipment can also assume the role of relay/gateway to a secondary network. ` - -In mesh topologies some nodes (CH or MR) assume the role of and edge router (from a layer 2/3 perspective). An edge router is either a CH or MR with an IP interface to -another network. The role of ER is to aggregate traffic (ingress) from IP flows to MPLS-like labels for transmission in the mesh. On reception it must demultiplex -traffic (degress) from MPLS-like labels to IP for traffic exiting the mesh. Edge routers, potentially all CH and MR, must have MAC-layer interfaces to IP in order to -perform these functions. - -Both OpenAirInterface topologies require Network Synchronization (NS) at least between adjacent clusters. This must be on the order of a few microseconds. Three mechanisms are -supported to ensure NS. Firstly, a secondary synchronization source (e.g. GPS) can be used as a common time reference by all nodes. Secondly, one CH (Primary CH) in the -network use a special synchronization signal which has longer range than the range of communication, in order to cover the region which a common time reference. This is -suitable for small networks. Finally the method of distributed relaying of synchronization is possible. This is a method by which all nodes propagate a time reference. Nodes -switch between reception (for timing acquisition and tracking) and transmission of the reference. This guarantees coverage of network synchronization over long distances -in the absence of a secondary synchronization source. - - -\subsection _L2_PROTOCOLS Layer 2 Protocols -Layer 2 is structured as below. It comprises: -- A IP/MPLS networking device (NAS DRIVER) responsible for provision of IP/MPLS layer services to Layer 2 and vice-versa -- An MPLS label-switching entity (NAS MPLS) responsible for routing/forwarding within the mesh network (MESH topology only) -- A Radio resource control (RRC) entity responsible for MAC layer signalling for configuration of logical flows (labels) and retrieval of measurement information. -- A Radio Link Control (RLC) entity which is responsible for automatic repeat request protocols (ARQ) and IP/MPLS packet segmentation -- A convergence protocol (PDCP) responsible for IP interface and related functions (header compression, ciphering, etc.) -- A scheduling and multiplexing unit (\ref _openair_mac_layer_specs_) responsible for the mapping between logical channels (labels and control-plane signalling) -and transport channels. It implements the interface with the PHY, which is the collection of transport channels as well as a primitives for -collection of PHY measurements and configuration of PHY parameters. - -\image latex layer2_stack_overview.pdf "Global View of OpenAirInterface Protocol Stack and Communication Primitives" -\image html layer2_stack_overview.png "Global View of OpenAirInterface Protocol Stack and Communication Primitives" - -These entities are described in the following subsections. - -\subsubsection _RRC_ Radio Resource Control (RRC) -The radio resource control entity is responsible for the L2 signalling implementing the radio channels establishment. It also implements the control of -measurement procedures described in Section 1.3.4. Its internal state machine controls the basic procedures for startup, monitoring of synchronization -through the measurement system and update of the nodes role in the network (Sections 1.3-0). - -RRC is responsible for configuration of all MAC entities (and PHY via MAC), both dynamic (during label establishment) and static (control channels). This functionality -is in response to event occurring in the interaction with L3 and based on dynamic measurements of radio quality. - -RRC signalling makes use of DCCH, CCCH and BCCH for transport of the various protocols. - - -\subsubsection _RLC_ Radio Link Control (RLC) -RLC segments IP packets. The segment size is configurable for each QoS class and is signalled by higher layers during route establishment. The sizes -are chosen based on the granularity of the underlying MAC/PHY resources (transport blocks). - -RLC is responsible for ARQ and indexing of SDUs from the user traffic and signalling SDUs from RRC. The SDU inputs from LS form the -set of radio bearers, and those from RRC the set of signalling radio bearers. It has two modes of functionality: acknowledged and unacknowledged. -Each logical channel can have an associated ARQ process which is managed by RLC. The ARQ mechanisms are based on Release 6 3GPP RLC (25.8xx). -The interface with RRC for configuration is not yet described. The interface with MAC is designed such that data for each logical channel is -buffered in data queues, whose occupancy can be measured by the MAC scheduling entity. - -\subsubsection _MAC_ MAC scheduling Entity (MAC) -The MAC entity is responsible for scheduling control plane and user-plane traffic on the physical OFDMA resources. -On transmission, the inputs to this entity are connected to data queues originating in the RLC layer which form the set of logical channels. The -control plane traffic is represented by logical channels which form the interface with the RLC. Logical channels contain both user-plane (originating -in the IP/MPLS entity via the PDCP entity) and control-plane traffic (originating in the RRC entity). MAC layer specifications are found in \ref _openair_mac_layer_specs_. -The MAC is responsible the transport channel interface which exchange data (MAC SDUs) and PHY measurement data for RRC measurement procedures. - -\subsection _PHY_PROCEDURES_MESH_ Physical Layer Procedures - Mesh Topology -\subsection _PHY_PROCEDURES_CELL_ Physical Layer Procedures - Cellular Topology - -\subsubsection _POWER_ON_CH_ Power-on procedures of a CH -This clause briefly describes the power-on procedure of a CH. The CH RRC receives basic cell configuration information (CHBCH/RACH configuration) from -L3 Radio Resource Management (RRM) and configures the MAC and RLC layers. The MAC, in turn, configures the static paramters of the PHY. Upon completion -of this initialization phase it enters the steady-state mode. - -\subsubsection _POWER_ON_UE_ Power-on procedures of a UE -This clause briefly describes the power-on procedures of a UE which is managed by the UE-RRC state machine. The first function is to search for at least one -existing CH in range which is under the responsibility of the PHY. This procedure attempts to analyze the received signal power over a pre-defined time period. If a -signal is detected on the desired carrier, the node attempts PHY synchronization using the pilots of the candidate CHs. The postulated frame start position is used -to demodulate the CHBCH resources. If the PHY returns an error-free CHBCH with acceptable receive quality, the node is said to be pre-synchronized to the CH. -It then attempts to decode the CHBCH of the rest of the CH in range. At the end of this stage, it has a list of acceptable CH. This procedure is repeated periodically, -until active communication is sought with the network. - -Upon passing to the state of active communication, it demodulates the CHBCH continuously from the CHs to obtain the UL-CCCH configurations as well as MCCH/MTCH. -Once configured, it attempts to establish a connection (connection request) with each of the candidates using the RACH resources of each CH. Upon successful completion -of the association procedure it is said to be synchronized to the CH and enters the steady-state mode for each CH. - -\subsubsection _CH_SS_OP_ CH Steady-state operation -In TTI N, the CH transmits all DL flows as determined by the CHBCH scheduler during the end of TTI N-2. Furthermore, it detects the UL-SACCH for all UE flows and the -UE-SACH for all flows. It also detects the RACH (CCCH). At the end of each TTI, once it has received all feedback indicators (channel and queuing), it invokes -the CHBCH scheduling entity to determine the allocations for TTI N+2. The sequence of operations after receiving flows from TTI N (towards the end of TTI N+1) is: - -Entity: RRC TX - --# generate BCCH and CCCH to be conveyed in TTI N+2 --# program new logical channels and measurement procedures starting in TTI N+2 based on L3 signaling requests --# generate signaling radio bearers (measurement requests, UE radio bearer/logical channel configuration) for TTI N+2, and invoke RLC - -Entity: MAC TX - --# Invoke MAC Scheduler for TTI N+2 allocations : compute DL_SACCH_PDU and UL_ALLOC_PDU for N+2, corresponding to PHY allocations in N+3. --# Generate CHBCH PDU for TTI N+2 --# Retrieve RLC SDUs and generate DL_SACH for TTI N+2 --# Generate MACPHY_DATA_REQ for TX transport channels in TTI N+2 - -MAC RX - --# Generate MACPHY_DATA_REQ for RX transport channels in TTI N+2 (based on previously scheduled UL_ALLOC_PDU received by UE in TTI N, decoded by end of TTI N+1) --# Invoked by PHY through macphy_data_confirm, the received flows are routed to RLC data queues and MAC signaling information is -stored for MAC TX scheduling in next TTI. The MACPHY_DATA_IND primitive (invoked by PHY) also provides CH RX measurements information in an UL_MEAS structure. - -RRC RX - --# Retrieve RACH and process association requests --# Retrieve signaling radio bearers from RLC --# Retrieve CH RX measurements from PHY/MAC - -This sequence is invoked at the end of each TTI by the system scheduler. - -\subsubsection _UE_SS_OP_ UE Steady-state operation - -In the steady-state of TTI N, the UE PHY demodulates the CHBCH. The CHBCH PDU is then available during TTI N+1 for the MAC. to determine the allocations of the CH and -itself in TTI N+2. Based on the decoded information, its scheduling entity generates the transmission for the next TTI and configures the PHY to demodulate the data for -which it is destination in the current TTI. The UE RRC acts on PHY/MAC measurements to maintain proper synchronization and received signal quality, for example by -detecting a loss of connection of degradation of service. The sequence of operations at the end of TTI N is - -Entity: MAC RX - --# Parse CHBCH_PDU --# Generate macphy_data_req for RX transport channels in TTI N+2 (based on previously scheduled UL_ALLOC received by UE in TTI N, decoded by end of TTI N+1) --# Invoked by PHY through macphy_data_confirm, the received flows are routed to RLC data queues and MAC signaling information is stored for MAC TX scheduling in next TTI. The reported PHY RF measurements (i.e. in DL_MEAS structure) are processed and used to generate UL_SACCH_FB. --# Process measurements for RRC measurement reports and invoke mac_meas_ind for each logical channel requiring a measurement report. - -Entity: RRC RX - --# Retrieve BCCH and CCCH and generate association requests --# Retrieve signaling radio bearers from RLC --# Retrieve UE RX measurements from PHY/MAC for L3 measurement reporting - -Entity: RRC TX - --# program new logical channels and measurement procedures starting in TTI N+2 based on L3 signaling requests signaled by CH-RRC --# generate signaling radio bearers (measurement reports, configuration ACKs) for TTI N+2, and invoke RLC - -Entity: MAC TX - --# Invoke MAC multiplexer for TTI N+2 allocations : compute UL_SACCH_FB and UL_SACCH_PDU for N+2, corresponding to PHY allocations in N+3. --# Generate CHBCH PDU for TTI N+2 --# Retrieve RLC SDUs and generate UL_SACH for TTI N+2 --# Generate MACPHY_DATA_REQ for UL_SACH in TTI N+2 - -\subsubsection _QOS_MEAS_PROC_ QoS Measurement Procedures - -CH RRC manages L3 measurement reports at L2 for nodes within the cell. Measurement reports are exchanged between UE and CH using a logical channel (DCCH) -for topological control signaling, and edge routers can provide these measurements to IP -Since the CH scheduler has access to low-level PHY measurements, the MAC layer is responsible for measurement reporting on behalf of the PHY and itself. -The CH obtains raw measurements of all links in the cell. RRC acquires these measurements from MAC scheduling entity. -Measurements are processed in nodes to the degree required for higher level services. For example nodes will extract link quality (rate/delay) indicators from -low-level services (MAC to L3 measurement messages) which are transported using special signaling flows offered by the MAC. This is then used for L2.5 topology -maintenance (radio-bearer (re)-assignment). Edge routers will extract L2.5 measurement information on labels to provide IP with quality indicators. - -The interface with RRC for measurement reports is very similar to existing Release 6 HSPA. The types of measurements are: -- periodic (or one-shot) with configurable reporting interval and total number of measurements -- event-driven - in order to handle degradation of QoS level or loss of connection. - -The available measurements for CH RRC(L2) are: -- RSSI (dBm) on physical resources corresponding to logical channel. -- Average SINR (dB) on physical resources corresponding to logical channel. -- Average number of transmission rounds (times 10) on transport channel associated with logical channel. -- Average residual block error rate (times 1000) on transport channel associated with logical channel (after HARQ!). -- Actual Spectral efficiency (bits/symbol times 10) of transport channel associated with logical channel. -*/ - -/** @defgroup _openair_specs_ OpenAirInterface Layer1/2 Specifications -* @defgroup physical_layer_ OpenAirInterface Physical Layer (PHY) Specifications -* @ingroup _openair_specs_ -* @{ -This clause specifies the PHY layer for a multiple-antenna orthogonal frequency-division multiple-access (OFDMA) system applied and -the generic openair MAC interface. -\image html PHY_arch.png "openair PHY" -\image latex PHY_arch.png "openair PHY" width=15cm -The specification is intended for reconfigurable equipment, so that actual parameters and mechanisms can be configured -prior to deployment of the equipment or potentially over-the-air, although the latter is not yet supported by any of the openair MAC implementations. The -PHY and MAC layers are tightly coupled so that the MAC entity can directly influence the occupied physical resources. The OFDMA system provides the means for -transmitting several multiple-bitrate streams (multiplexed over sub-carriers and antennas) in parallel. Moreover, PHY signaling strategies are included to -provide the means for exploiting channel state feedback at the transmitters in order to allow for advanced PHY allocation of OFDMA resources via the MAC. -Modulation and channel coding formats are generic allowing for specific techniques to be employed in different deployment scenarios although configurations -based on the 802.11a legacy standard (binary/quaternary phase shift keying BPSK/QPSK, 16-point quadrature amplitude modulation (16-QAM), -64-QAM, rate 1/2,2/3,3/4 punctured convolutional codes) are provided here. The specifications are not specific to any frequency band or bandwidth, -although the minimum expected channel bandwidth should not be less than 1 MHz. -*/ - -/** @defgroup _phy_scope Scope -* @ingroup physical_layer_ -* @{ -This subclause describes the PHY services provided to the openair MAC. The openair PHY consists of several protocol functions which provide the interface -between the MAC and PHY for allocation MAC layer PDUs to physical resources. Physical channels are used to convey signaling, data and training information -across the radio medium. OpenAirInterface implements the following physical channels: - --# The PCHSCH (Physical Clusterhead Synchronization Channel) is a pilot resource reserved to a clusterhead (CH) which is responsible for -delivering synchronization information to nodes in the cluster. This channel is used by nodes to acquire timing information regarding the -beginning of the TTI and to perform initial frequency offset adjustments with respect to the carrier frequency of the CH. The channel -is also used by adjacent clusterheads to synchronize the network, in order to facilitate inter-cluster communication under quality-of-service guarantees. --# The PCHBCH (Physical Cluster-head Broadcast Channel) is a signaling resrouce reserved to a clusterhead which is responsible for delivering layer 2/3 -protocol information to the nodes of the cluster. It can also used by the nodes in the cluster to acquire accurate timing and frequency synchronization information. --# the PRACH (Physical Random Access Channel) is a signaling resource used by a node to provide layer 2 protocol information to its clusterhead. --# the PCHSCH (Physical Clusterhead Synchronization Channel) is a pilot resource used by a CH to allow the UE/MR to estimate the channel of CH and to acquire timing synchronization. --# the PSCH (Physical Synchronization Channel) is a pilot resource used by a node to allow the CH to estimate the channel of an MR/UE. --# the PSACH (Physical Scheduled-Access Channel) is a multi-cast data resource used by a node or CH to send MAC data PDUs to one or more destinations in -parallel (using multi-antenna OFDMA). --# the PSACCH (Physical Scheduled-Access Control Channel) is a signaling resource used by a node to provide MAC protocol information to the destinations of its -transmissions as well as the CH. --# the PMRBCH (Physical Mesh Router Broadcast Channel) is a signaling resource used by a node to provide layer 2 broadcast protocol information to neighbouring nodes -outside the range of clusterheads. It is used by nodes in mesh network topologies to relay network synchronization and provide initial configuration information to - -Transport channels constitute the control and user plane interfaces between the MAC and PHY layers. The are used to exchange both data and measurement information -and are mapped onto the above physical channels. OpenAirInterface implements the following transport channels: - --# The CHBCH (Clusterhead Broadcast Channel) is the transport channel mapped to the PCHBCH. --# The RACH (Random-Access Channel) is the transport channel mapped to the PRACH. --# The DL-SACH (Downlink Scheduled-Access Channel) is the transport channel mapped to the PSACH. --# The UL/MR-SACH (Uplink or Mesh-Router Scheduled-Access Channel) is the transport channel with components mapped to both the PSACH and PSACCH. --# The MRBCH (Mesh-Router Broadcast Channel) is the transport channel mappted to the PMRBCH. - -During reception, all transport channels convey measurement information. -* @} -*/ - -/** @defgroup _phy_framing Framing and Channel Multiplexing -* @ingroup physical_layer_ -* @{ -*/ - - -/** @defgroup _framing_modulation TTI and Modulation Parameters -* @ingroup _phy_framing - -The physical layer uses OFDM symbols organized into frames (corresponding to TTIs) of complex baseband samples at a sampling rate of \f$ f_\mathrm{s} \f$ samples/s. The carrier frequency is denoted \f$f_c\f$. Each TTI is made up of \f$N_{\mathrm{symb}}\f$ OFDM symbols. OFDM symbols, \f$\mathbf{s}\f$, of length \f$N_\mathrm{s}\f$ samples contain two distinct parts,\f$\mathbf{s}_\mathrm{I}\f$ and \f$\mathbf{s}_\mathrm{E}\f$. - -OpenAirMesh framing is completely configurable, but the nominal OFDMA configuration is shown below - -\image html mesh_frame.png "OpenAir PHY Framing" -\image latex mesh_frame.pdf "OpenAir PHY Framing" width=15cm - -One frame consists of 64 OFDM symbols and is divided in a CH transmission time interval (TTI) and a MR TTI. The first four symbols of the CH TTI are reserved for pilot symbols. Each CH transmits one common pilot symbol (CHSCH$_0$) at position 0 and one dedicated pilot symbol (CHSCH\f$_i\f$) at position \f$i \in \{1,2,3\}\f$. This way we can ensure orthogonality between the pilots of different CH received at one MR. The pilot symbols are followed by the broadcast channel (CH-BCH). The rest of the CH TTI frame is reserved for the multiplexed scheduled access channels (CH-SACH). - -The MR TTI contains the random access channel (MR-RACH) with an associated pilot symbol (SCH$_0$). The next two symbols are reserved for pilots. Each MR transmits a pilot symbol SCH\f$_i\f$, \f$i \in \{1,2\}\f$ corresponding to the cluster it belongs to. The pilot symbols are followed by the uplink broadcast channel (MR-BCH) with an associated pilot symbol (MRSCH). The rest of the uplink frame contains the multiplexed scheduled access channels (MR-SACH). The end of the CH and MR TTIs are protected by a guard interval of two symbols. All pilots are designed for MIMO and/or Multiuser channel estimation at the corresponding end. - -MAC PDUs arrive at the MAC interface from different logical resources (control, broadcast, multiple-user data streams) in parallel at the start of each TTI and must be mapped to the available radio resources. Each PDU is scrambled, encoded with a CRC check, and encoded using a channel code with associated bit-interleaving. The output of the channel coding block contains the information content to be transfered across the channel via the modulator. The modulated information content, \f$\mathbf{s}_\mathrm{I}\f$, is built starting either from a frequency-domain signal (classical OFDM) or several time-domain signals (digital FDM). Both techniques yield what are denoted herein as OFDM symbols. In the first method (classical OFDM), \f$\mathbf{S}_\mathrm{I}\f$ is specified in the frequency-domain and is made up of \f$N_\mathrm{d}\f$ samples. This is transfered to the time-domain via the inverse discrete-time Fourier transform (DFT) yielding a time-domain signal also of length \f$N_\mathrm{d}\f$ samples, \f$\mathbf{s}_\mathrm{I}=\mathrm{idft}(\mathbf{S}_\mathrm{I})\f$. In the second method, up to \f$N_\mathrm{f}\f$ different time-domain signals each comprising \f$N_{\mathrm{d,2}}=\frac{N_\mathrm{d}}{N_\mathrm{f}}\f$ samples, where \f$N_\mathrm{f}\f$ denots the number of frequency groups making up an OFDM symbol. Here each signal \f$\mathbf{s}_{i}\f$ is transformed to the frequency-domain via an \f$N_\mathrm{d,2}\f$-dimensional DFT yielding \f$\mathbf{S}_i\f$ and the combined frequency-domain signal is the concatenation of the \f$\mathbf{S}_i\f$, \f$\mathbf{S}_\mathrm{I} = [\mathbf{S}_0 | \mathbf{S}_1 | \cdots | \mathbf{S}_{N_\mathrm{f}-1}]\f$ - -The redundant (or null) portion, \f$\mathrm{s}_\mathrm{E}\f$, comprises \f$N_\mathrm{c}=N_\mathrm{s}-N_\mathrm{d}\f$ extra samples, and is concatenated to \f$\mathbf{s}_\mathrm{I}\f$. It is either a cyclic extension or zeros. The overall symbol is \f$\mathbf{s} = [\mathbf{s}_\mathrm{E} | \mathbf{s}_\mathrm{I}]\f$ (prefix configuration) or \f$\mathbf{s} = [\mathbf{s}_\mathrm{I} | \mathbf{s}_\mathrm{E}]\f$ (suffix configuration). - -The cyclic prefix or zero-padding is used to absorb a channel with a delay spread (including propagation delay of the primary paths) equal to its length so that adjacent OFDM symbols do not overlap in time. If the cyclic prefix method is used, then \f$s_{\mathrm{E},i} = s_{\mathrm{I},N_\mathrm{d}-N_\mathrm{c}+i}, i=0,\cdots,N_\mathrm{c}-1\f$, whereas if the cyclic suffix method is used, then \f$s_{\mathrm{E},i} = s_{\mathrm{I},i}, i=0,\cdots,N_\mathrm{c}-1\f$ otherwise \f$s_{\mathrm{E},i}=0, i=0,\cdots,N_\mathrm{c}-1\f$. The value \f$N_\mathrm{c}\f$ should be chosen based on the maximum propagation delay in the system. For outdoor channels this will be on the order of a few microseconds. In addition, for large \f$N_\mathrm{c}\f$, the value of \f$N_\mathrm{d}\f$ should also be large so that the overhead due to the propagation channel be kept to a minimum. \f$N_\mathrm{d}\f$ should be large enough to allow for frequency-domain multiplexing of user data streams if OFDMA is employed. Very large \f$N_\mathrm{c},N_\mathrm{d}\f$ are probably not required for openair except perhaps in the case of long-distance point-to-point links -(e.g. to link different hotspot areas). - -OFDM symbols typically provide for a certain spectral roll-off to satisfy RF spectral mask requirements and aid in transmit filtering and adjacent channel suppression. This is usually accomplished by inserting \f$N_{\mathrm{z}}\f$ zeros in \f$\mathbf{S}_f\f$. The total number of useful samples in \f$\mathbf{S}_f\f$ is therefore \f$N_\mathrm{d}-N_\mathrm{z}\f$. - -For use in OFDMA multiplexing, the useful carriers can be split into \f$N_\mathrm{f}\f$ groups of contiguous carriers. Each group of carriers can be used to transmit a different data stream in the same OFDM symbol. This particularly useful for achieving dynamic FDMA on the uplink of a cellular system. - -A summary of the framing parameters is given in following table and is represented by the primitive PHY_FRAMING. It represents part of the static configuration of the air-interface and is set during the initialization phase of the equipment via the MAC-layer interface (see \ref _mac_phy_primitives_,MACPHY_CONFIG_REQ) . - -*/ - - -/** @defgroup _chsch_sig Clusterhead Synchronization Channel (P-CHSCH,S-CHSCH) Signaling Format -* @ingroup _phy_framing - -The clusterhead synchronization channel is a signaling channel generated in the PHY layer and is comprised of -\f$N_{\mathrm{s,CHSCH}}(N_\mathrm{d}+N_\mathrm{c})\f$ samples, or the equivalent of one \f$N_{\mathrm{s,CHSCH}}\f$ OFDM symbols. The main purposes of -this channel are - --# Timing (TTI/symbol) synchronization for nodes inside the cluster --# Frequency sychronization for nodes inside the cluster --# Timing (TTI/symbol) sychronization for clusterheads in adjacent clusters --# Frequency synchronization for clusterheads in adjacent clusters - -It is emitted once per TTI in conjunction with the clusterhead broadcast channel (P-CHBCH,S-CHSCH). Aside from its primary purposes above, it is also -intended to be exploited for channel estimation prior to demodulation of the CHBCH, since the CHBCH does not comprise pilot signals and the clusterhead -does not use the MCH. The number of symbols required, \f$N_{\mathrm{s,CHSCH}}\f$, depend on the desired time and frequency acquisition precision. - -The x-CHSCH is a pseudo-random QPSK sequence defined in the frequency domain by the bit sequences -\f$\mathrm{Re}\{\mathbf{c}_i\}, \mathrm{Im}\{\mathbf{c}_i\}, i=0,1,\cdots,\lfloor(N_{\mathrm{d}} - N_{\mathrm{z}})N_{\mathrm{s,CHSCH}}/32 \rfloor -1\f$. -If multiple transmit antennas (up to \f$N_d/N_c\f$) are used on the same frequency carrier, the CHSCH sequence, -\f$\mathbf{c}_{\mathrm{CHSCH,2}}\f$, shall be cyclicly shifted by \f$iN_\mathrm{c}, i=1,2,\cdots,N_\mathrm{ant}\f$ samples on antenna \f$i\f$ prior to -cyclic extension. This is to allow nodes to estimate the different channels of the clusterhead efficiently in the frequency domain. - -The transmit power of the CHSCH shall be adjustable by higher layers in order to control the detection range of the clusterhead. - -The parameters of the CHSCH are summarized in the following table and represented by the primitive PHY_CHSCH - -*/ - - -/** @defgroup _CHBCH Clusterhead Broadcast Channel (P-CHBCH,S-CHBCH) Signaling Format -* @ingroup _phy_framing - - -The CHBCH is the signaling channel used by the DLC for passing basic protocol information from the clusterhead to the nodes in its -cluster. This information is used to distribute physical resources during the TTI and some additional protocol information -(association, QoS reservation, etc.). It is located in the first symbol in the TTI,\f$s_{\mathrm{CHBCH}}\f$. In the case of several -clusterheads operating on the same carrier frequency, the CHBCH of adjacent clusters (i.e. those within range of the CHSCH) cannot collide -and thus must be allocated different symbols in the TTI or use disjoint frequency carrier sets. The same is true of the CHBCH and MCH/RACH of -adjacent clusters. The time/frequency allocation of CHSCH/MCH/RACH across several clusters must be accomplished in a distributed fashion based on the -activation times of the different clusterheads and mobility of the clusters. This is beyond the scope of this preliminary specification. - -The CHBCH must use the lowest spectral efficiency (highest sensitivity) coded-modulation format in order to be detectable at large distances. -It will thus employ a rate 1/2 forward-error-correcting code with QPSK modulation \ref _phy_coded_modulation. Information will be coded -across \f$N_{\mathrm{s,CHBCH}}-1\f$ OFDM symbols using all non-zero carriers. Interleaving shall be performed across frequencies with depth -\f$IntDepth_{\mathrm{CHBCH}}\f$. \f$IntDepth_{\mathrm{CHBCH}}\f$ shall be an integer divisor of \f$N_{\mathrm{d}}-N_{\mathrm{z}}\f$. Prior to -forward-error correction coding, a CRC of length 32 bits shall be applied to the PDU arriving from the MAC layer interface. - -Channel estimation can be obtained from the CHSCH which is located in the adjacent OFDM symbols. The CHSCH symbols shall be found starting -in symbol number \f$\lfloor.5N_{\mathrm{symb}}\rfloor\f$ of the CHBCH. - -The number of bits per TTI delivered by the MAC layer interface (FEC + CRC) bits is determined by the formula -\f$(N_{\mathrm{symb}}-1)*(N_{\mathrm{d}}-N_{\mathrm{f}}) - 32\f$. - -If \f$N_\mathrm{pilot}\f$ additional pilot symbols per OFDM symbol are required to handle large frequency offsets due to high-mobility (Doppler) -or significant carrier frequency offsets due to the RF equipment, then these are to be placed at equally spaced positions starting from the -first non-zero carrier in each CHBCH symbol. These simply puncture the coded bit sequence. Care must be taken when choosing the value of -\f$N_\mathrm{f}\f$ with respect to \f$IntDepth_{\mathrm{CHBCH}}\f$ so that consecutive bits of the encoded sequence are not punctured. -A judicious choice would take \f$IntDepth_{\mathrm{CHBCH}}\f$ and \f$N_{\mathrm{d}}-N_{\mathrm{z}}\f$ to be relatively prime. - -In order to allow for multi-cell deployment the CHBCH can use a reduced set of subbands which is controlled by the parameter \f$FreqReuse\f$. It should be set to the maximum number of base stations. Let \f$N_{FreqGroup}\f$ be the number of carriers of one frequency group. Then, the set of carriers used by the \f$i^\mathrm{th}\f$ CHBCH \f$i=1,2,3\f$ (CHBCH 0 is unused) is given by -\f$\left\{((i-1) FreqReuse N_{pilot} ) + k*N_{FreqGroup}, k=0,\cdots,N_{Pilots}-1\right\}\f$. - -The transmit power of the CHBCH shall be adjustable by higher layers in order to control the detection range of the clusterhead. This value will be -transfered via higher layer signaling so that nodes may perform open-loop power control. The following table summarizes the parameters of the CHBCH -which are transfered from higher layers using the primitive PHY_CHBCH. - -*/ - - -/** @defgroup _RACH Random-Access Channel (RACH) Signaling Format -* @ingroup _phy_framing - - -The RACH is a signaling channel used only during the association phase of a node and for other management services. -Several RACHs can be used in parallel to reduce contention in dense networks, and the exact number are signaled by the higher layer. -This resource is not meant, however, to be used for intensive data transmission. Data streams consisting of small sporadic packets -could potentially use this channel if required. - -The RACH is subject to power control. The transmit power should be adjusted in a closed-loop fashion based on the -measured path loss between the node and the clusterhead. - -For adhoc/mesh configurations, one or more MCH are reserved for the RACH. For a cellular -scenario, a SACH resource is opened periodically for the RACH by the clusterhead. - -*/ - - -/** @defgroup _SACH Scheduled-Access (SACH) and Scheduled-Access Control Channel (SACCH) Signaling Format -* @ingroup _phy_framing - -The SACH/SACCH is a multiplexed resource containing both signaling information (Scheduled Access Control CHannel) and user plane traffic -(Scheduled Access CHannel). The SACH is a set of data streams multiplexed by multiple-antenna OFDMA containing user traffic for several -destinations. The SACCH contains low-layer protocol information regarding sequencing (for ARQ and channel decoding) and signaling for -channel feedback mechanisms. In AdHoc/Mesh configuration, the SACCH is a resource common to all destinations sharing the SACH and -its data is multiplexed with those of the SACH. In the cellular configuration, the SACCH -is located in the first allocated symbol and uses the lowest-order (highest protection) coded-modulation format. Aside from low-level signaling -it contains the allocation formats used by the set of streams in the SACH, specifically the coded-modulation formats and frequency-allocations in the -case of the AdHoc/Mesh configuration. In the downlink of a cellular configuration, the SACCH information is embedded in the CHBCH PDU. - -The transmission format of the SACH/SACCH can either use classical OFDM or digital FDM, and this is signaled by the higher layers. - -Each SACH/SACCH is made up of \f$N_{\mathrm{symb,SACH}}\f$ OFDM symbols. The number of symbols -used by a particular SACH in a particular TTI is broadcast via MAC-layer signaling in the CHBCH and depends QoS parameters and -measurements. It is thus a dynamic parameter known by all nodes in the cluster at the beginning of each TTI. - -A SACH/SACCH contains \f$N_\mathrm{pilot,SACCH}\f$ pilot symbols during the SACCH symbols to allow for multi-antenna wideband channel estimation, and -\f$N_\mathrm{pilot,SACH}\f$ pilot symbols per SACH symbol for carrier frequency offset tracking. The encoding rules for the SACCH -pilot symbols is identical to the MCH/RACH on the first transmit antenna. If multiple transmit antennas are employed, the pilot symbols for antenna -\f$i=0,1,\cdots,N_\mathrm{ant}\f$ in position $k$ is multiplied by the complex phasor sequence \f$e^{j*2*pi*kiN_\mathrm{p}/N_\mathrm{d}}\f$. -This phasor sequence ensures that the \f$N_\mathrm{ant}\f$ channel responses are orthogonal at the receiver provided -\f$N_\mathrm{ant}N_\mathrm{p}\leq N_\mathrm{d}\f$ and \f$N_\mathrm{p}\f$ is less than the maximum channel duration plus maximum propagation delay. - -Both \f$N_\mathrm{pilot,SACH}\f$ and \f$N_\mathrm{ant}\f$ are broadcast using higher layer signaling or pre-configured. - -The number of samples for SACH/SACCH data is -\f$N_\mathrm{samp,SACH} = N_\mathrm{symb,SACH}(N_\mathrm{d}-N_\mathrm{f} - N_\mathrm{pilot,SACCH} - N_\mathrm{pilot,SACH}) - 32\f$. -SACCH data is to be encoded using the lowest spectral efficiency coded-modulation format, namely a rate 1/2 forward error-correcting code with QPSK -modulation. If multiple transmit antennas are used, then the lowest spectral-efficiency BICM space-time code is to be employed. Prior to FEC coding a -CRC shall be computed on the SACCH data and should be concatenated to the tail of the information. The total number of -coded bits for the SACCH depends on the number of streams. It should be kept to a minimum with respect to the total number of data bits in the SACH -streams in order to guarantee efficiency. - -Since the SACH is a dynamically allocated resource based on channel quality measures, -sample interleaving across different OFDM carriers is not required. - -Prior to forward error-correction coding, a CRC of length 32 bits shall be applied to the PDU. - -The SACH is the only resource for which the output of the channel coding block is vectorial, in the case of multiple transmit antennas. Space-time signal -processing is therefore possible on the SACH data streams. Identical interleaving is performed on all antenna streams and the choice of coded-modulation -and space-time processing methods is determined by the MAC scheduler. A choice of 16 different formats are considered including some of the legacy -802.11a formats. The formats could potentially be reconfigurable and installed at run-time or over-the-air. This is discussed in \ref _phy_coded_modulation. -Each stream can use a separate coded-modulation format. - -Streams can use a subset of the OFDM carriers according to the frequency allocation vector as mentioned earlier. The allocations are chosen by the opportunistic -scheduling algorithm in the MAC layer in order to achieve multi-user diversity and potentially spatial-multiplexing. - -The configuration information for the SACH/SACCH resource are partially signaled by higher layers and partially computed dynamically by the scheduling algorithm in the MAC. They are described by the primitive PHY_SACH summarized in the following table. - - -*/ - -/*! \brief Extension Type */ -typedef enum { - CYCLIC_PREFIX, - CYCLIC_SUFFIX, - ZEROS, - NONE -} Extension_t; - - -/*! \brief Transmit Signal Format */ -typedef enum { - OFDM=0, - Digital_FDM -} Signal_format_t; - - -/*! \brief PHY Framing Structure -*/ - -typedef struct PHY_FRAMING { - u_long fc_khz; /*!< \brief Carrier Frequency (kHz)*/ - u_long fs_khz; /*!< \brief Sampling Frequency (kHz)*/ - u_short Nsymb ; /*!< \brief Number of OFDM Symbols per TTI */ - u_short Nd; /*!< \brief Number of OFDM Carriers */ - u_char log2Nd; /*!< \brief Log2 of Number of OFDM Carriers */ - u_short Nc; /*!< \brief Number of Prefix Samples*/ - u_short Nz; /*!< \brief Number of Zero Carriers*/ - u_char Nf; /*!< \brief Number of Frequency Groups*/ - Extension_t Extension_type; /*!< \brief Prefix method*/ -} PHY_FRAMING; - - -/*! \brief PHY_CHSCH Configuration Structure -*/ - -typedef struct PHY_CHSCH { - u_short symbol; /*!< \brief First Symbol of CHSCH in TTI */ - u_short Nsymb; /*!< \brief Number of Symbols of CHSCH in TTI*/ - u_char dd_offset; - u_long chsch_seq_re[32]; /*!< \brief Real part of \f$\mathbf{c}_i\f$ \f$(0\cdots n_1-1 \mathrm{LSBs})\f$*/ - u_long chsch_seq_im[32]; /*!< \brief Imaginary part of \f$\mathbf{c}_i\f$ \f$(0\cdots n_1-1 \mathrm{LSBs})\f$*/ - char CHSCH_POWER_dBm; /*!< \brief Average CHSCH Transmit Power*/ -} PHY_CHSCH; - -/*! \brief PHY_SCH Configuration Structure -*/ -typedef struct PHY_SCH { - u_short Nsymb; /*!< \brief Number of Symbols of SCH in TTI */ - u_char dd_offset; - u_long sch_seq_re[32]; /*!< \brief Real part of \f$\mathbf{c}_i\f$ \f$(0\cdots n_1-1 \mathrm{LSBs})\f$*/ - u_long sch_seq_im[32]; /*!< \brief Imaginary part of \f$\mathbf{c}_i\f$ \f$(0\cdots n_1-1 \mathrm{LSBs})\f$*/ - char SCH_POWER_dBm; /*!< \brief Average SCH Transmit Power*/ -} PHY_SCH; - - -/*! \brief PHY_CHBCH Configuration Structure -*/ - -typedef struct PHY_CHBCH { - u_short symbol; /*!< \brief First Symbol of CHBCH in TTI */ - u_short Nsymb; /*!< \brief Number of Symbols of CHBCH in TTI */ - u_short IntDepth; /*!< \brief Frequency Interleaving depth of CHBCH */ - u_char dd_offset; - u_short Npilot; /*!< \brief Number of pilot symbols in CHBCH */ - u_long pilot_re[8]; /*!< \brief Pilot symbols (Real part) */ - u_long pilot_im[8]; /*!< \brief Pilot symbols (Imag part) */ - u_char FreqReuse; /*!< \brief Frequency Reuse Factor */ - u_char FreqReuse_ind; /*!< \brief Frequency Reuse Index */ - char CHBCH_POWER_dBm; /*!< \brief Average CHBCH Transmit Power*/ -} PHY_CHBCH; - -typedef struct PHY_MRBCH { - u_short symbol; /*!< \brief First Symbol of MRBCH in TTI */ - u_short Nsymb; /*!< \brief Number of Symbols of MRBCH in TTI */ - u_short IntDepth; /*!< \brief Frequency Interleaving depth of MRBCH */ - u_char dd_offset; - u_short Npilot; /*!< \brief Number of pilot symbols in MRBCH */ - u_long pilot_re[8]; /*!< \brief Pilot symbols (Real part) */ - u_long pilot_im[8]; /*!< \brief Pilot symbols (Imag part) */ - u_char FreqReuse; /*!< \brief Frequency Reuse Factor */ - u_char FreqReuse_ind; /*!< \brief Frequency Reuse Index */ - char MRBCH_POWER_dBm; /*!< \brief Average MRBCH Transmit Power*/ -} PHY_MRBCH; - -/*! \brief PHY SACH/SACCH Configuration Structure -*/ - - -typedef struct PHY_SACH { - Signal_format_t Signal_format; /*!< \brief Transmit Signal format of SACH/SACCH*/ - u_char Npilot; /*!< \brief Number of pilot symbols */ - u_long pilot_re[8]; /*!< \brief Pilot symbols (real part) */ - u_long pilot_im[8]; /*!< \brief Pilot symbols (imag part) */ - char SACH_POWER_dBm; /*!< \brief Average MCH/RACH Transmit Power*/ -} PHY_SACH; - - -/* @}*/ - - - -/** @defgroup _phy_coded_modulation Coded Modulation and H-ARQ -* @ingroup physical_layer_ -* @{ -OpenAirMesh makes use of punctured binary codes (64-state rate 1/2 convolutional or 8-state rate 1/3 3GPP/LTE Turbo code). -Puncturing can use either 3GPP rate matching or random puncturing in order to fine tune the coding rate to adapt to -configurable transport block sizes delivered to PHY by the MAC. The overall coding sub-system is shown in -Figure below. New transport blocks arriving from the MAC layer (based on multi-user scheduling) are coded -using a CRC extension and the chosen binary code. These are then fed to the active transport block buffer along with -those that are to be retransmitted. Each transmitted block is punctured and then passed to a bit-interleaver and -modulation mapper (BICM). OpenAirMesh supports QPSK, 16-QAM and 64-QAM modulation. - -\image html openair_coding.png "Coded Modulation Subsystem" -\image latex openair_coding.png "Coded Modulation Subsystem" width=15cm - -The transmitted transport blocks can be split into to two spatial streams in the case of point-to-point MIMO transmission. -Each stream receives an adjustable amplitude and then each is passed to a different (orthogonal) space-time parser which -guarantees that both streams use different antennas in the same time/frequency dimension. This allows for low-complexity -successive detection at the receiver and maximizes diversity against fading. This is a form of superposition coding since -the two streams are combined additively in the air through the use of multiple transmit antennas. - -A second design objective for this coding strategy, in addition to low-complexity point-to-point MIMO operation, is that -the same transmitter and receiver structure can be used in a distributed MIMO scenario. Here one spatial stream is used -at each source and the second stream originates in another part of the network, either in the same cluster or an adjacent -cluster. Co-operation is needed in order to guarantee different STF parsing for the two streams so that they can be -decoupled at the SIC receiver. A particular user can decode both streams or simply select the one it requires. - -*/ -/** @defgroup _phy_scrambling Transport block Scrambling -* @ingroup _phy_coded_modulation - -Each transport block is scrambled using the LFSR shown in the following figure with a random initial state -in the LFSR determined at deployment time. The LFSR is used in the to descramble the SDU. Scrambling is always -performed on all transport channels. - -\image html scrambler.png "MAC SDU Scrambling" -\image latex scrambler.png "MAC SDU Scrambling" width=15cm - -\note More information on Linear feedback shift register (LFSR) can be found on http://homepage.mac.com/afj/lfsr.html or http://www-math.cudenver.edu/~wcherowi/courses/m5410/m5410fsr.html -*/ - -/** @defgroup _phy_crc Cyclic Redundancy Check -* @ingroup _phy_coded_modulation - -For the purpose of error-detection a cyclic-redundancy check (CRC) is applied to every transport block entering the -PHY coding subsystem, including those destined for the CHBCH,MCH, RACH and SACCH. To the latter are a applied an -8-bit systematic CRC defined by the generator \f$g_8(D)=1+D+D^3+D^4+D^7+D^8\f$. Data on the SACH is encoded using a -24-bit CRC defined by the generator \f$g_{16}(D)=1+D^5+D^{12}+D^{15}\f$. -\note: Basic information about CRC can be found at: http://www.mathpages.com/home/kmath458.htm or http://utopia.knoware.nl/users/eprebel/Communication/CRC/ -*/ - -/**@defgroup _phy_conv_cod Convolutional Coding -* @ingroup _phy_coded_modulation - -For coded-modulation formats using convolutional coding, the 802.11a rate 1/2 64-state convolutional coder shown -below shall be applied to the scrambled and parity-checked transport blocks. - -\image html convolutional.png "802.11a Convolutional Code" -\image latex convolutional.png "802.11a Convolutional Code" width=15cm - -*/ - -/** @defgroup _phy_puncturing_ Puncturing -* @ingroup _phy_coded_modulation - -Random puncturing makes use of a 32-bit Tausworthe random number generator. Let \f$S_i,i\in\{0,1,2\}\f$ be -the 32-bit initial values of the generator state given by - -\f$S_0(0) = \mathrm{1E23D852} + 16s\f$ - -\f$S_1(0) = \mathrm{81F38A1C} + 16s\f$ - -\f$S_2(0) = \mathrm{FE1A133E} + 16s\f$ - -where \f$s\f$ is a seed. The seed is typically different for each transport block and each round in the -HARQ protocol. It can be also used for layer 1 encryption. - -The state recursions at iteration \f$n\f$ are given by - -\f$b_0(n)=((2^{13}S_0(n-1))\oplus S_0(n-1))2^{-19}\f$ - -\f$b_1(n)=((2^{2}S_1(n-1))\oplus S_1(n-1))2^{-25}\f$ - -\f$b_2(n)=((2^{3}S_2(n-1))\oplus S_2(n-1))2^{-11}\f$ - -\f$S_0(n)=((S_0(n-1)\mathrm{and}\mathrm{FFFFFFFE})2^{12})\oplus b_0(n)\f$ - -\f$S_1(n)=((S_1(n-1)\mathrm{and}\mathrm{FFFFFFF8})2^{4})\oplus b_0(n)\f$ - -\f$S_2(n)=((S_2(n-1)\mathrm{and}\mathrm{FFFFFFF0})2^{17})\oplus b_0(n)\f$ - -and the output of the generator is \f$U(n)=S_0(n)\oplus S_1(n)\oplus S_2(n)\f$. - -Let \f$N_c\f$ be the number of coded bits after puncturing, \f$N_i\f$ be the number of input bits and -\f$N_{\mathrm{bps}}\f$ be the number bits per symbol \f$N_{\mathrm{bps}}\in\{2,4,6\}\f$. Let the -input sequence be denoted \f$c[i],i\in\{0,1,\cdots,N_i-1\}\f$. The -Tausworthe puncturing procedure is achieved according to the following algorithm for a rate 1/2 binary code: - -1. Based on \f$N_c\f$, \f$N_i\f$ check that the rate falls between (\f$\frac{N_{\mathrm{bps}}}{4}\f$,\f$\frac{3N_{\mathrm{bps}}}{8}\f$), -otherwise declare an error. - -2. Set the number of punctured bits to \f$N_p\leftarrow (N_i-N_c)/N_{\mathrm{bps}}\f$. - -3. Initially mark all \f$N_c\f$ coded bits to be transmitted. - -4. Set the initial seed of the Tausworthe to the function value \f$\mathrm{s}\f$ - -5. Set \f$N_{i2}\leftarrow \lfloor N_i/N_{\mathrm{bps}}\rfloor \f$. - -6. Set \f$i\leftarrow0\f$ - -7. Let \f$U(i)\f$ be the \f$i^{\mathrm{th}}\f$ output of the Tausworthe generator and -\f$U'(i)=U(i)\mathrm{mod}2^{\lceil \log_2(N_{i2})\rceil}\f$ - -8. if \f$U'(i) < N_{i2}\f$ and \f$\mathrm{c[U'(i)]}\f$ is not already punctured go to 10 - -9. goto 7 - -10. Mark \f$c[U' + jN_{i2}])\f$ as punctured for \f$j=0,1,\cdots,N_{\mathrm{bps}}-1\f$. - -11. Set \f$i\leftarrow i+1\f$ - -12. if \f$i<N_{i2}\f$ goto 7 -*/ - -/** @defgroup _phy_interl Bit-Interleaving and Modulation Mapping -* @ingroup _phy_coded_modulation - -The interleaving depth for CHBCH,MCH,RACH and SACCH in the multiplexing sub-block is chosen to ensure sufficient separation in frequency -for adjacent coded outputs, and thus maximize frequency diversity. For coded-modulation formats 0-5, let \f$D=(N_\mathrm{d}-N_\mathrm{z})/IntDepth\f$ where -\f$IntDepth\f$ depends on the particular transport channel at hand. Each output bit from the convolutional coder, \f$c_i\f$, shall be placed in the set -\f$C_{i\mathrm{mod}D}\f$. The bits in each set are permuted based on a pseudo-random sequence and then combined to form 2,4 or 6-tuples depending on the modulation -order of the coded-modulation format. The interleaving permutation sequence depends on \f$D\f$ and the number of coded bits. - -For the SACH, \f$D\f$ is the number of allocated frequency groups. The above interleaving strategy shall be applied with this value. - -The QAM modulated symbols are mapped according to the Gray mapping as shown in the following figures. QAM symbols must be scaled to -ensure constant average energy independent of the modulation order. The scaling factors are \f$1/\sqrt(2),1/\sqrt{10}\f$ and \f$1/\sqrt{42}\f$ for -QPSK, 16-QAM and 64-QAM respectively. - -\image html QAMmodulation.png "QAM Modulation Mapping" -\image latex QAMmodulation.png "QAM Modulation Mapping" width=15cm - -* @} -* @} -* @defgroup _openair_mac_layer_specs_ MAC Layer (MAC) Specifications -* @ingroup _openair_specs_ -*/ - - -#endif /*__PHY_DEFS_SPEC_H__ */ - - - - - - - - - - - - - - - diff --git a/openair1/PHY/spec_defs_top.h b/openair1/PHY/spec_defs_top.h deleted file mode 100755 index 8f647f1eacc676087f545725ff0b778e445d6a19..0000000000000000000000000000000000000000 --- a/openair1/PHY/spec_defs_top.h +++ /dev/null @@ -1,68 +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 - - *******************************************************************************/ -#ifndef __PHY_SPEC_DEFS_TOP_H__ -#define __PHY_SPEC_DEFS_TOP_H__ - -#include "types.h" - - - -/*! \brief Extension Type */ -typedef enum { - CYCLIC_PREFIX, - CYCLIC_SUFFIX, - ZEROS, - NONE -} Extension_t; - - -/// mod_sym_t is the type of txdataF -#ifdef IFFT_FPGA -typedef unsigned char mod_sym_t; -#else -typedef int mod_sym_t; -#endif //IFFT_FPGA - - -#endif /*__PHY_SPEC_DEFS_TOP_H__ */ - - - - - - - - - - - - - - - diff --git a/openair1/PHY/vars.h b/openair1/PHY/vars.h index 294105affa07d212288718f18e7abd14a0d738d1..3d940d4a94a2b58b52af104f884783f3fa0beacd 100755 --- a/openair1/PHY/vars.h +++ b/openair1/PHY/vars.h @@ -77,7 +77,7 @@ unsigned char NB_RN_INST=0; unsigned char NB_INST=0; #endif -unsigned int ULSCH_max_consecutive_errors = 10; +unsigned int ULSCH_max_consecutive_errors = 20; int number_of_cards; diff --git a/openair1/SCHED/defs.h b/openair1/SCHED/defs.h index 8692a31f1249a49f390d26a3bd1ba13adf12f0e1..af6acca88002f29def1e24dd2e45db68140ee062 100644 --- a/openair1/SCHED/defs.h +++ b/openair1/SCHED/defs.h @@ -405,7 +405,7 @@ void remove_harq_pid_from_freelist(LTE_eNB_DLSCH_t *DLSCH_ptr, int harq_pid); int8_t find_ue(uint16_t rnti, PHY_VARS_eNB *phy_vars_eNB); int32_t add_ue(int16_t rnti, PHY_VARS_eNB *phy_vars_eNB); -int32_t remove_ue(uint16_t rnti, PHY_VARS_eNB *phy_vars_eNB,uint8_t abstraction_flag); +int mac_phy_remove_ue(module_id_t Mod_idP,rnti_t rnti); void process_timing_advance(module_id_t Mod_id,uint8_t CC_id,int16_t timing_advance); void process_timing_advance_rar(PHY_VARS_UE *phy_vars_ue,uint16_t timing_advance); diff --git a/openair1/SCHED/phy_mac_stub.c b/openair1/SCHED/phy_mac_stub.c index 6e90960bfc2d2f12804c3d745deba8e95d260e6e..5ed1b6837d2a785aceaa31adef30317716b26c90 100644 --- a/openair1/SCHED/phy_mac_stub.c +++ b/openair1/SCHED/phy_mac_stub.c @@ -40,8 +40,6 @@ #include "PHY/defs.h" #include "PHY/extern.h" -#include "MAC_INTERFACE/defs.h" -#include "MAC_INTERFACE/extern.h" #include "SCHED/defs.h" #include "SCHED/extern.h" #include "LAYER2/MAC/extern.h" @@ -53,12 +51,12 @@ void fill_dci(DCI_PDU *DCI_pdu, uint8_t sched_subframe, PHY_VARS_eNB *phy_vars_eNB) { - int i; //uint8_t cooperation_flag = phy_vars_eNB->cooperation_flag; uint8_t transmission_mode = phy_vars_eNB->transmission_mode[0]; uint32_t rballoc = 0x7FFF; //uint32_t rballoc2 = 0x000F; + uint32_t rballoc_test = 0xFFFF; int subframe = phy_vars_eNB->proc[sched_subframe].subframe_tx; LTE_eNB_DLSCH_t *DLSCH_ptr = phy_vars_eNB->dlsch_eNB[0][0]; @@ -145,7 +143,7 @@ void fill_dci(DCI_PDU *DCI_pdu, uint8_t sched_subframe, PHY_VARS_eNB *phy_vars_e DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI1A_10MHz_FDD_t; ((DCI1A_10MHz_FDD_t*)&bcch_pdu)->type = 1; ((DCI1A_10MHz_FDD_t*)&bcch_pdu)->vrb_type = 0; - ((DCI1A_10MHz_FDD_t*)&bcch_pdu)->rballoc = computeRIV(25,10,3); + ((DCI1A_10MHz_FDD_t*)&bcch_pdu)->rballoc = computeRIV(50,10,3); ((DCI1A_10MHz_FDD_t*)&bcch_pdu)->ndi = phy_vars_eNB->proc[sched_subframe].frame_tx&1; ((DCI1A_10MHz_FDD_t*)&bcch_pdu)->rv = 1; ((DCI1A_10MHz_FDD_t*)&bcch_pdu)->mcs = 1; @@ -156,7 +154,7 @@ void fill_dci(DCI_PDU *DCI_pdu, uint8_t sched_subframe, PHY_VARS_eNB *phy_vars_e DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI1A_10MHz_TDD_1_6_t; ((DCI1A_10MHz_TDD_1_6_t*)&bcch_pdu)->type = 1; ((DCI1A_10MHz_TDD_1_6_t*)&bcch_pdu)->vrb_type = 0; - ((DCI1A_10MHz_TDD_1_6_t*)&bcch_pdu)->rballoc = computeRIV(25,10,3); + ((DCI1A_10MHz_TDD_1_6_t*)&bcch_pdu)->rballoc = computeRIV(50,10,3); ((DCI1A_10MHz_TDD_1_6_t*)&bcch_pdu)->ndi = phy_vars_eNB->proc[sched_subframe].frame_tx&1; ((DCI1A_10MHz_TDD_1_6_t*)&bcch_pdu)->rv = 1; ((DCI1A_10MHz_TDD_1_6_t*)&bcch_pdu)->mcs = 1; @@ -172,7 +170,7 @@ void fill_dci(DCI_PDU *DCI_pdu, uint8_t sched_subframe, PHY_VARS_eNB *phy_vars_e DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI1A_20MHz_FDD_t; ((DCI1A_20MHz_FDD_t*)&bcch_pdu)->type = 1; ((DCI1A_20MHz_FDD_t*)&bcch_pdu)->vrb_type = 0; - ((DCI1A_20MHz_FDD_t*)&bcch_pdu)->rballoc = computeRIV(25,10,3); + ((DCI1A_20MHz_FDD_t*)&bcch_pdu)->rballoc = computeRIV(100,10,3); ((DCI1A_20MHz_FDD_t*)&bcch_pdu)->ndi = phy_vars_eNB->proc[sched_subframe].frame_tx&1; ((DCI1A_20MHz_FDD_t*)&bcch_pdu)->rv = 1; ((DCI1A_20MHz_FDD_t*)&bcch_pdu)->mcs = 1; @@ -183,7 +181,7 @@ void fill_dci(DCI_PDU *DCI_pdu, uint8_t sched_subframe, PHY_VARS_eNB *phy_vars_e DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI1A_20MHz_TDD_1_6_t; ((DCI1A_20MHz_TDD_1_6_t*)&bcch_pdu)->type = 1; ((DCI1A_20MHz_TDD_1_6_t*)&bcch_pdu)->vrb_type = 0; - ((DCI1A_20MHz_TDD_1_6_t*)&bcch_pdu)->rballoc = computeRIV(25,10,3); + ((DCI1A_20MHz_TDD_1_6_t*)&bcch_pdu)->rballoc = computeRIV(100,10,3); ((DCI1A_20MHz_TDD_1_6_t*)&bcch_pdu)->ndi = phy_vars_eNB->proc[sched_subframe].frame_tx&1; ((DCI1A_20MHz_TDD_1_6_t*)&bcch_pdu)->rv = 1; ((DCI1A_20MHz_TDD_1_6_t*)&bcch_pdu)->mcs = 1; @@ -233,14 +231,16 @@ void fill_dci(DCI_PDU *DCI_pdu, uint8_t sched_subframe, PHY_VARS_eNB *phy_vars_e if (phy_vars_eNB->lte_frame_parms.frame_type == FDD) { DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI1_5MHz_FDD_t; - ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->rballoc = rballoc; + ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->rballoc = rballoc; //computeRIV(25,10,3); ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->TPC = 0; ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->harq_pid = DLSCH_ptr->harq_pid_freelist[DLSCH_ptr->head_freelist]; ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->mcs = openair_daq_vars.target_ue_dl_mcs; //((DCI1_5MHz_FDD_t *)&dlsch_pdu)->mcs = (unsigned char) ((phy_vars_eNB->frame%1024)%28); ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->ndi = phy_vars_eNB->proc[sched_subframe].frame_tx&1; ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->rv = 0; - memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],(void *)&dlsch_pdu,sizeof(DCI1_5MHz_TDD_t)); + ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->rah = 0; + + memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],(void *)&dlsch_pdu,sizeof(DCI1_5MHz_FDD_t)); /* //user2 @@ -263,7 +263,7 @@ void fill_dci(DCI_PDU *DCI_pdu, uint8_t sched_subframe, PHY_VARS_eNB *phy_vars_e } else { DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI1_5MHz_TDD_t; - ((DCI1_5MHz_TDD_t *)&dlsch_pdu)->rballoc = rballoc; + ((DCI1_5MHz_TDD_t *)&dlsch_pdu)->rballoc = rballoc; //computeRIV(25,10,3); ((DCI1_5MHz_TDD_t *)&dlsch_pdu)->TPC = 0; ((DCI1_5MHz_TDD_t *)&dlsch_pdu)->dai = 0; ((DCI1_5MHz_TDD_t *)&dlsch_pdu)->harq_pid = DLSCH_ptr->harq_pid_freelist[DLSCH_ptr->head_freelist]; @@ -271,6 +271,7 @@ void fill_dci(DCI_PDU *DCI_pdu, uint8_t sched_subframe, PHY_VARS_eNB *phy_vars_e //((DCI1_5MHz_TDD_t *)&dlsch_pdu)->mcs = (unsigned char) ((phy_vars_eNB->frame%1024)%28); ((DCI1_5MHz_TDD_t *)&dlsch_pdu)->ndi = phy_vars_eNB->proc[sched_subframe].frame_tx&1; ((DCI1_5MHz_TDD_t *)&dlsch_pdu)->rv = 0; + ((DCI1_5MHz_TDD_t *)&dlsch_pdu)->rah = 0; memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],(void *)&dlsch_pdu,sizeof(DCI1_5MHz_TDD_t)); /* @@ -289,6 +290,7 @@ void fill_dci(DCI_PDU *DCI_pdu, uint8_t sched_subframe, PHY_VARS_eNB *phy_vars_e ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->mcs = openair_daq_vars.target_ue_dl_mcs; ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->ndi = 1; ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->rv = 0; + ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->rah = 0; memcpy((void*)&DCI_pdu->dci_alloc[1].dci_pdu[0],(void *)&((DCI1_5MHz_FDD_t *)&dlsch_pdu)->,sizeof(DCI1_5MHz_TDD_t)); */ } @@ -300,14 +302,16 @@ void fill_dci(DCI_PDU *DCI_pdu, uint8_t sched_subframe, PHY_VARS_eNB *phy_vars_e if (phy_vars_eNB->lte_frame_parms.frame_type == FDD) { DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI1_10MHz_FDD_t; - ((DCI1_10MHz_FDD_t *)&dlsch_pdu)->rballoc = rballoc; + ((DCI1_10MHz_FDD_t *)&dlsch_pdu)->rballoc = rballoc; //computeRIV(50,10,3); ((DCI1_10MHz_FDD_t *)&dlsch_pdu)->TPC = 0; ((DCI1_10MHz_FDD_t *)&dlsch_pdu)->harq_pid = DLSCH_ptr->harq_pid_freelist[DLSCH_ptr->head_freelist]; ((DCI1_10MHz_FDD_t *)&dlsch_pdu)->mcs = openair_daq_vars.target_ue_dl_mcs; //((DCI1_10MHz_FDD_t *)&dlsch_pdu)->mcs = (unsigned char) ((phy_vars_eNB->frame%1024)%28); ((DCI1_10MHz_FDD_t *)&dlsch_pdu)->ndi = phy_vars_eNB->proc[sched_subframe].frame_tx&1; ((DCI1_10MHz_FDD_t *)&dlsch_pdu)->rv = 0; - memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],(void *)&dlsch_pdu,sizeof(DCI1_10MHz_TDD_t)); + ((DCI1_10MHz_FDD_t *)&dlsch_pdu)->rah = 0; + + memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],(void *)&dlsch_pdu,sizeof(DCI1_10MHz_FDD_t)); /* //user2 @@ -325,12 +329,13 @@ void fill_dci(DCI_PDU *DCI_pdu, uint8_t sched_subframe, PHY_VARS_eNB *phy_vars_e ((DCI1_10MHz_FDD_t *)&dlsch_pdu)->mcs = openair_daq_vars.target_ue_dl_mcs; ((DCI1_10MHz_FDD_t *)&dlsch_pdu)->ndi = 1; ((DCI1_10MHz_FDD_t *)&dlsch_pdu)->rv = 0; + ((DCI1_10MHz_FDD_t *)&dlsch_pdu)->rah = 0; memcpy((void*)&DCI_pdu->dci_alloc[1].dci_pdu[0],(void *)&((DCI1_10MHz_FDD_t *)&dlsch_pdu)->,sizeof(DCI1_10MHz_TDD_t)); */ } else { DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI1_10MHz_TDD_t; - ((DCI1_10MHz_TDD_t *)&dlsch_pdu)->rballoc = rballoc; + ((DCI1_10MHz_TDD_t *)&dlsch_pdu)->rballoc = rballoc; //computeRIV(50,10,3); ((DCI1_10MHz_TDD_t *)&dlsch_pdu)->TPC = 0; ((DCI1_10MHz_TDD_t *)&dlsch_pdu)->dai = 0; ((DCI1_10MHz_TDD_t *)&dlsch_pdu)->harq_pid = DLSCH_ptr->harq_pid_freelist[DLSCH_ptr->head_freelist]; @@ -338,6 +343,7 @@ void fill_dci(DCI_PDU *DCI_pdu, uint8_t sched_subframe, PHY_VARS_eNB *phy_vars_e //((DCI1_10MHz_TDD_t *)&dlsch_pdu)->mcs = (unsigned char) ((phy_vars_eNB->frame%1024)%28); ((DCI1_10MHz_TDD_t *)&dlsch_pdu)->ndi = phy_vars_eNB->proc[sched_subframe].frame_tx&1; ((DCI1_10MHz_TDD_t *)&dlsch_pdu)->rv = 0; + ((DCI1_10MHz_TDD_t *)&dlsch_pdu)->rah = 0; memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],(void *)&dlsch_pdu,sizeof(DCI1_10MHz_TDD_t)); /* @@ -356,6 +362,7 @@ void fill_dci(DCI_PDU *DCI_pdu, uint8_t sched_subframe, PHY_VARS_eNB *phy_vars_e ((DCI1_10MHz_FDD_t *)&dlsch_pdu)->mcs = openair_daq_vars.target_ue_dl_mcs; ((DCI1_10MHz_FDD_t *)&dlsch_pdu)->ndi = 1; ((DCI1_10MHz_FDD_t *)&dlsch_pdu)->rv = 0; + ((DCI1_10MHz_FDD_t *)&dlsch_pdu)->rah = 0; memcpy((void*)&DCI_pdu->dci_alloc[1].dci_pdu[0],(void *)&((DCI1_10MHz_FDD_t *)&dlsch_pdu)->,sizeof(DCI1_10MHz_TDD_t)); */ } @@ -364,16 +371,18 @@ void fill_dci(DCI_PDU *DCI_pdu, uint8_t sched_subframe, PHY_VARS_eNB *phy_vars_e case 100: if (phy_vars_eNB->lte_frame_parms.frame_type == FDD) { - DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI1_5MHz_FDD_t; + DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI1_20MHz_FDD_t; - ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->rballoc = rballoc; - ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->TPC = 0; - ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->harq_pid = DLSCH_ptr->harq_pid_freelist[DLSCH_ptr->head_freelist]; - ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->mcs = openair_daq_vars.target_ue_dl_mcs; + ((DCI1_20MHz_FDD_t *)&dlsch_pdu)->rballoc = rballoc; //computeRIV(100,10,3); + ((DCI1_20MHz_FDD_t *)&dlsch_pdu)->TPC = 0; + ((DCI1_20MHz_FDD_t *)&dlsch_pdu)->harq_pid = DLSCH_ptr->harq_pid_freelist[DLSCH_ptr->head_freelist]; + ((DCI1_20MHz_FDD_t *)&dlsch_pdu)->mcs = openair_daq_vars.target_ue_dl_mcs; //((DCI1_5MHz_FDD_t *)&dlsch_pdu)->mcs = (unsigned char) ((phy_vars_eNB->frame%1024)%28); - ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->ndi = phy_vars_eNB->proc[sched_subframe].frame_tx&1; - ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->rv = 0; - memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],(void *)&dlsch_pdu,sizeof(DCI1_5MHz_TDD_t)); + ((DCI1_20MHz_FDD_t *)&dlsch_pdu)->ndi = phy_vars_eNB->proc[sched_subframe].frame_tx&1; + ((DCI1_20MHz_FDD_t *)&dlsch_pdu)->rv = 0; + ((DCI1_20MHz_FDD_t *)&dlsch_pdu)->rah = 0; + + memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],(void *)&dlsch_pdu,sizeof(DCI1_20MHz_FDD_t)); /* //user2 @@ -391,12 +400,13 @@ void fill_dci(DCI_PDU *DCI_pdu, uint8_t sched_subframe, PHY_VARS_eNB *phy_vars_e ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->mcs = openair_daq_vars.target_ue_dl_mcs; ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->ndi = 1; ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->rv = 0; + ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->rah = 0; memcpy((void*)&DCI_pdu->dci_alloc[1].dci_pdu[0],(void *)&((DCI1_5MHz_FDD_t *)&dlsch_pdu)->,sizeof(DCI1_5MHz_TDD_t)); */ } else { DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI1_20MHz_TDD_t; - ((DCI1_20MHz_TDD_t *)&dlsch_pdu)->rballoc = rballoc; + ((DCI1_20MHz_TDD_t *)&dlsch_pdu)->rballoc = rballoc; //computeRIV(100,10,3); ((DCI1_20MHz_TDD_t *)&dlsch_pdu)->TPC = 0; ((DCI1_20MHz_TDD_t *)&dlsch_pdu)->dai = 0; ((DCI1_20MHz_TDD_t *)&dlsch_pdu)->harq_pid = DLSCH_ptr->harq_pid_freelist[DLSCH_ptr->head_freelist]; @@ -404,6 +414,7 @@ void fill_dci(DCI_PDU *DCI_pdu, uint8_t sched_subframe, PHY_VARS_eNB *phy_vars_e //((DCI1_20MHz_TDD_t *)&dlsch_pdu)->mcs = (unsigned char) ((phy_vars_eNB->frame%1024)%28); ((DCI1_20MHz_TDD_t *)&dlsch_pdu)->ndi = phy_vars_eNB->proc[sched_subframe].frame_tx&1; ((DCI1_20MHz_TDD_t *)&dlsch_pdu)->rv = 0; + ((DCI1_20MHz_TDD_t *)&dlsch_pdu)->rah = 0; memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],(void *)&dlsch_pdu,sizeof(DCI1_20MHz_TDD_t)); /* @@ -422,6 +433,7 @@ void fill_dci(DCI_PDU *DCI_pdu, uint8_t sched_subframe, PHY_VARS_eNB *phy_vars_e ((DCI1_20MHz_FDD_t *)&dlsch_pdu)->mcs = openair_daq_vars.target_ue_dl_mcs; ((DCI1_20MHz_FDD_t *)&dlsch_pdu)->ndi = 1; ((DCI1_20MHz_FDD_t *)&dlsch_pdu)->rv = 0; + ((DCI1_20MHz_FDD_t *)&dlsch_pdu)->rah = 0; memcpy((void*)&DCI_pdu->dci_alloc[1].dci_pdu[0],(void *)&((DCI1_20MHz_FDD_t *)&dlsch_pdu)->,sizeof(DCI1_5MHz_TDD_t)); */ } @@ -573,18 +585,18 @@ void fill_dci(DCI_PDU *DCI_pdu, uint8_t sched_subframe, PHY_VARS_eNB *phy_vars_e break;*/ } + /* 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)); } - + */ } void fill_dci_emos(DCI_PDU *DCI_pdu, uint8_t subframe, PHY_VARS_eNB *phy_vars_eNB) { - int i; //uint8_t cooperation_flag = phy_vars_eNB->cooperation_flag; uint8_t transmission_mode = phy_vars_eNB->transmission_mode[0]; @@ -746,11 +758,11 @@ void fill_dci_emos(DCI_PDU *DCI_pdu, uint8_t subframe, PHY_VARS_eNB *phy_vars_eN default: break; } - + /* 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)); } - + */ } diff --git a/openair1/SCHED/phy_procedures_lte_common.c b/openair1/SCHED/phy_procedures_lte_common.c index c51bd82d8a7345009537fc89051100bfbecdb98b..e56606e262b063b6766fe427565b6a75c04971fa 100755 --- a/openair1/SCHED/phy_procedures_lte_common.c +++ b/openair1/SCHED/phy_procedures_lte_common.c @@ -39,8 +39,6 @@ */ #include "PHY/defs.h" #include "PHY/extern.h" -#include "MAC_INTERFACE/defs.h" -#include "MAC_INTERFACE/extern.h" #include "SCHED/defs.h" #include "SCHED/extern.h" diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c index 4420f2385d50b8b7f2059b41b47354ba289fdb11..5979b1ce66203d1cc20011b95fa697c4a17333f0 100755 --- a/openair1/SCHED/phy_procedures_lte_eNb.c +++ b/openair1/SCHED/phy_procedures_lte_eNb.c @@ -1,3 +1,4 @@ + /******************************************************************************* OpenAirInterface Copyright(c) 1999 - 2014 Eurecom @@ -40,8 +41,6 @@ #include "PHY/defs.h" #include "PHY/extern.h" -#include "MAC_INTERFACE/defs.h" -#include "MAC_INTERFACE/extern.h" #include "SCHED/defs.h" #include "SCHED/extern.h" @@ -57,6 +56,8 @@ #include "UTIL/LOG/log.h" #include "UTIL/LOG/vcd_signal_dumper.h" +#include "T.h" + #include "assertions.h" #include "msc.h" @@ -74,18 +75,17 @@ #define PUCCH 1 extern int exit_openair; -//extern void do_OFDM_mod(mod_sym_t **txdataF, int32_t **txdata, uint32_t frame, uint16_t next_slot, LTE_DL_FRAME_PARMS *frame_parms); -unsigned char dlsch_input_buffer[2700] __attribute__ ((aligned(16))); -int eNB_sync_buffer0[640*6] __attribute__ ((aligned(16))); -int eNB_sync_buffer1[640*6] __attribute__ ((aligned(16))); +unsigned char dlsch_input_buffer[2700] __attribute__ ((aligned(32))); +int eNB_sync_buffer0[640*6] __attribute__ ((aligned(32))); +int eNB_sync_buffer1[640*6] __attribute__ ((aligned(32))); int *eNB_sync_buffer[2] = {eNB_sync_buffer0, eNB_sync_buffer1}; extern uint16_t hundred_times_log10_NPRB[100]; unsigned int max_peak_val; -int max_sect_id, max_sync_pos; +int max_sync_pos; //DCI_ALLOC_t dci_alloc[8]; @@ -176,7 +176,7 @@ int32_t add_ue(int16_t rnti, PHY_VARS_eNB *phy_vars_eNB) } else { if (phy_vars_eNB->eNB_UE_stats[i].crnti==0) { MSC_LOG_EVENT(MSC_PHY_ENB, "0 Add ue %"PRIx16" ", rnti); - LOG_I(PHY,"UE_id %d associated with rnti %x\n",i, (uint16_t)rnti); + LOG_D(PHY,"UE_id %d associated with rnti %x\n",i, (uint16_t)rnti); phy_vars_eNB->dlsch_eNB[i][0]->rnti = rnti; phy_vars_eNB->ulsch_eNB[i]->rnti = rnti; phy_vars_eNB->eNB_UE_stats[i].crnti = rnti; @@ -184,7 +184,7 @@ int32_t add_ue(int16_t rnti, PHY_VARS_eNB *phy_vars_eNB) phy_vars_eNB->eNB_UE_stats[i].Po_PUCCH1_below = 0; phy_vars_eNB->eNB_UE_stats[i].Po_PUCCH1_above = (int32_t)pow(10.0,.1*(phy_vars_eNB->lte_frame_parms.ul_power_control_config_common.p0_NominalPUCCH+phy_vars_eNB->rx_total_gain_eNB_dB)); phy_vars_eNB->eNB_UE_stats[i].Po_PUCCH = (int32_t)pow(10.0,.1*(phy_vars_eNB->lte_frame_parms.ul_power_control_config_common.p0_NominalPUCCH+phy_vars_eNB->rx_total_gain_eNB_dB)); - LOG_I(PHY,"Initializing Po_PUCCH: p0_NominalPUCCH %d, gain %d => %d\n", + LOG_D(PHY,"Initializing Po_PUCCH: p0_NominalPUCCH %d, gain %d => %d\n", phy_vars_eNB->lte_frame_parms.ul_power_control_config_common.p0_NominalPUCCH, phy_vars_eNB->rx_total_gain_eNB_dB, phy_vars_eNB->eNB_UE_stats[i].Po_PUCCH); @@ -196,41 +196,43 @@ int32_t add_ue(int16_t rnti, PHY_VARS_eNB *phy_vars_eNB) return(-1); } -int32_t remove_ue(uint16_t rnti, PHY_VARS_eNB *phy_vars_eNB, uint8_t abstraction_flag) -{ +int mac_phy_remove_ue(module_id_t Mod_idP,rnti_t rntiP) { uint8_t i; - int j; - - for (i=0; i<NUMBER_OF_UE_MAX; i++) { - if ((phy_vars_eNB->dlsch_eNB[i]==NULL) || (phy_vars_eNB->ulsch_eNB[i]==NULL)) { - MSC_LOG_EVENT(MSC_PHY_ENB, "0 Failed remove ue %"PRIx16" (ENOMEM)", rnti); - LOG_E(PHY,"Can't remove UE, not enough memory allocated\n"); - return(-1); - } else { - if (phy_vars_eNB->eNB_UE_stats[i].crnti==rnti) { - MSC_LOG_EVENT(MSC_PHY_ENB, "0 Removed ue %"PRIx16" ", rnti); + int j,CC_id; + PHY_VARS_eNB *phy_vars_eNB; + + for (CC_id=0;CC_id<MAX_NUM_CCs;CC_id++) { + phy_vars_eNB = PHY_vars_eNB_g[Mod_idP][CC_id]; + for (i=0; i<NUMBER_OF_UE_MAX; i++) { + if ((phy_vars_eNB->dlsch_eNB[i]==NULL) || (phy_vars_eNB->ulsch_eNB[i]==NULL)) { + MSC_LOG_EVENT(MSC_PHY_ENB, "0 Failed remove ue %"PRIx16" (ENOMEM)", rnti); + LOG_E(PHY,"Can't remove UE, not enough memory allocated\n"); + return(-1); + } else { + if (phy_vars_eNB->eNB_UE_stats[i].crnti==rntiP) { + MSC_LOG_EVENT(MSC_PHY_ENB, "0 Removed ue %"PRIx16" ", rntiP); #ifdef DEBUG_PHY_PROC - LOG_I(PHY,"eNB %d removing UE %d with rnti %x\n",phy_vars_eNB->Mod_id,i,rnti); -#endif - //msg("[PHY] UE_id %d\n",i); - clean_eNb_dlsch(phy_vars_eNB->dlsch_eNB[i][0], abstraction_flag); - clean_eNb_ulsch(phy_vars_eNB->ulsch_eNB[i],abstraction_flag); - //phy_vars_eNB->eNB_UE_stats[i].crnti = 0; - memset(&phy_vars_eNB->eNB_UE_stats[i],0,sizeof(LTE_eNB_UE_stats)); - // mac_exit_wrapper("Removing UE"); - - /* clear the harq pid freelist */ - phy_vars_eNB->dlsch_eNB[i][0]->head_freelist = 0; - phy_vars_eNB->dlsch_eNB[i][0]->tail_freelist = 0; - for (j = 0; j < 8; j++) - put_harq_pid_in_freelist(phy_vars_eNB->dlsch_eNB[i][0], j); - - return(i); + LOG_I(PHY,"eNB %d removing UE %d with rnti %x\n",phy_vars_eNB->Mod_id,i,rnti); +#endif + //msg("[PHY] UE_id %d\n",i); + clean_eNb_dlsch(phy_vars_eNB->dlsch_eNB[i][0]); + clean_eNb_ulsch(phy_vars_eNB->ulsch_eNB[i]); + //phy_vars_eNB->eNB_UE_stats[i].crnti = 0; + memset(&phy_vars_eNB->eNB_UE_stats[i],0,sizeof(LTE_eNB_UE_stats)); + // mac_exit_wrapper("Removing UE"); + + /* clear the harq pid freelist */ + phy_vars_eNB->dlsch_eNB[i][0]->head_freelist = 0; + phy_vars_eNB->dlsch_eNB[i][0]->tail_freelist = 0; + for (j = 0; j < 8; j++) + put_harq_pid_in_freelist(phy_vars_eNB->dlsch_eNB[i][0], j); + + return(i); + } } } } - - MSC_LOG_EVENT(MSC_PHY_ENB, "0 Failed remove ue %"PRIx16" (not found)", rnti); + MSC_LOG_EVENT(MSC_PHY_ENB, "0 Failed remove ue %"PRIx16" (not found)", rntiP); return(-1); } @@ -338,69 +340,18 @@ void phy_procedures_emos_eNB_TX(unsigned char subframe, PHY_VARS_eNB *phy_vars_e } #endif -/* - void phy_procedures_eNB_S_TX(unsigned char next_slot,PHY_VARS_eNB *phy_vars_eNB,uint8_t abstraction_flag) { - - int sect_id = 0, aa; - - if (next_slot%2==0) { - #ifdef DEBUG_PHY_PROC - msg("[PHY][eNB %d] Frame %d, slot %d: Generating pilots for DL-S\n", - phy_vars_eNB->Mod_id,phy_vars_eNB->frame,next_slot); - #endif - - for (sect_id=0;sect_id<number_of_cards;sect_id++) { - if (abstraction_flag == 0) { - - for (aa=0; aa<phy_vars_eNB->lte_frame_parms.nb_antennas_tx; aa++) { - - #ifdef IFFT_FPGA - memset(&phy_vars_eNB->lte_eNB_common_vars.txdataF[sect_id][aa][next_slot*(phy_vars_eNB->lte_frame_parms.N_RB_DL*12)*(phy_vars_eNB->lte_frame_parms.symbols_per_tti>>1)], - 0,(phy_vars_eNB->lte_frame_parms.N_RB_DL*12)*(phy_vars_eNB->lte_frame_parms.symbols_per_tti>>1)*sizeof(mod_sym_t)); - #else - memset(&phy_vars_eNB->lte_eNB_common_vars.txdataF[sect_id][aa][next_slot*phy_vars_eNB->lte_frame_parms.ofdm_symbol_size*(phy_vars_eNB->lte_frame_parms.symbols_per_tti>>1)], - 0,phy_vars_eNB->lte_frame_parms.ofdm_symbol_size*(phy_vars_eNB->lte_frame_parms.symbols_per_tti>>1)*sizeof(mod_sym_t)); - #endif - } - - generate_pilots_slot(phy_vars_eNB, - phy_vars_eNB->lte_eNB_common_vars.txdataF[sect_id], - AMP, - next_slot); - - msg("[PHY][eNB] Frame %d, subframe %d Generating PSS\n", - phy_vars_eNB->frame,next_slot>>1); - - generate_pss(phy_vars_eNB->lte_eNB_common_vars.txdataF[sect_id], - 4*AMP, - &phy_vars_eNB->lte_frame_parms, - 2, - next_slot); - - } - else { - #ifdef PHY_ABSTRACTION - generate_pss_emul(phy_vars_eNB,sect_id); - #endif - } - } - } - } -*/ void phy_procedures_eNB_S_RX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_eNB,uint8_t abstraction_flag,relaying_type_t r_type) { UNUSED(r_type); - // unsigned char sect_id=0; int subframe = phy_vars_eNB->proc[sched_subframe].subframe_rx; #ifdef DEBUG_PHY_PROC LOG_D(PHY,"[eNB %d] Frame %d: Doing phy_procedures_eNB_S_RX(%d)\n", phy_vars_eNB->Mod_id,phy_vars_eNB->proc[sched_subframe].frame_rx, subframe); #endif - // for (sect_id=0;sect_id<number_of_cards;sect_id++) { if (abstraction_flag == 0) { lte_eNB_I0_measurements(phy_vars_eNB, @@ -613,6 +564,7 @@ void phy_eNB_lte_check_measurement_thresholds(instance_t instanceP, ral_threshol unsigned int taus(void); +DCI_PDU DCI_pdu_tmp; void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_eNB,uint8_t abstraction_flag, relaying_type_t r_type,PHY_VARS_RN *phy_vars_rn) @@ -624,7 +576,7 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e uint8_t harq_pid; DCI_PDU *DCI_pdu; uint8_t *DLSCH_pdu=NULL; - DCI_PDU DCI_pdu_tmp; + //DCI_PDU DCI_pdu_tmp; uint8_t DLSCH_pdu_tmp[768*8]; int8_t UE_id; uint8_t num_pdcch_symbols=0; @@ -646,24 +598,24 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_TX,1); start_meas(&phy_vars_eNB->phy_proc_tx); -#ifdef DEBUG_PHY_PROC - LOG_D(PHY,"[%s %"PRIu8"] Frame %d subframe %d : Doing phy_procedures_eNB_TX\n", - (r_type == multicast_relay) ? "RN/eNB" : "eNB", - phy_vars_eNB->Mod_id, frame, subframe); -#endif + T(T_ENB_DL_TICK, T_INT(phy_vars_eNB->Mod_id), T_INT(frame), T_INT(subframe)); for (i=0; i<NUMBER_OF_UE_MAX; i++) { // If we've dropped the UE, go back to PRACH mode for this UE - //#if !defined(EXMIMO_IOT) + if (phy_vars_eNB->eNB_UE_stats[i].ulsch_consecutive_errors == ULSCH_max_consecutive_errors) { - LOG_W(PHY,"[eNB %d, CC %d] frame %d, subframe %d, UE %d: ULSCH consecutive error count reached %u, removing UE\n", + LOG_W(PHY,"[eNB %d, CC %d] frame %d, subframe %d, UE %d: ULSCH consecutive error count reached %u, triggering UL Failure\n", phy_vars_eNB->Mod_id,phy_vars_eNB->CC_id,frame,subframe, i, phy_vars_eNB->eNB_UE_stats[i].ulsch_consecutive_errors); - phy_vars_eNB->eNB_UE_stats[i].mode = PRACH; - remove_ue(phy_vars_eNB->eNB_UE_stats[i].crnti,phy_vars_eNB,abstraction_flag); phy_vars_eNB->eNB_UE_stats[i].ulsch_consecutive_errors=0; + mac_xface->UL_failure_indication(phy_vars_eNB->Mod_id, + phy_vars_eNB->CC_id, + frame, + phy_vars_eNB->eNB_UE_stats[i].crnti, + subframe); + } + - //#endif } @@ -679,7 +631,7 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e for (aa=0; aa<phy_vars_eNB->lte_frame_parms.nb_antennas_tx_eNB; aa++) { memset(&phy_vars_eNB->lte_eNB_common_vars.txdataF[0][aa][subframe*phy_vars_eNB->lte_frame_parms.ofdm_symbol_size*(phy_vars_eNB->lte_frame_parms.symbols_per_tti)], - 0,phy_vars_eNB->lte_frame_parms.ofdm_symbol_size*(phy_vars_eNB->lte_frame_parms.symbols_per_tti)*sizeof(mod_sym_t)); + 0,phy_vars_eNB->lte_frame_parms.ofdm_symbol_size*(phy_vars_eNB->lte_frame_parms.symbols_per_tti)*sizeof(int32_t)); } } @@ -733,9 +685,6 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e phy_vars_rn->Mod_id,phy_vars_rn->frame, subframe,subframe%5, phy_vars_rn->sync_area[subframe%5],mch_pduP->mcs,mch_pduP->Pdu_size); } else { - /* LOG_I(PHY,"[RN %d] Frame %d subframe %d: do not forward MCH pdu for MBSFN sync area %d (MCS %d, TBS %d)\n", - phy_vars_rn->Mod_id,phy_vars_rn->frame, next_slot>>1, - mch_pduP->sync_area,mch_pduP->mcs,mch_pduP->Pdu_size);*/ mch_pduP=NULL; } @@ -885,20 +834,6 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e -#ifdef DEBUG_PHY_PROC - uint16_t frame_tx = (((int) (pbch_pdu[2]&0x3))<<8) + ((int) (pbch_pdu[1]&0xfc)) + phy_vars_eNB->proc[sched_subframe].frame_tx%4; - - LOG_D(PHY,"[eNB %"PRIu8"] Frame %d, subframe %d: Generating PBCH, mode1_flag=%"PRIu8", frame_tx=%"PRIu16", pdu=%02"PRIx8"%02"PRIx8"%02"PRIx8"\n", - phy_vars_eNB->Mod_id, - phy_vars_eNB->proc[sched_subframe].frame_tx, - subframe, - phy_vars_eNB->lte_frame_parms.mode1_flag, - frame_tx, - pbch_pdu[2], - pbch_pdu[1], - pbch_pdu[0]); -#endif - if (abstraction_flag==0) { generate_pbch(&phy_vars_eNB->lte_eNB_pbch, @@ -925,7 +860,6 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e if (abstraction_flag==0) { if (phy_vars_eNB->lte_frame_parms.frame_type == TDD) { - // printf("Generating PSS (frame %d, subframe %d)\n",phy_vars_eNB->proc[sched_subframe].frame_tx,next_slot>>1); generate_pss(phy_vars_eNB->lte_eNB_common_vars.txdataF[0], AMP, &phy_vars_eNB->lte_frame_parms, @@ -976,7 +910,6 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e if (abstraction_flag==0) { if (phy_vars_eNB->lte_frame_parms.frame_type == TDD) { - // printf("Generating PSS (frame %d, subframe %d)\n",phy_vars_eNB->proc[sched_subframe].frame_tx,next_slot>>1); generate_pss(phy_vars_eNB->lte_eNB_common_vars.txdataF[0], AMP, &phy_vars_eNB->lte_frame_parms, @@ -988,8 +921,6 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e - // sect_id=0; - #if defined(SMBV) && !defined(EXMIMO) // PBCH takes one allocation @@ -1032,28 +963,15 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e } } -#ifdef EMOS - //emos_dump_eNB.dci_cnt[next_slot>>1] = DCI_pdu->Num_common_dci + DCI_pdu->Num_ue_spec_dci; //nb_dci_common+nb_dci_ue_spec; -#endif - // clear previous allocation information for all UEs for (i=0; i<NUMBER_OF_UE_MAX; i++) { phy_vars_eNB->dlsch_eNB[i][0]->subframe_tx[subframe] = 0; } - // init_nCCE_table(); 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));*/ - LOG_D(PHY,"num_pdcch_symbols %"PRIu8", nCCE %u (dci commond %"PRIu8", dci uespec %"PRIu8"\n",num_pdcch_symbols,DCI_pdu->nCCE, + LOG_D(PHY,"num_pdcch_symbols %"PRIu8",(dci common %"PRIu8", dci uespec %"PRIu8"\n",num_pdcch_symbols, DCI_pdu->Num_common_dci,DCI_pdu->Num_ue_spec_dci); #if defined(SMBV) && !defined(EXMIMO) @@ -1067,21 +985,17 @@ 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) { - LOG_D(PHY,"[eNB] Subframe %d : Doing DCI index %"PRIu32"/%d\n",subframe,i,DCI_pdu->Num_common_dci + DCI_pdu->Num_ue_spec_dci); - dump_dci(&phy_vars_eNB->lte_frame_parms,&DCI_pdu->dci_alloc[i]); - } -#endif + VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_DCI_INFO,DCI_pdu->num_pdcch_symbols); + + 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); + VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_DCI_INFO,DCI_pdu->dci_alloc[i].rnti); + VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_DCI_INFO,DCI_pdu->dci_alloc[i].format); + VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_DCI_INFO,DCI_pdu->dci_alloc[i].firstCCE); if (DCI_pdu->dci_alloc[i].rnti == SI_RNTI) { -#ifdef DEBUG_PHY_PROC - LOG_D(PHY,"[eNB %"PRIu8"] SI generate_eNB_dlsch_params_from_dci\n", phy_vars_eNB->Mod_id); -#endif generate_eNB_dlsch_params_from_dci(frame, subframe, @@ -1100,7 +1014,7 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e 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); + phy_vars_eNB->dlsch_eNB_SI->nCCE[subframe],DCI_pdu->dci_alloc[i].firstCCE); #if defined(SMBV) && !defined(EXMIMO) @@ -1114,9 +1028,6 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e } else if (DCI_pdu->dci_alloc[i].ra_flag == 1) { -#ifdef DEBUG_PHY_PROC - LOG_D(PHY,"[eNB %"PRIu8"] RA generate_eNB_dlsch_params_from_dci\n", phy_vars_eNB->Mod_id); -#endif generate_eNB_dlsch_params_from_dci(frame, subframe, @@ -1131,13 +1042,11 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e P_RNTI, phy_vars_eNB->eNB_UE_stats[0].DL_pmi_single); - // mac_xface->macphy_exit("Transmitted RAR, exiting\n"); - phy_vars_eNB->dlsch_eNB_ra->nCCE[subframe] = DCI_pdu->dci_alloc[i].firstCCE; - 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); + LOG_D(PHY,"[eNB %"PRIu8"] Frame %d subframe %d : CCE resource for common DCI (RA) => %"PRIu8"/%u (num_pdcch_symbols %d)\n",phy_vars_eNB->Mod_id,phy_vars_eNB->proc[sched_subframe].frame_tx,subframe, + phy_vars_eNB->dlsch_eNB_ra->nCCE[subframe],get_nCCE_mac(phy_vars_eNB->Mod_id,phy_vars_eNB->CC_id,num_pdcch_symbols,subframe),num_pdcch_symbols); #if defined(SMBV) && !defined(EXMIMO) // configure RA DCI @@ -1152,10 +1061,6 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e else if (DCI_pdu->dci_alloc[i].format != format0) { // this is a normal DLSCH allocation -#ifdef DEBUG_PHY_PROC - LOG_D(PHY,"[eNB] Searching for RNTI %"PRIx16"\n",DCI_pdu->dci_alloc[i].rnti); -#endif - if (phy_vars_eNB->mac_enabled==1) UE_id = find_ue((int16_t)DCI_pdu->dci_alloc[i].rnti,phy_vars_eNB); else @@ -1192,10 +1097,14 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e 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); + T(T_ENB_DLSCH_UE_DCI, T_INT(phy_vars_eNB->Mod_id), T_INT(frame), T_INT(subframe), T_INT(UE_id), + T_INT(DCI_pdu->dci_alloc[i].rnti), T_INT(DCI_pdu->dci_alloc[i].format), + T_INT(phy_vars_eNB->dlsch_eNB[(int)UE_id][0]->current_harq_pid)); + phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->nCCE[subframe] = DCI_pdu->dci_alloc[i].firstCCE; 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); + DCI_pdu->dci_alloc[i].rnti,phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->nCCE[subframe],DCI_pdu->dci_alloc[i].firstCCE); #if defined(SMBV) && !defined(EXMIMO) @@ -1207,14 +1116,11 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e #endif -#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", phy_vars_eNB->Mod_id, DCI_pdu->dci_alloc[i].rnti, phy_vars_eNB->proc[sched_subframe].frame_tx, subframe,UE_id, DCI_pdu->dci_alloc[i].format, 1<<DCI_pdu->dci_alloc[i].L); -#endif } else { LOG_D(PHY,"[eNB %"PRIu8"][PDSCH] Frame %d : No UE_id with corresponding rnti %"PRIx16", dropping DLSCH\n", phy_vars_eNB->Mod_id,phy_vars_eNB->proc[sched_subframe].frame_tx,DCI_pdu->dci_alloc[i].rnti); @@ -1223,6 +1129,8 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e } + VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_DCI_INFO,(frame*10)+subframe); + // Apply physicalConfigDedicated if needed phy_config_dedicated_eNB_step2(phy_vars_eNB); @@ -1235,7 +1143,6 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e if (harq_pid==255) { LOG_E(PHY,"[eNB %"PRIu8"] Frame %d: Bad harq_pid for ULSCH allocation\n",phy_vars_eNB->Mod_id,phy_vars_eNB->proc[sched_subframe].frame_tx); - //mac_exit_wrapper("Invalid harq_pid (255) detected"); return; } @@ -1244,14 +1151,15 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e else UE_id = i; + T(T_ENB_ULSCH_UE_DCI, T_INT(phy_vars_eNB->Mod_id), T_INT(frame), T_INT(subframe), T_INT(UE_id), + T_INT(DCI_pdu->dci_alloc[i].rnti), T_INT(harq_pid)); + if (UE_id<0) { LOG_E(PHY,"[eNB %"PRIu8"] Frame %d: Unknown UE_id for rnti %"PRIx16"\n",phy_vars_eNB->Mod_id,phy_vars_eNB->proc[sched_subframe].frame_tx,DCI_pdu->dci_alloc[i].rnti); mac_exit_wrapper("Invalid UE id (< 0) detected"); return; // not reached } -#ifdef DEBUG_PHY_PROC - //if (phy_vars_eNB->proc[sched_subframe].frame_tx%100 == 0) LOG_D(PHY, "[eNB %"PRIu8"][PUSCH %"PRIu8"] Frame %d subframe %d UL Frame %"PRIu32", UL Subframe %"PRIu8", Generated ULSCH (format0) DCI (rnti %"PRIx16", dci %"PRIx8") (DCI pos %"PRIu32"/%d), aggregation %d\n", phy_vars_eNB->Mod_id, @@ -1267,10 +1175,6 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e i, DCI_pdu->Num_common_dci + DCI_pdu->Num_ue_spec_dci, 1<<DCI_pdu->dci_alloc[i].L); -#endif - - //dump_dci(&phy_vars_eNB->lte_frame_parms,&DCI_pdu->dci_alloc[i]); - //LOG_D(PHY,"[eNB] cba generate_eNB_ulsch_params_from_dci for ue %d for dci rnti %x\n", UE_id, DCI_pdu->dci_alloc[i].rnti); generate_eNB_ulsch_params_from_dci(&DCI_pdu->dci_alloc[i].dci_pdu[0], DCI_pdu->dci_alloc[i].rnti, @@ -1286,7 +1190,7 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e 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); + DCI_pdu->dci_alloc[i].firstCCE,DCI_pdu->dci_alloc[i].firstCCE); #if defined(SMBV) && !defined(EXMIMO) @@ -1300,13 +1204,6 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e -#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", - phy_vars_eNB->Mod_id,harq_pid, - phy_vars_eNB->proc[sched_subframe].frame_tx,subframe,i,harq_pid, - pdcch_alloc2ul_subframe(&phy_vars_eNB->lte_frame_parms,subframe)); -#endif - if ((DCI_pdu->dci_alloc[i].rnti >= CBA_RNTI) && (DCI_pdu->dci_alloc[i].rnti < P_RNTI)) phy_vars_eNB->ulsch_eNB[(uint32_t)UE_id]->harq_processes[harq_pid]->subframe_cba_scheduling_flag = 1; else @@ -1329,15 +1226,11 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e } if (abstraction_flag == 0) { - //#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 - - // for (sect_id=0;sect_id<number_of_cards;sect_id++) num_pdcch_symbols = generate_dci_top(DCI_pdu->Num_ue_spec_dci, DCI_pdu->Num_common_dci, DCI_pdu->dci_alloc, @@ -1347,10 +1240,6 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e phy_vars_eNB->lte_eNB_common_vars.txdataF[0], subframe); -#ifdef DEBUG_PHY_PROC - // LOG_I(PHY,"[eNB %d] Frame %d, subframe %d: num_pdcch_symbols %d)\n",phy_vars_eNB->Mod_id,phy_vars_eNB->proc[sched_subframe].frame_tx, next_slot>>1,num_pdcch_symbols); - -#endif } #ifdef PHY_ABSTRACTION // FIXME this ifdef seems suspicious @@ -1363,10 +1252,6 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_PDCCH_TX,0); -#ifdef DEBUG_PHY_PROC - //LOG_D(PHY,"[eNB %d] Frame %d, slot %d: num_pdcch_symbols=%d\n",phy_vars_eNB->Mod_id,phy_vars_eNB->proc[sched_subframe].frame_tx, next_slot,num_pdcch_symbols); -#endif - // Check for SI activity if (phy_vars_eNB->dlsch_eNB_SI->active == 1) { @@ -1395,21 +1280,6 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e smbv_configure_datalist_for_alloc(smbv_fname, smbv_alloc_cnt++, (smbv_frame_cnt*10) + (subframe), DLSCH_pdu, input_buffer_length); } -#endif - -#ifdef DEBUG_PHY_PROC -#ifdef DEBUG_DLSCH - //FIXME: The code below is commented as next_slot is not defined which results in failed compilation - /* - LOG_D(PHY,"[eNB %"PRIu8"][SI] Frame %d, slot %d: Calling generate_dlsch (SI) with input size = %"PRIu16", num_pdcch_symbols %"PRIu8"\n", - phy_vars_eNB->Mod_id,phy_vars_eNB->proc[sched_subframe].frame_tx, next_slot, input_buffer_length,num_pdcch_symbols); // FIXME this code is broken (next_slot?) - - for (i=0; i<input_buffer_length; i++) - LOG_T(PHY,"%x.",i,DLSCH_pdu[i]);// FIXME this code is broken (number of arguments) - - LOG_T(PHY,"\n"); - */ -#endif #endif if (abstraction_flag == 0) { @@ -1441,7 +1311,7 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e stop_meas(&phy_vars_eNB->dlsch_scrambling_stats); start_meas(&phy_vars_eNB->dlsch_modulation_stats); - // for (sect_id=0;sect_id<number_of_cards;sect_id++) + re_allocated = dlsch_modulation(phy_vars_eNB->lte_eNB_common_vars.txdataF[0], AMP, subframe, @@ -1468,10 +1338,6 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e // Check for RA activity if (phy_vars_eNB->dlsch_eNB_ra->active == 1) { -#ifdef DEBUG_PHY_PROC - LOG_D(PHY,"[eNB %"PRIu8"][RAPROC] Frame %d, subframe %d, RA active, filling RAR:\n", - phy_vars_eNB->Mod_id,phy_vars_eNB->proc[sched_subframe].frame_tx, subframe); -#endif input_buffer_length = phy_vars_eNB->dlsch_eNB_ra->harq_processes[0]->TBS/8; @@ -1481,11 +1347,6 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e dlsch_input_buffer, phy_vars_eNB->lte_frame_parms.N_RB_UL, input_buffer_length); - /* - for (i=0;i<input_buffer_length;i++) - LOG_T(PHY,"%x.",dlsch_input_buffer[i]); - LOG_T(PHY,"\n"); - */ if (crnti!=0) UE_id = add_ue(crnti,phy_vars_eNB); else @@ -1493,7 +1354,6 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e if (UE_id==-1) { LOG_W(PHY,"[eNB] Max user count reached.\n"); - //mac_xface->macphy_exit("[PHY][eNB] Max user count reached.\n"); mac_xface->cancel_ra_proc(phy_vars_eNB->Mod_id, phy_vars_eNB->CC_id, phy_vars_eNB->proc[sched_subframe].frame_tx, @@ -1516,22 +1376,13 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e phy_vars_eNB->proc[sched_subframe].frame_tx, &phy_vars_eNB->ulsch_eNB[(uint32_t)UE_id]->Msg3_frame, &phy_vars_eNB->ulsch_eNB[(uint32_t)UE_id]->Msg3_subframe); - LOG_I(PHY,"[eNB][RAPROC] Frame %d subframe %d, Activated Msg3 demodulation for UE %"PRId8" in frame %"PRIu32", subframe %"PRIu8"\n", + LOG_D(PHY,"[eNB][RAPROC] Frame %d subframe %d, Activated Msg3 demodulation for UE %"PRId8" in frame %"PRIu32", subframe %"PRIu8"\n", phy_vars_eNB->proc[sched_subframe].frame_tx, subframe, UE_id, phy_vars_eNB->ulsch_eNB[(uint32_t)UE_id]->Msg3_frame, phy_vars_eNB->ulsch_eNB[(uint32_t)UE_id]->Msg3_subframe); - /* - for (i=0; i<input_buffer_length; i++) - dlsch_input_buffer[i]= (unsigned char) i; //(taus()&0xff); - - dlsch_input_buffer[1] = (phy_vars_eNB->eNB_UE_stats[0].UE_timing_offset)>>(2+4); // 7 MSBs of timing advance + divide by 4 - dlsch_input_buffer[2] = ((phy_vars_eNB->eNB_UE_stats[0].UE_timing_offset)<<(4-2))&0xf0; // 4 LSBs of timing advance + divide by 4 - //LOG_I(PHY,"UE %d: timing_offset = %d\n",UE_id,phy_vars_eNB->eNB_UE_stats[0].UE_timing_offset); - */ - #if defined(SMBV) && !defined(EXMIMO) // Configures the data source of allocation (allocation is configured by DCI) @@ -1542,13 +1393,13 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e #endif -#ifdef DEBUG_PHY_PROC + LOG_D(PHY,"[eNB %"PRIu8"][RAPROC] Frame %d, subframe %d: Calling generate_dlsch (RA) with input size = %"PRIu16",Msg3 frame %"PRIu32", Msg3 subframe %"PRIu8"\n", phy_vars_eNB->Mod_id, phy_vars_eNB->proc[sched_subframe].frame_tx, subframe,input_buffer_length, phy_vars_eNB->ulsch_eNB[(uint32_t)UE_id]->Msg3_frame, phy_vars_eNB->ulsch_eNB[(uint32_t)UE_id]->Msg3_subframe); -#endif + if (abstraction_flag == 0) { @@ -1573,7 +1424,7 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e num_pdcch_symbols,phy_vars_eNB->proc[sched_subframe].frame_tx,subframe), 0, subframe<<1); - // for (sect_id=0;sect_id<number_of_cards;sect_id++) + re_allocated = dlsch_modulation(phy_vars_eNB->lte_eNB_common_vars.txdataF[0], AMP, subframe, @@ -1594,11 +1445,6 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e LOG_D(PHY,"[eNB %"PRIu8"][RAPROC] Frame %d subframe %d Deactivating DLSCH RA\n",phy_vars_eNB->Mod_id, phy_vars_eNB->proc[sched_subframe].frame_tx,subframe); -#ifdef DEBUG_PHY_PROC - LOG_D(PHY,"[eNB %"PRIu8"] Frame %d, subframe %d, DLSCH (RA) re_allocated = %"PRIu16"\n",phy_vars_eNB->Mod_id, - phy_vars_eNB->proc[sched_subframe].frame_tx, subframe, re_allocated); -#endif - } //max user count phy_vars_eNB->dlsch_eNB_ra->active = 0; @@ -1614,7 +1460,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 + 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, @@ -1630,7 +1476,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 + #if defined(MESSAGE_CHART_GENERATOR_PHY) MSC_LOG_TX_MESSAGE( MSC_PHY_ENB,MSC_PHY_UE, @@ -1730,15 +1576,7 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e subframe<<1); stop_meas(&phy_vars_eNB->dlsch_scrambling_stats); start_meas(&phy_vars_eNB->dlsch_modulation_stats); - //for (sect_id=0;sect_id<number_of_cards;sect_id++) { - /* if ((phy_vars_eNB->transmission_mode[(uint8_t)UE_id] == 5) && - (phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->dl_power_off == 0)) - amp = (int16_t)(((int32_t)AMP*(int32_t)ONE_OVER_SQRT2_Q15)>>15); - else*/ - // amp = AMP; - // if (UE_id == 1) - // LOG_I(PHY,"[MYEMOS] MCS_i %d\n", phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->harq_processes[harq_pid]->mcs); re_allocated = dlsch_modulation(phy_vars_eNB->lte_eNB_common_vars.txdataF[0], AMP, @@ -1763,7 +1601,6 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e #endif phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->active = 0; - //mac_xface->macphy_exit("first dlsch transmitted\n"); } else if ((phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0])&& @@ -1772,22 +1609,15 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e // clear subframe TX flag since UE is not scheduled for PDSCH in this subframe (so that we don't look for PUCCH later) phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->subframe_tx[subframe]=0; -#ifdef DEBUG_PHY_PROC - //LOG_D(PHY,"[eNB %d] DCI: Clearing subframe_tx for subframe %d, UE %d\n",phy_vars_eNB->Mod_id,subframe,UE_id); -#endif } } // if we have PHICH to generate - // printf("[PHY][eNB] Frame %d subframe %d Checking for phich\n",phy_vars_eNB->proc[sched_subframe].frame_tx,subframe); + if (is_phich_subframe(&phy_vars_eNB->lte_frame_parms,subframe)) { -#ifdef DEBUG_PHY_PROC - // LOG_D(PHY,"[eNB %d] Frame %d, subframe %d: Calling generate_phich_top\n",phy_vars_eNB->Mod_id,phy_vars_eNB->proc[sched_subframe].frame_tx, subframe); -#endif - // for (sect_id=0;sect_id<number_of_cards;sect_id++) { generate_phich_top(phy_vars_eNB, sched_subframe, AMP, @@ -2048,6 +1878,9 @@ void process_HARQ_feedback(uint8_t UE_id, dlsch->rnti,dl_harq_pid[m],M,m,mp,dlsch_harq_proc->round); #endif + T(T_ENB_DLSCH_UE_NACK, T_INT(phy_vars_eNB->Mod_id), T_INT(frame), T_INT(subframe), T_INT(UE_id), T_INT(dlsch->rnti), + T_INT(dl_harq_pid[m])); + if (dlsch_harq_proc->round == 0) ue_stats->dlsch_NAK_round0++; @@ -2057,7 +1890,8 @@ void process_HARQ_feedback(uint8_t UE_id, // then Increment DLSCH round index dlsch_harq_proc->round++; - if (dlsch_harq_proc->round == dlsch->Mdlharq) { + + if (dlsch_harq_proc->round == dlsch->Mlimit) { // This was the last round for DLSCH so reset round and increment l2_error counter #ifdef DEBUG_PHY_PROC LOG_W(PHY,"[eNB %d][PDSCH %x/%d] DLSCH retransmissions exhausted, dropping packet\n",phy_vars_eNB->Mod_id, @@ -2080,6 +1914,10 @@ void process_HARQ_feedback(uint8_t UE_id, LOG_D(PHY,"[eNB %d][PDSCH %x/%d] ACK Received in round %d, resetting process\n",phy_vars_eNB->Mod_id, dlsch->rnti,dl_harq_pid[m],dlsch_harq_proc->round); #endif + + T(T_ENB_DLSCH_UE_ACK, T_INT(phy_vars_eNB->Mod_id), T_INT(frame), T_INT(subframe), T_INT(UE_id), T_INT(dlsch->rnti), + T_INT(dl_harq_pid[m])); + ue_stats->dlsch_ACK[dl_harq_pid[m]][dlsch_harq_proc->round]++; // Received ACK so set round to 0 and set dlsch_harq_pid IDLE @@ -2294,7 +2132,6 @@ void prach_procedures(PHY_VARS_eNB *phy_vars_eNB,uint8_t sched_subframe,uint8_t LOG_D(PHY,"[eNB %d][RAPROC] Frame %d, Subframe %d : PRACH RX Signal Power : %d dBm\n",phy_vars_eNB->Mod_id, frame,subframe,dB_fixed(signal_energy(&phy_vars_eNB->lte_eNB_common_vars.rxdata[0][0][subframe*phy_vars_eNB->lte_frame_parms.samples_per_tti],512)) - phy_vars_eNB->rx_total_gain_eNB_dB); - // LOG_I(PHY,"[eNB %d][RAPROC] PRACH: rootSequenceIndex %d, prach_ConfigIndex %d, zeroCorrelationZoneConfig %d, highSpeedFlag %d, prach_FreqOffset %d\n",phy_vars_eNB->Mod_id,phy_vars_eNB->lte_frame_parms.prach_config_common.rootSequenceIndex,phy_vars_eNB->lte_frame_parms.prach_config_common.prach_ConfigInfo.prach_ConfigIndex, phy_vars_eNB->lte_frame_parms.prach_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig,phy_vars_eNB->lte_frame_parms.prach_config_common.prach_ConfigInfo.highSpeedFlag,phy_vars_eNB->lte_frame_parms.prach_config_common.prach_ConfigInfo.prach_FreqOffset); rx_prach(phy_vars_eNB, subframe, @@ -2339,21 +2176,14 @@ void prach_procedures(PHY_VARS_eNB *phy_vars_eNB,uint8_t sched_subframe,uint8_t #endif if (preamble_energy_list[preamble_max] > 580) { - /* - write_output("prach_ifft0.m","prach_t0",prach_ifft[0],2048,1,1); - write_output("prach_rx0.m","prach_rx0",&phy_vars_eNB->lte_eNB_common_vars.rxdata[0][0][subframe*phy_vars_eNB->lte_frame_parms.samples_per_tti],6144+792,1,1); - write_output("prach_rxF0.m","prach_rxF0",phy_vars_eNB->lte_eNB_prach_vars.rxsigF[0],24576,1,1); - - mac_xface->macphy_exit("Exiting for PRACH debug\n"); - */ UE_id = find_next_ue_index(phy_vars_eNB); - + if (UE_id>=0) { phy_vars_eNB->eNB_UE_stats[(uint32_t)UE_id].UE_timing_offset = preamble_delay_list[preamble_max]&0x1FFF; //limit to 13 (=11+2) bits - //phy_vars_eNb->eNB_UE_stats[(uint32_t)UE_id].mode = PRACH; + phy_vars_eNB->eNB_UE_stats[(uint32_t)UE_id].sector = 0; - LOG_I(PHY,"[eNB %d/%d][RAPROC] Frame %d, subframe %d Initiating RA procedure (UE_id %d) with preamble %d, energy %d.%d dB, delay %d\n", + LOG_D(PHY,"[eNB %d/%d][RAPROC] Frame %d, subframe %d Initiating RA procedure (UE_id %d) with preamble %d, energy %d.%d dB, delay %d\n", phy_vars_eNB->Mod_id, phy_vars_eNB->CC_id, frame, @@ -2411,14 +2241,9 @@ void ulsch_decoding_procedures(unsigned char subframe, unsigned int i, PHY_VARS_ } +void pucch_procedures(const unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_eNB,int UE_id,int harq_pid,const uint8_t abstraction_flag) { -void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_eNB,const uint8_t abstraction_flag,const relaying_type_t r_type) -{ - //RX processing - UNUSED(r_type); - uint32_t l, ret=0,i,j,k; - uint32_t sect_id=0; - uint32_t harq_pid, harq_idx, round; + LTE_DL_FRAME_PARMS *frame_parms=&phy_vars_eNB->lte_frame_parms; uint8_t SR_payload = 0,*pucch_payload=NULL,pucch_payload0[2]= {0,0},pucch_payload1[2]= {0,0}; int16_t n1_pucch0,n1_pucch1,n1_pucch2,n1_pucch3; uint8_t do_SR = 0; @@ -2426,999 +2251,1047 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_ int32_t metric0=0,metric1=0,metric0_SR=0; ANFBmode_t bundling_flag; PUCCH_FMT_t format; - uint8_t nPRS; - // uint8_t two_ues_connected = 0; - uint8_t pusch_active = 0; - LTE_DL_FRAME_PARMS *frame_parms=&phy_vars_eNB->lte_frame_parms; - int sync_pos; - uint16_t rnti=0; - uint8_t access_mode; - int num_active_cba_groups; + const int subframe = phy_vars_eNB->proc[sched_subframe].subframe_rx; const int frame = phy_vars_eNB->proc[sched_subframe].frame_rx; - AssertFatal(sched_subframe < NUM_ENB_THREADS, "Bad sched_subframe %d", sched_subframe); - - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_RX,1); - start_meas(&phy_vars_eNB->phy_proc_rx); -#ifdef DEBUG_PHY_PROC - LOG_D(PHY,"[eNB %d] Frame %d: Doing phy_procedures_eNB_RX(%d)\n",phy_vars_eNB->Mod_id,frame, subframe); -#endif + if ((phy_vars_eNB->dlsch_eNB[UE_id][0]) && + (phy_vars_eNB->dlsch_eNB[UE_id][0]->rnti>0) && + (phy_vars_eNB->ulsch_eNB[UE_id]->harq_processes[harq_pid]->subframe_scheduling_flag==0)) { - /* -#ifdef OAI_USRP - for (aa=0;aa<phy_vars_eNB->lte_frame_parms.nb_antennas_rx;aa++) - rescale(&phy_vars_eNB->lte_eNB_common_vars.rxdata[0][aa][subframe*phy_vars_eNB->lte_frame_parms.samples_per_tti], - 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; + // check SR availability + do_SR = is_SR_subframe(phy_vars_eNB,UE_id,sched_subframe); + // do_SR = 0; - if (abstraction_flag == 0) { - remove_7_5_kHz(phy_vars_eNB,subframe<<1); - remove_7_5_kHz(phy_vars_eNB,(subframe<<1)+1); - } + // Now ACK/NAK + // First check subframe_tx flag for earlier subframes + get_n1_pucch_eNB(phy_vars_eNB, + UE_id, + sched_subframe, + &n1_pucch0, + &n1_pucch1, + &n1_pucch2, + &n1_pucch3); - // check if we have to detect PRACH first - if (is_prach_subframe(&phy_vars_eNB->lte_frame_parms,frame,subframe)>0) { - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_PRACH_RX,1); - prach_procedures(phy_vars_eNB,sched_subframe,abstraction_flag); - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_PRACH_RX,0); - } + LOG_D(PHY,"[eNB %d][PDSCH %x] Frame %d, subframe %d Checking for PUCCH (%d,%d,%d,%d) SR %d\n", + phy_vars_eNB->Mod_id,phy_vars_eNB->dlsch_eNB[UE_id][0]->rnti, + frame,subframe, + n1_pucch0,n1_pucch1,n1_pucch2,n1_pucch3,do_SR); - if (abstraction_flag == 0) { - start_meas(&phy_vars_eNB->ofdm_demod_stats); + if ((n1_pucch0==-1) && (n1_pucch1==-1) && (do_SR==0)) { // no TX PDSCH that have to be checked and no SR for this UE_id + } else { + // otherwise we have some PUCCH detection to do - for (l=0; l<phy_vars_eNB->lte_frame_parms.symbols_per_tti/2; l++) { + // 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; + } - // for (sect_id=0;sect_id<number_of_cards;sect_id++) { - slot_fep_ul(&phy_vars_eNB->lte_frame_parms, - &phy_vars_eNB->lte_eNB_common_vars, - l, - subframe<<1, - 0, - 0 - ); - slot_fep_ul(&phy_vars_eNB->lte_frame_parms, - &phy_vars_eNB->lte_eNB_common_vars, - l, - (subframe<<1)+1, - 0, - 0 - ); - } + if (do_SR == 1) { + phy_vars_eNB->eNB_UE_stats[UE_id].sr_total++; - stop_meas(&phy_vars_eNB->ofdm_demod_stats); - } + if (abstraction_flag == 0) + metric0_SR = rx_pucch(phy_vars_eNB, + pucch_format1, + UE_id, + phy_vars_eNB->scheduling_request_config[UE_id].sr_PUCCH_ResourceIndex, + 0, // n2_pucch + 0, // shortened format, should be use_srs flag, later + &SR_payload, + frame, + subframe, + PUCCH1_THRES); - sect_id = 0; - (void)sect_id; /* remove gcc warning "set but not used" */ +#ifdef PHY_ABSTRACTION + else { + metric0_SR = rx_pucch_emul(phy_vars_eNB, + UE_id, + 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[UE_id]->rnti,frame,subframe,SR_payload,phy_vars_eNB->scheduling_request_config[UE_id].sr_PUCCH_ResourceIndex); + } - /* - for (UE_id=0;UE_id<NUMBER_OF_UE_MAX;UE_id++) { - - if ((phy_vars_eNB->eNB_UE_stats[(uint32_t)UE_id].mode>PRACH) && (last_slot%2==1)) { - #ifdef DEBUG_PHY_PROC - LOG_D(PHY,"[eNB %d] frame %d, slot %d: Doing SRS estimation and measurements for UE_id %d (UE_mode %d)\n", - phy_vars_eNB->Mod_id, - phy_vars_eNB->proc[sched_subframe].frame_tx, last_slot, - UE_id,phy_vars_eNB->eNB_UE_stats[(uint32_t)UE_id].mode); - #endif - for (sect_id=0;sect_id<number_of_cards;sect_id++) { - - lte_srs_channel_estimation(&phy_vars_eNB->lte_frame_parms, - &phy_vars_eNB->lte_eNB_common_vars, - &phy_vars_eNB->lte_eNB_srs_vars[(uint32_t)UE_id], - &phy_vars_eNB->soundingrs_ul_config_dedicated[(uint32_t)UE_id], - last_slot>>1, - sect_id); - lte_eNB_srs_measurements(phy_vars_eNB, - sect_id, - UE_id, - 1); - #ifdef DEBUG_PHY_PROC - LOG_D(PHY,"[eNB %d] frame %d, slot %d: UE_id %d, sect_id %d: RX RSSI %d (from SRS)\n", - phy_vars_eNB->Mod_id, - phy_vars_eNB->proc[sched_subframe].frame_tx, last_slot, - UE_id,sect_id, - phy_vars_eNB->PHY_measurements_eNB[sect_id].rx_rssi_dBm[(uint32_t)UE_id]); - #endif - } +#endif - sect_id=0; - #ifdef USER_MODE - //write_output("srs_est0.m","srsest0",phy_vars_eNB->lte_eNB_common_vars.srs_ch_estimates[0][0],512,1,1); - //write_output("srs_est1.m","srsest1",phy_vars_eNB->lte_eNB_common_vars.srs_ch_estimates[0][1],512,1,1); - #endif - - //msg("timing advance in\n"); - sync_pos = lte_est_timing_advance(&phy_vars_eNB->lte_frame_parms, - &phy_vars_eNB->lte_eNB_srs_vars[(uint32_t)UE_id], - §_id, - phy_vars_eNB->first_run_timing_advance[(uint32_t)UE_id], - number_of_cards, - 24576); - - //msg("timing advance out\n"); - - //phy_vars_eNB->eNB_UE_stats[(uint32_t)UE_id].UE_timing_offset = sync_pos - phy_vars_eNB->lte_frame_parms.nb_prefix_samples/8; - phy_vars_eNB->eNB_UE_stats[(uint32_t)UE_id].UE_timing_offset = 0; - phy_vars_eNB->eNB_UE_stats[(uint32_t)UE_id].sector = sect_id; - #ifdef DEBUG_PHY_PROC - LOG_D(PHY,"[eNB %d] frame %d, slot %d: user %d in sector %d: timing_advance = %d\n", - phy_vars_eNB->Mod_id, - phy_vars_eNB->proc[sched_subframe].frame_tx, last_slot, - UE_id, sect_id, - phy_vars_eNB->eNB_UE_stats[(uint32_t)UE_id].UE_timing_offset); - #endif - } - } - else { + if (SR_payload == 1) { + LOG_D(PHY,"[eNB %d][SR %x] Frame %d subframe %d Got SR for PUSCH, transmitting to MAC\n",phy_vars_eNB->Mod_id, + phy_vars_eNB->ulsch_eNB[UE_id]->rnti,frame,subframe); + phy_vars_eNB->eNB_UE_stats[UE_id].sr_received++; - } - */ + if (phy_vars_eNB->first_sr[UE_id] == 1) { // this is the first request for uplink after Connection Setup, so clear HARQ process 0 use for Msg4 + /* is this test necessary? */ + if (phy_vars_eNB->dlsch_eNB[UE_id][0]->harq_processes[0]->status != SCH_IDLE) + put_harq_pid_in_freelist(phy_vars_eNB->dlsch_eNB[UE_id][0], 0); + phy_vars_eNB->first_sr[UE_id] = 0; + phy_vars_eNB->dlsch_eNB[UE_id][0]->harq_processes[0]->round=0; + phy_vars_eNB->dlsch_eNB[UE_id][0]->harq_processes[0]->status=SCH_IDLE; + LOG_D(PHY,"[eNB %d][SR %x] Frame %d subframe %d First SR\n", + phy_vars_eNB->Mod_id, + phy_vars_eNB->ulsch_eNB[UE_id]->rnti,frame,subframe); + } - // Check for active processes in current subframe - harq_pid = subframe2harq_pid(&phy_vars_eNB->lte_frame_parms, - frame,subframe); - pusch_active = 0; + if (phy_vars_eNB->mac_enabled==1) { + mac_xface->SR_indication(phy_vars_eNB->Mod_id, + phy_vars_eNB->CC_id, + frame, + phy_vars_eNB->dlsch_eNB[UE_id][0]->rnti,subframe); + } + } + }// do_SR==1 - // reset the cba flag used for collision detection - for (i=0; i < NUM_MAX_CBA_GROUP; i++) { - phy_vars_eNB->cba_last_reception[i]=0; - } + 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[UE_id].sr_PUCCH_ResourceIndex:n1_pucch0; - // LOG_I(PHY,"subframe %d: nPRS %d\n",last_slot>>1,phy_vars_eNB->lte_frame_parms.pusch_config_common.ul_ReferenceSignalsPUSCH.nPRS[last_slot-1]); + LOG_D(PHY,"Demodulating PUCCH for ACK/NAK: n1_pucch0 %d (%d), SR_payload %d\n",n1_pucch0,phy_vars_eNB->scheduling_request_config[UE_id].sr_PUCCH_ResourceIndex,SR_payload); - for (i=0; i<NUMBER_OF_UE_MAX; i++) { + if (abstraction_flag == 0) { - /* - if ((i == 1) && (phy_vars_eNB->cooperation_flag > 0) && (two_ues_connected == 1)) - break; - */ - if (phy_vars_eNB->mac_enabled==1) { - if (phy_vars_eNB->eNB_UE_stats[i].mode == RA_RESPONSE) { - process_Msg3(phy_vars_eNB,sched_subframe,i,harq_pid); - } - } + metric0 = rx_pucch(phy_vars_eNB, + pucch_format1a, + UE_id, + (uint16_t)n1_pucch0, + 0, //n2_pucch + 0, // shortened format + pucch_payload0, + frame, + subframe, + PUCCH1a_THRES); - /* - #ifdef DEBUG_PHY_PROC - if (phy_vars_eNB->ulsch_eNB[i]) { + if (metric0 < metric0_SR) + metric0=rx_pucch(phy_vars_eNB, + pucch_format1a, + UE_id, + phy_vars_eNB->scheduling_request_config[UE_id].sr_PUCCH_ResourceIndex, + 0, //n2_pucch + 0, // shortened format + pucch_payload0, + frame, + subframe, + PUCCH1a_THRES); + } + else { +#ifdef PHY_ABSTRACTION + metric0 = rx_pucch_emul(phy_vars_eNB,UE_id, + pucch_format1a, + 0, + pucch_payload0, + subframe); +#endif + } - LOG_D(PHY,"[eNB %d][PUSCH %d] frame %d, subframe %d rnti %x, alloc %d, Msg3 %d\n",phy_vars_eNB->Mod_id, - harq_pid,frame,subframe, - (phy_vars_eNB->ulsch_eNB[i]->rnti), - (phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->subframe_scheduling_flag), - (phy_vars_eNB->ulsch_eNB[i]->Msg3_flag) - ); - } - #endif - */ +#ifdef DEBUG_PHY_PROC + LOG_D(PHY,"[eNB %d][PDSCH %x] Frame %d subframe %d pucch1a (FDD) payload %d (metric %d)\n", + phy_vars_eNB->Mod_id, + phy_vars_eNB->dlsch_eNB[UE_id][0]->rnti, + frame,subframe, + pucch_payload0[0],metric0); +#endif - if ((phy_vars_eNB->ulsch_eNB[i]) && - (phy_vars_eNB->ulsch_eNB[i]->rnti>0) && - (phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->subframe_scheduling_flag==1)) { + process_HARQ_feedback(UE_id,sched_subframe,phy_vars_eNB, + 0,// pusch_flag + pucch_payload0, + 2, + SR_payload); - pusch_active = 1; - round = phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->round; + } // FDD + else { //TDD - 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)); - } + bundling_flag = phy_vars_eNB->pucch_config_dedicated[UE_id].tdd_AckNackFeedbackMode; + + // fix later for 2 TB case and format1b + + if ((frame_parms->frame_type==FDD) || + (bundling_flag==bundling) || + ((frame_parms->frame_type==TDD)&&(frame_parms->tdd_config==1)&&((subframe!=2)||(subframe!=7)))) { + format = pucch_format1a; + // msg("PUCCH 1a\n"); + } else { + format = pucch_format1b; + // msg("PUCCH 1b\n"); + } + + // if SR was detected, use the n1_pucch from SR + if (SR_payload==1) { #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, - frame,subframe,phy_vars_eNB->ulsch_eNB[i]->rnti,i); + LOG_D(PHY,"[eNB %d][PDSCH %x] Frame %d subframe %d Checking ACK/NAK (%d,%d,%d,%d) format %d with SR\n",phy_vars_eNB->Mod_id, + phy_vars_eNB->dlsch_eNB[UE_id][0]->rnti, + frame,subframe, + n1_pucch0,n1_pucch1,n1_pucch2,n1_pucch3,format); #endif + if (abstraction_flag == 0) + metric0_SR = rx_pucch(phy_vars_eNB, + format, + UE_id, + phy_vars_eNB->scheduling_request_config[UE_id].sr_PUCCH_ResourceIndex, + 0, //n2_pucch + 0, // shortened format + pucch_payload0, + frame, + subframe, + PUCCH1a_THRES); + else { +#ifdef PHY_ABSTRACTION + metric0 = rx_pucch_emul(phy_vars_eNB,UE_id, + format, + 0, + pucch_payload0, + subframe); +#endif + } + } else { //using n1_pucch0/n1_pucch1 resources #ifdef DEBUG_PHY_PROC + LOG_D(PHY,"[eNB %d][PDSCH %x] Frame %d subframe %d Checking ACK/NAK (%d,%d,%d,%d) format %d\n",phy_vars_eNB->Mod_id, + phy_vars_eNB->dlsch_eNB[UE_id][0]->rnti, + frame,subframe, + n1_pucch0,n1_pucch1,n1_pucch2,n1_pucch3,format); +#endif + metric0=0; + metric1=0; - if (phy_vars_eNB->ulsch_eNB[i]->Msg3_flag == 1) { - LOG_D(PHY,"[eNB %d] frame %d, subframe %d: Scheduling ULSCH Reception for Msg3 in Sector %d\n", - phy_vars_eNB->Mod_id, - frame, - subframe, - phy_vars_eNB->eNB_UE_stats[i].sector); - } else { - LOG_D(PHY,"[eNB %d] frame %d, subframe %d: Scheduling ULSCH Reception for UE %d Mode %s sect_id %d\n", - phy_vars_eNB->Mod_id, - frame, - subframe, - i, - mode_string[phy_vars_eNB->eNB_UE_stats[i].mode], - phy_vars_eNB->eNB_UE_stats[i].sector); - } - + // Check n1_pucch0 metric + if (n1_pucch0 != -1) { + if (abstraction_flag == 0) + metric0 = rx_pucch(phy_vars_eNB, + format, + UE_id, + (uint16_t)n1_pucch0, + 0, // n2_pucch + 0, // shortened format + pucch_payload0, + frame, + subframe, + PUCCH1a_THRES); + else { +#ifdef PHY_ABSTRACTION + metric0 = rx_pucch_emul(phy_vars_eNB,UE_id, + format, + 0, + pucch_payload0, + subframe); #endif + } + } - nPRS = phy_vars_eNB->lte_frame_parms.pusch_config_common.ul_ReferenceSignalsPUSCH.nPRS[subframe<<1]; + // Check n1_pucch1 metric + if (n1_pucch1 != -1) { + if (abstraction_flag == 0) + metric1 = rx_pucch(phy_vars_eNB, + format, + UE_id, + (uint16_t)n1_pucch1, + 0, //n2_pucch + 0, // shortened format + pucch_payload1, + frame, + subframe, + PUCCH1a_THRES); + else { +#ifdef PHY_ABSTRACTION + metric1 = rx_pucch_emul(phy_vars_eNB,UE_id, + format, + 1, + pucch_payload1, + subframe); - phy_vars_eNB->ulsch_eNB[i]->cyclicShift = (phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->n_DMRS2 + phy_vars_eNB->lte_frame_parms.pusch_config_common.ul_ReferenceSignalsPUSCH.cyclicShift + - nPRS)%12; - if (frame_parms->frame_type == FDD ) { - int sf = (subframe<4) ? (subframe+6) : (subframe-4); +#endif + } + } + } - if (phy_vars_eNB->dlsch_eNB[i][0]->subframe_tx[sf]>0) { // we have downlink transmission - phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->O_ACK = 1; - } else { - phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->O_ACK = 0; - } - } + if (SR_payload == 1) { + pucch_payload = pucch_payload0; - //#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, - phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->dci_alloc, - phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->rar_alloc, - phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->round, - phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->first_rb, - phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->nb_rb, - phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->mcs, - phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->TBS, - phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->rvidx, - phy_vars_eNB->ulsch_eNB[i]->cyclicShift, - phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->n_DMRS2, - 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 - start_meas(&phy_vars_eNB->ulsch_demodulation_stats); + if (bundling_flag == bundling) + pucch_sel = 2; + } else if (bundling_flag == multiplexing) { // multiplexing + no SR + pucch_payload = (metric1>metric0) ? pucch_payload1 : pucch_payload0; + pucch_sel = (metric1>metric0) ? 1 : 0; + } else { // bundling + no SR + if (n1_pucch1 != -1) + pucch_payload = pucch_payload1; + else if (n1_pucch0 != -1) + pucch_payload = pucch_payload0; - if (abstraction_flag==0) { - rx_ulsch(phy_vars_eNB, - sched_subframe, - phy_vars_eNB->eNB_UE_stats[i].sector, // this is the effective sector id - i, - phy_vars_eNB->ulsch_eNB, - 0); - } + pucch_sel = 2; // indicate that this is a bundled ACK/NAK + } -#ifdef PHY_ABSTRACTION - else { - rx_ulsch_emul(phy_vars_eNB, - subframe, - phy_vars_eNB->eNB_UE_stats[i].sector, // this is the effective sector id - i); +#ifdef DEBUG_PHY_PROC + LOG_D(PHY,"[eNB %d][PDSCH %x] Frame %d subframe %d ACK/NAK metric 0 %d, metric 1 %d, sel %d, (%d,%d)\n",phy_vars_eNB->Mod_id, + phy_vars_eNB->dlsch_eNB[UE_id][0]->rnti, + frame,subframe, + metric0,metric1,pucch_sel,pucch_payload[0],pucch_payload[1]); +#endif + process_HARQ_feedback(UE_id,sched_subframe,phy_vars_eNB, + 0,// pusch_flag + pucch_payload, + pucch_sel, + SR_payload); + } } -#endif - stop_meas(&phy_vars_eNB->ulsch_demodulation_stats); + } +} +void cba_procedures(const unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_eNB,int UE_id,int harq_pid,const uint8_t abstraction_flag) { - start_meas(&phy_vars_eNB->ulsch_decoding_stats); - - if (abstraction_flag == 0) { - ret = ulsch_decoding(phy_vars_eNB, - i, - sched_subframe, - 0, // control_only_flag - phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->V_UL_DAI, - 0); - } + uint8_t access_mode; + int num_active_cba_groups; + const int subframe = phy_vars_eNB->proc[sched_subframe].subframe_rx; + const int frame = phy_vars_eNB->proc[sched_subframe].frame_rx; + uint16_t rnti=0; + int ret=0; + num_active_cba_groups = phy_vars_eNB->ulsch_eNB[UE_id]->num_active_cba_groups; + + if ((phy_vars_eNB->ulsch_eNB[UE_id]) && + (num_active_cba_groups > 0) && + (phy_vars_eNB->ulsch_eNB[UE_id]->cba_rnti[UE_id%num_active_cba_groups]>0) && + (phy_vars_eNB->ulsch_eNB[UE_id]->harq_processes[harq_pid]->subframe_cba_scheduling_flag==1)) { + rnti=0; + +#ifdef DEBUG_PHY_PROC + LOG_D(PHY,"[eNB %d][PUSCH %d] frame %d subframe %d Checking PUSCH/ULSCH CBA Reception for UE %d with cba rnti %x mode %s\n", + phy_vars_eNB->Mod_id,harq_pid, + frame,subframe, + UE_id, (uint16_t)phy_vars_eNB->ulsch_eNB[UE_id]->cba_rnti[UE_id%num_active_cba_groups],mode_string[phy_vars_eNB->eNB_UE_stats[UE_id].mode]); +#endif + + if (abstraction_flag==0) { + rx_ulsch(phy_vars_eNB, + sched_subframe, + phy_vars_eNB->eNB_UE_stats[UE_id].sector, // this is the effective sector id + UE_id, + phy_vars_eNB->ulsch_eNB, + 0); + } + #ifdef PHY_ABSTRACTION - else { - ret = ulsch_decoding_emul(phy_vars_eNB, - sched_subframe, - i, - &rnti); - } - + else { + rx_ulsch_emul(phy_vars_eNB, + subframe, + phy_vars_eNB->eNB_UE_stats[UE_id].sector, // this is the effective sector id + UE_id); + } + #endif - stop_meas(&phy_vars_eNB->ulsch_decoding_stats); - - //#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, - phy_vars_eNB->ulsch_eNB[i]->rnti, - dB_fixed(phy_vars_eNB->lte_eNB_pusch_vars[i]->ulsch_power[0]), - dB_fixed(phy_vars_eNB->lte_eNB_pusch_vars[i]->ulsch_power[1]), - phy_vars_eNB->eNB_UE_stats[i].UL_rssi[0], - phy_vars_eNB->eNB_UE_stats[i].UL_rssi[1], - phy_vars_eNB->PHY_measurements_eNB->n0_power_dB[0], - phy_vars_eNB->PHY_measurements_eNB->n0_power_dB[1], - 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 - /* - 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++) { - phy_vars_eNB->eNB_UE_stats[i].UL_rssi[j] = dB_fixed(phy_vars_eNB->lte_eNB_pusch_vars[i]->ulsch_power_0[j]) - - phy_vars_eNB->rx_total_gain_eNB_dB; - phy_vars_eNB->eNB_UE_stats[i+1].UL_rssi[j] = dB_fixed(phy_vars_eNB->lte_eNB_pusch_vars[i]->ulsch_power_1[j]) - - phy_vars_eNB->rx_total_gain_eNB_dB; - } - #ifdef DEBUG_PHY_PROC - LOG_D(PHY,"[eNB %d] Frame %d subframe %d: ULSCH %d RX power UE0 (%d,%d) dB RX power UE1 (%d,%d)\n", - phy_vars_eNB->Mod_id,phy_vars_eNB->proc[sched_subframe].frame_tx,last_slot>>1,i, - dB_fixed(phy_vars_eNB->lte_eNB_pusch_vars[i]->ulsch_power_0[0]), - dB_fixed(phy_vars_eNB->lte_eNB_pusch_vars[i]->ulsch_power_0[1]), - dB_fixed(phy_vars_eNB->lte_eNB_pusch_vars[i]->ulsch_power_1[0]), - dB_fixed(phy_vars_eNB->lte_eNB_pusch_vars[i]->ulsch_power_1[1])); - #endif - } - else { - */ - - //compute the expected ULSCH RX power (for the stats) - phy_vars_eNB->ulsch_eNB[(uint32_t)i]->harq_processes[harq_pid]->delta_TF = - get_hundred_times_delta_IF_eNB(phy_vars_eNB,i,harq_pid, 0); // 0 means bw_factor is not considered - - //dump_ulsch(phy_vars_eNB, sched_subframe, i); - - phy_vars_eNB->eNB_UE_stats[i].ulsch_decoding_attempts[harq_pid][phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->round]++; -#ifdef DEBUG_PHY_PROC - LOG_D(PHY,"[eNB %d][PUSCH %d] frame %d subframe %d UE %d harq_pid %d Clearing subframe_scheduling_flag\n", - phy_vars_eNB->Mod_id,harq_pid,frame,subframe,i,harq_pid); + + if (abstraction_flag == 0) { + ret = ulsch_decoding(phy_vars_eNB, + UE_id, + sched_subframe, + 0, // control_only_flag + phy_vars_eNB->ulsch_eNB[UE_id]->harq_processes[harq_pid]->V_UL_DAI, + phy_vars_eNB->ulsch_eNB[UE_id]->harq_processes[harq_pid]->nb_rb>20 ? 1 : 0); + } + +#ifdef PHY_ABSTRACTION + else { + ret = ulsch_decoding_emul(phy_vars_eNB, + sched_subframe, + UE_id, + &rnti); + } + #endif - phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->subframe_scheduling_flag=0; - - if (phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->cqi_crc_status == 1) { + + if (phy_vars_eNB->ulsch_eNB[UE_id]->harq_processes[harq_pid]->cqi_crc_status == 1) { #ifdef DEBUG_PHY_PROC - //if (((phy_vars_eNB->proc[sched_subframe].frame_tx%10) == 0) || (phy_vars_eNB->proc[sched_subframe].frame_tx < 50)) - print_CQI(phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->o,phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->uci_format,0,phy_vars_eNB->lte_frame_parms.N_RB_DL); + + print_CQI(phy_vars_eNB->ulsch_eNB[UE_id]->harq_processes[harq_pid]->o,phy_vars_eNB->ulsch_eNB[UE_id]->harq_processes[harq_pid]->uci_format,0,phy_vars_eNB->lte_frame_parms.N_RB_DL); +#endif + access_mode = UNKNOWN_ACCESS; + extract_CQI(phy_vars_eNB->ulsch_eNB[UE_id]->harq_processes[harq_pid]->o, + phy_vars_eNB->ulsch_eNB[UE_id]->harq_processes[harq_pid]->uci_format, + &phy_vars_eNB->eNB_UE_stats[UE_id], + phy_vars_eNB->lte_frame_parms.N_RB_DL, + &rnti, &access_mode); + phy_vars_eNB->eNB_UE_stats[UE_id].rank = phy_vars_eNB->ulsch_eNB[UE_id]->harq_processes[harq_pid]->o_RI[0]; + } + + phy_vars_eNB->ulsch_eNB[UE_id]->harq_processes[harq_pid]->subframe_cba_scheduling_flag=0; + phy_vars_eNB->ulsch_eNB[UE_id]->harq_processes[harq_pid]->status= SCH_IDLE; + + if ((num_active_cba_groups > 0) && + (UE_id + num_active_cba_groups < NUMBER_OF_UE_MAX) && + (phy_vars_eNB->ulsch_eNB[UE_id+num_active_cba_groups]->cba_rnti[UE_id%num_active_cba_groups] > 0 ) && + (phy_vars_eNB->ulsch_eNB[UE_id+num_active_cba_groups]->num_active_cba_groups> 0)) { +#ifdef DEBUG_PHY_PROC + LOG_D(PHY,"[eNB %d][PUSCH %d] frame %d subframe %d UE %d harq_pid %d resetting the subframe_scheduling_flag for Ue %d cba groups %d members\n", + phy_vars_eNB->Mod_id,harq_pid,frame,subframe,UE_id,harq_pid, + UE_id+num_active_cba_groups, UE_id%phy_vars_eNB->ulsch_eNB[UE_id]->num_active_cba_groups); #endif - extract_CQI(phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->o, - phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->uci_format, - &phy_vars_eNB->eNB_UE_stats[i], - phy_vars_eNB->lte_frame_parms.N_RB_DL, - &rnti, &access_mode); - phy_vars_eNB->eNB_UE_stats[i].rank = phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->o_RI[0]; + phy_vars_eNB->ulsch_eNB[UE_id+num_active_cba_groups]->harq_processes[harq_pid]->subframe_cba_scheduling_flag=1; + phy_vars_eNB->ulsch_eNB[UE_id+num_active_cba_groups]->harq_processes[harq_pid]->status= CBA_ACTIVE; + phy_vars_eNB->ulsch_eNB[UE_id+num_active_cba_groups]->harq_processes[harq_pid]->TBS=phy_vars_eNB->ulsch_eNB[UE_id]->harq_processes[harq_pid]->TBS; } if (ret == (1+MAX_TURBO_ITERATIONS)) { + phy_vars_eNB->eNB_UE_stats[UE_id].ulsch_round_errors[harq_pid][phy_vars_eNB->ulsch_eNB[UE_id]->harq_processes[harq_pid]->round]++; + phy_vars_eNB->ulsch_eNB[UE_id]->harq_processes[harq_pid]->phich_active = 1; + phy_vars_eNB->ulsch_eNB[UE_id]->harq_processes[harq_pid]->phich_ACK = 0; + phy_vars_eNB->ulsch_eNB[UE_id]->harq_processes[harq_pid]->round++; + } // ulsch in error + else { + LOG_D(PHY,"[eNB %d][PUSCH %d] Frame %d subframe %d ULSCH received, setting round to 0, PHICH ACK\n", + phy_vars_eNB->Mod_id,harq_pid, + frame,subframe); - /* - if (phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->round>0) { - dump_ulsch(phy_vars_eNB, sched_subframe, i); - mac_xface->macphy_exit("retransmission in error"); - } - */ - - phy_vars_eNB->eNB_UE_stats[i].ulsch_round_errors[harq_pid][phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->round]++; - 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 = 0; - phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->round++; + phy_vars_eNB->ulsch_eNB[UE_id]->harq_processes[harq_pid]->phich_active = 1; + phy_vars_eNB->ulsch_eNB[UE_id]->harq_processes[harq_pid]->phich_ACK = 1; + phy_vars_eNB->ulsch_eNB[UE_id]->harq_processes[harq_pid]->round = 0; + phy_vars_eNB->eNB_UE_stats[UE_id].ulsch_consecutive_errors = 0; +#ifdef DEBUG_PHY_PROC +#ifdef DEBUG_ULSCH + LOG_D(PHY,"[eNB] Frame %d, Subframe %d : ULSCH SDU (RX harq_pid %d) %d bytes:", + frame,subframe, + harq_pid,phy_vars_eNB->ulsch_eNB[UE_id]->harq_processes[harq_pid]->TBS>>3); - LOG_D(PHY,"[eNB][PUSCH %d] Increasing to round %d\n",harq_pid,phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->round); + for (j=0; j<phy_vars_eNB->ulsch_eNB[UE_id]->harq_processes[harq_pid]->TBS>>3; j++) + LOG_T(PHY,"%x.",phy_vars_eNB->ulsch_eNB[UE_id]->harq_processes[harq_pid]->b[j]); - if (phy_vars_eNB->ulsch_eNB[i]->Msg3_flag == 1) { - LOG_I(PHY,"[eNB %d/%d][RAPROC] frame %d, subframe %d, UE %d: Error receiving ULSCH (Msg3), round %d/%d\n", - phy_vars_eNB->Mod_id, - phy_vars_eNB->CC_id, - frame,subframe, i, - phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->round-1, - phy_vars_eNB->lte_frame_parms.maxHARQ_Msg3Tx-1); + LOG_T(PHY,"\n"); +#endif +#endif - LOG_I(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, - phy_vars_eNB->ulsch_eNB[i]->rnti, - dB_fixed(phy_vars_eNB->lte_eNB_pusch_vars[i]->ulsch_power[0]), - dB_fixed(phy_vars_eNB->lte_eNB_pusch_vars[i]->ulsch_power[1]), - phy_vars_eNB->eNB_UE_stats[i].UL_rssi[0], - phy_vars_eNB->eNB_UE_stats[i].UL_rssi[1], - phy_vars_eNB->PHY_measurements_eNB->n0_power_dB[0], - phy_vars_eNB->PHY_measurements_eNB->n0_power_dB[1], - 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); + if (access_mode > UNKNOWN_ACCESS) { + LOG_D(PHY,"[eNB %d] Frame %d, Subframe %d : received ULSCH SDU from CBA transmission, UE (%d,%x), CBA (group %d, rnti %x)\n", + phy_vars_eNB->Mod_id, frame,subframe, + UE_id, phy_vars_eNB->ulsch_eNB[UE_id]->rnti, + UE_id % phy_vars_eNB->ulsch_eNB[UE_id]->num_active_cba_groups, phy_vars_eNB->ulsch_eNB[UE_id]->cba_rnti[UE_id%num_active_cba_groups]); - if (phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->round == - phy_vars_eNB->lte_frame_parms.maxHARQ_Msg3Tx) { - LOG_I(PHY,"[eNB %d][RAPROC] maxHARQ_Msg3Tx reached, abandoning RA procedure for UE %d\n", - phy_vars_eNB->Mod_id, i); - phy_vars_eNB->eNB_UE_stats[i].mode = PRACH; - if (phy_vars_eNB->mac_enabled==1) { - mac_xface->cancel_ra_proc(phy_vars_eNB->Mod_id, - phy_vars_eNB->CC_id, - frame, - phy_vars_eNB->eNB_UE_stats[i].crnti); - } - remove_ue(phy_vars_eNB->eNB_UE_stats[i].crnti,phy_vars_eNB,abstraction_flag); - phy_vars_eNB->ulsch_eNB[(uint32_t)i]->Msg3_active = 0; - //phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->phich_active = 0; + // detect if there is a CBA collision + if (phy_vars_eNB->cba_last_reception[UE_id%num_active_cba_groups] == 0 ) { + mac_xface->rx_sdu(phy_vars_eNB->Mod_id, + phy_vars_eNB->CC_id, + frame,subframe, + phy_vars_eNB->ulsch_eNB[UE_id]->rnti, + phy_vars_eNB->ulsch_eNB[UE_id]->harq_processes[harq_pid]->b, + phy_vars_eNB->ulsch_eNB[UE_id]->harq_processes[harq_pid]->TBS>>3, + harq_pid, + NULL); + phy_vars_eNB->cba_last_reception[UE_id%num_active_cba_groups]+=1;//(subframe); } else { - // activate retransmission for Msg3 (signalled to UE PHY by PHICH (not MAC/DCI) - phy_vars_eNB->ulsch_eNB[(uint32_t)i]->Msg3_active = 1; + if (phy_vars_eNB->cba_last_reception[UE_id%num_active_cba_groups] == 1 ) + LOG_N(PHY,"[eNB%d] Frame %d subframe %d : first CBA collision detected \n ", + phy_vars_eNB->Mod_id,frame,subframe); - get_Msg3_alloc_ret(&phy_vars_eNB->lte_frame_parms, - subframe, - frame, - &phy_vars_eNB->ulsch_eNB[i]->Msg3_frame, - &phy_vars_eNB->ulsch_eNB[i]->Msg3_subframe); - }/* - - LOG_D(PHY,"[eNB] Frame %d, Subframe %d : ULSCH SDU (RX harq_pid %d) %d bytes:",frame,subframe, - harq_pid,phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->TBS>>3); - for (j=0;j<phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->TBS>>3;j++) - printf("%x.",phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->c[0][j]); - printf("\n"); - */ - // dump_ulsch(phy_vars_eNB,sched_subframe,i); - //#ifndef EXMIMO_IOT - LOG_W(PHY,"[eNB] Frame %d, Subframe %d: Msg3 in error, i = %d \n", frame,subframe,i); - //#else - //mac_exit_wrapper("Msg3 error"); - //#endif - } // This is Msg3 error - else { //normal ULSCH - LOG_D(PHY,"[eNB %d][PUSCH %d] frame %d subframe %d UE %d Error receiving ULSCH, round %d/%d (ACK %d,%d)\n", - phy_vars_eNB->Mod_id,harq_pid, - frame,subframe, i, - phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->round-1, - phy_vars_eNB->ulsch_eNB[i]->Mdlharq, - 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]); + LOG_N(PHY,"[eNB%d] Frame %d subframe %d : CBA collision set SR for UE %d in group %d \n ", + phy_vars_eNB->Mod_id,frame,subframe, + phy_vars_eNB->cba_last_reception[UE_id%num_active_cba_groups],UE_id%num_active_cba_groups ); -#if defined(MESSAGE_CHART_GENERATOR_PHY) - MSC_LOG_RX_DISCARDED_MESSAGE( - MSC_PHY_ENB,MSC_PHY_UE, - NULL,0, - "%05u:%02u ULSCH received rnti %x harq id %u round %d", - frame,subframe, - phy_vars_eNB->ulsch_eNB[i]->rnti,harq_pid, - phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->round-1 - ); -#endif - /* - LOG_T(PHY,"[eNB] Frame %d, Subframe %d : ULSCH SDU (RX harq_pid %d) %d bytes:\n",frame,subframe, - harq_pid,phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->TBS>>3); - if (phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->c[0]!=NULL){ - for (j=0;j<phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->TBS>>3;j++) - LOG_T(PHY,"%x.",phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->c[0][j]); - LOG_T(PHY,"\n"); + phy_vars_eNB->cba_last_reception[UE_id%num_active_cba_groups]+=1; + + mac_xface->SR_indication(phy_vars_eNB->Mod_id, + phy_vars_eNB->CC_id, + frame, + phy_vars_eNB->dlsch_eNB[UE_id][0]->rnti,subframe); } - */ + } // UNKNOWN_ACCESS + } // ULSCH CBA not in error + } +} - // dump_ulsch(phy_vars_eNB,sched_subframe,i); - //mac_exit_wrapper("ULSCH error"); +void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_eNB,const uint8_t abstraction_flag,const relaying_type_t r_type) +{ + //RX processing + UNUSED(r_type); + uint32_t l, ret=0,i,j,k; + uint32_t harq_pid, harq_idx, round; + uint8_t nPRS; + LTE_DL_FRAME_PARMS *frame_parms=&phy_vars_eNB->lte_frame_parms; + int sync_pos; + uint16_t rnti=0; + uint8_t access_mode; - if (phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->round== phy_vars_eNB->ulsch_eNB[i]->Mdlharq) { - LOG_D(PHY,"[eNB %d][PUSCH %d] frame %d subframe %d UE %d ULSCH Mdlharq %d reached\n", - phy_vars_eNB->Mod_id,harq_pid, - frame,subframe, i, - phy_vars_eNB->ulsch_eNB[i]->Mdlharq); + const int subframe = phy_vars_eNB->proc[sched_subframe].subframe_rx; + const int frame = phy_vars_eNB->proc[sched_subframe].frame_rx; - phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->round=0; - phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->phich_active=0; - phy_vars_eNB->eNB_UE_stats[i].ulsch_errors[harq_pid]++; - phy_vars_eNB->eNB_UE_stats[i].ulsch_consecutive_errors++; - //dump_ulsch(phy_vars_eNB, sched_subframe, i); - } - } - } // ulsch in error - else { - if (phy_vars_eNB->ulsch_eNB[i]->Msg3_flag == 1) { - LOG_I(PHY,"[eNB %d][PUSCH %d] Frame %d subframe %d ULSCH received, setting round to 0, PHICH ACK\n", - phy_vars_eNB->Mod_id,harq_pid, - frame,subframe); - LOG_I(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, - phy_vars_eNB->ulsch_eNB[i]->rnti, - dB_fixed(phy_vars_eNB->lte_eNB_pusch_vars[i]->ulsch_power[0]), - dB_fixed(phy_vars_eNB->lte_eNB_pusch_vars[i]->ulsch_power[1]), - phy_vars_eNB->eNB_UE_stats[i].UL_rssi[0], - phy_vars_eNB->eNB_UE_stats[i].UL_rssi[1], - phy_vars_eNB->PHY_measurements_eNB->n0_power_dB[0], - phy_vars_eNB->PHY_measurements_eNB->n0_power_dB[1], - 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); - } -#if defined(MESSAGE_CHART_GENERATOR_PHY) - MSC_LOG_RX_MESSAGE( - MSC_PHY_ENB,MSC_PHY_UE, - NULL,0, - "%05u:%02u ULSCH received rnti %x harq id %u", - frame,subframe, - phy_vars_eNB->ulsch_eNB[i]->rnti,harq_pid - ); + AssertFatal(sched_subframe < NUM_ENB_THREADS, "Bad sched_subframe %d", sched_subframe); + + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_RX,1); + start_meas(&phy_vars_eNB->phy_proc_rx); +#ifdef DEBUG_PHY_PROC + LOG_D(PHY,"[eNB %d] Frame %d: Doing phy_procedures_eNB_RX(%d)\n",phy_vars_eNB->Mod_id,frame, subframe); #endif - 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; - phy_vars_eNB->eNB_UE_stats[i].ulsch_consecutive_errors = 0; - if (phy_vars_eNB->ulsch_eNB[i]->Msg3_flag == 1) { - if (phy_vars_eNB->mac_enabled==1) { - //#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 - mac_xface->rx_sdu(phy_vars_eNB->Mod_id, - phy_vars_eNB->CC_id, - frame,subframe, - phy_vars_eNB->ulsch_eNB[i]->rnti, - phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->b, - phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->TBS>>3, - harq_pid, - &phy_vars_eNB->ulsch_eNB[i]->Msg3_flag); - - // 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, - phy_vars_eNB->CC_id, - frame, - phy_vars_eNB->eNB_UE_stats[i].crnti); - remove_ue(phy_vars_eNB->eNB_UE_stats[i].crnti,phy_vars_eNB,abstraction_flag); - phy_vars_eNB->ulsch_eNB[(uint32_t)i]->Msg3_active = 0; - } + T(T_ENB_UL_TICK, T_INT(phy_vars_eNB->Mod_id), T_INT(frame), T_INT(subframe)); - /* - mac_xface->terminate_ra_proc(phy_vars_eNB->Mod_id, - frame, - phy_vars_eNB->ulsch_eNB[i]->rnti, - phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->b, - phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->TBS>>3); - */ - } + T(T_ENB_INPUT_SIGNAL, T_INT(phy_vars_eNB->Mod_id), T_INT(frame), T_INT(subframe), T_INT(0), + T_BUFFER(&phy_vars_eNB->lte_eNB_common_vars.rxdata[0][0][subframe*phy_vars_eNB->lte_frame_parms.samples_per_tti], + phy_vars_eNB->lte_frame_parms.samples_per_tti * 4)); - phy_vars_eNB->eNB_UE_stats[i].mode = PUSCH; - phy_vars_eNB->ulsch_eNB[i]->Msg3_flag = 0; + 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; - //#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 + if (abstraction_flag == 0) { + remove_7_5_kHz(phy_vars_eNB,subframe<<1); + remove_7_5_kHz(phy_vars_eNB,(subframe<<1)+1); + } - for (k=0; k<8; k++) { //harq_processes - for (j=0; j<phy_vars_eNB->dlsch_eNB[i][0]->Mdlharq; j++) { - phy_vars_eNB->eNB_UE_stats[i].dlsch_NAK[k][j]=0; - phy_vars_eNB->eNB_UE_stats[i].dlsch_ACK[k][j]=0; - phy_vars_eNB->eNB_UE_stats[i].dlsch_trials[k][j]=0; - } - - phy_vars_eNB->eNB_UE_stats[i].dlsch_l2_errors[k]=0; - phy_vars_eNB->eNB_UE_stats[i].ulsch_errors[k]=0; - phy_vars_eNB->eNB_UE_stats[i].ulsch_consecutive_errors=0; - - for (j=0; j<phy_vars_eNB->ulsch_eNB[i]->Mdlharq; j++) { - phy_vars_eNB->eNB_UE_stats[i].ulsch_decoding_attempts[k][j]=0; - phy_vars_eNB->eNB_UE_stats[i].ulsch_decoding_attempts_last[k][j]=0; - phy_vars_eNB->eNB_UE_stats[i].ulsch_round_errors[k][j]=0; - phy_vars_eNB->eNB_UE_stats[i].ulsch_round_fer[k][j]=0; - } - } + // check if we have to detect PRACH first + if (is_prach_subframe(&phy_vars_eNB->lte_frame_parms,frame,subframe)>0) { + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_PRACH_RX,1); + prach_procedures(phy_vars_eNB,sched_subframe,abstraction_flag); + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_PRACH_RX,0); + } - phy_vars_eNB->eNB_UE_stats[i].dlsch_sliding_cnt=0; - phy_vars_eNB->eNB_UE_stats[i].dlsch_NAK_round0=0; - phy_vars_eNB->eNB_UE_stats[i].dlsch_mcs_offset=0; + if (abstraction_flag == 0) { + start_meas(&phy_vars_eNB->ofdm_demod_stats); - //mac_xface->macphy_exit("Mode PUSCH. Exiting.\n"); - } else { + for (l=0; l<phy_vars_eNB->lte_frame_parms.symbols_per_tti/2; l++) { -#ifdef DEBUG_PHY_PROC -#ifdef DEBUG_ULSCH - LOG_D(PHY,"[eNB] Frame %d, Subframe %d : ULSCH SDU (RX harq_pid %d) %d bytes:",frame,subframe, - harq_pid,phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->TBS>>3); + slot_fep_ul(&phy_vars_eNB->lte_frame_parms, + &phy_vars_eNB->lte_eNB_common_vars, + l, + subframe<<1, + 0, + 0 + ); + slot_fep_ul(&phy_vars_eNB->lte_frame_parms, + &phy_vars_eNB->lte_eNB_common_vars, + l, + (subframe<<1)+1, + 0, + 0 + ); + } - for (j=0; j<phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->TBS>>3; j++) - LOG_T(PHY,"%x.",phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->b[j]); + stop_meas(&phy_vars_eNB->ofdm_demod_stats); + } - LOG_T(PHY,"\n"); -#endif -#endif - //dump_ulsch(phy_vars_eNB,sched_subframe,i); + // Check for active processes in current subframe + harq_pid = subframe2harq_pid(&phy_vars_eNB->lte_frame_parms, + frame,subframe); + // reset the cba flag used for collision detection + for (i=0; i < NUM_MAX_CBA_GROUP; i++) { + phy_vars_eNB->cba_last_reception[i]=0; + } - if (phy_vars_eNB->mac_enabled==1) { - // if (phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->calibration_flag == 0) { - mac_xface->rx_sdu(phy_vars_eNB->Mod_id, - phy_vars_eNB->CC_id, - frame,subframe, - phy_vars_eNB->ulsch_eNB[i]->rnti, - phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->b, - phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->TBS>>3, - harq_pid, - NULL); - //} - /* - else { - // Retrieve calibration information and do whatever - LOG_D(PHY,"[eNB][Auto-Calibration] Frame %d, Subframe %d : ULSCH PDU (RX) %d bytes\n",phy_vars_eNB->proc[sched_subframe].frame_tx,subframe,phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->TBS>>3); - } - */ -#ifdef LOCALIZATION - start_meas(&phy_vars_eNB->localization_stats); - aggregate_eNB_UE_localization_stats(phy_vars_eNB, - i, - frame, - subframe, - get_hundred_times_delta_IF_eNB(phy_vars_eNB,i,harq_pid, 1)/100); - stop_meas(&phy_vars_eNB->localization_stats); -#endif + // Do PUCCH processing first - } - } + for (i=0; i<NUMBER_OF_UE_MAX; i++) { + pucch_procedures(sched_subframe,phy_vars_eNB,i,harq_pid,abstraction_flag); + } - // estimate timing advance for MAC - if (abstraction_flag == 0) { - sync_pos = lte_est_timing_advance_pusch(phy_vars_eNB,i,sched_subframe); - phy_vars_eNB->eNB_UE_stats[i].timing_advance_update = sync_pos - phy_vars_eNB->lte_frame_parms.nb_prefix_samples/4; //to check - } + for (i=0; i<NUMBER_OF_UE_MAX; i++) { -#ifdef DEBUG_PHY_PROC - LOG_D(PHY,"[eNB %d] frame %d, subframe %d: user %d in sector %d: timing advance = %d\n", - phy_vars_eNB->Mod_id, - frame, subframe, - i, sect_id, - phy_vars_eNB->eNB_UE_stats[i].timing_advance_update); -#endif + // check for Msg3 + if (phy_vars_eNB->mac_enabled==1) { + if (phy_vars_eNB->eNB_UE_stats[i].mode == RA_RESPONSE) { + process_Msg3(phy_vars_eNB,sched_subframe,i,harq_pid); + } + } - } // ulsch not in error + phy_vars_eNB->pusch_stats_rb[i][(frame*10)+subframe] = -63; + phy_vars_eNB->pusch_stats_round[i][(frame*10)+subframe] = 0; + phy_vars_eNB->pusch_stats_mcs[i][(frame*10)+subframe] = -63; - // process HARQ feedback -#ifdef DEBUG_PHY_PROC - LOG_D(PHY,"[eNB %d][PDSCH %x] Frame %d subframe %d, Processing HARQ feedback for UE %d (after PUSCH)\n",phy_vars_eNB->Mod_id, - phy_vars_eNB->dlsch_eNB[i][0]->rnti, - frame,subframe, - i); -#endif - process_HARQ_feedback(i, - sched_subframe, - phy_vars_eNB, - 1, // pusch_flag - 0, - 0, - 0); + if ((phy_vars_eNB->ulsch_eNB[i]) && + (phy_vars_eNB->ulsch_eNB[i]->rnti>0) && + (phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->subframe_scheduling_flag==1)) { + // UE is has ULSCH scheduling + 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] Frame %d subframe %d, sect %d: received ULSCH harq_pid %d for UE %d, ret = %d, CQI CRC Status %d, ACK %d,%d, ulsch_errors %d/%d\n", - phy_vars_eNB->Mod_id,frame,subframe, - phy_vars_eNB->eNB_UE_stats[i].sector, - harq_pid, - i, - ret, - phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->cqi_crc_status, - 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], - phy_vars_eNB->eNB_UE_stats[i].ulsch_errors[harq_pid], - phy_vars_eNB->eNB_UE_stats[i].ulsch_decoding_attempts[harq_pid][0]); + 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, + frame,subframe,phy_vars_eNB->ulsch_eNB[i]->rnti,i); #endif - } - -#ifdef PUCCH - else if ((phy_vars_eNB->dlsch_eNB[i][0]) && - (phy_vars_eNB->dlsch_eNB[i][0]->rnti>0)) { // check for PUCCH + if (phy_vars_eNB->ulsch_eNB[i]->Msg3_flag == 1) { + LOG_D(PHY,"[eNB %d] frame %d, subframe %d: Scheduling ULSCH Reception for Msg3 in Sector %d\n", + phy_vars_eNB->Mod_id, + frame, + subframe, + phy_vars_eNB->eNB_UE_stats[i].sector); + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_ULSCH_MSG3,1); + } else { + LOG_D(PHY,"[eNB %d] frame %d, subframe %d: Scheduling ULSCH Reception for UE %d Mode %s\n", + phy_vars_eNB->Mod_id, + frame, + subframe, + i, + mode_string[phy_vars_eNB->eNB_UE_stats[i].mode]); + } - // check SR availability - do_SR = is_SR_subframe(phy_vars_eNB,i,sched_subframe); - // do_SR = 0; - // Now ACK/NAK - // First check subframe_tx flag for earlier subframes - get_n1_pucch_eNB(phy_vars_eNB, - i, - sched_subframe, - &n1_pucch0, - &n1_pucch1, - &n1_pucch2, - &n1_pucch3); + nPRS = phy_vars_eNB->lte_frame_parms.pusch_config_common.ul_ReferenceSignalsPUSCH.nPRS[subframe<<1]; - LOG_D(PHY,"[eNB %d][PDSCH %x] Frame %d, subframe %d Checking for PUCCH (%d,%d,%d,%d) SR %d\n", - phy_vars_eNB->Mod_id,phy_vars_eNB->dlsch_eNB[i][0]->rnti, - frame,subframe, - n1_pucch0,n1_pucch1,n1_pucch2,n1_pucch3,do_SR); + phy_vars_eNB->ulsch_eNB[i]->cyclicShift = (phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->n_DMRS2 + phy_vars_eNB->lte_frame_parms.pusch_config_common.ul_ReferenceSignalsPUSCH.cyclicShift + + nPRS)%12; - if ((n1_pucch0==-1) && (n1_pucch1==-1) && (do_SR==0)) { // no TX PDSCH that have to be checked and no SR for this UE_id - } else { - // otherwise we have some PUCCH detection to do + if (frame_parms->frame_type == FDD ) { + int sf = (subframe<4) ? (subframe+6) : (subframe-4); - // 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 (phy_vars_eNB->dlsch_eNB[i][0]->subframe_tx[sf]>0) { // we have downlink transmission + phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->O_ACK = 1; + } else { + phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->O_ACK = 0; + } + } - if (do_SR == 1) { - phy_vars_eNB->eNB_UE_stats[i].sr_total++; + 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, + phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->dci_alloc, + phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->rar_alloc, + phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->round, + phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->first_rb, + phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->nb_rb, + phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->mcs, + phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->TBS, + phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->rvidx, + phy_vars_eNB->ulsch_eNB[i]->cyclicShift, + phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->n_DMRS2, + 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); + phy_vars_eNB->pusch_stats_rb[i][(frame*10)+subframe] = phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->nb_rb; + phy_vars_eNB->pusch_stats_round[i][(frame*10)+subframe] = phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->round; + phy_vars_eNB->pusch_stats_mcs[i][(frame*10)+subframe] = phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->mcs; + start_meas(&phy_vars_eNB->ulsch_demodulation_stats); - if (abstraction_flag == 0) - 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); + if (abstraction_flag==0) { + rx_ulsch(phy_vars_eNB, + sched_subframe, + phy_vars_eNB->eNB_UE_stats[i].sector, // this is the effective sector id + i, + phy_vars_eNB->ulsch_eNB, + 0); + } #ifdef PHY_ABSTRACTION - else { - 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); - } + else { + rx_ulsch_emul(phy_vars_eNB, + subframe, + phy_vars_eNB->eNB_UE_stats[i].sector, // this is the effective sector id + i); + } #endif + stop_meas(&phy_vars_eNB->ulsch_demodulation_stats); - if (SR_payload == 1) { - LOG_D(PHY,"[eNB %d][SR %x] Frame %d subframe %d Got SR for PUSCH, transmitting to MAC\n",phy_vars_eNB->Mod_id, - phy_vars_eNB->ulsch_eNB[i]->rnti,frame,subframe); - phy_vars_eNB->eNB_UE_stats[i].sr_received++; - if (phy_vars_eNB->first_sr[i] == 1) { // this is the first request for uplink after Connection Setup, so clear HARQ process 0 use for Msg4 - /* is this test necessary? */ - if (phy_vars_eNB->dlsch_eNB[i][0]->harq_processes[0]->status != SCH_IDLE) - put_harq_pid_in_freelist(phy_vars_eNB->dlsch_eNB[i][0], 0); - phy_vars_eNB->first_sr[i] = 0; - phy_vars_eNB->dlsch_eNB[i][0]->harq_processes[0]->round=0; - phy_vars_eNB->dlsch_eNB[i][0]->harq_processes[0]->status=SCH_IDLE; - LOG_D(PHY,"[eNB %d][SR %x] Frame %d subframe %d First SR\n", - phy_vars_eNB->Mod_id, - phy_vars_eNB->ulsch_eNB[i]->rnti,frame,subframe); - } + start_meas(&phy_vars_eNB->ulsch_decoding_stats); - if (phy_vars_eNB->mac_enabled==1) { - mac_xface->SR_indication(phy_vars_eNB->Mod_id, - phy_vars_eNB->CC_id, - frame, - phy_vars_eNB->dlsch_eNB[i][0]->rnti,subframe); - } - } - }// do_SR==1 + if (abstraction_flag == 0) { + ret = ulsch_decoding(phy_vars_eNB, + i, + sched_subframe, + 0, // control_only_flag + phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->V_UL_DAI, + phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->nb_rb>20 ? 1 : 0); + } - 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; +#ifdef PHY_ABSTRACTION + else { + ret = ulsch_decoding_emul(phy_vars_eNB, + sched_subframe, + i, + &rnti); + } - 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); +#endif + stop_meas(&phy_vars_eNB->ulsch_decoding_stats); - if (abstraction_flag == 0) { + 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, + phy_vars_eNB->ulsch_eNB[i]->rnti, + dB_fixed(phy_vars_eNB->lte_eNB_pusch_vars[i]->ulsch_power[0]), + dB_fixed(phy_vars_eNB->lte_eNB_pusch_vars[i]->ulsch_power[1]), + phy_vars_eNB->eNB_UE_stats[i].UL_rssi[0], + phy_vars_eNB->eNB_UE_stats[i].UL_rssi[1], + phy_vars_eNB->PHY_measurements_eNB->n0_power_dB[0], + phy_vars_eNB->PHY_measurements_eNB->n0_power_dB[1], + 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); + //compute the expected ULSCH RX power (for the stats) + phy_vars_eNB->ulsch_eNB[(uint32_t)i]->harq_processes[harq_pid]->delta_TF = + get_hundred_times_delta_IF_eNB(phy_vars_eNB,i,harq_pid, 0); // 0 means bw_factor is not considered - metric0 = rx_pucch(phy_vars_eNB, - pucch_format1a, - i, - (uint16_t)n1_pucch0, - 0, //n2_pucch - 0, // shortened format - pucch_payload0, - subframe, - PUCCH1a_THRES); + //dump_ulsch(phy_vars_eNB, sched_subframe, i); - 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, - pucch_format1a, - 0, - pucch_payload0, - subframe); + phy_vars_eNB->eNB_UE_stats[i].ulsch_decoding_attempts[harq_pid][phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->round]++; +#ifdef DEBUG_PHY_PROC + LOG_D(PHY,"[eNB %d][PUSCH %d] frame %d subframe %d UE %d harq_pid %d Clearing subframe_scheduling_flag\n", + phy_vars_eNB->Mod_id,harq_pid,frame,subframe,i,harq_pid); #endif - } + phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->subframe_scheduling_flag=0; + if (phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->cqi_crc_status == 1) { #ifdef DEBUG_PHY_PROC - LOG_D(PHY,"[eNB %d][PDSCH %x] Frame %d subframe %d pucch1a (FDD) payload %d (metric %d)\n", - phy_vars_eNB->Mod_id, - phy_vars_eNB->dlsch_eNB[i][0]->rnti, - frame,subframe, - pucch_payload0[0],metric0); + //if (((phy_vars_eNB->proc[sched_subframe].frame_tx%10) == 0) || (phy_vars_eNB->proc[sched_subframe].frame_tx < 50)) + print_CQI(phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->o,phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->uci_format,0,phy_vars_eNB->lte_frame_parms.N_RB_DL); #endif + extract_CQI(phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->o, + phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->uci_format, + &phy_vars_eNB->eNB_UE_stats[i], + phy_vars_eNB->lte_frame_parms.N_RB_DL, + &rnti, &access_mode); + phy_vars_eNB->eNB_UE_stats[i].rank = phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->o_RI[0]; - process_HARQ_feedback(i,sched_subframe,phy_vars_eNB, - 0,// pusch_flag - pucch_payload0, - 2, - SR_payload); + } - } // FDD - else { //TDD + if (phy_vars_eNB->ulsch_eNB[i]->Msg3_flag == 1) + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_ULSCH_MSG3,0); - bundling_flag = phy_vars_eNB->pucch_config_dedicated[i].tdd_AckNackFeedbackMode; + if (ret == (1+MAX_TURBO_ITERATIONS)) { + T(T_ENB_ULSCH_UE_NACK, T_INT(phy_vars_eNB->Mod_id), T_INT(frame), T_INT(subframe), T_INT(i), T_INT(phy_vars_eNB->ulsch_eNB[i]->rnti), + T_INT(harq_pid)); - // fix later for 2 TB case and format1b + phy_vars_eNB->eNB_UE_stats[i].ulsch_round_errors[harq_pid][phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->round]++; + 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 = 0; + phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->round++; + + LOG_D(PHY,"[eNB][PUSCH %d] Increasing to round %d\n",harq_pid,phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->round); + + if (phy_vars_eNB->ulsch_eNB[i]->Msg3_flag == 1) { + LOG_D(PHY,"[eNB %d/%d][RAPROC] frame %d, subframe %d, UE %d: Error receiving ULSCH (Msg3), round %d/%d\n", + phy_vars_eNB->Mod_id, + phy_vars_eNB->CC_id, + frame,subframe, i, + phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->round-1, + phy_vars_eNB->lte_frame_parms.maxHARQ_Msg3Tx-1); + + 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, + phy_vars_eNB->ulsch_eNB[i]->rnti, + dB_fixed(phy_vars_eNB->lte_eNB_pusch_vars[i]->ulsch_power[0]), + dB_fixed(phy_vars_eNB->lte_eNB_pusch_vars[i]->ulsch_power[1]), + phy_vars_eNB->eNB_UE_stats[i].UL_rssi[0], + phy_vars_eNB->eNB_UE_stats[i].UL_rssi[1], + phy_vars_eNB->PHY_measurements_eNB->n0_power_dB[0], + phy_vars_eNB->PHY_measurements_eNB->n0_power_dB[1], + 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); + + if (phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->round == + phy_vars_eNB->lte_frame_parms.maxHARQ_Msg3Tx) { + LOG_D(PHY,"[eNB %d][RAPROC] maxHARQ_Msg3Tx reached, abandoning RA procedure for UE %d\n", + phy_vars_eNB->Mod_id, i); + phy_vars_eNB->eNB_UE_stats[i].mode = PRACH; + if (phy_vars_eNB->mac_enabled==1) { + mac_xface->cancel_ra_proc(phy_vars_eNB->Mod_id, + phy_vars_eNB->CC_id, + frame, + phy_vars_eNB->eNB_UE_stats[i].crnti); + } + mac_phy_remove_ue(phy_vars_eNB->Mod_id,phy_vars_eNB->eNB_UE_stats[i].crnti); + + phy_vars_eNB->ulsch_eNB[(uint32_t)i]->Msg3_active = 0; + //phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->phich_active = 0; - if ((frame_parms->frame_type==FDD) || - (bundling_flag==bundling) || - ((frame_parms->frame_type==TDD)&&(frame_parms->tdd_config==1)&&((subframe!=2)||(subframe!=7)))) { - format = pucch_format1a; - // msg("PUCCH 1a\n"); } else { - format = pucch_format1b; - // msg("PUCCH 1b\n"); + // activate retransmission for Msg3 (signalled to UE PHY by PHICH (not MAC/DCI) + phy_vars_eNB->ulsch_eNB[(uint32_t)i]->Msg3_active = 1; + + get_Msg3_alloc_ret(&phy_vars_eNB->lte_frame_parms, + subframe, + frame, + &phy_vars_eNB->ulsch_eNB[i]->Msg3_frame, + &phy_vars_eNB->ulsch_eNB[i]->Msg3_subframe); } + LOG_D(PHY,"[eNB] Frame %d, Subframe %d: Msg3 in error, i = %d \n", frame,subframe,i); + } // This is Msg3 error - // if SR was detected, use the n1_pucch from SR - if (SR_payload==1) { -#ifdef DEBUG_PHY_PROC - LOG_D(PHY,"[eNB %d][PDSCH %x] Frame %d subframe %d Checking ACK/NAK (%d,%d,%d,%d) format %d with SR\n",phy_vars_eNB->Mod_id, - phy_vars_eNB->dlsch_eNB[i][0]->rnti, - frame,subframe, - n1_pucch0,n1_pucch1,n1_pucch2,n1_pucch3,format); + else { //normal ULSCH + LOG_D(PHY,"[eNB %d][PUSCH %d] frame %d subframe %d UE %d Error receiving ULSCH, round %d/%d (ACK %d,%d)\n", + phy_vars_eNB->Mod_id,harq_pid, + frame,subframe, i, + phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->round-1, + phy_vars_eNB->ulsch_eNB[i]->Mlimit, + 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]); + +#if defined(MESSAGE_CHART_GENERATOR_PHY) + MSC_LOG_RX_DISCARDED_MESSAGE( + MSC_PHY_ENB,MSC_PHY_UE, + NULL,0, + "%05u:%02u ULSCH received rnti %x harq id %u round %d", + frame,subframe, + phy_vars_eNB->ulsch_eNB[i]->rnti,harq_pid, + phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->round-1 + ); #endif - if (abstraction_flag == 0) - 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, - format, - 0, - pucch_payload0, - subframe); + if (phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->round== phy_vars_eNB->ulsch_eNB[i]->Mlimit) { + LOG_D(PHY,"[eNB %d][PUSCH %d] frame %d subframe %d UE %d ULSCH Mlimit %d reached\n", + phy_vars_eNB->Mod_id,harq_pid, + frame,subframe, i, + phy_vars_eNB->ulsch_eNB[i]->Mlimit); + + phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->round=0; + phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->phich_active=0; + phy_vars_eNB->eNB_UE_stats[i].ulsch_errors[harq_pid]++; + phy_vars_eNB->eNB_UE_stats[i].ulsch_consecutive_errors++; + + // indicate error to MAC + mac_xface->rx_sdu(phy_vars_eNB->Mod_id, + phy_vars_eNB->CC_id, + frame,subframe, + phy_vars_eNB->ulsch_eNB[i]->rnti, + NULL, + 0, + harq_pid, + &phy_vars_eNB->ulsch_eNB[i]->Msg3_flag); + } + } + } // ulsch in error + else { + T(T_ENB_ULSCH_UE_ACK, T_INT(phy_vars_eNB->Mod_id), T_INT(frame), T_INT(subframe), T_INT(i), T_INT(phy_vars_eNB->ulsch_eNB[i]->rnti), + T_INT(harq_pid)); + + if (phy_vars_eNB->ulsch_eNB[i]->Msg3_flag == 1) { + LOG_D(PHY,"[eNB %d][PUSCH %d] Frame %d subframe %d ULSCH received, setting round to 0, PHICH ACK\n", + phy_vars_eNB->Mod_id,harq_pid, + frame,subframe); + 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, + phy_vars_eNB->ulsch_eNB[i]->rnti, + dB_fixed(phy_vars_eNB->lte_eNB_pusch_vars[i]->ulsch_power[0]), + dB_fixed(phy_vars_eNB->lte_eNB_pusch_vars[i]->ulsch_power[1]), + phy_vars_eNB->eNB_UE_stats[i].UL_rssi[0], + phy_vars_eNB->eNB_UE_stats[i].UL_rssi[1], + phy_vars_eNB->PHY_measurements_eNB->n0_power_dB[0], + phy_vars_eNB->PHY_measurements_eNB->n0_power_dB[1], + 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); + } +#if defined(MESSAGE_CHART_GENERATOR_PHY) + MSC_LOG_RX_MESSAGE( + MSC_PHY_ENB,MSC_PHY_UE, + NULL,0, + "%05u:%02u ULSCH received rnti %x harq id %u", + frame,subframe, + phy_vars_eNB->ulsch_eNB[i]->rnti,harq_pid + ); #endif + 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; + + 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; + phy_vars_eNB->eNB_UE_stats[i].ulsch_consecutive_errors = 0; + + if (phy_vars_eNB->ulsch_eNB[i]->Msg3_flag == 1) { + if (phy_vars_eNB->mac_enabled==1) { + + 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); + + mac_xface->rx_sdu(phy_vars_eNB->Mod_id, + phy_vars_eNB->CC_id, + frame,subframe, + phy_vars_eNB->ulsch_eNB[i]->rnti, + phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->b, + phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->TBS>>3, + harq_pid, + &phy_vars_eNB->ulsch_eNB[i]->Msg3_flag); + + // 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, + phy_vars_eNB->CC_id, + frame, + phy_vars_eNB->eNB_UE_stats[i].crnti); + mac_phy_remove_ue(phy_vars_eNB->Mod_id,phy_vars_eNB->eNB_UE_stats[i].crnti); + phy_vars_eNB->ulsch_eNB[(uint32_t)i]->Msg3_active = 0; + } // Msg3_flag == 0 + + } // mac_enabled==1 + + phy_vars_eNB->eNB_UE_stats[i].mode = PUSCH; + phy_vars_eNB->ulsch_eNB[i]->Msg3_flag = 0; + + 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); + + for (k=0; k<8; k++) { //harq_processes + for (j=0; j<phy_vars_eNB->dlsch_eNB[i][0]->Mlimit; j++) { + phy_vars_eNB->eNB_UE_stats[i].dlsch_NAK[k][j]=0; + phy_vars_eNB->eNB_UE_stats[i].dlsch_ACK[k][j]=0; + phy_vars_eNB->eNB_UE_stats[i].dlsch_trials[k][j]=0; + } + + phy_vars_eNB->eNB_UE_stats[i].dlsch_l2_errors[k]=0; + phy_vars_eNB->eNB_UE_stats[i].ulsch_errors[k]=0; + phy_vars_eNB->eNB_UE_stats[i].ulsch_consecutive_errors=0; + + for (j=0; j<phy_vars_eNB->ulsch_eNB[i]->Mlimit; j++) { + phy_vars_eNB->eNB_UE_stats[i].ulsch_decoding_attempts[k][j]=0; + phy_vars_eNB->eNB_UE_stats[i].ulsch_decoding_attempts_last[k][j]=0; + phy_vars_eNB->eNB_UE_stats[i].ulsch_round_errors[k][j]=0; + phy_vars_eNB->eNB_UE_stats[i].ulsch_round_fer[k][j]=0; } - } else { //using n1_pucch0/n1_pucch1 resources + } + + phy_vars_eNB->eNB_UE_stats[i].dlsch_sliding_cnt=0; + phy_vars_eNB->eNB_UE_stats[i].dlsch_NAK_round0=0; + phy_vars_eNB->eNB_UE_stats[i].dlsch_mcs_offset=0; + } // Msg3_flag==1 + else { // Msg3_flag == 0 + #ifdef DEBUG_PHY_PROC - LOG_D(PHY,"[eNB %d][PDSCH %x] Frame %d subframe %d Checking ACK/NAK (%d,%d,%d,%d) format %d\n",phy_vars_eNB->Mod_id, - phy_vars_eNB->dlsch_eNB[i][0]->rnti, - frame,subframe, - n1_pucch0,n1_pucch1,n1_pucch2,n1_pucch3,format); -#endif - metric0=0; - metric1=0; +#ifdef DEBUG_ULSCH + LOG_D(PHY,"[eNB] Frame %d, Subframe %d : ULSCH SDU (RX harq_pid %d) %d bytes:",frame,subframe, + harq_pid,phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->TBS>>3); - // Check n1_pucch0 metric - if (n1_pucch0 != -1) { - if (abstraction_flag == 0) - metric0 = rx_pucch(phy_vars_eNB, - format, - i, - (uint16_t)n1_pucch0, - 0, // n2_pucch - 0, // shortened format - pucch_payload0, - subframe, - PUCCH1a_THRES); - else { -#ifdef PHY_ABSTRACTION - metric0 = rx_pucch_emul(phy_vars_eNB,i, - format, - 0, - pucch_payload0, - subframe); + for (j=0; j<phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->TBS>>3; j++) + LOG_T(PHY,"%x.",phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->b[j]); + + LOG_T(PHY,"\n"); +#endif #endif - } - } - // Check n1_pucch1 metric - if (n1_pucch1 != -1) { - if (abstraction_flag == 0) - metric1 = rx_pucch(phy_vars_eNB, - format, - i, - (uint16_t)n1_pucch1, - 0, //n2_pucch - 0, // shortened format - pucch_payload1, - subframe, - PUCCH1a_THRES); - else { -#ifdef PHY_ABSTRACTION - metric1 = rx_pucch_emul(phy_vars_eNB,i, - format, - 1, - pucch_payload1, - subframe); + if (phy_vars_eNB->mac_enabled==1) { + mac_xface->rx_sdu(phy_vars_eNB->Mod_id, + phy_vars_eNB->CC_id, + frame,subframe, + phy_vars_eNB->ulsch_eNB[i]->rnti, + phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->b, + phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->TBS>>3, + harq_pid, + NULL); +#ifdef LOCALIZATION + start_meas(&phy_vars_eNB->localization_stats); + aggregate_eNB_UE_localization_stats(phy_vars_eNB, + i, + frame, + subframe, + get_hundred_times_delta_IF_eNB(phy_vars_eNB,i,harq_pid, 1)/100); + stop_meas(&phy_vars_eNB->localization_stats); #endif - } - } - } + + } // mac_enabled==1 + } // Msg3_flag == 0 - if (SR_payload == 1) { - pucch_payload = pucch_payload0; + // estimate timing advance for MAC + if (abstraction_flag == 0) { + sync_pos = lte_est_timing_advance_pusch(phy_vars_eNB,i,sched_subframe); + phy_vars_eNB->eNB_UE_stats[i].timing_advance_update = sync_pos - phy_vars_eNB->lte_frame_parms.nb_prefix_samples/4; //to check + } - if (bundling_flag == bundling) - pucch_sel = 2; - } else if (bundling_flag == multiplexing) { // multiplexing + no SR - pucch_payload = (metric1>metric0) ? pucch_payload1 : pucch_payload0; - pucch_sel = (metric1>metric0) ? 1 : 0; - } else { // bundling + no SR - if (n1_pucch1 != -1) - pucch_payload = pucch_payload1; - else if (n1_pucch0 != -1) - pucch_payload = pucch_payload0; +#ifdef DEBUG_PHY_PROC + LOG_D(PHY,"[eNB %d] frame %d, subframe %d: user %d: timing advance = %d\n", + phy_vars_eNB->Mod_id, + frame, subframe, + i, + phy_vars_eNB->eNB_UE_stats[i].timing_advance_update); +#endif - pucch_sel = 2; // indicate that this is a bundled ACK/NAK - } + } // ulsch not in error + + // process HARQ feedback #ifdef DEBUG_PHY_PROC - LOG_D(PHY,"[eNB %d][PDSCH %x] Frame %d subframe %d ACK/NAK metric 0 %d, metric 1 %d, sel %d, (%d,%d)\n",phy_vars_eNB->Mod_id, - phy_vars_eNB->dlsch_eNB[i][0]->rnti, - frame,subframe, - metric0,metric1,pucch_sel,pucch_payload[0],pucch_payload[1]); + LOG_D(PHY,"[eNB %d][PDSCH %x] Frame %d subframe %d, Processing HARQ feedback for UE %d (after PUSCH)\n",phy_vars_eNB->Mod_id, + phy_vars_eNB->dlsch_eNB[i][0]->rnti, + frame,subframe, + i); #endif - process_HARQ_feedback(i,sched_subframe,phy_vars_eNB, - 0,// pusch_flag - pucch_payload, - pucch_sel, - SR_payload); - } + process_HARQ_feedback(i, + sched_subframe, + phy_vars_eNB, + 1, // pusch_flag + 0, + 0, + 0); + +#ifdef DEBUG_PHY_PROC + LOG_D(PHY,"[eNB %d] Frame %d subframe %d, sect %d: received ULSCH harq_pid %d for UE %d, ret = %d, CQI CRC Status %d, ACK %d,%d, ulsch_errors %d/%d\n", + phy_vars_eNB->Mod_id,frame,subframe, + phy_vars_eNB->eNB_UE_stats[i].sector, + harq_pid, + i, + ret, + phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->cqi_crc_status, + 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], + phy_vars_eNB->eNB_UE_stats[i].ulsch_errors[harq_pid], + phy_vars_eNB->eNB_UE_stats[i].ulsch_decoding_attempts[harq_pid][0]); +#endif + + // dump stats to VCD + if (i==0) { + VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_UE0_MCS0+harq_pid,phy_vars_eNB->pusch_stats_mcs[0][(frame*10)+subframe]); + VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_UE0_RB0+harq_pid,phy_vars_eNB->pusch_stats_rb[0][(frame*10)+subframe]); + VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_UE0_ROUND0+harq_pid,phy_vars_eNB->pusch_stats_round[0][(frame*10)+subframe]); + VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_UE0_RSSI0+harq_pid,dB_fixed(phy_vars_eNB->lte_eNB_pusch_vars[0]->ulsch_power[0])); + VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_UE0_RES0+harq_pid,ret); + VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_UE0_SFN0+harq_pid,(frame*10)+subframe); } - } // PUCCH processing + } // ulsch_eNB[0] && ulsch_eNB[0]->rnti>0 && ulsch_eNB[0]->subframe_scheduling_flag == 1 -#endif //PUCCH + // update ULSCH statistics for tracing if ((frame % 100 == 0) && (subframe == 4)) { for (harq_idx=0; harq_idx<8; harq_idx++) { - for (round=0; round<phy_vars_eNB->ulsch_eNB[i]->Mdlharq; round++) { + for (round=0; round<phy_vars_eNB->ulsch_eNB[i]->Mlimit; round++) { if ((phy_vars_eNB->eNB_UE_stats[i].ulsch_decoding_attempts[harq_idx][round] - phy_vars_eNB->eNB_UE_stats[i].ulsch_decoding_attempts_last[harq_idx][round]) != 0) { phy_vars_eNB->eNB_UE_stats[i].ulsch_round_fer[harq_idx][round] = @@ -3445,184 +3318,22 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_ phy_vars_eNB->eNB_UE_stats[i].total_TBS_last = phy_vars_eNB->eNB_UE_stats[i].total_TBS; } - num_active_cba_groups = phy_vars_eNB->ulsch_eNB[i]->num_active_cba_groups; - - /*if (num_active_cba_groups > 0 ) - LOG_D(PHY,"[eNB] last slot %d trying cba transmission decoding UE %d num_grps %d rnti %x flag %d\n", - last_slot, i, num_active_cba_groups,phy_vars_eNB->ulsch_eNB[i]->cba_rnti[i%num_active_cba_groups], - phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->subframe_cba_scheduling_flag ); - */ - if ((phy_vars_eNB->ulsch_eNB[i]) && - (num_active_cba_groups > 0) && - (phy_vars_eNB->ulsch_eNB[i]->cba_rnti[i%num_active_cba_groups]>0) && - (phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->subframe_cba_scheduling_flag==1)) { - rnti=0; - -#ifdef DEBUG_PHY_PROC - LOG_D(PHY,"[eNB %d][PUSCH %d] frame %d subframe %d Checking PUSCH/ULSCH CBA Reception for UE %d with cba rnti %x mode %s\n", - phy_vars_eNB->Mod_id,harq_pid, - frame,subframe, - i, (uint16_t)phy_vars_eNB->ulsch_eNB[i]->cba_rnti[i%num_active_cba_groups],mode_string[phy_vars_eNB->eNB_UE_stats[i].mode]); -#endif - - if (abstraction_flag==0) { - rx_ulsch(phy_vars_eNB, - sched_subframe, - phy_vars_eNB->eNB_UE_stats[i].sector, // this is the effective sector id - i, - phy_vars_eNB->ulsch_eNB, - 0); - } - -#ifdef PHY_ABSTRACTION - else { - rx_ulsch_emul(phy_vars_eNB, - subframe, - phy_vars_eNB->eNB_UE_stats[i].sector, // this is the effective sector id - i); - } - -#endif - - if (abstraction_flag == 0) { - ret = ulsch_decoding(phy_vars_eNB, - i, - sched_subframe, - 0, // control_only_flag - phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->V_UL_DAI, - 0); - } - -#ifdef PHY_ABSTRACTION - else { - ret = ulsch_decoding_emul(phy_vars_eNB, - sched_subframe, - i, - &rnti); - } - -#endif - - if (phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->cqi_crc_status == 1) { -#ifdef DEBUG_PHY_PROC - //if (((phy_vars_eNB->proc[sched_subframe].frame_tx%10) == 0) || (phy_vars_eNB->proc[sched_subframe].frame_tx < 50)) - print_CQI(phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->o,phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->uci_format,0,phy_vars_eNB->lte_frame_parms.N_RB_DL); -#endif - access_mode = UNKNOWN_ACCESS; - extract_CQI(phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->o, - phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->uci_format, - &phy_vars_eNB->eNB_UE_stats[i], - phy_vars_eNB->lte_frame_parms.N_RB_DL, - &rnti, &access_mode); - phy_vars_eNB->eNB_UE_stats[i].rank = phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->o_RI[0]; - } - - /* LOG_D(PHY,"[eNB %d][PUSCH %d] frame %d subframe %d UE %d harq_pid %d resetting the sched_subframeuling_flag, total cba groups %d %d\n", - phy_vars_eNB->Mod_id,harq_pid,phy_vars_eNB->proc[sched_subframe].frame_tx,subframe,i,harq_pid, - phy_vars_eNB->ulsch_eNB[i]->num_active_cba_groups,num_active_cba_groups); - */ - phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->subframe_cba_scheduling_flag=0; - phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->status= SCH_IDLE; - - if ((num_active_cba_groups > 0) && - // (i % num_active_cba_groups == 0) && // this ue is used a a template for the CBA - (i + num_active_cba_groups < NUMBER_OF_UE_MAX) && - (phy_vars_eNB->ulsch_eNB[i+num_active_cba_groups]->cba_rnti[i%num_active_cba_groups] > 0 ) && - (phy_vars_eNB->ulsch_eNB[i+num_active_cba_groups]->num_active_cba_groups> 0)) { -#ifdef DEBUG_PHY_PROC - LOG_D(PHY,"[eNB %d][PUSCH %d] frame %d subframe %d UE %d harq_pid %d resetting the subframe_scheduling_flag for Ue %d cba groups %d members\n", - phy_vars_eNB->Mod_id,harq_pid,frame,subframe,i,harq_pid, - i+num_active_cba_groups, i%phy_vars_eNB->ulsch_eNB[i]->num_active_cba_groups); -#endif - phy_vars_eNB->ulsch_eNB[i+num_active_cba_groups]->harq_processes[harq_pid]->subframe_cba_scheduling_flag=1; - phy_vars_eNB->ulsch_eNB[i+num_active_cba_groups]->harq_processes[harq_pid]->status= CBA_ACTIVE; - phy_vars_eNB->ulsch_eNB[i+num_active_cba_groups]->harq_processes[harq_pid]->TBS=phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->TBS; - } - - if (ret == (1+MAX_TURBO_ITERATIONS)) { - phy_vars_eNB->eNB_UE_stats[i].ulsch_round_errors[harq_pid][phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->round]++; - 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 = 0; - phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->round++; - } // ulsch in error - else { - LOG_D(PHY,"[eNB %d][PUSCH %d] Frame %d subframe %d ULSCH received, setting round to 0, PHICH ACK\n", - phy_vars_eNB->Mod_id,harq_pid, - frame,subframe); - - 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; - phy_vars_eNB->eNB_UE_stats[i].ulsch_consecutive_errors = 0; -#ifdef DEBUG_PHY_PROC -#ifdef DEBUG_ULSCH - LOG_D(PHY,"[eNB] Frame %d, Subframe %d : ULSCH SDU (RX harq_pid %d) %d bytes:", - frame,subframe, - harq_pid,phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->TBS>>3); - - for (j=0; j<phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->TBS>>3; j++) - LOG_T(PHY,"%x.",phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->b[j]); - - LOG_T(PHY,"\n"); -#endif -#endif - - if (access_mode > UNKNOWN_ACCESS) { - LOG_D(PHY,"[eNB %d] Frame %d, Subframe %d : received ULSCH SDU from CBA transmission, UE (%d,%x), CBA (group %d, rnti %x)\n", - phy_vars_eNB->Mod_id, frame,subframe, - i, phy_vars_eNB->ulsch_eNB[i]->rnti, - i % phy_vars_eNB->ulsch_eNB[i]->num_active_cba_groups, phy_vars_eNB->ulsch_eNB[i]->cba_rnti[i%num_active_cba_groups]); - - // detect if there is a CBA collision - if (phy_vars_eNB->cba_last_reception[i%num_active_cba_groups] == 0 ) { - mac_xface->rx_sdu(phy_vars_eNB->Mod_id, - phy_vars_eNB->CC_id, - frame,subframe, - phy_vars_eNB->ulsch_eNB[i]->rnti, - phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->b, - phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->TBS>>3, - harq_pid, - NULL); - - phy_vars_eNB->cba_last_reception[i%num_active_cba_groups]+=1;//(subframe); - } else { - if (phy_vars_eNB->cba_last_reception[i%num_active_cba_groups] == 1 ) - LOG_N(PHY,"[eNB%d] Frame %d subframe %d : first CBA collision detected \n ", - phy_vars_eNB->Mod_id,frame,subframe); - - LOG_N(PHY,"[eNB%d] Frame %d subframe %d : CBA collision set SR for UE %d in group %d \n ", - phy_vars_eNB->Mod_id,frame,subframe, - phy_vars_eNB->cba_last_reception[i%num_active_cba_groups],i%num_active_cba_groups ); - - phy_vars_eNB->cba_last_reception[i%num_active_cba_groups]+=1; - - mac_xface->SR_indication(phy_vars_eNB->Mod_id, - phy_vars_eNB->CC_id, - frame, - phy_vars_eNB->dlsch_eNB[i][0]->rnti,subframe); - } - } - } // ULSCH CBA not in error - } - + // CBA (non-LTE) + cba_procedures(sched_subframe,phy_vars_eNB,i,harq_pid,abstraction_flag); } // loop i=0 ... NUMBER_OF_UE_MAX-1 - (void)pusch_active; /* remove gcc warning "set but not used" */ - // 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; - } + if (abstraction_flag == 0) { + 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 else { lte_eNB_I0_measurements_emul(phy_vars_eNB, - sect_id); + 0); } #endif diff --git a/openair1/SCHED/phy_procedures_lte_ue.c b/openair1/SCHED/phy_procedures_lte_ue.c index a6d729696deccb3f144aa89e10b8200e674215f3..ac09ac77b395a9e20b0f2ff421958c38ef31a3c8 100755 --- a/openair1/SCHED/phy_procedures_lte_ue.c +++ b/openair1/SCHED/phy_procedures_lte_ue.c @@ -42,8 +42,6 @@ #include "defs.h" #include "PHY/defs.h" #include "PHY/extern.h" -#include "MAC_INTERFACE/defs.h" -#include "MAC_INTERFACE/extern.h" #include "SCHED/defs.h" #include "SCHED/extern.h" @@ -1368,7 +1366,7 @@ void phy_procedures_UE_TX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstra #endif if (abstraction_flag == 0) { - LOG_D(PHY,"[UE %d][RAPROC] Frame %d, Subframe %d : Generating PRACH, preamble %d, TARGET_RECEIVED_POWER %d dBm, PRACH TDD Resource index %d, RA-RNTI %d\n", + LOG_I(PHY,"[UE %d][RAPROC] Frame %d, Subframe %d : Generating PRACH, preamble %d, TARGET_RECEIVED_POWER %d dBm, PRACH TDD Resource index %d, RA-RNTI %d\n", Mod_id, frame_tx, subframe_tx, @@ -2639,7 +2637,7 @@ 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]->harq_processes[harq_pid], subframe_prev, harq_pid, - 1,0); + 1,phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->nb_rb>10 ? 1 : 0); stop_meas(&phy_vars_ue->dlsch_decoding_stats); } @@ -3325,7 +3323,7 @@ int phy_procedures_UE_RX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstrac phy_vars_ue->dlsch_ue_MCH[0]->harq_processes[0], subframe_prev, 0, - 0,0); + 0,1); } else { // abstraction #ifdef PHY_ABSTRACTION ret = dlsch_decoding_emul(phy_vars_ue, diff --git a/openair1/SIMULATION/LTE_PHY/dlsim.c b/openair1/SIMULATION/LTE_PHY/dlsim.c index 6f2c1f1d224494c93e78de898fc9792098a6951a..02fe3f1d29b388a396ea551c64e7e5094809a36a 100644 --- a/openair1/SIMULATION/LTE_PHY/dlsim.c +++ b/openair1/SIMULATION/LTE_PHY/dlsim.c @@ -48,7 +48,6 @@ #include "PHY/types.h" #include "PHY/defs.h" #include "PHY/vars.h" -#include "MAC_INTERFACE/vars.h" #include "SCHED/defs.h" #include "SCHED/vars.h" @@ -100,7 +99,7 @@ uint64_t DLSCH_alloc_pdu_1[2]; #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 //#define DLSCH_RB_ALLOC 0x0001 -void do_OFDM_mod_l(mod_sym_t **txdataF, int32_t **txdata, uint16_t next_slot, LTE_DL_FRAME_PARMS *frame_parms) +void do_OFDM_mod_l(int32_t **txdataF, int32_t **txdata, uint16_t next_slot, LTE_DL_FRAME_PARMS *frame_parms) { int aa, slot_offset, slot_offset_F; @@ -215,7 +214,7 @@ int main(int argc, char **argv) // void *data; // int ii; // int bler; - double blerr[4],uncoded_ber;//,avg_ber; + double blerr[4],uncoded_ber,avg_ber; short *uncoded_ber_bit=NULL; uint8_t N_RB_DL=25,osf=1; frame_t frame_type = FDD; @@ -2112,7 +2111,7 @@ PMI_FEEDBACK: // printf("Trial %d : Round %d, pmi_feedback %d \n",trials,round,pmi_feedback); for (aa=0; aa<PHY_vars_eNB->lte_frame_parms.nb_antennas_tx; aa++) { - memset(&PHY_vars_eNB->lte_eNB_common_vars.txdataF[eNB_id][aa][0],0,FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX*sizeof(mod_sym_t)); + memset(&PHY_vars_eNB->lte_eNB_common_vars.txdataF[eNB_id][aa][0],0,FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX*sizeof(int32_t)); } if (input_fd==NULL) { @@ -3292,7 +3291,7 @@ PMI_FEEDBACK: PHY_vars_UE->dlsch_ue[0][cw]->harq_processes[PHY_vars_UE->dlsch_ue[0][cw]->current_harq_pid]->G = coded_bits_per_codeword; - /* + // calculate uncoded BLER uncoded_ber=0; for (i=0;i<coded_bits_per_codeword;i++) @@ -3308,7 +3307,7 @@ PMI_FEEDBACK: if (n_frames==1) write_output("uncoded_ber_bit.m","uncoded_ber_bit",uncoded_ber_bit,coded_bits_per_codeword,1,0); - */ + start_meas(&PHY_vars_UE->dlsch_unscrambling_stats); dlsch_unscrambling(&PHY_vars_UE->lte_frame_parms, @@ -3419,12 +3418,12 @@ PMI_FEEDBACK: } sprintf(fname,"rxsig0_r%d.m",round); - sprintf(vname,"rxs0_r%d.m",round); + sprintf(vname,"rxs0_r%d",round); write_output(fname,vname, &PHY_vars_UE->lte_ue_common_vars.rxdata[0][0],10*PHY_vars_UE->lte_frame_parms.samples_per_tti,1,1); sprintf(fname,"rxsigF0_r%d.m",round); - sprintf(vname,"rxs0F_r%d.m",round); + sprintf(vname,"rxs0F_r%d",round); write_output(fname,vname, &PHY_vars_UE->lte_ue_common_vars.rxdataF[0][0],2*PHY_vars_UE->lte_frame_parms.ofdm_symbol_size*nsymb,2,1); - + if (PHY_vars_UE->lte_frame_parms.nb_antennas_rx>1) { sprintf(fname,"rxsig1_r%d.m",round); sprintf(vname,"rxs1_r%d.m",round); @@ -3435,14 +3434,14 @@ PMI_FEEDBACK: } sprintf(fname,"dlsch00_r%d.m",round); - sprintf(vname,"dl00_r%d.m",round); + sprintf(vname,"dl00_r%d",round); write_output(fname,vname, &(PHY_vars_UE->lte_ue_common_vars.dl_ch_estimates[eNB_id][0][0]), PHY_vars_UE->lte_frame_parms.ofdm_symbol_size*nsymb,1,1); if (PHY_vars_UE->lte_frame_parms.nb_antennas_rx>1) { sprintf(fname,"dlsch01_r%d.m",round); - sprintf(vname,"dl01_r%d.m",round); + sprintf(vname,"dl01_r%d",round); write_output(fname,vname, &(PHY_vars_UE->lte_ue_common_vars.dl_ch_estimates[eNB_id][1][0]), PHY_vars_UE->lte_frame_parms.ofdm_symbol_size*nsymb/2,1,1); @@ -3450,7 +3449,7 @@ PMI_FEEDBACK: if (PHY_vars_eNB->lte_frame_parms.nb_antennas_tx>1) { sprintf(fname,"dlsch10_r%d.m",round); - sprintf(vname,"dl10_r%d.m",round); + sprintf(vname,"dl10_r%d",round); write_output(fname,vname, &(PHY_vars_UE->lte_ue_common_vars.dl_ch_estimates[eNB_id][2][0]), PHY_vars_UE->lte_frame_parms.ofdm_symbol_size*nsymb/2,1,1); @@ -3458,7 +3457,7 @@ PMI_FEEDBACK: if ((PHY_vars_UE->lte_frame_parms.nb_antennas_rx>1) && (PHY_vars_eNB->lte_frame_parms.nb_antennas_tx>1)) { sprintf(fname,"dlsch11_r%d.m",round); - sprintf(vname,"dl11_r%d.m",round); + sprintf(vname,"dl11_r%d",round); write_output(fname,vname, &(PHY_vars_UE->lte_ue_common_vars.dl_ch_estimates[eNB_id][3][0]), PHY_vars_UE->lte_frame_parms.ofdm_symbol_size*nsymb/2,1,1); @@ -3989,7 +3988,7 @@ PMI_FEEDBACK: printf("[continue] effective rate : %f (%2.1f%%,%f)): increase snr \n",rate*effective_rate, 100*effective_rate, rate); } - if (((double)errs[0]/(round_trials[0]))<1e-2) + if (((double)errs[0]/(round_trials[0]))<(10.0/n_frames)) break; }// SNR diff --git a/openair1/SIMULATION/LTE_PHY/mbmssim.c b/openair1/SIMULATION/LTE_PHY/mbmssim.c index 0e14619cda7a521553b6a74a64aed49cdeb260c0..2691257895bbca11dd3cdb903b12edba4395a765 100644 --- a/openair1/SIMULATION/LTE_PHY/mbmssim.c +++ b/openair1/SIMULATION/LTE_PHY/mbmssim.c @@ -38,7 +38,6 @@ #include "PHY/types.h" #include "PHY/defs.h" #include "PHY/vars.h" -#include "MAC_INTERFACE/vars.h" #ifdef EMOS #include "SCHED/phy_procedures_emos.h" #endif @@ -132,7 +131,6 @@ int main(int argc, char **argv) double sigma2, sigma2_dB=0,SNR,snr0=-2.0,snr1=0.0; uint8_t snr1set=0; double snr_step=1,input_snr_step=1; - //mod_sym_t **txdataF; int **txdata; double **s_re,**s_im,**r_re,**r_im; double iqim = 0.0; @@ -456,7 +454,7 @@ int main(int argc, char **argv) //if (trials%100==0) //eNB2UE[0]->first_run = 1; eNB2UE->first_run = 1; - memset(&PHY_vars_eNB->lte_eNB_common_vars.txdataF[0][0][0],0,FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX*sizeof(mod_sym_t)); + memset(&PHY_vars_eNB->lte_eNB_common_vars.txdataF[0][0][0],0,FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX*sizeof(int32_t)); generate_mch(PHY_vars_eNB,sched_subframe,input_buffer,0); diff --git a/openair1/SIMULATION/LTE_PHY/pbchsim.c b/openair1/SIMULATION/LTE_PHY/pbchsim.c index 739c7e121fa41e1baf3ee78c034aa1d29e7c0d37..4a2b3f935120036e29ed1405f4a865720123e98d 100644 --- a/openair1/SIMULATION/LTE_PHY/pbchsim.c +++ b/openair1/SIMULATION/LTE_PHY/pbchsim.c @@ -38,7 +38,6 @@ #include "PHY/types.h" #include "PHY/defs.h" #include "PHY/vars.h" -#include "MAC_INTERFACE/vars.h" #ifdef EMOS #include "SCHED/phy_procedures_emos.h" @@ -58,11 +57,11 @@ PHY_VARS_UE *PHY_vars_UE; #define DLSCH_RB_ALLOC 0x1fbf // igore DC component,RB13 -mod_sym_t *dummybuf[4]; -mod_sym_t dummy0[2048*14]; -mod_sym_t dummy1[2048*14]; -mod_sym_t dummy2[2048*14]; -mod_sym_t dummy3[2048*14]; +int32_t *dummybuf[4]; +int32_t dummy0[2048*14]; +int32_t dummy1[2048*14]; +int32_t dummy2[2048*14]; +int32_t dummy3[2048*14]; int main(int argc, char **argv) @@ -73,7 +72,6 @@ int main(int argc, char **argv) int i,l,aa; double sigma2, sigma2_dB=0,SNR,snr0=-2.0,snr1; uint8_t snr1set=0; - //mod_sym_t **txdataF; int **txdata,**txdata1,**txdata2; double **s_re,**s_im,**s_re1,**s_im1,**s_re2,**s_im2,**r_re,**r_im,**r_re1,**r_im1,**r_re2,**r_im2; double iqim = 0.0; @@ -604,7 +602,7 @@ int main(int argc, char **argv) dummybuf[2] = dummy2; dummybuf[3] = dummy3; generate_pbch(&PHY_vars_eNB->lte_eNB_pbch, - (mod_sym_t**)dummybuf, + (int32_t**)dummybuf, AMP, &PHY_vars_eNB->lte_frame_parms, pbch_pdu, diff --git a/openair1/SIMULATION/LTE_PHY/pdcchsim.c b/openair1/SIMULATION/LTE_PHY/pdcchsim.c index 0c51959f148371209f8fc42f3c28d55af05dd49a..4691875d3a6c132084ef23b3a4b82f4109c80d90 100644 --- a/openair1/SIMULATION/LTE_PHY/pdcchsim.c +++ b/openair1/SIMULATION/LTE_PHY/pdcchsim.c @@ -34,7 +34,6 @@ #include "PHY/types.h" #include "PHY/defs.h" #include "PHY/vars.h" -#include "MAC_INTERFACE/vars.h" #ifdef EMOS #include "SCHED/phy_procedures_emos.h" @@ -393,11 +392,7 @@ DCI_PDU *get_dci(LTE_DL_FRAME_PARMS *lte_frame_parms,uint8_t log2L, uint8_t log2 - 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); } @@ -411,7 +406,6 @@ int main(int argc, char **argv) int i,l,aa; double sigma2, sigma2_dB=0,SNR,snr0=-2.0,snr1; - //mod_sym_t **txdataF; int **txdata; double **s_re,**s_im,**r_re,**r_im; @@ -712,6 +706,7 @@ int main(int argc, char **argv) Nid_cell, tdd_config, N_RB_DL, + 0, osf, perfect_ce); @@ -774,8 +769,8 @@ int main(int argc, char **argv) - PHY_vars_eNB->ulsch_eNB[0] = new_eNB_ulsch(8,MAX_TURBO_ITERATIONS,N_RB_DL,0); - PHY_vars_UE->ulsch_ue[0] = new_ue_ulsch(8,N_RB_DL,0); + PHY_vars_eNB->ulsch_eNB[0] = new_eNB_ulsch(MAX_TURBO_ITERATIONS,N_RB_DL,0); + PHY_vars_UE->ulsch_ue[0] = new_ue_ulsch(N_RB_DL,0); PHY_vars_eNB->proc[subframe].frame_tx = 0; @@ -839,7 +834,7 @@ int main(int argc, char **argv) // printf("DCI (SF %d): txdataF %p (0 %p)\n",subframe,&PHY_vars_eNB->lte_eNB_common_vars.txdataF[eNb_id][aa][512*14*subframe],&PHY_vars_eNB->lte_eNB_common_vars.txdataF[eNb_id][aa][0]); for (aa=0; aa<PHY_vars_eNB->lte_frame_parms.nb_antennas_tx_eNB; aa++) { - memset(&PHY_vars_eNB->lte_eNB_common_vars.txdataF[eNb_id][aa][0],0,FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX*sizeof(mod_sym_t)); + memset(&PHY_vars_eNB->lte_eNB_common_vars.txdataF[eNb_id][aa][0],0,FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX*sizeof(int32_t)); /* re_offset = PHY_vars_eNB->lte_frame_parms.first_carrier_offset; diff --git a/openair1/SIMULATION/LTE_PHY/prachsim.c b/openair1/SIMULATION/LTE_PHY/prachsim.c index 0fab08a3d1234f15bdfaa1eff184aac9c47843b9..37fc3a6a102d30d5883e3a6d78deeb5a4627007d 100644 --- a/openair1/SIMULATION/LTE_PHY/prachsim.c +++ b/openair1/SIMULATION/LTE_PHY/prachsim.c @@ -34,10 +34,6 @@ #include "PHY/types.h" #include "PHY/defs.h" #include "PHY/vars.h" -#include "MAC_INTERFACE/vars.h" -#ifdef IFFT_FPGA -#include "PHY/LTE_REFSIG/mod_table.h" -#endif #ifdef EMOS #include "SCHED/phy_procedures_emos.h" #endif @@ -70,9 +66,6 @@ int main(int argc, char **argv) uint8_t snr1set=0; uint8_t ue_speed1set=0; //mod_sym_t **txdataF; -#ifdef IFFT_FPGA - int **txdataF2; -#endif int **txdata; double **s_re,**s_im,**r_re,**r_im; double iqim=0.0; @@ -329,6 +322,7 @@ int main(int argc, char **argv) Nid_cell, 3, N_RB_DL, + 0, osf, 0); @@ -553,14 +547,6 @@ int main(int argc, char **argv) // printf("(%f,%f)\n",SNR,(double)prach_errors/(double)n_frames); } //SNR loop -#ifdef IFFT_FPGA - free(txdataF2[0]); - free(txdataF2[1]); - free(txdataF2); - free(txdata[0]); - free(txdata[1]); - free(txdata); -#endif for (i=0; i<2; i++) { free(s_re[i]); diff --git a/openair1/SIMULATION/LTE_PHY/pucchsim.c b/openair1/SIMULATION/LTE_PHY/pucchsim.c index 42de78ac7428e0ad1334e06a6ef0721beefb034d..c5b356918807a49f9f5acdaf3e7a798d73a677d1 100644 --- a/openair1/SIMULATION/LTE_PHY/pucchsim.c +++ b/openair1/SIMULATION/LTE_PHY/pucchsim.c @@ -34,10 +34,6 @@ #include "PHY/types.h" #include "PHY/defs.h" #include "PHY/vars.h" -#include "MAC_INTERFACE/vars.h" -#ifdef IFFT_FPGA -#include "PHY/LTE_REFSIG/mod_table.h" -#endif #ifdef EMOS #include "SCHED/phy_procedures_emos.h" #endif @@ -67,9 +63,6 @@ int main(int argc, char **argv) double sigma2, sigma2_dB=0,SNR,snr0=-2.0,snr1=0.0; uint8_t snr1set=0; //mod_sym_t **txdataF; -#ifdef IFFT_FPGA - int **txdataF2; -#endif int **txdata; double **s_re,**s_im,**r_re,**r_im; double ricean_factor=0.0000005,iqim=0.0; @@ -338,23 +331,7 @@ int main(int argc, char **argv) frame_parms = &PHY_vars_eNB->lte_frame_parms; -#ifdef IFFT_FPGA - txdata = (int **)malloc16(2*sizeof(int*)); - txdata[0] = (int *)malloc16(FRAME_LENGTH_BYTES); - txdata[1] = (int *)malloc16(FRAME_LENGTH_BYTES); - - bzero(txdata[0],FRAME_LENGTH_BYTES); - bzero(txdata[1],FRAME_LENGTH_BYTES); - - txdataF2 = (int **)malloc16(2*sizeof(int*)); - txdataF2[0] = (int *)malloc16(FRAME_LENGTH_BYTES_NO_PREFIX); - txdataF2[1] = (int *)malloc16(FRAME_LENGTH_BYTES_NO_PREFIX); - - bzero(txdataF2[0],FRAME_LENGTH_BYTES_NO_PREFIX); - bzero(txdataF2[1],FRAME_LENGTH_BYTES_NO_PREFIX); -#else txdata = PHY_vars_eNB->lte_eNB_common_vars.txdata[eNB_id]; -#endif s_re = malloc(2*sizeof(double*)); s_im = malloc(2*sizeof(double*)); @@ -420,27 +397,6 @@ int main(int argc, char **argv) &pucch_payload, AMP, //amp, subframe); //subframe -#ifdef IFFT_FPGA_UE - tx_lev=0; - - for (aa=0; aa<frame_parms->nb_antennas_tx; aa++) { - - if (frame_parms->Ncp == 1) - PHY_ofdm_mod(txdataF2[aa], // input - txdata[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(txdataF2[aa],txdata[aa],2*nsymb,frame_parms); - } - - tx_lev += signal_energy(&txdata[aa][OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES], - OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES); - -#else - write_output("txsigF0.m","txsF0", &PHY_vars_UE->lte_ue_common_vars.txdataF[0][2*subframe*nsymb*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES_NO_PREFIX],OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES_NO_PREFIX*nsymb,1,1); tx_lev = 0; @@ -472,7 +428,6 @@ int main(int argc, char **argv) OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES); } -#endif write_output("txsig0.m","txs0", txdata[0], FRAME_LENGTH_COMPLEX_SAMPLES,1,1); @@ -610,6 +565,7 @@ int main(int argc, char **argv) n2_pucch, 0, //shortened_format, &pucch_payload_rx, //payload, + 0 /* frame not defined, let's pass 0 */, subframe, pucch1_thres); @@ -655,15 +611,6 @@ int main(int argc, char **argv) } -#ifdef IFFT_FPGA - free(txdataF2[0]); - free(txdataF2[1]); - free(txdataF2); - free(txdata[0]); - free(txdata[1]); - free(txdata); -#endif - for (i=0; i<2; i++) { free(s_re[i]); free(s_im[i]); diff --git a/openair1/SIMULATION/LTE_PHY/ulsim.c b/openair1/SIMULATION/LTE_PHY/ulsim.c index de40298d584c0a3e7eea7722b941f828a9d1c28e..56f8eb146a6980542034d137d559fc22dfe4a747 100644 --- a/openair1/SIMULATION/LTE_PHY/ulsim.c +++ b/openair1/SIMULATION/LTE_PHY/ulsim.c @@ -45,7 +45,6 @@ #include "PHY/types.h" #include "PHY/defs.h" #include "PHY/vars.h" -#include "MAC_INTERFACE/vars.h" #include "SCHED/defs.h" #include "SCHED/vars.h" @@ -309,7 +308,7 @@ int main(int argc, char **argv) break; default: - msg("Unsupported channel model!\n"); + printf("Unsupported channel model!\n"); exit(-1); break; } @@ -333,7 +332,7 @@ int main(int argc, char **argv) if ((transmission_mode!=1) && (transmission_mode!=2)) { - msg("Unsupported transmission mode %d\n",transmission_mode); + printf("Unsupported transmission mode %d\n",transmission_mode); exit(-1); } @@ -383,10 +382,10 @@ int main(int argc, char **argv) case 'i': input_fdUL = fopen(optarg,"r"); - msg("Reading in %s (%p)\n",optarg,input_fdUL); + printf("Reading in %s (%p)\n",optarg,input_fdUL); if (input_fdUL == (FILE*)NULL) { - msg("Unknown file %s\n",optarg); + printf("Unknown file %s\n",optarg); exit(-1); } @@ -510,13 +509,8 @@ int main(int argc, char **argv) // r_re0 = malloc(2*sizeof(double*)); // r_im0 = malloc(2*sizeof(double*)); - nsymb = (PHY_vars_eNB->lte_frame_parms.Ncp == 0) ? 14 : 12; + nsymb = (PHY_vars_eNB->lte_frame_parms.Ncp == NORMAL) ? 14 : 12; - coded_bits_per_codeword = nb_rb * (12 * get_Qm(mcs)) * nsymb; - - rate = (double)dlsch_tbs25[get_I_TBS(mcs)][nb_rb-1]/(coded_bits_per_codeword); - - printf("Rate = %f (mod %d), coded bits %d\n",rate,get_Qm(mcs),coded_bits_per_codeword); sprintf(bler_fname,"ULbler_mcs%d_nrb%d_ChannelModel%d_nsim%d.csv",mcs,nb_rb,chMod,n_frames); bler_fd = fopen(bler_fname,"w"); @@ -641,8 +635,8 @@ int main(int argc, char **argv) UE2eNB->max_Doppler = maxDoppler; // NN: N_RB_UL has to be defined in ulsim - PHY_vars_eNB->ulsch_eNB[0] = new_eNB_ulsch(8,max_turbo_iterations,N_RB_DL,0); - PHY_vars_UE->ulsch_ue[0] = new_ue_ulsch(8,N_RB_DL,0); + PHY_vars_eNB->ulsch_eNB[0] = new_eNB_ulsch(max_turbo_iterations,N_RB_DL,0); + PHY_vars_UE->ulsch_ue[0] = new_ue_ulsch(N_RB_DL,0); // Create transport channel structures for 2 transport blocks (MIMO) for (i=0; i<2; i++) { @@ -766,9 +760,9 @@ int main(int argc, char **argv) PHY_vars_eNB->proc[sf].subframe_rx=sf; } - msg("Init UL hopping UE\n"); + printf("Init UL hopping UE\n"); init_ul_hopping(&PHY_vars_UE->lte_frame_parms); - msg("Init UL hopping eNB\n"); + printf("Init UL hopping eNB\n"); init_ul_hopping(&PHY_vars_eNB->lte_frame_parms); PHY_vars_eNB->proc[subframe].frame_rx = PHY_vars_UE->frame_tx; @@ -808,6 +802,13 @@ int main(int argc, char **argv) CBA_RNTI, srs_flag); + coded_bits_per_codeword = nb_rb * (12 * get_Qm_ul(mcs)) * nsymb; + + if (cqi_flag == 1) coded_bits_per_codeword-=PHY_vars_UE->ulsch_ue[0]->O; + + rate = (double)dlsch_tbs25[get_I_TBS(mcs)][nb_rb-1]/(coded_bits_per_codeword); + + printf("Rate = %f (mod %d), coded bits %d\n",rate,get_Qm_ul(mcs),coded_bits_per_codeword); PHY_vars_UE->frame_tx = (PHY_vars_UE->frame_tx+1)&1023; @@ -1062,7 +1063,7 @@ int main(int argc, char **argv) start_meas(&PHY_vars_UE->ofdm_mod_stats); for (aa=0; aa<1; aa++) { - if (frame_parms->Ncp == 1) + if (frame_parms->Ncp == EXTENDED) 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.ofdm_symbol_size, @@ -1256,6 +1257,7 @@ int main(int argc, char **argv) */ start_meas(&PHY_vars_eNB->ulsch_decoding_stats); + ret= ulsch_decoding(PHY_vars_eNB, 0, // UE_id subframe, @@ -1292,7 +1294,7 @@ int main(int argc, char **argv) if (PHY_vars_eNB->ulsch_eNB[0]->harq_processes[harq_pid]->o_ACK[0] != PHY_vars_UE->ulsch_ue[0]->o_ACK[0]) ack_errors++; - // msg("ulsch_coding: O[%d] %d\n",i,o_flip[i]); + // printf("ulsch_coding: O[%d] %d\n",i,o_flip[i]); if (ret <= PHY_vars_eNB->ulsch_eNB[0]->max_turbo_iterations) { @@ -1515,7 +1517,7 @@ int main(int argc, char **argv) rate*effective_rate, 100*effective_rate, rate, - rate*get_Qm(mcs), + rate*get_Qm_ul(mcs), (1.0*(round_trials[0]-errs[0])+2.0*(round_trials[1]-errs[1])+3.0*(round_trials[2]-errs[2])+4.0*(round_trials[3]-errs[3]))/((double)round_trials[0])/ (double)PHY_vars_eNB->ulsch_eNB[0]->harq_processes[harq_pid]->TBS, (1.0*(round_trials[0]-errs[0])+2.0*(round_trials[1]-errs[1])+3.0*(round_trials[2]-errs[2])+4.0*(round_trials[3]-errs[3]))/((double)round_trials[0])); diff --git a/openair2/LAYER2/MAC/config.c b/openair2/LAYER2/MAC/config.c index 608a67c18a5f5ecc634f062f60dc71d5b3b81512..2c5a0799d26f84a62dc35df909e0d3d0af52f028 100644 --- a/openair2/LAYER2/MAC/config.c +++ b/openair2/LAYER2/MAC/config.c @@ -90,8 +90,8 @@ void ue_mac_reset(module_id_t module_idP,uint8_t eNB_index) int rrc_mac_config_req( - module_id_t Mod_id, - int CC_id, + module_id_t Mod_idP, + int CC_idP, eNB_flag_t eNB_flagP, rnti_t rntiP, uint8_t eNB_index, @@ -129,28 +129,31 @@ rrc_mac_config_req( int i; int UE_id = -1; + eNB_MAC_INST *eNB = &eNB_mac_inst[Mod_idP]; + UE_list_t *UE_list= &eNB->UE_list; + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RRC_MAC_CONFIG, VCD_FUNCTION_IN); if (eNB_flagP==0) { - LOG_I(MAC,"[CONFIG][UE %d] Configuring MAC/PHY from eNB %d\n",Mod_id,eNB_index); + LOG_I(MAC,"[CONFIG][UE %d] Configuring MAC/PHY from eNB %d\n",Mod_idP,eNB_index); if (tdd_Config != NULL) { - UE_mac_inst[Mod_id].tdd_Config = tdd_Config; + UE_mac_inst[Mod_idP].tdd_Config = tdd_Config; } } else { - UE_id = find_UE_id(Mod_id, rntiP); + UE_id = find_UE_id(Mod_idP, rntiP); if (physicalConfigDedicated == NULL) { - LOG_I(MAC,"[CONFIG][eNB %d/%d] Configuring MAC/PHY\n", Mod_id, CC_id); + LOG_I(MAC,"[CONFIG][eNB %d/%d] Configuring MAC/PHY\n", Mod_idP, CC_idP); } else { - LOG_I(MAC,"[CONFIG][eNB %d/%d] Configuring MAC/PHY for UE %d (%x)\n", Mod_id, CC_id, UE_id, UE_RNTI(Mod_id, UE_id)); + LOG_I(MAC,"[CONFIG][eNB %d/%d] Configuring MAC/PHY for UE %d (%x)\n", Mod_idP, CC_idP, UE_id, UE_RNTI(Mod_idP, UE_id)); } } if (tdd_Config && SIwindowsize && SIperiod) { if (eNB_flagP == ENB_FLAG_YES) { - mac_xface->phy_config_sib1_eNB(Mod_id, CC_id, tdd_Config, *SIwindowsize, *SIperiod); + mac_xface->phy_config_sib1_eNB(Mod_idP, CC_idP, tdd_Config, *SIwindowsize, *SIperiod); } else { - mac_xface->phy_config_sib1_ue(Mod_id,0,eNB_index,tdd_Config,*SIwindowsize,*SIperiod); + mac_xface->phy_config_sib1_ue(Mod_idP,0,eNB_index,tdd_Config,*SIwindowsize,*SIperiod); } } @@ -165,106 +168,112 @@ rrc_mac_config_req( LOG_I(MAC,"[CONFIG]pusch_config_common.groupAssignmentPUSCH = %ld\n",radioResourceConfigCommon->pusch_ConfigCommon.ul_ReferenceSignalsPUSCH.groupAssignmentPUSCH); LOG_I(MAC,"[CONFIG]pusch_config_common.sequenceHoppingEnabled = %d\n",radioResourceConfigCommon->pusch_ConfigCommon.ul_ReferenceSignalsPUSCH.sequenceHoppingEnabled); LOG_I(MAC,"[CONFIG]pusch_config_common.cyclicShift = %ld\n",radioResourceConfigCommon->pusch_ConfigCommon.ul_ReferenceSignalsPUSCH.cyclicShift); - mac_xface->phy_config_sib2_eNB(Mod_id, CC_id, radioResourceConfigCommon, ul_CarrierFreq, ul_Bandwidth, additionalSpectrumEmission, mbsfn_SubframeConfigList); + mac_xface->phy_config_sib2_eNB(Mod_idP, CC_idP, radioResourceConfigCommon, ul_CarrierFreq, ul_Bandwidth, additionalSpectrumEmission, mbsfn_SubframeConfigList); } else { - UE_mac_inst[Mod_id].radioResourceConfigCommon = radioResourceConfigCommon; - mac_xface->phy_config_sib2_ue(Mod_id,0,eNB_index,radioResourceConfigCommon,ul_CarrierFreq,ul_Bandwidth,additionalSpectrumEmission,mbsfn_SubframeConfigList); + UE_mac_inst[Mod_idP].radioResourceConfigCommon = radioResourceConfigCommon; + mac_xface->phy_config_sib2_ue(Mod_idP,0,eNB_index,radioResourceConfigCommon,ul_CarrierFreq,ul_Bandwidth,additionalSpectrumEmission,mbsfn_SubframeConfigList); } } // SRB2_lchan_config->choice.explicitValue.ul_SpecificParameters->logicalChannelGroup if (logicalChannelConfig!= NULL) { if (eNB_flagP==0) { - LOG_I(MAC,"[CONFIG][UE %d] Applying RRC logicalChannelConfig from eNB%d\n",Mod_id,eNB_index); - UE_mac_inst[Mod_id].logicalChannelConfig[logicalChannelIdentity]=logicalChannelConfig; - UE_mac_inst[Mod_id].scheduling_info.Bj[logicalChannelIdentity]=0; // initilize the bucket for this lcid + LOG_I(MAC,"[CONFIG][UE %d] Applying RRC logicalChannelConfig from eNB%d\n",Mod_idP,eNB_index); + UE_mac_inst[Mod_idP].logicalChannelConfig[logicalChannelIdentity]=logicalChannelConfig; + UE_mac_inst[Mod_idP].scheduling_info.Bj[logicalChannelIdentity]=0; // initilize the bucket for this lcid if (logicalChannelConfig->ul_SpecificParameters) { - UE_mac_inst[Mod_id].scheduling_info.bucket_size[logicalChannelIdentity]=logicalChannelConfig->ul_SpecificParameters->prioritisedBitRate * + UE_mac_inst[Mod_idP].scheduling_info.bucket_size[logicalChannelIdentity]=logicalChannelConfig->ul_SpecificParameters->prioritisedBitRate * logicalChannelConfig->ul_SpecificParameters->bucketSizeDuration; // set the max bucket size - UE_mac_inst[Mod_id].scheduling_info.LCGID[logicalChannelIdentity]=*logicalChannelConfig->ul_SpecificParameters->logicalChannelGroup; - LOG_D(MAC,"[CONFIG][UE %d] LCID %d is attached to the LCGID %d\n",Mod_id,logicalChannelIdentity,*logicalChannelConfig->ul_SpecificParameters->logicalChannelGroup); + UE_mac_inst[Mod_idP].scheduling_info.LCGID[logicalChannelIdentity]=*logicalChannelConfig->ul_SpecificParameters->logicalChannelGroup; + LOG_D(MAC,"[CONFIG][UE %d] LCID %d is attached to the LCGID %d\n",Mod_idP,logicalChannelIdentity,*logicalChannelConfig->ul_SpecificParameters->logicalChannelGroup); } else { - LOG_E(MAC,"[CONFIG][UE %d] LCID %d NULL ul_SpecificParameters\n",Mod_id,logicalChannelIdentity); + LOG_E(MAC,"[CONFIG][UE %d] LCID %d NULL ul_SpecificParameters\n",Mod_idP,logicalChannelIdentity); mac_xface->macphy_exit("NULL ul_SpecificParameters"); } } + else { + if (logicalChannelConfig) + UE_list->UE_template[CC_idP][UE_id].lcgidmap[logicalChannelIdentity] = *logicalChannelConfig->ul_SpecificParameters->logicalChannelGroup; + else + UE_list->UE_template[CC_idP][UE_id].lcgidmap[logicalChannelIdentity] = 0; + } } if (mac_MainConfig != NULL) { if (eNB_flagP==0) { - LOG_I(MAC,"[CONFIG][UE%d] Applying RRC macMainConfig from eNB%d\n",Mod_id,eNB_index); - UE_mac_inst[Mod_id].macConfig=mac_MainConfig; - UE_mac_inst[Mod_id].measGapConfig=measGapConfig; + LOG_I(MAC,"[CONFIG][UE%d] Applying RRC macMainConfig from eNB%d\n",Mod_idP,eNB_index); + UE_mac_inst[Mod_idP].macConfig=mac_MainConfig; + UE_mac_inst[Mod_idP].measGapConfig=measGapConfig; if (mac_MainConfig->ul_SCH_Config) { if (mac_MainConfig->ul_SCH_Config->periodicBSR_Timer) { - UE_mac_inst[Mod_id].scheduling_info.periodicBSR_Timer = (uint16_t) *mac_MainConfig->ul_SCH_Config->periodicBSR_Timer; + UE_mac_inst[Mod_idP].scheduling_info.periodicBSR_Timer = (uint16_t) *mac_MainConfig->ul_SCH_Config->periodicBSR_Timer; } else { - UE_mac_inst[Mod_id].scheduling_info.periodicBSR_Timer = (uint16_t) MAC_MainConfig__ul_SCH_Config__periodicBSR_Timer_infinity; + UE_mac_inst[Mod_idP].scheduling_info.periodicBSR_Timer = (uint16_t) MAC_MainConfig__ul_SCH_Config__periodicBSR_Timer_infinity; } if (mac_MainConfig->ul_SCH_Config->maxHARQ_Tx) { - UE_mac_inst[Mod_id].scheduling_info.maxHARQ_Tx = (uint16_t) *mac_MainConfig->ul_SCH_Config->maxHARQ_Tx; + UE_mac_inst[Mod_idP].scheduling_info.maxHARQ_Tx = (uint16_t) *mac_MainConfig->ul_SCH_Config->maxHARQ_Tx; } else { - UE_mac_inst[Mod_id].scheduling_info.maxHARQ_Tx = (uint16_t) MAC_MainConfig__ul_SCH_Config__maxHARQ_Tx_n5; + UE_mac_inst[Mod_idP].scheduling_info.maxHARQ_Tx = (uint16_t) MAC_MainConfig__ul_SCH_Config__maxHARQ_Tx_n5; } if (mac_MainConfig->ul_SCH_Config->retxBSR_Timer) { - UE_mac_inst[Mod_id].scheduling_info.retxBSR_Timer = (uint16_t) mac_MainConfig->ul_SCH_Config->retxBSR_Timer; + UE_mac_inst[Mod_idP].scheduling_info.retxBSR_Timer = (uint16_t) mac_MainConfig->ul_SCH_Config->retxBSR_Timer; } else { - UE_mac_inst[Mod_id].scheduling_info.retxBSR_Timer = (uint16_t)MAC_MainConfig__ul_SCH_Config__retxBSR_Timer_sf2560; + UE_mac_inst[Mod_idP].scheduling_info.retxBSR_Timer = (uint16_t)MAC_MainConfig__ul_SCH_Config__retxBSR_Timer_sf2560; } } #ifdef Rel10 if (mac_MainConfig->ext1 && mac_MainConfig->ext1->sr_ProhibitTimer_r9) { - UE_mac_inst[Mod_id].scheduling_info.sr_ProhibitTimer = (uint16_t) *mac_MainConfig->ext1->sr_ProhibitTimer_r9; + UE_mac_inst[Mod_idP].scheduling_info.sr_ProhibitTimer = (uint16_t) *mac_MainConfig->ext1->sr_ProhibitTimer_r9; } else { - UE_mac_inst[Mod_id].scheduling_info.sr_ProhibitTimer = (uint16_t) 0; + UE_mac_inst[Mod_idP].scheduling_info.sr_ProhibitTimer = (uint16_t) 0; } #endif - UE_mac_inst[Mod_id].scheduling_info.periodicBSR_SF = get_sf_periodicBSRTimer(UE_mac_inst[Mod_id].scheduling_info.periodicBSR_Timer); - UE_mac_inst[Mod_id].scheduling_info.retxBSR_SF = get_sf_retxBSRTimer(UE_mac_inst[Mod_id].scheduling_info.retxBSR_Timer); + UE_mac_inst[Mod_idP].scheduling_info.periodicBSR_SF = get_sf_periodicBSRTimer(UE_mac_inst[Mod_idP].scheduling_info.periodicBSR_Timer); + UE_mac_inst[Mod_idP].scheduling_info.retxBSR_SF = get_sf_retxBSRTimer(UE_mac_inst[Mod_idP].scheduling_info.retxBSR_Timer); - UE_mac_inst[Mod_id].scheduling_info.drx_config = mac_MainConfig->drx_Config; - UE_mac_inst[Mod_id].scheduling_info.phr_config = mac_MainConfig->phr_Config; + UE_mac_inst[Mod_idP].scheduling_info.drx_config = mac_MainConfig->drx_Config; + UE_mac_inst[Mod_idP].scheduling_info.phr_config = mac_MainConfig->phr_Config; if (mac_MainConfig->phr_Config) { - UE_mac_inst[Mod_id].PHR_state = mac_MainConfig->phr_Config->present; - UE_mac_inst[Mod_id].PHR_reconfigured = 1; - UE_mac_inst[Mod_id].scheduling_info.periodicPHR_Timer = mac_MainConfig->phr_Config->choice.setup.periodicPHR_Timer; - UE_mac_inst[Mod_id].scheduling_info.prohibitPHR_Timer = mac_MainConfig->phr_Config->choice.setup.prohibitPHR_Timer; - UE_mac_inst[Mod_id].scheduling_info.PathlossChange = mac_MainConfig->phr_Config->choice.setup.dl_PathlossChange; + UE_mac_inst[Mod_idP].PHR_state = mac_MainConfig->phr_Config->present; + UE_mac_inst[Mod_idP].PHR_reconfigured = 1; + UE_mac_inst[Mod_idP].scheduling_info.periodicPHR_Timer = mac_MainConfig->phr_Config->choice.setup.periodicPHR_Timer; + UE_mac_inst[Mod_idP].scheduling_info.prohibitPHR_Timer = mac_MainConfig->phr_Config->choice.setup.prohibitPHR_Timer; + UE_mac_inst[Mod_idP].scheduling_info.PathlossChange = mac_MainConfig->phr_Config->choice.setup.dl_PathlossChange; } else { - UE_mac_inst[Mod_id].PHR_reconfigured = 0; - UE_mac_inst[Mod_id].PHR_state = MAC_MainConfig__phr_Config_PR_setup; - UE_mac_inst[Mod_id].scheduling_info.periodicPHR_Timer = MAC_MainConfig__phr_Config__setup__periodicPHR_Timer_sf20; - UE_mac_inst[Mod_id].scheduling_info.prohibitPHR_Timer = MAC_MainConfig__phr_Config__setup__prohibitPHR_Timer_sf20; - UE_mac_inst[Mod_id].scheduling_info.PathlossChange = MAC_MainConfig__phr_Config__setup__dl_PathlossChange_dB1; + UE_mac_inst[Mod_idP].PHR_reconfigured = 0; + UE_mac_inst[Mod_idP].PHR_state = MAC_MainConfig__phr_Config_PR_setup; + UE_mac_inst[Mod_idP].scheduling_info.periodicPHR_Timer = MAC_MainConfig__phr_Config__setup__periodicPHR_Timer_sf20; + UE_mac_inst[Mod_idP].scheduling_info.prohibitPHR_Timer = MAC_MainConfig__phr_Config__setup__prohibitPHR_Timer_sf20; + UE_mac_inst[Mod_idP].scheduling_info.PathlossChange = MAC_MainConfig__phr_Config__setup__dl_PathlossChange_dB1; } - UE_mac_inst[Mod_id].scheduling_info.periodicPHR_SF = get_sf_perioidicPHR_Timer(UE_mac_inst[Mod_id].scheduling_info.periodicPHR_Timer); - UE_mac_inst[Mod_id].scheduling_info.prohibitPHR_SF = get_sf_prohibitPHR_Timer(UE_mac_inst[Mod_id].scheduling_info.prohibitPHR_Timer); - UE_mac_inst[Mod_id].scheduling_info.PathlossChange_db = get_db_dl_PathlossChange(UE_mac_inst[Mod_id].scheduling_info.PathlossChange); + UE_mac_inst[Mod_idP].scheduling_info.periodicPHR_SF = get_sf_perioidicPHR_Timer(UE_mac_inst[Mod_idP].scheduling_info.periodicPHR_Timer); + UE_mac_inst[Mod_idP].scheduling_info.prohibitPHR_SF = get_sf_prohibitPHR_Timer(UE_mac_inst[Mod_idP].scheduling_info.prohibitPHR_Timer); + UE_mac_inst[Mod_idP].scheduling_info.PathlossChange_db = get_db_dl_PathlossChange(UE_mac_inst[Mod_idP].scheduling_info.PathlossChange); LOG_D(MAC,"[UE %d] config PHR (%d): periodic %d (SF) prohibit %d (SF) pathlosschange %d (db) \n", - Mod_id, + Mod_idP, (mac_MainConfig->phr_Config)?mac_MainConfig->phr_Config->present:-1, - UE_mac_inst[Mod_id].scheduling_info.periodicPHR_SF, - UE_mac_inst[Mod_id].scheduling_info.prohibitPHR_SF, - UE_mac_inst[Mod_id].scheduling_info.PathlossChange_db); + UE_mac_inst[Mod_idP].scheduling_info.periodicPHR_SF, + UE_mac_inst[Mod_idP].scheduling_info.prohibitPHR_SF, + UE_mac_inst[Mod_idP].scheduling_info.PathlossChange_db); } } if (physicalConfigDedicated != NULL) { if (eNB_flagP==1) { - mac_xface->phy_config_dedicated_eNB(Mod_id, CC_id, UE_RNTI(Mod_id, UE_id), physicalConfigDedicated); + mac_xface->phy_config_dedicated_eNB(Mod_idP, CC_idP, UE_RNTI(Mod_idP, UE_id), physicalConfigDedicated); } else { - mac_xface->phy_config_dedicated_ue(Mod_id,0,eNB_index,physicalConfigDedicated); - UE_mac_inst[Mod_id].physicalConfigDedicated=physicalConfigDedicated; // for SR proc + mac_xface->phy_config_dedicated_ue(Mod_idP,0,eNB_index,physicalConfigDedicated); + UE_mac_inst[Mod_idP].physicalConfigDedicated=physicalConfigDedicated; // for SR proc } } @@ -273,11 +282,12 @@ rrc_mac_config_req( if (sCellToAddMod_r10 != NULL) { if (eNB_flagP==1) { - mac_xface->phy_config_dedicated_scell_eNB(Mod_id,UE_RNTI(Mod_id,UE_id),sCellToAddMod_r10,1); + mac_xface->phy_config_dedicated_scell_eNB(Mod_idP,UE_RNTI(Mod_idP,UE_id),sCellToAddMod_r10,1); } else { -//#warning "phy_config_dedicated_scell_ue is empty" - mac_xface->phy_config_dedicated_scell_ue(Mod_id,eNB_index,sCellToAddMod_r10,1); - UE_mac_inst[Mod_id].physicalConfigDedicatedSCell_r10 = sCellToAddMod_r10->radioResourceConfigDedicatedSCell_r10->physicalConfigDedicatedSCell_r10; // using SCell index 0 + + //#warning "phy_config_dedicated_scell_ue is empty" + mac_xface->phy_config_dedicated_scell_ue(Mod_idP,eNB_index,sCellToAddMod_r10,1); + UE_mac_inst[Mod_idP].physicalConfigDedicatedSCell_r10 = sCellToAddMod_r10->radioResourceConfigDedicatedSCell_r10->physicalConfigDedicatedSCell_r10; // using SCell index 0 } } @@ -286,22 +296,22 @@ rrc_mac_config_req( if (eNB_flagP == 0) { if (measObj!= NULL) { if (measObj[0]!= NULL) { - UE_mac_inst[Mod_id].n_adj_cells = measObj[0]->measObject.choice.measObjectEUTRA.cellsToAddModList->list.count; - LOG_I(MAC,"Number of adjacent cells %d\n",UE_mac_inst[Mod_id].n_adj_cells); + UE_mac_inst[Mod_idP].n_adj_cells = measObj[0]->measObject.choice.measObjectEUTRA.cellsToAddModList->list.count; + LOG_I(MAC,"Number of adjacent cells %d\n",UE_mac_inst[Mod_idP].n_adj_cells); - for (i=0; i<UE_mac_inst[Mod_id].n_adj_cells; i++) { - UE_mac_inst[Mod_id].adj_cell_id[i] = measObj[0]->measObject.choice.measObjectEUTRA.cellsToAddModList->list.array[i]->physCellId; - LOG_I(MAC,"Cell %d : Nid_cell %d\n",i,UE_mac_inst[Mod_id].adj_cell_id[i]); + for (i=0; i<UE_mac_inst[Mod_idP].n_adj_cells; i++) { + UE_mac_inst[Mod_idP].adj_cell_id[i] = measObj[0]->measObject.choice.measObjectEUTRA.cellsToAddModList->list.array[i]->physCellId; + LOG_I(MAC,"Cell %d : Nid_cell %d\n",i,UE_mac_inst[Mod_idP].adj_cell_id[i]); } - mac_xface->phy_config_meas_ue(Mod_id,0,eNB_index,UE_mac_inst[Mod_id].n_adj_cells,UE_mac_inst[Mod_id].adj_cell_id); + mac_xface->phy_config_meas_ue(Mod_idP,0,eNB_index,UE_mac_inst[Mod_idP].n_adj_cells,UE_mac_inst[Mod_idP].adj_cell_id); } /* if (quantityConfig != NULL) { if (quantityConfig[0] != NULL) { - UE_mac_inst[Mod_id].quantityConfig = quantityConfig[0]; - LOG_I(MAC,"UE %d configured filterCoeff.",UE_mac_inst[Mod_id].crnti); + UE_mac_inst[Mod_idP].quantityConfig = quantityConfig[0]; + LOG_I(MAC,"UE %d configured filterCoeff.",UE_mac_inst[Mod_idP].crnti); mac_xface->phy_config_meas_ue } } @@ -312,51 +322,51 @@ rrc_mac_config_req( if (eNB_flagP==0) { if(mobilityControlInfo != NULL) { - LOG_D(MAC,"[UE%d] MAC Reset procedure triggered by RRC eNB %d \n",Mod_id,eNB_index); - ue_mac_reset(Mod_id,eNB_index); + LOG_D(MAC,"[UE%d] MAC Reset procedure triggered by RRC eNB %d \n",Mod_idP,eNB_index); + ue_mac_reset(Mod_idP,eNB_index); if(mobilityControlInfo->radioResourceConfigCommon.rach_ConfigCommon) { - memcpy((void *)&UE_mac_inst[Mod_id].radioResourceConfigCommon->rach_ConfigCommon, + memcpy((void *)&UE_mac_inst[Mod_idP].radioResourceConfigCommon->rach_ConfigCommon, (void *)mobilityControlInfo->radioResourceConfigCommon.rach_ConfigCommon, sizeof(RACH_ConfigCommon_t)); } - memcpy((void *)&UE_mac_inst[Mod_id].radioResourceConfigCommon->prach_Config.prach_ConfigInfo, + memcpy((void *)&UE_mac_inst[Mod_idP].radioResourceConfigCommon->prach_Config.prach_ConfigInfo, (void *)mobilityControlInfo->radioResourceConfigCommon.prach_Config.prach_ConfigInfo, sizeof(PRACH_ConfigInfo_t)); - UE_mac_inst[Mod_id].radioResourceConfigCommon->prach_Config.rootSequenceIndex = mobilityControlInfo->radioResourceConfigCommon.prach_Config.rootSequenceIndex; + UE_mac_inst[Mod_idP].radioResourceConfigCommon->prach_Config.rootSequenceIndex = mobilityControlInfo->radioResourceConfigCommon.prach_Config.rootSequenceIndex; if(mobilityControlInfo->radioResourceConfigCommon.pdsch_ConfigCommon) { - memcpy((void *)&UE_mac_inst[Mod_id].radioResourceConfigCommon->pdsch_ConfigCommon, + memcpy((void *)&UE_mac_inst[Mod_idP].radioResourceConfigCommon->pdsch_ConfigCommon, (void *)mobilityControlInfo->radioResourceConfigCommon.pdsch_ConfigCommon, sizeof(PDSCH_ConfigCommon_t)); } // not a pointer: mobilityControlInfo->radioResourceConfigCommon.pusch_ConfigCommon - memcpy((void *)&UE_mac_inst[Mod_id].radioResourceConfigCommon->pusch_ConfigCommon, + memcpy((void *)&UE_mac_inst[Mod_idP].radioResourceConfigCommon->pusch_ConfigCommon, (void *)&mobilityControlInfo->radioResourceConfigCommon.pusch_ConfigCommon, sizeof(PUSCH_ConfigCommon_t)); if(mobilityControlInfo->radioResourceConfigCommon.phich_Config) { - /* memcpy((void *)&UE_mac_inst[Mod_id].radioResourceConfigCommon->phich_Config, + /* memcpy((void *)&UE_mac_inst[Mod_idP].radioResourceConfigCommon->phich_Config, (void *)mobilityControlInfo->radioResourceConfigCommon.phich_Config, sizeof(PHICH_Config_t)); */ } if(mobilityControlInfo->radioResourceConfigCommon.pucch_ConfigCommon) { - memcpy((void *)&UE_mac_inst[Mod_id].radioResourceConfigCommon->pucch_ConfigCommon, + memcpy((void *)&UE_mac_inst[Mod_idP].radioResourceConfigCommon->pucch_ConfigCommon, (void *)mobilityControlInfo->radioResourceConfigCommon.pucch_ConfigCommon, sizeof(PUCCH_ConfigCommon_t)); } if(mobilityControlInfo->radioResourceConfigCommon.soundingRS_UL_ConfigCommon) { - memcpy((void *)&UE_mac_inst[Mod_id].radioResourceConfigCommon->soundingRS_UL_ConfigCommon, + memcpy((void *)&UE_mac_inst[Mod_idP].radioResourceConfigCommon->soundingRS_UL_ConfigCommon, (void *)mobilityControlInfo->radioResourceConfigCommon.soundingRS_UL_ConfigCommon, sizeof(SoundingRS_UL_ConfigCommon_t)); } if(mobilityControlInfo->radioResourceConfigCommon.uplinkPowerControlCommon) { - memcpy((void *)&UE_mac_inst[Mod_id].radioResourceConfigCommon->uplinkPowerControlCommon, + memcpy((void *)&UE_mac_inst[Mod_idP].radioResourceConfigCommon->uplinkPowerControlCommon, (void *)mobilityControlInfo->radioResourceConfigCommon.uplinkPowerControlCommon, sizeof(UplinkPowerControlCommon_t)); } @@ -367,54 +377,54 @@ rrc_mac_config_req( } if(mobilityControlInfo->radioResourceConfigCommon.tdd_Config) { - UE_mac_inst[Mod_id].tdd_Config = mobilityControlInfo->radioResourceConfigCommon.tdd_Config; + UE_mac_inst[Mod_idP].tdd_Config = mobilityControlInfo->radioResourceConfigCommon.tdd_Config; } if(mobilityControlInfo->radioResourceConfigCommon.ul_CyclicPrefixLength) { - memcpy((void *)&UE_mac_inst[Mod_id].radioResourceConfigCommon->ul_CyclicPrefixLength, + memcpy((void *)&UE_mac_inst[Mod_idP].radioResourceConfigCommon->ul_CyclicPrefixLength, (void *)mobilityControlInfo->radioResourceConfigCommon.ul_CyclicPrefixLength, sizeof(UL_CyclicPrefixLength_t)); } // store the previous rnti in case of failure, and set thenew rnti - UE_mac_inst[Mod_id].crnti_before_ho = UE_mac_inst[Mod_id].crnti; - UE_mac_inst[Mod_id].crnti = ((mobilityControlInfo->newUE_Identity.buf[0])|(mobilityControlInfo->newUE_Identity.buf[1]<<8)); - LOG_I(MAC,"[UE %d] Received new identity %x from %d\n", Mod_id, UE_mac_inst[Mod_id].crnti, eNB_index); - UE_mac_inst[Mod_id].rach_ConfigDedicated = malloc(sizeof(*mobilityControlInfo->rach_ConfigDedicated)); + UE_mac_inst[Mod_idP].crnti_before_ho = UE_mac_inst[Mod_idP].crnti; + UE_mac_inst[Mod_idP].crnti = ((mobilityControlInfo->newUE_Identity.buf[0])|(mobilityControlInfo->newUE_Identity.buf[1]<<8)); + LOG_I(MAC,"[UE %d] Received new identity %x from %d\n", Mod_idP, UE_mac_inst[Mod_idP].crnti, eNB_index); + UE_mac_inst[Mod_idP].rach_ConfigDedicated = malloc(sizeof(*mobilityControlInfo->rach_ConfigDedicated)); if (mobilityControlInfo->rach_ConfigDedicated) { - memcpy((void*)UE_mac_inst[Mod_id].rach_ConfigDedicated, + memcpy((void*)UE_mac_inst[Mod_idP].rach_ConfigDedicated, (void*)mobilityControlInfo->rach_ConfigDedicated, sizeof(*mobilityControlInfo->rach_ConfigDedicated)); } - mac_xface->phy_config_afterHO_ue(Mod_id,0,eNB_index,mobilityControlInfo,0); + mac_xface->phy_config_afterHO_ue(Mod_idP,0,eNB_index,mobilityControlInfo,0); } } if (mbsfn_SubframeConfigList != NULL) { if (eNB_flagP == 1) { - LOG_I(MAC,"[eNB %d][CONFIG] Received %d subframe allocation pattern for MBSFN\n", Mod_id, mbsfn_SubframeConfigList->list.count); - eNB_mac_inst[Mod_id].common_channels[0].num_sf_allocation_pattern= mbsfn_SubframeConfigList->list.count; + LOG_I(MAC,"[eNB %d][CONFIG] Received %d subframe allocation pattern for MBSFN\n", Mod_idP, mbsfn_SubframeConfigList->list.count); + eNB_mac_inst[Mod_idP].common_channels[0].num_sf_allocation_pattern= mbsfn_SubframeConfigList->list.count; for (i=0; i<mbsfn_SubframeConfigList->list.count; i++) { - eNB_mac_inst[Mod_id].common_channels[0].mbsfn_SubframeConfig[i] = mbsfn_SubframeConfigList->list.array[i]; - LOG_I(MAC, "[eNB %d][CONFIG] MBSFN_SubframeConfig[%d] pattern is %x\n", Mod_id, i, - eNB_mac_inst[Mod_id].common_channels[0].mbsfn_SubframeConfig[i]->subframeAllocation.choice.oneFrame.buf[0]); + eNB_mac_inst[Mod_idP].common_channels[0].mbsfn_SubframeConfig[i] = mbsfn_SubframeConfigList->list.array[i]; + LOG_I(MAC, "[eNB %d][CONFIG] MBSFN_SubframeConfig[%d] pattern is %x\n", Mod_idP, i, + eNB_mac_inst[Mod_idP].common_channels[0].mbsfn_SubframeConfig[i]->subframeAllocation.choice.oneFrame.buf[0]); } #ifdef Rel10 - eNB_mac_inst[Mod_id].common_channels[0].MBMS_flag = MBMS_Flag; + eNB_mac_inst[Mod_idP].common_channels[0].MBMS_flag = MBMS_Flag; #endif } else { // UE - LOG_I(MAC,"[UE %d][CONFIG] Received %d subframe allocation pattern for MBSFN\n", Mod_id, mbsfn_SubframeConfigList->list.count); - UE_mac_inst[Mod_id].num_sf_allocation_pattern= mbsfn_SubframeConfigList->list.count; + LOG_I(MAC,"[UE %d][CONFIG] Received %d subframe allocation pattern for MBSFN\n", Mod_idP, mbsfn_SubframeConfigList->list.count); + UE_mac_inst[Mod_idP].num_sf_allocation_pattern= mbsfn_SubframeConfigList->list.count; for (i=0; i<mbsfn_SubframeConfigList->list.count; i++) { - LOG_I(MAC, "[UE %d] Configuring MBSFN_SubframeConfig %d from received SIB2 \n", Mod_id, i); - UE_mac_inst[Mod_id].mbsfn_SubframeConfig[i] = mbsfn_SubframeConfigList->list.array[i]; - // LOG_I("[UE %d] MBSFN_SubframeConfig[%d] pattern is %ld\n", Mod_id, - // UE_mac_inst[Mod_id].mbsfn_SubframeConfig[i]->subframeAllocation.choice.oneFrame.buf[0]); + LOG_I(MAC, "[UE %d] Configuring MBSFN_SubframeConfig %d from received SIB2 \n", Mod_idP, i); + UE_mac_inst[Mod_idP].mbsfn_SubframeConfig[i] = mbsfn_SubframeConfigList->list.array[i]; + // LOG_I("[UE %d] MBSFN_SubframeConfig[%d] pattern is %ld\n", Mod_idP, + // UE_mac_inst[Mod_idP].mbsfn_SubframeConfig[i]->subframeAllocation.choice.oneFrame.buf[0]); } } } @@ -424,24 +434,24 @@ rrc_mac_config_req( if (mbsfn_AreaInfoList != NULL) { if (eNB_flagP == 1) { // One eNB could be part of multiple mbsfn syc area, this could change over time so reset each time - LOG_I(MAC,"[eNB %d][CONFIG] Received %d MBSFN Area Info\n", Mod_id, mbsfn_AreaInfoList->list.count); - eNB_mac_inst[Mod_id].common_channels[0].num_active_mbsfn_area = mbsfn_AreaInfoList->list.count; + LOG_I(MAC,"[eNB %d][CONFIG] Received %d MBSFN Area Info\n", Mod_idP, mbsfn_AreaInfoList->list.count); + eNB_mac_inst[Mod_idP].common_channels[0].num_active_mbsfn_area = mbsfn_AreaInfoList->list.count; for (i =0; i< mbsfn_AreaInfoList->list.count; i++) { - eNB_mac_inst[Mod_id].common_channels[0].mbsfn_AreaInfo[i] = mbsfn_AreaInfoList->list.array[i]; - LOG_I(MAC,"[eNB %d][CONFIG] MBSFN_AreaInfo[%d]: MCCH Repetition Period = %ld\n", Mod_id,i, - eNB_mac_inst[Mod_id].common_channels[0].mbsfn_AreaInfo[i]->mcch_Config_r9.mcch_RepetitionPeriod_r9); - mac_xface->phy_config_sib13_eNB(Mod_id,0,i,eNB_mac_inst[Mod_id].common_channels[0].mbsfn_AreaInfo[i]->mbsfn_AreaId_r9); + eNB_mac_inst[Mod_idP].common_channels[0].mbsfn_AreaInfo[i] = mbsfn_AreaInfoList->list.array[i]; + LOG_I(MAC,"[eNB %d][CONFIG] MBSFN_AreaInfo[%d]: MCCH Repetition Period = %ld\n", Mod_idP,i, + eNB_mac_inst[Mod_idP].common_channels[0].mbsfn_AreaInfo[i]->mcch_Config_r9.mcch_RepetitionPeriod_r9); + mac_xface->phy_config_sib13_eNB(Mod_idP,0,i,eNB_mac_inst[Mod_idP].common_channels[0].mbsfn_AreaInfo[i]->mbsfn_AreaId_r9); } } else { // UE - LOG_I(MAC,"[UE %d][CONFIG] Received %d MBSFN Area Info\n", Mod_id, mbsfn_AreaInfoList->list.count); - UE_mac_inst[Mod_id].num_active_mbsfn_area = mbsfn_AreaInfoList->list.count; + LOG_I(MAC,"[UE %d][CONFIG] Received %d MBSFN Area Info\n", Mod_idP, mbsfn_AreaInfoList->list.count); + UE_mac_inst[Mod_idP].num_active_mbsfn_area = mbsfn_AreaInfoList->list.count; for (i =0; i< mbsfn_AreaInfoList->list.count; i++) { - UE_mac_inst[Mod_id].mbsfn_AreaInfo[i] = mbsfn_AreaInfoList->list.array[i]; - LOG_I(MAC,"[UE %d] MBSFN_AreaInfo[%d]: MCCH Repetition Period = %ld\n",Mod_id, i, - UE_mac_inst[Mod_id].mbsfn_AreaInfo[i]->mcch_Config_r9.mcch_RepetitionPeriod_r9); - mac_xface->phy_config_sib13_ue(Mod_id,0,eNB_index,i,UE_mac_inst[Mod_id].mbsfn_AreaInfo[i]->mbsfn_AreaId_r9); + UE_mac_inst[Mod_idP].mbsfn_AreaInfo[i] = mbsfn_AreaInfoList->list.array[i]; + LOG_I(MAC,"[UE %d] MBSFN_AreaInfo[%d]: MCCH Repetition Period = %ld\n",Mod_idP, i, + UE_mac_inst[Mod_idP].mbsfn_AreaInfo[i]->mcch_Config_r9.mcch_RepetitionPeriod_r9); + mac_xface->phy_config_sib13_ue(Mod_idP,0,eNB_index,i,UE_mac_inst[Mod_idP].mbsfn_AreaInfo[i]->mbsfn_AreaId_r9); } } } @@ -456,29 +466,29 @@ rrc_mac_config_req( LOG_I(MAC, "[CONFIG] Number of PMCH in this MBSFN Area %d\n", pmch_InfoList->list.count); for (i =0; i< pmch_InfoList->list.count; i++) { - eNB_mac_inst[Mod_id].common_channels[0].pmch_Config[i] = &pmch_InfoList->list.array[i]->pmch_Config_r9; + eNB_mac_inst[Mod_idP].common_channels[0].pmch_Config[i] = &pmch_InfoList->list.array[i]->pmch_Config_r9; LOG_I(MAC, "[CONFIG] PMCH[%d]: This PMCH stop (sf_AllocEnd_r9) at subframe %ldth\n", i, - eNB_mac_inst[Mod_id].common_channels[0].pmch_Config[i]->sf_AllocEnd_r9); + eNB_mac_inst[Mod_idP].common_channels[0].pmch_Config[i]->sf_AllocEnd_r9); LOG_I(MAC, "[CONFIG] PMCH[%d]: mch_Scheduling_Period = %ld\n", i, - eNB_mac_inst[Mod_id].common_channels[0].pmch_Config[i]->mch_SchedulingPeriod_r9); + eNB_mac_inst[Mod_idP].common_channels[0].pmch_Config[i]->mch_SchedulingPeriod_r9); LOG_I(MAC, "[CONFIG] PMCH[%d]: dataMCS = %ld\n", i, - eNB_mac_inst[Mod_id].common_channels[0].pmch_Config[i]->dataMCS_r9); + eNB_mac_inst[Mod_idP].common_channels[0].pmch_Config[i]->dataMCS_r9); // MBMS session info list in each MCH - eNB_mac_inst[Mod_id].common_channels[0].mbms_SessionList[i] = &pmch_InfoList->list.array[i]->mbms_SessionInfoList_r9; - LOG_I(MAC, "PMCH[%d] Number of session (MTCH) is: %d\n",i, eNB_mac_inst[Mod_id].common_channels[0].mbms_SessionList[i]->list.count); + eNB_mac_inst[Mod_idP].common_channels[0].mbms_SessionList[i] = &pmch_InfoList->list.array[i]->mbms_SessionInfoList_r9; + LOG_I(MAC, "PMCH[%d] Number of session (MTCH) is: %d\n",i, eNB_mac_inst[Mod_idP].common_channels[0].mbms_SessionList[i]->list.count); } } else { // UE - LOG_I(MAC, "[UE %d] Configuring PMCH_config from MCCH MESSAGE \n",Mod_id); + LOG_I(MAC, "[UE %d] Configuring PMCH_config from MCCH MESSAGE \n",Mod_idP); for (i =0; i< pmch_InfoList->list.count; i++) { - UE_mac_inst[Mod_id].pmch_Config[i] = &pmch_InfoList->list.array[i]->pmch_Config_r9; - LOG_I(MAC, "[UE %d] PMCH[%d]: MCH_Scheduling_Period = %ld\n", Mod_id, i, - UE_mac_inst[Mod_id].pmch_Config[i]->mch_SchedulingPeriod_r9); + UE_mac_inst[Mod_idP].pmch_Config[i] = &pmch_InfoList->list.array[i]->pmch_Config_r9; + LOG_I(MAC, "[UE %d] PMCH[%d]: MCH_Scheduling_Period = %ld\n", Mod_idP, i, + UE_mac_inst[Mod_idP].pmch_Config[i]->mch_SchedulingPeriod_r9); } - UE_mac_inst[Mod_id].mcch_status = 1; + UE_mac_inst[Mod_idP].mcch_status = 1; } } @@ -487,28 +497,28 @@ rrc_mac_config_req( if (eNB_flagP == 0) { if (cba_rnti) { - UE_mac_inst[Mod_id].cba_rnti[num_active_cba_groups-1] = cba_rnti; + UE_mac_inst[Mod_idP].cba_rnti[num_active_cba_groups-1] = cba_rnti; LOG_D(MAC,"[UE %d] configure CBA group %d RNTI %x for eNB %d (total active cba group %d)\n", - Mod_id,Mod_id%num_active_cba_groups, cba_rnti,eNB_index,num_active_cba_groups); - mac_xface->phy_config_cba_rnti(Mod_id,CC_id,eNB_flagP,eNB_index,cba_rnti,num_active_cba_groups-1, num_active_cba_groups); + Mod_idP,Mod_idP%num_active_cba_groups, cba_rnti,eNB_index,num_active_cba_groups); + mac_xface->phy_config_cba_rnti(Mod_idP,CC_idP,eNB_flagP,eNB_index,cba_rnti,num_active_cba_groups-1, num_active_cba_groups); } } else { if (cba_rnti) { LOG_D(MAC,"[eNB %d] configure CBA RNTI for UE %d (total active cba groups %d)\n", - Mod_id, UE_id, num_active_cba_groups); - eNB_mac_inst[Mod_id].common_channels[CC_id].num_active_cba_groups=num_active_cba_groups; + Mod_idP, UE_id, num_active_cba_groups); + eNB_mac_inst[Mod_idP].common_channels[CC_idP].num_active_cba_groups=num_active_cba_groups; for (i=0; i < num_active_cba_groups; i ++) { - if (eNB_mac_inst[Mod_id].common_channels[CC_id].cba_rnti[i] != cba_rnti + i) { - eNB_mac_inst[Mod_id].common_channels[CC_id].cba_rnti[i] = cba_rnti + i; + if (eNB_mac_inst[Mod_idP].common_channels[CC_idP].cba_rnti[i] != cba_rnti + i) { + eNB_mac_inst[Mod_idP].common_channels[CC_idP].cba_rnti[i] = cba_rnti + i; } //only configure UE ids up to num_active_cba_groups //we use them as candidates for the transmission of dci format0) if (UE_id%num_active_cba_groups == i) { - mac_xface->phy_config_cba_rnti(Mod_id,CC_id,eNB_flagP,UE_id,cba_rnti + i,i,num_active_cba_groups ); + mac_xface->phy_config_cba_rnti(Mod_idP,CC_idP,eNB_flagP,UE_id,cba_rnti + i,i,num_active_cba_groups ); LOG_D(MAC,"[eNB %d] configure CBA groups %d with RNTI %x for UE %d (total active cba groups %d)\n", - Mod_id, i, eNB_mac_inst[Mod_id].common_channels[CC_id].cba_rnti[i],UE_id, num_active_cba_groups); + Mod_idP, i, eNB_mac_inst[Mod_idP].common_channels[CC_idP].cba_rnti[i],UE_id, num_active_cba_groups); } } } @@ -558,7 +568,7 @@ rrc_get_estimated_ue_distance( return eNB_UE_stats->distance.power_based; } - // LOG_D(LOCALIZE, "DEBUG ME, dist = %d\n", &eNB_mac_inst[ctxt_pP->module_id].UE_list.UE_template[CC_id][UE_id].distance.power_based); + // LOG_D(LOCALIZE, "DEBUG ME, dist = %d\n", &eNB_mac_inst[ctxt_pP->module_id].UE_list.UE_template[CC_idP][UE_id].distance.power_based); } diff --git a/openair2/LAYER2/MAC/defs.h b/openair2/LAYER2/MAC/defs.h index cd2d593726a22ab537a77aa0006f210cac8b4fc7..bf166f6d64fd754a1c0c8f6cae93c82cfbbf723b 100644 --- a/openair2/LAYER2/MAC/defs.h +++ b/openair2/LAYER2/MAC/defs.h @@ -251,7 +251,7 @@ typedef struct { typedef struct { uint8_t Num_ue_spec_dci ; uint8_t Num_common_dci ; - uint32_t nCCE; + // uint32_t nCCE; uint32_t num_pdcch_symbols; DCI_ALLOC_t dci_alloc[NUM_DCI_MAX] ; } DCI_PDU; @@ -654,9 +654,12 @@ typedef struct { // Logical channel info for link with RLC - /// UE BSR info for each logical channel group id + /// Last received UE BSR info for each logical channel group id uint8_t bsr_info[MAX_NUM_LCGID]; + /// LCGID mapping + long lcgidmap[11]; + /// phr information int8_t phr_info; @@ -737,7 +740,15 @@ typedef struct { 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; + int16_t ta_update; + int32_t context_active_timer; + int32_t cqi_req_timer; + int32_t ul_inactivity_timer; + int32_t ul_failure_timer; + int32_t ul_scheduled; + int32_t ra_pdcch_order_sent; + int32_t ul_out_of_sync; + int32_t phr_received; } UE_sched_ctrl; /*! \brief eNB template for the Random access information */ typedef struct { diff --git a/openair2/LAYER2/MAC/eNB_scheduler.c b/openair2/LAYER2/MAC/eNB_scheduler.c index df867693a601dca88743be97e27b88ba11f7f16a..a6c4eaeb16eb039d1136f6a0ac351fc887da77e9 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler.c +++ b/openair2/LAYER2/MAC/eNB_scheduler.c @@ -90,7 +90,7 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, #endif #if defined(ENABLE_ITTI) MessageDef *msg_p; - const char *msg_name; + const char *msg_name; instance_t instance; int result; #endif @@ -98,6 +98,8 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, int CC_id,i,next_i; UE_list_t *UE_list=&eNB_mac_inst[module_idP].UE_list; rnti_t rnti; + void *DLSCH_dci=NULL; + int size_bits=0,size_bytes=0; LOG_D(MAC,"[eNB %d] Frame %d, Subframe %d, entering MAC scheduler (UE_list->head %d)\n",module_idP, frameP, subframeP,UE_list->head); @@ -106,8 +108,6 @@ 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; - 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); @@ -123,9 +123,125 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, mac_xface->get_eNB_UE_stats(module_idP, CC_id, rnti)); next_i= UE_list->next[i]; + PHY_vars_eNB_g[module_idP][CC_id]->pusch_stats_bsr[i][(frameP*10)+subframeP]=-63; + if (i==UE_list->head) + VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_UE0_BSR,PHY_vars_eNB_g[module_idP][CC_id]->pusch_stats_bsr[i][(frameP*10)+subframeP]); + // increment this, it is cleared when we receive an sdu + eNB_mac_inst[module_idP].UE_list.UE_sched_ctrl[i].ul_inactivity_timer++; + + eNB_mac_inst[module_idP].UE_list.UE_sched_ctrl[i].cqi_req_timer++; + if (mac_xface->get_eNB_UE_stats(module_idP, CC_id, rnti)==NULL) { - mac_remove_ue(module_idP, i, frameP, subframeP); + // mac_remove_ue(module_idP, i, frameP, subframeP); } + else { + // check uplink failure + if ((UE_list->UE_sched_ctrl[i].ul_failure_timer>0)&& + (UE_list->UE_sched_ctrl[i].ul_out_of_sync==0)) { + LOG_D(MAC,"UE %d rnti %x: UL Failure timer %d \n",i,rnti,UE_list->UE_sched_ctrl[i].ul_failure_timer); + if (UE_list->UE_sched_ctrl[i].ra_pdcch_order_sent==0) { + UE_list->UE_sched_ctrl[i].ra_pdcch_order_sent=1; + + // add a format 1A dci for this UE to request an RA procedure (only one UE per subframe) + LOG_D(MAC,"UE %d rnti %x: sending PDCCH order for RAPROC (failure timer %d) \n",i,rnti,UE_list->UE_sched_ctrl[i].ul_failure_timer); + DLSCH_dci = (void *)UE_list->UE_template[CC_id][i].DLSCH_DCI[0]; + *(uint32_t*)DLSCH_dci = 0; + 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*)DLSCH_dci)->type = 1; + ((DCI1A_1_5MHz_TDD_1_6_t*)DLSCH_dci)->rballoc = 31; + size_bytes = sizeof(DCI1A_1_5MHz_TDD_1_6_t); + size_bits = sizeof_DCI1A_1_5MHz_TDD_1_6_t; + break; + case 25: + ((DCI1A_5MHz_TDD_1_6_t*)DLSCH_dci)->type = 1; + ((DCI1A_5MHz_TDD_1_6_t*)DLSCH_dci)->rballoc = 511; + size_bytes = sizeof(DCI1A_5MHz_TDD_1_6_t); + size_bits = sizeof_DCI1A_5MHz_TDD_1_6_t; + break; + case 50: + ((DCI1A_10MHz_TDD_1_6_t*)DLSCH_dci)->type = 1; + ((DCI1A_10MHz_TDD_1_6_t*)DLSCH_dci)->rballoc = 2047; + size_bytes = sizeof(DCI1A_10MHz_TDD_1_6_t); + size_bits = sizeof_DCI1A_10MHz_TDD_1_6_t; + break; + case 100: + ((DCI1A_20MHz_TDD_1_6_t*)DLSCH_dci)->type = 1; + ((DCI1A_20MHz_TDD_1_6_t*)DLSCH_dci)->rballoc = 8191; + size_bytes = sizeof(DCI1A_20MHz_TDD_1_6_t); + size_bits = sizeof_DCI1A_20MHz_TDD_1_6_t; + break; + } + } + else { // FDD + switch (PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL) { + case 6: + ((DCI1A_1_5MHz_FDD_t*)DLSCH_dci)->type = 1; + ((DCI1A_1_5MHz_FDD_t*)DLSCH_dci)->rballoc = 31; + size_bytes = sizeof(DCI1A_1_5MHz_FDD_t); + size_bits = sizeof_DCI1A_1_5MHz_FDD_t; + break; + case 15:/* + ((DCI1A_2_5MHz_FDD_t*)DLSCH_dci)->type = 1; + ((DCI1A_2_5MHz_FDD_t*)DLSCH_dci)->rballoc = 31; + size_bytes = sizeof(DCI1A_1_5MHz_FDD_t); + size_bits = sizeof_DCI1A_1_5MHz_FDD_t;*/ + break; + case 25: + ((DCI1A_5MHz_FDD_t*)DLSCH_dci)->type = 1; + ((DCI1A_5MHz_FDD_t*)DLSCH_dci)->rballoc = 511; + size_bytes = sizeof(DCI1A_5MHz_FDD_t); + size_bits = sizeof_DCI1A_5MHz_FDD_t; + break; + case 50: + ((DCI1A_10MHz_FDD_t*)DLSCH_dci)->type = 1; + ((DCI1A_10MHz_FDD_t*)DLSCH_dci)->rballoc = 2047; + size_bytes = sizeof(DCI1A_10MHz_FDD_t); + size_bits = sizeof_DCI1A_10MHz_FDD_t; + break; + case 75: + /* ((DCI1A_15MHz_FDD_t*)DLSCH_dci)->type = 1; + ((DCI1A_15MHz_FDD_t*)DLSCH_dci)->rballoc = 2047; + size_bytes = sizeof(DCI1A_10MHz_FDD_t); + size_bits = sizeof_DCI1A_10MHz_FDD_t;*/ + break; + case 100: + ((DCI1A_20MHz_FDD_t*)DLSCH_dci)->type = 1; + ((DCI1A_20MHz_FDD_t*)DLSCH_dci)->rballoc = 8191; + size_bytes = sizeof(DCI1A_20MHz_FDD_t); + size_bits = sizeof_DCI1A_20MHz_FDD_t; + break; + } + } + + add_ue_spec_dci(DCI_pdu[CC_id], + DLSCH_dci, + rnti, + size_bytes, + process_ue_cqi (module_idP,i),//aggregation, + size_bits, + format1A, + 0); + } + else { // ra_pdcch_sent==1 + LOG_D(MAC,"UE %d rnti %x: sent PDCCH order for RAPROC waiting (failure timer %d) \n",i,rnti,UE_list->UE_sched_ctrl[i].ul_failure_timer); + if ((UE_list->UE_sched_ctrl[i].ul_failure_timer % 40) == 0) + UE_list->UE_sched_ctrl[i].ra_pdcch_order_sent=0; // resend every 4 frames + } + + UE_list->UE_sched_ctrl[i].ul_failure_timer++; + // check threshold + if (UE_list->UE_sched_ctrl[i].ul_failure_timer > 200) { + // inform RRC of failure and clear timer + LOG_I(MAC,"UE %d rnti %x: UL Failure after repeated PDCCH orders: Triggering RRC \n",i,rnti,UE_list->UE_sched_ctrl[i].ul_failure_timer); + mac_eNB_rrc_ul_failure(module_idP,CC_id,frameP,subframeP,rnti); + UE_list->UE_sched_ctrl[i].ul_failure_timer=0; + UE_list->UE_sched_ctrl[i].ul_out_of_sync=1; + } + } + } // ul_failure_timer>0 + i = next_i; } @@ -356,7 +472,6 @@ 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); 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); @@ -427,7 +542,7 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, break; } } else { //FDD - // schedule_ulsch(module_idP,frameP,cooperation_flag,6,0); + 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); } @@ -456,7 +571,7 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, break; } } else { //FDD - //schedule_ulsch(module_idP,frameP,cooperation_flag,7,1); + 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); } @@ -485,7 +600,7 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, break; } } else { //FDD - //schedule_ulsch(module_idP,frameP,cooperation_flag,8,2); + 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); } @@ -529,7 +644,7 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, break; } } else { //FDD - // schedule_ulsch(module_idP,frameP,cooperation_flag,9,3); + 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); } @@ -544,7 +659,28 @@ 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++) allocate_CCEs(module_idP,CC_id,subframeP,0); + /* + int dummy=0; + for (i=0; + i<DCI_pdu[CC_id]->Num_common_dci+DCI_pdu[CC_id]->Num_ue_spec_dci; + i++) + if (DCI_pdu[CC_id]->dci_alloc[i].rnti==2) + dummy=1; + + if (dummy==1) + for (i=0; + i<DCI_pdu[CC_id]->Num_common_dci+DCI_pdu[CC_id]->Num_ue_spec_dci; + i++) + LOG_I(MAC,"Frame %d, subframe %d: DCI %d/%d, format %d, rnti %x, NCCE %d(num_pdcch_symb %d)\n", + frameP,subframeP,i,DCI_pdu[CC_id]->Num_common_dci+DCI_pdu[CC_id]->Num_ue_spec_dci, + DCI_pdu[CC_id]->dci_alloc[i].format, + DCI_pdu[CC_id]->dci_alloc[i].rnti, + DCI_pdu[CC_id]->dci_alloc[i].firstCCE, + DCI_pdu[CC_id]->num_pdcch_symbols); + + 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 8cb6b913016d02c4a487e1de068c8077ac12a568..3f9872a590b0f5b3f1ce566ec58f8aef601a3911 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_RA.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_RA.c @@ -251,6 +251,8 @@ void schedule_RA(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP,un } if (!CCE_allocation_infeasible(module_idP,CC_id,1,subframeP,2,RA_template->RA_rnti)) { + LOG_D(MAC,"Frame %d: Subframe %d : Adding common DCI for RA_RNTI %x\n", + frameP,subframeP,RA_template->RA_rnti); add_common_dci(DCI_pdu, (void*)&RA_template->RA_alloc_pdu1[0], RA_template->RA_rnti, @@ -737,7 +739,10 @@ void initiate_ra_proc(module_id_t module_idP, int CC_id,frame_t frameP, uint16_t uint8_t i; RA_TEMPLATE *RA_template = (RA_TEMPLATE *)&eNB_mac_inst[module_idP].common_channels[CC_id].RA_template[0]; - LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d Initiating RA procedure for preamble index %d\n",module_idP,CC_id,frameP,preamble_index); + LOG_D(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d Initiating RA procedure for preamble index %d\n",module_idP,CC_id,frameP,preamble_index); + + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_INITIATE_RA_PROC,1); + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_INITIATE_RA_PROC,0); for (i=0; i<NB_RA_PROC_MAX; i++) { if (RA_template[i].RA_active==FALSE) { @@ -765,7 +770,7 @@ void cancel_ra_proc(module_id_t module_idP, int CC_id, frame_t frameP, rnti_t rn RA_TEMPLATE *RA_template = (RA_TEMPLATE *)&eNB_mac_inst[module_idP].common_channels[CC_id].RA_template[0]; MSC_LOG_EVENT(MSC_PHY_ENB, "RA Cancelling procedure ue %"PRIx16" ", rnti); - LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d Cancelling RA procedure for UE rnti %x\n",module_idP,CC_id,frameP,rnti); + LOG_D(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d Cancelling RA procedure for UE rnti %x\n",module_idP,CC_id,frameP,rnti); for (i=0; i<NB_RA_PROC_MAX; i++) { if (rnti == RA_template[i].rnti) { diff --git a/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c b/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c index 4d8e32b63c353d1d73fc2169179c38a77dd569da..81e1df4dc52457d55724e3ab378951ec3270e916 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c @@ -65,6 +65,8 @@ # include "intertask_interface.h" #endif +#include "T.h" + #define ENABLE_MAC_PAYLOAD_DEBUG //#define DEBUG_eNB_SCHEDULER 1 @@ -833,6 +835,9 @@ schedule_ue_spec( DCCH, (char *)&dlsch_buffer[sdu_lengths[0]]); + T(T_ENB_MAC_UE_DL_SDU, T_INT(module_idP), T_INT(CC_id), T_INT(rnti), T_INT(frameP), T_INT(subframeP), + T_INT(harq_pid), T_INT(DCCH), T_INT(sdu_lengths[0])); + LOG_D(MAC,"[eNB %d][DCCH] CC_id %d Got %d bytes from RLC\n",module_idP,CC_id,sdu_lengths[0]); sdu_length_total = sdu_lengths[0]; sdu_lcids[0] = DCCH; @@ -880,6 +885,9 @@ schedule_ue_spec( DCCH+1, (char *)&dlsch_buffer[sdu_lengths[0]]); + T(T_ENB_MAC_UE_DL_SDU, T_INT(module_idP), T_INT(CC_id), T_INT(rnti), T_INT(frameP), T_INT(subframeP), + T_INT(harq_pid), T_INT(DCCH+1), T_INT(sdu_lengths[num_sdus])); + sdu_lcids[num_sdus] = DCCH1; sdu_length_total += sdu_lengths[num_sdus]; header_len_dcch += 2; @@ -924,6 +932,9 @@ schedule_ue_spec( DTCH, (char*)&dlsch_buffer[sdu_length_total]); + T(T_ENB_MAC_UE_DL_SDU, T_INT(module_idP), T_INT(CC_id), T_INT(rnti), T_INT(frameP), T_INT(subframeP), + T_INT(harq_pid), T_INT(DTCH), T_INT(sdu_lengths[num_sdus])); + LOG_D(MAC,"[eNB %d][USER-PLANE DEFAULT DRB] CC_id %d Got %d bytes for DTCH %d \n", module_idP,CC_id,sdu_lengths[num_sdus],DTCH); sdu_lcids[num_sdus] = DTCH; diff --git a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c index 79529c32848b69d4586b554dee0d2725ce48e9df..b510b6cb9b2d96d0c8117194efaee33ddf804960 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c @@ -193,7 +193,7 @@ uint8_t find_active_UEs(module_id_t module_idP,int CC_id){ // get aggregatiob form phy for a give UE unsigned char process_ue_cqi (module_id_t module_idP, int ue_idP) { - unsigned char aggregation=2; + unsigned char aggregation=1; // check the MCS and SNR and set the aggregation accordingly return aggregation; } @@ -287,44 +287,38 @@ int add_new_ue(module_id_t mod_idP, int cc_idP, rnti_t rntiP,int harq_pidP) } //------------------------------------------------------------------------------ -int mac_remove_ue(module_id_t mod_idP, int ue_idP, int frameP, sub_frame_t subframeP) +int rrc_mac_remove_ue(module_id_t mod_idP,rnti_t rntiP) //------------------------------------------------------------------------------ { int prev,i, ret=-1; - rnti_t rnti; + UE_list_t *UE_list = &eNB_mac_inst[mod_idP].UE_list; - int pCC_id = UE_PCCID(mod_idP,ue_idP); + int UE_id = find_UE_id(mod_idP,rntiP); + int pCC_id = UE_PCCID(mod_idP,UE_id); - rnti = UE_list->UE_template[pCC_id][ue_idP].rnti; - LOG_I(MAC,"Removing UE %d from Primary CC_id %d (rnti %x)\n",ue_idP,pCC_id, rnti); + LOG_I(MAC,"Removing UE %d from Primary CC_id %d (rnti %x)\n",UE_id,pCC_id, rntiP); dump_ue_list(UE_list,0); // clear all remaining pending transmissions - UE_list->UE_template[pCC_id][ue_idP].bsr_info[LCGID0] = 0; - UE_list->UE_template[pCC_id][ue_idP].bsr_info[LCGID1] = 0; - UE_list->UE_template[pCC_id][ue_idP].bsr_info[LCGID2] = 0; - UE_list->UE_template[pCC_id][ue_idP].bsr_info[LCGID3] = 0; - - UE_list->UE_template[pCC_id][ue_idP].ul_SR = 0; - UE_list->UE_template[pCC_id][ue_idP].rnti = NOT_A_RNTI; - UE_list->UE_template[pCC_id][ue_idP].ul_active = FALSE; - eNB_ulsch_info[mod_idP][pCC_id][ue_idP].rnti = NOT_A_RNTI; - eNB_ulsch_info[mod_idP][pCC_id][ue_idP].status = S_UL_NONE; - eNB_dlsch_info[mod_idP][pCC_id][ue_idP].rnti = NOT_A_RNTI; - eNB_dlsch_info[mod_idP][pCC_id][ue_idP].status = S_DL_NONE; - - rrc_eNB_free_UE( - mod_idP, - rnti, - frameP, - subframeP); + UE_list->UE_template[pCC_id][UE_id].bsr_info[LCGID0] = 0; + UE_list->UE_template[pCC_id][UE_id].bsr_info[LCGID1] = 0; + UE_list->UE_template[pCC_id][UE_id].bsr_info[LCGID2] = 0; + UE_list->UE_template[pCC_id][UE_id].bsr_info[LCGID3] = 0; + + UE_list->UE_template[pCC_id][UE_id].ul_SR = 0; + UE_list->UE_template[pCC_id][UE_id].rnti = NOT_A_RNTI; + UE_list->UE_template[pCC_id][UE_id].ul_active = FALSE; + eNB_ulsch_info[mod_idP][pCC_id][UE_id].rnti = NOT_A_RNTI; + eNB_ulsch_info[mod_idP][pCC_id][UE_id].status = S_UL_NONE; + eNB_dlsch_info[mod_idP][pCC_id][UE_id].rnti = NOT_A_RNTI; + eNB_dlsch_info[mod_idP][pCC_id][UE_id].status = S_DL_NONE; prev = UE_list->head; for (i=UE_list->head; i>=0; i=UE_list->next[i]) { - if (i == ue_idP) { + if (i == UE_id) { // link prev to next in Active list //if (prev==UE_list->head) if (i==UE_list->head) { @@ -349,7 +343,7 @@ int mac_remove_ue(module_id_t mod_idP, int ue_idP, int frameP, sub_frame_t subfr prev = UE_list->head_ul; for (i=UE_list->head_ul; i>=0; i=UE_list->next_ul[i]) { - if (i == ue_idP) { + if (i == UE_id) { // link prev to next in Active list if (prev==UE_list->head_ul) { UE_list->head_ul = UE_list->next_ul[i]; @@ -366,11 +360,13 @@ int mac_remove_ue(module_id_t mod_idP, int ue_idP, int frameP, sub_frame_t subfr prev=i; } + mac_phy_remove_ue(mod_idP,rntiP); + if (ret == 0) { return (0); } - LOG_E(MAC,"error in mac_remove_ue(), could not find previous to %d in UE_list, should never happen, Dumping UE list\n",ue_idP); + LOG_E(MAC,"error in mac_remove_ue(), could not find previous to %d in UE_list, should never happen, Dumping UE list\n",UE_id); dump_ue_list(UE_list,0); mac_xface->macphy_exit("mac_remove_ue: Problem in UE_list"); return(-1); @@ -530,22 +526,9 @@ void swap_UEs(UE_list_t *listP,int nodeiP, int nodejP, int ul_flag) dump_ue_list(listP,ul_flag); } -void SR_indication(module_id_t mod_idP, int cc_idP, frame_t frameP, rnti_t rntiP, sub_frame_t subframeP) -{ - int UE_id = find_UE_id(mod_idP, rntiP); - UE_list_t *UE_list = &eNB_mac_inst[mod_idP].UE_list; - if (UE_id != -1) { - LOG_D(MAC,"[eNB %d][SR %x] Frame %d subframeP %d Signaling SR for UE %d on CC_id %d\n",mod_idP,rntiP,frameP,subframeP, UE_id,cc_idP); - UE_list->UE_template[cc_idP][UE_id].ul_SR = 1; - UE_list->UE_template[cc_idP][UE_id].ul_active = TRUE; - } else { - // AssertFatal(0, "find_UE_id(%u,rnti %d) not found", enb_mod_idP, rntiP); - // AssertError(0, 0, "Frame %d: find_UE_id(%u,rnti %d) not found\n", frameP, enb_mod_idP, rntiP); - LOG_D(MAC,"[eNB %d][SR %x] Frame %d subframeP %d Signaling SR for UE %d (unknown UEid) on CC_id %d\n",mod_idP,rntiP,frameP,subframeP, UE_id,cc_idP); - } -} + @@ -707,16 +690,31 @@ void add_ue_spec_dci(DCI_PDU *DCI_pdu,void *pdu,rnti_t rnti,unsigned char dci_si uint8_t UE_is_to_be_scheduled(module_id_t module_idP,int CC_id,uint8_t UE_id) { - UE_TEMPLATE *UE_template = &eNB_mac_inst[module_idP].UE_list.UE_template[CC_id][UE_id]; + UE_TEMPLATE *UE_template = &eNB_mac_inst[module_idP].UE_list.UE_template[CC_id][UE_id]; + UE_sched_ctrl *UE_sched_ctl = &eNB_mac_inst[module_idP].UE_list.UE_sched_ctrl[UE_id]; + + + // do not schedule UE if UL is not working + if (UE_sched_ctl->ul_failure_timer>0) + return(0); + if (UE_sched_ctl->ul_out_of_sync>0) + return(0); - // LOG_D(MAC,"[eNB %d][PUSCH] Frame %d subframeP %d Scheduling UE %d\n",module_idP,rnti,frameP,subframeP, - // UE_id); + LOG_D(MAC,"[eNB %d][PUSCH] Checking UL requirements UE %d/%x\n",module_idP,UE_id,UE_RNTI(module_idP,UE_id)); if ((UE_template->bsr_info[LCGID0]>0) || (UE_template->bsr_info[LCGID1]>0) || (UE_template->bsr_info[LCGID2]>0) || (UE_template->bsr_info[LCGID3]>0) || - (UE_template->ul_SR>0)) { // uplink scheduling request + (UE_template->ul_SR>0) || // uplink scheduling request + ((UE_sched_ctl->ul_inactivity_timer>20)&& + (UE_sched_ctl->ul_scheduled==0))|| // every 2 frames when RRC_CONNECTED + ((UE_sched_ctl->ul_inactivity_timer>10)&& + (UE_sched_ctl->ul_scheduled==0)&& + (mac_eNB_get_rrc_status(module_idP,UE_RNTI(module_idP,UE_id)) < RRC_CONNECTED))) // every Frame when not RRC_CONNECTED + { + + LOG_D(MAC,"[eNB %d][PUSCH] UE %d/%x should be scheduled\n",module_idP,UE_id,UE_RNTI(module_idP,UE_id)); return(1); } else { return(0); @@ -995,82 +993,74 @@ int allocate_CCEs(int module_idP, 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 nCCE_max = mac_xface->get_nCCE_max(module_idP,CC_idP,1,subframeP); int fCCE; int i,j; - int allocation_is_feasible = 1; DCI_ALLOC_t *dci_alloc; - + int nCCE=0; 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); + DCI_pdu->num_pdcch_symbols=1; +try_again: 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; + nCCE=0; + + 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, + nCCE,nCCE_max,DCI_pdu->num_pdcch_symbols); + + if (nCCE + (1<<dci_alloc->L) > nCCE_max) { + if (DCI_pdu->num_pdcch_symbols == 3) + goto failed; + DCI_pdu->num_pdcch_symbols++; + nCCE_max = mac_xface->get_nCCE_max(module_idP,CC_idP,DCI_pdu->num_pdcch_symbols,subframeP); + goto try_again; + } + + // number of CCEs left can potentially hold this allocation + fCCE = get_nCCE_offset(CCE_table, + 1<<(dci_alloc->L), + nCCE_max, + (i<DCI_pdu->Num_common_dci) ? 1 : 0, + dci_alloc->rnti, + subframeP); + if (fCCE == -1) { + if (DCI_pdu->num_pdcch_symbols == 3) { + 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, + nCCE,nCCE_max,DCI_pdu->num_pdcch_symbols); + } + goto failed; } - 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 + DCI_pdu->num_pdcch_symbols++; + nCCE_max = mac_xface->get_nCCE_max(module_idP,CC_idP,DCI_pdu->num_pdcch_symbols,subframeP); + goto try_again; + } // fCCE==-1 + + // the allocation is feasible, rnti rule passes + nCCE += (1<<dci_alloc->L); + LOG_D(MAC,"Allocating at nCCE %d\n",fCCE); + if (test_onlyP == 0) { + dci_alloc->firstCCE=fCCE; + LOG_D(MAC,"Allocate CCEs subframe %d, test %d\n",subframeP,test_onlyP); + } + } // for i = 0 ... num_dcis - return(-1); - + return 0; +failed: + return -1; } boolean_t CCE_allocation_infeasible(int module_idP, @@ -1107,3 +1097,41 @@ boolean_t CCE_allocation_infeasible(int module_idP, return(res); } +void SR_indication(module_id_t mod_idP, int cc_idP, frame_t frameP, rnti_t rntiP, sub_frame_t subframeP) +{ + + int UE_id = find_UE_id(mod_idP, rntiP); + UE_list_t *UE_list = &eNB_mac_inst[mod_idP].UE_list; + + if (UE_id != -1) { + if (mac_eNB_get_rrc_status(mod_idP,UE_RNTI(mod_idP,UE_id)) < RRC_CONNECTED) + LOG_I(MAC,"[eNB %d][SR %x] Frame %d subframeP %d Signaling SR for UE %d on CC_id %d\n",mod_idP,rntiP,frameP,subframeP, UE_id,cc_idP); + UE_list->UE_template[cc_idP][UE_id].ul_SR = 1; + UE_list->UE_template[cc_idP][UE_id].ul_active = TRUE; + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_SR_INDICATION,1); + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_SR_INDICATION,0); + } else { + // AssertFatal(0, "find_UE_id(%u,rnti %d) not found", enb_mod_idP, rntiP); + // AssertError(0, 0, "Frame %d: find_UE_id(%u,rnti %d) not found\n", frameP, enb_mod_idP, rntiP); + LOG_D(MAC,"[eNB %d][SR %x] Frame %d subframeP %d Signaling SR for UE %d (unknown UEid) on CC_id %d\n",mod_idP,rntiP,frameP,subframeP, UE_id,cc_idP); + } +} + +void UL_failure_indication(module_id_t mod_idP, int cc_idP, frame_t frameP, rnti_t rntiP, sub_frame_t subframeP) +{ + + int UE_id = find_UE_id(mod_idP, rntiP); + UE_list_t *UE_list = &eNB_mac_inst[mod_idP].UE_list; + + if (UE_id != -1) { + LOG_I(MAC,"[eNB %d][UE %d/%x] Frame %d subframeP %d Signaling UL Failure for UE %d on CC_id %d (timer %d)\n", + mod_idP,UE_id,rntiP,frameP,subframeP, UE_id,cc_idP, + UE_list->UE_sched_ctrl[UE_id].ul_failure_timer); + if (UE_list->UE_sched_ctrl[UE_id].ul_failure_timer == 0) + UE_list->UE_sched_ctrl[UE_id].ul_failure_timer=1; + } else { + // AssertFatal(0, "find_UE_id(%u,rnti %d) not found", enb_mod_idP, rntiP); + // AssertError(0, 0, "Frame %d: find_UE_id(%u,rnti %d) not found\n", frameP, enb_mod_idP, rntiP); + LOG_W(MAC,"[eNB %d][SR %x] Frame %d subframeP %d Signaling UL Failure for UE %d (unknown UEid) on CC_id %d\n",mod_idP,rntiP,frameP,subframeP, UE_id,cc_idP); + } +} diff --git a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c index e6033d50579334141b3483605eb5c2578c9468e1..92327572a6df87cee6870837283664910a3332f4 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c @@ -63,6 +63,8 @@ # include "intertask_interface.h" #endif +#include "T.h" + #define ENABLE_MAC_PAYLOAD_DEBUG #define DEBUG_eNB_SCHEDULER 1 @@ -89,6 +91,7 @@ void rx_sdu( eNB_MAC_INST *eNB = &eNB_mac_inst[enb_mod_idP]; UE_list_t *UE_list= &eNB->UE_list; int crnti_rx=0; + int old_buffer_info; start_meas(&eNB->rx_ulsch_sdu); @@ -105,15 +108,38 @@ void rx_sdu( } LOG_D(MAC,"[eNB %d] CC_id %d Received ULSCH sdu from PHY (rnti %x, UE_id %d), parsing header\n",enb_mod_idP,CC_idP,rntiP,UE_id); - + + if (sduP==NULL) { // we've got an error after N rounds + UE_list->UE_sched_ctrl[UE_id].ul_scheduled &= (~(1<<harq_pidP)); + return; + } + + if (UE_id!=-1) { + UE_list->UE_sched_ctrl[UE_id].ul_inactivity_timer=0; + UE_list->UE_sched_ctrl[UE_id].ul_failure_timer =0; + UE_list->UE_sched_ctrl[UE_id].ul_scheduled &= (~(1<<harq_pidP)); + + if (UE_list->UE_sched_ctrl[UE_id].ul_out_of_sync > 0) { + UE_list->UE_sched_ctrl[UE_id].ul_out_of_sync=0; + mac_eNB_rrc_ul_in_sync(enb_mod_idP,CC_idP,frameP,subframeP,UE_RNTI(enb_mod_idP,UE_id)); + } + } + + payload_ptr = parse_ulsch_header(sduP,&num_ce,&num_sdu,rx_ces,rx_lcids,rx_lengths,sdu_lenP); - + + T(T_ENB_MAC_UE_UL_PDU, T_INT(enb_mod_idP), T_INT(CC_idP), T_INT(rntiP), T_INT(frameP), T_INT(subframeP), + T_INT(harq_pidP), T_INT(sdu_lenP), T_INT(num_ce), T_INT(num_sdu)); + eNB->eNB_stats[CC_idP].ulsch_bytes_rx=sdu_lenP; eNB->eNB_stats[CC_idP].total_ulsch_bytes_rx+=sdu_lenP; eNB->eNB_stats[CC_idP].total_ulsch_pdus_rx+=1; // control element for (i=0; i<num_ce; i++) { + T(T_ENB_MAC_UE_UL_CE, T_INT(enb_mod_idP), T_INT(CC_idP), T_INT(rntiP), T_INT(frameP), T_INT(subframeP), + T_INT(rx_ces[i])); + switch (rx_ces[i]) { // implement and process BSR + CRNTI + case POWER_HEADROOM: if (UE_id != -1) { @@ -122,13 +148,23 @@ void rx_sdu( enb_mod_idP, CC_idP, rx_ces[i], UE_list->UE_template[CC_idP][UE_id].phr_info); UE_list->UE_template[CC_idP][UE_id].phr_info_configured=1; } + UE_list->UE_sched_ctrl[UE_id].phr_received = 1; payload_ptr+=sizeof(POWER_HEADROOM_CMD); break; case CRNTI: 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 (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); + LOG_I(MAC, "[eNB %d] Frame %d, Subframe %d CC_id %d MAC CE_LCID %d (ce %d/%d): CRNTI %x (UE_id %d) in Msg3\n", + frameP,subframeP,enb_mod_idP, CC_idP, rx_ces[i], i,num_ce,(((uint16_t)payload_ptr[0])<<8) + payload_ptr[1],UE_id); + if (UE_id!=-1) { + UE_list->UE_sched_ctrl[UE_id].ul_inactivity_timer=0; + UE_list->UE_sched_ctrl[UE_id].ul_failure_timer=0; + if (UE_list->UE_sched_ctrl[UE_id].ul_out_of_sync > 0) { + UE_list->UE_sched_ctrl[UE_id].ul_out_of_sync=0; + mac_eNB_rrc_ul_in_sync(enb_mod_idP,CC_idP,frameP,subframeP,(((uint16_t)payload_ptr[0])<<8) + payload_ptr[1]); + } + } crnti_rx=1; payload_ptr+=2; @@ -152,9 +188,22 @@ void rx_sdu( UE_list->UE_template[CC_idP][UE_id].bsr_info[lcgid] = (payload_ptr[0] & 0x3f); + // update buffer info + + UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[lcgid]=BSR_TABLE[UE_list->UE_template[CC_idP][UE_id].bsr_info[lcgid]]; + + UE_list->UE_template[CC_idP][UE_id].ul_total_buffer= UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[lcgid]; + + PHY_vars_eNB_g[enb_mod_idP][CC_idP]->pusch_stats_bsr[UE_id][(frameP*10)+subframeP] = (payload_ptr[0] & 0x3f); + if (UE_id == UE_list->head) + VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_UE0_BSR,PHY_vars_eNB_g[enb_mod_idP][CC_idP]->pusch_stats_bsr[UE_id][(frameP*10)+subframeP]); if (UE_list->UE_template[CC_idP][UE_id].ul_buffer_creation_time[lcgid] == 0 ) { UE_list->UE_template[CC_idP][UE_id].ul_buffer_creation_time[lcgid]=frameP; } + if (mac_eNB_get_rrc_status(enb_mod_idP,UE_RNTI(enb_mod_idP,UE_id)) < RRC_CONNECTED) + LOG_I(MAC, "[eNB %d] CC_id %d MAC CE_LCID %d : ul_total_buffer = %d (lcg increment %d)\n", + enb_mod_idP, CC_idP, rx_ces[i], UE_list->UE_template[CC_idP][UE_id].ul_total_buffer, + UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[lcgid]); } else { @@ -171,6 +220,41 @@ void rx_sdu( UE_list->UE_template[CC_idP][UE_id].bsr_info[LCGID2] = ((payload_ptr[1] & 0x0F) << 2) | ((payload_ptr[2] & 0xC0) >> 6); UE_list->UE_template[CC_idP][UE_id].bsr_info[LCGID3] = (payload_ptr[2] & 0x3F); + + // update buffer info + old_buffer_info = UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[LCGID0]; + UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[LCGID0]=BSR_TABLE[UE_list->UE_template[CC_idP][UE_id].bsr_info[LCGID0]]; + + UE_list->UE_template[CC_idP][UE_id].ul_total_buffer+= UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[LCGID0]; + if (UE_list->UE_template[CC_idP][UE_id].ul_total_buffer >= old_buffer_info) + UE_list->UE_template[CC_idP][UE_id].ul_total_buffer -= old_buffer_info; + else + UE_list->UE_template[CC_idP][UE_id].ul_total_buffer = 0; + + old_buffer_info = UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[LCGID1]; + UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[LCGID1]=BSR_TABLE[UE_list->UE_template[CC_idP][UE_id].bsr_info[LCGID1]]; + UE_list->UE_template[CC_idP][UE_id].ul_total_buffer+= UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[LCGID1]; + if (UE_list->UE_template[CC_idP][UE_id].ul_total_buffer >= old_buffer_info) + UE_list->UE_template[CC_idP][UE_id].ul_total_buffer -= old_buffer_info; + else + UE_list->UE_template[CC_idP][UE_id].ul_total_buffer = 0; + + old_buffer_info = UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[LCGID2]; + UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[LCGID2]=BSR_TABLE[UE_list->UE_template[CC_idP][UE_id].bsr_info[LCGID2]]; + UE_list->UE_template[CC_idP][UE_id].ul_total_buffer+= UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[LCGID2]; + if (UE_list->UE_template[CC_idP][UE_id].ul_total_buffer >= old_buffer_info) + UE_list->UE_template[CC_idP][UE_id].ul_total_buffer -= old_buffer_info; + else + UE_list->UE_template[CC_idP][UE_id].ul_total_buffer = 0; + + old_buffer_info = UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[LCGID3]; + UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[LCGID3]=BSR_TABLE[UE_list->UE_template[CC_idP][UE_id].bsr_info[LCGID3]]; + UE_list->UE_template[CC_idP][UE_id].ul_total_buffer+= UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[LCGID3]; + if (UE_list->UE_template[CC_idP][UE_id].ul_total_buffer >= old_buffer_info) + UE_list->UE_template[CC_idP][UE_id].ul_total_buffer -= old_buffer_info; + else + UE_list->UE_template[CC_idP][UE_id].ul_total_buffer = 0; + LOG_D(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, @@ -227,6 +311,9 @@ void rx_sdu( for (i=0; i<num_sdu; i++) { LOG_D(MAC,"SDU Number %d MAC Subheader SDU_LCID %d, length %d\n",i,rx_lcids[i],rx_lengths[i]); + T(T_ENB_MAC_UE_UL_SDU, T_INT(enb_mod_idP), T_INT(CC_idP), T_INT(rntiP), T_INT(frameP), T_INT(subframeP), + T_INT(rx_lcids[i]), T_INT(rx_lengths[i])); + switch (rx_lcids[i]) { case CCCH : if (rx_lengths[i] > CCCH_PAYLOAD_SIZE_MAX) { @@ -238,7 +325,8 @@ void rx_sdu( LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, Received CCCH: %x.%x.%x.%x.%x.%x, Terminating RA procedure for UE rnti %x\n", enb_mod_idP,CC_idP,frameP, payload_ptr[0],payload_ptr[1],payload_ptr[2],payload_ptr[3],payload_ptr[4], payload_ptr[5], rntiP); - + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_TERMINATE_RA_PROC,1); + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_TERMINATE_RA_PROC,0); for (ii=0; ii<NB_RA_PROC_MAX; ii++) { LOG_D(MAC,"[eNB %d][RAPROC] CC_id %d Checking proc %d : rnti (%x, %x), active %d\n", enb_mod_idP, CC_idP, ii, @@ -296,10 +384,11 @@ void rx_sdu( case DCCH : case DCCH1 : // if(eNB_mac_inst[module_idP][CC_idP].Dcch_lchan[UE_id].Active==1){ + #if defined(ENABLE_MAC_PAYLOAD_DEBUG) LOG_T(MAC,"offset: %d\n",(unsigned char)((unsigned char*)payload_ptr-sduP)); - + for (j=0; j<32; j++) { LOG_T(MAC,"%x ",payload_ptr[j]); } @@ -308,23 +397,29 @@ void rx_sdu( #endif if (UE_id != -1) { - LOG_D(MAC,"[eNB %d] CC_id %d Frame %d : ULSCH -> UL-DCCH, received %d bytes form UE %d on LCID %d \n", - 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); - 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]; + // adjust buffer occupancy of the correponding logical channel group + if (UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[UE_list->UE_template[CC_idP][UE_id].lcgidmap[rx_lcids[i]]] >= rx_lengths[i]) + UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[UE_list->UE_template[CC_idP][UE_id].lcgidmap[rx_lcids[i]]] -= rx_lengths[i]; + else + UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[UE_list->UE_template[CC_idP][UE_id].lcgidmap[rx_lcids[i]]] = 0; + + LOG_D(MAC,"[eNB %d] CC_id %d Frame %d : ULSCH -> UL-DCCH, received %d bytes form UE %d on LCID %d \n", + 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); + 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]; } /* UE_id != -1 */ // } @@ -347,6 +442,17 @@ void rx_sdu( enb_mod_idP,CC_idP,frameP, rx_lengths[i], UE_id,rx_lcids[i]); if (UE_id != -1) { + // adjust buffer occupancy of the correponding logical channel group + LOG_D(MAC,"[eNB %d] CC_id %d Frame %d : ULSCH -> UL-DTCH, received %d bytes from UE %d for lcid %d, removing from LCGID %d, %d\n", + enb_mod_idP,CC_idP,frameP, rx_lengths[i], UE_id,rx_lcids[i], + UE_list->UE_template[CC_idP][UE_id].lcgidmap[rx_lcids[i]], + UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[UE_list->UE_template[CC_idP][UE_id].lcgidmap[rx_lcids[i]]]); + + if (UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[UE_list->UE_template[CC_idP][UE_id].lcgidmap[rx_lcids[i]]] >= rx_lengths[i]) + UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[UE_list->UE_template[CC_idP][UE_id].lcgidmap[rx_lcids[i]]] -= rx_lengths[i]; + else + UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[UE_list->UE_template[CC_idP][UE_id].lcgidmap[rx_lcids[i]]] = 0; + if ((rx_lengths[i] <SCH_PAYLOAD_SIZE_MAX) && (rx_lengths[i] > 0) ) { // MAX SIZE OF transport block mac_rlc_data_ind( enb_mod_idP, @@ -420,52 +526,6 @@ uint32_t bytes_to_bsr_index(int32_t nbytes) return(i-1); } -void adjust_bsr_info(int buffer_occupancy, - uint16_t TBS, - UE_TEMPLATE *UE_template) -{ - - uint32_t tmp_bsr; - - // could not serve all the uplink traffic - if (buffer_occupancy > 0 ) { - if (BSR_TABLE[UE_template->bsr_info[LCGID0]] <= TBS ) { - tmp_bsr = BSR_TABLE[UE_template->bsr_info[LCGID0]]; // serving this amout of bytes - UE_template->bsr_info[LCGID0] = 0; - - if (BSR_TABLE[UE_template->bsr_info[LCGID1]] <= (TBS-tmp_bsr)) { - tmp_bsr += BSR_TABLE[UE_template->bsr_info[LCGID1]]; - UE_template->bsr_info[LCGID1] = 0; - - if (BSR_TABLE[UE_template->bsr_info[LCGID2]] <= (TBS-tmp_bsr)) { - tmp_bsr += BSR_TABLE[UE_template->bsr_info[LCGID2]]; - UE_template->bsr_info[LCGID2] = 0; - - if (BSR_TABLE[UE_template->bsr_info[LCGID3]] <= (TBS-tmp_bsr)) { - tmp_bsr += BSR_TABLE[UE_template->bsr_info[LCGID3]]; - UE_template->bsr_info[LCGID3] = 0; - } else { - UE_template->bsr_info[LCGID3] = bytes_to_bsr_index((int32_t)BSR_TABLE[UE_template->bsr_info[LCGID3]] - ((int32_t) TBS - (int32_t)tmp_bsr)); - } - } else { - UE_template->bsr_info[LCGID2] = bytes_to_bsr_index((int32_t)BSR_TABLE[UE_template->bsr_info[LCGID2]] - ((int32_t)TBS - (int32_t)tmp_bsr)); - } - } else { - UE_template->bsr_info[LCGID1] = bytes_to_bsr_index((int32_t)BSR_TABLE[UE_template->bsr_info[LCGID1]] - ((int32_t)TBS - (int32_t)tmp_bsr)); - } - } else { - UE_template->bsr_info[LCGID0] = bytes_to_bsr_index((int32_t)BSR_TABLE[UE_template->bsr_info[LCGID0]] - (int32_t)TBS); - } - } else { // we have flushed all buffers so clear bsr - UE_template->bsr_info[LCGID0] = 0; - UE_template->bsr_info[LCGID1] = 0; - UE_template->bsr_info[LCGID2] = 0; - UE_template->bsr_info[LCGID3] = 0; - } - - -} - void add_ue_ulsch_info(module_id_t module_idP, int CC_id, int UE_id, sub_frame_t subframeP, UE_ULSCH_STATUS status) { @@ -477,66 +537,6 @@ void add_ue_ulsch_info(module_id_t module_idP, int CC_id, int UE_id, sub_frame_t } -// This seems not to be used anymore -/* -int schedule_next_ulue(module_id_t module_idP, int UE_id, sub_frame_t subframeP){ - - int next_ue; - - // first phase: scheduling for ACK - switch (subframeP) { - // scheduling for subframeP 2: for scheduled user during subframeP 5 and 6 - case 8: - if ((eNB_dlsch_info[module_idP][UE_id].status == S_DL_SCHEDULED) && - (eNB_dlsch_info[module_idP][UE_id].subframe == 5 || eNB_dlsch_info[module_idP][UE_id].subframe == 6)){ - // set the downlink status - eNB_dlsch_info[module_idP][UE_id].status = S_DL_BUFFERED; - return UE_id; - } - break; - // scheduling for subframeP 3: for scheduled user during subframeP 7 and 8 - case 9: - if ((eNB_dlsch_info[module_idP][UE_id].status == S_DL_SCHEDULED) && - (eNB_dlsch_info[module_idP][UE_id].subframe == 7 || eNB_dlsch_info[module_idP][UE_id].subframe == 8)){ - eNB_dlsch_info[module_idP][UE_id].status = S_DL_BUFFERED; - return UE_id; - } - break; - // scheduling UL subframeP 4: for scheduled user during subframeP 9 and 0 - case 0 : - if ((eNB_dlsch_info[module_idP][UE_id].status == S_DL_SCHEDULED) && - (eNB_dlsch_info[module_idP][UE_id].subframe == 9 || eNB_dlsch_info[module_idP][UE_id].subframe == 0)){ - eNB_dlsch_info[module_idP][UE_id].status = S_DL_BUFFERED; - return UE_id; - } - break; - default: - break; - } - - // second phase - for (next_ue=0; next_ue <NUMBER_OF_UE_MAX; next_ue++ ){ - - if (eNB_ulsch_info[module_idP][next_ue].status == S_UL_WAITING ) - return next_ue; - else if (eNB_ulsch_info[module_idP][next_ue].status == S_UL_SCHEDULED){ - eNB_ulsch_info[module_idP][next_ue].status = S_UL_BUFFERED; - } - } - for (next_ue=0; next_ue <NUMBER_OF_UE_MAX; next_ue++ ){ - if (eNB_ulsch_info[module_idP][next_ue].status != S_UL_NONE )// do this just for active UEs - eNB_ulsch_info[module_idP][next_ue].status = S_UL_WAITING; - } - next_ue = 0; - return next_ue; - -} - */ - - - - - unsigned char *parse_ulsch_header(unsigned char *mac_header, unsigned char *num_ce, unsigned char *num_sdu, @@ -691,8 +691,8 @@ void schedule_ulsch_rnti(module_id_t module_idP, uint8_t status = 0; uint8_t rb_table_index = -1; uint16_t TBS = 0; - int32_t buffer_occupancy=0; - uint32_t cqi_req,cshift,ndi,mcs,rballoc,tpc; + // int32_t buffer_occupancy=0; + uint32_t cqi_req,cshift,ndi,mcs=0,rballoc,tpc; int32_t normalized_rx_power, target_rx_power=-90; static int32_t tpc_accumulated=0; @@ -700,9 +700,11 @@ void schedule_ulsch_rnti(module_id_t module_idP, eNB_MAC_INST *eNB=&eNB_mac_inst[module_idP]; UE_list_t *UE_list=&eNB->UE_list; UE_TEMPLATE *UE_template; - int rvidx_tab[4] = {0,2,3,1}; - LTE_DL_FRAME_PARMS *frame_parms; + UE_sched_ctrl *UE_sched_ctrl; + // int rvidx_tab[4] = {0,2,3,1}; + LTE_DL_FRAME_PARMS *frame_parms; + int drop_ue=0; // LOG_I(MAC,"entering ulsch preprocesor\n"); @@ -719,6 +721,8 @@ void schedule_ulsch_rnti(module_id_t module_idP, // don't schedule if Msg4 is not received yet if (UE_list->UE_template[UE_PCCID(module_idP,UE_id)][UE_id].configured==FALSE) { + LOG_I(MAC,"[eNB %d] frame %d subfarme %d, UE %d: not configured, skipping UE scheduling \n", + module_idP,frameP,subframeP,UE_id); continue; } @@ -737,46 +741,57 @@ void schedule_ulsch_rnti(module_id_t module_idP, eNB_UE_stats = mac_xface->get_eNB_UE_stats(module_idP,CC_id,rnti); if (eNB_UE_stats==NULL) { - LOG_W(MAC,"[eNB %d] frame %d subframe %d, UE %d CC %d: no PHY context\n", module_idP,frameP,subframeP,UE_id,CC_id); + LOG_W(MAC,"[eNB %d] frame %d subframe %d, UE %d/%x CC %d: no PHY context\n", module_idP,frameP,subframeP,UE_id,rnti,CC_id); + drop_ue=1; continue; // mac_xface->macphy_exit("[MAC][eNB] Cannot find eNB_UE_stats\n"); } + if (drop_ue==1) + continue; + 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 DCI_pdu = &eNB->common_channels[CC_id].DCI_pdu; - UE_template = &UE_list->UE_template[CC_id][UE_id]; + UE_template = &UE_list->UE_template[CC_id][UE_id]; + UE_sched_ctrl = &UE_list->UE_sched_ctrl[UE_id]; if (mac_xface->get_ue_active_harq_pid(module_idP,CC_id,rnti,frameP,subframeP,&harq_pid,&round,1) == -1 ) { LOG_W(MAC,"[eNB %d] Scheduler Frame %d, subframeP %d: candidate harq_pid from PHY for UE %d CC %d RNTI %x\n", module_idP,frameP,subframeP, UE_id, CC_id, rnti); - // NN --> RK: Don't schedule UE if we cannot get harq pid - //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 (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)) + PHY_vars_eNB_g[module_idP][CC_id]->pusch_stats_BO[UE_id][(frameP*10)+subframeP] = UE_template->ul_total_buffer; + VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_UE0_BO,PHY_vars_eNB_g[module_idP][CC_id]->pusch_stats_BO[UE_id][(frameP*10)+subframeP]); + if (((UE_is_to_be_scheduled(module_idP,CC_id,UE_id)>0)) || (round>0))// || ((frameP%10)==0)) // if there is information on bsr of DCCH, DTCH or if there is UL_SR, or if there is a packet to retransmit, or we want to schedule a periodic feedback every 10 frames -#else - if (round==0) -#endif { + LOG_D(MAC,"[eNB %d][PUSCH] Frame %d subframe %d Scheduling UE %d/%x in round %d(SR %d,UL_inactivity timer %d,UL_failure timer %d)\n", + module_idP,frameP,subframeP,UE_id,rnti,round,UE_template->ul_SR, + UE_sched_ctrl->ul_inactivity_timer, + UE_sched_ctrl->ul_failure_timer); // reset the scheduling request UE_template->ul_SR = 0; - aggregation = process_ue_cqi(module_idP,UE_id); // =2 by default!! + aggregation = process_ue_cqi(module_idP,UE_id); status = mac_eNB_get_rrc_status(module_idP,rnti); - cqi_req = (status < RRC_CONNECTED)? 0:1; + if (status < RRC_CONNECTED) + cqi_req = 0; + else if (UE_sched_ctrl->cqi_req_timer>30) { + cqi_req = 1; + UE_sched_ctrl->cqi_req_timer=0; + } + else + cqi_req = 0; //power control //compute the expected ULSCH RX power (for the stats) @@ -821,7 +836,9 @@ void schedule_ulsch_rnti(module_id_t module_idP, UE_list->eNB_UE_stats[CC_id][UE_id].target_rx_power=target_rx_power; UE_list->eNB_UE_stats[CC_id][UE_id].ulsch_mcs1=UE_template->pre_assigned_mcs_ul; mcs = cmin (UE_template->pre_assigned_mcs_ul, openair_daq_vars.target_ue_ul_mcs); // adjust, based on user-defined MCS - + if ((cqi_req==1) && (mcs>19)) { + mcs=19; + } if (UE_template->pre_allocated_rb_table_index_ul >=0) { rb_table_index=UE_template->pre_allocated_rb_table_index_ul; } else { @@ -830,9 +847,10 @@ void schedule_ulsch_rnti(module_id_t module_idP, } UE_list->eNB_UE_stats[CC_id][UE_id].ulsch_mcs2=mcs; - buffer_occupancy = UE_template->ul_total_buffer; + // buffer_occupancy = UE_template->ul_total_buffer; - while ((rb_table[rb_table_index]>(frame_parms->N_RB_UL-1-first_rb[CC_id])) && + while (((rb_table[rb_table_index]>(frame_parms->N_RB_UL-1-first_rb[CC_id])) || + (rb_table[rb_table_index]>45)) && (rb_table_index>0)) { rb_table_index--; } @@ -840,25 +858,258 @@ void schedule_ulsch_rnti(module_id_t module_idP, TBS = mac_xface->get_TBS_UL(mcs,rb_table[rb_table_index]); UE_list->eNB_UE_stats[CC_id][UE_id].total_rbs_used_rx+=rb_table[rb_table_index]; UE_list->eNB_UE_stats[CC_id][UE_id].ulsch_TBS=TBS; - buffer_occupancy -= TBS; + // buffer_occupancy -= TBS; rballoc = mac_xface->computeRIV(frame_parms->N_RB_UL, first_rb[CC_id], rb_table[rb_table_index]); + // bad indices : 20 (40 PRB), 21 (45 PRB), 22 (48 PRB) // increment for next UE allocation first_rb[CC_id]+=rb_table[rb_table_index]; //store for possible retransmission UE_template->nb_rb_ul[harq_pid] = rb_table[rb_table_index]; + UE_sched_ctrl->ul_scheduled |= (1<<harq_pid); + if (UE_id == UE_list->head) + VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_UE0_SCHEDULED,UE_sched_ctrl->ul_scheduled); + + if (mac_eNB_get_rrc_status(module_idP,rnti) < RRC_CONNECTED) + LOG_I(MAC,"[eNB %d][PUSCH %d/%x] CC_id %d Frame %d subframeP %d Scheduled UE %d (mcs %d, first rb %d, nb_rb %d, rb_table_index %d, TBS %d, harq_pid %d)\n", + module_idP,harq_pid,rnti,CC_id,frameP,subframeP,UE_id,mcs, + first_rb[CC_id],rb_table[rb_table_index], + rb_table_index,TBS,harq_pid); + + // adjust total UL buffer status by TBS, wait for UL sdus to do final update + LOG_D(MAC,"[eNB %d] CC_id %d UE %d/%x : adjusting ul_total_buffer, old %d, TBS %d\n", module_idP,CC_id,UE_id,rnti,UE_template->ul_total_buffer,TBS); + if (UE_template->ul_total_buffer > TBS) + UE_template->ul_total_buffer -= TBS; + else + UE_template->ul_total_buffer = 0; + LOG_D(MAC,"ul_total_buffer, new %d\n", UE_template->ul_total_buffer); + // Cyclic shift for DM RS + cshift = 0;// values from 0 to 7 can be used for mapping the cyclic shift (36.211 , Table 5.5.2.1.1-1) + + if (frame_parms->frame_type == TDD) { + switch (frame_parms->N_RB_UL) { + case 6: + ULSCH_dci = UE_template->ULSCH_DCI[harq_pid]; + + ((DCI0_1_5MHz_TDD_1_6_t *)ULSCH_dci)->type = 0; + ((DCI0_1_5MHz_TDD_1_6_t *)ULSCH_dci)->hopping = 0; + ((DCI0_1_5MHz_TDD_1_6_t *)ULSCH_dci)->rballoc = rballoc; + ((DCI0_1_5MHz_TDD_1_6_t *)ULSCH_dci)->mcs = mcs; + ((DCI0_1_5MHz_TDD_1_6_t *)ULSCH_dci)->ndi = ndi; + ((DCI0_1_5MHz_TDD_1_6_t *)ULSCH_dci)->TPC = tpc; + ((DCI0_1_5MHz_TDD_1_6_t *)ULSCH_dci)->cshift = cshift; + ((DCI0_1_5MHz_TDD_1_6_t *)ULSCH_dci)->padding = 0; + ((DCI0_1_5MHz_TDD_1_6_t *)ULSCH_dci)->dai = UE_template->DAI_ul[sched_subframe]; + ((DCI0_1_5MHz_TDD_1_6_t *)ULSCH_dci)->cqi_req = cqi_req; + + add_ue_spec_dci(DCI_pdu, + ULSCH_dci, + rnti, + sizeof(DCI0_1_5MHz_TDD_1_6_t), + aggregation, + sizeof_DCI0_1_5MHz_TDD_1_6_t, + format0, + 0); + break; + + default: + case 25: + ULSCH_dci = UE_template->ULSCH_DCI[harq_pid]; + + ((DCI0_5MHz_TDD_1_6_t *)ULSCH_dci)->type = 0; + ((DCI0_5MHz_TDD_1_6_t *)ULSCH_dci)->hopping = 0; + ((DCI0_5MHz_TDD_1_6_t *)ULSCH_dci)->rballoc = rballoc; + ((DCI0_5MHz_TDD_1_6_t *)ULSCH_dci)->mcs = mcs; + ((DCI0_5MHz_TDD_1_6_t *)ULSCH_dci)->ndi = ndi; + ((DCI0_5MHz_TDD_1_6_t *)ULSCH_dci)->TPC = tpc; + ((DCI0_5MHz_TDD_1_6_t *)ULSCH_dci)->cshift = cshift; + ((DCI0_5MHz_TDD_1_6_t *)ULSCH_dci)->padding = 0; + ((DCI0_5MHz_TDD_1_6_t *)ULSCH_dci)->dai = UE_template->DAI_ul[sched_subframe]; + ((DCI0_5MHz_TDD_1_6_t *)ULSCH_dci)->cqi_req = cqi_req; + + add_ue_spec_dci(DCI_pdu, + ULSCH_dci, + rnti, + sizeof(DCI0_5MHz_TDD_1_6_t), + aggregation, + sizeof_DCI0_5MHz_TDD_1_6_t, + format0, + 0); + break; + + case 50: + ULSCH_dci = UE_template->ULSCH_DCI[harq_pid]; + + ((DCI0_10MHz_TDD_1_6_t *)ULSCH_dci)->type = 0; + ((DCI0_10MHz_TDD_1_6_t *)ULSCH_dci)->hopping = 0; + ((DCI0_10MHz_TDD_1_6_t *)ULSCH_dci)->rballoc = rballoc; + ((DCI0_10MHz_TDD_1_6_t *)ULSCH_dci)->mcs = mcs; + ((DCI0_10MHz_TDD_1_6_t *)ULSCH_dci)->ndi = ndi; + ((DCI0_10MHz_TDD_1_6_t *)ULSCH_dci)->TPC = tpc; + ((DCI0_10MHz_TDD_1_6_t *)ULSCH_dci)->cshift = cshift; + ((DCI0_10MHz_TDD_1_6_t *)ULSCH_dci)->padding = 0; + ((DCI0_10MHz_TDD_1_6_t *)ULSCH_dci)->dai = UE_template->DAI_ul[sched_subframe]; + ((DCI0_10MHz_TDD_1_6_t *)ULSCH_dci)->cqi_req = cqi_req; + + add_ue_spec_dci(DCI_pdu, + ULSCH_dci, + rnti, + sizeof(DCI0_10MHz_TDD_1_6_t), + aggregation, + sizeof_DCI0_10MHz_TDD_1_6_t, + format0, + 0); + break; + + case 100: + ULSCH_dci = UE_template->ULSCH_DCI[harq_pid]; + + ((DCI0_20MHz_TDD_1_6_t *)ULSCH_dci)->type = 0; + ((DCI0_20MHz_TDD_1_6_t *)ULSCH_dci)->hopping = 0; + ((DCI0_20MHz_TDD_1_6_t *)ULSCH_dci)->rballoc = rballoc; + ((DCI0_20MHz_TDD_1_6_t *)ULSCH_dci)->mcs = mcs; + ((DCI0_20MHz_TDD_1_6_t *)ULSCH_dci)->ndi = ndi; + ((DCI0_20MHz_TDD_1_6_t *)ULSCH_dci)->TPC = tpc; + ((DCI0_20MHz_TDD_1_6_t *)ULSCH_dci)->cshift = cshift; + ((DCI0_20MHz_TDD_1_6_t *)ULSCH_dci)->padding = 0; + ((DCI0_20MHz_TDD_1_6_t *)ULSCH_dci)->dai = UE_template->DAI_ul[sched_subframe]; + ((DCI0_20MHz_TDD_1_6_t *)ULSCH_dci)->cqi_req = cqi_req; + + add_ue_spec_dci(DCI_pdu, + ULSCH_dci, + rnti, + sizeof(DCI0_20MHz_TDD_1_6_t), + aggregation, + sizeof_DCI0_20MHz_TDD_1_6_t, + format0, + 0); + break; + } + } // TDD + else { //FDD + switch (frame_parms->N_RB_UL) { + case 25: + default: + + ULSCH_dci = UE_template->ULSCH_DCI[harq_pid]; + + ((DCI0_5MHz_FDD_t *)ULSCH_dci)->type = 0; + ((DCI0_5MHz_FDD_t *)ULSCH_dci)->hopping = 0; + ((DCI0_5MHz_FDD_t *)ULSCH_dci)->rballoc = rballoc; + ((DCI0_5MHz_FDD_t *)ULSCH_dci)->mcs = mcs; + ((DCI0_5MHz_FDD_t *)ULSCH_dci)->ndi = ndi; + ((DCI0_5MHz_FDD_t *)ULSCH_dci)->TPC = tpc; + ((DCI0_5MHz_FDD_t *)ULSCH_dci)->cshift = cshift; + ((DCI0_5MHz_FDD_t *)ULSCH_dci)->padding = 0; + ((DCI0_5MHz_FDD_t *)ULSCH_dci)->cqi_req = cqi_req; + + add_ue_spec_dci(DCI_pdu, + ULSCH_dci, + rnti, + sizeof(DCI0_5MHz_FDD_t), + aggregation, + sizeof_DCI0_5MHz_FDD_t, + format0, + 0); + break; + + case 6: + ULSCH_dci = UE_template->ULSCH_DCI[harq_pid]; + + ((DCI0_1_5MHz_FDD_t *)ULSCH_dci)->type = 0; + ((DCI0_1_5MHz_FDD_t *)ULSCH_dci)->hopping = 0; + ((DCI0_1_5MHz_FDD_t *)ULSCH_dci)->rballoc = rballoc; + ((DCI0_1_5MHz_FDD_t *)ULSCH_dci)->mcs = mcs; + ((DCI0_1_5MHz_FDD_t *)ULSCH_dci)->ndi = ndi; + ((DCI0_1_5MHz_FDD_t *)ULSCH_dci)->TPC = tpc; + ((DCI0_1_5MHz_FDD_t *)ULSCH_dci)->cshift = cshift; + ((DCI0_1_5MHz_FDD_t *)ULSCH_dci)->padding = 0; + ((DCI0_1_5MHz_FDD_t *)ULSCH_dci)->cqi_req = cqi_req; + + add_ue_spec_dci(DCI_pdu, + ULSCH_dci, + rnti, + sizeof(DCI0_1_5MHz_FDD_t), + aggregation, + sizeof_DCI0_1_5MHz_FDD_t, + format0, + 0); + break; + + case 50: + ULSCH_dci = UE_template->ULSCH_DCI[harq_pid]; + + ((DCI0_10MHz_FDD_t *)ULSCH_dci)->type = 0; + ((DCI0_10MHz_FDD_t *)ULSCH_dci)->hopping = 0; + ((DCI0_10MHz_FDD_t *)ULSCH_dci)->rballoc = rballoc; + ((DCI0_10MHz_FDD_t *)ULSCH_dci)->mcs = mcs; + ((DCI0_10MHz_FDD_t *)ULSCH_dci)->ndi = ndi; + ((DCI0_10MHz_FDD_t *)ULSCH_dci)->TPC = tpc; + ((DCI0_10MHz_FDD_t *)ULSCH_dci)->padding = 0; + ((DCI0_10MHz_FDD_t *)ULSCH_dci)->cshift = cshift; + ((DCI0_10MHz_FDD_t *)ULSCH_dci)->cqi_req = cqi_req; + + add_ue_spec_dci(DCI_pdu, + ULSCH_dci, + rnti, + sizeof(DCI0_10MHz_FDD_t), + aggregation, + sizeof_DCI0_10MHz_FDD_t, + format0, + 0); + break; + + case 100: + ULSCH_dci = UE_template->ULSCH_DCI[harq_pid]; + + ((DCI0_20MHz_FDD_t *)ULSCH_dci)->type = 0; + ((DCI0_20MHz_FDD_t *)ULSCH_dci)->hopping = 0; + ((DCI0_20MHz_FDD_t *)ULSCH_dci)->rballoc = rballoc; + ((DCI0_20MHz_FDD_t *)ULSCH_dci)->mcs = mcs; + ((DCI0_20MHz_FDD_t *)ULSCH_dci)->ndi = ndi; + ((DCI0_20MHz_FDD_t *)ULSCH_dci)->TPC = tpc; + ((DCI0_20MHz_FDD_t *)ULSCH_dci)->padding = 0; + ((DCI0_20MHz_FDD_t *)ULSCH_dci)->cshift = cshift; + ((DCI0_20MHz_FDD_t *)ULSCH_dci)->cqi_req = cqi_req; + + add_ue_spec_dci(DCI_pdu, + ULSCH_dci, + rnti, + sizeof(DCI0_20MHz_FDD_t), + aggregation, + sizeof_DCI0_20MHz_FDD_t, + format0, + 0); + break; + + } + } + + + add_ue_ulsch_info(module_idP, + CC_id, + UE_id, + subframeP, + S_UL_SCHEDULED); + + 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]); +#endif + + } + else { + T(T_ENB_MAC_UE_UL_SCHEDULE, T_INT(module_idP), T_INT(CC_id), T_INT(rnti), T_INT(frameP), + T_INT(subframeP), T_INT(harq_pid), T_INT(mcs), T_INT(first_rb[CC_id]), T_INT(rb_table[rb_table_index]), + T_INT(TBS)); - LOG_D(MAC,"[eNB %d][PUSCH %d/%x] CC_id %d Frame %d subframeP %d Scheduled UE %d (mcs %d, first rb %d, nb_rb %d, rb_table_index %d, TBS %d, harq_pid %d)\n", + LOG_D(MAC,"[eNB %d][PUSCH %d/%x] CC_id %d Frame %d subframeP %d Scheduled (PHICH) UE %d (mcs %d, first rb %d, nb_rb %d, rb_table_index %d, TBS %d, harq_pid %d,round %d)\n", module_idP,harq_pid,rnti,CC_id,frameP,subframeP,UE_id,mcs, first_rb[CC_id],rb_table[rb_table_index], - rb_table_index,TBS,harq_pid); - // Adjust BSR entries for LCGIDs - adjust_bsr_info(buffer_occupancy, - TBS, - UE_template); - - } else if (round > 0) { //we schedule a retransmission + rb_table_index,TBS,harq_pid,round); + }/* + else if (round > 0) { //we schedule a retransmission ndi = UE_template->oldNDI_UL[harq_pid]; @@ -869,7 +1120,11 @@ void schedule_ulsch_rnti(module_id_t module_idP, } - LOG_D(MAC,"[eNB %d][PUSCH %d/%x] CC_id %d Frame %d subframeP %d Scheduled UE retransmission (mcs %d, first rb %d, nb_rb %d, harq_pid %d, round %d)\n", + T(T_ENB_MAC_UE_UL_SCHEDULE_RETRANSMISSION, T_INT(module_idP), T_INT(CC_id), T_INT(rnti), T_INT(frameP), + T_INT(subframeP), T_INT(harq_pid), T_INT(mcs), T_INT(first_rb[CC_id]), T_INT(rb_table[rb_table_index]), + T_INT(round)); + + LOG_I(MAC,"[eNB %d][PUSCH %d/%x] CC_id %d Frame %d subframeP %d Scheduled UE retransmission (mcs %d, first rb %d, nb_rb %d, harq_pid %d, round %d)\n", module_idP,UE_id,rnti,CC_id,frameP,subframeP,mcs, first_rb[CC_id],UE_template->nb_rb_ul[harq_pid], harq_pid, round); @@ -885,227 +1140,7 @@ void schedule_ulsch_rnti(module_id_t module_idP, UE_list->eNB_UE_stats[CC_id][UE_id].ulsch_mcs1=mcs; UE_list->eNB_UE_stats[CC_id][UE_id].ulsch_mcs2=mcs; } - - // Cyclic shift for DM RS - if(cooperation_flag == 2) { - if(UE_id == 1) { // For Distriibuted Alamouti, cyclic shift applied to 2nd UE - cshift = 1; - } else { - cshift = 0; - } - } else { - cshift = 0;// values from 0 to 7 can be used for mapping the cyclic shift (36.211 , Table 5.5.2.1.1-1) - } - - if (frame_parms->frame_type == TDD) { - switch (frame_parms->N_RB_UL) { - case 6: - ULSCH_dci = UE_template->ULSCH_DCI[harq_pid]; - - ((DCI0_1_5MHz_TDD_1_6_t *)ULSCH_dci)->type = 0; - ((DCI0_1_5MHz_TDD_1_6_t *)ULSCH_dci)->hopping = 0; - ((DCI0_1_5MHz_TDD_1_6_t *)ULSCH_dci)->rballoc = rballoc; - ((DCI0_1_5MHz_TDD_1_6_t *)ULSCH_dci)->mcs = mcs; - ((DCI0_1_5MHz_TDD_1_6_t *)ULSCH_dci)->ndi = ndi; - ((DCI0_1_5MHz_TDD_1_6_t *)ULSCH_dci)->TPC = tpc; - ((DCI0_1_5MHz_TDD_1_6_t *)ULSCH_dci)->cshift = cshift; - ((DCI0_1_5MHz_TDD_1_6_t *)ULSCH_dci)->padding = 0; - ((DCI0_1_5MHz_TDD_1_6_t *)ULSCH_dci)->dai = UE_template->DAI_ul[sched_subframe]; - ((DCI0_1_5MHz_TDD_1_6_t *)ULSCH_dci)->cqi_req = cqi_req; - - add_ue_spec_dci(DCI_pdu, - ULSCH_dci, - rnti, - sizeof(DCI0_1_5MHz_TDD_1_6_t), - aggregation, - sizeof_DCI0_1_5MHz_TDD_1_6_t, - format0, - 0); - break; - - default: - case 25: - ULSCH_dci = UE_template->ULSCH_DCI[harq_pid]; - - ((DCI0_5MHz_TDD_1_6_t *)ULSCH_dci)->type = 0; - ((DCI0_5MHz_TDD_1_6_t *)ULSCH_dci)->hopping = 0; - ((DCI0_5MHz_TDD_1_6_t *)ULSCH_dci)->rballoc = rballoc; - ((DCI0_5MHz_TDD_1_6_t *)ULSCH_dci)->mcs = mcs; - ((DCI0_5MHz_TDD_1_6_t *)ULSCH_dci)->ndi = ndi; - ((DCI0_5MHz_TDD_1_6_t *)ULSCH_dci)->TPC = tpc; - ((DCI0_5MHz_TDD_1_6_t *)ULSCH_dci)->cshift = cshift; - ((DCI0_5MHz_TDD_1_6_t *)ULSCH_dci)->padding = 0; - ((DCI0_5MHz_TDD_1_6_t *)ULSCH_dci)->dai = UE_template->DAI_ul[sched_subframe]; - ((DCI0_5MHz_TDD_1_6_t *)ULSCH_dci)->cqi_req = cqi_req; - - add_ue_spec_dci(DCI_pdu, - ULSCH_dci, - rnti, - sizeof(DCI0_5MHz_TDD_1_6_t), - aggregation, - sizeof_DCI0_5MHz_TDD_1_6_t, - format0, - 0); - break; - - case 50: - ULSCH_dci = UE_template->ULSCH_DCI[harq_pid]; - - ((DCI0_10MHz_TDD_1_6_t *)ULSCH_dci)->type = 0; - ((DCI0_10MHz_TDD_1_6_t *)ULSCH_dci)->hopping = 0; - ((DCI0_10MHz_TDD_1_6_t *)ULSCH_dci)->rballoc = rballoc; - ((DCI0_10MHz_TDD_1_6_t *)ULSCH_dci)->mcs = mcs; - ((DCI0_10MHz_TDD_1_6_t *)ULSCH_dci)->ndi = ndi; - ((DCI0_10MHz_TDD_1_6_t *)ULSCH_dci)->TPC = tpc; - ((DCI0_10MHz_TDD_1_6_t *)ULSCH_dci)->cshift = cshift; - ((DCI0_10MHz_TDD_1_6_t *)ULSCH_dci)->padding = 0; - ((DCI0_10MHz_TDD_1_6_t *)ULSCH_dci)->dai = UE_template->DAI_ul[sched_subframe]; - ((DCI0_10MHz_TDD_1_6_t *)ULSCH_dci)->cqi_req = cqi_req; - - add_ue_spec_dci(DCI_pdu, - ULSCH_dci, - rnti, - sizeof(DCI0_10MHz_TDD_1_6_t), - aggregation, - sizeof_DCI0_10MHz_TDD_1_6_t, - format0, - 0); - break; - - case 100: - ULSCH_dci = UE_template->ULSCH_DCI[harq_pid]; - - ((DCI0_20MHz_TDD_1_6_t *)ULSCH_dci)->type = 0; - ((DCI0_20MHz_TDD_1_6_t *)ULSCH_dci)->hopping = 0; - ((DCI0_20MHz_TDD_1_6_t *)ULSCH_dci)->rballoc = rballoc; - ((DCI0_20MHz_TDD_1_6_t *)ULSCH_dci)->mcs = mcs; - ((DCI0_20MHz_TDD_1_6_t *)ULSCH_dci)->ndi = ndi; - ((DCI0_20MHz_TDD_1_6_t *)ULSCH_dci)->TPC = tpc; - ((DCI0_20MHz_TDD_1_6_t *)ULSCH_dci)->cshift = cshift; - ((DCI0_10MHz_TDD_1_6_t *)ULSCH_dci)->padding = 0; - ((DCI0_20MHz_TDD_1_6_t *)ULSCH_dci)->dai = UE_template->DAI_ul[sched_subframe]; - ((DCI0_20MHz_TDD_1_6_t *)ULSCH_dci)->cqi_req = cqi_req; - - add_ue_spec_dci(DCI_pdu, - ULSCH_dci, - rnti, - sizeof(DCI0_20MHz_TDD_1_6_t), - aggregation, - sizeof_DCI0_20MHz_TDD_1_6_t, - format0, - 0); - break; - } - } // TDD - else { //FDD - switch (frame_parms->N_RB_UL) { - case 25: - default: - - ULSCH_dci = UE_template->ULSCH_DCI[harq_pid]; - - ((DCI0_5MHz_FDD_t *)ULSCH_dci)->type = 0; - ((DCI0_5MHz_FDD_t *)ULSCH_dci)->hopping = 0; - ((DCI0_5MHz_FDD_t *)ULSCH_dci)->rballoc = rballoc; - ((DCI0_5MHz_FDD_t *)ULSCH_dci)->mcs = mcs; - ((DCI0_5MHz_FDD_t *)ULSCH_dci)->ndi = ndi; - ((DCI0_5MHz_FDD_t *)ULSCH_dci)->TPC = tpc; - ((DCI0_5MHz_FDD_t *)ULSCH_dci)->cshift = cshift; - ((DCI0_5MHz_FDD_t *)ULSCH_dci)->padding = 0; - ((DCI0_5MHz_FDD_t *)ULSCH_dci)->cqi_req = cqi_req; - - add_ue_spec_dci(DCI_pdu, - ULSCH_dci, - rnti, - sizeof(DCI0_5MHz_FDD_t), - aggregation, - sizeof_DCI0_5MHz_FDD_t, - format0, - 0); - break; - - case 6: - ULSCH_dci = UE_template->ULSCH_DCI[harq_pid]; - - ((DCI0_1_5MHz_FDD_t *)ULSCH_dci)->type = 0; - ((DCI0_1_5MHz_FDD_t *)ULSCH_dci)->hopping = 0; - ((DCI0_1_5MHz_FDD_t *)ULSCH_dci)->rballoc = rballoc; - ((DCI0_1_5MHz_FDD_t *)ULSCH_dci)->mcs = mcs; - ((DCI0_1_5MHz_FDD_t *)ULSCH_dci)->ndi = ndi; - ((DCI0_1_5MHz_FDD_t *)ULSCH_dci)->TPC = tpc; - ((DCI0_1_5MHz_FDD_t *)ULSCH_dci)->cshift = cshift; - ((DCI0_1_5MHz_FDD_t *)ULSCH_dci)->padding = 0; - ((DCI0_1_5MHz_FDD_t *)ULSCH_dci)->cqi_req = cqi_req; - - add_ue_spec_dci(DCI_pdu, - ULSCH_dci, - rnti, - sizeof(DCI0_1_5MHz_FDD_t), - aggregation, - sizeof_DCI0_1_5MHz_FDD_t, - format0, - 0); - break; - - case 50: - ULSCH_dci = UE_template->ULSCH_DCI[harq_pid]; - - ((DCI0_10MHz_FDD_t *)ULSCH_dci)->type = 0; - ((DCI0_10MHz_FDD_t *)ULSCH_dci)->hopping = 0; - ((DCI0_10MHz_FDD_t *)ULSCH_dci)->rballoc = rballoc; - ((DCI0_10MHz_FDD_t *)ULSCH_dci)->mcs = mcs; - ((DCI0_10MHz_FDD_t *)ULSCH_dci)->ndi = ndi; - ((DCI0_10MHz_FDD_t *)ULSCH_dci)->TPC = tpc; - ((DCI0_10MHz_FDD_t *)ULSCH_dci)->padding = 0; - ((DCI0_10MHz_FDD_t *)ULSCH_dci)->cshift = cshift; - ((DCI0_10MHz_FDD_t *)ULSCH_dci)->cqi_req = cqi_req; - - add_ue_spec_dci(DCI_pdu, - ULSCH_dci, - rnti, - sizeof(DCI0_10MHz_FDD_t), - aggregation, - sizeof_DCI0_10MHz_FDD_t, - format0, - 0); - break; - - case 100: - ULSCH_dci = UE_template->ULSCH_DCI[harq_pid]; - - ((DCI0_20MHz_FDD_t *)ULSCH_dci)->type = 0; - ((DCI0_20MHz_FDD_t *)ULSCH_dci)->hopping = 0; - ((DCI0_20MHz_FDD_t *)ULSCH_dci)->rballoc = rballoc; - ((DCI0_20MHz_FDD_t *)ULSCH_dci)->mcs = mcs; - ((DCI0_20MHz_FDD_t *)ULSCH_dci)->ndi = ndi; - ((DCI0_20MHz_FDD_t *)ULSCH_dci)->TPC = tpc; - ((DCI0_20MHz_FDD_t *)ULSCH_dci)->padding = 0; - ((DCI0_20MHz_FDD_t *)ULSCH_dci)->cshift = cshift; - ((DCI0_20MHz_FDD_t *)ULSCH_dci)->cqi_req = cqi_req; - - add_ue_spec_dci(DCI_pdu, - ULSCH_dci, - rnti, - sizeof(DCI0_20MHz_FDD_t), - aggregation, - sizeof_DCI0_20MHz_FDD_t, - format0, - 0); - break; - - } - } - - add_ue_ulsch_info(module_idP, - CC_id, - UE_id, - subframeP, - S_UL_SCHEDULED); - - 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]); -#endif + */ } // UE_is_to_be_scheduled } // UE is in PUSCH @@ -1188,7 +1223,7 @@ void schedule_ulsch_cba_rnti(module_id_t module_idP, unsigned char cooperation_f // simple UE identity based grouping if ((UE_id % total_groups) == cba_group) { // this could be simplifed to active_UEs[UE_id % total_groups]++; - if ((mac_get_rrc_status(module_idP,1,UE_id) > RRC_CONNECTED) && + if ((mac_eNB_get_rrc_status(module_idP,rnti) > RRC_CONNECTED) && (UE_is_to_be_scheduled(module_idP,CC_id,UE_id) == 0)) { active_UEs[cba_group]++; } diff --git a/openair2/LAYER2/MAC/main.c b/openair2/LAYER2/MAC/main.c index 0e8a65cf017cf1af7fa6e4158ecd4a47f53e9a27..d5a445744d780ae0aa1e1bf7d7fed4a5a7e53a25 100644 --- a/openair2/LAYER2/MAC/main.c +++ b/openair2/LAYER2/MAC/main.c @@ -84,7 +84,7 @@ void dl_phy_sync_success(module_id_t module_idP, } else #endif { - mac_in_sync_ind(module_idP,frameP,eNB_index); + rrc_in_sync_ind(module_idP,frameP,eNB_index); } } @@ -382,7 +382,7 @@ int mac_init_global_param(void) // mac_xface->macphy_data_ind=macphy_data_ind; mac_xface->mrbch_phy_sync_failure=mrbch_phy_sync_failure; mac_xface->dl_phy_sync_success=dl_phy_sync_success; - mac_xface->out_of_sync_ind=mac_out_of_sync_ind; + mac_xface->out_of_sync_ind=rrc_out_of_sync_ind; // Mac_rlc_xface->macphy_exit= mac_xface->macphy_exit; // Mac_rlc_xface->frame = 0; @@ -462,6 +462,7 @@ int l2_init(LTE_DL_FRAME_PARMS *frame_parms,int eMBMS_active, char *uecap_xer,ui mac_xface->initiate_ra_proc = initiate_ra_proc; mac_xface->cancel_ra_proc = cancel_ra_proc; mac_xface->SR_indication = SR_indication; + mac_xface->UL_failure_indication = UL_failure_indication; mac_xface->rx_sdu = rx_sdu; mac_xface->get_dlsch_sdu = get_dlsch_sdu; mac_xface->get_eNB_UE_stats = get_eNB_UE_stats; @@ -475,6 +476,7 @@ int l2_init(LTE_DL_FRAME_PARMS *frame_parms,int eMBMS_active, char *uecap_xer,ui mac_xface->Msg1_transmitted = Msg1_tx; mac_xface->ra_failed = ra_failed; mac_xface->ra_succeeded = ra_succeeded; + mac_xface->mac_phy_remove_ue = mac_phy_remove_ue; LOG_I(MAC,"[MAIN] init UE MAC functions \n"); mac_xface->ue_decode_si = ue_decode_si; diff --git a/openair2/LAYER2/MAC/pre_processor.c b/openair2/LAYER2/MAC/pre_processor.c index c744d1d90af6d5ad8b85e5bb3e679d6ec5c80724..fe8fe55d441f2cb045fb3d04f2100eb89c971853 100644 --- a/openair2/LAYER2/MAC/pre_processor.c +++ b/openair2/LAYER2/MAC/pre_processor.c @@ -47,6 +47,7 @@ #include "LAYER2/MAC/proto.h" #include "LAYER2/MAC/extern.h" #include "UTIL/LOG/log.h" +#include "UTIL/LOG/vcd_signal_dumper.h" #include "UTIL/OPT/opt.h" #include "OCG.h" #include "OCG_extern.h" @@ -319,6 +320,8 @@ void sort_UEs (module_id_t Mod_idP, rnti1 = UE_RNTI(Mod_idP,UE_id1); if(rnti1 == NOT_A_RNTI) continue; + if (UE_list->UE_sched_ctrl[UE_id1].ul_out_of_sync == 1) + continue; pCC_id1 = UE_PCCID(Mod_idP,UE_id1); cqi1 = maxcqi(Mod_idP,UE_id1); // round1 = maxround(Mod_idP,rnti1,frameP,subframeP,0); @@ -327,6 +330,8 @@ void sort_UEs (module_id_t Mod_idP, rnti2 = UE_RNTI(Mod_idP,UE_id2); if(rnti2 == NOT_A_RNTI) continue; + if (UE_list->UE_sched_ctrl[UE_id2].ul_out_of_sync == 1) + continue; cqi2 = maxcqi(Mod_idP,UE_id2); round2 = maxround(Mod_idP,rnti2,frameP,subframeP,0); //mac_xface->get_ue_active_harq_pid(Mod_id,rnti2,subframe,&harq_pid2,&round2,0); pCC_id2 = UE_PCCID(Mod_idP,UE_id2); @@ -453,7 +458,8 @@ void dlsch_scheduler_pre_processor (module_id_t Mod_id, if(rnti == NOT_A_RNTI) continue; - + if (UE_list->UE_sched_ctrl[i].ul_out_of_sync == 1) + continue; UE_id = i; // if there is no available harq_process, skip the UE @@ -563,6 +569,8 @@ void dlsch_scheduler_pre_processor (module_id_t Mod_id, // LOG_D(MAC,"UE %d rnti 0x\n", UE_id, rnti ); if(rnti == NOT_A_RNTI) continue; + if (UE_list->UE_sched_ctrl[UE_id].ul_out_of_sync == 1) + continue; transmission_mode = mac_xface->get_transmission_mode(Mod_id,CC_id,rnti); // mac_xface->get_ue_active_harq_pid(Mod_id,CC_id,rnti,frameP,subframeP,&harq_pid,&round,0); @@ -607,6 +615,8 @@ void dlsch_scheduler_pre_processor (module_id_t Mod_id, round2 = ue_sched_ctl2->round[CC_id]; if(rnti2 == NOT_A_RNTI) continue; + if (UE_list->UE_sched_ctrl[UE_id2].ul_out_of_sync == 1) + continue; eNB_UE_stats2 = mac_xface->get_eNB_UE_stats(Mod_id,CC_id,rnti2); //mac_xface->get_ue_active_harq_pid(Mod_id,CC_id,rnti2,frameP,subframeP,&harq_pid2,&round2,0); @@ -798,6 +808,9 @@ void dlsch_scheduler_pre_processor_reset (int module_idP, ue_sched_ctl->ta_timer--; ue_sched_ctl->ta_update =0; // don't trigger a timing advance command } + if (UE_id==0) { + VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_UE0_TIMING_ADVANCE,ue_sched_ctl->ta_update); + } 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; @@ -928,9 +941,6 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP, UE_TEMPLATE *UE_template = 0; LTE_DL_FRAME_PARMS *frame_parms = 0; - // LOG_I(MAC,"store ulsch buffers\n"); - // convert BSR to bytes for comparison with tbs - store_ulsch_buffer(module_idP,frameP, subframeP); //LOG_I(MAC,"assign max mcs min rb\n"); // maximize MCS and then allocate required RB according to the buffer occupancy with the limit of max available UL RB @@ -965,6 +975,9 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP, if (rnti==NOT_A_RNTI) continue; + if (UE_list->UE_sched_ctrl[i].ul_out_of_sync == 1) + continue; + UE_id = i; for (n=0; n<UE_list->numactiveULCCs[UE_id]; n++) { @@ -1013,6 +1026,8 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP, if (rnti==NOT_A_RNTI) continue; + if (UE_list->UE_sched_ctrl[i].ul_out_of_sync == 1) + continue; UE_id = i; @@ -1041,6 +1056,8 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP, if (rnti==NOT_A_RNTI) continue; + if (UE_list->UE_sched_ctrl[i].ul_out_of_sync == 1) + continue; UE_id = i; @@ -1082,49 +1099,6 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP, } -void store_ulsch_buffer(module_id_t module_idP, int frameP, sub_frame_t subframeP) -{ - - int UE_id, /* pCC_id, */ lcgid; - UE_list_t *UE_list = &eNB_mac_inst[module_idP].UE_list; - UE_TEMPLATE *UE_template; - - for (UE_id=UE_list->head_ul; UE_id>=0; UE_id=UE_list->next_ul[UE_id]) { - - - UE_template = &UE_list->UE_template[UE_PCCID(module_idP,UE_id)][UE_id]; - //LOG_I(MAC,"[UE %d next %d] SR is %d\n",UE_id, UE_list->next_ul[UE_id], UE_template->ul_SR); - - UE_template->ul_total_buffer=0; - - for (lcgid=0; lcgid<MAX_NUM_LCGID; lcgid++) { - UE_template->ul_buffer_info[lcgid]=BSR_TABLE[UE_template->bsr_info[lcgid]]; - UE_template->ul_total_buffer+= UE_template->ul_buffer_info[lcgid]; // apply traffic aggregtaion if packets are small - // UE_template->ul_buffer_creation_time_max=cmax(UE_template->ul_buffer_creation_time_max, frame_cycle*1024 + frameP-UE_template->ul_buffer_creation_time[lcgid])); - } - - if ( UE_template->ul_total_buffer >0) - LOG_D(MAC,"[eNB %d] Frame %d subframe %d UE %d CC id %d: LCGID0 %d, LCGID1 %d, LCGID2 %d LCGID3 %d, BO %d\n", - module_idP, frameP,subframeP, UE_id, UE_PCCID(module_idP,UE_id), - UE_template->ul_buffer_info[LCGID0], - UE_template->ul_buffer_info[LCGID1], - UE_template->ul_buffer_info[LCGID2], - UE_template->ul_buffer_info[LCGID3], - UE_template->ul_total_buffer); - else if (UE_is_to_be_scheduled(module_idP,UE_PCCID(module_idP,UE_id),UE_id) > 0 ) { - if (UE_template->ul_total_buffer == 0 ) { - UE_template->ul_total_buffer = BSR_TABLE[11]; - } - - LOG_D(MAC,"[eNB %d] Frame %d subframe %d UE %d CC id %d: SR active, set BO to %d \n", - module_idP, frameP,subframeP, UE_id, UE_PCCID(module_idP,UE_id), - UE_template->ul_total_buffer); - } - } -} - - - void assign_max_mcs_min_rb(module_id_t module_idP,int frameP, sub_frame_t subframeP, uint16_t *first_rb) { @@ -1132,7 +1106,7 @@ void assign_max_mcs_min_rb(module_id_t module_idP,int frameP, sub_frame_t subfra uint16_t n,UE_id; uint8_t CC_id; rnti_t rnti = -1; - int mcs=cmin(16,openair_daq_vars.target_ue_ul_mcs); + int mcs; int rb_table_index=0,tbs,tx_power; eNB_MAC_INST *eNB = &eNB_mac_inst[module_idP]; UE_list_t *UE_list = &eNB->UE_list; @@ -1140,12 +1114,20 @@ void assign_max_mcs_min_rb(module_id_t module_idP,int frameP, sub_frame_t subfra UE_TEMPLATE *UE_template; LTE_DL_FRAME_PARMS *frame_parms; + for (i=UE_list->head_ul; i>=0; i=UE_list->next_ul[i]) { rnti = UE_RNTI(module_idP,i); if (rnti==NOT_A_RNTI) continue; + if (UE_list->UE_sched_ctrl[i].ul_out_of_sync == 1) + continue; + + if (UE_list->UE_sched_ctrl[i].phr_received == 1) + mcs = 20; // if we've received the power headroom information the UE, we can go to maximum mcs + else + mcs = 10; // otherwise, limit to QPSK PUSCH UE_id = i; @@ -1246,7 +1228,9 @@ void sort_ue_ul (module_id_t module_idP,int frameP, sub_frame_t subframeP) rnti1 = UE_RNTI(module_idP,UE_id1); if(rnti1 == NOT_A_RNTI) - continue; + continue; + if (UE_list->UE_sched_ctrl[i].ul_out_of_sync == 1) + continue; pCCid1 = UE_PCCID(module_idP,UE_id1); round1 = maxround(module_idP,rnti1,frameP,subframeP,1); @@ -1256,6 +1240,8 @@ void sort_ue_ul (module_id_t module_idP,int frameP, sub_frame_t subframeP) if(rnti2 == NOT_A_RNTI) continue; + if (UE_list->UE_sched_ctrl[UE_id2].ul_out_of_sync == 1) + continue; pCCid2 = UE_PCCID(module_idP,UE_id2); round2 = maxround(module_idP,rnti2,frameP,subframeP,1); diff --git a/openair2/LAYER2/MAC/proto.h b/openair2/LAYER2/MAC/proto.h index 26656878f6aca88b2b95e0d79b2fa26174d94132..9a0f60167d12f47356e9364f231d665394ae00de 100644 --- a/openair2/LAYER2/MAC/proto.h +++ b/openair2/LAYER2/MAC/proto.h @@ -269,6 +269,15 @@ void rx_sdu(const module_id_t module_idP, const int CC_id,const frame_t frameP, */ void SR_indication(module_id_t module_idP,int CC_id,frame_t frameP,rnti_t rnti, sub_frame_t subframe); +/* \brief Function to indicate a UL failure was detected by eNB PHY. +@param Mod_id Instance ID of eNB +@param CC_id Component carrier +@param frameP Frame index +@param rnti RNTI of UE transmitting the SR +@param subframe Index of subframe where SR was received +*/ +void UL_failure_indication(module_id_t Mod_id,int CC_id,frame_t frameP,rnti_t rnti,sub_frame_t subframe); + uint8_t *get_dlsch_sdu(module_id_t module_idP,int CC_id,frame_t frameP,rnti_t rnti,uint8_t TBindex); /* \brief Function to retrieve MCH transport block and MCS used for MCH in this MBSFN subframe. Returns null if no MCH is to be transmitted @@ -490,7 +499,7 @@ uint8_t *parse_ulsch_header(uint8_t *mac_header, int l2_init(LTE_DL_FRAME_PARMS *frame_parms,int eMBMS_active, char *uecap_xer, uint8_t cba_group_active, uint8_t HO_active); int mac_init(void); int add_new_ue(module_id_t Mod_id, int CC_id, rnti_t rnti,int harq_pid); -int mac_remove_ue(module_id_t Mod_id, int UE_id,int frameP, sub_frame_t subframeP); +int rrc_mac_remove_ue(module_id_t Mod_id, rnti_t rntiP); int maxround(module_id_t Mod_id,uint16_t rnti,int frame,sub_frame_t subframe,uint8_t ul_flag); diff --git a/openair2/LAYER2/MAC/rar_tools.c b/openair2/LAYER2/MAC/rar_tools.c index 2e97f83fac72920610829cacebb77c1e6190bcd1..be8dc43c97ad7b6c3cae0f1450e499e2e5b01985 100644 --- a/openair2/LAYER2/MAC/rar_tools.c +++ b/openair2/LAYER2/MAC/rar_tools.c @@ -39,8 +39,6 @@ #include "defs.h" #include "proto.h" #include "extern.h" -#include "MAC_INTERFACE/defs.h" -#include "MAC_INTERFACE/extern.h" #include "SIMULATION/TOOLS/defs.h" #include "UTIL/LOG/log.h" #include "OCG.h" @@ -117,7 +115,7 @@ unsigned short fill_rar( rar[2] |= ((mcs&0x8)>>3); // mcs 10 rar[3] = (((mcs&0x7)<<5)) | ((TPC&7)<<2) | ((ULdelay&1)<<1) | (cqireq&1); - LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d Generating RAR (%02x|%02x.%02x.%02x.%02x.%02x.%02x) for ra_idx %d, CRNTI %x,preamble %d/%d,TIMING OFFSET %d\n", + LOG_D(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d Generating RAR (%02x|%02x.%02x.%02x.%02x.%02x.%02x) for ra_idx %d, CRNTI %x,preamble %d/%d,TIMING OFFSET %d\n", module_idP, CC_id, frameP, *(uint8_t*)rarh,rar[0],rar[1],rar[2],rar[3],rar[4],rar[5], @@ -168,14 +166,14 @@ ue_process_rar( LOG_D(MAC,"[UE %d][RAPROC] rarh->RAPID %d\n",module_idP,rarh->RAPID); // LOG_I(MAC,"[UE %d][RAPROC] rar->R %d\n",module_idP,rar->R); - LOG_I(MAC,"[UE %d][RAPROC] rar->Timing_Advance_Command %d\n",module_idP,(((uint16_t)(rar[0]&0x7f))<<4) + (rar[1]>>4)); + LOG_D(MAC,"[UE %d][RAPROC] rar->Timing_Advance_Command %d\n",module_idP,(((uint16_t)(rar[0]&0x7f))<<4) + (rar[1]>>4)); // LOG_I(MAC,"[UE %d][RAPROC] rar->hopping_flag %d\n",module_idP,rar->hopping_flag); // LOG_I(MAC,"[UE %d][RAPROC] rar->rb_alloc %d\n",module_idP,rar->rb_alloc); // LOG_I(MAC,"[UE %d][RAPROC] rar->mcs %d\n",module_idP,rar->mcs); // LOG_I(MAC,"[UE %d][RAPROC] rar->TPC %d\n",module_idP,rar->TPC); // LOG_I(MAC,"[UE %d][RAPROC] rar->UL_delay %d\n",module_idP,rar->UL_delay); // LOG_I(MAC,"[UE %d][RAPROC] rar->cqi_req %d\n",module_idP,rar->cqi_req); - LOG_I(MAC,"[UE %d][RAPROC] rar->t_crnti %x\n",module_idP,(uint16_t)rar[5]+(rar[4]<<8)); + LOG_D(MAC,"[UE %d][RAPROC] rar->t_crnti %x\n",module_idP,(uint16_t)rar[5]+(rar[4]<<8)); #endif diff --git a/openair2/LAYER2/MAC/vars.h b/openair2/LAYER2/MAC/vars.h index 88da64de5a0634109a3621320d081ac143f18b0e..508c7f8c210a9f20753d79f6b298f0518ce87f88 100644 --- a/openair2/LAYER2/MAC/vars.h +++ b/openair2/LAYER2/MAC/vars.h @@ -55,6 +55,7 @@ const uint32_t BSR_TABLE[BSR_TABLE_SIZE]= {0,10,12,14,17,19,22,26,31,36,42,49,57 //uint32_t EBSR_Level[63]={0,10,13,16,19,23,29,35,43,53,65,80,98,120,147,181}; +MAC_xface *mac_xface; uint32_t RRC_CONNECTION_FLAG; diff --git a/openair2/LAYER2/PDCP_v10.1.0/pdcp.c b/openair2/LAYER2/PDCP_v10.1.0/pdcp.c index d210b98f6a585411f887234822d01e58d4484b4b..d8fa42a19cc3f8a82e5d88fc3d531515287271d9 100755 --- a/openair2/LAYER2/PDCP_v10.1.0/pdcp.c +++ b/openair2/LAYER2/PDCP_v10.1.0/pdcp.c @@ -45,7 +45,7 @@ #include "pdcp_sequence_manager.h" #include "LAYER2/RLC/rlc.h" #include "LAYER2/MAC/extern.h" -#include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h" +#include "RRC/LITE/proto.h" #include "pdcp_primitives.h" #include "OCG.h" #include "OCG_extern.h" @@ -111,6 +111,11 @@ boolean_t pdcp_data_req( VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDCP_DATA_REQ,VCD_FUNCTION_IN); CHECK_CTXT_ARGS(ctxt_pP); +#if T_TRACER + if (ctxt_pP->enb_flag != ENB_FLAG_NO) + T(T_ENB_PDCP_DL, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->rnti), T_INT(rb_idP), T_INT(sdu_buffer_sizeP)); +#endif + if (modeP == PDCP_TRANSMISSION_MODE_TRANSPARENT) { AssertError (rb_idP < NB_RB_MBMS_MAX, return FALSE, "RB id is too high (%u/%d) %u %u!\n", rb_idP, NB_RB_MBMS_MAX, ctxt_pP->module_id, ctxt_pP->rnti); } else { @@ -458,6 +463,11 @@ pdcp_data_ind( LOG_F(PDCP,"\n"); #endif +#if T_TRACER + if (ctxt_pP->enb_flag != ENB_FLAG_NO) + T(T_ENB_PDCP_UL, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->rnti), T_INT(rb_idP), T_INT(sdu_buffer_sizeP)); +#endif + if (MBMS_flagP) { AssertError (rb_idP < NB_RB_MBMS_MAX, return FALSE, "RB id is too high (%u/%d) %u rnti %x!\n", @@ -636,10 +646,10 @@ pdcp_data_ind( PROTOCOL_PDCP_CTXT_FMT" DATA-IND len %u", PROTOCOL_PDCP_CTXT_ARGS(ctxt_pP, pdcp_p), sdu_buffer_sizeP - pdcp_header_len - pdcp_tailer_len); - pdcp_rrc_data_ind(ctxt_pP, - rb_id, - sdu_buffer_sizeP - pdcp_header_len - pdcp_tailer_len, - (uint8_t*)&sdu_buffer_pP->data[pdcp_header_len]); + rrc_data_ind(ctxt_pP, + rb_id, + sdu_buffer_sizeP - pdcp_header_len - pdcp_tailer_len, + (uint8_t*)&sdu_buffer_pP->data[pdcp_header_len]); free_mem_block(sdu_buffer_pP); // free_mem_block(new_sdu); diff --git a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_dar.c b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_dar.c index b2930e62966a59650ee330ab67514d2d4da7f838..881dc9b99338944a03e73e4369b2e959be5a613f 100644 --- a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_dar.c +++ b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_dar.c @@ -37,7 +37,6 @@ #include "rlc_primitives.h" #include "mac_primitives.h" #include "list.h" -#include "MAC_INTERFACE/extern.h" #include "UTIL/LOG/log.h" #include "UTIL/LOG/vcd_signal_dumper.h" diff --git a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_receiver.c b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_receiver.c index 085f37e4c1bbeb5e5767bb14ef2d8ffc8b4273a6..6ea07a4677df3e406a89c0116e6e7f1c8c06e6d3 100755 --- a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_receiver.c +++ b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_receiver.c @@ -36,7 +36,6 @@ #include "rlc_primitives.h" #include "mac_primitives.h" #include "list.h" -#include "MAC_INTERFACE/extern.h" #include "UTIL/LOG/log.h" //----------------------------------------------------------------------------- diff --git a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_segment.c b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_segment.c index a31f99091652ee742330547965d729dbfad6230a..24890bf957d0ae6519bf8560f11a9bcd8d735b90 100755 --- a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_segment.c +++ b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_segment.c @@ -40,7 +40,6 @@ #include "list.h" #include "rlc_um.h" #include "rlc_primitives.h" -#include "MAC_INTERFACE/extern.h" #include "UTIL/LOG/log.h" //----------------------------------------------------------------------------- diff --git a/openair2/LAYER2/RLC/rlc.c b/openair2/LAYER2/RLC/rlc.c index 1397387f22a372d794282d597bb3f1e25a74295e..af0fe468754f620a67d0bcdc3e9a53824bcef680 100644 --- a/openair2/LAYER2/RLC/rlc.c +++ b/openair2/LAYER2/RLC/rlc.c @@ -359,6 +359,11 @@ rlc_op_status_t rlc_data_req (const protocol_ctxt_t* const ctxt_pP, #endif +#if T_TRACER + if (ctxt_pP->enb_flag) + T(T_ENB_RLC_DL, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->rnti), T_INT(rb_idP), T_INT(sdu_sizeP)); +#endif + if (MBMS_flagP) { AssertFatal (rb_idP < NB_RB_MBMS_MAX, "RB id is too high (%u/%d)!\n", rb_idP, NB_RB_MBMS_MAX); } else { @@ -571,6 +576,12 @@ void rlc_data_ind ( rlc_util_print_hex_octets(RLC, (unsigned char*)sdu_pP->data, sdu_sizeP); #endif +#if T_TRACER + if (ctxt_pP->enb_flag) + T(T_ENB_RLC_UL, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->rnti), T_INT(rb_idP), T_INT(sdu_sizeP)); +#endif + + pdcp_data_ind ( ctxt_pP, srb_flagP, diff --git a/openair2/LAYER2/RLC/rlc_mac.c b/openair2/LAYER2/RLC/rlc_mac.c index 73f323f14b2013844ca2d7239436c1a011925cc1..3bde40888fe1ebc3fbc6d571c3ebf4296ddddb05 100644 --- a/openair2/LAYER2/RLC/rlc_mac.c +++ b/openair2/LAYER2/RLC/rlc_mac.c @@ -221,6 +221,11 @@ tbs_size_t mac_rlc_data_req( ; } +#if T_TRACER + if (enb_flagP) + T(T_ENB_RLC_MAC_DL, T_INT(module_idP), T_INT(rntiP), T_INT(channel_idP), T_INT(ret_tb_size)); +#endif + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_MAC_RLC_DATA_REQ,VCD_FUNCTION_OUT); return ret_tb_size; } @@ -276,6 +281,10 @@ void mac_rlc_data_ind ( #endif +#if T_TRACER + if (enb_flagP) + T(T_ENB_RLC_MAC_UL, T_INT(module_idP), T_INT(rntiP), T_INT(channel_idP), T_INT(tb_sizeP)); +#endif if (MBMS_flagP) { if (BOOL_NOT(enb_flagP)) { diff --git a/openair2/LAYER2/openair2_proc.c b/openair2/LAYER2/openair2_proc.c index e09adaea8c595c8b211c3af56306aa8f6cb5891f..8daa8afb70374907254f70e6e54ffec00e5aa789 100644 --- a/openair2/LAYER2/openair2_proc.c +++ b/openair2/LAYER2/openair2_proc.c @@ -201,9 +201,11 @@ int dump_eNB_l2_stats(char *buffer, int length) UE_list->eNB_UE_stats[CC_id][UE_id].avg_overhead_bytes ); - len += sprintf(&buffer[len],"[MAC] UE %d (ULSCH), Status %s, RNTI %x : rx power (normalized %d, target %d), MCS (pre %d, post %d), RB (rx %d, retx %d, total %d), Current TBS %d \n", + + len += sprintf(&buffer[len],"[MAC] UE %d (ULSCH), Status %s, Failute timer %d, RNTI %x : rx power (normalized %d, target %d), MCS (pre %d, post %d), RB (rx %d, retx %d, total %d), Current TBS %d \n", UE_id, map_int_to_str(rrc_status_names, UE_list->eNB_UE_stats[CC_id][UE_id].rrc_status), + UE_list->UE_sched_ctrl[UE_id].ul_failure_timer, UE_list->eNB_UE_stats[CC_id][UE_id].crnti, UE_list->eNB_UE_stats[CC_id][UE_id].normalized_rx_power, UE_list->eNB_UE_stats[CC_id][UE_id].target_rx_power, diff --git a/openair2/PHY_INTERFACE/defs.h b/openair2/PHY_INTERFACE/defs.h index c34bec28d74e22781288c2736be78188982499e4..a85c2b15f2bf8212654a82ad73ea6e8d48553ab4 100755 --- a/openair2/PHY_INTERFACE/defs.h +++ b/openair2/PHY_INTERFACE/defs.h @@ -94,7 +94,8 @@ typedef struct { /// Indicate Scheduling Request from UE void (*SR_indication)(module_id_t Mod_id,int CC_id,frame_t frameP,rnti_t rnti,sub_frame_t subframe); - + /// Indicate UL Failure to eNodeB MAC + void (*UL_failure_indication)(module_id_t Mod_id,int CC_id,frame_t frameP,rnti_t rnti,sub_frame_t subframe); /// Configure Common PHY parameters from SIB1 void (*phy_config_sib1_eNB)(module_id_t Mod_id,int CC_id, TDD_Config_t *tdd_config, @@ -133,7 +134,7 @@ typedef struct { /// get delta mcs for fast UL AMC int16_t (*estimate_ue_tx_power)(uint32_t tbs, uint32_t nb_rb, uint8_t control_only, lte_prefix_type_t ncp, uint8_t use_srs); - + int (*mac_phy_remove_ue)(module_id_t Mod_idP,rnti_t rntiP); /// UE functions /// reset the ue phy diff --git a/openair2/RRC/L2_INTERFACE/openair_rrc_L2_interface.c b/openair2/RRC/L2_INTERFACE/openair_rrc_L2_interface.c index 732d2aa54adff971b7b52948d378ef2cdda8eeb1..702433744d23e2003db7395bedb240cfc57e5ba3 100644 --- a/openair2/RRC/L2_INTERFACE/openair_rrc_L2_interface.c +++ b/openair2/RRC/L2_INTERFACE/openair_rrc_L2_interface.c @@ -155,10 +155,10 @@ rlcrrc_data_ind( ) //------------------------------------------------------------------------------ { - rrc_lite_data_ind(ctxt_pP, - srb_idP, - sdu_lenP, - buffer_pP); + rrc_data_ind(ctxt_pP, + srb_idP, + sdu_lenP, + buffer_pP); } //------------------------------------------------------------------------------ diff --git a/openair2/RRC/LITE/L2_interface.c b/openair2/RRC/LITE/L2_interface.c index 70d0a20c0862ae9dab0ef445c0af24e24a40b617..34e47c257562588218fd5bd87aff2bec57eddfe5 100644 --- a/openair2/RRC/LITE/L2_interface.c +++ b/openair2/RRC/LITE/L2_interface.c @@ -67,7 +67,7 @@ mui_t mui=0; //------------------------------------------------------------------------------ int8_t -mac_rrc_lite_data_req( +mac_rrc_data_req( const module_id_t Mod_idP, const int CC_id, const frame_t frameP, @@ -98,7 +98,7 @@ mac_rrc_lite_data_req( // All even frames transmit SIB in SF 5 if (eNB_rrc_inst[Mod_idP].carrier[CC_id].sizeof_SIB1 == 255) { LOG_E(RRC,"[eNB %d] MAC Request for SIB1 and SIB1 not initialized\n",Mod_idP); - mac_xface->macphy_exit("mac_rrc_lite_data_req: MAC Request for SIB1 and SIB1 not initialized"); + mac_xface->macphy_exit("mac_rrc_data_req: MAC Request for SIB1 and SIB1 not initialized"); } if ((frameP%2) == 0) { @@ -337,7 +337,7 @@ mac_rrc_lite_data_req( //------------------------------------------------------------------------------ int8_t -mac_rrc_lite_data_ind( +mac_rrc_data_ind( const module_id_t module_idP, const int CC_id, const frame_t frameP, @@ -509,14 +509,14 @@ mac_rrc_lite_data_ind( //-------------------------------------------------------------------------------------------// // this function is Not USED anymore -void mac_lite_sync_ind(module_id_t Mod_idP,uint8_t Status) +void mac_sync_ind(module_id_t Mod_idP,uint8_t Status) { //-------------------------------------------------------------------------------------------// } //------------------------------------------------------------------------------ uint8_t -rrc_lite_data_req( +rrc_data_req( const protocol_ctxt_t* const ctxt_pP, const rb_id_t rb_idP, const mui_t muiP, @@ -586,7 +586,7 @@ rrc_lite_data_req( //------------------------------------------------------------------------------ void -rrc_lite_data_ind( +rrc_data_ind( const protocol_ctxt_t* const ctxt_pP, const rb_id_t Srb_id, const sdu_size_t sdu_sizeP, @@ -650,7 +650,7 @@ rrc_lite_data_ind( } //-------------------------------------------------------------------------------------------// -void rrc_lite_in_sync_ind(module_id_t Mod_idP, frame_t frameP, uint16_t eNB_index) +void rrc_in_sync_ind(module_id_t Mod_idP, frame_t frameP, uint16_t eNB_index) { //-------------------------------------------------------------------------------------------// #if defined(ENABLE_ITTI) @@ -674,7 +674,7 @@ void rrc_lite_in_sync_ind(module_id_t Mod_idP, frame_t frameP, uint16_t eNB_inde } //-------------------------------------------------------------------------------------------// -void rrc_lite_out_of_sync_ind(module_id_t Mod_idP, frame_t frameP, uint16_t eNB_index) +void rrc_out_of_sync_ind(module_id_t Mod_idP, frame_t frameP, uint16_t eNB_index) { //-------------------------------------------------------------------------------------------// LOG_I(RRC,"[UE %d] Frame %d: OUT OF SYNC FROM eNB %d (T310 active %d : T310 %d, N310 %d, N311 %d)\n ", @@ -701,7 +701,7 @@ void rrc_lite_out_of_sync_ind(module_id_t Mod_idP, frame_t frameP, uint16_t eNB_ //------------------------------------------------------------------------------ int -mac_eNB_get_rrc_lite_status( +mac_eNB_get_rrc_status( const module_id_t Mod_idP, const rnti_t rntiP ) @@ -719,10 +719,54 @@ mac_eNB_get_rrc_lite_status( } } +void mac_eNB_rrc_ul_failure(const module_id_t Mod_instP, + const int CC_idP, + const frame_t frameP, + const sub_frame_t subframeP, + const rnti_t rntiP) { + struct rrc_eNB_ue_context_s* ue_context_p = NULL; + ue_context_p = rrc_eNB_get_ue_context( + &eNB_rrc_inst[Mod_instP], + rntiP); + + if (ue_context_p != NULL) { + LOG_I(RRC,"Frame %d, Subframe %d: UE %x UL failure, activating timer\n",frameP,subframeP,rntiP); + ue_context_p->ue_context.ul_failure_timer=1; + } + else { + LOG_W(RRC,"Frame %d, Subframe %d: UE %x unknown \n",frameP,subframeP,rntiP); + rrc_mac_remove_ue(Mod_instP,rntiP); + } + +} + +void mac_eNB_rrc_ul_in_sync(const module_id_t Mod_instP, + const int CC_idP, + const frame_t frameP, + const sub_frame_t subframeP, + const rnti_t rntiP) { + + struct rrc_eNB_ue_context_s* ue_context_p = NULL; + ue_context_p = rrc_eNB_get_ue_context( + &eNB_rrc_inst[Mod_instP], + rntiP); + + + + if (ue_context_p != NULL) { + LOG_I(RRC,"Frame %d, Subframe %d: UE %x to UL in synch\n",rntiP); + ue_context_p->ue_context.ul_failure_timer=0; + } + else { + LOG_E(RRC,"Frame %d, Subframe %d: UE %x unknown \n",rntiP); + } + + return; +} //------------------------------------------------------------------------------ int -mac_UE_get_rrc_lite_status( +mac_UE_get_rrc_status( const module_id_t Mod_idP, const uint8_t indexP ) diff --git a/openair2/RRC/LITE/defs.h b/openair2/RRC/LITE/defs.h index 78240de082602525457b5e49ca5118dadefbc47f..7a5211544038281c46cc4e80a3552e6ff519c6c0 100644 --- a/openair2/RRC/LITE/defs.h +++ b/openair2/RRC/LITE/defs.h @@ -357,6 +357,8 @@ typedef struct eNB_RRC_UE_s { transport_layer_addr_t enb_gtp_addrs[S1AP_MAX_E_RAB]; rb_id_t enb_gtp_ebi[S1AP_MAX_E_RAB]; #endif + uint32_t ul_failure_timer; + uint32_t ue_release_timer; } eNB_RRC_UE_t; typedef uid_t ue_uid_t; diff --git a/openair2/RRC/LITE/proto.h b/openair2/RRC/LITE/proto.h index 5d77698c8e4a5b3a5465f50c2c91d7b0c3780687..7b316ce953459654a15288e976add44be44fc035 100644 --- a/openair2/RRC/LITE/proto.h +++ b/openair2/RRC/LITE/proto.h @@ -38,21 +38,23 @@ * @{ */ +#include "RRC/LITE/defs.h" + //main.c int rrc_init_global_param(void); int L3_xface_init(void); void openair_rrc_top_init(int eMBMS_active, char *uecap_xer, uint8_t cba_group_active,uint8_t HO_enabled); #if defined(ENABLE_ITTI) char -openair_rrc_lite_eNB_configuration( +openair_rrc_eNB_configuration( const module_id_t enb_mod_idP, RrcConfigurationReq* configuration ); #endif -char openair_rrc_lite_eNB_init( +char openair_rrc_eNB_init( const module_id_t module_idP); -char openair_rrc_lite_ue_init( +char openair_rrc_ue_init( const module_id_t module_idP, const uint8_t CH_IDX); void rrc_config_buffer(SRB_INFO *srb_info, uint8_t Lchan_type, uint8_t Role); @@ -281,7 +283,7 @@ rrc_eNB_generate_RRCConnectionReconfiguration_handover( //L2_interface.c int8_t -mac_rrc_lite_data_req( +mac_rrc_data_req( const module_id_t Mod_idP, const int CC_id, const frame_t frameP, @@ -294,7 +296,7 @@ mac_rrc_lite_data_req( ); int8_t -mac_rrc_lite_data_ind( +mac_rrc_data_ind( const module_id_t module_idP, const int CC_id, const frame_t frameP, @@ -310,8 +312,20 @@ mac_rrc_lite_data_ind( void mac_sync_ind( module_id_t Mod_instP, uint8_t status); +void mac_eNB_rrc_ul_failure(const module_id_t Mod_instP, + const int CC_id, + const frame_t frameP, + const sub_frame_t subframeP, + const rnti_t rnti); + +void mac_eNB_rrc_ul_in_sync(const module_id_t Mod_instP, + const int CC_id, + const frame_t frameP, + const sub_frame_t subframeP, + const rnti_t rnti); + uint8_t -rrc_lite_data_req( +rrc_data_req( const protocol_ctxt_t* const ctxt_pP, const rb_id_t rb_idP, const mui_t muiP, @@ -322,16 +336,16 @@ rrc_lite_data_req( ); void -rrc_lite_data_ind( +rrc_data_ind( const protocol_ctxt_t* const ctxt_pP, const rb_id_t Srb_id, const sdu_size_t sdu_sizeP, const uint8_t* const buffer_pP ); -void rrc_lite_in_sync_ind(module_id_t module_idP, frame_t frameP, uint16_t eNB_index); +void rrc_in_sync_ind(module_id_t module_idP, frame_t frameP, uint16_t eNB_index); -void rrc_lite_out_of_sync_ind(module_id_t module_idP, frame_t frameP, unsigned short eNB_index); +void rrc_out_of_sync_ind(module_id_t module_idP, frame_t frameP, unsigned short eNB_index); int decode_MCCH_Message( const protocol_ctxt_t* const ctxt_pP, const uint8_t eNB_index, const uint8_t* const Sdu, const uint8_t Sdu_len, const uint8_t mbsfn_sync_area ); @@ -356,13 +370,13 @@ ue_measurement_report_triggering( ); int -mac_eNB_get_rrc_lite_status( +mac_eNB_get_rrc_status( const module_id_t Mod_idP, const rnti_t rntiP ); int -mac_UE_get_rrc_lite_status( +mac_UE_get_rrc_status( const module_id_t Mod_idP, const uint8_t indexP ); @@ -427,10 +441,8 @@ rrc_eNB_free_mem_UE_context( void rrc_eNB_free_UE( - const module_id_t enb_mod_idP, - const rnti_t rntiP, - const frame_t frameP, - const sub_frame_t subframeP + const module_id_t enb_mod_idP, + const struct rrc_eNB_ue_context_s* const ue_context_pP ); long binary_search_int(int elements[], long numElem, int value); diff --git a/openair2/RRC/LITE/rrc_UE.c b/openair2/RRC/LITE/rrc_UE.c index 7da26897e8dc52f16be33892ae98ee1ed3222d56..01c1ee6ca90489ee55afe0c4f5502c5ced82599e 100644 --- a/openair2/RRC/LITE/rrc_UE.c +++ b/openair2/RRC/LITE/rrc_UE.c @@ -283,7 +283,7 @@ static void init_MCCH_UE(module_id_t ue_mod_idP, uint8_t eNB_index) #endif //----------------------------------------------------------------------------- -static void openair_rrc_lite_ue_init_security( const protocol_ctxt_t* const ctxt_pP ) +static void openair_rrc_ue_init_security( const protocol_ctxt_t* const ctxt_pP ) { #if defined(ENABLE_SECURITY) // uint8_t *kRRCenc; @@ -304,7 +304,7 @@ static void openair_rrc_lite_ue_init_security( const protocol_ctxt_t* const ctxt } //----------------------------------------------------------------------------- -char openair_rrc_lite_ue_init( const module_id_t ue_mod_idP, const unsigned char eNB_index ) +char openair_rrc_ue_init( const module_id_t ue_mod_idP, const unsigned char eNB_index ) { protocol_ctxt_t ctxt; PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, ue_mod_idP, ENB_FLAG_NO, NOT_A_RNTI, 0, 0,eNB_index); @@ -331,7 +331,7 @@ char openair_rrc_lite_ue_init( const module_id_t ue_mod_idP, const unsigned char UE_rrc_inst[ctxt.module_id].integrity_algorithm = SecurityAlgorithmConfig__integrityProtAlgorithm_reserved; #endif - openair_rrc_lite_ue_init_security(&ctxt); + openair_rrc_ue_init_security(&ctxt); init_SI_UE(&ctxt,eNB_index); LOG_D(RRC,PROTOCOL_RRC_CTXT_FMT" INIT: phy_sync_2_ch_ind\n", PROTOCOL_RRC_CTXT_ARGS(&ctxt)); @@ -452,14 +452,14 @@ static void rrc_ue_generate_RRCConnectionSetupComplete( const protocol_ctxt_t* c LOG_D(RLC, "[FRAME %05d][RRC_UE][MOD %02d][][--- PDCP_DATA_REQ/%d Bytes (RRCConnectionSetupComplete to eNB %d MUI %d) --->][PDCP][MOD %02d][RB %02d]\n", ctxt_pP->frame, ctxt_pP->module_id+NB_eNB_INST, size, eNB_index, rrc_mui, ctxt_pP->module_id+NB_eNB_INST, DCCH); - pdcp_rrc_data_req ( - ctxt_pP, - DCCH, - rrc_mui++, - SDU_CONFIRM_NO, - size, - buffer, - PDCP_TRANSMISSION_MODE_CONTROL); + rrc_data_req ( + ctxt_pP, + DCCH, + rrc_mui++, + SDU_CONFIRM_NO, + size, + buffer, + PDCP_TRANSMISSION_MODE_CONTROL); } //----------------------------------------------------------------------------- @@ -479,14 +479,14 @@ static void rrc_ue_generate_RRCConnectionReconfigurationComplete( const protocol rrc_mui, UE_MODULE_ID_TO_INSTANCE(ctxt_pP->module_id), DCCH); - pdcp_rrc_data_req ( - ctxt_pP, - DCCH, - rrc_mui++, - SDU_CONFIRM_NO, - size, - buffer, - PDCP_TRANSMISSION_MODE_CONTROL); + rrc_data_req ( + ctxt_pP, + DCCH, + rrc_mui++, + SDU_CONFIRM_NO, + size, + buffer, + PDCP_TRANSMISSION_MODE_CONTROL); } @@ -1441,14 +1441,14 @@ rrc_ue_process_securityModeCommand( } LOG_T(RRC, "\n"); - pdcp_rrc_data_req ( - ctxt_pP, - DCCH, - rrc_mui++, - SDU_CONFIRM_NO, - (enc_rval.encoded + 7) / 8, - buffer, - PDCP_TRANSMISSION_MODE_CONTROL); + rrc_data_req ( + ctxt_pP, + DCCH, + rrc_mui++, + SDU_CONFIRM_NO, + (enc_rval.encoded + 7) / 8, + buffer, + PDCP_TRANSMISSION_MODE_CONTROL); } } } @@ -1546,14 +1546,14 @@ rrc_ue_process_ueCapabilityEnquiry( } LOG_T(RRC, "\n"); - pdcp_rrc_data_req ( - ctxt_pP, - DCCH, - rrc_mui++, - SDU_CONFIRM_NO, - (enc_rval.encoded + 7) / 8, - buffer, - PDCP_TRANSMISSION_MODE_CONTROL); + rrc_data_req ( + ctxt_pP, + DCCH, + rrc_mui++, + SDU_CONFIRM_NO, + (enc_rval.encoded + 7) / 8, + buffer, + PDCP_TRANSMISSION_MODE_CONTROL); } } } @@ -4175,15 +4175,15 @@ void *rrc_ue_task( void *args_p ) /* Transfer data to PDCP */ PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, ue_mod_id, ENB_FLAG_NO, UE_rrc_inst[ue_mod_id].Info[0].rnti, 0, 0,0); - pdcp_rrc_data_req (&ctxt, - DCCH, - rrc_mui++, - SDU_CONFIRM_NO, - length, buffer, - PDCP_TRANSMISSION_MODE_CONTROL); + rrc_data_req (&ctxt, + DCCH, + rrc_mui++, + SDU_CONFIRM_NO, + length, buffer, + PDCP_TRANSMISSION_MODE_CONTROL); break; } - + # endif # if ENABLE_RAL diff --git a/openair2/RRC/LITE/rrc_common.c b/openair2/RRC/LITE/rrc_common.c index 1955a5ac8927da61dcd98aeb291f61f8b9ea1c26..bd77c8463a062cb5e46803c82187b074b4e7f3f2 100644 --- a/openair2/RRC/LITE/rrc_common.c +++ b/openair2/RRC/LITE/rrc_common.c @@ -48,6 +48,7 @@ #include "asn1_msg.h" #include "pdcp.h" #include "UTIL/LOG/vcd_signal_dumper.h" +#include "rrc_eNB_UE_context.h" #ifdef LOCALIZATION #include <sys/time.h> @@ -132,7 +133,7 @@ rrc_init_global_param( return -1; } */ - rrc_rlc_register_rrc (rlcrrc_data_ind, NULL); //register with rlc + rrc_rlc_register_rrc (rrc_data_ind, NULL); //register with rlc DCCH_LCHAN_DESC.transport_block_size = 4; DCCH_LCHAN_DESC.max_transport_blocks = 16; @@ -417,9 +418,10 @@ rrc_rx_tx( //uint8_t UE_id; int32_t current_timestamp_ms, ref_timestamp_ms; struct timeval ts; + struct rrc_eNB_ue_context_s *ue_context_p = NULL,*ue_to_be_removed = NULL; + #ifdef LOCALIZATION double estimated_distance; - struct rrc_eNB_ue_context_s* ue_context_p = NULL; protocol_ctxt_t ctxt; #endif VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RRC_RX_TX,VCD_FUNCTION_IN); @@ -520,6 +522,31 @@ rrc_rx_tx( } else { // eNB check_handovers(ctxt_pP); // counetr, and get the value and aggregate + + // check for UL failure + 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.ul_failure_timer>0) { + ue_context_p->ue_context.ul_failure_timer++; + if (ue_context_p->ue_context.ul_failure_timer >= 20000) { + // remove UE after 20 seconds after MAC has indicated UL failure + LOG_I(RRC,"Removing UE %x instance\n",ue_context_p->ue_context.rnti); + ue_to_be_removed = ue_context_p; + break; + } + } + if (ue_context_p->ue_context.ue_release_timer>0) { + ue_context_p->ue_context.ue_release_timer++; + if (ue_context_p->ue_context.ue_release_timer >= 100) { + // remove UE after 10 frames after RRCConnectionRelease is triggered + LOG_I(RRC,"Removing UE %x instance\n",ue_context_p->ue_context.rnti); + ue_to_be_removed = ue_context_p; + break; + } + } + } + if (ue_to_be_removed) + rrc_eNB_free_UE(ctxt_pP->module_id,ue_to_be_removed); + #ifdef RRC_LOCALIZATION /* for the localization, only primary CC_id might be relevant*/ diff --git a/openair2/RRC/LITE/rrc_eNB.c b/openair2/RRC/LITE/rrc_eNB.c index 42e28f752f0f6c971b84da7f7a12a63253cfa675..c85e61a0a435b1203dfc46b2f40c172766700abb 100644 --- a/openair2/RRC/LITE/rrc_eNB.c +++ b/openair2/RRC/LITE/rrc_eNB.c @@ -63,6 +63,8 @@ #include "platform_types.h" #include "msc.h" +#include "T.h" + //#ifdef Rel10 #include "MeasResults.h" //#endif @@ -567,10 +569,20 @@ rrc_eNB_ue_context_stmsi_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.Initialue_identity_s_TMSI.presence == TRUE) + LOG_I(RRC,"checking for UE S-TMSI %x, mme %x (%p): rnti %x", + m_tmsiP, mme_codeP, ue_context_p, + ue_context_p->ue_context.rnti); + if (ue_context_p->ue_context.Initialue_identity_s_TMSI.presence == TRUE) { + printf("S-TMSI %x, MME %x\n", + ue_context_p->ue_context.Initialue_identity_s_TMSI.m_tmsi, + ue_context_p->ue_context.Initialue_identity_s_TMSI.mme_code); 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; + } + else + printf("\n"); + } return NULL; } @@ -780,37 +792,34 @@ rrc_eNB_free_mem_UE_context( } //----------------------------------------------------------------------------- -// called by MAC layer only // should be called when UE is lost by eNB void -rrc_eNB_free_UE( - const module_id_t enb_mod_idP, - const rnti_t rntiP, - const frame_t frameP, - const sub_frame_t subframeP -) +rrc_eNB_free_UE(const module_id_t enb_mod_idP,const struct rrc_eNB_ue_context_s* const ue_context_pP) //----------------------------------------------------------------------------- { - struct rrc_eNB_ue_context_s* ue_context_p = NULL; + protocol_ctxt_t ctxt; #if !defined(ENABLE_USE_MME) module_id_t ue_module_id; /* avoid gcc warnings */ (void)ue_module_id; #endif - AssertFatal(enb_mod_idP < NB_eNB_INST, "eNB inst invalid (%d/%d) for UE %x!", enb_mod_idP, NB_eNB_INST, rntiP); - ue_context_p = rrc_eNB_get_ue_context( + rnti_t rnti = ue_context_pP->ue_context.rnti; + + + AssertFatal(enb_mod_idP < NB_eNB_INST, "eNB inst invalid (%d/%d) for UE %x!", enb_mod_idP, NB_eNB_INST, rnti); + /* ue_context_p = rrc_eNB_get_ue_context( &eNB_rrc_inst[enb_mod_idP], rntiP ); - - if (NULL != ue_context_p) { - PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, enb_mod_idP, ENB_FLAG_YES, rntiP, frameP, subframeP,enb_mod_idP); - LOG_W(RRC, "[eNB %d] Removing UE RNTI %x\n", enb_mod_idP, rntiP); + */ + if (NULL != ue_context_pP) { + PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, enb_mod_idP, ENB_FLAG_YES, rnti, 0, 0,enb_mod_idP); + LOG_W(RRC, "[eNB %d] Removing UE RNTI %x\n", enb_mod_idP, rnti); #if defined(ENABLE_USE_MME) - rrc_eNB_send_S1AP_UE_CONTEXT_RELEASE_REQ(enb_mod_idP, ue_context_p, S1AP_CAUSE_RADIO_NETWORK, 21); // send cause 21: connection with ue lost + rrc_eNB_send_S1AP_UE_CONTEXT_RELEASE_REQ(enb_mod_idP, ue_context_pP, S1AP_CAUSE_RADIO_NETWORK, 21); // send cause 21: connection with ue lost /* From 3GPP 36300v10 p129 : 19.2.2.2.2 S1 UE Context Release Request (eNB triggered) * If the E-UTRAN internal reason is a radio link failure detected in the eNB, the eNB shall wait a sufficient time before * triggering the S1 UE Context Release Request procedure @@ -819,22 +828,22 @@ rrc_eNB_free_UE( */ #else #if defined(OAI_EMU) - AssertFatal(ue_context_p->local_uid < NUMBER_OF_UE_MAX, "local_uid invalid (%d<%d) for UE %x!", ue_context_p->local_uid, NUMBER_OF_UE_MAX, rntiP); - ue_module_id = oai_emulation.info.eNB_ue_local_uid_to_ue_module_id[enb_mod_idP][ue_context_p->local_uid]; - AssertFatal(ue_module_id < NUMBER_OF_UE_MAX, "ue_module_id invalid (%d<%d) for UE %x!", ue_module_id, NUMBER_OF_UE_MAX, rntiP); - oai_emulation.info.eNB_ue_local_uid_to_ue_module_id[enb_mod_idP][ue_context_p->local_uid] = -1; + AssertFatal(ue_context_pP->local_uid < NUMBER_OF_UE_MAX, "local_uid invalid (%d<%d) for UE %x!", ue_context_pP->local_uid, NUMBER_OF_UE_MAX, rnti); + ue_module_id = oai_emulation.info.eNB_ue_local_uid_to_ue_module_id[enb_mod_idP][ue_context_pP->local_uid]; + AssertFatal(ue_module_id < NUMBER_OF_UE_MAX, "ue_module_id invalid (%d<%d) for UE %x!", ue_module_id, NUMBER_OF_UE_MAX, rnti); + oai_emulation.info.eNB_ue_local_uid_to_ue_module_id[enb_mod_idP][ue_context_pP->local_uid] = -1; oai_emulation.info.eNB_ue_module_id_to_rnti[enb_mod_idP][ue_module_id] = NOT_A_RNTI; #endif #endif - ue_context_p->ue_context.Status = RRC_IDLE; + rrc_mac_remove_ue(enb_mod_idP,rnti); rrc_rlc_remove_ue(&ctxt); pdcp_remove_UE(&ctxt); rrc_eNB_remove_ue_context( &ctxt, &eNB_rrc_inst[enb_mod_idP], - ue_context_p); + (struct rrc_eNB_ue_context_s*) ue_context_pP); } } @@ -851,6 +860,9 @@ rrc_eNB_process_RRCConnectionSetupComplete( PROTOCOL_RRC_CTXT_UE_FMT" [RAPROC] Logical Channel UL-DCCH, " "processing RRCConnectionSetupComplete from UE\n", PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP)); + T(T_ENB_RRC_CONNECTION_SETUP_COMPLETE, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->frame), + T_INT(ctxt_pP->subframe), T_INT(ctxt_pP->rnti)); + #if defined(ENABLE_USE_MME) if (EPC_MODE_ENABLED == 1) { @@ -881,6 +893,9 @@ rrc_eNB_generate_SecurityModeCommand( uint8_t buffer[100]; uint8_t size; + T(T_ENB_RRC_SECURITY_MODE_COMMAND, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->frame), + T_INT(ctxt_pP->subframe), T_INT(ctxt_pP->rnti)); + size = do_SecurityModeCommand( ctxt_pP, buffer, @@ -922,14 +937,14 @@ rrc_eNB_generate_SecurityModeCommand( rrc_eNB_mui, size); - pdcp_rrc_data_req( - ctxt_pP, - DCCH, - rrc_eNB_mui++, - SDU_CONFIRM_NO, - size, - buffer, - PDCP_TRANSMISSION_MODE_CONTROL); + rrc_data_req( + ctxt_pP, + DCCH, + rrc_eNB_mui++, + SDU_CONFIRM_NO, + size, + buffer, + PDCP_TRANSMISSION_MODE_CONTROL); } @@ -945,6 +960,9 @@ rrc_eNB_generate_UECapabilityEnquiry( uint8_t buffer[100]; uint8_t size; + T(T_ENB_RRC_UE_CAPABILITY_ENQUIRY, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->frame), + T_INT(ctxt_pP->subframe), T_INT(ctxt_pP->rnti)); + size = do_UECapabilityEnquiry( ctxt_pP, buffer, @@ -973,14 +991,14 @@ rrc_eNB_generate_UECapabilityEnquiry( rrc_eNB_mui, size); - pdcp_rrc_data_req( - ctxt_pP, - DCCH, - rrc_eNB_mui++, - SDU_CONFIRM_NO, - size, - buffer, - PDCP_TRANSMISSION_MODE_CONTROL); + rrc_data_req( + ctxt_pP, + DCCH, + rrc_eNB_mui++, + SDU_CONFIRM_NO, + size, + buffer, + PDCP_TRANSMISSION_MODE_CONTROL); } @@ -997,6 +1015,9 @@ rrc_eNB_generate_RRCConnectionReject( int cnt; #endif + T(T_ENB_RRC_CONNECTION_REJECT, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->frame), + T_INT(ctxt_pP->subframe), T_INT(ctxt_pP->rnti)); + 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); @@ -1040,6 +1061,9 @@ rrc_eNB_generate_RRCConnectionReestablishmentReject( int cnt; #endif + T(T_ENB_RRC_CONNECTION_REESTABLISHMENT_REJECT, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->frame), + T_INT(ctxt_pP->subframe), T_INT(ctxt_pP->rnti)); + eNB_rrc_inst[ctxt_pP->module_id].carrier[CC_id].Srb0.Tx_buffer.payload_size = do_RRCConnectionReestablishmentReject(ctxt_pP->module_id, (uint8_t*) eNB_rrc_inst[ctxt_pP->module_id].carrier[CC_id].Srb0.Tx_buffer.Payload); @@ -1082,9 +1106,14 @@ rrc_eNB_generate_RRCConnectionRelease( uint8_t buffer[RRC_BUF_SIZE]; uint16_t size; + T(T_ENB_RRC_CONNECTION_RELEASE, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->frame), + T_INT(ctxt_pP->subframe), T_INT(ctxt_pP->rnti)); + memset(buffer, 0, RRC_BUF_SIZE); size = do_RRCConnectionRelease(ctxt_pP->module_id, buffer,rrc_eNB_get_next_transaction_identifier(ctxt_pP->module_id)); + // set release timer + ue_context_pP->ue_context.ue_release_timer=1; LOG_I(RRC, PROTOCOL_RRC_CTXT_UE_FMT" Logical Channel DL-DCCH, Generate RRCConnectionRelease (bytes %d)\n", @@ -1109,14 +1138,14 @@ rrc_eNB_generate_RRCConnectionRelease( rrc_eNB_mui, size); - pdcp_rrc_data_req( - ctxt_pP, - DCCH, - rrc_eNB_mui++, - SDU_CONFIRM_NO, - size, - buffer, - PDCP_TRANSMISSION_MODE_CONTROL); + rrc_data_req( + ctxt_pP, + DCCH, + rrc_eNB_mui++, + SDU_CONFIRM_NO, + size, + buffer, + PDCP_TRANSMISSION_MODE_CONTROL); } //----------------------------------------------------------------------------- @@ -1207,6 +1236,10 @@ rrc_eNB_generate_defaultRRCConnectionReconfiguration( } #endif + + T(T_ENB_RRC_CONNECTION_RECONFIGURATION, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->frame), + T_INT(ctxt_pP->subframe), T_INT(ctxt_pP->rnti)); + // Configure SRB2 /// SRB2 SRB2_config = CALLOC(1, sizeof(*SRB2_config)); @@ -1736,14 +1769,14 @@ rrc_eNB_generate_defaultRRCConnectionReconfiguration( rrc_eNB_mui, size); - pdcp_rrc_data_req( - ctxt_pP, - DCCH, - rrc_eNB_mui++, - SDU_CONFIRM_NO, - size, - buffer, - PDCP_TRANSMISSION_MODE_CONTROL); + rrc_data_req( + ctxt_pP, + DCCH, + rrc_eNB_mui++, + SDU_CONFIRM_NO, + size, + buffer, + PDCP_TRANSMISSION_MODE_CONTROL); } @@ -1813,14 +1846,14 @@ rrc_eNB_generate_RRCConnectionReconfiguration_SCell( rrc_eNB_mui, size); - pdcp_rrc_data_req( - ctxt_pP, - DCCH, - rrc_eNB_mui++, - SDU_CONFIRM_NO, - size, - buffer, - PDCP_TRANSMISSION_MODE_CONTROL); + rrc_data_req( + ctxt_pP, + DCCH, + rrc_eNB_mui++, + SDU_CONFIRM_NO, + size, + buffer, + PDCP_TRANSMISSION_MODE_CONTROL); return(0); } @@ -1834,6 +1867,9 @@ rrc_eNB_process_MeasurementReport( ) //----------------------------------------------------------------------------- { + T(T_ENB_RRC_MEASUREMENT_REPORT, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->frame), + T_INT(ctxt_pP->subframe), T_INT(ctxt_pP->rnti)); + LOG_I(RRC, "[eNB %d] Frame %d: Process Measurement Report From UE %x (Measurement Id %d)\n", ctxt_pP->module_id, ctxt_pP->frame, ctxt_pP->rnti, (int)measResults2->measId); @@ -1903,6 +1939,9 @@ rrc_eNB_generate_HandoverPreparationInformation( RadioResourceConfigDedicated_t *radioResourceConfigDedicated = CALLOC(1,sizeof(RadioResourceConfigDedicated_t)); */ + T(T_ENB_RRC_HANDOVER_PREPARATION_INFORMATION, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->frame), + T_INT(ctxt_pP->subframe), T_INT(ctxt_pP->rnti)); + handoverInfo->as_config.antennaInfoCommon.antennaPortsCount = 0; //Not used 0- but check value handoverInfo->as_config.sourceDl_CarrierFreq = 36090; //Verify! @@ -1993,6 +2032,9 @@ rrc_eNB_process_handoverPreparationInformation( ) //----------------------------------------------------------------------------- { + T(T_ENB_RRC_HANDOVER_PREPARATION_INFORMATION, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->frame), + T_INT(ctxt_pP->subframe), T_INT(ctxt_pP->rnti)); + LOG_I(RRC, "[eNB %d] Frame %d : Logical Channel UL-DCCH, processing RRCHandoverPreparationInformation, sending RRCConnectionReconfiguration to UE %d \n", @@ -2068,6 +2110,9 @@ rrc_eNB_generate_RRCConnectionReconfiguration_handover( ) //----------------------------------------------------------------------------- { + T(T_ENB_RRC_CONNECTION_RECONFIGURATION, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->frame), + T_INT(ctxt_pP->subframe), T_INT(ctxt_pP->rnti)); + uint8_t buffer[RRC_BUF_SIZE]; uint16_t size; @@ -3024,6 +3069,9 @@ rrc_eNB_process_RRCConnectionReconfigurationComplete( DRB_ToAddModList_t* DRB_configList = ue_context_pP->ue_context.DRB_configList; //SRB_ToAddModList_t* SRB_configList = ue_context_pP->ue_context.SRB_configList; + T(T_ENB_RRC_CONNECTION_RECONFIGURATION_COMPLETE, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->frame), + T_INT(ctxt_pP->subframe), T_INT(ctxt_pP->rnti)); + #if defined(ENABLE_SECURITY) /* Derive the keys from kenb */ @@ -3284,6 +3332,9 @@ rrc_eNB_generate_RRCConnectionSetup( SRB_ToAddMod_t *SRB1_config; int cnt; + T(T_ENB_RRC_CONNECTION_SETUP, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->frame), + T_INT(ctxt_pP->subframe), T_INT(ctxt_pP->rnti)); + SRB_configList = &ue_context_pP->ue_context.SRB_configList; eNB_rrc_inst[ctxt_pP->module_id].carrier[CC_id].Srb0.Tx_buffer.payload_size = do_RRCConnectionSetup(ctxt_pP, @@ -3381,7 +3432,7 @@ rrc_eNB_generate_RRCConnectionSetup( #if defined(ENABLE_ITTI) char //----------------------------------------------------------------------------- -openair_rrc_lite_eNB_init( +openair_rrc_eNB_init( const module_id_t enb_mod_idP ) //----------------------------------------------------------------------------- @@ -3394,13 +3445,13 @@ openair_rrc_lite_eNB_init( #if defined(ENABLE_ITTI) //----------------------------------------------------------------------------- char -openair_rrc_lite_eNB_configuration( +openair_rrc_eNB_configuration( const module_id_t enb_mod_idP, RrcConfigurationReq* configuration ) #else char -openair_rrc_lite_eNB_init( +openair_rrc_eNB_init( const module_id_t enb_mod_idP ) #endif @@ -3429,7 +3480,7 @@ openair_rrc_lite_eNB_init( // for (j = 0; j < NUMBER_OF_UE_MAX; j++) { // eNB_rrc_inst[ctxt.module_id].ciphering_algorithm[j] = SecurityAlgorithmConfig__cipheringAlgorithm_eea0; // eNB_rrc_inst[ctxt.module_id].integrity_algorithm[j] = SecurityAlgorithmConfig__integrityProtAlgorithm_eia2; - // rrc_lite_eNB_init_security(enb_mod_idP, j); + // rrc_eNB_init_security(enb_mod_idP, j); // } // } eNB_rrc_inst[ctxt.module_id].Nb_ue = 0; @@ -3556,6 +3607,10 @@ rrc_eNB_decode_ccch( int i, rval; struct rrc_eNB_ue_context_s* ue_context_p = NULL; uint64_t random_value = 0; + int stmsi_received = 0; + + T(T_ENB_RRC_UL_CCCH_DATA_IN, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->frame), + T_INT(ctxt_pP->subframe), T_INT(ctxt_pP->rnti)); //memset(ul_ccch_msg,0,sizeof(UL_CCCH_Message_t)); @@ -3627,6 +3682,9 @@ rrc_eNB_decode_ccch( break; case UL_CCCH_MessageType__c1_PR_rrcConnectionReestablishmentRequest: + T(T_ENB_RRC_CONNECTION_REESTABLISHMENT_REQUEST, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->frame), + T_INT(ctxt_pP->subframe), T_INT(ctxt_pP->rnti)); + #ifdef RRC_MSG_PRINT LOG_F(RRC,"[MSG] RRC Connection Reestablishement Request\n"); @@ -3669,6 +3727,9 @@ rrc_eNB_decode_ccch( break; case UL_CCCH_MessageType__c1_PR_rrcConnectionRequest: + T(T_ENB_RRC_CONNECTION_REQUEST, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->frame), + T_INT(ctxt_pP->subframe), T_INT(ctxt_pP->rnti)); + #ifdef RRC_MSG_PRINT LOG_F(RRC,"[MSG] RRC Connection Request\n"); @@ -3725,15 +3786,19 @@ rrc_eNB_decode_ccch( 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?)" + + //#warning "TODO: stmsi_exist: remove UE from MAC/PHY (how?)" + LOG_I(RRC," S-TMSI exists, ue_context_p %p\n",ue_context_p); + stmsi_received=1; + ue_context_p->ue_context.rnti = ctxt_pP->rnti; // AssertFatal(0 == 1, "TODO: remove UE from MAC/PHY (how?)"); - ue_context_p = NULL; + // 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; } - 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, @@ -3768,18 +3833,26 @@ rrc_eNB_decode_ccch( #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, - 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.establishment_cause); + if (stmsi_received==0) + 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, + 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.establishment_cause); + else + LOG_I(RRC, PROTOCOL_RRC_CTXT_UE_FMT" Accept new connection from UE MME code %u TMSI %u cause %u\n", + PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP), + 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.establishment_cause); #else LOG_I(RRC, PROTOCOL_RRC_CTXT_UE_FMT" Accept new connection for UE random UE identity (0x%" PRIx64 ")\n", PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP), ue_context_p->ue_context.random_ue_identity); #endif - eNB_rrc_inst[ctxt_pP->module_id].Nb_ue++; + if (stmsi_received == 0) + eNB_rrc_inst[ctxt_pP->module_id].Nb_ue++; } else { // no context available @@ -3892,6 +3965,9 @@ rrc_eNB_decode_dcch( int i; struct rrc_eNB_ue_context_s* ue_context_p = NULL; + T(T_ENB_RRC_UL_DCCH_DATA_IN, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->frame), + T_INT(ctxt_pP->subframe), T_INT(ctxt_pP->rnti)); + if ((Srb_id != 1) && (Srb_id != 2)) { LOG_E(RRC, PROTOCOL_RRC_CTXT_UE_FMT" Received message on SRB%d, should not have ...\n", PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP), @@ -4039,6 +4115,9 @@ rrc_eNB_decode_dcch( break; case UL_DCCH_MessageType__c1_PR_rrcConnectionReestablishmentComplete: + T(T_ENB_RRC_CONNECTION_REESTABLISHMENT_COMPLETE, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->frame), + T_INT(ctxt_pP->subframe), T_INT(ctxt_pP->rnti)); + #ifdef RRC_MSG_PRINT LOG_F(RRC,"[MSG] RRC Connection Reestablishment Complete\n"); @@ -4113,6 +4192,9 @@ rrc_eNB_decode_dcch( break; case UL_DCCH_MessageType__c1_PR_securityModeComplete: + T(T_ENB_RRC_SECURITY_MODE_COMPLETE, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->frame), + T_INT(ctxt_pP->subframe), T_INT(ctxt_pP->rnti)); + #ifdef RRC_MSG_PRINT LOG_F(RRC,"[MSG] RRC Security Mode Complete\n"); @@ -4155,6 +4237,9 @@ rrc_eNB_decode_dcch( break; case UL_DCCH_MessageType__c1_PR_securityModeFailure: + T(T_ENB_RRC_SECURITY_MODE_FAILURE, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->frame), + T_INT(ctxt_pP->subframe), T_INT(ctxt_pP->rnti)); + #ifdef RRC_MSG_PRINT LOG_F(RRC,"[MSG] RRC Security Mode Failure\n"); @@ -4192,6 +4277,9 @@ rrc_eNB_decode_dcch( break; case UL_DCCH_MessageType__c1_PR_ueCapabilityInformation: + T(T_ENB_RRC_UE_CAPABILITY_INFORMATION, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->frame), + T_INT(ctxt_pP->subframe), T_INT(ctxt_pP->rnti)); + #ifdef RRC_MSG_PRINT LOG_F(RRC,"[MSG] RRC UECapablility Information \n"); @@ -4254,9 +4342,15 @@ rrc_eNB_decode_dcch( break; case UL_DCCH_MessageType__c1_PR_ulHandoverPreparationTransfer: + T(T_ENB_RRC_UL_HANDOVER_PREPARATION_TRANSFER, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->frame), + T_INT(ctxt_pP->subframe), T_INT(ctxt_pP->rnti)); + break; case UL_DCCH_MessageType__c1_PR_ulInformationTransfer: + T(T_ENB_RRC_UL_INFORMATION_TRANSFER, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->frame), + T_INT(ctxt_pP->subframe), T_INT(ctxt_pP->rnti)); + #ifdef RRC_MSG_PRINT LOG_F(RRC,"[MSG] RRC UL Information Transfer \n"); @@ -4290,27 +4384,48 @@ rrc_eNB_decode_dcch( break; case UL_DCCH_MessageType__c1_PR_counterCheckResponse: + T(T_ENB_RRC_COUNTER_CHECK_RESPONSE, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->frame), + T_INT(ctxt_pP->subframe), T_INT(ctxt_pP->rnti)); + break; #ifdef Rel10 case UL_DCCH_MessageType__c1_PR_ueInformationResponse_r9: + T(T_ENB_RRC_UE_INFORMATION_RESPONSE_R9, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->frame), + T_INT(ctxt_pP->subframe), T_INT(ctxt_pP->rnti)); + break; case UL_DCCH_MessageType__c1_PR_proximityIndication_r9: + T(T_ENB_RRC_PROXIMITY_INDICATION_R9, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->frame), + T_INT(ctxt_pP->subframe), T_INT(ctxt_pP->rnti)); + break; case UL_DCCH_MessageType__c1_PR_rnReconfigurationComplete_r10: + T(T_ENB_RRC_RECONFIGURATION_COMPLETE_R10, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->frame), + T_INT(ctxt_pP->subframe), T_INT(ctxt_pP->rnti)); + break; case UL_DCCH_MessageType__c1_PR_mbmsCountingResponse_r10: + T(T_ENB_RRC_MBMS_COUNTING_RESPONSE_R10, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->frame), + T_INT(ctxt_pP->subframe), T_INT(ctxt_pP->rnti)); + break; case UL_DCCH_MessageType__c1_PR_interFreqRSTDMeasurementIndication_r10: + T(T_ENB_RRC_INTER_FREQ_RSTD_MEASUREMENT_INDICATION, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->frame), + T_INT(ctxt_pP->subframe), T_INT(ctxt_pP->rnti)); + break; #endif default: + T(T_ENB_RRC_UNKNOW_MESSAGE, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->frame), + T_INT(ctxt_pP->subframe), T_INT(ctxt_pP->rnti)); + LOG_E(RRC, PROTOCOL_RRC_CTXT_UE_FMT" Unknown message %s:%u\n", PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP), __FILE__, __LINE__); @@ -4443,7 +4558,7 @@ rrc_enb_task( /* Messages from eNB app */ case RRC_CONFIGURATION_REQ: LOG_I(RRC, "[eNB %d] Received %s\n", instance, msg_name_p); - openair_rrc_lite_eNB_configuration(ENB_INSTANCE_TO_MODULE_ID(instance), &RRC_CONFIGURATION_REQ(msg_p)); + openair_rrc_eNB_configuration(ENB_INSTANCE_TO_MODULE_ID(instance), &RRC_CONFIGURATION_REQ(msg_p)); break; # if ENABLE_RAL diff --git a/openair2/RRC/LITE/rrc_eNB_S1AP.c b/openair2/RRC/LITE/rrc_eNB_S1AP.c index e5738472c8098866dde11e1d867dc9736ef837f3..1414c4e1b305f116b2fe1121722010c4cb74e0f1 100644 --- a/openair2/RRC/LITE/rrc_eNB_S1AP.c +++ b/openair2/RRC/LITE/rrc_eNB_S1AP.c @@ -844,15 +844,15 @@ rrc_eNB_process_S1AP_DOWNLINK_NAS( LOG_F(RRC,"\n"); #endif /* Transfer data to PDCP */ - pdcp_rrc_data_req ( - &ctxt, - DCCH, - *rrc_eNB_mui++, - SDU_CONFIRM_NO, - length, - buffer, - PDCP_TRANSMISSION_MODE_CONTROL); - + rrc_data_req ( + &ctxt, + DCCH, + *rrc_eNB_mui++, + SDU_CONFIRM_NO, + length, + buffer, + PDCP_TRANSMISSION_MODE_CONTROL); + return (0); } } diff --git a/openair2/UTIL/LOG/log.h b/openair2/UTIL/LOG/log.h index c6abbfa001033107c8e1c57671f6e000d8514c0e..dce5a190e4d454b3fe8f60ed4fc1a9ada4e6ebdc 100755 --- a/openair2/UTIL/LOG/log.h +++ b/openair2/UTIL/LOG/log.h @@ -147,26 +147,40 @@ extern "C" { // debugging macros #ifdef USER_MODE -#define LOG_G(c, x...) logIt(c, LOG_EMERG, x) -#define LOG_A(c, x...) logIt(c, LOG_ALERT, x) -#define LOG_C(c, x...) logIt(c, LOG_CRIT, x) -#define LOG_E(c, x...) logIt(c, LOG_ERR, x) -#define LOG_W(c, x...) logIt(c, LOG_WARNING, x) -#define LOG_N(c, x...) logIt(c, LOG_NOTICE, x) -#define LOG_I(c, x...) logIt(c, LOG_INFO, x) -#define LOG_D(c, x...) logIt(c, LOG_DEBUG, x) -#define LOG_F(c, x...) logIt(c, LOG_FILE, x) // log to a file, useful for the MSC chart generation -#define LOG_T(c, x...) logIt(c, LOG_TRACE, x) -#else -#define LOG_G(c, x...) printk(x) -#define LOG_A(c, x...) printk(x) -#define LOG_C(c, x...) printk(x) -#define LOG_E(c, x...) printk(x) -#define LOG_W(c, x...) printk(x) -#define LOG_N(c, x...) printk(x) -#define LOG_I(c, x...) printk(x) -#define LOG_D(c, x...) printk(x) -#define LOG_T(c, x...) printk(x) +# if T_TRACER +# include "T.h" +# define LOG_I(c, x...) T(T_LEGACY_ ## c ## _INFO, T_PRINTF(x)) +# define LOG_W(c, x...) T(T_LEGACY_ ## c ## _WARNING, T_PRINTF(x)) +# define LOG_E(c, x...) T(T_LEGACY_ ## c ## _ERROR, T_PRINTF(x)) +# define LOG_D(c, x...) T(T_LEGACY_ ## c ## _DEBUG, T_PRINTF(x)) +# define LOG_T(c, x...) T(T_LEGACY_ ## c ## _TRACE, T_PRINTF(x)) +# define LOG_G(c, x...) /* */ +# define LOG_A(c, x...) /* */ +# define LOG_C(c, x...) /* */ +# define LOG_N(c, x...) /* */ +# define LOG_F(c, x...) /* */ +# else /* T_TRACER */ +# define LOG_G(c, x...) logIt(c, LOG_EMERG, x) +# define LOG_A(c, x...) logIt(c, LOG_ALERT, x) +# define LOG_C(c, x...) logIt(c, LOG_CRIT, x) +# define LOG_E(c, x...) logIt(c, LOG_ERR, x) +# define LOG_W(c, x...) logIt(c, LOG_WARNING, x) +# define LOG_N(c, x...) logIt(c, LOG_NOTICE, x) +# define LOG_I(c, x...) logIt(c, LOG_INFO, x) +# define LOG_D(c, x...) logIt(c, LOG_DEBUG, x) +# define LOG_F(c, x...) logIt(c, LOG_FILE, x) // log to a file, useful for the MSC chart generation +# define LOG_T(c, x...) logIt(c, LOG_TRACE, x) +# endif /* T_TRACER */ +#else /* USER_MODE */ +# define LOG_G(c, x...) printk(x) +# define LOG_A(c, x...) printk(x) +# define LOG_C(c, x...) printk(x) +# define LOG_E(c, x...) printk(x) +# define LOG_W(c, x...) printk(x) +# define LOG_N(c, x...) printk(x) +# define LOG_I(c, x...) printk(x) +# define LOG_D(c, x...) printk(x) +# define LOG_T(c, x...) printk(x) #endif /* @}*/ diff --git a/openair2/UTIL/LOG/vcd_signal_dumper.c b/openair2/UTIL/LOG/vcd_signal_dumper.c index 31ce2e0d71078bd4d12586db7a27ba861a61a6d9..78e481f3d6c43a7be089b4245342229990d3d082 100644 --- a/openair2/UTIL/LOG/vcd_signal_dumper.c +++ b/openair2/UTIL/LOG/vcd_signal_dumper.c @@ -118,7 +118,62 @@ const char* eurecomVariablesNames[] = { "mp_alloc", "mp_free", "ue_inst_cnt_rx", - "ue_inst_cnt_tx" + "ue_inst_cnt_tx", + "dci_info", + "ue0_BSR", + "ue0_BO", + "ue0_scheduled", + "ue0_timing_advance", + "ue0_SR_ENERGY", + "ue0_SR_THRES", + "ue0_rssi0", + "ue0_rssi1", + "ue0_rssi2", + "ue0_rssi3", + "ue0_rssi4", + "ue0_rssi5", + "ue0_rssi6", + "ue0_rssi7", + "ue0_res0", + "ue0_res1", + "ue0_res2", + "ue0_res3", + "ue0_res4", + "ue0_res5", + "ue0_res6", + "ue0_res7", + "ue0_MCS0", + "ue0_MCS1", + "ue0_MCS2", + "ue0_MCS3", + "ue0_MCS4", + "ue0_MCS5", + "ue0_MCS6", + "ue0_MCS7", + "ue0_RB0", + "ue0_RB1", + "ue0_RB2", + "ue0_RB3", + "ue0_RB4", + "ue0_RB5", + "ue0_RB6", + "ue0_RB7", + "ue0_ROUND0", + "ue0_ROUND1", + "ue0_ROUND2", + "ue0_ROUND3", + "ue0_ROUND4", + "ue0_ROUND5", + "ue0_ROUND6", + "ue0_ROUND7", + "ue0_SFN0", + "ue0_SFN1", + "ue0_SFN2", + "ue0_SFN3", + "ue0_SFN4", + "ue0_SFN5", + "ue0_SFN6", + "ue0_SFN7", }; const char* eurecomFunctionsNames[] = { @@ -200,7 +255,15 @@ const char* eurecomFunctionsNames[] = { "macxface_phy_config_sib2_eNB", "macxface_phy_config_dedicated_eNB", "phy_ue_compute_prach", - "phy_enb_ulsch_decoding", + "phy_enb_ulsch_msg3", + "phy_enb_ulsch_decoding0", + "phy_enb_ulsch_decoding1", + "phy_enb_ulsch_decoding2", + "phy_enb_ulsch_decoding3", + "phy_enb_ulsch_decoding4", + "phy_enb_ulsch_decoding5", + "phy_enb_ulsch_decoding6", + "phy_enb_ulsch_decoding7", "phy_enb_sfgen", "phy_enb_prach_rx", "phy_enb_pdcch_tx", diff --git a/openair2/UTIL/LOG/vcd_signal_dumper.h b/openair2/UTIL/LOG/vcd_signal_dumper.h index 9ca55846fd2aef75d3da598dbdd4f250a6591db6..06292a5212ba4d88230b74941fbc3e6f17c155d1 100644 --- a/openair2/UTIL/LOG/vcd_signal_dumper.h +++ b/openair2/UTIL/LOG/vcd_signal_dumper.h @@ -91,6 +91,61 @@ typedef enum { VCD_SIGNAL_DUMPER_VARIABLE_MP_FREE, VCD_SIGNAL_DUMPER_VARIABLES_UE_INST_CNT_RX, VCD_SIGNAL_DUMPER_VARIABLES_UE_INST_CNT_TX, + VCD_SIGNAL_DUMPER_VARIABLES_DCI_INFO, + VCD_SIGNAL_DUMPER_VARIABLES_UE0_BSR, + VCD_SIGNAL_DUMPER_VARIABLES_UE0_BO, + VCD_SIGNAL_DUMPER_VARIABLES_UE0_SCHEDULED, + VCD_SIGNAL_DUMPER_VARIABLES_UE0_TIMING_ADVANCE, + VCD_SIGNAL_DUMPER_VARIABLES_UE0_SR_ENERGY, + VCD_SIGNAL_DUMPER_VARIABLES_UE0_SR_THRES, + VCD_SIGNAL_DUMPER_VARIABLES_UE0_RSSI0, + VCD_SIGNAL_DUMPER_VARIABLES_UE0_RSSI1, + VCD_SIGNAL_DUMPER_VARIABLES_UE0_RSSI2, + VCD_SIGNAL_DUMPER_VARIABLES_UE0_RSSI3, + VCD_SIGNAL_DUMPER_VARIABLES_UE0_RSSI4, + VCD_SIGNAL_DUMPER_VARIABLES_UE0_RSSI5, + VCD_SIGNAL_DUMPER_VARIABLES_UE0_RSSI6, + VCD_SIGNAL_DUMPER_VARIABLES_UE0_RSSI7, + VCD_SIGNAL_DUMPER_VARIABLES_UE0_RES0, + VCD_SIGNAL_DUMPER_VARIABLES_UE0_RES1, + VCD_SIGNAL_DUMPER_VARIABLES_UE0_RES2, + VCD_SIGNAL_DUMPER_VARIABLES_UE0_RES3, + VCD_SIGNAL_DUMPER_VARIABLES_UE0_RES4, + VCD_SIGNAL_DUMPER_VARIABLES_UE0_RES5, + VCD_SIGNAL_DUMPER_VARIABLES_UE0_RES6, + VCD_SIGNAL_DUMPER_VARIABLES_UE0_RES7, + VCD_SIGNAL_DUMPER_VARIABLES_UE0_MCS0, + VCD_SIGNAL_DUMPER_VARIABLES_UE0_MCS1, + VCD_SIGNAL_DUMPER_VARIABLES_UE0_MCS2, + VCD_SIGNAL_DUMPER_VARIABLES_UE0_MCS3, + VCD_SIGNAL_DUMPER_VARIABLES_UE0_MCS4, + VCD_SIGNAL_DUMPER_VARIABLES_UE0_MCS5, + VCD_SIGNAL_DUMPER_VARIABLES_UE0_MCS6, + VCD_SIGNAL_DUMPER_VARIABLES_UE0_MCS7, + VCD_SIGNAL_DUMPER_VARIABLES_UE0_RB0, + VCD_SIGNAL_DUMPER_VARIABLES_UE0_RB1, + VCD_SIGNAL_DUMPER_VARIABLES_UE0_RB2, + VCD_SIGNAL_DUMPER_VARIABLES_UE0_RB3, + VCD_SIGNAL_DUMPER_VARIABLES_UE0_RB4, + VCD_SIGNAL_DUMPER_VARIABLES_UE0_RB5, + VCD_SIGNAL_DUMPER_VARIABLES_UE0_RB6, + VCD_SIGNAL_DUMPER_VARIABLES_UE0_RB7, + VCD_SIGNAL_DUMPER_VARIABLES_UE0_ROUND0, + VCD_SIGNAL_DUMPER_VARIABLES_UE0_ROUND1, + VCD_SIGNAL_DUMPER_VARIABLES_UE0_ROUND2, + VCD_SIGNAL_DUMPER_VARIABLES_UE0_ROUND3, + VCD_SIGNAL_DUMPER_VARIABLES_UE0_ROUND4, + VCD_SIGNAL_DUMPER_VARIABLES_UE0_ROUND5, + VCD_SIGNAL_DUMPER_VARIABLES_UE0_ROUND6, + VCD_SIGNAL_DUMPER_VARIABLES_UE0_ROUND7, + VCD_SIGNAL_DUMPER_VARIABLES_UE0_SFN0, + VCD_SIGNAL_DUMPER_VARIABLES_UE0_SFN1, + VCD_SIGNAL_DUMPER_VARIABLES_UE0_SFN2, + VCD_SIGNAL_DUMPER_VARIABLES_UE0_SFN3, + VCD_SIGNAL_DUMPER_VARIABLES_UE0_SFN4, + VCD_SIGNAL_DUMPER_VARIABLES_UE0_SFN5, + VCD_SIGNAL_DUMPER_VARIABLES_UE0_SFN6, + VCD_SIGNAL_DUMPER_VARIABLES_UE0_SFN7, VCD_SIGNAL_DUMPER_VARIABLES_LAST, VCD_SIGNAL_DUMPER_VARIABLES_END = VCD_SIGNAL_DUMPER_VARIABLES_LAST, } vcd_signal_dump_variables; @@ -174,7 +229,15 @@ typedef enum { VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_CONFIG_SIB2_ENB, VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_CONFIG_DEDICATED_ENB, VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_UE_COMPUTE_PRACH, - VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_ULSCH_DECODING, + VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_ULSCH_MSG3, + VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_ULSCH_DECODING0, + VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_ULSCH_DECODING1, + VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_ULSCH_DECODING2, + VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_ULSCH_DECODING3, + VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_ULSCH_DECODING4, + VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_ULSCH_DECODING5, + VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_ULSCH_DECODING6, + VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_ULSCH_DECODING7, VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_SFGEN, VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_PRACH_RX, VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_PDCCH_TX, @@ -312,6 +375,16 @@ void vcd_signal_dumper_dump_function_by_name(vcd_signal_dump_functions function extern int ouput_vcd; +#if T_TRACER + +#define VCD_SIGNAL_DUMPER_INIT(x) /* nothing */ +#define VCD_SIGNAL_DUMPER_CLOSE() /* nothing */ +#define VCD_SIGNAL_DUMPER_CREATE_HEADER() /* nothing */ +#define VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(var, val) T_VCD_VARIABLE(var, val) +#define VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(var, val) T_VCD_FUNCTION(var, val) + +#else /* T_TRACER */ + #if defined(ENABLE_VCD) #define VCD_SIGNAL_DUMPER_INIT(aRgUmEnT) vcd_signal_dumper_init(aRgUmEnT) #define VCD_SIGNAL_DUMPER_CLOSE() vcd_signal_dumper_close() @@ -326,5 +399,7 @@ extern int ouput_vcd; #define VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(vAr1,vAr2) #endif +#endif /* T_TRACER */ + #endif /* !defined (VCD_SIGNAL_DUMPER_H_) */ diff --git a/openair3/NAS/TOOLS/network.h b/openair3/NAS/TOOLS/network.h index 54bf61a7b43c5ec07ae5b469ca10f7be9c13aff8..b2c7977d2d15f91133091d1b50e06987a440bb57 100644 --- a/openair3/NAS/TOOLS/network.h +++ b/openair3/NAS/TOOLS/network.h @@ -58,21 +58,23 @@ Description Defines a list of PLMN network operators #define SFR1 1 #define SFR2 2 #define SFR3 3 -#define TM1 4 -#define FCT1 5 -#define VDF1 6 -#define VDF2 7 -#define VDF3 8 -#define VDF4 9 -#define VDF5 10 +#define OAI_LTEBOX 4 +#define TM1 5 +#define FCT1 6 +#define VDF1 7 +#define VDF2 8 +#define VDF3 9 +#define VDF4 10 +#define VDF5 11 -#define SELECTED_PLMN SFR1 +#define SELECTED_PLMN OAI_LTEBOX //SFR1 #define TEST_PLMN {0,0,0x0f,1,1,0} // 00101 #define SFR_PLMN_1 {0,2,0x0f,8,0,1} // 20810 #define SFR_PLMN_2 {0,2,0x0f,8,1,1} // 20811 #define SFR_PLMN_3 {0,2,0x0f,8,3,1} // 20813 +#define OAI_LTEBOX_PLMN {0,2,0x0f,8,3,9} //20893 #define TM_PLMN_1 {1,3,0,0,8,2} // 310280 #define FCT_PLMN_1 {1,3,8,0,2,0} // 310028 #define VDF_PLMN_1 {2,2,0x0f,2,0,1} // 22210 @@ -81,6 +83,7 @@ Description Defines a list of PLMN network operators #define VDF_PLMN_4 {6,2,0x0f,2,0x0f,2} // 2622 #define VDF_PLMN_5 {6,2,0x0f,2,0x0f,4} // 2624 + /****************************************************************************/ /************************ G L O B A L T Y P E S ************************/ /****************************************************************************/ @@ -110,6 +113,7 @@ network_record_t network_records[] = { {20810, SFR_PLMN_1, "SFR France", "SFR", 0x0001, 0xfffd}, {20811, SFR_PLMN_2, "SFR France", "SFR", 0x0001, 0xfffd}, {20813, SFR_PLMN_3, "SFR France", "SFR", 0x0001, 0xfffd}, + {20893, OAI_LTEBOX_PLMN, "OAI LTEBOX", "OAIALU", 0x0001, 0xfffd}, {310280,TM_PLMN_1, "T-Mobile USA", "T-Mobile", 0x0001, 0xfffd}, {310028,FCT_PLMN_1, "FICTITIOUS USA", "FICTITIO", 0x0001, 0xfffd}, {22210, VDF_PLMN_1, "Vodafone Italia", "VODAFONE", 0x0001, 0xfffd}, diff --git a/openair3/NAS/TOOLS/ue_data.c b/openair3/NAS/TOOLS/ue_data.c index 5a463ad094cb8c9e404b421a449aaf1cc9cf792c..e99cb9b84cc6741ee3cd42f52ffac936885d72c5 100644 --- a/openair3/NAS/TOOLS/ue_data.c +++ b/openair3/NAS/TOOLS/ue_data.c @@ -354,6 +354,36 @@ static void _gen_emm_data(emm_nvdata_t* data) data->rplmn.MNCdigit2 = 0; data->rplmn.MNCdigit3 = 0xf; #endif +#if (SELECTED_PLMN == OAI_LTEBOX) + /* + * International Mobile Subscriber Identity + * IMSI = MCC + MNC + MSIN = 208 (France) + 93 (OAI) + 00001110 + */ + data->imsi.length = 8; + data->imsi.u.num.parity = ODD_PARITY; // Type of identity = IMSI, even + data->imsi.u.num.digit1 = 2; // MCC digit 1 + data->imsi.u.num.digit2 = 0; // MCC digit 2 + data->imsi.u.num.digit3 = 8; // MCC digit 3 + data->imsi.u.num.digit4 = 9; // MNC digit 1 + data->imsi.u.num.digit5 = 3; // MNC digit 2 + data->imsi.u.num.digit6 = 0; // MNC digit 3 + data->imsi.u.num.digit7 = 1; + data->imsi.u.num.digit8 = 0; + data->imsi.u.num.digit9 = 0; + data->imsi.u.num.digit10 = 0; + data->imsi.u.num.digit11 = 0; + data->imsi.u.num.digit12 = 1; + data->imsi.u.num.digit13 = 1; + data->imsi.u.num.digit14 = 1; + data->imsi.u.num.digit15 = 1; + + data->rplmn.MCCdigit1 = 2; + data->rplmn.MCCdigit2 = 0; + data->rplmn.MCCdigit3 = 8; + data->rplmn.MNCdigit1 = 9; + data->rplmn.MNCdigit2 = 3; + data->rplmn.MNCdigit3 = 0xf; +#endif #if (SELECTED_PLMN == TEST1) /* * International Mobile Subscriber Identity diff --git a/openair3/NAS/TOOLS/usim_data.c b/openair3/NAS/TOOLS/usim_data.c index ea046245edbe0189158324f4764db2ddcfba23cf..ffde00c26896dabf9b91ef8a0a11bf918150ba36 100644 --- a/openair3/NAS/TOOLS/usim_data.c +++ b/openair3/NAS/TOOLS/usim_data.c @@ -61,7 +61,7 @@ Description Implements the utility used to generate data stored in the #define KSI USIM_KSI_NOT_AVAILABLE #define KSI_ASME USIM_KSI_NOT_AVAILABLE -#define INT_ALGO USIM_INT_EIA1 +#define INT_ALGO USIM_INT_EIA2 #define ENC_ALGO USIM_ENC_EEA0 #define SECURITY_ALGORITHMS (ENC_ALGO | INT_ALGO) @@ -159,12 +159,13 @@ int main (int argc, const char* argv[]) usim_data.imsi.u.num.digit15 = 0b1111; #endif #if (SELECTED_PLMN == SFR1) -#warning "IMSI 208.10.00001234" + /* * International Mobile Subscriber Identity * IMSI = MCC + MNC + MSIN = 208 (France) + 10 (SFR) + 00001234 */ - #warning "IMSI 208.10.00001234" +#warning "IMSI 208.10.00001234" + usim_data.imsi.length = 8; usim_data.imsi.u.num.parity = EVEN_PARITY; // Parity: even usim_data.imsi.u.num.digit1 = 2; // MCC digit 1 @@ -183,6 +184,31 @@ int main (int argc, const char* argv[]) usim_data.imsi.u.num.digit14 = 4; usim_data.imsi.u.num.digit15 = 0b1111; #endif +#if (SELECTED_PLMN == OAI_LTEBOX) +#warning "IMSI 208.93.00001111" + /* + * International Mobile Subscriber Identity + * IMSI = MCC + MNC + MSIN = 208 (France) + 10 (SFR) + 00001234 + */ + #warning "IMSI 208.93.0100001110" + usim_data.imsi.length = 8; + usim_data.imsi.u.num.parity = ODD_PARITY; // Parity: even + usim_data.imsi.u.num.digit1 = 2; // MCC digit 1 + usim_data.imsi.u.num.digit2 = 0; // MCC digit 2 + usim_data.imsi.u.num.digit3 = 8; // MCC digit 3 + usim_data.imsi.u.num.digit4 = 9; // MNC digit 1 + usim_data.imsi.u.num.digit5 = 3; // MNC digit 2 + usim_data.imsi.u.num.digit6 = 0; // MNC digit 3 + usim_data.imsi.u.num.digit7 = 1; + usim_data.imsi.u.num.digit8 = 0; + usim_data.imsi.u.num.digit9 = 0; + usim_data.imsi.u.num.digit10 = 0; + usim_data.imsi.u.num.digit11 = 0; + usim_data.imsi.u.num.digit12 = 1; + usim_data.imsi.u.num.digit13 = 1; + usim_data.imsi.u.num.digit14 = 1; + usim_data.imsi.u.num.digit15 = 1; +#endif #if (SELECTED_PLMN == TEST1) #warning "IMSI 001.01.000001234" usim_data.imsi.length = 8; @@ -470,13 +496,14 @@ static void _display_usim_data(const usim_data_t* data) printf("\tparity\t= %s\n", data->imsi.u.num.parity == EVEN_PARITY ? "Even" : "Odd"); digits = (data->imsi.length * 2) - 1 - (data->imsi.u.num.parity == EVEN_PARITY ? 1 : 0); printf("\tdigits\t= %d\n", digits); + printf("\tdigits\t= %u%u%u%u%u%x%u%u%u%u", data->imsi.u.num.digit1, // MCC digit 1 data->imsi.u.num.digit2, // MCC digit 2 data->imsi.u.num.digit3, // MCC digit 3 data->imsi.u.num.digit4, // MNC digit 1 data->imsi.u.num.digit5, // MNC digit 2 - data->imsi.u.num.digit6, // MNC digit 3 + data->imsi.u.num.digit6==0xf?0:data->imsi.u.num.digit6, // MNC digit 3 data->imsi.u.num.digit7, data->imsi.u.num.digit8, data->imsi.u.num.digit9, diff --git a/openair3/NAS/UE/API/USIM/aka_functions.c b/openair3/NAS/UE/API/USIM/aka_functions.c index 7670cbfc0b9e066f75b718380b8f7e86e13c1ea9..1c30a17bfd505254e1b37436d55dca259a527aab 100644 --- a/openair3/NAS/UE/API/USIM/aka_functions.c +++ b/openair3/NAS/UE/API/USIM/aka_functions.c @@ -21,9 +21,21 @@ /*--------- Operator Variant Algorithm Configuration Field --------*/ /*------- Insert your value of OP here -------*/ /* PFT OP used currently in HSS (OPENAIRHSS/auc/kdf.c) */ +#define OAI_LTEBOX + +#ifdef OAI_LTEBOX +//1006020f0a478bf6b699f15c062e42b3 +/*u8 OP[16] = {0xb3, 0x42, 0x2e, 0x06, 0x5c, 0xf1, 0x99, 0xb6, + 0xf6, 0x8b, 0x47, 0x0a, 0x0f, 0x02, 0x06, 0x10 + };*/ +u8 OP[16] = {0x10, 0x06, 0x02, 0x0f, 0x0a, 0x47, 0x8b, 0xf6, + 0xb6, 0x99, 0xf1, 0x5c, 0x06, 0x2e, 0x42, 0xb3 +}; +#else u8 OP[16] = {0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11 }; +#endif /*------- Insert your value of OP here -------*/ /*------------------------------------------------------------------- diff --git a/openair3/NAS/UE/API/USIM/usim_api.c b/openair3/NAS/UE/API/USIM/usim_api.c index 51b99033bc5ee00e3eb5ab79d2b47e7eab5c3388..fe8dc8b35074b8b38c745e7bab232bcfb29f356f 100644 --- a/openair3/NAS/UE/API/USIM/usim_api.c +++ b/openair3/NAS/UE/API/USIM/usim_api.c @@ -77,7 +77,7 @@ Description Implements the API used by the NAS layer to read/write * Subscriber authentication security key */ #define USIM_API_K_SIZE 16 -#define USIM_API_K_VALUE "8BAF473F2F8FD09487CCCBD7097C6862" +#define USIM_API_K_VALUE "fec86ba6eb707ed08905757b1bb44b8f" static uint8_t _usim_api_k[USIM_API_K_SIZE]; @@ -85,9 +85,13 @@ static uint8_t _usim_api_k[USIM_API_K_SIZE]; /* * List of last used Sequence Numbers SQN */ +#define USIM_API_AK_SIZE 6 +#define USIM_API_SQN_SIZE USIM_API_AK_SIZE +#define USIM_API_SQNMS_SIZE USIM_API_SQN_SIZE + static struct _usim_api_data_s { /* Highest sequence number the USIM has ever accepted */ - uint32_t sqn_ms; + uint8_t sqn_ms[USIM_API_SQNMS_SIZE]; /* List of the last used sequence numbers */ #define USIM_API_SQN_LIST_SIZE 32 uint8_t n_sqns; @@ -230,25 +234,25 @@ int usim_api_authenticate(const OctetString* rand_pP, const OctetString* autn_pP /* Compute the cipher key CK = f3K (RAND) */ /* Compute the integrity key IK = f4K (RAND) */ /* Compute the anonymity key AK = f5K (RAND) */ -#define USIM_API_AK_SIZE 6 + u8 ak[USIM_API_AK_SIZE]; f2345(_usim_api_k, rand_pP->value, res_pP->value, ck_pP->value, ik_pP->value, ak); - LOG_TRACE(DEBUG, "USIM-API - res(f2) :%s",dump_octet_string(res_pP)); - LOG_TRACE(DEBUG, "USIM-API - ck(f3) :%s",dump_octet_string(ck_pP)); - LOG_TRACE(DEBUG, "USIM-API - ik(f4) :%s",dump_octet_string(ik_pP)); - LOG_TRACE(DEBUG, "USIM-API - ak(f5) : %02X%02X%02X%02X%02X%02X", + LOG_TRACE(INFO, "USIM-API - res(f2) :%s",dump_octet_string(res_pP)); + LOG_TRACE(INFO, "USIM-API - ck(f3) :%s",dump_octet_string(ck_pP)); + LOG_TRACE(INFO, "USIM-API - ik(f4) :%s",dump_octet_string(ik_pP)); + LOG_TRACE(INFO, "USIM-API - ak(f5) : %02X%02X%02X%02X%02X%02X", ak[0],ak[1],ak[2],ak[3],ak[4],ak[5]); /* Retrieve the sequence number SQN = (SQN ⊕ AK) ⊕ AK */ -#define USIM_API_SQN_SIZE USIM_API_AK_SIZE + u8 sqn[USIM_API_SQN_SIZE]; for (i = 0; i < USIM_API_SQN_SIZE; i++) { sqn[i] = autn_pP->value[i] ^ ak[i]; } - LOG_TRACE(DEBUG, "USIM-API - Retrieved SQN %02X%02X%02X%02X%02X%02X", + LOG_TRACE(INFO, "USIM-API - Retrieved SQN %02X%02X%02X%02X%02X%02X", sqn[0],sqn[1],sqn[2],sqn[3],sqn[4],sqn[5]); /* Compute XMAC = f1K (SQN || RAND || AMF) */ @@ -267,14 +271,15 @@ int usim_api_authenticate(const OctetString* rand_pP, const OctetString* autn_pP USIM_API_XMAC_SIZE) != 0 ) { LOG_TRACE(INFO, "USIM-API - Comparing the XMAC with the MAC included in AUTN Failed"); + rc = RETURNerror; //LOG_FUNC_RETURN (RETURNerror); } else { LOG_TRACE(INFO, "USIM-API - Comparing the XMAC with the MAC included in AUTN Succeeded"); + /* Verify that the received sequence number SQN is in the correct range */ + rc = _usim_api_check_sqn(*(uint32_t*)(sqn), sqn[USIM_API_SQN_SIZE - 1]); } - /* Verify that the received sequence number SQN is in the correct range */ - rc = _usim_api_check_sqn(*(uint32_t*)(sqn), sqn[USIM_API_SQN_SIZE - 1]); if (rc != RETURNok) { /* Synchronisation failure; compute the AUTS parameter */ @@ -283,15 +288,17 @@ int usim_api_authenticate(const OctetString* rand_pP, const OctetString* autn_pP * Conc(SQNMS) = SQNMS ⊕ f5*K(RAND) */ f5star(_usim_api_k, rand_pP->value, ak); -#define USIM_API_SQNMS_SIZE USIM_API_SQN_SIZE + u8 sqn_ms[USIM_API_SQNMS_SIZE]; memset(sqn_ms, 0, USIM_API_SQNMS_SIZE); -#define USIM_API_SQN_MS_SIZE 3 - for (i = 0; i < USIM_API_SQN_MS_SIZE; i++) { -//#warning "LG:BUG HERE TODO" + //#define USIM_API_SQN_MS_SIZE 3 + printf("_usim_api_data.sqn_ms %p\n",_usim_api_data.sqn_ms); + for (i = 0; i < USIM_API_SQNMS_SIZE; i++) { + //#warning "LG:BUG HERE TODO" + printf("i %d: ((uint8_t*)(_usim_api_data.sqn_ms))[USIM_API_SQNMS_SIZE - i] %d\n",i, ((uint8_t*)(_usim_api_data.sqn_ms))[USIM_API_SQNMS_SIZE - i]); sqn_ms[USIM_API_SQNMS_SIZE - i] = - ((uint8_t*)(&_usim_api_data.sqn_ms))[USIM_API_SQN_MS_SIZE - i]; + ((uint8_t*)(_usim_api_data.sqn_ms))[USIM_API_SQNMS_SIZE - i]; } u8 sqnms[USIM_API_SQNMS_SIZE]; @@ -317,6 +324,8 @@ int usim_api_authenticate(const OctetString* rand_pP, const OctetString* autn_pP * AUTS = Conc(SQNMS) || MACS */ memcpy(&auts_pP->value[0], sqnms, USIM_API_SQNMS_SIZE); memcpy(&auts_pP->value[USIM_API_SQNMS_SIZE], macs, USIM_API_MACS_SIZE); + auts_pP->length = USIM_API_SQNMS_SIZE + USIM_API_MACS_SIZE; + LOG_FUNC_RETURN (RETURNerror); } LOG_FUNC_RETURN (RETURNok); diff --git a/openair3/NAS/UE/EMM/Attach.c b/openair3/NAS/UE/EMM/Attach.c index d7bdeb91208bdf4291347ef2515705354e86db06..8a589fa0a0e121b455fce5c343821e0796b6200f 100755 --- a/openair3/NAS/UE/EMM/Attach.c +++ b/openair3/NAS/UE/EMM/Attach.c @@ -249,7 +249,7 @@ int emm_proc_attach(emm_proc_attach_type_t type) esm_sap.data.pdn_connect.is_defined = TRUE; esm_sap.data.pdn_connect.cid = 1; /* TODO: PDN type should be set according to the IP capability of the UE */ - esm_sap.data.pdn_connect.pdn_type = NET_PDN_TYPE_IPV4V6; + esm_sap.data.pdn_connect.pdn_type = NET_PDN_TYPE_IPV4; esm_sap.data.pdn_connect.apn = NULL; esm_sap.data.pdn_connect.is_emergency = _emm_data.is_emergency; rc = esm_sap_send(&esm_sap); diff --git a/openair3/NAS/UE/ESM/esm_ebr_context.c b/openair3/NAS/UE/ESM/esm_ebr_context.c index f56a19b87685aafbdb9124811a6f60d9c874727b..539403f7e43a4bb10bd8b949a9718585450cec17 100755 --- a/openair3/NAS/UE/ESM/esm_ebr_context.c +++ b/openair3/NAS/UE/ESM/esm_ebr_context.c @@ -282,14 +282,16 @@ int esm_ebr_context_create( } res = sprintf(command_line, - "ifconfig oip1 %s netmask %s broadcast %s up", + "ifconfig oip1 %s netmask %s broadcast %s", ipv4_addr, netmask, broadcast); (void)res; /* avoid gcc warning "set but not used" */ // AssertFatal((res > 0) && (res < 128), // "error in system command line"); LOG_TRACE(INFO, "ESM-PROC - executing %s ", command_line); + if (system(command_line)) ; /* TODO: what to do? */ + break; case NET_PDN_TYPE_IPV6: diff --git a/openair3/TEST/EPC_TEST/play_scenario_s1ap.c b/openair3/TEST/EPC_TEST/play_scenario_s1ap.c index 5d5a3672d3139b17b655cfb1ceb9e4334599898b..64071981fb6ed646001fe969c492d91de02f9677 100644 --- a/openair3/TEST/EPC_TEST/play_scenario_s1ap.c +++ b/openair3/TEST/EPC_TEST/play_scenario_s1ap.c @@ -666,7 +666,7 @@ int et_s1ap_process_rx_packet(et_event_s1ap_data_ind_t * const s1ap_data_ind) packet = g_scenario->last_rx_packet->next; } // not_found threshold may sure depend on number of mme, may be not sure on number of UE - while ((NULL != packet) && (not_found < 7)) { + while ((NULL != packet) && (not_found < 9)) { S1AP_DEBUG("%s() Considering packet num %d original frame number %u\n", __FUNCTION__, packet->packet_number, packet->original_frame_number); if (packet->action == ET_PACKET_ACTION_S1C_RECEIVE) { comp_results = et_sctp_is_matching(&packet->sctp_hdr, &rx_packet->sctp_hdr, g_constraints); @@ -692,7 +692,7 @@ int et_s1ap_process_rx_packet(et_event_s1ap_data_ind_t * const s1ap_data_ind) return et_scenario_set_packet_received(packet); } } else if (strcmp(comp_results->name, "S1ap-TransportLayerAddress") == 0) { - S1AP_WARN("Some work needed there for %s, TODO in generic_scenario.xsl, add epc conf file in the process, anyway continuing...\n",comp_results->name); + S1AP_WARN("Some work needed there for %s, TODO in generic_scenario.xsl, add sgw conf file in the process, anyway continuing...\n",comp_results->name); packet->timestamp_packet.tv_sec = rx_packet->timestamp_packet.tv_sec; packet->timestamp_packet.tv_usec = rx_packet->timestamp_packet.tv_usec; return et_scenario_set_packet_received(packet); diff --git a/targets/ARCH/BLADERF/USERSPACE/LIB/bladerf_lib.c b/targets/ARCH/BLADERF/USERSPACE/LIB/bladerf_lib.c index d9b7bfa9050be30fb22b28725395916b08389250..6cc1d8c5d2dfec4fe75f4e9d4674e0e74124452d 100644 --- a/targets/ARCH/BLADERF/USERSPACE/LIB/bladerf_lib.c +++ b/targets/ARCH/BLADERF/USERSPACE/LIB/bladerf_lib.c @@ -37,6 +37,7 @@ #include <stdlib.h> #include <inttypes.h> #include "bladerf_lib.h" +#include "math.h" /** @addtogroup _BLADERF_PHY_RF_INTERFACE_ * @{ @@ -58,14 +59,16 @@ int num_devices=0; /*! \brief BladeRF Init function (not used at the moment) * \param device RF frontend parameters set by application + * \returns 0 on success */ int trx_brf_init(openair0_device *device) { - + return 0; } /*! \brief get current timestamp *\param device the hardware to use *\param module the bladeRf module + *\returns timestamp of BladeRF */ openair0_timestamp trx_get_timestamp(openair0_device *device, bladerf_module module) { @@ -83,28 +86,22 @@ openair0_timestamp trx_get_timestamp(openair0_device *device, bladerf_module mod } /*! \brief Start BladeRF - *\param device the hardware to use + * \param device the hardware to use + * \returns 0 on success */ 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){ - - -} - /*! \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 + \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 + \returns 0 on success */ static int trx_brf_write(openair0_device *device,openair0_timestamp ptimestamp, void **buff, int nsamps, int cc, int flags) { @@ -156,6 +153,7 @@ static int trx_brf_write(openair0_device *device,openair0_timestamp ptimestamp, * \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 + * \returns number of samples read */ static int trx_brf_read(openair0_device *device, openair0_timestamp *ptimestamp, void **buff, int nsamps, int cc) { @@ -176,9 +174,10 @@ static int trx_brf_read(openair0_device *device, openair0_timestamp *ptimestamp, brf->num_rx_errors++; } else if ( brf->meta_rx.status & BLADERF_META_STATUS_OVERRUN) { brf->num_overflows++; - printf("RX overrun (%d) is detected. t=%u. Got %u samples. nsymps %d\n", + printf("RX overrun (%d) is detected. t=" "%" PRIu64 "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; @@ -196,7 +195,7 @@ static int trx_brf_read(openair0_device *device, openair0_timestamp *ptimestamp, /*! \brief Terminate operation of the BladeRF transceiver -- free all associated resources * \param device the hardware to use */ -int trx_brf_end(openair0_device *device) { +void trx_brf_end(openair0_device *device) { int status; brf_state_t *brf = (brf_state_t*)device->priv; @@ -208,7 +207,6 @@ int trx_brf_end(openair0_device *device) { fprintf(stderr, "Failed to disable TX module: %s\n", bladerf_strerror(status)); } bladerf_close(brf->dev); - return 0; } /*! \brief print the BladeRF statistics @@ -231,10 +229,11 @@ int trx_brf_reset_stats(openair0_device* device) { } -/*! \brief Stop USRP - * \param device the hardware to use +/*! \brief Stop BladeRF + * \param card the hardware to use + * \returns 0 in success */ -int trx_brf_stop(openair0_device* device) { +int trx_brf_stop(int card) { return(0); @@ -242,9 +241,11 @@ int trx_brf_stop(openair0_device* device) { /*! \brief Set frequencies (TX/RX) * \param device the hardware to use + * \param openair0_cfg1 openair0 Config structure (ignored. It is there to comply with RF common API) + * \param exmimo_dump_config (ignored) * \returns 0 in success */ -int trx_brf_set_freq(openair0_device* device) { +int trx_brf_set_freq(openair0_device* device, openair0_config_t *openair0_cfg1,int exmimo_dump_config) { int status; brf_state_t *brf = (brf_state_t *)device->priv; @@ -269,9 +270,10 @@ int trx_brf_set_freq(openair0_device* device) { /*! \brief Set Gains (TX/RX) * \param device the hardware to use + * \param openair0_cfg openair0 Config structure * \returns 0 in success */ -int trx_brf_set_gains(openair0_device* device) { +int trx_brf_set_gains(openair0_device* device, openair0_config_t *openair0_cfg) { return(0); @@ -283,12 +285,17 @@ int trx_brf_set_gains(openair0_device* device) { 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}; +/*! \brief calibration table for BladeRF */ rx_gain_calib_table_t calib_table_fx4[] = { {2300000000.0,53.5}, {1880000000.0,57.0}, {816000000.0,73.0}, {-1,0}}; +/*! \brief set RX gain offset from calibration table + * \param openair0_cfg RF frontend parameters set by application + * \param chain_index RF chain ID + */ void set_rx_gain_offset(openair0_config_t *openair0_cfg, int chain_index) { int i=0; @@ -310,6 +317,9 @@ void set_rx_gain_offset(openair0_config_t *openair0_cfg, int chain_index) { } +/*! \brief Calibrate LMSSDR RF + * \param device the hardware to use + */ void calibrate_rf(openair0_device *device) { @@ -885,11 +895,10 @@ void calibrate_rf(openair0_device *device) { /*! \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 + * \returns 0 on success */ 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)); /* device specific */ @@ -1063,8 +1072,6 @@ int device_init(openair0_device *device, openair0_config_t *openair0_cfg) { }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"); @@ -1091,16 +1098,18 @@ int device_init(openair0_device *device, openair0_config_t *openair0_cfg) { /*! \brief bladeRF error report * \param status + * \returns 0 on success */ int brf_error(int status) { //exit(-1); - //return 1; // or status error code + return status; // or status error code } /*! \brief Open BladeRF from serial port * \param serial name of serial port on which to open BladeRF device + * \returns bladerf device structure */ struct bladerf * open_bladerf_from_serial(const char *serial) { @@ -1131,6 +1140,7 @@ struct bladerf * open_bladerf_from_serial(const char *serial) { /*! \brief Get BladeRF log level * \param log_level log level + * \returns log level of BLADERF device */ int get_brf_log_level(int log_level){ diff --git a/targets/ARCH/BLADERF/USERSPACE/LIB/bladerf_lib.h b/targets/ARCH/BLADERF/USERSPACE/LIB/bladerf_lib.h index 3a05c80e5c8f83e8d7e7434e3e5ead3484493709..743baf1bc815cdafd979135d6fb3bcedfe16b425 100644 --- a/targets/ARCH/BLADERF/USERSPACE/LIB/bladerf_lib.h +++ b/targets/ARCH/BLADERF/USERSPACE/LIB/bladerf_lib.h @@ -106,6 +106,27 @@ typedef struct { /* * func prototypes */ +/*! \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, bladerf_module module); +/*! \brief Get BladeRF log level + * \param log_level log level + * \returns log level of BLADERF device + */ +int get_brf_log_level(int log_level); + +/*! \brief bladeRF error report + * \param status + * \returns 0 on success + */ int brf_error(int status); + /*@}*/ diff --git a/targets/ARCH/COMMON/common_lib.c b/targets/ARCH/COMMON/common_lib.c index de78cb80a6558c6222c566e07d469b14cc9716b3..b82fc9898128df31ea95a680d85ee811c43e2516 100644 --- a/targets/ARCH/COMMON/common_lib.c +++ b/targets/ARCH/COMMON/common_lib.c @@ -99,6 +99,7 @@ int load_lib(openair0_device *device, openair0_config_t *openair0_cfg, eth_param void *lib_handle; oai_device_initfunc_t dp ; oai_transport_initfunc_t tp ; + int ret=0; if (flag == BBU_LOCAL_RADIO_HEAD) { lib_handle = dlopen(OAI_RF_LIBNAME, RTLD_LAZY); @@ -111,9 +112,9 @@ int load_lib(openair0_device *device, openair0_config_t *openair0_cfg, eth_param dp = dlsym(lib_handle,"device_init"); if (dp != NULL ) { - if (dp(device,openair0_cfg)!=0) { - fprintf(stderr,"Error initializing device\n"); - return -1; + ret = dp(device,openair0_cfg); + if (ret<0) { + fprintf(stderr, "%s %d:oai device intialization failed %s\n", __FILE__, __LINE__, dlerror()); } } else { fprintf(stderr, "%s %d:oai device intializing function not found %s\n", __FILE__, __LINE__, dlerror()); @@ -137,14 +138,14 @@ int load_lib(openair0_device *device, openair0_config_t *openair0_cfg, eth_param } } - return 0; + return ret; } int openair0_device_load(openair0_device *device, openair0_config_t *openair0_cfg) { - int rc; + int rc=0; //ToDo: EXMIMO harmonization is not complete. That is the reason for this ifdef #ifdef EXMIMO int device_init(openair0_device *device, openair0_config_t *openair0_cfg); diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp index 3ca15c66602c7760a563df391de9a8ba2f09a453..4be796e5888ace3f274bef977dc53ba24c68fe03 100644 --- a/targets/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp +++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp @@ -49,6 +49,9 @@ #include <cmath> +/** @addtogroup _LMSSDR_PHY_RF_INTERFACE_ + * @{ + */ ///define for parameter enumeration if prefix might be needed #define LMS7param(id) id @@ -69,6 +72,15 @@ extern "C" int write_output(const char *fname,const char *vname,void *data,int length,int dec,char format); } +/*! \brief Called to send samples to the LMSSDR 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 + \param flags Ignored for the moment + \returns 0 on success +*/ 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); @@ -76,7 +88,17 @@ int trx_lms_write(openair0_device *device, openair0_timestamp timestamp, void ** return nsamps; } - +/*! \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 port + * \returns number of samples read +*/ int trx_lms_read(openair0_device *device, openair0_timestamp *ptimestamp, void **buff, int nsamps, int antenna_id) { uint64_t timestamp; @@ -87,6 +109,11 @@ int trx_lms_read(openair0_device *device, openair0_timestamp *ptimestamp, void * return ret; } + +/*! \brief set RX gain offset from calibration table + * \param openair0_cfg RF frontend parameters set by application + * \param chain_index RF chain ID + */ void set_rx_gain_offset(openair0_config_t *openair0_cfg, int chain_index) { int i=0; @@ -107,469 +134,12 @@ void set_rx_gain_offset(openair0_config_t *openair0_cfg, int chain_index) { } } -/* -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 - -} -*/ +/*! \brief Set Gains (TX/RX) on LMSSDR + * \param device the hardware to use + * \param openair0_cfg openair0 Config structure + * \returns 0 in success + */ int trx_lms_set_gains(openair0_device* device, openair0_config_t *openair0_cfg) { @@ -589,6 +159,10 @@ int trx_lms_set_gains(openair0_device* device, openair0_config_t *openair0_cfg) return(0); } +/*! \brief Start LMSSDR + * \param device the hardware to use + * \returns 0 on success + */ int trx_lms_start(openair0_device *device){ @@ -746,7 +320,10 @@ int trx_lms_start(openair0_device *device){ return 0; } - +/*! \brief Stop LMSSDR + * \param card Index of the RF card to use + * \returns 0 on success + */ int trx_lms_stop(int card) { /* LMS_DeviceClose(usbport); @@ -756,6 +333,12 @@ int trx_lms_stop(int card) { */ } +/*! \brief Set frequencies (TX/RX) + * \param device the hardware to use + * \param openair0_cfg openair0 Config structure (ignored. It is there to comply with RF common API) + * \param exmimo_dump_config (ignored) + * \returns 0 in success + */ int trx_lms_set_freq(openair0_device* device, openair0_config_t *openair0_cfg,int exmimo_dump_config) { //Control port must be connected @@ -768,6 +351,7 @@ int trx_lms_set_freq(openair0_device* device, openair0_config_t *openair0_cfg,in } // 31 = 19 dB => 105 dB total gain @ 2.6 GHz +/*! \brief calibration table for LMSSDR */ rx_gain_calib_table_t calib_table_sodera[] = { {3500000000.0,70.0}, {2660000000.0,80.0}, @@ -780,33 +364,30 @@ rx_gain_calib_table_t calib_table_sodera[] = { - - +/*! \brief Get LMSSDR Statistics + * \param device the hardware to use + * \returns 0 in success + */ int trx_lms_get_stats(openair0_device* device) { return(0); } +/*! \brief Reset LMSSDR Statistics + * \param device the hardware to use + * \returns 0 in success + */ 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); -} - - +/*! \brief Terminate operation of the LMSSDR transceiver -- free all associated resources + * \param device the hardware to use + */ void trx_lms_end(openair0_device *device) { @@ -877,3 +458,4 @@ int device_init(openair0_device *device, openair0_config_t *openair0_cfg){ return 0; } } +/*@}*/ diff --git a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp index 7732cf8ff2ba8ed50b1e1dd4944c4fd29e79d295..72e79b44de53eaa0813bc5a2baaddea1d0ae8efe 100644 --- a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp +++ b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp @@ -55,6 +55,10 @@ # include <immintrin.h> #endif +#ifdef __arm__ +# include <arm_neon.h> +#endif + /** @addtogroup _USRP_PHY_RF_INTERFACE_ * @{ */ @@ -313,6 +317,7 @@ int trx_usrp_set_freq(openair0_device* device, openair0_config_t *openair0_cfg, usrp_state_t *s = (usrp_state_t*)device->priv; + printf("Setting USRP TX Freq %f, RX Freq %f\n",openair0_cfg[0].tx_freq[0],openair0_cfg[0].rx_freq[0]); s->usrp->set_tx_freq(openair0_cfg[0].tx_freq[0]); s->usrp->set_rx_freq(openair0_cfg[0].rx_freq[0]); diff --git a/targets/DOCS/Doxyfile b/targets/DOCS/Doxyfile index ac6ee99480063889df7bec664722b23229e47ff9..a060f6597ab894c046e427960ed42c2ba1084000 100644 --- a/targets/DOCS/Doxyfile +++ b/targets/DOCS/Doxyfile @@ -796,7 +796,8 @@ INPUT = $(OPENAIR1_DIR)/PHY/defs.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 + $(OPENAIR_TARGETS)/ARCH/BLADERF/USERSPACE/LIB/bladerf_lib.h \ + $(OPENAIR_TARGETS)/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp # 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 index 420949014150671cfc5a95a6aa4ba1e9c9ea0b20..b81ac861f616f8c844300f40cd15321226b815a5 100644 --- 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 @@ -133,7 +133,7 @@ eNBs = ////////// MME parameters: - mme_ip_address = ( { ipv4 = "192.168.12.11"; + mme_ip_address = ( { ipv4 = "127.0.0.3"; ipv6 = "192:168:30::17"; active = "yes"; preference = "ipv4"; @@ -142,11 +142,11 @@ eNBs = NETWORK_INTERFACES : { - ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.212/24"; + ENB_INTERFACE_NAME_FOR_S1_MME = "lo"; + ENB_IPV4_ADDRESS_FOR_S1_MME = "127.0.0.2/24"; - ENB_INTERFACE_NAME_FOR_S1U = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.212/24"; + ENB_INTERFACE_NAME_FOR_S1U = "lo"; + ENB_IPV4_ADDRESS_FOR_S1U = "127.0.0.4/24"; ENB_PORT_FOR_S1U = 2152; # Spec 2152 }; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band3.tm1.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band3.tm1.usrpb210.conf index 1a383524099db3e01af7fe4aeca09b193889c2d9..0a6def775741f7203b9e7110d6f10f220f9357b8 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band3.tm1.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band3.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 = 135; + rx_gain = 125; prach_root = 0; prach_config_index = 0; prach_high_speed = "DISABLE"; @@ -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 e083ea0f4ef8d4a6d545cb15334d227c3ab3f583..7d34889f6787782594f69f2398c58c0f39f39633 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 @@ -36,7 +36,7 @@ eNBs = nb_antennas_tx = 1; nb_antennas_rx = 1; tx_gain = 90; - rx_gain = 127; + 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 = -100; 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.25PRB.usrpx310.epc.remote.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf deleted file mode 100644 index d4b88383e249fac091e2e8bbb6ecfe779398e191..0000000000000000000000000000000000000000 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf +++ /dev/null @@ -1,169 +0,0 @@ -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 = 32; - rx_gain = 116; - 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 = -16; - 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.26"; - 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.111/24"; - - ENB_INTERFACE_NAME_FOR_S1U = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.111/24"; - ENB_PORT_FOR_S1U = 2152; # Spec 2152 - }; - - log_config : - { - global_log_level ="debug"; - 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 index 004af14749518fb6d75a95b466988fe15c589d6a..434dd056b45af43cc6d87f4ddc14dacbf51a0f6c 100644 --- 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 @@ -151,7 +151,7 @@ rrh_gw_config = ( tr_preference = "raw"; rf_preference = "usrp_b200"; iq_txshift = 4; - tx_sample_advance = 113; + tx_sample_advance = 103; tx_scheduling_advance = 9; } @@ -185,4 +185,4 @@ rrh_gw_config = ( rrc_log_verbosity ="medium"; }; } -); +); \ No newline at end of file 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 2ce9598129b4f34c45cb36564fccf4783299c53b..d00482edcab59bc95cf847b58e359172b3a7a6ac 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 = 2680000000L; + downlink_frequency = 2660000000L; uplink_frequency_offset = -120000000; Nid_cell = 0; N_RB_DL = 50; @@ -64,9 +64,9 @@ eNBs = srs_ackNackST =; srs_MaxUpPts =;*/ - pusch_p0_Nominal = -90; + pusch_p0_Nominal = -96; pusch_alpha = "AL1"; - pucch_p0_Nominal = -96; + pucch_p0_Nominal = -103; msg3_delta_Preamble = 6; pucch_deltaF_Format1 = "deltaF2"; pucch_deltaF_Format1b = "deltaF3"; @@ -82,7 +82,7 @@ eNBs = rach_messagePowerOffsetGroupB = ; */ rach_powerRampingStep = 4; - rach_preambleInitialReceivedTargetPower = -108; + rach_preambleInitialReceivedTargetPower = -104; rach_preambleTransMax = 10; rach_raResponseWindowSize = 10; rach_macContentionResolutionTimer = 48; @@ -130,7 +130,7 @@ eNBs = }; ////////// MME parameters: - mme_ip_address = ( { ipv4 = "192.168.12.11"; + mme_ip_address = ( { ipv4 = "127.0.0.3"; ipv6 = "192:168:30::17"; active = "yes"; preference = "ipv4"; @@ -139,11 +139,11 @@ eNBs = NETWORK_INTERFACES : { - ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.215/24"; + ENB_INTERFACE_NAME_FOR_S1_MME = "lo"; + ENB_IPV4_ADDRESS_FOR_S1_MME = "127.0.0.2/24"; - ENB_INTERFACE_NAME_FOR_S1U = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.215/24"; + ENB_INTERFACE_NAME_FOR_S1U = "lo"; + ENB_IPV4_ADDRESS_FOR_S1U = "127.0.0.4/24"; ENB_PORT_FOR_S1U = 2152; # Spec 2152 }; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf index 3ce32398f7ac5d6fe42720447565c0fb6326213a..f1160e78ca43cfc91050d0e278e467e96baeca1a 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf @@ -64,9 +64,9 @@ eNBs = srs_ackNackST =; srs_MaxUpPts =;*/ - pusch_p0_Nominal = -80; /*-85;*/ + pusch_p0_Nominal = -90; /*-85;*/ pusch_alpha = "AL1"; - pucch_p0_Nominal = -108; /* -108 */ + pucch_p0_Nominal = -100; /* -108 */ msg3_delta_Preamble = 6; pucch_deltaF_Format1 = "deltaF2"; pucch_deltaF_Format1b = "deltaF3"; 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 index 37880a29068a889909b2388b500e079dfd1aaead..894781fdfd3a2a53f3253a595cd287acef2e4536 100644 --- 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 @@ -17,7 +17,7 @@ eNBs = mobile_country_code = "208"; - mobile_network_code = "92"; + mobile_network_code = "93"; ////////// Physical parameters: @@ -133,43 +133,41 @@ eNBs = ////////// MME parameters: - mme_ip_address = ( { ipv4 = "192.168.12.170"; + mme_ip_address = ( { ipv4 = "192.168.12.11"; 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_INTERFACE_NAME_FOR_S1_MME = "eth3"; + ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.215/24"; + ENB_INTERFACE_NAME_FOR_S1U = "eth3"; + ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.215/24"; ENB_PORT_FOR_S1U = 2152; # Spec 2152 }; + 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 = 80; + tx_scheduling_advance = 9; + } + ); + log_config : { global_log_level ="info"; @@ -188,4 +186,4 @@ rrh_gw_config = ( rrc_log_verbosity ="medium"; }; } -); +); \ No newline at end of file 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 f1cd67b196163406f87c406167d4b8fa626ed016..967b0c0ca87df9807e778d8395a949cf04987407 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,52 +17,52 @@ eNBs = mobile_country_code = "208"; - mobile_network_code = "95"; + 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 = 2685000000L; - 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 =;*/ + 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 = 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"; @@ -74,34 +74,32 @@ eNBs = 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; - + 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] @@ -131,9 +129,8 @@ eNBs = SCTP_OUTSTREAMS = 2; }; - ////////// MME parameters: - mme_ip_address = ( { ipv4 = "172.27.8.52"; + mme_ip_address = ( { ipv4 = "192.168.12.11"; ipv6 = "192:168:30::17"; active = "yes"; preference = "ipv4"; @@ -143,10 +140,10 @@ eNBs = NETWORK_INTERFACES : { ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "172.27.8.51/23"; + ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.213/24"; ENB_INTERFACE_NAME_FOR_S1U = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1U = "172.27.8.51/23"; + 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.usrpb210.epc.local.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf deleted file mode 100644 index 3583deb7e392b2ba42733b03a12f6e3cbfb96294..0000000000000000000000000000000000000000 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf +++ /dev/null @@ -1,169 +0,0 @@ -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 = 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 = -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.170.0.1"; - ipv6 = "192:168:30::17"; - active = "yes"; - preference = "ipv4"; - } - ); - - NETWORK_INTERFACES : - { - ENB_INTERFACE_NAME_FOR_S1_MME = "eth0:3"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.170.0.2/24"; - - ENB_INTERFACE_NAME_FOR_S1U = "eth0:4"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.170.1.2/24"; - ENB_PORT_FOR_S1U = 2152; # Spec 2152 - }; - - log_config : - { - global_log_level ="debug"; - 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.band7.tm1.usrpb210.epc.remote.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf deleted file mode 100644 index 83b08cb4e0b50a409a26315331323627854b78ae..0000000000000000000000000000000000000000 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf +++ /dev/null @@ -1,167 +0,0 @@ -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 = -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.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 ="debug"; - 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/RT/USER/Makefile b/targets/RT/USER/Makefile index c0efdd2f7c5f6e790059a0f04e7d159532d7ec6a..621f30c5f41268f8009ee53646d652dcd3628719 100644 --- a/targets/RT/USER/Makefile +++ b/targets/RT/USER/Makefile @@ -8,14 +8,14 @@ include $(OPENAIR_TARGETS)/Makefile.common KERNEL_VERSION:=$(shell echo `uname -r | cut -d. -f-2`) KERNEL_TYPE:=$(shell echo `uname -r | cut -d. -f-3 | cut -d- -f3`) -LOWLATENCY_KERNEL:=$(shell if [ $(KERNEL_TYPE) = "lowlatency" ]; then echo "1" ; else echo "0" ; fi) +DEADLINE_SCHEDULER_KERNEL:=$(shell if [ $(KERNEL_TYPE) = "lowlatency" ]; then echo "1" ; else echo "0" ; fi) include $(OPENAIR2_DIR)/RRC/LITE/MESSAGES/Makefile.inc ifdef EXMIMO -#ifdef LOWLATENCY # this ifdef is to be removed after the debugging -ifeq ($(LOWLATENCY_KERNEL),1) -CFLAGS+=-DLOWLATENCY +#ifdef DEADLINE_SCHEDULER # this ifdef is to be removed after the debugging +ifeq ($(DEADLINE_SCHEDULER_KERNEL),1) +CFLAGS+=-DDEADLINE_SCHEDULER endif #endif endif @@ -431,7 +431,7 @@ show: @echo IS_REL10 is $(IS_REL10) @echo openssl $(OPENSSL_FOUND) @echo nettle $(NETTLE_FOUND) - @echo lowlatency kernel: $(LOWLATENCY_KERNEL) + @echo lowlatency kernel: $(DEADLINE_SCHEDULER_KERNEL) beautiful: astyle --style=gnu -s2 $(SRC) diff --git a/targets/RT/USER/eNB_transport_IQ.c b/targets/RT/USER/eNB_transport_IQ.c index acb382386e4ef680414d69a55416498eee5ebb87..86080c2c331bd01eb0254526b4fcf2627240c9ca 100644 --- a/targets/RT/USER/eNB_transport_IQ.c +++ b/targets/RT/USER/eNB_transport_IQ.c @@ -254,7 +254,7 @@ void *rrh_eNB_thread(void *arg) { pthread_mutex_init(&sync_trx_mutex,NULL); /* create eNB module's TX/RX threads */ -#ifdef LOWLATENCY +#ifdef DEADLINE_SCHEDULER error_code_eNB_rx = pthread_create(&eNB_rx_thread, NULL, rrh_eNB_rx_thread, (void *)dev); error_code_eNB_tx = pthread_create(&eNB_tx_thread, NULL, rrh_eNB_tx_thread, (void *)dev); LOG_I(RRH,"[eNB][SCHED] deadline scheduling applied to eNB TX/RX threads\n"); @@ -302,7 +302,7 @@ void *rrh_eNB_thread(void *arg) { timerspec.it_interval.tv_nsec = rt_period%1000000000; -#ifdef LOWLATENCY +#ifdef DEADLINE_SCHEDULER error_code_timer = pthread_create(&main_timer_proc_thread, NULL, timer_proc, (void *)&timerspec); LOG_I(RRH,"[eNB][SCHED] deadline scheduling applied to timer thread \n"); #else @@ -368,7 +368,7 @@ void *rrh_eNB_rx_thread(void *arg) { measurements = dev->measurements; next_rx_pos = spp_eth; -#ifdef LOWLATENCY +#ifdef DEADLINE_SCHEDULER struct sched_attr attr; unsigned int flags = 0; @@ -560,7 +560,7 @@ void *rrh_eNB_tx_thread(void *arg) { unsigned int subframe=0,frame=0; unsigned int pck_tx=0; -#ifdef LOWLATENCY +#ifdef DEADLINE_SCHEDULER struct sched_attr attr; unsigned int flags = 0; diff --git a/targets/RT/USER/eNB_usrp.gtkw b/targets/RT/USER/eNB_usrp.gtkw index ca9427a38de4e00b1588cdeb652feb389725bb25..935bf68b2eb49084c0e2738d758b106215bc7571 100644 --- a/targets/RT/USER/eNB_usrp.gtkw +++ b/targets/RT/USER/eNB_usrp.gtkw @@ -1,17 +1,17 @@ [*] [*] GTKWave Analyzer v3.3.58 (w)1999-2014 BSI -[*] Wed Sep 9 13:51:16 2015 +[*] Sun Apr 10 20:34:38 2016 [*] -[dumpfile] "/homes/kaltenbe/openair_dump_eNB_usrp_note4.gtk" -[dumpfile_mtime] "Wed Sep 9 13:39:25 2015" -[dumpfile_size] 323681028 -[savefile] "/homes/kaltenbe/Devel/openair/openair4G/trunk/targets/RT/USER/eNB.gtkw" -[timestart] 63022760000 -[size] 1855 1056 -[pos] -851 -429 -*-22.793451 63031840000 -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 +[dumpfile] "/tmp/openair_dump_eNB.vcd" +[dumpfile_mtime] "Sun Apr 10 20:26:57 2016" +[dumpfile_size] 181182776 +[savefile] "/home/papillon/openairinterface5g/targets/RT/USER/eNB_usrp.gtkw" +[timestart] 19787100000 +[size] 1535 876 +[pos] -1 -1 +*-21.793451 19795882832 -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] 284 +[signals_width] 238 [sst_expanded] 1 [sst_vpaned_height] 294 @24 @@ -50,16 +50,120 @@ functions.eNB_thread_rx9 functions.eNB_thread_tx9 functions.phy_procedures_eNb_tx functions.phy_procedures_eNb_rx +@24 +variables.dci_info[63:0] +variables.ue0_BO[63:0] +@420 +variables.ue0_BSR[63:0] +variables.ue0_timing_advance[63:0] +@28 +functions.macxface_initiate_ra_proc +functions.macxface_terminate_ra_proc +functions.phy_enb_ulsch_msg3 +functions.macxface_SR_indication +@420 +variables.ue0_SR_ENERGY[63:0] +variables.ue0_SR_THRES[63:0] +@25 +variables.dci_info[63:0] +@28 +functions.phy_enb_ulsch_decoding0 +@24 +variables.ue0_res0[63:0] +@420 +variables.ue0_rssi0[63:0] +variables.ue0_MCS0[63:0] +variables.ue0_RB0[63:0] +@24 +variables.ue0_ROUND0[63:0] +variables.ue0_SFN0[63:0] +@28 +functions.phy_enb_ulsch_decoding1 +@24 +variables.ue0_res1[63:0] +@420 +variables.ue0_rssi1[63:0] +variables.ue0_MCS1[63:0] +variables.ue0_RB1[63:0] +@24 +variables.ue0_ROUND1[63:0] +variables.ue0_SFN1[63:0] +@28 +functions.phy_enb_ulsch_decoding2 +@24 +variables.ue0_res2[63:0] +@420 +variables.ue0_rssi2[63:0] +variables.ue0_MCS2[63:0] +variables.ue0_RB2[63:0] +@24 +variables.ue0_ROUND2[63:0] +variables.ue0_SFN2[63:0] +@28 +functions.phy_enb_ulsch_decoding3 +@24 +variables.ue0_res3[63:0] +@420 +variables.ue0_rssi3[63:0] +variables.ue0_MCS3[63:0] +variables.ue0_RB3[63:0] +@24 +variables.ue0_ROUND3[63:0] +variables.ue0_SFN3[63:0] +@28 +functions.phy_enb_ulsch_decoding4 +@420 +variables.ue0_rssi4[63:0] +@24 +variables.ue0_res4[63:0] +@420 +variables.ue0_MCS4[63:0] +variables.ue0_RB4[63:0] +@24 +variables.ue0_ROUND4[63:0] +variables.ue0_SFN4[63:0] +@28 +functions.phy_enb_ulsch_decoding5 +@24 +variables.ue0_res5[63:0] +@420 +variables.ue0_rssi5[63:0] +variables.ue0_MCS5[63:0] +variables.ue0_RB5[63:0] +@24 +variables.ue0_ROUND5[63:0] +variables.ue0_SFN5[63:0] +@28 +functions.phy_enb_ulsch_decoding6 +@24 +variables.ue0_res6[63:0] +@420 +variables.ue0_rssi6[63:0] +variables.ue0_MCS6[63:0] +variables.ue0_RB6[63:0] +@24 +variables.ue0_ROUND6[63:0] +variables.ue0_SFN6[63:0] +@28 +functions.phy_enb_ulsch_decoding7 +@24 +variables.ue0_res7[63:0] +@420 +variables.ue0_rssi7[63:0] +variables.ue0_MCS7[63:0] +variables.ue0_RB7[63:0] +@24 +variables.ue0_ROUND7[63:0] +variables.ue0_SFN7[63:0] +@28 functions.phy_enb_prach_rx functions.phy_eNB_dlsch_encoding functions.phy_eNB_dlsch_modulation functions.phy_eNB_dlsch_scrambling functions.phy_enb_pdcch_tx -functions.phy_enb_ulsch_decoding functions.phy_enb_rs_tx functions.rrc_mac_config_req functions.rlc_data_req -@29 functions.udp_enb_task [pattern_trace] 1 [pattern_trace] 0 diff --git a/targets/RT/USER/lte-softmodem.c b/targets/RT/USER/lte-softmodem.c index 5271ca5d4aa4c1656ed5a0f7d398246d9740b158..ca97ad0e225acc5ca7f4205d30a3c7e7209dbf09 100644 --- a/targets/RT/USER/lte-softmodem.c +++ b/targets/RT/USER/lte-softmodem.c @@ -50,8 +50,12 @@ #include <signal.h> #include <execinfo.h> #include <getopt.h> +#include <sys/sysinfo.h> + +#include "T.h" #include "rt_wrapper.h" + #undef MALLOC //there are two conflicting definitions, so we better make sure we don't use it at all #include "assertions.h" @@ -77,8 +81,6 @@ struct gps_fix_t dummy_gps_data; //#undef FRAME_LENGTH_COMPLEX_SAMPLES //there are two conflicting definitions, so we better make sure we don't use it at all #include "PHY/vars.h" -#include "MAC_INTERFACE/vars.h" -//#include "SCHED/defs.h" #include "SCHED/vars.h" #include "LAYER2/MAC/vars.h" @@ -88,13 +90,11 @@ struct gps_fix_t dummy_gps_data; #include "SCHED/phy_procedures_emos.h" #endif -#ifdef OPENAIR2 #include "LAYER2/MAC/defs.h" #include "LAYER2/MAC/vars.h" #include "LAYER2/MAC/proto.h" #include "RRC/LITE/vars.h" #include "PHY_INTERFACE/vars.h" -#endif #ifdef SMBV #include "PHY/TOOLS/smbv.h" @@ -164,7 +164,7 @@ FD_lte_phy_scope_ue *form_ue[NUMBER_OF_UE_MAX]; FD_lte_phy_scope_enb *form_enb[MAX_NUM_CCs][NUMBER_OF_UE_MAX]; FD_stats_form *form_stats=NULL,*form_stats_l2=NULL; char title[255]; -unsigned char scope_enb_num_ue = 1; +unsigned char scope_enb_num_ue = 2; #endif //XFORMS #ifdef RTAI @@ -179,7 +179,7 @@ pthread_t main_ue_thread; pthread_attr_t attr_dlsch_threads; pthread_attr_t attr_UE_thread; -#ifndef LOWLATENCY +#ifndef DEADLINE_SCHEDULER struct sched_param sched_param_dlsch; #endif #endif @@ -195,7 +195,7 @@ struct sched_param sched_param_UE_thread; pthread_attr_t attr_eNB_proc_tx[MAX_NUM_CCs][NUM_ENB_THREADS]; pthread_attr_t attr_eNB_proc_rx[MAX_NUM_CCs][NUM_ENB_THREADS]; -#ifndef LOWLATENCY +#ifndef DEADLINE_SCHEDULER struct sched_param sched_param_eNB_proc_tx[MAX_NUM_CCs][NUM_ENB_THREADS]; struct sched_param sched_param_eNB_proc_rx[MAX_NUM_CCs][NUM_ENB_THREADS]; #endif @@ -319,7 +319,7 @@ static LTE_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs]; int multi_thread=1; uint32_t target_dl_mcs = 28; //maximum allowed mcs -uint32_t target_ul_mcs = 10; +uint32_t target_ul_mcs = 20; uint32_t timing_advance = 0; uint8_t exit_missed_slots=1; uint64_t num_missed_slots=0; // counter for the number of missed slots @@ -486,8 +486,13 @@ void help (void) { printf(" -U Set the lte softmodem as a UE\n"); printf(" -W Enable L2 wireshark messages on localhost \n"); printf(" -V Enable VCD (generated file will be located atopenair_dump_eNB.vcd, read it with target/RT/USER/eNB.gtkw\n"); - printf(" -x Set the transmission mode, valid options: 1 \n"RESET); - + printf(" -x Set the transmission mode, valid options: 1 \n"); +#if T_TRACER + printf(" --T_port [port] use given port\n"); + printf(" --T_nowait don't wait for tracer, start immediately\n"); +#endif + printf(RESET); + fflush(stdout); } void exit_fun(const char* s) { @@ -517,7 +522,7 @@ void reset_stats(FL_OBJECT *button, long arg) for (i=0; i<NUMBER_OF_UE_MAX; i++) { for (k=0; k<8; k++) { //harq_processes - for (j=0; j<phy_vars_eNB->dlsch_eNB[i][0]->Mdlharq; j++) { + for (j=0; j<phy_vars_eNB->dlsch_eNB[i][0]->Mlimit; j++) { phy_vars_eNB->eNB_UE_stats[i].dlsch_NAK[k][j]=0; phy_vars_eNB->eNB_UE_stats[i].dlsch_ACK[k][j]=0; phy_vars_eNB->eNB_UE_stats[i].dlsch_trials[k][j]=0; @@ -527,7 +532,7 @@ void reset_stats(FL_OBJECT *button, long arg) phy_vars_eNB->eNB_UE_stats[i].ulsch_errors[k]=0; phy_vars_eNB->eNB_UE_stats[i].ulsch_consecutive_errors=0; - for (j=0; j<phy_vars_eNB->ulsch_eNB[i]->Mdlharq; j++) { + for (j=0; j<phy_vars_eNB->ulsch_eNB[i]->Mlimit; j++) { phy_vars_eNB->eNB_UE_stats[i].ulsch_decoding_attempts[k][j]=0; phy_vars_eNB->eNB_UE_stats[i].ulsch_decoding_attempts_last[k][j]=0; phy_vars_eNB->eNB_UE_stats[i].ulsch_round_errors[k][j]=0; @@ -550,6 +555,7 @@ static void *scope_thread(void *arg) int len = 0; struct sched_param sched_param; int UE_id, CC_id; + int ue_cnt=0; sched_param.sched_priority = sched_get_priority_min(SCHED_FIFO)+1; sched_setscheduler(0, SCHED_FIFO,&sched_param); @@ -593,11 +599,15 @@ static void *scope_thread(void *arg) fl_clear_browser(form_stats->stats_text); fl_add_browser_line(form_stats->stats_text, stats_buffer); - for(UE_id=0; UE_id<scope_enb_num_ue; UE_id++) { + ue_cnt=0; + for(UE_id=0; UE_id<NUMBER_OF_UE_MAX; UE_id++) { for(CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) { - phy_scope_eNB(form_enb[CC_id][UE_id], - PHY_vars_eNB_g[0][CC_id], - UE_id); + if ((PHY_vars_eNB_g[0][CC_id]->dlsch_eNB[UE_id][0]->rnti>0) && (ue_cnt<scope_enb_num_ue)) { + phy_scope_eNB(form_enb[CC_id][ue_cnt], + PHY_vars_eNB_g[0][CC_id], + UE_id); + ue_cnt++; + } } } @@ -937,7 +947,7 @@ void do_OFDM_mod_rt(int subframe,PHY_VARS_eNB *phy_vars_eNB) { unsigned int aa,slot_offset, slot_offset_F; - int dummy_tx_b[7680*4] __attribute__((aligned(16))); + int dummy_tx_b[7680*4] __attribute__((aligned(32))); int i, tx_offset; int slot_sizeF = (phy_vars_eNB->lte_frame_parms.ofdm_symbol_size)* ((phy_vars_eNB->lte_frame_parms.Ncp==1) ? 6 : 7); @@ -1085,16 +1095,12 @@ static void* eNB_thread_tx( void* param ) } #else -#ifdef LOWLATENCY +#ifdef DEADLINE_SCHEDULER struct sched_attr attr; unsigned int flags = 0; - uint64_t runtime = (uint64_t) (get_runtime_tx(proc->subframe, runtime_phy_tx, target_dl_mcs,frame_parms[0]->N_RB_DL,cpuf,PHY_vars_eNB_g[0][0]->lte_frame_parms.nb_antennas_tx) * 1000000); - uint64_t deadline = 1 * 1000000; // each tx thread will finish within 1ms + uint64_t runtime = 850000 ; + uint64_t deadline = 1 * 1000000 ; // each tx thread will finish within 1ms uint64_t period = 1 * 10000000; // each tx thread has a period of 10ms from the starting point - if (runtime > 1000000 ){ - LOG_W(HW,"estimated runtime %d is larger than 1ms, adjusting\n",runtime); - runtime = (0.97 * 100) * 10000; - } attr.size = sizeof(attr); attr.sched_flags = 0; @@ -1113,7 +1119,74 @@ static void* eNB_thread_tx( void* param ) LOG_I( HW, "[SCHED] eNB TX deadline thread %d(TID %ld) started on CPU %d\n", proc->subframe, gettid(), sched_getcpu() ); #else - LOG_I( HW, "[SCHED][eNB] TX thread %d started on CPU %d TID %d\n", proc->subframe, sched_getcpu(),gettid() ); + int policy, s, j; + struct sched_param sparam; + char cpu_affinity[1024]; + cpu_set_t cpuset; + + /* Set affinity mask to include CPUs 1 to MAX_CPUS */ + /* CPU 0 is reserved for UHD threads */ + /* CPU 1 is reserved for all TX threads */ + /* Enable CPU Affinity only if number of CPUs >2 */ + CPU_ZERO(&cpuset); + + #ifdef CPU_AFFINITY + if (get_nprocs() > 2) + { + for (j = 1; j < get_nprocs(); j++) + CPU_SET(j, &cpuset); + s = pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); + if (s != 0) + { + perror( "pthread_setaffinity_np"); + exit_fun("Error setting processor affinity"); + } + } + #endif + + /* Check the actual affinity mask assigned to the thread */ + + s = pthread_getaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); + if (s != 0) + { + perror( "pthread_getaffinity_np"); + exit_fun("Error getting processor affinity "); + } + memset(cpu_affinity,0,sizeof(cpu_affinity)); + for (j = 0; j < CPU_SETSIZE; j++) + if (CPU_ISSET(j, &cpuset)) + { + char temp[1024]; + sprintf (temp, " CPU_%d", j); + strcat(cpu_affinity, temp); + } + + memset(&sparam, 0 , sizeof (sparam)); + sparam.sched_priority = sched_get_priority_max(SCHED_FIFO)-1; + policy = SCHED_FIFO ; + + s = pthread_setschedparam(pthread_self(), policy, &sparam); + if (s != 0) + { + perror("pthread_setschedparam : "); + exit_fun("Error setting thread priority"); + } + s = pthread_getschedparam(pthread_self(), &policy, &sparam); + if (s != 0) + { + perror("pthread_getschedparam : "); + exit_fun("Error getting thread priority"); + + } + + LOG_I( HW, "[SCHED][eNB] TX thread %d started on CPU %d TID %ld, sched_policy = %s , priority = %d, CPU Affinity=%s \n", proc->subframe, sched_getcpu(),gettid(), + (policy == SCHED_FIFO) ? "SCHED_FIFO" : + (policy == SCHED_RR) ? "SCHED_RR" : + (policy == SCHED_OTHER) ? "SCHED_OTHER" : + "???", + sparam.sched_priority, cpu_affinity ); + + #endif #endif @@ -1200,7 +1273,7 @@ static void* eNB_thread_tx( void* param ) /* 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) { + for (i=0;i<PHY_vars_eNB_g[0][proc->CC_id]->lte_frame_parms.samples_per_tti*2;i+=8) { txdata[i] = 2047; txdata[i+1] = 0; txdata[i+2] = 0; @@ -1230,7 +1303,7 @@ static void* eNB_thread_tx( void* param ) if (proc->frame_tx==1024) proc->frame_tx=0; stop_meas( &softmodem_stats_tx_sf[proc->subframe] ); -#ifdef LOWLATENCY +#ifdef DEADLINE_SCHEDULER if (opp_enabled){ if(softmodem_stats_tx_sf[proc->subframe].diff_now/(cpuf) > attr.sched_runtime){ VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_RUNTIME_TX_ENB, (softmodem_stats_tx_sf[proc->subframe].diff_now/cpuf - attr.sched_runtime)/1000000.0); @@ -1305,18 +1378,13 @@ static void* eNB_thread_rx( void* param ) } #else -#ifdef LOWLATENCY +#ifdef DEADLINE_SCHEDULER struct sched_attr attr; unsigned int flags = 0; - uint64_t runtime = get_runtime_rx(proc->subframe, runtime_phy_rx, target_ul_mcs,frame_parms[0]->N_RB_DL,cpuf,PHY_vars_eNB_g[0][0]->lte_frame_parms.nb_antennas_rx) * 1000000; + uint64_t runtime = 870000 ; uint64_t deadline = 1 * 1000000; uint64_t period = 1 * 10000000; // each rx thread has a period of 10ms from the starting point - if (runtime > 2300000 ) { - LOG_W(HW,"estimated rx runtime %d is larger than expected, adjusting\n",runtime); - runtime = 2300000; - deadline = runtime + 100000; - } - + attr.size = sizeof(attr); attr.sched_flags = 0; attr.sched_nice = 0; @@ -1334,7 +1402,79 @@ static void* eNB_thread_rx( void* param ) LOG_I( HW, "[SCHED] eNB RX deadline thread %d(TID %ld) started on CPU %d\n", proc->subframe, gettid(), sched_getcpu() ); #else - LOG_I( HW, "[SCHED][eNB] RX thread %d started on CPU %d TID %d\n", proc->subframe, sched_getcpu(),gettid() ); + int policy, s, j; + struct sched_param sparam; + char cpu_affinity[1024]; + cpu_set_t cpuset; + + /* Set affinity mask to include CPUs 1 to MAX_CPUS */ + /* CPU 0 is reserved for UHD */ + /* CPU 1 is reserved for all TX threads */ + /* CPU 2..MAX_CPUS is reserved for all RX threads */ + /* Set CPU Affinity only if number of CPUs >2 */ + CPU_ZERO(&cpuset); + #ifdef CPU_AFFINITY + if (get_nprocs() >2) + { + for (j = 1; j < get_nprocs(); j++) + CPU_SET(j, &cpuset); + + s = pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); + if (s != 0) + { + perror( "pthread_setaffinity_np"); + exit_fun (" Error setting processor affinity :"); + } + } + #endif + /* Check the actual affinity mask assigned to the thread */ + + s = pthread_getaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); + if (s != 0) + { + perror ("pthread_getaffinity_np"); + exit_fun (" Error getting processor affinity :"); + } + memset(cpu_affinity,0, sizeof(cpu_affinity)); + + for (j = 0; j < CPU_SETSIZE; j++) + if (CPU_ISSET(j, &cpuset)) + { + char temp[1024]; + sprintf (temp, " CPU_%d", j); + strcat(cpu_affinity, temp); + } + + + memset(&sparam, 0 , sizeof (sparam)); + sparam.sched_priority = sched_get_priority_max(SCHED_FIFO)-1; + + policy = SCHED_FIFO ; + s = pthread_setschedparam(pthread_self(), policy, &sparam); + if (s != 0) + { + perror("pthread_setschedparam : "); + exit_fun("Error setting thread priority"); + } + + memset(&sparam, 0 , sizeof (sparam)); + + s = pthread_getschedparam(pthread_self(), &policy, &sparam); + if (s != 0) + { + perror("pthread_getschedparam"); + exit_fun("Error getting thread priority"); + } + + +LOG_I( HW, "[SCHED][eNB] RX thread %d started on CPU %d TID %ld, sched_policy = %s, priority = %d, CPU Affinity = %s\n", proc->subframe, sched_getcpu(),gettid(), + (policy == SCHED_FIFO) ? "SCHED_FIFO" : + (policy == SCHED_RR) ? "SCHED_RR" : + (policy == SCHED_OTHER) ? "SCHED_OTHER" : + "???", + sparam.sched_priority, cpu_affinity); + + #endif #endif // RTAI @@ -1402,7 +1542,7 @@ static void* eNB_thread_rx( void* param ) proc->frame_rx=0; stop_meas( &softmodem_stats_rx_sf[proc->subframe] ); -#ifdef LOWLATENCY +#ifdef DEADLINE_SCHEDULER if (opp_enabled){ if(softmodem_stats_rx_sf[proc->subframe].diff_now/(cpuf) > attr.sched_runtime){ VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_RUNTIME_RX_ENB, (softmodem_stats_rx_sf[proc->subframe].diff_now/cpuf - attr.sched_runtime)/1000000.0); @@ -1444,7 +1584,7 @@ void init_eNB_proc(void) // set the stack size -#ifndef LOWLATENCY +#ifndef DEADLINE_SCHEDULER /* pthread_attr_init( &attr_eNB_proc_tx[CC_id][i] ); if (pthread_attr_setstacksize( &attr_eNB_proc_tx[CC_id][i], 64 *PTHREAD_STACK_MIN ) != 0) @@ -1471,7 +1611,7 @@ void init_eNB_proc(void) pthread_mutex_init( &PHY_vars_eNB_g[0][CC_id]->proc[i].mutex_rx, NULL); pthread_cond_init( &PHY_vars_eNB_g[0][CC_id]->proc[i].cond_tx, NULL); pthread_cond_init( &PHY_vars_eNB_g[0][CC_id]->proc[i].cond_rx, NULL); -#ifndef LOWLATENCY +#ifndef DEADLINE_SCHEDULER pthread_create( &PHY_vars_eNB_g[0][CC_id]->proc[i].pthread_tx, &attr_eNB_proc_tx[CC_id][i], eNB_thread_tx, &PHY_vars_eNB_g[0][CC_id]->proc[i] ); pthread_create( &PHY_vars_eNB_g[0][CC_id]->proc[i].pthread_rx, &attr_eNB_proc_rx[CC_id][i], eNB_thread_rx, &PHY_vars_eNB_g[0][CC_id]->proc[i] ); #else @@ -1646,7 +1786,7 @@ static void* eNB_thread( void* arg ) #ifdef RTAI RT_TASK* task = rt_task_init_schmod(nam2num("eNBmain"), 0, 0, 0, SCHED_FIFO, 0xF); #else -#ifdef LOWLATENCY +#ifdef DEADLINE_SCHEDULER struct sched_attr attr; unsigned int flags = 0; @@ -1661,12 +1801,6 @@ static void* eNB_thread( void* arg ) attr.sched_deadline = (0.9 * 100) * 10000; attr.sched_period = 1 * 1000000; - - /* pin the eNB main thread to CPU0*/ - /* if (pthread_setaffinity_np(pthread_self(), sizeof(mask),&mask) <0) { - perror("[MAIN_ENB_THREAD] pthread_setaffinity_np failed\n"); - }*/ - if (sched_setattr(0, &attr, flags) < 0 ) { perror("[SCHED] main eNB thread: sched_setattr failed\n"); exit_fun("Nothing to add"); @@ -1675,6 +1809,75 @@ static void* eNB_thread( void* arg ) gettid(),sched_getcpu()); } +#else + + int policy, s, j; + struct sched_param sparam; + char cpu_affinity[1024]; + cpu_set_t cpuset; + + /* Set affinity mask to include CPUs 1 to MAX_CPUS */ + /* CPU 0 is reserved for UHD threads */ + CPU_ZERO(&cpuset); + #ifdef CPU_AFFINITY + if (get_nprocs() >2) + { + for (j = 1; j < get_nprocs(); j++) + CPU_SET(j, &cpuset); + + s = pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); + if (s != 0) + { + perror( "pthread_setaffinity_np"); + exit_fun("Error setting processor affinity"); + } + } + #endif + + /* Check the actual affinity mask assigned to the thread */ + + s = pthread_getaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); + if (s != 0) + { + perror( "pthread_getaffinity_np"); + exit_fun("Error getting processor affinity "); + } + memset(cpu_affinity, 0 , sizeof(cpu_affinity)); + for (j = 0; j < CPU_SETSIZE; j++) + if (CPU_ISSET(j, &cpuset)) + { + char temp[1024]; + sprintf(temp, " CPU_%d ", j); + strcat(cpu_affinity, temp); + } + + memset(&sparam, 0 , sizeof (sparam)); + sparam.sched_priority = sched_get_priority_max(SCHED_FIFO); + policy = SCHED_FIFO ; + + s = pthread_setschedparam(pthread_self(), policy, &sparam); + if (s != 0) + { + perror("pthread_setschedparam : "); + exit_fun("Error setting thread priority"); + } + s = pthread_getschedparam(pthread_self(), &policy, &sparam); + if (s != 0) + { + perror("pthread_getschedparam : "); + exit_fun("Error getting thread priority"); + + } + + + LOG_I( HW, "[SCHED][eNB] Started eNB main thread on CPU %d TID %ld , sched_policy = %s, priority = %d, CPU Affinity = %s \n", (int)sched_getcpu(), gettid(), + (policy == SCHED_FIFO) ? "SCHED_FIFO" : + (policy == SCHED_RR) ? "SCHED_RR" : + (policy == SCHED_OTHER) ? "SCHED_OTHER" : + "???", + (int) sparam.sched_priority, cpu_affinity); + + #endif #endif @@ -1684,9 +1887,7 @@ static void* eNB_thread( void* arg ) goto eNB_thread_cleanup; #ifdef RTAI - printf( "[SCHED][eNB] Started eNB main thread (id %p)\n", task ); -#else - printf( "[SCHED][eNB] Started eNB main thread on CPU %d TID %ld\n", sched_getcpu(), gettid()); + LOG_I( HW, "[SCHED][eNB] Started eNB main thread (id %p)\n", task ); #endif #ifdef HARD_RT @@ -1984,6 +2185,8 @@ static void* eNB_thread( void* arg ) #else int sf = hw_subframe; #endif + /* TODO: is it the right place for master tick? */ + T(T_ENB_MASTER_TICK, T_INT(0), T_INT(frame % 1024), T_INT(sf)); if (frame>50) { for (int CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) { #ifdef EXMIMO @@ -2124,7 +2327,12 @@ static void get_options (int argc, char **argv) LONG_OPTION_MAXPOWER, LONG_OPTION_DUMP_FRAME, LONG_OPTION_LOOPMEMORY, - LONG_OPTION_PHYTEST + LONG_OPTION_PHYTEST, + +#if T_TRACER + LONG_OPTION_T_PORT, + LONG_OPTION_T_NOWAIT, +#endif }; static const struct option long_options[] = { @@ -2143,6 +2351,12 @@ static void get_options (int argc, char **argv) {"ue-dump-frame", no_argument, NULL, LONG_OPTION_DUMP_FRAME}, {"loop-memory", required_argument, NULL, LONG_OPTION_LOOPMEMORY}, {"phy-test", no_argument, NULL, LONG_OPTION_PHYTEST}, + +#if T_TRACER + {"T_port", required_argument, 0, LONG_OPTION_T_PORT}, + {"T_nowait", no_argument, 0, LONG_OPTION_T_NOWAIT}, +#endif + {NULL, 0, NULL, 0} }; @@ -2230,6 +2444,21 @@ static void get_options (int argc, char **argv) phy_test = 1; break; +#if T_TRACER + case LONG_OPTION_T_PORT: { + extern int T_port; + if (optarg == NULL) abort(); /* should not happen */ + T_port = atoi(optarg); + break; + } + + case LONG_OPTION_T_NOWAIT: { + extern int T_wait; + T_wait = 0; + break; + } +#endif + case 'A': timing_advance = atoi (optarg); break; @@ -2590,6 +2819,11 @@ static void get_options (int argc, char **argv) } } +#if T_TRACER +int T_wait = 1; /* by default we wait for the tracer */ +int T_port = 2021; /* default port to listen to to wait for the tracer */ +#endif + int main( int argc, char **argv ) { int i,aa,card=0; @@ -2659,6 +2893,10 @@ int main( int argc, char **argv ) else openair0_cfg[0].configFilename = rf_config_file; +#if T_TRACER + T_init(T_port, T_wait); +#endif + // initialize the log (see log.h for details) set_glog(glog_level, glog_verbosity); @@ -3111,6 +3349,49 @@ int main( int argc, char **argv ) #endif } + +#ifndef DEADLINE_SCHEDULER + + /* Currently we set affinity for UHD to CPU 0 for eNB/UE and only if number of CPUS >2 */ + + cpu_set_t cpuset; + int s; + char cpu_affinity[1024]; + CPU_ZERO(&cpuset); + #ifdef CPU_AFFINITY + if (get_nprocs() > 2) + { + CPU_SET(0, &cpuset); + s = pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); + if (s != 0) + { + perror( "pthread_setaffinity_np"); + exit_fun("Error setting processor affinity"); + } + LOG_I(HW, "Setting the affinity of main function to CPU 0, for device library to use CPU 0 only!\n"); + } + #endif + + /* Check the actual affinity mask assigned to the thread */ + s = pthread_getaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); + if (s != 0) + { + perror( "pthread_getaffinity_np"); + exit_fun("Error getting processor affinity "); + } + memset(cpu_affinity, 0 , sizeof(cpu_affinity)); + for (int j = 0; j < CPU_SETSIZE; j++) + { + if (CPU_ISSET(j, &cpuset)) + { + char temp[1024]; + sprintf(temp, " CPU_%d ", j); + strcat(cpu_affinity, temp); + } + } + LOG_I(HW, "CPU Affinity of main() function is... %s\n", cpu_affinity); +#endif + /* 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 */ @@ -3293,17 +3574,6 @@ int main( int argc, char **argv ) pthread_cond_init(&sync_cond,NULL); pthread_mutex_init(&sync_mutex, NULL); - /* 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 - - // this starts the DMA transfers #ifdef EXMIMO @@ -3383,7 +3653,7 @@ int main( int argc, char **argv ) pthread_attr_init (&attr_UE_thread); pthread_attr_setstacksize(&attr_UE_thread,8192);//5*PTHREAD_STACK_MIN); -#ifndef LOWLATENCY +#ifndef DEADLINE_SCHEDULER sched_param_UE_thread.sched_priority = sched_get_priority_max(SCHED_FIFO); pthread_attr_setschedparam(&attr_UE_thread,&sched_param_UE_thread); sched_param_dlsch.sched_priority = sched_get_priority_max(SCHED_FIFO); //OPENAIR_THREAD_PRIORITY; diff --git a/targets/RT/USER/lte-ue.c b/targets/RT/USER/lte-ue.c index 6ab133e5d6bb8e7fc56eec2e21924c94da6d28ee..0e834a53ab0e42b165036951b0313dfabdcd95de 100644 --- a/targets/RT/USER/lte-ue.c +++ b/targets/RT/USER/lte-ue.c @@ -53,6 +53,7 @@ #include <execinfo.h> #include <getopt.h> #include <syscall.h> +#include <sys/sysinfo.h> #include "rt_wrapper.h" #include "assertions.h" @@ -75,13 +76,9 @@ #endif #include "PHY/extern.h" -#include "MAC_INTERFACE/extern.h" -//#include "SCHED/defs.h" #include "SCHED/extern.h" -#ifdef OPENAIR2 #include "LAYER2/MAC/extern.h" #include "LAYER2/MAC/proto.h" -#endif #include "UTIL/LOG/log_extern.h" #include "UTIL/OTG/otg_tx.h" @@ -215,6 +212,76 @@ static void *UE_thread_synch(void *arg) printf("UE_thread_sync in with PHY_vars_UE %p\n",arg); printf("waiting for sync (UE_thread_synch) \n"); +#ifndef DEADLINE_SCHEDULER + int policy, s, j; + struct sched_param sparam; + char cpu_affinity[1024]; + cpu_set_t cpuset; + + /* Set affinity mask to include CPUs 1 to MAX_CPUS */ + /* CPU 0 is reserved for UHD threads */ + CPU_ZERO(&cpuset); + + #ifdef CPU_AFFINITY + if (get_nprocs() >2) + { + for (j = 1; j < get_nprocs(); j++) + CPU_SET(j, &cpuset); + + s = pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); + if (s != 0) + { + perror( "pthread_setaffinity_np"); + exit_fun("Error setting processor affinity"); + } + } + #endif + + /* Check the actual affinity mask assigned to the thread */ + + s = pthread_getaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); + if (s != 0) + { + perror( "pthread_getaffinity_np"); + exit_fun("Error getting processor affinity "); + } + memset(cpu_affinity, 0 , sizeof(cpu_affinity)); + for (j = 0; j < CPU_SETSIZE; j++) + if (CPU_ISSET(j, &cpuset)) + { + char temp[1024]; + sprintf(temp, " CPU_%d ", j); + strcat(cpu_affinity, temp); + } + + memset(&sparam, 0 , sizeof (sparam)); + sparam.sched_priority = sched_get_priority_max(SCHED_FIFO)-1; + policy = SCHED_FIFO ; + + s = pthread_setschedparam(pthread_self(), policy, &sparam); + if (s != 0) + { + perror("pthread_setschedparam : "); + exit_fun("Error setting thread priority"); + } + s = pthread_getschedparam(pthread_self(), &policy, &sparam); + if (s != 0) + { + perror("pthread_getschedparam : "); + exit_fun("Error getting thread priority"); + + } + + LOG_I( HW, "[SCHED][UE] Started UE synch thread on CPU %d TID %ld , sched_policy = %s, priority = %d, CPU Affinity = %s \n", (int)sched_getcpu(), gettid(), + (policy == SCHED_FIFO) ? "SCHED_FIFO" : + (policy == SCHED_RR) ? "SCHED_RR" : + (policy == SCHED_OTHER) ? "SCHED_OTHER" : + "???", + (int) sparam.sched_priority, cpu_affinity); + +#endif + + pthread_mutex_lock(&sync_mutex); printf("Locked sync_mutex, waiting (UE_sync_thread)\n"); @@ -447,8 +514,8 @@ static void *UE_thread_synch(void *arg) } #ifndef EXMIMO openair0.trx_set_freq_func(&openair0,&openair0_cfg[0],0); - openair0.trx_set_gains_func(&openair0,&openair0_cfg[0]); - openair0.trx_stop_func(0); + //openair0.trx_set_gains_func(&openair0,&openair0_cfg[0]); + //openair0.trx_stop_func(0); #else openair0_set_frequencies(&openair0,&openair0_cfg[0],0); openair0_set_gains(&openair0,&openair0_cfg[0]); @@ -504,6 +571,16 @@ static void *UE_thread_synch(void *arg) if (abs(freq_offset) > 7500) { LOG_I( PHY, "[initial_sync] No cell synchronization found, abandoning\n" ); + FILE *fd; + if ((fd = fopen("rxsig_frame0.dat","w"))!=NULL) { + fwrite((void*)&UE->lte_ue_common_vars.rxdata[0][0], + sizeof(int32_t), + 10*UE->lte_frame_parms.samples_per_tti, + fd); + LOG_I(PHY,"Dummping Frame ... bye bye \n"); + fclose(fd); + exit(0); + } mac_xface->macphy_exit("No cell synchronization found, abandoning"); return &UE_thread_synch_retval; // not reached } @@ -624,7 +701,7 @@ static void *UE_thread_tx(void *arg) LOG_D(HW,"Started UE TX thread (id %p)\n",task); #else -#ifdef LOWLATENCY +#ifdef DEADLINE_SCHEDULER struct sched_attr attr; unsigned int flags = 0; @@ -646,9 +723,72 @@ static void *UE_thread_tx(void *arg) } #else - struct sched_param sp; - sp.sched_priority = sched_get_priority_max(SCHED_FIFO)-1; - pthread_setschedparam(pthread_self(),SCHED_FIFO,&sp); + int policy, s, j; + struct sched_param sparam; + char cpu_affinity[1024]; + cpu_set_t cpuset; + + /* Set affinity mask to include CPUs 1 to MAX_CPUS */ + /* CPU 0 is reserved for UHD threads */ + CPU_ZERO(&cpuset); + + #ifdef CPU_AFFINITY + if (get_nprocs() >2) + { + for (j = 1; j < get_nprocs(); j++) + CPU_SET(j, &cpuset); + + s = pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); + if (s != 0) + { + perror( "pthread_setaffinity_np"); + exit_fun("Error setting processor affinity"); + } + } + #endif + + /* Check the actual affinity mask assigned to the thread */ + + s = pthread_getaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); + if (s != 0) + { + perror( "pthread_getaffinity_np"); + exit_fun("Error getting processor affinity "); + } + memset(cpu_affinity, 0 , sizeof(cpu_affinity)); + for (j = 0; j < CPU_SETSIZE; j++) + if (CPU_ISSET(j, &cpuset)) + { + char temp[1024]; + sprintf(temp, " CPU_%d ", j); + strcat(cpu_affinity, temp); + } + + memset(&sparam, 0 , sizeof (sparam)); + sparam.sched_priority = sched_get_priority_max(SCHED_FIFO)-1; + policy = SCHED_FIFO ; + + s = pthread_setschedparam(pthread_self(), policy, &sparam); + if (s != 0) + { + perror("pthread_setschedparam : "); + exit_fun("Error setting thread priority"); + } + s = pthread_getschedparam(pthread_self(), &policy, &sparam); + if (s != 0) + { + perror("pthread_getschedparam : "); + exit_fun("Error getting thread priority"); + + } + + LOG_I( HW, "[SCHED][UE] Started UE thread TX on CPU %d TID %ld , sched_policy = %s, priority = %d, CPU Affinity = %s \n", (int)sched_getcpu(), gettid(), + (policy == SCHED_FIFO) ? "SCHED_FIFO" : + (policy == SCHED_RR) ? "SCHED_RR" : + (policy == SCHED_OTHER) ? "SCHED_OTHER" : + "???", + (int) sparam.sched_priority, cpu_affinity); + #endif #endif @@ -780,7 +920,7 @@ static void *UE_thread_rx(void *arg) LOG_D(HW,"Started UE RX thread (id %p)\n",task); #else -#ifdef LOWLATENCY +#ifdef DEADLINE_SCHEDULER struct sched_attr attr; unsigned int flags = 0; @@ -801,9 +941,72 @@ static void *UE_thread_rx(void *arg) } #else - struct sched_param sp; - sp.sched_priority = sched_get_priority_max(SCHED_FIFO)-1; - pthread_setschedparam(pthread_self(),SCHED_FIFO,&sp); + int policy, s, j; + struct sched_param sparam; + char cpu_affinity[1024]; + cpu_set_t cpuset; + + /* Set affinity mask to include CPUs 1 to MAX_CPUS */ + /* CPU 0 is reserved for UHD threads */ + CPU_ZERO(&cpuset); + + #ifdef CPU_AFFINITY + if (get_nprocs() >2) + { + for (j = 1; j < get_nprocs(); j++) + CPU_SET(j, &cpuset); + + s = pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); + if (s != 0) + { + perror( "pthread_setaffinity_np"); + exit_fun("Error setting processor affinity"); + } + } + #endif + + /* Check the actual affinity mask assigned to the thread */ + + s = pthread_getaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); + if (s != 0) + { + perror( "pthread_getaffinity_np"); + exit_fun("Error getting processor affinity "); + } + memset(cpu_affinity, 0 , sizeof(cpu_affinity)); + for (j = 0; j < CPU_SETSIZE; j++) + if (CPU_ISSET(j, &cpuset)) + { + char temp[1024]; + sprintf(temp, " CPU_%d ", j); + strcat(cpu_affinity, temp); + } + + memset(&sparam, 0 , sizeof (sparam)); + sparam.sched_priority = sched_get_priority_max(SCHED_FIFO)-1; + policy = SCHED_FIFO ; + + s = pthread_setschedparam(pthread_self(), policy, &sparam); + if (s != 0) + { + perror("pthread_setschedparam : "); + exit_fun("Error setting thread priority"); + } + s = pthread_getschedparam(pthread_self(), &policy, &sparam); + if (s != 0) + { + perror("pthread_getschedparam : "); + exit_fun("Error getting thread priority"); + + } + + LOG_I( HW, "[SCHED][UE] Started UE RX thread on CPU %d TID %ld , sched_policy = %s, priority = %d, CPU Affinity = %s \n", (int)sched_getcpu(), gettid(), + (policy == SCHED_FIFO) ? "SCHED_FIFO" : + (policy == SCHED_RR) ? "SCHED_RR" : + (policy == SCHED_OTHER) ? "SCHED_OTHER" : + "???", + (int) sparam.sched_priority, cpu_affinity); + #endif #endif @@ -1034,7 +1237,7 @@ void *UE_thread(void *arg) #else -#ifdef LOWLATENCY +#ifdef DEADLINE_SCHEDULER struct sched_attr attr; unsigned int flags = 0; @@ -1226,7 +1429,7 @@ void *UE_thread(void *arg) } } else { LOG_E( PHY, "[SCHED][UE] UE RX thread busy (IC %d)!!\n", instance_cnt_rx); - if (instance_cnt_rx > 1) { + if (instance_cnt_rx > 2) { exit_fun("instance_cnt_rx > 1"); return &UE_thread_retval; } @@ -1262,7 +1465,7 @@ void *UE_thread(void *arg) } else { LOG_E( PHY, "[SCHED][UE] UE TX thread busy (IC %d)!!\n" ); - if (instance_cnt_tx>1) { + if (instance_cnt_tx>2) { exit_fun("instance_cnt_tx > 1"); return &UE_thread_retval; } @@ -1413,7 +1616,7 @@ void *UE_thread(void *arg) int wait_sync_cnt = 0; int first_synch = 1; -#ifdef LOWLATENCY +#ifdef DEADLINE_SCHEDULER struct sched_attr attr; unsigned int flags = 0; // unsigned long mask = 1; // processor 0 @@ -1437,7 +1640,7 @@ void *UE_thread(void *arg) #endif -#ifdef LOWLATENCY +#ifdef DEADLINE_SCHEDULER attr.size = sizeof(attr); attr.sched_flags = 0; attr.sched_nice = 0; diff --git a/targets/RT/USER/rrh_gw.c b/targets/RT/USER/rrh_gw.c index 8084644b853e0b538968bedba3d40f625824344b..4fd687a3a568aa656e58b96e052f27b1b223a37d 100644 --- a/targets/RT/USER/rrh_gw.c +++ b/targets/RT/USER/rrh_gw.c @@ -387,7 +387,7 @@ void *timer_proc(void *arg) { struct itimerspec *old_value; -#ifdef LOWLATENCY +#ifdef DEADLINE_SCHEDULER struct sched_attr attr; unsigned int flags = 0; diff --git a/targets/RT/USER/rt_wrapper.c b/targets/RT/USER/rt_wrapper.c index a011cf8dfe83288be1fed972723c29e8d73fc643..ed9eb4e79833152366c9dbc2109afd1437589b86 100644 --- a/targets/RT/USER/rt_wrapper.c +++ b/targets/RT/USER/rt_wrapper.c @@ -28,7 +28,7 @@ *******************************************************************************/ /*! \file rt_wrapper.h -* \brief provides a wrapper for the timing function, runtime calculations for real-time opeartions depending on weather RTAI or LOWLATENCY kernels are used or not +* \brief provides a wrapper for the timing function, runtime calculations for real-time opeartions depending on weather RTAI or DEADLINE_SCHEDULER kernels are used or not * \author F. Kaltenberger and Navid Nikaein * \date 2013 * \version 0.1 @@ -241,7 +241,7 @@ double get_runtime_rx(int rx_subframe, uint16_t runtime_phy_rx[29][6], uint32_t return runtime; } -#ifdef LOWLATENCY +#ifdef DEADLINE_SCHEDULER int sched_setattr(pid_t pid, const struct sched_attr *attr, unsigned int flags) { diff --git a/targets/RT/USER/rt_wrapper.h b/targets/RT/USER/rt_wrapper.h index 88a3d96efa88f70246146fd0279a3b39c103242e..d67632054b7ee2a14f7c555b7d509452d1851bba 100644 --- a/targets/RT/USER/rt_wrapper.h +++ b/targets/RT/USER/rt_wrapper.h @@ -72,7 +72,7 @@ double get_runtime_rx(int rx_subframe, uint16_t runtime_phy_rx[29][6], uint32_t * see https://www.kernel.org/doc/Documentation/scheduler/sched-deadline.txt or * http://www.blaess.fr/christophe/2014/04/05/utiliser-un-appel-systeme-inconnu-de-la-libc/ */ -#ifdef LOWLATENCY +#ifdef DEADLINE_SCHEDULER #define gettid() syscall(__NR_gettid) diff --git a/targets/RT/USER/sched_dlsch.c b/targets/RT/USER/sched_dlsch.c index d582e79310486bfbcd7fb4447dbb13e46b25e2cd..48fac642a9c1b63d52425ef6b97657c2c81fc724 100644 --- a/targets/RT/USER/sched_dlsch.c +++ b/targets/RT/USER/sched_dlsch.c @@ -51,14 +51,6 @@ #include "SCHED/defs.h" -#include "MAC_INTERFACE/extern.h" - -#ifdef CBMIMO1 -#include "ARCH/CBMIMO1/DEVICE_DRIVER/cbmimo1_device.h" -#include "ARCH/CBMIMO1/DEVICE_DRIVER/extern.h" -#include "ARCH/CBMIMO1/DEVICE_DRIVER/defs.h" -#endif // CBMIMO1 - #include "UTIL/LOG/vcd_signal_dumper.h" #define DEBUG_PHY diff --git a/targets/RT/USER/sched_rx_pdsch.c b/targets/RT/USER/sched_rx_pdsch.c index be1ffbd752611f818ccf96bd6aa75a4ae32e3cfe..e792fe737d936c2fb21f981cc52be3d957a67c86 100644 --- a/targets/RT/USER/sched_rx_pdsch.c +++ b/targets/RT/USER/sched_rx_pdsch.c @@ -51,8 +51,6 @@ #include "SCHED/defs.h" #include "SCHED/extern.h" -#include "MAC_INTERFACE/extern.h" - #include "UTIL/LOG/vcd_signal_dumper.h" RTIME time0,time1; diff --git a/targets/RT/USER/ue_usrp.gtkw b/targets/RT/USER/ue_usrp.gtkw new file mode 100644 index 0000000000000000000000000000000000000000..81940b564362944ca250a9c66d54866861c5290a --- /dev/null +++ b/targets/RT/USER/ue_usrp.gtkw @@ -0,0 +1,53 @@ +[*] +[*] GTKWave Analyzer v3.3.58 (w)1999-2014 BSI +[*] Sun Mar 20 18:27:06 2016 +[*] +[dumpfile] "/tmp/openair_dump_UE.vcd" +[dumpfile_mtime] "Sun Mar 20 18:14:17 2016" +[dumpfile_size] 92262400 +[savefile] "/home/papillon/openairinterface5g/targets/RT/USER/ue_usrp.gtkw" +[timestart] 30032830000 +[size] 1215 640 +[pos] 105 102 +*-22.292629 30041590000 -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] 262 +[sst_expanded] 1 +[sst_vpaned_height] 155 +@24 +variables.hw_subframe[63:0] +@28 +functions.trx_read +functions.trx_write +@24 +variables.subframe_number_RX_UE[63:0] +variables.subframe_number_TX_UE[63:0] +@28 +functions.ue_thread_rx +functions.ue_thread_tx +@420 +variables.ue_inst_cnt_rx[63:0] +variables.ue_inst_cnt_tx[63:0] +@28 +functions.phy_procedures_ue_rx +functions.phy_procedures_ue_tx +@24 +variables.frame_number_RX_UE[63:0] +variables.frame_number_TX_UE[63:0] +@28 +functions.ue_slot_fep +functions.lte_ue_measurement_procedures +functions.ue_rrc_measurements +functions.ue_gain_control +functions.ue_adjust_synch +functions.lte_ue_pbch_procedures +functions.lte_ue_pdcch_procedures +functions.rx_pdcch +functions.dci_decoding +functions.phy_ue_generate_prach +functions.phy_ue_ulsch_encoding +functions.phy_ue_ulsch_modulation +functions.phy_ue_ulsch_scrambling +functions.phy_ue_config_sib2 +[pattern_trace] 1 +[pattern_trace] 0 diff --git a/targets/SIMU/USER/channel_sim.c b/targets/SIMU/USER/channel_sim.c index adb1fb92e7a7a75169b9dd837f3653572935568b..187f1109c0fb8fad67259bf2a69e871ebb3447b6 100644 --- a/targets/SIMU/USER/channel_sim.c +++ b/targets/SIMU/USER/channel_sim.c @@ -39,7 +39,6 @@ #include "PHY/types.h" #include "PHY/defs.h" #include "PHY/extern.h" -#include "MAC_INTERFACE/extern.h" #ifdef OPENAIR2 #include "LAYER2/MAC/defs.h" diff --git a/targets/SIMU/USER/init_lte.c b/targets/SIMU/USER/init_lte.c index 85900387eb604ba21417998f536a5fac0e4c1cb9..861bfa6cbf9bd0eab11a964f4f584086b96a042c 100644 --- a/targets/SIMU/USER/init_lte.c +++ b/targets/SIMU/USER/init_lte.c @@ -38,14 +38,11 @@ #include "init_lte.h" #include "PHY/extern.h" -#include "MAC_INTERFACE/extern.h" -#ifdef OPENAIR2 #include "LAYER2/MAC/defs.h" #include "LAYER2/MAC/extern.h" #include "UTIL/LOG/log_if.h" #include "PHY_INTERFACE/extern.h" -#endif @@ -76,7 +73,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,NSOFT,frame_parms->N_RB_DL,abstraction_flag); + PHY_vars_eNB->dlsch_eNB[i][j] = new_eNB_dlsch(1,8,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); @@ -87,7 +84,7 @@ PHY_VARS_eNB* init_lte_eNB(LTE_DL_FRAME_PARMS *frame_parms, } } - PHY_vars_eNB->ulsch_eNB[1+i] = new_eNB_ulsch(NUMBER_OF_HARQ_PID_MAX,MAX_TURBO_ITERATIONS, frame_parms->N_RB_UL, abstraction_flag); + PHY_vars_eNB->ulsch_eNB[1+i] = new_eNB_ulsch(MAX_TURBO_ITERATIONS,frame_parms->N_RB_UL, abstraction_flag); if (!PHY_vars_eNB->ulsch_eNB[1+i]) { LOG_E(PHY,"Can't get eNB ulsch structures\n"); @@ -121,18 +118,18 @@ PHY_VARS_eNB* init_lte_eNB(LTE_DL_FRAME_PARMS *frame_parms, } // ULSCH for RA - PHY_vars_eNB->ulsch_eNB[0] = new_eNB_ulsch(NUMBER_OF_HARQ_PID_MAX,MAX_TURBO_ITERATIONS, frame_parms->N_RB_UL, abstraction_flag); + PHY_vars_eNB->ulsch_eNB[0] = new_eNB_ulsch(MAX_TURBO_ITERATIONS, frame_parms->N_RB_UL, abstraction_flag); if (!PHY_vars_eNB->ulsch_eNB[0]) { LOG_E(PHY,"Can't get eNB ulsch structures\n"); exit(-1); } - PHY_vars_eNB->dlsch_eNB_SI = new_eNB_dlsch(1,1,NSOFT,frame_parms->N_RB_DL, abstraction_flag); + PHY_vars_eNB->dlsch_eNB_SI = new_eNB_dlsch(1,8,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,NSOFT,frame_parms->N_RB_DL, abstraction_flag); + PHY_vars_eNB->dlsch_eNB_ra = new_eNB_dlsch(1,8,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,NSOFT,frame_parms->N_RB_DL, 0); + PHY_vars_eNB->dlsch_eNB_MCH = new_eNB_dlsch(1,8,NSOFT,frame_parms->N_RB_DL, 0); LOG_D(PHY,"eNB %d : MCH %p\n",eNB_id,PHY_vars_eNB->dlsch_eNB_MCH); @@ -180,7 +177,7 @@ PHY_VARS_UE* init_lte_UE(LTE_DL_FRAME_PARMS *frame_parms, - PHY_vars_UE->ulsch_ue[i] = new_ue_ulsch(NUMBER_OF_HARQ_PID_MAX,frame_parms->N_RB_UL, abstraction_flag); + PHY_vars_UE->ulsch_ue[i] = new_ue_ulsch(frame_parms->N_RB_UL, abstraction_flag); if (!PHY_vars_UE->ulsch_ue[i]) { LOG_E(PHY,"Can't get ue ulsch structures\n"); @@ -250,6 +247,7 @@ void init_lte_vars(LTE_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs], (frame_parms[CC_id])->phich_config_common.phich_resource = oneSixth; (frame_parms[CC_id])->phich_config_common.phich_duration = normal; (frame_parms[CC_id])->Ncp = extended_prefix_flag; + (frame_parms[CC_id])->Ncp_UL = extended_prefix_flag; (frame_parms[CC_id])->Nid_cell = Nid_cell; (frame_parms[CC_id])->nushift = (Nid_cell%6); (frame_parms[CC_id])->nb_antennas_tx = (transmission_mode == 1) ? 1 : 2; diff --git a/targets/SIMU/USER/oaisim.c b/targets/SIMU/USER/oaisim.c index d09f61f06a738872df3ffb6c99db8560b6f966c9..dfbf8f9676c6db683c6312ef150041ea288ea791 100644 --- a/targets/SIMU/USER/oaisim.c +++ b/targets/SIMU/USER/oaisim.c @@ -53,7 +53,6 @@ #include "PHY/defs.h" #include "PHY/LTE_TRANSPORT/proto.h" #include "PHY/vars.h" -#include "MAC_INTERFACE/vars.h" #include "SIMULATION/ETH_TRANSPORT/proto.h" @@ -114,6 +113,8 @@ char smbv_ip[16]; # include "create_tasks.h" #endif +#include "T.h" + /* DCI0_5MHz_TDD0_t UL_alloc_pdu; DCI1A_5MHz_TDD_1_6_t CCCH_alloc_pdu; @@ -246,6 +247,10 @@ help (void) printf ("-Y Set the global log verbosity (none, low, medium, high, full) \n"); printf ("-z Set the cooperation flag (0 for no cooperation, 1 for delay diversity and 2 for distributed alamouti\n"); printf ("-Z Reserved\n"); +#if T_TRACER + printf ("--T_port [port] use given port\n"); + printf ("--T_nowait don't wait for tracer, start immediately\n"); +#endif } pthread_t log_thread; @@ -609,8 +614,9 @@ l2l1_task (void *args_p) start_meas (&oaisim_stats); for (frame = 0; - (l2l1_state != L2L1_TERMINATED) - && (frame < oai_emulation.info.n_frames); + (l2l1_state != L2L1_TERMINATED) && + ((oai_emulation.info.n_frames_flag == 0) || + (frame < oai_emulation.info.n_frames)); frame++) { #if defined(ENABLE_ITTI) @@ -672,12 +678,6 @@ l2l1_task (void *args_p) //oai_emulation.info.time_ms += 1; oai_emulation.info.time_s += 0.01; // emu time in s, each frame lasts for 10 ms // JNote: TODO check the coherency of the time and frame (I corrected it to 10 (instead of 0.01) - // if n_frames not set by the user or is greater than max num frame then set adjust the frame counter - if ((oai_emulation.info.n_frames_flag == 0) - || (oai_emulation.info.n_frames >= 0xffff)) { - frame %= (oai_emulation.info.n_frames - 1); - } - update_omg (frame); // frequency is defined in the omg_global params configurable by the user update_omg_ocm (); @@ -709,7 +709,7 @@ l2l1_task (void *args_p) wait_for_slot_isr (); #if defined(ENABLE_ITTI) - itti_update_lte_time(frame, slot); + itti_update_lte_time(frame % MAX_FRAME_NUMBER, slot); #endif last_slot = (slot - 1) % 20; @@ -745,17 +745,19 @@ l2l1_task (void *args_p) + oai_emulation.info.nb_enb_local)); eNB_inst++) { if (oai_emulation.info.cli_start_enb[eNB_inst] != 0) { - if ((slot & 1) == 0) + if ((slot & 1) == 0) { + T(T_ENB_MASTER_TICK, T_INT(eNB_inst), T_INT(frame % 1024), T_INT(slot/2)); LOG_D(EMU, "PHY procedures eNB %d for frame %d, slot %d (subframe TX %d, RX %d) TDD %d/%d Nid_cell %d\n", eNB_inst, - frame, + frame % MAX_FRAME_NUMBER, slot, PHY_vars_eNB_g[eNB_inst][0]->proc[slot >> 1].subframe_tx, PHY_vars_eNB_g[eNB_inst][0]->proc[slot >> 1].subframe_rx, PHY_vars_eNB_g[eNB_inst][0]->lte_frame_parms.frame_type, PHY_vars_eNB_g[eNB_inst][0]->lte_frame_parms.tdd_config, PHY_vars_eNB_g[eNB_inst][0]->lte_frame_parms.Nid_cell); + } #ifdef OPENAIR2 //Application: traffic gen @@ -824,27 +826,27 @@ l2l1_task (void *args_p) { LOG_D(EMU, "PHY procedures UE %d for frame %d, slot %d (subframe TX %d, RX %d)\n", - UE_inst, frame, slot, next_slot >> 1, + UE_inst, frame % MAX_FRAME_NUMBER, slot, next_slot >> 1, last_slot >> 1); if (PHY_vars_UE_g[UE_inst][0]->UE_mode[0] != NOT_SYNCHED) { if (frame > 0) { - PHY_vars_UE_g[UE_inst][0]->frame_rx = frame; + PHY_vars_UE_g[UE_inst][0]->frame_rx = frame % MAX_FRAME_NUMBER; PHY_vars_UE_g[UE_inst][0]->slot_rx = last_slot; PHY_vars_UE_g[UE_inst][0]->slot_tx = next_slot; if (next_slot > 1) - PHY_vars_UE_g[UE_inst][0]->frame_tx = frame; + PHY_vars_UE_g[UE_inst][0]->frame_tx = frame % MAX_FRAME_NUMBER; else - PHY_vars_UE_g[UE_inst][0]->frame_tx = frame + 1; + PHY_vars_UE_g[UE_inst][0]->frame_tx = (frame + 1) % MAX_FRAME_NUMBER; #ifdef OPENAIR2 //Application update_otg_UE (UE_inst, oai_emulation.info.time_ms); //Access layer - PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, UE_inst, 0, ENB_FLAG_NO, NOT_A_RNTI, frame, next_slot); + PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, UE_inst, 0, ENB_FLAG_NO, NOT_A_RNTI, frame % MAX_FRAME_NUMBER, next_slot); pdcp_run (&ctxt); #endif @@ -896,7 +898,7 @@ l2l1_task (void *args_p) if(last_slot==2 && frame%10==0) { if (UE_stats_th[UE_inst]) { - fprintf(UE_stats_th[UE_inst],"%d %d\n",frame, PHY_vars_UE_g[UE_inst][0]->bitrate[0]/1000); + fprintf(UE_stats_th[UE_inst],"%d %d\n",frame % MAX_FRAME_NUMBER, PHY_vars_UE_g[UE_inst][0]->bitrate[0]/1000); } } @@ -930,7 +932,7 @@ l2l1_task (void *args_p) exit(-1); } - PHY_vars_RN_g[RN_id]->frame = frame; + PHY_vars_RN_g[RN_id]->frame = frame % MAX_FRAME_NUMBER; if ( oai_emulation.info.frame_type == 0) { // RN == UE @@ -938,12 +940,12 @@ l2l1_task (void *args_p) if (PHY_vars_UE_g[UE_inst][0]->UE_mode[0] != NOT_SYNCHED) { LOG_D(EMU,"[RN %d] PHY procedures UE %d for frame %d, slot %d (subframe TX %d, RX %d)\n", RN_id, UE_inst, frame, slot, next_slot >> 1,last_slot>>1); - PHY_vars_UE_g[UE_inst][0]->frame_rx = frame; + PHY_vars_UE_g[UE_inst][0]->frame_rx = frame % MAX_FRAME_NUMBER; PHY_vars_UE_g[UE_inst][0]->slot_rx = last_slot; PHY_vars_UE_g[UE_inst][0]->slot_tx = next_slot; - if (next_slot>1) PHY_vars_UE_g[UE_inst][0]->frame_tx = frame; - else PHY_vars_UE_g[UE_inst][0]->frame_tx = frame+1; + if (next_slot>1) PHY_vars_UE_g[UE_inst][0]->frame_tx = frame % MAX_FRAME_NUMBER; + else PHY_vars_UE_g[UE_inst][0]->frame_tx = (frame+1) % MAX_FRAME_NUMBER; phy_procedures_UE_lte (PHY_vars_UE_g[UE_inst][0], 0, abstraction_flag,normal_txrx, r_type, PHY_vars_RN_g[RN_id]); @@ -954,7 +956,7 @@ l2l1_task (void *args_p) // RN == eNB LOG_D(EMU,"[RN %d] PHY procedures eNB %d for frame %d, slot %d (subframe TX %d, RX %d)\n", - RN_id, eNB_inst, frame, slot, next_slot >> 1,last_slot>>1); + RN_id, eNB_inst, frame % MAX_FRAME_NUMBER, slot, next_slot >> 1,last_slot>>1); phy_procedures_eNB_lte(slot>>1, PHY_vars_eNB_g[eNB_inst], abstraction_flag, r_type, PHY_vars_RN_g[RN_id]); } else { @@ -964,7 +966,7 @@ l2l1_task (void *args_p) } #endif - emu_transport (frame, last_slot, next_slot, direction, + emu_transport (frame % MAX_FRAME_NUMBER, last_slot, next_slot, direction, oai_emulation.info.frame_type[0], ethernet_flag); if ((direction == SF_DL) @@ -1010,7 +1012,7 @@ l2l1_task (void *args_p) enb_data, ue_data, next_slot, abstraction_flag, &PHY_vars_eNB_g[0][CC_id]->lte_frame_parms, - frame, CC_id); + frame % MAX_FRAME_NUMBER, CC_id); } stop_meas (&ul_chan_stats); @@ -1079,7 +1081,7 @@ l2l1_task (void *args_p) next_slot, abstraction_flag, &PHY_vars_eNB_g[0][CC_id]->lte_frame_parms, - frame, CC_id); + frame % MAX_FRAME_NUMBER, CC_id); } stop_meas (&ul_chan_stats); @@ -1096,7 +1098,7 @@ l2l1_task (void *args_p) } } - if ((last_slot == 1) && (frame == 0) && (abstraction_flag == 0) + if ((last_slot == 1) && ((frame % MAX_FRAME_NUMBER) == 0) && (abstraction_flag == 0) && (oai_emulation.info.n_frames == 1)) { write_output ("dlchan0.m", @@ -1144,40 +1146,40 @@ l2l1_task (void *args_p) &&(Channel_Flag==0) #endif ) { - sprintf (fname, "UEtxsig%d.m", frame); - sprintf (vname, "txs%d", frame); + sprintf (fname, "UEtxsig%d.m", frame % MAX_FRAME_NUMBER); + sprintf (vname, "txs%d", frame % MAX_FRAME_NUMBER); write_output (fname, vname, PHY_vars_UE_g[0][0]->lte_ue_common_vars.txdata[0], PHY_vars_UE_g[0][0]->lte_frame_parms.samples_per_tti * 10, 1, 1); - sprintf (fname, "eNBtxsig%d.m", frame); - sprintf (vname, "txs%d", frame); + sprintf (fname, "eNBtxsig%d.m", frame % MAX_FRAME_NUMBER); + sprintf (vname, "txs%d", frame % MAX_FRAME_NUMBER); write_output (fname, vname, PHY_vars_eNB_g[0][0]->lte_eNB_common_vars.txdata[0][0], PHY_vars_UE_g[0][0]->lte_frame_parms.samples_per_tti * 10, 1, 1); - sprintf (fname, "eNBtxsigF%d.m", frame); - sprintf (vname, "txsF%d", frame); + sprintf (fname, "eNBtxsigF%d.m", frame % MAX_FRAME_NUMBER); + sprintf (vname, "txsF%d", frame % MAX_FRAME_NUMBER); write_output (fname, vname, PHY_vars_eNB_g[0][0]->lte_eNB_common_vars.txdataF[0][0], PHY_vars_eNB_g[0][0]->lte_frame_parms.symbols_per_tti * PHY_vars_eNB_g[0][0]->lte_frame_parms.ofdm_symbol_size, 1, 1); - sprintf (fname, "UErxsig%d.m", frame); - sprintf (vname, "rxs%d", frame); + sprintf (fname, "UErxsig%d.m", frame % MAX_FRAME_NUMBER); + sprintf (vname, "rxs%d", frame % MAX_FRAME_NUMBER); write_output (fname, vname, PHY_vars_UE_g[0][0]->lte_ue_common_vars.rxdata[0], PHY_vars_UE_g[0][0]->lte_frame_parms.samples_per_tti * 10, 1, 1); - sprintf (fname, "eNBrxsig%d.m", frame); - sprintf (vname, "rxs%d", frame); + sprintf (fname, "eNBrxsig%d.m", frame % MAX_FRAME_NUMBER); + sprintf (vname, "rxs%d", frame % MAX_FRAME_NUMBER); write_output (fname, vname, PHY_vars_eNB_g[0][0]->lte_eNB_common_vars.rxdata[0][0], @@ -1210,7 +1212,7 @@ l2l1_task (void *args_p) #ifdef SMBV // Rohde&Schwarz SMBV100A vector signal generator - if ((frame == config_frames[0]) || (frame == config_frames[1]) || (frame == config_frames[2]) || (frame == config_frames[3])) { + if ((frame % MAX_FRAME_NUMBER == config_frames[0]) || (frame % MAX_FRAME_NUMBER == config_frames[1]) || (frame % MAX_FRAME_NUMBER == config_frames[2]) || (frame % MAX_FRAME_NUMBER == config_frames[3])) { smbv_frame_cnt++; } @@ -1253,6 +1255,11 @@ l2l1_task (void *args_p) return NULL; } +#if T_TRACER +int T_wait = 1; /* by default we wait for the tracer */ +int T_port = 2021; /* default port to listen to to wait for the tracer */ +#endif + /*------------------------------------------------------------------------------*/ int main (int argc, char **argv) @@ -1269,8 +1276,9 @@ main (int argc, char **argv) int node_id; int port,Process_Flag=0,wgt,Channel_Flag=0,temp; #endif + //default parameters - oai_emulation.info.n_frames = 0xffff; //1024; //10; + oai_emulation.info.n_frames = MAX_FRAME_NUMBER; //1024; //10; oai_emulation.info.n_frames_flag = 0; //fixme snr_dB = 30; @@ -1285,6 +1293,10 @@ main (int argc, char **argv) // get command-line options get_simulation_options (argc, argv); //Command-line options +#if T_TRACER + T_init(T_port, T_wait); +#endif + // Initialize VCD LOG module VCD_SIGNAL_DUMPER_INIT (oai_emulation.info.vcd_file); diff --git a/targets/SIMU/USER/oaisim.h b/targets/SIMU/USER/oaisim.h index 8d3edbe9eb15797c01965e75b603b171d07b75d8..6fb16b82db56ddc83fa395a4fff85cbd86df0baa 100644 --- a/targets/SIMU/USER/oaisim.h +++ b/targets/SIMU/USER/oaisim.h @@ -73,7 +73,7 @@ int ulsch_abstraction(double* sinr_dB,uint8_t TM, uint8_t mcs,uint16_t nb_rb, ui void calc_path_loss(node_desc_t* node_tx, node_desc_t* node_rx, channel_desc_t *ch_desc, Environment_System_Config env_desc, double **SF); -void do_OFDM_mod(mod_sym_t **txdataF, int32_t **txdata, frame_t frame, uint16_t next_slot, LTE_DL_FRAME_PARMS *frame_parms); +void do_OFDM_mod(int32_t **txdataF, int32_t **txdata, frame_t frame, uint16_t next_slot, LTE_DL_FRAME_PARMS *frame_parms); void reset_opp_meas(void); void print_opp_meas(void); diff --git a/targets/SIMU/USER/oaisim_functions.c b/targets/SIMU/USER/oaisim_functions.c index 72153c3ee7a7a351f8d572213cf5a2eb7193d714..f8043b2cfd710c11f5a41cea72ae73387ef37721 100644 --- a/targets/SIMU/USER/oaisim_functions.c +++ b/targets/SIMU/USER/oaisim_functions.c @@ -51,7 +51,6 @@ #include "oaisim_functions.h" #include "PHY/extern.h" -#include "MAC_INTERFACE/extern.h" #include "LAYER2/MAC/extern.h" #ifdef OPENAIR2 #include "LAYER2/MAC/proto.h" @@ -213,6 +212,11 @@ void get_simulation_options(int argc, char *argv[]) LONG_OPTION_PHYTEST, LONG_OPTION_XFORMS, + +#if T_TRACER + LONG_OPTION_T_PORT, + LONG_OPTION_T_NOWAIT, +#endif }; static struct option long_options[] = { @@ -247,6 +251,11 @@ void get_simulation_options(int argc, char *argv[]) {"phy-test", no_argument, NULL, LONG_OPTION_PHYTEST}, {"xforms", no_argument, 0, LONG_OPTION_XFORMS}, +#if T_TRACER + {"T_port", required_argument, 0, LONG_OPTION_T_PORT}, + {"T_nowait", no_argument, 0, LONG_OPTION_T_NOWAIT}, +#endif + {NULL, 0, NULL, 0} }; @@ -414,6 +423,21 @@ void get_simulation_options(int argc, char *argv[]) xforms=1; break; +#if T_TRACER + case LONG_OPTION_T_PORT: { + extern int T_port; + if (optarg == NULL) abort(); /* should not happen */ + T_port = atoi(optarg); + break; + } + + case LONG_OPTION_T_NOWAIT: { + extern int T_wait; + T_wait = 0; + break; + } +#endif + case 'a': abstraction_flag = 1; break; diff --git a/targets/SIMU/USER/sinr_sim.c b/targets/SIMU/USER/sinr_sim.c index 9ac1371d1193ae848fdbeb217b4ece04d9faaebc..b235e16585d086e1dbafb642e1e0e45f249fb73f 100644 --- a/targets/SIMU/USER/sinr_sim.c +++ b/targets/SIMU/USER/sinr_sim.c @@ -40,7 +40,6 @@ #include "PHY/types.h" #include "PHY/defs.h" #include "PHY/extern.h" -#include "MAC_INTERFACE/extern.h" #include "oaisim_config.h" #ifdef OPENAIR2