Merge remote-tracking branch 'origin/develop_integration_2018_w29' into develop
Summary of changes:
- RF simulator enhancements
- remove oaisim
- use new asn1c
- bug fixes / cleanup
- TDD fixes
- IQ replay fixes
- clean VCD/LOG_XX
The new asn1c requires a reinstallation.
Do:
./build_oai -I
This commit is contained in:
+141
-272
@@ -170,7 +170,7 @@ set(CMAKE_C_FLAGS
|
||||
"${CMAKE_C_FLAGS} ${C_FLAGS_PROCESSOR} -std=gnu99 -Wall -Wstrict-prototypes -fno-strict-aliasing -rdynamic -funroll-loops -Wno-packed-bitfield-compat -fPIC ")
|
||||
# add autotools definitions that were maybe used!
|
||||
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 -D'MAKE_VERSION(a,b,c)=((a)*256+(b)*16+c)'"
|
||||
"${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 -DASN_DISABLE_OER_SUPPORT -D'MAKE_VERSION(a,b,c)=((a)*256+(b)*16+c)'"
|
||||
)
|
||||
set(CMAKE_CXX_FLAGS
|
||||
"${CMAKE_CXX_FLAGS} ${C_FLAGS_PROCESSOR} -std=c++11 "
|
||||
@@ -244,7 +244,7 @@ add_boolean_option(TEST_OMG False "???")
|
||||
add_boolean_option(DEBUG_OMG False "???")
|
||||
add_boolean_option(XFORMS False "This adds the possibility to see the signal oscilloscope")
|
||||
add_boolean_option(PRINT_STATS False "This adds the possibility to see the status")
|
||||
add_boolean_option(T_TRACER False "Activate the T tracer, a debugging/monitoring framework" )
|
||||
add_boolean_option(T_TRACER True "Activate the T tracer, a debugging/monitoring framework" )
|
||||
add_boolean_option(UE_AUTOTEST_TRACE False "Activate UE autotest specific logs")
|
||||
add_boolean_option(UE_DEBUG_TRACE False "Activate UE debug trace")
|
||||
add_boolean_option(UE_TIMING_TRACE False "Activate UE timing trace")
|
||||
@@ -262,7 +262,6 @@ if (${ENABLE_ITTI})
|
||||
# add .h files if depend on (this one is generated)
|
||||
${ITTI_DIR}/intertask_interface.h
|
||||
${ITTI_DIR}/intertask_interface.c
|
||||
${ITTI_DIR}/intertask_interface_dump.c
|
||||
${ITTI_DIR}/backtrace.c
|
||||
${ITTI_DIR}/memory_pools.c
|
||||
${ITTI_DIR}/signals.c
|
||||
@@ -281,8 +280,8 @@ endif (${ENABLE_ITTI})
|
||||
# (so creating new asn.1 objects instead of modifying the object attributes)
|
||||
# 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(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")
|
||||
@@ -302,31 +301,35 @@ elseif (${RRC_ASN1_VERSION} STREQUAL "CBA")
|
||||
elseif (${RRC_ASN1_VERSION} STREQUAL "Rel10")
|
||||
make_version(RRC_VERSION 10 2 0)
|
||||
set (RRC_GRAMMAR ${OPENAIR2_DIR}/RRC/LTE/MESSAGES/asn1c/ASN1_files/EUTRA-RRC-Definitions-a20.asn)
|
||||
else()
|
||||
make_version(RRC_VERSION 14 3 0)
|
||||
set (RRC_GRAMMAR ${OPENAIR2_DIR}/RRC/LTE/MESSAGES/asn1c/ASN1_files/RRC-e30.asn)
|
||||
elseif (${RRC_ASN1_VERSION} STREQUAL "Rel11")
|
||||
make_version(RRC_VERSION 11 18 0)
|
||||
set (RRC_GRAMMAR ${OPENAIR2_DIR}/RRC/LTE/MESSAGES/asn1c/ASN1_files/lte-rrc-11.18.0.asn1)
|
||||
elseif (${RRC_ASN1_VERSION} STREQUAL "Rel12")
|
||||
make_version(RRC_VERSION 12 16 0)
|
||||
set (RRC_GRAMMAR ${OPENAIR2_DIR}/RRC/LTE/MESSAGES/asn1c/ASN1_files/lte-rrc-12.16.0.asn1)
|
||||
elseif (${RRC_ASN1_VERSION} STREQUAL "Rel13")
|
||||
make_version(RRC_VERSION 13 9 1)
|
||||
set (RRC_GRAMMAR ${OPENAIR2_DIR}/RRC/LTE/MESSAGES/asn1c/ASN1_files/lte-rrc-13.9.1.asn1)
|
||||
elseif (${RRC_ASN1_VERSION} STREQUAL "Rel14")
|
||||
make_version(RRC_VERSION 14 7 0)
|
||||
set (RRC_GRAMMAR ${OPENAIR2_DIR}/RRC/LTE/MESSAGES/asn1c/ASN1_files/lte-rrc-14.7.0.asn1)
|
||||
elseif (${RRC_ASN1_VERSION} STREQUAL "Rel15")
|
||||
make_version(RRC_VERSION 15 2 2)
|
||||
set (RRC_GRAMMAR ${OPENAIR2_DIR}/RRC/LTE/MESSAGES/asn1c/ASN1_files/lte-rrc-15.2.2.asn1)
|
||||
endif (${RRC_ASN1_VERSION} STREQUAL "Rel8")
|
||||
add_definitions(-DRRC_VERSION=${RRC_VERSION})
|
||||
set (RRC_FULL_DIR ${asn1_generated_dir}/RRC_${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}
|
||||
message("calling asn1c -pdu=all -fcompound-names -gen-PER -no-gen-OER -no-gen-example -D ${RRC_FULL_DIR} ${RRC_GRAMMAR}")
|
||||
execute_process(COMMAND mkdir -p ${RRC_FULL_DIR}
|
||||
COMMAND env asn1c -pdu=all -fcompound-names -gen-PER -no-gen-OER -no-gen-example -D ${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")
|
||||
message(FATAL_ERROR "${ret}: error")
|
||||
endif (NOT ${ret} STREQUAL 0)
|
||||
|
||||
file(GLOB rrc_source ${RRC_FULL_DIR}/*.c)
|
||||
file(GLOB rrc_h ${RRC_FULL_DIR}/*.h)
|
||||
set(rrc_h ${rrc_h} ${RRC_FULL_DIR}/asn1_constants.h)
|
||||
set(rrc_h ${rrc_h} ${RRC_FULL_DIR}/asn_constant.h)
|
||||
set_source_files_properties(${rrc_source} PROPERTIES COMPILE_FLAGS -w) # suppress warnings from generated code
|
||||
add_library(RRC_LIB ${rrc_h} ${rrc_source}
|
||||
${OPENAIR2_DIR}/RRC/LTE/MESSAGES/asn1_msg.c
|
||||
@@ -336,9 +339,9 @@ include_directories ("${RRC_FULL_DIR}")
|
||||
# add the command to generate the source code
|
||||
# Warning: if you modify ASN.1 source file to generate new C files, cmake should be re-run instead of make
|
||||
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}
|
||||
OUTPUT ${RRC_FULL_DIR}/asn_constant.h
|
||||
COMMAND mkdir -p ${RRC_FULL_DIR}
|
||||
COMMAND env asn1c -pdu=all -fcompound-names -gen-PER -no-gen-OER -no-gen-example -D ${RRC_FULL_DIR} ${RRC_GRAMMAR}
|
||||
DEPENDS ${RRC_GRAMMAR}
|
||||
)
|
||||
|
||||
@@ -346,65 +349,56 @@ add_custom_command (
|
||||
# Same limitation as described in RRC: unknown generated file list
|
||||
# so we generate it at cmake time
|
||||
##############
|
||||
add_list1_option(S1AP_RELEASE R10 "S1AP ASN.1 grammar version" R8 R9 R10)
|
||||
add_list1_option(S1AP_RELEASE R14 "S1AP ASN.1 grammar version" R8 R9 R10 R14 R15)
|
||||
|
||||
set(S1AP_DIR ${OPENAIR3_DIR}/S1AP)
|
||||
if (${S1AP_RELEASE} STREQUAL "R8")
|
||||
make_version(S1AP_VERSION 8 10 0)
|
||||
set (ASN1RELDIR R8.10)
|
||||
set(S1AP_ASN_FILES "s1ap-8.10.0.asn1")
|
||||
elseif (${S1AP_RELEASE} STREQUAL "R9")
|
||||
make_version(S1AP_VERSION 9 8 0)
|
||||
set (ASN1RELDIR R9.8)
|
||||
make_version(S1AP_VERSION 9 10 0)
|
||||
set(S1AP_ASN_FILES "s1ap-9.10.0.asn1")
|
||||
elseif (${S1AP_RELEASE} STREQUAL "R10")
|
||||
make_version(S1AP_VERSION 10 5 0)
|
||||
set (ASN1RELDIR R10.5)
|
||||
make_version(S1AP_VERSION 10 9 0)
|
||||
set(S1AP_ASN_FILES "s1ap-10.9.0.asn1")
|
||||
elseif (${S1AP_RELEASE} STREQUAL "R11")
|
||||
make_version(S1AP_VERSION 11 8 0)
|
||||
set(S1AP_ASN_FILES "s1ap-11.8.0.asn1")
|
||||
elseif (${S1AP_RELEASE} STREQUAL "R12")
|
||||
make_version(S1AP_VERSION 12 7 0)
|
||||
set(S1AP_ASN_FILES "s1ap-12.7.0.asn1")
|
||||
elseif (${S1AP_RELEASE} STREQUAL "R13")
|
||||
make_version(S1AP_VERSION 13 6 0)
|
||||
set(S1AP_ASN_FILES "s1ap-13.6.0.asn1")
|
||||
elseif (${S1AP_RELEASE} STREQUAL "R14")
|
||||
make_version(S1AP_VERSION 14 5 0)
|
||||
set(S1AP_ASN_FILES "s1ap-14.5.0.asn1")
|
||||
else (${S1AP_RELEASE} STREQUAL "R15")
|
||||
make_version(S1AP_VERSION 15 1 0)
|
||||
set(S1AP_ASN_FILES "s1ap-15.1.0.asn1")
|
||||
endif(${S1AP_RELEASE} STREQUAL "R8")
|
||||
add_definitions(-DS1AP_VERSION=${S1AP_VERSION})
|
||||
set(S1AP_ASN_DIR ${S1AP_DIR}/MESSAGES/ASN1/${ASN1RELDIR})
|
||||
set(S1AP_ASN_FILES
|
||||
${S1AP_ASN_DIR}/S1AP-CommonDataTypes.asn
|
||||
${S1AP_ASN_DIR}/S1AP-Constants.asn
|
||||
${S1AP_ASN_DIR}/S1AP-IEs.asn
|
||||
${S1AP_ASN_DIR}/S1AP-PDU.asn
|
||||
)
|
||||
set(S1AP_C_DIR ${asn1_generated_dir}/S1AP_${ASN1RELDIR})
|
||||
#message("calling ${asn1c_call} ${S1AP_C_DIR} ${S1AP_ASN_FILES}")
|
||||
execute_process(COMMAND ${asn1c_call} ${S1AP_C_DIR} ${S1AP_ASN_FILES}
|
||||
set(S1AP_ASN_DIR ${S1AP_DIR}/MESSAGES/ASN1/${S1AP_RELEASE})
|
||||
set(S1AP_C_DIR ${asn1_generated_dir}/S1AP_${S1AP_RELEASE})
|
||||
message("calling ASN1C_PREFIX=S1AP_ asn1c -pdu=all -fcompound-names -fno-include-deps -gen-PER -no-gen-OER -no-gen-example -D ${S1AP_C_DIR} ${S1AP_ASN_DIR}/${S1AP_ASN_FILES}")
|
||||
execute_process(COMMAND mkdir -p ${S1AP_C_DIR}
|
||||
COMMAND env "ASN1C_PREFIX=S1AP_" asn1c -pdu=all -fcompound-names -fno-include-deps -gen-PER -no-gen-OER -no-gen-example -D ${S1AP_C_DIR} ${S1AP_ASN_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_RELEASE}
|
||||
RESULT_VARIABLE ret)
|
||||
if (NOT ${ret} STREQUAL 0)
|
||||
message(FATAL_ERROR "${fix_asn1c_call}: error")
|
||||
message(FATAL_ERROR "${ret}: 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)
|
||||
set(s1ap_h ${s1ap_h} )
|
||||
set(s1ap_h ${s1ap_h})
|
||||
|
||||
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_RELEASE}
|
||||
DEPENDS ${S1AP_ASN_FILES}
|
||||
)
|
||||
OUTPUT ${S1AP_C_DIR}/S1AP_asn_constant.h
|
||||
COMMAND mkdir -p ${S1AP_C_DIR}
|
||||
COMMAND env "ASN1C_PREFIX=S1AP_" asn1c -pdu=all -fcompound-names -fno-include-deps -gen-PER -no-gen-OER -no-gen-example -D ${S1AP_C_DIR} ${S1AP_ASN_DIR}/${S1AP_ASN_FILES}
|
||||
DEPENDS ${S1AP_ASN_DIR}/${S1AP_ASN_FILES}
|
||||
)
|
||||
add_library(S1AP_LIB
|
||||
${S1AP_OAI_generated}
|
||||
${S1AP_source}
|
||||
${S1AP_DIR}/s1ap_common.c
|
||||
)
|
||||
@@ -413,7 +407,6 @@ include_directories ("${S1AP_C_DIR}")
|
||||
include_directories ("${S1AP_DIR}")
|
||||
|
||||
add_library(S1AP_ENB
|
||||
${S1AP_C_DIR}/s1ap_ies_defs.h
|
||||
${S1AP_DIR}/s1ap_eNB.c
|
||||
${S1AP_DIR}/s1ap_eNB_context_management_procedures.c
|
||||
${S1AP_DIR}/s1ap_eNB_decoder.c
|
||||
@@ -428,70 +421,52 @@ add_library(S1AP_ENB
|
||||
${S1AP_DIR}/s1ap_eNB_ue_context.c
|
||||
)
|
||||
|
||||
|
||||
|
||||
#X2AP
|
||||
# Same limitation as described in RRC/S1AP: unknown generated file list
|
||||
# so we generate it at cmake time
|
||||
##############
|
||||
add_list1_option(X2AP_RELEASE R11 "X2AP ASN.1 grammar version" R10 R11)
|
||||
set(X2AP_DIR ${OPENAIR2_DIR}/X2AP)
|
||||
if (${X2AP_RELEASE} STREQUAL "R10")
|
||||
make_version(S1AP_VERSION 10 0 0)
|
||||
set (ASN1RELDIR R.UNKNOWN)
|
||||
elseif (${X2AP_RELEASE} STREQUAL "R11")
|
||||
make_version(S1AP_VERSION 11 2 0)
|
||||
set (ASN1RELDIR R11.2)
|
||||
endif(${X2AP_RELEASE} STREQUAL "R10")
|
||||
add_definitions(-DX2AP_VERSION=${X2AP_VERSION})
|
||||
set(X2AP_ASN_DIR ${X2AP_DIR}/MESSAGES/ASN1/${ASN1RELDIR})
|
||||
set(X2AP_ASN_FILES
|
||||
${X2AP_ASN_DIR}/X2AP-CommonDataTypes.asn
|
||||
${X2AP_ASN_DIR}/X2AP-Constants.asn
|
||||
${X2AP_ASN_DIR}/X2AP-IEs.asn
|
||||
${X2AP_ASN_DIR}/X2AP-PDU.asn
|
||||
${X2AP_ASN_DIR}/X2AP-Containers.asn
|
||||
)
|
||||
add_list1_option(X2AP_RELEASE R14 "X2AP ASN.1 grammar version" R8 R11 R12 R14 R15)
|
||||
|
||||
set(X2AP_C_DIR ${asn1_generated_dir}/X2AP_${ASN1RELDIR})
|
||||
#message("calling ${asn1c_call} ${X2AP_C_DIR} ${X2AP_ASN_FILES}")
|
||||
execute_process(COMMAND ${asn1c_call} ${X2AP_C_DIR} ${X2AP_ASN_FILES}
|
||||
set(X2AP_DIR ${OPENAIR2_DIR}/X2AP)
|
||||
if (${X2AP_RELEASE} STREQUAL "R8")
|
||||
make_version(X2AP_VERSION 8 9 0)
|
||||
set(X2AP_ASN_FILES x2ap-8.9.0.asn1)
|
||||
elseif (${X2AP_RELEASE} STREQUAL "R11")
|
||||
make_version(X2AP_VERSION 11 9 0)
|
||||
set(X2AP_ASN_FILES x2ap-11.9.0.asn1)
|
||||
elseif (${X2AP_RELEASE} STREQUAL "R12")
|
||||
make_version(X2AP_VERSION 12 9 0)
|
||||
set(X2AP_ASN_FILES x2ap-12.9.0.asn1)
|
||||
elseif (${X2AP_RELEASE} STREQUAL "R14")
|
||||
make_version(X2AP_VERSION 14 6 0)
|
||||
set(X2AP_ASN_FILES x2ap-14.6.0.asn1)
|
||||
elseif (${X2AP_RELEASE} STREQUAL "R15")
|
||||
make_version(X2AP_VERSION 15 1 0)
|
||||
set(X2AP_ASN_FILES x2ap-15.1.0.asn1)
|
||||
endif(${X2AP_RELEASE} STREQUAL "R8")
|
||||
add_definitions(-DX2AP_VERSION=${X2AP_VERSION})
|
||||
set(X2AP_ASN_DIR ${X2AP_DIR}/MESSAGES/ASN1/${X2AP_RELEASE})
|
||||
set(X2AP_C_DIR ${asn1_generated_dir}/X2AP_${X2AP_RELEASE})
|
||||
message("calling ASN1C_PREFIX=X2AP_ asn1c -pdu=all -fcompound-names -fno-include-deps -gen-PER -no-gen-OER -no-gen-example -D ${X2AP_C_DIR} ${X2AP_ASN_DIR}/${X2AP_ASN_FILES}")
|
||||
execute_process(COMMAND mkdir -p ${X2AP_C_DIR}
|
||||
COMMAND env "ASN1C_PREFIX=X2AP_" asn1c -pdu=all -fcompound-names -fno-include-deps -gen-PER -no-gen-OER -no-gen-example -D ${X2AP_C_DIR} ${X2AP_ASN_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_RELEASE}
|
||||
RESULT_VARIABLE ret)
|
||||
if (NOT ${ret} STREQUAL 0)
|
||||
message(FATAL_ERROR "${fix_asn1c_call}: error")
|
||||
message(FATAL_ERROR "${ret}: error")
|
||||
endif (NOT ${ret} STREQUAL 0)
|
||||
file(GLOB X2AP_source ${X2AP_C_DIR}/*.c)
|
||||
|
||||
set(X2AP_OAI_generated
|
||||
${X2AP_C_DIR}/x2ap_decoder.c
|
||||
${X2AP_C_DIR}/x2ap_encoder.c
|
||||
${X2AP_C_DIR}/x2ap_xer_print.c
|
||||
${X2AP_C_DIR}/x2ap_ies_defs.h
|
||||
)
|
||||
file(GLOB x2ap_h ${X2AP_C_DIR}/*.h)
|
||||
set(x2ap_h ${x2ap_h} )
|
||||
set(x2ap_h ${x2ap_h})
|
||||
|
||||
#message("calling ${X2AP_DIR}/MESSAGES/ASN1/asn1tostruct.py -f ${X2AP_ASN_DIR}/X2AP-PDU-Contents.asn -o ${X2AP_C_DIR}")
|
||||
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_RELEASE}
|
||||
DEPENDS ${X2AP_ASN_FILES}
|
||||
OUTPUT ${X2AP_C_DIR}/X2AP_asn_constant.h
|
||||
COMMAND mkdir -p ${X2AP_C_DIR}
|
||||
COMMAND env "ASN1C_PREFIX=X2AP_" asn1c -pdu=all -fcompound-names -fno-include-deps -gen-PER -no-gen-OER -no-gen-example -D ${X2AP_C_DIR} ${X2AP_ASN_DIR}/${X2AP_ASN_FILES}
|
||||
DEPENDS ${X2AP_ASN_DIR}/${X2AP_ASN_FILES}
|
||||
)
|
||||
|
||||
add_library(X2AP_LIB
|
||||
${X2AP_OAI_generated}
|
||||
${X2AP_source}
|
||||
${X2AP_DIR}/x2ap_common.c
|
||||
)
|
||||
@@ -515,12 +490,12 @@ set (CONFIG_SOURCES
|
||||
${CONFIG_ROOTDIR}/config_load_configmodule.c
|
||||
${CONFIG_ROOTDIR}/config_userapi.c
|
||||
${CONFIG_ROOTDIR}/config_cmdline.c
|
||||
)
|
||||
)
|
||||
set (CONFIG_LIBCONFIG_SOURCES
|
||||
${CONFIG_ROOTDIR}/libconfig/config_libconfig.c
|
||||
)
|
||||
)
|
||||
add_library(params_libconfig MODULE ${CONFIG_LIBCONFIG_SOURCES} )
|
||||
target_link_libraries(params_libconfig config)
|
||||
target_link_libraries(params_libconfig config)
|
||||
# shared library loader
|
||||
set (SHLIB_LOADER_SOURCES
|
||||
${OPENAIR_DIR}/common/utils/load_module_shlib.c
|
||||
@@ -621,9 +596,7 @@ add_boolean_option(RRC_DEFAULT_RAB_IS_AM False "set the RLC mode to AM for the d
|
||||
add_boolean_option(OAI_NW_DRIVER_TYPE_ETHERNET False "????")
|
||||
add_boolean_option(DEADLINE_SCHEDULER True "Use the Linux scheduler SCHED_DEADLINE: kernel >= 3.14")
|
||||
add_boolean_option(CPU_AFFINITY False "Enable CPU Affinity of threads (only valid without deadline scheduler). It is enabled only with >2 CPUs")
|
||||
add_boolean_option(NAS_ADDRESS_FIX False "specific to oaisim: for nasmesh driver")
|
||||
add_boolean_option(NAS_NETLINK False "useless ??? Must be True to compile nasmesh driver without rtai ????")
|
||||
add_boolean_option(OAISIM False "specific to oaisim")
|
||||
add_boolean_option(OAI_NW_DRIVER_USE_NETLINK True "????")
|
||||
|
||||
add_boolean_option(USE_MME False "this flag is used only one time in lte-softmodem.c")
|
||||
@@ -656,9 +629,7 @@ add_boolean_option(OPENAIR_LTE True "Seems legacy: keep it to true")
|
||||
# PHY options
|
||||
##########################
|
||||
add_boolean_option(DRIVER2013 True "only relevant for EXMIMO")
|
||||
add_boolean_option(ENABLE_NEW_MULTICAST False "specific to oaisim")
|
||||
add_boolean_option(EXMIMO_IOT True "????")
|
||||
add_boolean_option(LARGE_SCALE False "specific to oaisim: defines max eNB=2 and max UE=120")
|
||||
add_boolean_option(LOCALIZATION False "???")
|
||||
add_integer_option(MAX_NUM_CCs 1 "????")
|
||||
add_boolean_option(MU_RECEIVER False "????")
|
||||
@@ -669,6 +640,7 @@ add_boolean_option(SMBV False "Rohde&Schwarz SMBV100A vector
|
||||
add_boolean_option(DEBUG_PHY False "Enable PHY layer debugging options")
|
||||
add_boolean_option(DEBUG_PHY_PROC False "Enable debugging of PHY layer procedures")
|
||||
add_boolean_option(DEBUG_DLSCH False "Enable debugging of DLSCH physical layer channel")
|
||||
add_boolean_option(MEX False "Enabling compilation with mex")
|
||||
|
||||
##########################
|
||||
# NAS LAYER OPTIONS
|
||||
@@ -681,7 +653,6 @@ add_boolean_option(NAS_UE True "NAS UE INSTANCE (<> NAS_MME)")
|
||||
##########################
|
||||
# ACCESS STRATUM LAYER2 OPTIONS
|
||||
##########################
|
||||
add_boolean_option(MAC_CONTEXT True "specific to oaisim")
|
||||
add_boolean_option(JUMBO_FRAME True "ENABLE LARGE SDU in ACCESS STRATUM (larger than common MTU)")
|
||||
|
||||
##########################
|
||||
@@ -927,7 +898,7 @@ set(UTIL_SRC
|
||||
${OPENAIR2_DIR}/UTIL/LISTS/list.c
|
||||
${OPENAIR2_DIR}/UTIL/LISTS/list2.c
|
||||
${OPENAIR2_DIR}/UTIL/LOG/log.c
|
||||
${OPENAIR2_DIR}/UTIL/LOG/vcd_signal_dumper.c
|
||||
# ${OPENAIR2_DIR}/UTIL/LOG/vcd_signal_dumper.c
|
||||
${OPENAIR2_DIR}/UTIL/MATH/oml.c
|
||||
${OPENAIR2_DIR}/UTIL/MEM/mem_block.c
|
||||
# ${OPENAIR2_DIR}/UTIL/OCG/OCG.c
|
||||
@@ -989,7 +960,7 @@ set(SECU_CN_SRC
|
||||
)
|
||||
add_library(SECU_CN ${SECU_CN_SRC})
|
||||
|
||||
# Physical Channel Procedures Scheduling
|
||||
# Physical Channel Procedures Scheduling
|
||||
################################"
|
||||
set(SCHED_SRC
|
||||
${OPENAIR1_DIR}/SCHED/fapi_l1.c
|
||||
@@ -1082,13 +1053,14 @@ set(PHY_TURBOIF
|
||||
add_library(coding MODULE ${PHY_TURBOSRC} )
|
||||
set(PHY_SRC_COMMON
|
||||
# depend on code generation from asn1c
|
||||
${RRC_FULL_DIR}/asn1_constants.h
|
||||
${RRC_FULL_DIR}/asn_constant.h
|
||||
# actual source
|
||||
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/dci_tools_common.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/lte_mcs.c
|
||||
# ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/slss.c
|
||||
# ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/sldch.c
|
||||
# ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/slsch.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_UE_TRANSPORT/get_pmi.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/group_hopping.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/phich_common.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/pcfich_common.c
|
||||
@@ -1177,6 +1149,7 @@ set(PHY_SRC_UE
|
||||
${OPENAIR1_DIR}/PHY/LTE_UE_TRANSPORT/sss_ue.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_UE_TRANSPORT/dlsch_demodulation.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_UE_TRANSPORT/dlsch_llr_computation.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_UE_TRANSPORT/linear_preprocessing_rec.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_UE_TRANSPORT/dlsch_decoding.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_UE_TRANSPORT/dci_tools_ue.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_UE_TRANSPORT/uci_tools_ue.c
|
||||
@@ -1224,6 +1197,27 @@ add_library(PHY ${PHY_SRC})
|
||||
add_library(PHY_UE ${PHY_SRC_UE})
|
||||
add_library(PHY_RU ${PHY_SRC_RU})
|
||||
|
||||
#Library for mex functions
|
||||
#########################3
|
||||
set(PHY_MEX_UE
|
||||
${OPENAIR1_DIR}/PHY/LTE_UE_TRANSPORT/linear_preprocessing_rec.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_UE_TRANSPORT/dlsch_llr_computation.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_UE_TRANSPORT/dlsch_demodulation.c
|
||||
${OPENAIR1_DIR}/PHY/TOOLS/log2_approx.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/lte_mcs.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_UE_TRANSPORT/get_pmi.c
|
||||
${OPENAIR1_DIR}/PHY/TOOLS/dB_routines.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/pmch_common.c
|
||||
${OPENAIR1_DIR}/PHY/TOOLS/cadd_vv.c
|
||||
${OPENAIR1_DIR}/PHY/TOOLS/cmult_sv.c
|
||||
${OPENAIR1_DIR}/PHY/TOOLS/cmult_vv.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_UE_TRANSPORT/dlsch_llr_computation_avx2.c
|
||||
${OPENAIR1_DIR}/PHY/TOOLS/signal_energy.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_ESTIMATION/lte_ue_measurements.c
|
||||
${OPENAIR2_DIR}/UTIL/LOG/log.c
|
||||
)
|
||||
add_library(PHY_MEX ${PHY_MEX_UE})
|
||||
|
||||
#Layer 2 library
|
||||
#####################
|
||||
set(MAC_DIR ${OPENAIR2_DIR}/LAYER2/MAC)
|
||||
@@ -1725,12 +1719,14 @@ ${OPENAIR1_DIR}/SIMULATION/TOOLS/taus.c
|
||||
${OPENAIR1_DIR}/SIMULATION/TOOLS/multipath_channel.c
|
||||
${OPENAIR1_DIR}/SIMULATION/TOOLS/multipath_tv_channel.c
|
||||
${OPENAIR1_DIR}/SIMULATION/TOOLS/abstraction.c
|
||||
${OPENAIR1_DIR}/SIMULATION/TOOLS/channel_sim.c
|
||||
${OPENAIR1_DIR}/SIMULATION/RF/rf.c
|
||||
${OPENAIR1_DIR}/SIMULATION/RF/dac.c
|
||||
${OPENAIR1_DIR}/SIMULATION/RF/adc.c
|
||||
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/netlink_init.c
|
||||
)
|
||||
|
||||
|
||||
add_library(SIMU_ETH
|
||||
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/netlink_init.c
|
||||
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/multicast_link.c
|
||||
@@ -1817,11 +1813,13 @@ endif()
|
||||
# So, here are some hacks here. Hope this gets fixed in future!
|
||||
if(EXISTS "/usr/include/atlas/cblas.h" OR EXISTS "/usr/include/cblas.h")
|
||||
include_directories("/usr/include/atlas")
|
||||
LINK_DIRECTORIES("/usr/lib/lapack")
|
||||
LINK_DIRECTORIES("/usr/lib64")
|
||||
LINK_DIRECTORIES("/usr/lib64/atlas") #Added because atlas libraries in CentOS 7 are here!
|
||||
|
||||
|
||||
if(EXISTS "/usr/lib64/libblas.so" OR EXISTS "/usr/lib/libblas.so") #Case for CentOS7
|
||||
list(APPEND ATLAS_LIBRARIES blas)
|
||||
|
||||
else() # Case for Ubuntu
|
||||
list(APPEND ATLAS_LIBRARIES cblas)
|
||||
endif()
|
||||
@@ -1847,6 +1845,8 @@ else()
|
||||
message("No Blas/Atlas libs found, some targets will fail")
|
||||
endif()
|
||||
|
||||
list(APPEND ATLAS_LIBRARIES lapack lapacke)
|
||||
|
||||
if (${XFORMS})
|
||||
include_directories ("/usr/include/X11")
|
||||
set(XFORMS_SOURCE
|
||||
@@ -1904,7 +1904,6 @@ add_definitions(-DASN1_MINIMUM_VERSION=924)
|
||||
add_executable(lte-softmodem
|
||||
${rrc_h}
|
||||
${s1ap_h}
|
||||
${OPENAIR_BIN_DIR}/messages_xml.h
|
||||
${OPENAIR_TARGETS}/RT/USER/rt_wrapper.c
|
||||
${OPENAIR_TARGETS}/RT/USER/lte-enb.c
|
||||
${OPENAIR_TARGETS}/RT/USER/lte-ru.c
|
||||
@@ -1929,7 +1928,7 @@ 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 SCHED_RU_LIB PHY_COMMON PHY PHY_RU LFDS L2
|
||||
RRC_LIB S1AP_LIB S1AP_ENB GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB SCHED_RU_LIB PHY_COMMON PHY PHY_RU LFDS L2
|
||||
${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} LFDS7
|
||||
NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB
|
||||
-Wl,--end-group z dl)
|
||||
@@ -1944,7 +1943,6 @@ target_link_libraries (lte-softmodem ${T_LIB})
|
||||
add_executable(lte-softmodem-nos1
|
||||
${rrc_h}
|
||||
${s1ap_h}
|
||||
${OPENAIR_BIN_DIR}/messages_xml.h
|
||||
${OPENAIR_TARGETS}/RT/USER/rt_wrapper.c
|
||||
${OPENAIR_TARGETS}/RT/USER/lte-enb.c
|
||||
${OPENAIR_TARGETS}/RT/USER/lte-ru.c
|
||||
@@ -1967,7 +1965,7 @@ add_executable(lte-softmodem-nos1
|
||||
)
|
||||
target_link_libraries (lte-softmodem-nos1
|
||||
-Wl,--start-group
|
||||
RRC_LIB SECU_CN SECU_OSA UTIL HASHTABLE SCHED_LIB SCHED_RU_LIB PHY_COMMON PHY PHY_RU LFDS L2 ${MSC_LIB} ${RAL_LIB} ${ITTI_LIB}
|
||||
RRC_LIB SECU_CN SECU_OSA UTIL HASHTABLE SCHED_LIB SCHED_RU_LIB PHY_COMMON PHY PHY_RU LFDS L2 ${MSC_LIB} ${RAL_LIB} ${ITTI_LIB}
|
||||
${MIH_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} LFDS7
|
||||
NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB
|
||||
-Wl,--end-group z dl )
|
||||
@@ -1983,10 +1981,11 @@ target_link_libraries (lte-softmodem-nos1 ${T_LIB})
|
||||
add_executable(lte-uesoftmodem
|
||||
${rrc_h}
|
||||
${s1ap_h}
|
||||
${OPENAIR_BIN_DIR}/messages_xml.h
|
||||
${OPENAIR_TARGETS}/RT/USER/rt_wrapper.c
|
||||
${OPENAIR_TARGETS}/RT/USER/lte-ue.c
|
||||
${OPENAIR_TARGETS}/RT/USER/lte-uesoftmodem.c
|
||||
${OPENAIR_TARGETS}/RT/USER/lte-ru.c
|
||||
${OPENAIR_TARGETS}/RT/USER/rfsim.c
|
||||
${OPENAIR1_DIR}/SIMULATION/TOOLS/taus.c
|
||||
${OPENAIR_TARGETS}/COMMON/create_tasks_ue.c
|
||||
${OPENAIR_TARGETS}/ARCH/COMMON/common_lib.c
|
||||
@@ -2005,13 +2004,13 @@ add_executable(lte-uesoftmodem
|
||||
|
||||
target_link_libraries (lte-uesoftmodem
|
||||
-Wl,--start-group
|
||||
RRC_LIB S1AP_LIB S1AP_ENB GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT UDP SCHED_RU_LIB SCHED_UE_LIB PHY_COMMON PHY_UE PHY_RU LFDS L2_UE
|
||||
${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} LFDS7
|
||||
RRC_LIB S1AP_LIB S1AP_ENB GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT UDP SCHED_RU_LIB SCHED_UE_LIB PHY_COMMON PHY_UE PHY_RU LFDS L2_UE SIMU
|
||||
${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} LFDS7 ${ATLAS_LIBRARIES}
|
||||
NFAPI_COMMON_LIB NFAPI_LIB NFAPI_PNF_LIB NFAPI_USER_LIB
|
||||
-Wl,--end-group z dl)
|
||||
|
||||
target_link_libraries (lte-uesoftmodem ${LIBXML2_LIBRARIES})
|
||||
target_link_libraries (lte-uesoftmodem pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} sctp ${XFORMS_LIBRARIES} ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES})
|
||||
target_link_libraries (lte-uesoftmodem pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} sctp ${XFORMS_LIBRARIES} ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES} ${ATLAS_LIBRARIES})
|
||||
target_link_libraries (lte-uesoftmodem ${LIB_LMS_LIBRARIES})
|
||||
target_link_libraries (lte-uesoftmodem ${T_LIB})
|
||||
|
||||
@@ -2020,10 +2019,11 @@ target_link_libraries (lte-uesoftmodem ${T_LIB})
|
||||
add_executable(lte-uesoftmodem-nos1
|
||||
${rrc_h}
|
||||
${s1ap_h}
|
||||
${OPENAIR_BIN_DIR}/messages_xml.h
|
||||
${OPENAIR_TARGETS}/RT/USER/rt_wrapper.c
|
||||
${OPENAIR_TARGETS}/RT/USER/lte-ue.c
|
||||
${OPENAIR_TARGETS}/RT/USER/lte-uesoftmodem.c
|
||||
${OPENAIR_TARGETS}/RT/USER/lte-ru.c
|
||||
${OPENAIR_TARGETS}/RT/USER/rfsim.c
|
||||
${OPENAIR1_DIR}/SIMULATION/TOOLS/taus.c
|
||||
${OPENAIR_TARGETS}/COMMON/create_tasks_ue.c
|
||||
${OPENAIR_TARGETS}/ARCH/COMMON/common_lib.c
|
||||
@@ -2043,13 +2043,13 @@ add_executable(lte-uesoftmodem-nos1
|
||||
|
||||
target_link_libraries (lte-uesoftmodem-nos1
|
||||
-Wl,--start-group
|
||||
RRC_LIB SECU_CN SECU_OSA UTIL HASHTABLE SCHED_RU_LIB SCHED_UE_LIB PHY_COMMON PHY_UE PHY_RU LFDS L2_UE ${MSC_LIB} ${RAL_LIB} ${ITTI_LIB}
|
||||
${MIH_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} LFDS7
|
||||
RRC_LIB SECU_CN SECU_OSA UTIL HASHTABLE SCHED_RU_LIB SCHED_UE_LIB PHY_COMMON PHY_UE PHY_RU LFDS L2_UE SIMU ${MSC_LIB} ${RAL_LIB} ${ITTI_LIB}
|
||||
${MIH_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} LFDS7 ${ATLAS_LIBRARIES}
|
||||
NFAPI_COMMON_LIB NFAPI_LIB NFAPI_PNF_LIB NFAPI_USER_LIB
|
||||
-Wl,--end-group z dl )
|
||||
|
||||
target_link_libraries (lte-uesoftmodem-nos1 ${LIBXML2_LIBRARIES})
|
||||
target_link_libraries (lte-uesoftmodem-nos1 pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} sctp ${XFORMS_LIBRARIES} ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES})
|
||||
target_link_libraries (lte-uesoftmodem-nos1 pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} sctp ${XFORMS_LIBRARIES} ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES} ${ATLAS_LIBRARIES})
|
||||
target_link_libraries (lte-uesoftmodem-nos1 ${LIB_LMS_LIBRARIES})
|
||||
target_link_libraries (lte-uesoftmodem-nos1 ${T_LIB})
|
||||
|
||||
@@ -2080,103 +2080,12 @@ target_link_libraries (lte-uesoftmodem-nos1 ${T_LIB})
|
||||
# Addexecutables for tests
|
||||
####################################
|
||||
|
||||
# A all in one network simulator
|
||||
################
|
||||
add_executable(oaisim
|
||||
${rrc_h}
|
||||
${s1ap_h}
|
||||
${x2ap_h}
|
||||
${OPENAIR_BIN_DIR}/messages_xml.h
|
||||
${OPENAIR_TARGETS}/RT/USER/lte-ue.c
|
||||
${OPENAIR_TARGETS}/RT/USER/lte-ru.c
|
||||
${OPENAIR_TARGETS}/RT/USER/rt_wrapper.c
|
||||
${OPENAIR_TARGETS}/SIMU/USER/channel_sim.c
|
||||
# ${OPENAIR_TARGETS}/SIMU/USER/oaisim_config.c
|
||||
${OPENAIR_TARGETS}/SIMU/USER/sinr_sim.c
|
||||
${OPENAIR_TARGETS}/SIMU/USER/cor_SF_sim.c
|
||||
${OPENAIR_TARGETS}/SIMU/USER/oaisim_functions.c
|
||||
${OPENAIR_TARGETS}/SIMU/USER/event_handler.c
|
||||
${OPENAIR_TARGETS}/SIMU/USER/oaisim.c
|
||||
${OPENAIR_TARGETS}/ARCH/COMMON/common_lib.c
|
||||
${OPENAIR2_DIR}/RRC/NAS/nas_config.c
|
||||
${OPENAIR2_DIR}/RRC/NAS/rb_config.c
|
||||
${OPENAIR3_DIR}/NAS/UE/nas_ue_task.c
|
||||
${OPENAIR_DIR}/common/utils/utils.c
|
||||
${OPENAIR_DIR}/common/utils/system.c
|
||||
${OPENAIR_TARGETS}/COMMON/create_tasks_ue.c
|
||||
${XFORMS_SOURCE}
|
||||
${T_SOURCE}
|
||||
${CONFIG_SOURCES}
|
||||
${SHLIB_LOADER_SOURCES}
|
||||
)
|
||||
|
||||
|
||||
target_include_directories(oaisim PUBLIC ${OPENAIR_TARGETS}/SIMU/USER)
|
||||
target_link_libraries (oaisim
|
||||
-Wl,-ldl,--start-group
|
||||
RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB SECU_CN UTIL HASHTABLE SCTP_CLIENT UDP SCHED_RU_LIB SCHED_UE_LIB PHY_COMMON PHY_UE PHY_RU LFDS L2_UE ${MSC_LIB} LIB_NAS_UE SIMU SECU_OSA ${ITTI_LIB} ${MIH_LIB}
|
||||
${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} LFDS7
|
||||
-Wl,--end-group z dl)
|
||||
|
||||
target_link_libraries (oaisim ${LIBXML2_LIBRARIES} ${LAPACK_LIBRARIES})
|
||||
target_link_libraries (oaisim pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} sctp z
|
||||
${ATLAS_LIBRARIES} ${XFORMS_LIBRARIES} ${OPENPGM_LIBRARIES} ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES})
|
||||
#Force link with forms, regardless XFORMS option
|
||||
target_link_libraries (oaisim forms)
|
||||
target_link_libraries (oaisim ${T_LIB})
|
||||
|
||||
|
||||
# A all in one network simulator
|
||||
################
|
||||
add_executable(oaisim_nos1
|
||||
${rrc_h}
|
||||
${s1ap_h}
|
||||
${x2ap_h}
|
||||
${OPENAIR_BIN_DIR}/messages_xml.h
|
||||
${OPENAIR_TARGETS}/RT/USER/lte-ue.c
|
||||
${OPENAIR_TARGETS}/RT/USER/lte-ru.c
|
||||
${OPENAIR1_DIR}/SCHED/prach_procedures.c
|
||||
${OPENAIR_TARGETS}/RT/USER/rt_wrapper.c
|
||||
${OPENAIR_TARGETS}/SIMU/USER/channel_sim.c
|
||||
# ${OPENAIR_TARGETS}/SIMU/USER/oaisim_config.c
|
||||
${OPENAIR_TARGETS}/SIMU/USER/sinr_sim.c
|
||||
${OPENAIR_TARGETS}/SIMU/USER/cor_SF_sim.c
|
||||
${OPENAIR_TARGETS}/SIMU/USER/oaisim_functions.c
|
||||
${OPENAIR_TARGETS}/SIMU/USER/event_handler.c
|
||||
${OPENAIR_TARGETS}/SIMU/USER/oaisim.c
|
||||
${OPENAIR_TARGETS}/ARCH/COMMON/common_lib.c
|
||||
${OPENAIR2_DIR}/RRC/NAS/nas_config.c
|
||||
${OPENAIR2_DIR}/RRC/NAS/rb_config.c
|
||||
${OPENAIR_TARGETS}/COMMON/create_tasks_ue.c
|
||||
${OPENAIR_DIR}/common/utils/system.c
|
||||
${XFORMS_SOURCE}
|
||||
${T_SOURCE}
|
||||
${CONFIG_SOURCES}
|
||||
${SHLIB_LOADER_SOURCES}
|
||||
)
|
||||
target_include_directories(oaisim_nos1 PUBLIC ${OPENAIR_TARGETS}/SIMU/USER)
|
||||
target_link_libraries (oaisim_nos1
|
||||
-Wl,--start-group
|
||||
RRC_LIB X2AP_LIB SECU_CN UTIL HASHTABLE SCHED_RU_LIB SCHED_UE_LIB PHY_COMMON PHY_UE PHY_RU LFDS ${MSC_LIB} ${ITTI_LIB} SIMU L2_UE ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} LFDS7
|
||||
-Wl,--end-group z dl )
|
||||
|
||||
target_link_libraries (oaisim_nos1 ${LIBXML2_LIBRARIES} ${LAPACK_LIBRARIES})
|
||||
target_link_libraries (oaisim_nos1 pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES}
|
||||
${ATLAS_LIBRARIES} ${XFORMS_LIBRARIES} ${OPENPGM_LIBRARIES} ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES})
|
||||
#Force link with forms, regardless XFORMS option
|
||||
target_link_libraries (oaisim_nos1 forms)
|
||||
|
||||
#message("protobuflib is ${PROTOBUF_LIB}")
|
||||
|
||||
target_link_libraries (oaisim_nos1 ${T_LIB})
|
||||
|
||||
|
||||
# Unitary tests for each piece of L1: example, mbmssim is MBMS L1 simulator
|
||||
#####################################
|
||||
|
||||
#special case for dlim TM4, which uses its own version of phy_scope code
|
||||
add_executable(dlsim_tm4
|
||||
# ${OPENAIR_BIN_DIR}/messages_xml.h
|
||||
${OPENAIR1_DIR}/SIMULATION/LTE_PHY/dlsim_tm4.c
|
||||
${OPENAIR1_DIR}/PHY/TOOLS/lte_phy_scope_tm4.c
|
||||
${T_SOURCE}
|
||||
@@ -2189,7 +2098,6 @@ target_link_libraries (dlsim_tm4
|
||||
foreach(myExe dlsim dlsim_tm7 ulsim pbchsim scansim mbmssim pdcchsim pucchsim prachsim syncsim)
|
||||
|
||||
add_executable(${myExe}
|
||||
# ${OPENAIR_BIN_DIR}/messages_xml.h
|
||||
${OPENAIR1_DIR}/SIMULATION/LTE_PHY/${myExe}.c
|
||||
${XFORMS_SOURCE}
|
||||
${T_SOURCE}
|
||||
@@ -2211,7 +2119,6 @@ add_executable(test_epc_generate_scenario
|
||||
${OPENAIR2_DIR}/COMMON/messages_def.h
|
||||
${OPENAIR2_DIR}/COMMON/messages_types.h
|
||||
${OPENAIR3_DIR}/S1AP/s1ap_eNB_defs.h
|
||||
# ${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 ${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}
|
||||
@@ -2231,7 +2138,6 @@ add_executable(test_epc_play_scenario
|
||||
${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
|
||||
@@ -2267,7 +2173,7 @@ endforeach(myExe)
|
||||
if (${T_TRACER})
|
||||
foreach(i
|
||||
#all "add_executable" definitions (except tests, rb_tool, updatefw)
|
||||
lte-softmodem lte-softmodem-nos1 oaisim oaisim_nos1
|
||||
lte-softmodem lte-softmodem-nos1 lte-uesoftmodem lte-uesoftmodem-nos1
|
||||
dlsim_tm4 dlsim dlsim_tm7 ulsim pbchsim scansim mbmssim
|
||||
pdcchsim pucchsim prachsim syncsim
|
||||
#all "add_library" definitions
|
||||
@@ -2287,43 +2193,6 @@ endif (${T_TRACER})
|
||||
# Generated specific cases is not regular code
|
||||
###############################################
|
||||
|
||||
##################""
|
||||
# itti symbolic debug print require to generate a specific include file
|
||||
########################################
|
||||
|
||||
# retrieve the compiler options to send it to gccxml
|
||||
get_directory_property( DirDefs COMPILE_DEFINITIONS )
|
||||
foreach( d ${DirDefs} )
|
||||
list(APPEND itti_compiler_options "-D${d}")
|
||||
endforeach()
|
||||
get_directory_property( DirDefs INCLUDE_DIRECTORIES )
|
||||
foreach( d ${DirDefs} )
|
||||
list(APPEND itti_compiler_options "-I${d}")
|
||||
endforeach()
|
||||
|
||||
# castxml doesn't work with c11 (gcc 5 default)
|
||||
# force castxml and clang compilation with gnu89 standard
|
||||
# we can't use cXX standard as pthread_rwlock_t is gnu standard
|
||||
list(APPEND itti_compiler_options "-std=gnu89;-D'MAKE_VERSION(a,b,c)=((a)*256+(b)*16+c)'")
|
||||
set (ITTI_H ${ITTI_DIR}/intertask_interface_types.h)
|
||||
if(EXISTS /usr/bin/gccxml)
|
||||
set(xml_command gccxml ${itti_compiler_options} -fxml=${OPENAIR_BIN_DIR}/messages.xml ${ITTI_H})
|
||||
else()
|
||||
set(xml_command castxml --castxml-gccxml ${itti_compiler_options} ${ITTI_H} -o ${OPENAIR_BIN_DIR}/messages.xml)
|
||||
endif()
|
||||
|
||||
add_custom_command (
|
||||
OUTPUT ${OPENAIR_BIN_DIR}/messages.xml
|
||||
COMMAND ${xml_command}
|
||||
DEPENDS ${S1AP_OAI_generated} ${RRC_FULL_DIR}/asn1_constants.h
|
||||
)
|
||||
|
||||
add_custom_command (
|
||||
OUTPUT ${OPENAIR_BIN_DIR}/messages_xml.h
|
||||
COMMAND sed -e 's/ *//' -e 's/\"/\\\\\"/g' -e 's/^/\"/' -e 's/$$/\\\\n\"/' ${OPENAIR_BIN_DIR}/messages.xml > ${OPENAIR_BIN_DIR}/messages_xml.h
|
||||
DEPENDS ${OPENAIR_BIN_DIR}/messages.xml ${RRC_FULL_DIR}/asn1_constants.h
|
||||
)
|
||||
|
||||
################
|
||||
# Kernel modules
|
||||
###############
|
||||
|
||||
@@ -956,21 +956,21 @@
|
||||
<pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</pre_exec>
|
||||
<pre_exec_args></pre_exec_args>
|
||||
<main_exec> $OPENAIR_DIR/targets/bin/dlsim.Rel14</main_exec>
|
||||
<main_exec_args> -m5 -gF -s-1 -w1.0 -f.2 -n500 -B50 -c2 -z2 -O70
|
||||
-m4 -gF -s0 -w1.0 -f.2 -n500 -B6 -c4 -z2 -O70
|
||||
-m15 -gF -s6.7 -w1.0 -f.2 -n500 -B50 -c2 -z2 -O70
|
||||
-m14 -gF -s6.7 -w1.0 -f.2 -n500 -B25 -c3 -z2 -O70
|
||||
-m15 -gG -s6.7 -w1.0 -f.2 -n500 -B50 -c2 -z2 -O30
|
||||
-m14 -gG -s1.4 -w1.0 -f.2 -n500 -B25 -c3 -z2 -O30
|
||||
-m25 -gF -s17.4 -w1.0 -f.2 -n500 -B25 -c3 -z2 -O70
|
||||
-m25 -gF -s17.5 -w1.0 -f.2 -n500 -B25 -c3 -z2 -r1022 -O70
|
||||
-m26 -gF -s17.7 -w1.0 -f.2 -n500 -B50 -c2 -z2 -O70
|
||||
-m26 -gF -s17.6 -w1.0 -f.2 -n500 -B100 -c2 -z2 -O70
|
||||
-m26 -gF -s17.3 -w1.0 -f.2 -n500 -B100 -c2 -z2 -r1600 -O70
|
||||
-m26 -gF -s16.6 -w1.0 -f.2 -n500 -B100 -c2 -z2 -r1899 -O70
|
||||
-m14 -gF -s6.8 -w1.0 -f.2 -n500 -B50 -c2 -x2 -y2 -z2 -O70
|
||||
-m13 -gF -s5.9 -w1.0 -f.2 -n500 -B25 -c3 -x2 -y2 -z2 -O70</main_exec_args>
|
||||
<tags>dlsim.test1 dlsim.test5 dlsim.test6 dlsim.test6b dlsim.test7 dlsim.test7b dlsim.test10 dlsim.test10b dlsim.test11 dlsim.test11b dlsim.TM2_test1 dlsim.TM2_test1b dlsim.TM2_test1c</tags>
|
||||
<main_exec_args> -m5 -gF -s-1 -w1.0 -f.2 -n500 -B50 -c2 -z2 -O60
|
||||
-m4 -gF -s0 -w1.0 -f.2 -n500 -B6 -c4 -z2 -O60
|
||||
-m15 -gF -s6.7 -w1.0 -f.2 -n500 -B50 -c2 -z2 -O60
|
||||
-m15 -gF -s6.7 -w1.0 -f.2 -n500 -B25 -c2 -z2 -O60
|
||||
-m15 -gG -s1.4 -w1.0 -f.2 -n500 -B50 -c2 -z2 -O25
|
||||
-m15 -gG -s1.4 -w1.0 -f.2 -n500 -B25 -c2 -z2 -O25
|
||||
-m25 -gF -s17.4 -w1.0 -f.2 -n500 -B25 -c3 -z2 -O60
|
||||
-m25 -gF -s17.5 -w1.0 -f.2 -n500 -B25 -c3 -z2 -r1022 -O60
|
||||
-m26 -gF -s17.7 -w1.0 -f.2 -n500 -B50 -c2 -z2 -O60
|
||||
-m26 -gF -s17.6 -w1.0 -f.2 -n500 -B100 -c2 -z2 -O60
|
||||
-m26 -gF -s17.3 -w1.0 -f.2 -n500 -B100 -c2 -z2 -r1600 -O60
|
||||
-m26 -gF -s16.6 -w1.0 -f.2 -n500 -B100 -c2 -z2 -r1899 -O60
|
||||
-m14 -gF -s6.8 -w1.0 -f.2 -n500 -B50 -c2 -x2 -y2 -z2 -O60
|
||||
-m13 -gF -s5.9 -w1.0 -f.2 -n500 -B25 -c3 -x2 -y2 -z2 -O60</main_exec_args>
|
||||
<tags>dlsim.test1 dlsim.test5 dlsim.test6 dlsim.test6b dlsim.test7 dlsim.test7b dlsim.test10 dlsim.test10b dlsim.test11 dlsim.TM2_test1 dlsim.TM2_test1b</tags>
|
||||
<search_expr_true>"passed"</search_expr_true>
|
||||
<search_expr_false>segmentation fault|assertion|exiting|fatal</search_expr_false>
|
||||
<nruns>3</nruns>
|
||||
@@ -990,12 +990,12 @@
|
||||
<pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</pre_exec>
|
||||
<pre_exec_args></pre_exec_args>
|
||||
<main_exec> $OPENAIR_DIR/targets/bin/ulsim.Rel14</main_exec>
|
||||
<main_exec_args> -B25 -m5 -y1 -gN -x1 -s6 -w1.0 -e.1 -P -n500 -O70 -L
|
||||
-B25 -m16 -y1 -gN -x1 -s12 -w1.0 -e.1 -P -n500 -O70 -L
|
||||
-B50 -m5 -y1 -gN -x1 -s6 -w1.0 -e.1 -P -n500 -O70 -L
|
||||
-B50 -m16 -y1 -gN -x1 -s12 -w1.0 -e.1 -P -n500 -O70 -L
|
||||
-B100 -m5 -y1 -gN -x1 -s6 -w1.0 -e.1 -P -n500 -O70 -L
|
||||
-B100 -m16 -y1 -gN -x1 -s12 -w1.0 -e.1 -P -n500 -O70 -L</main_exec_args>
|
||||
<main_exec_args> -B25 -m5 -y1 -gN -x1 -s6 -w1.0 -e.1 -P -n500 -O70
|
||||
-B25 -m16 -y1 -gN -x1 -s12 -w1.0 -e.1 -P -n500 -O70
|
||||
-B50 -m5 -y1 -gN -x1 -s6 -w1.0 -e.1 -P -n500 -O70
|
||||
-B50 -m16 -y1 -gN -x1 -s12 -w1.0 -e.1 -P -n500 -O70
|
||||
-B100 -m5 -y1 -gN -x1 -s6 -w1.0 -e.1 -P -n500 -O70
|
||||
-B100 -m16 -y1 -gN -x1 -s12 -w1.0 -e.1 -P -n500 -O70 </main_exec_args>
|
||||
<tags>ulsim.test1 ulsim.test2 ulsim.test3 ulsim.test4 ulsim.test5 ulsim.test6</tags>
|
||||
<search_expr_true>"passed"</search_expr_true>
|
||||
<search_expr_false>segmentation fault|assertion|exiting|fatal</search_expr_false>
|
||||
|
||||
+9
-150
@@ -58,7 +58,7 @@ CFLAGS_PROCESSOR_USER=""
|
||||
RUN_GROUP=0
|
||||
TEST_CASE_GROUP=""
|
||||
BUILD_DOXYGEN=0
|
||||
T_TRACER="False"
|
||||
T_TRACER="True"
|
||||
DISABLE_HARDWARE_DEPENDENCY="False"
|
||||
CMAKE_BUILD_TYPE=""
|
||||
CMAKE_CMD="$CMAKE"
|
||||
@@ -112,8 +112,6 @@ Options
|
||||
-t | --transport protocol
|
||||
ETHERNET , None
|
||||
Adds this trasport protocol support in compilation
|
||||
--oaisim
|
||||
Makes the oaisim simulator. Hardware will be defaulted to \"None\".
|
||||
--phy_simulators
|
||||
Makes the unitary tests Layer 1 simulators
|
||||
--core_simulators
|
||||
@@ -125,12 +123,12 @@ Options
|
||||
-V | --vcd
|
||||
Adds a debgging facility to the binary files: GUI with major internal synchronization events
|
||||
-x | --xforms
|
||||
Adds a software oscilloscope feature to the produced binaries. If oaisim, then enable PRINT_STATS.
|
||||
Adds a software oscilloscope feature to the produced binaries.
|
||||
--install-system-files
|
||||
Install OpenArInterface required files in Linux system
|
||||
(will ask root password)
|
||||
--noS1
|
||||
Compiles oaisim or lte-softmodem without S1 interface, using direct link to IP instead
|
||||
Compiles lte-softmodem without S1 interface, using direct link to IP instead
|
||||
--verbose-compile
|
||||
Shows detailed compilation instructions in makefile
|
||||
--cflags_processor
|
||||
@@ -143,8 +141,8 @@ Options
|
||||
Enable deadline scheduler of Linux kernel (>=3.14.x).
|
||||
--disable-cpu-affinity
|
||||
Disables CPU Affinity between UHD/TX/RX Threads (Valid only when deadline scheduler is disabled). By defaulT, CPU Affinity is enabled when not using deadline scheduler. It is enabled only with >2 CPUs. For eNB, CPU_0-> Device library (UHD), CPU_1->TX Threads, CPU_2...CPU_MAX->Rx Threads. For UE, CPU_0->Device Library(UHD), CPU_1..CPU_MAX -> All the UE threads
|
||||
--T-tracer
|
||||
Enables the T tracer.
|
||||
--disable-T-Tracer
|
||||
Disables the T tracer.
|
||||
--disable-hardware-dependency
|
||||
Disable HW dependency during installation
|
||||
--ue-autotest-trace
|
||||
@@ -165,11 +163,8 @@ Options
|
||||
Generates a basic [1 UE + 1 eNB + no channel] simulator.
|
||||
See targets/ARCH/tcp_bridge/README.tcp_bridge_oai for documentation.
|
||||
Usage (first build):
|
||||
oaisim (eNB + UE): ./build_oai -I --oaisim -x --install-system-files
|
||||
Eurecom EXMIMO + COTS UE : ./build_oai -I --eNB -x --install-system-files
|
||||
NI/ETTUS B201 + COTS UE : ./build_oai -I --eNB -x --install-system-files -w USRP
|
||||
Usage (Regular):
|
||||
oaisim : ./build_oai --oaisim -x
|
||||
Eurecom EXMIMO + OAI ENB : ./build_oai --eNB -x
|
||||
NI/ETTUS B201 + OAI ENB : ./build_oai --eNB -x -w USRP"
|
||||
}
|
||||
@@ -255,10 +250,6 @@ function main() {
|
||||
echo_info "Setting transport protocol to: $TP"
|
||||
fi
|
||||
shift 2;;
|
||||
--oaisim)
|
||||
oaisim=1
|
||||
echo_info "Will compile oaisim and drivers nasmesh, ..."
|
||||
shift;;
|
||||
--phy_simulators)
|
||||
SIMUS_PHY=1
|
||||
echo_info "Will compile dlsim, ulsim, ..."
|
||||
@@ -318,9 +309,9 @@ function main() {
|
||||
CPU_AFFINITY_FLAG_USER="False"
|
||||
echo_info "Disabling CPU Affinity (only valid when not using deadline scheduler)"
|
||||
shift 1;;
|
||||
--T-tracer)
|
||||
T_TRACER="True"
|
||||
echo_info "Enabling the T tracer"
|
||||
--disable-T-Tracer)
|
||||
T_TRACER="False"
|
||||
echo_info "Disabling the T tracer"
|
||||
shift 1;;
|
||||
--disable-hardware-dependency)
|
||||
echo_info "Disabling hardware dependency for compiling software"
|
||||
@@ -495,16 +486,6 @@ function main() {
|
||||
check_install_additional_tools
|
||||
fi
|
||||
|
||||
if [ "$oaisim" = "1" ] ; then
|
||||
#to be discussed
|
||||
# there is no RF device transport protocol
|
||||
HW="None"
|
||||
TP="ETHERNET"
|
||||
|
||||
if [ "$XFORMS" == "True" ] ; then
|
||||
PRINT_STATS="True"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
echo_info "3. building the compilation directives ..."
|
||||
@@ -697,129 +678,7 @@ function main() {
|
||||
cp $OPENAIR_DIR/cmake_targets/tools/init_exmimo2 $dbin
|
||||
fi
|
||||
|
||||
# oaisim compilation
|
||||
###############
|
||||
if [ "$oaisim" = "1" ] ; then
|
||||
dconf=$OPENAIR_DIR/targets/bin
|
||||
if [ "$NOS1" = "1" ] ; then
|
||||
oaisim_build_dir=oaisim_noS1_build_oai
|
||||
oaisim_exec=oaisim_nos1
|
||||
else
|
||||
oaisim_build_dir=oaisim_build_oai
|
||||
oaisim_exec=oaisim
|
||||
fi
|
||||
|
||||
echo_info "Compiling $oaisim_exec ($oaisim_build_dir)"
|
||||
cmake_file=$DIR/$oaisim_build_dir/CMakeLists.txt
|
||||
cp $DIR/$oaisim_build_dir/CMakeLists.template $cmake_file
|
||||
echo "set ( CMAKE_BUILD_TYPE $CMAKE_BUILD_TYPE )" >> $cmake_file
|
||||
echo "set ( CFLAGS_PROCESSOR_USER \"$CFLAGS_PROCESSOR_USER\" )" >> $cmake_file
|
||||
echo "set ( XFORMS $XFORMS )" >> $cmake_file
|
||||
echo "set ( UE_EXPANSION $UE_EXPANSION )" >> $cmake_file
|
||||
echo "set ( PHY_TX_THREAD $UE_EXPANSION )" >> $cmake_file
|
||||
echo "set ( PRE_SCD_THREAD $UE_EXPANSION )" >> $cmake_file
|
||||
echo "set ( PRINT_STATS $PRINT_STATS )" >> $cmake_file
|
||||
echo "set ( RRC_ASN1_VERSION \"${REL}\")" >> $cmake_file
|
||||
echo "set ( ENABLE_VCD_FIFO $VCD_TIMING )" >> $cmake_file
|
||||
echo "set ( T_TRACER $T_TRACER )" >> $cmake_file
|
||||
echo "set ( UE_NAS_USE_TUN $UE_NAS_USE_TUN )" >> $cmake_file
|
||||
echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)' >> $cmake_file
|
||||
[ "$CLEAN" = "1" ] && rm -rf $DIR/$oaisim_build_dir/build
|
||||
mkdir -p $DIR/$oaisim_build_dir/build
|
||||
cd $DIR/$oaisim_build_dir/build
|
||||
eval $CMAKE_CMD
|
||||
compilations \
|
||||
$oaisim_build_dir $oaisim_exec \
|
||||
$oaisim_exec $dbin/$oaisim_exec.$REL
|
||||
compilations \
|
||||
$oaisim_build_dir $config_libconfig_shlib \
|
||||
lib$config_libconfig_shlib.so $dbin/lib$config_libconfig_shlib.so
|
||||
compilations \
|
||||
$oaisim_build_dir coding \
|
||||
libcoding.so $dbin/libcoding.so
|
||||
|
||||
if [ "$NOS1" != "1" ] ; then
|
||||
|
||||
[ "$CLEAN" = "1" ] && rm -rf $DIR/at_commands/build
|
||||
echo_info "Compiling at_nas_ue"
|
||||
mkdir -p $DIR/at_commands/build
|
||||
cd $DIR/at_commands/build
|
||||
eval $CMAKE_CMD
|
||||
compilations \
|
||||
at_commands at_nas_ue \
|
||||
at_nas_ue $dbin/at_nas_ue
|
||||
|
||||
# ue_ip driver compilation
|
||||
echo_info "Compiling UE specific part (ue_ip driver and usim tools)"
|
||||
compilations \
|
||||
oaisim_build_oai ue_ip \
|
||||
CMakeFiles/ue_ip/ue_ip.ko $dbin/ue_ip.ko
|
||||
|
||||
[ "$CLEAN" = "1" ] && rm -rf $DIR/nas_sim_tools/build
|
||||
mkdir -p $DIR/nas_sim_tools/build
|
||||
cd $DIR/nas_sim_tools/build
|
||||
eval $CMAKE_CMD
|
||||
compilations \
|
||||
nas_sim_tools usim \
|
||||
usim $dbin/usim
|
||||
compilations \
|
||||
nas_sim_tools nvram \
|
||||
nvram $dbin/nvram
|
||||
compilations \
|
||||
nas_sim_tools conf2uedata \
|
||||
conf2uedata $dbin/conf2uedata
|
||||
|
||||
# generate USIM data
|
||||
if [ -f $dbin/conf2uedata ]; then
|
||||
install_nas_tools $conf_nvram_path $gen_nvram_path
|
||||
else
|
||||
echo_warning "not generated UE NAS files: binaries not found"
|
||||
fi
|
||||
else
|
||||
|
||||
compilations \
|
||||
$oaisim_build_dir rb_tool \
|
||||
rb_tool $dbin/rb_tool
|
||||
|
||||
# nasmesh driver compilation
|
||||
compilations \
|
||||
$oaisim_build_dir nasmesh \
|
||||
CMakeFiles/nasmesh/nasmesh.ko $dbin/nasmesh.ko
|
||||
|
||||
#oai_nw_drv
|
||||
#compilations \
|
||||
# $oaisim_build_dir oai_nw_drv \
|
||||
# CMakeFiles/oai_nw_drv/oai_nw_drv.ko $dbin/oai_nw_drv.ko
|
||||
fi
|
||||
|
||||
if [ "$TP" == "ETHERNET" ] ; then
|
||||
compilations \
|
||||
$oaisim_build_dir oai_eth_transpro \
|
||||
liboai_eth_transpro.so $dbin/liboai_eth_transpro.so.$REL
|
||||
ln -sf liboai_eth_transpro.so liboai_transpro.so
|
||||
ln -sf $dbin/liboai_eth_transpro.so.$REL $dbin/liboai_transpro.so
|
||||
echo_info "liboai_transpro.so is linked with ETHERNET library"
|
||||
fi
|
||||
|
||||
cmake_file=$DIR/oaisim_mme_build_oai/CMakeLists.txt
|
||||
cp $DIR/oaisim_mme_build_oai/CMakeLists.template $cmake_file
|
||||
echo "set ( CMAKE_BUILD_TYPE $CMAKE_BUILD_TYPE )" >> $cmake_file
|
||||
echo "set ( XFORMS $XFORMS )" >> $cmake_file
|
||||
echo "set ( UE_EXPANSION $UE_EXPANSION )" >> $cmake_file
|
||||
echo "set ( PHY_TX_THREAD $UE_EXPANSION )" >> $cmake_file
|
||||
echo "set ( PRE_SCD_THREAD $UE_EXPANSION )" >> $cmake_file
|
||||
echo "set ( RRC_ASN1_VERSION \"${REL}\")" >> $cmake_file
|
||||
echo "set ( ENABLE_VCD_FIFO $VCD_TIMING )" >> $cmake_file
|
||||
echo "set ( T_TRACER $T_TRACER )" >> $cmake_file
|
||||
echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)' >> $cmake_file
|
||||
#[ "$CLEAN" = "1" ] && rm -rf $DIR/oaisim_mme_build_oai/build
|
||||
#mkdir -p $DIR/oaisim_mme_build_oai/build
|
||||
#cd $DIR/oaisim_mme_build_oai/build
|
||||
#eval $CMAKE_CMD
|
||||
#compilations \
|
||||
# oaisim_mme_build_oai oaisim_mme \
|
||||
# oaisim_mme $dbin/oaisim_mme.$REL
|
||||
fi
|
||||
|
||||
# Telnet server compilation
|
||||
#####################
|
||||
@@ -1020,7 +879,7 @@ fi
|
||||
echo "set(PACKAGE_NAME \"simulator_ue\")" >> $cmake_file
|
||||
echo "set (DEADLINE_SCHEDULER \"False\" )" >> $cmake_file
|
||||
echo "set (CPU_AFFINITY \"False\" )" >> $cmake_file
|
||||
echo "set ( T_TRACER \"False\" )" >> $cmake_file
|
||||
echo "set ( T_TRACER \"True\" )" >> $cmake_file
|
||||
echo "set (UE_AUTOTEST_TRACE $UE_AUTOTEST_TRACE)" >> $cmake_file
|
||||
echo "set (UE_DEBUG_TRACE $UE_DEBUG_TRACE)" >> $cmake_file
|
||||
echo "set (UE_TIMING_TRACE $UE_TIMING_TRACE)" >> $cmake_file
|
||||
|
||||
@@ -56,7 +56,7 @@ white='\E[37m'
|
||||
reset_color='\E[00m'
|
||||
COLORIZE=1
|
||||
|
||||
cecho() {
|
||||
cecho() {
|
||||
# Color-echo
|
||||
# arg1 = message
|
||||
# arg2 = color
|
||||
@@ -147,10 +147,10 @@ clean_kernel() {
|
||||
clean_all_files() {
|
||||
set_openair_env
|
||||
dir=$OPENAIR_DIR/cmake_targets
|
||||
rm -rf $dir/log $OPENAIR_DIR/targets/bin/*
|
||||
rm -rf $dir/log $OPENAIR_DIR/targets/bin/*
|
||||
rm -rf $dir/lte_build_oai $dir/lte-simulators/build
|
||||
rm -rf $dir/oaisim_build_oai/build $dir/oaisim_build_oai/CMakeLists.txt
|
||||
rm -rf $dir/autotests/bin $dir/autotests/log $dir/autotests/*/build
|
||||
rm -rf $dir/autotests/bin $dir/autotests/log $dir/autotests/*/build
|
||||
}
|
||||
|
||||
###################################
|
||||
@@ -272,7 +272,7 @@ check_install_usrp_uhd_driver(){
|
||||
v=$(lsb_release -cs)
|
||||
$SUDO apt-add-repository --remove "deb http://files.ettus.com/binaries/uhd/repo/uhd/ubuntu/$v $v main"
|
||||
# The new USRP repository
|
||||
# Raphael Defosseux: Adding a loop on adding PPA because in CI the gpg key retrieve may
|
||||
# Raphael Defosseux: Adding a loop on adding PPA because in CI the gpg key retrieve may
|
||||
# timeout due to proxy / network latencies in Eurecom on VM
|
||||
echo_info "\nAdding PPA repository ettusresearch/uhd\n"
|
||||
x=0
|
||||
@@ -352,7 +352,7 @@ check_install_bladerf_driver(){
|
||||
fi
|
||||
$SUDO apt-get install -y --allow-unauthenticated bladerf libbladerf-dev
|
||||
$SUDO apt-get install -y --allow-unauthenticated bladerf-firmware-fx3
|
||||
$SUDO apt-get install -y --allow-unauthenticated bladerf-fpga-hostedx40
|
||||
$SUDO apt-get install -y --allow-unauthenticated bladerf-fpga-hostedx40
|
||||
elif [[ "$OS_BASEDISTRO" == "fedora" ]]; then
|
||||
install_bladerf_driver_from_source
|
||||
else
|
||||
@@ -373,7 +373,7 @@ check_install_lmssdr_driver(){
|
||||
echo_error "lmssdr support implies installing lmssdr drivers and tools" \
|
||||
" from sources. check:"
|
||||
echo_info "https://open-cells.com/index.php/2017/05/10/limesdr-installation/"
|
||||
echo_fatal "Cannot compile lmssdr device"
|
||||
echo_fatal "Cannot compile lmssdr device"
|
||||
fi
|
||||
|
||||
|
||||
@@ -470,7 +470,7 @@ check_install_additional_tools (){
|
||||
python2-matplotlib"
|
||||
fi
|
||||
$SUDO $INSTALLER install -y $PACKAGE_LIST
|
||||
|
||||
|
||||
$SUDO rm -fr /opt/ssh
|
||||
$SUDO GIT_SSL_NO_VERIFY=true git clone https://gitlab.eurecom.fr/oai/ssh.git /opt/ssh
|
||||
|
||||
@@ -504,24 +504,24 @@ check_install_oai_software() {
|
||||
$SUDO apt install -y software-properties-common
|
||||
case "$(get_distribution_release)" in
|
||||
"ubuntu14.04")
|
||||
specific_packages="libtasn1-3-dev gccxml libgnutls-dev libatlas-dev iproute libconfig8-dev"
|
||||
specific_packages="libtasn1-3-dev libgnutls-dev libatlas-dev iproute libconfig8-dev"
|
||||
# For iperf3
|
||||
$SUDO add-apt-repository "deb http://archive.ubuntu.com/ubuntu trusty-backports universe"
|
||||
$SUDO apt-get update
|
||||
;;
|
||||
"ubuntu16.04")
|
||||
specific_packages="libtasn1-6-dev gccxml libgnutls-dev libatlas-dev iproute libconfig8-dev"
|
||||
specific_packages="libtasn1-6-dev libgnutls-dev libatlas-dev iproute libconfig8-dev"
|
||||
;;
|
||||
"ubuntu17.04")
|
||||
specific_packages="libtasn1-6-dev castxml libgnutls28-dev libatlas-dev iproute libconfig8-dev"
|
||||
specific_packages="libtasn1-6-dev libgnutls28-dev libatlas-dev iproute libconfig8-dev"
|
||||
;;
|
||||
"ubuntu17.10")
|
||||
specific_packages="libtasn1-6-dev castxml libgnutls28-dev iproute libconfig8-dev"
|
||||
specific_packages="libtasn1-6-dev libgnutls28-dev iproute libconfig8-dev"
|
||||
LAPACK_LIBNAME="liblapack.so-x86_64-linux-gnu"
|
||||
LAPACK_TARGET="/usr/lib/x86_64-linux-gnu/atlas/liblapack.so"
|
||||
;;
|
||||
"ubuntu18.04")
|
||||
specific_packages="libtasn1-6-dev castxml libgnutls28-dev iproute2 libconfig-dev"
|
||||
specific_packages="libtasn1-6-dev libgnutls28-dev iproute2 libconfig-dev"
|
||||
LAPACK_LIBNAME="liblapack.so-x86_64-linux-gnu"
|
||||
LAPACK_TARGET="/usr/lib/x86_64-linux-gnu/atlas/liblapack.so"
|
||||
;;
|
||||
@@ -549,6 +549,8 @@ check_install_oai_software() {
|
||||
iptables-dev \
|
||||
libatlas-base-dev \
|
||||
libblas-dev \
|
||||
liblapack-dev\
|
||||
liblapacke-dev\
|
||||
libffi-dev \
|
||||
libforms-bin \
|
||||
libforms-dev \
|
||||
@@ -596,13 +598,10 @@ check_install_oai_software() {
|
||||
$SUDO $INSTALLER install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
|
||||
fi
|
||||
$SUDO $INSTALLER install -y python-epdb
|
||||
$SUDO $INSTALLER install -y gccxml
|
||||
else
|
||||
$SUDO $INSTALLER install -y mscgen pydb
|
||||
# Fedora repos already contain gccxml's successor castxml.
|
||||
$SUDO $INSTALLER install -y castxml
|
||||
fi
|
||||
|
||||
|
||||
$SUDO $INSTALLER install -y \
|
||||
autoconf \
|
||||
automake \
|
||||
@@ -678,8 +677,14 @@ install_asn1c_from_source(){
|
||||
echo_info "\nInstalling ASN1. The log file for ASN1 installation is here: $asn1_install_log "
|
||||
(
|
||||
$SUDO rm -rf /tmp/asn1c
|
||||
GIT_SSL_NO_VERIFY=true git clone https://gitlab.eurecom.fr/oai/asn1c.git /tmp/asn1c
|
||||
# GIT_SSL_NO_VERIFY=true git clone https://gitlab.eurecom.fr/oai/asn1c.git /tmp/asn1c
|
||||
git clone https://gitlab.eurecom.fr/oai/asn1c.git /tmp/asn1c
|
||||
cd /tmp/asn1c
|
||||
# better to use a given commit than a branch in case the branch
|
||||
# is updated and requires modifications in the source of OAI
|
||||
#git checkout velichkov_s1ap_plus_option_group
|
||||
git checkout ec830d70bbb014b769810355a2f321a91ccd8a58
|
||||
autoreconf -iv
|
||||
./configure
|
||||
make -j`nproc`
|
||||
$SUDO make install
|
||||
@@ -689,7 +694,7 @@ install_asn1c_from_source(){
|
||||
}
|
||||
|
||||
#################################################
|
||||
# 2. compile
|
||||
# 2. compile
|
||||
################################################
|
||||
|
||||
install_nas_tools() {
|
||||
@@ -718,7 +723,7 @@ set_openair_env(){
|
||||
[ -f "/.$fullpath" ] || fullpath=`readlink -f $PWD/$fullpath`
|
||||
openair_path=${fullpath%/cmake_targets/*}
|
||||
openair_path=${openair_path%/targets/*}
|
||||
openair_path=${openair_path%/openair[123]/*}
|
||||
openair_path=${openair_path%/openair[123]/*}
|
||||
export OPENAIR_DIR=$openair_path
|
||||
export OPENAIR1_DIR=$openair_path/openair1
|
||||
export OPENAIR2_DIR=$openair_path/openair2
|
||||
@@ -735,7 +740,7 @@ ppid=$$
|
||||
arraycounter=1
|
||||
echo_info "** Trapped CTRL-C. Killing all subprocesses now..."
|
||||
echo_info "** Calling sync now..."
|
||||
sync
|
||||
sync
|
||||
while true
|
||||
do
|
||||
FORLOOP=FALSE
|
||||
@@ -753,7 +758,7 @@ do
|
||||
arraycounter=`expr $arraycounter - 1`
|
||||
## We want to kill child process id first and then parent id's
|
||||
while [ $arraycounter -ne 0 ]
|
||||
do
|
||||
do
|
||||
echo "first we send ctrl-c to program"
|
||||
$SUDO kill -INT "${procid[$arraycounter]}"
|
||||
sleep 5
|
||||
|
||||
@@ -29,9 +29,11 @@
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
#define _GNU_SOURCE
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
#include "config_userapi.h"
|
||||
|
||||
@@ -41,6 +43,7 @@ char *tmpval = value;
|
||||
int optisset=0;
|
||||
char defbool[2]="1";
|
||||
|
||||
|
||||
if ( value == NULL) {
|
||||
if( (cfgoptions->paramflags &PARAMFLAG_BOOL) == 0 ) { /* not a boolean, argument required */
|
||||
fprintf(stderr,"[CONFIG] command line, option %s requires an argument\n",cfgoptions->optname);
|
||||
@@ -103,15 +106,15 @@ char defbool[2]="1";
|
||||
if (optisset == 1) {
|
||||
cfgoptions->paramflags = cfgoptions->paramflags | PARAMFLAG_PARAMSET;
|
||||
}
|
||||
|
||||
return optisset;
|
||||
}
|
||||
|
||||
int config_process_cmdline(paramdef_t *cfgoptions,int numoptions, char *prefix)
|
||||
{
|
||||
char **p = config_get_if()->argv;
|
||||
|
||||
|
||||
int c = config_get_if()->argc;
|
||||
int j;
|
||||
int i,j;
|
||||
char *pp;
|
||||
char *cfgpath;
|
||||
|
||||
@@ -122,42 +125,72 @@ char *cfgpath;
|
||||
return -1;
|
||||
}
|
||||
|
||||
j=0;
|
||||
p++;
|
||||
c--;
|
||||
while (c > 0 && *p != NULL) {
|
||||
if (strcmp(*p, "-h") == 0 || strcmp(*p, "--help") == 0 ) {
|
||||
config_printhelp(cfgoptions,numoptions);
|
||||
j = 0;
|
||||
i = 0;
|
||||
while (c > 0 ) {
|
||||
char *oneargv = strdup(config_get_if()->argv[i]); /* we use strtok_r which modifies its string paramater, and we don't want argv to be modified */
|
||||
/* first check help options, either --help, -h or --help_<section> */
|
||||
if (strncmp(oneargv, "-h",2) == 0 || strncmp(oneargv, "--help",6) == 0 ) {
|
||||
char *tokctx;
|
||||
pp=strtok_r(oneargv, "_",&tokctx);
|
||||
if (pp == NULL || strcasecmp(pp,config_get_if()->argv[i] ) == 0 ) {
|
||||
if( prefix == NULL) {
|
||||
config_printhelp(cfgoptions,numoptions);
|
||||
if ( ! ( CONFIG_ISFLAGSET(CONFIG_NOEXITONHELP)))
|
||||
exit_fun("[CONFIG] Exiting after displaying help\n");
|
||||
}
|
||||
} else {
|
||||
pp=strtok_r(NULL, "_",&tokctx);
|
||||
if ( prefix != NULL && pp != NULL && strncasecmp(prefix,pp,strlen(pp)) == 0 ) {
|
||||
printf ("Help for %s section:\n",prefix);
|
||||
config_printhelp(cfgoptions,numoptions);
|
||||
if ( ! (CONFIG_ISFLAGSET(CONFIG_NOEXITONHELP))) {
|
||||
fprintf(stderr,"[CONFIG] %s %i section %s:", __FILE__, __LINE__, prefix);
|
||||
exit_fun(" Exiting after displaying help\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (*p[0] == '-') {
|
||||
for(int i=0;i<numoptions;i++) {
|
||||
if ( ( cfgoptions[i].paramflags & PARAMFLAG_DISABLECMDLINE) != 0) {
|
||||
/* now, check for non help options */
|
||||
if (oneargv[0] == '-') {
|
||||
for(int n=0;n<numoptions;n++) {
|
||||
if ( ( cfgoptions[n].paramflags & PARAMFLAG_DISABLECMDLINE) != 0) {
|
||||
continue;
|
||||
}
|
||||
if (prefix != NULL) {
|
||||
sprintf(cfgpath,"%s.%s",prefix,cfgoptions[i].optname);
|
||||
sprintf(cfgpath,"%s.%s",prefix,cfgoptions[n].optname);
|
||||
} else {
|
||||
sprintf(cfgpath,"%s",cfgoptions[i].optname);
|
||||
sprintf(cfgpath,"%s",cfgoptions[n].optname);
|
||||
}
|
||||
|
||||
if ( ((strlen(*p) == 2) && (strcmp(*p + 1,cfgpath) == 0)) ||
|
||||
((strlen(*p) > 2) && (strcmp(*p + 2,cfgpath ) == 0 )) ) {
|
||||
pp = *(p+1);
|
||||
if ( ( pp != NULL ) && (c>1) && (pp[0]!= '-') ) {
|
||||
|
||||
j += processoption(&(cfgoptions[i]), pp);
|
||||
} else {
|
||||
j += processoption(&(cfgoptions[i]), NULL);
|
||||
}
|
||||
if ( ((strlen(oneargv) == 2) && (strcmp(oneargv + 1,cfgpath) == 0)) || /* short option, one "-" */
|
||||
((strlen(oneargv) > 2) && (strcmp(oneargv + 2,cfgpath ) == 0 )) ) {
|
||||
char *valptr=NULL;
|
||||
int ret;
|
||||
pp = config_get_if()->argv[i+1];
|
||||
if (pp != NULL && c > 1) {
|
||||
ret = strlen(pp);
|
||||
if (ret > 0 ) {
|
||||
if (pp[0] != '-')
|
||||
valptr=pp;
|
||||
else if ( ret > 1 && pp[0] == '-' && isdigit(pp[1]) )
|
||||
valptr=pp;
|
||||
}
|
||||
}
|
||||
j += processoption(&(cfgoptions[n]), pp);
|
||||
if ( valptr != NULL ) {
|
||||
i++;
|
||||
c--;
|
||||
}
|
||||
break;
|
||||
}
|
||||
} /* for */
|
||||
} /* if (*p[0] == '-') */
|
||||
p++;
|
||||
} /* for n... */
|
||||
} /* if (oneargv[0] == '-') */
|
||||
free(oneargv);
|
||||
i++;
|
||||
c--;
|
||||
} /* fin du while */
|
||||
printf_cmdl("[CONFIG] %s %i options set from command line\n",((prefix == NULL) ? "":prefix),j);
|
||||
printf_cmdl("[CONFIG] %s %i options set from command line\n",((prefix == NULL) ? "(root)":prefix),j);
|
||||
free(cfgpath);
|
||||
return j;
|
||||
} /* parse_cmdline*/
|
||||
|
||||
@@ -97,7 +97,77 @@ int st;
|
||||
}
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
/* from here: interface implementtion of the configuration module */
|
||||
int nooptfunc(void) {
|
||||
return 0;
|
||||
};
|
||||
|
||||
int config_cmdlineonly_getlist(paramlist_def_t *ParamList,
|
||||
paramdef_t *params, int numparams, char *prefix)
|
||||
{
|
||||
ParamList->numelt = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int config_cmdlineonly_get(paramdef_t *cfgoptions,int numoptions, char *prefix )
|
||||
{
|
||||
int defval;
|
||||
int fatalerror=0;
|
||||
int numdefvals=0;
|
||||
|
||||
|
||||
for(int i=0;i<numoptions;i++) {
|
||||
defval=0;
|
||||
switch(cfgoptions[i].type) {
|
||||
case TYPE_STRING:
|
||||
defval=config_setdefault_string(&(cfgoptions[i]), prefix);
|
||||
break;
|
||||
case TYPE_STRINGLIST:
|
||||
defval=config_setdefault_stringlist(&(cfgoptions[i]), prefix);
|
||||
break;
|
||||
case TYPE_UINT8:
|
||||
case TYPE_INT8:
|
||||
case TYPE_UINT16:
|
||||
case TYPE_INT16:
|
||||
case TYPE_UINT32:
|
||||
case TYPE_INT32:
|
||||
case TYPE_MASK:
|
||||
defval=config_setdefault_int(&(cfgoptions[i]), prefix);
|
||||
break;
|
||||
case TYPE_UINT64:
|
||||
case TYPE_INT64:
|
||||
defval=config_setdefault_int64(&(cfgoptions[i]), prefix);
|
||||
break;
|
||||
case TYPE_UINTARRAY:
|
||||
case TYPE_INTARRAY:
|
||||
defval=config_setdefault_intlist(&(cfgoptions[i]), prefix);
|
||||
break;
|
||||
case TYPE_DOUBLE:
|
||||
defval=config_setdefault_double(&(cfgoptions[i]), prefix);
|
||||
break;
|
||||
case TYPE_IPV4ADDR:
|
||||
defval=config_setdefault_ipv4addr(&(cfgoptions[i]), prefix);
|
||||
|
||||
break;
|
||||
default:
|
||||
fprintf(stderr,"[CONFIG] %s.%s type %i not supported\n",prefix, cfgoptions[i].optname,cfgoptions[i].type);
|
||||
fatalerror=1;
|
||||
break;
|
||||
} /* switch on param type */
|
||||
if (defval == 1) {
|
||||
numdefvals++;
|
||||
cfgoptions[i].paramflags = cfgoptions[i].paramflags | PARAMFLAG_PARAMSETDEF;
|
||||
}
|
||||
} /* for loop on options */
|
||||
printf("[CONFIG] %s: %i/%i parameters successfully set \n",
|
||||
((prefix == NULL)?"(root)":prefix),
|
||||
numdefvals,numoptions );
|
||||
if (fatalerror == 1) {
|
||||
fprintf(stderr,"[CONFIG] fatal errors found when assigning %s parameters \n",
|
||||
prefix);
|
||||
}
|
||||
return numdefvals;
|
||||
}
|
||||
|
||||
configmodule_interface_t *load_configmodule(int argc, char **argv)
|
||||
{
|
||||
@@ -110,17 +180,19 @@ uint32_t tmpflags=0;
|
||||
int i;
|
||||
|
||||
/* first parse the command line to look for the -O option */
|
||||
opterr=0;
|
||||
for (i = 0;i<argc;i++) {
|
||||
if (strlen(argv[i]) < 2) continue;
|
||||
if ( argv[i][1] == 'O' && i < (argc -1)) {
|
||||
cfgparam = argv[i+1];
|
||||
}
|
||||
if ( argv[i][1] == 'h' ) {
|
||||
if ( strstr(argv[i], "help_config") != NULL ) {
|
||||
config_printhelp(Config_Params,CONFIG_PARAMLENGTH(Config_Params));
|
||||
exit(0);
|
||||
}
|
||||
if ( (strcmp(argv[i]+1, "h") == 0) || (strstr(argv[i]+1, "help_") != NULL ) ) {
|
||||
tmpflags = CONFIG_HELP;
|
||||
}
|
||||
}
|
||||
optind=1;
|
||||
|
||||
/* look for the OAI_CONFIGMODULE environement variable */
|
||||
if ( cfgparam == NULL ) {
|
||||
@@ -129,21 +201,25 @@ int i;
|
||||
|
||||
/* default */
|
||||
if (cfgparam == NULL) {
|
||||
tmpflags = tmpflags | CONFIG_NOOOPT;
|
||||
cfgparam = DEFAULT_CFGMODE ":" DEFAULT_CFGFILENAME;
|
||||
}
|
||||
tmpflags = tmpflags | CONFIG_NOOOPT;
|
||||
if (strstr(argv[0],"uesoftmodem") == NULL) {
|
||||
cfgparam = CONFIG_LIBCONFIGFILE ":" DEFAULT_CFGFILENAME;
|
||||
} else {
|
||||
cfgparam = CONFIG_CMDLINEONLY ":dbgl0" ;
|
||||
}
|
||||
}
|
||||
|
||||
/* parse the config parameters to set the config source */
|
||||
i = sscanf(cfgparam,"%m[^':']:%ms",&cfgmode,&modeparams);
|
||||
if (i< 0) {
|
||||
fprintf(stderr,"[CONFIG] %s, %d, sscanf error parsing config source %s: %s\n", __FILE__, __LINE__,cfgparam, strerror(errno));
|
||||
cfgmode=strdup(DEFAULT_CFGMODE);
|
||||
modeparams = strdup(DEFAULT_CFGFILENAME);
|
||||
exit(-1);
|
||||
}
|
||||
else if ( i == 1 ) {
|
||||
/* -O argument doesn't contain ":" separator, assume -O <conf file> option, default cfgmode to libconfig
|
||||
with one parameter, the path to the configuration file */
|
||||
modeparams=cfgmode;
|
||||
cfgmode=strdup(DEFAULT_CFGMODE);
|
||||
cfgmode=strdup(CONFIG_LIBCONFIGFILE);
|
||||
}
|
||||
|
||||
cfgptr = malloc(sizeof(configmodule_interface_t));
|
||||
@@ -153,7 +229,6 @@ int i;
|
||||
cfgptr->argc = argc;
|
||||
cfgptr->argv = argv;
|
||||
cfgptr->cfgmode=strdup(cfgmode);
|
||||
|
||||
cfgptr->num_cfgP=0;
|
||||
atoken=strtok_r(modeparams,":",&strtokctx);
|
||||
while ( cfgptr->num_cfgP< CONFIG_MAX_OOPT_PARAMS && atoken != NULL) {
|
||||
@@ -176,24 +251,33 @@ int i;
|
||||
for (i=0;i<cfgptr->num_cfgP; i++) {
|
||||
printf("%s ",cfgptr->cfgP[i]);
|
||||
}
|
||||
printf("\n");
|
||||
printf(", debug flags: 0x%08x\n",cfgptr->rtflags);
|
||||
|
||||
|
||||
i=load_config_sharedlib(cfgptr);
|
||||
if (i< 0) {
|
||||
fprintf(stderr,"[CONFIG] %s %d config module %s couldn't be loaded\n", __FILE__, __LINE__,cfgmode);
|
||||
cfgptr->rtflags = cfgptr->rtflags | CONFIG_HELP | CONFIG_ABORT;
|
||||
if (strstr(cfgparam,CONFIG_CMDLINEONLY) == NULL) {
|
||||
i=load_config_sharedlib(cfgptr);
|
||||
if (i == 0) {
|
||||
printf("[CONFIG] config module %s loaded\n",cfgmode);
|
||||
Config_Params[CONFIGPARAM_DEBUGFLAGS_IDX].uptr=&(cfgptr->rtflags);
|
||||
config_get(Config_Params,CONFIG_PARAMLENGTH(Config_Params), CONFIG_SECTIONNAME );
|
||||
} else {
|
||||
fprintf(stderr,"[CONFIG] %s %d config module \"%s\" couldn't be loaded\n", __FILE__, __LINE__,cfgmode);
|
||||
cfgptr->rtflags = cfgptr->rtflags | CONFIG_HELP | CONFIG_ABORT;
|
||||
}
|
||||
} else {
|
||||
printf("[CONFIG] config module %s loaded\n",cfgmode);
|
||||
Config_Params[CONFIGPARAM_DEBUGFLAGS_IDX].uptr=&(cfgptr->rtflags);
|
||||
config_get(Config_Params,CONFIG_PARAMLENGTH(Config_Params), CONFIG_SECTIONNAME );
|
||||
cfgptr->init = (configmodule_initfunc_t)nooptfunc;
|
||||
cfgptr->get = config_cmdlineonly_get;
|
||||
cfgptr->getlist = config_cmdlineonly_getlist;
|
||||
cfgptr->end = (configmodule_endfunc_t)nooptfunc;
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (modeparams != NULL) free(modeparams);
|
||||
if (cfgmode != NULL) free(cfgmode);
|
||||
if (CONFIG_ISFLAGSET(CONFIG_ABORT)) config_printhelp(Config_Params,CONFIG_PARAMLENGTH(Config_Params));
|
||||
if (CONFIG_ISFLAGSET(CONFIG_ABORT)) {
|
||||
config_printhelp(Config_Params,CONFIG_PARAMLENGTH(Config_Params));
|
||||
// exit(-1);
|
||||
}
|
||||
return cfgptr;
|
||||
}
|
||||
|
||||
|
||||
@@ -41,17 +41,19 @@
|
||||
#define CONFIG_MAX_ALLOCATEDPTRS 1024 // maximum number of parameters that can be dynamicaly allocated in the config module
|
||||
|
||||
/* default values for configuration module parameters */
|
||||
#define DEFAULT_CFGMODE "libconfig" // use libconfig file
|
||||
#define DEFAULT_CFGFILENAME "oai.conf" // default config file
|
||||
#define CONFIG_LIBCONFIGFILE "libconfig" // use libconfig file
|
||||
#define CONFIG_CMDLINEONLY "cmdline" // use only command line options
|
||||
#define DEFAULT_CFGFILENAME "oai.conf" // default config file
|
||||
|
||||
/* rtflags bit position definitions */
|
||||
#define CONFIG_PRINTPARAMS 1 // print parameters values while processing
|
||||
#define CONFIG_DEBUGPTR 1<<1 // print memory allocation/free debug messages
|
||||
#define CONFIG_DEBUGCMDLINE 1<<2 // print command line processing messages
|
||||
#define CONFIG_NOABORTONCHKF 1<<3 // disable abort execution when parameter checking function fails
|
||||
#define CONFIG_HELP 1<<20 // print help message
|
||||
#define CONFIG_ABORT 1<<21 // config failed,abort execution
|
||||
#define CONFIG_NOOOPT 1<<22 // no -O option found when parsing command line
|
||||
#define CONFIG_PRINTPARAMS 1 // print parameters values while processing
|
||||
#define CONFIG_DEBUGPTR (1<<1) // print memory allocation/free debug messages
|
||||
#define CONFIG_DEBUGCMDLINE (1<<2) // print command line processing messages
|
||||
#define CONFIG_NOABORTONCHKF (1<<3) // disable abort execution when parameter checking function fails
|
||||
#define CONFIG_NOEXITONHELP (1<<19) // do not exit after printing help
|
||||
#define CONFIG_HELP (1<<20) // print help message
|
||||
#define CONFIG_ABORT (1<<21) // config failed,abort execution
|
||||
#define CONFIG_NOOOPT (1<<22) // no -O option found when parsing command line
|
||||
typedef int(*configmodule_initfunc_t)(char *cfgP[],int numP);
|
||||
typedef int(*configmodule_getfunc_t)(paramdef_t *,int numparams, char *prefix);
|
||||
typedef int(*configmodule_getlistfunc_t)(paramlist_def_t *, paramdef_t *,int numparams, char *prefix);
|
||||
@@ -75,7 +77,7 @@ typedef struct configmodule_interface
|
||||
#ifdef CONFIG_LOADCONFIG_MAIN
|
||||
configmodule_interface_t *cfgptr=NULL;
|
||||
|
||||
static char config_helpstr [] = "\n lte-softmodem -O [config mode]<:dbg[debugflags]> \n \
|
||||
static char config_helpstr [] = "\n lte-softmodem -O [config mode]<:dbgl[debugflags]> \n \
|
||||
debugflags can also be defined in the config_libconfig section of the config file\n \
|
||||
debugflags: mask, 1->print parameters, 2->print memory allocations debug messages\n \
|
||||
4->print command line processing debug messages\n ";
|
||||
@@ -97,9 +99,9 @@ extern configmodule_interface_t *cfgptr;
|
||||
#endif
|
||||
|
||||
|
||||
#define printf_params(...) if ( (cfgptr->rtflags & CONFIG_PRINTPARAMS) != 0 ) { printf ( __VA_ARGS__ ); }
|
||||
#define printf_ptrs(...) if ( (cfgptr->rtflags & CONFIG_DEBUGPTR) != 0 ) { printf ( __VA_ARGS__ ); }
|
||||
#define printf_cmdl(...) if ( (cfgptr->rtflags & CONFIG_DEBUGCMDLINE) != 0 ) { printf ( __VA_ARGS__ ); }
|
||||
#define printf_params(...) if ( (cfgptr->rtflags & (CONFIG_PRINTPARAMS)) != 0 ) { printf ( __VA_ARGS__ ); }
|
||||
#define printf_ptrs(...) if ( (cfgptr->rtflags & (CONFIG_DEBUGPTR)) != 0 ) { printf ( __VA_ARGS__ ); }
|
||||
#define printf_cmdl(...) if ( (cfgptr->rtflags & (CONFIG_DEBUGCMDLINE)) != 0 ) { printf ( __VA_ARGS__ ); }
|
||||
|
||||
extern configmodule_interface_t *load_configmodule(int argc, char **argv);
|
||||
extern void end_configmodule(void);
|
||||
|
||||
@@ -148,7 +148,10 @@ typedef struct paramdef
|
||||
#define TYPE_MASK 10
|
||||
#define TYPE_DOUBLE 16
|
||||
#define TYPE_IPV4ADDR 20
|
||||
#define TYPE_LASTSCALAR 25
|
||||
|
||||
#define PARAM_ISLISTORARRAY(P) (P->type > TYPE_LASTSCALAR )
|
||||
#define PARAM_ISSCALAR(P) (P->type < TYPE_LASTSCALAR )
|
||||
|
||||
#define TYPE_STRINGLIST 50
|
||||
#define TYPE_INTARRAY 51
|
||||
|
||||
@@ -35,6 +35,8 @@
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
#include <dlfcn.h>
|
||||
#include <arpa/inet.h>
|
||||
|
||||
#include "config_userapi.h"
|
||||
extern void exit_fun(const char* s); // lte-softmodem clean exit function
|
||||
|
||||
@@ -50,10 +52,30 @@ configmodule_interface_t *config_get_if(void)
|
||||
|
||||
char * config_check_valptr(paramdef_t *cfgoptions, char **ptr, int length)
|
||||
{
|
||||
|
||||
if (ptr == NULL ) {
|
||||
ptr = malloc(sizeof(char *));
|
||||
if (ptr != NULL) {
|
||||
*ptr=NULL;
|
||||
cfgoptions->strptr=ptr;
|
||||
if ( (cfgoptions->paramflags & PARAMFLAG_NOFREE) == 0) {
|
||||
config_get_if()->ptrs[config_get_if()->numptrs] = (char *)ptr;
|
||||
config_get_if()->numptrs++;
|
||||
}
|
||||
} else {
|
||||
fprintf(stderr, "[CONFIG] %s %d option %s, cannot allocate pointer: %s \n",
|
||||
__FILE__, __LINE__, cfgoptions->optname, strerror(errno));
|
||||
exit(-1);
|
||||
}
|
||||
}
|
||||
printf_ptrs("[CONFIG] %s ptr: 0x%08lx requested size: %i\n",cfgoptions->optname,(uintptr_t)(ptr),length);
|
||||
if(cfgoptions->numelt > 0) { /* already allocated */
|
||||
return *ptr;
|
||||
if(cfgoptions->numelt > 0 && PARAM_ISSCALAR(cfgoptions) ) { /* already allocated */
|
||||
if (*ptr != NULL) {
|
||||
return *ptr;
|
||||
} else {
|
||||
fprintf(stderr,"[CONFIG] %s %d option %s, definition error: value pointer is NULL, declared as %i bytes allocated\n",
|
||||
__FILE__, __LINE__,cfgoptions->optname, cfgoptions->numelt);
|
||||
exit(-1);
|
||||
}
|
||||
}
|
||||
|
||||
if (*ptr == NULL) {
|
||||
@@ -75,7 +97,7 @@ char * config_check_valptr(paramdef_t *cfgoptions, char **ptr, int length)
|
||||
void config_assign_int(paramdef_t *cfgoptions, char *fullname, int val)
|
||||
{
|
||||
int tmpval=val;
|
||||
if ( ((cfgoptions->paramflags &PARAMFLAG_BOOL) != 0) && tmpval >1) {
|
||||
if ( ((cfgoptions->paramflags &PARAMFLAG_BOOL) != 0) && tmpval >0) {
|
||||
tmpval =1;
|
||||
}
|
||||
switch (cfgoptions->type) {
|
||||
@@ -160,7 +182,7 @@ int st=0;
|
||||
}
|
||||
}
|
||||
if (st != 0) {
|
||||
fprintf(stderr,"[CONFIG] config_execcheck: %i parameters with wrong value\n", -st);
|
||||
fprintf(stderr,"[CONFIG] config_execcheck: section %s %i parameters with wrong value\n", prefix, -st);
|
||||
if ( CONFIG_ISFLAGSET(CONFIG_NOABORTONCHKF) == 0) {
|
||||
exit_fun("exit because configuration failed\n");
|
||||
}
|
||||
@@ -173,7 +195,7 @@ int config_get(paramdef_t *params,int numparams, char *prefix)
|
||||
int ret= -1;
|
||||
|
||||
if (CONFIG_ISFLAGSET(CONFIG_ABORT)) {
|
||||
fprintf(stderr,"[CONFIG] config_get skipped, config module not properly initialized\n");
|
||||
fprintf(stderr,"[CONFIG] config_get, section %s skipped, config module not properly initialized\n",prefix);
|
||||
return ret;
|
||||
}
|
||||
configmodule_interface_t *cfgif = config_get_if();
|
||||
@@ -283,3 +305,115 @@ int config_checkstr_assign_integer(paramdef_t *param)
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
int config_setdefault_string(paramdef_t *cfgoptions, char *prefix)
|
||||
{
|
||||
int status = 0;
|
||||
if( cfgoptions->defstrval != NULL) {
|
||||
status=1;
|
||||
|
||||
if (cfgoptions->numelt == 0 ) {
|
||||
config_check_valptr(cfgoptions, (char **)(cfgoptions->strptr), sizeof(char *));
|
||||
config_check_valptr(cfgoptions, cfgoptions->strptr, strlen(cfgoptions->defstrval)+1);
|
||||
sprintf(*(cfgoptions->strptr), "%s",cfgoptions->defstrval);
|
||||
printf_params("[CONFIG] %s.%s set to default value \"%s\"\n", ((prefix == NULL) ? "" : prefix), cfgoptions->optname, *(cfgoptions->strptr));
|
||||
} else {
|
||||
sprintf((char *)*(cfgoptions->strptr), "%s",cfgoptions->defstrval);
|
||||
printf_params("[CONFIG] %s.%s set to default value \"%s\"\n", ((prefix == NULL) ? "" : prefix), cfgoptions->optname, (char *)*(cfgoptions->strptr));
|
||||
}
|
||||
}
|
||||
return status;
|
||||
}
|
||||
|
||||
int config_setdefault_stringlist(paramdef_t *cfgoptions, char *prefix)
|
||||
{
|
||||
int status = 0;
|
||||
if( cfgoptions->defstrlistval != NULL) {
|
||||
cfgoptions->strlistptr=cfgoptions->defstrlistval;
|
||||
status=1;
|
||||
for(int j=0; j<cfgoptions->numelt; j++)
|
||||
printf_params("[CONFIG] %s.%s[%i] set to default value %s\n", ((prefix == NULL) ? "" : prefix), cfgoptions->optname,j, cfgoptions->strlistptr[j]);
|
||||
}
|
||||
return status;
|
||||
}
|
||||
|
||||
int config_setdefault_int(paramdef_t *cfgoptions, char *prefix)
|
||||
{
|
||||
int status = 0;
|
||||
config_check_valptr(cfgoptions, (char **)(&(cfgoptions->iptr)),sizeof(int32_t));
|
||||
if( ((cfgoptions->paramflags & PARAMFLAG_MANDATORY) == 0)) {
|
||||
config_assign_int(cfgoptions,cfgoptions->optname,cfgoptions->defintval);
|
||||
status=1;
|
||||
printf_params("[CONFIG] %s.%s set to default value\n", ((prefix == NULL) ? "" : prefix), cfgoptions->optname);
|
||||
}
|
||||
return status;
|
||||
}
|
||||
|
||||
int config_setdefault_int64(paramdef_t *cfgoptions, char *prefix)
|
||||
{
|
||||
int status = 0;
|
||||
config_check_valptr(cfgoptions, (char **)&(cfgoptions->i64ptr),sizeof(long long));
|
||||
if( ((cfgoptions->paramflags & PARAMFLAG_MANDATORY) == 0)) {
|
||||
*(cfgoptions->u64ptr)=cfgoptions->defuintval;
|
||||
status=1;
|
||||
printf_params("[CONFIG] %s.%s set to default value %llu\n", ((prefix == NULL) ? "" : prefix), cfgoptions->optname, (long long unsigned)(*(cfgoptions->u64ptr)));
|
||||
}
|
||||
return status;
|
||||
}
|
||||
|
||||
int config_setdefault_intlist(paramdef_t *cfgoptions, char *prefix)
|
||||
{
|
||||
int status = 0;
|
||||
if( cfgoptions->defintarrayval != NULL) {
|
||||
config_check_valptr(cfgoptions,(char **)&(cfgoptions->iptr), sizeof(int32_t*));
|
||||
cfgoptions->iptr=cfgoptions->defintarrayval;
|
||||
status=1;
|
||||
for (int j=0; j<cfgoptions->numelt ; j++) {
|
||||
printf_params("[CONFIG] %s[%i] set to default value %i\n",cfgoptions->optname ,j,(int)cfgoptions->iptr[j]);
|
||||
}
|
||||
}
|
||||
return status;
|
||||
}
|
||||
|
||||
int config_setdefault_double(paramdef_t *cfgoptions, char *prefix)
|
||||
{
|
||||
int status = 0;
|
||||
config_check_valptr(cfgoptions, (char **)&(cfgoptions->dblptr),sizeof(double));
|
||||
if( ((cfgoptions->paramflags & PARAMFLAG_MANDATORY) == 0)) {
|
||||
*(cfgoptions->u64ptr)=cfgoptions->defdblval;
|
||||
status=1;
|
||||
printf_params("[CONFIG] %s set to default value %lf\n",cfgoptions->optname , *(cfgoptions->dblptr));
|
||||
}
|
||||
return status;
|
||||
}
|
||||
|
||||
int config_assign_ipv4addr(paramdef_t *cfgoptions, char *ipv4addr)
|
||||
{
|
||||
config_check_valptr(cfgoptions,(char **)&(cfgoptions->uptr), sizeof(int));
|
||||
int rst=inet_pton(AF_INET, ipv4addr ,cfgoptions->uptr );
|
||||
if (rst == 1 && *(cfgoptions->uptr) > 0) {
|
||||
printf_params("[CONFIG] %s: %s\n",cfgoptions->optname, ipv4addr);
|
||||
return 1;
|
||||
} else {
|
||||
if ( strncmp(ipv4addr,ANY_IPV4ADDR_STRING,sizeof(ANY_IPV4ADDR_STRING)) == 0) {
|
||||
printf_params("[CONFIG] %s:%s (INADDR_ANY) \n",cfgoptions->optname,ipv4addr);
|
||||
*cfgoptions->uptr=INADDR_ANY;
|
||||
return 1;
|
||||
} else {
|
||||
fprintf(stderr,"[CONFIG] %s not valid for %s \n", ipv4addr, cfgoptions->optname);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int config_setdefault_ipv4addr(paramdef_t *cfgoptions, char *prefix)
|
||||
{
|
||||
int status = 0;
|
||||
|
||||
if (cfgoptions->defstrval != NULL) {
|
||||
status = config_assign_ipv4addr(cfgoptions, cfgoptions->defstrval);
|
||||
}
|
||||
return status;
|
||||
}
|
||||
|
||||
@@ -38,10 +38,15 @@
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
/* get rid of "exit_fun undeclared" warning */
|
||||
extern void exit_fun(const char* s);
|
||||
|
||||
#define CONFIG_GETSOURCE ( (config_get_if()==NULL) ? NULL : config_get_if()->cfgmode )
|
||||
#define CONFIG_GETNUMP ( (config_get_if()==NULL) ? 0 : config_get_if()->num_cfgP )
|
||||
#define CONFIG_GETP(P) ( (config_get_if()==NULL) ? NULL : config_get_if()->cfgP[P] )
|
||||
#define CONFIG_ISFLAGSET(P) ( (config_get_if()==NULL) ? 0 : !!(config_get_if()->rtflags & P))
|
||||
#define CONFIG_SETRTFLAG(P) if (config_get_if()) { config_get_if()->rtflags |= P; }
|
||||
#define CONFIG_CLEARRTFLAG(P) if (config_get_if()) { config_get_if()->rtflags &= (~P); }
|
||||
#define CONFIG_ISPARAMFLAGSET(P,F) ( !!(P.paramflags & F))
|
||||
/* utility functions, to be used by configuration module and/or configuration libraries */
|
||||
extern configmodule_interface_t *config_get_if(void);
|
||||
@@ -50,6 +55,7 @@ extern void config_printhelp(paramdef_t *,int numparams);
|
||||
extern int config_process_cmdline(paramdef_t *params,int numparams, char *prefix);
|
||||
extern void config_assign_processedint(paramdef_t *cfgoption, int val);
|
||||
extern void config_assign_int(paramdef_t *cfgoptions, char *fullname, int val);
|
||||
extern int config_assign_ipv4addr(paramdef_t *cfgoptions, char *ipv4addr);
|
||||
|
||||
/* apis to get parameters, to be used by oai modules, at configuration time */
|
||||
extern int config_get(paramdef_t *params,int numparams, char *prefix);
|
||||
@@ -66,6 +72,15 @@ extern int config_check_intrange(paramdef_t *param);
|
||||
extern int config_check_strval(paramdef_t *param);
|
||||
extern int config_checkstr_assign_integer(paramdef_t *param);
|
||||
|
||||
/* functions to set a parameter to its default value */
|
||||
extern int config_setdefault_string(paramdef_t *cfgoptions, char *prefix);
|
||||
extern int config_setdefault_stringlist(paramdef_t *cfgoptions, char *prefix);
|
||||
extern int config_setdefault_int(paramdef_t *cfgoptions, char *prefix);
|
||||
extern int config_setdefault_int64(paramdef_t *cfgoptions, char *prefix);
|
||||
extern int config_setdefault_intlist(paramdef_t *cfgoptions, char *prefix);
|
||||
extern int config_setdefault_double(paramdef_t *cfgoptions, char *prefix);
|
||||
extern int config_setdefault_ipv4addr(paramdef_t *cfgoptions, char *prefix);
|
||||
|
||||
#define CONFIG_GETCONFFILE (config_get_if()->cfgP[0])
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -129,8 +129,6 @@ int config_libconfig_get(paramdef_t *cfgoptions,int numoptions, char *prefix )
|
||||
switch(cfgoptions[i].type)
|
||||
{
|
||||
case TYPE_STRING:
|
||||
|
||||
printf("call config_lookup_string for '%s' %p\n", cfgpath, &(libconfig_privdata.cfg)); fflush(stdout);
|
||||
if ( config_lookup_string(&(libconfig_privdata.cfg),cfgpath, (const char **)&str)) {
|
||||
if ( cfgoptions[i].numelt > 0 && str != NULL && strlen(str) >= cfgoptions[i].numelt ) {
|
||||
fprintf(stderr,"[LIBCONFIG] %s: %s exceeds maximum length of %i bytes, value truncated\n",
|
||||
@@ -138,7 +136,7 @@ printf("call config_lookup_string for '%s' %p\n", cfgpath, &(libconfig_privdata.
|
||||
str[strlen(str)-1] = 0;
|
||||
}
|
||||
if (cfgoptions[i].numelt == 0 ) {
|
||||
config_check_valptr(&(cfgoptions[i]), (char **)(&(cfgoptions[i].strptr)), sizeof(char *));
|
||||
// config_check_valptr(&(cfgoptions[i]), (char **)(&(cfgoptions[i].strptr)), sizeof(char *));
|
||||
config_check_valptr(&(cfgoptions[i]), cfgoptions[i].strptr, strlen(str)+1);
|
||||
sprintf( *(cfgoptions[i].strptr) , "%s", str);
|
||||
printf_params("[LIBCONFIG] %s: \"%s\"\n", cfgpath,*(cfgoptions[i].strptr) );
|
||||
@@ -147,21 +145,7 @@ printf("call config_lookup_string for '%s' %p\n", cfgpath, &(libconfig_privdata.
|
||||
printf_params("[LIBCONFIG] %s: \"%s\"\n", cfgpath,(char *)cfgoptions[i].strptr );
|
||||
}
|
||||
} else {
|
||||
if( cfgoptions[i].defstrval != NULL) {
|
||||
defval=1;
|
||||
|
||||
if (cfgoptions[i].numelt == 0 ) {
|
||||
config_check_valptr(&(cfgoptions[i]), (char **)(&(cfgoptions[i].strptr)), sizeof(char *));
|
||||
config_check_valptr(&(cfgoptions[i]), cfgoptions[i].strptr, strlen(cfgoptions[i].defstrval)+1);
|
||||
sprintf(*(cfgoptions[i].strptr), "%s",cfgoptions[i].defstrval);
|
||||
printf_params("[LIBCONFIG] %s set to default value \"%s\"\n", cfgpath, *(cfgoptions[i].strptr));
|
||||
} else {
|
||||
sprintf((char *)*(cfgoptions[i].strptr), "%s",cfgoptions[i].defstrval);
|
||||
printf_params("[LIBCONFIG] %s set to default value \"%s\"\n", cfgpath, (char *)*(cfgoptions[i].strptr));
|
||||
}
|
||||
} else {
|
||||
notfound=1;
|
||||
}
|
||||
defval=config_setdefault_string(&(cfgoptions[i]),prefix);
|
||||
}
|
||||
break;
|
||||
case TYPE_STRINGLIST:
|
||||
@@ -169,14 +153,7 @@ printf("call config_lookup_string for '%s' %p\n", cfgpath, &(libconfig_privdata.
|
||||
if ( setting != NULL) {
|
||||
read_strlist(&cfgoptions[i],setting,cfgpath);
|
||||
} else {
|
||||
if( cfgoptions[i].defstrlistval != NULL) {
|
||||
cfgoptions[i].strlistptr=cfgoptions[i].defstrlistval;
|
||||
defval=1;
|
||||
for(int j=0; j<cfgoptions[i].numelt; j++)
|
||||
printf_params("[LIBCONFIG] %s%i set to default value %s\n", cfgpath,j, cfgoptions[i].strlistptr[j]);
|
||||
} else {
|
||||
notfound=1;
|
||||
}
|
||||
defval=config_setdefault_stringlist(&(cfgoptions[i]),prefix);
|
||||
}
|
||||
break;
|
||||
case TYPE_UINT8:
|
||||
@@ -186,23 +163,17 @@ printf("call config_lookup_string for '%s' %p\n", cfgpath, &(libconfig_privdata.
|
||||
case TYPE_UINT32:
|
||||
case TYPE_INT32:
|
||||
case TYPE_MASK:
|
||||
config_check_valptr(&(cfgoptions[i]), (char **)(&(cfgoptions[i].iptr)),sizeof(int32_t));
|
||||
if ( config_lookup_int(&(libconfig_privdata.cfg),cfgpath, &u)) {
|
||||
config_check_valptr(&(cfgoptions[i]), (char **)(&(cfgoptions[i].iptr)),sizeof(int32_t));
|
||||
config_assign_int(&(cfgoptions[i]),cfgpath,u);
|
||||
} else {
|
||||
if( ((cfgoptions[i].paramflags & PARAMFLAG_MANDATORY) == 0)) {
|
||||
config_assign_int(&(cfgoptions[i]),cfgpath,cfgoptions[i].defintval);
|
||||
defval=1;
|
||||
printf_params("[LIBCONFIG] %s set to default value\n", cfgpath);
|
||||
} else {
|
||||
notfound=1;
|
||||
}
|
||||
defval=config_setdefault_int(&(cfgoptions[i]),prefix);
|
||||
}
|
||||
break;
|
||||
case TYPE_UINT64:
|
||||
case TYPE_INT64:
|
||||
config_check_valptr(&(cfgoptions[i]), (char **)&(cfgoptions[i].i64ptr),sizeof(long long));
|
||||
if ( config_lookup_int64(&(libconfig_privdata.cfg),cfgpath, &llu)) {
|
||||
config_check_valptr(&(cfgoptions[i]), (char **)&(cfgoptions[i].i64ptr),sizeof(long long));
|
||||
if(cfgoptions[i].type==TYPE_UINT64) {
|
||||
*(cfgoptions[i].u64ptr) = (uint64_t)llu;
|
||||
printf_params("[LIBCONFIG] %s: %llu\n", cfgpath,(long long unsigned)(*(cfgoptions[i].u64ptr)) );
|
||||
@@ -211,13 +182,7 @@ printf("call config_lookup_string for '%s' %p\n", cfgpath, &(libconfig_privdata.
|
||||
printf_params("[LIBCONFIG] %s: %lli\n", cfgpath,(long long unsigned)(*(cfgoptions[i].i64ptr)) );
|
||||
}
|
||||
} else {
|
||||
if( ((cfgoptions[i].paramflags & PARAMFLAG_MANDATORY) == 0)) {
|
||||
*(cfgoptions[i].u64ptr)=cfgoptions[i].defuintval;
|
||||
defval=1;
|
||||
printf_params("[LIBCONFIG] %s set to default value %llu\n", cfgpath, (long long unsigned)(*(cfgoptions[i].u64ptr)));
|
||||
} else {
|
||||
notfound=1;
|
||||
}
|
||||
defval=config_setdefault_int64(&(cfgoptions[i]),prefix);
|
||||
}
|
||||
break;
|
||||
case TYPE_UINTARRAY:
|
||||
@@ -226,57 +191,28 @@ printf("call config_lookup_string for '%s' %p\n", cfgpath, &(libconfig_privdata.
|
||||
if ( setting != NULL) {
|
||||
read_intarray(&cfgoptions[i],setting,cfgpath);
|
||||
} else {
|
||||
if( cfgoptions[i].defintarrayval != NULL) {
|
||||
config_check_valptr(&(cfgoptions[i]),(char **)&(cfgoptions[i].iptr), sizeof(int32_t*));
|
||||
cfgoptions[i].iptr=cfgoptions[i].defintarrayval;
|
||||
defval=1;
|
||||
for (int j=0; j<cfgoptions[i].numelt ; j++) {
|
||||
printf_params("[LIBCONFIG] %s[%i] set to default value %i\n", cfgpath,j,(int)cfgoptions[i].iptr[j]);
|
||||
}
|
||||
} else {
|
||||
notfound=1;
|
||||
}
|
||||
defval=config_setdefault_intlist(&(cfgoptions[i]),prefix);
|
||||
}
|
||||
break;
|
||||
case TYPE_DOUBLE:
|
||||
config_check_valptr(&(cfgoptions[i]), (char **)&(cfgoptions[i].dblptr),sizeof(double));
|
||||
if ( config_lookup_float(&(libconfig_privdata.cfg),cfgpath, &dbl)) {
|
||||
config_check_valptr(&(cfgoptions[i]), (char **)&(cfgoptions[i].dblptr),sizeof(double));
|
||||
*(cfgoptions[i].dblptr) = dbl;
|
||||
printf_params("[LIBCONFIG] %s: %lf\n", cfgpath,*(cfgoptions[i].dblptr) );
|
||||
} else {
|
||||
if( ((cfgoptions[i].paramflags & PARAMFLAG_MANDATORY) == 0)) {
|
||||
*(cfgoptions[i].u64ptr)=cfgoptions[i].defdblval;
|
||||
defval=1;
|
||||
printf_params("[LIBCONFIG] %s set to default value %lf\n", cfgpath, *(cfgoptions[i].dblptr));
|
||||
} else {
|
||||
notfound=1;
|
||||
}
|
||||
defval=config_setdefault_double(&(cfgoptions[i]),prefix);
|
||||
}
|
||||
break;
|
||||
case TYPE_IPV4ADDR:
|
||||
config_check_valptr(&(cfgoptions[i]),(char **)&(cfgoptions[i].uptr), sizeof(int));
|
||||
if ( !config_lookup_string(&(libconfig_privdata.cfg),cfgpath, (const char **)&str)) {
|
||||
str=cfgoptions[i].defstrval;
|
||||
defval=1;
|
||||
printf_params("[LIBCONFIG] %s set to default value %s\n", cfgpath, str);
|
||||
}
|
||||
if (str != NULL) {
|
||||
rst=inet_pton(AF_INET, str,cfgoptions[i].uptr );
|
||||
if (rst == 1 && *(cfgoptions[i].uptr) > 0) {
|
||||
printf_params("[LIBCONFIG] %s: %s\n", cfgpath,str );
|
||||
} else {
|
||||
if ( strncmp(str,ANY_IPV4ADDR_STRING,sizeof(ANY_IPV4ADDR_STRING)) == 0) {
|
||||
printf_params("[LIBCONFIG] %s:%s (INADDR_ANY) \n",cfgpath,str);
|
||||
*cfgoptions[i].uptr=INADDR_ANY;
|
||||
} else {
|
||||
fprintf(stderr,"[LIBCONFIG] %s not valid for %s \n", str, cfgpath);
|
||||
fatalerror=1;
|
||||
}
|
||||
defval=config_setdefault_ipv4addr(&(cfgoptions[i]),prefix);
|
||||
} else {
|
||||
rst=config_assign_ipv4addr(cfgoptions, str);
|
||||
if (rst < 0) {
|
||||
fprintf(stderr,"[LIBCONFIG] %s not valid for %s \n", str, cfgpath);
|
||||
fatalerror=1;
|
||||
}
|
||||
} else {
|
||||
notfound=1;
|
||||
}
|
||||
|
||||
}
|
||||
break;
|
||||
case TYPE_LIST:
|
||||
setting = config_setting_lookup (config_root_setting(&(libconfig_privdata.cfg)),cfgpath );
|
||||
|
||||
+5
-11
@@ -169,19 +169,13 @@ int T_dont_fork; /* default is to fork, see 'T_init' to understand */
|
||||
|
||||
paramdef_t ttraceparams[] = CMDLINE_TTRACEPARAMS_DESC ;
|
||||
|
||||
/* compatibility: look for TTracer parameters in root section */
|
||||
config_get( ttraceparams,sizeof(ttraceparams)/sizeof(paramdef_t),NULL);
|
||||
/* for a cleaner config file, TTracer params should be defined in a specific section... */
|
||||
config_get( ttraceparams,sizeof(ttraceparams)/sizeof(paramdef_t),TTRACER_CONFIG_PREFIX);
|
||||
|
||||
/* compatibility: look for TTracer command line options in root section */
|
||||
config_process_cmdline( ttraceparams,sizeof(ttraceparams)/sizeof(paramdef_t),NULL);
|
||||
|
||||
/* but for a cleaner config file, TTracer params should be defined in a specific section... */
|
||||
int ret = config_get( ttraceparams,sizeof(ttraceparams)/sizeof(paramdef_t),TTRACER_CONFIG_PREFIX);
|
||||
if (ret <0) {
|
||||
printf( "TTracer configuration couldn't be performed via config module\n");
|
||||
}
|
||||
if (T_stdout == 0) {
|
||||
T_init(T_port, 1-T_nowait, T_dont_fork);
|
||||
} else {
|
||||
for( int i=0 ; i<T_NUMBER_OF_IDS ; i++ ) {
|
||||
T_active[i] = T_ACTIVE_STDOUT;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -100,7 +100,7 @@ extern int T_stdout;
|
||||
20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0)(__VA_ARGS__)
|
||||
#define TN_N(n0,n1,n2,n3,n4,n5,n6,n7,n8,n9,n10,n11,n12,n13,n14,n15,n16,n17,\
|
||||
n18,n19,n20,n21,n22,n23,n24,n25,n26,n27,n28,n29,n30,n31,n32,n,...) T##n
|
||||
#define T(...) if(T_stdout == 0) {TN(__VA_ARGS__);}
|
||||
#define T(...) do { if (T_stdout == 0) TN(__VA_ARGS__); } while (0)
|
||||
|
||||
/* type used to send arbitrary buffer data */
|
||||
typedef struct {
|
||||
|
||||
@@ -39,10 +39,10 @@ typedef struct {
|
||||
#define T_SHM_FILENAME "/T_shm_segment"
|
||||
|
||||
/* number of VCD functions (to be kept up to date! see in T_messages.txt) */
|
||||
#define VCD_NUM_FUNCTIONS 187
|
||||
#define VCD_NUM_FUNCTIONS 190
|
||||
|
||||
/* number of VCD variables (to be kept up to date! see in T_messages.txt) */
|
||||
#define VCD_NUM_VARIABLES 131
|
||||
#define VCD_NUM_VARIABLES 128
|
||||
|
||||
/* first VCD function (to be kept up to date! see in T_messages.txt) */
|
||||
#define VCD_FIRST_FUNCTION ((uintptr_t)T_VCD_FUNCTION_RT_SLEEP)
|
||||
|
||||
@@ -750,6 +750,27 @@ ID = LEGACY_OSA_TRACE
|
||||
GROUP = ALL:LEGACY_OSA:LEGACY_GROUP_TRACE:LEGACY
|
||||
FORMAT = string,log
|
||||
|
||||
ID = LEGACY_SIM_INFO
|
||||
DESC = SIM legacy logs - info level
|
||||
GROUP = ALL:LEGACY_SIM:LEGACY_GROUP_INFO:LEGACY
|
||||
FORMAT = string,log
|
||||
ID = LEGACY_SIM_ERROR
|
||||
DESC = SIM legacy logs - error level
|
||||
GROUP = ALL:LEGACY_SIM:LEGACY_GROUP_ERROR:LEGACY
|
||||
FORMAT = string,log
|
||||
ID = LEGACY_SIM_WARNING
|
||||
DESC = SIM legacy logs - warning level
|
||||
GROUP = ALL:LEGACY_SIM:LEGACY_GROUP_WARNING:LEGACY
|
||||
FORMAT = string,log
|
||||
ID = LEGACY_SIM_DEBUG
|
||||
DESC = SIM legacy logs - debug level
|
||||
GROUP = ALL:LEGACY_SIM:LEGACY_GROUP_DEBUG:LEGACY
|
||||
FORMAT = string,log
|
||||
ID = LEGACY_SIM_TRACE
|
||||
DESC = SIM legacy logs - trace level
|
||||
GROUP = ALL:LEGACY_SIM:LEGACY_GROUP_TRACE:LEGACY
|
||||
FORMAT = string,log
|
||||
|
||||
# this is a bad hack but I won't fix (function util_print_hex_octets
|
||||
# in openairinterface5g/openair2/LAYER2/PDCP_v10.1.0/pdcp_util.c
|
||||
# does funky things with the LOG_x macros but we work on the C pre-processor
|
||||
@@ -1034,18 +1055,6 @@ ID = VCD_VARIABLE_SUBFRAME_NUMBER_RX1_UE
|
||||
DESC = VCD variable SUBFRAME_NUMBER_RX1_UE
|
||||
GROUP = ALL:VCD:UE:VCD_VARIABLE
|
||||
FORMAT = ulong,value
|
||||
ID = VCD_VARIABLE_MISSED_SLOTS_ENB
|
||||
DESC = VCD variable MISSED_SLOTS_ENB
|
||||
GROUP = ALL:VCD:ENB:VCD_VARIABLE
|
||||
FORMAT = ulong,value
|
||||
ID = VCD_VARIABLE_DAQ_MBOX
|
||||
DESC = VCD variable DAQ_MBOX
|
||||
GROUP = ALL:VCD:ENB:VCD_VARIABLE
|
||||
FORMAT = ulong,value
|
||||
ID = VCD_VARIABLE_UE_OFFSET_MBOX
|
||||
DESC = VCD variable UE_OFFSET_MBOX
|
||||
GROUP = ALL:VCD:UE:VCD_VARIABLE
|
||||
FORMAT = ulong,value
|
||||
ID = VCD_VARIABLE_UE_RX_OFFSET
|
||||
DESC = VCD variable UE_RX_OFFSET
|
||||
GROUP = ALL:VCD:UE:VCD_VARIABLE
|
||||
@@ -1553,6 +1562,18 @@ ID = VCD_FUNCTION_UE_LOCK_MUTEX_RXTX_FOR_CNT_INCREMENT1
|
||||
DESC = VCD function UE_LOCK_MUTEX_RXTX_FOR_CNT_INCREMENT1
|
||||
GROUP = ALL:VCD:UE:VCD_FUNCTION
|
||||
FORMAT = int,value
|
||||
ID = VCD_FUNCTION_SIM_DO_DL_SIGNAL
|
||||
DESC = VCD function SIM_DO_DL_SIGNAL
|
||||
GROUP = ALL:VCD:ENB:VCD_FUNCTION
|
||||
FORMAT = int,value
|
||||
ID = VCD_FUNCTION_SIM_DO_UL_SIGNAL
|
||||
DESC = VCD function SIM_DO_UL_SIGNAL
|
||||
GROUP = ALL:VCD:ENB:VCD_FUNCTION
|
||||
FORMAT = int,value
|
||||
ID = VCD_FUNCTION_SIM_UE_TRX_READ
|
||||
DESC = VCD function SIM_UE_TRX_READ
|
||||
GROUP = ALL:VCD:ENB:VCD_FUNCTION
|
||||
FORMAT = int,value
|
||||
ID = VCD_FUNCTION_eNB_TX
|
||||
DESC = VCD function eNB_TX
|
||||
GROUP = ALL:VCD:ENB:VCD_FUNCTION
|
||||
|
||||
@@ -367,20 +367,24 @@ void T_local_tracer_main(int remote_port, int wait_for_tracer,
|
||||
int port = remote_port;
|
||||
int dont_wait = wait_for_tracer ? 0 : 1;
|
||||
void *f;
|
||||
|
||||
printf("local tracer starting\n");
|
||||
/* write on a socket fails if the other end is closed and we get SIGPIPE */
|
||||
if (signal(SIGPIPE, SIG_IGN) == SIG_ERR) abort();
|
||||
if (signal(SIGPIPE, SIG_IGN) == SIG_ERR){
|
||||
printf("local tracer received SIGPIPE\n");
|
||||
abort();
|
||||
}
|
||||
|
||||
init_shm(shm_file);
|
||||
s = local_socket;
|
||||
|
||||
printf("local tracer starting step 2\n");
|
||||
if (dont_wait) {
|
||||
char t = 2;
|
||||
printf("local tracer in no wait mode \n");
|
||||
if (write(s, &t, 1) != 1) abort();
|
||||
}
|
||||
|
||||
printf("local tracer starting step 3\n");
|
||||
f = forwarder(port, s);
|
||||
|
||||
printf("local tracer main loop.... \n");
|
||||
/* read messages */
|
||||
while (1) {
|
||||
wait_message();
|
||||
|
||||
@@ -39,7 +39,6 @@
|
||||
|
||||
#include "assertions.h"
|
||||
#include "intertask_interface.h"
|
||||
#include "intertask_interface_dump.h"
|
||||
|
||||
#if T_TRACER
|
||||
#include "T.h"
|
||||
@@ -770,7 +769,7 @@ void itti_terminate_tasks(task_id_t task_id)
|
||||
}
|
||||
|
||||
int itti_init(task_id_t task_max, thread_id_t thread_max, MessagesIds messages_id_max, const task_info_t *tasks_info,
|
||||
const message_info_t *messages_info, const char * const messages_definition_xml, const char * const dump_file_name)
|
||||
const message_info_t *messages_info)
|
||||
{
|
||||
task_id_t task_id;
|
||||
thread_id_t thread_id;
|
||||
|
||||
@@ -1,790 +0,0 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/** @brief Intertask Interface Signal Dumper
|
||||
* Allows users to connect their itti_analyzer to this process and dump
|
||||
* signals exchanged between tasks.
|
||||
* @author Sebastien Roux <sebastien.roux@eurecom.fr>
|
||||
*/
|
||||
|
||||
#define _GNU_SOURCE // required for pthread_setname_np()
|
||||
#include <pthread.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
#include <errno.h>
|
||||
#include <error.h>
|
||||
#include <sched.h>
|
||||
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/select.h>
|
||||
#include <sys/types.h>
|
||||
#include <arpa/inet.h>
|
||||
|
||||
#include <sys/eventfd.h>
|
||||
|
||||
#include "assertions.h"
|
||||
#include "liblfds611.h"
|
||||
|
||||
#include "itti_types.h"
|
||||
#include "intertask_interface.h"
|
||||
#include "intertask_interface_dump.h"
|
||||
|
||||
#if T_TRACER
|
||||
#include "T.h"
|
||||
#endif
|
||||
|
||||
static const int itti_dump_debug = 0; // 0x8 | 0x4 | 0x2;
|
||||
|
||||
# define ITTI_DUMP_DEBUG(m, x, args...) do { if ((m) & itti_dump_debug) fprintf(stdout, "[ITTI_DUMP][D]"x, ##args); } \
|
||||
while(0)
|
||||
#define ITTI_DUMP_ERROR(x, args...) do { fprintf(stdout, "[ITTI_DUMP][E]"x, ##args); } \
|
||||
while(0)
|
||||
|
||||
|
||||
typedef struct itti_dump_queue_item_s {
|
||||
MessageDef *data;
|
||||
uint32_t data_size;
|
||||
uint32_t message_number;
|
||||
uint32_t message_type;
|
||||
uint32_t message_size;
|
||||
} itti_dump_queue_item_t;
|
||||
|
||||
typedef struct {
|
||||
int sd;
|
||||
uint32_t last_message_number;
|
||||
} itti_client_desc_t;
|
||||
|
||||
typedef struct itti_desc_s {
|
||||
/* Asynchronous thread that write to file/accept new clients */
|
||||
pthread_t itti_acceptor_thread;
|
||||
pthread_attr_t attr;
|
||||
|
||||
/* List of messages to dump.
|
||||
* NOTE: we limit the size of this queue to retain only the last exchanged
|
||||
* messages. The size can be increased by setting up the ITTI_QUEUE_MAX_ELEMENTS
|
||||
* in mme_default_values.h or by putting a custom in the configuration file.
|
||||
*/
|
||||
struct lfds611_ringbuffer_state *itti_message_queue;
|
||||
|
||||
int nb_connected;
|
||||
|
||||
/* Event fd used to notify new messages (semaphore) */
|
||||
int event_fd;
|
||||
int itti_listen_socket;
|
||||
|
||||
itti_client_desc_t itti_clients[ITTI_DUMP_MAX_CON];
|
||||
} itti_desc_t;
|
||||
|
||||
typedef struct {
|
||||
itti_socket_header_t socket_header;
|
||||
|
||||
itti_signal_header_t signal_header;
|
||||
|
||||
/* Message payload is added here, this struct is used as an header */
|
||||
} itti_dump_message_t;
|
||||
|
||||
typedef struct {
|
||||
itti_socket_header_t socket_header;
|
||||
} itti_statistic_message_t;
|
||||
|
||||
static const itti_message_types_t itti_dump_xml_definition_end = ITTI_DUMP_XML_DEFINITION_END;
|
||||
static const itti_message_types_t itti_dump_message_type_end = ITTI_DUMP_MESSAGE_TYPE_END;
|
||||
|
||||
static itti_desc_t itti_dump_queue;
|
||||
static FILE *dump_file = NULL;
|
||||
static int itti_dump_running = 1;
|
||||
|
||||
static volatile uint32_t pending_messages = 0;
|
||||
|
||||
/*------------------------------------------------------------------------------*/
|
||||
static int itti_dump_send_message(int sd, itti_dump_queue_item_t *message)
|
||||
{
|
||||
itti_dump_message_t *new_message;
|
||||
ssize_t bytes_sent = 0, total_sent = 0;
|
||||
uint8_t *data_ptr;
|
||||
|
||||
/* Allocate memory for message header and payload */
|
||||
size_t size = sizeof(itti_dump_message_t) + message->data_size + sizeof(itti_message_types_t);
|
||||
|
||||
AssertFatal (sd > 0, "Socket descriptor (%d) is invalid!\n", sd);
|
||||
AssertFatal (message != NULL, "Message is NULL!\n");
|
||||
|
||||
new_message = malloc(size);
|
||||
AssertFatal (new_message != NULL, "New message allocation failed!\n");
|
||||
|
||||
/* Preparing the header */
|
||||
new_message->socket_header.message_size = size;
|
||||
new_message->socket_header.message_type = ITTI_DUMP_MESSAGE_TYPE;
|
||||
/* Adds message number in unsigned decimal ASCII format */
|
||||
snprintf(new_message->signal_header.message_number_char, sizeof(new_message->signal_header.message_number_char),
|
||||
MESSAGE_NUMBER_CHAR_FORMAT, message->message_number);
|
||||
new_message->signal_header.message_number_char[sizeof(new_message->signal_header.message_number_char) - 1] = '\n';
|
||||
/* Appends message payload */
|
||||
memcpy(&new_message[1], message->data, message->data_size);
|
||||
|
||||
memcpy(((void *) &new_message[1]) + message->data_size, &itti_dump_message_type_end, sizeof(itti_message_types_t));
|
||||
|
||||
data_ptr = (uint8_t *)&new_message[0];
|
||||
|
||||
do {
|
||||
bytes_sent = send(sd, &data_ptr[total_sent], size - total_sent, 0);
|
||||
|
||||
if (bytes_sent < 0) {
|
||||
ITTI_DUMP_ERROR("[%d] Failed to send %zu bytes to socket (%d:%s)\n",
|
||||
sd, size, errno, strerror(errno));
|
||||
free(new_message);
|
||||
return -1;
|
||||
}
|
||||
|
||||
total_sent += bytes_sent;
|
||||
} while (total_sent != size);
|
||||
|
||||
free(new_message);
|
||||
return total_sent;
|
||||
}
|
||||
|
||||
static int itti_dump_fwrite_message(itti_dump_queue_item_t *message)
|
||||
{
|
||||
itti_dump_message_t new_message_header;
|
||||
|
||||
if ((dump_file != NULL) && (message != NULL)) {
|
||||
|
||||
new_message_header.socket_header.message_size = message->message_size + sizeof(itti_dump_message_t) + sizeof(itti_message_types_t);
|
||||
new_message_header.socket_header.message_type = message->message_type;
|
||||
snprintf(new_message_header.signal_header.message_number_char, sizeof(new_message_header.signal_header.message_number_char),
|
||||
MESSAGE_NUMBER_CHAR_FORMAT, message->message_number);
|
||||
new_message_header.signal_header.message_number_char[sizeof(new_message_header.signal_header.message_number_char) - 1] = '\n';
|
||||
|
||||
fwrite (&new_message_header, sizeof(itti_dump_message_t), 1, dump_file);
|
||||
fwrite (message->data, message->data_size, 1, dump_file);
|
||||
fwrite (&itti_dump_message_type_end, sizeof(itti_message_types_t), 1, dump_file);
|
||||
fflush (dump_file);
|
||||
return (1);
|
||||
}
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
static int itti_dump_send_xml_definition(const int sd, const char *message_definition_xml,
|
||||
const uint32_t message_definition_xml_length)
|
||||
{
|
||||
itti_socket_header_t *itti_dump_message;
|
||||
/* Allocate memory for message header and payload */
|
||||
size_t itti_dump_message_size;
|
||||
ssize_t bytes_sent = 0, total_sent = 0;
|
||||
uint8_t *data_ptr;
|
||||
|
||||
AssertFatal (sd > 0, "Socket descriptor (%d) is invalid!\n", sd);
|
||||
AssertFatal (message_definition_xml != NULL, "Message definition XML is NULL!\n");
|
||||
|
||||
itti_dump_message_size = sizeof(itti_socket_header_t) + message_definition_xml_length + sizeof(itti_message_types_t);
|
||||
|
||||
itti_dump_message = calloc(1, itti_dump_message_size);
|
||||
|
||||
ITTI_DUMP_DEBUG(0x2, "[%d] Sending XML definition message of size %zu to observer peer\n",
|
||||
sd, itti_dump_message_size);
|
||||
|
||||
itti_dump_message->message_size = itti_dump_message_size;
|
||||
itti_dump_message->message_type = ITTI_DUMP_XML_DEFINITION;
|
||||
|
||||
/* Copying message definition */
|
||||
memcpy (&itti_dump_message[1], message_definition_xml, message_definition_xml_length);
|
||||
memcpy (((void *) &itti_dump_message[1]) + message_definition_xml_length, &itti_dump_xml_definition_end, sizeof(itti_message_types_t));
|
||||
|
||||
data_ptr = (uint8_t *)&itti_dump_message[0];
|
||||
|
||||
do {
|
||||
bytes_sent = send(sd, &data_ptr[total_sent], itti_dump_message_size - total_sent, 0);
|
||||
|
||||
if (bytes_sent < 0) {
|
||||
ITTI_DUMP_ERROR("[%d] Failed to send %zu bytes to socket (%d:%s)\n",
|
||||
sd, itti_dump_message_size, errno, strerror(errno));
|
||||
free(itti_dump_message);
|
||||
return -1;
|
||||
}
|
||||
|
||||
total_sent += bytes_sent;
|
||||
} while (total_sent != itti_dump_message_size);
|
||||
|
||||
free(itti_dump_message);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void itti_dump_user_data_delete_function(void *user_data, void *user_state)
|
||||
{
|
||||
(void)user_state; // UNUSED
|
||||
|
||||
if (user_data != NULL) {
|
||||
itti_dump_queue_item_t *item;
|
||||
task_id_t task_id;
|
||||
int result;
|
||||
|
||||
item = (itti_dump_queue_item_t *)user_data;
|
||||
|
||||
if (item->data != NULL) {
|
||||
task_id = ITTI_MSG_ORIGIN_ID(item->data);
|
||||
result = itti_free(task_id, item->data);
|
||||
AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result);
|
||||
} else {
|
||||
task_id = TASK_UNKNOWN;
|
||||
}
|
||||
|
||||
result = itti_free(task_id, item);
|
||||
AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result);
|
||||
}
|
||||
}
|
||||
|
||||
static int itti_dump_enqueue_message(itti_dump_queue_item_t *new, uint32_t message_size,
|
||||
uint32_t message_type)
|
||||
{
|
||||
struct lfds611_freelist_element *new_queue_element = NULL;
|
||||
int overwrite_flag;
|
||||
AssertFatal (new != NULL, "Message to queue is NULL!\n");
|
||||
|
||||
new->message_type = message_type;
|
||||
new->message_size = message_size;
|
||||
|
||||
ITTI_DUMP_DEBUG (0x1, " itti_dump_enqueue_message: lfds611_ringbuffer_get_write_element\n");
|
||||
new_queue_element = lfds611_ringbuffer_get_write_element (itti_dump_queue.itti_message_queue, &new_queue_element, &overwrite_flag);
|
||||
|
||||
if (overwrite_flag != 0) {
|
||||
// no free element available: overwrite a non read one => data loss!
|
||||
void *old = NULL;
|
||||
|
||||
lfds611_freelist_get_user_data_from_element(new_queue_element, &old);
|
||||
ITTI_DUMP_DEBUG (0x4, " overwrite_flag set, freeing old data %p %p\n", new_queue_element, old);
|
||||
itti_dump_user_data_delete_function (old, NULL);
|
||||
}
|
||||
|
||||
lfds611_freelist_set_user_data_in_element(new_queue_element, new);
|
||||
lfds611_ringbuffer_put_write_element(itti_dump_queue.itti_message_queue, new_queue_element);
|
||||
|
||||
if (overwrite_flag == 0) {
|
||||
{
|
||||
ssize_t write_ret;
|
||||
eventfd_t sem_counter = 1;
|
||||
|
||||
/* Call to write for an event fd must be of 8 bytes */
|
||||
write_ret = write(itti_dump_queue.event_fd, &sem_counter, sizeof(sem_counter));
|
||||
AssertFatal (write_ret == sizeof(sem_counter), "Write to dump event failed (%d/%d)!\n", (int) write_ret, (int) sizeof(sem_counter));
|
||||
}
|
||||
// add one to pending_messages, atomically
|
||||
__sync_fetch_and_add (&pending_messages, 1);
|
||||
}
|
||||
|
||||
ITTI_DUMP_DEBUG (0x2, " Added element to queue %p %p, pending %u, type %u\n", new_queue_element, new, pending_messages, message_type);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void itti_dump_socket_exit(void)
|
||||
{
|
||||
close(itti_dump_queue.event_fd);
|
||||
close(itti_dump_queue.itti_listen_socket);
|
||||
|
||||
/* Leave the thread as we detected end signal */
|
||||
pthread_exit(NULL);
|
||||
}
|
||||
|
||||
static int itti_dump_flush_ring_buffer(int flush_all)
|
||||
{
|
||||
struct lfds611_freelist_element *element = NULL;
|
||||
void *user_data;
|
||||
int j;
|
||||
int consumer;
|
||||
|
||||
/* Check if there is a least one consumer */
|
||||
consumer = 0;
|
||||
|
||||
if (dump_file != NULL) {
|
||||
consumer = 1;
|
||||
} else {
|
||||
for (j = 0; j < ITTI_DUMP_MAX_CON; j++) {
|
||||
if (itti_dump_queue.itti_clients[j].sd > 0) {
|
||||
consumer = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (consumer > 0) {
|
||||
do {
|
||||
/* Acquire the ring element */
|
||||
lfds611_ringbuffer_get_read_element(itti_dump_queue.itti_message_queue, &element);
|
||||
|
||||
// subtract one from pending_messages, atomically
|
||||
__sync_fetch_and_sub (&pending_messages, 1);
|
||||
|
||||
if (element == NULL) {
|
||||
if (flush_all != 0) {
|
||||
flush_all = 0;
|
||||
} else {
|
||||
AssertFatal (0, "Dump event with no data!\n");
|
||||
}
|
||||
} else {
|
||||
/* Retrieve user part of the message */
|
||||
lfds611_freelist_get_user_data_from_element(element, &user_data);
|
||||
|
||||
ITTI_DUMP_DEBUG (0x2, " removed element from queue %p %p, pending %u\n", element, user_data, pending_messages);
|
||||
|
||||
if (((itti_dump_queue_item_t *)user_data)->message_type == ITTI_DUMP_EXIT_SIGNAL) {
|
||||
lfds611_ringbuffer_put_read_element(itti_dump_queue.itti_message_queue, element);
|
||||
itti_dump_socket_exit();
|
||||
}
|
||||
|
||||
/* Write message to file */
|
||||
itti_dump_fwrite_message((itti_dump_queue_item_t *)user_data);
|
||||
|
||||
/* Send message to remote analyzer */
|
||||
for (j = 0; j < ITTI_DUMP_MAX_CON; j++) {
|
||||
if (itti_dump_queue.itti_clients[j].sd > 0) {
|
||||
itti_dump_send_message(itti_dump_queue.itti_clients[j].sd,
|
||||
(itti_dump_queue_item_t *)user_data);
|
||||
}
|
||||
}
|
||||
|
||||
itti_dump_user_data_delete_function (user_data, NULL);
|
||||
lfds611_freelist_set_user_data_in_element(element, NULL);
|
||||
|
||||
/* We have finished with this element, reinsert it in the ring buffer */
|
||||
lfds611_ringbuffer_put_read_element(itti_dump_queue.itti_message_queue, element);
|
||||
}
|
||||
} while(flush_all
|
||||
);
|
||||
}
|
||||
|
||||
return (consumer);
|
||||
}
|
||||
|
||||
static int itti_dump_handle_new_connection(int sd, const char *xml_definition, uint32_t xml_definition_length)
|
||||
{
|
||||
if (itti_dump_queue.nb_connected < ITTI_DUMP_MAX_CON) {
|
||||
uint8_t i;
|
||||
|
||||
for (i = 0; i < ITTI_DUMP_MAX_CON; i++) {
|
||||
/* Let's find a place to store the new client */
|
||||
if (itti_dump_queue.itti_clients[i].sd == -1) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
ITTI_DUMP_DEBUG(0x2, " Found place to store new connection: %d\n", i);
|
||||
|
||||
AssertFatal (i < ITTI_DUMP_MAX_CON, "No more connection available (%d/%d) for socked %d!\n", i, ITTI_DUMP_MAX_CON, sd);
|
||||
|
||||
ITTI_DUMP_DEBUG(0x2, " Socket %d accepted\n", sd);
|
||||
|
||||
/* Send the XML message definition */
|
||||
if (itti_dump_send_xml_definition(sd, xml_definition, xml_definition_length) < 0) {
|
||||
AssertError (0, {}, "Failed to send XML definition!\n");
|
||||
close (sd);
|
||||
return -1;
|
||||
}
|
||||
|
||||
itti_dump_queue.itti_clients[i].sd = sd;
|
||||
itti_dump_queue.nb_connected++;
|
||||
} else {
|
||||
ITTI_DUMP_DEBUG(0x2, " Socket %d rejected\n", sd);
|
||||
/* We have reached max number of users connected...
|
||||
* Reject the connection.
|
||||
*/
|
||||
close (sd);
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void *itti_dump_socket(void *arg_p)
|
||||
{
|
||||
uint32_t message_definition_xml_length;
|
||||
char *message_definition_xml;
|
||||
int rc;
|
||||
int itti_listen_socket, max_sd;
|
||||
int on = 1;
|
||||
fd_set read_set, working_set;
|
||||
struct sockaddr_in servaddr; /* socket address structure */
|
||||
|
||||
struct timeval *timeout_p = NULL;
|
||||
|
||||
ITTI_DUMP_DEBUG(0x2, " Creating TCP dump socket on port %u\n", ITTI_PORT);
|
||||
|
||||
message_definition_xml = (char *)arg_p;
|
||||
AssertFatal (message_definition_xml != NULL, "Message definition XML is NULL!\n");
|
||||
|
||||
message_definition_xml_length = strlen(message_definition_xml) + 1;
|
||||
|
||||
if ((itti_listen_socket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP)) < 0) {
|
||||
ITTI_DUMP_ERROR(" ocket creation failed (%d:%s)\n", errno, strerror(errno));
|
||||
pthread_exit(NULL);
|
||||
}
|
||||
|
||||
/* Allow socket reuse */
|
||||
rc = setsockopt(itti_listen_socket, SOL_SOCKET, SO_REUSEADDR,
|
||||
(char *)&on, sizeof(on));
|
||||
|
||||
if (rc < 0) {
|
||||
ITTI_DUMP_ERROR(" setsockopt SO_REUSEADDR failed (%d:%s)\n", errno, strerror(errno));
|
||||
close(itti_listen_socket);
|
||||
pthread_exit(NULL);
|
||||
}
|
||||
|
||||
/* Set socket to be non-blocking.
|
||||
* NOTE: sockets accepted will inherit this option.
|
||||
*/
|
||||
rc = ioctl(itti_listen_socket, FIONBIO, (char *)&on);
|
||||
|
||||
if (rc < 0) {
|
||||
ITTI_DUMP_ERROR(" ioctl FIONBIO (non-blocking) failed (%d:%s)\n", errno, strerror(errno));
|
||||
close(itti_listen_socket);
|
||||
pthread_exit(NULL);
|
||||
}
|
||||
|
||||
memset(&servaddr, 0, sizeof(servaddr));
|
||||
servaddr.sin_family = AF_INET;
|
||||
servaddr.sin_addr.s_addr = htonl(INADDR_ANY);
|
||||
servaddr.sin_port = htons(ITTI_PORT);
|
||||
|
||||
if (bind(itti_listen_socket, (struct sockaddr *) &servaddr,
|
||||
sizeof(servaddr)) < 0) {
|
||||
ITTI_DUMP_ERROR(" Bind failed (%d:%s)\n", errno, strerror(errno));
|
||||
pthread_exit(NULL);
|
||||
}
|
||||
|
||||
if (listen(itti_listen_socket, 5) < 0) {
|
||||
ITTI_DUMP_ERROR(" Listen failed (%d:%s)\n", errno, strerror(errno));
|
||||
pthread_exit(NULL);
|
||||
}
|
||||
|
||||
FD_ZERO(&read_set);
|
||||
|
||||
/* Add the listener */
|
||||
FD_SET(itti_listen_socket, &read_set);
|
||||
|
||||
/* Add the event fd */
|
||||
FD_SET(itti_dump_queue.event_fd, &read_set);
|
||||
|
||||
/* Max of both sd */
|
||||
max_sd = itti_listen_socket > itti_dump_queue.event_fd ? itti_listen_socket : itti_dump_queue.event_fd;
|
||||
|
||||
itti_dump_queue.itti_listen_socket = itti_listen_socket;
|
||||
|
||||
/* Loop waiting for incoming connects or for incoming data
|
||||
* on any of the connected sockets.
|
||||
*/
|
||||
while (1) {
|
||||
int desc_ready;
|
||||
int client_socket = -1;
|
||||
int i;
|
||||
|
||||
memcpy(&working_set, &read_set, sizeof(read_set));
|
||||
timeout_p = NULL;
|
||||
|
||||
/* No timeout: select blocks till a new event has to be handled
|
||||
* on sd's.
|
||||
*/
|
||||
rc = select(max_sd + 1, &working_set, NULL, NULL, timeout_p);
|
||||
|
||||
if (rc < 0) {
|
||||
ITTI_DUMP_ERROR(" select failed (%d:%s)\n", errno, strerror(errno));
|
||||
pthread_exit(NULL);
|
||||
} else if (rc == 0) {
|
||||
/* Timeout */
|
||||
if (itti_dump_flush_ring_buffer(1) == 0) {
|
||||
if (itti_dump_running) {
|
||||
ITTI_DUMP_DEBUG (0x4, " No messages consumers, waiting ...\n");
|
||||
usleep(100 * 1000);
|
||||
} else {
|
||||
itti_dump_socket_exit();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
desc_ready = rc;
|
||||
|
||||
for (i = 0; i <= max_sd && desc_ready > 0; i++) {
|
||||
if (FD_ISSET(i, &working_set)) {
|
||||
desc_ready -= 1;
|
||||
|
||||
if (i == itti_dump_queue.event_fd) {
|
||||
/* Notification of new element to dump from other tasks */
|
||||
eventfd_t sem_counter;
|
||||
ssize_t read_ret;
|
||||
|
||||
/* Read will always return 1 for kernel versions > 2.6.30 */
|
||||
read_ret = read (itti_dump_queue.event_fd, &sem_counter, sizeof(sem_counter));
|
||||
|
||||
if (read_ret < 0) {
|
||||
ITTI_DUMP_ERROR(" Failed read for semaphore: %s\n", strerror(errno));
|
||||
pthread_exit(NULL);
|
||||
}
|
||||
|
||||
AssertFatal (read_ret == sizeof(sem_counter), "Failed to read from dump event FD (%d/%d)!\n", (int) read_ret, (int) sizeof(sem_counter));
|
||||
|
||||
if (itti_dump_flush_ring_buffer(0) == 0) {
|
||||
if (itti_dump_running) {
|
||||
ITTI_DUMP_DEBUG (0x4, " No messages consumers, waiting ...\n");
|
||||
usleep(100 * 1000);
|
||||
{
|
||||
ssize_t write_ret;
|
||||
|
||||
sem_counter = 1;
|
||||
/* Call to write for an event fd must be of 8 bytes */
|
||||
write_ret = write(itti_dump_queue.event_fd, &sem_counter, sizeof(sem_counter));
|
||||
AssertFatal (write_ret == sizeof(sem_counter), "Failed to write to dump event FD (%d/%d)!\n", (int) write_ret, (int) sem_counter);
|
||||
}
|
||||
} else {
|
||||
itti_dump_socket_exit();
|
||||
}
|
||||
} else {
|
||||
ITTI_DUMP_DEBUG(0x1, " Write element to file\n");
|
||||
}
|
||||
} else
|
||||
if (i == itti_listen_socket) {
|
||||
do {
|
||||
client_socket = accept(itti_listen_socket, NULL, NULL);
|
||||
|
||||
if (client_socket < 0) {
|
||||
if (errno == EWOULDBLOCK || errno == EAGAIN) {
|
||||
/* No more new connection */
|
||||
ITTI_DUMP_DEBUG(0x2, " No more new connection\n");
|
||||
continue;
|
||||
} else {
|
||||
ITTI_DUMP_ERROR(" accept failed (%d:%s)\n", errno, strerror(errno));
|
||||
pthread_exit(NULL);
|
||||
}
|
||||
}
|
||||
|
||||
if (itti_dump_handle_new_connection(client_socket, message_definition_xml,
|
||||
message_definition_xml_length) == 0) {
|
||||
/* The socket has been accepted.
|
||||
* We have to update the set to include this new sd.
|
||||
*/
|
||||
FD_SET(client_socket, &read_set);
|
||||
|
||||
if (client_socket > max_sd)
|
||||
max_sd = client_socket;
|
||||
}
|
||||
} while(client_socket != -1);
|
||||
} else {
|
||||
/* For now the MME itti dumper should not receive data
|
||||
* other than connection oriented (CLOSE).
|
||||
*/
|
||||
uint8_t j;
|
||||
|
||||
ITTI_DUMP_DEBUG(0x2, " Socket %d disconnected\n", i);
|
||||
|
||||
/* Close the socket and update info related to this connection */
|
||||
close(i);
|
||||
|
||||
for (j = 0; j < ITTI_DUMP_MAX_CON; j++) {
|
||||
if (itti_dump_queue.itti_clients[j].sd == i)
|
||||
break;
|
||||
}
|
||||
|
||||
/* In case we don't find the matching sd in list of known
|
||||
* connections -> assert.
|
||||
*/
|
||||
AssertFatal (j < ITTI_DUMP_MAX_CON, "Connection index not found (%d/%d) for socked %d!\n", j, ITTI_DUMP_MAX_CON, i);
|
||||
|
||||
/* Re-initialize the socket to -1 so we can accept new
|
||||
* incoming connections.
|
||||
*/
|
||||
itti_dump_queue.itti_clients[j].sd = -1;
|
||||
itti_dump_queue.itti_clients[j].last_message_number = 0;
|
||||
itti_dump_queue.nb_connected--;
|
||||
|
||||
/* Remove the socket from the FD set and update the max sd */
|
||||
FD_CLR(i, &read_set);
|
||||
|
||||
if (i == max_sd) {
|
||||
if (itti_dump_queue.nb_connected == 0) {
|
||||
/* No more new connection max_sd = itti_listen_socket */
|
||||
max_sd = itti_listen_socket;
|
||||
} else {
|
||||
while (FD_ISSET(max_sd, &read_set) == 0) {
|
||||
max_sd -= 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------------------------*/
|
||||
int itti_dump_queue_message(task_id_t sender_task,
|
||||
message_number_t message_number,
|
||||
MessageDef *message_p,
|
||||
const char *message_name,
|
||||
const uint32_t message_size)
|
||||
{
|
||||
if (itti_dump_running) {
|
||||
itti_dump_queue_item_t *new;
|
||||
|
||||
AssertFatal (message_name != NULL, "Message name is NULL!\n");
|
||||
AssertFatal (message_p != NULL, "Message is NULL!\n");
|
||||
|
||||
new = itti_malloc(sender_task, TASK_MAX, sizeof(itti_dump_queue_item_t));
|
||||
|
||||
new->data = itti_malloc(sender_task, TASK_MAX, message_size);
|
||||
|
||||
memcpy(new->data, message_p, message_size);
|
||||
new->data_size = message_size;
|
||||
new->message_number = message_number;
|
||||
|
||||
itti_dump_enqueue_message(new, message_size, ITTI_DUMP_MESSAGE_TYPE);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* This function should be called by each thread that will use the ring buffer */
|
||||
void itti_dump_thread_use_ring_buffer(void)
|
||||
{
|
||||
lfds611_ringbuffer_use(itti_dump_queue.itti_message_queue);
|
||||
}
|
||||
|
||||
int itti_dump_init(const char * const messages_definition_xml, const char * const dump_file_name)
|
||||
{
|
||||
int i, ret;
|
||||
struct sched_param scheduler_param;
|
||||
|
||||
scheduler_param.sched_priority = sched_get_priority_min(SCHED_FIFO) + 1;
|
||||
|
||||
if (dump_file_name != NULL) {
|
||||
dump_file = fopen(dump_file_name, "wb");
|
||||
|
||||
if (dump_file == NULL) {
|
||||
ITTI_DUMP_ERROR(" can not open dump file \"%s\" (%d:%s)\n", dump_file_name, errno, strerror(errno));
|
||||
} else {
|
||||
/* Output the XML to file */
|
||||
uint32_t message_size = strlen(messages_definition_xml) + 1;
|
||||
itti_socket_header_t header;
|
||||
|
||||
header.message_size = sizeof(itti_socket_header_t) + message_size + sizeof(itti_message_types_t);
|
||||
header.message_type = ITTI_DUMP_XML_DEFINITION;
|
||||
|
||||
fwrite (&header, sizeof(itti_socket_header_t), 1, dump_file);
|
||||
fwrite (messages_definition_xml, message_size, 1, dump_file);
|
||||
fwrite (&itti_dump_xml_definition_end, sizeof(itti_message_types_t), 1, dump_file);
|
||||
fflush (dump_file);
|
||||
}
|
||||
}
|
||||
|
||||
memset(&itti_dump_queue, 0, sizeof(itti_desc_t));
|
||||
|
||||
ITTI_DUMP_DEBUG(0x2, " Creating new ring buffer for itti dump of %u elements\n",
|
||||
ITTI_QUEUE_MAX_ELEMENTS);
|
||||
|
||||
if (lfds611_ringbuffer_new(&itti_dump_queue.itti_message_queue,
|
||||
ITTI_QUEUE_MAX_ELEMENTS,
|
||||
NULL,
|
||||
NULL) != 1) {
|
||||
/* Always assert on this condition */
|
||||
AssertFatal (0, " Failed to create ring buffer!\n");
|
||||
}
|
||||
|
||||
itti_dump_queue.event_fd = eventfd(0, EFD_SEMAPHORE);
|
||||
|
||||
if (itti_dump_queue.event_fd == -1) {
|
||||
/* Always assert on this condition */
|
||||
AssertFatal (0, "eventfd failed: %s!\n", strerror(errno));
|
||||
}
|
||||
|
||||
itti_dump_queue.nb_connected = 0;
|
||||
|
||||
for(i = 0; i < ITTI_DUMP_MAX_CON; i++) {
|
||||
itti_dump_queue.itti_clients[i].sd = -1;
|
||||
itti_dump_queue.itti_clients[i].last_message_number = 0;
|
||||
}
|
||||
|
||||
/* initialized with default attributes */
|
||||
ret = pthread_attr_init(&itti_dump_queue.attr);
|
||||
|
||||
if (ret < 0) {
|
||||
AssertFatal (0, "pthread_attr_init failed (%d:%s)!\n", errno, strerror(errno));
|
||||
}
|
||||
|
||||
ret = pthread_attr_setschedpolicy(&itti_dump_queue.attr, SCHED_FIFO);
|
||||
|
||||
if (ret < 0) {
|
||||
AssertFatal (0, "pthread_attr_setschedpolicy (SCHED_IDLE) failed (%d:%s)!\n", errno, strerror(errno));
|
||||
}
|
||||
|
||||
ret = pthread_attr_setschedparam(&itti_dump_queue.attr, &scheduler_param);
|
||||
|
||||
if (ret < 0) {
|
||||
AssertFatal (0, "pthread_attr_setschedparam failed (%d:%s)!\n", errno, strerror(errno));
|
||||
}
|
||||
|
||||
ret = pthread_create(&itti_dump_queue.itti_acceptor_thread, &itti_dump_queue.attr,
|
||||
&itti_dump_socket, (void *)messages_definition_xml);
|
||||
|
||||
if (ret < 0) {
|
||||
AssertFatal (0, "pthread_create failed (%d:%s)!\n", errno, strerror(errno));
|
||||
}
|
||||
|
||||
pthread_setname_np( itti_dump_queue.itti_acceptor_thread, "ITTI acceptor" );
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void itti_dump_exit(void)
|
||||
{
|
||||
void *arg;
|
||||
itti_dump_queue_item_t *new;
|
||||
|
||||
new = itti_malloc(TASK_UNKNOWN, TASK_UNKNOWN, sizeof(itti_dump_queue_item_t));
|
||||
memset(new, 0, sizeof(itti_dump_queue_item_t));
|
||||
|
||||
/* Set a flag to stop recording message */
|
||||
itti_dump_running = 0;
|
||||
|
||||
/* Send the exit signal to other thread */
|
||||
itti_dump_enqueue_message(new, 0, ITTI_DUMP_EXIT_SIGNAL);
|
||||
|
||||
ITTI_DUMP_DEBUG(0x2, " waiting for dumper thread to finish\n");
|
||||
|
||||
/* wait for the thread to terminate */
|
||||
pthread_join(itti_dump_queue.itti_acceptor_thread, &arg);
|
||||
|
||||
ITTI_DUMP_DEBUG(0x2, " dumper thread correctly exited\n");
|
||||
|
||||
if (dump_file != NULL) {
|
||||
/* Synchronise file and then close it */
|
||||
fclose(dump_file);
|
||||
dump_file = NULL;
|
||||
}
|
||||
|
||||
if (itti_dump_queue.itti_message_queue) {
|
||||
lfds611_ringbuffer_delete(itti_dump_queue.itti_message_queue,
|
||||
itti_dump_user_data_delete_function, NULL);
|
||||
}
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
#ifndef INTERTASK_INTERFACE_DUMP_H_
|
||||
#define INTERTASK_INTERFACE_DUMP_H_
|
||||
|
||||
int itti_dump_queue_message(task_id_t sender_task, message_number_t message_number, MessageDef *message_p, const char *message_name,
|
||||
const uint32_t message_size);
|
||||
|
||||
int itti_dump_init(const char * const messages_definition_xml, const char * const dump_file_name);
|
||||
|
||||
void itti_dump_exit(void);
|
||||
|
||||
void itti_dump_thread_use_ring_buffer(void);
|
||||
|
||||
#endif /* INTERTASK_INTERFACE_DUMP_H_ */
|
||||
@@ -41,10 +41,6 @@
|
||||
|
||||
#ifndef CHECK_PROTOTYPE_ONLY
|
||||
|
||||
const char * const messages_definition_xml = {
|
||||
#include "messages_xml.h"
|
||||
};
|
||||
|
||||
/* Map task id to printable name. */
|
||||
const task_info_t tasks_info[] = {
|
||||
{0, TASK_UNKNOWN, 0, 0, "TASK_UNKNOWN"},
|
||||
@@ -71,8 +67,7 @@ const message_info_t messages_info[] = {
|
||||
* \param messages_info Pointer on messages information as created by this include file
|
||||
**/
|
||||
int itti_init(task_id_t task_max, thread_id_t thread_max, MessagesIds messages_id_max, const task_info_t *tasks_info,
|
||||
const message_info_t *messages_info, const char * const messages_definition_xml,
|
||||
const char * const dump_file_name);
|
||||
const message_info_t *messages_info);
|
||||
|
||||
#endif /* INTERTASK_INTERFACE_INIT_H_ */
|
||||
/* @} */
|
||||
|
||||
@@ -42,8 +42,8 @@
|
||||
#include "log.h"
|
||||
|
||||
#if defined (LOG_D) && defined (LOG_E)
|
||||
# define SIG_DEBUG(x, args...) LOG_D(EMU, x, ##args)
|
||||
# define SIG_ERROR(x, args...) LOG_E(EMU, x, ##args)
|
||||
# define SIG_DEBUG(x, args...) LOG_D(RRC, x, ##args)
|
||||
# define SIG_ERROR(x, args...) LOG_E(RRC, x, ##args)
|
||||
#endif
|
||||
|
||||
#ifndef SIG_DEBUG
|
||||
|
||||
@@ -1068,9 +1068,8 @@ uint8_t phy_threegpplte_turbo_decoder8(int16_t *y,
|
||||
if (init_stats) stop_meas(init_stats);
|
||||
|
||||
// do log_map from first parity bit
|
||||
|
||||
|
||||
log_map8(systematic0,yparity1,m11,m10,alpha,beta,ext,n2,0,F,offset8_flag,alpha_stats,beta_stats,gamma_stats,ext_stats);
|
||||
|
||||
while (iteration_cnt++ < max_iterations) {
|
||||
|
||||
#ifdef DEBUG_LOGMAP
|
||||
|
||||
@@ -709,6 +709,7 @@ int init_lte_ue_signal(PHY_VARS_UE *ue,
|
||||
|
||||
for (i=0; i<fp->nb_antennas_rx; i++) {
|
||||
common_vars->rxdata[i] = (int32_t*) malloc16_clear( (fp->samples_per_tti*10+2048)*sizeof(int32_t) );
|
||||
LOG_I(PHY,"common_vars->rxdata[%d] %p\n",i,common_vars->rxdata[i]);
|
||||
common_vars->common_vars_rx_data_per_thread[0].rxdataF[i] = (int32_t*)malloc16_clear( sizeof(int32_t)*(fp->ofdm_symbol_size*14) );
|
||||
common_vars->common_vars_rx_data_per_thread[1].rxdataF[i] = (int32_t*)malloc16_clear( sizeof(int32_t)*(fp->ofdm_symbol_size*14) );
|
||||
}
|
||||
|
||||
@@ -100,6 +100,7 @@ int init_frame_parms(LTE_DL_FRAME_PARMS *frame_parms,uint8_t osf)
|
||||
frame_parms->first_carrier_offset = 1536-600;
|
||||
frame_parms->nb_prefix_samples=(frame_parms->nb_prefix_samples*3)>>2;
|
||||
frame_parms->nb_prefix_samples0=(frame_parms->nb_prefix_samples0*3)>>2;
|
||||
|
||||
}
|
||||
else {
|
||||
frame_parms->ofdm_symbol_size = 2048;
|
||||
@@ -148,7 +149,6 @@ int init_frame_parms(LTE_DL_FRAME_PARMS *frame_parms,uint8_t osf)
|
||||
frame_parms->N_RBGS = 2;
|
||||
frame_parms->N_RBG = 13;
|
||||
|
||||
|
||||
break;
|
||||
|
||||
case 15:
|
||||
@@ -159,6 +159,7 @@ int init_frame_parms(LTE_DL_FRAME_PARMS *frame_parms,uint8_t osf)
|
||||
frame_parms->nb_prefix_samples0>>=(3-log2_osf);
|
||||
frame_parms->N_RBGS = 2;
|
||||
frame_parms->N_RBG = 8;
|
||||
|
||||
break;
|
||||
|
||||
case 6:
|
||||
@@ -169,6 +170,7 @@ int init_frame_parms(LTE_DL_FRAME_PARMS *frame_parms,uint8_t osf)
|
||||
frame_parms->nb_prefix_samples0>>=(4-log2_osf);
|
||||
frame_parms->N_RBGS = 1;
|
||||
frame_parms->N_RBG = 6;
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
@@ -57,8 +57,8 @@
|
||||
|
||||
|
||||
|
||||
static uint8_t d[3*(MAX_DCI_SIZE_BITS + 16) + 96];
|
||||
static uint8_t w[3*3*(MAX_DCI_SIZE_BITS+16)];
|
||||
//static uint8_t d[3*(MAX_DCI_SIZE_BITS + 16) + 96];
|
||||
//static uint8_t w[3*3*(MAX_DCI_SIZE_BITS+16)];
|
||||
|
||||
void dci_encoding(uint8_t *a,
|
||||
uint8_t A,
|
||||
@@ -70,6 +70,8 @@ void dci_encoding(uint8_t *a,
|
||||
|
||||
uint8_t D = (A + 16);
|
||||
uint32_t RCC;
|
||||
uint8_t d[3*(MAX_DCI_SIZE_BITS + 16) + 96];
|
||||
uint8_t w[3*3*(MAX_DCI_SIZE_BITS+16)];
|
||||
|
||||
#ifdef DEBUG_DCI_ENCODING
|
||||
int32_t i;
|
||||
@@ -169,7 +171,7 @@ uint8_t *generate_dci0(uint8_t *dci,
|
||||
return(e+coded_bits);
|
||||
}
|
||||
|
||||
uint32_t Y;
|
||||
//uint32_t Y;
|
||||
|
||||
|
||||
|
||||
@@ -368,16 +370,12 @@ uint8_t generate_dci_top(uint8_t num_pdcch_symbols,
|
||||
|
||||
if (dci_alloc[i].L == (uint8_t)L) {
|
||||
|
||||
#ifdef DEBUG_DCI_ENCODING
|
||||
if (dci_alloc[i].rnti==0x1234)
|
||||
LOG_D(PHY,"Generating DCI %d/%d (nCCE %d) of length %d, aggregation %d (%x), rnti %x\n",i,num_dci,dci_alloc[i].firstCCE,dci_alloc[i].dci_length,dci_alloc[i].L,
|
||||
LOG_D(PHY,"Generating DCI %d/%d (nCCE %d) of length %d, aggregation %d (%x), rnti %x\n",
|
||||
i,num_dci,dci_alloc[i].firstCCE,dci_alloc[i].dci_length,dci_alloc[i].L,
|
||||
*(unsigned int*)dci_alloc[i].dci_pdu,
|
||||
dci_alloc[i].rnti);
|
||||
dump_dci(frame_parms,&dci_alloc[i]);
|
||||
#endif
|
||||
|
||||
if (dci_alloc[i].firstCCE>=0) {
|
||||
//printf("generate DCI .%d rnti %d length %d\n", subframe, dci_alloc[i].rnti, dci_alloc[i].dci_length);
|
||||
e_ptr = generate_dci0(dci_alloc[i].dci_pdu,
|
||||
e+(72*dci_alloc[i].firstCCE),
|
||||
dci_alloc[i].dci_length,
|
||||
|
||||
@@ -1998,12 +1998,13 @@ void fill_ulsch(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_ulsch_pdu *ulsch_pdu
|
||||
else if(ulsch->harq_processes[harq_pid]->n_DMRS == 7)
|
||||
ulsch->harq_processes[harq_pid]->n_DMRS2 = 9;
|
||||
|
||||
LOG_D(PHY,"[eNB %d][PUSCH %d] Frame %d, Subframe %d Programming PUSCH with n_DMRS2 %d (cshift %d) ulsch:ndi:%d ulsch_pdu:ndi:%d new_ulsch:%d status:%d ulsch_pdu:rvidx:%d\n",
|
||||
LOG_D(PHY,"[eNB %d][PUSCH %d] Frame %d, Subframe %d Programming PUSCH with n_DMRS2 %d (cshift %d) ulsch:ndi:%d ulsch_pdu:ndi:%d new_ulsch:%d status:%d ulsch_pdu:rvidx:%d ulsch_pdu->ulsch_pdu_rel8.size %d\n",
|
||||
eNB->Mod_id,harq_pid,frame,subframe,
|
||||
ulsch->harq_processes[harq_pid]->n_DMRS2,
|
||||
ulsch->harq_processes[harq_pid]->n_DMRS,
|
||||
ulsch->harq_processes[harq_pid]->ndi, ulsch_pdu->ulsch_pdu_rel8.new_data_indication, new_ulsch, ulsch->harq_processes[harq_pid]->status,
|
||||
ulsch_pdu->ulsch_pdu_rel8.redundancy_version);
|
||||
ulsch_pdu->ulsch_pdu_rel8.redundancy_version,
|
||||
ulsch_pdu->ulsch_pdu_rel8.size);
|
||||
|
||||
ulsch->harq_processes[harq_pid]->rvidx = ulsch_pdu->ulsch_pdu_rel8.redundancy_version;
|
||||
if(ulsch_pdu->ulsch_pdu_rel8.modulation_type!=0)
|
||||
|
||||
@@ -165,49 +165,6 @@ int8_t delta_PUSCH_acc[4] = {-1,0,1,3};
|
||||
|
||||
int8_t *delta_PUCCH_lut = delta_PUSCH_acc;
|
||||
|
||||
uint8_t get_pmi(uint8_t N_RB_DL, MIMO_mode_t mode, uint32_t pmi_alloc,uint16_t rb)
|
||||
{
|
||||
/*
|
||||
MIMO_mode_t mode = dlsch_harq->mimo_mode;
|
||||
uint32_t pmi_alloc = dlsch_harq->pmi_alloc;
|
||||
*/
|
||||
|
||||
switch (N_RB_DL) {
|
||||
case 6: // 1 PRB per subband
|
||||
if (mode <= PUSCH_PRECODING1)
|
||||
return((pmi_alloc>>(rb<<1))&3);
|
||||
else
|
||||
return((pmi_alloc>>rb)&1);
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
case 25: // 4 PRBs per subband
|
||||
if (mode <= PUSCH_PRECODING1)
|
||||
return((pmi_alloc>>((rb>>2)<<1))&3);
|
||||
else
|
||||
return((pmi_alloc>>(rb>>2))&1);
|
||||
|
||||
break;
|
||||
|
||||
case 50: // 6 PRBs per subband
|
||||
if (mode <= PUSCH_PRECODING1)
|
||||
return((pmi_alloc>>((rb/6)<<1))&3);
|
||||
else
|
||||
return((pmi_alloc>>(rb/6))&1);
|
||||
|
||||
break;
|
||||
|
||||
case 100: // 8 PRBs per subband
|
||||
if (mode <= PUSCH_PRECODING1)
|
||||
return((pmi_alloc>>((rb>>3)<<1))&3);
|
||||
else
|
||||
return((pmi_alloc>>(rb>>3))&1);
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t check_phich_reg(LTE_DL_FRAME_PARMS *frame_parms,uint32_t kprime,uint8_t lprime,uint8_t mi)
|
||||
{
|
||||
|
||||
@@ -330,7 +287,7 @@ void conv_eMTC_rballoc(uint16_t resource_block_coding,
|
||||
uint32_t N_RB_DL,
|
||||
uint32_t *rb_alloc) {
|
||||
|
||||
|
||||
|
||||
int narrowband = resource_block_coding>>5;
|
||||
int RIV = resource_block_coding&31;
|
||||
int N_NB_DL = N_RB_DL/6;
|
||||
@@ -346,7 +303,7 @@ void conv_eMTC_rballoc(uint16_t resource_block_coding,
|
||||
rb_alloc[2] = 0;
|
||||
rb_alloc[3] = 0;
|
||||
rb_alloc[ind] = alloc<<ind_mod;
|
||||
if (ind_mod > 26) rb_alloc[ind+1] = alloc>>(6-(ind_mod-26));
|
||||
if (ind_mod > 26) rb_alloc[ind+1] = alloc>>(6-(ind_mod-26));
|
||||
}
|
||||
|
||||
void conv_rballoc(uint8_t ra_header,uint32_t rb_alloc,uint32_t N_RB_DL,uint32_t *rb_alloc2)
|
||||
@@ -410,7 +367,7 @@ void conv_rballoc(uint8_t ra_header,uint32_t rb_alloc,uint32_t N_RB_DL,uint32_t
|
||||
// bit mask across
|
||||
if ((rb_alloc2[0]>>31)==1)
|
||||
rb_alloc2[1] |= 1;
|
||||
|
||||
|
||||
if ((rb_alloc&1) != 0)
|
||||
rb_alloc2[1] |= (3<<16);
|
||||
break;
|
||||
@@ -420,7 +377,7 @@ void conv_rballoc(uint8_t ra_header,uint32_t rb_alloc,uint32_t N_RB_DL,uint32_t
|
||||
for (i=0; i<25; i++) {
|
||||
if ((rb_alloc&(1<<(24-i))) != 0)
|
||||
rb_alloc2[(4*i)>>5] |= (0xf<<((4*i)%32));
|
||||
|
||||
|
||||
// printf("rb_alloc2[%d] (type 0) %x (%d)\n",(4*i)>>5,rb_alloc2[(4*i)>>5],rb_alloc&(1<<i));
|
||||
}
|
||||
|
||||
@@ -1099,13 +1056,9 @@ uint32_t pdcch_alloc2ul_frame(LTE_DL_FRAME_PARMS *frame_parms,uint32_t frame, ui
|
||||
uint32_t ul_frame;
|
||||
|
||||
if ((frame_parms->frame_type == TDD) &&
|
||||
(frame_parms->tdd_config == 1)) {
|
||||
if ((n==1)||(n==6)||(n==4)||(n==9)) { // tdd_config 0,1 SF 1,5
|
||||
(frame_parms->tdd_config == 1) &&
|
||||
((n==1)||(n==6)||(n==4)||(n==9))) { // tdd_config 0,1 SF 1,5
|
||||
ul_frame = (frame + (n < 5 ? 0 : 1));
|
||||
} else {
|
||||
LOG_E(PHY, "frame %d subframe %d: PUSCH frame = ?\n", frame, n);
|
||||
ul_frame = 0;
|
||||
}
|
||||
} else if ((frame_parms->frame_type == TDD) &&
|
||||
(frame_parms->tdd_config == 6) &&
|
||||
((n==0)||(n==1)||(n==5)||(n==6)))
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
#include "PHY/LTE_TRANSPORT/transport_eNB.h"
|
||||
#include "UTIL/LOG/vcd_signal_dumper.h"
|
||||
#include "PHY/LTE_TRANSPORT/transport_proto.h"
|
||||
|
||||
#include "PHY/LTE_TRANSPORT/transport_common_proto.h"
|
||||
//#define DEBUG_DLSCH_MODULATION
|
||||
#define NEW_ALLOC_RE
|
||||
|
||||
@@ -714,8 +714,8 @@ int allocate_REs_in_RB(PHY_VARS_eNB* phy_vars_eNB,
|
||||
|
||||
int first_layer0 = -1; //= dlsch0_harq->first_layer;
|
||||
int Nlayers0 = -1; // = dlsch0_harq->Nlayers;
|
||||
uint8_t mod_order0=0;
|
||||
uint8_t mod_order1=0;
|
||||
uint8_t mod_order0=0;
|
||||
uint8_t mod_order1=0;
|
||||
uint8_t precoder_index0,precoder_index1;
|
||||
|
||||
uint8_t *x1=NULL;
|
||||
|
||||
@@ -108,6 +108,7 @@ void rx_prach0(PHY_VARS_eNB *eNB,
|
||||
int prach_ifft_cnt=0;
|
||||
#endif
|
||||
#ifdef PRACH_DEBUG
|
||||
int en=0;
|
||||
int en0=0;
|
||||
#endif
|
||||
|
||||
@@ -229,7 +230,7 @@ void rx_prach0(PHY_VARS_eNB *eNB,
|
||||
#ifdef PRACH_DEBUG
|
||||
int32_t en0=signal_energy((int32_t*)prach[aa],fp->samples_per_tti);
|
||||
int8_t dbEn0 = dB_fixed(en0);
|
||||
int8_t rach_dBm = dbEn0 - eNB->rx_total_gain_dB;
|
||||
int8_t rach_dBm = dbEn0 - ru->rx_total_gain_dB;
|
||||
|
||||
#ifdef PRACH_WRITE_OUTPUT_DEBUG
|
||||
if (dbEn0>32 && prach[0]!= NULL)
|
||||
@@ -466,7 +467,7 @@ void rx_prach0(PHY_VARS_eNB *eNB,
|
||||
} else if (eNB!=NULL) {
|
||||
|
||||
#ifdef PRACH_DEBUG
|
||||
int en = dB_fixed(signal_energy((int32_t*)&rxsigF[0][0],840));
|
||||
en = dB_fixed(signal_energy((int32_t*)&rxsigF[0][0],840));
|
||||
if ((en > 60)&&(br_flag==1)) LOG_I(PHY,"PRACH (br_flag %d,ce_level %d, n_ra_prb %d, k %d): Frame %d, Subframe %d => %d dB\n",br_flag,ce_level,n_ra_prb,k,eNB->proc.frame_rx,eNB->proc.subframe_rx,en);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -1089,7 +1089,7 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB,
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG_PUCCH_RX
|
||||
LOG_D(PHY,"[eNB] PUCCH fmt1: stat_max : %d, sigma2_dB %d (%d, %d), phase_max : %d\n",dB_fixed(stat_max),sigma2_dB,eNB->measurements.n0_subband_power_tot_dBm[6],pucch1_thres,phase_max);
|
||||
LOG_I(PHY,"[eNB] PUCCH fmt1: stat_max : %d, sigma2_dB %d (%d, %d), phase_max : %d\n",dB_fixed(stat_max),sigma2_dB,eNB->measurements.n0_subband_power_tot_dBm[6],pucch1_thres,phase_max);
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1353,7 +1353,7 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB,
|
||||
|
||||
LOG_D(PHY,"PUCCH 1a/b: subframe %d : stat %d,%d (pos %d)\n",subframe,stat_re,stat_im,
|
||||
(subframe<<10) + (eNB->pucch1ab_stats_cnt[UE_id][subframe]));
|
||||
LOG_D(PHY,"PUCCH 1a/b: subframe %d : sigma2_dB %d, stat_max %d, pucch1_thres %d\n",subframe,sigma2_dB,dB_fixed(stat_max),pucch1_thres);
|
||||
LOG_D(PHY,"PUCCH 1a/b: subframe %d : sigma2_dB %d, stat_max %d, pucch1_thres %d\n",subframe,sigma2_dB,dB_fixed(stat_max),pucch1_thres);
|
||||
|
||||
eNB->pucch1ab_stats[UE_id][(subframe<<11) + 2*(eNB->pucch1ab_stats_cnt[UE_id][subframe])] = (stat_re);
|
||||
eNB->pucch1ab_stats[UE_id][(subframe<<11) + 1+2*(eNB->pucch1ab_stats_cnt[UE_id][subframe])] = (stat_im);
|
||||
|
||||
@@ -337,7 +337,7 @@ int ulsch_decoding_data_2thread0(td_params* tdp) {
|
||||
else
|
||||
crc_type = CRC24_B;
|
||||
|
||||
|
||||
|
||||
ret = tc(&ulsch_harq->d[r][96],
|
||||
NULL,
|
||||
ulsch_harq->c[r],
|
||||
@@ -667,7 +667,8 @@ int ulsch_decoding_data(PHY_VARS_eNB *eNB,int UE_id,int harq_pid,int llr8_flag)
|
||||
crc_type = CRC24_A;
|
||||
else
|
||||
crc_type = CRC24_B;
|
||||
|
||||
|
||||
|
||||
start_meas(&eNB->ulsch_turbo_decoding_stats);
|
||||
|
||||
ret = tc(&ulsch_harq->d[r][96],
|
||||
|
||||
@@ -943,7 +943,7 @@ int check_dci_format1_1a_coherency(DCI_format_t dci_format,
|
||||
}
|
||||
}
|
||||
|
||||
if ((rnti==si_rnti) || (rnti==p_rnti) || (rnti==ra_rnti))
|
||||
if (dci_format == format1A && ((rnti==si_rnti) || (rnti==p_rnti) || (rnti==ra_rnti)))
|
||||
{
|
||||
NPRB = (TPC&1) + 2;
|
||||
switch (N_RB_DL) {
|
||||
@@ -960,8 +960,8 @@ int check_dci_format1_1a_coherency(DCI_format_t dci_format,
|
||||
RIV_max = RIV_max100;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
}
|
||||
else if (dci_format == format1A)
|
||||
{
|
||||
switch (N_RB_DL) {
|
||||
case 6:
|
||||
@@ -996,13 +996,13 @@ int check_dci_format1_1a_coherency(DCI_format_t dci_format,
|
||||
}
|
||||
|
||||
|
||||
if(dci_format == format1)
|
||||
else if (dci_format == format1)
|
||||
{
|
||||
NPRB = conv_nprb(rah, rballoc, N_RB_DL);
|
||||
}
|
||||
|
||||
|
||||
if(rballoc > RIV_max)
|
||||
if(dci_format == format1A && rballoc > RIV_max)
|
||||
{
|
||||
// LOG_I(PHY,"bad dci rballoc rballoc %d RIV_max %lld \n",rballoc, RIV_max);
|
||||
// DCI false detection
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
#include "UTIL/LOG/vcd_signal_dumper.h"
|
||||
#include "PHY/LTE_UE_TRANSPORT/transport_proto_ue.h"
|
||||
//#define DEBUG_DLSCH_DECODING
|
||||
//#define UE_DEBUG_TRACE 1
|
||||
#define UE_DEBUG_TRACE 1
|
||||
|
||||
|
||||
void free_ue_dlsch(LTE_UE_DLSCH_t *dlsch)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -642,7 +642,7 @@ int dlsch_qpsk_llr(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
|
||||
uint32_t *rxF = (uint32_t*)&rxdataF_comp[0][((int32_t)symbol*frame_parms->N_RB_DL*12)];
|
||||
uint32_t *llr32;
|
||||
int i,len;
|
||||
int len;
|
||||
uint8_t symbol_mod = (symbol >= (7-frame_parms->Ncp))? (symbol-(7-frame_parms->Ncp)) : symbol;
|
||||
|
||||
/*
|
||||
@@ -681,19 +681,28 @@ int dlsch_qpsk_llr(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
dlsch_llr,
|
||||
llr32);
|
||||
*/
|
||||
//printf("ll32p=%p , dlsch_llr=%p, symbol=%d, flag=%d \n", llr32, dlsch_llr, symbol, first_symbol_flag);
|
||||
for (i=0; i<len; i++) {
|
||||
*llr32 = *rxF;
|
||||
//printf("llr %d : (%d,%d)\n",i,((int16_t*)llr32)[0],((int16_t*)llr32)[1]);
|
||||
rxF++;
|
||||
llr32++;
|
||||
}
|
||||
|
||||
//*llr32p = (int16_t *)llr32;
|
||||
qpsk_llr((short *)rxF,
|
||||
(short *)llr32,
|
||||
len);
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
void qpsk_llr(int16_t *stream0_in,
|
||||
int16_t *stream0_out,
|
||||
int length)
|
||||
{
|
||||
int i;
|
||||
for (i=0; i<2*length; i++) {
|
||||
*stream0_out = *stream0_in;
|
||||
//printf("llr %d : (%d,%d)\n",i,((int16_t*)stream0_out)[0],((int16_t*)stream0_out)[1]);
|
||||
stream0_in++;
|
||||
stream0_out++;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
int32_t dlsch_qpsk_llr_SIC(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
int32_t **rxdataF_comp,
|
||||
int32_t **sic_buffer, //Q15
|
||||
@@ -817,45 +826,21 @@ void dlsch_16qam_llr(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
int16_t **llr32p,
|
||||
uint8_t beamforming_mode)
|
||||
{
|
||||
int32_t *rxF = (int32_t*)&rxdataF_comp[0][(symbol*frame_parms->N_RB_DL*12)];
|
||||
int32_t *ch_mag = (int32_t*)&dl_ch_mag[0][(symbol*frame_parms->N_RB_DL*12)];
|
||||
int32_t *llr32;
|
||||
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
__m128i *rxF = (__m128i*)&rxdataF_comp[0][(symbol*frame_parms->N_RB_DL*12)];
|
||||
__m128i *ch_mag;
|
||||
__m128i llr128[2];
|
||||
uint32_t *llr32;
|
||||
#elif defined(__arm__)
|
||||
int16x8_t *rxF = (int16x8_t*)&rxdataF_comp[0][(symbol*frame_parms->N_RB_DL*12)];
|
||||
int16x8_t *ch_mag;
|
||||
int16x8_t xmm0;
|
||||
int16_t *llr16;
|
||||
#endif
|
||||
|
||||
|
||||
int i,len;
|
||||
int len;
|
||||
unsigned char symbol_mod,len_mod4=0;
|
||||
|
||||
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
if (first_symbol_flag==1) {
|
||||
llr32 = (uint32_t*)dlsch_llr;
|
||||
llr32 = (int32_t*)dlsch_llr;
|
||||
} else {
|
||||
llr32 = (uint32_t*)*llr32p;
|
||||
llr32 = (int32_t*)*llr32p;
|
||||
}
|
||||
#elif defined(__arm__)
|
||||
if (first_symbol_flag==1) {
|
||||
llr16 = (int16_t*)dlsch_llr;
|
||||
} else {
|
||||
llr16 = (int16_t*)*llr32p;
|
||||
}
|
||||
#endif
|
||||
|
||||
symbol_mod = (symbol>=(7-frame_parms->Ncp)) ? symbol-(7-frame_parms->Ncp) : symbol;
|
||||
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
ch_mag = (__m128i*)&dl_ch_mag[0][(symbol*frame_parms->N_RB_DL*12)];
|
||||
#elif defined(__arm__)
|
||||
ch_mag = (int16x8_t*)&dl_ch_mag[0][(symbol*frame_parms->N_RB_DL*12)];
|
||||
#endif
|
||||
if ((symbol_mod==0) || (symbol_mod==(4-frame_parms->Ncp))) {
|
||||
if (frame_parms->nb_antenna_ports_eNB!=1)
|
||||
len = (nb_rb*8) - (2*pbch_pss_sss_adjust/3);
|
||||
@@ -881,18 +866,45 @@ void dlsch_16qam_llr(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
len>>=2; // length in quad words (4 REs)
|
||||
// printf("len>>=2=%d\n", len);
|
||||
len+=(len_mod4==0 ? 0 : 1);
|
||||
// printf("len+=%d\n", len);
|
||||
for (i=0; i<len; i++) {
|
||||
|
||||
qam16_llr((short *)rxF,
|
||||
(short *)ch_mag,
|
||||
(short *)llr32,
|
||||
len);
|
||||
// printf ("This line in qam16_llr is %d.\n", __LINE__);
|
||||
|
||||
}
|
||||
|
||||
void qam16_llr(int16_t *stream0_in,
|
||||
int16_t *chan_magn,
|
||||
int16_t *llr,
|
||||
int length)
|
||||
{
|
||||
int i;
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
__m128i *rxF_128 = (__m128i*)stream0_in;
|
||||
__m128i *ch_mag_128 = (__m128i*)chan_magn;
|
||||
__m128i llr128[2];
|
||||
int32_t *llr32 = (int32_t*) llr;
|
||||
#elif defined(__arm__)
|
||||
int16x8_t *rxF_128 = (int16x8_t*)stream0_in;
|
||||
int16x8_t *ch_mag_128 = (int16x8_t*)chan_magn;
|
||||
int16x8_t xmm0;
|
||||
int16_t *llr16 = (int16_t*)llr;
|
||||
#endif
|
||||
|
||||
// printf ("This line in qam16_llr is %d.\n", __LINE__);
|
||||
|
||||
for (i=0; i<length; i++) {
|
||||
#if defined(__x86_64__) || defined(__i386)
|
||||
xmm0 = _mm_abs_epi16(rxF[i]);
|
||||
xmm0 = _mm_subs_epi16(ch_mag[i],xmm0);
|
||||
xmm0 = _mm_abs_epi16(rxF_128[i]);
|
||||
xmm0 = _mm_subs_epi16(ch_mag_128[i],xmm0);
|
||||
|
||||
// lambda_1=y_R, lambda_2=|y_R|-|h|^2, lamda_3=y_I, lambda_4=|y_I|-|h|^2
|
||||
llr128[0] = _mm_unpacklo_epi32(rxF[i],xmm0);
|
||||
llr128[1] = _mm_unpackhi_epi32(rxF[i],xmm0);
|
||||
llr128[0] = _mm_unpacklo_epi32(rxF_128[i],xmm0);
|
||||
llr128[1] = _mm_unpackhi_epi32(rxF_128[i],xmm0);
|
||||
llr32[0] = _mm_extract_epi32(llr128[0],0); //((uint32_t *)&llr128[0])[0];
|
||||
llr32[1] = _mm_extract_epi32(llr128[0],1); //((uint32_t *)&llr128[0])[1];
|
||||
llr32[1] = _mm_extract_epi32(llr128[0],1); //((uint32_t *)&llr128[0])[0];
|
||||
llr32[2] = _mm_extract_epi32(llr128[0],2); //((uint32_t *)&llr128[0])[2];
|
||||
llr32[3] = _mm_extract_epi32(llr128[0],3); //((uint32_t *)&llr128[0])[3];
|
||||
llr32[4] = _mm_extract_epi32(llr128[1],0); //((uint32_t *)&llr128[1])[0];
|
||||
@@ -922,14 +934,17 @@ void dlsch_16qam_llr(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
llr16[14] = vgetq_lane_s16(xmm0,7);
|
||||
llr16[15] = vgetq_lane_s16(xmm0,7);
|
||||
llr16+=16;
|
||||
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
#if defined(__x86_64__) || defined(__i386)
|
||||
_mm_empty();
|
||||
_m_empty();
|
||||
#endif
|
||||
|
||||
|
||||
}
|
||||
|
||||
void dlsch_16qam_llr_SIC (LTE_DL_FRAME_PARMS *frame_parms,
|
||||
@@ -1036,6 +1051,7 @@ void dlsch_16qam_llr_SIC (LTE_DL_FRAME_PARMS *frame_parms,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------------------------
|
||||
// 64-QAM
|
||||
//----------------------------------------------------------------------------------------------
|
||||
@@ -1053,14 +1069,10 @@ void dlsch_64qam_llr(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
uint32_t llr_offset,
|
||||
uint8_t beamforming_mode)
|
||||
{
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
__m128i *rxF = (__m128i*)&rxdataF_comp[0][(symbol*frame_parms->N_RB_DL*12)];
|
||||
__m128i *ch_mag,*ch_magb;
|
||||
#elif defined(__arm__)
|
||||
int16x8_t *rxF = (int16x8_t*)&rxdataF_comp[0][(symbol*frame_parms->N_RB_DL*12)];
|
||||
int16x8_t *ch_mag,*ch_magb,xmm1,xmm2;
|
||||
#endif
|
||||
int i,len,len2;
|
||||
int32_t *rxF = (int32_t*)&rxdataF_comp[0][(symbol*frame_parms->N_RB_DL*12)];
|
||||
int32_t *ch_mag = (int32_t*)&dl_ch_mag[0][(symbol*frame_parms->N_RB_DL*12)];
|
||||
int32_t *ch_magb = (int32_t*)&dl_ch_magb[0][(symbol*frame_parms->N_RB_DL*12)];
|
||||
int len,len2;
|
||||
unsigned char symbol_mod,len_mod4;
|
||||
short *llr;
|
||||
int16_t *llr2;
|
||||
@@ -1079,13 +1091,6 @@ void dlsch_64qam_llr(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
|
||||
symbol_mod = (symbol>=(7-frame_parms->Ncp)) ? symbol-(7-frame_parms->Ncp) : symbol;
|
||||
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
ch_mag = (__m128i*)&dl_ch_mag[0][(symbol*frame_parms->N_RB_DL*12)];
|
||||
ch_magb = (__m128i*)&dl_ch_magb[0][(symbol*frame_parms->N_RB_DL*12)];
|
||||
#elif defined(__arm__)
|
||||
ch_mag = (int16x8_t*)&dl_ch_mag[0][(symbol*frame_parms->N_RB_DL*12)];
|
||||
ch_magb = (int16x8_t*)&dl_ch_magb[0][(symbol*frame_parms->N_RB_DL*12)];
|
||||
#endif
|
||||
if ((symbol_mod==0) || (symbol_mod==(4-frame_parms->Ncp))) {
|
||||
if (frame_parms->nb_antenna_ports_eNB!=1)
|
||||
len = (nb_rb*8) - (2*pbch_pss_sss_adjust/3);
|
||||
@@ -1115,18 +1120,49 @@ void dlsch_64qam_llr(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
len2=len>>2; // length in quad words (4 REs)
|
||||
len2+=((len_mod4==0)?0:1);
|
||||
|
||||
for (i=0; i<len2; i++) {
|
||||
qam64_llr((short *)rxF,
|
||||
(short *)ch_mag,
|
||||
(short *)ch_magb,
|
||||
llr2,
|
||||
len2);
|
||||
}
|
||||
|
||||
|
||||
void qam64_llr(int16_t *stream0_in,
|
||||
int16_t *chan_magn,
|
||||
int16_t *chan_magn_b,
|
||||
int16_t *llr,
|
||||
int length)
|
||||
{
|
||||
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
xmm1 = _mm_abs_epi16(rxF[i]);
|
||||
xmm1 = _mm_subs_epi16(ch_mag[i],xmm1);
|
||||
xmm2 = _mm_abs_epi16(xmm1);
|
||||
xmm2 = _mm_subs_epi16(ch_magb[i],xmm2);
|
||||
__m128i *rxF_128 = (__m128i*)stream0_in;
|
||||
__m128i *ch_mag_128 = (__m128i*)chan_magn;
|
||||
__m128i *ch_magb_128 = (__m128i*)chan_magn_b;
|
||||
#elif defined(__arm__)
|
||||
xmm1 = vabsq_s16(rxF[i]);
|
||||
xmm1 = vsubq_s16(ch_mag[i],xmm1);
|
||||
int16x8_t *rxF_128 = (int16x8_t*)stream0_in;
|
||||
int16x8_t *ch_mag_128 = (int16x8_t*)chan_magn;
|
||||
int16x8_t *ch_magb_128 = (int16x8_t*)chan_magn_b;
|
||||
int16x8_t xmm1,xmm2;
|
||||
#endif
|
||||
|
||||
|
||||
int i;
|
||||
//int16_t *llr2;
|
||||
//llr2 = llr;
|
||||
|
||||
for (i=0; i<length; i++) {
|
||||
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
xmm1 = _mm_abs_epi16(rxF_128[i]);
|
||||
xmm1 = _mm_subs_epi16(ch_mag_128[i],xmm1);
|
||||
xmm2 = _mm_abs_epi16(xmm1);
|
||||
xmm2 = _mm_subs_epi16(ch_magb_128[i],xmm2);
|
||||
#elif defined(__arm__)
|
||||
xmm1 = vabsq_s16(rxF_128[i]);
|
||||
xmm1 = vsubq_s16(ch_mag_128[i],xmm1);
|
||||
xmm2 = vabsq_s16(xmm1);
|
||||
xmm2 = vsubq_s16(ch_magb[i],xmm2);
|
||||
xmm2 = vsubq_s16(ch_magb_128[i],xmm2);
|
||||
#endif
|
||||
// loop over all LLRs in quad word (24 coded bits)
|
||||
/*
|
||||
@@ -1141,64 +1177,64 @@ void dlsch_64qam_llr(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
llr2+=6;
|
||||
}
|
||||
*/
|
||||
llr2[0] = ((short *)&rxF[i])[0];
|
||||
llr2[1] = ((short *)&rxF[i])[1];
|
||||
llr[0] = ((short *)&rxF_128[i])[0];
|
||||
llr[1] = ((short *)&rxF_128[i])[1];
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
llr2[2] = _mm_extract_epi16(xmm1,0);
|
||||
llr2[3] = _mm_extract_epi16(xmm1,1);//((short *)&xmm1)[j+1];
|
||||
llr2[4] = _mm_extract_epi16(xmm2,0);//((short *)&xmm2)[j];
|
||||
llr2[5] = _mm_extract_epi16(xmm2,1);//((short *)&xmm2)[j+1];
|
||||
llr[2] = _mm_extract_epi16(xmm1,0);
|
||||
llr[3] = _mm_extract_epi16(xmm1,1);//((short *)&xmm1)[j+1];
|
||||
llr[4] = _mm_extract_epi16(xmm2,0);//((short *)&xmm2)[j];
|
||||
llr[5] = _mm_extract_epi16(xmm2,1);//((short *)&xmm2)[j+1];
|
||||
#elif defined(__arm__)
|
||||
llr2[2] = vgetq_lane_s16(xmm1,0);
|
||||
llr2[3] = vgetq_lane_s16(xmm1,1);//((short *)&xmm1)[j+1];
|
||||
llr2[4] = vgetq_lane_s16(xmm2,0);//((short *)&xmm2)[j];
|
||||
llr2[5] = vgetq_lane_s16(xmm2,1);//((short *)&xmm2)[j+1];
|
||||
llr[2] = vgetq_lane_s16(xmm1,0);
|
||||
llr[3] = vgetq_lane_s16(xmm1,1);//((short *)&xmm1)[j+1];
|
||||
llr[4] = vgetq_lane_s16(xmm2,0);//((short *)&xmm2)[j];
|
||||
llr[5] = vgetq_lane_s16(xmm2,1);//((short *)&xmm2)[j+1];
|
||||
#endif
|
||||
|
||||
llr2+=6;
|
||||
llr2[0] = ((short *)&rxF[i])[2];
|
||||
llr2[1] = ((short *)&rxF[i])[3];
|
||||
llr+=6;
|
||||
llr[0] = ((short *)&rxF_128[i])[2];
|
||||
llr[1] = ((short *)&rxF_128[i])[3];
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
llr2[2] = _mm_extract_epi16(xmm1,2);
|
||||
llr2[3] = _mm_extract_epi16(xmm1,3);//((short *)&xmm1)[j+1];
|
||||
llr2[4] = _mm_extract_epi16(xmm2,2);//((short *)&xmm2)[j];
|
||||
llr2[5] = _mm_extract_epi16(xmm2,3);//((short *)&xmm2)[j+1];
|
||||
llr[2] = _mm_extract_epi16(xmm1,2);
|
||||
llr[3] = _mm_extract_epi16(xmm1,3);//((short *)&xmm1)[j+1];
|
||||
llr[4] = _mm_extract_epi16(xmm2,2);//((short *)&xmm2)[j];
|
||||
llr[5] = _mm_extract_epi16(xmm2,3);//((short *)&xmm2)[j+1];
|
||||
#elif defined(__arm__)
|
||||
llr2[2] = vgetq_lane_s16(xmm1,2);
|
||||
llr2[3] = vgetq_lane_s16(xmm1,3);//((short *)&xmm1)[j+1];
|
||||
llr2[4] = vgetq_lane_s16(xmm2,2);//((short *)&xmm2)[j];
|
||||
llr2[5] = vgetq_lane_s16(xmm2,3);//((short *)&xmm2)[j+1];
|
||||
llr[2] = vgetq_lane_s16(xmm1,2);
|
||||
llr[3] = vgetq_lane_s16(xmm1,3);//((short *)&xmm1)[j+1];
|
||||
llr[4] = vgetq_lane_s16(xmm2,2);//((short *)&xmm2)[j];
|
||||
llr[5] = vgetq_lane_s16(xmm2,3);//((short *)&xmm2)[j+1];
|
||||
#endif
|
||||
|
||||
llr2+=6;
|
||||
llr2[0] = ((short *)&rxF[i])[4];
|
||||
llr2[1] = ((short *)&rxF[i])[5];
|
||||
llr+=6;
|
||||
llr[0] = ((short *)&rxF_128[i])[4];
|
||||
llr[1] = ((short *)&rxF_128[i])[5];
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
llr2[2] = _mm_extract_epi16(xmm1,4);
|
||||
llr2[3] = _mm_extract_epi16(xmm1,5);//((short *)&xmm1)[j+1];
|
||||
llr2[4] = _mm_extract_epi16(xmm2,4);//((short *)&xmm2)[j];
|
||||
llr2[5] = _mm_extract_epi16(xmm2,5);//((short *)&xmm2)[j+1];
|
||||
llr[2] = _mm_extract_epi16(xmm1,4);
|
||||
llr[3] = _mm_extract_epi16(xmm1,5);//((short *)&xmm1)[j+1];
|
||||
llr[4] = _mm_extract_epi16(xmm2,4);//((short *)&xmm2)[j];
|
||||
llr[5] = _mm_extract_epi16(xmm2,5);//((short *)&xmm2)[j+1];
|
||||
#elif defined(__arm__)
|
||||
llr2[2] = vgetq_lane_s16(xmm1,4);
|
||||
llr2[3] = vgetq_lane_s16(xmm1,5);//((short *)&xmm1)[j+1];
|
||||
llr2[4] = vgetq_lane_s16(xmm2,4);//((short *)&xmm2)[j];
|
||||
llr2[5] = vgetq_lane_s16(xmm2,5);//((short *)&xmm2)[j+1];
|
||||
llr[2] = vgetq_lane_s16(xmm1,4);
|
||||
llr[3] = vgetq_lane_s16(xmm1,5);//((short *)&xmm1)[j+1];
|
||||
llr[4] = vgetq_lane_s16(xmm2,4);//((short *)&xmm2)[j];
|
||||
llr[5] = vgetq_lane_s16(xmm2,5);//((short *)&xmm2)[j+1];
|
||||
#endif
|
||||
llr2+=6;
|
||||
llr2[0] = ((short *)&rxF[i])[6];
|
||||
llr2[1] = ((short *)&rxF[i])[7];
|
||||
llr+=6;
|
||||
llr[0] = ((short *)&rxF_128[i])[6];
|
||||
llr[1] = ((short *)&rxF_128[i])[7];
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
llr2[2] = _mm_extract_epi16(xmm1,6);
|
||||
llr2[3] = _mm_extract_epi16(xmm1,7);//((short *)&xmm1)[j+1];
|
||||
llr2[4] = _mm_extract_epi16(xmm2,6);//((short *)&xmm2)[j];
|
||||
llr2[5] = _mm_extract_epi16(xmm2,7);//((short *)&xmm2)[j+1];
|
||||
llr[2] = _mm_extract_epi16(xmm1,6);
|
||||
llr[3] = _mm_extract_epi16(xmm1,7);//((short *)&xmm1)[j+1];
|
||||
llr[4] = _mm_extract_epi16(xmm2,6);//((short *)&xmm2)[j];
|
||||
llr[5] = _mm_extract_epi16(xmm2,7);//((short *)&xmm2)[j+1];
|
||||
#elif defined(__arm__)
|
||||
llr2[2] = vgetq_lane_s16(xmm1,6);
|
||||
llr2[3] = vgetq_lane_s16(xmm1,7);//((short *)&xmm1)[j+1];
|
||||
llr2[4] = vgetq_lane_s16(xmm2,6);//((short *)&xmm2)[j];
|
||||
llr2[5] = vgetq_lane_s16(xmm2,7);//((short *)&xmm2)[j+1];
|
||||
llr[2] = vgetq_lane_s16(xmm1,6);
|
||||
llr[3] = vgetq_lane_s16(xmm1,7);//((short *)&xmm1)[j+1];
|
||||
llr[4] = vgetq_lane_s16(xmm2,6);//((short *)&xmm2)[j];
|
||||
llr[5] = vgetq_lane_s16(xmm2,7);//((short *)&xmm2)[j+1];
|
||||
#endif
|
||||
llr2+=6;
|
||||
llr+=6;
|
||||
|
||||
}
|
||||
|
||||
@@ -8865,7 +8901,7 @@ int dlsch_64qam_64qam_llr(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
(int16_t *)llr16,
|
||||
(int32_t *) rho_256i,
|
||||
len);
|
||||
|
||||
|
||||
free16(rxF_256i, sizeof(rxF_256i));
|
||||
free16(rxF_i_256i, sizeof(rxF_i_256i));
|
||||
free16(ch_mag_256i, sizeof(ch_mag_256i));
|
||||
|
||||
+38
-21
@@ -19,30 +19,47 @@
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/* Form definition file generated with fdesign. */
|
||||
#include "PHY/LTE_UE_TRANSPORT/transport_proto_ue.h"
|
||||
|
||||
#include <forms.h>
|
||||
#include <stdlib.h>
|
||||
#include "phy_procedures_sim_form.h"
|
||||
|
||||
FD_phy_procedures_sim *create_form_phy_procedures_sim(void)
|
||||
uint8_t get_pmi(uint8_t N_RB_DL, MIMO_mode_t mode, uint32_t pmi_alloc,uint16_t rb)
|
||||
{
|
||||
FL_OBJECT *obj;
|
||||
FD_phy_procedures_sim *fdui = (FD_phy_procedures_sim *) fl_calloc(1, sizeof(*fdui));
|
||||
/*
|
||||
MIMO_mode_t mode = dlsch_harq->mimo_mode;
|
||||
uint32_t pmi_alloc = dlsch_harq->pmi_alloc;
|
||||
*/
|
||||
|
||||
fdui->phy_procedures_sim = fl_bgn_form(FL_NO_BOX, 640, 320);
|
||||
obj = fl_add_box(FL_UP_BOX,0,0,640,320,"");
|
||||
fdui->pusch_constellation = obj = fl_add_xyplot(FL_POINTS_XYPLOT,50,30,220,190,"PUSCH constellation");
|
||||
fl_set_object_color(obj,FL_BLACK,FL_YELLOW);
|
||||
fdui->pdsch_constellation = obj = fl_add_xyplot(FL_POINTS_XYPLOT,370,30,220,190,"PDSCH constellation");
|
||||
fl_set_object_color(obj,FL_BLACK,FL_YELLOW);
|
||||
fdui->ch00 = obj = fl_add_xyplot(FL_IMPULSE_XYPLOT,370,240,210,60,"CH00");
|
||||
fl_set_object_color(obj,FL_BLACK,FL_YELLOW);
|
||||
fl_end_form();
|
||||
switch (N_RB_DL) {
|
||||
case 6: // 1 PRB per subband
|
||||
if (mode <= PUSCH_PRECODING1)
|
||||
return((pmi_alloc>>(rb<<1))&3);
|
||||
else
|
||||
return((pmi_alloc>>rb)&1);
|
||||
|
||||
fdui->phy_procedures_sim->fdui = fdui;
|
||||
break;
|
||||
|
||||
return fdui;
|
||||
default:
|
||||
case 25: // 4 PRBs per subband
|
||||
if (mode <= PUSCH_PRECODING1)
|
||||
return((pmi_alloc>>((rb>>2)<<1))&3);
|
||||
else
|
||||
return((pmi_alloc>>(rb>>2))&1);
|
||||
|
||||
break;
|
||||
|
||||
case 50: // 6 PRBs per subband
|
||||
if (mode <= PUSCH_PRECODING1)
|
||||
return((pmi_alloc>>((rb/6)<<1))&3);
|
||||
else
|
||||
return((pmi_alloc>>(rb/6))&1);
|
||||
|
||||
break;
|
||||
|
||||
case 100: // 8 PRBs per subband
|
||||
if (mode <= PUSCH_PRECODING1)
|
||||
return((pmi_alloc>>((rb>>3)<<1))&3);
|
||||
else
|
||||
return((pmi_alloc>>(rb>>3))&1);
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
/*---------------------------------------*/
|
||||
|
||||
@@ -387,6 +387,7 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode)
|
||||
// Now TDD normal prefix
|
||||
frame_parms->Ncp=NORMAL;
|
||||
frame_parms->frame_type=TDD;
|
||||
frame_parms->tdd_config=1;
|
||||
init_frame_parms(frame_parms,1);
|
||||
|
||||
if (sync_pos >= frame_parms->nb_prefix_samples)
|
||||
@@ -426,6 +427,7 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode)
|
||||
// Now TDD extended prefix
|
||||
frame_parms->Ncp=EXTENDED;
|
||||
frame_parms->frame_type=TDD;
|
||||
frame_parms->tdd_config=1;
|
||||
init_frame_parms(frame_parms,1);
|
||||
sync_pos2 = sync_pos - frame_parms->nb_prefix_samples;
|
||||
|
||||
@@ -493,17 +495,6 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode)
|
||||
#endif
|
||||
|
||||
// send sync status to higher layers later when timing offset converge to target timing
|
||||
#if OAISIM
|
||||
if (ue->mac_enabled==1) {
|
||||
LOG_I(PHY,"[UE%d] Sending synch status to higher layers\n",ue->Mod_id);
|
||||
//mac_resynch();
|
||||
dl_phy_sync_success(ue->Mod_id,ue->proc.proc_rxtx[0].frame_rx,0,1);//ue->common_vars.eNb_id);
|
||||
ue->UE_mode[0] = PRACH;
|
||||
}
|
||||
else {
|
||||
ue->UE_mode[0] = PUSCH;
|
||||
}
|
||||
#endif
|
||||
|
||||
generate_pcfich_reg_mapping(frame_parms);
|
||||
generate_phich_reg_mapping(frame_parms);
|
||||
|
||||
@@ -0,0 +1,369 @@
|
||||
/* These functions compute linear preprocessing for
|
||||
the UE using LAPACKE and CBLAS modules of
|
||||
LAPACK libraries.
|
||||
MMSE and MMSE whitening filters are available.
|
||||
Functions are using RowMajor storage of the
|
||||
matrices, like in conventional C. Traditional
|
||||
Fortran functions of LAPACK employ ColumnMajor
|
||||
data storage. */
|
||||
|
||||
#include<stdio.h>
|
||||
#include<math.h>
|
||||
#include<complex.h>
|
||||
#include <stdlib.h>
|
||||
#include <cblas.h>
|
||||
#include <string.h>
|
||||
#include <lapacke_utils.h>
|
||||
#include <lapacke.h>
|
||||
|
||||
//#define DEBUG_PREPROC
|
||||
|
||||
|
||||
void transpose (int N, float complex *A, float complex *Result)
|
||||
{
|
||||
// COnputes C := alpha*op(A)*op(B) + beta*C,
|
||||
enum CBLAS_TRANSPOSE transa = CblasTrans;
|
||||
enum CBLAS_TRANSPOSE transb = CblasNoTrans;
|
||||
int rows_opA = N; // number of rows in op(A) and in C
|
||||
int col_opB = N; //number of columns of op(B) and in C
|
||||
int col_opA = N; //number of columns in op(A) and rows in op(B)
|
||||
int col_B; //number of columns in B
|
||||
float complex alpha = 1.0+I*0;
|
||||
int lda = rows_opA;
|
||||
float complex beta = 0.0+I*0;
|
||||
int ldc = rows_opA;
|
||||
int i;
|
||||
float complex* B;
|
||||
|
||||
int ldb = col_opB;
|
||||
|
||||
if (transb == CblasNoTrans) {
|
||||
B = (float complex*)calloc(ldb*col_opB,sizeof(float complex));
|
||||
col_B= col_opB;
|
||||
}
|
||||
else {
|
||||
B = (float complex*)calloc(ldb*col_opA, sizeof(float complex));
|
||||
col_B = col_opA;
|
||||
}
|
||||
float complex* C = (float complex*)malloc(ldc*col_opB*sizeof(float complex));
|
||||
|
||||
for (i=0; i<lda*col_B; i+=N+1)
|
||||
B[i]=1.0+I*0;
|
||||
|
||||
cblas_cgemm(CblasRowMajor, transa, transb, rows_opA, col_opB, col_opA, &alpha, A, lda, B, ldb, &beta, C, ldc);
|
||||
|
||||
memcpy(Result, C, N*N*sizeof(float complex));
|
||||
|
||||
free(B);
|
||||
free(C);
|
||||
}
|
||||
|
||||
|
||||
void conjugate_transpose (int N, float complex *A, float complex *Result)
|
||||
{
|
||||
// Computes C := alpha*op(A)*op(B) + beta*C,
|
||||
enum CBLAS_TRANSPOSE transa = CblasConjTrans;
|
||||
enum CBLAS_TRANSPOSE transb = CblasNoTrans;
|
||||
int rows_opA = N; // number of rows in op(A) and in C
|
||||
int col_opB = N; //number of columns of op(B) and in C
|
||||
int col_opA = N; //number of columns in op(A) and rows in op(B)
|
||||
int col_B; //number of columns in B
|
||||
float complex alpha = 1.0+I*0;
|
||||
int lda = rows_opA;
|
||||
float complex beta = 0.0+I*0;
|
||||
int ldc = rows_opA;
|
||||
int i;
|
||||
float complex* B;
|
||||
int ldb = col_opB;
|
||||
|
||||
if (transb == CblasNoTrans) {
|
||||
B = (float complex*)calloc(ldb*col_opB,sizeof(float complex));
|
||||
col_B= col_opB;
|
||||
}
|
||||
else {
|
||||
B = (float complex*)calloc(ldb*col_opA, sizeof(float complex));
|
||||
col_B = col_opA;
|
||||
}
|
||||
float complex* C = (float complex*)malloc(ldc*col_opB*sizeof(float complex));
|
||||
|
||||
for (i=0; i<lda*col_B; i+=N+1)
|
||||
B[i]=1.0+I*0;
|
||||
|
||||
cblas_cgemm(CblasRowMajor, transa, transb, rows_opA, col_opB, col_opA, &alpha, A, lda, B, ldb, &beta, C, ldc);
|
||||
|
||||
memcpy(Result, C, N*N*sizeof(float complex));
|
||||
|
||||
free(B);
|
||||
free(C);
|
||||
}
|
||||
|
||||
void H_hermH_plus_sigma2I (int N, int M, float complex *A, float sigma2, float complex *Result)
|
||||
{
|
||||
//C := alpha*op(A)*op(B) + beta*C,
|
||||
enum CBLAS_TRANSPOSE transa = CblasConjTrans;
|
||||
enum CBLAS_TRANSPOSE transb = CblasNoTrans;
|
||||
int rows_opA = N; // number of rows in op(A) and in C
|
||||
int col_opB = N; //number of columns of op(B) and in C
|
||||
int col_opA = N; //number of columns in op(A) and rows in op(B)
|
||||
int col_C = N; //number of columns in B
|
||||
float complex alpha = 1.0+I*0;
|
||||
int lda = col_opA;
|
||||
float complex beta = 1.0 + I*0;
|
||||
int ldc = col_opA;
|
||||
int i;
|
||||
|
||||
float complex* C = (float complex*)calloc(ldc*col_opB, sizeof(float complex));
|
||||
|
||||
for (i=0; i<lda*col_C; i+=N+1)
|
||||
C[i]=sigma2*(1.0+I*0);
|
||||
|
||||
cblas_cgemm(CblasRowMajor, transa, transb, rows_opA, col_opB, col_opA, &alpha, A, lda, A, lda, &beta, C, ldc);
|
||||
|
||||
memcpy(Result, C, N*M*sizeof(float complex));
|
||||
free(C);
|
||||
|
||||
}
|
||||
|
||||
void HH_herm_plus_sigma2I (int M, int N, float complex *A, float sigma2, float complex *Result)
|
||||
{
|
||||
//C := alpha*op(A)*op(B) + beta*C,
|
||||
enum CBLAS_TRANSPOSE transa = CblasNoTrans;
|
||||
enum CBLAS_TRANSPOSE transb = CblasConjTrans;
|
||||
int k = N; //number of columns in op(A) and rows in op(B),k
|
||||
float complex alpha = 1.0+I*0;
|
||||
int lda = N;
|
||||
int ldb = N;
|
||||
int ldc = M;
|
||||
int i;
|
||||
|
||||
float complex* C = (float complex*)calloc(M*M, sizeof(float complex));
|
||||
|
||||
for (i=0; i<M*M; i+=M+1)
|
||||
C[i]=1.0+I*0;
|
||||
|
||||
cblas_cgemm(CblasRowMajor, transa, transb, M, M, k, &alpha, A, lda, A, ldb, &sigma2, C, ldc);
|
||||
|
||||
memcpy(Result, C, M*M*sizeof(float complex));
|
||||
free(C);
|
||||
|
||||
}
|
||||
|
||||
void eigen_vectors_values (int N, float complex *A, float complex *Vectors, float *Values_Matrix)
|
||||
{
|
||||
// This function computes ORTHONORMAL eigenvectors and eigenvalues of matrix A,
|
||||
// where Values_Matrix is a diagonal matrix of eigenvalues.
|
||||
// A=Vectors*Values_Matrix*Vectors'
|
||||
char jobz = 'V';
|
||||
char uplo = 'U';
|
||||
int order_A = N;
|
||||
int lda = N;
|
||||
int i;
|
||||
float* Values = (float*)malloc(sizeof(float)*1*N);
|
||||
|
||||
LAPACKE_cheev(LAPACK_ROW_MAJOR, jobz, uplo, order_A, A, lda, Values);
|
||||
|
||||
memcpy(Vectors, A, N*N*sizeof(float complex));
|
||||
|
||||
for (i=0; i<lda; i+=1)
|
||||
Values_Matrix[i*(lda+1)]=Values[i];
|
||||
|
||||
free(Values);
|
||||
}
|
||||
|
||||
void lin_eq_solver (int N, float complex* A, float complex* B, float complex* Result)
|
||||
{
|
||||
int n = N;
|
||||
int lda = N;
|
||||
int ldb = N;
|
||||
int nrhs = N;
|
||||
|
||||
char transa = 'N';
|
||||
int* IPIV = malloc(N*N*sizeof(int));
|
||||
|
||||
// Compute LU-factorization
|
||||
LAPACKE_cgetrf(LAPACK_ROW_MAJOR, n, nrhs, A, lda, IPIV);
|
||||
|
||||
// Solve AX=B
|
||||
LAPACKE_cgetrs(LAPACK_ROW_MAJOR, transa, n, nrhs, A, lda, IPIV, B, ldb);
|
||||
|
||||
// cgetrs( "N", N, 4, A, lda, IPIV, B, ldb, INFO )
|
||||
|
||||
memcpy(Result, B, N*N*sizeof(float complex));
|
||||
|
||||
free(IPIV);
|
||||
|
||||
}
|
||||
|
||||
void mutl_matrix_matrix_row_based(float complex* M0, float complex* M1, int rows_M0, int col_M0, int rows_M1, int col_M1, float complex* Result ){
|
||||
enum CBLAS_TRANSPOSE transa = CblasNoTrans;
|
||||
enum CBLAS_TRANSPOSE transb = CblasNoTrans;
|
||||
int rows_opA = rows_M0; // number of rows in op(A) and in C
|
||||
int col_opB = col_M1; //number of columns of op(B) and in C
|
||||
int col_opA = col_M0; //number of columns in op(A) and rows in op(B)
|
||||
float complex alpha =1.0;
|
||||
int lda = col_M0;
|
||||
float complex beta = 0.0;
|
||||
int ldc = col_M1;
|
||||
int ldb = col_M1;
|
||||
|
||||
#ifdef DEBUG_PREPROC
|
||||
int i=0;
|
||||
printf("rows_M0 %d, col_M0 %d, rows_M1 %d, col_M1 %d\n", rows_M0, col_M0, rows_M1, col_M1);
|
||||
|
||||
for(i=0; i<rows_M0*col_M0; ++i)
|
||||
printf(" rows_opA = %d, col_opB = %d, W_MMSE[%d] = (%f + i%f)\n", rows_opA, col_opB, i , creal(M0[i]), cimag(M0[i]));
|
||||
|
||||
for(i=0; i<rows_M1*col_M1; ++i)
|
||||
printf(" M1[%d] = (%f + i%f)\n", i , creal(M1[i]), cimag(M1[i]));
|
||||
#endif
|
||||
|
||||
cblas_cgemm(CblasRowMajor, transa, transb, rows_opA, col_opB, col_opA, &alpha, M0, lda, M1, ldb, &beta, Result, ldc);
|
||||
|
||||
#ifdef DEBUG_PREPROC
|
||||
for(i=0; i<rows_opA*col_opB; ++i)
|
||||
printf(" result[%d] = (%f + i%f)\n", i , creal(Result[i]), cimag(Result[i]));
|
||||
#endif
|
||||
|
||||
}
|
||||
void mutl_matrix_matrix_col_based(float complex* M0, float complex* M1, int rows_M0, int col_M0, int rows_M1, int col_M1, float complex* Result ){
|
||||
enum CBLAS_TRANSPOSE transa = CblasNoTrans;
|
||||
enum CBLAS_TRANSPOSE transb = CblasNoTrans;
|
||||
int rows_opA = rows_M0; // number of rows in op(A) and in C
|
||||
int col_opB = col_M1; //number of columns of op(B) and in C
|
||||
int col_opA = col_M0; //number of columns in op(A) and rows in op(B)
|
||||
float complex alpha =1.0;
|
||||
int lda = col_M0;
|
||||
float complex beta = 0.0;
|
||||
int ldc = rows_M1;
|
||||
int ldb = rows_M1;
|
||||
|
||||
#ifdef DEBUG_PREPROC
|
||||
int i = 0;
|
||||
printf("rows_M0 %d, col_M0 %d, rows_M1 %d, col_M1 %d\n", rows_M0, col_M0, rows_M1, col_M1);
|
||||
|
||||
for(i=0; i<rows_M0*col_M0; ++i)
|
||||
printf(" rows_opA = %d, col_opB = %d, W_MMSE[%d] = (%f + i%f)\n", rows_opA, col_opB, i , creal(M0[i]), cimag(M0[i]));
|
||||
|
||||
|
||||
for(i=0; i<rows_M1*col_M1; ++i)
|
||||
printf(" M1[%d] = (%f + i%f)\n", i , creal(M1[i]), cimag(M1[i]));
|
||||
#endif
|
||||
|
||||
cblas_cgemm(CblasColMajor, transa, transb, rows_opA, col_opB, col_opA, &alpha, M0, lda, M1, ldb, &beta, Result, ldc);
|
||||
|
||||
#ifdef DEBUG_PREPROC
|
||||
for(i=0; i<rows_opA*col_opB; ++i)
|
||||
printf(" result[%d] = (%f + i%f)\n", i , creal(Result[i]), cimag(Result[i]));
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
/*FILTERS */
|
||||
void compute_MMSE(float complex* H, int order_H, float sigma2, float complex* W_MMSE)
|
||||
{
|
||||
int N = order_H;
|
||||
float complex* H_hermH_sigmaI = malloc(N*N*sizeof(float complex));
|
||||
float complex* H_herm = malloc(N*N*sizeof(float complex));
|
||||
|
||||
H_hermH_plus_sigma2I(N, N, H, sigma2, H_hermH_sigmaI);
|
||||
|
||||
#ifdef DEBUG_PREPROC
|
||||
int i =0;
|
||||
for(i=0;i<N*N;i++)
|
||||
printf(" H_hermH_sigmaI[%d] = (%f + i%f)\n", i , creal(H_hermH_sigmaI[i]), cimag(H_hermH_sigmaI[i]));
|
||||
#endif
|
||||
|
||||
conjugate_transpose (N, H, H_herm); //equals H_herm
|
||||
|
||||
#ifdef DEBUG_PREPROC
|
||||
for(i=0;i<N*N;i++)
|
||||
printf(" H_herm[%d] = (%f + i%f)\n", i , creal(H_herm[i]), cimag(H_herm[i]));
|
||||
#endif
|
||||
|
||||
lin_eq_solver(N, H_hermH_sigmaI, H_herm, W_MMSE);
|
||||
|
||||
#ifdef DEBUG_PREPROC
|
||||
for(i=0;i<N*N;i++)
|
||||
printf(" W_MMSE[%d] = (%f + i%f)\n", i , creal(W_MMSE[i]), cimag(W_MMSE[i]));
|
||||
#endif
|
||||
|
||||
free(H_hermH_sigmaI);
|
||||
free(H_herm);
|
||||
}
|
||||
|
||||
#if 0
|
||||
void compute_white_filter(float complex* H_re,
|
||||
int order_H,
|
||||
float sigma2,
|
||||
float complex* W_Wh_0_re,
|
||||
float complex* W_Wh_1_re){
|
||||
|
||||
int aatx, aarx, re;
|
||||
int i,j;
|
||||
int M =n_rx;
|
||||
int N = n_tx;
|
||||
int sigma2=noise_power;
|
||||
|
||||
float complex *H0_re = malloc(n_rx*(n_tx>>2)*sizeof(float complex));
|
||||
float complex *H1_re = malloc(n_rx*(n_tx>>2)*sizeof(float complex));
|
||||
float complex *R_corr_col_n_0_re = malloc(n_rx*n_tx*sizeof(float complex));
|
||||
float complex *R_corr_col_n_1_re = malloc(n_rx*n_tx*sizeof(float complex));
|
||||
float complex *U_0_re = malloc(n_rx*n_tx*sizeof(float complex));
|
||||
float complex *U_1_re = malloc(n_rx*n_tx*sizeof(float complex));
|
||||
float complex *U_0_herm_re = malloc(n_rx*n_tx*sizeof(float complex));
|
||||
float complex *U_1_herm_re = malloc(n_rx*n_tx*sizeof(float complex));
|
||||
float complex *D_0_re = malloc(n_rx*n_tx*sizeof(float complex));
|
||||
float complex *D_1_re = malloc(n_rx*n_tx*sizeof(float complex));
|
||||
float complex *W_Wh_0_re = malloc(n_rx*n_tx*sizeof(float complex));
|
||||
float complex *W_Wh_1_re = malloc(n_rx*n_tx*sizeof(float complex));
|
||||
|
||||
for (aatx=0; aatx<n_tx/2; aatx++){
|
||||
for (aarx=0; aarx<n_rx; aarx++) {
|
||||
H0_re[aatx*n_rx + aarx] = H_re[aatx*n_rx + aarx][re]; // H0 gets [0 1 2 3; 4,5,6,7].' coefficients of H
|
||||
H1_re[aatx*n_rx + aarx] = H_re[aatx*n_rx + aarx + 8][re]; // H1 gets [8 9 10 11; 12, 13, 14, 15].' coefficients of H
|
||||
if (re == 0)
|
||||
printf("ant %d, H_re = (%f + i%f) \n", aatx*n_rx + aarx, creal(H[aatx*n_rx + aarx][re]), cimag(H[aatx*n_rx + aarx][re]));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//HH_herm_plus_sigma2I(n_rx, (n_tx>>2), H1_re, sigma2, R_corr_col_n_0_re);
|
||||
HH_herm_plus_sigma2I(n_rx, (n_tx>>2), H0_re, sigma2, R_corr_col_n_1_re);
|
||||
|
||||
eigen_vectors_values(n_rx, R_corr_col_n_0_re, U_0_re, D_0_re);
|
||||
eigen_vectors_values(n_rx, R_corr_col_n_1_re, U_1_re, D_1_re);
|
||||
|
||||
transpose (n_rx, U_0_re, U_0_herm_re);
|
||||
transpose (n_rx, U_1_re, U_1_herm_re);
|
||||
|
||||
sigma = (float)(sqrt((double)(sigma2)));
|
||||
|
||||
/*The inverse of a diagonal matrix is obtained by replacing each element in the diagonal with its reciprocal.
|
||||
A square root of a diagonal matrix is given by the diagonal matrix, whose diagonal entries are just the square
|
||||
roots of the original matrix.*/
|
||||
|
||||
|
||||
D_0_re_inv_sqrt[0] = sqrt_float(1/D_0_re_inv[0]);
|
||||
D_0_re_inv_sqrt[5] = sqrt_float(1/D_0_re_inv[5]);
|
||||
D_0_re_inv_sqrt[10] = sqrt_float(1/D_0_re_inv[10]);
|
||||
D_0_re_inv_sqrt[15] = sqrt_float(1/D_0_re_inv[15]);
|
||||
|
||||
D_1_re_inv[0] = sqrt_float(1/D_1_re_inv[0]);
|
||||
D_1_re_inv[5] = sqrt_float(1/D_1_re_inv[5]);
|
||||
D_1_re_inv[10] = sqrt_float(1/D_1_re_inv[10]);
|
||||
D_1_re_inv[15] = sqrt_float(1/D_1_re_inv[15]);
|
||||
|
||||
now only to multiply
|
||||
|
||||
free(H0);
|
||||
free(H1);
|
||||
free(R_corr_col_n_0);
|
||||
free(R_corr_col_n_1);
|
||||
}
|
||||
#endif
|
||||
|
||||
float sqrt_float(float x, float sqrt_x)
|
||||
{
|
||||
sqrt_x = (float)(sqrt((double)(x)));
|
||||
return sqrt_x;
|
||||
}
|
||||
+121
@@ -0,0 +1,121 @@
|
||||
|
||||
#include<stdio.h>
|
||||
#include<math.h>
|
||||
#include<complex.h>
|
||||
#include <stdlib.h>
|
||||
#include "PHY/defs_UE.h"
|
||||
|
||||
|
||||
/* FUNCTIONS FOR LINEAR PREPROCESSING: MMSE, WHITENNING, etc*/
|
||||
void transpose(int N, float complex *A, float complex *Result);
|
||||
|
||||
void conjugate_transpose(int N, float complex *A, float complex *Result);
|
||||
|
||||
void H_hermH_plus_sigma2I(int N, int M, float complex *A, float sigma2, float complex *Result);
|
||||
|
||||
void HH_herm_plus_sigma2I(int M, int N, float complex *A, float sigma2, float complex *Result);
|
||||
|
||||
void eigen_vectors_values(int N, float complex *A, float complex *Vectors, float *Values_Matrix);
|
||||
|
||||
void lin_eq_solver(int N, float complex *A, float complex* B);
|
||||
//float complex* lin_eq_solver (int N, float complex* A, float complex* B);
|
||||
|
||||
/* mutl_matrix_matrix_row_based performs multiplications when matrix is row-oriented H[0], H[1]; H[2], H[3]*/
|
||||
void mutl_matrix_matrix_row_based(float complex* M0, float complex* M1, int rows_M0, int col_M0, int rows_M1, int col_M1, float complex* Result );
|
||||
|
||||
/* mutl_matrix_matrix_col_based performs multiplications matrix is column-oriented H[0], H[2]; H[1], H[3]*/
|
||||
void mutl_matrix_matrix_col_based(float complex* M0, float complex* M1, int rows_M0, int col_M0, int rows_M1, int col_M1, float complex* Result );
|
||||
|
||||
void compute_MMSE(float complex* H, int order_H, float sigma2, float complex* W_MMSE);
|
||||
|
||||
void compute_white_filter(float complex* H, int order_H, float sigma2, float complex* U_1, float complex* D_1);
|
||||
|
||||
void mmse_processing_oai(LTE_UE_PDSCH *pdsch_vars,
|
||||
LTE_DL_FRAME_PARMS *frame_parms,
|
||||
PHY_MEASUREMENTS *measurements,
|
||||
unsigned char first_symbol_flag,
|
||||
MIMO_mode_t mimo_mode,
|
||||
unsigned short mmse_flag,
|
||||
int noise_power,
|
||||
unsigned char symbol,
|
||||
unsigned short nb_rb);
|
||||
|
||||
|
||||
void precode_channel_est(int32_t **dl_ch_estimates_ext,
|
||||
LTE_DL_FRAME_PARMS *frame_parms,
|
||||
LTE_UE_PDSCH *pdsch_vars,
|
||||
unsigned char symbol,
|
||||
unsigned short nb_rb,
|
||||
MIMO_mode_t mimo_mode);
|
||||
|
||||
|
||||
void rxdataF_to_float(int32_t **rxdataF_ext,
|
||||
float complex **rxdataF_f,
|
||||
int n_rx,
|
||||
int length,
|
||||
int start_point);
|
||||
|
||||
void chan_est_to_float(int32_t **dl_ch_estimates_ext,
|
||||
float complex **dl_ch_estimates_ext_f,
|
||||
int n_tx,
|
||||
int n_rx,
|
||||
int length,
|
||||
int start_point);
|
||||
|
||||
void float_to_chan_est(int32_t **dl_ch_estimates_ext,
|
||||
float complex **dl_ch_estimates_ext_f,
|
||||
int n_tx,
|
||||
int n_rx,
|
||||
int length,
|
||||
int start_point);
|
||||
|
||||
void float_to_rxdataF(int32_t **rxdataF_ext,
|
||||
float complex **rxdataF_f,
|
||||
int n_tx,
|
||||
int n_rx,
|
||||
int length,
|
||||
int start_point);
|
||||
|
||||
void mult_mmse_rxdataF(float complex** Wmmse,
|
||||
float complex** rxdataF_ext_f,
|
||||
int n_tx,
|
||||
int n_rx,
|
||||
int length,
|
||||
int start_point);
|
||||
|
||||
void mult_mmse_chan_est(float complex** Wmmse,
|
||||
float complex** dl_ch_estimates_ext_f,
|
||||
int n_tx,
|
||||
int n_rx,
|
||||
int length,
|
||||
int start_point);
|
||||
|
||||
void mmse_processing_core(int32_t **rxdataF_ext,
|
||||
int32_t **dl_ch_estimates_ext,
|
||||
int sigma2,
|
||||
int n_tx,
|
||||
int n_rx,
|
||||
int length,
|
||||
int start_point);
|
||||
|
||||
void mmse_processing_core_flp(float complex** rxdataF_ext_flcpx,
|
||||
float complex **H,
|
||||
int32_t **rxdataF_ext,
|
||||
int32_t **dl_ch_estimates_ext,
|
||||
float sigma2,
|
||||
int n_tx,
|
||||
int n_rx,
|
||||
int length,
|
||||
int start_point);
|
||||
|
||||
void whitening_processing_core_flp(float complex** rxdataF_ext_flcpx,
|
||||
float complex **H,
|
||||
int32_t **rxdataF_ext,
|
||||
int32_t **dl_ch_estimates_ext,
|
||||
float sigma2,
|
||||
int n_tx,
|
||||
int n_rx,
|
||||
int length,
|
||||
int start_point);
|
||||
|
||||
float sqrt_float(float x, float sqrt_x);
|
||||
@@ -369,7 +369,7 @@ void rx_phich(PHY_VARS_UE *ue,
|
||||
|
||||
if (HI16>0) { //NACK
|
||||
if (ue->ulsch_Msg3_active[eNB_id] == 1) {
|
||||
LOG_D(PHY,"[UE %d][PUSCH %d][RAPROC] Frame %d subframe %d Msg3 PHICH, received NAK (%d) nseq %d, ngroup %d\n",
|
||||
LOG_I(PHY,"[UE %d][PUSCH %d][RAPROC] Frame %d subframe %d Msg3 PHICH, received NAK (%d) nseq %d, ngroup %d\n",
|
||||
ue->Mod_id,harq_pid,
|
||||
proc->frame_rx,
|
||||
subframe,
|
||||
@@ -379,7 +379,7 @@ void rx_phich(PHY_VARS_UE *ue,
|
||||
|
||||
ulsch->f_pusch += delta_PUSCH_acc[ulsch->harq_processes[harq_pid]->TPC];
|
||||
|
||||
LOG_D(PHY,"[PUSCH %d] AbsSubframe %d.%d: f_pusch (ACC) %d, adjusting by %d (TPC %d)\n",
|
||||
LOG_I(PHY,"[PUSCH %d] AbsSubframe %d.%d: f_pusch (ACC) %d, adjusting by %d (TPC %d)\n",
|
||||
harq_pid,proc->frame_rx,subframe,ulsch->f_pusch,
|
||||
delta_PUSCH_acc[ulsch->harq_processes[harq_pid]->TPC],
|
||||
ulsch->harq_processes[harq_pid]->TPC);
|
||||
|
||||
@@ -41,6 +41,8 @@
|
||||
|
||||
#include "../LTE_TRANSPORT/prach_extern.h"
|
||||
|
||||
//#define PRACH_DEBUG 1
|
||||
|
||||
int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint16_t Nf )
|
||||
{
|
||||
|
||||
@@ -98,7 +100,7 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1
|
||||
|
||||
#else //normal case (simulation)
|
||||
prach_start = subframe*ue->frame_parms.samples_per_tti-ue->N_TA_offset;
|
||||
LOG_D(PHY,"[UE %d] prach_start %d, rx_offset %d, hw_timing_advance %d, N_TA_offset %d\n", ue->Mod_id,
|
||||
LOG_I(PHY,"[UE %d] prach_start %d, rx_offset %d, hw_timing_advance %d, N_TA_offset %d\n", ue->Mod_id,
|
||||
prach_start,
|
||||
ue->rx_offset,
|
||||
ue->hw_timing_advance,
|
||||
|
||||
@@ -182,7 +182,7 @@ int generate_ue_ulsch_params_from_rar(PHY_VARS_UE *ue,
|
||||
// initialize power control based on PRACH power
|
||||
ulsch->f_pusch = delta_PUSCH_msg2[ulsch->harq_processes[harq_pid]->TPC] +
|
||||
get_deltaP_rampup(ue->Mod_id,ue->CC_id);
|
||||
LOG_D(PHY,"[UE %d][PUSCH PC] Initializing f_pusch to %d dB, TPC %d (delta_PUSCH_msg2 %d dB), deltaP_rampup %d dB\n",
|
||||
LOG_I(PHY,"[UE %d][PUSCH PC] Initializing f_pusch to %d dB, TPC %d (delta_PUSCH_msg2 %d dB), deltaP_rampup %d dB\n",
|
||||
ue->Mod_id,ulsch->f_pusch,ulsch->harq_processes[harq_pid]->TPC,delta_PUSCH_msg2[ulsch->harq_processes[harq_pid]->TPC],
|
||||
get_deltaP_rampup(ue->Mod_id,ue->CC_id));
|
||||
|
||||
|
||||
@@ -106,6 +106,22 @@ void qpsk_qpsk(int16_t *stream0_in,
|
||||
@param nb_rb number of RBs for this allocation
|
||||
@param pbch_pss_sss_adj Number of channel bits taken by PBCH/PSS/SSS
|
||||
@param llr128p pointer to pointer to symbol in dlsch_llr*/
|
||||
|
||||
void qpsk_llr(int16_t *stream0_in,
|
||||
int16_t *stream0_out,
|
||||
int length);
|
||||
|
||||
void qam16_llr(int16_t *stream0_in,
|
||||
int16_t *chan_magn,
|
||||
int16_t *llr,
|
||||
int length);
|
||||
|
||||
void qam64_llr(int16_t *stream0_in,
|
||||
int16_t *chan_magn,
|
||||
int16_t *chan_magn_b,
|
||||
int16_t *llr,
|
||||
int length);
|
||||
|
||||
int32_t dlsch_qpsk_qpsk_llr(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
int32_t **rxdataF_comp,
|
||||
int32_t **rxdataF_comp_i,
|
||||
@@ -816,6 +832,19 @@ void dlsch_channel_compensation(int32_t **rxdataF_ext,
|
||||
uint8_t output_shift,
|
||||
PHY_MEASUREMENTS *phy_measurements);
|
||||
|
||||
void dlsch_channel_compensation_core(int **rxdataF_ext,
|
||||
int **dl_ch_estimates_ext,
|
||||
int **dl_ch_mag,
|
||||
int **dl_ch_magb,
|
||||
int **rxdataF_comp,
|
||||
int **rho,
|
||||
unsigned char n_tx,
|
||||
unsigned char n_rx,
|
||||
unsigned char mod_order,
|
||||
unsigned char output_shift,
|
||||
int length,
|
||||
int start_point);
|
||||
|
||||
void dlsch_dual_stream_correlation(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
unsigned char symbol,
|
||||
unsigned short nb_rb,
|
||||
@@ -912,6 +941,7 @@ void dlsch_channel_compensation_TM34(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
int round,
|
||||
MIMO_mode_t mimo_mode,
|
||||
unsigned short nb_rb,
|
||||
unsigned short mmse_flag,
|
||||
unsigned char output_shift0,
|
||||
unsigned char output_shift1);
|
||||
|
||||
@@ -929,6 +959,20 @@ void dlsch_channel_level(int32_t **dl_ch_estimates_ext,
|
||||
uint8_t pilots_flag,
|
||||
uint16_t nb_rb);
|
||||
|
||||
void dlsch_channel_level_core(int32_t **dl_ch_estimates_ext,
|
||||
int32_t *avg,
|
||||
int n_tx,
|
||||
int n_rx,
|
||||
int length,
|
||||
int start_point);
|
||||
|
||||
void dlsch_channel_level_median(int **dl_ch_estimates_ext,
|
||||
int32_t *median,
|
||||
int n_tx,
|
||||
int n_rx,
|
||||
int length,
|
||||
int start_point);
|
||||
|
||||
|
||||
void dlsch_channel_level_TM34(int **dl_ch_estimates_ext,
|
||||
LTE_DL_FRAME_PARMS *frame_parms,
|
||||
@@ -937,6 +981,7 @@ void dlsch_channel_level_TM34(int **dl_ch_estimates_ext,
|
||||
int *avg_1,
|
||||
uint8_t symbol,
|
||||
unsigned short nb_rb,
|
||||
unsigned int mmse_flag,
|
||||
MIMO_mode_t mimo_mode);
|
||||
|
||||
|
||||
@@ -1672,8 +1717,8 @@ double computeRhoB_UE(PDSCH_CONFIG_DEDICATED *pdsch_config_dedicated,
|
||||
LTE_UE_DLSCH_t *dlsch_ue);
|
||||
*/
|
||||
|
||||
uint8_t get_prach_prb_offset(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
uint8_t prach_ConfigIndex,
|
||||
uint8_t get_prach_prb_offset(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
uint8_t prach_ConfigIndex,
|
||||
uint8_t n_ra_prboffset,
|
||||
uint8_t tdd_mapindex, uint16_t Nf);
|
||||
|
||||
|
||||
@@ -83,6 +83,9 @@ void remove_7_5_kHz(RU_t *ru,uint8_t slot)
|
||||
|
||||
len = frame_parms->samples_per_tti/2;
|
||||
|
||||
AssertFatal(slot_offset<10*frame_parms->samples_per_tti,
|
||||
"slot_offset %d >= %d\n",slot_offset,10*frame_parms->samples_per_tti);
|
||||
|
||||
for (aa=0; aa<ru->nb_rx; aa++) {
|
||||
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
|
||||
+35
-3
@@ -69,6 +69,38 @@
|
||||
#include <pthread.h>
|
||||
#include "assertions.h"
|
||||
|
||||
#ifdef MEX
|
||||
#include "mex.h"
|
||||
# define msg mexPrintf
|
||||
# undef LOG_D
|
||||
# undef LOG_E
|
||||
# undef LOG_I
|
||||
# undef LOG_N
|
||||
# undef LOG_T
|
||||
# undef LOG_W
|
||||
# undef LOG_M
|
||||
# define LOG_D(x, ...) mexPrintf(__VA_ARGS__)
|
||||
# define LOG_E(x, ...) mexPrintf(__VA_ARGS__)
|
||||
# define LOG_I(x, ...) mexPrintf(__VA_ARGS__)
|
||||
# define LOG_N(x, ...) mexPrintf(__VA_ARGS__)
|
||||
# define LOG_T(x, ...) mexPrintf(__VA_ARGS__)
|
||||
# define LOG_W(x, ...) mexPrintf(__VA_ARGS__)
|
||||
# define LOG_M(x, ...) mexPrintf(__VA_ARGS__)
|
||||
#else
|
||||
# ifdef OPENAIR2
|
||||
# if ENABLE_RAL
|
||||
# include "collection/hashtable/hashtable.h"
|
||||
# include "COMMON/ral_messages_types.h"
|
||||
# include "UTIL/queue.h"
|
||||
# endif
|
||||
# include "log.h"
|
||||
# define msg(aRGS...) LOG_D(PHY, ##aRGS)
|
||||
# else
|
||||
# define msg printf
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/// Context data structure for RX/TX portion of subframe processing
|
||||
typedef struct {
|
||||
@@ -273,13 +305,13 @@ typedef struct {
|
||||
/// - first index: rx antenna [0..nb_antennas_rx[
|
||||
/// - second index: symbol [0..28*ofdm_symbol_size[
|
||||
int32_t **rxdataF;
|
||||
|
||||
|
||||
/// \brief Hold the channel estimates in frequency domain.
|
||||
/// - first index: eNB id [0..6] (hard coded)
|
||||
/// - second index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
|
||||
/// - third index: samples? [0..symbols_per_tti*(ofdm_symbol_size+LTE_CE_FILTER_LENGTH)[
|
||||
int32_t **dl_ch_estimates[7];
|
||||
|
||||
|
||||
/// \brief Hold the channel estimates in time domain (used for tracking).
|
||||
/// - first index: eNB id [0..6] (hard coded)
|
||||
/// - second index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
|
||||
@@ -848,7 +880,7 @@ typedef struct {
|
||||
|
||||
/// RF and Interface devices per CC
|
||||
|
||||
openair0_device rfdevice;
|
||||
openair0_device rfdevice;
|
||||
} PHY_VARS_UE;
|
||||
|
||||
/* this structure is used to pass both UE phy vars and
|
||||
|
||||
@@ -981,7 +981,7 @@ typedef uint8_t(encoder_if_t)(uint8_t *input,
|
||||
|
||||
static inline void wait_sync(char *thread_name) {
|
||||
|
||||
printf( "waiting for sync (%s)\n",thread_name);
|
||||
printf( "waiting for sync (%s,%d/%p,%p,%p)\n",thread_name,sync_var,&sync_var,&sync_cond,&sync_mutex);
|
||||
pthread_mutex_lock( &sync_mutex );
|
||||
|
||||
while (sync_var<0)
|
||||
|
||||
@@ -287,9 +287,9 @@ typedef struct {
|
||||
|
||||
#ifndef malloc16
|
||||
# ifdef __AVX2__
|
||||
# define malloc16(x) memalign(32,x)
|
||||
# define malloc16(x) memalign(32,x+32)
|
||||
# else
|
||||
# define malloc16(x) memalign(16,x)
|
||||
# define malloc16(x) memalign(16,x+16)
|
||||
# endif
|
||||
#endif
|
||||
#define free16(y,x) free(y)
|
||||
@@ -306,9 +306,9 @@ typedef struct {
|
||||
static inline void* malloc16_clear( size_t size )
|
||||
{
|
||||
#ifdef __AVX2__
|
||||
void* ptr = memalign(32, size);
|
||||
void* ptr = memalign(32, size+32);
|
||||
#else
|
||||
void* ptr = memalign(16, size);
|
||||
void* ptr = memalign(16, size+16);
|
||||
#endif
|
||||
DevAssert(ptr);
|
||||
memset( ptr, 0, size );
|
||||
|
||||
@@ -70,7 +70,6 @@ extern char mode_string[4][20];
|
||||
|
||||
|
||||
|
||||
extern unsigned char NB_RU;
|
||||
|
||||
#ifndef OPENAIR2
|
||||
extern unsigned char NB_eNB_INST;
|
||||
|
||||
@@ -65,7 +65,6 @@ extern int flagMag;
|
||||
|
||||
extern char mode_string[4][20];
|
||||
|
||||
extern unsigned char NB_RU;
|
||||
|
||||
#ifndef OPENAIR2
|
||||
extern unsigned char NB_eNB_INST;
|
||||
|
||||
@@ -66,7 +66,6 @@ char mode_string[4][20] = {"NOT SYNCHED","PRACH","RAR","PUSCH"};
|
||||
|
||||
#include "SIMULATION/ETH_TRANSPORT/vars.h"
|
||||
|
||||
unsigned char NB_RU=0;
|
||||
|
||||
#ifndef OPENAIR2
|
||||
unsigned char NB_eNB_INST=0;
|
||||
|
||||
@@ -60,7 +60,6 @@ char mode_string[4][20] = {"NOT SYNCHED","PRACH","RAR","PUSCH"};
|
||||
|
||||
#include "SIMULATION/ETH_TRANSPORT/vars.h"
|
||||
|
||||
unsigned char NB_RU=0;
|
||||
|
||||
#ifndef OPENAIR2
|
||||
unsigned char NB_eNB_INST=0;
|
||||
|
||||
@@ -451,7 +451,7 @@ uint8_t get_reset_ack(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
o_ACK[cw_idx] = harq_ack[subframe_dl0].ack;
|
||||
status = harq_ack[subframe_dl0].send_harq_status;
|
||||
|
||||
//LOG_I(PHY,"dl subframe %d send_harq_status %d cw_idx %d, reset %d\n",subframe_dl0, status, cw_idx, do_reset);
|
||||
LOG_D(PHY,"dl subframe %d send_harq_status %d cw_idx %d, reset %d\n",subframe_dl0, status, cw_idx, do_reset);
|
||||
if(do_reset)
|
||||
harq_ack[subframe_dl0].send_harq_status = 0;
|
||||
//printf("get_ack: Getting ACK/NAK for PDSCH (subframe %d) => %d\n",subframe_dl,o_ACK[0]);
|
||||
@@ -631,7 +631,7 @@ uint8_t get_reset_ack(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
pN_bundled[0] = harq_ack[subframe_rx].vDAI_UL;
|
||||
status = harq_ack[subframe_dl0].send_harq_status + harq_ack[subframe_dl1].send_harq_status + harq_ack[subframe_dl2].send_harq_status + harq_ack[subframe_dl3].send_harq_status;
|
||||
|
||||
LOG_I(PHY,"TDD Config3 UL Sfn %d, dl Sfn0 %d status %d o_Ack %d, dl Sfn1 %d status %d o_Ack %d dl Sfn2 %d status %d o_Ack %d dl Sfn3 %d status %d o_Ack %d subframe_rx %d N_bundled %d status %d\n",
|
||||
LOG_D(PHY,"TDD Config3 UL Sfn %d, dl Sfn0 %d status %d o_Ack %d, dl Sfn1 %d status %d o_Ack %d dl Sfn2 %d status %d o_Ack %d dl Sfn3 %d status %d o_Ack %d subframe_rx %d N_bundled %d status %d\n",
|
||||
subframe_tx, subframe_dl0, harq_ack[subframe_dl0].send_harq_status,harq_ack[subframe_dl0].ack,
|
||||
subframe_dl1, harq_ack[subframe_dl1].send_harq_status,harq_ack[subframe_dl1].ack,
|
||||
subframe_dl2, harq_ack[subframe_dl2].send_harq_status,harq_ack[subframe_dl2].ack,
|
||||
|
||||
@@ -558,11 +558,8 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
|
||||
|
||||
|
||||
|
||||
// num_pdcch_symbols = DCI_pdu->num_pdcch_symbols;
|
||||
num_pdcch_symbols = eNB->pdcch_vars[subframe&1].num_pdcch_symbols;
|
||||
num_dci = eNB->pdcch_vars[subframe&1].num_dci;
|
||||
// LOG_D(PHY,"num_pdcch_symbols %"PRIu8",(dci common %"PRIu8", dci uespec %"PRIu8"\n",num_pdcch_symbols,
|
||||
// DCI_pdu->Num_common_dci,DCI_pdu->Num_ue_spec_dci);
|
||||
LOG_D(PHY,"num_pdcch_symbols %"PRIu8",number dci %"PRIu8"\n",num_pdcch_symbols, num_dci);
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_DCI_INFO,num_pdcch_symbols);
|
||||
|
||||
@@ -572,7 +569,6 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
|
||||
if (num_dci > 0)
|
||||
LOG_D(PHY,"[eNB %"PRIu8"] Frame %d, subframe %d: Calling generate_dci_top (pdcch) (num_dci %"PRIu8") num_pdcch_symbols:%d\n",eNB->Mod_id,frame, subframe, num_dci, num_pdcch_symbols);
|
||||
|
||||
//LOG_D(PHY,"Before generate_dci_top num_pdcch_symbols:%d num_dci:%d dci_alloc:dci_length:%d\n", num_pdcch_symbols, num_dci, eNB->pdcch_vars[subframe&1].dci_alloc[0].dci_length);
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_PDCCH_TX,1);
|
||||
|
||||
@@ -776,15 +772,15 @@ void uci_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
|
||||
case HARQ_SR:
|
||||
|
||||
metric_SR = rx_pucch(eNB,
|
||||
uci->pucch_fmt,
|
||||
i,
|
||||
uci->n_pucch_1_0_sr[0],
|
||||
0, // n2_pucch
|
||||
uci->srs_active, // shortened format
|
||||
&SR_payload,
|
||||
frame,
|
||||
subframe,
|
||||
PUCCH1_THRES);
|
||||
uci->pucch_fmt,
|
||||
i,
|
||||
uci->n_pucch_1_0_sr[0],
|
||||
0, // n2_pucch
|
||||
uci->srs_active, // shortened format
|
||||
&SR_payload,
|
||||
frame,
|
||||
subframe,
|
||||
PUCCH1_THRES);
|
||||
LOG_D(PHY,"[eNB %d][SR %x] Frame %d subframe %d Checking SR is %d (uci.type %d SR n1pucch is %d)\n",
|
||||
eNB->Mod_id,
|
||||
uci->rnti,
|
||||
@@ -849,37 +845,42 @@ void uci_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
|
||||
frame,subframe,
|
||||
pucch_b0b1[0][0],metric[0]);
|
||||
|
||||
uci->stat = metric[0];
|
||||
uci->stat = metric[0];
|
||||
fill_uci_harq_indication(eNB,uci,frame,subframe,pucch_b0b1[0],0,0xffff);
|
||||
|
||||
}
|
||||
else { // frame_type == TDD
|
||||
LOG_D(PHY,"Frame %d Subframe %d Demodulating PUCCH (UCI %d) for ACK/NAK (uci->pucch_fmt %d,uci->type %d.uci->frame %d, uci->subframe %d): n1_pucch0 %d SR_payload %d\n",
|
||||
frame,subframe,i,
|
||||
uci->pucch_fmt,uci->type,
|
||||
uci->frame,uci->subframe,uci->n_pucch_1[0][0],
|
||||
SR_payload);
|
||||
#if 1
|
||||
metric[0] = rx_pucch(eNB,
|
||||
uci->pucch_fmt,
|
||||
i,
|
||||
uci->n_pucch_1[0][0],
|
||||
0, //n2_pucch
|
||||
uci->srs_active, // shortened format
|
||||
pucch_b0b1[0],
|
||||
frame,
|
||||
subframe,
|
||||
PUCCH1a_THRES);
|
||||
uci->pucch_fmt,
|
||||
i,
|
||||
uci->n_pucch_1[0][0],
|
||||
0, //n2_pucch
|
||||
uci->srs_active, // shortened format
|
||||
pucch_b0b1[0],
|
||||
frame,
|
||||
subframe,
|
||||
PUCCH1a_THRES);
|
||||
if (uci->type==HARQ_SR && metric[0] > metric_SR) SR_payload = 0;
|
||||
else if (SR_payload == 1) fill_sr_indication(eNB,uci->rnti,frame,subframe,metric_SR);
|
||||
|
||||
if (uci->type==HARQ_SR && metric[0] <= metric_SR) {
|
||||
SR_payload = 1;
|
||||
metric[0] = rx_pucch(eNB,
|
||||
pucch_format1b,
|
||||
i,
|
||||
uci->n_pucch_1_0_sr[0],
|
||||
0, //n2_pucch
|
||||
uci->srs_active, // shortened format
|
||||
pucch_b0b1[0],
|
||||
frame,
|
||||
subframe,
|
||||
PUCCH1a_THRES);
|
||||
pucch_format1b,
|
||||
i,
|
||||
uci->n_pucch_1_0_sr[0],
|
||||
0, //n2_pucch
|
||||
uci->srs_active, // shortened format
|
||||
pucch_b0b1[0],
|
||||
frame,
|
||||
subframe,
|
||||
PUCCH1a_THRES);
|
||||
}
|
||||
#else
|
||||
// if SR was detected, use the n1_pucch from SR
|
||||
@@ -949,7 +950,7 @@ void uci_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
|
||||
else if (pucch_b0b1[0][0] != 1 && pucch_b0b1[0][1] != 1) { // 0 ACKs, or at least one DL assignment missed
|
||||
harq_ack[0] = 0;
|
||||
}
|
||||
uci->stat = metric[0];
|
||||
uci->stat = metric[0];
|
||||
fill_uci_harq_indication(eNB,uci,frame,subframe,harq_ack,2,0xffff); // special_bundling mode
|
||||
}
|
||||
else if ((uci->tdd_bundling == 0) && (uci->num_pucch_resources==2)){ // multiplexing + no SR, implement Table 10.1.3-5 (Rel14) for multiplexing with M=2
|
||||
@@ -991,7 +992,7 @@ void uci_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
|
||||
}
|
||||
}
|
||||
}
|
||||
uci->stat = max(metric[0],metric[1]);
|
||||
uci->stat = max(metric[0],metric[1]);
|
||||
fill_uci_harq_indication(eNB,uci,frame,subframe,harq_ack,1,tdd_multiplexing_mask); // multiplexing mode
|
||||
} //else if ((uci->tdd_bundling == 0) && (res==2))
|
||||
else if ((uci->tdd_bundling == 0) && (uci->num_pucch_resources==3)){ // multiplexing + no SR, implement Table 10.1.3-6 (Rel14) for multiplexing with M=3
|
||||
@@ -1210,13 +1211,14 @@ void uci_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
|
||||
}
|
||||
}
|
||||
}
|
||||
uci->stat = max_metric;
|
||||
uci->stat = max_metric;
|
||||
fill_uci_harq_indication(eNB,uci,frame,subframe,harq_ack,1,tdd_multiplexing_mask); // multiplexing mode
|
||||
} // else if ((uci->tdd_bundling == 0) && (res==4))
|
||||
else { // bundling
|
||||
harq_ack[0] = pucch_b0b1[0][0];
|
||||
harq_ack[1] = pucch_b0b1[0][1];
|
||||
uci->stat = metric[0];
|
||||
uci->stat = metric[0];
|
||||
LOG_D(PHY,"bundling: (%d,%d), metric %d\n",harq_ack[0],harq_ack[1],uci->stat);
|
||||
fill_uci_harq_indication(eNB,uci,frame,subframe,harq_ack,0,0xffff); // special_bundling mode
|
||||
}
|
||||
|
||||
@@ -1285,49 +1287,49 @@ void pusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
|
||||
int rb2 = rb+ulsch_harq->first_rb;
|
||||
eNB->rb_mask_ul[rb2>>5] |= (1<<(rb2&31));
|
||||
}
|
||||
|
||||
|
||||
LOG_D(PHY,"[eNB %d] frame %d, subframe %d: Scheduling ULSCH Reception for UE %d \n", eNB->Mod_id, frame, subframe, i);
|
||||
|
||||
|
||||
nPRS = fp->pusch_config_common.ul_ReferenceSignalsPUSCH.nPRS[subframe<<1];
|
||||
|
||||
|
||||
ulsch->cyclicShift = (ulsch_harq->n_DMRS2 +
|
||||
fp->pusch_config_common.ul_ReferenceSignalsPUSCH.cyclicShift +
|
||||
nPRS)%12;
|
||||
|
||||
fp->pusch_config_common.ul_ReferenceSignalsPUSCH.cyclicShift +
|
||||
nPRS)%12;
|
||||
AssertFatal(ulsch_harq->TBS>0,"illegal TBS %d\n",ulsch_harq->TBS);
|
||||
LOG_D(PHY,
|
||||
"[eNB %d][PUSCH %d] Frame %d Subframe %d Demodulating PUSCH: dci_alloc %d, rar_alloc %d, round %d, first_rb %d, nb_rb %d, Qm %d, TBS %d, rv %d, cyclic_shift %d (n_DMRS2 %d, cyclicShift_common %d, ), O_ACK %d, beta_cqi %d \n",
|
||||
eNB->Mod_id,harq_pid,frame,subframe,
|
||||
ulsch_harq->dci_alloc,
|
||||
ulsch_harq->rar_alloc,
|
||||
ulsch_harq->round,
|
||||
ulsch_harq->first_rb,
|
||||
ulsch_harq->nb_rb,
|
||||
ulsch_harq->Qm,
|
||||
ulsch_harq->TBS,
|
||||
ulsch_harq->rvidx,
|
||||
ulsch->cyclicShift,
|
||||
ulsch_harq->n_DMRS2,
|
||||
fp->pusch_config_common.ul_ReferenceSignalsPUSCH.cyclicShift,
|
||||
ulsch_harq->O_ACK,
|
||||
ulsch->beta_offset_cqi_times8);
|
||||
|
||||
start_meas(&eNB->ulsch_demodulation_stats);
|
||||
|
||||
rx_ulsch(eNB,proc, i);
|
||||
|
||||
stop_meas(&eNB->ulsch_demodulation_stats);
|
||||
|
||||
start_meas(&eNB->ulsch_decoding_stats);
|
||||
|
||||
ret = ulsch_decoding(eNB,proc,
|
||||
i,
|
||||
0, // control_only_flag
|
||||
ulsch_harq->V_UL_DAI,
|
||||
ulsch_harq->nb_rb>20 ? 1 : 0);
|
||||
|
||||
stop_meas(&eNB->ulsch_decoding_stats);
|
||||
|
||||
LOG_D(PHY,"[eNB %d][PUSCH %d] frame %d subframe %d RNTI %x RX power (%d,%d) N0 (%d,%d) dB ACK (%d,%d), decoding iter %d ulsch_harq->cqi_crc_status:%d ackBits:%d ulsch_decoding_stats[t:%lld max:%lld]\n",
|
||||
"[eNB %d][PUSCH %d] Frame %d Subframe %d Demodulating PUSCH: dci_alloc %d, rar_alloc %d, round %d, first_rb %d, nb_rb %d, Qm %d, TBS %d, rv %d, cyclic_shift %d (n_DMRS2 %d, cyclicShift_common %d, ), O_ACK %d, beta_cqi %d \n",
|
||||
eNB->Mod_id,harq_pid,frame,subframe,
|
||||
ulsch_harq->dci_alloc,
|
||||
ulsch_harq->rar_alloc,
|
||||
ulsch_harq->round,
|
||||
ulsch_harq->first_rb,
|
||||
ulsch_harq->nb_rb,
|
||||
ulsch_harq->Qm,
|
||||
ulsch_harq->TBS,
|
||||
ulsch_harq->rvidx,
|
||||
ulsch->cyclicShift,
|
||||
ulsch_harq->n_DMRS2,
|
||||
fp->pusch_config_common.ul_ReferenceSignalsPUSCH.cyclicShift,
|
||||
ulsch_harq->O_ACK,
|
||||
ulsch->beta_offset_cqi_times8);
|
||||
|
||||
start_meas(&eNB->ulsch_demodulation_stats);
|
||||
|
||||
rx_ulsch(eNB,proc, i);
|
||||
|
||||
stop_meas(&eNB->ulsch_demodulation_stats);
|
||||
|
||||
start_meas(&eNB->ulsch_decoding_stats);
|
||||
|
||||
ret = ulsch_decoding(eNB,proc,
|
||||
i,
|
||||
0, // control_only_flag
|
||||
ulsch_harq->V_UL_DAI,
|
||||
ulsch_harq->nb_rb>20 ? 1 : 0);
|
||||
|
||||
stop_meas(&eNB->ulsch_decoding_stats);
|
||||
|
||||
LOG_D(PHY,"[eNB %d][PUSCH %d] frame %d subframe %d RNTI %x RX power (%d,%d) N0 (%d,%d) dB ACK (%d,%d), decoding iter %d ulsch_harq->cqi_crc_status:%d ackBits:%d ulsch_decoding_stats[t:%lld max:%lld]\n",
|
||||
eNB->Mod_id,harq_pid,
|
||||
frame,subframe,
|
||||
ulsch->rnti,
|
||||
@@ -1341,35 +1343,29 @@ void pusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
|
||||
ulsch_harq->cqi_crc_status,
|
||||
ulsch_harq->O_ACK,
|
||||
eNB->ulsch_decoding_stats.diff_now, eNB->ulsch_decoding_stats.max);
|
||||
|
||||
//compute the expected ULSCH RX power (for the stats)
|
||||
ulsch_harq->delta_TF = get_hundred_times_delta_IF_eNB(eNB,i,harq_pid, 0); // 0 means bw_factor is not considered
|
||||
|
||||
if (ulsch_harq->cqi_crc_status == 1) {
|
||||
|
||||
//compute the expected ULSCH RX power (for the stats)
|
||||
ulsch_harq->delta_TF = get_hundred_times_delta_IF_eNB(eNB,i,harq_pid, 0); // 0 means bw_factor is not considered
|
||||
|
||||
if (ulsch_harq->cqi_crc_status == 1) {
|
||||
#ifdef DEBUG_PHY_PROC
|
||||
//if (((frame%10) == 0) || (frame < 50))
|
||||
print_CQI(ulsch_harq->o,ulsch_harq->uci_format,0,fp->N_RB_DL);
|
||||
//if (((frame%10) == 0) || (frame < 50))
|
||||
print_CQI(ulsch_harq->o,ulsch_harq->uci_format,0,fp->N_RB_DL);
|
||||
#endif
|
||||
|
||||
|
||||
fill_ulsch_cqi_indication(eNB,frame,subframe,
|
||||
ulsch_harq,
|
||||
ulsch->rnti);
|
||||
RC.mac[eNB->Mod_id]->UE_list.UE_sched_ctrl[i].cqi_req_flag &= (~(1 << subframe));
|
||||
}else{
|
||||
if(RC.mac[eNB->Mod_id]->UE_list.UE_sched_ctrl[i].cqi_req_flag & (1 << subframe) ){
|
||||
RC.mac[eNB->Mod_id]->UE_list.UE_sched_ctrl[i].cqi_req_flag &= (~(1 << subframe));
|
||||
RC.mac[eNB->Mod_id]->UE_list.UE_sched_ctrl[i].cqi_req_timer=30;
|
||||
LOG_D(PHY,"Frame %d,Subframe %d, We're supposed to get a cqi here. Set cqi_req_timer to 30.\n",frame,subframe);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
if (ret == (1+MAX_TURBO_ITERATIONS)) {
|
||||
T(T_ENB_PHY_ULSCH_UE_NACK, T_INT(eNB->Mod_id), T_INT(frame), T_INT(subframe), T_INT(ulsch->rnti),
|
||||
T_INT(harq_pid));
|
||||
|
||||
T(T_ENB_PHY_ULSCH_UE_NACK, T_INT(eNB->Mod_id), T_INT(frame), T_INT(subframe), T_INT(ulsch->rnti),
|
||||
T_INT(harq_pid));
|
||||
|
||||
fill_crc_indication(eNB,i,frame,subframe,1); // indicate NAK to MAC
|
||||
fill_rx_indication(eNB,i,frame,subframe); // indicate SDU to MAC
|
||||
|
||||
|
||||
LOG_D(PHY,"[eNB %d][PUSCH %d] frame %d subframe %d UE %d Error receiving ULSCH, round %d/%d (ACK %d,%d)\n",
|
||||
eNB->Mod_id,harq_pid,
|
||||
frame,subframe, i,
|
||||
@@ -1377,24 +1373,24 @@ void pusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
|
||||
ulsch->Mlimit,
|
||||
ulsch_harq->o_ACK[0],
|
||||
ulsch_harq->o_ACK[1]);
|
||||
|
||||
|
||||
if (ulsch_harq->round >= 3) {
|
||||
ulsch_harq->status = SCH_IDLE;
|
||||
ulsch_harq->handled = 0;
|
||||
ulsch->harq_mask &= ~(1 << harq_pid);
|
||||
ulsch_harq->round = 0;
|
||||
}
|
||||
ulsch_harq->status = SCH_IDLE;
|
||||
ulsch_harq->handled = 0;
|
||||
ulsch->harq_mask &= ~(1 << harq_pid);
|
||||
ulsch_harq->round = 0;
|
||||
}
|
||||
#if defined(MESSAGE_CHART_GENERATOR_PHY)
|
||||
MSC_LOG_RX_DISCARDED_MESSAGE(
|
||||
MSC_PHY_ENB,MSC_PHY_UE,
|
||||
NULL,0,
|
||||
"%05u:%02u ULSCH received rnti %x harq id %u round %d",
|
||||
frame,subframe,
|
||||
ulsch->rnti,harq_pid,
|
||||
ulsch_harq->round-1
|
||||
);
|
||||
MSC_PHY_ENB,MSC_PHY_UE,
|
||||
NULL,0,
|
||||
"%05u:%02u ULSCH received rnti %x harq id %u round %d",
|
||||
frame,subframe,
|
||||
ulsch->rnti,harq_pid,
|
||||
ulsch_harq->round-1
|
||||
);
|
||||
#endif
|
||||
|
||||
|
||||
/* Mark the HARQ process to release it later if max transmission reached
|
||||
* (see below).
|
||||
* MAC does not send the max transmission count, we have to deal with it
|
||||
@@ -1433,10 +1429,10 @@ void pusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
|
||||
LOG_T(PHY,"\n");
|
||||
#endif
|
||||
#endif
|
||||
} // ulsch not in error
|
||||
} // ulsch not in error
|
||||
|
||||
if (ulsch_harq->O_ACK>0) fill_ulsch_harq_indication(eNB,ulsch_harq,ulsch->rnti,frame,subframe,ulsch->bundling);
|
||||
|
||||
|
||||
LOG_D(PHY,"[eNB %d] Frame %d subframe %d: received ULSCH harq_pid %d for UE %d, ret = %d, CQI CRC Status %d, ACK %d,%d, ulsch_errors %d/%d\n",
|
||||
eNB->Mod_id,frame,subframe,
|
||||
harq_pid,
|
||||
@@ -1910,6 +1906,7 @@ void fill_uci_harq_indication(PHY_VARS_eNB *eNB,
|
||||
if (uci->pucch_fmt == pucch_format1a) {
|
||||
pdu->harq_indication_tdd_rel13.tl.tag = NFAPI_HARQ_INDICATION_TDD_REL13_TAG;
|
||||
pdu->harq_indication_tdd_rel13.number_of_ack_nack = 1;
|
||||
LOG_D(PHY,"bundling, pucch1a, number of ack nack %d\n",pdu->harq_indication_tdd_rel13.number_of_ack_nack);
|
||||
AssertFatal(harq_ack[0] == 1 || harq_ack[0] == 2 || harq_ack[0] == 4, "harq_ack[0] is %d, should be 1,2 or 4\n",harq_ack[0]);
|
||||
pdu->harq_indication_tdd_rel13.harq_data[0].bundling.value_0 = harq_ack[0];
|
||||
// release all bundled DLSCH if needed
|
||||
|
||||
@@ -343,25 +343,27 @@ void feptx_ofdm(RU_t *ru) {
|
||||
}
|
||||
}
|
||||
*/
|
||||
if ((fp->frame_type == TDD) &&
|
||||
((fp->tdd_config==0) ||
|
||||
(fp->tdd_config==1) ||
|
||||
(fp->tdd_config==2) ||
|
||||
(fp->tdd_config==6)) &&
|
||||
((subframe==0) || (subframe==5))) {
|
||||
// turn on tx switch N_TA_offset before
|
||||
//LOG_D(HW,"subframe %d, time to switch to tx (N_TA_offset %d, slot_offset %d) \n",subframe,ru->N_TA_offset,slot_offset);
|
||||
for (i=0; i<ru->N_TA_offset; i++) {
|
||||
tx_offset = (int)slot_offset+i-ru->N_TA_offset/2;
|
||||
if (tx_offset<0)
|
||||
tx_offset += LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*fp->samples_per_tti;
|
||||
|
||||
if (tx_offset>=(LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*fp->samples_per_tti))
|
||||
tx_offset -= LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*fp->samples_per_tti;
|
||||
|
||||
ru->common.txdata[aa][tx_offset] = 0x00000000;
|
||||
}
|
||||
}
|
||||
|
||||
// if ((fp->frame_type == TDD) &&
|
||||
// ((fp->tdd_config==0) ||
|
||||
// (fp->tdd_config==1) ||
|
||||
// (fp->tdd_config==2) ||
|
||||
// (fp->tdd_config==6)) &&
|
||||
// ((subframe==0) || (subframe==5))) {
|
||||
// // turn on tx switch N_TA_offset before
|
||||
// //LOG_D(HW,"subframe %d, time to switch to tx (N_TA_offset %d, slot_offset %d) \n",subframe,ru->N_TA_offset,slot_offset);
|
||||
// for (i=0; i<ru->N_TA_offset; i++) {
|
||||
// tx_offset = (int)slot_offset+i-ru->N_TA_offset/2;
|
||||
// if (tx_offset<0)
|
||||
// tx_offset += LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*fp->samples_per_tti;
|
||||
//
|
||||
// if (tx_offset>=(LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*fp->samples_per_tti))
|
||||
// tx_offset -= LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*fp->samples_per_tti;
|
||||
//
|
||||
// ru->common.txdata[aa][tx_offset] = 0x00000000;
|
||||
// }
|
||||
// }
|
||||
|
||||
stop_meas(&ru->ofdm_mod_stats);
|
||||
LOG_D(PHY,"feptx_ofdm (TXPATH): frame %d, subframe %d: txp (time %p) %d dB, txp (freq) %d dB\n",
|
||||
ru->proc.frame_tx,subframe,txdata,dB_fixed(signal_energy((int32_t*)txdata,fp->samples_per_tti)),
|
||||
|
||||
@@ -1241,46 +1241,48 @@ void ulsch_common_procedures(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc, uint8_t empt
|
||||
if (empty_subframe)
|
||||
{
|
||||
//#if 1
|
||||
overflow = ulsch_start - 9*frame_parms->samples_per_tti;
|
||||
for (aa=0; aa<frame_parms->nb_antennas_tx; aa++) {
|
||||
|
||||
if (overflow > 0)
|
||||
{
|
||||
memset(&ue->common_vars.txdata[aa][ulsch_start],0,4*(frame_parms->samples_per_tti-overflow));
|
||||
memset(&ue->common_vars.txdata[aa][0],0,4*overflow);
|
||||
}
|
||||
else
|
||||
{
|
||||
memset(&ue->common_vars.txdata[aa][ulsch_start],0,4*frame_parms->samples_per_tti);
|
||||
}
|
||||
}
|
||||
/*#else
|
||||
overflow = ulsch_start - 9*frame_parms->samples_per_tti;
|
||||
for (aa=0; aa<frame_parms->nb_antennas_tx; aa++) {
|
||||
|
||||
if (overflow > 0)
|
||||
{
|
||||
memset(&ue->common_vars.txdata[aa][ulsch_start],0,4*(frame_parms->samples_per_tti-overflow));
|
||||
memset(&ue->common_vars.txdata[aa][0],0,4*overflow);
|
||||
}
|
||||
else
|
||||
{
|
||||
memset(&ue->common_vars.txdata[aa][ulsch_start],0,4*frame_parms->samples_per_tti);
|
||||
}
|
||||
for (k=ulsch_start; k<cmin(frame_parms->samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME,ulsch_start+frame_parms->samples_per_tti); k++) {
|
||||
((short*)ue->common_vars.txdata[aa])[2*k] = 0;
|
||||
((short*)ue->common_vars.txdata[aa])[2*k+1] = 0;
|
||||
}
|
||||
/*#else
|
||||
overflow = ulsch_start - 9*frame_parms->samples_per_tti;
|
||||
for (aa=0; aa<frame_parms->nb_antennas_tx; aa++) {
|
||||
for (k=ulsch_start; k<cmin(frame_parms->samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME,ulsch_start+frame_parms->samples_per_tti); k++) {
|
||||
((short*)ue->common_vars.txdata[aa])[2*k] = 0;
|
||||
((short*)ue->common_vars.txdata[aa])[2*k+1] = 0;
|
||||
}
|
||||
|
||||
for (k=0; k<overflow; k++) {
|
||||
((short*)ue->common_vars.txdata[aa])[2*k] = 0;
|
||||
((short*)ue->common_vars.txdata[aa])[2*k+1] = 0;
|
||||
}
|
||||
|
||||
for (k=0; k<overflow; k++) {
|
||||
((short*)ue->common_vars.txdata[aa])[2*k] = 0;
|
||||
((short*)ue->common_vars.txdata[aa])[2*k+1] = 0;
|
||||
}
|
||||
#endif*/
|
||||
return;
|
||||
}
|
||||
#endif*/
|
||||
return;
|
||||
}
|
||||
//#endif
|
||||
|
||||
// if ((frame_tx%100) == 0)
|
||||
LOG_D(PHY,"[UE %d] Frame %d, subframe %d: ulsch_start = %d (rxoff %d, HW TA %d, timing advance %d, TA_offset %d\n",
|
||||
ue->Mod_id,frame_tx,subframe_tx,
|
||||
ulsch_start,
|
||||
ue->rx_offset,
|
||||
ue->hw_timing_advance,
|
||||
ue->timing_advance,
|
||||
ue->N_TA_offset);
|
||||
|
||||
/*
|
||||
LOG_D(PHY,"[UE %d] Frame %d, subframe %d: ulsch_start = %d (rxoff %d, HW TA %d, timing advance %d, TA_offset %d, signal energy %d dB\n",
|
||||
ue->Mod_id,frame_tx,subframe_tx,
|
||||
ulsch_start,
|
||||
ue->rx_offset,
|
||||
ue->hw_timing_advance,
|
||||
ue->timing_advance,
|
||||
ue->N_TA_offset,
|
||||
dB_fixed(signal_energy(&ue->common_vars.txdataF[aa][subframe_tx*nsymb*frame_parms->ofdm_symbol_size],
|
||||
nsymb*frame_parms->ofdm_symbol_size)));
|
||||
*/
|
||||
|
||||
for (aa=0; aa<frame_parms->nb_antennas_tx; aa++) {
|
||||
if (frame_parms->Ncp == 1)
|
||||
@@ -1303,7 +1305,7 @@ void ulsch_common_procedures(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc, uint8_t empt
|
||||
#endif
|
||||
nsymb>>1,
|
||||
&ue->frame_parms);
|
||||
|
||||
|
||||
normal_prefix_mod(&ue->common_vars.txdataF[aa][((subframe_tx*nsymb)+(nsymb>>1))*frame_parms->ofdm_symbol_size],
|
||||
#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR)
|
||||
dummy_tx_buffer+(frame_parms->samples_per_tti>>1),
|
||||
@@ -1312,7 +1314,7 @@ void ulsch_common_procedures(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc, uint8_t empt
|
||||
#endif
|
||||
nsymb>>1,
|
||||
&ue->frame_parms);
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR)
|
||||
apply_7_5_kHz(ue,dummy_tx_buffer,0);
|
||||
@@ -1340,11 +1342,11 @@ void ulsch_common_procedures(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc, uint8_t empt
|
||||
// handle switch before 1st TX subframe, guarantee that the slot prior to transmission is switch on
|
||||
for (k=ulsch_start - (frame_parms->samples_per_tti>>1) ; k<ulsch_start ; k++) {
|
||||
if (k<0)
|
||||
ue->common_vars.txdata[aa][k+frame_parms->samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME] &= 0xFFFEFFFE;
|
||||
ue->common_vars.txdata[aa][k+frame_parms->samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME] &= 0xFFFEFFFE;
|
||||
else if (k>(frame_parms->samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME))
|
||||
ue->common_vars.txdata[aa][k-frame_parms->samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME] &= 0xFFFEFFFE;
|
||||
ue->common_vars.txdata[aa][k-frame_parms->samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME] &= 0xFFFEFFFE;
|
||||
else
|
||||
ue->common_vars.txdata[aa][k] &= 0xFFFEFFFE;
|
||||
ue->common_vars.txdata[aa][k] &= 0xFFFEFFFE;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
@@ -2177,29 +2179,29 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin
|
||||
case pucch_format1a:
|
||||
case pucch_format1b:
|
||||
{
|
||||
if (ue->mac_enabled == 1) {
|
||||
Po_PUCCH = pucch_power_cntl(ue,proc,subframe_tx,eNB_id,format);
|
||||
}
|
||||
else {
|
||||
Po_PUCCH = ue->tx_power_max_dBm;
|
||||
}
|
||||
ue->tx_power_dBm[subframe_tx] = Po_PUCCH;
|
||||
ue->tx_total_RE[subframe_tx] = 12;
|
||||
|
||||
if (ue->mac_enabled == 1) {
|
||||
Po_PUCCH = pucch_power_cntl(ue,proc,subframe_tx,eNB_id,format);
|
||||
}
|
||||
else {
|
||||
Po_PUCCH = ue->tx_power_max_dBm;
|
||||
}
|
||||
ue->tx_power_dBm[subframe_tx] = Po_PUCCH;
|
||||
ue->tx_total_RE[subframe_tx] = 12;
|
||||
|
||||
#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR)
|
||||
tx_amp = get_tx_amp(Po_PUCCH,
|
||||
ue->tx_power_max_dBm,
|
||||
ue->frame_parms.N_RB_UL,
|
||||
1);
|
||||
tx_amp = get_tx_amp(Po_PUCCH,
|
||||
ue->tx_power_max_dBm,
|
||||
ue->frame_parms.N_RB_UL,
|
||||
1);
|
||||
#else
|
||||
tx_amp = AMP;
|
||||
tx_amp = AMP;
|
||||
#endif
|
||||
#if T_TRACER
|
||||
T(T_UE_PHY_PUCCH_TX_POWER, T_INT(eNB_id), T_INT(frame_tx%1024), T_INT(subframe_tx),T_INT(ue->tx_power_dBm[subframe_tx]),
|
||||
T_INT(tx_amp),T_INT(ue->dlsch[ue->current_thread_id[proc->subframe_rx]][eNB_id][0]->g_pucch),T_INT(get_PL(ue->Mod_id,ue->CC_id,eNB_id)));
|
||||
T(T_UE_PHY_PUCCH_TX_POWER, T_INT(eNB_id), T_INT(frame_tx%1024), T_INT(subframe_tx),T_INT(ue->tx_power_dBm[subframe_tx]),
|
||||
T_INT(tx_amp),T_INT(ue->dlsch[ue->current_thread_id[proc->subframe_rx]][eNB_id][0]->g_pucch),T_INT(get_PL(ue->Mod_id,ue->CC_id,eNB_id)));
|
||||
#endif
|
||||
|
||||
#ifdef UE_DEBUG_TRACE
|
||||
|
||||
//#ifdef UE_DEBUG_TRACE
|
||||
if(format == pucch_format1)
|
||||
{
|
||||
LOG_D(PHY,"[UE %d][SR %x] AbsSubframe %d.%d Generating PUCCH 1 (SR for PUSCH), an_srs_simultanous %d, shorten_pucch %d, n1_pucch %d, Po_PUCCH %d\n",
|
||||
@@ -2240,7 +2242,7 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin
|
||||
tx_amp);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
//#endif
|
||||
|
||||
#if T_TRACER
|
||||
if(pucch_payload[0])
|
||||
@@ -2392,30 +2394,32 @@ void phy_procedures_UE_TX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,ui
|
||||
frame_parms->ofdm_symbol_size*frame_parms->symbols_per_tti*sizeof(int32_t));
|
||||
}
|
||||
|
||||
if (subframe_select(&ue->frame_parms,proc->subframe_tx) == SF_UL ||
|
||||
ue->frame_parms.frame_type == FDD) {
|
||||
if (ue->UE_mode[eNB_id] != PRACH ) {
|
||||
// check cell srs subframe and ue srs subframe. This has an impact on pusch encoding
|
||||
isSubframeSRS = is_srs_occasion_common(&ue->frame_parms,proc->frame_tx,proc->subframe_tx);
|
||||
|
||||
if (ue->UE_mode[eNB_id] != PRACH) {
|
||||
// check cell srs subframe and ue srs subframe. This has an impact on pusch encoding
|
||||
isSubframeSRS = is_srs_occasion_common(&ue->frame_parms,proc->frame_tx,proc->subframe_tx);
|
||||
|
||||
ue_compute_srs_occasion(ue,proc,eNB_id,isSubframeSRS);
|
||||
|
||||
ue_ulsch_uespec_procedures(ue,proc,eNB_id,abstraction_flag);
|
||||
|
||||
LOG_D(PHY,"ULPOWERS After ulsch_uespec_procedures : ue->tx_power_dBm[%d]=%d, NPRB %d\n",
|
||||
subframe_tx,ue->tx_power_dBm[subframe_tx],ue->tx_total_RE[subframe_tx]);
|
||||
}
|
||||
|
||||
if (ue->UE_mode[eNB_id] == PUSCH) {
|
||||
ue_compute_srs_occasion(ue,proc,eNB_id,isSubframeSRS);
|
||||
|
||||
ue_ulsch_uespec_procedures(ue,proc,eNB_id,abstraction_flag);
|
||||
|
||||
LOG_D(PHY,"ULPOWERS After ulsch_uespec_procedures : ue->tx_power_dBm[%d]=%d, NPRB %d\n",
|
||||
subframe_tx,ue->tx_power_dBm[subframe_tx],ue->tx_total_RE[subframe_tx]);
|
||||
}
|
||||
|
||||
if (ue->UE_mode[eNB_id] == PUSCH) {
|
||||
// check if we need to use PUCCH 1a/1b
|
||||
ue_pucch_procedures(ue,proc,eNB_id,abstraction_flag);
|
||||
// check if we need to use SRS
|
||||
ue_srs_procedures(ue,proc,eNB_id,abstraction_flag);
|
||||
} // UE_mode==PUSCH
|
||||
} // UE_mode==PUSCH
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
LOG_D(PHY,"doing ulsch_common_procedures (%d.%d): generate_ul_signal %d\n",frame_tx,subframe_tx,
|
||||
ue->generate_ul_signal[eNB_id]);
|
||||
ulsch_common_procedures(ue,proc, (ue->generate_ul_signal[eNB_id] == 0));
|
||||
|
||||
if ((ue->UE_mode[eNB_id] == PRACH) &&
|
||||
@@ -2491,8 +2495,8 @@ void phy_procedures_UE_S_TX(PHY_VARS_UE *ue,uint8_t eNB_id,uint8_t abstraction_f
|
||||
ue->common_vars.txdata[aa][i] = 0x00010001;
|
||||
|
||||
#else //this is the normal case
|
||||
memset(&ue->common_vars.txdata[aa][0],0,
|
||||
(LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*frame_parms->samples_per_tti)*sizeof(int32_t));
|
||||
// memset(&ue->common_vars.txdata[aa][0],0,
|
||||
// (LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*frame_parms->samples_per_tti)*sizeof(int32_t));
|
||||
#endif //else EXMIMO
|
||||
|
||||
}
|
||||
@@ -2665,6 +2669,9 @@ void ue_pbch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc, uin
|
||||
ue->UE_mode[eNB_id]==NOT_SYNCHED ? 1 : 0);
|
||||
}
|
||||
|
||||
// if this is the first PBCH after initial synchronization, make L1 state = PRACH
|
||||
if (ue->UE_mode[eNB_id]==NOT_SYNCHED) ue->UE_mode[eNB_id] = PRACH;
|
||||
|
||||
if (first_run) {
|
||||
first_run = 0;
|
||||
|
||||
@@ -2786,6 +2793,7 @@ int ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint
|
||||
uint8_t next1_thread_id = ue->current_thread_id[subframe_rx]== (RX_NB_TH-1) ? 0:(ue->current_thread_id[subframe_rx]+1);
|
||||
uint8_t next2_thread_id = next1_thread_id== (RX_NB_TH-1) ? 0:(next1_thread_id+1);
|
||||
|
||||
LOG_D(PHY,"DCI Decoding procedure in %d.%d\n",frame_rx,subframe_rx);
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_PDCCH_PROCEDURES, VCD_FUNCTION_IN);
|
||||
#if UE_TIMING_TRACE
|
||||
start_meas(&ue->dlsch_rx_pdcch_stats);
|
||||
@@ -5228,7 +5236,7 @@ void phy_procedures_UE_lte(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,u
|
||||
}
|
||||
|
||||
if ((subframe_select(&ue->frame_parms,subframe_tx)==SF_S) &&
|
||||
(slot==1)) {
|
||||
(slot==1)) {
|
||||
phy_procedures_UE_S_TX(ue,eNB_id,abstraction_flag);
|
||||
}
|
||||
|
||||
|
||||
@@ -114,7 +114,7 @@ void pusch_power_cntl(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uint8_
|
||||
else if (ue->ulsch[eNB_id]->PHR > 40)
|
||||
ue->ulsch[eNB_id]->PHR = 40;
|
||||
|
||||
LOG_D(PHY,"[UE %d][PUSCH %d] AbsSubframe %d.%d: nb_rb: %d, Po_PUSCH %d dBm : tx power %d, Po_NOMINAL_PUSCH %d,log10(NPRB) %f,PHR %d, PL %d, alpha*PL %f,delta_IF %f,f_pusch %d\n",
|
||||
LOG_D(PHY,"[UE %d][PUSCH %d] AbsSubframe %d.%d: nb_rb: %d, Po_PUSCH %d dBm : tx power max %d , Po_NOMINAL_PUSCH %d,log10(NPRB) %f,PHR %d, PL %d, alpha*PL %f,delta_IF %f,f_pusch %d\n",
|
||||
ue->Mod_id,harq_pid,proc->frame_tx,proc->subframe_tx,nb_rb,
|
||||
ue->ulsch[eNB_id]->Po_PUSCH,
|
||||
ue->tx_power_max_dBm,
|
||||
|
||||
@@ -99,7 +99,7 @@ multicast_link_init(void)
|
||||
SOCK_DGRAM,
|
||||
&group_list[group].port, &sin);
|
||||
|
||||
LOG_D(EMU, "multicast_link_init(): Created socket %d for group %d, port %d\n",
|
||||
LOG_D(PHY, "multicast_link_init(): Created socket %d for group %d, port %d\n",
|
||||
group_list[group].socket,group,group_list[group].port);
|
||||
|
||||
/* Used so we can re-bind to our port while a previous connection is still
|
||||
@@ -107,17 +107,17 @@ multicast_link_init(void)
|
||||
*/
|
||||
if (setsockopt(group_list[group].socket, SOL_SOCKET, SO_REUSEADDR,
|
||||
&reuse_addr, sizeof (reuse_addr)) < 0) {
|
||||
LOG_E(EMU, "[MULTICAST] ERROR : setsockopt:SO_REUSEADDR, exiting ...");
|
||||
LOG_E(PHY, "[MULTICAST] ERROR : setsockopt:SO_REUSEADDR, exiting ...");
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
|
||||
if (multicast_if != NULL) {
|
||||
if (setsockopt(group_list[group].socket, SOL_SOCKET,SO_BINDTODEVICE,
|
||||
multicast_if, strlen(multicast_if)) < 0) {
|
||||
LOG_E(EMU,
|
||||
LOG_E(PHY,
|
||||
"[MULTICAST] ERROR : setsockopt:SO_BINDTODEVICE on interface %s, exiting ...\n",
|
||||
multicast_if);
|
||||
LOG_E(EMU,
|
||||
LOG_E(PHY,
|
||||
"[MULTICAST] make sure that you have a root privilage or run with sudo -E \n");
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
@@ -132,7 +132,7 @@ multicast_link_init(void)
|
||||
|
||||
if (setsockopt (group_list[group].socket, IPPROTO_IP, IP_MULTICAST_LOOP,
|
||||
&multicast_loop, sizeof (multicast_loop)) < 0) {
|
||||
LOG_E(EMU,
|
||||
LOG_E(PHY,
|
||||
"[MULTICAST] ERROR: %s line %d multicast_link_main_loop() IP_MULTICAST_LOOP %m",
|
||||
__FILE__, __LINE__);
|
||||
exit (EXIT_FAILURE);
|
||||
@@ -143,13 +143,13 @@ multicast_link_init(void)
|
||||
command.imr_interface.s_addr = htonl (INADDR_ANY);
|
||||
|
||||
if (command.imr_multiaddr.s_addr == -1) {
|
||||
LOG_E(EMU, "[MULTICAST] ERROR: %s line %d NO MULTICAST", __FILE__, __LINE__);
|
||||
LOG_E(PHY, "[MULTICAST] ERROR: %s line %d NO MULTICAST", __FILE__, __LINE__);
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
|
||||
if (setsockopt (group_list[group].socket, IPPROTO_IP, IP_ADD_MEMBERSHIP,
|
||||
&command, sizeof (command)) < 0) {
|
||||
LOG_E(EMU, "[MULTICAST] ERROR: %s line %d IP_ADD_MEMBERSHIP %m", __FILE__,
|
||||
LOG_E(PHY, "[MULTICAST] ERROR: %s line %d IP_ADD_MEMBERSHIP %m", __FILE__,
|
||||
__LINE__);
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
@@ -202,13 +202,13 @@ multicast_link_read_data (int groupP)
|
||||
if ((groupP < MULTICAST_LINK_NUM_GROUPS) && (groupP >= 0)) {
|
||||
if ((num_bytes = recvfrom (group_list[groupP].socket,
|
||||
group_list[groupP].rx_buffer, 40000, 0, 0, 0)) < 0) {
|
||||
LOG_E(EMU, "[MULTICAST] recvfrom has failed (%d:%s)\n (%s:%d)\n",
|
||||
LOG_E(PHY, "[MULTICAST] recvfrom has failed (%d:%s)\n (%s:%d)\n",
|
||||
errno, strerror(errno), __FILE__, __LINE__);
|
||||
} else {
|
||||
rx_handler(num_bytes,group_list[groupP].rx_buffer);
|
||||
}
|
||||
} else {
|
||||
LOG_E(EMU, "[MULTICAST] ERROR: groupP out of bounds %d\n", groupP);
|
||||
LOG_E(PHY, "[MULTICAST] ERROR: groupP out of bounds %d\n", groupP);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -242,7 +242,7 @@ multicast_link_write_sock(int groupP, char *dataP, uint32_t sizeP)
|
||||
if ((num = sendto (group_list[groupP].socket, dataP, sizeP, 0,
|
||||
(struct sockaddr *) &group_list[groupP].sock_remote_addr,
|
||||
sizeof (group_list[groupP].sock_remote_addr))) < 0) {
|
||||
LOG_E(EMU, "[MULTICAST] sendto has failed (%d:%s)\n (%s:%d)\n",
|
||||
LOG_E(PHY, "[MULTICAST] sendto has failed (%d:%s)\n (%s:%d)\n",
|
||||
errno, strerror(errno),
|
||||
__FILE__, __LINE__);
|
||||
}
|
||||
@@ -274,22 +274,19 @@ int multicast_link_read_data_from_sock(uint8_t is_master)
|
||||
|
||||
multicast_link_build_select_list ();
|
||||
|
||||
LOG_D(EMU, "Stuck on select with timeout %s\n",
|
||||
LOG_D(PHY, "Stuck on select with timeout %s\n",
|
||||
timeout_p == NULL ? "infinite" : "15000 usecs");
|
||||
|
||||
readsocks = select(highsock + 1, &socks, (fd_set *) 0, (fd_set *) 0, timeout_p);
|
||||
|
||||
if (readsocks < 0) {
|
||||
LOG_E(EMU, "Multicast select failed (%d:%s)\n", errno, strerror(errno));
|
||||
LOG_E(PHY, "Multicast select failed (%d:%s)\n", errno, strerror(errno));
|
||||
exit(EXIT_FAILURE);
|
||||
} else if (readsocks > 0) {
|
||||
#ifdef DEBUG_EMU
|
||||
LOG_D(EMU, "Multicast Normal read\n");
|
||||
#endif
|
||||
multicast_link_read();
|
||||
} else {
|
||||
/* Timeout */
|
||||
LOG_I(EMU, "Multicast select time-out\n");
|
||||
LOG_I(PHY, "Multicast select time-out\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -311,21 +308,21 @@ void multicast_link_start(void (*rx_handlerP) (unsigned int, char *),
|
||||
rx_handler = rx_handlerP;
|
||||
multicast_group = _multicast_group;
|
||||
multicast_if = multicast_ifname;
|
||||
LOG_I(EMU, "[MULTICAST] LINK START on interface=%s for group=%d: handler=%p\n",
|
||||
LOG_I(PHY, "[MULTICAST] LINK START on interface=%s for group=%d: handler=%p\n",
|
||||
(multicast_if == NULL) ? "not specified" : multicast_if, multicast_group,
|
||||
rx_handler);
|
||||
multicast_link_init ();
|
||||
#if ! defined(ENABLE_NEW_MULTICAST)
|
||||
LOG_D(EMU, "[MULTICAST] multicast link start thread\n");
|
||||
LOG_D(PHY, "[MULTICAST] multicast link start thread\n");
|
||||
|
||||
if (pthread_create (&main_loop_thread, NULL, multicast_link_main_loop,
|
||||
NULL) != 0) {
|
||||
LOG_E(EMU, "[MULTICAST LINK] Error in pthread_create (%d:%s)\n",
|
||||
LOG_E(PHY, "[MULTICAST LINK] Error in pthread_create (%d:%s)\n",
|
||||
errno, strerror(errno));
|
||||
exit(EXIT_FAILURE);
|
||||
} else {
|
||||
pthread_detach(main_loop_thread); // disassociate from parent
|
||||
LOG_I(EMU, "[MULTICAST LINK] Thread detached\n");
|
||||
LOG_I(PHY, "[MULTICAST LINK] Thread detached\n");
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -521,6 +521,7 @@ int main(int argc, char **argv)
|
||||
int k,i,j,aa;
|
||||
int re;
|
||||
|
||||
|
||||
int s,Kr,Kr_bytes;
|
||||
|
||||
double SNR,snr0=-2.0,snr1,rate = 0;
|
||||
@@ -1137,10 +1138,10 @@ int main(int argc, char **argv)
|
||||
}
|
||||
else {
|
||||
eNB->te = dlsch_encoding_2threads;
|
||||
extern void init_td_thread(PHY_VARS_eNB *, pthread_attr_t *);
|
||||
extern void init_te_thread(PHY_VARS_eNB *, pthread_attr_t *);
|
||||
init_td_thread(eNB,NULL);
|
||||
init_te_thread(eNB,NULL);
|
||||
extern void init_td_thread(PHY_VARS_eNB *);
|
||||
extern void init_te_thread(PHY_VARS_eNB *);
|
||||
init_td_thread(eNB);
|
||||
init_te_thread(eNB);
|
||||
}
|
||||
|
||||
// callback functions required for phy_procedures_tx
|
||||
@@ -1306,7 +1307,9 @@ int main(int argc, char **argv)
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
UE->pdcch_vars[UE->current_thread_id[subframe]][0]->crnti = n_rnti;
|
||||
UE->n_connected_eNB = 1;
|
||||
|
||||
printf("Allocating %dx%d eNB->UE channel descriptor\n",eNB->frame_parms.nb_antennas_tx,UE->frame_parms.nb_antennas_rx);
|
||||
eNB2UE[0] = new_channel_desc_scm(eNB->frame_parms.nb_antennas_tx,
|
||||
@@ -1318,8 +1321,10 @@ int main(int argc, char **argv)
|
||||
rx_sample_offset,
|
||||
0);
|
||||
|
||||
reset_meas(&eNB2UE[0]->random_channel);
|
||||
reset_meas(&eNB2UE[0]->interp_time);
|
||||
if(num_rounds>1) {
|
||||
for(n=1; n<4; n++)
|
||||
for(n=1; n<4; n++) {
|
||||
eNB2UE[n] = new_channel_desc_scm(eNB->frame_parms.nb_antennas_tx,
|
||||
UE->frame_parms.nb_antennas_rx,
|
||||
channel_model,
|
||||
@@ -1328,8 +1333,11 @@ int main(int argc, char **argv)
|
||||
forgetting_factor,
|
||||
rx_sample_offset,
|
||||
0);
|
||||
reset_meas(&eNB2UE[n]->random_channel);
|
||||
reset_meas(&eNB2UE[n]->interp_time);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (eNB2UE[0]==NULL) {
|
||||
printf("Problem generating channel model. Exiting.\n");
|
||||
exit(-1);
|
||||
|
||||
@@ -126,7 +126,6 @@ fill_nfapi_ulsch_config_request(nfapi_ul_config_request_pdu_t *ul_config_pdu,
|
||||
{
|
||||
memset((void *) ul_config_pdu, 0, sizeof(nfapi_ul_config_request_pdu_t));
|
||||
|
||||
// printf("filling ul_config_pdu: modulation type %d, rvidx %d\n",modulation_type,redundancy_version);
|
||||
|
||||
ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_ULSCH_PDU_TYPE;
|
||||
ul_config_pdu->pdu_size = (uint8_t) (2 + sizeof(nfapi_ul_config_ulsch_pdu));
|
||||
@@ -147,6 +146,8 @@ fill_nfapi_ulsch_config_request(nfapi_ul_config_request_pdu_t *ul_config_pdu,
|
||||
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.n_srs = n_srs;
|
||||
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.size = size;
|
||||
|
||||
//printf("Filling ul_config_pdu : Q %d, TBS %d, rv %d, ndi %d\n", modulation_type,size,redundancy_version,new_data_indication);
|
||||
|
||||
if (cqi_req == 1) {
|
||||
// Add CQI portion
|
||||
ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_ULSCH_CQI_RI_PDU_TYPE;
|
||||
@@ -183,6 +184,7 @@ void fill_ulsch_dci(PHY_VARS_eNB *eNB,
|
||||
int mcs,
|
||||
int modulation_type,
|
||||
int ndi,
|
||||
int TBS,
|
||||
int cqi_flag,
|
||||
uint8_t beta_CQI,
|
||||
uint8_t beta_RI,
|
||||
@@ -191,7 +193,7 @@ void fill_ulsch_dci(PHY_VARS_eNB *eNB,
|
||||
nfapi_ul_config_request_body_t *ul_req=&sched_resp->UL_req->ul_config_request_body;
|
||||
int harq_pid = ((frame*10)+subframe)&7;
|
||||
|
||||
// printf("ulsch in frame %d, subframe %d => harq_pid %d, mcs %d, ndi %d\n",frame,subframe,harq_pid,mcs,ndi);
|
||||
//printf("ulsch in frame %d, subframe %d => harq_pid %d, mcs %d, ndi %d\n",frame,subframe,harq_pid,mcs,ndi);
|
||||
|
||||
switch (eNB->frame_parms.N_RB_UL) {
|
||||
case 6:
|
||||
@@ -297,7 +299,7 @@ void fill_ulsch_dci(PHY_VARS_eNB *eNB,
|
||||
0, // ul_tx_mode
|
||||
0, // current_tx_nb
|
||||
0, // n_srs
|
||||
get_TBS_UL(mcs,nb_rb));
|
||||
TBS);
|
||||
|
||||
sched_resp->UL_req->header.message_id = NFAPI_UL_CONFIG_REQUEST;
|
||||
ul_req->number_of_pdus=1;
|
||||
@@ -446,14 +448,14 @@ int main(int argc, char **argv)
|
||||
"cannot load configuration module, exiting\n");
|
||||
|
||||
logInit();
|
||||
/*
|
||||
|
||||
// enable these lines if you need debug info
|
||||
// however itti will catch all signals, so ctrl-c won't work anymore
|
||||
// alternatively you can disable ITTI completely in CMakeLists.txt
|
||||
itti_init(TASK_MAX, THREAD_MAX, MESSAGES_ID_MAX, tasks_info, messages_info, messages_definition_xml, NULL);
|
||||
set_comp_log(PHY,LOG_DEBUG,LOG_MED,1);
|
||||
set_glog(LOG_DEBUG,LOG_MED);
|
||||
*/
|
||||
//itti_init(TASK_MAX, THREAD_MAX, MESSAGES_ID_MAX, tasks_info, messages_info, messages_definition_xml, NULL);
|
||||
//set_comp_log(PHY,LOG_DEBUG,LOG_MED,1);
|
||||
//set_glog(LOG_DEBUG,LOG_MED);
|
||||
|
||||
|
||||
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) {
|
||||
@@ -887,9 +889,9 @@ int main(int argc, char **argv)
|
||||
|
||||
if (parallel_flag == 1) {
|
||||
extern void init_fep_thread(PHY_VARS_eNB *, pthread_attr_t *);
|
||||
extern void init_td_thread(PHY_VARS_eNB *, pthread_attr_t *);
|
||||
extern void init_td_thread(PHY_VARS_eNB *);
|
||||
init_fep_thread(eNB,NULL);
|
||||
init_td_thread(eNB,NULL);
|
||||
init_td_thread(eNB);
|
||||
}
|
||||
// Create transport channel structures for 2 transport blocks (MIMO)
|
||||
for (i=0; i<2; i++) {
|
||||
@@ -1142,7 +1144,7 @@ int main(int argc, char **argv)
|
||||
else if (mcs < 21) modulation_type = 4;
|
||||
else if (mcs < 29) modulation_type = 6;
|
||||
|
||||
fill_ulsch_dci(eNB,proc_rxtx->frame_rx,subframe,&sched_resp,14,(void*)&UL_alloc_pdu,first_rb,nb_rb,(round==0)?mcs:(28+rvidx[round]),modulation_type,ndi,cqi_flag,beta_CQI,beta_RI,cqi_size);
|
||||
fill_ulsch_dci(eNB,proc_rxtx->frame_rx,subframe,&sched_resp,14,(void*)&UL_alloc_pdu,first_rb,nb_rb,(round==0)?mcs:(28+rvidx[round]),modulation_type,ndi,get_TBS_UL(mcs,nb_rb),cqi_flag,beta_CQI,beta_RI,cqi_size);
|
||||
|
||||
UE->ulsch_Msg3_active[eNB_id] = 0;
|
||||
UE->ul_power_control_dedicated[eNB_id].accumulationEnabled=1;
|
||||
@@ -1324,7 +1326,6 @@ int main(int argc, char **argv)
|
||||
ru->feprx(ru);
|
||||
phy_procedures_eNB_uespec_RX(eNB,proc_rxtx);
|
||||
|
||||
|
||||
if (cqi_flag > 0) {
|
||||
cqi_error = 0;
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
*/
|
||||
|
||||
openair0_device openair0;
|
||||
int oai_exit=0;
|
||||
volatile int oai_exit=0;
|
||||
|
||||
void exit_fun(const char *s) { exit(-1); }
|
||||
|
||||
|
||||
@@ -38,12 +38,7 @@ void adc(double *r_re[2],
|
||||
for (aa=0; aa<nb_rx_antennas; aa++) {
|
||||
((short *)output[aa])[((i+output_offset)<<1)] = (short)(r_re[aa][i+input_offset]*gain);
|
||||
((short *)output[aa])[1+((i+output_offset)<<1)] = (short)(r_im[aa][i+input_offset]*gain);
|
||||
|
||||
if ((r_re[aa][i+input_offset]*gain) > 30000) {
|
||||
//("Adc outputs %d %e %d \n",i,((short *)output[0])[((i+output_offset)<<1)], ((i+output_offset)<<1) );
|
||||
}
|
||||
}
|
||||
|
||||
//printf("Adc outputs %d %e %d \n",i,((short *)output[0])[((i+output_offset)<<1)], ((i+output_offset)<<1) );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
#include "rf.h"
|
||||
void dac(double *s_re[2],
|
||||
double *s_im[2],
|
||||
uint32_t **input,
|
||||
int32_t **input,
|
||||
uint32_t input_offset,
|
||||
uint32_t nb_tx_antennas,
|
||||
uint32_t length,
|
||||
@@ -76,7 +76,7 @@ void dac(double *s_re[2],
|
||||
|
||||
double dac_fixed_gain(double *s_re[2],
|
||||
double *s_im[2],
|
||||
uint32_t **input,
|
||||
int32_t **input,
|
||||
uint32_t input_offset,
|
||||
uint32_t nb_tx_antennas,
|
||||
uint32_t length,
|
||||
|
||||
@@ -69,14 +69,14 @@ void adc(double *r_re[2],
|
||||
double *r_im[2],
|
||||
unsigned int input_offset,
|
||||
unsigned int output_offset,
|
||||
int **output,
|
||||
int32_t **output,
|
||||
unsigned int nb_rx_antennas,
|
||||
unsigned int length,
|
||||
unsigned char B);
|
||||
|
||||
void dac(double *s_re[2],
|
||||
double *s_im[2],
|
||||
unsigned int **input,
|
||||
int32_t **input,
|
||||
unsigned int input_offset,
|
||||
unsigned int nb_tx_antennas,
|
||||
unsigned int length,
|
||||
@@ -87,7 +87,7 @@ void dac(double *s_re[2],
|
||||
|
||||
double dac_fixed_gain(double *s_re[2],
|
||||
double *s_im[2],
|
||||
unsigned int **input,
|
||||
int32_t **input,
|
||||
unsigned int input_offset,
|
||||
unsigned int nb_tx_antennas,
|
||||
unsigned int length,
|
||||
|
||||
@@ -0,0 +1,487 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
#include <unistd.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <time.h>
|
||||
|
||||
#include "SIMULATION/TOOLS/sim.h"
|
||||
#include "SIMULATION/RF/rf.h"
|
||||
#include "PHY/types.h"
|
||||
#include "PHY/defs_eNB.h"
|
||||
#include "PHY/phy_extern.h"
|
||||
#include "PHY/phy_extern_ue.h"
|
||||
|
||||
#include "LAYER2/MAC/mac.h"
|
||||
#include "LAYER2/MAC/mac_extern.h"
|
||||
#include "UTIL/LOG/log_if.h"
|
||||
#include "UTIL/LOG/log_extern.h"
|
||||
#include "RRC/LTE/rrc_extern.h"
|
||||
#include "PHY_INTERFACE/phy_interface_extern.h"
|
||||
#include "UTIL/OCG/OCG.h"
|
||||
#include "UTIL/OPT/opt.h" // to test OPT
|
||||
|
||||
#include "UTIL/FIFO/types.h"
|
||||
|
||||
#define RF
|
||||
//#define DEBUG_SIM
|
||||
|
||||
//#undef LOG_D
|
||||
//#define LOG_D(A,B,C...) printf(B,C)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void do_DL_sig(sim_t *sim,
|
||||
uint16_t subframe,
|
||||
uint32_t offset,
|
||||
uint32_t length,
|
||||
uint8_t abstraction_flag,LTE_DL_FRAME_PARMS *ue_frame_parms,
|
||||
uint8_t UE_id,
|
||||
int CC_id)
|
||||
{
|
||||
|
||||
int32_t **txdata,**rxdata;
|
||||
|
||||
uint32_t ru_id=0;
|
||||
double tx_pwr;
|
||||
double rx_pwr;
|
||||
int32_t rx_pwr2;
|
||||
uint32_t i,aa;
|
||||
uint32_t sf_offset;
|
||||
|
||||
uint8_t hold_channel=0;
|
||||
uint8_t nb_antennas_rx = sim->RU2UE[0][0][CC_id]->nb_rx; // number of rx antennas at UE
|
||||
uint8_t nb_antennas_tx = sim->RU2UE[0][0][CC_id]->nb_tx; // number of tx antennas at eNB
|
||||
|
||||
double s_re0[30720];
|
||||
double s_re1[30720];
|
||||
double *s_re[2];
|
||||
double s_im0[30720];
|
||||
double s_im1[30720];
|
||||
double *s_im[2];
|
||||
double r_re00[30720];
|
||||
double r_re01[30720];
|
||||
double *r_re0[2];
|
||||
double r_im00[30720];
|
||||
double r_im01[30720];
|
||||
double *r_im0[2];
|
||||
LTE_DL_FRAME_PARMS *frame_parms;
|
||||
|
||||
s_re[0] = s_re0;
|
||||
s_im[0] = s_im0;
|
||||
s_re[1] = s_re1;
|
||||
s_im[1] = s_im1;
|
||||
|
||||
r_re0[0] = r_re00;
|
||||
r_im0[0] = r_im00;
|
||||
r_re0[1] = r_re01;
|
||||
r_im0[1] = r_im01;
|
||||
|
||||
if (subframe==0)
|
||||
hold_channel = 0;
|
||||
else
|
||||
hold_channel = 1;
|
||||
|
||||
pthread_mutex_lock(&sim->RU_output_mutex[UE_id]);
|
||||
|
||||
if (sim->RU_output_mask[UE_id] == 0) { // This is the first eNodeB for this UE, clear the buffer
|
||||
for (aa=0; aa<nb_antennas_rx; aa++) {
|
||||
memset((void*)sim->r_re_DL[UE_id][aa],0,(RC.ru[0]->frame_parms.samples_per_tti)*sizeof(double));
|
||||
memset((void*)sim->r_im_DL[UE_id][aa],0,(RC.ru[0]->frame_parms.samples_per_tti)*sizeof(double));
|
||||
}
|
||||
}
|
||||
pthread_mutex_unlock(&sim->RU_output_mutex[UE_id]);
|
||||
|
||||
for (ru_id=0; ru_id<RC.nb_RU; ru_id++) {
|
||||
txdata = RC.ru[ru_id]->common.txdata;
|
||||
frame_parms = &RC.ru[ru_id]->frame_parms;
|
||||
|
||||
// sf_offset = (subframe*frame_parms->samples_per_tti) + offset;
|
||||
sf_offset = (subframe*frame_parms->samples_per_tti);
|
||||
LOG_D(OCM,">>>>>>>>>>>>>>>>>TXPATH: RU %d : DL_sig reading TX for subframe %d (sf_offset %d, length %d) from %p\n",ru_id,subframe,sf_offset,length,txdata[0]+sf_offset);
|
||||
int length_meas = frame_parms->ofdm_symbol_size;
|
||||
if (sf_offset+length <= frame_parms->samples_per_tti*10) {
|
||||
|
||||
tx_pwr = dac_fixed_gain(s_re,
|
||||
s_im,
|
||||
txdata,
|
||||
sf_offset+offset,
|
||||
nb_antennas_tx,
|
||||
length,
|
||||
sf_offset,
|
||||
length_meas,
|
||||
14,
|
||||
frame_parms->pdsch_config_common.referenceSignalPower, // dBm/RE
|
||||
0,
|
||||
&sim->ru_amp[ru_id],
|
||||
frame_parms->N_RB_DL*12);
|
||||
|
||||
}
|
||||
else {
|
||||
tx_pwr = dac_fixed_gain(s_re,
|
||||
s_im,
|
||||
txdata,
|
||||
sf_offset,
|
||||
nb_antennas_tx,
|
||||
(frame_parms->samples_per_tti*10)-sf_offset,
|
||||
sf_offset,
|
||||
length_meas,
|
||||
14,
|
||||
frame_parms->pdsch_config_common.referenceSignalPower, // dBm/RE
|
||||
0,
|
||||
&sim->ru_amp[ru_id],
|
||||
frame_parms->N_RB_DL*12);
|
||||
|
||||
tx_pwr = dac_fixed_gain(s_re,
|
||||
s_im,
|
||||
txdata,
|
||||
sf_offset,
|
||||
nb_antennas_tx,
|
||||
length+sf_offset-(frame_parms->samples_per_tti*10),
|
||||
sf_offset,
|
||||
length_meas,
|
||||
14,
|
||||
frame_parms->pdsch_config_common.referenceSignalPower, // dBm/RE
|
||||
0,
|
||||
&sim->ru_amp[ru_id],
|
||||
frame_parms->N_RB_DL*12);
|
||||
}
|
||||
#ifdef DEBUG_SIM
|
||||
LOG_D(OCM,"[SIM][DL] subframe %d: txp (time) %d dB\n",
|
||||
subframe,dB_fixed(signal_energy(&txdata[0][sf_offset],length_meas)));
|
||||
|
||||
LOG_D(OCM,"[SIM][DL] RU %d (CCid %d): tx_pwr %.1f dBm/RE (target %d dBm/RE), for subframe %d\n",
|
||||
ru_id,CC_id,
|
||||
10*log10(tx_pwr),
|
||||
frame_parms->pdsch_config_common.referenceSignalPower,
|
||||
subframe);
|
||||
|
||||
#endif
|
||||
tx_pwr = signal_energy_fp(s_re,s_im,nb_antennas_tx,
|
||||
length<length_meas?length:length_meas,
|
||||
0)/(12.0*frame_parms->N_RB_DL);
|
||||
|
||||
//RU2UE[eNB_id][UE_id]->path_loss_dB = 0;
|
||||
multipath_channel(sim->RU2UE[ru_id][UE_id][CC_id],s_re,s_im,r_re0,r_im0,
|
||||
length,hold_channel);
|
||||
#ifdef DEBUG_SIM
|
||||
rx_pwr = signal_energy_fp2(sim->RU2UE[ru_id][UE_id][CC_id]->ch[0],
|
||||
sim->RU2UE[ru_id][UE_id][CC_id]->channel_length)*sim->RU2UE[ru_id][UE_id][CC_id]->channel_length;
|
||||
LOG_D(OCM,"[SIM][DL] Channel RU %d => UE %d (CCid %d): Channel gain %f dB (%f)\n",ru_id,UE_id,CC_id,10*log10(rx_pwr),rx_pwr);
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef DEBUG_SIM
|
||||
|
||||
for (i=0; i<sim->RU2UE[ru_id][UE_id][CC_id]->channel_length; i++)
|
||||
LOG_D(OCM,"channel(%d,%d)[%d] : (%f,%f)\n",ru_id,UE_id,i,sim->RU2UE[ru_id][UE_id][CC_id]->ch[0][i].x,sim->RU2UE[ru_id][UE_id][CC_id]->ch[0][i].y);
|
||||
|
||||
#endif
|
||||
|
||||
LOG_D(OCM,"[SIM][DL] Channel RU %d => UE %d (CCid %d): tx_power %.1f dBm/RE, path_loss %1.f dB\n",
|
||||
ru_id,UE_id,CC_id,
|
||||
(double)frame_parms->pdsch_config_common.referenceSignalPower,
|
||||
sim->RU2UE[ru_id][UE_id][CC_id]->path_loss_dB);
|
||||
|
||||
#ifdef DEBUG_SIM
|
||||
rx_pwr = signal_energy_fp(r_re0,r_im0,nb_antennas_rx,
|
||||
length<length_meas?length:length_meas,
|
||||
0)/(12.0*frame_parms->N_RB_DL);
|
||||
LOG_D(OCM,"[SIM][DL] UE %d : rx_pwr %f dBm/RE (%f dBm RSSI,tx %f dB)for subframe %d (length %d)\n",UE_id,
|
||||
10*log10(rx_pwr),
|
||||
10*log10(rx_pwr*(double)frame_parms->N_RB_DL*12),
|
||||
10*log10(tx_pwr),subframe,
|
||||
length<length_meas?length:length_meas);
|
||||
|
||||
|
||||
LOG_D(OCM,"[SIM][DL] UE %d : rx_pwr (noise) -132 dBm/RE (N0fs = %.1f dBm, N0B = %.1f dBm) for subframe %d\n",
|
||||
UE_id,
|
||||
10*log10(sim->RU2UE[ru_id][UE_id][CC_id]->sampling_rate*1e6)-174,
|
||||
10*log10(sim->RU2UE[ru_id][UE_id][CC_id]->sampling_rate*1e6*12*frame_parms->N_RB_DL/(double)frame_parms->ofdm_symbol_size)-174,
|
||||
subframe);
|
||||
#endif
|
||||
|
||||
if (sim->RU2UE[ru_id][UE_id][CC_id]->first_run == 1)
|
||||
sim->RU2UE[ru_id][UE_id][CC_id]->first_run = 0;
|
||||
|
||||
|
||||
// RF model
|
||||
#ifdef DEBUG_SIM
|
||||
LOG_D(OCM,"[SIM][DL] UE %d (CCid %d): rx_gain %d dB (-ADC %f) for subframe %d\n",UE_id,CC_id,PHY_vars_UE_g[UE_id][CC_id]->rx_total_gain_dB,
|
||||
PHY_vars_UE_g[UE_id][CC_id]->rx_total_gain_dB-66.227,subframe);
|
||||
#endif
|
||||
|
||||
rf_rx_simple(r_re0,
|
||||
r_im0,
|
||||
nb_antennas_rx,
|
||||
length,
|
||||
1e3/sim->RU2UE[ru_id][UE_id][CC_id]->sampling_rate, // sampling time (ns)
|
||||
(double)PHY_vars_UE_g[UE_id][CC_id]->rx_total_gain_dB - 66.227); // rx_gain (dB) (66.227 = 20*log10(pow2(11)) = gain from the adc that will be applied later)
|
||||
|
||||
#ifdef DEBUG_SIM
|
||||
rx_pwr = signal_energy_fp(r_re0,r_im0,
|
||||
nb_antennas_rx,
|
||||
length<length_meas?length:length_meas,
|
||||
0)/(12.0*frame_parms->N_RB_DL);
|
||||
LOG_D(OCM,"[SIM][DL] UE %d : ADC in (RU %d) %f dBm/RE for subframe %d\n",
|
||||
UE_id,ru_id,
|
||||
10*log10(rx_pwr),subframe);
|
||||
#endif
|
||||
|
||||
|
||||
pthread_mutex_lock(&sim->RU_output_mutex[UE_id]);
|
||||
for (i=0; i<frame_parms->samples_per_tti; i++) {
|
||||
for (aa=0; aa<nb_antennas_rx; aa++) {
|
||||
sim->r_re_DL[UE_id][aa][i]+=r_re0[aa][i];
|
||||
sim->r_im_DL[UE_id][aa][i]+=r_im0[aa][i];
|
||||
}
|
||||
}
|
||||
sim->RU_output_mask[UE_id] |= (1<<ru_id);
|
||||
if (sim->RU_output_mask[UE_id] == (1<<RC.nb_RU)-1) {
|
||||
sim->RU_output_mask[UE_id]=0;
|
||||
|
||||
|
||||
|
||||
double *r_re_p[2] = {sim->r_re_DL[UE_id][0],sim->r_re_DL[UE_id][1]};
|
||||
double *r_im_p[2] = {sim->r_im_DL[UE_id][0],sim->r_im_DL[UE_id][1]};
|
||||
|
||||
#ifdef DEBUG_SIM
|
||||
rx_pwr = signal_energy_fp(r_re_p,r_im_p,nb_antennas_rx,length<length_meas?length:length_meas,0)/(12.0*frame_parms->N_RB_DL);
|
||||
LOG_D(OCM,"[SIM][DL] UE %d : ADC in %f dBm/RE for subframe %d\n",UE_id,10*log10(rx_pwr),subframe);
|
||||
#endif
|
||||
|
||||
rxdata = PHY_vars_UE_g[UE_id][CC_id]->common_vars.rxdata;
|
||||
sf_offset = (subframe*frame_parms->samples_per_tti)+offset;
|
||||
|
||||
|
||||
adc(r_re_p,
|
||||
r_im_p,
|
||||
0,
|
||||
sf_offset,
|
||||
rxdata,
|
||||
nb_antennas_rx,
|
||||
length,
|
||||
12);
|
||||
|
||||
#ifdef DEBUG_SIM
|
||||
rx_pwr2 = signal_energy(rxdata[0]+sf_offset,length<length_meas?length:length_meas)/(12.0*frame_parms->N_RB_DL);
|
||||
LOG_D(OCM,"[SIM][DL] UE %d : rx_pwr (ADC out) %f dB/RE (%d) for subframe %d, writing to %p, length %d\n",UE_id, 10*log10((double)rx_pwr2),rx_pwr2,subframe,rxdata,length<length_meas?length:length_meas);
|
||||
LOG_D(OCM,"[SIM][DL] UE %d : rx_pwr (ADC out) %f dB for subframe %d\n",UE_id,10*log10((double)rx_pwr2*12*frame_parms->N_RB_DL) ,subframe);
|
||||
#else
|
||||
UNUSED_VARIABLE(rx_pwr2);
|
||||
UNUSED_VARIABLE(tx_pwr);
|
||||
UNUSED_VARIABLE(rx_pwr);
|
||||
#endif
|
||||
|
||||
} // RU_output_mask
|
||||
pthread_mutex_unlock(&sim->RU_output_mutex[UE_id]);
|
||||
} // ru_id
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void do_UL_sig(sim_t *sim,
|
||||
uint16_t subframe,uint8_t abstraction_flag,LTE_DL_FRAME_PARMS *frame_parms,
|
||||
uint32_t frame,int ru_id,uint8_t CC_id)
|
||||
{
|
||||
|
||||
int32_t **txdata,**rxdata;
|
||||
uint8_t UE_id=0;
|
||||
|
||||
uint8_t nb_antennas_rx = sim->UE2RU[0][0][CC_id]->nb_rx; // number of rx antennas at eNB
|
||||
uint8_t nb_antennas_tx = sim->UE2RU[0][0][CC_id]->nb_tx; // number of tx antennas at UE
|
||||
|
||||
double tx_pwr, rx_pwr;
|
||||
int32_t rx_pwr2;
|
||||
uint32_t i,aa;
|
||||
uint32_t sf_offset,sf_offset_tdd;
|
||||
|
||||
uint8_t hold_channel=0;
|
||||
|
||||
double s_re0[30720];
|
||||
double s_re1[30720];
|
||||
double *s_re[2];
|
||||
double s_im0[30720];
|
||||
double s_im1[30720];
|
||||
double *s_im[2];
|
||||
double r_re00[30720];
|
||||
double r_re01[30720];
|
||||
double *r_re0[2];
|
||||
double r_im00[30720];
|
||||
double r_im01[30720];
|
||||
double *r_im0[2];
|
||||
|
||||
s_re[0] = s_re0;
|
||||
s_im[0] = s_im0;
|
||||
s_re[1] = s_re1;
|
||||
s_im[1] = s_im1;
|
||||
|
||||
r_re0[0] = r_re00;
|
||||
r_im0[0] = r_im00;
|
||||
r_re0[1] = r_re01;
|
||||
r_im0[1] = r_im01;
|
||||
|
||||
pthread_mutex_lock(&sim->UE_output_mutex[ru_id]);
|
||||
// Clear RX signal for eNB = eNB_id
|
||||
for (i=0; i<frame_parms->samples_per_tti; i++) {
|
||||
for (aa=0; aa<nb_antennas_rx; aa++) {
|
||||
sim->r_re_UL[ru_id][aa][i]=0.0;
|
||||
sim->r_im_UL[ru_id][aa][i]=0.0;
|
||||
}
|
||||
}
|
||||
pthread_mutex_unlock(&sim->UE_output_mutex[ru_id]);
|
||||
|
||||
// Compute RX signal for eNB = eNB_id
|
||||
for (UE_id=0; UE_id<NB_UE_INST; UE_id++) {
|
||||
|
||||
txdata = PHY_vars_UE_g[UE_id][CC_id]->common_vars.txdata;
|
||||
AssertFatal(txdata != NULL,"txdata is null\n");
|
||||
|
||||
sf_offset = subframe*frame_parms->samples_per_tti;
|
||||
if (subframe>0) sf_offset_tdd = sf_offset - PHY_vars_UE_g[UE_id][CC_id]->N_TA_offset;
|
||||
else sf_offset_tdd = sf_offset;
|
||||
|
||||
LOG_D(OCM,"txdata for subframe %d (%d), power %d\n",subframe,sf_offset_tdd,dB_fixed(signal_energy(&txdata[0][sf_offset_tdd],frame_parms->samples_per_tti)));
|
||||
|
||||
if (((double)PHY_vars_UE_g[UE_id][CC_id]->tx_power_dBm[subframe] +
|
||||
sim->UE2RU[UE_id][ru_id][CC_id]->path_loss_dB) <= -125.0) {
|
||||
// don't simulate a UE that is too weak
|
||||
LOG_D(OCM,"[SIM][UL] ULPOWERS UE %d tx_pwr %d dBm (num_RE %d) for subframe %d (sf_offset %d,sf_offset_tdd %d)\n",
|
||||
UE_id,
|
||||
PHY_vars_UE_g[UE_id][CC_id]->tx_power_dBm[subframe],
|
||||
PHY_vars_UE_g[UE_id][CC_id]->tx_total_RE[subframe],
|
||||
subframe,sf_offset,sf_offset_tdd);
|
||||
} else {
|
||||
tx_pwr = dac_fixed_gain((double**)s_re,
|
||||
(double**)s_im,
|
||||
txdata,
|
||||
sf_offset_tdd,
|
||||
nb_antennas_tx,
|
||||
frame_parms->samples_per_tti,
|
||||
sf_offset_tdd,
|
||||
frame_parms->ofdm_symbol_size,
|
||||
14,
|
||||
(double)PHY_vars_UE_g[UE_id][CC_id]->tx_power_dBm[subframe]-10*log10((double)PHY_vars_UE_g[UE_id][CC_id]->tx_total_RE[subframe]),
|
||||
1,
|
||||
NULL,
|
||||
PHY_vars_UE_g[UE_id][CC_id]->tx_total_RE[subframe]); // This make the previous argument the total power
|
||||
LOG_D(OCM,"[SIM][UL] ULPOWERS UE %d tx_pwr %f dBm (target %d dBm, num_RE %d) for subframe %d (sf_offset %d,sf_offset_tdd %d)\n",
|
||||
UE_id,
|
||||
10*log10(tx_pwr*PHY_vars_UE_g[UE_id][CC_id]->tx_total_RE[subframe]),
|
||||
PHY_vars_UE_g[UE_id][CC_id]->tx_power_dBm[subframe],
|
||||
PHY_vars_UE_g[UE_id][CC_id]->tx_total_RE[subframe],
|
||||
subframe,sf_offset,sf_offset_tdd);
|
||||
|
||||
|
||||
multipath_channel(sim->UE2RU[UE_id][ru_id][CC_id],s_re,s_im,r_re0,r_im0,
|
||||
frame_parms->samples_per_tti,hold_channel);
|
||||
|
||||
|
||||
rx_pwr = signal_energy_fp2(sim->UE2RU[UE_id][ru_id][CC_id]->ch[0],
|
||||
sim->UE2RU[UE_id][ru_id][CC_id]->channel_length)*sim->UE2RU[UE_id][ru_id][CC_id]->channel_length;
|
||||
|
||||
LOG_D(OCM,"[SIM][UL] subframe %d Channel UE %d => RU %d : %f dB (hold %d,length %d, PL %f)\n",subframe,UE_id,ru_id,10*log10(rx_pwr),
|
||||
hold_channel,sim->UE2RU[UE_id][ru_id][CC_id]->channel_length,
|
||||
sim->UE2RU[UE_id][ru_id][CC_id]->path_loss_dB);
|
||||
|
||||
rx_pwr = signal_energy_fp(r_re0,r_im0,nb_antennas_rx,frame_parms->samples_per_tti,0);
|
||||
LOG_D(OCM,"[SIM][UL] RU %d (%d/%d rx antennas) : rx_pwr %f dBm (tx_pwr - PL %f) for subframe %d, sptti %d\n",
|
||||
ru_id,nb_antennas_rx,sim->UE2RU[UE_id][ru_id][CC_id]->nb_rx,10*log10(rx_pwr),10*log10(tx_pwr*PHY_vars_UE_g[UE_id][CC_id]->tx_total_RE[subframe])+sim->UE2RU[UE_id][ru_id][CC_id]->path_loss_dB,subframe,frame_parms->samples_per_tti);
|
||||
/*
|
||||
if (abs(10*log10(rx_pwr)-10*log10(tx_pwr*PHY_vars_UE_g[UE_id][CC_id]->tx_total_RE[subframe])-UE2RU[UE_id][ru_id][CC_id]->path_loss_dB)>3) {
|
||||
write_output("txsig_re.m","s_re",s_re[0],frame_parms->samples_per_tti,1,7);
|
||||
write_output("txsig_im.m","s_im",s_im[0],frame_parms->samples_per_tti,1,7);
|
||||
write_output("rxsig_re.m","r_re",r_re0[0],frame_parms->samples_per_tti,1,7);
|
||||
write_output("rxsig_im.m","r_im",r_im0[0],frame_parms->samples_per_tti,1,7);
|
||||
exit(-1);
|
||||
}*/
|
||||
|
||||
if (sim->UE2RU[UE_id][ru_id][CC_id]->first_run == 1)
|
||||
sim->UE2RU[UE_id][ru_id][CC_id]->first_run = 0;
|
||||
|
||||
|
||||
pthread_mutex_lock(&sim->UE_output_mutex[ru_id]);
|
||||
for (aa=0; aa<nb_antennas_rx; aa++) {
|
||||
for (i=0; i<frame_parms->samples_per_tti; i++) {
|
||||
sim->r_re_UL[ru_id][aa][i]+=r_re0[aa][i];
|
||||
sim->r_im_UL[ru_id][aa][i]+=r_im0[aa][i];
|
||||
}
|
||||
}
|
||||
pthread_mutex_unlock(&sim->UE_output_mutex[ru_id]);
|
||||
}
|
||||
} //UE_id
|
||||
|
||||
double *r_re_p[2] = {sim->r_re_UL[ru_id][0],sim->r_re_UL[ru_id][1]};
|
||||
double *r_im_p[2] = {sim->r_im_UL[ru_id][0],sim->r_im_UL[ru_id][1]};
|
||||
|
||||
rx_pwr = signal_energy_fp(r_re_p,r_im_p,nb_antennas_rx,frame_parms->samples_per_tti,0);
|
||||
LOG_D(OCM,"[SIM][UL] RU %d (%d/%d rx antennas) : rx_pwr %f dBm (before RF) for subframe %d, gain %f\n",
|
||||
ru_id,nb_antennas_rx,nb_antennas_rx,10*log10(rx_pwr),subframe,
|
||||
(double)RC.ru[ru_id]->max_rxgain-(double)RC.ru[ru_id]->att_rx - 66.227);
|
||||
rf_rx_simple(r_re_p,
|
||||
r_im_p,
|
||||
nb_antennas_rx,
|
||||
frame_parms->samples_per_tti,
|
||||
1e3/sim->UE2RU[0][ru_id][CC_id]->sampling_rate, // sampling time (ns)
|
||||
(double)RC.ru[ru_id]->max_rxgain-(double)RC.ru[ru_id]->att_rx - 66.227); // rx_gain (dB) (66.227 = 20*log10(pow2(11)) = gain from the adc that will be applied later)
|
||||
|
||||
#ifdef DEBUG_SIM
|
||||
rx_pwr = signal_energy_fp(r_re_p,r_im_p,nb_antennas_rx,frame_parms->samples_per_tti,0);//*(double)frame_parms->ofdm_symbol_size/(12.0*frame_parms->N_RB_DL;
|
||||
LOG_D(OCM,"[SIM][UL] rx_pwr (ADC in) %f dB for subframe %d (rx_gain %f)\n",10*log10(rx_pwr),subframe,
|
||||
(double)RC.ru[ru_id]->max_rxgain-(double)RC.ru[ru_id]->att_rx);
|
||||
#endif
|
||||
|
||||
rxdata = RC.ru[ru_id]->common.rxdata;
|
||||
sf_offset = subframe*frame_parms->samples_per_tti;
|
||||
if (subframe>0) sf_offset_tdd = sf_offset - RC.ru[ru_id]->N_TA_offset;
|
||||
else sf_offset_tdd = sf_offset;
|
||||
|
||||
|
||||
adc(r_re_p,
|
||||
r_im_p,
|
||||
0,
|
||||
sf_offset_tdd,
|
||||
rxdata,
|
||||
nb_antennas_rx,
|
||||
frame_parms->samples_per_tti,
|
||||
12);
|
||||
|
||||
#ifdef DEBUG_SIM
|
||||
rx_pwr2 = signal_energy(rxdata[0]+sf_offset_tdd,frame_parms->samples_per_tti)*(double)frame_parms->ofdm_symbol_size/(12.0*frame_parms->N_RB_DL);
|
||||
LOG_D(OCM,"[SIM][UL] RU %d rx_pwr (ADC out) %f dB (%d) for subframe %d (offset %d) = %p\n",ru_id,10*log10((double)rx_pwr2),rx_pwr2,subframe,sf_offset,rxdata[0]+sf_offset_tdd);
|
||||
#else
|
||||
UNUSED_VARIABLE(tx_pwr);
|
||||
UNUSED_VARIABLE(rx_pwr);
|
||||
UNUSED_VARIABLE(rx_pwr2);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
#ifndef __SIMULATION_TOOLS_DEFS_H__
|
||||
#define __SIMULATION_TOOLS_DEFS_H__
|
||||
#include "PHY/defs_common.h"
|
||||
|
||||
#include <pthread.h>
|
||||
/** @defgroup _numerical_ Useful Numerical Functions
|
||||
*@{
|
||||
The present clause specifies several numerical functions for testing of digital communication systems.
|
||||
@@ -181,6 +181,31 @@ typedef enum {
|
||||
EPA_high,
|
||||
} SCM_t;
|
||||
|
||||
#include "platform_constants.h"
|
||||
|
||||
typedef struct {
|
||||
channel_desc_t *RU2UE[NUMBER_OF_RU_MAX][NUMBER_OF_UE_MAX][MAX_NUM_CCs];
|
||||
channel_desc_t *UE2RU[NUMBER_OF_UE_MAX][NUMBER_OF_RU_MAX][MAX_NUM_CCs];
|
||||
double r_re_DL[NUMBER_OF_UE_MAX][2][30720];
|
||||
double r_im_DL[NUMBER_OF_UE_MAX][2][30720];
|
||||
double r_re_UL[NUMBER_OF_eNB_MAX][2][30720];
|
||||
double r_im_UL[NUMBER_OF_eNB_MAX][2][30720];
|
||||
int RU_output_mask[NUMBER_OF_UE_MAX];
|
||||
int UE_output_mask[NUMBER_OF_RU_MAX];
|
||||
pthread_mutex_t RU_output_mutex[NUMBER_OF_UE_MAX];
|
||||
pthread_mutex_t UE_output_mutex[NUMBER_OF_RU_MAX];
|
||||
pthread_mutex_t subframe_mutex;
|
||||
int subframe_ru_mask;
|
||||
int subframe_UE_mask;
|
||||
openair0_timestamp current_ru_rx_timestamp[NUMBER_OF_RU_MAX][MAX_NUM_CCs];
|
||||
openair0_timestamp current_UE_rx_timestamp[MAX_MOBILES_PER_ENB][MAX_NUM_CCs];
|
||||
openair0_timestamp last_ru_rx_timestamp[NUMBER_OF_RU_MAX][MAX_NUM_CCs];
|
||||
openair0_timestamp last_UE_rx_timestamp[MAX_MOBILES_PER_ENB][MAX_NUM_CCs];
|
||||
double ru_amp[NUMBER_OF_RU_MAX];
|
||||
pthread_t rfsim_thread;
|
||||
} sim_t;
|
||||
|
||||
|
||||
/**
|
||||
\brief This routine initializes a new channel descriptor
|
||||
\param nb_tx Number of TX antennas
|
||||
@@ -373,6 +398,20 @@ void multipath_tv_channel(channel_desc_t *desc,
|
||||
double N_RB2sampling_rate(uint16_t N_RB);
|
||||
double N_RB2channel_bandwidth(uint16_t N_RB);
|
||||
|
||||
#include "targets/RT/USER/rfsim.h"
|
||||
|
||||
void do_DL_sig(sim_t *sim,
|
||||
uint16_t subframe,
|
||||
uint32_t offset,
|
||||
uint32_t length,
|
||||
uint8_t abstraction_flag,LTE_DL_FRAME_PARMS *ue_frame_parms,
|
||||
uint8_t UE_id,
|
||||
int CC_id);
|
||||
|
||||
void do_UL_sig(sim_t *sim,
|
||||
uint16_t subframe,uint8_t abstraction_flag,LTE_DL_FRAME_PARMS *frame_parms,
|
||||
uint32_t frame,int ru_id,uint8_t CC_id);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
#ifndef GTPV1_U_MESSAGES_TYPES_H_
|
||||
#define GTPV1_U_MESSAGES_TYPES_H_
|
||||
|
||||
#include "asn1_constants.h"
|
||||
#include "asn_constant.h"
|
||||
|
||||
|
||||
#define GTPV1U_MAX_BEARERS_PER_UE max_val_DRB_Identity
|
||||
|
||||
@@ -29,9 +29,9 @@
|
||||
***************************************************************************/
|
||||
|
||||
#ifdef CMAKER
|
||||
#include "asn1_constants.h"
|
||||
#include "asn_constant.h"
|
||||
#else
|
||||
#include "RRC/LITE/MESSAGES/asn1_constants.h"
|
||||
#include "RRC/LTE/MESSAGES/asn1_constants.h"
|
||||
#endif
|
||||
|
||||
#ifndef __PLATFORM_CONSTANTS_H__
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
#ifndef RAL_MESSAGES_TYPES_H_
|
||||
#define RAL_MESSAGES_TYPES_H_
|
||||
#include "asn1_constants.h"
|
||||
#include "asn_constant.h"
|
||||
#include "platform_types.h"
|
||||
#include "commonDef.h"
|
||||
/* 802.21 mappings with the RRC protocol :
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
#ifdef CMAKER
|
||||
#include "SystemInformationBlockType2.h"
|
||||
#else
|
||||
#include "RRC/LITE/MESSAGES/SystemInformationBlockType2.h"
|
||||
#include "RRC/LTE/MESSAGES/SystemInformationBlockType2.h"
|
||||
#endif
|
||||
#include "SL-OffsetIndicator-r12.h"
|
||||
#include "SubframeBitmapSL-r12.h"
|
||||
|
||||
@@ -38,7 +38,7 @@ MESSAGE_DEF(S1AP_E_RAB_MODIFY_RESPONSE_LOG , MESSAGE_PRIORITY_MED, IttiMsgTex
|
||||
MESSAGE_DEF(S1AP_PAGING_LOG , MESSAGE_PRIORITY_MED, IttiMsgText , s1ap_paging_log)
|
||||
MESSAGE_DEF(S1AP_E_RAB_RELEASE_REQUEST_LOG , MESSAGE_PRIORITY_MED, IttiMsgText , s1ap_e_rab_release_request_log)
|
||||
MESSAGE_DEF(S1AP_E_RAB_RELEASE_RESPONSE_LOG , MESSAGE_PRIORITY_MED, IttiMsgText , s1ap_e_rab_release_response_log)
|
||||
MESSAGE_DEF(S1AP_E_RAB_ERROR_INDICATION_LOG , MESSAGE_PRIORITY_MED, IttiMsgText , s1ap_error_indication_log)
|
||||
MESSAGE_DEF(S1AP_ERROR_INDICATION_LOG , MESSAGE_PRIORITY_MED, IttiMsgText , s1ap_error_indication_log)
|
||||
|
||||
/* eNB application layer -> S1AP messages */
|
||||
MESSAGE_DEF(S1AP_REGISTER_ENB_REQ , MESSAGE_PRIORITY_MED, s1ap_register_enb_req_t , s1ap_register_enb_req)
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
#include "SystemInformationBlockType2.h"
|
||||
#include "rrc_messages_types.h"
|
||||
#else
|
||||
#include "RRC/LITE/MESSAGES/SystemInformationBlockType2.h"
|
||||
#include "RRC/LTE/MESSAGES/SystemInformationBlockType2.h"
|
||||
#endif
|
||||
#include "intertask_interface_types.h"
|
||||
#include "RRC/LTE/rrc_defs.h"
|
||||
|
||||
@@ -102,7 +102,7 @@ typedef enum {
|
||||
} ran_name_t;
|
||||
|
||||
typedef uint8_t xid_t;
|
||||
typedef uint8_t mid_t; // module or enb id
|
||||
typedef uint16_t mid_t; // module or enb id
|
||||
typedef uint8_t lcid_t;
|
||||
typedef int32_t err_code_t;
|
||||
|
||||
|
||||
@@ -1324,6 +1324,26 @@ fill_nfapi_ulsch_harq_information(module_id_t module_
|
||||
} // get Tmode
|
||||
}
|
||||
|
||||
uint8_t Np[6][4]= {{0,1,3,5},
|
||||
{0,3,8,13},
|
||||
{0,5,13,22},
|
||||
{0,11,27,44},
|
||||
{0,16,41,66},
|
||||
{0,22,55,88}};
|
||||
|
||||
// This is part of the PUCCH allocation procedure (see Section 10.1 36.213)
|
||||
uint16_t getNp(int dl_Bandwidth,uint8_t nCCE,uint8_t plus1)
|
||||
{
|
||||
AssertFatal(dl_Bandwidth<6,"dl_Bandwidth %d>5\n",dl_Bandwidth);
|
||||
|
||||
if (nCCE>=Np[dl_Bandwidth][2])
|
||||
return(Np[dl_Bandwidth][2+plus1]);
|
||||
else if (nCCE>=Np[dl_Bandwidth][1])
|
||||
return(Np[dl_Bandwidth][1+plus1]);
|
||||
else
|
||||
return(Np[dl_Bandwidth][0+plus1]);
|
||||
}
|
||||
|
||||
void
|
||||
fill_nfapi_harq_information(module_id_t module_idP,
|
||||
int CC_idP,
|
||||
@@ -1365,8 +1385,7 @@ fill_nfapi_harq_information(module_id_t module_idP,
|
||||
harq_information->harq_information_rel10_tdd.ack_nack_mode = 0; // bundling
|
||||
}
|
||||
harq_information->harq_information_rel10_tdd.tl.tag = NFAPI_UL_CONFIG_REQUEST_HARQ_INFORMATION_REL10_TDD_TAG;
|
||||
LTE_DL_FRAME_PARMS *frame_parms = &RC.eNB[module_idP][CC_idP]->frame_parms;
|
||||
harq_information->harq_information_rel10_tdd.n_pucch_1_0 = get_Np(frame_parms->N_RB_DL,cce_idxP,0) +
|
||||
harq_information->harq_information_rel10_tdd.n_pucch_1_0 = getNp(cc->mib->message.dl_Bandwidth,cce_idxP,0) +
|
||||
cc->radioResourceConfigCommon->pucch_ConfigCommon.n1PUCCH_AN + cce_idxP;
|
||||
harq_information->harq_information_rel10_tdd.number_of_pucch_resources = 1;
|
||||
} else {
|
||||
@@ -3157,7 +3176,7 @@ allocate_CCEs(int module_idP, int CC_idP, frame_t frameP, sub_frame_t subframeP,
|
||||
cc->radioResourceConfigCommon->pucch_ConfigCommon.n1PUCCH_AN + fCCE;
|
||||
else
|
||||
ul_req->ul_config_pdu_list[ack_int].uci_harq_pdu.harq_information.harq_information_rel10_tdd.n_pucch_1_0 =
|
||||
cc->radioResourceConfigCommon->pucch_ConfigCommon.n1PUCCH_AN + fCCE + get_Np(to_prb(cc->mib->message.dl_Bandwidth),fCCE,0) ;
|
||||
cc->radioResourceConfigCommon->pucch_ConfigCommon.n1PUCCH_AN + fCCE + getNp(cc->mib->message.dl_Bandwidth,fCCE,0) ;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3362,6 +3381,132 @@ uint8_t frame_subframe2_dl_harq_pid(TDD_Config_t *tdd_Config, int abs_frameP, su
|
||||
return -1;
|
||||
}
|
||||
|
||||
unsigned char ul_ACK_subframe2M(TDD_Config_t *tdd_Config,unsigned char subframe)
|
||||
{
|
||||
|
||||
if (tdd_Config == NULL) {
|
||||
return(1);
|
||||
} else {
|
||||
switch (tdd_Config->subframeAssignment) {
|
||||
case 1:
|
||||
return 1; // don't ACK special subframe for now
|
||||
if (subframe == 2) { // ACK subframes 5 and 6
|
||||
return(2);
|
||||
} else if (subframe == 3) { // ACK subframe 9
|
||||
return(1); // To be updated
|
||||
} else if (subframe == 7) { // ACK subframes 0 and 1
|
||||
return(2); // To be updated
|
||||
} else if (subframe == 8) { // ACK subframe 4
|
||||
return(1); // To be updated
|
||||
} else {
|
||||
AssertFatal(1==0,"illegal subframe %d for tdd_config %d\n",
|
||||
subframe,tdd_Config->subframeAssignment);
|
||||
|
||||
}
|
||||
|
||||
break;
|
||||
case 3:
|
||||
if (subframe == 2) { // ACK subframes 5 and 6
|
||||
return(2); // should be 3
|
||||
} else if (subframe == 3) { // ACK subframes 7 and 8
|
||||
return(2); // To be updated
|
||||
} else if (subframe == 4) { // ACK subframes 9 and 0
|
||||
return(2);
|
||||
} else {
|
||||
AssertFatal(1==0,"illegal subframe %d for tdd_config %d\n",
|
||||
subframe,tdd_Config->subframeAssignment);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 4:
|
||||
if (subframe == 2) { // ACK subframes 0,4 and 5
|
||||
return(3); // should be 4
|
||||
} else if (subframe == 3) { // ACK subframes 6,7,8 and 9
|
||||
return(4);
|
||||
} else {
|
||||
AssertFatal(1==0,"illegal subframe %d for tdd_config %d\n",
|
||||
subframe,tdd_Config->subframeAssignment);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 5:
|
||||
if (subframe == 2) { // ACK subframes 0,3,4,5,6,7,8 and 9
|
||||
return(8); // should be 3
|
||||
} else {
|
||||
AssertFatal(1==0,"illegal subframe %d for tdd_config %d\n",
|
||||
subframe,tdd_Config->subframeAssignment);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
unsigned char ul_ACK_subframe2dl_subframe(TDD_Config_t *tdd_Config,unsigned char subframe,unsigned char ACK_index)
|
||||
{
|
||||
|
||||
if (tdd_Config == NULL) {
|
||||
return((subframe<4) ? subframe+6 : subframe-4);
|
||||
} else {
|
||||
switch (tdd_Config->subframeAssignment) {
|
||||
case 3:
|
||||
if (subframe == 2) { // ACK subframes 5 and 6
|
||||
if (ACK_index==2)
|
||||
return(1);
|
||||
|
||||
return(5+ACK_index);
|
||||
} else if (subframe == 3) { // ACK subframes 7 and 8
|
||||
return(7+ACK_index); // To be updated
|
||||
} else if (subframe == 4) { // ACK subframes 9 and 0
|
||||
return((9+ACK_index)%10);
|
||||
} else {
|
||||
AssertFatal(1==0,"illegal subframe %d for tdd_config->subframeAssignment %d\n",
|
||||
subframe,tdd_Config->subframeAssignment);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 4:
|
||||
if (subframe == 2) { // ACK subframes 0, 4 and 5
|
||||
//if (ACK_index==2)
|
||||
// return(1); TBC
|
||||
if (ACK_index==2)
|
||||
return(0);
|
||||
|
||||
return(4+ACK_index);
|
||||
} else if (subframe == 3) { // ACK subframes 6, 7 8 and 9
|
||||
return(6+ACK_index); // To be updated
|
||||
} else {
|
||||
AssertFatal(1==0,"illegal subframe %d for tdd_config %d\n",
|
||||
subframe,tdd_Config->subframeAssignment);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 1:
|
||||
if (subframe == 2) { // ACK subframes 5 and 6
|
||||
return(5+ACK_index);
|
||||
} else if (subframe == 3) { // ACK subframe 9
|
||||
return(9); // To be updated
|
||||
} else if (subframe == 7) { // ACK subframes 0 and 1
|
||||
return(ACK_index); // To be updated
|
||||
} else if (subframe == 8) { // ACK subframe 4
|
||||
return(4); // To be updated
|
||||
} else {
|
||||
AssertFatal(1==0,"illegal subframe %d for tdd_config %d\n",
|
||||
subframe,tdd_Config->subframeAssignment);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
void
|
||||
extract_harq(module_id_t mod_idP, int CC_idP, int UE_id,
|
||||
@@ -3381,11 +3526,10 @@ extract_harq(module_id_t mod_idP, int CC_idP, int UE_id,
|
||||
int tmode[5];
|
||||
int i, j, m;
|
||||
uint8_t *pdu;
|
||||
LTE_DL_FRAME_PARMS *fp;
|
||||
sub_frame_t subframe_tx;
|
||||
int frame_tx;
|
||||
uint8_t harq_pid;
|
||||
|
||||
|
||||
#if (RRC_VERSION >= MAKE_VERSION(13, 0, 0))
|
||||
if (UE_list->UE_template[pCCid][UE_id].physicalConfigDedicated != NULL &&
|
||||
UE_list->UE_template[pCCid][UE_id].physicalConfigDedicated->pucch_ConfigDedicated != NULL &&
|
||||
@@ -3396,27 +3540,26 @@ extract_harq(module_id_t mod_idP, int CC_idP, int UE_id,
|
||||
&& (format == 1))))
|
||||
spatial_bundling = 1;
|
||||
#endif
|
||||
fp=&(RC.eNB[mod_idP][CC_idP]->frame_parms);
|
||||
for (i = 0; i < numCC; i++)
|
||||
tmode[i] = get_tmode(mod_idP, i, UE_id);
|
||||
|
||||
|
||||
if (cc->tdd_Config) {
|
||||
harq_indication_tdd = (nfapi_harq_indication_tdd_rel13_t *) harq_indication;
|
||||
// pdu = &harq_indication_tdd->harq_tb_n[0];
|
||||
|
||||
|
||||
num_ack_nak = harq_indication_tdd->number_of_ack_nack;
|
||||
|
||||
|
||||
switch (harq_indication_tdd->mode) {
|
||||
case 0: // Format 1a/b bundling
|
||||
AssertFatal(numCC == 1, "numCC %d > 1, should not be using Format1a/b\n", numCC);
|
||||
int M = ul_ACK_subframe2_M(fp,subframeP);
|
||||
int M = ul_ACK_subframe2M(cc->tdd_Config,subframeP);
|
||||
for(m=0;m<M;m++){
|
||||
subframe_tx = ul_ACK_subframe2_dl_subframe(fp,subframeP,m);
|
||||
if(frameP==1023&&subframeP>5)
|
||||
frame_tx=-1;
|
||||
else
|
||||
frame_tx = subframeP < 4 ? frameP -1 : frameP;
|
||||
harq_pid = frame_subframe2_dl_harq_pid(cc->tdd_Config,frame_tx,subframe_tx);
|
||||
subframe_tx = ul_ACK_subframe2dl_subframe(cc->tdd_Config,subframeP,m);
|
||||
if(frameP==1023&&subframeP>5)
|
||||
frame_tx=-1;
|
||||
else
|
||||
frame_tx = subframeP < 4 ? frameP -1 : frameP;
|
||||
harq_pid = frame_subframe2_dl_harq_pid(cc->tdd_Config,frame_tx,subframe_tx);
|
||||
RA_t *ra = &RC.mac[mod_idP]->common_channels[CC_idP].ra[0];
|
||||
|
||||
if(num_ack_nak==1){
|
||||
@@ -3425,9 +3568,12 @@ extract_harq(module_id_t mod_idP, int CC_idP, int UE_id,
|
||||
sched_ctl->tbcnt[CC_idP][harq_pid] = 0;
|
||||
LOG_D(MAC,"frame %d subframe %d Acking (%d,%d) harq_pid %d round %d\n",frameP,subframeP,frame_tx,subframe_tx,harq_pid,sched_ctl->round[CC_idP][harq_pid]);
|
||||
}else{ //nack
|
||||
if( sched_ctl->round[CC_idP][harq_pid]<8)
|
||||
sched_ctl->round[CC_idP][harq_pid]++;
|
||||
LOG_D(MAC,"frame %d subframe %d Nacking (%d,%d) harq_pid %d round %d\n",frameP,subframeP,frame_tx,subframe_tx,harq_pid,sched_ctl->round[CC_idP][harq_pid]);
|
||||
if( sched_ctl->round[CC_idP][harq_pid]<8) sched_ctl->round[CC_idP][harq_pid]++;
|
||||
if (sched_ctl->round[CC_idP][harq_pid] == 4) {
|
||||
sched_ctl->round[CC_idP][harq_pid] = 8; // release HARQ process
|
||||
sched_ctl->tbcnt[CC_idP][harq_pid] = 0;
|
||||
}
|
||||
LOG_D(MAC,"frame %d subframe %d Nacking (%d,%d) harq_pid %d round %d\n",frameP,subframeP,frame_tx,subframe_tx,harq_pid,sched_ctl->round[CC_idP][harq_pid]);
|
||||
if(sched_ctl->round[CC_idP][harq_pid] == 8){
|
||||
for (uint8_t ra_i = 0; ra_i < NB_RA_PROC_MAX; ra_i++) {
|
||||
if((ra[ra_i].rnti == rnti) && (ra[ra_i].state == WAITMSG4ACK)){
|
||||
@@ -4266,6 +4412,9 @@ cqi_indication(module_id_t mod_idP, int CC_idP, frame_t frameP,
|
||||
pdu, rel9->length);
|
||||
|
||||
LOG_D(MAC,"Frame %d Subframe %d update CQI:%d\n",frameP,subframeP,sched_ctl->dl_cqi[CC_idP]);
|
||||
|
||||
sched_ctl->cqi_req_flag &= (~(1 << subframeP));
|
||||
sched_ctl->cqi_received = 1;
|
||||
}
|
||||
|
||||
// timing advance
|
||||
@@ -4336,8 +4485,11 @@ static int nack_or_dtx_reported(
|
||||
int i;
|
||||
|
||||
if (cc->tdd_Config) {
|
||||
AssertFatal(0==1, "TDD to be done. FAPI structures (see nfapi_harq_indication_tdd_rel13_t) are not clean. To be cleaned as well?\n");
|
||||
abort();
|
||||
nfapi_harq_indication_tdd_rel13_t *hi = &harq_pdu->harq_indication_tdd_rel13;
|
||||
for (i = 0; i < hi->number_of_ack_nack; hi++)
|
||||
if (hi->harq_data[0].bundling.value_0 != 1) //only bundling is used for tdd for now
|
||||
return 1;
|
||||
return 0;
|
||||
} else {
|
||||
nfapi_harq_indication_fdd_rel13_t *hi = &harq_pdu->harq_indication_fdd_rel13;
|
||||
for (i = 0; i < hi->number_of_ack_nack; hi++)
|
||||
|
||||
@@ -158,8 +158,8 @@ rx_sdu(const module_id_t enb_mod_idP,
|
||||
|
||||
if (UE_id != -1) {
|
||||
LOG_D(MAC,
|
||||
"[eNB %d][PUSCH %d] CC_id %d Received ULSCH sdu round %d from PHY (rnti %x, UE_id %d) ul_cqi %d\n",
|
||||
enb_mod_idP, harq_pid, CC_idP,
|
||||
"[eNB %d][PUSCH %d] CC_id %d %d.%d Received ULSCH sdu round %d from PHY (rnti %x, UE_id %d) ul_cqi %d\n",
|
||||
enb_mod_idP, harq_pid, CC_idP,frameP,subframeP,
|
||||
UE_list->UE_sched_ctrl[UE_id].round_UL[CC_idP][harq_pid],
|
||||
current_rnti, UE_id, ul_cqi);
|
||||
|
||||
@@ -191,9 +191,9 @@ rx_sdu(const module_id_t enb_mod_idP,
|
||||
if (UE_list->UE_template[CC_idP][UE_id].scheduled_ul_bytes < 0)
|
||||
UE_list->UE_template[CC_idP][UE_id].scheduled_ul_bytes = 0;
|
||||
} else { // we've got an error
|
||||
LOG_D(MAC,
|
||||
"[eNB %d][PUSCH %d] CC_id %d ULSCH in error in round %d, ul_cqi %d\n",
|
||||
enb_mod_idP, harq_pid, CC_idP,
|
||||
LOG_I(MAC,
|
||||
"[eNB %d][PUSCH %d] CC_id %d %d.%d ULSCH in error in round %d, ul_cqi %d\n",
|
||||
enb_mod_idP, harq_pid, CC_idP,frameP,subframeP,
|
||||
UE_list->UE_sched_ctrl[UE_id].round_UL[CC_idP][harq_pid],
|
||||
ul_cqi);
|
||||
|
||||
@@ -1332,18 +1332,23 @@ schedule_ulsch_rnti(module_id_t module_idP,
|
||||
// reset the scheduling request
|
||||
UE_template->ul_SR = 0;
|
||||
status = mac_eNB_get_rrc_status(module_idP, rnti);
|
||||
if (status < RRC_CONNECTED)
|
||||
cqi_req = 0;
|
||||
else if (UE_sched_ctrl->cqi_req_timer > 30) {
|
||||
if (nfapi_mode) {
|
||||
cqi_req = 0;
|
||||
} else {
|
||||
cqi_req = 1;
|
||||
UE_sched_ctrl->cqi_req_flag |= 1 << sched_subframeP;
|
||||
cqi_req = 0;
|
||||
|
||||
if (status >= RRC_CONNECTED && UE_sched_ctrl->cqi_req_timer > 30) {
|
||||
if (UE_sched_ctrl->cqi_received == 0) {
|
||||
if (nfapi_mode) {
|
||||
cqi_req = 0;
|
||||
} else {
|
||||
cqi_req = 1;
|
||||
UE_sched_ctrl->cqi_req_flag |= 1 << sched_subframeP;
|
||||
}
|
||||
}
|
||||
UE_sched_ctrl->cqi_req_timer = 0;
|
||||
} else
|
||||
cqi_req = 0;
|
||||
else if (UE_sched_ctrl->cqi_received == 1) {
|
||||
UE_sched_ctrl->cqi_req_flag = 0;
|
||||
UE_sched_ctrl->cqi_received = 0;
|
||||
UE_sched_ctrl->cqi_req_timer = 0;
|
||||
}
|
||||
}
|
||||
|
||||
//power control
|
||||
//compute the expected ULSCH RX power (for the stats)
|
||||
@@ -1562,7 +1567,7 @@ schedule_ulsch_rnti(module_id_t module_idP,
|
||||
CC_id, UE_id, subframeP,
|
||||
S_UL_SCHEDULED);
|
||||
|
||||
//LOG_D(MAC, "[eNB %d] CC_id %d Frame %d, subframeP %d: Generated ULSCH DCI for next UE_id %d, format 0\n", module_idP, CC_id, frameP, subframeP, UE_id);
|
||||
LOG_D(MAC, "[eNB %d] CC_id %d Frame %d, subframeP %d: Generated ULSCH DCI for next UE_id %d, format 0\n", module_idP, CC_id, frameP, subframeP, UE_id);
|
||||
LOG_D(MAC,"[PUSCH %d] SFN/SF:%04d%d UL_CFG:SFN/SF:%04d%d CQI:%d for UE %d/%x\n", harq_pid,frameP,subframeP,ul_sched_frame,ul_sched_subframeP,cqi_req,UE_id,rnti);
|
||||
|
||||
// increment first rb for next UE allocation
|
||||
|
||||
@@ -951,7 +951,10 @@ typedef struct {
|
||||
int16_t ta_update;
|
||||
uint16_t ul_consecutive_errors;
|
||||
int32_t context_active_timer;
|
||||
/// timer for regular CQI request on PUSCH
|
||||
int32_t cqi_req_timer;
|
||||
/// indicator that CQI was received on PUSCH when requested
|
||||
int32_t cqi_received;
|
||||
int32_t ul_inactivity_timer;
|
||||
int32_t ul_failure_timer;
|
||||
uint32_t ue_reestablishment_reject_timer;
|
||||
|
||||
@@ -1060,6 +1060,12 @@ uint16_t mac_computeRIV(uint16_t N_RB_DL, uint16_t RBstart,
|
||||
|
||||
int get_phich_resource_times6(COMMON_channels_t * cc);
|
||||
|
||||
uint8_t frame_subframe2_dl_harq_pid(TDD_Config_t *tdd_Config, int abs_frameP, sub_frame_t subframeP);
|
||||
|
||||
uint8_t ul_subframe2_k_phich(COMMON_channels_t * cc, sub_frame_t ul_subframe);
|
||||
|
||||
unsigned char ul_ACK_subframe2M(TDD_Config_t *tdd_Config,unsigned char subframe);
|
||||
|
||||
int to_rbg(int dl_Bandwidth);
|
||||
|
||||
int to_prb(int dl_Bandwidth);
|
||||
|
||||
@@ -93,7 +93,7 @@ uint16_t ue_process_rar(const module_id_t module_idP, const int CC_id, const fra
|
||||
}
|
||||
|
||||
LOG_I(MAC,
|
||||
"[eNB %d][RAPROC] Frame %d Received RAR (%02x|%02x.%02x.%02x.%02x.%02x.%02x) for preamble %d/%d\n",
|
||||
"[UE %d][RAPROC] Frame %d Received RAR (%02x|%02x.%02x.%02x.%02x.%02x.%02x) for preamble %d/%d\n",
|
||||
module_idP, frameP, *(uint8_t *) rarh, rar[0], rar[1], rar[2],
|
||||
rar[3], rar[4], rar[5], rarh->RAPID, preamble_index);
|
||||
#ifdef DEBUG_RAR
|
||||
|
||||
@@ -860,7 +860,7 @@ pdcp_data_ind(
|
||||
|
||||
void pdcp_update_stats(const protocol_ctxt_t* const ctxt_pP){
|
||||
|
||||
uint8_t pdcp_uid = 0;
|
||||
uint16_t pdcp_uid = 0;
|
||||
uint8_t rb_id = 0;
|
||||
|
||||
// these stats are measured for both eNB and UE on per seond basis
|
||||
|
||||
@@ -500,8 +500,8 @@ rnti_t pdcp_UE_UE_module_id_to_rnti[MAX_MOBILES_PER_ENB];
|
||||
rnti_t pdcp_eNB_UE_instance_to_rnti[MAX_MOBILES_PER_ENB]; // for noS1 mode
|
||||
unsigned int pdcp_eNB_UE_instance_to_rnti_index;
|
||||
#if (RRC_VERSION >= MAKE_VERSION(10, 0, 0))
|
||||
pdcp_mbms_t pdcp_mbms_array_ue[MAX_MOBILES_PER_ENB][maxServiceCount][maxSessionPerPMCH]; // some constants from openair2/RRC/LITE/MESSAGES/asn1_constants.h
|
||||
pdcp_mbms_t pdcp_mbms_array_eNB[NUMBER_OF_eNB_MAX][maxServiceCount][maxSessionPerPMCH]; // some constants from openair2/RRC/LITE/MESSAGES/asn1_constants.h
|
||||
pdcp_mbms_t pdcp_mbms_array_ue[MAX_MOBILES_PER_ENB][maxServiceCount][maxSessionPerPMCH]; // some constants from openair2/RRC/LTE/MESSAGES/asn1_constants.h
|
||||
pdcp_mbms_t pdcp_mbms_array_eNB[NUMBER_OF_eNB_MAX][maxServiceCount][maxSessionPerPMCH]; // some constants from openair2/RRC/LTE/MESSAGES/asn1_constants.h
|
||||
#endif
|
||||
sdu_size_t pdcp_output_sdu_bytes_to_write;
|
||||
sdu_size_t pdcp_output_header_bytes_to_write;
|
||||
|
||||
@@ -161,7 +161,7 @@ boolean_t pdcp_is_rx_seq_number_valid(uint16_t seq_num, pdcp_t* pdcp_entity,srb_
|
||||
* (and to build PDCP Control PDU for PDCP status report)
|
||||
*/
|
||||
if (pdcp_mark_current_pdu_as_received(seq_num, pdcp_entity) == TRUE) {
|
||||
LOG_I(PDCP, "Received sequence number successfuly marked\n");
|
||||
LOG_D(PDCP, "Received sequence number successfuly marked\n");
|
||||
} else {
|
||||
LOG_W(PDCP, "Cannot mark received sequence number on the bitmap!\n");
|
||||
}
|
||||
|
||||
@@ -32,7 +32,6 @@
|
||||
#include "list.h"
|
||||
#include "UTIL/LOG/log.h"
|
||||
#include "UTIL/LOG/vcd_signal_dumper.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
signed int rlc_um_get_pdu_infos(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
# include "rlc_am_structs.h"
|
||||
# include "rlc_tm_structs.h"
|
||||
# include "rlc_um_structs.h"
|
||||
# include "asn1_constants.h"
|
||||
# include "asn_constant.h"
|
||||
# include "UTIL/LOG/log.h"
|
||||
# include "mem_block.h"
|
||||
//# include "PHY/defs.h"
|
||||
@@ -193,10 +193,10 @@ typedef struct rlc_mbms_id_s {
|
||||
# define maxSessionPerPMCH 1
|
||||
# endif
|
||||
#endif
|
||||
//rlc_mbms_t rlc_mbms_array_ue[MAX_MOBILES_PER_ENB][maxServiceCount][maxSessionPerPMCH]; // some constants from openair2/RRC/LITE/MESSAGES/asn1_constants.h
|
||||
//rlc_mbms_t rlc_mbms_array_eNB[NUMBER_OF_eNB_MAX][maxServiceCount][maxSessionPerPMCH]; // some constants from openair2/RRC/LITE/MESSAGES/asn1_constants.h
|
||||
rlc_mbms_id_t rlc_mbms_lcid2service_session_id_ue[MAX_MOBILES_PER_ENB][RLC_MAX_MBMS_LC]; // some constants from openair2/RRC/LITE/MESSAGES/asn1_constants.h
|
||||
rlc_mbms_id_t rlc_mbms_lcid2service_session_id_eNB[MAX_eNB][RLC_MAX_MBMS_LC]; // some constants from openair2/RRC/LITE/MESSAGES/asn1_constants.h
|
||||
//rlc_mbms_t rlc_mbms_array_ue[MAX_MOBILES_PER_ENB][maxServiceCount][maxSessionPerPMCH]; // some constants from openair2/RRC/LTE/MESSAGES/asn1_constants.h
|
||||
//rlc_mbms_t rlc_mbms_array_eNB[NUMBER_OF_eNB_MAX][maxServiceCount][maxSessionPerPMCH]; // some constants from openair2/RRC/LTE/MESSAGES/asn1_constants.h
|
||||
rlc_mbms_id_t rlc_mbms_lcid2service_session_id_ue[MAX_MOBILES_PER_ENB][RLC_MAX_MBMS_LC]; // some constants from openair2/RRC/LTE/MESSAGES/asn1_constants.h
|
||||
rlc_mbms_id_t rlc_mbms_lcid2service_session_id_eNB[MAX_eNB][RLC_MAX_MBMS_LC]; // some constants from openair2/RRC/LTE/MESSAGES/asn1_constants.h
|
||||
|
||||
#define rlc_mbms_enb_get_lcid_by_rb_id(Enb_mOD,rB_iD) rlc_mbms_rbid2lcid_eNB[Enb_mOD][rB_iD]
|
||||
;
|
||||
|
||||
@@ -99,15 +99,29 @@ void *ue_ip_interrupt(void)
|
||||
}
|
||||
#endif //NETLINK
|
||||
//---------------------------------------------------------------------------
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0))
|
||||
void ue_ip_timer(struct timer_list *t)
|
||||
#else
|
||||
void ue_ip_timer(unsigned long dataP)
|
||||
#endif
|
||||
{
|
||||
//---------------------------------------------------------------------------
|
||||
ue_ip_priv_t *priv_p=(ue_ip_priv_t *)dataP;
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0))
|
||||
ue_ip_priv_t *priv_p = from_timer(priv_p, t, timer);
|
||||
#else
|
||||
ue_ip_priv_t *priv_p = (ue_ip_priv_t *)dataP;
|
||||
#endif
|
||||
|
||||
spin_lock(&priv_p->lock);
|
||||
(priv_p->timer).function=ue_ip_timer;
|
||||
(priv_p->timer).expires=jiffies+UE_IP_TIMER_TICK;
|
||||
(priv_p->timer).data=dataP;
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0))
|
||||
mod_timer(&priv_p->timer, jiffies + UE_IP_TIMER_TICK);
|
||||
#else
|
||||
(priv_p->timer).function = ue_ip_timer;
|
||||
(priv_p->timer).expires = jiffies + UE_IP_TIMER_TICK;
|
||||
(priv_p->timer).data = dataP;
|
||||
add_timer(&priv_p->timer);
|
||||
#endif
|
||||
|
||||
spin_unlock(&priv_p->lock);
|
||||
return;
|
||||
// add_timer(&gpriv->timer);
|
||||
@@ -137,10 +151,15 @@ int ue_ip_open(struct net_device *dev_pP)
|
||||
netif_wake_queue(dev_pP);
|
||||
}
|
||||
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0))
|
||||
timer_setup(&(priv_p->timer), ue_ip_timer, 0);
|
||||
(priv_p->timer).expires = jiffies+UE_IP_TIMER_TICK;
|
||||
#else
|
||||
init_timer(&priv_p->timer);
|
||||
(priv_p->timer).expires = jiffies+UE_IP_TIMER_TICK;
|
||||
(priv_p->timer).data = (unsigned long)priv_p;
|
||||
(priv_p->timer).function = ue_ip_timer;
|
||||
#endif
|
||||
//add_timer(&priv_p->timer);
|
||||
|
||||
printk("[UE_IP_DRV][%s] name = %s\n", __FUNCTION__, dev_pP->name);
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
#ifdef CELLULAR
|
||||
#include "rrc_L2_proto.h"
|
||||
#else
|
||||
#include "RRC/LITE/defs.h"
|
||||
#include "RRC/LTE/defs.h"
|
||||
#endif //CELLULAR
|
||||
#include "COMMON/mac_rrc_primitives.h"
|
||||
#include "openair_rrc_L2_interface.h"
|
||||
|
||||
@@ -131,6 +131,7 @@ mac_rrc_data_req(
|
||||
|
||||
mib->message.systemFrameNumber.buf = &sfn;
|
||||
enc_rval = uper_encode_to_buffer(&asn_DEF_BCCH_BCH_Message,
|
||||
NULL,
|
||||
(void*)mib,
|
||||
carrier->MIB,
|
||||
24);
|
||||
|
||||
@@ -241,6 +241,7 @@ uint8_t do_MIB(rrc_eNB_carrier_data_t *carrier, uint32_t N_RB_DL, uint32_t phich
|
||||
#endif
|
||||
|
||||
enc_rval = uper_encode_to_buffer(&asn_DEF_BCCH_BCH_Message,
|
||||
NULL,
|
||||
(void*)mib,
|
||||
carrier->MIB,
|
||||
24);
|
||||
@@ -320,6 +321,7 @@ uint8_t do_MIB_SL(const protocol_ctxt_t* const ctxt_pP, const uint8_t eNB_index,
|
||||
|
||||
|
||||
enc_rval = uper_encode_to_buffer(&asn_DEF_SBCCH_SL_BCH_Message,
|
||||
NULL,
|
||||
(void*)mib_sl,
|
||||
UE_rrc_inst[ctxt_pP->module_id].MIB,
|
||||
24);
|
||||
@@ -509,6 +511,7 @@ uint8_t do_SIB1(rrc_eNB_carrier_data_t *carrier,
|
||||
xer_fprint(stdout, &asn_DEF_BCCH_DL_SCH_Message, (void*)bcch_message);
|
||||
#endif
|
||||
enc_rval = uper_encode_to_buffer(&asn_DEF_BCCH_DL_SCH_Message,
|
||||
NULL,
|
||||
(void*)bcch_message,
|
||||
buffer,
|
||||
100);
|
||||
@@ -1354,6 +1357,7 @@ uint8_t do_SIB23(uint8_t Mod_id,
|
||||
xer_fprint(stdout, &asn_DEF_BCCH_DL_SCH_Message, (void*)bcch_message);
|
||||
#endif
|
||||
enc_rval = uper_encode_to_buffer(&asn_DEF_BCCH_DL_SCH_Message,
|
||||
NULL,
|
||||
(void*)bcch_message,
|
||||
buffer,
|
||||
900);
|
||||
@@ -1442,6 +1446,7 @@ uint8_t do_RRCConnectionRequest(uint8_t Mod_id, uint8_t *buffer,uint8_t *rv)
|
||||
|
||||
|
||||
enc_rval = uper_encode_to_buffer(&asn_DEF_UL_CCCH_Message,
|
||||
NULL,
|
||||
(void*)&ul_ccch_msg,
|
||||
buffer,
|
||||
100);
|
||||
@@ -1609,6 +1614,7 @@ uint8_t do_SidelinkUEInformation(uint8_t Mod_id, uint8_t *buffer, SL_Destinatio
|
||||
|
||||
|
||||
enc_rval = uper_encode_to_buffer(&asn_DEF_UL_DCCH_Message,
|
||||
NULL,
|
||||
(void*)&ul_dcch_msg,
|
||||
buffer,
|
||||
100);
|
||||
@@ -1693,6 +1699,7 @@ uint8_t do_RRCConnectionSetupComplete(uint8_t Mod_id, uint8_t *buffer, const uin
|
||||
*/
|
||||
|
||||
enc_rval = uper_encode_to_buffer(&asn_DEF_UL_DCCH_Message,
|
||||
NULL,
|
||||
(void*)&ul_dcch_msg,
|
||||
buffer,
|
||||
100);
|
||||
@@ -1753,6 +1760,7 @@ do_RRCConnectionReconfigurationComplete(
|
||||
rrcConnectionReconfigurationComplete->criticalExtensions.choice.rrcConnectionReconfigurationComplete_r8.nonCriticalExtension=NULL;
|
||||
|
||||
enc_rval = uper_encode_to_buffer(&asn_DEF_UL_DCCH_Message,
|
||||
NULL,
|
||||
(void*)&ul_dcch_msg,
|
||||
buffer,
|
||||
100);
|
||||
@@ -2163,6 +2171,7 @@ do_RRCConnectionSetup(
|
||||
xer_fprint(stdout, &asn_DEF_DL_CCCH_Message, (void*)&dl_ccch_msg);
|
||||
#endif
|
||||
enc_rval = uper_encode_to_buffer(&asn_DEF_DL_CCCH_Message,
|
||||
NULL,
|
||||
(void*)&dl_ccch_msg,
|
||||
buffer,
|
||||
100);
|
||||
@@ -2237,6 +2246,7 @@ do_SecurityModeCommand(
|
||||
xer_fprint(stdout, &asn_DEF_DL_DCCH_Message, (void*)&dl_dcch_msg);
|
||||
#endif
|
||||
enc_rval = uper_encode_to_buffer(&asn_DEF_DL_DCCH_Message,
|
||||
NULL,
|
||||
(void*)&dl_dcch_msg,
|
||||
buffer,
|
||||
100);
|
||||
@@ -2316,6 +2326,7 @@ do_UECapabilityEnquiry(
|
||||
xer_fprint(stdout, &asn_DEF_DL_DCCH_Message, (void*)&dl_dcch_msg);
|
||||
#endif
|
||||
enc_rval = uper_encode_to_buffer(&asn_DEF_DL_DCCH_Message,
|
||||
NULL,
|
||||
(void*)&dl_dcch_msg,
|
||||
buffer,
|
||||
100);
|
||||
@@ -2520,6 +2531,7 @@ do_RRCConnectionReconfiguration(
|
||||
}
|
||||
|
||||
enc_rval = uper_encode_to_buffer(&asn_DEF_DL_DCCH_Message,
|
||||
NULL,
|
||||
(void*)&dl_dcch_msg,
|
||||
buffer,
|
||||
RRC_BUF_SIZE);
|
||||
@@ -2736,6 +2748,7 @@ do_RRCConnectionReestablishment(
|
||||
xer_fprint(stdout, &asn_DEF_DL_CCCH_Message, (void*)&dl_ccch_msg);
|
||||
#endif
|
||||
enc_rval = uper_encode_to_buffer(&asn_DEF_DL_CCCH_Message,
|
||||
NULL,
|
||||
(void*)&dl_ccch_msg,
|
||||
buffer,
|
||||
100);
|
||||
@@ -2797,6 +2810,7 @@ do_RRCConnectionReestablishmentReject(
|
||||
xer_fprint(stdout, &asn_DEF_DL_CCCH_Message, (void*)&dl_ccch_msg);
|
||||
#endif
|
||||
enc_rval = uper_encode_to_buffer(&asn_DEF_DL_CCCH_Message,
|
||||
NULL,
|
||||
(void*)&dl_ccch_msg,
|
||||
buffer,
|
||||
100);
|
||||
@@ -2859,6 +2873,7 @@ do_RRCConnectionReject(
|
||||
xer_fprint(stdout, &asn_DEF_DL_CCCH_Message, (void*)&dl_ccch_msg);
|
||||
#endif
|
||||
enc_rval = uper_encode_to_buffer(&asn_DEF_DL_CCCH_Message,
|
||||
NULL,
|
||||
(void*)&dl_ccch_msg,
|
||||
buffer,
|
||||
100);
|
||||
@@ -2924,6 +2939,7 @@ uint8_t do_RRCConnectionRelease(
|
||||
sizeof(*rrcConnectionRelease->criticalExtensions.choice.c1.choice.rrcConnectionRelease_r8.nonCriticalExtension));
|
||||
|
||||
enc_rval = uper_encode_to_buffer(&asn_DEF_DL_DCCH_Message,
|
||||
NULL,
|
||||
(void*)&dl_dcch_msg,
|
||||
buffer,
|
||||
RRC_BUF_SIZE);
|
||||
@@ -3051,6 +3067,7 @@ uint8_t do_MBSFNAreaConfig(uint8_t Mod_id,
|
||||
xer_fprint(stdout,&asn_DEF_MCCH_Message,(void*)mcch_message);
|
||||
#endif
|
||||
enc_rval = uper_encode_to_buffer(&asn_DEF_MCCH_Message,
|
||||
NULL,
|
||||
(void*)mcch_message,
|
||||
buffer,
|
||||
100);
|
||||
@@ -3183,6 +3200,7 @@ uint8_t do_MeasurementReport(uint8_t Mod_id, uint8_t *buffer,int measid,int phy_
|
||||
measurementReport->criticalExtensions.choice.c1.choice.measurementReport_r8.measResults.measResultNeighCells->choice.measResultListEUTRA=*(measResultListEUTRA2);
|
||||
|
||||
enc_rval = uper_encode_to_buffer(&asn_DEF_UL_DCCH_Message,
|
||||
NULL,
|
||||
(void*)&ul_dcch_msg,
|
||||
buffer,
|
||||
100);
|
||||
@@ -3316,7 +3334,7 @@ uint8_t do_Paging(uint8_t Mod_id, uint8_t *buffer, ue_paging_identity_t ue_pagin
|
||||
LOG_D(RRC, "[eNB %d] do_Paging paging_record: cn_Domain %ld, ue_paging_identity.presenceMask %d, PagingRecordList.count %d\n",
|
||||
Mod_id, paging_record_p->cn_Domain, ue_paging_identity.presenceMask, pcch_msg.message.choice.c1.choice.paging.pagingRecordList->list.count);
|
||||
|
||||
enc_rval = uper_encode_to_buffer(&asn_DEF_PCCH_Message, (void*)&pcch_msg, buffer, RRC_BUF_SIZE);
|
||||
enc_rval = uper_encode_to_buffer(&asn_DEF_PCCH_Message, NULL, (void*)&pcch_msg, buffer, RRC_BUF_SIZE);
|
||||
if(enc_rval.encoded == -1)
|
||||
{
|
||||
LOG_I(RRC, "[eNB AssertFatal]ASN1 message encoding failed (%s, %lu)!\n",
|
||||
@@ -3492,6 +3510,7 @@ OAI_UECapability_t *fill_ue_capability(char *UE_EUTRA_Capability_xer_fname)
|
||||
xer_fprint(stdout,&asn_DEF_UE_EUTRA_Capability,(void *)UE_EUTRA_Capability);
|
||||
#endif
|
||||
enc_rval = uper_encode_to_buffer(&asn_DEF_UE_EUTRA_Capability,
|
||||
NULL,
|
||||
(void*)UE_EUTRA_Capability,
|
||||
&UECapability.sdu[0],
|
||||
MAX_UE_CAPABILITY_SIZE);
|
||||
|
||||
@@ -131,6 +131,7 @@ uint8_t do_MIB_NB_IoT(
|
||||
(uint32_t)hsfn_LSB);
|
||||
|
||||
enc_rval = uper_encode_to_buffer(&asn_DEF_BCCH_BCH_Message_NB,
|
||||
NULL,
|
||||
(void*)mib_NB_IoT,
|
||||
carrier->MIB_NB_IoT,
|
||||
100);
|
||||
@@ -387,6 +388,7 @@ uint8_t do_SIB1_NB_IoT(uint8_t Mod_id, int CC_id,
|
||||
|
||||
|
||||
enc_rval = uper_encode_to_buffer(&asn_DEF_BCCH_DL_SCH_Message_NB,
|
||||
NULL,
|
||||
(void*)bcch_message,
|
||||
carrier->SIB1_NB_IoT,
|
||||
100);
|
||||
@@ -669,6 +671,7 @@ uint8_t do_SIB23_NB_IoT(uint8_t Mod_id,
|
||||
xer_fprint(stdout, &asn_DEF_BCCH_DL_SCH_Message_NB, (void*)bcch_message);
|
||||
#endif
|
||||
enc_rval = uper_encode_to_buffer(&asn_DEF_BCCH_DL_SCH_Message_NB,
|
||||
NULL,
|
||||
(void*)bcch_message,
|
||||
carrier->SIB23_NB_IoT,
|
||||
900);
|
||||
@@ -888,6 +891,7 @@ uint8_t do_RRCConnectionSetup_NB_IoT(
|
||||
xer_fprint(stdout, &asn_DEF_DL_CCCH_Message, (void*)&dl_ccch_msg);
|
||||
#endif
|
||||
enc_rval = uper_encode_to_buffer(&asn_DEF_DL_CCCH_Message_NB,
|
||||
NULL,
|
||||
(void*)&dl_ccch_msg_NB_IoT,
|
||||
buffer,
|
||||
100);
|
||||
@@ -939,6 +943,7 @@ uint8_t do_SecurityModeCommand_NB_IoT(
|
||||
xer_fprint(stdout, &asn_DEF_DL_DCCH_Message_NB, (void*)&dl_dcch_msg_NB_IoT);
|
||||
#endif
|
||||
enc_rval = uper_encode_to_buffer(&asn_DEF_DL_DCCH_Message_NB,
|
||||
NULL,
|
||||
(void*)&dl_dcch_msg_NB_IoT,
|
||||
buffer,
|
||||
100);
|
||||
@@ -1000,6 +1005,7 @@ uint8_t do_UECapabilityEnquiry_NB_IoT(
|
||||
xer_fprint(stdout, &asn_DEF_DL_DCCH_Message_NB, (void*)&dl_dcch_msg_NB_IoT);
|
||||
#endif
|
||||
enc_rval = uper_encode_to_buffer(&asn_DEF_DL_DCCH_Message_NB,
|
||||
NULL,
|
||||
(void*)&dl_dcch_msg_NB_IoT,
|
||||
buffer,
|
||||
100);
|
||||
@@ -1094,6 +1100,7 @@ uint16_t do_RRCConnectionReconfiguration_NB_IoT(
|
||||
rrcConnectionReconfiguration_NB->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r13.fullConfig_r13 = NULL;
|
||||
|
||||
enc_rval = uper_encode_to_buffer(&asn_DEF_DL_DCCH_Message_NB,
|
||||
NULL,
|
||||
(void*)&dl_dcch_msg_NB_IoT,
|
||||
buffer,
|
||||
RRC_BUF_SIZE);
|
||||
@@ -1140,6 +1147,7 @@ uint8_t do_RRCConnectionReestablishmentReject_NB_IoT(
|
||||
xer_fprint(stdout, &asn_DEF_DL_CCCH_Message_NB, (void*)&dl_ccch_msg_NB_IoT);
|
||||
#endif
|
||||
enc_rval = uper_encode_to_buffer(&asn_DEF_DL_CCCH_Message_NB,
|
||||
NULL,
|
||||
(void*)&dl_ccch_msg_NB_IoT,
|
||||
buffer,
|
||||
100);
|
||||
@@ -1210,6 +1218,7 @@ uint8_t do_RRCConnectionReject_NB_IoT(
|
||||
xer_fprint(stdout, &asn_DEF_DL_CCCH_Message_NB, (void*)&dl_ccch_msg);
|
||||
#endif
|
||||
enc_rval = uper_encode_to_buffer(&asn_DEF_DL_CCCH_Message_NB,
|
||||
NULL,
|
||||
(void*)&dl_ccch_msg_NB_IoT,
|
||||
buffer,
|
||||
100);
|
||||
@@ -1336,6 +1345,7 @@ uint8_t do_RRCConnectionReestablishment_NB_IoT(
|
||||
rrcConnectionReestablishment_NB_IoT->criticalExtensions.choice.c1.choice.rrcConnectionReestablishment_r13.nextHopChainingCount_r13=0;
|
||||
|
||||
enc_rval = uper_encode_to_buffer(&asn_DEF_DL_CCCH_Message_NB,
|
||||
NULL,
|
||||
(void*)&dl_ccch_msg_NB_IoT,
|
||||
buffer,
|
||||
RRC_BUF_SIZE);
|
||||
@@ -1405,6 +1415,7 @@ uint8_t do_RRCConnectionRelease_NB_IoT(
|
||||
sizeof(*rrcConnectionRelease_NB_IoT->criticalExtensions.choice.c1.choice.rrcConnectionRelease_r13.nonCriticalExtension));
|
||||
|
||||
enc_rval = uper_encode_to_buffer(&asn_DEF_DL_DCCH_Message_NB,
|
||||
NULL,
|
||||
(void*)&dl_dcch_msg_NB_IoT,
|
||||
buffer,
|
||||
RRC_BUF_SIZE);//check
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
#include <asn_internal.h> /* for _ASN_DEFAULT_STACK_MAX */
|
||||
|
||||
|
||||
#include "RRC/LITE/defs_NB_IoT.h"
|
||||
#include "RRC/LTE/defs_NB_IoT.h"
|
||||
|
||||
/*
|
||||
* The variant of the above function which dumps the BASIC-XER (XER_F_BASIC)
|
||||
|
||||
+4978
File diff suppressed because it is too large
Load Diff
+5979
File diff suppressed because it is too large
Load Diff
+7775
File diff suppressed because it is too large
Load Diff
+11905
File diff suppressed because it is too large
Load Diff
+14042
File diff suppressed because it is too large
Load Diff
+14278
File diff suppressed because it is too large
Load Diff
+14414
File diff suppressed because it is too large
Load Diff
+14695
File diff suppressed because it is too large
Load Diff
+14828
File diff suppressed because it is too large
Load Diff
+14834
File diff suppressed because it is too large
Load Diff
+2905
File diff suppressed because it is too large
Load Diff
+3787
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user