Merge branch 'develop' into bugfix-51-mscgen
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
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_repo=`git config --get remote.origin.url`
|
||||
- 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 -5GRepo $git_repo -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 -5GRepo $git_repo -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
|
||||
+257
-67
@@ -36,12 +36,16 @@ set (OPENAIR1_DIR ${OPENAIR_DIR}/openair1)
|
||||
set (OPENAIR2_DIR ${OPENAIR_DIR}/openair2)
|
||||
set (OPENAIR3_DIR ${OPENAIR_DIR}/openair3)
|
||||
set (OPENAIR_TARGETS ${OPENAIR_DIR}/targets)
|
||||
set (OPENAIR3_DIR ${OPENAIR_DIR}/openair3)
|
||||
set (OPENAIR3_DIR ${OPENAIR_DIR}/openair3)
|
||||
set (OPENAIR_CMAKE ${OPENAIR_DIR}/cmake_targets)
|
||||
set (OPENAIR_BIN_DIR ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY})
|
||||
|
||||
project (OpenAirInterface)
|
||||
|
||||
add_subdirectory(${OPENAIR_TARGETS}/ARCH/LMSSDR/USERSPACE/LIB/lms7002m lms7002m)
|
||||
add_subdirectory(${OPENAIR_TARGETS}/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR lmsSDR)
|
||||
add_subdirectory(${OPENAIR_TARGETS}/ARCH/LMSSDR/USERSPACE/LIB/Si5351C Si5351C)
|
||||
|
||||
###########################################
|
||||
# macros to define options as there is numerous options in oai
|
||||
################################################
|
||||
@@ -133,9 +137,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()
|
||||
@@ -149,8 +150,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()
|
||||
|
||||
@@ -162,49 +163,78 @@ set(CMAKE_C_FLAGS
|
||||
"${CMAKE_C_FLAGS} -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_FCNTL_H=1 -DHAVE_ARPA_INET_H=1 -DHAVE_SYS_TIME_H=1 -DHAVE_SYS_SOCKET_H=1 -DHAVE_STRERROR=1 -DHAVE_SOCKET=1 -DHAVE_MEMSET=1 -DHAVE_GETTIMEOFDAY=1 -DHAVE_STDLIB_H=1 -DHAVE_MALLOC=1 -DHAVE_LIBSCTP"
|
||||
)
|
||||
set(CMAKE_CXX_FLAGS
|
||||
"${CMAKE_CXX_FLAGS} ${C_FLAGS_PROCESSOR}"
|
||||
"${CMAKE_CXX_FLAGS} ${C_FLAGS_PROCESSOR} -std=c++11 "
|
||||
)
|
||||
|
||||
|
||||
#########################
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-rpath -Wl,${OPENAIR_TARGETS}/bin")
|
||||
#########################
|
||||
# set a flag for changes in the source code
|
||||
# these changes are related to hardcoded path to include .h files
|
||||
add_definitions(-DCMAKER)
|
||||
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS} -g -DMALLOC_CHECK_=3")
|
||||
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS} -g -DMALLOC_CHECK_=3 -O2")
|
||||
|
||||
# Below has been put in comment because does not work with
|
||||
# SVN authentication.
|
||||
#
|
||||
#find_package(Subversion)
|
||||
#if(SUBVERSION_FOUND)
|
||||
# Subversion_WC_INFO(${OPENAIR_DIR} openair)
|
||||
# set (FIRMWARE_VERSION "${openair_WC_REVISION} - ${openair_WC_LAST_CHANGED_DATE}")
|
||||
# Subversion_WC_LOG(${OPENAIR_DIR} Project)
|
||||
#else()
|
||||
# set (FIRMWARE_VERSION "No svn information")
|
||||
#endif()
|
||||
#add_definitions("-DFIRMWARE_VERSION=\"${FIRMWARE_VERSION}\"")
|
||||
|
||||
set(GIT_BRANCH "UNKNOWN")
|
||||
set(GIT_COMMIT_HASH "UNKNOWN")
|
||||
set(GIT_COMMIT_DATE "UNKNOWN")
|
||||
|
||||
|
||||
find_package(Git)
|
||||
if(GIT_FOUND)
|
||||
message("git found: ${GIT_EXECUTABLE}")
|
||||
# Get the current working branch
|
||||
execute_process(
|
||||
COMMAND git rev-parse --abbrev-ref HEAD
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
OUTPUT_VARIABLE GIT_BRANCH
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
|
||||
# Get the latest abbreviated commit hash of the working branch
|
||||
execute_process(
|
||||
COMMAND git log -1 --format=%h
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
OUTPUT_VARIABLE GIT_COMMIT_HASH
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
|
||||
# Get the latest commit date of the working branch
|
||||
execute_process(
|
||||
COMMAND git log -1 --format=%cd
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
OUTPUT_VARIABLE GIT_COMMIT_DATE
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
endif()
|
||||
|
||||
|
||||
# Below is a hard-coded info
|
||||
set (FIRMWARE_VERSION "No svn information")
|
||||
add_definitions("-DFIRMWARE_VERSION=\"${FIRMWARE_VERSION}\"")
|
||||
add_definitions("-DPACKAGE_VERSION=\"${FIRMWARE_VERSION}\"")
|
||||
add_definitions("-DPACKAGE_BUGREPORT=\"OpenAirInterface web site\"")
|
||||
add_definitions("-DPACKAGE_VERSION=\"Branch: ${GIT_BRANCH} Abrev. Hash: ${GIT_COMMIT_HASH} Date: ${GIT_COMMIT_DATE}\"")
|
||||
add_definitions("-DPACKAGE_BUGREPORT=\"openair4g-devel@lists.eurecom.fr\"")
|
||||
|
||||
|
||||
|
||||
# Debug related options
|
||||
#########################################
|
||||
add_boolean_option(MSG_PRINT False "print debug messages")
|
||||
add_boolean_option(DISABLE_XER_PRINT False "print XER Format")
|
||||
add_boolean_option(XER_PRINT False "print XER Format")
|
||||
add_boolean_option(RRC_MSG_PRINT False "print RRC messages")
|
||||
add_boolean_option(PDCP_MSG_PRINT False "print PDCP messages to /tmp/pdcp.log")
|
||||
add_boolean_option(DEBUG_PDCP_PAYLOAD False "print PDCP PDU to stdout") # if true, make sure that global and PDCP log levels are trace
|
||||
add_boolean_option(ASN_DEBUG False "ASN1 coder/decoder Debug")
|
||||
add_boolean_option(EMIT_ASN_DEBUG False "ASN1 coder/decoder Debug")
|
||||
add_boolean_option(MSG_PRINT False "print debug messages")
|
||||
add_boolean_option(DISABLE_XER_PRINT False "print XER Format")
|
||||
add_boolean_option(XER_PRINT False "print XER Format")
|
||||
add_boolean_option(RRC_MSG_PRINT False "print RRC messages")
|
||||
add_boolean_option(PDCP_MSG_PRINT False "print PDCP messages to /tmp/pdcp.log")
|
||||
add_boolean_option(DEBUG_PDCP_PAYLOAD False "print PDCP PDU to stdout") # if true, make sure that global and PDCP log levels are trace
|
||||
add_boolean_option(DEBUG_MAC_INTERFACE False "print MAC-RLC PDU exchange to stdout") # if true, make sure that global and PDCP log levels are trace
|
||||
add_boolean_option(TRACE_RLC_PAYLOAD False "print RLC PDU to stdout") # if true, make sure that global and PDCP log levels are trace
|
||||
add_boolean_option(TEST_OMG False "???")
|
||||
add_boolean_option(DEBUG_OMG False "???")
|
||||
add_boolean_option(XFORMS False "This adds the possibility to see the signal oscilloscope")
|
||||
add_boolean_option(PRINT_STATS False "This adds the possibility to see the status")
|
||||
add_boolean_option(TRACE_RLC_PAYLOAD False "print RLC PDU to stdout") # if true, make sure that global and PDCP log levels are trace
|
||||
add_boolean_option(TEST_OMG False "???")
|
||||
add_boolean_option(DEBUG_OMG False "???")
|
||||
add_boolean_option(XFORMS False "This adds the possibility to see the signal oscilloscope")
|
||||
add_boolean_option(PRINT_STATS False "This adds the possibility to see the status")
|
||||
|
||||
add_boolean_option(DEBUG_CONSOLE False "makes debugging easier, disables stdout/stderr buffering")
|
||||
|
||||
@@ -245,8 +275,12 @@ endif (${RTAI})
|
||||
# New C code source file, cmake must be re-run (instead of re-running make only)
|
||||
#############
|
||||
set(asn1c_call "${OPENAIR_CMAKE}/tools/generate_asn1")
|
||||
set(fix_asn1c_call "${OPENAIR_CMAKE}/tools/fix_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")
|
||||
@@ -263,7 +297,19 @@ set (RRC_FULL_DIR ${asn1_generated_dir}/${RRC_ASN1_VERSION})
|
||||
if(NOT EXISTS ${asn1c_call})
|
||||
message( FATAL_ERROR "The script ${asn1c_call} must be present" )
|
||||
endif(NOT EXISTS ${asn1c_call})
|
||||
execute_process(COMMAND ${asn1c_call} ${RRC_FULL_DIR} ${RRC_GRAMMAR})
|
||||
execute_process(COMMAND ${asn1c_call} ${RRC_FULL_DIR} ${RRC_GRAMMAR}
|
||||
RESULT_VARIABLE ret)
|
||||
if (NOT ${ret} STREQUAL 0)
|
||||
message(FATAL_ERROR "${asn1c_call}: error")
|
||||
endif (NOT ${ret} STREQUAL 0)
|
||||
if(NOT EXISTS ${fix_asn1c_call})
|
||||
message( FATAL_ERROR "The script ${fix_asn1c_call} must be present" )
|
||||
endif(NOT EXISTS ${fix_asn1c_call})
|
||||
execute_process(COMMAND ${fix_asn1c_call} ${RRC_FULL_DIR} RRC ${RRC_ASN1_VERSION}
|
||||
RESULT_VARIABLE ret)
|
||||
if (NOT ${ret} STREQUAL 0)
|
||||
message(FATAL_ERROR "${fix_asn1c_call}: error")
|
||||
endif (NOT ${ret} STREQUAL 0)
|
||||
file(GLOB rrc_source ${RRC_FULL_DIR}/*.c)
|
||||
set(rrc_source ${rrc_source} ${OPENAIR2_DIR}/RRC/LITE/MESSAGES/asn1_msg.c)
|
||||
file(GLOB rrc_h ${RRC_FULL_DIR}/*.h)
|
||||
@@ -277,6 +323,7 @@ include_directories ("${RRC_FULL_DIR}")
|
||||
add_custom_command (
|
||||
OUTPUT ${RRC_FULL_DIR}/asn1_constants.h
|
||||
COMMAND ${asn1c_call} ${RRC_FULL_DIR} ${RRC_GRAMMAR}
|
||||
COMMAND ${fix_asn1c_call} ${RRC_FULL_DIR} RRC ${RRC_ASN1_VERSION}
|
||||
DEPENDS ${RRC_GRAMMAR}
|
||||
)
|
||||
|
||||
@@ -305,13 +352,28 @@ set(S1AP_ASN_FILES
|
||||
)
|
||||
set(S1AP_C_DIR ${asn1_generated_dir}/${ASN1RELDIR})
|
||||
#message("calling ${asn1c_call} ${S1AP_C_DIR} ${S1AP_ASN_FILES}")
|
||||
execute_process(COMMAND ${asn1c_call} ${S1AP_C_DIR} ${S1AP_ASN_FILES})
|
||||
execute_process(COMMAND ${asn1c_call} ${S1AP_C_DIR} ${S1AP_ASN_FILES}
|
||||
RESULT_VARIABLE ret)
|
||||
if (NOT ${ret} STREQUAL 0)
|
||||
message(FATAL_ERROR "${asn1c_call}: error")
|
||||
endif (NOT ${ret} STREQUAL 0)
|
||||
execute_process(COMMAND python ${S1AP_DIR}/MESSAGES/ASN1/asn1tostruct.py -f${S1AP_ASN_DIR}/S1AP-PDU-Contents.asn -o${S1AP_C_DIR}
|
||||
RESULT_VARIABLE ret)
|
||||
if (NOT ${ret} STREQUAL 0)
|
||||
message(FATAL_ERROR "asn1tostruct.py: error")
|
||||
endif (NOT ${ret} STREQUAL 0)
|
||||
execute_process(COMMAND ${fix_asn1c_call} ${S1AP_C_DIR} S1AP ${S1AP_VERSION}
|
||||
RESULT_VARIABLE ret)
|
||||
if (NOT ${ret} STREQUAL 0)
|
||||
message(FATAL_ERROR "${fix_asn1c_call}: error")
|
||||
endif (NOT ${ret} STREQUAL 0)
|
||||
file(GLOB S1AP_source ${S1AP_C_DIR}/*.c)
|
||||
|
||||
set(S1AP_OAI_generated
|
||||
${S1AP_C_DIR}/s1ap_decoder.c
|
||||
${S1AP_C_DIR}/s1ap_encoder.c
|
||||
${S1AP_C_DIR}/s1ap_xer_print.c
|
||||
${S1AP_C_DIR}/s1ap_compare.c
|
||||
${S1AP_C_DIR}/s1ap_ies_defs.h
|
||||
)
|
||||
file(GLOB s1ap_h ${S1AP_C_DIR}/*.h)
|
||||
@@ -321,6 +383,7 @@ add_custom_command (
|
||||
OUTPUT ${S1AP_OAI_generated}
|
||||
COMMAND ${asn1c_call} ${S1AP_C_DIR} ${S1AP_ASN_FILES}
|
||||
COMMAND python ${S1AP_DIR}/MESSAGES/ASN1/asn1tostruct.py -f${S1AP_ASN_DIR}/S1AP-PDU-Contents.asn -o${S1AP_C_DIR}
|
||||
COMMAND ${fix_asn1c_call} ${S1AP_C_DIR} S1AP ${S1AP_VERSION}
|
||||
DEPENDS ${S1AP_ASN_FILES}
|
||||
)
|
||||
add_library(S1AP_LIB
|
||||
@@ -372,7 +435,21 @@ set(X2AP_ASN_FILES
|
||||
|
||||
set(X2AP_C_DIR ${asn1_generated_dir}/${ASN1RELDIR})
|
||||
#message("calling ${asn1c_call} ${X2AP_C_DIR} ${X2AP_ASN_FILES}")
|
||||
execute_process(COMMAND ${asn1c_call} ${X2AP_C_DIR} ${X2AP_ASN_FILES})
|
||||
execute_process(COMMAND ${asn1c_call} ${X2AP_C_DIR} ${X2AP_ASN_FILES}
|
||||
RESULT_VARIABLE ret)
|
||||
if (NOT ${ret} STREQUAL 0)
|
||||
message(FATAL_ERROR "${asn1c_call}: error")
|
||||
endif (NOT ${ret} STREQUAL 0)
|
||||
execute_process(COMMAND python ${X2AP_DIR}/MESSAGES/ASN1/asn1tostruct.py -f ${X2AP_ASN_DIR}/X2AP-PDU-Contents.asn -o ${X2AP_C_DIR}
|
||||
RESULT_VARIABLE ret)
|
||||
if (NOT ${ret} STREQUAL 0)
|
||||
message(FATAL_ERROR "asn1tostruct.py: error")
|
||||
endif (NOT ${ret} STREQUAL 0)
|
||||
execute_process(COMMAND ${fix_asn1c_call} ${X2AP_C_DIR} X2AP ${X2AP_VERSION}
|
||||
RESULT_VARIABLE ret)
|
||||
if (NOT ${ret} STREQUAL 0)
|
||||
message(FATAL_ERROR "${fix_asn1c_call}: error")
|
||||
endif (NOT ${ret} STREQUAL 0)
|
||||
file(GLOB X2AP_source ${X2AP_C_DIR}/*.c)
|
||||
|
||||
set(X2AP_OAI_generated
|
||||
@@ -389,6 +466,7 @@ add_custom_command (
|
||||
OUTPUT ${X2AP_OAI_generated}
|
||||
COMMAND ${asn1c_call} ${X2AP_C_DIR} ${X2AP_ASN_FILES}
|
||||
COMMAND python ${X2AP_DIR}/MESSAGES/ASN1/asn1tostruct.py -f ${X2AP_ASN_DIR}/X2AP-PDU-Contents.asn -o ${X2AP_C_DIR}
|
||||
COMMAND ${fix_asn1c_call} ${X2AP_C_DIR} X2AP ${X2AP_VERSION}
|
||||
DEPENDS ${X2AP_ASN_FILES}
|
||||
)
|
||||
|
||||
@@ -407,8 +485,55 @@ add_list1_option(NB_ANTENNAS_RX "2" "Number of antennas in reception" "1" "2" "4
|
||||
add_list1_option(NB_ANTENNAS_TX "2" "Number of antennas in transmission" "1" "2" "4")
|
||||
add_list1_option(NB_ANTENNAS_TXRX "2" "Number of antennas in ????" "1" "2" "4")
|
||||
|
||||
add_list2_option(RF_BOARD "EXMIMO" "RF head type" "False" "EXMIMO" "OAI_USRP" "ETHERNET" "OAI_BLADERF" "CPRIGW")
|
||||
add_list2_option(RF_BOARD "EXMIMO" "RF head type" "None" "EXMIMO" "OAI_USRP" "OAI_BLADERF" "CPRIGW" "OAI_LMSSDR")
|
||||
|
||||
add_list2_option(TRANSP_PRO "None" "Transport protocol type" "None" "ETHERNET")
|
||||
|
||||
|
||||
# include RF devices / transport protocols library modules
|
||||
######################################################################
|
||||
|
||||
include_directories("${OPENAIR_TARGETS}/ARCH/EXMIMO/USERSPACE/LIB/")
|
||||
include_directories ("${OPENAIR_TARGETS}/ARCH/EXMIMO/DEFS/")
|
||||
#set (option_HWEXMIMOLIB_lib "-l ")
|
||||
set(HWLIB_EXMIMO_SOURCE
|
||||
${OPENAIR_TARGETS}/ARCH/EXMIMO/USERSPACE/LIB/openair0_lib.c
|
||||
${OPENAIR_TARGETS}/ARCH/EXMIMO/USERSPACE/LIB/gain_control.c
|
||||
)
|
||||
add_library(oai_exmimodevif MODULE ${HWLIB_EXMIMO_SOURCE} )
|
||||
|
||||
include_directories("${OPENAIR_TARGETS}/ARCH/USRP/USERSPACE/LIB/")
|
||||
set (option_HWUSRPLIB_lib "-l uhd")
|
||||
set(HWLIB_USRP_SOURCE
|
||||
${OPENAIR_TARGETS}/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp
|
||||
)
|
||||
add_library(oai_usrpdevif MODULE ${HWLIB_USRP_SOURCE} )
|
||||
|
||||
include_directories("${OPENAIR_TARGETS}/ARCH/BLADERF/USERSPACE/LIB/")
|
||||
set (option_HWBLADERFLIB_lib "-l bladerf")
|
||||
set(HWLIB_BLADERF_SOURCE
|
||||
${OPENAIR_TARGETS}/ARCH/BLADERF/USERSPACE/LIB/bladerf_lib.c
|
||||
)
|
||||
add_library(oai_bladerfdevif MODULE ${HWLIB_BLADERF_SOURCE} )
|
||||
|
||||
include_directories("${OPENAIR_TARGETS}/ARCH/LMSSDR/USERSPACE/LIB/")
|
||||
set (option_HWLMSSDRLIB_lib "-l LMS_SDR -l LMS7002M -l Si5351C")
|
||||
set(HWLIB_LMSSDR_SOURCE
|
||||
${OPENAIR_TARGETS}/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp
|
||||
)
|
||||
add_library(oai_lmssdrdevif MODULE ${HWLIB_LMSSDR_SOURCE} )
|
||||
|
||||
include_directories("${OPENAIR_TARGETS}/ARCH/ETHERNET/USERSPACE/LIB/")
|
||||
set(TPLIB_ETHERNET_SOURCE
|
||||
${OPENAIR_TARGETS}/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.c
|
||||
${OPENAIR_TARGETS}/ARCH/ETHERNET/USERSPACE/LIB/eth_udp.c
|
||||
${OPENAIR_TARGETS}/ARCH/ETHERNET/USERSPACE/LIB/eth_raw.c
|
||||
)
|
||||
add_library(oai_eth_transpro MODULE ${TPLIB_ETHERNET_SOURCE} )
|
||||
|
||||
|
||||
# RF devices / transport protocols settings
|
||||
######################################################################
|
||||
if (${RF_BOARD} STREQUAL "EXMIMO")
|
||||
set(DRIVER2013)
|
||||
include_directories ("${OPENAIR_TARGETS}/ARCH/EXMIMO/USERSPACE/LIB/")
|
||||
@@ -416,6 +541,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/")
|
||||
@@ -423,8 +549,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/")
|
||||
@@ -434,26 +559,51 @@ elseif (${RF_BOARD} STREQUAL "OAI_BLADERF")
|
||||
${OPENAIR_TARGETS}/ARCH/BLADERF/USERSPACE/LIB/bladerf_lib.c
|
||||
)
|
||||
LINK_DIRECTORIES("/usr/lib/x86_64-linux-gnu")
|
||||
set(option_HW_lib "bladeRF")
|
||||
#set(LOWLATENCY False)
|
||||
|
||||
elseif (${RF_BOARD} STREQUAL "ETHERNET")
|
||||
include_directories ("${OPENAIR_TARGETS}/ARCH/ETHERNET/USERSPACE/LIB")
|
||||
set(HW_SOURCE ${HW_SOURCE}
|
||||
${OPENAIR_TARGETS}/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.c
|
||||
)
|
||||
set(LOWLATENCY True)
|
||||
|
||||
set(option_HW_lib "bladeRF -rdynamic -ldl")
|
||||
#set(LOWLATENCY False)
|
||||
|
||||
elseif (${RF_BOARD} STREQUAL "OAI_LMSSDR")
|
||||
include_directories("${OPENAIR_TARGETS}/ARCH/LMSSDR/USERSPACE/LIB")
|
||||
include_directories("${OPENAIR_TARGETS}/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR")
|
||||
include_directories("${OPENAIR_TARGETS}/ARCH/LMSSDR/USERSPACE/LIB/lms7002m")
|
||||
include_directories("${OPENAIR_TARGETS}/ARCH/LMSSDR/USERSPACE/LIB/Si5351C")
|
||||
include_directories("${OPENAIR_TARGETS}/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/LMS_StreamBoard")
|
||||
LINK_DIRECTORIES("/usr/lib/x86_64-linux-gnu")
|
||||
LINK_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}/lmsSDR")
|
||||
LINK_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}/lms7002m")
|
||||
LINK_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}/Si5351C")
|
||||
set(HW_SOURCE ${HW_SOURCE} ${OPENAIR_TARGETS}/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp)
|
||||
set(LOWLATENCY False)
|
||||
set(option_HW_lib "-lLMS_SDR -lLMS7002M -lSi5351C -rdynamic -ldl")
|
||||
|
||||
elseif (${RF_BOARD} STREQUAL "CPRIGW")
|
||||
set(HW_SOURCE ${HW_SOURCE}
|
||||
${OPENAIR_TARGETS}/ARCH/CPRIGW/USERSPACE/LIB/cprigw_lib.c
|
||||
)
|
||||
include_directories("${OPENAIR_TARGETS}/ARCH/CPRIGW/USERSPACE/LIB/")
|
||||
set(option_HW_lib "-rdynamic dl")
|
||||
set(option_HW_lib "-rdynamic dl")
|
||||
|
||||
endif (${RF_BOARD} STREQUAL "EXMIMO")
|
||||
|
||||
|
||||
if (${TRANSP_PRO} STREQUAL "ETHERNET")
|
||||
|
||||
include_directories ("${OPENAIR_TARGETS}/ARCH/ETHERNET/USERSPACE/LIB")
|
||||
set(TRANSPORT_SOURCE ${TRANSPORT_SOURCE}
|
||||
${OPENAIR_TARGETS}/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.c
|
||||
${OPENAIR_TARGETS}/ARCH/ETHERNET/USERSPACE/LIB/eth_udp.c
|
||||
${OPENAIR_TARGETS}/ARCH/ETHERNET/USERSPACE/LIB/eth_raw.c
|
||||
)
|
||||
set(option_TP_lib "-rdynamic -ldl")
|
||||
|
||||
|
||||
endif (${TRANSP_PRO} STREQUAL "ETHERNET")
|
||||
##########################################################
|
||||
|
||||
include_directories ("${OPENAIR_TARGETS}/ARCH/COMMON")
|
||||
|
||||
Message("LOWLATENCY flag is ${LOWLATENCY}")
|
||||
|
||||
##############################################################
|
||||
# ???!!! TO BE DOCUMENTED OPTIONS !!!???
|
||||
@@ -462,6 +612,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 "???")
|
||||
@@ -475,6 +626,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
|
||||
##########################
|
||||
@@ -845,6 +999,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
|
||||
@@ -999,7 +1154,6 @@ add_library(CN_UTILS
|
||||
${OPENAIR3_DIR}/UTILS/conversions.c
|
||||
${OPENAIR3_DIR}/UTILS/enum_string.c
|
||||
${OPENAIR3_DIR}/UTILS/log.c
|
||||
${OPENAIR3_DIR}/UTILS/mme_config.c
|
||||
${OPENAIR3_DIR}/UTILS/mcc_mnc_itu.c
|
||||
)
|
||||
|
||||
@@ -1340,6 +1494,9 @@ include(FindPkgConfig)
|
||||
pkg_search_module(LIBXML2 libxml-2.0 REQUIRED)
|
||||
include_directories(${LIBXML2_INCLUDE_DIRS})
|
||||
|
||||
pkg_search_module(LIBXSLT libxslt REQUIRED)
|
||||
include_directories(${LIBXSLT_INCLUDE_DIRS})
|
||||
|
||||
pkg_search_module(OPENSSL openssl REQUIRED)
|
||||
include_directories(${OPENSSL_INCLUDE_DIRS})
|
||||
|
||||
@@ -1403,10 +1560,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}
|
||||
@@ -1424,6 +1582,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}
|
||||
@@ -1431,13 +1590,14 @@ add_executable(lte-softmodem
|
||||
|
||||
target_link_libraries (lte-softmodem
|
||||
-Wl,--start-group
|
||||
RRC_LIB S1AP_LIB S1AP_ENB GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB PHY LFDS L2 ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ${ITTI_LIB} ${MIH_LIB}
|
||||
RRC_LIB S1AP_LIB S1AP_ENB GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB PHY LFDS L2 ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ${ITTI_LIB} ${MIH_LIB}
|
||||
-Wl,--end-group )
|
||||
|
||||
|
||||
target_link_libraries (lte-softmodem ${LIBXML2_LIBRARIES})
|
||||
target_link_libraries (lte-softmodem pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} sctp ${option_HW_lib} ${XFORMS_LIBRARIES} )
|
||||
target_link_libraries (lte-softmodem pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} sctp ${option_HW_lib} ${option_TP_lib} ${XFORMS_LIBRARIES} )
|
||||
target_link_libraries (lte-softmodem ${LIBBOOST_LIBRARIES})
|
||||
target_link_libraries (lte-softmodem ${LIB_LMS_LIBRARIES})
|
||||
|
||||
# lte-softmodem-nos1 is both eNB and UE implementation
|
||||
###################################################
|
||||
@@ -1458,6 +1618,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}
|
||||
@@ -1468,38 +1629,43 @@ target_link_libraries (lte-softmodem-nos1
|
||||
-Wl,--end-group )
|
||||
|
||||
target_link_libraries (lte-softmodem-nos1 ${LIBXML2_LIBRARIES})
|
||||
target_link_libraries (lte-softmodem-nos1 pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} ${option_HW_lib} ${XFORMS_LIBRARIES} )
|
||||
target_link_libraries (lte-softmodem-nos1 pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} ${option_HW_lib} ${option_TP_lib} ${XFORMS_LIBRARIES} )
|
||||
target_link_libraries (lte-softmodem-nos1 ${LIBBOOST_LIBRARIES})
|
||||
|
||||
|
||||
target_link_libraries (lte-softmodem-nos1 ${LIB_LMS_LIBRARIES})
|
||||
|
||||
# rrh
|
||||
################################
|
||||
set(DRIVER2013)
|
||||
|
||||
#Note: only on RF type is currently supported for RRH
|
||||
#Note: only one RF type (USRP) is currently supported for RRH
|
||||
add_executable(rrh_gw
|
||||
${OPENAIR_TARGETS}/RT/USER/rrh_gw.c
|
||||
${OPENAIR_TARGETS}/RT/USER/eNB_transport_IQ.c
|
||||
${OPENAIR_TARGETS}/RT/USER/UE_transport_IQ.c
|
||||
${OPENAIR_TARGETS}/RT/USER/rt_wrapper.c
|
||||
${OPENAIR_TARGETS}/ARCH/COMMON/common_lib.c
|
||||
${OPENAIR_TARGETS}/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.c
|
||||
${HW_SOURCE}
|
||||
${TRANSPORT_SOURCE}
|
||||
)
|
||||
# assert and common_lib.h
|
||||
target_include_directories(rrh_gw PRIVATE ${OPENAIR_DIR}/common/utils/itti ${OPENAIR_TARGETS}/ARCH/COMMON ${OPENAIR_TARGETS}/ARCH/ETHERNET/USERSPACE/LIB/ )
|
||||
|
||||
target_include_directories(rrh_gw PRIVATE ${OPENAIR_DIR}/common/utils/itti)
|
||||
target_link_libraries(rrh_gw
|
||||
-Wl,--start-group
|
||||
UTIL LFDS
|
||||
-Wl,--end-group )
|
||||
target_link_libraries (rrh_gw rt pthread m )
|
||||
target_link_libraries (rrh_gw ${option_HW_lib} ${LIBBOOST_LIBRARIES} )
|
||||
target_link_libraries (rrh_gw ${option_HW_lib} ${option_TP_lib} ${LIBBOOST_LIBRARIES} )
|
||||
target_link_libraries (rrh_gw ${LIB_LMS_LIBRARIES})
|
||||
|
||||
#Message("-- default_HW_lib=ETHERNET") # only in case of RRH
|
||||
Message("-- option_HW_lib=${option_HW_lib}")
|
||||
Message("-- HW_SOURCE=${HW_SOURCE}")
|
||||
Message("-- option_TP_lib=${option_TP_lib}")
|
||||
Message("-- TRANSPORT_SOURCE=${TRANSPORT_SOURCE}")
|
||||
|
||||
if (${RF_BOARD} STREQUAL "OAI_LMSSDR")
|
||||
add_dependencies(lte-softmodem LMS7002M LMS_SDR Si5351C)
|
||||
add_dependencies(lte-softmodem-nos1 LMS7002M LMS_SDR Si5351C)
|
||||
add_dependencies(rrh_gw LMS7002M LMS_SDR Si5351C)
|
||||
endif (${RF_BOARD} STREQUAL "OAI_LMSSDR")
|
||||
|
||||
|
||||
|
||||
# USIM process
|
||||
#################
|
||||
@@ -1550,6 +1716,7 @@ add_executable(oaisim
|
||||
${GTPU_need_ITTI}
|
||||
${OPENAIR_TARGETS}/COMMON/create_tasks.c
|
||||
${HW_SOURCE}
|
||||
${TRANSPORT_SOURCE}
|
||||
${XFORMS_SOURCE}
|
||||
)
|
||||
|
||||
@@ -1561,7 +1728,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)
|
||||
@@ -1588,6 +1755,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)
|
||||
@@ -1597,7 +1765,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)
|
||||
@@ -1620,6 +1788,7 @@ endforeach(myExe)
|
||||
|
||||
add_executable(test_epc_generate_scenario
|
||||
${OPENAIR3_DIR}/TEST/EPC_TEST/generate_scenario.c
|
||||
${OPENAIR3_DIR}/TEST/EPC_TEST/generate_scenario.h
|
||||
${OPENAIR2_DIR}/ENB_APP/enb_config.h
|
||||
${OPENAIR2_DIR}/COMMON/commonDef.h
|
||||
${OPENAIR2_DIR}/COMMON/messages_def.h
|
||||
@@ -1628,7 +1797,28 @@ add_executable(test_epc_generate_scenario
|
||||
${OPENAIR_BIN_DIR}/messages_xml.h
|
||||
)
|
||||
target_link_libraries (test_epc_generate_scenario
|
||||
-Wl,--start-group RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB GTPV1U LIB_NAS_UE SECU_CN UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB PHY LFDS ${MSC_LIB} L2 -Wl,--end-group pthread m rt crypt sctp ${LIBXML2_LIBRARIES} ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} ${CONFIG_LIBRARIES}
|
||||
-Wl,--start-group RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB GTPV1U LIB_NAS_UE SECU_CN UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB PHY LFDS ${ITTI_LIB} ${MSC_LIB} L2 -Wl,--end-group pthread m rt crypt sctp ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} ${CONFIG_LIBRARIES}
|
||||
)
|
||||
|
||||
add_executable(test_epc_play_scenario
|
||||
${OPENAIR3_DIR}/TEST/EPC_TEST/play_scenario.c
|
||||
${OPENAIR3_DIR}/TEST/EPC_TEST/play_scenario_decode.c
|
||||
${OPENAIR3_DIR}/TEST/EPC_TEST/play_scenario_display.c
|
||||
${OPENAIR3_DIR}/TEST/EPC_TEST/play_scenario_fsm.c
|
||||
${OPENAIR3_DIR}/TEST/EPC_TEST/play_scenario_parse.c
|
||||
${OPENAIR3_DIR}/TEST/EPC_TEST/play_scenario_s1ap.c
|
||||
${OPENAIR3_DIR}/TEST/EPC_TEST/play_scenario_s1ap_compare_ie.c
|
||||
${OPENAIR3_DIR}/TEST/EPC_TEST/play_scenario_s1ap_eNB_defs.h
|
||||
${OPENAIR3_DIR}/TEST/EPC_TEST/play_scenario_sctp.c
|
||||
${OPENAIR3_DIR}/TEST/EPC_TEST/play_scenario.h
|
||||
${OPENAIR2_DIR}/COMMON/commonDef.h
|
||||
${OPENAIR2_DIR}/COMMON/messages_def.h
|
||||
${OPENAIR2_DIR}/COMMON/messages_types.h
|
||||
${OPENAIR_BIN_DIR}/messages_xml.h
|
||||
)
|
||||
target_include_directories(test_epc_play_scenario PUBLIC /usr/local/share/asn1c)
|
||||
target_link_libraries (test_epc_play_scenario
|
||||
-Wl,--start-group RRC_LIB S1AP_LIB X2AP_LIB GTPV1U LIB_NAS_UE SECU_CN UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB PHY LFDS ${ITTI_LIB} ${MSC_LIB} -Wl,--end-group pthread m rt crypt sctp ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} ${CONFIG_LIBRARIES}
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -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,208 @@ 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 70 00 lte-softmodem tests with SoDeRa RF as eNB and ALU EPC w/ Bandrich COTS UE for TX/1RX
|
||||
01 70 00 Band 7 FDD 5MHz UL Throughput for 300 sec for 1TX/1RX
|
||||
01 70 01 Band 7 FDD 10MHz UL Throughput for 300 sec for 1TX/1RX
|
||||
01 70 02 Band 7 FDD 20MHz UL Throughput for 300 sec for 1TX/1RX
|
||||
01 70 03 Band 7 FDD 5MHz DL Throughput for 300 sec for 1TX/1RX
|
||||
01 70 04 Band 7 FDD 10MHz DL Throughput for 300 sec for 1TX/1RX
|
||||
01 70 05 Band 7 FDD 20MHz DL Throughput for 300 sec for 1TX/1RX
|
||||
|
||||
|
||||
01 75 00 lte-softmodem + RRH tests with B210 RF as eNB and ALU EPC w/ Bandrich COTS UE for TX/1RX
|
||||
01 75 00 Band 7 FDD 5MHz UL Throughput for 300 sec for 1TX/1RX
|
||||
01 75 01 Band 7 FDD 10MHz UL Throughput for 300 sec for 1TX/1RX
|
||||
01 75 02 Band 7 FDD 20MHz UL Throughput for 300 sec for 1TX/1RX
|
||||
01 75 03 Band 7 FDD 5MHz DL Throughput for 300 sec for 1TX/1RX
|
||||
01 75 04 Band 7 FDD 10MHz DL Throughput for 300 sec for 1TX/1RX
|
||||
01 75 05 Band 7 FDD 20MHz DL Throughput for 300 sec for 1TX/1RX
|
||||
|
||||
01 80 00 lte-softmodem + RRH tests with BladeRF RF as eNB and ALU EPC w/ Bandrich COTS UE for TX/1RX
|
||||
01 80 00 Band 7 FDD 5MHz UL Throughput for 300 sec for 1TX/1RX
|
||||
01 80 01 Band 7 FDD 10MHz UL Throughput for 300 sec for 1TX/1RX
|
||||
01 80 02 Band 7 FDD 20MHz UL Throughput for 300 sec for 1TX/1RX
|
||||
01 80 03 Band 7 FDD 5MHz DL Throughput for 300 sec for 1TX/1RX
|
||||
01 80 04 Band 7 FDD 10MHz DL Throughput for 300 sec for 1TX/1RX
|
||||
01 80 05 Band 7 FDD 20MHz DL Throughput for 300 sec for 1TX/1RX
|
||||
|
||||
01 85 00 lte-softmodem + RRH tests with USRP X310 RF as eNB and ALU EPC w/ Bandrich COTS UE for TX/1RX
|
||||
01 85 00 Band 7 FDD 5MHz UL Throughput for 300 sec for 1TX/1RX
|
||||
01 85 01 Band 7 FDD 10MHz UL Throughput for 300 sec for 1TX/1RX
|
||||
01 85 02 Band 7 FDD 20MHz UL Throughput for 300 sec for 1TX/1RX
|
||||
01 85 03 Band 7 FDD 5MHz DL Throughput for 300 sec for 1TX/1RX
|
||||
01 85 04 Band 7 FDD 10MHz DL Throughput for 300 sec for 1TX/1RX
|
||||
01 85 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 +216,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
|
||||
@@ -20,7 +20,7 @@ test_compile() {
|
||||
compile_prog=$2
|
||||
exec_prog=$3
|
||||
build_dir=$tdir/$1/build
|
||||
log_file=$tdir/log/test.$1.txt
|
||||
log_file=$tdir/log/test.$1.$2.$5.txt
|
||||
target=$5
|
||||
echo "Compiling test case $test_name. Log file = $log_file"
|
||||
rm -fr $build_dir
|
||||
@@ -34,10 +34,10 @@ test_compile() {
|
||||
if [ -s $exec_prog ] ; then
|
||||
cp $exec_prog $tdir/bin/`basename $exec_prog`.$target.$test_name
|
||||
echo_success "$test_name $exec_prog $target compiled"
|
||||
xUnit_success "compilation" $test_name "PASS" 1
|
||||
xUnit_success "compilation" $test_name "PASS" 1 "$results_file"
|
||||
else
|
||||
echo_error "$test_name $exec_prog $target compilation failed"
|
||||
xUnit_fail "compilation" $test_name "FAIL" 1
|
||||
xUnit_fail "compilation" $test_name "FAIL" 1 "$results_file"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
@@ -7,12 +7,16 @@ else
|
||||
exit 1
|
||||
fi
|
||||
|
||||
trap handle_ctrl_c INT
|
||||
|
||||
source $OPENAIR_DIR/cmake_targets/tools/test_helper
|
||||
|
||||
#SUDO="sudo -E "
|
||||
|
||||
SUDO="sudo -E -S"
|
||||
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,382 @@ 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
|
||||
test_case_group=`sed "s/\+/\*/g" <<< "${test_case_group}"` # Replace + with * for bash string substituion
|
||||
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
|
||||
read -s -p "Enter Password: " passwd
|
||||
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`
|
||||
test_case_excl_list=`xmlstarlet sel -t -v "/testCaseList/TestCaseExclusionList" $xml_conf`
|
||||
echo "Test Case Exclusion List = $test_case_excl_list "
|
||||
|
||||
test_case_excl_list=`sed "s/\+/\*/g" <<< "$test_case_excl_list" ` # Replace + with * for bash string substituion
|
||||
|
||||
read -a test_case_excl_array <<< "$test_case_excl_list"
|
||||
|
||||
echo "test_case_list = $test_case_list"
|
||||
|
||||
echo "Test Case Exclusion List = $test_case_excl_list \n"
|
||||
|
||||
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
|
||||
|
||||
for search_excl in "${test_case_excl_array[@]}"
|
||||
do
|
||||
if [[ $search_expr == $search_excl ]];then
|
||||
flag_run_test_case=0
|
||||
echo_info "Test case $search_expr match found in test case excl group. Will skip the test case for execution..."
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
#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
|
||||
echo \'passwd\' | $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
|
||||
|
||||
|
||||
|
||||
|
||||
+1555
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
+200
@@ -0,0 +1,200 @@
|
||||
#!/usr/bin/python
|
||||
|
||||
import time
|
||||
import serial
|
||||
import os
|
||||
from pyroute2 import IPRoute
|
||||
import sys
|
||||
import re
|
||||
import threading
|
||||
import signal
|
||||
import traceback
|
||||
import os
|
||||
import commands
|
||||
|
||||
# configure the serial connections (the parameters differs on the device you are connecting to)
|
||||
#First we find an open port to work with
|
||||
serial_port=''
|
||||
ser=serial.Serial()
|
||||
openair_dir = os.environ.get('OPENAIR_DIR')
|
||||
if openair_dir == None:
|
||||
print "Error getting OPENAIR_DIR environment variable"
|
||||
sys.exit(1)
|
||||
|
||||
sys.path.append(os.path.expandvars('$OPENAIR_DIR/cmake_targets/autotests/tools/'))
|
||||
|
||||
from lib_autotest import *
|
||||
|
||||
def find_open_port():
|
||||
global serial_port, ser
|
||||
max_ports=100
|
||||
if os.path.exists(serial_port) == True:
|
||||
return serial_port
|
||||
for port in range(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('sleep 5')
|
||||
os.system ('ping ' + gw)
|
||||
break
|
||||
except Exception, e:
|
||||
error = ' Interface ' + iface + 'does not exist...'
|
||||
error = error + ' In function: ' + sys._getframe().f_code.co_name + ': *** Caught exception: ' + str(e.__class__) + " : " + str( e)
|
||||
error = error + traceback.format_exc()
|
||||
print error
|
||||
|
||||
thread_ppp.join()
|
||||
|
||||
def stop_ue():
|
||||
timeout=60
|
||||
os.system('killall wvdial')
|
||||
send_command('AT', 'OK' , timeout)
|
||||
send_command('AT+CGATT=0' , 'OK|ERROR' , timeout)
|
||||
send_command('AT+CFUN=4' , 'OK' , timeout)
|
||||
|
||||
|
||||
#reset the USB BUS of Bandrich UE
|
||||
def reset_ue():
|
||||
stringIdBandrich='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
|
||||
|
||||
|
||||
@@ -0,0 +1,200 @@
|
||||
#!/usr/bin/python
|
||||
|
||||
import time
|
||||
import serial
|
||||
import os
|
||||
from pyroute2 import IPRoute
|
||||
import sys
|
||||
import re
|
||||
import threading
|
||||
import signal
|
||||
import traceback
|
||||
import os
|
||||
import commands
|
||||
|
||||
# configure the serial connections (the parameters differs on the device you are connecting to)
|
||||
#First we find an open port to work with
|
||||
serial_port=''
|
||||
ser=serial.Serial()
|
||||
openair_dir = os.environ.get('OPENAIR_DIR')
|
||||
if openair_dir == None:
|
||||
print "Error getting OPENAIR_DIR environment variable"
|
||||
sys.exit(1)
|
||||
|
||||
sys.path.append(os.path.expandvars('$OPENAIR_DIR/cmake_targets/autotests/tools/'))
|
||||
|
||||
from lib_autotest import *
|
||||
|
||||
def find_open_port():
|
||||
global serial_port, ser
|
||||
max_ports=100
|
||||
if os.path.exists(serial_port) == True:
|
||||
return serial_port
|
||||
for port in range(0,100):
|
||||
serial_port = '/dev/ttyUSB'+str(port)
|
||||
if os.path.exists(serial_port) == True:
|
||||
print 'New Serial Port : ' + serial_port
|
||||
break
|
||||
|
||||
ser = serial.Serial(port=serial_port)
|
||||
return
|
||||
|
||||
|
||||
|
||||
#serial_port = '/dev/ttyUSB2'
|
||||
bandrich_ppd_config = os.environ.get('OPENAIR_DIR') + '/cmake_targets/autotests/tools/wdial.bandrich.conf'
|
||||
|
||||
exit_flag=0
|
||||
|
||||
def signal_handler(signal, frame):
|
||||
print('You pressed Ctrl+C!')
|
||||
print('Resetting the UE to detached state')
|
||||
timeout=10
|
||||
exit_flag=1
|
||||
send_command('AT+CGATT=0' , 'OK' , timeout)
|
||||
sys.exit(0)
|
||||
|
||||
signal.signal(signal.SIGINT, signal_handler)
|
||||
|
||||
|
||||
|
||||
#ser.open()
|
||||
#ser.isOpen()
|
||||
|
||||
class pppThread (threading.Thread):
|
||||
def __init__(self, threadID, name, counter):
|
||||
threading.Thread.__init__(self)
|
||||
self.threadID = threadID
|
||||
self.name = name
|
||||
self.counter = counter
|
||||
def run(self):
|
||||
print "Starting " + self.name
|
||||
#Here we keep running pppd thread in indefinite loop as this script terminates sometimes
|
||||
#while 1:
|
||||
while 1:
|
||||
time.sleep(5) #Hard coded, do not reduce this number!
|
||||
print "Starting wvdial now..."
|
||||
print 'exit_flag = ' + str(exit_flag)
|
||||
send_command('AT+CGATT=1','OK', 300)
|
||||
os.system('wvdial -C ' + bandrich_ppd_config + '' )
|
||||
if exit_flag == 1:
|
||||
print "Exit flag set to true. Exiting pppThread now"
|
||||
print "Terminating wvdial now..."
|
||||
|
||||
def send_command (cmd, response, timeout):
|
||||
count=0
|
||||
sleep_duration = 1
|
||||
print 'In function: send_command: cmd = <' + cmd + '> response: <' + response + '> \n'
|
||||
global serial_port, ser
|
||||
while count <= timeout:
|
||||
try:
|
||||
#Sometimes the port does not exist coz of reset in modem.
|
||||
#In that case, we need to search for this port again
|
||||
if os.path.exists(serial_port) == False:
|
||||
find_open_port()
|
||||
ser.write (cmd + '\r\n')
|
||||
out = ''
|
||||
time.sleep(sleep_duration)
|
||||
count = count + sleep_duration
|
||||
while ser.inWaiting() > 0:
|
||||
out += ser.read(1)
|
||||
print 'out = <' + out + '> response = <' + response + '> \n'
|
||||
if re.search(response, out):
|
||||
break
|
||||
except Exception, e:
|
||||
error = ' cmd : ' + cmd + ' response : ' + response
|
||||
error = error + ' In function: ' + sys._getframe().f_code.co_name + ': *** Caught exception: ' + str(e.__class__) + " : " + str( e)
|
||||
error = error + traceback.format_exc()
|
||||
print error
|
||||
|
||||
|
||||
def start_ue () :
|
||||
#print 'Enter your commands below.\r\nInsert "exit" to leave the application.'
|
||||
timeout=60 #timeout in seconds
|
||||
send_command('AT', 'OK' , timeout)
|
||||
#send_command('AT+CFUN=1' , 'OK' , timeout)
|
||||
#send_command('AT+CGATT=0' , 'OK' , timeout)
|
||||
send_command('AT+CGATT=1','OK', 300)
|
||||
#os.system('wvdial -C ' + bandrich_ppd_config + ' &' )
|
||||
|
||||
thread_ppp = pppThread(1, "ppp_thread", 1)
|
||||
thread_ppp.start()
|
||||
|
||||
iface='ppp0'
|
||||
|
||||
while 1:
|
||||
time.sleep ( 2)
|
||||
#Now we check if ppp0 interface is up and running
|
||||
try:
|
||||
if exit_flag == 1:
|
||||
break
|
||||
ip = IPRoute()
|
||||
idx = ip.link_lookup(ifname=iface)[0]
|
||||
os.system ('route add ' + gw + ' ppp0')
|
||||
os.system('sleep 5')
|
||||
os.system ('ping ' + gw)
|
||||
break
|
||||
except Exception, e:
|
||||
error = ' Interface ' + iface + 'does not exist...'
|
||||
error = error + ' In function: ' + sys._getframe().f_code.co_name + ': *** Caught exception: ' + str(e.__class__) + " : " + str( e)
|
||||
error = error + traceback.format_exc()
|
||||
print error
|
||||
|
||||
thread_ppp.join()
|
||||
|
||||
def stop_ue():
|
||||
timeout=60
|
||||
os.system('killall wvdial')
|
||||
send_command('AT', 'OK' , timeout)
|
||||
send_command('AT+CGATT=0' , 'OK|ERROR' , timeout)
|
||||
#send_command('AT+CFUN=4' , 'OK' , timeout)
|
||||
|
||||
|
||||
#reset the USB BUS of Bandrich UE
|
||||
def reset_ue():
|
||||
stringIdBandrich='Huawei Technologies Co., Ltd. E398 LTE/UMTS/GSM Modem/Networkcard'
|
||||
status, out = commands.getstatusoutput('lsusb | grep -i \'' + stringIdBandrich + '\'')
|
||||
if (out == '') :
|
||||
print "Bandrich 4G LTE Adapter not found. Exiting now..."
|
||||
sys.exit()
|
||||
p=re.compile('Bus\s*(\w+)\s*Device\s*(\w+):\s*ID\s*(\w+):(\w+)')
|
||||
res=p.findall(out)
|
||||
BusId=res[0][0]
|
||||
DeviceId=res[0][1]
|
||||
VendorId=res[0][2]
|
||||
ProductId=res[0][3]
|
||||
usb_dir= find_usb_path(VendorId, ProductId)
|
||||
print "Bandrich 4G LTE Adapter found in..." + usb_dir
|
||||
cmd = "sudo sh -c \"echo 0 > " + usb_dir + "/authorized\""
|
||||
os.system(cmd + " ; sleep 15" )
|
||||
cmd = "sudo sh -c \"echo 1 > " + usb_dir + "/authorized\""
|
||||
os.system(cmd + " ; sleep 30" )
|
||||
|
||||
i=1
|
||||
gw='192.172.0.1'
|
||||
while i < len(sys.argv):
|
||||
arg=sys.argv[i]
|
||||
if arg == '--start-ue' :
|
||||
find_open_port()
|
||||
print 'Using Serial port : ' + serial_port
|
||||
start_ue()
|
||||
elif arg == '--stop-ue' :
|
||||
find_open_port()
|
||||
print 'Using Serial port : ' + serial_port
|
||||
stop_ue()
|
||||
elif arg == '--reset-ue' :
|
||||
reset_ue()
|
||||
elif arg == '-gw' :
|
||||
gw = sys.argv[i+1]
|
||||
i=i+1
|
||||
elif arg == '-h' :
|
||||
print "--reset-ue: Reset the UE on USB Bus. Similar to unplugging and plugging the UE"
|
||||
print "--stop-ue: Stop the UE. Send DETACH command"
|
||||
print "--start-ue: Start the UE. Send ATTACH command"
|
||||
print "-gw: Specify the default gw as sometimes the gateway/route arguments are not set properly via wvdial"
|
||||
else :
|
||||
print " Script called with wrong arguments, arg = " + arg
|
||||
sys.exit()
|
||||
i = i +1
|
||||
|
||||
|
||||
+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
+42
@@ -0,0 +1,42 @@
|
||||
#!/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)
|
||||
elif keyword == 'rrh_gw_config':
|
||||
replacement_text = keyword + ' = ( { ' + replacement_text + ' } ) ; '
|
||||
string = re.sub(r"rrh_gw_config\s*=\s*\(([^\$]+?)\)\s*;", replacement_text, string, re.M)
|
||||
else :
|
||||
replacement_text = keyword + ' = ' + replacement_text + ' ; '
|
||||
string = re.sub(r"%s\s*=\s*([^\$]+?)\s*;" % keyword , replacement_text, string, re.M)
|
||||
#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!
|
||||
+265
-78
@@ -42,15 +42,22 @@ THIS_SCRIPT_PATH=$(dirname $(readlink -f $0))
|
||||
source $THIS_SCRIPT_PATH/tools/build_helper
|
||||
|
||||
MSC_GEN="False"
|
||||
XFORMS="False"
|
||||
XFORMS="True"
|
||||
PRINT_STATS="False"
|
||||
VCD_TIMING="False"
|
||||
LOWLATENCY_FLAG_USER="False"
|
||||
FORCE_LOWLATENCY_FLAG_USER=""
|
||||
REL="Rel10"
|
||||
HW="EXMIMO"
|
||||
HW="None"
|
||||
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, USRP, BLADERF, ETHERNET, LMSSDR, None (Default)
|
||||
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,41 @@ 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" != "LMSSDR" -a "$HW" != "None" -a "$HW" != "EXMIMO" ] ; then
|
||||
echo_fatal "Unknown HW type $HW will exit..."
|
||||
else
|
||||
if [ "$HW" == "USRP" ] ; then
|
||||
HW="OAI_USRP"
|
||||
fi
|
||||
if [ "$HW" == "BLADERF" ] ; then
|
||||
HW="OAI_BLADERF"
|
||||
fi
|
||||
if [ "$HW" == "LMSSDR" ] ; then
|
||||
HW="OAI_LMSSDR"
|
||||
fi
|
||||
echo_info "Setting hardware to: $HW"
|
||||
fi
|
||||
shift 2;;
|
||||
--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 +220,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 +249,20 @@ function main() {
|
||||
shift;;
|
||||
--cflags_processor)
|
||||
CFLAGS_PROCESSOR_USER=$2
|
||||
echo_info "setting CPU FLAGS from USER to: $CFLAGS_PROCESSOR_USER"
|
||||
echo_info "Setting CPU FLAGS from USER to: $CFLAGS_PROCESSOR_USER"
|
||||
shift 2;;
|
||||
--build-doxygen)
|
||||
BUILD_DOXYGEN=1
|
||||
echo_info "Will build doxygen support"
|
||||
shift;;
|
||||
--disable-deadline)
|
||||
FORCE_LOWLATENCY_FLAG_USER="False"
|
||||
echo_info "Disabling the usage of deadline scheduler"
|
||||
shift 1;;
|
||||
--enable-deadline)
|
||||
FORCE_LOWLATENCY_FLAG_USER="True"
|
||||
echo_info "Enabling the usage of deadline scheduler"
|
||||
shift 1;;
|
||||
-h | --help)
|
||||
print_help
|
||||
exit 1;;
|
||||
@@ -229,6 +272,64 @@ function main() {
|
||||
break;;
|
||||
esac
|
||||
done
|
||||
|
||||
#########################################################
|
||||
# check validity of HW and TP parameters for RRH and eNB
|
||||
#########################################################
|
||||
# to be discussed
|
||||
|
||||
if [ "$eNB" = "1" ] ; then
|
||||
if [ "$HW" = "None" -a "$TP" = "None" ] ; then
|
||||
echo_fatal "Define a local radio head (e.g. -w EXMIMO) or a transport protocol (e.g. -t ETHERNET) to communicate with a remote radio head!"
|
||||
fi
|
||||
if [ "$HW" != "None" -a "$TP" != "None" ] ; then
|
||||
echo_fatal "Currently eNB can not support simultaniously local and remote radio heads!!"
|
||||
fi
|
||||
if [ "$HW" = "None" ] ; then
|
||||
echo_info "No radio head has been selected (HW set to $HW)"
|
||||
fi
|
||||
if [ "$TP" = "None" ] ; then
|
||||
echo_info "No transport protocol has been selected (TP set to $TP)"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$RRH" = "1" ] ; then
|
||||
if [ "$TP" = "None" ] ; then
|
||||
echo_fatal "A transport protocol (e.g. -t ETHERNET) must be defined!"
|
||||
fi
|
||||
if [ "$HW" = "None" ] ; then
|
||||
echo_info "No radio head has been selected (HW set to $HW)"
|
||||
fi
|
||||
fi
|
||||
|
||||
echo_info "RF HW set to $HW"
|
||||
#Now we set flags to enable deadline scheduler settings
|
||||
#By default: USRP: disable,
|
||||
#By default: BLADERF: enable,
|
||||
#By default: EXMIMO: enable
|
||||
if [ "$FORCE_LOWLATENCY_FLAG_USER" = "" ]; then
|
||||
if [ "$HW" = "EXMIMO" ] ; then
|
||||
LOWLATENCY_FLAG_USER="True"
|
||||
elif [ "$HW" = "ETHERNET" ] ; then
|
||||
LOWLATENCY_FLAG_USER="True"
|
||||
elif [ "$HW" = "OAI_USRP" ] ; then
|
||||
LOWLATENCY_FLAG_USER="False"
|
||||
elif [ "$HW" = "OAI_BLADERF" ] ; then
|
||||
LOWLATENCY_FLAG_USER="False"
|
||||
elif [ "$HW" = "OAI_LMSSDR" ] ; then
|
||||
LOWLATENCY_FLAG_USER="False"
|
||||
elif [ "$HW" = "None" ] ; then
|
||||
LOWLATENCY_FLAG_USER="False"
|
||||
else
|
||||
echo_error "Unknown HW type $HW. Exiting now..."
|
||||
exit
|
||||
fi
|
||||
else
|
||||
LOWLATENCY_FLAG_USER=$FORCE_LOWLATENCY_FLAG_USER
|
||||
fi
|
||||
|
||||
echo_info "Flags for Deadline scheduler: $LOWLATENCY_FLAG_USER"
|
||||
|
||||
|
||||
############################################
|
||||
# setting and printing OAI envs, we should check here
|
||||
@@ -268,7 +369,7 @@ function main() {
|
||||
check_install_usrp_uhd_driver
|
||||
fi
|
||||
if [ "$HW" == "OAI_BLADERF" ] ; then
|
||||
echo_info "installing packages for BALDERF support"
|
||||
echo_info "installing packages for BLADERF support"
|
||||
check_install_bladerf_driver
|
||||
fi
|
||||
fi
|
||||
@@ -279,9 +380,11 @@ function main() {
|
||||
fi
|
||||
|
||||
if [ "$oaisim" = "1" ] ; then
|
||||
if [ "$HW" != "ETHERNET" ] ; then
|
||||
HW="NONE"
|
||||
fi
|
||||
#to be discussed
|
||||
# there is no RF device and no transport protocol
|
||||
HW="None"
|
||||
TP="None"
|
||||
|
||||
if [ "$XFORMS" == "True" ] ; then
|
||||
PRINT_STATS="True"
|
||||
fi
|
||||
@@ -315,7 +418,9 @@ function main() {
|
||||
echo "set ( RRC_ASN1_VERSION \"${REL}\")" >> $cmake_file
|
||||
echo "set ( ENABLE_VCD_FIFO $VCD_TIMING )" >> $cmake_file
|
||||
echo "set ( RF_BOARD \"${HW}\")" >> $cmake_file
|
||||
echo "set(PACKAGE_NAME \"${lte_exec}\")" >> $cmake_file
|
||||
echo "set ( TRANSP_PRO \"${TP}\")" >> $cmake_file
|
||||
echo "set(PACKAGE_NAME \"${lte_exec}\")" >> $cmake_file
|
||||
echo "set (LOWLATENCY \"${LOWLATENCY_FLAG_USER}\" )" >>$cmake_file
|
||||
echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)' >> $cmake_file
|
||||
cd $DIR/$lte_build_dir/build
|
||||
cmake ..
|
||||
@@ -407,7 +512,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 \
|
||||
@@ -520,64 +625,146 @@ 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"
|
||||
elif [ "$HW" == "OAI_LMSSDR" ] ; then
|
||||
# if [ -f "/usr/include/libbladeRF.h" ] ; then
|
||||
compilations \
|
||||
$build_dir oai_lmssdrdevif \
|
||||
liboai_lmssdrdevif.so $dbin/liboai_lmssdrdevif.so.$REL
|
||||
# fi
|
||||
|
||||
ln -s liboai_lmssdrdevif.so liboai_device.so
|
||||
ln -s $dbin/liboai_lmssdrdevif.so.$REL $dbin/liboai_device.so
|
||||
echo_info "liboai_device.so is linked to LMSSDR device library"
|
||||
else
|
||||
echo_info "liboai_device.so is not linked to any device library"
|
||||
fi
|
||||
fi
|
||||
|
||||
# build trasport protocol libraries (currently only ETHERNET is available)
|
||||
if [ "$TP" != "None" ] ; then
|
||||
rm -f liboai_transpro.so
|
||||
rm -f $dbin/liboai_transpro.so
|
||||
|
||||
if [ "$TP" == "ETHERNET" ] ; then
|
||||
compilations \
|
||||
$build_dir oai_eth_transpro \
|
||||
liboai_eth_transpro.so $dbin/liboai_eth_transpro.so.$REL
|
||||
ln -s liboai_eth_transpro.so liboai_transpro.so
|
||||
ln -s $dbin/liboai_eth_transpro.so.$REL $dbin/liboai_transpro.so
|
||||
echo_info "liboai_transpro.so is linked with ETHERNET library"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
# Doxygen Support
|
||||
#####################
|
||||
if [ "$BUILD_DOXYGEN" = "1" ] ;then
|
||||
doxygen_log=$OPENAIR_DIR/cmake_targets/log/doxygen.log
|
||||
echo_info "Building doxygen based documentation. The documentation file is located here: $OPENAIR_DIR/targets/DOCS/html/index.html"
|
||||
echo_info "Doxygen Generation log is located here: $doxygen_log"
|
||||
echo_info "Generating doxygen files....please wait"
|
||||
(
|
||||
[ "$CLEAN" = "1" ] && rm -rf $OPENAIR_DIR/cmake_targets/doxygen/build
|
||||
mkdir -p $OPENAIR_DIR/cmake_targets/doxygen/build
|
||||
cd $OPENAIR_DIR/cmake_targets/doxygen/build
|
||||
cmake ..
|
||||
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,11 +1,13 @@
|
||||
cmake_minimum_required(VERSION 2.8)
|
||||
|
||||
set ( CMAKE_BUILD_TYPE "RelWithDebInfo" )
|
||||
set ( ASN_DEBUG False)
|
||||
set ( ADDR_CONF False )
|
||||
set ( DEBUG_OMG False )
|
||||
set ( DISABLE_XER_PRINT False )
|
||||
set ( DRIVER2013 True )
|
||||
set ( EMOS False )
|
||||
set ( EMIT_ASN_DEBUG False )
|
||||
set ( ENABLE_FXP True )
|
||||
set ( ENABLE_ITTI True )
|
||||
set ( ENABLE_NAS_UE_LOGGING True )
|
||||
@@ -47,9 +49,9 @@ set ( OAI_EMU False )
|
||||
set ( OAISIM False )
|
||||
set ( OAI_NW_DRIVER_TYPE_ETHERNET False )
|
||||
set ( OAI_NW_DRIVER_USE_NETLINK True )
|
||||
set ( OPENAIR1 False )
|
||||
set ( OPENAIR2 False )
|
||||
set ( OPENAIR_LTE F )
|
||||
set ( OPENAIR1 True )
|
||||
set ( OPENAIR2 True )
|
||||
set ( OPENAIR_LTE True )
|
||||
set ( PACKAGE_NAME "epc_test" )
|
||||
set ( PBS_SIM False )
|
||||
set ( PDCP_USE_NETLINK True )
|
||||
@@ -74,4 +76,4 @@ set ( SMBV False )
|
||||
set ( TEST_OMG False )
|
||||
set ( USE_MME "R10" )
|
||||
set ( USER_MODE True )
|
||||
set ( XER_PRINT False )
|
||||
set ( XER_PRINT True )
|
||||
|
||||
@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 2.8)
|
||||
set(PACKAGE_NAME "unitary_tests_simulators")
|
||||
set(PHYSIM True)
|
||||
set(RF_BOARD None)
|
||||
set(XFORMS False)
|
||||
set(XFORMS True)
|
||||
|
||||
set(DEBUG_PHY False)
|
||||
set(MU_RECIEVER False)
|
||||
|
||||
@@ -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)
|
||||
@@ -30,7 +30,7 @@
|
||||
################################################################################
|
||||
# file build_helper
|
||||
# brief
|
||||
# author Laurent Thomas
|
||||
# authors Laurent Thomas, Lionel GAUTHIER
|
||||
#
|
||||
#######################################
|
||||
SUDO='sudo -E'
|
||||
@@ -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,15 @@ check_install_oai_software() {
|
||||
openssh-server \
|
||||
openssl \
|
||||
python \
|
||||
subversion
|
||||
subversion \
|
||||
xmlstarlet \
|
||||
python-pip \
|
||||
pydb \
|
||||
wvdial \
|
||||
python-numpy \
|
||||
sshpass \
|
||||
libxslt1-dev
|
||||
|
||||
$SUDO update-alternatives --set liblapack.so /usr/lib/atlas-base/atlas/liblapack.so
|
||||
if [ `lsb_release -rs` = '12.04' ] ; then
|
||||
install_nettle_from_source
|
||||
@@ -262,10 +279,18 @@ 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 "
|
||||
(
|
||||
$SUDO rm -rf /tmp/asn1c-r1516
|
||||
mkdir -p /tmp/asn1c-r1516
|
||||
cd /tmp/asn1c-r1516
|
||||
rm -rf /tmp/asn1c-r1516/*
|
||||
@@ -273,9 +298,11 @@ install_asn1c_from_source(){
|
||||
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
|
||||
patch -p0 < $OPENAIR_DIR/openair3/S1AP/MESSAGES/ASN1/asn1cpatch_3.p0 >> /tmp/log_compile_asn1c
|
||||
./configure
|
||||
make > /tmp/log_compile_asn1c 2>&1
|
||||
make -j`nproc`
|
||||
$SUDO make install
|
||||
) > $asn1_install_dir 2>&1
|
||||
}
|
||||
|
||||
#################################################
|
||||
@@ -301,7 +328,6 @@ install_nas_tools() {
|
||||
}
|
||||
|
||||
|
||||
|
||||
################################
|
||||
# set_openair_env
|
||||
###############################
|
||||
@@ -318,3 +344,60 @@ 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
|
||||
}
|
||||
|
||||
|
||||
# get from http://www.linuxjournal.com/content/validating-ip-address-bash-script
|
||||
validate_ip() {
|
||||
|
||||
local ip=$1
|
||||
local stat=1
|
||||
|
||||
if [[ $ip =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then
|
||||
OIFS=$IFS
|
||||
IFS='.'
|
||||
ip=($ip)
|
||||
IFS=$OIFS
|
||||
[[ ${ip[0]} -le 255 && ${ip[1]} -le 255 \
|
||||
&& ${ip[2]} -le 255 && ${ip[3]} -le 255 ]]
|
||||
stat=$?
|
||||
fi
|
||||
|
||||
return $stat
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
# Contact Information
|
||||
# OpenAirInterface Admin: openair_admin@eurecom.fr
|
||||
# OpenAirInterface Tech : openair_tech@eurecom.fr
|
||||
# OpenAirInterface Dev : openair4g-devel@eurecom.fr
|
||||
# OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr
|
||||
#
|
||||
# Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
|
||||
#
|
||||
@@ -121,6 +121,7 @@ function main()
|
||||
echo "Cleaning TEST_EPC"
|
||||
fi
|
||||
rm -f $OPENAIR_DIR/targets/bin/test_epc_generate_scenario
|
||||
rm -f $OPENAIR_DIR/targets/bin/test_epc_play_scenario
|
||||
rm -Rf build 2>&1
|
||||
mkdir -m 777 -p -v build
|
||||
fi
|
||||
@@ -140,6 +141,13 @@ function main()
|
||||
compilations \
|
||||
epc_test test_epc_generate_scenario \
|
||||
test_epc_generate_scenario $dbin/test_epc_generate_scenario
|
||||
|
||||
compilations \
|
||||
epc_test test_epc_play_scenario \
|
||||
test_epc_play_scenario $dbin/test_epc_play_scenario
|
||||
|
||||
$SUDO cp -upv test_epc_generate_scenario /usr/local/bin
|
||||
$SUDO cp -upv test_epc_play_scenario /usr/local/bin
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
n=oarf_get_num_detected_cards;
|
||||
for i=n-1:0
|
||||
oarf_stop(i);
|
||||
end
|
||||
Executable
+177
@@ -0,0 +1,177 @@
|
||||
#!/bin/bash
|
||||
|
||||
# in those arrays, each line is:
|
||||
# <file> <sha1sum of file (without line 4 which changes depending on the location of the files)> <patch to apply to file>
|
||||
|
||||
RRC_Rel10=(
|
||||
"SystemInformation-r8-IEs.h" 603cd6615cff36ec7020692d72c0d6de7c4859cb "fix_asn1.data/RRC.rel10/SystemInformation-r8-IEs.h.diff"
|
||||
)
|
||||
|
||||
X2AP_Rel11_2=(
|
||||
"X2ap-CriticalityDiagnostics-IE-List.h" ae96308b37fcbcbf39da5012e42968135fc5f27b "fix_asn1.data/X2AP.rel11.2/X2ap-CriticalityDiagnostics-IE-List.h.diff"
|
||||
"NativeInteger.c" 9f173e87daa1e7378618dbb060a10aae752d74be "fix_asn1.data/X2AP.rel11.2/NativeInteger.c.diff"
|
||||
"constr_SET_OF.c" 5c8765a1e0fc44a48e406d0aa7628004bf3aac2a "fix_asn1.data/X2AP.rel11.2/constr_SET_OF.c.diff"
|
||||
)
|
||||
|
||||
S1AP_Rel10_5=(
|
||||
"NativeInteger.c" 9f173e87daa1e7378618dbb060a10aae752d74be "fix_asn1.data/S1AP.rel10.5/NativeInteger.c.diff"
|
||||
"constr_SET_OF.c" 5c8765a1e0fc44a48e406d0aa7628004bf3aac2a "fix_asn1.data/S1AP.rel10.5/constr_SET_OF.c.diff"
|
||||
)
|
||||
|
||||
red_color="$(tput setaf 1)"
|
||||
green_color="$(tput setaf 2)"
|
||||
reset_color="$(tput sgr0)"
|
||||
|
||||
function error()
|
||||
{
|
||||
echo -e "$red_color"ERROR: "$@""$reset_color"
|
||||
exit 1
|
||||
}
|
||||
|
||||
function check_sha1()
|
||||
{
|
||||
local file="$1"
|
||||
local target_sha1="$2"
|
||||
|
||||
if [ ! -f "$file" ]
|
||||
then
|
||||
error "$file: no such file"
|
||||
fi
|
||||
|
||||
# we don't use the line 4 of the file
|
||||
# it contains the location of the ASN1 grammar
|
||||
# and this location is not the same on every
|
||||
# installation (this is for *.h files, for *.c
|
||||
# files it's no big deal to skip that line)
|
||||
local computed_sha1=$(sed 4d "$file" | sha1sum | cut -f 1 -d ' ')
|
||||
|
||||
if [ "$target_sha1" != "$computed_sha1" ]
|
||||
then
|
||||
error "$file: wrong SHA1"
|
||||
fi
|
||||
}
|
||||
|
||||
function patch_file()
|
||||
{
|
||||
local patch="$1"
|
||||
local file="$2"
|
||||
|
||||
echo -e "$green_color""patch file $file with $OPENAIR_DIR/cmake_targets/tools/$patch""$reset_color"
|
||||
|
||||
patch "$file" "$OPENAIR_DIR/cmake_targets/tools/$patch"
|
||||
if [ $? -ne 0 ]
|
||||
then
|
||||
error "patching of $file with $OPENAIR_DIR/cmake_targets/tools/$patch failed"
|
||||
fi
|
||||
}
|
||||
|
||||
function apply_patches()
|
||||
{
|
||||
local directory="$1"
|
||||
local array=$2
|
||||
local len=$3 # the length could be computed locally but the way to do it is not clear to me [CROUX]
|
||||
|
||||
local i
|
||||
local file
|
||||
local sha1
|
||||
local patch
|
||||
local item
|
||||
|
||||
for (( i = 0; i < $len; i += 3 ))
|
||||
do
|
||||
# special bash syntax to access the array
|
||||
item=$array[$i]; file=${!item}
|
||||
item=$array[$((i+1))]; sha1=${!item}
|
||||
item=$array[$((i+2))]; patch=${!item}
|
||||
check_sha1 "$directory/$file" "$sha1"
|
||||
patch_file "$patch" "$directory/$file"
|
||||
done
|
||||
}
|
||||
|
||||
function patch_rrc()
|
||||
{
|
||||
local directory="$1"
|
||||
local version="$2"
|
||||
|
||||
case "$version" in
|
||||
Rel10 )
|
||||
echo "patching RRC files release 10"
|
||||
apply_patches "$directory" RRC_Rel10 ${#RRC_Rel10[*]}
|
||||
;;
|
||||
Rel8 )
|
||||
echo "patching RRC files release 8 TODO?"
|
||||
;;
|
||||
* )
|
||||
error unknwon/unhandled RRC version \'"$version"\'
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
function patch_x2ap()
|
||||
{
|
||||
local directory="$1"
|
||||
local version="$2"
|
||||
|
||||
case "$version" in
|
||||
R11 )
|
||||
echo "patching X2AP files release 11.2"
|
||||
apply_patches "$directory" X2AP_Rel11_2 ${#X2AP_Rel11_2[*]}
|
||||
;;
|
||||
* )
|
||||
error unknwon/unhandled X2AP version \'"$version"\'
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
function patch_s1ap()
|
||||
{
|
||||
local directory="$1"
|
||||
local version="$2"
|
||||
|
||||
case "$version" in
|
||||
R10 )
|
||||
echo "patching S1AP files release 10.5"
|
||||
apply_patches "$directory" S1AP_Rel10_5 ${#S1AP_Rel10_5[*]}
|
||||
;;
|
||||
* )
|
||||
error unknwon/unhandled S1AP version \'"$version"\'
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
function main()
|
||||
{
|
||||
if [ $# -ne 3 ]
|
||||
then
|
||||
echo "ERROR: pass <output directory> <module> <version>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ x"$OPENAIR_DIR" = x ]
|
||||
then
|
||||
error "the variable OPENAIR_DIR is not set"
|
||||
fi
|
||||
|
||||
local directory="$1"
|
||||
local module="$2"
|
||||
local version="$3"
|
||||
|
||||
case "$module" in
|
||||
RRC )
|
||||
patch_rrc "$directory" "$version"
|
||||
;;
|
||||
X2AP )
|
||||
patch_x2ap "$directory" "$version"
|
||||
;;
|
||||
S1AP )
|
||||
patch_s1ap "$directory" "$version"
|
||||
;;
|
||||
* )
|
||||
error unknown module "$module"
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -0,0 +1,23 @@
|
||||
57,61d56
|
||||
< /* SystemInformation-r8-IEs */
|
||||
< typedef struct SystemInformation_r8_IEs {
|
||||
< struct SystemInformation_r8_IEs__sib_TypeAndInfo {
|
||||
< A_SEQUENCE_OF(struct SystemInformation_r8_IEs__sib_TypeAndInfo__Member {
|
||||
< SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR present;
|
||||
79c74,78
|
||||
< } choice;
|
||||
---
|
||||
> };
|
||||
>
|
||||
> struct SystemInformation_r8_IEs__sib_TypeAndInfo__Member {
|
||||
> SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR present;
|
||||
> union SystemInformation_r8_IEs__sib_TypeAndInfo__Member_u choice;
|
||||
83c82,87
|
||||
< } ) list;
|
||||
---
|
||||
> };
|
||||
>
|
||||
> /* SystemInformation-r8-IEs */
|
||||
> typedef struct SystemInformation_r8_IEs {
|
||||
> struct SystemInformation_r8_IEs__sib_TypeAndInfo {
|
||||
> A_SEQUENCE_OF(struct SystemInformation_r8_IEs__sib_TypeAndInfo__Member) list;
|
||||
@@ -0,0 +1,8 @@
|
||||
283c283
|
||||
< int dynamic = 0;
|
||||
---
|
||||
> //int dynamic = 0;
|
||||
290c290
|
||||
< dynamic = 1;
|
||||
---
|
||||
> //dynamic = 1;
|
||||
@@ -0,0 +1,4 @@
|
||||
1007c1007
|
||||
< (int)nelems, (int)ct ? ct->effective_bits : -1);
|
||||
---
|
||||
> (int)nelems, ct ? ct->effective_bits : -1);
|
||||
@@ -0,0 +1,8 @@
|
||||
283c283
|
||||
< int dynamic = 0;
|
||||
---
|
||||
> //int dynamic = 0;
|
||||
290c290
|
||||
< dynamic = 1;
|
||||
---
|
||||
> //dynamic = 1;
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
29,31c29
|
||||
< /* X2ap-CriticalityDiagnostics-IE-List */
|
||||
< typedef struct X2ap_CriticalityDiagnostics_IE_List {
|
||||
< A_SEQUENCE_OF(struct X2ap_CriticalityDiagnostics_IE_List__Member {
|
||||
---
|
||||
> struct X2ap_CriticalityDiagnostics_IE_List__Member {
|
||||
43c41,46
|
||||
< } ) list;
|
||||
---
|
||||
> };
|
||||
>
|
||||
> /* X2ap-CriticalityDiagnostics-IE-List */
|
||||
> typedef struct X2ap_CriticalityDiagnostics_IE_List {
|
||||
> A_SEQUENCE_OF(struct X2ap_CriticalityDiagnostics_IE_List__Member
|
||||
> ) list;
|
||||
@@ -0,0 +1,4 @@
|
||||
1007c1007
|
||||
< (int)nelems, (int)ct ? ct->effective_bits : -1);
|
||||
---
|
||||
> (int)nelems, ct ? ct->effective_bits : -1);
|
||||
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"
|
||||
|
||||
@@ -29,9 +29,9 @@
|
||||
################################################################################
|
||||
# file run_enb_s1_usrp
|
||||
# brief run script for eNB USRP.
|
||||
# author Lionel GAUTHIER
|
||||
# author Lionel GAUTHIER and Navid Nikaein
|
||||
# company Eurecom
|
||||
# email: lionel.gauthier@eurecom.fr
|
||||
# email: lionel.gauthier@eurecom.fr and navid.nikaein@eurecom.fr
|
||||
|
||||
|
||||
################################
|
||||
@@ -56,6 +56,8 @@ function help()
|
||||
echo_error "Mandatory arguments to long options are mandatory for short options too."
|
||||
echo_error " -g, --gdb Run with GDB."
|
||||
echo_error " -h, --help Print this help."
|
||||
echo_error " -e, --ulsch-max-errors num-errs maximum allowed number of uplink errors"
|
||||
echo_error " -f, --rf-config-file filename RF specific configuration file"
|
||||
echo_error " -K, --itti-dump-file filename ITTI dump file containing all ITTI events occuring during EPC runtime.(can omit file name if last argument)"
|
||||
echo_error " -M, --target-dl-mcs mcs Downlink target MCS."
|
||||
echo_error " -m, --mscgen directory Generate mscgen output files in a directory"
|
||||
@@ -137,7 +139,27 @@ function main()
|
||||
shift;
|
||||
exit 0
|
||||
;;
|
||||
-K | --itti-dump-file)
|
||||
-e | --ulsch-max-errors)
|
||||
ulsch_max_errors=$2
|
||||
echo "setting --ulsch-max-errors to $ulsch_max_errors"
|
||||
exe_arguments="$exe_arguments --ulsch-max-errors=$ulsch_max_errors"
|
||||
shift 2;
|
||||
;;
|
||||
-f | --rf-config-file)
|
||||
rf_config_file=$2
|
||||
# can omit file name if last arg on the line
|
||||
if [ "x$rf_config_file" = "x" ]; then
|
||||
rf_config_file=null
|
||||
shift 1;
|
||||
else
|
||||
shift 2;
|
||||
fi
|
||||
if [ "$rf_config_file" != "null" ]; then
|
||||
echo "setting --rf-config-file to $rf_config_file"
|
||||
exe_arguments="$exe_arguments --rf-config-file=$rf_config_file"
|
||||
fi
|
||||
;;
|
||||
-K | --itti-dump-file)
|
||||
itti_dump_file=$2
|
||||
# can omit file name if last arg on the line
|
||||
if [ "x$itti_dump_file" = "x" ]; then
|
||||
|
||||
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 -H --no-gui $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,106 @@
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
#include <unistd.h>
|
||||
#include <execinfo.h>
|
||||
#include <signal.h>
|
||||
|
||||
#include "SIMULATION/TOOLS/defs.h"
|
||||
#include "PHY/types.h"
|
||||
#include "PHY/defs.h"
|
||||
#include "PHY/extern.h"
|
||||
|
||||
extern PHY_VARS_eNB *PHY_vars_eNB;
|
||||
extern PHY_VARS_UE *PHY_vars_UE;
|
||||
|
||||
void lte_param_init(unsigned char N_tx,
|
||||
unsigned char N_rx,
|
||||
unsigned char transmission_mode,
|
||||
uint8_t extended_prefix_flag,
|
||||
frame_t frame_type,
|
||||
uint16_t Nid_cell,
|
||||
uint8_t tdd_config,
|
||||
uint8_t N_RB_DL,
|
||||
uint8_t threequarter_fs,
|
||||
uint8_t osf,
|
||||
uint32_t perfect_ce)
|
||||
{
|
||||
|
||||
LTE_DL_FRAME_PARMS *lte_frame_parms;
|
||||
int i;
|
||||
|
||||
|
||||
printf("Start lte_param_init\n");
|
||||
PHY_vars_eNB = malloc(sizeof(PHY_VARS_eNB));
|
||||
PHY_vars_UE = malloc(sizeof(PHY_VARS_UE));
|
||||
//PHY_config = malloc(sizeof(PHY_CONFIG));
|
||||
mac_xface = malloc(sizeof(MAC_xface));
|
||||
|
||||
srand(0);
|
||||
randominit(0);
|
||||
set_taus_seed(0);
|
||||
|
||||
lte_frame_parms = &(PHY_vars_eNB->lte_frame_parms);
|
||||
|
||||
lte_frame_parms->N_RB_DL = N_RB_DL; //50 for 10MHz and 25 for 5 MHz
|
||||
lte_frame_parms->N_RB_UL = N_RB_DL;
|
||||
lte_frame_parms->threequarter_fs = threequarter_fs;
|
||||
lte_frame_parms->Ncp = extended_prefix_flag;
|
||||
lte_frame_parms->Nid_cell = Nid_cell;
|
||||
lte_frame_parms->nushift = Nid_cell%6;
|
||||
lte_frame_parms->nb_antennas_tx = N_tx;
|
||||
lte_frame_parms->nb_antennas_rx = N_rx;
|
||||
lte_frame_parms->nb_antennas_tx_eNB = N_tx;
|
||||
lte_frame_parms->phich_config_common.phich_resource = one;
|
||||
lte_frame_parms->tdd_config = tdd_config;
|
||||
lte_frame_parms->frame_type = frame_type;
|
||||
// lte_frame_parms->Csrs = 2;
|
||||
// lte_frame_parms->Bsrs = 0;
|
||||
// lte_frame_parms->kTC = 0;44
|
||||
// lte_frame_parms->n_RRC = 0;
|
||||
lte_frame_parms->mode1_flag = (transmission_mode == 1)? 1 : 0;
|
||||
|
||||
init_frame_parms(lte_frame_parms,osf);
|
||||
|
||||
//copy_lte_parms_to_phy_framing(lte_frame_parms, &(PHY_config->PHY_framing));
|
||||
|
||||
// phy_init_top(lte_frame_parms); //allocation
|
||||
|
||||
PHY_vars_UE->is_secondary_ue = 0;
|
||||
PHY_vars_UE->lte_frame_parms = *lte_frame_parms;
|
||||
PHY_vars_eNB->lte_frame_parms = *lte_frame_parms;
|
||||
|
||||
phy_init_lte_top(lte_frame_parms);
|
||||
dump_frame_parms(lte_frame_parms);
|
||||
|
||||
PHY_vars_UE->PHY_measurements.n_adj_cells=0;
|
||||
PHY_vars_UE->PHY_measurements.adj_cell_id[0] = Nid_cell+1;
|
||||
PHY_vars_UE->PHY_measurements.adj_cell_id[1] = Nid_cell+2;
|
||||
|
||||
for (i=0; i<3; i++)
|
||||
lte_gold(lte_frame_parms,PHY_vars_UE->lte_gold_table[i],Nid_cell+i);
|
||||
|
||||
phy_init_lte_ue(PHY_vars_UE,1,0);
|
||||
phy_init_lte_eNB(PHY_vars_eNB,0,0,0);
|
||||
|
||||
generate_pcfich_reg_mapping(&PHY_vars_UE->lte_frame_parms);
|
||||
generate_phich_reg_mapping(&PHY_vars_UE->lte_frame_parms);
|
||||
|
||||
// DL power control init
|
||||
if (transmission_mode == 1) {
|
||||
PHY_vars_eNB->pdsch_config_dedicated->p_a = dB0; // 4 = 0dB
|
||||
((PHY_vars_eNB->lte_frame_parms).pdsch_config_common).p_b = 0;
|
||||
PHY_vars_UE->pdsch_config_dedicated->p_a = dB0; // 4 = 0dB
|
||||
((PHY_vars_UE->lte_frame_parms).pdsch_config_common).p_b = 0;
|
||||
} else { // rho_a = rhob
|
||||
PHY_vars_eNB->pdsch_config_dedicated->p_a = dB0; // 4 = 0dB
|
||||
((PHY_vars_eNB->lte_frame_parms).pdsch_config_common).p_b = 1;
|
||||
PHY_vars_UE->pdsch_config_dedicated->p_a = dB0; // 4 = 0dB
|
||||
((PHY_vars_UE->lte_frame_parms).pdsch_config_common).p_b = 1;
|
||||
}
|
||||
|
||||
PHY_vars_UE->perfect_ce = perfect_ce;
|
||||
|
||||
printf("Done lte_param_init\n");
|
||||
|
||||
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -38,23 +38,16 @@ extern int card;
|
||||
#endif
|
||||
|
||||
void
|
||||
phy_adjust_gain (PHY_VARS_UE *phy_vars_ue, uint8_t eNB_id)
|
||||
phy_adjust_gain (PHY_VARS_UE *phy_vars_ue, uint32_t rx_power_fil_dB, uint8_t eNB_id)
|
||||
{
|
||||
|
||||
uint16_t rx_power_fil_dB;
|
||||
#ifdef EXMIMO
|
||||
exmimo_config_t *p_exmimo_config = openair0_exmimo_pci[card].exmimo_config_ptr;
|
||||
uint16_t i;
|
||||
#endif
|
||||
int rssi;
|
||||
|
||||
rssi = dB_fixed(phy_vars_ue->PHY_measurements.rssi);
|
||||
|
||||
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",
|
||||
rssi,
|
||||
LOG_D(PHY,"Gain control: rssi %d (%d,%d)\n",
|
||||
rx_power_fil_dB,
|
||||
phy_vars_ue->PHY_measurements.rssi,
|
||||
phy_vars_ue->PHY_measurements.rx_power_avg_dB[eNB_id]
|
||||
);
|
||||
|
||||
@@ -213,6 +213,7 @@ int8_t set_RSRQ_filtered(module_id_t Mod_id,uint8_t CC_id,uint8_t eNB_index,floa
|
||||
|
||||
//! Automatic gain control
|
||||
void phy_adjust_gain (PHY_VARS_UE *phy_vars_ue,
|
||||
uint32_t rx_power_fil_dB,
|
||||
unsigned char eNB_id);
|
||||
|
||||
int lte_ul_channel_estimation(PHY_VARS_eNB *phy_vars_eNB,
|
||||
@@ -243,15 +244,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);
|
||||
|
||||
@@ -703,24 +703,28 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue,
|
||||
|
||||
void (*idft)(int16_t *,int16_t *, int);
|
||||
|
||||
switch (phy_vars_ue->lte_frame_parms.log2_symbol_size) {
|
||||
case 7:
|
||||
switch (phy_vars_ue->lte_frame_parms.ofdm_symbol_size) {
|
||||
case 128:
|
||||
idft = idft128;
|
||||
break;
|
||||
|
||||
case 8:
|
||||
case 256:
|
||||
idft = idft256;
|
||||
break;
|
||||
|
||||
case 9:
|
||||
case 512:
|
||||
idft = idft512;
|
||||
break;
|
||||
|
||||
case 10:
|
||||
case 1024:
|
||||
idft = idft1024;
|
||||
break;
|
||||
|
||||
case 11:
|
||||
case 1536:
|
||||
idft = idft1536;
|
||||
break;
|
||||
|
||||
case 2048:
|
||||
idft = idft2048;
|
||||
break;
|
||||
|
||||
|
||||
@@ -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];
|
||||
@@ -491,13 +483,10 @@ int lte_sync_time(int **rxdata, ///rx data in time domain
|
||||
|
||||
*eNB_id = sync_source;
|
||||
|
||||
LOG_D(PHY,"[UE] lte_sync_time: Sync source = %d, Peak found at pos %d, val = %d (%d dB)\n",sync_source,peak_pos,peak_val,dB_fixed(peak_val)/2);
|
||||
|
||||
|
||||
#ifdef DEBUG_PHY
|
||||
msg("[PHY][UE] lte_sync_time: Sync source = %d, Peak found at pos %d, val = %d\n",
|
||||
sync_source,peak_pos,peak_val);
|
||||
|
||||
|
||||
|
||||
|
||||
if (debug_cnt == 0) {
|
||||
write_output("sync_corr0_ue.m","synccorr0",sync_corr_ue0,2*length,1,2);
|
||||
write_output("sync_corr1_ue.m","synccorr1",sync_corr_ue1,2*length,1,2);
|
||||
|
||||
@@ -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++;
|
||||
|
||||
@@ -1,31 +1,3 @@
|
||||
/*******************************************************************************
|
||||
OpenAirInterface
|
||||
Copyright(c) 1999 - 2014 Eurecom
|
||||
|
||||
OpenAirInterface is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
|
||||
OpenAirInterface is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenAirInterface.The full GNU General Public License is
|
||||
included in this distribution in the file called "COPYING". If not,
|
||||
see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Contact Information
|
||||
OpenAirInterface Admin: openair_admin@eurecom.fr
|
||||
OpenAirInterface Tech : openair_tech@eurecom.fr
|
||||
OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr
|
||||
|
||||
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
|
||||
|
||||
*******************************************************************************/
|
||||
short primary_synch0[144] = {0,0,0,0,0,0,0,0,0,0,32767,0,-26120,-19785,11971,-30502,-24020,-22288,32117,6492,31311,9658,-16384,-28378,25100,-21063,-7292,-31946,20429,25618,14948,29158,11971,-30502,31311,9658,25100,-21063,-16384,28377,-24020,22287,32117,6492,-7292,31945,20429,25618,-26120,-19785,-16384,-28378,-16384,28377,-26120,-19785,-32402,4883,31311,-9659,32117,6492,-7292,-31946,32767,-1,25100,-21063,-24020,22287,-32402,4883,-32402,4883,-24020,22287,25100,-21063,32767,-1,-7292,-31946,32117,6492,31311,-9659,-32402,4883,-26120,-19785,-16384,28377,-16384,-28378,-26120,-19785,20429,25618,-7292,31945,32117,6492,-24020,22287,-16384,28377,25100,-21063,31311,9658,11971,-30502,14948,29158,20429,25618,-7292,-31946,25100,-21063,-16384,-28378,31311,9658,32117,6492,-24020,-22288,11971,-30502,-26120,-19785,32767,0,0,0,0,0,0,0,0,0,0,0};
|
||||
short primary_synch1[144] = {0,0,0,0,0,0,0,0,0,0,32767,0,-31754,-8086,-24020,-22288,2448,32675,-26120,19784,27073,18458,-16384,28377,25100,21062,-29523,14217,-7292,31945,-13477,-29868,-24020,-22288,27073,18458,25100,21062,-16384,-28378,2448,-32676,-26120,19784,-29523,-14218,-7292,31945,-31754,-8086,-16384,28377,-16384,-28378,-31754,-8086,31311,-9659,27073,-18459,-26120,19784,-29523,14217,32767,-1,25100,21062,2448,-32676,31311,-9659,31311,-9659,2448,-32676,25100,21062,32767,0,-29523,14217,-26120,19784,27073,-18459,31311,-9659,-31754,-8086,-16384,-28378,-16384,28377,-31754,-8086,-7292,31945,-29523,-14218,-26120,19784,2448,-32676,-16384,-28378,25100,21062,27073,18458,-24020,-22288,-13477,-29868,-7292,31945,-29523,14217,25100,21062,-16384,28377,27073,18458,-26120,19784,2448,32675,-24020,-22288,-31754,-8086,32767,0,0,0,0,0,0,0,0,0,0,0};
|
||||
short primary_synch2[144] = {0,0,0,0,0,0,0,0,0,0,32767,0,-31754,8085,-24020,22287,2448,-32676,-26120,-19785,27073,-18459,-16384,-28378,25100,-21063,-29523,-14218,-7292,-31946,-13477,29867,-24020,22287,27073,-18459,25100,-21063,-16384,28377,2448,32675,-26120,-19785,-29523,14217,-7292,-31946,-31754,8085,-16384,-28378,-16384,28377,-31754,8085,31311,9658,27073,18458,-26120,-19785,-29523,-14218,32767,0,25100,-21063,2448,32675,31311,9658,31311,9658,2448,32675,25100,-21063,32767,0,-29523,-14218,-26120,-19785,27073,18458,31311,9658,-31754,8085,-16384,28377,-16384,-28378,-31754,8085,-7292,-31946,-29523,14217,-26120,-19785,2448,32675,-16384,28377,25100,-21063,27073,-18459,-24020,22287,-13477,29867,-7292,-31946,-29523,-14218,25100,-21063,-16384,-28378,27073,-18459,-26120,-19785,2448,-32676,-24020,22287,-31754,8085,32767,-1,0,0,0,0,0,0,0,0,0,0};
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -258,6 +258,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)
|
||||
@@ -266,6 +273,8 @@ typedef struct {
|
||||
uint8_t Mdlharq;
|
||||
/// MIMO transmission mode indicator for this sub-frame (for definition see 36-212 V8.6 2009-03, p.17)
|
||||
uint8_t Kmimo;
|
||||
/// Nsoft parameter related to UE Category
|
||||
uint32_t Nsoft;
|
||||
/// amplitude of PDSCH (compared to RS) in symbols without pilots
|
||||
int16_t sqrt_rho_a;
|
||||
/// amplitude of PDSCH (compared to RS) in symbols containing pilots
|
||||
@@ -576,13 +585,13 @@ typedef struct {
|
||||
/// UL RSSI per receive antenna
|
||||
int32_t UL_rssi[NB_ANTENNAS_RX];
|
||||
/// PUCCH1a/b power (digital linear)
|
||||
int32_t Po_PUCCH;
|
||||
uint32_t Po_PUCCH;
|
||||
/// PUCCH1a/b power (dBm)
|
||||
int32_t Po_PUCCH_dBm;
|
||||
/// PUCCH1 power (digital linear), conditioned on below threshold
|
||||
int32_t Po_PUCCH1_below;
|
||||
uint32_t Po_PUCCH1_below;
|
||||
/// PUCCH1 power (digital linear), conditioned on above threshold
|
||||
int32_t Po_PUCCH1_above;
|
||||
uint32_t Po_PUCCH1_above;
|
||||
/// Indicator that Po_PUCCH has been updated by PHY
|
||||
int32_t Po_PUCCH_update;
|
||||
/// DL Wideband CQI index (2 TBs)
|
||||
@@ -693,6 +702,8 @@ typedef struct {
|
||||
uint8_t Mdlharq;
|
||||
/// MIMO transmission mode indicator for this sub-frame (for definition see 36-212 V8.6 2009-03, p.17)
|
||||
uint8_t Kmimo;
|
||||
/// Nsoft parameter related to UE Category
|
||||
uint32_t Nsoft;
|
||||
/// Maximum number of Turbo iterations
|
||||
uint8_t max_turbo_iterations;
|
||||
/// accumulated tx power adjustment for PUCCH
|
||||
@@ -737,7 +748,7 @@ typedef struct {
|
||||
/// Aggregation level
|
||||
uint8_t L;
|
||||
/// Position of first CCE of the dci
|
||||
int nCCE;
|
||||
int firstCCE;
|
||||
/// flag to indicate that this is a RA response
|
||||
boolean_t ra_flag;
|
||||
/// rnti
|
||||
|
||||
@@ -117,7 +117,7 @@ void free_eNB_dlsch(LTE_eNB_DLSCH_t *dlsch)
|
||||
|
||||
}
|
||||
|
||||
LTE_eNB_DLSCH_t *new_eNB_dlsch(unsigned char Kmimo,unsigned char Mdlharq,unsigned char N_RB_DL, uint8_t abstraction_flag)
|
||||
LTE_eNB_DLSCH_t *new_eNB_dlsch(unsigned char Kmimo,unsigned char Mdlharq,uint32_t Nsoft,unsigned char N_RB_DL, uint8_t abstraction_flag)
|
||||
{
|
||||
|
||||
LTE_eNB_DLSCH_t *dlsch;
|
||||
@@ -148,10 +148,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",
|
||||
@@ -192,6 +196,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);
|
||||
}
|
||||
|
||||
if (exit_flag==0) {
|
||||
@@ -395,7 +401,7 @@ int dlsch_encoding(unsigned char *a,
|
||||
dlsch->harq_processes[harq_pid]->w[r],
|
||||
dlsch->harq_processes[harq_pid]->e+r_offset,
|
||||
dlsch->harq_processes[harq_pid]->C, // C
|
||||
NSOFT, // Nsoft,
|
||||
dlsch->Nsoft, // Nsoft,
|
||||
dlsch->Mdlharq,
|
||||
dlsch->Kmimo,
|
||||
dlsch->harq_processes[harq_pid]->rvidx,
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -45,7 +45,6 @@
|
||||
#include "PHY/sse_intrin.h"
|
||||
|
||||
|
||||
|
||||
#ifndef USER_MODE
|
||||
#define NOCYGWIN_STATIC static
|
||||
#else
|
||||
@@ -53,9 +52,9 @@
|
||||
#endif
|
||||
|
||||
//#define DEBUG_PHY 1
|
||||
//#define DEBUG_DLSCH_MOD 1
|
||||
//#define DEBUG_DLSCH_DEMOD 1
|
||||
|
||||
int avg[4];
|
||||
int avg[4];
|
||||
|
||||
// [MCS][i_mod (0,1,2) = (2,4,6)]
|
||||
unsigned char offset_mumimo_llr_drange_fix=0;
|
||||
@@ -3091,19 +3090,21 @@ void dlsch_alamouti(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
ch_mag1 = (__m128i *)&dl_ch_mag[2][jj];
|
||||
ch_mag0b = (__m128i *)&dl_ch_magb[0][jj];
|
||||
ch_mag1b = (__m128i *)&dl_ch_magb[2][jj];
|
||||
|
||||
|
||||
for (rb=0; rb<nb_rb; rb++) {
|
||||
|
||||
for (re=0; re<((pilots==0)?12:8); re+=2) {
|
||||
|
||||
// Alamouti RX combining
|
||||
|
||||
// printf("Alamouti: symbol %d, rb %d, re %d: rxF0 (%d,%d,%d,%d), rxF1 (%d,%d,%d,%d)\n",symbol,rb,re,rxF0[0],rxF0[1],rxF0[2],rxF0[3],rxF1[0],rxF1[1],rxF1[2],rxF1[3]);
|
||||
rxF0[0] = rxF0[0] + rxF1[2];
|
||||
rxF0[1] = rxF0[1] - rxF1[3];
|
||||
rxF0[1] = rxF0[1] - rxF1[3];
|
||||
|
||||
rxF0[2] = rxF0[2] - rxF1[0];
|
||||
rxF0[3] = rxF0[3] + rxF1[1];
|
||||
|
||||
// printf("Alamouti: rxF0 after (%d,%d,%d,%d)\n",rxF0[0],rxF0[1],rxF0[2],rxF0[3]);
|
||||
rxF0+=4;
|
||||
rxF1+=4;
|
||||
|
||||
@@ -3229,12 +3230,40 @@ unsigned short dlsch_extract_rbs_single(int **rxdataF,
|
||||
else
|
||||
rb_alloc_ind = 0;
|
||||
|
||||
if (rb_alloc_ind == 1)
|
||||
nb_rb++;
|
||||
|
||||
// For second half of RBs skip DC carrier
|
||||
if (rb==(frame_parms->N_RB_DL>>1)) {
|
||||
rxF = &rxdataF[aarx][(1 + (symbol*(frame_parms->ofdm_symbol_size)))];
|
||||
//dl_ch0++;
|
||||
}
|
||||
|
||||
// PBCH
|
||||
if ((subframe==0) && (rb>=((frame_parms->N_RB_DL>>1)-3)) && (rb<((frame_parms->N_RB_DL>>1)+3)) && (l>=nsymb>>1) && (l<((nsymb>>1) + 4))) {
|
||||
rb_alloc_ind = 0;
|
||||
}
|
||||
|
||||
//SSS
|
||||
if (((subframe==0)||(subframe==5)) && (rb>=((frame_parms->N_RB_DL>>1)-3)) && (rb<((frame_parms->N_RB_DL>>1)+3)) && (l==sss_symb) ) {
|
||||
rb_alloc_ind = 0;
|
||||
}
|
||||
|
||||
|
||||
if (frame_parms->frame_type == FDD) {
|
||||
//PSS
|
||||
if (((subframe==0)||(subframe==5)) && (rb>=((frame_parms->N_RB_DL>>1)-3)) && (rb<((frame_parms->N_RB_DL>>1)+3)) && (l==pss_symb) ) {
|
||||
rb_alloc_ind = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if ((frame_parms->frame_type == TDD) &&
|
||||
(subframe==6)) { //TDD Subframe 6
|
||||
if ((rb>=((frame_parms->N_RB_DL>>1)-3)) && (rb<((frame_parms->N_RB_DL>>1)+3)) && (l==pss_symb) ) {
|
||||
rb_alloc_ind = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (rb_alloc_ind==1) {
|
||||
*pmi_ext = (pmi>>((rb>>2)<<1))&3;
|
||||
memcpy(dl_ch0_ext,dl_ch0,12*sizeof(int));
|
||||
@@ -3272,7 +3301,7 @@ unsigned short dlsch_extract_rbs_single(int **rxdataF,
|
||||
rxF_ext+=10;
|
||||
}
|
||||
|
||||
nb_rb++;
|
||||
|
||||
}
|
||||
|
||||
dl_ch0+=12;
|
||||
@@ -3281,7 +3310,9 @@ unsigned short dlsch_extract_rbs_single(int **rxdataF,
|
||||
}
|
||||
else { // Odd number of RBs
|
||||
for (rb=0; rb<frame_parms->N_RB_DL>>1; rb++) {
|
||||
// printf("dlch_ext %d\n",dl_ch0_ext-&dl_ch_estimates_ext[aarx][0]);
|
||||
#ifdef DEBUG_DLSCH_DEMOD
|
||||
printf("dlch_ext %d\n",dl_ch0_ext-&dl_ch_estimates_ext[aarx][0]);
|
||||
#endif
|
||||
skip_half=0;
|
||||
|
||||
if (rb < 32)
|
||||
@@ -3295,6 +3326,8 @@ unsigned short dlsch_extract_rbs_single(int **rxdataF,
|
||||
else
|
||||
rb_alloc_ind = 0;
|
||||
|
||||
if (rb_alloc_ind == 1)
|
||||
nb_rb++;
|
||||
|
||||
// PBCH
|
||||
if ((subframe==0) && (rb>((frame_parms->N_RB_DL>>1)-3)) && (rb<((frame_parms->N_RB_DL>>1)+3)) && (l>=(nsymb>>1)) && (l<((nsymb>>1) + 4))) {
|
||||
@@ -3328,7 +3361,10 @@ unsigned short dlsch_extract_rbs_single(int **rxdataF,
|
||||
|
||||
//PSS in subframe 0/5 if FDD
|
||||
if (frame_parms->frame_type == FDD) { //FDD
|
||||
if (((subframe==0)||(subframe==5)) && (rb>((frame_parms->N_RB_DL>>1)-3)) && (rb<((frame_parms->N_RB_DL>>1)+3)) && (l==pss_symb) ) {
|
||||
if (((subframe==0)||(subframe==5)) &&
|
||||
(rb>((frame_parms->N_RB_DL>>1)-3)) &&
|
||||
(rb<((frame_parms->N_RB_DL>>1)+3)) &&
|
||||
(l==pss_symb) ) {
|
||||
rb_alloc_ind = 0;
|
||||
}
|
||||
|
||||
@@ -3352,55 +3388,68 @@ unsigned short dlsch_extract_rbs_single(int **rxdataF,
|
||||
|
||||
|
||||
if (rb_alloc_ind==1) {
|
||||
// printf("rb %d/symbol %d (skip_half %d)\n",rb,l,skip_half);
|
||||
|
||||
#ifdef DEBUG_DLSCH_DEMOD
|
||||
printf("rb %d/symbol %d (skip_half %d)\n",rb,l,skip_half);
|
||||
#endif
|
||||
if (pilots==0) {
|
||||
// printf("Extracting w/o pilots (symbol %d, rb %d, skip_half %d)\n",l,rb,skip_half);
|
||||
// printf("Extracting w/o pilots (symbol %d, rb %d, skip_half %d)\n",l,rb,skip_half);
|
||||
if (skip_half==1) {
|
||||
memcpy(dl_ch0_ext,dl_ch0,6*sizeof(int));
|
||||
|
||||
for (i=0; i<6; i++)
|
||||
rxF_ext[i]=rxF[i];
|
||||
|
||||
for (i=0; i<6; i++) {
|
||||
rxF_ext[i]=rxF[i];
|
||||
#ifdef DEBUG_DLSCH_DEMOD
|
||||
printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[i],*(1+(short*)&rxF_ext[i]));
|
||||
#endif
|
||||
}
|
||||
dl_ch0_ext+=6;
|
||||
rxF_ext+=6;
|
||||
} else if (skip_half==2) {
|
||||
memcpy(dl_ch0_ext,dl_ch0+6,6*sizeof(int));
|
||||
|
||||
for (i=0; i<6; i++)
|
||||
for (i=0; i<6; i++) {
|
||||
rxF_ext[i]=rxF[(i+6)];
|
||||
|
||||
#ifdef DEBUG_DLSCH_DEMOD
|
||||
printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[i],*(1+(short*)&rxF_ext[i]));
|
||||
#endif
|
||||
}
|
||||
dl_ch0_ext+=6;
|
||||
rxF_ext+=6;
|
||||
} else {
|
||||
memcpy(dl_ch0_ext,dl_ch0,12*sizeof(int));
|
||||
|
||||
for (i=0; i<12; i++)
|
||||
for (i=0; i<12; i++) {
|
||||
rxF_ext[i]=rxF[i];
|
||||
|
||||
#ifdef DEBUG_DLSCH_DEMOD
|
||||
printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[i],*(1+(short*)&rxF_ext[i]));
|
||||
#endif
|
||||
}
|
||||
dl_ch0_ext+=12;
|
||||
rxF_ext+=12;
|
||||
}
|
||||
} else {
|
||||
// printf("Extracting with pilots (symbol %d, rb %d, skip_half %d)\n",l,rb,skip_half);
|
||||
// printf("Extracting with pilots (symbol %d, rb %d, skip_half %d)\n",l,rb,skip_half);
|
||||
j=0;
|
||||
|
||||
if (skip_half==1) {
|
||||
for (i=0; i<6; i++) {
|
||||
if (i!=((frame_parms->nushift+poffset)%6)) {
|
||||
rxF_ext[j]=rxF[i];
|
||||
// printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[j],*(1+(short*)&rxF_ext[j]));
|
||||
#ifdef DEBUG_DLSCH_DEMOD
|
||||
printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[j],*(1+(short*)&rxF_ext[j]));
|
||||
#endif
|
||||
dl_ch0_ext[j++]=dl_ch0[i];
|
||||
}
|
||||
}
|
||||
|
||||
rxF_ext+=5;
|
||||
dl_ch0_ext+=5;
|
||||
rxF_ext+=5;
|
||||
} else if (skip_half==2) {
|
||||
for (i=0; i<6; i++) {
|
||||
if (i!=((frame_parms->nushift+poffset)%6)) {
|
||||
rxF_ext[j]=rxF[(i+6)];
|
||||
// printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[j],*(1+(short*)&rxF_ext[j]));
|
||||
#ifdef DEBUG_DLSCH_DEMOD
|
||||
printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[j],*(1+(short*)&rxF_ext[j]));
|
||||
#endif
|
||||
dl_ch0_ext[j++]=dl_ch0[i+6];
|
||||
}
|
||||
}
|
||||
@@ -3412,7 +3461,9 @@ unsigned short dlsch_extract_rbs_single(int **rxdataF,
|
||||
if ((i!=(frame_parms->nushift+poffset)) &&
|
||||
(i!=((frame_parms->nushift+poffset+6)%12))) {
|
||||
rxF_ext[j]=rxF[i];
|
||||
// printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[j],*(1+(short*)&rxF_ext[j]));
|
||||
#ifdef DEBUG_DLSCH_DEMOD
|
||||
printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[j],*(1+(short*)&rxF_ext[j]));
|
||||
#endif
|
||||
dl_ch0_ext[j++]=dl_ch0[i];
|
||||
|
||||
}
|
||||
@@ -3422,8 +3473,6 @@ unsigned short dlsch_extract_rbs_single(int **rxdataF,
|
||||
rxF_ext+=10;
|
||||
}
|
||||
}
|
||||
|
||||
nb_rb++;
|
||||
}
|
||||
|
||||
dl_ch0+=12;
|
||||
@@ -3444,36 +3493,42 @@ unsigned short dlsch_extract_rbs_single(int **rxdataF,
|
||||
rb_alloc_ind = 0;
|
||||
|
||||
|
||||
if (rb_alloc_ind == 1)
|
||||
nb_rb++;
|
||||
|
||||
// PBCH
|
||||
if ((subframe==0) && (rb>=((frame_parms->N_RB_DL>>1)-3)) && (rb<((frame_parms->N_RB_DL>>1)+3)) && (l>=(nsymb>>1)) && (l<((nsymb>>1) + 4))) {
|
||||
if ((subframe==0) &&
|
||||
(l>=(nsymb>>1)) &&
|
||||
(l<((nsymb>>1) + 4))) {
|
||||
rb_alloc_ind = 0;
|
||||
}
|
||||
|
||||
//SSS
|
||||
if (((subframe==0)||(subframe==5)) && (rb>=((frame_parms->N_RB_DL>>1)-3)) && (rb<((frame_parms->N_RB_DL>>1)+3)) && (l==sss_symb) ) {
|
||||
if (((subframe==0)||(subframe==5)) && (l==sss_symb) ) {
|
||||
rb_alloc_ind = 0;
|
||||
}
|
||||
|
||||
if (frame_parms->frame_type == FDD) {
|
||||
//PSS
|
||||
if (((subframe==0)||(subframe==5)) && (rb>=((frame_parms->N_RB_DL>>1)-3)) && (rb<((frame_parms->N_RB_DL>>1)+3)) && (l==pss_symb) ) {
|
||||
if (((subframe==0)||(subframe==5)) && (l==pss_symb) ) {
|
||||
rb_alloc_ind = 0;
|
||||
}
|
||||
}
|
||||
|
||||
//PSS
|
||||
if ((frame_parms->frame_type == TDD) &&
|
||||
(subframe==6)) {
|
||||
//PSS
|
||||
if ((rb>((frame_parms->N_RB_DL>>1)-3)) && (rb<((frame_parms->N_RB_DL>>1)+3)) && (l==pss_symb) ) {
|
||||
rb_alloc_ind = 0;
|
||||
}
|
||||
(subframe==6) &&
|
||||
(l==pss_symb) ) {
|
||||
rb_alloc_ind = 0;
|
||||
}
|
||||
|
||||
|
||||
// printf("dlch_ext %d\n",dl_ch0_ext-&dl_ch_estimates_ext[aarx][0]);
|
||||
// printf("DC rb %d (%p)\n",rb,rxF);
|
||||
if (rb_alloc_ind==1) {
|
||||
// printf("rb %d/symbol %d (skip_half %d)\n",rb,l,skip_half);
|
||||
#ifdef DEBUG_DLSCH_DEMOD
|
||||
printf("rb %d/symbol %d (skip_half %d)\n",rb,l,skip_half);
|
||||
#endif
|
||||
if (pilots==0) {
|
||||
for (i=0; i<6; i++) {
|
||||
dl_ch0_ext[i]=dl_ch0[i];
|
||||
@@ -3496,7 +3551,9 @@ unsigned short dlsch_extract_rbs_single(int **rxdataF,
|
||||
if (i!=((frame_parms->nushift+poffset)%6)) {
|
||||
dl_ch0_ext[j]=dl_ch0[i];
|
||||
rxF_ext[j++]=rxF[i];
|
||||
// printf("**extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[j-1],*(1+(short*)&rxF_ext[j-1]));
|
||||
#ifdef DEBUG_DLSCH_DEMOD
|
||||
printf("**extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[j-1],*(1+(short*)&rxF_ext[j-1]));
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3506,7 +3563,9 @@ unsigned short dlsch_extract_rbs_single(int **rxdataF,
|
||||
if (i!=((frame_parms->nushift+6+poffset)%12)) {
|
||||
dl_ch0_ext[j]=dl_ch0[i];
|
||||
rxF_ext[j++]=rxF[(1+i-6)];
|
||||
// printf("**extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[j-1],*(1+(short*)&rxF_ext[j-1]));
|
||||
#ifdef DEBUG_DLSCH_DEMOD
|
||||
printf("**extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[j-1],*(1+(short*)&rxF_ext[j-1]));
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3514,7 +3573,6 @@ unsigned short dlsch_extract_rbs_single(int **rxdataF,
|
||||
rxF_ext+=10;
|
||||
} // symbol_mod==0
|
||||
|
||||
nb_rb++;
|
||||
} // rballoc==1
|
||||
else {
|
||||
rxF = &rxdataF[aarx][((symbol*(frame_parms->ofdm_symbol_size)))];
|
||||
@@ -3540,7 +3598,8 @@ unsigned short dlsch_extract_rbs_single(int **rxdataF,
|
||||
else
|
||||
rb_alloc_ind = 0;
|
||||
|
||||
|
||||
if (rb_alloc_ind == 1)
|
||||
nb_rb++;
|
||||
|
||||
// PBCH
|
||||
if ((subframe==0) && (rb>((frame_parms->N_RB_DL>>1)-3)) && (rb<((frame_parms->N_RB_DL>>1)+3)) && (l>=nsymb>>1) && (l<((nsymb>>1) + 4))) {
|
||||
@@ -3590,7 +3649,9 @@ unsigned short dlsch_extract_rbs_single(int **rxdataF,
|
||||
}
|
||||
|
||||
if (rb_alloc_ind==1) {
|
||||
// printf("rb %d/symbol %d (skip_half %d)\n",rb,l,skip_half);
|
||||
#ifdef DEBUG_DLSCH_DEMOD
|
||||
printf("rb %d/symbol %d (skip_half %d)\n",rb,l,skip_half);
|
||||
#endif
|
||||
/*
|
||||
printf("rb %d\n",rb);
|
||||
for (i=0;i<12;i++)
|
||||
@@ -3598,43 +3659,54 @@ unsigned short dlsch_extract_rbs_single(int **rxdataF,
|
||||
printf("\n");
|
||||
*/
|
||||
if (pilots==0) {
|
||||
// printf("Extracting w/o pilots (symbol %d, rb %d, skip_half %d)\n",l,rb,skip_half);
|
||||
// printf("Extracting w/o pilots (symbol %d, rb %d, skip_half %d)\n",l,rb,skip_half);
|
||||
if (skip_half==1) {
|
||||
memcpy(dl_ch0_ext,dl_ch0,6*sizeof(int));
|
||||
|
||||
for (i=0; i<6; i++)
|
||||
for (i=0; i<6; i++) {
|
||||
rxF_ext[i]=rxF[i];
|
||||
|
||||
#ifdef DEBUG_DLSCH_DEMOD
|
||||
printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[i],*(1+(short*)&rxF_ext[i]));
|
||||
#endif
|
||||
}
|
||||
dl_ch0_ext+=6;
|
||||
rxF_ext+=6;
|
||||
|
||||
} else if (skip_half==2) {
|
||||
memcpy(dl_ch0_ext,dl_ch0+6,6*sizeof(int));
|
||||
|
||||
for (i=0; i<6; i++)
|
||||
for (i=0; i<6; i++) {
|
||||
rxF_ext[i]=rxF[(i+6)];
|
||||
|
||||
#ifdef DEBUG_DLSCH_DEMOD
|
||||
printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[i],*(1+(short*)&rxF_ext[i]));
|
||||
#endif
|
||||
}
|
||||
dl_ch0_ext+=6;
|
||||
rxF_ext+=6;
|
||||
|
||||
} else {
|
||||
memcpy(dl_ch0_ext,dl_ch0,12*sizeof(int));
|
||||
|
||||
for (i=0; i<12; i++)
|
||||
for (i=0; i<12; i++) {
|
||||
rxF_ext[i]=rxF[i];
|
||||
|
||||
#ifdef DEBUG_DLSCH_DEMOD
|
||||
printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[i],*(1+(short*)&rxF_ext[i]));
|
||||
#endif
|
||||
}
|
||||
dl_ch0_ext+=12;
|
||||
rxF_ext+=12;
|
||||
}
|
||||
} else {
|
||||
// printf("Extracting with pilots (symbol %d, rb %d, skip_half %d)\n",l,rb,skip_half);
|
||||
// printf("Extracting with pilots (symbol %d, rb %d, skip_half %d)\n",l,rb,skip_half);
|
||||
j=0;
|
||||
|
||||
if (skip_half==1) {
|
||||
for (i=0; i<6; i++) {
|
||||
if (i!=((frame_parms->nushift+poffset)%6)) {
|
||||
rxF_ext[j]=rxF[i];
|
||||
// printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[j],*(1+(short*)&rxF_ext[j]));
|
||||
#ifdef DEBUG_DLSCH_DEMOD
|
||||
printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[j],*(1+(short*)&rxF_ext[j]));
|
||||
#endif
|
||||
dl_ch0_ext[j++]=dl_ch0[i];
|
||||
}
|
||||
}
|
||||
@@ -3645,7 +3717,9 @@ unsigned short dlsch_extract_rbs_single(int **rxdataF,
|
||||
for (i=0; i<6; i++) {
|
||||
if (i!=((frame_parms->nushift+poffset)%6)) {
|
||||
rxF_ext[j]=rxF[(i+6)];
|
||||
// printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[j],*(1+(short*)&rxF_ext[j]));
|
||||
#ifdef DEBUG_DLSCH_DEMOD
|
||||
printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[j],*(1+(short*)&rxF_ext[j]));
|
||||
#endif
|
||||
dl_ch0_ext[j++]=dl_ch0[i+6];
|
||||
}
|
||||
}
|
||||
@@ -3657,7 +3731,9 @@ unsigned short dlsch_extract_rbs_single(int **rxdataF,
|
||||
if ((i!=(frame_parms->nushift+poffset)) &&
|
||||
(i!=((frame_parms->nushift+poffset+6)%12))) {
|
||||
rxF_ext[j]=rxF[i];
|
||||
// printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[j],*(1+(short*)&rxF_ext[j]));
|
||||
#ifdef DEBUG_DLSCH_DEMOD
|
||||
printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[j],*(1+(short*)&rxF_ext[j]));
|
||||
#endif
|
||||
dl_ch0_ext[j++]=dl_ch0[i];
|
||||
}
|
||||
}
|
||||
@@ -3666,8 +3742,6 @@ unsigned short dlsch_extract_rbs_single(int **rxdataF,
|
||||
rxF_ext+=10;
|
||||
}
|
||||
} // pilots=0
|
||||
|
||||
nb_rb++;
|
||||
}
|
||||
|
||||
dl_ch0+=12;
|
||||
@@ -3749,52 +3823,58 @@ unsigned short dlsch_extract_rbs_dual(int **rxdataF,
|
||||
rb_alloc_ind = (rb_alloc[3]>>(prb-96)) & 1;
|
||||
else
|
||||
rb_alloc_ind = 0;
|
||||
|
||||
// PBCH
|
||||
if ((subframe==0) &&
|
||||
(prb>((frame_parms->N_RB_DL>>1)-3)) &&
|
||||
(prb<((frame_parms->N_RB_DL>>1)+3)) &&
|
||||
(l>=(nsymb>>1)) &&
|
||||
(l<((nsymb>>1) + 4))) {
|
||||
rb_alloc_ind = 0;
|
||||
// printf("symbol %d / rb %d: skipping PBCH REs\n",symbol,prb);
|
||||
}
|
||||
|
||||
//SSS
|
||||
|
||||
if (((subframe==0)||(subframe==5)) &&
|
||||
(prb>((frame_parms->N_RB_DL>>1)-3)) &&
|
||||
(prb<((frame_parms->N_RB_DL>>1)+3)) &&
|
||||
(l==sss_symb) ) {
|
||||
rb_alloc_ind = 0;
|
||||
// printf("symbol %d / rb %d: skipping SSS REs\n",symbol,prb);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//PSS in subframe 0/5 if FDD
|
||||
if (frame_parms->frame_type == FDD) { //FDD
|
||||
if (((subframe==0)||(subframe==5)) &&
|
||||
(prb>((frame_parms->N_RB_DL>>1)-3)) &&
|
||||
(prb<((frame_parms->N_RB_DL>>1)+3)) &&
|
||||
(l==pss_symb) ) {
|
||||
rb_alloc_ind = 0;
|
||||
// printf("symbol %d / rb %d: skipping PSS REs\n",symbol,prb);
|
||||
}
|
||||
}
|
||||
|
||||
if ((frame_parms->frame_type == TDD) &&
|
||||
(subframe==6)) { //TDD Subframe 6
|
||||
if ((prb>=((frame_parms->N_RB_DL>>1)-3)) &&
|
||||
(prb<=((frame_parms->N_RB_DL>>1)+3)) &&
|
||||
(l==pss_symb) ) {
|
||||
rb_alloc_ind = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (rb_alloc_ind==1) { // PRB is allocated
|
||||
|
||||
if ((frame_parms->N_RB_DL&1) == 0) { // even number of RBs
|
||||
if (rb_alloc_ind == 1)
|
||||
nb_rb++;
|
||||
|
||||
|
||||
if ((frame_parms->N_RB_DL&1) == 0) { // even number of RBs
|
||||
|
||||
// PBCH
|
||||
if ((subframe==0) &&
|
||||
(prb>=((frame_parms->N_RB_DL>>1)-3)) &&
|
||||
(prb<((frame_parms->N_RB_DL>>1)+3)) &&
|
||||
(l>=(nsymb>>1)) &&
|
||||
(l<((nsymb>>1) + 4))) {
|
||||
rb_alloc_ind = 0;
|
||||
// printf("symbol %d / rb %d: skipping PBCH REs\n",symbol,prb);
|
||||
}
|
||||
|
||||
//SSS
|
||||
|
||||
if (((subframe==0)||(subframe==5)) &&
|
||||
(prb>=((frame_parms->N_RB_DL>>1)-3)) &&
|
||||
(prb<((frame_parms->N_RB_DL>>1)+3)) &&
|
||||
(l==sss_symb) ) {
|
||||
rb_alloc_ind = 0;
|
||||
// printf("symbol %d / rb %d: skipping SSS REs\n",symbol,prb);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//PSS in subframe 0/5 if FDD
|
||||
if (frame_parms->frame_type == FDD) { //FDD
|
||||
if (((subframe==0)||(subframe==5)) &&
|
||||
(prb>=((frame_parms->N_RB_DL>>1)-3)) &&
|
||||
(prb<((frame_parms->N_RB_DL>>1)+3)) &&
|
||||
(l==pss_symb) ) {
|
||||
rb_alloc_ind = 0;
|
||||
// printf("symbol %d / rb %d: skipping PSS REs\n",symbol,prb);
|
||||
}
|
||||
}
|
||||
|
||||
if ((frame_parms->frame_type == TDD) &&
|
||||
(subframe==6)) { //TDD Subframe 6
|
||||
if ((prb>=((frame_parms->N_RB_DL>>1)-3)) &&
|
||||
(prb<((frame_parms->N_RB_DL>>1)+3)) &&
|
||||
(l==pss_symb) ) {
|
||||
rb_alloc_ind = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (rb_alloc_ind==1) { // PRB is allocated
|
||||
|
||||
|
||||
|
||||
prb_off = 12*prb;
|
||||
prb_off2 = 1+(12*(prb-(frame_parms->N_RB_DL>>1)));
|
||||
@@ -3839,12 +3919,55 @@ unsigned short dlsch_extract_rbs_dual(int **rxdataF,
|
||||
rxF_ext+=8;
|
||||
} // pilots==1
|
||||
|
||||
nb_rb++;
|
||||
}
|
||||
} else { // Odd number of RBs
|
||||
|
||||
} else { // Odd number of RBs
|
||||
|
||||
// PBCH
|
||||
if ((subframe==0) &&
|
||||
(prb>((frame_parms->N_RB_DL>>1)-3)) &&
|
||||
(prb<((frame_parms->N_RB_DL>>1)+3)) &&
|
||||
(l>=(nsymb>>1)) &&
|
||||
(l<((nsymb>>1) + 4))) {
|
||||
rb_alloc_ind = 0;
|
||||
// printf("symbol %d / rb %d: skipping PBCH REs\n",symbol,prb);
|
||||
}
|
||||
|
||||
//SSS
|
||||
|
||||
if (((subframe==0)||(subframe==5)) &&
|
||||
(prb>((frame_parms->N_RB_DL>>1)-3)) &&
|
||||
(prb<((frame_parms->N_RB_DL>>1)+3)) &&
|
||||
(l==sss_symb) ) {
|
||||
rb_alloc_ind = 0;
|
||||
// printf("symbol %d / rb %d: skipping SSS REs\n",symbol,prb);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//PSS in subframe 0/5 if FDD
|
||||
if (frame_parms->frame_type == FDD) { //FDD
|
||||
if (((subframe==0)||(subframe==5)) &&
|
||||
(prb>((frame_parms->N_RB_DL>>1)-3)) &&
|
||||
(prb<((frame_parms->N_RB_DL>>1)+3)) &&
|
||||
(l==pss_symb) ) {
|
||||
rb_alloc_ind = 0;
|
||||
// printf("symbol %d / rb %d: skipping PSS REs\n",symbol,prb);
|
||||
}
|
||||
}
|
||||
|
||||
if ((frame_parms->frame_type == TDD) &&
|
||||
((subframe==1) || (subframe==6))) { //TDD Subframe 1-6
|
||||
if ((prb>((frame_parms->N_RB_DL>>1)-3)) &&
|
||||
(prb<((frame_parms->N_RB_DL>>1)+3)) &&
|
||||
(l==pss_symb) ) {
|
||||
rb_alloc_ind = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (rb_alloc_ind == 1) {
|
||||
skip_half=0;
|
||||
|
||||
|
||||
//Check if we have to drop half a PRB due to PSS/SSS/PBCH
|
||||
// skip_half == 0 means full PRB
|
||||
// skip_half == 1 means first half is used (leftmost half-PRB from PSS/SSS/PBCH)
|
||||
@@ -3875,13 +3998,12 @@ unsigned short dlsch_extract_rbs_dual(int **rxdataF,
|
||||
if (((frame_parms->frame_type == FDD) &&
|
||||
(((subframe==0)||(subframe==5)))) || //FDD Subframes 0,5
|
||||
((frame_parms->frame_type == TDD) &&
|
||||
(((subframe==2) || (subframe==6))))) { //TDD Subframes 2,6
|
||||
(((subframe==1) || (subframe==6))))) { //TDD Subframes 1,6
|
||||
|
||||
if ((prb==((frame_parms->N_RB_DL>>1)-3)) &&
|
||||
(l==pss_symb))
|
||||
skip_half=1;
|
||||
else if (((subframe==0)||(subframe==5)) &&
|
||||
(prb==((frame_parms->N_RB_DL>>1)+3)) &&
|
||||
else if ((prb==((frame_parms->N_RB_DL>>1)+3)) &&
|
||||
(l==pss_symb))
|
||||
skip_half=2;
|
||||
}
|
||||
@@ -3901,9 +4023,9 @@ unsigned short dlsch_extract_rbs_dual(int **rxdataF,
|
||||
rxF = &rxdataF[aarx][prb_off2+
|
||||
(symbol*(frame_parms->ofdm_symbol_size))];
|
||||
}
|
||||
|
||||
// printf("symbol %d / rb %d: alloc %d skip_half %d (rxF %p, rxF_ext %p) prb_off (%d,%d)\n",symbol,prb,rb_alloc_ind,skip_half,rxF,rxF_ext,prb_off,prb_off2);
|
||||
|
||||
#ifdef DEBUG_DLSCH_DEMOD
|
||||
printf("symbol %d / rb %d: alloc %d skip_half %d (rxF %p, rxF_ext %p) prb_off (%d,%d)\n",symbol,prb,rb_alloc_ind,skip_half,rxF,rxF_ext,prb_off,prb_off2);
|
||||
#endif
|
||||
*pmi_loc = (pmi>>((prb>>2)<<1))&3;
|
||||
// printf("symbol_mod %d (pilots %d) rb %d, sb %d, pmi %d (pmi_loc %p,rxF %p, ch00 %p, ch01 %p, rxF_ext %p dl_ch0_ext %p dl_ch1_ext %p)\n",symbol_mod,pilots,rb,rb>>2,*pmi_loc,pmi_loc,rxF,dl_ch0, dl_ch1, rxF_ext,dl_ch0_ext,dl_ch1_ext);
|
||||
|
||||
@@ -3915,6 +4037,10 @@ unsigned short dlsch_extract_rbs_dual(int **rxdataF,
|
||||
memcpy(dl_ch0_ext,dl_ch0p,6*sizeof(int32_t));
|
||||
memcpy(dl_ch1_ext,dl_ch1p,6*sizeof(int32_t));
|
||||
memcpy(rxF_ext,rxF,6*sizeof(int32_t));
|
||||
#ifdef DEBUG_DLSCH_DEMOD
|
||||
for (i=0;i<6;i++)
|
||||
printf("extract rb %d, re %d => (%d,%d)\n",prb,i,*(short *)&rxF_ext[i],*(1+(short*)&rxF_ext[i]));
|
||||
#endif
|
||||
dl_ch0_ext+=6;
|
||||
dl_ch1_ext+=6;
|
||||
rxF_ext+=6;
|
||||
@@ -3922,6 +4048,10 @@ unsigned short dlsch_extract_rbs_dual(int **rxdataF,
|
||||
memcpy(dl_ch0_ext,dl_ch0p+6,6*sizeof(int32_t));
|
||||
memcpy(dl_ch1_ext,dl_ch1p+6,6*sizeof(int32_t));
|
||||
memcpy(rxF_ext,rxF+6,6*sizeof(int32_t));
|
||||
#ifdef DEBUG_DLSCH_DEMOD
|
||||
for (i=0;i<6;i++)
|
||||
printf("extract rb %d, re %d => (%d,%d)\n",prb,i,*(short *)&rxF_ext[i],*(1+(short*)&rxF_ext[i]));
|
||||
#endif
|
||||
dl_ch0_ext+=6;
|
||||
dl_ch1_ext+=6;
|
||||
rxF_ext+=6;
|
||||
@@ -3929,8 +4059,10 @@ unsigned short dlsch_extract_rbs_dual(int **rxdataF,
|
||||
memcpy(dl_ch0_ext,dl_ch0p,12*sizeof(int32_t));
|
||||
memcpy(dl_ch1_ext,dl_ch1p,12*sizeof(int32_t));
|
||||
memcpy(rxF_ext,rxF,12*sizeof(int32_t));
|
||||
#ifdef DEBUG_DLSCH_DEMOD
|
||||
for (i=0;i<12;i++)
|
||||
// printf("extract rb %d, re %d => (%d,%d)\n",prb,i,*(short *)&rxF_ext[i],*(1+(short*)&rxF_ext[i]));
|
||||
printf("extract rb %d, re %d => (%d,%d)\n",prb,i,*(short *)&rxF_ext[i],*(1+(short*)&rxF_ext[i]));
|
||||
#endif
|
||||
dl_ch0_ext+=12;
|
||||
dl_ch1_ext+=12;
|
||||
rxF_ext+=12;
|
||||
@@ -3943,7 +4075,9 @@ unsigned short dlsch_extract_rbs_dual(int **rxdataF,
|
||||
if ((i!=frame_parms->nushift) &&
|
||||
(i!=((frame_parms->nushift+3)%6))) {
|
||||
rxF_ext[j]=rxF[i];
|
||||
// printf("(pilots,skip1)extract rb %d, re %d => (%d,%d)\n",prb,i,*(short *)&rxF_ext[j],*(1+(short*)&rxF_ext[j]));
|
||||
#ifdef DEBUG_DLSCH_DEMOD
|
||||
printf("(pilots,skip1)extract rb %d, re %d (%d)=> (%d,%d)\n",prb,i,j,*(short *)&rxF_ext[j],*(1+(short*)&rxF_ext[j]));
|
||||
#endif
|
||||
dl_ch0_ext[j]=dl_ch0p[i];
|
||||
dl_ch1_ext[j++]=dl_ch1p[i];
|
||||
}
|
||||
@@ -3956,15 +4090,17 @@ unsigned short dlsch_extract_rbs_dual(int **rxdataF,
|
||||
if ((i!=frame_parms->nushift) &&
|
||||
(i!=((frame_parms->nushift+3)%6))) {
|
||||
rxF_ext[j]=rxF[(i+6)];
|
||||
// printf("(pilots,skip2)extract rb %d, re %d => (%d,%d)\n",prb,i,*(short *)&rxF_ext[j],*(1+(short*)&rxF_ext[j]));
|
||||
#ifdef DEBUG_DLSCH_DEMOD
|
||||
printf("(pilots,skip2)extract rb %d, re %d (%d) => (%d,%d)\n",prb,i,j,*(short *)&rxF_ext[j],*(1+(short*)&rxF_ext[j]));
|
||||
#endif
|
||||
dl_ch0_ext[j]=dl_ch0p[i+6];
|
||||
dl_ch1_ext[j++]=dl_ch1p[i+6];
|
||||
}
|
||||
|
||||
dl_ch0_ext+=4;
|
||||
dl_ch1_ext+=4;
|
||||
rxF_ext+=4;
|
||||
}
|
||||
dl_ch0_ext+=4;
|
||||
dl_ch1_ext+=4;
|
||||
rxF_ext+=4;
|
||||
|
||||
} else { //skip_half==0
|
||||
for (i=0; i<12; i++) {
|
||||
if ((i!=frame_parms->nushift) &&
|
||||
@@ -3972,7 +4108,9 @@ unsigned short dlsch_extract_rbs_dual(int **rxdataF,
|
||||
(i!=frame_parms->nushift+6) &&
|
||||
(i!=((frame_parms->nushift+9)%12))) {
|
||||
rxF_ext[j]=rxF[i];
|
||||
// printf("(pilots)extract rb %d, re %d => (%d,%d)\n",prb,i,*(short *)&rxF_ext[j],*(1+(short*)&rxF_ext[j]));
|
||||
#ifdef DEBUG_DLSCH_DEMOD
|
||||
printf("(pilots)extract rb %d, re %d => (%d,%d)\n",prb,i,*(short *)&rxF_ext[j],*(1+(short*)&rxF_ext[j]));
|
||||
#endif
|
||||
dl_ch0_ext[j] =dl_ch0p[i];
|
||||
dl_ch1_ext[j++]=dl_ch1p[i];
|
||||
}
|
||||
@@ -3982,31 +4120,33 @@ unsigned short dlsch_extract_rbs_dual(int **rxdataF,
|
||||
rxF_ext+=8;
|
||||
} //skip_half==0
|
||||
} //pilots==1
|
||||
nb_rb++;
|
||||
} else { // Do middle RB (around DC)
|
||||
|
||||
if (pilots==0) {
|
||||
memcpy(dl_ch0_ext,dl_ch0p,6*sizeof(int32_t));
|
||||
memcpy(dl_ch1_ext,dl_ch1p,6*sizeof(int32_t));
|
||||
memcpy(rxF_ext,rxF,6*sizeof(int32_t));
|
||||
/*
|
||||
#ifdef DEBUG_DLSCH_DEMOD
|
||||
for (i=0; i<6; i++) {
|
||||
printf("extract rb %d, re %d => (%d,%d)\n",prb,i,*(short *)&rxF_ext[i],*(1+(short*)&rxF_ext[i]));
|
||||
}*/
|
||||
}
|
||||
#endif
|
||||
rxF_ext+=6;
|
||||
dl_ch0_ext+=6;
|
||||
dl_ch1_ext+=6;
|
||||
dl_ch0p+=6;
|
||||
dl_ch1p+=6;
|
||||
|
||||
rxF = &rxdataF[aarx][((symbol*(frame_parms->ofdm_symbol_size)))];
|
||||
rxF = &rxdataF[aarx][1+((symbol*(frame_parms->ofdm_symbol_size)))];
|
||||
|
||||
memcpy(dl_ch0_ext,dl_ch0p,6*sizeof(int32_t));
|
||||
memcpy(dl_ch1_ext,dl_ch1p,6*sizeof(int32_t));
|
||||
memcpy(rxF_ext,rxF,6*sizeof(int32_t));
|
||||
/*for (i=0; i<6; i++) {
|
||||
#ifdef DEBUG_DLSCH_DEMOD
|
||||
for (i=0; i<6; i++) {
|
||||
printf("extract rb %d, re %d => (%d,%d)\n",prb,i,*(short *)&rxF_ext[i],*(1+(short*)&rxF_ext[i]));
|
||||
}*/
|
||||
}
|
||||
#endif
|
||||
rxF_ext+=6;
|
||||
dl_ch0_ext+=6;
|
||||
dl_ch1_ext+=6;
|
||||
@@ -4019,18 +4159,22 @@ unsigned short dlsch_extract_rbs_dual(int **rxdataF,
|
||||
dl_ch0_ext[j]=dl_ch0p[i];
|
||||
dl_ch1_ext[j]=dl_ch1p[i];
|
||||
rxF_ext[j++]=rxF[i];
|
||||
//printf("(pilots)extract rb %d, re %d => (%d,%d)\n",prb,i,*(short *)&rxF[i],*(1+(short*)&rxF[i]));
|
||||
#ifdef DEBUG_DLSCH_DEMOD
|
||||
printf("(pilots)extract rb %d, re %d (%d) => (%d,%d)\n",prb,i,j,*(short *)&rxF[i],*(1+(short*)&rxF[i]));
|
||||
#endif
|
||||
}
|
||||
}
|
||||
rxF = &rxdataF[aarx][symbol*(frame_parms->ofdm_symbol_size)];
|
||||
rxF = &rxdataF[aarx][1+symbol*(frame_parms->ofdm_symbol_size)];
|
||||
|
||||
for (; i<12; i++) {
|
||||
if ((i!=((frame_parms->nushift+6)%12)) &&
|
||||
(i!=((frame_parms->nushift+9)%12))) {
|
||||
dl_ch0_ext[j]=dl_ch0p[i];
|
||||
dl_ch1_ext[j]=dl_ch1p[i];
|
||||
rxF_ext[j++]=rxF[(1+i-6)];
|
||||
//printf("(pilots)extract rb %d, re %d => (%d,%d)\n",prb,i,*(short *)&rxF[1+i-6],*(1+(short*)&rxF[1+i-6]));
|
||||
rxF_ext[j++]=rxF[i-6];
|
||||
#ifdef DEBUG_DLSCH_DEMOD
|
||||
printf("(pilots)extract rb %d, re %d (%d) => (%d,%d)\n",prb,i,j,*(short *)&rxF[1+i-6],*(1+(short*)&rxF[1+i-6]));
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4038,7 +4182,6 @@ unsigned short dlsch_extract_rbs_dual(int **rxdataF,
|
||||
dl_ch1_ext+=8;
|
||||
rxF_ext+=8;
|
||||
} //pilots==1
|
||||
nb_rb++;
|
||||
} // if Middle PRB
|
||||
} // if odd PRB
|
||||
} // if rballoc==1
|
||||
@@ -4126,7 +4269,7 @@ void dump_dlsch2(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint16_t coded_bits_per
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG_DLSCH_DEMOD
|
||||
|
||||
/*
|
||||
void print_bytes(char *s,__m128i *x)
|
||||
{
|
||||
|
||||
@@ -4164,5 +4307,5 @@ void print_ints(char *s,__m128i *x)
|
||||
printf("%s : %d,%d,%d,%d\n",s,
|
||||
tempb[0],tempb[1],tempb[2],tempb[3]);
|
||||
|
||||
}
|
||||
}*/
|
||||
#endif
|
||||
|
||||
@@ -662,16 +662,19 @@ int dlsch_qpsk_llr(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
|
||||
if ((symbol_mod==0) || (symbol_mod==(4-frame_parms->Ncp))) {
|
||||
if (frame_parms->mode1_flag==0)
|
||||
len = (nb_rb*8);// - (2*pbch_pss_sss_adjust/3);
|
||||
len = (nb_rb*8) - (2*pbch_pss_sss_adjust/3);
|
||||
else
|
||||
len = (nb_rb*10);// - (5*pbch_pss_sss_adjust/6);
|
||||
len = (nb_rb*10) - (5*pbch_pss_sss_adjust/6);
|
||||
} else {
|
||||
len = (nb_rb*12);// - pbch_pss_sss_adjust;
|
||||
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);
|
||||
|
||||
// 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]);
|
||||
rxF++;
|
||||
llr32++;
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
#include "gain_control.h"
|
||||
#endif
|
||||
|
||||
#if defined(OAI_USRP) || defined(EXMIMO)
|
||||
#if defined(OAI_USRP) || defined(EXMIMO) || defined(OAI_LMSSDR)
|
||||
#include "common_lib.h"
|
||||
extern openair0_config_t openair0_cfg[];
|
||||
#endif
|
||||
@@ -280,7 +280,6 @@ int initial_sync(PHY_VARS_UE *phy_vars_ue, runmode_t mode)
|
||||
uint8_t flip_fdd_ncp,flip_fdd_ecp,flip_tdd_ncp,flip_tdd_ecp;
|
||||
// uint16_t Nid_cell_fdd_ncp=0,Nid_cell_fdd_ecp=0,Nid_cell_tdd_ncp=0,Nid_cell_tdd_ecp=0;
|
||||
LTE_DL_FRAME_PARMS *frame_parms = &phy_vars_ue->lte_frame_parms;
|
||||
int i;
|
||||
int ret=-1;
|
||||
int aarx,rx_power=0;
|
||||
/*#ifdef OAI_USRP
|
||||
@@ -291,17 +290,10 @@ int initial_sync(PHY_VARS_UE *phy_vars_ue, runmode_t mode)
|
||||
frame_parms->Ncp=NORMAL;
|
||||
frame_parms->frame_type=FDD;
|
||||
init_frame_parms(frame_parms,1);
|
||||
|
||||
// write_output("rxdata0.m","rxd0",phy_vars_ue->lte_ue_common_vars.rxdata[0],10*frame_parms->samples_per_tti,1,1);
|
||||
|
||||
/*#ifdef OAI_USRP
|
||||
for (aarx = 0; aarx<frame_parms->nb_antennas_rx;aarx++) {
|
||||
rxdata128 = (__m128i*)phy_vars_ue->lte_ue_common_vars.rxdata[aarx];
|
||||
for (i=0; i<(frame_parms->samples_per_tti*10)>>2; i++) {
|
||||
rxdata128[i] = _mm_srai_epi16(rxdata128[i],4);
|
||||
}
|
||||
}
|
||||
#endif*/
|
||||
/*
|
||||
write_output("rxdata0.m","rxd0",phy_vars_ue->lte_ue_common_vars.rxdata[0],10*frame_parms->samples_per_tti,1,1);
|
||||
exit(-1);
|
||||
*/
|
||||
sync_pos = lte_sync_time(phy_vars_ue->lte_ue_common_vars.rxdata,
|
||||
frame_parms,
|
||||
(int *)&phy_vars_ue->lte_ue_common_vars.eNb_id);
|
||||
@@ -316,30 +308,6 @@ int initial_sync(PHY_VARS_UE *phy_vars_ue, runmode_t mode)
|
||||
LOG_I(PHY,"[UE%d] Initial sync : Estimated PSS position %d, Nid2 %d\n",phy_vars_ue->Mod_id,sync_pos,phy_vars_ue->lte_ue_common_vars.eNb_id);
|
||||
#endif
|
||||
|
||||
|
||||
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++)
|
||||
rx_power += signal_energy(&phy_vars_ue->lte_ue_common_vars.rxdata[aarx][sync_pos2],
|
||||
frame_parms->ofdm_symbol_size+frame_parms->nb_prefix_samples);
|
||||
|
||||
phy_vars_ue->PHY_measurements.rx_power_avg_dB[0] = dB_fixed(rx_power/frame_parms->nb_antennas_rx);
|
||||
|
||||
#ifdef DEBUG_INITIAL_SYNCH
|
||||
LOG_I(PHY,"[UE%d] Initial sync : Estimated power: %d dB\n",phy_vars_ue->Mod_id,phy_vars_ue->PHY_measurements.rx_power_avg_dB[0] );
|
||||
#endif
|
||||
|
||||
#ifdef EXMIMO
|
||||
|
||||
if ((openair_daq_vars.rx_gain_mode == DAQ_AGC_ON) &&
|
||||
(mode != rx_calib_ue) && (mode != rx_calib_ue_med) && (mode != rx_calib_ue_byp) )
|
||||
//phy_adjust_gain(phy_vars_ue,0);
|
||||
gain_control_all(phy_vars_ue->PHY_measurements.rx_power_avg_dB[0],0);
|
||||
|
||||
#else
|
||||
#ifndef OAI_USRP
|
||||
phy_adjust_gain(phy_vars_ue,0);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// SSS detection
|
||||
|
||||
// PSS is hypothesized in last symbol of first slot in Frame
|
||||
@@ -528,20 +496,20 @@ int initial_sync(PHY_VARS_UE *phy_vars_ue, runmode_t mode)
|
||||
#endif
|
||||
|
||||
if (phy_vars_ue->UE_scan_carrier == 0) {
|
||||
#ifdef OPENAIR2
|
||||
LOG_I(PHY,"[UE%d] Sending synch status to higher layers\n",phy_vars_ue->Mod_id);
|
||||
//mac_resynch();
|
||||
mac_xface->dl_phy_sync_success(phy_vars_ue->Mod_id,phy_vars_ue->frame_rx,0,1);//phy_vars_ue->lte_ue_common_vars.eNb_id);
|
||||
#endif //OPENAIR2
|
||||
|
||||
if (phy_vars_ue->mac_enabled==1) {
|
||||
LOG_I(PHY,"[UE%d] Sending synch status to higher layers\n",phy_vars_ue->Mod_id);
|
||||
//mac_resynch();
|
||||
mac_xface->dl_phy_sync_success(phy_vars_ue->Mod_id,phy_vars_ue->frame_rx,0,1);//phy_vars_ue->lte_ue_common_vars.eNb_id);
|
||||
phy_vars_ue->UE_mode[0] = PRACH;
|
||||
}
|
||||
else {
|
||||
phy_vars_ue->UE_mode[0] = PUSCH;
|
||||
}
|
||||
|
||||
generate_pcfich_reg_mapping(frame_parms);
|
||||
generate_phich_reg_mapping(frame_parms);
|
||||
// init_prach625(frame_parms);
|
||||
#ifndef OPENAIR2
|
||||
phy_vars_ue->UE_mode[0] = PUSCH;
|
||||
#else
|
||||
phy_vars_ue->UE_mode[0] = PRACH;
|
||||
#endif
|
||||
|
||||
//phy_vars_ue->lte_ue_pbch_vars[0]->pdu_errors=0;
|
||||
phy_vars_ue->lte_ue_pbch_vars[0]->pdu_errors_conseq=0;
|
||||
//phy_vars_ue->lte_ue_pbch_vars[0]->pdu_errors_last=0;
|
||||
@@ -567,7 +535,7 @@ int initial_sync(PHY_VARS_UE *phy_vars_ue, runmode_t mode)
|
||||
phy_vars_ue->lte_frame_parms.phich_config_common.phich_duration,
|
||||
phich_string[phy_vars_ue->lte_frame_parms.phich_config_common.phich_resource],
|
||||
phy_vars_ue->lte_frame_parms.nb_antennas_tx_eNB);
|
||||
#if defined(OAI_USRP) || defined(EXMIMO)
|
||||
#if defined(OAI_USRP) || defined(EXMIMO) || defined(OAI_LMSSDR)
|
||||
LOG_I(PHY,"[UE %d] Frame %d Measured Carrier Frequency %.0f Hz (offset %d Hz)\n",
|
||||
phy_vars_ue->Mod_id,
|
||||
phy_vars_ue->frame_rx,
|
||||
@@ -595,6 +563,65 @@ int initial_sync(PHY_VARS_UE *phy_vars_ue, runmode_t mode)
|
||||
|
||||
}
|
||||
|
||||
// gain control
|
||||
if (ret!=0) { //we are not synched, so we cannot use rssi measurement (which is based on channel estimates)
|
||||
rx_power = 0;
|
||||
|
||||
// do a measurement on the best guess of the PSS
|
||||
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++)
|
||||
rx_power += signal_energy(&phy_vars_ue->lte_ue_common_vars.rxdata[aarx][sync_pos2],
|
||||
frame_parms->ofdm_symbol_size+frame_parms->nb_prefix_samples);
|
||||
|
||||
/*
|
||||
// do a measurement on the full frame
|
||||
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++)
|
||||
rx_power += signal_energy(&phy_vars_ue->lte_ue_common_vars.rxdata[aarx][0],
|
||||
frame_parms->samples_per_tti*10);
|
||||
*/
|
||||
|
||||
// we might add a low-pass filter here later
|
||||
phy_vars_ue->PHY_measurements.rx_power_avg[0] = rx_power/frame_parms->nb_antennas_rx;
|
||||
|
||||
phy_vars_ue->PHY_measurements.rx_power_avg_dB[0] = dB_fixed(phy_vars_ue->PHY_measurements.rx_power_avg[0]);
|
||||
|
||||
#ifdef DEBUG_INITIAL_SYNCH
|
||||
LOG_I(PHY,"[UE%d] Initial sync : Estimated power: %d dB\n",phy_vars_ue->Mod_id,phy_vars_ue->PHY_measurements.rx_power_avg_dB[0] );
|
||||
#endif
|
||||
|
||||
#ifdef EXMIMO
|
||||
if ((openair_daq_vars.rx_gain_mode == DAQ_AGC_ON) &&
|
||||
(mode != rx_calib_ue) && (mode != rx_calib_ue_med) && (mode != rx_calib_ue_byp) )
|
||||
//phy_adjust_gain(phy_vars_ue,0);
|
||||
gain_control_all(phy_vars_ue->PHY_measurements.rx_power_avg_dB[0],0);
|
||||
|
||||
#else
|
||||
#ifndef OAI_USRP
|
||||
#ifndef OAI_BLADERF
|
||||
#ifndef OAI_LMSSDR
|
||||
phy_adjust_gain(phy_vars_ue,phy_vars_ue->PHY_measurements.rx_power_avg_dB[0],0);
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
#ifdef EXMIMO
|
||||
if ((openair_daq_vars.rx_gain_mode == DAQ_AGC_ON) &&
|
||||
(mode != rx_calib_ue) && (mode != rx_calib_ue_med) && (mode != rx_calib_ue_byp) )
|
||||
//phy_adjust_gain(phy_vars_ue,0);
|
||||
gain_control_all(dB_fixed(phy_vars_ue->PHY_measurements.rssi),0);
|
||||
|
||||
#else
|
||||
#ifndef OAI_USRP
|
||||
#ifndef OAI_BLADERF
|
||||
#ifndef OAI_LMSSDR
|
||||
phy_adjust_gain(phy_vars_ue,dB_fixed(phy_vars_ue->PHY_measurements.rssi),0);
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
// exit_fun("debug exit");
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
#endif
|
||||
|
||||
extern int mac_get_rrc_status(uint8_t Mod_id,uint8_t eNB_flag,uint8_t index);
|
||||
#if defined(OAI_USRP) || defined(EXMIMO)
|
||||
#if defined(OAI_USRP) || defined(EXMIMO) || defined(OAI_BLADERF) || defined(OAI_LMSSDR)
|
||||
#include "common_lib.h"
|
||||
extern openair0_config_t openair0_cfg[];
|
||||
#endif
|
||||
@@ -67,11 +67,12 @@ int dump_ue_stats(PHY_VARS_UE *phy_vars_ue, char* buffer, int length, runmode_t
|
||||
|
||||
if ((mode == normal_txrx) || (mode == no_L2_connect)) {
|
||||
len += sprintf(&buffer[len], "[UE_PROC] UE %d, RNTI %x\n",phy_vars_ue->Mod_id, phy_vars_ue->lte_ue_pdcch_vars[0]->crnti);
|
||||
len += sprintf(&buffer[len],"[UE PROC] RSRP[0] %.2f dBm/RE, RSSI %.2f dBm, RSRQ[0] %.2f dB, N0 %d dBm/RE\n",
|
||||
len += sprintf(&buffer[len],"[UE PROC] RSRP[0] %.2f dBm/RE, RSSI %.2f dBm, RSRQ[0] %.2f dB, N0 %d dBm/RE (NF %.1f dB)\n",
|
||||
10*log10(phy_vars_ue->PHY_measurements.rsrp[0])-phy_vars_ue->rx_total_gain_dB,
|
||||
10*log10(phy_vars_ue->PHY_measurements.rssi)-phy_vars_ue->rx_total_gain_dB,
|
||||
10*log10(phy_vars_ue->PHY_measurements.rsrq[0]),
|
||||
phy_vars_ue->PHY_measurements.n0_power_tot_dBm);
|
||||
phy_vars_ue->PHY_measurements.n0_power_tot_dBm,
|
||||
(double)phy_vars_ue->PHY_measurements.n0_power_tot_dBm+132.24);
|
||||
|
||||
/*
|
||||
len += sprintf(&buffer[len],
|
||||
@@ -96,20 +97,20 @@ int dump_ue_stats(PHY_VARS_UE *phy_vars_ue, char* buffer, int length, runmode_t
|
||||
#ifdef EXMIMO
|
||||
len += sprintf(&buffer[len], "[UE PROC] RX Gain %d dB (LNA %d, vga %d dB)\n",phy_vars_ue->rx_total_gain_dB, openair0_cfg[0].rxg_mode[0],(int)openair0_cfg[0].rx_gain[0]);
|
||||
#endif
|
||||
#ifdef OAI_USRP
|
||||
#if defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR)
|
||||
len += sprintf(&buffer[len], "[UE PROC] RX Gain %d dB\n",phy_vars_ue->rx_total_gain_dB);
|
||||
#endif
|
||||
#if defined(EXMIMO) || defined(OAI_USRP)
|
||||
#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR)
|
||||
len += sprintf(&buffer[len], "[UE_PROC] Frequency offset %d Hz (%d), estimated carrier frequency %f Hz\n",phy_vars_ue->lte_ue_common_vars.freq_offset,openair_daq_vars.freq_offset,openair0_cfg[0].rx_freq[0]-phy_vars_ue->lte_ue_common_vars.freq_offset);
|
||||
#endif
|
||||
len += sprintf(&buffer[len], "[UE PROC] UE mode = %s (%d)\n",mode_string[phy_vars_ue->UE_mode[0]],phy_vars_ue->UE_mode[0]);
|
||||
len += sprintf(&buffer[len], "[UE PROC] timing_advance = %d\n",phy_vars_ue->timing_advance);
|
||||
if (phy_vars_ue->UE_mode[0]==PUSCH) {
|
||||
len += sprintf(&buffer[len], "[UE PROC] Po_PUSCH = %d dBm (PL %d dB, Po_NOMINAL_PUSCH %d dBm, PHR %d dB)\n",
|
||||
PHY_vars_UE_g[0][0]->ulsch_ue[0]->Po_PUSCH,
|
||||
phy_vars_ue->ulsch_ue[0]->Po_PUSCH,
|
||||
get_PL(phy_vars_ue->Mod_id,phy_vars_ue->CC_id,0),
|
||||
mac_xface->get_Po_NOMINAL_PUSCH(phy_vars_ue->Mod_id,0),
|
||||
PHY_vars_UE_g[0][0]->ulsch_ue[0]->PHR);
|
||||
phy_vars_ue->lte_frame_parms.ul_power_control_config_common.p0_NominalPUSCH,
|
||||
phy_vars_ue->ulsch_ue[0]->PHR);
|
||||
len += sprintf(&buffer[len], "[UE PROC] Po_PUCCH = %d dBm (Po_NOMINAL_PUCCH %d dBm, g_pucch %d dB)\n",
|
||||
get_PL(phy_vars_ue->Mod_id,phy_vars_ue->CC_id,0)+
|
||||
phy_vars_ue->lte_frame_parms.ul_power_control_config_common.p0_NominalPUCCH+
|
||||
@@ -573,12 +574,16 @@ 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: ");
|
||||
|
||||
for (i=0; i<25; i++)
|
||||
len += sprintf(&buffer[len],"%2d ",
|
||||
phy_vars_eNB->PHY_measurements_eNB[eNB].n0_subband_power_tot_dB[i]);
|
||||
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<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");
|
||||
}
|
||||
len += sprintf(&buffer[len],"\n");
|
||||
len += sprintf(&buffer[len],"\n[eNB PROC] PERFORMANCE PARAMETERS\n");
|
||||
/*
|
||||
@@ -634,11 +639,10 @@ 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,
|
||||
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,15 +56,16 @@ void free_eNB_dlsch(LTE_eNB_DLSCH_t *dlsch);
|
||||
|
||||
void clean_eNb_dlsch(LTE_eNB_DLSCH_t *dlsch, uint8_t abstraction_flag);
|
||||
|
||||
/** \fn new_eNB_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint8_t abstraction_flag)
|
||||
/** \fn new_eNB_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint32_t Nsoft,uint8_t abstraction_flag)
|
||||
\brief This function allocates structures for a particular DLSCH at eNB
|
||||
@returns Pointer to DLSCH to be removed
|
||||
@param Kmimo Kmimo factor from 36-212/36-213
|
||||
@param Mdlharq Maximum number of HARQ rounds (36-212/36-213)
|
||||
@param Nsoft Soft-LLR buffer size from UE-Category
|
||||
@params N_RB_DL total number of resource blocks (determine the operating BW)
|
||||
@param abstraction_flag Flag to indicate abstracted interface
|
||||
*/
|
||||
LTE_eNB_DLSCH_t *new_eNB_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint8_t N_RB_DL, uint8_t abstraction_flag);
|
||||
LTE_eNB_DLSCH_t *new_eNB_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint32_t Nsoft,uint8_t N_RB_DL, uint8_t abstraction_flag);
|
||||
|
||||
/** \fn free_ue_dlsch(LTE_UE_DLSCH_t *dlsch)
|
||||
\brief This function frees memory allocated for a particular DLSCH at UE
|
||||
@@ -72,18 +73,26 @@ LTE_eNB_DLSCH_t *new_eNB_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint8_t N_RB_DL, ui
|
||||
*/
|
||||
void free_ue_dlsch(LTE_UE_DLSCH_t *dlsch);
|
||||
|
||||
LTE_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,
|
||||
@@ -1230,11 +1239,20 @@ uint32_t get_TBS_DL(uint8_t mcs, uint16_t nb_rb);
|
||||
uint32_t get_TBS_UL(uint8_t mcs, uint16_t nb_rb);
|
||||
|
||||
/* \brief Return bit-map of resource allocation for a given DCI rballoc (RIV format) and vrb type
|
||||
@param N_RB_DL number of PRB on DL
|
||||
@param indicator for even/odd slot
|
||||
@param vrb vrb index
|
||||
@param Ngap Gap indicator
|
||||
*/
|
||||
uint32_t get_prb(int N_RB_DL,int odd_slot,int vrb,int Ngap);
|
||||
|
||||
/* \brief Return prb for a given vrb index
|
||||
@param vrb_type VRB type (0=localized,1=distributed)
|
||||
@param rb_alloc_dci rballoc field from DCI
|
||||
*/
|
||||
uint32_t get_rballoc(vrb_t vrb_type,uint16_t rb_alloc_dci);
|
||||
|
||||
|
||||
/* \brief Return bit-map of resource allocation for a given DCI rballoc (RIV format) and vrb type
|
||||
@returns Transmission mode (1-7)
|
||||
*/
|
||||
@@ -1574,6 +1592,12 @@ uint16_t computeRIV(uint16_t N_RB_DL,uint16_t RBstart,uint16_t Lcrbs);
|
||||
|
||||
uint32_t pmi_extend(LTE_DL_FRAME_PARMS *frame_parms,uint8_t wideband_pmi);
|
||||
|
||||
int get_nCCE_offset_l1(int *CCE_table,
|
||||
const unsigned char L,
|
||||
const int nCCE,
|
||||
const int common_dci,
|
||||
const unsigned short rnti,
|
||||
const unsigned char subframe);
|
||||
|
||||
uint16_t get_nCCE(uint8_t num_pdcch_symbols,LTE_DL_FRAME_PARMS *frame_parms,uint8_t mi);
|
||||
|
||||
@@ -1581,7 +1605,7 @@ uint16_t get_nquad(uint8_t num_pdcch_symbols,LTE_DL_FRAME_PARMS *frame_parms,uin
|
||||
|
||||
uint8_t get_mi(LTE_DL_FRAME_PARMS *frame,uint8_t subframe);
|
||||
|
||||
uint16_t get_nCCE_max(uint8_t Mod_id,uint8_t CC_id);
|
||||
uint16_t get_nCCE_mac(uint8_t Mod_id,uint8_t CC_id,int num_pdcch_symbols,int subframe);
|
||||
|
||||
uint8_t get_num_pdcch_symbols(uint8_t num_dci,DCI_ALLOC_t *dci_alloc,LTE_DL_FRAME_PARMS *frame_parms,uint8_t subframe);
|
||||
|
||||
@@ -1634,22 +1658,22 @@ void generate_pucch_emul(PHY_VARS_UE *phy_vars_ue,
|
||||
uint8_t subframe);
|
||||
|
||||
|
||||
int32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB,
|
||||
PUCCH_FMT_t fmt,
|
||||
uint8_t UE_id,
|
||||
uint16_t n1_pucch,
|
||||
uint16_t n2_pucch,
|
||||
uint8_t shortened_format,
|
||||
uint8_t *payload,
|
||||
uint8_t subframe,
|
||||
uint8_t pucch1_thres);
|
||||
uint32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB,
|
||||
PUCCH_FMT_t fmt,
|
||||
uint8_t UE_id,
|
||||
uint16_t n1_pucch,
|
||||
uint16_t n2_pucch,
|
||||
uint8_t shortened_format,
|
||||
uint8_t *payload,
|
||||
uint8_t subframe,
|
||||
uint8_t pucch1_thres);
|
||||
|
||||
int32_t rx_pucch_emul(PHY_VARS_eNB *phy_vars_eNB,
|
||||
uint8_t UE_index,
|
||||
PUCCH_FMT_t fmt,
|
||||
uint8_t n1_pucch_sel,
|
||||
uint8_t *payload,
|
||||
uint8_t subframe);
|
||||
uint8_t UE_index,
|
||||
PUCCH_FMT_t fmt,
|
||||
uint8_t n1_pucch_sel,
|
||||
uint8_t *payload,
|
||||
uint8_t subframe);
|
||||
|
||||
|
||||
/*!
|
||||
@@ -1764,7 +1788,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);
|
||||
|
||||
@@ -58,24 +58,28 @@ int slot_fep(PHY_VARS_UE *phy_vars_ue,
|
||||
void (*dft)(int16_t *,int16_t *, int);
|
||||
int tmp_dft_in[256]; // This is for misalignment issues for 6 and 15 PRBs
|
||||
|
||||
switch (frame_parms->log2_symbol_size) {
|
||||
case 7:
|
||||
switch (frame_parms->ofdm_symbol_size) {
|
||||
case 128:
|
||||
dft = dft128;
|
||||
break;
|
||||
|
||||
case 8:
|
||||
case 256:
|
||||
dft = dft256;
|
||||
break;
|
||||
|
||||
case 9:
|
||||
case 512:
|
||||
dft = dft512;
|
||||
break;
|
||||
|
||||
case 10:
|
||||
case 1024:
|
||||
dft = dft1024;
|
||||
break;
|
||||
|
||||
case 11:
|
||||
case 1536:
|
||||
dft = dft1536;
|
||||
break;
|
||||
|
||||
case 2048:
|
||||
dft = dft2048;
|
||||
break;
|
||||
|
||||
@@ -96,12 +100,12 @@ int slot_fep(PHY_VARS_UE *phy_vars_ue,
|
||||
|
||||
|
||||
if (l<0 || l>=7-frame_parms->Ncp) {
|
||||
msg("slot_fep: l must be between 0 and %d\n",7-frame_parms->Ncp);
|
||||
printf("slot_fep: l must be between 0 and %d\n",7-frame_parms->Ncp);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
if (Ns<0 || Ns>=20) {
|
||||
msg("slot_fep: Ns must be between 0 and 19\n");
|
||||
printf("slot_fep: Ns must be between 0 and 19\n");
|
||||
return(-1);
|
||||
}
|
||||
|
||||
@@ -116,7 +120,7 @@ int slot_fep(PHY_VARS_UE *phy_vars_ue,
|
||||
|
||||
#ifdef DEBUG_FEP
|
||||
// if (phy_vars_ue->frame <100)
|
||||
msg("slot_fep: frame %d: slot %d, symbol %d, nb_prefix_samples %d, nb_prefix_samples0 %d, slot_offset %d, subframe_offset %d, sample_offset %d,rx_offset %d\n", phy_vars_ue->frame_rx,Ns, symbol,
|
||||
printf("slot_fep: frame %d: slot %d, symbol %d, nb_prefix_samples %d, nb_prefix_samples0 %d, slot_offset %d, subframe_offset %d, sample_offset %d,rx_offset %d\n", phy_vars_ue->frame_rx,Ns, symbol,
|
||||
nb_prefix_samples,nb_prefix_samples0,slot_offset,subframe_offset,sample_offset,rx_offset);
|
||||
#endif
|
||||
|
||||
@@ -147,7 +151,7 @@ int slot_fep(PHY_VARS_UE *phy_vars_ue,
|
||||
|
||||
#ifdef DEBUG_FEP
|
||||
// if (phy_vars_ue->frame <100)
|
||||
msg("slot_fep: frame %d: slot %d, symbol %d, nb_prefix_samples %d, nb_prefix_samples0 %d, slot_offset %d, subframe_offset %d, sample_offset %d,rx_offset %d\n", phy_vars_ue->frame_rx,Ns, symbol,
|
||||
printf("slot_fep: frame %d: slot %d, symbol %d, nb_prefix_samples %d, nb_prefix_samples0 %d, slot_offset %d, subframe_offset %d, sample_offset %d,rx_offset %d\n", phy_vars_ue->frame_rx,Ns, symbol,
|
||||
nb_prefix_samples,nb_prefix_samples0,slot_offset,subframe_offset,sample_offset,rx_offset);
|
||||
#endif
|
||||
|
||||
@@ -182,7 +186,7 @@ int slot_fep(PHY_VARS_UE *phy_vars_ue,
|
||||
for (aa=0; aa<frame_parms->nb_antennas_tx_eNB; aa++) {
|
||||
|
||||
#ifdef DEBUG_FEP
|
||||
msg("Channel estimation eNB %d, aatx %d, slot %d, symbol %d\n",eNB_id,aa,Ns,l);
|
||||
printf("Channel estimation eNB %d, aatx %d, slot %d, symbol %d\n",eNB_id,aa,Ns,l);
|
||||
#endif
|
||||
start_meas(&phy_vars_ue->dlsch_channel_estimation_stats);
|
||||
lte_dl_channel_estimation(phy_vars_ue,eNB_id,0,
|
||||
@@ -205,7 +209,7 @@ int slot_fep(PHY_VARS_UE *phy_vars_ue,
|
||||
// do frequency offset estimation here!
|
||||
// use channel estimates from current symbol (=ch_t) and last symbol (ch_{t-1})
|
||||
#ifdef DEBUG_FEP
|
||||
msg("Frequency offset estimation\n");
|
||||
printf("Frequency offset estimation\n");
|
||||
#endif
|
||||
|
||||
if (l==(4-frame_parms->Ncp)) {
|
||||
@@ -222,7 +226,7 @@ int slot_fep(PHY_VARS_UE *phy_vars_ue,
|
||||
}
|
||||
|
||||
#ifdef DEBUG_FEP
|
||||
msg("slot_fep: done\n");
|
||||
printf("slot_fep: done\n");
|
||||
#endif
|
||||
return(0);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -1,200 +0,0 @@
|
||||
/*******************************************************************************
|
||||
OpenAirInterface
|
||||
Copyright(c) 1999 - 2014 Eurecom
|
||||
|
||||
OpenAirInterface is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
|
||||
OpenAirInterface is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenAirInterface.The full GNU General Public License is
|
||||
included in this distribution in the file called "COPYING". If not,
|
||||
see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Contact Information
|
||||
OpenAirInterface Admin: openair_admin@eurecom.fr
|
||||
OpenAirInterface Tech : openair_tech@eurecom.fr
|
||||
OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr
|
||||
|
||||
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
|
||||
|
||||
*******************************************************************************/
|
||||
#include "defs.h"
|
||||
|
||||
int mult_cpx_matrix_h(short *x1[2][2],
|
||||
short *x2[2][2],
|
||||
short *y[2][2],
|
||||
unsigned int N,
|
||||
unsigned short output_shift,
|
||||
short hermitian)
|
||||
{
|
||||
|
||||
if (hermitian) {
|
||||
// this computes x1^H*x2 and stores it in y
|
||||
mult_cpx_vector_h(x2[0][0],x1[0][0],y[0][0],N,output_shift,1);
|
||||
mult_cpx_vector_h(x2[0][1],x1[0][1],y[0][0],N,output_shift,1);
|
||||
mult_cpx_vector_h(x2[0][0],x1[1][0],y[1][0],N,output_shift,1);
|
||||
mult_cpx_vector_h(x2[0][1],x1[1][1],y[1][0],N,output_shift,1);
|
||||
mult_cpx_vector_h(x2[1][0],x1[0][0],y[0][1],N,output_shift,1);
|
||||
mult_cpx_vector_h(x2[1][1],x1[0][1],y[0][1],N,output_shift,1);
|
||||
mult_cpx_vector_h(x2[1][0],x1[1][0],y[1][1],N,output_shift,1);
|
||||
mult_cpx_vector_h(x2[1][1],x1[1][1],y[1][1],N,output_shift,1);
|
||||
} else {
|
||||
// this computes x1*x2^H and stores it in y
|
||||
mult_cpx_vector_h(x1[0][0],x2[0][0],y[0][0],N,output_shift,1);
|
||||
mult_cpx_vector_h(x1[0][1],x2[0][1],y[0][0],N,output_shift,1);
|
||||
mult_cpx_vector_h(x1[0][0],x2[1][0],y[0][1],N,output_shift,1);
|
||||
mult_cpx_vector_h(x1[0][1],x2[1][1],y[0][1],N,output_shift,1);
|
||||
mult_cpx_vector_h(x1[1][0],x2[0][0],y[1][0],N,output_shift,1);
|
||||
mult_cpx_vector_h(x1[1][1],x2[0][1],y[1][0],N,output_shift,1);
|
||||
mult_cpx_vector_h(x1[1][0],x2[1][0],y[1][1],N,output_shift,1);
|
||||
mult_cpx_vector_h(x1[1][1],x2[1][1],y[1][1],N,output_shift,1);
|
||||
}
|
||||
}
|
||||
|
||||
int mult_cpx_matrix_vector(int *x1[2][2],
|
||||
int *x2[2],
|
||||
int *y[2],
|
||||
unsigned int N,
|
||||
unsigned short output_shift)
|
||||
{
|
||||
|
||||
Zero_Buffer(y[0],N*8);
|
||||
Zero_Buffer(y[1],N*8);
|
||||
|
||||
// this computes x1*x2 and stores it in y (32 bit)
|
||||
mult_cpx_vector_add32((short*)x2[0],(short*)x1[0][0],(short*)y[0],N);
|
||||
mult_cpx_vector_add32((short*)x2[1],(short*)x1[0][1],(short*)y[0],N);
|
||||
mult_cpx_vector_add32((short*)x2[0],(short*)x1[1][0],(short*)y[1],N);
|
||||
mult_cpx_vector_add32((short*)x2[1],(short*)x1[1][1],(short*)y[1],N);
|
||||
|
||||
// shift and pack
|
||||
shift_and_pack((short*)y[0],N,output_shift);
|
||||
shift_and_pack((short*)y[1],N,output_shift);
|
||||
|
||||
}
|
||||
|
||||
#ifdef MAIN_MM
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
main ()
|
||||
{
|
||||
short x1_00[256] __attribute__((aligned(16)));
|
||||
short x1_10[256] __attribute__((aligned(16)));
|
||||
short x1_01[256] __attribute__((aligned(16)));
|
||||
short x1_11[256] __attribute__((aligned(16)));
|
||||
short x2_0[256] __attribute__((aligned(16)));
|
||||
short x2_1[256] __attribute__((aligned(16)));
|
||||
short y_0[256] __attribute__((aligned(16)));
|
||||
short y_1[256] __attribute__((aligned(16)));
|
||||
|
||||
int *x1[2][2];
|
||||
int *x2[2];
|
||||
int *y[2];
|
||||
int i,m,n;
|
||||
|
||||
x1[0][0] = (int*)x1_00;
|
||||
x1[0][1] = (int*)x1_01;
|
||||
x1[1][0] = (int*)x1_10;
|
||||
x1[1][1] = (int*)x1_11;
|
||||
x2[0] = (int*)x2_0;
|
||||
x2[1] = (int*)x2_1;
|
||||
y[0] = (int*)y_0;
|
||||
y[1] = (int*)y_1;
|
||||
|
||||
for(m=0; m<2; m++) {
|
||||
for(n=0; n<2; n++) {
|
||||
for(i=0; i<256; i+=4) {
|
||||
((short*)x1[m][n])[i] = ((short) rand())/4;
|
||||
((short*)x1[m][n])[i+1] = ((short) rand())/4;
|
||||
((short*)x1[m][n])[i+2] = -((short*)x1[m][n])[i+1];
|
||||
((short*)x1[m][n])[i+3] = ((short*)x1[m][n])[i];
|
||||
}
|
||||
}
|
||||
|
||||
for(i=0; i<256; i+=4) {
|
||||
((short*)x2[m])[i] = ((short) rand())/4;
|
||||
((short*)x2[m])[i+1] = ((short) rand())/4;
|
||||
((short*)x2[m])[i+2] = ((short*)x2[m])[i];
|
||||
((short*)x2[m])[i+3] = ((short*)x2[m])[i+1];
|
||||
}
|
||||
|
||||
Zero_Buffer(y[m],512);
|
||||
}
|
||||
|
||||
/*
|
||||
input[0] = 100;
|
||||
input[1] = 200;
|
||||
input[2] = -200;
|
||||
input[3] = 100;
|
||||
input[4] = 1000;
|
||||
input[5] = 2000;
|
||||
input[6] = -2000;
|
||||
input[7] = 1000;
|
||||
input[8] = 100;
|
||||
input[9] = 200;
|
||||
input[10] = -200;
|
||||
input[11] = 100;
|
||||
input[12] = 1000;
|
||||
input[13] = 2000;
|
||||
input[14] = -2000;
|
||||
input[15] = 1000;
|
||||
|
||||
input2[0] = 2;
|
||||
input2[1] = 1;
|
||||
input2[2] = 2;
|
||||
input2[3] = 1;
|
||||
input2[4] = 20;
|
||||
input2[5] = 10;
|
||||
input2[6] = 20;
|
||||
input2[7] = 10;
|
||||
input2[8] = 2;
|
||||
input2[9] = 1;
|
||||
input2[10] = 2;
|
||||
input2[11] = 1;
|
||||
input2[12] = 2000;
|
||||
input2[13] = 1000;
|
||||
input2[14] = 2000;
|
||||
input2[15] = 1000;
|
||||
|
||||
x1[0][0] = (int*)input;
|
||||
x1[0][1] = (int*)input;
|
||||
x1[1][0] = (int*)input;
|
||||
x1[1][1] = (int*)input;
|
||||
|
||||
x2[0] = (int*)input2;
|
||||
x2[1] = (int*)input2;
|
||||
|
||||
y[0] = (int*)output;
|
||||
y[1] = (int*)output2;
|
||||
*/
|
||||
|
||||
mult_cpx_matrix_vector(x1,x2,y,64,15);
|
||||
|
||||
//mult_cpx_vector_add32(x2[0],x1[0][0],y[0],64);
|
||||
|
||||
for (i=0; i<128; i+=2)
|
||||
printf("i=%d, x1 = [%d+1i*%d %d+1i*%d; %d+1i*%d %d+1i*%d]; x2 = [%d+1i*%d; %d+1i*%d]; y = [%d+1i*%d; %d+1i*%d]; y_m= round(x1*x2./pow2(15)); y-y_m \n",
|
||||
i,
|
||||
((short*)x1[0][0])[2*i], ((short*)x1[0][0])[2*i+2],
|
||||
((short*)x1[0][1])[2*i], ((short*)x1[0][1])[2*i+2],
|
||||
((short*)x1[1][0])[2*i], ((short*)x1[1][0])[2*i+2],
|
||||
((short*)x1[1][1])[2*i], ((short*)x1[1][1])[2*i+2],
|
||||
((short*)x2[0])[2*i], ((short*)x2[0])[2*i+1],
|
||||
((short*)x2[1])[2*i], ((short*)x2[1])[2*i+1],
|
||||
((short*)y[0])[2*i], ((short*)y[0])[2*i+1],
|
||||
((short*)y[1])[2*i], ((short*)y[1])[2*i+1]);
|
||||
|
||||
//((int*)y[0])[i], ((int*)y[0])[i+1],
|
||||
//((int*)y[1])[i], ((int*)y[1])[i+1]);
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -50,7 +50,7 @@ int mult_cpx_conj_vector(int16_t *x1,
|
||||
uint32_t N,
|
||||
int output_shift)
|
||||
{
|
||||
// Multiply elementwise two complex vectors of N elements with repeated formatted output
|
||||
// Multiply elementwise the complex conjugate of x1 with x2.
|
||||
// x1 - input 1 in the format |Re0 Im0 Re1 Im1|,......,|Re(N-2) Im(N-2) Re(N-1) Im(N-1)|
|
||||
// We assume x1 with a dinamic of 15 bit maximum
|
||||
//
|
||||
@@ -90,7 +90,7 @@ int mult_cpx_conj_vector(int16_t *x1,
|
||||
tmp_im = _mm_shufflelo_epi16(*x1_128,_MM_SHUFFLE(2,3,0,1));
|
||||
tmp_im = _mm_shufflehi_epi16(tmp_im,_MM_SHUFFLE(2,3,0,1));
|
||||
tmp_im = _mm_sign_epi16(tmp_im,*(__m128i*)&conjug[0]);
|
||||
tmp_im = _mm_madd_epi16(tmp_im,*x1_128);
|
||||
tmp_im = _mm_madd_epi16(tmp_im,*x2_128);
|
||||
tmp_re = _mm_srai_epi32(tmp_re,output_shift);
|
||||
tmp_im = _mm_srai_epi32(tmp_im,output_shift);
|
||||
tmpy0 = _mm_unpacklo_epi32(tmp_re,tmp_im);
|
||||
@@ -130,3 +130,4 @@ int mult_cpx_conj_vector(int16_t *x1,
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,366 +0,0 @@
|
||||
/*******************************************************************************
|
||||
OpenAirInterface
|
||||
Copyright(c) 1999 - 2014 Eurecom
|
||||
|
||||
OpenAirInterface is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
|
||||
OpenAirInterface is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenAirInterface.The full GNU General Public License is
|
||||
included in this distribution in the file called "COPYING". If not,
|
||||
see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Contact Information
|
||||
OpenAirInterface Admin: openair_admin@eurecom.fr
|
||||
OpenAirInterface Tech : openair_tech@eurecom.fr
|
||||
OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr
|
||||
|
||||
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
|
||||
|
||||
*******************************************************************************/
|
||||
#include "defs.h"
|
||||
|
||||
static __m128i shift __attribute__ ((aligned(16)));
|
||||
|
||||
|
||||
int mult_cpx_vector_h(short *x1,
|
||||
short *x2,
|
||||
short *y,
|
||||
unsigned int N,
|
||||
unsigned short output_shift,
|
||||
short sign)
|
||||
{
|
||||
// Multiply elementwise the complex vector x1 with the complex conjugate of the complex vecotr x2 of N elements and adds it to the vector y.
|
||||
// x1 - input 1 in the format |Re0 Im0 Re0 Im0|,......,|Re(N-1) Im(N-1) Re(N-1) Im(N-1)|
|
||||
// We assume x1 with a dinamic of 15 bit maximum
|
||||
//
|
||||
// x2 - input 2 in the format |Re0 Im0 Re0 Im0|,......,|Re(N-1) Im(N-1) Re(N-1) Im(N-1)|
|
||||
// We assume x2 with a dinamic of 14 bit maximum
|
||||
//
|
||||
// y - output in the format |Re0 Im0 Re0 Im0|,......,|Re(N-1) Im(N-1) Re(N-1) Im(N-1)|
|
||||
//
|
||||
// N - the size f the vectors (this function does N cpx mpy. WARNING: N>=4;
|
||||
//
|
||||
// log2_amp - increase the output amplitude by a factor 2^log2_amp (default is 0)
|
||||
// WARNING: log2_amp>0 can cause overflow!!
|
||||
// sign - +1..add, -1..substract
|
||||
|
||||
unsigned int i; // loop counter
|
||||
|
||||
register __m128i m0,m1,m2;
|
||||
|
||||
short *temps;
|
||||
int *tempd;
|
||||
|
||||
__m128i *x1_128;
|
||||
__m128i *x2_128;
|
||||
__m128i *y_128;
|
||||
__m128i mask;
|
||||
|
||||
__m128i temp;
|
||||
|
||||
shift = _mm_cvtsi32_si128(output_shift);
|
||||
x1_128 = (__m128i *)&x1[0];
|
||||
x2_128 = (__m128i *)&x2[0];
|
||||
y_128 = (__m128i *)&y[0];
|
||||
|
||||
if (sign == -1)
|
||||
mask = (__m128i) _mm_set_epi16 (-1,1,-1,-1,-1,1,-1,-1);
|
||||
else
|
||||
mask = (__m128i) _mm_set_epi16 (1,-1,1,1,1,-1,1,1);
|
||||
|
||||
// we compute 2*4 cpx multiply for each loop
|
||||
for(i=0; i<(N>>3); i++) {
|
||||
|
||||
// printf("i=%d\n",i);
|
||||
|
||||
// unroll 1
|
||||
// temps = (short *)x1_128;
|
||||
// printf("x1 : %d,%d,%d,%d,%d,%d,%d,%d\n",temps[0],temps[1],temps[2],temps[3],temps[4],temps[5],temps[6],temps[7]);
|
||||
m1 = x1_128[0];
|
||||
m2 = x2_128[0];
|
||||
|
||||
// temps = (short *)&x2_128[0];
|
||||
// printf("x2 : %x,%x,%x,%x,%x,%x,%x,%x\n",temps[0],temps[1],temps[2],temps[3],temps[4],temps[5],temps[6],temps[7]);
|
||||
|
||||
// bring x2 in conjugate form
|
||||
// the first two instructions might be replaced with a single one in SSE3
|
||||
m2 = _mm_shufflelo_epi16(m2,_MM_SHUFFLE(0,1,3,2));
|
||||
m2 = _mm_shufflehi_epi16(m2,_MM_SHUFFLE(0,1,3,2));
|
||||
m2 = _mm_mullo_epi16(m2, mask);
|
||||
|
||||
// temp = m2;
|
||||
// temps = (short *)&temp;
|
||||
// printf("x2 conj : %x,%x,%x,%x,%x,%x,%x,%x\n",temps[0],temps[1],temps[2],temps[3],temps[4],temps[5],temps[6],temps[7]);
|
||||
|
||||
m0 = _mm_madd_epi16(m1,m2); //pmaddwd_r2r(mm1,mm0); // 1- compute x1[0]*x2[0]
|
||||
|
||||
// temp = m0;
|
||||
|
||||
// tempd = &temp;
|
||||
// printf("m0 : %d,%d,%d,%d\n",tempd[0],tempd[1],tempd[2],tempd[3]);
|
||||
|
||||
m0 = _mm_sra_epi32(m0,shift); // 1- shift right by shift in order to compensate for the input amplitude
|
||||
|
||||
// temp = m0;
|
||||
|
||||
// tempd = (int *)&temp;
|
||||
// printf("m0 : %d,%d,%d,%d\n",tempd[0],tempd[1],tempd[2],tempd[3]);
|
||||
|
||||
m0 = _mm_packs_epi32(m0,m0); // 1- pack in a 128 bit register [re im re im]
|
||||
m0 = _mm_unpacklo_epi32(m0,m0); // 1- pack in a 128 bit register [re im re im]
|
||||
|
||||
y_128[0] = _mm_add_epi16(m0,y_128[0]);
|
||||
|
||||
// temps = (short *)&y_128[0];
|
||||
// printf("y0 : %d,%d,%d,%d,%d,%d,%d,%d\n",temps[0],temps[1],temps[2],temps[3],temps[4],temps[5],temps[6],temps[7]);
|
||||
|
||||
// unroll 2
|
||||
m1 = x1_128[1];
|
||||
m2 = x2_128[1];
|
||||
|
||||
m2 = _mm_shufflelo_epi16(m2,_MM_SHUFFLE(0,1,3,2));
|
||||
m2 = _mm_shufflehi_epi16(m2,_MM_SHUFFLE(0,1,3,2));
|
||||
m2 = _mm_mullo_epi16(m2, mask);
|
||||
|
||||
m0 = _mm_madd_epi16(m1,m2); //pmaddwd_r2r(mm1,mm0); // 1- compute x1[0]*x2[0]
|
||||
|
||||
m0 = _mm_sra_epi32(m0,shift); // 1- shift right by shift in order to compensate for the input amplitude
|
||||
|
||||
m0 = _mm_packs_epi32(m0,m0); // 1- pack in a 128 bit register [re im re im]
|
||||
m0 = _mm_unpacklo_epi32(m0,m0); // 1- pack in a 128 bit register [re im re im]
|
||||
|
||||
y_128[1] = _mm_add_epi16(m0,y_128[1]);
|
||||
|
||||
// unroll 3
|
||||
m1 = x1_128[2];
|
||||
m2 = x2_128[2];
|
||||
|
||||
m2 = _mm_shufflelo_epi16(m2,_MM_SHUFFLE(0,1,3,2));
|
||||
m2 = _mm_shufflehi_epi16(m2,_MM_SHUFFLE(0,1,3,2));
|
||||
m2 = _mm_mullo_epi16(m2, mask);
|
||||
|
||||
m0 = _mm_madd_epi16(m1,m2); //pmaddwd_r2r(mm1,mm0); // 1- compute x1[0]*x2[0]
|
||||
|
||||
m0 = _mm_sra_epi32(m0,shift); // 1- shift right by shift in order to compensate for the input amplitude
|
||||
|
||||
m0 = _mm_packs_epi32(m0,m0); // 1- pack in a 128 bit register [re im re im]
|
||||
m0 = _mm_unpacklo_epi32(m0,m0); // 1- pack in a 128 bit register [re im re im]
|
||||
|
||||
y_128[2] = _mm_add_epi16(m0,y_128[2]);
|
||||
|
||||
|
||||
// unroll 4
|
||||
m1 = x1_128[3];
|
||||
m2 = x2_128[3];
|
||||
|
||||
m2 = _mm_shufflelo_epi16(m2,_MM_SHUFFLE(0,1,3,2));
|
||||
m2 = _mm_shufflehi_epi16(m2,_MM_SHUFFLE(0,1,3,2));
|
||||
m2 = _mm_mullo_epi16(m2, mask);
|
||||
|
||||
m0 = _mm_madd_epi16(m1,m2); //pmaddwd_r2r(mm1,mm0); // 1- compute x1[0]*x2[0]
|
||||
|
||||
m0 = _mm_sra_epi32(m0,shift); // 1- shift right by shift in order to compensate for the input amplitude
|
||||
|
||||
m0 = _mm_packs_epi32(m0,m0); // 1- pack in a 128 bit register [re im re im]
|
||||
m0 = _mm_unpacklo_epi32(m0,m0); // 1- pack in a 128 bit register [re im re im]
|
||||
|
||||
y_128[3] = _mm_add_epi16(m0,y_128[3]);
|
||||
|
||||
x1_128+=4;
|
||||
x2_128+=4;
|
||||
y_128 +=4;
|
||||
// printf("x1_128 = %p, x2_128 =%p, y_128=%p\n",x1_128,x2_128,y_128);
|
||||
|
||||
}
|
||||
|
||||
|
||||
_mm_empty();
|
||||
_m_empty();
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
int mult_cpx_vector_h_add32(short *x1,
|
||||
short *x2,
|
||||
short *y,
|
||||
unsigned int N,
|
||||
short sign)
|
||||
{
|
||||
// Multiply elementwise the complex vector x1 with the complex conjugate of the complex vecotr x2 of N elements and adds it to the vector y.
|
||||
// x1 - input 1 in 16bit format |Re0 Im0 Re0 Im0|,......,|Re(N-1) Im(N-1) Re(N-1) Im(N-1)|
|
||||
// We assume x1 with a dinamic of 15 bit maximum
|
||||
//
|
||||
// x2 - input 2 in 16bit format |Re0 Im0 Re0 Im0|,......,|Re(N-1) Im(N-1) Re(N-1) Im(N-1)|
|
||||
// We assume x2 with a dinamic of 14 bit maximum
|
||||
//
|
||||
// y - output in 32bit format |Re0 Im0|,......,|Re(N-1) Im(N-1)|
|
||||
//
|
||||
// N - the size f the vectors (this function does N cpx mpy. WARNING: N>=4;
|
||||
//
|
||||
// sign - +1..add, -1..substract
|
||||
|
||||
unsigned int i; // loop counter
|
||||
|
||||
register __m128i m0,m1,m2;
|
||||
|
||||
short *temps;
|
||||
int *tempd;
|
||||
|
||||
__m128i *x1_128;
|
||||
__m128i *x2_128;
|
||||
__m128i *y_128;
|
||||
__m128i mask;
|
||||
|
||||
__m128i temp;
|
||||
|
||||
x1_128 = (__m128i *)&x1[0];
|
||||
x2_128 = (__m128i *)&x2[0];
|
||||
y_128 = (__m128i *)&y[0];
|
||||
|
||||
if (sign == -1)
|
||||
mask = (__m128i) _mm_set_epi16 (-1,1,-1,-1,-1,1,-1,-1);
|
||||
else
|
||||
mask = (__m128i) _mm_set_epi16 (1,-1,1,1,1,-1,1,1);
|
||||
|
||||
// we compute 2*4 cpx multiply for each loop
|
||||
for(i=0; i<(N>>3); i++) {
|
||||
|
||||
m1 = x1_128[0];
|
||||
m2 = x2_128[0];
|
||||
|
||||
// bring x2 in conjugate form
|
||||
// the first two instructions might be replaced with a single one in SSE3
|
||||
m2 = _mm_shufflelo_epi16(m2,_MM_SHUFFLE(0,1,3,2));
|
||||
m2 = _mm_shufflehi_epi16(m2,_MM_SHUFFLE(0,1,3,2));
|
||||
m2 = _mm_mullo_epi16(m2, mask);
|
||||
|
||||
m0 = _mm_madd_epi16(m1,m2); // 1- compute x1[0]*x2[0], result is 32bit
|
||||
|
||||
y_128[0] = _mm_add_epi32(m0,y_128[0]);
|
||||
|
||||
// unroll 2
|
||||
m1 = x1_128[1];
|
||||
m2 = x2_128[1];
|
||||
|
||||
m2 = _mm_shufflelo_epi16(m2,_MM_SHUFFLE(0,1,3,2));
|
||||
m2 = _mm_shufflehi_epi16(m2,_MM_SHUFFLE(0,1,3,2));
|
||||
m2 = _mm_mullo_epi16(m2, mask);
|
||||
|
||||
m0 = _mm_madd_epi16(m1,m2);
|
||||
|
||||
y_128[1] = _mm_add_epi32(m0,y_128[1]);
|
||||
|
||||
// unroll 3
|
||||
m1 = x1_128[2];
|
||||
m2 = x2_128[2];
|
||||
|
||||
m2 = _mm_shufflelo_epi16(m2,_MM_SHUFFLE(0,1,3,2));
|
||||
m2 = _mm_shufflehi_epi16(m2,_MM_SHUFFLE(0,1,3,2));
|
||||
m2 = _mm_mullo_epi16(m2, mask);
|
||||
|
||||
m0 = _mm_madd_epi16(m1,m2);
|
||||
|
||||
y_128[2] = _mm_add_epi32(m0,y_128[2]);
|
||||
|
||||
|
||||
// unroll 4
|
||||
m1 = x1_128[3];
|
||||
m2 = x2_128[3];
|
||||
|
||||
m2 = _mm_shufflelo_epi16(m2,_MM_SHUFFLE(0,1,3,2));
|
||||
m2 = _mm_shufflehi_epi16(m2,_MM_SHUFFLE(0,1,3,2));
|
||||
m2 = _mm_mullo_epi16(m2, mask);
|
||||
|
||||
m0 = _mm_madd_epi16(m1,m2);
|
||||
|
||||
y_128[3] = _mm_add_epi32(m0,y_128[3]);
|
||||
|
||||
x1_128+=4;
|
||||
x2_128+=4;
|
||||
y_128 +=4;
|
||||
|
||||
}
|
||||
|
||||
|
||||
_mm_empty();
|
||||
_m_empty();
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
#ifdef MAIN
|
||||
#define L 16
|
||||
|
||||
main ()
|
||||
{
|
||||
|
||||
short input[256] __attribute__((aligned(16)));
|
||||
short input2[256] __attribute__((aligned(16)));
|
||||
short output[256] __attribute__((aligned(16)));
|
||||
|
||||
int i;
|
||||
|
||||
Zero_Buffer(output,256*2);
|
||||
|
||||
for (i=0; i<16; i+=2)
|
||||
printf("output[%d] = %d + %d i\n",i,output[i],output[i+1]);
|
||||
|
||||
input[0] = 100;
|
||||
input[1] = 200;
|
||||
input[2] = 100;
|
||||
input[3] = 200;
|
||||
input[4] = 1234;
|
||||
input[5] = -1234;
|
||||
input[6] = 1234;
|
||||
input[7] = -1234;
|
||||
input[8] = 100;
|
||||
input[9] = 200;
|
||||
input[10] = 100;
|
||||
input[11] = 200;
|
||||
input[12] = 1000;
|
||||
input[13] = 2000;
|
||||
input[14] = 1000;
|
||||
input[15] = 2000;
|
||||
|
||||
input2[0] = 1;
|
||||
input2[1] = 2;
|
||||
input2[2] = 1;
|
||||
input2[3] = 2;
|
||||
input2[4] = 10;
|
||||
input2[5] = 20;
|
||||
input2[6] = 10;
|
||||
input2[7] = 20;
|
||||
input2[8] = 1;
|
||||
input2[9] = 2;
|
||||
input2[10] = 1;
|
||||
input2[11] = 2;
|
||||
input2[12] = 1000;
|
||||
input2[13] = 2000;
|
||||
input2[14] = 1000;
|
||||
input2[15] = 2000;
|
||||
|
||||
|
||||
mult_cpx_vector_h(input2,input2,output,8,0,1);
|
||||
|
||||
for (i=0; i<16; i+=2)
|
||||
printf("output[%d] = %d + %d i\n",i,output[i],output[i+1]);
|
||||
|
||||
Zero_Buffer(output,256*2);
|
||||
mult_cpx_vector_h(input2,input2,output,8,0,-1);
|
||||
|
||||
for (i=0; i<16; i+=2)
|
||||
printf("output[%d] = %d + %d i\n",i,output[i],output[i+1]);
|
||||
|
||||
}
|
||||
|
||||
#endif //MAIN
|
||||
+26
-182
@@ -64,6 +64,8 @@ struct complex32 {
|
||||
int32_t i;
|
||||
};
|
||||
|
||||
//cmult_sv.h
|
||||
|
||||
/*!\fn void multadd_real_vector_complex_scalar(int16_t *x,int16_t *alpha,int16_t *y,uint32_t N)
|
||||
This function performs componentwise multiplication and accumulation of a complex scalar and a real vector.
|
||||
@param x Vector input (Q1.15)
|
||||
@@ -95,192 +97,14 @@ void multadd_complex_vector_real_scalar(int16_t *x,
|
||||
uint8_t zero_flag,
|
||||
uint32_t N);
|
||||
|
||||
|
||||
/*!\fn int32_t mult_cpx_vector(int16_t *x1,int16_t *x2,int16_t *y,uint32_t N,int32_t output_shift)
|
||||
This function performs optimized componentwise multiplication of two Q1.15 vectors in repeated format.
|
||||
|
||||
@param x1 Input 1 in the format |Re0 Im0 Re0 Im0|,......,|Re(N-1) Im(N-1) Re(N-1) Im(N-1)|
|
||||
@param x2 Input 2 in the format |Re0 -Im0 Im0 Re0|,......,|Re(N-1) -Im(N-1) Im(N-1) Re(N-1)|
|
||||
@param y Output in the format |Re0 Im0 Re0 Im0|,......,|Re(N-1) Im(N-1) Re(N-1) Im(N-1)|
|
||||
@param N Length of Vector WARNING: N must be a multiple of 8 (4x loop unrolling and two complex multiplies per cycle)
|
||||
@param output_shift Number of bits to shift output down to Q1.15 (should be 15 for Q1.15 inputs) WARNING: log2_amp>0 can cause overflow!!
|
||||
|
||||
The function implemented is : \f$\mathbf{y} = \mathbf{x_1}\odot\mathbf{x_2}\f$
|
||||
*/
|
||||
int32_t mult_cpx_vector(int16_t *x1,
|
||||
int16_t *x2,
|
||||
int16_t *y,
|
||||
uint32_t N,
|
||||
int32_t output_shift);
|
||||
|
||||
/*!\fn int32_t mult_cpx_vector_norep(int16_t *x1,int16_t *x2,int16_t *y,uint32_t N,int32_t output_shift)
|
||||
This function performs optimized componentwise multiplication of two Q1.15 vectors with normal formatted output.
|
||||
|
||||
@param x1 Input 1 in the format |Re0 Im0 Re0 Im0|,......,|Re(N-1) Im(N-1) Re(N-1) Im(N-1)|
|
||||
@param x2 Input 2 in the format |Re0 -Im0 Im0 Re0|,......,|Re(N-1) -Im(N-1) Im(N-1) Re(N-1)|
|
||||
@param y Output in the format |Re0 Im0 Re1 Im1|,......,|Re(N-2) Im(N-2) Re(N-1) Im(N-1)|
|
||||
@param N Length of Vector WARNING: N must be a multiple of 8 (4x loop unrolling and two complex multiplies per cycle)
|
||||
@param output_shift Number of bits to shift output down to Q1.15 (should be 15 for Q1.15 inputs) WARNING: log2_amp>0 can cause overflow!!
|
||||
|
||||
The function implemented is : \f$\mathbf{y} = \mathbf{x_1}\odot\mathbf{x_2}\f$
|
||||
*/
|
||||
int32_t mult_cpx_vector_norep(int16_t *x1,
|
||||
int16_t *x2,
|
||||
int16_t *y,
|
||||
uint32_t N,
|
||||
int32_t output_shift);
|
||||
|
||||
|
||||
/*!\fn int32_t mult_cpx_vector_norep2(int16_t *x1,int16_t *x2,int16_t *y,uint32_t N,int32_t output_shift)
|
||||
This function performs optimized componentwise multiplication of two Q1.15 vectors with normal formatted output.
|
||||
|
||||
@param x1 Input 1 in the format |Re0 Im0 Re0 Im0|,......,|Re(N-1) Im(N-1) Re(N-1) Im(N-1)|
|
||||
@param x2 Input 2 in the format |Re0 -Im0 Im0 Re0|,......,|Re(N-1) -Im(N-1) Im(N-1) Re(N-1)|
|
||||
@param y Output in the format |Re0 Im0 Re1 Im1|,......,|Re(N-2) Im(N-2) Re(N-1) Im(N-1)|
|
||||
@param N Length of Vector WARNING: N must be a multiple of 8 (no unrolling and two complex multiplies per cycle)
|
||||
@param output_shift Number of bits to shift output down to Q1.15 (should be 15 for Q1.15 inputs) WARNING: log2_amp>0 can cause overflow!!
|
||||
|
||||
The function implemented is : \f$\mathbf{y} = \mathbf{x_1}\odot\mathbf{x_2}\f$
|
||||
*/
|
||||
int32_t mult_cpx_vector_norep2(int16_t *x1,
|
||||
int16_t *x2,
|
||||
int16_t *y,
|
||||
uint32_t N,
|
||||
int32_t output_shift);
|
||||
|
||||
int32_t mult_cpx_vector_norep_conj(int16_t *x1,
|
||||
int16_t *x2,
|
||||
int16_t *y,
|
||||
uint32_t N,
|
||||
int32_t output_shift);
|
||||
|
||||
int32_t mult_cpx_vector_norep_conj2(int16_t *x1,
|
||||
int16_t *x2,
|
||||
int16_t *y,
|
||||
uint32_t N,
|
||||
int32_t output_shift);
|
||||
|
||||
/*!\fn int32_t mult_cpx_vector2(int16_t *x1,int16_t *x2,int16_t *y,uint32_t N,int32_t output_shift)
|
||||
This function performs optimized componentwise multiplication of two Q1.15 vectors.
|
||||
|
||||
@param x1 Input 1 in the format |Re0 Im0 Re0 Im0|,......,|Re(N-1) Im(N-1) Re(N-1) Im(N-1)|
|
||||
@param x2 Input 2 in the format |Re0 -Im0 Im0 Re0|,......,|Re(N-1) -Im(N-1) Im(N-1) Re(N-1)|
|
||||
@param y Output in the format |Re0 Im0 Re0 Im0|,......,|Re(N-1) Im(N-1) Re(N-1) Im(N-1)|
|
||||
@param N Length of Vector WARNING: N must be a multiple of 2 (2 complex multiplies per cycle)
|
||||
@param output_shift Number of bits to shift output down to Q1.15 (should be 15 for Q1.15 inputs) WARNING: log2_amp>0 can cause overflow!!
|
||||
|
||||
The function implemented is : \f$\mathbf{y} = \mathbf{x_1}\odot\mathbf{x_2}\f$
|
||||
*/
|
||||
int32_t mult_cpx_vector2(int16_t *x1,
|
||||
int16_t *x2,
|
||||
int16_t *y,
|
||||
uint32_t N,
|
||||
int32_t output_shift);
|
||||
|
||||
/*!\fn int32_t mult_cpx_vector_add(int16_t *x1,int16_t *x2,int16_t *y,uint32_t N,int32_t output_shift)
|
||||
This function performs optimized componentwise multiplication of two Q1.15 vectors. The output IS ADDED TO y. WARNING: make sure that output_shift is set to the right value, so that the result of the multiplication has the comma at the same place as y.
|
||||
|
||||
@param x1 Input 1 in the format |Re0 Im0 Re0 Im0|,......,|Re(N-1) Im(N-1) Re(N-1) Im(N-1)|
|
||||
@param x2 Input 2 in the format |Re0 -Im0 Im0 Re0|,......,|Re(N-1) -Im(N-1) Im(N-1) Re(N-1)|
|
||||
@param y Output in the format |Re0 Im0 Re0 Im0|,......,|Re(N-1) Im(N-1) Re(N-1) Im(N-1)|
|
||||
@param N Length of Vector WARNING: N>=4
|
||||
@param output_shift Number of bits to shift output down to Q1.15 (should be 15 for Q1.15 inputs) WARNING: log2_amp>0 can cause overflow!!
|
||||
|
||||
The function implemented is : \f$\mathbf{y} += \mathbf{x_1}\odot\mathbf{x_2}\f$
|
||||
*/
|
||||
|
||||
int32_t mult_cpx_vector_add(int16_t *x1,
|
||||
int16_t *x2,
|
||||
int16_t *y,
|
||||
uint32_t N,
|
||||
int32_t output_shift);
|
||||
|
||||
|
||||
int32_t mult_cpx_vector_h_add32(int16_t *x1,
|
||||
int16_t *x2,
|
||||
int16_t *y,
|
||||
uint32_t N,
|
||||
int16_t sign);
|
||||
|
||||
int32_t mult_cpx_vector_add32(int16_t *x1,
|
||||
int16_t *x2,
|
||||
int16_t *y,
|
||||
uint32_t N);
|
||||
|
||||
int32_t mult_vector32(int16_t *x1,
|
||||
int16_t *x2,
|
||||
int rotate_cpx_vector(int16_t *x,
|
||||
int16_t *alpha,
|
||||
int16_t *y,
|
||||
uint32_t N);
|
||||
|
||||
int32_t mult_vector32_scalar(int16_t *x1,
|
||||
int32_t x2,
|
||||
int16_t *y,
|
||||
uint32_t N);
|
||||
|
||||
int32_t mult_cpx_vector32_conj(int16_t *x,
|
||||
int16_t *y,
|
||||
uint32_t N);
|
||||
|
||||
int32_t mult_cpx_vector32_real(int16_t *x1,
|
||||
int16_t *x2,
|
||||
int16_t *y,
|
||||
uint32_t N);
|
||||
|
||||
int32_t shift_and_pack(int16_t *y,
|
||||
uint32_t N,
|
||||
int32_t output_shift);
|
||||
|
||||
/*!\fn int32_t mult_cpx_vector_h(int16_t *x1,int16_t *x2,int16_t *y,uint32_t N,int32_t output_shift,int16_t sign)
|
||||
This function performs optimized componentwise multiplication of the vector x1 with the conjugate of the vector x2. The output IS ADDED TO y. WARNING: make sure that output_shift is set to the right value, so that the result of the multiplication has the comma at the same place as y.
|
||||
|
||||
@param x1 Input 1 in the format |Re0 Im0 Re0 Im0|,......,|Re(N-1) Im(N-1) Re(N-1) Im(N-1)|
|
||||
@param x2 Input 2 in the format |Re0 Im0 Re0 Im0|,......,|Re(N-1) Im(N-1) Re(N-1) Im(N-1)|
|
||||
@param y Output in the format |Re0 Im0 Re0 Im0|,......,|Re(N-1) Im(N-1) Re(N-1) Im(N-1)|
|
||||
@param N Length of Vector (complex samples) WARNING: N>=4
|
||||
@param output_shift Number of bits to shift output down to Q1.15 (should be 15 for Q1.15 inputs) WARNING: log2_amp>0 can cause overflow!!
|
||||
@param sign +1..add, -1..substract
|
||||
|
||||
The function implemented is : \f$\mathbf{y} = \mathbf{y} + \mathbf{x_1}\odot\mathbf{x_2}^*\f$
|
||||
*/
|
||||
int32_t mult_cpx_vector_h(int16_t *x1,
|
||||
int16_t *x2,
|
||||
int16_t *y,
|
||||
uint32_t N,
|
||||
int32_t output_shift,
|
||||
int16_t sign);
|
||||
|
||||
/*!\fn int32_t mult_cpx_matrix_h(int16_t *x1[2][2],int16_t *x2[2][2],int16_t *y[2][2],uint32_t N,uint16_t output_shift,int16_t hermitian)
|
||||
This function performs optimized componentwise matrix multiplication of the 2x2 matrices x1 with the 2x2 matrices x2. The output IS ADDED TO y (i.e. make sure y is initilized correctly). WARNING: make sure that output_shift is set to the right value, so that the result of the multiplication has the comma at the same place as y.
|
||||
|
||||
@param x1 Input 1 in the format |Re0 Im0 Re0 Im0|,......,|Re(N-1) Im(N-1) Re(N-1) Im(N-1)|
|
||||
@param x2 Input 2 in the format |Re0 Im0 Re0 Im0|,......,|Re(N-1) Im(N-1) Re(N-1) Im(N-1)|
|
||||
@param y Output in the format |Re0 Im0 Re0 Im0|,......,|Re(N-1) Im(N-1) Re(N-1) Im(N-1)|
|
||||
@param N Length of Vector (complex samples) WARNING: N>=4
|
||||
@param output_shift Number of bits to shift output down to Q1.15 (should be 15 for Q1.15 inputs) WARNING: log2_amp>0 can cause overflow!!
|
||||
@param hermitian if !=0 the hermitian transpose is returned (i.e. A^H*B instead of A*B^H)
|
||||
*/
|
||||
int32_t mult_cpx_matrix_h(int16_t *x1[2][2],
|
||||
int16_t *x2[2][2],
|
||||
int16_t *y[2][2],
|
||||
uint32_t N,
|
||||
uint16_t output_shift,
|
||||
int16_t hermitian);
|
||||
uint32_t N,
|
||||
uint16_t output_shift);
|
||||
|
||||
|
||||
/*!\fn int32_t mult_cpx_matrix_vector(int32_t *x1[2][2],int32_t *x2[2],int32_t *y[2],uint32_t N,uint16_t output_shift)
|
||||
This function performs optimized componentwise matrix-vector multiplication of the 2x2 matrices x1 with the 2x1 vectors x2. The output IS ADDED TO y (i.e. make sure y is initilized correctly). WARNING: make sure that output_shift is set to the right value, so that the result of the multiplication has the comma at the same place as y.
|
||||
|
||||
@param x1 Input 1 in the format |Re0 Im0 Re0 Im0|,......,|Re(N-1) Im(N-1) Re(N-1) Im(N-1)|
|
||||
@param x2 Input 2 in the format |Re0 -Im0 Im0 Re0|,......,|Re(N-1) -Im(N-1) Im(N-1) Re(N-1)|
|
||||
@param y Output in the format |Re0 Im0 Re0 Im0|,......,|Re(N-1) Im(N-1) Re(N-1) Im(N-1)| WARNING: y must be different for x2
|
||||
@param N Length of Vector (complex samples) WARNING: N>=4
|
||||
@param output_shift Number of bits to shift output down to Q1.15 (should be 15 for Q1.15 inputs) WARNING: log2_amp>0 can cause overflow!!
|
||||
*/
|
||||
int32_t mult_cpx_matrix_vector(int32_t *x1[2][2],
|
||||
int32_t *x2[2],
|
||||
int32_t *y[2],
|
||||
uint32_t N,
|
||||
uint16_t output_shift);
|
||||
|
||||
/*!\fn void init_fft(uint16_t size,uint8_t logsize,uint16_t *rev)
|
||||
\brief Initialize the FFT engine for a given size
|
||||
@@ -289,6 +113,25 @@ int32_t mult_cpx_matrix_vector(int32_t *x1[2][2],
|
||||
@param rev Pointer to bit-reversal permutation array
|
||||
*/
|
||||
|
||||
//cmult_vv.c
|
||||
/*!
|
||||
Multiply elementwise the complex conjugate of x1 with x2.
|
||||
@param x1 - input 1 in the format |Re0 Im0 Re1 Im1|,......,|Re(N-2) Im(N-2) Re(N-1) Im(N-1)|
|
||||
We assume x1 with a dinamic of 15 bit maximum
|
||||
@param x2 - input 2 in the format |Re0 Im0 Re1 Im1|,......,|Re(N-2) Im(N-2) Re(N-1) Im(N-1)|
|
||||
We assume x2 with a dinamic of 14 bit maximum
|
||||
@param y - output in the format |Re0 Im0 Re1 Im1|,......,|Re(N-2) Im(N-2) Re(N-1) Im(N-1)|
|
||||
@param N - the size f the vectors (this function does N cpx mpy. WARNING: N>=4;
|
||||
@param output_shift - shift to be applied to generate output
|
||||
*/
|
||||
|
||||
int mult_cpx_conj_vector(int16_t *x1,
|
||||
int16_t *x2,
|
||||
int16_t *y,
|
||||
uint32_t N,
|
||||
int output_shift);
|
||||
|
||||
// lte_dfts.c
|
||||
void init_fft(uint16_t size,
|
||||
uint8_t logsize,
|
||||
uint16_t *rev);
|
||||
@@ -355,6 +198,7 @@ int32_t rotate_cpx_vector(int16_t *x,
|
||||
uint16_t output_shift);
|
||||
|
||||
|
||||
//cadd_sv.c
|
||||
|
||||
/*!\fn int32_t add_cpx_vector(int16_t *x,int16_t *alpha,int16_t *y,uint32_t N)
|
||||
This function performs componentwise addition of a vector with a complex scalar.
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
@@ -88,7 +88,7 @@ FD_lte_phy_scope_enb *create_lte_phy_scope_enb( void )
|
||||
fl_set_object_boxtype( fdui->rxsig_t, FL_EMBOSSED_BOX );
|
||||
fl_set_object_color( fdui->rxsig_t, FL_BLACK, FL_RED );
|
||||
fl_set_object_lcolor( fdui->rxsig_t, FL_WHITE ); // Label color
|
||||
fl_set_xyplot_ybounds(fdui->rxsig_t,30,70);
|
||||
fl_set_xyplot_ybounds(fdui->rxsig_t,10,70);
|
||||
|
||||
// Time-domain channel response
|
||||
fdui->chest_t = fl_add_xyplot( FL_NORMAL_XYPLOT, 410, 20, 370, 100, "Channel Impulse Response (samples, abs)" );
|
||||
@@ -119,7 +119,7 @@ FD_lte_phy_scope_enb *create_lte_phy_scope_enb( void )
|
||||
fl_set_xyplot_xgrid( fdui->pusch_llr,FL_GRID_MAJOR);
|
||||
|
||||
// I/Q PUCCH comp (format 1)
|
||||
fdui->pucch_comp1 = fl_add_xyplot( FL_POINTS_XYPLOT, 540, 480, 240, 100, "PUCCH I/Q of MF Output" );
|
||||
fdui->pucch_comp1 = fl_add_xyplot( FL_POINTS_XYPLOT, 540, 480, 240, 100, "PUCCH1 Energy (SR)" );
|
||||
fl_set_object_boxtype( fdui->pucch_comp1, FL_EMBOSSED_BOX );
|
||||
fl_set_object_color( fdui->pucch_comp1, FL_BLACK, FL_YELLOW );
|
||||
fl_set_object_lcolor( fdui->pucch_comp1, FL_WHITE ); // Label color
|
||||
@@ -160,7 +160,7 @@ void phy_scope_eNB(FD_lte_phy_scope_enb *form,
|
||||
int UE_id)
|
||||
{
|
||||
int eNB_id = 0;
|
||||
int i,arx,atx,ind,k;
|
||||
int i,i2,arx,atx,ind,k;
|
||||
LTE_DL_FRAME_PARMS *frame_parms = &phy_vars_enb->lte_frame_parms;
|
||||
int nsymb_ce = 12*frame_parms->N_RB_UL*frame_parms->symbols_per_tti;
|
||||
uint8_t nb_antennas_rx = frame_parms->nb_antennas_rx;
|
||||
@@ -171,15 +171,17 @@ void phy_scope_eNB(FD_lte_phy_scope_enb *form,
|
||||
int16_t *pusch_llr;
|
||||
int16_t *pusch_comp;
|
||||
int32_t *pucch1_comp;
|
||||
int16_t *pucch1ab_comp;
|
||||
int32_t *pucch1_thres;
|
||||
int32_t *pucch1ab_comp;
|
||||
float Re,Im,ymax;
|
||||
float *llr, *bit;
|
||||
float I[nsymb_ce*2], Q[nsymb_ce*2];
|
||||
float I_pucch[10240],Q_pucch[10240],A_pucch[10240],B_pucch[10240];
|
||||
float I_pucch[10240],Q_pucch[10240],A_pucch[10240],B_pucch[10240],C_pucch[10240];
|
||||
float rxsig_t_dB[nb_antennas_rx][FRAME_LENGTH_COMPLEX_SAMPLES];
|
||||
float chest_t_abs[nb_antennas_rx][frame_parms->ofdm_symbol_size];
|
||||
float *chest_f_abs;
|
||||
float time[FRAME_LENGTH_COMPLEX_SAMPLES];
|
||||
float time2[2048];
|
||||
float freq[nsymb_ce*nb_antennas_rx*nb_antennas_tx];
|
||||
int frame = phy_vars_enb->proc[0].frame_tx;
|
||||
uint32_t total_dlsch_bitrate = phy_vars_enb->total_dlsch_bitrate;
|
||||
@@ -206,7 +208,8 @@ void phy_scope_eNB(FD_lte_phy_scope_enb *form,
|
||||
pusch_llr = (int16_t*) phy_vars_enb->lte_eNB_pusch_vars[UE_id]->llr;
|
||||
pusch_comp = (int16_t*) phy_vars_enb->lte_eNB_pusch_vars[UE_id]->rxdataF_comp[eNB_id][0];
|
||||
pucch1_comp = (int32_t*) phy_vars_enb->pucch1_stats[UE_id];
|
||||
pucch1ab_comp = (int16_t*) phy_vars_enb->pucch1ab_stats[UE_id];
|
||||
pucch1_thres = (int32_t*) phy_vars_enb->pucch1_stats_thres[UE_id];
|
||||
pucch1ab_comp = (int32_t*) phy_vars_enb->pucch1ab_stats[UE_id];
|
||||
|
||||
// Received signal in time domain of receive antenna 0
|
||||
if (rxsig_t != NULL) {
|
||||
@@ -236,19 +239,21 @@ void phy_scope_eNB(FD_lte_phy_scope_enb *form,
|
||||
|
||||
if (chest_t[0] !=NULL) {
|
||||
for (i=0; i<(frame_parms->ofdm_symbol_size); i++) {
|
||||
chest_t_abs[0][i] = 10*log10((float) (chest_t[0][2*i]*chest_t[0][2*i]+chest_t[0][2*i+1]*chest_t[0][2*i+1]));
|
||||
i2 = (i+(frame_parms->ofdm_symbol_size>>1))%frame_parms->ofdm_symbol_size;
|
||||
time2[i] = (float)(i-(frame_parms->ofdm_symbol_size>>1));
|
||||
chest_t_abs[0][i] = 10*log10((float) (1+chest_t[0][2*i2]*chest_t[0][2*i2]+chest_t[0][2*i2+1]*chest_t[0][2*i2+1]));
|
||||
|
||||
if (chest_t_abs[0][i] > ymax)
|
||||
ymax = chest_t_abs[0][i];
|
||||
}
|
||||
|
||||
fl_set_xyplot_data(form->chest_t,time,chest_t_abs[0],(frame_parms->ofdm_symbol_size),"","","");
|
||||
fl_set_xyplot_data(form->chest_t,time2,chest_t_abs[0],(frame_parms->ofdm_symbol_size),"","","");
|
||||
}
|
||||
|
||||
for (arx=1; arx<nb_antennas_rx; arx++) {
|
||||
if (chest_t[arx] !=NULL) {
|
||||
for (i=0; i<(frame_parms->ofdm_symbol_size>>3); i++) {
|
||||
chest_t_abs[arx][i] = 10*log10((float) (chest_t[arx][2*i]*chest_t[arx][2*i]+chest_t[arx][2*i+1]*chest_t[arx][2*i+1]));
|
||||
chest_t_abs[arx][i] = 10*log10((float) (1+chest_t[arx][2*i]*chest_t[arx][2*i]+chest_t[arx][2*i+1]*chest_t[arx][2*i+1]));
|
||||
|
||||
if (chest_t_abs[arx][i] > ymax)
|
||||
ymax = chest_t_abs[arx][i];
|
||||
@@ -337,16 +342,20 @@ void phy_scope_eNB(FD_lte_phy_scope_enb *form,
|
||||
// PUSCH I/Q of MF Output
|
||||
if (pucch1ab_comp!=NULL) {
|
||||
for (ind=0; ind<10240; ind++) {
|
||||
I_pucch[ind] = pucch1ab_comp[2*ind];
|
||||
Q_pucch[ind] = pucch1ab_comp[2*ind+1];
|
||||
|
||||
I_pucch[ind] = (float)pucch1ab_comp[2*(ind)];
|
||||
Q_pucch[ind] = (float)pucch1ab_comp[2*(ind)+1];
|
||||
A_pucch[ind] = 10*log10(pucch1_comp[ind]);
|
||||
B_pucch[ind] = ind;
|
||||
C_pucch[ind] = (float)pucch1_thres[ind];
|
||||
}
|
||||
fl_set_xyplot_data(form->pucch_comp,I_pucch,Q_pucch,10240,"","","");
|
||||
fl_set_xyplot_data(form->pucch_comp1,B_pucch,A_pucch,1024,"","","");
|
||||
fl_set_xyplot_xbounds(form->pucch_comp,-200,200);
|
||||
fl_set_xyplot_ybounds(form->pucch_comp,-100,100);
|
||||
fl_set_xyplot_ybounds(form->pucch_comp1,10,40);
|
||||
fl_add_xyplot_overlay(form->pucch_comp1,1,B_pucch,C_pucch,1024,FL_RED);
|
||||
fl_set_xyplot_ybounds(form->pucch_comp,-5000,5000);
|
||||
fl_set_xyplot_xbounds(form->pucch_comp,-5000,5000);
|
||||
|
||||
fl_set_xyplot_ybounds(form->pucch_comp1,20,80);
|
||||
}
|
||||
|
||||
|
||||
@@ -387,7 +396,7 @@ FD_lte_phy_scope_ue *create_lte_phy_scope_ue( void )
|
||||
fl_set_object_boxtype( fdui->rxsig_t, FL_EMBOSSED_BOX );
|
||||
fl_set_object_color( fdui->rxsig_t, FL_BLACK, FL_RED );
|
||||
fl_set_object_lcolor( fdui->rxsig_t, FL_WHITE ); // Label color
|
||||
fl_set_xyplot_ybounds(fdui->rxsig_t,30,70);
|
||||
fl_set_xyplot_ybounds(fdui->rxsig_t,10,70);
|
||||
|
||||
// Time-domain channel response
|
||||
fdui->chest_t = fl_add_xyplot( FL_NORMAL_XYPLOT, 410, 20, 370, 100, "Channel Impulse Response (samples, abs)" );
|
||||
@@ -710,13 +719,13 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form,
|
||||
|
||||
// PDSCH LLRs
|
||||
if (pdsch_llr != NULL) {
|
||||
for (i=0; i<coded_bits_per_codeword/4; i++) {
|
||||
llr[i] = (float) pdsch_llr[4*i];
|
||||
for (i=0; i<coded_bits_per_codeword; i++) {
|
||||
llr[i] = (float) pdsch_llr[i];
|
||||
bit[i] = (float) i;
|
||||
}
|
||||
|
||||
fl_set_xyplot_xbounds(form->pdsch_llr,0,coded_bits_per_codeword/4);
|
||||
fl_set_xyplot_data(form->pdsch_llr,bit,llr,coded_bits_per_codeword/4,"","","");
|
||||
fl_set_xyplot_xbounds(form->pdsch_llr,0,coded_bits_per_codeword);
|
||||
fl_set_xyplot_data(form->pdsch_llr,bit,llr,coded_bits_per_codeword,"","","");
|
||||
}
|
||||
|
||||
// PDSCH I/Q of MF Output
|
||||
|
||||
@@ -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));
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -26,6 +26,9 @@
|
||||
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
|
||||
|
||||
*******************************************************************************/
|
||||
#ifndef __TIME_MEAS_DEFS__H__
|
||||
#define __TIME_MEAS_DEFS__H__
|
||||
|
||||
#include <unistd.h>
|
||||
#include <math.h>
|
||||
#include <stdint.h>
|
||||
@@ -148,3 +151,4 @@ static inline void copy_meas(time_stats_t *dst_ts,time_stats_t *src_ts)
|
||||
dst_ts->max=src_ts->max;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
+18
-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 )
|
||||
@@ -271,6 +278,9 @@ typedef struct PHY_VARS_eNB_s {
|
||||
int **dl_precoder_SeNB[3];
|
||||
char log2_maxp; /// holds the maximum channel/precoder coefficient
|
||||
|
||||
/// if ==0 enables phy only test mode
|
||||
int mac_enabled;
|
||||
|
||||
/// For emulation only (used by UE abstraction to retrieve DCI)
|
||||
uint8_t num_common_dci[2]; // num_dci in even/odd subframes
|
||||
uint8_t num_ue_spec_dci[2]; // num_dci in even/odd subframes
|
||||
@@ -313,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];
|
||||
|
||||
@@ -374,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;
|
||||
@@ -569,6 +582,9 @@ typedef struct {
|
||||
/// holds the maximum channel/precoder coefficient
|
||||
char log2_maxp;
|
||||
|
||||
/// if ==0 enables phy only test mode
|
||||
int mac_enabled;
|
||||
|
||||
/// Flag to initialize averaging of PHY measurements
|
||||
int init_averaging;
|
||||
|
||||
|
||||
@@ -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)
|
||||
@@ -340,13 +346,12 @@ typedef struct {
|
||||
#define NUMBER_OF_SUBBANDS_MAX 13
|
||||
#define NUMBER_OF_HARQ_PID_MAX 8
|
||||
|
||||
#if defined(CBMIMO1) || defined(EXMIMO) || defined(OAI_USRP)
|
||||
#define MAX_FRAME_NUMBER 0x400
|
||||
#if defined(CBMIMO1) || defined(EXMIMO) || defined(OAI_USRP)
|
||||
#define NUMBER_OF_eNB_MAX 1
|
||||
#define NUMBER_OF_UE_MAX 4
|
||||
#define NUMBER_OF_CONNECTED_eNB_MAX 3
|
||||
#else
|
||||
#define MAX_FRAME_NUMBER 0xFFFF
|
||||
#ifdef LARGE_SCALE
|
||||
#define NUMBER_OF_eNB_MAX 2
|
||||
#define NUMBER_OF_UE_MAX 120
|
||||
@@ -471,13 +476,13 @@ typedef struct {
|
||||
//! estimated avg noise power (dB)
|
||||
short n0_power_tot_dBm;
|
||||
//! estimated avg noise power per RB per RX ant (lin)
|
||||
unsigned short n0_subband_power[NB_ANTENNAS_RX][25];
|
||||
unsigned short n0_subband_power[NB_ANTENNAS_RX][100];
|
||||
//! estimated avg noise power per RB per RX ant (dB)
|
||||
unsigned short n0_subband_power_dB[NB_ANTENNAS_RX][25];
|
||||
unsigned short n0_subband_power_dB[NB_ANTENNAS_RX][100];
|
||||
//! estimated avg noise power per RB (dB)
|
||||
short n0_subband_power_tot_dB[25];
|
||||
short n0_subband_power_tot_dB[100];
|
||||
//! estimated avg noise power per RB (dBm)
|
||||
short n0_subband_power_tot_dBm[25];
|
||||
short n0_subband_power_tot_dBm[100];
|
||||
// eNB measurements (per user)
|
||||
//! estimated received spatial signal power (linear)
|
||||
unsigned int rx_spatial_power[NUMBER_OF_UE_MAX][2][2];
|
||||
@@ -497,13 +502,13 @@ typedef struct {
|
||||
/// Wideband CQI (sum of all RX antennas, in dB)
|
||||
char wideband_cqi_tot[NUMBER_OF_UE_MAX];
|
||||
/// Subband CQI per RX antenna and RB (= SINR)
|
||||
int subband_cqi[NUMBER_OF_UE_MAX][NB_ANTENNAS_RX][25];
|
||||
int subband_cqi[NUMBER_OF_UE_MAX][NB_ANTENNAS_RX][100];
|
||||
/// Total Subband CQI and RB (= SINR)
|
||||
int subband_cqi_tot[NUMBER_OF_UE_MAX][25];
|
||||
int subband_cqi_tot[NUMBER_OF_UE_MAX][100];
|
||||
/// Subband CQI in dB and RB (= SINR dB)
|
||||
int subband_cqi_dB[NUMBER_OF_UE_MAX][NB_ANTENNAS_RX][25];
|
||||
int subband_cqi_dB[NUMBER_OF_UE_MAX][NB_ANTENNAS_RX][100];
|
||||
/// Total Subband CQI and RB
|
||||
int subband_cqi_tot_dB[NUMBER_OF_UE_MAX][25];
|
||||
int subband_cqi_tot_dB[NUMBER_OF_UE_MAX][100];
|
||||
|
||||
} PHY_MEASUREMENTS_eNB;
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user