Merge branch 'develop' into feature-21-TM7 and conflict resolve
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
job1:
|
||||
script:
|
||||
- echo $PWD
|
||||
- echo $USER
|
||||
- echo $OAI_USER
|
||||
- echo $OAI_EXTRA_ARGS
|
||||
- echo $NFS_SHARE_DIR
|
||||
- echo $EXTERNAL_SHARE_DIR
|
||||
- echo $SHELL
|
||||
- git rev-parse --abbrev-ref HEAD
|
||||
- git_head=`git rev-parse HEAD`
|
||||
- echo $git_head
|
||||
- tmp=`git show-ref --head | grep $git_head`
|
||||
- tmp=(${tmp///// })
|
||||
- git_branch=${tmp[@]:(-1)}
|
||||
- echo $git_branch
|
||||
- source oaienv
|
||||
- echo $OPENAIR_DIR
|
||||
- NFS_TEST_RESULTS_DIR=$NFS_SHARE_DIR/$git_branch/$git_head
|
||||
- EXTERNAL_SHARE_RESULTS_DIR=$EXTERNAL_SHARE_DIR/$git_branch/$git_head
|
||||
- echo $NFS_TEST_RESULTS_DIR
|
||||
- echo $EXTERNAL_SHARE_RESULTS_DIR
|
||||
- echo $NRUNS_LTE_SOFTMODEM
|
||||
- echo $TIMEOUT_CMD
|
||||
- mkdir -p $OPENAIR_DIR/cmake_targets/autotests/log
|
||||
- python $OPENAIR_DIR/cmake_targets/autotests/run_exec_lte-softmodem_tests.py -c -5GRepoHeadVersion $git_head -n $NFS_SHARE_DIR -u $OAI_USER -p $OAI_PASS $OAI_EXTRA_ARGS -g "$OAI_TEST_CASE_GROUP">& $OPENAIR_DIR/cmake_targets/autotests/python_autotest_cleanup.log
|
||||
- python $OPENAIR_DIR/cmake_targets/autotests/run_exec_lte-softmodem_tests.py -r -5GRepoHeadVersion $git_head -n $NFS_SHARE_DIR -u $OAI_USER -p $OAI_PASS `echo $OAI_EXTRA_ARGS` -g "$OAI_TEST_CASE_GROUP" --nrun_lte_softmodem $NRUNS_LTE_SOFTMODEM --timeout_cmd $TIMEOUT_CMD >& $OPENAIR_DIR/cmake_targets/autotests/python_autotest.log
|
||||
- mv $OPENAIR_DIR/cmake_targets/autotests/python_autotest.log $OPENAIR_DIR/cmake_targets/autotests/log/python_autotest.log
|
||||
- mv $OPENAIR_DIR/cmake_targets/autotests/python_autotest_cleanup.log $OPENAIR_DIR/cmake_targets/autotests/log/python_autotest_cleanup.log
|
||||
- sshpass -p "$OAI_PASS" rsync -az -e "ssh -o StrictHostKeyChecking=no " --rsync-path="mkdir -p $NFS_TEST_RESULTS_DIR && rsync" $OPENAIR_DIR/cmake_targets/autotests/log $OAI_USER@localhost:$NFS_TEST_RESULTS_DIR
|
||||
- sshpass -p "$OAI_PASS" rsync -az -e "ssh -o StrictHostKeyChecking=no " --rsync-path="mkdir -p $EXTERNAL_SHARE_DIR && rsync" $OPENAIR_DIR/cmake_targets/autotests/log $OAI_USER@localhost:$EXTERNAL_SHARE_DIR
|
||||
- cat $OPENAIR_DIR/cmake_targets/autotests/log/results_autotests.xml
|
||||
@@ -36,7 +36,7 @@ set (OPENAIR1_DIR ${OPENAIR_DIR}/openair1)
|
||||
set (OPENAIR2_DIR ${OPENAIR_DIR}/openair2)
|
||||
set (OPENAIR3_DIR ${OPENAIR_DIR}/openair3)
|
||||
set (OPENAIR_TARGETS ${OPENAIR_DIR}/targets)
|
||||
set (OPENAIR3_DIR ${OPENAIR_DIR}/openair3)
|
||||
set (OPENAIR3_DIR ${OPENAIR_DIR}/openair3)
|
||||
set (OPENAIR_CMAKE ${OPENAIR_DIR}/cmake_targets)
|
||||
set (OPENAIR_BIN_DIR ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY})
|
||||
|
||||
@@ -134,9 +134,6 @@ else (CMAKE_SYSTEM_PROCESSOR STREQUAL "armv7l")
|
||||
if (CPUINFO MATCHES "avx2")
|
||||
set(C_FLAGS_PROCESSOR "${C_FLAGS_PROCESSOR} -mavx2")
|
||||
endif()
|
||||
if (CPUINFO MATCHES "sse4_2")
|
||||
set(C_FLAGS_PROCESSOR "${C_FLAGS_PROCESSOR} -msse4.2")
|
||||
endif()
|
||||
if (CPUINFO MATCHES "sse4_1")
|
||||
set(C_FLAGS_PROCESSOR "${C_FLAGS_PROCESSOR} -msse4.1")
|
||||
endif()
|
||||
@@ -150,8 +147,8 @@ set(C_FLAGS_PROCESSOR " ${C_FLAGS_PROCESSOR} ${CFLAGS_PROCESSOR_USER}")
|
||||
Message("C_FLAGS_PROCESSOR is ${C_FLAGS_PROCESSOR}")
|
||||
|
||||
if (CMAKE_SYSTEM_PROCESSOR MATCHES "x86")
|
||||
if ( (NOT( C_FLAGS_PROCESSOR MATCHES "ssse3")) OR (NOT( C_FLAGS_PROCESSOR MATCHES "msse4.1")) OR (NOT( C_FLAGS_PROCESSOR MATCHES "msse4.2")) )
|
||||
Message(FATAL_ERROR "For x86 Architecture, you must have following flags: -mssse3 -msse4.1 -msse4.2. The current detected flags are: ${C_FLAGS_PROCESSOR}. You can pass the flags manually in build script, for example: ./build_oai --cflags_processor \"-mssse3 -msse4.1 -msse4.2\" ")
|
||||
if ( (NOT( C_FLAGS_PROCESSOR MATCHES "ssse3")) OR (NOT( C_FLAGS_PROCESSOR MATCHES "msse4.1")) )
|
||||
Message(FATAL_ERROR "For x86 Architecture, you must have following flags: -mssse3 -msse4.1. The current detected flags are: ${C_FLAGS_PROCESSOR}. You can pass the flags manually in build script, for example: ./build_oai --cflags_processor \"-mssse3 -msse4.1\" ")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@@ -165,6 +162,11 @@ set(CMAKE_C_FLAGS
|
||||
set(CMAKE_CXX_FLAGS
|
||||
"${CMAKE_CXX_FLAGS} ${C_FLAGS_PROCESSOR}"
|
||||
)
|
||||
|
||||
|
||||
#########################
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-rpath -Wl,${OPENAIR_TARGETS}/bin")
|
||||
#########################
|
||||
# set a flag for changes in the source code
|
||||
# these changes are related to hardcoded path to include .h files
|
||||
add_definitions(-DCMAKER)
|
||||
@@ -248,6 +250,9 @@ endif (${RTAI})
|
||||
set(asn1c_call "${OPENAIR_CMAKE}/tools/generate_asn1")
|
||||
set(asn1_generated_dir ${OPENAIR_BIN_DIR})
|
||||
|
||||
set(protoc_call "${OPENAIR_CMAKE}/tools/generate_protobuf")
|
||||
set(protobuf_generated_dir ${OPENAIR_BIN_DIR})
|
||||
|
||||
# RRC
|
||||
######
|
||||
add_list2_option(RRC_ASN1_VERSION "Rel10" "ASN.1 version of RRC interface" "Rel8" "Rel10" "CBA")
|
||||
@@ -408,8 +413,47 @@ add_list1_option(NB_ANTENNAS_RX "2" "Number of antennas in reception" "1" "2" "4
|
||||
add_list1_option(NB_ANTENNAS_TX "4" "Number of antennas in transmission" "1" "2" "4")
|
||||
add_list1_option(NB_ANTENNAS_TXRX "2" "Number of antennas in ????" "1" "2" "4")
|
||||
|
||||
add_list2_option(RF_BOARD "EXMIMO" "RF head type" "False" "EXMIMO" "OAI_USRP" "ETHERNET" "OAI_BLADERF" "CPRIGW")
|
||||
add_list2_option(RF_BOARD "EXMIMO" "RF head type" "None" "EXMIMO" "OAI_USRP" "OAI_BLADERF" "CPRIGW")
|
||||
|
||||
add_list2_option(TRANSP_PRO "None" "Transport protocol type" "None" "ETHERNET")
|
||||
|
||||
|
||||
# include RF devices / transport protocols library modules
|
||||
######################################################################
|
||||
|
||||
include_directories("${OPENAIR_TARGETS}/ARCH/EXMIMO/USERSPACE/LIB/")
|
||||
include_directories ("${OPENAIR_TARGETS}/ARCH/EXMIMO/DEFS/")
|
||||
#set (option_HWEXMIMOLIB_lib "-l ")
|
||||
set(HWLIB_EXMIMO_SOURCE
|
||||
${OPENAIR_TARGETS}/ARCH/EXMIMO/USERSPACE/LIB/openair0_lib.c
|
||||
${OPENAIR_TARGETS}/ARCH/EXMIMO/USERSPACE/LIB/gain_control.c
|
||||
)
|
||||
add_library(oai_exmimodevif MODULE ${HWLIB_EXMIMO_SOURCE} )
|
||||
|
||||
include_directories("${OPENAIR_TARGETS}/ARCH/USRP/USERSPACE/LIB/")
|
||||
set (option_HWUSRPLIB_lib "-l uhd")
|
||||
set(HWLIB_USRP_SOURCE
|
||||
${OPENAIR_TARGETS}/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp
|
||||
)
|
||||
add_library(oai_usrpdevif MODULE ${HWLIB_USRP_SOURCE} )
|
||||
|
||||
include_directories("${OPENAIR_TARGETS}/ARCH/BLADERF/USERSPACE/LIB/")
|
||||
set (option_HWBLADERFLIB_lib "-l bladerf")
|
||||
set(HWLIB_BLADERF_SOURCE
|
||||
${OPENAIR_TARGETS}/ARCH/BLADERF/USERSPACE/LIB/bladerf_lib.c
|
||||
)
|
||||
add_library(oai_bladerfdevif MODULE ${HWLIB_BLADERF_SOURCE} )
|
||||
|
||||
include_directories("${OPENAIR_TARGETS}/ARCH/ETHERNET/USERSPACE/LIB/")
|
||||
set(TPLIB_ETHERNET_SOURCE
|
||||
${OPENAIR_TARGETS}/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.c
|
||||
${OPENAIR_TARGETS}/ARCH/ETHERNET/USERSPACE/LIB/eth_udp.c
|
||||
${OPENAIR_TARGETS}/ARCH/ETHERNET/USERSPACE/LIB/eth_raw.c
|
||||
)
|
||||
add_library(oai_eth_transpro MODULE ${TPLIB_ETHERNET_SOURCE} )
|
||||
|
||||
# RF devices / transport protocols settings
|
||||
######################################################################
|
||||
if (${RF_BOARD} STREQUAL "EXMIMO")
|
||||
set(DRIVER2013)
|
||||
include_directories ("${OPENAIR_TARGETS}/ARCH/EXMIMO/USERSPACE/LIB/")
|
||||
@@ -417,6 +461,7 @@ if (${RF_BOARD} STREQUAL "EXMIMO")
|
||||
set(HW_SOURCE ${HW_SOURCE}
|
||||
${OPENAIR_TARGETS}/ARCH/EXMIMO/USERSPACE/LIB/openair0_lib.c
|
||||
${OPENAIR_TARGETS}/ARCH/EXMIMO/USERSPACE/LIB/gain_control.c)
|
||||
set(option_HW_lib "-rdynamic -ldl")
|
||||
|
||||
elseif (${RF_BOARD} STREQUAL "OAI_USRP")
|
||||
include_directories("${OPENAIR_TARGETS}/ARCH/USRP/USERSPACE/LIB/")
|
||||
@@ -424,8 +469,7 @@ elseif (${RF_BOARD} STREQUAL "OAI_USRP")
|
||||
set(HW_SOURCE ${HW_SOURCE}
|
||||
${OPENAIR_TARGETS}/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp)
|
||||
LINK_DIRECTORIES("/opt/lib")
|
||||
set(option_HW_lib "uhd")
|
||||
set(LOWLATENCY False)
|
||||
set(option_HW_lib "-luhd -rdynamic -ldl")
|
||||
|
||||
elseif (${RF_BOARD} STREQUAL "OAI_BLADERF")
|
||||
include_directories("${OPENAIR_TARGETS}/ARCH/BLADERF/USERSPACE/LIB/")
|
||||
@@ -435,26 +479,35 @@ elseif (${RF_BOARD} STREQUAL "OAI_BLADERF")
|
||||
${OPENAIR_TARGETS}/ARCH/BLADERF/USERSPACE/LIB/bladerf_lib.c
|
||||
)
|
||||
LINK_DIRECTORIES("/usr/lib/x86_64-linux-gnu")
|
||||
set(option_HW_lib "bladeRF")
|
||||
#set(LOWLATENCY False)
|
||||
|
||||
elseif (${RF_BOARD} STREQUAL "ETHERNET")
|
||||
include_directories ("${OPENAIR_TARGETS}/ARCH/ETHERNET/USERSPACE/LIB")
|
||||
set(HW_SOURCE ${HW_SOURCE}
|
||||
${OPENAIR_TARGETS}/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.c
|
||||
)
|
||||
set(LOWLATENCY True)
|
||||
|
||||
elseif (${RF_BOARD} STREQUAL "CPRIGW")
|
||||
set(option_HW_lib "bladeRF -rdynamic -ldl")
|
||||
|
||||
elseif (${RF_BOARD} STREQUAL "CPRIGW") #to ask
|
||||
set(HW_SOURCE ${HW_SOURCE}
|
||||
${OPENAIR_TARGETS}/ARCH/CPRIGW/USERSPACE/LIB/cprigw_lib.c
|
||||
)
|
||||
include_directories("${OPENAIR_TARGETS}/ARCH/CPRIGW/USERSPACE/LIB/")
|
||||
set(option_HW_lib "-rdynamic dl")
|
||||
set(option_HW_lib "-rdynamic dl")
|
||||
|
||||
endif (${RF_BOARD} STREQUAL "EXMIMO")
|
||||
|
||||
|
||||
if (${TRANSP_PRO} STREQUAL "ETHERNET")
|
||||
|
||||
include_directories ("${OPENAIR_TARGETS}/ARCH/ETHERNET/USERSPACE/LIB")
|
||||
set(TRANSPORT_SOURCE ${TRANSPORT_SOURCE}
|
||||
${OPENAIR_TARGETS}/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.c
|
||||
${OPENAIR_TARGETS}/ARCH/ETHERNET/USERSPACE/LIB/eth_udp.c
|
||||
${OPENAIR_TARGETS}/ARCH/ETHERNET/USERSPACE/LIB/eth_raw.c
|
||||
)
|
||||
set(option_TP_lib "-rdynamic -ldl")
|
||||
|
||||
|
||||
endif (${TRANSP_PRO} STREQUAL "ETHERNET")
|
||||
##########################################################
|
||||
|
||||
include_directories ("${OPENAIR_TARGETS}/ARCH/COMMON")
|
||||
|
||||
Message("LOWLATENCY flag is ${LOWLATENCY}")
|
||||
|
||||
##############################################################
|
||||
# ???!!! TO BE DOCUMENTED OPTIONS !!!???
|
||||
@@ -463,6 +516,7 @@ add_boolean_option(ENABLE_SECURITY True "Enable LTE integrity and ciphe
|
||||
add_boolean_option(ENABLE_USE_MME True "eNB connected to MME (INTERFACE S1-C), not standalone eNB")
|
||||
add_boolean_option(NO_RRM True "DO WE HAVE A RADIO RESSOURCE MANAGER: NO")
|
||||
add_boolean_option(USER_MODE True "????")
|
||||
add_boolean_option(RRC_DEFAULT_RAB_IS_AM False "set the RLC mode to AM for the default bearer")
|
||||
|
||||
add_boolean_option(OAI_NW_DRIVER_TYPE_ETHERNET False "????")
|
||||
add_boolean_option(DISABLE_USE_NAS False "???")
|
||||
@@ -476,6 +530,9 @@ add_list_string_option(PACKAGE_NAME "NotDefined" "As per attribute name")
|
||||
add_boolean_option(MESSAGE_CHART_GENERATOR False "For generating sequence diagrams")
|
||||
add_boolean_option(MESSAGE_CHART_GENERATOR_RLC_MAC False "trace RLC-MAC exchanges in sequence diagrams")
|
||||
add_boolean_option(MESSAGE_CHART_GENERATOR_PHY False "trace some PHY exchanges in sequence diagrams")
|
||||
|
||||
add_boolean_option(ENB_AGENT True "enable eNB agent to inteface with a SDN contrller")
|
||||
|
||||
########################
|
||||
# Include order
|
||||
##########################
|
||||
@@ -848,6 +905,7 @@ set(PHY_SRC
|
||||
${OPENAIR1_DIR}/PHY/CODING/viterbi_lte.c
|
||||
${OPENAIR1_DIR}/PHY/INIT/lte_init.c
|
||||
${OPENAIR1_DIR}/PHY/INIT/lte_parms.c
|
||||
${OPENAIR1_DIR}/PHY/INIT/lte_param_init.c
|
||||
${OPENAIR1_DIR}/PHY/TOOLS/file_output.c
|
||||
${OPENAIR1_DIR}/PHY/TOOLS/lte_dfts.c
|
||||
${OPENAIR1_DIR}/PHY/TOOLS/log2_approx.c
|
||||
@@ -1406,10 +1464,11 @@ add_definitions(-DASN1_MINIMUM_VERSION=924)
|
||||
|
||||
#################################
|
||||
# add executables for operation
|
||||
#################################""
|
||||
#################################
|
||||
|
||||
# lte-softmodem is both eNB and UE implementation
|
||||
###################################################
|
||||
|
||||
add_executable(lte-softmodem
|
||||
${rrc_h}
|
||||
${s1ap_h}
|
||||
@@ -1427,6 +1486,7 @@ add_executable(lte-softmodem
|
||||
${OPENAIR3_DIR}/NAS/UE/nas_ue_task.c
|
||||
${GTPU_need_ITTI}
|
||||
${HW_SOURCE}
|
||||
${TRANSPORT_SOURCE}
|
||||
${RTAI_SOURCE}
|
||||
${XFORMS_SOURCE}
|
||||
${XFORMS_SOURCE_SOFTMODEM}
|
||||
@@ -1439,7 +1499,7 @@ target_link_libraries (lte-softmodem
|
||||
|
||||
|
||||
target_link_libraries (lte-softmodem ${LIBXML2_LIBRARIES})
|
||||
target_link_libraries (lte-softmodem pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} sctp ${option_HW_lib} ${XFORMS_LIBRARIES} )
|
||||
target_link_libraries (lte-softmodem pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} sctp ${option_HW_lib} ${option_TP_lib} ${XFORMS_LIBRARIES} )
|
||||
target_link_libraries (lte-softmodem ${LIBBOOST_LIBRARIES})
|
||||
|
||||
# lte-softmodem-nos1 is both eNB and UE implementation
|
||||
@@ -1461,6 +1521,7 @@ add_executable(lte-softmodem-nos1
|
||||
#${OPENAIR2_DIR}/RRC/NAS/rb_config.c
|
||||
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/netlink_init.c
|
||||
${HW_SOURCE}
|
||||
${TRANSPORT_SOURCE}
|
||||
${RTAI_SOURCE}
|
||||
${XFORMS_SOURCE}
|
||||
${XFORMS_SOURCE_SOFTMODEM}
|
||||
@@ -1471,38 +1532,36 @@ target_link_libraries (lte-softmodem-nos1
|
||||
-Wl,--end-group )
|
||||
|
||||
target_link_libraries (lte-softmodem-nos1 ${LIBXML2_LIBRARIES})
|
||||
target_link_libraries (lte-softmodem-nos1 pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} ${option_HW_lib} ${XFORMS_LIBRARIES} )
|
||||
target_link_libraries (lte-softmodem-nos1 pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} ${option_HW_lib} ${option_TP_lib} ${XFORMS_LIBRARIES} )
|
||||
target_link_libraries (lte-softmodem-nos1 ${LIBBOOST_LIBRARIES})
|
||||
|
||||
|
||||
|
||||
# rrh
|
||||
################################
|
||||
set(DRIVER2013)
|
||||
|
||||
#Note: only on RF type is currently supported for RRH
|
||||
#Note: only one RF type (USRP) is currently supported for RRH
|
||||
add_executable(rrh_gw
|
||||
${OPENAIR_TARGETS}/RT/USER/rrh_gw.c
|
||||
${OPENAIR_TARGETS}/RT/USER/eNB_transport_IQ.c
|
||||
${OPENAIR_TARGETS}/RT/USER/UE_transport_IQ.c
|
||||
${OPENAIR_TARGETS}/RT/USER/rt_wrapper.c
|
||||
${OPENAIR_TARGETS}/ARCH/COMMON/common_lib.c
|
||||
${OPENAIR_TARGETS}/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.c
|
||||
${HW_SOURCE}
|
||||
${TRANSPORT_SOURCE}
|
||||
)
|
||||
# assert and common_lib.h
|
||||
target_include_directories(rrh_gw PRIVATE ${OPENAIR_DIR}/common/utils/itti ${OPENAIR_TARGETS}/ARCH/COMMON ${OPENAIR_TARGETS}/ARCH/ETHERNET/USERSPACE/LIB/ )
|
||||
|
||||
# assert
|
||||
target_include_directories(rrh_gw PRIVATE ${OPENAIR_DIR}/common/utils/itti)
|
||||
target_link_libraries(rrh_gw
|
||||
-Wl,--start-group
|
||||
UTIL LFDS
|
||||
-Wl,--end-group )
|
||||
target_link_libraries (rrh_gw rt pthread m )
|
||||
target_link_libraries (rrh_gw ${option_HW_lib} ${LIBBOOST_LIBRARIES} )
|
||||
target_link_libraries (rrh_gw ${option_HW_lib} ${option_TP_lib} ${LIBBOOST_LIBRARIES} )
|
||||
|
||||
#Message("-- default_HW_lib=ETHERNET") # only in case of RRH
|
||||
Message("-- option_HW_lib=${option_HW_lib}")
|
||||
Message("-- HW_SOURCE=${HW_SOURCE}")
|
||||
Message("-- option_TP_lib=${option_TP_lib}")
|
||||
Message("-- TRANSPORT_SOURCE=${TRANSPORT_SOURCE}")
|
||||
|
||||
# USIM process
|
||||
#################
|
||||
@@ -1553,6 +1612,7 @@ add_executable(oaisim
|
||||
${GTPU_need_ITTI}
|
||||
${OPENAIR_TARGETS}/COMMON/create_tasks.c
|
||||
${HW_SOURCE}
|
||||
${TRANSPORT_SOURCE}
|
||||
${XFORMS_SOURCE}
|
||||
)
|
||||
|
||||
@@ -1564,7 +1624,7 @@ target_link_libraries (oaisim
|
||||
-Wl,--end-group )
|
||||
|
||||
target_link_libraries (oaisim ${LIBXML2_LIBRARIES} ${LAPACK_LIBRARIES})
|
||||
target_link_libraries (oaisim pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} sctp ${option_HW_lib}
|
||||
target_link_libraries (oaisim pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} sctp ${option_HW_lib} ${option_TP_lib}
|
||||
${ATLAS_LIBRARIES} ${XFORMS_LIBRARIES} ${OPENPGM_LIBRARIES})
|
||||
#Force link with forms, regardless XFORMS option
|
||||
target_link_libraries (oaisim forms)
|
||||
@@ -1591,6 +1651,7 @@ add_executable(oaisim_nos1
|
||||
${OPENAIR2_DIR}/UTIL/OMG/sumo.c
|
||||
${OPENAIR_TARGETS}/COMMON/create_tasks.c
|
||||
${HW_SOURCE}
|
||||
${TRANSPORT_SOURCE}
|
||||
${XFORMS_SOURCE}
|
||||
)
|
||||
target_include_directories(oaisim_nos1 PUBLIC ${OPENAIR_TARGETS}/SIMU/USER)
|
||||
@@ -1600,7 +1661,7 @@ target_link_libraries (oaisim_nos1
|
||||
-Wl,--end-group )
|
||||
|
||||
target_link_libraries (oaisim_nos1 ${LIBXML2_LIBRARIES} ${LAPACK_LIBRARIES})
|
||||
target_link_libraries (oaisim_nos1 pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} ${option_HW_lib}
|
||||
target_link_libraries (oaisim_nos1 pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} ${option_HW_lib} ${option_TP_lib}
|
||||
${ATLAS_LIBRARIES} ${XFORMS_LIBRARIES} ${OPENPGM_LIBRARIES})
|
||||
#Force link with forms, regardless XFORMS option
|
||||
target_link_libraries (oaisim_nos1 forms)
|
||||
@@ -1652,7 +1713,7 @@ foreach(myExe s1ap
|
||||
${OPENAIR3_DIR}/TEST/test_${myExe}.c
|
||||
)
|
||||
target_link_libraries (test_${myExe}
|
||||
-Wl,--start-group SECU_CN UTIL LFDS -Wl,--end-group m rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} ${CONFIG_LIBRARIES} fdproto fdcore
|
||||
-Wl,--start-group SECU_CN UTIL LFDS -Wl,--end-group m rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} ${CONFIG_LIBRARIES}
|
||||
)
|
||||
endforeach(myExe)
|
||||
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
cmake_minimum_required(VERSION 2.8)
|
||||
set(OAI_NW_DRIVER_TYPE_ETHERNET True)
|
||||
set(OAI_NW_DRIVER_USE_NETLINK True)
|
||||
set(NAS_NETLINK True)
|
||||
include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt)
|
||||
@@ -1,72 +0,0 @@
|
||||
cmake_minimum_required(VERSION 2.8)
|
||||
|
||||
set(ADDR_CONF False)
|
||||
set(DEBUG_OMG False)
|
||||
set(DISABLE_XER_PRINT False)
|
||||
set(DRIVER2013 False)
|
||||
set(ENABLE_FXP True)
|
||||
set(ENABLE_ITTI True)
|
||||
set(ENABLE_NAS_UE_LOGGING False)
|
||||
set(ENABLE_NEW_MULTICAST True)
|
||||
set(ENABLE_PGM_TRANSPORT True)
|
||||
set(ENABLE_RAL False)
|
||||
set(ENABLE_SECURITY False)
|
||||
set(ENABLE_USE_CPU_EXECUTION_TIME True)
|
||||
set(ENABLE_USE_MME False)
|
||||
set(ENABLE_VCD_FIFO True)
|
||||
set(HARD_RT False)
|
||||
set(JUMBO_FRAME True)
|
||||
set(LARGE_SCALE False)
|
||||
set(LINK_ENB_PDCP_TO_GTPV1U False)
|
||||
set(LINUX_LIST False)
|
||||
set(LINUX True)
|
||||
set(LOCALIZATION False)
|
||||
set(LOG_NO_THREAD True)
|
||||
set(LOWLATENCY False)
|
||||
set(MAC_CONTEXT 1)
|
||||
set(MAX_NUM_CCs 1)
|
||||
set(MIH_C_MEDIEVAL_EXTENSIONS False)
|
||||
set(MSG_PRINT False)
|
||||
set(MU_RECEIVER False)
|
||||
set(NAS_ADDRESS_FIX true)
|
||||
set(NAS_NETLINK True)
|
||||
set(NAS_UE True)
|
||||
set(NEW_FFT True)
|
||||
set(NO_RRM True)
|
||||
set(OAI_EMU True)
|
||||
set(OAI_EMU True)
|
||||
set(OAI_NW_DRIVER_TYPE_ETHERNET True)
|
||||
set(OPENAIR1 False)
|
||||
set(OPENAIR2 True)
|
||||
set(OPENAIR_EMU True)
|
||||
set(OPENAIR_LTE True)
|
||||
set (PACKAGE_NAME "oaisim")
|
||||
set(PACKAGE_NAME "oaisim")
|
||||
set(PBS_SIM False)
|
||||
set(PC_DSP False)
|
||||
set(PC_TARGET False)
|
||||
set(PDCP_MSG_PRINT False)
|
||||
set(PERFECT_CE False)
|
||||
set(PHY_ABSTRACTION True)
|
||||
set(PHY_ABSTRACTION True)
|
||||
set(PHY_EMUL False)
|
||||
set(PHYSIM False)
|
||||
set(PUCCH True)
|
||||
set(RANDOM_BF False)
|
||||
set(RF_BOARD "NoBoard")
|
||||
set(RLC_STOP_ON_LOST_PDU True)
|
||||
set(RRC_ASN1_VERSION Rel8)
|
||||
set(RRC_ASN1_VERSION "Rel8")
|
||||
set(RRC_MSG_PRINT False)
|
||||
set(RTAI False)
|
||||
set(SECU False)
|
||||
set(SMBV False)
|
||||
set(SPECTRA False)
|
||||
set(TEST_OMG False)
|
||||
set(USE_3GPP_ADDR_AS_LINK_ADDR False)
|
||||
set(USE_MME False)
|
||||
set(USER_MODE True)
|
||||
set(XER_PRINT False)
|
||||
set(XFORMS False)
|
||||
|
||||
include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt)
|
||||
@@ -1,107 +0,0 @@
|
||||
cmake_minimum_required(VERSION 2.8)
|
||||
|
||||
set ( ADDR_CONF False )
|
||||
set ( DEBUG_OMG False )
|
||||
set ( DISABLE_USE_NAS False )
|
||||
set ( DISABLE_XER_PRINT False )
|
||||
set ( DRIVER2013 False )
|
||||
set ( EMOS False )
|
||||
set ( ENABLE_FXP True )
|
||||
set ( ENABLE_ITTI True )
|
||||
set ( ENABLE_NAS_UE_LOGGING False )
|
||||
set ( ENABLE_NEW_MULTICAST True )
|
||||
set ( ENABLE_PGM_TRANSPORT True )
|
||||
set ( ENABLE_RAL False )
|
||||
set ( ENABLE_SECURITY False )
|
||||
set ( ENABLE_STANDALONE_EPC False )
|
||||
set ( ENABLE_USE_CPU_EXECUTION_TIME True )
|
||||
set ( ENABLE_USE_MME False )
|
||||
set ( ENABLE_VCD_FIFO True )
|
||||
set ( ENB_MODE True )
|
||||
set ( EPC_BUILD False )
|
||||
set ( HARD_RT False )
|
||||
set ( JUMBO_FRAME True )
|
||||
set ( LARGE_SCALE False )
|
||||
set ( LINK_ENB_PDCP_TO_GTPV1U False )
|
||||
set ( LINK_ENB_PDCP_TO_IP_DRIVER False )
|
||||
set ( LINUX_LIST False )
|
||||
set ( LINUX True )
|
||||
set ( LOCALIZATION False )
|
||||
set ( LOG_NO_THREAD True )
|
||||
set ( LOWLATENCY False )
|
||||
set ( MAC_CONTEXT 1 )
|
||||
set ( MAX_NUM_CCs 1 )
|
||||
set ( MESSAGE_CHART_GENERATOR False )
|
||||
set ( MESSAGE_CHART_GENERATOR_RLC_MAC False )
|
||||
set ( MESSAGE_CHART_GENERATOR_PHY False )
|
||||
set ( MIH_C_MEDIEVAL_EXTENSIONS False )
|
||||
set ( MSG_PRINT False )
|
||||
set ( MU_RECEIVER False )
|
||||
set ( NAS_ADDRESS_FIX False )
|
||||
set ( NAS_BUILT_IN_EPC False )
|
||||
set ( NAS_BUILT_IN_UE False )
|
||||
set ( NAS_MME False )
|
||||
set ( NAS_NETLINK False )
|
||||
set ( NAS_UE False )
|
||||
set ( NB_ANTENNAS_RX 2 )
|
||||
set ( NB_ANTENNAS_TX 2 )
|
||||
set ( NB_ANTENNAS_TXRX 2 )
|
||||
set ( NEW_FFT True )
|
||||
set ( NO_RRM True )
|
||||
set ( OAI_EMU True )
|
||||
set ( OAI_NW_DRIVER_TYPE_ETHERNET True )
|
||||
set ( OAI_NW_DRIVER_USE_NETLINK False )
|
||||
set ( OAISIM True )
|
||||
set ( OPENAIR1 False )
|
||||
set ( OPENAIR2 True )
|
||||
set ( OPENAIR_EMU False )
|
||||
set ( OPENAIR_LTE True )
|
||||
set ( PBS_SIM False )
|
||||
set ( PC_DSP False )
|
||||
set ( PC_TARGET False )
|
||||
set ( PDCP_MSG_PRINT False )
|
||||
set ( PDCP_USE_NETLINK_QUEUES False )
|
||||
set ( PDCP_USE_NETLINK True )
|
||||
set ( PERFECT_CE False )
|
||||
set ( PHY_ABSTRACTION True )
|
||||
set ( PHY_CONTEXT 1 )
|
||||
set ( PHY_EMUL False )
|
||||
set ( PHYSIM False )
|
||||
set ( PUCCH True )
|
||||
set ( RANDOM_BF False )
|
||||
set ( RF_BOARD False )
|
||||
set ( RLC_STOP_ON_LOST_PDU True )
|
||||
set ( RRC_ASN1_VERSION Rel10 )
|
||||
set ( RRC_DEFAULT_RAB_IS_AM False )
|
||||
set ( RRC_MSG_PRINT False )
|
||||
set ( RTAI False )
|
||||
set ( S1AP_LIMIT_STREAM_ID_TO_1 False )
|
||||
set ( S1AP_VERSION R10 )
|
||||
set ( SMBV False )
|
||||
set ( SPECTRA False )
|
||||
set ( STOP_ON_IP_TRAFFIC_OVERLOAD False )
|
||||
set ( TEST_OMG False )
|
||||
set ( TRACE_RLC_AM_BO False )
|
||||
set ( TRACE_RLC_AM_FREE_SDU False )
|
||||
set ( TRACE_RLC_AM_HOLE False )
|
||||
set ( TRACE_RLC_AM_PDU True )
|
||||
set ( TRACE_RLC_AM_RESEGMENT False )
|
||||
set ( TRACE_RLC_AM_RX_DECODE False )
|
||||
set ( TRACE_RLC_AM_RX False )
|
||||
set ( TRACE_RLC_AM_STATUS_CREATION False )
|
||||
set ( TRACE_RLC_AM_TX False )
|
||||
set ( TRACE_RLC_AM_TX_STATUS False )
|
||||
set ( TRACE_RLC_PAYLOAD False )
|
||||
set ( TRACE_RLC_UM_DAR False )
|
||||
set ( TRACE_RLC_UM_DISPLAY_ASCII_DATA False )
|
||||
set ( TRACE_RLC_UM_PDU True )
|
||||
set ( TRACE_RLC_UM_RX False )
|
||||
set ( TRACE_RLC_UM_SEGMENT False )
|
||||
set ( TRACE_RLC_UM_TX_STATUS False )
|
||||
set ( USE_3GPP_ADDR_AS_LINK_ADDR False )
|
||||
set ( USE_MME False )
|
||||
set ( USER_MODE True )
|
||||
set ( XER_PRINT False )
|
||||
set ( XFORMS False )
|
||||
|
||||
include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt)
|
||||
@@ -0,0 +1,87 @@
|
||||
cmake_minimum_required(VERSION 2.8)
|
||||
|
||||
set ( CMAKE_BUILD_TYPE "RelWithDebInfo" )
|
||||
set ( ADDR_CONF False )
|
||||
set ( DEBUG_OMG False )
|
||||
set ( DISABLE_XER_PRINT False )
|
||||
set ( DRIVER2013 True )
|
||||
set ( EMOS False )
|
||||
set ( ENABLE_FXP True )
|
||||
set ( ENABLE_ITTI True )
|
||||
set ( ENABLE_NAS_UE_LOGGING False )
|
||||
set ( ENABLE_NEW_MULTICAST True )
|
||||
set ( ENABLE_PGM_TRANSPORT True )
|
||||
set ( ENABLE_RAL False )
|
||||
set ( ENABLE_SECURITY False )
|
||||
set ( ENABLE_STANDALONE_EPC False)
|
||||
set ( ENABLE_USE_CPU_EXECUTION_TIME True )
|
||||
set ( ENABLE_USE_MME False )
|
||||
set ( ENABLE_USE_RAW_SOCKET_FOR_SGI False)
|
||||
set ( ENABLE_VCD_FIFO False )
|
||||
set ( ENB_MODE True )
|
||||
set ( EXMIMO_IOT True )
|
||||
set ( HARD_RT False )
|
||||
set ( JUMBO_FRAME True )
|
||||
set ( LARGE_SCALE False )
|
||||
set ( LINK_ENB_PDCP_TO_GTPV1U False)
|
||||
set ( LINUX_LIST False )
|
||||
set ( LINUX True )
|
||||
set ( LOCALIZATION False )
|
||||
set ( LOG_NO_THREAD 1 )
|
||||
set ( LOWLATENCY False )
|
||||
set ( MAC_CONTEXT 1 )
|
||||
set ( MAX_NUM_CCs 1 )
|
||||
set ( MESSAGE_CHART_GENERATOR False )
|
||||
set ( MESSAGE_CHART_GENERATOR_RLC_MAC False )
|
||||
set ( MESSAGE_CHART_GENERATOR_PHY False )
|
||||
set ( MIH_C_MEDIEVAL_EXTENSIONS False )
|
||||
set ( MSG_PRINT False )
|
||||
set ( MU_RECEIVER False )
|
||||
set ( NAS_ADDRESS_FIX True )
|
||||
set ( NAS_BUILT_IN_UE False)
|
||||
set ( NAS_MME False )
|
||||
set ( NAS_UE False )
|
||||
set ( NB_ANTENNAS_RX "2" )
|
||||
set ( NB_ANTENNAS_TX "2" )
|
||||
set ( NB_ANTENNAS_TXRX "2" )
|
||||
set ( NEW_FFT True )
|
||||
set ( NO_RRM True )
|
||||
set ( OAI_EMU True )
|
||||
set ( OAISIM True )
|
||||
set ( OAI_NW_DRIVER_TYPE_ETHERNET True )
|
||||
set ( OAI_NW_DRIVER_USE_NETLINK True )
|
||||
set ( OPENAIR1 True )
|
||||
set ( OPENAIR2 True )
|
||||
set ( OPENAIR_EMU False )
|
||||
set ( OPENAIR_LTE True )
|
||||
set ( PACKAGE_NAME "oaisim" )
|
||||
set ( PBS_SIM False )
|
||||
set ( PDCP_USE_NETLINK True )
|
||||
set ( PC_DSP True )
|
||||
set ( PC_TARGET True )
|
||||
set ( PDCP_MSG_PRINT False )
|
||||
set ( PERFECT_CE False )
|
||||
set ( PHY_ABSTRACTION True )
|
||||
set ( PHY_CONTEXT False )
|
||||
set ( PHY_EMUL False )
|
||||
set ( PHYSIM True )
|
||||
set ( PUCCH True )
|
||||
set ( RANDOM_BF False )
|
||||
set ( RF_BOARD "False" )
|
||||
set ( RRC_ASN1_VERSION "Rel10" )
|
||||
set ( RLC_STOP_ON_LOST_PDU False )
|
||||
set ( RRC_MSG_PRINT False )
|
||||
set ( RTAI False )
|
||||
set ( SECU False )
|
||||
set ( SMBV False )
|
||||
set ( SPECTRA False )
|
||||
set ( TEST_OMG False )
|
||||
set ( USE_3GPP_ADDR_AS_LINK_ADDR False )
|
||||
set ( USE_MME "R10" )
|
||||
set ( USER_MODE True )
|
||||
set ( XER_PRINT False )
|
||||
set ( XFORMS False )
|
||||
set ( PRINT_STATS False )
|
||||
set ( RRC_ASN1_VERSION "Rel10")
|
||||
set ( ENABLE_VCD_FIFO False )
|
||||
include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt)
|
||||
@@ -0,0 +1,87 @@
|
||||
cmake_minimum_required(VERSION 2.8)
|
||||
|
||||
set ( CMAKE_BUILD_TYPE "RelWithDebInfo" )
|
||||
set ( ADDR_CONF False )
|
||||
set ( DEBUG_OMG False )
|
||||
set ( DISABLE_XER_PRINT False )
|
||||
set ( DRIVER2013 True )
|
||||
set ( EMOS False )
|
||||
set ( ENABLE_FXP True )
|
||||
set ( ENABLE_ITTI True )
|
||||
set ( ENABLE_NAS_UE_LOGGING False )
|
||||
set ( ENABLE_NEW_MULTICAST True )
|
||||
set ( ENABLE_PGM_TRANSPORT True )
|
||||
set ( ENABLE_RAL False )
|
||||
set ( ENABLE_SECURITY False )
|
||||
set ( ENABLE_STANDALONE_EPC False)
|
||||
set ( ENABLE_USE_CPU_EXECUTION_TIME True )
|
||||
set ( ENABLE_USE_MME False )
|
||||
set ( ENABLE_USE_RAW_SOCKET_FOR_SGI False)
|
||||
set ( ENABLE_VCD_FIFO False )
|
||||
set ( ENB_MODE True )
|
||||
set ( EXMIMO_IOT True )
|
||||
set ( HARD_RT False )
|
||||
set ( JUMBO_FRAME True )
|
||||
set ( LARGE_SCALE False )
|
||||
set ( LINK_ENB_PDCP_TO_GTPV1U False)
|
||||
set ( LINUX_LIST False )
|
||||
set ( LINUX True )
|
||||
set ( LOCALIZATION False )
|
||||
set ( LOG_NO_THREAD 1 )
|
||||
set ( LOWLATENCY False )
|
||||
set ( MAC_CONTEXT 1 )
|
||||
set ( MAX_NUM_CCs 1 )
|
||||
set ( MESSAGE_CHART_GENERATOR False )
|
||||
set ( MESSAGE_CHART_GENERATOR_RLC_MAC False )
|
||||
set ( MESSAGE_CHART_GENERATOR_PHY False )
|
||||
set ( MIH_C_MEDIEVAL_EXTENSIONS False )
|
||||
set ( MSG_PRINT False )
|
||||
set ( MU_RECEIVER False )
|
||||
set ( NAS_ADDRESS_FIX True )
|
||||
set ( NAS_BUILT_IN_UE False)
|
||||
set ( NAS_MME False )
|
||||
set ( NAS_UE False )
|
||||
set ( NB_ANTENNAS_RX "2" )
|
||||
set ( NB_ANTENNAS_TX "2" )
|
||||
set ( NB_ANTENNAS_TXRX "2" )
|
||||
set ( NEW_FFT True )
|
||||
set ( NO_RRM True )
|
||||
set ( OAI_EMU True )
|
||||
set ( OAISIM True )
|
||||
set ( OAI_NW_DRIVER_TYPE_ETHERNET True )
|
||||
set ( OAI_NW_DRIVER_USE_NETLINK True )
|
||||
set ( OPENAIR1 True )
|
||||
set ( OPENAIR2 True )
|
||||
set ( OPENAIR_EMU False )
|
||||
set ( OPENAIR_LTE True )
|
||||
set ( PACKAGE_NAME "oaisim" )
|
||||
set ( PBS_SIM False )
|
||||
set ( PDCP_USE_NETLINK True )
|
||||
set ( PC_DSP True )
|
||||
set ( PC_TARGET True )
|
||||
set ( PDCP_MSG_PRINT False )
|
||||
set ( PERFECT_CE False )
|
||||
set ( PHY_ABSTRACTION True )
|
||||
set ( PHY_CONTEXT False )
|
||||
set ( PHY_EMUL False )
|
||||
set ( PHYSIM True )
|
||||
set ( PUCCH True )
|
||||
set ( RANDOM_BF False )
|
||||
set ( RF_BOARD "False" )
|
||||
set ( RRC_ASN1_VERSION "Rel10" )
|
||||
set ( RLC_STOP_ON_LOST_PDU False )
|
||||
set ( RRC_MSG_PRINT False )
|
||||
set ( RTAI False )
|
||||
set ( SECU False )
|
||||
set ( SMBV False )
|
||||
set ( SPECTRA False )
|
||||
set ( TEST_OMG False )
|
||||
set ( USE_3GPP_ADDR_AS_LINK_ADDR False )
|
||||
set ( USE_MME "R10" )
|
||||
set ( USER_MODE True )
|
||||
set ( XER_PRINT False )
|
||||
set ( XFORMS False )
|
||||
set ( PRINT_STATS False )
|
||||
set ( RRC_ASN1_VERSION "Rel10")
|
||||
set ( ENABLE_VCD_FIFO False )
|
||||
include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt)
|
||||
@@ -0,0 +1,87 @@
|
||||
cmake_minimum_required(VERSION 2.8)
|
||||
|
||||
set ( CMAKE_BUILD_TYPE "RelWithDebInfo" )
|
||||
set ( ADDR_CONF False )
|
||||
set ( DEBUG_OMG False )
|
||||
set ( DISABLE_XER_PRINT False )
|
||||
set ( DRIVER2013 True )
|
||||
set ( EMOS False )
|
||||
set ( ENABLE_FXP True )
|
||||
set ( ENABLE_ITTI True )
|
||||
set ( ENABLE_NAS_UE_LOGGING False )
|
||||
set ( ENABLE_NEW_MULTICAST True )
|
||||
set ( ENABLE_PGM_TRANSPORT True )
|
||||
set ( ENABLE_RAL False )
|
||||
set ( ENABLE_SECURITY False )
|
||||
set ( ENABLE_STANDALONE_EPC False)
|
||||
set ( ENABLE_USE_CPU_EXECUTION_TIME True )
|
||||
set ( ENABLE_USE_MME False )
|
||||
set ( ENABLE_USE_RAW_SOCKET_FOR_SGI False)
|
||||
set ( ENABLE_VCD_FIFO False )
|
||||
set ( ENB_MODE True )
|
||||
set ( EXMIMO_IOT True )
|
||||
set ( HARD_RT False )
|
||||
set ( JUMBO_FRAME True )
|
||||
set ( LARGE_SCALE False )
|
||||
set ( LINK_ENB_PDCP_TO_GTPV1U False)
|
||||
set ( LINUX_LIST False )
|
||||
set ( LINUX True )
|
||||
set ( LOCALIZATION False )
|
||||
set ( LOG_NO_THREAD 1 )
|
||||
set ( LOWLATENCY False )
|
||||
set ( MAC_CONTEXT 1 )
|
||||
set ( MAX_NUM_CCs 1 )
|
||||
set ( MESSAGE_CHART_GENERATOR False )
|
||||
set ( MESSAGE_CHART_GENERATOR_RLC_MAC False )
|
||||
set ( MESSAGE_CHART_GENERATOR_PHY False )
|
||||
set ( MIH_C_MEDIEVAL_EXTENSIONS False )
|
||||
set ( MSG_PRINT False )
|
||||
set ( MU_RECEIVER False )
|
||||
set ( NAS_ADDRESS_FIX True )
|
||||
set ( NAS_BUILT_IN_UE False)
|
||||
set ( NAS_MME False )
|
||||
set ( NAS_UE False )
|
||||
set ( NB_ANTENNAS_RX "2" )
|
||||
set ( NB_ANTENNAS_TX "2" )
|
||||
set ( NB_ANTENNAS_TXRX "2" )
|
||||
set ( NEW_FFT True )
|
||||
set ( NO_RRM True )
|
||||
set ( OAI_EMU True )
|
||||
set ( OAISIM True )
|
||||
set ( OAI_NW_DRIVER_TYPE_ETHERNET True )
|
||||
set ( OAI_NW_DRIVER_USE_NETLINK True )
|
||||
set ( OPENAIR1 True )
|
||||
set ( OPENAIR2 True )
|
||||
set ( OPENAIR_EMU False )
|
||||
set ( OPENAIR_LTE True )
|
||||
set ( PACKAGE_NAME "oaisim" )
|
||||
set ( PBS_SIM False )
|
||||
set ( PDCP_USE_NETLINK True )
|
||||
set ( PC_DSP True )
|
||||
set ( PC_TARGET True )
|
||||
set ( PDCP_MSG_PRINT False )
|
||||
set ( PERFECT_CE False )
|
||||
set ( PHY_ABSTRACTION True )
|
||||
set ( PHY_CONTEXT False )
|
||||
set ( PHY_EMUL False )
|
||||
set ( PHYSIM True )
|
||||
set ( PUCCH True )
|
||||
set ( RANDOM_BF False )
|
||||
set ( RF_BOARD "False" )
|
||||
set ( RRC_ASN1_VERSION "Rel10" )
|
||||
set ( RLC_STOP_ON_LOST_PDU False )
|
||||
set ( RRC_MSG_PRINT False )
|
||||
set ( RTAI False )
|
||||
set ( SECU False )
|
||||
set ( SMBV False )
|
||||
set ( SPECTRA False )
|
||||
set ( TEST_OMG False )
|
||||
set ( USE_3GPP_ADDR_AS_LINK_ADDR False )
|
||||
set ( USE_MME "R10" )
|
||||
set ( USER_MODE True )
|
||||
set ( XER_PRINT False )
|
||||
set ( XFORMS False )
|
||||
set ( PRINT_STATS False )
|
||||
set ( RRC_ASN1_VERSION "Rel10")
|
||||
set ( ENABLE_VCD_FIFO False )
|
||||
include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt)
|
||||
@@ -0,0 +1,87 @@
|
||||
cmake_minimum_required(VERSION 2.8)
|
||||
|
||||
set ( CMAKE_BUILD_TYPE "RelWithDebInfo" )
|
||||
set ( ADDR_CONF False )
|
||||
set ( DEBUG_OMG False )
|
||||
set ( DISABLE_XER_PRINT False )
|
||||
set ( DRIVER2013 True )
|
||||
set ( EMOS False )
|
||||
set ( ENABLE_FXP True )
|
||||
set ( ENABLE_ITTI True )
|
||||
set ( ENABLE_NAS_UE_LOGGING False )
|
||||
set ( ENABLE_NEW_MULTICAST True )
|
||||
set ( ENABLE_PGM_TRANSPORT True )
|
||||
set ( ENABLE_RAL False )
|
||||
set ( ENABLE_SECURITY False )
|
||||
set ( ENABLE_STANDALONE_EPC False)
|
||||
set ( ENABLE_USE_CPU_EXECUTION_TIME True )
|
||||
set ( ENABLE_USE_MME False )
|
||||
set ( ENABLE_USE_RAW_SOCKET_FOR_SGI False)
|
||||
set ( ENABLE_VCD_FIFO False )
|
||||
set ( ENB_MODE True )
|
||||
set ( EXMIMO_IOT True )
|
||||
set ( HARD_RT False )
|
||||
set ( JUMBO_FRAME True )
|
||||
set ( LARGE_SCALE False )
|
||||
set ( LINK_ENB_PDCP_TO_GTPV1U False)
|
||||
set ( LINUX_LIST False )
|
||||
set ( LINUX True )
|
||||
set ( LOCALIZATION False )
|
||||
set ( LOG_NO_THREAD 1 )
|
||||
set ( LOWLATENCY False )
|
||||
set ( MAC_CONTEXT 1 )
|
||||
set ( MAX_NUM_CCs 1 )
|
||||
set ( MESSAGE_CHART_GENERATOR False )
|
||||
set ( MESSAGE_CHART_GENERATOR_RLC_MAC False )
|
||||
set ( MESSAGE_CHART_GENERATOR_PHY False )
|
||||
set ( MIH_C_MEDIEVAL_EXTENSIONS False )
|
||||
set ( MSG_PRINT False )
|
||||
set ( MU_RECEIVER False )
|
||||
set ( NAS_ADDRESS_FIX True )
|
||||
set ( NAS_BUILT_IN_UE False)
|
||||
set ( NAS_MME False )
|
||||
set ( NAS_UE False )
|
||||
set ( NB_ANTENNAS_RX "2" )
|
||||
set ( NB_ANTENNAS_TX "2" )
|
||||
set ( NB_ANTENNAS_TXRX "2" )
|
||||
set ( NEW_FFT True )
|
||||
set ( NO_RRM True )
|
||||
set ( OAI_EMU True )
|
||||
set ( OAISIM True )
|
||||
set ( OAI_NW_DRIVER_TYPE_ETHERNET True )
|
||||
set ( OAI_NW_DRIVER_USE_NETLINK True )
|
||||
set ( OPENAIR1 True )
|
||||
set ( OPENAIR2 True )
|
||||
set ( OPENAIR_EMU False )
|
||||
set ( OPENAIR_LTE True )
|
||||
set ( PACKAGE_NAME "oaisim" )
|
||||
set ( PBS_SIM False )
|
||||
set ( PDCP_USE_NETLINK True )
|
||||
set ( PC_DSP True )
|
||||
set ( PC_TARGET True )
|
||||
set ( PDCP_MSG_PRINT False )
|
||||
set ( PERFECT_CE False )
|
||||
set ( PHY_ABSTRACTION True )
|
||||
set ( PHY_CONTEXT False )
|
||||
set ( PHY_EMUL False )
|
||||
set ( PHYSIM True )
|
||||
set ( PUCCH True )
|
||||
set ( RANDOM_BF False )
|
||||
set ( RF_BOARD "False" )
|
||||
set ( RRC_ASN1_VERSION "Rel10" )
|
||||
set ( RLC_STOP_ON_LOST_PDU False )
|
||||
set ( RRC_MSG_PRINT False )
|
||||
set ( RTAI False )
|
||||
set ( SECU False )
|
||||
set ( SMBV False )
|
||||
set ( SPECTRA False )
|
||||
set ( TEST_OMG False )
|
||||
set ( USE_3GPP_ADDR_AS_LINK_ADDR False )
|
||||
set ( USE_MME "R10" )
|
||||
set ( USER_MODE True )
|
||||
set ( XER_PRINT False )
|
||||
set ( XFORMS False )
|
||||
set ( PRINT_STATS False )
|
||||
set ( RRC_ASN1_VERSION "Rel10")
|
||||
set ( ENABLE_VCD_FIFO False )
|
||||
include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt)
|
||||
@@ -0,0 +1,87 @@
|
||||
cmake_minimum_required(VERSION 2.8)
|
||||
|
||||
set ( CMAKE_BUILD_TYPE "RelWithDebInfo" )
|
||||
set ( ADDR_CONF False )
|
||||
set ( DEBUG_OMG False )
|
||||
set ( DISABLE_XER_PRINT False )
|
||||
set ( DRIVER2013 True )
|
||||
set ( EMOS False )
|
||||
set ( ENABLE_FXP True )
|
||||
set ( ENABLE_ITTI True )
|
||||
set ( ENABLE_NAS_UE_LOGGING False )
|
||||
set ( ENABLE_NEW_MULTICAST True )
|
||||
set ( ENABLE_PGM_TRANSPORT True )
|
||||
set ( ENABLE_RAL False )
|
||||
set ( ENABLE_SECURITY False )
|
||||
set ( ENABLE_STANDALONE_EPC False)
|
||||
set ( ENABLE_USE_CPU_EXECUTION_TIME True )
|
||||
set ( ENABLE_USE_MME False )
|
||||
set ( ENABLE_USE_RAW_SOCKET_FOR_SGI False)
|
||||
set ( ENABLE_VCD_FIFO False )
|
||||
set ( ENB_MODE True )
|
||||
set ( EXMIMO_IOT True )
|
||||
set ( HARD_RT False )
|
||||
set ( JUMBO_FRAME True )
|
||||
set ( LARGE_SCALE False )
|
||||
set ( LINK_ENB_PDCP_TO_GTPV1U False)
|
||||
set ( LINUX_LIST False )
|
||||
set ( LINUX True )
|
||||
set ( LOCALIZATION False )
|
||||
set ( LOG_NO_THREAD 1 )
|
||||
set ( LOWLATENCY False )
|
||||
set ( MAC_CONTEXT 1 )
|
||||
set ( MAX_NUM_CCs 1 )
|
||||
set ( MESSAGE_CHART_GENERATOR False )
|
||||
set ( MESSAGE_CHART_GENERATOR_RLC_MAC False )
|
||||
set ( MESSAGE_CHART_GENERATOR_PHY False )
|
||||
set ( MIH_C_MEDIEVAL_EXTENSIONS False )
|
||||
set ( MSG_PRINT False )
|
||||
set ( MU_RECEIVER False )
|
||||
set ( NAS_ADDRESS_FIX True )
|
||||
set ( NAS_BUILT_IN_UE False)
|
||||
set ( NAS_MME False )
|
||||
set ( NAS_UE False )
|
||||
set ( NB_ANTENNAS_RX "2" )
|
||||
set ( NB_ANTENNAS_TX "2" )
|
||||
set ( NB_ANTENNAS_TXRX "2" )
|
||||
set ( NEW_FFT True )
|
||||
set ( NO_RRM True )
|
||||
set ( OAI_EMU True )
|
||||
set ( OAISIM True )
|
||||
set ( OAI_NW_DRIVER_TYPE_ETHERNET True )
|
||||
set ( OAI_NW_DRIVER_USE_NETLINK True )
|
||||
set ( OPENAIR1 True )
|
||||
set ( OPENAIR2 True )
|
||||
set ( OPENAIR_EMU False )
|
||||
set ( OPENAIR_LTE True )
|
||||
set ( PACKAGE_NAME "oaisim" )
|
||||
set ( PBS_SIM False )
|
||||
set ( PDCP_USE_NETLINK True )
|
||||
set ( PC_DSP True )
|
||||
set ( PC_TARGET True )
|
||||
set ( PDCP_MSG_PRINT False )
|
||||
set ( PERFECT_CE False )
|
||||
set ( PHY_ABSTRACTION True )
|
||||
set ( PHY_CONTEXT False )
|
||||
set ( PHY_EMUL False )
|
||||
set ( PHYSIM True )
|
||||
set ( PUCCH True )
|
||||
set ( RANDOM_BF False )
|
||||
set ( RF_BOARD "False" )
|
||||
set ( RRC_ASN1_VERSION "Rel10" )
|
||||
set ( RLC_STOP_ON_LOST_PDU False )
|
||||
set ( RRC_MSG_PRINT False )
|
||||
set ( RTAI False )
|
||||
set ( SECU False )
|
||||
set ( SMBV False )
|
||||
set ( SPECTRA False )
|
||||
set ( TEST_OMG False )
|
||||
set ( USE_3GPP_ADDR_AS_LINK_ADDR False )
|
||||
set ( USE_MME "R10" )
|
||||
set ( USER_MODE True )
|
||||
set ( XER_PRINT False )
|
||||
set ( XFORMS False )
|
||||
set ( PRINT_STATS False )
|
||||
set ( RRC_ASN1_VERSION "Rel10")
|
||||
set ( ENABLE_VCD_FIFO False )
|
||||
include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt)
|
||||
@@ -0,0 +1,87 @@
|
||||
cmake_minimum_required(VERSION 2.8)
|
||||
|
||||
set ( CMAKE_BUILD_TYPE "RelWithDebInfo" )
|
||||
set ( ADDR_CONF False )
|
||||
set ( DEBUG_OMG False )
|
||||
set ( DISABLE_XER_PRINT False )
|
||||
set ( DRIVER2013 True )
|
||||
set ( EMOS False )
|
||||
set ( ENABLE_FXP True )
|
||||
set ( ENABLE_ITTI True )
|
||||
set ( ENABLE_NAS_UE_LOGGING False )
|
||||
set ( ENABLE_NEW_MULTICAST True )
|
||||
set ( ENABLE_PGM_TRANSPORT True )
|
||||
set ( ENABLE_RAL False )
|
||||
set ( ENABLE_SECURITY False )
|
||||
set ( ENABLE_STANDALONE_EPC False)
|
||||
set ( ENABLE_USE_CPU_EXECUTION_TIME True )
|
||||
set ( ENABLE_USE_MME False )
|
||||
set ( ENABLE_USE_RAW_SOCKET_FOR_SGI False)
|
||||
set ( ENABLE_VCD_FIFO False )
|
||||
set ( ENB_MODE True )
|
||||
set ( EXMIMO_IOT True )
|
||||
set ( HARD_RT False )
|
||||
set ( JUMBO_FRAME True )
|
||||
set ( LARGE_SCALE False )
|
||||
set ( LINK_ENB_PDCP_TO_GTPV1U False)
|
||||
set ( LINUX_LIST False )
|
||||
set ( LINUX True )
|
||||
set ( LOCALIZATION False )
|
||||
set ( LOG_NO_THREAD 1 )
|
||||
set ( LOWLATENCY False )
|
||||
set ( MAC_CONTEXT 1 )
|
||||
set ( MAX_NUM_CCs 1 )
|
||||
set ( MESSAGE_CHART_GENERATOR False )
|
||||
set ( MESSAGE_CHART_GENERATOR_RLC_MAC False )
|
||||
set ( MESSAGE_CHART_GENERATOR_PHY False )
|
||||
set ( MIH_C_MEDIEVAL_EXTENSIONS False )
|
||||
set ( MSG_PRINT False )
|
||||
set ( MU_RECEIVER False )
|
||||
set ( NAS_ADDRESS_FIX True )
|
||||
set ( NAS_BUILT_IN_UE False)
|
||||
set ( NAS_MME False )
|
||||
set ( NAS_UE False )
|
||||
set ( NB_ANTENNAS_RX "2" )
|
||||
set ( NB_ANTENNAS_TX "2" )
|
||||
set ( NB_ANTENNAS_TXRX "2" )
|
||||
set ( NEW_FFT True )
|
||||
set ( NO_RRM True )
|
||||
set ( OAI_EMU True )
|
||||
set ( OAISIM True )
|
||||
set ( OAI_NW_DRIVER_TYPE_ETHERNET True )
|
||||
set ( OAI_NW_DRIVER_USE_NETLINK True )
|
||||
set ( OPENAIR1 True )
|
||||
set ( OPENAIR2 True )
|
||||
set ( OPENAIR_EMU False )
|
||||
set ( OPENAIR_LTE True )
|
||||
set ( PACKAGE_NAME "oaisim" )
|
||||
set ( PBS_SIM False )
|
||||
set ( PDCP_USE_NETLINK True )
|
||||
set ( PC_DSP True )
|
||||
set ( PC_TARGET True )
|
||||
set ( PDCP_MSG_PRINT False )
|
||||
set ( PERFECT_CE False )
|
||||
set ( PHY_ABSTRACTION True )
|
||||
set ( PHY_CONTEXT False )
|
||||
set ( PHY_EMUL False )
|
||||
set ( PHYSIM True )
|
||||
set ( PUCCH True )
|
||||
set ( RANDOM_BF False )
|
||||
set ( RF_BOARD "False" )
|
||||
set ( RRC_ASN1_VERSION "Rel10" )
|
||||
set ( RLC_STOP_ON_LOST_PDU False )
|
||||
set ( RRC_MSG_PRINT False )
|
||||
set ( RTAI False )
|
||||
set ( SECU False )
|
||||
set ( SMBV False )
|
||||
set ( SPECTRA False )
|
||||
set ( TEST_OMG False )
|
||||
set ( USE_3GPP_ADDR_AS_LINK_ADDR False )
|
||||
set ( USE_MME "R10" )
|
||||
set ( USER_MODE True )
|
||||
set ( XER_PRINT False )
|
||||
set ( XFORMS False )
|
||||
set ( PRINT_STATS False )
|
||||
set ( RRC_ASN1_VERSION "Rel10")
|
||||
set ( ENABLE_VCD_FIFO False )
|
||||
include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt)
|
||||
+1
-1
@@ -5,7 +5,7 @@ set(RF_BOARD None)
|
||||
set(XFORMS False)
|
||||
|
||||
set(DEBUG_PHY False)
|
||||
set(MU_RECIEVER Flase)
|
||||
set(MU_RECIEVER False)
|
||||
set(RANDOM_BF False)
|
||||
set(PBS_SIM False)
|
||||
set(PERFECT_CE False)
|
||||
+1
-1
@@ -5,7 +5,7 @@ set(RF_BOARD None)
|
||||
set(XFORMS False)
|
||||
|
||||
set(DEBUG_PHY False)
|
||||
set(MU_RECIEVER Flase)
|
||||
set(MU_RECIEVER False)
|
||||
set(RANDOM_BF False)
|
||||
set(PBS_SIM False)
|
||||
set(PERFECT_CE False)
|
||||
+1
-1
@@ -5,7 +5,7 @@ set(RF_BOARD None)
|
||||
set(XFORMS False)
|
||||
|
||||
set(DEBUG_PHY False)
|
||||
set(MU_RECIEVER Flase)
|
||||
set(MU_RECIEVER False)
|
||||
set(RANDOM_BF False)
|
||||
set(PBS_SIM False)
|
||||
set(PERFECT_CE False)
|
||||
+1
-1
@@ -5,7 +5,7 @@ set(RF_BOARD None)
|
||||
set(XFORMS False)
|
||||
|
||||
set(DEBUG_PHY False)
|
||||
set(MU_RECIEVER Flase)
|
||||
set(MU_RECIEVER False)
|
||||
set(RANDOM_BF False)
|
||||
set(PBS_SIM False)
|
||||
set(PERFECT_CE False)
|
||||
@@ -0,0 +1,15 @@
|
||||
cmake_minimum_required(VERSION 2.8)
|
||||
set(PACKAGE_NAME "unitary_tests_simulators")
|
||||
set(PHYSIM True)
|
||||
set(RF_BOARD None)
|
||||
set(XFORMS False)
|
||||
|
||||
set(DEBUG_PHY False)
|
||||
set(MU_RECIEVER False)
|
||||
set(RANDOM_BF False)
|
||||
set(PBS_SIM False)
|
||||
set(PERFECT_CE False)
|
||||
set(NAS_UE False)
|
||||
set(MESSAGE_CHART_GENERATOR False)
|
||||
|
||||
include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt)
|
||||
@@ -0,0 +1,15 @@
|
||||
cmake_minimum_required(VERSION 2.8)
|
||||
set(PACKAGE_NAME "unitary_tests_simulators")
|
||||
set(PHYSIM True)
|
||||
set(RF_BOARD None)
|
||||
set(XFORMS False)
|
||||
|
||||
set(DEBUG_PHY False)
|
||||
set(MU_RECIEVER False)
|
||||
set(RANDOM_BF False)
|
||||
set(PBS_SIM False)
|
||||
set(PERFECT_CE False)
|
||||
set(NAS_UE False)
|
||||
set(MESSAGE_CHART_GENERATOR False)
|
||||
|
||||
include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt)
|
||||
@@ -0,0 +1,15 @@
|
||||
cmake_minimum_required(VERSION 2.8)
|
||||
set(PACKAGE_NAME "unitary_tests_simulators")
|
||||
set(PHYSIM True)
|
||||
set(RF_BOARD None)
|
||||
set(XFORMS False)
|
||||
|
||||
set(DEBUG_PHY False)
|
||||
set(MU_RECIEVER False)
|
||||
set(RANDOM_BF False)
|
||||
set(PBS_SIM False)
|
||||
set(PERFECT_CE False)
|
||||
set(NAS_UE False)
|
||||
set(MESSAGE_CHART_GENERATOR False)
|
||||
|
||||
include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt)
|
||||
@@ -0,0 +1,15 @@
|
||||
cmake_minimum_required(VERSION 2.8)
|
||||
set(PACKAGE_NAME "unitary_tests_simulators")
|
||||
set(PHYSIM True)
|
||||
set(RF_BOARD None)
|
||||
set(XFORMS False)
|
||||
|
||||
set(DEBUG_PHY False)
|
||||
set(MU_RECIEVER False)
|
||||
set(RANDOM_BF False)
|
||||
set(PBS_SIM False)
|
||||
set(PERFECT_CE False)
|
||||
set(NAS_UE False)
|
||||
set(MESSAGE_CHART_GENERATOR False)
|
||||
|
||||
include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt)
|
||||
@@ -0,0 +1,15 @@
|
||||
cmake_minimum_required(VERSION 2.8)
|
||||
set(PACKAGE_NAME "unitary_tests_simulators")
|
||||
set(PHYSIM True)
|
||||
set(RF_BOARD None)
|
||||
set(XFORMS False)
|
||||
|
||||
set(DEBUG_PHY False)
|
||||
set(MU_RECIEVER False)
|
||||
set(RANDOM_BF False)
|
||||
set(PBS_SIM False)
|
||||
set(PERFECT_CE False)
|
||||
set(NAS_UE False)
|
||||
set(MESSAGE_CHART_GENERATOR False)
|
||||
|
||||
include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt)
|
||||
@@ -0,0 +1,15 @@
|
||||
cmake_minimum_required(VERSION 2.8)
|
||||
set(PACKAGE_NAME "unitary_tests_simulators")
|
||||
set(PHYSIM True)
|
||||
set(RF_BOARD None)
|
||||
set(XFORMS False)
|
||||
|
||||
set(DEBUG_PHY False)
|
||||
set(MU_RECIEVER False)
|
||||
set(RANDOM_BF False)
|
||||
set(PBS_SIM False)
|
||||
set(PERFECT_CE False)
|
||||
set(NAS_UE False)
|
||||
set(MESSAGE_CHART_GENERATOR False)
|
||||
|
||||
include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt)
|
||||
@@ -0,0 +1,15 @@
|
||||
cmake_minimum_required(VERSION 2.8)
|
||||
set(PACKAGE_NAME "unitary_tests_simulators")
|
||||
set(PHYSIM True)
|
||||
set(RF_BOARD None)
|
||||
set(XFORMS False)
|
||||
|
||||
set(DEBUG_PHY False)
|
||||
set(MU_RECIEVER False)
|
||||
set(RANDOM_BF False)
|
||||
set(PBS_SIM False)
|
||||
set(PERFECT_CE False)
|
||||
set(NAS_UE False)
|
||||
set(MESSAGE_CHART_GENERATOR False)
|
||||
|
||||
include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt)
|
||||
@@ -0,0 +1,15 @@
|
||||
cmake_minimum_required(VERSION 2.8)
|
||||
set(PACKAGE_NAME "unitary_tests_simulators")
|
||||
set(PHYSIM True)
|
||||
set(RF_BOARD None)
|
||||
set(XFORMS False)
|
||||
|
||||
set(DEBUG_PHY False)
|
||||
set(MU_RECIEVER False)
|
||||
set(RANDOM_BF False)
|
||||
set(PBS_SIM False)
|
||||
set(PERFECT_CE False)
|
||||
set(NAS_UE False)
|
||||
set(MESSAGE_CHART_GENERATOR False)
|
||||
|
||||
include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt)
|
||||
@@ -5,40 +5,173 @@ Obj.# Case# Test# Description
|
||||
|
||||
01 pre-commit test case
|
||||
01 01 Build OAI
|
||||
01 01 00 Check Makefiles and
|
||||
01 01 01 Build oaisim Rel8
|
||||
01 01 02 Build oaisim Rel8 + network device driver(nasmesh_fix)
|
||||
01 01 03 Build lte-softmode Rel8
|
||||
01 01 04 Build dlsim Rel8
|
||||
01 01 05 Build ulsim Rel8
|
||||
01 01 06 Build oaisim Rel10
|
||||
01 01 07 Build oaisim Rel8 with cellular RRC for eNB
|
||||
01 01 08 Build oaisim Rel8 with cellular RRC for UE
|
||||
01 01 09 "commented test in targets/TEST/OAI/case01.py"
|
||||
01 01 10 "commented test in targets/TEST/OAI/case01.py"
|
||||
01 01 11 "commented test in targets/TEST/OAI/case01.py"
|
||||
01 01 12 "commented test in targets/TEST/OAI/case01.py"
|
||||
01 01 13 Build network device driver(oai_nw_drv type ethernet)
|
||||
01 01 14 Build oaisim Rel8 with RRC lite (new cellular+ITTI) + RAL (802.21)
|
||||
01 01 15 Build oaisim Rel10 with RRC lite (new cellular+ITTI) + RAL (802.21)
|
||||
01 01 01 Build oaisim.Rel8
|
||||
01 01 02 Build oaisim.Rel10
|
||||
01 01 03 Build oaisim_noS1.Rel10
|
||||
01 01 10 Build lte-softmodem_noS1.USRP.Rel10
|
||||
01 01 11 Build lte-softmodem_noS1.EXMIMO.Rel10
|
||||
01 01 12 Build lte-softmodem_noS1.BLADERF.Rel10
|
||||
01 01 13 Build lte-softmodem_noS1.ETHERNET.Rel10
|
||||
01 01 20 Build lte-softmodem.USRP.Rel10
|
||||
01 01 21 Build lte-softmodem.EXMIMO.Rel10
|
||||
01 01 22 Build lte-softmodem.BLADERF.Rel10
|
||||
01 01 23 Build lte-softmodem.ETHERNET.Rel10
|
||||
|
||||
01 02 Run OAI Rel8, and check the operation
|
||||
01 02 00 Run OAI Rel8, and search for segmentation fault or exit
|
||||
01 02 01 Run OAI Rel8, and search for execution errors
|
||||
01 02 02 Run OAI Rel8 in abstraction mode and check that RRC proc is finished completely for the configured number of eNB and UE
|
||||
01 02 03 Run OAI Rel8 in abstraction mode, send ping from from one eNB to each UE, and check that there is no packet losses
|
||||
01 02 04 Run OAI Rel8 with full PHY, and check that the RRC proc for eNBsxUEs
|
||||
01 02 05 Run OAI Rel8 with full PHY in FDD mode, and check that the RRC proc for eNBsxUEs
|
||||
01 01 30 Build (dlsim.Rel10 + ulsim.Rel10 + pucchsim.Rel10 + prachsim.Rel10 + pdcchsim.Rel10 + pbchsim.Rel10 + mbmssim.Rel10
|
||||
secu_knas_encrypt_eia1.Rel10 secu_kenb.Rel10 aes128_ctr_encrypt.Rel10 aes128_ctr_decrypt.Rel10 secu_knas_encrypt_eea2.Rel10
|
||||
secu_knas.Rel10 secu_knas_encrypt_eea1.Rel10 kdf.Rel10 aes128_cmac_encrypt.Rel10 secu_knas_encrypt_eia2.Rel10)
|
||||
|
||||
01 03 Run OAI Rel10, and check the operation
|
||||
01 03 00 Run OAI Rel10, and search for segmentation fault or exit
|
||||
01 03 01 Run OAI Rel10, and search for execution errors
|
||||
01 03 02 Run OAI Rel10 in abstraction mode, and check the RRC proc for eNBsxUEs
|
||||
01 03 03 Run OAI Rel10 in full phy mode, and check the RRC proc for eNBsxUEs
|
||||
01 03 04 Run OAI Rel10 in full phy mode in FDD mode, and check the RRC proc for eNBsxUEs
|
||||
01 03 05 Run OAI Rel10 with eMBMS enabled, and check the SIB13 and MCCH
|
||||
01 03 06 Run OAI Rel10 with eMBMS enabled, and check the MTCH
|
||||
01 03 07 Run OAI Rel10 with eMBMS enabled and FDD mode, and check the MTCH
|
||||
01 01 40 Build RRH Gateway for USRP (Rel 10)
|
||||
01 01 41 Build RRH Gateway for EXMIMO (Rel 10)
|
||||
01 01 42 Build RRH Gateway for BLADERF (Rel 10)
|
||||
|
||||
|
||||
|
||||
01 02 Run OAISIM-NOS1 Rel10 (TDD + 5MHz/10MHz/20MHz + TM 1,2), and check the operation
|
||||
01 02 00 Run OAISIM-NOS1 Rel10 TDD, 1 eNB + 1 UE (5 MHz/10MHz/20MHz), (TM 1,2) and search for errors, segmentation fault or exit
|
||||
01 02 01 Run OAISIM-NOS1 Rel10 TDD, 1 eNB + 1 UE (5 MHz/10MHz/20MHz), (TM 1,2) in PHY_ABSTRACTION mode and search for errors
|
||||
01 02 02 Run OAISIM-NOS1 Rel10 TDD, 1 eNB + 3 UEs (5 MHz/10MHz/20MHz), (TM 1,2) and search for errors, segmentation fault or exit
|
||||
01 02 03 Run OAISIM-NOS1 Rel10 TDD, 1 eNB + 3 UEs (5 MHz/10MHz/20MHz), (TM 1,2) in PHY_ABSTRACTION mode and search for errors
|
||||
01 02 04 Run OAISIM-NOS1 Rel10 TDD, 1 eNB + 1 UE (5 MHz/10MHz/20MHz), (TM 1,2) without PHY_ABSTRACTION mode, ping from from eNB to UE,
|
||||
and for check for no packet losses
|
||||
01 02 05 Run OAISIM-NOS1 Rel10 TDD, 1 eNB + 1 UE (5 MHz/10MHz/20MHz), (TM 1,2) in PHY_ABSTRACTION mode, send ping from from eNB to UE,
|
||||
and check for no packet losses
|
||||
|
||||
01 03 Run OAISIM-NOS1 Rel10 (FDD + 5MHz/10MHz/20MHz + TM 1,2), and check the operation
|
||||
01 03 00 Run OAISIM-NOS1 Rel10 FDD, 1 eNB + 1 UE 1 eNB (5 MHz/10MHz/20MHz), (TM 1,2) and search for errors, segmentation fault or exit
|
||||
01 03 01 Run OAISIM-NOS1 Rel10 FDD, 1 eNB + 1 UE (5 MHz/10MHz/20MHz), (TM 1,2) in PHY_ABSTRACTION mode and search for errors
|
||||
01 03 02 Run OAISIM-NOS1 Rel10 FDD, 1 eNB + 3 UEs (5 MHz/10MHz/20MHz), (TM 1,2) and search for errors, segmentation fault or exit
|
||||
01 03 03 Run OAISIM-NOS1 Rel10 FDD, 1 eNB + 3 UEs (5 MHz/10MHz/20MHz), (TM 1,2) in PHY_ABSTRACTION mode and search for errors
|
||||
01 03 04 Run OAISIM-NOS1 Rel10 FDD, 1 eNB + 1 UE (5 MHz/10MHz/20MHz), (TM 1,2) without PHY_ABSTRACTION mode, ping from from eNB to UE,
|
||||
and for check for no packet losses
|
||||
01 03 05 Run OAISIM-NOS1 Rel10 FDD, 1 eNB + 1 UE (5 MHz/10MHz/20MHz), (TM 1,2) in PHY_ABSTRACTION mode, send ping from from eNB to UE,
|
||||
and check for no packet losses
|
||||
|
||||
|
||||
|
||||
01 04 OAISIM-NOS1 MBSFN Tests
|
||||
01 04 00 Check if eMBMS procedure is not finished completely, make sure that the SIB13/MCCH have been correclty received by UEs
|
||||
01 04 01 Check if eMBMS multicast/broadcast data is received, make sure that the SIB13/MCCH/MTCH have been correclty received by UEs
|
||||
01 04 02 Check for eMBMS multicast/broadcast data received in fdd mode, make sure that the SIB13/MCCH/MTCH have been correctly
|
||||
received by UEs
|
||||
01 04 03 Check for eMBMS multicast/broadcast DF relaying working properly in fdd mode, make sure that the SIB13/MCCH/MTCH have been
|
||||
correclty received by UEs
|
||||
|
||||
|
||||
01 50 Run PHY unitary secuirity tests
|
||||
01 50 00 test_aes128_cmac_encrypt
|
||||
01 50 01 test_aes128_ctr_decrypt
|
||||
01 50 02 test_aes128_ctr_encrypt
|
||||
01 50 03 test_secu_kenb
|
||||
01 50 04 test_secu_knas
|
||||
01 50 05 test_secu_knas_encrypt_eea1
|
||||
01 50 06 test_secu_knas_encrypt_eea2
|
||||
01 50 07 test_secu_knas_encrypt_eia1
|
||||
01 50 08 test_secu_knas_encrypt_eia2
|
||||
01 50 09 test_kdf
|
||||
|
||||
|
||||
|
||||
01 51 Run PHY simulator tests
|
||||
01 51 00 dlsim test cases (Test 1: 10 MHz, R2.FDD (MCS 5), EVA5, -1dB),
|
||||
(Test 5: 1.4 MHz, R4.FDD (MCS 4), EVA5, 0dB (70%)),
|
||||
(Test 6: 10 MHz, R3.FDD (MCS 15), EVA5, 6.7dB (70%)),
|
||||
(Test 6b: 5 MHz, R3-1.FDD (MCS 15), EVA5, 6.7dB (70%)),
|
||||
(Test 7: 5 MHz, R3-1.FDD (MCS 15), EVA5, 6.7dB (30%)),
|
||||
(Test 7b: 5 MHz, R3-1.FDD (MCS 15), ETU70, 1.4 dB (30%)),
|
||||
(Test 10: 5 MHz, R6.FDD (MCS 25), EVA5, 17.4 dB (70%)),
|
||||
(Test 10b: 5 MHz, R6-1.FDD (MCS 24,18 PRB), EVA5, 17.5dB (70%)),
|
||||
(Test 11: 10 MHz, R7.FDD (MCS 25), EVA5, 17.7dB (70%))
|
||||
(TM2 Test 1 10 MHz, R.11 FDD (MCS 14), EVA5, 6.8 dB (70%)),
|
||||
(TM2 Test 1b 20 MHz, R.11-2 FDD (MCS 13), EVA5, 5.9 dB (70%)),
|
||||
01 51 01 ulsim Test cases. (Test 1, 5 MHz, FDD (MCS 5), AWGN, 6dB),
|
||||
(Test 2, 5 MHz, FDD (MCS 16), AWGN , 12dB (70%)),
|
||||
(Test 3, 10 MHz, R3.FDD (MCS 5), AWGN, 6dB (70%)),
|
||||
(Test 4, 10 MHz, R3-1.FDD (MCS 16), AWGN, 12dB (70%)),
|
||||
(Test 5, 20 MHz, FDD (MCS 5), AWGN, 6dB (70%)),
|
||||
(Test 6, 20 MHz, FDD (MCS 16), AWGN, 12 dB (70%))
|
||||
01 51 02 pucchsim (TBD)
|
||||
01 51 03 prachsim (TBD)
|
||||
01 51 04 pdcchsim (TBD)
|
||||
01 51 05 pbchsim (TBD)
|
||||
01 51 06 mbmssim (TBD)
|
||||
|
||||
|
||||
01 55 lte-softmodem tests with USRP B210 RF as eNB and ALU EPC w/ Bandrich COTS UE for TX/1RX, 2TX/2RX
|
||||
01 55 00 Band 7 FDD 5MHz UL Throughput for 300 sec for 1TX/1RX
|
||||
01 55 01 Band 7 FDD 10MHz UL Throughput for 300 sec for 1TX/1RX
|
||||
01 55 02 Band 7 FDD 20MHz UL Throughput for 300 sec for 1TX/1RX
|
||||
01 55 03 Band 7 FDD 5MHz DL Throughput for 300 sec for 1TX/1RX
|
||||
01 55 04 Band 7 FDD 10MHz DL Throughput for 300 sec for 1TX/1RX
|
||||
01 55 05 Band 7 FDD 20MHz DL Throughput for 300 sec for 1TX/1RX
|
||||
01 55 06 Band 7 FDD 5MHz UL Throughput for 300 sec for 2TX/2RX
|
||||
01 55 07 Band 7 FDD 10MHz UL Throughput for 300 sec for 2TX/2RX
|
||||
01 55 08 Band 7 FDD 20MHz UL Throughput for 300 sec for 2TX/2RX
|
||||
01 55 09 Band 7 FDD 5MHz DL Throughput for 300 sec for 2TX/2RX
|
||||
01 55 10 Band 7 FDD 10MHz DL Throughput for 300 sec for 2TX/2RX
|
||||
01 55 11 Band 7 FDD 20MHz DL Throughput for 300 sec for 2TX/2RX
|
||||
|
||||
01 56 lte-softmodem tests with USRP B210 RF as eNB and OAI EPC (eNB and EPC are on same machines) w/ Bandrich COTS UE
|
||||
01 56 00 Band 7 FDD 5MHz UL Throughput for 300 sec for 1TX/1RX
|
||||
01 56 01 Band 7 FDD 10MHz UL Throughput for 300 sec for 1TX/1RX
|
||||
01 56 02 Band 7 FDD 20MHz UL Throughput for 300 sec for 1TX/1RX
|
||||
01 56 03 Band 7 FDD 5MHz DL Throughput for 300 sec for 1TX/1RX
|
||||
01 56 04 Band 7 FDD 10MHz DL Throughput for 300 sec for 1TX/1RX
|
||||
01 56 05 Band 7 FDD 20MHz DL Throughput for 300 sec for 1TX/1RX
|
||||
|
||||
01 57 lte-softmodem tests with USRP B210 RF as eNB and OAI EPC (eNB and EPC are on different machines) w/ Bandrich COTS UE
|
||||
01 57 00 Band 7 FDD 5MHz UL Throughput for 300 sec for 1TX/1RX
|
||||
01 57 01 Band 7 FDD 10MHz UL Throughput for 300 sec for 1TX/1RX
|
||||
01 57 02 Band 7 FDD 20MHz UL Throughput for 300 sec for 1TX/1RX
|
||||
01 57 03 Band 7 FDD 5MHz DL Throughput for 300 sec for 1TX/1RX
|
||||
01 57 04 Band 7 FDD 10MHz DL Throughput for 300 sec for 1TX/1RX
|
||||
01 57 05 Band 7 FDD 20MHz DL Throughput for 300 sec for 1TX/1RX
|
||||
|
||||
01 58 lte-softmodem tests with USRP X310 RF as eNB and ALU EPC w/ Bandrich COTS UE for `TX/1RX, 2TX/2RX
|
||||
01 58 00 Band 7 FDD 5MHz UL Throughput for 300 sec for 1TX/1RX
|
||||
01 58 01 Band 7 FDD 10MHz UL Throughput for 300 sec for 1TX/1RX
|
||||
01 58 02 Band 7 FDD 20MHz UL Throughput for 300 sec for 1TX/1RX
|
||||
01 58 03 Band 7 FDD 5MHz DL Throughput for 300 sec for 1TX/1RX
|
||||
01 58 04 Band 7 FDD 10MHz DL Throughput for 300 sec for 1TX/1RX
|
||||
01 58 05 Band 7 FDD 20MHz DL Throughput for 300 sec for 1TX/1RX
|
||||
|
||||
01 59 lte-softmodem tests with USRP X310 RF as eNB and OAI EPC (eNB and EPC are on same machines) w/ Bandrich COTS UE
|
||||
|
||||
01 60 lte-softmodem tests with USRP X310 RF as eNB and OAI EPC (eNB and EPC are on different machines) w/ Bandrich COTS UE
|
||||
01 60 00 Band 7 FDD 5MHz UL Throughput for 300 sec for 1TX/1RX
|
||||
01 60 01 Band 7 FDD 10MHz UL Throughput for 300 sec for 1TX/1RX
|
||||
01 60 02 Band 7 FDD 20MHz UL Throughput for 300 sec for 1TX/1RX
|
||||
01 60 03 Band 7 FDD 5MHz DL Throughput for 300 sec for 1TX/1RX
|
||||
01 60 04 Band 7 FDD 10MHz DL Throughput for 300 sec for 1TX/1RX
|
||||
01 60 05 Band 7 FDD 20MHz DL Throughput for 300 sec for 1TX/1RX
|
||||
|
||||
01 61 lte-softmodem tests with EXMIMO RF as eNB and ALU EPC w/ Bandrich COTS UE for `TX/1RX, 2TX/2RX
|
||||
01 61 00 Band 7 FDD 5MHz UL Throughput for 300 sec for 1TX/1RX
|
||||
01 61 01 Band 7 FDD 10MHz UL Throughput for 300 sec for 1TX/1RX
|
||||
01 61 02 Band 7 FDD 20MHz UL Throughput for 300 sec for 1TX/1RX
|
||||
01 61 03 Band 7 FDD 5MHz DL Throughput for 300 sec for 1TX/1RX
|
||||
01 61 04 Band 7 FDD 10MHz DL Throughput for 300 sec for 1TX/1RX
|
||||
01 61 05 Band 7 FDD 20MHz DL Throughput for 300 sec for 1TX/1RX
|
||||
|
||||
01 62 lte-softmodem tests with EXMIMO RF as eNB and OAI EPC (eNB and EPC are on same machines) w/ Bandrich COTS UE
|
||||
|
||||
01 63 lte-softmodem tests with EXMIMO RF as eNB and OAI EPC (eNB and EPC are on different machines) w/ Bandrich COTS UE
|
||||
01 63 00 Band 7 FDD 5MHz UL Throughput for 300 sec for 1TX/1RX
|
||||
01 63 01 Band 7 FDD 10MHz UL Throughput for 300 sec for 1TX/1RX
|
||||
01 63 02 Band 7 FDD 20MHz UL Throughput for 300 sec for 1TX/1RX
|
||||
01 63 03 Band 7 FDD 5MHz DL Throughput for 300 sec for 1TX/1RX
|
||||
01 63 04 Band 7 FDD 10MHz DL Throughput for 300 sec for 1TX/1RX
|
||||
01 63 05 Band 7 FDD 20MHz DL Throughput for 300 sec for 1TX/1RX
|
||||
|
||||
01 65 00 lte-softmodem tests with BladeRF RF as eNB and ALU EPC w/ Bandrich COTS UE for TX/1RX
|
||||
01 65 00 Band 7 FDD 5MHz UL Throughput for 300 sec for 1TX/1RX
|
||||
01 65 01 Band 7 FDD 10MHz UL Throughput for 300 sec for 1TX/1RX
|
||||
01 65 02 Band 7 FDD 20MHz UL Throughput for 300 sec for 1TX/1RX
|
||||
01 65 03 Band 7 FDD 5MHz DL Throughput for 300 sec for 1TX/1RX
|
||||
01 65 04 Band 7 FDD 10MHz DL Throughput for 300 sec for 1TX/1RX
|
||||
01 65 05 Band 7 FDD 20MHz DL Throughput for 300 sec for 1TX/1RX
|
||||
|
||||
01 64 lte-softmodem-noS1 tests
|
||||
|
||||
02 Functional test case
|
||||
|
||||
@@ -48,3 +181,10 @@ Obj.# Case# Test# Description
|
||||
|
||||
05 Performance test case
|
||||
|
||||
|
||||
#TODO: Add test cases for 10,20 MHz
|
||||
#TODO: Add test cases for TDD/FDD
|
||||
#TODO: Test and compile seperately for Rel8/Rel10
|
||||
#TODO: Case03.py eMBMS test case
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,351 @@
|
||||
#******************************************************************************
|
||||
|
||||
# Eurecom OpenAirInterface
|
||||
# Copyright(c) 1999 - 2013 Eurecom
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify it
|
||||
# under the terms and conditions of the GNU General Public License,
|
||||
# version 2, as published by the Free Software Foundation.
|
||||
|
||||
# This program is distributed in the hope it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
# more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License along with
|
||||
# this program; if not, write to the Free Software Foundation, Inc.,
|
||||
# 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
# The full GNU General Public License is included in this distribution in
|
||||
# the file called "COPYING".
|
||||
|
||||
# Contact Information
|
||||
# Openair Admin: openair_admin@eurecom.fr
|
||||
# Openair Tech : openair_tech@eurecom.fr
|
||||
# Forums : http://forums.eurecom.fsr/openairinterface
|
||||
# Address : Eurecom, Compus SophiaTech 450, route des chappes, 06451 Biot, France
|
||||
|
||||
#*****************************************************************************
|
||||
|
||||
# \file core.py
|
||||
# \brief OAI core testing class that provides various primitives to send/recv cmd to openair class searching for patterns and process the responses and tag the test case as passed/failed/skipped
|
||||
# \author Navid Nikaein
|
||||
# \date 2013
|
||||
# \version 0.1
|
||||
# @ingroup _test
|
||||
|
||||
|
||||
import pexpect
|
||||
import time
|
||||
import re
|
||||
import string
|
||||
import sys
|
||||
import os
|
||||
|
||||
import openair
|
||||
import log
|
||||
|
||||
class core:
|
||||
def __init__(self):
|
||||
self.send_cr = 1
|
||||
self.expect_echo = 0
|
||||
self.expect_response = 1
|
||||
self.flag_errors = 1
|
||||
self.log = None
|
||||
|
||||
def clean(self, obj):
|
||||
if type(obj) is str:
|
||||
return obj
|
||||
else:
|
||||
return repr(obj)
|
||||
|
||||
def mark(self, marker):
|
||||
if self.log:
|
||||
print >> self.log, "\n\n{" + marker + "}\n\n"
|
||||
|
||||
def expected(self, expected, got):
|
||||
return "================================= Failure ===================================\n"+\
|
||||
"_________________________________ Expected __________________________________\n"+\
|
||||
"--->" + expected + "<-\n" +\
|
||||
"_________________________________ Received __________________________________\n"+\
|
||||
"--->" + got + "<-\n" +\
|
||||
"=============================================================================\n"
|
||||
|
||||
def unexpected(self, notexpected, got):
|
||||
return "================================= Failure ===================================\n"+\
|
||||
"__________________________ not expect to find _______________________________\n"+\
|
||||
"---> " + self.clean(notexpected) + "\n" +\
|
||||
"_________________________________ Received___________________________________\n"+\
|
||||
"---> " + self.clean(got) + "\n" +\
|
||||
"=============================================================================\n"
|
||||
|
||||
def failed(self, command, expect,debug):
|
||||
time.sleep(2)
|
||||
ret = "================================= Failure =================================\n"
|
||||
ret +="_________________________________ Sent ____________________________________\n"
|
||||
ret +="---> " + command + "\n"
|
||||
ret +="______________________________Searching for _______________________________\n"
|
||||
ret +="---> " + self.clean(expect) + "\n"
|
||||
if debug >= 1 :
|
||||
ret +="________________________________ Received _________________________________\n"
|
||||
ret +="---> " + self.clean(self.oai.before) + "\n"
|
||||
ret +="_______________________________ Remaining _________________________________\n"
|
||||
ret +="---> " + self.clean(self.oai.after) + "\n"
|
||||
ret +="===========================================================================\n"
|
||||
return ret
|
||||
|
||||
def err(self, command):
|
||||
return "============================ Error received ================================\n"+\
|
||||
"__________________________________ Sent ____________________________________\n"+\
|
||||
'---> ' + command + "\n"+\
|
||||
"_________________________________ Error was ________________________________\n"+\
|
||||
"---> " + self.oai.before + "\n" +\
|
||||
"============================================================================\n"
|
||||
|
||||
|
||||
def wait_quiet(self, timeout=0.5):
|
||||
while 1:
|
||||
try:
|
||||
self.oai.expect(['..*'], timeout=0.5)
|
||||
except pexpect.TIMEOUT, e:
|
||||
return
|
||||
# print '[Flushing ' + self.oai.after + ']'
|
||||
|
||||
# **************************Send*****************************
|
||||
# 1) send a command and return, do not wait
|
||||
# ************************************************************
|
||||
def send_nowait(self, command, sudo=False):
|
||||
rsp1 = self.prompt1
|
||||
rsp2 = self.prompt2
|
||||
if sudo == True:
|
||||
command = 'echo \'' + '' + '\' | sudo -S -E bash -c \' ' + command + '\' '
|
||||
self.wait_quiet()
|
||||
if self.send_cr:
|
||||
log.stats['cmd'] += 1
|
||||
self.oai.sendline(command)
|
||||
else:
|
||||
self.oai.send(command)
|
||||
|
||||
|
||||
# **************************Send*****************************
|
||||
# 1) send a command
|
||||
# 2) wait for a return prompt. Don't capture the response.
|
||||
# 3) Check for error or timeout.
|
||||
# ************************************************************
|
||||
def send(self, command,sudo=False, timeout = 50, rsp1=None, rsp2=None,debug=0):
|
||||
if not rsp1:
|
||||
rsp1 = self.prompt1
|
||||
if not rsp2:
|
||||
rsp2 = self.prompt2
|
||||
self.wait_quiet()
|
||||
if sudo == True:
|
||||
command = 'echo \'' + '' + '\' | sudo -S -E bash -c \' ' + command + '\' '
|
||||
if self.send_cr:
|
||||
log.stats['cmd'] += 1
|
||||
self.oai.sendline(command)
|
||||
else:
|
||||
self.oai.send(command)
|
||||
|
||||
if self.expect_echo:
|
||||
#cmd = self.oai.expect([re.escape(command), pexpect.TIMEOUT], timeout=timeout);
|
||||
cmd = self.oai.expect_exact([command, pexpect.TIMEOUT], timeout=timeout);
|
||||
if cmd != 0:
|
||||
raise log.err(self.failed(command, command,debug))
|
||||
|
||||
if self.expect_response:
|
||||
#index = self.oai.expect([re.escape(rsp1), re.escape(rsp2),'%', pexpect.TIMEOUT], timeout=timeout)
|
||||
index = self.oai.expect_exact([rsp1, rsp2, pexpect.TIMEOUT], timeout=timeout)
|
||||
|
||||
if index == 0 or index == 1:
|
||||
return 'OK'
|
||||
elif index == 2:
|
||||
#self.oai.expect([re.escape(rsp1), re.escape(rsp2), pexpect.TIMEOUT], timeout=timeout)
|
||||
self.oai.expect_exact([rsp1, rsp2, pexpect.TIMEOUT], timeout=timeout)
|
||||
if self.flag_errors:
|
||||
raise log.err(self.err(command))
|
||||
else:
|
||||
return 'OK'
|
||||
else:
|
||||
raise log.err(self.failed(command, rsp1 + ' or ' + rsp2,debug))
|
||||
|
||||
# **************************send_recv*************************
|
||||
# 1) send a command
|
||||
# 2) wait for either rsp1 or rsp2 is found (normally prompts)
|
||||
# 3) return everything seen before that
|
||||
# ************************************************************
|
||||
def send_recv(self, command, sudo=False, timeout=100, rsp1=None, rsp2=None,debug=0):
|
||||
if not rsp1:
|
||||
rsp1 = self.prompt1
|
||||
if not rsp2:
|
||||
rsp2 = self.prompt2
|
||||
self.wait_quiet()
|
||||
if sudo == True:
|
||||
#command = 'echo \'' + self.password + '\' | sudo -S -E ' + command
|
||||
command = 'echo \'' + '' + '\' | sudo -S -E bash -c \' ' + command + '\' '
|
||||
if self.send_cr:
|
||||
log.stats['cmd'] += 1
|
||||
self.oai.sendline(command)
|
||||
else:
|
||||
self.oai.send(command)
|
||||
#index = self.oai.expect([re.escape(rsp1), re.escape(rsp2), pexpect.TIMEOUT], timeout=timeout);
|
||||
index = self.oai.expect_exact([rsp1, rsp2, pexpect.TIMEOUT], timeout=timeout);
|
||||
if index == 0 or index == 1 :
|
||||
return self.oai.before
|
||||
else:
|
||||
print "command = " + command + "rsp1 = " + rsp1 + " rsp2 = " + rsp2 + " index = " + str(index)
|
||||
raise log.err(self.failed(command, rsp1 + ' or ' + rsp2,debug))
|
||||
|
||||
|
||||
# **************************send_expect*************************
|
||||
# 1) send a command, and optionally specify a the time to wait
|
||||
# 2) search for an expected pattern in the response
|
||||
# 3) raise an error if not found
|
||||
# **************************************************************
|
||||
def send_expect(self, command, expect, sudo=False, delay = 50, rsp1=None, rsp2=None,debug=0):
|
||||
if debug :
|
||||
print command
|
||||
print expect
|
||||
print delay
|
||||
rsp = self.send_recv(command, sudo, delay, rsp1, rsp2)
|
||||
#print rsp
|
||||
if (rsp.find(expect) != -1):
|
||||
return 'Ok'
|
||||
|
||||
raise log.err(self.failed(command, expect,debug))
|
||||
|
||||
|
||||
# **************************send_expect_re*************************
|
||||
# 1) send a command, and optionally specify a the time to wait
|
||||
# 2) search for an expected pattern defined by a regular expression in the response
|
||||
# 3) return a error if raise_err flag is set and re not found, otherwise return 'Ok'
|
||||
# *****************************************************************
|
||||
def send_expect_re(self, command, expect, sudo=False, raise_err=1, delay = 50, rsp1=None, rsp2=None,debug=0):
|
||||
rsp = self.send_recv(command, sudo, delay, rsp1, rsp2)
|
||||
# print rsp
|
||||
match = re.compile(expect).search(rsp)
|
||||
if match:
|
||||
return match
|
||||
if raise_err:
|
||||
raise log.err(self.failed(command, expect,debug))
|
||||
else :
|
||||
return None
|
||||
|
||||
# **************************send_expect*************************
|
||||
# 1) send a command, and optionally specify a the time to wait
|
||||
# 2) search for an expected pattern defined by a re in the response
|
||||
# 3) return ok if not found
|
||||
# **************************************************************
|
||||
def send_expect_false(self, command, expect, sudo=False, delay = 5, rsp1=None, rsp2=None,debug=0):
|
||||
rsp = self.send_recv(command, sudo, delay, rsp1, rsp2)
|
||||
# print rsp
|
||||
if (rsp.find(expect) == -1):
|
||||
return 'OK'
|
||||
else:
|
||||
print "command = " + command + "expect = " + expect + "rsp = " + rsp
|
||||
raise log.err(self.failed(command, expect,debug))
|
||||
|
||||
|
||||
# **************************send_wait*************************
|
||||
# 1) send a command, and optionally specify a the time to wait
|
||||
# 2) search for an expected pattern in the response
|
||||
# 3) retry for a numretries if not found
|
||||
# 4) return an error if not found after the numtries
|
||||
# 3) return the response if found
|
||||
# **************************************************************
|
||||
def send_wait(self, command, expect, sudo=False, numretries=3, rsp1=None, rsp2=None,debug=0):
|
||||
timer = 0
|
||||
for i in range(numretries):
|
||||
rsp = self.send_recv(command, sudo, 10, rsp1, rsp2)
|
||||
if (rsp.find(expect) != -1):
|
||||
return rsp;
|
||||
time.sleep(2)
|
||||
timer = timer+2
|
||||
raise log.err(self.failed(command, expect,debug))
|
||||
|
||||
# **************************send_wait_re*************************
|
||||
# 1) send a command, and optionally specify a the time to wait
|
||||
# 2) search for an expected pattern defined by a re in the response
|
||||
# 3) retry for a numretries if not found
|
||||
# 4) return an error if not found after the numtries
|
||||
# 3) return the response if found
|
||||
# **************************************************************
|
||||
def send_wait_re(self, command, expect, sudo=False, numretries=3, rsp1=None, rsp2=None,debug=0):
|
||||
timer = 0
|
||||
for i in range(numretries):
|
||||
rsp = self.send_recv(command,sudo)
|
||||
if re.compile(expect).search(rsp):
|
||||
# print "Found in",i,"attempts"
|
||||
return rsp;
|
||||
time.sleep(2)
|
||||
timer = timer+2
|
||||
raise log.err(self.failed(command, expect,debug))
|
||||
|
||||
# **************************send_wait_false*************************
|
||||
# 1) send a command, and optionally specify a the time to wait
|
||||
# 2) search for an expect pattern in the response
|
||||
# 3) return the response if not found
|
||||
# 4) return an error if the pattern found after the numtries
|
||||
# **************************************************************
|
||||
def send_wait_false(self, command, expect, sudo=False, numretries=3, rsp1=None, rsp2=None,debug=0):
|
||||
timer = 1
|
||||
for i in range(numretries):
|
||||
rsp = self.send_recv(command,sudo)
|
||||
if (rsp.find(expect) == -1):
|
||||
return rsp;
|
||||
time.sleep(2)
|
||||
timer = timer+2
|
||||
raise log.err(self.failed(command, expect,debug))
|
||||
|
||||
# **************************send_wait_false*************************
|
||||
# 1) send a command, and optionally specify a the time to wait
|
||||
# 2) search for an expect pattern defined by a re in the response
|
||||
# 3) return the response if not found
|
||||
# 4) return an error if the pattern found after the numtries
|
||||
# **************************************************************
|
||||
def send_wait_false_re(self, command, expect, sudo=False, numretries=3, rsp1=None, rsp2=None,debug=0):
|
||||
timer = 0
|
||||
for i in range(numretries):
|
||||
rsp = self.send_recv(command,sudo)
|
||||
if not re.compile(expect).search(rsp):
|
||||
return rsp;
|
||||
time.sleep(2)
|
||||
timer = timer+2
|
||||
raise log.err(self.failed(command, expect,debug))
|
||||
|
||||
# **************************find*************************
|
||||
# 1) find an exact pattern in a given string
|
||||
# 2) raise an error if not found
|
||||
# **************************************************************
|
||||
def find(self, string, pattern):
|
||||
word = string.replace(pattern,'*','\*')
|
||||
words = string.replace(word,' ','\s*')
|
||||
if re.search(words,string):
|
||||
pass
|
||||
else:
|
||||
raise log.err(string)
|
||||
|
||||
|
||||
# **************************find_false**************************
|
||||
# 1) find an exact pattern in a given string
|
||||
# 2) raise an error if found
|
||||
# **************************************************************
|
||||
def find_false(self, string, pattern):
|
||||
if string.find(pattern) != -1:
|
||||
raise log.err(string)
|
||||
|
||||
# **************************find_re*************************
|
||||
# 1) find an exact re pattern in a given string
|
||||
# 2) raise an error if not found
|
||||
# **************************************************************
|
||||
def find_re(self, string, pattern):
|
||||
if not re.compile(pattern).search(string):
|
||||
raise log.err(string)
|
||||
|
||||
# **************************find_false_re*************************
|
||||
# 1) find an exact re pattern in a given string
|
||||
# 2) raise an error if found
|
||||
# **************************************************************
|
||||
def find_false_re(self, string, pattern):
|
||||
if re.compile(pattern).search(string):
|
||||
raise log.err(string)
|
||||
|
||||
@@ -0,0 +1,206 @@
|
||||
#******************************************************************************
|
||||
|
||||
# Eurecom OpenAirInterface
|
||||
# Copyright(c) 1999 - 2013 Eurecom
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify it
|
||||
# under the terms and conditions of the GNU General Public License,
|
||||
# version 2, as published by the Free Software Foundation.
|
||||
|
||||
# This program is distributed in the hope it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
# more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License along with
|
||||
# this program; if not, write to the Free Software Foundation, Inc.,
|
||||
# 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
# The full GNU General Public License is included in this distribution in
|
||||
# the file called "COPYING".
|
||||
|
||||
# Contact Information
|
||||
# Openair Admin: openair_admin@eurecom.fr
|
||||
# Openair Tech : openair_tech@eurecom.fr
|
||||
# Forums : http://forums.eurecom.fsr/openairinterface
|
||||
# Address : Eurecom, Compus SophiaTech 450, route des chappes, 06451 Biot, France
|
||||
|
||||
#*****************************************************************************
|
||||
|
||||
# \file log.py
|
||||
# \brief provides primitives and defines how the logs and statistics are generated
|
||||
# \author Navid Nikaein
|
||||
# \date 2013
|
||||
# \version 0.1
|
||||
# @ingroup _test
|
||||
|
||||
import sys
|
||||
import re
|
||||
import time
|
||||
import datetime
|
||||
import array
|
||||
import xml.etree.ElementTree as ET
|
||||
|
||||
|
||||
debug = False
|
||||
docfile = ''
|
||||
start_time = time.time()
|
||||
testcase_starttime = start_time
|
||||
debug = 0
|
||||
stats = {'passed':0, 'failed':0, 'skipped':0, 'internal_errors':0, 'cmd':0}
|
||||
|
||||
# xml result (jUnit like)
|
||||
xUnitTestsuites = ET.Element( 'testsuites' )
|
||||
xUnitTestsuite = ET.SubElement( xUnitTestsuites, 'testsuite' )
|
||||
xUnitTestsuite.set( 'name', 'OAI' )
|
||||
xUnitTestsuite.set( 'timestamp', datetime.datetime.fromtimestamp(start_time).strftime('%Y-%m-%dT%H:%M:%S') )
|
||||
xUnitTestsuite.set( 'hostname', 'localhost' )
|
||||
#xUnitSystemOut = ET.SubElement( xUnitTestsuite, 'system-out' )
|
||||
|
||||
class bcolors:
|
||||
header = '\033[95m'
|
||||
okblue = '\033[94m'
|
||||
okgreen = '\033[92m'
|
||||
warning = '\033[93m'
|
||||
fail = '\033[91m'
|
||||
normal = '\033[0m'
|
||||
|
||||
def __init__(self):
|
||||
if not sys.stdout.isatty():
|
||||
self.disable()
|
||||
|
||||
def disable(self):
|
||||
self.header = ''
|
||||
self.okblue = ''
|
||||
self.okgreen = ''
|
||||
self.warning = ''
|
||||
self.fail = ''
|
||||
self.normal = ''
|
||||
|
||||
class err(Exception):
|
||||
def __init__(self, value):
|
||||
self.value = value
|
||||
def __str__(self):
|
||||
return repr(self.value)
|
||||
|
||||
def writefile(logfile, message):
|
||||
F_testlog = open(logfile, 'a')
|
||||
F_testlog.write(message + '\n')
|
||||
F_testlog.close()
|
||||
|
||||
|
||||
def sleep(seconds):
|
||||
time.sleep(seconds)
|
||||
|
||||
def start():
|
||||
"""Start the timer for the following testcase."""
|
||||
global testcase_starttime
|
||||
testcase_starttime = time.time()
|
||||
|
||||
def set_debug_level(level):
|
||||
debug = level
|
||||
|
||||
def statistics(logfile):
|
||||
global start_time
|
||||
|
||||
#if stats['passed'] == 0:
|
||||
# print "no test executed...exiting"
|
||||
# sys.exit()
|
||||
|
||||
total_tests = stats['passed'] + stats['failed'] + stats['skipped']
|
||||
total_ex_tests = stats['passed'] + stats['failed']
|
||||
elapsed_time = time.gmtime(time.time() - start_time)
|
||||
print '\n'
|
||||
log_record('info', '===============================================')
|
||||
log_record('info', 'Total tests performed ' + repr(total_tests))
|
||||
log_record('info', 'Tests passed ' + repr(stats['passed']))
|
||||
log_record('info', 'Tests failed ' + repr(stats['failed']))
|
||||
log_record('info', 'Tests skipped ' + repr(stats['skipped']))
|
||||
log_record('info', '')
|
||||
log_record('info', 'Total commands sent ' + repr(stats['cmd']))
|
||||
log_record('info', 'Total elapsed time (h:m:s) ' + time.strftime('%H:%M:%S', elapsed_time))
|
||||
log_record('info', '===============================================')
|
||||
log_record('info', 'Testing pass rate ' + repr((stats['passed'] * 100) / total_tests) + '%')
|
||||
log_record('info', '===============================================')
|
||||
|
||||
writefile(logfile, '\n=====================Results===================')
|
||||
writefile(logfile, 'Total tests performed ' + repr(total_tests))
|
||||
writefile(logfile, 'Tests passed ' + repr(stats['passed']))
|
||||
writefile(logfile, 'Tests failed ' + repr(stats['failed']))
|
||||
writefile(logfile, 'Tests skipped ' + repr(stats['skipped']))
|
||||
writefile(logfile, '')
|
||||
writefile(logfile, 'Total commands sent ' + repr(stats['cmd']))
|
||||
writefile(logfile, 'Total elapsed time (h:m:s) ' + time.strftime('%H:%M:%S', elapsed_time))
|
||||
writefile(logfile, '===============================================')
|
||||
writefile(logfile, 'Testing pass rate ' + repr((stats['passed'] * 100) / total_tests) + '%')
|
||||
writefile(logfile, '===============================================\n')
|
||||
|
||||
xUnitTestsuite.set( 'tests', repr(total_tests) )
|
||||
xUnitTestsuite.set( 'failures', repr(stats['failed']) )
|
||||
xUnitTestsuite.set( 'skipped', repr(stats['skipped']) )
|
||||
xUnitTestsuite.set( 'errors', '0' )
|
||||
time_delta = datetime.datetime.now() - datetime.datetime.fromtimestamp(start_time)
|
||||
xUnitTestsuite.set( 'time', repr(time_delta.total_seconds()) )
|
||||
writefile( logfile + '.xml', ET.tostring( xUnitTestsuites, encoding="utf-8", method="xml" ) )
|
||||
|
||||
def log_record(level, message):
|
||||
ts = time.strftime('%d %b %Y %H:%M')
|
||||
message = ts + ' [' + level + '] ' + message
|
||||
if level == 'passed' :
|
||||
print bcolors.okgreen + message + bcolors.normal
|
||||
elif level == 'failed' :
|
||||
print bcolors.fail + message + bcolors.normal
|
||||
elif level == 'skipped' :
|
||||
print bcolors.warning + message + bcolors.normal
|
||||
else :
|
||||
print message
|
||||
|
||||
def fail(case, testnum, testname, conf, message, diag, output,trace):
|
||||
# report(case, testnum, testname, conf, 'failed', output, diag, message)
|
||||
report(case, testnum, testname, conf, 'failed', output, diag)
|
||||
log_record('failed', case + testnum + ' : ' + testname + ' ('+ conf+')')
|
||||
if message :
|
||||
log_record('failed', "Output follows:\n" + message )
|
||||
if trace :
|
||||
log_record('failed', "trace file can be found in " + trace + "\n" )
|
||||
stats['failed'] += 1
|
||||
|
||||
def failquiet(case, testnum, testname, conf):
|
||||
log_record('failed', case + testnum + ' :' + testname + ' ('+ conf+')')
|
||||
stats['failed'] += 1
|
||||
|
||||
def ok(case, testnum, testname, conf, message, output):
|
||||
report(case, testnum, testname, conf, 'passed', output)
|
||||
log_record('passed', case + testnum + ' : ' + testname + ' ('+ conf+')')
|
||||
if message :
|
||||
print bcolors.okgreen + message + bcolors.normal
|
||||
stats['passed'] += 1
|
||||
|
||||
|
||||
def skip(case, testnum, testname, conf, message=None, diag=None, output=None):
|
||||
log_record('skipped', case + testnum + ' :' + testname + ' ('+ conf+')')
|
||||
report(case, testnum, testname, conf, 'skipped', output, diag)
|
||||
if message :
|
||||
log_record('skipped', "Output follows:\n" + message )
|
||||
if diag :
|
||||
log_record('skipped', "Diagnostic: \n" + diag )
|
||||
stats['skipped'] += 1
|
||||
|
||||
|
||||
def report(case, test, name, conf, status, output, diag=None, desc=None):
|
||||
writefile (output, '[' +status+ '] ' + case + test + ' : ' + name + ' ('+ conf+')')
|
||||
if diag :
|
||||
writefile (output, '-------> ' + diag)
|
||||
if desc:
|
||||
writefile(output, desc)
|
||||
#log_record('report', + case + test + ' documented')
|
||||
e = ET.SubElement( xUnitTestsuite, 'testcase' )
|
||||
e.set( 'name', case + '_' + test + '_' + name )
|
||||
e.set( 'classname', 'shellscript' )
|
||||
e.set( 'time', repr( time.time() - testcase_starttime ) )
|
||||
if status == 'failed':
|
||||
e = ET.SubElement( e, 'failure' )
|
||||
e.set( 'message', 'failed' )
|
||||
e.text = diag
|
||||
if status == 'skipped':
|
||||
e = ET.SubElement( e, 'skipped' )
|
||||
@@ -0,0 +1,272 @@
|
||||
#******************************************************************************
|
||||
|
||||
# Eurecom OpenAirInterface
|
||||
# Copyright(c) 1999 - 2013 Eurecom
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify it
|
||||
# under the terms and conditions of the GNU General Public License,
|
||||
# version 2, as published by the Free Software Foundation.
|
||||
|
||||
# This program is distributed in the hope it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
# more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License along with
|
||||
# this program; if not, write to the Free Software Foundation, Inc.,
|
||||
# 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
# The full GNU General Public License is included in this distribution in
|
||||
# the file called "COPYING".
|
||||
|
||||
# Contact Information
|
||||
# Openair Admin: openair_admin@eurecom.fr
|
||||
# Openair Tech : openair_tech@eurecom.fr
|
||||
# Forums : http://forums.eurecom.fsr/openairinterface
|
||||
# Address : Eurecom, Compus SophiaTech 450, route des chappes, 06451 Biot, France
|
||||
|
||||
#*****************************************************************************
|
||||
|
||||
# \file openair.py
|
||||
# \brief class that define the oaisim class and its attributes
|
||||
# \author Navid Nikaein
|
||||
# \date 2013
|
||||
# \version 0.1
|
||||
# @ingroup _test
|
||||
|
||||
import pexpect
|
||||
import pxssh
|
||||
import time
|
||||
import os
|
||||
import array
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
import traceback
|
||||
import time
|
||||
# import call
|
||||
|
||||
from core import *
|
||||
|
||||
SHELL = '/bin/bash'
|
||||
|
||||
class openair(core):
|
||||
def __init__(self, hostname, address):
|
||||
self.error = '% '
|
||||
self.hostname = hostname
|
||||
self.address = address
|
||||
self.localhost = None
|
||||
core.__init__(self)
|
||||
|
||||
@property
|
||||
def localhost(self):
|
||||
if self.localhost :
|
||||
return self.localhost
|
||||
elif self.hostname in ['localhost', '127.0.0.7', '::1'] :
|
||||
self.localhost = self.hostname
|
||||
return self.localhost
|
||||
|
||||
@localhost.setter
|
||||
def localhost(self,localhost):
|
||||
self.localhost = localhost
|
||||
|
||||
def shcmd(self,cmd,sudo=False):
|
||||
|
||||
if sudo:
|
||||
cmd = "sudo %s" % command
|
||||
|
||||
proc = subprocess.Popen(command, shell=True,
|
||||
stdout = subprocess.PIPE,
|
||||
stderr = subprocess.PIPE)
|
||||
|
||||
stdout, stderr = proc.communicate()
|
||||
return (stdout, stderr)
|
||||
|
||||
def connect(self, username, password, prompt='PEXPECT_OAI'):
|
||||
max_retries=100
|
||||
i=0
|
||||
while i <= max_retries:
|
||||
self.prompt1 = prompt
|
||||
self.prompt2 = prompt
|
||||
self.password = ''
|
||||
i=i+1
|
||||
# WE do not store the password when sending commands for secuirity reasons. The password might be accidentally logged in such cases.
|
||||
#The password is used only to make ssh connections. In case user wants to run programs with sudo, then he/she needs to add following line in /etc/sudoers
|
||||
# your_user_name ALL=(ALL:ALL) NOPASSWD: ALL
|
||||
try:
|
||||
if not username:
|
||||
username = root
|
||||
if not password:
|
||||
password = username
|
||||
self.oai = pxssh.pxssh()
|
||||
self.oai.login(self.address,username,password)
|
||||
self.oai.sendline('PS1='+self.prompt1)
|
||||
self.oai.PROMPT='PEXPECT_OAI'
|
||||
# need to look for twice the string of the prompt
|
||||
self.oai.prompt()
|
||||
self.oai.prompt()
|
||||
self.oai.sendline('uptime')
|
||||
self.oai.prompt()
|
||||
print self.oai.before
|
||||
break
|
||||
except Exception, e:
|
||||
error=''
|
||||
error = error + ' In function: ' + sys._getframe().f_code.co_name + ': *** Caught exception: ' + str(e.__class__) + " : " + str( e)
|
||||
error = error + 'address = "'+ self.address +' username = ' + username
|
||||
error = error + traceback.format_exc()
|
||||
print error
|
||||
print "Retrying again in 1 seconds"
|
||||
time.sleep(1)
|
||||
if i==max_retries:
|
||||
print "Fatal Error: Terminating the program now..."
|
||||
sys.exit(1)
|
||||
|
||||
def connect2(self, username, password, prompt='$'):
|
||||
self.prompt1 = prompt
|
||||
self.prompt2 = prompt
|
||||
self.password = password
|
||||
while 1:
|
||||
try:
|
||||
if not username:
|
||||
username = root
|
||||
if not password:
|
||||
password = username
|
||||
|
||||
self.oai = pexpect.spawn('ssh -o "UserKnownHostsFile=/dev/null" -o "StrictHostKeyChecking=no" -o "ConnectionAttempts=1" ' \
|
||||
+ username + '@' + self.address)
|
||||
|
||||
index = self.oai.expect([re.escape(self.prompt1), re.escape(self.prompt2), pexpect.TIMEOUT], timeout=40)
|
||||
if index == 0 :
|
||||
return 'Ok'
|
||||
else :
|
||||
index = self.oai.expect(['password:', pexpect.TIMEOUT], timeout=40)
|
||||
if index == 0 :
|
||||
self.oai.sendline(password)
|
||||
index = self.oai.expect([re.escape(self.prompt1), re.escape(self.prompt2), pexpect.TIMEOUT], timeout=10)
|
||||
if index != 0:
|
||||
print 'ERROR! could not login with SSH.'
|
||||
print 'Expected ' + self.prompt1 + ', received >>>>' + self.oai.before + '<<<<'
|
||||
sys.exit(1)
|
||||
return 'Ok'
|
||||
|
||||
except Exception, e:
|
||||
error=''
|
||||
error = error + ' In function: ' + sys._getframe().f_code.co_name + ': *** Caught exception: ' + str(e.__class__) + " : " + str( e)
|
||||
error = error + traceback.format_exc()
|
||||
print error
|
||||
sys.exit(1)
|
||||
|
||||
def connect_localshell(self, prompt='$'):
|
||||
self.prompt1 = prompt
|
||||
self.prompt2 = prompt
|
||||
|
||||
while 1:
|
||||
try:
|
||||
# start a shell and use the current environment
|
||||
self.oai = pexpect.spawn('bash --norc --noprofile')
|
||||
|
||||
index = self.oai.expect([re.escape(self.prompt1), re.escape(self.prompt2), pexpect.TIMEOUT], timeout=40)
|
||||
if index == 0 :
|
||||
return 'Ok'
|
||||
else :
|
||||
sys.exit(1)
|
||||
|
||||
except Exception, e:
|
||||
error=''
|
||||
error = error + ' In function: ' + sys._getframe().f_code.co_name + ': *** Caught exception: ' + str(e.__class__) + " : " + str( e)
|
||||
error = error + traceback.format_exc()
|
||||
print error
|
||||
sys.exit(1)
|
||||
|
||||
def disconnect(self):
|
||||
print 'disconnecting the ssh connection to ' + self.address + '\n'
|
||||
self.oai.send('exit')
|
||||
# self.cancel()
|
||||
|
||||
def kill(self, user, pw):
|
||||
try:
|
||||
if user == 'root' :
|
||||
os.system('pkill oaisim oaisim_nos1')
|
||||
os.system('pkill cc1')
|
||||
time.sleep(1)
|
||||
os.system('pkill oaisim oaisim_nos1')
|
||||
else :
|
||||
os.system('echo '+pw+' | sudo -S pkill oaisim oaisim_nos1')
|
||||
os.system('echo '+pw+' | sudo -S pkill cc1')
|
||||
time.sleep(1)
|
||||
os.system('echo '+pw+' | sudo -S pkill oaisim oaisim_nos1')
|
||||
except Exception, e:
|
||||
error=''
|
||||
error = error + ' In function: ' + sys._getframe().f_code.co_name + ': *** Caught exception: ' + str(e.__class__) + " : " + str( e)
|
||||
error = error + traceback.format_exc()
|
||||
print error
|
||||
#sys.exit(1)
|
||||
|
||||
def rm_driver(self,oai,user, pw):
|
||||
try:
|
||||
if user == 'root' :
|
||||
#oai.send_nowait('rmmod nasmesh;')
|
||||
os.system('rmmod nasmesh;')
|
||||
else :
|
||||
oai.send_nowait('echo '+pw+ ' | sudo -S rmmod nasmesh;')
|
||||
#os.system('echo '+pw+ ' | sudo -S rmmod nasmesh;')
|
||||
except Exception, e:
|
||||
error=''
|
||||
error = error + ' In function: ' + sys._getframe().f_code.co_name + ': *** Caught exception: ' + str(e.__class__) + " : " + str( e)
|
||||
error = error + traceback.format_exc()
|
||||
print error
|
||||
#sys.exit(1)
|
||||
|
||||
def driver(self,oai,user,pw):
|
||||
#pwd = oai.send_recv('pwd')
|
||||
oai.send('cd $OPENAIR_TARGETS;')
|
||||
oai.send('cd SIMU/USER;')
|
||||
try:
|
||||
if user == 'root' :
|
||||
oai.send_nowait('insmod ./nasmesh.ko;')
|
||||
else :
|
||||
oai.send('echo '+pw+ ' | sudo -S insmod ./nasmesh.ko;')
|
||||
|
||||
except Exception, e:
|
||||
error=''
|
||||
error = error + ' In function: ' + sys._getframe().f_code.co_name + ': *** Caught exception: ' + str(e.__class__) + " : " + str( e)
|
||||
error = error + traceback.format_exc()
|
||||
print error
|
||||
#sys.exit(1)
|
||||
|
||||
def cleandir (self, logdir,debug) :
|
||||
|
||||
for filename in os.listdir(logdir):
|
||||
filepath = os.path.join(logdir, filename)
|
||||
if debug == 2 :
|
||||
print 'logdir is ' + logdir
|
||||
print 'filepath is ' + filepath
|
||||
try:
|
||||
shutil.rmtree(filepath)
|
||||
except Exception, e:
|
||||
error=''
|
||||
error = error + ' In function: ' + sys._getframe().f_code.co_name + ': *** Caught exception: ' + str(e.__class__) + " : " + str( e)
|
||||
error = error + traceback.format_exc()
|
||||
print error
|
||||
#sys.exit(1)
|
||||
#print 'Could not remove the filepath'+ filepath + ' with error ' + OSError
|
||||
|
||||
def create_dir(self,dirname,debug) :
|
||||
if not os.path.exists(dirname) :
|
||||
try:
|
||||
os.makedirs(dirname,0755)
|
||||
except OSError:
|
||||
# There was an error on creation, so make sure we know about it
|
||||
raise
|
||||
def cpu_freq(self):
|
||||
freq=0
|
||||
proc = subprocess.Popen(["cat","/proc/cpuinfo"],
|
||||
stdout=subprocess.PIPE)
|
||||
out, err = proc.communicate()
|
||||
|
||||
for line in out.split("\n"):
|
||||
if "cpu MHz" in line:
|
||||
freq = float(line.split(":")[1])
|
||||
break
|
||||
|
||||
return freq
|
||||
@@ -7,12 +7,16 @@ else
|
||||
exit 1
|
||||
fi
|
||||
|
||||
trap handle_ctrl_c INT
|
||||
|
||||
source $OPENAIR_DIR/cmake_targets/tools/test_helper
|
||||
|
||||
|
||||
#SUDO="sudo -E "
|
||||
tdir=$OPENAIR_DIR/cmake_targets/autotests
|
||||
mkdir -p $tdir/bin $tdir/log
|
||||
results_file="$tdir/log/execution_autotests.xml"
|
||||
rm -fr $tdir/bin
|
||||
mkdir -p $tdir/bin
|
||||
results_file="$tdir/log/results_autotests.xml"
|
||||
|
||||
updated=$(svn st -q $OPENAIR_DIR)
|
||||
if [ "$updated" != "" ] ; then
|
||||
@@ -21,6 +25,140 @@ fi
|
||||
|
||||
cd $tdir
|
||||
|
||||
#\param $1 -> name of test case
|
||||
#\param $2 -> name of compilation program
|
||||
#\param $3 -> arguments for compilation program
|
||||
#\param $4 -> name of pre-executable to install kernel modules, etc
|
||||
#\param $5 -> arguments of pre-executable
|
||||
#\param $6 -> name of executable
|
||||
#\param $7 -> arguments for running the program
|
||||
#\param $8 -> search expression
|
||||
#\param $9 -> search expression which should NOT be found (for ex. segmentation fault)
|
||||
#\param $10 -> number of runs
|
||||
#\param $11 -> pre_compile program execution
|
||||
#\param $12 -> class of the test case (compilation, execution)
|
||||
#\param $13 -> output of compilation program that needs to be found for test case to pass
|
||||
#\param $14 -> tags to help identify the test case for readability in output xml file
|
||||
function test_compile() {
|
||||
|
||||
xUnit_start
|
||||
test_case_name=$1
|
||||
log_dir=$tdir/log/$test_case_name
|
||||
log_file=$log_dir/test.$1.log.txt
|
||||
compile_prog=$2
|
||||
compile_args=$3
|
||||
pre_exec_file=$4
|
||||
pre_exec_args=$5
|
||||
exec_args=$7
|
||||
search_expr_array=("${!8}")
|
||||
search_expr_negative=$9
|
||||
nruns=${10}
|
||||
pre_compile_prog=${11}
|
||||
class=${12}
|
||||
compile_prog_out=${13}
|
||||
tags=${14}
|
||||
xmlfile_testcase=$log_dir/test.$1.xml
|
||||
#build_dir=$tdir/$1/build
|
||||
#exec_file=$build_dir/$6
|
||||
|
||||
#compile_prog_out=`eval "echo $compile_prog_out"`
|
||||
#echo "compile_prog_out = $compile_prog_out"
|
||||
read -a compile_prog_out_array <<< "$compile_prog_out"
|
||||
|
||||
#Temporary log file where execution log is stored.
|
||||
temp_exec_log=$log_dir/temp_log.txt
|
||||
rm -fr $log_dir
|
||||
mkdir -p $log_dir
|
||||
|
||||
|
||||
|
||||
#echo "log_dir = $log_dir"
|
||||
#echo "log_file = $log_file"
|
||||
#echo "exec_file = $exec_file"
|
||||
#echo "exec_args = $exec_args"
|
||||
#echo "search_expr = $search_expr"
|
||||
#echo "pre_exec_file = $pre_exec_file"
|
||||
#echo "nruns = $nruns"
|
||||
echo "class = $class"
|
||||
|
||||
compile_prog_array=()
|
||||
read -a compile_prog_array <<<"$compile_prog"
|
||||
|
||||
#tags_array=()
|
||||
#read -a tags_array <<<"$tags"
|
||||
|
||||
#pre_compile_prog_array=()
|
||||
#readarray -t pre_compile_prog_array <<< "$pre_compile_prog"
|
||||
result=1
|
||||
result_string=""
|
||||
for (( run_index=1; run_index <= $nruns; run_index++ ))
|
||||
do
|
||||
|
||||
#tags_array_index=0
|
||||
#for pre_compile_prog_array_index in "${pre_compile_prog_array[@]}"
|
||||
#do
|
||||
|
||||
#for compile_prog_array_index in "${compile_prog_array[@]}"
|
||||
#do
|
||||
echo "Compiling test case $test_case_name.${tags} Log file = $log_file"
|
||||
date=`date`
|
||||
echo "<COMPILATION LOG file=$test_case_name.${tags} , Run = $run_index>, Date = $date " >> $log_file
|
||||
#rm -fr $build_dir
|
||||
#mkdir -p $build_dir
|
||||
cd $log_dir
|
||||
{
|
||||
uname -a
|
||||
compile_log_dir=`eval echo \"$OPENAIR_DIR/cmake_targets/log/\"`
|
||||
echo "Removing compilation log files in $compile_log_dir"
|
||||
rm -frv $compile_log_dir
|
||||
echo "Executing $compile_prog $compile_prog_args ...."
|
||||
eval $compile_prog $compile_prog_args
|
||||
echo "Copying compilation log files to test case log directory: $log_dir"
|
||||
cp -fvr $OPENAIR_DIR/cmake_targets/log/ $log_dir/compile_log
|
||||
}>> $log_file 2>&1
|
||||
echo "</COMPILATION LOG>" >> $log_file 2>&1
|
||||
if [ "$class" == "compilation" ]; then
|
||||
for compile_prog_out_index in ${compile_prog_out_array[@]}
|
||||
do
|
||||
if [ -s "$compile_prog_out_index" ]; then
|
||||
let "result = result&1"
|
||||
|
||||
echo_success "$test_case_name.${tags} RUN = $run_index $compile_prog_out_index = compiled"
|
||||
|
||||
else
|
||||
let "result = result&0"
|
||||
|
||||
echo_error "$test_case_name.${tags} RUN = $run_index $compile_prog_out_index failed"
|
||||
|
||||
fi
|
||||
done #end of for loop compile_prog_out_index
|
||||
if [ "$result" == "1" ]; then
|
||||
result_string=$result_string" Run_$run_index = PASS"
|
||||
else
|
||||
result_string=$result_string" Run_$run_index = FAIL"
|
||||
fi
|
||||
|
||||
fi
|
||||
#let "tags_array_index++"
|
||||
#done # End of for loop compile_prog_array
|
||||
#done # End of for loop (pre_compile_prog_array_index)
|
||||
done #End of for loop (run_index)
|
||||
|
||||
|
||||
#If for for some reason upper for loop does not execute, we fail the test case completely
|
||||
if [ "$result_string" == "" ]; then
|
||||
result=0
|
||||
fi
|
||||
if [ "$result" == "1" ]; then
|
||||
echo_success "$test_case_name.${tags} PASSED"
|
||||
xUnit_success "compilation" "$test_case_name.$tags" "PASS" "$result_string" "$xmlfile_testcase"
|
||||
else
|
||||
echo_error "$test_case_name.${tags} FAILED"
|
||||
xUnit_fail "compilation" "$test_case_name.$tags" "FAIL" "$result_string" "$xmlfile_testcase"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
|
||||
#\param $1 -> name of test case
|
||||
#\param $2 -> name of compilation program
|
||||
@@ -32,211 +170,366 @@ cd $tdir
|
||||
#\param $8 -> search expression
|
||||
#\param $9 -> search expression which should NOT be found (for ex. segmentation fault)
|
||||
#\param $10 -> number of runs
|
||||
#\param $11 -> pre_compile program execution
|
||||
#\param $12 -> class of the test case (compilation, execution)
|
||||
#\param $13 -> output of compilation program that needs to be found for test case to pass
|
||||
#\param $14 -> tags to help identify the test case for readability in output xml file
|
||||
#\param $15 => password for the user to run certain commands as sudo
|
||||
#\param $16 => test config file params to be modified
|
||||
|
||||
test_compile_and_run() {
|
||||
function test_compile_and_run() {
|
||||
xUnit_start
|
||||
test_case_name=$1.$2
|
||||
log_dir=$tdir/log
|
||||
log_file=$tdir/log/test.$1.txt
|
||||
test_case_name=$1
|
||||
log_dir=$tdir/log/$test_case_name
|
||||
log_file=$log_dir/test.$1.log.txt
|
||||
compile_prog=$2
|
||||
compile_args=$3
|
||||
pre_exec_file=$4
|
||||
pre_exec_args=$5
|
||||
main_exec=$6
|
||||
exec_args=$7
|
||||
search_expr_array=("${!8}")
|
||||
search_expr_negative=$9
|
||||
nruns=${10}
|
||||
pre_compile_prog=${11}
|
||||
class=${12}
|
||||
compile_prog_out=${13}
|
||||
tags=${14}
|
||||
mypassword=${15}
|
||||
test_config_file=${16}
|
||||
|
||||
build_dir=$tdir/$1/build
|
||||
exec_file=$build_dir/$6
|
||||
|
||||
#exec_file=$build_dir/$6
|
||||
xmlfile_testcase=$log_dir/test.$1.xml
|
||||
#Temporary log file where execution log is stored.
|
||||
temp_exec_log=$log_dir/temp_log.txt
|
||||
export OPENAIR_LOGDIR=$log_dir
|
||||
rm -fr $log_dir
|
||||
mkdir -p $log_dir
|
||||
|
||||
echo "Compiling test case $test_case_name. Log file = $log_file"
|
||||
|
||||
rm -fr $build_dir
|
||||
mkdir -p $build_dir
|
||||
rm -fr $OPENAIR_DIR/cmake_targets/log
|
||||
|
||||
echo "" > $temp_exec_log
|
||||
echo "" > $log_file
|
||||
#echo "log_dir = $log_dir"
|
||||
#echo "log_file = $log_file"
|
||||
#echo "exec_file = $exec_file"
|
||||
#echo "args = $args"
|
||||
#echo "exec_args = $exec_args"
|
||||
#echo "search_expr = $search_expr"
|
||||
#echo "pre_exec_file = $pre_exec_file"
|
||||
#echo "nruns = $nruns"
|
||||
echo "class = $class"
|
||||
|
||||
#compile_prog_array=()
|
||||
#read -a compile_prog_array <<<"$compile_prog"
|
||||
|
||||
|
||||
#test_config_file=`eval "echo \"$test_config_file\" "`
|
||||
|
||||
echo "<COMPILATION LOG>" > $log_file
|
||||
cd $build_dir
|
||||
{
|
||||
cmake ..
|
||||
#rm -fv $exec_file
|
||||
make -j`nproc` $compile_prog
|
||||
}>> $log_file 2>&1
|
||||
echo "</COMPILATION LOG>" >> $log_file 2>&1
|
||||
|
||||
for (( run_index=1; run_index <= $nruns; run_index++ ))
|
||||
do
|
||||
|
||||
echo "Executing test case $test_case_name, Run Index = $run_index, Log file = $log_file"
|
||||
|
||||
echo "-----------------------------------------------------------------------------" >> $log_file 2>&1
|
||||
echo "<EXECUTION LOG Run = $run_index >" >> $log_file 2>&1
|
||||
|
||||
if [ -n "$pre_exec_file" ]; then
|
||||
{ source $pre_exec_file $pre_exec_args; } >> $log_file 2>&1
|
||||
fi
|
||||
|
||||
{ $exec_file $exec_args ;} > $temp_exec_log 2>&1
|
||||
|
||||
cat $temp_exec_log >> $log_file 2>&1
|
||||
echo "</EXECUTION LOG Run = $run_index >" >> $log_file 2>&1
|
||||
#echo "test_config_file = $test_config_file"
|
||||
|
||||
tags_array=()
|
||||
read -a tags_array <<<"$tags"
|
||||
|
||||
result=1
|
||||
for search_expr in "${search_expr_array[@]}"
|
||||
do
|
||||
main_exec_args_array=()
|
||||
readarray -t main_exec_args_array <<< "$exec_args"
|
||||
|
||||
|
||||
#for search_expr in "${compile_prog_array[@]}"
|
||||
#do
|
||||
echo "Compiling test case $test_case_name Log file = $log_file"
|
||||
echo "<COMPILATION LOG file=$log_file>" >> $log_file
|
||||
|
||||
#rm -fr $build_dir
|
||||
#mkdir -p $build_dir
|
||||
|
||||
cd $log_dir
|
||||
{
|
||||
uname -a
|
||||
echo "Executing $pre_compile_prog"
|
||||
eval $pre_compile_prog
|
||||
|
||||
if [ "$test_config_file" != "" ]; then
|
||||
echo "Modifying test_config_file parameters..."
|
||||
echo "$test_config_file" |xargs -L 1 $OPENAIR_DIR/cmake_targets/autotests/tools/search_repl.py
|
||||
fi
|
||||
echo "Executing $compile_prog $compile_args"
|
||||
eval "$compile_prog $compile_args"
|
||||
echo "Copying compilation log files to test case log directory: $log_dir"
|
||||
cp -fvr $OPENAIR_DIR/cmake_targets/log/ $log_dir/compile_log
|
||||
}>> $log_file 2>&1
|
||||
echo "</COMPILATION LOG>" >> $log_file 2>&1
|
||||
#done
|
||||
|
||||
#process the test case if it is that of execution
|
||||
if [ "$class" == "execution" ]; then
|
||||
tags_array_index=0
|
||||
for main_exec_args_array_index in "${main_exec_args_array[@]}"
|
||||
do
|
||||
global_result=1
|
||||
result_string=""
|
||||
|
||||
for (( run_index=1; run_index <= $nruns; run_index++ ))
|
||||
do
|
||||
temp_exec_log=$log_dir/test.$test_case_name.${tags_array[$tags_array_index]}.run_$run_index
|
||||
echo "" > $temp_exec_log
|
||||
|
||||
echo "Executing test case $test_case_name.${tags_array[$tags_array_index]}, Run Index = $run_index, Execution Log file = $temp_exec_log"
|
||||
|
||||
echo "-----------------------------------------------------------------------------" >> $temp_exec_log 2>&1
|
||||
echo "<EXECUTION LOG Test Case = $test_case_name.${tags_array[$tags_array_index]}, Run = $run_index >" >> $temp_exec_log 2>&1
|
||||
|
||||
if [ -n "$pre_exec_file" ]; then
|
||||
{ echo " Executing $pre_exec_file $pre_exec_args "
|
||||
eval " echo '$mypassword' |sudo -S -E $pre_exec_file $pre_exec_args " ; }>> $temp_exec_log 2>&1
|
||||
|
||||
fi
|
||||
echo "Executing $main_exec $main_exec_args_array_index "
|
||||
echo "Executing $main_exec $main_exec_args_array_index " >> $temp_exec_log
|
||||
{ uname -a ; eval "$main_exec $main_exec_args_array_index" ;} >> $temp_exec_log 2>&1
|
||||
|
||||
echo "</EXECUTION LOG Test Case = $test_case_name.${tags_array[$tags_array_index]}, Run = $run_index >" >> $temp_exec_log 2>&1
|
||||
cat $temp_exec_log >> $log_file 2>&1
|
||||
|
||||
|
||||
result=1
|
||||
for search_expr in "${search_expr_array[@]}"
|
||||
do
|
||||
|
||||
search_result=`grep -E "$search_expr" $temp_exec_log`
|
||||
search_result=`grep -E "$search_expr" $temp_exec_log`
|
||||
|
||||
#echo "search_expr = $search_expr"
|
||||
#echo "search_result = $search_result"
|
||||
#echo "search_expr = $search_expr"
|
||||
#echo "search_result = $search_result"
|
||||
|
||||
if [ -z "$search_result" ]; then
|
||||
let "result = result & 0"
|
||||
if [ -z "$search_result" ]; then
|
||||
let "result = result & 0"
|
||||
else
|
||||
let "result = result & 1"
|
||||
fi
|
||||
done
|
||||
|
||||
#If we find a negative search result then there is crash of program and test case is failed even if above condition is true
|
||||
search_result=`grep -iE "$search_expr_negative" $temp_exec_log`
|
||||
if [ -n "$search_result" ]; then
|
||||
result=0
|
||||
fi
|
||||
let "global_result = global_result & result"
|
||||
|
||||
#echo "result = $result"
|
||||
|
||||
#this is a result of this run
|
||||
#test_case_result=""
|
||||
if [ "$result" -eq "0" ]; then
|
||||
result_string=$result_string" Run_$run_index =FAIL"
|
||||
echo_error "$test_case_name.${tags_array[$tags_array_index]} RUN = $run_index Result = FAIL"
|
||||
fi
|
||||
|
||||
if [ "$result" -eq "1" ]; then
|
||||
result_string=$result_string" Run_$run_index =PASS"
|
||||
echo_success "$test_case_name.${tags_array[$tags_array_index]} RUN = $run_index Result = PASS"
|
||||
fi
|
||||
|
||||
|
||||
done #End of for loop (nindex)
|
||||
|
||||
echo " Result String = $result_string"
|
||||
|
||||
if [ "$result_string" == "" ]; then
|
||||
echo_error "execution $test_case_name.$compile_prog.${tags_array[$tags_array_index]} Run_Result = \"$result_string\" Result = FAIL"
|
||||
xUnit_fail "execution" "$test_case_name.${tags_array[$tags_array_index]}" "FAIL" "$result_string" "$xmlfile_testcase"
|
||||
else
|
||||
let "result = result & 1"
|
||||
if [ "$global_result" == "0" ]; then
|
||||
echo_error "execution $test_case_name.${tags_array[$tags_array_index]} Run_Result = \"$result_string\" Result = FAIL"
|
||||
xUnit_fail "execution" "$test_case_name.${tags_array[$tags_array_index]}" "FAIL" "$result_string" "$xmlfile_testcase"
|
||||
fi
|
||||
|
||||
if [ "$global_result" == "1" ]; then
|
||||
echo_success "execution $test_case_name.${tags_array[$tags_array_index]} Run_Result = \"$result_string\" Result = PASS "
|
||||
xUnit_success "execution" "$test_case_name.${tags_array[$tags_array_index]}" "PASS" "$result_string" "$xmlfile_testcase"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
#echo "result = $result"
|
||||
|
||||
test_case_result=""
|
||||
if [ "$result" -eq "0" ]; then
|
||||
test_case_result="FAIL"
|
||||
fi
|
||||
|
||||
if [ "$result" -eq "1" ]; then
|
||||
test_case_result="PASS"
|
||||
fi
|
||||
|
||||
#If we find a negative search result then there is crash of program and test case is failed even if above condition is true
|
||||
|
||||
search_result=`grep -iE "$search_expr_negative" $temp_exec_log`
|
||||
if [ -n "$search_result" ]; then
|
||||
test_case_result="FAIL"
|
||||
fi
|
||||
|
||||
if [ "$test_case_result" == "FAIL" ]; then
|
||||
echo_error "execution $test_case_name FAIL $run_index"
|
||||
xUnit_fail "execution" "$test_case_name" "FAIL" "$run_index"
|
||||
fi
|
||||
|
||||
if [ "$test_case_result" == "PASS" ]; then
|
||||
echo_success "execution $test_case_name PASS $run_index"
|
||||
xUnit_success "execution" "$test_case_name" "PASS" "$run_index"
|
||||
fi
|
||||
|
||||
# End of for loop
|
||||
done
|
||||
|
||||
let "tags_array_index++"
|
||||
done
|
||||
fi
|
||||
rm -fr $build_dir
|
||||
}
|
||||
|
||||
dbin=$OPENAIR_DIR/cmake_targets/autotests/bin
|
||||
dlog=$OPENAIR_DIR/cmake_targets/autotests/log
|
||||
|
||||
run_test() {
|
||||
case=case$1; shift
|
||||
cmd=$1; shift
|
||||
expected=$3; shift
|
||||
echo "expected = $expected"
|
||||
exit
|
||||
|
||||
$cmd > $dlog/$case.txt 2>&1
|
||||
if [ $expected = "true" ] ; then
|
||||
if $* $dlog/$case.txt; then
|
||||
echo_success "test $case, command: $cmd ok"
|
||||
else
|
||||
echo_error "test $case, command: $cmd Failed"
|
||||
fi
|
||||
else
|
||||
if $* $dlog/$case.txt; then
|
||||
echo_error "test $case, command: $cmd Failed"
|
||||
else
|
||||
echo_success "test $case, command: $cmd ok"
|
||||
fi
|
||||
fi
|
||||
function print_help() {
|
||||
echo_info '
|
||||
This program runs automated test case system for OpenAirInterface
|
||||
You should have ubuntu 14.xx, updated, and the Linux kernel >= 3.14
|
||||
Options
|
||||
-h | --help
|
||||
This help
|
||||
-g | --run-group
|
||||
Run test cases in a group. For example, ./run_exec_autotests "0101* 010102"
|
||||
-p
|
||||
Use password for logging
|
||||
'
|
||||
}
|
||||
|
||||
#$1 -> name of test case
|
||||
#$2 -> name of compilation program
|
||||
#$3 -> arguments for compilation program
|
||||
#$4 -> name of pre-executable to install kernel modules, etc
|
||||
#$5 -> arguments of pre-executable
|
||||
#$6 -> name of executable
|
||||
#$7 -> arguments for running the program
|
||||
#$8 -> search expression ARRAY which needs to be found
|
||||
#$9 -> search expression which should NOT be found (for ex. segmentation fault)
|
||||
#$10 -> number of runs
|
||||
|
||||
#oaisim tests
|
||||
search_array=("Received RRCConnectionReconfigurationComplete from UE 0")
|
||||
test_compile_and_run 010200 "oaisim_nos1" "" "$OPENAIR_DIR/cmake_targets/tools/init_nas_nos1" "" "oaisim_nos1" " -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -b1 -u1 -n100" "search_array[@]" "segmentation fault|assertion|exiting|fatal" 3
|
||||
|
||||
search_array=("Received RRCConnectionReconfigurationComplete from UE 0")
|
||||
test_compile_and_run 010201 "oaisim_nos1" "" "$OPENAIR_DIR/cmake_targets/tools/init_nas_nos1" "" "oaisim_nos1" " -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -b1 -u1 -a -n100" "search_array[@]" "segmentation fault|assertion|exiting|fatal" 3
|
||||
|
||||
search_array=("Received RRCConnectionReconfigurationComplete from UE 0" "Received RRCConnectionReconfigurationComplete from UE 1" "Received RRCConnectionReconfigurationComplete from UE 2")
|
||||
test_compile_and_run 010202 "oaisim_nos1" "" "$OPENAIR_DIR/cmake_targets/tools/init_nas_nos1" "" "oaisim_nos1" " -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -b1 -u3 -n100" "search_array[@]" "segmentation fault|assertion|exiting|fatal" 3
|
||||
|
||||
search_array=("Received RRCConnectionReconfigurationComplete from UE 0" "Received RRCConnectionReconfigurationComplete from UE 1" "Received RRCConnectionReconfigurationComplete from UE 2")
|
||||
test_compile_and_run 010203 "oaisim_nos1" "" "$OPENAIR_DIR/cmake_targets/tools/init_nas_nos1" "" "oaisim_nos1" " -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -b1 -u3 -a -n100" "search_array[@]" "segmentation fault|assertion|exiting|fatal" 3
|
||||
|
||||
#PHY unitary simulations for secuirity tests
|
||||
search_array=("finished with 0 errors")
|
||||
test_compile_and_run 010300 "test_aes128_cmac_encrypt" "" "" "" "test_aes128_cmac_encrypt" " --verbose" "search_array[@]" "segmentation fault|assertion|exiting|fatal" 3
|
||||
|
||||
search_array=("finished with 0 errors")
|
||||
test_compile_and_run 010301 "test_aes128_ctr_decrypt" "" "" "" "test_aes128_ctr_decrypt" " --verbose" "search_array[@]" "segmentation fault|assertion|exiting|fatal" 3
|
||||
|
||||
search_array=("finished with 0 errors")
|
||||
test_compile_and_run 010302 "test_aes128_ctr_encrypt" "" "" "" "test_aes128_ctr_encrypt" " --verbose" "search_array[@]" "segmentation fault|assertion|exiting|fatal" 3
|
||||
|
||||
search_array=("finished with 0 errors")
|
||||
test_compile_and_run 010303 "test_secu_kenb" "" "" "" "test_secu_kenb" " --verbose" "search_array[@]" "segmentation fault|assertion|exiting|fatal" 3
|
||||
|
||||
search_array=("finished with 0 errors")
|
||||
test_compile_and_run 010304 "test_secu_knas" "" "" "" "test_secu_knas" " --verbose" "search_array[@]" "segmentation fault|assertion|exiting|fatal" 3
|
||||
|
||||
search_array=("finished with 0 errors")
|
||||
test_compile_and_run 010305 "test_secu_knas_encrypt_eea1" "" "" "" "test_secu_knas_encrypt_eea1" " --verbose" "search_array[@]" "segmentation fault|assertion|exiting|fatal" 3
|
||||
|
||||
search_array=("finished with 0 errors")
|
||||
test_compile_and_run 010306 "test_secu_knas_encrypt_eea2" "" "" "" "test_secu_knas_encrypt_eea2" " --verbose" "search_array[@]" "segmentation fault|assertion|exiting|fatal" 3
|
||||
|
||||
search_array=("finished with 0 errors")
|
||||
test_compile_and_run 010307 "test_secu_knas_encrypt_eia1" "" "" "" "test_secu_knas_encrypt_eia1" " --verbose" "search_array[@]" "segmentation fault|assertion|exiting|fatal" 3
|
||||
|
||||
search_array=("finished with 0 errors")
|
||||
test_compile_and_run 010308 "test_secu_knas_encrypt_eia2" "" "" "" "test_secu_knas_encrypt_eia2" " --verbose" "search_array[@]" "segmentation fault|assertion|exiting|fataln" 3
|
||||
|
||||
search_array=("finished with 0 errors")
|
||||
test_compile_and_run 010309 "test_kdf" "" "" "" "test_kdf" " --verbose" "search_array[@]" "segmentation fault|assertion|exiting|fatal" 3
|
||||
|
||||
#TODO: Add test cases for 10,20 MHz
|
||||
#TODO: Test and compile seperately for Rel8/Rel10
|
||||
function main () {
|
||||
RUN_GROUP=0
|
||||
SET_PASSWORD=0
|
||||
passwd=""
|
||||
test_case_group=""
|
||||
test_case_group_array=()
|
||||
test_case_array=()
|
||||
echo_info "Note that the user should be sudoer for executing certain commands, for example loading kernel modules"
|
||||
|
||||
|
||||
#test_compile_and_run 0200 "oaisim_nos1" "" "$OPENAIR_DIR/cmake_targets/tools/init_nas_nos1" "" "oaisim_nos1" " -O /home/calisson/rohit/oai_snav/taets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -b1 -u1 -a " "RRC_CONN" 3
|
||||
until [ -z "$1" ]
|
||||
do
|
||||
case "$1" in
|
||||
-g | --run-group)
|
||||
RUN_GROUP=1
|
||||
test_case_group=$2
|
||||
echo_info "Will execute test cases only in group $test_case_group"
|
||||
shift 2;;
|
||||
-p)
|
||||
SET_PASSWORD=1
|
||||
passwd=$2
|
||||
shift 2;;
|
||||
-h | --help)
|
||||
print_help
|
||||
exit 1;;
|
||||
*)
|
||||
print_help
|
||||
echo_fatal "Unknown option $1"
|
||||
break;;
|
||||
esac
|
||||
done
|
||||
|
||||
#run_test 0200 "$dbin/oaisim.r8 -a -A AWGN -n 100" false grep -q '(Segmentation.fault)|(Exiting)|(FATAL)'
|
||||
if [ "$SET_PASSWORD" == "1" ]; then
|
||||
mypassword=$passwd
|
||||
else
|
||||
read -s -p "Enter Password: " mypassword
|
||||
fi
|
||||
|
||||
#run_test 0201 "$dbin/oaisim.r8 -a -A AWGN -n 100" false fgrep -q '[E]'
|
||||
tmpfile=`mktemp`
|
||||
echo \'$passwd\' | $SUDO echo $HOME >& $tmpfile
|
||||
tstsudo=`cat $tmpfile`
|
||||
if [ "$tstsudo" != "$HOME" ]; then
|
||||
echo "$USER might not have sudo privileges. Exiting"
|
||||
exit
|
||||
else
|
||||
echo "$USER has sudo privileges"
|
||||
fi
|
||||
echo "tstsudo = $tstsudo"
|
||||
rm -fr $tmpfile
|
||||
|
||||
# write the test results into a file
|
||||
xml_conf="$OPENAIR_DIR/cmake_targets/autotests/test_case_list.xml"
|
||||
|
||||
test_case_list=`xmlstarlet sel -T -t -m /testCaseList/testCase -s A:N:- "@id" -v "@id" -n $xml_conf`
|
||||
|
||||
echo "test_case_list = $test_case_list"
|
||||
|
||||
readarray -t test_case_array <<<"$test_case_list"
|
||||
|
||||
read -a test_case_group_array <<< "$test_case_group"
|
||||
|
||||
for search_expr in "${test_case_array[@]}"
|
||||
do
|
||||
flag_run_test_case=0
|
||||
# search if this test case needs to be executed
|
||||
if [ "$RUN_GROUP" -eq "1" ]; then
|
||||
for search_group in "${test_case_group_array[@]}"
|
||||
do
|
||||
if [[ $search_expr == $search_group ]];then
|
||||
flag_run_test_case=1
|
||||
echo_info "Test case $search_expr match found in group"
|
||||
break
|
||||
fi
|
||||
done
|
||||
else
|
||||
flag_run_test_case=1
|
||||
fi
|
||||
|
||||
|
||||
#We skip this test case if it is not in the group list
|
||||
if [ "$flag_run_test_case" -ne "1" ]; then
|
||||
continue
|
||||
fi
|
||||
|
||||
name=$search_expr
|
||||
class=`xmlstarlet sel -t -v "/testCaseList/testCase[@id='$search_expr']/class" $xml_conf`
|
||||
desc=`xmlstarlet sel -t -v "/testCaseList/testCase[@id='$search_expr']/desc" $xml_conf`
|
||||
pre_compile_prog=`xmlstarlet sel -t -v "/testCaseList/testCase[@id='$search_expr']/pre_compile_prog" $xml_conf`
|
||||
compile_prog=`xmlstarlet sel -t -v "/testCaseList/testCase[@id='$search_expr']/compile_prog" $xml_conf`
|
||||
compile_prog_args=`xmlstarlet sel -t -v "/testCaseList/testCase[@id='$search_expr']/compile_prog_args" $xml_conf`
|
||||
pre_exec=`xmlstarlet sel -t -v "/testCaseList/testCase[@id='$search_expr']/pre_exec" $xml_conf`
|
||||
pre_exec_args=`xmlstarlet sel -t -v "/testCaseList/testCase[@id='$search_expr']/pre_exec_args" $xml_conf`
|
||||
main_exec=`xmlstarlet sel -t -v "/testCaseList/testCase[@id='$search_expr']/main_exec" $xml_conf`
|
||||
main_exec_args=`xmlstarlet sel -t -v "/testCaseList/testCase[@id='$search_expr']/main_exec_args" $xml_conf`
|
||||
search_expr_true=`xmlstarlet sel -t -v "/testCaseList/testCase[@id='$search_expr']/search_expr_true" $xml_conf`
|
||||
search_expr_false=`xmlstarlet sel -t -v "/testCaseList/testCase[@id='$search_expr']/search_expr_false" $xml_conf`
|
||||
nruns=`xmlstarlet sel -t -v "/testCaseList/testCase[@id='$search_expr']/nruns" $xml_conf`
|
||||
compile_prog_out=`xmlstarlet sel -t -v "/testCaseList/testCase[@id='$search_expr']/compile_prog_out" $xml_conf`
|
||||
tags=`xmlstarlet sel -t -v "/testCaseList/testCase[@id='$search_expr']/tags" $xml_conf`
|
||||
test_config_file=`xmlstarlet sel -t -v "/testCaseList/testCase[@id='$search_expr']/test_config_file" $xml_conf`
|
||||
|
||||
echo "class = $class"
|
||||
echo "name = $name"
|
||||
echo "Description = $desc"
|
||||
echo "pre_compile_prog = $pre_compile_prog"
|
||||
echo "compile_prog = $compile_prog"
|
||||
echo "compile_prog_args = $compile_prog_args"
|
||||
echo "compile_prog_out = $compile_prog_out"
|
||||
echo "pre_exec = $pre_exec"
|
||||
echo "pre_exec_args = $pre_exec_args"
|
||||
echo "main_exec = $main_exec"
|
||||
echo "main_exec_args = $main_exec_args"
|
||||
echo "search_expr_true = $search_expr_true"
|
||||
echo "search_expr_false = $search_expr_false"
|
||||
echo "nruns = $nruns"
|
||||
|
||||
#eval $pre_exec
|
||||
compile_prog_out=`eval echo \"$compile_prog_out\"`
|
||||
|
||||
search_array_true=()
|
||||
|
||||
IFS=\" #set the shell's field separator
|
||||
set -f #don't try to glob
|
||||
#set -- $search_expr_true #split on $IFS
|
||||
for i in $search_expr_true
|
||||
do echo "i = $i"
|
||||
if [ -n "$i" ] && [ "$i" != " " ]; then
|
||||
search_array_true+=("$i")
|
||||
#echo "inside i = \"$i\" "
|
||||
fi
|
||||
done
|
||||
unset IFS
|
||||
|
||||
#echo "arg1 = ${search_array_true[0]}"
|
||||
#echo " arg2 = ${search_array_true[1]}"
|
||||
if [ "$class" == "compilation" ]; then
|
||||
test_compile "$name" "$compile_prog" "$compile_prog_args" "$pre_exec" "$pre_exec_args" "$main_exec" "$main_exec_args" "search_array_true[@]" "$search_expr_false" "$nruns" "$pre_compile_prog" "$class" "$compile_prog_out" "$tags"
|
||||
elif [ "$class" == "execution" ]; then
|
||||
$SUDO killall -q oaisim_nos1
|
||||
test_compile_and_run "$name" "$compile_prog" "$compile_prog_args" "$pre_exec" "$pre_exec_args" "$main_exec" "$main_exec_args" "search_array_true[@]" "$search_expr_false" "$nruns" "$pre_compile_prog" "$class" "$compile_prog_out" "$tags" "$mypassword" "$test_config_file"
|
||||
else
|
||||
echo "Unexpected class of test case...Skipping the test case $name ...."
|
||||
fi
|
||||
|
||||
done
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
uname -a
|
||||
|
||||
main "$@"
|
||||
|
||||
xUnit_write "$results_file"
|
||||
|
||||
echo "Test Results are written to $results_file"
|
||||
|
||||
exit
|
||||
|
||||
|
||||
|
||||
|
||||
+1470
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
+199
@@ -0,0 +1,199 @@
|
||||
#!/usr/bin/python
|
||||
|
||||
import time
|
||||
import serial
|
||||
import os
|
||||
from pyroute2 import IPRoute
|
||||
import sys
|
||||
import re
|
||||
import threading
|
||||
import signal
|
||||
import traceback
|
||||
import os
|
||||
import commands
|
||||
|
||||
# configure the serial connections (the parameters differs on the device you are connecting to)
|
||||
#First we find an open port to work with
|
||||
serial_port=''
|
||||
ser=serial.Serial()
|
||||
openair_dir = os.environ.get('OPENAIR_DIR')
|
||||
if openair_dir == None:
|
||||
print "Error getting OPENAIR_DIR environment variable"
|
||||
sys.exit(1)
|
||||
|
||||
sys.path.append(os.path.expandvars('$OPENAIR_DIR/cmake_targets/autotests/tools/'))
|
||||
|
||||
from lib_autotest import *
|
||||
|
||||
def find_open_port():
|
||||
global serial_port, ser
|
||||
max_ports=100
|
||||
if os.path.exists(serial_port) == True:
|
||||
return serial_port
|
||||
for port in range(2,100):
|
||||
serial_port = '/dev/ttyUSB'+str(port)
|
||||
if os.path.exists(serial_port) == True:
|
||||
print 'New Serial Port : ' + serial_port
|
||||
break
|
||||
|
||||
ser = serial.Serial(port=serial_port)
|
||||
return
|
||||
|
||||
|
||||
|
||||
#serial_port = '/dev/ttyUSB2'
|
||||
bandrich_ppd_config = os.environ.get('OPENAIR_DIR') + '/cmake_targets/autotests/tools/wdial.bandrich.conf'
|
||||
|
||||
exit_flag=0
|
||||
|
||||
def signal_handler(signal, frame):
|
||||
print('You pressed Ctrl+C!')
|
||||
print('Resetting the UE to detached state')
|
||||
timeout=10
|
||||
exit_flag=1
|
||||
send_command('AT+CGATT=0' , 'OK' , timeout)
|
||||
sys.exit(0)
|
||||
|
||||
signal.signal(signal.SIGINT, signal_handler)
|
||||
|
||||
|
||||
|
||||
#ser.open()
|
||||
#ser.isOpen()
|
||||
|
||||
class pppThread (threading.Thread):
|
||||
def __init__(self, threadID, name, counter):
|
||||
threading.Thread.__init__(self)
|
||||
self.threadID = threadID
|
||||
self.name = name
|
||||
self.counter = counter
|
||||
def run(self):
|
||||
print "Starting " + self.name
|
||||
#Here we keep running pppd thread in indefinite loop as this script terminates sometimes
|
||||
#while 1:
|
||||
while 1:
|
||||
time.sleep(5) #Hard coded, do not reduce this number!
|
||||
print "Starting wvdial now..."
|
||||
print 'exit_flag = ' + str(exit_flag)
|
||||
send_command('AT+CGATT=1','OK', 300)
|
||||
os.system('wvdial -C ' + bandrich_ppd_config + '' )
|
||||
if exit_flag == 1:
|
||||
print "Exit flag set to true. Exiting pppThread now"
|
||||
print "Terminating wvdial now..."
|
||||
|
||||
def send_command (cmd, response, timeout):
|
||||
count=0
|
||||
sleep_duration = 1
|
||||
print 'In function: send_command: cmd = <' + cmd + '> response: <' + response + '> \n'
|
||||
global serial_port, ser
|
||||
while count <= timeout:
|
||||
try:
|
||||
#Sometimes the port does not exist coz of reset in modem.
|
||||
#In that case, we need to search for this port again
|
||||
if os.path.exists(serial_port) == False:
|
||||
find_open_port()
|
||||
ser.write (cmd + '\r\n')
|
||||
out = ''
|
||||
time.sleep(sleep_duration)
|
||||
count = count + sleep_duration
|
||||
while ser.inWaiting() > 0:
|
||||
out += ser.read(1)
|
||||
print 'out = <' + out + '> response = <' + response + '> \n'
|
||||
if re.search(response, out):
|
||||
break
|
||||
except Exception, e:
|
||||
error = ' cmd : ' + cmd + ' response : ' + response
|
||||
error = error + ' In function: ' + sys._getframe().f_code.co_name + ': *** Caught exception: ' + str(e.__class__) + " : " + str( e)
|
||||
error = error + traceback.format_exc()
|
||||
print error
|
||||
|
||||
|
||||
def start_ue () :
|
||||
#print 'Enter your commands below.\r\nInsert "exit" to leave the application.'
|
||||
timeout=60 #timeout in seconds
|
||||
send_command('AT', 'OK' , timeout)
|
||||
send_command('AT+CFUN=1' , 'OK' , timeout)
|
||||
#send_command('AT+CGATT=0' , 'OK' , timeout)
|
||||
send_command('AT+CGATT=1','OK', 300)
|
||||
#os.system('wvdial -C ' + bandrich_ppd_config + ' &' )
|
||||
|
||||
thread_ppp = pppThread(1, "ppp_thread", 1)
|
||||
thread_ppp.start()
|
||||
|
||||
iface='ppp0'
|
||||
|
||||
while 1:
|
||||
time.sleep ( 2)
|
||||
#Now we check if ppp0 interface is up and running
|
||||
try:
|
||||
if exit_flag == 1:
|
||||
break
|
||||
ip = IPRoute()
|
||||
idx = ip.link_lookup(ifname=iface)[0]
|
||||
os.system ('route add ' + gw + ' ppp0')
|
||||
os.system ('ping ' + gw)
|
||||
break
|
||||
except Exception, e:
|
||||
error = ' Interface ' + iface + 'does not exist...'
|
||||
error = error + ' In function: ' + sys._getframe().f_code.co_name + ': *** Caught exception: ' + str(e.__class__) + " : " + str( e)
|
||||
error = error + traceback.format_exc()
|
||||
print error
|
||||
|
||||
thread_ppp.join()
|
||||
|
||||
def stop_ue():
|
||||
timeout=60
|
||||
os.system('killall wvdial')
|
||||
send_command('AT', 'OK' , timeout)
|
||||
send_command('AT+CGATT=0' , 'OK|ERROR' , timeout)
|
||||
send_command('AT+CFUN=4' , 'OK' , timeout)
|
||||
|
||||
|
||||
#reset the USB BUS of Bandrich UE
|
||||
def reset_ue():
|
||||
stringIdBandrich='BandRich, Inc. 4G LTE adapter'
|
||||
status, out = commands.getstatusoutput('lsusb | grep -i \'' + stringIdBandrich + '\'')
|
||||
if (out == '') :
|
||||
print "Bandrich 4G LTE Adapter not found. Exiting now..."
|
||||
sys.exit()
|
||||
p=re.compile('Bus\s*(\w+)\s*Device\s*(\w+):\s*ID\s*(\w+):(\w+)')
|
||||
res=p.findall(out)
|
||||
BusId=res[0][0]
|
||||
DeviceId=res[0][1]
|
||||
VendorId=res[0][2]
|
||||
ProductId=res[0][3]
|
||||
usb_dir= find_usb_path(VendorId, ProductId)
|
||||
print "Bandrich 4G LTE Adapter found in..." + usb_dir
|
||||
cmd = "sudo sh -c \"echo 0 > " + usb_dir + "/authorized\""
|
||||
os.system(cmd + " ; sleep 15" )
|
||||
cmd = "sudo sh -c \"echo 1 > " + usb_dir + "/authorized\""
|
||||
os.system(cmd + " ; sleep 30" )
|
||||
|
||||
i=1
|
||||
gw='192.172.0.1'
|
||||
while i < len(sys.argv):
|
||||
arg=sys.argv[i]
|
||||
if arg == '--start-ue' :
|
||||
find_open_port()
|
||||
print 'Using Serial port : ' + serial_port
|
||||
start_ue()
|
||||
elif arg == '--stop-ue' :
|
||||
find_open_port()
|
||||
print 'Using Serial port : ' + serial_port
|
||||
stop_ue()
|
||||
elif arg == '--reset-ue' :
|
||||
reset_ue()
|
||||
elif arg == '-gw' :
|
||||
gw = sys.argv[i+1]
|
||||
i=i+1
|
||||
elif arg == '-h' :
|
||||
print "--reset-ue: Reset the UE on USB Bus. Similar to unplugging and plugging the UE"
|
||||
print "--stop-ue: Stop the UE. Send DETACH command"
|
||||
print "--start-ue: Start the UE. Send ATTACH command"
|
||||
print "-gw: Specify the default gw as sometimes the gateway/route arguments are not set properly via wvdial"
|
||||
else :
|
||||
print " Script called with wrong arguments, arg = " + arg
|
||||
sys.exit()
|
||||
i = i +1
|
||||
|
||||
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
#!/bin/bash
|
||||
|
||||
#arg1 idVendor
|
||||
#arg2 idProduct
|
||||
argIdVendor=$1
|
||||
argIdProduct=$2
|
||||
|
||||
echo $1
|
||||
echo $2
|
||||
|
||||
for X in /sys/bus/usb/devices/*; do
|
||||
#echo "$X"
|
||||
idVendor=`cat "$X/idVendor" 2>/dev/null`
|
||||
idProduct=`cat "$X/idProduct" 2>/dev/null`
|
||||
if [ "$argIdVendor" == "$idVendor" ] && [ "$argIdProduct" == "$idProduct" ]
|
||||
then
|
||||
echo "$X"
|
||||
fi
|
||||
done
|
||||
|
||||
Executable
+22
@@ -0,0 +1,22 @@
|
||||
#!/bin/bash
|
||||
|
||||
#arg1 timeout to wait before running the script
|
||||
#arg2 interface
|
||||
#arg3 iperf arguments
|
||||
|
||||
args=($*)
|
||||
timeout=${args[0]}
|
||||
iface=${args[1]}
|
||||
iperf_args=(${args[@]:2})
|
||||
|
||||
#array=${1:-1}
|
||||
echo "args = ${args[@]}"
|
||||
echo "timeout = $timeout"
|
||||
echo "iface = $iface"
|
||||
echo "iperf_args = ${iperf_args[@]}"
|
||||
|
||||
sleep $timeout
|
||||
|
||||
while true; do var=`ifconfig $iface` ;sleep 1; if [ "$var" != "" ]; then break; fi ; done ; sleep 5
|
||||
|
||||
iperf ${iperf_args[@]}
|
||||
@@ -0,0 +1,33 @@
|
||||
#!/usr/bin/python
|
||||
|
||||
import os
|
||||
from pyroute2 import IPRoute
|
||||
import sys
|
||||
import re
|
||||
import threading
|
||||
import signal
|
||||
import traceback
|
||||
import commands
|
||||
|
||||
def read_file(filename):
|
||||
try:
|
||||
file = open(filename, 'r')
|
||||
return file.read()
|
||||
except Exception, e:
|
||||
# WE just ignore the exception as some files are probably not present
|
||||
#error = ' Filename ' + filename
|
||||
#error = error + ' In function: ' + sys._getframe().f_code.co_name + ': *** Caught exception: ' + str(e.__class__) + " : " + str( e)
|
||||
#error = error + traceback.format_exc()
|
||||
#print error
|
||||
return ''
|
||||
|
||||
def find_usb_path(idVendor, idProduct):
|
||||
for root, dirs, files in os.walk("/sys/bus/usb/devices", topdown=False):
|
||||
for name in dirs:
|
||||
tmpdir= os.path.join(root, name)
|
||||
tmpidVendor = read_file(tmpdir+'/idVendor').replace("\n","")
|
||||
tmpidProduct = read_file(tmpdir+'/idProduct').replace("\n","")
|
||||
if tmpidVendor == idVendor and tmpidProduct == idProduct:
|
||||
return tmpdir
|
||||
return ''
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
#$1 programs to be killed and checked
|
||||
var=`ps -A |grep -E -i $1`
|
||||
echo $var
|
||||
if [ -n "$var" ]; then echo 'Match found'; else echo 'Match not found' ;fi
|
||||
|
||||
Executable
+39
@@ -0,0 +1,39 @@
|
||||
#!/usr/bin/python
|
||||
import sys
|
||||
import re
|
||||
import os
|
||||
|
||||
#Arg 1 name of file
|
||||
#Arg 2 keyword
|
||||
#arg 3 replacement text
|
||||
#Note that these should be seperated by spaces
|
||||
if len(sys.argv) != 4:
|
||||
print "search_repl.py: Wrong number of arguments. This program needs 3 arguments. The number of arguments supplied : " + str(sys.argv)
|
||||
sys.exit()
|
||||
filename = os.path.expandvars(sys.argv[1])
|
||||
keyword = sys.argv[2]
|
||||
replacement_text = sys.argv[3]
|
||||
|
||||
|
||||
file = open(filename, 'r')
|
||||
string = file.read()
|
||||
file.close()
|
||||
|
||||
|
||||
if keyword == 'mme_ip_address':
|
||||
replacement_text = keyword + ' = ( { ' + replacement_text + ' } ) ; '
|
||||
string = re.sub(r"mme_ip_address\s*=\s*\(([^\$]+?)\)\s*;", replacement_text, string, re.M)
|
||||
elif keyword == 'IPV4_LIST':
|
||||
replacement_text = keyword + ' = ( ' + replacement_text + ' ) ; '
|
||||
string = re.sub(r"IPV4_LIST\s*=\s*\(([^\$]+?)\)\s*;", replacement_text, string, re.M)
|
||||
else :
|
||||
replacement_text = keyword + ' = ' + replacement_text + ' ; '
|
||||
string = re.sub(r"%s\s*=\s*([^\$]+?)\s*;" % keyword , replacement_text, string, re.M)
|
||||
#else :
|
||||
# replacement_text = keyword + ' =\"' + replacement_text + '\" ; '
|
||||
# string = re.sub(r"%s\s*=\s*\"([^\$]+?)\"\s*;" % keyword , replacement_text, string, re.M)
|
||||
|
||||
file = open(filename, 'w')
|
||||
file.write(string)
|
||||
file.close()
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
[Dialer Defaults]
|
||||
Modem = /dev/ttyUSB0
|
||||
ISDN = off
|
||||
Modem Type = Analog Modem
|
||||
Baud = 9600
|
||||
Init = ATZ
|
||||
Init2 = AT+CPIN?
|
||||
Init3 = AT+CGREG?
|
||||
Init4 = AT+COPS?
|
||||
Init5 = AT+CSQ
|
||||
Init6 =
|
||||
Init7 = AT+CGATT=1
|
||||
Init8 =
|
||||
Init9 =
|
||||
Phone = *99***1#
|
||||
Phone1 =
|
||||
Phone2 =
|
||||
Phone3 =
|
||||
Phone4 =
|
||||
Dial Prefix =
|
||||
Dial Attempts = 1
|
||||
Dial Command = ATM1L3DT
|
||||
Ask Password = off
|
||||
Password = ''
|
||||
Username = ImaginLab
|
||||
Auto Reconnect = off
|
||||
Abort on Busy = off
|
||||
Carrier Check = on
|
||||
Check Def Route = on
|
||||
Abort on No Dialtone = on
|
||||
Stupid Mode = on
|
||||
Idle Seconds = 0
|
||||
Auto DNS = on
|
||||
;Minimize = off
|
||||
;Dock = off
|
||||
;Do NOT edit this file by hand!
|
||||
+248
-78
@@ -45,12 +45,19 @@ MSC_GEN="False"
|
||||
XFORMS="False"
|
||||
PRINT_STATS="False"
|
||||
VCD_TIMING="False"
|
||||
LOWLATENCY_FLAG_USER="False"
|
||||
FORCE_LOWLATENCY_FLAG_USER=""
|
||||
REL="Rel10"
|
||||
HW="EXMIMO"
|
||||
TP="None"
|
||||
NOS1=0
|
||||
EPC=0
|
||||
VERBOSE_COMPILE=0
|
||||
CFLAGS_PROCESSOR_USER=""
|
||||
RUN_GROUP=0
|
||||
TEST_CASE_GROUP=""
|
||||
BUILD_DOXYGEN=0
|
||||
trap handle_ctrl_c INT
|
||||
|
||||
function print_help() {
|
||||
echo_info '
|
||||
@@ -78,24 +85,27 @@ Options
|
||||
Makes the LTE softmodem
|
||||
--UE
|
||||
Makes the UE specific parts (ue_ip, usim, nvram)
|
||||
--EPC
|
||||
Makes the EPC (MME-SPGW, HSS)
|
||||
--RRH
|
||||
Makes the RRH
|
||||
-r | --3gpp-release
|
||||
default is Rel10,
|
||||
Rel8 limits the implementation to 3GPP Release 8 version
|
||||
-w | --hardware
|
||||
EXMIMO (Default), USRP, BLADERF, ETHERNET, None
|
||||
EXMIMO (Default), USRP, BLADERF, None
|
||||
Adds this RF board support (in external packages installation and in compilation)
|
||||
-t | --transport protocol
|
||||
ETHERNET , None
|
||||
Adds this trasport protocol support in compilation
|
||||
--oaisim
|
||||
Makes the oaisim simulator. Hardware will be defaulted to "NONE".
|
||||
Makes the oaisim simulator. Hardware will be defaulted to "None".
|
||||
--phy_simulators
|
||||
Makes the unitary tests Layer 1 simulators
|
||||
--core_simulators
|
||||
Makes the core security features unitary simulators
|
||||
-s | --check
|
||||
runs a set of auto-tests based on simulators and several compilation tests
|
||||
--run-group
|
||||
runs only specified test cases specified here. This flag is only valid with -s
|
||||
-V | --vcd
|
||||
Adds a debgging facility to the binary files: GUI with major internal synchronization events
|
||||
-x | --xforms
|
||||
@@ -109,11 +119,16 @@ Options
|
||||
Shows detailed compilation instructions in makefile
|
||||
--cflags_processor
|
||||
Manually Add CFLAGS of processor if they are not detected correctly by script. Only add these flags if you know your processor supports them. Example flags: -msse3 -msse4.1 -msse4.2 -mavx2
|
||||
|
||||
--build-doxygen
|
||||
Builds doxygen based documentation.
|
||||
--disable-deadline
|
||||
Disables deadline scheduler of Linux kernel (>=3.14.x).
|
||||
--enable-deadline
|
||||
Disables deadline scheduler of Linux kernel (>=3.14.x).
|
||||
Usage (first build):
|
||||
oaisim (eNB + UE): ./build_oai -I -g --oaisim -x --install-system-files
|
||||
Eurecom EXMIMO + COTS UE : ./build_oai -I -g --eNB --EPC -x --install-system-files
|
||||
NI/ETTUS B201 + COTS UE : ./build_oai -I -g --eNB --EPC -x --install-system-files -w USRP
|
||||
Eurecom EXMIMO + COTS UE : ./build_oai -I -g --eNB -x --install-system-files
|
||||
NI/ETTUS B201 + COTS UE : ./build_oai -I -g --eNB -x --install-system-files -w USRP
|
||||
Usage (Regular):
|
||||
oaisim : ./build_oai --oaisim -x
|
||||
Eurecom EXMIMO + OAI ENB : ./build_oai --eNB -x
|
||||
@@ -155,30 +170,38 @@ function main() {
|
||||
UE=1
|
||||
echo_info "Will compile UE"
|
||||
shift;;
|
||||
--EPC)
|
||||
EPC=1
|
||||
echo_info "Will compile EPC"
|
||||
shift;;
|
||||
--RRH)
|
||||
RRH=1
|
||||
echo_info "Will compile RRH"
|
||||
shift;;
|
||||
-r | --3gpp-release)
|
||||
REL=$2
|
||||
echo_info "setting release to: $REL"
|
||||
echo_info "Setting release to: $REL"
|
||||
shift 2;;
|
||||
-w | --hardware)
|
||||
HW="$2" #"${i#*=}"
|
||||
# Use OAI_USRP as the key word USRP is used inside UHD driver
|
||||
if [ "$HW" == "USRP" ] ; then
|
||||
HW="OAI_USRP"
|
||||
fi
|
||||
if [ "$HW" == "BLADERF" ] ; then
|
||||
HW="OAI_BLADERF"
|
||||
fi
|
||||
echo_info "setting hardware to: $HW"
|
||||
# Use OAI_USRP as the key word USRP is used inside UHD driver
|
||||
if [ "$HW" != "BLADERF" -a "$HW" != "USRP" -a "$HW" != "None" -a "$HW" != "EXMIMO" ] ; then
|
||||
echo_fatal "Unknown HW type $HW will exit..."
|
||||
else
|
||||
if [ "$HW" == "USRP" ] ; then
|
||||
HW="OAI_USRP"
|
||||
fi
|
||||
if [ "$HW" == "BLADERF" ] ; then
|
||||
HW="OAI_BLADERF"
|
||||
fi
|
||||
echo_info "Setting hardware to: $HW"
|
||||
fi
|
||||
shift 2;;
|
||||
--oaisim)
|
||||
-t | --transport_protocol)
|
||||
TP="$2" #"${i#*=}"
|
||||
if [ "$TP" != "ETHERNET" -a "$TP" != "None" ] ; then
|
||||
echo_fatal "Unknown TP type $TP will exit..."
|
||||
else
|
||||
echo_info "Setting transport protocol to: $TP"
|
||||
fi
|
||||
shift 2;;
|
||||
--oaisim)
|
||||
oaisim=1
|
||||
echo_info "Will compile oaisim and drivers nasmesh, ..."
|
||||
shift;;
|
||||
@@ -194,8 +217,13 @@ function main() {
|
||||
OAI_TEST=1
|
||||
echo_info "Will run auto-tests"
|
||||
shift;;
|
||||
--run-group)
|
||||
RUN_GROUP=1
|
||||
TEST_CASE_GROUP=$2
|
||||
echo_info "executing test cases only in group: $TEST_CASE_GROUP"
|
||||
shift 2;;
|
||||
-V | --vcd)
|
||||
echo_info "setting gtk-wave output"
|
||||
echo_info "Setting gtk-wave output"
|
||||
VCD_TIMING=1
|
||||
EXE_ARGUMENTS="$EXE_ARGUMENTS -V"
|
||||
shift;;
|
||||
@@ -218,8 +246,20 @@ function main() {
|
||||
shift;;
|
||||
--cflags_processor)
|
||||
CFLAGS_PROCESSOR_USER=$2
|
||||
echo_info "setting CPU FLAGS from USER to: $CFLAGS_PROCESSOR_USER"
|
||||
echo_info "Setting CPU FLAGS from USER to: $CFLAGS_PROCESSOR_USER"
|
||||
shift 2;;
|
||||
--build-doxygen)
|
||||
BUILD_DOXYGEN=1
|
||||
echo_info "Will build doxygen support"
|
||||
shift;;
|
||||
--disable-deadline)
|
||||
FORCE_LOWLATENCY_FLAG_USER="False"
|
||||
echo_info "Disabling the usage of deadline scheduler"
|
||||
shift 1;;
|
||||
--enable-deadline)
|
||||
FORCE_LOWLATENCY_FLAG_USER="True"
|
||||
echo_info "Enabling the usage of deadline scheduler"
|
||||
shift 1;;
|
||||
-h | --help)
|
||||
print_help
|
||||
exit 1;;
|
||||
@@ -229,6 +269,61 @@ function main() {
|
||||
break;;
|
||||
esac
|
||||
done
|
||||
|
||||
#########################################################
|
||||
# check validity of HW and TP parameters for RRH and eNB
|
||||
#########################################################
|
||||
# to be discussed
|
||||
|
||||
if [ "$eNB" = "1" ] ; then
|
||||
if [ "$HW" = "None" -a "$TP" = "None" ] ; then
|
||||
echo_fatal "Define a local radio head (e.g. -w EXMIMO) or a transport protocol (e.g. -t ETHERNET) to communicate with a remote radio head!"
|
||||
fi
|
||||
if [ "$HW" != "None" -a "$TP" != "None" ] ; then
|
||||
echo_fatal "Currently eNB can not support simultaniously local and remote radio heads!!"
|
||||
fi
|
||||
if [ "$HW" = "None" ] ; then
|
||||
echo_info "No radio head has been selected (HW set to $HW)"
|
||||
fi
|
||||
if [ "$TP" = "None" ] ; then
|
||||
echo_info "No transport protocol has been selected (TP set to $TP)"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$RRH" = "1" ] ; then
|
||||
if [ "$TP" = "None" ] ; then
|
||||
echo_fatal "A transport protocol (e.g. -t ETHERNET) must be defined!"
|
||||
fi
|
||||
if [ "$HW" = "None" ] ; then
|
||||
echo_info "No radio head has been selected (HW set to $HW)"
|
||||
fi
|
||||
fi
|
||||
|
||||
#Now we set flags to enable deadline scheduler settings
|
||||
#By default: USRP: disable,
|
||||
#By default: BLADERF: enable,
|
||||
#By default: EXMIMO: enable
|
||||
if [ "$FORCE_LOWLATENCY_FLAG_USER" = "" ]; then
|
||||
if [ "$HW" = "EXMIMO" ] ; then
|
||||
LOWLATENCY_FLAG_USER="True"
|
||||
elif [ "$HW" = "ETHERNET" ] ; then
|
||||
LOWLATENCY_FLAG_USER="True"
|
||||
elif [ "$HW" = "OAI_USRP" ] ; then
|
||||
LOWLATENCY_FLAG_USER="False"
|
||||
elif [ "$HW" = "OAI_BLADERF" ] ; then
|
||||
LOWLATENCY_FLAG_USER="False"
|
||||
elif [ "$HW" = "None" ] ; then
|
||||
LOWLATENCY_FLAG_USER="False"
|
||||
else
|
||||
echo_error "Unknown HW type $HW. Exiting now..."
|
||||
exit
|
||||
fi
|
||||
else
|
||||
LOWLATENCY_FLAG_USER=$FORCE_LOWLATENCY_FLAG_USER
|
||||
fi
|
||||
|
||||
echo_info "Flags for Deadline scheduler: $LOWLATENCY_FLAG_USER"
|
||||
|
||||
|
||||
############################################
|
||||
# setting and printing OAI envs, we should check here
|
||||
@@ -266,12 +361,11 @@ function main() {
|
||||
if [ "$HW" == "OAI_USRP" ] ; then
|
||||
echo_info "installing packages for USRP support"
|
||||
check_install_usrp_uhd_driver
|
||||
fi
|
||||
fi
|
||||
if [ "$HW" == "OAI_BLADERF" ] ; then
|
||||
echo_info "installing packages for BALDERF support"
|
||||
echo_info "installing packages for BLADERF support"
|
||||
check_install_bladerf_driver
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
if [ "$INSTALL_OPTIONAL" = "1" ] ; then
|
||||
@@ -280,9 +374,11 @@ function main() {
|
||||
fi
|
||||
|
||||
if [ "$oaisim" = "1" ] ; then
|
||||
if [ "$HW" != "ETHERNET" ] ; then
|
||||
HW="NONE"
|
||||
fi
|
||||
#to be discussed
|
||||
# there is no RF device and no transport protocol
|
||||
HW="None"
|
||||
TP="None"
|
||||
|
||||
if [ "$XFORMS" == "True" ] ; then
|
||||
PRINT_STATS="True"
|
||||
fi
|
||||
@@ -316,7 +412,9 @@ function main() {
|
||||
echo "set ( RRC_ASN1_VERSION \"${REL}\")" >> $cmake_file
|
||||
echo "set ( ENABLE_VCD_FIFO $VCD_TIMING )" >> $cmake_file
|
||||
echo "set ( RF_BOARD \"${HW}\")" >> $cmake_file
|
||||
echo "set(PACKAGE_NAME \"${lte_exec}\")" >> $cmake_file
|
||||
echo "set ( TRANSP_PRO \"${TP}\")" >> $cmake_file
|
||||
echo "set(PACKAGE_NAME \"${lte_exec}\")" >> $cmake_file
|
||||
echo "set (LOWLATENCY \"${LOWLATENCY_FLAG_USER}\" )" >>$cmake_file
|
||||
echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)' >> $cmake_file
|
||||
cd $DIR/$lte_build_dir/build
|
||||
cmake ..
|
||||
@@ -408,7 +506,7 @@ function main() {
|
||||
|
||||
# EXMIMO drivers & firmware loader
|
||||
###############
|
||||
if [ "$HW" = "EXMIMO" -a "$EPC" = "0" ] ; then
|
||||
if [ "$HW" = "EXMIMO" ] ; then
|
||||
|
||||
echo_info "Compiling Express MIMO 2 board drivers"
|
||||
compilations \
|
||||
@@ -521,64 +619,136 @@ function main() {
|
||||
fi
|
||||
|
||||
# RRH compilation
|
||||
##################
|
||||
#####################
|
||||
if [ "$RRH" = "1" ] ; then
|
||||
echo_info "Compiling RRH"
|
||||
if [ $HW == "ETHERNET" ] ; then
|
||||
echo_info "RF frontend for RRH is not defined. This mode is used for testing (loopback)."
|
||||
elif [ $HW != "EXMIMO" -a $HW != "OAI_USRP" -a $HW != "OAI_BLADERF" ] ; then
|
||||
echo_fatal "Hardware not defined ($HW)"
|
||||
fi
|
||||
cmake_file=$DIR/rrh_gw/CMakeLists.txt
|
||||
echo "cmake_minimum_required(VERSION 2.8)" > $cmake_file
|
||||
echo "set(ENABLE_VCD_FIFO $VCD_TIMING )" >> $cmake_file
|
||||
echo "set(ENABLE_ITTI False )" >> $cmake_file
|
||||
echo "set(RF_BOARD \"${HW}\")" >> $cmake_file
|
||||
echo 'set(PACKAGE_NAME "\"rrh_gw\"")' >> $cmake_file
|
||||
echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)' >> $cmake_file
|
||||
|
||||
[ "$CLEAN" = "1" ] && rm -rf $DIR/rrh_gw/build
|
||||
mkdir -p $DIR/rrh_gw/build
|
||||
cd $DIR/rrh_gw/build
|
||||
cmake ..
|
||||
compilations \
|
||||
rrh_gw rrh_gw \
|
||||
rrh_gw $dbin/rrh_gw
|
||||
fi
|
||||
rrh_exec=rrh_gw
|
||||
rrh_build_dir=rrh_gw
|
||||
|
||||
echo_info "Compiling $rrh_exec ..."
|
||||
|
||||
[ "$CLEAN" = "1" ] && rm -rf $DIR/rrh_gw/build
|
||||
mkdir -p $DIR/$rrh_build_dir/build
|
||||
cmake_file=$DIR/$rrh_build_dir/CMakeLists.txt
|
||||
echo "cmake_minimum_required(VERSION 2.8)" > $cmake_file
|
||||
echo "set(ENABLE_VCD_FIFO $VCD_TIMING )" >> $cmake_file
|
||||
echo "set(ENABLE_ITTI False )" >> $cmake_file
|
||||
echo "set(RF_BOARD \"${HW}\")" >> $cmake_file
|
||||
echo "set(TRANSP_PRO \"${TP}\")" >> $cmake_file
|
||||
echo 'set(PACKAGE_NAME "\"rrh_gw\"")' >> $cmake_file
|
||||
echo "set (LOWLATENCY \"${LOWLATENCY_FLAG_USER}\" )" >>$cmake_file
|
||||
echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)' >> $cmake_file
|
||||
cd $DIR/$rrh_build_dir/build
|
||||
cmake ..
|
||||
compilations \
|
||||
rrh_gw rrh_gw \
|
||||
rrh_gw $dbin/rrh_gw
|
||||
|
||||
# EPC compilation
|
||||
##################
|
||||
if [ "$EPC" = "1" ] ; then
|
||||
echo_info "Compiling EPC"
|
||||
# Example HSS and EPC run on the same host
|
||||
if [ "$CLEAN" = "1" ]; then
|
||||
$OPENAIR_DIR/cmake_targets/tools/build_epc --clean --debug --transport-tcp-only --transport-prefer-tcp --s6a-server
|
||||
$OPENAIR_DIR/cmake_targets/tools/build_hss --clean --debug --transport-tcp-only --transport-prefer-tcp --fqdn `hostname --fqdn` --connect-to-mme `hostname --fqdn`
|
||||
else
|
||||
$OPENAIR_DIR/cmake_targets/tools/build_epc --debug --transport-tcp-only --transport-prefer-tcp --s6a-server
|
||||
$OPENAIR_DIR/cmake_targets/tools/build_hss --debug --transport-tcp-only --transport-prefer-tcp --fqdn `hostname --fqdn` --connect-to-mme `hostname --fqdn`
|
||||
fi
|
||||
|
||||
# if [ "$INSTALL_SYSTEM_FILES" = "1" ] ;then
|
||||
# if [ -f $dbin/hss.conf ] ; then
|
||||
# sed -e 's/ *= */=/' $dbin/hss.conf > $dconf/hss.conf.nospace
|
||||
# source $dconf/hss.conf.nospace
|
||||
# rm -f $dconf/hss.conf.nospace
|
||||
# create_hss_database root linux "$MYSQL_user" "$MYSQL_pass" "$MYSQL_db"
|
||||
# else
|
||||
# echo_warning "not created HSS database: config not found"
|
||||
# fi
|
||||
# fi
|
||||
fi
|
||||
|
||||
# build RF device and transport protocol libraries
|
||||
#####################################
|
||||
if [ "$eNB" = "1" -o "$RRH" = "1" ] ; then
|
||||
|
||||
if [ "$eNB" = "1" ] ; then
|
||||
build_dir=$lte_build_dir
|
||||
else
|
||||
build_dir=$rrh_build_dir
|
||||
fi
|
||||
|
||||
# build RF device libraries (currently EXMIMO is not complied with the rest of HW targets)
|
||||
if [ "$HW" != "None" ] ; then
|
||||
rm -f liboai_device.so
|
||||
rm -f $dbin/liboai_device.so
|
||||
|
||||
|
||||
# link liboai_device.so with the selected RF device library
|
||||
if [ "$HW" == "EXMIMO" ] ; then
|
||||
|
||||
#add exmimo compilation
|
||||
#TODO EXMIMO library support
|
||||
|
||||
echo_info "liboai_device.so is linked to EXMIMO device library"
|
||||
elif [ "$HW" == "OAI_USRP" ] ; then
|
||||
if [ -d "/usr/include/uhd" ] ; then
|
||||
compilations \
|
||||
$build_dir oai_usrpdevif \
|
||||
liboai_usrpdevif.so $dbin/liboai_usrpdevif.so.$REL
|
||||
fi
|
||||
|
||||
ln -s liboai_usrpdevif.so liboai_device.so
|
||||
ln -s $dbin/liboai_usrpdevif.so.$REL $dbin/liboai_device.so
|
||||
echo_info "liboai_device.so is linked to USRP device library"
|
||||
elif [ "$HW" == "OAI_BLADERF" ] ; then
|
||||
if [ -f "/usr/include/libbladeRF.h" ] ; then
|
||||
compilations \
|
||||
$build_dir oai_bladerfdevif \
|
||||
liboai_bladerfdevif.so $dbin/liboai_bladerfdevif.so.$REL
|
||||
fi
|
||||
|
||||
ln -s liboai_bladerfdevif.so liboai_device.so
|
||||
ln -s $dbin/liboai_bladerfdevif.so.$REL $dbin/liboai_device.so
|
||||
echo_info "liboai_device.so is linked to BLADERF device library"
|
||||
else
|
||||
echo_info "liboai_device.so is not linked to any device library"
|
||||
fi
|
||||
fi
|
||||
|
||||
# build trasport protocol libraries (currently only ETHERNET is available)
|
||||
if [ "$TP" != "None" ] ; then
|
||||
rm -f liboai_transpro.so
|
||||
rm -f $dbin/liboai_transpro.so
|
||||
|
||||
if [ "$TP" == "ETHERNET" ] ; then
|
||||
compilations \
|
||||
$build_dir oai_eth_transpro \
|
||||
liboai_eth_transpro.so $dbin/liboai_eth_transpro.so.$REL
|
||||
ln -s liboai_eth_transpro.so liboai_transpro.so
|
||||
ln -s $dbin/liboai_eth_transpro.so.$REL $dbin/liboai_transpro.so
|
||||
echo_info "liboai_transpro.so is linked with ETHERNET library"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
# Doxygen Support
|
||||
#####################
|
||||
if [ "$BUILD_DOXYGEN" = "1" ] ;then
|
||||
doxygen_log=$OPENAIR_DIR/cmake_targets/log/doxygen.log
|
||||
echo_info "Building doxygen based documentation. The documentation file is located here: $OPENAIR_DIR/targets/DOCS/html/index.html"
|
||||
echo_info "Doxygen Generation log is located here: $doxygen_log"
|
||||
echo_info "Generating doxygen files....please wait"
|
||||
(
|
||||
[ "$CLEAN" = "1" ] && rm -rf $OPENAIR_DIR/cmake_targets/doxygen/build
|
||||
mkdir -p $OPENAIR_DIR/cmake_targets/doxygen/build
|
||||
cd $OPENAIR_DIR/cmake_targets/doxygen/build
|
||||
cmake ..
|
||||
make doc
|
||||
) >& $doxygen_log
|
||||
fi
|
||||
|
||||
# Auto-tests
|
||||
#####################
|
||||
if [ "$OAI_TEST" = "1" ]; then
|
||||
echo_info "10. Running OAI pre commit tests (pre-ci) ..."
|
||||
echo_error "These scripts ASSUME that user is in /etc/sudoers and can execute commands without PASSWORD prompt"
|
||||
echo_error "Add the following lines in /etc/sudoers file to make your __user_name__ sudo without password prompt"
|
||||
echo_error " __your_user_name__ ALL = (ALL:ALL) NOPASSWD: ALL"
|
||||
echo_error " __your_user_name__ ALL = (ALL) NOPASSWD: ALL "
|
||||
echo_info "The log file for the autotest script for debugging is located here: $OPENAIR_DIR/cmake_targets/autotests/log/autotests.log "
|
||||
echo_info "The results of autotests results is located here: $OPENAIR_DIR/cmake_targets/autotests/log/results_autotests.xml "
|
||||
echo_info "You can hit CTRL-C any time to terminate the autotests..."
|
||||
echo "Current User Name: $USER"
|
||||
read -s -p "Enter Password: " mypassword
|
||||
echo -e "\n"
|
||||
rm -fr $OPENAIR_DIR/cmake_targets/autotests/log
|
||||
mkdir -p $OPENAIR_DIR/cmake_targets/autotests/log
|
||||
$OPENAIR_DIR/cmake_targets/autotests/run_compilation_autotests.bash
|
||||
$OPENAIR_DIR/cmake_targets/autotests/run_exec_autotests.bash
|
||||
if [ "$RUN_GROUP" -eq "1" ]; then
|
||||
$OPENAIR_DIR/cmake_targets/autotests/run_exec_autotests.bash -g "$TEST_CASE_GROUP" -p '$mypassword' >& $OPENAIR_DIR/cmake_targets/autotests/log/autotests.log &
|
||||
else
|
||||
$OPENAIR_DIR/cmake_targets/autotests/run_exec_autotests.bash -p '$mypassword' >& $OPENAIR_DIR/cmake_targets/autotests/log/autotests.log &
|
||||
fi
|
||||
wait
|
||||
else
|
||||
echo_info "10. Bypassing the Tests ..."
|
||||
fi
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
cmake_minimum_required(VERSION 2.8)
|
||||
set(ENABLE_VCD_FIFO False )
|
||||
set(ENABLE_ITTI False )
|
||||
set(RF_BOARD "ETHERNET")
|
||||
set(PACKAGE_NAME "\"rrh_gw\"")
|
||||
include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)
|
||||
@@ -111,7 +111,12 @@ compilations() {
|
||||
cd $OPENAIR_DIR/cmake_targets/$1/build
|
||||
{
|
||||
rm -f $3
|
||||
make -j`nproc` $2 VERBOSE=$VERBOSE_COMPILE
|
||||
if [ "$VERBOSE_COMPILE" == "1" ]; then
|
||||
make -j`nproc` $2 VERBOSE=$VERBOSE_COMPILE
|
||||
else
|
||||
make -j`nproc` $2
|
||||
fi
|
||||
|
||||
} > $dlog/$2.$REL.txt 2>&1
|
||||
echo_info "Log file for compilation has been written to: $dlog/$2.$REL.txt"
|
||||
if [ -s $3 ] ; then
|
||||
@@ -158,19 +163,24 @@ install_gnutls_from_source(){
|
||||
|
||||
|
||||
check_install_usrp_uhd_driver(){
|
||||
#first we remove old installation
|
||||
$SUDO apt-get remove uhd libuhd-dev libuhd003 uhd-host -y
|
||||
v=$(lsb_release -cs)
|
||||
$SUDO apt-add-repository "deb http://files.ettus.com/binaries/uhd/repo/uhd/ubuntu/$v $v main"
|
||||
$SUDO apt-add-repository --remove "deb http://files.ettus.com/binaries/uhd/repo/uhd/ubuntu/$v $v main"
|
||||
#The new USRP repository
|
||||
$SUDO add-apt-repository ppa:ettusresearch/uhd -y
|
||||
$SUDO apt-get update
|
||||
$SUDO apt-get -y install python python-tk libboost-all-dev libusb-1.0-0-dev
|
||||
$SUDO apt-get -y install -t `lsb_release -cs` uhd --force-yes
|
||||
$SUDO apt-get -y install libuhd-dev libuhd003 uhd-host
|
||||
$SUDO uhd_images_downloader
|
||||
}
|
||||
check_install_bladerf_driver(){
|
||||
$SUDO add-apt-repository -y ppa:bladerf/bladerf
|
||||
$SUDO apt-get update
|
||||
$SUDO apt-get install -y bladerf libbladerf-dev
|
||||
$SUDO apt-get install bladerf-firmware-fx3
|
||||
$SUDO apt-get install bladerf-fpga-hostedx40
|
||||
bladeRF-cli --flash-firmware /usr/share/Nuand/bladeRF/bladeRF_fw.img
|
||||
$SUDO apt-get install -y bladerf-firmware-fx3
|
||||
$SUDO apt-get install -y bladerf-fpga-hostedx40
|
||||
$SUDO bladeRF-cli --flash-firmware /usr/share/Nuand/bladeRF/bladeRF_fw.img
|
||||
}
|
||||
|
||||
check_install_additional_tools (){
|
||||
@@ -183,7 +193,6 @@ check_install_additional_tools (){
|
||||
libboost-all-dev \
|
||||
libpthread-stubs0-dev \
|
||||
openvpn \
|
||||
phpmyadmin \
|
||||
pkg-config \
|
||||
python-dev \
|
||||
python-pexpect \
|
||||
@@ -194,27 +203,27 @@ check_install_additional_tools (){
|
||||
unzip \
|
||||
valgrind \
|
||||
vlan \
|
||||
ctags
|
||||
ctags \
|
||||
ntpdate
|
||||
}
|
||||
|
||||
check_install_oai_software() {
|
||||
|
||||
$SUDO apt-get update
|
||||
$SUDO apt-get install -y \
|
||||
autoconf \
|
||||
autoconf \
|
||||
automake \
|
||||
bison \
|
||||
build-essential \
|
||||
cmake \
|
||||
cmake-curses-gui \
|
||||
doxygen \
|
||||
doxygen-gui\
|
||||
texlive-latex-base\
|
||||
doxygen-gui \
|
||||
texlive-latex-base \
|
||||
ethtool \
|
||||
flex \
|
||||
gccxml \
|
||||
gdb \
|
||||
git \
|
||||
gccxml \
|
||||
gdb \
|
||||
git \
|
||||
graphviz \
|
||||
gtkwave \
|
||||
guile-2.0-dev \
|
||||
@@ -233,7 +242,7 @@ check_install_oai_software() {
|
||||
libgmp-dev \
|
||||
libgtk-3-dev \
|
||||
libidn2-0-dev \
|
||||
libidn11-dev \
|
||||
libidn11-dev \
|
||||
libmysqlclient-dev \
|
||||
liboctave-dev \
|
||||
libpgm-5.1 \
|
||||
@@ -254,7 +263,13 @@ check_install_oai_software() {
|
||||
openssh-server \
|
||||
openssl \
|
||||
python \
|
||||
subversion
|
||||
subversion \
|
||||
xmlstarlet \
|
||||
python-pip \
|
||||
pydb \
|
||||
wvdial \
|
||||
python-numpy \
|
||||
sshpass
|
||||
$SUDO update-alternatives --set liblapack.so /usr/lib/atlas-base/atlas/liblapack.so
|
||||
if [ `lsb_release -rs` = '12.04' ] ; then
|
||||
install_nettle_from_source
|
||||
@@ -262,20 +277,28 @@ check_install_oai_software() {
|
||||
else
|
||||
$SUDO apt-get install -y libgnutls-dev nettle-dev nettle-bin
|
||||
fi
|
||||
$SUDO pip install paramiko
|
||||
$SUDO pip install pyroute2
|
||||
install_asn1c_from_source
|
||||
$SUDO rm -fr /opt/ssh
|
||||
$SUDO git clone https://gist.github.com/2190472.git /opt/ssh
|
||||
}
|
||||
|
||||
install_asn1c_from_source(){
|
||||
asn1_install_dir=$OPENAIR_DIR/cmake_targets/log/asn1c_install_log.txt
|
||||
echo_info "\nInstalling ASN1. The log file for ASN1 installation is here: $asn1_install_dir "
|
||||
(
|
||||
rm -rf /tmp/asn1c-r1516
|
||||
mkdir -p /tmp/asn1c-r1516
|
||||
cd /tmp/asn1c-r1516
|
||||
rm -rf /tmp/asn1c-r1516/*
|
||||
svn co https://github.com/vlm/asn1c/trunk /tmp/asn1c-r1516 -r 1516 > /tmp/log_compile_asn1c
|
||||
patch -p0 < $OPENAIR_DIR/openair3/S1AP/MESSAGES/ASN1/asn1cpatch.p0 >> /tmp/log_compile_asn1c
|
||||
patch -p0 < $OPENAIR_DIR/openair3/S1AP/MESSAGES/ASN1/asn1cpatch_2.p0 >> /tmp/log_compile_asn1c
|
||||
patch -p0 < $OPENAIR_DIR/openair2/RRC/LITE/MESSAGES/asn1c/asn1cpatch.p0 >> /tmp/log_compile_asn1c
|
||||
svn co https://github.com/vlm/asn1c/trunk /tmp/asn1c-r1516 -r 1516
|
||||
patch -p0 < $OPENAIR_DIR/openair3/S1AP/MESSAGES/ASN1/asn1cpatch.p0
|
||||
patch -p0 < $OPENAIR_DIR/openair3/S1AP/MESSAGES/ASN1/asn1cpatch_2.p0
|
||||
patch -p0 < $OPENAIR_DIR/openair2/RRC/LITE/MESSAGES/asn1c/asn1cpatch.p0
|
||||
./configure
|
||||
make > /tmp/log_compile_asn1c 2>&1
|
||||
make -j`nproc`
|
||||
$SUDO make install
|
||||
) > $asn1_install_dir 2>&1
|
||||
}
|
||||
|
||||
#################################################
|
||||
@@ -318,3 +341,42 @@ set_openair_env(){
|
||||
export OPENAIR_TARGETS=$openair_path/targets
|
||||
}
|
||||
|
||||
################################
|
||||
# Function to killall the subprocesses when Ctrl-C Key is hit
|
||||
###############################
|
||||
function handle_ctrl_c(){
|
||||
CURPID=$$
|
||||
ppid=$$
|
||||
arraycounter=1
|
||||
echo_info "** Trapped CTRL-C. Killing all subprocesses now..."
|
||||
while true
|
||||
do
|
||||
FORLOOP=FALSE
|
||||
# Get all the child process id
|
||||
for i in `ps -ef| awk '$3 == '$ppid' { print $2 }'`
|
||||
do
|
||||
if [ $i -ne $CURPID ] ; then
|
||||
procid[$arraycounter]=$i
|
||||
arraycounter=`expr $arraycounter + 1`
|
||||
ppid=$i
|
||||
FORLOOP=TRUE
|
||||
fi
|
||||
done
|
||||
if [ "$FORLOOP" = "FALSE" ] ; then
|
||||
arraycounter=`expr $arraycounter - 1`
|
||||
## We want to kill child process id first and then parent id's
|
||||
while [ $arraycounter -ne 0 ]
|
||||
do
|
||||
echo "first we send ctrl-c to program"
|
||||
$SUDO kill -INT "${procid[$arraycounter]}"
|
||||
sleep 5
|
||||
echo "Now we force kill if that didn't work"
|
||||
$SUDO kill -9 "${procid[$arraycounter]}" >/dev/null
|
||||
arraycounter=`expr $arraycounter - 1`
|
||||
done
|
||||
exit
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
n=oarf_get_num_detected_cards;
|
||||
for i=n-1:0
|
||||
oarf_stop(i);
|
||||
end
|
||||
Regular → Executable
@@ -68,7 +68,7 @@ declare MAX_RATE=1000
|
||||
|
||||
# set paths to the required binaries and check if the required binaries are available
|
||||
ENB_CONFIG=$OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf
|
||||
OAISIM_EXEC=$OPENAIR_DIR/targets/bin/oaisim_nos1
|
||||
OAISIM_EXEC=$OPENAIR_DIR/cmake_targets/oaisim_noS1_build_oai/build/oaisim_nos1
|
||||
BYPASSE_ITTI=0
|
||||
OTGPLOT="$OPENAIR2_DIR/UTIL/OTG/OTGplot"
|
||||
PS2PDF="ps2pdf"
|
||||
@@ -301,8 +301,8 @@ oaisim_otg_stats(){
|
||||
sync
|
||||
|
||||
if [ ! -f $OAISIM_EXEC ]; then
|
||||
echo_info "3.1 compiling OAISIM ($OPENAIR_TARGETS/cmake_targets/build_oai --oaisim -c)"
|
||||
($OPENAIR_TARGETS/cmake_targets/build_oai --oaisim -c >> results/perf_log.txt 2>&1 )
|
||||
echo_info "3.1 compiling OAISIM ($OPENAIR_DIR/cmake_targets/build_oai --oaisim -c --noS1)"
|
||||
($OPENAIR_DIR/cmake_targets/build_oai --oaisim -c --noS1 >> results/perf_log.txt 2>&1 )
|
||||
build_stats=$?
|
||||
if [ $build_stats != 0 ] ; then
|
||||
echo_error "$OAISIM_EXEC cannot be built, check results/perf_log.txt file"
|
||||
|
||||
Executable
+46
@@ -0,0 +1,46 @@
|
||||
#!/usr/bin/python
|
||||
import time
|
||||
import serial
|
||||
import os
|
||||
from pyroute2 import IPRoute
|
||||
import sys
|
||||
import re
|
||||
import threading
|
||||
import signal
|
||||
import traceback
|
||||
import commands
|
||||
|
||||
if os.environ.get('OPENAIR_DIR') == None:
|
||||
print "Error getting OPENAIR_DIR environment variable"
|
||||
sys.exit(1)
|
||||
|
||||
sys.path.append(os.path.expandvars('$OPENAIR_DIR/cmake_targets/autotests/tools/'))
|
||||
|
||||
from lib_autotest import *
|
||||
|
||||
def reset_bladerf():
|
||||
stringIdBladeRF='OpenMoko, Inc'
|
||||
status, out = commands.getstatusoutput('lsusb | grep -i \'' + stringIdBladeRF + '\'')
|
||||
if (out == '') :
|
||||
print "BladeRF not found. Exiting now..."
|
||||
sys.exit()
|
||||
p=re.compile('Bus\s*(\w+)\s*Device\s*(\w+):\s*ID\s*(\w+):(\w+)')
|
||||
res=p.findall(out)
|
||||
BusId=res[0][0]
|
||||
DeviceId=res[0][1]
|
||||
VendorId=res[0][2]
|
||||
ProductId=res[0][3]
|
||||
usb_dir= find_usb_path(VendorId, ProductId)
|
||||
print "BladeRF Found in directory..." + usb_dir
|
||||
cmd = "sudo sh -c \"echo 0 > " + usb_dir + "/authorized\""
|
||||
os.system(cmd + " ; sleep 5" )
|
||||
cmd = "sudo sh -c \"echo 1 > " + usb_dir + "/authorized\""
|
||||
os.system(cmd + " ; sleep 5" )
|
||||
|
||||
os.system ('sudo -E bladeRF-cli --flash-firmware /usr/share/Nuand/bladeRF/bladeRF_fw.img')
|
||||
|
||||
print "Resettting BladeRF..."
|
||||
|
||||
reset_bladerf()
|
||||
|
||||
os.system ("dmesg|tail")
|
||||
Executable
+17
@@ -0,0 +1,17 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo "This script stops exmimo2 as it might be transmitting signal by itself if lte-softmodem terminates incorrectly"
|
||||
|
||||
if [ "$OPENAIR_DIR" == "" ]; then
|
||||
echo "Is the OPENAIR_DIR path set correctly? Exiting now"
|
||||
exit
|
||||
fi
|
||||
sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches'
|
||||
|
||||
#load the module
|
||||
sudo -E $OPENAIR_DIR/cmake_targets/tools/init_exmimo2
|
||||
|
||||
#now we stop the card from transmitting anything
|
||||
cd $OPENAIR_DIR/targets/bin
|
||||
sudo -E octave $OPENAIR_DIR/cmake_targets/tools/exmimo_stop_octave.m
|
||||
|
||||
@@ -24,34 +24,40 @@ xUnit_start() {
|
||||
# \param $1 classname
|
||||
# \param $2 testcase name
|
||||
# \param $3 testcase result
|
||||
# \param $4 run index
|
||||
# \param $4 run result
|
||||
# \param $5 XML file local to test case for storing its own results
|
||||
xUnit_fail() {
|
||||
class=$1
|
||||
test_case=$2
|
||||
result=$3
|
||||
run_index=$4
|
||||
run_result=$4
|
||||
xmlfile_testcase=$5
|
||||
currtime=$(date +%s.%N)
|
||||
time=$(echo "$currtime - $XUNIT_START" | bc -l)
|
||||
xml="<testcase classname='$class' name='$test_case' run='$run_index' time='$time' RESULT='$result'></testcase>"
|
||||
xml="<testcase classname='$class' name='$test_case' Run_result='$run_result' time='$time s' RESULT='$result'></testcase>"
|
||||
echo -e $xml >> $xmlfile_testcase
|
||||
XUNIT_TESTCASES_XML="$XUNIT_TESTCASES_XML \n$xml"
|
||||
XUNIT_FAILED=$((XUNIT_FAILED+1))
|
||||
}
|
||||
|
||||
## Call this after the testcase finished successfully.
|
||||
# \sa xUnit_fail()
|
||||
# \sa xUnit_success()
|
||||
# \pre xUnit_start() must have been called before
|
||||
# \param $1 classname
|
||||
# \param $2 testcase name
|
||||
# \param $3 testcase result
|
||||
# \param $4 run index
|
||||
# \param $4 run result
|
||||
# \param $5 XML file local to test case for storing its own results
|
||||
xUnit_success() {
|
||||
class=$1
|
||||
test_case=$2
|
||||
result=$3
|
||||
run_index=$4
|
||||
run_result=$4
|
||||
xmlfile_testcase=$5
|
||||
currtime=$(date +%s.%N)
|
||||
time=$(echo "$currtime - $XUNIT_START" | bc -l)
|
||||
xml="<testcase classname='$class' name='$test_case' run='$run_index' time='$time' RESULT='$result'></testcase>"
|
||||
xml="<testcase classname='$class' name='$test_case' Run_result='$run_result' time='$time s' RESULT='$result'></testcase>"
|
||||
echo -e $xml >> $xmlfile_testcase
|
||||
XUNIT_TESTCASES_XML="$XUNIT_TESTCASES_XML \n$xml"
|
||||
XUNIT_SUCCESS=$((XUNIT_SUCCESS+1))
|
||||
}
|
||||
|
||||
@@ -5,7 +5,8 @@ export OPENAIR1_DIR=$OPENAIR_HOME/openair1
|
||||
export OPENAIR2_DIR=$OPENAIR_HOME/openair2
|
||||
export OPENAIR3_DIR=$OPENAIR_HOME/openair3
|
||||
export OPENAIR_TARGETS=$OPENAIR_HOME/targets
|
||||
export OPENAIRITS_DIR=$OPENAIR_HOME/openairITS
|
||||
|
||||
export PATH=$PATH:$OPENAIR_TARGETS/bin
|
||||
|
||||
alias oai='cd $OPENAIR_HOME'
|
||||
alias oai0='cd $OPENAIR0_DIR'
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
#include "PHY/defs.h"
|
||||
#include "assertions.h"
|
||||
|
||||
//#define cmin(a,b) ((a)<(b) ? (a) : (b))
|
||||
|
||||
@@ -515,16 +516,14 @@ uint32_t lte_rate_matching_turbo(uint32_t RTC,
|
||||
// if (rvidx==3)
|
||||
// for (cnt=0;cnt<Ncb;cnt++)
|
||||
// counter_buffer[rvidx][cnt]=0;
|
||||
if (Ncb<(3*(RTC<<5))) {
|
||||
msg("Exiting, RM condition (Nir %d, Nsoft %d, Kw %d\n",Nir,Nsoft,3*(RTC<<5));
|
||||
return(0);
|
||||
}
|
||||
AssertFatal(Ncb>=(3*RTC<<5),"Exiting, RM condition (Ncb %d, Nir/C %d, Nsoft %d, Kw %d\n",Ncb,Nir/C,Nsoft,3*(RTC<<5));
|
||||
|
||||
|
||||
Gp = G/Nl/Qm;
|
||||
GpmodC = Gp%C;
|
||||
|
||||
#ifdef RM_DEBUG
|
||||
printf("lte_rate_matching_turbo: Kw %d, rvidx %d, G %d, Qm %d, Nl%d, r %d\n",3*(RTC<<5),rvidx, G, Qm,Nl,r);
|
||||
printf("lte_rate_matching_turbo: Ncb %d, Kw %d, Nir/C %d, rvidx %d, G %d, Qm %d, Nl%d, r %d\n",Ncb,3*(RTC<<5),Nir/C,rvidx, G, Qm,Nl,r);
|
||||
#endif
|
||||
|
||||
if (r < (C-(GpmodC)))
|
||||
|
||||
@@ -0,0 +1,112 @@
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
#include <unistd.h>
|
||||
#include <execinfo.h>
|
||||
#include <signal.h>
|
||||
|
||||
#include "SIMULATION/TOOLS/defs.h"
|
||||
#include "PHY/types.h"
|
||||
#include "PHY/defs.h"
|
||||
#include "PHY/extern.h"
|
||||
|
||||
extern PHY_VARS_eNB *PHY_vars_eNB;
|
||||
extern PHY_VARS_UE *PHY_vars_UE;
|
||||
|
||||
void lte_param_init(unsigned char N_tx_port_eNB,
|
||||
unsigned char N_tx_phy,
|
||||
unsigned char N_rx,
|
||||
unsigned char transmission_mode,
|
||||
uint8_t extended_prefix_flag,
|
||||
frame_t frame_type,
|
||||
uint16_t Nid_cell,
|
||||
uint8_t tdd_config,
|
||||
uint8_t N_RB_DL,
|
||||
uint8_t threequarter_fs,
|
||||
uint8_t osf,
|
||||
uint32_t perfect_ce)
|
||||
{
|
||||
|
||||
LTE_DL_FRAME_PARMS *lte_frame_parms;
|
||||
int i;
|
||||
|
||||
|
||||
printf("Start lte_param_init\n");
|
||||
PHY_vars_eNB = malloc(sizeof(PHY_VARS_eNB));
|
||||
PHY_vars_UE = malloc(sizeof(PHY_VARS_UE));
|
||||
//PHY_config = malloc(sizeof(PHY_CONFIG));
|
||||
mac_xface = malloc(sizeof(MAC_xface));
|
||||
|
||||
srand(0);
|
||||
randominit(0);
|
||||
set_taus_seed(0);
|
||||
|
||||
lte_frame_parms = &(PHY_vars_eNB->lte_frame_parms);
|
||||
|
||||
lte_frame_parms->N_RB_DL = N_RB_DL; //50 for 10MHz and 25 for 5 MHz
|
||||
lte_frame_parms->N_RB_UL = N_RB_DL;
|
||||
lte_frame_parms->threequarter_fs = threequarter_fs;
|
||||
lte_frame_parms->Ncp = extended_prefix_flag;
|
||||
lte_frame_parms->Nid_cell = Nid_cell;
|
||||
lte_frame_parms->nushift = Nid_cell%6;
|
||||
lte_frame_parms->nb_antennas_tx = N_tx_phy;
|
||||
lte_frame_parms->nb_antennas_rx = N_rx;
|
||||
lte_frame_parms->nb_antenna_ports_eNB = N_tx_port_eNB;
|
||||
lte_frame_parms->phich_config_common.phich_resource = one;
|
||||
lte_frame_parms->tdd_config = tdd_config;
|
||||
lte_frame_parms->frame_type = frame_type;
|
||||
// lte_frame_parms->Csrs = 2;
|
||||
// lte_frame_parms->Bsrs = 0;
|
||||
// lte_frame_parms->kTC = 0;44
|
||||
// lte_frame_parms->n_RRC = 0;
|
||||
//lte_frame_parms->mode1_flag = (transmission_mode == 1)? 1 : 0;
|
||||
lte_frame_parms->mode1_flag = (transmission_mode == 1 || transmission_mode ==7)? 1 : 0;
|
||||
|
||||
init_frame_parms(lte_frame_parms,osf);
|
||||
|
||||
//copy_lte_parms_to_phy_framing(lte_frame_parms, &(PHY_config->PHY_framing));
|
||||
|
||||
// phy_init_top(lte_frame_parms); //allocation
|
||||
|
||||
PHY_vars_UE->is_secondary_ue = 0;
|
||||
PHY_vars_UE->lte_frame_parms = *lte_frame_parms;
|
||||
PHY_vars_eNB->lte_frame_parms = *lte_frame_parms;
|
||||
|
||||
PHY_vars_eNB->transmission_mode[0] = transmission_mode;
|
||||
PHY_vars_UE->transmission_mode[0] = transmission_mode;
|
||||
|
||||
phy_init_lte_top(lte_frame_parms);
|
||||
dump_frame_parms(lte_frame_parms);
|
||||
|
||||
PHY_vars_UE->PHY_measurements.n_adj_cells=0;
|
||||
PHY_vars_UE->PHY_measurements.adj_cell_id[0] = Nid_cell+1;
|
||||
PHY_vars_UE->PHY_measurements.adj_cell_id[1] = Nid_cell+2;
|
||||
|
||||
for (i=0; i<3; i++)
|
||||
lte_gold(lte_frame_parms,PHY_vars_UE->lte_gold_table[i],Nid_cell+i);
|
||||
|
||||
phy_init_lte_ue(PHY_vars_UE,1,0);
|
||||
phy_init_lte_eNB(PHY_vars_eNB,0,0,0);
|
||||
|
||||
generate_pcfich_reg_mapping(&PHY_vars_UE->lte_frame_parms);
|
||||
generate_phich_reg_mapping(&PHY_vars_UE->lte_frame_parms);
|
||||
|
||||
// DL power control init
|
||||
//if (transmission_mode == 1) {
|
||||
if (transmission_mode == 1 || transmission_mode ==7) {
|
||||
PHY_vars_eNB->pdsch_config_dedicated->p_a = dB0; // 4 = 0dB
|
||||
((PHY_vars_eNB->lte_frame_parms).pdsch_config_common).p_b = 0;
|
||||
PHY_vars_UE->pdsch_config_dedicated->p_a = dB0; // 4 = 0dB
|
||||
((PHY_vars_UE->lte_frame_parms).pdsch_config_common).p_b = 0;
|
||||
} else { // rho_a = rhob
|
||||
PHY_vars_eNB->pdsch_config_dedicated->p_a = dB0; // 4 = 0dB
|
||||
((PHY_vars_eNB->lte_frame_parms).pdsch_config_common).p_b = 1;
|
||||
PHY_vars_UE->pdsch_config_dedicated->p_a = dB0; // 4 = 0dB
|
||||
((PHY_vars_UE->lte_frame_parms).pdsch_config_common).p_b = 1;
|
||||
}
|
||||
|
||||
PHY_vars_UE->perfect_ce = perfect_ce;
|
||||
|
||||
printf("Done lte_param_init\n");
|
||||
|
||||
|
||||
}
|
||||
@@ -68,33 +68,57 @@ int init_frame_parms(LTE_DL_FRAME_PARMS *frame_parms,uint8_t osf)
|
||||
break;
|
||||
|
||||
default:
|
||||
msg("Illegal oversampling %d\n",osf);
|
||||
printf("Illegal oversampling %d\n",osf);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
switch (frame_parms->N_RB_DL) {
|
||||
|
||||
case 100:
|
||||
if (osf>1) {
|
||||
msg("Illegal oversampling %d for N_RB_DL %d\n",osf,frame_parms->N_RB_DL);
|
||||
printf("Illegal oversampling %d for N_RB_DL %d\n",osf,frame_parms->N_RB_DL);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
frame_parms->ofdm_symbol_size = 2048;
|
||||
frame_parms->log2_symbol_size = 11;
|
||||
frame_parms->samples_per_tti = 30720;
|
||||
frame_parms->first_carrier_offset = 2048-600;
|
||||
if (frame_parms->threequarter_fs) {
|
||||
frame_parms->ofdm_symbol_size = 1536;
|
||||
frame_parms->samples_per_tti = 23040;
|
||||
frame_parms->first_carrier_offset = 1536-600;
|
||||
frame_parms->nb_prefix_samples=(frame_parms->nb_prefix_samples*3)>>2;
|
||||
frame_parms->nb_prefix_samples0=(frame_parms->nb_prefix_samples0*3)>>2;
|
||||
}
|
||||
else {
|
||||
frame_parms->ofdm_symbol_size = 2048;
|
||||
frame_parms->samples_per_tti = 30720;
|
||||
frame_parms->first_carrier_offset = 2048-600;
|
||||
}
|
||||
frame_parms->N_RBGS = 4;
|
||||
frame_parms->N_RBG = 25;
|
||||
break;
|
||||
|
||||
case 75:
|
||||
if (osf>1) {
|
||||
printf("Illegal oversampling %d for N_RB_DL %d\n",osf,frame_parms->N_RB_DL);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
|
||||
frame_parms->ofdm_symbol_size = 1536;
|
||||
frame_parms->samples_per_tti = 23040;
|
||||
frame_parms->first_carrier_offset = 1536-450;
|
||||
frame_parms->nb_prefix_samples=(frame_parms->nb_prefix_samples*3)>>2;
|
||||
frame_parms->nb_prefix_samples0=(frame_parms->nb_prefix_samples0*3)>>2;
|
||||
frame_parms->N_RBGS = 4;
|
||||
frame_parms->N_RBG = 25;
|
||||
break;
|
||||
|
||||
case 50:
|
||||
if (osf>1) {
|
||||
msg("Illegal oversampling %d for N_RB_DL %d\n",osf,frame_parms->N_RB_DL);
|
||||
printf("Illegal oversampling %d for N_RB_DL %d\n",osf,frame_parms->N_RB_DL);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
frame_parms->ofdm_symbol_size = 1024*osf;
|
||||
frame_parms->log2_symbol_size = 10+log2_osf;
|
||||
frame_parms->samples_per_tti = 15360*osf;
|
||||
frame_parms->first_carrier_offset = frame_parms->ofdm_symbol_size - 300;
|
||||
frame_parms->nb_prefix_samples>>=(1-log2_osf);
|
||||
@@ -105,13 +129,13 @@ int init_frame_parms(LTE_DL_FRAME_PARMS *frame_parms,uint8_t osf)
|
||||
|
||||
case 25:
|
||||
if (osf>2) {
|
||||
msg("Illegal oversampling %d for N_RB_DL %d\n",osf,frame_parms->N_RB_DL);
|
||||
printf("Illegal oversampling %d for N_RB_DL %d\n",osf,frame_parms->N_RB_DL);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
frame_parms->ofdm_symbol_size = 512*osf;
|
||||
|
||||
frame_parms->log2_symbol_size = 9+log2_osf;
|
||||
|
||||
frame_parms->samples_per_tti = 7680*osf;
|
||||
frame_parms->first_carrier_offset = frame_parms->ofdm_symbol_size - 150;
|
||||
frame_parms->nb_prefix_samples>>=(2-log2_osf);
|
||||
@@ -124,7 +148,6 @@ int init_frame_parms(LTE_DL_FRAME_PARMS *frame_parms,uint8_t osf)
|
||||
|
||||
case 15:
|
||||
frame_parms->ofdm_symbol_size = 256*osf;
|
||||
frame_parms->log2_symbol_size = 8+log2_osf;
|
||||
frame_parms->samples_per_tti = 3840*osf;
|
||||
frame_parms->first_carrier_offset = frame_parms->ofdm_symbol_size - 90;
|
||||
frame_parms->nb_prefix_samples>>=(3-log2_osf);
|
||||
@@ -135,7 +158,6 @@ int init_frame_parms(LTE_DL_FRAME_PARMS *frame_parms,uint8_t osf)
|
||||
|
||||
case 6:
|
||||
frame_parms->ofdm_symbol_size = 128*osf;
|
||||
frame_parms->log2_symbol_size = 7+log2_osf;
|
||||
frame_parms->samples_per_tti = 1920*osf;
|
||||
frame_parms->first_carrier_offset = frame_parms->ofdm_symbol_size - 36;
|
||||
frame_parms->nb_prefix_samples>>=(4-log2_osf);
|
||||
@@ -145,7 +167,7 @@ int init_frame_parms(LTE_DL_FRAME_PARMS *frame_parms,uint8_t osf)
|
||||
break;
|
||||
|
||||
default:
|
||||
msg("init_frame_parms: Error: Number of resource blocks (N_RB_DL %d) undefined, frame_parms = %p \n",frame_parms->N_RB_DL, frame_parms);
|
||||
printf("init_frame_parms: Error: Number of resource blocks (N_RB_DL %d) undefined, frame_parms = %p \n",frame_parms->N_RB_DL, frame_parms);
|
||||
return(-1);
|
||||
break;
|
||||
}
|
||||
@@ -159,23 +181,22 @@ int init_frame_parms(LTE_DL_FRAME_PARMS *frame_parms,uint8_t osf)
|
||||
|
||||
void dump_frame_parms(LTE_DL_FRAME_PARMS *frame_parms)
|
||||
{
|
||||
msg("frame_parms->N_RB_DL=%d\n",frame_parms->N_RB_DL);
|
||||
msg("frame_parms->N_RB_UL=%d\n",frame_parms->N_RB_UL);
|
||||
msg("frame_parms->Nid_cell=%d\n",frame_parms->Nid_cell);
|
||||
msg("frame_parms->Ncp=%d\n",frame_parms->Ncp);
|
||||
msg("frame_parms->Ncp_UL=%d\n",frame_parms->Ncp_UL);
|
||||
msg("frame_parms->nushift=%d\n",frame_parms->nushift);
|
||||
msg("frame_parms->frame_type=%d\n",frame_parms->frame_type);
|
||||
msg("frame_parms->tdd_config=%d\n",frame_parms->tdd_config);
|
||||
msg("frame_parms->tdd_config_S=%d\n",frame_parms->tdd_config_S);
|
||||
msg("frame_parms->mode1_flag=%d\n",frame_parms->mode1_flag);
|
||||
msg("frame_parms->nb_antennas_tx=%d\n",frame_parms->nb_antennas_tx);
|
||||
msg("frame_parms->nb_antennas_rx=%d\n",frame_parms->nb_antennas_rx);
|
||||
msg("frame_parms->ofdm_symbol_size=%d\n",frame_parms->ofdm_symbol_size);
|
||||
msg("frame_parms->log2_symbol_size=%d\n",frame_parms->log2_symbol_size);
|
||||
msg("frame_parms->nb_prefix_samples=%d\n",frame_parms->nb_prefix_samples);
|
||||
msg("frame_parms->nb_prefix_samples0=%d\n",frame_parms->nb_prefix_samples0);
|
||||
msg("frame_parms->first_carrier_offset=%d\n",frame_parms->first_carrier_offset);
|
||||
msg("frame_parms->samples_per_tti=%d\n",frame_parms->samples_per_tti);
|
||||
msg("frame_parms->symbols_per_tti=%d\n",frame_parms->symbols_per_tti);
|
||||
printf("frame_parms->N_RB_DL=%d\n",frame_parms->N_RB_DL);
|
||||
printf("frame_parms->N_RB_UL=%d\n",frame_parms->N_RB_UL);
|
||||
printf("frame_parms->Nid_cell=%d\n",frame_parms->Nid_cell);
|
||||
printf("frame_parms->Ncp=%d\n",frame_parms->Ncp);
|
||||
printf("frame_parms->Ncp_UL=%d\n",frame_parms->Ncp_UL);
|
||||
printf("frame_parms->nushift=%d\n",frame_parms->nushift);
|
||||
printf("frame_parms->frame_type=%d\n",frame_parms->frame_type);
|
||||
printf("frame_parms->tdd_config=%d\n",frame_parms->tdd_config);
|
||||
printf("frame_parms->tdd_config_S=%d\n",frame_parms->tdd_config_S);
|
||||
printf("frame_parms->mode1_flag=%d\n",frame_parms->mode1_flag);
|
||||
printf("frame_parms->nb_antennas_tx=%d\n",frame_parms->nb_antennas_tx);
|
||||
printf("frame_parms->nb_antennas_rx=%d\n",frame_parms->nb_antennas_rx);
|
||||
printf("frame_parms->ofdm_symbol_size=%d\n",frame_parms->ofdm_symbol_size);
|
||||
printf("frame_parms->nb_prefix_samples=%d\n",frame_parms->nb_prefix_samples);
|
||||
printf("frame_parms->nb_prefix_samples0=%d\n",frame_parms->nb_prefix_samples0);
|
||||
printf("frame_parms->first_carrier_offset=%d\n",frame_parms->first_carrier_offset);
|
||||
printf("frame_parms->samples_per_tti=%d\n",frame_parms->samples_per_tti);
|
||||
printf("frame_parms->symbols_per_tti=%d\n",frame_parms->symbols_per_tti);
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ phy_adjust_gain (PHY_VARS_UE *phy_vars_ue, uint8_t eNB_id)
|
||||
if (rssi>0) rx_power_fil_dB = rssi;
|
||||
else rx_power_fil_dB = phy_vars_ue->PHY_measurements.rx_power_avg_dB[eNB_id];
|
||||
|
||||
printf("Gain control: rssi %d (%d,%d)\n",
|
||||
LOG_D(PHY,"Gain control: rssi %d (%d,%d)\n",
|
||||
rssi,
|
||||
phy_vars_ue->PHY_measurements.rssi,
|
||||
phy_vars_ue->PHY_measurements.rx_power_avg_dB[eNB_id]
|
||||
|
||||
@@ -249,15 +249,16 @@ int lte_est_timing_advance(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
|
||||
int lte_est_timing_advance_pusch(PHY_VARS_eNB* phy_vars_eNB,module_id_t UE_id,uint8_t subframe);
|
||||
|
||||
void lte_eNB_I0_measurements(PHY_VARS_eNB *phy_vars_eNb,
|
||||
void lte_eNB_I0_measurements(PHY_VARS_eNB *phy_vars_eNB,
|
||||
int subframe,
|
||||
module_id_t eNB_id,
|
||||
unsigned char clear);
|
||||
|
||||
void lte_eNB_I0_measurements_emul(PHY_VARS_eNB *phy_vars_eNb,
|
||||
void lte_eNB_I0_measurements_emul(PHY_VARS_eNB *phy_vars_eNB,
|
||||
uint8_t sect_id);
|
||||
|
||||
|
||||
void lte_eNB_srs_measurements(PHY_VARS_eNB *phy_vars_eNb,
|
||||
void lte_eNB_srs_measurements(PHY_VARS_eNB *phy_vars_eNBy,
|
||||
module_id_t eNB_id,
|
||||
module_id_t UE_id,
|
||||
unsigned char init_averaging);
|
||||
|
||||
@@ -700,24 +700,28 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue,
|
||||
|
||||
void (*idft)(int16_t *,int16_t *, int);
|
||||
|
||||
switch (phy_vars_ue->lte_frame_parms.log2_symbol_size) {
|
||||
case 7:
|
||||
switch (phy_vars_ue->lte_frame_parms.ofdm_symbol_size) {
|
||||
case 128:
|
||||
idft = idft128;
|
||||
break;
|
||||
|
||||
case 8:
|
||||
case 256:
|
||||
idft = idft256;
|
||||
break;
|
||||
|
||||
case 9:
|
||||
case 512:
|
||||
idft = idft512;
|
||||
break;
|
||||
|
||||
case 10:
|
||||
case 1024:
|
||||
idft = idft1024;
|
||||
break;
|
||||
|
||||
case 11:
|
||||
case 1536:
|
||||
idft = idft1536;
|
||||
break;
|
||||
|
||||
case 2048:
|
||||
idft = idft2048;
|
||||
break;
|
||||
|
||||
|
||||
@@ -39,57 +39,36 @@
|
||||
int32_t rx_power_avg_eNB[3][3];
|
||||
|
||||
|
||||
void lte_eNB_I0_measurements(PHY_VARS_eNB *phy_vars_eNb,
|
||||
void lte_eNB_I0_measurements(PHY_VARS_eNB *phy_vars_eNB,
|
||||
int subframe,
|
||||
unsigned char eNB_id,
|
||||
unsigned char clear)
|
||||
{
|
||||
|
||||
LTE_eNB_COMMON *eNB_common_vars = &phy_vars_eNb->lte_eNB_common_vars;
|
||||
LTE_DL_FRAME_PARMS *frame_parms = &phy_vars_eNb->lte_frame_parms;
|
||||
PHY_MEASUREMENTS_eNB *phy_measurements = &phy_vars_eNb->PHY_measurements_eNB[eNB_id];
|
||||
|
||||
LTE_eNB_COMMON *eNB_common_vars = &phy_vars_eNB->lte_eNB_common_vars;
|
||||
LTE_DL_FRAME_PARMS *frame_parms = &phy_vars_eNB->lte_frame_parms;
|
||||
PHY_MEASUREMENTS_eNB *phy_measurements = &phy_vars_eNB->PHY_measurements_eNB[eNB_id];
|
||||
int32_t *rb_mask = phy_vars_eNB->rb_mask_ul;
|
||||
|
||||
uint32_t aarx,rx_power_correction;
|
||||
uint32_t rb;
|
||||
int32_t *ul_ch;
|
||||
int32_t n0_power_tot;
|
||||
|
||||
int len;
|
||||
int offset;
|
||||
int Nsymb = (frame_parms->Ncp==NORMAL)?14:12;
|
||||
// noise measurements
|
||||
// for the moment we measure the noise on the 7th OFDM symbol (in S subframe)
|
||||
|
||||
phy_measurements->n0_power_tot = 0;
|
||||
|
||||
/* printf("rxdataF0 %p, rxdataF1 %p\n",
|
||||
(&eNB_common_vars->rxdataF[0][0][(frame_parms->ofdm_symbol_size + frame_parms->first_carrier_offset)<<1 ]),
|
||||
(&eNB_common_vars->rxdataF[0][1][(frame_parms->ofdm_symbol_size + frame_parms->first_carrier_offset)<<1 ]));
|
||||
*/
|
||||
/*
|
||||
for (i=0;i<512;i++)
|
||||
printf("sector 0 antenna 0 : %d,%d\n",((short *)&eNB_common_vars->rxdataF[0][0][(19*frame_parms->ofdm_symbol_size)<<1])[i<<1],
|
||||
((short *)&eNB_common_vars->rxdataF[0][0][(19*frame_parms->ofdm_symbol_size)<<1])[1+(i<<1)]);
|
||||
|
||||
for (i=0;i<12;i++)
|
||||
// printf("sector 0 antenna 1 : %d,%d\n",((short *)&eNB_common_vars->rxdataF[0][1][(19*frame_parms->ofdm_symbol_size)<<1])[i<<1],
|
||||
((short *)&eNB_common_vars->rxdataF[0][1][(19*frame_parms->ofdm_symbol_size)<<1])[1+(i<<1)]);
|
||||
*/
|
||||
|
||||
if ( (frame_parms->ofdm_symbol_size == 128) ||
|
||||
(frame_parms->ofdm_symbol_size == 512) )
|
||||
rx_power_correction = 2;
|
||||
else
|
||||
rx_power_correction = 1;
|
||||
|
||||
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
|
||||
if (clear == 1)
|
||||
phy_measurements->n0_power[aarx]=0;
|
||||
|
||||
#ifdef USER_MODE
|
||||
|
||||
phy_measurements->n0_power[aarx] = ((k1*signal_energy(&eNB_common_vars->rxdata[eNB_id][aarx][(frame_parms->samples_per_tti<<1) -frame_parms->ofdm_symbol_size],
|
||||
frame_parms->ofdm_symbol_size)) + k2*phy_measurements->n0_power[aarx])>>10;
|
||||
#else
|
||||
phy_measurements->n0_power[aarx] = ((k1*signal_energy(&eNB_common_vars->rxdata[eNB_id][aarx][(frame_parms->samples_per_tti<<1) -frame_parms->ofdm_symbol_size],
|
||||
frame_parms->ofdm_symbol_size))+k2*phy_measurements->n0_power[aarx])>>10;
|
||||
#endif
|
||||
phy_measurements->n0_power[aarx] = (phy_measurements->n0_power[aarx] * 12*frame_parms->N_RB_DL)/(frame_parms->ofdm_symbol_size);
|
||||
phy_measurements->n0_power_dB[aarx] = (unsigned short) dB_fixed(phy_measurements->n0_power[aarx]);
|
||||
phy_measurements->n0_power_tot += phy_measurements->n0_power[aarx];
|
||||
@@ -97,52 +76,49 @@ void lte_eNB_I0_measurements(PHY_VARS_eNB *phy_vars_eNb,
|
||||
|
||||
phy_measurements->n0_power_tot_dB = (unsigned short) dB_fixed(phy_measurements->n0_power_tot);
|
||||
|
||||
phy_measurements->n0_power_tot_dBm = phy_measurements->n0_power_tot_dB - phy_vars_eNb->rx_total_gain_eNB_dB;
|
||||
phy_measurements->n0_power_tot_dBm = phy_measurements->n0_power_tot_dB - phy_vars_eNB->rx_total_gain_eNB_dB;
|
||||
// printf("n0_power %d\n",phy_measurements->n0_power_tot_dB);
|
||||
|
||||
|
||||
for (rb=0; rb<frame_parms->N_RB_UL; rb++) {
|
||||
|
||||
n0_power_tot=0;
|
||||
if ((rb_mask[rb>>5]&(1<<(rb&31))) == 0) { // check that rb was not used in this subframe
|
||||
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
|
||||
|
||||
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
|
||||
// select the 7th symbol in an uplink subframe
|
||||
offset = (frame_parms->first_carrier_offset + (rb*12))%frame_parms->ofdm_symbol_size;
|
||||
offset += (7*frame_parms->ofdm_symbol_size);//(((Nsymb*subframe)+7)*frame_parms->ofdm_symbol_size);
|
||||
ul_ch = &eNB_common_vars->rxdataF[eNB_id][aarx][offset];
|
||||
len = 12;
|
||||
// just do first half of middle PRB for odd number of PRBs
|
||||
if (((frame_parms->N_RB_UL&1) == 1) &&
|
||||
(rb==(frame_parms->N_RB_UL>>1))) {
|
||||
len=6;
|
||||
}
|
||||
if (clear == 1)
|
||||
phy_measurements->n0_subband_power[aarx][rb]=0;
|
||||
|
||||
AssertFatal(ul_ch, "RX signal buffer (freq) problem");
|
||||
|
||||
|
||||
if (rb < 12)
|
||||
// ul_ch = &eNB_common_vars->rxdataF[eNB_id][aarx][((19*(frame_parms->ofdm_symbol_size)) + frame_parms->first_carrier_offset + (rb*12))<<1];
|
||||
ul_ch = &eNB_common_vars->rxdataF[eNB_id][aarx][((7*frame_parms->ofdm_symbol_size) + frame_parms->first_carrier_offset + (rb*12))<<1];
|
||||
else if (rb>12)
|
||||
ul_ch = &eNB_common_vars->rxdataF[eNB_id][aarx][((7*frame_parms->ofdm_symbol_size) + 6 + (rb-13)*12)<<1];
|
||||
else {
|
||||
ul_ch = NULL;
|
||||
}
|
||||
|
||||
if (clear == 1)
|
||||
phy_measurements->n0_subband_power[aarx][rb]=0;
|
||||
|
||||
if (ul_ch) {
|
||||
// for (i=0;i<24;i+=2)
|
||||
// printf("re %d => %d\n",i/2,ul_ch[i]);
|
||||
phy_measurements->n0_subband_power[aarx][rb] = ((k1*(signal_energy_nodc(ul_ch,
|
||||
24))*rx_power_correction) + (k2*phy_measurements->n0_subband_power[aarx][rb]))>>11; // 11 and 24 to compensate for repeated signal format
|
||||
|
||||
phy_measurements->n0_subband_power_dB[aarx][rb] = dB_fixed(phy_measurements->n0_subband_power[aarx][rb]);
|
||||
// printf("eNb %d, aarx %d, rb %d : energy %d (%d dB)\n",eNB_id,aarx,rb,signal_energy_nodc(ul_ch,24), phy_measurements->n0_subband_power_dB[aarx][rb]);
|
||||
n0_power_tot += phy_measurements->n0_subband_power[aarx][rb];
|
||||
} else {
|
||||
phy_measurements->n0_subband_power[aarx][rb] = 1;
|
||||
phy_measurements->n0_subband_power_dB[aarx][rb] = -99;
|
||||
n0_power_tot = 1;
|
||||
phy_measurements->n0_subband_power[aarx][rb] = signal_energy_nodc(ul_ch,len);
|
||||
//((k1*(signal_energy_nodc(ul_ch,len)))
|
||||
// + (k2*phy_measurements->n0_subband_power[aarx][rb]));
|
||||
|
||||
phy_measurements->n0_subband_power_dB[aarx][rb] = dB_fixed(phy_measurements->n0_subband_power[aarx][rb]);
|
||||
// printf("subframe %d (%d): eNb %d, aarx %d, rb %d len %d: energy %d (%d dB)\n",subframe,offset,eNB_id,aarx,rb,len,signal_energy_nodc(ul_ch,len),
|
||||
// phy_measurements->n0_subband_power_dB[aarx][rb]);
|
||||
n0_power_tot += phy_measurements->n0_subband_power[aarx][rb];
|
||||
}
|
||||
|
||||
phy_measurements->n0_subband_power_tot_dB[rb] = dB_fixed(n0_power_tot);
|
||||
phy_measurements->n0_subband_power_tot_dBm[rb] = phy_measurements->n0_subband_power_tot_dB[rb] - phy_vars_eNB->rx_total_gain_eNB_dB - dB_fixed(frame_parms->N_RB_UL);
|
||||
|
||||
}
|
||||
|
||||
phy_measurements->n0_subband_power_tot_dB[rb] = dB_fixed(n0_power_tot);
|
||||
phy_measurements->n0_subband_power_tot_dBm[rb] = phy_measurements->n0_subband_power_tot_dB[rb] - phy_vars_eNb->rx_total_gain_eNB_dB - 14;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void lte_eNB_srs_measurements(PHY_VARS_eNB *phy_vars_eNb,
|
||||
unsigned char eNB_id,
|
||||
unsigned char UE_id,
|
||||
|
||||
@@ -61,7 +61,6 @@ int lte_sync_time_init(LTE_DL_FRAME_PARMS *frame_parms ) // LTE_UE_COMMON *com
|
||||
{
|
||||
|
||||
int i,k;
|
||||
//unsigned short ds = frame_parms->log2_symbol_size - 7;
|
||||
|
||||
sync_corr_ue0 = (int *)malloc16(LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*sizeof(int)*frame_parms->samples_per_tti);
|
||||
sync_corr_ue1 = (int *)malloc16(LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*sizeof(int)*frame_parms->samples_per_tti);
|
||||
@@ -184,13 +183,6 @@ int lte_sync_time_init(LTE_DL_FRAME_PARMS *frame_parms ) // LTE_UE_COMMON *com
|
||||
LOG_E(PHY,"Unsupported N_RB_DL %d\n",frame_parms->N_RB_DL);
|
||||
break;
|
||||
}
|
||||
/*
|
||||
frame_parms->twiddle_ifft, /// complex twiddle factors
|
||||
frame_parms->rev, /// bit reversed permutation vector
|
||||
frame_parms->log2_symbol_size,/// log2(FFT_SIZE)
|
||||
(frame_parms->log2_symbol_size/2),
|
||||
0); /// 0 - input is in complex Q1.15 format, 1 - input is in complex redundant Q1.15 format)
|
||||
*/
|
||||
|
||||
for (i=0; i<frame_parms->ofdm_symbol_size; i++)
|
||||
((int32_t*)primary_synch0_time)[i] = sync_tmp[i];
|
||||
|
||||
@@ -432,7 +432,7 @@ int32_t lte_ul_channel_estimation(PHY_VARS_eNB *phy_vars_eNB,
|
||||
in_fft_ptr_0 = &temp_in_fft_0[0];
|
||||
in_fft_ptr_1 = &temp_in_fft_1[0];
|
||||
|
||||
for(j=0; j<(1<<(frame_parms->log2_symbol_size))/12; j++) {
|
||||
for(j=0; j<(frame_parms->ofdm_symbol_size)/12; j++) {
|
||||
if (j>19) {
|
||||
((int16_t*)in_fft_ptr_0)[-40+(2*j)] = ((int16_t*)temp_out_ifft_0)[-80+(2*j)]*rx_power_correction;
|
||||
((int16_t*)in_fft_ptr_0)[-40+(2*j)+1] = ((int16_t*)temp_out_ifft_0)[-80+(2*j+1)]*rx_power_correction;
|
||||
|
||||
@@ -72,7 +72,7 @@ int lte_dl_cell_spec_SS(PHY_VARS_eNB *phy_vars_eNB,
|
||||
else if ((p==1) && (l>0))
|
||||
nu = 0;
|
||||
else {
|
||||
msg("lte_dl_cell_spec: p %d, l %d -> ERROR\n",p,l);
|
||||
printf("lte_dl_cell_spec: p %d, l %d -> ERROR\n",p,l);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
@@ -94,9 +94,9 @@ int lte_dl_cell_spec_SS(PHY_VARS_eNB *phy_vars_eNB,
|
||||
output[k] = qpsk[(phy_vars_eNB->lte_gold_table[Ns][l][mprime_dword]>>(2*mprime_qpsk_symb))&3];
|
||||
//output[k] = (lte_gold_table[eNB_offset][Ns][l][mprime_dword]>>(2*mprime_qpsk_symb))&3;
|
||||
#ifdef DEBUG_DL_CELL_SPEC
|
||||
msg("Ns %d, l %d, m %d,mprime_dword %d, mprime_qpsk_symbol %d\n",
|
||||
printf("Ns %d, l %d, m %d,mprime_dword %d, mprime_qpsk_symbol %d\n",
|
||||
Ns,l,m,mprime_dword,mprime_qpsk_symb);
|
||||
msg("index = %d (k %d)\n",(phy_vars_eNB->lte_gold_table[Ns][l][mprime_dword]>>(2*mprime_qpsk_symb))&3,k);
|
||||
printf("index = %d (k %d)\n",(phy_vars_eNB->lte_gold_table[Ns][l][mprime_dword]>>(2*mprime_qpsk_symb))&3,k);
|
||||
#endif
|
||||
|
||||
mprime++;
|
||||
@@ -151,7 +151,7 @@ int lte_dl_cell_spec(PHY_VARS_eNB *phy_vars_eNB,
|
||||
else if ((p==1) && (l>0))
|
||||
nu = 0;
|
||||
else {
|
||||
msg("lte_dl_cell_spec: p %d, l %d -> ERROR\n",p,l);
|
||||
printf("lte_dl_cell_spec: p %d, l %d -> ERROR\n",p,l);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
@@ -177,9 +177,9 @@ int lte_dl_cell_spec(PHY_VARS_eNB *phy_vars_eNB,
|
||||
output[k] = qpsk[(phy_vars_eNB->lte_gold_table[Ns][l][mprime_dword]>>(2*mprime_qpsk_symb))&3];
|
||||
//output[k] = (lte_gold_table[eNB_offset][Ns][l][mprime_dword]>>(2*mprime_qpsk_symb))&3;
|
||||
#ifdef DEBUG_DL_CELL_SPEC
|
||||
msg("Ns %d, l %d, m %d,mprime_dword %d, mprime_qpsk_symbol %d\n",
|
||||
printf("Ns %d, l %d, m %d,mprime_dword %d, mprime_qpsk_symbol %d\n",
|
||||
Ns,l,m,mprime_dword,mprime_qpsk_symb);
|
||||
msg("index = %d (k %d)\n",(phy_vars_eNB->lte_gold_table[Ns][l][mprime_dword]>>(2*mprime_qpsk_symb))&3,k);
|
||||
printf("index = %d (k %d)\n",(phy_vars_eNB->lte_gold_table[Ns][l][mprime_dword]>>(2*mprime_qpsk_symb))&3,k);
|
||||
#endif
|
||||
|
||||
mprime++;
|
||||
|
||||
@@ -2108,14 +2108,14 @@ uint8_t generate_dci_top(uint8_t num_ue_spec_dci,
|
||||
if (dci_alloc[i].L == (uint8_t)L) {
|
||||
|
||||
#ifdef DEBUG_DCI_ENCODING
|
||||
LOG_I(PHY,"Generating common DCI %d/%d (nCCE %d) of length %d, aggregation %d (%x)\n",i,num_common_dci,dci_alloc[i].nCCE,dci_alloc[i].dci_length,1<<dci_alloc[i].L,
|
||||
LOG_I(PHY,"Generating common DCI %d/%d (nCCE %d) of length %d, aggregation %d (%x)\n",i,num_common_dci,dci_alloc[i].firstCCE,dci_alloc[i].dci_length,1<<dci_alloc[i].L,
|
||||
*(unsigned int*)dci_alloc[i].dci_pdu);
|
||||
dump_dci(frame_parms,&dci_alloc[i]);
|
||||
#endif
|
||||
|
||||
if (dci_alloc[i].nCCE>=0) {
|
||||
if (dci_alloc[i].firstCCE>=0) {
|
||||
e_ptr = generate_dci0(dci_alloc[i].dci_pdu,
|
||||
e+(72*dci_alloc[i].nCCE),
|
||||
e+(72*dci_alloc[i].firstCCE),
|
||||
dci_alloc[i].dci_length,
|
||||
dci_alloc[i].L,
|
||||
dci_alloc[i].rnti);
|
||||
@@ -2133,9 +2133,9 @@ uint8_t generate_dci_top(uint8_t num_ue_spec_dci,
|
||||
dump_dci(frame_parms,&dci_alloc[i]);
|
||||
#endif
|
||||
|
||||
if (dci_alloc[i].nCCE >= 0) {
|
||||
if (dci_alloc[i].firstCCE >= 0) {
|
||||
e_ptr = generate_dci0(dci_alloc[i].dci_pdu,
|
||||
e+(72*dci_alloc[i].nCCE),
|
||||
e+(72*dci_alloc[i].firstCCE),
|
||||
dci_alloc[i].dci_length,
|
||||
dci_alloc[i].L,
|
||||
dci_alloc[i].rnti);
|
||||
@@ -2537,13 +2537,116 @@ uint16_t get_nquad(uint8_t num_pdcch_symbols,LTE_DL_FRAME_PARMS *frame_parms,uin
|
||||
return(Nreg - 4 - (3*Ngroup_PHICH));
|
||||
}
|
||||
|
||||
uint16_t get_nCCE_max(uint8_t Mod_id,uint8_t CC_id)
|
||||
uint16_t get_nCCE_mac(uint8_t Mod_id,uint8_t CC_id,int num_pdcch_symbols,int subframe)
|
||||
{
|
||||
|
||||
// check for eNB only !
|
||||
return(get_nCCE(3,&PHY_vars_eNB_g[Mod_id][CC_id]->lte_frame_parms,1)); // 5, 15,21
|
||||
return(get_nCCE(num_pdcch_symbols,
|
||||
&PHY_vars_eNB_g[Mod_id][CC_id]->lte_frame_parms,
|
||||
get_mi(&PHY_vars_eNB_g[Mod_id][CC_id]->lte_frame_parms,subframe)));
|
||||
}
|
||||
|
||||
|
||||
int get_nCCE_offset_l1(int *CCE_table,
|
||||
const unsigned char L,
|
||||
const int nCCE,
|
||||
const int common_dci,
|
||||
const unsigned short rnti,
|
||||
const unsigned char subframe)
|
||||
{
|
||||
|
||||
int search_space_free,m,nb_candidates = 0,l,i;
|
||||
unsigned int Yk;
|
||||
/*
|
||||
printf("CCE Allocation: ");
|
||||
for (i=0;i<nCCE;i++)
|
||||
printf("%d.",CCE_table[i]);
|
||||
printf("\n");
|
||||
*/
|
||||
if (common_dci == 1) {
|
||||
// check CCE(0 ... L-1)
|
||||
nb_candidates = (L==4) ? 4 : 2;
|
||||
nb_candidates = min(nb_candidates,nCCE/L);
|
||||
|
||||
// printf("Common DCI nb_candidates %d, L %d\n",nb_candidates,L);
|
||||
|
||||
for (m = nb_candidates-1 ; m >=0 ; m--) {
|
||||
|
||||
search_space_free = 1;
|
||||
for (l=0; l<L; l++) {
|
||||
|
||||
// printf("CCE_table[%d] %d\n",(m*L)+l,CCE_table[(m*L)+l]);
|
||||
if (CCE_table[(m*L) + l] == 1) {
|
||||
search_space_free = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (search_space_free == 1) {
|
||||
|
||||
// printf("returning %d\n",m*L);
|
||||
|
||||
for (l=0; l<L; l++)
|
||||
CCE_table[(m*L)+l]=1;
|
||||
return(m*L);
|
||||
}
|
||||
}
|
||||
|
||||
return(-1);
|
||||
|
||||
} else { // Find first available in ue specific search space
|
||||
// according to procedure in Section 9.1.1 of 36.213 (v. 8.6)
|
||||
// compute Yk
|
||||
Yk = (unsigned int)rnti;
|
||||
|
||||
for (i=0; i<=subframe; i++)
|
||||
Yk = (Yk*39827)%65537;
|
||||
|
||||
Yk = Yk % (nCCE/L);
|
||||
|
||||
|
||||
switch (L) {
|
||||
case 1:
|
||||
case 2:
|
||||
nb_candidates = 6;
|
||||
break;
|
||||
|
||||
case 4:
|
||||
case 8:
|
||||
nb_candidates = 2;
|
||||
break;
|
||||
|
||||
default:
|
||||
DevParam(L, nCCE, rnti);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
LOG_D(MAC,"rnti %x, Yk = %d, nCCE %d (nCCE/L %d),nb_cand %d\n",rnti,Yk,nCCE,nCCE/L,nb_candidates);
|
||||
|
||||
for (m = 0 ; m < nb_candidates ; m++) {
|
||||
search_space_free = 1;
|
||||
|
||||
for (l=0; l<L; l++) {
|
||||
if (CCE_table[(((Yk+m)%(nCCE/L))*L) + l] == 1) {
|
||||
search_space_free = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (search_space_free == 1) {
|
||||
for (l=0; l<L; l++)
|
||||
CCE_table[(((Yk+m)%(nCCE/L))*L)+l]=1;
|
||||
|
||||
return(((Yk+m)%(nCCE/L))*L);
|
||||
}
|
||||
}
|
||||
|
||||
return(-1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void dci_decoding_procedure0(LTE_UE_PDCCH **lte_ue_pdcch_vars,
|
||||
int do_common,
|
||||
uint8_t subframe,
|
||||
@@ -2691,7 +2794,7 @@ void dci_decoding_procedure0(LTE_UE_PDCCH **lte_ue_pdcch_vars,
|
||||
dci_alloc[*dci_cnt].dci_length = sizeof_bits;
|
||||
dci_alloc[*dci_cnt].rnti = crc;
|
||||
dci_alloc[*dci_cnt].L = L;
|
||||
dci_alloc[*dci_cnt].nCCE = CCEind;
|
||||
dci_alloc[*dci_cnt].firstCCE = CCEind;
|
||||
|
||||
if (sizeof_bytes<=4) {
|
||||
dci_alloc[*dci_cnt].dci_pdu[3] = dci_decoded_output[0];
|
||||
|
||||
@@ -453,7 +453,7 @@ uint32_t conv_1C_RIV(int32_t rballoc,uint32_t N_RB_DL) {
|
||||
|
||||
}
|
||||
|
||||
int get_prb(int N_RB_DL,int odd_slot,int vrb,int Ngap) {
|
||||
uint32_t get_prb(int N_RB_DL,int odd_slot,int vrb,int Ngap) {
|
||||
|
||||
int offset;
|
||||
|
||||
@@ -926,10 +926,15 @@ int generate_eNB_dlsch_params_from_dci(int frame,
|
||||
// printf("FDD 1A: mcs %d, rballoc %x,rv %d, NPRB %d\n",mcs,rballoc,rv,NPRB);
|
||||
}
|
||||
|
||||
|
||||
dlsch0_harq = dlsch[0]->harq_processes[harq_pid];
|
||||
|
||||
dlsch0_harq->rb_alloc[0] = localRIV2alloc_LUT6[rballoc];
|
||||
if (vrb_type==LOCALIZED) {
|
||||
dlsch0_harq->rb_alloc[0] = localRIV2alloc_LUT6[rballoc];
|
||||
}
|
||||
else {
|
||||
LOG_E(PHY,"Distributed RB allocation not done yet\n");
|
||||
mac_xface->macphy_exit("exiting");
|
||||
}
|
||||
dlsch0_harq->vrb_type = vrb_type;
|
||||
dlsch0_harq->nb_rb = RIV2nb_rb_LUT6[rballoc];//NPRB;
|
||||
RIV_max = RIV_max6;
|
||||
@@ -960,7 +965,14 @@ int generate_eNB_dlsch_params_from_dci(int frame,
|
||||
|
||||
dlsch0_harq = dlsch[0]->harq_processes[harq_pid];
|
||||
|
||||
dlsch0_harq->rb_alloc[0] = localRIV2alloc_LUT25[rballoc];
|
||||
|
||||
if (vrb_type==LOCALIZED) {
|
||||
dlsch0_harq->rb_alloc[0] = localRIV2alloc_LUT25[rballoc];
|
||||
}
|
||||
else {
|
||||
LOG_E(PHY,"Distributed RB allocation not done yet\n");
|
||||
mac_xface->macphy_exit("exiting");
|
||||
}
|
||||
dlsch0_harq->vrb_type = vrb_type;
|
||||
dlsch0_harq->nb_rb = RIV2nb_rb_LUT25[rballoc];//NPRB;
|
||||
RIV_max = RIV_max25;
|
||||
@@ -987,9 +999,16 @@ int generate_eNB_dlsch_params_from_dci(int frame,
|
||||
}
|
||||
|
||||
dlsch0_harq = dlsch[0]->harq_processes[harq_pid];
|
||||
if (vrb_type==LOCALIZED) {
|
||||
dlsch0_harq->rb_alloc[0] = localRIV2alloc_LUT50_0[rballoc];
|
||||
dlsch0_harq->rb_alloc[1] = localRIV2alloc_LUT50_1[rballoc];
|
||||
}
|
||||
else {
|
||||
LOG_E(PHY,"Distributed RB allocation not done yet\n");
|
||||
mac_xface->macphy_exit("exiting");
|
||||
}
|
||||
|
||||
|
||||
dlsch0_harq->rb_alloc[0] = localRIV2alloc_LUT50_0[rballoc];
|
||||
dlsch0_harq->rb_alloc[1] = localRIV2alloc_LUT50_1[rballoc];
|
||||
dlsch0_harq->vrb_type = vrb_type;
|
||||
dlsch0_harq->nb_rb = RIV2nb_rb_LUT50[rballoc];//NPRB;
|
||||
RIV_max = RIV_max50;
|
||||
@@ -1017,10 +1036,17 @@ int generate_eNB_dlsch_params_from_dci(int frame,
|
||||
dlsch0_harq = dlsch[0]->harq_processes[harq_pid];
|
||||
|
||||
dlsch0_harq->vrb_type = vrb_type;
|
||||
dlsch0_harq->rb_alloc[0] = localRIV2alloc_LUT100_0[rballoc];
|
||||
dlsch0_harq->rb_alloc[1] = localRIV2alloc_LUT100_1[rballoc];
|
||||
dlsch0_harq->rb_alloc[2] = localRIV2alloc_LUT100_2[rballoc];
|
||||
dlsch0_harq->rb_alloc[3] = localRIV2alloc_LUT100_3[rballoc];
|
||||
if (vrb_type==LOCALIZED) {
|
||||
dlsch0_harq->rb_alloc[0] = localRIV2alloc_LUT100_0[rballoc];
|
||||
dlsch0_harq->rb_alloc[1] = localRIV2alloc_LUT100_1[rballoc];
|
||||
dlsch0_harq->rb_alloc[2] = localRIV2alloc_LUT100_2[rballoc];
|
||||
dlsch0_harq->rb_alloc[3] = localRIV2alloc_LUT100_3[rballoc];
|
||||
}
|
||||
else {
|
||||
LOG_E(PHY,"Distributed RB allocation not done yet\n");
|
||||
mac_xface->macphy_exit("exiting");
|
||||
}
|
||||
|
||||
|
||||
|
||||
dlsch0_harq->nb_rb = RIV2nb_rb_LUT100[rballoc];//NPRB;
|
||||
@@ -1102,8 +1128,12 @@ int generate_eNB_dlsch_params_from_dci(int frame,
|
||||
|
||||
dlsch[0]->harq_ids[subframe] = harq_pid;
|
||||
|
||||
if (dlsch0_harq->round == 0)
|
||||
if (dlsch0_harq->round == 0) {
|
||||
/* necessary test? */
|
||||
if (dlsch0_harq->status == SCH_IDLE)
|
||||
remove_harq_pid_from_freelist(dlsch[0], harq_pid);
|
||||
dlsch0_harq->status = ACTIVE;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
@@ -1237,6 +1267,9 @@ int generate_eNB_dlsch_params_from_dci(int frame,
|
||||
|
||||
|
||||
if (dlsch0_harq->round == 0) {
|
||||
/* necessary test? */
|
||||
if (dlsch0_harq->status == SCH_IDLE)
|
||||
remove_harq_pid_from_freelist(dlsch[0], harq_pid);
|
||||
dlsch0_harq->status = ACTIVE;
|
||||
// printf("Setting DLSCH process %d to ACTIVE\n",harq_pid);
|
||||
// MCS and TBS don't change across HARQ rounds
|
||||
@@ -1605,10 +1638,16 @@ int generate_eNB_dlsch_params_from_dci(int frame,
|
||||
|
||||
// reset HARQ process if this is the first transmission
|
||||
if (dlsch0_harq->round == 0) {
|
||||
/* necessary test? */
|
||||
if (dlsch0_harq->status == SCH_IDLE)
|
||||
remove_harq_pid_from_freelist(dlsch0, harq_pid);
|
||||
dlsch0_harq->status = ACTIVE;
|
||||
}
|
||||
|
||||
if (dlsch1_harq->round == 0) {
|
||||
/* necessary test? */
|
||||
if (dlsch1_harq->status == SCH_IDLE)
|
||||
remove_harq_pid_from_freelist(dlsch1, harq_pid);
|
||||
dlsch1_harq->status = ACTIVE;
|
||||
}
|
||||
|
||||
@@ -1986,10 +2025,16 @@ int generate_eNB_dlsch_params_from_dci(int frame,
|
||||
|
||||
// reset HARQ process if this is the first transmission
|
||||
if ((dlsch0->active==1) && (dlsch0_harq->round == 0)) {
|
||||
/* necessary test? */
|
||||
if (dlsch0_harq->status == SCH_IDLE)
|
||||
remove_harq_pid_from_freelist(dlsch0, harq_pid);
|
||||
dlsch0_harq->status = ACTIVE;
|
||||
}
|
||||
|
||||
if ((dlsch1->active==1) && (dlsch1_harq->round == 0)) {
|
||||
/* necessary test? */
|
||||
if (dlsch1_harq->status == SCH_IDLE)
|
||||
remove_harq_pid_from_freelist(dlsch1, harq_pid);
|
||||
dlsch1_harq->status = ACTIVE;
|
||||
}
|
||||
|
||||
@@ -2131,16 +2176,23 @@ int generate_eNB_dlsch_params_from_dci(int frame,
|
||||
// check if either TB is disabled (see 36-213 V8.6 p. 26)
|
||||
|
||||
|
||||
if ((dlsch0_harq->rvidx == 1) && (dlsch0_harq->mcs == 0))
|
||||
if ((dlsch0_harq->rvidx == 1) && (dlsch0_harq->mcs == 0)) {
|
||||
LOG_W(PHY, "what to do with respect to remove_harq_pid_from_freelist?\n");
|
||||
dlsch0_harq->status = DISABLED;
|
||||
}
|
||||
|
||||
if ((dlsch1_harq->rvidx == 1) && (dlsch1_harq->mcs == 0))
|
||||
if ((dlsch1_harq->rvidx == 1) && (dlsch1_harq->mcs == 0)) {
|
||||
LOG_W(PHY, "what to do with respect to remove_harq_pid_from_freelist?\n");
|
||||
dlsch1_harq->status = DISABLED;
|
||||
}
|
||||
|
||||
dlsch0_harq->Nl = 1;
|
||||
|
||||
|
||||
if (dlsch0_harq->round == 0) {
|
||||
/* necessary test? */
|
||||
if (dlsch0_harq->status == SCH_IDLE)
|
||||
remove_harq_pid_from_freelist(dlsch0, harq_pid);
|
||||
dlsch0_harq->status = ACTIVE;
|
||||
// printf("Setting DLSCH process %d to ACTIVE\n",harq_pid);
|
||||
}
|
||||
@@ -2305,11 +2357,17 @@ int generate_eNB_dlsch_params_from_dci(int frame,
|
||||
|
||||
|
||||
if ((dlsch0_harq->round == 0) && (dlsch0->active == 1) ) {
|
||||
/* necessary test? */
|
||||
if (dlsch0_harq->status == SCH_IDLE)
|
||||
remove_harq_pid_from_freelist(dlsch0, harq_pid);
|
||||
dlsch0_harq->status = ACTIVE;
|
||||
dlsch0_harq->mcs = mcs1;
|
||||
}
|
||||
|
||||
if ((dlsch1_harq->round == 0) && (dlsch1->active == 1) ) {
|
||||
/* necessary test? */
|
||||
if (dlsch1_harq->status == SCH_IDLE)
|
||||
remove_harq_pid_from_freelist(dlsch1, harq_pid);
|
||||
dlsch1_harq->status = ACTIVE;
|
||||
dlsch1_harq->mcs = mcs2;
|
||||
}
|
||||
@@ -2473,6 +2531,9 @@ int generate_eNB_dlsch_params_from_dci(int frame,
|
||||
|
||||
|
||||
if (dlsch0_harq->round == 0) {
|
||||
/* necessary test? */
|
||||
if (dlsch0_harq->status == SCH_IDLE)
|
||||
remove_harq_pid_from_freelist(dlsch0, harq_pid);
|
||||
dlsch0_harq->status = ACTIVE;
|
||||
// printf("Setting DLSCH process %d to ACTIVE\n",harq_pid);
|
||||
}
|
||||
@@ -2602,6 +2663,9 @@ int generate_eNB_dlsch_params_from_dci(int frame,
|
||||
|
||||
// dlsch0_harq->Ndi = ((DCI1E_5MHz_2A_M10PRB_TDD_t *)dci_pdu)->ndi;
|
||||
if (dlsch0_harq->round == 0) {
|
||||
/* necessary test? */
|
||||
if (dlsch0_harq->status == SCH_IDLE)
|
||||
remove_harq_pid_from_freelist(dlsch0, harq_pid);
|
||||
dlsch0_harq->status = ACTIVE;
|
||||
// printf("Setting DLSCH process %d to ACTIVE\n",harq_pid);
|
||||
}
|
||||
@@ -2644,17 +2708,17 @@ int generate_eNB_dlsch_params_from_dci(int frame,
|
||||
#ifdef DEBUG_DCI
|
||||
|
||||
if (dlsch0) {
|
||||
msg("dlsch0 eNB: dlsch0 %p\n",dlsch0);
|
||||
msg("dlsch0 eNB: rnti %x\n",dlsch0->rnti);
|
||||
msg("dlsch0 eNB: NBRB %d\n",dlsch0_harq->nb_rb);
|
||||
msg("dlsch0 eNB: rballoc %x\n",dlsch0_harq->rb_alloc[0]);
|
||||
msg("dlsch0 eNB: harq_pid %d\n",harq_pid);
|
||||
msg("dlsch0 eNB: round %d\n",dlsch0_harq->round);
|
||||
msg("dlsch0 eNB: rvidx %d\n",dlsch0_harq->rvidx);
|
||||
msg("dlsch0 eNB: TBS %d (NPRB %d)\n",dlsch0_harq->TBS,NPRB);
|
||||
msg("dlsch0 eNB: mcs %d\n",dlsch0_harq->mcs);
|
||||
msg("dlsch0 eNB: tpmi %d\n",tpmi);
|
||||
msg("dlsch0 eNB: mimo_mode %d\n",dlsch0_harq->mimo_mode);
|
||||
printf("dlsch0 eNB: dlsch0 %p\n",dlsch0);
|
||||
printf("dlsch0 eNB: rnti %x\n",dlsch0->rnti);
|
||||
printf("dlsch0 eNB: NBRB %d\n",dlsch0_harq->nb_rb);
|
||||
printf("dlsch0 eNB: rballoc %x\n",dlsch0_harq->rb_alloc[0]);
|
||||
printf("dlsch0 eNB: harq_pid %d\n",harq_pid);
|
||||
printf("dlsch0 eNB: round %d\n",dlsch0_harq->round);
|
||||
printf("dlsch0 eNB: rvidx %d\n",dlsch0_harq->rvidx);
|
||||
printf("dlsch0 eNB: TBS %d (NPRB %d)\n",dlsch0_harq->TBS,NPRB);
|
||||
printf("dlsch0 eNB: mcs %d\n",dlsch0_harq->mcs);
|
||||
printf("dlsch0 eNB: tpmi %d\n",tpmi);
|
||||
printf("dlsch0 eNB: mimo_mode %d\n",dlsch0_harq->mimo_mode);
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -5511,15 +5575,15 @@ int generate_ue_dlsch_params_from_dci(int frame,
|
||||
#ifdef DEBUG_DCI
|
||||
|
||||
if (dlsch[0]) {
|
||||
msg("PDSCH dlsch0 UE: rnti %x\n",dlsch[0]->rnti);
|
||||
msg("PDSCH dlsch0 UE: NBRB %d\n",dlsch0_harq->nb_rb);
|
||||
msg("PDSCH dlsch0 UE: rballoc %x\n",dlsch0_harq->rb_alloc[0]);
|
||||
msg("PDSCH dlsch0 UE: harq_pid %d\n",harq_pid);
|
||||
msg("PDSCH dlsch0 UE: DCINdi %d\n",dlsch0_harq->DCINdi);
|
||||
msg("PDSCH dlsch0 UE: rvidx %d\n",dlsch0_harq->rvidx);
|
||||
msg("PDSCH dlsch0 UE: TBS %d\n",dlsch0_harq->TBS);
|
||||
msg("PDSCH dlsch0 UE: mcs %d\n",dlsch0_harq->mcs);
|
||||
msg("PDSCH dlsch0 UE: pwr_off %d\n",dlsch0_harq->dl_power_off);
|
||||
printf("PDSCH dlsch0 UE: rnti %x\n",dlsch[0]->rnti);
|
||||
printf("PDSCH dlsch0 UE: NBRB %d\n",dlsch0_harq->nb_rb);
|
||||
printf("PDSCH dlsch0 UE: rballoc %x\n",dlsch0_harq->rb_alloc_even[0]);
|
||||
printf("PDSCH dlsch0 UE: harq_pid %d\n",harq_pid);
|
||||
printf("PDSCH dlsch0 UE: DCINdi %d\n",dlsch0_harq->DCINdi);
|
||||
printf("PDSCH dlsch0 UE: rvidx %d\n",dlsch0_harq->rvidx);
|
||||
printf("PDSCH dlsch0 UE: TBS %d\n",dlsch0_harq->TBS);
|
||||
printf("PDSCH dlsch0 UE: mcs %d\n",dlsch0_harq->mcs);
|
||||
printf("PDSCH dlsch0 UE: pwr_off %d\n",dlsch0_harq->dl_power_off);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -260,6 +260,13 @@ typedef struct {
|
||||
uint8_t error_threshold;
|
||||
/// Pointers to 8 HARQ processes for the DLSCH
|
||||
LTE_DL_eNB_HARQ_t *harq_processes[8];
|
||||
/// circular list of free harq PIDs (the oldest come first)
|
||||
/// (10 is arbitrary value, must be > to max number of DL HARQ processes in LTE)
|
||||
int harq_pid_freelist[10];
|
||||
/// the head position of the free list (if list is free then head=tail)
|
||||
int head_freelist;
|
||||
/// the tail position of the free list
|
||||
int tail_freelist;
|
||||
/// Number of soft channel bits
|
||||
uint32_t G;
|
||||
/// Codebook index for this dlsch (0,1,2,3)
|
||||
@@ -268,6 +275,8 @@ typedef struct {
|
||||
uint8_t Mdlharq;
|
||||
/// MIMO transmission mode indicator for this sub-frame (for definition see 36-212 V8.6 2009-03, p.17)
|
||||
uint8_t Kmimo;
|
||||
/// Nsoft parameter related to UE Category
|
||||
uint32_t Nsoft;
|
||||
/// amplitude of PDSCH (compared to RS) in symbols without pilots
|
||||
int16_t sqrt_rho_a;
|
||||
/// amplitude of PDSCH (compared to RS) in symbols containing pilots
|
||||
@@ -578,13 +587,13 @@ typedef struct {
|
||||
/// UL RSSI per receive antenna
|
||||
int32_t UL_rssi[NB_ANTENNAS_RX];
|
||||
/// PUCCH1a/b power (digital linear)
|
||||
int32_t Po_PUCCH;
|
||||
uint32_t Po_PUCCH;
|
||||
/// PUCCH1a/b power (dBm)
|
||||
int32_t Po_PUCCH_dBm;
|
||||
/// PUCCH1 power (digital linear), conditioned on below threshold
|
||||
int32_t Po_PUCCH1_below;
|
||||
uint32_t Po_PUCCH1_below;
|
||||
/// PUCCH1 power (digital linear), conditioned on above threshold
|
||||
int32_t Po_PUCCH1_above;
|
||||
uint32_t Po_PUCCH1_above;
|
||||
/// Indicator that Po_PUCCH has been updated by PHY
|
||||
int32_t Po_PUCCH_update;
|
||||
/// DL Wideband CQI index (2 TBs)
|
||||
@@ -695,6 +704,8 @@ typedef struct {
|
||||
uint8_t Mdlharq;
|
||||
/// MIMO transmission mode indicator for this sub-frame (for definition see 36-212 V8.6 2009-03, p.17)
|
||||
uint8_t Kmimo;
|
||||
/// Nsoft parameter related to UE Category
|
||||
uint32_t Nsoft;
|
||||
/// Maximum number of Turbo iterations
|
||||
uint8_t max_turbo_iterations;
|
||||
/// accumulated tx power adjustment for PUCCH
|
||||
@@ -739,7 +750,7 @@ typedef struct {
|
||||
/// Aggregation level
|
||||
uint8_t L;
|
||||
/// Position of first CCE of the dci
|
||||
int nCCE;
|
||||
int firstCCE;
|
||||
/// flag to indicate that this is a RA response
|
||||
boolean_t ra_flag;
|
||||
/// rnti
|
||||
|
||||
@@ -117,7 +117,7 @@ void free_eNB_dlsch(LTE_eNB_DLSCH_t *dlsch)
|
||||
|
||||
}
|
||||
|
||||
LTE_eNB_DLSCH_t *new_eNB_dlsch(unsigned char Kmimo,unsigned char Mdlharq,unsigned char N_RB_DL, uint8_t abstraction_flag, LTE_DL_FRAME_PARMS* frame_parms)
|
||||
LTE_eNB_DLSCH_t *new_eNB_dlsch(unsigned char Kmimo,unsigned char Mdlharq,uint32_t Nsoft,unsigned char N_RB_DL, uint8_t abstraction_flag, LTE_DL_FRAME_PARMS* frame_parms)
|
||||
{
|
||||
|
||||
LTE_eNB_DLSCH_t *dlsch;
|
||||
@@ -149,10 +149,14 @@ LTE_eNB_DLSCH_t *new_eNB_dlsch(unsigned char Kmimo,unsigned char Mdlharq,unsigne
|
||||
bzero(dlsch,sizeof(LTE_eNB_DLSCH_t));
|
||||
dlsch->Kmimo = Kmimo;
|
||||
dlsch->Mdlharq = Mdlharq;
|
||||
dlsch->Nsoft = Nsoft;
|
||||
|
||||
for (i=0; i<10; i++)
|
||||
dlsch->harq_ids[i] = Mdlharq;
|
||||
|
||||
dlsch->head_freelist = 0;
|
||||
dlsch->tail_freelist = 0;
|
||||
|
||||
for (i=0; i<Mdlharq; i++) {
|
||||
dlsch->harq_processes[i] = (LTE_DL_eNB_HARQ_t *)malloc16(sizeof(LTE_DL_eNB_HARQ_t));
|
||||
LOG_T(PHY, "Required mem size %d (bw scaling %d), dlsch->harq_processes[%d] %p\n",
|
||||
@@ -193,6 +197,8 @@ LTE_eNB_DLSCH_t *new_eNB_dlsch(unsigned char Kmimo,unsigned char Mdlharq,unsigne
|
||||
msg("Can't get harq_p %d\n",i);
|
||||
exit_flag=3;
|
||||
}
|
||||
|
||||
put_harq_pid_in_freelist(dlsch, i);
|
||||
}
|
||||
|
||||
for (i=0; i<4; i++) {
|
||||
@@ -412,7 +418,7 @@ int dlsch_encoding(unsigned char *a,
|
||||
dlsch->harq_processes[harq_pid]->w[r],
|
||||
dlsch->harq_processes[harq_pid]->e+r_offset,
|
||||
dlsch->harq_processes[harq_pid]->C, // C
|
||||
NSOFT, // Nsoft,
|
||||
dlsch->Nsoft, // Nsoft,
|
||||
dlsch->Mdlharq,
|
||||
dlsch->Kmimo,
|
||||
dlsch->harq_processes[harq_pid]->rvidx,
|
||||
|
||||
@@ -81,7 +81,7 @@ void free_ue_dlsch(LTE_UE_DLSCH_t *dlsch)
|
||||
}
|
||||
}
|
||||
|
||||
LTE_UE_DLSCH_t *new_ue_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint8_t max_turbo_iterations,uint8_t N_RB_DL, uint8_t abstraction_flag)
|
||||
LTE_UE_DLSCH_t *new_ue_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint32_t Nsoft,uint8_t max_turbo_iterations,uint8_t N_RB_DL, uint8_t abstraction_flag)
|
||||
{
|
||||
|
||||
LTE_UE_DLSCH_t *dlsch;
|
||||
@@ -113,6 +113,7 @@ LTE_UE_DLSCH_t *new_ue_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint8_t max_turbo_ite
|
||||
memset(dlsch,0,sizeof(LTE_UE_DLSCH_t));
|
||||
dlsch->Kmimo = Kmimo;
|
||||
dlsch->Mdlharq = Mdlharq;
|
||||
dlsch->Nsoft = Nsoft;
|
||||
dlsch->max_turbo_iterations = max_turbo_iterations;
|
||||
|
||||
for (i=0; i<Mdlharq; i++) {
|
||||
@@ -353,7 +354,7 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue,
|
||||
(uint8_t*)&dummy_w[r][0],
|
||||
dlsch_llr+r_offset,
|
||||
harq_process->C,
|
||||
NSOFT,
|
||||
dlsch->Nsoft,
|
||||
dlsch->Mdlharq,
|
||||
dlsch->Kmimo,
|
||||
harq_process->rvidx,
|
||||
|
||||
@@ -675,7 +675,9 @@ int dlsch_qpsk_llr(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
len = (nb_rb*12) - pbch_pss_sss_adjust;
|
||||
}
|
||||
|
||||
|
||||
// printf("dlsch_qpsk_llr: symbol %d,nb_rb %d, len %d,pbch_pss_sss_adjust %d\n",symbol,nb_rb,len,pbch_pss_sss_adjust);
|
||||
|
||||
for (i=0; i<len; i++) {
|
||||
*llr32 = *rxF;
|
||||
// printf("llr %d : (%d,%d)\n",i,((int16_t*)llr32)[0],((int16_t*)llr32)[1]);
|
||||
|
||||
@@ -336,7 +336,9 @@ int initial_sync(PHY_VARS_UE *phy_vars_ue, runmode_t mode)
|
||||
|
||||
#else
|
||||
#ifndef OAI_USRP
|
||||
#ifndef OAI_BLADERF
|
||||
phy_adjust_gain(phy_vars_ue,0);
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
#endif
|
||||
|
||||
extern int mac_get_rrc_status(uint8_t Mod_id,uint8_t eNB_flag,uint8_t index);
|
||||
#if defined(OAI_USRP) || defined(EXMIMO)
|
||||
#if defined(OAI_USRP) || defined(EXMIMO) || defined(OAI_BLADERF)
|
||||
#include "common_lib.h"
|
||||
extern openair0_config_t openair0_cfg[];
|
||||
#endif
|
||||
@@ -67,11 +67,12 @@ int dump_ue_stats(PHY_VARS_UE *phy_vars_ue, char* buffer, int length, runmode_t
|
||||
|
||||
if ((mode == normal_txrx) || (mode == no_L2_connect)) {
|
||||
len += sprintf(&buffer[len], "[UE_PROC] UE %d, RNTI %x\n",phy_vars_ue->Mod_id, phy_vars_ue->lte_ue_pdcch_vars[0]->crnti);
|
||||
len += sprintf(&buffer[len],"[UE PROC] RSRP[0] %.2f dBm/RE, RSSI %.2f dBm, RSRQ[0] %.2f dB, N0 %d dBm/RE\n",
|
||||
len += sprintf(&buffer[len],"[UE PROC] RSRP[0] %.2f dBm/RE, RSSI %.2f dBm, RSRQ[0] %.2f dB, N0 %d dBm/RE (NF %.1f dB)\n",
|
||||
10*log10(phy_vars_ue->PHY_measurements.rsrp[0])-phy_vars_ue->rx_total_gain_dB,
|
||||
10*log10(phy_vars_ue->PHY_measurements.rssi)-phy_vars_ue->rx_total_gain_dB,
|
||||
10*log10(phy_vars_ue->PHY_measurements.rsrq[0]),
|
||||
phy_vars_ue->PHY_measurements.n0_power_tot_dBm);
|
||||
phy_vars_ue->PHY_measurements.n0_power_tot_dBm,
|
||||
(double)phy_vars_ue->PHY_measurements.n0_power_tot_dBm+132.24);
|
||||
|
||||
/*
|
||||
len += sprintf(&buffer[len],
|
||||
@@ -96,10 +97,10 @@ int dump_ue_stats(PHY_VARS_UE *phy_vars_ue, char* buffer, int length, runmode_t
|
||||
#ifdef EXMIMO
|
||||
len += sprintf(&buffer[len], "[UE PROC] RX Gain %d dB (LNA %d, vga %d dB)\n",phy_vars_ue->rx_total_gain_dB, openair0_cfg[0].rxg_mode[0],(int)openair0_cfg[0].rx_gain[0]);
|
||||
#endif
|
||||
#ifdef OAI_USRP
|
||||
#if defined(OAI_USRP) || defined(OAI_BLADERF)
|
||||
len += sprintf(&buffer[len], "[UE PROC] RX Gain %d dB\n",phy_vars_ue->rx_total_gain_dB);
|
||||
#endif
|
||||
#if defined(EXMIMO) || defined(OAI_USRP)
|
||||
#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF)
|
||||
len += sprintf(&buffer[len], "[UE_PROC] Frequency offset %d Hz (%d), estimated carrier frequency %f Hz\n",phy_vars_ue->lte_ue_common_vars.freq_offset,openair_daq_vars.freq_offset,openair0_cfg[0].rx_freq[0]-phy_vars_ue->lte_ue_common_vars.freq_offset);
|
||||
#endif
|
||||
len += sprintf(&buffer[len], "[UE PROC] UE mode = %s (%d)\n",mode_string[phy_vars_ue->UE_mode[0]],phy_vars_ue->UE_mode[0]);
|
||||
@@ -573,12 +574,18 @@ int dump_eNB_stats(PHY_VARS_eNB *phy_vars_eNB, char* buffer, int length)
|
||||
phy_vars_eNB->PHY_measurements_eNB[eNB].n0_power_dB[0],
|
||||
phy_vars_eNB->PHY_measurements_eNB[eNB].n0_power_dB[1]);
|
||||
|
||||
len += sprintf(&buffer[len],"[eNB PROC] Subband I0: ");
|
||||
len += sprintf(&buffer[len],"[eNB PROC] PRB I0 (%X.%X.%X.%X): ",
|
||||
phy_vars_eNB->rb_mask_ul[0],
|
||||
phy_vars_eNB->rb_mask_ul[1],phy_vars_eNB->rb_mask_ul[2],phy_vars_eNB->rb_mask_ul[3]);
|
||||
|
||||
for (i=0; i<25; i++)
|
||||
len += sprintf(&buffer[len],"%2d ",
|
||||
phy_vars_eNB->PHY_measurements_eNB[eNB].n0_subband_power_tot_dB[i]);
|
||||
for (i=0; i<phy_vars_eNB->lte_frame_parms.N_RB_UL; i++) {
|
||||
len += sprintf(&buffer[len],"%4d ",
|
||||
phy_vars_eNB->PHY_measurements_eNB[eNB].n0_subband_power_tot_dBm[i]);
|
||||
if ((i>0) && ((i%25) == 0))
|
||||
len += sprintf(&buffer[len],"\n ",
|
||||
phy_vars_eNB->PHY_measurements_eNB[eNB].n0_subband_power_tot_dBm[i]);
|
||||
|
||||
}
|
||||
len += sprintf(&buffer[len],"\n");
|
||||
len += sprintf(&buffer[len],"\n[eNB PROC] PERFORMANCE PARAMETERS\n");
|
||||
/*
|
||||
@@ -634,11 +641,11 @@ int dump_eNB_stats(PHY_VARS_eNB *phy_vars_eNB, char* buffer, int length)
|
||||
dB_fixed(phy_vars_eNB->lte_eNB_pusch_vars[UE_id]->ulsch_power[1]),
|
||||
phy_vars_eNB->eNB_UE_stats[UE_id].UL_rssi[0],
|
||||
phy_vars_eNB->eNB_UE_stats[UE_id].UL_rssi[1],
|
||||
dB_fixed(phy_vars_eNB->eNB_UE_stats[UE_id].Po_PUCCH)-phy_vars_eNB->rx_total_gain_eNB_dB,
|
||||
dB_fixed(phy_vars_eNB->eNB_UE_stats[UE_id].Po_PUCCH/phy_vars_eNB->lte_frame_parms.N_RB_UL)-phy_vars_eNB->rx_total_gain_eNB_dB,
|
||||
phy_vars_eNB->lte_frame_parms.ul_power_control_config_common.p0_NominalPUCCH,
|
||||
dB_fixed(phy_vars_eNB->eNB_UE_stats[UE_id].Po_PUCCH1_below)-phy_vars_eNB->rx_total_gain_eNB_dB,
|
||||
dB_fixed(phy_vars_eNB->eNB_UE_stats[UE_id].Po_PUCCH1_above)-phy_vars_eNB->rx_total_gain_eNB_dB,
|
||||
PUCCH1_THRES+phy_vars_eNB->PHY_measurements_eNB[0].n0_power_tot_dBm, //-dB_fixed(phy_vars_eNB->lte_frame_parms.N_RB_UL),
|
||||
dB_fixed(phy_vars_eNB->eNB_UE_stats[UE_id].Po_PUCCH1_below/phy_vars_eNB->lte_frame_parms.N_RB_UL)-phy_vars_eNB->rx_total_gain_eNB_dB,
|
||||
dB_fixed(phy_vars_eNB->eNB_UE_stats[UE_id].Po_PUCCH1_above/phy_vars_eNB->lte_frame_parms.N_RB_UL)-phy_vars_eNB->rx_total_gain_eNB_dB,
|
||||
PUCCH1_THRES+phy_vars_eNB->PHY_measurements_eNB[0].n0_power_tot_dBm-dB_fixed(phy_vars_eNB->lte_frame_parms.N_RB_UL),
|
||||
phy_vars_eNB->eNB_UE_stats[UE_id].sector);
|
||||
|
||||
for(i=0; i<8; i++)
|
||||
|
||||
@@ -56,17 +56,17 @@ void free_eNB_dlsch(LTE_eNB_DLSCH_t *dlsch);
|
||||
|
||||
void clean_eNb_dlsch(LTE_eNB_DLSCH_t *dlsch, uint8_t abstraction_flag);
|
||||
|
||||
/** \fn new_eNB_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint8_t abstraction_flag)
|
||||
/** \fn new_eNB_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint32_t Nsoft,uint8_t abstraction_flag)
|
||||
\brief This function allocates structures for a particular DLSCH at eNB
|
||||
@returns Pointer to DLSCH to be removed
|
||||
@param Kmimo Kmimo factor from 36-212/36-213
|
||||
@param Mdlharq Maximum number of HARQ rounds (36-212/36-213)
|
||||
@param Nsoft Soft-LLR buffer size from UE-Category
|
||||
@params N_RB_DL total number of resource blocks (determine the operating BW)
|
||||
@param abstraction_flag Flag to indicate abstracted interface
|
||||
@param nb_antenna_tx number of physical transmit antennas at eNB
|
||||
@param frame_parms Pointer to frame descriptor structure
|
||||
*/
|
||||
LTE_eNB_DLSCH_t *new_eNB_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint8_t
|
||||
N_RB_DL, uint8_t abstraction_flag, LTE_DL_FRAME_PARMS* frame_parms);
|
||||
LTE_eNB_DLSCH_t *new_eNB_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint32_t Nsoft,uint8_t N_RB_DL, uint8_t abstraction_flag, LTE_DL_FRAME_PARMS* frame_parms);
|
||||
|
||||
/** \fn free_ue_dlsch(LTE_UE_DLSCH_t *dlsch)
|
||||
\brief This function frees memory allocated for a particular DLSCH at UE
|
||||
@@ -74,18 +74,26 @@ N_RB_DL, uint8_t abstraction_flag, LTE_DL_FRAME_PARMS* frame_parms);
|
||||
*/
|
||||
void free_ue_dlsch(LTE_UE_DLSCH_t *dlsch);
|
||||
|
||||
LTE_UE_DLSCH_t *new_ue_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint8_t max_turbo_iterations,uint8_t N_RB_DL, uint8_t abstraction_flag);
|
||||
|
||||
/** \fn new_ue_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint32_t Nsoft,uint8_t abstraction_flag)
|
||||
\brief This function allocates structures for a particular DLSCH at eNB
|
||||
@returns Pointer to DLSCH to be removed
|
||||
@param Kmimo Kmimo factor from 36-212/36-213
|
||||
@param Mdlharq Maximum number of HARQ rounds (36-212/36-213)
|
||||
@param Nsoft Soft-LLR buffer size from UE-Category
|
||||
@params N_RB_DL total number of resource blocks (determine the operating BW)
|
||||
@param abstraction_flag Flag to indicate abstracted interface
|
||||
*/
|
||||
LTE_UE_DLSCH_t *new_ue_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint32_t Nsoft,uint8_t max_turbo_iterations,uint8_t N_RB_DL, uint8_t abstraction_flag);
|
||||
|
||||
|
||||
void clean_eNb_ulsch(LTE_eNB_ULSCH_t *ulsch, uint8_t abstraction_flag);
|
||||
|
||||
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_UE_ULSCH_t *new_ue_ulsch(uint8_t Mdlharq, unsigned char N_RB_UL, uint8_t abstraction_flag);
|
||||
|
||||
|
||||
|
||||
/** \fn dlsch_encoding(uint8_t *input_buffer,
|
||||
LTE_DL_FRAME_PARMS *frame_parms,
|
||||
uint8_t num_pdcch_symbols,
|
||||
@@ -1320,11 +1328,20 @@ uint32_t get_TBS_DL(uint8_t mcs, uint16_t nb_rb);
|
||||
uint32_t get_TBS_UL(uint8_t mcs, uint16_t nb_rb);
|
||||
|
||||
/* \brief Return bit-map of resource allocation for a given DCI rballoc (RIV format) and vrb type
|
||||
@param N_RB_DL number of PRB on DL
|
||||
@param indicator for even/odd slot
|
||||
@param vrb vrb index
|
||||
@param Ngap Gap indicator
|
||||
*/
|
||||
uint32_t get_prb(int N_RB_DL,int odd_slot,int vrb,int Ngap);
|
||||
|
||||
/* \brief Return prb for a given vrb index
|
||||
@param vrb_type VRB type (0=localized,1=distributed)
|
||||
@param rb_alloc_dci rballoc field from DCI
|
||||
*/
|
||||
uint32_t get_rballoc(vrb_t vrb_type,uint16_t rb_alloc_dci);
|
||||
|
||||
|
||||
/* \brief Return bit-map of resource allocation for a given DCI rballoc (RIV format) and vrb type
|
||||
@returns Transmission mode (1-7)
|
||||
*/
|
||||
@@ -1664,6 +1681,12 @@ uint16_t computeRIV(uint16_t N_RB_DL,uint16_t RBstart,uint16_t Lcrbs);
|
||||
|
||||
uint32_t pmi_extend(LTE_DL_FRAME_PARMS *frame_parms,uint8_t wideband_pmi);
|
||||
|
||||
int get_nCCE_offset_l1(int *CCE_table,
|
||||
const unsigned char L,
|
||||
const int nCCE,
|
||||
const int common_dci,
|
||||
const unsigned short rnti,
|
||||
const unsigned char subframe);
|
||||
|
||||
uint16_t get_nCCE(uint8_t num_pdcch_symbols,LTE_DL_FRAME_PARMS *frame_parms,uint8_t mi);
|
||||
|
||||
@@ -1671,7 +1694,7 @@ uint16_t get_nquad(uint8_t num_pdcch_symbols,LTE_DL_FRAME_PARMS *frame_parms,uin
|
||||
|
||||
uint8_t get_mi(LTE_DL_FRAME_PARMS *frame,uint8_t subframe);
|
||||
|
||||
uint16_t get_nCCE_max(uint8_t Mod_id,uint8_t CC_id);
|
||||
uint16_t get_nCCE_mac(uint8_t Mod_id,uint8_t CC_id,int num_pdcch_symbols,int subframe);
|
||||
|
||||
uint8_t get_num_pdcch_symbols(uint8_t num_dci,DCI_ALLOC_t *dci_alloc,LTE_DL_FRAME_PARMS *frame_parms,uint8_t subframe);
|
||||
|
||||
@@ -1724,22 +1747,22 @@ void generate_pucch_emul(PHY_VARS_UE *phy_vars_ue,
|
||||
uint8_t subframe);
|
||||
|
||||
|
||||
int32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB,
|
||||
PUCCH_FMT_t fmt,
|
||||
uint8_t UE_id,
|
||||
uint16_t n1_pucch,
|
||||
uint16_t n2_pucch,
|
||||
uint8_t shortened_format,
|
||||
uint8_t *payload,
|
||||
uint8_t subframe,
|
||||
uint8_t pucch1_thres);
|
||||
uint32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB,
|
||||
PUCCH_FMT_t fmt,
|
||||
uint8_t UE_id,
|
||||
uint16_t n1_pucch,
|
||||
uint16_t n2_pucch,
|
||||
uint8_t shortened_format,
|
||||
uint8_t *payload,
|
||||
uint8_t subframe,
|
||||
uint8_t pucch1_thres);
|
||||
|
||||
int32_t rx_pucch_emul(PHY_VARS_eNB *phy_vars_eNB,
|
||||
uint8_t UE_index,
|
||||
PUCCH_FMT_t fmt,
|
||||
uint8_t n1_pucch_sel,
|
||||
uint8_t *payload,
|
||||
uint8_t subframe);
|
||||
uint8_t UE_index,
|
||||
PUCCH_FMT_t fmt,
|
||||
uint8_t n1_pucch_sel,
|
||||
uint8_t *payload,
|
||||
uint8_t subframe);
|
||||
|
||||
|
||||
/*!
|
||||
@@ -1856,7 +1879,9 @@ double computeRhoB_UE(PDSCH_CONFIG_DEDICATED *pdsch_config_dedicated,
|
||||
LTE_UE_DLSCH_t *dlsch_ue);
|
||||
*/
|
||||
|
||||
uint8_t get_prach_prb_offset(LTE_DL_FRAME_PARMS *frame_parms, uint8_t tdd_mapindex, uint16_t Nf);
|
||||
uint8_t get_prach_prb_offset(LTE_DL_FRAME_PARMS *frame_parms, uint8_t tdd_mapindex, uint16_t Nf);
|
||||
|
||||
uint8_t ul_subframe2pdcch_alloc_subframe(LTE_DL_FRAME_PARMS *frame_parms,uint8_t n);
|
||||
|
||||
/**@}*/
|
||||
#endif
|
||||
|
||||
@@ -430,15 +430,15 @@ void generate_pucch_emul(PHY_VARS_UE *phy_vars_ue,
|
||||
|
||||
}
|
||||
|
||||
int32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB,
|
||||
PUCCH_FMT_t fmt,
|
||||
uint8_t UE_id,
|
||||
uint16_t n1_pucch,
|
||||
uint16_t n2_pucch,
|
||||
uint8_t shortened_format,
|
||||
uint8_t *payload,
|
||||
uint8_t subframe,
|
||||
uint8_t pucch1_thres)
|
||||
uint32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB,
|
||||
PUCCH_FMT_t fmt,
|
||||
uint8_t UE_id,
|
||||
uint16_t n1_pucch,
|
||||
uint16_t n2_pucch,
|
||||
uint8_t shortened_format,
|
||||
uint8_t *payload,
|
||||
uint8_t subframe,
|
||||
uint8_t pucch1_thres)
|
||||
{
|
||||
|
||||
|
||||
@@ -446,11 +446,11 @@ int32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB,
|
||||
LTE_eNB_COMMON *eNB_common_vars = &phy_vars_eNB->lte_eNB_common_vars;
|
||||
LTE_DL_FRAME_PARMS *frame_parms = &phy_vars_eNB->lte_frame_parms;
|
||||
// PUCCH_CONFIG_DEDICATED *pucch_config_dedicated = &phy_vars_eNB->pucch_config_dedicated[UE_id];
|
||||
int8_t sigma2_dB = phy_vars_eNB->PHY_measurements_eNB[0].n0_power_dB[0];
|
||||
int32_t *Po_PUCCH = &(phy_vars_eNB->eNB_UE_stats[UE_id].Po_PUCCH);
|
||||
int8_t sigma2_dB = phy_vars_eNB->PHY_measurements_eNB[0].n0_subband_power_tot_dB[6];
|
||||
uint32_t *Po_PUCCH = &(phy_vars_eNB->eNB_UE_stats[UE_id].Po_PUCCH);
|
||||
int32_t *Po_PUCCH_dBm = &(phy_vars_eNB->eNB_UE_stats[UE_id].Po_PUCCH_dBm);
|
||||
int32_t *Po_PUCCH1_below = &(phy_vars_eNB->eNB_UE_stats[UE_id].Po_PUCCH1_below);
|
||||
int32_t *Po_PUCCH1_above = &(phy_vars_eNB->eNB_UE_stats[UE_id].Po_PUCCH1_above);
|
||||
uint32_t *Po_PUCCH1_below = &(phy_vars_eNB->eNB_UE_stats[UE_id].Po_PUCCH1_below);
|
||||
uint32_t *Po_PUCCH1_above = &(phy_vars_eNB->eNB_UE_stats[UE_id].Po_PUCCH1_above);
|
||||
int32_t *Po_PUCCH_update = &(phy_vars_eNB->eNB_UE_stats[UE_id].Po_PUCCH_update);
|
||||
uint32_t u,v,n,aa;
|
||||
uint32_t z[12*14];
|
||||
@@ -468,7 +468,7 @@ int32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB,
|
||||
uint32_t symbol_offset;
|
||||
int16_t stat_ref_re,stat_ref_im,*cfo,chest_re,chest_im;
|
||||
int32_t stat_re=0,stat_im=0;
|
||||
int32_t stat,stat_max=0;
|
||||
uint32_t stat,stat_max=0;
|
||||
|
||||
uint8_t deltaPUCCH_Shift = frame_parms->pucch_config_common.deltaPUCCH_Shift;
|
||||
uint8_t NRB2 = frame_parms->pucch_config_common.nRB_CQI;
|
||||
@@ -478,6 +478,7 @@ int32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB,
|
||||
uint32_t u1 = (frame_parms->Nid_cell + frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.grouphop[1+(subframe<<1)]) % 30;
|
||||
uint32_t v0=frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.seqhop[subframe<<1];
|
||||
uint32_t v1=frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.seqhop[1+(subframe<<1)];
|
||||
int chL;
|
||||
|
||||
if (first_call == 1) {
|
||||
for (i=0;i<10;i++) {
|
||||
@@ -508,6 +509,7 @@ int32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB,
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
if ((deltaPUCCH_Shift==0) || (deltaPUCCH_Shift>3)) {
|
||||
LOG_E(PHY,"[eNB] rx_pucch: Illegal deltaPUCCH_shift %d (should be 1,2,3)\n",deltaPUCCH_Shift);
|
||||
return(-1);
|
||||
@@ -737,30 +739,35 @@ int32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB,
|
||||
cfo = (frame_parms->Ncp==0) ? &cfo_pucch_np[14*phase] : &cfo_pucch_ep[12*phase];
|
||||
|
||||
for (l=0; l<(nsymb>>1); l++) {
|
||||
stat_re += ((rxcomp[aa][off]*(int32_t)cfo[l<<1])>>15) - ((rxcomp[aa][1+off]*(int32_t)cfo[1+(l<<1)])>>15);
|
||||
stat_im += ((rxcomp[aa][off]*(int32_t)cfo[1+(l<<1)])>>15) + ((rxcomp[aa][1+off]*(int32_t)cfo[(l<<1)])>>15);
|
||||
stat_re += (((rxcomp[aa][off]*(int32_t)cfo[l<<1])>>15) - ((rxcomp[aa][1+off]*(int32_t)cfo[1+(l<<1)])>>15))/nsymb;
|
||||
stat_im += (((rxcomp[aa][off]*(int32_t)cfo[1+(l<<1)])>>15) + ((rxcomp[aa][1+off]*(int32_t)cfo[(l<<1)])>>15))/nsymb;
|
||||
off+=2;
|
||||
|
||||
|
||||
#ifdef DEBUG_PUCCH_RX
|
||||
LOG_D(PHY,"[eNB] PUCCH subframe %d (%d,%d) => (%d,%d) x (%d,%d) : (%d,%d)\n",subframe,l,re,
|
||||
LOG_D(PHY,"[eNB] PUCCH subframe %d (%d,%d,%d) => (%d,%d) x (%d,%d) : (%d,%d) , stat %d\n",subframe,phase,l,re,
|
||||
rxcomp[aa][off],rxcomp[aa][1+off],
|
||||
cfo[l<<1],cfo[1+(l<<1)],
|
||||
stat_re,stat_im);
|
||||
stat_re,stat_im,stat);
|
||||
#endif
|
||||
}
|
||||
|
||||
for (l2=0,l=(nsymb>>1); l<(nsymb-1); l++,l2++) {
|
||||
stat_re += ((rxcomp[aa][off]*(int32_t)cfo[l2<<1])>>15) - ((rxcomp[aa][1+off]*(int32_t)cfo[1+(l2<<1)])>>15);
|
||||
stat_im += ((rxcomp[aa][off]*(int32_t)cfo[1+(l2<<1)])>>15) + ((rxcomp[aa][1+off]*(int32_t)cfo[(l2<<1)])>>15);
|
||||
stat_re += (((rxcomp[aa][off]*(int32_t)cfo[l2<<1])>>15) - ((rxcomp[aa][1+off]*(int32_t)cfo[1+(l2<<1)])>>15))/nsymb;
|
||||
stat_im += (((rxcomp[aa][off]*(int32_t)cfo[1+(l2<<1)])>>15) + ((rxcomp[aa][1+off]*(int32_t)cfo[(l2<<1)])>>15))/nsymb;
|
||||
off+=2;
|
||||
|
||||
#ifdef DEBUG_PUCCH_RX
|
||||
LOG_D(PHY,"[eNB] PUCCH subframe %d (%d,%d) => (%d,%d) x (%d,%d) : (%d,%d)\n",subframe,l2,re,
|
||||
LOG_D(PHY,"[eNB] PUCCH subframe %d (%d,%d,%d) => (%d,%d) x (%d,%d) : (%d,%d), stat %d\n",subframe,phase,l2,re,
|
||||
rxcomp[aa][off],rxcomp[aa][1+off],
|
||||
cfo[l2<<1],cfo[1+(l2<<1)],
|
||||
stat_re,stat_im);
|
||||
stat_re,stat_im,stat);
|
||||
#endif
|
||||
|
||||
|
||||
}
|
||||
stat += (stat_re*stat_re) + (stat_im*stat_im);
|
||||
stat += ((stat_re*stat_re) + (stat_im*stat_im));
|
||||
|
||||
} //re
|
||||
} // aa
|
||||
|
||||
@@ -772,16 +779,18 @@ int32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB,
|
||||
|
||||
} //phase
|
||||
|
||||
stat_max /= (nsymb*12); // normalize to energy per symbol and RE
|
||||
stat_max *= nsymb; // normalize to energy per symbol
|
||||
stat_max /= (frame_parms->N_RB_UL*12); //
|
||||
#ifdef DEBUG_PUCCH_RX
|
||||
LOG_D(PHY,"[eNB] PUCCH: stat %d, stat_max %d, phase_max %d\n", stat,stat_max,phase_max);
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG_PUCCH_RX
|
||||
LOG_D(PHY,"[eNB] PUCCH fmt0: stat_max : %d, sigma2_dB %d (%d, %d), phase_max : %d\n",dB_fixed(stat_max),sigma2_dB,phy_vars_eNB->PHY_measurements_eNB[0].n0_power_tot_dBm,pucch1_thres,phase_max);
|
||||
LOG_I(PHY,"[eNB] PUCCH fmt1: stat_max : %d, sigma2_dB %d (%d, %d), phase_max : %d\n",dB_fixed(stat_max),sigma2_dB,phy_vars_eNB->PHY_measurements_eNB[0].n0_subband_power_tot_dBm[6],pucch1_thres,phase_max);
|
||||
#endif
|
||||
|
||||
phy_vars_eNB->pucch1_stats[UE_id][(subframe<<10)+phy_vars_eNB->pucch1_stats_cnt[UE_id][subframe]] = stat_max;
|
||||
phy_vars_eNB->pucch1_stats_thres[UE_id][(subframe<<10)+phy_vars_eNB->pucch1_stats_cnt[UE_id][subframe]] = sigma2_dB+pucch1_thres;
|
||||
phy_vars_eNB->pucch1_stats_cnt[UE_id][subframe] = (phy_vars_eNB->pucch1_stats_cnt[UE_id][subframe]+1)&1023;
|
||||
|
||||
/*
|
||||
@@ -798,13 +807,13 @@ int32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB,
|
||||
if (sigma2_dB<(dB_fixed(stat_max)-pucch1_thres)) {
|
||||
*payload = 1;
|
||||
*Po_PUCCH1_above = ((*Po_PUCCH1_above<<9) + (stat_max<<9)+1024)>>10;
|
||||
|
||||
//LOG_I(PHY,"[eNB] PUCCH fmt1: stat_max : %d, sigma2_dB %d (%d, %d), phase_max : %d\n",dB_fixed(stat_max),sigma2_dB,phy_vars_eNB->PHY_measurements_eNB[0].n0_power_tot_dBm,pucch1_thres,phase_max);
|
||||
}
|
||||
else {
|
||||
*payload = 0;
|
||||
*Po_PUCCH1_below = ((*Po_PUCCH1_below<<9) + (stat_max<<9)+1024)>>10;
|
||||
}
|
||||
LOG_D(PHY,"[eNB] PUCCH fmt0: stat_max : %d, sigma2_dB %d (I0 %d dBm, thres %d), Po_PUCCH1_below/above : %d / %d\n",dB_fixed(stat_max),sigma2_dB,phy_vars_eNB->PHY_measurements_eNB[0].n0_power_tot_dBm,pucch1_thres,dB_fixed(*Po_PUCCH1_below),dB_fixed(*Po_PUCCH1_above));
|
||||
LOG_D(PHY,"[eNB] PUCCH fmt1: stat_max : %d, sigma2_dB %d (I0 %d dBm, thres %d), Po_PUCCH1_below/above : %d / %d\n",dB_fixed(stat_max),sigma2_dB,phy_vars_eNB->PHY_measurements_eNB[0].n0_subband_power_tot_dBm[6],pucch1_thres,dB_fixed(*Po_PUCCH1_below),dB_fixed(*Po_PUCCH1_above));
|
||||
*Po_PUCCH_update = 1;
|
||||
|
||||
} else if ((fmt == pucch_format1a)||(fmt == pucch_format1b)) {
|
||||
@@ -813,7 +822,7 @@ int32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB,
|
||||
LOG_I(PHY,"Doing PUCCH detection for format 1a/1b\n");
|
||||
#endif
|
||||
|
||||
for (phase=0; phase<7; phase++) {
|
||||
for (phase=3;phase<4;phase++){ //phase=0; phase<7; phase++) {
|
||||
stat=0;
|
||||
|
||||
for (aa=0; aa<frame_parms->nb_antennas_rx; aa++) {
|
||||
@@ -844,6 +853,9 @@ int32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB,
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
for (l2=0,l=(nsymb>>1); l<(nsymb-1); l++,l2++) {
|
||||
if ((l2<2) || ((l2>(nsymb>>1) - 3)) ) { // data symbols
|
||||
stat_re += ((rxcomp[aa][off]*(int32_t)cfo[l2<<1])>>15) - ((rxcomp[aa][1+off]*(int32_t)cfo[1+(l2<<1)])>>15);
|
||||
@@ -863,34 +875,36 @@ int32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB,
|
||||
|
||||
}
|
||||
|
||||
stat += (((stat_re*stat_re)) + ((stat_im*stat_im)) +
|
||||
((stat_ref_re*stat_ref_re)) + ((stat_ref_im*stat_ref_im)));
|
||||
#ifdef DEBUG_PUCCH_RX
|
||||
LOG_D(PHY,"aa%d re %d : phase %d : stat %d\n",aa,re,phase,stat);
|
||||
#endif
|
||||
|
||||
stat += ((((stat_re*stat_re)) + ((stat_im*stat_im)) +
|
||||
((stat_ref_re*stat_ref_re)) + ((stat_ref_im*stat_ref_im)))/nsymb);
|
||||
|
||||
|
||||
} //re
|
||||
} // aa
|
||||
|
||||
#ifdef DEBUG_PUCCH_RX
|
||||
LOG_I(PHY,"phase %d : stat %d\n",phase,stat);
|
||||
LOG_I(PHY,"Format 1A: phase %d : stat %d\n",phase,stat);
|
||||
#endif
|
||||
|
||||
if (stat>stat_max) {
|
||||
stat_max = stat;
|
||||
phase_max = phase;
|
||||
}
|
||||
} //phase
|
||||
|
||||
stat_max/=(nsymb*12); //normalize to energy per symbol and RE
|
||||
#ifdef DEBUG_PUCCH_RX
|
||||
LOG_I(PHY,"[eNB] PUCCH fmt1: stat_max : %d, phase_max : %d\n",stat_max,phase_max);
|
||||
#endif
|
||||
stat_max/=(12); //normalize to energy per symbol and RE
|
||||
//#ifdef DEBUG_PUCCH_RX
|
||||
LOG_D(PHY,"[eNB] PUCCH fmt1a/b: stat_max : %d, phase_max : %d\n",stat_max,phase_max);
|
||||
//#endif
|
||||
|
||||
stat_re=0;
|
||||
stat_im=0;
|
||||
LOG_D(PHY,"PUCCH1A : Po_PUCCH before %d dB (%d)\n",dB_fixed(*Po_PUCCH),*Po_PUCCH);
|
||||
*Po_PUCCH = ((*Po_PUCCH<<9) + (stat_max<<9)+1024)>>10;
|
||||
*Po_PUCCH_dBm = dB_fixed(*Po_PUCCH) - phy_vars_eNB->rx_total_gain_eNB_dB;
|
||||
*Po_PUCCH = ((*Po_PUCCH>>1) + ((stat_max)>>1));
|
||||
*Po_PUCCH_dBm = dB_fixed(*Po_PUCCH/frame_parms->N_RB_UL) - phy_vars_eNB->rx_total_gain_eNB_dB;
|
||||
*Po_PUCCH_update = 1;
|
||||
|
||||
LOG_D(PHY,"PUCCH1A : stat_max %d (%d,%d,%d) => Po_PUCCH %d\n",
|
||||
@@ -906,6 +920,8 @@ int32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB,
|
||||
|
||||
*Po_PUCCH = ((*Po_PUCCH*1023) + stat_max)>>10;
|
||||
|
||||
chL = (nsymb>>1)-4;
|
||||
|
||||
for (aa=0; aa<frame_parms->nb_antennas_rx; aa++) {
|
||||
for (re=0; re<12; re++) {
|
||||
chest_re=0;
|
||||
@@ -915,8 +931,8 @@ int32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB,
|
||||
// channel estimate for first slot
|
||||
for (l=2; l<(nsymb>>1)-2; l++) {
|
||||
off=(re<<1) + (24*l);
|
||||
chest_re += ((rxcomp[aa][off]*(int32_t)cfo[l<<1])>>15) - ((rxcomp[aa][1+off]*(int32_t)cfo[1+(l<<1)])>>15);
|
||||
chest_im += ((rxcomp[aa][off]*(int32_t)cfo[1+(l<<1)])>>15) + ((rxcomp[aa][1+off]*(int32_t)cfo[(l<<1)])>>15);
|
||||
chest_re += (((rxcomp[aa][off]*(int32_t)cfo[l<<1])>>15) - ((rxcomp[aa][1+off]*(int32_t)cfo[1+(l<<1)])>>15))/chL;
|
||||
chest_im += (((rxcomp[aa][off]*(int32_t)cfo[1+(l<<1)])>>15) + ((rxcomp[aa][1+off]*(int32_t)cfo[(l<<1)])>>15))/chL;
|
||||
}
|
||||
|
||||
#ifdef DEBUG_PUCCH_RX
|
||||
@@ -928,8 +944,8 @@ int32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB,
|
||||
off=(re<<1) + (24*l);
|
||||
tmp_re = ((rxcomp[aa][off]*(int32_t)cfo[l<<1])>>15) - ((rxcomp[aa][1+off]*(int32_t)cfo[1+(l<<1)])>>15);
|
||||
tmp_im = ((rxcomp[aa][off]*(int32_t)cfo[1+(l<<1)])>>15) + ((rxcomp[aa][1+off]*(int32_t)cfo[(l<<1)])>>15);
|
||||
stat_re += ((tmp_re*chest_re)>>15) + ((tmp_im*chest_im)>>15);
|
||||
stat_im += ((tmp_re*chest_im)>>15) - ((tmp_im*chest_re)>>15);
|
||||
stat_re += (((tmp_re*chest_re)>>15) + ((tmp_im*chest_im)>>15))/4;
|
||||
stat_im += (((tmp_re*chest_im)>>15) - ((tmp_im*chest_re)>>15))/4;
|
||||
off+=2;
|
||||
#ifdef DEBUG_PUCCH_RX
|
||||
LOG_D(PHY,"[eNB] PUCCH subframe %d (%d,%d) => (%d,%d) x (%d,%d) : (%d,%d)\n",subframe,l,re,
|
||||
@@ -943,8 +959,8 @@ int32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB,
|
||||
off=(re<<1) + (24*l);
|
||||
tmp_re = ((rxcomp[aa][off]*(int32_t)cfo[l<<1])>>15) - ((rxcomp[aa][1+off]*(int32_t)cfo[1+(l<<1)])>>15);
|
||||
tmp_im = ((rxcomp[aa][off]*(int32_t)cfo[1+(l<<1)])>>15) + ((rxcomp[aa][1+off]*(int32_t)cfo[(l<<1)])>>15);
|
||||
stat_re += ((tmp_re*chest_re)>>15) + ((tmp_im*chest_im)>>15);
|
||||
stat_im += ((tmp_re*chest_im)>>15) - ((tmp_im*chest_re)>>15);
|
||||
stat_re += (((tmp_re*chest_re)>>15) + ((tmp_im*chest_im)>>15)/4);
|
||||
stat_im += (((tmp_re*chest_im)>>15) - ((tmp_im*chest_re)>>15)/4);
|
||||
off+=2;
|
||||
#ifdef DEBUG_PUCCH_RX
|
||||
LOG_D(PHY,"[eNB] PUCCH subframe %d (%d,%d) => (%d,%d) x (%d,%d) : (%d,%d)\n",subframe,l,re,
|
||||
@@ -960,8 +976,8 @@ int32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB,
|
||||
// channel estimate for second slot
|
||||
for (l=2; l<(nsymb>>1)-2; l++) {
|
||||
off=(re<<1) + (24*l) + (nsymb>>1)*24;
|
||||
chest_re += ((rxcomp[aa][off]*(int32_t)cfo[l<<1])>>15) - ((rxcomp[aa][1+off]*(int32_t)cfo[1+(l<<1)])>>15);
|
||||
chest_im += ((rxcomp[aa][off]*(int32_t)cfo[1+(l<<1)])>>15) + ((rxcomp[aa][1+off]*(int32_t)cfo[(l<<1)])>>15);
|
||||
chest_re += (((rxcomp[aa][off]*(int32_t)cfo[l<<1])>>15) - ((rxcomp[aa][1+off]*(int32_t)cfo[1+(l<<1)])>>15))/chL;
|
||||
chest_im += (((rxcomp[aa][off]*(int32_t)cfo[1+(l<<1)])>>15) + ((rxcomp[aa][1+off]*(int32_t)cfo[(l<<1)])>>15))/chL;
|
||||
}
|
||||
|
||||
#ifdef DEBUG_PUCCH_RX
|
||||
@@ -973,8 +989,8 @@ int32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB,
|
||||
off=(re<<1) + (24*l) + (nsymb>>1)*24;
|
||||
tmp_re = ((rxcomp[aa][off]*(int32_t)cfo[l<<1])>>15) - ((rxcomp[aa][1+off]*(int32_t)cfo[1+(l<<1)])>>15);
|
||||
tmp_im = ((rxcomp[aa][off]*(int32_t)cfo[1+(l<<1)])>>15) + ((rxcomp[aa][1+off]*(int32_t)cfo[(l<<1)])>>15);
|
||||
stat_re += ((tmp_re*chest_re)>>15) + ((tmp_im*chest_im)>>15);
|
||||
stat_im += ((tmp_re*chest_im)>>15) - ((tmp_im*chest_re)>>15);
|
||||
stat_re += (((tmp_re*chest_re)>>15) + ((tmp_im*chest_im)>>15))/4;
|
||||
stat_im += (((tmp_re*chest_im)>>15) - ((tmp_im*chest_re)>>15))/4;
|
||||
off+=2;
|
||||
#ifdef DEBUG_PUCCH_RX
|
||||
LOG_D(PHY,"[PHY][eNB] PUCCH subframe %d (%d,%d) => (%d,%d) x (%d,%d) : (%d,%d)\n",subframe,l,re,
|
||||
@@ -988,8 +1004,8 @@ int32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB,
|
||||
off=(re<<1) + (24*l) + (nsymb>>1)*24;
|
||||
tmp_re = ((rxcomp[aa][off]*(int32_t)cfo[l<<1])>>15) - ((rxcomp[aa][1+off]*(int32_t)cfo[1+(l<<1)])>>15);
|
||||
tmp_im = ((rxcomp[aa][off]*(int32_t)cfo[1+(l<<1)])>>15) + ((rxcomp[aa][1+off]*(int32_t)cfo[(l<<1)])>>15);
|
||||
stat_re += ((tmp_re*chest_re)>>9) + ((tmp_im*chest_im)>>9);
|
||||
stat_im += ((tmp_re*chest_im)>>9) - ((tmp_im*chest_re)>>9);
|
||||
stat_re += (((tmp_re*chest_re)>>15) + ((tmp_im*chest_im)>>15))/4;
|
||||
stat_im += (((tmp_re*chest_im)>>15) - ((tmp_im*chest_re)>>15))/4;
|
||||
off+=2;
|
||||
#ifdef DEBUG_PUCCH_RX
|
||||
LOG_D(PHY,"[PHY][eNB] PUCCH subframe %d (%d,%d) => (%d,%d) x (%d,%d) : (%d,%d)\n",subframe,l,re,
|
||||
@@ -1007,20 +1023,27 @@ int32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB,
|
||||
} // aa
|
||||
|
||||
#ifdef DEBUG_PUCCH_RX
|
||||
LOG_D(PHY,"PUCCH 1a/b: subframe %d : stat %d,%d (pos %d)\n",subframe,stat_re,stat_im,
|
||||
LOG_I(PHY,"PUCCH 1a/b: subframe %d : stat %d,%d (pos %d)\n",subframe,stat_re,stat_im,
|
||||
(subframe<<10) + (phy_vars_eNB->pucch1ab_stats_cnt[UE_id][subframe]));
|
||||
#endif
|
||||
|
||||
((int16_t*)&phy_vars_eNB->pucch1ab_stats[UE_id][(subframe<<10) + (phy_vars_eNB->pucch1_stats_cnt[UE_id][subframe])])[0] = stat_re;
|
||||
((int16_t*)&phy_vars_eNB->pucch1ab_stats[UE_id][(subframe<<10) + (phy_vars_eNB->pucch1_stats_cnt[UE_id][subframe])])[1] = stat_im;
|
||||
phy_vars_eNB->pucch1ab_stats_cnt[UE_id][subframe] = (phy_vars_eNB->pucch1ab_stats_cnt[UE_id][subframe]+1)&1023;
|
||||
|
||||
phy_vars_eNB->pucch1ab_stats[UE_id][(subframe<<11) + 2*(phy_vars_eNB->pucch1ab_stats_cnt[UE_id][subframe])] = (stat_re);
|
||||
phy_vars_eNB->pucch1ab_stats[UE_id][(subframe<<11) + 1+2*(phy_vars_eNB->pucch1ab_stats_cnt[UE_id][subframe])] = (stat_im);
|
||||
phy_vars_eNB->pucch1ab_stats_cnt[UE_id][subframe] = (phy_vars_eNB->pucch1ab_stats_cnt[UE_id][subframe]+1)&1023;
|
||||
|
||||
|
||||
|
||||
*payload = (stat_re<0) ? 1 : 0;
|
||||
|
||||
if (fmt==pucch_format1b)
|
||||
*(1+payload) = (stat_im<0) ? 1 : 0;
|
||||
} else { // insufficient energy on PUCCH so NAK
|
||||
*payload = 0;
|
||||
((int16_t*)&phy_vars_eNB->pucch1ab_stats[UE_id][(subframe<<10) + (phy_vars_eNB->pucch1ab_stats_cnt[UE_id][subframe])])[0] = (int16_t)(stat_re);
|
||||
((int16_t*)&phy_vars_eNB->pucch1ab_stats[UE_id][(subframe<<10) + (phy_vars_eNB->pucch1ab_stats_cnt[UE_id][subframe])])[1] = (int16_t)(stat_im);
|
||||
phy_vars_eNB->pucch1ab_stats_cnt[UE_id][subframe] = (phy_vars_eNB->pucch1ab_stats_cnt[UE_id][subframe]+1)&1023;
|
||||
|
||||
*payload = (stat_re<0) ? 1 : 0;
|
||||
|
||||
if (fmt==pucch_format1b)
|
||||
*(1+payload) = 0;
|
||||
@@ -1054,7 +1077,7 @@ int32_t rx_pucch_emul(PHY_VARS_eNB *phy_vars_eNB,
|
||||
}
|
||||
|
||||
if (UE_id==NB_UE_INST) {
|
||||
LOG_E(PHY,"rx_pucch_emul: FATAL, didn't find UE with rnti %x\n",rnti);
|
||||
LOG_W(PHY,"rx_pucch_emul: Didn't find UE with rnti %x\n",rnti);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
|
||||
@@ -1657,8 +1657,15 @@ void rx_ulsch(PHY_VARS_eNB *phy_vars_eNB,
|
||||
}
|
||||
} else {
|
||||
for (i=0; i<frame_parms->nb_antennas_rx; i++) {
|
||||
/*
|
||||
eNB_pusch_vars->ulsch_power[i] = signal_energy_nodc(eNB_pusch_vars->drs_ch_estimates[eNB_id][i],
|
||||
ulsch[UE_id]->harq_processes[harq_pid]->nb_rb*12)*rx_power_correction;
|
||||
|
||||
*/
|
||||
|
||||
eNB_pusch_vars->ulsch_power[i] = signal_energy_nodc(eNB_pusch_vars->drs_ch_estimates[eNB_id][i],
|
||||
ulsch[UE_id]->harq_processes[harq_pid]->nb_rb*12);
|
||||
|
||||
#ifdef LOCALIZATION
|
||||
eNB_pusch_vars->subcarrier_power = (int32_t *)malloc(ulsch[UE_id]->harq_processes[harq_pid]->nb_rb*12*sizeof(int32_t));
|
||||
eNB_pusch_vars->active_subcarrier = subcarrier_energy(eNB_pusch_vars->drs_ch_estimates[eNB_id][i],
|
||||
|
||||
@@ -34,12 +34,12 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
\fn void PHY_ofdm_mod(int *input,int *output,unsigned char log2fftsize,unsigned char nb_symbols,unsigned short nb_prefix_samples,Extension_t etype)
|
||||
\fn void PHY_ofdm_mod(int *input,int *output,int fftsize,unsigned char nb_symbols,unsigned short nb_prefix_samples,Extension_t etype)
|
||||
This function performs OFDM modulation with cyclic extension or zero-padding.
|
||||
|
||||
@param input The sequence input samples in the frequency-domain. This is a concatenation of the input symbols in SIMD redundant format
|
||||
@param output The time-domain output signal
|
||||
@param log2fftsize Base-2 logarithm of the OFDM symbol size (\f$N_d\f$)
|
||||
@param fftsize size of OFDM symbol size (\f$N_d\f$)
|
||||
@param nb_symbols The number of OFDM symbols in the block
|
||||
@param nb_prefix_samples The number of prefix/suffix/zero samples
|
||||
@param etype Type of extension (CYCLIC_PREFIX,CYCLIC_SUFFIX,ZEROS)
|
||||
@@ -47,7 +47,7 @@ This function performs OFDM modulation with cyclic extension or zero-padding.
|
||||
*/
|
||||
void PHY_ofdm_mod(int *input,
|
||||
int *output,
|
||||
unsigned char log2fftsize,
|
||||
int fftsize,
|
||||
unsigned char nb_symbols,
|
||||
unsigned short nb_prefix_samples,
|
||||
Extension_t etype
|
||||
|
||||
@@ -61,9 +61,9 @@ void normal_prefix_mod(int32_t *txdataF,int32_t *txdata,uint8_t nsymb,LTE_DL_FRA
|
||||
txdata+(i*(frame_parms->samples_per_tti>>1)));
|
||||
#endif
|
||||
|
||||
PHY_ofdm_mod(txdataF+(i*NUMBER_OF_OFDM_CARRIERS*frame_parms->symbols_per_tti>>1), // input
|
||||
PHY_ofdm_mod(txdataF+(i*frame_parms->ofdm_symbol_size*frame_parms->symbols_per_tti>>1), // input
|
||||
txdata+(i*frame_parms->samples_per_tti>>1), // output
|
||||
frame_parms->log2_symbol_size, // log2_fft_size
|
||||
frame_parms->ofdm_symbol_size,
|
||||
1, // number of symbols
|
||||
frame_parms->nb_prefix_samples0, // number of prefix samples
|
||||
CYCLIC_PREFIX);
|
||||
@@ -71,9 +71,9 @@ void normal_prefix_mod(int32_t *txdataF,int32_t *txdata,uint8_t nsymb,LTE_DL_FRA
|
||||
printf("slot i %d (txdata offset %d)\n",i,OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES0+(i*frame_parms->samples_per_tti>>1));
|
||||
#endif
|
||||
|
||||
PHY_ofdm_mod(txdataF+NUMBER_OF_OFDM_CARRIERS+(i*NUMBER_OF_OFDM_CARRIERS*(frame_parms->symbols_per_tti>>1)), // input
|
||||
PHY_ofdm_mod(txdataF+frame_parms->ofdm_symbol_size+(i*frame_parms->ofdm_symbol_size*(frame_parms->symbols_per_tti>>1)), // input
|
||||
txdata+OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES0+(i*(frame_parms->samples_per_tti>>1)), // output
|
||||
frame_parms->log2_symbol_size, // log2_fft_size
|
||||
frame_parms->ofdm_symbol_size,
|
||||
(short_offset==1) ? 1 :(frame_parms->symbols_per_tti>>1)-1,//6, // number of symbols
|
||||
frame_parms->nb_prefix_samples, // number of prefix samples
|
||||
CYCLIC_PREFIX);
|
||||
@@ -84,7 +84,7 @@ void normal_prefix_mod(int32_t *txdataF,int32_t *txdata,uint8_t nsymb,LTE_DL_FRA
|
||||
|
||||
void PHY_ofdm_mod(int *input, /// pointer to complex input
|
||||
int *output, /// pointer to complex output
|
||||
unsigned char log2fftsize, /// log2(FFT_SIZE)
|
||||
int fftsize, /// FFT_SIZE
|
||||
unsigned char nb_symbols, /// number of OFDM symbols
|
||||
unsigned short nb_prefix_samples, /// cyclic prefix length
|
||||
Extension_t etype /// type of extension
|
||||
@@ -100,24 +100,28 @@ void PHY_ofdm_mod(int *input, /// pointer to complex input
|
||||
int *temp_ptr=(int*)0;
|
||||
void (*idft)(int16_t *,int16_t *, int);
|
||||
|
||||
switch (log2fftsize) {
|
||||
case 7:
|
||||
switch (fftsize) {
|
||||
case 128:
|
||||
idft = idft128;
|
||||
break;
|
||||
|
||||
case 8:
|
||||
case 256:
|
||||
idft = idft256;
|
||||
break;
|
||||
|
||||
case 9:
|
||||
case 512:
|
||||
idft = idft512;
|
||||
break;
|
||||
|
||||
case 10:
|
||||
case 1024:
|
||||
idft = idft1024;
|
||||
break;
|
||||
|
||||
case 11:
|
||||
case 1536:
|
||||
idft = idft1536;
|
||||
break;
|
||||
|
||||
case 2048:
|
||||
idft = idft2048;
|
||||
break;
|
||||
|
||||
@@ -127,8 +131,8 @@ void PHY_ofdm_mod(int *input, /// pointer to complex input
|
||||
}
|
||||
|
||||
#ifdef DEBUG_OFDM_MOD
|
||||
msg("[PHY] OFDM mod (size %d,prefix %d) Symbols %d, input %p, output %p\n",
|
||||
1<<log2fftsize,nb_prefix_samples,nb_symbols,input,output);
|
||||
printf("[PHY] OFDM mod (size %d,prefix %d) Symbols %d, input %p, output %p\n",
|
||||
fftsize,nb_prefix_samples,nb_symbols,input,output);
|
||||
#endif
|
||||
|
||||
|
||||
@@ -136,35 +140,31 @@ void PHY_ofdm_mod(int *input, /// pointer to complex input
|
||||
for (i=0; i<nb_symbols; i++) {
|
||||
|
||||
#ifdef DEBUG_OFDM_MOD
|
||||
msg("[PHY] symbol %d/%d (%p,%p -> %p)\n",i,nb_symbols,input,&input[i<<log2fftsize],&output[(i<<log2fftsize) + ((i)*nb_prefix_samples)]);
|
||||
printf("[PHY] symbol %d/%d offset %d (%p,%p -> %p)\n",i,nb_symbols,i*fftsize+(i*nb_prefix_samples),input,&input[i*fftsize],&output[(i*fftsize) + ((i)*nb_prefix_samples)]);
|
||||
#endif
|
||||
|
||||
idft((int16_t *)&input[i<<log2fftsize],
|
||||
(log2fftsize==7) ? (int16_t *)temp : (int16_t *)&output[(i<<log2fftsize) + ((1+i)*nb_prefix_samples)],
|
||||
idft((int16_t *)&input[i*fftsize],
|
||||
(fftsize==128) ? (int16_t *)temp : (int16_t *)&output[(i*fftsize) + ((1+i)*nb_prefix_samples)],
|
||||
1);
|
||||
// write_output("fft_out.m","fftout",temp,(1<<log2fftsize)*2,1,1);
|
||||
|
||||
//memset(temp,0,1<<log2fftsize);
|
||||
|
||||
|
||||
// Copy to frame buffer with Cyclic Extension
|
||||
// Note: will have to adjust for synchronization offset!
|
||||
|
||||
switch (etype) {
|
||||
case CYCLIC_PREFIX:
|
||||
output_ptr = &output[(i<<log2fftsize) + ((1+i)*nb_prefix_samples)];
|
||||
output_ptr = &output[(i*fftsize) + ((1+i)*nb_prefix_samples)];
|
||||
temp_ptr = (int *)temp;
|
||||
|
||||
|
||||
// msg("Doing cyclic prefix method\n");
|
||||
|
||||
if (log2fftsize==7) {
|
||||
for (j=0; j<((1<<log2fftsize)) ; j++) {
|
||||
if (fftsize==128) {
|
||||
for (j=0; j<fftsize ; j++) {
|
||||
output_ptr[j] = temp_ptr[j];
|
||||
}
|
||||
}
|
||||
|
||||
j=(1<<log2fftsize);
|
||||
j=fftsize;
|
||||
|
||||
for (k=-1; k>=-nb_prefix_samples; k--) {
|
||||
output_ptr[k] = output_ptr[--j];
|
||||
@@ -175,19 +175,19 @@ void PHY_ofdm_mod(int *input, /// pointer to complex input
|
||||
case CYCLIC_SUFFIX:
|
||||
|
||||
|
||||
output_ptr = &output[(i<<log2fftsize)+ (i*nb_prefix_samples)];
|
||||
output_ptr = &output[(i*fftsize)+ (i*nb_prefix_samples)];
|
||||
|
||||
temp_ptr = (int *)temp;
|
||||
|
||||
// msg("Doing cyclic suffix method\n");
|
||||
|
||||
for (j=0; j<(1<<log2fftsize) ; j++) {
|
||||
for (j=0; j<fftsize ; j++) {
|
||||
output_ptr[j] = temp_ptr[2*j];
|
||||
}
|
||||
|
||||
|
||||
for (j=0; j<nb_prefix_samples; j++)
|
||||
output_ptr[(1<<log2fftsize)+j] = output_ptr[j];
|
||||
output_ptr[fftsize+j] = output_ptr[j];
|
||||
|
||||
break;
|
||||
|
||||
@@ -198,11 +198,11 @@ void PHY_ofdm_mod(int *input, /// pointer to complex input
|
||||
case NONE:
|
||||
|
||||
// msg("NO EXTENSION!\n");
|
||||
output_ptr = &output[(i<<log2fftsize)];
|
||||
output_ptr = &output[fftsize];
|
||||
|
||||
temp_ptr = (int *)temp;
|
||||
|
||||
for (j=0; j<(1<<log2fftsize) ; j++) {
|
||||
for (j=0; j<fftsize ; j++) {
|
||||
output_ptr[j] = temp_ptr[2*j];
|
||||
|
||||
|
||||
@@ -219,14 +219,7 @@ void PHY_ofdm_mod(int *input, /// pointer to complex input
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
printf("input %p, output %p, log2fftsize %d, nsymb %d\n",input,output,log2fftsize,nb_symbols);
|
||||
for (i=0;i<16;i++)
|
||||
printf("%d %d\n",((short *)input)[i<<1],((short *)input)[1+(i<<1)]);
|
||||
printf("------\n");
|
||||
for (i=0;i<16;i++)
|
||||
printf("%d %d\n",((short *)output)[i<<1],((short *)output)[1+(i<<1)]);
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -244,7 +237,7 @@ void do_OFDM_mod(mod_sym_t **txdataF, int32_t **txdata, uint32_t frame,uint16_t
|
||||
LOG_D(PHY,"Frame %d, subframe %d: Doing MBSFN modulation (slot_offset %d)\n",frame,next_slot>>1,slot_offset);
|
||||
PHY_ofdm_mod(&txdataF[aa][slot_offset_F], // input
|
||||
&txdata[aa][slot_offset], // output
|
||||
frame_parms->log2_symbol_size, // log2_fft_size
|
||||
frame_parms->ofdm_symbol_size,
|
||||
12, // number of symbols
|
||||
frame_parms->ofdm_symbol_size>>2, // number of prefix samples
|
||||
CYCLIC_PREFIX);
|
||||
@@ -252,7 +245,7 @@ void do_OFDM_mod(mod_sym_t **txdataF, int32_t **txdata, uint32_t frame,uint16_t
|
||||
if (frame_parms->Ncp == EXTENDED)
|
||||
PHY_ofdm_mod(&txdataF[aa][slot_offset_F], // input
|
||||
&txdata[aa][slot_offset], // output
|
||||
frame_parms->log2_symbol_size, // log2_fft_size
|
||||
frame_parms->ofdm_symbol_size,
|
||||
2, // number of symbols
|
||||
frame_parms->nb_prefix_samples, // number of prefix samples
|
||||
CYCLIC_PREFIX);
|
||||
@@ -268,7 +261,7 @@ void do_OFDM_mod(mod_sym_t **txdataF, int32_t **txdata, uint32_t frame,uint16_t
|
||||
if (frame_parms->Ncp == EXTENDED)
|
||||
PHY_ofdm_mod(&txdataF[aa][slot_offset_F], // input
|
||||
&txdata[aa][slot_offset], // output
|
||||
frame_parms->log2_symbol_size, // log2_fft_size
|
||||
frame_parms->ofdm_symbol_size,
|
||||
6, // number of symbols
|
||||
frame_parms->nb_prefix_samples, // number of prefix samples
|
||||
CYCLIC_PREFIX);
|
||||
|
||||
@@ -63,24 +63,28 @@ int slot_fep(PHY_VARS_UE *phy_vars_ue,
|
||||
void (*dft)(int16_t *,int16_t *, int);
|
||||
int tmp_dft_in[256]; // This is for misalignment issues for 6 and 15 PRBs
|
||||
|
||||
switch (frame_parms->log2_symbol_size) {
|
||||
case 7:
|
||||
switch (frame_parms->ofdm_symbol_size) {
|
||||
case 128:
|
||||
dft = dft128;
|
||||
break;
|
||||
|
||||
case 8:
|
||||
case 256:
|
||||
dft = dft256;
|
||||
break;
|
||||
|
||||
case 9:
|
||||
case 512:
|
||||
dft = dft512;
|
||||
break;
|
||||
|
||||
case 10:
|
||||
case 1024:
|
||||
dft = dft1024;
|
||||
break;
|
||||
|
||||
case 11:
|
||||
case 1536:
|
||||
dft = dft1536;
|
||||
break;
|
||||
|
||||
case 2048:
|
||||
dft = dft2048;
|
||||
break;
|
||||
|
||||
@@ -101,12 +105,12 @@ int slot_fep(PHY_VARS_UE *phy_vars_ue,
|
||||
|
||||
|
||||
if (l<0 || l>=7-frame_parms->Ncp) {
|
||||
msg("slot_fep: l must be between 0 and %d\n",7-frame_parms->Ncp);
|
||||
printf("slot_fep: l must be between 0 and %d\n",7-frame_parms->Ncp);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
if (Ns<0 || Ns>=20) {
|
||||
msg("slot_fep: Ns must be between 0 and 19\n");
|
||||
printf("slot_fep: Ns must be between 0 and 19\n");
|
||||
return(-1);
|
||||
}
|
||||
|
||||
@@ -121,7 +125,7 @@ int slot_fep(PHY_VARS_UE *phy_vars_ue,
|
||||
|
||||
#ifdef DEBUG_FEP
|
||||
// if (phy_vars_ue->frame <100)
|
||||
msg("slot_fep: frame %d: slot %d, symbol %d, nb_prefix_samples %d, nb_prefix_samples0 %d, slot_offset %d, subframe_offset %d, sample_offset %d,rx_offset %d\n", phy_vars_ue->frame_rx,Ns, symbol,
|
||||
printf("slot_fep: frame %d: slot %d, symbol %d, nb_prefix_samples %d, nb_prefix_samples0 %d, slot_offset %d, subframe_offset %d, sample_offset %d,rx_offset %d\n", phy_vars_ue->frame_rx,Ns, symbol,
|
||||
nb_prefix_samples,nb_prefix_samples0,slot_offset,subframe_offset,sample_offset,rx_offset);
|
||||
#endif
|
||||
|
||||
@@ -152,7 +156,7 @@ int slot_fep(PHY_VARS_UE *phy_vars_ue,
|
||||
|
||||
#ifdef DEBUG_FEP
|
||||
// if (phy_vars_ue->frame <100)
|
||||
msg("slot_fep: frame %d: slot %d, symbol %d, nb_prefix_samples %d, nb_prefix_samples0 %d, slot_offset %d, subframe_offset %d, sample_offset %d,rx_offset %d\n", phy_vars_ue->frame_rx,Ns, symbol,
|
||||
printf("slot_fep: frame %d: slot %d, symbol %d, nb_prefix_samples %d, nb_prefix_samples0 %d, slot_offset %d, subframe_offset %d, sample_offset %d,rx_offset %d\n", phy_vars_ue->frame_rx,Ns, symbol,
|
||||
nb_prefix_samples,nb_prefix_samples0,slot_offset,subframe_offset,sample_offset,rx_offset);
|
||||
#endif
|
||||
|
||||
@@ -187,7 +191,7 @@ int slot_fep(PHY_VARS_UE *phy_vars_ue,
|
||||
for (aa=0; aa<frame_parms->nb_antenna_ports_eNB; aa++) {
|
||||
|
||||
#ifdef DEBUG_FEP
|
||||
msg("Channel estimation eNB %d, aatx %d, slot %d, symbol %d\n",eNB_id,aa,Ns,l);
|
||||
printf("Channel estimation eNB %d, aatx %d, slot %d, symbol %d\n",eNB_id,aa,Ns,l);
|
||||
#endif
|
||||
start_meas(&phy_vars_ue->dlsch_channel_estimation_stats);
|
||||
lte_dl_channel_estimation(phy_vars_ue,eNB_id,0,
|
||||
@@ -210,7 +214,7 @@ int slot_fep(PHY_VARS_UE *phy_vars_ue,
|
||||
// do frequency offset estimation here!
|
||||
// use channel estimates from current symbol (=ch_t) and last symbol (ch_{t-1})
|
||||
#ifdef DEBUG_FEP
|
||||
msg("Frequency offset estimation\n");
|
||||
printf("Frequency offset estimation\n");
|
||||
#endif
|
||||
|
||||
if (l==(4-frame_parms->Ncp)) {
|
||||
@@ -228,7 +232,7 @@ int slot_fep(PHY_VARS_UE *phy_vars_ue,
|
||||
}
|
||||
|
||||
#ifdef DEBUG_FEP
|
||||
msg("slot_fep: done\n");
|
||||
printf("slot_fep: done\n");
|
||||
#endif
|
||||
return(0);
|
||||
}
|
||||
|
||||
@@ -54,25 +54,29 @@ int slot_fep_mbsfn(PHY_VARS_UE *phy_vars_ue,
|
||||
unsigned int frame_length_samples = frame_parms->samples_per_tti * 10;
|
||||
void (*dft)(int16_t *,int16_t *, int);
|
||||
|
||||
switch (frame_parms->log2_symbol_size) {
|
||||
switch (frame_parms->ofdm_symbol_size) {
|
||||
|
||||
case 7:
|
||||
case 128:
|
||||
dft = dft128;
|
||||
break;
|
||||
|
||||
case 8:
|
||||
case 256:
|
||||
dft = dft256;
|
||||
break;
|
||||
|
||||
case 9:
|
||||
case 512:
|
||||
dft = dft512;
|
||||
break;
|
||||
|
||||
case 10:
|
||||
case 1024:
|
||||
dft = dft1024;
|
||||
break;
|
||||
|
||||
case 11:
|
||||
case 1536:
|
||||
dft = dft1536;
|
||||
break;
|
||||
|
||||
case 2048:
|
||||
dft = dft2048;
|
||||
break;
|
||||
|
||||
|
||||
@@ -50,24 +50,28 @@ int slot_fep_ul(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
|
||||
void (*dft)(int16_t *,int16_t *, int);
|
||||
|
||||
switch (frame_parms->log2_symbol_size) {
|
||||
case 7:
|
||||
switch (frame_parms->ofdm_symbol_size) {
|
||||
case 128:
|
||||
dft = dft128;
|
||||
break;
|
||||
|
||||
case 8:
|
||||
case 256:
|
||||
dft = dft256;
|
||||
break;
|
||||
|
||||
case 9:
|
||||
case 512:
|
||||
dft = dft512;
|
||||
break;
|
||||
|
||||
case 10:
|
||||
case 1024:
|
||||
dft = dft1024;
|
||||
break;
|
||||
|
||||
case 11:
|
||||
case 1536:
|
||||
dft = dft1536;
|
||||
break;
|
||||
|
||||
case 2048:
|
||||
dft = dft2048;
|
||||
break;
|
||||
|
||||
|
||||
@@ -115,11 +115,11 @@ int32_t dot_product(int16_t *x,
|
||||
// convert back to integer
|
||||
result = _mm_cvtsi64_si32(mmtmp7);
|
||||
|
||||
return(result);
|
||||
|
||||
_mm_empty();
|
||||
_m_empty();
|
||||
|
||||
return(result);
|
||||
|
||||
#elif defined(__arm__)
|
||||
int16x4_t *x_128=(int16x4_t*)x;
|
||||
int16x4_t *y_128=(int16x4_t*)y;
|
||||
|
||||
@@ -45,8 +45,10 @@
|
||||
#define debug_msg
|
||||
#define ONE_OVER_SQRT2_Q15 23170
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
#define ONE_OVER_SQRT3_Q15 18919
|
||||
|
||||
#include "PHY/sse_intrin.h"
|
||||
|
||||
@@ -94,7 +96,7 @@ static inline void cmacc(__m128i a,__m128i b, __m128i *re32, __m128i *im32)
|
||||
cmac_tmp = _mm_sign_epi16(b,*(__m128i*)reflip);
|
||||
// cmac_tmp = _mm_shufflelo_epi16(b,_MM_SHUFFLE(2,3,0,1));
|
||||
// cmac_tmp = _mm_shufflehi_epi16(cmac_tmp,_MM_SHUFFLE(2,3,0,1));
|
||||
cmac_tmp = _mm_shuffle_epi8(b,_mm_set_epi8(13,12,15,14,9,8,11,10,5,4,7,6,1,0,3,2));
|
||||
cmac_tmp = _mm_shuffle_epi8(cmac_tmp,_mm_set_epi8(13,12,15,14,9,8,11,10,5,4,7,6,1,0,3,2));
|
||||
cmac_tmp_im32 = _mm_madd_epi16(cmac_tmp,a);
|
||||
|
||||
*re32 = _mm_add_epi32(*re32,cmac_tmp_re32);
|
||||
@@ -3180,6 +3182,8 @@ void idft1536(int16_t *input, int16_t *output)
|
||||
int i,i2,j;
|
||||
uint32_t tmp[3][512 ]__attribute__((aligned(16)));
|
||||
uint32_t tmpo[3][512] __attribute__((aligned(16)));
|
||||
simd_q15_t *y128p=(simd_q15_t*)output;
|
||||
simd_q15_t ONE_OVER_SQRT3_Q15_128 = set1_int16(ONE_OVER_SQRT3_Q15);
|
||||
|
||||
for (i=0,j=0; i<512; i++) {
|
||||
tmp[0][i] = ((uint32_t *)input)[j++];
|
||||
@@ -3190,17 +3194,6 @@ void idft1536(int16_t *input, int16_t *output)
|
||||
idft512((int16_t*)(tmp[0]),(int16_t*)(tmpo[0]),1);
|
||||
idft512((int16_t*)(tmp[1]),(int16_t*)(tmpo[1]),1);
|
||||
idft512((int16_t*)(tmp[2]),(int16_t*)(tmpo[2]),1);
|
||||
/*
|
||||
for (i=1; i<512; i++) {
|
||||
tmpo[0][i] = tmpo[0][i<<1];
|
||||
tmpo[1][i] = tmpo[1][i<<1];
|
||||
tmpo[2][i] = tmpo[2][i<<1];
|
||||
}*/
|
||||
|
||||
// write_output("in.m","in",input,6144,1,1);
|
||||
// write_output("out0.m","o0",tmpo[0],2048,1,1);
|
||||
// write_output("out1.m","o1",tmpo[1],2048,1,1);
|
||||
// write_output("out2.m","o2",tmpo[2],2048,1,1);
|
||||
|
||||
for (i=0,i2=0; i<1024; i+=8,i2+=4) {
|
||||
ibfly3((simd_q15_t*)(&tmpo[0][i2]),(simd_q15_t*)(&tmpo[1][i2]),((simd_q15_t*)&tmpo[2][i2]),
|
||||
@@ -3209,6 +3202,26 @@ void idft1536(int16_t *input, int16_t *output)
|
||||
}
|
||||
|
||||
|
||||
for (i=0; i<24; i++) {
|
||||
y128p[0] = mulhi_int16(y128p[0],ONE_OVER_SQRT3_Q15_128);
|
||||
y128p[1] = mulhi_int16(y128p[1],ONE_OVER_SQRT3_Q15_128);
|
||||
y128p[2] = mulhi_int16(y128p[2],ONE_OVER_SQRT3_Q15_128);
|
||||
y128p[3] = mulhi_int16(y128p[3],ONE_OVER_SQRT3_Q15_128);
|
||||
y128p[4] = mulhi_int16(y128p[4],ONE_OVER_SQRT3_Q15_128);
|
||||
y128p[5] = mulhi_int16(y128p[5],ONE_OVER_SQRT3_Q15_128);
|
||||
y128p[6] = mulhi_int16(y128p[6],ONE_OVER_SQRT3_Q15_128);
|
||||
y128p[7] = mulhi_int16(y128p[7],ONE_OVER_SQRT3_Q15_128);
|
||||
y128p[8] = mulhi_int16(y128p[8],ONE_OVER_SQRT3_Q15_128);
|
||||
y128p[9] = mulhi_int16(y128p[9],ONE_OVER_SQRT3_Q15_128);
|
||||
y128p[10] = mulhi_int16(y128p[10],ONE_OVER_SQRT3_Q15_128);
|
||||
y128p[11] = mulhi_int16(y128p[11],ONE_OVER_SQRT3_Q15_128);
|
||||
y128p[12] = mulhi_int16(y128p[12],ONE_OVER_SQRT3_Q15_128);
|
||||
y128p[13] = mulhi_int16(y128p[13],ONE_OVER_SQRT3_Q15_128);
|
||||
y128p[14] = mulhi_int16(y128p[14],ONE_OVER_SQRT3_Q15_128);
|
||||
y128p[15] = mulhi_int16(y128p[15],ONE_OVER_SQRT3_Q15_128);
|
||||
y128p+=16;
|
||||
}
|
||||
|
||||
_mm_empty();
|
||||
_m_empty();
|
||||
|
||||
|
||||
@@ -119,7 +119,7 @@ FD_lte_phy_scope_enb *create_lte_phy_scope_enb( void )
|
||||
fl_set_xyplot_xgrid( fdui->pusch_llr,FL_GRID_MAJOR);
|
||||
|
||||
// I/Q PUCCH comp (format 1)
|
||||
fdui->pucch_comp1 = fl_add_xyplot( FL_POINTS_XYPLOT, 540, 480, 240, 100, "PUCCH I/Q of MF Output" );
|
||||
fdui->pucch_comp1 = fl_add_xyplot( FL_POINTS_XYPLOT, 540, 480, 240, 100, "PUCCH1 Energy (SR)" );
|
||||
fl_set_object_boxtype( fdui->pucch_comp1, FL_EMBOSSED_BOX );
|
||||
fl_set_object_color( fdui->pucch_comp1, FL_BLACK, FL_YELLOW );
|
||||
fl_set_object_lcolor( fdui->pucch_comp1, FL_WHITE ); // Label color
|
||||
@@ -160,7 +160,7 @@ void phy_scope_eNB(FD_lte_phy_scope_enb *form,
|
||||
int UE_id)
|
||||
{
|
||||
int eNB_id = 0;
|
||||
int i,arx,atx,ind,k;
|
||||
int i,i2,arx,atx,ind,k;
|
||||
LTE_DL_FRAME_PARMS *frame_parms = &phy_vars_enb->lte_frame_parms;
|
||||
int nsymb_ce = 12*frame_parms->N_RB_UL*frame_parms->symbols_per_tti;
|
||||
uint8_t nb_antennas_rx = frame_parms->nb_antennas_rx;
|
||||
@@ -171,15 +171,17 @@ void phy_scope_eNB(FD_lte_phy_scope_enb *form,
|
||||
int16_t *pusch_llr;
|
||||
int16_t *pusch_comp;
|
||||
int32_t *pucch1_comp;
|
||||
int16_t *pucch1ab_comp;
|
||||
int32_t *pucch1_thres;
|
||||
int32_t *pucch1ab_comp;
|
||||
float Re,Im,ymax;
|
||||
float *llr, *bit;
|
||||
float I[nsymb_ce*2], Q[nsymb_ce*2];
|
||||
float I_pucch[10240],Q_pucch[10240],A_pucch[10240],B_pucch[10240];
|
||||
float I_pucch[10240],Q_pucch[10240],A_pucch[10240],B_pucch[10240],C_pucch[10240];
|
||||
float rxsig_t_dB[nb_antennas_rx][FRAME_LENGTH_COMPLEX_SAMPLES];
|
||||
float chest_t_abs[nb_antennas_rx][frame_parms->ofdm_symbol_size];
|
||||
float *chest_f_abs;
|
||||
float time[FRAME_LENGTH_COMPLEX_SAMPLES];
|
||||
float time2[2048];
|
||||
float freq[nsymb_ce*nb_antennas_rx*nb_antennas_tx];
|
||||
int frame = phy_vars_enb->proc[0].frame_tx;
|
||||
uint32_t total_dlsch_bitrate = phy_vars_enb->total_dlsch_bitrate;
|
||||
@@ -206,7 +208,8 @@ void phy_scope_eNB(FD_lte_phy_scope_enb *form,
|
||||
pusch_llr = (int16_t*) phy_vars_enb->lte_eNB_pusch_vars[UE_id]->llr;
|
||||
pusch_comp = (int16_t*) phy_vars_enb->lte_eNB_pusch_vars[UE_id]->rxdataF_comp[eNB_id][0];
|
||||
pucch1_comp = (int32_t*) phy_vars_enb->pucch1_stats[UE_id];
|
||||
pucch1ab_comp = (int16_t*) phy_vars_enb->pucch1ab_stats[UE_id];
|
||||
pucch1_thres = (int32_t*) phy_vars_enb->pucch1_stats_thres[UE_id];
|
||||
pucch1ab_comp = (int32_t*) phy_vars_enb->pucch1ab_stats[UE_id];
|
||||
|
||||
// Received signal in time domain of receive antenna 0
|
||||
if (rxsig_t != NULL) {
|
||||
@@ -236,19 +239,21 @@ void phy_scope_eNB(FD_lte_phy_scope_enb *form,
|
||||
|
||||
if (chest_t[0] !=NULL) {
|
||||
for (i=0; i<(frame_parms->ofdm_symbol_size); i++) {
|
||||
chest_t_abs[0][i] = 10*log10((float) (chest_t[0][2*i]*chest_t[0][2*i]+chest_t[0][2*i+1]*chest_t[0][2*i+1]));
|
||||
i2 = (i+(frame_parms->ofdm_symbol_size>>1))%frame_parms->ofdm_symbol_size;
|
||||
time2[i] = (float)(i-(frame_parms->ofdm_symbol_size>>1));
|
||||
chest_t_abs[0][i] = 10*log10((float) (1+chest_t[0][2*i2]*chest_t[0][2*i2]+chest_t[0][2*i2+1]*chest_t[0][2*i2+1]));
|
||||
|
||||
if (chest_t_abs[0][i] > ymax)
|
||||
ymax = chest_t_abs[0][i];
|
||||
}
|
||||
|
||||
fl_set_xyplot_data(form->chest_t,time,chest_t_abs[0],(frame_parms->ofdm_symbol_size),"","","");
|
||||
fl_set_xyplot_data(form->chest_t,time2,chest_t_abs[0],(frame_parms->ofdm_symbol_size),"","","");
|
||||
}
|
||||
|
||||
for (arx=1; arx<nb_antennas_rx; arx++) {
|
||||
if (chest_t[arx] !=NULL) {
|
||||
for (i=0; i<(frame_parms->ofdm_symbol_size>>3); i++) {
|
||||
chest_t_abs[arx][i] = 10*log10((float) (chest_t[arx][2*i]*chest_t[arx][2*i]+chest_t[arx][2*i+1]*chest_t[arx][2*i+1]));
|
||||
chest_t_abs[arx][i] = 10*log10((float) (1+chest_t[arx][2*i]*chest_t[arx][2*i]+chest_t[arx][2*i+1]*chest_t[arx][2*i+1]));
|
||||
|
||||
if (chest_t_abs[arx][i] > ymax)
|
||||
ymax = chest_t_abs[arx][i];
|
||||
@@ -337,16 +342,20 @@ void phy_scope_eNB(FD_lte_phy_scope_enb *form,
|
||||
// PUSCH I/Q of MF Output
|
||||
if (pucch1ab_comp!=NULL) {
|
||||
for (ind=0; ind<10240; ind++) {
|
||||
I_pucch[ind] = pucch1ab_comp[2*ind];
|
||||
Q_pucch[ind] = pucch1ab_comp[2*ind+1];
|
||||
|
||||
I_pucch[ind] = (float)pucch1ab_comp[2*(ind)];
|
||||
Q_pucch[ind] = (float)pucch1ab_comp[2*(ind)+1];
|
||||
A_pucch[ind] = 10*log10(pucch1_comp[ind]);
|
||||
B_pucch[ind] = ind;
|
||||
C_pucch[ind] = (float)pucch1_thres[ind];
|
||||
}
|
||||
fl_set_xyplot_data(form->pucch_comp,I_pucch,Q_pucch,10240,"","","");
|
||||
fl_set_xyplot_data(form->pucch_comp1,B_pucch,A_pucch,1024,"","","");
|
||||
fl_set_xyplot_xbounds(form->pucch_comp,-200,200);
|
||||
fl_set_xyplot_ybounds(form->pucch_comp,-100,100);
|
||||
fl_set_xyplot_ybounds(form->pucch_comp1,10,40);
|
||||
fl_add_xyplot_overlay(form->pucch_comp1,1,B_pucch,C_pucch,1024,FL_RED);
|
||||
fl_set_xyplot_ybounds(form->pucch_comp,-5000,5000);
|
||||
fl_set_xyplot_xbounds(form->pucch_comp,-5000,5000);
|
||||
|
||||
fl_set_xyplot_ybounds(form->pucch_comp1,20,80);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -197,7 +197,7 @@ int32_t signal_energy(int32_t *input,uint32_t length)
|
||||
for (i=0; i<length>>1; i++) {
|
||||
|
||||
tmpE = vqaddq_s32(tmpE,vshrq_n_s32(vmull_s16(*in,*in),shift));
|
||||
tmpDC = vaddw_s16(tmpDC,vshr_n_s16(*in++,shift_DC));
|
||||
//tmpDC = vaddw_s16(tmpDC,vshr_n_s16(*in++,shift_DC));
|
||||
|
||||
}
|
||||
|
||||
|
||||
+12
-2
@@ -76,6 +76,13 @@
|
||||
#define openair_free(y,x) free((y))
|
||||
#define PAGE_SIZE 4096
|
||||
|
||||
//#ifdef SHRLIBDEV
|
||||
//extern int rxrescale;
|
||||
//#define RX_IQRESCALELEN rxrescale
|
||||
//#else
|
||||
//#define RX_IQRESCALELEN 15
|
||||
//#endif
|
||||
|
||||
//! \brief Allocate \c size bytes of memory on the heap with alignment 16 and zero it afterwards.
|
||||
//! If no more memory is available, this function will terminate the program with an assertion error.
|
||||
static inline void* malloc16_clear( size_t size )
|
||||
@@ -316,6 +323,8 @@ typedef struct PHY_VARS_eNB_s {
|
||||
struct PhysicalConfigDedicated *physicalConfigDedicated[NUMBER_OF_UE_MAX];
|
||||
|
||||
|
||||
uint32_t rb_mask_ul[4];
|
||||
|
||||
/// Information regarding TM5
|
||||
MU_MIMO_mode mu_mimo_mode[NUMBER_OF_UE_MAX];
|
||||
|
||||
@@ -377,12 +386,13 @@ typedef struct PHY_VARS_eNB_s {
|
||||
#ifdef LOCALIZATION
|
||||
/// time state for localization
|
||||
time_stats_t localization_stats;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
int32_t pucch1_stats_cnt[NUMBER_OF_UE_MAX][10];
|
||||
int32_t pucch1_stats[NUMBER_OF_UE_MAX][10*1024];
|
||||
int32_t pucch1_stats_thres[NUMBER_OF_UE_MAX][10*1024];
|
||||
int32_t pucch1ab_stats_cnt[NUMBER_OF_UE_MAX][10];
|
||||
int32_t pucch1ab_stats[NUMBER_OF_UE_MAX][10*1024];
|
||||
int32_t pucch1ab_stats[NUMBER_OF_UE_MAX][2*10*1024];
|
||||
|
||||
#if ENABLE_RAL
|
||||
hash_table_t *ral_thresholds_timed;
|
||||
|
||||
@@ -516,10 +516,10 @@ typedef struct {
|
||||
uint8_t dual_tx;
|
||||
/// flag to indicate SISO transmission
|
||||
uint8_t mode1_flag;
|
||||
/// Indicator that 20 MHz channel uses 3/4 sampling frequency
|
||||
uint8_t threequarter_fs;
|
||||
/// Size of FFT
|
||||
uint16_t ofdm_symbol_size;
|
||||
/// log2(Size of FFT)
|
||||
uint8_t log2_symbol_size;
|
||||
/// Number of prefix samples in all but first symbol of slot
|
||||
uint16_t nb_prefix_samples;
|
||||
/// Number of prefix samples in first symbol of slot
|
||||
|
||||
@@ -44,7 +44,14 @@
|
||||
/** @defgroup _ref_implementation_ OpenAirInterface LTE Implementation
|
||||
* @{
|
||||
|
||||
* @defgroup _PHY_RF_INTERFACE_ Generic PHY - RF Interface
|
||||
* @defgroup _PHY_RF_INTERFACE_ PHY - RF Interface
|
||||
* @ingroup _PHY_RF_INTERFACE_
|
||||
* @{
|
||||
* @defgroup _GENERIC_PHY_RF_INTERFACE_ Generic PHY - RF Interface
|
||||
* @defgroup _USRP_PHY_RF_INTERFACE_ PHY - USRP RF Interface
|
||||
* @defgroup _BLADERF_PHY_RF_INTERFACE_ PHY - BLADERF RF Interface
|
||||
* @}
|
||||
*
|
||||
* @ingroup _ref_implementation_
|
||||
* @{
|
||||
* This module is responsible for defining the generic interface between PHY and RF Target
|
||||
@@ -117,7 +124,6 @@
|
||||
*/
|
||||
#define NUMBER_OF_OFDM_CARRIERS (frame_parms->ofdm_symbol_size)
|
||||
#define NUMBER_OF_SYMBOLS_PER_FRAME (frame_parms->symbols_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME)
|
||||
#define LOG2_NUMBER_OF_OFDM_CARRIERS (frame_parms->log2_symbol_size)
|
||||
#define NUMBER_OF_USEFUL_CARRIERS (12*frame_parms->N_RB_DL)
|
||||
#define NUMBER_OF_ZERO_CARRIERS (NUMBER_OF_OFDM_CARRIERS-NUMBER_OF_USEFUL_CARRIERS)
|
||||
#define NUMBER_OF_USEFUL_CARRIERS_BYTES (NUMBER_OF_USEFUL_CARRIERS>>2)
|
||||
@@ -341,13 +347,12 @@ typedef struct {
|
||||
#define NUMBER_OF_SUBBANDS_MAX 13
|
||||
#define NUMBER_OF_HARQ_PID_MAX 8
|
||||
|
||||
#if defined(CBMIMO1) || defined(EXMIMO) || defined(OAI_USRP)
|
||||
#define MAX_FRAME_NUMBER 0x400
|
||||
#if defined(CBMIMO1) || defined(EXMIMO) || defined(OAI_USRP)
|
||||
#define NUMBER_OF_eNB_MAX 1
|
||||
#define NUMBER_OF_UE_MAX 4
|
||||
#define NUMBER_OF_CONNECTED_eNB_MAX 3
|
||||
#else
|
||||
#define MAX_FRAME_NUMBER 0xFFFF
|
||||
#ifdef LARGE_SCALE
|
||||
#define NUMBER_OF_eNB_MAX 2
|
||||
#define NUMBER_OF_UE_MAX 120
|
||||
@@ -472,13 +477,13 @@ typedef struct {
|
||||
//! estimated avg noise power (dB)
|
||||
short n0_power_tot_dBm;
|
||||
//! estimated avg noise power per RB per RX ant (lin)
|
||||
unsigned short n0_subband_power[NB_ANTENNAS_RX][25];
|
||||
unsigned short n0_subband_power[NB_ANTENNAS_RX][100];
|
||||
//! estimated avg noise power per RB per RX ant (dB)
|
||||
unsigned short n0_subband_power_dB[NB_ANTENNAS_RX][25];
|
||||
unsigned short n0_subband_power_dB[NB_ANTENNAS_RX][100];
|
||||
//! estimated avg noise power per RB (dB)
|
||||
short n0_subband_power_tot_dB[25];
|
||||
short n0_subband_power_tot_dB[100];
|
||||
//! estimated avg noise power per RB (dBm)
|
||||
short n0_subband_power_tot_dBm[25];
|
||||
short n0_subband_power_tot_dBm[100];
|
||||
// eNB measurements (per user)
|
||||
//! estimated received spatial signal power (linear)
|
||||
unsigned int rx_spatial_power[NUMBER_OF_UE_MAX][2][2];
|
||||
@@ -498,13 +503,13 @@ typedef struct {
|
||||
/// Wideband CQI (sum of all RX antennas, in dB)
|
||||
char wideband_cqi_tot[NUMBER_OF_UE_MAX];
|
||||
/// Subband CQI per RX antenna and RB (= SINR)
|
||||
int subband_cqi[NUMBER_OF_UE_MAX][NB_ANTENNAS_RX][25];
|
||||
int subband_cqi[NUMBER_OF_UE_MAX][NB_ANTENNAS_RX][100];
|
||||
/// Total Subband CQI and RB (= SINR)
|
||||
int subband_cqi_tot[NUMBER_OF_UE_MAX][25];
|
||||
int subband_cqi_tot[NUMBER_OF_UE_MAX][100];
|
||||
/// Subband CQI in dB and RB (= SINR dB)
|
||||
int subband_cqi_dB[NUMBER_OF_UE_MAX][NB_ANTENNAS_RX][25];
|
||||
int subband_cqi_dB[NUMBER_OF_UE_MAX][NB_ANTENNAS_RX][100];
|
||||
/// Total Subband CQI and RB
|
||||
int subband_cqi_tot_dB[NUMBER_OF_UE_MAX][25];
|
||||
int subband_cqi_tot_dB[NUMBER_OF_UE_MAX][100];
|
||||
|
||||
} PHY_MEASUREMENTS_eNB;
|
||||
|
||||
|
||||
@@ -399,8 +399,9 @@ uint32_t pdcch_alloc2ul_frame(LTE_DL_FRAME_PARMS *frame_parms,uint32_t frame, ui
|
||||
|
||||
uint16_t get_Np(uint8_t N_RB_DL,uint8_t nCCE,uint8_t plus1);
|
||||
|
||||
int get_nCCE_offset(unsigned char L, int nCCE, int common_dci, unsigned short rnti, unsigned char subframe);
|
||||
|
||||
void put_harq_pid_in_freelist(LTE_eNB_DLSCH_t *DLSCH_ptr, int harq_pid);
|
||||
void remove_harq_pid_from_freelist(LTE_eNB_DLSCH_t *DLSCH_ptr, int harq_pid);
|
||||
|
||||
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);
|
||||
|
||||
@@ -405,8 +405,8 @@ uint8_t get_ack(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
|
||||
if (harq_ack[0].send_harq_status == 1)
|
||||
o_ACK[1] = harq_ack[0].ack;
|
||||
} else if (harq_ack[8].send_harq_status == 1)
|
||||
o_ACK[0] = harq_ack[8].ack;
|
||||
} else if (harq_ack[0].send_harq_status == 1)
|
||||
o_ACK[0] = harq_ack[0].ack;
|
||||
|
||||
status = harq_ack[9].send_harq_status + (harq_ack[0].send_harq_status<<1);
|
||||
//printf("Subframe 4, TDD config 3: harq_ack[9] = %d,harq_ack[0] = %d\n",harq_ack[9].ack,harq_ack[0].ack);
|
||||
|
||||
@@ -104,7 +104,6 @@ extern uint8_t smbv_frame_cnt;
|
||||
#ifdef DIAG_PHY
|
||||
extern int rx_sig_fifo;
|
||||
#endif
|
||||
static unsigned char I0_clear = 1;
|
||||
|
||||
uint8_t is_SR_subframe(PHY_VARS_eNB *phy_vars_eNB,uint8_t UE_id,uint8_t sched_subframe)
|
||||
{
|
||||
@@ -136,6 +135,30 @@ uint8_t is_SR_subframe(PHY_VARS_eNB *phy_vars_eNB,uint8_t UE_id,uint8_t sched_su
|
||||
return(0);
|
||||
}
|
||||
|
||||
void put_harq_pid_in_freelist(LTE_eNB_DLSCH_t *DLSCH_ptr, int harq_pid)
|
||||
{
|
||||
DLSCH_ptr->harq_pid_freelist[DLSCH_ptr->tail_freelist] = harq_pid;
|
||||
DLSCH_ptr->tail_freelist = (DLSCH_ptr->tail_freelist + 1) % 10;
|
||||
}
|
||||
|
||||
void remove_harq_pid_from_freelist(LTE_eNB_DLSCH_t *DLSCH_ptr, int harq_pid)
|
||||
{
|
||||
if (DLSCH_ptr->head_freelist == DLSCH_ptr->tail_freelist) {
|
||||
LOG_E(PHY, "%s:%d: you cannot read this!\n", __FILE__, __LINE__);
|
||||
abort();
|
||||
}
|
||||
/* basic check, in case several threads deal with the free list at the same time
|
||||
* in normal situations it should not happen, that's also why we don't use any
|
||||
* locking mechanism to protect the free list
|
||||
* to be refined in case things don't work properly
|
||||
*/
|
||||
if (harq_pid != DLSCH_ptr->harq_pid_freelist[DLSCH_ptr->head_freelist]) {
|
||||
LOG_E(PHY, "%s:%d: critical error, get in touch with the authors\n", __FILE__, __LINE__);
|
||||
abort();
|
||||
}
|
||||
DLSCH_ptr->head_freelist = (DLSCH_ptr->head_freelist + 1) % 10;
|
||||
}
|
||||
|
||||
int32_t add_ue(int16_t rnti, PHY_VARS_eNB *phy_vars_eNB)
|
||||
{
|
||||
uint8_t i;
|
||||
@@ -178,6 +201,7 @@ 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)
|
||||
{
|
||||
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)) {
|
||||
@@ -196,6 +220,13 @@ int32_t remove_ue(uint16_t rnti, PHY_VARS_eNB *phy_vars_eNB, uint8_t abstraction
|
||||
//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);
|
||||
}
|
||||
}
|
||||
@@ -224,14 +255,12 @@ int8_t find_next_ue_index(PHY_VARS_eNB *phy_vars_eNB)
|
||||
|
||||
int get_ue_active_harq_pid(const uint8_t Mod_id,const uint8_t CC_id,const uint16_t rnti, const int frame, const uint8_t subframe,uint8_t *harq_pid,uint8_t *round,const uint8_t ul_flag)
|
||||
{
|
||||
|
||||
LTE_eNB_DLSCH_t *DLSCH_ptr;
|
||||
LTE_eNB_ULSCH_t *ULSCH_ptr;
|
||||
uint8_t ulsch_subframe,ulsch_frame;
|
||||
uint8_t i;
|
||||
int8_t UE_id = find_ue(rnti,PHY_vars_eNB_g[Mod_id][CC_id]);
|
||||
int sf1=(10*frame)+subframe,sf2,sfdiff,sfdiff_max=7;
|
||||
int first_proc_found=0;
|
||||
|
||||
if (UE_id==-1) {
|
||||
LOG_D(PHY,"Cannot find UE with rnti %x (Mod_id %d, CC_id %d)\n",rnti, Mod_id, CC_id);
|
||||
@@ -247,18 +276,7 @@ int get_ue_active_harq_pid(const uint8_t Mod_id,const uint8_t CC_id,const uint16
|
||||
|
||||
for (i=0; i<DLSCH_ptr->Mdlharq; i++) {
|
||||
if (DLSCH_ptr->harq_processes[i]!=NULL) {
|
||||
if (DLSCH_ptr->harq_processes[i]->status != ACTIVE) {
|
||||
// store first inactive process
|
||||
if (first_proc_found == 0) {
|
||||
first_proc_found = 1;
|
||||
*harq_pid = i;
|
||||
*round = 0;
|
||||
LOG_D(PHY,"process %d is first free process\n",i);
|
||||
}
|
||||
else {
|
||||
LOG_D(PHY,"process %d is free\n",i);
|
||||
}
|
||||
} else {
|
||||
if (DLSCH_ptr->harq_processes[i]->status == ACTIVE) {
|
||||
sf2 = (DLSCH_ptr->harq_processes[i]->frame*10) + DLSCH_ptr->harq_processes[i]->subframe;
|
||||
if (sf2<=sf1)
|
||||
sfdiff = sf1-sf2;
|
||||
@@ -270,7 +288,6 @@ int get_ue_active_harq_pid(const uint8_t Mod_id,const uint8_t CC_id,const uint16
|
||||
sfdiff_max = sfdiff;
|
||||
*harq_pid = i;
|
||||
*round = DLSCH_ptr->harq_processes[i]->round;
|
||||
first_proc_found = 1;
|
||||
}
|
||||
}
|
||||
} else { // a process is not defined
|
||||
@@ -278,6 +295,14 @@ int get_ue_active_harq_pid(const uint8_t Mod_id,const uint8_t CC_id,const uint16
|
||||
return(-1);
|
||||
}
|
||||
}
|
||||
|
||||
/* if no active harq pid, get the oldest in the freelist, if any */
|
||||
if (*harq_pid == 255 && DLSCH_ptr->head_freelist != DLSCH_ptr->tail_freelist) {
|
||||
*harq_pid = DLSCH_ptr->harq_pid_freelist[DLSCH_ptr->head_freelist];
|
||||
*round = 0;
|
||||
LOG_D(PHY,"process %d is first free process\n", *harq_pid);
|
||||
}
|
||||
|
||||
LOG_D(PHY,"get_ue_active_harq_pid DL => Frame %d, Subframe %d : harq_pid %d\n",
|
||||
frame,subframe,*harq_pid);
|
||||
} else { // This is a UL request
|
||||
@@ -296,101 +321,6 @@ int get_ue_active_harq_pid(const uint8_t Mod_id,const uint8_t CC_id,const uint16
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
int CCE_table[800];
|
||||
|
||||
void init_nCCE_table(void)
|
||||
{
|
||||
memset(CCE_table,0,800*sizeof(int));
|
||||
}
|
||||
|
||||
|
||||
int get_nCCE_offset(const unsigned char L, const int nCCE, const int common_dci, const unsigned short rnti, const unsigned char subframe)
|
||||
{
|
||||
|
||||
int search_space_free,m,nb_candidates = 0,l,i;
|
||||
unsigned int Yk;
|
||||
|
||||
/*
|
||||
printf("CCE Allocation: ");
|
||||
for (i=0;i<nCCE;i++)
|
||||
printf("%d.",CCE_table[i]);
|
||||
printf("\n");
|
||||
*/
|
||||
if (common_dci == 1) {
|
||||
// check CCE(0 ... L-1)
|
||||
nb_candidates = (L==4) ? 4 : 2;
|
||||
nb_candidates = min(nb_candidates,nCCE/L);
|
||||
|
||||
for (m = nb_candidates-1 ; m >=0 ; m--) {
|
||||
search_space_free = 1;
|
||||
for (l=0; l<L; l++) {
|
||||
if (CCE_table[(m*L) + l] == 1) {
|
||||
search_space_free = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (search_space_free == 1) {
|
||||
for (l=0; l<L; l++)
|
||||
CCE_table[(m*L)+l]=1;
|
||||
return(m*L);
|
||||
}
|
||||
}
|
||||
|
||||
return(-1);
|
||||
|
||||
} else { // Find first available in ue specific search space
|
||||
// according to procedure in Section 9.1.1 of 36.213 (v. 8.6)
|
||||
// compute Yk
|
||||
Yk = (unsigned int)rnti;
|
||||
|
||||
for (i=0; i<=subframe; i++)
|
||||
Yk = (Yk*39827)%65537;
|
||||
|
||||
Yk = Yk % (nCCE/L);
|
||||
|
||||
|
||||
switch (L) {
|
||||
case 1:
|
||||
case 2:
|
||||
nb_candidates = 6;
|
||||
break;
|
||||
|
||||
case 4:
|
||||
case 8:
|
||||
nb_candidates = 2;
|
||||
break;
|
||||
|
||||
default:
|
||||
DevParam(L, nCCE, rnti);
|
||||
break;
|
||||
}
|
||||
|
||||
// LOG_I(PHY,"rnti %x, Yk = %d, nCCE %d (nCCE/L %d),nb_cand %d\n",rnti,Yk,nCCE,nCCE/L,nb_candidates);
|
||||
|
||||
for (m = 0 ; m < nb_candidates ; m++) {
|
||||
search_space_free = 1;
|
||||
|
||||
for (l=0; l<L; l++) {
|
||||
if (CCE_table[(((Yk+m)%(nCCE/L))*L) + l] == 1) {
|
||||
search_space_free = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (search_space_free == 1) {
|
||||
for (l=0; l<L; l++)
|
||||
CCE_table[(((Yk+m)%(nCCE/L))*L)+l]=1;
|
||||
|
||||
return(((Yk+m)%(nCCE/L))*L);
|
||||
}
|
||||
}
|
||||
|
||||
return(-1);
|
||||
}
|
||||
}
|
||||
|
||||
int16_t get_target_pusch_rx_power(const module_id_t module_idP, const uint8_t CC_id)
|
||||
{
|
||||
//return PHY_vars_eNB_g[module_idP][CC_id]->PHY_measurements_eNB[0].n0_power_tot_dBm;
|
||||
@@ -476,6 +406,7 @@ void phy_procedures_eNB_S_RX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars
|
||||
|
||||
if (abstraction_flag == 0) {
|
||||
lte_eNB_I0_measurements(phy_vars_eNB,
|
||||
subframe,
|
||||
0,
|
||||
phy_vars_eNB->first_run_I0_measurements);
|
||||
}
|
||||
@@ -489,8 +420,6 @@ void phy_procedures_eNB_S_RX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars
|
||||
#endif
|
||||
|
||||
|
||||
if (I0_clear == 1)
|
||||
I0_clear = 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -1813,15 +1742,18 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
|
||||
phy_vars_eNB->dlsch_eNB[i][0]->subframe_tx[subframe] = 0;
|
||||
}
|
||||
|
||||
init_nCCE_table();
|
||||
// init_nCCE_table();
|
||||
|
||||
num_pdcch_symbols = get_num_pdcch_symbols(DCI_pdu->Num_common_dci + DCI_pdu->Num_ue_spec_dci,
|
||||
DCI_pdu->dci_alloc,
|
||||
&phy_vars_eNB->lte_frame_parms,
|
||||
subframe);
|
||||
num_pdcch_symbols = DCI_pdu->num_pdcch_symbols;
|
||||
/*get_num_pdcch_symbols(DCI_pdu->Num_common_dci + DCI_pdu->Num_ue_spec_dci,
|
||||
DCI_pdu->dci_alloc,
|
||||
&phy_vars_eNB->lte_frame_parms,
|
||||
subframe);*/
|
||||
/*
|
||||
DCI_pdu->nCCE = get_nCCE(num_pdcch_symbols,
|
||||
&phy_vars_eNB->lte_frame_parms,
|
||||
get_mi(&phy_vars_eNB->lte_frame_parms,subframe));
|
||||
get_mi(&phy_vars_eNB->lte_frame_parms,subframe));*/
|
||||
|
||||
LOG_D(PHY,"num_pdcch_symbols %"PRIu8", nCCE %u (dci commond %"PRIu8", dci uespec %"PRIu8"\n",num_pdcch_symbols,DCI_pdu->nCCE,
|
||||
DCI_pdu->Num_common_dci,DCI_pdu->Num_ue_spec_dci);
|
||||
|
||||
@@ -1837,6 +1769,7 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
|
||||
#endif
|
||||
|
||||
for (i=0; i<DCI_pdu->Num_common_dci + DCI_pdu->Num_ue_spec_dci ; i++) {
|
||||
LOG_D(PHY,"[eNB] Subframe %d: DCI %d/%d : rnti %x, CCEind %d\n",subframe,i,DCI_pdu->Num_common_dci+DCI_pdu->Num_ue_spec_dci,DCI_pdu->dci_alloc[i].rnti,DCI_pdu->dci_alloc[i].firstCCE);
|
||||
#ifdef DEBUG_PHY_PROC
|
||||
|
||||
if (DCI_pdu->dci_alloc[i].rnti != SI_RNTI) {
|
||||
@@ -1864,28 +1797,21 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
|
||||
phy_vars_eNB->eNB_UE_stats[0].DL_pmi_single);
|
||||
|
||||
|
||||
int result = get_nCCE_offset(1<<DCI_pdu->dci_alloc[i].L, DCI_pdu->nCCE, 1, SI_RNTI, subframe);
|
||||
phy_vars_eNB->dlsch_eNB_SI->nCCE[subframe] = result;
|
||||
|
||||
if (result == -1) {
|
||||
// FIXME what happens to phy_vars_eNB->dlsch_eNB_SI->nCCE[subframe]?
|
||||
LOG_E(PHY,"[eNB %"PRIu8"] Frame %d subframe %d : No available CCE resources for common DCI (SI)!!!\n",phy_vars_eNB->Mod_id,phy_vars_eNB->proc[sched_subframe].frame_tx,subframe);
|
||||
} else {
|
||||
LOG_T(PHY,"[eNB %"PRIu8"] Frame %d subframe %d : CCE resource for common DCI (SI) => %"PRIu8"/%u\n",phy_vars_eNB->Mod_id,phy_vars_eNB->proc[sched_subframe].frame_tx,subframe,
|
||||
phy_vars_eNB->dlsch_eNB_SI->nCCE[subframe],DCI_pdu->nCCE);
|
||||
phy_vars_eNB->dlsch_eNB_SI->nCCE[subframe] = DCI_pdu->dci_alloc[i].firstCCE;
|
||||
|
||||
LOG_T(PHY,"[eNB %"PRIu8"] Frame %d subframe %d : CCE resource for common DCI (SI) => %"PRIu8"/%u\n",phy_vars_eNB->Mod_id,phy_vars_eNB->proc[sched_subframe].frame_tx,subframe,
|
||||
phy_vars_eNB->dlsch_eNB_SI->nCCE[subframe],DCI_pdu->nCCE);
|
||||
|
||||
#if defined(SMBV) && !defined(EXMIMO)
|
||||
|
||||
// configure SI DCI
|
||||
if (smbv_is_config_frame(phy_vars_eNB->proc[sched_subframe].frame_tx) && (smbv_frame_cnt < 4)) {
|
||||
msg("[SMBV] Frame %3d, SI in SF %d DCI %"PRIu32"\n",phy_vars_eNB->proc[sched_subframe].frame_tx,subframe,i);
|
||||
smbv_configure_common_dci(smbv_fname,(smbv_frame_cnt*10) + (subframe), "SI", &DCI_pdu->dci_alloc[i], i);
|
||||
}
|
||||
|
||||
#endif
|
||||
// configure SI DCI
|
||||
if (smbv_is_config_frame(phy_vars_eNB->proc[sched_subframe].frame_tx) && (smbv_frame_cnt < 4)) {
|
||||
msg("[SMBV] Frame %3d, SI in SF %d DCI %"PRIu32"\n",phy_vars_eNB->proc[sched_subframe].frame_tx,subframe,i);
|
||||
smbv_configure_common_dci(smbv_fname,(smbv_frame_cnt*10) + (subframe), "SI", &DCI_pdu->dci_alloc[i], i);
|
||||
}
|
||||
|
||||
DCI_pdu->dci_alloc[i].nCCE = phy_vars_eNB->dlsch_eNB_SI->nCCE[subframe];
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
} else if (DCI_pdu->dci_alloc[i].ra_flag == 1) {
|
||||
#ifdef DEBUG_PHY_PROC
|
||||
@@ -1906,28 +1832,20 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
|
||||
|
||||
// mac_xface->macphy_exit("Transmitted RAR, exiting\n");
|
||||
|
||||
int result = get_nCCE_offset(1<<DCI_pdu->dci_alloc[i].L, DCI_pdu->nCCE, 1, DCI_pdu->dci_alloc[i].rnti, subframe);
|
||||
phy_vars_eNB->dlsch_eNB_ra->nCCE[subframe] = result;
|
||||
|
||||
if (result == -1) {
|
||||
// FIXME what happens to phy_vars_eNB->dlsch_eNB_ra->nCCE[subframe]?
|
||||
LOG_E(PHY,"[eNB %"PRIu8"] Frame %d subframe %d : No available CCE resources for common DCI (RA) !!!\n",phy_vars_eNB->Mod_id,phy_vars_eNB->proc[sched_subframe].frame_tx,subframe);
|
||||
} else {
|
||||
LOG_D(PHY,"[eNB %"PRIu8"] Frame %d subframe %d : CCE resource for common DCI (RA) => %"PRIu8"/%u\n",phy_vars_eNB->Mod_id,phy_vars_eNB->proc[sched_subframe].frame_tx,subframe,
|
||||
phy_vars_eNB->dlsch_eNB_ra->nCCE[subframe],DCI_pdu->nCCE);
|
||||
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);
|
||||
#if defined(SMBV) && !defined(EXMIMO)
|
||||
|
||||
// configure RA DCI
|
||||
if (smbv_is_config_frame(phy_vars_eNB->proc[sched_subframe].frame_tx) && (smbv_frame_cnt < 4)) {
|
||||
msg("[SMBV] Frame %3d, RA in SF %d DCI %"PRIu32"\n",phy_vars_eNB->proc[sched_subframe].frame_tx,subframe,i);
|
||||
smbv_configure_common_dci(smbv_fname,(smbv_frame_cnt*10) + (subframe), "RA", &DCI_pdu->dci_alloc[i], i);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
// configure RA DCI
|
||||
if (smbv_is_config_frame(phy_vars_eNB->proc[sched_subframe].frame_tx) && (smbv_frame_cnt < 4)) {
|
||||
msg("[SMBV] Frame %3d, RA in SF %d DCI %"PRIu32"\n",phy_vars_eNB->proc[sched_subframe].frame_tx,subframe,i);
|
||||
smbv_configure_common_dci(smbv_fname,(smbv_frame_cnt*10) + (subframe), "RA", &DCI_pdu->dci_alloc[i], i);
|
||||
}
|
||||
|
||||
DCI_pdu->dci_alloc[i].nCCE = phy_vars_eNB->dlsch_eNB_ra->nCCE[subframe];
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
@@ -1968,30 +1886,22 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
|
||||
LOG_D(PHY,"[eNB %"PRIu8"][PDSCH %"PRIx16"/%"PRIu8"] Frame %d subframe %d: Generated dlsch params\n",
|
||||
phy_vars_eNB->Mod_id,DCI_pdu->dci_alloc[i].rnti,phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->current_harq_pid,phy_vars_eNB->proc[sched_subframe].frame_tx,subframe);
|
||||
|
||||
int result = get_nCCE_offset(1<<DCI_pdu->dci_alloc[i].L, DCI_pdu->nCCE, 0, DCI_pdu->dci_alloc[i].rnti, subframe);
|
||||
phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->nCCE[subframe] = result;
|
||||
|
||||
if (result == -1) {
|
||||
// FIXME what happens to phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->nCCE[subframe]?
|
||||
LOG_E(PHY,"[eNB %"PRIu8"] Frame %d subframe %d : No available CCE resources for UE spec DCI (PDSCH %"PRIx16") !!!\n",
|
||||
phy_vars_eNB->Mod_id,phy_vars_eNB->proc[sched_subframe].frame_tx,subframe,DCI_pdu->dci_alloc[i].rnti);
|
||||
} else {
|
||||
LOG_D(PHY,"[eNB %"PRIu8"] Frame %d subframe %d : CCE resource for ue DCI (PDSCH %"PRIx16") => %"PRIu8"/%u\n",phy_vars_eNB->Mod_id,phy_vars_eNB->proc[sched_subframe].frame_tx,subframe,
|
||||
DCI_pdu->dci_alloc[i].rnti,phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->nCCE[subframe],DCI_pdu->nCCE);
|
||||
phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->nCCE[subframe] = DCI_pdu->dci_alloc[i].firstCCE;
|
||||
|
||||
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);
|
||||
|
||||
#if defined(SMBV) && !defined(EXMIMO)
|
||||
DCI_pdu->dci_alloc[i].nCCE = phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->nCCE[subframe];
|
||||
|
||||
// configure UE-spec DCI
|
||||
if (smbv_is_config_frame(phy_vars_eNB->proc[sched_subframe].frame_tx) && (smbv_frame_cnt < 4)) {
|
||||
msg("[SMBV] Frame %3d, PDSCH in SF %d DCI %"PRIu32"\n",phy_vars_eNB->proc[sched_subframe].frame_tx,subframe,i);
|
||||
smbv_configure_ue_spec_dci(smbv_fname,(smbv_frame_cnt*10) + (subframe), UE_id+1, &DCI_pdu->dci_alloc[i], i);
|
||||
}
|
||||
|
||||
// configure UE-spec DCI
|
||||
if (smbv_is_config_frame(phy_vars_eNB->proc[sched_subframe].frame_tx) && (smbv_frame_cnt < 4)) {
|
||||
msg("[SMBV] Frame %3d, PDSCH in SF %d DCI %"PRIu32"\n",phy_vars_eNB->proc[sched_subframe].frame_tx,subframe,i);
|
||||
smbv_configure_ue_spec_dci(smbv_fname,(smbv_frame_cnt*10) + (subframe), UE_id+1, &DCI_pdu->dci_alloc[i], i);
|
||||
}
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
DCI_pdu->dci_alloc[i].nCCE = phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->nCCE[subframe];
|
||||
#ifdef DEBUG_PHY_PROC
|
||||
//if (phy_vars_eNB->proc[sched_subframe].frame_tx%100 == 0)
|
||||
LOG_D(PHY,"[eNB %"PRIu8"][DCI][PDSCH %"PRIx16"] Frame %d subframe %d UE_id %"PRId8" Generated DCI format %d, aggregation %d\n",
|
||||
@@ -2069,29 +1979,21 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
|
||||
CBA_RNTI,
|
||||
0); // do_srs
|
||||
|
||||
if ((DCI_pdu->dci_alloc[i].nCCE=get_nCCE_offset(1<<DCI_pdu->dci_alloc[i].L,
|
||||
DCI_pdu->nCCE,
|
||||
0,
|
||||
DCI_pdu->dci_alloc[i].rnti,
|
||||
subframe)) == -1) {
|
||||
LOG_E(PHY,"[eNB %"PRIu8"] Frame %d subframe %d : No available CCE resources (%u) for UE spec DCI (PUSCH %"PRIx16") !!!\n",
|
||||
phy_vars_eNB->Mod_id,phy_vars_eNB->proc[sched_subframe].frame_tx,subframe,DCI_pdu->nCCE,DCI_pdu->dci_alloc[i].rnti);
|
||||
} else {
|
||||
LOG_T(PHY,"[eNB %"PRIu8"] Frame %d subframe %d : CCE resources for UE spec DCI (PUSCH %"PRIx16") => %d/%u\n",
|
||||
phy_vars_eNB->Mod_id,phy_vars_eNB->proc[sched_subframe].frame_tx,subframe,DCI_pdu->dci_alloc[i].rnti,
|
||||
DCI_pdu->dci_alloc[i].nCCE,DCI_pdu->nCCE);
|
||||
|
||||
LOG_T(PHY,"[eNB %"PRIu8"] Frame %d subframe %d : CCE resources for UE spec DCI (PUSCH %"PRIx16") => %d/%u\n",
|
||||
phy_vars_eNB->Mod_id,phy_vars_eNB->proc[sched_subframe].frame_tx,subframe,DCI_pdu->dci_alloc[i].rnti,
|
||||
DCI_pdu->dci_alloc[i].firstCCE,DCI_pdu->nCCE);
|
||||
|
||||
#if defined(SMBV) && !defined(EXMIMO)
|
||||
|
||||
// configure UE-spec DCI for UL Grant
|
||||
if (smbv_is_config_frame(phy_vars_eNB->proc[sched_subframe].frame_tx) && (smbv_frame_cnt < 4)) {
|
||||
msg("[SMBV] Frame %3d, SF %d UL DCI %"PRIu32"\n",phy_vars_eNB->proc[sched_subframe].frame_tx,subframe,i);
|
||||
smbv_configure_ue_spec_dci(smbv_fname,(smbv_frame_cnt*10) + (subframe), UE_id+1, &DCI_pdu->dci_alloc[i], i);
|
||||
}
|
||||
|
||||
if (smbv_is_config_frame(phy_vars_eNB->proc[sched_subframe].frame_tx) && (smbv_frame_cnt < 4)) {
|
||||
msg("[SMBV] Frame %3d, SF %d UL DCI %"PRIu32"\n",phy_vars_eNB->proc[sched_subframe].frame_tx,subframe,i);
|
||||
smbv_configure_ue_spec_dci(smbv_fname,(smbv_frame_cnt*10) + (subframe), UE_id+1, &DCI_pdu->dci_alloc[i], i);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
|
||||
#ifdef DEBUG_PHY_PROC
|
||||
LOG_D(PHY,"[eNB %"PRIu8"][PUSCH %"PRIu8"] frame %d subframe %d Setting subframe_scheduling_flag for UE %"PRIu32" harq_pid %"PRIu8" (ul subframe %"PRIu8")\n",
|
||||
@@ -2122,13 +2024,13 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
|
||||
}
|
||||
|
||||
if (abstraction_flag == 0) {
|
||||
#ifdef DEBUG_PHY_PROC
|
||||
//#ifdef DEBUG_PHY_PROC
|
||||
|
||||
if (DCI_pdu->Num_ue_spec_dci+DCI_pdu->Num_common_dci > 0)
|
||||
LOG_D(PHY,"[eNB %"PRIu8"] Frame %d, subframe %d: Calling generate_dci_top (pdcch) (common %"PRIu8",ue_spec %"PRIu8")\n",phy_vars_eNB->Mod_id,phy_vars_eNB->proc[sched_subframe].frame_tx, subframe,
|
||||
DCI_pdu->Num_common_dci,DCI_pdu->Num_ue_spec_dci);
|
||||
|
||||
#endif
|
||||
//#endif
|
||||
|
||||
// for (sect_id=0;sect_id<number_of_cards;sect_id++)
|
||||
num_pdcch_symbols = generate_dci_top(DCI_pdu->Num_ue_spec_dci,
|
||||
@@ -2417,7 +2319,7 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
|
||||
input_buffer_length = phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->harq_processes[harq_pid]->TBS/8;
|
||||
|
||||
|
||||
#ifdef DEBUG_PHY_PROC
|
||||
//#ifdef DEBUG_PHY_PROC
|
||||
LOG_D(PHY,
|
||||
"[eNB %"PRIu8"][PDSCH %"PRIx16"/%"PRIu8"] Frame %d, subframe %d: Generating PDSCH/DLSCH with input size = %"PRIu16", G %d, nb_rb %"PRIu16", mcs %"PRIu8", pmi_alloc %"PRIx16", rv %"PRIu8" (round %"PRIu8")\n",
|
||||
phy_vars_eNB->Mod_id, phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->rnti,harq_pid,
|
||||
@@ -2436,7 +2338,7 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
|
||||
pmi2hex_2Ar1(phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->harq_processes[harq_pid]->pmi_alloc),
|
||||
phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->harq_processes[harq_pid]->rvidx,
|
||||
phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->harq_processes[harq_pid]->round);
|
||||
#endif
|
||||
//#endif
|
||||
#if defined(MESSAGE_CHART_GENERATOR_PHY)
|
||||
MSC_LOG_TX_MESSAGE(
|
||||
MSC_PHY_ENB,MSC_PHY_UE,
|
||||
@@ -2883,6 +2785,7 @@ void process_HARQ_feedback(uint8_t UE_id,
|
||||
dlsch_harq_proc->round = 0;
|
||||
ue_stats->dlsch_l2_errors[dl_harq_pid[m]]++;
|
||||
dlsch_harq_proc->status = SCH_IDLE;
|
||||
put_harq_pid_in_freelist(dlsch, dl_harq_pid[m]);
|
||||
dlsch->harq_ids[dl_subframe] = dlsch->Mdlharq;
|
||||
}
|
||||
} else {
|
||||
@@ -2895,6 +2798,7 @@ void process_HARQ_feedback(uint8_t UE_id,
|
||||
// Received ACK so set round to 0 and set dlsch_harq_pid IDLE
|
||||
dlsch_harq_proc->round = 0;
|
||||
dlsch_harq_proc->status = SCH_IDLE;
|
||||
put_harq_pid_in_freelist(dlsch, dl_harq_pid[m]);
|
||||
dlsch->harq_ids[dl_subframe] = dlsch->Mdlharq;
|
||||
|
||||
ue_stats->total_TBS = ue_stats->total_TBS +
|
||||
@@ -3233,7 +3137,7 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_
|
||||
int16_t n1_pucch0,n1_pucch1,n1_pucch2,n1_pucch3;
|
||||
uint8_t do_SR = 0;
|
||||
uint8_t pucch_sel = 0;
|
||||
int32_t metric0=0,metric1=0;
|
||||
int32_t metric0=0,metric1=0,metric0_SR=0;
|
||||
ANFBmode_t bundling_flag;
|
||||
PUCCH_FMT_t format;
|
||||
uint8_t nPRS;
|
||||
@@ -3262,6 +3166,11 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_
|
||||
phy_vars_eNB->lte_frame_parms.samples_per_tti);
|
||||
#endif
|
||||
*/
|
||||
phy_vars_eNB->rb_mask_ul[0]=0;
|
||||
phy_vars_eNB->rb_mask_ul[1]=0;
|
||||
phy_vars_eNB->rb_mask_ul[2]=0;
|
||||
phy_vars_eNB->rb_mask_ul[3]=0;
|
||||
|
||||
if (abstraction_flag == 0) {
|
||||
remove_7_5_kHz(phy_vars_eNB,subframe<<1);
|
||||
remove_7_5_kHz(phy_vars_eNB,(subframe<<1)+1);
|
||||
@@ -3410,6 +3319,12 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_
|
||||
pusch_active = 1;
|
||||
round = phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->round;
|
||||
|
||||
for (int rb=0;
|
||||
rb<=phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->nb_rb;
|
||||
rb++) {
|
||||
int rb2 = rb+phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->first_rb;
|
||||
phy_vars_eNB->rb_mask_ul[rb2>>5] |= (1<<(rb2&31));
|
||||
}
|
||||
#ifdef DEBUG_PHY_PROC
|
||||
LOG_D(PHY,"[eNB %d][PUSCH %d] frame %d subframe %d Scheduling PUSCH/ULSCH Reception for rnti %x (UE_id %d)\n",
|
||||
phy_vars_eNB->Mod_id,harq_pid,
|
||||
@@ -3451,7 +3366,7 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef DEBUG_PHY_PROC
|
||||
//#ifdef DEBUG_PHY_PROC
|
||||
LOG_D(PHY,
|
||||
"[eNB %d][PUSCH %d] Frame %d Subframe %d Demodulating PUSCH: dci_alloc %d, rar_alloc %d, round %d, first_rb %d, nb_rb %d, mcs %d, TBS %d, rv %d, cyclic_shift %d (n_DMRS2 %d, cyclicShift_common %d, nprs %d), O_ACK %d \n",
|
||||
phy_vars_eNB->Mod_id,harq_pid,frame,subframe,
|
||||
@@ -3468,7 +3383,7 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_
|
||||
phy_vars_eNB->lte_frame_parms.pusch_config_common.ul_ReferenceSignalsPUSCH.cyclicShift,
|
||||
nPRS,
|
||||
phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->O_ACK);
|
||||
#endif
|
||||
//#endif
|
||||
start_meas(&phy_vars_eNB->ulsch_demodulation_stats);
|
||||
|
||||
if (abstraction_flag==0) {
|
||||
@@ -3514,7 +3429,7 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_
|
||||
#endif
|
||||
stop_meas(&phy_vars_eNB->ulsch_decoding_stats);
|
||||
|
||||
#ifdef DEBUG_PHY_PROC
|
||||
//#ifdef DEBUG_PHY_PROC
|
||||
LOG_D(PHY,"[eNB %d][PUSCH %d] frame %d subframe %d RNTI %x RX power (%d,%d) RSSI (%d,%d) N0 (%d,%d) dB ACK (%d,%d), decoding iter %d\n",
|
||||
phy_vars_eNB->Mod_id,harq_pid,
|
||||
frame,subframe,
|
||||
@@ -3528,7 +3443,7 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_
|
||||
phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->o_ACK[0],
|
||||
phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->o_ACK[1],
|
||||
ret);
|
||||
#endif //DEBUG_PHY_PROC
|
||||
//#endif //DEBUG_PHY_PROC
|
||||
/*
|
||||
if ((two_ues_connected==1) && (phy_vars_eNB->cooperation_flag==2)) {
|
||||
for (j=0;j<phy_vars_eNB->lte_frame_parms.nb_antennas_rx;j++) {
|
||||
@@ -3730,13 +3645,19 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_
|
||||
for (j=0; j<phy_vars_eNB->lte_frame_parms.nb_antennas_rx; j++)
|
||||
//this is the RSSI per RB
|
||||
phy_vars_eNB->eNB_UE_stats[i].UL_rssi[j] =
|
||||
|
||||
dB_fixed(phy_vars_eNB->lte_eNB_pusch_vars[i]->ulsch_power[j]*
|
||||
(phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->nb_rb*12)/
|
||||
phy_vars_eNB->lte_frame_parms.ofdm_symbol_size) -
|
||||
phy_vars_eNB->rx_total_gain_eNB_dB -
|
||||
hundred_times_log10_NPRB[phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->nb_rb-1]/100 -
|
||||
get_hundred_times_delta_IF_eNB(phy_vars_eNB,i,harq_pid, 0)/100;
|
||||
|
||||
|
||||
/*
|
||||
dB_fixed(phy_vars_eNB->lte_eNB_pusch_vars[i]->ulsch_power[j]*phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->nb_rb) -
|
||||
phy_vars_eNB->rx_total_gain_eNB_dB -
|
||||
hundred_times_log10_NPRB[phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->nb_rb-1]/100 -
|
||||
get_hundred_times_delta_IF_eNB(phy_vars_eNB,i,harq_pid, 0)/100;*/
|
||||
phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->phich_active = 1;
|
||||
phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->phich_ACK = 1;
|
||||
phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->round = 0;
|
||||
@@ -3744,11 +3665,11 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_
|
||||
|
||||
if (phy_vars_eNB->ulsch_eNB[i]->Msg3_flag == 1) {
|
||||
#ifdef OPENAIR2
|
||||
#ifdef DEBUG_PHY_PROC
|
||||
//#ifdef DEBUG_PHY_PROC
|
||||
LOG_I(PHY,"[eNB %d][RAPROC] Frame %d Terminating ra_proc for harq %d, UE %d\n",
|
||||
phy_vars_eNB->Mod_id,
|
||||
frame,harq_pid,i);
|
||||
#endif
|
||||
//#endif
|
||||
mac_xface->rx_sdu(phy_vars_eNB->Mod_id,
|
||||
phy_vars_eNB->CC_id,
|
||||
frame,subframe,
|
||||
@@ -3758,7 +3679,7 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_
|
||||
harq_pid,
|
||||
&phy_vars_eNB->ulsch_eNB[i]->Msg3_flag);
|
||||
|
||||
// false msg3 detection by MAC: empty PDU
|
||||
// one-shot msg3 detection by MAC: empty PDU (e.g. CRNTI)
|
||||
if (phy_vars_eNB->ulsch_eNB[i]->Msg3_flag == 0 ) {
|
||||
phy_vars_eNB->eNB_UE_stats[i].mode = PRACH;
|
||||
mac_xface->cancel_ra_proc(phy_vars_eNB->Mod_id,
|
||||
@@ -3781,9 +3702,9 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_
|
||||
phy_vars_eNB->eNB_UE_stats[i].mode = PUSCH;
|
||||
phy_vars_eNB->ulsch_eNB[i]->Msg3_flag = 0;
|
||||
|
||||
#ifdef DEBUG_PHY_PROC
|
||||
LOG_D(PHY,"[eNB %d][RAPROC] Frame %d : RX Subframe %d Setting UE %d mode to PUSCH\n",phy_vars_eNB->Mod_id,frame,subframe,i);
|
||||
#endif //DEBUG_PHY_PROC
|
||||
//#ifdef DEBUG_PHY_PROC
|
||||
LOG_D(PHY,"[eNB %d][RAPROC] Frame %d : RX Subframe %d Setting UE %d mode to PUSCH\n",phy_vars_eNB->Mod_id,frame,subframe,i);
|
||||
//#endif //DEBUG_PHY_PROC
|
||||
|
||||
for (k=0; k<8; k++) { //harq_processes
|
||||
for (j=0; j<phy_vars_eNB->dlsch_eNB[i][0]->Mdlharq; j++) {
|
||||
@@ -3930,28 +3851,56 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_
|
||||
} else {
|
||||
// otherwise we have some PUCCH detection to do
|
||||
|
||||
// Null out PUCCH PRBs for noise measurement
|
||||
switch(phy_vars_eNB->lte_frame_parms.N_RB_UL) {
|
||||
case 6:
|
||||
phy_vars_eNB->rb_mask_ul[0] |= (0x1 | (1<<5)); //position 5
|
||||
break;
|
||||
case 15:
|
||||
phy_vars_eNB->rb_mask_ul[0] |= (0x1 | (1<<14)); // position 14
|
||||
break;
|
||||
case 25:
|
||||
phy_vars_eNB->rb_mask_ul[0] |= (0x1 | (1<<24)); // position 24
|
||||
break;
|
||||
case 50:
|
||||
phy_vars_eNB->rb_mask_ul[0] |= 0x1;
|
||||
phy_vars_eNB->rb_mask_ul[1] |= (1<<17); // position 49 (49-32)
|
||||
break;
|
||||
case 75:
|
||||
phy_vars_eNB->rb_mask_ul[0] |= 0x1;
|
||||
phy_vars_eNB->rb_mask_ul[2] |= (1<<10); // position 74 (74-64)
|
||||
break;
|
||||
case 100:
|
||||
phy_vars_eNB->rb_mask_ul[0] |= 0x1;
|
||||
phy_vars_eNB->rb_mask_ul[3] |= (1<<3); // position 99 (99-96)
|
||||
break;
|
||||
default:
|
||||
LOG_E(PHY,"Unknown number for N_RB_UL %d\n",phy_vars_eNB->lte_frame_parms.N_RB_UL);
|
||||
break;
|
||||
}
|
||||
|
||||
if (do_SR == 1) {
|
||||
phy_vars_eNB->eNB_UE_stats[i].sr_total++;
|
||||
|
||||
if (abstraction_flag == 0)
|
||||
metric0 = rx_pucch(phy_vars_eNB,
|
||||
pucch_format1,
|
||||
i,
|
||||
phy_vars_eNB->scheduling_request_config[i].sr_PUCCH_ResourceIndex,
|
||||
0, // n2_pucch
|
||||
1, // shortened format
|
||||
&SR_payload,
|
||||
subframe,
|
||||
PUCCH1_THRES);
|
||||
metric0_SR = rx_pucch(phy_vars_eNB,
|
||||
pucch_format1,
|
||||
i,
|
||||
phy_vars_eNB->scheduling_request_config[i].sr_PUCCH_ResourceIndex,
|
||||
0, // n2_pucch
|
||||
0, // shortened format, should be use_srs flag, later
|
||||
&SR_payload,
|
||||
subframe,
|
||||
PUCCH1_THRES);
|
||||
|
||||
#ifdef PHY_ABSTRACTION
|
||||
else {
|
||||
metric0 = rx_pucch_emul(phy_vars_eNB,
|
||||
i,
|
||||
pucch_format1,
|
||||
0,
|
||||
&SR_payload,
|
||||
sched_subframe);
|
||||
metric0_SR = rx_pucch_emul(phy_vars_eNB,
|
||||
i,
|
||||
pucch_format1,
|
||||
0,
|
||||
&SR_payload,
|
||||
sched_subframe);
|
||||
LOG_D(PHY,"[eNB %d][SR %x] Frame %d subframe %d Checking SR (UE SR %d/%d)\n",phy_vars_eNB->Mod_id,
|
||||
phy_vars_eNB->ulsch_eNB[i]->rnti,frame,subframe,SR_payload,phy_vars_eNB->scheduling_request_config[i].sr_PUCCH_ResourceIndex);
|
||||
}
|
||||
@@ -3964,6 +3913,9 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_
|
||||
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;
|
||||
@@ -3984,20 +3936,35 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_
|
||||
if ((n1_pucch0==-1) && (n1_pucch1==-1)) { // just check for SR
|
||||
} else if (phy_vars_eNB->lte_frame_parms.frame_type==FDD) { // FDD
|
||||
// if SR was detected, use the n1_pucch from SR, else use n1_pucch0
|
||||
n1_pucch0 = (SR_payload==1) ? phy_vars_eNB->scheduling_request_config[i].sr_PUCCH_ResourceIndex:n1_pucch0;
|
||||
// n1_pucch0 = (SR_payload==1) ? phy_vars_eNB->scheduling_request_config[i].sr_PUCCH_ResourceIndex:n1_pucch0;
|
||||
|
||||
LOG_D(PHY,"Demodulating PUCCH for ACK/NAK: n1_pucch0 %d (%d), SR_payload %d\n",n1_pucch0,phy_vars_eNB->scheduling_request_config[i].sr_PUCCH_ResourceIndex,SR_payload);
|
||||
|
||||
if (abstraction_flag == 0)
|
||||
if (abstraction_flag == 0) {
|
||||
|
||||
|
||||
|
||||
metric0 = rx_pucch(phy_vars_eNB,
|
||||
pucch_format1a,
|
||||
i,
|
||||
(uint16_t)n1_pucch0,
|
||||
0, //n2_pucch
|
||||
1, // shortened format
|
||||
0, // shortened format
|
||||
pucch_payload0,
|
||||
subframe,
|
||||
PUCCH1a_THRES);
|
||||
|
||||
if (metric0 < metric0_SR)
|
||||
metric0=rx_pucch(phy_vars_eNB,
|
||||
pucch_format1a,
|
||||
i,
|
||||
phy_vars_eNB->scheduling_request_config[i].sr_PUCCH_ResourceIndex,
|
||||
0, //n2_pucch
|
||||
0, // shortened format
|
||||
pucch_payload0,
|
||||
subframe,
|
||||
PUCCH1a_THRES);
|
||||
}
|
||||
else {
|
||||
#ifdef PHY_ABSTRACTION
|
||||
metric0 = rx_pucch_emul(phy_vars_eNB,i,
|
||||
@@ -4049,15 +4016,15 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_
|
||||
#endif
|
||||
|
||||
if (abstraction_flag == 0)
|
||||
metric0 = rx_pucch(phy_vars_eNB,
|
||||
format,
|
||||
i,
|
||||
phy_vars_eNB->scheduling_request_config[i].sr_PUCCH_ResourceIndex,
|
||||
0, //n2_pucch
|
||||
1, // shortened format
|
||||
pucch_payload0,
|
||||
subframe,
|
||||
PUCCH1a_THRES);
|
||||
metric0_SR = rx_pucch(phy_vars_eNB,
|
||||
format,
|
||||
i,
|
||||
phy_vars_eNB->scheduling_request_config[i].sr_PUCCH_ResourceIndex,
|
||||
0, //n2_pucch
|
||||
0, // shortened format
|
||||
pucch_payload0,
|
||||
subframe,
|
||||
PUCCH1a_THRES);
|
||||
else {
|
||||
#ifdef PHY_ABSTRACTION
|
||||
metric0 = rx_pucch_emul(phy_vars_eNB,i,
|
||||
@@ -4085,7 +4052,7 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_
|
||||
i,
|
||||
(uint16_t)n1_pucch0,
|
||||
0, // n2_pucch
|
||||
1, // shortened format
|
||||
0, // shortened format
|
||||
pucch_payload0,
|
||||
subframe,
|
||||
PUCCH1a_THRES);
|
||||
@@ -4108,7 +4075,7 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_
|
||||
i,
|
||||
(uint16_t)n1_pucch1,
|
||||
0, //n2_pucch
|
||||
1, // shortened format
|
||||
0, // shortened format
|
||||
pucch_payload1,
|
||||
subframe,
|
||||
PUCCH1a_THRES);
|
||||
@@ -4351,13 +4318,15 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_
|
||||
|
||||
} // loop i=0 ... NUMBER_OF_UE_MAX-1
|
||||
|
||||
if (pusch_active == 0) {
|
||||
// if (pusch_active == 0) {
|
||||
if (abstraction_flag == 0) {
|
||||
// LOG_D(PHY,"[eNB] Frame %d, subframe %d Doing I0_measurements\n",
|
||||
// (((subframe)==9)?-1:0) + phy_vars_eNB->proc[sched_subframe].frame_tx,subframe);
|
||||
lte_eNB_I0_measurements(phy_vars_eNB,
|
||||
subframe,
|
||||
0,
|
||||
phy_vars_eNB->first_run_I0_measurements);
|
||||
phy_vars_eNB->first_run_I0_measurements = 0;
|
||||
}
|
||||
|
||||
#ifdef PHY_ABSTRACTION
|
||||
@@ -4369,9 +4338,7 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_
|
||||
#endif
|
||||
|
||||
|
||||
if (I0_clear == 1)
|
||||
I0_clear = 0;
|
||||
}
|
||||
//}
|
||||
|
||||
#ifdef EMOS
|
||||
phy_procedures_emos_eNB_RX(subframe,phy_vars_eNB);
|
||||
@@ -4610,11 +4577,11 @@ void phy_procedures_eNB_lte(unsigned char subframe,PHY_VARS_eNB **phy_vars_eNB,u
|
||||
phy_vars_eNB[CC_id]->proc[subframe].frame_tx++;
|
||||
phy_vars_eNB[CC_id]->proc[subframe].frame_rx++;
|
||||
|
||||
if (phy_vars_eNB[CC_id]->proc[subframe].frame_tx==MAX_FRAME_NUMBER) // defined in impl_defs_top.h
|
||||
phy_vars_eNB[CC_id]->proc[subframe].frame_tx=0;
|
||||
if (phy_vars_eNB[CC_id]->proc[subframe].frame_tx>=MAX_FRAME_NUMBER) // defined in impl_defs_top.h
|
||||
phy_vars_eNB[CC_id]->proc[subframe].frame_tx-=MAX_FRAME_NUMBER;
|
||||
|
||||
if (phy_vars_eNB[CC_id]->proc[subframe].frame_rx==MAX_FRAME_NUMBER)
|
||||
phy_vars_eNB[CC_id]->proc[subframe].frame_rx=0;
|
||||
if (phy_vars_eNB[CC_id]->proc[subframe].frame_rx>=MAX_FRAME_NUMBER)
|
||||
phy_vars_eNB[CC_id]->proc[subframe].frame_rx-=MAX_FRAME_NUMBER;
|
||||
}
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_LTE,0);
|
||||
|
||||
@@ -172,7 +172,7 @@ void dump_dlsch_SI(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t subframe)
|
||||
phy_vars_ue->frame_rx,
|
||||
subframe,
|
||||
phy_vars_ue->transmission_mode[eNB_id]<7?0:phy_vars_ue->transmission_mode[eNB_id]);
|
||||
LOG_I(PHY,"[UE %d] Dumping dlsch_SI : ofdm_symbol_size %d, nsymb %d, nb_rb %d, mcs %d, nb_rb %d, num_pdcch_symbols %d,G %d\n",
|
||||
LOG_D(PHY,"[UE %d] Dumping dlsch_SI : ofdm_symbol_size %d, nsymb %d, nb_rb %d, mcs %d, nb_rb %d, num_pdcch_symbols %d,G %d\n",
|
||||
phy_vars_ue->Mod_id,
|
||||
phy_vars_ue->lte_frame_parms.ofdm_symbol_size,
|
||||
nsymb,
|
||||
@@ -1269,7 +1269,7 @@ void phy_procedures_UE_TX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstra
|
||||
#else
|
||||
&phy_vars_ue->lte_ue_common_vars.txdata[aa][ulsch_start],
|
||||
#endif
|
||||
frame_parms->log2_symbol_size,
|
||||
frame_parms->ofdm_symbol_size,
|
||||
nsymb,
|
||||
frame_parms->nb_prefix_samples,
|
||||
CYCLIC_PREFIX);
|
||||
@@ -1560,7 +1560,9 @@ void lte_ue_measurement_procedures(uint16_t l, PHY_VARS_UE *phy_vars_ue,uint8_t
|
||||
|
||||
#else
|
||||
#ifndef OAI_USRP
|
||||
#ifndef OAI_BLADERF
|
||||
phy_adjust_gain (phy_vars_ue,0);
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_GAIN_CONTROL, VCD_FUNCTION_OUT);
|
||||
@@ -2068,9 +2070,9 @@ int lte_ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *phy_vars_ue,uint8_t abst
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG_PHY_PROC
|
||||
//#ifdef DEBUG_PHY_PROC
|
||||
LOG_D(PHY,"[UE %d] Frame %d, slot %d, Mode %s: DCI found %i\n",phy_vars_ue->Mod_id,frame_rx,slot_rx,mode_string[phy_vars_ue->UE_mode[eNB_id]],dci_cnt);
|
||||
#endif
|
||||
//#endif
|
||||
|
||||
phy_vars_ue->lte_ue_pdcch_vars[eNB_id]->dci_received += dci_cnt;
|
||||
/*
|
||||
@@ -2108,10 +2110,10 @@ int lte_ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *phy_vars_ue,uint8_t abst
|
||||
|
||||
#ifdef DEBUG_PHY_PROC
|
||||
|
||||
if (subframe_rx == 9) { //( frame_rx % 100 == 0) {
|
||||
// if (subframe_rx == 9) { //( frame_rx % 100 == 0) {
|
||||
LOG_D(PHY,"frame %d, subframe %d, rnti %x: dci %d/%d\n",frame_rx,subframe_rx,phy_vars_ue->lte_ue_pdcch_vars[eNB_id]->crnti,i,dci_cnt);
|
||||
//dump_dci(&phy_vars_ue->lte_frame_parms, &dci_alloc_rx[i]);
|
||||
}
|
||||
// }
|
||||
|
||||
#endif
|
||||
|
||||
@@ -2451,7 +2453,7 @@ int phy_procedures_UE_RX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstrac
|
||||
else
|
||||
openair_daq_vars.use_ia_receiver = (openair_daq_vars.use_ia_receiver+1)%3;
|
||||
|
||||
LOG_I(PHY,"[MYEMOS] frame %d, IA receiver %d, MCS %d, bitrate %d\n",
|
||||
LOG_D(PHY,"[MYEMOS] frame %d, IA receiver %d, MCS %d, bitrate %d\n",
|
||||
frame_rx,
|
||||
openair_daq_vars.use_ia_receiver,
|
||||
phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[phy_vars_ue->dlsch_ue[eNB_id][0]->current_harq_pid]->mcs,
|
||||
@@ -2629,13 +2631,13 @@ int phy_procedures_UE_RX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstrac
|
||||
|
||||
phy_vars_ue->dlsch_ue[eNB_id][0]->active = 0;
|
||||
|
||||
#ifdef DEBUG_PHY_PROC
|
||||
//#ifdef DEBUG_PHY_PROC
|
||||
LOG_D(PHY,"[UE %d][PDSCH %x/%d] Frame %d subframe %d Scheduling DLSCH decoding\n",
|
||||
phy_vars_ue->Mod_id,
|
||||
phy_vars_ue->dlsch_ue[eNB_id][0]->rnti,
|
||||
harq_pid,
|
||||
(subframe_prev == 9) ? (frame_rx-1) : frame_rx,subframe_prev);
|
||||
#endif
|
||||
//#endif
|
||||
|
||||
if (phy_vars_ue->dlsch_ue[eNB_id][0]) {
|
||||
if (abstraction_flag == 0) {
|
||||
@@ -2683,17 +2685,18 @@ int phy_procedures_UE_RX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstrac
|
||||
if (ret == (1+phy_vars_ue->dlsch_ue[eNB_id][0]->max_turbo_iterations)) {
|
||||
phy_vars_ue->dlsch_errors[eNB_id]++;
|
||||
|
||||
#ifdef DEBUG_PHY_PROC
|
||||
LOG_D(PHY,"[UE %d][PDSCH %x/%d] Frame %d subframe %d DLSCH in error (rv %d,mcs %d)\n",
|
||||
//#ifdef DEBUG_PHY_PROC
|
||||
LOG_D(PHY,"[UE %d][PDSCH %x/%d] Frame %d subframe %d DLSCH in error (rv %d,mcs %d,TBS %d)\n",
|
||||
phy_vars_ue->Mod_id,phy_vars_ue->dlsch_ue[eNB_id][0]->rnti,
|
||||
harq_pid,frame_rx,subframe_prev,
|
||||
phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->rvidx,
|
||||
phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->mcs);
|
||||
phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->mcs,
|
||||
phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->TBS);
|
||||
|
||||
// if (abstraction_flag ==0 )
|
||||
//dump_dlsch(phy_vars_ue,eNB_id,subframe_prev,harq_pid);
|
||||
//mac_xface->macphy_exit("");
|
||||
#endif
|
||||
dump_dlsch(phy_vars_ue,eNB_id,subframe_prev,harq_pid);
|
||||
mac_xface->macphy_exit("");
|
||||
//#endif
|
||||
} else {
|
||||
LOG_D(PHY,"[UE %d][PDSCH %x/%d] Frame %d subframe %d (slot_rx %d): Received DLSCH (rv %d,mcs %d,TBS %d)\n",
|
||||
phy_vars_ue->Mod_id,phy_vars_ue->dlsch_ue[eNB_id][0]->rnti,
|
||||
@@ -2810,7 +2813,7 @@ int phy_procedures_UE_RX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstrac
|
||||
phy_vars_ue->transmission_mode[eNB_id]);
|
||||
|
||||
#ifdef DEBUG_PHY_PROC
|
||||
LOG_I(PHY,"Decoding DLSCH_SI : rb_alloc %x : nb_rb %d G %d TBS %d, num_pdcch_sym %d\n",phy_vars_ue->dlsch_ue_SI[eNB_id]->harq_processes[0]->rb_alloc_even[0],
|
||||
LOG_D(PHY,"Decoding DLSCH_SI : rb_alloc %x : nb_rb %d G %d TBS %d, num_pdcch_sym %d\n",phy_vars_ue->dlsch_ue_SI[eNB_id]->harq_processes[0]->rb_alloc_even[0],
|
||||
phy_vars_ue->dlsch_ue_SI[eNB_id]->harq_processes[0]->nb_rb,
|
||||
phy_vars_ue->dlsch_ue_SI[eNB_id]->harq_processes[0]->G,
|
||||
phy_vars_ue->dlsch_ue_SI[eNB_id]->harq_processes[0]->TBS,
|
||||
@@ -2858,7 +2861,7 @@ int phy_procedures_UE_RX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstrac
|
||||
if (ret == (1+phy_vars_ue->dlsch_ue_SI[eNB_id]->max_turbo_iterations)) {
|
||||
phy_vars_ue->dlsch_SI_errors[eNB_id]++;
|
||||
#ifdef DEBUG_PHY_PROC
|
||||
LOG_I(PHY,"[UE %d] Frame %d, subframe %d, received SI in error (TBS %d, mcs %d, rvidx %d, rballoc %X.%X.%X.%X\n",
|
||||
LOG_D(PHY,"[UE %d] Frame %d, subframe %d, received SI in error (TBS %d, mcs %d, rvidx %d, rballoc %X.%X.%X.%X\n",
|
||||
phy_vars_ue->Mod_id,
|
||||
frame_rx,
|
||||
subframe_prev,
|
||||
@@ -3292,7 +3295,7 @@ int phy_procedures_UE_RX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstrac
|
||||
}
|
||||
|
||||
if (is_pmch_subframe((subframe_rx==9?-1:0)+frame_rx,subframe_rx,&phy_vars_ue->lte_frame_parms)) {
|
||||
LOG_I(PHY,"ue calling pmch subframe ..\n ");
|
||||
LOG_D(PHY,"ue calling pmch subframe ..\n ");
|
||||
|
||||
if ((slot_rx%2)==1) {
|
||||
LOG_D(PHY,"[UE %d] Frame %d, subframe %d: Querying for PMCH demodulation(%d)\n",
|
||||
@@ -3442,7 +3445,7 @@ int phy_procedures_UE_RX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstrac
|
||||
phy_vars_rn->sync_area[subframe_rx] = sync_area; // this could also go the harq data struct
|
||||
phy_vars_rn->dlsch_rn_MCH[subframe_rx]->harq_processes[0]->TBS = phy_vars_ue->dlsch_ue_MCH[0]->harq_processes[0]->TBS;
|
||||
phy_vars_rn->dlsch_rn_MCH[subframe_rx]->harq_processes[0]->mcs = phy_vars_ue->dlsch_ue_MCH[0]->harq_processes[0]->mcs;
|
||||
LOG_I(PHY,"[RN/UE %d] Frame %d subframe %d: store the MCH PDU for MBSFN sync area %d (MCS %d, TBS %d)\n",
|
||||
LOG_D(PHY,"[RN/UE %d] Frame %d subframe %d: store the MCH PDU for MBSFN sync area %d (MCS %d, TBS %d)\n",
|
||||
phy_vars_ue->Mod_id, frame_rx,subframe_rx,sync_area,
|
||||
phy_vars_rn->dlsch_rn_MCH[subframe_rx]->harq_processes[0]->mcs,
|
||||
phy_vars_rn->dlsch_rn_MCH[subframe_rx]->harq_processes[0]->TBS>>3);
|
||||
|
||||
+222
-272
@@ -107,93 +107,6 @@ void handler(int sig)
|
||||
exit(1);
|
||||
}
|
||||
|
||||
void lte_param_init(unsigned char N_tx_port_eNB, unsigned char N_tx_phy, unsigned char N_rx,unsigned char transmission_mode,uint8_t extended_prefix_flag,uint8_t fdd_flag, uint16_t Nid_cell,uint8_t tdd_config,uint8_t N_RB_DL, uint8_t osf,uint32_t perfect_ce)
|
||||
{
|
||||
|
||||
LTE_DL_FRAME_PARMS *lte_frame_parms;
|
||||
int i;
|
||||
|
||||
|
||||
printf("Start lte_param_init\n");
|
||||
PHY_vars_eNB = malloc(sizeof(PHY_VARS_eNB));
|
||||
PHY_vars_UE = malloc(sizeof(PHY_VARS_UE));
|
||||
//PHY_config = malloc(sizeof(PHY_CONFIG));
|
||||
mac_xface = malloc(sizeof(MAC_xface));
|
||||
|
||||
srand(0);
|
||||
randominit(0);
|
||||
//set_taus_seed(0);
|
||||
set_taus_seed(1234);
|
||||
|
||||
lte_frame_parms = &(PHY_vars_eNB->lte_frame_parms);
|
||||
|
||||
lte_frame_parms->N_RB_DL = N_RB_DL; //50 for 10MHz and 25 for 5 MHz
|
||||
lte_frame_parms->N_RB_UL = N_RB_DL;
|
||||
lte_frame_parms->Ncp = extended_prefix_flag;
|
||||
lte_frame_parms->Nid_cell = Nid_cell;
|
||||
lte_frame_parms->nushift = Nid_cell%6;
|
||||
lte_frame_parms->nb_antennas_tx = N_tx_phy;
|
||||
lte_frame_parms->nb_antennas_rx = N_rx;
|
||||
lte_frame_parms->nb_antenna_ports_eNB = N_tx_port_eNB;
|
||||
lte_frame_parms->phich_config_common.phich_resource = one;
|
||||
lte_frame_parms->tdd_config = tdd_config;
|
||||
lte_frame_parms->frame_type = (fdd_flag==1)?0 : 1;
|
||||
// lte_frame_parms->Csrs = 2;
|
||||
// lte_frame_parms->Bsrs = 0;
|
||||
// lte_frame_parms->kTC = 0;44
|
||||
// lte_frame_parms->n_RRC = 0;
|
||||
//lte_frame_parms->mode1_flag = (transmission_mode == 1)? 1 : 0;
|
||||
lte_frame_parms->mode1_flag = (transmission_mode == 1 || transmission_mode ==7)? 1 : 0;
|
||||
|
||||
init_frame_parms(lte_frame_parms,osf);
|
||||
|
||||
//copy_lte_parms_to_phy_framing(lte_frame_parms, &(PHY_config->PHY_framing));
|
||||
|
||||
// phy_init_top(lte_frame_parms); //allocation
|
||||
|
||||
PHY_vars_UE->is_secondary_ue = 0;
|
||||
PHY_vars_UE->lte_frame_parms = *lte_frame_parms;
|
||||
PHY_vars_eNB->lte_frame_parms = *lte_frame_parms;
|
||||
|
||||
PHY_vars_eNB->transmission_mode[0] = transmission_mode;
|
||||
PHY_vars_UE->transmission_mode[0] = transmission_mode;
|
||||
|
||||
phy_init_lte_top(lte_frame_parms);
|
||||
dump_frame_parms(lte_frame_parms);
|
||||
|
||||
PHY_vars_UE->PHY_measurements.n_adj_cells=0;
|
||||
PHY_vars_UE->PHY_measurements.adj_cell_id[0] = Nid_cell+1;
|
||||
PHY_vars_UE->PHY_measurements.adj_cell_id[1] = Nid_cell+2;
|
||||
|
||||
for (i=0; i<3; i++)
|
||||
lte_gold(lte_frame_parms,PHY_vars_UE->lte_gold_table[i],Nid_cell+i);
|
||||
|
||||
phy_init_lte_ue(PHY_vars_UE,1,0);
|
||||
phy_init_lte_eNB(PHY_vars_eNB,0,0,0);
|
||||
|
||||
generate_pcfich_reg_mapping(&PHY_vars_UE->lte_frame_parms);
|
||||
generate_phich_reg_mapping(&PHY_vars_UE->lte_frame_parms);
|
||||
|
||||
// DL power control init
|
||||
//if (transmission_mode == 1) {
|
||||
if (transmission_mode == 1 || transmission_mode ==7) {
|
||||
PHY_vars_eNB->pdsch_config_dedicated->p_a = dB0; // 4 = 0dB
|
||||
((PHY_vars_eNB->lte_frame_parms).pdsch_config_common).p_b = 0;
|
||||
PHY_vars_UE->pdsch_config_dedicated->p_a = dB0; // 4 = 0dB
|
||||
((PHY_vars_UE->lte_frame_parms).pdsch_config_common).p_b = 0;
|
||||
} else { // rho_a = rhob
|
||||
PHY_vars_eNB->pdsch_config_dedicated->p_a = dB0; // 4 = 0dB
|
||||
((PHY_vars_eNB->lte_frame_parms).pdsch_config_common).p_b = 1;
|
||||
PHY_vars_UE->pdsch_config_dedicated->p_a = dB0; // 4 = 0dB
|
||||
((PHY_vars_UE->lte_frame_parms).pdsch_config_common).p_b = 1;
|
||||
}
|
||||
|
||||
PHY_vars_UE->perfect_ce = perfect_ce;
|
||||
|
||||
printf("Done lte_param_init\n");
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
//DCI2_5MHz_2A_M10PRB_TDD_t DLSCH_alloc_pdu2_2A[2];
|
||||
@@ -233,7 +146,7 @@ void do_OFDM_mod_l(LTE_eNB_COMMON *eNB_common_vars, int eNB_id, uint16_t next_sl
|
||||
if (frame_parms->Ncp == 1)
|
||||
PHY_ofdm_mod(txdataF_BF[aa], // input
|
||||
&txdata[aa][slot_offset+l*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES], // output
|
||||
frame_parms->log2_symbol_size, // log2_fft_size
|
||||
frame_parms->ofdm_symbol_size,
|
||||
1, // number of symbols
|
||||
frame_parms->nb_prefix_samples, // number of prefix samples
|
||||
CYCLIC_PREFIX);
|
||||
@@ -241,7 +154,7 @@ void do_OFDM_mod_l(LTE_eNB_COMMON *eNB_common_vars, int eNB_id, uint16_t next_sl
|
||||
if (l==0) {
|
||||
PHY_ofdm_mod(txdataF_BF[aa], // input
|
||||
&txdata[aa][slot_offset], // output
|
||||
frame_parms->log2_symbol_size, // log2_fft_size
|
||||
frame_parms->ofdm_symbol_size,
|
||||
1, // number of symbols
|
||||
frame_parms->nb_prefix_samples0, // number of prefix samples
|
||||
CYCLIC_PREFIX);
|
||||
@@ -249,14 +162,12 @@ void do_OFDM_mod_l(LTE_eNB_COMMON *eNB_common_vars, int eNB_id, uint16_t next_sl
|
||||
} else {
|
||||
PHY_ofdm_mod(txdataF_BF[aa], // input
|
||||
&txdata[aa][slot_offset+OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES0+(l-1)*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES], // output
|
||||
frame_parms->log2_symbol_size, // log2_fft_size
|
||||
frame_parms->ofdm_symbol_size,
|
||||
1, // number of symbols
|
||||
frame_parms->nb_prefix_samples, // number of prefix samples
|
||||
CYCLIC_PREFIX);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -300,15 +211,15 @@ int main(int argc, char **argv)
|
||||
unsigned int ret;
|
||||
unsigned int coded_bits_per_codeword=0,nsymb,dci_cnt,tbs=0;
|
||||
|
||||
unsigned int tx_lev=0,tx_lev_dB=0,trials,errs[4]= {0,0,0,0},errs2[4]= {0,0,0,0},round_trials[4]= {0,0,0,0},dci_errors=0,dlsch_active=0,num_layers;
|
||||
unsigned int tx_lev=0,tx_lev_dB=0,trials,errs[4]= {0,0,0,0},errs2[4]= {0,0,0,0},round_trials[4]= {0,0,0,0},dci_errors=0,dlsch_active=0;//,num_layers;
|
||||
int re_allocated;
|
||||
char fname[32],vname[32];
|
||||
FILE *bler_fd;
|
||||
char bler_fname[256];
|
||||
FILE *time_meas_fd;
|
||||
char time_meas_fname[256];
|
||||
FILE *tikz_fd;
|
||||
char tikz_fname[256];
|
||||
// FILE *tikz_fd;
|
||||
// char tikz_fname[256];
|
||||
|
||||
FILE *input_trch_fd=NULL;
|
||||
unsigned char input_trch_file=0;
|
||||
@@ -334,7 +245,7 @@ int main(int argc, char **argv)
|
||||
uint8_t rx_sample_offset = 0;
|
||||
//char stats_buffer[4096];
|
||||
//int len;
|
||||
uint8_t num_rounds = 4,fix_rounds=0;
|
||||
uint8_t num_rounds = 4;//,fix_rounds=0;
|
||||
uint8_t subframe=7;
|
||||
int u;
|
||||
int n=0;
|
||||
@@ -348,11 +259,11 @@ int main(int argc, char **argv)
|
||||
|
||||
// void *data;
|
||||
// int ii;
|
||||
int bler;
|
||||
double blerr[4],uncoded_ber,avg_ber;
|
||||
// int bler;
|
||||
double blerr[4],uncoded_ber;//,avg_ber;
|
||||
short *uncoded_ber_bit=NULL;
|
||||
uint8_t N_RB_DL=25,osf=1;
|
||||
uint8_t fdd_flag = 0;
|
||||
frame_t frame_type = FDD;
|
||||
#ifdef XFORMS
|
||||
FD_lte_phy_scope_ue *form_ue;
|
||||
char title[255];
|
||||
@@ -360,12 +271,11 @@ int main(int argc, char **argv)
|
||||
uint32_t DLSCH_RB_ALLOC = 0x1fff;
|
||||
int numCCE=0;
|
||||
int dci_length_bytes=0,dci_length=0;
|
||||
//double BW = 5.0;
|
||||
double BW = 7.68;
|
||||
//double channel_bandwidth = 5.0, sampling_rate=7.68;
|
||||
int common_flag=0,TPC=0;
|
||||
|
||||
double cpu_freq_GHz;
|
||||
time_stats_t ts;//,sts,usts;
|
||||
// time_stats_t ts;//,sts,usts;
|
||||
int avg_iter,iter_trials;
|
||||
int rballocset=0;
|
||||
int print_perf=0;
|
||||
@@ -379,15 +289,24 @@ int main(int argc, char **argv)
|
||||
int TB0_active = 1;
|
||||
uint32_t perfect_ce = 0;
|
||||
|
||||
LTE_DL_UE_HARQ_t *dlsch0_ue_harq;
|
||||
LTE_DL_eNB_HARQ_t *dlsch0_eNB_harq;
|
||||
// LTE_DL_UE_HARQ_t *dlsch0_ue_harq;
|
||||
// LTE_DL_eNB_HARQ_t *dlsch0_eNB_harq;
|
||||
uint8_t Kmimo;
|
||||
FILE *proc_fd = NULL;
|
||||
char buf[64];
|
||||
uint8_t ue_category=4;
|
||||
uint32_t Nsoft;
|
||||
|
||||
|
||||
|
||||
int CCE_table[800];
|
||||
|
||||
int threequarter_fs=0;
|
||||
|
||||
opp_enabled=1; // to enable the time meas
|
||||
|
||||
#if defined(__arm__)
|
||||
FILE *proc_fd = NULL;
|
||||
char buf[64];
|
||||
|
||||
proc_fd = fopen("/sys/devices/system/cpu/cpu4/cpufreq/cpuinfo_cur_freq", "r");
|
||||
if(!proc_fd)
|
||||
printf("cannot open /sys/devices/system/cpu/cpu4/cpufreq/cpuinfo_cur_freq");
|
||||
@@ -410,16 +329,20 @@ int main(int argc, char **argv)
|
||||
// default parameters
|
||||
n_frames = 1000;
|
||||
snr0 = 0;
|
||||
num_layers = 1;
|
||||
// num_layers = 1;
|
||||
perfect_ce = 0;
|
||||
|
||||
while ((c = getopt (argc, argv, "ahdqZDe:m:n:o:s:f:t:c:g:r:F:x:p:y:z:AM:N:I:i:O:R:S:C:T:b:u:v:w:B:PLl:Y")) != -1) {
|
||||
while ((c = getopt (argc, argv, "ahdpZDe:Em:n:o:s:f:t:c:g:r:F:x::p:y:z:AM:N:I:i:O:R:S:C:T:b:u:v:w:B:PLl:Y")) != -1) {
|
||||
switch (c) {
|
||||
case 'a':
|
||||
awgn_flag = 1;
|
||||
channel_model = AWGN;
|
||||
break;
|
||||
|
||||
case 'A':
|
||||
abstx = 1;
|
||||
break;
|
||||
|
||||
case 'b':
|
||||
tdd_config=atoi(optarg);
|
||||
break;
|
||||
@@ -428,10 +351,59 @@ int main(int argc, char **argv)
|
||||
N_RB_DL=atoi(optarg);
|
||||
break;
|
||||
|
||||
case 'c':
|
||||
num_pdcch_symbols=atoi(optarg);
|
||||
break;
|
||||
|
||||
case 'C':
|
||||
Nid_cell = atoi(optarg);
|
||||
break;
|
||||
|
||||
case 'd':
|
||||
dci_flag = 1;
|
||||
break;
|
||||
|
||||
case 'D':
|
||||
frame_type=TDD;
|
||||
break;
|
||||
|
||||
case 'e':
|
||||
num_rounds=1;
|
||||
common_flag = 1;
|
||||
TPC = atoi(optarg);
|
||||
break;
|
||||
|
||||
case 'E':
|
||||
threequarter_fs=1;
|
||||
break;
|
||||
|
||||
case 'f':
|
||||
input_snr_step= atof(optarg);
|
||||
break;
|
||||
|
||||
case 'F':
|
||||
forgetting_factor = atof(optarg);
|
||||
break;
|
||||
|
||||
case 'i':
|
||||
input_fd = fopen(optarg,"r");
|
||||
input_file=1;
|
||||
dci_flag = 1;
|
||||
break;
|
||||
|
||||
case 'I':
|
||||
input_trch_fd = fopen(optarg,"r");
|
||||
input_trch_file=1;
|
||||
break;
|
||||
|
||||
case 'L':
|
||||
llr8_flag=1;
|
||||
break;
|
||||
|
||||
case 'l':
|
||||
offset_mumimo_llr_drange_fix=atoi(optarg);
|
||||
break;
|
||||
|
||||
case 'm':
|
||||
mcs1 = atoi(optarg);
|
||||
break;
|
||||
@@ -440,6 +412,11 @@ int main(int argc, char **argv)
|
||||
mcs2 = atoi(optarg);
|
||||
break;
|
||||
|
||||
case 'O':
|
||||
test_perf=atoi(optarg);
|
||||
//print_perf =1;
|
||||
break;
|
||||
|
||||
case 't':
|
||||
mcs_i = atoi(optarg);
|
||||
i_mod = get_Qm(mcs_i);
|
||||
@@ -449,27 +426,15 @@ int main(int argc, char **argv)
|
||||
n_frames = atoi(optarg);
|
||||
break;
|
||||
|
||||
case 'C':
|
||||
Nid_cell = atoi(optarg);
|
||||
break;
|
||||
|
||||
case 'o':
|
||||
rx_sample_offset = atoi(optarg);
|
||||
break;
|
||||
|
||||
case 'D':
|
||||
fdd_flag = 1;
|
||||
break;
|
||||
|
||||
case 'r':
|
||||
DLSCH_RB_ALLOC = atoi(optarg);
|
||||
rballocset = 1;
|
||||
break;
|
||||
|
||||
case 'F':
|
||||
forgetting_factor = atof(optarg);
|
||||
break;
|
||||
|
||||
case 's':
|
||||
snr0 = atof(optarg);
|
||||
break;
|
||||
@@ -478,14 +443,6 @@ int main(int argc, char **argv)
|
||||
snr_int = atof(optarg);
|
||||
break;
|
||||
|
||||
case 'f':
|
||||
input_snr_step= atof(optarg);
|
||||
break;
|
||||
|
||||
case 'A':
|
||||
abstx = 1;
|
||||
break;
|
||||
|
||||
case 'N':
|
||||
n_ch_rlz= atof(optarg);
|
||||
break;
|
||||
@@ -494,10 +451,6 @@ int main(int argc, char **argv)
|
||||
extended_prefix_flag=1;
|
||||
break;
|
||||
|
||||
case 'c':
|
||||
num_pdcch_symbols=atoi(optarg);
|
||||
break;
|
||||
|
||||
case 'g':
|
||||
memcpy(channel_model_input,optarg,10);
|
||||
|
||||
@@ -557,7 +510,6 @@ int main(int argc, char **argv)
|
||||
case 'N':
|
||||
channel_model=AWGN;
|
||||
break;
|
||||
|
||||
default:
|
||||
msg("Unsupported channel model!\n");
|
||||
exit(-1);
|
||||
@@ -565,87 +517,6 @@ int main(int argc, char **argv)
|
||||
|
||||
break;
|
||||
|
||||
case 'x':
|
||||
transmission_mode=atoi(optarg);
|
||||
|
||||
if ((transmission_mode!=1) &&
|
||||
(transmission_mode!=2) &&
|
||||
(transmission_mode!=3) &&
|
||||
(transmission_mode!=4) &&
|
||||
(transmission_mode!=5) &&
|
||||
(transmission_mode!=6) &&
|
||||
(transmission_mode!=7)) {
|
||||
msg("Unsupported transmission mode %d\n",transmission_mode);
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
if (transmission_mode>1 && transmission_mode<7){
|
||||
n_tx_port = 2;
|
||||
n_tx_phy = n_tx_port;
|
||||
} else if (transmission_mode==7){
|
||||
n_tx_port = 1;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 'p':
|
||||
n_tx_port=atoi(optarg);
|
||||
|
||||
if ((n_tx_port==0) || ((n_tx_port>2))) {
|
||||
msg("Unsupported number of cell specific antennas ports %d\n",n_tx_port);
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 'y':
|
||||
n_tx_phy=atoi(optarg);
|
||||
|
||||
if (transmission_mode>1&&transmission_mode<7) {
|
||||
if(n_tx_phy==1) {
|
||||
msg("n_tx_phy must be >1 for transmission_mode %d\n",transmission_mode);
|
||||
exit(-1);
|
||||
} else if (n_tx_phy!=n_tx_port) { // to be changed
|
||||
msg("For transmission mode TM2-TM6, physical antenna number should be the same as antenna port number.\n");
|
||||
exit(-1);
|
||||
}
|
||||
}
|
||||
|
||||
//if (transmission_mode==7 && (n_tx_phy!=1 && n_tx_phy!=2 && n_tx_phy!=4 && n_tx_phy!=8 && n_tx_phy!=16 && n_tx_phy!=64 && n_tx_phy!=128)) {
|
||||
if (transmission_mode==7 && (n_tx_phy!=1 && n_tx_phy!=2 && n_tx_phy!=4 && n_tx_phy!=16 && n_tx_phy!=64)) {
|
||||
msg("Physical number of antennas not supported for TM7.\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 'z':
|
||||
n_rx=atoi(optarg);
|
||||
|
||||
if ((n_rx==0) || (n_rx>2)) {
|
||||
msg("Unsupported number of rx antennas %d\n",n_rx);
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 'I':
|
||||
input_trch_fd = fopen(optarg,"r");
|
||||
input_trch_file=1;
|
||||
break;
|
||||
|
||||
case 'i':
|
||||
input_fd = fopen(optarg,"r");
|
||||
input_file=1;
|
||||
dci_flag = 1;
|
||||
break;
|
||||
|
||||
case 'e':
|
||||
num_rounds=1;
|
||||
common_flag = 1;
|
||||
TPC = atoi(optarg);
|
||||
break;
|
||||
|
||||
case 'R':
|
||||
num_rounds=atoi(optarg);
|
||||
break;
|
||||
@@ -683,26 +554,80 @@ int main(int argc, char **argv)
|
||||
print_perf=1;
|
||||
break;
|
||||
|
||||
case 'L':
|
||||
llr8_flag=1;
|
||||
case 'p':
|
||||
n_tx_port=atoi(optarg);
|
||||
|
||||
if ((n_tx_port==0) || ((n_tx_port>2))) {
|
||||
msg("Unsupported number of cell specific antennas ports %d\n",n_tx_port);
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 'l':
|
||||
offset_mumimo_llr_drange_fix=atoi(optarg);
|
||||
|
||||
case 'x':
|
||||
transmission_mode=atoi(optarg);
|
||||
|
||||
if ((transmission_mode!=1) &&
|
||||
(transmission_mode!=2) &&
|
||||
(transmission_mode!=3) &&
|
||||
(transmission_mode!=4) &&
|
||||
(transmission_mode!=5) &&
|
||||
(transmission_mode!=6) &&
|
||||
(transmission_mode!=7)) {
|
||||
msg("Unsupported transmission mode %d\n",transmission_mode);
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
if (transmission_mode>1 && transmission_mode<7){
|
||||
n_tx_port = 2;
|
||||
n_tx_phy = n_tx_port;
|
||||
} else if (transmission_mode==7){
|
||||
n_tx_port = 1;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 'O':
|
||||
test_perf=atoi(optarg);
|
||||
//print_perf =1;
|
||||
case 'y':
|
||||
n_tx_phy=atoi(optarg);
|
||||
|
||||
if (transmission_mode>1&&transmission_mode<7) {
|
||||
if(n_tx_phy==1) {
|
||||
msg("n_tx_phy must be >1 for transmission_mode %d\n",transmission_mode);
|
||||
exit(-1);
|
||||
} else if (n_tx_phy!=n_tx_port) { // to be changed
|
||||
msg("For transmission mode TM2-TM6, physical antenna number should be the same as antenna port number.\n");
|
||||
exit(-1);
|
||||
}
|
||||
}
|
||||
|
||||
//if (transmission_mode==7 && (n_tx_phy!=1 && n_tx_phy!=2 && n_tx_phy!=4 && n_tx_phy!=8 && n_tx_phy!=16 && n_tx_phy!=64 && n_tx_phy!=128)) {
|
||||
if (transmission_mode==7 && (n_tx_phy!=1 && n_tx_phy!=2 && n_tx_phy!=4 && n_tx_phy!=16 && n_tx_phy!=64)) {
|
||||
msg("Physical number of antennas not supported for TM7.\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 'Y':
|
||||
perfect_ce=1;
|
||||
break;
|
||||
|
||||
case 'z':
|
||||
n_rx=atoi(optarg);
|
||||
|
||||
if ((n_rx==0) || (n_rx>2)) {
|
||||
msg("Unsupported number of rx antennas %d\n",n_rx);
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 'Z':
|
||||
dump_table=1;
|
||||
break;
|
||||
|
||||
case 'Y':
|
||||
perfect_ce=1;
|
||||
break;
|
||||
|
||||
|
||||
case 'h':
|
||||
default:
|
||||
@@ -741,27 +666,19 @@ int main(int argc, char **argv)
|
||||
switch (N_RB_DL) {
|
||||
case 6:
|
||||
if (rballocset==0) DLSCH_RB_ALLOC = 0x3f;
|
||||
|
||||
BW = 1.25;
|
||||
num_pdcch_symbols = 3;
|
||||
break;
|
||||
|
||||
case 25:
|
||||
if (rballocset==0) DLSCH_RB_ALLOC = 0x1fff;
|
||||
|
||||
BW = 5.00;
|
||||
break;
|
||||
|
||||
case 50:
|
||||
if (rballocset==0) DLSCH_RB_ALLOC = 0x1ffff;
|
||||
|
||||
BW = 10.00;
|
||||
break;
|
||||
|
||||
case 100:
|
||||
if (rballocset==0) DLSCH_RB_ALLOC = 0x1ffffff;
|
||||
|
||||
BW = 20.00;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -769,9 +686,6 @@ int main(int argc, char **argv)
|
||||
} else
|
||||
NB_RB = 4;
|
||||
|
||||
NB_RB=conv_nprb(0,DLSCH_RB_ALLOC,N_RB_DL);
|
||||
|
||||
|
||||
#ifdef XFORMS
|
||||
fl_initialize (&argc, argv, NULL, 0, 0);
|
||||
form_ue = create_lte_phy_scope_ue();
|
||||
@@ -792,8 +706,7 @@ int main(int argc, char **argv)
|
||||
printf("dual_stream_UE=%d\n", dual_stream_UE);
|
||||
}
|
||||
|
||||
|
||||
lte_param_init(n_tx_port,n_tx_phy,n_rx,transmission_mode,extended_prefix_flag,fdd_flag,Nid_cell,tdd_config,N_RB_DL,osf,perfect_ce);
|
||||
lte_param_init(n_tx_port,n_tx_phy,n_rx,transmission_mode,extended_prefix_flag,frame_type,Nid_cell,tdd_config,N_RB_DL,threequarter_fs,osf,perfect_ce);
|
||||
|
||||
frame_parms = &PHY_vars_eNB->lte_frame_parms;
|
||||
|
||||
@@ -816,7 +729,7 @@ int main(int argc, char **argv)
|
||||
lte_gold_ue_spec_port5(PHY_vars_UE->lte_gold_uespec_port5_table,Nid_cell,n_rnti);
|
||||
}
|
||||
|
||||
|
||||
|
||||
eNB_id_i = PHY_vars_UE->n_connected_eNB;
|
||||
|
||||
printf("Setting mcs1 = %d\n",mcs1);
|
||||
@@ -857,6 +770,10 @@ int main(int argc, char **argv)
|
||||
sprintf(bler_fname,"bler_tm%d_chan%d_perfce%d_ntx%d_nrx%d_mcs%d.csv",transmission_mode,channel_model,perfect_ce,n_tx_phy,n_rx,mcs1);
|
||||
|
||||
bler_fd = fopen(bler_fname,"w");
|
||||
if (bler_fd==NULL) {
|
||||
fprintf(stderr,"Cannot create file %s!\n",bler_fname);
|
||||
exit(-1);
|
||||
}
|
||||
fprintf(bler_fd,"SNR; MCS; TBS; rate; err0; trials0; err1; trials1; err2; trials2; err3; trials3; dci_err\n");
|
||||
|
||||
if (test_perf != 0) {
|
||||
@@ -864,12 +781,16 @@ int main(int argc, char **argv)
|
||||
hostname[1023] = '\0';
|
||||
gethostname(hostname, 1023);
|
||||
printf("Hostname: %s\n", hostname);
|
||||
char dirname[FILENAME_MAX];
|
||||
sprintf(dirname, "%s/SIMU/USER/pre-ci-logs-%s", getenv("OPENAIR_TARGETS"),hostname );
|
||||
sprintf(time_meas_fname,"%s/time_meas_prb%d_mcs%d_anttx%d_antrx%d_pdcch%d_channel%s_tx%d.csv",
|
||||
dirname,N_RB_DL,mcs1,n_tx_phy,n_rx,num_pdcch_symbols,channel_model_input,transmission_mode);
|
||||
mkdir(dirname,0777);
|
||||
//char dirname[FILENAME_MAX];
|
||||
//sprintf(dirname, "%s/SIMU/USER/pre-ci-logs-%s", getenv("OPENAIR_TARGETS"),hostname );
|
||||
sprintf(time_meas_fname,"time_meas_prb%d_mcs%d_anttx%d_antrx%d_pdcch%d_channel%s_tx%d.csv",
|
||||
N_RB_DL,mcs1,n_tx_phy,n_rx,num_pdcch_symbols,channel_model_input,transmission_mode);
|
||||
//mkdir(dirname,0777);
|
||||
time_meas_fd = fopen(time_meas_fname,"w");
|
||||
if (time_meas_fd==NULL) {
|
||||
fprintf(stderr,"Cannot create file %s!\n",time_meas_fname);
|
||||
exit(-1);
|
||||
}
|
||||
}
|
||||
|
||||
if(abstx) {
|
||||
@@ -877,6 +798,10 @@ int main(int argc, char **argv)
|
||||
sprintf(csv_fname,"dataout_tx%d_u2%d_mcs%d_chan%d_nsimus%d_R%d.m",transmission_mode,dual_stream_UE,mcs1,channel_model,n_frames,num_rounds);
|
||||
csv_fd = fopen(csv_fname,"w");
|
||||
fprintf(csv_fd,"data_all%d=[",mcs1);
|
||||
if (csv_fd==NULL) {
|
||||
fprintf(stderr,"Cannot create file %s!\n",csv_fname);
|
||||
exit(-1);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1038,7 +963,8 @@ int main(int argc, char **argv)
|
||||
eNB2UE[0] = new_channel_desc_scm(PHY_vars_eNB->lte_frame_parms.nb_antennas_tx,
|
||||
PHY_vars_UE->lte_frame_parms.nb_antennas_rx,
|
||||
channel_model,
|
||||
BW,
|
||||
N_RB2sampling_rate(PHY_vars_eNB->lte_frame_parms.N_RB_DL),
|
||||
N_RB2channel_bandwidth(PHY_vars_eNB->lte_frame_parms.N_RB_DL),
|
||||
forgetting_factor,
|
||||
rx_sample_offset,
|
||||
0);
|
||||
@@ -1048,8 +974,9 @@ int main(int argc, char **argv)
|
||||
eNB2UE[n] = new_channel_desc_scm(PHY_vars_eNB->lte_frame_parms.nb_antennas_tx,
|
||||
PHY_vars_UE->lte_frame_parms.nb_antennas_rx,
|
||||
channel_model,
|
||||
BW,
|
||||
forgetting_factor,
|
||||
N_RB2sampling_rate(PHY_vars_eNB->lte_frame_parms.N_RB_DL),
|
||||
N_RB2channel_bandwidth(PHY_vars_eNB->lte_frame_parms.N_RB_DL),
|
||||
forgetting_factor,
|
||||
rx_sample_offset,
|
||||
0);
|
||||
}
|
||||
@@ -1064,11 +991,27 @@ int main(int argc, char **argv)
|
||||
else
|
||||
Kmimo=1;
|
||||
|
||||
switch (ue_category) {
|
||||
case 1:
|
||||
Nsoft = 250368;
|
||||
break;
|
||||
case 2:
|
||||
case 3:
|
||||
Nsoft = 1237248;
|
||||
break;
|
||||
case 4:
|
||||
Nsoft = 1827072;
|
||||
break;
|
||||
default:
|
||||
printf("Unsupported UE category %d\n",ue_category);
|
||||
exit(-1);
|
||||
break;
|
||||
}
|
||||
|
||||
for (k=0; k<n_users; k++) {
|
||||
// Create transport channel structures for 2 transport blocks (MIMO)
|
||||
for (i=0; i<2; i++) {
|
||||
|
||||
PHY_vars_eNB->dlsch_eNB[k][i] = new_eNB_dlsch(Kmimo,8,N_RB_DL,0,&PHY_vars_eNB->lte_frame_parms);
|
||||
PHY_vars_eNB->dlsch_eNB[k][i] = new_eNB_dlsch(Kmimo,8,Nsoft,N_RB_DL,0,&PHY_vars_eNB->lte_frame_parms);
|
||||
|
||||
if (!PHY_vars_eNB->dlsch_eNB[k][i]) {
|
||||
printf("Can't get eNB dlsch structures\n");
|
||||
@@ -1099,7 +1042,7 @@ int main(int argc, char **argv)
|
||||
}
|
||||
|
||||
for (i=0; i<2; i++) {
|
||||
PHY_vars_UE->dlsch_ue[0][i] = new_ue_dlsch(Kmimo,8,MAX_TURBO_ITERATIONS,N_RB_DL,0);
|
||||
PHY_vars_UE->dlsch_ue[0][i] = new_ue_dlsch(Kmimo,8,Nsoft,MAX_TURBO_ITERATIONS,N_RB_DL,0);
|
||||
|
||||
if (!PHY_vars_UE->dlsch_ue[0][i]) {
|
||||
printf("Can't get ue dlsch structures\n");
|
||||
@@ -1110,7 +1053,7 @@ int main(int argc, char **argv)
|
||||
}
|
||||
|
||||
// structure for SIC at UE
|
||||
PHY_vars_UE->dlsch_eNB[0] = new_eNB_dlsch(Kmimo,8,N_RB_DL,0,&PHY_vars_eNB->lte_frame_parms);
|
||||
PHY_vars_UE->dlsch_eNB[0] = new_eNB_dlsch(Kmimo,8,Nsoft,N_RB_DL,0,&PHY_vars_eNB->lte_frame_parms);
|
||||
|
||||
if (DLSCH_alloc_pdu2_1E[0].tpmi == 5) {
|
||||
|
||||
@@ -1401,7 +1344,7 @@ int main(int argc, char **argv)
|
||||
dci_alloc[num_dci].L = 1;
|
||||
dci_alloc[num_dci].rnti = SI_RNTI;
|
||||
dci_alloc[num_dci].format = format1A;
|
||||
dci_alloc[num_dci].nCCE = 0;
|
||||
dci_alloc[num_dci].firstCCE = 0;
|
||||
dump_dci(&PHY_vars_eNB->lte_frame_parms,&dci_alloc[num_dci]);
|
||||
|
||||
printf("Generating dlsch params for user %d\n",k);
|
||||
@@ -1708,7 +1651,7 @@ int main(int argc, char **argv)
|
||||
dci_alloc[num_dci].L = 1;
|
||||
dci_alloc[num_dci].rnti = SI_RNTI;
|
||||
dci_alloc[num_dci].format = format1A;
|
||||
dci_alloc[num_dci].nCCE = 0;
|
||||
dci_alloc[num_dci].firstCCE = 0;
|
||||
dump_dci(&PHY_vars_eNB->lte_frame_parms,&dci_alloc[num_dci]);
|
||||
|
||||
printf("Generating dlsch params for user %d\n",k);
|
||||
@@ -2016,7 +1959,7 @@ int main(int argc, char **argv)
|
||||
dci_alloc[num_dci].L = 1;
|
||||
dci_alloc[num_dci].rnti = SI_RNTI;
|
||||
dci_alloc[num_dci].format = format1A;
|
||||
dci_alloc[num_dci].nCCE = 0;
|
||||
dci_alloc[num_dci].firstCCE = 0;
|
||||
dump_dci(&PHY_vars_eNB->lte_frame_parms,&dci_alloc[num_dci]);
|
||||
|
||||
printf("Generating dlsch params for user %d\n",k);
|
||||
@@ -2047,7 +1990,7 @@ int main(int argc, char **argv)
|
||||
dci_alloc[num_dci].L = 1;
|
||||
dci_alloc[num_dci].rnti = n_rnti+k;
|
||||
dci_alloc[num_dci].format = format1E_2A_M10PRB;
|
||||
dci_alloc[num_dci].nCCE = 4*k;
|
||||
dci_alloc[num_dci].firstCCE = 4*k;
|
||||
printf("Generating dlsch params for user %d\n",k);
|
||||
generate_eNB_dlsch_params_from_dci(0,
|
||||
subframe,
|
||||
@@ -2092,17 +2035,20 @@ int main(int argc, char **argv)
|
||||
if (n_frames==1) printf("%d\n",numCCE);
|
||||
|
||||
// apply RNTI-based nCCE allocation
|
||||
memset(CCE_table,0,800*sizeof(int));
|
||||
|
||||
for (i=num_common_dci; i<num_dci; i++) {
|
||||
|
||||
dci_alloc[i].nCCE = get_nCCE_offset(1<<dci_alloc[i].L,
|
||||
numCCE,
|
||||
(dci_alloc[i].rnti==SI_RNTI)? 1 : 0,
|
||||
dci_alloc[i].rnti,
|
||||
subframe);
|
||||
dci_alloc[i].firstCCE = get_nCCE_offset_l1(CCE_table,
|
||||
1<<dci_alloc[i].L,
|
||||
numCCE,
|
||||
(dci_alloc[i].rnti==SI_RNTI)? 1 : 0,
|
||||
dci_alloc[i].rnti,
|
||||
subframe);
|
||||
|
||||
if (n_frames==1)
|
||||
printf("dci %d: rnti %x, format %d : nCCE %d/%d\n",i,dci_alloc[i].rnti, dci_alloc[i].format,
|
||||
dci_alloc[i].nCCE,numCCE);
|
||||
dci_alloc[i].firstCCE,numCCE);
|
||||
}
|
||||
|
||||
for (k=0; k<n_users; k++) {
|
||||
@@ -2187,7 +2133,7 @@ int main(int argc, char **argv)
|
||||
round_trials[3] = 0;
|
||||
|
||||
dci_errors=0;
|
||||
avg_ber = 0;
|
||||
// avg_ber = 0;
|
||||
|
||||
round=0;
|
||||
avg_iter = 0;
|
||||
@@ -2662,7 +2608,7 @@ PMI_FEEDBACK:
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
num_pdcch_symbols_2 = generate_dci_top(num_ue_spec_dci,
|
||||
num_common_dci,
|
||||
dci_alloc,
|
||||
@@ -2671,7 +2617,7 @@ PMI_FEEDBACK:
|
||||
&PHY_vars_eNB->lte_frame_parms,
|
||||
PHY_vars_eNB->lte_eNB_common_vars.txdataF[eNB_id],
|
||||
subframe);
|
||||
|
||||
|
||||
if (num_pdcch_symbols_2 > num_pdcch_symbols) {
|
||||
msg("Error: given num_pdcch_symbols not big enough (%d > %d)\n",num_pdcch_symbols_2,num_pdcch_symbols);
|
||||
exit(-1);
|
||||
@@ -2783,7 +2729,8 @@ PMI_FEEDBACK:
|
||||
subframe,
|
||||
num_pdcch_symbols,
|
||||
PHY_vars_eNB->dlsch_eNB[k][0],
|
||||
PHY_vars_eNB->dlsch_eNB[k][1]);
|
||||
PHY_vars_eNB->dlsch_eNB[k][1]);
|
||||
|
||||
stop_meas(&PHY_vars_eNB->dlsch_modulation_stats);
|
||||
/*
|
||||
if (trials==0 && round==0)
|
||||
@@ -3029,7 +2976,7 @@ PMI_FEEDBACK:
|
||||
|
||||
// Multipath channel
|
||||
if (awgn_flag == 0) {
|
||||
multipath_channel(eNB2UE[0],s_re,s_im,r_re,r_im,
|
||||
multipath_channel(eNB2UE[round],s_re,s_im,r_re,r_im,
|
||||
2*frame_parms->samples_per_tti,hold_channel);
|
||||
|
||||
// printf("amc: ****************** eNB2UE[%d]->n_rx = %d,dd %d\n",round,eNB2UE[round]->nb_rx,eNB2UE[round]->channel_offset);
|
||||
@@ -3039,8 +2986,16 @@ PMI_FEEDBACK:
|
||||
random_channel(eNB2UE[2],0);
|
||||
random_channel(eNB2UE[3],0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (PHY_vars_UE->perfect_ce==1) {
|
||||
// fill in perfect channel estimates
|
||||
freq_channel(eNB2UE[round],PHY_vars_UE->lte_frame_parms.N_RB_DL,12*PHY_vars_UE->lte_frame_parms.N_RB_DL + 1);
|
||||
/*
|
||||
write_output("channel.m","ch",eNB2UE[round]->ch[0],eNB2UE[round]->channel_length,1,8);
|
||||
write_output("channelF.m","chF",eNB2UE[round]->chF[0],12*PHY_vars_UE->lte_frame_parms.N_RB_DL + 1,1,8);
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
if(abstx) {
|
||||
if (trials==0 && round==0) {
|
||||
@@ -3192,11 +3147,6 @@ PMI_FEEDBACK:
|
||||
|
||||
if (PHY_vars_UE->perfect_ce==1) {
|
||||
if (awgn_flag==0) {
|
||||
// fill in perfect channel estimates
|
||||
freq_channel(eNB2UE[round],PHY_vars_UE->lte_frame_parms.N_RB_DL,12*PHY_vars_UE->lte_frame_parms.N_RB_DL + 1);
|
||||
|
||||
//write_output("channel.m","ch",desc1->ch[0],desc1->channel_length,1,8);
|
||||
//write_output("channelF.m","chF",desc1->chF[0],nb_samples,1,8);
|
||||
for(k=0; k<NUMBER_OF_eNB_MAX; k++) {
|
||||
for(aa=0; aa<frame_parms->nb_antenna_ports_eNB; aa++) {
|
||||
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
|
||||
|
||||
@@ -47,15 +47,12 @@
|
||||
#include "LAYER2/MAC/vars.h"
|
||||
|
||||
#ifdef XFORMS
|
||||
#include <forms.h>
|
||||
#include "../../USERSPACE_TOOLS/SCOPE/lte_scope.h"
|
||||
#include "PHY/TOOLS/lte_phy_scope.h"
|
||||
#endif //XFORMS
|
||||
|
||||
|
||||
#include "OCG_vars.h"
|
||||
|
||||
//#define BW 5.0
|
||||
|
||||
|
||||
PHY_VARS_eNB *PHY_vars_eNB;
|
||||
PHY_VARS_UE *PHY_vars_UE;
|
||||
@@ -131,7 +128,7 @@ int main(int argc, char **argv)
|
||||
|
||||
char c;
|
||||
|
||||
int i,l,aa,aarx;
|
||||
int i,l,aa,aarx,k;
|
||||
double sigma2, sigma2_dB=0,SNR,snr0=-2.0,snr1=0.0;
|
||||
uint8_t snr1set=0;
|
||||
double snr_step=1,input_snr_step=1;
|
||||
@@ -172,20 +169,19 @@ int main(int argc, char **argv)
|
||||
unsigned int trials,errs[4]= {0,0,0,0}; //,round_trials[4]={0,0,0,0};
|
||||
|
||||
uint8_t N_RB_DL=25,osf=1;
|
||||
double BW=5.0;
|
||||
uint32_t perfect_ce = 0;
|
||||
|
||||
lte_frame_type_t frame_type = FDD;
|
||||
|
||||
|
||||
#ifdef XFORMS
|
||||
FD_lte_scope *form_dl;
|
||||
FD_lte_phy_scope_ue *form_ue;
|
||||
char title[255];
|
||||
|
||||
fl_initialize (&argc, argv, NULL, 0, 0);
|
||||
form_dl = create_form_lte_scope();
|
||||
form_ue = create_lte_phy_scope_ue();
|
||||
sprintf (title, "LTE DL SCOPE UE");
|
||||
fl_show_form (form_dl->lte_scope, FL_PLACE_HOTSPOT, FL_FULLBORDER, title);
|
||||
fl_show_form (form_ue->lte_phy_scope_ue, FL_PLACE_HOTSPOT, FL_FULLBORDER, title);
|
||||
#endif
|
||||
|
||||
logInit();
|
||||
@@ -255,27 +251,9 @@ int main(int argc, char **argv)
|
||||
case 'R':
|
||||
N_RB_DL = atoi(optarg);
|
||||
|
||||
switch (N_RB_DL) {
|
||||
case 6:
|
||||
BW=1.25;
|
||||
break;
|
||||
|
||||
case 25:
|
||||
BW=5.0;
|
||||
break;
|
||||
|
||||
case 50:
|
||||
BW=10.0;
|
||||
break;
|
||||
|
||||
case 100:
|
||||
BW=20.0;
|
||||
break;
|
||||
|
||||
default:
|
||||
if ((N_RB_DL!=6) && (N_RB_DL!=25) && (N_RB_DL!=50) && (N_RB_DL!=100)) {
|
||||
printf("Unsupported Bandwidth %d\n",N_RB_DL);
|
||||
exit(-1);
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
@@ -397,7 +375,8 @@ int main(int argc, char **argv)
|
||||
eNB2UE = new_channel_desc_scm(PHY_vars_eNB->lte_frame_parms.nb_antennas_tx,
|
||||
PHY_vars_UE->lte_frame_parms.nb_antennas_rx,
|
||||
channel_model,
|
||||
BW,
|
||||
N_RB2sampling_rate(PHY_vars_eNB->lte_frame_parms.N_RB_DL),
|
||||
N_RB2channel_bandwidth(PHY_vars_eNB->lte_frame_parms.N_RB_DL),
|
||||
0,
|
||||
0,
|
||||
0);
|
||||
@@ -477,7 +456,7 @@ int main(int argc, char **argv)
|
||||
|
||||
PHY_ofdm_mod(PHY_vars_eNB->lte_eNB_common_vars.txdataF[0][0], // input,
|
||||
txdata[0], // output
|
||||
frame_parms->log2_symbol_size, // log2_fft_size
|
||||
frame_parms->ofdm_symbol_size,
|
||||
LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*nsymb, // number of symbols
|
||||
frame_parms->nb_prefix_samples, // number of prefix samples
|
||||
CYCLIC_PREFIX);
|
||||
@@ -541,15 +520,26 @@ int main(int argc, char **argv)
|
||||
subframe%10,
|
||||
0,
|
||||
0);
|
||||
}
|
||||
|
||||
for (l=2; l<12; l++) {
|
||||
rx_pmch(PHY_vars_UE,
|
||||
|
||||
if (PHY_vars_UE->perfect_ce==1) {
|
||||
// fill in perfect channel estimates
|
||||
freq_channel(eNB2UE,PHY_vars_UE->lte_frame_parms.N_RB_DL,12*PHY_vars_UE->lte_frame_parms.N_RB_DL + 1);
|
||||
for(k=0; k<NUMBER_OF_eNB_MAX; k++) {
|
||||
for(aa=0; aa<frame_parms->nb_antennas_tx; aa++) {
|
||||
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
|
||||
for (i=0; i<frame_parms->N_RB_DL*12; i++) {
|
||||
((int16_t *) PHY_vars_UE->lte_ue_common_vars.dl_ch_estimates[k][(aa<<1)+aarx])[2*i+(l*frame_parms->ofdm_symbol_size+LTE_CE_FILTER_LENGTH)*2]=(int16_t)(eNB2UE->chF[aarx+(aa*frame_parms->nb_antennas_rx)][i].x*AMP);
|
||||
((int16_t *) PHY_vars_UE->lte_ue_common_vars.dl_ch_estimates[k][(aa<<1)+aarx])[2*i+1+(l*frame_parms->ofdm_symbol_size+LTE_CE_FILTER_LENGTH)*2]=(int16_t)(eNB2UE->chF[aarx+(aa*frame_parms->nb_antennas_rx)][i].y*AMP);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
rx_pmch(PHY_vars_UE,
|
||||
0,
|
||||
subframe%10,
|
||||
l);
|
||||
|
||||
|
||||
}
|
||||
|
||||
PHY_vars_UE->dlsch_ue_MCH[0]->harq_processes[0]->G = get_G(&PHY_vars_UE->lte_frame_parms,
|
||||
|
||||
@@ -53,90 +53,11 @@
|
||||
|
||||
#include "OCG_vars.h"
|
||||
|
||||
#define BW 5.0
|
||||
|
||||
|
||||
PHY_VARS_eNB *PHY_vars_eNb,*PHY_vars_eNb1,*PHY_vars_eNb2;
|
||||
PHY_VARS_eNB *PHY_vars_eNB,*PHY_vars_eNB1,*PHY_vars_eNB2;
|
||||
PHY_VARS_UE *PHY_vars_UE;
|
||||
|
||||
#define DLSCH_RB_ALLOC 0x1fbf // igore DC component,RB13
|
||||
|
||||
void lte_param_init(unsigned char N_tx, unsigned char N_rx,unsigned char transmission_mode,unsigned char extended_prefix_flag,unsigned char frame_type, uint16_t Nid_cell,uint8_t N_RB_DL,uint8_t osf)
|
||||
{
|
||||
|
||||
// unsigned int ind;
|
||||
LTE_DL_FRAME_PARMS *lte_frame_parms;
|
||||
int i;
|
||||
|
||||
printf("Start lte_param_init\n");
|
||||
PHY_vars_eNb = malloc(sizeof(PHY_VARS_eNB));
|
||||
PHY_vars_eNb1 = malloc(sizeof(PHY_VARS_eNB));
|
||||
PHY_vars_eNb2 = malloc(sizeof(PHY_VARS_eNB));
|
||||
|
||||
PHY_vars_UE = malloc(sizeof(PHY_VARS_UE));
|
||||
//PHY_config = malloc(sizeof(PHY_CONFIG));
|
||||
mac_xface = malloc(sizeof(MAC_xface));
|
||||
|
||||
randominit(0);
|
||||
set_taus_seed(0);
|
||||
|
||||
lte_frame_parms = &(PHY_vars_eNb->lte_frame_parms);
|
||||
|
||||
lte_frame_parms->N_RB_DL = N_RB_DL; //50 for 10MHz and 25 for 5 MHz
|
||||
lte_frame_parms->N_RB_UL = N_RB_DL;
|
||||
lte_frame_parms->Ncp = extended_prefix_flag;
|
||||
lte_frame_parms->Nid_cell = Nid_cell;
|
||||
lte_frame_parms->nushift = Nid_cell%6;
|
||||
lte_frame_parms->nb_antennas_tx = N_tx;
|
||||
lte_frame_parms->nb_antenna_ports_eNB = N_tx;
|
||||
lte_frame_parms->nb_antennas_rx = N_rx;
|
||||
// lte_frame_parms->Csrs = 2;
|
||||
// lte_frame_parms->Bsrs = 0;
|
||||
// lte_frame_parms->kTC = 0;
|
||||
// lte_frame_parms->n_RRC = 0;
|
||||
lte_frame_parms->mode1_flag = (transmission_mode == 1)? 1 : 0;
|
||||
lte_frame_parms->tdd_config = 3;
|
||||
lte_frame_parms->frame_type = frame_type;
|
||||
init_frame_parms(lte_frame_parms,osf);
|
||||
|
||||
//copy_lte_parms_to_phy_framing(lte_frame_parms, &(PHY_config->PHY_framing));
|
||||
|
||||
PHY_vars_UE->lte_frame_parms = *lte_frame_parms;
|
||||
|
||||
phy_init_lte_top(lte_frame_parms);
|
||||
|
||||
PHY_vars_UE->PHY_measurements.n_adj_cells=2;
|
||||
PHY_vars_UE->PHY_measurements.adj_cell_id[0] = Nid_cell+1;
|
||||
PHY_vars_UE->PHY_measurements.adj_cell_id[1] = Nid_cell+2;
|
||||
|
||||
for (i=0; i<3; i++)
|
||||
lte_gold(lte_frame_parms,PHY_vars_UE->lte_gold_table[i],Nid_cell+i);
|
||||
|
||||
phy_init_lte_ue(PHY_vars_UE,1,0);
|
||||
|
||||
phy_init_lte_eNB(PHY_vars_eNb,0,0,0);
|
||||
|
||||
memcpy((void*)&PHY_vars_eNb1->lte_frame_parms,(void*)&PHY_vars_eNb->lte_frame_parms,sizeof(LTE_DL_FRAME_PARMS));
|
||||
PHY_vars_eNb1->lte_frame_parms.Nid_cell=Nid_cell+1;
|
||||
PHY_vars_eNb1->lte_frame_parms.nushift=(Nid_cell+1)%6;
|
||||
PHY_vars_eNb1->Mod_id=1;
|
||||
|
||||
memcpy((void*)&PHY_vars_eNb2->lte_frame_parms,(void*)&PHY_vars_eNb->lte_frame_parms,sizeof(LTE_DL_FRAME_PARMS));
|
||||
PHY_vars_eNb2->lte_frame_parms.Nid_cell=Nid_cell+2;
|
||||
PHY_vars_eNb2->lte_frame_parms.nushift=(Nid_cell+2)%6;
|
||||
PHY_vars_eNb2->Mod_id=2;
|
||||
|
||||
phy_init_lte_eNB(PHY_vars_eNb1,0,0,0);
|
||||
|
||||
phy_init_lte_eNB(PHY_vars_eNb2,0,0,0);
|
||||
|
||||
phy_init_lte_top(lte_frame_parms);
|
||||
|
||||
printf("Done lte_param_init\n");
|
||||
|
||||
|
||||
}
|
||||
|
||||
mod_sym_t *dummybuf[4];
|
||||
mod_sym_t dummy0[2048*14];
|
||||
mod_sym_t dummy1[2048*14];
|
||||
@@ -423,6 +344,28 @@ int main(int argc, char **argv)
|
||||
|
||||
lte_param_init(n_tx,n_rx,transmission_mode,extended_prefix_flag,frame_type,Nid_cell,N_RB_DL,osf);
|
||||
|
||||
PHY_vars_eNB1 = malloc(sizeof(PHY_VARS_eNB));
|
||||
PHY_vars_eNB2 = malloc(sizeof(PHY_VARS_eNB));
|
||||
PHY_vars_UE->PHY_measurements.n_adj_cells=2;
|
||||
PHY_vars_UE->PHY_measurements.adj_cell_id[0] = Nid_cell+1;
|
||||
PHY_vars_UE->PHY_measurements.adj_cell_id[1] = Nid_cell+2;
|
||||
|
||||
for (i=0; i<3; i++)
|
||||
lte_gold(&PHY_vars_eNB->lte_frame_parms,PHY_vars_UE->lte_gold_table[i],Nid_cell+i);
|
||||
|
||||
memcpy((void*)&PHY_vars_eNB1->lte_frame_parms,(void*)&PHY_vars_eNB->lte_frame_parms,sizeof(LTE_DL_FRAME_PARMS));
|
||||
PHY_vars_eNB1->lte_frame_parms.Nid_cell=Nid_cell+1;
|
||||
PHY_vars_eNB1->lte_frame_parms.nushift=(Nid_cell+1)%6;
|
||||
PHY_vars_eNB1->Mod_id=1;
|
||||
|
||||
memcpy((void*)&PHY_vars_eNB2->lte_frame_parms,(void*)&PHY_vars_eNB->lte_frame_parms,sizeof(LTE_DL_FRAME_PARMS));
|
||||
PHY_vars_eNB2->lte_frame_parms.Nid_cell=Nid_cell+2;
|
||||
PHY_vars_eNB2->lte_frame_parms.nushift=(Nid_cell+2)%6;
|
||||
PHY_vars_eNB2->Mod_id=2;
|
||||
|
||||
phy_init_lte_eNB(PHY_vars_eNB1,0,0,0);
|
||||
phy_init_lte_eNB(PHY_vars_eNB2,0,0,0);
|
||||
|
||||
#ifdef XFORMS
|
||||
fl_initialize (&argc, argv, NULL, 0, 0);
|
||||
form_ue = create_lte_phy_scope_ue();
|
||||
@@ -439,13 +382,13 @@ int main(int argc, char **argv)
|
||||
|
||||
printf("SNR0 %f, SNR1 %f\n",snr0,snr1);
|
||||
|
||||
frame_parms = &PHY_vars_eNb->lte_frame_parms;
|
||||
frame_parms = &PHY_vars_eNB->lte_frame_parms;
|
||||
|
||||
|
||||
|
||||
txdata = PHY_vars_eNb->lte_eNB_common_vars.txdata[0];
|
||||
txdata1 = PHY_vars_eNb1->lte_eNB_common_vars.txdata[0];
|
||||
txdata2 = PHY_vars_eNb2->lte_eNB_common_vars.txdata[0];
|
||||
txdata = PHY_vars_eNB->lte_eNB_common_vars.txdata[0];
|
||||
txdata1 = PHY_vars_eNB1->lte_eNB_common_vars.txdata[0];
|
||||
txdata2 = PHY_vars_eNB2->lte_eNB_common_vars.txdata[0];
|
||||
|
||||
|
||||
s_re = malloc(2*sizeof(double*));
|
||||
@@ -466,8 +409,8 @@ int main(int argc, char **argv)
|
||||
printf("FFT Size %d, Extended Prefix %d, Samples per subframe %d, Symbols per subframe %d, interf (%d,%d)\n",NUMBER_OF_OFDM_CARRIERS,
|
||||
frame_parms->Ncp,frame_parms->samples_per_tti,nsymb,interf1,interf2);
|
||||
|
||||
printf("PHY_vars_eNb1->lte_eNB_common_vars.txdataF[0][0] = %p\n",
|
||||
PHY_vars_eNb1->lte_eNB_common_vars.txdataF[0][0]);
|
||||
printf("PHY_vars_eNB1->lte_eNB_common_vars.txdataF[0][0] = %p\n",
|
||||
PHY_vars_eNB1->lte_eNB_common_vars.txdataF[0][0]);
|
||||
|
||||
|
||||
DLSCH_alloc_pdu2.rah = 0;
|
||||
@@ -482,28 +425,31 @@ int main(int argc, char **argv)
|
||||
// Forget second codeword
|
||||
DLSCH_alloc_pdu2.tpmi = (transmission_mode==6 ? 5 : 0) ; // precoding
|
||||
|
||||
eNB2UE = new_channel_desc_scm(PHY_vars_eNb->lte_frame_parms.nb_antennas_tx,
|
||||
eNB2UE = new_channel_desc_scm(PHY_vars_eNB->lte_frame_parms.nb_antennas_tx,
|
||||
PHY_vars_UE->lte_frame_parms.nb_antennas_rx,
|
||||
channel_model,
|
||||
BW,
|
||||
N_RB2sampling_rate(PHY_vars_eNB->lte_frame_parms.N_RB_DL),
|
||||
N_RB2channel_bandwidth(PHY_vars_eNB->lte_frame_parms.N_RB_DL),
|
||||
0,
|
||||
0,
|
||||
0);
|
||||
|
||||
if (interf1>-20)
|
||||
eNB2UE1 = new_channel_desc_scm(PHY_vars_eNb->lte_frame_parms.nb_antennas_tx,
|
||||
eNB2UE1 = new_channel_desc_scm(PHY_vars_eNB->lte_frame_parms.nb_antennas_tx,
|
||||
PHY_vars_UE->lte_frame_parms.nb_antennas_rx,
|
||||
channel_model,
|
||||
BW,
|
||||
N_RB2sampling_rate(PHY_vars_eNB->lte_frame_parms.N_RB_DL),
|
||||
N_RB2channel_bandwidth(PHY_vars_eNB->lte_frame_parms.N_RB_DL),
|
||||
0,
|
||||
4,
|
||||
0);
|
||||
|
||||
if (interf2>-20)
|
||||
eNB2UE2 = new_channel_desc_scm(PHY_vars_eNb->lte_frame_parms.nb_antennas_tx,
|
||||
eNB2UE2 = new_channel_desc_scm(PHY_vars_eNB->lte_frame_parms.nb_antennas_tx,
|
||||
PHY_vars_UE->lte_frame_parms.nb_antennas_rx,
|
||||
channel_model,
|
||||
BW,
|
||||
N_RB2sampling_rate(PHY_vars_eNB->lte_frame_parms.N_RB_DL),
|
||||
N_RB2channel_bandwidth(PHY_vars_eNB->lte_frame_parms.N_RB_DL),
|
||||
0,
|
||||
8,
|
||||
0);
|
||||
@@ -567,47 +513,47 @@ int main(int argc, char **argv)
|
||||
pbch_pdu[1]=1;
|
||||
pbch_pdu[2]=0;
|
||||
|
||||
if (PHY_vars_eNb->lte_frame_parms.frame_type == 0) {
|
||||
generate_pss(PHY_vars_eNb->lte_eNB_common_vars.txdataF[0],
|
||||
if (PHY_vars_eNB->lte_frame_parms.frame_type == 0) {
|
||||
generate_pss(PHY_vars_eNB->lte_eNB_common_vars.txdataF[0],
|
||||
AMP,
|
||||
&PHY_vars_eNb->lte_frame_parms,
|
||||
(PHY_vars_eNb->lte_frame_parms.Ncp==0) ? 6 : 5,
|
||||
&PHY_vars_eNB->lte_frame_parms,
|
||||
(PHY_vars_eNB->lte_frame_parms.Ncp==0) ? 6 : 5,
|
||||
0);
|
||||
generate_sss(PHY_vars_eNb->lte_eNB_common_vars.txdataF[0],
|
||||
generate_sss(PHY_vars_eNB->lte_eNB_common_vars.txdataF[0],
|
||||
AMP,
|
||||
&PHY_vars_eNb->lte_frame_parms,
|
||||
(PHY_vars_eNb->lte_frame_parms.Ncp==0) ? 5 : 4,
|
||||
&PHY_vars_eNB->lte_frame_parms,
|
||||
(PHY_vars_eNB->lte_frame_parms.Ncp==0) ? 5 : 4,
|
||||
0);
|
||||
generate_pss(PHY_vars_eNb->lte_eNB_common_vars.txdataF[0],
|
||||
generate_pss(PHY_vars_eNB->lte_eNB_common_vars.txdataF[0],
|
||||
AMP,
|
||||
&PHY_vars_eNb->lte_frame_parms,
|
||||
(PHY_vars_eNb->lte_frame_parms.Ncp==0) ? 6 : 5,
|
||||
&PHY_vars_eNB->lte_frame_parms,
|
||||
(PHY_vars_eNB->lte_frame_parms.Ncp==0) ? 6 : 5,
|
||||
10);
|
||||
generate_sss(PHY_vars_eNb->lte_eNB_common_vars.txdataF[0],
|
||||
generate_sss(PHY_vars_eNB->lte_eNB_common_vars.txdataF[0],
|
||||
AMP,
|
||||
&PHY_vars_eNb->lte_frame_parms,
|
||||
(PHY_vars_eNb->lte_frame_parms.Ncp==0) ? 5 : 4,
|
||||
&PHY_vars_eNB->lte_frame_parms,
|
||||
(PHY_vars_eNB->lte_frame_parms.Ncp==0) ? 5 : 4,
|
||||
10);
|
||||
|
||||
} else {
|
||||
generate_sss(PHY_vars_eNb->lte_eNB_common_vars.txdataF[0],
|
||||
generate_sss(PHY_vars_eNB->lte_eNB_common_vars.txdataF[0],
|
||||
AMP,
|
||||
&PHY_vars_eNb->lte_frame_parms,
|
||||
(PHY_vars_eNb->lte_frame_parms.Ncp==0) ? 6 : 5,
|
||||
&PHY_vars_eNB->lte_frame_parms,
|
||||
(PHY_vars_eNB->lte_frame_parms.Ncp==0) ? 6 : 5,
|
||||
1);
|
||||
generate_pss(PHY_vars_eNb->lte_eNB_common_vars.txdataF[0],
|
||||
generate_pss(PHY_vars_eNB->lte_eNB_common_vars.txdataF[0],
|
||||
AMP,
|
||||
&PHY_vars_eNb->lte_frame_parms,
|
||||
&PHY_vars_eNB->lte_frame_parms,
|
||||
2,
|
||||
2);
|
||||
generate_sss(PHY_vars_eNb->lte_eNB_common_vars.txdataF[0],
|
||||
generate_sss(PHY_vars_eNB->lte_eNB_common_vars.txdataF[0],
|
||||
AMP,
|
||||
&PHY_vars_eNb->lte_frame_parms,
|
||||
(PHY_vars_eNb->lte_frame_parms.Ncp==0) ? 6 : 5,
|
||||
&PHY_vars_eNB->lte_frame_parms,
|
||||
(PHY_vars_eNB->lte_frame_parms.Ncp==0) ? 6 : 5,
|
||||
11);
|
||||
generate_pss(PHY_vars_eNb->lte_eNB_common_vars.txdataF[0],
|
||||
generate_pss(PHY_vars_eNB->lte_eNB_common_vars.txdataF[0],
|
||||
AMP,
|
||||
&PHY_vars_eNb->lte_frame_parms,
|
||||
&PHY_vars_eNB->lte_frame_parms,
|
||||
2,
|
||||
12);
|
||||
|
||||
@@ -626,11 +572,11 @@ int main(int argc, char **argv)
|
||||
dci_alloc[1].rnti = 0x1234;
|
||||
*/
|
||||
|
||||
printf("Generating PBCH for mode1_flag = %d\n", PHY_vars_eNb->lte_frame_parms.mode1_flag);
|
||||
printf("Generating PBCH for mode1_flag = %d\n", PHY_vars_eNB->lte_frame_parms.mode1_flag);
|
||||
|
||||
|
||||
generate_pilots(PHY_vars_eNb,
|
||||
PHY_vars_eNb->lte_eNB_common_vars.txdataF[0],
|
||||
generate_pilots(PHY_vars_eNB,
|
||||
PHY_vars_eNB->lte_eNB_common_vars.txdataF[0],
|
||||
AMP,
|
||||
LTE_NUMBER_OF_SUBFRAMES_PER_FRAME);
|
||||
|
||||
@@ -641,8 +587,8 @@ int main(int argc, char **argv)
|
||||
dci_alloc,
|
||||
0,
|
||||
1024,
|
||||
&PHY_vars_eNb->lte_frame_parms,
|
||||
PHY_vars_eNb->lte_eNB_common_vars.txdataF[0],
|
||||
&PHY_vars_eNB->lte_frame_parms,
|
||||
PHY_vars_eNB->lte_eNB_common_vars.txdataF[0],
|
||||
0);
|
||||
*/
|
||||
|
||||
@@ -657,47 +603,47 @@ int main(int argc, char **argv)
|
||||
dummybuf[1] = dummy1;
|
||||
dummybuf[2] = dummy2;
|
||||
dummybuf[3] = dummy3;
|
||||
generate_pbch(&PHY_vars_eNb->lte_eNB_pbch,
|
||||
generate_pbch(&PHY_vars_eNB->lte_eNB_pbch,
|
||||
(mod_sym_t**)dummybuf,
|
||||
AMP,
|
||||
&PHY_vars_eNb->lte_frame_parms,
|
||||
&PHY_vars_eNB->lte_frame_parms,
|
||||
pbch_pdu,
|
||||
0);
|
||||
}
|
||||
|
||||
generate_pbch(&PHY_vars_eNb->lte_eNB_pbch,
|
||||
PHY_vars_eNb->lte_eNB_common_vars.txdataF[0],
|
||||
generate_pbch(&PHY_vars_eNB->lte_eNB_pbch,
|
||||
PHY_vars_eNB->lte_eNB_common_vars.txdataF[0],
|
||||
AMP,
|
||||
&PHY_vars_eNb->lte_frame_parms,
|
||||
&PHY_vars_eNB->lte_frame_parms,
|
||||
pbch_pdu,
|
||||
pbch_phase);
|
||||
/*
|
||||
generate_pbch(&PHY_vars_eNb->lte_eNB_pbch,
|
||||
PHY_vars_eNb->lte_eNB_common_vars.txdataF[0],
|
||||
generate_pbch(&PHY_vars_eNB->lte_eNB_pbch,
|
||||
PHY_vars_eNB->lte_eNB_common_vars.txdataF[0],
|
||||
AMP,
|
||||
&PHY_vars_eNb->lte_frame_parms,
|
||||
&PHY_vars_eNB->lte_frame_parms,
|
||||
pbch_pdu,
|
||||
1);
|
||||
*/
|
||||
|
||||
if (interf1>-20) {
|
||||
/*
|
||||
generate_pss(PHY_vars_eNb1->lte_eNB_common_vars.txdataF[0],
|
||||
generate_pss(PHY_vars_eNB1->lte_eNB_common_vars.txdataF[0],
|
||||
AMP,
|
||||
&PHY_vars_eNb1->lte_frame_parms,
|
||||
(PHY_vars_eNb1->lte_frame_parms.Ncp==0)?6:5,
|
||||
&PHY_vars_eNB1->lte_frame_parms,
|
||||
(PHY_vars_eNB1->lte_frame_parms.Ncp==0)?6:5,
|
||||
0);
|
||||
*/
|
||||
generate_pilots(PHY_vars_eNb1,
|
||||
PHY_vars_eNb1->lte_eNB_common_vars.txdataF[0],
|
||||
generate_pilots(PHY_vars_eNB1,
|
||||
PHY_vars_eNB1->lte_eNB_common_vars.txdataF[0],
|
||||
AMP,
|
||||
LTE_NUMBER_OF_SUBFRAMES_PER_FRAME);
|
||||
|
||||
|
||||
generate_pbch(&PHY_vars_eNb1->lte_eNB_pbch,
|
||||
PHY_vars_eNb1->lte_eNB_common_vars.txdataF[0],
|
||||
generate_pbch(&PHY_vars_eNB1->lte_eNB_pbch,
|
||||
PHY_vars_eNB1->lte_eNB_common_vars.txdataF[0],
|
||||
AMP,
|
||||
&PHY_vars_eNb1->lte_frame_parms,
|
||||
&PHY_vars_eNB1->lte_frame_parms,
|
||||
pbch_pdu,
|
||||
0);
|
||||
|
||||
@@ -705,26 +651,26 @@ int main(int argc, char **argv)
|
||||
|
||||
if (interf2>-20) {
|
||||
/*
|
||||
generate_pss(PHY_vars_eNb2->lte_eNB_common_vars.txdataF[0],
|
||||
generate_pss(PHY_vars_eNB2->lte_eNB_common_vars.txdataF[0],
|
||||
AMP,
|
||||
&PHY_vars_eNb2->lte_frame_parms,
|
||||
(PHY_vars_eNb2->lte_frame_parms.Ncp==0)?6:5,
|
||||
&PHY_vars_eNB2->lte_frame_parms,
|
||||
(PHY_vars_eNB2->lte_frame_parms.Ncp==0)?6:5,
|
||||
0);
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
generate_pilots(PHY_vars_eNb2,
|
||||
PHY_vars_eNb2->lte_eNB_common_vars.txdataF[0],
|
||||
generate_pilots(PHY_vars_eNB2,
|
||||
PHY_vars_eNB2->lte_eNB_common_vars.txdataF[0],
|
||||
AMP,
|
||||
LTE_NUMBER_OF_SUBFRAMES_PER_FRAME);
|
||||
|
||||
|
||||
generate_pbch(&PHY_vars_eNb2->lte_eNB_pbch,
|
||||
PHY_vars_eNb2->lte_eNB_common_vars.txdataF[0],
|
||||
generate_pbch(&PHY_vars_eNB2->lte_eNB_pbch,
|
||||
PHY_vars_eNB2->lte_eNB_common_vars.txdataF[0],
|
||||
AMP,
|
||||
&PHY_vars_eNb2->lte_frame_parms,
|
||||
&PHY_vars_eNB2->lte_frame_parms,
|
||||
pbch_pdu,
|
||||
0);
|
||||
|
||||
@@ -733,10 +679,10 @@ int main(int argc, char **argv)
|
||||
|
||||
// write_output("pilotsF.m","rsF",txdataF[0],lte_frame_parms->ofdm_symbol_size,1,1);
|
||||
|
||||
write_output("txsigF0.m","txsF0", PHY_vars_eNb->lte_eNB_common_vars.txdataF[0][0],FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX,1,1);
|
||||
write_output("txsigF0.m","txsF0", PHY_vars_eNB->lte_eNB_common_vars.txdataF[0][0],FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX,1,1);
|
||||
|
||||
if (PHY_vars_eNb->lte_frame_parms.nb_antennas_tx>1)
|
||||
write_output("txsigF1.m","txsF1", PHY_vars_eNb->lte_eNB_common_vars.txdataF[0][1],FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX,1,1);
|
||||
if (PHY_vars_eNB->lte_frame_parms.nb_antennas_tx>1)
|
||||
write_output("txsigF1.m","txsF1", PHY_vars_eNB->lte_eNB_common_vars.txdataF[0][1],FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX,1,1);
|
||||
|
||||
tx_lev = 0;
|
||||
tx_lev1 = 0;
|
||||
@@ -745,16 +691,16 @@ int main(int argc, char **argv)
|
||||
|
||||
|
||||
|
||||
for (aa=0; aa<PHY_vars_eNb->lte_frame_parms.nb_antennas_tx; aa++) {
|
||||
for (aa=0; aa<PHY_vars_eNB->lte_frame_parms.nb_antennas_tx; aa++) {
|
||||
if (frame_parms->Ncp == 1)
|
||||
PHY_ofdm_mod(PHY_vars_eNb->lte_eNB_common_vars.txdataF[0][aa], // input,
|
||||
PHY_ofdm_mod(PHY_vars_eNB->lte_eNB_common_vars.txdataF[0][aa], // input,
|
||||
txdata[aa], // output
|
||||
frame_parms->log2_symbol_size, // log2_fft_size
|
||||
frame_parms->ofdm_symbol_size,
|
||||
LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*nsymb, // number of symbols
|
||||
frame_parms->nb_prefix_samples, // number of prefix samples
|
||||
CYCLIC_PREFIX);
|
||||
else {
|
||||
normal_prefix_mod(PHY_vars_eNb->lte_eNB_common_vars.txdataF[0][aa],
|
||||
normal_prefix_mod(PHY_vars_eNB->lte_eNB_common_vars.txdataF[0][aa],
|
||||
txdata[aa],
|
||||
LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*nsymb,
|
||||
frame_parms);
|
||||
@@ -765,17 +711,17 @@ int main(int argc, char **argv)
|
||||
}
|
||||
|
||||
if (interf1>-20) {
|
||||
for (aa=0; aa<PHY_vars_eNb1->lte_frame_parms.nb_antennas_tx; aa++) {
|
||||
for (aa=0; aa<PHY_vars_eNB1->lte_frame_parms.nb_antennas_tx; aa++) {
|
||||
if (frame_parms->Ncp == 1)
|
||||
PHY_ofdm_mod(PHY_vars_eNb1->lte_eNB_common_vars.txdataF[0][aa], // input,
|
||||
PHY_vars_eNb1->lte_eNB_common_vars.txdata[0][aa], // output
|
||||
frame_parms->log2_symbol_size, // log2_fft_size
|
||||
PHY_ofdm_mod(PHY_vars_eNB1->lte_eNB_common_vars.txdataF[0][aa], // input,
|
||||
PHY_vars_eNB1->lte_eNB_common_vars.txdata[0][aa], // output
|
||||
frame_parms->ofdm_symbol_size,
|
||||
2*nsymb, // number of symbols
|
||||
frame_parms->nb_prefix_samples, // number of prefix samples
|
||||
CYCLIC_PREFIX);
|
||||
else {
|
||||
normal_prefix_mod(PHY_vars_eNb1->lte_eNB_common_vars.txdataF[0][aa],
|
||||
PHY_vars_eNb1->lte_eNB_common_vars.txdata[0][aa],
|
||||
normal_prefix_mod(PHY_vars_eNB1->lte_eNB_common_vars.txdataF[0][aa],
|
||||
PHY_vars_eNB1->lte_eNB_common_vars.txdata[0][aa],
|
||||
2*nsymb,
|
||||
frame_parms);
|
||||
}
|
||||
@@ -784,24 +730,24 @@ int main(int argc, char **argv)
|
||||
OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES);
|
||||
}
|
||||
|
||||
write_output("txsigF0_1.m","txsF0_1", PHY_vars_eNb1->lte_eNB_common_vars.txdataF[0][0],FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX,1,1);
|
||||
write_output("txsigF0_1.m","txsF0_1", PHY_vars_eNB1->lte_eNB_common_vars.txdataF[0][0],FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX,1,1);
|
||||
|
||||
if (PHY_vars_eNb1->lte_frame_parms.nb_antennas_tx>1)
|
||||
write_output("txsigF1_1.m","txsF1_1", PHY_vars_eNb1->lte_eNB_common_vars.txdataF[0][1],FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX,1,1);
|
||||
if (PHY_vars_eNB1->lte_frame_parms.nb_antennas_tx>1)
|
||||
write_output("txsigF1_1.m","txsF1_1", PHY_vars_eNB1->lte_eNB_common_vars.txdataF[0][1],FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX,1,1);
|
||||
}
|
||||
|
||||
if (interf2>-20) {
|
||||
for (aa=0; aa<PHY_vars_eNb2->lte_frame_parms.nb_antennas_tx; aa++) {
|
||||
for (aa=0; aa<PHY_vars_eNB2->lte_frame_parms.nb_antennas_tx; aa++) {
|
||||
if (frame_parms->Ncp == 1)
|
||||
PHY_ofdm_mod(PHY_vars_eNb2->lte_eNB_common_vars.txdataF[0][aa], // input,
|
||||
PHY_vars_eNb2->lte_eNB_common_vars.txdata[0][aa], // output
|
||||
frame_parms->log2_symbol_size, // log2_fft_size
|
||||
PHY_ofdm_mod(PHY_vars_eNB2->lte_eNB_common_vars.txdataF[0][aa], // input,
|
||||
PHY_vars_eNB2->lte_eNB_common_vars.txdata[0][aa], // output
|
||||
frame_parms->ofdm_symbol_size,
|
||||
2*nsymb, // number of symbols
|
||||
frame_parms->nb_prefix_samples, // number of prefix samples
|
||||
CYCLIC_PREFIX);
|
||||
else {
|
||||
normal_prefix_mod(PHY_vars_eNb2->lte_eNB_common_vars.txdataF[0][aa],
|
||||
PHY_vars_eNb2->lte_eNB_common_vars.txdata[0][aa],
|
||||
normal_prefix_mod(PHY_vars_eNB2->lte_eNB_common_vars.txdataF[0][aa],
|
||||
PHY_vars_eNB2->lte_eNB_common_vars.txdata[0][aa],
|
||||
2*nsymb,
|
||||
frame_parms);
|
||||
}
|
||||
@@ -810,10 +756,10 @@ int main(int argc, char **argv)
|
||||
OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES);
|
||||
}
|
||||
|
||||
write_output("txsigF0_2.m","txsF0_2", PHY_vars_eNb2->lte_eNB_common_vars.txdataF[0][0],FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX,1,1);
|
||||
write_output("txsigF0_2.m","txsF0_2", PHY_vars_eNB2->lte_eNB_common_vars.txdataF[0][0],FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX,1,1);
|
||||
|
||||
if (PHY_vars_eNb2->lte_frame_parms.nb_antennas_tx>1)
|
||||
write_output("txsigF1_2.m","txsF1_2", PHY_vars_eNb2->lte_eNB_common_vars.txdataF[0][1],FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX,1,1);
|
||||
if (PHY_vars_eNB2->lte_frame_parms.nb_antennas_tx>1)
|
||||
write_output("txsigF1_2.m","txsF1_2", PHY_vars_eNB2->lte_eNB_common_vars.txdataF[0][1],FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX,1,1);
|
||||
}
|
||||
|
||||
// tx_lev_dB = (unsigned int) dB_fixed(tx_lev);
|
||||
@@ -823,15 +769,15 @@ int main(int argc, char **argv)
|
||||
if (frame_parms->nb_antennas_tx>1)
|
||||
write_output("txsig1.m","txs1", txdata[1],FRAME_LENGTH_COMPLEX_SAMPLES,1,1);
|
||||
|
||||
write_output("txsig0_1.m","txs0_1", PHY_vars_eNb1->lte_eNB_common_vars.txdata[0][0],FRAME_LENGTH_COMPLEX_SAMPLES,1,1);
|
||||
write_output("txsig0_1.m","txs0_1", PHY_vars_eNB1->lte_eNB_common_vars.txdata[0][0],FRAME_LENGTH_COMPLEX_SAMPLES,1,1);
|
||||
|
||||
if (frame_parms->nb_antennas_tx>1)
|
||||
write_output("txsig1_1.m","txs1_1", PHY_vars_eNb1->lte_eNB_common_vars.txdata[0][1],FRAME_LENGTH_COMPLEX_SAMPLES,1,1);
|
||||
write_output("txsig1_1.m","txs1_1", PHY_vars_eNB1->lte_eNB_common_vars.txdata[0][1],FRAME_LENGTH_COMPLEX_SAMPLES,1,1);
|
||||
|
||||
write_output("txsig0_2.m","txs0_2", PHY_vars_eNb2->lte_eNB_common_vars.txdata[0][0],FRAME_LENGTH_COMPLEX_SAMPLES,1,1);
|
||||
write_output("txsig0_2.m","txs0_2", PHY_vars_eNB2->lte_eNB_common_vars.txdata[0][0],FRAME_LENGTH_COMPLEX_SAMPLES,1,1);
|
||||
|
||||
if (frame_parms->nb_antennas_tx>1)
|
||||
write_output("txsig1_2.m","txs1_2", PHY_vars_eNb2->lte_eNB_common_vars.txdata[0][1],FRAME_LENGTH_COMPLEX_SAMPLES,1,1);
|
||||
write_output("txsig1_2.m","txs1_2", PHY_vars_eNB2->lte_eNB_common_vars.txdata[0][1],FRAME_LENGTH_COMPLEX_SAMPLES,1,1);
|
||||
} else { //read in from file
|
||||
i=0;
|
||||
|
||||
@@ -864,7 +810,7 @@ int main(int argc, char **argv)
|
||||
// multipath channel
|
||||
|
||||
for (i=0; i<2*nsymb*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES; i++) {
|
||||
for (aa=0; aa<PHY_vars_eNb->lte_frame_parms.nb_antennas_tx; aa++) {
|
||||
for (aa=0; aa<PHY_vars_eNB->lte_frame_parms.nb_antennas_tx; aa++) {
|
||||
s_re[aa][i] = ((double)(((short *)txdata[aa]))[(i<<1)]);
|
||||
s_im[aa][i] = ((double)(((short *)txdata[aa]))[(i<<1)+1]);
|
||||
|
||||
@@ -925,7 +871,7 @@ int main(int argc, char **argv)
|
||||
}
|
||||
}
|
||||
|
||||
sigma2_dB = 10*log10((double)tx_lev) +10*log10((double)PHY_vars_eNb->lte_frame_parms.ofdm_symbol_size/(double)(12*NB_RB)) - SNR;
|
||||
sigma2_dB = 10*log10((double)tx_lev) +10*log10((double)PHY_vars_eNB->lte_frame_parms.ofdm_symbol_size/(double)(12*NB_RB)) - SNR;
|
||||
|
||||
if (n_frames==1)
|
||||
printf("sigma2_dB %f (SNR %f dB) tx_lev_dB %f,%f,%f\n",sigma2_dB,SNR,
|
||||
@@ -947,7 +893,7 @@ int main(int argc, char **argv)
|
||||
for (n_trials=0; n_trials<ntrials; n_trials++) {
|
||||
//printf("n_trial %d\n",n_trials);
|
||||
for (i=0; i<2*nsymb*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES; i++) {
|
||||
for (aa=0; aa<PHY_vars_eNb->lte_frame_parms.nb_antennas_rx; aa++) {
|
||||
for (aa=0; aa<PHY_vars_eNB->lte_frame_parms.nb_antennas_rx; aa++) {
|
||||
if (n_trials==0) {
|
||||
r_re[aa][i] += (pow(10.0,.05*interf1)*r_re1[aa][i] + pow(10.0,.05*interf2)*r_re2[aa][i]);
|
||||
r_im[aa][i] += (pow(10.0,.05*interf1)*r_im1[aa][i] + pow(10.0,.05*interf2)*r_im2[aa][i]);
|
||||
@@ -983,14 +929,14 @@ int main(int argc, char **argv)
|
||||
*/
|
||||
|
||||
|
||||
for (l=0; l<PHY_vars_eNb->lte_frame_parms.symbols_per_tti; l++) {
|
||||
for (l=0; l<PHY_vars_eNB->lte_frame_parms.symbols_per_tti; l++) {
|
||||
|
||||
// subframe_offset = (l/PHY_vars_eNb->lte_frame_parms.symbols_per_tti)*PHY_vars_eNb->lte_frame_parms.samples_per_tti;
|
||||
// subframe_offset = (l/PHY_vars_eNB->lte_frame_parms.symbols_per_tti)*PHY_vars_eNB->lte_frame_parms.samples_per_tti;
|
||||
// printf("subframe_offset = %d\n",subframe_offset);
|
||||
|
||||
slot_fep(PHY_vars_UE,
|
||||
l%(PHY_vars_eNb->lte_frame_parms.symbols_per_tti/2),
|
||||
l/(PHY_vars_eNb->lte_frame_parms.symbols_per_tti/2),
|
||||
l%(PHY_vars_eNB->lte_frame_parms.symbols_per_tti/2),
|
||||
l/(PHY_vars_eNB->lte_frame_parms.symbols_per_tti/2),
|
||||
0,
|
||||
0,
|
||||
0);
|
||||
@@ -1026,7 +972,7 @@ int main(int argc, char **argv)
|
||||
*/
|
||||
}
|
||||
|
||||
if (l==((PHY_vars_eNb->lte_frame_parms.Ncp==0)?4:3)) {
|
||||
if (l==((PHY_vars_eNB->lte_frame_parms.Ncp==0)?4:3)) {
|
||||
//sprintf(fname,"dl_ch00_%d.m",l);
|
||||
//sprintf(vname,"dl_ch00_%d",l);
|
||||
//write_output(fname,vname,&(lte_ue_common_vars->dl_ch_estimates[0][lte_frame_parms->ofdm_symbol_size*(l%6)]),lte_frame_parms->ofdm_symbol_size,1,1);
|
||||
@@ -1038,7 +984,7 @@ int main(int argc, char **argv)
|
||||
1);
|
||||
}
|
||||
|
||||
if (l==((PHY_vars_eNb->lte_frame_parms.Ncp==0)?10:9)) {
|
||||
if (l==((PHY_vars_eNB->lte_frame_parms.Ncp==0)?10:9)) {
|
||||
|
||||
for (frame_mod4=0; frame_mod4<4; frame_mod4++) {
|
||||
pbch_tx_ant = rx_pbch(&PHY_vars_UE->lte_ue_common_vars,
|
||||
@@ -1059,7 +1005,7 @@ int main(int argc, char **argv)
|
||||
|
||||
pbch_tx_ant = rx_pbch(&PHY_vars_UE->lte_ue_common_vars,
|
||||
PHY_vars_UE->lte_ue_pbch_vars[0],
|
||||
&PHY_vars_eNb->lte_frame_parms,
|
||||
&PHY_vars_eNB->lte_frame_parms,
|
||||
0,
|
||||
ALAMOUTI,
|
||||
PHY_vars_UE->high_speed_flag,
|
||||
@@ -1119,10 +1065,10 @@ int main(int argc, char **argv)
|
||||
|
||||
if (n_frames==1) {
|
||||
|
||||
write_output("H00.m","h00",&(PHY_vars_UE->lte_ue_common_vars.dl_ch_estimates[0][0][0]),((frame_parms->Ncp==0)?7:6)*(PHY_vars_eNb->lte_frame_parms.ofdm_symbol_size),1,1);
|
||||
write_output("H00.m","h00",&(PHY_vars_UE->lte_ue_common_vars.dl_ch_estimates[0][0][0]),((frame_parms->Ncp==0)?7:6)*(PHY_vars_eNB->lte_frame_parms.ofdm_symbol_size),1,1);
|
||||
|
||||
if (n_tx==2)
|
||||
write_output("H10.m","h10",&(PHY_vars_UE->lte_ue_common_vars.dl_ch_estimates[0][2][0]),((frame_parms->Ncp==0)?7:6)*(PHY_vars_eNb->lte_frame_parms.ofdm_symbol_size),1,1);
|
||||
write_output("H10.m","h10",&(PHY_vars_UE->lte_ue_common_vars.dl_ch_estimates[0][2][0]),((frame_parms->Ncp==0)?7:6)*(PHY_vars_eNB->lte_frame_parms.ofdm_symbol_size),1,1);
|
||||
|
||||
write_output("rxsig0.m","rxs0", PHY_vars_UE->lte_ue_common_vars.rxdata[0],FRAME_LENGTH_COMPLEX_SAMPLES,1,1);
|
||||
write_output("rxsigF0.m","rxsF0", PHY_vars_UE->lte_ue_common_vars.rxdataF[0],NUMBER_OF_OFDM_CARRIERS*2*((frame_parms->Ncp==0)?14:12),2,1);
|
||||
|
||||
@@ -56,107 +56,15 @@ PHY_VARS_UE *PHY_vars_UE;
|
||||
|
||||
#define UL_RB_ALLOC 0x1ff;
|
||||
#define CCCH_RB_ALLOC computeRIV(PHY_vars_eNB->lte_frame_parms.N_RB_UL,0,2)
|
||||
#define DLSCH_RB_ALLOC 0x1fbf // igore DC component,RB13
|
||||
|
||||
void lte_param_init(unsigned char N_tx, unsigned char N_rx,unsigned char transmission_mode,unsigned char extended_prefix_flag,uint16_t Nid_cell,uint8_t tdd_config,uint8_t N_RB_DL,
|
||||
lte_frame_type_t frame_type,uint8_t osf,uint32_t perfect_ce)
|
||||
{
|
||||
|
||||
unsigned int i;
|
||||
LTE_DL_FRAME_PARMS *lte_frame_parms;
|
||||
|
||||
printf("Start lte_param_init (Nid_cell %d, extended_prefix %d, transmission_mode %d, N_tx %d, N_rx %d)\n",
|
||||
Nid_cell, extended_prefix_flag,transmission_mode,N_tx,N_rx);
|
||||
PHY_vars_eNB = malloc(sizeof(PHY_VARS_eNB));
|
||||
PHY_vars_eNB1 = malloc(sizeof(PHY_VARS_eNB));
|
||||
PHY_vars_eNB2 = malloc(sizeof(PHY_VARS_eNB));
|
||||
|
||||
PHY_vars_UE = malloc(sizeof(PHY_VARS_UE));
|
||||
//PHY_config = malloc(sizeof(PHY_CONFIG));
|
||||
mac_xface = malloc(sizeof(MAC_xface));
|
||||
|
||||
randominit(0);
|
||||
set_taus_seed(0);
|
||||
|
||||
lte_frame_parms = &(PHY_vars_eNB->lte_frame_parms);
|
||||
|
||||
lte_frame_parms->N_RB_DL = N_RB_DL; //50 for 10MHz and 25 for 5 MHz
|
||||
lte_frame_parms->N_RB_UL = N_RB_DL;
|
||||
lte_frame_parms->Ncp = extended_prefix_flag;
|
||||
lte_frame_parms->Nid_cell = Nid_cell;
|
||||
lte_frame_parms->nushift = Nid_cell%6;
|
||||
lte_frame_parms->nb_antenna_ports_eNB = N_tx;
|
||||
lte_frame_parms->nb_antennas_tx = N_tx;
|
||||
lte_frame_parms->nb_antennas_rx = N_rx;
|
||||
lte_frame_parms->phich_config_common.phich_resource = one; //half
|
||||
lte_frame_parms->tdd_config = tdd_config;
|
||||
lte_frame_parms->frame_type = frame_type;
|
||||
|
||||
// lte_frame_parms->Csrs = 2;
|
||||
// lte_frame_parms->Bsrs = 0;
|
||||
// lte_frame_parms->kTC = 0;
|
||||
// lte_frame_parms->n_RRC = 0;
|
||||
lte_frame_parms->mode1_flag = (transmission_mode == 1)? 1 : 0;
|
||||
|
||||
init_frame_parms(lte_frame_parms,osf);
|
||||
|
||||
//copy_lte_parms_to_phy_framing(lte_frame_parms, &(PHY_config->PHY_framing));
|
||||
|
||||
|
||||
memcpy(&PHY_vars_UE->lte_frame_parms,lte_frame_parms,sizeof(LTE_DL_FRAME_PARMS));
|
||||
|
||||
|
||||
phy_init_lte_top(lte_frame_parms);
|
||||
|
||||
phy_init_lte_ue(PHY_vars_UE,1,0);
|
||||
|
||||
phy_init_lte_eNB(PHY_vars_eNB,0,0,0);
|
||||
|
||||
memcpy((void*)&PHY_vars_eNB1->lte_frame_parms,(void*)&PHY_vars_eNB->lte_frame_parms,sizeof(LTE_DL_FRAME_PARMS));
|
||||
PHY_vars_eNB1->lte_frame_parms.nushift=(Nid_cell+1)%6;
|
||||
PHY_vars_eNB1->lte_frame_parms.Nid_cell=Nid_cell+1;
|
||||
|
||||
memcpy((void*)&PHY_vars_eNB2->lte_frame_parms,(void*)&PHY_vars_eNB->lte_frame_parms,sizeof(LTE_DL_FRAME_PARMS));
|
||||
PHY_vars_eNB2->lte_frame_parms.nushift=(Nid_cell+2)%6;
|
||||
PHY_vars_eNB2->lte_frame_parms.Nid_cell=Nid_cell+2;
|
||||
|
||||
phy_init_lte_eNB(PHY_vars_eNB1,0,0,0);
|
||||
|
||||
phy_init_lte_eNB(PHY_vars_eNB2,0,0,0);
|
||||
|
||||
phy_init_lte_top(lte_frame_parms);
|
||||
|
||||
PHY_vars_UE->PHY_measurements.n_adj_cells=2;
|
||||
PHY_vars_UE->PHY_measurements.adj_cell_id[0] = Nid_cell+1;
|
||||
PHY_vars_UE->PHY_measurements.adj_cell_id[1] = Nid_cell+2;
|
||||
PHY_vars_UE->perfect_ce = perfect_ce;
|
||||
|
||||
for (i=0; i<3; i++)
|
||||
lte_gold(lte_frame_parms,PHY_vars_UE->lte_gold_table[i],Nid_cell+i);
|
||||
|
||||
generate_pcfich_reg_mapping(&PHY_vars_UE->lte_frame_parms);
|
||||
generate_phich_reg_mapping(&PHY_vars_UE->lte_frame_parms);
|
||||
|
||||
printf("Done lte_param_init\n");
|
||||
|
||||
CCCH_alloc_pdu.type = 1;
|
||||
CCCH_alloc_pdu.vrb_type = 0;
|
||||
CCCH_alloc_pdu.rballoc = CCCH_RB_ALLOC;
|
||||
CCCH_alloc_pdu.ndi = 1;
|
||||
CCCH_alloc_pdu.mcs = 1;
|
||||
CCCH_alloc_pdu.harq_pid = 0;
|
||||
|
||||
}
|
||||
|
||||
|
||||
#define DLSCH_RB_ALLOC ((uint16_t)0x1fbf) // igore DC component,RB13
|
||||
|
||||
DCI_PDU DCI_pdu;
|
||||
|
||||
DCI_PDU *get_dci(LTE_DL_FRAME_PARMS *lte_frame_parms,uint8_t log2L, uint8_t log2Lcommon, uint8_t format_selector, uint32_t rnti)
|
||||
{
|
||||
uint8_t BCCH_alloc_pdu[8];
|
||||
uint8_t DLSCH_alloc_pdu[8];
|
||||
uint8_t UL_alloc_pdu[8];
|
||||
uint32_t BCCH_alloc_pdu[2];
|
||||
uint32_t DLSCH_alloc_pdu[2];
|
||||
uint32_t UL_alloc_pdu[2];
|
||||
|
||||
int i;
|
||||
int dci_length_bytes,dci_length;
|
||||
@@ -462,31 +370,35 @@ DCI_PDU *get_dci(LTE_DL_FRAME_PARMS *lte_frame_parms,uint8_t log2L, uint8_t log2
|
||||
DCI_pdu.dci_alloc[0].ra_flag = 0;
|
||||
memcpy((void*)&DCI_pdu.dci_alloc[0].dci_pdu[0], &BCCH_alloc_pdu[0], BCCH_pdu_size_bytes);
|
||||
DCI_pdu.Num_common_dci++;
|
||||
/*
|
||||
if (lte_frame_parms->N_RB_DL >= 25) {
|
||||
// add ue specific dci
|
||||
DCI_pdu.dci_alloc[1].dci_length = dci_length;
|
||||
DCI_pdu.dci_alloc[1].L = log2L;
|
||||
DCI_pdu.dci_alloc[1].rnti = rnti;
|
||||
DCI_pdu.dci_alloc[1].format = format1;
|
||||
DCI_pdu.dci_alloc[1].ra_flag = 0;
|
||||
memcpy((void*)&DCI_pdu.dci_alloc[1].dci_pdu[0], &DLSCH_alloc_pdu[0], dci_length_bytes);
|
||||
DCI_pdu.Num_ue_spec_dci++;
|
||||
DCI_pdu.dci_alloc[1].dci_length = dci_length;
|
||||
DCI_pdu.dci_alloc[1].L = log2L;
|
||||
DCI_pdu.dci_alloc[1].rnti = rnti;
|
||||
DCI_pdu.dci_alloc[1].format = format1;
|
||||
DCI_pdu.dci_alloc[1].ra_flag = 0;
|
||||
memcpy((void*)&DCI_pdu.dci_alloc[1].dci_pdu[0], &DLSCH_alloc_pdu[0], dci_length_bytes);
|
||||
DCI_pdu.Num_ue_spec_dci++;
|
||||
|
||||
if (lte_frame_parms->N_RB_DL >= 50) {
|
||||
DCI_pdu.dci_alloc[2].dci_length = UL_pdu_size_bits;
|
||||
DCI_pdu.dci_alloc[2].L = log2L;
|
||||
DCI_pdu.dci_alloc[2].rnti = rnti;
|
||||
DCI_pdu.dci_alloc[2].format = format0;
|
||||
DCI_pdu.dci_alloc[2].ra_flag = 0;
|
||||
memcpy((void*)&DCI_pdu.dci_alloc[0].dci_pdu[0], &UL_alloc_pdu[0], UL_pdu_size_bytes);
|
||||
DCI_pdu.Num_ue_spec_dci++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
DCI_pdu.dci_alloc[0].dci_length = UL_pdu_size_bits;
|
||||
DCI_pdu.dci_alloc[0].L = log2L;
|
||||
DCI_pdu.dci_alloc[0].rnti = rnti;
|
||||
DCI_pdu.dci_alloc[0].format = format0;
|
||||
DCI_pdu.dci_alloc[0].ra_flag = 0;
|
||||
memcpy((void*)&DCI_pdu.dci_alloc[0].dci_pdu[0], &UL_alloc_pdu[0], UL_pdu_size_bytes);
|
||||
DCI_pdu.Num_ue_spec_dci++;
|
||||
*/
|
||||
DCI_pdu.nCCE = 0;
|
||||
|
||||
for (i=0; i<DCI_pdu.Num_common_dci+DCI_pdu.Num_ue_spec_dci; i++) {
|
||||
DCI_pdu.nCCE += (1<<(DCI_pdu.dci_alloc[i].L));
|
||||
}
|
||||
|
||||
|
||||
return(&DCI_pdu);
|
||||
}
|
||||
|
||||
@@ -523,10 +435,8 @@ int main(int argc, char **argv)
|
||||
uint8_t dci_cnt=0;
|
||||
LTE_DL_FRAME_PARMS *frame_parms;
|
||||
uint8_t log2L=2, log2Lcommon=2, format_selector=0;
|
||||
uint8_t numCCE,nCCE_max,common_active=0,ul_active=0,dl_active=0;
|
||||
uint32_t rv;
|
||||
uint8_t numCCE,common_active=0,ul_active=0,dl_active=0;
|
||||
|
||||
DCI_format_t format = format1;
|
||||
uint32_t n_trials_common=0,n_trials_ul=0,n_trials_dl=0,false_detection_cnt=0;
|
||||
uint8_t common_rx,ul_rx,dl_rx;
|
||||
uint8_t tdd_config=3;
|
||||
@@ -540,20 +450,19 @@ int main(int argc, char **argv)
|
||||
|
||||
DCI_ALLOC_t dci_alloc_rx[8];
|
||||
|
||||
void* dlsch_pdu = NULL;
|
||||
// int ret;
|
||||
int ret;
|
||||
|
||||
uint8_t harq_pid;
|
||||
uint8_t phich_ACK;
|
||||
|
||||
uint8_t num_phich_interf = 0;
|
||||
lte_frame_type_t frame_type=TDD;
|
||||
int re_offset;
|
||||
uint32_t *txptr;
|
||||
// int re_offset;
|
||||
// uint32_t *txptr;
|
||||
int aarx;
|
||||
int k;
|
||||
double BW=5.0;
|
||||
uint32_t perfect_ce = 0;
|
||||
int CCE_table[800];
|
||||
|
||||
number_of_cards = 1;
|
||||
openair_daq_vars.rx_rf_mode = 1;
|
||||
@@ -799,9 +708,10 @@ int main(int argc, char **argv)
|
||||
n_rx,
|
||||
transmission_mode,
|
||||
extended_prefix_flag,
|
||||
frame_type,
|
||||
Nid_cell,
|
||||
tdd_config,
|
||||
N_RB_DL,frame_type,
|
||||
N_RB_DL,
|
||||
osf,
|
||||
perfect_ce);
|
||||
|
||||
@@ -840,6 +750,7 @@ int main(int argc, char **argv)
|
||||
subframe,NUMBER_OF_OFDM_CARRIERS,
|
||||
PHY_vars_eNB->lte_frame_parms.Ncp,PHY_vars_eNB->lte_frame_parms.samples_per_tti,nsymb);
|
||||
|
||||
<<<<<<< HEAD
|
||||
switch (N_RB_DL) {
|
||||
case 6:
|
||||
BW = 1.25;
|
||||
@@ -861,7 +772,8 @@ int main(int argc, char **argv)
|
||||
eNB2UE = new_channel_desc_scm(PHY_vars_eNB->lte_frame_parms.nb_antenna_ports_eNB,
|
||||
PHY_vars_UE->lte_frame_parms.nb_antennas_rx,
|
||||
channel_model,
|
||||
BW,
|
||||
N_RB2sampling_rate(PHY_vars_eNB->lte_frame_parms.N_RB_DL),
|
||||
N_RB2channel_bandwidth(PHY_vars_eNB->lte_frame_parms.N_RB_DL),
|
||||
0,
|
||||
0,
|
||||
0);
|
||||
@@ -894,7 +806,7 @@ int main(int argc, char **argv)
|
||||
i=0;
|
||||
|
||||
while (!feof(input_fd)) {
|
||||
fscanf(input_fd,"%s %s",input_val_str,input_val_str2);//&input_val1,&input_val2);
|
||||
ret=fscanf(input_fd,"%s %s",input_val_str,input_val_str2);//&input_val1,&input_val2);
|
||||
|
||||
if ((i%4)==0) {
|
||||
((short*)txdata[0])[i/2] = (short)((1<<15)*strtod(input_val_str,NULL));
|
||||
@@ -921,7 +833,7 @@ int main(int argc, char **argv)
|
||||
|
||||
PHY_vars_UE->UE_mode[0] = PUSCH;
|
||||
|
||||
nCCE_max = get_nCCE(3,&PHY_vars_eNB->lte_frame_parms,get_mi(&PHY_vars_eNB->lte_frame_parms,0));
|
||||
// nCCE_max = get_nCCE(3,&PHY_vars_eNB->lte_frame_parms,get_mi(&PHY_vars_eNB->lte_frame_parms,0));
|
||||
//printf("nCCE_max %d\n",nCCE_max);
|
||||
|
||||
//printf("num_phich interferers %d\n",num_phich_interf);
|
||||
@@ -973,55 +885,62 @@ int main(int argc, char **argv)
|
||||
numCCE=0;
|
||||
n_trials_common++;
|
||||
common_active = 1;
|
||||
n_trials_ul++;
|
||||
ul_active = 1;
|
||||
n_trials_dl++;
|
||||
dl_active = 1;
|
||||
if (PHY_vars_eNB->lte_frame_parms.N_RB_DL >= 50) {
|
||||
n_trials_ul++;
|
||||
ul_active = 1;
|
||||
}
|
||||
if (PHY_vars_eNB->lte_frame_parms.N_RB_DL >= 25) {
|
||||
n_trials_dl++;
|
||||
dl_active = 1;
|
||||
}
|
||||
|
||||
init_nCCE_table();
|
||||
num_pdcch_symbols = get_num_pdcch_symbols(DCI_pdu.Num_common_dci+DCI_pdu.Num_ue_spec_dci,
|
||||
DCI_pdu.dci_alloc, frame_parms, subframe);
|
||||
DCI_pdu.nCCE = get_nCCE(num_pdcch_symbols,&PHY_vars_eNB->lte_frame_parms,get_mi(&PHY_vars_eNB->lte_frame_parms,subframe));
|
||||
numCCE = get_nCCE(num_pdcch_symbols,&PHY_vars_eNB->lte_frame_parms,get_mi(&PHY_vars_eNB->lte_frame_parms,subframe));
|
||||
|
||||
if (n_frames==1) {
|
||||
printf("num_dci %d, num_pddch_symbols %d, nCCE %d\n",
|
||||
DCI_pdu.Num_common_dci+DCI_pdu.Num_ue_spec_dci,
|
||||
num_pdcch_symbols,
|
||||
DCI_pdu.nCCE);
|
||||
num_pdcch_symbols,numCCE);
|
||||
}
|
||||
|
||||
// apply RNTI-based nCCE allocation
|
||||
memset(CCE_table,0,800*sizeof(int));
|
||||
|
||||
for (i = 0; i < DCI_pdu.Num_common_dci + DCI_pdu.Num_ue_spec_dci; i++) {
|
||||
// SI RNTI
|
||||
if (DCI_pdu.dci_alloc[i].rnti == SI_RNTI) {
|
||||
DCI_pdu.dci_alloc[i].nCCE = get_nCCE_offset(1<<DCI_pdu.dci_alloc[i].L,
|
||||
DCI_pdu.nCCE,
|
||||
1,
|
||||
SI_RNTI,
|
||||
subframe);
|
||||
DCI_pdu.dci_alloc[i].firstCCE = get_nCCE_offset_l1(CCE_table,
|
||||
1<<DCI_pdu.dci_alloc[i].L,
|
||||
numCCE,
|
||||
1,
|
||||
SI_RNTI,
|
||||
subframe);
|
||||
}
|
||||
// RA RNTI
|
||||
else if (DCI_pdu.dci_alloc[i].ra_flag == 1) {
|
||||
DCI_pdu.dci_alloc[i].nCCE = get_nCCE_offset(1<<DCI_pdu.dci_alloc[i].L,
|
||||
DCI_pdu.nCCE,
|
||||
1,
|
||||
DCI_pdu.dci_alloc[i].rnti,
|
||||
subframe);
|
||||
DCI_pdu.dci_alloc[i].firstCCE = get_nCCE_offset_l1(CCE_table,
|
||||
1<<DCI_pdu.dci_alloc[i].L,
|
||||
numCCE,
|
||||
1,
|
||||
DCI_pdu.dci_alloc[i].rnti,
|
||||
subframe);
|
||||
}
|
||||
// C RNTI
|
||||
else {
|
||||
DCI_pdu.dci_alloc[i].nCCE = get_nCCE_offset(1<<DCI_pdu.dci_alloc[i].L,
|
||||
DCI_pdu.nCCE,
|
||||
0,
|
||||
DCI_pdu.dci_alloc[i].rnti,
|
||||
subframe);
|
||||
DCI_pdu.dci_alloc[i].firstCCE = get_nCCE_offset_l1(CCE_table,
|
||||
1<<DCI_pdu.dci_alloc[i].L,
|
||||
numCCE,
|
||||
0,
|
||||
DCI_pdu.dci_alloc[i].rnti,
|
||||
subframe);
|
||||
}
|
||||
|
||||
if (n_frames==1)
|
||||
printf("dci %d: rnti 0x%x, format %d, L %d, nCCE %d/%d dci_length %d\n",i,DCI_pdu.dci_alloc[i].rnti, DCI_pdu.dci_alloc[i].format,
|
||||
DCI_pdu.dci_alloc[i].L, DCI_pdu.dci_alloc[i].nCCE, DCI_pdu.nCCE, DCI_pdu.dci_alloc[i].dci_length);
|
||||
DCI_pdu.dci_alloc[i].L, DCI_pdu.dci_alloc[i].firstCCE, numCCE, DCI_pdu.dci_alloc[i].dci_length);
|
||||
|
||||
if (DCI_pdu.dci_alloc[i].nCCE==-1)
|
||||
if (DCI_pdu.dci_alloc[i].firstCCE==-1)
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
@@ -1055,7 +974,7 @@ int main(int argc, char **argv)
|
||||
|
||||
generate_phich_top(PHY_vars_eNB,
|
||||
subframe,AMP,0,0);
|
||||
/*
|
||||
|
||||
// generate 3 interfering PHICH
|
||||
if (num_phich_interf>0) {
|
||||
PHY_vars_eNB->ulsch_eNB[0]->harq_processes[harq_pid]->first_rb = 4;
|
||||
@@ -1082,7 +1001,7 @@ int main(int argc, char **argv)
|
||||
}
|
||||
|
||||
PHY_vars_eNB->ulsch_eNB[0]->harq_processes[harq_pid]->first_rb = 0;
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
// write_output("pilotsF.m","rsF",txdataF[0],lte_PHY_vars_eNB->lte_frame_parms.ofdm_symbol_size,1,1);
|
||||
@@ -1102,7 +1021,7 @@ int main(int argc, char **argv)
|
||||
if (PHY_vars_eNB->lte_frame_parms.Ncp == 1)
|
||||
PHY_ofdm_mod(&PHY_vars_eNB->lte_eNB_common_vars.txdataF[eNb_id][aa][subframe*nsymb*PHY_vars_eNB->lte_frame_parms.ofdm_symbol_size], // input,
|
||||
&txdata[aa][subframe*PHY_vars_eNB->lte_frame_parms.samples_per_tti], // output
|
||||
PHY_vars_eNB->lte_frame_parms.log2_symbol_size, // log2_fft_size
|
||||
PHY_vars_eNB->lte_frame_parms.ofdm_symbol_size,
|
||||
2*nsymb, // number of symbols
|
||||
PHY_vars_eNB->lte_frame_parms.nb_prefix_samples, // number of prefix samples
|
||||
CYCLIC_PREFIX);
|
||||
@@ -1262,7 +1181,7 @@ int main(int argc, char **argv)
|
||||
|
||||
for (i = 0; i < dci_cnt; i++)
|
||||
printf("dci %d: rnti 0x%x, format %d, L %d, nCCE %d/%d dci_length %d\n",i, dci_alloc_rx[i].rnti, dci_alloc_rx[i].format,
|
||||
dci_alloc_rx[i].L, dci_alloc_rx[i].nCCE, numCCE, dci_alloc_rx[i].dci_length);
|
||||
dci_alloc_rx[i].L, dci_alloc_rx[i].firstCCE, numCCE, dci_alloc_rx[i].dci_length);
|
||||
}
|
||||
|
||||
for (i=0; i<dci_cnt; i++) {
|
||||
@@ -1337,8 +1256,8 @@ int main(int argc, char **argv)
|
||||
} //trials
|
||||
|
||||
printf("SNR %f : n_errors_common = %d/%d (%e)\n", SNR,n_errors_common,n_trials_common,(double)n_errors_common/n_trials_common);
|
||||
printf("SNR %f : n_errors_ul = %d/%d (%e)\n", SNR,n_errors_ul,n_trials_ul,(double)n_errors_ul/n_trials_ul);
|
||||
printf("SNR %f : n_errors_dl = %d/%d (%e)\n", SNR,n_errors_dl,n_trials_dl,(double)n_errors_dl/n_trials_dl);
|
||||
if (ul_active==1) printf("SNR %f : n_errors_ul = %d/%d (%e)\n", SNR,n_errors_ul,n_trials_ul,(double)n_errors_ul/n_trials_ul);
|
||||
if (dl_active==1) printf("SNR %f : n_errors_dl = %d/%d (%e)\n", SNR,n_errors_dl,n_trials_dl,(double)n_errors_dl/n_trials_dl);
|
||||
printf("SNR %f : n_errors_cfi = %d/%d (%e)\n", SNR,n_errors_cfi,trial,(double)n_errors_cfi/trial);
|
||||
printf("SNR %f : n_errors_hi = %d/%d (%e)\n", SNR,n_errors_hi,trial,(double)n_errors_hi/trial);
|
||||
|
||||
|
||||
@@ -47,8 +47,6 @@
|
||||
|
||||
#include "OCG_vars.h"
|
||||
|
||||
#define BW 5.0
|
||||
|
||||
int current_dlsch_cqi; //FIXME!
|
||||
|
||||
PHY_VARS_eNB *PHY_vars_eNB;
|
||||
@@ -58,58 +56,6 @@ PHY_VARS_UE *PHY_vars_UE;
|
||||
|
||||
|
||||
|
||||
void lte_param_init(unsigned char N_tx, unsigned char N_rx,unsigned char transmission_mode,unsigned char extended_prefix_flag,uint16_t Nid_cell,uint8_t N_RB_DL,uint8_t osf)
|
||||
{
|
||||
|
||||
LTE_DL_FRAME_PARMS *lte_frame_parms;
|
||||
|
||||
printf("Start lte_param_init\n");
|
||||
PHY_vars_eNB = malloc(sizeof(PHY_VARS_eNB));
|
||||
|
||||
PHY_vars_UE = malloc(sizeof(PHY_VARS_UE));
|
||||
//PHY_config = malloc(sizeof(PHY_CONFIG));
|
||||
mac_xface = malloc(sizeof(MAC_xface));
|
||||
|
||||
randominit(0);
|
||||
set_taus_seed(0);
|
||||
|
||||
lte_frame_parms = &(PHY_vars_eNB->lte_frame_parms);
|
||||
|
||||
lte_frame_parms->N_RB_DL = N_RB_DL; //50 for 10MHz and 25 for 5 MHz
|
||||
lte_frame_parms->N_RB_UL = N_RB_DL;
|
||||
lte_frame_parms->Ncp = extended_prefix_flag;
|
||||
lte_frame_parms->Nid_cell = Nid_cell;
|
||||
lte_frame_parms->nushift = 0;
|
||||
lte_frame_parms->nb_antennas_tx = N_tx;
|
||||
lte_frame_parms->nb_antennas_rx = N_rx;
|
||||
// lte_frame_parms->Csrs = 2;
|
||||
// lte_frame_parms->Bsrs = 0;
|
||||
// lte_frame_parms->kTC = 0;
|
||||
// lte_frame_parms->n_RRC = 0;
|
||||
lte_frame_parms->mode1_flag = (transmission_mode == 1)? 1 : 0;
|
||||
lte_frame_parms->tdd_config = 1;
|
||||
lte_frame_parms->frame_type = 1;
|
||||
init_frame_parms(lte_frame_parms,osf);
|
||||
|
||||
//copy_lte_parms_to_phy_framing(lte_frame_parms, &(PHY_config->PHY_framing));
|
||||
|
||||
|
||||
PHY_vars_UE->lte_frame_parms = *lte_frame_parms;
|
||||
|
||||
phy_init_lte_top(lte_frame_parms);
|
||||
|
||||
phy_init_lte_ue(PHY_vars_UE,1,0);
|
||||
|
||||
phy_init_lte_eNB(PHY_vars_eNB,0,0,0);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
printf("Done lte_param_init\n");
|
||||
|
||||
}
|
||||
|
||||
extern uint16_t prach_root_sequence_map0_3[838];
|
||||
|
||||
int main(int argc, char **argv)
|
||||
@@ -372,7 +318,16 @@ int main(int argc, char **argv)
|
||||
if (transmission_mode==2)
|
||||
n_tx=2;
|
||||
|
||||
lte_param_init(n_tx,n_rx,transmission_mode,extended_prefix_flag,Nid_cell,N_RB_DL,osf);
|
||||
lte_param_init(n_tx,
|
||||
n_rx,
|
||||
transmission_mode,
|
||||
extended_prefix_flag,
|
||||
FDD,
|
||||
Nid_cell,
|
||||
3,
|
||||
N_RB_DL,
|
||||
osf,
|
||||
0);
|
||||
|
||||
|
||||
if (snr1set==0) {
|
||||
@@ -412,7 +367,8 @@ int main(int argc, char **argv)
|
||||
UE2eNB = new_channel_desc_scm(PHY_vars_UE->lte_frame_parms.nb_antennas_tx,
|
||||
PHY_vars_eNB->lte_frame_parms.nb_antennas_rx,
|
||||
channel_model,
|
||||
BW,
|
||||
N_RB2sampling_rate(PHY_vars_eNB->lte_frame_parms.N_RB_UL),
|
||||
N_RB2channel_bandwidth(PHY_vars_eNB->lte_frame_parms.N_RB_UL),
|
||||
0.0,
|
||||
delay,
|
||||
0);
|
||||
|
||||
@@ -49,8 +49,6 @@
|
||||
#include "OCG_vars.h"
|
||||
#include "UTIL/LOG/log_extern.h"
|
||||
|
||||
#define BW 5.0
|
||||
|
||||
int current_dlsch_cqi; //FIXME!
|
||||
|
||||
PHY_VARS_eNB *PHY_vars_eNB;
|
||||
@@ -60,60 +58,6 @@ PHY_VARS_UE *PHY_vars_UE;
|
||||
|
||||
|
||||
|
||||
void lte_param_init(unsigned char N_tx, unsigned char N_rx,unsigned char transmission_mode,unsigned char extended_prefix_flag,uint16_t Nid_cell,uint8_t N_RB_DL,uint8_t osf)
|
||||
{
|
||||
|
||||
LTE_DL_FRAME_PARMS *lte_frame_parms;
|
||||
|
||||
printf("Start lte_param_init\n");
|
||||
PHY_vars_eNB = malloc(sizeof(PHY_VARS_eNB));
|
||||
|
||||
PHY_vars_UE = malloc(sizeof(PHY_VARS_UE));
|
||||
//PHY_config = malloc(sizeof(PHY_CONFIG));
|
||||
mac_xface = malloc(sizeof(MAC_xface));
|
||||
|
||||
randominit(0);
|
||||
set_taus_seed(0);
|
||||
|
||||
lte_frame_parms = &(PHY_vars_eNB->lte_frame_parms);
|
||||
|
||||
lte_frame_parms->N_RB_DL = N_RB_DL; //50 for 10MHz and 25 for 5 MHz
|
||||
lte_frame_parms->N_RB_UL = N_RB_DL;
|
||||
lte_frame_parms->Ncp = extended_prefix_flag;
|
||||
lte_frame_parms->Nid_cell = Nid_cell;
|
||||
lte_frame_parms->nushift = 0;
|
||||
lte_frame_parms->nb_antennas_tx = N_tx;
|
||||
lte_frame_parms->nb_antennas_rx = N_rx;
|
||||
// lte_frame_parms->Csrs = 2;
|
||||
// lte_frame_parms->Bsrs = 0;
|
||||
// lte_frame_parms->kTC = 0;
|
||||
// lte_frame_parms->n_RRC = 0;
|
||||
lte_frame_parms->mode1_flag = (transmission_mode == 1)? 1 : 0;
|
||||
lte_frame_parms->tdd_config = 3;
|
||||
lte_frame_parms->frame_type = 0;
|
||||
init_frame_parms(lte_frame_parms,osf);
|
||||
|
||||
//copy_lte_parms_to_phy_framing(lte_frame_parms, &(PHY_config->PHY_framing));
|
||||
|
||||
// phy_init_top(lte_frame_parms); //allocation
|
||||
|
||||
PHY_vars_UE->lte_frame_parms = *lte_frame_parms;
|
||||
|
||||
|
||||
phy_init_lte_ue(PHY_vars_UE,1,0);
|
||||
|
||||
phy_init_lte_eNB(PHY_vars_eNB,0,0,0);
|
||||
|
||||
phy_init_lte_top(lte_frame_parms);
|
||||
|
||||
|
||||
|
||||
|
||||
printf("Done lte_param_init\n");
|
||||
|
||||
}
|
||||
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
|
||||
@@ -248,7 +192,7 @@ int main(int argc, char **argv)
|
||||
break;
|
||||
|
||||
default:
|
||||
msg("Unsupported channel model!\n");
|
||||
printf("Unsupported channel model!\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
@@ -260,13 +204,13 @@ int main(int argc, char **argv)
|
||||
|
||||
case 's':
|
||||
snr0 = atof(optarg);
|
||||
msg("Setting SNR0 to %f\n",snr0);
|
||||
printf("Setting SNR0 to %f\n",snr0);
|
||||
break;
|
||||
|
||||
case 'S':
|
||||
snr1 = atof(optarg);
|
||||
snr1set=1;
|
||||
msg("Setting SNR1 to %f\n",snr1);
|
||||
printf("Setting SNR1 to %f\n",snr1);
|
||||
break;
|
||||
|
||||
case 'p':
|
||||
@@ -289,7 +233,7 @@ int main(int argc, char **argv)
|
||||
if ((transmission_mode!=1) &&
|
||||
(transmission_mode!=2) &&
|
||||
(transmission_mode!=6)) {
|
||||
msg("Unsupported transmission mode %d\n",transmission_mode);
|
||||
printf("Unsupported transmission mode %d\n",transmission_mode);
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
@@ -299,7 +243,7 @@ int main(int argc, char **argv)
|
||||
n_tx=atoi(optarg);
|
||||
|
||||
if ((n_tx==0) || (n_tx>2)) {
|
||||
msg("Unsupported number of tx antennas %d\n",n_tx);
|
||||
printf("Unsupported number of tx antennas %d\n",n_tx);
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
@@ -309,7 +253,7 @@ int main(int argc, char **argv)
|
||||
n_rx=atoi(optarg);
|
||||
|
||||
if ((n_rx==0) || (n_rx>2)) {
|
||||
msg("Unsupported number of rx antennas %d\n",n_rx);
|
||||
printf("Unsupported number of rx antennas %d\n",n_rx);
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
@@ -370,7 +314,16 @@ int main(int argc, char **argv)
|
||||
if (transmission_mode==2)
|
||||
n_tx=2;
|
||||
|
||||
lte_param_init(n_tx,n_rx,transmission_mode,extended_prefix_flag,Nid_cell,N_RB_DL,osf);
|
||||
lte_param_init(n_tx,
|
||||
n_rx,
|
||||
transmission_mode,
|
||||
extended_prefix_flag,
|
||||
Nid_cell,
|
||||
FDD,
|
||||
3,
|
||||
N_RB_DL,
|
||||
osf,
|
||||
0);
|
||||
|
||||
|
||||
if (snr1set==0) {
|
||||
@@ -414,18 +367,19 @@ int main(int argc, char **argv)
|
||||
|
||||
|
||||
|
||||
msg("[SIM] Using SCM/101\n");
|
||||
printf("[SIM] Using SCM/101\n");
|
||||
UE2eNB = new_channel_desc_scm(PHY_vars_eNB->lte_frame_parms.nb_antennas_tx,
|
||||
PHY_vars_UE->lte_frame_parms.nb_antennas_rx,
|
||||
channel_model,
|
||||
BW,
|
||||
N_RB2sampling_rate(PHY_vars_eNB->lte_frame_parms.N_RB_UL),
|
||||
N_RB2channel_bandwidth(PHY_vars_eNB->lte_frame_parms.N_RB_UL),
|
||||
0.0,
|
||||
0,
|
||||
0);
|
||||
|
||||
|
||||
if (UE2eNB==NULL) {
|
||||
msg("Problem generating channel model. Exiting.\n");
|
||||
printf("Problem generating channel model. Exiting.\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
@@ -453,7 +407,7 @@ int main(int argc, char **argv)
|
||||
PHY_vars_UE->lte_frame_parms.pucch_config_common.nRB_CQI = 0;
|
||||
PHY_vars_UE->lte_frame_parms.pucch_config_common.nCS_AN = 0;
|
||||
|
||||
pucch_payload = 1;
|
||||
pucch_payload = 0;
|
||||
|
||||
generate_pucch(PHY_vars_UE->lte_ue_common_vars.txdataF,
|
||||
frame_parms,
|
||||
@@ -474,7 +428,7 @@ int main(int argc, char **argv)
|
||||
if (frame_parms->Ncp == 1)
|
||||
PHY_ofdm_mod(txdataF2[aa], // input
|
||||
txdata[aa], // output
|
||||
frame_parms->log2_symbol_size, // log2_fft_size
|
||||
frame_parms->ofdm_symbol_size,
|
||||
2*nsymb, // number of symbols
|
||||
frame_parms->nb_prefix_samples, // number of prefix samples
|
||||
CYCLIC_PREFIX);
|
||||
@@ -497,7 +451,7 @@ int main(int argc, char **argv)
|
||||
if (frame_parms->Ncp == 1)
|
||||
PHY_ofdm_mod(&PHY_vars_UE->lte_ue_common_vars.txdataF[aa][2*subframe*nsymb*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES_NO_PREFIX], // input,
|
||||
&txdata[aa][PHY_vars_eNB->lte_frame_parms.samples_per_tti*subframe], // output
|
||||
frame_parms->log2_symbol_size, // log2_fft_size
|
||||
frame_parms->ofdm_symbol_size,
|
||||
nsymb, // number of symbols
|
||||
frame_parms->nb_prefix_samples, // number of prefix samples
|
||||
CYCLIC_PREFIX);
|
||||
@@ -596,9 +550,7 @@ int main(int argc, char **argv)
|
||||
}
|
||||
}
|
||||
|
||||
lte_eNB_I0_measurements(PHY_vars_eNB,
|
||||
0,
|
||||
1);
|
||||
|
||||
|
||||
for (i=0; i<2*nsymb*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES; i++) {
|
||||
for (aa=0; aa<PHY_vars_eNB->lte_frame_parms.nb_antennas_rx; aa++) {
|
||||
@@ -646,6 +598,10 @@ int main(int argc, char **argv)
|
||||
|
||||
// if (sig == 1)
|
||||
// printf("*");
|
||||
lte_eNB_I0_measurements(PHY_vars_eNB,
|
||||
subframe,
|
||||
0,
|
||||
1);
|
||||
PHY_vars_eNB->PHY_measurements_eNB[0].n0_power_tot_dB = N0;//(int8_t)(sigma2_dB-10*log10(PHY_vars_eNB->lte_frame_parms.ofdm_symbol_size/(12*NB_RB)));
|
||||
stat = rx_pucch(PHY_vars_eNB,
|
||||
pucch_format,
|
||||
|
||||
@@ -56,94 +56,11 @@
|
||||
#define BW 20.0
|
||||
|
||||
|
||||
PHY_VARS_eNB *PHY_vars_eNb,*PHY_vars_eNb1,*PHY_vars_eNb2;
|
||||
PHY_VARS_eNB *PHY_vars_eNB,*PHY_vars_eNB1,*PHY_vars_eNB2;
|
||||
PHY_VARS_UE *PHY_vars_UE;
|
||||
|
||||
#define DLSCH_RB_ALLOC 0x1fbf // igore DC component,RB13
|
||||
|
||||
void lte_param_init(unsigned char N_tx, unsigned char N_rx,unsigned char transmission_mode,unsigned char extended_prefix_flag,unsigned char frame_type, uint16_t Nid_cell,uint8_t N_RB_DL,uint8_t osf)
|
||||
{
|
||||
|
||||
// unsigned int ind;
|
||||
LTE_DL_FRAME_PARMS *lte_frame_parms;
|
||||
int i;
|
||||
|
||||
printf("Start lte_param_init\n");
|
||||
PHY_vars_eNb = malloc(sizeof(PHY_VARS_eNB));
|
||||
PHY_vars_eNb1 = malloc(sizeof(PHY_VARS_eNB));
|
||||
PHY_vars_eNb2 = malloc(sizeof(PHY_VARS_eNB));
|
||||
|
||||
PHY_vars_UE = malloc(sizeof(PHY_VARS_UE));
|
||||
//PHY_config = malloc(sizeof(PHY_CONFIG));
|
||||
mac_xface = malloc(sizeof(MAC_xface));
|
||||
|
||||
randominit(0);
|
||||
set_taus_seed(0);
|
||||
|
||||
lte_frame_parms = &(PHY_vars_eNb->lte_frame_parms);
|
||||
|
||||
lte_frame_parms->N_RB_DL = N_RB_DL; //50 for 10MHz and 25 for 5 MHz
|
||||
lte_frame_parms->N_RB_UL = N_RB_DL;
|
||||
lte_frame_parms->Ncp = extended_prefix_flag;
|
||||
lte_frame_parms->Nid_cell = Nid_cell;
|
||||
lte_frame_parms->nushift = Nid_cell%6;
|
||||
lte_frame_parms->nb_antennas_tx = N_tx;
|
||||
lte_frame_parms->nb_antenna_ports_eNB = N_tx;
|
||||
lte_frame_parms->nb_antennas_rx = N_rx;
|
||||
// lte_frame_parms->Csrs = 2;
|
||||
// lte_frame_parms->Bsrs = 0;
|
||||
// lte_frame_parms->kTC = 0;
|
||||
// lte_frame_parms->n_RRC = 0;
|
||||
lte_frame_parms->mode1_flag = (transmission_mode == 1)? 1 : 0;
|
||||
lte_frame_parms->tdd_config = 3;
|
||||
lte_frame_parms->frame_type = frame_type;
|
||||
init_frame_parms(lte_frame_parms,osf);
|
||||
|
||||
//copy_lte_parms_to_phy_framing(lte_frame_parms, &(PHY_config->PHY_framing));
|
||||
|
||||
|
||||
PHY_vars_UE->lte_frame_parms = *lte_frame_parms;
|
||||
|
||||
phy_init_lte_top(lte_frame_parms);
|
||||
|
||||
PHY_vars_UE->PHY_measurements.n_adj_cells=2;
|
||||
PHY_vars_UE->PHY_measurements.adj_cell_id[0] = Nid_cell+1;
|
||||
PHY_vars_UE->PHY_measurements.adj_cell_id[1] = Nid_cell+2;
|
||||
|
||||
for (i=0; i<3; i++)
|
||||
lte_gold(lte_frame_parms,PHY_vars_UE->lte_gold_table[i],Nid_cell+i);
|
||||
|
||||
phy_init_lte_ue(PHY_vars_UE,1,0);
|
||||
|
||||
phy_init_lte_eNB(PHY_vars_eNb,0,0,0);
|
||||
|
||||
for (i=0; i<10; i++) {
|
||||
PHY_vars_UE->scan_info[0].amp[0][i] = 0;
|
||||
PHY_vars_UE->scan_info[0].amp[1][i] = 0;
|
||||
PHY_vars_UE->scan_info[0].amp[2][i] = 0;
|
||||
}
|
||||
|
||||
memcpy((void*)&PHY_vars_eNb1->lte_frame_parms,(void*)&PHY_vars_eNb->lte_frame_parms,sizeof(LTE_DL_FRAME_PARMS));
|
||||
PHY_vars_eNb1->lte_frame_parms.Nid_cell=Nid_cell+1;
|
||||
PHY_vars_eNb1->lte_frame_parms.nushift=(Nid_cell+1)%6;
|
||||
PHY_vars_eNb1->Mod_id=1;
|
||||
|
||||
memcpy((void*)&PHY_vars_eNb2->lte_frame_parms,(void*)&PHY_vars_eNb->lte_frame_parms,sizeof(LTE_DL_FRAME_PARMS));
|
||||
PHY_vars_eNb2->lte_frame_parms.Nid_cell=Nid_cell+2;
|
||||
PHY_vars_eNb2->lte_frame_parms.nushift=(Nid_cell+2)%6;
|
||||
PHY_vars_eNb2->Mod_id=2;
|
||||
|
||||
phy_init_lte_eNB(PHY_vars_eNb1,0,0,0);
|
||||
|
||||
phy_init_lte_eNB(PHY_vars_eNb2,0,0,0);
|
||||
|
||||
phy_init_lte_top(lte_frame_parms);
|
||||
|
||||
printf("Done lte_param_init\n");
|
||||
|
||||
|
||||
}
|
||||
|
||||
mod_sym_t *dummybuf[4];
|
||||
mod_sym_t dummy0[2048*14];
|
||||
mod_sym_t dummy1[2048*14];
|
||||
@@ -404,7 +321,16 @@ int main(int argc, char **argv)
|
||||
if (transmission_mode>=2)
|
||||
n_tx=2;
|
||||
|
||||
lte_param_init(n_tx,n_rx,transmission_mode,extended_prefix_flag,frame_type,Nid_cell,N_RB_DL,osf);
|
||||
lte_param_init(n_tx,
|
||||
n_rx,
|
||||
transmission_mode,
|
||||
extended_prefix_flag,
|
||||
frame_type,
|
||||
Nid_cell,
|
||||
3,
|
||||
N_RB_DL,
|
||||
osf,
|
||||
0);
|
||||
|
||||
#ifdef XFORMS
|
||||
fl_initialize (&argc, argv, NULL, 0, 0);
|
||||
@@ -422,13 +348,13 @@ int main(int argc, char **argv)
|
||||
|
||||
printf("SNR0 %f, SNR1 %f\n",snr0,snr1);
|
||||
|
||||
frame_parms = &PHY_vars_eNb->lte_frame_parms;
|
||||
frame_parms = &PHY_vars_eNB->lte_frame_parms;
|
||||
|
||||
|
||||
|
||||
txdata = PHY_vars_eNb->lte_eNB_common_vars.txdata[0];
|
||||
txdata1 = PHY_vars_eNb1->lte_eNB_common_vars.txdata[0];
|
||||
txdata2 = PHY_vars_eNb2->lte_eNB_common_vars.txdata[0];
|
||||
txdata = PHY_vars_eNB->lte_eNB_common_vars.txdata[0];
|
||||
txdata1 = PHY_vars_eNB1->lte_eNB_common_vars.txdata[0];
|
||||
txdata2 = PHY_vars_eNB2->lte_eNB_common_vars.txdata[0];
|
||||
|
||||
|
||||
s_re = malloc(2*sizeof(double*));
|
||||
@@ -449,8 +375,8 @@ int main(int argc, char **argv)
|
||||
printf("FFT Size %d, Extended Prefix %d, Samples per subframe %d, Symbols per subframe %d\n",NUMBER_OF_OFDM_CARRIERS,
|
||||
frame_parms->Ncp,frame_parms->samples_per_tti,nsymb);
|
||||
|
||||
printf("PHY_vars_eNb1->lte_eNB_common_vars.txdataF[0][0] = %p\n",
|
||||
PHY_vars_eNb1->lte_eNB_common_vars.txdataF[0][0]);
|
||||
printf("PHY_vars_eNB1->lte_eNB_common_vars.txdataF[0][0] = %p\n",
|
||||
PHY_vars_eNB1->lte_eNB_common_vars.txdataF[0][0]);
|
||||
|
||||
|
||||
DLSCH_alloc_pdu2.rah = 0;
|
||||
@@ -465,13 +391,14 @@ int main(int argc, char **argv)
|
||||
// Forget second codeword
|
||||
DLSCH_alloc_pdu2.tpmi = (transmission_mode==6 ? 5 : 0) ; // precoding
|
||||
|
||||
eNB2UE = new_channel_desc_scm(PHY_vars_eNb->lte_frame_parms.nb_antennas_tx,
|
||||
PHY_vars_UE->lte_frame_parms.nb_antennas_rx,
|
||||
channel_model,
|
||||
BW,
|
||||
0,
|
||||
0,
|
||||
0);
|
||||
eNB2UE = new_channel_desc_scm(PHY_vars_eNB->lte_frame_parms.nb_antennas_tx,
|
||||
PHY_vars_UE->lte_frame_parms.nb_antennas_rx,
|
||||
channel_model,
|
||||
N_RB2sampling_rate(PHY_vars_eNB->lte_frame_parms.N_RB_DL),
|
||||
N_RB2channel_bandwidth(PHY_vars_eNB->lte_frame_parms.N_RB_DL),
|
||||
0,
|
||||
0,
|
||||
0);
|
||||
|
||||
|
||||
if (eNB2UE==NULL) {
|
||||
@@ -512,51 +439,51 @@ int main(int argc, char **argv)
|
||||
pbch_pdu[1]=1;
|
||||
pbch_pdu[2]=0;
|
||||
|
||||
if (PHY_vars_eNb->lte_frame_parms.frame_type == FDD) {
|
||||
generate_pss(PHY_vars_eNb->lte_eNB_common_vars.txdataF[0],
|
||||
if (PHY_vars_eNB->lte_frame_parms.frame_type == FDD) {
|
||||
generate_pss(PHY_vars_eNB->lte_eNB_common_vars.txdataF[0],
|
||||
AMP,
|
||||
&PHY_vars_eNb->lte_frame_parms,
|
||||
(PHY_vars_eNb->lte_frame_parms.Ncp==NORMAL) ? 6 : 5,
|
||||
&PHY_vars_eNB->lte_frame_parms,
|
||||
(PHY_vars_eNB->lte_frame_parms.Ncp==NORMAL) ? 6 : 5,
|
||||
0);
|
||||
/*
|
||||
generate_sss(PHY_vars_eNb->lte_eNB_common_vars.txdataF[0],
|
||||
generate_sss(PHY_vars_eNB->lte_eNB_common_vars.txdataF[0],
|
||||
AMP,
|
||||
&PHY_vars_eNb->lte_frame_parms,
|
||||
(PHY_vars_eNb->lte_frame_parms.Ncp==0) ? 5 : 4,
|
||||
&PHY_vars_eNB->lte_frame_parms,
|
||||
(PHY_vars_eNB->lte_frame_parms.Ncp==0) ? 5 : 4,
|
||||
0);*/
|
||||
generate_pss(PHY_vars_eNb->lte_eNB_common_vars.txdataF[0],
|
||||
generate_pss(PHY_vars_eNB->lte_eNB_common_vars.txdataF[0],
|
||||
AMP,
|
||||
&PHY_vars_eNb->lte_frame_parms,
|
||||
(PHY_vars_eNb->lte_frame_parms.Ncp==0) ? 6 : 5,
|
||||
&PHY_vars_eNB->lte_frame_parms,
|
||||
(PHY_vars_eNB->lte_frame_parms.Ncp==0) ? 6 : 5,
|
||||
10);
|
||||
/*
|
||||
generate_sss(PHY_vars_eNb->lte_eNB_common_vars.txdataF[0],
|
||||
generate_sss(PHY_vars_eNB->lte_eNB_common_vars.txdataF[0],
|
||||
AMP,
|
||||
&PHY_vars_eNb->lte_frame_parms,
|
||||
(PHY_vars_eNb->lte_frame_parms.Ncp==0) ? 5 : 4,
|
||||
&PHY_vars_eNB->lte_frame_parms,
|
||||
(PHY_vars_eNB->lte_frame_parms.Ncp==0) ? 5 : 4,
|
||||
10);
|
||||
*/
|
||||
|
||||
} else {
|
||||
|
||||
generate_sss(PHY_vars_eNb->lte_eNB_common_vars.txdataF[0],
|
||||
generate_sss(PHY_vars_eNB->lte_eNB_common_vars.txdataF[0],
|
||||
AMP,
|
||||
&PHY_vars_eNb->lte_frame_parms,
|
||||
(PHY_vars_eNb->lte_frame_parms.Ncp==0) ? 6 : 5,
|
||||
&PHY_vars_eNB->lte_frame_parms,
|
||||
(PHY_vars_eNB->lte_frame_parms.Ncp==0) ? 6 : 5,
|
||||
1);
|
||||
generate_pss(PHY_vars_eNb->lte_eNB_common_vars.txdataF[0],
|
||||
generate_pss(PHY_vars_eNB->lte_eNB_common_vars.txdataF[0],
|
||||
AMP,
|
||||
&PHY_vars_eNb->lte_frame_parms,
|
||||
&PHY_vars_eNB->lte_frame_parms,
|
||||
2,
|
||||
2);
|
||||
generate_sss(PHY_vars_eNb->lte_eNB_common_vars.txdataF[0],
|
||||
generate_sss(PHY_vars_eNB->lte_eNB_common_vars.txdataF[0],
|
||||
AMP,
|
||||
&PHY_vars_eNb->lte_frame_parms,
|
||||
(PHY_vars_eNb->lte_frame_parms.Ncp==0) ? 6 : 5,
|
||||
&PHY_vars_eNB->lte_frame_parms,
|
||||
(PHY_vars_eNB->lte_frame_parms.Ncp==0) ? 6 : 5,
|
||||
11);
|
||||
generate_pss(PHY_vars_eNb->lte_eNB_common_vars.txdataF[0],
|
||||
generate_pss(PHY_vars_eNB->lte_eNB_common_vars.txdataF[0],
|
||||
AMP,
|
||||
&PHY_vars_eNb->lte_frame_parms,
|
||||
&PHY_vars_eNB->lte_frame_parms,
|
||||
2,
|
||||
12);
|
||||
|
||||
@@ -565,8 +492,8 @@ int main(int argc, char **argv)
|
||||
|
||||
|
||||
/*
|
||||
generate_pilots(PHY_vars_eNb,
|
||||
PHY_vars_eNb->lte_eNB_common_vars.txdataF[0],
|
||||
generate_pilots(PHY_vars_eNB,
|
||||
PHY_vars_eNB->lte_eNB_common_vars.txdataF[0],
|
||||
AMP,
|
||||
LTE_NUMBER_OF_SUBFRAMES_PER_FRAME);
|
||||
|
||||
@@ -577,8 +504,8 @@ int main(int argc, char **argv)
|
||||
dci_alloc,
|
||||
0,
|
||||
1024,
|
||||
&PHY_vars_eNb->lte_frame_parms,
|
||||
PHY_vars_eNb->lte_eNB_common_vars.txdataF[0],
|
||||
&PHY_vars_eNB->lte_frame_parms,
|
||||
PHY_vars_eNB->lte_eNB_common_vars.txdataF[0],
|
||||
0);
|
||||
*/
|
||||
|
||||
@@ -593,25 +520,25 @@ int main(int argc, char **argv)
|
||||
dummybuf[1] = dummy1;
|
||||
dummybuf[2] = dummy2;
|
||||
dummybuf[3] = dummy3;
|
||||
generate_pbch(&PHY_vars_eNb->lte_eNB_pbch,
|
||||
generate_pbch(&PHY_vars_eNB->lte_eNB_pbch,
|
||||
(mod_sym_t**)dummybuf,
|
||||
AMP,
|
||||
&PHY_vars_eNb->lte_frame_parms,
|
||||
&PHY_vars_eNB->lte_frame_parms,
|
||||
pbch_pdu,
|
||||
0);
|
||||
}
|
||||
|
||||
generate_pbch(&PHY_vars_eNb->lte_eNB_pbch,
|
||||
PHY_vars_eNb->lte_eNB_common_vars.txdataF[0],
|
||||
generate_pbch(&PHY_vars_eNB->lte_eNB_pbch,
|
||||
PHY_vars_eNB->lte_eNB_common_vars.txdataF[0],
|
||||
AMP,
|
||||
&PHY_vars_eNb->lte_frame_parms,
|
||||
&PHY_vars_eNB->lte_frame_parms,
|
||||
pbch_pdu,
|
||||
pbch_phase);
|
||||
*/
|
||||
write_output("txsigF0.m","txsF0", PHY_vars_eNb->lte_eNB_common_vars.txdataF[0][0],FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX,1,1);
|
||||
write_output("txsigF0.m","txsF0", PHY_vars_eNB->lte_eNB_common_vars.txdataF[0][0],FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX,1,1);
|
||||
|
||||
if (PHY_vars_eNb->lte_frame_parms.nb_antennas_tx>1)
|
||||
write_output("txsigF1.m","txsF1", PHY_vars_eNb->lte_eNB_common_vars.txdataF[0][1],FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX,1,1);
|
||||
if (PHY_vars_eNB->lte_frame_parms.nb_antennas_tx>1)
|
||||
write_output("txsigF1.m","txsF1", PHY_vars_eNB->lte_eNB_common_vars.txdataF[0][1],FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX,1,1);
|
||||
|
||||
tx_lev = 0;
|
||||
tx_lev1 = 0;
|
||||
@@ -620,16 +547,16 @@ int main(int argc, char **argv)
|
||||
|
||||
|
||||
|
||||
for (aa=0; aa<PHY_vars_eNb->lte_frame_parms.nb_antennas_tx; aa++) {
|
||||
for (aa=0; aa<PHY_vars_eNB->lte_frame_parms.nb_antennas_tx; aa++) {
|
||||
if (frame_parms->Ncp == 1)
|
||||
PHY_ofdm_mod(PHY_vars_eNb->lte_eNB_common_vars.txdataF[0][aa], // input,
|
||||
PHY_ofdm_mod(PHY_vars_eNB->lte_eNB_common_vars.txdataF[0][aa], // input,
|
||||
txdata[aa], // output
|
||||
frame_parms->log2_symbol_size, // log2_fft_size
|
||||
frame_parms->ofdm_symbol_size,
|
||||
LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*nsymb, // number of symbols
|
||||
frame_parms->nb_prefix_samples, // number of prefix samples
|
||||
CYCLIC_PREFIX);
|
||||
else {
|
||||
normal_prefix_mod(PHY_vars_eNb->lte_eNB_common_vars.txdataF[0][aa],
|
||||
normal_prefix_mod(PHY_vars_eNB->lte_eNB_common_vars.txdataF[0][aa],
|
||||
txdata[aa],
|
||||
LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*nsymb,
|
||||
frame_parms);
|
||||
@@ -648,7 +575,7 @@ int main(int argc, char **argv)
|
||||
// multipath channel
|
||||
|
||||
for (i=0; i<2*nsymb*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES; i++) {
|
||||
for (aa=0; aa<PHY_vars_eNb->lte_frame_parms.nb_antennas_tx; aa++) {
|
||||
for (aa=0; aa<PHY_vars_eNB->lte_frame_parms.nb_antennas_tx; aa++) {
|
||||
s_re[aa][i] = ((double)(((short *)txdata[aa]))[(i<<1)]);
|
||||
s_im[aa][i] = ((double)(((short *)txdata[aa]))[(i<<1)+1]);
|
||||
}
|
||||
@@ -667,7 +594,7 @@ int main(int argc, char **argv)
|
||||
multipath_channel(eNB2UE,s_re,s_im,r_re,r_im,
|
||||
2*nsymb*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES,0);
|
||||
|
||||
sigma2_dB = 10*log10((double)tx_lev) +10*log10((double)PHY_vars_eNb->lte_frame_parms.ofdm_symbol_size/(double)(12*NB_RB)) - SNR;
|
||||
sigma2_dB = 10*log10((double)tx_lev) +10*log10((double)PHY_vars_eNB->lte_frame_parms.ofdm_symbol_size/(double)(12*NB_RB)) - SNR;
|
||||
|
||||
if (n_frames==1)
|
||||
printf("sigma2_dB %f (SNR %f dB) tx_lev_dB %f,%f,%f\n",sigma2_dB,SNR,
|
||||
@@ -689,7 +616,7 @@ int main(int argc, char **argv)
|
||||
for (n_trials=0; n_trials<ntrials; n_trials++) {
|
||||
//printf("n_trial %d\n",n_trials);
|
||||
for (i=0; i<2*nsymb*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES; i++) {
|
||||
for (aa=0; aa<PHY_vars_eNb->lte_frame_parms.nb_antennas_rx; aa++) {
|
||||
for (aa=0; aa<PHY_vars_eNB->lte_frame_parms.nb_antennas_rx; aa++) {
|
||||
((short*) PHY_vars_UE->lte_ue_common_vars.rxdata[aa])[2*i] = (short) ((r_re[aa][i] +sqrt(sigma2/2)*gaussdouble(0.0,1.0)));
|
||||
((short*) PHY_vars_UE->lte_ue_common_vars.rxdata[aa])[2*i+1] = (short) ((r_im[aa][i] + (iqim*r_re[aa][i]) + sqrt(sigma2/2)*gaussdouble(0.0,1.0)));
|
||||
}
|
||||
|
||||
@@ -1189,7 +1189,7 @@ int main(int argc, char **argv)
|
||||
if (frame_parms->Ncp == 1)
|
||||
PHY_ofdm_mod(txdataF2[aa], // input
|
||||
txdata[aa], // output
|
||||
PHY_vars_eNB->lte_frame_parms.log2_symbol_size, // log2_fft_size
|
||||
PHY_vars_eNB->lte_frame_parms.ofdm_symbol_size, // log2_fft_size
|
||||
LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*nsymb, // number of symbols
|
||||
PHY_vars_eNB->lte_frame_parms.nb_prefix_samples, // number of prefix samples
|
||||
PHY_vars_eNB->lte_frame_parms.twiddle_ifft, // IFFT twiddle factors
|
||||
@@ -1218,7 +1218,7 @@ int main(int argc, char **argv)
|
||||
if (frame_parms->Ncp == 1)
|
||||
PHY_ofdm_mod(PHY_vars_eNB->lte_eNB_common_vars.txdataF[eNb_id][aa], // input,
|
||||
txdata[aa], // output
|
||||
frame_parms->log2_symbol_size, // log2_fft_size
|
||||
frame_parms->ofdm_symbol_size, // log2_fft_size
|
||||
LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*nsymb, // number of symbols
|
||||
frame_parms->nb_prefix_samples, // number of prefix samples
|
||||
frame_parms->twiddle_ifft, // IFFT twiddle factors
|
||||
@@ -1240,7 +1240,7 @@ int main(int argc, char **argv)
|
||||
if (frame_parms->Ncp == 1)
|
||||
PHY_ofdm_mod(PHY_vars_eNB1->lte_eNB_common_vars.txdataF[eNb_id][aa], // input,
|
||||
PHY_vars_eNB1->lte_eNB_common_vars.txdata[eNb_id][aa], // output
|
||||
frame_parms->log2_symbol_size, // log2_fft_size
|
||||
frame_parms->ofdm_symbol_size, // log2_fft_size
|
||||
LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*nsymb, // number of symbols
|
||||
frame_parms->nb_prefix_samples, // number of prefix samples
|
||||
frame_parms->twiddle_ifft, // IFFT twiddle factors
|
||||
@@ -1260,7 +1260,7 @@ int main(int argc, char **argv)
|
||||
if (frame_parms->Ncp == 1)
|
||||
PHY_ofdm_mod(PHY_vars_eNB2->lte_eNB_common_vars.txdataF[eNb_id][aa], // input,
|
||||
PHY_vars_eNB2->lte_eNB_common_vars.txdata[eNb_id][aa], // output
|
||||
frame_parms->log2_symbol_size, // log2_fft_size
|
||||
frame_parms->ofdm_symbol_size, // log2_fft_size
|
||||
LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*nsymb, // number of symbols
|
||||
frame_parms->nb_prefix_samples, // number of prefix samples
|
||||
frame_parms->twiddle_ifft, // IFFT twiddle factors
|
||||
|
||||
@@ -58,23 +58,11 @@
|
||||
|
||||
extern unsigned short dftsizes[33];
|
||||
extern short *ul_ref_sigs[30][2][33];
|
||||
//#define AWGN
|
||||
//#define NO_DCI
|
||||
|
||||
#define BW 7.68
|
||||
//#define ABSTRACTION
|
||||
//#define PERFECT_CE
|
||||
|
||||
/*
|
||||
#define RBmask0 0x00fc00fc
|
||||
#define RBmask1 0x0
|
||||
#define RBmask2 0x0
|
||||
#define RBmask3 0x0
|
||||
*/
|
||||
PHY_VARS_eNB *PHY_vars_eNB;
|
||||
PHY_VARS_UE *PHY_vars_UE;
|
||||
|
||||
#define MCS_COUNT 23//added for PHY abstraction
|
||||
//#define MCS_COUNT 23//added for PHY abstraction
|
||||
|
||||
channel_desc_t *eNB2UE[NUMBER_OF_eNB_MAX][NUMBER_OF_UE_MAX];
|
||||
channel_desc_t *UE2eNB[NUMBER_OF_UE_MAX][NUMBER_OF_eNB_MAX];
|
||||
@@ -101,65 +89,6 @@ double t_rx_min = 1000000000; /*!< \brief initial min process time for tx */
|
||||
int n_tx_dropped = 0; /*!< \brief initial max process time for tx */
|
||||
int n_rx_dropped = 0; /*!< \brief initial max process time for rx */
|
||||
|
||||
void lte_param_init(unsigned char N_tx, unsigned char N_rx,unsigned char transmission_mode,uint8_t extended_prefix_flag,uint8_t N_RB_DL,uint8_t frame_type,uint8_t tdd_config,uint8_t osf)
|
||||
{
|
||||
|
||||
LTE_DL_FRAME_PARMS *lte_frame_parms;
|
||||
|
||||
printf("Start lte_param_init\n");
|
||||
PHY_vars_eNB = malloc(sizeof(PHY_VARS_eNB));
|
||||
PHY_vars_UE = malloc(sizeof(PHY_VARS_UE));
|
||||
//PHY_config = malloc(sizeof(PHY_CONFIG));
|
||||
mac_xface = malloc(sizeof(MAC_xface));
|
||||
|
||||
randominit(0);
|
||||
set_taus_seed(0);
|
||||
|
||||
lte_frame_parms = &(PHY_vars_eNB->lte_frame_parms);
|
||||
|
||||
lte_frame_parms->frame_type = frame_type;
|
||||
lte_frame_parms->tdd_config = tdd_config;
|
||||
lte_frame_parms->N_RB_DL = N_RB_DL; //50 for 10MHz and 25 for 5 MHz
|
||||
lte_frame_parms->N_RB_UL = N_RB_DL;
|
||||
lte_frame_parms->Ncp = extended_prefix_flag;
|
||||
lte_frame_parms->Ncp_UL = extended_prefix_flag;
|
||||
lte_frame_parms->Nid_cell = 10;
|
||||
lte_frame_parms->nushift = 0;
|
||||
lte_frame_parms->nb_antennas_tx = N_tx;
|
||||
lte_frame_parms->nb_antennas_rx = N_rx;
|
||||
// lte_frame_parms->Csrs = 2;
|
||||
// lte_frame_parms->Bsrs = 0;
|
||||
// lte_frame_parms->kTC = 0;
|
||||
// lte_frame_parms->n_RRC = 0;
|
||||
lte_frame_parms->mode1_flag = (transmission_mode == 1)? 1 : 0;
|
||||
lte_frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.cyclicShift = 0;//n_DMRS1 set to 0
|
||||
|
||||
init_frame_parms(lte_frame_parms,osf);
|
||||
|
||||
//copy_lte_parms_to_phy_framing(lte_frame_parms, &(PHY_config->PHY_framing));
|
||||
|
||||
|
||||
PHY_vars_UE->lte_frame_parms = *lte_frame_parms;
|
||||
|
||||
phy_init_lte_top(lte_frame_parms);
|
||||
|
||||
phy_init_lte_ue(PHY_vars_UE,1,0);
|
||||
|
||||
phy_init_lte_eNB(PHY_vars_eNB,0,0,0);
|
||||
|
||||
printf("Done lte_param_init\n");
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#define UL_RB_ALLOC 0x1ff;
|
||||
|
||||
|
||||
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
|
||||
@@ -168,12 +97,10 @@ int main(int argc, char **argv)
|
||||
|
||||
int aarx,aatx;
|
||||
double channelx,channely;
|
||||
double sigma2, sigma2_dB=10,SNR,SNR2,snr0=-2.0,snr1,SNRmeas,rate,saving_bler;
|
||||
double sigma2, sigma2_dB=10,SNR,SNR2,snr0=-2.0,snr1,SNRmeas,rate,saving_bler=0;
|
||||
double input_snr_step=.2,snr_int=30;
|
||||
double blerr;
|
||||
|
||||
//int **txdataF, **txdata;
|
||||
|
||||
int **txdata;
|
||||
|
||||
LTE_DL_FRAME_PARMS *frame_parms;
|
||||
@@ -199,7 +126,7 @@ int main(int argc, char **argv)
|
||||
unsigned int coded_bits_per_codeword,nsymb;
|
||||
int subframe=3;
|
||||
unsigned int tx_lev=0,tx_lev_dB,trials,errs[4]= {0,0,0,0},round_trials[4]= {0,0,0,0};
|
||||
uint8_t transmission_mode=1,n_rx=1,n_tx=1;
|
||||
uint8_t transmission_mode=1,n_rx=1;
|
||||
|
||||
FILE *bler_fd=NULL;
|
||||
char bler_fname[512];
|
||||
@@ -214,6 +141,7 @@ int main(int argc, char **argv)
|
||||
// FILE *rx_frame_file;
|
||||
FILE *csv_fdUL=NULL;
|
||||
|
||||
/*
|
||||
FILE *fperen=NULL;
|
||||
char fperen_name[512];
|
||||
|
||||
@@ -222,6 +150,7 @@ int main(int argc, char **argv)
|
||||
|
||||
FILE *flogeren=NULL;
|
||||
char flogeren_name[512];
|
||||
*/
|
||||
|
||||
/* FILE *ftxlev;
|
||||
char ftxlev_name[512];
|
||||
@@ -265,6 +194,7 @@ int main(int argc, char **argv)
|
||||
int nb_rb_set = 0;
|
||||
int sf;
|
||||
|
||||
int threequarter_fs=0;
|
||||
opp_enabled=1; // to enable the time meas
|
||||
|
||||
cpu_freq_GHz = (double)get_cpu_freq_GHz();
|
||||
@@ -274,7 +204,7 @@ int main(int argc, char **argv)
|
||||
|
||||
logInit();
|
||||
|
||||
while ((c = getopt (argc, argv, "hapZbm:n:Y:X:x:s:w:e:q:d:D:O:c:r:i:f:y:c:oA:C:R:g:N:l:S:T:QB:PI:L")) != -1) {
|
||||
while ((c = getopt (argc, argv, "hapZEbm:n:Y:X:x:s:w:e:q:d:D:O:c:r:i:f:y:c:oA:C:R:g:N:l:S:T:QB:PI:L")) != -1) {
|
||||
switch (c) {
|
||||
case 'a':
|
||||
channel_model = AWGN;
|
||||
@@ -412,10 +342,6 @@ int main(int argc, char **argv)
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
if (transmission_mode>1) {
|
||||
n_tx = 1;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 'y':
|
||||
@@ -448,6 +374,10 @@ int main(int argc, char **argv)
|
||||
cyclic_shift = atoi(optarg);
|
||||
break;
|
||||
|
||||
case 'E':
|
||||
threequarter_fs=1;
|
||||
break;
|
||||
|
||||
case 'N':
|
||||
N0 = atoi(optarg);
|
||||
break;
|
||||
@@ -537,7 +467,17 @@ int main(int argc, char **argv)
|
||||
}
|
||||
}
|
||||
|
||||
lte_param_init(1,n_rx,1,extended_prefix_flag,N_RB_DL,frame_type,tdd_config,osf);
|
||||
lte_param_init(1,
|
||||
n_rx,
|
||||
1,
|
||||
extended_prefix_flag,
|
||||
frame_type,
|
||||
0,
|
||||
tdd_config,
|
||||
N_RB_DL,
|
||||
threequarter_fs,
|
||||
osf,
|
||||
0);
|
||||
|
||||
if (nb_rb_set == 0)
|
||||
nb_rb = PHY_vars_eNB->lte_frame_parms.N_RB_UL;
|
||||
@@ -581,6 +521,10 @@ int main(int argc, char **argv)
|
||||
|
||||
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");
|
||||
if (bler_fd==NULL) {
|
||||
fprintf(stderr,"Problem creating file %s\n",bler_fname);
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
fprintf(bler_fd,"#SNR;mcs;nb_rb;TBS;rate;errors[0];trials[0];errors[1];trials[1];errors[2];trials[2];errors[3];trials[3]\n");
|
||||
|
||||
@@ -589,15 +533,19 @@ int main(int argc, char **argv)
|
||||
hostname[1023] = '\0';
|
||||
gethostname(hostname, 1023);
|
||||
printf("Hostname: %s\n", hostname);
|
||||
char dirname[FILENAME_MAX];
|
||||
sprintf(dirname, "%s//SIMU/USER/pre-ci-logs-%s", getenv("OPENAIR_TARGETS"),hostname);
|
||||
mkdir(dirname, 0777);
|
||||
sprintf(time_meas_fname,"%s/time_meas_prb%d_mcs%d_antrx%d_channel%s_tx%d.csv",
|
||||
dirname,
|
||||
//char dirname[FILENAME_MAX];
|
||||
//sprintf(dirname, "%s//SIMU/USER/pre-ci-logs-%s", getenv("OPENAIR_TARGETS"),hostname);
|
||||
//mkdir(dirname, 0777);
|
||||
sprintf(time_meas_fname,"time_meas_prb%d_mcs%d_antrx%d_channel%s_tx%d.csv",
|
||||
N_RB_DL,mcs,n_rx,channel_model_input,transmission_mode);
|
||||
time_meas_fd = fopen(time_meas_fname,"w");
|
||||
if (time_meas_fd==NULL) {
|
||||
fprintf(stderr,"Cannot create file %s!\n",time_meas_fname);
|
||||
exit(-1);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
if(abstx) {
|
||||
sprintf(fperen_name,"ULchan_estims_F_mcs%d_rb%d_chanMod%d_nframes%d_chanReal%d.m",mcs,nb_rb,chMod,n_frames,n_ch_rlz);
|
||||
fperen = fopen(fperen_name,"a+");
|
||||
@@ -614,6 +562,7 @@ int main(int argc, char **argv)
|
||||
fprintf(flogeren,"mag_f = [");
|
||||
fclose(flogeren);
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
sprintf(ftxlev_name,"txlevel_mcs%d_rb%d_chanMod%d_nframes%d_chanReal%d.m",mcs,nb_rb,chMod,n_frames,n_ch_rlz);
|
||||
@@ -626,6 +575,10 @@ int main(int argc, char **argv)
|
||||
// CSV file
|
||||
sprintf(csv_fname,"EULdataout_tx%d_mcs%d_nbrb%d_chan%d_nsimus%d_eren.m",transmission_mode,mcs,nb_rb,chMod,n_frames);
|
||||
csv_fdUL = fopen(csv_fname,"w");
|
||||
if (csv_fdUL == NULL) {
|
||||
fprintf(stderr,"Problem opening file %s\n",csv_fname);
|
||||
exit(-1);
|
||||
}
|
||||
fprintf(csv_fdUL,"data_all%d=[",mcs);
|
||||
}
|
||||
|
||||
@@ -680,7 +633,8 @@ int main(int argc, char **argv)
|
||||
UE2eNB = new_channel_desc_scm(PHY_vars_eNB->lte_frame_parms.nb_antennas_tx,
|
||||
PHY_vars_UE->lte_frame_parms.nb_antennas_rx,
|
||||
channel_model,
|
||||
BW,
|
||||
N_RB2sampling_rate(PHY_vars_eNB->lte_frame_parms.N_RB_UL),
|
||||
N_RB2channel_bandwidth(PHY_vars_eNB->lte_frame_parms.N_RB_UL),
|
||||
forgetting_factor,
|
||||
delay,
|
||||
0);
|
||||
@@ -693,8 +647,8 @@ int main(int argc, char **argv)
|
||||
|
||||
// Create transport channel structures for 2 transport blocks (MIMO)
|
||||
for (i=0; i<2; i++) {
|
||||
PHY_vars_eNB->dlsch_eNB[0][i] = new_eNB_dlsch(1,8,N_RB_DL,0,&PHY_vars_eNB->lte_frame_parms);
|
||||
PHY_vars_UE->dlsch_ue[0][i] = new_ue_dlsch(1,8,MAX_TURBO_ITERATIONS,N_RB_DL,0);
|
||||
PHY_vars_eNB->dlsch_eNB[0][i] = new_eNB_dlsch(1,8,1827072,N_RB_DL,0,&PHY_vars_eNB->lte_frame_parms);
|
||||
PHY_vars_UE->dlsch_ue[0][i] = new_ue_dlsch(1,8,1827072,MAX_TURBO_ITERATIONS,N_RB_DL,0);
|
||||
|
||||
if (!PHY_vars_eNB->dlsch_eNB[0][i]) {
|
||||
printf("Can't get eNB dlsch structures\n");
|
||||
@@ -709,7 +663,7 @@ int main(int argc, char **argv)
|
||||
PHY_vars_eNB->dlsch_eNB[0][i]->rnti = 14;
|
||||
PHY_vars_UE->dlsch_ue[0][i]->rnti = 14;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
switch (PHY_vars_eNB->lte_frame_parms.N_RB_UL) {
|
||||
@@ -897,11 +851,11 @@ int main(int argc, char **argv)
|
||||
|
||||
|
||||
harq_pid = subframe2harq_pid(&PHY_vars_UE->lte_frame_parms,PHY_vars_UE->frame_tx,subframe);
|
||||
|
||||
input_buffer_length = PHY_vars_UE->ulsch_ue[0]->harq_processes[harq_pid]->TBS/8;
|
||||
input_buffer = (unsigned char *)malloc(input_buffer_length+4);
|
||||
// printf("UL frame %d/subframe %d, harq_pid %d\n",PHY_vars_UE->frame,subframe,harq_pid);
|
||||
if (input_fdUL == NULL) {
|
||||
input_buffer_length = PHY_vars_UE->ulsch_ue[0]->harq_processes[harq_pid]->TBS/8;
|
||||
input_buffer = (unsigned char *)malloc(input_buffer_length+4);
|
||||
|
||||
|
||||
if (n_frames == 1) {
|
||||
trch_out_fdUL= fopen("ulsch_trchUL.txt","w");
|
||||
@@ -923,7 +877,7 @@ int main(int argc, char **argv)
|
||||
i=0;
|
||||
|
||||
while (!feof(input_fdUL)) {
|
||||
fscanf(input_fdUL,"%s %s",input_val_str,input_val_str2);//&input_val1,&input_val2);
|
||||
ret=fscanf(input_fdUL,"%s %s",input_val_str,input_val_str2);//&input_val1,&input_val2);
|
||||
|
||||
if ((i%4)==0) {
|
||||
((short*)txdata[0])[i/2] = (short)((1<<15)*strtod(input_val_str,NULL));
|
||||
@@ -1112,7 +1066,7 @@ int main(int argc, char **argv)
|
||||
if (frame_parms->Ncp == 1)
|
||||
PHY_ofdm_mod(&PHY_vars_UE->lte_ue_common_vars.txdataF[aa][subframe*nsymb*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES_NO_PREFIX], // input
|
||||
&txdata[aa][PHY_vars_eNB->lte_frame_parms.samples_per_tti*subframe], // output
|
||||
PHY_vars_UE->lte_frame_parms.log2_symbol_size, // log2_fft_size
|
||||
PHY_vars_UE->lte_frame_parms.ofdm_symbol_size,
|
||||
nsymb, // number of symbols
|
||||
PHY_vars_UE->lte_frame_parms.nb_prefix_samples, // number of prefix samples
|
||||
CYCLIC_PREFIX);
|
||||
@@ -1253,6 +1207,7 @@ int main(int argc, char **argv)
|
||||
start_meas(&PHY_vars_eNB->phy_proc_rx);
|
||||
start_meas(&PHY_vars_eNB->ofdm_demod_stats);
|
||||
lte_eNB_I0_measurements(PHY_vars_eNB,
|
||||
subframe,
|
||||
0,
|
||||
1);
|
||||
|
||||
@@ -1270,11 +1225,13 @@ int main(int argc, char **argv)
|
||||
|
||||
PHY_vars_eNB->ulsch_eNB[0]->cyclicShift = cyclic_shift;// cyclic shift for DMRS
|
||||
|
||||
/*
|
||||
if(abstx) {
|
||||
namepointer_log2 = &flogeren_name;
|
||||
namepointer_chMag = &fmageren_name;
|
||||
//namepointer_txlev = &ftxlev;
|
||||
}
|
||||
*/
|
||||
|
||||
start_meas(&PHY_vars_eNB->ulsch_demodulation_stats);
|
||||
rx_ulsch(PHY_vars_eNB,
|
||||
@@ -1285,6 +1242,7 @@ int main(int argc, char **argv)
|
||||
cooperation_flag);
|
||||
stop_meas(&PHY_vars_eNB->ulsch_demodulation_stats);
|
||||
|
||||
/*
|
||||
if(abstx) {
|
||||
namepointer_chMag = NULL;
|
||||
|
||||
@@ -1296,8 +1254,7 @@ int main(int argc, char **argv)
|
||||
// flagMag = 1;
|
||||
}
|
||||
}
|
||||
|
||||
///////
|
||||
*/
|
||||
|
||||
start_meas(&PHY_vars_eNB->ulsch_decoding_stats);
|
||||
ret= ulsch_decoding(PHY_vars_eNB,
|
||||
@@ -1816,6 +1773,7 @@ int main(int argc, char **argv)
|
||||
|
||||
}//ch realization
|
||||
|
||||
/*
|
||||
if(abstx) {
|
||||
fperen = fopen(fperen_name,"a+");
|
||||
fprintf(fperen,"];\n");
|
||||
@@ -1829,6 +1787,7 @@ int main(int argc, char **argv)
|
||||
fprintf(flogeren,"];\n");
|
||||
fclose(flogeren);
|
||||
}
|
||||
*/
|
||||
|
||||
// ftxlev = fopen(ftxlev_name,"a+");
|
||||
//fprintf(ftxlev,"];\n");
|
||||
|
||||
@@ -45,7 +45,7 @@ double **cos_lut=NULL,**sin_lut=NULL;
|
||||
|
||||
|
||||
|
||||
void init_freq_channel(channel_desc_t *desc,uint16_t nb_rb,int16_t n_samples)
|
||||
int init_freq_channel(channel_desc_t *desc,uint16_t nb_rb,int16_t n_samples)
|
||||
{
|
||||
|
||||
|
||||
@@ -54,15 +54,17 @@ void init_freq_channel(channel_desc_t *desc,uint16_t nb_rb,int16_t n_samples)
|
||||
int16_t f;
|
||||
uint8_t l;
|
||||
|
||||
if ((n_samples&1)==0) {
|
||||
fprintf(stderr, "freq_channel_init: n_samples has to be odd\n");
|
||||
return(-1);
|
||||
}
|
||||
|
||||
cos_lut = (double **)malloc(n_samples*sizeof(double*));
|
||||
sin_lut = (double **)malloc(n_samples*sizeof(double*));
|
||||
|
||||
|
||||
|
||||
delta_f = nb_rb*180000/(n_samples-1);
|
||||
|
||||
for (f=-(n_samples>>1); f<(n_samples>>1); f++) {
|
||||
for (f=-(n_samples>>1); f<=(n_samples>>1); f++) {
|
||||
freq=delta_f*(double)f*1e-6;// due to the fact that delays is in mus
|
||||
|
||||
cos_lut[f+(n_samples>>1)] = (double *)malloc((int)desc->nb_taps*sizeof(double));
|
||||
@@ -73,7 +75,7 @@ void init_freq_channel(channel_desc_t *desc,uint16_t nb_rb,int16_t n_samples)
|
||||
if (desc->nb_taps==1)
|
||||
delay = desc->delays[l];
|
||||
else
|
||||
delay = desc->delays[l]+NB_SAMPLES_CHANNEL_OFFSET/desc->BW;
|
||||
delay = desc->delays[l]+NB_SAMPLES_CHANNEL_OFFSET/desc->sampling_rate;
|
||||
|
||||
cos_lut[f+(n_samples>>1)][l] = cos(2*M_PI*freq*delay);
|
||||
sin_lut[f+(n_samples>>1)][l] = sin(2*M_PI*freq*delay);
|
||||
@@ -81,9 +83,11 @@ void init_freq_channel(channel_desc_t *desc,uint16_t nb_rb,int16_t n_samples)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
void freq_channel(channel_desc_t *desc,uint16_t nb_rb,int16_t n_samples)
|
||||
int freq_channel(channel_desc_t *desc,uint16_t nb_rb,int16_t n_samples)
|
||||
{
|
||||
|
||||
|
||||
@@ -93,22 +97,32 @@ void freq_channel(channel_desc_t *desc,uint16_t nb_rb,int16_t n_samples)
|
||||
static int freq_channel_init=0;
|
||||
static int n_samples_max=0;
|
||||
|
||||
// printf("no of samples:%d,",n_samples);
|
||||
// do some error checking
|
||||
// n_samples has to be a odd number because we assume the spectrum is symmetric around the DC and includes the DC
|
||||
if ((n_samples&1)==0) {
|
||||
fprintf(stderr, "freq_channel: n_samples has to be odd\n");
|
||||
return(-1);
|
||||
}
|
||||
|
||||
// printf("no of taps:%d,",(int)desc->nb_taps);
|
||||
|
||||
if (freq_channel_init == 0) {
|
||||
// we are initializing the lut for the largets possible n_samples=12*nb_rb+1
|
||||
// if called with n_samples<12*nb_rb+1, we decimate the lut
|
||||
n_samples_max=12*nb_rb+1;
|
||||
init_freq_channel(desc,nb_rb,n_samples_max);
|
||||
freq_channel_init=1;
|
||||
if (init_freq_channel(desc,nb_rb,n_samples_max)==0)
|
||||
freq_channel_init=1;
|
||||
else
|
||||
return(-1);
|
||||
}
|
||||
|
||||
d=n_samples_max/n_samples;
|
||||
d=(n_samples_max-1)/(n_samples-1);
|
||||
|
||||
//printf("no_samples=%d, n_samples_max=%d, d=%d\n",n_samples,n_samples_max,d);
|
||||
|
||||
start_meas(&desc->interp_freq);
|
||||
|
||||
for (f=-n_samples_max/2,f2=-n_samples/2; f<n_samples_max/2; f+=d,f2++) {
|
||||
for (f=-n_samples_max/2,f2=-n_samples/2; f<=n_samples_max/2; f+=d,f2++) {
|
||||
clut = cos_lut[n_samples_max/2+f];
|
||||
slut = sin_lut[n_samples_max/2+f];
|
||||
|
||||
@@ -129,6 +143,8 @@ void freq_channel(channel_desc_t *desc,uint16_t nb_rb,int16_t n_samples)
|
||||
}
|
||||
|
||||
stop_meas(&desc->interp_freq);
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
double compute_pbch_sinr(channel_desc_t *desc,
|
||||
|
||||
@@ -69,7 +69,9 @@ typedef struct {
|
||||
///Maximum path delay in mus.
|
||||
double Td;
|
||||
///Channel bandwidth in MHz.
|
||||
double BW;
|
||||
double channel_bandwidth;
|
||||
///System sampling rate in Msps.
|
||||
double sampling_rate;
|
||||
///Ricean factor of first tap wrt other taps (0..1, where 0 means AWGN and 1 means Rayleigh channel).
|
||||
double ricean_factor;
|
||||
///Angle of arrival of wavefront (in radians). For Ricean channel only. This assumes that both RX and TX have linear antenna arrays with lambda/2 antenna spacing. Furhter it is assumed that the arrays are parallel to each other and that they are far enough apart so that we can safely assume plane wave propagation.
|
||||
@@ -202,7 +204,8 @@ typedef enum {
|
||||
channel_desc_t *new_channel_desc_scm(uint8_t nb_tx,
|
||||
uint8_t nb_rx,
|
||||
SCM_t channel_model,
|
||||
double BW,
|
||||
double sampling_rate,
|
||||
double channel_bandwidth,
|
||||
double forgetting_factor,
|
||||
int32_t channel_offset,
|
||||
double path_loss_dB);
|
||||
@@ -351,8 +354,8 @@ int gauss(unsigned int *gauss_LUT,unsigned char Nbits);
|
||||
double gaussdouble(double,double);
|
||||
void randominit(unsigned int seed_init);
|
||||
double uniformrandom(void);
|
||||
void freq_channel(channel_desc_t *desc,uint16_t nb_rb, int16_t n_samples);
|
||||
void init_freq_channel(channel_desc_t *desc,uint16_t nb_rb,int16_t n_samples);
|
||||
int freq_channel(channel_desc_t *desc,uint16_t nb_rb, int16_t n_samples);
|
||||
int init_freq_channel(channel_desc_t *desc,uint16_t nb_rb,int16_t n_samples);
|
||||
uint8_t multipath_channel_nosigconv(channel_desc_t *desc);
|
||||
void multipath_tv_channel(channel_desc_t *desc,
|
||||
double **tx_sig_re,
|
||||
@@ -364,6 +367,10 @@ void multipath_tv_channel(channel_desc_t *desc,
|
||||
|
||||
/**@} */
|
||||
/**@} */
|
||||
|
||||
double N_RB2sampling_rate(uint16_t N_RB);
|
||||
double N_RB2channel_bandwidth(uint16_t N_RB);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -175,13 +175,13 @@ void tv_channel(channel_desc_t *desc,double complex ***H,uint16_t length)
|
||||
{
|
||||
for(p=0;p<desc->nb_paths;p++)
|
||||
{
|
||||
H[i][j] += sqrt(desc->amps[j]/2)*alpha[p]*cexp(-I*(2*pi*w_Hz[p]*i*(1/(desc->BW*1e6))+phi_rad[p]));
|
||||
H[i][j] += sqrt(desc->amps[j]/2)*alpha[p]*cexp(-I*(2*pi*w_Hz[p]*i*(1/(desc->sampling_rate*1e6))+phi_rad[p]));
|
||||
}
|
||||
}
|
||||
}
|
||||
for(j=0;j<desc->nb_paths;j++)
|
||||
{
|
||||
phi_rad[j] = fmod(2*pi*w_Hz[j]*(length-1)*(1/desc->BW)+phi_rad[j],2*pi);
|
||||
phi_rad[j] = fmod(2*pi*w_Hz[j]*(length-1)*(1/desc->sampling_rate)+phi_rad[j],2*pi);
|
||||
}
|
||||
*/
|
||||
|
||||
@@ -193,13 +193,13 @@ void tv_channel(channel_desc_t *desc,double complex ***H,uint16_t length)
|
||||
H[i+(j*desc->nb_rx)][k][l] = 0;
|
||||
|
||||
for(p=0; p<desc->nb_paths; p++) {
|
||||
H[i+(j*desc->nb_rx)][k][l] += sqrt(desc->amps[l]/2)*alpha[p]*cexp(I*(2*pi*w_Hz[p]*k*(1/(desc->BW*1e6))+phi_rad[p]));
|
||||
H[i+(j*desc->nb_rx)][k][l] += sqrt(desc->amps[l]/2)*alpha[p]*cexp(I*(2*pi*w_Hz[p]*k*(1/(desc->sampling_rate*1e6))+phi_rad[p]));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for(j=0; j<desc->nb_paths; j++) {
|
||||
phi_rad[j] = fmod(2*pi*w_Hz[j]*(length-1)*(1/desc->BW)+phi_rad[j],2*pi);
|
||||
phi_rad[j] = fmod(2*pi*w_Hz[j]*(length-1)*(1/desc->sampling_rate)+phi_rad[j],2*pi);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,7 +48,8 @@ void fill_channel_desc(channel_desc_t *chan_desc,
|
||||
double *delays,
|
||||
struct complex** R_sqrt,
|
||||
double Td,
|
||||
double BW,
|
||||
double sampling_rate,
|
||||
double channel_bandwidth,
|
||||
double ricean_factor,
|
||||
double aoa,
|
||||
double forgetting_factor,
|
||||
@@ -81,7 +82,8 @@ void fill_channel_desc(channel_desc_t *chan_desc,
|
||||
chan_desc->delays = delays;
|
||||
|
||||
chan_desc->Td = Td;
|
||||
chan_desc->BW = BW;
|
||||
chan_desc->sampling_rate = sampling_rate;
|
||||
chan_desc->channel_bandwidth = channel_bandwidth;
|
||||
chan_desc->ricean_factor = ricean_factor;
|
||||
chan_desc->aoa = aoa;
|
||||
chan_desc->random_aoa = random_aoa;
|
||||
@@ -195,7 +197,8 @@ struct complex **R_sqrt_ptr2;
|
||||
channel_desc_t *new_channel_desc_scm(uint8_t nb_tx,
|
||||
uint8_t nb_rx,
|
||||
SCM_t channel_model,
|
||||
double BW,
|
||||
double sampling_rate,
|
||||
double channel_bandwidth,
|
||||
double forgetting_factor,
|
||||
int32_t channel_offset,
|
||||
double path_loss_dB)
|
||||
@@ -209,7 +212,8 @@ channel_desc_t *new_channel_desc_scm(uint8_t nb_tx,
|
||||
|
||||
chan_desc->nb_tx = nb_tx;
|
||||
chan_desc->nb_rx = nb_rx;
|
||||
chan_desc->BW = BW;
|
||||
chan_desc->sampling_rate = sampling_rate;
|
||||
chan_desc->channel_bandwidth = channel_bandwidth;
|
||||
chan_desc->forgetting_factor = forgetting_factor;
|
||||
chan_desc->channel_offset = channel_offset;
|
||||
chan_desc->path_loss_dB = path_loss_dB;
|
||||
@@ -232,7 +236,7 @@ channel_desc_t *new_channel_desc_scm(uint8_t nb_tx,
|
||||
case SCM_C:
|
||||
chan_desc->nb_taps = 18;
|
||||
chan_desc->Td = 4.625;
|
||||
chan_desc->channel_length = (int) (2*chan_desc->BW*chan_desc->Td + 1 + 2/(M_PI*M_PI)*log(4*M_PI*chan_desc->BW*chan_desc->Td));
|
||||
chan_desc->channel_length = (int) (2*chan_desc->sampling_rate*chan_desc->Td + 1 + 2/(M_PI*M_PI)*log(4*M_PI*chan_desc->sampling_rate*chan_desc->Td));
|
||||
sum_amps = 0;
|
||||
chan_desc->amps = (double*) malloc(chan_desc->nb_taps*sizeof(double));
|
||||
|
||||
@@ -291,7 +295,7 @@ channel_desc_t *new_channel_desc_scm(uint8_t nb_tx,
|
||||
LOG_W(OCM,"This is not the real SCM-D model! It is just SCM-C with an additional Rice factor!\n");
|
||||
chan_desc->nb_taps = 18;
|
||||
chan_desc->Td = 4.625;
|
||||
chan_desc->channel_length = (int) (2*chan_desc->BW*chan_desc->Td + 1 + 2/(M_PI*M_PI)*log(4*M_PI*chan_desc->BW*chan_desc->Td));
|
||||
chan_desc->channel_length = (int) (2*chan_desc->sampling_rate*chan_desc->Td + 1 + 2/(M_PI*M_PI)*log(4*M_PI*chan_desc->sampling_rate*chan_desc->Td));
|
||||
sum_amps = 0;
|
||||
chan_desc->amps = (double*) malloc(chan_desc->nb_taps*sizeof(double));
|
||||
|
||||
@@ -349,7 +353,7 @@ channel_desc_t *new_channel_desc_scm(uint8_t nb_tx,
|
||||
case EPA:
|
||||
chan_desc->nb_taps = 7;
|
||||
chan_desc->Td = .410;
|
||||
chan_desc->channel_length = (int) (2*chan_desc->BW*chan_desc->Td + 1 + 2/(M_PI*M_PI)*log(4*M_PI*chan_desc->BW*chan_desc->Td));
|
||||
chan_desc->channel_length = (int) (2*chan_desc->sampling_rate*chan_desc->Td + 1 + 2/(M_PI*M_PI)*log(4*M_PI*chan_desc->sampling_rate*chan_desc->Td));
|
||||
sum_amps = 0;
|
||||
chan_desc->amps = (double*) malloc(chan_desc->nb_taps*sizeof(double));
|
||||
|
||||
@@ -403,7 +407,7 @@ channel_desc_t *new_channel_desc_scm(uint8_t nb_tx,
|
||||
case EVA:
|
||||
chan_desc->nb_taps = 9;
|
||||
chan_desc->Td = 2.51;
|
||||
chan_desc->channel_length = (int) (2*chan_desc->BW*chan_desc->Td + 1 + 2/(M_PI*M_PI)*log(4*M_PI*chan_desc->BW*chan_desc->Td));
|
||||
chan_desc->channel_length = (int) (2*chan_desc->sampling_rate*chan_desc->Td + 1 + 2/(M_PI*M_PI)*log(4*M_PI*chan_desc->sampling_rate*chan_desc->Td));
|
||||
sum_amps = 0;
|
||||
chan_desc->amps = (double*) malloc(chan_desc->nb_taps*sizeof(double));
|
||||
|
||||
@@ -457,7 +461,7 @@ channel_desc_t *new_channel_desc_scm(uint8_t nb_tx,
|
||||
case ETU:
|
||||
chan_desc->nb_taps = 9;
|
||||
chan_desc->Td = 5.0;
|
||||
chan_desc->channel_length = (int) (2*chan_desc->BW*chan_desc->Td + 1 + 2/(M_PI*M_PI)*log(4*M_PI*chan_desc->BW*chan_desc->Td));
|
||||
chan_desc->channel_length = (int) (2*chan_desc->sampling_rate*chan_desc->Td + 1 + 2/(M_PI*M_PI)*log(4*M_PI*chan_desc->sampling_rate*chan_desc->Td));
|
||||
sum_amps = 0;
|
||||
chan_desc->amps = (double*) malloc(chan_desc->nb_taps*sizeof(double));
|
||||
|
||||
@@ -511,7 +515,7 @@ channel_desc_t *new_channel_desc_scm(uint8_t nb_tx,
|
||||
case MBSFN:
|
||||
chan_desc->nb_taps = 18;
|
||||
chan_desc->Td = 28.58;
|
||||
chan_desc->channel_length = (int) (2*chan_desc->BW*chan_desc->Td + 1 + 2/(M_PI*M_PI)*log(4*M_PI*chan_desc->BW*chan_desc->Td));
|
||||
chan_desc->channel_length = (int) (2*chan_desc->sampling_rate*chan_desc->Td + 1 + 2/(M_PI*M_PI)*log(4*M_PI*chan_desc->sampling_rate*chan_desc->Td));
|
||||
sum_amps = 0;
|
||||
chan_desc->amps = (double*) malloc(chan_desc->nb_taps*sizeof(double));
|
||||
|
||||
@@ -558,7 +562,7 @@ channel_desc_t *new_channel_desc_scm(uint8_t nb_tx,
|
||||
case Rayleigh8:
|
||||
nb_taps = 8;
|
||||
Td = 0.8;
|
||||
channel_length = (int)11+2*BW*Td;
|
||||
channel_length = (int)11+2*sampling_rate*Td;
|
||||
ricean_factor = 1;
|
||||
aoa = .03;
|
||||
maxDoppler = 0;
|
||||
@@ -572,7 +576,8 @@ channel_desc_t *new_channel_desc_scm(uint8_t nb_tx,
|
||||
NULL,
|
||||
NULL,
|
||||
Td,
|
||||
BW,
|
||||
sampling_rate,
|
||||
channel_bandwidth,
|
||||
ricean_factor,
|
||||
aoa,
|
||||
forgetting_factor,
|
||||
@@ -585,7 +590,7 @@ channel_desc_t *new_channel_desc_scm(uint8_t nb_tx,
|
||||
case Rice8:
|
||||
nb_taps = 8;
|
||||
Td = 0.8;
|
||||
channel_length = (int)11+2*BW*Td;
|
||||
channel_length = (int)11+2*sampling_rate*Td;
|
||||
ricean_factor = 0.1;
|
||||
aoa = .03;
|
||||
maxDoppler = 0;
|
||||
@@ -598,7 +603,8 @@ channel_desc_t *new_channel_desc_scm(uint8_t nb_tx,
|
||||
NULL,
|
||||
NULL,
|
||||
Td,
|
||||
BW,
|
||||
sampling_rate,
|
||||
channel_bandwidth,
|
||||
ricean_factor,
|
||||
aoa,
|
||||
forgetting_factor,
|
||||
@@ -624,7 +630,8 @@ channel_desc_t *new_channel_desc_scm(uint8_t nb_tx,
|
||||
NULL,
|
||||
NULL,
|
||||
Td,
|
||||
BW,
|
||||
sampling_rate,
|
||||
channel_bandwidth,
|
||||
ricean_factor,
|
||||
aoa,
|
||||
forgetting_factor,
|
||||
@@ -650,7 +657,8 @@ channel_desc_t *new_channel_desc_scm(uint8_t nb_tx,
|
||||
NULL,
|
||||
NULL,
|
||||
Td,
|
||||
BW,
|
||||
sampling_rate,
|
||||
channel_bandwidth,
|
||||
ricean_factor,
|
||||
aoa,
|
||||
forgetting_factor,
|
||||
@@ -683,7 +691,8 @@ channel_desc_t *new_channel_desc_scm(uint8_t nb_tx,
|
||||
NULL,
|
||||
R_sqrt_ptr2,
|
||||
Td,
|
||||
BW,
|
||||
sampling_rate,
|
||||
channel_bandwidth,
|
||||
ricean_factor,
|
||||
aoa,
|
||||
forgetting_factor,
|
||||
@@ -716,7 +725,8 @@ channel_desc_t *new_channel_desc_scm(uint8_t nb_tx,
|
||||
NULL,
|
||||
R_sqrt_ptr2,
|
||||
Td,
|
||||
BW,
|
||||
sampling_rate,
|
||||
channel_bandwidth,
|
||||
ricean_factor,
|
||||
aoa,
|
||||
forgetting_factor,
|
||||
@@ -742,7 +752,8 @@ channel_desc_t *new_channel_desc_scm(uint8_t nb_tx,
|
||||
NULL,
|
||||
NULL,
|
||||
Td,
|
||||
BW,
|
||||
sampling_rate,
|
||||
channel_bandwidth,
|
||||
ricean_factor,
|
||||
aoa,
|
||||
forgetting_factor,
|
||||
@@ -768,7 +779,8 @@ channel_desc_t *new_channel_desc_scm(uint8_t nb_tx,
|
||||
NULL,
|
||||
NULL,
|
||||
Td,
|
||||
BW,
|
||||
sampling_rate,
|
||||
channel_bandwidth,
|
||||
ricean_factor,
|
||||
aoa,
|
||||
forgetting_factor,
|
||||
@@ -803,7 +815,8 @@ channel_desc_t *new_channel_desc_scm(uint8_t nb_tx,
|
||||
NULL,
|
||||
R_sqrt_ptr2,
|
||||
Td,
|
||||
BW,
|
||||
sampling_rate,
|
||||
channel_bandwidth,
|
||||
ricean_factor,
|
||||
aoa,
|
||||
forgetting_factor,
|
||||
@@ -836,7 +849,8 @@ channel_desc_t *new_channel_desc_scm(uint8_t nb_tx,
|
||||
NULL,
|
||||
R_sqrt_ptr2,
|
||||
Td,
|
||||
BW,
|
||||
sampling_rate,
|
||||
channel_bandwidth,
|
||||
ricean_factor,
|
||||
aoa,
|
||||
forgetting_factor,
|
||||
@@ -985,11 +999,11 @@ int random_channel(channel_desc_t *desc, uint8_t abstraction_flag)
|
||||
desc->ch[aarx+(aatx*desc->nb_rx)][k].y = 0.0;
|
||||
|
||||
for (l=0; l<desc->nb_taps; l++) {
|
||||
if ((k - (desc->delays[l]*desc->BW) - NB_SAMPLES_CHANNEL_OFFSET) == 0)
|
||||
if ((k - (desc->delays[l]*desc->sampling_rate) - NB_SAMPLES_CHANNEL_OFFSET) == 0)
|
||||
s = 1.0;
|
||||
else
|
||||
s = sin(M_PI*(k - (desc->delays[l]*desc->BW) - NB_SAMPLES_CHANNEL_OFFSET))/
|
||||
(M_PI*(k - (desc->delays[l]*desc->BW) - NB_SAMPLES_CHANNEL_OFFSET));
|
||||
s = sin(M_PI*(k - (desc->delays[l]*desc->sampling_rate) - NB_SAMPLES_CHANNEL_OFFSET))/
|
||||
(M_PI*(k - (desc->delays[l]*desc->sampling_rate) - NB_SAMPLES_CHANNEL_OFFSET));
|
||||
|
||||
desc->ch[aarx+(aatx*desc->nb_rx)][k].x += s*desc->a[l][aarx+(aatx*desc->nb_rx)].x;
|
||||
desc->ch[aarx+(aatx*desc->nb_rx)][k].y += s*desc->a[l][aarx+(aatx*desc->nb_rx)].y;
|
||||
@@ -1014,22 +1028,77 @@ int random_channel(channel_desc_t *desc, uint8_t abstraction_flag)
|
||||
return (0);
|
||||
}
|
||||
|
||||
double N_RB2sampling_rate(uint16_t N_RB)
|
||||
{
|
||||
double sampling_rate;
|
||||
switch (N_RB) {
|
||||
case 6:
|
||||
sampling_rate = 1.92;
|
||||
break;
|
||||
|
||||
case 25:
|
||||
sampling_rate = 7.68;
|
||||
break;
|
||||
|
||||
case 50:
|
||||
sampling_rate = 15.36;
|
||||
break;
|
||||
|
||||
case 100:
|
||||
sampling_rate = 30.72;
|
||||
break;
|
||||
|
||||
default:
|
||||
LOG_E(PHY,"Unknown N_PRB\n");
|
||||
return(-1);
|
||||
}
|
||||
|
||||
return(sampling_rate);
|
||||
}
|
||||
|
||||
double N_RB2channel_bandwidth(uint16_t N_RB)
|
||||
{
|
||||
double channel_bandwidth;
|
||||
switch (N_RB) {
|
||||
case 6:
|
||||
channel_bandwidth = 1.25;
|
||||
break;
|
||||
|
||||
case 25:
|
||||
channel_bandwidth = 5.00;
|
||||
break;
|
||||
|
||||
case 50:
|
||||
channel_bandwidth = 10.00;
|
||||
break;
|
||||
|
||||
case 100:
|
||||
channel_bandwidth = 20.00;
|
||||
break;
|
||||
|
||||
default:
|
||||
LOG_E(PHY,"Unknown N_PRB\n");
|
||||
return(-1);
|
||||
}
|
||||
return(channel_bandwidth);
|
||||
}
|
||||
|
||||
#ifdef RANDOM_CHANNEL_MAIN
|
||||
#define BW 5.0
|
||||
#define sampling_rate 5.0
|
||||
#define Td 2.0
|
||||
main(int argc,char **argv)
|
||||
{
|
||||
|
||||
double amps[8] = {.8,.2,.1,.04,.02,.01,.005};
|
||||
struct complex ch[(int)(1+2*BW*Td)],phase;
|
||||
struct complex ch[(int)(1+2*sampling_rate*Td)],phase;
|
||||
int i;
|
||||
|
||||
randominit();
|
||||
phase.x = 1.0;
|
||||
phase.y = 0;
|
||||
random_channel(amps,Td, 8,BW,ch,(double)1.0,&phase);
|
||||
random_channel(amps,Td, 8,sampling_rate,ch,(double)1.0,&phase);
|
||||
/*
|
||||
for (i=0;i<(11+2*BW*Td);i++){
|
||||
for (i=0;i<(11+2*sampling_rate*Td);i++){
|
||||
printf("%f + sqrt(-1)*%f\n",ch[i].x,ch[i].y);
|
||||
}
|
||||
*/
|
||||
|
||||
@@ -163,7 +163,13 @@ typedef uint32_t mbms_session_id_t;
|
||||
typedef uint16_t mbms_service_id_t;
|
||||
typedef uint16_t rnti_t;
|
||||
typedef uint8_t rrc_enb_index_t;
|
||||
typedef uint8_t mme_code_t;
|
||||
typedef uint32_t m_tmsi_t;
|
||||
|
||||
//Random UE identity length = 40 bits
|
||||
#if ! defined(NOT_A_RANDOM_UE_IDENTITY)
|
||||
#define NOT_A_RANDOM_UE_IDENTITY (uint64_t)0xFFFFFFFF
|
||||
#endif
|
||||
#if ! defined(NOT_A_RNTI)
|
||||
#define NOT_A_RNTI (rnti_t)0
|
||||
#endif
|
||||
|
||||
@@ -170,6 +170,14 @@
|
||||
#define ENB_CONFIG_STRING_ENB_IPV4_ADDR_FOR_S1U "ENB_IPV4_ADDRESS_FOR_S1U"
|
||||
#define ENB_CONFIG_STRING_ENB_PORT_FOR_S1U "ENB_PORT_FOR_S1U"
|
||||
|
||||
#define ENB_CONFIG_STRING_RRH_GW_CONFIG "rrh_gw_config"
|
||||
#define ENB_CONFIG_STRING_RRH_GW_LOCAL_IF_NAME "local_if_name"
|
||||
#define ENB_CONFIG_STRING_RRH_GW_LOCAL_ADDRESS "local_address"
|
||||
#define ENB_CONFIG_STRING_RRH_GW_REMOTE_ADDRESS "remote_address"
|
||||
#define ENB_CONFIG_STRING_RRH_GW_LOCAL_PORT "local_port"
|
||||
#define ENB_CONFIG_STRING_RRH_GW_REMOTE_PORT "remote_port"
|
||||
#define ENB_CONFIG_STRING_RRH_GW_ACTIVE "active"
|
||||
#define ENB_CONFIG_STRING_RRH_GW_PREFERENCE "preference"
|
||||
|
||||
#define ENB_CONFIG_STRING_ASN1_VERBOSITY "Asn1_verbosity"
|
||||
#define ENB_CONFIG_STRING_ASN1_VERBOSITY_NONE "none"
|
||||
@@ -274,6 +282,18 @@ static void enb_config_display(void)
|
||||
} else {
|
||||
printf( "\tMNC: \t%02"PRIu16":\n",enb_properties.properties[i]->mnc);
|
||||
}
|
||||
|
||||
for (j=0; j< enb_properties.properties[i]->nb_rrh_gw; j++) {
|
||||
if (enb_properties.properties[i]->rrh_gw_config[j].active == 1 ){
|
||||
printf( "\n\tRRH GW %d config for eNB %u:\n\n", j, i);
|
||||
printf( "\tinterface name : \t%s:\n",enb_properties.properties[i]->rrh_gw_if_name);
|
||||
printf( "\tlocal address : \t%s:\n",enb_properties.properties[i]->rrh_gw_config[j].local_address);
|
||||
printf( "\tlocal port : \t%d:\n",enb_properties.properties[i]->rrh_gw_config[j].local_port);
|
||||
printf( "\tremote address : \t%s:\n",enb_properties.properties[i]->rrh_gw_config[j].remote_address);
|
||||
printf( "\tremote port : \t%d:\n",enb_properties.properties[i]->rrh_gw_config[j].remote_port);
|
||||
printf( "\ttransport : \t%s Ethernet:\n\n",(enb_properties.properties[i]->rrh_gw_config[j].raw == 1)? "RAW" : "UDP");
|
||||
}
|
||||
}
|
||||
|
||||
for (j=0; j< enb_properties.properties[i]->nb_cc; j++) {
|
||||
printf( "\teutra band for CC %d: \t%"PRId16":\n",j,enb_properties.properties[i]->eutra_band[j]);
|
||||
@@ -455,6 +475,8 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP)
|
||||
config_setting_t *setting_srb1 = NULL;
|
||||
config_setting_t *setting_mme_addresses = NULL;
|
||||
config_setting_t *setting_mme_address = NULL;
|
||||
config_setting_t *setting_rrh_gws = NULL;
|
||||
config_setting_t *setting_rrh_gw = NULL;
|
||||
config_setting_t *setting_enb = NULL;
|
||||
config_setting_t *setting_otg = NULL;
|
||||
config_setting_t *subsetting_otg = NULL;
|
||||
@@ -462,6 +484,7 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP)
|
||||
int enb_properties_index = 0;
|
||||
int num_enbs = 0;
|
||||
int num_mme_address = 0;
|
||||
int num_rrh_gw = 0;
|
||||
int num_otg_elements =0;
|
||||
int num_component_carriers =0;
|
||||
int i = 0;
|
||||
@@ -558,10 +581,15 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP)
|
||||
|
||||
libconfig_int my_int;
|
||||
|
||||
|
||||
char* if_name = NULL;
|
||||
char* ipv4 = NULL;
|
||||
char* ipv4_remote = NULL;
|
||||
char* ipv6 = NULL;
|
||||
char* active = NULL;
|
||||
char* preference = NULL;
|
||||
libconfig_int local_port = 0;
|
||||
libconfig_int remote_port = 0;
|
||||
const char* active_enb[MAX_ENB];
|
||||
char* enb_interface_name_for_S1U = NULL;
|
||||
char* enb_ipv4_address_for_S1U = NULL;
|
||||
@@ -2136,6 +2164,63 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP)
|
||||
enb_properties.properties[enb_properties_index]->mme_ip_address[j].ipv6 = 1;
|
||||
}
|
||||
}
|
||||
// RRH Config
|
||||
setting_rrh_gws = config_setting_get_member (setting_enb, ENB_CONFIG_STRING_RRH_GW_CONFIG);
|
||||
if ( setting_rrh_gws != NULL) {
|
||||
num_rrh_gw = config_setting_length(setting_rrh_gws);
|
||||
enb_properties.properties[enb_properties_index]->nb_rrh_gw = 0;
|
||||
|
||||
for (j = 0; j < num_rrh_gw; j++) {
|
||||
setting_rrh_gw = config_setting_get_elem(setting_rrh_gws, j);
|
||||
|
||||
if ( !(
|
||||
config_setting_lookup_string(setting_rrh_gw, ENB_CONFIG_STRING_RRH_GW_LOCAL_IF_NAME, (const char **)&if_name)
|
||||
&& config_setting_lookup_string(setting_rrh_gw, ENB_CONFIG_STRING_RRH_GW_LOCAL_ADDRESS, (const char **)&ipv4)
|
||||
&& config_setting_lookup_string(setting_rrh_gw, ENB_CONFIG_STRING_RRH_GW_REMOTE_ADDRESS , (const char **)&ipv4_remote)
|
||||
&& config_setting_lookup_int(setting_rrh_gw, ENB_CONFIG_STRING_RRH_GW_LOCAL_PORT, &local_port)
|
||||
&& config_setting_lookup_int(setting_rrh_gw, ENB_CONFIG_STRING_RRH_GW_REMOTE_PORT, &remote_port)
|
||||
&& config_setting_lookup_string(setting_rrh_gw, ENB_CONFIG_STRING_RRH_GW_ACTIVE, (const char **)&active)
|
||||
&& config_setting_lookup_string(setting_rrh_gw, ENB_CONFIG_STRING_RRH_GW_PREFERENCE, (const char **)&preference)
|
||||
)
|
||||
) {
|
||||
AssertError (0, parse_errors ++,
|
||||
"Failed to parse eNB configuration file %s, %u th enb %u the RRH GW address !\n",
|
||||
lib_config_file_name_pP, i, j);
|
||||
continue; // FIXME will prevent segfaults below, not sure what happens at function exit...
|
||||
}
|
||||
|
||||
enb_properties.properties[enb_properties_index]->nb_rrh_gw += 1;
|
||||
|
||||
enb_properties.properties[enb_properties_index]->rrh_gw_if_name = strdup(if_name);
|
||||
enb_properties.properties[enb_properties_index]->rrh_gw_config[j].local_address = strdup(ipv4);
|
||||
enb_properties.properties[enb_properties_index]->rrh_gw_config[j].remote_address = strdup(ipv4_remote);
|
||||
enb_properties.properties[enb_properties_index]->rrh_gw_config[j].local_port= local_port;
|
||||
enb_properties.properties[enb_properties_index]->rrh_gw_config[j].remote_port= remote_port;
|
||||
|
||||
if (strcmp(active, "yes") == 0) {
|
||||
enb_properties.properties[enb_properties_index]->rrh_gw_config[j].active = 1;
|
||||
}
|
||||
|
||||
if (strcmp(preference, "udp") == 0) {
|
||||
enb_properties.properties[enb_properties_index]->rrh_gw_config[j].udp = 1;
|
||||
} else if (strcmp(preference, "raw") == 0) {
|
||||
enb_properties.properties[enb_properties_index]->rrh_gw_config[j].raw = 1;
|
||||
} else {//if (strcmp(preference, "no") == 0)
|
||||
enb_properties.properties[enb_properties_index]->rrh_gw_config[j].udp = 1;
|
||||
enb_properties.properties[enb_properties_index]->rrh_gw_config[j].raw = 1;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
enb_properties.properties[enb_properties_index]->nb_rrh_gw = 0;
|
||||
enb_properties.properties[enb_properties_index]->rrh_gw_if_name = "none";
|
||||
enb_properties.properties[enb_properties_index]->rrh_gw_config[j].local_address = "0.0.0.0";
|
||||
enb_properties.properties[enb_properties_index]->rrh_gw_config[j].remote_address = "0.0.0.0";
|
||||
enb_properties.properties[enb_properties_index]->rrh_gw_config[j].local_port= 0;
|
||||
enb_properties.properties[enb_properties_index]->rrh_gw_config[j].remote_port= 0;
|
||||
enb_properties.properties[enb_properties_index]->rrh_gw_config[j].active = 0;
|
||||
enb_properties.properties[enb_properties_index]->rrh_gw_config[j].udp = 0;
|
||||
enb_properties.properties[enb_properties_index]->rrh_gw_config[j].raw = 0;
|
||||
}
|
||||
|
||||
// SCTP SETTING
|
||||
enb_properties.properties[enb_properties_index]->sctp_out_streams = SCTP_OUT_STREAMS;
|
||||
|
||||
@@ -78,6 +78,17 @@ typedef struct mme_ip_address_s {
|
||||
char *ipv6_address;
|
||||
} mme_ip_address_t;
|
||||
|
||||
typedef struct rrh_gw_config_s {
|
||||
unsigned udp:1;
|
||||
unsigned raw:1;
|
||||
unsigned active:1;
|
||||
char *local_address;
|
||||
char *remote_address;
|
||||
uint16_t local_port;
|
||||
uint16_t remote_port;
|
||||
|
||||
} rrh_gw_config_t;
|
||||
|
||||
typedef struct Enb_properties_s {
|
||||
/* Unique eNB_id to identify the eNB within EPC.
|
||||
* For macro eNB ids this field should be 20 bits long.
|
||||
@@ -203,6 +214,13 @@ typedef struct Enb_properties_s {
|
||||
char *enb_interface_name_for_S1_MME;
|
||||
in_addr_t enb_ipv4_address_for_S1_MME;
|
||||
|
||||
|
||||
/* Nb of RRH to connect to */
|
||||
uint8_t nb_rrh_gw;
|
||||
char *rrh_gw_if_name;
|
||||
/* List of MME to connect to */
|
||||
rrh_gw_config_t rrh_gw_config[4];
|
||||
|
||||
// otg config
|
||||
/* Nb of OTG elements */
|
||||
uint8_t num_otg_elements;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user