Merge remote-tracking branch 'origin/tm4-fixes' into develop_integration_w07
Conflicts: openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c openair1/PHY/LTE_TRANSPORT/power_control.c openair2/LAYER2/MAC/eNB_scheduler_dlsch.c targets/SIMU/USER/oaisim_functions.c
This commit is contained in:
@@ -114,6 +114,7 @@ endmacro(add_list_string_option)
|
||||
####################################################
|
||||
# compilation flags
|
||||
#############################################
|
||||
|
||||
#set(CMAKE_BUILD_TYPE "Debug")
|
||||
if (CMAKE_BUILD_TYPE STREQUAL "")
|
||||
set(CMAKE_BUILD_TYPE "RelWithDebInfo")
|
||||
@@ -170,7 +171,7 @@ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-rpath -Wl,${CMAKE_CU
|
||||
# these changes are related to hardcoded path to include .h files
|
||||
add_definitions(-DCMAKER)
|
||||
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS} -g -DMALLOC_CHECK_=3")
|
||||
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS} -g -DMALLOC_CHECK_=3 -O2")
|
||||
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS} -g -DMALLOC_CHECK_=3 -O2")
|
||||
|
||||
|
||||
set(GIT_BRANCH "UNKNOWN")
|
||||
@@ -195,7 +196,7 @@ if(GIT_FOUND)
|
||||
OUTPUT_VARIABLE GIT_COMMIT_HASH
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
|
||||
|
||||
# Get the latest commit date of the working branch
|
||||
execute_process(
|
||||
COMMAND git log -1 --format=%cd
|
||||
@@ -223,9 +224,9 @@ add_boolean_option(DISABLE_XER_PRINT False "print XER Format")
|
||||
add_boolean_option(XER_PRINT False "print XER Format")
|
||||
add_boolean_option(RRC_MSG_PRINT False "print RRC messages")
|
||||
add_boolean_option(PDCP_MSG_PRINT False "print PDCP messages to /tmp/pdcp.log")
|
||||
add_boolean_option(DEBUG_PDCP_PAYLOAD False "print PDCP PDU to stdout") # if true, make sure that global and PDCP log levels are trace
|
||||
add_boolean_option(DEBUG_MAC_INTERFACE False "print MAC-RLC PDU exchange to stdout") # if true, make sure that global and PDCP log levels are trace
|
||||
add_boolean_option(TRACE_RLC_PAYLOAD False "print RLC PDU to stdout") # if true, make sure that global and PDCP log levels are trace
|
||||
add_boolean_option(DEBUG_PDCP_PAYLOAD False "print PDCP PDU to stdout") # if true, make sure that global and PDCP log levels are trace
|
||||
add_boolean_option(DEBUG_MAC_INTERFACE False "print MAC-RLC PDU exchange to stdout") # if true, make sure that global and PDCP log levels are trace
|
||||
add_boolean_option(TRACE_RLC_PAYLOAD False "print RLC PDU to stdout") # if true, make sure that global and PDCP log levels are trace
|
||||
add_boolean_option(TEST_OMG False "???")
|
||||
add_boolean_option(DEBUG_OMG False "???")
|
||||
add_boolean_option(XFORMS False "This adds the possibility to see the signal oscilloscope")
|
||||
@@ -486,7 +487,7 @@ add_list2_option(TRANSP_PRO "None" "Transport protocol type" "None" "ETHERNET")
|
||||
include_directories("${OPENAIR_TARGETS}/ARCH/EXMIMO/USERSPACE/LIB/")
|
||||
include_directories ("${OPENAIR_TARGETS}/ARCH/EXMIMO/DEFS/")
|
||||
#set (option_HWEXMIMOLIB_lib "-l ")
|
||||
set(HWLIB_EXMIMO_SOURCE
|
||||
set(HWLIB_EXMIMO_SOURCE
|
||||
${OPENAIR_TARGETS}/ARCH/EXMIMO/USERSPACE/LIB/openair0_lib.c
|
||||
# ${OPENAIR_TARGETS}/ARCH/EXMIMO/USERSPACE/LIB/gain_control.c
|
||||
)
|
||||
@@ -494,27 +495,27 @@ add_library(oai_exmimodevif MODULE ${HWLIB_EXMIMO_SOURCE} )
|
||||
|
||||
include_directories("${OPENAIR_TARGETS}/ARCH/USRP/USERSPACE/LIB/")
|
||||
set (option_HWUSRPLIB_lib "-l uhd")
|
||||
set(HWLIB_USRP_SOURCE
|
||||
set(HWLIB_USRP_SOURCE
|
||||
${OPENAIR_TARGETS}/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp
|
||||
)
|
||||
add_library(oai_usrpdevif MODULE ${HWLIB_USRP_SOURCE} )
|
||||
|
||||
include_directories("${OPENAIR_TARGETS}/ARCH/BLADERF/USERSPACE/LIB/")
|
||||
set (option_HWBLADERFLIB_lib "-l bladerf")
|
||||
set(HWLIB_BLADERF_SOURCE
|
||||
set(HWLIB_BLADERF_SOURCE
|
||||
${OPENAIR_TARGETS}/ARCH/BLADERF/USERSPACE/LIB/bladerf_lib.c
|
||||
)
|
||||
add_library(oai_bladerfdevif MODULE ${HWLIB_BLADERF_SOURCE} )
|
||||
|
||||
include_directories("${OPENAIR_TARGETS}/ARCH/LMSSDR/USERSPACE/LIB/")
|
||||
|
||||
set(HWLIB_LMSSDR_SOURCE
|
||||
set(HWLIB_LMSSDR_SOURCE
|
||||
${OPENAIR_TARGETS}/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp
|
||||
)
|
||||
add_library(oai_lmssdrdevif MODULE ${HWLIB_LMSSDR_SOURCE} )
|
||||
|
||||
include_directories("${OPENAIR_TARGETS}/ARCH/ETHERNET/USERSPACE/LIB/")
|
||||
set(TPLIB_ETHERNET_SOURCE
|
||||
set(TPLIB_ETHERNET_SOURCE
|
||||
${OPENAIR_TARGETS}/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.c
|
||||
${OPENAIR_TARGETS}/ARCH/ETHERNET/USERSPACE/LIB/eth_udp.c
|
||||
${OPENAIR_TARGETS}/ARCH/ETHERNET/USERSPACE/LIB/eth_raw.c
|
||||
@@ -569,12 +570,12 @@ elseif (${RF_BOARD} STREQUAL "CPRIGW")
|
||||
)
|
||||
include_directories("${OPENAIR_TARGETS}/ARCH/CPRIGW/USERSPACE/LIB/")
|
||||
set(option_HW_lib "-rdynamic dl")
|
||||
|
||||
|
||||
endif (${RF_BOARD} STREQUAL "EXMIMO")
|
||||
|
||||
|
||||
if (${TRANSP_PRO} STREQUAL "ETHERNET")
|
||||
|
||||
|
||||
include_directories ("${OPENAIR_TARGETS}/ARCH/ETHERNET/USERSPACE/LIB")
|
||||
set(TRANSPORT_SOURCE ${TRANSPORT_SOURCE}
|
||||
${OPENAIR_TARGETS}/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.c
|
||||
@@ -583,7 +584,7 @@ if (${TRANSP_PRO} STREQUAL "ETHERNET")
|
||||
)
|
||||
set(option_TP_lib "-rdynamic -ldl")
|
||||
|
||||
|
||||
|
||||
endif (${TRANSP_PRO} STREQUAL "ETHERNET")
|
||||
##########################################################
|
||||
|
||||
@@ -837,13 +838,13 @@ include_directories("${OPENAIR_DIR}")
|
||||
if (FLEXRAN_AGENT_SB_IF)
|
||||
# set the version of protobuf messages, V3 not supported yet
|
||||
add_list1_option(FLPT_VERSION V2 "FLPT MSG protobuf grammar version" V2 V3)
|
||||
|
||||
|
||||
if (${FLPT_VERSION} STREQUAL "V2")
|
||||
set (FLPTDIR V2)
|
||||
elseif (${FLPT_VERSION} STREQUAL "V3")
|
||||
set (FLPTDIR V3)
|
||||
endif(${FLPT_VERSION} STREQUAL "V2")
|
||||
|
||||
|
||||
set(FLPT_MSG_DIR ${OPENAIR2_DIR}/ENB_APP/MESSAGES/${FLPTDIR} )
|
||||
set(FLPT_MSG_FILES
|
||||
${FLPT_MSG_DIR}/header.proto
|
||||
@@ -874,10 +875,10 @@ if (FLEXRAN_AGENT_SB_IF)
|
||||
${FLPT_C_DIR}/config_common.pb-c.c
|
||||
${FLPT_C_DIR}/control_delegation.pb-c.c
|
||||
)
|
||||
|
||||
|
||||
file(GLOB flpt_h ${FLPT_C_DIR}/*.h)
|
||||
set(flpt_h ${flpt_h} )
|
||||
|
||||
|
||||
add_library(FLPT_MSG
|
||||
${FLPT_OAI_generated}
|
||||
${FLPT_source}
|
||||
@@ -908,12 +909,12 @@ if (FLEXRAN_AGENT_SB_IF)
|
||||
)
|
||||
set(FLEXRAN_AGENT_LIB FLEXRAN_AGENT)
|
||||
#include_directories(${OPENAIR2_DIR}/ENB_APP)
|
||||
|
||||
|
||||
set(PROTOBUF_LIB "protobuf-c")
|
||||
|
||||
|
||||
FIND_PATH(LIBYAML_INCLUDE_DIR NAMES yaml.h)
|
||||
FIND_LIBRARY(LIBYAML_LIBRARIES NAMES yaml libyaml)
|
||||
|
||||
|
||||
INCLUDE(FindPackageHandleStandardArgs)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Yaml DEFAULT_MSG LIBYAML_LIBRARIES LIBYAML_INCLUDE_DIR)
|
||||
MARK_AS_ADVANCED(LIBYAML_INCLUDE_DIR LIBYAML_LIBRARIES)
|
||||
@@ -929,9 +930,9 @@ add_library(HASHTABLE
|
||||
include_directories(${OPENAIR_DIR}/common/utils/hashtable)
|
||||
|
||||
if (MESSAGE_CHART_GENERATOR)
|
||||
add_library(MSC
|
||||
add_library(MSC
|
||||
${OPENAIR_DIR}/common/utils/msc/msc.c
|
||||
)
|
||||
)
|
||||
set(MSC_LIB MSC)
|
||||
endif()
|
||||
include_directories(${OPENAIR_DIR}/common/utils/msc)
|
||||
@@ -1008,7 +1009,7 @@ add_library(SECU_CN ${SECU_CN_SRC})
|
||||
|
||||
# Scheduler
|
||||
################################"
|
||||
set(SCHED_SRC
|
||||
set(SCHED_SRC
|
||||
${OPENAIR1_DIR}/SCHED/phy_procedures_lte_eNb.c
|
||||
${OPENAIR1_DIR}/SCHED/phy_procedures_lte_ue.c
|
||||
${OPENAIR1_DIR}/SCHED/phy_procedures_lte_common.c
|
||||
@@ -1100,6 +1101,7 @@ set(PHY_SRC
|
||||
${OPENAIR1_DIR}/PHY/INIT/lte_parms.c
|
||||
${OPENAIR1_DIR}/PHY/INIT/lte_param_init.c
|
||||
${OPENAIR1_DIR}/PHY/TOOLS/file_output.c
|
||||
${OPENAIR1_DIR}/PHY/TOOLS/cadd_vv.c
|
||||
${OPENAIR1_DIR}/PHY/TOOLS/lte_dfts.c
|
||||
${OPENAIR1_DIR}/PHY/TOOLS/log2_approx.c
|
||||
${OPENAIR1_DIR}/PHY/TOOLS/cmult_sv.c
|
||||
@@ -1301,7 +1303,7 @@ set(libnas_api_OBJS
|
||||
${NAS_SRC}COMMON/API/NETWORK/nas_message.c
|
||||
${NAS_SRC}COMMON/API/NETWORK/network_api.c
|
||||
)
|
||||
|
||||
|
||||
set(libnas_emm_msg_OBJS
|
||||
${NAS_SRC}COMMON/EMM/MSG/AttachAccept.c
|
||||
${NAS_SRC}COMMON/EMM/MSG/AttachComplete.c
|
||||
@@ -1334,7 +1336,7 @@ set(libnas_emm_msg_OBJS
|
||||
${NAS_SRC}COMMON/EMM/MSG/TrackingAreaUpdateRequest.c
|
||||
${NAS_SRC}COMMON/EMM/MSG/UplinkNasTransport.c
|
||||
)
|
||||
|
||||
|
||||
set(libnas_esm_msg_OBJS
|
||||
${NAS_SRC}COMMON/ESM/MSG/ActivateDedicatedEpsBearerContextAccept.c
|
||||
${NAS_SRC}COMMON/ESM/MSG/ActivateDedicatedEpsBearerContextReject.c
|
||||
@@ -1454,7 +1456,7 @@ set (libnas_utils_OBJS
|
||||
${NAS_SRC}COMMON/UTIL/OctetString.c
|
||||
)
|
||||
|
||||
if(NAS_UE)
|
||||
if(NAS_UE)
|
||||
set(libnas_ue_api_OBJS
|
||||
${NAS_SRC}UE/API/USER/at_command.c
|
||||
${NAS_SRC}UE/API/USER/at_error.c
|
||||
@@ -1759,7 +1761,7 @@ add_executable(lte-softmodem
|
||||
${OPENAIR3_DIR}/NAS/UE/nas_ue_task.c
|
||||
${GTPU_need_ITTI}
|
||||
${HW_SOURCE}
|
||||
${TRANSPORT_SOURCE}
|
||||
${TRANSPORT_SOURCE}
|
||||
${RTAI_SOURCE}
|
||||
${XFORMS_SOURCE}
|
||||
${XFORMS_SOURCE_SOFTMODEM}
|
||||
@@ -1794,7 +1796,7 @@ add_executable(lte-softmodem-nos1
|
||||
${OPENAIR2_DIR}/RRC/NAS/rb_config.c
|
||||
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/netlink_init.c
|
||||
${HW_SOURCE}
|
||||
${TRANSPORT_SOURCE}
|
||||
${TRANSPORT_SOURCE}
|
||||
${RTAI_SOURCE}
|
||||
${XFORMS_SOURCE}
|
||||
${XFORMS_SOURCE_SOFTMODEM}
|
||||
@@ -1818,15 +1820,15 @@ add_executable(rrh_gw
|
||||
${OPENAIR_TARGETS}/RT/USER/eNB_transport_IQ.c
|
||||
${OPENAIR_TARGETS}/RT/USER/UE_transport_IQ.c
|
||||
${OPENAIR_TARGETS}/RT/USER/rt_wrapper.c
|
||||
${OPENAIR_TARGETS}/ARCH/COMMON/common_lib.c
|
||||
${OPENAIR_TARGETS}/ARCH/COMMON/common_lib.c
|
||||
${HW_SOURCE}
|
||||
${TRANSPORT_SOURCE}
|
||||
${TRANSPORT_SOURCE}
|
||||
${T_SOURCE}
|
||||
)
|
||||
target_include_directories(rrh_gw PRIVATE ${OPENAIR_DIR}/common/utils/itti)
|
||||
target_link_libraries(rrh_gw
|
||||
-Wl,--start-group
|
||||
UTIL LFDS
|
||||
UTIL LFDS
|
||||
-Wl,--end-group )
|
||||
target_link_libraries (rrh_gw rt pthread m )
|
||||
target_link_libraries (rrh_gw ${option_HW_lib} ${option_TP_lib})
|
||||
@@ -1890,7 +1892,7 @@ add_executable(oaisim
|
||||
${GTPU_need_ITTI}
|
||||
${OPENAIR_TARGETS}/COMMON/create_tasks.c
|
||||
${HW_SOURCE}
|
||||
${TRANSPORT_SOURCE}
|
||||
${TRANSPORT_SOURCE}
|
||||
${XFORMS_SOURCE}
|
||||
${T_SOURCE}
|
||||
)
|
||||
@@ -1934,7 +1936,7 @@ add_executable(oaisim_nos1
|
||||
${OPENAIR2_DIR}/RRC/NAS/rb_config.c
|
||||
${OPENAIR_TARGETS}/COMMON/create_tasks.c
|
||||
${HW_SOURCE}
|
||||
${TRANSPORT_SOURCE}
|
||||
${TRANSPORT_SOURCE}
|
||||
${XFORMS_SOURCE}
|
||||
${T_SOURCE}
|
||||
)
|
||||
@@ -1958,7 +1960,20 @@ 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}
|
||||
)
|
||||
target_link_libraries (dlsim_tm4
|
||||
-Wl,--start-group SIMU UTIL SCHED_LIB PHY LFDS ${ITTI_LIB} -Wl,--end-group
|
||||
pthread m rt ${CONFIG_LIBRARIES} ${ATLAS_LIBRARIES} ${XFORMS_LIBRARIES} ${T_LIB}
|
||||
)
|
||||
|
||||
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
|
||||
@@ -1983,7 +1998,7 @@ add_executable(test_epc_generate_scenario
|
||||
${OPENAIR_BIN_DIR}/messages_xml.h
|
||||
)
|
||||
target_link_libraries (test_epc_generate_scenario
|
||||
-Wl,--start-group RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB GTPV1U LIB_NAS_UE SECU_CN UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB PHY LFDS ${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}
|
||||
-Wl,--start-group RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB GTPV1U LIB_NAS_UE SECU_CN UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB PHY LFDS ${ITTI_LIB} ${MSC_LIB} L2 -Wl,--end-group pthread m rt crypt sctp ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} ${CONFIG_LIBRARIES}
|
||||
)
|
||||
|
||||
add_executable(test_epc_play_scenario
|
||||
@@ -2004,7 +2019,7 @@ add_executable(test_epc_play_scenario
|
||||
)
|
||||
target_include_directories(test_epc_play_scenario PUBLIC /usr/local/share/asn1c)
|
||||
target_link_libraries (test_epc_play_scenario
|
||||
-Wl,--start-group RRC_LIB S1AP_LIB X2AP_LIB GTPV1U LIB_NAS_UE SECU_CN UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB PHY LFDS ${ITTI_LIB} ${MSC_LIB} -Wl,--end-group pthread m rt crypt sctp ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} ${CONFIG_LIBRARIES}
|
||||
-Wl,--start-group RRC_LIB S1AP_LIB X2AP_LIB GTPV1U LIB_NAS_UE SECU_CN UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB PHY LFDS ${ITTI_LIB} ${MSC_LIB} -Wl,--end-group pthread m rt crypt sctp ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} ${CONFIG_LIBRARIES}
|
||||
)
|
||||
|
||||
|
||||
@@ -2024,7 +2039,7 @@ foreach(myExe s1ap
|
||||
${OPENAIR3_DIR}/TEST/test_${myExe}.c
|
||||
)
|
||||
target_link_libraries (test_${myExe}
|
||||
-Wl,--start-group SECU_CN UTIL LFDS -Wl,--end-group m rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} ${CONFIG_LIBRARIES}
|
||||
-Wl,--start-group SECU_CN UTIL LFDS -Wl,--end-group m rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} ${CONFIG_LIBRARIES}
|
||||
)
|
||||
endforeach(myExe)
|
||||
|
||||
@@ -2040,6 +2055,7 @@ if (${T_TRACER})
|
||||
add_dependencies(oaisim generate_T)
|
||||
add_dependencies(oaisim_nos1 generate_T)
|
||||
add_dependencies(dlsim generate_T)
|
||||
add_dependencies(dlsim_tm4 generate_T)
|
||||
add_dependencies(dlsim_tm7 generate_T)
|
||||
add_dependencies(ulsim generate_T)
|
||||
add_dependencies(pbchsim generate_T)
|
||||
@@ -2187,16 +2203,16 @@ make_driver(ue_ip ${OPENAIR2_DIR}/NETWORK_DRIVER/UE_IP ${ue_ip_src})
|
||||
# OCTAVE tools
|
||||
###############
|
||||
set(OCT_INCL -I${OPENAIR_TARGETS}/ARCH/EXMIMO/DEFS -I${OPENAIR_TARGETS}/ARCH/EXMIMO/USERSPACE/LIB -I${OPENAIR_TARGETS}/ARCH/COMMON)
|
||||
set(OCT_LIBS -L${CMAKE_CURRENT_BINARY_DIR} -lm -lOPENAIR0_LIB)
|
||||
set(OCT_LIBS -L${CMAKE_CURRENT_BINARY_DIR} -lm -lOPENAIR0_LIB)
|
||||
set(OCT_FLAGS -DEXMIMO)
|
||||
set(OCT_DIR ${OPENAIR_TARGETS}/ARCH/EXMIMO/USERSPACE/OCTAVE)
|
||||
set(OCT_FILES
|
||||
oarf_config_exmimo.oct
|
||||
oarf_config_exmimo.oct
|
||||
oarf_get_frame.oct
|
||||
oarf_stop.oct
|
||||
oarf_send_frame.oct
|
||||
oarf_get_num_detected_cards.oct
|
||||
oarf_config_exmimo.oct
|
||||
oarf_get_frame.oct
|
||||
oarf_stop.oct
|
||||
oarf_send_frame.oct
|
||||
oarf_get_num_detected_cards.oct
|
||||
oarf_stop_without_reset.oct
|
||||
)
|
||||
|
||||
@@ -2206,7 +2222,7 @@ foreach(file IN ITEMS ${OCT_FILES})
|
||||
OUTPUT ${file}
|
||||
DEPENDS ${OCT_DIR}/${src} OPENAIR0_LIB
|
||||
COMMAND mkoctfile
|
||||
ARGS ${OCT_FLAGS} ${OCT_INCL} ${OCT_LIBS}
|
||||
ARGS ${OCT_FLAGS} ${OCT_INCL} ${OCT_LIBS}
|
||||
ARGS -o ${file} ${OCT_DIR}/${src}
|
||||
COMMENT "Generating ${file}"
|
||||
VERBATIM
|
||||
|
||||
@@ -101,6 +101,19 @@ Obj.# Case# Test# Description
|
||||
01 51 04 pdcchsim (TBD)
|
||||
01 51 05 pbchsim (TBD)
|
||||
01 51 06 mbmssim (TBD)
|
||||
01 51 10 dlsim_tm4 test cases (Test 1: 10 MHz, R2.FDD (MCS 5), EVA5, -1dB),
|
||||
(Test 5: 1.4 MHz, R4.FDD (MCS 4), EVA5, 0dB (70%)),
|
||||
(Test 6: 10 MHz, R3.FDD (MCS 15), EVA5, 6.7dB (70%)),
|
||||
(Test 6b: 5 MHz, R3-1.FDD (MCS 15), EVA5, 6.7dB (70%)),
|
||||
(Test 7: 5 MHz, R3-1.FDD (MCS 15), EVA5, 6.7dB (30%)),
|
||||
(Test 7b: 5 MHz, R3-1.FDD (MCS 15), ETU70, 1.4 dB (30%)),
|
||||
(Test 10: 5 MHz, R6.FDD (MCS 25), EVA5, 17.4 dB (70%)),
|
||||
(Test 10b: 5 MHz, R6-1.FDD (MCS 24,18 PRB), EVA5, 17.5dB (70%)),
|
||||
(Test 11: 10 MHz, R7.FDD (MCS 25), EVA5, 17.7dB (70%))
|
||||
(TM2 Test 1 10 MHz, R.11 FDD (MCS 14), EVA5, 6.8 dB (70%)),
|
||||
(TM2 Test 1b 20 MHz, R.11-2 FDD (MCS 13), EVA5, 5.9 dB (70%)),
|
||||
|
||||
|
||||
|
||||
|
||||
01 55 lte-softmodem tests with USRP B210 RF as eNB and ALU EPC w/ Bandrich COTS UE for 1TX/1RX (TM1), 2TX/2RX (TM2)
|
||||
|
||||
@@ -994,6 +994,43 @@
|
||||
<nruns>3</nruns>
|
||||
</testCase>
|
||||
|
||||
<testCase id="015110">
|
||||
<class>execution</class>
|
||||
<desc>dlsim_tm4 test cases (Test 1: 10 MHz, R2.FDD (MCS 5), EVA5, -1dB),
|
||||
(Test 5: 1.4 MHz, R4.FDD (MCS 4), EVA5, 0dB (70%)),
|
||||
(Test 6, 10 MHz, R3.FDD (MCS 15), EVA5, 6.7dB (70%)),
|
||||
(Test 6b, 5 MHz, R3-1.FDD (MCS 15), EVA5, 6.7dB (70%)),
|
||||
(Test 7, 5 MHz, R3-1.FDD (MCS 15), EVA5, 6.7dB (30%)),
|
||||
(Test 7b, 5 MHz, R3-1.FDD (MCS 15), ETU70, 1.4 dB (30%)),
|
||||
(Test 10, 5 MHz, R6.FDD (MCS 25), EVA5, 17.4 dB (70%)),
|
||||
(Test 10b, 5 MHz, R6-1.FDD (MCS 24,18 PRB), EVA5, 17.5dB (70%)),
|
||||
(Test 11, 10 MHz, R7.FDD (MCS 25), EVA5, 17.7dB (70%))
|
||||
(TM2 Test 1 10 MHz, R.11 FDD (MCS 14), EVA5, 6.8 dB (70%)),
|
||||
(TM2 Test 1b 20 MHz, R.11-2 FDD (MCS 13), EVA5, 5.9 dB (70%)),
|
||||
</desc>
|
||||
<pre_compile_prog></pre_compile_prog>
|
||||
<compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</compile_prog>
|
||||
<compile_prog_args> --phy_simulators -c </compile_prog_args>
|
||||
<pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</pre_exec>
|
||||
<pre_exec_args></pre_exec_args>
|
||||
<main_exec> $OPENAIR_DIR/cmake_targets/lte-simulators/build/dlsim_tm4</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
|
||||
-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_tm4.test1 dlsim_tm4.test5 dlsim_tm4.test6 dlsim_tm4.test6b dlsim_tm4.test7 dlsim_tm4.test7b dlsim_tm4.test10 dlsim_tm4.test10b dlsim_tm4.test11 dlsim_tm4.TM2_test1 dlsim_tm4.TM2_test1b</tags>
|
||||
<search_expr_true>"passed"</search_expr_true>
|
||||
<search_expr_false>segmentation fault|assertion|exiting|fatal</search_expr_false>
|
||||
<nruns>3</nruns>
|
||||
</testCase>
|
||||
|
||||
<testCase id="015500" >
|
||||
<class>lte-softmodem</class>
|
||||
<desc></desc>
|
||||
|
||||
@@ -543,7 +543,7 @@ function main() {
|
||||
if [ "$SIMUS_PHY" = "1" ] ; then
|
||||
# lte unitary simulators compilation
|
||||
echo_info "Compiling unitary tests simulators"
|
||||
simlist="dlsim ulsim pucchsim prachsim pdcchsim pbchsim mbmssim"
|
||||
simlist="dlsim_tm4 dlsim ulsim pucchsim prachsim pdcchsim pbchsim mbmssim"
|
||||
for f in $simlist ; do
|
||||
compilations \
|
||||
lte-simulators $f \
|
||||
|
||||
@@ -8,7 +8,7 @@ set(DEBUG_PHY False)
|
||||
set(MU_RECIEVER False)
|
||||
set(RANDOM_BF False)
|
||||
set(PBS_SIM False)
|
||||
set(PERFECT_CE False)
|
||||
set(PERFECT_CE True)
|
||||
set(NAS_UE False)
|
||||
set(MESSAGE_CHART_GENERATOR False)
|
||||
|
||||
|
||||
Regular → Executable
+279
-228
@@ -665,34 +665,34 @@ void phy_config_dedicated_eNB(uint8_t Mod_id,
|
||||
if (physicalConfigDedicated->antennaInfo) {
|
||||
switch(physicalConfigDedicated->antennaInfo->choice.explicitValue.transmissionMode) {
|
||||
case AntennaInfoDedicated__transmissionMode_tm1:
|
||||
eNB->transmission_mode[UE_id] = 1;
|
||||
break;
|
||||
eNB->transmission_mode[UE_id] = 1;
|
||||
break;
|
||||
case AntennaInfoDedicated__transmissionMode_tm2:
|
||||
eNB->transmission_mode[UE_id] = 2;
|
||||
break;
|
||||
eNB->transmission_mode[UE_id] = 2;
|
||||
break;
|
||||
case AntennaInfoDedicated__transmissionMode_tm3:
|
||||
eNB->transmission_mode[UE_id] = 3;
|
||||
break;
|
||||
eNB->transmission_mode[UE_id] = 3;
|
||||
break;
|
||||
case AntennaInfoDedicated__transmissionMode_tm4:
|
||||
eNB->transmission_mode[UE_id] = 4;
|
||||
break;
|
||||
eNB->transmission_mode[UE_id] = 4;
|
||||
break;
|
||||
case AntennaInfoDedicated__transmissionMode_tm5:
|
||||
eNB->transmission_mode[UE_id] = 5;
|
||||
break;
|
||||
eNB->transmission_mode[UE_id] = 5;
|
||||
break;
|
||||
case AntennaInfoDedicated__transmissionMode_tm6:
|
||||
eNB->transmission_mode[UE_id] = 6;
|
||||
break;
|
||||
eNB->transmission_mode[UE_id] = 6;
|
||||
break;
|
||||
case AntennaInfoDedicated__transmissionMode_tm7:
|
||||
lte_gold_ue_spec_port5(eNB->lte_gold_uespec_port5_table[0],eNB->frame_parms.Nid_cell,rnti);
|
||||
eNB->do_precoding = 1;
|
||||
eNB->transmission_mode[UE_id] = 7;
|
||||
break;
|
||||
eNB->do_precoding = 1;
|
||||
eNB->transmission_mode[UE_id] = 7;
|
||||
break;
|
||||
default:
|
||||
LOG_E(PHY,"Unknown transmission mode!\n");
|
||||
break;
|
||||
LOG_E(PHY,"Unknown transmission mode!\n");
|
||||
break;
|
||||
}
|
||||
LOG_I(PHY,"Transmission Mode (phy_config_dedicated_eNB) %d\n",eNB->transmission_mode[UE_id]);
|
||||
|
||||
|
||||
} else {
|
||||
LOG_D(PHY,"[eNB %d] : Received NULL radioResourceConfigDedicated->antennaInfo from eNB %d\n",Mod_id,UE_id);
|
||||
}
|
||||
@@ -838,31 +838,31 @@ void phy_config_dedicated_ue(uint8_t Mod_id,int CC_id,uint8_t eNB_id,
|
||||
LOG_D(PHY,"Transmission Mode %d\n",phy_vars_ue->transmission_mode[eNB_id]);
|
||||
switch(physicalConfigDedicated->antennaInfo->choice.explicitValue.transmissionMode) {
|
||||
case AntennaInfoDedicated__transmissionMode_tm1:
|
||||
phy_vars_ue->transmission_mode[eNB_id] = 1;
|
||||
break;
|
||||
phy_vars_ue->transmission_mode[eNB_id] = 1;
|
||||
break;
|
||||
case AntennaInfoDedicated__transmissionMode_tm2:
|
||||
phy_vars_ue->transmission_mode[eNB_id] = 2;
|
||||
break;
|
||||
phy_vars_ue->transmission_mode[eNB_id] = 2;
|
||||
break;
|
||||
case AntennaInfoDedicated__transmissionMode_tm3:
|
||||
phy_vars_ue->transmission_mode[eNB_id] = 3;
|
||||
break;
|
||||
phy_vars_ue->transmission_mode[eNB_id] = 3;
|
||||
break;
|
||||
case AntennaInfoDedicated__transmissionMode_tm4:
|
||||
phy_vars_ue->transmission_mode[eNB_id] = 4;
|
||||
break;
|
||||
phy_vars_ue->transmission_mode[eNB_id] = 4;
|
||||
break;
|
||||
case AntennaInfoDedicated__transmissionMode_tm5:
|
||||
phy_vars_ue->transmission_mode[eNB_id] = 5;
|
||||
break;
|
||||
phy_vars_ue->transmission_mode[eNB_id] = 5;
|
||||
break;
|
||||
case AntennaInfoDedicated__transmissionMode_tm6:
|
||||
phy_vars_ue->transmission_mode[eNB_id] = 6;
|
||||
break;
|
||||
phy_vars_ue->transmission_mode[eNB_id] = 6;
|
||||
break;
|
||||
case AntennaInfoDedicated__transmissionMode_tm7:
|
||||
lte_gold_ue_spec_port5(phy_vars_ue->lte_gold_uespec_port5_table, phy_vars_ue->frame_parms.Nid_cell, phy_vars_ue->pdcch_vars[eNB_id]->crnti);
|
||||
phy_vars_ue->transmission_mode[eNB_id] = 7;
|
||||
break;
|
||||
phy_vars_ue->transmission_mode[eNB_id] = 7;
|
||||
break;
|
||||
default:
|
||||
LOG_E(PHY,"Unknown transmission mode!\n");
|
||||
break;
|
||||
}
|
||||
LOG_E(PHY,"Unknown transmission mode!\n");
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
LOG_D(PHY,"[UE %d] Received NULL physicalConfigDedicated->antennaInfo from eNB %d\n",Mod_id, eNB_id);
|
||||
}
|
||||
@@ -906,29 +906,29 @@ void phy_config_dedicated_ue(uint8_t Mod_id,int CC_id,uint8_t eNB_id,
|
||||
|
||||
if (physicalConfigDedicated->cqi_ReportConfig) {
|
||||
if (physicalConfigDedicated->cqi_ReportConfig->cqi_ReportModeAperiodic) {
|
||||
// configure PUSCH CQI reporting
|
||||
phy_vars_ue->cqi_report_config[eNB_id].cqi_ReportModeAperiodic = *physicalConfigDedicated->cqi_ReportConfig->cqi_ReportModeAperiodic;
|
||||
if ((phy_vars_ue->cqi_report_config[eNB_id].cqi_ReportModeAperiodic != rm12) &&
|
||||
(phy_vars_ue->cqi_report_config[eNB_id].cqi_ReportModeAperiodic != rm30) &&
|
||||
(phy_vars_ue->cqi_report_config[eNB_id].cqi_ReportModeAperiodic != rm31))
|
||||
LOG_E(PHY,"Unsupported Aperiodic CQI Feedback Mode : %d\n",phy_vars_ue->cqi_report_config[eNB_id].cqi_ReportModeAperiodic);
|
||||
// configure PUSCH CQI reporting
|
||||
phy_vars_ue->cqi_report_config[eNB_id].cqi_ReportModeAperiodic = *physicalConfigDedicated->cqi_ReportConfig->cqi_ReportModeAperiodic;
|
||||
if ((phy_vars_ue->cqi_report_config[eNB_id].cqi_ReportModeAperiodic != rm12) &&
|
||||
(phy_vars_ue->cqi_report_config[eNB_id].cqi_ReportModeAperiodic != rm30) &&
|
||||
(phy_vars_ue->cqi_report_config[eNB_id].cqi_ReportModeAperiodic != rm31))
|
||||
LOG_E(PHY,"Unsupported Aperiodic CQI Feedback Mode : %d\n",phy_vars_ue->cqi_report_config[eNB_id].cqi_ReportModeAperiodic);
|
||||
}
|
||||
if (physicalConfigDedicated->cqi_ReportConfig->cqi_ReportPeriodic) {
|
||||
if (physicalConfigDedicated->cqi_ReportConfig->cqi_ReportPeriodic->present == CQI_ReportPeriodic_PR_setup) {
|
||||
// configure PUCCH CQI reporting
|
||||
phy_vars_ue->cqi_report_config[eNB_id].CQI_ReportPeriodic.cqi_PUCCH_ResourceIndex = physicalConfigDedicated->cqi_ReportConfig->cqi_ReportPeriodic->choice.setup.cqi_PUCCH_ResourceIndex;
|
||||
phy_vars_ue->cqi_report_config[eNB_id].CQI_ReportPeriodic.cqi_PMI_ConfigIndex = physicalConfigDedicated->cqi_ReportConfig->cqi_ReportPeriodic->choice.setup.cqi_pmi_ConfigIndex;
|
||||
if (physicalConfigDedicated->cqi_ReportConfig->cqi_ReportPeriodic->choice.setup.ri_ConfigIndex)
|
||||
phy_vars_ue->cqi_report_config[eNB_id].CQI_ReportPeriodic.ri_ConfigIndex = *physicalConfigDedicated->cqi_ReportConfig->cqi_ReportPeriodic->choice.setup.ri_ConfigIndex;
|
||||
}
|
||||
else if (physicalConfigDedicated->cqi_ReportConfig->cqi_ReportPeriodic->present == CQI_ReportPeriodic_PR_release) {
|
||||
// handle release
|
||||
phy_vars_ue->cqi_report_config[eNB_id].CQI_ReportPeriodic.ri_ConfigIndex = -1;
|
||||
phy_vars_ue->cqi_report_config[eNB_id].CQI_ReportPeriodic.cqi_PMI_ConfigIndex = -1;
|
||||
}
|
||||
if (physicalConfigDedicated->cqi_ReportConfig->cqi_ReportPeriodic->present == CQI_ReportPeriodic_PR_setup) {
|
||||
// configure PUCCH CQI reporting
|
||||
phy_vars_ue->cqi_report_config[eNB_id].CQI_ReportPeriodic.cqi_PUCCH_ResourceIndex = physicalConfigDedicated->cqi_ReportConfig->cqi_ReportPeriodic->choice.setup.cqi_PUCCH_ResourceIndex;
|
||||
phy_vars_ue->cqi_report_config[eNB_id].CQI_ReportPeriodic.cqi_PMI_ConfigIndex = physicalConfigDedicated->cqi_ReportConfig->cqi_ReportPeriodic->choice.setup.cqi_pmi_ConfigIndex;
|
||||
if (physicalConfigDedicated->cqi_ReportConfig->cqi_ReportPeriodic->choice.setup.ri_ConfigIndex)
|
||||
phy_vars_ue->cqi_report_config[eNB_id].CQI_ReportPeriodic.ri_ConfigIndex = *physicalConfigDedicated->cqi_ReportConfig->cqi_ReportPeriodic->choice.setup.ri_ConfigIndex;
|
||||
}
|
||||
else if (physicalConfigDedicated->cqi_ReportConfig->cqi_ReportPeriodic->present == CQI_ReportPeriodic_PR_release) {
|
||||
// handle release
|
||||
phy_vars_ue->cqi_report_config[eNB_id].CQI_ReportPeriodic.ri_ConfigIndex = -1;
|
||||
phy_vars_ue->cqi_report_config[eNB_id].CQI_ReportPeriodic.cqi_PMI_ConfigIndex = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#ifdef CBA
|
||||
|
||||
if (physicalConfigDedicated->pusch_CBAConfigDedicated_vlola) {
|
||||
@@ -1016,8 +1016,9 @@ void phy_init_lte_ue__PDSCH( LTE_UE_PDSCH* const pdsch, const LTE_DL_FRAME_PARMS
|
||||
pdsch->pmi_ext = (uint8_t*)malloc16_clear( fp->N_RB_DL );
|
||||
pdsch->llr[0] = (int16_t*)malloc16_clear( (8*((3*8*6144)+12))*sizeof(int16_t) );
|
||||
pdsch->llr128 = (int16_t**)malloc16_clear( sizeof(int16_t*) );
|
||||
pdsch->llr128_2ndstream = (int16_t**)malloc16_clear( sizeof(int16_t*) );
|
||||
// FIXME! no further allocation for (int16_t*)pdsch->llr128 !!! expect SIGSEGV
|
||||
// FK, 11-3-2015: this is only as a temporary pointer, no memory is stored there
|
||||
|
||||
|
||||
pdsch->rxdataF_ext = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
|
||||
pdsch->rxdataF_uespec_pilots = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
|
||||
@@ -1026,11 +1027,12 @@ void phy_init_lte_ue__PDSCH( LTE_UE_PDSCH* const pdsch, const LTE_DL_FRAME_PARMS
|
||||
pdsch->dl_ch_estimates_ext = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
|
||||
pdsch->dl_bf_ch_estimates = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
|
||||
pdsch->dl_bf_ch_estimates_ext = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
|
||||
pdsch->dl_ch_rho_ext = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
|
||||
pdsch->dl_ch_rho2_ext = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
|
||||
//pdsch->dl_ch_rho_ext = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
|
||||
//pdsch->dl_ch_rho2_ext = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
|
||||
pdsch->dl_ch_mag0 = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
|
||||
pdsch->dl_ch_magb0 = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
|
||||
|
||||
|
||||
// the allocated memory size is fixed:
|
||||
AssertFatal( fp->nb_antennas_rx <= 2, "nb_antennas_rx > 2" );
|
||||
|
||||
@@ -1046,15 +1048,14 @@ void phy_init_lte_ue__PDSCH( LTE_UE_PDSCH* const pdsch, const LTE_DL_FRAME_PARMS
|
||||
pdsch->dl_ch_estimates_ext[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num );
|
||||
pdsch->dl_bf_ch_estimates[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * fp->ofdm_symbol_size*7*2);
|
||||
pdsch->dl_bf_ch_estimates_ext[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num );
|
||||
pdsch->dl_ch_rho_ext[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num );
|
||||
pdsch->dl_ch_rho2_ext[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num );
|
||||
//pdsch->dl_ch_rho_ext[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num );
|
||||
//pdsch->dl_ch_rho2_ext[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num );
|
||||
pdsch->dl_ch_mag0[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num );
|
||||
pdsch->dl_ch_magb0[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int phy_init_lte_ue(PHY_VARS_UE *ue,
|
||||
int nb_connected_eNB,
|
||||
uint8_t abstraction_flag)
|
||||
@@ -1072,7 +1073,7 @@ int phy_init_lte_ue(PHY_VARS_UE *ue,
|
||||
LTE_UE_PDCCH** const pdcch_vars = ue->pdcch_vars;
|
||||
LTE_UE_PRACH** const prach_vars = ue->prach_vars;
|
||||
|
||||
int i,j,k;
|
||||
int i,j,k,l;
|
||||
int eNB_id;
|
||||
|
||||
printf("Initializing UE vars (abstraction %"PRIu8") for eNB TXant %"PRIu8", UE RXant %"PRIu8"\n",abstraction_flag,fp->nb_antennas_tx,fp->nb_antennas_rx);
|
||||
@@ -1160,44 +1161,72 @@ int phy_init_lte_ue(PHY_VARS_UE *ue,
|
||||
phy_init_lte_ue__PDSCH( pdsch_vars_th1[eNB_id], fp );
|
||||
|
||||
// thread 0
|
||||
pdsch_vars_th0[eNB_id]->llr_shifts = (uint8_t*)malloc16_clear(7*2*fp->N_RB_DL*12);
|
||||
pdsch_vars_th0[eNB_id]->llr_shifts_p = pdsch_vars_th0[eNB_id]->llr_shifts;
|
||||
pdsch_vars_th0[eNB_id]->dl_ch_mag1 = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
|
||||
pdsch_vars_th0[eNB_id]->dl_ch_magb1 = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
|
||||
pdsch_vars_th0[eNB_id]->llr[1] = (int16_t*)malloc16_clear( (8*((3*8*6144)+12))*sizeof(int16_t) );
|
||||
pdsch_vars_th0[eNB_id]->llr_shifts = (uint8_t*)malloc16_clear(7*2*fp->N_RB_DL*12);
|
||||
pdsch_vars_th0[eNB_id]->llr_shifts_p = pdsch_vars_th0[eNB_id]->llr_shifts;
|
||||
pdsch_vars_th0[eNB_id]->llr[1] = (int16_t*)malloc16_clear( (8*((3*8*6144)+12))*sizeof(int16_t) );
|
||||
pdsch_vars_th0[eNB_id]->llr128_2ndstream = (int16_t**)malloc16_clear( sizeof(int16_t*) );
|
||||
pdsch_vars_th0[eNB_id]->rho = (int32_t**)malloc16_clear( fp->nb_antennas_rx*sizeof(int32_t*) );
|
||||
|
||||
for (k=0; k<8; k++)
|
||||
pdsch_vars_th0[eNB_id]->rxdataF_comp1[k] = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
|
||||
// thread 0
|
||||
pdsch_vars_th1[eNB_id]->llr_shifts = (uint8_t*)malloc16_clear(7*2*fp->N_RB_DL*12);
|
||||
pdsch_vars_th1[eNB_id]->llr_shifts_p = pdsch_vars_th0[eNB_id]->llr_shifts;
|
||||
pdsch_vars_th1[eNB_id]->llr[1] = (int16_t*)malloc16_clear( (8*((3*8*6144)+12))*sizeof(int16_t) );
|
||||
pdsch_vars_th1[eNB_id]->llr128_2ndstream = (int16_t**)malloc16_clear( sizeof(int16_t*) );
|
||||
pdsch_vars_th1[eNB_id]->rho = (int32_t**)malloc16_clear( fp->nb_antennas_rx*sizeof(int32_t*) );
|
||||
|
||||
// thread 1
|
||||
pdsch_vars_th1[eNB_id]->llr_shifts = (uint8_t*)malloc16_clear(7*2*fp->N_RB_DL*12);
|
||||
pdsch_vars_th1[eNB_id]->llr_shifts_p = pdsch_vars_th1[eNB_id]->llr_shifts;
|
||||
pdsch_vars_th1[eNB_id]->dl_ch_mag1 = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
|
||||
pdsch_vars_th1[eNB_id]->dl_ch_magb1 = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
|
||||
pdsch_vars_th1[eNB_id]->llr[1] = (int16_t*)malloc16_clear( (8*((3*8*6144)+12))*sizeof(int16_t) );
|
||||
|
||||
for (k=0; k<8; k++)
|
||||
pdsch_vars_th1[eNB_id]->rxdataF_comp1[k] = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
|
||||
|
||||
|
||||
for (int i=0; i<fp->nb_antennas_rx; i++){
|
||||
pdsch_vars_th0[eNB_id]->rho[i] = (int32_t*)malloc16_clear( 7*2*sizeof(int32_t)*(fp->N_RB_DL*12) );
|
||||
pdsch_vars_th1[eNB_id]->rho[i] = (int32_t*)malloc16_clear( 7*2*sizeof(int32_t)*(fp->N_RB_DL*12) );
|
||||
}
|
||||
|
||||
pdsch_vars_th0[eNB_id]->dl_ch_rho2_ext = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
|
||||
pdsch_vars_th1[eNB_id]->dl_ch_rho2_ext = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
|
||||
|
||||
for (i=0; i<fp->nb_antennas_rx; i++)
|
||||
for (j=0; j<4; j++) {
|
||||
int idx = (j<<1)+i;
|
||||
pdsch_vars_th0[eNB_id]->dl_ch_mag1[idx] = (int32_t*)malloc16_clear( 7*2*sizeof(int32_t)*(fp->N_RB_DL*12) );
|
||||
pdsch_vars_th0[eNB_id]->dl_ch_magb1[idx] = (int32_t*)malloc16_clear( 7*2*sizeof(int32_t)*(fp->N_RB_DL*12) );
|
||||
|
||||
pdsch_vars_th1[eNB_id]->dl_ch_mag1[idx] = (int32_t*)malloc16_clear( 7*2*sizeof(int32_t)*(fp->N_RB_DL*12) );
|
||||
pdsch_vars_th1[eNB_id]->dl_ch_magb1[idx] = (int32_t*)malloc16_clear( 7*2*sizeof(int32_t)*(fp->N_RB_DL*12) );
|
||||
|
||||
for (k=0; k<8; k++)
|
||||
{
|
||||
pdsch_vars_th0[eNB_id]->rxdataF_comp1[idx][k] = (int32_t*)malloc16_clear( sizeof(int32_t)*(fp->N_RB_DL*12*14) );
|
||||
pdsch_vars_th1[eNB_id]->rxdataF_comp1[idx][k] = (int32_t*)malloc16_clear( sizeof(int32_t)*(fp->N_RB_DL*12*14) );
|
||||
}
|
||||
const int idx = (j<<1)+i;
|
||||
const size_t num = 7*2*fp->N_RB_DL*12+4;
|
||||
pdsch_vars_th0[eNB_id]->dl_ch_rho2_ext[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num );
|
||||
pdsch_vars_th1[eNB_id]->dl_ch_rho2_ext[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num );
|
||||
}
|
||||
|
||||
|
||||
const size_t num = 7*2*fp->N_RB_DL*12+4;
|
||||
for (k=0;k<8;k++) { //harq_pid
|
||||
for (l=0;l<8;l++) { //round
|
||||
pdsch_vars_th0[eNB_id]->rxdataF_comp1[k][l] = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
|
||||
pdsch_vars_th0[eNB_id]->dl_ch_rho_ext[k][l] = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
|
||||
pdsch_vars_th0[eNB_id]->dl_ch_mag1[k][l] = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
|
||||
pdsch_vars_th0[eNB_id]->dl_ch_magb1[k][l] = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
|
||||
|
||||
pdsch_vars_th1[eNB_id]->rxdataF_comp1[k][l] = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
|
||||
pdsch_vars_th1[eNB_id]->dl_ch_rho_ext[k][l] = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
|
||||
pdsch_vars_th1[eNB_id]->dl_ch_mag1[k][l] = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
|
||||
pdsch_vars_th1[eNB_id]->dl_ch_magb1[k][l] = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
|
||||
|
||||
|
||||
for (int i=0; i<fp->nb_antennas_rx; i++)
|
||||
for (int j=0; j<4; j++) { //frame_parms->nb_antennas_tx; j++)
|
||||
const int idx = (j<<1)+i;
|
||||
pdsch_vars_th0[eNB_id]->dl_ch_rho_ext[k][l][idx] = (int32_t*)malloc16_clear( 7*2*sizeof(int32_t)*(fp->N_RB_DL*12) );
|
||||
pdsch_vars_th0[eNB_id]->rxdataF_comp1[k][l][idx] = (int32_t*)malloc16_clear( 7*2*sizeof(int32_t)*(fp->N_RB_DL*12) );
|
||||
pdsch_vars_th0[eNB_id]->dl_ch_mag1[k][l][idx] = (int32_t*)malloc16_clear( 7*2*sizeof(int32_t)*(fp->N_RB_DL*12) );
|
||||
pdsch_vars_th0[eNB_id]->dl_ch_magb1[k][l][idx] = (int32_t*)malloc16_clear( 7*2*sizeof(int32_t)*(fp->N_RB_DL*12) );
|
||||
|
||||
pdsch_vars_th1[eNB_id]->dl_ch_rho_ext[k][l][idx] = (int32_t*)malloc16_clear( 7*2*sizeof(int32_t)*(fp->N_RB_DL*12) );
|
||||
pdsch_vars_th1[eNB_id]->rxdataF_comp1[k][l][idx] = (int32_t*)malloc16_clear( 7*2*sizeof(int32_t)*(fp->N_RB_DL*12) );
|
||||
pdsch_vars_th1[eNB_id]->dl_ch_mag1[k][l][idx] = (int32_t*)malloc16_clear( 7*2*sizeof(int32_t)*(fp->N_RB_DL*12) );
|
||||
pdsch_vars_th1[eNB_id]->dl_ch_magb1[k][l][idx] = (int32_t*)malloc16_clear( 7*2*sizeof(int32_t)*(fp->N_RB_DL*12) );
|
||||
}
|
||||
}
|
||||
}
|
||||
phy_init_lte_ue__PDSCH( pdsch_vars_SI[eNB_id], fp );
|
||||
phy_init_lte_ue__PDSCH( pdsch_vars_ra[eNB_id], fp );
|
||||
phy_init_lte_ue__PDSCH( pdsch_vars_mch[eNB_id], fp );
|
||||
|
||||
// 100 PRBs * 12 REs/PRB * 4 PDCCH SYMBOLS * 2 LLRs/RE
|
||||
pdcch_vars[eNB_id]->llr = (uint16_t*)malloc16_clear( 2*4*100*12*sizeof(uint16_t) );
|
||||
pdcch_vars[eNB_id]->llr16 = (uint16_t*)malloc16_clear( 2*4*100*12*sizeof(uint16_t) );
|
||||
@@ -1267,7 +1296,11 @@ int phy_init_lte_ue(PHY_VARS_UE *ue,
|
||||
ue->sinr_CQI_dB = (double*) malloc16_clear( fp->N_RB_DL*12*sizeof(double) );
|
||||
|
||||
ue->init_averaging = 1;
|
||||
ue->pdsch_config_dedicated->p_a = dB0; // default value until overwritten by RRCConnectionReconfiguration
|
||||
// default value until overwritten by RRCConnectionReconfiguration
|
||||
if (fp->nb_antenna_ports_eNB==2)
|
||||
ue->pdsch_config_dedicated->p_a = dBm3;
|
||||
else
|
||||
ue->pdsch_config_dedicated->p_a = dB0;
|
||||
|
||||
// set channel estimation to do linear interpolation in time
|
||||
ue->high_speed_flag = 1;
|
||||
@@ -1290,9 +1323,11 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB,
|
||||
LTE_eNB_PUSCH** const pusch_vars = eNB->pusch_vars;
|
||||
LTE_eNB_SRS* const srs_vars = eNB->srs_vars;
|
||||
LTE_eNB_PRACH* const prach_vars = &eNB->prach_vars;
|
||||
int i, j, eNB_id, UE_id;
|
||||
|
||||
int i, j, eNB_id, UE_id;
|
||||
int re;
|
||||
|
||||
|
||||
eNB->total_dlsch_bitrate = 0;
|
||||
eNB->total_transmitted_bits = 0;
|
||||
eNB->total_system_throughput = 0;
|
||||
@@ -1307,17 +1342,17 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB,
|
||||
lte_gold(fp,eNB->lte_gold_table,fp->Nid_cell);
|
||||
generate_pcfich_reg_mapping(fp);
|
||||
generate_phich_reg_mapping(fp);
|
||||
|
||||
|
||||
for (UE_id=0; UE_id<NUMBER_OF_UE_MAX; UE_id++) {
|
||||
eNB->first_run_timing_advance[UE_id] =
|
||||
1; ///This flag used to be static. With multiple eNBs this does no longer work, hence we put it in the structure. However it has to be initialized with 1, which is performed here.
|
||||
1; ///This flag used to be static. With multiple eNBs this does no longer work, hence we put it in the structure. However it has to be initialized with 1, which is performed here.
|
||||
|
||||
// clear whole structure
|
||||
bzero( &eNB->UE_stats[UE_id], sizeof(LTE_eNB_UE_stats) );
|
||||
|
||||
|
||||
eNB->physicalConfigDedicated[UE_id] = NULL;
|
||||
}
|
||||
|
||||
|
||||
eNB->first_run_I0_measurements = 1; ///This flag used to be static. With multiple eNBs this does no longer work, hence we put it in the structure. However it has to be initialized with 1, which is performed here.
|
||||
}
|
||||
|
||||
@@ -1325,131 +1360,142 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB,
|
||||
{
|
||||
eNB_id=0;
|
||||
if (abstraction_flag==0) {
|
||||
|
||||
|
||||
// TX vars
|
||||
if (eNB->node_function != NGFI_RCC_IF4p5)
|
||||
common_vars->txdata[eNB_id] = (int32_t**)malloc16(fp->nb_antennas_tx*sizeof(int32_t*));
|
||||
|
||||
common_vars->txdata[eNB_id] = (int32_t**)malloc16(fp->nb_antennas_tx*sizeof(int32_t*));
|
||||
common_vars->txdataF[eNB_id] = (int32_t **)malloc16(NB_ANTENNA_PORTS_ENB*sizeof(int32_t*));
|
||||
common_vars->txdataF_BF[eNB_id] = (int32_t **)malloc16(fp->nb_antennas_tx*sizeof(int32_t*));
|
||||
|
||||
if (eNB->node_function != NGFI_RRU_IF5) {
|
||||
for (i=0; i<NB_ANTENNA_PORTS_ENB; i++) {
|
||||
if (i<fp->nb_antenna_ports_eNB || i==5) {
|
||||
common_vars->txdataF[eNB_id][i] = (int32_t*)malloc16_clear(fp->ofdm_symbol_size*fp->symbols_per_tti*10*sizeof(int32_t) );
|
||||
for (i=0; i<NB_ANTENNA_PORTS_ENB; i++) {
|
||||
if (i<fp->nb_antenna_ports_eNB || i==5) {
|
||||
common_vars->txdataF[eNB_id][i] = (int32_t*)malloc16_clear(fp->ofdm_symbol_size*fp->symbols_per_tti*10*sizeof(int32_t) );
|
||||
#ifdef DEBUG_PHY
|
||||
printf("[openair][LTE_PHY][INIT] common_vars->txdataF[%d][%d] = %p (%lu bytes)\n",
|
||||
eNB_id,i,common_vars->txdataF[eNB_id][i],
|
||||
fp->ofdm_symbol_size*fp->symbols_per_tti*10*sizeof(int32_t));
|
||||
printf("[openair][LTE_PHY][INIT] common_vars->txdataF[%d][%d] = %p (%lu bytes)\n",
|
||||
eNB_id,i,common_vars->txdataF[eNB_id][i],
|
||||
fp->ofdm_symbol_size*fp->symbols_per_tti*10*sizeof(int32_t));
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (i=0; i<fp->nb_antennas_tx; i++) {
|
||||
common_vars->txdataF_BF[eNB_id][i] = (int32_t*)malloc16_clear(fp->ofdm_symbol_size*sizeof(int32_t) );
|
||||
if (eNB->node_function != NGFI_RCC_IF4p5)
|
||||
common_vars->txdataF_BF[eNB_id][i] = (int32_t*)malloc16_clear(fp->ofdm_symbol_size*sizeof(int32_t) );
|
||||
if (eNB->node_function != NGFI_RCC_IF4p5)
|
||||
|
||||
// Allocate 10 subframes of I/Q TX signal data (time) if not
|
||||
common_vars->txdata[eNB_id][i] = (int32_t*)malloc16_clear( fp->samples_per_tti*10*sizeof(int32_t) );
|
||||
// Allocate 10 subframes of I/Q TX signal data (time) if not
|
||||
common_vars->txdata[eNB_id][i] = (int32_t*)malloc16_clear( fp->samples_per_tti*10*sizeof(int32_t) );
|
||||
|
||||
#ifdef DEBUG_PHY
|
||||
printf("[openair][LTE_PHY][INIT] common_vars->txdata[%d][%d] = %p (%lu bytes)\n",eNB_id,i,common_vars->txdata[eNB_id][i],
|
||||
fp->samples_per_tti*10*sizeof(int32_t));
|
||||
printf("[openair][LTE_PHY][INIT] common_vars->txdata[%d][%d] = %p (%lu bytes)\n",eNB_id,i,common_vars->txdata[eNB_id][i],
|
||||
fp->samples_per_tti*10*sizeof(int32_t));
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
for (i=0; i<NB_ANTENNA_PORTS_ENB; i++) {
|
||||
if (i<fp->nb_antenna_ports_eNB || i==5) {
|
||||
common_vars->beam_weights[eNB_id][i] = (int32_t **)malloc16_clear(fp->nb_antennas_tx*sizeof(int32_t*));
|
||||
for (j=0; j<fp->nb_antennas_tx; j++) {
|
||||
common_vars->beam_weights[eNB_id][i][j] = (int32_t *)malloc16_clear(fp->ofdm_symbol_size*sizeof(int32_t));
|
||||
// antenna ports 0-3 are mapped on antennas 0-3
|
||||
// antenna port 4 is mapped on antenna 0
|
||||
// antenna ports 5-14 are mapped on all antennas
|
||||
if (((i<4) && (i==j)) || ((i==4) && (j==0))) {
|
||||
for (re=0; re<fp->ofdm_symbol_size; re++)
|
||||
common_vars->beam_weights[eNB_id][i][j][re] = 0x00007fff;
|
||||
}
|
||||
else if (i>4) {
|
||||
for (re=0; re<fp->ofdm_symbol_size; re++)
|
||||
common_vars->beam_weights[eNB_id][i][j][re] = 0x00007fff/fp->nb_antennas_tx;
|
||||
}
|
||||
if (i<fp->nb_antenna_ports_eNB || i==5) {
|
||||
common_vars->beam_weights[eNB_id][i] = (int32_t **)malloc16_clear(fp->nb_antennas_tx*sizeof(int32_t*));
|
||||
for (j=0; j<fp->nb_antennas_tx; j++) {
|
||||
common_vars->beam_weights[eNB_id][i][j] = (int32_t *)malloc16_clear(fp->ofdm_symbol_size*sizeof(int32_t));
|
||||
// antenna ports 0-3 are mapped on antennas 0-3
|
||||
// antenna port 4 is mapped on antenna 0
|
||||
// antenna ports 5-14 are mapped on all antennas
|
||||
if (((i<4) && (i==j)) || ((i==4) && (j==0))) {
|
||||
for (re=0; re<fp->ofdm_symbol_size; re++)
|
||||
common_vars->beam_weights[eNB_id][i][j][re] = 0x00007fff;
|
||||
}
|
||||
else if (i>4) {
|
||||
for (re=0; re<fp->ofdm_symbol_size; re++)
|
||||
common_vars->beam_weights[eNB_id][i][j][re] = 0x00007fff/fp->nb_antennas_tx;
|
||||
}
|
||||
#ifdef DEBUG_PHY
|
||||
msg("[openair][LTE_PHY][INIT] lte_common_vars->beam_weights[%d][%d][%d] = %p (%d bytes)\n",
|
||||
eNB_id,i,j,common_vars->beam_weights[eNB_id][i][j],
|
||||
fp->ofdm_symbol_size*sizeof(int32_t));
|
||||
msg("[openair][LTE_PHY][INIT] lte_common_vars->beam_weights[%d][%d][%d] = %p (%d bytes)\n",
|
||||
eNB_id,i,j,common_vars->beam_weights[eNB_id][i][j],
|
||||
fp->ofdm_symbol_size*sizeof(int32_t));
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// RX vars
|
||||
if (eNB->node_function != NGFI_RCC_IF4p5) {
|
||||
common_vars->rxdata[eNB_id] = (int32_t**)malloc16(fp->nb_antennas_rx*sizeof(int32_t*) );
|
||||
common_vars->rxdata_7_5kHz[eNB_id] = (int32_t**)malloc16(fp->nb_antennas_rx*sizeof(int32_t*) );
|
||||
common_vars->rxdata[eNB_id] = (int32_t**)malloc16(fp->nb_antennas_rx*sizeof(int32_t*) );
|
||||
common_vars->rxdata_7_5kHz[eNB_id] = (int32_t**)malloc16(fp->nb_antennas_rx*sizeof(int32_t*) );
|
||||
}
|
||||
|
||||
common_vars->rxdataF[eNB_id] = (int32_t**)malloc16(fp->nb_antennas_rx*sizeof(int32_t*) );
|
||||
|
||||
for (i=0; i<fp->nb_antennas_rx; i++) {
|
||||
if (eNB->node_function != NGFI_RCC_IF4p5) {
|
||||
// allocate 2 subframes of I/Q signal data (time) if not an RCC (no time-domain signals)
|
||||
common_vars->rxdata[eNB_id][i] = (int32_t*)malloc16_clear( fp->samples_per_tti*10*sizeof(int32_t) );
|
||||
|
||||
if (eNB->node_function != NGFI_RRU_IF5)
|
||||
// allocate 2 subframes of I/Q signal data (time, 7.5 kHz offset)
|
||||
common_vars->rxdata_7_5kHz[eNB_id][i] = (int32_t*)malloc16_clear( 2*fp->samples_per_tti*2*sizeof(int32_t) );
|
||||
}
|
||||
if (eNB->node_function != NGFI_RRU_IF5)
|
||||
// allocate 2 subframes of I/Q signal data (frequency)
|
||||
common_vars->rxdataF[eNB_id][i] = (int32_t*)malloc16_clear(sizeof(int32_t)*(2*fp->ofdm_symbol_size*fp->symbols_per_tti) );
|
||||
for (i=0; i<fp->nb_antennas_rx; i++) {
|
||||
if (eNB->node_function != NGFI_RCC_IF4p5) {
|
||||
// allocate 2 subframes of I/Q signal data (time) if not an RCC (no time-domain signals)
|
||||
common_vars->rxdata[eNB_id][i] = (int32_t*)malloc16_clear( fp->samples_per_tti*10*sizeof(int32_t) );
|
||||
|
||||
if (eNB->node_function != NGFI_RRU_IF5)
|
||||
// allocate 2 subframes of I/Q signal data (time, 7.5 kHz offset)
|
||||
common_vars->rxdata_7_5kHz[eNB_id][i] = (int32_t*)malloc16_clear( 2*fp->samples_per_tti*2*sizeof(int32_t) );
|
||||
}
|
||||
|
||||
if (eNB->node_function != NGFI_RRU_IF5)
|
||||
// allocate 2 subframes of I/Q signal data (frequency)
|
||||
common_vars->rxdataF[eNB_id][i] = (int32_t*)malloc16_clear(sizeof(int32_t)*(2*fp->ofdm_symbol_size*fp->symbols_per_tti) );
|
||||
|
||||
#ifdef DEBUG_PHY
|
||||
printf("[openair][LTE_PHY][INIT] common_vars->rxdata[%d][%d] = %p (%lu bytes)\n",eNB_id,i,common_vars->rxdata[eNB_id][i],fp->samples_per_tti*10*sizeof(int32_t));
|
||||
if (eNB->node_function != NGFI_RRU_IF5)
|
||||
printf("[openair][LTE_PHY][INIT] common_vars->rxdata_7_5kHz[%d][%d] = %p (%lu bytes)\n",eNB_id,i,common_vars->rxdata_7_5kHz[eNB_id][i],fp->samples_per_tti*2*sizeof(int32_t));
|
||||
printf("[openair][LTE_PHY][INIT] common_vars->rxdata[%d][%d] = %p (%lu bytes)\n",eNB_id,i,common_vars->rxdata[eNB_id][i],fp->samples_per_tti*10*sizeof(int32_t));
|
||||
if (eNB->node_function != NGFI_RRU_IF5)
|
||||
printf("[openair][LTE_PHY][INIT] common_vars->rxdata_7_5kHz[%d][%d] = %p (%lu bytes)\n",eNB_id,i,common_vars->rxdata_7_5kHz[eNB_id][i],fp->samples_per_tti*2*sizeof(int32_t));
|
||||
#endif
|
||||
common_vars->rxdataF[eNB_id][i] = (int32_t*)malloc16_clear(sizeof(int32_t)*(fp->ofdm_symbol_size*fp->symbols_per_tti) );
|
||||
}
|
||||
|
||||
|
||||
|
||||
if ((eNB->node_function != NGFI_RRU_IF4p5)&&(eNB->node_function != NGFI_RRU_IF5)) {
|
||||
// Channel estimates for SRS
|
||||
for (UE_id=0; UE_id<NUMBER_OF_UE_MAX; UE_id++) {
|
||||
|
||||
srs_vars[UE_id].srs_ch_estimates[eNB_id] = (int32_t**)malloc16( fp->nb_antennas_rx*sizeof(int32_t*) );
|
||||
srs_vars[UE_id].srs_ch_estimates_time[eNB_id] = (int32_t**)malloc16( fp->nb_antennas_rx*sizeof(int32_t*) );
|
||||
|
||||
for (i=0; i<fp->nb_antennas_rx; i++) {
|
||||
srs_vars[UE_id].srs_ch_estimates[eNB_id][i] = (int32_t*)malloc16_clear( sizeof(int32_t)*fp->ofdm_symbol_size );
|
||||
srs_vars[UE_id].srs_ch_estimates_time[eNB_id][i] = (int32_t*)malloc16_clear( sizeof(int32_t)*fp->ofdm_symbol_size*2 );
|
||||
}
|
||||
} //UE_id
|
||||
|
||||
common_vars->sync_corr[eNB_id] = (uint32_t*)malloc16_clear( LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*sizeof(uint32_t)*fp->samples_per_tti );
|
||||
|
||||
// Channel estimates for SRS
|
||||
for (UE_id=0; UE_id<NUMBER_OF_UE_MAX; UE_id++) {
|
||||
|
||||
srs_vars[UE_id].srs_ch_estimates[eNB_id] = (int32_t**)malloc16( fp->nb_antennas_rx*sizeof(int32_t*) );
|
||||
srs_vars[UE_id].srs_ch_estimates_time[eNB_id] = (int32_t**)malloc16( fp->nb_antennas_rx*sizeof(int32_t*) );
|
||||
|
||||
for (i=0; i<fp->nb_antennas_rx; i++) {
|
||||
srs_vars[UE_id].srs_ch_estimates[eNB_id][i] = (int32_t*)malloc16_clear( sizeof(int32_t)*fp->ofdm_symbol_size );
|
||||
srs_vars[UE_id].srs_ch_estimates_time[eNB_id][i] = (int32_t*)malloc16_clear( sizeof(int32_t)*fp->ofdm_symbol_size*2 );
|
||||
}
|
||||
} //UE_id
|
||||
|
||||
common_vars->sync_corr[eNB_id] = (uint32_t*)malloc16_clear( LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*sizeof(uint32_t)*fp->samples_per_tti );
|
||||
}
|
||||
} // abstraction_flag = 0
|
||||
else { //UPLINK abstraction = 1
|
||||
eNB->sinr_dB = (double*) malloc16_clear( fp->N_RB_DL*12*sizeof(double) );
|
||||
}
|
||||
} //eNB_id
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if (abstraction_flag==0) {
|
||||
if ((eNB->node_function != NGFI_RRU_IF4p5)&&(eNB->node_function != NGFI_RRU_IF5)) {
|
||||
generate_ul_ref_sigs_rx();
|
||||
|
||||
|
||||
// SRS
|
||||
for (UE_id=0; UE_id<NUMBER_OF_UE_MAX; UE_id++) {
|
||||
srs_vars[UE_id].srs = (int32_t*)malloc16_clear(2*fp->ofdm_symbol_size*sizeof(int32_t));
|
||||
srs_vars[UE_id].srs = (int32_t*)malloc16_clear(2*fp->ofdm_symbol_size*sizeof(int32_t));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// ULSCH VARS, skip if NFGI_RRU_IF4
|
||||
|
||||
|
||||
|
||||
if ((eNB->node_function!=NGFI_RRU_IF4p5)&&(eNB->node_function != NGFI_RRU_IF5))
|
||||
|
||||
prach_vars->prachF = (int16_t*)malloc16_clear( 1024*2*sizeof(int16_t) );
|
||||
|
||||
|
||||
/* number of elements of an array X is computed as sizeof(X) / sizeof(X[0]) */
|
||||
AssertFatal(fp->nb_antennas_rx <= sizeof(prach_vars->rxsigF) / sizeof(prach_vars->rxsigF[0]),
|
||||
"nb_antennas_rx too large");
|
||||
@@ -1459,10 +1505,11 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB,
|
||||
printf("[openair][LTE_PHY][INIT] prach_vars->rxsigF[%d] = %p\n",i,prach_vars->rxsigF[i]);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
if ((eNB->node_function != NGFI_RRU_IF4p5)&&(eNB->node_function != NGFI_RRU_IF5)) {
|
||||
|
||||
AssertFatal(fp->nb_antennas_rx <= sizeof(prach_vars->prach_ifft) / sizeof(prach_vars->prach_ifft[0]),
|
||||
"nb_antennas_rx too large");
|
||||
"nb_antennas_rx too large");
|
||||
for (i=0; i<fp->nb_antennas_rx; i++) {
|
||||
prach_vars->prach_ifft[i] = (int16_t*)malloc16_clear(1024*2*sizeof(int16_t));
|
||||
#ifdef DEBUG_PHY
|
||||
@@ -1471,77 +1518,81 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB,
|
||||
}
|
||||
|
||||
for (UE_id=0; UE_id<NUMBER_OF_UE_MAX; UE_id++) {
|
||||
|
||||
|
||||
//FIXME
|
||||
pusch_vars[UE_id] = (LTE_eNB_PUSCH*)malloc16_clear( NUMBER_OF_UE_MAX*sizeof(LTE_eNB_PUSCH) );
|
||||
|
||||
|
||||
if (abstraction_flag==0) {
|
||||
for (eNB_id=0; eNB_id<3; eNB_id++) {
|
||||
|
||||
pusch_vars[UE_id]->rxdataF_ext[eNB_id] = (int32_t**)malloc16( fp->nb_antennas_rx*sizeof(int32_t*) );
|
||||
pusch_vars[UE_id]->rxdataF_ext2[eNB_id] = (int32_t**)malloc16( fp->nb_antennas_rx*sizeof(int32_t*) );
|
||||
pusch_vars[UE_id]->drs_ch_estimates[eNB_id] = (int32_t**)malloc16( fp->nb_antennas_rx*sizeof(int32_t*) );
|
||||
pusch_vars[UE_id]->drs_ch_estimates_time[eNB_id] = (int32_t**)malloc16( fp->nb_antennas_rx*sizeof(int32_t*) );
|
||||
pusch_vars[UE_id]->rxdataF_comp[eNB_id] = (int32_t**)malloc16( fp->nb_antennas_rx*sizeof(int32_t*) );
|
||||
pusch_vars[UE_id]->ul_ch_mag[eNB_id] = (int32_t**)malloc16( fp->nb_antennas_rx*sizeof(int32_t*) );
|
||||
pusch_vars[UE_id]->ul_ch_magb[eNB_id] = (int32_t**)malloc16( fp->nb_antennas_rx*sizeof(int32_t*) );
|
||||
|
||||
for (i=0; i<fp->nb_antennas_rx; i++) {
|
||||
// RK 2 times because of output format of FFT!
|
||||
// FIXME We should get rid of this
|
||||
pusch_vars[UE_id]->rxdataF_ext[eNB_id][i] = (int32_t*)malloc16_clear( 2*sizeof(int32_t)*fp->N_RB_UL*12*fp->symbols_per_tti );
|
||||
pusch_vars[UE_id]->rxdataF_ext2[eNB_id][i] = (int32_t*)malloc16_clear( sizeof(int32_t)*fp->N_RB_UL*12*fp->symbols_per_tti );
|
||||
pusch_vars[UE_id]->drs_ch_estimates[eNB_id][i] = (int32_t*)malloc16_clear( sizeof(int32_t)*fp->N_RB_UL*12*fp->symbols_per_tti );
|
||||
pusch_vars[UE_id]->drs_ch_estimates_time[eNB_id][i] = (int32_t*)malloc16_clear( 2*2*sizeof(int32_t)*fp->ofdm_symbol_size );
|
||||
pusch_vars[UE_id]->rxdataF_comp[eNB_id][i] = (int32_t*)malloc16_clear( sizeof(int32_t)*fp->N_RB_UL*12*fp->symbols_per_tti );
|
||||
pusch_vars[UE_id]->ul_ch_mag[eNB_id][i] = (int32_t*)malloc16_clear( fp->symbols_per_tti*sizeof(int32_t)*fp->N_RB_UL*12 );
|
||||
pusch_vars[UE_id]->ul_ch_magb[eNB_id][i] = (int32_t*)malloc16_clear( fp->symbols_per_tti*sizeof(int32_t)*fp->N_RB_UL*12 );
|
||||
}
|
||||
} //eNB_id
|
||||
|
||||
pusch_vars[UE_id]->llr = (int16_t*)malloc16_clear( (8*((3*8*6144)+12))*sizeof(int16_t) );
|
||||
for (eNB_id=0; eNB_id<3; eNB_id++) {
|
||||
|
||||
pusch_vars[UE_id]->rxdataF_ext[eNB_id] = (int32_t**)malloc16( fp->nb_antennas_rx*sizeof(int32_t*) );
|
||||
pusch_vars[UE_id]->rxdataF_ext2[eNB_id] = (int32_t**)malloc16( fp->nb_antennas_rx*sizeof(int32_t*) );
|
||||
pusch_vars[UE_id]->drs_ch_estimates[eNB_id] = (int32_t**)malloc16( fp->nb_antennas_rx*sizeof(int32_t*) );
|
||||
pusch_vars[UE_id]->drs_ch_estimates_time[eNB_id] = (int32_t**)malloc16( fp->nb_antennas_rx*sizeof(int32_t*) );
|
||||
pusch_vars[UE_id]->rxdataF_comp[eNB_id] = (int32_t**)malloc16( fp->nb_antennas_rx*sizeof(int32_t*) );
|
||||
pusch_vars[UE_id]->ul_ch_mag[eNB_id] = (int32_t**)malloc16( fp->nb_antennas_rx*sizeof(int32_t*) );
|
||||
pusch_vars[UE_id]->ul_ch_magb[eNB_id] = (int32_t**)malloc16( fp->nb_antennas_rx*sizeof(int32_t*) );
|
||||
|
||||
for (i=0; i<fp->nb_antennas_rx; i++) {
|
||||
// RK 2 times because of output format of FFT!
|
||||
// FIXME We should get rid of this
|
||||
pusch_vars[UE_id]->rxdataF_ext[eNB_id][i] = (int32_t*)malloc16_clear( 2*sizeof(int32_t)*fp->N_RB_UL*12*fp->symbols_per_tti );
|
||||
pusch_vars[UE_id]->rxdataF_ext2[eNB_id][i] = (int32_t*)malloc16_clear( sizeof(int32_t)*fp->N_RB_UL*12*fp->symbols_per_tti );
|
||||
pusch_vars[UE_id]->drs_ch_estimates[eNB_id][i] = (int32_t*)malloc16_clear( sizeof(int32_t)*fp->N_RB_UL*12*fp->symbols_per_tti );
|
||||
pusch_vars[UE_id]->drs_ch_estimates_time[eNB_id][i] = (int32_t*)malloc16_clear( 2*2*sizeof(int32_t)*fp->ofdm_symbol_size );
|
||||
pusch_vars[UE_id]->rxdataF_comp[eNB_id][i] = (int32_t*)malloc16_clear( sizeof(int32_t)*fp->N_RB_UL*12*fp->symbols_per_tti );
|
||||
pusch_vars[UE_id]->ul_ch_mag[eNB_id][i] = (int32_t*)malloc16_clear( fp->symbols_per_tti*sizeof(int32_t)*fp->N_RB_UL*12 );
|
||||
pusch_vars[UE_id]->ul_ch_magb[eNB_id][i] = (int32_t*)malloc16_clear( fp->symbols_per_tti*sizeof(int32_t)*fp->N_RB_UL*12 );
|
||||
}
|
||||
} //eNB_id
|
||||
|
||||
pusch_vars[UE_id]->llr = (int16_t*)malloc16_clear( (8*((3*8*6144)+12))*sizeof(int16_t) );
|
||||
} // abstraction_flag
|
||||
} //UE_id
|
||||
|
||||
|
||||
|
||||
if (abstraction_flag==0) {
|
||||
if (is_secondary_eNB) {
|
||||
for (eNB_id=0; eNB_id<3; eNB_id++) {
|
||||
eNB->dl_precoder_SeNB[eNB_id] = (int **)malloc16(4*sizeof(int*));
|
||||
|
||||
if (eNB->dl_precoder_SeNB[eNB_id]) {
|
||||
for (eNB_id=0; eNB_id<3; eNB_id++) {
|
||||
eNB->dl_precoder_SeNB[eNB_id] = (int **)malloc16(4*sizeof(int*));
|
||||
|
||||
if (eNB->dl_precoder_SeNB[eNB_id]) {
|
||||
#ifdef DEBUG_PHY
|
||||
printf("[openair][SECSYS_PHY][INIT] eNB->dl_precoder_SeNB[%d] allocated at %p\n",eNB_id,
|
||||
eNB->dl_precoder_SeNB[eNB_id]);
|
||||
printf("[openair][SECSYS_PHY][INIT] eNB->dl_precoder_SeNB[%d] allocated at %p\n",eNB_id,
|
||||
eNB->dl_precoder_SeNB[eNB_id]);
|
||||
#endif
|
||||
} else {
|
||||
printf("[openair][SECSYS_PHY][INIT] eNB->dl_precoder_SeNB[%d] not allocated\n",eNB_id);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
for (j=0; j<fp->nb_antennas_tx; j++) {
|
||||
eNB->dl_precoder_SeNB[eNB_id][j] = (int *)malloc16(2*sizeof(int)*(fp->ofdm_symbol_size)); // repeated format (hence the '2*')
|
||||
|
||||
if (eNB->dl_precoder_SeNB[eNB_id][j]) {
|
||||
} else {
|
||||
printf("[openair][SECSYS_PHY][INIT] eNB->dl_precoder_SeNB[%d] not allocated\n",eNB_id);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
for (j=0; j<fp->nb_antennas_tx; j++) {
|
||||
eNB->dl_precoder_SeNB[eNB_id][j] = (int *)malloc16(2*sizeof(int)*(fp->ofdm_symbol_size)); // repeated format (hence the '2*')
|
||||
|
||||
if (eNB->dl_precoder_SeNB[eNB_id][j]) {
|
||||
#ifdef DEBUG_PHY
|
||||
printf("[openair][LTE_PHY][INIT] eNB->dl_precoder_SeNB[%d][%d] allocated at %p\n",eNB_id,j,
|
||||
eNB->dl_precoder_SeNB[eNB_id][j]);
|
||||
printf("[openair][LTE_PHY][INIT] eNB->dl_precoder_SeNB[%d][%d] allocated at %p\n",eNB_id,j,
|
||||
eNB->dl_precoder_SeNB[eNB_id][j]);
|
||||
#endif
|
||||
memset(eNB->dl_precoder_SeNB[eNB_id][j],0,2*sizeof(int)*(fp->ofdm_symbol_size));
|
||||
} else {
|
||||
printf("[openair][LTE_PHY][INIT] eNB->dl_precoder_SeNB[%d][%d] not allocated\n",eNB_id,j);
|
||||
return(-1);
|
||||
}
|
||||
} //for(j=...nb_antennas_tx
|
||||
|
||||
} //for(eNB_id...
|
||||
memset(eNB->dl_precoder_SeNB[eNB_id][j],0,2*sizeof(int)*(fp->ofdm_symbol_size));
|
||||
} else {
|
||||
printf("[openair][LTE_PHY][INIT] eNB->dl_precoder_SeNB[%d][%d] not allocated\n",eNB_id,j);
|
||||
return(-1);
|
||||
}
|
||||
} //for(j=...nb_antennas_tx
|
||||
|
||||
} //for(eNB_id...
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
for (UE_id=0; UE_id<NUMBER_OF_UE_MAX; UE_id++)
|
||||
eNB->UE_stats_ptr[UE_id] = &eNB->UE_stats[UE_id];
|
||||
|
||||
eNB->pdsch_config_dedicated->p_a = dB0; //defaul value until overwritten by RRCConnectionReconfiguration
|
||||
|
||||
//defaul value until overwritten by RRCConnectionReconfiguration
|
||||
if (fp->nb_antenna_ports_eNB==2)
|
||||
eNB->pdsch_config_dedicated->p_a = dBm3;
|
||||
else
|
||||
eNB->pdsch_config_dedicated->p_a = dB0;
|
||||
|
||||
init_prach_tables(839);
|
||||
} // node_function != NGFI_RRU_IF4p5
|
||||
|
||||
@@ -121,9 +121,9 @@ void lte_param_init(unsigned char N_tx_port_eNB,
|
||||
UE->pdsch_config_dedicated->p_a = dB0; // 4 = 0dB
|
||||
((UE->frame_parms).pdsch_config_common).p_b = 0;
|
||||
} else { // rho_a = rhob
|
||||
eNB->pdsch_config_dedicated->p_a = dB0; // 4 = 0dB
|
||||
eNB->pdsch_config_dedicated->p_a = dBm3; // 4 = 0dB
|
||||
((eNB->frame_parms).pdsch_config_common).p_b = 1;
|
||||
UE->pdsch_config_dedicated->p_a = dB0; // 4 = 0dB
|
||||
UE->pdsch_config_dedicated->p_a = dBm3; // 4 = 0dB
|
||||
((UE->frame_parms).pdsch_config_common).p_b = 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -197,9 +197,9 @@ void ue_rrc_measurements(PHY_VARS_UE *ue,
|
||||
|
||||
if (ue->frame_parms.Ncp==NORMAL) {
|
||||
for (aarx=0; aarx<ue->frame_parms.nb_antennas_rx; aarx++) {
|
||||
|
||||
rxF_sss = (int16_t *)&ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF[aarx][(5*ue->frame_parms.ofdm_symbol_size)];
|
||||
rxF_pss = (int16_t *)&ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF[aarx][(6*ue->frame_parms.ofdm_symbol_size)];
|
||||
|
||||
|
||||
//-ve spectrum from SSS
|
||||
// printf("slot %d: SSS DTX: %d,%d, non-DTX %d,%d\n",slot,rxF_pss[-72],rxF_pss[-71],rxF_pss[-36],rxF_pss[-35]);
|
||||
@@ -298,8 +298,9 @@ void ue_rrc_measurements(PHY_VARS_UE *ue,
|
||||
rxF_sss = (int16_t *)&ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF[aarx][(6*ue->frame_parms.ofdm_symbol_size)];
|
||||
// note this is a dummy pointer, the pss is not really there!
|
||||
// in FDD the pss is in the symbol after the sss, but not in TDD
|
||||
|
||||
rxF_pss = (int16_t *)&ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF[aarx][(7*ue->frame_parms.ofdm_symbol_size)];
|
||||
|
||||
|
||||
//-ve spectrum from SSS
|
||||
// ue->measurements.n0_power[aarx] = (((int32_t)rxF_pss[-72]*rxF_pss[-72])+((int32_t)rxF_pss[-71]*rxF_pss[-71]));
|
||||
ue->measurements.n0_power[aarx] = (((int32_t)rxF_pss[-70]*rxF_pss[-70])+((int32_t)rxF_pss[-69]*rxF_pss[-69]));
|
||||
@@ -312,14 +313,14 @@ void ue_rrc_measurements(PHY_VARS_UE *ue,
|
||||
ue->measurements.n0_power[aarx] += (((int32_t)rxF_sss[2+68]*rxF_sss[2+68])+((int32_t)rxF_sss[2+67]*rxF_sss[2+67]));
|
||||
ue->measurements.n0_power[aarx] += (((int32_t)rxF_sss[2+66]*rxF_sss[2+66])+((int32_t)rxF_sss[2+65]*rxF_sss[2+65]));
|
||||
// ue->measurements.n0_power[aarx] += (((int32_t)rxF_sss[2+64]*rxF_sss[2+64])+((int32_t)rxF_sss[2+63]*rxF_sss[2+63]));
|
||||
|
||||
|
||||
ue->measurements.n0_power_dB[aarx] = (unsigned short) dB_fixed(ue->measurements.n0_power[aarx]/(6));
|
||||
ue->measurements.n0_power_tot += ue->measurements.n0_power[aarx];
|
||||
}
|
||||
ue->measurements.n0_power_tot += ue->measurements.n0_power[aarx];
|
||||
}
|
||||
ue->measurements.n0_power_tot_dB = (unsigned short) dB_fixed(ue->measurements.n0_power_tot/(6*aarx));
|
||||
ue->measurements.n0_power_tot_dBm = ue->measurements.n0_power_tot_dB - ue->rx_total_gain_dB - dB_fixed(ue->frame_parms.ofdm_symbol_size);
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -363,7 +364,7 @@ void ue_rrc_measurements(PHY_VARS_UE *ue,
|
||||
// if ((ue->frame_rx&0x3ff) == 0)
|
||||
// printf("rb %d, off %d : %d\n",rb,off,((rxF[off]*rxF[off])+(rxF[off+1]*rxF[off+1])));
|
||||
|
||||
|
||||
|
||||
off+=12;
|
||||
|
||||
if (off>=(ue->frame_parms.ofdm_symbol_size<<1))
|
||||
@@ -474,6 +475,14 @@ void lte_ue_measurements(PHY_VARS_UE *ue,
|
||||
LTE_DL_FRAME_PARMS *frame_parms = &ue->frame_parms;
|
||||
int nb_subbands,subband_size,last_subband_size;
|
||||
int N_RB_DL = frame_parms->N_RB_DL;
|
||||
ue->measurements.nb_antennas_rx = frame_parms->nb_antennas_rx;
|
||||
|
||||
if (ue->transmission_mode[eNB_id]!=4)
|
||||
ue->measurements.rank[eNB_id] = 0;
|
||||
else
|
||||
ue->measurements.rank[eNB_id] = 1;
|
||||
// printf ("tx mode %d\n", ue->transmission_mode[eNB_id]);
|
||||
// printf ("rank %d\n", ue->PHY_measurements.rank[eNB_id]);
|
||||
|
||||
switch (N_RB_DL) {
|
||||
case 6:
|
||||
@@ -625,6 +634,7 @@ void lte_ue_measurements(PHY_VARS_UE *ue,
|
||||
}
|
||||
|
||||
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
|
||||
//printf("aarx=%d", aarx);
|
||||
// skip the first 4 RE due to interpolation filter length of 5 (not possible to skip 5 due to 128i alignment, must be multiple of 128bit)
|
||||
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
@@ -644,9 +654,11 @@ void lte_ue_measurements(PHY_VARS_UE *ue,
|
||||
|
||||
// pmi
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
pmi128_re = _mm_setzero_si128();
|
||||
pmi128_im = _mm_setzero_si128();
|
||||
|
||||
pmi128_re = _mm_xor_si128(pmi128_re,pmi128_re);
|
||||
pmi128_im = _mm_xor_si128(pmi128_im,pmi128_im);
|
||||
#elif defined(__arm__)
|
||||
|
||||
pmi128_re = vdupq_n_s32(0);
|
||||
pmi128_im = vdupq_n_s32(0);
|
||||
#endif
|
||||
@@ -659,18 +671,52 @@ void lte_ue_measurements(PHY_VARS_UE *ue,
|
||||
|
||||
for (i=0; i<limit; i++) {
|
||||
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
mmtmpPMI0 = _mm_xor_si128(mmtmpPMI0,mmtmpPMI0);
|
||||
mmtmpPMI1 = _mm_xor_si128(mmtmpPMI1,mmtmpPMI1);
|
||||
|
||||
// For each RE in subband perform ch0 * conj(ch1)
|
||||
// multiply by conjugated channel
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
mmtmpPMI1 = _mm_shufflelo_epi16(dl_ch1_128[0],_MM_SHUFFLE(2,3,0,1));//_MM_SHUFFLE(2,3,0,1)
|
||||
mmtmpPMI1 = _mm_shufflehi_epi16(mmtmpPMI1,_MM_SHUFFLE(2,3,0,1));
|
||||
mmtmpPMI1 = _mm_sign_epi16(mmtmpPMI1,*(__m128i*)&conjugate[0]);
|
||||
mmtmpPMI1 = _mm_madd_epi16(mmtmpPMI1,dl_ch0_128[0]);
|
||||
// mmtmpPMI1 contains imag part of 4 consecutive outputs (32-bit)
|
||||
// print_ints("ch0",&dl_ch0_128[0]);
|
||||
// print_ints("ch1",&dl_ch1_128[0]);
|
||||
|
||||
mmtmpPMI0 = _mm_madd_epi16(dl_ch0_128[0],dl_ch1_128[0]);
|
||||
// print_ints("re",&mmtmpPMI0);
|
||||
mmtmpPMI1 = _mm_shufflelo_epi16(dl_ch1_128[0],_MM_SHUFFLE(2,3,0,1));
|
||||
// print_ints("_mm_shufflelo_epi16",&mmtmpPMI1);
|
||||
mmtmpPMI1 = _mm_shufflehi_epi16(mmtmpPMI1,_MM_SHUFFLE(2,3,0,1));
|
||||
// print_ints("_mm_shufflehi_epi16",&mmtmpPMI1);
|
||||
mmtmpPMI1 = _mm_sign_epi16(mmtmpPMI1,*(__m128i*)&conjugate[0]);
|
||||
// print_ints("_mm_sign_epi16",&mmtmpPMI1);
|
||||
mmtmpPMI1 = _mm_madd_epi16(mmtmpPMI1,dl_ch0_128[0]);
|
||||
// print_ints("mm_madd_epi16",&mmtmpPMI1);
|
||||
// mmtmpPMI1 contains imag part of 4 consecutive outputs (32-bit)
|
||||
pmi128_re = _mm_add_epi32(pmi128_re,mmtmpPMI0);
|
||||
// print_ints(" pmi128_re 0",&pmi128_re);
|
||||
pmi128_im = _mm_add_epi32(pmi128_im,mmtmpPMI1);
|
||||
// print_ints(" pmi128_im 0 ",&pmi128_im);
|
||||
|
||||
/* mmtmpPMI0 = _mm_xor_si128(mmtmpPMI0,mmtmpPMI0);
|
||||
mmtmpPMI1 = _mm_xor_si128(mmtmpPMI1,mmtmpPMI1);
|
||||
|
||||
mmtmpPMI0 = _mm_madd_epi16(dl_ch0_128[1],dl_ch1_128[1]);
|
||||
// print_ints("re",&mmtmpPMI0);
|
||||
mmtmpPMI1 = _mm_shufflelo_epi16(dl_ch1_128[1],_MM_SHUFFLE(2,3,0,1));
|
||||
// print_ints("_mm_shufflelo_epi16",&mmtmpPMI1);
|
||||
mmtmpPMI1 = _mm_shufflehi_epi16(mmtmpPMI1,_MM_SHUFFLE(2,3,0,1));
|
||||
// print_ints("_mm_shufflehi_epi16",&mmtmpPMI1);
|
||||
mmtmpPMI1 = _mm_sign_epi16(mmtmpPMI1,*(__m128i*)&conjugate);
|
||||
// print_ints("_mm_sign_epi16",&mmtmpPMI1);
|
||||
mmtmpPMI1 = _mm_madd_epi16(mmtmpPMI1,dl_ch0_128[1]);
|
||||
// print_ints("mm_madd_epi16",&mmtmpPMI1);
|
||||
// mmtmpPMI1 contains imag part of 4 consecutive outputs (32-bit)
|
||||
pmi128_re = _mm_add_epi32(pmi128_re,mmtmpPMI0);
|
||||
// print_ints(" pmi128_re 1",&pmi128_re);
|
||||
pmi128_im = _mm_add_epi32(pmi128_im,mmtmpPMI1);
|
||||
//print_ints(" pmi128_im 1 ",&pmi128_im);*/
|
||||
|
||||
#elif defined(__arm__)
|
||||
|
||||
mmtmpPMI0 = vmull_s16(((int16x4_t*)dl_ch0_128)[0], ((int16x4_t*)dl_ch1_128)[0]);
|
||||
mmtmpPMI1 = vmull_s16(((int16x4_t*)dl_ch0_128)[1], ((int16x4_t*)dl_ch1_128)[1]);
|
||||
pmi128_re = vqaddq_s32(pmi128_re,vcombine_s32(vpadd_s32(vget_low_s32(mmtmpPMI0),vget_high_s32(mmtmpPMI0)),vpadd_s32(vget_low_s32(mmtmpPMI1),vget_high_s32(mmtmpPMI1))));
|
||||
@@ -730,7 +776,7 @@ void lte_ue_measurements(PHY_VARS_UE *ue,
|
||||
}
|
||||
}
|
||||
|
||||
ue->measurements.rank[eNB_id] = 0;
|
||||
//ue->measurements.rank[eNB_id] = 0;
|
||||
|
||||
for (i=0; i<nb_subbands; i++) {
|
||||
ue->measurements.selected_rx_antennas[eNB_id][i] = 0;
|
||||
|
||||
Regular → Executable
+1257
-732
File diff suppressed because it is too large
Load Diff
Regular → Executable
+20
-3
@@ -79,11 +79,17 @@
|
||||
#if !defined(C_RNTI)
|
||||
#define C_RNTI (rnti_t)0x1234
|
||||
#endif
|
||||
|
||||
#define PMI_2A_11 0
|
||||
// These are the codebook indexes according to Table 6.3.4.2.3-1 of 36.211
|
||||
//1 layer
|
||||
#define PMI_2A_11 0
|
||||
#define PMI_2A_1m1 1
|
||||
#define PMI_2A_1j 2
|
||||
#define PMI_2A_1j 2
|
||||
#define PMI_2A_1mj 3
|
||||
//2 layers
|
||||
#define PMI_2A_R1_10 0
|
||||
#define PMI_2A_R1_11 1
|
||||
#define PMI_2A_R1_1j 2
|
||||
|
||||
|
||||
typedef enum {
|
||||
SCH_IDLE,
|
||||
@@ -158,6 +164,8 @@ typedef struct {
|
||||
uint8_t Nlayers;
|
||||
/// First layer for this PSCH transmission
|
||||
uint8_t first_layer;
|
||||
/// codeword this transport block is mapped to
|
||||
uint8_t codeword;
|
||||
} LTE_DL_eNB_HARQ_t;
|
||||
|
||||
typedef struct {
|
||||
@@ -584,6 +592,8 @@ typedef struct {
|
||||
uint32_t trials[8];
|
||||
/// error statistics per round
|
||||
uint32_t errors[8];
|
||||
/// codeword this transport block is mapped to
|
||||
uint8_t codeword;
|
||||
} LTE_DL_UE_HARQ_t;
|
||||
|
||||
typedef struct {
|
||||
@@ -754,6 +764,13 @@ typedef enum {
|
||||
PMCH
|
||||
} PDSCH_t;
|
||||
|
||||
typedef enum {
|
||||
rx_standard=0,
|
||||
rx_IC_single_stream,
|
||||
rx_IC_dual_stream,
|
||||
rx_SIC_dual_stream
|
||||
} RX_type_t;
|
||||
|
||||
typedef enum {
|
||||
pucch_format1=0,
|
||||
pucch_format1a,
|
||||
|
||||
@@ -85,11 +85,11 @@ void free_eNB_dlsch(LTE_eNB_DLSCH_t *dlsch)
|
||||
#endif
|
||||
|
||||
for (r=0; r<MAX_NUM_DLSCH_SEGMENTS; r++) {
|
||||
|
||||
|
||||
#ifdef DEBUG_DLSCH_FREE
|
||||
printf("Freeing dlsch process %d c[%d] (%p)\n",i,r,dlsch->harq_processes[i]->c[r]);
|
||||
#endif
|
||||
|
||||
|
||||
if (dlsch->harq_processes[i]->c[r]) {
|
||||
free16(dlsch->harq_processes[i]->c[r],((r==0)?8:0) + 3+768);
|
||||
dlsch->harq_processes[i]->c[r] = NULL;
|
||||
@@ -98,17 +98,17 @@ void free_eNB_dlsch(LTE_eNB_DLSCH_t *dlsch)
|
||||
free16(dlsch->harq_processes[i]->d[r],(96+12+3+(3*6144)));
|
||||
dlsch->harq_processes[i]->d[r] = NULL;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
free16(dlsch->harq_processes[i],sizeof(LTE_DL_eNB_HARQ_t));
|
||||
dlsch->harq_processes[i] = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
free16(dlsch,sizeof(LTE_eNB_DLSCH_t));
|
||||
dlsch = NULL;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
LTE_eNB_DLSCH_t *new_eNB_dlsch(unsigned char Kmimo,unsigned char Mdlharq,uint32_t Nsoft,unsigned char N_RB_DL, uint8_t abstraction_flag, LTE_DL_FRAME_PARMS* frame_parms)
|
||||
@@ -148,7 +148,7 @@ LTE_eNB_DLSCH_t *new_eNB_dlsch(unsigned char Kmimo,unsigned char Mdlharq,uint32_
|
||||
|
||||
for (layer=0; layer<4; layer++) {
|
||||
dlsch->ue_spec_bf_weights[layer] = (int32_t**)malloc16(frame_parms->nb_antennas_tx*sizeof(int32_t*));
|
||||
|
||||
|
||||
for (aa=0; aa<frame_parms->nb_antennas_tx; aa++) {
|
||||
dlsch->ue_spec_bf_weights[layer][aa] = (int32_t *)malloc16(OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES*sizeof(int32_t));
|
||||
for (re=0;re<OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES; re++) {
|
||||
@@ -160,7 +160,7 @@ LTE_eNB_DLSCH_t *new_eNB_dlsch(unsigned char Kmimo,unsigned char Mdlharq,uint32_
|
||||
dlsch->calib_dl_ch_estimates = (int32_t**)malloc16(frame_parms->nb_antennas_tx*sizeof(int32_t*));
|
||||
for (aa=0; aa<frame_parms->nb_antennas_tx; aa++) {
|
||||
dlsch->calib_dl_ch_estimates[aa] = (int32_t *)malloc16(OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES*sizeof(int32_t));
|
||||
|
||||
|
||||
}
|
||||
|
||||
for (i=0; i<10; i++)
|
||||
@@ -207,7 +207,7 @@ LTE_eNB_DLSCH_t *new_eNB_dlsch(unsigned char Kmimo,unsigned char Mdlharq,uint32_
|
||||
exit_flag=3;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (exit_flag==0) {
|
||||
for (i=0; i<Mdlharq; i++) {
|
||||
dlsch->harq_processes[i]->round=0;
|
||||
@@ -218,7 +218,7 @@ LTE_eNB_DLSCH_t *new_eNB_dlsch(unsigned char Kmimo,unsigned char Mdlharq,uint32_
|
||||
if (dlsch->harq_processes[i]->d[r])
|
||||
dlsch->harq_processes[i]->d[r][j] = LTE_NULL;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
return(dlsch);
|
||||
@@ -257,7 +257,7 @@ void clean_eNb_dlsch(LTE_eNB_DLSCH_t *dlsch)
|
||||
for (r=0; r<MAX_NUM_DLSCH_SEGMENTS; r++)
|
||||
if (dlsch->harq_processes[i]->d[r])
|
||||
dlsch->harq_processes[i]->d[r][j] = LTE_NULL;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -352,7 +352,7 @@ void *te_thread(void *param) {
|
||||
while (!oai_exit) {
|
||||
|
||||
|
||||
if (wait_on_condition(&proc->mutex_te,&proc->cond_te,&proc->instance_cnt_te,"te thread")<0) break;
|
||||
if (wait_on_condition(&proc->mutex_te,&proc->cond_te,&proc->instance_cnt_te,"te thread")<0) break;
|
||||
|
||||
dlsch_encoding_2threads0((te_params*)param);
|
||||
|
||||
@@ -432,14 +432,14 @@ int dlsch_encoding_2threads(PHY_VARS_eNB *eNB,
|
||||
return(-1);
|
||||
}
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_ENCODING, VCD_FUNCTION_OUT);
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_ENCODING, VCD_FUNCTION_OUT);
|
||||
++proc->instance_cnt_te;
|
||||
|
||||
proc->tep.eNB = eNB;
|
||||
proc->tep.dlsch = dlsch;
|
||||
proc->tep.G = G;
|
||||
|
||||
// wakeup worker to do second half segments
|
||||
// wakeup worker to do second half segments
|
||||
if (pthread_cond_signal(&proc->cond_te) != 0) {
|
||||
printf("[eNB] ERROR pthread_cond_signal for te thread exit\n");
|
||||
exit_fun( "ERROR pthread_cond_signal" );
|
||||
@@ -497,8 +497,8 @@ int dlsch_encoding_2threads(PHY_VARS_eNB *eNB,
|
||||
proc->tep.eNB = eNB;
|
||||
proc->tep.dlsch = dlsch;
|
||||
proc->tep.G = G;
|
||||
|
||||
// wakeup worker to do second half segments
|
||||
|
||||
// wakeup worker to do second half segments
|
||||
if (pthread_cond_signal(&proc->cond_te) != 0) {
|
||||
printf("[eNB] ERROR pthread_cond_signal for te thread exit\n");
|
||||
exit_fun( "ERROR pthread_cond_signal" );
|
||||
@@ -545,9 +545,9 @@ int dlsch_encoding_2threads(PHY_VARS_eNB *eNB,
|
||||
|
||||
// wait for worker to finish
|
||||
|
||||
wait_on_busy_condition(&proc->mutex_te,&proc->cond_te,&proc->instance_cnt_te,"te thread");
|
||||
wait_on_busy_condition(&proc->mutex_te,&proc->cond_te,&proc->instance_cnt_te,"te thread");
|
||||
|
||||
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_ENCODING, VCD_FUNCTION_OUT);
|
||||
|
||||
return(0);
|
||||
@@ -729,6 +729,186 @@ int dlsch_encoding(PHY_VARS_eNB *eNB,
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
int dlsch_encoding_SIC(PHY_VARS_UE *ue,
|
||||
unsigned char *a,
|
||||
uint8_t num_pdcch_symbols,
|
||||
LTE_eNB_DLSCH_t *dlsch,
|
||||
int frame,
|
||||
uint8_t subframe,
|
||||
time_stats_t *rm_stats,
|
||||
time_stats_t *te_stats,
|
||||
time_stats_t *i_stats)
|
||||
{
|
||||
|
||||
unsigned int G;
|
||||
unsigned int crc=1;
|
||||
unsigned short iind;
|
||||
|
||||
LTE_DL_FRAME_PARMS *frame_parms = &ue->frame_parms;
|
||||
unsigned char harq_pid = dlsch->current_harq_pid;
|
||||
unsigned short nb_rb = dlsch->harq_processes[harq_pid]->nb_rb;
|
||||
unsigned int A;
|
||||
unsigned char mod_order;
|
||||
unsigned int Kr=0,Kr_bytes,r,r_offset=0;
|
||||
unsigned short m=dlsch->harq_processes[harq_pid]->mcs;
|
||||
uint8_t beamforming_mode=0;
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_ENCODING, VCD_FUNCTION_IN);
|
||||
|
||||
A = dlsch->harq_processes[harq_pid]->TBS; //6228
|
||||
// printf("Encoder: A: %d\n",A);
|
||||
mod_order = get_Qm(dlsch->harq_processes[harq_pid]->mcs);
|
||||
|
||||
if(dlsch->harq_processes[harq_pid]->mimo_mode == TM7)
|
||||
beamforming_mode = 7;
|
||||
else if(dlsch->harq_processes[harq_pid]->mimo_mode == TM8)
|
||||
beamforming_mode = 8;
|
||||
else if(dlsch->harq_processes[harq_pid]->mimo_mode == TM9_10)
|
||||
beamforming_mode = 9;
|
||||
G = get_G(frame_parms,nb_rb,dlsch->harq_processes[harq_pid]->rb_alloc,mod_order,dlsch->harq_processes[harq_pid]->Nl,num_pdcch_symbols,frame,subframe,beamforming_mode);
|
||||
|
||||
|
||||
// if (dlsch->harq_processes[harq_pid]->Ndi == 1) { // this is a new packet
|
||||
if (dlsch->harq_processes[harq_pid]->round == 0) { // this is a new packet
|
||||
|
||||
/*
|
||||
int i;
|
||||
printf("dlsch (tx): \n");
|
||||
for (i=0;i<(A>>3);i++)
|
||||
printf("%02x.",a[i]);
|
||||
printf("\n");
|
||||
*/
|
||||
// Add 24-bit crc (polynomial A) to payload
|
||||
crc = crc24a(a,
|
||||
A)>>8;
|
||||
a[A>>3] = ((uint8_t*)&crc)[2];
|
||||
a[1+(A>>3)] = ((uint8_t*)&crc)[1];
|
||||
a[2+(A>>3)] = ((uint8_t*)&crc)[0];
|
||||
// printf("CRC %x (A %d)\n",crc,A);
|
||||
|
||||
dlsch->harq_processes[harq_pid]->B = A+24;
|
||||
// dlsch->harq_processes[harq_pid]->b = a;
|
||||
memcpy(dlsch->harq_processes[harq_pid]->b,a,(A/8)+4);
|
||||
|
||||
if (lte_segmentation(dlsch->harq_processes[harq_pid]->b,
|
||||
dlsch->harq_processes[harq_pid]->c,
|
||||
dlsch->harq_processes[harq_pid]->B,
|
||||
&dlsch->harq_processes[harq_pid]->C,
|
||||
&dlsch->harq_processes[harq_pid]->Cplus,
|
||||
&dlsch->harq_processes[harq_pid]->Cminus,
|
||||
&dlsch->harq_processes[harq_pid]->Kplus,
|
||||
&dlsch->harq_processes[harq_pid]->Kminus,
|
||||
&dlsch->harq_processes[harq_pid]->F)<0)
|
||||
return(-1);
|
||||
|
||||
for (r=0; r<dlsch->harq_processes[harq_pid]->C; r++) {
|
||||
|
||||
if (r<dlsch->harq_processes[harq_pid]->Cminus)
|
||||
Kr = dlsch->harq_processes[harq_pid]->Kminus;
|
||||
else
|
||||
Kr = dlsch->harq_processes[harq_pid]->Kplus;
|
||||
|
||||
Kr_bytes = Kr>>3;
|
||||
|
||||
// get interleaver index for Turbo code (lookup in Table 5.1.3-3 36-212, V8.6 2009-03, p. 13-14)
|
||||
if (Kr_bytes<=64)
|
||||
iind = (Kr_bytes-5);
|
||||
else if (Kr_bytes <=128)
|
||||
iind = 59 + ((Kr_bytes-64)>>1);
|
||||
else if (Kr_bytes <= 256)
|
||||
iind = 91 + ((Kr_bytes-128)>>2);
|
||||
else if (Kr_bytes <= 768)
|
||||
iind = 123 + ((Kr_bytes-256)>>3);
|
||||
else {
|
||||
printf("dlsch_coding: Illegal codeword size %d!!!\n",Kr_bytes);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
|
||||
#ifdef DEBUG_DLSCH_CODING
|
||||
printf("Generating Code Segment %d (%d bits)\n",r,Kr);
|
||||
// generate codewords
|
||||
|
||||
printf("bits_per_codeword (Kr)= %d, A %d\n",Kr,A);
|
||||
printf("N_RB = %d\n",nb_rb);
|
||||
printf("Ncp %d\n",frame_parms->Ncp);
|
||||
printf("mod_order %d\n",mod_order);
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef DEBUG_DLSCH_CODING
|
||||
printf("Encoding ... iind %d f1 %d, f2 %d\n",iind,f1f2mat_old[iind*2],f1f2mat_old[(iind*2)+1]);
|
||||
#endif
|
||||
start_meas(te_stats);
|
||||
threegpplte_turbo_encoder(dlsch->harq_processes[harq_pid]->c[r],
|
||||
Kr>>3,
|
||||
&dlsch->harq_processes[harq_pid]->d[r][96],
|
||||
(r==0) ? dlsch->harq_processes[harq_pid]->F : 0,
|
||||
f1f2mat_old[iind*2], // f1 (see 36121-820, page 14)
|
||||
f1f2mat_old[(iind*2)+1] // f2 (see 36121-820, page 14)
|
||||
);
|
||||
stop_meas(te_stats);
|
||||
#ifdef DEBUG_DLSCH_CODING
|
||||
|
||||
if (r==0)
|
||||
write_output("enc_output0.m","enc0",&dlsch->harq_processes[harq_pid]->d[r][96],(3*8*Kr_bytes)+12,1,4);
|
||||
|
||||
#endif
|
||||
start_meas(i_stats);
|
||||
dlsch->harq_processes[harq_pid]->RTC[r] =
|
||||
sub_block_interleaving_turbo(4+(Kr_bytes*8),
|
||||
&dlsch->harq_processes[harq_pid]->d[r][96],
|
||||
dlsch->harq_processes[harq_pid]->w[r]);
|
||||
stop_meas(i_stats);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Fill in the "e"-sequence from 36-212, V8.6 2009-03, p. 16-17 (for each "e") and concatenate the
|
||||
// outputs for each code segment, see Section 5.1.5 p.20
|
||||
|
||||
for (r=0; r<dlsch->harq_processes[harq_pid]->C; r++) {
|
||||
#ifdef DEBUG_DLSCH_CODING
|
||||
printf("Rate Matching, Code segment %d (coded bits (G) %d,unpunctured/repeated bits per code segment %d,mod_order %d, nb_rb %d)...\n",
|
||||
r,
|
||||
G,
|
||||
Kr*3,
|
||||
mod_order,nb_rb);
|
||||
#endif
|
||||
|
||||
start_meas(rm_stats);
|
||||
r_offset += lte_rate_matching_turbo(dlsch->harq_processes[harq_pid]->RTC[r],
|
||||
G, //G
|
||||
dlsch->harq_processes[harq_pid]->w[r],
|
||||
dlsch->harq_processes[harq_pid]->e+r_offset,
|
||||
dlsch->harq_processes[harq_pid]->C, // C
|
||||
dlsch->Nsoft, // Nsoft,
|
||||
dlsch->Mdlharq,
|
||||
dlsch->Kmimo,
|
||||
dlsch->harq_processes[harq_pid]->rvidx,
|
||||
get_Qm(dlsch->harq_processes[harq_pid]->mcs),
|
||||
dlsch->harq_processes[harq_pid]->Nl,
|
||||
r,
|
||||
nb_rb,
|
||||
m); // r
|
||||
stop_meas(rm_stats);
|
||||
#ifdef DEBUG_DLSCH_CODING
|
||||
|
||||
if (r==dlsch->harq_processes[harq_pid]->C-1)
|
||||
write_output("enc_output.m","enc",dlsch->harq_processes[harq_pid]->e,r_offset,1,4);
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_ENCODING, VCD_FUNCTION_OUT);
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#ifdef PHY_ABSTRACTION
|
||||
void dlsch_encoding_emul(PHY_VARS_eNB *phy_vars_eNB,
|
||||
uint8_t *DLSCH_pdu,
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
#include "SCHED/extern.h"
|
||||
#include "SIMULATION/TOOLS/defs.h"
|
||||
//#define DEBUG_DLSCH_DECODING
|
||||
|
||||
|
||||
|
||||
void free_ue_dlsch(LTE_UE_DLSCH_t *dlsch)
|
||||
{
|
||||
@@ -343,7 +343,7 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue,
|
||||
|
||||
for (r=0; r<harq_process->C; r++) {
|
||||
|
||||
|
||||
|
||||
// Get Turbo interleaver parameters
|
||||
if (r<harq_process->Cminus)
|
||||
Kr = harq_process->Kminus;
|
||||
@@ -387,7 +387,7 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue,
|
||||
harq_process->round);
|
||||
#endif
|
||||
|
||||
|
||||
//printf("dlsch->harq_processes[harq_pid]->rvidx = %d\n", dlsch->harq_processes[harq_pid]->rvidx);
|
||||
if (lte_rate_matching_turbo_rx(harq_process->RTC[r],
|
||||
G,
|
||||
harq_process->w[r],
|
||||
@@ -486,7 +486,7 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue,
|
||||
stop_meas(dlsch_turbo_decoding_stats);
|
||||
}
|
||||
#else
|
||||
if ((harq_process->C == 1) ||
|
||||
if ((harq_process->C == 1) ||
|
||||
((r==harq_process->C-1) && (skipped_last==0))) { // last segment with odd number of segments
|
||||
|
||||
start_meas(dlsch_turbo_decoding_stats);
|
||||
@@ -518,7 +518,7 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue,
|
||||
}
|
||||
else {
|
||||
skipped_last=0;
|
||||
|
||||
|
||||
if (Kr_last == Kr) { // decode 2 code segments with AVX2 version
|
||||
#ifdef DEBUG_DLSCH_DECODING
|
||||
printf("single decoding segment %d (%p)\n",r-1,&harq_process->d[r-1][96]);
|
||||
@@ -565,7 +565,7 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue,
|
||||
|
||||
exit(-1);*/
|
||||
stop_meas(dlsch_turbo_decoding_stats);
|
||||
}
|
||||
}
|
||||
else { // Kr_last != Kr
|
||||
start_meas(dlsch_turbo_decoding_stats);
|
||||
ret = tc
|
||||
@@ -585,7 +585,7 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue,
|
||||
&phy_vars_ue->dlsch_tc_intl1_stats,
|
||||
&phy_vars_ue->dlsch_tc_intl2_stats); //(is_crnti==0)?harq_pid:harq_pid+1);
|
||||
stop_meas(dlsch_turbo_decoding_stats);
|
||||
|
||||
|
||||
start_meas(dlsch_turbo_decoding_stats);
|
||||
ret = tc
|
||||
(&harq_process->d[r][96],
|
||||
@@ -604,7 +604,7 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue,
|
||||
&phy_vars_ue->dlsch_tc_intl1_stats,
|
||||
&phy_vars_ue->dlsch_tc_intl2_stats); //(is_crnti==0)?harq_pid:harq_pid+1);
|
||||
stop_meas(dlsch_turbo_decoding_stats);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -747,7 +747,7 @@ int dlsch_abstraction_EESM(double* sinr_dB, uint8_t TM, uint32_t rb_alloc[4], ui
|
||||
|
||||
bler = interp(sinr_eff,&sinr_bler_map[mcs][0][0],&sinr_bler_map[mcs][1][0],table_length[mcs]);
|
||||
|
||||
#ifdef USER_MODE // need to be adapted for the emulation in the kernel space
|
||||
#ifdef USER_MODE // need to be adapted for the emulation in the kernel space
|
||||
|
||||
if (uniformrandom() < bler) {
|
||||
LOG_I(OCM,"abstraction_decoding failed (mcs=%d, sinr_eff=%f, bler=%f, TM %d)\n",mcs,sinr_eff,bler, TM);
|
||||
@@ -830,7 +830,7 @@ int dlsch_abstraction_MIESM(double* sinr_dB,uint8_t TM, uint32_t rb_alloc[4], ui
|
||||
|
||||
bler = interp(sinr_eff,&sinr_bler_map[mcs][0][0],&sinr_bler_map[mcs][1][0],table_length[mcs]);
|
||||
|
||||
#ifdef USER_MODE // need to be adapted for the emulation in the kernel space
|
||||
#ifdef USER_MODE // need to be adapted for the emulation in the kernel space
|
||||
|
||||
if (uniformrandom() < bler) {
|
||||
LOG_N(OCM,"abstraction_decoding failed (mcs=%d, sinr_eff=%f, bler=%f)\n",mcs,sinr_eff,bler);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -31,6 +31,7 @@
|
||||
*/
|
||||
|
||||
#include "PHY/defs.h"
|
||||
#include "PHY/TOOLS/defs.h"
|
||||
#include "PHY/extern.h"
|
||||
#include "defs.h"
|
||||
#include "extern.h"
|
||||
@@ -667,11 +668,11 @@ int dlsch_qpsk_llr(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
}
|
||||
|
||||
|
||||
// printf("dlsch_qpsk_llr: symbol %d,nb_rb %d, len %d,pbch_pss_sss_adjust %d\n",symbol,nb_rb,len,pbch_pss_sss_adjust);
|
||||
|
||||
//printf("dlsch_qpsk_llr: symbol %d,nb_rb %d, len %d,pbch_pss_sss_adjust %d\n",symbol,nb_rb,len,pbch_pss_sss_adjust);
|
||||
//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]);
|
||||
//printf("llr %d : (%d,%d)\n",i,((int16_t*)llr32)[0],((int16_t*)llr32)[1]);
|
||||
rxF++;
|
||||
llr32++;
|
||||
}
|
||||
@@ -681,6 +682,131 @@ int dlsch_qpsk_llr(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
return(0);
|
||||
}
|
||||
|
||||
int32_t dlsch_qpsk_llr_SIC(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
int32_t **rxdataF_comp,
|
||||
int32_t **sic_buffer, //Q15
|
||||
int32_t **rho_i,
|
||||
short *dlsch_llr,
|
||||
uint8_t num_pdcch_symbols,
|
||||
uint16_t nb_rb,
|
||||
uint8_t subframe,
|
||||
uint32_t rb_alloc,
|
||||
uint16_t mod_order_0,
|
||||
LTE_UE_DLSCH_t *dlsch0)
|
||||
{
|
||||
|
||||
int16_t rho_amp_x0[2*frame_parms->N_RB_DL*12];
|
||||
int16_t rho_rho_amp_x0[2*frame_parms->N_RB_DL*12];
|
||||
int16_t clean_x1[2*frame_parms->N_RB_DL*12];
|
||||
uint16_t amp_tmp;
|
||||
uint16_t *llr16=(uint16_t*)dlsch_llr;
|
||||
int i, len, nsymb;
|
||||
uint8_t symbol, symbol_mod;
|
||||
//uint8_t pilots;
|
||||
int len_acc=0;
|
||||
uint16_t *sic_data;
|
||||
uint16_t pbch_pss_sss_adjust;
|
||||
|
||||
nsymb = (frame_parms->Ncp==0) ? 14:12;
|
||||
|
||||
for (symbol=num_pdcch_symbols; symbol<nsymb; symbol++) {
|
||||
uint16_t *rxF = (uint16_t*)(&rxdataF_comp[0][((int16_t)symbol*frame_parms->N_RB_DL*12)]);
|
||||
int16_t *rho_1=(int16_t*)(&rho_i[0][((int16_t)symbol*frame_parms->N_RB_DL*12)]);
|
||||
sic_data = (uint16_t*)&sic_buffer[0][((int16_t)len_acc)];
|
||||
|
||||
symbol_mod = (symbol>=(7-frame_parms->Ncp)) ? symbol-(7-frame_parms->Ncp) : symbol;
|
||||
|
||||
|
||||
|
||||
|
||||
if ((symbol_mod == 0) || (symbol_mod == (4-frame_parms->Ncp))) //pilots=1
|
||||
amp_tmp=dlsch0->sqrt_rho_b;
|
||||
else //pilots=0
|
||||
amp_tmp=dlsch0->sqrt_rho_a;
|
||||
|
||||
if (mod_order_0==6)
|
||||
amp_tmp=amp_tmp<<1; // to compensate for >> 1 shift in modulation
|
||||
|
||||
|
||||
pbch_pss_sss_adjust=adjust_G2(frame_parms,&rb_alloc,2,subframe,symbol);
|
||||
|
||||
// printf("amp_tmp=%d\n", amp_tmp);
|
||||
|
||||
if ((symbol_mod==0) || (symbol_mod==(4-frame_parms->Ncp))) {
|
||||
if (frame_parms->mode1_flag==0)
|
||||
len = (nb_rb*8) - (2*pbch_pss_sss_adjust/3);
|
||||
else
|
||||
len = (nb_rb*10) - (5*pbch_pss_sss_adjust/6);
|
||||
} else {
|
||||
len = (nb_rb*12) - pbch_pss_sss_adjust;
|
||||
}
|
||||
|
||||
// printf("dlsch_qpsk_llr: symbol %d,nb_rb %d, len %d,pbch_pss_sss_adjust %d\n",symbol,nb_rb,len,pbch_pss_sss_adjust);
|
||||
|
||||
len_acc+=len; //accumulated length; this is done because in sic_buffer we have only data symbols
|
||||
|
||||
multadd_complex_vector_real_scalar((int16_t *)sic_data,
|
||||
amp_tmp,
|
||||
(int16_t *)rho_amp_x0, //this is in Q13
|
||||
1,
|
||||
len);
|
||||
|
||||
|
||||
// printf ("Got x0*rho_a\n");
|
||||
|
||||
mult_cpx_vector((int16_t *)rho_1, //Q15
|
||||
(int16_t *)rho_amp_x0, //Q13
|
||||
(int16_t*)rho_rho_amp_x0,
|
||||
len,
|
||||
13);
|
||||
/* write_output("rho_for_multipl.m","rho_for_multipl", rho_1,len,1,
|
||||
symbol==num_pdcch_symbols ? 15 :
|
||||
symbol==nsymb-1 ? 14 : 13);
|
||||
|
||||
write_output("rho_rho_in_llr.m","rho2", rho_rho_amp_x0,len,1,
|
||||
symbol==num_pdcch_symbols ? 15 :
|
||||
symbol==nsymb-1 ? 14 : 13);
|
||||
// printf ("Computed rho*rho_a*x0\n");*/
|
||||
|
||||
|
||||
//rho_rho_amp_x0_512 = (int16_t)((512*(int16_t *)rho_rho_amp_x0)>>15);
|
||||
|
||||
|
||||
sub_cpx_vector16((int16_t *)rxF,
|
||||
(int16_t *)rho_rho_amp_x0,
|
||||
//(int16_t *)clean_x1,
|
||||
(int16_t *)rxF,
|
||||
len*2);
|
||||
|
||||
// write_output("rxFdata_comp1_after.m","rxF_a", rxF,len,1,1);
|
||||
// write_output("clean_x1.m","x1", clean_x1,len,1,1);
|
||||
// printf ("Interference removed \n");
|
||||
/* write_output("clean_x1.m","x1", clean_x1,len,1,
|
||||
symbol==num_pdcch_symbols ? 15 :
|
||||
symbol==nsymb-1 ? 14 : 13);
|
||||
|
||||
write_output("rxF_comp1.m","rxF_1_comp", rxF,len,1,
|
||||
symbol==num_pdcch_symbols ? 15 :
|
||||
symbol==nsymb-1 ? 14 : 13);*/
|
||||
|
||||
// printf("dlsch_qpsk_llr_SIC: symbol %d,nb_rb %d, len %d,pbch_pss_sss_adjust %d\n",symbol,nb_rb,len,pbch_pss_sss_adjust);
|
||||
|
||||
|
||||
//this is for QPSK only!!!
|
||||
for (i=0; i<len*2; i++) {
|
||||
*llr16 =rxF[i]; //clean_x1[i];//(int16_t *)rxF[i];//clean_x1[i]; //(int16_t *)rxF[i];//; //rxF[i];
|
||||
//printf("llr %d : (%d,%d)\n",i,((int16_t*)llr32)[0],((int16_t*)llr32)[1]);
|
||||
llr16++;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// printf("dlsch_qpsk_llr_SIC: acc_len=%d\n",len_acc);
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------------------------
|
||||
// 16-QAM
|
||||
//----------------------------------------------------------------------------------------------
|
||||
@@ -754,10 +880,13 @@ void dlsch_16qam_llr(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
else
|
||||
*llr32p += (len<<2);
|
||||
|
||||
// printf("len=%d\n", len);
|
||||
len_mod4 = len&3;
|
||||
// printf("len_mod4=%d\n", len_mod4);
|
||||
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++) {
|
||||
|
||||
#if defined(__x86_64__) || defined(__i386)
|
||||
@@ -808,6 +937,117 @@ void dlsch_16qam_llr(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
#endif
|
||||
}
|
||||
|
||||
void dlsch_16qam_llr_SIC (LTE_DL_FRAME_PARMS *frame_parms,
|
||||
int32_t **rxdataF_comp,
|
||||
int32_t **sic_buffer, //Q15
|
||||
int32_t **rho_i,
|
||||
int16_t *dlsch_llr,
|
||||
uint8_t num_pdcch_symbols,
|
||||
int32_t **dl_ch_mag,
|
||||
uint16_t nb_rb,
|
||||
uint8_t subframe,
|
||||
uint32_t rb_alloc,
|
||||
uint16_t mod_order_0,
|
||||
LTE_UE_DLSCH_t *dlsch0
|
||||
)
|
||||
{
|
||||
int16_t rho_amp_x0[2*frame_parms->N_RB_DL*12];
|
||||
int16_t rho_rho_amp_x0[2*frame_parms->N_RB_DL*12];
|
||||
int16_t clean_x1[2*frame_parms->N_RB_DL*12];
|
||||
uint16_t amp_tmp;
|
||||
uint32_t *llr32=(uint32_t*)dlsch_llr;
|
||||
int i, len, nsymb;
|
||||
uint8_t symbol, symbol_mod;
|
||||
//uint8_t pilots;
|
||||
int len_acc=0;
|
||||
uint16_t *sic_data;
|
||||
uint16_t pbch_pss_sss_adjust;
|
||||
unsigned char len_mod4=0;
|
||||
__m128i llr128[2];
|
||||
__m128i *ch_mag;
|
||||
nsymb = (frame_parms->Ncp==0) ? 14:12;
|
||||
|
||||
for (symbol=num_pdcch_symbols; symbol<nsymb; symbol++) {
|
||||
uint16_t *rxF = (uint16_t*)(&rxdataF_comp[0][((int16_t)symbol*frame_parms->N_RB_DL*12)]);
|
||||
int16_t *rho_1=(int16_t*)(&rho_i[0][((int16_t)symbol*frame_parms->N_RB_DL*12)]);
|
||||
ch_mag = (__m128i*)(&dl_ch_mag[0][((int16_t)symbol*frame_parms->N_RB_DL*12)]);
|
||||
sic_data = (uint16_t*)(&sic_buffer[0][((int16_t)len_acc)]);
|
||||
|
||||
symbol_mod = (symbol>=(7-frame_parms->Ncp)) ? symbol-(7-frame_parms->Ncp) : symbol;
|
||||
|
||||
pbch_pss_sss_adjust=adjust_G2(frame_parms,&rb_alloc,4,subframe,symbol);
|
||||
|
||||
|
||||
if ((symbol_mod==0) || (symbol_mod==(4-frame_parms->Ncp))) {
|
||||
|
||||
amp_tmp=dlsch0->sqrt_rho_b;
|
||||
if (frame_parms->mode1_flag==0)
|
||||
len = nb_rb*8 - (2*pbch_pss_sss_adjust/3);
|
||||
else
|
||||
len = nb_rb*10 - (5*pbch_pss_sss_adjust/6);
|
||||
} else {
|
||||
|
||||
amp_tmp=dlsch0->sqrt_rho_a;
|
||||
len = nb_rb*12 - pbch_pss_sss_adjust;
|
||||
}
|
||||
|
||||
if (mod_order_0==6)
|
||||
amp_tmp=amp_tmp<<1; // to compensate for >> 1 shift in modulation
|
||||
|
||||
len_acc+=len;
|
||||
|
||||
multadd_complex_vector_real_scalar((int16_t *)sic_data,
|
||||
amp_tmp,
|
||||
(int16_t *)rho_amp_x0, //this is in Q13
|
||||
1,
|
||||
len);
|
||||
|
||||
mult_cpx_vector((int16_t *)rho_1, //Q15
|
||||
(int16_t *)rho_amp_x0, //Q13
|
||||
(int16_t*)rho_rho_amp_x0,
|
||||
len,
|
||||
13);
|
||||
|
||||
sub_cpx_vector16((int16_t *)rxF,
|
||||
(int16_t *)rho_rho_amp_x0,
|
||||
//(int16_t *)clean_x1,
|
||||
(int16_t *)rxF,
|
||||
len*2);
|
||||
|
||||
len_mod4 = len&3;
|
||||
len>>=2; // length in quad words (4 REs)
|
||||
len+=(len_mod4==0 ? 0 : 1);
|
||||
|
||||
for (i=0; i<len; i++) {
|
||||
|
||||
|
||||
__m128i *x1 = (__m128i*)rxF;//clean_x1;
|
||||
//printf("%p %p %p\n", clean_x1, &clean_x1, &clean_x1[0]);
|
||||
//int *a = malloc(10*sizeof(int));
|
||||
//printf("%p %p\n", a, &a);
|
||||
//exit(0);
|
||||
xmm0 = _mm_abs_epi16(x1[i]);
|
||||
xmm0 = _mm_subs_epi16(ch_mag[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(x1[i],xmm0);
|
||||
llr128[1] = _mm_unpackhi_epi32(x1[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[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];
|
||||
llr32[5] = _mm_extract_epi32(llr128[1],1); //((uint32_t *)&llr128[1])[1];
|
||||
llr32[6] = _mm_extract_epi32(llr128[1],2); //((uint32_t *)&llr128[1])[2];
|
||||
llr32[7] = _mm_extract_epi32(llr128[1],3); //((uint32_t *)&llr128[1])[3];
|
||||
llr32+=8;
|
||||
|
||||
}
|
||||
_mm_empty();
|
||||
_m_empty();
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------
|
||||
// 64-QAM
|
||||
//----------------------------------------------------------------------------------------------
|
||||
@@ -893,7 +1133,7 @@ void dlsch_64qam_llr(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
llr2[4] = ((short *)&xmm2)[j];
|
||||
llr2[5] = ((short *)&xmm2)[j+1];
|
||||
|
||||
llr2+=6;
|
||||
llr2+=6;
|
||||
}
|
||||
*/
|
||||
llr2[0] = ((short *)&rxF[i])[0];
|
||||
@@ -964,7 +1204,162 @@ void dlsch_64qam_llr(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
#endif
|
||||
}
|
||||
|
||||
//#if 0
|
||||
void dlsch_64qam_llr_SIC(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
int32_t **rxdataF_comp,
|
||||
int32_t **sic_buffer, //Q15
|
||||
int32_t **rho_i,
|
||||
int16_t *dlsch_llr,
|
||||
uint8_t num_pdcch_symbols,
|
||||
int32_t **dl_ch_mag,
|
||||
int32_t **dl_ch_magb,
|
||||
uint16_t nb_rb,
|
||||
uint8_t subframe,
|
||||
uint32_t rb_alloc,
|
||||
uint16_t mod_order_0,
|
||||
LTE_UE_DLSCH_t *dlsch0
|
||||
)
|
||||
{
|
||||
int16_t rho_amp_x0[2*frame_parms->N_RB_DL*12];
|
||||
int16_t rho_rho_amp_x0[2*frame_parms->N_RB_DL*12];
|
||||
int16_t clean_x1[2*frame_parms->N_RB_DL*12];
|
||||
uint16_t amp_tmp;
|
||||
uint16_t *llr32=(uint16_t*)dlsch_llr;
|
||||
int i, len, nsymb, len2;
|
||||
uint8_t symbol, symbol_mod;
|
||||
int len_acc=0;
|
||||
uint16_t *sic_data;
|
||||
uint16_t pbch_pss_sss_adjust;
|
||||
unsigned char len_mod4=0;
|
||||
uint16_t *llr2;
|
||||
__m128i *ch_mag,*ch_magb;
|
||||
|
||||
nsymb = (frame_parms->Ncp==0) ? 14:12;
|
||||
|
||||
for (symbol=num_pdcch_symbols; symbol<nsymb; symbol++) {
|
||||
uint16_t *rxF = (uint16_t*)(&rxdataF_comp[0][((int16_t)symbol*frame_parms->N_RB_DL*12)]);
|
||||
int16_t *rho_1=(int16_t*)(&rho_i[0][((int16_t)symbol*frame_parms->N_RB_DL*12)]);
|
||||
ch_mag = (__m128i*)(&dl_ch_mag[0][((int16_t)symbol*frame_parms->N_RB_DL*12)]);
|
||||
ch_magb = (__m128i*)(&dl_ch_magb[0][((int16_t)symbol*frame_parms->N_RB_DL*12)]);
|
||||
sic_data = (uint16_t*)(&sic_buffer[0][((int16_t)len_acc)]);
|
||||
|
||||
symbol_mod = (symbol>=(7-frame_parms->Ncp)) ? symbol-(7-frame_parms->Ncp) : symbol;
|
||||
|
||||
pbch_pss_sss_adjust=adjust_G2(frame_parms,&rb_alloc,6,subframe,symbol);
|
||||
|
||||
if ((symbol_mod==0) || (symbol_mod==(4-frame_parms->Ncp))) {
|
||||
|
||||
amp_tmp = dlsch0->sqrt_rho_b;
|
||||
if (frame_parms->mode1_flag==0)
|
||||
len = nb_rb*8 - (2*pbch_pss_sss_adjust/3);
|
||||
else
|
||||
len = nb_rb*10 - (5*pbch_pss_sss_adjust/6);
|
||||
} else {
|
||||
|
||||
amp_tmp = dlsch0->sqrt_rho_a;
|
||||
len = nb_rb*12 - pbch_pss_sss_adjust;
|
||||
}
|
||||
|
||||
if (mod_order_0==6)
|
||||
amp_tmp=amp_tmp<<1; // to compensate for >> 1 shift in modulation
|
||||
|
||||
len_acc+=len;
|
||||
|
||||
multadd_complex_vector_real_scalar((int16_t *)sic_data,
|
||||
amp_tmp,
|
||||
(int16_t *)rho_amp_x0, //this is in Q13
|
||||
1,
|
||||
len);
|
||||
|
||||
mult_cpx_vector((int16_t *)rho_1, //Q15
|
||||
(int16_t *)rho_amp_x0, //Q13
|
||||
(int16_t*)rho_rho_amp_x0,
|
||||
len,
|
||||
13);
|
||||
|
||||
sub_cpx_vector16((int16_t *)rxF,
|
||||
(int16_t *)rho_rho_amp_x0,
|
||||
//(int16_t *)clean_x1,
|
||||
(int16_t *)rxF,
|
||||
len*2);
|
||||
|
||||
llr2 = llr32;
|
||||
llr32 += (len*6);
|
||||
|
||||
len_mod4 =len&3;
|
||||
len2=len>>2; // length in quad words (4 REs)
|
||||
len2+=(len_mod4?0:1);
|
||||
|
||||
|
||||
|
||||
for (i=0; i<len2; i++) {
|
||||
|
||||
__m128i *x1 = (__m128i*)rxF;
|
||||
xmm1 = _mm_abs_epi16(x1[i]);
|
||||
xmm1 = _mm_subs_epi16(ch_mag[i],xmm1);
|
||||
xmm2 = _mm_abs_epi16(xmm1);
|
||||
xmm2 = _mm_subs_epi16(ch_magb[i],xmm2);
|
||||
|
||||
// loop over all LLRs in quad word (24 coded bits)
|
||||
/*
|
||||
for (j=0;j<8;j+=2) {
|
||||
llr2[0] = ((short *)&rxF[i])[j];
|
||||
llr2[1] = ((short *)&rxF[i])[j+1];
|
||||
llr2[2] = ((short *)&xmm1)[j];
|
||||
llr2[3] = ((short *)&xmm1)[j+1];
|
||||
llr2[4] = ((short *)&xmm2)[j];
|
||||
llr2[5] = ((short *)&xmm2)[j+1];
|
||||
|
||||
llr2+=6;
|
||||
}
|
||||
*/
|
||||
llr2[0] = ((short *)&x1[i])[0];
|
||||
llr2[1] = ((short *)&x1[i])[1];
|
||||
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];
|
||||
|
||||
|
||||
llr2+=6;
|
||||
llr2[0] = ((short *)&x1[i])[2];
|
||||
llr2[1] = ((short *)&x1[i])[3];
|
||||
|
||||
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];
|
||||
|
||||
llr2+=6;
|
||||
llr2[0] = ((short *)&x1[i])[4];
|
||||
llr2[1] = ((short *)&x1[i])[5];
|
||||
|
||||
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];
|
||||
|
||||
llr2+=6;
|
||||
llr2[0] = ((short *)&x1[i])[6];
|
||||
llr2[1] = ((short *)&x1[i])[7];
|
||||
|
||||
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];
|
||||
|
||||
llr2+=6;
|
||||
|
||||
}
|
||||
|
||||
// *llr_save = llr;
|
||||
|
||||
_mm_empty();
|
||||
_m_empty();
|
||||
|
||||
}
|
||||
}
|
||||
//#endif
|
||||
//==============================================================================================
|
||||
// DUAL-STREAM
|
||||
//==============================================================================================
|
||||
@@ -1033,6 +1428,7 @@ int dlsch_qpsk_qpsk_llr(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
len = (nb_rb*12) - pbch_pss_sss_adjust;
|
||||
}
|
||||
|
||||
// printf("dlsch_qpsk_qpsk_llr: symbol %d,nb_rb %d, len %d,pbch_pss_sss_adjust %d\n",symbol,nb_rb,len,pbch_pss_sss_adjust);
|
||||
// printf("qpsk_qpsk: len %d, llr16 %p\n",len,llr16);
|
||||
qpsk_qpsk((short *)rxF,
|
||||
(short *)rxF_i,
|
||||
@@ -1053,7 +1449,7 @@ void qpsk_qpsk(short *stream0_in,
|
||||
short *stream0_out,
|
||||
short *rho01,
|
||||
int length
|
||||
)
|
||||
)
|
||||
{
|
||||
|
||||
/*
|
||||
@@ -1313,7 +1709,7 @@ void qpsk_qam16(int16_t *stream0_in,
|
||||
int16_t *stream0_out,
|
||||
int16_t *rho01,
|
||||
int32_t length
|
||||
)
|
||||
)
|
||||
{
|
||||
/*
|
||||
This function computes the LLRs of stream 0 (s_0) in presence of the interfering stream 1 (s_1) assuming that both symbols are QPSK. It can be used for both MU-MIMO interference-aware receiver or for SU-MIMO receivers.
|
||||
@@ -1544,6 +1940,7 @@ int dlsch_qpsk_64qam_llr(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
int len;
|
||||
uint8_t symbol_mod = (symbol >= (7-frame_parms->Ncp))? (symbol-(7-frame_parms->Ncp)) : symbol;
|
||||
|
||||
|
||||
if (first_symbol_flag == 1) {
|
||||
llr16 = (int16_t*)dlsch_llr;
|
||||
} else {
|
||||
@@ -1597,7 +1994,7 @@ void qpsk_qam64(short *stream0_in,
|
||||
short *stream0_out,
|
||||
short *rho01,
|
||||
int length
|
||||
)
|
||||
)
|
||||
{
|
||||
|
||||
/*
|
||||
@@ -1849,7 +2246,7 @@ void qam16_qpsk(short *stream0_in,
|
||||
short *stream0_out,
|
||||
short *rho01,
|
||||
int length
|
||||
)
|
||||
)
|
||||
{
|
||||
|
||||
/*
|
||||
@@ -1883,7 +2280,7 @@ void qam16_qpsk(short *stream0_in,
|
||||
__m128i y0i_over_sqrt10;
|
||||
__m128i y0r_three_over_sqrt10;
|
||||
__m128i y0i_three_over_sqrt10;
|
||||
|
||||
|
||||
__m128i ch_mag_des;
|
||||
__m128i ch_mag_over_10;
|
||||
__m128i ch_mag_over_2;
|
||||
@@ -2319,7 +2716,6 @@ int dlsch_16qam_qpsk_llr(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
llr16 = (int16_t*)(*llr16p);
|
||||
}
|
||||
|
||||
|
||||
if (!llr16) {
|
||||
msg("dlsch_16qam_qpsk_llr: llr is null, symbol %d\n",symbol);
|
||||
return(-1);
|
||||
@@ -2360,7 +2756,7 @@ void qam16_qam16(short *stream0_in,
|
||||
short *stream0_out,
|
||||
short *rho01,
|
||||
int length
|
||||
)
|
||||
)
|
||||
{
|
||||
|
||||
/*
|
||||
@@ -2919,7 +3315,7 @@ void qam16_qam64(int16_t *stream0_in,
|
||||
int16_t *stream0_out,
|
||||
int16_t *rho01,
|
||||
int32_t length
|
||||
)
|
||||
)
|
||||
{
|
||||
|
||||
/*
|
||||
@@ -2945,7 +3341,7 @@ void qam16_qam64(int16_t *stream0_in,
|
||||
__m128i *ch_mag_128i = (__m128i *)ch_mag;
|
||||
__m128i *ch_mag_128i_i = (__m128i *)ch_mag_i;
|
||||
|
||||
|
||||
|
||||
__m128i ONE_OVER_SQRT_2 = _mm_set1_epi16(23170); // round(1/sqrt(2)*2^15)
|
||||
__m128i ONE_OVER_SQRT_10 = _mm_set1_epi16(20724); // round(1/sqrt(10)*2^16)
|
||||
__m128i THREE_OVER_SQRT_10 = _mm_set1_epi16(31086); // round(3/sqrt(10)*2^15)
|
||||
@@ -3595,7 +3991,7 @@ void qam64_qpsk(int16_t *stream0_in,
|
||||
int16_t *stream0_out,
|
||||
int16_t *rho01,
|
||||
int32_t length
|
||||
)
|
||||
)
|
||||
{
|
||||
|
||||
/*
|
||||
@@ -3657,7 +4053,7 @@ void qam64_qpsk(int16_t *stream0_in,
|
||||
#elif defined(__arm__)
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
int i,j;
|
||||
|
||||
for (i=0; i<length>>2; i+=2) {
|
||||
@@ -5118,7 +5514,7 @@ void qam64_qam16(short *stream0_in,
|
||||
short *stream0_out,
|
||||
short *rho01,
|
||||
int length
|
||||
)
|
||||
)
|
||||
{
|
||||
|
||||
/*
|
||||
@@ -5181,7 +5577,7 @@ void qam64_qam16(short *stream0_in,
|
||||
__m128i y0i_three_over_sqrt_21;
|
||||
__m128i y0i_five_over_sqrt_21;
|
||||
__m128i y0i_seven_over_sqrt_21;
|
||||
|
||||
|
||||
#elif defined(__arm__)
|
||||
|
||||
#endif
|
||||
@@ -6663,7 +7059,7 @@ void qam64_qam64(short *stream0_in,
|
||||
short *stream0_out,
|
||||
short *rho01,
|
||||
int length
|
||||
)
|
||||
)
|
||||
{
|
||||
|
||||
/*
|
||||
@@ -6730,7 +7126,7 @@ void qam64_qam64(short *stream0_in,
|
||||
__m128i y0i_seven_over_sqrt_21;
|
||||
__m128i ch_mag_int_with_sigma2;
|
||||
__m128i two_ch_mag_int_with_sigma2;
|
||||
__m128i three_ch_mag_int_with_sigma2;
|
||||
__m128i three_ch_mag_int_with_sigma2;
|
||||
#elif defined(__arm__)
|
||||
|
||||
#endif
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -69,9 +69,9 @@ void generate_pcfich_reg_mapping(LTE_DL_FRAME_PARMS *frame_parms)
|
||||
first_reg = pcfich_reg[3];
|
||||
}
|
||||
|
||||
//#ifdef DEBUG_PCFICH
|
||||
#ifdef DEBUG_PCFICH
|
||||
printf("pcfich_reg : %d,%d,%d,%d\n",pcfich_reg[0],pcfich_reg[1],pcfich_reg[2],pcfich_reg[3]);
|
||||
//#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
void pcfich_scrambling(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
|
||||
@@ -307,7 +307,7 @@ void generate_phich_reg_mapping(LTE_DL_FRAME_PARMS *frame_parms)
|
||||
Ngroup_PHICH<<=1;
|
||||
}
|
||||
|
||||
//#ifdef DEBUG_PHICH
|
||||
#ifdef DEBUG_PHICH
|
||||
printf("Ngroup_PHICH %d (phich_config_common.phich_resource %d,phich_config_common.phich_duration %s, NidCell %d,Ncp %d, frame_type %d), smallest pcfich REG %d, n0 %d, n1 %d (first PHICH REG %d)\n",
|
||||
((frame_parms->Ncp == NORMAL)?Ngroup_PHICH:(Ngroup_PHICH>>1)),
|
||||
frame_parms->phich_config_common.phich_resource,
|
||||
@@ -317,7 +317,7 @@ void generate_phich_reg_mapping(LTE_DL_FRAME_PARMS *frame_parms)
|
||||
n0,
|
||||
n1,
|
||||
((frame_parms->Nid_cell))%n0);
|
||||
//#endif
|
||||
#endif
|
||||
|
||||
// This is the algorithm from Section 6.9.3 in 36-211, it works only for normal PHICH duration for now ...
|
||||
|
||||
@@ -371,9 +371,9 @@ void generate_phich_reg_mapping(LTE_DL_FRAME_PARMS *frame_parms)
|
||||
if (frame_parms->phich_reg[mprime][2]>=pcfich_reg[(frame_parms->pcfich_first_reg_idx+3)&3])
|
||||
frame_parms->phich_reg[mprime][2]++;
|
||||
|
||||
//#ifdef DEBUG_PHICH
|
||||
#ifdef DEBUG_PHICH
|
||||
printf("phich_reg :%d => %d,%d,%d\n",mprime,frame_parms->phich_reg[mprime][0],frame_parms->phich_reg[mprime][1],frame_parms->phich_reg[mprime][2]);
|
||||
//#endif
|
||||
#endif
|
||||
} else { // extended PHICH duration
|
||||
frame_parms->phich_reg[mprime<<1][0] = (frame_parms->Nid_cell + mprime)%n0;
|
||||
frame_parms->phich_reg[1+(mprime<<1)][0] = (frame_parms->Nid_cell + mprime)%n0;
|
||||
|
||||
@@ -22,41 +22,44 @@
|
||||
#include "PHY/defs.h"
|
||||
#include "PHY/impl_defs_lte.h"
|
||||
|
||||
//#define DEBUG_PC 1
|
||||
|
||||
//#define DEBUG_PC 0
|
||||
/*
|
||||
double ratioPB[2][4]={{ 1.0,4.0/5.0,3.0/5.0,2.0/5.0},
|
||||
{ 5.0/4.0,1.0,3.0/4.0,1.0/2.0}};
|
||||
*/
|
||||
|
||||
double ratioPB[2][4]= {{ 0.00000, -0.96910, -2.21849, -3.97940},
|
||||
{ 0.96910, 0.00000, -1.24939, -3.01030}
|
||||
};
|
||||
double ratioPB[2][4]={{ 0.00000, -0.96910, -2.21849, -3.97940}, //in db
|
||||
{ 0.96910, 0.00000, -1.24939, -3.01030}};
|
||||
|
||||
double pa_values[8]= {-6.0,-4.77,-3.0,-1.77,0.0,1.0,2.0,3.0};
|
||||
double pa_values[8]={-6.0,-4.77,-3.0,-1.77,0.0,1.0,2.0,3.0}; //reported by higher layers
|
||||
|
||||
double get_pa_dB(PDSCH_CONFIG_DEDICATED *pdsch_config_dedicated)
|
||||
{
|
||||
return(pa_values[pdsch_config_dedicated->p_a]);
|
||||
if (pdsch_config_dedicated)
|
||||
return(pa_values[ pdsch_config_dedicated->p_a]);
|
||||
else
|
||||
return(0.0);
|
||||
}
|
||||
|
||||
double computeRhoA_eNB(PDSCH_CONFIG_DEDICATED *pdsch_config_dedicated,
|
||||
LTE_eNB_DLSCH_t *dlsch_eNB,int dl_power_off)
|
||||
{
|
||||
LTE_eNB_DLSCH_t *dlsch_eNB, int dl_power_off, uint8_t n_antenna_port){
|
||||
double rho_a_dB;
|
||||
double sqrt_rho_a_lin;
|
||||
|
||||
rho_a_dB = pa_values[ pdsch_config_dedicated->p_a];
|
||||
rho_a_dB = get_pa_dB(pdsch_config_dedicated);
|
||||
|
||||
if(!dl_power_off)
|
||||
if(!dl_power_off) //if dl_power_offset is 0, this is for MU-interference, TM5
|
||||
rho_a_dB-=10*log10(2);
|
||||
|
||||
if(n_antenna_port==4) // see TS 36.213 Section 5.2
|
||||
rho_a_dB=+10*log10(2);
|
||||
|
||||
sqrt_rho_a_lin= pow(10,(0.05*rho_a_dB));
|
||||
|
||||
dlsch_eNB->sqrt_rho_a= (short) (sqrt_rho_a_lin*pow(2,13));
|
||||
|
||||
#ifdef DEBUG_PC
|
||||
printf("sqrt_rho_a(eNB):%d\n",dlsch_eNB->sqrt_rho_a);
|
||||
#if DEBUG_PC
|
||||
printf("eNB: p_a=%d, value=%f, sqrt_rho_a=%d\n",pdsch_config_dedicated->p_a,pa_values[ pdsch_config_dedicated->p_a],dlsch_eNB->sqrt_rho_a);
|
||||
#endif
|
||||
|
||||
return(rho_a_dB);
|
||||
@@ -72,7 +75,7 @@ double computeRhoB_eNB(PDSCH_CONFIG_DEDICATED *pdsch_config_dedicated,
|
||||
double rho_a_dB, rho_b_dB;
|
||||
double sqrt_rho_b_lin;
|
||||
|
||||
rho_a_dB= computeRhoA_eNB(pdsch_config_dedicated,dlsch_eNB,dl_power_off);
|
||||
rho_a_dB= computeRhoA_eNB(pdsch_config_dedicated,dlsch_eNB,dl_power_off, n_antenna_port);
|
||||
|
||||
if(n_antenna_port>1)
|
||||
rho_b_dB= ratioPB[1][pdsch_config_common->p_b] + rho_a_dB;
|
||||
@@ -84,7 +87,7 @@ double computeRhoB_eNB(PDSCH_CONFIG_DEDICATED *pdsch_config_dedicated,
|
||||
dlsch_eNB->sqrt_rho_b= (short) (sqrt_rho_b_lin*pow(2,13));
|
||||
|
||||
#ifdef DEBUG_PC
|
||||
printf("sqrt_rho_b(eNB):%d\n",dlsch_eNB->sqrt_rho_b);
|
||||
printf("eNB: n_ant=%d, p_b=%d -> rho_b/rho_a=%f -> sqrt_rho_b=%d\n",n_antenna_port,pdsch_config_common->p_b,ratioPB[1][pdsch_config_common->p_b],dlsch_eNB->sqrt_rho_b);
|
||||
#endif
|
||||
return(rho_b_dB);
|
||||
}
|
||||
@@ -92,23 +95,28 @@ double computeRhoB_eNB(PDSCH_CONFIG_DEDICATED *pdsch_config_dedicated,
|
||||
|
||||
double computeRhoA_UE(PDSCH_CONFIG_DEDICATED *pdsch_config_dedicated,
|
||||
LTE_UE_DLSCH_t *dlsch_ue,
|
||||
unsigned char dl_power_off)
|
||||
{
|
||||
unsigned char dl_power_off,
|
||||
uint8_t n_antenna_port
|
||||
){
|
||||
|
||||
double rho_a_dB;
|
||||
double sqrt_rho_a_lin;
|
||||
|
||||
rho_a_dB = pa_values[ pdsch_config_dedicated->p_a];
|
||||
rho_a_dB = get_pa_dB(pdsch_config_dedicated);
|
||||
|
||||
if(!dl_power_off)
|
||||
rho_a_dB-=10*log10(2);
|
||||
//if dl_power_offset is 0, this is for MU-interference, TM5. But in practice UE may assume 16 or 64QAM TM4 as multiuser
|
||||
|
||||
if(n_antenna_port==4) // see TS 36.213 Section 5.2
|
||||
rho_a_dB=+10*log10(2);
|
||||
|
||||
sqrt_rho_a_lin= pow(10,(0.05*rho_a_dB));
|
||||
|
||||
dlsch_ue->sqrt_rho_a= (short) (sqrt_rho_a_lin*pow(2,13));
|
||||
|
||||
#ifdef DEBUG_PC
|
||||
printf("p_a %d, rho_a_dB: %f, sqrt_rho_a(ue):%d \n",pdsch_config_dedicated->p_a, rho_a_dB, dlsch_ue->sqrt_rho_a);
|
||||
printf("UE: p_a=%d, value=%f, dl_power_off=%d, sqrt_rho_a=%d\n",pdsch_config_dedicated->p_a,pa_values[ pdsch_config_dedicated->p_a],dl_power_off,dlsch_ue->sqrt_rho_a);
|
||||
#endif
|
||||
|
||||
return(rho_a_dB);
|
||||
@@ -124,7 +132,7 @@ double computeRhoB_UE(PDSCH_CONFIG_DEDICATED *pdsch_config_dedicated,
|
||||
double rho_a_dB, rho_b_dB;
|
||||
double sqrt_rho_b_lin;
|
||||
|
||||
rho_a_dB= computeRhoA_UE(pdsch_config_dedicated,dlsch_ue,dl_power_off);
|
||||
rho_a_dB= computeRhoA_UE(pdsch_config_dedicated,dlsch_ue,dl_power_off, n_antenna_port);
|
||||
|
||||
if(n_antenna_port>1)
|
||||
rho_b_dB= ratioPB[1][pdsch_config_common->p_b] + rho_a_dB;
|
||||
@@ -136,9 +144,7 @@ double computeRhoB_UE(PDSCH_CONFIG_DEDICATED *pdsch_config_dedicated,
|
||||
dlsch_ue->sqrt_rho_b= (short) (sqrt_rho_b_lin*pow(2,13));
|
||||
|
||||
#ifdef DEBUG_PC
|
||||
printf("p_b : %d, rho_b_dB: %f, sqrt_rho_b(ue):%d\n",pdsch_config_common->p_b, rho_b_dB, dlsch_ue->sqrt_rho_b);
|
||||
printf("UE: p_b=%d, n_ant=%d -> ratio=%f -> sqrt_rho_b=%d\n",pdsch_config_common->p_b, n_antenna_port,ratioPB[1][pdsch_config_common->p_b],dlsch_ue->sqrt_rho_b);
|
||||
#endif
|
||||
return(rho_b_dB);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -121,6 +121,18 @@ int32_t dlsch_encoding(PHY_VARS_eNB *eNB,
|
||||
time_stats_t *te_stats,
|
||||
time_stats_t *i_stats);
|
||||
|
||||
int32_t dlsch_encoding_SIC(PHY_VARS_UE *ue,
|
||||
uint8_t *a,
|
||||
uint8_t num_pdcch_symbols,
|
||||
LTE_eNB_DLSCH_t *dlsch,
|
||||
int frame,
|
||||
uint8_t subframe,
|
||||
time_stats_t *rm_stats,
|
||||
time_stats_t *te_stats,
|
||||
time_stats_t *i_stats);
|
||||
|
||||
|
||||
|
||||
/** \fn dlsch_encoding_2threads(PHY_VARS_eNB *eNB,
|
||||
uint8_t *input_buffer,
|
||||
uint8_t num_pdcch_symbols,
|
||||
@@ -180,7 +192,7 @@ void dlsch_encoding_emul(PHY_VARS_eNB *phy_vars_eNB,
|
||||
\brief Fills RB with data
|
||||
\param txdataF pointer to output data (frequency domain signal)
|
||||
\param jj index to output (from CW 1)
|
||||
\param jj index to output (from CW 2)
|
||||
\param jj2 index to output (from CW 2)
|
||||
\param re_offset index of the first RE of the RB
|
||||
\param symbol_offset index to the OFDM symbol
|
||||
\param dlsch0_harq Pointer to Transport block 0 HARQ structure
|
||||
@@ -192,7 +204,7 @@ void dlsch_encoding_emul(PHY_VARS_eNB *phy_vars_eNB,
|
||||
\param re_allocated pointer to allocation counter
|
||||
\param skip_dc offset for positive RBs
|
||||
\param skip_half indicate that first or second half of RB must be skipped for PBCH/PSS/SSS
|
||||
\param ue_spec_rs UE specific RS indicator
|
||||
\param ue_spec_rs UE specific RS indicator
|
||||
\param nb_antennas_tx_phy Physical antenna elements which can be different with antenna port number, especially in beamforming case
|
||||
\param use2ndpilots Set to use the pilots from antenna port 1 for PDSCH
|
||||
\param frame_parms Frame parameter descriptor
|
||||
@@ -281,6 +293,14 @@ int32_t dlsch_modulation(PHY_VARS_eNB* phy_vars_eNB,
|
||||
uint8_t num_pdcch_symbols,
|
||||
LTE_eNB_DLSCH_t *dlsch0,
|
||||
LTE_eNB_DLSCH_t *dlsch1);
|
||||
|
||||
int32_t dlsch_modulation_SIC(int32_t **sic_buffer,
|
||||
uint32_t sub_frame_offset,
|
||||
LTE_DL_FRAME_PARMS *frame_parms,
|
||||
uint8_t num_pdcch_symbols,
|
||||
LTE_eNB_DLSCH_t *dlsch0,
|
||||
LTE_eNB_DLSCH_t *dlsch1,
|
||||
int G);
|
||||
/*
|
||||
\brief This function is the top-level routine for generation of the sub-frame signal (frequency-domain) for MCH.
|
||||
@param txdataF Table of pointers for frequency-domain TX signals
|
||||
@@ -789,6 +809,18 @@ int32_t dlsch_qpsk_llr(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
@param beamforming_mode beamforming mode
|
||||
*/
|
||||
|
||||
int32_t dlsch_qpsk_llr_SIC(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
int **rxdataF_comp,
|
||||
int32_t **sic_buffer,
|
||||
int **rho_i,
|
||||
short *dlsch_llr,
|
||||
uint8_t num_pdcch_symbols,
|
||||
uint16_t nb_rb,
|
||||
uint8_t subframe,
|
||||
uint32_t rb_alloc,
|
||||
uint16_t mod_order_0,
|
||||
LTE_UE_DLSCH_t *dlsch0);
|
||||
|
||||
void dlsch_16qam_llr(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
int32_t **rxdataF_comp,
|
||||
int16_t *dlsch_llr,
|
||||
@@ -799,7 +831,6 @@ void dlsch_16qam_llr(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
uint16_t pbch_pss_sss_adjust,
|
||||
int16_t **llr128p,
|
||||
uint8_t beamforming_mode);
|
||||
|
||||
/**
|
||||
\brief This function generates log-likelihood ratios (decoder input) for single-stream 16QAM received waveforms
|
||||
@param frame_parms Frame descriptor structure
|
||||
@@ -813,6 +844,34 @@ void dlsch_16qam_llr(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
@param pbch_pss_sss_adjust PBCH/PSS/SSS RE adjustment (in REs)
|
||||
@param beamforming_mode beamforming mode
|
||||
*/
|
||||
void dlsch_16qam_llr_SIC (LTE_DL_FRAME_PARMS *frame_parms,
|
||||
int32_t **rxdataF_comp,
|
||||
int32_t **sic_buffer, //Q15
|
||||
int32_t **rho_i,
|
||||
int16_t *dlsch_llr,
|
||||
uint8_t num_pdcch_symbols,
|
||||
int32_t **dl_ch_mag,
|
||||
uint16_t nb_rb,
|
||||
uint8_t subframe,
|
||||
uint32_t rb_alloc,
|
||||
uint16_t mod_order_0,
|
||||
LTE_UE_DLSCH_t *dlsch0);
|
||||
|
||||
void dlsch_64qam_llr_SIC(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
int32_t **rxdataF_comp,
|
||||
int32_t **sic_buffer, //Q15
|
||||
int32_t **rho_i,
|
||||
int16_t *dlsch_llr,
|
||||
uint8_t num_pdcch_symbols,
|
||||
int32_t **dl_ch_mag,
|
||||
int32_t **dl_ch_magb,
|
||||
uint16_t nb_rb,
|
||||
uint8_t subframe,
|
||||
uint32_t rb_alloc,
|
||||
uint16_t mod_order_0,
|
||||
LTE_UE_DLSCH_t *dlsch0);
|
||||
|
||||
|
||||
void dlsch_64qam_llr(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
int32_t **rxdataF_comp,
|
||||
int16_t *dlsch_llr,
|
||||
@@ -825,6 +884,7 @@ void dlsch_64qam_llr(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
int16_t **llr_save,
|
||||
uint8_t beamforming_mode);
|
||||
|
||||
|
||||
/** \fn dlsch_siso(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
int32_t **rxdataF_comp,
|
||||
int32_t **rxdataF_comp_i,
|
||||
@@ -922,6 +982,14 @@ void dlsch_detection_mrc(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
uint16_t nb_rb,
|
||||
uint8_t dual_stream_UE);
|
||||
|
||||
void dlsch_detection_mrc_TM34(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
LTE_UE_PDSCH *lte_ue_pdsch_vars,
|
||||
int harq_pid,
|
||||
int round,
|
||||
unsigned char symbol,
|
||||
unsigned short nb_rb,
|
||||
unsigned char dual_stream_UE);
|
||||
|
||||
/** \fn dlsch_extract_rbs_single(int32_t **rxdataF,
|
||||
int32_t **dl_ch_estimates,
|
||||
int32_t **rxdataF_ext,
|
||||
@@ -992,7 +1060,8 @@ uint16_t dlsch_extract_rbs_dual(int32_t **rxdataF,
|
||||
uint8_t symbol,
|
||||
uint8_t subframe,
|
||||
uint32_t high_speed_flag,
|
||||
LTE_DL_FRAME_PARMS *frame_parms);
|
||||
LTE_DL_FRAME_PARMS *frame_parms,
|
||||
MIMO_mode_t mimo_mode);
|
||||
|
||||
/** \fn dlsch_extract_rbs_TM7(int32_t **rxdataF,
|
||||
int32_t **dl_bf_ch_estimates,
|
||||
@@ -1062,6 +1131,15 @@ void dlsch_dual_stream_correlation(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
int **dl_ch_rho_ext,
|
||||
unsigned char output_shift);
|
||||
|
||||
void dlsch_dual_stream_correlationTM34(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
unsigned char symbol,
|
||||
unsigned short nb_rb,
|
||||
int **dl_ch_estimates_ext,
|
||||
int **dl_ch_estimates_ext_i,
|
||||
int **dl_ch_rho_ext,
|
||||
unsigned char output_shift0,
|
||||
unsigned char output_shift1);
|
||||
|
||||
void dlsch_channel_compensation_TM56(int **rxdataF_ext,
|
||||
int **dl_ch_estimates_ext,
|
||||
int **dl_ch_mag,
|
||||
@@ -1077,16 +1155,20 @@ void dlsch_channel_compensation_TM56(int **rxdataF_ext,
|
||||
unsigned char output_shift,
|
||||
unsigned char dl_power_off);
|
||||
|
||||
void dlsch_channel_compensation_TM3(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
|
||||
void dlsch_channel_compensation_TM34(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
LTE_UE_PDSCH *lte_ue_pdsch_vars,
|
||||
PHY_MEASUREMENTS *phy_measurements,
|
||||
int eNB_id,
|
||||
unsigned char symbol,
|
||||
unsigned char mod_order0,
|
||||
unsigned char mod_order1,
|
||||
int harq_pid,
|
||||
int round,
|
||||
MIMO_mode_t mimo_mode,
|
||||
unsigned short nb_rb,
|
||||
unsigned char output_shift);
|
||||
unsigned char output_shift0,
|
||||
unsigned char output_shift1);
|
||||
|
||||
|
||||
/** \brief This function computes the average channel level over all allocated RBs and antennas (TX/RX) in order to compute output shift for compensated signal
|
||||
@@ -1102,11 +1184,16 @@ void dlsch_channel_level(int32_t **dl_ch_estimates_ext,
|
||||
uint8_t pilots_flag,
|
||||
uint16_t nb_rb);
|
||||
|
||||
void dlsch_channel_level_TM3(int **dl_ch_estimates_ext,
|
||||
LTE_DL_FRAME_PARMS *frame_parms,
|
||||
int *avg,
|
||||
uint8_t symbol,
|
||||
unsigned short nb_rb);
|
||||
|
||||
void dlsch_channel_level_TM34(int **dl_ch_estimates_ext,
|
||||
LTE_DL_FRAME_PARMS *frame_parms,
|
||||
unsigned char *pmi_ext,
|
||||
int *avg_0,
|
||||
int *avg_1,
|
||||
uint8_t symbol,
|
||||
unsigned short nb_rb,
|
||||
MIMO_mode_t mimo_mode);
|
||||
|
||||
|
||||
void dlsch_channel_level_TM56(int32_t **dl_ch_estimates_ext,
|
||||
LTE_DL_FRAME_PARMS *frame_parms,
|
||||
@@ -1167,6 +1254,7 @@ uint32_t dlsch_decoding_emul(PHY_VARS_UE *phy_vars_ue,
|
||||
- RE extraction (pilot, PBCH, synch. signals)
|
||||
- antenna combining (MRC, Alamouti, cycling)
|
||||
- LLR computation
|
||||
This function supports TM1, 2, 3, 5, and 6.
|
||||
@param phy_vars_ue Pointer to PHY variables
|
||||
@param type Type of PDSCH (SI_PDSCH,RA_PDSCH,PDSCH,PMCH)
|
||||
@param eNB_id eNb index (Nid1) 0,1,2
|
||||
@@ -1174,7 +1262,7 @@ uint32_t dlsch_decoding_emul(PHY_VARS_UE *phy_vars_ue,
|
||||
@param subframe Subframe number
|
||||
@param symbol Symbol on which to act (within sub-frame)
|
||||
@param first_symbol_flag set to 1 on first DLSCH symbol
|
||||
@param dual_stream_UE Flag to indicate dual-stream interference cancellation
|
||||
@param rx_type. rx_type=RX_IC_single_stream will enable interference cancellation of a second stream when decoding the first stream. In case of TM1, 2, 5, and this can cancel interference from a neighbouring cell given by eNB_id_i. In case of TM5, eNB_id_i should be set to n_connected_eNB to perform multi-user interference cancellation. In case of TM3, eNB_id_i should be set to eNB_id to perform co-channel interference cancellation; this option should be used together with an interference cancellation step [...]. In case of TM3, if rx_type=RX_IC_dual_stream, both streams will be decoded by applying the IC single stream receiver twice.
|
||||
@param i_mod Modulation order of the interfering stream
|
||||
*/
|
||||
int32_t rx_pdsch(PHY_VARS_UE *phy_vars_ue,
|
||||
@@ -1185,7 +1273,7 @@ int32_t rx_pdsch(PHY_VARS_UE *phy_vars_ue,
|
||||
uint8_t subframe,
|
||||
uint8_t symbol,
|
||||
uint8_t first_symbol_flag,
|
||||
uint8_t dual_stream_UE,
|
||||
RX_type_t rx_type,
|
||||
uint8_t i_mod,
|
||||
uint8_t harq_pid);
|
||||
|
||||
@@ -1397,7 +1485,7 @@ uint32_t get_TBS_UL(uint8_t mcs, uint16_t nb_rb);
|
||||
*/
|
||||
uint32_t get_prb(int N_RB_DL,int odd_slot,int vrb,int Ngap);
|
||||
|
||||
/* \brief Return prb for a given vrb index
|
||||
/* \brief Return prb for a given vrb index
|
||||
@param vrb_type VRB type (0=localized,1=distributed)
|
||||
@param rb_alloc_dci rballoc field from DCI
|
||||
*/
|
||||
@@ -1521,7 +1609,7 @@ uint8_t subframe2harq_pid(LTE_DL_FRAME_PARMS *frame_parms,frame_t frame,uint8_t
|
||||
uint8_t subframe2harq_pid_eNBrx(LTE_DL_FRAME_PARMS *frame_parms,uint8_t subframe);
|
||||
|
||||
int generate_ue_dlsch_params_from_dci(int frame,
|
||||
uint8_t subframe,
|
||||
uint8_t subframe,
|
||||
void *dci_pdu,
|
||||
rnti_t rnti,
|
||||
DCI_format_t dci_format,
|
||||
@@ -1591,10 +1679,6 @@ int generate_eNB_ulsch_params_from_dci(PHY_VARS_eNB *PHY_vars_eNB,
|
||||
|
||||
void dump_ulsch(PHY_VARS_eNB *phy_vars_eNB,eNB_rxtx_proc_t *proc,uint8_t UE_id);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
int dump_dci(LTE_DL_FRAME_PARMS *frame_parms, DCI_ALLOC_t *dci);
|
||||
|
||||
int dump_ue_stats(PHY_VARS_UE *phy_vars_ue, UE_rxtx_proc_t *proc, char* buffer, int length, runmode_t mode, int input_level_dBm);
|
||||
@@ -1771,10 +1855,20 @@ void print_CQI(void *o,UCI_format_t uci_format,uint8_t eNB_id,int N_RB_DL);
|
||||
void extract_CQI(void *o,UCI_format_t uci_format,LTE_eNB_UE_stats *stats,uint8_t N_RB_DL, uint16_t * crnti, uint8_t * access_mode);
|
||||
|
||||
void fill_CQI(LTE_UE_ULSCH_t *ulsch,PHY_MEASUREMENTS *meas,uint8_t eNB_id, uint8_t harq_pid,int N_RB_DL, rnti_t rnti, uint8_t trans_mode,double sinr_eff);
|
||||
|
||||
void reset_cba_uci(void *o);
|
||||
|
||||
/** \brief This routine computes the subband PMI bitmap based on measurements (0,1,2,3 for rank 0 and 0,1 for rank 1) in the format needed for UCI
|
||||
@param meas pointer to measurements
|
||||
@param eNB_id eNB_id
|
||||
@param nb_subbands number of subbands
|
||||
@returns subband PMI bitmap
|
||||
*/
|
||||
uint16_t quantize_subband_pmi(PHY_MEASUREMENTS *meas,uint8_t eNB_id,int nb_subbands);
|
||||
uint16_t quantize_subband_pmi2(PHY_MEASUREMENTS *meas,uint8_t eNB_id,uint8_t a_id,int nb_subbands);
|
||||
|
||||
int32_t pmi_convert_rank1_from_rank2(uint16_t pmi_alloc, int tpmi, int nb_rb);
|
||||
|
||||
//uint16_t quantize_subband_pmi2(PHY_MEASUREMENTS *meas,uint8_t eNB_id,uint8_t a_id,int nb_subbands);
|
||||
|
||||
uint64_t pmi2hex_2Ar1(uint32_t pmi);
|
||||
|
||||
@@ -1784,14 +1878,29 @@ uint64_t cqi2hex(uint32_t cqi);
|
||||
|
||||
uint16_t computeRIV(uint16_t N_RB_DL,uint16_t RBstart,uint16_t Lcrbs);
|
||||
|
||||
uint32_t pmi_extend(LTE_DL_FRAME_PARMS *frame_parms,uint8_t wideband_pmi);
|
||||
/** \brief This routine expands a single (wideband) PMI to subband PMI bitmap similar to the one used in the UCI and in the dlsch_modulation routine
|
||||
@param frame_parms Pointer to DL frame configuration parameters
|
||||
@param wideband_pmi (0,1,2,3 for rank 0 and 0,1 for rank 1)
|
||||
@param rank (0 or 1)
|
||||
@returns subband PMI bitmap
|
||||
*/
|
||||
uint32_t pmi_extend(LTE_DL_FRAME_PARMS *frame_parms,uint8_t wideband_pmi, uint8_t rank);
|
||||
|
||||
/** \brief This routine extracts a single subband PMI from a bitmap coming from UCI or the pmi_extend function
|
||||
@param N_RB_DL number of resource blocks
|
||||
@param mimo_mode
|
||||
@param pmi_alloc subband PMI bitmap
|
||||
@param rb resource block for which to extract PMI
|
||||
@returns subband PMI
|
||||
*/
|
||||
uint8_t get_pmi(uint8_t N_RB_DL,MIMO_mode_t mode, uint32_t pmi_alloc,uint16_t rb);
|
||||
|
||||
int get_nCCE_offset_l1(int *CCE_table,
|
||||
const unsigned char L,
|
||||
const int nCCE,
|
||||
const int common_dci,
|
||||
const unsigned short rnti,
|
||||
const unsigned char subframe);
|
||||
const unsigned char L,
|
||||
const int nCCE,
|
||||
const int common_dci,
|
||||
const unsigned short rnti,
|
||||
const unsigned char subframe);
|
||||
|
||||
uint16_t get_nCCE(uint8_t num_pdcch_symbols,LTE_DL_FRAME_PARMS *frame_parms,uint8_t mi);
|
||||
|
||||
@@ -1867,15 +1976,15 @@ void generate_pucch_emul(PHY_VARS_UE *phy_vars_ue,
|
||||
|
||||
|
||||
uint32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB,
|
||||
PUCCH_FMT_t fmt,
|
||||
uint8_t UE_id,
|
||||
uint16_t n1_pucch,
|
||||
uint16_t n2_pucch,
|
||||
uint8_t shortened_format,
|
||||
uint8_t *payload,
|
||||
int frame,
|
||||
uint8_t subframe,
|
||||
uint8_t pucch1_thres);
|
||||
PUCCH_FMT_t fmt,
|
||||
uint8_t UE_id,
|
||||
uint16_t n1_pucch,
|
||||
uint16_t n2_pucch,
|
||||
uint8_t shortened_format,
|
||||
uint8_t *payload,
|
||||
int frame,
|
||||
uint8_t subframe,
|
||||
uint8_t pucch1_thres);
|
||||
|
||||
int32_t rx_pucch_emul(PHY_VARS_eNB *phy_vars_eNB,
|
||||
eNB_rxtx_proc_t *proc,
|
||||
@@ -1885,7 +1994,6 @@ int32_t rx_pucch_emul(PHY_VARS_eNB *phy_vars_eNB,
|
||||
uint8_t *payload);
|
||||
|
||||
|
||||
|
||||
/*!
|
||||
\brief Check for PRACH TXop in subframe
|
||||
@param frame_parms Pointer to LTE_DL_FRAME_PARMS
|
||||
@@ -1979,16 +2087,19 @@ double get_pa_dB(PDSCH_CONFIG_DEDICATED *pdsch_config_dedicated);
|
||||
|
||||
double computeRhoA_eNB(PDSCH_CONFIG_DEDICATED *pdsch_config_dedicated,
|
||||
LTE_eNB_DLSCH_t *dlsch_eNB,
|
||||
int dl_power_off);
|
||||
int dl_power_off,
|
||||
uint8_t n_antenna_port);
|
||||
|
||||
double computeRhoB_eNB(PDSCH_CONFIG_DEDICATED *pdsch_config_dedicated,
|
||||
PDSCH_CONFIG_COMMON *pdsch_config_common,
|
||||
uint8_t n_antenna_port,
|
||||
LTE_eNB_DLSCH_t *dlsch_eNB,int dl_power_off);
|
||||
LTE_eNB_DLSCH_t *dlsch_eNB,
|
||||
int dl_power_off);
|
||||
|
||||
double computeRhoA_UE(PDSCH_CONFIG_DEDICATED *pdsch_config_dedicated,
|
||||
LTE_UE_DLSCH_t *dlsch_ue,
|
||||
uint8_t dl_power_off);
|
||||
uint8_t dl_power_off,
|
||||
uint8_t n_antenna_port);
|
||||
|
||||
double computeRhoB_UE(PDSCH_CONFIG_DEDICATED *pdsch_config_dedicated,
|
||||
PDSCH_CONFIG_COMMON *pdsch_config_common,
|
||||
@@ -2002,7 +2113,7 @@ double computeRhoB_UE(PDSCH_CONFIG_DEDICATED *pdsch_config_dedicated,
|
||||
LTE_UE_DLSCH_t *dlsch_ue);
|
||||
*/
|
||||
|
||||
uint8_t get_prach_prb_offset(LTE_DL_FRAME_PARMS *frame_parms, uint8_t tdd_mapindex, uint16_t Nf);
|
||||
uint8_t get_prach_prb_offset(LTE_DL_FRAME_PARMS *frame_parms, uint8_t tdd_mapindex, uint16_t Nf);
|
||||
|
||||
uint8_t ul_subframe2pdcch_alloc_subframe(LTE_DL_FRAME_PARMS *frame_parms,uint8_t n);
|
||||
|
||||
|
||||
@@ -168,6 +168,7 @@ void extract_CQI(void *o,UCI_format_t uci_format,LTE_eNB_UE_stats *stats, uint8_
|
||||
//unsigned char rank;
|
||||
//UCI_format fmt;
|
||||
//uint8_t N_RB_DL = 25;
|
||||
uint8_t i;
|
||||
LOG_D(PHY,"[eNB][UCI] N_RB_DL %d uci format %d\n", N_RB_DL,uci_format);
|
||||
|
||||
switch(N_RB_DL) {
|
||||
@@ -275,6 +276,11 @@ void extract_CQI(void *o,UCI_format_t uci_format,LTE_eNB_UE_stats *stats, uint8_
|
||||
stats->DL_cqi[1] = 24;
|
||||
|
||||
stats->DL_pmi_dual = ((wideband_cqi_rank2_2A_5MHz *)o)->pmi;
|
||||
//this translates the 2-layer PMI into a single layer PMI for the first codeword
|
||||
//the PMI for the second codeword will be stats->DL_pmi_single^0x1555
|
||||
stats->DL_pmi_single = 0;
|
||||
for (i=0;i<7;i++)
|
||||
stats->DL_pmi_single = stats->DL_pmi_single | (((stats->DL_pmi_dual&(1<i))>>i)*2)<<2*i;
|
||||
break;
|
||||
|
||||
case HLC_subband_cqi_nopmi:
|
||||
|
||||
@@ -1,3 +1,29 @@
|
||||
/*******************************************************************************
|
||||
OpenAirInterface
|
||||
Copyright(c) 1999 - 2014 Eurecom
|
||||
|
||||
OpenAirInterface is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
|
||||
OpenAirInterface is distributed in the hope that it will be useful,
|
||||
but WITTOOLHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenAirInterface.The full GNU General Public License is
|
||||
included in this distribution in the file called "COPYING". If not,
|
||||
see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Contact Information
|
||||
OpenAirInterface Admin: openair_admin@eurecom.fr
|
||||
OpenAirInterface Tech : openair_tech@eurecom.fr
|
||||
OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr
|
||||
|
||||
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
@@ -169,6 +195,37 @@ int add_cpx_vector32(short *x,
|
||||
return(0);
|
||||
}
|
||||
|
||||
int32_t sub_cpx_vector16(int16_t *x,
|
||||
int16_t *y,
|
||||
int16_t *z,
|
||||
uint32_t N)
|
||||
{
|
||||
unsigned int i; // loop counter
|
||||
|
||||
__m128i *x_128;
|
||||
__m128i *y_128;
|
||||
__m128i *z_128;
|
||||
|
||||
x_128 = (__m128i *)&x[0];
|
||||
y_128 = (__m128i *)&y[0];
|
||||
z_128 = (__m128i *)&z[0];
|
||||
|
||||
for(i=0; i<(N>>3); i++) {
|
||||
z_128[0] = _mm_subs_epi16(x_128[0],y_128[0]);
|
||||
|
||||
x_128++;
|
||||
y_128++;
|
||||
z_128++;
|
||||
|
||||
}
|
||||
|
||||
_mm_empty();
|
||||
_m_empty();
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
int add_real_vector64(short *x,
|
||||
short* y,
|
||||
short *z,
|
||||
|
||||
@@ -107,10 +107,10 @@ int32_t dot_product(int16_t *x,
|
||||
// print_shorts("mmtmp7",&mmtmp7);
|
||||
// convert back to integer
|
||||
result = _mm_cvtsi64_si32(mmtmp7);
|
||||
|
||||
|
||||
_mm_empty();
|
||||
_m_empty();
|
||||
|
||||
|
||||
return(result);
|
||||
|
||||
#elif defined(__arm__)
|
||||
|
||||
@@ -59,18 +59,23 @@ void multadd_complex_vector_real_scalar(int16_t *x,
|
||||
|
||||
if (zero_flag == 1)
|
||||
for (n=0; n<N>>2; n++) {
|
||||
// print_shorts("x_128[n]=", &x_128[n]);
|
||||
// print_shorts("alpha_128", &alpha_128);
|
||||
y_128[n] = mulhi_int16(x_128[n],alpha_128);
|
||||
// print_shorts("y_128[n]=", &y_128[n]);
|
||||
}
|
||||
|
||||
else
|
||||
for (n=0; n<N>>2; n++) {
|
||||
y_128[n] = adds_int16(y_128[n],mulhi_int16(x_128[n],alpha_128));
|
||||
}
|
||||
|
||||
|
||||
_mm_empty();
|
||||
_m_empty();
|
||||
|
||||
}
|
||||
|
||||
|
||||
void multadd_real_vector_complex_scalar(int16_t *x,
|
||||
int16_t *alpha,
|
||||
int16_t *y,
|
||||
@@ -380,6 +385,7 @@ int rotate_cpx_vector(int16_t *x,
|
||||
m3 = _mm_sra_epi32(m3,shift); // shift right by shift in order to compensate for the input amplitude
|
||||
|
||||
y_128[0] = _mm_packs_epi32(m2,m3); // pack in 16bit integers with saturation [re im re im re im re im]
|
||||
//print_ints("y_128[0]=", &y_128[0]);
|
||||
#elif defined(__arm__)
|
||||
|
||||
ab_re0 = vmull_s16(((int16x4_t*)xd)[0],((int16x4_t*)&bconj)[0]);
|
||||
|
||||
@@ -28,8 +28,11 @@
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
int16_t conjug[8]__attribute__((aligned(16))) = {-1,1,-1,1,-1,1,-1,1} ;
|
||||
int16_t conjug2[8]__attribute__((aligned(16))) = {1,-1,1,-1,1,-1,1,-1} ;
|
||||
|
||||
#define simd_q15_t __m128i
|
||||
#define simdshort_q15_t __m64
|
||||
#define set1_int16(a) _mm_set1_epi16(a)
|
||||
#define setr_int16(a0, a1, a2, a3, a4, a5, a6, a7) _mm_setr_epi16(a0, a1, a2, a3, a4, a5, a6, a7 )
|
||||
#elif defined(__arm__)
|
||||
int16_t conjug[4]__attribute__((aligned(16))) = {-1,1,-1,1} ;
|
||||
#define simd_q15_t int16x8_t
|
||||
@@ -45,7 +48,7 @@ int mult_cpx_conj_vector(int16_t *x1,
|
||||
int output_shift,
|
||||
int madd)
|
||||
{
|
||||
// Multiply elementwise the complex conjugate of x1 with x2.
|
||||
// Multiply elementwise the complex conjugate of x1 with x2.
|
||||
// x1 - input 1 in the format |Re0 Im0 Re1 Im1|,......,|Re(N-2) Im(N-2) Re(N-1) Im(N-1)|
|
||||
// We assume x1 with a dinamic of 15 bit maximum
|
||||
//
|
||||
@@ -68,11 +71,12 @@ int mult_cpx_conj_vector(int16_t *x1,
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
simd_q15_t tmp_re,tmp_im;
|
||||
simd_q15_t tmpy0,tmpy1;
|
||||
|
||||
#elif defined(__arm__)
|
||||
int32x4_t tmp_re,tmp_im;
|
||||
int32x4_t tmp_re1,tmp_im1;
|
||||
int16x4x2_t tmpy;
|
||||
int32x4_t shift = vdupq_n_s32(-output_shift);
|
||||
int16x4x2_t tmpy;
|
||||
int32x4_t shift = vdupq_n_s32(-output_shift);
|
||||
#endif
|
||||
|
||||
x1_128 = (simd_q15_t *)&x1[0];
|
||||
@@ -92,7 +96,7 @@ int mult_cpx_conj_vector(int16_t *x1,
|
||||
tmp_im = _mm_srai_epi32(tmp_im,output_shift);
|
||||
tmpy0 = _mm_unpacklo_epi32(tmp_re,tmp_im);
|
||||
tmpy1 = _mm_unpackhi_epi32(tmp_re,tmp_im);
|
||||
if (madd==0)
|
||||
if (madd==0)
|
||||
*y_128 = _mm_packs_epi32(tmpy0,tmpy1);
|
||||
else
|
||||
*y_128 += _mm_packs_epi32(tmpy0,tmpy1);
|
||||
@@ -100,12 +104,12 @@ int mult_cpx_conj_vector(int16_t *x1,
|
||||
#elif defined(__arm__)
|
||||
|
||||
tmp_re = vmull_s16(((simdshort_q15_t *)x1_128)[0], ((simdshort_q15_t*)x2_128)[0]);
|
||||
//tmp_re = [Re(x1[0])Re(x2[0]) Im(x1[0])Im(x2[0]) Re(x1[1])Re(x2[1]) Im(x1[1])Im(x2[1])]
|
||||
//tmp_re = [Re(x1[0])Re(x2[0]) Im(x1[0])Im(x2[0]) Re(x1[1])Re(x2[1]) Im(x1[1])Im(x2[1])]
|
||||
tmp_re1 = vmull_s16(((simdshort_q15_t *)x1_128)[1], ((simdshort_q15_t*)x2_128)[1]);
|
||||
//tmp_re1 = [Re(x1[1])Re(x2[1]) Im(x1[1])Im(x2[1]) Re(x1[1])Re(x2[2]) Im(x1[1])Im(x2[2])]
|
||||
//tmp_re1 = [Re(x1[1])Re(x2[1]) Im(x1[1])Im(x2[1]) Re(x1[1])Re(x2[2]) Im(x1[1])Im(x2[2])]
|
||||
tmp_re = vcombine_s32(vpadd_s32(vget_low_s32(tmp_re),vget_high_s32(tmp_re)),
|
||||
vpadd_s32(vget_low_s32(tmp_re1),vget_high_s32(tmp_re1)));
|
||||
//tmp_re = [Re(ch[0])Re(rx[0])+Im(ch[0])Im(ch[0]) Re(ch[1])Re(rx[1])+Im(ch[1])Im(ch[1]) Re(ch[2])Re(rx[2])+Im(ch[2]) Im(ch[2]) Re(ch[3])Re(rx[3])+Im(ch[3])Im(ch[3])]
|
||||
//tmp_re = [Re(ch[0])Re(rx[0])+Im(ch[0])Im(ch[0]) Re(ch[1])Re(rx[1])+Im(ch[1])Im(ch[1]) Re(ch[2])Re(rx[2])+Im(ch[2]) Im(ch[2]) Re(ch[3])Re(rx[3])+Im(ch[3])Im(ch[3])]
|
||||
|
||||
tmp_im = vmull_s16(vrev32_s16(vmul_s16(((simdshort_q15_t*)x2_128)[0],*(simdshort_q15_t*)conjug)), ((simdshort_q15_t*)x1_128)[0]);
|
||||
//tmp_im = [-Im(ch[0])Re(rx[0]) Re(ch[0])Im(rx[0]) -Im(ch[1])Re(rx[1]) Re(ch[1])Im(rx[1])]
|
||||
@@ -135,6 +139,68 @@ int mult_cpx_conj_vector(int16_t *x1,
|
||||
return(0);
|
||||
}
|
||||
|
||||
int mult_cpx_vector(int16_t *x1, //Q15
|
||||
int16_t *x2,//Q13
|
||||
int16_t *y,
|
||||
uint32_t N,
|
||||
int output_shift)
|
||||
{
|
||||
// Multiply elementwise x1 with x2.
|
||||
// x1 - input 1 in the format |Re0 Im0 Re1 Im1|,......,|Re(N-2) Im(N-2) Re(N-1) Im(N-1)|
|
||||
// We assume x1 with a dinamic of 15 bit maximum
|
||||
//
|
||||
// x2 - input 2 in the format |Re0 Im0 Re1 Im1|,......,|Re(N-2) Im(N-2) Re(N-1) Im(N-1)|
|
||||
// We assume x2 with a dinamic of 14 bit maximum
|
||||
///
|
||||
// y - output in the format |Re0 Im0 Re1 Im1|,......,|Re(N-2) Im(N-2) Re(N-1) Im(N-1)|
|
||||
//
|
||||
// N - the size f the vectors (this function does N cpx mpy. WARNING: N>=4;
|
||||
//
|
||||
// output_shift - shift to be applied to generate output
|
||||
uint32_t i; // loop counter
|
||||
simd_q15_t *x1_128;
|
||||
simd_q15_t *x2_128;
|
||||
simd_q15_t *y_128;
|
||||
simd_q15_t tmp_re,tmp_im;
|
||||
simd_q15_t tmpy0,tmpy1;
|
||||
x1_128 = (simd_q15_t *)&x1[0];
|
||||
x2_128 = (simd_q15_t *)&x2[0];
|
||||
y_128 = (simd_q15_t *)&y[0];
|
||||
//print_shorts("x1_128:",&x1_128[0]);
|
||||
// print_shorts("x2_128:",&x2_128[0]);
|
||||
|
||||
//right shift by 13 while p_a * x0 and 15 while
|
||||
// we compute 4 cpx multiply for each loop
|
||||
for(i=0; i<(N>>2); i++) {
|
||||
tmp_re = _mm_sign_epi16(*x1_128,*(__m128i*)&conjug2[0]);// Q15
|
||||
//print_shorts("tmp_re1:",&tmp_re[i]);
|
||||
tmp_re = _mm_madd_epi16(tmp_re,*x2_128); //Q28
|
||||
//print_ints("tmp_re2:",&tmp_re[i]);
|
||||
tmp_im = _mm_shufflelo_epi16(*x1_128,_MM_SHUFFLE(2,3,0,1)); //Q15
|
||||
//print_shorts("tmp_im1:",&tmp_im[i]);
|
||||
tmp_im = _mm_shufflehi_epi16(tmp_im,_MM_SHUFFLE(2,3,0,1)); //Q15
|
||||
//print_shorts("tmp_im2:",&tmp_im[i]);
|
||||
tmp_im = _mm_madd_epi16(tmp_im, *x2_128); //Q28
|
||||
//print_ints("tmp_im3:",&tmp_im[i]);
|
||||
tmp_re = _mm_srai_epi32(tmp_re,output_shift);//Q(28-shift)
|
||||
//print_ints("tmp_re shifted:",&tmp_re[i]);
|
||||
tmp_im = _mm_srai_epi32(tmp_im,output_shift); //Q(28-shift)
|
||||
//print_ints("tmp_im shifted:",&tmp_im[i]);
|
||||
tmpy0 = _mm_unpacklo_epi32(tmp_re,tmp_im); //Q(28-shift)
|
||||
//print_ints("unpack lo :",&tmpy0[i]);
|
||||
tmpy1 = _mm_unpackhi_epi32(tmp_re,tmp_im); //Q(28-shift)
|
||||
//print_ints("mrc rho0:",&tmpy1[i]);
|
||||
*y_128 = _mm_packs_epi32(tmpy0,tmpy1); //must be Q15
|
||||
//print_shorts("*y_128:",&y_128[i]);
|
||||
x1_128++;
|
||||
x2_128++;
|
||||
y_128++;
|
||||
}
|
||||
_mm_empty();
|
||||
_m_empty();
|
||||
return(0);
|
||||
}
|
||||
|
||||
int multadd_cpx_vector(int16_t *x1,
|
||||
int16_t *x2,
|
||||
int16_t *y,
|
||||
@@ -156,9 +222,7 @@ int multadd_cpx_vector(int16_t *x1,
|
||||
// N - the size f the vectors (this function does N cpx mpy. WARNING: N>=4;
|
||||
//
|
||||
// output_shift - shift to be applied to generate output
|
||||
|
||||
uint32_t i; // loop counter
|
||||
|
||||
simd_q15_t *x1_128;
|
||||
simd_q15_t *x2_128;
|
||||
simd_q15_t *y_128;
|
||||
@@ -171,12 +235,9 @@ int multadd_cpx_vector(int16_t *x1,
|
||||
int16x4x2_t tmpy;
|
||||
int32x4_t shift = vdupq_n_s32(-output_shift);
|
||||
#endif
|
||||
|
||||
x1_128 = (simd_q15_t *)&x1[0];
|
||||
x2_128 = (simd_q15_t *)&x2[0];
|
||||
y_128 = (simd_q15_t *)&y[0];
|
||||
|
||||
|
||||
// we compute 4 cpx multiply for each loop
|
||||
for(i=0; i<(N>>2); i++) {
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
@@ -191,25 +252,19 @@ int multadd_cpx_vector(int16_t *x1,
|
||||
//print_ints("unpack lo:",&tmpy0[i]);
|
||||
tmpy1 = _mm_unpackhi_epi32(tmp_re,tmp_im);
|
||||
//print_ints("unpack hi:",&tmpy1[i]);
|
||||
|
||||
if (zero_flag == 1)
|
||||
*y_128 = _mm_packs_epi32(tmpy0,tmpy1);
|
||||
else
|
||||
*y_128 = _mm_adds_epi16(*y_128,_mm_packs_epi32(tmpy0,tmpy1));
|
||||
//print_shorts("*y_128:",&y_128[i]);
|
||||
|
||||
#elif defined(__arm__)
|
||||
|
||||
msg("mult_cpx_vector not implemented for __arm__");
|
||||
#endif
|
||||
x1_128++;
|
||||
x2_128++;
|
||||
y_128++;
|
||||
}
|
||||
|
||||
|
||||
_mm_empty();
|
||||
_m_empty();
|
||||
|
||||
return(0);
|
||||
}
|
||||
}
|
||||
@@ -145,6 +145,12 @@ int multadd_cpx_vector(int16_t *x1,
|
||||
uint32_t N,
|
||||
int output_shift);
|
||||
|
||||
int mult_cpx_vector(int16_t *x1,
|
||||
int16_t *x2,
|
||||
int16_t *y,
|
||||
uint32_t N,
|
||||
int output_shift);
|
||||
|
||||
// lte_dfts.c
|
||||
void init_fft(uint16_t size,
|
||||
uint8_t logsize,
|
||||
@@ -228,6 +234,11 @@ int32_t add_cpx_vector(int16_t *x,
|
||||
int16_t *y,
|
||||
uint32_t N);
|
||||
|
||||
int32_t sub_cpx_vector16(int16_t *x,
|
||||
int16_t *y,
|
||||
int16_t *z,
|
||||
uint32_t N);
|
||||
|
||||
int32_t add_cpx_vector32(int16_t *x,
|
||||
int16_t *y,
|
||||
int16_t *z,
|
||||
|
||||
@@ -36,9 +36,9 @@ int write_output(const char *fname,const char *vname,void *data,int length,int d
|
||||
printf("Writing %d elements of type %d to %s\n",length,format,fname);
|
||||
|
||||
|
||||
if (format == 10 || format ==11 || format == 12 ) {
|
||||
if (format == 10 || format ==11 || format == 12 || format == 13 || format == 14) {
|
||||
fp = fopen(fname,"a+");
|
||||
} else if (format != 10 && format !=11 && format != 12 ) {
|
||||
} else if (format != 10 && format !=11 && format != 12 && format != 13 && format != 14) {
|
||||
fp = fopen(fname,"w+");
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ int write_output(const char *fname,const char *vname,void *data,int length,int d
|
||||
return(-1);
|
||||
}
|
||||
|
||||
if (format != 10 && format !=11 && format != 12 )
|
||||
if (format != 10 && format !=11 && format != 12 && format != 13 && format != 14)
|
||||
fprintf(fp,"%s = [",vname);
|
||||
|
||||
|
||||
@@ -63,7 +63,9 @@ int write_output(const char *fname,const char *vname,void *data,int length,int d
|
||||
break;
|
||||
|
||||
case 1: // complex 16-bit
|
||||
|
||||
case 13:
|
||||
case 14:
|
||||
case 15:
|
||||
|
||||
for (i=0; i<length<<1; i+=(2*dec)) {
|
||||
fprintf(fp,"%d + j*(%d)\n",((short *)data)[i],((short *)data)[i+1]);
|
||||
@@ -165,14 +167,13 @@ int write_output(const char *fname,const char *vname,void *data,int length,int d
|
||||
fprintf(fp,"%d \n",((unsigned char *)&data)[0]);
|
||||
break;
|
||||
|
||||
|
||||
}
|
||||
|
||||
if (format != 10 && format !=11 && format !=12 ) {
|
||||
if (format != 10 && format !=11 && format !=12 && format != 13 && format != 15) {
|
||||
fprintf(fp,"];\n");
|
||||
fclose(fp);
|
||||
return(0);
|
||||
} else if (format == 10 || format ==11 || format == 12 ) {
|
||||
} else if (format == 10 || format ==11 || format == 12 || format == 13 || format == 15) {
|
||||
fclose(fp);
|
||||
return(0);
|
||||
}
|
||||
|
||||
@@ -232,8 +232,8 @@ void phy_scope_eNB(FD_lte_phy_scope_enb *form,
|
||||
|
||||
if (chest_t[0] !=NULL) {
|
||||
for (i=0; i<(frame_parms->ofdm_symbol_size); i++) {
|
||||
i2 = (i+(frame_parms->ofdm_symbol_size>>1))%frame_parms->ofdm_symbol_size;
|
||||
time2[i] = (float)(i-(frame_parms->ofdm_symbol_size>>1));
|
||||
i2 = (i+(frame_parms->ofdm_symbol_size>>1))%frame_parms->ofdm_symbol_size;
|
||||
time2[i] = (float)(i-(frame_parms->ofdm_symbol_size>>1));
|
||||
chest_t_abs[0][i] = 10*log10((float) (1+chest_t[0][2*i2]*chest_t[0][2*i2]+chest_t[0][2*i2+1]*chest_t[0][2*i2+1]));
|
||||
|
||||
if (chest_t_abs[0][i] > ymax)
|
||||
@@ -247,7 +247,7 @@ void phy_scope_eNB(FD_lte_phy_scope_enb *form,
|
||||
if (chest_t[arx] !=NULL) {
|
||||
for (i=0; i<(frame_parms->ofdm_symbol_size>>3); i++) {
|
||||
chest_t_abs[arx][i] = 10*log10((float) (1+chest_t[arx][2*i]*chest_t[arx][2*i]+chest_t[arx][2*i+1]*chest_t[arx][2*i+1]));
|
||||
|
||||
|
||||
if (chest_t_abs[arx][i] > ymax)
|
||||
ymax = chest_t_abs[arx][i];
|
||||
}
|
||||
@@ -340,7 +340,7 @@ void phy_scope_eNB(FD_lte_phy_scope_enb *form,
|
||||
Q_pucch[ind] = (float)pucch1ab_comp[2*(ind)+1];
|
||||
A_pucch[ind] = 10*log10(pucch1_comp[ind]);
|
||||
B_pucch[ind] = ind;
|
||||
C_pucch[ind] = (float)pucch1_thres[ind];
|
||||
C_pucch[ind] = (float)pucch1_thres[ind];
|
||||
}
|
||||
fl_set_xyplot_data(form->pucch_comp,I_pucch,Q_pucch,10240,"","","");
|
||||
fl_set_xyplot_data(form->pucch_comp1,B_pucch,A_pucch,1024,"","","");
|
||||
@@ -768,4 +768,4 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form,
|
||||
}
|
||||
|
||||
free(chest_t_abs);
|
||||
}
|
||||
}
|
||||
@@ -46,18 +46,21 @@ typedef struct {
|
||||
} FD_lte_phy_scope_enb;
|
||||
|
||||
typedef struct {
|
||||
FL_FORM * lte_phy_scope_ue;
|
||||
FL_OBJECT * rxsig_t;
|
||||
FL_OBJECT * chest_f;
|
||||
FL_OBJECT * chest_t;
|
||||
FL_OBJECT * pbch_comp;
|
||||
FL_OBJECT * pbch_llr;
|
||||
FL_OBJECT * pdcch_comp;
|
||||
FL_OBJECT * pdcch_llr;
|
||||
FL_OBJECT * pdsch_comp;
|
||||
FL_OBJECT * pdsch_llr;
|
||||
FL_OBJECT * pdsch_tput;
|
||||
FL_OBJECT * button_0;
|
||||
FL_FORM * lte_phy_scope_ue;
|
||||
FL_OBJECT * rxsig_t;
|
||||
FL_OBJECT * chest_f;
|
||||
FL_OBJECT * chest_t;
|
||||
FL_OBJECT * pbch_comp;
|
||||
FL_OBJECT * pbch_llr;
|
||||
FL_OBJECT * pdcch_comp;
|
||||
FL_OBJECT * pdcch_llr;
|
||||
FL_OBJECT * pdsch_comp;
|
||||
FL_OBJECT * pdsch_llr;
|
||||
FL_OBJECT * pdsch_comp1;
|
||||
FL_OBJECT * pdsch_llr1;
|
||||
FL_OBJECT * pdsch_tput;
|
||||
FL_OBJECT * button_0;
|
||||
|
||||
} FD_lte_phy_scope_ue;
|
||||
|
||||
FD_lte_phy_scope_enb * create_lte_phy_scope_enb( void );
|
||||
@@ -76,7 +79,4 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form,
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif /* FD_lte_scope_h_ */
|
||||
|
||||
Executable
+800
@@ -0,0 +1,800 @@
|
||||
/*******************************************************************************
|
||||
OpenAirInterface
|
||||
Copyright(c) 1999 - 2014 Eurecom
|
||||
OpenAirInterface is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
OpenAirInterface is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenAirInterface.The full GNU General Public License is
|
||||
included in this distribution in the file called "COPYING". If not,
|
||||
see <http://www.gnu.org/licenses/>.
|
||||
Contact Information
|
||||
OpenAirInterface Admin: openair_admin@eurecom.fr
|
||||
OpenAirInterface Tech : openair_tech@eurecom.fr
|
||||
OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr
|
||||
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
|
||||
*******************************************************************************/
|
||||
/* Form definition file generated by fdesign */
|
||||
#include <stdlib.h>
|
||||
#include "lte_phy_scope.h"
|
||||
#define TPUT_WINDOW_LENGTH 100
|
||||
int otg_enabled;
|
||||
FL_COLOR rx_antenna_colors[4] = {FL_RED,FL_BLUE,FL_GREEN,FL_YELLOW};
|
||||
float tput_time_enb[NUMBER_OF_UE_MAX][TPUT_WINDOW_LENGTH] = {{0}};
|
||||
float tput_enb[NUMBER_OF_UE_MAX][TPUT_WINDOW_LENGTH] = {{0}};
|
||||
float tput_time_ue[NUMBER_OF_UE_MAX][TPUT_WINDOW_LENGTH] = {{0}};
|
||||
float tput_ue[NUMBER_OF_UE_MAX][TPUT_WINDOW_LENGTH] = {{0}};
|
||||
float tput_ue_max[NUMBER_OF_UE_MAX] = {0};
|
||||
static void ia_receiver_on_off( FL_OBJECT *button, long arg)
|
||||
{
|
||||
if (fl_get_button(button)) {
|
||||
fl_set_object_label(button, "IA Receiver ON");
|
||||
// PHY_vars_UE_g[0][0]->use_ia_receiver = 1;
|
||||
fl_set_object_color(button, FL_GREEN, FL_GREEN);
|
||||
} else {
|
||||
fl_set_object_label(button, "IA Receiver OFF");
|
||||
// PHY_vars_UE_g[0][0]->use_ia_receiver = 0;
|
||||
fl_set_object_color(button, FL_RED, FL_RED);
|
||||
}
|
||||
}
|
||||
static void dl_traffic_on_off( FL_OBJECT *button, long arg)
|
||||
{
|
||||
if (fl_get_button(button)) {
|
||||
fl_set_object_label(button, "DL Traffic ON");
|
||||
otg_enabled = 1;
|
||||
fl_set_object_color(button, FL_GREEN, FL_GREEN);
|
||||
} else {
|
||||
fl_set_object_label(button, "DL Traffic OFF");
|
||||
otg_enabled = 0;
|
||||
fl_set_object_color(button, FL_RED, FL_RED);
|
||||
}
|
||||
}
|
||||
FD_lte_phy_scope_enb *create_lte_phy_scope_enb( void )
|
||||
{
|
||||
FL_OBJECT *obj;
|
||||
FD_lte_phy_scope_enb *fdui = fl_malloc( sizeof *fdui );
|
||||
// Define form
|
||||
fdui->lte_phy_scope_enb = fl_bgn_form( FL_NO_BOX, 800, 800 );
|
||||
// This the whole UI box
|
||||
obj = fl_add_box( FL_BORDER_BOX, 0, 0, 800, 800, "" );
|
||||
fl_set_object_color( obj, FL_BLACK, FL_BLACK );
|
||||
// Received signal
|
||||
fdui->rxsig_t = fl_add_xyplot( FL_NORMAL_XYPLOT, 20, 20, 370, 100, "Received Signal (Time-Domain, dB)" );
|
||||
fl_set_object_boxtype( fdui->rxsig_t, FL_EMBOSSED_BOX );
|
||||
fl_set_object_color( fdui->rxsig_t, FL_BLACK, FL_RED );
|
||||
fl_set_object_lcolor( fdui->rxsig_t, FL_WHITE ); // Label color
|
||||
fl_set_xyplot_ybounds(fdui->rxsig_t,10,70);
|
||||
// Time-domain channel response
|
||||
fdui->chest_t = fl_add_xyplot( FL_NORMAL_XYPLOT, 410, 20, 370, 100, "Channel Impulse Response (samples, abs)" );
|
||||
fl_set_object_boxtype( fdui->chest_t, FL_EMBOSSED_BOX );
|
||||
fl_set_object_color( fdui->chest_t, FL_BLACK, FL_RED );
|
||||
fl_set_object_lcolor( fdui->chest_t, FL_WHITE ); // Label color
|
||||
// Frequency-domain channel response
|
||||
fdui->chest_f = fl_add_xyplot( FL_IMPULSE_XYPLOT, 20, 140, 760, 100, "Channel Frequency Response (RE, dB)" );
|
||||
fl_set_object_boxtype( fdui->chest_f, FL_EMBOSSED_BOX );
|
||||
fl_set_object_color( fdui->chest_f, FL_BLACK, FL_RED );
|
||||
fl_set_object_lcolor( fdui->chest_f, FL_WHITE ); // Label color
|
||||
fl_set_xyplot_ybounds( fdui->chest_f,30,70);
|
||||
// LLR of PUSCH
|
||||
fdui->pusch_llr = fl_add_xyplot( FL_POINTS_XYPLOT, 20, 260, 500, 200, "PUSCH Log-Likelihood Ratios (LLR, mag)" );
|
||||
fl_set_object_boxtype( fdui->pusch_llr, FL_EMBOSSED_BOX );
|
||||
fl_set_object_color( fdui->pusch_llr, FL_BLACK, FL_YELLOW );
|
||||
fl_set_object_lcolor( fdui->pusch_llr, FL_WHITE ); // Label color
|
||||
fl_set_xyplot_symbolsize( fdui->pusch_llr,2);
|
||||
// I/Q PUSCH comp
|
||||
fdui->pusch_comp = fl_add_xyplot( FL_POINTS_XYPLOT, 540, 260, 240, 200, "PUSCH I/Q of MF Output" );
|
||||
fl_set_object_boxtype( fdui->pusch_comp, FL_EMBOSSED_BOX );
|
||||
fl_set_object_color( fdui->pusch_comp, FL_BLACK, FL_YELLOW );
|
||||
fl_set_object_lcolor( fdui->pusch_comp, FL_WHITE ); // Label color
|
||||
fl_set_xyplot_symbolsize( fdui->pusch_comp,2);
|
||||
fl_set_xyplot_xgrid( fdui->pusch_llr,FL_GRID_MAJOR);
|
||||
// I/Q PUCCH comp (format 1)
|
||||
fdui->pucch_comp1 = fl_add_xyplot( FL_POINTS_XYPLOT, 540, 480, 240, 100, "PUCCH1 Energy (SR)" );
|
||||
fl_set_object_boxtype( fdui->pucch_comp1, FL_EMBOSSED_BOX );
|
||||
fl_set_object_color( fdui->pucch_comp1, FL_BLACK, FL_YELLOW );
|
||||
fl_set_object_lcolor( fdui->pucch_comp1, FL_WHITE ); // Label color
|
||||
fl_set_xyplot_symbolsize( fdui->pucch_comp1,2);
|
||||
// fl_set_xyplot_xgrid( fdui->pusch_llr,FL_GRID_MAJOR);
|
||||
// I/Q PUCCH comp (fromat 1a/b)
|
||||
fdui->pucch_comp = fl_add_xyplot( FL_POINTS_XYPLOT, 540, 600, 240, 100, "PUCCH I/Q of MF Output" );
|
||||
fl_set_object_boxtype( fdui->pucch_comp, FL_EMBOSSED_BOX );
|
||||
fl_set_object_color( fdui->pucch_comp, FL_BLACK, FL_YELLOW );
|
||||
fl_set_object_lcolor( fdui->pucch_comp, FL_WHITE ); // Label color
|
||||
fl_set_xyplot_symbolsize( fdui->pucch_comp,2);
|
||||
// fl_set_xyplot_xgrid( fdui->pusch_llr,FL_GRID_MAJOR);
|
||||
// Throughput on PUSCH
|
||||
fdui->pusch_tput = fl_add_xyplot( FL_NORMAL_XYPLOT, 20, 480, 500, 100, "PUSCH Throughput [frame]/[kbit/s]" );
|
||||
fl_set_object_boxtype( fdui->pusch_tput, FL_EMBOSSED_BOX );
|
||||
fl_set_object_color( fdui->pusch_tput, FL_BLACK, FL_WHITE );
|
||||
fl_set_object_lcolor( fdui->pusch_tput, FL_WHITE ); // Label color
|
||||
// Generic eNB Button
|
||||
fdui->button_0 = fl_add_button( FL_PUSH_BUTTON, 20, 600, 240, 40, "" );
|
||||
fl_set_object_lalign(fdui->button_0, FL_ALIGN_CENTER );
|
||||
fl_set_button(fdui->button_0,0);
|
||||
otg_enabled = 0;
|
||||
fl_set_object_label(fdui->button_0, "DL Traffic OFF");
|
||||
fl_set_object_color(fdui->button_0, FL_RED, FL_RED);
|
||||
fl_set_object_callback(fdui->button_0, dl_traffic_on_off, 0 );
|
||||
fl_end_form( );
|
||||
fdui->lte_phy_scope_enb->fdui = fdui;
|
||||
return fdui;
|
||||
}
|
||||
void phy_scope_eNB(FD_lte_phy_scope_enb *form,
|
||||
PHY_VARS_eNB *phy_vars_enb,
|
||||
int UE_id)
|
||||
{
|
||||
int eNB_id = 0;
|
||||
int i,i2,arx,atx,ind,k;
|
||||
LTE_DL_FRAME_PARMS *frame_parms = &phy_vars_enb->frame_parms;
|
||||
int nsymb_ce = 12*frame_parms->N_RB_UL*frame_parms->symbols_per_tti;
|
||||
uint8_t nb_antennas_rx = frame_parms->nb_antennas_rx;
|
||||
uint8_t nb_antennas_tx = 1; // frame_parms->nb_antennas_tx; // in LTE Rel. 8 and 9 only a single transmit antenna is assumed at the UE
|
||||
int16_t **rxsig_t;
|
||||
int16_t **chest_t;
|
||||
int16_t **chest_f;
|
||||
int16_t *pusch_llr;
|
||||
int16_t *pusch_comp;
|
||||
int32_t *pucch1_comp;
|
||||
int32_t *pucch1_thres;
|
||||
int32_t *pucch1ab_comp;
|
||||
float Re,Im,ymax;
|
||||
float *llr, *bit;
|
||||
float I[nsymb_ce*2], Q[nsymb_ce*2];
|
||||
float I_pucch[10240],Q_pucch[10240],A_pucch[10240],B_pucch[10240],C_pucch[10240];
|
||||
float rxsig_t_dB[nb_antennas_rx][FRAME_LENGTH_COMPLEX_SAMPLES];
|
||||
float chest_t_abs[nb_antennas_rx][frame_parms->ofdm_symbol_size];
|
||||
float *chest_f_abs;
|
||||
float time[FRAME_LENGTH_COMPLEX_SAMPLES];
|
||||
float time2[2048];
|
||||
float freq[nsymb_ce*nb_antennas_rx*nb_antennas_tx];
|
||||
int frame = phy_vars_enb->proc.proc_rxtx[0].frame_tx;
|
||||
uint32_t total_dlsch_bitrate = phy_vars_enb->total_dlsch_bitrate;
|
||||
int coded_bits_per_codeword = 0;
|
||||
uint8_t harq_pid; // in TDD config 3 it is sf-2, i.e., can be 0,1,2
|
||||
int mcs = 0;
|
||||
// choose max MCS to compute coded_bits_per_codeword
|
||||
if (phy_vars_enb->ulsch[UE_id]!=NULL) {
|
||||
for (harq_pid=0; harq_pid<3; harq_pid++) {
|
||||
mcs = cmax(phy_vars_enb->ulsch[UE_id]->harq_processes[harq_pid]->mcs,mcs);
|
||||
}
|
||||
}
|
||||
coded_bits_per_codeword = frame_parms->N_RB_UL*12*get_Qm(mcs)*frame_parms->symbols_per_tti;
|
||||
chest_f_abs = (float*) calloc(nsymb_ce*nb_antennas_rx*nb_antennas_tx,sizeof(float));
|
||||
llr = (float*) calloc(coded_bits_per_codeword,sizeof(float)); // init to zero
|
||||
bit = malloc(coded_bits_per_codeword*sizeof(float));
|
||||
rxsig_t = (int16_t**) phy_vars_enb->common_vars.rxdata[eNB_id];
|
||||
chest_t = (int16_t**) phy_vars_enb->pusch_vars[UE_id]->drs_ch_estimates_time[eNB_id];
|
||||
chest_f = (int16_t**) phy_vars_enb->pusch_vars[UE_id]->drs_ch_estimates[eNB_id];
|
||||
pusch_llr = (int16_t*) phy_vars_enb->pusch_vars[UE_id]->llr;
|
||||
pusch_comp = (int16_t*) phy_vars_enb->pusch_vars[UE_id]->rxdataF_comp[eNB_id][0];
|
||||
pucch1_comp = (int32_t*) phy_vars_enb->pucch1_stats[UE_id];
|
||||
pucch1_thres = (int32_t*) phy_vars_enb->pucch1_stats_thres[UE_id];
|
||||
pucch1ab_comp = (int32_t*) phy_vars_enb->pucch1ab_stats[UE_id];
|
||||
// Received signal in time domain of receive antenna 0
|
||||
if (rxsig_t != NULL) {
|
||||
if (rxsig_t[0] != NULL) {
|
||||
for (i=0; i<FRAME_LENGTH_COMPLEX_SAMPLES; i++) {
|
||||
rxsig_t_dB[0][i] = 10*log10(1.0+(float) ((rxsig_t[0][2*i])*(rxsig_t[0][2*i])+(rxsig_t[0][2*i+1])*(rxsig_t[0][2*i+1])));
|
||||
time[i] = (float) i;
|
||||
}
|
||||
fl_set_xyplot_data(form->rxsig_t,time,rxsig_t_dB[0],FRAME_LENGTH_COMPLEX_SAMPLES,"","","");
|
||||
}
|
||||
for (arx=1; arx<nb_antennas_rx; arx++) {
|
||||
if (rxsig_t[arx] != NULL) {
|
||||
for (i=0; i<FRAME_LENGTH_COMPLEX_SAMPLES; i++) {
|
||||
rxsig_t_dB[arx][i] = 10*log10(1.0+(float) ((rxsig_t[arx][2*i])*(rxsig_t[arx][2*i])+(rxsig_t[arx][2*i+1])*(rxsig_t[arx][2*i+1])));
|
||||
}
|
||||
fl_add_xyplot_overlay(form->rxsig_t,arx,time,rxsig_t_dB[arx],FRAME_LENGTH_COMPLEX_SAMPLES,rx_antenna_colors[arx]);
|
||||
}
|
||||
}
|
||||
}
|
||||
// Channel Impulse Response
|
||||
if (chest_t != NULL) {
|
||||
ymax = 0;
|
||||
if (chest_t[0] !=NULL) {
|
||||
for (i=0; i<(frame_parms->ofdm_symbol_size); i++) {
|
||||
i2 = (i+(frame_parms->ofdm_symbol_size>>1))%frame_parms->ofdm_symbol_size;
|
||||
time2[i] = (float)(i-(frame_parms->ofdm_symbol_size>>1));
|
||||
chest_t_abs[0][i] = 10*log10((float) (1+chest_t[0][2*i2]*chest_t[0][2*i2]+chest_t[0][2*i2+1]*chest_t[0][2*i2+1]));
|
||||
if (chest_t_abs[0][i] > ymax)
|
||||
ymax = chest_t_abs[0][i];
|
||||
}
|
||||
fl_set_xyplot_data(form->chest_t,time2,chest_t_abs[0],(frame_parms->ofdm_symbol_size),"","","");
|
||||
}
|
||||
for (arx=1; arx<nb_antennas_rx; arx++) {
|
||||
if (chest_t[arx] !=NULL) {
|
||||
for (i=0; i<(frame_parms->ofdm_symbol_size>>3); i++) {
|
||||
chest_t_abs[arx][i] = 10*log10((float) (1+chest_t[arx][2*i]*chest_t[arx][2*i]+chest_t[arx][2*i+1]*chest_t[arx][2*i+1]));
|
||||
if (chest_t_abs[arx][i] > ymax)
|
||||
ymax = chest_t_abs[arx][i];
|
||||
}
|
||||
fl_add_xyplot_overlay(form->chest_t,arx,time,chest_t_abs[arx],(frame_parms->ofdm_symbol_size>>3),rx_antenna_colors[arx]);
|
||||
fl_set_xyplot_overlay_type(form->chest_t,arx,FL_DASHED_XYPLOT);
|
||||
}
|
||||
}
|
||||
// Avoid flickering effect
|
||||
// fl_get_xyplot_ybounds(form->chest_t,&ymin,&ymax);
|
||||
fl_set_xyplot_ybounds(form->chest_t,0,ymax);
|
||||
}
|
||||
// Channel Frequency Response
|
||||
if (chest_f != NULL) {
|
||||
ind = 0;
|
||||
for (atx=0; atx<nb_antennas_tx; atx++) {
|
||||
for (arx=0; arx<nb_antennas_rx; arx++) {
|
||||
if (chest_f[(atx<<1)+arx] != NULL) {
|
||||
for (k=0; k<nsymb_ce; k++) {
|
||||
freq[ind] = (float)ind;
|
||||
Re = (float)(chest_f[(atx<<1)+arx][(2*k)]);
|
||||
Im = (float)(chest_f[(atx<<1)+arx][(2*k)+1]);
|
||||
chest_f_abs[ind] = (short)10*log10(1.0+((double)Re*Re + (double)Im*Im));
|
||||
ind++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// tx antenna 0
|
||||
fl_set_xyplot_xbounds(form->chest_f,0,nb_antennas_rx*nb_antennas_tx*nsymb_ce);
|
||||
fl_set_xyplot_xtics(form->chest_f,nb_antennas_rx*nb_antennas_tx*frame_parms->symbols_per_tti,3);
|
||||
fl_set_xyplot_xgrid(form->chest_f,FL_GRID_MAJOR);
|
||||
fl_set_xyplot_data(form->chest_f,freq,chest_f_abs,nsymb_ce,"","","");
|
||||
for (arx=1; arx<nb_antennas_rx; arx++) {
|
||||
fl_add_xyplot_overlay(form->chest_f,1,&freq[arx*nsymb_ce],&chest_f_abs[arx*nsymb_ce],nsymb_ce,rx_antenna_colors[arx]);
|
||||
}
|
||||
// other tx antennas
|
||||
if (nb_antennas_tx > 1) {
|
||||
if (nb_antennas_rx > 1) {
|
||||
for (atx=1; atx<nb_antennas_tx; atx++) {
|
||||
for (arx=0; arx<nb_antennas_rx; arx++) {
|
||||
fl_add_xyplot_overlay(form->chest_f,(atx<<1)+arx,&freq[((atx<<1)+arx)*nsymb_ce],&chest_f_abs[((atx<<1)+arx)*nsymb_ce],nsymb_ce,rx_antenna_colors[arx]);
|
||||
}
|
||||
}
|
||||
} else { // 1 rx antenna
|
||||
atx=1;
|
||||
arx=0;
|
||||
fl_add_xyplot_overlay(form->chest_f,atx,&freq[atx*nsymb_ce],&chest_f_abs[atx*nsymb_ce],nsymb_ce,rx_antenna_colors[arx]);
|
||||
}
|
||||
}
|
||||
}
|
||||
// PUSCH LLRs
|
||||
if (pusch_llr != NULL) {
|
||||
for (i=0; i<coded_bits_per_codeword; i++) {
|
||||
llr[i] = (float) pusch_llr[i];
|
||||
bit[i] = (float) i;
|
||||
}
|
||||
fl_set_xyplot_data(form->pusch_llr,bit,llr,coded_bits_per_codeword,"","","");
|
||||
}
|
||||
// PUSCH I/Q of MF Output
|
||||
if (pusch_comp!=NULL) {
|
||||
ind=0;
|
||||
for (k=0; k<frame_parms->symbols_per_tti; k++) {
|
||||
for (i=0; i<12*frame_parms->N_RB_UL; i++) {
|
||||
I[ind] = pusch_comp[(2*frame_parms->N_RB_UL*12*k)+2*i];
|
||||
Q[ind] = pusch_comp[(2*frame_parms->N_RB_UL*12*k)+2*i+1];
|
||||
ind++;
|
||||
}
|
||||
}
|
||||
fl_set_xyplot_data(form->pusch_comp,I,Q,ind,"","","");
|
||||
}
|
||||
// PUSCH I/Q of MF Output
|
||||
if (pucch1ab_comp!=NULL) {
|
||||
for (ind=0; ind<10240; ind++) {
|
||||
I_pucch[ind] = (float)pucch1ab_comp[2*(ind)];
|
||||
Q_pucch[ind] = (float)pucch1ab_comp[2*(ind)+1];
|
||||
A_pucch[ind] = 10*log10(pucch1_comp[ind]);
|
||||
B_pucch[ind] = ind;
|
||||
C_pucch[ind] = (float)pucch1_thres[ind];
|
||||
}
|
||||
fl_set_xyplot_data(form->pucch_comp,I_pucch,Q_pucch,10240,"","","");
|
||||
fl_set_xyplot_data(form->pucch_comp1,B_pucch,A_pucch,1024,"","","");
|
||||
fl_add_xyplot_overlay(form->pucch_comp1,1,B_pucch,C_pucch,1024,FL_RED);
|
||||
fl_set_xyplot_ybounds(form->pucch_comp,-5000,5000);
|
||||
fl_set_xyplot_xbounds(form->pucch_comp,-5000,5000);
|
||||
fl_set_xyplot_ybounds(form->pucch_comp1,0,80);
|
||||
}
|
||||
// PUSCH Throughput
|
||||
memmove( tput_time_enb[UE_id], &tput_time_enb[UE_id][1], (TPUT_WINDOW_LENGTH-1)*sizeof(float) );
|
||||
memmove( tput_enb[UE_id], &tput_enb[UE_id][1], (TPUT_WINDOW_LENGTH-1)*sizeof(float) );
|
||||
tput_time_enb[UE_id][TPUT_WINDOW_LENGTH-1] = (float) frame;
|
||||
tput_enb[UE_id][TPUT_WINDOW_LENGTH-1] = ((float) total_dlsch_bitrate)/1000.0;
|
||||
fl_set_xyplot_data(form->pusch_tput,tput_time_enb[UE_id],tput_enb[UE_id],TPUT_WINDOW_LENGTH,"","","");
|
||||
// fl_get_xyplot_ybounds(form->pusch_tput,&ymin,&ymax);
|
||||
// fl_set_xyplot_ybounds(form->pusch_tput,0,ymax);
|
||||
fl_check_forms();
|
||||
free(llr);
|
||||
free(bit);
|
||||
free(chest_f_abs);
|
||||
}
|
||||
FD_lte_phy_scope_ue *create_lte_phy_scope_ue( void ) {
|
||||
FL_OBJECT *obj;
|
||||
FD_lte_phy_scope_ue *fdui = fl_malloc( sizeof *fdui );
|
||||
// Define form
|
||||
fdui->lte_phy_scope_ue = fl_bgn_form( FL_NO_BOX, 800, 1000 );
|
||||
// This the whole UI box
|
||||
obj = fl_add_box( FL_BORDER_BOX, 0, 0, 800, 1000, "" );
|
||||
fl_set_object_color( obj, FL_BLACK, FL_BLACK );
|
||||
// Received signal
|
||||
fdui->rxsig_t = fl_add_xyplot( FL_NORMAL_XYPLOT, 20, 20, 370, 100, "Received Signal (Time-Domain, dB)" );
|
||||
fl_set_object_boxtype( fdui->rxsig_t, FL_EMBOSSED_BOX );
|
||||
fl_set_object_color( fdui->rxsig_t, FL_BLACK, FL_RED );
|
||||
fl_set_object_lcolor( fdui->rxsig_t, FL_WHITE ); // Label color
|
||||
fl_set_xyplot_ybounds(fdui->rxsig_t,30,70);
|
||||
// Time-domain channel response
|
||||
fdui->chest_t = fl_add_xyplot( FL_NORMAL_XYPLOT, 410, 20, 370, 100, "Channel Impulse Response (samples, abs)" );
|
||||
fl_set_object_boxtype( fdui->chest_t, FL_EMBOSSED_BOX );
|
||||
fl_set_object_color( fdui->chest_t, FL_BLACK, FL_RED );
|
||||
fl_set_object_lcolor( fdui->chest_t, FL_WHITE ); // Label color
|
||||
// Frequency-domain channel response
|
||||
fdui->chest_f = fl_add_xyplot( FL_IMPULSE_XYPLOT, 20, 140, 760, 100, "Channel Frequency Response (RE, dB)" );
|
||||
fl_set_object_boxtype( fdui->chest_f, FL_EMBOSSED_BOX );
|
||||
fl_set_object_color( fdui->chest_f, FL_BLACK, FL_RED );
|
||||
fl_set_object_lcolor( fdui->chest_f, FL_WHITE ); // Label color
|
||||
fl_set_xyplot_ybounds( fdui->chest_f,30,70);
|
||||
/*
|
||||
// LLR of PBCH
|
||||
fdui->pbch_llr = fl_add_xyplot( FL_POINTS_XYPLOT, 20, 260, 500, 100, "PBCH Log-Likelihood Ratios (LLR, mag)" );
|
||||
fl_set_object_boxtype( fdui->pbch_llr, FL_EMBOSSED_BOX );
|
||||
fl_set_object_color( fdui->pbch_llr, FL_BLACK, FL_GREEN );
|
||||
fl_set_object_lcolor( fdui->pbch_llr, FL_WHITE ); // Label color
|
||||
fl_set_xyplot_symbolsize( fdui->pbch_llr,2);
|
||||
fl_set_xyplot_xgrid( fdui->pbch_llr,FL_GRID_MAJOR);
|
||||
fl_set_xyplot_xbounds( fdui->pbch_llr,0,1920);
|
||||
// I/Q PBCH comp
|
||||
fdui->pbch_comp = fl_add_xyplot( FL_POINTS_XYPLOT, 540, 260, 240, 100, "PBCH I/Q of MF Output" );
|
||||
fl_set_object_boxtype( fdui->pbch_comp, FL_EMBOSSED_BOX );
|
||||
fl_set_object_color( fdui->pbch_comp, FL_BLACK, FL_GREEN );
|
||||
fl_set_object_lcolor( fdui->pbch_comp, FL_WHITE ); // Label color
|
||||
fl_set_xyplot_symbolsize( fdui->pbch_comp,2);
|
||||
fl_set_xyplot_xbounds( fdui->pbch_comp,-100,100);
|
||||
fl_set_xyplot_ybounds( fdui->pbch_comp,-100,100);
|
||||
// LLR of PDCCH
|
||||
fdui->pdcch_llr = fl_add_xyplot( FL_POINTS_XYPLOT, 20, 380, 500, 100, "PDCCH Log-Likelihood Ratios (LLR, mag)" );
|
||||
fl_set_object_boxtype( fdui->pdcch_llr, FL_EMBOSSED_BOX );
|
||||
fl_set_object_color( fdui->pdcch_llr, FL_BLACK, FL_CYAN );
|
||||
fl_set_object_lcolor( fdui->pdcch_llr, FL_WHITE ); // Label color
|
||||
fl_set_xyplot_symbolsize( fdui->pdcch_llr,2);
|
||||
// I/Q PDCCH comp
|
||||
fdui->pdcch_comp = fl_add_xyplot( FL_POINTS_XYPLOT, 540, 380, 240, 100, "PDCCH I/Q of MF Output" );
|
||||
fl_set_object_boxtype( fdui->pdcch_comp, FL_EMBOSSED_BOX );
|
||||
fl_set_object_color( fdui->pdcch_comp, FL_BLACK, FL_CYAN );
|
||||
fl_set_object_lcolor( fdui->pdcch_comp, FL_WHITE ); // Label color
|
||||
fl_set_xyplot_symbolsize( fdui->pdcch_comp,2);
|
||||
fl_set_xyplot_xgrid( fdui->pdcch_llr,FL_GRID_MAJOR);
|
||||
*/
|
||||
int offset=240;
|
||||
// LLR of PDSCH
|
||||
fdui->pdsch_llr = fl_add_xyplot( FL_POINTS_XYPLOT, 20, 500-offset, 500, 200, "PDSCH Log-Likelihood Ratios (LLR, mag)" );
|
||||
fl_set_object_boxtype( fdui->pdsch_llr, FL_EMBOSSED_BOX );
|
||||
fl_set_object_color( fdui->pdsch_llr, FL_BLACK, FL_YELLOW );
|
||||
fl_set_object_lcolor( fdui->pdsch_llr, FL_WHITE ); // Label color
|
||||
fl_set_xyplot_symbolsize( fdui->pdsch_llr,2);
|
||||
fl_set_xyplot_xgrid( fdui->pdsch_llr,FL_GRID_MAJOR);
|
||||
// I/Q PDSCH comp
|
||||
fdui->pdsch_comp = fl_add_xyplot( FL_POINTS_XYPLOT, 540, 500-offset, 240, 200, "PDSCH I/Q of MF Output" );
|
||||
fl_set_object_boxtype( fdui->pdsch_comp, FL_EMBOSSED_BOX );
|
||||
fl_set_object_color( fdui->pdsch_comp, FL_BLACK, FL_YELLOW );
|
||||
fl_set_object_lcolor( fdui->pdsch_comp, FL_WHITE ); // Label color
|
||||
fl_set_xyplot_symbolsize( fdui->pdsch_comp,2);
|
||||
// LLR of PDSCH
|
||||
fdui->pdsch_llr1 = fl_add_xyplot( FL_POINTS_XYPLOT, 20, 720-offset, 500, 200, "PDSCH Log-Likelihood Ratios (LLR, mag)" );
|
||||
fl_set_object_boxtype( fdui->pdsch_llr1, FL_EMBOSSED_BOX );
|
||||
fl_set_object_color( fdui->pdsch_llr1, FL_BLACK, FL_YELLOW );
|
||||
fl_set_object_lcolor( fdui->pdsch_llr1, FL_WHITE ); // Label color
|
||||
fl_set_xyplot_symbolsize( fdui->pdsch_llr1,2);
|
||||
fl_set_xyplot_xgrid( fdui->pdsch_llr1,FL_GRID_MAJOR);
|
||||
// I/Q PDSCH comp
|
||||
fdui->pdsch_comp1 = fl_add_xyplot( FL_POINTS_XYPLOT, 540, 720-offset, 240, 200, "PDSCH I/Q of MF Output" );
|
||||
fl_set_object_boxtype( fdui->pdsch_comp1, FL_EMBOSSED_BOX );
|
||||
fl_set_object_color( fdui->pdsch_comp1, FL_BLACK, FL_YELLOW );
|
||||
fl_set_object_lcolor( fdui->pdsch_comp1, FL_WHITE ); // Label color
|
||||
fl_set_xyplot_symbolsize( fdui->pdsch_comp1,2);
|
||||
/*
|
||||
// Throughput on PDSCH
|
||||
fdui->pdsch_tput = fl_add_xyplot( FL_NORMAL_XYPLOT, 20, 720, 500, 100, "PDSCH Throughput [frame]/[kbit/s]" );
|
||||
fl_set_object_boxtype( fdui->pdsch_tput, FL_EMBOSSED_BOX );
|
||||
fl_set_object_color( fdui->pdsch_tput, FL_BLACK, FL_WHITE );
|
||||
fl_set_object_lcolor( fdui->pdsch_tput, FL_WHITE ); // Label color
|
||||
// Generic UE Button
|
||||
fdui->button_0 = fl_add_button( FL_PUSH_BUTTON, 540, 720, 240, 40, "" );
|
||||
fl_set_object_lalign(fdui->button_0, FL_ALIGN_CENTER );
|
||||
//openair_daq_vars.use_ia_receiver = 0;
|
||||
fl_set_button(fdui->button_0,0);
|
||||
fl_set_object_label(fdui->button_0, "IA Receiver OFF");
|
||||
fl_set_object_color(fdui->button_0, FL_RED, FL_RED);
|
||||
fl_set_object_callback(fdui->button_0, ia_receiver_on_off, 0 );
|
||||
fl_hide_object(fdui->button_0);
|
||||
*/
|
||||
fl_end_form( );
|
||||
fdui->lte_phy_scope_ue->fdui = fdui;
|
||||
return fdui;
|
||||
}
|
||||
void phy_scope_UE(FD_lte_phy_scope_ue *form,
|
||||
PHY_VARS_UE *phy_vars_ue,
|
||||
int eNB_id,
|
||||
int UE_id,
|
||||
uint8_t subframe){
|
||||
int i,arx,atx,ind,k;
|
||||
LTE_DL_FRAME_PARMS *frame_parms = &phy_vars_ue->frame_parms;
|
||||
int nsymb_ce = frame_parms->ofdm_symbol_size*frame_parms->symbols_per_tti;
|
||||
uint8_t nb_antennas_rx = frame_parms->nb_antennas_rx;
|
||||
uint8_t nb_antennas_tx = frame_parms->nb_antenna_ports_eNB;
|
||||
int16_t **rxsig_t;
|
||||
int16_t **chest_t;
|
||||
int16_t **chest_f;
|
||||
int16_t *pdsch_llr,*pdsch_llr1;
|
||||
int16_t *pdsch_comp,*pdsch_comp1;
|
||||
int16_t *pdsch_mag0,*pdsch_mag1,*pdsch_magb0,*pdsch_magb1;
|
||||
int8_t *pdcch_llr;
|
||||
int16_t *pdcch_comp;
|
||||
int8_t *pbch_llr;
|
||||
int16_t *pbch_comp;
|
||||
float Re,Im,ymax=1;
|
||||
int num_pdcch_symbols=3;
|
||||
float *llr0, *bit0, *llr1, *bit1, *chest_f_abs, llr_pbch[1920], bit_pbch[1920], *llr_pdcch, *bit_pdcch;
|
||||
float *I, *Q;
|
||||
float rxsig_t_dB[nb_antennas_rx][FRAME_LENGTH_COMPLEX_SAMPLES];
|
||||
float **chest_t_abs;
|
||||
float time[FRAME_LENGTH_COMPLEX_SAMPLES];
|
||||
float freq[nsymb_ce*nb_antennas_rx*nb_antennas_tx];
|
||||
int frame = phy_vars_ue->proc.proc_rxtx[0].frame_rx;
|
||||
uint32_t total_dlsch_bitrate = phy_vars_ue->bitrate[eNB_id];
|
||||
int coded_bits_per_codeword0=0,coded_bits_per_codeword1=1;
|
||||
int mod0,mod1;
|
||||
int mcs0 = 0;
|
||||
int mcs1=0;
|
||||
unsigned char harq_pid = 0;
|
||||
int beamforming_mode = phy_vars_ue->transmission_mode[eNB_id]>6 ? phy_vars_ue->transmission_mode[eNB_id] : 0;
|
||||
if (phy_vars_ue->dlsch[eNB_id][0]!=NULL) {
|
||||
harq_pid = phy_vars_ue->dlsch[eNB_id][0]->current_harq_pid;
|
||||
if (harq_pid>=8)
|
||||
return;
|
||||
mcs0 = phy_vars_ue->dlsch[eNB_id][0]->harq_processes[harq_pid]->mcs;
|
||||
// Button 0
|
||||
/*
|
||||
if(!phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->dl_power_off) {
|
||||
// we are in TM5
|
||||
fl_show_object(form->button_0);
|
||||
}
|
||||
*/
|
||||
}
|
||||
if (phy_vars_ue->dlsch[eNB_id][1]!=NULL) {
|
||||
harq_pid = phy_vars_ue->dlsch[eNB_id][1]->current_harq_pid;
|
||||
if (harq_pid>=8)
|
||||
return;
|
||||
mcs1 = phy_vars_ue->dlsch[eNB_id][1]->harq_processes[harq_pid]->mcs;
|
||||
}
|
||||
if (phy_vars_ue->pdcch_vars[eNB_id]!=NULL) {
|
||||
num_pdcch_symbols = phy_vars_ue->pdcch_vars[eNB_id]->num_pdcch_symbols;
|
||||
}
|
||||
// coded_bits_per_codeword = frame_parms->N_RB_DL*12*get_Qm(mcs)*(frame_parms->symbols_per_tti);
|
||||
if (phy_vars_ue->dlsch[eNB_id][0]!=NULL) {
|
||||
mod0 = get_Qm(mcs0);
|
||||
coded_bits_per_codeword0 = get_G(frame_parms,
|
||||
phy_vars_ue->dlsch[eNB_id][0]->harq_processes[harq_pid]->nb_rb,
|
||||
phy_vars_ue->dlsch[eNB_id][0]->harq_processes[harq_pid]->rb_alloc_even,
|
||||
get_Qm(mcs0),
|
||||
phy_vars_ue->dlsch[eNB_id][0]->harq_processes[harq_pid]->Nl,
|
||||
num_pdcch_symbols,
|
||||
frame,
|
||||
subframe,
|
||||
beamforming_mode);
|
||||
} else {
|
||||
coded_bits_per_codeword0 = 0; //frame_parms->N_RB_DL*12*get_Qm(mcs)*(frame_parms->symbols_per_tti);
|
||||
mod0=0;
|
||||
}
|
||||
if (phy_vars_ue->dlsch[eNB_id][1]!=NULL) {
|
||||
mod1 = get_Qm(mcs1);
|
||||
coded_bits_per_codeword1 = get_G(frame_parms,
|
||||
phy_vars_ue->dlsch[eNB_id][1]->harq_processes[harq_pid]->nb_rb,
|
||||
phy_vars_ue->dlsch[eNB_id][1]->harq_processes[harq_pid]->rb_alloc_even,
|
||||
get_Qm(mcs1),
|
||||
phy_vars_ue->dlsch[eNB_id][1]->harq_processes[harq_pid]->Nl,
|
||||
num_pdcch_symbols,
|
||||
frame,
|
||||
subframe,
|
||||
beamforming_mode);
|
||||
} else {
|
||||
coded_bits_per_codeword1 = 0; //frame_parms->N_RB_DL*12*get_Qm(mcs)*(frame_parms->symbols_per_tti);
|
||||
mod1=0;
|
||||
}
|
||||
I = (float*) calloc(nsymb_ce*2,sizeof(float));
|
||||
Q = (float*) calloc(nsymb_ce*2,sizeof(float));
|
||||
chest_t_abs = (float**) malloc(nb_antennas_rx*sizeof(float*));
|
||||
for (arx=0;arx<nb_antennas_rx;arx++) {
|
||||
chest_t_abs[arx] = (float*) calloc(frame_parms->ofdm_symbol_size,sizeof(float));
|
||||
}
|
||||
chest_f_abs = (float*) calloc(nsymb_ce*nb_antennas_rx*nb_antennas_tx,sizeof(float));
|
||||
llr0 = (float*) calloc(coded_bits_per_codeword0,sizeof(float)); // init to zero
|
||||
bit0 = malloc(coded_bits_per_codeword0*sizeof(float));
|
||||
llr1 = (float*) calloc(coded_bits_per_codeword1,sizeof(float)); // init to zero
|
||||
bit1 = malloc(coded_bits_per_codeword1*sizeof(float));
|
||||
llr_pdcch = (float*) calloc(12*frame_parms->N_RB_DL*num_pdcch_symbols*2,sizeof(float)); // init to zero
|
||||
bit_pdcch = (float*) calloc(12*frame_parms->N_RB_DL*num_pdcch_symbols*2,sizeof(float));
|
||||
rxsig_t = (int16_t**) phy_vars_ue->common_vars.rxdata;
|
||||
chest_t = (int16_t**) phy_vars_ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates_time[eNB_id];
|
||||
chest_f = (int16_t**) phy_vars_ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id];
|
||||
pbch_llr = (int8_t*) phy_vars_ue->pbch_vars[eNB_id]->llr;
|
||||
pbch_comp = (int16_t*) phy_vars_ue->pbch_vars[eNB_id]->rxdataF_comp[0];
|
||||
pdcch_llr = (int8_t*) phy_vars_ue->pdcch_vars[eNB_id]->llr;
|
||||
pdcch_comp = (int16_t*) phy_vars_ue->pdcch_vars[eNB_id]->rxdataF_comp[0];
|
||||
pdsch_llr = (int16_t*) phy_vars_ue->pdsch_vars[subframe&0x1][eNB_id]->llr[0]; // stream 0
|
||||
pdsch_llr1 = (int16_t*) phy_vars_ue->pdsch_vars[subframe&0x1][eNB_id]->llr[1]; // stream 1
|
||||
pdsch_comp = (int16_t*) phy_vars_ue->pdsch_vars[subframe&0x1][eNB_id]->rxdataF_comp0[0];
|
||||
//pdsch_comp = (int16_t*) phy_vars_ue->lte_ue_pdsch_vars[subframe&0x1][eNB_id]->rxdataF_ext[0];
|
||||
//pdsch_comp1 = (int16_t*) phy_vars_ue->lte_ue_pdsch_vars[subframe&0x1][eNB_id]->rxdataF_ext[1];
|
||||
pdsch_comp1 = (int16_t*) (phy_vars_ue->pdsch_vars[subframe&0x1][eNB_id]->rxdataF_comp1[0][0])[0];
|
||||
//pdsch_comp1 = (int16_t*) (phy_vars_ue->lte_ue_pdsch_vars[eNB_id]->dl_ch_rho_ext[0][0])[0];
|
||||
pdsch_mag0 = (int16_t*) phy_vars_ue->pdsch_vars[subframe&0x1][eNB_id]->dl_ch_mag0[0];
|
||||
pdsch_mag1 = (int16_t*) (phy_vars_ue->pdsch_vars[subframe&0x1][eNB_id]->dl_ch_mag1[0][0])[0];
|
||||
pdsch_magb0 = (int16_t*) phy_vars_ue->pdsch_vars[subframe&0x1][eNB_id]->dl_ch_magb0[0];
|
||||
pdsch_magb1 = (int16_t*) (phy_vars_ue->pdsch_vars[subframe&0x1][eNB_id]->dl_ch_magb1[0][0])[0];
|
||||
fl_freeze_form(form->lte_phy_scope_ue);
|
||||
// Received signal in time domain of receive antenna 0
|
||||
if (rxsig_t != NULL) {
|
||||
if (rxsig_t[0] != NULL) {
|
||||
for (i=0; i<FRAME_LENGTH_COMPLEX_SAMPLES; i++) {
|
||||
rxsig_t_dB[0][i] = 10*log10(1.0+(float) ((rxsig_t[0][2*i])*(rxsig_t[0][2*i])+(rxsig_t[0][2*i+1])*(rxsig_t[0][2*i+1])));
|
||||
time[i] = (float) i;
|
||||
}
|
||||
fl_set_xyplot_data(form->rxsig_t,time,rxsig_t_dB[0],FRAME_LENGTH_COMPLEX_SAMPLES,"","","");
|
||||
}
|
||||
for (arx=1;arx<nb_antennas_rx;arx++) {
|
||||
if (rxsig_t[arx] != NULL) {
|
||||
for (i=0; i<FRAME_LENGTH_COMPLEX_SAMPLES; i++) {
|
||||
rxsig_t_dB[arx][i] = 10*log10(1.0+(float) ((rxsig_t[arx][2*i])*(rxsig_t[arx][2*i])+(rxsig_t[arx][2*i+1])*(rxsig_t[arx][2*i+1])));
|
||||
}
|
||||
fl_add_xyplot_overlay(form->rxsig_t,arx,time,rxsig_t_dB[arx],FRAME_LENGTH_COMPLEX_SAMPLES,rx_antenna_colors[arx]);
|
||||
}
|
||||
}
|
||||
}
|
||||
// Channel Impulse Response (still repeated format)
|
||||
if (chest_t != NULL) {
|
||||
ymax = 0;
|
||||
if (chest_t[0] !=NULL) {
|
||||
for (i=0; i<(frame_parms->ofdm_symbol_size>>3); i++) {
|
||||
chest_t_abs[0][i] = (float) (chest_t[0][4*i]*chest_t[0][4*i]+chest_t[0][4*i+1]*chest_t[0][4*i+1]);
|
||||
if (chest_t_abs[0][i] > ymax)
|
||||
ymax = chest_t_abs[0][i];
|
||||
}
|
||||
fl_set_xyplot_data(form->chest_t,time,chest_t_abs[0],(frame_parms->ofdm_symbol_size>>3),"","","");
|
||||
}
|
||||
for (arx=1; arx<nb_antennas_rx; arx++) {
|
||||
if (chest_t[arx] !=NULL) {
|
||||
for (i=0; i<(frame_parms->ofdm_symbol_size>>3); i++) {
|
||||
chest_t_abs[arx][i] = (float) (chest_t[arx][4*i]*chest_t[arx][4*i]+chest_t[arx][4*i+1]*chest_t[arx][4*i+1]);
|
||||
if (chest_t_abs[arx][i] > ymax)
|
||||
ymax = chest_t_abs[arx][i];
|
||||
}
|
||||
fl_add_xyplot_overlay(form->chest_t,arx,time,chest_t_abs[arx],(frame_parms->ofdm_symbol_size>>3),rx_antenna_colors[arx]);
|
||||
fl_set_xyplot_overlay_type(form->chest_t,arx,FL_DASHED_XYPLOT);
|
||||
}
|
||||
}
|
||||
// Avoid flickering effect
|
||||
// fl_get_xyplot_ybounds(form->chest_t,&ymin,&ymax);
|
||||
fl_set_xyplot_ybounds(form->chest_t,0,ymax);
|
||||
}
|
||||
// Channel Frequency Response (includes 5 complex sample for filter)
|
||||
if (chest_f != NULL) {
|
||||
ind = 0;
|
||||
for (atx=0;atx<nb_antennas_tx;atx++) {
|
||||
for (arx=0;arx<nb_antennas_rx;arx++) {
|
||||
if (chest_f[(atx<<1)+arx] != NULL) {
|
||||
for (k=0; k<nsymb_ce; k++) {
|
||||
freq[ind] = (float)ind;
|
||||
Re = (float)(chest_f[(atx<<1)+arx][(2*k)]);
|
||||
Im = (float)(chest_f[(atx<<1)+arx][(2*k)+1]);
|
||||
chest_f_abs[ind] = (short)10*log10(1.0+((double)Re*Re + (double)Im*Im));
|
||||
ind++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// tx antenna 0
|
||||
fl_set_xyplot_xbounds(form->chest_f,0,nb_antennas_rx*nb_antennas_tx*nsymb_ce);
|
||||
//fl_set_xyplot_xtics(form->chest_f,nb_antennas_rx*nb_antennas_tx*frame_parms->symbols_per_tti,2);
|
||||
// fl_set_xyplot_xtics(form->chest_f,nb_antennas_rx*nb_antennas_tx*2,2);
|
||||
fl_set_xyplot_xgrid(form->chest_f,FL_GRID_MAJOR);
|
||||
fl_set_xyplot_data(form->chest_f,freq,chest_f_abs,nsymb_ce,"","","");
|
||||
for (arx=1;arx<nb_antennas_rx;arx++) {
|
||||
fl_add_xyplot_overlay(form->chest_f,1,&freq[arx*nsymb_ce],&chest_f_abs[arx*nsymb_ce],nsymb_ce,rx_antenna_colors[arx]);
|
||||
}
|
||||
// other tx antennas
|
||||
if (nb_antennas_tx > 1) {
|
||||
if (nb_antennas_rx > 1) {
|
||||
for (atx=1;atx<nb_antennas_tx;atx++) {
|
||||
for (arx=0;arx<nb_antennas_rx;arx++) {
|
||||
fl_add_xyplot_overlay(form->chest_f,(atx<<1)+arx,&freq[((atx<<1)+arx)*nsymb_ce],&chest_f_abs[((atx<<1)+arx)*nsymb_ce],nsymb_ce,rx_antenna_colors[arx]);
|
||||
}
|
||||
}
|
||||
} else { // 1 rx antenna
|
||||
atx=1; arx=0;
|
||||
fl_add_xyplot_overlay(form->chest_f,atx,&freq[atx*nsymb_ce],&chest_f_abs[atx*nsymb_ce],nsymb_ce,rx_antenna_colors[arx]);
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
// PBCH LLRs
|
||||
if (pbch_llr != NULL) {
|
||||
for (i=0; i<1920;i++) {
|
||||
llr_pbch[i] = (float) pbch_llr[i];
|
||||
bit_pbch[i] = (float) i;
|
||||
}
|
||||
fl_set_xyplot_data(form->pbch_llr,bit_pbch,llr_pbch,1920,"","","");
|
||||
}
|
||||
// PBCH I/Q of MF Output
|
||||
if (pbch_comp!=NULL) {
|
||||
for (i=0; i<72*2; i++) {
|
||||
I[i] = pbch_comp[2*i];
|
||||
Q[i] = pbch_comp[2*i+1];
|
||||
}
|
||||
fl_set_xyplot_data(form->pbch_comp,I,Q,72*2,"","","");
|
||||
}
|
||||
// PDCCH LLRs
|
||||
if (pdcch_llr != NULL) {
|
||||
for (i=0; i<12*frame_parms->N_RB_DL*2*num_pdcch_symbols;i++) {
|
||||
llr_pdcch[i] = (float) pdcch_llr[i];
|
||||
bit_pdcch[i] = (float) i;
|
||||
}
|
||||
fl_set_xyplot_xbounds(form->pdcch_llr,0,12*frame_parms->N_RB_DL*2*3);
|
||||
fl_set_xyplot_data(form->pdcch_llr,bit_pdcch,llr_pdcch,12*frame_parms->N_RB_DL*2*num_pdcch_symbols,"","","");
|
||||
}
|
||||
// PDCCH I/Q of MF Output
|
||||
if (pdcch_comp!=NULL) {
|
||||
for (i=0; i<12*frame_parms->N_RB_DL*num_pdcch_symbols; i++) {
|
||||
I[i] = pdcch_comp[2*i];
|
||||
Q[i] = pdcch_comp[2*i+1];
|
||||
}
|
||||
fl_set_xyplot_data(form->pdcch_comp,I,Q,12*frame_parms->N_RB_DL*num_pdcch_symbols,"","","");
|
||||
}
|
||||
*/
|
||||
// PDSCH LLRs CW0
|
||||
if (pdsch_llr != NULL) {
|
||||
for (i=0; i<coded_bits_per_codeword0; i++) {
|
||||
llr0[i] = (float) pdsch_llr[i];
|
||||
bit0[i] = (float) i;
|
||||
}
|
||||
fl_set_xyplot_xbounds(form->pdsch_llr,0,coded_bits_per_codeword0);
|
||||
fl_set_xyplot_data(form->pdsch_llr,bit0,llr0,coded_bits_per_codeword0,"","","");
|
||||
}
|
||||
// PDSCH I/Q of MF Output
|
||||
if (pdsch_comp!=NULL) {
|
||||
ind=0;
|
||||
for (k=0; k<frame_parms->symbols_per_tti; k++) {
|
||||
for (i=0; i<12*frame_parms->N_RB_DL/2; i++) {
|
||||
I[ind] = pdsch_comp[(2*frame_parms->N_RB_DL*12*k)+4*i];
|
||||
Q[ind] = pdsch_comp[(2*frame_parms->N_RB_DL*12*k)+4*i+1];
|
||||
ind++;
|
||||
}
|
||||
}
|
||||
fl_set_xyplot_data(form->pdsch_comp,I,Q,ind,"","","");
|
||||
}
|
||||
if (pdsch_mag0 != NULL) {
|
||||
ind=0;
|
||||
for (k=0; k<frame_parms->symbols_per_tti; k++) {
|
||||
for (i=0; i<12*frame_parms->N_RB_DL/2; i++) {
|
||||
I[ind] = pdsch_mag0[(2*frame_parms->N_RB_DL*12*k)+4*i]*cos(i*2*M_PI/(12*frame_parms->N_RB_DL/2));
|
||||
Q[ind] = pdsch_mag0[(2*frame_parms->N_RB_DL*12*k)+4*i+1]*sin(i*2*M_PI/(12*frame_parms->N_RB_DL/2));
|
||||
ind++;
|
||||
}
|
||||
}
|
||||
fl_add_xyplot_overlay(form->pdsch_comp,1,I,Q,ind,FL_GREEN);
|
||||
}
|
||||
if (pdsch_magb0 != NULL) {
|
||||
ind=0;
|
||||
for (k=0; k<frame_parms->symbols_per_tti; k++) {
|
||||
for (i=0; i<12*frame_parms->N_RB_DL/2; i++) {
|
||||
I[ind] = pdsch_magb0[(2*frame_parms->N_RB_DL*12*k)+4*i]*cos(i*2*M_PI/(12*frame_parms->N_RB_DL/2));
|
||||
Q[ind] = pdsch_magb0[(2*frame_parms->N_RB_DL*12*k)+4*i+1]*sin(i*2*M_PI/(12*frame_parms->N_RB_DL/2));
|
||||
ind++;
|
||||
}
|
||||
}
|
||||
fl_add_xyplot_overlay(form->pdsch_comp,2,I,Q,ind,FL_RED);
|
||||
}
|
||||
if ((pdsch_mag0 != NULL) && (pdsch_magb0 != NULL)) {
|
||||
ind=0;
|
||||
for (k=0; k<frame_parms->symbols_per_tti; k++) {
|
||||
for (i=0; i<12*frame_parms->N_RB_DL/2; i++) {
|
||||
I[ind] =
|
||||
(pdsch_mag0[(2*frame_parms->N_RB_DL*12*k)+4*i]+
|
||||
pdsch_magb0[(2*frame_parms->N_RB_DL*12*k)+4*i])*
|
||||
cos(i*2*M_PI/(12*frame_parms->N_RB_DL/2));
|
||||
Q[ind] =
|
||||
(pdsch_mag0[(2*frame_parms->N_RB_DL*12*k)+4*i+1]+
|
||||
pdsch_magb0[(2*frame_parms->N_RB_DL*12*k)+4*i+1])*
|
||||
sin(i*2*M_PI/(12*frame_parms->N_RB_DL/2));
|
||||
ind++;
|
||||
}
|
||||
}
|
||||
fl_add_xyplot_overlay(form->pdsch_comp,3,I,Q,ind,FL_BLUE);
|
||||
}
|
||||
// PDSCH LLRs CW1
|
||||
if (pdsch_llr1 != NULL) {
|
||||
for (i=0; i<coded_bits_per_codeword1; i++) {
|
||||
llr1[i] = (float) pdsch_llr1[i];
|
||||
bit1[i] = (float) i;
|
||||
}
|
||||
fl_set_xyplot_xbounds(form->pdsch_llr1,0,coded_bits_per_codeword1);
|
||||
fl_set_xyplot_data(form->pdsch_llr1,bit1,llr1,coded_bits_per_codeword1,"","","");
|
||||
}
|
||||
// PDSCH I/Q of MF Output
|
||||
if (pdsch_comp1!=NULL) {
|
||||
ind=0;
|
||||
for (k=0; k<frame_parms->symbols_per_tti; k++) {
|
||||
for (i=0; i<12*frame_parms->N_RB_DL/2; i++) {
|
||||
I[ind] = pdsch_comp1[(2*frame_parms->N_RB_DL*12*k)+4*i];
|
||||
Q[ind] = pdsch_comp1[(2*frame_parms->N_RB_DL*12*k)+4*i+1];
|
||||
ind++;
|
||||
}
|
||||
}
|
||||
fl_set_xyplot_data(form->pdsch_comp1,I,Q,ind,"","","");
|
||||
}
|
||||
if (pdsch_mag1 != NULL) {
|
||||
ind=0;
|
||||
for (k=0; k<frame_parms->symbols_per_tti; k++) {
|
||||
for (i=0; i<12*frame_parms->N_RB_DL/2; i++) {
|
||||
I[ind] = pdsch_mag1[(2*frame_parms->N_RB_DL*12*k)+4*i]*cos(i*2*M_PI/(12*frame_parms->N_RB_DL/2));
|
||||
Q[ind] = pdsch_mag1[(2*frame_parms->N_RB_DL*12*k)+4*i+1]*sin(i*2*M_PI/(12*frame_parms->N_RB_DL/2));
|
||||
ind++;
|
||||
}
|
||||
}
|
||||
fl_add_xyplot_overlay(form->pdsch_comp1,1,I,Q,ind,FL_GREEN);
|
||||
}
|
||||
if (pdsch_magb1 != NULL) {
|
||||
ind=0;
|
||||
for (k=0; k<frame_parms->symbols_per_tti; k++) {
|
||||
for (i=0; i<12*frame_parms->N_RB_DL/2; i++) {
|
||||
I[ind] = pdsch_magb1[(2*frame_parms->N_RB_DL*12*k)+4*i]*cos(i*2*M_PI/(12*frame_parms->N_RB_DL/2));
|
||||
Q[ind] = pdsch_magb1[(2*frame_parms->N_RB_DL*12*k)+4*i+1]*sin(i*2*M_PI/(12*frame_parms->N_RB_DL/2));
|
||||
ind++;
|
||||
}
|
||||
}
|
||||
fl_add_xyplot_overlay(form->pdsch_comp1,2,I,Q,ind,FL_RED);
|
||||
}
|
||||
if ((pdsch_mag1 != NULL) && (pdsch_magb1 != NULL)) {
|
||||
ind=0;
|
||||
for (k=0; k<frame_parms->symbols_per_tti; k++) {
|
||||
for (i=0; i<12*frame_parms->N_RB_DL/2; i++) {
|
||||
I[ind] =
|
||||
(pdsch_mag1[(2*frame_parms->N_RB_DL*12*k)+4*i]+
|
||||
pdsch_magb1[(2*frame_parms->N_RB_DL*12*k)+4*i])*
|
||||
cos(i*2*M_PI/(12*frame_parms->N_RB_DL/2));
|
||||
Q[ind] =
|
||||
(pdsch_mag1[(2*frame_parms->N_RB_DL*12*k)+4*i+1]+
|
||||
pdsch_magb1[(2*frame_parms->N_RB_DL*12*k)+4*i+1])*
|
||||
sin(i*2*M_PI/(12*frame_parms->N_RB_DL/2));
|
||||
ind++;
|
||||
}
|
||||
}
|
||||
fl_add_xyplot_overlay(form->pdsch_comp1,3,I,Q,ind,FL_BLUE);
|
||||
}
|
||||
/*
|
||||
// PDSCH Throughput
|
||||
memcpy((void*)tput_time_ue[UE_id],(void*)&tput_time_ue[UE_id][1],(TPUT_WINDOW_LENGTH-1)*sizeof(float));
|
||||
memcpy((void*)tput_ue[UE_id],(void*)&tput_ue[UE_id][1],(TPUT_WINDOW_LENGTH-1)*sizeof(float));
|
||||
tput_time_ue[UE_id][TPUT_WINDOW_LENGTH-1] = (float) frame;
|
||||
tput_ue[UE_id][TPUT_WINDOW_LENGTH-1] = ((float) total_dlsch_bitrate)/1000.0;
|
||||
if (tput_ue[UE_id][TPUT_WINDOW_LENGTH-1] > tput_ue_max[UE_id]) {
|
||||
tput_ue_max[UE_id] = tput_ue[UE_id][TPUT_WINDOW_LENGTH-1];
|
||||
}
|
||||
fl_set_xyplot_data(form->pdsch_tput,tput_time_ue[UE_id],tput_ue[UE_id],TPUT_WINDOW_LENGTH,"","","");
|
||||
fl_set_xyplot_ybounds(form->pdsch_tput,0,tput_ue_max[UE_id]);
|
||||
*/
|
||||
fl_unfreeze_form(form->lte_phy_scope_ue);
|
||||
fl_check_forms();
|
||||
free(I);
|
||||
free(Q);
|
||||
free(chest_f_abs);
|
||||
free(llr0);
|
||||
free(bit0);
|
||||
free(llr1);
|
||||
free(bit1);
|
||||
free(bit_pdcch);
|
||||
free(llr_pdcch);
|
||||
for (arx=0;arx<nb_antennas_rx;arx++) {
|
||||
free(chest_t_abs[arx]);
|
||||
}
|
||||
}
|
||||
@@ -45,6 +45,7 @@ typedef struct {
|
||||
long long diff_square; /*!< \brief process duration square */
|
||||
long long max;
|
||||
int trials;
|
||||
int meas_flag;
|
||||
} time_stats_t;
|
||||
#elif defined(__arm__)
|
||||
typedef struct {
|
||||
@@ -98,9 +99,14 @@ static inline void start_meas(time_stats_t *ts)
|
||||
{
|
||||
|
||||
if (opp_enabled) {
|
||||
|
||||
if (ts->meas_flag==0) {
|
||||
ts->trials++;
|
||||
ts->in = rdtsc_oai();
|
||||
ts->meas_flag=1;
|
||||
}
|
||||
else {
|
||||
ts->in = rdtsc_oai();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -120,7 +126,8 @@ static inline void stop_meas(time_stats_t *ts)
|
||||
|
||||
if ((out-ts->in) > ts->max)
|
||||
ts->max = out-ts->in;
|
||||
|
||||
|
||||
ts->meas_flag=0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -132,6 +139,7 @@ static inline void reset_meas(time_stats_t *ts) {
|
||||
ts->p_time=0;
|
||||
ts->diff_square=0;
|
||||
ts->max=0;
|
||||
ts->meas_flag=0;
|
||||
|
||||
}
|
||||
|
||||
|
||||
+22
-11
@@ -153,10 +153,10 @@ enum transmission_access_mode {
|
||||
typedef enum {
|
||||
eNodeB_3GPP=0, // classical eNodeB function
|
||||
eNodeB_3GPP_BBU, // eNodeB with NGFI IF5
|
||||
NGFI_RCC_IF4p5, // NGFI_RCC (NGFI radio cloud center)
|
||||
NGFI_RCC_IF4p5, // NGFI_RCC (NGFI radio cloud center)
|
||||
NGFI_RAU_IF4p5,
|
||||
NGFI_RRU_IF5, // NGFI_RRU (NGFI remote radio-unit,IF5)
|
||||
NGFI_RRU_IF4p5 // NGFI_RRU (NGFI remote radio-unit,IF4p5)
|
||||
NGFI_RRU_IF4p5 // NGFI_RRU (NGFI remote radio-unit,IF4p5)
|
||||
} eNB_func_t;
|
||||
|
||||
typedef enum {
|
||||
@@ -592,7 +592,7 @@ typedef struct PHY_VARS_eNB_s {
|
||||
uint32_t total_transmitted_bits;
|
||||
uint32_t total_system_throughput;
|
||||
|
||||
int hw_timing_advance;
|
||||
int hw_timing_advance;
|
||||
|
||||
time_stats_t phy_proc;
|
||||
time_stats_t phy_proc_tx;
|
||||
@@ -629,7 +629,7 @@ typedef struct PHY_VARS_eNB_s {
|
||||
#ifdef LOCALIZATION
|
||||
/// time state for localization
|
||||
time_stats_t localization_stats;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
int32_t pucch1_stats_cnt[NUMBER_OF_UE_MAX][10];
|
||||
int32_t pucch1_stats[NUMBER_OF_UE_MAX][10*1024];
|
||||
@@ -641,9 +641,9 @@ typedef struct PHY_VARS_eNB_s {
|
||||
int32_t pusch_stats_mcs[NUMBER_OF_UE_MAX][10240];
|
||||
int32_t pusch_stats_bsr[NUMBER_OF_UE_MAX][10240];
|
||||
int32_t pusch_stats_BO[NUMBER_OF_UE_MAX][10240];
|
||||
|
||||
|
||||
/// RF and Interface devices per CC
|
||||
openair0_device rfdevice;
|
||||
openair0_device rfdevice;
|
||||
openair0_device ifdevice;
|
||||
/// Pointer for ifdevice buffer struct
|
||||
if_buffer_t ifbuffer;
|
||||
@@ -906,7 +906,18 @@ typedef struct {
|
||||
time_stats_t tx_prach;
|
||||
|
||||
/// RF and Interface devices per CC
|
||||
openair0_device rfdevice;
|
||||
openair0_device rfdevice;
|
||||
time_stats_t dlsch_encoding_SIC_stats;
|
||||
time_stats_t dlsch_scrambling_SIC_stats;
|
||||
time_stats_t dlsch_modulation_SIC_stats;
|
||||
time_stats_t dlsch_llr_stripping_unit_SIC_stats;
|
||||
time_stats_t dlsch_unscrambling_SIC_stats;
|
||||
|
||||
#if ENABLE_RAL
|
||||
hash_table_t *ral_thresholds_timed;
|
||||
SLIST_HEAD(ral_thresholds_gen_poll_s, ral_threshold_phy_t) ral_thresholds_gen_polled[RAL_LINK_PARAM_GEN_MAX];
|
||||
SLIST_HEAD(ral_thresholds_lte_poll_s, ral_threshold_phy_t) ral_thresholds_lte_polled[RAL_LINK_PARAM_LTE_MAX];
|
||||
#endif
|
||||
|
||||
} PHY_VARS_UE;
|
||||
|
||||
@@ -919,7 +930,7 @@ static inline int wait_on_condition(pthread_mutex_t *mutex,pthread_cond_t *cond,
|
||||
exit_fun("nothing to add");
|
||||
return(-1);
|
||||
}
|
||||
|
||||
|
||||
while (*instance_cnt < 0) {
|
||||
// most of the time the thread is waiting here
|
||||
// proc->instance_cnt_rxtx is -1
|
||||
@@ -941,7 +952,7 @@ static inline int wait_on_busy_condition(pthread_mutex_t *mutex,pthread_cond_t *
|
||||
exit_fun("nothing to add");
|
||||
return(-1);
|
||||
}
|
||||
|
||||
|
||||
while (*instance_cnt == 0) {
|
||||
// most of the time the thread will skip this
|
||||
// waits only if proc->instance_cnt_rxtx is 0
|
||||
@@ -963,9 +974,9 @@ static inline int release_thread(pthread_mutex_t *mutex,int *instance_cnt,char *
|
||||
exit_fun("nothing to add");
|
||||
return(-1);
|
||||
}
|
||||
|
||||
|
||||
*instance_cnt=*instance_cnt-1;
|
||||
|
||||
|
||||
if (pthread_mutex_unlock(mutex) != 0) {
|
||||
LOG_E( PHY, "[SCHED][eNB] error unlocking mutex for %s\n",name);
|
||||
exit_fun("nothing to add");
|
||||
|
||||
Regular → Executable
+20
-13
@@ -666,8 +666,8 @@ typedef struct {
|
||||
/// - third index: tx antenna [0..nb_antennas_tx[
|
||||
/// - fourth index: sample [0..]
|
||||
int32_t **beam_weights[3][15];
|
||||
/// \brief Holds the tdd reciprocity calibration coefficients
|
||||
/// - first index: eNB id [0..2] (hard coded)
|
||||
/// \brief Holds the tdd reciprocity calibration coefficients
|
||||
/// - first index: eNB id [0..2] (hard coded)
|
||||
/// - second index: tx antenna [0..nb_antennas_tx[
|
||||
/// - third index: frequency [0..]
|
||||
int32_t **tdd_calib_coeffs[3];
|
||||
@@ -845,15 +845,22 @@ typedef struct {
|
||||
/// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
|
||||
/// - second index: ? [0..168*N_RB_DL[
|
||||
int32_t **rxdataF_comp0;
|
||||
/// \brief Received frequency-domain signal after extraction and channel compensation.
|
||||
/// - first index: ? [0..7] (hard coded) accessed via \c round
|
||||
/// - second index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
|
||||
/// - third index: ? [0..168*N_RB_DL[
|
||||
int32_t **rxdataF_comp1[8];
|
||||
/// \brief Received frequency-domain signal after extraction and channel compensation for the second stream. For the SIC receiver we need to store the history of this for each harq process and round
|
||||
/// - first index: ? [0..7] (hard coded) accessed via \c harq_pid
|
||||
/// - second index: ? [0..7] (hard coded) accessed via \c round
|
||||
/// - third index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
|
||||
/// - fourth index: ? [0..168*N_RB_DL[
|
||||
int32_t **rxdataF_comp1[8][8];
|
||||
/// \brief Downlink channel estimates extracted in PRBS.
|
||||
/// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
|
||||
/// - second index: ? [0..168*N_RB_DL[
|
||||
int32_t **dl_ch_estimates_ext;
|
||||
/// \brief Downlink cross-correlation of MIMO channel estimates (unquantized PMI) extracted in PRBS. For the SIC receiver we need to store the history of this for each harq process and round
|
||||
/// - first index: ? [0..7] (hard coded) accessed via \c harq_pid
|
||||
/// - second index: ? [0..7] (hard coded) accessed via \c round
|
||||
/// - third index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
|
||||
/// - fourth index: ? [0..168*N_RB_DL[
|
||||
int32_t **dl_ch_rho_ext[8][8];
|
||||
/// \brief Downlink beamforming channel estimates in frequency domain.
|
||||
/// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
|
||||
/// - second index: samples? [0..symbols_per_tti*(ofdm_symbol_size+LTE_CE_FILTER_LENGTH)[
|
||||
@@ -865,10 +872,6 @@ typedef struct {
|
||||
/// \brief Downlink cross-correlation of MIMO channel estimates (unquantized PMI) extracted in PRBS.
|
||||
/// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
|
||||
/// - second index: ? [0..168*N_RB_DL[
|
||||
int32_t **dl_ch_rho_ext;
|
||||
/// \brief Downlink cross-correlation of MIMO channel estimates (unquantized PMI) extracted in PRBS.
|
||||
/// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
|
||||
/// - second index: ? [0..168*N_RB_DL[
|
||||
int32_t **dl_ch_rho2_ext;
|
||||
/// \brief Downlink PMIs extracted in PRBS and grouped in subbands.
|
||||
/// - first index: ressource block [0..N_RB_DL[
|
||||
@@ -880,7 +883,7 @@ typedef struct {
|
||||
/// \brief Magnitude of Downlink Channel second layer (16QAM level/First 64QAM level).
|
||||
/// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
|
||||
/// - second index: ? [0..168*N_RB_DL[
|
||||
int32_t **dl_ch_mag1;
|
||||
int32_t **dl_ch_mag1[8][8];
|
||||
/// \brief Magnitude of Downlink Channel, first layer (2nd 64QAM level).
|
||||
/// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
|
||||
/// - second index: ? [0..168*N_RB_DL[
|
||||
@@ -888,7 +891,7 @@ typedef struct {
|
||||
/// \brief Magnitude of Downlink Channel second layer (2nd 64QAM level).
|
||||
/// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
|
||||
/// - second index: ? [0..168*N_RB_DL[
|
||||
int32_t **dl_ch_magb1;
|
||||
int32_t **dl_ch_magb1[8][8];
|
||||
/// \brief Cross-correlation of two eNB signals.
|
||||
/// - first index: rx antenna [0..nb_antennas_rx[
|
||||
/// - second index: symbol [0..]
|
||||
@@ -901,6 +904,10 @@ typedef struct {
|
||||
int16_t *llr[2];
|
||||
/// \f$\log_2(\max|H_i|^2)\f$
|
||||
int16_t log2_maxh;
|
||||
/// \f$\log_2(\max|H_i|^2)\f$ //this is for TM3-4 layer1 channel compensation
|
||||
int16_t log2_maxh0;
|
||||
/// \f$\log_2(\max|H_i|^2)\f$ //this is for TM3-4 layer2 channel commpensation
|
||||
int16_t log2_maxh1;
|
||||
/// \brief LLR shifts for subband scaling.
|
||||
/// - first index: ? [0..168*N_RB_DL[
|
||||
uint8_t *llr_shifts;
|
||||
|
||||
@@ -202,7 +202,7 @@
|
||||
|
||||
|
||||
#define ONE_OVER_SQRT2_Q15 23170
|
||||
|
||||
#define ONE_OVER_2_Q15 16384
|
||||
|
||||
// QAM amplitude definitions
|
||||
|
||||
|
||||
@@ -197,7 +197,7 @@ void phy_procedures_eNB_S_TX(PHY_VARS_eNB *phy_vars_eNB,relaying_type_t r_type);
|
||||
*/
|
||||
void phy_procedures_eNB_S_RX(PHY_VARS_eNB *phy_vars_eNB,eNB_rxtx_proc_t *proc,relaying_type_t r_type);
|
||||
|
||||
/*! \brief Scheduling for eNB PRACH RX procedures
|
||||
/*! \brief Scheduling for eNB PRACH RX procedures
|
||||
@param phy_vars_eNB Pointer to eNB variables on which to act
|
||||
@param proc Pointer to RXn-TXnp4 proc information
|
||||
*/
|
||||
@@ -510,8 +510,10 @@ int get_ue_active_harq_pid(uint8_t Mod_id,uint8_t CC_id,uint16_t rnti,int frame,
|
||||
void dump_dlsch(PHY_VARS_UE *phy_vars_ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t subframe,uint8_t harq_pid);
|
||||
void dump_dlsch_SI(PHY_VARS_UE *phy_vars_ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t subframe);
|
||||
void dump_dlsch_ra(PHY_VARS_UE *phy_vars_ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t subframe);
|
||||
|
||||
void dump_dlsch2(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t subframe, uint16_t coded_bits_per_codeword,int round);
|
||||
|
||||
|
||||
/*@}*/
|
||||
|
||||
|
||||
|
||||
@@ -689,7 +689,7 @@ void generate_eNB_dlsch_params(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC
|
||||
dci_alloc->format,
|
||||
&eNB->dlsch_SI,
|
||||
fp,
|
||||
eNB->pdsch_config_dedicated,
|
||||
NULL,
|
||||
SI_RNTI,
|
||||
0,
|
||||
P_RNTI,
|
||||
@@ -723,7 +723,7 @@ void generate_eNB_dlsch_params(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC
|
||||
dci_alloc->format,
|
||||
&eNB->dlsch_ra,
|
||||
fp,
|
||||
eNB->pdsch_config_dedicated,
|
||||
NULL,
|
||||
SI_RNTI,
|
||||
dci_alloc->rnti,
|
||||
P_RNTI,
|
||||
@@ -773,7 +773,7 @@ void generate_eNB_dlsch_params(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC
|
||||
dci_alloc->format,
|
||||
eNB->dlsch[(uint8_t)UE_id],
|
||||
fp,
|
||||
eNB->pdsch_config_dedicated,
|
||||
&eNB->pdsch_config_dedicated[UE_id],
|
||||
SI_RNTI,
|
||||
0,
|
||||
P_RNTI,
|
||||
@@ -1480,7 +1480,13 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
|
||||
0);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
if (frame>=10 && subframe>=9) {
|
||||
write_output("/tmp/txsigF0.m","txsF0", &eNB->common_vars.txdataF[0][0][0],120*eNB->frame_parms.ofdm_symbol_size,1,1);
|
||||
write_output("/tmp/txsigF1.m","txsF1", &eNB->common_vars.txdataF[0][0][0],120*eNB->frame_parms.ofdm_symbol_size,1,1);
|
||||
abort();
|
||||
}
|
||||
*/
|
||||
|
||||
#ifdef EMOS
|
||||
phy_procedures_emos_eNB_TX(subframe, eNB);
|
||||
@@ -3473,3 +3479,4 @@ int phy_procedures_RN_eNB_TX(unsigned char last_slot, unsigned char next_slot, r
|
||||
return do_proc;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -118,10 +118,10 @@ void do_OFDM_mod_l(int32_t **txdataF, int32_t **txdata, uint16_t next_slot, LTE_
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
void DL_channel(PHY_VARS_eNB *eNB,PHY_VARS_UE *UE,int subframe,int awgn_flag,double SNR, int tx_lev,int hold_channel,int abstx, int num_rounds, int trials, int round, channel_desc_t *eNB2UE[4],
|
||||
void DL_channel(PHY_VARS_eNB *eNB,PHY_VARS_UE *UE,int subframe,int awgn_flag,double SNR, int tx_lev,int hold_channel,int abstx, int num_rounds, int trials, int round, channel_desc_t *eNB2UE[4],
|
||||
double *s_re[2],double *s_im[2],double *r_re[2],double *r_im[2],FILE *csv_fd) {
|
||||
|
||||
int i,u;
|
||||
@@ -145,17 +145,17 @@ void DL_channel(PHY_VARS_eNB *eNB,PHY_VARS_UE *UE,int subframe,int awgn_flag,dou
|
||||
r_re[aarx][i] += ((double)(((short *)eNB->common_vars.txdata[0][aa]))[(2*subframe*UE->frame_parms.samples_per_tti) +(i<<1)]);
|
||||
r_im[aarx][i] += ((double)(((short *)eNB->common_vars.txdata[0][aa]))[(2*subframe*UE->frame_parms.samples_per_tti) +(i<<1)+1]);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Multipath channel
|
||||
if (awgn_flag == 0) {
|
||||
multipath_channel(eNB2UE[round],s_re,s_im,r_re,r_im,
|
||||
2*UE->frame_parms.samples_per_tti,hold_channel);
|
||||
|
||||
|
||||
// printf("amc: ****************** eNB2UE[%d]->n_rx = %d,dd %d\n",round,eNB2UE[round]->nb_rx,eNB2UE[round]->channel_offset);
|
||||
if(abstx==1 && num_rounds>1)
|
||||
if(round==0 && hold_channel==0) {
|
||||
@@ -163,7 +163,7 @@ void DL_channel(PHY_VARS_eNB *eNB,PHY_VARS_UE *UE,int subframe,int awgn_flag,dou
|
||||
random_channel(eNB2UE[2],0);
|
||||
random_channel(eNB2UE[3],0);
|
||||
}
|
||||
|
||||
|
||||
if (UE->perfect_ce==1) {
|
||||
// fill in perfect channel estimates
|
||||
freq_channel(eNB2UE[round],UE->frame_parms.N_RB_DL,12*UE->frame_parms.N_RB_DL + 1);
|
||||
@@ -173,15 +173,15 @@ void DL_channel(PHY_VARS_eNB *eNB,PHY_VARS_UE *UE,int subframe,int awgn_flag,dou
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
if(abstx) {
|
||||
if (trials==0 && round==0) {
|
||||
// calculate freq domain representation to compute SINR
|
||||
freq_channel(eNB2UE[0], eNB->frame_parms.N_RB_DL,2*eNB->frame_parms.N_RB_DL + 1);
|
||||
// snr=pow(10.0,.1*SNR);
|
||||
fprintf(csv_fd,"%f,",SNR);
|
||||
|
||||
|
||||
for (u=0; u<2*eNB->frame_parms.N_RB_DL; u++) {
|
||||
for (aarx=0; aarx<eNB2UE[0]->nb_rx; aarx++) {
|
||||
for (aatx=0; aatx<eNB2UE[0]->nb_tx; aatx++) {
|
||||
@@ -190,11 +190,11 @@ void DL_channel(PHY_VARS_eNB *eNB,PHY_VARS_UE *UE,int subframe,int awgn_flag,dou
|
||||
fprintf(csv_fd,"%e+i*(%e),",channelx,channely);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if(num_rounds>1) {
|
||||
freq_channel(eNB2UE[1], eNB->frame_parms.N_RB_DL,2*eNB->frame_parms.N_RB_DL + 1);
|
||||
|
||||
|
||||
for (u=0; u<2*eNB->frame_parms.N_RB_DL; u++) {
|
||||
for (aarx=0; aarx<eNB2UE[1]->nb_rx; aarx++) {
|
||||
for (aatx=0; aatx<eNB2UE[1]->nb_tx; aatx++) {
|
||||
@@ -204,9 +204,9 @@ void DL_channel(PHY_VARS_eNB *eNB,PHY_VARS_UE *UE,int subframe,int awgn_flag,dou
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
freq_channel(eNB2UE[2], eNB->frame_parms.N_RB_DL,2*eNB->frame_parms.N_RB_DL + 1);
|
||||
|
||||
|
||||
for (u=0; u<2*eNB->frame_parms.N_RB_DL; u++) {
|
||||
for (aarx=0; aarx<eNB2UE[2]->nb_rx; aarx++) {
|
||||
for (aatx=0; aatx<eNB2UE[2]->nb_tx; aatx++) {
|
||||
@@ -216,9 +216,9 @@ void DL_channel(PHY_VARS_eNB *eNB,PHY_VARS_UE *UE,int subframe,int awgn_flag,dou
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
freq_channel(eNB2UE[3], eNB->frame_parms.N_RB_DL,2*eNB->frame_parms.N_RB_DL + 1);
|
||||
|
||||
|
||||
for (u=0; u<2*eNB->frame_parms.N_RB_DL; u++) {
|
||||
for (aarx=0; aarx<eNB2UE[3]->nb_rx; aarx++) {
|
||||
for (aatx=0; aatx<eNB2UE[3]->nb_tx; aatx++) {
|
||||
@@ -231,10 +231,11 @@ void DL_channel(PHY_VARS_eNB *eNB,PHY_VARS_UE *UE,int subframe,int awgn_flag,dou
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//AWGN
|
||||
// This is the SNR on the PDSCH for OFDM symbols without pilots -> rho_A
|
||||
sigma2_dB = 10*log10((double)tx_lev) +10*log10((double)eNB->frame_parms.ofdm_symbol_size/(double)(eNB->frame_parms.N_RB_DL*12)) - SNR - get_pa_dB(eNB->pdsch_config_dedicated);
|
||||
// tx_lev is the average energy over the whole subframe
|
||||
// but SNR should be better defined wrt the energy in the reference symbols
|
||||
sigma2_dB = 10*log10((double)tx_lev) +10*log10((double)eNB->frame_parms.ofdm_symbol_size/(double)(eNB->frame_parms.N_RB_DL*12)) - SNR;
|
||||
sigma2 = pow(10,sigma2_dB/10);
|
||||
|
||||
for (i=0; i<2*UE->frame_parms.samples_per_tti; i++) {
|
||||
@@ -251,7 +252,7 @@ void DL_channel(PHY_VARS_eNB *eNB,PHY_VARS_UE *UE,int subframe,int awgn_flag,dou
|
||||
|
||||
void fill_DCI(PHY_VARS_eNB *eNB,
|
||||
DCI_ALLOC_t *dci_alloc,
|
||||
int subframe,
|
||||
int subframe,
|
||||
int n_rnti,
|
||||
int n_users,
|
||||
int transmission_mode,
|
||||
@@ -278,9 +279,9 @@ void fill_DCI(PHY_VARS_eNB *eNB,
|
||||
|
||||
case 7:
|
||||
if (common_flag == 0) {
|
||||
|
||||
|
||||
if (eNB->frame_parms.frame_type == TDD) {
|
||||
|
||||
|
||||
switch (eNB->frame_parms.N_RB_DL) {
|
||||
case 6:
|
||||
dci_length = sizeof_DCI1_1_5MHz_TDD_t;
|
||||
@@ -294,7 +295,7 @@ void fill_DCI(PHY_VARS_eNB *eNB,
|
||||
((DCI1_1_5MHz_TDD_t *)&DLSCH_alloc_pdu_1[k])->ndi = ndi;
|
||||
((DCI1_1_5MHz_TDD_t *)&DLSCH_alloc_pdu_1[k])->rv = rv;
|
||||
break;
|
||||
|
||||
|
||||
case 25:
|
||||
dci_length = sizeof_DCI1_5MHz_TDD_t;
|
||||
dci_length_bytes = sizeof(DCI1_5MHz_TDD_t);
|
||||
@@ -307,7 +308,7 @@ void fill_DCI(PHY_VARS_eNB *eNB,
|
||||
((DCI1_5MHz_TDD_t *)&DLSCH_alloc_pdu_1[k])->ndi = ndi;
|
||||
((DCI1_5MHz_TDD_t *)&DLSCH_alloc_pdu_1[k])->rv = rv;
|
||||
break;
|
||||
|
||||
|
||||
case 50:
|
||||
dci_length = sizeof_DCI1_10MHz_TDD_t;
|
||||
dci_length_bytes = sizeof(DCI1_10MHz_TDD_t);
|
||||
@@ -1223,17 +1224,17 @@ DCI_PDU *get_dci_sdu(module_id_t module_idP,int CC_id,frame_t frameP,sub_frame_t
|
||||
if (subframeP == subframe) {
|
||||
DCI_pdu.Num_ue_spec_dci = num_ue_spec_dci;
|
||||
DCI_pdu.Num_common_dci = num_common_dci;
|
||||
DCI_pdu.num_pdcch_symbols = num_pdcch_symbols;
|
||||
DCI_pdu.num_pdcch_symbols = num_pdcch_symbols;
|
||||
return(&DCI_pdu);
|
||||
} else {
|
||||
DCI_pdu.Num_ue_spec_dci = 0;
|
||||
DCI_pdu.Num_common_dci = 0;
|
||||
DCI_pdu.num_pdcch_symbols = num_pdcch_symbols;
|
||||
DCI_pdu.num_pdcch_symbols = num_pdcch_symbols;
|
||||
}
|
||||
}
|
||||
|
||||
void eNB_dlsch_ulsch_scheduler(module_id_t module_idP, uint8_t cooperation_flag, frame_t frameP, sub_frame_t subframeP) {
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1459,7 +1460,7 @@ int main(int argc, char **argv)
|
||||
common_flag = 1;
|
||||
TPC = atoi(optarg);
|
||||
break;
|
||||
|
||||
|
||||
case 'E':
|
||||
threequarter_fs=1;
|
||||
break;
|
||||
@@ -1779,7 +1780,7 @@ int main(int argc, char **argv)
|
||||
form_ue = create_lte_phy_scope_ue();
|
||||
sprintf (title, "LTE PHY SCOPE eNB");
|
||||
fl_show_form (form_ue->lte_phy_scope_ue, FL_PLACE_HOTSPOT, FL_FULLBORDER, title);
|
||||
|
||||
|
||||
if (!dual_stream_UE==0) {
|
||||
UE->use_ia_receiver = 1;
|
||||
fl_set_button(form_ue->button_0,1);
|
||||
@@ -1807,9 +1808,9 @@ int main(int argc, char **argv)
|
||||
perfect_ce);
|
||||
|
||||
if ((transmission_mode==1) || (transmission_mode==7)) {
|
||||
for (aa=0; aa<eNB->frame_parms.nb_antennas_tx; aa++)
|
||||
for (re=0; re<eNB->frame_parms.ofdm_symbol_size; re++)
|
||||
eNB->common_vars.beam_weights[0][0][aa][re] = 0x00007fff/eNB->frame_parms.nb_antennas_tx;
|
||||
for (aa=0; aa<eNB->frame_parms.nb_antennas_tx; aa++)
|
||||
for (re=0; re<eNB->frame_parms.ofdm_symbol_size; re++)
|
||||
eNB->common_vars.beam_weights[0][0][aa][re] = 0x00007fff/eNB->frame_parms.nb_antennas_tx;
|
||||
}
|
||||
|
||||
if (transmission_mode<7)
|
||||
@@ -1827,11 +1828,11 @@ int main(int argc, char **argv)
|
||||
init_te_thread(eNB,NULL);
|
||||
}
|
||||
|
||||
// callback functions required for phy_procedures_tx
|
||||
// callback functions required for phy_procedures_tx
|
||||
mac_xface->get_dci_sdu = get_dci_sdu;
|
||||
mac_xface->get_dlsch_sdu = get_dlsch_sdu;
|
||||
mac_xface->eNB_dlsch_ulsch_scheduler = eNB_dlsch_ulsch_scheduler;
|
||||
|
||||
|
||||
// eNB_id_i = UE->n_connected_eNB;
|
||||
|
||||
printf("Setting mcs1 = %d\n",mcs1);
|
||||
@@ -2107,6 +2108,10 @@ int main(int argc, char **argv)
|
||||
UE->dlsch[0][i]->rnti = n_rnti;
|
||||
}
|
||||
|
||||
UE->dlsch_SI[0] = new_ue_dlsch(1,1,Nsoft,MAX_TURBO_ITERATIONS,N_RB_DL,0);
|
||||
UE->dlsch_ra[0] = new_ue_dlsch(1,1,Nsoft,MAX_TURBO_ITERATIONS,N_RB_DL,0);
|
||||
UE->ulsch[0] = new_ue_ulsch(N_RB_DL,0);
|
||||
|
||||
// structure for SIC at UE
|
||||
UE->dlsch_eNB[0] = new_eNB_dlsch(Kmimo,8,Nsoft,N_RB_DL,0,&eNB->frame_parms);
|
||||
|
||||
@@ -2335,7 +2340,7 @@ int main(int argc, char **argv)
|
||||
TB0_active = 1;
|
||||
|
||||
eNB->dlsch[0][0]->harq_processes[0]->rvidx = round&3;
|
||||
|
||||
|
||||
fill_DCI(eNB,&dci_alloc[0],subframe,n_rnti,n_users,transmission_mode,common_flag,DLSCH_RB_ALLOC,TPC,mcs1,mcs2,trials&1,round&3,&num_common_dci,&num_ue_spec_dci,&num_dci);
|
||||
}
|
||||
else {
|
||||
@@ -2343,14 +2348,14 @@ int main(int argc, char **argv)
|
||||
(TB0_active==1)?mcs1:0,mcs2,trials&1,(TB0_active==1)?round&3:0,&num_common_dci,&num_ue_spec_dci,&num_dci);
|
||||
}
|
||||
for (i=num_common_dci; i<num_dci; i++) {
|
||||
|
||||
|
||||
dci_alloc[i].firstCCE = get_nCCE_offset_l1(CCE_table,
|
||||
1<<dci_alloc[i].L,
|
||||
numCCE,
|
||||
(dci_alloc[i].rnti==SI_RNTI)? 1 : 0,
|
||||
dci_alloc[i].rnti,
|
||||
subframe);
|
||||
|
||||
|
||||
if (dci_alloc[i].firstCCE < 0) {
|
||||
printf("firstCCE <0 !! dci %d: rnti %x, format %d : nCCE %d/%d\n",i,dci_alloc[i].rnti, dci_alloc[i].format,
|
||||
dci_alloc[i].firstCCE,numCCE);
|
||||
@@ -2362,7 +2367,7 @@ int main(int argc, char **argv)
|
||||
}
|
||||
|
||||
} // common_flag == 0
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
@@ -2389,22 +2394,22 @@ int main(int argc, char **argv)
|
||||
tx_lev_dB = (unsigned int) dB_fixed(tx_lev);
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
|
||||
proc_eNB->subframe_tx = subframe;
|
||||
eNB->abstraction_flag=0;
|
||||
|
||||
|
||||
phy_procedures_eNB_TX(eNB,proc_eNB,no_relay,NULL,1);
|
||||
|
||||
|
||||
|
||||
|
||||
start_meas(&eNB->ofdm_mod_stats);
|
||||
|
||||
|
||||
/*
|
||||
do_OFDM_mod_l(eNB->common_vars.txdataF[eNB_id],
|
||||
eNB->common_vars.txdata[eNB_id],
|
||||
(subframe*2),
|
||||
&eNB->frame_parms);
|
||||
|
||||
|
||||
do_OFDM_mod_l(eNB->common_vars.txdataF[eNB_id],
|
||||
eNB->common_vars.txdata[eNB_id],
|
||||
(subframe*2)+1,
|
||||
@@ -2425,19 +2430,19 @@ int main(int argc, char **argv)
|
||||
|
||||
|
||||
stop_meas(&eNB->ofdm_mod_stats);
|
||||
|
||||
|
||||
// generate next subframe for channel estimation
|
||||
|
||||
|
||||
proc_eNB->subframe_tx = subframe+1;
|
||||
|
||||
|
||||
phy_procedures_eNB_TX(eNB,proc_eNB,no_relay,NULL,0);
|
||||
|
||||
|
||||
do_OFDM_mod_l(eNB->common_vars.txdataF[eNB_id],
|
||||
eNB->common_vars.txdata[eNB_id],
|
||||
(subframe*2)+2,
|
||||
&eNB->frame_parms);
|
||||
|
||||
|
||||
|
||||
proc_eNB->frame_tx++;
|
||||
|
||||
tx_lev = 0;
|
||||
@@ -2450,7 +2455,7 @@ int main(int argc, char **argv)
|
||||
|
||||
tx_lev_dB = (unsigned int) dB_fixed(tx_lev);
|
||||
|
||||
|
||||
|
||||
if (n_frames==1) {
|
||||
printf("tx_lev = %d (%d dB)\n",tx_lev,tx_lev_dB);
|
||||
|
||||
@@ -2466,7 +2471,7 @@ int main(int argc, char **argv)
|
||||
}
|
||||
|
||||
DL_channel(eNB,UE,subframe,awgn_flag,SNR,tx_lev,hold_channel,abstx,num_rounds,trials,round,eNB2UE,s_re,s_im,r_re,r_im,csv_fd);
|
||||
|
||||
|
||||
|
||||
UE_rxtx_proc_t *proc = &UE->proc.proc_rxtx[subframe&1];
|
||||
proc->subframe_rx = subframe;
|
||||
@@ -2479,7 +2484,7 @@ int main(int argc, char **argv)
|
||||
UE->rx_offset,
|
||||
0,
|
||||
0);
|
||||
|
||||
|
||||
if (n_frames==1) printf("Running phy_procedures_UE_RX\n");
|
||||
phy_procedures_UE_RX(UE,proc,0,0,normal_txrx,no_relay,NULL);
|
||||
|
||||
@@ -2488,7 +2493,7 @@ int main(int argc, char **argv)
|
||||
/*
|
||||
write_output("pdcchF0_ext.m","pdcchF_ext", UE->pdcch_vars[eNB_id]->rxdataF_ext[0],2*3*UE->frame_parms.ofdm_symbol_size,1,1);
|
||||
write_output("pdcch00_ch0_ext.m","pdcch00_ch0_ext",UE->pdcch_vars[eNB_id]->dl_ch_estimates_ext[0],12*UE->frame_parms.N_RB_DL*3,1,1);
|
||||
|
||||
|
||||
write_output("pdcch_rxF_comp0.m","pdcch0_rxF_comp0",UE->pdcch_vars[eNB_id]->rxdataF_comp[0],4*12*UE->frame_parms.N_RB_DL,1,1);
|
||||
write_output("pdcch_rxF_llr.m","pdcch_llr",UE->pdcch_vars[eNB_id]->llr,12*UE->frame_parms.N_RB_DL*4*2,1,4);
|
||||
write_output("txsigF0.m","txsF0", &eNB->common_vars.txdataF[eNB_id][0][subframe*nsymb*eNB->frame_parms.ofdm_symbol_size],
|
||||
@@ -2503,53 +2508,55 @@ int main(int argc, char **argv)
|
||||
|
||||
if ((test_perf ==0 ) && (n_frames==1)) {
|
||||
write_output("ch0.m","ch0",eNB2UE[0]->ch[0],eNB2UE[0]->channel_length,1,8);
|
||||
|
||||
|
||||
if (eNB->frame_parms.nb_antennas_tx>1)
|
||||
write_output("ch1.m","ch1",eNB2UE[0]->ch[eNB->frame_parms.nb_antennas_rx],eNB2UE[0]->channel_length,1,8);
|
||||
|
||||
|
||||
//common vars
|
||||
write_output("rxsig0.m","rxs0", &UE->common_vars.rxdata[0][0],10*UE->frame_parms.samples_per_tti,1,1);
|
||||
|
||||
write_output("rxsigF0.m","rxsF0", &UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF[0][0],UE->frame_parms.ofdm_symbol_size*nsymb,1,1);
|
||||
|
||||
|
||||
if (UE->frame_parms.nb_antennas_rx>1) {
|
||||
write_output("rxsig1.m","rxs1", UE->common_vars.rxdata[1],UE->frame_parms.samples_per_tti,1,1);
|
||||
write_output("rxsigF1.m","rxsF1", UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF[1],UE->frame_parms.ofdm_symbol_size*nsymb,1,1);
|
||||
}
|
||||
|
||||
|
||||
write_output("dlsch00_r0.m","dl00_r0",
|
||||
&(UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][0][0]),
|
||||
UE->frame_parms.ofdm_symbol_size*nsymb,1,1);
|
||||
|
||||
|
||||
if (UE->frame_parms.nb_antennas_rx>1)
|
||||
write_output("dlsch01_r0.m","dl01_r0",
|
||||
&(UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][1][0]),
|
||||
UE->frame_parms.ofdm_symbol_size*nsymb,1,1);
|
||||
|
||||
|
||||
if (eNB->frame_parms.nb_antennas_tx>1)
|
||||
write_output("dlsch10_r0.m","dl10_r0",
|
||||
&(UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][2][0]),
|
||||
UE->frame_parms.ofdm_symbol_size*nsymb,1,1);
|
||||
|
||||
|
||||
if ((UE->frame_parms.nb_antennas_rx>1) && (eNB->frame_parms.nb_antennas_tx>1))
|
||||
write_output("dlsch11_r0.m","dl11_r0",
|
||||
&(UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][3][0]),
|
||||
UE->frame_parms.ofdm_symbol_size*nsymb/2,1,1);
|
||||
|
||||
|
||||
//pdsch_vars
|
||||
|
||||
dump_dlsch2(UE,eNB_id,subframe,coded_bits_per_codeword,round);
|
||||
//dump_dlsch2(UE,eNB_id_i,coded_bits_per_codeword);
|
||||
|
||||
write_output("dlsch_e.m","e",eNB->dlsch[0][0]->harq_processes[0]->e,coded_bits_per_codeword,1,4);
|
||||
|
||||
|
||||
//pdcch_vars
|
||||
write_output("pdcchF0_ext.m","pdcchF_ext", UE->pdcch_vars[eNB_id]->rxdataF_ext[0],2*3*UE->frame_parms.ofdm_symbol_size,1,1);
|
||||
write_output("pdcch00_ch0_ext.m","pdcch00_ch0_ext",UE->pdcch_vars[eNB_id]->dl_ch_estimates_ext[0],300*3,1,1);
|
||||
|
||||
|
||||
write_output("pdcch_rxF_comp0.m","pdcch0_rxF_comp0",UE->pdcch_vars[eNB_id]->rxdataF_comp[0],4*300,1,1);
|
||||
write_output("pdcch_rxF_llr.m","pdcch_llr",UE->pdcch_vars[eNB_id]->llr,2400,1,4);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if (UE->dlsch_errors[0] == 0) {
|
||||
@@ -2563,7 +2570,7 @@ int main(int argc, char **argv)
|
||||
UE->total_TBS[eNB_id] = UE->total_TBS[eNB_id] + UE->dlsch[eNB_id][0]->harq_processes[UE->dlsch[eNB_id][0]->current_harq_pid]->TBS;
|
||||
TB0_active = 0;
|
||||
|
||||
|
||||
|
||||
} // DLSCH received ok
|
||||
else {
|
||||
errs[round]++;
|
||||
@@ -2594,8 +2601,9 @@ int main(int argc, char **argv)
|
||||
write_output(fname,vname, &UE->common_vars.rxdata[0][0],10*UE->frame_parms.samples_per_tti,1,1);
|
||||
sprintf(fname,"rxsigF0_r%d.m",round);
|
||||
sprintf(vname,"rxs0F_r%d",round);
|
||||
|
||||
write_output(fname,vname, &UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF[0][0],UE->frame_parms.ofdm_symbol_size*nsymb,1,1);
|
||||
|
||||
|
||||
if (UE->frame_parms.nb_antennas_rx>1) {
|
||||
sprintf(fname,"rxsig1_r%d.m",round);
|
||||
sprintf(vname,"rxs1_r%d.m",round);
|
||||
@@ -2636,8 +2644,9 @@ int main(int argc, char **argv)
|
||||
}
|
||||
|
||||
//pdsch_vars
|
||||
dump_dlsch2(UE,eNB_id,subframe,coded_bits_per_codeword,round);
|
||||
|
||||
dump_dlsch2(UE,eNB_id,subframe,coded_bits_per_codeword,round);
|
||||
|
||||
|
||||
//write_output("dlsch_e.m","e",eNB->dlsch[0][0]->harq_processes[0]->e,coded_bits_per_codeword,1,4);
|
||||
//write_output("dlsch_ber_bit.m","ber_bit",uncoded_ber_bit,coded_bits_per_codeword,1,0);
|
||||
//write_output("dlsch_w.m","w",eNB->dlsch[0][0]->harq_processes[0]->w[0],3*(tbs+64),1,4);
|
||||
@@ -2645,10 +2654,10 @@ int main(int argc, char **argv)
|
||||
//pdcch_vars
|
||||
write_output("pdcchF0_ext.m","pdcchF_ext", UE->pdcch_vars[eNB_id]->rxdataF_ext[0],2*3*UE->frame_parms.ofdm_symbol_size,1,1);
|
||||
write_output("pdcch00_ch0_ext.m","pdcch00_ch0_ext",UE->pdcch_vars[eNB_id]->dl_ch_estimates_ext[0],300*3,1,1);
|
||||
|
||||
|
||||
write_output("pdcch_rxF_comp0.m","pdcch0_rxF_comp0",UE->pdcch_vars[eNB_id]->rxdataF_comp[0],4*300,1,1);
|
||||
write_output("pdcch_rxF_llr.m","pdcch_llr",UE->pdcch_vars[eNB_id]->llr,2400,1,4);
|
||||
|
||||
write_output("pdcch_rxF_llr.m","pdcch_llr",UE->pdcch_vars[eNB_id]->llr,2400,1,4);
|
||||
|
||||
if (round == 3) exit(-1);
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -115,7 +115,7 @@ int freq_channel(channel_desc_t *desc,uint16_t nb_rb,int16_t n_samples)
|
||||
|
||||
start_meas(&desc->interp_freq);
|
||||
|
||||
for (f=-n_samples_max/2,f2=-n_samples/2; f<=n_samples_max/2; f+=d,f2++) {
|
||||
for (f=-n_samples_max/2,f2=-n_samples/2; f<n_samples_max/2; f+=d,f2++) {
|
||||
clut = cos_lut[n_samples_max/2+f];
|
||||
slut = sin_lut[n_samples_max/2+f];
|
||||
|
||||
@@ -318,3 +318,4 @@ double pbch_bler(double sinr)
|
||||
return(bler);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -169,7 +169,16 @@ typedef enum {
|
||||
Rice1,
|
||||
Rice1_corr,
|
||||
Rice1_anticorr,
|
||||
AWGN
|
||||
AWGN,
|
||||
Rayleigh1_orthogonal,
|
||||
Rayleigh1_orth_eff_ch_TM4_prec_real,
|
||||
Rayleigh1_orth_eff_ch_TM4_prec_imag,
|
||||
Rayleigh8_orth_eff_ch_TM4_prec_real,
|
||||
Rayleigh8_orth_eff_ch_TM4_prec_imag,
|
||||
TS_SHIFT,
|
||||
EPA_low,
|
||||
EPA_medium,
|
||||
EPA_high,
|
||||
} SCM_t;
|
||||
|
||||
/**
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -39,7 +39,7 @@ static unsigned int seed, iy, ir[98];
|
||||
#define a 1664525lu
|
||||
#define mod 4294967296.0 /* is 2**32 */
|
||||
|
||||
|
||||
#if 1
|
||||
void randominit(unsigned seed_init)
|
||||
{
|
||||
int i;
|
||||
@@ -61,9 +61,37 @@ void randominit(unsigned seed_init)
|
||||
ir[i]= seed; /* initialize the shuffle table */
|
||||
}
|
||||
|
||||
iy=1;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
void randominit(unsigned seed_init)
|
||||
{
|
||||
int i;
|
||||
// this need to be integrated with the existing rng, like taus: navid
|
||||
msg("Initializing random number generator, seed %x\n",seed_init);
|
||||
|
||||
seed_init = 62110;
|
||||
|
||||
if (seed_init == 0) {
|
||||
srand((unsigned)time(NULL));
|
||||
|
||||
seed = (unsigned int) rand();
|
||||
} else {
|
||||
seed = seed_init;
|
||||
}
|
||||
|
||||
if (seed % 2 == 0) seed += 1; /* seed and mod are relative prime */
|
||||
|
||||
for (i=1; i<=97; i++) {
|
||||
seed = a*seed; /* mod 2**32 */
|
||||
ir[i]= seed; /* initialize the shuffle table */
|
||||
}
|
||||
|
||||
iy=1;
|
||||
}
|
||||
|
||||
#endif
|
||||
/*!\brief Uniform linear congruential random number generator on \f$[0,1)\f$. Returns a double-precision floating-point number.*/
|
||||
|
||||
double uniformrandom(void)
|
||||
|
||||
@@ -51,7 +51,7 @@ unsigned int taus(void)
|
||||
s2 = (((s2 & 0xFFFFFFF0) << 17)^ b);
|
||||
return s0 ^ s1 ^ s2;
|
||||
}
|
||||
|
||||
#if 1
|
||||
void set_taus_seed(unsigned int seed_init)
|
||||
{
|
||||
|
||||
@@ -81,6 +81,44 @@ void set_taus_seed(unsigned int seed_init)
|
||||
#endif
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
void set_taus_seed(unsigned int seed_init)
|
||||
{
|
||||
|
||||
#ifdef USER_MODE
|
||||
struct drand48_data buffer;
|
||||
unsigned long result = 0;
|
||||
#endif
|
||||
s0 = (unsigned int)0x1e23d852;
|
||||
s1 = (unsigned int)0x81f38a1c;
|
||||
s2 = (unsigned int)0xfe1a133e;
|
||||
|
||||
return;
|
||||
|
||||
if (seed_init == 0) {
|
||||
s0 = (unsigned int)time(NULL);
|
||||
s1 = (unsigned int)time(NULL);
|
||||
s2 = (unsigned int)time(NULL);
|
||||
} else {
|
||||
#ifndef USER_MODE
|
||||
s0 = (unsigned int)0x1e23d852;
|
||||
s1 = (unsigned int)0x81f38a1c;
|
||||
s2 = (unsigned int)0xfe1a133e;
|
||||
#else
|
||||
// Use reentrant version of rand48 to ensure that no conflicts with other generators occur */
|
||||
srand48_r((long int)seed_init, &buffer);
|
||||
mrand48_r(&buffer, (long int *)&result);
|
||||
s0 = result;
|
||||
mrand48_r(&buffer, (long int *)&result);
|
||||
s1 = result;
|
||||
mrand48_r(&buffer, (long int *)&result);
|
||||
s2 = result;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef MAIN
|
||||
|
||||
|
||||
@@ -426,8 +426,8 @@ schedule_ue_spec(
|
||||
int N_RBG[MAX_NUM_CCs];
|
||||
unsigned char aggregation;
|
||||
mac_rlc_status_resp_t rlc_status;
|
||||
unsigned char header_len_dcch=0, header_len_dcch_tmp=0;
|
||||
unsigned char header_len_dtch=0, header_len_dtch_tmp=0, header_len_dtch_last=0;
|
||||
unsigned char header_len_dcch=0, header_len_dcch_tmp=0;
|
||||
unsigned char header_len_dtch=0, header_len_dtch_tmp=0, header_len_dtch_last=0;
|
||||
unsigned char ta_len=0;
|
||||
unsigned char sdu_lcids[NB_RB_MAX],lcid,offset,num_sdus=0;
|
||||
uint16_t nb_rb,nb_rb_temp,total_nb_available_rb[MAX_NUM_CCs],nb_available_rb;
|
||||
@@ -472,7 +472,7 @@ schedule_ue_spec(
|
||||
total_nb_available_rb[CC_id] = frame_parms[CC_id]->N_RB_DL;
|
||||
for (i=0;i<frame_parms[CC_id]->N_RB_DL;i++)
|
||||
if (eNB->common_channels[CC_id].vrb_map[i]!=0)
|
||||
total_nb_available_rb[CC_id]--;
|
||||
total_nb_available_rb[CC_id]--;
|
||||
|
||||
N_RBG[CC_id] = frame_parms[CC_id]->N_RBG;
|
||||
|
||||
@@ -574,7 +574,7 @@ schedule_ue_spec(
|
||||
round = ue_sched_ctl->round[CC_id];
|
||||
UE_list->eNB_UE_stats[CC_id][UE_id].crnti= rnti;
|
||||
UE_list->eNB_UE_stats[CC_id][UE_id].rrc_status=mac_eNB_get_rrc_status(module_idP,rnti);
|
||||
UE_list->eNB_UE_stats[CC_id][UE_id].harq_pid = harq_pid;
|
||||
UE_list->eNB_UE_stats[CC_id][UE_id].harq_pid = harq_pid;
|
||||
UE_list->eNB_UE_stats[CC_id][UE_id].harq_round = round;
|
||||
|
||||
sdu_length_total=0;
|
||||
@@ -599,7 +599,7 @@ schedule_ue_spec(
|
||||
LOG_D(MAC,"[eNB %d] Frame %d: Scheduling UE %d on CC_id %d (rnti %x, harq_pid %d, round %d, rb %d, cqi %d, mcs %d, rrc %d)\n",
|
||||
module_idP, frameP, UE_id,CC_id,rnti,harq_pid, round,nb_available_rb,
|
||||
eNB_UE_stats->DL_cqi[0], eNB_UE_stats->dlsch_mcs1,
|
||||
UE_list->eNB_UE_stats[CC_id][UE_id].rrc_status);
|
||||
UE_list->eNB_UE_stats[CC_id][UE_id].rrc_status);
|
||||
|
||||
|
||||
// Note this code is for a specific DCI format
|
||||
@@ -743,8 +743,8 @@ schedule_ue_spec(
|
||||
}
|
||||
|
||||
break;
|
||||
/*
|
||||
// this code is disabled for now - needs to be done properly
|
||||
/*
|
||||
// this code is disabled for now - needs to be done properly
|
||||
case 4:
|
||||
// if (nb_rb>10) {
|
||||
((DCI2_5MHz_2A_TDD_t*)DLSCH_dci)->ndi1 = 0;
|
||||
@@ -782,7 +782,7 @@ schedule_ue_spec(
|
||||
((DCI1E_5MHz_2A_M10PRB_TDD_t*)DLSCH_dci)->dai = (UE_list->UE_template[CC_id][UE_id].DAI-1)&3;
|
||||
((DCI1E_5MHz_2A_M10PRB_TDD_t*)DLSCH_dci)->dl_power_off = 1;//dl_pow_off[UE_id];
|
||||
break;
|
||||
*/
|
||||
*/
|
||||
}
|
||||
|
||||
add_ue_dlsch_info(module_idP,
|
||||
@@ -819,7 +819,7 @@ schedule_ue_spec(
|
||||
rlc_status = mac_rlc_status_ind(
|
||||
module_idP,
|
||||
rnti,
|
||||
module_idP,
|
||||
module_idP,
|
||||
frameP,
|
||||
ENB_FLAG_YES,
|
||||
MBMS_FLAG_NO,
|
||||
@@ -832,14 +832,14 @@ schedule_ue_spec(
|
||||
LOG_D(MAC,"[eNB %d] Frame %d, DL-DCCH->DLSCH CC_id %d, Requesting %d bytes from RLC (RRC message)\n",
|
||||
module_idP,frameP,CC_id,TBS-header_len_dcch);
|
||||
sdu_lengths[0] = mac_rlc_data_req(
|
||||
module_idP,
|
||||
rnti,
|
||||
module_idP,
|
||||
frameP,
|
||||
ENB_FLAG_YES,
|
||||
MBMS_FLAG_NO,
|
||||
DCCH,
|
||||
(char *)&dlsch_buffer[0]);
|
||||
module_idP,
|
||||
rnti,
|
||||
module_idP,
|
||||
frameP,
|
||||
ENB_FLAG_YES,
|
||||
MBMS_FLAG_NO,
|
||||
DCCH,
|
||||
(char *)&dlsch_buffer[0]);
|
||||
|
||||
T(T_ENB_MAC_UE_DL_SDU, T_INT(module_idP), T_INT(CC_id), T_INT(rnti), T_INT(frameP), T_INT(subframeP),
|
||||
T_INT(harq_pid), T_INT(DCCH), T_INT(sdu_lengths[0]));
|
||||
@@ -864,20 +864,20 @@ schedule_ue_spec(
|
||||
sdu_length_total = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// check for DCCH1 and update header information (assume 2 byte sub-header)
|
||||
if (TBS-ta_len-header_len_dcch-sdu_length_total > 0 ) {
|
||||
rlc_status = mac_rlc_status_ind(
|
||||
module_idP,
|
||||
rnti,
|
||||
module_idP,
|
||||
module_idP,
|
||||
frameP,
|
||||
ENB_FLAG_YES,
|
||||
MBMS_FLAG_NO,
|
||||
DCCH+1,
|
||||
(TBS-ta_len-header_len_dcch-sdu_length_total)); // transport block set size less allocations for timing advance and
|
||||
// DCCH SDU
|
||||
sdu_lengths[num_sdus] = 0;
|
||||
sdu_lengths[num_sdus] = 0;
|
||||
|
||||
if (rlc_status.bytes_in_buffer > 0) {
|
||||
LOG_I(MAC,"[eNB %d], Frame %d, DCCH1->DLSCH, CC_id %d, Requesting %d bytes from RLC (RRC message)\n",
|
||||
@@ -885,7 +885,7 @@ schedule_ue_spec(
|
||||
sdu_lengths[num_sdus] += mac_rlc_data_req(
|
||||
module_idP,
|
||||
rnti,
|
||||
module_idP,
|
||||
module_idP,
|
||||
frameP,
|
||||
ENB_FLAG_YES,
|
||||
MBMS_FLAG_NO,
|
||||
@@ -900,7 +900,7 @@ schedule_ue_spec(
|
||||
header_len_dcch += 2;
|
||||
UE_list->eNB_UE_stats[CC_id][UE_id].num_pdu_tx[DCCH1]+=1;
|
||||
UE_list->eNB_UE_stats[CC_id][UE_id].num_bytes_tx[DCCH1]+=sdu_lengths[num_sdus];
|
||||
num_sdus++;
|
||||
num_sdus++;
|
||||
#ifdef DEBUG_eNB_SCHEDULER
|
||||
LOG_T(MAC,"[eNB %d][DCCH1] CC_id %d Got %d bytes :",module_idP,CC_id,sdu_lengths[num_sdus]);
|
||||
|
||||
@@ -911,85 +911,85 @@ schedule_ue_spec(
|
||||
LOG_T(MAC,"\n");
|
||||
#endif
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// assume the max dtch header size, and adjust it later
|
||||
header_len_dtch=0;
|
||||
header_len_dtch_last=0; // the header length of the last mac sdu
|
||||
// lcid has to be sorted before the actual allocation (similar struct as ue_list).
|
||||
for (lcid=NB_RB_MAX-1; lcid>=DTCH ; lcid--){
|
||||
// TBD: check if the lcid is active
|
||||
|
||||
header_len_dtch+=3;
|
||||
header_len_dtch_last=3;
|
||||
LOG_D(MAC,"[eNB %d], Frame %d, DTCH%d->DLSCH, Checking RLC status (tbs %d, len %d)\n",
|
||||
module_idP,frameP,lcid,TBS,
|
||||
TBS-ta_len-header_len_dcch-sdu_length_total-header_len_dtch);
|
||||
|
||||
if (TBS-ta_len-header_len_dcch-sdu_length_total-header_len_dtch > 0 ) { // NN: > 2 ?
|
||||
rlc_status = mac_rlc_status_ind(module_idP,
|
||||
rnti,
|
||||
module_idP,
|
||||
frameP,
|
||||
ENB_FLAG_YES,
|
||||
MBMS_FLAG_NO,
|
||||
lcid,
|
||||
TBS-ta_len-header_len_dcch-sdu_length_total-header_len_dtch);
|
||||
|
||||
// assume the max dtch header size, and adjust it later
|
||||
header_len_dtch=0;
|
||||
header_len_dtch_last=0; // the header length of the last mac sdu
|
||||
// lcid has to be sorted before the actual allocation (similar struct as ue_list).
|
||||
for (lcid=NB_RB_MAX-1; lcid>=DTCH ; lcid--){
|
||||
// TBD: check if the lcid is active
|
||||
|
||||
if (rlc_status.bytes_in_buffer > 0) {
|
||||
|
||||
LOG_D(MAC,"[eNB %d][USER-PLANE DEFAULT DRB] Frame %d : DTCH->DLSCH, Requesting %d bytes from RLC (lcid %d total hdr len %d)\n",
|
||||
module_idP,frameP,TBS-header_len_dcch-sdu_length_total-header_len_dtch,lcid, header_len_dtch);
|
||||
sdu_lengths[num_sdus] = mac_rlc_data_req(module_idP,
|
||||
rnti,
|
||||
module_idP,
|
||||
frameP,
|
||||
ENB_FLAG_YES,
|
||||
MBMS_FLAG_NO,
|
||||
lcid,
|
||||
(char*)&dlsch_buffer[sdu_length_total]);
|
||||
T(T_ENB_MAC_UE_DL_SDU, T_INT(module_idP), T_INT(CC_id), T_INT(rnti), T_INT(frameP), T_INT(subframeP),
|
||||
header_len_dtch+=3;
|
||||
header_len_dtch_last=3;
|
||||
LOG_D(MAC,"[eNB %d], Frame %d, DTCH%d->DLSCH, Checking RLC status (tbs %d, len %d)\n",
|
||||
module_idP,frameP,lcid,TBS,
|
||||
TBS-ta_len-header_len_dcch-sdu_length_total-header_len_dtch);
|
||||
|
||||
if (TBS-ta_len-header_len_dcch-sdu_length_total-header_len_dtch > 0 ) { // NN: > 2 ?
|
||||
rlc_status = mac_rlc_status_ind(module_idP,
|
||||
rnti,
|
||||
module_idP,
|
||||
frameP,
|
||||
ENB_FLAG_YES,
|
||||
MBMS_FLAG_NO,
|
||||
lcid,
|
||||
TBS-ta_len-header_len_dcch-sdu_length_total-header_len_dtch);
|
||||
|
||||
|
||||
if (rlc_status.bytes_in_buffer > 0) {
|
||||
|
||||
LOG_D(MAC,"[eNB %d][USER-PLANE DEFAULT DRB] Frame %d : DTCH->DLSCH, Requesting %d bytes from RLC (lcid %d total hdr len %d)\n",
|
||||
module_idP,frameP,TBS-header_len_dcch-sdu_length_total-header_len_dtch,lcid, header_len_dtch);
|
||||
sdu_lengths[num_sdus] = mac_rlc_data_req(module_idP,
|
||||
rnti,
|
||||
module_idP,
|
||||
frameP,
|
||||
ENB_FLAG_YES,
|
||||
MBMS_FLAG_NO,
|
||||
lcid,
|
||||
(char*)&dlsch_buffer[sdu_length_total]);
|
||||
T(T_ENB_MAC_UE_DL_SDU, T_INT(module_idP), T_INT(CC_id), T_INT(rnti), T_INT(frameP), T_INT(subframeP),
|
||||
T_INT(harq_pid), T_INT(lcid), T_INT(sdu_lengths[num_sdus]));
|
||||
|
||||
LOG_D(MAC,"[eNB %d][USER-PLANE DEFAULT DRB] Got %d bytes for DTCH %d \n",module_idP,sdu_lengths[num_sdus],lcid);
|
||||
sdu_lcids[num_sdus] = lcid;
|
||||
sdu_length_total += sdu_lengths[num_sdus];
|
||||
UE_list->eNB_UE_stats[CC_id][UE_id].num_pdu_tx[lcid]+=1;
|
||||
UE_list->eNB_UE_stats[CC_id][UE_id].num_bytes_tx[lcid]+=sdu_lengths[num_sdus];
|
||||
if (sdu_lengths[num_sdus] < 128) {
|
||||
header_len_dtch--;
|
||||
header_len_dtch_last--;
|
||||
}
|
||||
num_sdus++;
|
||||
} // no data for this LCID
|
||||
else {
|
||||
header_len_dtch-=3;
|
||||
}
|
||||
} // no TBS left
|
||||
else {
|
||||
header_len_dtch-=3;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (header_len_dtch == 0 )
|
||||
header_len_dtch_last= 0;
|
||||
// there is at least one SDU
|
||||
// if (num_sdus > 0 ){
|
||||
if ((sdu_length_total + header_len_dcch + header_len_dtch )> 0) {
|
||||
|
||||
// Now compute number of required RBs for total sdu length
|
||||
// Assume RAH format 2
|
||||
// adjust header lengths
|
||||
header_len_dcch_tmp = header_len_dcch;
|
||||
header_len_dtch_tmp = header_len_dtch;
|
||||
if (header_len_dtch==0) {
|
||||
header_len_dcch = (header_len_dcch >0) ? 1 : 0;//header_len_dcch; // remove length field
|
||||
} else {
|
||||
header_len_dtch_last-=1; // now use it to find how many bytes has to be removed for the last MAC SDU
|
||||
header_len_dtch = (header_len_dtch > 0) ? header_len_dtch - header_len_dtch_last :header_len_dtch; // remove length field for the last SDU
|
||||
}
|
||||
LOG_D(MAC,"[eNB %d][USER-PLANE DEFAULT DRB] Got %d bytes for DTCH %d \n",module_idP,sdu_lengths[num_sdus],lcid);
|
||||
sdu_lcids[num_sdus] = lcid;
|
||||
sdu_length_total += sdu_lengths[num_sdus];
|
||||
UE_list->eNB_UE_stats[CC_id][UE_id].num_pdu_tx[lcid]+=1;
|
||||
UE_list->eNB_UE_stats[CC_id][UE_id].num_bytes_tx[lcid]+=sdu_lengths[num_sdus];
|
||||
if (sdu_lengths[num_sdus] < 128) {
|
||||
header_len_dtch--;
|
||||
header_len_dtch_last--;
|
||||
}
|
||||
num_sdus++;
|
||||
} // no data for this LCID
|
||||
else {
|
||||
header_len_dtch-=3;
|
||||
}
|
||||
} // no TBS left
|
||||
else {
|
||||
header_len_dtch-=3;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (header_len_dtch == 0 )
|
||||
header_len_dtch_last= 0;
|
||||
// there is at least one SDU
|
||||
// if (num_sdus > 0 ){
|
||||
if ((sdu_length_total + header_len_dcch + header_len_dtch )> 0) {
|
||||
|
||||
// Now compute number of required RBs for total sdu length
|
||||
// Assume RAH format 2
|
||||
// adjust header lengths
|
||||
header_len_dcch_tmp = header_len_dcch;
|
||||
header_len_dtch_tmp = header_len_dtch;
|
||||
if (header_len_dtch==0) {
|
||||
header_len_dcch = (header_len_dcch >0) ? 1 : 0;//header_len_dcch; // remove length field
|
||||
} else {
|
||||
header_len_dtch_last-=1; // now use it to find how many bytes has to be removed for the last MAC SDU
|
||||
header_len_dtch = (header_len_dtch > 0) ? header_len_dtch - header_len_dtch_last :header_len_dtch; // remove length field for the last SDU
|
||||
}
|
||||
|
||||
mcs = eNB_UE_stats->dlsch_mcs1;
|
||||
|
||||
@@ -1103,7 +1103,7 @@ schedule_ue_spec(
|
||||
"[eNB %d][DLSCH] Frame %d Generate header for UE_id %d on CC_id %d: sdu_length_total %d, num_sdus %d, sdu_lengths[0] %d, sdu_lcids[0] %d => payload offset %d,timing advance value : %d, padding %d,post_padding %d,(mcs %d, TBS %d, nb_rb %d),header_dcch %d, header_dtch %d\n",
|
||||
module_idP,frameP, UE_id, CC_id, sdu_length_total,num_sdus,sdu_lengths[0],sdu_lcids[0],offset,
|
||||
ue_sched_ctl->ta_update,padding,post_padding,mcs,TBS,nb_rb,header_len_dcch,header_len_dtch);
|
||||
}
|
||||
}
|
||||
//#endif
|
||||
#ifdef DEBUG_eNB_SCHEDULER
|
||||
LOG_T(MAC,"[eNB %d] First 16 bytes of DLSCH : \n");
|
||||
@@ -1164,44 +1164,44 @@ schedule_ue_spec(
|
||||
update_ul_dci(module_idP,CC_id,rnti,UE_list->UE_template[CC_id][UE_id].DAI);
|
||||
}
|
||||
|
||||
// do PUCCH power control
|
||||
// do PUCCH power control
|
||||
// this is the normalized RX power
|
||||
eNB_UE_stats = mac_xface->get_eNB_UE_stats(module_idP,CC_id,rnti);
|
||||
normalized_rx_power = eNB_UE_stats->Po_PUCCH_dBm;
|
||||
target_rx_power = mac_xface->get_target_pucch_rx_power(module_idP,CC_id) + 20;
|
||||
|
||||
eNB_UE_stats = mac_xface->get_eNB_UE_stats(module_idP,CC_id,rnti);
|
||||
normalized_rx_power = eNB_UE_stats->Po_PUCCH_dBm;
|
||||
target_rx_power = mac_xface->get_target_pucch_rx_power(module_idP,CC_id) + 20;
|
||||
|
||||
// this assumes accumulated tpc
|
||||
// make sure that we are only sending a tpc update once a frame, otherwise the control loop will freak out
|
||||
int32_t framex10psubframe = UE_list->UE_template[CC_id][UE_id].pucch_tpc_tx_frame*10+UE_list->UE_template[CC_id][UE_id].pucch_tpc_tx_subframe;
|
||||
// make sure that we are only sending a tpc update once a frame, otherwise the control loop will freak out
|
||||
int32_t framex10psubframe = UE_list->UE_template[CC_id][UE_id].pucch_tpc_tx_frame*10+UE_list->UE_template[CC_id][UE_id].pucch_tpc_tx_subframe;
|
||||
if (((framex10psubframe+10)<=(frameP*10+subframeP)) || //normal case
|
||||
((framex10psubframe>(frameP*10+subframeP)) && (((10240-framex10psubframe+frameP*10+subframeP)>=10)))) //frame wrap-around
|
||||
if (eNB_UE_stats->Po_PUCCH_update == 1) {
|
||||
eNB_UE_stats->Po_PUCCH_update = 0;
|
||||
((framex10psubframe>(frameP*10+subframeP)) && (((10240-framex10psubframe+frameP*10+subframeP)>=10)))) //frame wrap-around
|
||||
if (eNB_UE_stats->Po_PUCCH_update == 1) {
|
||||
eNB_UE_stats->Po_PUCCH_update = 0;
|
||||
|
||||
UE_list->UE_template[CC_id][UE_id].pucch_tpc_tx_frame=frameP;
|
||||
UE_list->UE_template[CC_id][UE_id].pucch_tpc_tx_subframe=subframeP;
|
||||
|
||||
if (normalized_rx_power>(target_rx_power+1)) {
|
||||
tpc = 0; //-1
|
||||
tpc_accumulated--;
|
||||
} else if (normalized_rx_power<(target_rx_power-1)) {
|
||||
tpc = 2; //+1
|
||||
tpc_accumulated++;
|
||||
} else {
|
||||
tpc = 1; //0
|
||||
}
|
||||
/*
|
||||
LOG_I(MAC,"[eNB %d] DLSCH scheduler: frame %d, subframe %d, harq_pid %d, tpc %d, accumulated %d, normalized/target rx power %d/%d\n",
|
||||
module_idP,frameP, subframeP,harq_pid,tpc,
|
||||
tpc_accumulated,normalized_rx_power,target_rx_power);*/
|
||||
UE_list->UE_template[CC_id][UE_id].pucch_tpc_tx_frame=frameP;
|
||||
UE_list->UE_template[CC_id][UE_id].pucch_tpc_tx_subframe=subframeP;
|
||||
|
||||
} // Po_PUCCH has been updated
|
||||
else {
|
||||
tpc = 1; //0
|
||||
} // time to do TPC update
|
||||
else {
|
||||
tpc = 1; //0
|
||||
}
|
||||
if (normalized_rx_power>(target_rx_power+1)) {
|
||||
tpc = 0; //-1
|
||||
tpc_accumulated--;
|
||||
} else if (normalized_rx_power<(target_rx_power-1)) {
|
||||
tpc = 2; //+1
|
||||
tpc_accumulated++;
|
||||
} else {
|
||||
tpc = 1; //0
|
||||
}
|
||||
/*
|
||||
LOG_I(MAC,"[eNB %d] DLSCH scheduler: frame %d, subframe %d, harq_pid %d, tpc %d, accumulated %d, normalized/target rx power %d/%d\n",
|
||||
module_idP,frameP, subframeP,harq_pid,tpc,
|
||||
tpc_accumulated,normalized_rx_power,target_rx_power);*/
|
||||
|
||||
} // Po_PUCCH has been updated
|
||||
else {
|
||||
tpc = 1; //0
|
||||
} // time to do TPC update
|
||||
else {
|
||||
tpc = 1; //0
|
||||
}
|
||||
|
||||
switch (mac_xface->get_transmission_mode(module_idP,CC_id,rnti)) {
|
||||
case 1:
|
||||
@@ -1324,7 +1324,7 @@ schedule_ue_spec(
|
||||
((DCI2A_5MHz_2A_TDD_t*)DLSCH_dci)->ndi1 = 1-UE_list->UE_template[CC_id][UE_id].oldNDI[harq_pid];
|
||||
((DCI2A_5MHz_2A_TDD_t*)DLSCH_dci)->rv1 = 0;
|
||||
((DCI2A_5MHz_2A_TDD_t*)DLSCH_dci)->dai = (UE_list->UE_template[CC_id][UE_id].DAI-1)&3;
|
||||
((DCI2A_5MHz_2A_TDD_t*)DLSCH_dci)->TPC = tpc;
|
||||
((DCI2A_5MHz_2A_TDD_t*)DLSCH_dci)->TPC = tpc;
|
||||
|
||||
// deactivate TB2
|
||||
((DCI2A_5MHz_2A_TDD_t*)DLSCH_dci)->mcs2 = 0;
|
||||
@@ -1339,7 +1339,7 @@ schedule_ue_spec(
|
||||
((DCI2A_10MHz_2A_TDD_t*)DLSCH_dci)->ndi1 = 1-UE_list->UE_template[CC_id][UE_id].oldNDI[harq_pid];
|
||||
((DCI2A_10MHz_2A_TDD_t*)DLSCH_dci)->rv1 = 0;
|
||||
((DCI2A_10MHz_2A_TDD_t*)DLSCH_dci)->dai = (UE_list->UE_template[CC_id][UE_id].DAI-1)&3;
|
||||
((DCI2A_10MHz_2A_TDD_t*)DLSCH_dci)->TPC = tpc;
|
||||
((DCI2A_10MHz_2A_TDD_t*)DLSCH_dci)->TPC = tpc;
|
||||
|
||||
// deactivate TB2
|
||||
((DCI2A_10MHz_2A_TDD_t*)DLSCH_dci)->mcs2 = 0;
|
||||
@@ -1352,7 +1352,7 @@ schedule_ue_spec(
|
||||
((DCI2A_20MHz_2A_TDD_t*)DLSCH_dci)->ndi1 = 1-UE_list->UE_template[CC_id][UE_id].oldNDI[harq_pid];
|
||||
((DCI2A_20MHz_2A_TDD_t*)DLSCH_dci)->rv1 = 0;
|
||||
((DCI2A_20MHz_2A_TDD_t*)DLSCH_dci)->dai = (UE_list->UE_template[CC_id][UE_id].DAI-1)&3;
|
||||
((DCI2A_20MHz_2A_TDD_t*)DLSCH_dci)->TPC = tpc;
|
||||
((DCI2A_20MHz_2A_TDD_t*)DLSCH_dci)->TPC = tpc;
|
||||
|
||||
// deactivate TB2
|
||||
((DCI2A_20MHz_2A_TDD_t*)DLSCH_dci)->mcs2 = 0;
|
||||
@@ -1365,7 +1365,7 @@ schedule_ue_spec(
|
||||
((DCI2A_5MHz_2A_TDD_t*)DLSCH_dci)->ndi1 = 1-UE_list->UE_template[CC_id][UE_id].oldNDI[harq_pid];
|
||||
((DCI2A_5MHz_2A_TDD_t*)DLSCH_dci)->rv1 = 0;
|
||||
((DCI2A_5MHz_2A_TDD_t*)DLSCH_dci)->dai = (UE_list->UE_template[CC_id][UE_id].DAI-1)&3;
|
||||
((DCI2A_5MHz_2A_TDD_t*)DLSCH_dci)->TPC = tpc;
|
||||
((DCI2A_5MHz_2A_TDD_t*)DLSCH_dci)->TPC = tpc;
|
||||
|
||||
// deactivate TB2
|
||||
((DCI2A_5MHz_2A_TDD_t*)DLSCH_dci)->mcs2 = 0;
|
||||
@@ -1379,7 +1379,7 @@ schedule_ue_spec(
|
||||
((DCI2A_1_5MHz_2A_FDD_t*)DLSCH_dci)->harq_pid = harq_pid;
|
||||
((DCI2A_1_5MHz_2A_FDD_t*)DLSCH_dci)->ndi1 = 1-UE_list->UE_template[CC_id][UE_id].oldNDI[harq_pid];
|
||||
((DCI2A_1_5MHz_2A_FDD_t*)DLSCH_dci)->rv1 = 0;
|
||||
((DCI2A_1_5MHz_2A_FDD_t*)DLSCH_dci)->TPC = tpc;
|
||||
((DCI2A_1_5MHz_2A_FDD_t*)DLSCH_dci)->TPC = tpc;
|
||||
|
||||
// deactivate TB2
|
||||
((DCI2A_1_5MHz_2A_FDD_t*)DLSCH_dci)->mcs2 = 0;
|
||||
@@ -1391,7 +1391,7 @@ schedule_ue_spec(
|
||||
((DCI2A_5MHz_2A_FDD_t*)DLSCH_dci)->harq_pid = harq_pid;
|
||||
((DCI2A_5MHz_2A_FDD_t*)DLSCH_dci)->ndi1 = 1-UE_list->UE_template[CC_id][UE_id].oldNDI[harq_pid];
|
||||
((DCI2A_5MHz_2A_FDD_t*)DLSCH_dci)->rv1 = 0;
|
||||
((DCI2A_5MHz_2A_FDD_t*)DLSCH_dci)->TPC = tpc;
|
||||
((DCI2A_5MHz_2A_FDD_t*)DLSCH_dci)->TPC = tpc;
|
||||
|
||||
// deactivate TB2
|
||||
((DCI2A_5MHz_2A_FDD_t*)DLSCH_dci)->mcs2 = 0;
|
||||
@@ -1403,7 +1403,7 @@ schedule_ue_spec(
|
||||
((DCI2A_10MHz_2A_FDD_t*)DLSCH_dci)->harq_pid = harq_pid;
|
||||
((DCI2A_10MHz_2A_FDD_t*)DLSCH_dci)->ndi1 = 1-UE_list->UE_template[CC_id][UE_id].oldNDI[harq_pid];
|
||||
((DCI2A_10MHz_2A_FDD_t*)DLSCH_dci)->rv1 = 0;
|
||||
((DCI2A_10MHz_2A_FDD_t*)DLSCH_dci)->TPC = tpc;
|
||||
((DCI2A_10MHz_2A_FDD_t*)DLSCH_dci)->TPC = tpc;
|
||||
// deactivate TB2
|
||||
((DCI2A_10MHz_2A_FDD_t*)DLSCH_dci)->mcs2 = 0;
|
||||
((DCI2A_10MHz_2A_FDD_t*)DLSCH_dci)->rv2 = 1;
|
||||
@@ -1414,7 +1414,7 @@ schedule_ue_spec(
|
||||
((DCI2A_20MHz_2A_FDD_t*)DLSCH_dci)->harq_pid = harq_pid;
|
||||
((DCI2A_20MHz_2A_FDD_t*)DLSCH_dci)->ndi1 = 1-UE_list->UE_template[CC_id][UE_id].oldNDI[harq_pid];
|
||||
((DCI2A_20MHz_2A_FDD_t*)DLSCH_dci)->rv1 = 0;
|
||||
((DCI2A_20MHz_2A_FDD_t*)DLSCH_dci)->TPC = tpc;
|
||||
((DCI2A_20MHz_2A_FDD_t*)DLSCH_dci)->TPC = tpc;
|
||||
|
||||
// deactivate TB2
|
||||
((DCI2A_20MHz_2A_FDD_t*)DLSCH_dci)->mcs2 = 0;
|
||||
@@ -1426,7 +1426,7 @@ schedule_ue_spec(
|
||||
((DCI2A_5MHz_2A_FDD_t*)DLSCH_dci)->harq_pid = harq_pid;
|
||||
((DCI2A_5MHz_2A_FDD_t*)DLSCH_dci)->ndi1 = 1-UE_list->UE_template[CC_id][UE_id].oldNDI[harq_pid];
|
||||
((DCI2A_5MHz_2A_FDD_t*)DLSCH_dci)->rv1 = 0;
|
||||
((DCI2A_5MHz_2A_FDD_t*)DLSCH_dci)->TPC = tpc;
|
||||
((DCI2A_5MHz_2A_FDD_t*)DLSCH_dci)->TPC = tpc;
|
||||
|
||||
// deactivate TB2
|
||||
((DCI2A_5MHz_2A_FDD_t*)DLSCH_dci)->mcs2 = 0;
|
||||
@@ -1437,18 +1437,159 @@ schedule_ue_spec(
|
||||
|
||||
break;
|
||||
|
||||
/*
|
||||
// disabled for now as this needs to be done properly
|
||||
/*
|
||||
// disabled for now as this needs to be done properly
|
||||
case 4:
|
||||
((DCI2_5MHz_2A_TDD_t*)DLSCH_dci)->mcs1 = mcs;
|
||||
((DCI2_5MHz_2A_TDD_t*)DLSCH_dci)->harq_pid = harq_pid;
|
||||
((DCI2_5MHz_2A_TDD_t*)DLSCH_dci)->ndi1 = 1;
|
||||
((DCI2_5MHz_2A_TDD_t*)DLSCH_dci)->rv1 = round&3;
|
||||
((DCI2_5MHz_2A_TDD_t*)DLSCH_dci)->dai = (UE_list->UE_template[CC_id][UE_id].DAI-1)&3;
|
||||
((DCI2_5MHz_2A_TDD_t*)DLSCH_dci)->TPC = tpc;
|
||||
if (frame_parms[CC_id]->frame_type == TDD) {
|
||||
switch (frame_parms[CC_id]->N_RB_DL) {
|
||||
case 6:
|
||||
// fall back to alamouti for now
|
||||
((DCI2_1_5MHz_2A_TDD_t*)DLSCH_dci)->tpmi = 0;
|
||||
((DCI2_1_5MHz_2A_TDD_t*)DLSCH_dci)->mcs1 = mcs;
|
||||
((DCI2_1_5MHz_2A_TDD_t*)DLSCH_dci)->harq_pid = harq_pid;
|
||||
((DCI2_1_5MHz_2A_TDD_t*)DLSCH_dci)->ndi1 = 1-UE_list->UE_template[CC_id][UE_id].oldNDI[harq_pid];
|
||||
((DCI2_1_5MHz_2A_TDD_t*)DLSCH_dci)->rv1 = 0;
|
||||
|
||||
// deactivate TB2
|
||||
((DCI2A_1_5MHz_2A_TDD_t*)DLSCH_dci)->mcs2 = 0;
|
||||
((DCI2A_1_5MHz_2A_TDD_t*)DLSCH_dci)->rv2 = 1;
|
||||
|
||||
((DCI2A_1_5MHz_2A_TDD_t*)DLSCH_dci)->dai = (UE_list->UE_template[CC_id][UE_id].DAI-1)&3;
|
||||
((DCI2A_1_5MHz_2A_TDD_t*)DLSCH_dci)->TPC = tpc;
|
||||
break;
|
||||
|
||||
case 25:
|
||||
((DCI2_5MHz_2A_TDD_t*)DLSCH_dci)->tpmi = 0;
|
||||
((DCI2_5MHz_2A_TDD_t*)DLSCH_dci)->mcs1 = mcs;
|
||||
((DCI2_5MHz_2A_TDD_t*)DLSCH_dci)->harq_pid = harq_pid;
|
||||
((DCI2_5MHz_2A_TDD_t*)DLSCH_dci)->ndi1 = 1-UE_list->UE_template[CC_id][UE_id].oldNDI[harq_pid];
|
||||
((DCI2_5MHz_2A_TDD_t*)DLSCH_dci)->rv1 = 0;
|
||||
((DCI2_5MHz_2A_TDD_t*)DLSCH_dci)->dai = (UE_list->UE_template[CC_id][UE_id].DAI-1)&3;
|
||||
((DCI2_5MHz_2A_TDD_t*)DLSCH_dci)->TPC = tpc;
|
||||
|
||||
// deactivate TB2
|
||||
((DCI2_5MHz_2A_TDD_t*)DLSCH_dci)->mcs2 = 0;
|
||||
((DCI2_5MHz_2A_TDD_t*)DLSCH_dci)->rv2 = 1;
|
||||
|
||||
LOG_D(MAC,"Format2 DCI: harq_pid %d, ndi %d\n",harq_pid,((DCI2_5MHz_2A_TDD_t*)DLSCH_dci)->ndi1);
|
||||
break;
|
||||
|
||||
case 50:
|
||||
((DCI2_10MHz_2A_TDD_t*)DLSCH_dci)->tpmi = 0;
|
||||
((DCI2_10MHz_2A_TDD_t*)DLSCH_dci)->mcs1 = mcs;
|
||||
((DCI2_10MHz_2A_TDD_t*)DLSCH_dci)->harq_pid = harq_pid;
|
||||
((DCI2_10MHz_2A_TDD_t*)DLSCH_dci)->ndi1 = 1-UE_list->UE_template[CC_id][UE_id].oldNDI[harq_pid];
|
||||
((DCI2_10MHz_2A_TDD_t*)DLSCH_dci)->rv1 = 0;
|
||||
((DCI2_10MHz_2A_TDD_t*)DLSCH_dci)->dai = (UE_list->UE_template[CC_id][UE_id].DAI-1)&3;
|
||||
((DCI2_10MHz_2A_TDD_t*)DLSCH_dci)->TPC = tpc;
|
||||
|
||||
// deactivate TB2
|
||||
((DCI2_10MHz_2A_TDD_t*)DLSCH_dci)->mcs2 = 0;
|
||||
((DCI2_10MHz_2A_TDD_t*)DLSCH_dci)->rv2 = 1;
|
||||
break;
|
||||
|
||||
case 100:
|
||||
((DCI2_20MHz_2A_TDD_t*)DLSCH_dci)->tpmi = 0;
|
||||
((DCI2_20MHz_2A_TDD_t*)DLSCH_dci)->mcs1 = mcs;
|
||||
((DCI2_20MHz_2A_TDD_t*)DLSCH_dci)->harq_pid = harq_pid;
|
||||
((DCI2_20MHz_2A_TDD_t*)DLSCH_dci)->ndi1 = 1-UE_list->UE_template[CC_id][UE_id].oldNDI[harq_pid];
|
||||
((DCI2_20MHz_2A_TDD_t*)DLSCH_dci)->rv1 = 0;
|
||||
((DCI2_20MHz_2A_TDD_t*)DLSCH_dci)->dai = (UE_list->UE_template[CC_id][UE_id].DAI-1)&3;
|
||||
((DCI2_20MHz_2A_TDD_t*)DLSCH_dci)->TPC = tpc;
|
||||
|
||||
// deactivate TB2
|
||||
((DCI2_20MHz_2A_TDD_t*)DLSCH_dci)->mcs2 = 0;
|
||||
((DCI2_20MHz_2A_TDD_t*)DLSCH_dci)->rv2 = 1;
|
||||
break;
|
||||
|
||||
default:
|
||||
((DCI2_5MHz_2A_TDD_t*)DLSCH_dci)->tpmi = 0;
|
||||
((DCI2_5MHz_2A_TDD_t*)DLSCH_dci)->mcs1 = mcs;
|
||||
((DCI2_5MHz_2A_TDD_t*)DLSCH_dci)->harq_pid = harq_pid;
|
||||
((DCI2_5MHz_2A_TDD_t*)DLSCH_dci)->ndi1 = 1-UE_list->UE_template[CC_id][UE_id].oldNDI[harq_pid];
|
||||
((DCI2_5MHz_2A_TDD_t*)DLSCH_dci)->rv1 = 0;
|
||||
((DCI2_5MHz_2A_TDD_t*)DLSCH_dci)->dai = (UE_list->UE_template[CC_id][UE_id].DAI-1)&3;
|
||||
((DCI2_5MHz_2A_TDD_t*)DLSCH_dci)->TPC = tpc;
|
||||
|
||||
|
||||
// deactivate TB2
|
||||
((DCI2_5MHz_2A_TDD_t*)DLSCH_dci)->mcs2 = 0;
|
||||
((DCI2_5MHz_2A_TDD_t*)DLSCH_dci)->rv2 = 1;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
switch (frame_parms[CC_id]->N_RB_DL) {
|
||||
case 6:
|
||||
((DCI2_1_5MHz_2A_FDD_t*)DLSCH_dci)->tpmi = 0;
|
||||
((DCI2_1_5MHz_2A_FDD_t*)DLSCH_dci)->mcs1 = mcs;
|
||||
((DCI2_1_5MHz_2A_FDD_t*)DLSCH_dci)->harq_pid = harq_pid;
|
||||
((DCI2_1_5MHz_2A_FDD_t*)DLSCH_dci)->ndi1 = 1-UE_list->UE_template[CC_id][UE_id].oldNDI[harq_pid];
|
||||
((DCI2_1_5MHz_2A_FDD_t*)DLSCH_dci)->rv1 = 0;
|
||||
((DCI2_1_5MHz_2A_FDD_t*)DLSCH_dci)->TPC = tpc;
|
||||
|
||||
// deactivate TB2
|
||||
((DCI2_1_5MHz_2A_FDD_t*)DLSCH_dci)->mcs2 = 0;
|
||||
((DCI2_1_5MHz_2A_FDD_t*)DLSCH_dci)->rv2 = 1;
|
||||
break;
|
||||
|
||||
case 25:
|
||||
((DCI2_5MHz_2A_FDD_t*)DLSCH_dci)->tpmi = 0;
|
||||
((DCI2_5MHz_2A_FDD_t*)DLSCH_dci)->mcs1 = mcs;
|
||||
((DCI2_5MHz_2A_FDD_t*)DLSCH_dci)->harq_pid = harq_pid;
|
||||
((DCI2_5MHz_2A_FDD_t*)DLSCH_dci)->ndi1 = 1-UE_list->UE_template[CC_id][UE_id].oldNDI[harq_pid];
|
||||
((DCI2_5MHz_2A_FDD_t*)DLSCH_dci)->rv1 = 0;
|
||||
((DCI2_5MHz_2A_FDD_t*)DLSCH_dci)->TPC = tpc;
|
||||
|
||||
// deactivate TB2
|
||||
((DCI2_5MHz_2A_FDD_t*)DLSCH_dci)->mcs2 = 0;
|
||||
((DCI2_5MHz_2A_FDD_t*)DLSCH_dci)->rv2 = 1;
|
||||
|
||||
LOG_I(MAC,"Format2 DCI: harq_pid %d, ndi %d\n",harq_pid,((DCI2_5MHz_2A_FDD_t*)DLSCH_dci)->ndi1);
|
||||
break;
|
||||
|
||||
case 50:
|
||||
((DCI2_10MHz_2A_FDD_t*)DLSCH_dci)->tpmi = 0;
|
||||
((DCI2_10MHz_2A_FDD_t*)DLSCH_dci)->mcs1 = mcs;
|
||||
((DCI2_10MHz_2A_FDD_t*)DLSCH_dci)->harq_pid = harq_pid;
|
||||
((DCI2_10MHz_2A_FDD_t*)DLSCH_dci)->ndi1 = 1-UE_list->UE_template[CC_id][UE_id].oldNDI[harq_pid];
|
||||
((DCI2_10MHz_2A_FDD_t*)DLSCH_dci)->rv1 = 0;
|
||||
((DCI2_10MHz_2A_FDD_t*)DLSCH_dci)->TPC = tpc;
|
||||
// deactivate TB2
|
||||
((DCI2_10MHz_2A_FDD_t*)DLSCH_dci)->mcs2 = 0;
|
||||
((DCI2_10MHz_2A_FDD_t*)DLSCH_dci)->rv2 = 1;
|
||||
break;
|
||||
|
||||
case 100:
|
||||
((DCI2_20MHz_2A_FDD_t*)DLSCH_dci)->tpmi = 0;
|
||||
((DCI2_20MHz_2A_FDD_t*)DLSCH_dci)->mcs1 = mcs;
|
||||
((DCI2_20MHz_2A_FDD_t*)DLSCH_dci)->harq_pid = harq_pid;
|
||||
((DCI2_20MHz_2A_FDD_t*)DLSCH_dci)->ndi1 = 1-UE_list->UE_template[CC_id][UE_id].oldNDI[harq_pid];
|
||||
((DCI2_20MHz_2A_FDD_t*)DLSCH_dci)->rv1 = 0;
|
||||
((DCI2_20MHz_2A_FDD_t*)DLSCH_dci)->TPC = tpc;
|
||||
|
||||
// deactivate TB2
|
||||
((DCI2_20MHz_2A_FDD_t*)DLSCH_dci)->mcs2 = 0;
|
||||
((DCI2_20MHz_2A_FDD_t*)DLSCH_dci)->rv2 = 1;
|
||||
break;
|
||||
|
||||
default:
|
||||
((DCI2_5MHz_2A_FDD_t*)DLSCH_dci)->tpmi = 0;
|
||||
((DCI2_5MHz_2A_FDD_t*)DLSCH_dci)->mcs1 = mcs;
|
||||
((DCI2_5MHz_2A_FDD_t*)DLSCH_dci)->harq_pid = harq_pid;
|
||||
((DCI2_5MHz_2A_FDD_t*)DLSCH_dci)->ndi1 = 1-UE_list->UE_template[CC_id][UE_id].oldNDI[harq_pid];
|
||||
((DCI2_5MHz_2A_FDD_t*)DLSCH_dci)->rv1 = 0;
|
||||
((DCI2_5MHz_2A_FDD_t*)DLSCH_dci)->TPC = tpc;
|
||||
|
||||
// deactivate TB2
|
||||
((DCI2_5MHz_2A_FDD_t*)DLSCH_dci)->mcs2 = 0;
|
||||
((DCI2_5MHz_2A_FDD_t*)DLSCH_dci)->rv2 = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
/*
|
||||
// disabled for now as this needs to be done properly
|
||||
case 5:
|
||||
|
||||
((DCI1E_5MHz_2A_M10PRB_TDD_t*)DLSCH_dci)->mcs = mcs;
|
||||
@@ -1456,7 +1597,7 @@ schedule_ue_spec(
|
||||
((DCI1E_5MHz_2A_M10PRB_TDD_t*)DLSCH_dci)->ndi = 1;
|
||||
((DCI1E_5MHz_2A_M10PRB_TDD_t*)DLSCH_dci)->rv = round&3;
|
||||
((DCI1E_5MHz_2A_M10PRB_TDD_t*)DLSCH_dci)->dai = (UE_list->UE_template[CC_id][UE_id].DAI-1)&3;
|
||||
((DCI1E_5MHz_2A_M10PRB_TDD_t*)DLSCH_dci)->TPC = tpc;
|
||||
((DCI1E_5MHz_2A_M10PRB_TDD_t*)DLSCH_dci)->TPC = tpc;
|
||||
|
||||
if(ue_sched_ctl->dl_pow_off[CC_id] == 2) {
|
||||
ue_sched_ctl->dl_pow_off[CC_id] = 1;
|
||||
@@ -1474,10 +1615,10 @@ schedule_ue_spec(
|
||||
((DCI1E_5MHz_2A_M10PRB_TDD_t*)DLSCH_dci)->dai = (UE_list->UE_template[CC_id][UE_id].DAI-1)&3;
|
||||
((DCI1E_5MHz_2A_M10PRB_TDD_t*)DLSCH_dci)->dl_power_off = 1;
|
||||
((DCI1E_5MHz_2A_M10PRB_TDD_t*)DLSCH_dci)->tpmi = 5;
|
||||
((DCI1E_5MHz_2A_M10PRB_TDD_t*)DLSCH_dci)->TPC = tpc;
|
||||
((DCI1E_5MHz_2A_M10PRB_TDD_t*)DLSCH_dci)->TPC = tpc;
|
||||
|
||||
break;
|
||||
*/
|
||||
*/
|
||||
}
|
||||
|
||||
// Toggle NDI for next time
|
||||
@@ -1506,11 +1647,11 @@ schedule_ue_spec(
|
||||
//------------------------------------------------------------------------------
|
||||
void
|
||||
fill_DLSCH_dci(
|
||||
module_id_t module_idP,
|
||||
frame_t frameP,
|
||||
sub_frame_t subframeP,
|
||||
int* mbsfn_flagP
|
||||
)
|
||||
module_id_t module_idP,
|
||||
frame_t frameP,
|
||||
sub_frame_t subframeP,
|
||||
int* mbsfn_flagP
|
||||
)
|
||||
//------------------------------------------------------------------------------
|
||||
{
|
||||
|
||||
@@ -1545,7 +1686,7 @@ fill_DLSCH_dci(
|
||||
continue;
|
||||
|
||||
DCI_pdu = &eNB->common_channels[CC_id].DCI_pdu;
|
||||
|
||||
|
||||
|
||||
// UE specific DCIs
|
||||
for (UE_id=UE_list->head; UE_id>=0; UE_id=UE_list->next[UE_id]) {
|
||||
@@ -1556,8 +1697,8 @@ fill_DLSCH_dci(
|
||||
// clear scheduling flag
|
||||
eNB_dlsch_info[module_idP][CC_id][UE_id].status = S_DL_WAITING;
|
||||
rnti = UE_RNTI(module_idP,UE_id);
|
||||
// mac_xface->get_ue_active_harq_pid(module_idP,CC_id,rnti,frameP,subframeP,&harq_pid,&round,0);
|
||||
harq_pid = UE_list->UE_sched_ctrl[UE_id].harq_pid[CC_id];
|
||||
// mac_xface->get_ue_active_harq_pid(module_idP,CC_id,rnti,frameP,subframeP,&harq_pid,&round,0);
|
||||
harq_pid = UE_list->UE_sched_ctrl[UE_id].harq_pid[CC_id];
|
||||
nb_rb = UE_list->UE_template[CC_id][UE_id].nb_rb[harq_pid];
|
||||
|
||||
DLSCH_dci = (void *)UE_list->UE_template[CC_id][UE_id].DLSCH_DCI[harq_pid];
|
||||
@@ -1764,7 +1905,7 @@ fill_DLSCH_dci(
|
||||
|
||||
break;
|
||||
|
||||
/*
|
||||
/*
|
||||
case 4:
|
||||
|
||||
// DCI format 2_2A
|
||||
@@ -1807,7 +1948,7 @@ fill_DLSCH_dci(
|
||||
format1E_2A_M10PRB,
|
||||
0);
|
||||
break;
|
||||
*/
|
||||
*/
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -99,7 +99,7 @@ int errno;
|
||||
# endif
|
||||
#endif
|
||||
|
||||
//#define XER_PRINT
|
||||
#define XER_PRINT
|
||||
|
||||
extern Enb_properties_array_t enb_properties;
|
||||
typedef struct xer_sprint_string_s {
|
||||
@@ -1505,7 +1505,10 @@ do_RRCConnectionSetup(
|
||||
// PDSCH
|
||||
//assign_enum(&physicalConfigDedicated2->pdsch_ConfigDedicated->p_a,
|
||||
// PDSCH_ConfigDedicated__p_a_dB0);
|
||||
physicalConfigDedicated2->pdsch_ConfigDedicated->p_a= PDSCH_ConfigDedicated__p_a_dB0;
|
||||
if (frame_parms->nb_antenna_ports_eNB==2)
|
||||
physicalConfigDedicated2->pdsch_ConfigDedicated->p_a= PDSCH_ConfigDedicated__p_a_dB_3;
|
||||
else
|
||||
physicalConfigDedicated2->pdsch_ConfigDedicated->p_a= PDSCH_ConfigDedicated__p_a_dB0;
|
||||
|
||||
// PUCCH
|
||||
physicalConfigDedicated2->pucch_ConfigDedicated->ackNackRepetition.present=PUCCH_ConfigDedicated__ackNackRepetition_PR_release;
|
||||
|
||||
@@ -124,6 +124,7 @@ int logInit (void)
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
#if ! defined(CN_BUILD)
|
||||
g_log->log_component[PHY].name = "PHY";
|
||||
g_log->log_component[PHY].level = LOG_EMERG;
|
||||
|
||||
@@ -0,0 +1,169 @@
|
||||
Active_eNBs = ( "eNB_Eurecom_LTEBox");
|
||||
# Asn1_verbosity, choice in: none, info, annoying
|
||||
Asn1_verbosity = "none";
|
||||
|
||||
eNBs =
|
||||
(
|
||||
{
|
||||
////////// Identification parameters:
|
||||
eNB_ID = 0xe00;
|
||||
|
||||
cell_type = "CELL_MACRO_ENB";
|
||||
|
||||
eNB_name = "eNB_Eurecom_LTEBox";
|
||||
|
||||
// Tracking area code, 0x0000 and 0xfffe are reserved values
|
||||
tracking_area_code = "1";
|
||||
|
||||
mobile_country_code = "208";
|
||||
|
||||
mobile_network_code = "93";
|
||||
|
||||
////////// Physical parameters:
|
||||
|
||||
component_carriers = (
|
||||
{
|
||||
frame_type = "TDD";
|
||||
tdd_config = 3;
|
||||
tdd_config_s = 0;
|
||||
prefix_type = "NORMAL";
|
||||
eutra_band = 38;
|
||||
downlink_frequency = 2580000000L;
|
||||
uplink_frequency_offset = 0; //-120000000;
|
||||
Nid_cell = 0;
|
||||
N_RB_DL = 25;
|
||||
Nid_cell_mbsfn = 0;
|
||||
nb_antennas_tx = 2;
|
||||
nb_antennas_rx = 2;
|
||||
tx_gain = 10; //25;
|
||||
rx_gain = 10; //20;
|
||||
prach_root = 0;
|
||||
prach_config_index = 0;
|
||||
prach_high_speed = "DISABLE";
|
||||
prach_zero_correlation = 1;
|
||||
prach_freq_offset = 2;
|
||||
pucch_delta_shift = 1;
|
||||
pucch_nRB_CQI = 1;
|
||||
pucch_nCS_AN = 0;
|
||||
pucch_n1_AN = 32;
|
||||
pdsch_referenceSignalPower = -26;
|
||||
pdsch_p_b = 0;
|
||||
pusch_n_SB = 1;
|
||||
pusch_enable64QAM = "DISABLE";
|
||||
pusch_hoppingMode = "interSubFrame";
|
||||
pusch_hoppingOffset = 0;
|
||||
pusch_groupHoppingEnabled = "ENABLE";
|
||||
pusch_groupAssignment = 0;
|
||||
pusch_sequenceHoppingEnabled = "DISABLE";
|
||||
pusch_nDMRS1 = 0;
|
||||
phich_duration = "NORMAL";
|
||||
phich_resource = "ONESIXTH";
|
||||
srs_enable = "DISABLE";
|
||||
/* srs_BandwidthConfig =;
|
||||
srs_SubframeConfig =;
|
||||
srs_ackNackST =;
|
||||
srs_MaxUpPts =;*/
|
||||
|
||||
pusch_p0_Nominal = -85;
|
||||
pusch_alpha = "AL1";
|
||||
pucch_p0_Nominal = -108;
|
||||
msg3_delta_Preamble = 6;
|
||||
pucch_deltaF_Format1 = "deltaF2";
|
||||
pucch_deltaF_Format1b = "deltaF3";
|
||||
pucch_deltaF_Format2 = "deltaF0";
|
||||
pucch_deltaF_Format2a = "deltaF0";
|
||||
pucch_deltaF_Format2b = "deltaF0";
|
||||
|
||||
rach_numberOfRA_Preambles = 64;
|
||||
rach_preamblesGroupAConfig = "DISABLE";
|
||||
/*
|
||||
rach_sizeOfRA_PreamblesGroupA = ;
|
||||
rach_messageSizeGroupA = ;
|
||||
rach_messagePowerOffsetGroupB = ;
|
||||
*/
|
||||
rach_powerRampingStep = 2;
|
||||
rach_preambleInitialReceivedTargetPower = -100;
|
||||
rach_preambleTransMax = 10;
|
||||
rach_raResponseWindowSize = 10;
|
||||
rach_macContentionResolutionTimer = 48;
|
||||
rach_maxHARQ_Msg3Tx = 4;
|
||||
|
||||
pcch_default_PagingCycle = 128;
|
||||
pcch_nB = "oneT";
|
||||
bcch_modificationPeriodCoeff = 2;
|
||||
ue_TimersAndConstants_t300 = 1000;
|
||||
ue_TimersAndConstants_t301 = 1000;
|
||||
ue_TimersAndConstants_t310 = 1000;
|
||||
ue_TimersAndConstants_t311 = 10000;
|
||||
ue_TimersAndConstants_n310 = 20;
|
||||
ue_TimersAndConstants_n311 = 1;
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
srb1_parameters :
|
||||
{
|
||||
# timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500]
|
||||
timer_poll_retransmit = 80;
|
||||
|
||||
# timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200]
|
||||
timer_reordering = 35;
|
||||
|
||||
# timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500]
|
||||
timer_status_prohibit = 0;
|
||||
|
||||
# poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)]
|
||||
poll_pdu = 4;
|
||||
|
||||
# poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)]
|
||||
poll_byte = 99999;
|
||||
|
||||
# max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32]
|
||||
max_retx_threshold = 4;
|
||||
}
|
||||
|
||||
# ------- SCTP definitions
|
||||
SCTP :
|
||||
{
|
||||
# Number of streams to use in input/output
|
||||
SCTP_INSTREAMS = 2;
|
||||
SCTP_OUTSTREAMS = 2;
|
||||
};
|
||||
|
||||
////////// MME parameters:
|
||||
mme_ip_address = ( { ipv4 = "192.168.12.70";
|
||||
ipv6 = "192:168:30::17";
|
||||
active = "yes";
|
||||
preference = "ipv4";
|
||||
}
|
||||
);
|
||||
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
ENB_INTERFACE_NAME_FOR_S1_MME = "eth0";
|
||||
ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.212/24";
|
||||
|
||||
ENB_INTERFACE_NAME_FOR_S1U = "eth0";
|
||||
ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.212/24";
|
||||
ENB_PORT_FOR_S1U = 2152; # Spec 2152
|
||||
};
|
||||
|
||||
log_config :
|
||||
{
|
||||
global_log_level ="info";
|
||||
global_log_verbosity ="medium";
|
||||
hw_log_level ="debug";
|
||||
hw_log_verbosity ="medium";
|
||||
phy_log_level ="info";
|
||||
phy_log_verbosity ="medium";
|
||||
mac_log_level ="info";
|
||||
mac_log_verbosity ="high";
|
||||
rlc_log_level ="info";
|
||||
rlc_log_verbosity ="medium";
|
||||
pdcp_log_level ="info";
|
||||
pdcp_log_verbosity ="medium";
|
||||
rrc_log_level ="debug";
|
||||
rrc_log_verbosity ="medium";
|
||||
};
|
||||
}
|
||||
);
|
||||
@@ -68,9 +68,9 @@ eNBs =
|
||||
srs_ackNackST =;
|
||||
srs_MaxUpPts =;*/
|
||||
|
||||
pusch_p0_Nominal = -90;
|
||||
pusch_p0_Nominal = -100;
|
||||
pusch_alpha = "AL1";
|
||||
pucch_p0_Nominal = -96;
|
||||
pucch_p0_Nominal = -106;
|
||||
msg3_delta_Preamble = 6;
|
||||
pucch_deltaF_Format1 = "deltaF2";
|
||||
pucch_deltaF_Format1b = "deltaF3";
|
||||
@@ -148,9 +148,9 @@ eNBs =
|
||||
{
|
||||
|
||||
ENB_INTERFACE_NAME_FOR_S1_MME = "eth1";
|
||||
ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.147/24";
|
||||
ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.212/24";
|
||||
ENB_INTERFACE_NAME_FOR_S1U = "eth1";
|
||||
ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.147/24";
|
||||
ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.212/24";
|
||||
ENB_PORT_FOR_S1U = 2152; # Spec 2152
|
||||
};
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ eNBs =
|
||||
tdd_config_s = 0;
|
||||
prefix_type = "NORMAL";
|
||||
eutra_band = 7;
|
||||
downlink_frequency = 2680000000L;
|
||||
downlink_frequency = 2660000000L;
|
||||
uplink_frequency_offset = -120000000;
|
||||
Nid_cell = 0;
|
||||
N_RB_DL = 25;
|
||||
@@ -51,7 +51,7 @@ eNBs =
|
||||
pucch_nCS_AN = 0;
|
||||
pucch_n1_AN = 32;
|
||||
pdsch_referenceSignalPower = -24;
|
||||
pdsch_p_b = 0;
|
||||
pdsch_p_b = 1;
|
||||
pusch_n_SB = 1;
|
||||
pusch_enable64QAM = "DISABLE";
|
||||
pusch_hoppingMode = "interSubFrame";
|
||||
@@ -68,9 +68,9 @@ eNBs =
|
||||
srs_ackNackST =;
|
||||
srs_MaxUpPts =;*/
|
||||
|
||||
pusch_p0_Nominal = -90;
|
||||
pusch_p0_Nominal = -100;
|
||||
pusch_alpha = "AL1";
|
||||
pucch_p0_Nominal = -96;
|
||||
pucch_p0_Nominal = -106;
|
||||
msg3_delta_Preamble = 6;
|
||||
pucch_deltaF_Format1 = "deltaF2";
|
||||
pucch_deltaF_Format1b = "deltaF3";
|
||||
@@ -138,7 +138,7 @@ eNBs =
|
||||
};
|
||||
|
||||
////////// MME parameters:
|
||||
mme_ip_address = ( { ipv4 = "192.168.12.171";
|
||||
mme_ip_address = ( { ipv4 = "192.168.12.70";
|
||||
ipv6 = "192:168:30::17";
|
||||
active = "yes";
|
||||
preference = "ipv4";
|
||||
@@ -148,10 +148,10 @@ eNBs =
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
ENB_INTERFACE_NAME_FOR_S1_MME = "eth0";
|
||||
ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.150/24";
|
||||
ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.212/24";
|
||||
|
||||
ENB_INTERFACE_NAME_FOR_S1U = "eth0";
|
||||
ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.150/24";
|
||||
ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.212/24";
|
||||
ENB_PORT_FOR_S1U = 2152; # Spec 2152
|
||||
};
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
/*! \file oaisim_functions.c
|
||||
* \brief function primitives of oaisim
|
||||
* \author Navid Nikaein
|
||||
* \author Navid Nikaein
|
||||
* \date 2013-2015
|
||||
* \version 1.0
|
||||
* \company Eurecom
|
||||
@@ -729,8 +729,9 @@ void get_simulation_options(int argc, char *argv[])
|
||||
/*
|
||||
oai_emulation.info.transmission_mode[0] = atoi (optarg);
|
||||
|
||||
if ((oai_emulation.info.transmission_mode[0] != 1) && (oai_emulation.info.transmission_mode[0] != 2) && (oai_emulation.info.transmission_mode[0] != 3)
|
||||
&& (oai_emulation.info.transmission_mode[0] != 5) && (oai_emulation.info.transmission_mode[0] != 6) && (oai_emulation.info.transmission_mode[0] !=7)) {
|
||||
if ((oai_emulation.info.transmission_mode[0] != 1) && (oai_emulation.info.transmission_mode[0] != 2) &&
|
||||
(oai_emulation.info.transmission_mode[0] != 3) && (oai_emulation.info.transmission_mode[0] != 4) &&
|
||||
(oai_emulation.info.transmission_mode[0] != 5) && (oai_emulation.info.transmission_mode[0] != 6)) && (oai_emulation.info.transmission_mode[0] !=7)) {
|
||||
printf("Unsupported transmission mode %d\n",oai_emulation.info.transmission_mode[0]);
|
||||
exit(-1);
|
||||
}
|
||||
@@ -1061,13 +1062,13 @@ int eNB_trx_read(openair0_device *device, openair0_timestamp *ptimestamp, void *
|
||||
// tell top-level we are busy
|
||||
pthread_mutex_lock(&subframe_mutex);
|
||||
subframe_eNB_mask|=(1<<eNB_id);
|
||||
pthread_mutex_unlock(&subframe_mutex);
|
||||
|
||||
pthread_mutex_unlock(&subframe_mutex);
|
||||
|
||||
subframe = (last_eNB_rx_timestamp[eNB_id][CC_id]/PHY_vars_eNB_g[eNB_id][CC_id]->frame_parms.samples_per_tti)%10;
|
||||
LOG_D(EMU,"eNB_trx_read generating UL subframe %d (Ts %llu, current TS %llu)\n",
|
||||
subframe,(unsigned long long)*ptimestamp,
|
||||
(unsigned long long)current_eNB_rx_timestamp[eNB_id][CC_id]);
|
||||
|
||||
|
||||
do_UL_sig(UE2eNB,
|
||||
enb_data,
|
||||
ue_data,
|
||||
@@ -1077,11 +1078,11 @@ int eNB_trx_read(openair0_device *device, openair0_timestamp *ptimestamp, void *
|
||||
0, // frame is only used for abstraction
|
||||
eNB_id,
|
||||
CC_id);
|
||||
|
||||
|
||||
last_eNB_rx_timestamp[eNB_id][CC_id] += PHY_vars_eNB_g[eNB_id][CC_id]->frame_parms.samples_per_tti;
|
||||
sample_count += PHY_vars_eNB_g[eNB_id][CC_id]->frame_parms.samples_per_tti;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
return(nsamps);
|
||||
@@ -1108,7 +1109,7 @@ int UE_trx_read(openair0_device *device, openair0_timestamp *ptimestamp, void **
|
||||
read_size = PHY_vars_UE_g[UE_id][CC_id]->frame_parms.samples_per_tti;
|
||||
|
||||
while (sample_count<nsamps) {
|
||||
while (current_UE_rx_timestamp[UE_id][CC_id] <
|
||||
while (current_UE_rx_timestamp[UE_id][CC_id] <
|
||||
(last_UE_rx_timestamp[UE_id][CC_id]+read_size)) {
|
||||
//LOG_D(EMU,"UE_trx_read : current TS %d, last TS %d, sleeping\n",current_UE_rx_timestamp[UE_id][CC_id],last_UE_rx_timestamp[UE_id][CC_id]);
|
||||
|
||||
@@ -1130,13 +1131,13 @@ int UE_trx_read(openair0_device *device, openair0_timestamp *ptimestamp, void **
|
||||
|
||||
last_UE_rx_timestamp[UE_id][CC_id] += read_size;
|
||||
sample_count += read_size;
|
||||
|
||||
if (subframe > 9)
|
||||
|
||||
if (subframe > 9)
|
||||
return(nsamps);
|
||||
|
||||
LOG_D(PHY,"UE_trx_read generating DL subframe %d (Ts %llu, current TS %llu)\n",
|
||||
subframe,(unsigned long long)*ptimestamp,
|
||||
(unsigned long long)current_UE_rx_timestamp[UE_id][CC_id]);
|
||||
(unsigned long long)current_UE_rx_timestamp[UE_id][CC_id]);
|
||||
do_DL_sig(eNB2UE,
|
||||
enb_data,
|
||||
ue_data,
|
||||
@@ -1288,9 +1289,9 @@ void init_openair1(void)
|
||||
|
||||
// change the nb_connected_eNB
|
||||
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
|
||||
init_lte_vars (&frame_parms[CC_id],
|
||||
oai_emulation.info.frame_type[CC_id],
|
||||
oai_emulation.info.tdd_config[CC_id],
|
||||
init_lte_vars (&frame_parms[CC_id],
|
||||
oai_emulation.info.frame_type[CC_id],
|
||||
oai_emulation.info.tdd_config[CC_id],
|
||||
oai_emulation.info.tdd_config_S[CC_id],
|
||||
oai_emulation.info.extended_prefix_flag[CC_id],
|
||||
oai_emulation.info.N_RB_DL[CC_id],
|
||||
@@ -1396,9 +1397,9 @@ void init_openair1(void)
|
||||
// init_ue_status();
|
||||
for (UE_id=0; UE_id<NB_UE_INST; UE_id++) {
|
||||
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
|
||||
|
||||
|
||||
PHY_vars_UE_g[UE_id][CC_id]->tx_power_max_dBm=10;
|
||||
|
||||
|
||||
PHY_vars_UE_g[UE_id][CC_id]->rx_total_gain_dB=100;
|
||||
|
||||
// update UE_mode for each eNB_id not just 0
|
||||
@@ -1485,7 +1486,7 @@ void init_ocm(void)
|
||||
get_beta_map_up();
|
||||
#endif
|
||||
get_MIESM_param();
|
||||
|
||||
|
||||
//load_pbch_desc();
|
||||
}
|
||||
|
||||
@@ -1526,7 +1527,7 @@ void init_ocm(void)
|
||||
map_str_to_int(small_scale_names,oai_emulation.environment_system_config.fading.small_scale.selected_option), eNB_id, UE_id);
|
||||
|
||||
|
||||
eNB2UE[eNB_id][UE_id][CC_id] =
|
||||
eNB2UE[eNB_id][UE_id][CC_id] =
|
||||
new_channel_desc_scm(PHY_vars_eNB_g[eNB_id][CC_id]->frame_parms.nb_antennas_tx,
|
||||
PHY_vars_UE_g[UE_id][CC_id]->frame_parms.nb_antennas_rx,
|
||||
map_str_to_int(small_scale_names,oai_emulation.environment_system_config.fading.small_scale.selected_option),
|
||||
@@ -1539,7 +1540,7 @@ void init_ocm(void)
|
||||
LOG_D(OCM,"[SIM] Initializing channel (%s, %d) from UE %d to eNB %d\n", oai_emulation.environment_system_config.fading.small_scale.selected_option,
|
||||
map_str_to_int(small_scale_names, oai_emulation.environment_system_config.fading.small_scale.selected_option),UE_id, eNB_id);
|
||||
|
||||
UE2eNB[UE_id][eNB_id][CC_id] =
|
||||
UE2eNB[UE_id][eNB_id][CC_id] =
|
||||
new_channel_desc_scm(PHY_vars_UE_g[UE_id][CC_id]->frame_parms.nb_antennas_tx,
|
||||
PHY_vars_eNB_g[eNB_id][CC_id]->frame_parms.nb_antennas_rx,
|
||||
map_str_to_int(small_scale_names, oai_emulation.environment_system_config.fading.small_scale.selected_option),
|
||||
@@ -1664,7 +1665,7 @@ void update_ocm()
|
||||
//pathloss: -132.24 dBm/15kHz RE + target SNR - eNB TX power per RE
|
||||
if (eNB_id == (UE_id % NB_eNB_INST)) {
|
||||
eNB2UE[eNB_id][UE_id][CC_id]->path_loss_dB = -132.24 + snr_dB - PHY_vars_eNB_g[eNB_id][CC_id]->frame_parms.pdsch_config_common.referenceSignalPower;
|
||||
UE2eNB[UE_id][eNB_id][CC_id]->path_loss_dB = -132.24 + snr_dB - PHY_vars_eNB_g[eNB_id][CC_id]->frame_parms.pdsch_config_common.referenceSignalPower;
|
||||
UE2eNB[UE_id][eNB_id][CC_id]->path_loss_dB = -132.24 + snr_dB - PHY_vars_eNB_g[eNB_id][CC_id]->frame_parms.pdsch_config_common.referenceSignalPower;
|
||||
} else {
|
||||
eNB2UE[eNB_id][UE_id][CC_id]->path_loss_dB = -132.24 + sinr_dB - PHY_vars_eNB_g[eNB_id][CC_id]->frame_parms.pdsch_config_common.referenceSignalPower;
|
||||
UE2eNB[UE_id][eNB_id][CC_id]->path_loss_dB = -132.24 + sinr_dB - PHY_vars_eNB_g[eNB_id][CC_id]->frame_parms.pdsch_config_common.referenceSignalPower;
|
||||
@@ -1673,7 +1674,7 @@ void update_ocm()
|
||||
LOG_D(OCM,"Path loss from eNB %d to UE %d (CCid %d)=> %f dB (eNB TX %d, SNR %f)\n",eNB_id,UE_id,CC_id,
|
||||
eNB2UE[eNB_id][UE_id][CC_id]->path_loss_dB,
|
||||
PHY_vars_eNB_g[eNB_id][CC_id]->frame_parms.pdsch_config_common.referenceSignalPower,snr_dB);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1698,9 +1699,9 @@ void update_otg_eNB(module_id_t enb_module_idP, unsigned int ctime)
|
||||
|
||||
// generate traffic if the ue is rrc reconfigured state
|
||||
//if ((rrc_state=mac_eNB_get_rrc_status(enb_module_idP, dst_id)) > 2 /*RRC_CONNECTED*/ ) {
|
||||
if (mac_eNB_get_rrc_status(enb_module_idP, oai_emulation.info.eNB_ue_module_id_to_rnti[enb_module_idP][dst_id]) > 2 ){
|
||||
if (mac_eNB_get_rrc_status(enb_module_idP, oai_emulation.info.eNB_ue_module_id_to_rnti[enb_module_idP][dst_id]) > 2 ){
|
||||
if_times += 1;
|
||||
|
||||
|
||||
for (app_id=0; app_id<MAX_NUM_APPLICATION; app_id++) {
|
||||
otg_pkt = malloc (sizeof(Packet_otg_elt_t));
|
||||
|
||||
@@ -1842,16 +1843,16 @@ void update_otg_UE(module_id_t ue_mod_idP, unsigned int ctime)
|
||||
if (mac_UE_get_rrc_status(ue_mod_idP, dst_id ) > 2 /*RRC_CONNECTED*/) {
|
||||
for (app_id=0; app_id<MAX_NUM_APPLICATION; app_id++) {
|
||||
Packet_otg_elt_t *otg_pkt = malloc (sizeof(Packet_otg_elt_t));
|
||||
|
||||
|
||||
if (otg_pkt!=NULL)
|
||||
memset(otg_pkt,0,sizeof(Packet_otg_elt_t));
|
||||
else {
|
||||
LOG_E(OTG,"not enough memory\n");
|
||||
exit(-1);
|
||||
}// Manage to add this packet to the tail of your list
|
||||
|
||||
|
||||
(otg_pkt->otg_pkt).sdu_buffer = (uint8_t*) packet_gen(src_id, dst_id, app_id, ctime, &((otg_pkt->otg_pkt).sdu_buffer_size));
|
||||
|
||||
|
||||
if ((otg_pkt->otg_pkt).sdu_buffer != NULL) {
|
||||
(otg_pkt->otg_pkt).rb_id = DTCH-2;
|
||||
(otg_pkt->otg_pkt).module_id = module_id;
|
||||
|
||||
Reference in New Issue
Block a user