Merge branch 'develop' into feature-42-doxygen
This commit is contained in:
+3
-2
@@ -8,6 +8,7 @@ job1:
|
||||
- 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`
|
||||
@@ -23,8 +24,8 @@ job1:
|
||||
- echo $NRUNS_LTE_SOFTMODEM
|
||||
- echo $TIMEOUT_CMD
|
||||
- mkdir -p $OPENAIR_DIR/cmake_targets/autotests/log
|
||||
- python $OPENAIR_DIR/cmake_targets/autotests/run_exec_lte-softmodem_tests.py -c -5GRepoHeadVersion $git_head -n $NFS_SHARE_DIR -u $OAI_USER -p $OAI_PASS $OAI_EXTRA_ARGS -g "$OAI_TEST_CASE_GROUP">& $OPENAIR_DIR/cmake_targets/autotests/python_autotest_cleanup.log
|
||||
- python $OPENAIR_DIR/cmake_targets/autotests/run_exec_lte-softmodem_tests.py -r -5GRepoHeadVersion $git_head -n $NFS_SHARE_DIR -u $OAI_USER -p $OAI_PASS `echo $OAI_EXTRA_ARGS` -g "$OAI_TEST_CASE_GROUP" --nrun_lte_softmodem $NRUNS_LTE_SOFTMODEM --timeout_cmd $TIMEOUT_CMD >& $OPENAIR_DIR/cmake_targets/autotests/python_autotest.log
|
||||
- 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
|
||||
|
||||
+183
-51
@@ -42,6 +42,10 @@ 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
|
||||
################################################
|
||||
@@ -128,16 +132,19 @@ Message("Architecture is ${CMAKE_SYSTEM_PROCESSOR}")
|
||||
if (CMAKE_SYSTEM_PROCESSOR STREQUAL "armv7l")
|
||||
set(C_FLAGS_PROCESSOR "-gdwarf-2 -mfloat-abi=hard -mfpu=neon -lgcc -lrt")
|
||||
else (CMAKE_SYSTEM_PROCESSOR STREQUAL "armv7l")
|
||||
file(STRINGS "/proc/cpuinfo" CPUINFO REGEX flags LIMIT_COUNT 1)
|
||||
#Message("CPUINFO is ${CPUINFO}")
|
||||
if (CPUINFO MATCHES "avx2")
|
||||
set(C_FLAGS_PROCESSOR "${C_FLAGS_PROCESSOR} -mavx2")
|
||||
endif()
|
||||
if (CPUINFO MATCHES "sse4_1")
|
||||
set(C_FLAGS_PROCESSOR "${C_FLAGS_PROCESSOR} -msse4.1")
|
||||
endif()
|
||||
if (CPUINFO MATCHES "ssse3")
|
||||
set(C_FLAGS_PROCESSOR "${C_FLAGS_PROCESSOR} -mssse3")
|
||||
if(EXISTS "/proc/cpuinfo")
|
||||
file(STRINGS "/proc/cpuinfo" CPUINFO REGEX flags LIMIT_COUNT 1)
|
||||
if (CPUINFO MATCHES "avx2")
|
||||
set(C_FLAGS_PROCESSOR "${C_FLAGS_PROCESSOR} -mavx2")
|
||||
endif()
|
||||
if (CPUINFO MATCHES "sse4_1")
|
||||
set(C_FLAGS_PROCESSOR "${C_FLAGS_PROCESSOR} -msse4.1")
|
||||
endif()
|
||||
if (CPUINFO MATCHES "ssse3")
|
||||
set(C_FLAGS_PROCESSOR "${C_FLAGS_PROCESSOR} -mssse3")
|
||||
endif()
|
||||
else()
|
||||
Message("/proc/cpuinfo does not exit. We will use manual CPU flags")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@@ -147,7 +154,7 @@ 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")) )
|
||||
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\" ")
|
||||
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 -mavx2\" ")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@@ -159,54 +166,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(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-rpath -Wl,${CMAKE_CURRENT_BINARY_DIR}")
|
||||
#########################
|
||||
# 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")
|
||||
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS} -g -DMALLOC_CHECK_=3 -O3")
|
||||
|
||||
|
||||
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 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}\"")
|
||||
|
||||
# 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")
|
||||
|
||||
@@ -247,6 +278,7 @@ 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")
|
||||
@@ -268,7 +300,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)
|
||||
@@ -282,6 +326,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}
|
||||
)
|
||||
|
||||
@@ -310,13 +355,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)
|
||||
@@ -326,6 +386,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
|
||||
@@ -377,7 +438,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
|
||||
@@ -394,6 +469,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}
|
||||
)
|
||||
|
||||
@@ -412,7 +488,7 @@ 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" "None" "EXMIMO" "OAI_USRP" "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")
|
||||
|
||||
@@ -443,6 +519,13 @@ set(HWLIB_BLADERF_SOURCE
|
||||
)
|
||||
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
|
||||
@@ -451,6 +534,7 @@ set(TPLIB_ETHERNET_SOURCE
|
||||
)
|
||||
add_library(oai_eth_transpro MODULE ${TPLIB_ETHERNET_SOURCE} )
|
||||
|
||||
|
||||
# RF devices / transport protocols settings
|
||||
######################################################################
|
||||
if (${RF_BOARD} STREQUAL "EXMIMO")
|
||||
@@ -478,9 +562,25 @@ 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 -rdynamic -ldl")
|
||||
|
||||
elseif (${RF_BOARD} STREQUAL "CPRIGW") #to ask
|
||||
#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
|
||||
)
|
||||
@@ -1057,7 +1157,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
|
||||
)
|
||||
|
||||
@@ -1398,6 +1497,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})
|
||||
|
||||
@@ -1491,13 +1593,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} ${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
|
||||
###################################################
|
||||
@@ -1531,8 +1634,7 @@ target_link_libraries (lte-softmodem-nos1
|
||||
target_link_libraries (lte-softmodem-nos1 ${LIBXML2_LIBRARIES})
|
||||
target_link_libraries (lte-softmodem-nos1 pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} ${option_HW_lib} ${option_TP_lib} ${XFORMS_LIBRARIES} )
|
||||
target_link_libraries (lte-softmodem-nos1 ${LIBBOOST_LIBRARIES})
|
||||
|
||||
|
||||
target_link_libraries (lte-softmodem-nos1 ${LIB_LMS_LIBRARIES})
|
||||
|
||||
# rrh
|
||||
################################
|
||||
@@ -1546,7 +1648,6 @@ add_executable(rrh_gw
|
||||
${HW_SOURCE}
|
||||
${TRANSPORT_SOURCE}
|
||||
)
|
||||
# assert
|
||||
target_include_directories(rrh_gw PRIVATE ${OPENAIR_DIR}/common/utils/itti)
|
||||
target_link_libraries(rrh_gw
|
||||
-Wl,--start-group
|
||||
@@ -1554,12 +1655,21 @@ target_link_libraries(rrh_gw
|
||||
-Wl,--end-group )
|
||||
target_link_libraries (rrh_gw rt pthread m )
|
||||
target_link_libraries (rrh_gw ${option_HW_lib} ${option_TP_lib} ${LIBBOOST_LIBRARIES} )
|
||||
target_link_libraries (rrh_gw ${LIB_LMS_LIBRARIES})
|
||||
|
||||
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
|
||||
#################
|
||||
#add_executable(usim
|
||||
@@ -1681,6 +1791,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
|
||||
@@ -1689,7 +1800,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}
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -171,6 +171,49 @@ Obj.# Case# Test# Description
|
||||
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
|
||||
|
||||
02 55 lte-softmodem tests with USRP B210 RF as eNB and ALU EPC w/ Sony Experia M4 COTS UE for TX/1RX
|
||||
02 55 00 Band 7 FDD 5MHz UL Throughput for 300 sec for 1TX/1RX
|
||||
02 55 01 Band 7 FDD 10MHz UL Throughput for 300 sec for 1TX/1RX
|
||||
02 55 02 Band 7 FDD 20MHz UL Throughput for 300 sec for 1TX/1RX
|
||||
02 55 03 Band 7 FDD 5MHz DL Throughput for 300 sec for 1TX/1RX
|
||||
02 55 04 Band 7 FDD 10MHz DL Throughput for 300 sec for 1TX/1RX
|
||||
02 55 05 Band 7 FDD 20MHz DL Throughput for 300 sec for 1TX/1RX
|
||||
|
||||
|
||||
01 64 lte-softmodem-noS1 tests
|
||||
|
||||
02 Functional test case
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,34 @@
|
||||
#!/bin/bash
|
||||
#******************************************************************************
|
||||
|
||||
# OpenAirInterface
|
||||
# Copyright(c) 1999 - 2014 Eurecom
|
||||
|
||||
# OpenAirInterface is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
|
||||
|
||||
# OpenAirInterface is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with OpenAirInterface.The full GNU General Public License is
|
||||
# included in this distribution in the file called "COPYING". If not,
|
||||
# see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# Contact Information
|
||||
# OpenAirInterface Admin: openair_admin@eurecom.fr
|
||||
# OpenAirInterface Tech : openair_tech@eurecom.fr
|
||||
# OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr
|
||||
|
||||
# Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
|
||||
|
||||
# *******************************************************************************/
|
||||
# \author Navid Nikaein, Rohit Gupta
|
||||
|
||||
if [ -s $OPENAIR_DIR/cmake_targets/tools/build_helper ] ; then
|
||||
source $OPENAIR_DIR/cmake_targets/tools/build_helper
|
||||
@@ -12,7 +42,7 @@ 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
|
||||
rm -fr $tdir/bin
|
||||
mkdir -p $tdir/bin
|
||||
@@ -111,6 +141,8 @@ function test_compile() {
|
||||
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 $pre_exec_file $pre_exe_args ...."
|
||||
eval $pre_exec_file $pre_exec_args
|
||||
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"
|
||||
@@ -280,7 +312,7 @@ function test_compile_and_run() {
|
||||
|
||||
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
|
||||
eval " $pre_exec_file $pre_exec_args " ; }>> $temp_exec_log 2>&1
|
||||
|
||||
fi
|
||||
echo "Executing $main_exec $main_exec_args_array_index "
|
||||
@@ -388,6 +420,7 @@ until [ -z "$1" ]
|
||||
-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)
|
||||
@@ -404,14 +437,12 @@ until [ -z "$1" ]
|
||||
esac
|
||||
done
|
||||
|
||||
if [ "$SET_PASSWORD" == "1" ]; then
|
||||
mypassword=$passwd
|
||||
else
|
||||
read -s -p "Enter Password: " mypassword
|
||||
if [ "$SET_PASSWORD" != "1" ]; then
|
||||
read -s -p "Enter Password: " passwd
|
||||
fi
|
||||
|
||||
tmpfile=`mktemp`
|
||||
echo \'$passwd\' | $SUDO echo $HOME >& $tmpfile
|
||||
echo $passwd | $SUDO echo $HOME > $tmpfile
|
||||
tstsudo=`cat $tmpfile`
|
||||
if [ "$tstsudo" != "$HOME" ]; then
|
||||
echo "$USER might not have sudo privileges. Exiting"
|
||||
@@ -425,9 +456,17 @@ rm -fr $tmpfile
|
||||
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"
|
||||
@@ -449,6 +488,15 @@ for search_expr in "${test_case_array[@]}"
|
||||
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
|
||||
@@ -487,6 +535,7 @@ for search_expr in "${test_case_array[@]}"
|
||||
echo "search_expr_false = $search_expr_false"
|
||||
echo "nruns = $nruns"
|
||||
|
||||
|
||||
#eval $pre_exec
|
||||
compile_prog_out=`eval echo \"$compile_prog_out\"`
|
||||
|
||||
@@ -509,7 +558,7 @@ for search_expr in "${test_case_array[@]}"
|
||||
if [ "$class" == "compilation" ]; then
|
||||
test_compile "$name" "$compile_prog" "$compile_prog_args" "$pre_exec" "$pre_exec_args" "$main_exec" "$main_exec_args" "search_array_true[@]" "$search_expr_false" "$nruns" "$pre_compile_prog" "$class" "$compile_prog_out" "$tags"
|
||||
elif [ "$class" == "execution" ]; then
|
||||
$SUDO killall -q oaisim_nos1
|
||||
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 ...."
|
||||
|
||||
@@ -216,7 +216,7 @@ def sftp_module (username, password, hostname, ports, paramList,logfile):
|
||||
# \brief bash script stub put at the end of scripts to terminate it
|
||||
# \param timeout_cmd terminate script after timeout_cmd seconds
|
||||
# \param terminate_missing_procs if True terminate all the processes launched by script if one of them terminates prematurely (due to error)
|
||||
def finalize_deploy_script (timeout_cmd, terminate_missing_procs='True'):
|
||||
def finalize_deploy_script (timeout_cmd, terminate_missing_procs='False'):
|
||||
cmd = 'declare -i timeout_cmd='+str(timeout_cmd) + '\n'
|
||||
if terminate_missing_procs == 'True':
|
||||
cmd = cmd + """
|
||||
@@ -571,6 +571,17 @@ def handle_testcaseclass_softmodem (testcase, oldprogramList, logdirOAI5GRepo ,
|
||||
nruns = nruns_lte_softmodem
|
||||
nruns = int(float(nruns))
|
||||
tags = testcase.findtext('tags',default='')
|
||||
|
||||
RRHMachine = testcase.findtext('RRH',default='')
|
||||
RRH_compile_prog = testcase.findtext('RRH_compile_prog',default='')
|
||||
RRH_compile_prog_args = testcase.findtext('RRH_compile_prog_args',default='')
|
||||
RRH_pre_exec = testcase.findtext('RRH_pre_exec',default='')
|
||||
RRH_pre_exec_args = testcase.findtext('RRH_pre_exec_args',default='')
|
||||
RRH_main_exec = testcase.findtext('RRH_main_exec',default='')
|
||||
RRH_main_exec_args = testcase.findtext('RRH_main_exec_args',default='')
|
||||
RRH_terminate_missing_procs = testcase.findtext('RRH_terminate_missing_procs',default='True')
|
||||
|
||||
|
||||
eNBMachine = testcase.findtext('eNB',default='')
|
||||
eNB_config_file = testcase.findtext('eNB_config_file',default='')
|
||||
eNB_compile_prog = testcase.findtext('eNB_compile_prog',default='')
|
||||
@@ -635,13 +646,15 @@ def handle_testcaseclass_softmodem (testcase, oldprogramList, logdirOAI5GRepo ,
|
||||
oai_EPC = openair('localdomain', EPCMachine)
|
||||
oai_EPC.connect(user, password)
|
||||
res = oai_eNB.send_recv(cmd)
|
||||
|
||||
if RRHMachine != '':
|
||||
cmd = 'cd ' + logdirOAI5GRepo + '; source oaienv ; env|grep OPENAIR'
|
||||
index_RRHMachine = MachineList.index(RRHMachine)
|
||||
oai_RRH = openair('localdomain', RRHMachine)
|
||||
oai_RRH.connect(user, password)
|
||||
res= oai_RRH.send_recv(cmd)
|
||||
#cleanOldPrograms(oai_eNB, oldprogramList, CleanUpAluLteBox, ExmimoRfStop)
|
||||
#cleanOldPrograms(oai_UE, oldprogramList, CleanUpAluLteBox, ExmimoRfStop)
|
||||
#cleanOldPrograms(oai_EPC, oldprogramList, CleanUpAluLteBox, ExmimoRfStop)
|
||||
logdir_eNB = logdirOAI5GRepo+'/cmake_targets/autotests/log/'+ testcasename
|
||||
logdir_UE = logdirOAI5GRepo+'/cmake_targets/autotests/log/'+ testcasename
|
||||
logdir_EPC = logdirOpenaircnRepo+'/TEST/autotests/log/'+ testcasename
|
||||
logdir_local = os.environ.get('OPENAIR_DIR')
|
||||
if logdir_local is None:
|
||||
print "Environment variable OPENAIR_DIR not set correctly"
|
||||
@@ -667,10 +680,14 @@ def handle_testcaseclass_softmodem (testcase, oldprogramList, logdirOAI5GRepo ,
|
||||
run_result=1
|
||||
run_result_string=''
|
||||
logdir_eNB = logdirOAI5GRepo+'/cmake_targets/autotests/log/'+ testcasename + '/run_' + str(run)
|
||||
logdir_RRH = logdirOAI5GRepo+'/cmake_targets/autotests/log/'+ testcasename + '/run_' + str(run)
|
||||
logdir_UE = logdirOAI5GRepo+'/cmake_targets/autotests/log/'+ testcasename + '/run_' + str(run)
|
||||
logdir_EPC = logdirOpenaircnRepo+'/TEST/autotests/log/'+ testcasename + '/run_' + str(run)
|
||||
logdir_local_testcase = logdir_local + '/cmake_targets/autotests/log/'+ testcasename + '/run_' + str(run)
|
||||
#Make the log directory of test case
|
||||
if RRHMachine != '':
|
||||
cmd = 'rm -fr ' + logdir_RRH + ' ; mkdir -p ' + logdir_RRH
|
||||
result = oai_RRH.send_recv(cmd)
|
||||
cmd = 'rm -fr ' + logdir_eNB + ' ; mkdir -p ' + logdir_eNB
|
||||
result = oai_eNB.send_recv(cmd)
|
||||
cmd = 'rm -fr ' + logdir_UE + ' ; mkdir -p ' + logdir_UE
|
||||
@@ -679,6 +696,39 @@ def handle_testcaseclass_softmodem (testcase, oldprogramList, logdirOAI5GRepo ,
|
||||
result = oai_EPC.send_recv(cmd)
|
||||
cmd = ' rm -fr ' + logdir_local_testcase + ' ; mkdir -p ' + logdir_local_testcase
|
||||
result = os.system(cmd)
|
||||
|
||||
if RRHMachine != '':
|
||||
logfile_compile_RRH = logdir_RRH + '/RRH_compile' + '_' + str(run) + '_.log'
|
||||
logfile_exec_RRH = logdir_RRH + '/RRH_exec' + '_' + str(run) + '_.log'
|
||||
logfile_pre_exec_RRH = logdir_RRH + '/RRH_pre_exec' + '_' + str(run) + '_.log'
|
||||
logfile_task_RRH_compile_out = logdir_RRH + '/RRH_task_compile_out' + '_' + str(run) + '_.log'
|
||||
logfile_task_RRH_compile = logdir_local_testcase + '/RRH_task_compile' + '_' + str(run) + '_.log'
|
||||
logfile_task_RRH_out = logdir_RRH + '/RRH_task_out' + '_' + str(run) + '_.log'
|
||||
logfile_task_RRH = logdir_local_testcase + '/RRH_task' + '_' + str(run) + '_.log'
|
||||
task_RRH_compile = ' ( uname -a ; date \n'
|
||||
task_RRH_compile = task_RRH_compile + 'cd ' + logdirOAI5GRepo + ' ; source oaienv ; source cmake_targets/tools/build_helper \n'
|
||||
task_RRH_compile = task_RRH_compile + 'env |grep OPENAIR \n'
|
||||
if RRH_compile_prog != "":
|
||||
task_RRH_compile = task_RRH_compile + ' ( ' + RRH_compile_prog + ' '+ RRH_compile_prog_args + ' ) > ' + logfile_compile_RRH + ' 2>&1 \n'
|
||||
task_RRH_compile = task_RRH_compile + ' date ) > ' + logfile_task_RRH_compile_out + ' 2>&1 '
|
||||
write_file(logfile_task_RRH_compile, task_RRH_compile, mode="w")
|
||||
|
||||
task_RRH = ' ( uname -a ; date \n'
|
||||
task_RRH = task_RRH + ' export OPENAIR_TESTDIR=' + logdir_RRH + '\n'
|
||||
task_RRH = task_RRH + 'cd ' + logdirOAI5GRepo + ' ; source oaienv ; source cmake_targets/tools/build_helper \n'
|
||||
task_RRH = task_RRH + 'env |grep OPENAIR \n' + 'array_exec_pid=() \n'
|
||||
|
||||
if RRH_pre_exec != "":
|
||||
task_RRH = task_RRH + ' ( date; ' + RRH_pre_exec + ' '+ RRH_pre_exec_args + ' ) > ' + logfile_pre_exec_RRH + ' 2>&1 \n'
|
||||
if RRH_main_exec != "":
|
||||
task_RRH = task_RRH + ' ( date; ' + addsudo(RRH_main_exec + ' ' + RRH_main_exec_args, mypassword) + ' ) > ' + logfile_exec_RRH + ' 2>&1 & \n'
|
||||
task_RRH = task_RRH + 'array_exec_pid+=($!) \n'
|
||||
task_RRH = task_RRH + 'echo eNB_main_exec PID = $! \n'
|
||||
#terminate the eNB test case after timeout_cmd seconds
|
||||
task_RRH = task_RRH + finalize_deploy_script (timeout_cmd, RRH_terminate_missing_procs) + ' \n'
|
||||
task_RRH = task_RRH + 'handle_ctrl_c' + '\n'
|
||||
task_RRH = task_RRH + ' ) > ' + logfile_task_RRH_out + ' 2>&1 '
|
||||
write_file(logfile_task_RRH, task_RRH, mode="w")
|
||||
|
||||
logfile_compile_eNB = logdir_eNB + '/eNB_compile' + '_' + str(run) + '_.log'
|
||||
logfile_exec_eNB = logdir_eNB + '/eNB_exec' + '_' + str(run) + '_.log'
|
||||
@@ -704,6 +754,7 @@ def handle_testcaseclass_softmodem (testcase, oldprogramList, logdirOAI5GRepo ,
|
||||
write_file(logfile_task_eNB_compile, task_eNB_compile, mode="w")
|
||||
|
||||
task_eNB = ' ( uname -a ; date \n'
|
||||
task_eNB = task_eNB + ' export OPENAIR_TESTDIR=' + logdir_eNB + '\n'
|
||||
task_eNB = task_eNB + 'cd ' + logdirOAI5GRepo + ' ; source oaienv ; source cmake_targets/tools/build_helper \n'
|
||||
task_eNB = task_eNB + 'env |grep OPENAIR \n' + 'array_exec_pid=() \n'
|
||||
|
||||
@@ -806,6 +857,7 @@ def handle_testcaseclass_softmodem (testcase, oldprogramList, logdirOAI5GRepo ,
|
||||
write_file(logfile_task_EPC_compile, task_EPC_compile, mode="w")
|
||||
|
||||
task_EPC = ' ( uname -a ; date \n'
|
||||
task_EPC = task_EPC + ' export OPENAIRCN_TESTDIR=' + logdir_EPC + '\n'
|
||||
task_EPC = task_EPC + 'array_exec_pid=()' + '\n'
|
||||
task_EPC = task_EPC + 'cd ' + logdirOpenaircnRepo + '; source oaienv\n'
|
||||
task_EPC = task_EPC + 'source BUILD/TOOLS/build_helper \n'
|
||||
@@ -837,14 +889,20 @@ def handle_testcaseclass_softmodem (testcase, oldprogramList, logdirOAI5GRepo ,
|
||||
thread_EPC = oaiThread(1, "EPC_thread", EPCMachine, user, password , task_EPC_compile, False, timeout_thread)
|
||||
thread_eNB = oaiThread(2, "eNB_thread", eNBMachine, user, password , task_eNB_compile, False, timeout_thread)
|
||||
thread_UE = oaiThread(3, "UE_thread", UEMachine, user, password , task_UE_compile, False, timeout_thread)
|
||||
if RRHMachine != '':
|
||||
thread_RRH = oaiThread(4, "RRH_thread", RRHMachine, user, password , task_RRH_compile, False, timeout_thread)
|
||||
threads=[]
|
||||
threads.append(thread_eNB)
|
||||
threads.append(thread_UE)
|
||||
threads.append(thread_EPC)
|
||||
if RRHMachine != '':
|
||||
threads.append(thread_RRH)
|
||||
# Start new Threads
|
||||
thread_eNB.start()
|
||||
thread_UE.start()
|
||||
thread_EPC.start()
|
||||
if RRHMachine != '':
|
||||
thread_RRH.start()
|
||||
#Wait for all the compile threads to complete
|
||||
for t in threads:
|
||||
t.join()
|
||||
@@ -853,26 +911,29 @@ def handle_testcaseclass_softmodem (testcase, oldprogramList, logdirOAI5GRepo ,
|
||||
thread_EPC = oaiThread(1, "EPC_thread", EPCMachine, user, password , task_EPC, False, timeout_thread)
|
||||
thread_eNB = oaiThread(2, "eNB_thread", eNBMachine, user, password , task_eNB, False, timeout_thread)
|
||||
thread_UE = oaiThread(3, "UE_thread", UEMachine, user, password , task_UE, False, timeout_thread)
|
||||
|
||||
if RRHMachine != '':
|
||||
thread_RRH = oaiThread(4, "RRH_thread", RRHMachine, user, password , task_RRH, False, timeout_thread)
|
||||
threads=[]
|
||||
threads.append(thread_eNB)
|
||||
threads.append(thread_UE)
|
||||
threads.append(thread_EPC)
|
||||
if RRHMachine != '':
|
||||
threads.append(thread_RRH)
|
||||
# Start new Threads
|
||||
|
||||
thread_eNB.start()
|
||||
thread_UE.start()
|
||||
thread_EPC.start()
|
||||
|
||||
if RRHMachine != '':
|
||||
thread_RRH.start()
|
||||
#Wait for all the compile threads to complete
|
||||
for t in threads:
|
||||
t.join()
|
||||
#Now we get the log files from remote machines on the local machine
|
||||
cleanOldProgramsAllMachines([oai_eNB, oai_UE, oai_EPC] , oldprogramList, CleanUpAluLteBox, ExmimoRfStop)
|
||||
|
||||
#cleanOldPrograms(oai_eNB, oldprogramList, CleanUpAluLteBox, ExmimoRfStop)
|
||||
#cleanOldPrograms(oai_UE, oldprogramList, CleanUpAluLteBox, ExmimoRfStop)
|
||||
#cleanOldPrograms(oai_EPC, oldprogramList, CleanUpAluLteBox, ExmimoRfStop)
|
||||
if RRHMachine != '':
|
||||
cleanOldProgramsAllMachines([oai_eNB, oai_UE, oai_EPC, oai_RRH] , oldprogramList, CleanUpAluLteBox, ExmimoRfStop)
|
||||
else:
|
||||
cleanOldProgramsAllMachines([oai_eNB, oai_UE, oai_EPC] , oldprogramList, CleanUpAluLteBox, ExmimoRfStop)
|
||||
logfile_UE_stop_script_out = logdir_UE + '/UE_stop_script_out' + '_' + str(run) + '_.log'
|
||||
logfile_UE_stop_script = logdir_local_testcase + '/UE_stop_script' + '_' + str(run) + '_.log'
|
||||
|
||||
@@ -900,22 +961,23 @@ def handle_testcaseclass_softmodem (testcase, oldprogramList, logdirOAI5GRepo ,
|
||||
res= oai_EPC.send_recv(cmd)
|
||||
print "Changing permissions of logdir <" + logdir_EPC + "> in EPC machine..." + res
|
||||
|
||||
if RRHMachine != '':
|
||||
cmd = 'sudo -E chown -R ' + user + ' ' + logdir_RRH
|
||||
res= oai_RRH.send_recv(cmd)
|
||||
print "Changing permissions of logdir <" + logdir_RRH + "> in RRH machine..." + res
|
||||
|
||||
print "Copying files from EPCMachine : " + EPCMachine + "logdir_EPC = " + logdir_EPC
|
||||
#ssh = SSHSession(EPCMachine , username=user, key_file=None, password=password)
|
||||
#ssh.get_all(logdir_EPC , logdir_local + '/cmake_targets/autotests/log/'+ testcasename)
|
||||
SSHSessionWrapper(EPCMachine, user, None, password, logdir_EPC, logdir_local + '/cmake_targets/autotests/log/'+ testcasename, "get_all")
|
||||
|
||||
print "Copying files from eNBMachine " + eNBMachine + "logdir_eNB = " + logdir_eNB
|
||||
#ssh = SSHSession(eNBMachine , username=user, key_file=None, password=password)
|
||||
#ssh.get_all(logdir_eNB, logdir_local + '/cmake_targets/autotests/log/'+ testcasename)
|
||||
SSHSessionWrapper(eNBMachine, user, None, password, logdir_eNB, logdir_local + '/cmake_targets/autotests/log/'+ testcasename, "get_all")
|
||||
|
||||
print "Copying files from UEMachine : " + UEMachine + "logdir_UE = " + logdir_UE
|
||||
#ssh = SSHSession(UEMachine , username=user, key_file=None, password=password)
|
||||
#ssh.get_all(logdir_UE , logdir_local + '/cmake_targets/autotests/log/'+ testcasename)
|
||||
SSHSessionWrapper(UEMachine, user, None, password, logdir_UE, logdir_local + '/cmake_targets/autotests/log/'+ testcasename, "get_all")
|
||||
|
||||
if RRHMachine != '':
|
||||
print "Copying files from RRHMachine : " + RRHMachine + "logdir_RRH = " + logdir_RRH
|
||||
SSHSessionWrapper(RRHMachine, user, None, password, logdir_RRH, logdir_local + '/cmake_targets/autotests/log/'+ testcasename, "get_all")
|
||||
|
||||
|
||||
#Currently we only perform throughput tests
|
||||
@@ -1017,8 +1079,8 @@ class oaiCleanOldProgramThread (threading.Thread):
|
||||
error = error + '\n threadID = ' + str(self.threadID) + '\n threadname = ' + self.threadname + '\n CleanUpOldProgs = ' + self.CleanUpOldProgs + '\n CleanUpAluLteBox = ' + self.CleanUpAluLteBox + '\n ExmimoRfStop = ' + self.ExmimoRfStop + '\n'
|
||||
error = error + traceback.format_exc()
|
||||
print error
|
||||
print "There is error in cleaning up old programs. The test case execution cannot continue...."
|
||||
sys.exit(1)
|
||||
print "There is error in cleaning up old programs....."
|
||||
#sys.exit(1)
|
||||
|
||||
# \brief Run parallel threads in all machines for clean up old execution of test cases
|
||||
# \param oai_list list of handlers that can be used to execute programs on remote machines
|
||||
@@ -1043,6 +1105,7 @@ pw =''
|
||||
i = 0
|
||||
dlsim=0
|
||||
localshell=0
|
||||
GitOAI5GRepo=''
|
||||
GitOAI5GRepoBranch=''
|
||||
GitOAI5GHeadVersion=''
|
||||
user=''
|
||||
@@ -1061,6 +1124,7 @@ flag_remove_logdir=False
|
||||
flag_start_testcase=False
|
||||
nruns_lte_softmodem=''
|
||||
flag_skip_git_head_check=False
|
||||
flag_skip_oai_install=False
|
||||
Timeout_cmd=''
|
||||
print "Number of arguments argc = " + str(len(sys.argv))
|
||||
#for index in range(1,len(sys.argv) ):
|
||||
@@ -1078,6 +1142,9 @@ while i < len (sys.argv):
|
||||
i = i +1
|
||||
elif arg == '-c':
|
||||
cleanUpRemoteMachines=True
|
||||
elif arg == '-5GRepo':
|
||||
GitOAI5GRepo = sys.argv[i+1]
|
||||
i = i +1
|
||||
elif arg == '-5GRepoBranch':
|
||||
GitOAI5GRepoBranch = sys.argv[i+1]
|
||||
i = i +1
|
||||
@@ -1120,11 +1187,14 @@ while i < len (sys.argv):
|
||||
elif arg == '--timeout_cmd':
|
||||
Timeout_cmd = sys.argv[i+1]
|
||||
i = i +1
|
||||
elif arg == '--skip-oai-install':
|
||||
flag_skip_oai_install=True
|
||||
elif arg == '-h' :
|
||||
print "-s: This flag *MUST* be set to start the test cases"
|
||||
print "-r: Remove the log directory in autotests"
|
||||
print "-g: Run test cases in a group"
|
||||
print "-c: Run cleanup scripts on remote machines and exit"
|
||||
print "-5GRepo: Repository for OAI 5G to use to run tests (overrides GitOAI5GRepo in test_case_list.xml)"
|
||||
print "-5GRepoBranch: Branch for OAI 5G Repository to run tests (overrides the branch in test_case_list.xml)"
|
||||
print "-5GRepoHeadVersion: Head commit on which to run tests (overrides the branch in test_case_list.xml)"
|
||||
print "-u: use the user name passed as argument"
|
||||
@@ -1135,6 +1205,7 @@ while i < len (sys.argv):
|
||||
print "-MachineListGeneric : overrides the MachineListGeneric parameter in test_case_list.xml"
|
||||
print "--skip-git-head-check: skip checking of GitHead remote/local branch (only for debugging)"
|
||||
print "--timeout_cmd: Override the default parameter (timeout_cmd) in test_case_list.xml. This parameter is in seconds and should be > 120"
|
||||
print "--skip-oai-install: Skips the openairinterface5g installer"
|
||||
sys.exit()
|
||||
else :
|
||||
print "Unrecongnized Option: <" + arg + ">. Use -h to see valid options"
|
||||
@@ -1212,7 +1283,9 @@ if MachineList =='':
|
||||
MachineList = xmlRoot.findtext('MachineList',default='')
|
||||
NFSResultsShare = xmlRoot.findtext('NFSResultsShare',default='')
|
||||
GitOpenaircnRepo = xmlRoot.findtext('GitOpenair-cnRepo',default='')
|
||||
GitOAI5GRepo = xmlRoot.findtext('GitOAI5GRepo',default='')
|
||||
|
||||
if GitOAI5GRepo == '':
|
||||
GitOAI5GRepo = xmlRoot.findtext('GitOAI5GRepo',default='')
|
||||
|
||||
if GitOAI5GRepoBranch == '':
|
||||
GitOAI5GRepoBranch = xmlRoot.findtext('GitOAI5GRepoBranch',default='')
|
||||
@@ -1328,21 +1401,32 @@ for oai in oai_list:
|
||||
#cmd = cmd + 'mkdir -p ' + logdir + '\n'
|
||||
cmd = cmd + 'cd '+ logdir + '\n'
|
||||
cmd = cmd + 'git config --global http.sslVerify false \n'
|
||||
cmd = cmd + 'git clone --depth 1 '+ GitOAI5GRepo + ' -b ' + GitOAI5GRepoBranch +' \n'
|
||||
cmd = cmd + 'git clone '+ GitOpenaircnRepo + ' -b ' +GitOpenaircnRepoBranch + ' \n'
|
||||
cmd = cmd + 'git clone '+ GitOAI5GRepo +' \n'
|
||||
cmd = cmd + 'git clone '+ GitOpenaircnRepo + ' \n'
|
||||
cmd = cmd + 'cd ' + logdirOAI5GRepo + '\n'
|
||||
cmd = cmd + 'git checkout ' + GitOAI5GRepoBranch + '\n'
|
||||
#cmd = cmd + 'git checkout ' + GitOAI5GHeadVersion + '\n'
|
||||
cmd = cmd + 'git_head=`git ls-remote |grep \'' + GitOAI5GRepoBranch + '\'` \n'
|
||||
cmd = cmd + 'git_head=($git_head) \n'
|
||||
cmd = cmd + 'git_head=${git_head[0]} \n'
|
||||
cmd = cmd + 'echo \"GitOAI5GHeadVersion_remote = $git_head\"'
|
||||
cmd = cmd + 'echo \"GitOAI5GHeadVersion_remote = $git_head\" \n'
|
||||
cmd = cmd + 'echo \"GitOAI5GHeadVersion_local = ' + GitOAI5GHeadVersion + '\" \n'
|
||||
if flag_skip_git_head_check==True:
|
||||
cmd = cmd + 'echo \"skipping GitHead check...\" \n '
|
||||
else:
|
||||
cmd = cmd + 'if [ \"$git_head\" != \"'+ GitOAI5GHeadVersion + '\" ]; then echo \"error: Git openairinterface5g head version does not match\" ; fi \n'
|
||||
cmd = cmd + 'source oaienv' + '\n'
|
||||
if flag_skip_oai_install == False:
|
||||
cmd = cmd + 'source $OPENAIR_DIR/cmake_targets/tools/build_helper \n'
|
||||
cmd = cmd + 'echo \"Installing core OAI dependencies...Start\" \n'
|
||||
cmd = cmd + '$OPENAIR_DIR/cmake_targets/build_oai -I --install-optional-packages \n'
|
||||
cmd = cmd + 'echo \"Installing core OAI dependencies...Finished\" \n'
|
||||
#cmd = cmd + 'echo \"Installing BLADERF OAI dependencies...Start\" \n'
|
||||
#cmd = cmd + 'check_install_bladerf_driver \n'
|
||||
#cmd = cmd + 'echo \"Installing BLADERF OAI dependencies...Finished\" \n'
|
||||
#cmd = cmd + 'echo \"Installing USRP OAI dependencies...Start\" \n'
|
||||
#cmd = cmd + 'check_install_usrp_uhd_driver \n'
|
||||
#cmd = cmd + 'echo \"Installing USRP OAI dependencies...Finished\" \n'
|
||||
cmd = cmd + 'cd ' + logdirOpenaircnRepo + '\n'
|
||||
cmd = cmd + 'git checkout ' + GitOpenaircnRepoBranch + '\n'
|
||||
cmd = cmd + 'env |grep OPENAIR' + '\n'
|
||||
@@ -1351,7 +1435,7 @@ for oai in oai_list:
|
||||
#cmd = cmd + 'echo \' ' + cmd + '\' > ' + setup_script + ' 2>&1 \n '
|
||||
#result = oai_list[index].send_recv(cmd, False, 300 )
|
||||
write_file(setup_script, cmd, mode="w")
|
||||
tempThread = oaiThread(index, 'thread_setup_'+str(index)+'_' + MachineList[index] , MachineList[index] , user, pw, cmd, False, 300)
|
||||
tempThread = oaiThread(index, 'thread_setup_'+str(index)+'_' + MachineList[index] , MachineList[index] , user, pw, cmd, False, 3000)
|
||||
threads_init_setup.append(tempThread )
|
||||
tempThread.start()
|
||||
index = index + 1
|
||||
@@ -1399,7 +1483,8 @@ status, out = commands.getstatusoutput('grep ' + ' -il \'error\' ' + locallogdi
|
||||
if (out != '') :
|
||||
print "There is error in setup of machines"
|
||||
print "status = " + str(status) + "\n Check files for error = " + out
|
||||
print sys.exit(1)
|
||||
print "Exiting now..."
|
||||
sys.exit(1)
|
||||
|
||||
cleanOldProgramsAllMachines(oai_list, CleanUpOldProgs, CleanUpAluLteBox, ExmimoRfStop)
|
||||
if cleanUpRemoteMachines == True:
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,4 +1,34 @@
|
||||
#!/usr/bin/python
|
||||
#******************************************************************************
|
||||
|
||||
# OpenAirInterface
|
||||
# Copyright(c) 1999 - 2014 Eurecom
|
||||
|
||||
# OpenAirInterface is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
|
||||
|
||||
# OpenAirInterface is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with OpenAirInterface.The full GNU General Public License is
|
||||
# included in this distribution in the file called "COPYING". If not,
|
||||
# see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# Contact Information
|
||||
# OpenAirInterface Admin: openair_admin@eurecom.fr
|
||||
# OpenAirInterface Tech : openair_tech@eurecom.fr
|
||||
# OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr
|
||||
|
||||
# Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
|
||||
|
||||
# *******************************************************************************/
|
||||
# \author Navid Nikaein, Rohit Gupta
|
||||
|
||||
import time
|
||||
import serial
|
||||
@@ -28,17 +58,22 @@ 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=''
|
||||
while True:
|
||||
if os.path.exists(serial_port) == True:
|
||||
return serial_port
|
||||
for port in range(2,100):
|
||||
serial_port_tmp = '/dev/ttyUSB'+str(port)
|
||||
if os.path.exists(serial_port_tmp) == True:
|
||||
print 'New Serial Port : ' + serial_port_tmp
|
||||
serial_port = serial_port_tmp
|
||||
break
|
||||
if serial_port == '':
|
||||
print" Not able to detect valid serial ports. Resetting the modem now..."
|
||||
reset_ue()
|
||||
else :
|
||||
ser = serial.Serial(port=serial_port)
|
||||
return
|
||||
|
||||
|
||||
#serial_port = '/dev/ttyUSB2'
|
||||
@@ -131,6 +166,7 @@ def start_ue () :
|
||||
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:
|
||||
|
||||
@@ -0,0 +1,242 @@
|
||||
#!/usr/bin/python
|
||||
#******************************************************************************
|
||||
|
||||
# OpenAirInterface
|
||||
# Copyright(c) 1999 - 2014 Eurecom
|
||||
|
||||
# OpenAirInterface is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
|
||||
|
||||
# OpenAirInterface is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with OpenAirInterface.The full GNU General Public License is
|
||||
# included in this distribution in the file called "COPYING". If not,
|
||||
# see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# Contact Information
|
||||
# OpenAirInterface Admin: openair_admin@eurecom.fr
|
||||
# OpenAirInterface Tech : openair_tech@eurecom.fr
|
||||
# OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr
|
||||
|
||||
# Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
|
||||
|
||||
# *******************************************************************************/
|
||||
# \author Navid Nikaein, Rohit Gupta
|
||||
|
||||
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
|
||||
serial_port=''
|
||||
while True:
|
||||
if os.path.exists(serial_port) == True:
|
||||
return serial_port
|
||||
for port in range(2,100):
|
||||
serial_port_tmp = '/dev/ttyUSB'+str(port)
|
||||
if os.path.exists(serial_port_tmp) == True:
|
||||
print 'New Serial Port : ' + serial_port_tmp
|
||||
serial_port = serial_port_tmp
|
||||
break
|
||||
if serial_port == '':
|
||||
print" Not able to detect valid serial ports. Resetting the modem now..."
|
||||
reset_ue()
|
||||
else :
|
||||
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():
|
||||
stringIdBandrich='Huawei Technologies Co., Ltd. E398 LTE/UMTS/GSM Modem/Networkcard'
|
||||
status, out = commands.getstatusoutput('lsusb | grep -i \'' + stringIdBandrich + '\'')
|
||||
if (out == '') :
|
||||
print "Huawei E398 Adapter not found. Exiting now..."
|
||||
sys.exit()
|
||||
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 "Huawei E398 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,118 @@
|
||||
#!/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
|
||||
|
||||
# Find a device ID by running sudo adb devices
|
||||
# The device ID below is for Sony Xperia M4
|
||||
|
||||
device_id='YT9115PX1E'
|
||||
|
||||
|
||||
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 signal_handler(signal, frame):
|
||||
print('You pressed Ctrl+C!')
|
||||
print('Exiting now...')
|
||||
timeout=10
|
||||
exit_flag=1
|
||||
sys.exit(0)
|
||||
|
||||
signal.signal(signal.SIGINT, signal_handler)
|
||||
|
||||
# Find all the process IDs in a phone given the name of process
|
||||
def kill_processes(name):
|
||||
print " Killing all processes by name..." + name
|
||||
while 1:
|
||||
cmd = 'sudo adb -s ' + device_id +' shell "ps |grep ' + name + '"'
|
||||
status, out = commands.getstatusoutput(cmd)
|
||||
if status != 0:
|
||||
print "Error execting command to kill process " + name
|
||||
sys.exit(1)
|
||||
print "Out = " + out
|
||||
if out=='':
|
||||
break;
|
||||
out_arr = out.split()
|
||||
pid_to_kill = out_arr[1]
|
||||
print "Now killing process ID " + pid_to_kill + " on Phone"
|
||||
cmd = 'sudo adb -s ' + device_id +' shell "kill ' + pid_to_kill + '"'
|
||||
status, out = commands.getstatusoutput(cmd)
|
||||
if status != 0:
|
||||
print "Error execting command to kill process " + name
|
||||
sys.exit(1)
|
||||
print "Out = " + out
|
||||
|
||||
def start_ue () :
|
||||
#print 'Enter your commands below.\r\nInsert "exit" to leave the application.'
|
||||
print 'Killing old iperf/ping sessions'
|
||||
kill_processes('iperf')
|
||||
kill_processes('ping')
|
||||
print "Turning off airplane mode"
|
||||
os.system('sudo -E adb devices')
|
||||
os.system('sudo -E adb -s ' + device_id + ' shell \"settings put global airplane_mode_on 0; am broadcast -a android.intent.action.AIRPLANE_MODE --ez state false\"')
|
||||
|
||||
while 1:
|
||||
time.sleep ( 2)
|
||||
#Now we check if ppp0 interface is up and running
|
||||
try:
|
||||
cmd = 'sudo adb -s ' + device_id + ' shell netcfg |grep 192.'
|
||||
status, out = commands.getstatusoutput(cmd)
|
||||
if (out == '') :
|
||||
print "Waiting for UE to connect and get IP Address..."
|
||||
else :
|
||||
print "UE is now connected. IP Address settings are..." + out
|
||||
os.system('sleep 5')
|
||||
os.system ('sudo adb -s ' + device_id + ' shell ping ' + gw)
|
||||
break
|
||||
except Exception, e:
|
||||
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 stop_ue():
|
||||
print "Turning on airplane mode"
|
||||
os.system('sudo adb devices')
|
||||
os.system('sudo adb -s ' + device_id + ' shell \"settings put global airplane_mode_on 1; am broadcast -a android.intent.action.AIRPLANE_MODE --ez state true\" ')
|
||||
print "Killing iperf/ping sessions"
|
||||
kill_processes('iperf')
|
||||
kill_processes('ping')
|
||||
|
||||
i=1
|
||||
gw='192.172.0.1'
|
||||
while i < len(sys.argv):
|
||||
arg=sys.argv[i]
|
||||
if arg == '--start-ue' :
|
||||
start_ue()
|
||||
elif arg == '--stop-ue' :
|
||||
stop_ue()
|
||||
elif arg == '-gw' :
|
||||
gw = sys.argv[i+1]
|
||||
i=i+1
|
||||
elif arg == '-h' :
|
||||
print "--stop-ue: Stop the UE. Turn on airplane mode"
|
||||
print "--start-ue: Start the UE. Turn off airplane mode"
|
||||
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
|
||||
|
||||
|
||||
@@ -1,4 +1,35 @@
|
||||
#!/bin/bash
|
||||
#******************************************************************************
|
||||
|
||||
# OpenAirInterface
|
||||
# Copyright(c) 1999 - 2014 Eurecom
|
||||
|
||||
# OpenAirInterface is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
|
||||
|
||||
# OpenAirInterface is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with OpenAirInterface.The full GNU General Public License is
|
||||
# included in this distribution in the file called "COPYING". If not,
|
||||
# see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# Contact Information
|
||||
# OpenAirInterface Admin: openair_admin@eurecom.fr
|
||||
# OpenAirInterface Tech : openair_tech@eurecom.fr
|
||||
# OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr
|
||||
|
||||
# Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
|
||||
|
||||
# *******************************************************************************/
|
||||
# \author Navid Nikaein, Rohit Gupta
|
||||
|
||||
|
||||
#arg1 idVendor
|
||||
#arg2 idProduct
|
||||
|
||||
Executable
+36
@@ -0,0 +1,36 @@
|
||||
#!/bin/bash
|
||||
#******************************************************************************
|
||||
|
||||
# OpenAirInterface
|
||||
# Copyright(c) 1999 - 2014 Eurecom
|
||||
|
||||
# OpenAirInterface is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
|
||||
|
||||
# OpenAirInterface is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with OpenAirInterface.The full GNU General Public License is
|
||||
# included in this distribution in the file called "COPYING". If not,
|
||||
# see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# Contact Information
|
||||
# OpenAirInterface Admin: openair_admin@eurecom.fr
|
||||
# OpenAirInterface Tech : openair_tech@eurecom.fr
|
||||
# OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr
|
||||
|
||||
# Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
|
||||
|
||||
# *******************************************************************************/
|
||||
# \author Navid Nikaein, Rohit Gupta
|
||||
|
||||
# To free unused memory else test setup runs out of memory
|
||||
sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches '
|
||||
|
||||
|
||||
@@ -1,4 +1,34 @@
|
||||
#!/bin/bash
|
||||
#******************************************************************************
|
||||
|
||||
# OpenAirInterface
|
||||
# Copyright(c) 1999 - 2014 Eurecom
|
||||
|
||||
# OpenAirInterface is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
|
||||
|
||||
# OpenAirInterface is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with OpenAirInterface.The full GNU General Public License is
|
||||
# included in this distribution in the file called "COPYING". If not,
|
||||
# see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# Contact Information
|
||||
# OpenAirInterface Admin: openair_admin@eurecom.fr
|
||||
# OpenAirInterface Tech : openair_tech@eurecom.fr
|
||||
# OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr
|
||||
|
||||
# Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
|
||||
|
||||
# *******************************************************************************/
|
||||
# \author Navid Nikaein, Rohit Gupta
|
||||
|
||||
#arg1 timeout to wait before running the script
|
||||
#arg2 interface
|
||||
|
||||
+63
@@ -0,0 +1,63 @@
|
||||
#!/bin/bash
|
||||
#******************************************************************************
|
||||
|
||||
# OpenAirInterface
|
||||
# Copyright(c) 1999 - 2014 Eurecom
|
||||
|
||||
# OpenAirInterface is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
|
||||
|
||||
# OpenAirInterface is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with OpenAirInterface.The full GNU General Public License is
|
||||
# included in this distribution in the file called "COPYING". If not,
|
||||
# see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# Contact Information
|
||||
# OpenAirInterface Admin: openair_admin@eurecom.fr
|
||||
# OpenAirInterface Tech : openair_tech@eurecom.fr
|
||||
# OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr
|
||||
|
||||
# Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
|
||||
|
||||
# *******************************************************************************/
|
||||
# \author Navid Nikaein, Rohit Gupta
|
||||
|
||||
#arg1 timeout to wait before running the script
|
||||
#arg2 interface
|
||||
#arg3 iperf arguments
|
||||
|
||||
args=($*)
|
||||
timeout=${args[0]}
|
||||
device_id=${args[1]}
|
||||
iperf_args=(${args[@]:2})
|
||||
|
||||
#array=${1:-1}
|
||||
echo "args = ${args[@]}"
|
||||
echo "timeout = $timeout"
|
||||
echo "device_id = $device_id"
|
||||
echo "iperf_args = ${iperf_args[@]}"
|
||||
|
||||
sleep $timeout
|
||||
|
||||
while true ; do
|
||||
cmd=`sudo adb -s $device_id shell netcfg |grep 192.`
|
||||
if [ -z "$cmd" ]; then
|
||||
echo "Wating for UE to connect and get IP Address..."
|
||||
sleep 1
|
||||
else
|
||||
echo "UE is now connected. IP Address settings are... $cmd"
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
echo "Starting iperf now..."
|
||||
|
||||
sudo adb -s $device_id shell /data/local/tmp/iperf ${iperf_args[@]}
|
||||
@@ -1,4 +1,34 @@
|
||||
#!/usr/bin/python
|
||||
#******************************************************************************
|
||||
|
||||
# OpenAirInterface
|
||||
# Copyright(c) 1999 - 2014 Eurecom
|
||||
|
||||
# OpenAirInterface is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
|
||||
|
||||
# OpenAirInterface is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with OpenAirInterface.The full GNU General Public License is
|
||||
# included in this distribution in the file called "COPYING". If not,
|
||||
# see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# Contact Information
|
||||
# OpenAirInterface Admin: openair_admin@eurecom.fr
|
||||
# OpenAirInterface Tech : openair_tech@eurecom.fr
|
||||
# OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr
|
||||
|
||||
# Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
|
||||
|
||||
# *******************************************************************************/
|
||||
# \author Navid Nikaein, Rohit Gupta
|
||||
|
||||
import os
|
||||
from pyroute2 import IPRoute
|
||||
|
||||
@@ -1,4 +1,35 @@
|
||||
#!/usr/bin/python
|
||||
#******************************************************************************
|
||||
|
||||
# OpenAirInterface
|
||||
# Copyright(c) 1999 - 2014 Eurecom
|
||||
|
||||
# OpenAirInterface is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
|
||||
|
||||
# OpenAirInterface is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with OpenAirInterface.The full GNU General Public License is
|
||||
# included in this distribution in the file called "COPYING". If not,
|
||||
# see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# Contact Information
|
||||
# OpenAirInterface Admin: openair_admin@eurecom.fr
|
||||
# OpenAirInterface Tech : openair_tech@eurecom.fr
|
||||
# OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr
|
||||
|
||||
# Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
|
||||
|
||||
# *******************************************************************************/
|
||||
# \author Navid Nikaein, Rohit Gupta
|
||||
|
||||
import sys
|
||||
import re
|
||||
import os
|
||||
@@ -26,6 +57,9 @@ if keyword == 'mme_ip_address':
|
||||
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)
|
||||
|
||||
+22
-6
@@ -42,13 +42,13 @@ 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
|
||||
@@ -91,7 +91,7 @@ Options
|
||||
default is Rel10,
|
||||
Rel8 limits the implementation to 3GPP Release 8 version
|
||||
-w | --hardware
|
||||
EXMIMO (Default), USRP, BLADERF, 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
|
||||
@@ -181,7 +181,7 @@ function main() {
|
||||
-w | --hardware)
|
||||
HW="$2" #"${i#*=}"
|
||||
# Use OAI_USRP as the key word USRP is used inside UHD driver
|
||||
if [ "$HW" != "BLADERF" -a "$HW" != "USRP" -a "$HW" != "None" -a "$HW" != "EXMIMO" ] ; then
|
||||
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
|
||||
@@ -190,6 +190,9 @@ function main() {
|
||||
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;;
|
||||
@@ -299,6 +302,7 @@ function main() {
|
||||
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,
|
||||
@@ -312,6 +316,8 @@ function main() {
|
||||
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
|
||||
@@ -689,6 +695,16 @@ function main() {
|
||||
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
|
||||
@@ -744,9 +760,9 @@ fi
|
||||
rm -fr $OPENAIR_DIR/cmake_targets/autotests/log
|
||||
mkdir -p $OPENAIR_DIR/cmake_targets/autotests/log
|
||||
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 &
|
||||
$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 &
|
||||
$OPENAIR_DIR/cmake_targets/autotests/run_exec_autotests.bash -p $mypassword >& $OPENAIR_DIR/cmake_targets/autotests/log/autotests.log &
|
||||
fi
|
||||
wait
|
||||
else
|
||||
|
||||
@@ -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'
|
||||
@@ -132,10 +132,21 @@ compilations() {
|
||||
############################################
|
||||
|
||||
install_nettle_from_source() {
|
||||
nettle_install_log=$OPENAIR_DIR/cmake_targets/log/nettle_install_log.txt
|
||||
echo_info "\nInstalling Nettle. The log file for nettle installation is here: $nettle_install_log "
|
||||
(
|
||||
cd /tmp
|
||||
echo "Downloading nettle archive"
|
||||
rm -rf /tmp/nettle-2.5.tar.gz* /tmp/nettle-2.5
|
||||
wget ftp://ftp.lysator.liu.se/pub/security/lsh/nettle-2.5.tar.gz
|
||||
$SUDO rm -rf /tmp/nettle-2.5.tar.gz* /tmp/nettle-2.5
|
||||
wget https://ftp.gnu.org/gnu/nettle/nettle-2.5.tar.gz
|
||||
if [ $? -ne 0 ]; then
|
||||
wget ftp://ftp.lysator.liu.se/pub/security/lsh/nettle-2.5.tar.gz
|
||||
fi
|
||||
if [ ! -f nettle-2.5.tar.gz ]; then
|
||||
echo_error "Could not download nettle source files"
|
||||
cd -
|
||||
return
|
||||
fi
|
||||
tar -xzf nettle-2.5.tar.gz
|
||||
cd nettle-2.5/
|
||||
./configure --disable-openssl --enable-shared --prefix=/usr
|
||||
@@ -143,21 +154,32 @@ install_nettle_from_source() {
|
||||
make -j`nproc`
|
||||
make check
|
||||
$SUDO make install
|
||||
rm -rf /tmp/nettle-2.5.tar.gz /tmp/nettle-2.5
|
||||
) >& $nettle_install_log
|
||||
}
|
||||
|
||||
install_gnutls_from_source(){
|
||||
gnutls_install_log=$OPENAIR_DIR/cmake_targets/log/gnutls_install_log.txt
|
||||
echo_info "\nInstalling Gnutls. The log file for Gnutls installation is here: $gnutls_install_log "
|
||||
(
|
||||
cd /tmp
|
||||
echo "Downloading gnutls archive"
|
||||
rm -rf /tmp/gnutls-3.1.23.tar.xz* /tmp/gnutls-3.1.23
|
||||
wget ftp://ftp.gnutls.org/gcrypt/gnutls/v3.1/gnutls-3.1.23.tar.xz
|
||||
tar -xzf gnutls-3.1.23.tar.xz
|
||||
$SUDO rm -rf /tmp/gnutls-3.1.23.tar.xz* /tmp/gnutls-3.1.23
|
||||
wget http://mirrors.dotsrc.org/gcrypt/gnutls/v3.1/gnutls-3.1.23.tar.xz
|
||||
if [ $? -ne 0 ]; then
|
||||
wget ftp://ftp.gnutls.org/gcrypt/gnutls/v3.1/gnutls-3.1.23.tar.xz
|
||||
fi
|
||||
if [ ! -f gnutls-3.1.23.tar.xz ]; then
|
||||
echo_error "Could not download gnutls source files"
|
||||
cd -
|
||||
return
|
||||
fi
|
||||
tar -xJf gnutls-3.1.23.tar.xz
|
||||
cd gnutls-3.1.23/
|
||||
./configure --prefix=/usr
|
||||
echo "Compiling gnutls"
|
||||
make -j`nproc`
|
||||
$SUDO make install
|
||||
rm -rf /tmp/gnutls-3.1.23.tar.xz /tmp/gnutls-3.1.23
|
||||
)>& $gnutls_install_log
|
||||
}
|
||||
|
||||
|
||||
@@ -269,14 +291,17 @@ check_install_oai_software() {
|
||||
pydb \
|
||||
wvdial \
|
||||
python-numpy \
|
||||
sshpass
|
||||
sshpass \
|
||||
libxslt1-dev \
|
||||
android-tools-adb
|
||||
|
||||
$SUDO update-alternatives --set liblapack.so /usr/lib/atlas-base/atlas/liblapack.so
|
||||
if [ `lsb_release -rs` = '12.04' ] ; then
|
||||
install_nettle_from_source
|
||||
install_gnutls_from_source
|
||||
else
|
||||
$SUDO apt-get install -y libgnutls-dev nettle-dev nettle-bin
|
||||
fi
|
||||
|
||||
# First we remove gnutls/nettle installation and then install from sources
|
||||
$SUDO apt-get remove -y libgnutls-dev nettle-dev nettle-bin
|
||||
install_nettle_from_source
|
||||
install_gnutls_from_source
|
||||
|
||||
$SUDO pip install paramiko
|
||||
$SUDO pip install pyroute2
|
||||
install_asn1c_from_source
|
||||
@@ -285,20 +310,22 @@ check_install_oai_software() {
|
||||
}
|
||||
|
||||
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 "
|
||||
asn1_install_log=$OPENAIR_DIR/cmake_targets/log/asn1c_install_log.txt
|
||||
echo_info "\nInstalling ASN1. The log file for ASN1 installation is here: $asn1_install_log "
|
||||
(
|
||||
rm -rf /tmp/asn1c-r1516
|
||||
$SUDO rm -rf /tmp/asn1c-r1516
|
||||
mkdir -p /tmp/asn1c-r1516
|
||||
cd /tmp/asn1c-r1516
|
||||
svn co https://github.com/vlm/asn1c/trunk /tmp/asn1c-r1516 -r 1516
|
||||
patch -p0 < $OPENAIR_DIR/openair3/S1AP/MESSAGES/ASN1/asn1cpatch.p0
|
||||
patch -p0 < $OPENAIR_DIR/openair3/S1AP/MESSAGES/ASN1/asn1cpatch_2.p0
|
||||
patch -p0 < $OPENAIR_DIR/openair2/RRC/LITE/MESSAGES/asn1c/asn1cpatch.p0
|
||||
rm -rf /tmp/asn1c-r1516/*
|
||||
svn co https://github.com/vlm/asn1c/trunk /tmp/asn1c-r1516 -r 1516 > /tmp/log_compile_asn1c
|
||||
patch -p0 < $OPENAIR_DIR/openair3/S1AP/MESSAGES/ASN1/asn1cpatch.p0 >> /tmp/log_compile_asn1c
|
||||
patch -p0 < $OPENAIR_DIR/openair3/S1AP/MESSAGES/ASN1/asn1cpatch_2.p0 >> /tmp/log_compile_asn1c
|
||||
patch -p0 < $OPENAIR_DIR/openair2/RRC/LITE/MESSAGES/asn1c/asn1cpatch.p0 >> /tmp/log_compile_asn1c
|
||||
patch -p0 < $OPENAIR_DIR/openair3/S1AP/MESSAGES/ASN1/asn1cpatch_3.p0 >> /tmp/log_compile_asn1c
|
||||
./configure
|
||||
make -j`nproc`
|
||||
$SUDO make install
|
||||
) > $asn1_install_dir 2>&1
|
||||
) > $asn1_install_log 2>&1
|
||||
}
|
||||
|
||||
#################################################
|
||||
@@ -324,7 +351,6 @@ install_nas_tools() {
|
||||
}
|
||||
|
||||
|
||||
|
||||
################################
|
||||
# set_openair_env
|
||||
###############################
|
||||
@@ -380,3 +406,21 @@ done
|
||||
}
|
||||
|
||||
|
||||
# get from http://www.linuxjournal.com/content/validating-ip-address-bash-script
|
||||
validate_ip() {
|
||||
|
||||
local ip=$1
|
||||
local stat=1
|
||||
|
||||
if [[ $ip =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then
|
||||
OIFS=$IFS
|
||||
IFS='.'
|
||||
ip=($ip)
|
||||
IFS=$OIFS
|
||||
[[ ${ip[0]} -le 255 && ${ip[1]} -le 255 \
|
||||
&& ${ip[2]} -le 255 && ${ip[3]} -le 255 ]]
|
||||
stat=$?
|
||||
fi
|
||||
|
||||
return $stat
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
|
||||
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" 1a55f5402fd363318cf5444ffe1f67530dcf66ff "fix_asn1.data/X2AP.rel11.2/NativeInteger.c.diff"
|
||||
"constr_SET_OF.c" 808cbbdf19b118c0bdb04e3acf2cbe6e4133be2b "fix_asn1.data/X2AP.rel11.2/constr_SET_OF.c.diff"
|
||||
)
|
||||
|
||||
S1AP_Rel10_5=(
|
||||
"NativeInteger.c" 1a55f5402fd363318cf5444ffe1f67530dcf66ff "fix_asn1.data/S1AP.rel10.5/NativeInteger.c.diff"
|
||||
"constr_SET_OF.c" 808cbbdf19b118c0bdb04e3acf2cbe6e4133be2b "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);
|
||||
@@ -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
|
||||
|
||||
@@ -71,6 +71,7 @@ function help()
|
||||
echo_error " and PDCP-LTE. Then capture for all the interfaces with the following filters: s1ap or lte_rrc or mac-lte or rlc-lte"
|
||||
echo_error " or pdcp-lte. Note the L2 pdus are transmitted to the local interface."
|
||||
echo_error " -x, --xforms Run XFORMS scope windows."
|
||||
echo_error " -n, --num-frames Set number of frames for simulation"
|
||||
}
|
||||
|
||||
|
||||
@@ -165,6 +166,11 @@ function main()
|
||||
exe_arguments="$exe_arguments -P wireshark"
|
||||
shift 1;
|
||||
;;
|
||||
-n | --num-frames)
|
||||
echo "setting the number of frames in simulation to $2"
|
||||
exe_arguments="$exe_arguments -n $2"
|
||||
shift 2;
|
||||
;;
|
||||
*)
|
||||
echo "Unknown option $1"
|
||||
help
|
||||
|
||||
@@ -81,8 +81,10 @@ function help()
|
||||
echo_error " "
|
||||
echo_error "Options:"
|
||||
echo_error "Mandatory arguments to long options are mandatory for short options too."
|
||||
echo_error " -a, --abstraction enable phy abstraction mode"
|
||||
echo_error " -c, -C, --config-file eNB_config_file eNB config file, (see $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF)"
|
||||
echo_error " Default eNB config file if not set is $1"
|
||||
echo_error " -l, --log-level set the global log level (8:trace, 7:debug, 6:info, 4:warn, 3:error). Note that the log configuration is eNB config file is ignored for oaisim."
|
||||
echo_error " -g, --gdb Run with GDB."
|
||||
echo_error " -h, --help Print this help."
|
||||
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)"
|
||||
@@ -114,8 +116,14 @@ function main()
|
||||
until [ -z "$1" ]
|
||||
do
|
||||
case "$1" in
|
||||
-a | --abstraction )
|
||||
abstraction_flag=1
|
||||
echo "enabling abstraction mode"
|
||||
exe_arguments="$exe_arguments -a"
|
||||
shift;
|
||||
;;
|
||||
-c | -C | --config-file)
|
||||
CONFIG_FILE_ENB=$2
|
||||
CONFIG_FILE_ENB=$2
|
||||
# may be relative path
|
||||
if [ -f $(dirname $(readlink -f $0))/$CONFIG_FILE ]; then
|
||||
CONFIG_FILE_ENB=$(dirname $(readlink -f $0))/$CONFIG_FILE
|
||||
@@ -131,6 +139,11 @@ function main()
|
||||
fi
|
||||
shift 2;
|
||||
;;
|
||||
-l | --log-level)
|
||||
echo "setting the log level to $2"
|
||||
exe_arguments="$exe_arguments -l $2"
|
||||
shift 2;
|
||||
;;
|
||||
-g | --gdb)
|
||||
run_gdb=1
|
||||
echo "setting GDB flag to: $GDB"
|
||||
@@ -241,7 +254,8 @@ function main()
|
||||
if [ $? -ne 0 ]; then
|
||||
bash -c echo "200 lte " >> /etc/iproute2/rt_tables
|
||||
fi
|
||||
ip rule add fwmark 1 table lte
|
||||
ip rule add fwmark 1 table lte
|
||||
ifconfig oip1 up
|
||||
ip route add default dev oip1 table lte
|
||||
|
||||
exe_arguments="$exe_arguments -s15 -AAWGN -y1 -b1 -u1 -Q0"
|
||||
|
||||
@@ -13,5 +13,5 @@ sudo -E $OPENAIR_DIR/cmake_targets/tools/init_exmimo2
|
||||
|
||||
#now we stop the card from transmitting anything
|
||||
cd $OPENAIR_DIR/targets/bin
|
||||
sudo -E octave $OPENAIR_DIR/cmake_targets/tools/exmimo_stop_octave.m
|
||||
sudo -E octave -H --no-gui $OPENAIR_DIR/cmake_targets/tools/exmimo_stop_octave.m
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ xUnit_fail() {
|
||||
currtime=$(date +%s.%N)
|
||||
time=$(echo "$currtime - $XUNIT_START" | bc -l)
|
||||
xml="<testcase classname='$class' name='$test_case' Run_result='$run_result' time='$time s' RESULT='$result'></testcase>"
|
||||
echo -e $xml >> $xmlfile_testcase
|
||||
echo -e "$xml" >> "$xmlfile_testcase"
|
||||
XUNIT_TESTCASES_XML="$XUNIT_TESTCASES_XML \n$xml"
|
||||
XUNIT_FAILED=$((XUNIT_FAILED+1))
|
||||
}
|
||||
|
||||
@@ -177,7 +177,6 @@ hashtable_rc_t hashtable_dump_content (const hash_table_t * const hashtblP, char
|
||||
{
|
||||
hash_node_t *node = NULL;
|
||||
unsigned int i = 0;
|
||||
unsigned int num_elements = 0;
|
||||
if (hashtblP == NULL) {
|
||||
*remaining_bytes_in_buffer_pP = snprintf(
|
||||
buffer_pP,
|
||||
|
||||
@@ -54,7 +54,9 @@ uint64_t vcd_mp_free;
|
||||
#endif
|
||||
|
||||
/*------------------------------------------------------------------------------*/
|
||||
#ifndef CHARS_TO_UINT32
|
||||
#define CHARS_TO_UINT32(c1, c2, c3, c4) (((c1) << 24) | ((c2) << 16) | ((c3) << 8) | (c4))
|
||||
#endif
|
||||
|
||||
#define MEMORY_POOL_ITEM_INFO_NUMBER 2
|
||||
|
||||
|
||||
@@ -128,8 +128,8 @@ void phy_config_sib2_eNB(uint8_t Mod_id,
|
||||
{
|
||||
|
||||
LTE_DL_FRAME_PARMS *lte_frame_parms = &PHY_vars_eNB_g[Mod_id][CC_id]->lte_frame_parms;
|
||||
LTE_eNB_UE_stats *eNB_UE_stats = PHY_vars_eNB_g[Mod_id][CC_id]->eNB_UE_stats;
|
||||
int32_t rx_total_gain_eNB_dB = PHY_vars_eNB_g[Mod_id][CC_id]->rx_total_gain_eNB_dB;
|
||||
//LTE_eNB_UE_stats *eNB_UE_stats = PHY_vars_eNB_g[Mod_id][CC_id]->eNB_UE_stats;
|
||||
//int32_t rx_total_gain_eNB_dB = PHY_vars_eNB_g[Mod_id][CC_id]->rx_total_gain_eNB_dB;
|
||||
int i;
|
||||
|
||||
LOG_D(PHY,"[eNB%d] CCid %d Frame %d: Applying radioResourceConfigCommon\n",Mod_id,CC_id,PHY_vars_eNB_g[Mod_id][CC_id]->proc[8].frame_tx);
|
||||
@@ -683,11 +683,11 @@ void phy_config_dedicated_scell_eNB(uint8_t Mod_id,
|
||||
int CC_id)
|
||||
{
|
||||
|
||||
PHY_VARS_eNB *phy_vars_eNB = PHY_vars_eNB_g[Mod_id][CC_id];
|
||||
//PHY_VARS_eNB *phy_vars_eNB = PHY_vars_eNB_g[Mod_id][CC_id];
|
||||
uint8_t UE_id = find_ue(rnti,PHY_vars_eNB_g[Mod_id][0]);
|
||||
struct PhysicalConfigDedicatedSCell_r10 *physicalConfigDedicatedSCell_r10 = sCellToAddMod_r10->radioResourceConfigDedicatedSCell_r10->physicalConfigDedicatedSCell_r10;
|
||||
//struct RadioResourceConfigCommonSCell_r10 *physicalConfigCommonSCell_r10 = sCellToAddMod_r10->radioResourceConfigCommonSCell_r10;
|
||||
PhysCellId_t physCellId_r10 = sCellToAddMod_r10->cellIdentification_r10->physCellId_r10;
|
||||
//PhysCellId_t physCellId_r10 = sCellToAddMod_r10->cellIdentification_r10->physCellId_r10;
|
||||
ARFCN_ValueEUTRA_t dl_CarrierFreq_r10 = sCellToAddMod_r10->cellIdentification_r10->dl_CarrierFreq_r10;
|
||||
uint32_t carrier_freq_local;
|
||||
|
||||
@@ -733,7 +733,7 @@ void phy_config_dedicated_scell_eNB(uint8_t Mod_id,
|
||||
}
|
||||
|
||||
if (physicalConfigDedicatedSCell_r10) {
|
||||
#warning " phy_vars_eNB->physicalConfigDedicatedSCell_r10 does not exist in phy_vars_eNB"
|
||||
//#warning " phy_vars_eNB->physicalConfigDedicatedSCell_r10 does not exist in phy_vars_eNB"
|
||||
// phy_vars_eNB->physicalConfigDedicatedSCell_r10[UE_id] = physicalConfigDedicatedSCell_r10;
|
||||
LOG_I(PHY,"[eNB %d] Frame %d: Configured phyConfigDedicatedSCell with CC_id %d for UE %d\n",Mod_id,/*phy_vars_eNB->frame*/0,CC_id,UE_id);
|
||||
} else {
|
||||
|
||||
@@ -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];
|
||||
|
||||
LOG_D(PHY,"Gain control: rssi %d (%d,%d)\n",
|
||||
rssi,
|
||||
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,
|
||||
|
||||
@@ -755,26 +755,26 @@ int lte_dl_mbsfn_channel_estimation(PHY_VARS_UE *phy_vars_ue,
|
||||
if (phy_vars_ue->lte_ue_common_vars.dl_ch_estimates[eNB_offset][aa]) {
|
||||
switch (phy_vars_ue->lte_frame_parms.N_RB_DL) {
|
||||
case 6:
|
||||
idft128((int16_t*) &phy_vars_ue->lte_ue_common_vars.dl_ch_estimates[eNB_offset][aa][LTE_CE_OFFSET],
|
||||
idft128((int16_t*) &phy_vars_ue->lte_ue_common_vars.dl_ch_estimates[eNB_offset][aa][8],
|
||||
(int16_t*) phy_vars_ue->lte_ue_common_vars.dl_ch_estimates_time[eNB_offset][aa],
|
||||
1);
|
||||
break;
|
||||
case 25:
|
||||
idft512((int16_t*) &phy_vars_ue->lte_ue_common_vars.dl_ch_estimates[eNB_offset][aa][LTE_CE_OFFSET],
|
||||
idft512((int16_t*) &phy_vars_ue->lte_ue_common_vars.dl_ch_estimates[eNB_offset][aa][8],
|
||||
(int16_t*) phy_vars_ue->lte_ue_common_vars.dl_ch_estimates_time[eNB_offset][aa],
|
||||
1);
|
||||
break;
|
||||
case 50:
|
||||
idft1024((int16_t*) &phy_vars_ue->lte_ue_common_vars.dl_ch_estimates[eNB_offset][aa][LTE_CE_OFFSET],
|
||||
idft1024((int16_t*) &phy_vars_ue->lte_ue_common_vars.dl_ch_estimates[eNB_offset][aa][8],
|
||||
(int16_t*) phy_vars_ue->lte_ue_common_vars.dl_ch_estimates_time[eNB_offset][aa],
|
||||
1);
|
||||
break;
|
||||
case 75:
|
||||
idft1536((int16_t*) &phy_vars_ue->lte_ue_common_vars.dl_ch_estimates[eNB_offset][aa][LTE_CE_OFFSET],
|
||||
idft1536((int16_t*) &phy_vars_ue->lte_ue_common_vars.dl_ch_estimates[eNB_offset][aa][8],
|
||||
(int16_t*) phy_vars_ue->lte_ue_common_vars.dl_ch_estimates_time[eNB_offset][aa]);
|
||||
break;
|
||||
case 100:
|
||||
idft2048((int16_t*) &phy_vars_ue->lte_ue_common_vars.dl_ch_estimates[eNB_offset][aa][LTE_CE_OFFSET],
|
||||
idft2048((int16_t*) &phy_vars_ue->lte_ue_common_vars.dl_ch_estimates[eNB_offset][aa][8],
|
||||
(int16_t*) phy_vars_ue->lte_ue_common_vars.dl_ch_estimates_time[eNB_offset][aa],
|
||||
1);
|
||||
break;
|
||||
|
||||
@@ -48,15 +48,15 @@ void lte_eNB_I0_measurements(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;
|
||||
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 *rb_mask = phy_vars_eNB->rb_mask_ul;
|
||||
|
||||
uint32_t aarx,rx_power_correction;
|
||||
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;
|
||||
//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)
|
||||
|
||||
|
||||
@@ -483,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);
|
||||
|
||||
@@ -572,7 +572,7 @@ void lte_ue_measurements(PHY_VARS_UE *phy_vars_ue,
|
||||
// skip the first 4 RE due to interpolation filter length of 5 (not possible to skip 5 due to 128i alignment, must be multiple of 128bit)
|
||||
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
__m128i pmi128_re,pmi128_im,mmtmpPMI0,mmtmpPMI1,mmtmpPMI2,mmtmpPMI3;
|
||||
__m128i pmi128_re,pmi128_im,mmtmpPMI0,mmtmpPMI1 /* ,mmtmpPMI2,mmtmpPMI3 */ ;
|
||||
|
||||
dl_ch0_128 = (__m128i *)&phy_vars_ue->lte_ue_common_vars.dl_ch_estimates[eNB_id][aarx][4];
|
||||
dl_ch1_128 = (__m128i *)&phy_vars_ue->lte_ue_common_vars.dl_ch_estimates[eNB_id][2+aarx][4];
|
||||
|
||||
@@ -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};
|
||||
|
||||
@@ -44,6 +44,7 @@
|
||||
#include "PHY/CODING/extern.h"
|
||||
#include "PHY/CODING/lte_interleaver_inline.h"
|
||||
#include "PHY/LTE_TRANSPORT/defs.h"
|
||||
#include "SCHED/defs.h"
|
||||
#include "defs.h"
|
||||
#include "UTIL/LOG/vcd_signal_dumper.h"
|
||||
|
||||
|
||||
@@ -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,32 +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
|
||||
#ifndef OAI_BLADERF
|
||||
phy_adjust_gain(phy_vars_ue,0);
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// SSS detection
|
||||
|
||||
// PSS is hypothesized in last symbol of first slot in Frame
|
||||
@@ -530,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;
|
||||
@@ -569,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,
|
||||
@@ -597,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) || defined(OAI_BLADERF)
|
||||
#if defined(OAI_USRP) || defined(EXMIMO) || defined(OAI_BLADERF) || defined(OAI_LMSSDR)
|
||||
#include "common_lib.h"
|
||||
extern openair0_config_t openair0_cfg[];
|
||||
#endif
|
||||
@@ -97,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
|
||||
#if defined(OAI_USRP) || defined(OAI_BLADERF)
|
||||
#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) || defined(OAI_BLADERF)
|
||||
#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+
|
||||
@@ -582,9 +582,7 @@ int dump_eNB_stats(PHY_VARS_eNB *phy_vars_eNB, char* buffer, int length)
|
||||
len += sprintf(&buffer[len],"%4d ",
|
||||
phy_vars_eNB->PHY_measurements_eNB[eNB].n0_subband_power_tot_dBm[i]);
|
||||
if ((i>0) && ((i%25) == 0))
|
||||
len += sprintf(&buffer[len],"\n ",
|
||||
phy_vars_eNB->PHY_measurements_eNB[eNB].n0_subband_power_tot_dBm[i]);
|
||||
|
||||
len += sprintf(&buffer[len],"\n");
|
||||
}
|
||||
len += sprintf(&buffer[len],"\n");
|
||||
len += sprintf(&buffer[len],"\n[eNB PROC] PERFORMANCE PARAMETERS\n");
|
||||
@@ -644,7 +642,6 @@ int dump_eNB_stats(PHY_VARS_eNB *phy_vars_eNB, char* buffer, int length)
|
||||
dB_fixed(phy_vars_eNB->eNB_UE_stats[UE_id].Po_PUCCH/phy_vars_eNB->lte_frame_parms.N_RB_UL)-phy_vars_eNB->rx_total_gain_eNB_dB,
|
||||
phy_vars_eNB->lte_frame_parms.ul_power_control_config_common.p0_NominalPUCCH,
|
||||
dB_fixed(phy_vars_eNB->eNB_UE_stats[UE_id].Po_PUCCH1_below/phy_vars_eNB->lte_frame_parms.N_RB_UL)-phy_vars_eNB->rx_total_gain_eNB_dB,
|
||||
dB_fixed(phy_vars_eNB->eNB_UE_stats[UE_id].Po_PUCCH1_above/phy_vars_eNB->lte_frame_parms.N_RB_UL)-phy_vars_eNB->rx_total_gain_eNB_dB,
|
||||
PUCCH1_THRES+phy_vars_eNB->PHY_measurements_eNB[0].n0_power_tot_dBm-dB_fixed(phy_vars_eNB->lte_frame_parms.N_RB_UL),
|
||||
phy_vars_eNB->eNB_UE_stats[UE_id].sector);
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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)" );
|
||||
@@ -396,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)" );
|
||||
@@ -719,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
|
||||
|
||||
@@ -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
|
||||
|
||||
+12
-4
@@ -65,10 +65,12 @@
|
||||
//use msg in the real-time thread context
|
||||
#define msg_nrt printf
|
||||
//use msg_nrt in the non real-time context (for initialization, ...)
|
||||
#ifdef __AVX2__
|
||||
#define malloc16(x) memalign(32,x)
|
||||
#else
|
||||
#define malloc16(x) memalign(16,x)
|
||||
#ifndef malloc16
|
||||
# ifdef __AVX2__
|
||||
# define malloc16(x) memalign(32,x)
|
||||
# else
|
||||
# define malloc16(x) memalign(16,x)
|
||||
# endif
|
||||
#endif
|
||||
#define free16(y,x) free(y)
|
||||
#define bigmalloc malloc
|
||||
@@ -278,6 +280,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
|
||||
@@ -579,6 +584,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;
|
||||
|
||||
|
||||
@@ -0,0 +1,756 @@
|
||||
/*******************************************************************************
|
||||
OpenAirInterface
|
||||
Copyright(c) 1999 - 2014 Eurecom
|
||||
|
||||
OpenAirInterface is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
|
||||
OpenAirInterface is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenAirInterface.The full GNU General Public License is
|
||||
included in this distribution in the file called "COPYING". If not,
|
||||
see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Contact Information
|
||||
OpenAirInterface Admin: openair_admin@eurecom.fr
|
||||
OpenAirInterface Tech : openair_tech@eurecom.fr
|
||||
OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr
|
||||
|
||||
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
|
||||
|
||||
*******************************************************************************/
|
||||
|
||||
/*! \file phy_mac_stub.c
|
||||
* \brief stimulates the phy without mac
|
||||
* \author R. Knopp, F. Kaltenberger, N. Nikaein
|
||||
* \date 2011
|
||||
* \version 0.1
|
||||
* \company Eurecom
|
||||
* \email: knopp@eurecom.fr,florian.kaltenberger@eurecom.fr,navid.nikaein@eurecom.fr
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
|
||||
#include "PHY/defs.h"
|
||||
#include "PHY/extern.h"
|
||||
#include "MAC_INTERFACE/defs.h"
|
||||
#include "MAC_INTERFACE/extern.h"
|
||||
#include "SCHED/defs.h"
|
||||
#include "SCHED/extern.h"
|
||||
#include "LAYER2/MAC/extern.h"
|
||||
|
||||
#ifdef EMOS
|
||||
#include "SCHED/phy_procedures_emos.h"
|
||||
#endif
|
||||
|
||||
void fill_dci(DCI_PDU *DCI_pdu, uint8_t sched_subframe, PHY_VARS_eNB *phy_vars_eNB)
|
||||
{
|
||||
|
||||
int i;
|
||||
//uint8_t cooperation_flag = phy_vars_eNB->cooperation_flag;
|
||||
uint8_t transmission_mode = phy_vars_eNB->transmission_mode[0];
|
||||
|
||||
uint32_t rballoc = 0x7FFF;
|
||||
//uint32_t rballoc2 = 0x000F;
|
||||
int subframe = phy_vars_eNB->proc[sched_subframe].subframe_tx;
|
||||
|
||||
LTE_eNB_DLSCH_t *DLSCH_ptr = phy_vars_eNB->dlsch_eNB[0][0];
|
||||
|
||||
/*
|
||||
uint32_t rand = taus();
|
||||
if ((subframe==8) || (subframe==9) || (subframe==0))
|
||||
rand = (rand%5)+5;
|
||||
else
|
||||
rand = (rand%4)+5;
|
||||
*/
|
||||
uint32_t bcch_pdu;
|
||||
uint64_t dlsch_pdu;
|
||||
|
||||
DCI_pdu->Num_common_dci = 0;
|
||||
DCI_pdu->Num_ue_spec_dci=0;
|
||||
|
||||
switch (subframe) {
|
||||
case 5:
|
||||
DCI_pdu->Num_common_dci = 1;
|
||||
DCI_pdu->dci_alloc[0].L = 2;
|
||||
DCI_pdu->dci_alloc[0].rnti = SI_RNTI;
|
||||
DCI_pdu->dci_alloc[0].format = format1A;
|
||||
DCI_pdu->dci_alloc[0].ra_flag = 0;
|
||||
|
||||
switch (phy_vars_eNB->lte_frame_parms.N_RB_DL) {
|
||||
case 6:
|
||||
if (phy_vars_eNB->lte_frame_parms.frame_type == FDD) {
|
||||
DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI1A_1_5MHz_FDD_t;
|
||||
((DCI1A_1_5MHz_FDD_t*)&bcch_pdu)->type = 1;
|
||||
((DCI1A_1_5MHz_FDD_t*)&bcch_pdu)->vrb_type = 0;
|
||||
((DCI1A_1_5MHz_FDD_t*)&bcch_pdu)->rballoc = computeRIV(25,10,3);
|
||||
((DCI1A_1_5MHz_FDD_t*)&bcch_pdu)->ndi = phy_vars_eNB->proc[sched_subframe].frame_tx&1;
|
||||
((DCI1A_1_5MHz_FDD_t*)&bcch_pdu)->rv = 1;
|
||||
((DCI1A_1_5MHz_FDD_t*)&bcch_pdu)->mcs = 1;
|
||||
((DCI1A_1_5MHz_FDD_t*)&bcch_pdu)->harq_pid = 0;
|
||||
((DCI1A_1_5MHz_FDD_t*)&bcch_pdu)->TPC = 1; // set to 3 PRB
|
||||
memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],&bcch_pdu,sizeof(DCI1A_1_5MHz_TDD_1_6_t));
|
||||
} else {
|
||||
DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI1A_1_5MHz_TDD_1_6_t;
|
||||
((DCI1A_1_5MHz_TDD_1_6_t*)&bcch_pdu)->type = 1;
|
||||
((DCI1A_1_5MHz_TDD_1_6_t*)&bcch_pdu)->vrb_type = 0;
|
||||
((DCI1A_1_5MHz_TDD_1_6_t*)&bcch_pdu)->rballoc = computeRIV(25,10,3);
|
||||
((DCI1A_1_5MHz_TDD_1_6_t*)&bcch_pdu)->ndi = phy_vars_eNB->proc[sched_subframe].frame_tx&1;
|
||||
((DCI1A_1_5MHz_TDD_1_6_t*)&bcch_pdu)->rv = 1;
|
||||
((DCI1A_1_5MHz_TDD_1_6_t*)&bcch_pdu)->mcs = 1;
|
||||
((DCI1A_1_5MHz_TDD_1_6_t*)&bcch_pdu)->harq_pid = 0;
|
||||
((DCI1A_1_5MHz_TDD_1_6_t*)&bcch_pdu)->TPC = 1; // set to 3 PRB
|
||||
memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],&bcch_pdu,sizeof(DCI1A_1_5MHz_TDD_1_6_t));
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 25:
|
||||
default:
|
||||
if (phy_vars_eNB->lte_frame_parms.frame_type == FDD) {
|
||||
DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI1A_5MHz_FDD_t;
|
||||
((DCI1A_5MHz_FDD_t*)&bcch_pdu)->type = 1;
|
||||
((DCI1A_5MHz_FDD_t*)&bcch_pdu)->vrb_type = 0;
|
||||
((DCI1A_5MHz_FDD_t*)&bcch_pdu)->rballoc = computeRIV(25,10,3);
|
||||
((DCI1A_5MHz_FDD_t*)&bcch_pdu)->ndi = phy_vars_eNB->proc[sched_subframe].frame_tx&1;
|
||||
((DCI1A_5MHz_FDD_t*)&bcch_pdu)->rv = 1;
|
||||
((DCI1A_5MHz_FDD_t*)&bcch_pdu)->mcs = 1;
|
||||
((DCI1A_5MHz_FDD_t*)&bcch_pdu)->harq_pid = 0;
|
||||
((DCI1A_5MHz_FDD_t*)&bcch_pdu)->TPC = 1; // set to 3 PRB
|
||||
memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],&bcch_pdu,sizeof(DCI1A_5MHz_TDD_1_6_t));
|
||||
} else {
|
||||
DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI1A_5MHz_TDD_1_6_t;
|
||||
((DCI1A_5MHz_TDD_1_6_t*)&bcch_pdu)->type = 1;
|
||||
((DCI1A_5MHz_TDD_1_6_t*)&bcch_pdu)->vrb_type = 0;
|
||||
((DCI1A_5MHz_TDD_1_6_t*)&bcch_pdu)->rballoc = computeRIV(25,10,3);
|
||||
((DCI1A_5MHz_TDD_1_6_t*)&bcch_pdu)->ndi = phy_vars_eNB->proc[sched_subframe].frame_tx&1;
|
||||
((DCI1A_5MHz_TDD_1_6_t*)&bcch_pdu)->rv = 1;
|
||||
((DCI1A_5MHz_TDD_1_6_t*)&bcch_pdu)->mcs = 1;
|
||||
((DCI1A_5MHz_TDD_1_6_t*)&bcch_pdu)->harq_pid = 0;
|
||||
((DCI1A_5MHz_TDD_1_6_t*)&bcch_pdu)->TPC = 1; // set to 3 PRB
|
||||
memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],&bcch_pdu,sizeof(DCI1A_5MHz_TDD_1_6_t));
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 50:
|
||||
if (phy_vars_eNB->lte_frame_parms.frame_type == FDD) {
|
||||
DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI1A_10MHz_FDD_t;
|
||||
((DCI1A_10MHz_FDD_t*)&bcch_pdu)->type = 1;
|
||||
((DCI1A_10MHz_FDD_t*)&bcch_pdu)->vrb_type = 0;
|
||||
((DCI1A_10MHz_FDD_t*)&bcch_pdu)->rballoc = computeRIV(25,10,3);
|
||||
((DCI1A_10MHz_FDD_t*)&bcch_pdu)->ndi = phy_vars_eNB->proc[sched_subframe].frame_tx&1;
|
||||
((DCI1A_10MHz_FDD_t*)&bcch_pdu)->rv = 1;
|
||||
((DCI1A_10MHz_FDD_t*)&bcch_pdu)->mcs = 1;
|
||||
((DCI1A_10MHz_FDD_t*)&bcch_pdu)->harq_pid = 0;
|
||||
((DCI1A_10MHz_FDD_t*)&bcch_pdu)->TPC = 1; // set to 3 PRB
|
||||
memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],&bcch_pdu,sizeof(DCI1A_10MHz_TDD_1_6_t));
|
||||
} else {
|
||||
DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI1A_10MHz_TDD_1_6_t;
|
||||
((DCI1A_10MHz_TDD_1_6_t*)&bcch_pdu)->type = 1;
|
||||
((DCI1A_10MHz_TDD_1_6_t*)&bcch_pdu)->vrb_type = 0;
|
||||
((DCI1A_10MHz_TDD_1_6_t*)&bcch_pdu)->rballoc = computeRIV(25,10,3);
|
||||
((DCI1A_10MHz_TDD_1_6_t*)&bcch_pdu)->ndi = phy_vars_eNB->proc[sched_subframe].frame_tx&1;
|
||||
((DCI1A_10MHz_TDD_1_6_t*)&bcch_pdu)->rv = 1;
|
||||
((DCI1A_10MHz_TDD_1_6_t*)&bcch_pdu)->mcs = 1;
|
||||
((DCI1A_10MHz_TDD_1_6_t*)&bcch_pdu)->harq_pid = DLSCH_ptr->harq_pid_freelist[DLSCH_ptr->head_freelist];
|
||||
((DCI1A_10MHz_TDD_1_6_t*)&bcch_pdu)->TPC = 1; // set to 3 PRB
|
||||
memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],&bcch_pdu,sizeof(DCI1A_10MHz_TDD_1_6_t));
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 100:
|
||||
if (phy_vars_eNB->lte_frame_parms.frame_type == FDD) {
|
||||
DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI1A_20MHz_FDD_t;
|
||||
((DCI1A_20MHz_FDD_t*)&bcch_pdu)->type = 1;
|
||||
((DCI1A_20MHz_FDD_t*)&bcch_pdu)->vrb_type = 0;
|
||||
((DCI1A_20MHz_FDD_t*)&bcch_pdu)->rballoc = computeRIV(25,10,3);
|
||||
((DCI1A_20MHz_FDD_t*)&bcch_pdu)->ndi = phy_vars_eNB->proc[sched_subframe].frame_tx&1;
|
||||
((DCI1A_20MHz_FDD_t*)&bcch_pdu)->rv = 1;
|
||||
((DCI1A_20MHz_FDD_t*)&bcch_pdu)->mcs = 1;
|
||||
((DCI1A_20MHz_FDD_t*)&bcch_pdu)->harq_pid = 0;
|
||||
((DCI1A_20MHz_FDD_t*)&bcch_pdu)->TPC = 1; // set to 3 PRB
|
||||
memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],&bcch_pdu,sizeof(DCI1A_20MHz_TDD_1_6_t));
|
||||
} else {
|
||||
DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI1A_20MHz_TDD_1_6_t;
|
||||
((DCI1A_20MHz_TDD_1_6_t*)&bcch_pdu)->type = 1;
|
||||
((DCI1A_20MHz_TDD_1_6_t*)&bcch_pdu)->vrb_type = 0;
|
||||
((DCI1A_20MHz_TDD_1_6_t*)&bcch_pdu)->rballoc = computeRIV(25,10,3);
|
||||
((DCI1A_20MHz_TDD_1_6_t*)&bcch_pdu)->ndi = phy_vars_eNB->proc[sched_subframe].frame_tx&1;
|
||||
((DCI1A_20MHz_TDD_1_6_t*)&bcch_pdu)->rv = 1;
|
||||
((DCI1A_20MHz_TDD_1_6_t*)&bcch_pdu)->mcs = 1;
|
||||
((DCI1A_20MHz_TDD_1_6_t*)&bcch_pdu)->harq_pid = 0;
|
||||
((DCI1A_20MHz_TDD_1_6_t*)&bcch_pdu)->TPC = 1; // set to 3 PRB
|
||||
memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],&bcch_pdu,sizeof(DCI1A_20MHz_TDD_1_6_t));
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
break; //subframe switch
|
||||
|
||||
/*
|
||||
case 6:
|
||||
DCI_pdu->Num_ue_spec_dci = 1;
|
||||
DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI2_5MHz_2A_M10PRB_TDD_t;
|
||||
DCI_pdu->dci_alloc[0].L = 2;
|
||||
DCI_pdu->dci_alloc[0].rnti = 0x1236;
|
||||
DCI_pdu->dci_alloc[0].format = format2_2A_M10PRB;
|
||||
DCI_pdu->dci_alloc[0].ra_flag = 0;
|
||||
|
||||
DLSCH_alloc_pdu1.rballoc = 0x00ff;
|
||||
DLSCH_alloc_pdu1.TPC = 0;
|
||||
DLSCH_alloc_pdu1.dai = 0;
|
||||
DLSCH_alloc_pdu1.harq_pid = 0;
|
||||
DLSCH_alloc_pdu1.tb_swap = 0;
|
||||
DLSCH_alloc_pdu1.mcs1 = 0;
|
||||
DLSCH_alloc_pdu1.ndi1 = 1;
|
||||
DLSCH_alloc_pdu1.rv1 = 0;
|
||||
DLSCH_alloc_pdu1.tpmi = 0;
|
||||
memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],(void *)&DLSCH_alloc_pdu1,sizeof(DCI2_5MHz_2A_M10PRB_TDD_t));
|
||||
break;
|
||||
*/
|
||||
|
||||
default:
|
||||
case 7:
|
||||
DCI_pdu->Num_ue_spec_dci = 1;
|
||||
DCI_pdu->dci_alloc[0].L = 2;
|
||||
DCI_pdu->dci_alloc[0].rnti = 0x1235;
|
||||
DCI_pdu->dci_alloc[0].format = format1;
|
||||
DCI_pdu->dci_alloc[0].ra_flag = 0;
|
||||
|
||||
if (transmission_mode<3) {
|
||||
//user 1
|
||||
switch (phy_vars_eNB->lte_frame_parms.N_RB_DL) {
|
||||
case 25:
|
||||
if (phy_vars_eNB->lte_frame_parms.frame_type == FDD) {
|
||||
DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI1_5MHz_FDD_t;
|
||||
|
||||
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->rballoc = rballoc;
|
||||
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->TPC = 0;
|
||||
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->harq_pid = DLSCH_ptr->harq_pid_freelist[DLSCH_ptr->head_freelist];
|
||||
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->mcs = openair_daq_vars.target_ue_dl_mcs;
|
||||
//((DCI1_5MHz_FDD_t *)&dlsch_pdu)->mcs = (unsigned char) ((phy_vars_eNB->frame%1024)%28);
|
||||
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->ndi = phy_vars_eNB->proc[sched_subframe].frame_tx&1;
|
||||
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->rv = 0;
|
||||
memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],(void *)&dlsch_pdu,sizeof(DCI1_5MHz_TDD_t));
|
||||
|
||||
/*
|
||||
//user2
|
||||
DCI_pdu->dci_alloc[1].dci_length = sizeof_DCI1_5MHz_TDD_t;
|
||||
DCI_pdu->dci_alloc[1].L = 2;
|
||||
DCI_pdu->dci_alloc[1].rnti = 0x1236;
|
||||
DCI_pdu->dci_alloc[1].format = format1;
|
||||
DCI_pdu->dci_alloc[1].ra_flag = 0;
|
||||
|
||||
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->rballoc = rballoc2;
|
||||
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->TPC = 0;
|
||||
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->dai = 0;
|
||||
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->harq_pid = 1;
|
||||
//((DCI1_5MHz_FDD_t *)&dlsch_pdu)->mcs = (unsigned char) ((phy_vars_eNB->proc[subframe].frame%1024)%28);
|
||||
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->mcs = openair_daq_vars.target_ue_dl_mcs;
|
||||
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->ndi = 1;
|
||||
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->rv = 0;
|
||||
memcpy((void*)&DCI_pdu->dci_alloc[1].dci_pdu[0],(void *)&((DCI1_5MHz_FDD_t *)&dlsch_pdu)->,sizeof(DCI1_5MHz_TDD_t));
|
||||
*/
|
||||
} else {
|
||||
DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI1_5MHz_TDD_t;
|
||||
|
||||
((DCI1_5MHz_TDD_t *)&dlsch_pdu)->rballoc = rballoc;
|
||||
((DCI1_5MHz_TDD_t *)&dlsch_pdu)->TPC = 0;
|
||||
((DCI1_5MHz_TDD_t *)&dlsch_pdu)->dai = 0;
|
||||
((DCI1_5MHz_TDD_t *)&dlsch_pdu)->harq_pid = DLSCH_ptr->harq_pid_freelist[DLSCH_ptr->head_freelist];
|
||||
((DCI1_5MHz_TDD_t *)&dlsch_pdu)->mcs = openair_daq_vars.target_ue_dl_mcs;
|
||||
//((DCI1_5MHz_TDD_t *)&dlsch_pdu)->mcs = (unsigned char) ((phy_vars_eNB->frame%1024)%28);
|
||||
((DCI1_5MHz_TDD_t *)&dlsch_pdu)->ndi = phy_vars_eNB->proc[sched_subframe].frame_tx&1;
|
||||
((DCI1_5MHz_TDD_t *)&dlsch_pdu)->rv = 0;
|
||||
memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],(void *)&dlsch_pdu,sizeof(DCI1_5MHz_TDD_t));
|
||||
|
||||
/*
|
||||
//user2
|
||||
DCI_pdu->dci_alloc[1].dci_length = sizeof_DCI1_5MHz_TDD_t;
|
||||
DCI_pdu->dci_alloc[1].L = 2;
|
||||
DCI_pdu->dci_alloc[1].rnti = 0x1236;
|
||||
DCI_pdu->dci_alloc[1].format = format1;
|
||||
DCI_pdu->dci_alloc[1].ra_flag = 0;
|
||||
|
||||
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->rballoc = rballoc2;
|
||||
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->TPC = 0;
|
||||
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->dai = 0;
|
||||
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->harq_pid = 1;
|
||||
//((DCI1_5MHz_FDD_t *)&dlsch_pdu)->mcs = (unsigned char) ((phy_vars_eNB->proc[subframe].frame%1024)%28);
|
||||
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->mcs = openair_daq_vars.target_ue_dl_mcs;
|
||||
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->ndi = 1;
|
||||
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->rv = 0;
|
||||
memcpy((void*)&DCI_pdu->dci_alloc[1].dci_pdu[0],(void *)&((DCI1_5MHz_FDD_t *)&dlsch_pdu)->,sizeof(DCI1_5MHz_TDD_t));
|
||||
*/
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 50:
|
||||
|
||||
if (phy_vars_eNB->lte_frame_parms.frame_type == FDD) {
|
||||
DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI1_10MHz_FDD_t;
|
||||
|
||||
((DCI1_10MHz_FDD_t *)&dlsch_pdu)->rballoc = rballoc;
|
||||
((DCI1_10MHz_FDD_t *)&dlsch_pdu)->TPC = 0;
|
||||
((DCI1_10MHz_FDD_t *)&dlsch_pdu)->harq_pid = DLSCH_ptr->harq_pid_freelist[DLSCH_ptr->head_freelist];
|
||||
((DCI1_10MHz_FDD_t *)&dlsch_pdu)->mcs = openair_daq_vars.target_ue_dl_mcs;
|
||||
//((DCI1_10MHz_FDD_t *)&dlsch_pdu)->mcs = (unsigned char) ((phy_vars_eNB->frame%1024)%28);
|
||||
((DCI1_10MHz_FDD_t *)&dlsch_pdu)->ndi = phy_vars_eNB->proc[sched_subframe].frame_tx&1;
|
||||
((DCI1_10MHz_FDD_t *)&dlsch_pdu)->rv = 0;
|
||||
memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],(void *)&dlsch_pdu,sizeof(DCI1_10MHz_TDD_t));
|
||||
|
||||
/*
|
||||
//user2
|
||||
DCI_pdu->dci_alloc[1].dci_length = sizeof_DCI1_10MHz_TDD_t;
|
||||
DCI_pdu->dci_alloc[1].L = 2;
|
||||
DCI_pdu->dci_alloc[1].rnti = 0x1236;
|
||||
DCI_pdu->dci_alloc[1].format = format1;
|
||||
DCI_pdu->dci_alloc[1].ra_flag = 0;
|
||||
|
||||
((DCI1_10MHz_FDD_t *)&dlsch_pdu)->rballoc = rballoc2;
|
||||
((DCI1_10MHz_FDD_t *)&dlsch_pdu)->TPC = 0;
|
||||
((DCI1_10MHz_FDD_t *)&dlsch_pdu)->dai = 0;
|
||||
((DCI1_10MHz_FDD_t *)&dlsch_pdu)->harq_pid = 1;
|
||||
//((DCI1_10MHz_FDD_t *)&dlsch_pdu)->mcs = (unsigned char) ((phy_vars_eNB->proc[subframe].frame%1024)%28);
|
||||
((DCI1_10MHz_FDD_t *)&dlsch_pdu)->mcs = openair_daq_vars.target_ue_dl_mcs;
|
||||
((DCI1_10MHz_FDD_t *)&dlsch_pdu)->ndi = 1;
|
||||
((DCI1_10MHz_FDD_t *)&dlsch_pdu)->rv = 0;
|
||||
memcpy((void*)&DCI_pdu->dci_alloc[1].dci_pdu[0],(void *)&((DCI1_10MHz_FDD_t *)&dlsch_pdu)->,sizeof(DCI1_10MHz_TDD_t));
|
||||
*/
|
||||
} else {
|
||||
DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI1_10MHz_TDD_t;
|
||||
|
||||
((DCI1_10MHz_TDD_t *)&dlsch_pdu)->rballoc = rballoc;
|
||||
((DCI1_10MHz_TDD_t *)&dlsch_pdu)->TPC = 0;
|
||||
((DCI1_10MHz_TDD_t *)&dlsch_pdu)->dai = 0;
|
||||
((DCI1_10MHz_TDD_t *)&dlsch_pdu)->harq_pid = DLSCH_ptr->harq_pid_freelist[DLSCH_ptr->head_freelist];
|
||||
((DCI1_10MHz_TDD_t *)&dlsch_pdu)->mcs = openair_daq_vars.target_ue_dl_mcs;
|
||||
//((DCI1_10MHz_TDD_t *)&dlsch_pdu)->mcs = (unsigned char) ((phy_vars_eNB->frame%1024)%28);
|
||||
((DCI1_10MHz_TDD_t *)&dlsch_pdu)->ndi = phy_vars_eNB->proc[sched_subframe].frame_tx&1;
|
||||
((DCI1_10MHz_TDD_t *)&dlsch_pdu)->rv = 0;
|
||||
memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],(void *)&dlsch_pdu,sizeof(DCI1_10MHz_TDD_t));
|
||||
|
||||
/*
|
||||
//user2
|
||||
DCI_pdu->dci_alloc[1].dci_length = sizeof_DCI1_10MHz_TDD_t;
|
||||
DCI_pdu->dci_alloc[1].L = 2;
|
||||
DCI_pdu->dci_alloc[1].rnti = 0x1236;
|
||||
DCI_pdu->dci_alloc[1].format = format1;
|
||||
DCI_pdu->dci_alloc[1].ra_flag = 0;
|
||||
|
||||
((DCI1_10MHz_FDD_t *)&dlsch_pdu)->rballoc = rballoc2;
|
||||
((DCI1_10MHz_FDD_t *)&dlsch_pdu)->TPC = 0;
|
||||
((DCI1_10MHz_FDD_t *)&dlsch_pdu)->dai = 0;
|
||||
((DCI1_10MHz_FDD_t *)&dlsch_pdu)->harq_pid = 1;
|
||||
//((DCI1_10MHz_FDD_t *)&dlsch_pdu)->mcs = (unsigned char) ((phy_vars_eNB->proc[subframe].frame%1024)%28);
|
||||
((DCI1_10MHz_FDD_t *)&dlsch_pdu)->mcs = openair_daq_vars.target_ue_dl_mcs;
|
||||
((DCI1_10MHz_FDD_t *)&dlsch_pdu)->ndi = 1;
|
||||
((DCI1_10MHz_FDD_t *)&dlsch_pdu)->rv = 0;
|
||||
memcpy((void*)&DCI_pdu->dci_alloc[1].dci_pdu[0],(void *)&((DCI1_10MHz_FDD_t *)&dlsch_pdu)->,sizeof(DCI1_10MHz_TDD_t));
|
||||
*/
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 100:
|
||||
if (phy_vars_eNB->lte_frame_parms.frame_type == FDD) {
|
||||
DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI1_5MHz_FDD_t;
|
||||
|
||||
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->rballoc = rballoc;
|
||||
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->TPC = 0;
|
||||
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->harq_pid = DLSCH_ptr->harq_pid_freelist[DLSCH_ptr->head_freelist];
|
||||
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->mcs = openair_daq_vars.target_ue_dl_mcs;
|
||||
//((DCI1_5MHz_FDD_t *)&dlsch_pdu)->mcs = (unsigned char) ((phy_vars_eNB->frame%1024)%28);
|
||||
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->ndi = phy_vars_eNB->proc[sched_subframe].frame_tx&1;
|
||||
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->rv = 0;
|
||||
memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],(void *)&dlsch_pdu,sizeof(DCI1_5MHz_TDD_t));
|
||||
|
||||
/*
|
||||
//user2
|
||||
DCI_pdu->dci_alloc[1].dci_length = sizeof_DCI1_5MHz_TDD_t;
|
||||
DCI_pdu->dci_alloc[1].L = 2;
|
||||
DCI_pdu->dci_alloc[1].rnti = 0x1236;
|
||||
DCI_pdu->dci_alloc[1].format = format1;
|
||||
DCI_pdu->dci_alloc[1].ra_flag = 0;
|
||||
|
||||
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->rballoc = rballoc2;
|
||||
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->TPC = 0;
|
||||
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->dai = 0;
|
||||
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->harq_pid = 1;
|
||||
//((DCI1_5MHz_FDD_t *)&dlsch_pdu)->mcs = (unsigned char) ((phy_vars_eNB->proc[subframe].frame%1024)%28);
|
||||
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->mcs = openair_daq_vars.target_ue_dl_mcs;
|
||||
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->ndi = 1;
|
||||
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->rv = 0;
|
||||
memcpy((void*)&DCI_pdu->dci_alloc[1].dci_pdu[0],(void *)&((DCI1_5MHz_FDD_t *)&dlsch_pdu)->,sizeof(DCI1_5MHz_TDD_t));
|
||||
*/
|
||||
} else {
|
||||
DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI1_20MHz_TDD_t;
|
||||
|
||||
((DCI1_20MHz_TDD_t *)&dlsch_pdu)->rballoc = rballoc;
|
||||
((DCI1_20MHz_TDD_t *)&dlsch_pdu)->TPC = 0;
|
||||
((DCI1_20MHz_TDD_t *)&dlsch_pdu)->dai = 0;
|
||||
((DCI1_20MHz_TDD_t *)&dlsch_pdu)->harq_pid = DLSCH_ptr->harq_pid_freelist[DLSCH_ptr->head_freelist];
|
||||
((DCI1_20MHz_TDD_t *)&dlsch_pdu)->mcs = openair_daq_vars.target_ue_dl_mcs;
|
||||
//((DCI1_20MHz_TDD_t *)&dlsch_pdu)->mcs = (unsigned char) ((phy_vars_eNB->frame%1024)%28);
|
||||
((DCI1_20MHz_TDD_t *)&dlsch_pdu)->ndi = phy_vars_eNB->proc[sched_subframe].frame_tx&1;
|
||||
((DCI1_20MHz_TDD_t *)&dlsch_pdu)->rv = 0;
|
||||
memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],(void *)&dlsch_pdu,sizeof(DCI1_20MHz_TDD_t));
|
||||
|
||||
/*
|
||||
//user2
|
||||
DCI_pdu->dci_alloc[1].dci_length = sizeof_DCI1_20MHz_TDD_t;
|
||||
DCI_pdu->dci_alloc[1].L = 2;
|
||||
DCI_pdu->dci_alloc[1].rnti = 0x1236;
|
||||
DCI_pdu->dci_alloc[1].format = format1;
|
||||
DCI_pdu->dci_alloc[1].ra_flag = 0;
|
||||
|
||||
((DCI1_20MHz_FDD_t *)&dlsch_pdu)->rballoc = rballoc2;
|
||||
((DCI1_20MHz_FDD_t *)&dlsch_pdu)->TPC = 0;
|
||||
((DCI1_20MHz_FDD_t *)&dlsch_pdu)->dai = 0;
|
||||
((DCI1_20MHz_FDD_t *)&dlsch_pdu)->harq_pid = 1;
|
||||
//((DCI1_20MHz_FDD_t *)&dlsch_pdu)->mcs = (unsigned char) ((phy_vars_eNB->proc[subframe].frame%1024)%28);
|
||||
((DCI1_20MHz_FDD_t *)&dlsch_pdu)->mcs = openair_daq_vars.target_ue_dl_mcs;
|
||||
((DCI1_20MHz_FDD_t *)&dlsch_pdu)->ndi = 1;
|
||||
((DCI1_20MHz_FDD_t *)&dlsch_pdu)->rv = 0;
|
||||
memcpy((void*)&DCI_pdu->dci_alloc[1].dci_pdu[0],(void *)&((DCI1_20MHz_FDD_t *)&dlsch_pdu)->,sizeof(DCI1_5MHz_TDD_t));
|
||||
*/
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
} else if (transmission_mode==4) {
|
||||
DCI_pdu->Num_ue_spec_dci = 1;
|
||||
// user 1
|
||||
DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI2_5MHz_2A_FDD_t;
|
||||
DCI_pdu->dci_alloc[0].L = 3;
|
||||
DCI_pdu->dci_alloc[0].rnti = 0x1235;
|
||||
DCI_pdu->dci_alloc[0].format = format2;
|
||||
DCI_pdu->dci_alloc[0].ra_flag = 0;
|
||||
|
||||
((DCI2_5MHz_2A_FDD_t*) (&DCI_pdu->dci_alloc[0].dci_pdu))->tpmi = 0;
|
||||
((DCI2_5MHz_2A_FDD_t*) (&DCI_pdu->dci_alloc[0].dci_pdu))->rv1 = 0;
|
||||
((DCI2_5MHz_2A_FDD_t*) (&DCI_pdu->dci_alloc[0].dci_pdu))->ndi1 = phy_vars_eNB->proc[sched_subframe].frame_tx&1;
|
||||
((DCI2_5MHz_2A_FDD_t*) (&DCI_pdu->dci_alloc[0].dci_pdu))->mcs1 = openair_daq_vars.target_ue_dl_mcs;
|
||||
((DCI2_5MHz_2A_FDD_t*) (&DCI_pdu->dci_alloc[0].dci_pdu))->rv2 = 0;
|
||||
((DCI2_5MHz_2A_FDD_t*) (&DCI_pdu->dci_alloc[0].dci_pdu))->ndi2 = phy_vars_eNB->proc[sched_subframe].frame_tx&1;
|
||||
((DCI2_5MHz_2A_FDD_t*) (&DCI_pdu->dci_alloc[0].dci_pdu))->mcs2 = openair_daq_vars.target_ue_dl_mcs;
|
||||
((DCI2_5MHz_2A_FDD_t*) (&DCI_pdu->dci_alloc[0].dci_pdu))->tb_swap = 0;
|
||||
((DCI2_5MHz_2A_FDD_t*) (&DCI_pdu->dci_alloc[0].dci_pdu))->harq_pid = DLSCH_ptr->harq_pid_freelist[DLSCH_ptr->head_freelist];
|
||||
((DCI2_5MHz_2A_FDD_t*) (&DCI_pdu->dci_alloc[0].dci_pdu))->TPC = 0;
|
||||
((DCI2_5MHz_2A_FDD_t*) (&DCI_pdu->dci_alloc[0].dci_pdu))->rballoc = openair_daq_vars.ue_dl_rb_alloc;
|
||||
((DCI2_5MHz_2A_FDD_t*) (&DCI_pdu->dci_alloc[0].dci_pdu))->rah = 0;
|
||||
|
||||
} else if (transmission_mode==5) {
|
||||
DCI_pdu->Num_ue_spec_dci = 2;
|
||||
// user 1
|
||||
DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI1E_5MHz_2A_M10PRB_TDD_t;
|
||||
DCI_pdu->dci_alloc[0].L = 3;
|
||||
DCI_pdu->dci_alloc[0].rnti = 0x1235;
|
||||
DCI_pdu->dci_alloc[0].format = format1E_2A_M10PRB;
|
||||
DCI_pdu->dci_alloc[0].ra_flag = 0;
|
||||
|
||||
DLSCH_alloc_pdu1E.tpmi = 5; //5=use feedback
|
||||
DLSCH_alloc_pdu1E.rv = 0;
|
||||
DLSCH_alloc_pdu1E.ndi = phy_vars_eNB->proc[sched_subframe].frame_tx&1;
|
||||
//DLSCH_alloc_pdu1E.mcs = cqi_to_mcs[phy_vars_eNB->eNB_UE_stats->DL_cqi[0]];
|
||||
//DLSCH_alloc_pdu1E.mcs = (unsigned char) (taus()%28);
|
||||
DLSCH_alloc_pdu1E.mcs = openair_daq_vars.target_ue_dl_mcs;
|
||||
//DLSCH_alloc_pdu1E.mcs = (unsigned char) ((phy_vars_eNB->proc[subframe].frame%1024)%28);
|
||||
phy_vars_eNB->eNB_UE_stats[0].dlsch_mcs1 = DLSCH_alloc_pdu1E.mcs;
|
||||
DLSCH_alloc_pdu1E.harq_pid = DLSCH_ptr->harq_pid_freelist[DLSCH_ptr->head_freelist];
|
||||
DLSCH_alloc_pdu1E.dai = 0;
|
||||
DLSCH_alloc_pdu1E.TPC = 0;
|
||||
DLSCH_alloc_pdu1E.rballoc = openair_daq_vars.ue_dl_rb_alloc;
|
||||
DLSCH_alloc_pdu1E.rah = 0;
|
||||
DLSCH_alloc_pdu1E.dl_power_off = 0; //0=second user present
|
||||
memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],(void *)&DLSCH_alloc_pdu1E,sizeof(DCI1E_5MHz_2A_M10PRB_TDD_t));
|
||||
|
||||
//user 2
|
||||
DCI_pdu->dci_alloc[1].dci_length = sizeof_DCI1E_5MHz_2A_M10PRB_TDD_t;
|
||||
DCI_pdu->dci_alloc[1].L = 0;
|
||||
DCI_pdu->dci_alloc[1].rnti = 0x1236;
|
||||
DCI_pdu->dci_alloc[1].format = format1E_2A_M10PRB;
|
||||
DCI_pdu->dci_alloc[1].ra_flag = 0;
|
||||
//DLSCH_alloc_pdu1E.mcs = openair_daq_vars.target_ue_dl_mcs;
|
||||
//DLSCH_alloc_pdu1E.mcs = (unsigned char) (taus()%28);
|
||||
//DLSCH_alloc_pdu1E.mcs = (unsigned char) ((phy_vars_eNB->frame%1024)%28);
|
||||
DLSCH_alloc_pdu1E.mcs = (unsigned char) (((phy_vars_eNB->proc[sched_subframe].frame_tx%1024)/3)%28);
|
||||
phy_vars_eNB->eNB_UE_stats[1].dlsch_mcs1 = DLSCH_alloc_pdu1E.mcs;
|
||||
|
||||
memcpy((void*)&DCI_pdu->dci_alloc[1].dci_pdu[0],(void *)&DLSCH_alloc_pdu1E,sizeof(DCI1E_5MHz_2A_M10PRB_TDD_t));
|
||||
|
||||
// set the precoder of the second UE orthogonal to the first
|
||||
phy_vars_eNB->eNB_UE_stats[1].DL_pmi_single = (phy_vars_eNB->eNB_UE_stats[0].DL_pmi_single ^ 0x1555);
|
||||
}
|
||||
|
||||
break; //subframe switch
|
||||
|
||||
/*
|
||||
case 8:
|
||||
DCI_pdu->Num_common_dci = 1;
|
||||
DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI1A_5MHz_TDD_1_6_t;
|
||||
DCI_pdu->dci_alloc[0].L = 2;
|
||||
DCI_pdu->dci_alloc[0].rnti = 0xbeef;
|
||||
DCI_pdu->dci_alloc[0].format = format1A;
|
||||
DCI_pdu->dci_alloc[0].ra_flag = 1;
|
||||
|
||||
RA_alloc_pdu.type = 1;
|
||||
RA_alloc_pdu.vrb_type = 0;
|
||||
RA_alloc_pdu.rballoc = computeRIV(25,12,3);
|
||||
RA_alloc_pdu.ndi = 1;
|
||||
RA_alloc_pdu.rv = 1;
|
||||
RA_alloc_pdu.mcs = 4;
|
||||
RA_alloc_pdu.harq_pid = 0;
|
||||
RA_alloc_pdu.TPC = 1;
|
||||
|
||||
memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],&RA_alloc_pdu,sizeof(DCI1A_5MHz_TDD_1_6_t));
|
||||
break;
|
||||
*/
|
||||
/*
|
||||
case 9:
|
||||
DCI_pdu->Num_ue_spec_dci = 1;
|
||||
|
||||
//user 1
|
||||
if (phy_vars_eNB->lte_frame_parms.frame_type == FDD)
|
||||
DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI0_5MHz_FDD_t ;
|
||||
else
|
||||
DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI0_5MHz_TDD_1_6_t ;
|
||||
|
||||
DCI_pdu->dci_alloc[0].L = 2;
|
||||
DCI_pdu->dci_alloc[0].rnti = 0x1235;
|
||||
DCI_pdu->dci_alloc[0].format = format0;
|
||||
DCI_pdu->dci_alloc[0].ra_flag = 0;
|
||||
|
||||
UL_alloc_pdu.type = 0;
|
||||
UL_alloc_pdu.hopping = 0;
|
||||
UL_alloc_pdu.rballoc = computeRIV(25,2,openair_daq_vars.ue_ul_nb_rb);
|
||||
UL_alloc_pdu.mcs = openair_daq_vars.target_ue_ul_mcs;
|
||||
UL_alloc_pdu.ndi = phy_vars_eNB->proc[sched_subframe].frame_tx&1;
|
||||
UL_alloc_pdu.TPC = 0;
|
||||
UL_alloc_pdu.cshift = 0;
|
||||
UL_alloc_pdu.dai = 0;
|
||||
UL_alloc_pdu.cqi_req = 1;
|
||||
memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],(void *)&UL_alloc_pdu,sizeof(DCI0_5MHz_TDD_1_6_t));
|
||||
*/
|
||||
// user 2
|
||||
/*
|
||||
DCI_pdu->dci_alloc[1].dci_length = sizeof_DCI0_5MHz_TDD_1_6_t ;
|
||||
DCI_pdu->dci_alloc[1].L = 2;
|
||||
DCI_pdu->dci_alloc[1].rnti = 0x1236;
|
||||
DCI_pdu->dci_alloc[1].format = format0;
|
||||
DCI_pdu->dci_alloc[1].ra_flag = 0;
|
||||
|
||||
UL_alloc_pdu.type = 0;
|
||||
UL_alloc_pdu.hopping = 0;
|
||||
if (cooperation_flag==0)
|
||||
UL_alloc_pdu.rballoc = computeRIV(25,2+openair_daq_vars.ue_ul_nb_rb,openair_daq_vars.ue_ul_nb_rb);
|
||||
else
|
||||
UL_alloc_pdu.rballoc = computeRIV(25,0,openair_daq_vars.ue_ul_nb_rb);
|
||||
UL_alloc_pdu.mcs = openair_daq_vars.target_ue_ul_mcs;
|
||||
UL_alloc_pdu.ndi = phy_vars_eNB->proc[sched_subframe].frame_tx&1;
|
||||
UL_alloc_pdu.TPC = 0;
|
||||
if ((cooperation_flag==0) || (cooperation_flag==1))
|
||||
UL_alloc_pdu.cshift = 0;
|
||||
else
|
||||
UL_alloc_pdu.cshift = 1;
|
||||
UL_alloc_pdu.dai = 0;
|
||||
UL_alloc_pdu.cqi_req = 1;
|
||||
memcpy((void*)&DCI_pdu->dci_alloc[1].dci_pdu[0],(void *)&UL_alloc_pdu,sizeof(DCI0_5MHz_TDD_1_6_t));
|
||||
break;
|
||||
*/
|
||||
|
||||
/*default:
|
||||
break;*/
|
||||
}
|
||||
|
||||
DCI_pdu->nCCE = 0;
|
||||
|
||||
for (i=0; i<DCI_pdu->Num_common_dci+DCI_pdu->Num_ue_spec_dci; i++) {
|
||||
DCI_pdu->nCCE += (1<<(DCI_pdu->dci_alloc[i].L));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void fill_dci_emos(DCI_PDU *DCI_pdu, uint8_t subframe, PHY_VARS_eNB *phy_vars_eNB)
|
||||
{
|
||||
|
||||
int i;
|
||||
//uint8_t cooperation_flag = phy_vars_eNB->cooperation_flag;
|
||||
uint8_t transmission_mode = phy_vars_eNB->transmission_mode[0];
|
||||
|
||||
//uint32_t rballoc = 0x00F0;
|
||||
//uint32_t rballoc2 = 0x000F;
|
||||
/*
|
||||
uint32_t rand = taus();
|
||||
if ((subframe==8) || (subframe==9) || (subframe==0))
|
||||
rand = (rand%5)+5;
|
||||
else
|
||||
rand = (rand%4)+5;
|
||||
*/
|
||||
|
||||
DCI_pdu->Num_common_dci = 0;
|
||||
DCI_pdu->Num_ue_spec_dci=0;
|
||||
|
||||
switch (subframe) {
|
||||
case 5:
|
||||
DCI_pdu->Num_ue_spec_dci = 1;
|
||||
|
||||
if (transmission_mode<3) {
|
||||
//user 1
|
||||
DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI1_5MHz_TDD_t;
|
||||
DCI_pdu->dci_alloc[0].L = 2;
|
||||
DCI_pdu->dci_alloc[0].rnti = 0x1235;
|
||||
DCI_pdu->dci_alloc[0].format = format1;
|
||||
DCI_pdu->dci_alloc[0].ra_flag = 0;
|
||||
|
||||
DLSCH_alloc_pdu.rballoc = openair_daq_vars.ue_dl_rb_alloc;
|
||||
DLSCH_alloc_pdu.TPC = 0;
|
||||
DLSCH_alloc_pdu.dai = 0;
|
||||
DLSCH_alloc_pdu.harq_pid = 1;
|
||||
DLSCH_alloc_pdu.mcs = openair_daq_vars.target_ue_dl_mcs;
|
||||
DLSCH_alloc_pdu.ndi = 1;
|
||||
DLSCH_alloc_pdu.rv = 0;
|
||||
memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],(void *)&DLSCH_alloc_pdu,sizeof(DCI1_5MHz_TDD_t));
|
||||
|
||||
/*
|
||||
//user2
|
||||
DCI_pdu->dci_alloc[1].dci_length = sizeof_DCI1_5MHz_TDD_t;
|
||||
DCI_pdu->dci_alloc[1].L = 2;
|
||||
DCI_pdu->dci_alloc[1].rnti = 0x1236;
|
||||
DCI_pdu->dci_alloc[1].format = format1;
|
||||
DCI_pdu->dci_alloc[1].ra_flag = 0;
|
||||
|
||||
DLSCH_alloc_pdu.rballoc = rballoc2;
|
||||
DLSCH_alloc_pdu.TPC = 0;
|
||||
DLSCH_alloc_pdu.dai = 0;
|
||||
DLSCH_alloc_pdu.harq_pid = 1;
|
||||
DLSCH_alloc_pdu.mcs = openair_daq_vars.target_ue_dl_mcs;
|
||||
DLSCH_alloc_pdu.ndi = 1;
|
||||
DLSCH_alloc_pdu.rv = 0;
|
||||
memcpy((void*)&DCI_pdu->dci_alloc[1].dci_pdu[0],(void *)&DLSCH_alloc_pdu,sizeof(DCI1_5MHz_TDD_t));
|
||||
*/
|
||||
} else if (transmission_mode==5) {
|
||||
DCI_pdu->Num_ue_spec_dci = 2;
|
||||
// user 1
|
||||
DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI1E_5MHz_2A_M10PRB_TDD_t;
|
||||
DCI_pdu->dci_alloc[0].L = 2;
|
||||
DCI_pdu->dci_alloc[0].rnti = 0x1235;
|
||||
DCI_pdu->dci_alloc[0].format = format1E_2A_M10PRB;
|
||||
DCI_pdu->dci_alloc[0].ra_flag = 0;
|
||||
|
||||
DLSCH_alloc_pdu1E.tpmi = 5; //5=use feedback
|
||||
DLSCH_alloc_pdu1E.rv = 0;
|
||||
DLSCH_alloc_pdu1E.ndi = 1;
|
||||
DLSCH_alloc_pdu1E.mcs = openair_daq_vars.target_ue_dl_mcs;
|
||||
DLSCH_alloc_pdu1E.harq_pid = 1;
|
||||
DLSCH_alloc_pdu1E.dai = 0;
|
||||
DLSCH_alloc_pdu1E.TPC = 0;
|
||||
DLSCH_alloc_pdu1E.rballoc = openair_daq_vars.ue_dl_rb_alloc;
|
||||
DLSCH_alloc_pdu1E.rah = 0;
|
||||
DLSCH_alloc_pdu1E.dl_power_off = 0; //0=second user present
|
||||
memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],(void *)&DLSCH_alloc_pdu1E,sizeof(DCI1E_5MHz_2A_M10PRB_TDD_t));
|
||||
|
||||
//user 2
|
||||
DCI_pdu->dci_alloc[1].dci_length = sizeof_DCI1E_5MHz_2A_M10PRB_TDD_t;
|
||||
DCI_pdu->dci_alloc[1].L = 2;
|
||||
DCI_pdu->dci_alloc[1].rnti = 0x1236;
|
||||
DCI_pdu->dci_alloc[1].format = format1E_2A_M10PRB;
|
||||
DCI_pdu->dci_alloc[1].ra_flag = 0;
|
||||
|
||||
memcpy((void*)&DCI_pdu->dci_alloc[1].dci_pdu[0],(void *)&DLSCH_alloc_pdu1E,sizeof(DCI1E_5MHz_2A_M10PRB_TDD_t));
|
||||
|
||||
// set the precoder of the second UE orthogonal to the first
|
||||
phy_vars_eNB->eNB_UE_stats[1].DL_pmi_single = (phy_vars_eNB->eNB_UE_stats[0].DL_pmi_single ^ 0x1555);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 7:
|
||||
DCI_pdu->Num_common_dci = 1;
|
||||
DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI1A_5MHz_TDD_1_6_t;
|
||||
DCI_pdu->dci_alloc[0].L = 2;
|
||||
DCI_pdu->dci_alloc[0].rnti = 0xbeef;
|
||||
DCI_pdu->dci_alloc[0].format = format1A;
|
||||
DCI_pdu->dci_alloc[0].ra_flag = 1;
|
||||
|
||||
RA_alloc_pdu.type = 1;
|
||||
RA_alloc_pdu.vrb_type = 0;
|
||||
RA_alloc_pdu.rballoc = computeRIV(25,12,3);
|
||||
RA_alloc_pdu.ndi = 1;
|
||||
RA_alloc_pdu.rv = 1;
|
||||
RA_alloc_pdu.mcs = 4;
|
||||
RA_alloc_pdu.harq_pid = 0;
|
||||
RA_alloc_pdu.TPC = 1;
|
||||
|
||||
memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],&RA_alloc_pdu,sizeof(DCI1A_5MHz_TDD_1_6_t));
|
||||
break;
|
||||
|
||||
case 9:
|
||||
DCI_pdu->Num_ue_spec_dci = 1;
|
||||
|
||||
//user 1
|
||||
DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI0_5MHz_TDD_1_6_t ;
|
||||
DCI_pdu->dci_alloc[0].L = 2;
|
||||
DCI_pdu->dci_alloc[0].rnti = 0x1235;
|
||||
DCI_pdu->dci_alloc[0].format = format0;
|
||||
DCI_pdu->dci_alloc[0].ra_flag = 0;
|
||||
|
||||
UL_alloc_pdu.type = 0;
|
||||
UL_alloc_pdu.hopping = 0;
|
||||
UL_alloc_pdu.rballoc = computeRIV(25,0,openair_daq_vars.ue_ul_nb_rb);
|
||||
UL_alloc_pdu.mcs = openair_daq_vars.target_ue_ul_mcs;
|
||||
UL_alloc_pdu.ndi = 1;
|
||||
UL_alloc_pdu.TPC = 0;
|
||||
UL_alloc_pdu.cshift = 0;
|
||||
UL_alloc_pdu.dai = 0;
|
||||
UL_alloc_pdu.cqi_req = 1;
|
||||
memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],(void *)&UL_alloc_pdu,sizeof(DCI0_5MHz_TDD_1_6_t));
|
||||
|
||||
/*
|
||||
//user 2
|
||||
DCI_pdu->dci_alloc[1].dci_length = sizeof_DCI0_5MHz_TDD_1_6_t ;
|
||||
DCI_pdu->dci_alloc[1].L = 2;
|
||||
DCI_pdu->dci_alloc[1].rnti = 0x1236;
|
||||
DCI_pdu->dci_alloc[1].format = format0;
|
||||
DCI_pdu->dci_alloc[1].ra_flag = 0;
|
||||
|
||||
UL_alloc_pdu.type = 0;
|
||||
UL_alloc_pdu.hopping = 0;
|
||||
if (cooperation_flag==0)
|
||||
UL_alloc_pdu.rballoc = computeRIV(25,2+openair_daq_vars.ue_ul_nb_rb,openair_daq_vars.ue_ul_nb_rb);
|
||||
else
|
||||
UL_alloc_pdu.rballoc = computeRIV(25,0,openair_daq_vars.ue_ul_nb_rb);
|
||||
UL_alloc_pdu.mcs = openair_daq_vars.target_ue_ul_mcs;
|
||||
UL_alloc_pdu.ndi = 1;
|
||||
UL_alloc_pdu.TPC = 0;
|
||||
if ((cooperation_flag==0) || (cooperation_flag==1))
|
||||
UL_alloc_pdu.cshift = 0;
|
||||
else
|
||||
UL_alloc_pdu.cshift = 1;
|
||||
UL_alloc_pdu.dai = 0;
|
||||
UL_alloc_pdu.cqi_req = 1;
|
||||
memcpy((void*)&DCI_pdu->dci_alloc[1].dci_pdu[0],(void *)&UL_alloc_pdu,sizeof(DCI0_5MHz_TDD_1_6_t));
|
||||
*/
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
DCI_pdu->nCCE = 0;
|
||||
|
||||
for (i=0; i<DCI_pdu->Num_common_dci+DCI_pdu->Num_ue_spec_dci; i++) {
|
||||
DCI_pdu->nCCE += (1<<(DCI_pdu->dci_alloc[i].L));
|
||||
}
|
||||
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -59,20 +59,15 @@ extern int card;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
//#define DEBUG_PHY_PROC
|
||||
#define UE_TX_POWER (-10)
|
||||
#define DEBUG_PHY_PROC
|
||||
|
||||
//#ifdef OPENAIR2
|
||||
#ifndef PUCCH
|
||||
#define PUCCH
|
||||
#endif
|
||||
//#endif
|
||||
|
||||
//#ifdef OPENAIR2
|
||||
#include "LAYER2/MAC/extern.h"
|
||||
#include "LAYER2/MAC/defs.h"
|
||||
#include "UTIL/LOG/log.h"
|
||||
//#endif
|
||||
|
||||
#ifdef EMOS
|
||||
fifo_dump_emos_UE emos_dump_UE;
|
||||
@@ -87,9 +82,6 @@ fifo_dump_emos_UE emos_dump_UE;
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef OPENAIR2
|
||||
//#define DIAG_PHY
|
||||
#endif
|
||||
|
||||
#define DLSCH_RB_ALLOC 0x1fbf // skip DC RB (total 23/25 RBs)
|
||||
#define DLSCH_RB_ALLOC_12 0x0aaa // skip DC RB (total 23/25 RBs)
|
||||
@@ -121,7 +113,7 @@ extern int rx_sig_fifo;
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(EXMIMO) || defined(OAI_USRP)
|
||||
#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR)
|
||||
extern uint32_t downlink_frequency[MAX_NUM_CCs][4];
|
||||
#endif
|
||||
|
||||
@@ -197,7 +189,7 @@ void dump_dlsch_SI(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t subframe)
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
#if defined(EXMIMO) || defined(OAI_USRP)
|
||||
#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR)
|
||||
//unsigned int gain_table[31] = {100,112,126,141,158,178,200,224,251,282,316,359,398,447,501,562,631,708,794,891,1000,1122,1258,1412,1585,1778,1995,2239,2512,2818,3162};
|
||||
/*
|
||||
unsigned int get_tx_amp_prach(int power_dBm, int power_max_dBm, int N_RB_UL)
|
||||
@@ -454,7 +446,7 @@ uint16_t get_n1_pucch(PHY_VARS_UE *phy_vars_ue,
|
||||
|
||||
if (frame_parms->frame_type == FDD ) { // FDD
|
||||
sf = (subframe<4)? subframe+6 : subframe-4;
|
||||
printf("n1_pucch_UE: subframe %d, nCCE %d\n",sf,phy_vars_ue->lte_ue_pdcch_vars[eNB_id]->nCCE[sf]);
|
||||
LOG_D(PHY,"n1_pucch_UE: subframe %d, nCCE %d\n",sf,phy_vars_ue->lte_ue_pdcch_vars[eNB_id]->nCCE[sf]);
|
||||
|
||||
if (SR == 0)
|
||||
return(frame_parms->pucch_config_common.n1PUCCH_AN + phy_vars_ue->lte_ue_pdcch_vars[eNB_id]->nCCE[sf]);
|
||||
@@ -642,16 +634,12 @@ void phy_procedures_emos_UE_TX(uint8_t next_slot,uint8_t eNB_id) {
|
||||
#endif
|
||||
|
||||
int dummy_tx_buffer[3840*4] __attribute__((aligned(16)));
|
||||
#ifndef OPENAIR2
|
||||
PRACH_RESOURCES_t prach_resources_local;
|
||||
#endif
|
||||
|
||||
void phy_procedures_UE_TX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstraction_flag,runmode_t mode,relaying_type_t r_type)
|
||||
{
|
||||
|
||||
#ifndef OPENAIR2
|
||||
int i;
|
||||
#endif
|
||||
uint16_t first_rb, nb_rb;
|
||||
uint8_t harq_pid;
|
||||
unsigned int input_buffer_length;
|
||||
@@ -669,7 +657,7 @@ void phy_procedures_UE_TX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstra
|
||||
uint8_t ack_status=0;
|
||||
int8_t Po_PUCCH;
|
||||
int32_t ulsch_start=0;
|
||||
#if defined(EXMIMO) || defined(OAI_USRP)
|
||||
#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR)
|
||||
int overflow=0;
|
||||
int k,l;
|
||||
#endif
|
||||
@@ -724,8 +712,7 @@ void phy_procedures_UE_TX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstra
|
||||
subframe_tx);
|
||||
|
||||
|
||||
#ifdef OPENAIR2
|
||||
|
||||
if (phy_vars_ue->mac_enabled == 1) {
|
||||
if ((phy_vars_ue->ulsch_ue_Msg3_active[eNB_id] == 1) &&
|
||||
(phy_vars_ue->ulsch_ue_Msg3_frame[eNB_id] == frame_tx) &&
|
||||
(phy_vars_ue->ulsch_ue_Msg3_subframe[eNB_id] == subframe_tx)) { // Initial Transmission of Msg3
|
||||
@@ -756,8 +743,7 @@ void phy_procedures_UE_TX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstra
|
||||
|
||||
Msg3_flag=0;
|
||||
}
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
if (phy_vars_ue->ulsch_ue[eNB_id]->harq_processes[harq_pid]->subframe_scheduling_flag == 1) {
|
||||
|
||||
@@ -856,19 +842,17 @@ void phy_procedures_UE_TX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstra
|
||||
#endif
|
||||
stop_meas(&phy_vars_ue->ulsch_encoding_stats);
|
||||
|
||||
|
||||
#ifdef OPENAIR2
|
||||
// signal MAC that Msg3 was sent
|
||||
mac_xface->Msg3_transmitted(Mod_id,
|
||||
CC_id,
|
||||
frame_tx,
|
||||
eNB_id);
|
||||
#endif
|
||||
if (phy_vars_ue->mac_enabled == 1) {
|
||||
// signal MAC that Msg3 was sent
|
||||
mac_xface->Msg3_transmitted(Mod_id,
|
||||
CC_id,
|
||||
frame_tx,
|
||||
eNB_id);
|
||||
}
|
||||
} else {
|
||||
input_buffer_length = phy_vars_ue->ulsch_ue[eNB_id]->harq_processes[harq_pid]->TBS/8;
|
||||
|
||||
#ifdef OPENAIR2
|
||||
|
||||
if (phy_vars_ue->mac_enabled==1) {
|
||||
// LOG_D(PHY,"[UE %d] ULSCH : Searching for MAC SDUs\n",Mod_id);
|
||||
if (phy_vars_ue->ulsch_ue[eNB_id]->harq_processes[harq_pid]->round==0) {
|
||||
//if (phy_vars_ue->ulsch_ue[eNB_id]->harq_processes[harq_pid]->calibration_flag == 0) {
|
||||
@@ -905,7 +889,8 @@ void phy_procedures_UE_TX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstra
|
||||
LOG_T(PHY,"\n");
|
||||
#endif
|
||||
#endif
|
||||
#else //OPENAIR2
|
||||
}
|
||||
else {
|
||||
// the following lines were necessary for the calibration in CROWN
|
||||
/*
|
||||
if (phy_vars_ue->ulsch_ue[eNB_id]->harq_processes[harq_pid]->calibration_flag == 0) {
|
||||
@@ -917,6 +902,8 @@ void phy_procedures_UE_TX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstra
|
||||
}
|
||||
*/
|
||||
|
||||
unsigned int taus(void);
|
||||
|
||||
for (i=0; i<input_buffer_length; i++)
|
||||
ulsch_input_buffer[i]= (uint8_t)(taus()&0xff);
|
||||
|
||||
@@ -928,8 +915,8 @@ void phy_procedures_UE_TX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstra
|
||||
for (i=0;i<input_buffer_length;i++)
|
||||
ulsch_input_buffer[i]= i;
|
||||
*/
|
||||
}
|
||||
|
||||
#endif //OPENAIR2
|
||||
start_meas(&phy_vars_ue->ulsch_encoding_stats);
|
||||
|
||||
if (abstraction_flag==0) {
|
||||
@@ -961,15 +948,16 @@ void phy_procedures_UE_TX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstra
|
||||
}
|
||||
|
||||
if (abstraction_flag == 0) {
|
||||
#ifdef OPENAIR2
|
||||
pusch_power_cntl(phy_vars_ue,subframe_tx,eNB_id,1, abstraction_flag);
|
||||
phy_vars_ue->tx_power_dBm = phy_vars_ue->ulsch_ue[eNB_id]->Po_PUSCH;
|
||||
#else
|
||||
phy_vars_ue->tx_power_dBm = UE_TX_POWER;
|
||||
#endif
|
||||
if (phy_vars_ue->mac_enabled==1) {
|
||||
pusch_power_cntl(phy_vars_ue,subframe_tx,eNB_id,1, abstraction_flag);
|
||||
phy_vars_ue->tx_power_dBm = phy_vars_ue->ulsch_ue[eNB_id]->Po_PUSCH;
|
||||
}
|
||||
else {
|
||||
phy_vars_ue->tx_power_dBm = phy_vars_ue->tx_power_max_dBm;
|
||||
}
|
||||
phy_vars_ue->tx_total_RE = nb_rb*12;
|
||||
|
||||
#if defined(EXMIMO) || defined(OAI_USRP)
|
||||
#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR)
|
||||
tx_amp = get_tx_amp(phy_vars_ue->tx_power_dBm,
|
||||
phy_vars_ue->tx_power_max_dBm,
|
||||
phy_vars_ue->lte_frame_parms.N_RB_UL,
|
||||
@@ -1023,17 +1011,19 @@ void phy_procedures_UE_TX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstra
|
||||
if (is_SR_TXOp(phy_vars_ue,eNB_id,subframe_tx)==1) {
|
||||
LOG_D(PHY,"[UE %d][SR %x] Frame %d subframe %d: got SR_TXOp, Checking for SR for PUSCH from MAC\n",
|
||||
Mod_id,phy_vars_ue->lte_ue_pdcch_vars[eNB_id]->crnti,frame_tx,subframe_tx);
|
||||
#ifdef OPENAIR2
|
||||
SR_payload = mac_xface->ue_get_SR(Mod_id,
|
||||
CC_id,
|
||||
frame_tx,
|
||||
eNB_id,
|
||||
phy_vars_ue->lte_ue_pdcch_vars[eNB_id]->crnti,
|
||||
subframe_tx); // subframe used for meas gap
|
||||
#else
|
||||
SR_payload = 1;
|
||||
#endif
|
||||
|
||||
if (phy_vars_ue->mac_enabled==1) {
|
||||
SR_payload = mac_xface->ue_get_SR(Mod_id,
|
||||
CC_id,
|
||||
frame_tx,
|
||||
eNB_id,
|
||||
phy_vars_ue->lte_ue_pdcch_vars[eNB_id]->crnti,
|
||||
subframe_tx); // subframe used for meas gap
|
||||
}
|
||||
else {
|
||||
SR_payload = 1;
|
||||
}
|
||||
|
||||
if (SR_payload>0) {
|
||||
generate_ul_signal = 1;
|
||||
LOG_D(PHY,"[UE %d][SR %x] Frame %d subframe %d got the SR for PUSCH is %d\n",
|
||||
@@ -1041,8 +1031,9 @@ void phy_procedures_UE_TX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstra
|
||||
} else {
|
||||
phy_vars_ue->sr[subframe_tx]=0;
|
||||
}
|
||||
} else
|
||||
} else {
|
||||
SR_payload=0;
|
||||
}
|
||||
|
||||
if (get_ack(&phy_vars_ue->lte_frame_parms,
|
||||
phy_vars_ue->dlsch_ue[eNB_id][0]->harq_ack,
|
||||
@@ -1057,15 +1048,16 @@ void phy_procedures_UE_TX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstra
|
||||
pucch_ack_payload,
|
||||
SR_payload);
|
||||
|
||||
#ifdef OPENAIR2
|
||||
Po_PUCCH = pucch_power_cntl(phy_vars_ue,subframe_tx,eNB_id,format);
|
||||
phy_vars_ue->tx_power_dBm = Po_PUCCH;
|
||||
#else
|
||||
phy_vars_ue->tx_power_dBm = UE_TX_POWER;
|
||||
#endif
|
||||
if (phy_vars_ue->mac_enabled == 1) {
|
||||
Po_PUCCH = pucch_power_cntl(phy_vars_ue,subframe_tx,eNB_id,format);
|
||||
}
|
||||
else {
|
||||
Po_PUCCH = phy_vars_ue->tx_power_max_dBm;
|
||||
}
|
||||
phy_vars_ue->tx_power_dBm = Po_PUCCH;
|
||||
phy_vars_ue->tx_total_RE = 12;
|
||||
|
||||
#if defined(EXMIMO) || defined(OAI_USRP)
|
||||
#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR)
|
||||
tx_amp = get_tx_amp(Po_PUCCH,
|
||||
phy_vars_ue->tx_power_max_dBm,
|
||||
phy_vars_ue->lte_frame_parms.N_RB_UL,
|
||||
@@ -1120,15 +1112,16 @@ void phy_procedures_UE_TX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstra
|
||||
}
|
||||
} else if (SR_payload==1) { // no ACK/NAK but SR is triggered by MAC
|
||||
|
||||
#ifdef OPENAIR2
|
||||
Po_PUCCH = pucch_power_cntl(phy_vars_ue,subframe_tx,eNB_id,pucch_format1);
|
||||
phy_vars_ue->tx_power_dBm = Po_PUCCH;
|
||||
#else
|
||||
phy_vars_ue->tx_power_dBm = UE_TX_POWER;
|
||||
#endif
|
||||
if (phy_vars_ue->mac_enabled == 1) {
|
||||
Po_PUCCH = pucch_power_cntl(phy_vars_ue,subframe_tx,eNB_id,pucch_format1);
|
||||
}
|
||||
else {
|
||||
Po_PUCCH = phy_vars_ue->tx_power_max_dBm;
|
||||
}
|
||||
phy_vars_ue->tx_power_dBm = Po_PUCCH;
|
||||
phy_vars_ue->tx_total_RE = 12;
|
||||
|
||||
#if defined(EXMIMO) || defined(OAI_USRP)
|
||||
#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR)
|
||||
tx_amp = get_tx_amp(Po_PUCCH,
|
||||
phy_vars_ue->tx_power_max_dBm,
|
||||
phy_vars_ue->lte_frame_parms.N_RB_UL,
|
||||
@@ -1230,7 +1223,7 @@ void phy_procedures_UE_TX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstra
|
||||
if (abstraction_flag == 0) {
|
||||
nsymb = (frame_parms->Ncp == 0) ? 14 : 12;
|
||||
|
||||
#if defined(EXMIMO) || defined(OAI_USRP) //this is the EXPRESS MIMO case
|
||||
#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR)//this is the EXPRESS MIMO case
|
||||
ulsch_start = (phy_vars_ue->rx_offset+subframe_tx*frame_parms->samples_per_tti-
|
||||
openair_daq_vars.timing_advance-
|
||||
phy_vars_ue->timing_advance-
|
||||
@@ -1257,7 +1250,7 @@ void phy_procedures_UE_TX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstra
|
||||
for (aa=0; aa<frame_parms->nb_antennas_tx; aa++) {
|
||||
if (frame_parms->Ncp == 1)
|
||||
PHY_ofdm_mod(&phy_vars_ue->lte_ue_common_vars.txdataF[aa][subframe_tx*nsymb*frame_parms->ofdm_symbol_size],
|
||||
#if defined(EXMIMO) || defined(OAI_USRP)
|
||||
#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR)
|
||||
dummy_tx_buffer,
|
||||
#else
|
||||
&phy_vars_ue->lte_ue_common_vars.txdata[aa][ulsch_start],
|
||||
@@ -1268,7 +1261,7 @@ void phy_procedures_UE_TX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstra
|
||||
CYCLIC_PREFIX);
|
||||
else
|
||||
normal_prefix_mod(&phy_vars_ue->lte_ue_common_vars.txdataF[aa][subframe_tx*nsymb*frame_parms->ofdm_symbol_size],
|
||||
#if defined(EXMIMO) || defined(OAI_USRP)
|
||||
#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR)
|
||||
dummy_tx_buffer,
|
||||
#else
|
||||
&phy_vars_ue->lte_ue_common_vars.txdata[aa][ulsch_start],
|
||||
@@ -1289,7 +1282,7 @@ void phy_procedures_UE_TX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstra
|
||||
}
|
||||
*/
|
||||
#ifndef OFDMA_ULSCH
|
||||
#if defined(EXMIMO) || defined(OAI_USRP)
|
||||
#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR)
|
||||
apply_7_5_kHz(phy_vars_ue,dummy_tx_buffer,0);
|
||||
apply_7_5_kHz(phy_vars_ue,dummy_tx_buffer,1);
|
||||
#else
|
||||
@@ -1304,7 +1297,7 @@ void phy_procedures_UE_TX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstra
|
||||
*/
|
||||
#endif
|
||||
|
||||
#if defined(EXMIMO) || defined(OAI_USRP)
|
||||
#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR)
|
||||
overflow = ulsch_start - 9*frame_parms->samples_per_tti;
|
||||
|
||||
//if ((slot_tx==4) && (aa==0)) printf("ulsch_start %d, overflow %d\n",ulsch_start,overflow);
|
||||
@@ -1345,30 +1338,23 @@ void phy_procedures_UE_TX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstra
|
||||
// }// slot_tx is even
|
||||
// else { // slot_tx is odd, do the PRACH here
|
||||
|
||||
#ifdef OPENAIR2
|
||||
|
||||
if ((phy_vars_ue->UE_mode[eNB_id] == PRACH) && (phy_vars_ue->lte_frame_parms.prach_config_common.prach_Config_enabled==1)) {
|
||||
|
||||
#else
|
||||
|
||||
if (1) {
|
||||
#endif
|
||||
|
||||
// check if we have PRACH opportunity
|
||||
if (is_prach_subframe(&phy_vars_ue->lte_frame_parms,frame_tx,subframe_tx)) {
|
||||
phy_vars_ue->generate_prach=0;
|
||||
#ifdef OPENAIR2
|
||||
|
||||
// ask L2 for RACH transport
|
||||
if ((mode != rx_calib_ue) && (mode != rx_calib_ue_med) && (mode != rx_calib_ue_byp) && (mode != no_L2_connect) ) {
|
||||
phy_vars_ue->prach_resources[eNB_id] = mac_xface->ue_get_rach(Mod_id,
|
||||
CC_id,
|
||||
frame_tx,
|
||||
eNB_id,
|
||||
subframe_tx);
|
||||
// LOG_I(PHY,"Got prach_resources for eNB %d address %d, RRCCommon %d\n",eNB_id,phy_vars_ue->prach_resources[eNB_id],UE_mac_inst[Mod_id].radioResourceConfigCommon);
|
||||
}
|
||||
#endif
|
||||
if (phy_vars_ue->mac_enabled==1){
|
||||
// ask L2 for RACH transport
|
||||
if ((mode != rx_calib_ue) && (mode != rx_calib_ue_med) && (mode != rx_calib_ue_byp) && (mode != no_L2_connect) ) {
|
||||
phy_vars_ue->prach_resources[eNB_id] = mac_xface->ue_get_rach(Mod_id,
|
||||
CC_id,
|
||||
frame_tx,
|
||||
eNB_id,
|
||||
subframe_tx);
|
||||
// LOG_I(PHY,"Got prach_resources for eNB %d address %d, RRCCommon %d\n",eNB_id,phy_vars_ue->prach_resources[eNB_id],UE_mac_inst[Mod_id].radioResourceConfigCommon);
|
||||
}
|
||||
}
|
||||
|
||||
if (phy_vars_ue->prach_resources[eNB_id]!=NULL) {
|
||||
|
||||
@@ -1391,20 +1377,17 @@ void phy_procedures_UE_TX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstra
|
||||
phy_vars_ue->prach_resources[eNB_id]->ra_TDD_map_index,
|
||||
phy_vars_ue->prach_resources[eNB_id]->ra_RNTI);
|
||||
|
||||
#ifdef OPENAIR2
|
||||
if (mode != calib_prach_tx)
|
||||
if ((phy_vars_ue->mac_enabled==1) && (mode != calib_prach_tx)) {
|
||||
phy_vars_ue->tx_power_dBm = phy_vars_ue->prach_resources[eNB_id]->ra_PREAMBLE_RECEIVED_TARGET_POWER+get_PL(Mod_id,CC_id,eNB_id);
|
||||
}
|
||||
else {
|
||||
phy_vars_ue->tx_power_dBm = phy_vars_ue->tx_power_max_dBm;
|
||||
phy_vars_ue->prach_resources[eNB_id]->ra_PreambleIndex = 19;
|
||||
}
|
||||
#else
|
||||
phy_vars_ue->tx_power_dBm = UE_TX_POWER;
|
||||
#endif
|
||||
|
||||
phy_vars_ue->tx_total_RE = 96;
|
||||
|
||||
#if defined(EXMIMO) || defined(OAI_USRP)
|
||||
#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR)
|
||||
phy_vars_ue->lte_ue_prach_vars[eNB_id]->amp = get_tx_amp(phy_vars_ue->tx_power_dBm,
|
||||
phy_vars_ue->tx_power_max_dBm,
|
||||
phy_vars_ue->lte_frame_parms.N_RB_UL,
|
||||
@@ -1431,12 +1414,12 @@ void phy_procedures_UE_TX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstra
|
||||
} else {
|
||||
UE_transport_info[Mod_id][CC_id].cntl.prach_flag=1;
|
||||
UE_transport_info[Mod_id][CC_id].cntl.prach_id=phy_vars_ue->prach_resources[eNB_id]->ra_PreambleIndex;
|
||||
#ifdef OPENAIR2
|
||||
mac_xface->Msg1_transmitted(Mod_id,
|
||||
CC_id,
|
||||
frame_tx,
|
||||
eNB_id);
|
||||
#endif
|
||||
if (phy_vars_ue->mac_enabled==1){
|
||||
mac_xface->Msg1_transmitted(Mod_id,
|
||||
CC_id,
|
||||
frame_tx,
|
||||
eNB_id);
|
||||
}
|
||||
}
|
||||
|
||||
LOG_D(PHY,"[UE %d][RAPROC] Frame %d, subframe %d: Generating PRACH (eNB %d) preamble index %d for UL, TX power %d dBm (PL %d dB), l3msg \n",
|
||||
@@ -1549,13 +1532,15 @@ void lte_ue_measurement_procedures(uint16_t l, PHY_VARS_UE *phy_vars_ue,uint8_t
|
||||
if ((openair_daq_vars.rx_gain_mode == DAQ_AGC_ON) &&
|
||||
(mode != rx_calib_ue) && (mode != rx_calib_ue_med) && (mode != rx_calib_ue_byp) )
|
||||
if (phy_vars_ue->frame_rx%100==0)
|
||||
gain_control_all(phy_vars_ue->PHY_measurements.rx_power_avg_dB[eNB_id],0);
|
||||
gain_control_all(dB_fixed(phy_vars_ue->PHY_measurements.rssi),0);
|
||||
|
||||
#else
|
||||
#ifndef OAI_USRP
|
||||
#ifndef OAI_BLADERF
|
||||
phy_adjust_gain (phy_vars_ue,0);
|
||||
#endif
|
||||
#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
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_GAIN_CONTROL, VCD_FUNCTION_OUT);
|
||||
@@ -1820,11 +1805,11 @@ void lte_ue_pbch_procedures(uint8_t eNB_id,PHY_VARS_UE *phy_vars_ue,uint8_t abst
|
||||
frame_tx += ((int)(phy_vars_ue->lte_ue_pbch_vars[eNB_id]->decoded_output[1]&0xfc));
|
||||
frame_tx += pbch_phase;
|
||||
|
||||
#ifdef OPENAIR2
|
||||
mac_xface->dl_phy_sync_success(phy_vars_ue->Mod_id,frame_rx,eNB_id,
|
||||
phy_vars_ue->UE_mode[eNB_id]==NOT_SYNCHED ? 1 : 0);
|
||||
#endif
|
||||
|
||||
if (phy_vars_ue->mac_enabled==1) {
|
||||
mac_xface->dl_phy_sync_success(phy_vars_ue->Mod_id,frame_rx,eNB_id,
|
||||
phy_vars_ue->UE_mode[eNB_id]==NOT_SYNCHED ? 1 : 0);
|
||||
}
|
||||
|
||||
#ifdef EMOS
|
||||
//emos_dump_UE.frame_tx = frame_tx;
|
||||
//emos_dump_UE.mimo_mode = phy_vars_ue->lte_ue_pbch_vars[eNB_id]->decoded_output[1];
|
||||
@@ -1904,16 +1889,15 @@ void lte_ue_pbch_procedures(uint8_t eNB_id,PHY_VARS_UE *phy_vars_ue,uint8_t abst
|
||||
phy_vars_ue->Mod_id,frame_rx, slot_rx);
|
||||
phy_vars_ue->lte_ue_pbch_vars[eNB_id]->pdu_errors_conseq++;
|
||||
phy_vars_ue->lte_ue_pbch_vars[eNB_id]->pdu_errors++;
|
||||
#ifdef OPENAIR2
|
||||
mac_xface->out_of_sync_ind(phy_vars_ue->Mod_id,frame_rx,eNB_id);
|
||||
#else
|
||||
|
||||
if (phy_vars_ue->lte_ue_pbch_vars[eNB_id]->pdu_errors_conseq>=100) {
|
||||
LOG_E(PHY,"More that 100 consecutive PBCH errors! Exiting!\n");
|
||||
mac_xface->macphy_exit("More that 100 consecutive PBCH errors!");
|
||||
if (phy_vars_ue->mac_enabled == 1) {
|
||||
mac_xface->out_of_sync_ind(phy_vars_ue->Mod_id,frame_rx,eNB_id);
|
||||
}
|
||||
else{
|
||||
if (phy_vars_ue->lte_ue_pbch_vars[eNB_id]->pdu_errors_conseq>=100) {
|
||||
LOG_E(PHY,"More that 100 consecutive PBCH errors! Exiting!\n");
|
||||
mac_xface->macphy_exit("More that 100 consecutive PBCH errors!");
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
if (frame_rx % 100 == 0) {
|
||||
@@ -2103,10 +2087,10 @@ int lte_ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *phy_vars_ue,uint8_t abst
|
||||
|
||||
#ifdef DEBUG_PHY_PROC
|
||||
|
||||
// if (subframe_rx == 9) { //( frame_rx % 100 == 0) {
|
||||
if ( frame_rx % 100 == 0) {
|
||||
LOG_D(PHY,"frame %d, subframe %d, rnti %x: dci %d/%d\n",frame_rx,subframe_rx,phy_vars_ue->lte_ue_pdcch_vars[eNB_id]->crnti,i,dci_cnt);
|
||||
//dump_dci(&phy_vars_ue->lte_frame_parms, &dci_alloc_rx[i]);
|
||||
// }
|
||||
dump_dci(&phy_vars_ue->lte_frame_parms, &dci_alloc_rx[i]);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -2414,9 +2398,7 @@ int phy_procedures_UE_RX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstrac
|
||||
int eNB_id_i = 1;
|
||||
uint8_t dual_stream_UE = 0;
|
||||
#endif
|
||||
#ifndef OPENAIR2
|
||||
uint8_t *rar;
|
||||
#endif
|
||||
int pmch_flag=0;
|
||||
uint8_t sync_area=255;
|
||||
int pmch_mcs=-1;
|
||||
@@ -2425,9 +2407,7 @@ int phy_procedures_UE_RX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstrac
|
||||
int slot_rx = phy_vars_ue->slot_rx;
|
||||
int subframe_rx = slot_rx>>1;
|
||||
int subframe_prev = (subframe_rx+9)%10;
|
||||
#ifdef OPENAIR2
|
||||
int CC_id = phy_vars_ue->CC_id;
|
||||
#endif
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_RX, VCD_FUNCTION_IN);
|
||||
|
||||
@@ -2676,18 +2656,12 @@ int phy_procedures_UE_RX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstrac
|
||||
if (ret == (1+phy_vars_ue->dlsch_ue[eNB_id][0]->max_turbo_iterations)) {
|
||||
phy_vars_ue->dlsch_errors[eNB_id]++;
|
||||
|
||||
//#ifdef DEBUG_PHY_PROC
|
||||
LOG_D(PHY,"[UE %d][PDSCH %x/%d] Frame %d subframe %d DLSCH in error (rv %d,mcs %d,TBS %d)\n",
|
||||
phy_vars_ue->Mod_id,phy_vars_ue->dlsch_ue[eNB_id][0]->rnti,
|
||||
harq_pid,frame_rx,subframe_prev,
|
||||
phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->rvidx,
|
||||
phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->mcs,
|
||||
phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->TBS);
|
||||
|
||||
// if (abstraction_flag ==0 )
|
||||
dump_dlsch(phy_vars_ue,eNB_id,subframe_prev,harq_pid);
|
||||
mac_xface->macphy_exit("");
|
||||
//#endif
|
||||
} else {
|
||||
LOG_D(PHY,"[UE %d][PDSCH %x/%d] Frame %d subframe %d (slot_rx %d): Received DLSCH (rv %d,mcs %d,TBS %d)\n",
|
||||
phy_vars_ue->Mod_id,phy_vars_ue->dlsch_ue[eNB_id][0]->rnti,
|
||||
@@ -2706,14 +2680,14 @@ int phy_procedures_UE_RX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstrac
|
||||
LOG_T(PHY,"\n");
|
||||
#endif
|
||||
#endif
|
||||
#ifdef OPENAIR2
|
||||
mac_xface->ue_send_sdu(phy_vars_ue->Mod_id,
|
||||
CC_id,
|
||||
frame_rx,
|
||||
phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[phy_vars_ue->dlsch_ue[eNB_id][0]->current_harq_pid]->b,
|
||||
phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[phy_vars_ue->dlsch_ue[eNB_id][0]->current_harq_pid]->TBS>>3,
|
||||
eNB_id);
|
||||
#endif
|
||||
if (phy_vars_ue->mac_enabled == 1) {
|
||||
mac_xface->ue_send_sdu(phy_vars_ue->Mod_id,
|
||||
CC_id,
|
||||
frame_rx,
|
||||
phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[phy_vars_ue->dlsch_ue[eNB_id][0]->current_harq_pid]->b,
|
||||
phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[phy_vars_ue->dlsch_ue[eNB_id][0]->current_harq_pid]->TBS>>3,
|
||||
eNB_id);
|
||||
}
|
||||
phy_vars_ue->total_TBS[eNB_id] = phy_vars_ue->total_TBS[eNB_id] +
|
||||
phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[phy_vars_ue->dlsch_ue[eNB_id][0]->current_harq_pid]->TBS;
|
||||
phy_vars_ue->total_received_bits[eNB_id] = phy_vars_ue->total_TBS[eNB_id] +
|
||||
@@ -2883,24 +2857,20 @@ int phy_procedures_UE_RX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstrac
|
||||
phy_vars_ue->dlsch_ue_SI[eNB_id]->harq_processes[0]->rb_alloc_even[3]);
|
||||
#endif
|
||||
|
||||
#ifdef OPENAIR2
|
||||
/*
|
||||
printf("\n\n");
|
||||
for (i=0;i<phy_vars_ue->dlsch_ue_SI[eNB_id]->harq_processes[0]->TBS>>3;i++)
|
||||
printf("%02x ",phy_vars_ue->dlsch_ue_SI[eNB_id]->harq_processes[0]->b[i]);
|
||||
printf("\n");
|
||||
*/
|
||||
mac_xface->ue_decode_si(phy_vars_ue->Mod_id,
|
||||
CC_id,
|
||||
frame_rx,
|
||||
eNB_id,
|
||||
phy_vars_ue->dlsch_ue_SI[eNB_id]->harq_processes[0]->b,
|
||||
phy_vars_ue->dlsch_ue_SI[eNB_id]->harq_processes[0]->TBS>>3);
|
||||
/*
|
||||
if ((frame_rx % 160) < 10)
|
||||
printf("sending SI to L2 in frame %d\n",frame_rx);
|
||||
*/
|
||||
#endif
|
||||
if (phy_vars_ue->mac_enabled == 1) {
|
||||
/*
|
||||
printf("\n\n");
|
||||
for (i=0;i<phy_vars_ue->dlsch_ue_SI[eNB_id]->harq_processes[0]->TBS>>3;i++)
|
||||
printf("%02x ",phy_vars_ue->dlsch_ue_SI[eNB_id]->harq_processes[0]->b[i]);
|
||||
printf("\n");
|
||||
*/
|
||||
mac_xface->ue_decode_si(phy_vars_ue->Mod_id,
|
||||
CC_id,
|
||||
frame_rx,
|
||||
eNB_id,
|
||||
phy_vars_ue->dlsch_ue_SI[eNB_id]->harq_processes[0]->b,
|
||||
phy_vars_ue->dlsch_ue_SI[eNB_id]->harq_processes[0]->TBS>>3);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3016,8 +2986,7 @@ int phy_procedures_UE_RX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstrac
|
||||
subframe_prev, phy_vars_ue->UE_mode[eNB_id]);
|
||||
#endif
|
||||
|
||||
#ifdef OPENAIR2
|
||||
|
||||
if (phy_vars_ue->mac_enabled == 1) {
|
||||
if ((phy_vars_ue->UE_mode[eNB_id] != PUSCH) && (phy_vars_ue->prach_resources[eNB_id]->Msg3!=NULL)) {
|
||||
LOG_D(PHY,"[UE %d][RAPROC] Frame %d subframe %d Invoking MAC for RAR (current preamble %d)\n",
|
||||
phy_vars_ue->Mod_id,frame_rx-((subframe_prev==9) ? 1 : 0),
|
||||
@@ -3074,14 +3043,13 @@ int phy_procedures_UE_RX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstrac
|
||||
phy_vars_ue->prach_resources[eNB_id]->ra_PreambleIndex);
|
||||
}
|
||||
} // mode != PUSCH
|
||||
|
||||
#else //OPENAIR2
|
||||
|
||||
rar = phy_vars_ue->dlsch_ue_ra[eNB_id]->harq_processes[0]->b+1;
|
||||
timing_advance = ((((uint16_t)(rar[0]&0x7f))<<4) + (rar[1]>>4));
|
||||
//timing_advance = phy_vars_ue->dlsch_ue_ra[eNB_id]->harq_processes[0]->b[0];
|
||||
process_timing_advance_rar(phy_vars_ue,timing_advance);
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
rar = phy_vars_ue->dlsch_ue_ra[eNB_id]->harq_processes[0]->b+1;
|
||||
timing_advance = ((((uint16_t)(rar[0]&0x7f))<<4) + (rar[1]>>4));
|
||||
//timing_advance = phy_vars_ue->dlsch_ue_ra[eNB_id]->harq_processes[0]->b[0];
|
||||
process_timing_advance_rar(phy_vars_ue,timing_advance);
|
||||
}
|
||||
} //ret <= MAX_ITERATIONS
|
||||
|
||||
/*
|
||||
@@ -3633,24 +3601,21 @@ void phy_procedures_UE_lte(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstr
|
||||
int CC_id =0;
|
||||
#endif
|
||||
int frame_rx = phy_vars_ue->frame_rx;
|
||||
#ifdef OPENAIR2
|
||||
int frame_tx = phy_vars_ue->frame_tx;
|
||||
#endif
|
||||
int slot_rx = phy_vars_ue->slot_rx;
|
||||
int slot_tx = phy_vars_ue->slot_tx;
|
||||
int subframe_tx = slot_tx>>1;
|
||||
int subframe_rx = slot_rx>>1;
|
||||
#undef DEBUG_PHY_PROC
|
||||
|
||||
#ifdef OPENAIR2
|
||||
UE_L2_STATE_t ret;
|
||||
#endif
|
||||
#ifndef OPENAIR2
|
||||
phy_vars_ue->UE_mode[eNB_id]=PUSCH;
|
||||
phy_vars_ue->prach_resources[eNB_id] = &prach_resources_local;
|
||||
prach_resources_local.ra_RNTI = 0xbeef;
|
||||
prach_resources_local.ra_PreambleIndex = 0;
|
||||
#endif
|
||||
|
||||
if (phy_vars_ue->mac_enabled == 0) {
|
||||
phy_vars_ue->UE_mode[eNB_id]=PUSCH;
|
||||
phy_vars_ue->prach_resources[eNB_id] = &prach_resources_local;
|
||||
prach_resources_local.ra_RNTI = 0xbeef;
|
||||
prach_resources_local.ra_PreambleIndex = 0;
|
||||
}
|
||||
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_LTE,1);
|
||||
@@ -3849,16 +3814,14 @@ void phy_procedures_UE_lte(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstr
|
||||
phy_procedures_UE_RX(phy_vars_ue,eNB_id,abstraction_flag,mode,r_type,phy_vars_rn);
|
||||
}
|
||||
|
||||
#ifdef OPENAIR2
|
||||
|
||||
if (slot_rx%2==0) {
|
||||
|
||||
ret = mac_xface->ue_scheduler(phy_vars_ue->Mod_id,
|
||||
frame_tx,
|
||||
subframe_rx,
|
||||
subframe_select(&phy_vars_ue->lte_frame_parms,subframe_tx),
|
||||
eNB_id,
|
||||
0/*FIXME CC_id*/);
|
||||
if (phy_vars_ue->mac_enabled==1) {
|
||||
if (slot_rx%2==0) {
|
||||
ret = mac_xface->ue_scheduler(phy_vars_ue->Mod_id,
|
||||
frame_tx,
|
||||
subframe_rx,
|
||||
subframe_select(&phy_vars_ue->lte_frame_parms,subframe_tx),
|
||||
eNB_id,
|
||||
0/*FIXME CC_id*/);
|
||||
|
||||
if (ret == CONNECTION_LOST) {
|
||||
LOG_E(PHY,"[UE %d] Frame %d, subframe %d RRC Connection lost, returning to PRACH\n",phy_vars_ue->Mod_id,
|
||||
@@ -3877,11 +3840,7 @@ void phy_procedures_UE_lte(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstr
|
||||
phy_vars_ue->UE_mode[eNB_id] = PRACH;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
// if (last_slot == 19)
|
||||
// phy_vars_ue->frame++;
|
||||
}
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_LTE,0);
|
||||
stop_meas(&phy_vars_ue->phy_proc);
|
||||
|
||||
@@ -46,16 +46,16 @@ int8_t pucch_power_cntl(PHY_VARS_UE *phy_vars_ue,uint8_t subframe,uint8_t eNB_id
|
||||
{
|
||||
|
||||
int8_t Po_PUCCH;
|
||||
uint8_t harq_pid;
|
||||
//uint8_t harq_pid;
|
||||
|
||||
// P_pucch = P_opucch+ PL + h(nCQI,nHARQ) + delta_pucchF(pucch_fmt) + g(i))
|
||||
//
|
||||
if ((pucch_fmt == pucch_format1a) ||
|
||||
(pucch_fmt == pucch_format1b)) { // Update g_pucch based on TPC/delta_PUCCH received in PDCCH for this process
|
||||
harq_pid = phy_vars_ue->dlsch_ue[eNB_id][0]->harq_ack[subframe].harq_id;
|
||||
//if ((pucch_fmt == pucch_format1a) ||
|
||||
// (pucch_fmt == pucch_format1b)) { // Update g_pucch based on TPC/delta_PUCCH received in PDCCH for this process
|
||||
//harq_pid = phy_vars_ue->dlsch_ue[eNB_id][0]->harq_ack[subframe].harq_id;
|
||||
//this is now done in dci_tools
|
||||
//phy_vars_ue->g_pucch[eNB_id] += phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->delta_PUCCH;
|
||||
}
|
||||
//}
|
||||
|
||||
Po_PUCCH = get_PL(phy_vars_ue->Mod_id,phy_vars_ue->CC_id,eNB_id)+
|
||||
phy_vars_ue->lte_frame_parms.ul_power_control_config_common.p0_NominalPUCCH+
|
||||
|
||||
@@ -81,7 +81,7 @@ int16_t get_hundred_times_delta_IF_eNB(PHY_VARS_eNB *phy_vars_eNB,uint8_t UE_id,
|
||||
//(phy_vars_eNB->ulsch_eNB[UE_id]->harq_processes[harq_pid]->control_only == 1) ? phy_vars_eNB->ulsch_eNB[UE_id]->beta_offset_cqi_times8:8;
|
||||
|
||||
DevAssert( UE_id < NUMBER_OF_UE_MAX );
|
||||
#warning "This condition happens sometimes. Need more investigation" // navid
|
||||
//#warning "This condition happens sometimes. Need more investigation" // navid
|
||||
//DevAssert( MPR_x100/6 < 100 );
|
||||
|
||||
if (phy_vars_eNB->ul_power_control_dedicated[UE_id].deltaMCS_Enabled == 1) {
|
||||
|
||||
@@ -288,7 +288,7 @@ int emu_transport_handle_ue_info(bypass_msg_header_t *messg,
|
||||
n_ue, total_header+total_tbs,total_header,total_tbs);
|
||||
}
|
||||
|
||||
#warning "CC id should be adjusted, set to zero for the moment"
|
||||
//#warning "CC id should be adjusted, set to zero for the moment"
|
||||
memcpy(&UE_transport_info[n_ue][CC_id], UE_info, total_header + total_tbs);
|
||||
|
||||
/* Go to the next UE info */
|
||||
|
||||
@@ -291,7 +291,6 @@ void fill_phy_enb_vars(unsigned int enb_id, uint8_t CC_id,unsigned int next_slot
|
||||
LTE_eNB_DLSCH_t *dlsch_eNB;
|
||||
unsigned short ue_id;
|
||||
uint8_t nb_total_dci;
|
||||
int i;
|
||||
|
||||
// eNB
|
||||
// PBCH : copy payload
|
||||
|
||||
@@ -61,25 +61,7 @@
|
||||
extern unsigned int dlsch_tbs25[27][25],TBStable[27][110];
|
||||
extern unsigned char offset_mumimo_llr_drange_fix;
|
||||
|
||||
#ifdef XFORMS
|
||||
#include "PHY/TOOLS/lte_phy_scope.h"
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
//#define AWGN
|
||||
//#define NO_DCI
|
||||
|
||||
|
||||
|
||||
//#define ABSTRACTION
|
||||
|
||||
/*
|
||||
#define RBmask0 0x00fc00fc
|
||||
#define RBmask1 0x0
|
||||
#define RBmask2 0x0
|
||||
#define RBmask3 0x0
|
||||
*/
|
||||
|
||||
PHY_VARS_eNB *PHY_vars_eNB;
|
||||
PHY_VARS_UE *PHY_vars_UE;
|
||||
@@ -237,10 +219,9 @@ int main(int argc, char **argv)
|
||||
short *uncoded_ber_bit=NULL;
|
||||
uint8_t N_RB_DL=25,osf=1;
|
||||
frame_t frame_type = FDD;
|
||||
#ifdef XFORMS
|
||||
FD_lte_phy_scope_ue *form_ue;
|
||||
int xforms=0;
|
||||
FD_lte_phy_scope_ue *form_ue = NULL;
|
||||
char title[255];
|
||||
#endif
|
||||
uint32_t DLSCH_RB_ALLOC = 0x1fff;
|
||||
int numCCE=0;
|
||||
int dci_length_bytes=0,dci_length=0;
|
||||
@@ -305,7 +286,7 @@ int main(int argc, char **argv)
|
||||
// num_layers = 1;
|
||||
perfect_ce = 0;
|
||||
|
||||
while ((c = getopt (argc, argv, "ahdpZDe:Em:n:o:s:f:t:c:g:r:F:x:y:z:AM:N:I:i:O:R:S:C:T:b:u:v:w:B:PLl:Y")) != -1) {
|
||||
while ((c = getopt (argc, argv, "ahdpZDe:Em:n:o:s:f:t:c:g:r:F:x:y:z:AM:N:I:i:O:R:S:C:T:b:u:v:w:B:PLl:XY")) != -1) {
|
||||
switch (c) {
|
||||
case 'a':
|
||||
awgn_flag = 1;
|
||||
@@ -557,6 +538,10 @@ int main(int argc, char **argv)
|
||||
|
||||
break;
|
||||
|
||||
case 'X':
|
||||
xforms=1;
|
||||
break;
|
||||
|
||||
case 'Y':
|
||||
perfect_ce=1;
|
||||
break;
|
||||
@@ -636,27 +621,36 @@ int main(int argc, char **argv)
|
||||
if ((transmission_mode > 1) && (n_tx != 2))
|
||||
printf("n_tx must be >1 for transmission_mode %d\n",transmission_mode);
|
||||
|
||||
#ifdef XFORMS
|
||||
fl_initialize (&argc, argv, NULL, 0, 0);
|
||||
form_ue = create_lte_phy_scope_ue();
|
||||
sprintf (title, "LTE PHY SCOPE eNB");
|
||||
fl_show_form (form_ue->lte_phy_scope_ue, FL_PLACE_HOTSPOT, FL_FULLBORDER, title);
|
||||
|
||||
if (!dual_stream_UE==0) {
|
||||
openair_daq_vars.use_ia_receiver = 1;
|
||||
fl_set_button(form_ue->button_0,1);
|
||||
fl_set_object_label(form_ue->button_0, "IA Receiver ON");
|
||||
fl_set_object_color(form_ue->button_0, FL_GREEN, FL_GREEN);
|
||||
if (xforms==1) {
|
||||
fl_initialize (&argc, argv, NULL, 0, 0);
|
||||
form_ue = create_lte_phy_scope_ue();
|
||||
sprintf (title, "LTE PHY SCOPE eNB");
|
||||
fl_show_form (form_ue->lte_phy_scope_ue, FL_PLACE_HOTSPOT, FL_FULLBORDER, title);
|
||||
|
||||
if (!dual_stream_UE==0) {
|
||||
openair_daq_vars.use_ia_receiver = 1;
|
||||
fl_set_button(form_ue->button_0,1);
|
||||
fl_set_object_label(form_ue->button_0, "IA Receiver ON");
|
||||
fl_set_object_color(form_ue->button_0, FL_GREEN, FL_GREEN);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
if (transmission_mode==5) {
|
||||
n_users = 2;
|
||||
printf("dual_stream_UE=%d\n", dual_stream_UE);
|
||||
}
|
||||
|
||||
lte_param_init(n_tx,n_rx,transmission_mode,extended_prefix_flag,frame_type,Nid_cell,tdd_config,N_RB_DL,threequarter_fs,osf,perfect_ce);
|
||||
lte_param_init(n_tx,
|
||||
n_rx,
|
||||
transmission_mode,
|
||||
extended_prefix_flag,
|
||||
frame_type,
|
||||
Nid_cell,
|
||||
tdd_config,
|
||||
N_RB_DL,
|
||||
threequarter_fs,
|
||||
osf,
|
||||
perfect_ce);
|
||||
|
||||
|
||||
|
||||
@@ -2630,6 +2624,8 @@ PMI_FEEDBACK:
|
||||
num_pdcch_symbols,
|
||||
PHY_vars_eNB->dlsch_eNB[k][0],
|
||||
PHY_vars_eNB->dlsch_eNB[k][1]);
|
||||
/* avoid gcc warnings */
|
||||
(void)re_allocated;
|
||||
|
||||
stop_meas(&PHY_vars_eNB->dlsch_modulation_stats);
|
||||
/*
|
||||
@@ -3486,13 +3482,13 @@ PMI_FEEDBACK:
|
||||
// PHY_vars_UE->dlsch_ue[0][0]->harq_processes[0]->round++;
|
||||
}
|
||||
|
||||
#ifdef XFORMS
|
||||
phy_scope_UE(form_ue,
|
||||
PHY_vars_UE,
|
||||
eNB_id,
|
||||
0,// UE_id
|
||||
subframe);
|
||||
#endif
|
||||
if (xforms==1) {
|
||||
phy_scope_UE(form_ue,
|
||||
PHY_vars_UE,
|
||||
eNB_id,
|
||||
0,// UE_id
|
||||
subframe);
|
||||
}
|
||||
|
||||
} //round
|
||||
|
||||
|
||||
@@ -128,7 +128,7 @@ int main(int argc, char **argv)
|
||||
|
||||
char c;
|
||||
|
||||
int i,l,aa,aarx,k;
|
||||
int i,l,l2,aa,aarx,k;
|
||||
double sigma2, sigma2_dB=0,SNR,snr0=-2.0,snr1=0.0;
|
||||
uint8_t snr1set=0;
|
||||
double snr_step=1,input_snr_step=1;
|
||||
@@ -173,7 +173,9 @@ int main(int argc, char **argv)
|
||||
|
||||
lte_frame_type_t frame_type = FDD;
|
||||
|
||||
uint32_t Nsoft = 1827072;
|
||||
|
||||
/*
|
||||
#ifdef XFORMS
|
||||
FD_lte_phy_scope_ue *form_ue;
|
||||
char title[255];
|
||||
@@ -183,6 +185,7 @@ int main(int argc, char **argv)
|
||||
sprintf (title, "LTE DL SCOPE UE");
|
||||
fl_show_form (form_ue->lte_phy_scope_ue, FL_PLACE_HOTSPOT, FL_FULLBORDER, title);
|
||||
#endif
|
||||
*/
|
||||
|
||||
logInit();
|
||||
number_of_cards = 1;
|
||||
@@ -334,7 +337,11 @@ int main(int argc, char **argv)
|
||||
else
|
||||
sprintf(fname,"embms_awgn_%d_%d.m",mcs,N_RB_DL);
|
||||
|
||||
fd = fopen(fname,"w");
|
||||
if (!(fd = fopen(fname,"w"))) {
|
||||
printf("Cannot open %s, check permissions\n",fname);
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
|
||||
if (awgn_flag==0)
|
||||
fprintf(fd,"SNR_%d_%d=[];errs_mch_%d_%d=[];mch_trials_%d_%d=[];\n",
|
||||
@@ -382,14 +389,14 @@ int main(int argc, char **argv)
|
||||
0);
|
||||
|
||||
// Create transport channel structures for 2 transport blocks (MIMO)
|
||||
PHY_vars_eNB->dlsch_eNB_MCH = new_eNB_dlsch(1,8,N_RB_DL,0);
|
||||
PHY_vars_eNB->dlsch_eNB_MCH = new_eNB_dlsch(1,8,Nsoft,N_RB_DL,0);
|
||||
|
||||
if (!PHY_vars_eNB->dlsch_eNB_MCH) {
|
||||
printf("Can't get eNB dlsch structures\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
PHY_vars_UE->dlsch_ue_MCH[0] = new_ue_dlsch(1,8,MAX_TURBO_ITERATIONS_MBSFN,N_RB_DL,0);
|
||||
PHY_vars_UE->dlsch_ue_MCH[0] = new_ue_dlsch(1,8,Nsoft,MAX_TURBO_ITERATIONS_MBSFN,N_RB_DL,0);
|
||||
|
||||
PHY_vars_eNB->lte_frame_parms.num_MBSFN_config = 1;
|
||||
PHY_vars_eNB->lte_frame_parms.MBSFN_config[0].radioframeAllocationPeriod = 0;
|
||||
@@ -535,11 +542,25 @@ int main(int argc, char **argv)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
rx_pmch(PHY_vars_UE,
|
||||
0,
|
||||
subframe%10,
|
||||
l);
|
||||
|
||||
if (l==6)
|
||||
for (l2=2;l2<7;l2++)
|
||||
rx_pmch(PHY_vars_UE,
|
||||
0,
|
||||
subframe%10,
|
||||
l2);
|
||||
if (l==6)
|
||||
for (l2=2;l2<7;l2++)
|
||||
rx_pmch(PHY_vars_UE,
|
||||
0,
|
||||
subframe%10,
|
||||
l2);
|
||||
if (l==11)
|
||||
for (l2=7;l2<12;l2++)
|
||||
rx_pmch(PHY_vars_UE,
|
||||
0,
|
||||
subframe%10,
|
||||
l2);
|
||||
}
|
||||
|
||||
PHY_vars_UE->dlsch_ue_MCH[0]->harq_processes[0]->G = get_G(&PHY_vars_UE->lte_frame_parms,
|
||||
@@ -580,10 +601,10 @@ int main(int argc, char **argv)
|
||||
mcs,N_RB_DL,mcs,N_RB_DL,errs[0],
|
||||
mcs,N_RB_DL,mcs,N_RB_DL,trials);
|
||||
else
|
||||
fprintf(fd,"SNR_awgn_%d = [SNR_awgn_%d %d]; errs_mch_awgn_%d =[errs_mch_awgn_%f %d]; mch_trials_awgn_%d =[mch_trials_awgn_%d %d];\n",
|
||||
mcs,N_RB_DL,mcs,N_RB_DL,SNR,
|
||||
mcs,N_RB_DL,mcs,N_RB_DL,errs[0],
|
||||
mcs,N_RB_DL,mcs,N_RB_DL,trials);
|
||||
fprintf(fd,"SNR_awgn_%d = [SNR_awgn_%d %f]; errs_mch_awgn_%d =[errs_mch_awgn_%d %d]; mch_trials_awgn_%d =[mch_trials_awgn_%d %d];\n",
|
||||
N_RB_DL,N_RB_DL,SNR,
|
||||
N_RB_DL,N_RB_DL,errs[0],
|
||||
N_RB_DL,N_RB_DL,trials);
|
||||
|
||||
fflush(fd);
|
||||
|
||||
|
||||
@@ -80,9 +80,9 @@ int main(int argc, char **argv)
|
||||
unsigned char pbch_pdu[6];
|
||||
// int sync_pos, sync_pos_slot;
|
||||
// FILE *rx_frame_file;
|
||||
FILE *output_fd;
|
||||
FILE *output_fd = NULL;
|
||||
uint8_t write_output_file=0;
|
||||
int result;
|
||||
//int result;
|
||||
int freq_offset;
|
||||
// int subframe_offset;
|
||||
// char fname[40], vname[40];
|
||||
@@ -91,8 +91,8 @@ int main(int argc, char **argv)
|
||||
uint16_t Nid_cell=0;
|
||||
|
||||
int n_frames=1;
|
||||
channel_desc_t *eNB2UE,*eNB2UE1,*eNB2UE2;
|
||||
uint32_t nsymb,tx_lev,tx_lev1,tx_lev2;
|
||||
channel_desc_t *eNB2UE,*eNB2UE1 = NULL,*eNB2UE2 = NULL;
|
||||
uint32_t nsymb,tx_lev,tx_lev1 = 0,tx_lev2 = 0;
|
||||
uint8_t extended_prefix_flag=0;
|
||||
int8_t interf1=-21,interf2=-21;
|
||||
LTE_DL_FRAME_PARMS *frame_parms;
|
||||
@@ -104,12 +104,12 @@ int main(int argc, char **argv)
|
||||
char input_val_str[50],input_val_str2[50];
|
||||
// double input_val1,input_val2;
|
||||
// uint16_t amask=0;
|
||||
uint8_t frame_mod4,num_pdcch_symbols;
|
||||
uint8_t frame_mod4,num_pdcch_symbols = 0;
|
||||
uint16_t NB_RB=25;
|
||||
|
||||
SCM_t channel_model=AWGN;//Rayleigh1_anticorr;
|
||||
|
||||
DCI_ALLOC_t dci_alloc[8];
|
||||
//DCI_ALLOC_t dci_alloc[8];
|
||||
uint8_t abstraction_flag=0;//,calibration_flag=0;
|
||||
double pbch_sinr;
|
||||
int pbch_tx_ant;
|
||||
@@ -782,7 +782,10 @@ int main(int argc, char **argv)
|
||||
i=0;
|
||||
|
||||
while (!feof(input_fd)) {
|
||||
fscanf(input_fd,"%s %s",input_val_str,input_val_str2);//&input_val1,&input_val2);
|
||||
if (fscanf(input_fd,"%s %s",input_val_str,input_val_str2) != 2) { //&input_val1,&input_val2);
|
||||
printf("%s:%d:%s: error with fscanf, exiting\n", __FILE__, __LINE__, __FUNCTION__);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if ((i%4)==0) {
|
||||
((short*)txdata[0])[i/2] = (short)((1<<15)*strtod(input_val_str,NULL));
|
||||
|
||||
@@ -67,9 +67,9 @@ DCI_PDU *get_dci(LTE_DL_FRAME_PARMS *lte_frame_parms,uint8_t log2L, uint8_t log2
|
||||
uint32_t UL_alloc_pdu[2];
|
||||
|
||||
int i;
|
||||
int dci_length_bytes,dci_length;
|
||||
int BCCH_pdu_size_bits, BCCH_pdu_size_bytes;
|
||||
int UL_pdu_size_bits, UL_pdu_size_bytes;
|
||||
int dci_length_bytes=0,dci_length=0;
|
||||
int BCCH_pdu_size_bits=0, BCCH_pdu_size_bytes=0;
|
||||
int UL_pdu_size_bits=0, UL_pdu_size_bytes=0;
|
||||
int mcs = 3;
|
||||
|
||||
DCI_pdu.Num_ue_spec_dci = 0;
|
||||
@@ -789,6 +789,11 @@ int main(int argc, char **argv)
|
||||
while (!feof(input_fd)) {
|
||||
ret=fscanf(input_fd,"%s %s",input_val_str,input_val_str2);//&input_val1,&input_val2);
|
||||
|
||||
if (ret != 2) {
|
||||
printf("%s:%d:%s: fscanf error, exiting\n", __FILE__, __LINE__, __FUNCTION__);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if ((i%4)==0) {
|
||||
((short*)txdata[0])[i/2] = (short)((1<<15)*strtod(input_val_str,NULL));
|
||||
((short*)txdata[0])[(i/2)+1] = (short)((1<<15)*strtod(input_val_str2,NULL));
|
||||
|
||||
@@ -58,6 +58,8 @@ PHY_VARS_UE *PHY_vars_UE;
|
||||
|
||||
extern uint16_t prach_root_sequence_map0_3[838];
|
||||
|
||||
void dump_prach_config(LTE_DL_FRAME_PARMS *frame_parms,uint8_t subframe);
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
|
||||
@@ -74,7 +76,7 @@ int main(int argc, char **argv)
|
||||
int **txdata;
|
||||
double **s_re,**s_im,**r_re,**r_im;
|
||||
double iqim=0.0;
|
||||
int trial, ntrials=1;
|
||||
int trial; //, ntrials=1;
|
||||
uint8_t transmission_mode = 1,n_tx=1,n_rx=1;
|
||||
uint16_t Nid_cell=0;
|
||||
|
||||
@@ -82,7 +84,7 @@ int main(int argc, char **argv)
|
||||
uint8_t hs_flag=0;
|
||||
int n_frames=1;
|
||||
channel_desc_t *UE2eNB;
|
||||
uint32_t nsymb,tx_lev,tx_lev_dB;
|
||||
uint32_t nsymb,tx_lev; //,tx_lev_dB;
|
||||
uint8_t extended_prefix_flag=0;
|
||||
// int8_t interf1=-19,interf2=-19;
|
||||
LTE_DL_FRAME_PARMS *frame_parms;
|
||||
@@ -101,8 +103,8 @@ int main(int argc, char **argv)
|
||||
uint16_t preamble_energy_list[64],preamble_tx=99,preamble_delay_list[64];
|
||||
uint16_t preamble_max,preamble_energy_max;
|
||||
PRACH_RESOURCES_t prach_resources;
|
||||
uint8_t prach_fmt;
|
||||
int N_ZC;
|
||||
//uint8_t prach_fmt;
|
||||
//int N_ZC;
|
||||
int delay = 0;
|
||||
double delay_avg=0;
|
||||
double ue_speed = 0;
|
||||
@@ -126,7 +128,8 @@ int main(int argc, char **argv)
|
||||
case 'a':
|
||||
printf("Running AWGN simulation\n");
|
||||
awgn_flag = 1;
|
||||
ntrials=1;
|
||||
/* ntrials not used later, no need to set */
|
||||
//ntrials=1;
|
||||
break;
|
||||
|
||||
case 'd':
|
||||
@@ -404,9 +407,11 @@ int main(int argc, char **argv)
|
||||
PHY_vars_eNB->lte_frame_parms.prach_config_common.prach_ConfigInfo.highSpeedFlag=hs_flag;
|
||||
PHY_vars_eNB->lte_frame_parms.prach_config_common.prach_ConfigInfo.prach_FreqOffset=0;
|
||||
|
||||
prach_fmt = get_prach_fmt(PHY_vars_eNB->lte_frame_parms.prach_config_common.prach_ConfigInfo.prach_ConfigIndex,
|
||||
PHY_vars_eNB->lte_frame_parms.frame_type);
|
||||
N_ZC = (prach_fmt <4)?839:139;
|
||||
/* N_ZC not used later, so prach_fmt is also useless, don't set */
|
||||
//prach_fmt = get_prach_fmt(PHY_vars_eNB->lte_frame_parms.prach_config_common.prach_ConfigInfo.prach_ConfigIndex,
|
||||
// PHY_vars_eNB->lte_frame_parms.frame_type);
|
||||
/* N_ZC not used later, no need to set */
|
||||
//N_ZC = (prach_fmt <4)?839:139;
|
||||
|
||||
compute_prach_seq(&PHY_vars_eNB->lte_frame_parms.prach_config_common,PHY_vars_eNB->lte_frame_parms.frame_type,PHY_vars_eNB->X_u);
|
||||
|
||||
@@ -430,7 +435,8 @@ int main(int argc, char **argv)
|
||||
subframe,
|
||||
0); //Nf
|
||||
|
||||
tx_lev_dB = (unsigned int) dB_fixed(tx_lev);
|
||||
/* tx_lev_dB not used later, no need to set */
|
||||
//tx_lev_dB = (unsigned int) dB_fixed(tx_lev);
|
||||
|
||||
write_output("txsig0_new.m","txs0", &txdata[0][subframe*frame_parms->samples_per_tti],frame_parms->samples_per_tti,1,1);
|
||||
//write_output("txsig1.m","txs1", txdata[1],FRAME_LENGTH_COMPLEX_SAMPLES,1,1);
|
||||
|
||||
@@ -52,9 +52,7 @@
|
||||
#include "LAYER2/MAC/vars.h"
|
||||
#include "OCG_vars.h"
|
||||
|
||||
#ifdef XFORMS
|
||||
#include "PHY/TOOLS/lte_phy_scope.h"
|
||||
#endif
|
||||
|
||||
extern unsigned short dftsizes[33];
|
||||
extern short *ul_ref_sigs[30][2][33];
|
||||
@@ -74,12 +72,9 @@ node_desc_t *ue_data[NUMBER_OF_UE_MAX];
|
||||
extern uint16_t beta_ack[16],beta_ri[16],beta_cqi[16];
|
||||
//extern char* namepointer_chMag ;
|
||||
|
||||
|
||||
|
||||
#ifdef XFORMS
|
||||
int xforms=0;
|
||||
FD_lte_phy_scope_enb *form_enb;
|
||||
char title[255];
|
||||
#endif
|
||||
|
||||
/*the following parameters are used to control the processing times*/
|
||||
double t_tx_max = -1000000000; /*!< \brief initial max process time for tx */
|
||||
@@ -194,6 +189,7 @@ int main(int argc, char **argv)
|
||||
int nb_rb_set = 0;
|
||||
int sf;
|
||||
|
||||
int threequarter_fs=0;
|
||||
opp_enabled=1; // to enable the time meas
|
||||
|
||||
cpu_freq_GHz = (double)get_cpu_freq_GHz();
|
||||
@@ -203,7 +199,7 @@ int main(int argc, char **argv)
|
||||
|
||||
logInit();
|
||||
|
||||
while ((c = getopt (argc, argv, "hapZbm:n:Y:X:x:s:w:e:q:d:D:O:c:r:i:f:y:c:oA:C:R:g:N:l:S:T:QB:PI:L")) != -1) {
|
||||
while ((c = getopt (argc, argv, "hapZEbm:n:Y:X:x:s:w:e:q:d:D:O:c:r:i:f:y:c:oA:C:R:g:N:l:S:T:QB:PI:LF")) != -1) {
|
||||
switch (c) {
|
||||
case 'a':
|
||||
channel_model = AWGN;
|
||||
@@ -373,6 +369,10 @@ int main(int argc, char **argv)
|
||||
cyclic_shift = atoi(optarg);
|
||||
break;
|
||||
|
||||
case 'E':
|
||||
threequarter_fs=1;
|
||||
break;
|
||||
|
||||
case 'N':
|
||||
N0 = atoi(optarg);
|
||||
break;
|
||||
@@ -449,6 +449,10 @@ int main(int argc, char **argv)
|
||||
max_turbo_iterations=atoi(optarg);
|
||||
break;
|
||||
|
||||
case 'F':
|
||||
xforms=1;
|
||||
break;
|
||||
|
||||
case 'Z':
|
||||
dump_table = 1;
|
||||
break;
|
||||
@@ -470,6 +474,7 @@ int main(int argc, char **argv)
|
||||
0,
|
||||
tdd_config,
|
||||
N_RB_DL,
|
||||
threequarter_fs,
|
||||
osf,
|
||||
0);
|
||||
|
||||
@@ -588,12 +593,12 @@ int main(int argc, char **argv)
|
||||
}
|
||||
|
||||
|
||||
#ifdef XFORMS
|
||||
fl_initialize (&argc, argv, NULL, 0, 0);
|
||||
form_enb = create_lte_phy_scope_enb();
|
||||
sprintf (title, "LTE PHY SCOPE eNB");
|
||||
fl_show_form (form_enb->lte_phy_scope_enb, FL_PLACE_HOTSPOT, FL_FULLBORDER, title);
|
||||
#endif
|
||||
if (xforms==1) {
|
||||
fl_initialize (&argc, argv, NULL, 0, 0);
|
||||
form_enb = create_lte_phy_scope_enb();
|
||||
sprintf (title, "LTE PHY SCOPE eNB");
|
||||
fl_show_form (form_enb->lte_phy_scope_enb, FL_PLACE_HOTSPOT, FL_FULLBORDER, title);
|
||||
}
|
||||
|
||||
PHY_vars_UE->lte_ue_pdcch_vars[0]->crnti = 14;
|
||||
|
||||
@@ -1348,9 +1353,9 @@ int main(int argc, char **argv)
|
||||
if ((errs[0]>=100) && (trials>(n_frames/2)))
|
||||
break;
|
||||
|
||||
#ifdef XFORMS
|
||||
phy_scope_eNB(form_enb,PHY_vars_eNB,0);
|
||||
#endif
|
||||
if (xforms==1)
|
||||
phy_scope_eNB(form_enb,PHY_vars_eNB,0);
|
||||
|
||||
/*calculate the total processing time for each packet, get the max, min, and number of packets that exceed t>3000us*/
|
||||
|
||||
double t_tx = (double)PHY_vars_UE->phy_proc_tx.p_time/cpu_freq_GHz/1000.0;
|
||||
|
||||
@@ -48,7 +48,19 @@ Description Contains global common definitions
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
typedef signed char boolean_t;
|
||||
|
||||
#if !defined(TRUE)
|
||||
#define TRUE (boolean_t)0x01
|
||||
#endif
|
||||
|
||||
#if !defined(FALSE)
|
||||
#define FALSE (boolean_t)0x00
|
||||
#endif
|
||||
|
||||
#define BOOL_NOT(b) (b^TRUE)
|
||||
|
||||
#define NAS_UE_ID_FMT "0x%06x"
|
||||
|
||||
@@ -59,13 +71,6 @@ Description Contains global common definitions
|
||||
#define RETURNok (0)
|
||||
#define RETURNerror (-1)
|
||||
|
||||
#ifndef FALSE
|
||||
#define FALSE (0)
|
||||
#endif
|
||||
#ifndef TRUE
|
||||
#define TRUE (1)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Name of the environment variable which defines the default directory
|
||||
* where the NAS application is executed and where are located files
|
||||
|
||||
@@ -41,7 +41,13 @@
|
||||
#if !defined (msg)
|
||||
# define msg(aRGS...) LOG_D(PHY, ##aRGS)
|
||||
#endif
|
||||
#define malloc16(x) memalign(16,x) //malloc(x)
|
||||
#ifndef malloc16
|
||||
# ifdef __AVX2__
|
||||
# define malloc16(x) memalign(32,x)
|
||||
# else
|
||||
# define malloc16(x) memalign(16,x)
|
||||
# endif
|
||||
#endif
|
||||
#define free16(y,x) free(y)
|
||||
#define bigmalloc malloc
|
||||
#define bigmalloc16 malloc16
|
||||
|
||||
@@ -112,7 +112,7 @@ typedef struct net_ip_address_s {
|
||||
unsigned ipv4:1;
|
||||
unsigned ipv6:1;
|
||||
char ipv4_address[16];
|
||||
char ipv6_address[40];
|
||||
char ipv6_address[46];
|
||||
} net_ip_address_t;
|
||||
|
||||
typedef uint64_t bitrate_t;
|
||||
|
||||
@@ -285,6 +285,9 @@ void *eNB_app_task(void *args_p)
|
||||
instance_t instance;
|
||||
int result;
|
||||
|
||||
/* for no gcc warnings */
|
||||
(void)instance;
|
||||
|
||||
itti_mark_task_ready (TASK_ENB_APP);
|
||||
|
||||
# if defined(ENABLE_USE_MME)
|
||||
@@ -420,5 +423,8 @@ void *eNB_app_task(void *args_p)
|
||||
|
||||
#endif
|
||||
|
||||
/* for no gcc warnings */
|
||||
(void)enb_properties_p;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -176,8 +176,12 @@
|
||||
#define ENB_CONFIG_STRING_RRH_GW_REMOTE_ADDRESS "remote_address"
|
||||
#define ENB_CONFIG_STRING_RRH_GW_LOCAL_PORT "local_port"
|
||||
#define ENB_CONFIG_STRING_RRH_GW_REMOTE_PORT "remote_port"
|
||||
#define ENB_CONFIG_STRING_RRH_GW_ACTIVE "active"
|
||||
#define ENB_CONFIG_STRING_RRH_GW_PREFERENCE "preference"
|
||||
#define ENB_CONFIG_STRING_RRH_GW_ACTIVE "rrh_gw_active"
|
||||
#define ENB_CONFIG_STRING_RRH_GW_TRANSPORT_PREFERENCE "tr_preference"
|
||||
#define ENB_CONFIG_STRING_RRH_GW_RF_TARGET_PREFERENCE "rf_preference"
|
||||
#define ENB_CONFIG_STRING_RRH_GW_IQ_TXSHIFT "iq_txshift"
|
||||
#define ENB_CONFIG_STRING_RRH_GW_TX_SAMPLE_ADVANCE "tx_sample_advance"
|
||||
#define ENB_CONFIG_STRING_RRH_GW_TX_SCHEDULING_ADVANCE "tx_scheduling_advance"
|
||||
|
||||
#define ENB_CONFIG_STRING_ASN1_VERBOSITY "Asn1_verbosity"
|
||||
#define ENB_CONFIG_STRING_ASN1_VERBOSITY_NONE "none"
|
||||
@@ -261,7 +265,7 @@ static const eutra_band_t eutra_bands[] = {
|
||||
|
||||
Enb_properties_array_t enb_properties;
|
||||
|
||||
static void enb_config_display(void)
|
||||
void enb_config_display(void)
|
||||
{
|
||||
int i,j;
|
||||
|
||||
@@ -291,7 +295,23 @@ static void enb_config_display(void)
|
||||
printf( "\tlocal port : \t%d:\n",enb_properties.properties[i]->rrh_gw_config[j].local_port);
|
||||
printf( "\tremote address : \t%s:\n",enb_properties.properties[i]->rrh_gw_config[j].remote_address);
|
||||
printf( "\tremote port : \t%d:\n",enb_properties.properties[i]->rrh_gw_config[j].remote_port);
|
||||
printf( "\ttransport : \t%s Ethernet:\n\n",(enb_properties.properties[i]->rrh_gw_config[j].raw == 1)? "RAW" : "UDP");
|
||||
printf( "\ttx_scheduling_advance :\t%d:\n",enb_properties.properties[i]->rrh_gw_config[j].tx_scheduling_advance);
|
||||
printf( "\ttx_sample_advance : \t%d:\n",enb_properties.properties[i]->rrh_gw_config[j].tx_sample_advance);
|
||||
printf( "\tiq_txshift : \t%d:\n",enb_properties.properties[i]->rrh_gw_config[j].iq_txshift);
|
||||
printf( "\ttransport : \t%s Ethernet:\n",(enb_properties.properties[i]->rrh_gw_config[j].raw == 1)? "RAW" : "UDP");
|
||||
if (enb_properties.properties[i]->rrh_gw_config[j].exmimo == 1) {
|
||||
printf( "\tRF target : \tEXMIMO:\n\n");
|
||||
} else if (enb_properties.properties[i]->rrh_gw_config[j].usrp_b200 == 1) {
|
||||
printf( "\tRF target : \tUSRP_B200:\n\n");
|
||||
} else if (enb_properties.properties[i]->rrh_gw_config[j].usrp_x300 == 1) {
|
||||
printf( "\tRF target : \tUSRP_X300:\n\n");
|
||||
} else if (enb_properties.properties[i]->rrh_gw_config[j].bladerf == 1) {
|
||||
printf( "\tRF target : \tBLADERF:\n\n");
|
||||
} else if (enb_properties.properties[i]->rrh_gw_config[j].lmssdr == 1) {
|
||||
printf( "\tRF target : \tLMSSDR:\n\n");
|
||||
} else {
|
||||
printf( "\tRF target : \tNONE:\n\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -479,14 +499,14 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP)
|
||||
config_setting_t *setting_rrh_gw = NULL;
|
||||
config_setting_t *setting_enb = NULL;
|
||||
config_setting_t *setting_otg = NULL;
|
||||
config_setting_t *subsetting_otg = NULL;
|
||||
config_setting_t *subsetting_otg = NULL;
|
||||
int num_enb_properties = 0;
|
||||
int enb_properties_index = 0;
|
||||
int num_enbs = 0;
|
||||
int num_mme_address = 0;
|
||||
int num_rrh_gw = 0;
|
||||
int num_otg_elements =0;
|
||||
int num_component_carriers =0;
|
||||
int num_otg_elements = 0;
|
||||
int num_component_carriers = 0;
|
||||
int i = 0;
|
||||
int j = 0;
|
||||
int parse_errors = 0;
|
||||
@@ -542,9 +562,9 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP)
|
||||
const char* pusch_alpha = NULL;
|
||||
libconfig_int pucch_p0_Nominal = 0;
|
||||
libconfig_int msg3_delta_Preamble = 0;
|
||||
libconfig_int ul_CyclicPrefixLength = 0;
|
||||
//libconfig_int ul_CyclicPrefixLength = 0;
|
||||
const char* pucch_deltaF_Format1 = NULL;
|
||||
const char* pucch_deltaF_Format1a = NULL;
|
||||
//const char* pucch_deltaF_Format1a = NULL;
|
||||
const char* pucch_deltaF_Format1b = NULL;
|
||||
const char* pucch_deltaF_Format2 = NULL;
|
||||
const char* pucch_deltaF_Format2a = NULL;
|
||||
@@ -588,6 +608,12 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP)
|
||||
char* ipv6 = NULL;
|
||||
char* active = NULL;
|
||||
char* preference = NULL;
|
||||
|
||||
char* tr_preference = NULL;
|
||||
char* rf_preference = NULL;
|
||||
libconfig_int tx_scheduling_advance = 0;
|
||||
libconfig_int tx_sample_advance = 0;
|
||||
libconfig_int iq_txshift = 0;
|
||||
libconfig_int local_port = 0;
|
||||
libconfig_int remote_port = 0;
|
||||
const char* active_enb[MAX_ENB];
|
||||
@@ -623,6 +649,10 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP)
|
||||
char* osa_log_level = NULL;
|
||||
char* osa_log_verbosity = NULL;
|
||||
|
||||
/* for no gcc warnings */
|
||||
(void)astring;
|
||||
(void)my_int;
|
||||
|
||||
memset((char*) (enb_properties.properties), 0 , MAX_ENB * sizeof(Enb_properties_t *));
|
||||
memset((char*)active_enb, 0 , MAX_ENB * sizeof(char*));
|
||||
|
||||
@@ -993,7 +1023,7 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP)
|
||||
|
||||
enb_properties.properties[enb_properties_index]->prach_zero_correlation[j] =prach_zero_correlation;
|
||||
|
||||
if ((prach_zero_correlation <0) || (prach_zero_correlation > 63))
|
||||
if ((prach_zero_correlation <0) || (prach_zero_correlation > 15))
|
||||
AssertError (0, parse_errors ++,
|
||||
"Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for prach_zero_correlation choice: 0..15!\n",
|
||||
lib_config_file_name_pP, i, prach_zero_correlation);
|
||||
@@ -2180,7 +2210,11 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP)
|
||||
&& config_setting_lookup_int(setting_rrh_gw, ENB_CONFIG_STRING_RRH_GW_LOCAL_PORT, &local_port)
|
||||
&& config_setting_lookup_int(setting_rrh_gw, ENB_CONFIG_STRING_RRH_GW_REMOTE_PORT, &remote_port)
|
||||
&& config_setting_lookup_string(setting_rrh_gw, ENB_CONFIG_STRING_RRH_GW_ACTIVE, (const char **)&active)
|
||||
&& config_setting_lookup_string(setting_rrh_gw, ENB_CONFIG_STRING_RRH_GW_PREFERENCE, (const char **)&preference)
|
||||
&& config_setting_lookup_string(setting_rrh_gw, ENB_CONFIG_STRING_RRH_GW_TRANSPORT_PREFERENCE, (const char **)&tr_preference)
|
||||
&& config_setting_lookup_string(setting_rrh_gw, ENB_CONFIG_STRING_RRH_GW_RF_TARGET_PREFERENCE, (const char **)&rf_preference)
|
||||
&& config_setting_lookup_int(setting_rrh_gw, ENB_CONFIG_STRING_RRH_GW_IQ_TXSHIFT, &iq_txshift)
|
||||
&& config_setting_lookup_int(setting_rrh_gw, ENB_CONFIG_STRING_RRH_GW_TX_SAMPLE_ADVANCE, &tx_sample_advance)
|
||||
&& config_setting_lookup_int(setting_rrh_gw, ENB_CONFIG_STRING_RRH_GW_TX_SCHEDULING_ADVANCE, &tx_scheduling_advance)
|
||||
)
|
||||
) {
|
||||
AssertError (0, parse_errors ++,
|
||||
@@ -2194,21 +2228,43 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP)
|
||||
enb_properties.properties[enb_properties_index]->rrh_gw_if_name = strdup(if_name);
|
||||
enb_properties.properties[enb_properties_index]->rrh_gw_config[j].local_address = strdup(ipv4);
|
||||
enb_properties.properties[enb_properties_index]->rrh_gw_config[j].remote_address = strdup(ipv4_remote);
|
||||
enb_properties.properties[enb_properties_index]->rrh_gw_config[j].local_port= local_port;
|
||||
enb_properties.properties[enb_properties_index]->rrh_gw_config[j].remote_port= remote_port;
|
||||
enb_properties.properties[enb_properties_index]->rrh_gw_config[j].local_port = local_port;
|
||||
enb_properties.properties[enb_properties_index]->rrh_gw_config[j].remote_port = remote_port;
|
||||
enb_properties.properties[enb_properties_index]->rrh_gw_config[j].iq_txshift = iq_txshift;
|
||||
enb_properties.properties[enb_properties_index]->rrh_gw_config[j].tx_sample_advance = tx_sample_advance;
|
||||
enb_properties.properties[enb_properties_index]->rrh_gw_config[j].tx_scheduling_advance= tx_scheduling_advance;
|
||||
|
||||
if (strcmp(active, "yes") == 0) {
|
||||
enb_properties.properties[enb_properties_index]->rrh_gw_config[j].active = 1;
|
||||
}
|
||||
|
||||
if (strcmp(preference, "udp") == 0) {
|
||||
if (strcmp(tr_preference, "udp") == 0) {
|
||||
enb_properties.properties[enb_properties_index]->rrh_gw_config[j].udp = 1;
|
||||
} else if (strcmp(preference, "raw") == 0) {
|
||||
} else if (strcmp(tr_preference, "raw") == 0) {
|
||||
enb_properties.properties[enb_properties_index]->rrh_gw_config[j].raw = 1;
|
||||
} else {//if (strcmp(preference, "no") == 0)
|
||||
enb_properties.properties[enb_properties_index]->rrh_gw_config[j].udp = 1;
|
||||
enb_properties.properties[enb_properties_index]->rrh_gw_config[j].raw = 1;
|
||||
}
|
||||
|
||||
if (strcmp(rf_preference, "exmimo") == 0) {
|
||||
enb_properties.properties[enb_properties_index]->rrh_gw_config[j].exmimo = 1;
|
||||
} else if (strcmp(rf_preference, "usrp_b200") == 0) {
|
||||
enb_properties.properties[enb_properties_index]->rrh_gw_config[j].usrp_b200 = 1;
|
||||
} else if (strcmp(rf_preference, "usrp_x300") == 0) {
|
||||
enb_properties.properties[enb_properties_index]->rrh_gw_config[j].usrp_x300 = 1;
|
||||
} else if (strcmp(rf_preference, "bladerf") == 0) {
|
||||
enb_properties.properties[enb_properties_index]->rrh_gw_config[j].bladerf = 1;
|
||||
} else if (strcmp(rf_preference, "bladerf") == 0) {
|
||||
enb_properties.properties[enb_properties_index]->rrh_gw_config[j].lmssdr = 1;
|
||||
} else {//if (strcmp(preference, "no") == 0)
|
||||
enb_properties.properties[enb_properties_index]->rrh_gw_config[j].exmimo = 1;
|
||||
enb_properties.properties[enb_properties_index]->rrh_gw_config[j].usrp_b200 = 1;
|
||||
enb_properties.properties[enb_properties_index]->rrh_gw_config[j].usrp_x300 = 1;
|
||||
enb_properties.properties[enb_properties_index]->rrh_gw_config[j].bladerf = 1;
|
||||
enb_properties.properties[enb_properties_index]->rrh_gw_config[j].lmssdr = 1;
|
||||
|
||||
}
|
||||
}
|
||||
} else {
|
||||
enb_properties.properties[enb_properties_index]->nb_rrh_gw = 0;
|
||||
@@ -2220,6 +2276,14 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP)
|
||||
enb_properties.properties[enb_properties_index]->rrh_gw_config[j].active = 0;
|
||||
enb_properties.properties[enb_properties_index]->rrh_gw_config[j].udp = 0;
|
||||
enb_properties.properties[enb_properties_index]->rrh_gw_config[j].raw = 0;
|
||||
enb_properties.properties[enb_properties_index]->rrh_gw_config[j].tx_scheduling_advance = 0;
|
||||
enb_properties.properties[enb_properties_index]->rrh_gw_config[j].tx_sample_advance = 0;
|
||||
enb_properties.properties[enb_properties_index]->rrh_gw_config[j].iq_txshift = 0;
|
||||
enb_properties.properties[enb_properties_index]->rrh_gw_config[j].exmimo = 0;
|
||||
enb_properties.properties[enb_properties_index]->rrh_gw_config[j].usrp_b200 = 0;
|
||||
enb_properties.properties[enb_properties_index]->rrh_gw_config[j].usrp_x300 = 0;
|
||||
enb_properties.properties[enb_properties_index]->rrh_gw_config[j].bladerf = 0;
|
||||
enb_properties.properties[enb_properties_index]->rrh_gw_config[j].lmssdr = 0;
|
||||
}
|
||||
|
||||
// SCTP SETTING
|
||||
|
||||
@@ -86,7 +86,14 @@ typedef struct rrh_gw_config_s {
|
||||
char *remote_address;
|
||||
uint16_t local_port;
|
||||
uint16_t remote_port;
|
||||
|
||||
int tx_scheduling_advance;
|
||||
int tx_sample_advance;
|
||||
int iq_txshift;
|
||||
unsigned exmimo:1;
|
||||
unsigned usrp_b200:1;
|
||||
unsigned usrp_x300:1;
|
||||
unsigned bladerf:1;
|
||||
unsigned lmssdr:1;
|
||||
} rrh_gw_config_t;
|
||||
|
||||
typedef struct Enb_properties_s {
|
||||
@@ -257,6 +264,7 @@ typedef struct Enb_properties_array_s {
|
||||
Enb_properties_t *properties[MAX_ENB];
|
||||
} Enb_properties_array_t;
|
||||
|
||||
void enb_config_display(void);
|
||||
const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP);
|
||||
|
||||
const Enb_properties_array_t *enb_config_get(void);
|
||||
|
||||
@@ -275,7 +275,7 @@ rrc_mac_config_req(
|
||||
if (eNB_flagP==1) {
|
||||
mac_xface->phy_config_dedicated_scell_eNB(Mod_id,UE_RNTI(Mod_id,UE_id),sCellToAddMod_r10,1);
|
||||
} else {
|
||||
#warning "phy_config_dedicated_scell_ue is empty"
|
||||
//#warning "phy_config_dedicated_scell_ue is empty"
|
||||
mac_xface->phy_config_dedicated_scell_ue(Mod_id,eNB_index,sCellToAddMod_r10,1);
|
||||
UE_mac_inst[Mod_id].physicalConfigDedicatedSCell_r10 = sCellToAddMod_r10->radioResourceConfigDedicatedSCell_r10->physicalConfigDedicatedSCell_r10; // using SCell index 0
|
||||
}
|
||||
|
||||
@@ -86,7 +86,7 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
|
||||
int mbsfn_status[MAX_NUM_CCs];
|
||||
protocol_ctxt_t ctxt;
|
||||
#ifdef EXMIMO
|
||||
int ret;
|
||||
//int ret;
|
||||
#endif
|
||||
#if defined(ENABLE_ITTI)
|
||||
MessageDef *msg_p;
|
||||
|
||||
@@ -85,9 +85,9 @@ schedule_SI(
|
||||
int CC_id;
|
||||
eNB_MAC_INST *eNB = &eNB_mac_inst[module_idP];
|
||||
uint8_t *vrb_map;
|
||||
int first_rb;
|
||||
int first_rb = -1;
|
||||
int rballoc[MAX_NUM_CCs];
|
||||
int sizeof1A_bytes,sizeof1A_bits;
|
||||
int sizeof1A_bytes,sizeof1A_bits = -1;
|
||||
DCI_PDU *DCI_pdu;
|
||||
|
||||
start_meas(&eNB->schedule_si);
|
||||
|
||||
@@ -1125,7 +1125,7 @@ schedule_ue_spec(
|
||||
if (frame_parms[CC_id]->frame_type == TDD) {
|
||||
UE_list->UE_template[CC_id][UE_id].DAI++;
|
||||
// printf("DAI update: subframeP %d: UE %d, DAI %d\n",subframeP,UE_id,UE_list->UE_template[CC_id][UE_id].DAI);
|
||||
#warning only for 5MHz channel
|
||||
//#warning only for 5MHz channel
|
||||
update_ul_dci(module_idP,CC_id,rnti,UE_list->UE_template[CC_id][UE_id].DAI);
|
||||
}
|
||||
|
||||
@@ -1488,23 +1488,23 @@ fill_DLSCH_dci(
|
||||
|
||||
// loop over all allocated UEs and compute frequency allocations for PDSCH
|
||||
int UE_id = -1;
|
||||
uint8_t first_rb,nb_rb=3;
|
||||
uint8_t /* first_rb, */ nb_rb=3;
|
||||
rnti_t rnti;
|
||||
unsigned char *vrb_map;
|
||||
//unsigned char *vrb_map;
|
||||
uint8_t rballoc_sub[25];
|
||||
//uint8_t number_of_subbands=13;
|
||||
|
||||
unsigned char round;
|
||||
//unsigned char round;
|
||||
unsigned char harq_pid;
|
||||
void *DLSCH_dci=NULL;
|
||||
DCI_PDU *DCI_pdu;
|
||||
int i;
|
||||
void *BCCH_alloc_pdu;
|
||||
//void *BCCH_alloc_pdu;
|
||||
int size_bits,size_bytes;
|
||||
int CC_id;
|
||||
eNB_MAC_INST *eNB =&eNB_mac_inst[module_idP];
|
||||
UE_list_t *UE_list = &eNB->UE_list;
|
||||
RA_TEMPLATE *RA_template;
|
||||
//RA_TEMPLATE *RA_template;
|
||||
|
||||
start_meas(&eNB->fill_DLSCH_dci);
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_FILL_DLSCH_DCI,VCD_FUNCTION_IN);
|
||||
|
||||
@@ -666,7 +666,7 @@ MCH_PDU *get_mch_sdu(module_id_t module_idP, int CC_id, frame_t frameP, sub_fram
|
||||
{
|
||||
// eNB_mac_inst[module_idP].MCH_pdu.mcs=0;
|
||||
//LOG_D(MAC," MCH_pdu.mcs is %d\n", eNB_mac_inst[module_idP].MCH_pdu.mcs);
|
||||
#warning "MCH pdu should take the CC_id index"
|
||||
//#warning "MCH pdu should take the CC_id index"
|
||||
return(&eNB_mac_inst[module_idP].common_channels[CC_id].MCH_pdu);
|
||||
}
|
||||
|
||||
|
||||
@@ -1082,7 +1082,7 @@ boolean_t CCE_allocation_infeasible(int module_idP,
|
||||
|
||||
|
||||
DCI_PDU *DCI_pdu = &eNB_mac_inst[module_idP].common_channels[CC_idP].DCI_pdu;
|
||||
DCI_ALLOC_t *dci_alloc;
|
||||
//DCI_ALLOC_t *dci_alloc;
|
||||
int ret;
|
||||
boolean_t res=FALSE;
|
||||
|
||||
|
||||
@@ -229,6 +229,12 @@ void rx_sdu(
|
||||
|
||||
switch (rx_lcids[i]) {
|
||||
case CCCH :
|
||||
if (rx_lengths[i] > CCCH_PAYLOAD_SIZE_MAX) {
|
||||
LOG_E(MAC, "[eNB %d/%d] frame %d received CCCH of size %d (too big, maximum allowed is %d), dropping packet\n",
|
||||
enb_mod_idP, CC_idP, frameP, rx_lengths[i], CCCH_PAYLOAD_SIZE_MAX);
|
||||
break;
|
||||
}
|
||||
|
||||
LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, Received CCCH: %x.%x.%x.%x.%x.%x, Terminating RA procedure for UE rnti %x\n",
|
||||
enb_mod_idP,CC_idP,frameP,
|
||||
payload_ptr[0],payload_ptr[1],payload_ptr[2],payload_ptr[3],payload_ptr[4], payload_ptr[5], rntiP);
|
||||
@@ -302,26 +308,23 @@ void rx_sdu(
|
||||
#endif
|
||||
|
||||
if (UE_id != -1) {
|
||||
// This check is just to make sure we didn't get a bogus SDU length, to be removed ...
|
||||
if (rx_lengths[i]<CCCH_PAYLOAD_SIZE_MAX) {
|
||||
LOG_D(MAC,"[eNB %d] CC_id %d Frame %d : ULSCH -> UL-DCCH, received %d bytes form UE %d on LCID %d \n",
|
||||
enb_mod_idP,CC_idP,frameP, rx_lengths[i], UE_id, rx_lcids[i]);
|
||||
LOG_D(MAC,"[eNB %d] CC_id %d Frame %d : ULSCH -> UL-DCCH, received %d bytes form UE %d on LCID %d \n",
|
||||
enb_mod_idP,CC_idP,frameP, rx_lengths[i], UE_id, rx_lcids[i]);
|
||||
|
||||
mac_rlc_data_ind(
|
||||
enb_mod_idP,
|
||||
rntiP,
|
||||
enb_mod_idP,
|
||||
frameP,
|
||||
ENB_FLAG_YES,
|
||||
MBMS_FLAG_NO,
|
||||
rx_lcids[i],
|
||||
(char *)payload_ptr,
|
||||
rx_lengths[i],
|
||||
1,
|
||||
NULL);//(unsigned int*)crc_status);
|
||||
UE_list->eNB_UE_stats[CC_idP][UE_id].num_pdu_rx[rx_lcids[i]]+=1;
|
||||
UE_list->eNB_UE_stats[CC_idP][UE_id].num_bytes_rx[rx_lcids[i]]+=rx_lengths[i];
|
||||
}
|
||||
mac_rlc_data_ind(
|
||||
enb_mod_idP,
|
||||
rntiP,
|
||||
enb_mod_idP,
|
||||
frameP,
|
||||
ENB_FLAG_YES,
|
||||
MBMS_FLAG_NO,
|
||||
rx_lcids[i],
|
||||
(char *)payload_ptr,
|
||||
rx_lengths[i],
|
||||
1,
|
||||
NULL);//(unsigned int*)crc_status);
|
||||
UE_list->eNB_UE_stats[CC_idP][UE_id].num_pdu_rx[rx_lcids[i]]+=1;
|
||||
UE_list->eNB_UE_stats[CC_idP][UE_id].num_bytes_rx[rx_lcids[i]]+=rx_lengths[i];
|
||||
} /* UE_id != -1 */
|
||||
|
||||
// }
|
||||
|
||||
@@ -47,8 +47,8 @@ int8_t get_Po_NOMINAL_PUSCH(module_id_t module_idP,uint8_t CC_id)
|
||||
|
||||
if (CC_id>0) {
|
||||
LOG_E(MAC,"Transmission on secondary CCs is not supported yet\n");
|
||||
mac_xface->macphy_exit("MAC FATAL CC_id>0");
|
||||
return 0; // not reached
|
||||
//mac_xface->macphy_exit("MAC FATAL CC_id>0");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (UE_mac_inst[module_idP].radioResourceConfigCommon) {
|
||||
@@ -56,7 +56,8 @@ int8_t get_Po_NOMINAL_PUSCH(module_id_t module_idP,uint8_t CC_id)
|
||||
}
|
||||
else {
|
||||
LOG_E(MAC,"[UE %d] CCid %d FATAL radioResourceConfigCommon is NULL !!!\n",module_idP,CC_id);
|
||||
mac_xface->macphy_exit("FATAL radioResourceConfigCommon is NULL");
|
||||
//mac_xface->macphy_exit("FATAL radioResourceConfigCommon is NULL");
|
||||
return 0;
|
||||
}
|
||||
|
||||
return(-120 + (rach_ConfigCommon->powerRampingParameters.preambleInitialReceivedTargetPower<<1) +
|
||||
|
||||
@@ -748,10 +748,10 @@ void dlsch_scheduler_pre_processor_reset (int module_idP,
|
||||
UE_list_t *UE_list=&eNB_mac_inst[module_idP].UE_list;
|
||||
UE_sched_ctrl *ue_sched_ctl = &UE_list->UE_sched_ctrl[UE_id];
|
||||
rnti_t rnti = UE_RNTI(module_idP,UE_id);
|
||||
uint8_t *vrb_map = &eNB_mac_inst[module_idP].common_channels[CC_id].vrb_map;
|
||||
uint8_t *vrb_map = eNB_mac_inst[module_idP].common_channels[CC_id].vrb_map;
|
||||
int RBGsize = PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL/N_RBG;
|
||||
#ifdef SF05_LIMIT
|
||||
int subframe05_limit=0;
|
||||
//int subframe05_limit=0;
|
||||
int sf05_upper=-1,sf05_lower=-1;
|
||||
#endif
|
||||
LTE_eNB_UE_stats *eNB_UE_stats = mac_xface->get_eNB_UE_stats(module_idP,CC_id,rnti);
|
||||
@@ -1085,7 +1085,7 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP,
|
||||
void store_ulsch_buffer(module_id_t module_idP, int frameP, sub_frame_t subframeP)
|
||||
{
|
||||
|
||||
int UE_id,pCC_id,lcgid;
|
||||
int UE_id, /* pCC_id, */ lcgid;
|
||||
UE_list_t *UE_list = &eNB_mac_inst[module_idP].UE_list;
|
||||
UE_TEMPLATE *UE_template;
|
||||
|
||||
@@ -1231,7 +1231,7 @@ void sort_ue_ul (module_id_t module_idP,int frameP, sub_frame_t subframeP)
|
||||
int UE_id1,UE_id2;
|
||||
int pCCid1,pCCid2;
|
||||
int round1,round2;
|
||||
int i=0,ii=0,j=0;
|
||||
int i=0,ii=0;
|
||||
rnti_t rnti1,rnti2;
|
||||
|
||||
UE_list_t *UE_list = &eNB_mac_inst[module_idP].UE_list;
|
||||
|
||||
@@ -777,6 +777,7 @@ rrc_get_estimated_ue_distance(
|
||||
const int CC_idP,
|
||||
const uint8_t loc_typeP);
|
||||
|
||||
void fill_dci(DCI_PDU *DCI_pdu, uint8_t sched_subframe, PHY_VARS_eNB *phy_vars_eNB);
|
||||
|
||||
#endif
|
||||
/** @}*/
|
||||
|
||||
@@ -152,6 +152,9 @@ void get_prach_resources(module_id_t module_idP,
|
||||
}
|
||||
}
|
||||
|
||||
/* TODO: gcc warns if this variable is not always set, let's put -1 for no more warning */
|
||||
messageSizeGroupA = -1;
|
||||
|
||||
if (!rach_ConfigCommon->preambleInfo.preamblesGroupAConfig) {
|
||||
noGroupB = 1;
|
||||
} else {
|
||||
@@ -171,6 +174,8 @@ void get_prach_resources(module_id_t module_idP,
|
||||
break;
|
||||
}
|
||||
|
||||
/* TODO: what value to use as default? */
|
||||
messagePowerOffsetGroupB = -9999;
|
||||
switch (rach_ConfigCommon->preambleInfo.preamblesGroupAConfig->messagePowerOffsetGroupB) {
|
||||
case 0:
|
||||
messagePowerOffsetGroupB = -9999;
|
||||
@@ -495,7 +500,7 @@ PRACH_RESOURCES_t *ue_get_rach(module_id_t module_idP,int CC_id,frame_t frameP,
|
||||
UE_mac_inst[module_idP].RA_PREAMBLE_TRANSMISSION_COUNTER++;
|
||||
UE_mac_inst[module_idP].RA_prach_resources.ra_PREAMBLE_RECEIVED_TARGET_POWER +=
|
||||
(rach_ConfigCommon->powerRampingParameters.powerRampingStep<<1); // 2dB increments in ASN.1 definition
|
||||
int preambleTransMax;
|
||||
int preambleTransMax = -1;
|
||||
switch (rach_ConfigCommon->ra_SupervisionInfo.preambleTransMax) {
|
||||
case RACH_ConfigCommon__ra_SupervisionInfo__preambleTransMax_n3:
|
||||
preambleTransMax = 3;
|
||||
|
||||
@@ -692,7 +692,7 @@ pdcp_data_ind(
|
||||
#if defined(USER_MODE) && defined(OAI_EMU)
|
||||
|
||||
if (oai_emulation.info.otg_enabled == 1) {
|
||||
unsigned int dst_instance;
|
||||
//unsigned int dst_instance;
|
||||
int ctime;
|
||||
|
||||
if ((pdcp_p->rlc_mode == RLC_MODE_AM)&&(MBMS_flagP==0) ) {
|
||||
@@ -1032,6 +1032,8 @@ pdcp_remove_UE(
|
||||
|
||||
}
|
||||
|
||||
(void)h_rc; /* remove gcc warning "set but not used" */
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -1486,7 +1488,7 @@ pdcp_config_req_asn1 (
|
||||
|
||||
case CONFIG_ACTION_REMOVE:
|
||||
DevAssert(pdcp_pP != NULL);
|
||||
#warning "TODO pdcp_module_id_to_rnti"
|
||||
//#warning "TODO pdcp_module_id_to_rnti"
|
||||
//pdcp_module_id_to_rnti[ctxt_pP.module_id ][dst_id] = NOT_A_RNTI;
|
||||
LOG_D(PDCP, PROTOCOL_PDCP_CTXT_FMT" CONFIG_ACTION_REMOVE LCID %d RBID %d configured\n",
|
||||
PROTOCOL_PDCP_CTXT_ARGS(ctxt_pP,pdcp_pP),
|
||||
|
||||
@@ -313,6 +313,8 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t* const ctxt_pP)
|
||||
hash_key_t key = HASHTABLE_NOT_A_KEY_VALUE;
|
||||
hashtable_rc_t h_rc;
|
||||
struct pdcp_netlink_element_s* data_p = NULL;
|
||||
/* avoid gcc warnings */
|
||||
(void)data_p;
|
||||
module_id_t ue_id = 0;
|
||||
pdcp_t* pdcp_p = NULL;
|
||||
# if defined(PDCP_USE_NETLINK_QUEUES)
|
||||
@@ -482,7 +484,7 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t* const ctxt_pP)
|
||||
ctxt.enb_flag = ENB_FLAG_NO;
|
||||
ctxt.module_id = pdcp_read_header_g.inst - oai_emulation.info.nb_enb_local + oai_emulation.info.first_ue_local;
|
||||
ctxt.rnti = pdcp_UE_UE_module_id_to_rnti[ctxt.module_id];
|
||||
rab_id = pdcp_read_header_g.rb_id;
|
||||
rab_id = pdcp_read_header_g.rb_id % maxDRB;
|
||||
}
|
||||
|
||||
CHECK_CTXT_ARGS(&ctxt);
|
||||
@@ -492,7 +494,7 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t* const ctxt_pP)
|
||||
pdcp_read_header_g.inst + oai_emulation.info.first_enb_local;*/
|
||||
#else // OAI_EMU
|
||||
pdcp_read_header_g.inst = 0;
|
||||
#warning "TO DO CORRCT VALUES FOR ue mod id, enb mod id"
|
||||
//#warning "TO DO CORRCT VALUES FOR ue mod id, enb mod id"
|
||||
ctxt.frame = ctxt_cpy.frame;
|
||||
ctxt.enb_flag = ctxt_cpy.enb_flag;
|
||||
|
||||
@@ -565,7 +567,7 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t* const ctxt_pP)
|
||||
}
|
||||
} else { // rb_id =0, thus interpreated as broadcast and transported as multiple unicast
|
||||
// is a broadcast packet, we have to send this packet on all default RABS of all connected UEs
|
||||
#warning CODE TO BE REVIEWED, ONLY WORK FOR SIMPLE TOPOLOGY CASES
|
||||
//#warning CODE TO BE REVIEWED, ONLY WORK FOR SIMPLE TOPOLOGY CASES
|
||||
for (ue_id = 0; ue_id < NB_UE_INST; ue_id++) {
|
||||
if (oai_emulation.info.eNB_ue_module_id_to_rnti[ctxt_cpy.module_id][ue_id] != NOT_A_RNTI) {
|
||||
ctxt.rnti = oai_emulation.info.eNB_ue_module_id_to_rnti[ctxt_cpy.module_id][ue_id];
|
||||
|
||||
@@ -599,6 +599,7 @@ rlc_am_mac_status_indication (
|
||||
rlc_sn_t sn_end = (rlc->vt_a - 1) & RLC_AM_SN_MASK;
|
||||
int found_pdu = 0;
|
||||
rlc_sn_t found_pdu_sn = 0; // avoid warning
|
||||
(void)found_pdu_sn; /* avoid gcc warning "set but not used" */
|
||||
|
||||
|
||||
while (sn != sn_end) {
|
||||
@@ -681,6 +682,12 @@ rlc_am_mac_data_request (
|
||||
MessageDef *msg_p;
|
||||
# endif
|
||||
int octet_index, index;
|
||||
/* for no gcc warnings */
|
||||
(void)num_nack;
|
||||
(void)message_string;
|
||||
(void)message_string_size;
|
||||
(void)octet_index;
|
||||
(void)index;
|
||||
#endif
|
||||
|
||||
list_init (&data_req.data, NULL);
|
||||
@@ -915,8 +922,16 @@ rlc_am_mac_data_indication (
|
||||
MessageDef *msg_p;
|
||||
# endif
|
||||
int octet_index, index;
|
||||
/* for no gcc warnings */
|
||||
(void)num_nack;
|
||||
(void)message_string;
|
||||
(void)message_string_size;
|
||||
(void)octet_index;
|
||||
(void)index;
|
||||
#endif
|
||||
|
||||
(void)l_rlc_p; /* avoid gcc warning "unused variable" */
|
||||
|
||||
#if TRACE_RLC_AM_PDU || MESSAGE_CHART_GENERATOR
|
||||
|
||||
if (data_indP.data.nb_elements > 0) {
|
||||
|
||||
@@ -57,7 +57,7 @@ rlc_am_init(
|
||||
|
||||
pthread_mutex_init(&rlc_pP->lock_input_sdus, NULL);
|
||||
rlc_pP->input_sdus = calloc(1, RLC_AM_SDU_CONTROL_BUFFER_SIZE*sizeof(rlc_am_tx_sdu_management_t));
|
||||
#warning "cast the rlc retrans buffer to uint32"
|
||||
//#warning "cast the rlc retrans buffer to uint32"
|
||||
// rlc_pP->pdu_retrans_buffer = calloc(1, (uint16_t)((unsigned int)RLC_AM_PDU_RETRANSMISSION_BUFFER_SIZE*(unsigned int)sizeof(rlc_am_tx_data_pdu_management_t)));
|
||||
rlc_pP->pdu_retrans_buffer = calloc(1, (uint32_t)((unsigned int)RLC_AM_PDU_RETRANSMISSION_BUFFER_SIZE*(unsigned int)sizeof(
|
||||
rlc_am_tx_data_pdu_management_t)));
|
||||
@@ -114,7 +114,7 @@ rlc_am_reestablish(
|
||||
LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[AM REESTABLISH] RE-INIT STATE VARIABLES, BUFFERS, LISTS\n",
|
||||
PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP));
|
||||
|
||||
#warning TODO when possible reassemble RLC SDUs from any byte segments of AMD PDUs with SN inf VR(MR)
|
||||
//#warning TODO when possible reassemble RLC SDUs from any byte segments of AMD PDUs with SN inf VR(MR)
|
||||
list2_free(&rlc_pP->receiver_buffer);
|
||||
|
||||
list_free(&rlc_pP->pdus_to_mac_layer);
|
||||
|
||||
@@ -516,7 +516,7 @@ void rlc_am_segment_10 (
|
||||
|
||||
pdu_tb_req_p->data_ptr = (unsigned char*)pdu_p;
|
||||
pdu_tb_req_p->tb_size = data_pdu_size - pdu_remaining_size;
|
||||
#warning "why 3000: changed to RLC_SDU_MAX_SIZE "
|
||||
//#warning "why 3000: changed to RLC_SDU_MAX_SIZE "
|
||||
assert(pdu_tb_req_p->tb_size < RLC_SDU_MAX_SIZE );
|
||||
rlc_am_pdu_polling(ctxt_pP, rlc_pP, pdu_p, pdu_mngt_p->payload_size);
|
||||
|
||||
|
||||
@@ -745,7 +745,7 @@ rlc_um_data_req (const protocol_ctxt_t* const ctxt_pP, void *rlc_pP, mem_block_t
|
||||
/*
|
||||
* Print every single octet in hexadecimal form
|
||||
*/
|
||||
message_string_size += sprintf(&message_string[message_string_size], " %02x", (uint8_t*)(&sdu_pP->data[data_offset])[octet_index]);
|
||||
message_string_size += sprintf(&message_string[message_string_size], " %02x", ((uint8_t*)(&sdu_pP->data[data_offset]))[octet_index]);
|
||||
/*
|
||||
* Align newline and pipes according to the octets in groups of 2
|
||||
*/
|
||||
|
||||
@@ -602,6 +602,9 @@ rlc_module_init (void)
|
||||
int k;
|
||||
module_id_t module_id1;
|
||||
|
||||
/* for no gcc warnings */
|
||||
(void)k;
|
||||
|
||||
LOG_D(RLC, "MODULE INIT\n");
|
||||
rlc_rrc_data_ind = NULL;
|
||||
rlc_rrc_data_conf = NULL;
|
||||
|
||||
@@ -60,6 +60,8 @@
|
||||
# include "DRB-ToAddModList.h"
|
||||
# include "SRB-ToAddMod.h"
|
||||
# include "SRB-ToAddModList.h"
|
||||
# include "DRB-ToReleaseList.h"
|
||||
|
||||
#ifdef Rel10
|
||||
#include "PMCH-InfoList-r9.h"
|
||||
#endif
|
||||
|
||||
@@ -87,6 +87,11 @@ rlc_op_status_t rrc_rlc_config_asn1_req (const protocol_ctxt_t * const ctxt_pP
|
||||
|
||||
#endif
|
||||
|
||||
/* for no gcc warnings */
|
||||
(void)rlc_union_p;
|
||||
(void)key;
|
||||
(void)h_rc;
|
||||
|
||||
LOG_D(RLC, PROTOCOL_CTXT_FMT" CONFIG REQ ASN1 \n",
|
||||
PROTOCOL_CTXT_ARGS(ctxt_pP));
|
||||
|
||||
@@ -196,7 +201,7 @@ rlc_op_status_t rrc_rlc_config_asn1_req (const protocol_ctxt_t * const ctxt_pP
|
||||
break;
|
||||
|
||||
case SRB_ToAddMod__rlc_Config_PR_defaultValue:
|
||||
#warning TO DO SRB_ToAddMod__rlc_Config_PR_defaultValue
|
||||
//#warning TO DO SRB_ToAddMod__rlc_Config_PR_defaultValue
|
||||
if (rrc_rlc_add_rlc (ctxt_pP, SRB_FLAG_YES, MBMS_FLAG_NO, rb_id, lc_id, RLC_MODE_UM) != NULL) {
|
||||
config_req_rlc_um_asn1(
|
||||
ctxt_pP,
|
||||
@@ -463,6 +468,9 @@ rlc_op_status_t rrc_rlc_remove_rlc (
|
||||
|
||||
#endif
|
||||
|
||||
/* for no gcc warnings */
|
||||
(void)lcid;
|
||||
|
||||
#ifdef Rel10
|
||||
|
||||
if (MBMS_flagP == TRUE) {
|
||||
@@ -634,7 +642,7 @@ rlc_op_status_t rrc_rlc_config_req (
|
||||
const rlc_info_t rlc_infoP)
|
||||
{
|
||||
//-----------------------------------------------------------------------------
|
||||
rlc_op_status_t status;
|
||||
//rlc_op_status_t status;
|
||||
|
||||
LOG_D(RLC, PROTOCOL_CTXT_FMT" CONFIG_REQ for RAB %u\n",
|
||||
PROTOCOL_CTXT_ARGS(ctxt_pP),
|
||||
|
||||
@@ -74,7 +74,7 @@ int dump_eNB_l2_stats(char *buffer, int length)
|
||||
int eNB_id,UE_id,number_of_cards;
|
||||
int len= length;
|
||||
int CC_id=0;
|
||||
int i,j;
|
||||
int i;
|
||||
protocol_ctxt_t ctxt;
|
||||
rlc_op_status_t rlc_status;
|
||||
unsigned int stat_rlc_mode;
|
||||
@@ -150,7 +150,7 @@ int dump_eNB_l2_stats(char *buffer, int length)
|
||||
eNB->eNB_stats[CC_id].dlsch_pdus_tx,
|
||||
eNB->eNB_stats[CC_id].total_dlsch_pdus_tx);
|
||||
|
||||
len += sprintf(&buffer[len],"ULSCH bitrate (TTI %u, avg %u) kbps, Received bytes (TTI %u, total %u), Received PDU (TTI %u, total %lu) \n",
|
||||
len += sprintf(&buffer[len],"ULSCH bitrate (TTI %u, avg %u) kbps, Received bytes (TTI %u, total %u), Received PDU (TTI %lu, total %u) \n",
|
||||
eNB->eNB_stats[CC_id].ulsch_bitrate,
|
||||
eNB->eNB_stats[CC_id].total_ulsch_bitrate,
|
||||
eNB->eNB_stats[CC_id].ulsch_bytes_rx,
|
||||
@@ -201,7 +201,7 @@ int dump_eNB_l2_stats(char *buffer, int length)
|
||||
UE_list->eNB_UE_stats[CC_id][UE_id].avg_overhead_bytes
|
||||
);
|
||||
|
||||
len += sprintf(&buffer[len],"[MAC] UE %d (ULSCH), Status %d, RNTI %x : rx power (normalized %d, target %d), MCS (pre %d, post %d), RB (rx %d, retx %d, total %d), Current TBS %d \n",
|
||||
len += sprintf(&buffer[len],"[MAC] UE %d (ULSCH), Status %s, RNTI %x : rx power (normalized %d, target %d), MCS (pre %d, post %d), RB (rx %d, retx %d, total %d), Current TBS %d \n",
|
||||
UE_id,
|
||||
map_int_to_str(rrc_status_names, UE_list->eNB_UE_stats[CC_id][UE_id].rrc_status),
|
||||
UE_list->eNB_UE_stats[CC_id][UE_id].crnti,
|
||||
|
||||
@@ -241,19 +241,24 @@ typedef struct {
|
||||
uint16_t (*get_nCCE_max)(module_id_t Mod_id,uint8_t CC_id,int num_pdcch_symbols,int subframe);
|
||||
|
||||
|
||||
int (*get_nCCE_offset)(unsigned char L, int nCCE, int common_dci, unsigned short rnti, unsigned char subframe);
|
||||
int (*get_nCCE_offset)(int *CCE_table,
|
||||
const unsigned char L,
|
||||
const int nCCE,
|
||||
const int common_dci,
|
||||
const unsigned short rnti,
|
||||
const unsigned char subframe);
|
||||
|
||||
/// Function to retrieve number of PRB in an rb_alloc
|
||||
uint32_t (*get_nb_rb)(uint8_t ra_header, uint32_t rb_alloc, int n_rb_dl);
|
||||
|
||||
/// Function to convert VRB to PRB for distributed allocation
|
||||
int (*get_prb)(int N_RB_DL,int odd_slot,int vrb,int Ngap);
|
||||
uint32_t (*get_prb)(int N_RB_DL,int odd_slot,int vrb,int Ngap);
|
||||
|
||||
/// Function to retrieve transmission mode for UE
|
||||
uint8_t (*get_transmission_mode)(module_id_t Mod_id,uint8_t CC_id,rnti_t rnti);
|
||||
|
||||
/// Function to retrieve rb_alloc bitmap from dci rballoc field and VRB type
|
||||
uint32_t (*get_rballoc)(uint8_t vrb_type, uint16_t rb_alloc_dci);
|
||||
uint32_t (*get_rballoc)(vrb_t vrb_type, uint16_t rb_alloc_dci);
|
||||
|
||||
/// Function for UE MAC to retrieve current PHY connectivity mode (PRACH,RA_RESPONSE,PUSCH)
|
||||
UE_MODE_t (*get_ue_mode)(module_id_t Mod_id, uint8_t CC_id,uint8_t eNB_index);
|
||||
|
||||
@@ -355,6 +355,10 @@ mac_rrc_lite_data_ind(
|
||||
SRB_INFO *Srb_info;
|
||||
protocol_ctxt_t ctxt;
|
||||
sdu_size_t sdu_size = 0;
|
||||
|
||||
/* for no gcc warnings */
|
||||
(void)sdu_size;
|
||||
|
||||
/*
|
||||
int si_window;
|
||||
*/
|
||||
@@ -389,7 +393,7 @@ mac_rrc_lite_data_ind(
|
||||
itti_send_msg_to_task (TASK_RRC_UE, ctxt.instance, message_p);
|
||||
}
|
||||
#else
|
||||
decode_BCCH_DLSCH_Message(&ctxt,eNB_indexP,sduP,sdu_lenP, 0, 0);
|
||||
decode_BCCH_DLSCH_Message(&ctxt,eNB_indexP,(uint8_t*)sduP,sdu_lenP, 0, 0);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -634,7 +638,7 @@ rrc_lite_data_ind(
|
||||
buffer_pP,
|
||||
sdu_sizeP);
|
||||
} else {
|
||||
#warning "LG put 0 to arg4 that is eNB index"
|
||||
//#warning "LG put 0 to arg4 that is eNB index"
|
||||
rrc_ue_decode_dcch(
|
||||
ctxt_pP,
|
||||
DCCH_index,
|
||||
|
||||
@@ -141,7 +141,9 @@ static uint8_t check_trigger_meas_event(
|
||||
Q_OffsetRange_t ofn, Q_OffsetRange_t ocn, Hysteresis_t hys,
|
||||
Q_OffsetRange_t ofs, Q_OffsetRange_t ocs, long a3_offset, TimeToTrigger_t ttt);
|
||||
|
||||
#ifdef Rel10
|
||||
static void decode_MBSFNAreaConfiguration(module_id_t module_idP, uint8_t eNB_index, frame_t frameP,uint8_t mbsfn_sync_area);
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -151,10 +153,13 @@ static void decode_MBSFNAreaConfiguration(module_id_t module_idP, uint8_t eNB_in
|
||||
|
||||
|
||||
/*------------------------------------------------------------------------------*/
|
||||
/* to avoid gcc warnings when compiling with certain options */
|
||||
#if defined(ENABLE_USE_MME) || ENABLE_RAL
|
||||
static Rrc_State_t rrc_get_state (module_id_t ue_mod_idP)
|
||||
{
|
||||
return UE_rrc_inst[ue_mod_idP].RrcState;
|
||||
}
|
||||
#endif
|
||||
|
||||
static Rrc_Sub_State_t rrc_get_sub_state (module_id_t ue_mod_idP)
|
||||
{
|
||||
@@ -261,6 +266,7 @@ static void init_SI_UE( const protocol_ctxt_t* const ctxt_pP, const uint8_t eNB_
|
||||
|
||||
#ifdef Rel10
|
||||
//-----------------------------------------------------------------------------
|
||||
#if 0
|
||||
static void init_MCCH_UE(module_id_t ue_mod_idP, uint8_t eNB_index)
|
||||
{
|
||||
int i;
|
||||
@@ -274,6 +280,7 @@ static void init_MCCH_UE(module_id_t ue_mod_idP, uint8_t eNB_index)
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
static void openair_rrc_lite_ue_init_security( const protocol_ctxt_t* const ctxt_pP )
|
||||
@@ -697,6 +704,10 @@ rrc_ue_establish_drb(
|
||||
// add descriptor from RRC PDU
|
||||
#ifdef PDCP_USE_NETLINK
|
||||
int oip_ifup=0,ip_addr_offset3=0,ip_addr_offset4=0;
|
||||
/* avoid gcc warnings */
|
||||
(void)oip_ifup;
|
||||
(void)ip_addr_offset3;
|
||||
(void)ip_addr_offset4;
|
||||
#endif
|
||||
|
||||
LOG_I(RRC,"[UE %d] Frame %d: processing RRCConnectionReconfiguration: reconfiguring DRB %ld/LCID %d\n",
|
||||
@@ -1296,7 +1307,7 @@ rrc_ue_process_radioResourceConfigDedicated(
|
||||
UE_rrc_inst[ctxt_pP->module_id].sib1[eNB_index]->cellAccessRelatedInfo.cellIdentity.buf[1],
|
||||
UE_rrc_inst[ctxt_pP->module_id].sib1[eNB_index]->cellAccessRelatedInfo.cellIdentity.buf[2],
|
||||
UE_rrc_inst[ctxt_pP->module_id].sib1[eNB_index]->cellAccessRelatedInfo.cellIdentity.buf[3]);
|
||||
# endif OAI_EMU
|
||||
# endif /* OAI_EMU */
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -2266,6 +2277,9 @@ static const char* SIB2preambleTransMax( long value )
|
||||
case 10:
|
||||
return "n200";
|
||||
}
|
||||
|
||||
/* unreachable but gcc warns... */
|
||||
return "ERR";
|
||||
}
|
||||
static const char* SIB2ra_ResponseWindowSize( long value )
|
||||
{
|
||||
@@ -3061,9 +3075,10 @@ uint64_t arfcn_to_freq(long arfcn) {
|
||||
return((uint64_t)3400000000 + ((arfcn-41590)*100000));
|
||||
else if (arfcn <45590) // Band 43
|
||||
return((uint64_t)3600000000 + ((arfcn-43950)*100000));
|
||||
else
|
||||
else {
|
||||
LOG_E(RRC,"Unknown EARFCN %d\n",arfcn);
|
||||
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
static void dump_sib5( SystemInformationBlockType5_t *sib5 )
|
||||
{
|
||||
|
||||
@@ -253,6 +253,9 @@ openair_rrc_top_init(
|
||||
OAI_UECapability_t *UECap = NULL;
|
||||
int CC_id;
|
||||
|
||||
/* for no gcc warnings */
|
||||
(void)CC_id;
|
||||
|
||||
LOG_D(RRC, "[OPENAIR][INIT] Init function start: NB_UE_INST=%d, NB_eNB_INST=%d\n", NB_UE_INST, NB_eNB_INST);
|
||||
|
||||
if (NB_UE_INST > 0) {
|
||||
@@ -411,7 +414,7 @@ rrc_rx_tx(
|
||||
)
|
||||
//-----------------------------------------------------------------------------
|
||||
{
|
||||
uint8_t UE_id;
|
||||
//uint8_t UE_id;
|
||||
int32_t current_timestamp_ms, ref_timestamp_ms;
|
||||
struct timeval ts;
|
||||
#ifdef LOCALIZATION
|
||||
@@ -517,7 +520,7 @@ rrc_rx_tx(
|
||||
} else { // eNB
|
||||
check_handovers(ctxt_pP);
|
||||
// counetr, and get the value and aggregate
|
||||
#ifdef LOCALIZATION
|
||||
#ifdef RRC_LOCALIZATION
|
||||
|
||||
/* for the localization, only primary CC_id might be relevant*/
|
||||
gettimeofday(&ts, NULL);
|
||||
@@ -547,6 +550,9 @@ rrc_rx_tx(
|
||||
}
|
||||
|
||||
#endif
|
||||
(void)ts; /* remove gcc warning "unused variable" */
|
||||
(void)ref_timestamp_ms; /* remove gcc warning "unused variable" */
|
||||
(void)current_timestamp_ms; /* remove gcc warning "unused variable" */
|
||||
}
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RRC_RX_TX,VCD_FUNCTION_OUT);
|
||||
|
||||
+23
-11
@@ -796,6 +796,8 @@ rrc_eNB_free_UE(
|
||||
protocol_ctxt_t ctxt;
|
||||
#if !defined(ENABLE_USE_MME)
|
||||
module_id_t ue_module_id;
|
||||
/* avoid gcc warnings */
|
||||
(void)ue_module_id;
|
||||
#endif
|
||||
AssertFatal(enb_mod_idP < NB_eNB_INST, "eNB inst invalid (%d/%d) for UE %x!", enb_mod_idP, NB_eNB_INST, rntiP);
|
||||
ue_context_p = rrc_eNB_get_ue_context(
|
||||
@@ -1131,8 +1133,8 @@ rrc_eNB_generate_defaultRRCConnectionReconfiguration(
|
||||
int i;
|
||||
|
||||
// configure SRB1/SRB2, PhysicalConfigDedicated, MAC_MainConfig for UE
|
||||
eNB_RRC_INST* rrc_inst = &eNB_rrc_inst[ctxt_pP->module_id];
|
||||
struct PhysicalConfigDedicated** physicalConfigDedicated = &ue_context_pP->ue_context.physicalConfigDedicated;
|
||||
//eNB_RRC_INST* rrc_inst = &eNB_rrc_inst[ctxt_pP->module_id];
|
||||
//struct PhysicalConfigDedicated** physicalConfigDedicated = &ue_context_pP->ue_context.physicalConfigDedicated;
|
||||
|
||||
struct SRB_ToAddMod *SRB2_config = NULL;
|
||||
struct SRB_ToAddMod__rlc_Config *SRB2_rlc_config = NULL;
|
||||
@@ -1163,7 +1165,7 @@ rrc_eNB_generate_defaultRRCConnectionReconfiguration(
|
||||
#if Rel10
|
||||
long *sr_ProhibitTimer_r9 = NULL;
|
||||
// uint8_t sCellIndexToAdd = rrc_find_free_SCell_index(enb_mod_idP, ue_mod_idP, 1);
|
||||
uint8_t sCellIndexToAdd = 0;
|
||||
//uint8_t sCellIndexToAdd = 0;
|
||||
#endif
|
||||
|
||||
long *logicalchannelgroup, *logicalchannelgroup_drb;
|
||||
@@ -1176,6 +1178,8 @@ rrc_eNB_generate_defaultRRCConnectionReconfiguration(
|
||||
CellsToAddModList_t *CellsToAddModList = NULL;
|
||||
struct RRCConnectionReconfiguration_r8_IEs__dedicatedInfoNASList *dedicatedInfoNASList = NULL;
|
||||
DedicatedInfoNAS_t *dedicatedInfoNas = NULL;
|
||||
/* for no gcc warnings */
|
||||
(void)dedicatedInfoNas;
|
||||
|
||||
C_RNTI_t *cba_RNTI = NULL;
|
||||
#ifdef CBA
|
||||
@@ -1288,6 +1292,10 @@ rrc_eNB_generate_defaultRRCConnectionReconfiguration(
|
||||
DRB_pdcp_config->rlc_AM = NULL;
|
||||
DRB_pdcp_config->rlc_UM = NULL;
|
||||
|
||||
/* avoid gcc warnings */
|
||||
(void)PDCP_rlc_AM;
|
||||
(void)PDCP_rlc_UM;
|
||||
|
||||
#ifdef RRC_DEFAULT_RAB_IS_AM // EXMIMO_IOT
|
||||
PDCP_rlc_AM = CALLOC(1, sizeof(*PDCP_rlc_AM));
|
||||
DRB_pdcp_config->rlc_AM = PDCP_rlc_AM;
|
||||
@@ -2097,8 +2105,8 @@ rrc_eNB_generate_RRCConnectionReconfiguration_handover(
|
||||
QuantityConfig_t *quantityConfig;
|
||||
MobilityControlInfo_t *mobilityInfo;
|
||||
// HandoverCommand_t handoverCommand;
|
||||
uint8_t sourceModId =
|
||||
get_adjacent_cell_mod_id(ue_context_pP->ue_context.handover_info->as_context.reestablishmentInfo->sourcePhysCellId);
|
||||
//uint8_t sourceModId =
|
||||
// get_adjacent_cell_mod_id(ue_context_pP->ue_context.handover_info->as_context.reestablishmentInfo->sourcePhysCellId);
|
||||
#if Rel10
|
||||
long *sr_ProhibitTimer_r9;
|
||||
#endif
|
||||
@@ -2945,7 +2953,7 @@ rrc_eNB_generate_RRCConnectionReconfiguration_handover(
|
||||
handoverCommand.criticalExtensions.choice.c1.choice.handoverCommand_r8.handoverCommandMessage.buf = buffer;
|
||||
handoverCommand.criticalExtensions.choice.c1.choice.handoverCommand_r8.handoverCommandMessage.size = size;
|
||||
*/
|
||||
#warning "COMPILATION PROBLEM"
|
||||
//#warning "COMPILATION PROBLEM"
|
||||
#ifdef PROBLEM_COMPILATION_RESOLVED
|
||||
|
||||
if (sourceModId != 0xFF) {
|
||||
@@ -3003,6 +3011,10 @@ rrc_eNB_process_RRCConnectionReconfigurationComplete(
|
||||
int oip_ifup = 0;
|
||||
int dest_ip_offset = 0;
|
||||
module_id_t ue_module_id = -1;
|
||||
/* avoid gcc warnings */
|
||||
(void)oip_ifup;
|
||||
(void)dest_ip_offset;
|
||||
(void)ue_module_id;
|
||||
#endif
|
||||
|
||||
uint8_t *kRRCenc = NULL;
|
||||
@@ -3010,7 +3022,7 @@ rrc_eNB_process_RRCConnectionReconfigurationComplete(
|
||||
uint8_t *kUPenc = NULL;
|
||||
|
||||
DRB_ToAddModList_t* DRB_configList = ue_context_pP->ue_context.DRB_configList;
|
||||
SRB_ToAddModList_t* SRB_configList = ue_context_pP->ue_context.SRB_configList;
|
||||
//SRB_ToAddModList_t* SRB_configList = ue_context_pP->ue_context.SRB_configList;
|
||||
|
||||
#if defined(ENABLE_SECURITY)
|
||||
|
||||
@@ -3700,7 +3712,7 @@ rrc_eNB_decode_ccch(
|
||||
* the current one must be removed from MAC/PHY (zombie UE)
|
||||
*/
|
||||
if ((ue_context_p = rrc_eNB_ue_context_random_exist(ctxt_pP, random_value))) {
|
||||
#warning "TODO: random_exist: remove UE from MAC/PHY (how?)"
|
||||
//#warning "TODO: random_exist: remove UE from MAC/PHY (how?)"
|
||||
// AssertFatal(0 == 1, "TODO: remove UE from MAC/PHY (how?)");
|
||||
ue_context_p = NULL;
|
||||
} else {
|
||||
@@ -3713,7 +3725,7 @@ rrc_eNB_decode_ccch(
|
||||
m_tmsi_t m_tmsi = BIT_STRING_to_uint32(&s_TMSI.m_TMSI);
|
||||
random_value = (((uint64_t)mme_code) << 32) | m_tmsi;
|
||||
if ((ue_context_p = rrc_eNB_ue_context_stmsi_exist(ctxt_pP, mme_code, m_tmsi))) {
|
||||
#warning "TODO: stmsi_exist: remove UE from MAC/PHY (how?)"
|
||||
//#warning "TODO: stmsi_exist: remove UE from MAC/PHY (how?)"
|
||||
// AssertFatal(0 == 1, "TODO: remove UE from MAC/PHY (how?)");
|
||||
ue_context_p = NULL;
|
||||
} else {
|
||||
@@ -4175,7 +4187,7 @@ rrc_eNB_decode_dcch(
|
||||
// cancel the security mode in PDCP
|
||||
|
||||
// followup with the remaining procedure
|
||||
#warning "LG Removed rrc_eNB_generate_UECapabilityEnquiry after receiving securityModeFailure"
|
||||
//#warning "LG Removed rrc_eNB_generate_UECapabilityEnquiry after receiving securityModeFailure"
|
||||
rrc_eNB_generate_UECapabilityEnquiry(ctxt_pP, ue_context_p);
|
||||
break;
|
||||
|
||||
@@ -4443,7 +4455,7 @@ rrc_enb_task(
|
||||
//SPECTRA: Add the RRC connection reconfiguration with Second cell configuration
|
||||
case RRC_RAL_CONNECTION_RECONFIGURATION_REQ:
|
||||
// ue_mod_id = 0; /* TODO force ue_mod_id to first UE, NAS UE not virtualized yet */
|
||||
#warning "TODO GET RIGHT RNTI"
|
||||
//#warning "TODO GET RIGHT RNTI"
|
||||
PROTOCOL_CTXT_SET_BY_INSTANCE(&ctxt,
|
||||
instance,
|
||||
ENB_FLAG_YES,
|
||||
|
||||
@@ -86,6 +86,7 @@ rrc_eNB_process_GTPV1U_CREATE_TUNNEL_RESP(
|
||||
create_tunnel_resp_pP->num_tunnels,
|
||||
ue_context_p->ue_context.enb_gtp_ebi[0],
|
||||
ue_context_p->ue_context.enb_gtp_teid[0]);
|
||||
(void)rnti; /* avoid gcc warning "set but not used" */
|
||||
return 0;
|
||||
} else {
|
||||
return -1;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user