Merge remote-tracking branch 'oai/develop' into oai-integration
Conflicts: openair1/SCHED/phy_procedures_lte_eNb.c openair2/LAYER2/MAC/eNB_scheduler.c
This commit is contained in:
@@ -7,6 +7,7 @@ job1:
|
||||
- echo $NFS_SHARE_DIR
|
||||
- echo $EXTERNAL_SHARE_DIR
|
||||
- echo $SHELL
|
||||
- echo $OAI_TEST_CASE_GROUP
|
||||
- git rev-parse --abbrev-ref HEAD
|
||||
- git_repo=`git config --get remote.origin.url`
|
||||
- git_head=`git rev-parse HEAD`
|
||||
|
||||
@@ -171,13 +171,13 @@ set(CMAKE_CXX_FLAGS
|
||||
|
||||
|
||||
#########################
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-rpath -Wl,${OPENAIR_TARGETS}/bin")
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-rpath -Wl,${CMAKE_CURRENT_BINARY_DIR}")
|
||||
#########################
|
||||
# set a flag for changes in the source code
|
||||
# these changes are related to hardcoded path to include .h files
|
||||
add_definitions(-DCMAKER)
|
||||
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS} -g -DMALLOC_CHECK_=3")
|
||||
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS} -g -DMALLOC_CHECK_=3 -O2")
|
||||
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS} -g -DMALLOC_CHECK_=3 -O3")
|
||||
|
||||
|
||||
set(GIT_BRANCH "UNKNOWN")
|
||||
@@ -261,6 +261,7 @@ endif (${ENABLE_ITTI})
|
||||
add_boolean_option(RTAI False "Use RTAI")
|
||||
if (${RTAI})
|
||||
set(LOWLATENCY False)
|
||||
set(CPU_AFFINITY False)
|
||||
add_definitions("-DENABLE_RTAI_CLOCK")
|
||||
add_definitions("-DCONFIG_RTAI_LXRT_INLINE")
|
||||
include_directories ("/usr/realtime/include")
|
||||
@@ -564,7 +565,6 @@ elseif (${RF_BOARD} STREQUAL "OAI_BLADERF")
|
||||
LINK_DIRECTORIES("/usr/lib/x86_64-linux-gnu")
|
||||
|
||||
set(option_HW_lib "bladeRF -rdynamic -ldl")
|
||||
#set(LOWLATENCY False)
|
||||
|
||||
elseif (${RF_BOARD} STREQUAL "OAI_LMSSDR")
|
||||
include_directories("${OPENAIR_TARGETS}/ARCH/LMSSDR/USERSPACE/LIB")
|
||||
@@ -577,7 +577,6 @@ elseif (${RF_BOARD} STREQUAL "OAI_LMSSDR")
|
||||
LINK_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}/lms7002m")
|
||||
LINK_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}/Si5351C")
|
||||
set(HW_SOURCE ${HW_SOURCE} ${OPENAIR_TARGETS}/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp)
|
||||
set(LOWLATENCY False)
|
||||
set(option_HW_lib "-lLMS_SDR -lLMS7002M -lSi5351C -rdynamic -ldl")
|
||||
|
||||
elseif (${RF_BOARD} STREQUAL "CPRIGW")
|
||||
@@ -607,6 +606,7 @@ endif (${TRANSP_PRO} STREQUAL "ETHERNET")
|
||||
include_directories ("${OPENAIR_TARGETS}/ARCH/COMMON")
|
||||
|
||||
Message("LOWLATENCY flag is ${LOWLATENCY}")
|
||||
Message("CPU_Affinity flag is ${CPU_AFFINITY}")
|
||||
|
||||
##############################################################
|
||||
# ???!!! TO BE DOCUMENTED OPTIONS !!!???
|
||||
@@ -620,6 +620,7 @@ add_boolean_option(RRC_DEFAULT_RAB_IS_AM False "set the RLC mode to AM for the d
|
||||
add_boolean_option(OAI_NW_DRIVER_TYPE_ETHERNET False "????")
|
||||
add_boolean_option(DISABLE_USE_NAS False "???")
|
||||
add_boolean_option(LOWLATENCY True "Use the Linux scheduler SCHED_DEADLINE: kernel >= 3.14")
|
||||
add_boolean_option(CPU_AFFINITY False "Enable CPU Affinity of threads (only valid without deadline scheduler). It is enabled only with >2 CPUs")
|
||||
add_boolean_option(NAS_ADDRESS_FIX False "specific to oaisim: for nasmesh driver")
|
||||
add_boolean_option(NAS_NETLINK False "???? Must be True to compile nasmesh driver without rtai")
|
||||
add_boolean_option(OAISIM False "specific to oaisim")
|
||||
@@ -1085,6 +1086,7 @@ set(PHY_SRC
|
||||
${OPENAIR1_DIR}/PHY/CODING/crc_byte.c
|
||||
${OPENAIR1_DIR}/PHY/CODING/3gpplte_turbo_decoder_sse_8bit.c
|
||||
${OPENAIR1_DIR}/PHY/CODING/3gpplte_turbo_decoder_sse_16bit.c
|
||||
${OPENAIR1_DIR}/PHY/CODING/3gpplte_turbo_decoder_avx2_16bit.c
|
||||
${OPENAIR1_DIR}/PHY/CODING/lte_rate_matching.c
|
||||
${OPENAIR1_DIR}/PHY/CODING/rate_matching.c
|
||||
${OPENAIR1_DIR}/PHY/CODING/viterbi.c
|
||||
@@ -1190,8 +1192,8 @@ set (ENB_APP_SRC
|
||||
add_library(L2
|
||||
${L2_SRC}
|
||||
${MAC_SRC}
|
||||
${ENB_APP_SRC}
|
||||
${OPENAIR2_DIR}/RRC/L2_INTERFACE/openair_rrc_L2_interface.c)
|
||||
${ENB_APP_SRC})
|
||||
# ${OPENAIR2_DIR}/RRC/L2_INTERFACE/openair_rrc_L2_interface.c)
|
||||
|
||||
#Test for adding a shared library
|
||||
add_library(default_sched SHARED ${MAC_DIR}/eNB_agent_scheduler_dlsch_ue.c)
|
||||
@@ -2127,38 +2129,4 @@ endforeach(file)
|
||||
ADD_CUSTOM_TARGET(oarf
|
||||
DEPENDS ${OCT_FILES}
|
||||
)
|
||||
|
||||
#CMAKE INSTALL and CPACK
|
||||
|
||||
#INSTALL(PROGRAMS lte-softmodem ${OPENAIR_DIR}/targets DESTINATION bin)
|
||||
#INSTALL(PROGRAMS oaisim ${OPENAIR_DIR}/targets DESTINATION bin)
|
||||
|
||||
|
||||
#SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "OpenAirInterface")
|
||||
#SET(CPACK_PACKAGE_VENDOR "Eurecom")
|
||||
#SET(CPACK_PACKAGE_DESCRIPTION_FILE "${OPENAIR_DIR}/README.txt")
|
||||
#SET(CPACK_RESOURCE_FILE_LICENSE "${OPENAIR_DIR}/COPYING")
|
||||
#SET(CPACK_PACKAGE_VERSION_MAJOR "1")
|
||||
#SET(CPACK_PACKAGE_VERSION_MINOR "1")
|
||||
#SET(CPACK_PACKAGE_VERSION_PATCH "1")
|
||||
|
||||
#SET(CPACK_PACKAGE_INSTALL_DIRECTORY "CMake ${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}")
|
||||
#SET(CPACK_STRIP_FILES "${OPENAIR_TARGETS}/bin")
|
||||
#SET(CPACK_SOURCE_STRIP_FILES "")
|
||||
|
||||
##debian specific
|
||||
#SET(CPACK_DEBIAN_PACKAGE_NAME "OAI")
|
||||
#SET(CPACK_DEBIAN_PACKAGE_VERSION "${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}")
|
||||
##dpkg --print-architecture (do not use i686
|
||||
#SET(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "amd64")
|
||||
|
||||
#SET(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6 (>= 2.3.1-6), libgcc1 (>= 1:3.4.2-12)")
|
||||
#SET(CPACK_DEBIAN_PACKAGE_DEPENDS "libpthread.so.0 libm.so.6 libconfig.so.9 librt.so.1 libcrypt.so.1 libcrypto.so.1.0.0 libnettle.so.4 libsctp.so.1 libc.so.6")
|
||||
#SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "EURECOM-OSA")
|
||||
|
||||
#SET(CPACK_PACKAGE_EXECUTABLES "lte-softmodem" "mme_gw.Rel10" "openair-hss")
|
||||
|
||||
#SET(CPACK_DEBIAN_PACKAGE_DESCRIPTION "OpenAirInterface")
|
||||
#SET(CPACK_DEBIAN_PACKAGE_Section "Beta-Release")
|
||||
|
||||
#INCLUDE(CPack)
|
||||
|
||||
@@ -321,13 +321,19 @@ def cleanOldPrograms(oai, programList, CleanUpAluLteBox, ExmimoRfStop):
|
||||
print "Killing old programs..." + result
|
||||
programArray = programList.split()
|
||||
programListJoin = '|'.join(programArray)
|
||||
cmd = " ( date ;echo \"Starting cleaning old programs.. \" ; dmesg|tail )>& $HOME/.oai_test_setup_cleanup.log.`hostname` 2>&1 ; sync"
|
||||
result=oai.send_recv(cmd)
|
||||
cmd = cleanupOldProgramsScript + ' ' + '\''+programListJoin+'\''
|
||||
#result = oai.send_recv(cmd)
|
||||
#print result
|
||||
result = oai.send_expect_false(cmd, 'Match found', False)
|
||||
print "Looking for old programs..." + result
|
||||
res=oai.send_recv(CleanUpAluLteBox, True)
|
||||
res = oai.send_recv(ExmimoRfStop, False)
|
||||
cmd = "( " + ExmimoRfStop + " ) >> $HOME/.oai_test_setup_cleanup.log.`hostname` ; sync "
|
||||
res=oai.send_recv(cmd, False)
|
||||
#res = oai.send_recv(ExmimoRfStop, False)
|
||||
cmd = " ( date ;echo \"Finished cleaning old programs.. \" ; dmesg | tail)>> $HOME/.oai_test_setup_cleanup.log.`hostname` 2>&1 ; sync"
|
||||
res=oai.send_recv(cmd)
|
||||
|
||||
# \brief Class thread to launch a generic command on remote machine
|
||||
# \param threadID number of thread (for book keeping)
|
||||
@@ -1514,6 +1520,23 @@ for testcase in testcaseList:
|
||||
threadListGlobal = wait_testcaseclass_generic_threads(threadListGlobal, Timeout_execution)
|
||||
#cleanOldProgramsAllMachines(oai_list, CleanUpOldProgs, CleanUpAluLteBox, ExmimoRfStop)
|
||||
handle_testcaseclass_softmodem (testcase, CleanUpOldProgs, logdirOAI5GRepo, logdirOpenaircnRepo, MachineList, user, pw, CleanUpAluLteBox, ExmimoRfStop, nruns_lte_softmodem, Timeout_cmd )
|
||||
|
||||
#The lines below are copied from below to trace the failure of some of the machines in test setup. These lines below need to be removed in long term
|
||||
print "Creating xml file for overall results..."
|
||||
cmd = "cat $OPENAIR_DIR/cmake_targets/autotests/log/*/*.xml > $OPENAIR_DIR/cmake_targets/autotests/log/results_autotests.xml "
|
||||
res=os.system(cmd)
|
||||
os.system('sync')
|
||||
print "Now copying files to NFS Share"
|
||||
oai_localhost = openair('localdomain','localhost')
|
||||
oai_localhost.connect(user,pw)
|
||||
cmd = ' rm -fr ' + NFSTestsResultsDir + ' ; mkdir -p ' + NFSTestsResultsDir
|
||||
res = oai_localhost.send_recv(cmd)
|
||||
print "Deleting NFSTestResults Dir..." + res
|
||||
|
||||
print "Copying files from GilabCI Runner Machine : " + host + " .locallogdir = " + locallogdir + ", NFSTestsResultsDir = " + NFSTestsResultsDir
|
||||
SSHSessionWrapper('localhost', user, None, pw , NFSTestsResultsDir , locallogdir, "put_all")
|
||||
oai_localhost.disconnect()
|
||||
|
||||
elif (testcaseclass == 'compilation'):
|
||||
threadListGlobal = handle_testcaseclass_generic (testcasename, threadListGlobal, CleanUpOldProgs, logdirOAI5GRepo, MachineListGeneric, user, pw, CleanUpAluLteBox,Timeout_execution, ExmimoRfStop)
|
||||
elif (testcaseclass == 'execution'):
|
||||
@@ -1551,5 +1574,6 @@ print "Deleting NFSTestResults Dir..." + res
|
||||
|
||||
print "Copying files from GilabCI Runner Machine : " + host + " .locallogdir = " + locallogdir + ", NFSTestsResultsDir = " + NFSTestsResultsDir
|
||||
SSHSessionWrapper('localhost', user, None, pw , NFSTestsResultsDir , locallogdir, "put_all")
|
||||
oai_localhost.disconnect()
|
||||
|
||||
sys.exit()
|
||||
|
||||
@@ -8,9 +8,9 @@
|
||||
<GitOpenair-cnRepoBranch>develop</GitOpenair-cnRepoBranch>
|
||||
<CleanUpOldProgs>oaisim* oaisim_nos1* lte-softmodem* lte-softmodem-nos1* mme_gw* run_epc* run_hss* hss hss_sim configure_cots* wvdial* iperf iperf_script ping tshark rrh_gw</CleanUpOldProgs>
|
||||
<CleanUpAluLteBox>sudo -S -E /opt/ltebox/tools/stop_ltebox</CleanUpAluLteBox>
|
||||
<ExmimoRfStop>$OPENAIR_DIR/cmake_targets/build_oai -w EXMIMO -c; sudo -S -E $OPENAIR_DIR/cmake_targets/tools/stop_exmimo2; uname -a; dmesg|tail</ExmimoRfStop>
|
||||
<ExmimoRfStop>$OPENAIR_DIR/cmake_targets/build_oai -w EXMIMO -c; sudo -S -E $OPENAIR_DIR/cmake_targets/tools/stop_exmimo2; sudo -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_huaweiE398_ue.py --stop-ue; sudo -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue; sudo -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --stop-ue; uname -a; sudo -E dmesg|tail</ExmimoRfStop>
|
||||
<Timeout_execution>36000</Timeout_execution>
|
||||
<TestCaseExclusionList>0102+ 010304 010305 0104+ 015502 015505 015506 015507 015508 015509 015510 015511 015602 015605 015702 015705 015802 015805 016102 016105 016502 016505 0170+ 017502 017505 018002 018005 018502 018505 025502 025505</TestCaseExclusionList>
|
||||
<TestCaseExclusionList>0102+ 010304 010305 0104+ 015502 015505 015506 015507 015508 015509 015510 015511 015602 015605 015702 015705 015802 015805 016102 016105 016502 016505 017002 017005 017502 017505 018002 018005 018502 018505 025502 025505</TestCaseExclusionList>
|
||||
<nruns_lte-softmodem>3</nruns_lte-softmodem>
|
||||
<MachineListGeneric>mozart calisson stevens nano amerique</MachineListGeneric>
|
||||
<testCase id="010101" >
|
||||
@@ -4638,7 +4638,7 @@
|
||||
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf ENB_PORT_FOR_S1U 2152</eNB_config_file>
|
||||
<eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
|
||||
<eNB_compile_prog_args>--eNB -w BLADERF -x -c </eNB_compile_prog_args>
|
||||
<eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E $OPENAIR_DIR/cmake_targets/tools/start_bladerf.py</eNB_pre_exec>
|
||||
<eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash </eNB_pre_exec>
|
||||
<eNB_pre_exec_args></eNB_pre_exec_args>
|
||||
<eNB_main_exec>sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
|
||||
<eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf -W </eNB_main_exec_args>
|
||||
@@ -4714,7 +4714,7 @@
|
||||
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf ENB_PORT_FOR_S1U 2152</eNB_config_file>
|
||||
<eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
|
||||
<eNB_compile_prog_args>--eNB -w BLADERF -x -c </eNB_compile_prog_args>
|
||||
<eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E $OPENAIR_DIR/cmake_targets/tools/start_bladerf.py</eNB_pre_exec>
|
||||
<eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash </eNB_pre_exec>
|
||||
<eNB_pre_exec_args></eNB_pre_exec_args>
|
||||
<eNB_main_exec>sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
|
||||
<eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf -W </eNB_main_exec_args>
|
||||
@@ -4789,7 +4789,7 @@
|
||||
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf ENB_PORT_FOR_S1U 2152</eNB_config_file>
|
||||
<eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
|
||||
<eNB_compile_prog_args>--eNB -w BLADERF -x -c </eNB_compile_prog_args>
|
||||
<eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E $OPENAIR_DIR/cmake_targets/tools/start_bladerf.py</eNB_pre_exec>
|
||||
<eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash </eNB_pre_exec>
|
||||
<eNB_pre_exec_args></eNB_pre_exec_args>
|
||||
<eNB_main_exec>sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
|
||||
<eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf -W </eNB_main_exec_args>
|
||||
@@ -4864,7 +4864,7 @@
|
||||
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf ENB_PORT_FOR_S1U 2152</eNB_config_file>
|
||||
<eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
|
||||
<eNB_compile_prog_args>--eNB -w BLADERF -x -c </eNB_compile_prog_args>
|
||||
<eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E $OPENAIR_DIR/cmake_targets/tools/start_bladerf.py</eNB_pre_exec>
|
||||
<eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash </eNB_pre_exec>
|
||||
<eNB_pre_exec_args></eNB_pre_exec_args>
|
||||
<eNB_main_exec>sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
|
||||
<eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf -W </eNB_main_exec_args>
|
||||
@@ -4938,7 +4938,7 @@
|
||||
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf ENB_PORT_FOR_S1U 2152</eNB_config_file>
|
||||
<eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
|
||||
<eNB_compile_prog_args>--eNB -w BLADERF -x -c </eNB_compile_prog_args>
|
||||
<eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E $OPENAIR_DIR/cmake_targets/tools/start_bladerf.py</eNB_pre_exec>
|
||||
<eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash </eNB_pre_exec>
|
||||
<eNB_pre_exec_args></eNB_pre_exec_args>
|
||||
<eNB_main_exec>sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
|
||||
<eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf -W </eNB_main_exec_args>
|
||||
@@ -5012,7 +5012,7 @@
|
||||
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf ENB_PORT_FOR_S1U 2152</eNB_config_file>
|
||||
<eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
|
||||
<eNB_compile_prog_args>--eNB -w BLADERF -x -c </eNB_compile_prog_args>
|
||||
<eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E $OPENAIR_DIR/cmake_targets/tools/start_bladerf.py</eNB_pre_exec>
|
||||
<eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash </eNB_pre_exec>
|
||||
<eNB_pre_exec_args></eNB_pre_exec_args>
|
||||
<eNB_main_exec>sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
|
||||
<eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf -W </eNB_main_exec_args>
|
||||
@@ -5090,7 +5090,7 @@
|
||||
<eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</eNB_pre_exec>
|
||||
<eNB_pre_exec_args></eNB_pre_exec_args>
|
||||
<eNB_main_exec>sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
|
||||
<eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf -W </eNB_main_exec_args>
|
||||
<eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf --rf-config-file $OPENAIR_DIR/targets/ARCH/LMSSDR/enb_sodera_highband_5MHz_rx19dB_txfull.ini -W </eNB_main_exec_args>
|
||||
<eNB_traffic_exec></eNB_traffic_exec>
|
||||
<eNB_traffic_exec_args></eNB_traffic_exec_args>
|
||||
<eNB_search_expr_true></eNB_search_expr_true>
|
||||
@@ -5130,7 +5130,7 @@
|
||||
<EPC_search_expr_true>throughput_test min=1.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec </EPC_search_expr_true>
|
||||
<EPC_search_expr_false></EPC_search_expr_false>
|
||||
<EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
|
||||
<tags>SoDeRa.ALU_EPC.Bandrich.5MHz.FDD.Band_7.UL.1TX.1RX</tags>
|
||||
<tags>LMSSDR.ALU_EPC.Bandrich.5MHz.FDD.Band_7.UL.1TX.1RX</tags>
|
||||
<nruns>10</nruns>
|
||||
</testCase>
|
||||
|
||||
@@ -5166,7 +5166,7 @@
|
||||
<eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</eNB_pre_exec>
|
||||
<eNB_pre_exec_args></eNB_pre_exec_args>
|
||||
<eNB_main_exec>sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
|
||||
<eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf -W </eNB_main_exec_args>
|
||||
<eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf --rf-config-file $OPENAIR_DIR/targets/ARCH/LMSSDR/enb_sodera_highband_10MHz_rx19dB_txfull.ini -W </eNB_main_exec_args>
|
||||
<eNB_traffic_exec></eNB_traffic_exec>
|
||||
<eNB_traffic_exec_args></eNB_traffic_exec_args>
|
||||
<eNB_search_expr_true></eNB_search_expr_true>
|
||||
@@ -5206,7 +5206,7 @@
|
||||
<EPC_search_expr_true>throughput_test min=1.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec </EPC_search_expr_true>
|
||||
<EPC_search_expr_false></EPC_search_expr_false>
|
||||
<EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
|
||||
<tags>SoDeRa.ALU_EPC.Bandrich.10MHz.FDD.Band_7.UL.1TX.1RX</tags>
|
||||
<tags>LMSSDR.ALU_EPC.Bandrich.10MHz.FDD.Band_7.UL.1TX.1RX</tags>
|
||||
<nruns>10</nruns>
|
||||
</testCase>
|
||||
|
||||
@@ -5241,7 +5241,7 @@
|
||||
<eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</eNB_pre_exec>
|
||||
<eNB_pre_exec_args></eNB_pre_exec_args>
|
||||
<eNB_main_exec>sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
|
||||
<eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf -W </eNB_main_exec_args>
|
||||
<eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf -W --rf-config-file $OPENAIR_DIR/targets/ARCH/LMSSDR/enb_sodera_highband_20MHz_rx19dB_txfull.ini </eNB_main_exec_args>
|
||||
<eNB_traffic_exec></eNB_traffic_exec>
|
||||
<eNB_traffic_exec_args></eNB_traffic_exec_args>
|
||||
<eNB_search_expr_true></eNB_search_expr_true>
|
||||
@@ -5281,7 +5281,7 @@
|
||||
<EPC_search_expr_true>throughput_test min=1.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec </EPC_search_expr_true>
|
||||
<EPC_search_expr_false></EPC_search_expr_false>
|
||||
<EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
|
||||
<tags>SoDeRa.ALU_EPC.Bandrich.20MHz.FDD.Band_7.UL.1TX.1RX</tags>
|
||||
<tags>LMSSDR.ALU_EPC.Bandrich.20MHz.FDD.Band_7.UL.1TX.1RX</tags>
|
||||
<nruns>10</nruns>
|
||||
</testCase>
|
||||
|
||||
@@ -5316,7 +5316,7 @@
|
||||
<eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</eNB_pre_exec>
|
||||
<eNB_pre_exec_args></eNB_pre_exec_args>
|
||||
<eNB_main_exec>sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
|
||||
<eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf -W </eNB_main_exec_args>
|
||||
<eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf -W --rf-config-file $OPENAIR_DIR/targets/ARCH/LMSSDR/enb_sodera_highband_5MHz_rx19dB_txfull.ini </eNB_main_exec_args>
|
||||
<eNB_traffic_exec></eNB_traffic_exec>
|
||||
<eNB_traffic_exec_args></eNB_traffic_exec_args>
|
||||
<eNB_search_expr_true></eNB_search_expr_true>
|
||||
@@ -5355,7 +5355,7 @@
|
||||
<EPC_traffic_exec_args></EPC_traffic_exec_args>
|
||||
<EPC_search_expr_false></EPC_search_expr_false>
|
||||
<EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
|
||||
<tags>BladeRF.ALU_EPC.Bandrich.5MHz.FDD.Band_7.DL.1TX.1RX</tags>
|
||||
<tags>LMSSDR.ALU_EPC.Bandrich.5MHz.FDD.Band_7.DL.1TX.1RX</tags>
|
||||
<nruns>10</nruns>
|
||||
</testCase>
|
||||
|
||||
@@ -5390,7 +5390,7 @@
|
||||
<eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</eNB_pre_exec>
|
||||
<eNB_pre_exec_args></eNB_pre_exec_args>
|
||||
<eNB_main_exec>sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
|
||||
<eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf -W </eNB_main_exec_args>
|
||||
<eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf -W --rf-config-file $OPENAIR_DIR/targets/ARCH/LMSSDR/enb_sodera_highband_10MHz_rx19dB_txfull.ini</eNB_main_exec_args>
|
||||
<eNB_traffic_exec></eNB_traffic_exec>
|
||||
<eNB_traffic_exec_args></eNB_traffic_exec_args>
|
||||
<eNB_search_expr_true></eNB_search_expr_true>
|
||||
@@ -5464,7 +5464,7 @@
|
||||
<eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</eNB_pre_exec>
|
||||
<eNB_pre_exec_args></eNB_pre_exec_args>
|
||||
<eNB_main_exec>sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
|
||||
<eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf -W </eNB_main_exec_args>
|
||||
<eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf -W --rf-config-file $OPENAIR_DIR/targets/ARCH/LMSSDR/enb_sodera_highband_20MHz_rx19dB_txfull.ini</eNB_main_exec_args>
|
||||
<eNB_traffic_exec></eNB_traffic_exec>
|
||||
<eNB_traffic_exec_args></eNB_traffic_exec_args>
|
||||
<eNB_search_expr_true></eNB_search_expr_true>
|
||||
|
||||
@@ -180,11 +180,16 @@ def start_ue () :
|
||||
thread_ppp.join()
|
||||
|
||||
def stop_ue():
|
||||
timeout=60
|
||||
os.system('killall wvdial')
|
||||
send_command('AT', 'OK' , timeout)
|
||||
send_command('AT+CGATT=0' , 'OK|ERROR' , timeout)
|
||||
#send_command('AT+CFUN=4' , 'OK' , timeout)
|
||||
stringIdBandrich='Huawei Technologies Co., Ltd. E398 LTE/UMTS/GSM Modem/Networkcard'
|
||||
status, out = commands.getstatusoutput('lsusb | grep -i \'' + stringIdBandrich + '\'')
|
||||
if (out == '') :
|
||||
print "Huawei E398 Adapter not found. Exiting now..."
|
||||
sys.exit()
|
||||
timeout=60
|
||||
os.system('killall wvdial')
|
||||
send_command('AT', 'OK' , timeout)
|
||||
send_command('AT+CGATT=0' , 'OK|ERROR' , timeout)
|
||||
#send_command('AT+CFUN=4' , 'OK' , timeout)
|
||||
|
||||
|
||||
#reset the USB BUS of Bandrich UE
|
||||
@@ -192,7 +197,7 @@ def reset_ue():
|
||||
stringIdBandrich='Huawei Technologies Co., Ltd. E398 LTE/UMTS/GSM Modem/Networkcard'
|
||||
status, out = commands.getstatusoutput('lsusb | grep -i \'' + stringIdBandrich + '\'')
|
||||
if (out == '') :
|
||||
print "Bandrich 4G LTE Adapter not found. Exiting now..."
|
||||
print "Huawei E398 Adapter not found. Exiting now..."
|
||||
sys.exit()
|
||||
p=re.compile('Bus\s*(\w+)\s*Device\s*(\w+):\s*ID\s*(\w+):(\w+)')
|
||||
res=p.findall(out)
|
||||
|
||||
Executable
+36
@@ -0,0 +1,36 @@
|
||||
#!/bin/bash
|
||||
#******************************************************************************
|
||||
|
||||
# OpenAirInterface
|
||||
# Copyright(c) 1999 - 2014 Eurecom
|
||||
|
||||
# OpenAirInterface is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
|
||||
|
||||
# OpenAirInterface is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with OpenAirInterface.The full GNU General Public License is
|
||||
# included in this distribution in the file called "COPYING". If not,
|
||||
# see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# Contact Information
|
||||
# OpenAirInterface Admin: openair_admin@eurecom.fr
|
||||
# OpenAirInterface Tech : openair_tech@eurecom.fr
|
||||
# OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr
|
||||
|
||||
# Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
|
||||
|
||||
# *******************************************************************************/
|
||||
# \author Navid Nikaein, Rohit Gupta
|
||||
|
||||
# To free unused memory else test setup runs out of memory
|
||||
sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches '
|
||||
|
||||
|
||||
@@ -53,11 +53,11 @@ while true ; do
|
||||
echo "Wating for UE to connect and get IP Address..."
|
||||
sleep 1
|
||||
else
|
||||
echo "UE is not connected. IP Address settings are... $cmd"
|
||||
echo "UE is now connected. IP Address settings are... $cmd"
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
print "Starting iperf now..."
|
||||
echo "Starting iperf now..."
|
||||
|
||||
sudo adb -s $device_id shell /data/local/tmp/iperf ${iperf_args[@]}
|
||||
|
||||
+22
-3
@@ -47,6 +47,7 @@ PRINT_STATS="False"
|
||||
VCD_TIMING="False"
|
||||
LOWLATENCY_FLAG_USER="False"
|
||||
FORCE_LOWLATENCY_FLAG_USER=""
|
||||
CPU_AFFINITY_FLAG_USER="True" #Only valid when lowlatecy flag is set to False
|
||||
REL="Rel10"
|
||||
HW="None"
|
||||
TP="None"
|
||||
@@ -125,6 +126,8 @@ Options
|
||||
Disables deadline scheduler of Linux kernel (>=3.14.x).
|
||||
--enable-deadline
|
||||
Disables deadline scheduler of Linux kernel (>=3.14.x).
|
||||
--disable-cpu-affinity
|
||||
Disables CPU Affinity between UHD/TX/RX Threads (Valid only when deadline scheduler is disabled). By defaulT, CPU Affinity is enabled when not using deadline scheduler. It is enabled only with >2 CPUs. For eNB, CPU_0-> Device library (UHD), CPU_1->TX Threads, CPU_2...CPU_MAX->Rx Threads. For UE, CPU_0->Device Library(UHD), CPU_1..CPU_MAX -> All the UE threads
|
||||
Usage (first build):
|
||||
oaisim (eNB + UE): ./build_oai -I -g --oaisim -x --install-system-files
|
||||
Eurecom EXMIMO + COTS UE : ./build_oai -I -g --eNB -x --install-system-files
|
||||
@@ -263,6 +266,10 @@ function main() {
|
||||
FORCE_LOWLATENCY_FLAG_USER="True"
|
||||
echo_info "Enabling the usage of deadline scheduler"
|
||||
shift 1;;
|
||||
--disable-cpu-affinity)
|
||||
CPU_AFFINITY_FLAG_USER="False"
|
||||
echo_info "Disabling CPU Affinity (only valid when not using deadline scheduler)"
|
||||
shift 1;;
|
||||
-h | --help)
|
||||
print_help
|
||||
exit 1;;
|
||||
@@ -309,7 +316,7 @@ function main() {
|
||||
#By default: EXMIMO: enable
|
||||
if [ "$FORCE_LOWLATENCY_FLAG_USER" = "" ]; then
|
||||
if [ "$HW" = "EXMIMO" ] ; then
|
||||
LOWLATENCY_FLAG_USER="True"
|
||||
LOWLATENCY_FLAG_USER="False"
|
||||
elif [ "$HW" = "ETHERNET" ] ; then
|
||||
LOWLATENCY_FLAG_USER="True"
|
||||
elif [ "$HW" = "OAI_USRP" ] ; then
|
||||
@@ -328,8 +335,13 @@ function main() {
|
||||
LOWLATENCY_FLAG_USER=$FORCE_LOWLATENCY_FLAG_USER
|
||||
fi
|
||||
|
||||
echo_info "Flags for Deadline scheduler: $LOWLATENCY_FLAG_USER"
|
||||
#Disable CPU Affinity for deadline scheduler
|
||||
if [ "$LOWLATENCY_FLAG_USER" = "True" ] ; then
|
||||
CPU_AFFINITY_FLAG_USER="False"
|
||||
fi
|
||||
|
||||
echo_info "Flags for Deadline scheduler: $LOWLATENCY_FLAG_USER"
|
||||
echo_info "Flags for CPU Affinity: $CPU_AFFINITY_FLAG_USER"
|
||||
|
||||
############################################
|
||||
# setting and printing OAI envs, we should check here
|
||||
@@ -421,6 +433,7 @@ function main() {
|
||||
echo "set ( TRANSP_PRO \"${TP}\")" >> $cmake_file
|
||||
echo "set(PACKAGE_NAME \"${lte_exec}\")" >> $cmake_file
|
||||
echo "set (LOWLATENCY \"${LOWLATENCY_FLAG_USER}\" )" >>$cmake_file
|
||||
echo "set (CPU_AFFINITY \"${CPU_AFFINITY_FLAG_USER}\" )" >>$cmake_file
|
||||
echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)' >> $cmake_file
|
||||
cd $DIR/$lte_build_dir/build
|
||||
cmake ..
|
||||
@@ -449,7 +462,7 @@ function main() {
|
||||
compilations \
|
||||
$lte_build_dir ue_ip \
|
||||
CMakeFiles/ue_ip/ue_ip.ko $dbin/ue_ip.ko
|
||||
|
||||
|
||||
# mkdir -p $DIR/at_commands/build
|
||||
# cd $DIR/at_commands/build
|
||||
# cmake ..
|
||||
@@ -472,6 +485,11 @@ function main() {
|
||||
# generate USIM data
|
||||
if [ -f $dbin/nvram ]; then
|
||||
install_nas_tools $dbin $dconf
|
||||
echo_info "Copying UE specific part to $DIR/$lte_build_dir/build"
|
||||
cp -Rvf $dbin/.ue_emm.nvram $DIR/$lte_build_dir/build
|
||||
cp -Rvf $dbin/.ue.nvram $DIR/$lte_build_dir/build
|
||||
cp -Rvf $dbin/.usim.nvram $DIR/$lte_build_dir/build
|
||||
|
||||
else
|
||||
echo_warning "not generated UE NAS files: binaries not found"
|
||||
fi
|
||||
@@ -643,6 +661,7 @@ function main() {
|
||||
echo "set(TRANSP_PRO \"${TP}\")" >> $cmake_file
|
||||
echo 'set(PACKAGE_NAME "\"rrh_gw\"")' >> $cmake_file
|
||||
echo "set (LOWLATENCY \"${LOWLATENCY_FLAG_USER}\" )" >>$cmake_file
|
||||
echo "set (CPU_AFFINITY \"${CPU_AFFINITY_FLAG_USER}\" )" >>$cmake_file
|
||||
echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)' >> $cmake_file
|
||||
cd $DIR/$rrh_build_dir/build
|
||||
cmake ..
|
||||
|
||||
@@ -132,10 +132,21 @@ compilations() {
|
||||
############################################
|
||||
|
||||
install_nettle_from_source() {
|
||||
nettle_install_log=$OPENAIR_DIR/cmake_targets/log/nettle_install_log.txt
|
||||
echo_info "\nInstalling Nettle. The log file for nettle installation is here: $nettle_install_log "
|
||||
(
|
||||
cd /tmp
|
||||
echo "Downloading nettle archive"
|
||||
rm -rf /tmp/nettle-2.5.tar.gz* /tmp/nettle-2.5
|
||||
wget ftp://ftp.lysator.liu.se/pub/security/lsh/nettle-2.5.tar.gz
|
||||
$SUDO rm -rf /tmp/nettle-2.5.tar.gz* /tmp/nettle-2.5
|
||||
wget https://ftp.gnu.org/gnu/nettle/nettle-2.5.tar.gz
|
||||
if [ $? -ne 0 ]; then
|
||||
wget ftp://ftp.lysator.liu.se/pub/security/lsh/nettle-2.5.tar.gz
|
||||
fi
|
||||
if [ ! -f nettle-2.5.tar.gz ]; then
|
||||
echo_error "Could not download nettle source files"
|
||||
cd -
|
||||
return
|
||||
fi
|
||||
tar -xzf nettle-2.5.tar.gz
|
||||
cd nettle-2.5/
|
||||
./configure --disable-openssl --enable-shared --prefix=/usr
|
||||
@@ -143,7 +154,7 @@ install_nettle_from_source() {
|
||||
make -j`nproc`
|
||||
make check
|
||||
$SUDO make install
|
||||
rm -rf /tmp/nettle-2.5.tar.gz /tmp/nettle-2.5
|
||||
) >& $nettle_install_log
|
||||
}
|
||||
|
||||
|
||||
@@ -178,17 +189,28 @@ install_protobuf_c_from_source(){
|
||||
}
|
||||
|
||||
install_gnutls_from_source(){
|
||||
gnutls_install_log=$OPENAIR_DIR/cmake_targets/log/gnutls_install_log.txt
|
||||
echo_info "\nInstalling Gnutls. The log file for Gnutls installation is here: $gnutls_install_log "
|
||||
(
|
||||
cd /tmp
|
||||
echo "Downloading gnutls archive"
|
||||
rm -rf /tmp/gnutls-3.1.23.tar.xz* /tmp/gnutls-3.1.23
|
||||
wget ftp://ftp.gnutls.org/gcrypt/gnutls/v3.1/gnutls-3.1.23.tar.xz
|
||||
tar -xzf gnutls-3.1.23.tar.xz
|
||||
$SUDO rm -rf /tmp/gnutls-3.1.23.tar.xz* /tmp/gnutls-3.1.23
|
||||
wget http://mirrors.dotsrc.org/gcrypt/gnutls/v3.1/gnutls-3.1.23.tar.xz
|
||||
if [ $? -ne 0 ]; then
|
||||
wget ftp://ftp.gnutls.org/gcrypt/gnutls/v3.1/gnutls-3.1.23.tar.xz
|
||||
fi
|
||||
if [ ! -f gnutls-3.1.23.tar.xz ]; then
|
||||
echo_error "Could not download gnutls source files"
|
||||
cd -
|
||||
return
|
||||
fi
|
||||
tar -xJf gnutls-3.1.23.tar.xz
|
||||
cd gnutls-3.1.23/
|
||||
./configure --prefix=/usr
|
||||
echo "Compiling gnutls"
|
||||
make -j`nproc`
|
||||
$SUDO make install
|
||||
rm -rf /tmp/gnutls-3.1.23.tar.xz /tmp/gnutls-3.1.23
|
||||
)>& $gnutls_install_log
|
||||
}
|
||||
|
||||
|
||||
@@ -306,12 +328,12 @@ check_install_oai_software() {
|
||||
libyaml-dev
|
||||
|
||||
$SUDO update-alternatives --set liblapack.so /usr/lib/atlas-base/atlas/liblapack.so
|
||||
if [ `lsb_release -rs` = '12.04' ] ; then
|
||||
install_nettle_from_source
|
||||
install_gnutls_from_source
|
||||
else
|
||||
$SUDO apt-get install -y libgnutls-dev nettle-dev nettle-bin
|
||||
fi
|
||||
|
||||
# First we remove gnutls/nettle installation and then install from sources
|
||||
$SUDO apt-get remove -y libgnutls-dev nettle-dev nettle-bin
|
||||
install_nettle_from_source
|
||||
install_gnutls_from_source
|
||||
|
||||
$SUDO pip install paramiko
|
||||
$SUDO pip install pyroute2
|
||||
install_asn1c_from_source
|
||||
@@ -322,8 +344,8 @@ check_install_oai_software() {
|
||||
}
|
||||
|
||||
install_asn1c_from_source(){
|
||||
asn1_install_dir=$OPENAIR_DIR/cmake_targets/log/asn1c_install_log.txt
|
||||
echo_info "\nInstalling ASN1. The log file for ASN1 installation is here: $asn1_install_dir "
|
||||
asn1_install_log=$OPENAIR_DIR/cmake_targets/log/asn1c_install_log.txt
|
||||
echo_info "\nInstalling ASN1. The log file for ASN1 installation is here: $asn1_install_log "
|
||||
(
|
||||
$SUDO rm -rf /tmp/asn1c-r1516
|
||||
mkdir -p /tmp/asn1c-r1516
|
||||
@@ -337,7 +359,7 @@ install_asn1c_from_source(){
|
||||
./configure
|
||||
make -j`nproc`
|
||||
$SUDO make install
|
||||
) > $asn1_install_dir 2>&1
|
||||
) > $asn1_install_log 2>&1
|
||||
}
|
||||
|
||||
#################################################
|
||||
|
||||
@@ -81,8 +81,10 @@ function help()
|
||||
echo_error " "
|
||||
echo_error "Options:"
|
||||
echo_error "Mandatory arguments to long options are mandatory for short options too."
|
||||
echo_error " -a, --abstraction enable phy abstraction mode"
|
||||
echo_error " -c, -C, --config-file eNB_config_file eNB config file, (see $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF)"
|
||||
echo_error " Default eNB config file if not set is $1"
|
||||
echo_error " -l, --log-level set the global log level (8:trace, 7:debug, 6:info, 4:warn, 3:error). Note that the log configuration is eNB config file is ignored for oaisim."
|
||||
echo_error " -g, --gdb Run with GDB."
|
||||
echo_error " -h, --help Print this help."
|
||||
echo_error " -K, --itti-dump-file filename ITTI dump file containing all ITTI events occuring during EPC runtime.(can omit file name if last argument)"
|
||||
@@ -114,8 +116,14 @@ function main()
|
||||
until [ -z "$1" ]
|
||||
do
|
||||
case "$1" in
|
||||
-a | --abstraction )
|
||||
abstraction_flag=1
|
||||
echo "enabling abstraction mode"
|
||||
exe_arguments="$exe_arguments -a"
|
||||
shift;
|
||||
;;
|
||||
-c | -C | --config-file)
|
||||
CONFIG_FILE_ENB=$2
|
||||
CONFIG_FILE_ENB=$2
|
||||
# may be relative path
|
||||
if [ -f $(dirname $(readlink -f $0))/$CONFIG_FILE ]; then
|
||||
CONFIG_FILE_ENB=$(dirname $(readlink -f $0))/$CONFIG_FILE
|
||||
@@ -131,6 +139,11 @@ function main()
|
||||
fi
|
||||
shift 2;
|
||||
;;
|
||||
-l | --log-level)
|
||||
echo "setting the log level to $2"
|
||||
exe_arguments="$exe_arguments -l $2"
|
||||
shift 2;
|
||||
;;
|
||||
-g | --gdb)
|
||||
run_gdb=1
|
||||
echo "setting GDB flag to: $GDB"
|
||||
@@ -241,7 +254,8 @@ function main()
|
||||
if [ $? -ne 0 ]; then
|
||||
bash -c echo "200 lte " >> /etc/iproute2/rt_tables
|
||||
fi
|
||||
ip rule add fwmark 1 table lte
|
||||
ip rule add fwmark 1 table lte
|
||||
ifconfig oip1 up
|
||||
ip route add default dev oip1 table lte
|
||||
|
||||
exe_arguments="$exe_arguments -s15 -AAWGN -y1 -b1 -u1 -Q0"
|
||||
|
||||
@@ -1,674 +0,0 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users. We, the Free Software Foundation, use the
|
||||
GNU General Public License for most of our software; it applies also to
|
||||
any other work released this way by its authors. You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you have
|
||||
certain responsibilities if you distribute copies of the software, or if
|
||||
you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. You must make sure that they, too, receive
|
||||
or can get the source code. And you must show them these terms so they
|
||||
know their rights.
|
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the manufacturer
|
||||
can do so. This is fundamentally incompatible with the aim of
|
||||
protecting users' freedom to change the software. The systematic
|
||||
pattern of such abuse occurs in the area of products for individuals to
|
||||
use, which is precisely where it is most unacceptable. Therefore, we
|
||||
have designed this version of the GPL to prohibit the practice for those
|
||||
products. If such problems arise substantially in other domains, we
|
||||
stand ready to extend this provision to those domains in future versions
|
||||
of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish to
|
||||
avoid the special danger that patents applied to a free program could
|
||||
make it effectively proprietary. To prevent this, the GPL assures that
|
||||
patents cannot be used to render the program non-free.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program 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.
|
||||
|
||||
This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
<program> Copyright (C) <year> <name of author>
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, your program's commands
|
||||
might be different; for a GUI interface, you would use an "about box".
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU GPL, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
|
||||
The GNU General Public License does not permit incorporating your program
|
||||
into proprietary programs. If your program is a subroutine library, you
|
||||
may consider it more useful to permit linking proprietary applications with
|
||||
the library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License. But first, please read
|
||||
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
||||
@@ -1,2 +0,0 @@
|
||||
#MAC_XFACE_OBJS = $(OPENAIR1_TOP)/MAC_INTERFACE/register.o
|
||||
MAC_XFACE_OBJS += $(OPENAIR1_TOP)/MAC_INTERFACE/init.o
|
||||
@@ -1,42 +0,0 @@
|
||||
/*******************************************************************************
|
||||
OpenAirInterface
|
||||
Copyright(c) 1999 - 2014 Eurecom
|
||||
|
||||
OpenAirInterface is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
|
||||
OpenAirInterface is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenAirInterface.The full GNU General Public License is
|
||||
included in this distribution in the file called "COPYING". If not,
|
||||
see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Contact Information
|
||||
OpenAirInterface Admin: openair_admin@eurecom.fr
|
||||
OpenAirInterface Tech : openair_tech@eurecom.fr
|
||||
OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr
|
||||
|
||||
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
|
||||
|
||||
*******************************************************************************/
|
||||
/*________________________mac_defs.h________________________
|
||||
|
||||
Authors : Hicham Anouar, Raymond Knopp
|
||||
Company : EURECOM
|
||||
Emails : anouar@eurecom.fr, knopp@eurecom.fr
|
||||
________________________________________________________________*/
|
||||
|
||||
#ifndef __MAC_INTERFACE_DEFS_H__
|
||||
#define __MAC_INTERFACE_DEFS_H__
|
||||
|
||||
|
||||
#include "PHY_INTERFACE/defs.h"
|
||||
|
||||
#endif
|
||||
@@ -1,55 +0,0 @@
|
||||
/*******************************************************************************
|
||||
OpenAirInterface
|
||||
Copyright(c) 1999 - 2014 Eurecom
|
||||
|
||||
OpenAirInterface is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
|
||||
OpenAirInterface is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenAirInterface.The full GNU General Public License is
|
||||
included in this distribution in the file called "COPYING". If not,
|
||||
see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Contact Information
|
||||
OpenAirInterface Admin: openair_admin@eurecom.fr
|
||||
OpenAirInterface Tech : openair_tech@eurecom.fr
|
||||
OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr
|
||||
|
||||
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
|
||||
|
||||
*******************************************************************************/
|
||||
/*________________________mac_extern.h________________________
|
||||
|
||||
Authors : Hicham Anouar, Raymond Knopp
|
||||
Company : EURECOM
|
||||
Emails : anouar@eurecom.fr, knopp@eurecom.fr
|
||||
________________________________________________________________*/
|
||||
|
||||
|
||||
/*! \file mac_extern.h
|
||||
* \brief Generic mac interface external variable definitions
|
||||
* \author R. Knopp
|
||||
* \date March 2006
|
||||
* \note
|
||||
* \warning
|
||||
* @ingroup macxface
|
||||
*/
|
||||
|
||||
#ifndef __MAC_INTERFACE_EXTERN_H__
|
||||
#define __MAC_INTERFACE_EXTERN_H__
|
||||
|
||||
#include "defs.h"
|
||||
|
||||
|
||||
extern MAC_xface *mac_xface;
|
||||
|
||||
|
||||
#endif /*__MAC_INTERFACE_EXTERN_H__ */
|
||||
@@ -1,76 +0,0 @@
|
||||
/*******************************************************************************
|
||||
OpenAirInterface
|
||||
Copyright(c) 1999 - 2014 Eurecom
|
||||
|
||||
OpenAirInterface is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
|
||||
OpenAirInterface is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenAirInterface.The full GNU General Public License is
|
||||
included in this distribution in the file called "COPYING". If not,
|
||||
see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Contact Information
|
||||
OpenAirInterface Admin: openair_admin@eurecom.fr
|
||||
OpenAirInterface Tech : openair_tech@eurecom.fr
|
||||
OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr
|
||||
|
||||
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
|
||||
|
||||
*******************************************************************************/
|
||||
/*________________________mac_init.c________________________
|
||||
|
||||
Authors : Hicham Anouar, Raymond Knopp
|
||||
Company : EURECOM
|
||||
Emails : anouar@eurecom.fr, knopp@eurecom.fr
|
||||
________________________________________________________________*/
|
||||
|
||||
/*!\brief Initilization and reconfiguration routines for generic MAC interface */
|
||||
|
||||
#include "defs.h"
|
||||
#include "extern.h"
|
||||
#include "SCHED/defs.h"
|
||||
|
||||
int mac_init(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
#ifndef USER_MODE
|
||||
// mac_xface->macphy_init();
|
||||
mac_xface->macphy_exit = openair_sched_exit;
|
||||
#else
|
||||
mac_xface->macphy_exit=(void (*)(void)) exit;
|
||||
#endif
|
||||
|
||||
/* this is done in cbmimo1_fileops
|
||||
#ifdef OPENAIR2
|
||||
mac_xface->macphy_init();
|
||||
#endif //OPENAIR2
|
||||
*/
|
||||
|
||||
return(1);
|
||||
}
|
||||
|
||||
void mac_cleanup(void)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void mac_resynch(void)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
#ifdef OPENAIR2
|
||||
EXPORT_SYMBOL(frame);
|
||||
#endif //OPENAIR2
|
||||
*/
|
||||
@@ -1,121 +0,0 @@
|
||||
/*******************************************************************************
|
||||
OpenAirInterface
|
||||
Copyright(c) 1999 - 2014 Eurecom
|
||||
|
||||
OpenAirInterface is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
|
||||
OpenAirInterface is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenAirInterface.The full GNU General Public License is
|
||||
included in this distribution in the file called "COPYING". If not,
|
||||
see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Contact Information
|
||||
OpenAirInterface Admin: openair_admin@eurecom.fr
|
||||
OpenAirInterface Tech : openair_tech@eurecom.fr
|
||||
OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr
|
||||
|
||||
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
|
||||
|
||||
*******************************************************************************/
|
||||
/*________________________mac_register.c________________________
|
||||
|
||||
Authors : Hicham Anouar, Raymond Knopp
|
||||
Company : EURECOM
|
||||
Emails : anouar@eurecom.fr, knopp@eurecom.fr
|
||||
________________________________________________________________*/
|
||||
|
||||
|
||||
/*!\brief Registration routines for generic MAC interface. Register/unregister a MAC.
|
||||
Upon registration, the MAC retrieves the transport channel (MAC_tch) data structure and provides the
|
||||
pointer to the macphy_scheduler() routine*/
|
||||
#define __NO_VERSION__
|
||||
|
||||
#undef __PHY_IMPLEMENTATION_DEFS_H__
|
||||
|
||||
#include "ARCH/CBMIMO1/DEVICE_DRIVER/defs.h"
|
||||
#include "defs.h"
|
||||
#include "extern.h"
|
||||
#include "SCHED/extern.h"
|
||||
|
||||
#ifndef USER_MODE
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void dummy_macphy_scheduler(uint8_t last_slot)
|
||||
{
|
||||
//if (last_slot == 0)
|
||||
// mac_xface->frame++;
|
||||
|
||||
msg("[OPENAIR][MAC XFACE] in dummy_macphy_scheduler(): MAC no yet registered!\n");
|
||||
|
||||
//#ifdef EMOS
|
||||
// phy_procedures(last_slot);
|
||||
//#endif
|
||||
|
||||
}
|
||||
|
||||
void dummy_macphy_setparams(void *params)
|
||||
{
|
||||
msg("[OPENAIR][MAC XFACE] dummy_macphy_setparams(): no MAC registered!\n");
|
||||
}
|
||||
|
||||
void dummy_macphy_init(void )
|
||||
{
|
||||
msg("[OPENAIR][MAC XFACE] dummy_macphy_init(): no MAC registered!\n");
|
||||
}
|
||||
|
||||
MAC_xface *mac_register(void macphy_scheduler(uint8_t last_slot), void macphy_setparams(void *),void macphy_init(void ),void mrbch_phy_sync_failure(unsigned char,unsigned char),
|
||||
void chbch_phy_sync_success(unsigned char,unsigned char))
|
||||
{
|
||||
|
||||
if (openair_daq_vars.mac_registered == 0) {
|
||||
|
||||
msg("[OPENAIR][MAC XFACE] Registering new MAC interface at %p, scheduler %p, setparams at %p, init at %p\n",
|
||||
mac_xface,macphy_scheduler,macphy_setparams,macphy_init);
|
||||
mac_xface->macphy_scheduler = macphy_scheduler;
|
||||
mac_xface->macphy_setparams = macphy_setparams;
|
||||
mac_xface->macphy_init = macphy_init;
|
||||
#ifndef PC_TARGET
|
||||
// mac_xface->ublaze_mac_xface = ublaze_mac_xface;
|
||||
#endif
|
||||
openair_daq_vars.mac_registered=1;
|
||||
return(mac_xface);
|
||||
} else {
|
||||
msg("[OPENAIR][MAC XFACE] MAC interface already registered, aborting ...\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
int mac_unregister(MAC_xface *mac_xface_rx)
|
||||
{
|
||||
|
||||
if (mac_xface_rx == mac_xface) {
|
||||
msg("[OPENAIR][MAC XFACE] Unregistering MAC interface\n");
|
||||
mac_xface->macphy_scheduler = dummy_macphy_scheduler;
|
||||
mac_xface->macphy_setparams = dummy_macphy_setparams;
|
||||
mac_xface->macphy_init = dummy_macphy_init;
|
||||
openair_daq_vars.mac_registered=0;
|
||||
return(0);
|
||||
} else {
|
||||
msg("[OPENAIR][MAC XFACE] Not the right interface descriptor pointer!!!, aborting ...\n");
|
||||
return (-1);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
EXPORT_SYMBOL(mac_register);
|
||||
EXPORT_SYMBOL(mac_unregister);
|
||||
#endif //USER_MODE
|
||||
@@ -1,52 +0,0 @@
|
||||
/*******************************************************************************
|
||||
OpenAirInterface
|
||||
Copyright(c) 1999 - 2014 Eurecom
|
||||
|
||||
OpenAirInterface is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
|
||||
OpenAirInterface is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenAirInterface.The full GNU General Public License is
|
||||
included in this distribution in the file called "COPYING". If not,
|
||||
see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Contact Information
|
||||
OpenAirInterface Admin: openair_admin@eurecom.fr
|
||||
OpenAirInterface Tech : openair_tech@eurecom.fr
|
||||
OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr
|
||||
|
||||
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
|
||||
|
||||
*******************************************************************************/
|
||||
/*________________________mac_vars.h________________________
|
||||
|
||||
Authors : Hicham Anouar, Raymond Knopp
|
||||
Company : EURECOM
|
||||
Emails : anouar@eurecom.fr, knopp@eurecom.fr
|
||||
________________________________________________________________*/
|
||||
|
||||
|
||||
/*! \file mac_vars.h
|
||||
* \brief generic mac interface variable definitions
|
||||
* \author R. Knopp
|
||||
* \version 1
|
||||
* \date March 2006
|
||||
* @ingroup macxface
|
||||
*/
|
||||
|
||||
#ifndef __MAC_INTERFACE_VARS_H__
|
||||
#define __MAC_INTERFACE_VARS_H__
|
||||
|
||||
#include "defs.h"
|
||||
|
||||
MAC_xface *mac_xface;
|
||||
|
||||
#endif //__MAC_INTERFACE_VARS_H__
|
||||
@@ -37,6 +37,7 @@
|
||||
#include "extern_3GPPinterleaver.h"
|
||||
#else
|
||||
#include "vars.h"
|
||||
#include <stdint.h>
|
||||
#endif
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
@@ -48,6 +49,7 @@
|
||||
#define print_shorts(s,x) printf("%s %x,%x,%x,%x,%x,%x,%x,%x\n",s,(x)[0],(x)[1],(x)[2],(x)[3],(x)[4],(x)[5],(x)[6],(x)[7])
|
||||
#define print_ints(s,x) printf("%s %x %x %x %x\n",s,(x)[0],(x)[1],(x)[2],(x)[3])
|
||||
|
||||
#define print_bytes2(s,x) printf("%s %x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x\n",s,(x)[0],(x)[1],(x)[2],(x)[3],(x)[4],(x)[5],(x)[6],(x)[7],(x)[8],(x)[9],(x)[10],(x)[11],(x)[12],(x)[13],(x)[14],(x)[15],(x)[16],(x)[17],(x)[18],(x)[19],(x)[20],(x)[21],(x)[22],(x)[23],(x)[24],(x)[25],(x)[26],(x)[27],(x)[28],(x)[29],(x)[30],(x)[31])
|
||||
|
||||
//#define DEBUG_TURBO_ENCODER 1
|
||||
#define CALLGRIND 1
|
||||
@@ -57,16 +59,12 @@ unsigned long long threegpplte_interleaver_tmp;
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
struct treillis {
|
||||
union {
|
||||
__m64 systematic_64[3];
|
||||
char systematic_8[24];
|
||||
};
|
||||
union {
|
||||
__m64 parity1_64[3];
|
||||
char parity1_8[24];
|
||||
__m64 systematic_andp1_64[3];
|
||||
uint8_t systematic_andp1_8[24];
|
||||
};
|
||||
union {
|
||||
__m64 parity2_64[3];
|
||||
char parity2_8[24];
|
||||
uint8_t parity2_8[24];
|
||||
};
|
||||
int exit_state;
|
||||
} __attribute__ ((aligned(64)));
|
||||
@@ -75,12 +73,8 @@ struct treillis {
|
||||
|
||||
struct treillis {
|
||||
union {
|
||||
uint8x8_t systematic_64[3];
|
||||
char systematic_8[24];
|
||||
}__attribute__((aligned(64)));
|
||||
union {
|
||||
uint8x8_t parity1_64[3];
|
||||
char parity1_8[24];
|
||||
uint8x8_t systematic_andp1_64[3];
|
||||
char systematic_andp1_8[24];
|
||||
}__attribute__((aligned(64)));
|
||||
union {
|
||||
uint8x8_t parity2_64[3];
|
||||
@@ -91,6 +85,7 @@ struct treillis {
|
||||
#endif
|
||||
|
||||
struct treillis all_treillis[8][256];
|
||||
|
||||
int all_treillis_initialized=0;
|
||||
|
||||
static inline unsigned char threegpplte_rsc(unsigned char input,unsigned char *state)
|
||||
@@ -116,18 +111,20 @@ void treillis_table_init(void)
|
||||
unsigned char v, current_state;
|
||||
|
||||
// clear all_treillis
|
||||
for (i=0; i<8; i++)
|
||||
for (i=0; i<8; i++) {
|
||||
bzero( all_treillis[i], sizeof(all_treillis[0]) );
|
||||
}
|
||||
|
||||
for (i=0; i<8; i++) { //all possible initial states
|
||||
for (j=0; j<=255; j++) { // all possible values of a byte
|
||||
current_state=i;
|
||||
|
||||
for (b=0; b<8 ; b++ ) { // pre-compute the image of the byte j in _m128i vector right place
|
||||
all_treillis[i][j].systematic_8[b*3]= (j&(1<<(7-b)))>>(7-b);
|
||||
v=threegpplte_rsc( all_treillis[i][j].systematic_8[b*3] ,
|
||||
all_treillis[i][j].systematic_andp1_8[b*3]= (j&(1<<(7-b)))>>(7-b);
|
||||
v=threegpplte_rsc( all_treillis[i][j].systematic_andp1_8[b*3] ,
|
||||
¤t_state);
|
||||
all_treillis[i][j].parity1_8[b*3+1]=v; // for the yparity1
|
||||
all_treillis[i][j].systematic_andp1_8[b*3+1]=v; // for the yparity1
|
||||
// all_treillis[i][j].parity1_8[b*3+1]=v; // for the yparity1
|
||||
all_treillis[i][j].parity2_8[b*3+2]=v; // for the yparity2
|
||||
}
|
||||
|
||||
@@ -143,9 +140,10 @@ void treillis_table_init(void)
|
||||
char interleave_compact_byte(short * base_interleaver,unsigned char * input, unsigned char * output, int n)
|
||||
{
|
||||
|
||||
char expandInput[768*8] __attribute__((aligned(16)));
|
||||
char expandInput[768*8] __attribute__((aligned(32)));
|
||||
int i,loop=n>>4;
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
#ifndef __AVX2__
|
||||
__m128i *i_128=(__m128i *)input, *o_128=(__m128i*)expandInput;
|
||||
__m128i tmp1, tmp2, tmp3, tmp4;
|
||||
__m128i BIT_MASK = _mm_set_epi8( 0b00000001,
|
||||
@@ -164,6 +162,43 @@ char interleave_compact_byte(short * base_interleaver,unsigned char * input, uns
|
||||
0b00100000,
|
||||
0b01000000,
|
||||
0b10000000);
|
||||
|
||||
#else
|
||||
__m256i *i_256=(__m256i *)input, *o_256=(__m256i*)expandInput;
|
||||
__m256i tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
|
||||
__m256i BIT_MASK = _mm256_set_epi8( 0b00000001,
|
||||
0b00000010,
|
||||
0b00000100,
|
||||
0b00001000,
|
||||
0b00010000,
|
||||
0b00100000,
|
||||
0b01000000,
|
||||
0b10000000,
|
||||
0b00000001,
|
||||
0b00000010,
|
||||
0b00000100,
|
||||
0b00001000,
|
||||
0b00010000,
|
||||
0b00100000,
|
||||
0b01000000,
|
||||
0b10000000,
|
||||
0b00000001,
|
||||
0b00000010,
|
||||
0b00000100,
|
||||
0b00001000,
|
||||
0b00010000,
|
||||
0b00100000,
|
||||
0b01000000,
|
||||
0b10000000,
|
||||
0b00000001,
|
||||
0b00000010,
|
||||
0b00000100,
|
||||
0b00001000,
|
||||
0b00010000,
|
||||
0b00100000,
|
||||
0b01000000,
|
||||
0b10000000);
|
||||
#endif
|
||||
#elif defined(__arm__)
|
||||
uint8x16_t *i_128=(uint8x16_t *)input, *o_128=(uint8x16_t *)expandInput;
|
||||
uint8x16_t tmp1,tmp2;
|
||||
@@ -187,46 +222,126 @@ char interleave_compact_byte(short * base_interleaver,unsigned char * input, uns
|
||||
0b00000010,
|
||||
0b00000001};
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef __AVX2__
|
||||
if ((n&15) > 0)
|
||||
loop++;
|
||||
#else
|
||||
loop=n>>5;
|
||||
if ((n&31) > 0)
|
||||
loop++;
|
||||
#endif
|
||||
|
||||
|
||||
for (i=0; i<loop ; i++ ) {
|
||||
/* int cur_byte=i<<3; */
|
||||
/* for (b=0;b<8;b++) */
|
||||
/* expandInput[cur_byte+b] = (input[i]&(1<<(7-b)))>>(7-b); */
|
||||
// int cur_byte=i<<3;
|
||||
// for (b=0;b<8;b++)
|
||||
// expandInput[cur_byte+b] = (input[i]&(1<<(7-b)))>>(7-b);
|
||||
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
tmp1=_mm_load_si128(i_128++);
|
||||
tmp2=_mm_unpacklo_epi8(tmp1,tmp1);
|
||||
tmp3=_mm_unpacklo_epi16(tmp2,tmp2);
|
||||
tmp4=_mm_unpacklo_epi32(tmp3,tmp3);
|
||||
#ifndef __AVX2__
|
||||
tmp1=_mm_load_si128(i_128++); // tmp1 = B0,B1,...,B15
|
||||
tmp2=_mm_unpacklo_epi8(tmp1,tmp1); // tmp2 = B0,B0,B1,B1,...,B7,B7
|
||||
tmp3=_mm_unpacklo_epi16(tmp2,tmp2); // tmp3 = B0,B0,B0,B0,B1,B1,B1,B1,B2,B2,B2,B2,B3,B3,B3,B3
|
||||
tmp4=_mm_unpacklo_epi32(tmp3,tmp3); // tmp4 - B0,B0,B0,B0,B0,B0,B0,B0,B1,B1,B1,B1,B1,B1,B1,B1
|
||||
*o_128++=_mm_cmpeq_epi8(_mm_and_si128(tmp4,BIT_MASK),BIT_MASK);
|
||||
|
||||
tmp4=_mm_unpackhi_epi32(tmp3,tmp3);
|
||||
tmp4=_mm_unpackhi_epi32(tmp3,tmp3); // tmp4 - B2,B2,B2,B2,B2,B2,B2,B2,B3,B3,B3,B3,B3,B3,B3,B3
|
||||
*o_128++=_mm_cmpeq_epi8(_mm_and_si128(tmp4,BIT_MASK),BIT_MASK);;
|
||||
|
||||
tmp3=_mm_unpackhi_epi16(tmp2,tmp2);
|
||||
tmp4=_mm_unpacklo_epi32(tmp3,tmp3);
|
||||
tmp3=_mm_unpackhi_epi16(tmp2,tmp2); // tmp3 = B4,B4,B4,B4,B5,B5,B5,B5,B6,B6,B6,B6,B7,B7,B7,B7
|
||||
tmp4=_mm_unpacklo_epi32(tmp3,tmp3); // tmp4 - B4,B4,B4,B4,B4,B4,B4,B4,B5,B5,B5,B5,B5,B5,B5,B5
|
||||
*o_128++=_mm_cmpeq_epi8(_mm_and_si128(tmp4,BIT_MASK),BIT_MASK);;
|
||||
|
||||
tmp4=_mm_unpackhi_epi32(tmp3,tmp3);
|
||||
tmp4=_mm_unpackhi_epi32(tmp3,tmp3); // tmp4 - B6,B6,B6,B6,B6,B6,B6,B6,B7,B7,B7,B7,B7,B7,B7,B7
|
||||
*o_128++=_mm_cmpeq_epi8(_mm_and_si128(tmp4,BIT_MASK),BIT_MASK);;
|
||||
|
||||
tmp2=_mm_unpackhi_epi8(tmp1,tmp1);
|
||||
tmp3=_mm_unpacklo_epi16(tmp2,tmp2);
|
||||
tmp4=_mm_unpacklo_epi32(tmp3,tmp3);
|
||||
tmp2=_mm_unpackhi_epi8(tmp1,tmp1); // tmp2 = B8,B8,B9,B9,...,B15,B15
|
||||
tmp3=_mm_unpacklo_epi16(tmp2,tmp2); // tmp3 = B8,B8,B8,B8,B9,B9,B9,B9,B10,B10,B10,B10,B11,B11,B11,B11
|
||||
tmp4=_mm_unpacklo_epi32(tmp3,tmp3); // tmp4 = B8,B8,B8,B8,B8,B8,B8,B8,B9,B9,B9,B9,B9,B9,B9,B9
|
||||
*o_128++=_mm_cmpeq_epi8(_mm_and_si128(tmp4,BIT_MASK),BIT_MASK);;
|
||||
|
||||
tmp4=_mm_unpackhi_epi32(tmp3,tmp3);
|
||||
tmp4=_mm_unpackhi_epi32(tmp3,tmp3); // tmp4 = B10,B10,B10,B10,B10,B10,B10,B10,B11,B11,B11,B11,B11,B11,B11,B11
|
||||
*o_128++=_mm_cmpeq_epi8(_mm_and_si128(tmp4,BIT_MASK),BIT_MASK);;
|
||||
|
||||
tmp3=_mm_unpackhi_epi16(tmp2,tmp2);
|
||||
tmp4=_mm_unpacklo_epi32(tmp3,tmp3);
|
||||
tmp3=_mm_unpackhi_epi16(tmp2,tmp2); // tmp3 = B12,B12,B12,B12,B13,B13,B13,B13,B14,B14,B14,B14,B15,B15,B15,B15
|
||||
tmp4=_mm_unpacklo_epi32(tmp3,tmp3); // tmp4 = B12,B12,B12,B12,B12,B12,B12,B12,B13,B13,B13,B13,B13,B13,B13,B13
|
||||
*o_128++=_mm_cmpeq_epi8(_mm_and_si128(tmp4,BIT_MASK),BIT_MASK);;
|
||||
|
||||
tmp4=_mm_unpackhi_epi32(tmp3,tmp3);
|
||||
tmp4=_mm_unpackhi_epi32(tmp3,tmp3); // tmp4 = B14,B14,B14,B14,B14,B14,B14,B14,B15,B15,B15,B15,B15,B15,B15,B15
|
||||
*o_128++=_mm_cmpeq_epi8(_mm_and_si128(tmp4,BIT_MASK),BIT_MASK);;
|
||||
#else
|
||||
tmp1=_mm256_load_si256(i_256++); // tmp1 = B0,B1,...,B15,...,B31
|
||||
//print_bytes2("in",(uint8_t*)&tmp1);
|
||||
tmp2=_mm256_unpacklo_epi8(tmp1,tmp1); // tmp2 = B0,B0,B1,B1,...,B7,B7,B16,B16,B17,B17,...,B23,B23
|
||||
tmp3=_mm256_unpacklo_epi16(tmp2,tmp2); // tmp3 = B0,B0,B0,B0,B1,B1,B1,B1,B2,B2,B2,B2,B3,B3,B3,B3,B16,B16,B16,B16,...,B19,B19,B19,B19
|
||||
tmp4=_mm256_unpacklo_epi32(tmp3,tmp3); // tmp4 - B0,B0,B0,B0,B0,B0,B0,B0,B1,B1,B1,B1,B1,B1,B1,B1,B16,B16...,B17..,B17
|
||||
tmp5=_mm256_unpackhi_epi32(tmp3,tmp3); // tmp5 - B2,B2,B2,B2,B2,B2,B2,B2,B3,B3,B3,B3,B3,B3,B3,B3,B18...,B18,B19,...,B19
|
||||
tmp6=_mm256_insertf128_si256(tmp4,_mm256_extracti128_si256(tmp5,0),1); // tmp6 = B0 B1 B2 B3
|
||||
tmp7=_mm256_insertf128_si256(tmp5,_mm256_extracti128_si256(tmp4,1),0); // tmp7 = B16 B17 B18 B19
|
||||
//print_bytes2("tmp2",(uint8_t*)&tmp2);
|
||||
//print_bytes2("tmp3",(uint8_t*)&tmp3);
|
||||
//print_bytes2("tmp4",(uint8_t*)&tmp4);
|
||||
//print_bytes2("tmp5",(uint8_t*)&tmp4);
|
||||
//print_bytes2("tmp6",(uint8_t*)&tmp6);
|
||||
//print_bytes2("tmp7",(uint8_t*)&tmp7);
|
||||
o_256[0]=_mm256_cmpeq_epi8(_mm256_and_si256(tmp6,BIT_MASK),BIT_MASK);
|
||||
//print_bytes2("out",(uint8_t*)o_256);
|
||||
o_256[4]=_mm256_cmpeq_epi8(_mm256_and_si256(tmp7,BIT_MASK),BIT_MASK);;
|
||||
//print_bytes2("out",(uint8_t*)(o_256+4));
|
||||
|
||||
tmp3=_mm256_unpackhi_epi16(tmp2,tmp2); // tmp3 = B4,B4,B4,B4,B5,B5,B5,B5,B6,B6,B6,B6,B7,B7,B7,B7,B20,B20,B20,B20,...,B23,B23,B23,B23
|
||||
tmp4=_mm256_unpacklo_epi32(tmp3,tmp3); // tmp4 - B4,B4,B4,B4,B4,B4,B4,B4,B5,B5,B5,B5,B5,B5,B5,B5,B20,B20...,B21..,B21
|
||||
tmp5=_mm256_unpackhi_epi32(tmp3,tmp3); // tmp5 - B6,B6,B6,B6,B6,B6,B6,B6,B7,B7,B7,B7,B7,B7,B7,B7,B22...,B22,B23,...,B23
|
||||
tmp6=_mm256_insertf128_si256(tmp4,_mm256_extracti128_si256(tmp5,0),1); // tmp6 = B4 B5 B6 B7
|
||||
tmp7=_mm256_insertf128_si256(tmp5,_mm256_extracti128_si256(tmp4,1),0); // tmp7 = B20 B21 B22 B23
|
||||
//print_bytes2("tmp2",(uint8_t*)&tmp2);
|
||||
//print_bytes2("tmp3",(uint8_t*)&tmp3);
|
||||
//print_bytes2("tmp4",(uint8_t*)&tmp4);
|
||||
//print_bytes2("tmp5",(uint8_t*)&tmp4);
|
||||
//print_bytes2("tmp6",(uint8_t*)&tmp6);
|
||||
//print_bytes2("tmp7",(uint8_t*)&tmp7);
|
||||
o_256[1]=_mm256_cmpeq_epi8(_mm256_and_si256(tmp6,BIT_MASK),BIT_MASK);
|
||||
//print_bytes2("out",(uint8_t*)(o_256+1));
|
||||
o_256[5]=_mm256_cmpeq_epi8(_mm256_and_si256(tmp7,BIT_MASK),BIT_MASK);;
|
||||
//print_bytes2("out",(uint8_t*)(o_256+4));
|
||||
|
||||
tmp2=_mm256_unpackhi_epi8(tmp1,tmp1); // tmp2 = B8 B9 B10 B11 B12 B13 B14 B15 B25 B26 B27 B28 B29 B30 B31
|
||||
tmp3=_mm256_unpacklo_epi16(tmp2,tmp2); // tmp3 = B8,B9,B10,B11,B26,B27,B28,B29
|
||||
tmp4=_mm256_unpacklo_epi32(tmp3,tmp3); // tmp4 - B8,B9,B26,B27
|
||||
tmp5=_mm256_unpackhi_epi32(tmp3,tmp3); // tmp5 - B10,B11,B28,B29
|
||||
tmp6=_mm256_insertf128_si256(tmp4,_mm256_extracti128_si256(tmp5,0),1); // tmp6 = B8 B9 B10 B11
|
||||
tmp7=_mm256_insertf128_si256(tmp5,_mm256_extracti128_si256(tmp4,1),0); // tmp7 = B26 B27 B28 B29
|
||||
//print_bytes2("tmp2",(uint8_t*)&tmp2);
|
||||
//print_bytes2("tmp3",(uint8_t*)&tmp3);
|
||||
//print_bytes2("tmp4",(uint8_t*)&tmp4);
|
||||
//print_bytes2("tmp5",(uint8_t*)&tmp4);
|
||||
//print_bytes2("tmp6",(uint8_t*)&tmp6);
|
||||
//print_bytes2("tmp7",(uint8_t*)&tmp7);
|
||||
o_256[2]=_mm256_cmpeq_epi8(_mm256_and_si256(tmp6,BIT_MASK),BIT_MASK);
|
||||
//print_bytes2("out",(uint8_t*)(o_256+2));
|
||||
o_256[6]=_mm256_cmpeq_epi8(_mm256_and_si256(tmp7,BIT_MASK),BIT_MASK);;
|
||||
//print_bytes2("out",(uint8_t*)(o_256+4));
|
||||
|
||||
tmp3=_mm256_unpackhi_epi16(tmp2,tmp2); // tmp3 = B12 B13 B14 B15 B28 B29 B30 B31
|
||||
tmp4=_mm256_unpacklo_epi32(tmp3,tmp3); // tmp4 = B12 B13 B28 B29
|
||||
tmp5=_mm256_unpackhi_epi32(tmp3,tmp3); // tmp5 = B14 B15 B30 B31
|
||||
tmp6=_mm256_insertf128_si256(tmp4,_mm256_extracti128_si256(tmp5,0),1); // tmp6 = B12 B13 B14 B15
|
||||
tmp7=_mm256_insertf128_si256(tmp5,_mm256_extracti128_si256(tmp4,1),0); // tmp7 = B28 B29 B30 B31
|
||||
//print_bytes2("tmp2",(uint8_t*)&tmp2);
|
||||
//print_bytes2("tmp3",(uint8_t*)&tmp3);
|
||||
//print_bytes2("tmp4",(uint8_t*)&tmp4);
|
||||
//print_bytes2("tmp5",(uint8_t*)&tmp4);
|
||||
//print_bytes2("tmp6",(uint8_t*)&tmp6);
|
||||
//print_bytes2("tmp7",(uint8_t*)&tmp7);
|
||||
o_256[3]=_mm256_cmpeq_epi8(_mm256_and_si256(tmp6,BIT_MASK),BIT_MASK);
|
||||
//print_bytes2("out",(uint8_t*)(o_256+3));
|
||||
o_256[7]=_mm256_cmpeq_epi8(_mm256_and_si256(tmp7,BIT_MASK),BIT_MASK);;
|
||||
//print_bytes2("out",(uint8_t*)(o_256+7));
|
||||
|
||||
o_256+=8;
|
||||
#endif
|
||||
#elif defined(__arm__)
|
||||
tmp1=vld1q_u8((uint8_t*)i_128);
|
||||
//print_bytes("tmp1:",(uint8_t*)&tmp1);
|
||||
@@ -302,11 +417,17 @@ char interleave_compact_byte(short * base_interleaver,unsigned char * input, uns
|
||||
i_128++;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
short * ptr_intl=base_interleaver;
|
||||
#if defined(__x86_64) || defined(__i386__)
|
||||
#ifndef __AVX2__
|
||||
__m128i tmp;
|
||||
uint16_t *systematic2_ptr=(unsigned short *) output;
|
||||
uint16_t *systematic2_ptr=(uint16_t *) output;
|
||||
#else
|
||||
__m256i tmp;
|
||||
uint32_t *systematic2_ptr=(uint32_t *) output;
|
||||
#endif
|
||||
#elif defined(__arm__)
|
||||
uint8x16_t tmp;
|
||||
const uint8_t __attribute__ ((aligned (16))) _Powers[16]=
|
||||
@@ -316,11 +437,15 @@ char interleave_compact_byte(short * base_interleaver,unsigned char * input, uns
|
||||
uint8x16_t Powers= vld1q_u8(_Powers);
|
||||
uint8_t *systematic2_ptr=(uint8_t *) output;
|
||||
#endif
|
||||
#ifndef __AVX2__
|
||||
int input_length_words=n>>1;
|
||||
|
||||
#else
|
||||
int input_length_words=n>>2;
|
||||
#endif
|
||||
for ( i=0; i< input_length_words ; i ++ ) {
|
||||
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
#ifndef __AVX2__
|
||||
tmp=_mm_insert_epi8(tmp,expandInput[*ptr_intl++],7);
|
||||
tmp=_mm_insert_epi8(tmp,expandInput[*ptr_intl++],6);
|
||||
tmp=_mm_insert_epi8(tmp,expandInput[*ptr_intl++],5);
|
||||
@@ -338,6 +463,45 @@ char interleave_compact_byte(short * base_interleaver,unsigned char * input, uns
|
||||
tmp=_mm_insert_epi8(tmp,expandInput[*ptr_intl++],8+1);
|
||||
tmp=_mm_insert_epi8(tmp,expandInput[*ptr_intl++],8+0);
|
||||
*systematic2_ptr++=(unsigned short)_mm_movemask_epi8(tmp);
|
||||
#else
|
||||
tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],7);
|
||||
tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],6);
|
||||
tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],5);
|
||||
tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],4);
|
||||
tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],3);
|
||||
tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],2);
|
||||
tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],1);
|
||||
tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],0);
|
||||
|
||||
tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],8+7);
|
||||
tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],8+6);
|
||||
tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],8+5);
|
||||
tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],8+4);
|
||||
tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],8+3);
|
||||
tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],8+2);
|
||||
tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],8+1);
|
||||
tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],8+0);
|
||||
|
||||
tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],16+7);
|
||||
tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],16+6);
|
||||
tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],16+5);
|
||||
tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],16+4);
|
||||
tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],16+3);
|
||||
tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],16+2);
|
||||
tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],16+1);
|
||||
tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],16+0);
|
||||
|
||||
tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],24+7);
|
||||
tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],24+6);
|
||||
tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],24+5);
|
||||
tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],24+4);
|
||||
tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],24+3);
|
||||
tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],24+2);
|
||||
tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],24+1);
|
||||
tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],24+0);
|
||||
|
||||
*systematic2_ptr++=(unsigned int)_mm256_movemask_epi8(tmp);
|
||||
#endif
|
||||
#elif defined(__arm__)
|
||||
tmp=vsetq_lane_u8(expandInput[*ptr_intl++],tmp,7);
|
||||
tmp=vsetq_lane_u8(expandInput[*ptr_intl++],tmp,6);
|
||||
@@ -391,8 +555,9 @@ void threegpplte_turbo_encoder(unsigned char *input,
|
||||
unsigned short input_length_bits = input_length_bytes<<3;
|
||||
short * base_interleaver;
|
||||
|
||||
if ( all_treillis_initialized == 0 )
|
||||
if ( all_treillis_initialized == 0 ) {
|
||||
treillis_table_init();
|
||||
}
|
||||
|
||||
// look for f1 and f2 precomputed interleaver values
|
||||
for (i=0; i < 188 && f1f2mat[i].nb_bits != input_length_bits; i++);
|
||||
@@ -405,7 +570,7 @@ void threegpplte_turbo_encoder(unsigned char *input,
|
||||
}
|
||||
|
||||
|
||||
unsigned char systematic2[768];
|
||||
unsigned char systematic2[768] __attribute__((aligned(32)));
|
||||
interleave_compact_byte(base_interleaver,input,systematic2,input_length_bytes);
|
||||
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
@@ -419,22 +584,26 @@ void threegpplte_turbo_encoder(unsigned char *input,
|
||||
for ( state0=state1=i=0 ; i<input_length_bytes; i++ ) {
|
||||
cur_s1=input[i];
|
||||
cur_s2=systematic2[i];
|
||||
|
||||
|
||||
for ( code_rate=0; code_rate<3; code_rate++) {
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
*ptr_output++ = _mm_add_pi8(all_treillis[state0][cur_s1].systematic_64[code_rate],
|
||||
_mm_add_pi8(all_treillis[state0][cur_s1].parity1_64[code_rate],
|
||||
all_treillis[state1][cur_s2].parity2_64[code_rate]));
|
||||
/*
|
||||
*ptr_output++ = _mm_add_pi8(all_treillis[state0][cur_s1].systematic_64[code_rate],
|
||||
_mm_add_pi8(all_treillis[state0][cur_s1].parity1_64[code_rate],
|
||||
all_treillis[state1][cur_s2].parity2_64[code_rate]));
|
||||
*/
|
||||
*ptr_output++ = _mm_add_pi8(all_treillis[state0][cur_s1].systematic_andp1_64[code_rate],
|
||||
all_treillis[state1][cur_s2].parity2_64[code_rate]);
|
||||
|
||||
|
||||
#elif defined(__arm__)
|
||||
uint8x8_t ptmp = vadd_u8(all_treillis[state0][cur_s1].parity1_64[code_rate],
|
||||
all_treillis[state1][cur_s2].parity2_64[code_rate]);
|
||||
*ptr_output++ = vadd_u8(all_treillis[state0][cur_s1].systematic_64[code_rate],
|
||||
ptmp);
|
||||
*ptr_output++ = vadd_u8(all_treillis[state0][cur_s1].systematic_andp1_64[code_rate],
|
||||
all_treillis[state0][cur_s1].parity2_64[code_rate]);
|
||||
#endif
|
||||
}
|
||||
|
||||
state0=all_treillis[state0][cur_s1].exit_state;
|
||||
state1=all_treillis[state1][cur_s2].exit_state;
|
||||
}
|
||||
|
||||
state0=all_treillis[state0][cur_s1].exit_state;
|
||||
state1=all_treillis[state1][cur_s2].exit_state;
|
||||
}
|
||||
|
||||
x=output+(input_length_bits*3);
|
||||
@@ -485,7 +654,7 @@ void threegpplte_turbo_encoder(unsigned char *input,
|
||||
int main(int argc,char **argv)
|
||||
{
|
||||
|
||||
unsigned char input[INPUT_LENGTH+16],state,state2;
|
||||
unsigned char input[INPUT_LENGTH+32],state,state2;
|
||||
unsigned char output[12+(3*(INPUT_LENGTH<<3))],x,z;
|
||||
int i;
|
||||
unsigned char out;
|
||||
@@ -510,7 +679,7 @@ int main(int argc,char **argv)
|
||||
memset((void*)input,0,INPUT_LENGTH+16);
|
||||
for (i=0; i<INPUT_LENGTH; i++) {
|
||||
input[i] = i*219;
|
||||
printf("Input %d : %x\n",i,input[i]);
|
||||
printf("Input %d : %d\n",i,input[i]);
|
||||
}
|
||||
|
||||
threegpplte_turbo_encoder(&input[0],
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -63,11 +63,17 @@
|
||||
#include "mex.h"
|
||||
#endif
|
||||
|
||||
|
||||
#define print_shorts(s,x) printf("%s %d,%d,%d,%d,%d,%d,%d,%d\n",s,(x)[0],(x)[1],(x)[2],(x)[3],(x)[4],(x)[5],(x)[6],(x)[7])
|
||||
|
||||
//#define DEBUG_LOGMAP
|
||||
|
||||
#ifdef DEBUG_LOGMAP
|
||||
#define print_shorts(s,x) fprintf(fdsse4,"%s %d,%d,%d,%d,%d,%d,%d,%d\n",s,(x)[0],(x)[1],(x)[2],(x)[3],(x)[4],(x)[5],(x)[6],(x)[7])
|
||||
#endif
|
||||
|
||||
#undef __AVX2__
|
||||
|
||||
#ifdef DEBUG_LOGMAP
|
||||
FILE *fdsse4;
|
||||
#endif
|
||||
|
||||
typedef int16_t llr_t; // internal decoder LLR data is 16-bit fixed
|
||||
typedef int16_t channel_t;
|
||||
@@ -99,7 +105,7 @@ void log_map16(llr_t* systematic,
|
||||
{
|
||||
|
||||
#ifdef DEBUG_LOGMAP
|
||||
msg("log_map, frame_length %d\n",frame_length);
|
||||
fprintf(fdsse4,"log_map, frame_length %d\n",frame_length);
|
||||
#endif
|
||||
|
||||
start_meas(gamma_stats) ;
|
||||
@@ -135,22 +141,35 @@ void compute_gamma16(llr_t* m11,llr_t* m10,llr_t* systematic,channel_t* y_parity
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG_LOGMAP
|
||||
msg("compute_gamma, %p,%p,%p,%p,framelength %d\n",m11,m10,systematic,y_parity,frame_length);
|
||||
fprintf(fdsse4,"compute_gamma (sse_16bit), %p,%p,%p,%p,framelength %d\n",m11,m10,systematic,y_parity,frame_length);
|
||||
#endif
|
||||
|
||||
#ifndef __AVX2__
|
||||
K1=frame_length>>3;
|
||||
#else
|
||||
if ((frame_length&15) > 0)
|
||||
K1=(frame_length+1)>>4;
|
||||
else
|
||||
K1=frame_length>>4;
|
||||
#endif
|
||||
|
||||
for (k=0; k<K1; k++) {
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
#ifndef __AVX2__
|
||||
m11_128[k] = _mm_srai_epi16(_mm_adds_epi16(systematic128[k],y_parity128[k]),1);
|
||||
m10_128[k] = _mm_srai_epi16(_mm_subs_epi16(systematic128[k],y_parity128[k]),1);
|
||||
#else
|
||||
((__m256i*)m11_128)[k] = _mm256_srai_epi16(_mm256_adds_epi16(((__m256i*)systematic128)[k],((__m256i*)y_parity128)[k]),1);
|
||||
// ((__m256i*)m10_128)[k] = _mm256_srai_epi16(_mm256_subs_epi16(((__m256i*)y_parity128)[k],((__m256i*)systematic128)[k]),1);
|
||||
((__m256i*)m10_128)[k] = _mm256_srai_epi16(_mm256_subs_epi16(((__m256i*)systematic128)[k],((__m256i*)y_parity128)[k]),1);
|
||||
#endif
|
||||
#elif defined(__arm__)
|
||||
m11_128[k] = vhaddq_s16(systematic128[k],y_parity128[k]);
|
||||
m10_128[k] = vhsubq_s16(systematic128[k],y_parity128[k]);
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG_LOGMAP
|
||||
printf("Loop index k, m11,m10\n");
|
||||
fprintf(fdsse4,"Loop index k %d\n", k);
|
||||
print_shorts("sys",(int16_t*)&systematic128[k]);
|
||||
print_shorts("yp",(int16_t*)&y_parity128[k]);
|
||||
print_shorts("m11",(int16_t*)&m11_128[k]);
|
||||
@@ -158,14 +177,28 @@ void compute_gamma16(llr_t* m11,llr_t* m10,llr_t* systematic,channel_t* y_parity
|
||||
#endif
|
||||
}
|
||||
|
||||
k=frame_length>>3;
|
||||
// Termination
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
m11_128[k] = _mm_srai_epi16(_mm_adds_epi16(systematic128[k+term_flag],y_parity128[k]),1);
|
||||
//#ifndef __AVX2__
|
||||
#if 1
|
||||
m10_128[k] = _mm_srai_epi16(_mm_subs_epi16(systematic128[k+term_flag],y_parity128[k]),1);
|
||||
#else
|
||||
m10_128[k] = _mm_srai_epi16(_mm_subs_epi16(y_parity128[k],systematic128[k+term_flag]),1);
|
||||
#endif
|
||||
#elif defined(__arm__)
|
||||
m11_128[k] = vhaddq_s16(systematic128[k+term_flag],y_parity128[k]);
|
||||
m10_128[k] = vhsubq_s16(systematic128[k+term_flag],y_parity128[k]);
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG_LOGMAP
|
||||
fprintf(fdsse4,"Loop index k %d (term flag %d)\n", k,term_flag);
|
||||
print_shorts("sys",(int16_t*)&systematic128[k]);
|
||||
print_shorts("yp",(int16_t*)&y_parity128[k]);
|
||||
print_shorts("m11",(int16_t*)&m11_128[k]);
|
||||
print_shorts("m10",(int16_t*)&m10_128[k]);
|
||||
#endif
|
||||
}
|
||||
|
||||
#define L 40
|
||||
@@ -174,11 +207,21 @@ void compute_alpha16(llr_t* alpha,llr_t* beta,llr_t* m_11,llr_t* m_10,unsigned s
|
||||
{
|
||||
int k,l,l2,K1,rerun_flag=0;
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
__m128i *alpha128=(__m128i *)alpha,*alpha_ptr;
|
||||
__m128i a0,a1,a2,a3,a4,a5,a6,a7,*m11p,*m10p;
|
||||
__m128i *alpha128=(__m128i *)alpha,*alpha_ptr,*m11p,*m10p;
|
||||
//#ifndef __AVX2__
|
||||
#if 1
|
||||
__m128i a0,a1,a2,a3,a4,a5,a6,a7;
|
||||
__m128i m_b0,m_b1,m_b2,m_b3,m_b4,m_b5,m_b6,m_b7;
|
||||
__m128i new0,new1,new2,new3,new4,new5,new6,new7;
|
||||
__m128i alpha_max;
|
||||
#else
|
||||
__m256i *alpha256=(__m256i *)alpha,*alpha_ptr256,m11,m10;
|
||||
__m256i a01,a23,a45,a67,a02,a13,a64,a75;
|
||||
__m256i m_b01,m_b23,m_b45,m_b67,new01,new23,new45,new67;
|
||||
__m256i m11m10_256;
|
||||
__m256i alpha_max;
|
||||
#endif
|
||||
|
||||
#elif defined(__arm__)
|
||||
int16x8_t *alpha128=(int16x8_t *)alpha,*alpha_ptr;
|
||||
int16x8_t a0,a1,a2,a3,a4,a5,a6,a7,*m11p,*m10p;
|
||||
@@ -188,10 +231,16 @@ void compute_alpha16(llr_t* alpha,llr_t* beta,llr_t* m_11,llr_t* m_10,unsigned s
|
||||
#endif
|
||||
l2 = L>>3;
|
||||
K1 = (frame_length>>3);
|
||||
|
||||
#ifdef DEBUG_LOGMAP
|
||||
fprintf(fdsse4,"compute_alpha (sse_16bit)\n");
|
||||
#endif
|
||||
for (l=K1;; l=l2,rerun_flag=1) {
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
alpha128 = (__m128i *)alpha;
|
||||
//#ifdef __AVX2__
|
||||
#if 0
|
||||
alpha256 = (__m256i *)alpha;
|
||||
#endif
|
||||
#elif defined(__arm__)
|
||||
alpha128 = (int16x8_t *)alpha;
|
||||
#endif
|
||||
@@ -218,7 +267,7 @@ void compute_alpha16(llr_t* alpha,llr_t* beta,llr_t* m_11,llr_t* m_10,unsigned s
|
||||
alpha128[7] = vdupq_n_s16(-MAX/2);
|
||||
#endif
|
||||
#ifdef DEBUG_LOGMAP
|
||||
printf("Initial alpha\n");
|
||||
fprintf(fdsse4,"Initial alpha\n");
|
||||
print_shorts("a0",(int16_t*)&alpha128[0]);
|
||||
print_shorts("a1",(int16_t*)&alpha128[1]);
|
||||
print_shorts("a2",(int16_t*)&alpha128[2]);
|
||||
@@ -258,7 +307,7 @@ void compute_alpha16(llr_t* alpha,llr_t* beta,llr_t* m_11,llr_t* m_10,unsigned s
|
||||
alpha[48] = -MAX/2;
|
||||
alpha[56] = -MAX/2;
|
||||
#ifdef DEBUG_LOGMAP
|
||||
printf("Second run\n");
|
||||
fprintf(fdsse4,"Second run\n");
|
||||
print_shorts("a0",(int16_t*)&alpha128[0]);
|
||||
print_shorts("a1",(int16_t*)&alpha128[1]);
|
||||
print_shorts("a2",(int16_t*)&alpha128[2]);
|
||||
@@ -272,6 +321,11 @@ void compute_alpha16(llr_t* alpha,llr_t* beta,llr_t* m_11,llr_t* m_10,unsigned s
|
||||
}
|
||||
|
||||
alpha_ptr = &alpha128[0];
|
||||
//#ifdef __AVX2__
|
||||
#if 0
|
||||
alpha_ptr256 = &alpha256[0];
|
||||
#endif
|
||||
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
m11p = (__m128i*)m_11;
|
||||
m10p = (__m128i*)m_10;
|
||||
@@ -284,6 +338,8 @@ void compute_alpha16(llr_t* alpha,llr_t* beta,llr_t* m_11,llr_t* m_10,unsigned s
|
||||
k++) {
|
||||
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
//#ifndef __AVX2__
|
||||
#if 1
|
||||
a1=_mm_load_si128(&alpha_ptr[1]);
|
||||
a3=_mm_load_si128(&alpha_ptr[3]);
|
||||
a5=_mm_load_si128(&alpha_ptr[5]);
|
||||
@@ -328,6 +384,37 @@ void compute_alpha16(llr_t* alpha,llr_t* beta,llr_t* m_11,llr_t* m_10,unsigned s
|
||||
alpha_max = _mm_max_epi16(alpha_max,a5);
|
||||
alpha_max = _mm_max_epi16(alpha_max,a6);
|
||||
alpha_max = _mm_max_epi16(alpha_max,a7);
|
||||
#else
|
||||
a02=_mm256_load_si256(&alpha_ptr256[0]);
|
||||
a13=_mm256_load_si256(&alpha_ptr256[1]);
|
||||
a64=_mm256_load_si256(&alpha_ptr256[2]);
|
||||
a75=_mm256_load_si256(&alpha_ptr256[3]);
|
||||
m11m10_256 = _mm256_insertf128_si256(m11m10_256,*m11p,0);
|
||||
m11m10_256 = _mm256_insertf128_si256(m11m10_256,*m10p,1);
|
||||
|
||||
|
||||
m_b01 = _mm256_adds_epi16(a13,m11m10_256); //negative m10
|
||||
m_b23 = _mm256_subs_epi16(a75,m11m10_256); //negative m10
|
||||
m_b45 = _mm256_subs_epi16(a13,m11m10_256); //negative m10
|
||||
m_b67 = _mm256_adds_epi16(a75,m11m10_256); //negative m10
|
||||
|
||||
new01 = _mm256_subs_epi16(a02,m11m10_256); //negative m10
|
||||
new23 = _mm256_adds_epi16(a64,m11m10_256); //negative m10
|
||||
new45 = _mm256_adds_epi16(a02,m11m10_256); //negative m10
|
||||
new67 = _mm256_subs_epi16(a64,m11m10_256); //negative m10
|
||||
|
||||
a01 = _mm256_max_epi16(m_b01,new01);
|
||||
a23 = _mm256_max_epi16(m_b23,new23);
|
||||
a45 = _mm256_max_epi16(m_b45,new45);
|
||||
a67 = _mm256_max_epi16(m_b67,new67);
|
||||
|
||||
alpha_max = _mm256_max_epi16(a01,a23);
|
||||
alpha_max = _mm256_max_epi16(alpha_max,a45);
|
||||
alpha_max = _mm256_max_epi16(alpha_max,a67);
|
||||
alpha_max = _mm256_max_epi16(alpha_max,_mm256_permutevar8x32_epi32(alpha_max,_mm256_set_epi32(3,2,1,0,7,6,5,4)));
|
||||
|
||||
|
||||
#endif
|
||||
#elif defined(__arm__)
|
||||
m_b0 = vqaddq_s16(alpha_ptr[1],*m11p); // m11
|
||||
m_b4 = vqsubq_s16(alpha_ptr[1],*m11p); // m00=-m11
|
||||
@@ -367,9 +454,15 @@ void compute_alpha16(llr_t* alpha,llr_t* beta,llr_t* m_11,llr_t* m_10,unsigned s
|
||||
#endif
|
||||
|
||||
alpha_ptr+=8;
|
||||
//#ifdef __AVX2__
|
||||
#if 0
|
||||
alpha_ptr256+=4;
|
||||
#endif
|
||||
m11p++;
|
||||
m10p++;
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
//#ifndef __AVX2__
|
||||
#if 1
|
||||
alpha_ptr[0] = _mm_subs_epi16(a0,alpha_max);
|
||||
alpha_ptr[1] = _mm_subs_epi16(a1,alpha_max);
|
||||
alpha_ptr[2] = _mm_subs_epi16(a2,alpha_max);
|
||||
@@ -378,6 +471,18 @@ void compute_alpha16(llr_t* alpha,llr_t* beta,llr_t* m_11,llr_t* m_10,unsigned s
|
||||
alpha_ptr[5] = _mm_subs_epi16(a5,alpha_max);
|
||||
alpha_ptr[6] = _mm_subs_epi16(a6,alpha_max);
|
||||
alpha_ptr[7] = _mm_subs_epi16(a7,alpha_max);
|
||||
#else
|
||||
|
||||
a01 = _mm256_subs_epi16(a01,alpha_max);
|
||||
a23 = _mm256_subs_epi16(a23,alpha_max);
|
||||
a45 = _mm256_subs_epi16(a45,alpha_max);
|
||||
a67 = _mm256_subs_epi16(a67,alpha_max);
|
||||
|
||||
alpha_ptr256[0] = _mm256_permute2x128_si256(a01,a23,0x20); //a02
|
||||
alpha_ptr256[1] = _mm256_permute2x128_si256(a01,a23,0x13); //a13
|
||||
alpha_ptr256[2] = _mm256_permute2x128_si256(a45,a67,0x02); //a64
|
||||
alpha_ptr256[3] = _mm256_permute2x128_si256(a45,a67,0x31); //a75
|
||||
#endif
|
||||
#elif defined(__arm__)
|
||||
alpha_ptr[0] = vqsubq_s16(a0,alpha_max);
|
||||
alpha_ptr[1] = vqsubq_s16(a1,alpha_max);
|
||||
@@ -390,7 +495,7 @@ void compute_alpha16(llr_t* alpha,llr_t* beta,llr_t* m_11,llr_t* m_10,unsigned s
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG_LOGMAP
|
||||
printf("Loop index %d, mb\n",k);
|
||||
fprintf(fdsse4,"Loop index %d\n",k);
|
||||
print_shorts("mb0",(int16_t*)&m_b0);
|
||||
print_shorts("mb1",(int16_t*)&m_b1);
|
||||
print_shorts("mb2",(int16_t*)&m_b2);
|
||||
@@ -400,7 +505,7 @@ void compute_alpha16(llr_t* alpha,llr_t* beta,llr_t* m_11,llr_t* m_10,unsigned s
|
||||
print_shorts("mb6",(int16_t*)&m_b6);
|
||||
print_shorts("mb7",(int16_t*)&m_b7);
|
||||
|
||||
printf("Loop index %d, new\n",k);
|
||||
fprintf(fdsse4,"Loop index %d, new\n",k);
|
||||
print_shorts("new0",(int16_t*)&new0);
|
||||
print_shorts("new1",(int16_t*)&new1);
|
||||
print_shorts("new2",(int16_t*)&new2);
|
||||
@@ -410,7 +515,7 @@ void compute_alpha16(llr_t* alpha,llr_t* beta,llr_t* m_11,llr_t* m_10,unsigned s
|
||||
print_shorts("new6",(int16_t*)&new6);
|
||||
print_shorts("new7",(int16_t*)&new7);
|
||||
|
||||
printf("Loop index %d, after max\n",k);
|
||||
fprintf(fdsse4,"Loop index %d, after max\n",k);
|
||||
print_shorts("a0",(int16_t*)&a0);
|
||||
print_shorts("a1",(int16_t*)&a1);
|
||||
print_shorts("a2",(int16_t*)&a2);
|
||||
@@ -420,7 +525,7 @@ void compute_alpha16(llr_t* alpha,llr_t* beta,llr_t* m_11,llr_t* m_10,unsigned s
|
||||
print_shorts("a6",(int16_t*)&a6);
|
||||
print_shorts("a7",(int16_t*)&a7);
|
||||
|
||||
printf("Loop index %d\n",k);
|
||||
fprintf(fdsse4,"Loop index %d\n",k);
|
||||
print_shorts("a0",(int16_t*)&alpha_ptr[0]);
|
||||
print_shorts("a1",(int16_t*)&alpha_ptr[1]);
|
||||
print_shorts("a2",(int16_t*)&alpha_ptr[2]);
|
||||
@@ -463,25 +568,33 @@ void compute_beta16(llr_t* alpha,llr_t* beta,llr_t *m_11,llr_t* m_10,unsigned sh
|
||||
llr_t beta0,beta1;
|
||||
|
||||
#ifdef DEBUG_LOGMAP
|
||||
msg("compute_beta, %p,%p,%p,%p,framelength %d,F %d\n",
|
||||
beta,m_11,m_10,alpha,frame_length,F);
|
||||
fprintf(fdsse4,"compute_beta, %p,%p,%p,%p,framelength %d,F %d\n",
|
||||
beta,m_11,m_10,alpha,frame_length,F);
|
||||
#endif
|
||||
|
||||
|
||||
// termination for beta initialization
|
||||
|
||||
// printf("beta init: offset8 %d\n",offset8_flag);
|
||||
// fprintf(fdsse4,"beta init: offset8 %d\n",offset8_flag);
|
||||
m11=(int16_t)m_11[2+frame_length];
|
||||
//#ifndef __AVX2__
|
||||
#if 1
|
||||
m10=(int16_t)m_10[2+frame_length];
|
||||
|
||||
// printf("m11,m10 %d,%d\n",m11,m10);
|
||||
#else
|
||||
m10=-(int16_t)m_10[2+frame_length];
|
||||
#endif
|
||||
#ifdef DEBUG_LOGMAP
|
||||
fprintf(fdsse4,"m11,m10 %d,%d\n",m11,m10);
|
||||
#endif
|
||||
|
||||
beta0 = -m11;//M0T_TERM;
|
||||
beta1 = m11;//M1T_TERM;
|
||||
m11=(int16_t)m_11[1+frame_length];
|
||||
m10=(int16_t)m_10[1+frame_length];
|
||||
|
||||
// printf("m11,m10 %d,%d\n",m11,m10);
|
||||
#ifdef DEBUG_LOGMAP
|
||||
fprintf(fdsse4,"m11,m10 %d,%d\n",m11,m10);
|
||||
#endif
|
||||
|
||||
beta0_2 = beta0-m11;//+M0T_TERM;
|
||||
beta1_2 = beta0+m11;//+M1T_TERM;
|
||||
@@ -489,8 +602,9 @@ void compute_beta16(llr_t* alpha,llr_t* beta,llr_t *m_11,llr_t* m_10,unsigned sh
|
||||
beta3_2 = beta1-m10;//+M3T_TERM;
|
||||
m11=(int16_t)m_11[frame_length];
|
||||
m10=(int16_t)m_10[frame_length];
|
||||
// printf("m11,m10 %d,%d (%p)\n",m11,m10,m_11+frame_length);
|
||||
|
||||
#ifdef DEBUG_LOGMAP
|
||||
fprintf(fdsse4,"m11,m10 %d,%d\n",m11,m10);
|
||||
#endif
|
||||
beta0_16 = beta0_2-m11;//+M0T_TERM;
|
||||
beta1_16 = beta0_2+m11;//+M1T_TERM;
|
||||
beta2_16 = beta1_2+m10;//+M2T_TERM;
|
||||
@@ -536,6 +650,17 @@ void compute_beta16(llr_t* alpha,llr_t* beta,llr_t *m_11,llr_t* m_10,unsigned sh
|
||||
beta_ptr[5] = alpha128[5+(frame_length)];
|
||||
beta_ptr[6] = alpha128[6+(frame_length)];
|
||||
beta_ptr[7] = alpha128[7+(frame_length)];
|
||||
#ifdef DEBUG_LOGMAP
|
||||
fprintf(fdsse4,"beta init \n");
|
||||
print_shorts("b0",(int16_t*)&beta_ptr[0]);
|
||||
print_shorts("b1",(int16_t*)&beta_ptr[1]);
|
||||
print_shorts("b2",(int16_t*)&beta_ptr[2]);
|
||||
print_shorts("b3",(int16_t*)&beta_ptr[3]);
|
||||
print_shorts("b4",(int16_t*)&beta_ptr[4]);
|
||||
print_shorts("b5",(int16_t*)&beta_ptr[5]);
|
||||
print_shorts("b6",(int16_t*)&beta_ptr[6]);
|
||||
print_shorts("b7",(int16_t*)&beta_ptr[7]);
|
||||
#endif
|
||||
} else {
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
beta128 = (__m128i*)&beta[0];
|
||||
@@ -558,6 +683,17 @@ void compute_beta16(llr_t* alpha,llr_t* beta,llr_t *m_11,llr_t* m_10,unsigned sh
|
||||
beta_ptr[5] = (int16x8_t)vshrq_n_s64((int64x2_t)beta128[5],16); beta_ptr[5] = vsetq_lane_s16(beta[43],beta_ptr[5],4);
|
||||
beta_ptr[6] = (int16x8_t)vshrq_n_s64((int64x2_t)beta128[6],16); beta_ptr[6] = vsetq_lane_s16(beta[51],beta_ptr[6],4);
|
||||
beta_ptr[7] = (int16x8_t)vshrq_n_s64((int64x2_t)beta128[7],16); beta_ptr[7] = vsetq_lane_s16(beta[59],beta_ptr[7],4);
|
||||
#endif
|
||||
#ifdef DEBUG_LOGMAP
|
||||
fprintf(fdsse4,"beta init (second run) \n");
|
||||
print_shorts("b0",(int16_t*)&beta_ptr[0]);
|
||||
print_shorts("b1",(int16_t*)&beta_ptr[1]);
|
||||
print_shorts("b2",(int16_t*)&beta_ptr[2]);
|
||||
print_shorts("b3",(int16_t*)&beta_ptr[3]);
|
||||
print_shorts("b4",(int16_t*)&beta_ptr[4]);
|
||||
print_shorts("b5",(int16_t*)&beta_ptr[5]);
|
||||
print_shorts("b6",(int16_t*)&beta_ptr[6]);
|
||||
print_shorts("b7",(int16_t*)&beta_ptr[7]);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -582,6 +718,17 @@ void compute_beta16(llr_t* alpha,llr_t* beta,llr_t *m_11,llr_t* m_10,unsigned sh
|
||||
beta_ptr[7] = vsetq_lane_s16(beta7_16,beta_ptr[7],7);
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG_LOGMAP
|
||||
fprintf(fdsse4,"beta init (after insert) \n");
|
||||
print_shorts("b0",(int16_t*)&beta_ptr[0]);
|
||||
print_shorts("b1",(int16_t*)&beta_ptr[1]);
|
||||
print_shorts("b2",(int16_t*)&beta_ptr[2]);
|
||||
print_shorts("b3",(int16_t*)&beta_ptr[3]);
|
||||
print_shorts("b4",(int16_t*)&beta_ptr[4]);
|
||||
print_shorts("b5",(int16_t*)&beta_ptr[5]);
|
||||
print_shorts("b6",(int16_t*)&beta_ptr[6]);
|
||||
print_shorts("b7",(int16_t*)&beta_ptr[7]);
|
||||
#endif
|
||||
int loopval=((rerun_flag==0)?0:((frame_length-L)>>3));
|
||||
|
||||
for (k=(frame_length>>3)-1; k>=loopval; k--) {
|
||||
@@ -589,6 +736,9 @@ void compute_beta16(llr_t* alpha,llr_t* beta,llr_t *m_11,llr_t* m_10,unsigned sh
|
||||
m11_128=((__m128i*)m_11)[k];
|
||||
m10_128=((__m128i*)m_10)[k];
|
||||
|
||||
|
||||
//#ifndef __AVX2__
|
||||
#if 1
|
||||
m_b0 = _mm_adds_epi16(beta_ptr[4],m11_128); //m11
|
||||
m_b1 = _mm_subs_epi16(beta_ptr[4],m11_128); //m00
|
||||
m_b2 = _mm_subs_epi16(beta_ptr[5],m10_128); //m01
|
||||
@@ -598,6 +748,7 @@ void compute_beta16(llr_t* alpha,llr_t* beta,llr_t *m_11,llr_t* m_10,unsigned sh
|
||||
m_b6 = _mm_subs_epi16(beta_ptr[7],m11_128); //m00
|
||||
m_b7 = _mm_adds_epi16(beta_ptr[7],m11_128); //m11
|
||||
|
||||
|
||||
new0 = _mm_subs_epi16(beta_ptr[0],m11_128); //m00
|
||||
new1 = _mm_adds_epi16(beta_ptr[0],m11_128); //m11
|
||||
new2 = _mm_adds_epi16(beta_ptr[1],m10_128); //m10
|
||||
@@ -607,8 +758,29 @@ void compute_beta16(llr_t* alpha,llr_t* beta,llr_t *m_11,llr_t* m_10,unsigned sh
|
||||
new6 = _mm_adds_epi16(beta_ptr[3],m11_128); //m11
|
||||
new7 = _mm_subs_epi16(beta_ptr[3],m11_128); //m00
|
||||
|
||||
#else
|
||||
b01=_mm256_load_si256(&((_m256i*)beta_ptr)[0]);
|
||||
b23=_mm256_load_si256(&((_m256i*)beta_ptr)[1]);
|
||||
b45=_mm256_load_si256(&((_m256i*)beta_ptr)[2]);
|
||||
b67=_mm256_load_si256(&((_m256i*)beta_ptr)[3]);
|
||||
m11m10_256 = _mm256_insertf128_si256(m11m10_256,m11_128,0);
|
||||
m11m10_256 = _mm256_insertf128_si256(m11m10_256,m10_128,1);
|
||||
|
||||
|
||||
m_b02 = _mm256_adds_epi16(b45,m11m10_256); //negative m10
|
||||
m_b13 = _mm256_subs_epi16(b45,m11m10_256); //negative m10
|
||||
m_b64 = _mm256_subs_epi16(b67,m11m10_256); //negative m10
|
||||
m_b75 = _mm256_adds_epi16(b67,m11m10_256); //negative m10
|
||||
new02 = _mm256_subs_epi16(b01,m11m10_256); //negative m10
|
||||
new13 = _mm256_adds_epi16(b01,m11m10_256); //negative m10
|
||||
new64 = _mm256_adds_epi16(b23,m11m10_256); //negative m10
|
||||
new75 = _mm256_subs_epi16(b24,m11m10_256); //negative m10
|
||||
#endif
|
||||
|
||||
beta_ptr-=8;
|
||||
|
||||
//#ifndef __AVX2__
|
||||
#if 1
|
||||
beta_ptr[0] = _mm_max_epi16(m_b0,new0);
|
||||
beta_ptr[1] = _mm_max_epi16(m_b1,new1);
|
||||
beta_ptr[2] = _mm_max_epi16(m_b2,new2);
|
||||
@@ -634,6 +806,28 @@ void compute_beta16(llr_t* alpha,llr_t* beta,llr_t *m_11,llr_t* m_10,unsigned sh
|
||||
beta_ptr[5] = _mm_subs_epi16(beta_ptr[5],beta_max);
|
||||
beta_ptr[6] = _mm_subs_epi16(beta_ptr[6],beta_max);
|
||||
beta_ptr[7] = _mm_subs_epi16(beta_ptr[7],beta_max);
|
||||
#else
|
||||
b02 = _mm256_max_epi16(m_b02,new02);
|
||||
b13 = _mm256_max_epi16(m_b13,new13);
|
||||
b64 = _mm256_max_epi16(m_b64,new64);
|
||||
b75 = _mm256_max_epi16(m_b75,new75);
|
||||
|
||||
beta_max = _mm256_max_epi16(b02,b13);
|
||||
beta_max = _mm256_max_epi16(beta_max,b64);
|
||||
beta_max = _mm256_max_epi16(beta_max,b75);
|
||||
beta_max = _mm256_max_epi16(beta_max,_mm256_permutevar8x32_epi32(betaa_max,_mm256_set_epi32(3,2,1,0,7,6,5,4)));
|
||||
|
||||
b02 = _mm256_subs_epi16(b02,beta_max);
|
||||
b13 = _mm256_subs_epi16(b13,beta_max);
|
||||
b64 = _mm256_subs_epi16(b64,beta_max);
|
||||
b75 = _mm256_subs_epi16(b75,beta_max);
|
||||
|
||||
((_m256i*)beta_ptr)[0]) = _mm256_permute2x128_si256(b02,b13,0x02); //b01
|
||||
((_m256i*)beta_ptr)[1]) = _mm256_permute2x128_si256(b02,b13,0x31); //b23
|
||||
((_m256i*)beta_ptr)[2]) = _mm256_permute2x128_si256(b64,b75,0x13); //b45
|
||||
((_m256i*)beta_ptr)[3]) = _mm256_permute2x128_si256(b64,b75,0x20); //b67
|
||||
#endif
|
||||
|
||||
#elif defined(__arm__)
|
||||
m11_128=((int16x8_t*)m_11)[k];
|
||||
m10_128=((int16x8_t*)m_10)[k];
|
||||
@@ -684,6 +878,18 @@ void compute_beta16(llr_t* alpha,llr_t* beta,llr_t *m_11,llr_t* m_10,unsigned sh
|
||||
beta_ptr[7] = vqsubq_s16(beta_ptr[7],beta_max);
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG_LOGMAP
|
||||
fprintf(fdsse4,"Loop index %d, mb\n",k);
|
||||
fprintf(fdsse4,"beta init (after max)\n");
|
||||
print_shorts("b0",(int16_t*)&beta_ptr[0]);
|
||||
print_shorts("b1",(int16_t*)&beta_ptr[1]);
|
||||
print_shorts("b2",(int16_t*)&beta_ptr[2]);
|
||||
print_shorts("b3",(int16_t*)&beta_ptr[3]);
|
||||
print_shorts("b4",(int16_t*)&beta_ptr[4]);
|
||||
print_shorts("b5",(int16_t*)&beta_ptr[5]);
|
||||
print_shorts("b6",(int16_t*)&beta_ptr[6]);
|
||||
print_shorts("b7",(int16_t*)&beta_ptr[7]);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
@@ -721,7 +927,7 @@ void compute_ext16(llr_t* alpha,llr_t* beta,llr_t* m_11,llr_t* m_10,llr_t* ext,
|
||||
//
|
||||
|
||||
#ifdef DEBUG_LOGMAP
|
||||
msg("compute_ext, %p, %p, %p, %p, %p, %p ,framelength %d\n",alpha,beta,m_11,m_10,ext,systematic,frame_length);
|
||||
fprintf(fdsse4,"compute_ext (sse_16bit), %p, %p, %p, %p, %p, %p ,framelength %d\n",alpha,beta,m_11,m_10,ext,systematic,frame_length);
|
||||
#endif
|
||||
|
||||
alpha_ptr = alpha128;
|
||||
@@ -736,7 +942,7 @@ void compute_ext16(llr_t* alpha,llr_t* beta,llr_t* m_11,llr_t* m_10,llr_t* ext,
|
||||
ext_128 = (__m128i*)&ext[k<<3];
|
||||
|
||||
/*
|
||||
printf("EXT %03d\n",k);
|
||||
fprintf(fdsse4,"EXT %03d\n",k);
|
||||
print_shorts("a0:",&alpha_ptr[0]);
|
||||
print_shorts("a1:",&alpha_ptr[1]);
|
||||
print_shorts("a2:",&alpha_ptr[2]);
|
||||
@@ -754,6 +960,9 @@ void compute_ext16(llr_t* alpha,llr_t* beta,llr_t* m_11,llr_t* m_10,llr_t* ext,
|
||||
print_shorts("b6:",&beta_ptr[6]);
|
||||
print_shorts("b7:",&beta_ptr[7]);
|
||||
*/
|
||||
|
||||
//#ifndef __AVX2__
|
||||
#if 1
|
||||
m00_4 = _mm_adds_epi16(alpha_ptr[7],beta_ptr[3]); //ALPHA_BETA_4m00;
|
||||
m11_4 = _mm_adds_epi16(alpha_ptr[7],beta_ptr[7]); //ALPHA_BETA_4m11;
|
||||
m00_3 = _mm_adds_epi16(alpha_ptr[6],beta_ptr[7]); //ALPHA_BETA_3m00;
|
||||
@@ -770,6 +979,32 @@ void compute_ext16(llr_t* alpha,llr_t* beta,llr_t* m_11,llr_t* m_10,llr_t* ext,
|
||||
m10_2 = _mm_adds_epi16(alpha_ptr[3],beta_ptr[5]); //ALPHA_BETA_2m10;
|
||||
m10_1 = _mm_adds_epi16(alpha_ptr[2],beta_ptr[1]); //ALPHA_BETA_1m10;
|
||||
m01_1 = _mm_adds_epi16(alpha_ptr[2],beta_ptr[5]); //ALPHA_BETA_1m01;
|
||||
#else
|
||||
|
||||
|
||||
m00_1 = _mm_adds_epi16(alpha_ptr[0],beta_ptr[0]); //ALPHA_BETA_1m00;
|
||||
m10_1 = _mm_adds_epi16(alpha_ptr[2],beta_ptr[1]); //ALPHA_BETA_1m10;
|
||||
m11_1 = _mm_adds_epi16(alpha_ptr[0],beta_ptr[4]); //ALPHA_BETA_1m11;
|
||||
m01_1 = _mm_adds_epi16(alpha_ptr[2],beta_ptr[5]); //ALPHA_BETA_1m01;
|
||||
|
||||
m11_2 = _mm_adds_epi16(alpha_ptr[1],beta_ptr[0]); //ALPHA_BETA_2m11;
|
||||
m01_2 = _mm_adds_epi16(alpha_ptr[3],beta_ptr[1]); //ALPHA_BETA_2m01;
|
||||
m00_2 = _mm_adds_epi16(alpha_ptr[1],beta_ptr[4]); //ALPHA_BETA_2m00;
|
||||
m10_2 = _mm_adds_epi16(alpha_ptr[3],beta_ptr[5]); //ALPHA_BETA_2m10;
|
||||
|
||||
m11_3 = _mm_adds_epi16(alpha_ptr[6],beta_ptr[3]); //ALPHA_BETA_3m11;
|
||||
m01_3 = _mm_adds_epi16(alpha_ptr[4],beta_ptr[2]); //ALPHA_BETA_3m01;
|
||||
m00_3 = _mm_adds_epi16(alpha_ptr[6],beta_ptr[7]); //ALPHA_BETA_3m00;
|
||||
m10_3 = _mm_adds_epi16(alpha_ptr[4],beta_ptr[6]); //ALPHA_BETA_3m10;
|
||||
|
||||
m00_4 = _mm_adds_epi16(alpha_ptr[7],beta_ptr[3]); //ALPHA_BETA_4m00;
|
||||
m10_4 = _mm_adds_epi16(alpha_ptr[5],beta_ptr[2]); //ALPHA_BETA_4m10;
|
||||
m11_4 = _mm_adds_epi16(alpha_ptr[7],beta_ptr[7]); //ALPHA_BETA_4m11;
|
||||
m01_4 = _mm_adds_epi16(alpha_ptr[5],beta_ptr[6]); //ALPHA_BETA_4m01;
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
print_shorts("m11_1:",&m11_1);
|
||||
print_shorts("m11_2:",&m11_2);
|
||||
@@ -816,15 +1051,15 @@ void compute_ext16(llr_t* alpha,llr_t* beta,llr_t* m_11,llr_t* m_10,llr_t* ext,
|
||||
// print_shorts("m10_1:",&m10_1);
|
||||
|
||||
*ext_128 = _mm_subs_epi16(m10_1,m01_1);
|
||||
#ifdef DEBUG_LOGMAP
|
||||
fprintf(fdsse4,"ext %p\n",ext_128);
|
||||
print_shorts("ext:",(int16_t*)ext_128);
|
||||
print_shorts("m11:",(int16_t*)m11_128);
|
||||
print_shorts("m10:",(int16_t*)m10_128);
|
||||
print_shorts("m10_1:",(int16_t*)&m10_1);
|
||||
print_shorts("m01_1:",(int16_t*)&m01_1);
|
||||
#endif
|
||||
|
||||
/*
|
||||
print_shorts("ext:",ext_128);
|
||||
print_shorts("m11:",m11_128);
|
||||
print_shorts("m10:",m10_128);
|
||||
print_shorts("m10_1:",&m10_1);
|
||||
print_shorts("m01_1:",&m01_1);
|
||||
print_shorts("syst:",systematic_128);
|
||||
*/
|
||||
#elif defined(__arm__)
|
||||
m11_128 = (int16x8_t*)&m_11[k<<3];
|
||||
m10_128 = (int16x8_t*)&m_10[k<<3];
|
||||
@@ -927,7 +1162,7 @@ void init_td16()
|
||||
// j-=(n-1);
|
||||
|
||||
pi2tab16[ind][i] = j;
|
||||
// printf("pi2[%d] = %d\n",i,j);
|
||||
// fprintf(fdsse4,"pi2[%d] = %d\n",i,j);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -964,19 +1199,19 @@ unsigned char phy_threegpplte_turbo_decoder16(short *y,
|
||||
n is the size in bits of the coded block, with the tail */
|
||||
|
||||
|
||||
llr_t systematic0[n+16] __attribute__ ((aligned(16)));
|
||||
llr_t systematic1[n+16] __attribute__ ((aligned(16)));
|
||||
llr_t systematic2[n+16] __attribute__ ((aligned(16)));
|
||||
llr_t yparity1[n+16] __attribute__ ((aligned(16)));
|
||||
llr_t yparity2[n+16] __attribute__ ((aligned(16)));
|
||||
llr_t systematic0[n+16] __attribute__ ((aligned(32)));
|
||||
llr_t systematic1[n+16] __attribute__ ((aligned(32)));
|
||||
llr_t systematic2[n+16] __attribute__ ((aligned(32)));
|
||||
llr_t yparity1[n+16] __attribute__ ((aligned(32)));
|
||||
llr_t yparity2[n+16] __attribute__ ((aligned(32)));
|
||||
|
||||
llr_t ext[n+128] __attribute__((aligned(16)));
|
||||
llr_t ext2[n+128] __attribute__((aligned(16)));
|
||||
llr_t ext[n+128] __attribute__((aligned(32)));
|
||||
llr_t ext2[n+128] __attribute__((aligned(32)));
|
||||
|
||||
llr_t alpha[(n+16)*8] __attribute__ ((aligned(16)));
|
||||
llr_t beta[(n+16)*8] __attribute__ ((aligned(16)));
|
||||
llr_t m11[n+16] __attribute__ ((aligned(16)));
|
||||
llr_t m10[n+16] __attribute__ ((aligned(16)));
|
||||
llr_t alpha[(n+16)*8] __attribute__ ((aligned(32)));
|
||||
llr_t beta[(n+16)*8] __attribute__ ((aligned(32)));
|
||||
llr_t m11[n+32] __attribute__ ((aligned(32)));
|
||||
llr_t m10[n+32] __attribute__ ((aligned(32)));
|
||||
|
||||
|
||||
int *pi2_p,*pi4_p,*pi5_p,*pi6_p;
|
||||
@@ -989,7 +1224,7 @@ unsigned char phy_threegpplte_turbo_decoder16(short *y,
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
__m128i *yp128;
|
||||
__m128i tmp, zeros=_mm_setzero_si128();
|
||||
register __m128i tmpe;
|
||||
__m128i tmpe;
|
||||
#elif defined(__arm__)
|
||||
int16x8_t *yp128;
|
||||
// int16x8_t tmp128[(n+8)>>3];
|
||||
@@ -1000,12 +1235,20 @@ unsigned char phy_threegpplte_turbo_decoder16(short *y,
|
||||
#endif
|
||||
int offset8_flag=0;
|
||||
|
||||
#ifdef DEBUG_LOGMAP
|
||||
fdsse4 = fopen("dump_sse4.txt","w");
|
||||
|
||||
|
||||
printf("tc sse4_16 (y) %p\n",y);
|
||||
#endif
|
||||
|
||||
if (crc_type > 3) {
|
||||
msg("Illegal crc length!\n");
|
||||
printf("Illegal crc length!\n");
|
||||
return 255;
|
||||
}
|
||||
|
||||
|
||||
|
||||
start_meas(init_stats);
|
||||
|
||||
|
||||
@@ -1013,7 +1256,7 @@ unsigned char phy_threegpplte_turbo_decoder16(short *y,
|
||||
for (iind=0; iind < 188 && f1f2mat[iind].nb_bits != n; iind++);
|
||||
|
||||
if ( iind == 188 ) {
|
||||
msg("Illegal frame length!\n");
|
||||
printf("Illegal frame length!\n");
|
||||
return 255;
|
||||
}
|
||||
|
||||
@@ -1059,62 +1302,74 @@ unsigned char phy_threegpplte_turbo_decoder16(short *y,
|
||||
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
tmpe = _mm_load_si128(yp128);
|
||||
// fprintf(fdsse4,"yp128 %p\n",yp128);
|
||||
// print_shorts("tmpe",(int16_t *)&tmpe);
|
||||
|
||||
s[j] = _mm_extract_epi16(tmpe,0);
|
||||
yp1[j] = _mm_extract_epi16(tmpe,1);
|
||||
yp2[j] = _mm_extract_epi16(tmpe,2);
|
||||
// printf("init: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",j,s[j],yp1[j],yp2[j]);
|
||||
|
||||
#ifdef DEBUG_LOGMAP
|
||||
fprintf(fdsse4,"init0: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",j,s[j],yp1[j],yp2[j]);
|
||||
#endif
|
||||
j=pi2_p[1];
|
||||
|
||||
s[j] = _mm_extract_epi16(tmpe,3);
|
||||
yp1[j] = _mm_extract_epi16(tmpe,4);
|
||||
yp2[j] = _mm_extract_epi16(tmpe,5);
|
||||
// printf("init: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",j,s[j],yp1[j],yp2[j]);
|
||||
|
||||
#ifdef DEBUG_LOGMAP
|
||||
fprintf(fdsse4,"init1: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",j,s[j],yp1[j],yp2[j]);
|
||||
#endif
|
||||
j=pi2_p[2];
|
||||
|
||||
s[j] = _mm_extract_epi16(tmpe,6);
|
||||
yp1[j] = _mm_extract_epi16(tmpe,7);
|
||||
tmpe = _mm_load_si128(&yp128[1]);
|
||||
yp2[j] = _mm_extract_epi16(tmpe,0);
|
||||
// printf("init: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",j,s[j],yp1[j],yp2[j]);
|
||||
|
||||
#ifdef DEBUG_LOGMAP
|
||||
fprintf(fdsse4,"init2: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",j,s[j],yp1[j],yp2[j]);
|
||||
#endif
|
||||
j=pi2_p[3];
|
||||
|
||||
s[j] = _mm_extract_epi16(tmpe,1);
|
||||
yp1[j] = _mm_extract_epi16(tmpe,2);
|
||||
yp2[j] = _mm_extract_epi16(tmpe,3);
|
||||
// printf("init: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",j,s[j],yp1[j],yp2[j]);
|
||||
|
||||
#ifdef DEBUG_LOGMAP
|
||||
fprintf(fdsse4,"init3: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",j,s[j],yp1[j],yp2[j]);
|
||||
#endif
|
||||
j=pi2_p[4];
|
||||
|
||||
s[j] = _mm_extract_epi16(tmpe,4);
|
||||
yp1[j] = _mm_extract_epi16(tmpe,5);
|
||||
yp2[j] = _mm_extract_epi16(tmpe,6);
|
||||
// printf("init: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",j,s[j],yp1[j],yp2[j]);
|
||||
|
||||
#ifdef DEBUG_LOGMAP
|
||||
fprintf(fdsse4,"init4: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",j,s[j],yp1[j],yp2[j]);
|
||||
#endif
|
||||
j=pi2_p[5];
|
||||
|
||||
s[j] = _mm_extract_epi16(tmpe,7);
|
||||
tmpe = _mm_load_si128(&yp128[2]);
|
||||
yp1[j] = _mm_extract_epi16(tmpe,0);
|
||||
yp2[j] = _mm_extract_epi16(tmpe,1);
|
||||
// printf("init: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",j,s[j],yp1[j],yp2[j]);
|
||||
#ifdef DEBUG_LOGMAP
|
||||
fprintf(fdsse4,"init5: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",j,s[j],yp1[j],yp2[j]);
|
||||
#endif
|
||||
|
||||
j=pi2_p[6];
|
||||
|
||||
s[j] = _mm_extract_epi16(tmpe,2);
|
||||
yp1[j] = _mm_extract_epi16(tmpe,3);
|
||||
yp2[j] = _mm_extract_epi16(tmpe,4);
|
||||
// printf("init: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",j,s[j],yp1[j],yp2[j]);
|
||||
|
||||
#ifdef DEBUG_LOGMAP
|
||||
fprintf(fdsse4,"init6: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",j,s[j],yp1[j],yp2[j]);
|
||||
#endif
|
||||
j=pi2_p[7];
|
||||
|
||||
s[j] = _mm_extract_epi16(tmpe,5);
|
||||
yp1[j] = _mm_extract_epi16(tmpe,6);
|
||||
yp2[j] = _mm_extract_epi16(tmpe,7);
|
||||
// printf("init: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",j,s[j],yp1[j],yp2[j]);
|
||||
#ifdef DEBUG_LOGMAP
|
||||
fprintf(fdsse4,"init7: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",j,s[j],yp1[j],yp2[j]);
|
||||
#endif
|
||||
|
||||
#elif defined(__arm__)
|
||||
s[j] = vgetq_lane_s16(yp128[0],0);
|
||||
@@ -1172,7 +1427,7 @@ unsigned char phy_threegpplte_turbo_decoder16(short *y,
|
||||
yp1[i] = *yp;
|
||||
yp++;
|
||||
#ifdef DEBUG_LOGMAP
|
||||
msg("Term 1 (%d): %d %d\n",i,s[i],yp1[i]);
|
||||
fprintf(fdsse4,"Term 1 (%d): %d %d\n",i,s[i],yp1[i]);
|
||||
#endif //DEBUG_LOGMAP
|
||||
}
|
||||
|
||||
@@ -1184,12 +1439,12 @@ unsigned char phy_threegpplte_turbo_decoder16(short *y,
|
||||
yp2[i-8] = *yp;
|
||||
yp++;
|
||||
#ifdef DEBUG_LOGMAP
|
||||
msg("Term 2 (%d): %d %d\n",i-3,s[i],yp2[i-8]);
|
||||
fprintf(fdsse4,"Term 2 (%d): %d %d\n",i-3,s[i],yp2[i-8]);
|
||||
#endif //DEBUG_LOGMAP
|
||||
}
|
||||
|
||||
#ifdef DEBUG_LOGMAP
|
||||
msg("\n");
|
||||
fprintf(fdsse4,"\n");
|
||||
#endif //DEBUG_LOGMAP
|
||||
|
||||
stop_meas(init_stats);
|
||||
@@ -1201,7 +1456,7 @@ unsigned char phy_threegpplte_turbo_decoder16(short *y,
|
||||
while (iteration_cnt++ < max_iterations) {
|
||||
|
||||
#ifdef DEBUG_LOGMAP
|
||||
printf("\n*******************ITERATION %d (n %d), ext %p\n\n",iteration_cnt,n,ext);
|
||||
fprintf(fdsse4,"\n*******************ITERATION %d (n %d), ext %p\n\n",iteration_cnt,n,ext);
|
||||
#endif //DEBUG_LOGMAP
|
||||
|
||||
start_meas(intl1_stats);
|
||||
@@ -1209,24 +1464,29 @@ unsigned char phy_threegpplte_turbo_decoder16(short *y,
|
||||
pi4_p=pi4tab16[iind];
|
||||
|
||||
for (i=0; i<(n>>3); i++) { // steady-state portion
|
||||
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
((__m128i *)systematic2)[i]=_mm_insert_epi16(((__m128i *)systematic2)[i],((llr_t*)ext)[*pi4_p++],0);
|
||||
((__m128i *)systematic2)[i]=_mm_insert_epi16(((__m128i *)systematic2)[i],((llr_t*)ext)[*pi4_p++],1);
|
||||
((__m128i *)systematic2)[i]=_mm_insert_epi16(((__m128i *)systematic2)[i],((llr_t*)ext)[*pi4_p++],2);
|
||||
((__m128i *)systematic2)[i]=_mm_insert_epi16(((__m128i *)systematic2)[i],((llr_t*)ext)[*pi4_p++],3);
|
||||
((__m128i *)systematic2)[i]=_mm_insert_epi16(((__m128i *)systematic2)[i],((llr_t*)ext)[*pi4_p++],4);
|
||||
((__m128i *)systematic2)[i]=_mm_insert_epi16(((__m128i *)systematic2)[i],((llr_t*)ext)[*pi4_p++],5);
|
||||
((__m128i *)systematic2)[i]=_mm_insert_epi16(((__m128i *)systematic2)[i],((llr_t*)ext)[*pi4_p++],6);
|
||||
((__m128i *)systematic2)[i]=_mm_insert_epi16(((__m128i *)systematic2)[i],((llr_t*)ext)[*pi4_p++],7);
|
||||
((__m128i *)systematic2)[i]=_mm_insert_epi16(((__m128i *)systematic2)[i],ext[*pi4_p++],0);
|
||||
((__m128i *)systematic2)[i]=_mm_insert_epi16(((__m128i *)systematic2)[i],ext[*pi4_p++],1);
|
||||
((__m128i *)systematic2)[i]=_mm_insert_epi16(((__m128i *)systematic2)[i],ext[*pi4_p++],2);
|
||||
((__m128i *)systematic2)[i]=_mm_insert_epi16(((__m128i *)systematic2)[i],ext[*pi4_p++],3);
|
||||
((__m128i *)systematic2)[i]=_mm_insert_epi16(((__m128i *)systematic2)[i],ext[*pi4_p++],4);
|
||||
((__m128i *)systematic2)[i]=_mm_insert_epi16(((__m128i *)systematic2)[i],ext[*pi4_p++],5);
|
||||
((__m128i *)systematic2)[i]=_mm_insert_epi16(((__m128i *)systematic2)[i],ext[*pi4_p++],6);
|
||||
((__m128i *)systematic2)[i]=_mm_insert_epi16(((__m128i *)systematic2)[i],ext[*pi4_p++],7);
|
||||
|
||||
#elif defined(__arm__)
|
||||
((int16x8_t*)systematic2)[i]=vsetq_lane_s16(((llr_t*)ext)[*pi4_p++],((int16x8_t*)systematic2)[i],0);
|
||||
((int16x8_t*)systematic2)[i]=vsetq_lane_s16(((llr_t*)ext)[*pi4_p++],((int16x8_t*)systematic2)[i],1);
|
||||
((int16x8_t*)systematic2)[i]=vsetq_lane_s16(((llr_t*)ext)[*pi4_p++],((int16x8_t*)systematic2)[i],2);
|
||||
((int16x8_t*)systematic2)[i]=vsetq_lane_s16(((llr_t*)ext)[*pi4_p++],((int16x8_t*)systematic2)[i],3);
|
||||
((int16x8_t*)systematic2)[i]=vsetq_lane_s16(((llr_t*)ext)[*pi4_p++],((int16x8_t*)systematic2)[i],4);
|
||||
((int16x8_t*)systematic2)[i]=vsetq_lane_s16(((llr_t*)ext)[*pi4_p++],((int16x8_t*)systematic2)[i],5);
|
||||
((int16x8_t*)systematic2)[i]=vsetq_lane_s16(((llr_t*)ext)[*pi4_p++],((int16x8_t*)systematic2)[i],6);
|
||||
((int16x8_t*)systematic2)[i]=vsetq_lane_s16(((llr_t*)ext)[*pi4_p++],((int16x8_t*)systematic2)[i],7);
|
||||
((int16x8_t*)systematic2)[i]=vsetq_lane_s16(ext[*pi4_p++],((int16x8_t*)systematic2)[i],0);
|
||||
((int16x8_t*)systematic2)[i]=vsetq_lane_s16(ext[*pi4_p++],((int16x8_t*)systematic2)[i],1);
|
||||
((int16x8_t*)systematic2)[i]=vsetq_lane_s16(ext[*pi4_p++],((int16x8_t*)systematic2)[i],2);
|
||||
((int16x8_t*)systematic2)[i]=vsetq_lane_s16(ext[*pi4_p++],((int16x8_t*)systematic2)[i],3);
|
||||
((int16x8_t*)systematic2)[i]=vsetq_lane_s16(ext[*pi4_p++],((int16x8_t*)systematic2)[i],4);
|
||||
((int16x8_t*)systematic2)[i]=vsetq_lane_s16(ext[*pi4_p++],((int16x8_t*)systematic2)[i],5);
|
||||
((int16x8_t*)systematic2)[i]=vsetq_lane_s16(ext[*pi4_p++],((int16x8_t*)systematic2)[i],6);
|
||||
((int16x8_t*)systematic2)[i]=vsetq_lane_s16(ext[*pi4_p++],((int16x8_t*)systematic2)[i],7);
|
||||
#endif
|
||||
#ifdef DEBUG_LOGMAP
|
||||
print_shorts("syst2",(int16_t*)&((__m128i *)systematic2)[i]);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -1261,6 +1521,9 @@ unsigned char phy_threegpplte_turbo_decoder16(short *y,
|
||||
tmp=vsetq_lane_s16(ext2[*pi5_p++],tmp,6);
|
||||
tmp=vsetq_lane_s16(ext2[*pi5_p++],tmp,7);
|
||||
((int16x8_t *)systematic1)[i] = vqaddq_s16(vqsubq_s16(tmp,((int16x8_t*)ext)[i]),((int16x8_t *)systematic0)[i]);
|
||||
#endif
|
||||
#ifdef DEBUG_LOGMAP
|
||||
print_shorts("syst1",(int16_t*)&((__m128i *)systematic1)[i]);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -1278,6 +1541,9 @@ unsigned char phy_threegpplte_turbo_decoder16(short *y,
|
||||
tmp=_mm_insert_epi16(tmp, ((llr_t*)ext2)[*pi6_p++],2);
|
||||
tmp=_mm_insert_epi16(tmp, ((llr_t*)ext2)[*pi6_p++],1);
|
||||
tmp=_mm_insert_epi16(tmp, ((llr_t*)ext2)[*pi6_p++],0);
|
||||
#ifdef DEBUG_LOGMAP
|
||||
print_shorts("tmp",(int16_t*)&tmp);
|
||||
#endif
|
||||
tmp=_mm_cmpgt_epi8(_mm_packs_epi16(tmp,zeros),zeros);
|
||||
decoded_bytes[i]=(unsigned char)_mm_movemask_epi8(tmp);
|
||||
#elif defined(__arm__)
|
||||
@@ -1297,6 +1563,10 @@ unsigned char phy_threegpplte_turbo_decoder16(short *y,
|
||||
uint64x2_t Mask = vpaddlq_u32(vpaddlq_u16(vandq_u16(vcgtq_s16(tmp,zeros), Powers)));
|
||||
uint64x1_t Mask64 = vget_high_u64(Mask)+vget_low_u64(Mask);
|
||||
decoded_bytes[i] = (uint8_t)Mask64;
|
||||
#endif
|
||||
#ifdef DEBUG_LOGMAP
|
||||
print_shorts("tmp",(int16_t*)&tmp);
|
||||
fprintf(fdsse4,"decoded_bytes[%d] %x\n",i,decoded_bytes[i]);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -1344,6 +1614,9 @@ unsigned char phy_threegpplte_turbo_decoder16(short *y,
|
||||
}
|
||||
|
||||
stop_meas(intl2_stats);
|
||||
#ifdef DEBUG_LOGMAP
|
||||
fprintf(fdsse4,"oldcrc %x, crc %x\n",oldcrc,crc);
|
||||
#endif
|
||||
|
||||
if ((crc == oldcrc) && (crc!=0)) {
|
||||
return(iteration_cnt);
|
||||
@@ -1374,8 +1647,12 @@ unsigned char phy_threegpplte_turbo_decoder16(short *y,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// fprintf(fdsse4,"crc %x, oldcrc %x\n",crc,oldcrc);
|
||||
|
||||
// printf("crc %x, oldcrc %x\n",crc,oldcrc);
|
||||
#ifdef DEBUG_LOGMAP
|
||||
fclose(fdsse4);
|
||||
#endif
|
||||
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
_mm_empty();
|
||||
|
||||
@@ -1000,6 +1000,7 @@ unsigned char phy_threegpplte_turbo_decoder8(short *y,
|
||||
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
|
||||
// note: this makes valgrind freak
|
||||
__m128i avg=_mm_set1_epi32(0);
|
||||
|
||||
for (i=0; i<(3*(n>>4))+1; i++) {
|
||||
@@ -1503,6 +1504,7 @@ unsigned char phy_threegpplte_turbo_decoder8(short *y,
|
||||
|
||||
tmp2=_mm_and_si128(tmp,mask);
|
||||
tmp2=_mm_cmpeq_epi16(tmp2,mask);
|
||||
// printf("decoded_bytes %p\n",decoded_bytes);
|
||||
decoded_bytes[n_128*0+i]=(uint8_t) _mm_movemask_epi8(_mm_packs_epi16(tmp2,zeros));
|
||||
int j;
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ RATE12CC_SRC = ccoding_byte.c viterbi.c crc_byte.c
|
||||
all: 3gpplte_sse
|
||||
|
||||
3gpplte_sse: $(TURBO_SRC)
|
||||
gcc -o 3gpplte_sse 3gpplte_sse.c -msse4 -Wall -g -ggdb -DMAIN
|
||||
gcc -o 3gpplte_sse 3gpplte_sse.c -msse4 -Wall -g -ggdb -DTC_MAIN -I../..
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -303,6 +303,10 @@ void ccodedot11_init(void);
|
||||
\brief This function initializes the trellis structure for decoding an 802.11 convolutional code.*/
|
||||
void ccodedot11_init_inv(void);
|
||||
|
||||
/*!\fn void teillis_table_init(void)
|
||||
\brief This function initializes the trellis structure for 3GPP LTE Turbo code.*/
|
||||
void treillis_table_init(void);
|
||||
|
||||
/*\fn void threegpplte_turbo_encoder(uint8_t *input,uint16_t input_length_bytes,uint8_t *output,uint8_t F,uint16_t interleaver_f1,uint16_t interleaver_f2)
|
||||
\brief This function implements a rate 1/3 8-state parralel concatenated turbo code (3GPP-LTE).
|
||||
@param input Pointer to input buffer
|
||||
@@ -353,6 +357,8 @@ void ccodedab_init(void);
|
||||
\brief This function initializes the trellis structure for decoding an DAB convolutional code (first 3 bits).*/
|
||||
void ccodedab_init_inv(void);
|
||||
|
||||
|
||||
|
||||
/*!\fn void crcTableInit(void)
|
||||
\brief This function initializes the different crc tables.*/
|
||||
void crcTableInit (void);
|
||||
@@ -366,6 +372,17 @@ void init_td8 (void);
|
||||
\brief This function initializes the tables for 16-bit LLR Turbo decoder.*/
|
||||
void init_td16 (void);
|
||||
|
||||
#ifdef __AVX2__
|
||||
/*!\fn void init_td8(void)
|
||||
\brief This function initializes the tables for 8-bit LLR Turbo decoder (AVX2).*/
|
||||
void init_td8avx2 (void);
|
||||
|
||||
|
||||
/*!\fn void init_td16(void)
|
||||
\brief This function initializes the tables for 16-bit LLR Turbo decoder (AVX2).*/
|
||||
void init_td16avx2 (void);
|
||||
#endif
|
||||
|
||||
/*!\fn uint32_t crc24a(uint8_t *inPtr, int32_t bitlen)
|
||||
\brief This computes a 24-bit crc ('a' variant for overall transport block)
|
||||
based on 3GPP UMTS/LTE specifications.
|
||||
@@ -483,6 +500,24 @@ uint8_t phy_threegpplte_turbo_decoder16(int16_t *y,
|
||||
time_stats_t *intl1_stats,
|
||||
time_stats_t *intl2_stats);
|
||||
|
||||
uint8_t phy_threegpplte_turbo_decoder16avx2(int16_t *y,
|
||||
int16_t *y2,
|
||||
uint8_t *decoded_bytes,
|
||||
uint8_t *decoded_bytes2,
|
||||
uint16_t n,
|
||||
uint16_t interleaver_f1,
|
||||
uint16_t interleaver_f2,
|
||||
uint8_t max_iterations,
|
||||
uint8_t crc_type,
|
||||
uint8_t F,
|
||||
time_stats_t *init_stats,
|
||||
time_stats_t *alpha_stats,
|
||||
time_stats_t *beta_stats,
|
||||
time_stats_t *gamma_stats,
|
||||
time_stats_t *ext_stats,
|
||||
time_stats_t *intl1_stats,
|
||||
time_stats_t *intl2_stats);
|
||||
|
||||
/*!
|
||||
\brief This routine performs max-logmap detection for the 3GPP turbo code (with termination). It is optimized for SIMD processing and 8-bit
|
||||
LLR arithmetic, and requires SSE2,SSSE3 and SSE4.1 (gcc >=4.3 and appropriate CPU)
|
||||
|
||||
@@ -495,8 +495,14 @@ uint32_t lte_rate_matching_turbo(uint32_t RTC,
|
||||
char fname[512];
|
||||
#endif
|
||||
|
||||
Nir = Nsoft/Kmimo/cmin(8,Mdlharq);
|
||||
Ncb = cmin(Nir/C,3*(RTC<<5));
|
||||
if (Mdlharq>0) { // Downlink
|
||||
Nir = Nsoft/Kmimo/cmin(8,Mdlharq);
|
||||
Ncb = cmin(Nir/C,3*(RTC<<5));
|
||||
}
|
||||
else { // Uplink
|
||||
Nir=0;
|
||||
Ncb = 3*(RTC<<5); // Kw
|
||||
}
|
||||
#ifdef RM_DEBUG_TX
|
||||
|
||||
if (rvidx==0 && r==0) {
|
||||
@@ -709,15 +715,20 @@ int lte_rate_matching_turbo_rx(uint32_t RTC,
|
||||
int nulled=0;
|
||||
#endif
|
||||
|
||||
if (Kmimo==0 || Mdlharq==0 || C==0 || Qm==0 || Nl==0) {
|
||||
if (Kmimo==0 || C==0 || Qm==0 || Nl==0) {
|
||||
printf("lte_rate_matching.c: invalid parameters (Kmimo %d, Mdlharq %d, C %d, Qm %d, Nl %d\n",
|
||||
Kmimo,Mdlharq,C,Qm,Nl);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
Nir = Nsoft/Kmimo/cmin(8,Mdlharq);
|
||||
Ncb = cmin(Nir/C,3*(RTC<<5));
|
||||
|
||||
if (Mdlharq>0) { // Downlink
|
||||
Nir = Nsoft/Kmimo/cmin(8,Mdlharq);
|
||||
Ncb = cmin(Nir/C,3*(RTC<<5));
|
||||
}
|
||||
else { // Uplink
|
||||
Nir=0;
|
||||
Ncb = 3*(RTC<<5);
|
||||
}
|
||||
|
||||
Gp = G/Nl/Qm;
|
||||
GpmodC = Gp%C;
|
||||
|
||||
@@ -26,17 +26,6 @@
|
||||
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
|
||||
|
||||
*******************************************************************************/
|
||||
/*
|
||||
#ifdef CBMIMO1
|
||||
#include "ARCH/COMMON/defs.h"
|
||||
#include "ARCH/CBMIMO1/DEVICE_DRIVER/from_grlib_softconfig.h"
|
||||
#include "ARCH/CBMIMO1/DEVICE_DRIVER/cbmimo1_device.h"
|
||||
#include "ARCH/CBMIMO1/DEVICE_DRIVER/defs.h"
|
||||
#include "ARCH/CBMIMO1/DEVICE_DRIVER/extern.h"
|
||||
#include "ARCH/CBMIMO1/DEVICE_DRIVER/cbmimo1_pci.h"
|
||||
//#include "pci_commands.h"
|
||||
#endif //CBMIMO1
|
||||
*/
|
||||
#ifdef EXMIMO
|
||||
#include "openair0_lib.h"
|
||||
#endif
|
||||
@@ -888,12 +877,16 @@ void phy_init_lte_top(LTE_DL_FRAME_PARMS *lte_frame_parms)
|
||||
ccodelte_init();
|
||||
ccodelte_init_inv();
|
||||
|
||||
treillis_table_init();
|
||||
|
||||
phy_generate_viterbi_tables();
|
||||
phy_generate_viterbi_tables_lte();
|
||||
|
||||
init_td8();
|
||||
init_td16();
|
||||
|
||||
#ifdef __AVX2__
|
||||
init_td16avx2();
|
||||
#endif
|
||||
|
||||
lte_sync_time_init(lte_frame_parms);
|
||||
|
||||
@@ -1049,7 +1042,7 @@ int phy_init_lte_ue(PHY_VARS_UE *phy_vars_ue,
|
||||
// init TX buffers
|
||||
|
||||
ue_common_vars->txdata = (int32_t**)malloc16( frame_parms->nb_antennas_tx*sizeof(int32_t*) );
|
||||
ue_common_vars->txdataF = (mod_sym_t **)malloc16( frame_parms->nb_antennas_tx*sizeof(mod_sym_t*) );
|
||||
ue_common_vars->txdataF = (int32_t **)malloc16( frame_parms->nb_antennas_tx*sizeof(int32_t*) );
|
||||
|
||||
for (i=0; i<frame_parms->nb_antennas_tx; i++) {
|
||||
#ifdef USER_MODE
|
||||
@@ -1057,7 +1050,7 @@ int phy_init_lte_ue(PHY_VARS_UE *phy_vars_ue,
|
||||
#else //USER_MODE
|
||||
ue_common_vars->txdata[i] = TX_DMA_BUFFER[0][i];
|
||||
#endif //USER_MODE
|
||||
ue_common_vars->txdataF[i] = (mod_sym_t *)malloc16_clear( FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX*sizeof(mod_sym_t) );
|
||||
ue_common_vars->txdataF[i] = (int32_t *)malloc16_clear( FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX*sizeof(int32_t) );
|
||||
}
|
||||
|
||||
// init RX buffers
|
||||
@@ -1270,21 +1263,21 @@ int phy_init_lte_eNB(PHY_VARS_eNB *phy_vars_eNB,
|
||||
|
||||
// TX vars
|
||||
eNB_common_vars->txdata[eNB_id] = (int32_t**)malloc16( frame_parms->nb_antennas_tx*sizeof(int32_t*) );
|
||||
eNB_common_vars->txdataF[eNB_id] = (mod_sym_t **)malloc16( frame_parms->nb_antennas_tx*sizeof(mod_sym_t*) );
|
||||
eNB_common_vars->txdataF[eNB_id] = (int32_t **)malloc16( frame_parms->nb_antennas_tx*sizeof(int32_t*) );
|
||||
|
||||
for (i=0; i<frame_parms->nb_antennas_tx; i++) {
|
||||
#ifdef USER_MODE
|
||||
eNB_common_vars->txdata[eNB_id][i] = (int32_t*)malloc16_clear( FRAME_LENGTH_COMPLEX_SAMPLES*sizeof(int32_t) );
|
||||
eNB_common_vars->txdataF[eNB_id][i] = (mod_sym_t*)malloc16_clear( FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX*sizeof(mod_sym_t) );
|
||||
eNB_common_vars->txdataF[eNB_id][i] = (int32_t*)malloc16_clear( FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX*sizeof(int32_t) );
|
||||
#else // USER_MODE
|
||||
eNB_common_vars->txdata[eNB_id][i] = TX_DMA_BUFFER[eNB_id][i];
|
||||
eNB_common_vars->txdataF[eNB_id][i] = (mod_sym_t *)malloc16_clear( FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX*sizeof(mod_sym_t) );
|
||||
eNB_common_vars->txdataF[eNB_id][i] = (int32_t *)malloc16_clear( FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX*sizeof(int32_t) );
|
||||
#endif //USER_MODE
|
||||
#ifdef DEBUG_PHY
|
||||
msg("[openair][LTE_PHY][INIT] lte_eNB_common_vars->txdata[%d][%d] = %p\n",eNB_id,i,eNB_common_vars->txdata[eNB_id][i]);
|
||||
msg("[openair][LTE_PHY][INIT] lte_eNB_common_vars->txdataF[%d][%d] = %p (%d bytes)\n",
|
||||
eNB_id,i,eNB_common_vars->txdataF[eNB_id][i],
|
||||
FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX*sizeof(mod_sym_t));
|
||||
FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX*sizeof(int32_t));
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -45,6 +45,7 @@ void lte_param_init(unsigned char N_tx,
|
||||
lte_frame_parms->N_RB_UL = N_RB_DL;
|
||||
lte_frame_parms->threequarter_fs = threequarter_fs;
|
||||
lte_frame_parms->Ncp = extended_prefix_flag;
|
||||
lte_frame_parms->Ncp_UL = extended_prefix_flag;
|
||||
lte_frame_parms->Nid_cell = Nid_cell;
|
||||
lte_frame_parms->nushift = Nid_cell%6;
|
||||
lte_frame_parms->nb_antennas_tx = N_tx;
|
||||
|
||||
@@ -29,8 +29,6 @@
|
||||
#include "PHY/types.h"
|
||||
#include "PHY/defs.h"
|
||||
#include "PHY/extern.h"
|
||||
#include "MAC_INTERFACE/defs.h"
|
||||
#include "MAC_INTERFACE/extern.h"
|
||||
|
||||
#ifdef EXMIMO
|
||||
#include "openair0_lib.h"
|
||||
|
||||
@@ -26,187 +26,187 @@
|
||||
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
|
||||
|
||||
*******************************************************************************/
|
||||
short filt24_0[24] __attribute__((aligned(16))) ={
|
||||
short filt24_0[24] __attribute__((aligned(32))) ={
|
||||
2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
};
|
||||
short filt24_0_dcl[24] __attribute__((aligned(16))) ={
|
||||
short filt24_0_dcl[24] __attribute__((aligned(32))) ={
|
||||
2341,4681,7022,9362,11703,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
};
|
||||
short filt24_0_dcr[24] __attribute__((aligned(16))) ={
|
||||
short filt24_0_dcr[24] __attribute__((aligned(32))) ={
|
||||
2730,5461,8192,10922,13653,16384,14043,11703,9362,7022,4681,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
};
|
||||
|
||||
short filt24_1[24] __attribute__((aligned(16))) ={
|
||||
short filt24_1[24] __attribute__((aligned(32))) ={
|
||||
0,2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
};
|
||||
short filt24_1_dcl[24] __attribute__((aligned(16))) ={
|
||||
short filt24_1_dcl[24] __attribute__((aligned(32))) ={
|
||||
0,4681,7022,9362,11703,14043,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
};
|
||||
short filt24_1_dcr[24] __attribute__((aligned(16))) ={
|
||||
short filt24_1_dcr[24] __attribute__((aligned(32))) ={
|
||||
0,2730,5461,8192,10922,13653,16384,14043,11703,9362,7022,4681,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
};
|
||||
|
||||
|
||||
short filt24_2[24] __attribute__((aligned(16))) ={
|
||||
short filt24_2[24] __attribute__((aligned(32))) ={
|
||||
0,0,2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0,0,0,0
|
||||
};
|
||||
short filt24_2_dcl[24] __attribute__((aligned(16))) ={
|
||||
short filt24_2_dcl[24] __attribute__((aligned(32))) ={
|
||||
0,0,2341,4681,7022,9362, 11703,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0,0,0,0
|
||||
};
|
||||
short filt24_2_dcr[24] __attribute__((aligned(16))) ={
|
||||
short filt24_2_dcr[24] __attribute__((aligned(32))) ={
|
||||
0,0,2730,5461,8192,10922,13653,16384,14043,11703,9362,4681,2341,0,0,0,0,0,0,0,0,0,0,0
|
||||
};
|
||||
|
||||
// X X X Y | X X X X | X Y X X
|
||||
short filt24_3[24] __attribute__((aligned(16))) ={
|
||||
short filt24_3[24] __attribute__((aligned(32))) ={
|
||||
0,0,0,2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0,0,0
|
||||
};
|
||||
short filt24_3_dcl[24] __attribute__((aligned(16))) ={
|
||||
short filt24_3_dcl[24] __attribute__((aligned(32))) ={
|
||||
0,0,0,2341,4681,7022,9362,14043,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0,0,0
|
||||
};
|
||||
// X X X Y | X X DC X X | X Y X X
|
||||
short filt24_3_dcr[24] __attribute__((aligned(16))) ={
|
||||
short filt24_3_dcr[24] __attribute__((aligned(32))) ={
|
||||
0,0,0,2730,5461,8192,10922,13653,16384,14043,11703,7022,4681,2341,0,0,0,0,0,0,0,0,0,0
|
||||
};
|
||||
|
||||
|
||||
short filt24_4[24] __attribute__((aligned(16))) ={
|
||||
short filt24_4[24] __attribute__((aligned(32))) ={
|
||||
0,0,0,0,2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0,0
|
||||
};
|
||||
short filt24_4_dcl[24] __attribute__((aligned(16))) ={
|
||||
short filt24_4_dcl[24] __attribute__((aligned(32))) ={
|
||||
0,0,0,0,2341,7022,9362,11703,14043,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0,0
|
||||
};
|
||||
short filt24_4_dcr[24] __attribute__((aligned(16))) ={
|
||||
short filt24_4_dcr[24] __attribute__((aligned(32))) ={
|
||||
0,0,0,0,2730,5461,8192,10922,13653,16384,14043,11703,7022,4681,2341,0,0,0,0,0,0,0,0,0
|
||||
};
|
||||
|
||||
short filt24_5[24] __attribute__((aligned(16))) ={
|
||||
short filt24_5[24] __attribute__((aligned(32))) ={
|
||||
0,0,0,0,0,2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0
|
||||
};
|
||||
// X X X Y | X X DC X X | X Y X X
|
||||
short filt24_5_dcl[24] __attribute__((aligned(16))) ={
|
||||
short filt24_5_dcl[24] __attribute__((aligned(32))) ={
|
||||
0,0,0,0,0,2341,4681,9362,11703,14043,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0
|
||||
};
|
||||
short filt24_5_dcr[24] __attribute__((aligned(16))) ={
|
||||
short filt24_5_dcr[24] __attribute__((aligned(32))) ={
|
||||
0,0,0,0,0,2730,5461,8192,10922,13653,16384,11703,9362,7022,4681,2730,0,0,0,0,0,0,0,0
|
||||
};
|
||||
|
||||
|
||||
short filt24_6[24] __attribute__((aligned(16))) ={
|
||||
short filt24_6[24] __attribute__((aligned(32))) ={
|
||||
0,0,0,0,0,0,2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0
|
||||
};
|
||||
short filt24_6_dcl[24] __attribute__((aligned(16))) ={
|
||||
short filt24_6_dcl[24] __attribute__((aligned(32))) ={
|
||||
0,0,0,0,0,0,4681,7022,9362,11703,14043,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0
|
||||
};
|
||||
short filt24_6_dcr[24] __attribute__((aligned(16))) ={
|
||||
short filt24_6_dcr[24] __attribute__((aligned(32))) ={
|
||||
0,0,0,0,0,0,2730,5461,8192,10922,13653,16384,14043,11703,9362,7022,4681,0,0,0,0,0,0,0
|
||||
};
|
||||
|
||||
|
||||
short filt24_7[24] __attribute__((aligned(16))) ={
|
||||
short filt24_7[24] __attribute__((aligned(32))) ={
|
||||
0,0,0,0,0,0,0,2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0
|
||||
};
|
||||
short filt24_7_dcl[24] __attribute__((aligned(16))) ={
|
||||
short filt24_7_dcl[24] __attribute__((aligned(32))) ={
|
||||
0,0,0,0,0,0,0,4681,7022,9362,11703,14043,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0
|
||||
};
|
||||
short filt24_7_dcr[24] __attribute__((aligned(16))) ={
|
||||
short filt24_7_dcr[24] __attribute__((aligned(32))) ={
|
||||
0,0,0,0,0,0,0,2730,5461,8192,10922,13653,16384,14043,11703,9362,7022,4681,0,0,0,0,0,0
|
||||
};
|
||||
|
||||
short filt24_0l[24] __attribute__((aligned(16))) ={
|
||||
short filt24_0l[24] __attribute__((aligned(32))) ={
|
||||
30037,27306,24576,21845,19114,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
};
|
||||
short filt24_1l[24] __attribute__((aligned(16))) ={
|
||||
short filt24_1l[24] __attribute__((aligned(32))) ={
|
||||
0,30037,27306,24576,21845,19114,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
};
|
||||
short filt24_2l[24] __attribute__((aligned(16))) ={
|
||||
short filt24_2l[24] __attribute__((aligned(32))) ={
|
||||
0,0,30037,27306,24576,21845,19114,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0,0,0,0
|
||||
};
|
||||
short filt24_3l[24] __attribute__((aligned(16))) ={
|
||||
short filt24_3l[24] __attribute__((aligned(32))) ={
|
||||
//0,0,0,30037,27306,24576,21845,19114,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0,0,0};
|
||||
0,0,0,0,0,24576,21845,19114,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0,0,0
|
||||
};
|
||||
short filt24_4l[24] __attribute__((aligned(16))) ={
|
||||
short filt24_4l[24] __attribute__((aligned(32))) ={
|
||||
0,0,0,0,30037,27306,24576,21845,19114,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0,0
|
||||
};
|
||||
short filt24_5l[24] __attribute__((aligned(16))) ={
|
||||
short filt24_5l[24] __attribute__((aligned(32))) ={
|
||||
0,0,0,0,0,30037,27306,24576,21845,19114,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0
|
||||
};
|
||||
short filt24_6l[24] __attribute__((aligned(16))) ={
|
||||
short filt24_6l[24] __attribute__((aligned(32))) ={
|
||||
0,0,0,0,0,0,30037,27306,24576,21845,19114,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0
|
||||
};
|
||||
short filt24_7l[24] __attribute__((aligned(16))) ={
|
||||
short filt24_7l[24] __attribute__((aligned(32))) ={
|
||||
0,0,0,0,0,0,0,30037,27306,24576,21845,19114,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0
|
||||
};
|
||||
short filt24_0l2[24] __attribute__((aligned(16))) ={
|
||||
short filt24_0l2[24] __attribute__((aligned(32))) ={
|
||||
2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
};
|
||||
short filt24_1l2[24] __attribute__((aligned(16))) ={
|
||||
short filt24_1l2[24] __attribute__((aligned(32))) ={
|
||||
0,2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
};
|
||||
short filt24_2l2[24] __attribute__((aligned(16))) ={
|
||||
short filt24_2l2[24] __attribute__((aligned(32))) ={
|
||||
-2730,0,2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0,0,0,0
|
||||
};
|
||||
short filt24_3l2[24] __attribute__((aligned(16))) ={
|
||||
short filt24_3l2[24] __attribute__((aligned(32))) ={
|
||||
-5461,-2730,0,2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0,0,0
|
||||
};
|
||||
short filt24_4l2[24] __attribute__((aligned(16))) ={
|
||||
short filt24_4l2[24] __attribute__((aligned(32))) ={
|
||||
-8192,-5461,-2730,0,2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0,0
|
||||
};
|
||||
short filt24_5l2[24] __attribute__((aligned(16))) ={
|
||||
short filt24_5l2[24] __attribute__((aligned(32))) ={
|
||||
0,-8192,-5461,-2730,0,2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0
|
||||
};
|
||||
short filt24_6l2[24] __attribute__((aligned(16))) ={
|
||||
short filt24_6l2[24] __attribute__((aligned(32))) ={
|
||||
-13653,-10922,-8192,-5461,-2730,0,2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0
|
||||
};
|
||||
short filt24_7l2[24] __attribute__((aligned(16))) ={
|
||||
short filt24_7l2[24] __attribute__((aligned(32))) ={
|
||||
0,-13653,-10922,-8192,-5461,-2730,0,2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0
|
||||
};
|
||||
short filt24_0r[24] __attribute__((aligned(16))) ={
|
||||
short filt24_0r[24] __attribute__((aligned(32))) ={
|
||||
2730,5461,8192,10922,13653,16384,19114,21845,24576,27306,30037,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
};
|
||||
short filt24_1r[24] __attribute__((aligned(16))) ={
|
||||
short filt24_1r[24] __attribute__((aligned(32))) ={
|
||||
0,2730,5461,8192,10922,13653,16384,19114,21845,24576,27306,30037,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
};
|
||||
short filt24_2r[24] __attribute__((aligned(16))) ={
|
||||
short filt24_2r[24] __attribute__((aligned(32))) ={
|
||||
0,0,2730,5461,8192,10922,13653,16384,19114,21845,24576,27306,30037,0,0,0,0,0,0,0,0,0,0,0
|
||||
};
|
||||
short filt24_3r[24] __attribute__((aligned(16))) ={
|
||||
short filt24_3r[24] __attribute__((aligned(32))) ={
|
||||
0,0,0,2730,5461,8192,10922,13653,16384,19114,21845,24576,27306,30037,0,0,0,0,0,0,0,0,0,0
|
||||
};
|
||||
short filt24_4r[24] __attribute__((aligned(16))) ={
|
||||
short filt24_4r[24] __attribute__((aligned(32))) ={
|
||||
0,0,0,0,2730,5461,8192,10922,13653,16384,19114,21845,24576,27306,30037,0,0,0,0,0,0,0,0,0
|
||||
};
|
||||
short filt24_5r[24] __attribute__((aligned(16))) ={
|
||||
short filt24_5r[24] __attribute__((aligned(32))) ={
|
||||
0,0,0,0,0,2730,5461,8192,10922,13653,16384,19114,21845,24576,27306,30037,0,0,0,0,0,0,0,0
|
||||
};
|
||||
short filt24_6r[24] __attribute__((aligned(16))) ={
|
||||
short filt24_6r[24] __attribute__((aligned(32))) ={
|
||||
0,0,0,0,0,0,2730,5461,8192,10922,13653,16384,19114,21845,24576,27306,30037,0,0,0,0,0,0,0
|
||||
};
|
||||
short filt24_7r[24] __attribute__((aligned(16))) ={
|
||||
short filt24_7r[24] __attribute__((aligned(32))) ={
|
||||
0,0,0,0,0,0,0,2730,5461,8192,10922,13653,16384,19114,21845,24576,27306,30037,0,0,0,0,0,0
|
||||
};
|
||||
short filt24_0r2[24] __attribute__((aligned(16))) ={ /****/
|
||||
short filt24_0r2[24] __attribute__((aligned(32))) ={ /****/
|
||||
2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,-2730,-5461,-8192,-10922,-13653,0,0,0,0,0,0,0
|
||||
};
|
||||
short filt24_1r2[24] __attribute__((aligned(16))) ={
|
||||
short filt24_1r2[24] __attribute__((aligned(32))) ={
|
||||
0,2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,-2730,-5461,-8192,-10922,-13653,0,0,0,0,0,0
|
||||
};
|
||||
short filt24_2r2[24] __attribute__((aligned(16))) ={
|
||||
short filt24_2r2[24] __attribute__((aligned(32))) ={
|
||||
0,0,2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,-2730,-5461,-8192,-10922,-13653,0,0,0,0,0
|
||||
};
|
||||
short filt24_3r2[24] __attribute__((aligned(16))) ={
|
||||
short filt24_3r2[24] __attribute__((aligned(32))) ={
|
||||
0,0,0,2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,-2730,-5461,-8192,-10922,-13653,0,0,0,0
|
||||
};
|
||||
short filt24_4r2[24] __attribute__((aligned(16))) ={
|
||||
short filt24_4r2[24] __attribute__((aligned(32))) ={
|
||||
0,0,0,0,2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,-2730,-5461,-8192,-10922,-13653,0,0,0
|
||||
};
|
||||
short filt24_5r2[24] __attribute__((aligned(16))) ={
|
||||
short filt24_5r2[24] __attribute__((aligned(32))) ={
|
||||
0,0,0,0,0,2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,-2730,-5461,-8192,-10922,-13653,0,0
|
||||
};
|
||||
short filt24_6r2[24] __attribute__((aligned(16))) ={
|
||||
short filt24_6r2[24] __attribute__((aligned(32))) ={
|
||||
0,0,0,0,0,0,2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,-2730,-5461,-8192,-10922,-13653,0
|
||||
};
|
||||
short filt24_7r2[24] __attribute__((aligned(16))) ={
|
||||
short filt24_7r2[24] __attribute__((aligned(32))) ={
|
||||
0,0,0,0,0,0,0,2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,-2730,-5461,-8192,-10922,-13653
|
||||
};
|
||||
|
||||
@@ -29,8 +29,6 @@
|
||||
#include "PHY/types.h"
|
||||
#include "PHY/defs.h"
|
||||
#include "PHY/extern.h"
|
||||
#include "MAC_INTERFACE/defs.h"
|
||||
#include "MAC_INTERFACE/extern.h"
|
||||
|
||||
#define DEBUG_PHY
|
||||
|
||||
|
||||
@@ -203,8 +203,9 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue,
|
||||
multadd_complex_vector_real_scalar(dl_ch-(phy_vars_ue->lte_frame_parms.ofdm_symbol_size<<1),
|
||||
phy_vars_ue->ch_est_alpha,dl_ch-(phy_vars_ue->lte_frame_parms.ofdm_symbol_size<<1),
|
||||
1,phy_vars_ue->lte_frame_parms.ofdm_symbol_size);
|
||||
|
||||
|
||||
#ifdef DEBUG_CH
|
||||
printf("k %d, first_carrier %d\n",k,phy_vars_ue->lte_frame_parms.first_carrier_offset);
|
||||
#endif
|
||||
if ((phy_vars_ue->lte_frame_parms.N_RB_DL==6) ||
|
||||
(phy_vars_ue->lte_frame_parms.N_RB_DL==50) ||
|
||||
(phy_vars_ue->lte_frame_parms.N_RB_DL==100)) {
|
||||
@@ -213,7 +214,9 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue,
|
||||
// Treat first 2 pilots specially (left edge)
|
||||
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
||||
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
||||
// printf("pilot 0 : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||
#ifdef DEBUG_CH
|
||||
printf("pilot 0 : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||
#endif
|
||||
multadd_real_vector_complex_scalar(fl,
|
||||
ch,
|
||||
dl_ch,
|
||||
@@ -224,7 +227,9 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue,
|
||||
|
||||
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
||||
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
||||
// printf("pilot 1 : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||
#ifdef DEBUG_CH
|
||||
printf("pilot 1 : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||
#endif
|
||||
multadd_real_vector_complex_scalar(f2l2,
|
||||
ch,
|
||||
dl_ch,
|
||||
@@ -235,15 +240,13 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue,
|
||||
|
||||
for (pilot_cnt=2; pilot_cnt<((phy_vars_ue->lte_frame_parms.N_RB_DL)-1); pilot_cnt+=2) {
|
||||
|
||||
// printf("%d\n",dl_ch-(int16_t *)&dl_ch_estimates[(p<<1)+aarx][ch_offset]);
|
||||
|
||||
// printf("pilot[%d][%d] (%d,%d)\n",p,pilot_cnt,pil[0],pil[1]);
|
||||
// printf("rx[%d] -> (%d,%d)\n", k, rxF[0], rxF[1]);
|
||||
|
||||
|
||||
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15); //Re
|
||||
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15); //Im
|
||||
// printf("**rb %d %d\n",rb,dl_ch-(int16_t *)&dl_ch_estimates[(p<<1)+aarx][ch_offset]);
|
||||
#ifdef DEBUG_CH
|
||||
printf("pilot %d : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||
#endif
|
||||
multadd_real_vector_complex_scalar(f,
|
||||
ch,
|
||||
dl_ch,
|
||||
@@ -254,13 +257,11 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue,
|
||||
rxF+=12;
|
||||
dl_ch+=8;
|
||||
|
||||
// printf("pilot[%d][%d] (%d,%d)\n",p,rb,pil[0],pil[1]);
|
||||
// printf("rx[%d] -> (%d,%d)\n", k+6, rxF[0], rxF[1]);
|
||||
|
||||
|
||||
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
||||
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
||||
// printf("**rb %d %d\n",rb,dl_ch-(int16_t *)&dl_ch_estimates[(p<<1)+aarx][ch_offset]);
|
||||
#ifdef DEBUG_CH
|
||||
printf("pilot %d : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt+1,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||
#endif
|
||||
multadd_real_vector_complex_scalar(f2,
|
||||
ch,
|
||||
dl_ch,
|
||||
@@ -281,15 +282,17 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue,
|
||||
|
||||
rxF = (int16_t *)&rxdataF[aarx][((symbol_offset+1+k))];
|
||||
|
||||
#ifdef DEBUG_CH
|
||||
printf("second half k %d\n",k);
|
||||
#endif
|
||||
for (pilot_cnt=0; pilot_cnt<((phy_vars_ue->lte_frame_parms.N_RB_DL)-3); pilot_cnt+=2) {
|
||||
// printf("pilot[%d][%d] (%d,%d)\n",p,pilot_cnt,pil[0],pil[1]);
|
||||
// printf("rx[%d] -> (%d,%d)\n", k+6, rxF[0], rxF[1]);
|
||||
|
||||
|
||||
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
||||
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
||||
|
||||
// printf("**rb %d %d\n",rb,dl_ch-(int16_t *)&dl_ch_estimates[(p<<1)+aarx][ch_offset]);
|
||||
#ifdef DEBUG_CH
|
||||
printf("pilot %d : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||
#endif
|
||||
multadd_real_vector_complex_scalar(f,
|
||||
ch,
|
||||
dl_ch,
|
||||
@@ -300,8 +303,9 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue,
|
||||
|
||||
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
||||
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
||||
|
||||
// printf("**rb %d %d\n",rb,dl_ch-(int16_T *)&dl_ch_estimates[(p<<1)+aarx][ch_offset]);
|
||||
#ifdef DEBUG_CH
|
||||
printf("pilot %d : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt+1,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||
#endif
|
||||
multadd_real_vector_complex_scalar(f2,
|
||||
ch,
|
||||
dl_ch,
|
||||
@@ -314,8 +318,9 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue,
|
||||
|
||||
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
||||
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
||||
// printf("pilot 49: rxF -> (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||
|
||||
#ifdef DEBUG_CH
|
||||
printf("pilot %d: rxF -> (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||
#endif
|
||||
multadd_real_vector_complex_scalar(fr,
|
||||
ch,
|
||||
dl_ch,
|
||||
@@ -326,7 +331,9 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue,
|
||||
|
||||
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
||||
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
||||
// printf("pilot 50: rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||
#ifdef DEBUG_CH
|
||||
printf("pilot %d: rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt+1,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||
#endif
|
||||
multadd_real_vector_complex_scalar(f2r2,
|
||||
ch,
|
||||
dl_ch,
|
||||
|
||||
@@ -771,7 +771,8 @@ int lte_dl_mbsfn_channel_estimation(PHY_VARS_UE *phy_vars_ue,
|
||||
break;
|
||||
case 75:
|
||||
idft1536((int16_t*) &phy_vars_ue->lte_ue_common_vars.dl_ch_estimates[eNB_offset][aa][8],
|
||||
(int16_t*) phy_vars_ue->lte_ue_common_vars.dl_ch_estimates_time[eNB_offset][aa]);
|
||||
(int16_t*) phy_vars_ue->lte_ue_common_vars.dl_ch_estimates_time[eNB_offset][aa],
|
||||
1);
|
||||
break;
|
||||
case 100:
|
||||
idft2048((int16_t*) &phy_vars_ue->lte_ue_common_vars.dl_ch_estimates[eNB_offset][aa][8],
|
||||
|
||||
@@ -56,7 +56,6 @@ void lte_eNB_I0_measurements(PHY_VARS_eNB *phy_vars_eNB,
|
||||
int32_t n0_power_tot;
|
||||
int len;
|
||||
int offset;
|
||||
//int Nsymb = (frame_parms->Ncp==NORMAL)?14:12;
|
||||
// noise measurements
|
||||
// for the moment we measure the noise on the 7th OFDM symbol (in S subframe)
|
||||
|
||||
@@ -68,8 +67,8 @@ void lte_eNB_I0_measurements(PHY_VARS_eNB *phy_vars_eNB,
|
||||
|
||||
|
||||
phy_measurements->n0_power[aarx] = ((k1*signal_energy(&eNB_common_vars->rxdata[eNB_id][aarx][(frame_parms->samples_per_tti<<1) -frame_parms->ofdm_symbol_size],
|
||||
frame_parms->ofdm_symbol_size)) + k2*phy_measurements->n0_power[aarx])>>10;
|
||||
phy_measurements->n0_power[aarx] = (phy_measurements->n0_power[aarx] * 12*frame_parms->N_RB_DL)/(frame_parms->ofdm_symbol_size);
|
||||
frame_parms->ofdm_symbol_size)) + k2*phy_measurements->n0_power[aarx])>>10;
|
||||
//phy_measurements->n0_power[aarx] = (phy_measurements->n0_power[aarx]) * 12*frame_parms->N_RB_DL)/(frame_parms->ofdm_symbol_size);
|
||||
phy_measurements->n0_power_dB[aarx] = (unsigned short) dB_fixed(phy_measurements->n0_power[aarx]);
|
||||
phy_measurements->n0_power_tot += phy_measurements->n0_power[aarx];
|
||||
}
|
||||
@@ -88,7 +87,7 @@ void lte_eNB_I0_measurements(PHY_VARS_eNB *phy_vars_eNB,
|
||||
|
||||
// select the 7th symbol in an uplink subframe
|
||||
offset = (frame_parms->first_carrier_offset + (rb*12))%frame_parms->ofdm_symbol_size;
|
||||
offset += (7*frame_parms->ofdm_symbol_size);//(((Nsymb*subframe)+7)*frame_parms->ofdm_symbol_size);
|
||||
offset += (7*frame_parms->ofdm_symbol_size);
|
||||
ul_ch = &eNB_common_vars->rxdataF[eNB_id][aarx][offset];
|
||||
len = 12;
|
||||
// just do first half of middle PRB for odd number of PRBs
|
||||
|
||||
@@ -37,8 +37,6 @@
|
||||
#include "PHY/defs.h"
|
||||
#include "PHY/extern.h"
|
||||
#include "SCHED/extern.h"
|
||||
#include "MAC_INTERFACE/defs.h"
|
||||
#include "MAC_INTERFACE/extern.h"
|
||||
#include <math.h>
|
||||
|
||||
#ifdef OPENAIR2
|
||||
@@ -52,8 +50,8 @@
|
||||
int* sync_corr_ue0 = NULL;
|
||||
int* sync_corr_ue1 = NULL;
|
||||
int* sync_corr_ue2 = NULL;
|
||||
int sync_tmp[2048*4] __attribute__((aligned(16)));
|
||||
short syncF_tmp[2048*2] __attribute__((aligned(16)));
|
||||
int sync_tmp[2048*4] __attribute__((aligned(32)));
|
||||
short syncF_tmp[2048*2] __attribute__((aligned(32)));
|
||||
|
||||
|
||||
|
||||
@@ -172,12 +170,13 @@ int lte_sync_time_init(LTE_DL_FRAME_PARMS *frame_parms ) // LTE_UE_COMMON *com
|
||||
|
||||
case 75:
|
||||
idft1536((short*)syncF_tmp, /// complex input
|
||||
(short*)sync_tmp); /// complex output
|
||||
(short*)sync_tmp,
|
||||
1); /// complex output
|
||||
break;
|
||||
case 100:
|
||||
idft2048((short*)syncF_tmp, /// complex input
|
||||
(short*)sync_tmp, /// complex output
|
||||
1);
|
||||
(short*)sync_tmp, /// complex output
|
||||
1);
|
||||
break;
|
||||
default:
|
||||
LOG_E(PHY,"Unsupported N_RB_DL %d\n",frame_parms->N_RB_DL);
|
||||
@@ -219,8 +218,8 @@ int lte_sync_time_init(LTE_DL_FRAME_PARMS *frame_parms ) // LTE_UE_COMMON *com
|
||||
|
||||
case 75:
|
||||
idft1536((short*)syncF_tmp, /// complex input
|
||||
(short*)sync_tmp /// complex output
|
||||
);
|
||||
(short*)sync_tmp, /// complex output
|
||||
1);
|
||||
break;
|
||||
case 100:
|
||||
idft2048((short*)syncF_tmp, /// complex input
|
||||
@@ -267,8 +266,8 @@ int lte_sync_time_init(LTE_DL_FRAME_PARMS *frame_parms ) // LTE_UE_COMMON *com
|
||||
|
||||
case 75:
|
||||
idft1536((short*)syncF_tmp, /// complex input
|
||||
(short*)sync_tmp /// complex output
|
||||
);
|
||||
(short*)sync_tmp, /// complex output
|
||||
1);
|
||||
break;
|
||||
case 100:
|
||||
idft2048((short*)syncF_tmp, /// complex input
|
||||
@@ -346,6 +345,8 @@ static inline int abs32(int x)
|
||||
int debug_cnt=0;
|
||||
#endif
|
||||
|
||||
#define SHIFT 17
|
||||
|
||||
int lte_sync_time(int **rxdata, ///rx data in time domain
|
||||
LTE_DL_FRAME_PARMS *frame_parms,
|
||||
int *eNB_id)
|
||||
@@ -414,8 +415,8 @@ int lte_sync_time(int **rxdata, ///rx data in time domain
|
||||
//calculate dot product of primary_synch0_time and rxdata[ar][n] (ar=0..nb_ant_rx) and store the sum in temp[n];
|
||||
for (ar=0; ar<frame_parms->nb_antennas_rx; ar++) {
|
||||
|
||||
result = dot_product((short*)primary_synch0_time, (short*) &(rxdata[ar][n]), frame_parms->ofdm_symbol_size, 15);
|
||||
result2 = dot_product((short*)primary_synch0_time, (short*) &(rxdata[ar][n+length]), frame_parms->ofdm_symbol_size, 15);
|
||||
result = dot_product((short*)primary_synch0_time, (short*) &(rxdata[ar][n]), frame_parms->ofdm_symbol_size, SHIFT);
|
||||
result2 = dot_product((short*)primary_synch0_time, (short*) &(rxdata[ar][n+length]), frame_parms->ofdm_symbol_size, SHIFT);
|
||||
|
||||
((short*)sync_corr_ue0)[2*n] += ((short*) &result)[0];
|
||||
((short*)sync_corr_ue0)[2*n+1] += ((short*) &result)[1];
|
||||
@@ -428,8 +429,8 @@ int lte_sync_time(int **rxdata, ///rx data in time domain
|
||||
}
|
||||
|
||||
for (ar=0; ar<frame_parms->nb_antennas_rx; ar++) {
|
||||
result = dot_product((short*)primary_synch1_time, (short*) &(rxdata[ar][n]), frame_parms->ofdm_symbol_size, 15);
|
||||
result2 = dot_product((short*)primary_synch1_time, (short*) &(rxdata[ar][n+length]), frame_parms->ofdm_symbol_size, 15);
|
||||
result = dot_product((short*)primary_synch1_time, (short*) &(rxdata[ar][n]), frame_parms->ofdm_symbol_size, SHIFT);
|
||||
result2 = dot_product((short*)primary_synch1_time, (short*) &(rxdata[ar][n+length]), frame_parms->ofdm_symbol_size, SHIFT);
|
||||
((short*)sync_corr_ue1)[2*n] += ((short*) &result)[0];
|
||||
((short*)sync_corr_ue1)[2*n+1] += ((short*) &result)[1];
|
||||
((short*)sync_corr_ue1)[2*(length+n)] += ((short*) &result2)[0];
|
||||
@@ -443,8 +444,8 @@ int lte_sync_time(int **rxdata, ///rx data in time domain
|
||||
|
||||
for (ar=0; ar<frame_parms->nb_antennas_rx; ar++) {
|
||||
|
||||
result = dot_product((short*)primary_synch2_time, (short*) &(rxdata[ar][n]), frame_parms->ofdm_symbol_size, 15);
|
||||
result2 = dot_product((short*)primary_synch2_time, (short*) &(rxdata[ar][n+length]), frame_parms->ofdm_symbol_size, 15);
|
||||
result = dot_product((short*)primary_synch2_time, (short*) &(rxdata[ar][n]), frame_parms->ofdm_symbol_size, SHIFT);
|
||||
result2 = dot_product((short*)primary_synch2_time, (short*) &(rxdata[ar][n+length]), frame_parms->ofdm_symbol_size, SHIFT);
|
||||
((short*)sync_corr_ue2)[2*n] += ((short*) &result)[0];
|
||||
((short*)sync_corr_ue2)[2*n+1] += ((short*) &result)[1];
|
||||
((short*)sync_corr_ue2)[2*(length+n)] += ((short*) &result2)[0];
|
||||
@@ -558,7 +559,7 @@ int lte_sync_time_eNB(int32_t **rxdata, ///rx data in time domain
|
||||
//calculate dot product of primary_synch0_time and rxdata[ar][n] (ar=0..nb_ant_rx) and store the sum in temp[n];
|
||||
for (ar=0; ar<frame_parms->nb_antennas_rx; ar++) {
|
||||
|
||||
result = dot_product((short*)primary_synch_time, (short*) &(rxdata[ar][n]), frame_parms->ofdm_symbol_size, 15);
|
||||
result = dot_product((short*)primary_synch_time, (short*) &(rxdata[ar][n]), frame_parms->ofdm_symbol_size, SHIFT);
|
||||
//((short*)sync_corr)[2*n] += ((short*) &result)[0];
|
||||
//((short*)sync_corr)[2*n+1] += ((short*) &result)[1];
|
||||
sync_corr_eNB[n] += abs32(result);
|
||||
|
||||
@@ -56,8 +56,8 @@ void lte_sync_timefreq(PHY_VARS_UE *ue,int band,unsigned int DL_freq)
|
||||
{
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
UE_SCAN_INFO_t *scan_info = &ue->scan_info[band];
|
||||
int16_t spectrum[12288] __attribute__((aligned(16)));
|
||||
int16_t spectrum_p5ms[12288] __attribute__((aligned(16)));
|
||||
int16_t spectrum[12288] __attribute__((aligned(32)));
|
||||
int16_t spectrum_p5ms[12288] __attribute__((aligned(32)));
|
||||
int i,f,band_idx;
|
||||
__m128i autocorr0[256/4],autocorr1[256/4],autocorr2[256/4];
|
||||
__m128i autocorr0_t[256/4],autocorr1_t[256/4],autocorr2_t[256/4];
|
||||
|
||||
@@ -73,7 +73,7 @@ void lte_gold_mbsfn(LTE_DL_FRAME_PARMS *frame_parms,uint32_t lte_gold_mbsfn_tabl
|
||||
|
||||
|
||||
int lte_dl_cell_spec(PHY_VARS_eNB *phy_vars_eNB,
|
||||
mod_sym_t *output,
|
||||
int32_t *output,
|
||||
short amp,
|
||||
unsigned char Ns,
|
||||
unsigned char l,
|
||||
@@ -89,7 +89,7 @@ int lte_dl_cell_spec(PHY_VARS_eNB *phy_vars_eNB,
|
||||
*/
|
||||
int lte_dl_ue_spec(PHY_VARS_eNB *phy_vars_eNB,
|
||||
uint8_t UE_id,
|
||||
mod_sym_t *output,
|
||||
int32_t *output,
|
||||
short amp,
|
||||
uint8_t Ns,
|
||||
uint8_t p,
|
||||
@@ -102,7 +102,7 @@ int lte_dl_ue_spec(PHY_VARS_eNB *phy_vars_eNB,
|
||||
@param Ns Slot number (0..19)
|
||||
@param l symbol (0,1,2)
|
||||
*/
|
||||
int lte_dl_mbsfn(PHY_VARS_eNB *phy_vars_eNB, mod_sym_t *output,
|
||||
int lte_dl_mbsfn(PHY_VARS_eNB *phy_vars_eNB, int32_t *output,
|
||||
short amp,
|
||||
int subframe,
|
||||
unsigned char l);
|
||||
@@ -148,7 +148,7 @@ void free_ul_ref_sigs(void);
|
||||
@sub_frame_offset Offset of this subframe in units of subframes
|
||||
*/
|
||||
|
||||
int lte_generate_srs(mod_sym_t **txdataF,
|
||||
int lte_generate_srs(int32_t **txdataF,
|
||||
short amp,
|
||||
LTE_DL_FRAME_PARMS *frame_parms,
|
||||
unsigned int sub_frame_offset);
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
|
||||
//Calibration
|
||||
int lte_dl_cell_spec_SS(PHY_VARS_eNB *phy_vars_eNB,
|
||||
mod_sym_t *output,
|
||||
int32_t *output,
|
||||
short amp,
|
||||
unsigned char Ns,
|
||||
unsigned char l,//nb of sym per slot
|
||||
@@ -50,7 +50,7 @@ int lte_dl_cell_spec_SS(PHY_VARS_eNB *phy_vars_eNB,
|
||||
|
||||
unsigned char nu,mprime,mprime_dword,mprime_qpsk_symb,m;
|
||||
unsigned short k,a;
|
||||
mod_sym_t qpsk[4];
|
||||
int32_t qpsk[4];
|
||||
|
||||
a = (amp*ONE_OVER_SQRT2_Q15)>>15;
|
||||
((short *)&qpsk[0])[0] = a;
|
||||
@@ -121,7 +121,7 @@ int lte_dl_cell_spec_SS(PHY_VARS_eNB *phy_vars_eNB,
|
||||
|
||||
|
||||
int lte_dl_cell_spec(PHY_VARS_eNB *phy_vars_eNB,
|
||||
mod_sym_t *output,
|
||||
int32_t *output,
|
||||
short amp,
|
||||
unsigned char Ns,
|
||||
unsigned char l,
|
||||
@@ -130,7 +130,7 @@ int lte_dl_cell_spec(PHY_VARS_eNB *phy_vars_eNB,
|
||||
|
||||
unsigned char nu,mprime,mprime_dword,mprime_qpsk_symb,m;
|
||||
unsigned short k,a;
|
||||
mod_sym_t qpsk[4];
|
||||
int32_t qpsk[4];
|
||||
|
||||
a = (amp*ONE_OVER_SQRT2_Q15)>>15;
|
||||
((short *)&qpsk[0])[0] = a;
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
//extern unsigned int lte_gold_table[10][3][42];
|
||||
//#define DEBUG_DL_MBSFN
|
||||
|
||||
int lte_dl_mbsfn(PHY_VARS_eNB *phy_vars_eNB, mod_sym_t *output,
|
||||
int lte_dl_mbsfn(PHY_VARS_eNB *phy_vars_eNB, int32_t *output,
|
||||
short amp,
|
||||
int subframe,
|
||||
unsigned char l)
|
||||
@@ -47,7 +47,7 @@ int lte_dl_mbsfn(PHY_VARS_eNB *phy_vars_eNB, mod_sym_t *output,
|
||||
|
||||
unsigned int mprime,mprime_dword,mprime_qpsk_symb,m;
|
||||
unsigned short k=0,a;
|
||||
mod_sym_t qpsk[4];
|
||||
int32_t qpsk[4];
|
||||
|
||||
a = (amp*ONE_OVER_SQRT2_Q15)>>15;
|
||||
((short *)&qpsk[0])[0] = a;
|
||||
|
||||
@@ -54,14 +54,14 @@ int Wbar_NCP[8][4] = {{1,1,1,1},{1,-1,1,-1},{1,1,1,1},{1,-1,1,-1},{1,1,-1,-1},{-
|
||||
|
||||
int lte_dl_ue_spec(PHY_VARS_eNB *phy_vars_eNB,
|
||||
uint8_t UE_id,
|
||||
mod_sym_t *output,
|
||||
int32_t *output,
|
||||
short amp,
|
||||
uint8_t Ns,
|
||||
uint8_t p,
|
||||
int SS_flag )
|
||||
{
|
||||
|
||||
mod_sym_t qpsk[4],nqpsk[4],*qpsk_p,*output_p;
|
||||
int32_t qpsk[4],nqpsk[4],*qpsk_p,*output_p;
|
||||
int16_t a;
|
||||
int w,lprime,ind,l,ind_dword,ind_qpsk_symb,nPRB;
|
||||
// LTE_eNB_DLSCH_t *dlsch = phy_vars_eNB->dlsch_eNB[UE_id][0];
|
||||
|
||||
@@ -61,21 +61,18 @@ void lte_gold(LTE_DL_FRAME_PARMS *frame_parms,uint32_t lte_gold_table[20][2][14]
|
||||
|
||||
x2 = Ncp +
|
||||
(Nid_cell<<1) +
|
||||
(((1+(Nid_cell<<1))*(1 + (((frame_parms->Ncp==0)?4:3)*l) + (7*(1+ns))))<<10); //cinit
|
||||
(((1+(Nid_cell<<1))*(1 + (((frame_parms->Ncp==0)?4:3)*l) + (7*(1+ns))))<<10); //cinit
|
||||
//x2 = frame_parms->Ncp + (Nid_cell<<1) + (1+(Nid_cell<<1))*(1 + (3*l) + (7*(1+ns))); //cinit
|
||||
//n = 0
|
||||
// printf("cinit (ns %d, l %d) => %d\n",ns,l,x2);
|
||||
x1 = 1+ (1<<31);
|
||||
x2=x2 ^ ((x2 ^ (x2>>1) ^ (x2>>2) ^ (x2>>3))<<31);
|
||||
|
||||
// skip first 50 double words (1600 bits)
|
||||
//printf("n=0 : x1 %x, x2 %x\n",x1,x2);
|
||||
for (n=1; n<50; n++) {
|
||||
x1 = (x1>>1) ^ (x1>>4);
|
||||
x1 = x1 ^ (x1<<31) ^ (x1<<28);
|
||||
x2 = (x2>>1) ^ (x2>>2) ^ (x2>>3) ^ (x2>>4);
|
||||
x2 = x2 ^ (x2<<31) ^ (x2<<30) ^ (x2<<29) ^ (x2<<28);
|
||||
// printf("x1 : %x, x2 : %x\n",x1,x2);
|
||||
}
|
||||
|
||||
for (n=0; n<14; n++) {
|
||||
@@ -84,7 +81,6 @@ void lte_gold(LTE_DL_FRAME_PARMS *frame_parms,uint32_t lte_gold_table[20][2][14]
|
||||
x2 = (x2>>1) ^ (x2>>2) ^ (x2>>3) ^ (x2>>4);
|
||||
x2 = x2 ^ (x2<<31) ^ (x2<<30) ^ (x2<<29) ^ (x2<<28);
|
||||
lte_gold_table[ns][l][n] = x1^x2;
|
||||
// printf("n=%d : c %x\n",n,x1^x2);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -272,12 +272,12 @@ uint32_t Y;
|
||||
//#define Mquad (Msymb/4)
|
||||
|
||||
static uint32_t bitrev_cc_dci[32] = {1,17,9,25,5,21,13,29,3,19,11,27,7,23,15,31,0,16,8,24,4,20,12,28,2,18,10,26,6,22,14,30};
|
||||
static mod_sym_t wtemp[2][Msymb];
|
||||
static int32_t wtemp[2][Msymb];
|
||||
|
||||
void pdcch_interleaving(LTE_DL_FRAME_PARMS *frame_parms,mod_sym_t **z, mod_sym_t **wbar,uint8_t n_symbols_pdcch,uint8_t mi)
|
||||
void pdcch_interleaving(LTE_DL_FRAME_PARMS *frame_parms,int32_t **z, int32_t **wbar,uint8_t n_symbols_pdcch,uint8_t mi)
|
||||
{
|
||||
|
||||
mod_sym_t *wptr,*wptr2,*zptr;
|
||||
int32_t *wptr,*wptr2,*zptr;
|
||||
uint32_t Mquad = get_nquad(n_symbols_pdcch,frame_parms,mi);
|
||||
uint32_t RCC = (Mquad>>5), ND;
|
||||
uint32_t row,col,Kpi,index;
|
||||
@@ -2027,7 +2027,7 @@ uint8_t generate_dci_top(uint8_t num_ue_spec_dci,
|
||||
uint32_t n_rnti,
|
||||
int16_t amp,
|
||||
LTE_DL_FRAME_PARMS *frame_parms,
|
||||
mod_sym_t **txdataF,
|
||||
int32_t **txdataF,
|
||||
uint32_t subframe)
|
||||
{
|
||||
|
||||
@@ -2038,10 +2038,10 @@ uint8_t generate_dci_top(uint8_t num_ue_spec_dci,
|
||||
int16_t re_offset;
|
||||
uint8_t mi = get_mi(frame_parms,subframe);
|
||||
static uint8_t e[DCI_BITS_MAX];
|
||||
static mod_sym_t yseq0[Msymb],yseq1[Msymb],wbar0[Msymb],wbar1[Msymb];
|
||||
static int32_t yseq0[Msymb],yseq1[Msymb],wbar0[Msymb],wbar1[Msymb];
|
||||
|
||||
mod_sym_t *y[2];
|
||||
mod_sym_t *wbar[2];
|
||||
int32_t *y[2];
|
||||
int32_t *wbar[2];
|
||||
|
||||
int nushiftmod3 = frame_parms->nushift%3;
|
||||
|
||||
|
||||
@@ -40,8 +40,6 @@
|
||||
#include "PHY/defs.h"
|
||||
#include "PHY/extern.h"
|
||||
#include "SCHED/defs.h"
|
||||
#include "MAC_INTERFACE/defs.h"
|
||||
#include "MAC_INTERFACE/extern.h"
|
||||
#ifdef DEBUG_DCI_TOOLS
|
||||
#include "PHY/vars.h"
|
||||
#endif
|
||||
@@ -253,8 +251,8 @@ void conv_rballoc(uint8_t ra_header,uint32_t rb_alloc,uint32_t N_RB_DL,uint32_t
|
||||
*/
|
||||
// printf("rb_alloc[1]=%x,rb_alloc[0]=%x\n",rb_alloc2[1],rb_alloc2[0]);
|
||||
} else {
|
||||
LOG_E(PHY,"resource type 1 not supported for N_RB_DL=100\n");
|
||||
mac_xface->macphy_exit("resource type 1 not supported for N_RB_DL=100\n");
|
||||
LOG_E(PHY,"resource type 1 not supported for N_RB_DL=50\n");
|
||||
// mac_xface->macphy_exit("resource type 1 not supported for N_RB_DL=100\n");
|
||||
/*
|
||||
subset = rb_alloc&1;
|
||||
shift = (rb_alloc>>1)&1;
|
||||
@@ -284,7 +282,7 @@ void conv_rballoc(uint8_t ra_header,uint32_t rb_alloc,uint32_t N_RB_DL,uint32_t
|
||||
}
|
||||
} else {
|
||||
LOG_E(PHY,"resource type 1 not supported for N_RB_DL=100\n");
|
||||
mac_xface->macphy_exit("resource type 1 not supported for N_RB_DL=100\n");
|
||||
// mac_xface->macphy_exit("resource type 1 not supported for N_RB_DL=100\n");
|
||||
/*
|
||||
subset = rb_alloc&1;
|
||||
shift = (rb_alloc>>1)&1;
|
||||
@@ -734,11 +732,11 @@ void generate_RIV_tables()
|
||||
if (nVRB<32)
|
||||
alloc0 |= (1<<nVRB);
|
||||
else if (nVRB<64)
|
||||
alloc1 |= (1<<(nVRB-33));
|
||||
alloc1 |= (1<<(nVRB-32));
|
||||
else if (nVRB<96)
|
||||
alloc2 |= (1<<(nVRB-65));
|
||||
alloc2 |= (1<<(nVRB-64));
|
||||
else
|
||||
alloc3 |= (1<<(nVRB-97));
|
||||
alloc3 |= (1<<(nVRB-96));
|
||||
|
||||
// Distributed Gap1, even slot
|
||||
nVRB_even_dist = get_prb(100,0,nVRB,0);
|
||||
@@ -770,9 +768,9 @@ void generate_RIV_tables()
|
||||
else if (nVRB_odd_dist<64)
|
||||
allocdist1_0_odd |= (1<<(nVRB_odd_dist-32));
|
||||
else if (nVRB_odd_dist<96)
|
||||
allocdist2_0_odd |= (1<<(nVRB_odd_dist-65));
|
||||
allocdist2_0_odd |= (1<<(nVRB_odd_dist-64));
|
||||
else
|
||||
allocdist3_0_odd |= (1<<(nVRB_odd_dist-97));
|
||||
allocdist3_0_odd |= (1<<(nVRB_odd_dist-96));
|
||||
|
||||
|
||||
// Distributed Gap2, even slot
|
||||
@@ -4467,7 +4465,7 @@ int generate_ue_dlsch_params_from_dci(int frame,
|
||||
dlsch[0]->g_pucch += delta_PUCCH_lut[TPC&3];
|
||||
|
||||
if (TPC!=1)
|
||||
LOG_I(PHY,"format1 TPC %d, dlsch0_harq->delta_PUCCH %d\n",TPC,dlsch0_harq->delta_PUCCH);
|
||||
LOG_D(PHY,"format1 TPC %d, dlsch0_harq->delta_PUCCH %d\n",TPC,dlsch0_harq->delta_PUCCH);
|
||||
|
||||
dlsch0_harq->rvidx = rv;
|
||||
|
||||
@@ -4476,7 +4474,7 @@ int generate_ue_dlsch_params_from_dci(int frame,
|
||||
|
||||
dlsch0_harq->dl_power_off = 1; //no power offset
|
||||
|
||||
LOG_D(PHY,"UE (%x/%d): Subframe %d Format2 DCI: ndi %d, old_ndi %d (first tx %d) harq_status %d\n",dlsch[0]->rnti,harq_pid,subframe,ndi,dlsch0_harq->DCINdi,
|
||||
LOG_D(PHY,"UE (%x/%d): Subframe %d Format1 DCI: ndi %d, old_ndi %d (first tx %d) harq_status %d\n",dlsch[0]->rnti,harq_pid,subframe,ndi,dlsch0_harq->DCINdi,
|
||||
dlsch0_harq->first_tx,dlsch0_harq->status);
|
||||
|
||||
// printf("Format2 DCI (UE, hard pid %d): ndi %d, old_ndi %d (first tx %d)\n",harq_pid,ndi,dlsch0_harq->DCINdi,
|
||||
@@ -7129,10 +7127,10 @@ int generate_eNB_ulsch_params_from_dci(void *dci_pdu,
|
||||
|
||||
harq_pid = subframe2harq_pid(frame_parms,
|
||||
pdcch_alloc2ul_frame(frame_parms,
|
||||
phy_vars_eNB->proc[sched_subframe].frame_tx,
|
||||
subframe),
|
||||
phy_vars_eNB->proc[sched_subframe].frame_tx,
|
||||
subframe),
|
||||
pdcch_alloc2ul_subframe(frame_parms,subframe));
|
||||
|
||||
|
||||
// printf("eNB: sched_subframe %d, subframe %d, frame_tx %d\n",sched_subframe,subframe,phy_vars_eNB->proc[sched_subframe].frame_tx);
|
||||
|
||||
switch (frame_parms->N_RB_DL) {
|
||||
@@ -7600,9 +7598,9 @@ int generate_eNB_ulsch_params_from_dci(void *dci_pdu,
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
ulsch->harq_processes[harq_pid]->O_RI = 0;//1;
|
||||
ulsch->harq_processes[harq_pid]->O_RI = 0;
|
||||
ulsch->harq_processes[harq_pid]->Or2 = 0;
|
||||
ulsch->harq_processes[harq_pid]->Or1 = 0;//sizeof_HLC_subband_cqi_nopmi_5MHz;
|
||||
ulsch->harq_processes[harq_pid]->Or1 = 0;
|
||||
ulsch->harq_processes[harq_pid]->uci_format = HLC_subband_cqi_nopmi;
|
||||
}
|
||||
|
||||
|
||||
@@ -269,8 +269,10 @@ typedef struct {
|
||||
uint32_t G;
|
||||
/// Codebook index for this dlsch (0,1,2,3)
|
||||
uint8_t codebook_index;
|
||||
/// Maximum number of HARQ rounds (for definition see 36-212 V8.6 2009-03, p.17)
|
||||
/// Maximum number of HARQ processes (for definition see 36-212 V8.6 2009-03, p.17)
|
||||
uint8_t Mdlharq;
|
||||
/// Maximum number of HARQ rounds
|
||||
uint8_t Mlimit;
|
||||
/// MIMO transmission mode indicator for this sub-frame (for definition see 36-212 V8.6 2009-03, p.17)
|
||||
uint8_t Kmimo;
|
||||
/// Nsoft parameter related to UE Category
|
||||
@@ -315,11 +317,9 @@ typedef struct {
|
||||
/// Scrambled "b"-sequences (for definition see 36-211 V8.6 2009-03, p.14)
|
||||
uint8_t b_tilde[MAX_NUM_CHANNEL_BITS];
|
||||
/// Modulated "d"-sequences (for definition see 36-211 V8.6 2009-03, p.14)
|
||||
mod_sym_t d[MAX_NUM_RE];
|
||||
int32_t d[MAX_NUM_RE];
|
||||
/// Transform-coded "z"-sequences (for definition see 36-211 V8.6 2009-03, p.14-15)
|
||||
mod_sym_t z[MAX_NUM_RE];
|
||||
/// Maximum number of HARQ rounds (for definition see 36-212 V8.6 2009-03, p.17)
|
||||
uint8_t Mdlharq;
|
||||
int32_t z[MAX_NUM_RE];
|
||||
/// "q" sequences for CQI/PMI (for definition see 36-212 V8.6 2009-03, p.27)
|
||||
uint8_t q[MAX_CQI_PAYLOAD];
|
||||
/// coded and interleaved CQI bits
|
||||
@@ -468,8 +468,8 @@ typedef struct {
|
||||
typedef struct {
|
||||
/// Pointers to 8 HARQ processes for the ULSCH
|
||||
LTE_UL_eNB_HARQ_t *harq_processes[8];
|
||||
/// Maximum number of HARQ rounds (for definition see 36-212 V8.6 2009-03, p.17)
|
||||
uint8_t Mdlharq;
|
||||
/// Maximum number of HARQ rounds
|
||||
uint8_t Mlimit;
|
||||
/// Maximum number of iterations used in eNB turbo decoder
|
||||
uint8_t max_turbo_iterations;
|
||||
/// ACK/NAK Bundling flag
|
||||
@@ -572,6 +572,10 @@ typedef struct {
|
||||
vrb_t vrb_type;
|
||||
/// downlink power offset field
|
||||
uint8_t dl_power_off;
|
||||
/// trials per round statistics
|
||||
uint32_t trials[8];
|
||||
/// error statistics per round
|
||||
uint32_t errors[8];
|
||||
} LTE_DL_UE_HARQ_t;
|
||||
|
||||
typedef struct {
|
||||
@@ -698,7 +702,7 @@ typedef struct {
|
||||
harq_status_t harq_ack[10];
|
||||
/// Pointers to up to 8 HARQ processes
|
||||
LTE_DL_UE_HARQ_t *harq_processes[8];
|
||||
/// Maximum number of HARQ rounds (for definition see 36-212 V8.6 2009-03, p.17
|
||||
/// Maximum number of HARQ processes(for definition see 36-212 V8.6 2009-03, p.17
|
||||
uint8_t Mdlharq;
|
||||
/// MIMO transmission mode indicator for this sub-frame (for definition see 36-212 V8.6 2009-03, p.17)
|
||||
uint8_t Kmimo;
|
||||
|
||||
@@ -44,6 +44,7 @@
|
||||
#include "PHY/CODING/extern.h"
|
||||
#include "PHY/CODING/lte_interleaver_inline.h"
|
||||
#include "PHY/LTE_TRANSPORT/defs.h"
|
||||
#include "PHY/LTE_TRANSPORT/proto.h"
|
||||
#include "SCHED/defs.h"
|
||||
#include "defs.h"
|
||||
#include "UTIL/LOG/vcd_signal_dumper.h"
|
||||
@@ -92,11 +93,11 @@ void free_eNB_dlsch(LTE_eNB_DLSCH_t *dlsch)
|
||||
#endif
|
||||
|
||||
for (r=0; r<MAX_NUM_DLSCH_SEGMENTS; r++) {
|
||||
|
||||
|
||||
#ifdef DEBUG_DLSCH_FREE
|
||||
msg("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;
|
||||
@@ -105,17 +106,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->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)
|
||||
@@ -149,6 +150,7 @@ LTE_eNB_DLSCH_t *new_eNB_dlsch(unsigned char Kmimo,unsigned char Mdlharq,uint32_
|
||||
bzero(dlsch,sizeof(LTE_eNB_DLSCH_t));
|
||||
dlsch->Kmimo = Kmimo;
|
||||
dlsch->Mdlharq = Mdlharq;
|
||||
dlsch->Mlimit = 4;
|
||||
dlsch->Nsoft = Nsoft;
|
||||
|
||||
for (i=0; i<10; i++)
|
||||
@@ -205,28 +207,28 @@ LTE_eNB_DLSCH_t *new_eNB_dlsch(unsigned char Kmimo,unsigned char Mdlharq,uint32_
|
||||
for (i=0; i<Mdlharq; i++) {
|
||||
dlsch->harq_processes[i]->round=0;
|
||||
|
||||
if (abstraction_flag==0) {
|
||||
for (j=0; j<96; j++)
|
||||
for (r=0; r<MAX_NUM_DLSCH_SEGMENTS/bw_scaling; r++) {
|
||||
// printf("dlsch->harq_processes[%d]->d[%d] %p\n",i,r,dlsch->harq_processes[i]->d[r]);
|
||||
dlsch->harq_processes[i]->d[r][j] = LTE_NULL;
|
||||
}
|
||||
}
|
||||
for (j=0; j<96; j++)
|
||||
for (r=0; r<MAX_NUM_DLSCH_SEGMENTS/bw_scaling; r++) {
|
||||
// printf("dlsch->harq_processes[%d]->d[%d] %p\n",i,r,dlsch->harq_processes[i]->d[r]);
|
||||
if (dlsch->harq_processes[i]->d[r])
|
||||
dlsch->harq_processes[i]->d[r][j] = LTE_NULL;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return(dlsch);
|
||||
}
|
||||
}
|
||||
|
||||
LOG_D(PHY, "new_eNB_dlsch exit flag %d, size of %ld\n",
|
||||
exit_flag, sizeof(LTE_eNB_DLSCH_t));
|
||||
LOG_D(PHY,"new_eNB_dlsch exit flag %d, size of %ld\n",
|
||||
exit_flag, sizeof(LTE_eNB_DLSCH_t));
|
||||
free_eNB_dlsch(dlsch);
|
||||
return(NULL);
|
||||
|
||||
|
||||
}
|
||||
|
||||
void clean_eNb_dlsch(LTE_eNB_DLSCH_t *dlsch, uint8_t abstraction_flag)
|
||||
void clean_eNb_dlsch(LTE_eNB_DLSCH_t *dlsch)
|
||||
{
|
||||
|
||||
unsigned char Mdlharq;
|
||||
@@ -246,12 +248,11 @@ void clean_eNb_dlsch(LTE_eNB_DLSCH_t *dlsch, uint8_t abstraction_flag)
|
||||
dlsch->harq_processes[i]->status = 0;
|
||||
dlsch->harq_processes[i]->round = 0;
|
||||
|
||||
if (abstraction_flag==0) {
|
||||
for (j=0; j<96; j++)
|
||||
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;
|
||||
}
|
||||
for (j=0; j<96; j++)
|
||||
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;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -117,7 +117,7 @@ LTE_UE_DLSCH_t *new_ue_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint32_t Nsoft,uint8_
|
||||
dlsch->max_turbo_iterations = max_turbo_iterations;
|
||||
|
||||
for (i=0; i<Mdlharq; i++) {
|
||||
// msg("new_ue_dlsch: Harq process %d\n",i);
|
||||
// printf("new_ue_dlsch: Harq process %d\n",i);
|
||||
dlsch->harq_processes[i] = (LTE_DL_UE_HARQ_t *)malloc16(sizeof(LTE_DL_UE_HARQ_t));
|
||||
|
||||
if (dlsch->harq_processes[i]) {
|
||||
@@ -156,7 +156,7 @@ LTE_UE_DLSCH_t *new_ue_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint32_t Nsoft,uint8_
|
||||
return(dlsch);
|
||||
}
|
||||
|
||||
msg("new_ue_dlsch with size %zu: exit_flag = %u\n",sizeof(LTE_DL_UE_HARQ_t), exit_flag);
|
||||
printf("new_ue_dlsch with size %zu: exit_flag = %u\n",sizeof(LTE_DL_UE_HARQ_t), exit_flag);
|
||||
free_ue_dlsch(dlsch);
|
||||
|
||||
return(NULL);
|
||||
@@ -187,6 +187,27 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue,
|
||||
uint8_t crc_type;
|
||||
#ifdef DEBUG_DLSCH_DECODING
|
||||
uint16_t i;
|
||||
#endif
|
||||
#ifdef __AVX2__
|
||||
int Kr_last,skipped_last=0;
|
||||
uint8_t (*tc_2cw)(int16_t *y,
|
||||
int16_t *y2,
|
||||
uint8_t *,
|
||||
uint8_t *,
|
||||
uint16_t,
|
||||
uint16_t,
|
||||
uint16_t,
|
||||
uint8_t,
|
||||
uint8_t,
|
||||
uint8_t,
|
||||
time_stats_t *,
|
||||
time_stats_t *,
|
||||
time_stats_t *,
|
||||
time_stats_t *,
|
||||
time_stats_t *,
|
||||
time_stats_t *,
|
||||
time_stats_t *);
|
||||
|
||||
#endif
|
||||
uint8_t (*tc)(int16_t *y,
|
||||
uint8_t *,
|
||||
@@ -204,28 +225,35 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue,
|
||||
time_stats_t *,
|
||||
time_stats_t *);
|
||||
|
||||
|
||||
|
||||
|
||||
if (!dlsch_llr) {
|
||||
msg("dlsch_decoding.c: NULL dlsch_llr pointer\n");
|
||||
printf("dlsch_decoding.c: NULL dlsch_llr pointer\n");
|
||||
return(dlsch->max_turbo_iterations);
|
||||
}
|
||||
|
||||
if (!harq_process) {
|
||||
msg("dlsch_decoding.c: NULL harq_process pointer\n");
|
||||
printf("dlsch_decoding.c: NULL harq_process pointer\n");
|
||||
return(dlsch->max_turbo_iterations);
|
||||
}
|
||||
|
||||
if (!frame_parms) {
|
||||
msg("dlsch_decoding.c: NULL frame_parms pointer\n");
|
||||
printf("dlsch_decoding.c: NULL frame_parms pointer\n");
|
||||
return(dlsch->max_turbo_iterations);
|
||||
}
|
||||
|
||||
if (subframe>9) {
|
||||
msg("dlsch_decoding.c: Illegal subframe index %d\n",subframe);
|
||||
printf("dlsch_decoding.c: Illegal subframe index %d\n",subframe);
|
||||
return(dlsch->max_turbo_iterations);
|
||||
}
|
||||
|
||||
if (llr8_flag == 0)
|
||||
if (llr8_flag == 0) {
|
||||
#ifdef __AVX2__
|
||||
tc_2cw = phy_threegpplte_turbo_decoder16avx2;
|
||||
#endif
|
||||
tc = phy_threegpplte_turbo_decoder16;
|
||||
}
|
||||
else
|
||||
tc = phy_threegpplte_turbo_decoder8;
|
||||
|
||||
@@ -233,16 +261,19 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue,
|
||||
|
||||
/*
|
||||
if (nb_rb > frame_parms->N_RB_DL) {
|
||||
msg("dlsch_decoding.c: Illegal nb_rb %d\n",nb_rb);
|
||||
printf("dlsch_decoding.c: Illegal nb_rb %d\n",nb_rb);
|
||||
return(max_turbo_iterations);
|
||||
}*/
|
||||
|
||||
/*harq_pid = dlsch->current_harq_pid;
|
||||
if (harq_pid >= 8) {
|
||||
msg("dlsch_decoding.c: Illegal harq_pid %d\n",harq_pid);
|
||||
printf("dlsch_decoding.c: Illegal harq_pid %d\n",harq_pid);
|
||||
return(max_turbo_iterations);
|
||||
}
|
||||
*/
|
||||
|
||||
harq_process->trials[harq_process->round]++;
|
||||
|
||||
A = harq_process->TBS; //2072 for QPSK 1/3
|
||||
|
||||
ret = dlsch->max_turbo_iterations;
|
||||
@@ -251,7 +282,7 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue,
|
||||
G = harq_process->G;
|
||||
//get_G(frame_parms,nb_rb,dlsch->rb_alloc,mod_order,num_pdcch_symbols,phy_vars_ue->frame,subframe);
|
||||
|
||||
// msg("DLSCH Decoding, harq_pid %d Ndi %d\n",harq_pid,harq_process->Ndi);
|
||||
// printf("DLSCH Decoding, harq_pid %d Ndi %d\n",harq_pid,harq_process->Ndi);
|
||||
|
||||
if (harq_process->round == 0) {
|
||||
// This is a new packet, so compute quantities regarding segmentation
|
||||
@@ -270,7 +301,7 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue,
|
||||
|
||||
/*
|
||||
else {
|
||||
msg("dlsch_decoding.c: Ndi>0 not checked yet!!\n");
|
||||
printf("dlsch_decoding.c: Ndi>0 not checked yet!!\n");
|
||||
return(max_turbo_iterations);
|
||||
}
|
||||
*/
|
||||
@@ -297,10 +328,14 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue,
|
||||
break;
|
||||
}
|
||||
|
||||
if (harq_process->C >= MAX_NUM_DLSCH_SEGMENTS/bw_scaling) {
|
||||
if (harq_process->C > MAX_NUM_DLSCH_SEGMENTS/bw_scaling) {
|
||||
LOG_E(PHY,"Illegal harq_process->C %d > %d\n",harq_process->C,MAX_NUM_DLSCH_SEGMENTS/bw_scaling);
|
||||
return((1+dlsch->max_turbo_iterations));
|
||||
}
|
||||
#ifdef DEBUG_DLSCH_DECODING
|
||||
printf("Segmentation: C %d, Cminus %d, Kminus %d, Kplus %d\n",harq_process->C,harq_process->Cminus,harq_process->Kminus,harq_process->Kplus);
|
||||
#endif
|
||||
|
||||
for (r=0; r<harq_process->C; r++) {
|
||||
|
||||
|
||||
@@ -321,7 +356,7 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue,
|
||||
else if (Kr_bytes <= 768)
|
||||
iind = 123 + ((Kr_bytes-256)>>3);
|
||||
else {
|
||||
msg("dlsch_decoding: Illegal codeword size %d!!!\n",Kr_bytes);
|
||||
printf("dlsch_decoding: Illegal codeword size %d!!!\n",Kr_bytes);
|
||||
return(dlsch->max_turbo_iterations);
|
||||
}
|
||||
|
||||
@@ -415,15 +450,12 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue,
|
||||
printf("\n");
|
||||
*/
|
||||
|
||||
//#ifndef __AVX2__
|
||||
#if 1
|
||||
if (err_flag == 0) {
|
||||
|
||||
start_meas(dlsch_turbo_decoding_stats);
|
||||
#ifdef TURBO_S
|
||||
ret = phy_threegpplte_turbo_decoder_scalar
|
||||
#else
|
||||
|
||||
ret = tc
|
||||
#endif
|
||||
(&harq_process->d[r][96],
|
||||
harq_process->c[r],
|
||||
Kr,
|
||||
@@ -443,7 +475,130 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue,
|
||||
|
||||
stop_meas(dlsch_turbo_decoding_stats);
|
||||
}
|
||||
#else
|
||||
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);
|
||||
ret = tc
|
||||
(&harq_process->d[r][96],
|
||||
harq_process->c[r],
|
||||
Kr,
|
||||
f1f2mat_old[iind*2],
|
||||
f1f2mat_old[(iind*2)+1],
|
||||
dlsch->max_turbo_iterations,
|
||||
crc_type,
|
||||
(r==0) ? harq_process->F : 0,
|
||||
&phy_vars_ue->dlsch_tc_init_stats,
|
||||
&phy_vars_ue->dlsch_tc_alpha_stats,
|
||||
&phy_vars_ue->dlsch_tc_beta_stats,
|
||||
&phy_vars_ue->dlsch_tc_gamma_stats,
|
||||
&phy_vars_ue->dlsch_tc_ext_stats,
|
||||
&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);
|
||||
// printf("single decode, exit\n");
|
||||
// exit(-1);
|
||||
}
|
||||
else {
|
||||
// we can merge code segments
|
||||
if ((skipped_last == 0) && (r<harq_process->C-1)) {
|
||||
skipped_last = 1;
|
||||
Kr_last = Kr;
|
||||
}
|
||||
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]);
|
||||
#endif
|
||||
start_meas(dlsch_turbo_decoding_stats);
|
||||
#ifdef DEBUG_DLSCH_DECODING
|
||||
printf("double decoding segments %d,%d (%p,%p)\n",r-1,r,&harq_process->d[r-1][96],&harq_process->d[r][96]);
|
||||
#endif
|
||||
ret = tc_2cw
|
||||
(&harq_process->d[r-1][96],
|
||||
&harq_process->d[r][96],
|
||||
harq_process->c[r-1],
|
||||
harq_process->c[r],
|
||||
Kr,
|
||||
f1f2mat_old[iind*2],
|
||||
f1f2mat_old[(iind*2)+1],
|
||||
dlsch->max_turbo_iterations,
|
||||
crc_type,
|
||||
(r==0) ? harq_process->F : 0,
|
||||
&phy_vars_ue->dlsch_tc_init_stats,
|
||||
&phy_vars_ue->dlsch_tc_alpha_stats,
|
||||
&phy_vars_ue->dlsch_tc_beta_stats,
|
||||
&phy_vars_ue->dlsch_tc_gamma_stats,
|
||||
&phy_vars_ue->dlsch_tc_ext_stats,
|
||||
&phy_vars_ue->dlsch_tc_intl1_stats,
|
||||
&phy_vars_ue->dlsch_tc_intl2_stats); //(is_crnti==0)?harq_pid:harq_pid+1);
|
||||
/*
|
||||
ret = tc
|
||||
(&harq_process->d[r-1][96],
|
||||
harq_process->c[r-1],
|
||||
Kr_last,
|
||||
f1f2mat_old[iind*2],
|
||||
f1f2mat_old[(iind*2)+1],
|
||||
dlsch->max_turbo_iterations,
|
||||
crc_type,
|
||||
(r==0) ? harq_process->F : 0,
|
||||
&phy_vars_ue->dlsch_tc_init_stats,
|
||||
&phy_vars_ue->dlsch_tc_alpha_stats,
|
||||
&phy_vars_ue->dlsch_tc_beta_stats,
|
||||
&phy_vars_ue->dlsch_tc_gamma_stats,
|
||||
&phy_vars_ue->dlsch_tc_ext_stats,
|
||||
&phy_vars_ue->dlsch_tc_intl1_stats,
|
||||
&phy_vars_ue->dlsch_tc_intl2_stats); //(is_crnti==0)?harq_pid:harq_pid+1);
|
||||
|
||||
exit(-1);*/
|
||||
stop_meas(dlsch_turbo_decoding_stats);
|
||||
}
|
||||
else { // Kr_last != Kr
|
||||
start_meas(dlsch_turbo_decoding_stats);
|
||||
ret = tc
|
||||
(&harq_process->d[r-1][96],
|
||||
harq_process->c[r-1],
|
||||
Kr_last,
|
||||
f1f2mat_old[iind*2],
|
||||
f1f2mat_old[(iind*2)+1],
|
||||
dlsch->max_turbo_iterations,
|
||||
crc_type,
|
||||
(r==0) ? harq_process->F : 0,
|
||||
&phy_vars_ue->dlsch_tc_init_stats,
|
||||
&phy_vars_ue->dlsch_tc_alpha_stats,
|
||||
&phy_vars_ue->dlsch_tc_beta_stats,
|
||||
&phy_vars_ue->dlsch_tc_gamma_stats,
|
||||
&phy_vars_ue->dlsch_tc_ext_stats,
|
||||
&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],
|
||||
harq_process->c[r],
|
||||
Kr,
|
||||
f1f2mat_old[iind*2],
|
||||
f1f2mat_old[(iind*2)+1],
|
||||
dlsch->max_turbo_iterations,
|
||||
crc_type,
|
||||
(r==0) ? harq_process->F : 0,
|
||||
&phy_vars_ue->dlsch_tc_init_stats,
|
||||
&phy_vars_ue->dlsch_tc_alpha_stats,
|
||||
&phy_vars_ue->dlsch_tc_beta_stats,
|
||||
&phy_vars_ue->dlsch_tc_gamma_stats,
|
||||
&phy_vars_ue->dlsch_tc_ext_stats,
|
||||
&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);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
if ((err_flag == 0) && (ret>=(1+dlsch->max_turbo_iterations))) {// a Code segment is in error so break;
|
||||
@@ -457,6 +612,7 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue,
|
||||
dlsch->harq_ack[subframe].ack = 0;
|
||||
dlsch->harq_ack[subframe].harq_id = harq_pid;
|
||||
dlsch->harq_ack[subframe].send_harq_status = 1;
|
||||
harq_process->errors[harq_process->round]++;
|
||||
harq_process->round++;
|
||||
|
||||
// LOG_D(PHY,"[UE %d] DLSCH: Setting NACK for subframe %d (pid %d, round %d)\n",phy_vars_ue->Mod_id,subframe,harq_pid,harq_process->round);
|
||||
|
||||
@@ -281,7 +281,7 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue,
|
||||
// avgs = cmax(avgs,avg[(aarx<<1)+aatx]);
|
||||
|
||||
|
||||
lte_ue_pdsch_vars[eNB_id]->log2_maxh = (log2_approx(avgs)/2);
|
||||
lte_ue_pdsch_vars[eNB_id]->log2_maxh = (log2_approx(avgs)/2)+1;
|
||||
// + log2_approx(frame_parms->nb_antennas_tx_eNB-1) //-1 because log2_approx counts the number of bits
|
||||
// + log2_approx(frame_parms->nb_antennas_rx-1);
|
||||
|
||||
@@ -1898,17 +1898,17 @@ void dlsch_channel_compensation_TM3(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
|
||||
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
|
||||
|
||||
dl_ch0_128 = (__m128i *)&dl_ch_estimates_ext[aarx][symbol*frame_parms->N_RB_DL*12];
|
||||
dl_ch1_128 = (__m128i *)&dl_ch_estimates_ext[2+aarx][symbol*frame_parms->N_RB_DL*12];
|
||||
dl_ch0_128 = (__m128i *)&dl_ch_estimates_ext[aarx][symbol*frame_parms->N_RB_DL*12]; // hr,0
|
||||
dl_ch1_128 = (__m128i *)&dl_ch_estimates_ext[2+aarx][symbol*frame_parms->N_RB_DL*12]; // hr,1
|
||||
|
||||
|
||||
dl_ch_mag0_128 = (__m128i *)&dl_ch_mag0[aarx][symbol*frame_parms->N_RB_DL*12];
|
||||
dl_ch_mag0_128b = (__m128i *)&dl_ch_magb0[aarx][symbol*frame_parms->N_RB_DL*12];
|
||||
dl_ch_mag1_128 = (__m128i *)&dl_ch_mag1[aarx][symbol*frame_parms->N_RB_DL*12];
|
||||
dl_ch_mag1_128b = (__m128i *)&dl_ch_magb1[aarx][symbol*frame_parms->N_RB_DL*12];
|
||||
rxdataF128 = (__m128i *)&rxdataF_ext[aarx][symbol*frame_parms->N_RB_DL*12];
|
||||
rxdataF_comp0_128 = (__m128i *)&rxdataF_comp0[aarx][symbol*frame_parms->N_RB_DL*12];
|
||||
rxdataF_comp1_128 = (__m128i *)&rxdataF_comp1[aarx][symbol*frame_parms->N_RB_DL*12];
|
||||
rxdataF128 = (__m128i *)&rxdataF_ext[aarx][symbol*frame_parms->N_RB_DL*12]; // yr
|
||||
rxdataF_comp0_128 = (__m128i *)&rxdataF_comp0[aarx][symbol*frame_parms->N_RB_DL*12]; // yr,0 = yr * conj(hr,0)
|
||||
rxdataF_comp1_128 = (__m128i *)&rxdataF_comp1[aarx][symbol*frame_parms->N_RB_DL*12]; // yr,1 = yr * conj(hr,1)
|
||||
|
||||
|
||||
for (rb=0; rb<nb_rb; rb++) {
|
||||
|
||||
@@ -137,7 +137,7 @@ void layer1prec2A(int32_t *antenna0_sample, int32_t *antenna1_sample, uint8_t pr
|
||||
}
|
||||
|
||||
int allocate_REs_in_RB(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
mod_sym_t **txdataF,
|
||||
int32_t **txdataF,
|
||||
uint32_t *jj,
|
||||
uint32_t *jj2,
|
||||
uint16_t re_offset,
|
||||
@@ -981,7 +981,7 @@ int allocate_REs_in_RB(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
return(0);
|
||||
}
|
||||
|
||||
int allocate_REs_in_RB_MCH(mod_sym_t **txdataF,
|
||||
int allocate_REs_in_RB_MCH(int32_t **txdataF,
|
||||
uint32_t *jj,
|
||||
uint16_t re_offset,
|
||||
uint32_t symbol_offset,
|
||||
@@ -1178,7 +1178,7 @@ uint8_t get_pmi(uint8_t N_RB_DL,LTE_DL_eNB_HARQ_t *dlsch_harq,uint16_t rb)
|
||||
}
|
||||
|
||||
|
||||
int dlsch_modulation(mod_sym_t **txdataF,
|
||||
int dlsch_modulation(int32_t **txdataF,
|
||||
int16_t amp,
|
||||
uint32_t subframe_offset,
|
||||
LTE_DL_FRAME_PARMS *frame_parms,
|
||||
@@ -1492,7 +1492,7 @@ int dlsch_modulation(mod_sym_t **txdataF,
|
||||
return (re_allocated);
|
||||
}
|
||||
|
||||
int mch_modulation(mod_sym_t **txdataF,
|
||||
int mch_modulation(int32_t **txdataF,
|
||||
int16_t amp,
|
||||
uint32_t subframe_offset,
|
||||
LTE_DL_FRAME_PARMS *frame_parms,
|
||||
|
||||
@@ -63,7 +63,7 @@ int generate_drs_pusch(PHY_VARS_UE *phy_vars_ue,
|
||||
|
||||
uint8_t cyclic_shift,cyclic_shift0,cyclic_shift1;
|
||||
LTE_DL_FRAME_PARMS *frame_parms = &phy_vars_ue->lte_frame_parms;
|
||||
mod_sym_t *txdataF = phy_vars_ue->lte_ue_common_vars.txdataF[ant];
|
||||
int32_t *txdataF = phy_vars_ue->lte_ue_common_vars.txdataF[ant];
|
||||
uint32_t u,v,alpha_ind;
|
||||
uint32_t u0=frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.grouphop[subframe<<1];
|
||||
uint32_t u1=frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.grouphop[1+(subframe<<1)];
|
||||
@@ -147,13 +147,13 @@ int generate_drs_pusch(PHY_VARS_UE *phy_vars_ue,
|
||||
if (cyclic_shift == 0) {
|
||||
for (k=0; k<12; k++) {
|
||||
if ((ul_ref_sigs[u][v][Msc_RS_idx][drs_offset<<1] >= 0) && (ul_ref_sigs[u][v][Msc_RS_idx][(drs_offset<<1)+1] >= 0))
|
||||
txdataF[symbol_offset+re_offset] = (mod_sym_t) 1;
|
||||
txdataF[symbol_offset+re_offset] = (int32_t) 1;
|
||||
else if ((ul_ref_sigs[u][v][Msc_RS_idx][drs_offset<<1] >= 0) && (ul_ref_sigs[u][v][Msc_RS_idx][(drs_offset<<1)+1] < 0))
|
||||
txdataF[symbol_offset+re_offset] = (mod_sym_t) 2;
|
||||
txdataF[symbol_offset+re_offset] = (int32_t) 2;
|
||||
else if ((ul_ref_sigs[u][v][Msc_RS_idx][drs_offset<<1] < 0) && (ul_ref_sigs[u][v][Msc_RS_idx][(drs_offset<<1)+1] >= 0))
|
||||
txdataF[symbol_offset+re_offset] = (mod_sym_t) 3;
|
||||
txdataF[symbol_offset+re_offset] = (int32_t) 3;
|
||||
else if ((ul_ref_sigs[u][v][Msc_RS_idx][drs_offset<<1] < 0) && (ul_ref_sigs[u][v][Msc_RS_idx][(drs_offset<<1)+1] < 0))
|
||||
txdataF[symbol_offset+re_offset] = (mod_sym_t) 4;
|
||||
txdataF[symbol_offset+re_offset] = (int32_t) 4;
|
||||
|
||||
re_offset++;
|
||||
drs_offset++;
|
||||
@@ -165,22 +165,22 @@ int generate_drs_pusch(PHY_VARS_UE *phy_vars_ue,
|
||||
for (k=0; k<12; k++) {
|
||||
if(k%2 == 0) {
|
||||
if ((ul_ref_sigs[u][v][Msc_RS_idx][drs_offset<<1] >= 0) && (ul_ref_sigs[u][v][Msc_RS_idx][(drs_offset<<1)+1] >= 0))
|
||||
txdataF[symbol_offset+re_offset] = (mod_sym_t) 4;
|
||||
txdataF[symbol_offset+re_offset] = (int32_t) 4;
|
||||
else if ((ul_ref_sigs[u][v][Msc_RS_idx][drs_offset<<1] >= 0) && (ul_ref_sigs[u][v][Msc_RS_idx][(drs_offset<<1)+1] < 0))
|
||||
txdataF[symbol_offset+re_offset] = (mod_sym_t) 3;
|
||||
txdataF[symbol_offset+re_offset] = (int32_t) 3;
|
||||
else if ((ul_ref_sigs[u][v][Msc_RS_idx][drs_offset<<1] < 0) && (ul_ref_sigs[u][v][Msc_RS_idx][(drs_offset<<1)+1] >= 0))
|
||||
txdataF[symbol_offset+re_offset] = (mod_sym_t) 2;
|
||||
txdataF[symbol_offset+re_offset] = (int32_t) 2;
|
||||
else if ((ul_ref_sigs[u][v][Msc_RS_idx][drs_offset<<1] < 0) && (ul_ref_sigs[u][v][Msc_RS_idx][(drs_offset<<1)+1] < 0))
|
||||
txdataF[symbol_offset+re_offset] = (mod_sym_t) 1;
|
||||
txdataF[symbol_offset+re_offset] = (int32_t) 1;
|
||||
} else {
|
||||
if ((ul_ref_sigs[u][v][Msc_RS_idx][drs_offset<<1] >= 0) && (ul_ref_sigs[u][v][Msc_RS_idx][(drs_offset<<1)+1] >= 0))
|
||||
txdataF[symbol_offset+re_offset] = (mod_sym_t) 1;
|
||||
txdataF[symbol_offset+re_offset] = (int32_t) 1;
|
||||
else if ((ul_ref_sigs[u][v][Msc_RS_idx][drs_offset<<1] >= 0) && (ul_ref_sigs[u][v][Msc_RS_idx][(drs_offset<<1)+1] < 0))
|
||||
txdataF[symbol_offset+re_offset] = (mod_sym_t) 2;
|
||||
txdataF[symbol_offset+re_offset] = (int32_t) 2;
|
||||
else if ((ul_ref_sigs[u][v][Msc_RS_idx][drs_offset<<1] < 0) && (ul_ref_sigs[u][v][Msc_RS_idx][(drs_offset<<1)+1] >= 0))
|
||||
txdataF[symbol_offset+re_offset] = (mod_sym_t) 3;
|
||||
txdataF[symbol_offset+re_offset] = (int32_t) 3;
|
||||
else if ((ul_ref_sigs[u][v][Msc_RS_idx][drs_offset<<1] < 0) && (ul_ref_sigs[u][v][Msc_RS_idx][(drs_offset<<1)+1] < 0))
|
||||
txdataF[symbol_offset+re_offset] = (mod_sym_t) 4;
|
||||
txdataF[symbol_offset+re_offset] = (int32_t) 4;
|
||||
}
|
||||
|
||||
re_offset++;
|
||||
|
||||
@@ -52,7 +52,7 @@ void generate_grouphop(LTE_DL_FRAME_PARMS *frame_parms)
|
||||
|
||||
x2 = frame_parms->Nid_cell/30;
|
||||
#ifdef DEBUG_GROUPHOP
|
||||
msg("[PHY] GroupHop:");
|
||||
printf("[PHY] GroupHop:");
|
||||
#endif
|
||||
|
||||
for (ns=0; ns<20; ns++) {
|
||||
@@ -68,12 +68,12 @@ void generate_grouphop(LTE_DL_FRAME_PARMS *frame_parms)
|
||||
}
|
||||
|
||||
#ifdef DEBUG_GROUPHOP
|
||||
msg("%d.",frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.grouphop[ns]);
|
||||
printf("%d.",frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.grouphop[ns]);
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef DEBUG_GROUPHOP
|
||||
msg("\n");
|
||||
printf("\n");
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -89,7 +89,7 @@ void generate_seqhop(LTE_DL_FRAME_PARMS *frame_parms)
|
||||
|
||||
s = lte_gold_generic(&x1,&x2,reset);
|
||||
#ifdef DEBUG_GROUPHOP
|
||||
msg("[PHY] SeqHop:");
|
||||
printf("[PHY] SeqHop:");
|
||||
#endif
|
||||
|
||||
for (ns=0; ns<20; ns++) {
|
||||
@@ -100,12 +100,12 @@ void generate_seqhop(LTE_DL_FRAME_PARMS *frame_parms)
|
||||
frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.seqhop[ns] = 0;
|
||||
|
||||
#ifdef DEBUG_GROUPHOP
|
||||
msg("%d.",frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.seqhop[ns]);
|
||||
printf("%d.",frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.seqhop[ns]);
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef DEBUG_GROUPHOP
|
||||
msg("\n");
|
||||
printf("\n");
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -116,7 +116,7 @@ void generate_nPRS(LTE_DL_FRAME_PARMS *frame_parms)
|
||||
uint8_t reset=1;
|
||||
uint32_t x1, x2, s=0;
|
||||
// This is from Section 5.5.1.3
|
||||
uint8_t Nsymb_UL = (frame_parms->Ncp_UL == 0) ? 7 : 6;
|
||||
uint8_t Nsymb_UL = (frame_parms->Ncp_UL == NORMAL) ? 7 : 6;
|
||||
uint16_t next = 0;
|
||||
uint8_t ns=0;
|
||||
|
||||
@@ -124,7 +124,7 @@ void generate_nPRS(LTE_DL_FRAME_PARMS *frame_parms)
|
||||
|
||||
x2 = (32*(uint32_t)(frame_parms->Nid_cell/30)) + fss_pusch;
|
||||
#ifdef DEBUG_GROUPHOP
|
||||
msg("[PHY] nPRS:");
|
||||
printf("[PHY] nPRS:");
|
||||
#endif
|
||||
|
||||
for (n=0; n<(20*Nsymb_UL); n++) { //loop over total number of bytes to generate
|
||||
@@ -137,7 +137,7 @@ void generate_nPRS(LTE_DL_FRAME_PARMS *frame_parms)
|
||||
if (n == next) {
|
||||
frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.nPRS[ns] = ((uint8_t*)&s)[next&3];
|
||||
#ifdef DEBUG_GROUPHOP
|
||||
msg("%d.",frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.nPRS[ns]);
|
||||
printf("%d.",frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.nPRS[ns]);
|
||||
#endif
|
||||
ns++;
|
||||
next+=Nsymb_UL;
|
||||
@@ -145,7 +145,7 @@ void generate_nPRS(LTE_DL_FRAME_PARMS *frame_parms)
|
||||
}
|
||||
|
||||
#ifdef DEBUG_GROUPHOP
|
||||
msg("\n");
|
||||
printf("\n");
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
#define PBCH_A 24
|
||||
|
||||
int allocate_pbch_REs_in_RB(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
mod_sym_t **txdataF,
|
||||
int32_t **txdataF,
|
||||
uint32_t *jj,
|
||||
uint16_t re_offset,
|
||||
uint32_t symbol_offset,
|
||||
@@ -160,7 +160,7 @@ int allocate_pbch_REs_in_RB(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
|
||||
//uint8_t pbch_d[96+(3*(16+PBCH_A))], pbch_w[3*3*(16+PBCH_A)],pbch_e[1920]; //one bit per byte
|
||||
int generate_pbch(LTE_eNB_PBCH *eNB_pbch,
|
||||
mod_sym_t **txdataF,
|
||||
int32_t **txdataF,
|
||||
int amp,
|
||||
LTE_DL_FRAME_PARMS *frame_parms,
|
||||
uint8_t *pbch_pdu,
|
||||
|
||||
@@ -38,7 +38,6 @@
|
||||
* \warning
|
||||
*/
|
||||
#include "PHY/defs.h"
|
||||
#include "MAC_INTERFACE/extern.h"
|
||||
|
||||
//uint16_t pcfich_reg[4];
|
||||
//uint8_t pcfich_first_reg_idx = 0;
|
||||
@@ -144,12 +143,12 @@ uint8_t pcfich_b[4][32]= {{0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1
|
||||
void generate_pcfich(uint8_t num_pdcch_symbols,
|
||||
int16_t amp,
|
||||
LTE_DL_FRAME_PARMS *frame_parms,
|
||||
mod_sym_t **txdataF,
|
||||
int32_t **txdataF,
|
||||
uint8_t subframe)
|
||||
{
|
||||
|
||||
uint8_t pcfich_bt[32],nsymb,pcfich_quad;
|
||||
mod_sym_t pcfich_d[2][16];
|
||||
int32_t pcfich_d[2][16];
|
||||
uint8_t i;
|
||||
uint32_t symbol_offset,m,re_offset,reg_offset;
|
||||
int16_t gain_lin_QPSK;
|
||||
|
||||
@@ -393,8 +393,8 @@ void generate_phich_emul(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
|
||||
}
|
||||
|
||||
mod_sym_t alam_bpsk_perm1[4] = {2,1,4,3}; // -conj(x) 1 (-1-j) -> 2 (1-j), 2->1, 3 (-1+j) -> (4) 1+j, 4->3
|
||||
mod_sym_t alam_bpsk_perm2[4] = {3,4,2,1}; // conj(x) 1 (-1-j) -> 3 (-1+j), 3->1, 2 (1-j) -> 4 (1+j), 4->2
|
||||
int32_t alam_bpsk_perm1[4] = {2,1,4,3}; // -conj(x) 1 (-1-j) -> 2 (1-j), 2->1, 3 (-1+j) -> (4) 1+j, 4->3
|
||||
int32_t alam_bpsk_perm2[4] = {3,4,2,1}; // conj(x) 1 (-1-j) -> 3 (-1+j), 3->1, 2 (1-j) -> 4 (1+j), 4->2
|
||||
|
||||
// This routine generates the PHICH
|
||||
|
||||
@@ -404,7 +404,7 @@ void generate_phich(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
uint8_t ngroup_PHICH,
|
||||
uint8_t HI,
|
||||
uint8_t subframe,
|
||||
mod_sym_t **y)
|
||||
int32_t **y)
|
||||
{
|
||||
|
||||
int16_t d[24],*dp;
|
||||
@@ -1425,7 +1425,7 @@ void generate_phich_top(PHY_VARS_eNB *phy_vars_eNB,
|
||||
|
||||
LTE_DL_FRAME_PARMS *frame_parms=&phy_vars_eNB->lte_frame_parms;
|
||||
LTE_eNB_ULSCH_t **ulsch_eNB = phy_vars_eNB->ulsch_eNB;
|
||||
mod_sym_t **txdataF = phy_vars_eNB->lte_eNB_common_vars.txdataF[sect_id];
|
||||
int32_t **txdataF = phy_vars_eNB->lte_eNB_common_vars.txdataF[sect_id];
|
||||
uint8_t harq_pid;
|
||||
uint8_t Ngroup_PHICH,ngroup_PHICH,nseq_PHICH;
|
||||
uint8_t NSF_PHICH = 4;
|
||||
@@ -1466,7 +1466,6 @@ void generate_phich_top(PHY_VARS_eNB *phy_vars_eNB,
|
||||
|
||||
nseq_PHICH = ((ulsch_eNB[UE_id]->harq_processes[harq_pid]->first_rb/Ngroup_PHICH) +
|
||||
ulsch_eNB[UE_id]->harq_processes[harq_pid]->n_DMRS)%(2*NSF_PHICH);
|
||||
//#ifdef DEBUG_PHICH
|
||||
LOG_D(PHY,"[eNB %d][PUSCH %d] Frame %d subframe %d Generating PHICH, ngroup_PHICH %d/%d, nseq_PHICH %d : HI %d, first_rb %d dci_alloc %d)\n",
|
||||
phy_vars_eNB->Mod_id,harq_pid,phy_vars_eNB->proc[sched_subframe].frame_tx,
|
||||
subframe,ngroup_PHICH,Ngroup_PHICH,nseq_PHICH,
|
||||
@@ -1474,7 +1473,6 @@ void generate_phich_top(PHY_VARS_eNB *phy_vars_eNB,
|
||||
ulsch_eNB[UE_id]->harq_processes[harq_pid]->first_rb,
|
||||
ulsch_eNB[UE_id]->harq_processes[harq_pid]->dci_alloc);
|
||||
|
||||
//#endif
|
||||
if (ulsch_eNB[UE_id]->Msg3_active == 1) {
|
||||
LOG_D(PHY,"[eNB %d][PUSCH %d][RAPROC] Frame %d, subframe %d: Generating Msg3 PHICH for UE %d, ngroup_PHICH %d/%d, nseq_PHICH %d : HI %d, first_rb %d\n",
|
||||
phy_vars_eNB->Mod_id,harq_pid,phy_vars_eNB->proc[sched_subframe].frame_tx,subframe,
|
||||
@@ -1509,12 +1507,10 @@ void generate_phich_top(PHY_VARS_eNB *phy_vars_eNB,
|
||||
LOG_D(PHY,"[eNB %d][PUSCH %d] frame %d, subframe %d : PHICH NACK / (no format0 DCI) Setting subframe_scheduling_flag\n",
|
||||
phy_vars_eNB->Mod_id,harq_pid,phy_vars_eNB->proc[sched_subframe].frame_tx,subframe);
|
||||
ulsch_eNB[UE_id]->harq_processes[harq_pid]->subframe_scheduling_flag = 1;
|
||||
// ulsch_eNB[UE_id]->harq_processes[harq_pid]->Ndi = 0;
|
||||
// ulsch_eNB[UE_id]->harq_processes[harq_pid]->round++; //this is already done in phy_procedures
|
||||
ulsch_eNB[UE_id]->harq_processes[harq_pid]->rvidx = rv_table[ulsch_eNB[UE_id]->harq_processes[harq_pid]->round&3];
|
||||
ulsch_eNB[UE_id]->harq_processes[harq_pid]->O_RI = 0;
|
||||
ulsch_eNB[UE_id]->harq_processes[harq_pid]->Or2 = 0;
|
||||
ulsch_eNB[UE_id]->harq_processes[harq_pid]->Or1 = 0;//sizeof_HLC_subband_cqi_nopmi_5MHz;
|
||||
ulsch_eNB[UE_id]->harq_processes[harq_pid]->Or1 = 0;
|
||||
ulsch_eNB[UE_id]->harq_processes[harq_pid]->uci_format = HLC_subband_cqi_nopmi;
|
||||
|
||||
} else {
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
#include "PHY/defs.h"
|
||||
|
||||
void generate_pilots(PHY_VARS_eNB *phy_vars_eNB,
|
||||
mod_sym_t **txdataF,
|
||||
int32_t **txdataF,
|
||||
int16_t amp,
|
||||
uint16_t Ntti)
|
||||
{
|
||||
@@ -168,7 +168,7 @@ void generate_pilots(PHY_VARS_eNB *phy_vars_eNB,
|
||||
}
|
||||
|
||||
int generate_pilots_slot(PHY_VARS_eNB *phy_vars_eNB,
|
||||
mod_sym_t **txdataF,
|
||||
int32_t **txdataF,
|
||||
int16_t amp,
|
||||
uint16_t slot,
|
||||
int first_pilot_only)
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
|
||||
|
||||
int generate_mbsfn_pilot(PHY_VARS_eNB *phy_vars_eNB,
|
||||
mod_sym_t **txdataF,
|
||||
int32_t **txdataF,
|
||||
int16_t amp,
|
||||
uint16_t subframe)
|
||||
{
|
||||
|
||||
@@ -608,7 +608,7 @@ int32_t generate_prach( PHY_VARS_UE *phy_vars_ue, uint8_t eNB_id, uint8_t subfra
|
||||
uint8_t preamble_index = phy_vars_ue->prach_resources[eNB_id]->ra_PreambleIndex;
|
||||
uint8_t tdd_mapindex = phy_vars_ue->prach_resources[eNB_id]->ra_TDD_map_index;
|
||||
int16_t *prachF = phy_vars_ue->lte_ue_prach_vars[eNB_id]->prachF;
|
||||
static int16_t prach_tmp[45600*2] __attribute__((aligned(16)));
|
||||
static int16_t prach_tmp[45600*2] __attribute__((aligned(32)));
|
||||
int16_t *prach = prach_tmp;
|
||||
int16_t *prach2;
|
||||
int16_t amp = phy_vars_ue->lte_ue_prach_vars[eNB_id]->amp;
|
||||
@@ -898,7 +898,7 @@ int32_t generate_prach( PHY_VARS_UE *phy_vars_ue, uint8_t eNB_id, uint8_t subfra
|
||||
memmove( prach, prach+512, Ncp<<2 );
|
||||
prach_len = 256+Ncp;
|
||||
} else {
|
||||
idft1536(prachF,prach2);
|
||||
idft1536(prachF,prach2,1);
|
||||
memmove( prach, prach+3072, Ncp<<2 );
|
||||
prach_len = 1536+Ncp;
|
||||
|
||||
@@ -1058,21 +1058,24 @@ int32_t generate_prach( PHY_VARS_UE *phy_vars_ue, uint8_t eNB_id, uint8_t subfra
|
||||
}
|
||||
//__m128i mmtmpX0,mmtmpX1,mmtmpX2,mmtmpX3;
|
||||
|
||||
void rx_prach(PHY_VARS_eNB *phy_vars_eNB,uint8_t subframe,uint16_t *preamble_energy_list, uint16_t *preamble_delay_list, uint16_t Nf, uint8_t tdd_mapindex)
|
||||
void rx_prach(PHY_VARS_eNB *phy_vars_eNB,
|
||||
uint8_t subframe,
|
||||
uint16_t *preamble_energy_list,
|
||||
uint16_t *preamble_delay_list,
|
||||
uint16_t Nf,
|
||||
uint8_t tdd_mapindex)
|
||||
{
|
||||
|
||||
int i;
|
||||
lte_frame_type_t frame_type = phy_vars_eNB->lte_frame_parms.frame_type;
|
||||
lte_frame_type_t frame_type = phy_vars_eNB->lte_frame_parms.frame_type;
|
||||
|
||||
//uint8_t tdd_config = phy_vars_eNB->lte_frame_parms.tdd_config;
|
||||
uint16_t rootSequenceIndex = phy_vars_eNB->lte_frame_parms.prach_config_common.rootSequenceIndex;
|
||||
uint8_t prach_ConfigIndex = phy_vars_eNB->lte_frame_parms.prach_config_common.prach_ConfigInfo.prach_ConfigIndex;
|
||||
uint8_t Ncs_config = phy_vars_eNB->lte_frame_parms.prach_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig;
|
||||
uint8_t restricted_set = phy_vars_eNB->lte_frame_parms.prach_config_common.prach_ConfigInfo.highSpeedFlag;
|
||||
//uint8_t n_ra_prboffset = phy_vars_eNB->lte_frame_parms.prach_config_common.prach_ConfigInfo.prach_FreqOffset;
|
||||
int16_t *prachF = phy_vars_eNB->lte_eNB_prach_vars.prachF;
|
||||
int16_t **rxsigF = phy_vars_eNB->lte_eNB_prach_vars.rxsigF;
|
||||
int16_t **prach_ifft = phy_vars_eNB->lte_eNB_prach_vars.prach_ifft;
|
||||
uint16_t rootSequenceIndex = phy_vars_eNB->lte_frame_parms.prach_config_common.rootSequenceIndex;
|
||||
uint8_t prach_ConfigIndex = phy_vars_eNB->lte_frame_parms.prach_config_common.prach_ConfigInfo.prach_ConfigIndex;
|
||||
uint8_t Ncs_config = phy_vars_eNB->lte_frame_parms.prach_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig;
|
||||
uint8_t restricted_set = phy_vars_eNB->lte_frame_parms.prach_config_common.prach_ConfigInfo.highSpeedFlag;
|
||||
int16_t *prachF = phy_vars_eNB->lte_eNB_prach_vars.prachF;
|
||||
int16_t **rxsigF = phy_vars_eNB->lte_eNB_prach_vars.rxsigF;
|
||||
int16_t **prach_ifft = phy_vars_eNB->lte_eNB_prach_vars.prach_ifft;
|
||||
int16_t *prach[4];
|
||||
int16_t *prach2;
|
||||
uint8_t n_ra_prb;
|
||||
@@ -1086,12 +1089,8 @@ void rx_prach(PHY_VARS_eNB *phy_vars_eNB,uint8_t subframe,uint16_t *preamble_ene
|
||||
uint16_t numshift=0;
|
||||
uint16_t *prach_root_sequence_map;
|
||||
uint8_t prach_fmt = get_prach_fmt(prach_ConfigIndex,frame_type);
|
||||
//uint8_t Nsp=2;
|
||||
//uint8_t f_ra,t1_ra;
|
||||
uint16_t N_ZC = (prach_fmt <4)?839:139;
|
||||
uint8_t not_found;
|
||||
// LTE_DL_FRAME_PARMS *frame_parms = &phy_vars_eNB->lte_frame_parms;
|
||||
// uint16_t subframe_offset;
|
||||
int k;
|
||||
uint16_t u;
|
||||
int16_t *Xu;
|
||||
@@ -1107,7 +1106,6 @@ void rx_prach(PHY_VARS_eNB *phy_vars_eNB,uint8_t subframe,uint16_t *preamble_ene
|
||||
|
||||
for (aa=0; aa<nb_ant_rx; aa++) {
|
||||
prach[aa] = (int16_t*)&phy_vars_eNB->lte_eNB_common_vars.rxdata[0][aa][subframe*phy_vars_eNB->lte_frame_parms.samples_per_tti-phy_vars_eNB->N_TA_offset];
|
||||
// remove_625_Hz(phy_vars_eNB,prach[aa]);
|
||||
}
|
||||
|
||||
// First compute physical root sequence
|
||||
@@ -1134,37 +1132,6 @@ void rx_prach(PHY_VARS_eNB *phy_vars_eNB,uint8_t subframe,uint16_t *preamble_ene
|
||||
n_ra_prb = get_prach_prb_offset(&(phy_vars_eNB->lte_frame_parms),tdd_mapindex,Nf);
|
||||
prach_root_sequence_map = (prach_fmt < 4) ? prach_root_sequence_map0_3 : prach_root_sequence_map4;
|
||||
|
||||
/*
|
||||
// this code is now part of get_prach_prb_offset
|
||||
if (frame_type == TDD) { // TDD
|
||||
// adjust n_ra_prboffset for frequency multiplexing (p.36 36.211)
|
||||
|
||||
f_ra = tdd_preamble_map[prach_ConfigIndex][tdd_config].map[tdd_mapindex].f_ra;
|
||||
|
||||
if (prach_fmt < 4) {
|
||||
if ((f_ra&1) == 0) {
|
||||
n_ra_prb = n_ra_prboffset + 6*(f_ra>>1);
|
||||
} else {
|
||||
n_ra_prb = phy_vars_eNB->lte_frame_parms.N_RB_UL - 6 - n_ra_prboffset + 6*(f_ra>>1);
|
||||
}
|
||||
|
||||
} else {
|
||||
if ((tdd_config >2) && (tdd_config<6))
|
||||
Nsp = 2;
|
||||
|
||||
t1_ra = tdd_preamble_map[prach_ConfigIndex][tdd_config].map[0].t1_ra;
|
||||
|
||||
if ((((Nf&1)*(2-Nsp)+t1_ra)&1) == 0) {
|
||||
n_ra_prb = 6*f_ra;
|
||||
} else {
|
||||
n_ra_prb = phy_vars_eNB->lte_frame_parms.N_RB_UL - 6*(f_ra+1);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
// printf("NCS %d\n",NCS);
|
||||
// PDP is oversampled, e.g. 1024 sample instead of 839
|
||||
// Adapt the NCS (zero-correlation zones) with oversampling factor e.g. 1024/839
|
||||
NCS2 = (N_ZC==839) ? ((NCS<<10)/839) : ((NCS<<8)/139);
|
||||
@@ -1217,9 +1184,6 @@ void rx_prach(PHY_VARS_eNB *phy_vars_eNB,uint8_t subframe,uint16_t *preamble_ene
|
||||
break;
|
||||
}
|
||||
|
||||
// nsymb = (frame_parms->Ncp==0) ? 14:12;
|
||||
// subframe_offset = (unsigned int)frame_parms->ofdm_symbol_size*subframe*nsymb;
|
||||
|
||||
preamble_offset_old = 99;
|
||||
|
||||
for (preamble_index=0 ; preamble_index<64 ; preamble_index++) {
|
||||
@@ -1338,10 +1302,10 @@ void rx_prach(PHY_VARS_eNB *phy_vars_eNB,uint8_t subframe,uint16_t *preamble_ene
|
||||
if (prach_fmt == 4) {
|
||||
dft256(prach2,rxsigF[aa],1);
|
||||
} else {
|
||||
dft1536(prach2,rxsigF[aa]);
|
||||
dft1536(prach2,rxsigF[aa],1);
|
||||
|
||||
if (prach_fmt>1)
|
||||
dft1536(prach2+3072,rxsigF[aa]+3072);
|
||||
dft1536(prach2+3072,rxsigF[aa]+3072,1);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
@@ -61,6 +61,7 @@ int dump_ue_stats(PHY_VARS_UE *phy_vars_ue, char* buffer, int length, runmode_t
|
||||
uint8_t eNB=0;
|
||||
uint32_t RRC_status;
|
||||
int len=length;
|
||||
int harq_pid,round;
|
||||
|
||||
if (phy_vars_ue==NULL)
|
||||
return 0;
|
||||
@@ -488,13 +489,27 @@ int dump_ue_stats(PHY_VARS_UE *phy_vars_ue, char* buffer, int length, runmode_t
|
||||
if (phy_vars_ue->transmission_mode[eNB] == 6)
|
||||
len += sprintf(&buffer[len], "[UE PROC] Mode 6 Wideband CQI eNB %d : %d dB\n",eNB,phy_vars_ue->PHY_measurements.precoded_cqi_dB[eNB][0]);
|
||||
|
||||
for (harq_pid=0;harq_pid<8;harq_pid++) {
|
||||
len+=sprintf(&buffer[len],"[UE PROC] eNB %d: CW 0 harq_pid %d, mcs %d:",eNB,harq_pid,phy_vars_ue->dlsch_ue[0][0]->harq_processes[harq_pid]->mcs);
|
||||
for (round=0;round<8;round++)
|
||||
len+=sprintf(&buffer[len],"%d/%d ",
|
||||
phy_vars_ue->dlsch_ue[0][0]->harq_processes[harq_pid]->errors[round],
|
||||
phy_vars_ue->dlsch_ue[0][0]->harq_processes[harq_pid]->trials[round]);
|
||||
len+=sprintf(&buffer[len],"\n");
|
||||
}
|
||||
if (phy_vars_ue->dlsch_ue[0] && phy_vars_ue->dlsch_ue[0][0] && phy_vars_ue->dlsch_ue[0][1]) {
|
||||
len += sprintf(&buffer[len], "[UE PROC] Saved PMI for DLSCH eNB %d : %jx (%p)\n",eNB,pmi2hex_2Ar1(phy_vars_ue->dlsch_ue[0][0]->pmi_alloc),phy_vars_ue->dlsch_ue[0][0]);
|
||||
|
||||
len += sprintf(&buffer[len], "[UE PROC] eNB %d: dl_power_off = %d\n",eNB,phy_vars_ue->dlsch_ue[0][0]->harq_processes[0]->dl_power_off);
|
||||
|
||||
len += sprintf(&buffer[len], "[UE PROC] DL mcs1 (dlsch cw1) %d\n",phy_vars_ue->dlsch_ue[0][0]->harq_processes[0]->mcs);
|
||||
len += sprintf(&buffer[len], "[UE PROC] DL mcs2 (dlsch cw2) %d\n",phy_vars_ue->dlsch_ue[0][1]->harq_processes[0]->mcs);
|
||||
for (harq_pid=0;harq_pid<8;harq_pid++) {
|
||||
len+=sprintf(&buffer[len],"[UE PROC] eNB %d: CW 1 harq_pid %d, mcs %d:",eNB,harq_pid,phy_vars_ue->dlsch_ue[0][1]->harq_processes[0]->mcs);
|
||||
for (round=0;round<8;round++)
|
||||
len+=sprintf(&buffer[len],"%d/%d ",
|
||||
phy_vars_ue->dlsch_ue[0][1]->harq_processes[harq_pid]->errors[round],
|
||||
phy_vars_ue->dlsch_ue[0][1]->harq_processes[harq_pid]->trials[round]);
|
||||
len+=sprintf(&buffer[len],"\n");
|
||||
}
|
||||
}
|
||||
|
||||
len += sprintf(&buffer[len], "[UE PROC] DLSCH Total %d, Error %d, FER %d\n",phy_vars_ue->dlsch_received[0],phy_vars_ue->dlsch_errors[0],phy_vars_ue->dlsch_fer[0]);
|
||||
@@ -566,7 +581,7 @@ int dump_eNB_stats(PHY_VARS_eNB *phy_vars_eNB, char* buffer, int length)
|
||||
// }
|
||||
|
||||
for (eNB=0; eNB<number_of_cards_l; eNB++) {
|
||||
len += sprintf(&buffer[len],"[eNB PROC] eNB %d/%d Frame %d: RX Gain %d dB, I0 %d dBm (%d,%d) dB \n",
|
||||
len += sprintf(&buffer[len],"eNB %d/%d Frame %d: RX Gain %d dB, I0 %d dBm (%d,%d) dB \n",
|
||||
eNB,number_of_cards_l,
|
||||
phy_vars_eNB->proc[0].frame_tx,
|
||||
phy_vars_eNB->rx_total_gain_eNB_dB,
|
||||
@@ -574,7 +589,7 @@ int dump_eNB_stats(PHY_VARS_eNB *phy_vars_eNB, char* buffer, int length)
|
||||
phy_vars_eNB->PHY_measurements_eNB[eNB].n0_power_dB[0],
|
||||
phy_vars_eNB->PHY_measurements_eNB[eNB].n0_power_dB[1]);
|
||||
|
||||
len += sprintf(&buffer[len],"[eNB PROC] PRB I0 (%X.%X.%X.%X): ",
|
||||
len += sprintf(&buffer[len],"PRB I0 (%X.%X.%X.%X): ",
|
||||
phy_vars_eNB->rb_mask_ul[0],
|
||||
phy_vars_eNB->rb_mask_ul[1],phy_vars_eNB->rb_mask_ul[2],phy_vars_eNB->rb_mask_ul[3]);
|
||||
|
||||
@@ -585,7 +600,7 @@ int dump_eNB_stats(PHY_VARS_eNB *phy_vars_eNB, char* buffer, int length)
|
||||
len += sprintf(&buffer[len],"\n");
|
||||
}
|
||||
len += sprintf(&buffer[len],"\n");
|
||||
len += sprintf(&buffer[len],"\n[eNB PROC] PERFORMANCE PARAMETERS\n");
|
||||
len += sprintf(&buffer[len],"\nPERFORMANCE PARAMETERS\n");
|
||||
/*
|
||||
len += sprintf(&buffer[len],"[eNB PROC] Total DLSCH Bitrate for the System %dkbps\n",((phy_vars_eNB->eNB_UE_stats[0].dlsch_bitrate + phy_vars_eNB->eNB_UE_stats[1].dlsch_bitrate)/1000));
|
||||
len += sprintf(&buffer[len],"[eNB PROC] Total Bits successfully transitted %dKbits in %dframe(s)\n",((phy_vars_eNB->eNB_UE_stats[0].total_transmitted_bits + phy_vars_eNB->eNB_UE_stats[1].total_transmitted_bits)/1000),phy_vars_eNB->frame+1);
|
||||
@@ -593,118 +608,115 @@ int dump_eNB_stats(PHY_VARS_eNB *phy_vars_eNB, char* buffer, int length)
|
||||
*/
|
||||
|
||||
for (UE_id=0; UE_id<NUMBER_OF_UE_MAX; UE_id++) {
|
||||
#ifdef OPENAIR2
|
||||
if ((phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->rnti>0)&&
|
||||
(phy_vars_eNB->eNB_UE_stats[UE_id].mode == PUSCH)) {
|
||||
|
||||
if (phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->rnti>0) {
|
||||
phy_vars_eNB->total_dlsch_bitrate = phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_bitrate + phy_vars_eNB->total_dlsch_bitrate;
|
||||
phy_vars_eNB->total_transmitted_bits = phy_vars_eNB->eNB_UE_stats[UE_id].total_TBS + phy_vars_eNB->total_transmitted_bits;
|
||||
|
||||
//phy_vars_eNB->total_system_throughput = phy_vars_eNB->eNB_UE_stats[UE_id].total_transmitted_bits + phy_vars_eNB->total_system_throughput;
|
||||
if (phy_vars_eNB->eNB_UE_stats[UE_id].mode == PUSCH)
|
||||
for (i=0; i<8; i++)
|
||||
success = success + (phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_trials[i][0] - phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_l2_errors[i]);
|
||||
}
|
||||
|
||||
for (i=0; i<8; i++)
|
||||
success = success + (phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_trials[i][0] - phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_l2_errors[i]);
|
||||
|
||||
#else
|
||||
phy_vars_eNB->total_dlsch_bitrate = phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_bitrate + phy_vars_eNB->total_dlsch_bitrate;
|
||||
phy_vars_eNB->total_transmitted_bits = phy_vars_eNB->eNB_UE_stats[UE_id].total_TBS + phy_vars_eNB->total_transmitted_bits;
|
||||
|
||||
|
||||
len += sprintf(&buffer[len],"Total DLSCH %d kbits / %d frames ",(phy_vars_eNB->total_transmitted_bits/1000),phy_vars_eNB->proc[0].frame_tx+1);
|
||||
len += sprintf(&buffer[len],"Total DLSCH throughput %d kbps ",(phy_vars_eNB->total_dlsch_bitrate/1000));
|
||||
len += sprintf(&buffer[len],"Total DLSCH trans %d / %d frames\n",success,phy_vars_eNB->proc[0].frame_tx+1);
|
||||
//len += sprintf(&buffer[len],"[eNB PROC] FULL MU-MIMO Transmissions/Total Transmissions = %d/%d\n",phy_vars_eNB->FULL_MUMIMO_transmissions,phy_vars_eNB->check_for_total_transmissions);
|
||||
//len += sprintf(&buffer[len],"[eNB PROC] MU-MIMO Transmissions/Total Transmissions = %d/%d\n",phy_vars_eNB->check_for_MUMIMO_transmissions,phy_vars_eNB->check_for_total_transmissions);
|
||||
//len += sprintf(&buffer[len],"[eNB PROC] SU-MIMO Transmissions/Total Transmissions = %d/%d\n",phy_vars_eNB->check_for_SUMIMO_transmissions,phy_vars_eNB->check_for_total_transmissions);
|
||||
|
||||
len += sprintf(&buffer[len],"UE %d (%x) Power: (%d,%d) dB, Po_PUSCH: (%d,%d) dBm, Po_PUCCH (%d/%d) dBm, Po_PUCCH1 (%d,%d) dBm, PUCCH1 Thres %d dBm \n",
|
||||
UE_id,
|
||||
phy_vars_eNB->eNB_UE_stats[UE_id].crnti,
|
||||
dB_fixed(phy_vars_eNB->lte_eNB_pusch_vars[UE_id]->ulsch_power[0]),
|
||||
dB_fixed(phy_vars_eNB->lte_eNB_pusch_vars[UE_id]->ulsch_power[1]),
|
||||
phy_vars_eNB->eNB_UE_stats[UE_id].UL_rssi[0],
|
||||
phy_vars_eNB->eNB_UE_stats[UE_id].UL_rssi[1],
|
||||
dB_fixed(phy_vars_eNB->eNB_UE_stats[UE_id].Po_PUCCH/phy_vars_eNB->lte_frame_parms.N_RB_UL)-phy_vars_eNB->rx_total_gain_eNB_dB,
|
||||
phy_vars_eNB->lte_frame_parms.ul_power_control_config_common.p0_NominalPUCCH,
|
||||
dB_fixed(phy_vars_eNB->eNB_UE_stats[UE_id].Po_PUCCH1_below/phy_vars_eNB->lte_frame_parms.N_RB_UL)-phy_vars_eNB->rx_total_gain_eNB_dB,
|
||||
dB_fixed(phy_vars_eNB->eNB_UE_stats[UE_id].Po_PUCCH1_above/phy_vars_eNB->lte_frame_parms.N_RB_UL)-phy_vars_eNB->rx_total_gain_eNB_dB,
|
||||
PUCCH1_THRES+phy_vars_eNB->PHY_measurements_eNB[0].n0_power_tot_dBm-dB_fixed(phy_vars_eNB->lte_frame_parms.N_RB_UL));
|
||||
|
||||
len+= sprintf(&buffer[len],"DL mcs %d, UL mcs %d, UL rb %d, delta_TF %d, ",
|
||||
phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->harq_processes[0]->mcs,
|
||||
phy_vars_eNB->ulsch_eNB[(uint8_t)UE_id]->harq_processes[0]->mcs,
|
||||
phy_vars_eNB->ulsch_eNB[(uint8_t)UE_id]->harq_processes[0]->nb_rb,
|
||||
phy_vars_eNB->ulsch_eNB[(uint8_t)UE_id]->harq_processes[0]->delta_TF);
|
||||
|
||||
len += sprintf(&buffer[len],"Wideband CQI: (%d,%d) dB\n",
|
||||
phy_vars_eNB->PHY_measurements_eNB[eNB].wideband_cqi_dB[UE_id][0],
|
||||
phy_vars_eNB->PHY_measurements_eNB[eNB].wideband_cqi_dB[UE_id][1]);
|
||||
|
||||
/* len += sprintf(&buffer[len],"[eNB PROC] Subband CQI: ");
|
||||
|
||||
for (i=0; i<phy_vars_eNB->lte_frame_parms.N_RB_DL; i++)
|
||||
len += sprintf(&buffer[len],"%2d ",
|
||||
phy_vars_eNB->PHY_measurements_eNB[eNB].subband_cqi_tot_dB[UE_id][i]);
|
||||
|
||||
len += sprintf(&buffer[len],"\n");
|
||||
*/
|
||||
|
||||
//phy_vars_eNB->total_system_throughput = phy_vars_eNB->eNB_UE_stats[UE_id].total_transmitted_bits + phy_vars_eNB->total_system_throughput;
|
||||
for (i=0; i<8; i++)
|
||||
success = success + (phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_trials[i][0] - phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_l2_errors[i]);
|
||||
len += sprintf(&buffer[len],"DL TM %d, DL_cqi %d, DL_pmi_single %jx ",
|
||||
phy_vars_eNB->transmission_mode[UE_id],
|
||||
phy_vars_eNB->eNB_UE_stats[UE_id].DL_cqi[0],
|
||||
pmi2hex_2Ar1(phy_vars_eNB->eNB_UE_stats[UE_id].DL_pmi_single));
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
len += sprintf(&buffer[len],"[eNB PROC] Total DLSCH bits successfully transmitted %d kbits in %d frame(s)\n",(phy_vars_eNB->total_transmitted_bits/1000),phy_vars_eNB->proc[0].frame_tx+1);
|
||||
len += sprintf(&buffer[len],"[eNB PROC] Total DLSCH average system throughput %d kbps\n",(phy_vars_eNB->total_dlsch_bitrate/1000));
|
||||
len += sprintf(&buffer[len],"[eNB PROC] Total DLSCH successful transmissions %d in %d frame(s)\n",success,phy_vars_eNB->proc[0].frame_tx+1);
|
||||
//len += sprintf(&buffer[len],"[eNB PROC] FULL MU-MIMO Transmissions/Total Transmissions = %d/%d\n",phy_vars_eNB->FULL_MUMIMO_transmissions,phy_vars_eNB->check_for_total_transmissions);
|
||||
//len += sprintf(&buffer[len],"[eNB PROC] MU-MIMO Transmissions/Total Transmissions = %d/%d\n",phy_vars_eNB->check_for_MUMIMO_transmissions,phy_vars_eNB->check_for_total_transmissions);
|
||||
//len += sprintf(&buffer[len],"[eNB PROC] SU-MIMO Transmissions/Total Transmissions = %d/%d\n",phy_vars_eNB->check_for_SUMIMO_transmissions,phy_vars_eNB->check_for_total_transmissions);
|
||||
|
||||
}
|
||||
|
||||
len += sprintf(&buffer[len],"\n");
|
||||
|
||||
for (UE_id=0; UE_id<NUMBER_OF_UE_MAX; UE_id++) {
|
||||
#ifdef OPENAIR2
|
||||
|
||||
if (phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->rnti>0) {
|
||||
#endif
|
||||
len += sprintf(&buffer[len],"[eNB PROC] UE %d (%x) Power: (%d,%d) dB, Po_PUSCH: (%d,%d) dBm, Po_PUCCH (%d/%d) dBm, Po_PUCCH1 (%d,%d) dBm, PUCCH1 Thres %d dBm \n",
|
||||
UE_id,
|
||||
phy_vars_eNB->eNB_UE_stats[UE_id].crnti,
|
||||
dB_fixed(phy_vars_eNB->lte_eNB_pusch_vars[UE_id]->ulsch_power[0]),
|
||||
dB_fixed(phy_vars_eNB->lte_eNB_pusch_vars[UE_id]->ulsch_power[1]),
|
||||
phy_vars_eNB->eNB_UE_stats[UE_id].UL_rssi[0],
|
||||
phy_vars_eNB->eNB_UE_stats[UE_id].UL_rssi[1],
|
||||
dB_fixed(phy_vars_eNB->eNB_UE_stats[UE_id].Po_PUCCH/phy_vars_eNB->lte_frame_parms.N_RB_UL)-phy_vars_eNB->rx_total_gain_eNB_dB,
|
||||
phy_vars_eNB->lte_frame_parms.ul_power_control_config_common.p0_NominalPUCCH,
|
||||
dB_fixed(phy_vars_eNB->eNB_UE_stats[UE_id].Po_PUCCH1_below/phy_vars_eNB->lte_frame_parms.N_RB_UL)-phy_vars_eNB->rx_total_gain_eNB_dB,
|
||||
PUCCH1_THRES+phy_vars_eNB->PHY_measurements_eNB[0].n0_power_tot_dBm-dB_fixed(phy_vars_eNB->lte_frame_parms.N_RB_UL),
|
||||
phy_vars_eNB->eNB_UE_stats[UE_id].sector);
|
||||
|
||||
for(i=0; i<8; i++)
|
||||
len+= sprintf(&buffer[len]," harq %d: DL mcs %d, UL mcs %d, UL rb %d, delta_TF %d\n",
|
||||
i,
|
||||
phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->harq_processes[i]->mcs,
|
||||
phy_vars_eNB->ulsch_eNB[(uint8_t)UE_id]->harq_processes[i]->mcs,
|
||||
phy_vars_eNB->ulsch_eNB[(uint8_t)UE_id]->harq_processes[i]->nb_rb,
|
||||
phy_vars_eNB->ulsch_eNB[(uint8_t)UE_id]->harq_processes[i]->delta_TF);
|
||||
|
||||
len += sprintf(&buffer[len],"[eNB PROC] Wideband CQI: (%d,%d) dB\n",
|
||||
phy_vars_eNB->PHY_measurements_eNB[eNB].wideband_cqi_dB[UE_id][0],
|
||||
phy_vars_eNB->PHY_measurements_eNB[eNB].wideband_cqi_dB[UE_id][1]);
|
||||
|
||||
len += sprintf(&buffer[len],"[eNB PROC] Subband CQI: ");
|
||||
|
||||
for (i=0; i<25; i++)
|
||||
len += sprintf(&buffer[len],"%2d ",
|
||||
phy_vars_eNB->PHY_measurements_eNB[eNB].subband_cqi_tot_dB[UE_id][i]);
|
||||
|
||||
len += sprintf(&buffer[len],"\n");
|
||||
|
||||
len += sprintf(&buffer[len],"[eNB PROC] DL TM %d, DL_cqi %d, DL_pmi_single %jx\n",
|
||||
phy_vars_eNB->transmission_mode[UE_id],
|
||||
phy_vars_eNB->eNB_UE_stats[UE_id].DL_cqi[0],
|
||||
pmi2hex_2Ar1(phy_vars_eNB->eNB_UE_stats[UE_id].DL_pmi_single));
|
||||
|
||||
len += sprintf(&buffer[len],"[eNB PROC] DL Subband CQI: ");
|
||||
|
||||
for (i=0; i<13; i++)
|
||||
len += sprintf(&buffer[len],"%2d ",
|
||||
phy_vars_eNB->eNB_UE_stats[UE_id].DL_subband_cqi[0][i]);
|
||||
|
||||
len += sprintf(&buffer[len],"\n");
|
||||
|
||||
len += sprintf(&buffer[len],"[eNB PROC] Timing advance %d samples (%d 16Ts), update %d\n",
|
||||
phy_vars_eNB->eNB_UE_stats[UE_id].UE_timing_offset,
|
||||
phy_vars_eNB->eNB_UE_stats[UE_id].UE_timing_offset>>2,
|
||||
phy_vars_eNB->eNB_UE_stats[UE_id].timing_advance_update);
|
||||
|
||||
len += sprintf(&buffer[len],"[eNB PROC] Mode = %s(%d)\n",
|
||||
mode_string[phy_vars_eNB->eNB_UE_stats[UE_id].mode],
|
||||
phy_vars_eNB->eNB_UE_stats[UE_id].mode);
|
||||
#ifdef OPENAIR2
|
||||
UE_id_mac = find_UE_id(phy_vars_eNB->Mod_id,phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->rnti);
|
||||
|
||||
if (UE_id_mac != -1) {
|
||||
RRC_status = mac_eNB_get_rrc_status(phy_vars_eNB->Mod_id,phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->rnti);
|
||||
len += sprintf(&buffer[len],"[eNB PROC] UE_id_mac = %d, RRC status = %d\n",UE_id_mac,RRC_status);
|
||||
} else
|
||||
len += sprintf(&buffer[len],"[eNB PROC] UE_id_mac = -1\n");
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef OPENAIR2
|
||||
|
||||
if (phy_vars_eNB->eNB_UE_stats[UE_id].mode == PUSCH) {
|
||||
#endif
|
||||
len += sprintf(&buffer[len],"[eNB PROC] SR received/total: %d/%d (diff %d)\n",
|
||||
len += sprintf(&buffer[len],"Timing advance %d samples (%d 16Ts), update %d ",
|
||||
phy_vars_eNB->eNB_UE_stats[UE_id].UE_timing_offset,
|
||||
phy_vars_eNB->eNB_UE_stats[UE_id].UE_timing_offset>>2,
|
||||
phy_vars_eNB->eNB_UE_stats[UE_id].timing_advance_update);
|
||||
|
||||
len += sprintf(&buffer[len],"Mode = %s(%d) ",
|
||||
mode_string[phy_vars_eNB->eNB_UE_stats[UE_id].mode],
|
||||
phy_vars_eNB->eNB_UE_stats[UE_id].mode);
|
||||
UE_id_mac = find_UE_id(phy_vars_eNB->Mod_id,phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->rnti);
|
||||
|
||||
if (UE_id_mac != -1) {
|
||||
RRC_status = mac_eNB_get_rrc_status(phy_vars_eNB->Mod_id,phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->rnti);
|
||||
len += sprintf(&buffer[len],"UE_id_mac = %d, RRC status = %d\n",UE_id_mac,RRC_status);
|
||||
} else
|
||||
len += sprintf(&buffer[len],"UE_id_mac = -1\n");
|
||||
|
||||
len += sprintf(&buffer[len],"SR received/total: %d/%d (diff %d)\n",
|
||||
phy_vars_eNB->eNB_UE_stats[UE_id].sr_received,
|
||||
phy_vars_eNB->eNB_UE_stats[UE_id].sr_total,
|
||||
phy_vars_eNB->eNB_UE_stats[UE_id].sr_total-phy_vars_eNB->eNB_UE_stats[UE_id].sr_received);
|
||||
|
||||
len += sprintf(&buffer[len],"DL Subband CQI: ");
|
||||
|
||||
int nb_sb;
|
||||
switch (phy_vars_eNB->lte_frame_parms.N_RB_DL) {
|
||||
case 6:
|
||||
nb_sb=0;
|
||||
break;
|
||||
case 15:
|
||||
nb_sb = 4;
|
||||
case 25:
|
||||
nb_sb = 7;
|
||||
break;
|
||||
case 50:
|
||||
nb_sb = 9;
|
||||
break;
|
||||
case 75:
|
||||
nb_sb = 10;
|
||||
break;
|
||||
case 100:
|
||||
nb_sb = 13;
|
||||
break;
|
||||
default:
|
||||
nb_sb=0;
|
||||
break;
|
||||
}
|
||||
for (i=0; i<nb_sb; i++)
|
||||
len += sprintf(&buffer[len],"%2d ",
|
||||
phy_vars_eNB->eNB_UE_stats[UE_id].DL_subband_cqi[0][i]);
|
||||
len += sprintf(&buffer[len],"\n");
|
||||
|
||||
|
||||
|
||||
ulsch_errors = 0;
|
||||
|
||||
@@ -713,10 +725,10 @@ int dump_eNB_stats(PHY_VARS_eNB *phy_vars_eNB, char* buffer, int length)
|
||||
ulsch_round_errors[j]=0;
|
||||
}
|
||||
|
||||
len += sprintf(&buffer[len],"[eNB PROC] ULSCH errors/attempts per harq (per round): \n");
|
||||
len += sprintf(&buffer[len],"ULSCH errors/attempts per harq (per round): \n");
|
||||
|
||||
for (i=0; i<8; i++) {
|
||||
len += sprintf(&buffer[len]," harq %d: %d/%d (fer %d) (%d/%d, %d/%d, %d/%d, %d/%d)\n",
|
||||
len += sprintf(&buffer[len]," harq %d: %d/%d (fer %d) (%d/%d, %d/%d, %d/%d, %d/%d) ",
|
||||
i,
|
||||
phy_vars_eNB->eNB_UE_stats[UE_id].ulsch_errors[i],
|
||||
phy_vars_eNB->eNB_UE_stats[UE_id].ulsch_decoding_attempts[i][0],
|
||||
@@ -729,6 +741,9 @@ int dump_eNB_stats(PHY_VARS_eNB *phy_vars_eNB, char* buffer, int length)
|
||||
phy_vars_eNB->eNB_UE_stats[UE_id].ulsch_decoding_attempts[i][2],
|
||||
phy_vars_eNB->eNB_UE_stats[UE_id].ulsch_round_errors[i][3],
|
||||
phy_vars_eNB->eNB_UE_stats[UE_id].ulsch_decoding_attempts[i][3]);
|
||||
if ((i&1) == 1)
|
||||
len += sprintf(&buffer[len],"\n");
|
||||
|
||||
ulsch_errors+=phy_vars_eNB->eNB_UE_stats[UE_id].ulsch_errors[i];
|
||||
|
||||
for (j=0; j<4; j++) {
|
||||
@@ -737,7 +752,7 @@ int dump_eNB_stats(PHY_VARS_eNB *phy_vars_eNB, char* buffer, int length)
|
||||
}
|
||||
}
|
||||
|
||||
len += sprintf(&buffer[len],"[eNB PROC] ULSCH errors/attempts total %d/%d (%d/%d, %d/%d, %d/%d, %d/%d): \n",
|
||||
len += sprintf(&buffer[len],"ULSCH errors/attempts total %d/%d (%d/%d, %d/%d, %d/%d, %d/%d)\n",
|
||||
ulsch_errors,ulsch_round_attempts[0],
|
||||
|
||||
ulsch_round_errors[0],ulsch_round_attempts[0],
|
||||
@@ -752,10 +767,10 @@ int dump_eNB_stats(PHY_VARS_eNB *phy_vars_eNB, char* buffer, int length)
|
||||
dlsch_round_errors[j]=0;
|
||||
}
|
||||
|
||||
len += sprintf(&buffer[len],"[eNB PROC] DLSCH errors/attempts per harq (per round): \n");
|
||||
len += sprintf(&buffer[len],"DLSCH errors/attempts per harq (per round): \n");
|
||||
|
||||
for (i=0; i<8; i++) {
|
||||
len += sprintf(&buffer[len]," harq %d: %d/%d (%d/%d/%d, %d/%d/%d, %d/%d/%d, %d/%d/%d)\n",
|
||||
len += sprintf(&buffer[len]," harq %d: %d/%d (%d/%d/%d, %d/%d/%d, %d/%d/%d, %d/%d/%d) ",
|
||||
i,
|
||||
phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_l2_errors[i],
|
||||
phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_trials[i][0],
|
||||
@@ -771,6 +786,10 @@ int dump_eNB_stats(PHY_VARS_eNB *phy_vars_eNB, char* buffer, int length)
|
||||
phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_ACK[i][3],
|
||||
phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_NAK[i][3],
|
||||
phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_trials[i][3]);
|
||||
if ((i&1) == 1)
|
||||
len += sprintf(&buffer[len],"\n");
|
||||
|
||||
|
||||
dlsch_errors+=phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_l2_errors[i];
|
||||
|
||||
for (j=0; j<4; j++) {
|
||||
@@ -779,7 +798,7 @@ int dump_eNB_stats(PHY_VARS_eNB *phy_vars_eNB, char* buffer, int length)
|
||||
}
|
||||
}
|
||||
|
||||
len += sprintf(&buffer[len],"[eNB PROC] DLSCH errors/attempts total %d/%d (%d/%d, %d/%d, %d/%d, %d/%d): \n",
|
||||
len += sprintf(&buffer[len],"DLSCH errors/attempts total %d/%d (%d/%d, %d/%d, %d/%d, %d/%d): \n",
|
||||
dlsch_errors,dlsch_round_attempts[0],
|
||||
dlsch_round_errors[0],dlsch_round_attempts[0],
|
||||
dlsch_round_errors[1],dlsch_round_attempts[1],
|
||||
@@ -787,11 +806,11 @@ int dump_eNB_stats(PHY_VARS_eNB *phy_vars_eNB, char* buffer, int length)
|
||||
dlsch_round_errors[3],dlsch_round_attempts[3]);
|
||||
|
||||
|
||||
len += sprintf(&buffer[len],"[eNB PROC] DLSCH total bits from MAC: %dkbit\n",(phy_vars_eNB->eNB_UE_stats[UE_id].total_TBS_MAC)/1000);
|
||||
len += sprintf(&buffer[len],"[eNB PROC] DLSCH total bits ack'ed: %dkbit\n",(phy_vars_eNB->eNB_UE_stats[UE_id].total_TBS)/1000);
|
||||
len += sprintf(&buffer[len],"[eNB PROC] DLSCH Average throughput (100 frames): %dkbps\n",(phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_bitrate/1000));
|
||||
len += sprintf(&buffer[len],"[eNB PROC] Transmission Mode %d\n",phy_vars_eNB->transmission_mode[UE_id]);
|
||||
|
||||
len += sprintf(&buffer[len],"DLSCH total bits from MAC: %dkbit ",(phy_vars_eNB->eNB_UE_stats[UE_id].total_TBS_MAC)/1000);
|
||||
len += sprintf(&buffer[len],"DLSCH total bits ack'ed: %dkbit ",(phy_vars_eNB->eNB_UE_stats[UE_id].total_TBS)/1000);
|
||||
len += sprintf(&buffer[len],"DLSCH Average throughput (100 frames): %dkbps\n",(phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_bitrate/1000));
|
||||
// len += sprintf(&buffer[len],"[eNB PROC] Transmission Mode %d\n",phy_vars_eNB->transmission_mode[UE_id]);
|
||||
/*
|
||||
if(phy_vars_eNB->transmission_mode[UE_id] == 5) {
|
||||
if(phy_vars_eNB->mu_mimo_mode[UE_id].dl_pow_off == 0)
|
||||
len += sprintf(&buffer[len],"[eNB PROC] ****UE %d is in MU-MIMO mode****\n",UE_id);
|
||||
@@ -800,7 +819,8 @@ int dump_eNB_stats(PHY_VARS_eNB *phy_vars_eNB, char* buffer, int length)
|
||||
else
|
||||
len += sprintf(&buffer[len],"[eNB PROC] ****UE %d is not scheduled****\n",UE_id);
|
||||
}
|
||||
|
||||
*/
|
||||
/*
|
||||
len += sprintf(&buffer[len],"[eNB PROC] RB Allocation on Sub-bands: ");
|
||||
|
||||
// for (j=0;j< mac_xface->lte_frame_parms->N_RBGS;j++)
|
||||
@@ -810,16 +830,14 @@ int dump_eNB_stats(PHY_VARS_eNB *phy_vars_eNB, char* buffer, int length)
|
||||
|
||||
len += sprintf(&buffer[len],"\n");
|
||||
len += sprintf(&buffer[len],"[eNB PROC] Total Number of Allocated PRBs = %d\n",phy_vars_eNB->mu_mimo_mode[UE_id].pre_nb_available_rbs);
|
||||
|
||||
#ifdef OPENAIR2
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
len += sprintf(&buffer[len],"\n");
|
||||
}
|
||||
|
||||
|
||||
len += sprintf(&buffer[len],"EOF\n");
|
||||
|
||||
|
||||
return len;
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
*/
|
||||
void free_eNB_dlsch(LTE_eNB_DLSCH_t *dlsch);
|
||||
|
||||
void clean_eNb_dlsch(LTE_eNB_DLSCH_t *dlsch, uint8_t abstraction_flag);
|
||||
void clean_eNb_dlsch(LTE_eNB_DLSCH_t *dlsch);
|
||||
|
||||
/** \fn new_eNB_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint32_t Nsoft,uint8_t abstraction_flag)
|
||||
\brief This function allocates structures for a particular DLSCH at eNB
|
||||
@@ -85,13 +85,13 @@ void free_ue_dlsch(LTE_UE_DLSCH_t *dlsch);
|
||||
LTE_UE_DLSCH_t *new_ue_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint32_t Nsoft,uint8_t max_turbo_iterations,uint8_t N_RB_DL, uint8_t abstraction_flag);
|
||||
|
||||
|
||||
void clean_eNb_ulsch(LTE_eNB_ULSCH_t *ulsch, uint8_t abstraction_flag);
|
||||
void clean_eNb_ulsch(LTE_eNB_ULSCH_t *ulsch);
|
||||
|
||||
void free_ue_ulsch(LTE_UE_ULSCH_t *ulsch);
|
||||
|
||||
LTE_eNB_ULSCH_t *new_eNB_ulsch(uint8_t Mdlharq,uint8_t max_turbo_iterations,uint8_t N_RB_UL, uint8_t abstraction_flag);
|
||||
LTE_eNB_ULSCH_t *new_eNB_ulsch(uint8_t max_turbo_iterations,uint8_t N_RB_UL, uint8_t abstraction_flag);
|
||||
|
||||
LTE_UE_ULSCH_t *new_ue_ulsch(uint8_t Mdlharq, unsigned char N_RB_UL, uint8_t abstraction_flag);
|
||||
LTE_UE_ULSCH_t *new_ue_ulsch(unsigned char N_RB_UL, uint8_t abstraction_flag);
|
||||
|
||||
/** \fn dlsch_encoding(uint8_t *input_buffer,
|
||||
LTE_DL_FRAME_PARMS *frame_parms,
|
||||
@@ -133,7 +133,7 @@ void dlsch_encoding_emul(PHY_VARS_eNB *phy_vars_eNB,
|
||||
|
||||
// Functions below implement 36-211
|
||||
|
||||
/** \fn allocate_REs_in_RB(mod_sym_t **txdataF,
|
||||
/** \fn allocate_REs_in_RB(int32_t **txdataF,
|
||||
uint32_t *jj,
|
||||
uint32_t *jj2,
|
||||
uint16_t re_offset,
|
||||
@@ -169,7 +169,7 @@ void dlsch_encoding_emul(PHY_VARS_eNB *phy_vars_eNB,
|
||||
*/
|
||||
|
||||
int32_t allocate_REs_in_RB(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
mod_sym_t **txdataF,
|
||||
int32_t **txdataF,
|
||||
uint32_t *jj,
|
||||
uint32_t *jj2,
|
||||
uint16_t re_offset,
|
||||
@@ -186,7 +186,7 @@ int32_t allocate_REs_in_RB(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
uint8_t skip_half);
|
||||
|
||||
|
||||
/** \fn int32_t dlsch_modulation(mod_sym_t **txdataF,
|
||||
/** \fn int32_t dlsch_modulation(int32_t **txdataF,
|
||||
int16_t amp,
|
||||
uint32_t sub_frame_offset,
|
||||
LTE_DL_FRAME_PARMS *frame_parms,
|
||||
@@ -203,7 +203,7 @@ int32_t allocate_REs_in_RB(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
@param dlsch1 Pointer to Transport Block 0 DLSCH descriptor for this allocation
|
||||
|
||||
*/
|
||||
int32_t dlsch_modulation(mod_sym_t **txdataF,
|
||||
int32_t dlsch_modulation(int32_t **txdataF,
|
||||
int16_t amp,
|
||||
uint32_t sub_frame_offset,
|
||||
LTE_DL_FRAME_PARMS *frame_parms,
|
||||
@@ -218,7 +218,7 @@ int32_t dlsch_modulation(mod_sym_t **txdataF,
|
||||
@param frame_parms Pointer to frame descriptor
|
||||
@param dlsch Pointer to DLSCH descriptor for this allocation
|
||||
*/
|
||||
int mch_modulation(mod_sym_t **txdataF,
|
||||
int mch_modulation(int32_t **txdataF,
|
||||
int16_t amp,
|
||||
uint32_t subframe_offset,
|
||||
LTE_DL_FRAME_PARMS *frame_parms,
|
||||
@@ -279,7 +279,7 @@ void dump_mch(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint16_t coded_bits_per_co
|
||||
@param N Number of sub-frames to generate
|
||||
*/
|
||||
void generate_pilots(PHY_VARS_eNB *phy_vars_eNB,
|
||||
mod_sym_t **txdataF,
|
||||
int32_t **txdataF,
|
||||
int16_t amp,
|
||||
uint16_t N);
|
||||
|
||||
@@ -292,17 +292,17 @@ void generate_pilots(PHY_VARS_eNB *phy_vars_eNB,
|
||||
@param first_pilot_only (0 no)
|
||||
*/
|
||||
int32_t generate_pilots_slot(PHY_VARS_eNB *phy_vars_eNB,
|
||||
mod_sym_t **txdataF,
|
||||
int32_t **txdataF,
|
||||
int16_t amp,
|
||||
uint16_t slot,
|
||||
int first_pilot_only);
|
||||
|
||||
int32_t generate_mbsfn_pilot(PHY_VARS_eNB *phy_vars_eNB,
|
||||
mod_sym_t **txdataF,
|
||||
int32_t **txdataF,
|
||||
int16_t amp,
|
||||
uint16_t subframe);
|
||||
|
||||
int32_t generate_pss(mod_sym_t **txdataF,
|
||||
int32_t generate_pss(int32_t **txdataF,
|
||||
int16_t amp,
|
||||
LTE_DL_FRAME_PARMS *frame_parms,
|
||||
uint16_t l,
|
||||
@@ -310,14 +310,14 @@ int32_t generate_pss(mod_sym_t **txdataF,
|
||||
|
||||
int32_t generate_pss_emul(PHY_VARS_eNB *phy_vars_eNB,uint8_t sect_id);
|
||||
|
||||
int32_t generate_sss(mod_sym_t **txdataF,
|
||||
int32_t generate_sss(int32_t **txdataF,
|
||||
short amp,
|
||||
LTE_DL_FRAME_PARMS *frame_parms,
|
||||
unsigned short symbol,
|
||||
unsigned short slot_offset);
|
||||
|
||||
int32_t generate_pbch(LTE_eNB_PBCH *eNB_pbch,
|
||||
mod_sym_t **txdataF,
|
||||
int32_t **txdataF,
|
||||
int32_t amp,
|
||||
LTE_DL_FRAME_PARMS *frame_parms,
|
||||
uint8_t *pbch_pdu,
|
||||
@@ -1148,7 +1148,7 @@ uint8_t generate_dci_top(uint8_t num_ue_spec_dci,
|
||||
uint32_t n_rnti,
|
||||
int16_t amp,
|
||||
LTE_DL_FRAME_PARMS *frame_parms,
|
||||
mod_sym_t **txdataF,
|
||||
int32_t **txdataF,
|
||||
uint32_t sub_frame_offset);
|
||||
|
||||
uint8_t generate_dci_top_emul(PHY_VARS_eNB *phy_vars_eNB,
|
||||
@@ -1341,7 +1341,7 @@ void init_ul_hopping(LTE_DL_FRAME_PARMS *frame_parms);
|
||||
int32_t compareints (const void * a, const void * b);
|
||||
|
||||
|
||||
void ulsch_modulation(mod_sym_t **txdataF,
|
||||
void ulsch_modulation(int32_t **txdataF,
|
||||
int16_t amp,
|
||||
frame_t frame,
|
||||
uint32_t subframe,
|
||||
@@ -1450,7 +1450,7 @@ void pcfich_unscrambling(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
void generate_pcfich(uint8_t num_pdcch_symbols,
|
||||
int16_t amp,
|
||||
LTE_DL_FRAME_PARMS *frame_parms,
|
||||
mod_sym_t **txdataF,
|
||||
int32_t **txdataF,
|
||||
uint8_t subframe);
|
||||
|
||||
uint8_t rx_pcfich(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
@@ -1609,7 +1609,7 @@ uint16_t get_nCCE_mac(uint8_t Mod_id,uint8_t CC_id,int num_pdcch_symbols,int sub
|
||||
|
||||
uint8_t get_num_pdcch_symbols(uint8_t num_dci,DCI_ALLOC_t *dci_alloc,LTE_DL_FRAME_PARMS *frame_parms,uint8_t subframe);
|
||||
|
||||
void pdcch_interleaving(LTE_DL_FRAME_PARMS *frame_parms,mod_sym_t **z, mod_sym_t **wbar,uint8_t n_symbols_pdcch,uint8_t mi);
|
||||
void pdcch_interleaving(LTE_DL_FRAME_PARMS *frame_parms,int32_t **z, int32_t **wbar,uint8_t n_symbols_pdcch,uint8_t mi);
|
||||
|
||||
void pdcch_unscrambling(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
uint8_t subframe,
|
||||
@@ -1638,7 +1638,7 @@ void dlsch_unscrambling(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
|
||||
void init_ncs_cell(LTE_DL_FRAME_PARMS *frame_parms,uint8_t ncs_cell[20][7]);
|
||||
|
||||
void generate_pucch(mod_sym_t **txdataF,
|
||||
void generate_pucch(int32_t **txdataF,
|
||||
LTE_DL_FRAME_PARMS *frame_parms,
|
||||
uint8_t ncs_cell[20][7],
|
||||
PUCCH_FMT_t fmt,
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
#include "PHY/defs.h"
|
||||
#include "PHY/extern.h"
|
||||
|
||||
int generate_pss(mod_sym_t **txdataF,
|
||||
int generate_pss(int32_t **txdataF,
|
||||
short amp,
|
||||
LTE_DL_FRAME_PARMS *frame_parms,
|
||||
unsigned short symbol,
|
||||
|
||||
@@ -41,6 +41,9 @@
|
||||
#include "PHY/extern.h"
|
||||
#include "LAYER2/MAC/extern.h"
|
||||
|
||||
#include "UTIL/LOG/log.h"
|
||||
#include "UTIL/LOG/vcd_signal_dumper.h"
|
||||
|
||||
//uint8_t ncs_cell[20][7];
|
||||
//#define DEBUG_PUCCH_TX
|
||||
//#define DEBUG_PUCCH_RX
|
||||
@@ -118,7 +121,7 @@ int16_t W3_im[3][6] = {{0 ,0 ,0 },
|
||||
|
||||
char pucch_format_string[6][20] = {"format 1\0","format 1a\0","format 1b\0","format 2\0","format 2a\0","format 2b\0"};
|
||||
|
||||
void generate_pucch(mod_sym_t **txdataF,
|
||||
void generate_pucch(int32_t **txdataF,
|
||||
LTE_DL_FRAME_PARMS *frame_parms,
|
||||
uint8_t ncs_cell[20][7],
|
||||
PUCCH_FMT_t fmt,
|
||||
@@ -142,7 +145,7 @@ void generate_pucch(mod_sym_t **txdataF,
|
||||
uint8_t m,l,refs;
|
||||
uint8_t n_cs,S,alpha_ind,rem;
|
||||
int16_t tmp_re,tmp_im,ref_re,ref_im,W_re=0,W_im=0;
|
||||
mod_sym_t *txptr;
|
||||
int32_t *txptr;
|
||||
uint32_t symbol_offset;
|
||||
|
||||
uint8_t deltaPUCCH_Shift = frame_parms->pucch_config_common.deltaPUCCH_Shift;
|
||||
@@ -446,7 +449,7 @@ uint32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB,
|
||||
LTE_eNB_COMMON *eNB_common_vars = &phy_vars_eNB->lte_eNB_common_vars;
|
||||
LTE_DL_FRAME_PARMS *frame_parms = &phy_vars_eNB->lte_frame_parms;
|
||||
// PUCCH_CONFIG_DEDICATED *pucch_config_dedicated = &phy_vars_eNB->pucch_config_dedicated[UE_id];
|
||||
int8_t sigma2_dB = phy_vars_eNB->PHY_measurements_eNB[0].n0_subband_power_tot_dB[6];
|
||||
int8_t sigma2_dB = phy_vars_eNB->PHY_measurements_eNB[0].n0_subband_power_tot_dB[0]-10;
|
||||
uint32_t *Po_PUCCH = &(phy_vars_eNB->eNB_UE_stats[UE_id].Po_PUCCH);
|
||||
int32_t *Po_PUCCH_dBm = &(phy_vars_eNB->eNB_UE_stats[UE_id].Po_PUCCH_dBm);
|
||||
uint32_t *Po_PUCCH1_below = &(phy_vars_eNB->eNB_UE_stats[UE_id].Po_PUCCH1_below);
|
||||
@@ -815,7 +818,10 @@ uint32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB,
|
||||
}
|
||||
LOG_D(PHY,"[eNB] PUCCH fmt1: stat_max : %d, sigma2_dB %d (I0 %d dBm, thres %d), Po_PUCCH1_below/above : %d / %d\n",dB_fixed(stat_max),sigma2_dB,phy_vars_eNB->PHY_measurements_eNB[0].n0_subband_power_tot_dBm[6],pucch1_thres,dB_fixed(*Po_PUCCH1_below),dB_fixed(*Po_PUCCH1_above));
|
||||
*Po_PUCCH_update = 1;
|
||||
|
||||
if (UE_id==0) {
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_UE0_SR_ENERGY,dB_fixed(stat_max));
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_UE0_SR_THRES,sigma2_dB+pucch1_thres);
|
||||
}
|
||||
} else if ((fmt == pucch_format1a)||(fmt == pucch_format1b)) {
|
||||
stat_max = 0;
|
||||
#ifdef DEBUG_PUCCH_RX
|
||||
|
||||
@@ -40,12 +40,8 @@
|
||||
#include "PHY/defs.h"
|
||||
#include "PHY/extern.h"
|
||||
#include "SCHED/extern.h"
|
||||
#ifdef OPENAIR2
|
||||
#include "LAYER2/MAC/defs.h"
|
||||
#include "MAC_INTERFACE/defs.h"
|
||||
#include "MAC_INTERFACE/extern.h"
|
||||
#include "SCHED/defs.h"
|
||||
#endif
|
||||
|
||||
#include "assertions.h"
|
||||
|
||||
@@ -81,7 +77,7 @@ int generate_eNB_ulsch_params_from_rar(unsigned char *rar_pdu,
|
||||
uint16_t *RIV2nb_rb_LUT, *RIV2first_rb_LUT;
|
||||
uint16_t RIV_max;
|
||||
|
||||
LOG_I(PHY,"[eNB][RAPROC] generate_eNB_ulsch_params_from_rar: subframe %d (harq_pid %d)\n",subframe,harq_pid);
|
||||
LOG_D(PHY,"[eNB][RAPROC] generate_eNB_ulsch_params_from_rar: subframe %d (harq_pid %d)\n",subframe,harq_pid);
|
||||
|
||||
switch (frame_parms->N_RB_DL) {
|
||||
case 6:
|
||||
|
||||
@@ -137,7 +137,7 @@ int32_t generate_srs_tx(PHY_VARS_UE *phy_vars_ue,
|
||||
|
||||
LTE_DL_FRAME_PARMS *frame_parms=&phy_vars_ue->lte_frame_parms;
|
||||
SOUNDINGRS_UL_CONFIG_DEDICATED *soundingrs_ul_config_dedicated=&phy_vars_ue->soundingrs_ul_config_dedicated[eNB_id];
|
||||
mod_sym_t *txdataF = phy_vars_ue->lte_ue_common_vars.txdataF[0];
|
||||
int32_t *txdataF = phy_vars_ue->lte_ue_common_vars.txdataF[0];
|
||||
uint16_t msrsb=0,Nb=0,nb,b,msrs0=0,k,Msc_RS,Msc_RS_idx,carrier_pos,symbol_offset;
|
||||
uint16_t *Msc_idx_ptr;
|
||||
int32_t k0;
|
||||
@@ -237,13 +237,13 @@ int32_t generate_srs_tx(PHY_VARS_UE *phy_vars_ue,
|
||||
|
||||
for (k=0; k<Msc_RS; k++) {
|
||||
if ((ul_ref_sigs[0][0][Msc_RS_idx][k<<1] >= 0) && (ul_ref_sigs[0][0][Msc_RS_idx][(k<<1)+1] >= 0))
|
||||
txdataF[symbol_offset+carrier_pos] = (mod_sym_t) 4;
|
||||
txdataF[symbol_offset+carrier_pos] = (int32_t) 4;
|
||||
else if ((ul_ref_sigs[0][0][Msc_RS_idx][k<<1] >= 0) && (ul_ref_sigs[0][0][Msc_RS_idx][(k<<1)+1] < 0))
|
||||
txdataF[symbol_offset+carrier_pos] = (mod_sym_t) 2;
|
||||
txdataF[symbol_offset+carrier_pos] = (int32_t) 2;
|
||||
else if ((ul_ref_sigs[0][0][Msc_RS_idx][k<<1] < 0) && (ul_ref_sigs[0][0][Msc_RS_idx][(k<<1)+1] >= 0))
|
||||
txdataF[symbol_offset+carrier_pos] = (mod_sym_t) 3;
|
||||
txdataF[symbol_offset+carrier_pos] = (int32_t) 3;
|
||||
else if ((ul_ref_sigs[0][0][Msc_RS_idx][k<<1] < 0) && (ul_ref_sigs[0][0][Msc_RS_idx][(k<<1)+1] < 0))
|
||||
txdataF[symbol_offset+carrier_pos] = (mod_sym_t) 1;
|
||||
txdataF[symbol_offset+carrier_pos] = (int32_t) 1;
|
||||
|
||||
carrier_pos+=2;
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
//#define DEBUG_SSS
|
||||
|
||||
|
||||
int generate_sss(mod_sym_t **txdataF,
|
||||
int generate_sss(int32_t **txdataF,
|
||||
int16_t amp,
|
||||
LTE_DL_FRAME_PARMS *frame_parms,
|
||||
uint16_t symbol,
|
||||
|
||||
@@ -39,8 +39,6 @@
|
||||
*/
|
||||
#include "PHY/defs.h"
|
||||
#include "PHY/extern.h"
|
||||
#include "MAC_INTERFACE/defs.h"
|
||||
#include "MAC_INTERFACE/extern.h"
|
||||
#ifdef DEBUG_UCI_TOOLS
|
||||
#include "PHY/vars.h"
|
||||
#endif
|
||||
|
||||
@@ -73,7 +73,7 @@ void free_ue_ulsch(LTE_UE_ULSCH_t *ulsch)
|
||||
msg("Freeing ulsch %p\n",ulsch);
|
||||
#endif
|
||||
|
||||
for (i=0; i<ulsch->Mdlharq; i++) {
|
||||
for (i=0; i<8; i++) {
|
||||
#ifdef DEBUG_ULSCH_FREE
|
||||
msg("Freeing ulsch process %d\n",i);
|
||||
#endif
|
||||
@@ -118,7 +118,7 @@ void free_ue_ulsch(LTE_UE_ULSCH_t *ulsch)
|
||||
|
||||
}
|
||||
|
||||
LTE_UE_ULSCH_t *new_ue_ulsch(unsigned char Mdlharq,unsigned char N_RB_UL, uint8_t abstraction_flag)
|
||||
LTE_UE_ULSCH_t *new_ue_ulsch(unsigned char N_RB_UL, uint8_t abstraction_flag)
|
||||
{
|
||||
|
||||
LTE_UE_ULSCH_t *ulsch;
|
||||
@@ -147,9 +147,8 @@ LTE_UE_ULSCH_t *new_ue_ulsch(unsigned char Mdlharq,unsigned char N_RB_UL, uint8_
|
||||
|
||||
if (ulsch) {
|
||||
memset(ulsch,0,sizeof(LTE_UE_ULSCH_t));
|
||||
ulsch->Mdlharq = Mdlharq;
|
||||
|
||||
for (i=0; i<Mdlharq; i++) {
|
||||
for (i=0; i<8; i++) {
|
||||
|
||||
ulsch->harq_processes[i] = (LTE_UL_UE_HARQ_t *)malloc16(sizeof(LTE_UL_UE_HARQ_t));
|
||||
|
||||
@@ -187,7 +186,7 @@ LTE_UE_ULSCH_t *new_ue_ulsch(unsigned char Mdlharq,unsigned char N_RB_UL, uint8_
|
||||
}
|
||||
|
||||
if ((abstraction_flag == 0) && (exit_flag==0)) {
|
||||
for (i=0; i<Mdlharq; i++)
|
||||
for (i=0; i<8; i++)
|
||||
for (j=0; j<96; j++)
|
||||
for (r=0; r<MAX_NUM_ULSCH_SEGMENTS; r++)
|
||||
ulsch->harq_processes[i]->d[r][j] = LTE_NULL;
|
||||
@@ -541,7 +540,7 @@ uint32_t ulsch_encoding(uint8_t *a,
|
||||
ulsch->e+r_offset,
|
||||
ulsch->harq_processes[harq_pid]->C, // C
|
||||
NSOFT, // Nsoft,
|
||||
ulsch->Mdlharq,
|
||||
0, // this means UL
|
||||
1,
|
||||
ulsch->harq_processes[harq_pid]->rvidx,
|
||||
get_Qm_ul(ulsch->harq_processes[harq_pid]->mcs),
|
||||
|
||||
@@ -44,8 +44,6 @@
|
||||
#include "PHY/extern.h"
|
||||
#include "PHY/CODING/extern.h"
|
||||
#include "extern.h"
|
||||
#include "MAC_INTERFACE/defs.h"
|
||||
#include "MAC_INTERFACE/extern.h"
|
||||
#include "SCHED/extern.h"
|
||||
#ifdef OPENAIR2
|
||||
#include "LAYER2/MAC/defs.h"
|
||||
@@ -54,10 +52,6 @@
|
||||
#include "PHY_INTERFACE/extern.h"
|
||||
#endif
|
||||
|
||||
#ifdef OMP
|
||||
#include <omp.h>
|
||||
#endif
|
||||
|
||||
#ifdef PHY_ABSTRACTION
|
||||
#include "UTIL/OCG/OCG.h"
|
||||
#include "UTIL/OCG/OCG_extern.h"
|
||||
@@ -72,7 +66,7 @@ void free_eNB_ulsch(LTE_eNB_ULSCH_t *ulsch)
|
||||
int i,r;
|
||||
|
||||
if (ulsch) {
|
||||
for (i=0; i<ulsch->Mdlharq; i++) {
|
||||
for (i=0; i<8; i++) {
|
||||
if (ulsch->harq_processes[i]) {
|
||||
if (ulsch->harq_processes[i]->b) {
|
||||
free16(ulsch->harq_processes[i]->b,MAX_ULSCH_PAYLOAD_BYTES);
|
||||
@@ -100,7 +94,7 @@ void free_eNB_ulsch(LTE_eNB_ULSCH_t *ulsch)
|
||||
}
|
||||
}
|
||||
|
||||
LTE_eNB_ULSCH_t *new_eNB_ulsch(uint8_t Mdlharq,uint8_t max_turbo_iterations,uint8_t N_RB_UL, uint8_t abstraction_flag)
|
||||
LTE_eNB_ULSCH_t *new_eNB_ulsch(uint8_t max_turbo_iterations,uint8_t N_RB_UL, uint8_t abstraction_flag)
|
||||
{
|
||||
|
||||
LTE_eNB_ULSCH_t *ulsch;
|
||||
@@ -129,10 +123,10 @@ LTE_eNB_ULSCH_t *new_eNB_ulsch(uint8_t Mdlharq,uint8_t max_turbo_iterations,uint
|
||||
|
||||
if (ulsch) {
|
||||
memset(ulsch,0,sizeof(LTE_eNB_ULSCH_t));
|
||||
ulsch->Mdlharq = Mdlharq;
|
||||
ulsch->max_turbo_iterations = max_turbo_iterations;
|
||||
ulsch->Mlimit = 4;
|
||||
|
||||
for (i=0; i<Mdlharq; i++) {
|
||||
for (i=0; i<8; i++) {
|
||||
// msg("new_ue_ulsch: Harq process %d\n",i);
|
||||
ulsch->harq_processes[i] = (LTE_UL_eNB_HARQ_t *)malloc16(sizeof(LTE_UL_eNB_HARQ_t));
|
||||
|
||||
@@ -148,7 +142,6 @@ LTE_eNB_ULSCH_t *new_eNB_ulsch(uint8_t Mdlharq,uint8_t max_turbo_iterations,uint
|
||||
if (abstraction_flag==0) {
|
||||
for (r=0; r<MAX_NUM_ULSCH_SEGMENTS/bw_scaling; r++) {
|
||||
ulsch->harq_processes[i]->c[r] = (uint8_t*)malloc16(((r==0)?8:0) + 3+768);
|
||||
|
||||
if (ulsch->harq_processes[i]->c[r])
|
||||
memset(ulsch->harq_processes[i]->c[r],0,((r==0)?8:0) + 3+768);
|
||||
else
|
||||
@@ -179,18 +172,16 @@ LTE_eNB_ULSCH_t *new_eNB_ulsch(uint8_t Mdlharq,uint8_t max_turbo_iterations,uint
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
void clean_eNb_ulsch(LTE_eNB_ULSCH_t *ulsch, uint8_t abstraction_flag)
|
||||
void clean_eNb_ulsch(LTE_eNB_ULSCH_t *ulsch)
|
||||
{
|
||||
|
||||
unsigned char Mdlharq;
|
||||
unsigned char i;
|
||||
|
||||
//ulsch = (LTE_eNB_ULSCH_t *)malloc16(sizeof(LTE_eNB_ULSCH_t));
|
||||
if (ulsch) {
|
||||
Mdlharq = ulsch->Mdlharq;
|
||||
ulsch->rnti = 0;
|
||||
|
||||
for (i=0; i<Mdlharq; i++) {
|
||||
for (i=0; i<8; i++) {
|
||||
if (ulsch->harq_processes[i]) {
|
||||
// ulsch->harq_processes[i]->Ndi = 0;
|
||||
ulsch->harq_processes[i]->status = 0;
|
||||
@@ -254,7 +245,7 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB,
|
||||
uint8_t *columnset;
|
||||
unsigned int sumKr=0;
|
||||
unsigned int Qprime,L,G,Q_CQI,Q_RI,H,Hprime,Hpp,Cmux,Rmux_prime,O_RCC;
|
||||
unsigned int Qprime_ACK,Qprime_CQI,Qprime_RI,len_ACK=0,len_RI=0;
|
||||
unsigned int Qprime_ACK,Qprime_RI,len_ACK=0,len_RI=0;
|
||||
// uint8_t q_ACK[MAX_ACK_PAYLOAD],q_RI[MAX_RI_PAYLOAD];
|
||||
int metric,metric_new;
|
||||
uint8_t o_flip[8];
|
||||
@@ -288,13 +279,12 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB,
|
||||
time_stats_t *,
|
||||
time_stats_t *);
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_ULSCH_DECODING,1);
|
||||
harq_pid = subframe2harq_pid(frame_parms,phy_vars_eNB->proc[sched_subframe].frame_rx,subframe);
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_ULSCH_DECODING0+harq_pid,1);
|
||||
|
||||
// x1 is set in lte_gold_generic
|
||||
x2 = ((uint32_t)ulsch->rnti<<14) + ((uint32_t)subframe<<9) + frame_parms->Nid_cell; //this is c_init in 36.211 Sec 6.3.1
|
||||
|
||||
// harq_pid = (ulsch->RRCConnRequest_flag == 0) ? subframe2harq_pid_tdd(frame_parms->tdd_config,subframe) : 0;
|
||||
harq_pid = subframe2harq_pid(frame_parms,phy_vars_eNB->proc[sched_subframe].frame_rx,subframe);
|
||||
ulsch_harq = ulsch->harq_processes[harq_pid];
|
||||
|
||||
if (harq_pid==255) {
|
||||
@@ -347,6 +337,7 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB,
|
||||
// CLEAR LLR's HERE for first packet in process
|
||||
}
|
||||
|
||||
// printf("after segmentation c[%d] = %p\n",0,ulsch_harq->c[0]);
|
||||
|
||||
sumKr = 0;
|
||||
|
||||
@@ -419,12 +410,13 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB,
|
||||
else
|
||||
L=8;
|
||||
|
||||
// NOTE: we have to handle the case where we have a very small number of bits (condition on pg. 26 36.212)
|
||||
if (ulsch_harq->Or1 > 0)
|
||||
Qprime = (ulsch_harq->Or1 + L) * ulsch_harq->Msc_initial*ulsch_harq->Nsymb_initial * ulsch->beta_offset_cqi_times8;
|
||||
else
|
||||
Qprime=0;
|
||||
|
||||
if (Qprime > 0) {
|
||||
if (Qprime > 0) { // check if ceiling is larger than floor in Q' expression
|
||||
if ((Qprime % (8*sumKr)) > 0)
|
||||
Qprime = 1+(Qprime/(8*sumKr));
|
||||
else
|
||||
@@ -435,14 +427,10 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB,
|
||||
|
||||
|
||||
|
||||
if (Qprime > (G - ulsch_harq->O_RI))
|
||||
Qprime = G - ulsch_harq->O_RI;
|
||||
|
||||
Q_CQI = Q_m * Qprime;
|
||||
#ifdef DEBUG_ULSCH_DECODING
|
||||
msg("ulsch_decoding: G %d, Q_RI %d, Q_CQI %d (L %d, Or1 %d) O_ACK %d\n",G,Q_RI,Q_CQI,L,ulsch_harq->Or1,ulsch_harq->O_ACK);
|
||||
#endif
|
||||
Qprime_CQI = Qprime;
|
||||
|
||||
G = G - Q_RI - Q_CQI;
|
||||
|
||||
@@ -461,9 +449,7 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB,
|
||||
// Rmux = Hpp*Q_m/Cmux;
|
||||
Rmux_prime = Hpp/Cmux;
|
||||
|
||||
#ifdef DEBUG_ULSCH_DECODING
|
||||
msg("ulsch_decoding.c: G raw %d (%d symb), Hpp %d, Cmux %d, Rmux_prime %d\n",G,ulsch_harq->Nsymb_pusch,Hpp,Cmux,Rmux_prime);
|
||||
#endif
|
||||
|
||||
// Clear "tag" interleaving matrix to allow for CQI/DATA identification
|
||||
memset(ytag,0,Cmux*Rmux_prime);
|
||||
|
||||
@@ -471,128 +457,8 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB,
|
||||
|
||||
i=0;
|
||||
memset(y,LTE_NULL,Q_m*Hpp);
|
||||
/*
|
||||
// Do RI coding
|
||||
if (ulsch->O_RI == 1) {
|
||||
switch (Q_m) {
|
||||
case 2:
|
||||
q_RI[0] = 0;
|
||||
q_RI[1] = PUSCH_y;
|
||||
len_RI=2;
|
||||
break;
|
||||
case 4:
|
||||
q_RI[0] = 0;
|
||||
q_RI[1] = PUSCH_y;//1;
|
||||
q_RI[2] = PUSCH_x;//o_RI[0];
|
||||
q_RI[3] = PUSCH_x;//1;
|
||||
len_RI=4;
|
||||
break;
|
||||
case 6:
|
||||
q_RI[0] = 0;
|
||||
q_RI[1] = PUSCH_y;//1;
|
||||
q_RI[2] = PUSCH_x;//1;
|
||||
q_RI[3] = PUSCH_x;//ulsch->o_RI[0];
|
||||
q_RI[4] = PUSCH_x;//1;
|
||||
q_RI[5] = PUSCH_x;//1;
|
||||
len_RI=6;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (ulsch->O_RI > 1){
|
||||
LOG_E(PHY,"ulsch_decoding: FATAL, RI cannot be more than 1 bit yet\n");
|
||||
return(-1);
|
||||
}
|
||||
|
||||
// 1-bit ACK/NAK
|
||||
if (ulsch_harq->O_ACK == 1) {
|
||||
switch (Q_m) {
|
||||
case 2:
|
||||
q_ACK[0] = 0;
|
||||
q_ACK[1] = (ulsch->bundling==0)? PUSCH_y : 0;
|
||||
len_ACK = 2;
|
||||
break;
|
||||
case 4:
|
||||
q_ACK[0] = 0;
|
||||
q_ACK[1] = (ulsch->bundling==0)? PUSCH_y : 0;
|
||||
q_ACK[2] = PUSCH_x;
|
||||
q_ACK[3] = PUSCH_x;
|
||||
len_ACK = 4;
|
||||
break;
|
||||
case 6:
|
||||
q_ACK[0] = 0;
|
||||
q_ACK[1] = (ulsch->bundling==0)? PUSCH_y : 0;
|
||||
q_ACK[2] = PUSCH_x;
|
||||
q_ACK[3] = PUSCH_x;
|
||||
q_ACK[4] = PUSCH_x;
|
||||
q_ACK[6] = PUSCH_x;
|
||||
len_ACK = 6;
|
||||
break;
|
||||
}
|
||||
}
|
||||
// two-bit ACK/NAK
|
||||
if (ulsch_harq->O_ACK == 2) {
|
||||
switch (Q_m) {
|
||||
case 2:
|
||||
q_ACK[0] = 0;
|
||||
q_ACK[1] = 0;
|
||||
q_ACK[2] = 0;
|
||||
q_ACK[3] = 0;
|
||||
q_ACK[4] = 0;
|
||||
q_ACK[5] = 0;
|
||||
len_ACK = 6;
|
||||
break;
|
||||
case 4:
|
||||
q_ACK[0] = 0;
|
||||
q_ACK[1] = 0;
|
||||
q_ACK[2] = PUSCH_x;
|
||||
q_ACK[3] = PUSCH_x;//1;
|
||||
q_ACK[4] = 0;
|
||||
q_ACK[5] = 0;
|
||||
q_ACK[6] = PUSCH_x;
|
||||
q_ACK[7] = PUSCH_x;//1;
|
||||
q_ACK[8] = 0;
|
||||
q_ACK[9] = 0;
|
||||
q_ACK[10] = PUSCH_x;
|
||||
q_ACK[11] = PUSCH_x;//1;
|
||||
len_ACK = 12;
|
||||
break;
|
||||
case 6:
|
||||
q_ACK[0] = 0;
|
||||
q_ACK[1] = 0;
|
||||
q_ACK[2] = PUSCH_x;
|
||||
q_ACK[3] = PUSCH_x;
|
||||
q_ACK[4] = PUSCH_x;
|
||||
q_ACK[5] = PUSCH_x;
|
||||
|
||||
q_ACK[6] = 0;
|
||||
q_ACK[7] = 0;
|
||||
q_ACK[8] = PUSCH_x;
|
||||
q_ACK[9] = PUSCH_x;
|
||||
q_ACK[10] = PUSCH_x;
|
||||
q_ACK[11] = PUSCH_x;
|
||||
|
||||
q_ACK[12] = 0;
|
||||
q_ACK[13] = 0;
|
||||
q_ACK[14] = PUSCH_x;
|
||||
q_ACK[15] = PUSCH_x;
|
||||
q_ACK[16] = PUSCH_x;
|
||||
q_ACK[17] = PUSCH_x;
|
||||
len_ACK = 18;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (ulsch_harq->O_ACK > 2) {
|
||||
LOG_E(PHY,"ulsch_decoding: FATAL, ACK cannot be more than 2 bits yet\n");
|
||||
return(-1);
|
||||
}
|
||||
|
||||
|
||||
// RI BITS
|
||||
|
||||
// memset(ytag2,0,Q_m*Hpp);
|
||||
|
||||
*/
|
||||
// printf("before unscrambling c[%d] = %p\n",0,ulsch_harq->c[0]);
|
||||
// read in buffer and unscramble llrs for everything but placeholder bits
|
||||
// llrs stored per symbol correspond to columns of interleaving matrix
|
||||
|
||||
@@ -608,6 +474,8 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB,
|
||||
s = lte_gold_generic(&x1, &x2, 0);
|
||||
}
|
||||
|
||||
// printf("after unscrambling c[%d] = %p\n",0,ulsch_harq->c[0]);
|
||||
|
||||
if (frame_parms->Ncp == 0)
|
||||
columnset = cs_ri_normal;
|
||||
else
|
||||
@@ -631,6 +499,8 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB,
|
||||
|
||||
}
|
||||
|
||||
// printf("after RI c[%d] = %p\n",0,ulsch_harq->c[0]);
|
||||
|
||||
// HARQ-ACK Bits (Note these overwrite some bits)
|
||||
if (frame_parms->Ncp == 0)
|
||||
columnset = cs_ack_normal;
|
||||
@@ -733,40 +603,6 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB,
|
||||
}
|
||||
|
||||
|
||||
// for (q=0;q<Q_m;q++) {
|
||||
/*
|
||||
if ((i&0x1f)==0) {
|
||||
s = lte_gold_generic(&x1, &x2, reset);
|
||||
// msg("lte_gold[%d]=%x\n",i,s);
|
||||
reset = 0;
|
||||
}
|
||||
c = (uint8_t)((s>>(i&0x1f))&1);
|
||||
|
||||
|
||||
|
||||
// if bits are tagged as placeholders (RI,ACK)
|
||||
|
||||
if (ytag2[q+(Q_m*((r*Cmux)+j))] == PUSCH_y) {
|
||||
|
||||
c=c_prev;
|
||||
}
|
||||
else if (ytag2[q+(Q_m*((r*Cmux)+j))] == PUSCH_x) {
|
||||
c = 0;
|
||||
#ifdef DEBUG_ULSCH_DECODING
|
||||
// msg("ulsch_decoding.c: PUSCH_x in row %d, col %d: llr %d\n",r,j,ulsch_llr[i]);
|
||||
#endif
|
||||
}
|
||||
c_prev = c;
|
||||
#ifdef DEBUG_ULSCH_DECODING
|
||||
// msg("llr[%d] = %d (c %d, ytag2 %d) ==> ",i,ulsch_llr[i],c,ytag2[q+(Q_m*((r*Cmux)+j))]);
|
||||
#endif
|
||||
// note flipped here for reverse polarity in 3GPP bit mapping
|
||||
y[q+(Q_m*((r*Cmux)+j))] = (c==0) ? -ulsch_llr[i] : ulsch_llr[i];
|
||||
i++;
|
||||
#ifdef DEBUG_ULSCH_DECODING
|
||||
// msg("%d\n",y[q+(Q_m*((r*Cmux)+j))]);
|
||||
#endif
|
||||
*/
|
||||
stop_meas(&phy_vars_eNB->ulsch_demultiplexing_stats);
|
||||
|
||||
if (i!=(H+Q_RI))
|
||||
@@ -828,17 +664,13 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB,
|
||||
for (q=0; q<Q_m; q++) {
|
||||
if (y[q+(Q_m*((r*Cmux) + columnset[j]))]!=0)
|
||||
ulsch_harq->q_ACK[(q+(Q_m*i))%len_ACK] += y[q+(Q_m*((r*Cmux) + columnset[j]))];
|
||||
|
||||
#ifdef DEBUG_ULSCH_DECODING
|
||||
// LOG_D(PHY,"ACK %d => %d (%d,%d,%d)\n",(q+(Q_m*i))%len_ACK,ulsch_harq->q_ACK[(q+(Q_m*i))%len_ACK],q+(Q_m*((r*Cmux) + columnset[j])),r,columnset[j]);
|
||||
printf("ACK %d => %d (%d,%d,%d)\n",(q+(Q_m*i))%len_ACK,ulsch_harq->q_ACK[(q+(Q_m*i))%len_ACK],q+(Q_m*((r*Cmux) + columnset[j])),r,columnset[j]);
|
||||
#endif
|
||||
y[q+(Q_m*((r*Cmux) + columnset[j]))]=0; // NULL LLRs in ACK positions
|
||||
}
|
||||
|
||||
j=(j+3)&3;
|
||||
}
|
||||
|
||||
// printf("after ACKNAK c[%d] = %p\n",0,ulsch_harq->c[0]);
|
||||
|
||||
// RI BITS
|
||||
|
||||
@@ -883,178 +715,141 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB,
|
||||
j=(j+3)&3;
|
||||
}
|
||||
|
||||
// printf("after RI2 c[%d] = %p\n",0,ulsch_harq->c[0]);
|
||||
|
||||
// CQI and Data bits
|
||||
j=0;
|
||||
j2=0;
|
||||
|
||||
// r=0;
|
||||
for (i=0; i<Qprime_CQI; i++) {
|
||||
|
||||
/*
|
||||
while (ytag[(r*Cmux)+j]==LTE_NULL) {
|
||||
#ifdef DEBUG_ULSCH_DECODING
|
||||
msg("ulsch_decoding.c: r %d, j %d: LTE_NULL\n",r,j);
|
||||
#endif
|
||||
j++;
|
||||
if (j==Cmux) {
|
||||
j=0;
|
||||
r++;
|
||||
if (Q_RI>0) {
|
||||
for (i=0; i<(Q_CQI/Q_m); i++) {
|
||||
|
||||
while (ytag[j]==LTE_NULL) {
|
||||
j++;
|
||||
j2+=Q_m;
|
||||
}
|
||||
}
|
||||
for (q=0;q<Q_m;q++) {
|
||||
ys = y[q+(Q_m*((r*Cmux)+j))];
|
||||
if (ys>127)
|
||||
ulsch_harq->q[q+(Q_m*i)] = 127;
|
||||
else if (ys<-128)
|
||||
ulsch_harq->q[q+(Q_m*i)] = -128;
|
||||
else
|
||||
ulsch_harq->q[q+(Q_m*i)] = ys;
|
||||
#ifdef DEBUG_ULSCH_DECODING
|
||||
msg("ulsch_decoding.c: CQI %d, r %d, j %d, y[%d] %d\n",q+(Q_m*i),r,j, q+(Q_m*((r*Cmux) + j)),ys);
|
||||
#endif
|
||||
}
|
||||
*/
|
||||
while (ytag[j]==LTE_NULL) {
|
||||
j++;
|
||||
|
||||
for (q=0; q<Q_m; q++) {
|
||||
// ys = y[q+(Q_m*((r*Cmux)+j))];
|
||||
ys = y[q+j2];
|
||||
|
||||
if (ys>127)
|
||||
ulsch_harq->q[q+(Q_m*i)] = 127;
|
||||
else if (ys<-128)
|
||||
ulsch_harq->q[q+(Q_m*i)] = -128;
|
||||
else
|
||||
ulsch_harq->q[q+(Q_m*i)] = ys;
|
||||
}
|
||||
|
||||
j2+=Q_m;
|
||||
}
|
||||
|
||||
for (q=0; q<Q_m; q++) {
|
||||
// ys = y[q+(Q_m*((r*Cmux)+j))];
|
||||
ys = y[q+j2];
|
||||
|
||||
if (ys>127)
|
||||
ulsch_harq->q[q+(Q_m*i)] = 127;
|
||||
else if (ys<-128)
|
||||
ulsch_harq->q[q+(Q_m*i)] = -128;
|
||||
else
|
||||
ulsch_harq->q[q+(Q_m*i)] = ys;
|
||||
|
||||
#ifdef DEBUG_ULSCH_DECODING
|
||||
msg("ulsch_decoding.c: CQI %d, q %d, y[%d] %d\n",q+(Q_m*i),q,j2, q+j2,ys);
|
||||
#endif
|
||||
}
|
||||
|
||||
j2+=Q_m;
|
||||
}
|
||||
|
||||
// j2=j*Q_m;
|
||||
|
||||
switch (Q_m) {
|
||||
case 2:
|
||||
for (iprime=0; iprime<(Hprime-Qprime_CQI)<<1;) {
|
||||
while (ytag[j]==LTE_NULL) {
|
||||
j++;
|
||||
j2+=2;
|
||||
|
||||
|
||||
switch (Q_m) {
|
||||
case 2:
|
||||
for (iprime=0; iprime<G;) {
|
||||
while (ytag[j]==LTE_NULL) {
|
||||
j++;
|
||||
j2+=2;
|
||||
}
|
||||
|
||||
ulsch_harq->e[iprime++] = y[j2++];
|
||||
ulsch_harq->e[iprime++] = y[j2++];
|
||||
|
||||
}
|
||||
|
||||
ulsch_harq->e[iprime++] = y[j2++];
|
||||
ulsch_harq->e[iprime++] = y[j2++];
|
||||
#ifdef DEBUG_ULSCH_DECODING
|
||||
// msg("ulsch_decoding.c: e %d, r %d, j %d, y[%d] %d\n",g,r,j,q+(Q_m*((r*Cmux) + j)),y[q+(Q_m*((r*Cmux)+j))]);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
// write_output("/tmp/ulsch_e.m","ulsch_e",ulsch->e,iprime,1,0);
|
||||
break;
|
||||
|
||||
case 4:
|
||||
for (iprime=0; iprime<(Hprime-Qprime_CQI)<<2;) {
|
||||
while (ytag[j]==LTE_NULL) {
|
||||
j++;
|
||||
j2+=4;
|
||||
|
||||
|
||||
break;
|
||||
|
||||
case 4:
|
||||
for (iprime=0; iprime<G;) {
|
||||
while (ytag[j]==LTE_NULL) {
|
||||
j++;
|
||||
j2+=4;
|
||||
}
|
||||
|
||||
ulsch_harq->e[iprime++] = y[j2++];
|
||||
ulsch_harq->e[iprime++] = y[j2++];
|
||||
ulsch_harq->e[iprime++] = y[j2++];
|
||||
ulsch_harq->e[iprime++] = y[j2++];
|
||||
|
||||
}
|
||||
|
||||
ulsch_harq->e[iprime++] = y[j2++];
|
||||
ulsch_harq->e[iprime++] = y[j2++];
|
||||
ulsch_harq->e[iprime++] = y[j2++];
|
||||
ulsch_harq->e[iprime++] = y[j2++];
|
||||
#ifdef DEBUG_ULSCH_DECODING
|
||||
// msg("ulsch_decoding.c: e %d, r %d, j %d, y[%d] %d\n",g,r,j,q+(Q_m*((r*Cmux) + j)),y[q+(Q_m*((r*Cmux)+j))]);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 6:
|
||||
for (iprime=0; iprime<(Hprime-Qprime_CQI)*6;) {
|
||||
while (ytag[j]==LTE_NULL) {
|
||||
j++;
|
||||
j2+=6;
|
||||
|
||||
break;
|
||||
|
||||
case 6:
|
||||
for (iprime=0; iprime<G;) {
|
||||
while (ytag[j]==LTE_NULL) {
|
||||
j++;
|
||||
j2+=6;
|
||||
}
|
||||
|
||||
ulsch_harq->e[iprime++] = y[j2++];
|
||||
ulsch_harq->e[iprime++] = y[j2++];
|
||||
ulsch_harq->e[iprime++] = y[j2++];
|
||||
ulsch_harq->e[iprime++] = y[j2++];
|
||||
ulsch_harq->e[iprime++] = y[j2++];
|
||||
ulsch_harq->e[iprime++] = y[j2++];
|
||||
|
||||
}
|
||||
|
||||
ulsch_harq->e[iprime++] = y[j2++];
|
||||
ulsch_harq->e[iprime++] = y[j2++];
|
||||
ulsch_harq->e[iprime++] = y[j2++];
|
||||
ulsch_harq->e[iprime++] = y[j2++];
|
||||
ulsch_harq->e[iprime++] = y[j2++];
|
||||
ulsch_harq->e[iprime++] = y[j2++];
|
||||
#ifdef DEBUG_ULSCH_DECODING
|
||||
// msg("ulsch_decoding.c: e %d, r %d, j %d, y[%d] %d\n",g,r,j,q+(Q_m*((r*Cmux) + j)),y[q+(Q_m*((r*Cmux)+j))]);
|
||||
#endif
|
||||
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
|
||||
break;
|
||||
} // Q_RI>0
|
||||
else {
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
for (i=0,iprime=-Qprime_CQI;i<Hprime;i++,iprime++) {
|
||||
|
||||
while (ytag[(r*Cmux)+j]==LTE_NULL) {
|
||||
#ifdef DEBUG_ULSCH_DECODING
|
||||
msg("ulsch_decoding.c: r %d, j %d: LTE_NULL\n",r,j);
|
||||
#endif
|
||||
j++;
|
||||
if (j==Cmux) {
|
||||
j=0;
|
||||
r++;
|
||||
for (i=0; i<(Q_CQI/Q_m); i++) {
|
||||
|
||||
for (q=0; q<Q_m; q++) {
|
||||
ys = y[q+j2];
|
||||
if (ys>127)
|
||||
ulsch_harq->q[q+(Q_m*i)] = 127;
|
||||
else if (ys<-128)
|
||||
ulsch_harq->q[q+(Q_m*i)] = -128;
|
||||
else
|
||||
ulsch_harq->q[q+(Q_m*i)] = ys;
|
||||
}
|
||||
|
||||
j2+=Q_m;
|
||||
}
|
||||
|
||||
if (i<Qprime_CQI) {
|
||||
|
||||
for (q=0;q<Q_m;q++) {
|
||||
ys = y[q+(Q_m*((r*Cmux)+j))];
|
||||
if (ys>127)
|
||||
ulsch_harq->q[q+(Q_m*i)] = 127;
|
||||
else if (ys<-128)
|
||||
ulsch_harq->q[q+(Q_m*i)] = -128;
|
||||
else
|
||||
ulsch_harq->q[q+(Q_m*i)] = ys;
|
||||
#ifdef DEBUG_ULSCH_DECODING
|
||||
msg("ulsch_decoding.c: CQI %d, r %d, j %d, y[%d] %d\n",q+(Q_m*i),r,j, q+(Q_m*((r*Cmux) + j)),ys);
|
||||
#endif
|
||||
// printf("after CQI0 c[%d] = %p\n",0,ulsch_harq->c[0]);
|
||||
switch (Q_m) {
|
||||
case 2:
|
||||
for (iprime=0; iprime<G;) {
|
||||
ulsch_harq->e[iprime++] = y[j2++];
|
||||
ulsch_harq->e[iprime++] = y[j2++];
|
||||
}
|
||||
}
|
||||
else {
|
||||
for (q=0;q<Q_m;q++) {
|
||||
g = q+(Q_m*iprime);
|
||||
ulsch->e[g] = y[q+(Q_m*((r*Cmux)+j))];
|
||||
#ifdef DEBUG_ULSCH_DECODING
|
||||
// msg("ulsch_decoding.c: e %d, r %d, j %d, y[%d] %d\n",g,r,j,q+(Q_m*((r*Cmux) + j)),y[q+(Q_m*((r*Cmux)+j))]);
|
||||
#endif
|
||||
break;
|
||||
case 4:
|
||||
for (iprime=0; iprime<G;) {
|
||||
ulsch_harq->e[iprime++] = y[j2++];
|
||||
ulsch_harq->e[iprime++] = y[j2++];
|
||||
ulsch_harq->e[iprime++] = y[j2++];
|
||||
ulsch_harq->e[iprime++] = y[j2++];
|
||||
}
|
||||
}
|
||||
j++;
|
||||
if (j==Cmux) {
|
||||
j=0;
|
||||
r++;
|
||||
break;
|
||||
case 6:
|
||||
for (iprime=0; iprime<G;) {
|
||||
ulsch_harq->e[iprime++] = y[j2++];
|
||||
ulsch_harq->e[iprime++] = y[j2++];
|
||||
ulsch_harq->e[iprime++] = y[j2++];
|
||||
ulsch_harq->e[iprime++] = y[j2++];
|
||||
ulsch_harq->e[iprime++] = y[j2++];
|
||||
ulsch_harq->e[iprime++] = y[j2++];
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
*/
|
||||
// printf("after ACKNAK2 c[%d] = %p (iprime %d, G %d)\n",0,ulsch_harq->c[0],iprime,G);
|
||||
|
||||
// Do CQI/RI/HARQ-ACK Decoding first and pass to MAC
|
||||
|
||||
// HARQ-ACK
|
||||
wACK_idx = (ulsch->bundling==0) ? 4 : ((Nbundled-1)&3);
|
||||
#ifdef DEBUG_ULSCH_DECODING
|
||||
msg("ulsch_decoding.c: Bundling %d, Nbundled %d, wACK_idx %d\n",
|
||||
ulsch->bundling,Nbundled,wACK_idx);
|
||||
#endif
|
||||
|
||||
if (ulsch_harq->O_ACK == 1) {
|
||||
ulsch_harq->q_ACK[0] *= wACK_RX[wACK_idx][0];
|
||||
@@ -1064,10 +859,6 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB,
|
||||
ulsch_harq->o_ACK[0] = 0;
|
||||
else
|
||||
ulsch_harq->o_ACK[0] = 1;
|
||||
|
||||
#ifdef DEBUG_ULSCH_DECODING
|
||||
msg("ulsch_decoding.c: ulsch_q_ACK[0] %d (%d,%d)\n",ulsch_harq->q_ACK[0],wACK_RX[wACK_idx][0],wACK_RX[wACK_idx][1]);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (ulsch_harq->O_ACK == 2) {
|
||||
@@ -1077,16 +868,12 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB,
|
||||
ulsch_harq->q_ACK[0] = ulsch_harq->q_ACK[0]*wACK_RX[wACK_idx][0] + ulsch_harq->q_ACK[3]*wACK_RX[wACK_idx][1];
|
||||
ulsch_harq->q_ACK[1] = ulsch_harq->q_ACK[1]*wACK_RX[wACK_idx][0] + ulsch_harq->q_ACK[4]*wACK_RX[wACK_idx][1];
|
||||
ulsch_harq->q_ACK[2] = ulsch_harq->q_ACK[2]*wACK_RX[wACK_idx][0] + ulsch_harq->q_ACK[5]*wACK_RX[wACK_idx][1];
|
||||
|
||||
break;
|
||||
|
||||
case 4:
|
||||
ulsch_harq->q_ACK[0] = ulsch_harq->q_ACK[0]*wACK_RX[wACK_idx][0] + ulsch_harq->q_ACK[5]*wACK_RX[wACK_idx][1];
|
||||
ulsch_harq->q_ACK[1] = ulsch_harq->q_ACK[1]*wACK_RX[wACK_idx][0] + ulsch_harq->q_ACK[8]*wACK_RX[wACK_idx][1];
|
||||
ulsch_harq->q_ACK[2] = ulsch_harq->q_ACK[4]*wACK_RX[wACK_idx][0] + ulsch_harq->q_ACK[9]*wACK_RX[wACK_idx][1];
|
||||
|
||||
break;
|
||||
|
||||
case 6:
|
||||
ulsch_harq->q_ACK[0] = ulsch_harq->q_ACK[0]*wACK_RX[wACK_idx][0] + ulsch_harq->q_ACK[7]*wACK_RX[wACK_idx][1];
|
||||
ulsch_harq->q_ACK[1] = ulsch_harq->q_ACK[1]*wACK_RX[wACK_idx][0] + ulsch_harq->q_ACK[12]*wACK_RX[wACK_idx][1];
|
||||
@@ -1123,37 +910,16 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB,
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef DEBUG_ULSCH_DECODING
|
||||
|
||||
for (i=0; i<ulsch_harq->O_ACK; i++)
|
||||
msg("ulsch_decoding: O_ACK[%d] %d, q_ACK => (%d,%d,%d)\n",i,ulsch_harq->o_ACK[i],ulsch_harq->q_ACK[0],ulsch_harq->q_ACK[1],ulsch_harq->q_ACK[2]);
|
||||
|
||||
#endif
|
||||
|
||||
// RI
|
||||
|
||||
if ((ulsch_harq->O_RI == 1) && (Qprime_RI > 0)) {
|
||||
ulsch_harq->o_RI[0] = ((ulsch_harq->q_RI[0] + ulsch_harq->q_RI[Q_m/2]) > 0) ? 0 : 1;
|
||||
}
|
||||
|
||||
#ifdef DEBUG_ULSCH_DECODING
|
||||
|
||||
if (Qprime_RI > 0) {
|
||||
for (i=0; i<2*ulsch_harq->O_RI; i++)
|
||||
msg("ulsch_decoding: q_RI[%d] %d\n",i,ulsch_harq->q_RI[i]);
|
||||
}
|
||||
|
||||
if (Qprime_CQI > 0) {
|
||||
for (i=0; i<ulsch_harq->O_RI; i++)
|
||||
LOG_D(PHY,"ulsch_decoding: O_RI[%d] %d\n",i,ulsch_harq->o_RI[i]);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
// CQI
|
||||
|
||||
if (Qprime_CQI>0) {
|
||||
// printf("before cqi c[%d] = %p\n",0,ulsch_harq->c[0]);
|
||||
if (Q_CQI>0) {
|
||||
memset((void *)&dummy_w_cc[0],0,3*(ulsch_harq->Or1+8+32));
|
||||
|
||||
O_RCC = generate_dummy_w_cc(ulsch_harq->Or1+8,
|
||||
@@ -1178,7 +944,6 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB,
|
||||
else
|
||||
ulsch_harq->cqi_crc_status = 0;
|
||||
|
||||
//printf("crc(cqi) rx: %x\n",(crc8(o_flip,ulsch->Or1)>>24));
|
||||
|
||||
if (ulsch->harq_processes[harq_pid]->Or1<=32) {
|
||||
ulsch_harq->o[3] = o_flip[0] ;
|
||||
@@ -1221,6 +986,7 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB,
|
||||
|
||||
for (r=0; r<ulsch_harq->C; r++) {
|
||||
|
||||
// printf("before subblock deinterleaving c[%d] = %p\n",r,ulsch_harq->c[r]);
|
||||
// Get Turbo interleaver parameters
|
||||
if (r<ulsch_harq->Cminus)
|
||||
Kr = ulsch_harq->Kminus;
|
||||
@@ -1269,7 +1035,7 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB,
|
||||
ulsch_harq->e+r_offset,
|
||||
ulsch_harq->C,
|
||||
NSOFT,
|
||||
ulsch->Mdlharq,
|
||||
0, //Uplink
|
||||
1,
|
||||
ulsch_harq->rvidx,
|
||||
(ulsch_harq->round==0)?1:0, // clear
|
||||
@@ -1283,50 +1049,25 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB,
|
||||
|
||||
stop_meas(&phy_vars_eNB->ulsch_rate_unmatching_stats);
|
||||
r_offset += E;
|
||||
/*
|
||||
msg("Subblock deinterleaving, d %p w %p\n",
|
||||
ulsch_harq->d[r],
|
||||
ulsch_harq->w);
|
||||
*/
|
||||
|
||||
start_meas(&phy_vars_eNB->ulsch_deinterleaving_stats);
|
||||
sub_block_deinterleaving_turbo(4+Kr,
|
||||
&ulsch_harq->d[r][96],
|
||||
ulsch_harq->w[r]);
|
||||
stop_meas(&phy_vars_eNB->ulsch_deinterleaving_stats);
|
||||
/*
|
||||
#ifdef DEBUG_ULSCH_DECODING
|
||||
msg("decoder input(segment %d) :",r);
|
||||
for (i=0;i<(3*8*Kr_bytes)+12;i++)
|
||||
msg("%d : %d\n",i,ulsch_harq->d[r][96+i]);
|
||||
msg("\n");
|
||||
#endif
|
||||
*/
|
||||
}
|
||||
|
||||
#ifdef OMP
|
||||
#pragma omp parallel private(r,ret) shared(ulsch,harq_pid,crc_type,Kr,f1f2mat_old,phy_vars_eNB,status,iind,)
|
||||
{
|
||||
#pragma omp for nowait
|
||||
#endif
|
||||
|
||||
for (r=0; r<ulsch_harq->C; r++) {
|
||||
// msg("Clearing c, %p\n",ulsch_harq->c[r]);
|
||||
// memset(ulsch_harq->c[r],0,16);//block_length);
|
||||
// msg("done\n");
|
||||
|
||||
/* printf("c[%d] : %p\n",r,
|
||||
ulsch_harq->c[r]);
|
||||
*/
|
||||
|
||||
if (ulsch_harq->C == 1)
|
||||
crc_type = CRC24_A;
|
||||
else
|
||||
crc_type = CRC24_B;
|
||||
|
||||
/*
|
||||
msg("decoder input(segment %d)\n",r);
|
||||
for (i=0;i<(3*8*Kr_bytes)+12;i++)
|
||||
if ((ulsch_harq->d[r][96+i]>7) ||
|
||||
(ulsch_harq->d[r][96+i] < -8))
|
||||
msg("%d : %d\n",i,ulsch_harq->d[r][96+i]);
|
||||
msg("\n");
|
||||
*/
|
||||
|
||||
start_meas(&phy_vars_eNB->ulsch_turbo_decoding_stats);
|
||||
|
||||
ret = tc(&ulsch_harq->d[r][96],
|
||||
@@ -1349,31 +1090,10 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB,
|
||||
|
||||
status[r] = ret;
|
||||
|
||||
if (ret==(1+ulsch->max_turbo_iterations)) {// a Code segment is in error so break;
|
||||
#ifdef DEBUG_ULSCH_DECODING
|
||||
msg("ULSCH harq_pid %d CRC failed\n",harq_pid);
|
||||
#endif
|
||||
/*
|
||||
for (i=0;i<Kr_bytes;i++)
|
||||
printf("segment %d : byte %d => %d\n",r,i,ulsch_harq->c[r][i]);
|
||||
return(ret);
|
||||
*/
|
||||
}
|
||||
|
||||
#ifdef DEBUG_ULSCH_DECODING
|
||||
else
|
||||
msg("ULSCH harq_pid %d CRC OK : %d iterations\n",harq_pid, ret);
|
||||
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
#ifdef OMP
|
||||
}
|
||||
#endif
|
||||
// Reassembly of Transport block here
|
||||
offset = 0;
|
||||
// msg("F %d, Fbytes %d\n",ulsch_harq->F,ulsch_harq->F>>3);
|
||||
|
||||
ret = 1;
|
||||
|
||||
@@ -1391,8 +1111,6 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB,
|
||||
&ulsch_harq->c[0][(ulsch_harq->F>>3)],
|
||||
Kr_bytes - (ulsch_harq->F>>3) - ((ulsch_harq->C>1)?3:0));
|
||||
offset = Kr_bytes - (ulsch_harq->F>>3) - ((ulsch_harq->C>1)?3:0);
|
||||
// msg("copied %d bytes to b sequence\n",
|
||||
// Kr_bytes - (ulsch_harq->F>>3));
|
||||
} else {
|
||||
memcpy(ulsch_harq->b+offset,
|
||||
ulsch_harq->c[r],
|
||||
@@ -1408,7 +1126,7 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB,
|
||||
|
||||
}
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_ULSCH_DECODING,0);
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_ULSCH_DECODING0+harq_pid,0);
|
||||
|
||||
return(ret);
|
||||
}
|
||||
|
||||
@@ -40,8 +40,6 @@
|
||||
|
||||
#include "PHY/defs.h"
|
||||
#include "PHY/extern.h"
|
||||
#include "MAC_INTERFACE/defs.h"
|
||||
#include "MAC_INTERFACE/extern.h"
|
||||
#include "defs.h"
|
||||
#include "extern.h"
|
||||
//#define DEBUG_ULSCH
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
//#define DEBUG_ULSCH_MODULATION
|
||||
|
||||
#ifndef OFDMA_ULSCH
|
||||
void dft_lte(mod_sym_t *z,mod_sym_t *d, int32_t Msc_PUSCH, uint8_t Nsymb)
|
||||
void dft_lte(int32_t *z,int32_t *d, int32_t Msc_PUSCH, uint8_t Nsymb)
|
||||
{
|
||||
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
@@ -373,7 +373,7 @@ void dft_lte(mod_sym_t *z,mod_sym_t *d, int32_t Msc_PUSCH, uint8_t Nsymb)
|
||||
}
|
||||
|
||||
#endif
|
||||
void ulsch_modulation(mod_sym_t **txdataF,
|
||||
void ulsch_modulation(int32_t **txdataF,
|
||||
short amp,
|
||||
uint32_t frame,
|
||||
uint32_t subframe,
|
||||
@@ -393,7 +393,7 @@ void ulsch_modulation(mod_sym_t **txdataF,
|
||||
// uint8_t harq_pid = (rag_flag == 1) ? 0 : subframe2harq_pid_tdd(frame_parms->tdd_config,subframe);
|
||||
uint8_t harq_pid = subframe2harq_pid(frame_parms,frame,subframe);
|
||||
uint8_t Q_m;
|
||||
mod_sym_t *txptr;
|
||||
int32_t *txptr;
|
||||
uint32_t symbol_offset;
|
||||
uint16_t first_rb;
|
||||
uint16_t nb_rb;
|
||||
|
||||
@@ -87,7 +87,7 @@ int slot_fep_ul(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
|
||||
void normal_prefix_mod(int32_t *txdataF,int32_t *txdata,uint8_t nsymb,LTE_DL_FRAME_PARMS *frame_parms);
|
||||
|
||||
void do_OFDM_mod(mod_sym_t **txdataF, int32_t **txdata, uint32_t frame,uint16_t next_slot, LTE_DL_FRAME_PARMS *frame_parms);
|
||||
void do_OFDM_mod(int32_t **txdataF, int32_t **txdata, uint32_t frame,uint16_t next_slot, LTE_DL_FRAME_PARMS *frame_parms);
|
||||
|
||||
void remove_7_5_kHz(PHY_VARS_eNB *phy_vars_eNB,uint8_t subframe);
|
||||
|
||||
|
||||
@@ -91,7 +91,7 @@ void PHY_ofdm_mod(int *input, /// pointer to complex input
|
||||
)
|
||||
{
|
||||
|
||||
static short temp[2048*4] __attribute__((aligned(16)));
|
||||
static short temp[2048*4] __attribute__((aligned(32)));
|
||||
unsigned short i,j;
|
||||
short k;
|
||||
|
||||
@@ -143,9 +143,18 @@ void PHY_ofdm_mod(int *input, /// pointer to complex input
|
||||
printf("[PHY] symbol %d/%d offset %d (%p,%p -> %p)\n",i,nb_symbols,i*fftsize+(i*nb_prefix_samples),input,&input[i*fftsize],&output[(i*fftsize) + ((i)*nb_prefix_samples)]);
|
||||
#endif
|
||||
|
||||
#ifndef __AVX2__
|
||||
// handle 128-bit alignment for 128-bit SIMD (SSE4,NEON,AltiVEC)
|
||||
idft((int16_t *)&input[i*fftsize],
|
||||
(fftsize==128) ? (int16_t *)temp : (int16_t *)&output[(i*fftsize) + ((1+i)*nb_prefix_samples)],
|
||||
1);
|
||||
#else
|
||||
// on AVX2 need 256-bit alignment
|
||||
idft((int16_t *)&input[i*fftsize],
|
||||
(fftsize<=512) ? (int16_t *)temp : (int16_t *)&output[(i*fftsize) + ((1+i)*nb_prefix_samples)],
|
||||
1);
|
||||
|
||||
#endif
|
||||
|
||||
// Copy to frame buffer with Cyclic Extension
|
||||
// Note: will have to adjust for synchronization offset!
|
||||
@@ -158,7 +167,12 @@ void PHY_ofdm_mod(int *input, /// pointer to complex input
|
||||
|
||||
// msg("Doing cyclic prefix method\n");
|
||||
|
||||
if (fftsize==128) {
|
||||
#ifndef __AVX2__
|
||||
if (fftsize==128)
|
||||
#else
|
||||
if (fftsize<=512)
|
||||
#endif
|
||||
{
|
||||
for (j=0; j<fftsize ; j++) {
|
||||
output_ptr[j] = temp_ptr[j];
|
||||
}
|
||||
@@ -223,7 +237,7 @@ void PHY_ofdm_mod(int *input, /// pointer to complex input
|
||||
}
|
||||
|
||||
|
||||
void do_OFDM_mod(mod_sym_t **txdataF, int32_t **txdata, uint32_t frame,uint16_t next_slot, LTE_DL_FRAME_PARMS *frame_parms)
|
||||
void do_OFDM_mod(int32_t **txdataF, int32_t **txdata, uint32_t frame,uint16_t next_slot, LTE_DL_FRAME_PARMS *frame_parms)
|
||||
{
|
||||
|
||||
int aa, slot_offset, slot_offset_F;
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
|
||||
*******************************************************************************/
|
||||
#include "PHY/defs.h"
|
||||
#include "MAC_INTERFACE/extern.h"
|
||||
#include "defs.h"
|
||||
//#define DEBUG_FEP
|
||||
|
||||
@@ -56,7 +55,7 @@ int slot_fep(PHY_VARS_UE *phy_vars_ue,
|
||||
unsigned int rx_offset;
|
||||
|
||||
void (*dft)(int16_t *,int16_t *, int);
|
||||
int tmp_dft_in[256]; // This is for misalignment issues for 6 and 15 PRBs
|
||||
int tmp_dft_in[2048]; // This is for misalignment issues for 6 and 15 PRBs
|
||||
|
||||
switch (frame_parms->ofdm_symbol_size) {
|
||||
case 128:
|
||||
@@ -115,8 +114,8 @@ int slot_fep(PHY_VARS_UE *phy_vars_ue,
|
||||
memset(&ue_common_vars->rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],0,frame_parms->ofdm_symbol_size*sizeof(int));
|
||||
|
||||
rx_offset = sample_offset + slot_offset + nb_prefix_samples0 + subframe_offset - SOFFSET;
|
||||
// Align with 128 bit
|
||||
rx_offset = rx_offset - rx_offset % 4;
|
||||
// Align with 256 bit
|
||||
// rx_offset = rx_offset&0xfffffff8;
|
||||
|
||||
#ifdef DEBUG_FEP
|
||||
// if (phy_vars_ue->frame <100)
|
||||
@@ -131,9 +130,9 @@ int slot_fep(PHY_VARS_UE *phy_vars_ue,
|
||||
(short *)&ue_common_vars->rxdata[aa][0],
|
||||
frame_parms->ofdm_symbol_size*sizeof(int));
|
||||
|
||||
if ((rx_offset&3)!=0) { // if input to dft is not 128-bit aligned, issue for size 6 and 15 PRBs
|
||||
if ((rx_offset&7)!=0) { // if input to dft is not 256-bit aligned, issue for size 6,15 and 25 PRBs
|
||||
memcpy((void *)tmp_dft_in,
|
||||
(void *)&ue_common_vars->rxdata[aa][(rx_offset-nb_prefix_samples0) % frame_length_samples],
|
||||
(void *)&ue_common_vars->rxdata[aa][rx_offset % frame_length_samples],
|
||||
frame_parms->ofdm_symbol_size*sizeof(int));
|
||||
dft((int16_t *)tmp_dft_in,
|
||||
(int16_t *)&ue_common_vars->rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1);
|
||||
@@ -146,8 +145,8 @@ int slot_fep(PHY_VARS_UE *phy_vars_ue,
|
||||
|
||||
}
|
||||
} else {
|
||||
rx_offset += (frame_parms->ofdm_symbol_size+nb_prefix_samples) +
|
||||
(frame_parms->ofdm_symbol_size+nb_prefix_samples)*(l-1);
|
||||
rx_offset += (frame_parms->ofdm_symbol_size+nb_prefix_samples)*l;// +
|
||||
// (frame_parms->ofdm_symbol_size+nb_prefix_samples)*(l-1);
|
||||
|
||||
#ifdef DEBUG_FEP
|
||||
// if (phy_vars_ue->frame <100)
|
||||
@@ -162,7 +161,7 @@ int slot_fep(PHY_VARS_UE *phy_vars_ue,
|
||||
|
||||
start_meas(&phy_vars_ue->rx_dft_stats);
|
||||
|
||||
if ((rx_offset&3)!=0) { // if input to dft is not 128-bit aligned, issue for size 6 and 15 PRBs
|
||||
if ((rx_offset&7)!=0) { // if input to dft is not 128-bit aligned, issue for size 6 and 15 PRBs
|
||||
memcpy((void *)tmp_dft_in,
|
||||
(void *)&ue_common_vars->rxdata[aa][(rx_offset) % frame_length_samples],
|
||||
frame_parms->ofdm_symbol_size*sizeof(int));
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
|
||||
*******************************************************************************/
|
||||
#include "PHY/defs.h"
|
||||
#include "MAC_INTERFACE/extern.h"
|
||||
#include "defs.h"
|
||||
//#define DEBUG_FEP
|
||||
|
||||
|
||||
@@ -1,8 +1,14 @@
|
||||
lte_dfts: lte_dfts.c
|
||||
gcc -O2 -mavx2 -g -ggdb -o lte_dfts lte_dfts.c time_meas.c file_output.c ../../SIMULATION/TOOLS/taus.c -I$$OPENAIR1_DIR -I$$OPENAIR_TARGETS -I$$OPENAIR2_DIR/COMMON -DUSER_MODE -DMR_MAIN -DNB_ANTENNAS_RX=1 # -DD256STATS #-DD64STATS
|
||||
lte_dfts_sse4: lte_dfts.c
|
||||
gcc -O2 -msse4.1 -g -ggdb -o lte_dfts_sse4 lte_dfts.c time_meas.c file_output.c ../../SIMULATION/TOOLS/taus.c -I$$OPENAIR1_DIR -I$$OPENAIR_TARGETS -I$$OPENAIR2_DIR/COMMON -DUSER_MODE -DMR_MAIN -DNB_ANTENNAS_RX=1 # -DD256STATS #-DD64STATS
|
||||
|
||||
lte_dfts.s: lte_dfts.c
|
||||
lte_dfts_avx2: lte_dfts.c
|
||||
gcc -O2 -mavx2 -g -ggdb -o lte_dfts_avx2 lte_dfts.c time_meas.c file_output.c ../../SIMULATION/TOOLS/taus.c -I$$OPENAIR1_DIR -I$$OPENAIR_TARGETS -I$$OPENAIR2_DIR/COMMON -DUSER_MODE -DMR_MAIN -DNB_ANTENNAS_RX=1 # -DD256STATS #-DD64STATS
|
||||
|
||||
lte_dfts_avx2.s: lte_dfts.c
|
||||
gcc -O2 -mavx2 -S lte_dfts.c time_meas.c file_output.c ../../SIMULATION/TOOLS/taus.c -I$$OPENAIR1_DIR -I$$OPENAIR_TARGETS -I$$OPENAIR2_DIR/COMMON -DUSER_MODE -DMR_MAIN -DNB_ANTENNAS_RX=1 # -DD256STATS #-DD64STATS
|
||||
|
||||
dft_cycles: lte_dfts
|
||||
./lte_dfts | egrep cycles
|
||||
lte_dfts_sse4.s: lte_dfts.c
|
||||
gcc -O2 -msse4.1 -S lte_dfts.c time_meas.c file_output.c ../../SIMULATION/TOOLS/taus.c -I$$OPENAIR1_DIR -I$$OPENAIR_TARGETS -I$$OPENAIR2_DIR/COMMON -DUSER_MODE -DMR_MAIN -DNB_ANTENNAS_RX=1 # -DD256STATS #-DD64STATS
|
||||
|
||||
dft_cycles_avx2: lte_dfts_avx2
|
||||
./lte_dfts_avx2 | egrep cycles
|
||||
|
||||
@@ -156,7 +156,7 @@ This function performs optimized fixed-point radix-2 FFT/IFFT.
|
||||
);
|
||||
*/
|
||||
|
||||
void idft1536(int16_t *sigF,int16_t *sig);
|
||||
void idft1536(int16_t *sigF,int16_t *sig,int scale);
|
||||
|
||||
void idft6144(int16_t *sigF,int16_t *sig);
|
||||
|
||||
@@ -168,7 +168,7 @@ void idft3072(int16_t *sigF,int16_t *sig);
|
||||
|
||||
void idft24576(int16_t *sigF,int16_t *sig);
|
||||
|
||||
void dft1536(int16_t *sigF,int16_t *sig);
|
||||
void dft1536(int16_t *sigF,int16_t *sig,int scale);
|
||||
|
||||
void dft6144(int16_t *sigF,int16_t *sig);
|
||||
|
||||
|
||||
+2764
-226
File diff suppressed because one or more lines are too long
@@ -355,7 +355,7 @@ void phy_scope_eNB(FD_lte_phy_scope_enb *form,
|
||||
fl_set_xyplot_ybounds(form->pucch_comp,-5000,5000);
|
||||
fl_set_xyplot_xbounds(form->pucch_comp,-5000,5000);
|
||||
|
||||
fl_set_xyplot_ybounds(form->pucch_comp1,20,80);
|
||||
fl_set_xyplot_ybounds(form->pucch_comp1,0,80);
|
||||
}
|
||||
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
+5
-2
@@ -122,7 +122,6 @@ static inline void* malloc16_clear( size_t size )
|
||||
#define UNUSED(x) (void)x;
|
||||
|
||||
|
||||
#include "spec_defs_top.h"
|
||||
#include "impl_defs_top.h"
|
||||
#include "impl_defs_lte.h"
|
||||
|
||||
@@ -395,7 +394,11 @@ typedef struct PHY_VARS_eNB_s {
|
||||
int32_t pucch1_stats_thres[NUMBER_OF_UE_MAX][10*1024];
|
||||
int32_t pucch1ab_stats_cnt[NUMBER_OF_UE_MAX][10];
|
||||
int32_t pucch1ab_stats[NUMBER_OF_UE_MAX][2*10*1024];
|
||||
|
||||
int32_t pusch_stats_rb[NUMBER_OF_UE_MAX][10240];
|
||||
int32_t pusch_stats_round[NUMBER_OF_UE_MAX][10240];
|
||||
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];
|
||||
#if ENABLE_RAL
|
||||
hash_table_t *ral_thresholds_timed;
|
||||
SLIST_HEAD(ral_thresholds_gen_poll_enb_s, ral_threshold_phy_t) ral_thresholds_gen_polled[RAL_LINK_PARAM_GEN_MAX];
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
#define __PHY_EXTERN_H__
|
||||
|
||||
#include "PHY/defs.h"
|
||||
|
||||
#include "PHY_INTERFACE/defs.h"
|
||||
|
||||
extern char* namepointer_chMag ;
|
||||
extern char* namepointer_log2;
|
||||
@@ -39,10 +39,7 @@ extern char fmageren_name2[512];
|
||||
extern unsigned int RX_DMA_BUFFER[4][NB_ANTENNAS_RX];
|
||||
extern unsigned int TX_DMA_BUFFER[4][NB_ANTENNAS_TX];
|
||||
|
||||
#ifdef OPENAIR_LTE
|
||||
#include "PHY/LTE_TRANSPORT/extern.h"
|
||||
#include "MAC_INTERFACE/defs.h"
|
||||
#include "MAC_INTERFACE/extern.h"
|
||||
#include "SIMULATION/ETH_TRANSPORT/extern.h"
|
||||
|
||||
extern unsigned int DAQ_MBOX;
|
||||
@@ -56,6 +53,7 @@ extern PHY_VARS_eNB ***PHY_vars_eNB_g;
|
||||
extern PHY_VARS_RN **PHY_vars_RN_g;
|
||||
extern LTE_DL_FRAME_PARMS *lte_frame_parms_g;
|
||||
|
||||
extern MAC_xface *mac_xface;
|
||||
|
||||
|
||||
extern short primary_synch0[144];
|
||||
@@ -78,7 +76,6 @@ extern char mode_string[4][20];
|
||||
|
||||
#include "PHY/LTE_TRANSPORT/extern.h"
|
||||
|
||||
#endif
|
||||
|
||||
#ifndef OPENAIR2
|
||||
extern unsigned char NB_eNB_INST;
|
||||
|
||||
@@ -43,7 +43,6 @@
|
||||
|
||||
|
||||
#include "types.h"
|
||||
#include "spec_defs_top.h"
|
||||
//#include "defs.h"
|
||||
|
||||
#define LTE_NUMBER_OF_SUBFRAMES_PER_FRAME 10
|
||||
@@ -605,7 +604,7 @@ typedef struct {
|
||||
/// - first index: eNB id [0..2] (hard coded)
|
||||
/// - second index: tx antenna [0..nb_antennas_tx[
|
||||
/// - third index: sample [0..]
|
||||
mod_sym_t **txdataF[3];
|
||||
int32_t **txdataF[3];
|
||||
/// \brief Holds the received data in time domain.
|
||||
/// Should point to the same memory as PHY_vars->rx_vars[a].RX_DMA_BUFFER.
|
||||
/// - first index: eNB id [0..2] (hard coded)
|
||||
@@ -749,7 +748,7 @@ typedef struct {
|
||||
/// For IFFT_FPGA this points to the same memory as PHY_vars->rx_vars[a].RX_DMA_BUFFER.
|
||||
/// - first index: tx antenna [0..nb_antennas_tx[
|
||||
/// - second index: sample [0..FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX[
|
||||
mod_sym_t **txdataF;
|
||||
int32_t **txdataF;
|
||||
/// \brief Holds the received data in time domain.
|
||||
/// Should point to the same memory as PHY_vars->rx_vars[a].RX_DMA_BUFFER.
|
||||
/// - first index: rx antenna [0..nb_antennas_rx[
|
||||
|
||||
@@ -115,7 +115,6 @@
|
||||
*/
|
||||
|
||||
#include "types.h"
|
||||
#include "spec_defs_top.h"
|
||||
|
||||
|
||||
|
||||
@@ -130,11 +129,7 @@
|
||||
#define HALF_NUMBER_OF_USEFUL_CARRIERS (NUMBER_OF_USEFUL_CARRIERS>>1)
|
||||
#define HALF_NUMBER_OF_USEFUL_CARRIERS_BYTES (HALF_NUMBER_OF_USEFUL_CARRIERS>>2)
|
||||
#define FIRST_CARRIER_OFFSET (HALF_NUMBER_OF_USEFUL_CARRIERS+NUMBER_OF_ZERO_CARRIERS)
|
||||
#ifdef OPENAIR_LTE
|
||||
#define NUMBER_OF_OFDM_SYMBOLS_PER_SLOT (NUMBER_OF_SYMBOLS_PER_FRAME/LTE_SLOTS_PER_FRAME)
|
||||
#else
|
||||
#define NUMBER_OF_OFDM_SYMBOLS_PER_SLOT 16
|
||||
#endif
|
||||
|
||||
#ifdef EMOS
|
||||
#define EMOS_SCH_INDEX 1
|
||||
@@ -263,70 +258,10 @@
|
||||
#define AMP_OVER_2 (AMP>>1)
|
||||
|
||||
/// Threshold for PUCCH Format 1 detection
|
||||
#define PUCCH1_THRES 10
|
||||
#define PUCCH1_THRES 0
|
||||
/// Threshold for PUCCH Format 1a/1b detection
|
||||
#define PUCCH1a_THRES 4
|
||||
|
||||
#ifndef OPENAIR_LTE
|
||||
///
|
||||
/// PHY-MAC Interface Defs
|
||||
///
|
||||
|
||||
/// Maximum number of parallel streams per slot
|
||||
#define NB_STREAMS_MAX 4
|
||||
|
||||
/// Maximum number of frequency groups per slot
|
||||
#define NB_GROUPS_MAX 16
|
||||
|
||||
/// Maximum number of control bytes per slot
|
||||
#define NB_CNTL_BYTES_MAX 8
|
||||
|
||||
/// Maximum number of data bytes per slot
|
||||
#define NB_DATA_BYTES_MAX 256
|
||||
|
||||
#define MAX_NUM_TB 32
|
||||
#define MAX_TB_SIZE_BYTES 128
|
||||
|
||||
/// Size of SACCH PDU in Bytes
|
||||
#define SACCH_SIZE_BYTES (sizeof(UL_SACCH_PDU)+4)
|
||||
/// Size of SACCH PDU in Bytes
|
||||
#define SACCH_SIZE_BITS (SACCH_SIZE_BYTES<<3)
|
||||
|
||||
#define MAX_SACH_SIZE_BYTES 1024
|
||||
|
||||
|
||||
#define SACH_ERROR 1
|
||||
#define SACCH_ERROR 2
|
||||
#define SACH_MISSING 3
|
||||
#define SACH_PARAM_INVALID 10
|
||||
|
||||
#endif //OPENAIR_LTE
|
||||
|
||||
/*
|
||||
enum STATUS_RX {STATUS_RX_OFF,
|
||||
STATUS_RX_ON,
|
||||
STATUS_RX_SYNCING,
|
||||
STATUS_RX_CANNOT_SYNC,
|
||||
STATUS_RX_DATA_PROBLEM,
|
||||
STATUS_RX_LOST_SYNC,
|
||||
STATUS_RX_ABORT,
|
||||
STATUS_RX_TOO_LATE,
|
||||
STATUS_RX_CLOCK_STOPPED};
|
||||
|
||||
enum STATUS_TX {
|
||||
STATUS_TX_OFF,
|
||||
STATUS_TX_ON,
|
||||
STATUS_TX_INPUT_CORRUPT,
|
||||
STATUS_TX_ABORT,
|
||||
STATUS_TX_TOO_LATE,
|
||||
STATUS_TX_CLOCK_STOPPED};
|
||||
|
||||
enum MODE {
|
||||
SYNCHED,
|
||||
SYNCHING,
|
||||
NOT_SYNCHED};
|
||||
*/
|
||||
|
||||
/// Data structure for transmission.
|
||||
typedef struct {
|
||||
/// RAW TX sample buffer
|
||||
@@ -341,6 +276,14 @@ typedef struct {
|
||||
int *RX_DMA_BUFFER[2];
|
||||
} TX_RX_VARS;
|
||||
|
||||
/*! \brief Extension Type */
|
||||
typedef enum {
|
||||
CYCLIC_PREFIX,
|
||||
CYCLIC_SUFFIX,
|
||||
ZEROS,
|
||||
NONE
|
||||
} Extension_t;
|
||||
|
||||
/// Measurement Variables
|
||||
|
||||
#define NUMBER_OF_SUBBANDS_MAX 13
|
||||
@@ -349,7 +292,7 @@ typedef struct {
|
||||
#define MAX_FRAME_NUMBER 0x400
|
||||
#if defined(CBMIMO1) || defined(EXMIMO) || defined(OAI_USRP)
|
||||
#define NUMBER_OF_eNB_MAX 1
|
||||
#define NUMBER_OF_UE_MAX 4
|
||||
#define NUMBER_OF_UE_MAX 16
|
||||
#define NUMBER_OF_CONNECTED_eNB_MAX 3
|
||||
#else
|
||||
#ifdef LARGE_SCALE
|
||||
|
||||
@@ -1,745 +0,0 @@
|
||||
/*******************************************************************************
|
||||
OpenAirInterface
|
||||
Copyright(c) 1999 - 2014 Eurecom
|
||||
|
||||
OpenAirInterface is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
|
||||
OpenAirInterface is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenAirInterface.The full GNU General Public License is
|
||||
included in this distribution in the file called "COPYING". If not,
|
||||
see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Contact Information
|
||||
OpenAirInterface Admin: openair_admin@eurecom.fr
|
||||
OpenAirInterface Tech : openair_tech@eurecom.fr
|
||||
OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr
|
||||
|
||||
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
|
||||
|
||||
*******************************************************************************/
|
||||
#ifndef __PHY_DEFS_SPEC_H__
|
||||
#define __PHY_DEFS_SPEC_H__
|
||||
|
||||
#include "types.h"
|
||||
|
||||
|
||||
/*! \mainpage OpenAirInterface.org Specifications
|
||||
|
||||
\section scope_openair Scope
|
||||
|
||||
The present document specifies the architecture of the following components of a OpenAirInterface network
|
||||
-# \ref _RN_TOPOLOGY_
|
||||
-# \ref _PHY_PROCEDURES_MESH_
|
||||
-# \ref _PHY_PROCEDURES_CELL_
|
||||
-# \ref _L2_PROTOCOLS
|
||||
\subsection _RN_TOPOLOGY_ Radio Network Topology and Components
|
||||
This section describes the different components which constitute the OpenAirInterface. Two types of network topologies are supported, mesh and cellular.
|
||||
The mesh topology is depicted as:
|
||||
|
||||
\image html mesh_topology_small.png "OpenAirInterface Mesh Topology" width=5cm
|
||||
\image latex mesh_topology.pdf "OpenAirInterface Mesh Topology"
|
||||
|
||||
The cellular topology is depicted as:
|
||||
|
||||
\image html cellular_topology_small.png "OpenAirInterface Cellular Topology" width=5cm
|
||||
\image latex cellular_topology.pdf "OpenAirInterface Cellular Topology"
|
||||
|
||||
The mesh topology contains Clusterheads (CH) and Mesh Routers (MR) whereas the cellular topology contains Clusterheads/NodeB (CH/NodeB) and User Equipment (UE).
|
||||
The main difference at the physical layer between the two topologies is that direct communications between UE is not permitted in a cellular topology. Other major
|
||||
differences exist at layers 2 and 3. In both topologies, MR/UE can be connected to more than one CH at any time, if radio connectivity is possible.
|
||||
|
||||
The two types of physical networking devices are specified as follows:
|
||||
|
||||
- Cluster-head (CH or NodeB): A cluster-head can be defined as a node with a maximum visibility/connectivity in terms of number of nodes in its neighborhood.
|
||||
From the point-of-view of the MAC layer, it assumes the fine-grain management of radio resources in the cluster (cell). It determines the frame partitioning
|
||||
(see \ref _framing_modulation) and bandwidth allocation and communicates this information to nodes in the cluster through a beacon. At the
|
||||
physical layer, the cluster-head provides mechanisms for timing and carrier frequency synchronization. The primary role of the CH is to manage radio resources in their cluster. The cluster is defined as the set of nodes which are characterized by one-hop connectivity with the clusterhead. One-hop connectivity is further defined as the capacity to reliably receive and transmit basic signaling channels with the clusterhead using at least at the lowest datarate communication mode. Reliable communication is defined by a transmission which falls below a maximal error probability threshold.
|
||||
CH can only be connected to MR on the same frequency-carrier since they use the same temporal resources as other CH. Thus direct CH<->CH communication is not possible on the same frequency carrier.
|
||||
The downlink (CH -> MR) signaling channels allow for the CH to schedule transmission of labels (in the form of time and frequency mappings on the radio resource) which each carry different types of traffic throughout the mesh network. The Uplink (UL) signaling channels (MR -> CH) are used for relaying bandwidth requirement indicators and channel quality measurements from nodes within the cluster. These feed the scheduling algorithms residing in the CH and allow for proper resource allocation satisfying quality-of-service (QoS) negotiations carried out using Layer 3 (L3) signaling.
|
||||
|
||||
The CH further provides mechanisms for measurement reporting to L3 (for routing, QoS management, labeling, etc...). This is achieved by a set of signaling channels which relay measurement information (UL) for the nodes in the cluster to the CH. The CH processes these raw measurements into a form which is expected by L3 mechanisms.
|
||||
Some CH can assume the role of network synchronization by sending special synchronization pilots (see Section 1.1.5). These will be called Primary CH when network synchronization is achieved using this method. Other CH using this method are called Secondary CH.
|
||||
|
||||
- Regular node/Mesh Router (UE): All nodes have the ability to play at the same time the role of a host and of a router, although this functionality is not activated
|
||||
in a cellular topology.
|
||||
|
||||
The primary role of an MR is to interpret the scheduling information from the CH on the DL signaling channels in order to route the traffic corresponding to the
|
||||
scheduled labels on the allocated physical resources. MR can be connected to other MR (direct link) in the same cluster. MR can also be connected to more than one cluster
|
||||
at the same time. It is also expected to using the UL signaling channels to relay measurements to the CH with which is connected.
|
||||
A secondary role of some MR is to search, on behalf of the CH, for isolated nodes which need to be connected to the mesh. These MR use a special signaling resource (MRBCH) to
|
||||
exchange basic topological parameters with the IN which then results in overall network topology updates. If several IN are contending for access with the cluster,
|
||||
joint processing of the requests will be performed by the mesh during topology adjustments. The most likely nodes to assume this role will be those at the extremities
|
||||
of the mesh.
|
||||
|
||||
Either type of equipment can also assume the role of relay/gateway to a secondary network. `
|
||||
|
||||
In mesh topologies some nodes (CH or MR) assume the role of and edge router (from a layer 2/3 perspective). An edge router is either a CH or MR with an IP interface to
|
||||
another network. The role of ER is to aggregate traffic (ingress) from IP flows to MPLS-like labels for transmission in the mesh. On reception it must demultiplex
|
||||
traffic (degress) from MPLS-like labels to IP for traffic exiting the mesh. Edge routers, potentially all CH and MR, must have MAC-layer interfaces to IP in order to
|
||||
perform these functions.
|
||||
|
||||
Both OpenAirInterface topologies require Network Synchronization (NS) at least between adjacent clusters. This must be on the order of a few microseconds. Three mechanisms are
|
||||
supported to ensure NS. Firstly, a secondary synchronization source (e.g. GPS) can be used as a common time reference by all nodes. Secondly, one CH (Primary CH) in the
|
||||
network use a special synchronization signal which has longer range than the range of communication, in order to cover the region which a common time reference. This is
|
||||
suitable for small networks. Finally the method of distributed relaying of synchronization is possible. This is a method by which all nodes propagate a time reference. Nodes
|
||||
switch between reception (for timing acquisition and tracking) and transmission of the reference. This guarantees coverage of network synchronization over long distances
|
||||
in the absence of a secondary synchronization source.
|
||||
|
||||
|
||||
\subsection _L2_PROTOCOLS Layer 2 Protocols
|
||||
Layer 2 is structured as below. It comprises:
|
||||
- A IP/MPLS networking device (NAS DRIVER) responsible for provision of IP/MPLS layer services to Layer 2 and vice-versa
|
||||
- An MPLS label-switching entity (NAS MPLS) responsible for routing/forwarding within the mesh network (MESH topology only)
|
||||
- A Radio resource control (RRC) entity responsible for MAC layer signalling for configuration of logical flows (labels) and retrieval of measurement information.
|
||||
- A Radio Link Control (RLC) entity which is responsible for automatic repeat request protocols (ARQ) and IP/MPLS packet segmentation
|
||||
- A convergence protocol (PDCP) responsible for IP interface and related functions (header compression, ciphering, etc.)
|
||||
- A scheduling and multiplexing unit (\ref _openair_mac_layer_specs_) responsible for the mapping between logical channels (labels and control-plane signalling)
|
||||
and transport channels. It implements the interface with the PHY, which is the collection of transport channels as well as a primitives for
|
||||
collection of PHY measurements and configuration of PHY parameters.
|
||||
|
||||
\image latex layer2_stack_overview.pdf "Global View of OpenAirInterface Protocol Stack and Communication Primitives"
|
||||
\image html layer2_stack_overview.png "Global View of OpenAirInterface Protocol Stack and Communication Primitives"
|
||||
|
||||
These entities are described in the following subsections.
|
||||
|
||||
\subsubsection _RRC_ Radio Resource Control (RRC)
|
||||
The radio resource control entity is responsible for the L2 signalling implementing the radio channels establishment. It also implements the control of
|
||||
measurement procedures described in Section 1.3.4. Its internal state machine controls the basic procedures for startup, monitoring of synchronization
|
||||
through the measurement system and update of the nodes role in the network (Sections 1.3-0).
|
||||
|
||||
RRC is responsible for configuration of all MAC entities (and PHY via MAC), both dynamic (during label establishment) and static (control channels). This functionality
|
||||
is in response to event occurring in the interaction with L3 and based on dynamic measurements of radio quality.
|
||||
|
||||
RRC signalling makes use of DCCH, CCCH and BCCH for transport of the various protocols.
|
||||
|
||||
|
||||
\subsubsection _RLC_ Radio Link Control (RLC)
|
||||
RLC segments IP packets. The segment size is configurable for each QoS class and is signalled by higher layers during route establishment. The sizes
|
||||
are chosen based on the granularity of the underlying MAC/PHY resources (transport blocks).
|
||||
|
||||
RLC is responsible for ARQ and indexing of SDUs from the user traffic and signalling SDUs from RRC. The SDU inputs from LS form the
|
||||
set of radio bearers, and those from RRC the set of signalling radio bearers. It has two modes of functionality: acknowledged and unacknowledged.
|
||||
Each logical channel can have an associated ARQ process which is managed by RLC. The ARQ mechanisms are based on Release 6 3GPP RLC (25.8xx).
|
||||
The interface with RRC for configuration is not yet described. The interface with MAC is designed such that data for each logical channel is
|
||||
buffered in data queues, whose occupancy can be measured by the MAC scheduling entity.
|
||||
|
||||
\subsubsection _MAC_ MAC scheduling Entity (MAC)
|
||||
The MAC entity is responsible for scheduling control plane and user-plane traffic on the physical OFDMA resources.
|
||||
On transmission, the inputs to this entity are connected to data queues originating in the RLC layer which form the set of logical channels. The
|
||||
control plane traffic is represented by logical channels which form the interface with the RLC. Logical channels contain both user-plane (originating
|
||||
in the IP/MPLS entity via the PDCP entity) and control-plane traffic (originating in the RRC entity). MAC layer specifications are found in \ref _openair_mac_layer_specs_.
|
||||
The MAC is responsible the transport channel interface which exchange data (MAC SDUs) and PHY measurement data for RRC measurement procedures.
|
||||
|
||||
\subsection _PHY_PROCEDURES_MESH_ Physical Layer Procedures - Mesh Topology
|
||||
\subsection _PHY_PROCEDURES_CELL_ Physical Layer Procedures - Cellular Topology
|
||||
|
||||
\subsubsection _POWER_ON_CH_ Power-on procedures of a CH
|
||||
This clause briefly describes the power-on procedure of a CH. The CH RRC receives basic cell configuration information (CHBCH/RACH configuration) from
|
||||
L3 Radio Resource Management (RRM) and configures the MAC and RLC layers. The MAC, in turn, configures the static paramters of the PHY. Upon completion
|
||||
of this initialization phase it enters the steady-state mode.
|
||||
|
||||
\subsubsection _POWER_ON_UE_ Power-on procedures of a UE
|
||||
This clause briefly describes the power-on procedures of a UE which is managed by the UE-RRC state machine. The first function is to search for at least one
|
||||
existing CH in range which is under the responsibility of the PHY. This procedure attempts to analyze the received signal power over a pre-defined time period. If a
|
||||
signal is detected on the desired carrier, the node attempts PHY synchronization using the pilots of the candidate CHs. The postulated frame start position is used
|
||||
to demodulate the CHBCH resources. If the PHY returns an error-free CHBCH with acceptable receive quality, the node is said to be pre-synchronized to the CH.
|
||||
It then attempts to decode the CHBCH of the rest of the CH in range. At the end of this stage, it has a list of acceptable CH. This procedure is repeated periodically,
|
||||
until active communication is sought with the network.
|
||||
|
||||
Upon passing to the state of active communication, it demodulates the CHBCH continuously from the CHs to obtain the UL-CCCH configurations as well as MCCH/MTCH.
|
||||
Once configured, it attempts to establish a connection (connection request) with each of the candidates using the RACH resources of each CH. Upon successful completion
|
||||
of the association procedure it is said to be synchronized to the CH and enters the steady-state mode for each CH.
|
||||
|
||||
\subsubsection _CH_SS_OP_ CH Steady-state operation
|
||||
In TTI N, the CH transmits all DL flows as determined by the CHBCH scheduler during the end of TTI N-2. Furthermore, it detects the UL-SACCH for all UE flows and the
|
||||
UE-SACH for all flows. It also detects the RACH (CCCH). At the end of each TTI, once it has received all feedback indicators (channel and queuing), it invokes
|
||||
the CHBCH scheduling entity to determine the allocations for TTI N+2. The sequence of operations after receiving flows from TTI N (towards the end of TTI N+1) is:
|
||||
|
||||
Entity: RRC TX
|
||||
|
||||
-# generate BCCH and CCCH to be conveyed in TTI N+2
|
||||
-# program new logical channels and measurement procedures starting in TTI N+2 based on L3 signaling requests
|
||||
-# generate signaling radio bearers (measurement requests, UE radio bearer/logical channel configuration) for TTI N+2, and invoke RLC
|
||||
|
||||
Entity: MAC TX
|
||||
|
||||
-# Invoke MAC Scheduler for TTI N+2 allocations : compute DL_SACCH_PDU and UL_ALLOC_PDU for N+2, corresponding to PHY allocations in N+3.
|
||||
-# Generate CHBCH PDU for TTI N+2
|
||||
-# Retrieve RLC SDUs and generate DL_SACH for TTI N+2
|
||||
-# Generate MACPHY_DATA_REQ for TX transport channels in TTI N+2
|
||||
|
||||
MAC RX
|
||||
|
||||
-# Generate MACPHY_DATA_REQ for RX transport channels in TTI N+2 (based on previously scheduled UL_ALLOC_PDU received by UE in TTI N, decoded by end of TTI N+1)
|
||||
-# Invoked by PHY through macphy_data_confirm, the received flows are routed to RLC data queues and MAC signaling information is
|
||||
stored for MAC TX scheduling in next TTI. The MACPHY_DATA_IND primitive (invoked by PHY) also provides CH RX measurements information in an UL_MEAS structure.
|
||||
|
||||
RRC RX
|
||||
|
||||
-# Retrieve RACH and process association requests
|
||||
-# Retrieve signaling radio bearers from RLC
|
||||
-# Retrieve CH RX measurements from PHY/MAC
|
||||
|
||||
This sequence is invoked at the end of each TTI by the system scheduler.
|
||||
|
||||
\subsubsection _UE_SS_OP_ UE Steady-state operation
|
||||
|
||||
In the steady-state of TTI N, the UE PHY demodulates the CHBCH. The CHBCH PDU is then available during TTI N+1 for the MAC. to determine the allocations of the CH and
|
||||
itself in TTI N+2. Based on the decoded information, its scheduling entity generates the transmission for the next TTI and configures the PHY to demodulate the data for
|
||||
which it is destination in the current TTI. The UE RRC acts on PHY/MAC measurements to maintain proper synchronization and received signal quality, for example by
|
||||
detecting a loss of connection of degradation of service. The sequence of operations at the end of TTI N is
|
||||
|
||||
Entity: MAC RX
|
||||
|
||||
-# Parse CHBCH_PDU
|
||||
-# Generate macphy_data_req for RX transport channels in TTI N+2 (based on previously scheduled UL_ALLOC received by UE in TTI N, decoded by end of TTI N+1)
|
||||
-# Invoked by PHY through macphy_data_confirm, the received flows are routed to RLC data queues and MAC signaling information is stored for MAC TX scheduling in next TTI. The reported PHY RF measurements (i.e. in DL_MEAS structure) are processed and used to generate UL_SACCH_FB.
|
||||
-# Process measurements for RRC measurement reports and invoke mac_meas_ind for each logical channel requiring a measurement report.
|
||||
|
||||
Entity: RRC RX
|
||||
|
||||
-# Retrieve BCCH and CCCH and generate association requests
|
||||
-# Retrieve signaling radio bearers from RLC
|
||||
-# Retrieve UE RX measurements from PHY/MAC for L3 measurement reporting
|
||||
|
||||
Entity: RRC TX
|
||||
|
||||
-# program new logical channels and measurement procedures starting in TTI N+2 based on L3 signaling requests signaled by CH-RRC
|
||||
-# generate signaling radio bearers (measurement reports, configuration ACKs) for TTI N+2, and invoke RLC
|
||||
|
||||
Entity: MAC TX
|
||||
|
||||
-# Invoke MAC multiplexer for TTI N+2 allocations : compute UL_SACCH_FB and UL_SACCH_PDU for N+2, corresponding to PHY allocations in N+3.
|
||||
-# Generate CHBCH PDU for TTI N+2
|
||||
-# Retrieve RLC SDUs and generate UL_SACH for TTI N+2
|
||||
-# Generate MACPHY_DATA_REQ for UL_SACH in TTI N+2
|
||||
|
||||
\subsubsection _QOS_MEAS_PROC_ QoS Measurement Procedures
|
||||
|
||||
CH RRC manages L3 measurement reports at L2 for nodes within the cell. Measurement reports are exchanged between UE and CH using a logical channel (DCCH)
|
||||
for topological control signaling, and edge routers can provide these measurements to IP
|
||||
Since the CH scheduler has access to low-level PHY measurements, the MAC layer is responsible for measurement reporting on behalf of the PHY and itself.
|
||||
The CH obtains raw measurements of all links in the cell. RRC acquires these measurements from MAC scheduling entity.
|
||||
Measurements are processed in nodes to the degree required for higher level services. For example nodes will extract link quality (rate/delay) indicators from
|
||||
low-level services (MAC to L3 measurement messages) which are transported using special signaling flows offered by the MAC. This is then used for L2.5 topology
|
||||
maintenance (radio-bearer (re)-assignment). Edge routers will extract L2.5 measurement information on labels to provide IP with quality indicators.
|
||||
|
||||
The interface with RRC for measurement reports is very similar to existing Release 6 HSPA. The types of measurements are:
|
||||
- periodic (or one-shot) with configurable reporting interval and total number of measurements
|
||||
- event-driven - in order to handle degradation of QoS level or loss of connection.
|
||||
|
||||
The available measurements for CH RRC(L2) are:
|
||||
- RSSI (dBm) on physical resources corresponding to logical channel.
|
||||
- Average SINR (dB) on physical resources corresponding to logical channel.
|
||||
- Average number of transmission rounds (times 10) on transport channel associated with logical channel.
|
||||
- Average residual block error rate (times 1000) on transport channel associated with logical channel (after HARQ!).
|
||||
- Actual Spectral efficiency (bits/symbol times 10) of transport channel associated with logical channel.
|
||||
*/
|
||||
|
||||
/** @defgroup _openair_specs_ OpenAirInterface Layer1/2 Specifications
|
||||
* @defgroup physical_layer_ OpenAirInterface Physical Layer (PHY) Specifications
|
||||
* @ingroup _openair_specs_
|
||||
* @{
|
||||
This clause specifies the PHY layer for a multiple-antenna orthogonal frequency-division multiple-access (OFDMA) system applied and
|
||||
the generic openair MAC interface.
|
||||
\image html PHY_arch.png "openair PHY"
|
||||
\image latex PHY_arch.png "openair PHY" width=15cm
|
||||
The specification is intended for reconfigurable equipment, so that actual parameters and mechanisms can be configured
|
||||
prior to deployment of the equipment or potentially over-the-air, although the latter is not yet supported by any of the openair MAC implementations. The
|
||||
PHY and MAC layers are tightly coupled so that the MAC entity can directly influence the occupied physical resources. The OFDMA system provides the means for
|
||||
transmitting several multiple-bitrate streams (multiplexed over sub-carriers and antennas) in parallel. Moreover, PHY signaling strategies are included to
|
||||
provide the means for exploiting channel state feedback at the transmitters in order to allow for advanced PHY allocation of OFDMA resources via the MAC.
|
||||
Modulation and channel coding formats are generic allowing for specific techniques to be employed in different deployment scenarios although configurations
|
||||
based on the 802.11a legacy standard (binary/quaternary phase shift keying BPSK/QPSK, 16-point quadrature amplitude modulation (16-QAM),
|
||||
64-QAM, rate 1/2,2/3,3/4 punctured convolutional codes) are provided here. The specifications are not specific to any frequency band or bandwidth,
|
||||
although the minimum expected channel bandwidth should not be less than 1 MHz.
|
||||
*/
|
||||
|
||||
/** @defgroup _phy_scope Scope
|
||||
* @ingroup physical_layer_
|
||||
* @{
|
||||
This subclause describes the PHY services provided to the openair MAC. The openair PHY consists of several protocol functions which provide the interface
|
||||
between the MAC and PHY for allocation MAC layer PDUs to physical resources. Physical channels are used to convey signaling, data and training information
|
||||
across the radio medium. OpenAirInterface implements the following physical channels:
|
||||
|
||||
-# The PCHSCH (Physical Clusterhead Synchronization Channel) is a pilot resource reserved to a clusterhead (CH) which is responsible for
|
||||
delivering synchronization information to nodes in the cluster. This channel is used by nodes to acquire timing information regarding the
|
||||
beginning of the TTI and to perform initial frequency offset adjustments with respect to the carrier frequency of the CH. The channel
|
||||
is also used by adjacent clusterheads to synchronize the network, in order to facilitate inter-cluster communication under quality-of-service guarantees.
|
||||
-# The PCHBCH (Physical Cluster-head Broadcast Channel) is a signaling resrouce reserved to a clusterhead which is responsible for delivering layer 2/3
|
||||
protocol information to the nodes of the cluster. It can also used by the nodes in the cluster to acquire accurate timing and frequency synchronization information.
|
||||
-# the PRACH (Physical Random Access Channel) is a signaling resource used by a node to provide layer 2 protocol information to its clusterhead.
|
||||
-# the PCHSCH (Physical Clusterhead Synchronization Channel) is a pilot resource used by a CH to allow the UE/MR to estimate the channel of CH and to acquire timing synchronization.
|
||||
-# the PSCH (Physical Synchronization Channel) is a pilot resource used by a node to allow the CH to estimate the channel of an MR/UE.
|
||||
-# the PSACH (Physical Scheduled-Access Channel) is a multi-cast data resource used by a node or CH to send MAC data PDUs to one or more destinations in
|
||||
parallel (using multi-antenna OFDMA).
|
||||
-# the PSACCH (Physical Scheduled-Access Control Channel) is a signaling resource used by a node to provide MAC protocol information to the destinations of its
|
||||
transmissions as well as the CH.
|
||||
-# the PMRBCH (Physical Mesh Router Broadcast Channel) is a signaling resource used by a node to provide layer 2 broadcast protocol information to neighbouring nodes
|
||||
outside the range of clusterheads. It is used by nodes in mesh network topologies to relay network synchronization and provide initial configuration information to
|
||||
|
||||
Transport channels constitute the control and user plane interfaces between the MAC and PHY layers. The are used to exchange both data and measurement information
|
||||
and are mapped onto the above physical channels. OpenAirInterface implements the following transport channels:
|
||||
|
||||
-# The CHBCH (Clusterhead Broadcast Channel) is the transport channel mapped to the PCHBCH.
|
||||
-# The RACH (Random-Access Channel) is the transport channel mapped to the PRACH.
|
||||
-# The DL-SACH (Downlink Scheduled-Access Channel) is the transport channel mapped to the PSACH.
|
||||
-# The UL/MR-SACH (Uplink or Mesh-Router Scheduled-Access Channel) is the transport channel with components mapped to both the PSACH and PSACCH.
|
||||
-# The MRBCH (Mesh-Router Broadcast Channel) is the transport channel mappted to the PMRBCH.
|
||||
|
||||
During reception, all transport channels convey measurement information.
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup _phy_framing Framing and Channel Multiplexing
|
||||
* @ingroup physical_layer_
|
||||
* @{
|
||||
*/
|
||||
|
||||
|
||||
/** @defgroup _framing_modulation TTI and Modulation Parameters
|
||||
* @ingroup _phy_framing
|
||||
|
||||
The physical layer uses OFDM symbols organized into frames (corresponding to TTIs) of complex baseband samples at a sampling rate of \f$ f_\mathrm{s} \f$ samples/s. The carrier frequency is denoted \f$f_c\f$. Each TTI is made up of \f$N_{\mathrm{symb}}\f$ OFDM symbols. OFDM symbols, \f$\mathbf{s}\f$, of length \f$N_\mathrm{s}\f$ samples contain two distinct parts,\f$\mathbf{s}_\mathrm{I}\f$ and \f$\mathbf{s}_\mathrm{E}\f$.
|
||||
|
||||
OpenAirMesh framing is completely configurable, but the nominal OFDMA configuration is shown below
|
||||
|
||||
\image html mesh_frame.png "OpenAir PHY Framing"
|
||||
\image latex mesh_frame.pdf "OpenAir PHY Framing" width=15cm
|
||||
|
||||
One frame consists of 64 OFDM symbols and is divided in a CH transmission time interval (TTI) and a MR TTI. The first four symbols of the CH TTI are reserved for pilot symbols. Each CH transmits one common pilot symbol (CHSCH$_0$) at position 0 and one dedicated pilot symbol (CHSCH\f$_i\f$) at position \f$i \in \{1,2,3\}\f$. This way we can ensure orthogonality between the pilots of different CH received at one MR. The pilot symbols are followed by the broadcast channel (CH-BCH). The rest of the CH TTI frame is reserved for the multiplexed scheduled access channels (CH-SACH).
|
||||
|
||||
The MR TTI contains the random access channel (MR-RACH) with an associated pilot symbol (SCH$_0$). The next two symbols are reserved for pilots. Each MR transmits a pilot symbol SCH\f$_i\f$, \f$i \in \{1,2\}\f$ corresponding to the cluster it belongs to. The pilot symbols are followed by the uplink broadcast channel (MR-BCH) with an associated pilot symbol (MRSCH). The rest of the uplink frame contains the multiplexed scheduled access channels (MR-SACH). The end of the CH and MR TTIs are protected by a guard interval of two symbols. All pilots are designed for MIMO and/or Multiuser channel estimation at the corresponding end.
|
||||
|
||||
MAC PDUs arrive at the MAC interface from different logical resources (control, broadcast, multiple-user data streams) in parallel at the start of each TTI and must be mapped to the available radio resources. Each PDU is scrambled, encoded with a CRC check, and encoded using a channel code with associated bit-interleaving. The output of the channel coding block contains the information content to be transfered across the channel via the modulator. The modulated information content, \f$\mathbf{s}_\mathrm{I}\f$, is built starting either from a frequency-domain signal (classical OFDM) or several time-domain signals (digital FDM). Both techniques yield what are denoted herein as OFDM symbols. In the first method (classical OFDM), \f$\mathbf{S}_\mathrm{I}\f$ is specified in the frequency-domain and is made up of \f$N_\mathrm{d}\f$ samples. This is transfered to the time-domain via the inverse discrete-time Fourier transform (DFT) yielding a time-domain signal also of length \f$N_\mathrm{d}\f$ samples, \f$\mathbf{s}_\mathrm{I}=\mathrm{idft}(\mathbf{S}_\mathrm{I})\f$. In the second method, up to \f$N_\mathrm{f}\f$ different time-domain signals each comprising \f$N_{\mathrm{d,2}}=\frac{N_\mathrm{d}}{N_\mathrm{f}}\f$ samples, where \f$N_\mathrm{f}\f$ denots the number of frequency groups making up an OFDM symbol. Here each signal \f$\mathbf{s}_{i}\f$ is transformed to the frequency-domain via an \f$N_\mathrm{d,2}\f$-dimensional DFT yielding \f$\mathbf{S}_i\f$ and the combined frequency-domain signal is the concatenation of the \f$\mathbf{S}_i\f$, \f$\mathbf{S}_\mathrm{I} = [\mathbf{S}_0 | \mathbf{S}_1 | \cdots | \mathbf{S}_{N_\mathrm{f}-1}]\f$
|
||||
|
||||
The redundant (or null) portion, \f$\mathrm{s}_\mathrm{E}\f$, comprises \f$N_\mathrm{c}=N_\mathrm{s}-N_\mathrm{d}\f$ extra samples, and is concatenated to \f$\mathbf{s}_\mathrm{I}\f$. It is either a cyclic extension or zeros. The overall symbol is \f$\mathbf{s} = [\mathbf{s}_\mathrm{E} | \mathbf{s}_\mathrm{I}]\f$ (prefix configuration) or \f$\mathbf{s} = [\mathbf{s}_\mathrm{I} | \mathbf{s}_\mathrm{E}]\f$ (suffix configuration).
|
||||
|
||||
The cyclic prefix or zero-padding is used to absorb a channel with a delay spread (including propagation delay of the primary paths) equal to its length so that adjacent OFDM symbols do not overlap in time. If the cyclic prefix method is used, then \f$s_{\mathrm{E},i} = s_{\mathrm{I},N_\mathrm{d}-N_\mathrm{c}+i}, i=0,\cdots,N_\mathrm{c}-1\f$, whereas if the cyclic suffix method is used, then \f$s_{\mathrm{E},i} = s_{\mathrm{I},i}, i=0,\cdots,N_\mathrm{c}-1\f$ otherwise \f$s_{\mathrm{E},i}=0, i=0,\cdots,N_\mathrm{c}-1\f$. The value \f$N_\mathrm{c}\f$ should be chosen based on the maximum propagation delay in the system. For outdoor channels this will be on the order of a few microseconds. In addition, for large \f$N_\mathrm{c}\f$, the value of \f$N_\mathrm{d}\f$ should also be large so that the overhead due to the propagation channel be kept to a minimum. \f$N_\mathrm{d}\f$ should be large enough to allow for frequency-domain multiplexing of user data streams if OFDMA is employed. Very large \f$N_\mathrm{c},N_\mathrm{d}\f$ are probably not required for openair except perhaps in the case of long-distance point-to-point links
|
||||
(e.g. to link different hotspot areas).
|
||||
|
||||
OFDM symbols typically provide for a certain spectral roll-off to satisfy RF spectral mask requirements and aid in transmit filtering and adjacent channel suppression. This is usually accomplished by inserting \f$N_{\mathrm{z}}\f$ zeros in \f$\mathbf{S}_f\f$. The total number of useful samples in \f$\mathbf{S}_f\f$ is therefore \f$N_\mathrm{d}-N_\mathrm{z}\f$.
|
||||
|
||||
For use in OFDMA multiplexing, the useful carriers can be split into \f$N_\mathrm{f}\f$ groups of contiguous carriers. Each group of carriers can be used to transmit a different data stream in the same OFDM symbol. This particularly useful for achieving dynamic FDMA on the uplink of a cellular system.
|
||||
|
||||
A summary of the framing parameters is given in following table and is represented by the primitive PHY_FRAMING. It represents part of the static configuration of the air-interface and is set during the initialization phase of the equipment via the MAC-layer interface (see \ref _mac_phy_primitives_,MACPHY_CONFIG_REQ) .
|
||||
|
||||
*/
|
||||
|
||||
|
||||
/** @defgroup _chsch_sig Clusterhead Synchronization Channel (P-CHSCH,S-CHSCH) Signaling Format
|
||||
* @ingroup _phy_framing
|
||||
|
||||
The clusterhead synchronization channel is a signaling channel generated in the PHY layer and is comprised of
|
||||
\f$N_{\mathrm{s,CHSCH}}(N_\mathrm{d}+N_\mathrm{c})\f$ samples, or the equivalent of one \f$N_{\mathrm{s,CHSCH}}\f$ OFDM symbols. The main purposes of
|
||||
this channel are
|
||||
|
||||
-# Timing (TTI/symbol) synchronization for nodes inside the cluster
|
||||
-# Frequency sychronization for nodes inside the cluster
|
||||
-# Timing (TTI/symbol) sychronization for clusterheads in adjacent clusters
|
||||
-# Frequency synchronization for clusterheads in adjacent clusters
|
||||
|
||||
It is emitted once per TTI in conjunction with the clusterhead broadcast channel (P-CHBCH,S-CHSCH). Aside from its primary purposes above, it is also
|
||||
intended to be exploited for channel estimation prior to demodulation of the CHBCH, since the CHBCH does not comprise pilot signals and the clusterhead
|
||||
does not use the MCH. The number of symbols required, \f$N_{\mathrm{s,CHSCH}}\f$, depend on the desired time and frequency acquisition precision.
|
||||
|
||||
The x-CHSCH is a pseudo-random QPSK sequence defined in the frequency domain by the bit sequences
|
||||
\f$\mathrm{Re}\{\mathbf{c}_i\}, \mathrm{Im}\{\mathbf{c}_i\}, i=0,1,\cdots,\lfloor(N_{\mathrm{d}} - N_{\mathrm{z}})N_{\mathrm{s,CHSCH}}/32 \rfloor -1\f$.
|
||||
If multiple transmit antennas (up to \f$N_d/N_c\f$) are used on the same frequency carrier, the CHSCH sequence,
|
||||
\f$\mathbf{c}_{\mathrm{CHSCH,2}}\f$, shall be cyclicly shifted by \f$iN_\mathrm{c}, i=1,2,\cdots,N_\mathrm{ant}\f$ samples on antenna \f$i\f$ prior to
|
||||
cyclic extension. This is to allow nodes to estimate the different channels of the clusterhead efficiently in the frequency domain.
|
||||
|
||||
The transmit power of the CHSCH shall be adjustable by higher layers in order to control the detection range of the clusterhead.
|
||||
|
||||
The parameters of the CHSCH are summarized in the following table and represented by the primitive PHY_CHSCH
|
||||
|
||||
*/
|
||||
|
||||
|
||||
/** @defgroup _CHBCH Clusterhead Broadcast Channel (P-CHBCH,S-CHBCH) Signaling Format
|
||||
* @ingroup _phy_framing
|
||||
|
||||
|
||||
The CHBCH is the signaling channel used by the DLC for passing basic protocol information from the clusterhead to the nodes in its
|
||||
cluster. This information is used to distribute physical resources during the TTI and some additional protocol information
|
||||
(association, QoS reservation, etc.). It is located in the first symbol in the TTI,\f$s_{\mathrm{CHBCH}}\f$. In the case of several
|
||||
clusterheads operating on the same carrier frequency, the CHBCH of adjacent clusters (i.e. those within range of the CHSCH) cannot collide
|
||||
and thus must be allocated different symbols in the TTI or use disjoint frequency carrier sets. The same is true of the CHBCH and MCH/RACH of
|
||||
adjacent clusters. The time/frequency allocation of CHSCH/MCH/RACH across several clusters must be accomplished in a distributed fashion based on the
|
||||
activation times of the different clusterheads and mobility of the clusters. This is beyond the scope of this preliminary specification.
|
||||
|
||||
The CHBCH must use the lowest spectral efficiency (highest sensitivity) coded-modulation format in order to be detectable at large distances.
|
||||
It will thus employ a rate 1/2 forward-error-correcting code with QPSK modulation \ref _phy_coded_modulation. Information will be coded
|
||||
across \f$N_{\mathrm{s,CHBCH}}-1\f$ OFDM symbols using all non-zero carriers. Interleaving shall be performed across frequencies with depth
|
||||
\f$IntDepth_{\mathrm{CHBCH}}\f$. \f$IntDepth_{\mathrm{CHBCH}}\f$ shall be an integer divisor of \f$N_{\mathrm{d}}-N_{\mathrm{z}}\f$. Prior to
|
||||
forward-error correction coding, a CRC of length 32 bits shall be applied to the PDU arriving from the MAC layer interface.
|
||||
|
||||
Channel estimation can be obtained from the CHSCH which is located in the adjacent OFDM symbols. The CHSCH symbols shall be found starting
|
||||
in symbol number \f$\lfloor.5N_{\mathrm{symb}}\rfloor\f$ of the CHBCH.
|
||||
|
||||
The number of bits per TTI delivered by the MAC layer interface (FEC + CRC) bits is determined by the formula
|
||||
\f$(N_{\mathrm{symb}}-1)*(N_{\mathrm{d}}-N_{\mathrm{f}}) - 32\f$.
|
||||
|
||||
If \f$N_\mathrm{pilot}\f$ additional pilot symbols per OFDM symbol are required to handle large frequency offsets due to high-mobility (Doppler)
|
||||
or significant carrier frequency offsets due to the RF equipment, then these are to be placed at equally spaced positions starting from the
|
||||
first non-zero carrier in each CHBCH symbol. These simply puncture the coded bit sequence. Care must be taken when choosing the value of
|
||||
\f$N_\mathrm{f}\f$ with respect to \f$IntDepth_{\mathrm{CHBCH}}\f$ so that consecutive bits of the encoded sequence are not punctured.
|
||||
A judicious choice would take \f$IntDepth_{\mathrm{CHBCH}}\f$ and \f$N_{\mathrm{d}}-N_{\mathrm{z}}\f$ to be relatively prime.
|
||||
|
||||
In order to allow for multi-cell deployment the CHBCH can use a reduced set of subbands which is controlled by the parameter \f$FreqReuse\f$. It should be set to the maximum number of base stations. Let \f$N_{FreqGroup}\f$ be the number of carriers of one frequency group. Then, the set of carriers used by the \f$i^\mathrm{th}\f$ CHBCH \f$i=1,2,3\f$ (CHBCH 0 is unused) is given by
|
||||
\f$\left\{((i-1) FreqReuse N_{pilot} ) + k*N_{FreqGroup}, k=0,\cdots,N_{Pilots}-1\right\}\f$.
|
||||
|
||||
The transmit power of the CHBCH shall be adjustable by higher layers in order to control the detection range of the clusterhead. This value will be
|
||||
transfered via higher layer signaling so that nodes may perform open-loop power control. The following table summarizes the parameters of the CHBCH
|
||||
which are transfered from higher layers using the primitive PHY_CHBCH.
|
||||
|
||||
*/
|
||||
|
||||
|
||||
/** @defgroup _RACH Random-Access Channel (RACH) Signaling Format
|
||||
* @ingroup _phy_framing
|
||||
|
||||
|
||||
The RACH is a signaling channel used only during the association phase of a node and for other management services.
|
||||
Several RACHs can be used in parallel to reduce contention in dense networks, and the exact number are signaled by the higher layer.
|
||||
This resource is not meant, however, to be used for intensive data transmission. Data streams consisting of small sporadic packets
|
||||
could potentially use this channel if required.
|
||||
|
||||
The RACH is subject to power control. The transmit power should be adjusted in a closed-loop fashion based on the
|
||||
measured path loss between the node and the clusterhead.
|
||||
|
||||
For adhoc/mesh configurations, one or more MCH are reserved for the RACH. For a cellular
|
||||
scenario, a SACH resource is opened periodically for the RACH by the clusterhead.
|
||||
|
||||
*/
|
||||
|
||||
|
||||
/** @defgroup _SACH Scheduled-Access (SACH) and Scheduled-Access Control Channel (SACCH) Signaling Format
|
||||
* @ingroup _phy_framing
|
||||
|
||||
The SACH/SACCH is a multiplexed resource containing both signaling information (Scheduled Access Control CHannel) and user plane traffic
|
||||
(Scheduled Access CHannel). The SACH is a set of data streams multiplexed by multiple-antenna OFDMA containing user traffic for several
|
||||
destinations. The SACCH contains low-layer protocol information regarding sequencing (for ARQ and channel decoding) and signaling for
|
||||
channel feedback mechanisms. In AdHoc/Mesh configuration, the SACCH is a resource common to all destinations sharing the SACH and
|
||||
its data is multiplexed with those of the SACH. In the cellular configuration, the SACCH
|
||||
is located in the first allocated symbol and uses the lowest-order (highest protection) coded-modulation format. Aside from low-level signaling
|
||||
it contains the allocation formats used by the set of streams in the SACH, specifically the coded-modulation formats and frequency-allocations in the
|
||||
case of the AdHoc/Mesh configuration. In the downlink of a cellular configuration, the SACCH information is embedded in the CHBCH PDU.
|
||||
|
||||
The transmission format of the SACH/SACCH can either use classical OFDM or digital FDM, and this is signaled by the higher layers.
|
||||
|
||||
Each SACH/SACCH is made up of \f$N_{\mathrm{symb,SACH}}\f$ OFDM symbols. The number of symbols
|
||||
used by a particular SACH in a particular TTI is broadcast via MAC-layer signaling in the CHBCH and depends QoS parameters and
|
||||
measurements. It is thus a dynamic parameter known by all nodes in the cluster at the beginning of each TTI.
|
||||
|
||||
A SACH/SACCH contains \f$N_\mathrm{pilot,SACCH}\f$ pilot symbols during the SACCH symbols to allow for multi-antenna wideband channel estimation, and
|
||||
\f$N_\mathrm{pilot,SACH}\f$ pilot symbols per SACH symbol for carrier frequency offset tracking. The encoding rules for the SACCH
|
||||
pilot symbols is identical to the MCH/RACH on the first transmit antenna. If multiple transmit antennas are employed, the pilot symbols for antenna
|
||||
\f$i=0,1,\cdots,N_\mathrm{ant}\f$ in position $k$ is multiplied by the complex phasor sequence \f$e^{j*2*pi*kiN_\mathrm{p}/N_\mathrm{d}}\f$.
|
||||
This phasor sequence ensures that the \f$N_\mathrm{ant}\f$ channel responses are orthogonal at the receiver provided
|
||||
\f$N_\mathrm{ant}N_\mathrm{p}\leq N_\mathrm{d}\f$ and \f$N_\mathrm{p}\f$ is less than the maximum channel duration plus maximum propagation delay.
|
||||
|
||||
Both \f$N_\mathrm{pilot,SACH}\f$ and \f$N_\mathrm{ant}\f$ are broadcast using higher layer signaling or pre-configured.
|
||||
|
||||
The number of samples for SACH/SACCH data is
|
||||
\f$N_\mathrm{samp,SACH} = N_\mathrm{symb,SACH}(N_\mathrm{d}-N_\mathrm{f} - N_\mathrm{pilot,SACCH} - N_\mathrm{pilot,SACH}) - 32\f$.
|
||||
SACCH data is to be encoded using the lowest spectral efficiency coded-modulation format, namely a rate 1/2 forward error-correcting code with QPSK
|
||||
modulation. If multiple transmit antennas are used, then the lowest spectral-efficiency BICM space-time code is to be employed. Prior to FEC coding a
|
||||
CRC shall be computed on the SACCH data and should be concatenated to the tail of the information. The total number of
|
||||
coded bits for the SACCH depends on the number of streams. It should be kept to a minimum with respect to the total number of data bits in the SACH
|
||||
streams in order to guarantee efficiency.
|
||||
|
||||
Since the SACH is a dynamically allocated resource based on channel quality measures,
|
||||
sample interleaving across different OFDM carriers is not required.
|
||||
|
||||
Prior to forward error-correction coding, a CRC of length 32 bits shall be applied to the PDU.
|
||||
|
||||
The SACH is the only resource for which the output of the channel coding block is vectorial, in the case of multiple transmit antennas. Space-time signal
|
||||
processing is therefore possible on the SACH data streams. Identical interleaving is performed on all antenna streams and the choice of coded-modulation
|
||||
and space-time processing methods is determined by the MAC scheduler. A choice of 16 different formats are considered including some of the legacy
|
||||
802.11a formats. The formats could potentially be reconfigurable and installed at run-time or over-the-air. This is discussed in \ref _phy_coded_modulation.
|
||||
Each stream can use a separate coded-modulation format.
|
||||
|
||||
Streams can use a subset of the OFDM carriers according to the frequency allocation vector as mentioned earlier. The allocations are chosen by the opportunistic
|
||||
scheduling algorithm in the MAC layer in order to achieve multi-user diversity and potentially spatial-multiplexing.
|
||||
|
||||
The configuration information for the SACH/SACCH resource are partially signaled by higher layers and partially computed dynamically by the scheduling algorithm in the MAC. They are described by the primitive PHY_SACH summarized in the following table.
|
||||
|
||||
|
||||
*/
|
||||
|
||||
/*! \brief Extension Type */
|
||||
typedef enum {
|
||||
CYCLIC_PREFIX,
|
||||
CYCLIC_SUFFIX,
|
||||
ZEROS,
|
||||
NONE
|
||||
} Extension_t;
|
||||
|
||||
|
||||
/*! \brief Transmit Signal Format */
|
||||
typedef enum {
|
||||
OFDM=0,
|
||||
Digital_FDM
|
||||
} Signal_format_t;
|
||||
|
||||
|
||||
/*! \brief PHY Framing Structure
|
||||
*/
|
||||
|
||||
typedef struct PHY_FRAMING {
|
||||
u_long fc_khz; /*!< \brief Carrier Frequency (kHz)*/
|
||||
u_long fs_khz; /*!< \brief Sampling Frequency (kHz)*/
|
||||
u_short Nsymb ; /*!< \brief Number of OFDM Symbols per TTI */
|
||||
u_short Nd; /*!< \brief Number of OFDM Carriers */
|
||||
u_char log2Nd; /*!< \brief Log2 of Number of OFDM Carriers */
|
||||
u_short Nc; /*!< \brief Number of Prefix Samples*/
|
||||
u_short Nz; /*!< \brief Number of Zero Carriers*/
|
||||
u_char Nf; /*!< \brief Number of Frequency Groups*/
|
||||
Extension_t Extension_type; /*!< \brief Prefix method*/
|
||||
} PHY_FRAMING;
|
||||
|
||||
|
||||
/*! \brief PHY_CHSCH Configuration Structure
|
||||
*/
|
||||
|
||||
typedef struct PHY_CHSCH {
|
||||
u_short symbol; /*!< \brief First Symbol of CHSCH in TTI */
|
||||
u_short Nsymb; /*!< \brief Number of Symbols of CHSCH in TTI*/
|
||||
u_char dd_offset;
|
||||
u_long chsch_seq_re[32]; /*!< \brief Real part of \f$\mathbf{c}_i\f$ \f$(0\cdots n_1-1 \mathrm{LSBs})\f$*/
|
||||
u_long chsch_seq_im[32]; /*!< \brief Imaginary part of \f$\mathbf{c}_i\f$ \f$(0\cdots n_1-1 \mathrm{LSBs})\f$*/
|
||||
char CHSCH_POWER_dBm; /*!< \brief Average CHSCH Transmit Power*/
|
||||
} PHY_CHSCH;
|
||||
|
||||
/*! \brief PHY_SCH Configuration Structure
|
||||
*/
|
||||
typedef struct PHY_SCH {
|
||||
u_short Nsymb; /*!< \brief Number of Symbols of SCH in TTI */
|
||||
u_char dd_offset;
|
||||
u_long sch_seq_re[32]; /*!< \brief Real part of \f$\mathbf{c}_i\f$ \f$(0\cdots n_1-1 \mathrm{LSBs})\f$*/
|
||||
u_long sch_seq_im[32]; /*!< \brief Imaginary part of \f$\mathbf{c}_i\f$ \f$(0\cdots n_1-1 \mathrm{LSBs})\f$*/
|
||||
char SCH_POWER_dBm; /*!< \brief Average SCH Transmit Power*/
|
||||
} PHY_SCH;
|
||||
|
||||
|
||||
/*! \brief PHY_CHBCH Configuration Structure
|
||||
*/
|
||||
|
||||
typedef struct PHY_CHBCH {
|
||||
u_short symbol; /*!< \brief First Symbol of CHBCH in TTI */
|
||||
u_short Nsymb; /*!< \brief Number of Symbols of CHBCH in TTI */
|
||||
u_short IntDepth; /*!< \brief Frequency Interleaving depth of CHBCH */
|
||||
u_char dd_offset;
|
||||
u_short Npilot; /*!< \brief Number of pilot symbols in CHBCH */
|
||||
u_long pilot_re[8]; /*!< \brief Pilot symbols (Real part) */
|
||||
u_long pilot_im[8]; /*!< \brief Pilot symbols (Imag part) */
|
||||
u_char FreqReuse; /*!< \brief Frequency Reuse Factor */
|
||||
u_char FreqReuse_ind; /*!< \brief Frequency Reuse Index */
|
||||
char CHBCH_POWER_dBm; /*!< \brief Average CHBCH Transmit Power*/
|
||||
} PHY_CHBCH;
|
||||
|
||||
typedef struct PHY_MRBCH {
|
||||
u_short symbol; /*!< \brief First Symbol of MRBCH in TTI */
|
||||
u_short Nsymb; /*!< \brief Number of Symbols of MRBCH in TTI */
|
||||
u_short IntDepth; /*!< \brief Frequency Interleaving depth of MRBCH */
|
||||
u_char dd_offset;
|
||||
u_short Npilot; /*!< \brief Number of pilot symbols in MRBCH */
|
||||
u_long pilot_re[8]; /*!< \brief Pilot symbols (Real part) */
|
||||
u_long pilot_im[8]; /*!< \brief Pilot symbols (Imag part) */
|
||||
u_char FreqReuse; /*!< \brief Frequency Reuse Factor */
|
||||
u_char FreqReuse_ind; /*!< \brief Frequency Reuse Index */
|
||||
char MRBCH_POWER_dBm; /*!< \brief Average MRBCH Transmit Power*/
|
||||
} PHY_MRBCH;
|
||||
|
||||
/*! \brief PHY SACH/SACCH Configuration Structure
|
||||
*/
|
||||
|
||||
|
||||
typedef struct PHY_SACH {
|
||||
Signal_format_t Signal_format; /*!< \brief Transmit Signal format of SACH/SACCH*/
|
||||
u_char Npilot; /*!< \brief Number of pilot symbols */
|
||||
u_long pilot_re[8]; /*!< \brief Pilot symbols (real part) */
|
||||
u_long pilot_im[8]; /*!< \brief Pilot symbols (imag part) */
|
||||
char SACH_POWER_dBm; /*!< \brief Average MCH/RACH Transmit Power*/
|
||||
} PHY_SACH;
|
||||
|
||||
|
||||
/* @}*/
|
||||
|
||||
|
||||
|
||||
/** @defgroup _phy_coded_modulation Coded Modulation and H-ARQ
|
||||
* @ingroup physical_layer_
|
||||
* @{
|
||||
OpenAirMesh makes use of punctured binary codes (64-state rate 1/2 convolutional or 8-state rate 1/3 3GPP/LTE Turbo code).
|
||||
Puncturing can use either 3GPP rate matching or random puncturing in order to fine tune the coding rate to adapt to
|
||||
configurable transport block sizes delivered to PHY by the MAC. The overall coding sub-system is shown in
|
||||
Figure below. New transport blocks arriving from the MAC layer (based on multi-user scheduling) are coded
|
||||
using a CRC extension and the chosen binary code. These are then fed to the active transport block buffer along with
|
||||
those that are to be retransmitted. Each transmitted block is punctured and then passed to a bit-interleaver and
|
||||
modulation mapper (BICM). OpenAirMesh supports QPSK, 16-QAM and 64-QAM modulation.
|
||||
|
||||
\image html openair_coding.png "Coded Modulation Subsystem"
|
||||
\image latex openair_coding.png "Coded Modulation Subsystem" width=15cm
|
||||
|
||||
The transmitted transport blocks can be split into to two spatial streams in the case of point-to-point MIMO transmission.
|
||||
Each stream receives an adjustable amplitude and then each is passed to a different (orthogonal) space-time parser which
|
||||
guarantees that both streams use different antennas in the same time/frequency dimension. This allows for low-complexity
|
||||
successive detection at the receiver and maximizes diversity against fading. This is a form of superposition coding since
|
||||
the two streams are combined additively in the air through the use of multiple transmit antennas.
|
||||
|
||||
A second design objective for this coding strategy, in addition to low-complexity point-to-point MIMO operation, is that
|
||||
the same transmitter and receiver structure can be used in a distributed MIMO scenario. Here one spatial stream is used
|
||||
at each source and the second stream originates in another part of the network, either in the same cluster or an adjacent
|
||||
cluster. Co-operation is needed in order to guarantee different STF parsing for the two streams so that they can be
|
||||
decoupled at the SIC receiver. A particular user can decode both streams or simply select the one it requires.
|
||||
|
||||
*/
|
||||
/** @defgroup _phy_scrambling Transport block Scrambling
|
||||
* @ingroup _phy_coded_modulation
|
||||
|
||||
Each transport block is scrambled using the LFSR shown in the following figure with a random initial state
|
||||
in the LFSR determined at deployment time. The LFSR is used in the to descramble the SDU. Scrambling is always
|
||||
performed on all transport channels.
|
||||
|
||||
\image html scrambler.png "MAC SDU Scrambling"
|
||||
\image latex scrambler.png "MAC SDU Scrambling" width=15cm
|
||||
|
||||
\note More information on Linear feedback shift register (LFSR) can be found on http://homepage.mac.com/afj/lfsr.html or http://www-math.cudenver.edu/~wcherowi/courses/m5410/m5410fsr.html
|
||||
*/
|
||||
|
||||
/** @defgroup _phy_crc Cyclic Redundancy Check
|
||||
* @ingroup _phy_coded_modulation
|
||||
|
||||
For the purpose of error-detection a cyclic-redundancy check (CRC) is applied to every transport block entering the
|
||||
PHY coding subsystem, including those destined for the CHBCH,MCH, RACH and SACCH. To the latter are a applied an
|
||||
8-bit systematic CRC defined by the generator \f$g_8(D)=1+D+D^3+D^4+D^7+D^8\f$. Data on the SACH is encoded using a
|
||||
24-bit CRC defined by the generator \f$g_{16}(D)=1+D^5+D^{12}+D^{15}\f$.
|
||||
\note: Basic information about CRC can be found at: http://www.mathpages.com/home/kmath458.htm or http://utopia.knoware.nl/users/eprebel/Communication/CRC/
|
||||
*/
|
||||
|
||||
/**@defgroup _phy_conv_cod Convolutional Coding
|
||||
* @ingroup _phy_coded_modulation
|
||||
|
||||
For coded-modulation formats using convolutional coding, the 802.11a rate 1/2 64-state convolutional coder shown
|
||||
below shall be applied to the scrambled and parity-checked transport blocks.
|
||||
|
||||
\image html convolutional.png "802.11a Convolutional Code"
|
||||
\image latex convolutional.png "802.11a Convolutional Code" width=15cm
|
||||
|
||||
*/
|
||||
|
||||
/** @defgroup _phy_puncturing_ Puncturing
|
||||
* @ingroup _phy_coded_modulation
|
||||
|
||||
Random puncturing makes use of a 32-bit Tausworthe random number generator. Let \f$S_i,i\in\{0,1,2\}\f$ be
|
||||
the 32-bit initial values of the generator state given by
|
||||
|
||||
\f$S_0(0) = \mathrm{1E23D852} + 16s\f$
|
||||
|
||||
\f$S_1(0) = \mathrm{81F38A1C} + 16s\f$
|
||||
|
||||
\f$S_2(0) = \mathrm{FE1A133E} + 16s\f$
|
||||
|
||||
where \f$s\f$ is a seed. The seed is typically different for each transport block and each round in the
|
||||
HARQ protocol. It can be also used for layer 1 encryption.
|
||||
|
||||
The state recursions at iteration \f$n\f$ are given by
|
||||
|
||||
\f$b_0(n)=((2^{13}S_0(n-1))\oplus S_0(n-1))2^{-19}\f$
|
||||
|
||||
\f$b_1(n)=((2^{2}S_1(n-1))\oplus S_1(n-1))2^{-25}\f$
|
||||
|
||||
\f$b_2(n)=((2^{3}S_2(n-1))\oplus S_2(n-1))2^{-11}\f$
|
||||
|
||||
\f$S_0(n)=((S_0(n-1)\mathrm{and}\mathrm{FFFFFFFE})2^{12})\oplus b_0(n)\f$
|
||||
|
||||
\f$S_1(n)=((S_1(n-1)\mathrm{and}\mathrm{FFFFFFF8})2^{4})\oplus b_0(n)\f$
|
||||
|
||||
\f$S_2(n)=((S_2(n-1)\mathrm{and}\mathrm{FFFFFFF0})2^{17})\oplus b_0(n)\f$
|
||||
|
||||
and the output of the generator is \f$U(n)=S_0(n)\oplus S_1(n)\oplus S_2(n)\f$.
|
||||
|
||||
Let \f$N_c\f$ be the number of coded bits after puncturing, \f$N_i\f$ be the number of input bits and
|
||||
\f$N_{\mathrm{bps}}\f$ be the number bits per symbol \f$N_{\mathrm{bps}}\in\{2,4,6\}\f$. Let the
|
||||
input sequence be denoted \f$c[i],i\in\{0,1,\cdots,N_i-1\}\f$. The
|
||||
Tausworthe puncturing procedure is achieved according to the following algorithm for a rate 1/2 binary code:
|
||||
|
||||
1. Based on \f$N_c\f$, \f$N_i\f$ check that the rate falls between (\f$\frac{N_{\mathrm{bps}}}{4}\f$,\f$\frac{3N_{\mathrm{bps}}}{8}\f$),
|
||||
otherwise declare an error.
|
||||
|
||||
2. Set the number of punctured bits to \f$N_p\leftarrow (N_i-N_c)/N_{\mathrm{bps}}\f$.
|
||||
|
||||
3. Initially mark all \f$N_c\f$ coded bits to be transmitted.
|
||||
|
||||
4. Set the initial seed of the Tausworthe to the function value \f$\mathrm{s}\f$
|
||||
|
||||
5. Set \f$N_{i2}\leftarrow \lfloor N_i/N_{\mathrm{bps}}\rfloor \f$.
|
||||
|
||||
6. Set \f$i\leftarrow0\f$
|
||||
|
||||
7. Let \f$U(i)\f$ be the \f$i^{\mathrm{th}}\f$ output of the Tausworthe generator and
|
||||
\f$U'(i)=U(i)\mathrm{mod}2^{\lceil \log_2(N_{i2})\rceil}\f$
|
||||
|
||||
8. if \f$U'(i) < N_{i2}\f$ and \f$\mathrm{c[U'(i)]}\f$ is not already punctured go to 10
|
||||
|
||||
9. goto 7
|
||||
|
||||
10. Mark \f$c[U' + jN_{i2}])\f$ as punctured for \f$j=0,1,\cdots,N_{\mathrm{bps}}-1\f$.
|
||||
|
||||
11. Set \f$i\leftarrow i+1\f$
|
||||
|
||||
12. if \f$i<N_{i2}\f$ goto 7
|
||||
*/
|
||||
|
||||
/** @defgroup _phy_interl Bit-Interleaving and Modulation Mapping
|
||||
* @ingroup _phy_coded_modulation
|
||||
|
||||
The interleaving depth for CHBCH,MCH,RACH and SACCH in the multiplexing sub-block is chosen to ensure sufficient separation in frequency
|
||||
for adjacent coded outputs, and thus maximize frequency diversity. For coded-modulation formats 0-5, let \f$D=(N_\mathrm{d}-N_\mathrm{z})/IntDepth\f$ where
|
||||
\f$IntDepth\f$ depends on the particular transport channel at hand. Each output bit from the convolutional coder, \f$c_i\f$, shall be placed in the set
|
||||
\f$C_{i\mathrm{mod}D}\f$. The bits in each set are permuted based on a pseudo-random sequence and then combined to form 2,4 or 6-tuples depending on the modulation
|
||||
order of the coded-modulation format. The interleaving permutation sequence depends on \f$D\f$ and the number of coded bits.
|
||||
|
||||
For the SACH, \f$D\f$ is the number of allocated frequency groups. The above interleaving strategy shall be applied with this value.
|
||||
|
||||
The QAM modulated symbols are mapped according to the Gray mapping as shown in the following figures. QAM symbols must be scaled to
|
||||
ensure constant average energy independent of the modulation order. The scaling factors are \f$1/\sqrt(2),1/\sqrt{10}\f$ and \f$1/\sqrt{42}\f$ for
|
||||
QPSK, 16-QAM and 64-QAM respectively.
|
||||
|
||||
\image html QAMmodulation.png "QAM Modulation Mapping"
|
||||
\image latex QAMmodulation.png "QAM Modulation Mapping" width=15cm
|
||||
|
||||
* @}
|
||||
* @}
|
||||
* @defgroup _openair_mac_layer_specs_ MAC Layer (MAC) Specifications
|
||||
* @ingroup _openair_specs_
|
||||
*/
|
||||
|
||||
|
||||
#endif /*__PHY_DEFS_SPEC_H__ */
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,68 +0,0 @@
|
||||
/*******************************************************************************
|
||||
OpenAirInterface
|
||||
Copyright(c) 1999 - 2014 Eurecom
|
||||
|
||||
OpenAirInterface is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
|
||||
OpenAirInterface is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenAirInterface.The full GNU General Public License is
|
||||
included in this distribution in the file called "COPYING". If not,
|
||||
see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Contact Information
|
||||
OpenAirInterface Admin: openair_admin@eurecom.fr
|
||||
OpenAirInterface Tech : openair_tech@eurecom.fr
|
||||
OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr
|
||||
|
||||
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
|
||||
|
||||
*******************************************************************************/
|
||||
#ifndef __PHY_SPEC_DEFS_TOP_H__
|
||||
#define __PHY_SPEC_DEFS_TOP_H__
|
||||
|
||||
#include "types.h"
|
||||
|
||||
|
||||
|
||||
/*! \brief Extension Type */
|
||||
typedef enum {
|
||||
CYCLIC_PREFIX,
|
||||
CYCLIC_SUFFIX,
|
||||
ZEROS,
|
||||
NONE
|
||||
} Extension_t;
|
||||
|
||||
|
||||
/// mod_sym_t is the type of txdataF
|
||||
#ifdef IFFT_FPGA
|
||||
typedef unsigned char mod_sym_t;
|
||||
#else
|
||||
typedef int mod_sym_t;
|
||||
#endif //IFFT_FPGA
|
||||
|
||||
|
||||
#endif /*__PHY_SPEC_DEFS_TOP_H__ */
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -77,7 +77,7 @@ unsigned char NB_RN_INST=0;
|
||||
unsigned char NB_INST=0;
|
||||
#endif
|
||||
|
||||
unsigned int ULSCH_max_consecutive_errors = 10;
|
||||
unsigned int ULSCH_max_consecutive_errors = 20;
|
||||
|
||||
int number_of_cards;
|
||||
|
||||
|
||||
@@ -410,7 +410,7 @@ void remove_harq_pid_from_freelist(LTE_eNB_DLSCH_t *DLSCH_ptr, int harq_pid);
|
||||
|
||||
int8_t find_ue(uint16_t rnti, PHY_VARS_eNB *phy_vars_eNB);
|
||||
int32_t add_ue(int16_t rnti, PHY_VARS_eNB *phy_vars_eNB);
|
||||
int32_t remove_ue(uint16_t rnti, PHY_VARS_eNB *phy_vars_eNB,uint8_t abstraction_flag);
|
||||
int mac_phy_remove_ue(module_id_t Mod_idP,rnti_t rnti);
|
||||
|
||||
void process_timing_advance(module_id_t Mod_id,uint8_t CC_id,int16_t timing_advance);
|
||||
void process_timing_advance_rar(PHY_VARS_UE *phy_vars_ue,uint16_t timing_advance);
|
||||
|
||||
@@ -40,8 +40,6 @@
|
||||
|
||||
#include "PHY/defs.h"
|
||||
#include "PHY/extern.h"
|
||||
#include "MAC_INTERFACE/defs.h"
|
||||
#include "MAC_INTERFACE/extern.h"
|
||||
#include "SCHED/defs.h"
|
||||
#include "SCHED/extern.h"
|
||||
#include "LAYER2/MAC/extern.h"
|
||||
@@ -573,12 +571,13 @@ void fill_dci(DCI_PDU *DCI_pdu, uint8_t sched_subframe, PHY_VARS_eNB *phy_vars_e
|
||||
break;*/
|
||||
}
|
||||
|
||||
/*
|
||||
DCI_pdu->nCCE = 0;
|
||||
|
||||
for (i=0; i<DCI_pdu->Num_common_dci+DCI_pdu->Num_ue_spec_dci; i++) {
|
||||
DCI_pdu->nCCE += (1<<(DCI_pdu->dci_alloc[i].L));
|
||||
}
|
||||
|
||||
*/
|
||||
}
|
||||
|
||||
void fill_dci_emos(DCI_PDU *DCI_pdu, uint8_t subframe, PHY_VARS_eNB *phy_vars_eNB)
|
||||
@@ -746,11 +745,11 @@ void fill_dci_emos(DCI_PDU *DCI_pdu, uint8_t subframe, PHY_VARS_eNB *phy_vars_eN
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
DCI_pdu->nCCE = 0;
|
||||
|
||||
for (i=0; i<DCI_pdu->Num_common_dci+DCI_pdu->Num_ue_spec_dci; i++) {
|
||||
DCI_pdu->nCCE += (1<<(DCI_pdu->dci_alloc[i].L));
|
||||
}
|
||||
|
||||
*/
|
||||
}
|
||||
|
||||
@@ -39,8 +39,6 @@
|
||||
*/
|
||||
#include "PHY/defs.h"
|
||||
#include "PHY/extern.h"
|
||||
#include "MAC_INTERFACE/defs.h"
|
||||
#include "MAC_INTERFACE/extern.h"
|
||||
#include "SCHED/defs.h"
|
||||
#include "SCHED/extern.h"
|
||||
|
||||
|
||||
+851
-1176
File diff suppressed because it is too large
Load Diff
@@ -42,8 +42,6 @@
|
||||
#include "defs.h"
|
||||
#include "PHY/defs.h"
|
||||
#include "PHY/extern.h"
|
||||
#include "MAC_INTERFACE/defs.h"
|
||||
#include "MAC_INTERFACE/extern.h"
|
||||
#include "SCHED/defs.h"
|
||||
#include "SCHED/extern.h"
|
||||
|
||||
@@ -1368,7 +1366,7 @@ void phy_procedures_UE_TX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstra
|
||||
#endif
|
||||
|
||||
if (abstraction_flag == 0) {
|
||||
LOG_D(PHY,"[UE %d][RAPROC] Frame %d, Subframe %d : Generating PRACH, preamble %d, TARGET_RECEIVED_POWER %d dBm, PRACH TDD Resource index %d, RA-RNTI %d\n",
|
||||
LOG_I(PHY,"[UE %d][RAPROC] Frame %d, Subframe %d : Generating PRACH, preamble %d, TARGET_RECEIVED_POWER %d dBm, PRACH TDD Resource index %d, RA-RNTI %d\n",
|
||||
Mod_id,
|
||||
frame_tx,
|
||||
subframe_tx,
|
||||
@@ -2639,7 +2637,7 @@ int phy_procedures_UE_RX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstrac
|
||||
phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid],
|
||||
subframe_prev,
|
||||
harq_pid,
|
||||
1,0);
|
||||
1,phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->nb_rb>10 ? 1 : 0);
|
||||
stop_meas(&phy_vars_ue->dlsch_decoding_stats);
|
||||
}
|
||||
|
||||
@@ -2656,12 +2654,19 @@ int phy_procedures_UE_RX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstrac
|
||||
if (ret == (1+phy_vars_ue->dlsch_ue[eNB_id][0]->max_turbo_iterations)) {
|
||||
phy_vars_ue->dlsch_errors[eNB_id]++;
|
||||
|
||||
#ifdef DEBUG_PHY_PROC
|
||||
LOG_D(PHY,"[UE %d][PDSCH %x/%d] Frame %d subframe %d DLSCH in error (rv %d,mcs %d,TBS %d)\n",
|
||||
phy_vars_ue->Mod_id,phy_vars_ue->dlsch_ue[eNB_id][0]->rnti,
|
||||
harq_pid,frame_rx,subframe_prev,
|
||||
phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->rvidx,
|
||||
phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->mcs,
|
||||
phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->TBS);
|
||||
/*
|
||||
if (abstraction_flag ==0 )
|
||||
dump_dlsch(phy_vars_ue,eNB_id,subframe_prev,harq_pid);
|
||||
mac_xface->macphy_exit("");
|
||||
*/
|
||||
#endif
|
||||
} else {
|
||||
LOG_D(PHY,"[UE %d][PDSCH %x/%d] Frame %d subframe %d (slot_rx %d): Received DLSCH (rv %d,mcs %d,TBS %d)\n",
|
||||
phy_vars_ue->Mod_id,phy_vars_ue->dlsch_ue[eNB_id][0]->rnti,
|
||||
@@ -3318,7 +3323,7 @@ int phy_procedures_UE_RX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstrac
|
||||
phy_vars_ue->dlsch_ue_MCH[0]->harq_processes[0],
|
||||
subframe_prev,
|
||||
0,
|
||||
0,0);
|
||||
0,1);
|
||||
} else { // abstraction
|
||||
#ifdef PHY_ABSTRACTION
|
||||
ret = dlsch_decoding_emul(phy_vars_ue,
|
||||
|
||||
@@ -48,7 +48,6 @@
|
||||
#include "PHY/types.h"
|
||||
#include "PHY/defs.h"
|
||||
#include "PHY/vars.h"
|
||||
#include "MAC_INTERFACE/vars.h"
|
||||
|
||||
#include "SCHED/defs.h"
|
||||
#include "SCHED/vars.h"
|
||||
@@ -100,7 +99,7 @@ uint64_t DLSCH_alloc_pdu_1[2];
|
||||
#define CCCH_RB_ALLOC computeRIV(PHY_vars_eNB->lte_frame_parms.N_RB_UL,0,2)
|
||||
//#define DLSCH_RB_ALLOC 0x1fbf // igore DC component,RB13
|
||||
//#define DLSCH_RB_ALLOC 0x0001
|
||||
void do_OFDM_mod_l(mod_sym_t **txdataF, int32_t **txdata, uint16_t next_slot, LTE_DL_FRAME_PARMS *frame_parms)
|
||||
void do_OFDM_mod_l(int32_t **txdataF, int32_t **txdata, uint16_t next_slot, LTE_DL_FRAME_PARMS *frame_parms)
|
||||
{
|
||||
|
||||
int aa, slot_offset, slot_offset_F;
|
||||
@@ -215,7 +214,7 @@ int main(int argc, char **argv)
|
||||
// void *data;
|
||||
// int ii;
|
||||
// int bler;
|
||||
double blerr[4],uncoded_ber;//,avg_ber;
|
||||
double blerr[4],uncoded_ber,avg_ber;
|
||||
short *uncoded_ber_bit=NULL;
|
||||
uint8_t N_RB_DL=25,osf=1;
|
||||
frame_t frame_type = FDD;
|
||||
@@ -2112,7 +2111,7 @@ PMI_FEEDBACK:
|
||||
|
||||
// printf("Trial %d : Round %d, pmi_feedback %d \n",trials,round,pmi_feedback);
|
||||
for (aa=0; aa<PHY_vars_eNB->lte_frame_parms.nb_antennas_tx; aa++) {
|
||||
memset(&PHY_vars_eNB->lte_eNB_common_vars.txdataF[eNB_id][aa][0],0,FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX*sizeof(mod_sym_t));
|
||||
memset(&PHY_vars_eNB->lte_eNB_common_vars.txdataF[eNB_id][aa][0],0,FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX*sizeof(int32_t));
|
||||
}
|
||||
|
||||
if (input_fd==NULL) {
|
||||
@@ -3292,7 +3291,7 @@ PMI_FEEDBACK:
|
||||
PHY_vars_UE->dlsch_ue[0][cw]->harq_processes[PHY_vars_UE->dlsch_ue[0][cw]->current_harq_pid]->G = coded_bits_per_codeword;
|
||||
|
||||
|
||||
/*
|
||||
|
||||
// calculate uncoded BLER
|
||||
uncoded_ber=0;
|
||||
for (i=0;i<coded_bits_per_codeword;i++)
|
||||
@@ -3308,7 +3307,7 @@ PMI_FEEDBACK:
|
||||
|
||||
if (n_frames==1)
|
||||
write_output("uncoded_ber_bit.m","uncoded_ber_bit",uncoded_ber_bit,coded_bits_per_codeword,1,0);
|
||||
*/
|
||||
|
||||
|
||||
start_meas(&PHY_vars_UE->dlsch_unscrambling_stats);
|
||||
dlsch_unscrambling(&PHY_vars_UE->lte_frame_parms,
|
||||
@@ -3419,12 +3418,12 @@ PMI_FEEDBACK:
|
||||
}
|
||||
|
||||
sprintf(fname,"rxsig0_r%d.m",round);
|
||||
sprintf(vname,"rxs0_r%d.m",round);
|
||||
sprintf(vname,"rxs0_r%d",round);
|
||||
write_output(fname,vname, &PHY_vars_UE->lte_ue_common_vars.rxdata[0][0],10*PHY_vars_UE->lte_frame_parms.samples_per_tti,1,1);
|
||||
sprintf(fname,"rxsigF0_r%d.m",round);
|
||||
sprintf(vname,"rxs0F_r%d.m",round);
|
||||
sprintf(vname,"rxs0F_r%d",round);
|
||||
write_output(fname,vname, &PHY_vars_UE->lte_ue_common_vars.rxdataF[0][0],2*PHY_vars_UE->lte_frame_parms.ofdm_symbol_size*nsymb,2,1);
|
||||
|
||||
|
||||
if (PHY_vars_UE->lte_frame_parms.nb_antennas_rx>1) {
|
||||
sprintf(fname,"rxsig1_r%d.m",round);
|
||||
sprintf(vname,"rxs1_r%d.m",round);
|
||||
@@ -3435,14 +3434,14 @@ PMI_FEEDBACK:
|
||||
}
|
||||
|
||||
sprintf(fname,"dlsch00_r%d.m",round);
|
||||
sprintf(vname,"dl00_r%d.m",round);
|
||||
sprintf(vname,"dl00_r%d",round);
|
||||
write_output(fname,vname,
|
||||
&(PHY_vars_UE->lte_ue_common_vars.dl_ch_estimates[eNB_id][0][0]),
|
||||
PHY_vars_UE->lte_frame_parms.ofdm_symbol_size*nsymb,1,1);
|
||||
|
||||
if (PHY_vars_UE->lte_frame_parms.nb_antennas_rx>1) {
|
||||
sprintf(fname,"dlsch01_r%d.m",round);
|
||||
sprintf(vname,"dl01_r%d.m",round);
|
||||
sprintf(vname,"dl01_r%d",round);
|
||||
write_output(fname,vname,
|
||||
&(PHY_vars_UE->lte_ue_common_vars.dl_ch_estimates[eNB_id][1][0]),
|
||||
PHY_vars_UE->lte_frame_parms.ofdm_symbol_size*nsymb/2,1,1);
|
||||
@@ -3450,7 +3449,7 @@ PMI_FEEDBACK:
|
||||
|
||||
if (PHY_vars_eNB->lte_frame_parms.nb_antennas_tx>1) {
|
||||
sprintf(fname,"dlsch10_r%d.m",round);
|
||||
sprintf(vname,"dl10_r%d.m",round);
|
||||
sprintf(vname,"dl10_r%d",round);
|
||||
write_output(fname,vname,
|
||||
&(PHY_vars_UE->lte_ue_common_vars.dl_ch_estimates[eNB_id][2][0]),
|
||||
PHY_vars_UE->lte_frame_parms.ofdm_symbol_size*nsymb/2,1,1);
|
||||
@@ -3458,7 +3457,7 @@ PMI_FEEDBACK:
|
||||
|
||||
if ((PHY_vars_UE->lte_frame_parms.nb_antennas_rx>1) && (PHY_vars_eNB->lte_frame_parms.nb_antennas_tx>1)) {
|
||||
sprintf(fname,"dlsch11_r%d.m",round);
|
||||
sprintf(vname,"dl11_r%d.m",round);
|
||||
sprintf(vname,"dl11_r%d",round);
|
||||
write_output(fname,vname,
|
||||
&(PHY_vars_UE->lte_ue_common_vars.dl_ch_estimates[eNB_id][3][0]),
|
||||
PHY_vars_UE->lte_frame_parms.ofdm_symbol_size*nsymb/2,1,1);
|
||||
@@ -3989,7 +3988,7 @@ PMI_FEEDBACK:
|
||||
printf("[continue] effective rate : %f (%2.1f%%,%f)): increase snr \n",rate*effective_rate, 100*effective_rate, rate);
|
||||
}
|
||||
|
||||
if (((double)errs[0]/(round_trials[0]))<1e-2)
|
||||
if (((double)errs[0]/(round_trials[0]))<(10.0/n_frames))
|
||||
break;
|
||||
}// SNR
|
||||
|
||||
|
||||
@@ -38,7 +38,6 @@
|
||||
#include "PHY/types.h"
|
||||
#include "PHY/defs.h"
|
||||
#include "PHY/vars.h"
|
||||
#include "MAC_INTERFACE/vars.h"
|
||||
#ifdef EMOS
|
||||
#include "SCHED/phy_procedures_emos.h"
|
||||
#endif
|
||||
@@ -132,7 +131,6 @@ int main(int argc, char **argv)
|
||||
double sigma2, sigma2_dB=0,SNR,snr0=-2.0,snr1=0.0;
|
||||
uint8_t snr1set=0;
|
||||
double snr_step=1,input_snr_step=1;
|
||||
//mod_sym_t **txdataF;
|
||||
int **txdata;
|
||||
double **s_re,**s_im,**r_re,**r_im;
|
||||
double iqim = 0.0;
|
||||
@@ -456,7 +454,7 @@ int main(int argc, char **argv)
|
||||
//if (trials%100==0)
|
||||
//eNB2UE[0]->first_run = 1;
|
||||
eNB2UE->first_run = 1;
|
||||
memset(&PHY_vars_eNB->lte_eNB_common_vars.txdataF[0][0][0],0,FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX*sizeof(mod_sym_t));
|
||||
memset(&PHY_vars_eNB->lte_eNB_common_vars.txdataF[0][0][0],0,FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX*sizeof(int32_t));
|
||||
|
||||
generate_mch(PHY_vars_eNB,sched_subframe,input_buffer,0);
|
||||
|
||||
|
||||
@@ -38,7 +38,6 @@
|
||||
#include "PHY/types.h"
|
||||
#include "PHY/defs.h"
|
||||
#include "PHY/vars.h"
|
||||
#include "MAC_INTERFACE/vars.h"
|
||||
|
||||
#ifdef EMOS
|
||||
#include "SCHED/phy_procedures_emos.h"
|
||||
@@ -58,11 +57,11 @@ PHY_VARS_UE *PHY_vars_UE;
|
||||
|
||||
#define DLSCH_RB_ALLOC 0x1fbf // igore DC component,RB13
|
||||
|
||||
mod_sym_t *dummybuf[4];
|
||||
mod_sym_t dummy0[2048*14];
|
||||
mod_sym_t dummy1[2048*14];
|
||||
mod_sym_t dummy2[2048*14];
|
||||
mod_sym_t dummy3[2048*14];
|
||||
int32_t *dummybuf[4];
|
||||
int32_t dummy0[2048*14];
|
||||
int32_t dummy1[2048*14];
|
||||
int32_t dummy2[2048*14];
|
||||
int32_t dummy3[2048*14];
|
||||
|
||||
|
||||
int main(int argc, char **argv)
|
||||
@@ -73,7 +72,6 @@ int main(int argc, char **argv)
|
||||
int i,l,aa;
|
||||
double sigma2, sigma2_dB=0,SNR,snr0=-2.0,snr1;
|
||||
uint8_t snr1set=0;
|
||||
//mod_sym_t **txdataF;
|
||||
int **txdata,**txdata1,**txdata2;
|
||||
double **s_re,**s_im,**s_re1,**s_im1,**s_re2,**s_im2,**r_re,**r_im,**r_re1,**r_im1,**r_re2,**r_im2;
|
||||
double iqim = 0.0;
|
||||
@@ -604,7 +602,7 @@ int main(int argc, char **argv)
|
||||
dummybuf[2] = dummy2;
|
||||
dummybuf[3] = dummy3;
|
||||
generate_pbch(&PHY_vars_eNB->lte_eNB_pbch,
|
||||
(mod_sym_t**)dummybuf,
|
||||
(int32_t**)dummybuf,
|
||||
AMP,
|
||||
&PHY_vars_eNB->lte_frame_parms,
|
||||
pbch_pdu,
|
||||
|
||||
@@ -34,7 +34,6 @@
|
||||
#include "PHY/types.h"
|
||||
#include "PHY/defs.h"
|
||||
#include "PHY/vars.h"
|
||||
#include "MAC_INTERFACE/vars.h"
|
||||
|
||||
#ifdef EMOS
|
||||
#include "SCHED/phy_procedures_emos.h"
|
||||
@@ -393,11 +392,7 @@ DCI_PDU *get_dci(LTE_DL_FRAME_PARMS *lte_frame_parms,uint8_t log2L, uint8_t log2
|
||||
|
||||
|
||||
|
||||
DCI_pdu.nCCE = 0;
|
||||
|
||||
for (i=0; i<DCI_pdu.Num_common_dci+DCI_pdu.Num_ue_spec_dci; i++) {
|
||||
DCI_pdu.nCCE += (1<<(DCI_pdu.dci_alloc[i].L));
|
||||
}
|
||||
|
||||
return(&DCI_pdu);
|
||||
}
|
||||
@@ -411,7 +406,6 @@ int main(int argc, char **argv)
|
||||
|
||||
int i,l,aa;
|
||||
double sigma2, sigma2_dB=0,SNR,snr0=-2.0,snr1;
|
||||
//mod_sym_t **txdataF;
|
||||
|
||||
int **txdata;
|
||||
double **s_re,**s_im,**r_re,**r_im;
|
||||
@@ -712,6 +706,7 @@ int main(int argc, char **argv)
|
||||
Nid_cell,
|
||||
tdd_config,
|
||||
N_RB_DL,
|
||||
0,
|
||||
osf,
|
||||
perfect_ce);
|
||||
|
||||
@@ -774,8 +769,8 @@ int main(int argc, char **argv)
|
||||
|
||||
|
||||
|
||||
PHY_vars_eNB->ulsch_eNB[0] = new_eNB_ulsch(8,MAX_TURBO_ITERATIONS,N_RB_DL,0);
|
||||
PHY_vars_UE->ulsch_ue[0] = new_ue_ulsch(8,N_RB_DL,0);
|
||||
PHY_vars_eNB->ulsch_eNB[0] = new_eNB_ulsch(MAX_TURBO_ITERATIONS,N_RB_DL,0);
|
||||
PHY_vars_UE->ulsch_ue[0] = new_ue_ulsch(N_RB_DL,0);
|
||||
|
||||
|
||||
PHY_vars_eNB->proc[subframe].frame_tx = 0;
|
||||
@@ -839,7 +834,7 @@ int main(int argc, char **argv)
|
||||
|
||||
// printf("DCI (SF %d): txdataF %p (0 %p)\n",subframe,&PHY_vars_eNB->lte_eNB_common_vars.txdataF[eNb_id][aa][512*14*subframe],&PHY_vars_eNB->lte_eNB_common_vars.txdataF[eNb_id][aa][0]);
|
||||
for (aa=0; aa<PHY_vars_eNB->lte_frame_parms.nb_antennas_tx_eNB; aa++) {
|
||||
memset(&PHY_vars_eNB->lte_eNB_common_vars.txdataF[eNb_id][aa][0],0,FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX*sizeof(mod_sym_t));
|
||||
memset(&PHY_vars_eNB->lte_eNB_common_vars.txdataF[eNb_id][aa][0],0,FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX*sizeof(int32_t));
|
||||
|
||||
/*
|
||||
re_offset = PHY_vars_eNB->lte_frame_parms.first_carrier_offset;
|
||||
|
||||
@@ -34,10 +34,6 @@
|
||||
#include "PHY/types.h"
|
||||
#include "PHY/defs.h"
|
||||
#include "PHY/vars.h"
|
||||
#include "MAC_INTERFACE/vars.h"
|
||||
#ifdef IFFT_FPGA
|
||||
#include "PHY/LTE_REFSIG/mod_table.h"
|
||||
#endif
|
||||
#ifdef EMOS
|
||||
#include "SCHED/phy_procedures_emos.h"
|
||||
#endif
|
||||
@@ -70,9 +66,6 @@ int main(int argc, char **argv)
|
||||
uint8_t snr1set=0;
|
||||
uint8_t ue_speed1set=0;
|
||||
//mod_sym_t **txdataF;
|
||||
#ifdef IFFT_FPGA
|
||||
int **txdataF2;
|
||||
#endif
|
||||
int **txdata;
|
||||
double **s_re,**s_im,**r_re,**r_im;
|
||||
double iqim=0.0;
|
||||
@@ -329,6 +322,7 @@ int main(int argc, char **argv)
|
||||
Nid_cell,
|
||||
3,
|
||||
N_RB_DL,
|
||||
0,
|
||||
osf,
|
||||
0);
|
||||
|
||||
@@ -553,14 +547,6 @@ int main(int argc, char **argv)
|
||||
// printf("(%f,%f)\n",SNR,(double)prach_errors/(double)n_frames);
|
||||
} //SNR loop
|
||||
|
||||
#ifdef IFFT_FPGA
|
||||
free(txdataF2[0]);
|
||||
free(txdataF2[1]);
|
||||
free(txdataF2);
|
||||
free(txdata[0]);
|
||||
free(txdata[1]);
|
||||
free(txdata);
|
||||
#endif
|
||||
|
||||
for (i=0; i<2; i++) {
|
||||
free(s_re[i]);
|
||||
|
||||
@@ -34,10 +34,6 @@
|
||||
#include "PHY/types.h"
|
||||
#include "PHY/defs.h"
|
||||
#include "PHY/vars.h"
|
||||
#include "MAC_INTERFACE/vars.h"
|
||||
#ifdef IFFT_FPGA
|
||||
#include "PHY/LTE_REFSIG/mod_table.h"
|
||||
#endif
|
||||
#ifdef EMOS
|
||||
#include "SCHED/phy_procedures_emos.h"
|
||||
#endif
|
||||
@@ -67,9 +63,6 @@ int main(int argc, char **argv)
|
||||
double sigma2, sigma2_dB=0,SNR,snr0=-2.0,snr1=0.0;
|
||||
uint8_t snr1set=0;
|
||||
//mod_sym_t **txdataF;
|
||||
#ifdef IFFT_FPGA
|
||||
int **txdataF2;
|
||||
#endif
|
||||
int **txdata;
|
||||
double **s_re,**s_im,**r_re,**r_im;
|
||||
double ricean_factor=0.0000005,iqim=0.0;
|
||||
@@ -338,23 +331,7 @@ int main(int argc, char **argv)
|
||||
frame_parms = &PHY_vars_eNB->lte_frame_parms;
|
||||
|
||||
|
||||
#ifdef IFFT_FPGA
|
||||
txdata = (int **)malloc16(2*sizeof(int*));
|
||||
txdata[0] = (int *)malloc16(FRAME_LENGTH_BYTES);
|
||||
txdata[1] = (int *)malloc16(FRAME_LENGTH_BYTES);
|
||||
|
||||
bzero(txdata[0],FRAME_LENGTH_BYTES);
|
||||
bzero(txdata[1],FRAME_LENGTH_BYTES);
|
||||
|
||||
txdataF2 = (int **)malloc16(2*sizeof(int*));
|
||||
txdataF2[0] = (int *)malloc16(FRAME_LENGTH_BYTES_NO_PREFIX);
|
||||
txdataF2[1] = (int *)malloc16(FRAME_LENGTH_BYTES_NO_PREFIX);
|
||||
|
||||
bzero(txdataF2[0],FRAME_LENGTH_BYTES_NO_PREFIX);
|
||||
bzero(txdataF2[1],FRAME_LENGTH_BYTES_NO_PREFIX);
|
||||
#else
|
||||
txdata = PHY_vars_eNB->lte_eNB_common_vars.txdata[eNB_id];
|
||||
#endif
|
||||
|
||||
s_re = malloc(2*sizeof(double*));
|
||||
s_im = malloc(2*sizeof(double*));
|
||||
@@ -420,27 +397,6 @@ int main(int argc, char **argv)
|
||||
&pucch_payload,
|
||||
AMP, //amp,
|
||||
subframe); //subframe
|
||||
#ifdef IFFT_FPGA_UE
|
||||
tx_lev=0;
|
||||
|
||||
for (aa=0; aa<frame_parms->nb_antennas_tx; aa++) {
|
||||
|
||||
if (frame_parms->Ncp == 1)
|
||||
PHY_ofdm_mod(txdataF2[aa], // input
|
||||
txdata[aa], // output
|
||||
frame_parms->ofdm_symbol_size,
|
||||
2*nsymb, // number of symbols
|
||||
frame_parms->nb_prefix_samples, // number of prefix samples
|
||||
CYCLIC_PREFIX);
|
||||
else
|
||||
normal_prefix_mod(txdataF2[aa],txdata[aa],2*nsymb,frame_parms);
|
||||
}
|
||||
|
||||
tx_lev += signal_energy(&txdata[aa][OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES],
|
||||
OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES);
|
||||
|
||||
#else
|
||||
|
||||
write_output("txsigF0.m","txsF0", &PHY_vars_UE->lte_ue_common_vars.txdataF[0][2*subframe*nsymb*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES_NO_PREFIX],OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES_NO_PREFIX*nsymb,1,1);
|
||||
|
||||
tx_lev = 0;
|
||||
@@ -472,7 +428,6 @@ int main(int argc, char **argv)
|
||||
OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
write_output("txsig0.m","txs0", txdata[0], FRAME_LENGTH_COMPLEX_SAMPLES,1,1);
|
||||
@@ -655,15 +610,6 @@ int main(int argc, char **argv)
|
||||
}
|
||||
|
||||
|
||||
#ifdef IFFT_FPGA
|
||||
free(txdataF2[0]);
|
||||
free(txdataF2[1]);
|
||||
free(txdataF2);
|
||||
free(txdata[0]);
|
||||
free(txdata[1]);
|
||||
free(txdata);
|
||||
#endif
|
||||
|
||||
for (i=0; i<2; i++) {
|
||||
free(s_re[i]);
|
||||
free(s_im[i]);
|
||||
|
||||
@@ -45,7 +45,6 @@
|
||||
#include "PHY/types.h"
|
||||
#include "PHY/defs.h"
|
||||
#include "PHY/vars.h"
|
||||
#include "MAC_INTERFACE/vars.h"
|
||||
|
||||
#include "SCHED/defs.h"
|
||||
#include "SCHED/vars.h"
|
||||
@@ -309,7 +308,7 @@ int main(int argc, char **argv)
|
||||
break;
|
||||
|
||||
default:
|
||||
msg("Unsupported channel model!\n");
|
||||
printf("Unsupported channel model!\n");
|
||||
exit(-1);
|
||||
break;
|
||||
}
|
||||
@@ -333,7 +332,7 @@ int main(int argc, char **argv)
|
||||
|
||||
if ((transmission_mode!=1) &&
|
||||
(transmission_mode!=2)) {
|
||||
msg("Unsupported transmission mode %d\n",transmission_mode);
|
||||
printf("Unsupported transmission mode %d\n",transmission_mode);
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
@@ -383,10 +382,10 @@ int main(int argc, char **argv)
|
||||
|
||||
case 'i':
|
||||
input_fdUL = fopen(optarg,"r");
|
||||
msg("Reading in %s (%p)\n",optarg,input_fdUL);
|
||||
printf("Reading in %s (%p)\n",optarg,input_fdUL);
|
||||
|
||||
if (input_fdUL == (FILE*)NULL) {
|
||||
msg("Unknown file %s\n",optarg);
|
||||
printf("Unknown file %s\n",optarg);
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
@@ -510,13 +509,8 @@ int main(int argc, char **argv)
|
||||
// r_re0 = malloc(2*sizeof(double*));
|
||||
// r_im0 = malloc(2*sizeof(double*));
|
||||
|
||||
nsymb = (PHY_vars_eNB->lte_frame_parms.Ncp == 0) ? 14 : 12;
|
||||
nsymb = (PHY_vars_eNB->lte_frame_parms.Ncp == NORMAL) ? 14 : 12;
|
||||
|
||||
coded_bits_per_codeword = nb_rb * (12 * get_Qm(mcs)) * nsymb;
|
||||
|
||||
rate = (double)dlsch_tbs25[get_I_TBS(mcs)][nb_rb-1]/(coded_bits_per_codeword);
|
||||
|
||||
printf("Rate = %f (mod %d), coded bits %d\n",rate,get_Qm(mcs),coded_bits_per_codeword);
|
||||
|
||||
sprintf(bler_fname,"ULbler_mcs%d_nrb%d_ChannelModel%d_nsim%d.csv",mcs,nb_rb,chMod,n_frames);
|
||||
bler_fd = fopen(bler_fname,"w");
|
||||
@@ -641,8 +635,8 @@ int main(int argc, char **argv)
|
||||
UE2eNB->max_Doppler = maxDoppler;
|
||||
|
||||
// NN: N_RB_UL has to be defined in ulsim
|
||||
PHY_vars_eNB->ulsch_eNB[0] = new_eNB_ulsch(8,max_turbo_iterations,N_RB_DL,0);
|
||||
PHY_vars_UE->ulsch_ue[0] = new_ue_ulsch(8,N_RB_DL,0);
|
||||
PHY_vars_eNB->ulsch_eNB[0] = new_eNB_ulsch(max_turbo_iterations,N_RB_DL,0);
|
||||
PHY_vars_UE->ulsch_ue[0] = new_ue_ulsch(N_RB_DL,0);
|
||||
|
||||
// Create transport channel structures for 2 transport blocks (MIMO)
|
||||
for (i=0; i<2; i++) {
|
||||
@@ -766,9 +760,9 @@ int main(int argc, char **argv)
|
||||
PHY_vars_eNB->proc[sf].subframe_rx=sf;
|
||||
}
|
||||
|
||||
msg("Init UL hopping UE\n");
|
||||
printf("Init UL hopping UE\n");
|
||||
init_ul_hopping(&PHY_vars_UE->lte_frame_parms);
|
||||
msg("Init UL hopping eNB\n");
|
||||
printf("Init UL hopping eNB\n");
|
||||
init_ul_hopping(&PHY_vars_eNB->lte_frame_parms);
|
||||
|
||||
PHY_vars_eNB->proc[subframe].frame_rx = PHY_vars_UE->frame_tx;
|
||||
@@ -808,6 +802,13 @@ int main(int argc, char **argv)
|
||||
CBA_RNTI,
|
||||
srs_flag);
|
||||
|
||||
coded_bits_per_codeword = nb_rb * (12 * get_Qm_ul(mcs)) * nsymb;
|
||||
|
||||
if (cqi_flag == 1) coded_bits_per_codeword-=PHY_vars_UE->ulsch_ue[0]->O;
|
||||
|
||||
rate = (double)dlsch_tbs25[get_I_TBS(mcs)][nb_rb-1]/(coded_bits_per_codeword);
|
||||
|
||||
printf("Rate = %f (mod %d), coded bits %d\n",rate,get_Qm_ul(mcs),coded_bits_per_codeword);
|
||||
|
||||
|
||||
PHY_vars_UE->frame_tx = (PHY_vars_UE->frame_tx+1)&1023;
|
||||
@@ -1062,7 +1063,7 @@ int main(int argc, char **argv)
|
||||
start_meas(&PHY_vars_UE->ofdm_mod_stats);
|
||||
|
||||
for (aa=0; aa<1; aa++) {
|
||||
if (frame_parms->Ncp == 1)
|
||||
if (frame_parms->Ncp == EXTENDED)
|
||||
PHY_ofdm_mod(&PHY_vars_UE->lte_ue_common_vars.txdataF[aa][subframe*nsymb*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES_NO_PREFIX], // input
|
||||
&txdata[aa][PHY_vars_eNB->lte_frame_parms.samples_per_tti*subframe], // output
|
||||
PHY_vars_UE->lte_frame_parms.ofdm_symbol_size,
|
||||
@@ -1256,6 +1257,7 @@ int main(int argc, char **argv)
|
||||
*/
|
||||
|
||||
start_meas(&PHY_vars_eNB->ulsch_decoding_stats);
|
||||
|
||||
ret= ulsch_decoding(PHY_vars_eNB,
|
||||
0, // UE_id
|
||||
subframe,
|
||||
@@ -1292,7 +1294,7 @@ int main(int argc, char **argv)
|
||||
if (PHY_vars_eNB->ulsch_eNB[0]->harq_processes[harq_pid]->o_ACK[0] != PHY_vars_UE->ulsch_ue[0]->o_ACK[0])
|
||||
ack_errors++;
|
||||
|
||||
// msg("ulsch_coding: O[%d] %d\n",i,o_flip[i]);
|
||||
// printf("ulsch_coding: O[%d] %d\n",i,o_flip[i]);
|
||||
|
||||
|
||||
if (ret <= PHY_vars_eNB->ulsch_eNB[0]->max_turbo_iterations) {
|
||||
@@ -1515,7 +1517,7 @@ int main(int argc, char **argv)
|
||||
rate*effective_rate,
|
||||
100*effective_rate,
|
||||
rate,
|
||||
rate*get_Qm(mcs),
|
||||
rate*get_Qm_ul(mcs),
|
||||
(1.0*(round_trials[0]-errs[0])+2.0*(round_trials[1]-errs[1])+3.0*(round_trials[2]-errs[2])+4.0*(round_trials[3]-errs[3]))/((double)round_trials[0])/
|
||||
(double)PHY_vars_eNB->ulsch_eNB[0]->harq_processes[harq_pid]->TBS,
|
||||
(1.0*(round_trials[0]-errs[0])+2.0*(round_trials[1]-errs[1])+3.0*(round_trials[2]-errs[2])+4.0*(round_trials[3]-errs[3]))/((double)round_trials[0]));
|
||||
|
||||
+140
-130
@@ -90,8 +90,8 @@ void ue_mac_reset(module_id_t module_idP,uint8_t eNB_index)
|
||||
|
||||
int
|
||||
rrc_mac_config_req(
|
||||
module_id_t Mod_id,
|
||||
int CC_id,
|
||||
module_id_t Mod_idP,
|
||||
int CC_idP,
|
||||
eNB_flag_t eNB_flagP,
|
||||
rnti_t rntiP,
|
||||
uint8_t eNB_index,
|
||||
@@ -129,28 +129,31 @@ rrc_mac_config_req(
|
||||
int i;
|
||||
|
||||
int UE_id = -1;
|
||||
eNB_MAC_INST *eNB = &eNB_mac_inst[Mod_idP];
|
||||
UE_list_t *UE_list= &eNB->UE_list;
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RRC_MAC_CONFIG, VCD_FUNCTION_IN);
|
||||
|
||||
if (eNB_flagP==0) {
|
||||
LOG_I(MAC,"[CONFIG][UE %d] Configuring MAC/PHY from eNB %d\n",Mod_id,eNB_index);
|
||||
LOG_I(MAC,"[CONFIG][UE %d] Configuring MAC/PHY from eNB %d\n",Mod_idP,eNB_index);
|
||||
|
||||
if (tdd_Config != NULL) {
|
||||
UE_mac_inst[Mod_id].tdd_Config = tdd_Config;
|
||||
UE_mac_inst[Mod_idP].tdd_Config = tdd_Config;
|
||||
}
|
||||
} else {
|
||||
UE_id = find_UE_id(Mod_id, rntiP);
|
||||
UE_id = find_UE_id(Mod_idP, rntiP);
|
||||
if (physicalConfigDedicated == NULL) {
|
||||
LOG_I(MAC,"[CONFIG][eNB %d/%d] Configuring MAC/PHY\n", Mod_id, CC_id);
|
||||
LOG_I(MAC,"[CONFIG][eNB %d/%d] Configuring MAC/PHY\n", Mod_idP, CC_idP);
|
||||
} else {
|
||||
LOG_I(MAC,"[CONFIG][eNB %d/%d] Configuring MAC/PHY for UE %d (%x)\n", Mod_id, CC_id, UE_id, UE_RNTI(Mod_id, UE_id));
|
||||
LOG_I(MAC,"[CONFIG][eNB %d/%d] Configuring MAC/PHY for UE %d (%x)\n", Mod_idP, CC_idP, UE_id, UE_RNTI(Mod_idP, UE_id));
|
||||
}
|
||||
}
|
||||
|
||||
if (tdd_Config && SIwindowsize && SIperiod) {
|
||||
if (eNB_flagP == ENB_FLAG_YES) {
|
||||
mac_xface->phy_config_sib1_eNB(Mod_id, CC_id, tdd_Config, *SIwindowsize, *SIperiod);
|
||||
mac_xface->phy_config_sib1_eNB(Mod_idP, CC_idP, tdd_Config, *SIwindowsize, *SIperiod);
|
||||
} else {
|
||||
mac_xface->phy_config_sib1_ue(Mod_id,0,eNB_index,tdd_Config,*SIwindowsize,*SIperiod);
|
||||
mac_xface->phy_config_sib1_ue(Mod_idP,0,eNB_index,tdd_Config,*SIwindowsize,*SIperiod);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -165,106 +168,112 @@ rrc_mac_config_req(
|
||||
LOG_I(MAC,"[CONFIG]pusch_config_common.groupAssignmentPUSCH = %ld\n",radioResourceConfigCommon->pusch_ConfigCommon.ul_ReferenceSignalsPUSCH.groupAssignmentPUSCH);
|
||||
LOG_I(MAC,"[CONFIG]pusch_config_common.sequenceHoppingEnabled = %d\n",radioResourceConfigCommon->pusch_ConfigCommon.ul_ReferenceSignalsPUSCH.sequenceHoppingEnabled);
|
||||
LOG_I(MAC,"[CONFIG]pusch_config_common.cyclicShift = %ld\n",radioResourceConfigCommon->pusch_ConfigCommon.ul_ReferenceSignalsPUSCH.cyclicShift);
|
||||
mac_xface->phy_config_sib2_eNB(Mod_id, CC_id, radioResourceConfigCommon, ul_CarrierFreq, ul_Bandwidth, additionalSpectrumEmission, mbsfn_SubframeConfigList);
|
||||
mac_xface->phy_config_sib2_eNB(Mod_idP, CC_idP, radioResourceConfigCommon, ul_CarrierFreq, ul_Bandwidth, additionalSpectrumEmission, mbsfn_SubframeConfigList);
|
||||
} else {
|
||||
UE_mac_inst[Mod_id].radioResourceConfigCommon = radioResourceConfigCommon;
|
||||
mac_xface->phy_config_sib2_ue(Mod_id,0,eNB_index,radioResourceConfigCommon,ul_CarrierFreq,ul_Bandwidth,additionalSpectrumEmission,mbsfn_SubframeConfigList);
|
||||
UE_mac_inst[Mod_idP].radioResourceConfigCommon = radioResourceConfigCommon;
|
||||
mac_xface->phy_config_sib2_ue(Mod_idP,0,eNB_index,radioResourceConfigCommon,ul_CarrierFreq,ul_Bandwidth,additionalSpectrumEmission,mbsfn_SubframeConfigList);
|
||||
}
|
||||
}
|
||||
|
||||
// SRB2_lchan_config->choice.explicitValue.ul_SpecificParameters->logicalChannelGroup
|
||||
if (logicalChannelConfig!= NULL) {
|
||||
if (eNB_flagP==0) {
|
||||
LOG_I(MAC,"[CONFIG][UE %d] Applying RRC logicalChannelConfig from eNB%d\n",Mod_id,eNB_index);
|
||||
UE_mac_inst[Mod_id].logicalChannelConfig[logicalChannelIdentity]=logicalChannelConfig;
|
||||
UE_mac_inst[Mod_id].scheduling_info.Bj[logicalChannelIdentity]=0; // initilize the bucket for this lcid
|
||||
LOG_I(MAC,"[CONFIG][UE %d] Applying RRC logicalChannelConfig from eNB%d\n",Mod_idP,eNB_index);
|
||||
UE_mac_inst[Mod_idP].logicalChannelConfig[logicalChannelIdentity]=logicalChannelConfig;
|
||||
UE_mac_inst[Mod_idP].scheduling_info.Bj[logicalChannelIdentity]=0; // initilize the bucket for this lcid
|
||||
|
||||
if (logicalChannelConfig->ul_SpecificParameters) {
|
||||
UE_mac_inst[Mod_id].scheduling_info.bucket_size[logicalChannelIdentity]=logicalChannelConfig->ul_SpecificParameters->prioritisedBitRate *
|
||||
UE_mac_inst[Mod_idP].scheduling_info.bucket_size[logicalChannelIdentity]=logicalChannelConfig->ul_SpecificParameters->prioritisedBitRate *
|
||||
logicalChannelConfig->ul_SpecificParameters->bucketSizeDuration; // set the max bucket size
|
||||
UE_mac_inst[Mod_id].scheduling_info.LCGID[logicalChannelIdentity]=*logicalChannelConfig->ul_SpecificParameters->logicalChannelGroup;
|
||||
LOG_D(MAC,"[CONFIG][UE %d] LCID %d is attached to the LCGID %d\n",Mod_id,logicalChannelIdentity,*logicalChannelConfig->ul_SpecificParameters->logicalChannelGroup);
|
||||
UE_mac_inst[Mod_idP].scheduling_info.LCGID[logicalChannelIdentity]=*logicalChannelConfig->ul_SpecificParameters->logicalChannelGroup;
|
||||
LOG_D(MAC,"[CONFIG][UE %d] LCID %d is attached to the LCGID %d\n",Mod_idP,logicalChannelIdentity,*logicalChannelConfig->ul_SpecificParameters->logicalChannelGroup);
|
||||
} else {
|
||||
LOG_E(MAC,"[CONFIG][UE %d] LCID %d NULL ul_SpecificParameters\n",Mod_id,logicalChannelIdentity);
|
||||
LOG_E(MAC,"[CONFIG][UE %d] LCID %d NULL ul_SpecificParameters\n",Mod_idP,logicalChannelIdentity);
|
||||
mac_xface->macphy_exit("NULL ul_SpecificParameters");
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (logicalChannelConfig)
|
||||
UE_list->UE_template[CC_idP][UE_id].lcgidmap[logicalChannelIdentity] = *logicalChannelConfig->ul_SpecificParameters->logicalChannelGroup;
|
||||
else
|
||||
UE_list->UE_template[CC_idP][UE_id].lcgidmap[logicalChannelIdentity] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (mac_MainConfig != NULL) {
|
||||
if (eNB_flagP==0) {
|
||||
LOG_I(MAC,"[CONFIG][UE%d] Applying RRC macMainConfig from eNB%d\n",Mod_id,eNB_index);
|
||||
UE_mac_inst[Mod_id].macConfig=mac_MainConfig;
|
||||
UE_mac_inst[Mod_id].measGapConfig=measGapConfig;
|
||||
LOG_I(MAC,"[CONFIG][UE%d] Applying RRC macMainConfig from eNB%d\n",Mod_idP,eNB_index);
|
||||
UE_mac_inst[Mod_idP].macConfig=mac_MainConfig;
|
||||
UE_mac_inst[Mod_idP].measGapConfig=measGapConfig;
|
||||
|
||||
if (mac_MainConfig->ul_SCH_Config) {
|
||||
|
||||
if (mac_MainConfig->ul_SCH_Config->periodicBSR_Timer) {
|
||||
UE_mac_inst[Mod_id].scheduling_info.periodicBSR_Timer = (uint16_t) *mac_MainConfig->ul_SCH_Config->periodicBSR_Timer;
|
||||
UE_mac_inst[Mod_idP].scheduling_info.periodicBSR_Timer = (uint16_t) *mac_MainConfig->ul_SCH_Config->periodicBSR_Timer;
|
||||
} else {
|
||||
UE_mac_inst[Mod_id].scheduling_info.periodicBSR_Timer = (uint16_t) MAC_MainConfig__ul_SCH_Config__periodicBSR_Timer_infinity;
|
||||
UE_mac_inst[Mod_idP].scheduling_info.periodicBSR_Timer = (uint16_t) MAC_MainConfig__ul_SCH_Config__periodicBSR_Timer_infinity;
|
||||
}
|
||||
|
||||
if (mac_MainConfig->ul_SCH_Config->maxHARQ_Tx) {
|
||||
UE_mac_inst[Mod_id].scheduling_info.maxHARQ_Tx = (uint16_t) *mac_MainConfig->ul_SCH_Config->maxHARQ_Tx;
|
||||
UE_mac_inst[Mod_idP].scheduling_info.maxHARQ_Tx = (uint16_t) *mac_MainConfig->ul_SCH_Config->maxHARQ_Tx;
|
||||
} else {
|
||||
UE_mac_inst[Mod_id].scheduling_info.maxHARQ_Tx = (uint16_t) MAC_MainConfig__ul_SCH_Config__maxHARQ_Tx_n5;
|
||||
UE_mac_inst[Mod_idP].scheduling_info.maxHARQ_Tx = (uint16_t) MAC_MainConfig__ul_SCH_Config__maxHARQ_Tx_n5;
|
||||
}
|
||||
|
||||
if (mac_MainConfig->ul_SCH_Config->retxBSR_Timer) {
|
||||
UE_mac_inst[Mod_id].scheduling_info.retxBSR_Timer = (uint16_t) mac_MainConfig->ul_SCH_Config->retxBSR_Timer;
|
||||
UE_mac_inst[Mod_idP].scheduling_info.retxBSR_Timer = (uint16_t) mac_MainConfig->ul_SCH_Config->retxBSR_Timer;
|
||||
} else {
|
||||
UE_mac_inst[Mod_id].scheduling_info.retxBSR_Timer = (uint16_t)MAC_MainConfig__ul_SCH_Config__retxBSR_Timer_sf2560;
|
||||
UE_mac_inst[Mod_idP].scheduling_info.retxBSR_Timer = (uint16_t)MAC_MainConfig__ul_SCH_Config__retxBSR_Timer_sf2560;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef Rel10
|
||||
|
||||
if (mac_MainConfig->ext1 && mac_MainConfig->ext1->sr_ProhibitTimer_r9) {
|
||||
UE_mac_inst[Mod_id].scheduling_info.sr_ProhibitTimer = (uint16_t) *mac_MainConfig->ext1->sr_ProhibitTimer_r9;
|
||||
UE_mac_inst[Mod_idP].scheduling_info.sr_ProhibitTimer = (uint16_t) *mac_MainConfig->ext1->sr_ProhibitTimer_r9;
|
||||
} else {
|
||||
UE_mac_inst[Mod_id].scheduling_info.sr_ProhibitTimer = (uint16_t) 0;
|
||||
UE_mac_inst[Mod_idP].scheduling_info.sr_ProhibitTimer = (uint16_t) 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
UE_mac_inst[Mod_id].scheduling_info.periodicBSR_SF = get_sf_periodicBSRTimer(UE_mac_inst[Mod_id].scheduling_info.periodicBSR_Timer);
|
||||
UE_mac_inst[Mod_id].scheduling_info.retxBSR_SF = get_sf_retxBSRTimer(UE_mac_inst[Mod_id].scheduling_info.retxBSR_Timer);
|
||||
UE_mac_inst[Mod_idP].scheduling_info.periodicBSR_SF = get_sf_periodicBSRTimer(UE_mac_inst[Mod_idP].scheduling_info.periodicBSR_Timer);
|
||||
UE_mac_inst[Mod_idP].scheduling_info.retxBSR_SF = get_sf_retxBSRTimer(UE_mac_inst[Mod_idP].scheduling_info.retxBSR_Timer);
|
||||
|
||||
UE_mac_inst[Mod_id].scheduling_info.drx_config = mac_MainConfig->drx_Config;
|
||||
UE_mac_inst[Mod_id].scheduling_info.phr_config = mac_MainConfig->phr_Config;
|
||||
UE_mac_inst[Mod_idP].scheduling_info.drx_config = mac_MainConfig->drx_Config;
|
||||
UE_mac_inst[Mod_idP].scheduling_info.phr_config = mac_MainConfig->phr_Config;
|
||||
|
||||
if (mac_MainConfig->phr_Config) {
|
||||
UE_mac_inst[Mod_id].PHR_state = mac_MainConfig->phr_Config->present;
|
||||
UE_mac_inst[Mod_id].PHR_reconfigured = 1;
|
||||
UE_mac_inst[Mod_id].scheduling_info.periodicPHR_Timer = mac_MainConfig->phr_Config->choice.setup.periodicPHR_Timer;
|
||||
UE_mac_inst[Mod_id].scheduling_info.prohibitPHR_Timer = mac_MainConfig->phr_Config->choice.setup.prohibitPHR_Timer;
|
||||
UE_mac_inst[Mod_id].scheduling_info.PathlossChange = mac_MainConfig->phr_Config->choice.setup.dl_PathlossChange;
|
||||
UE_mac_inst[Mod_idP].PHR_state = mac_MainConfig->phr_Config->present;
|
||||
UE_mac_inst[Mod_idP].PHR_reconfigured = 1;
|
||||
UE_mac_inst[Mod_idP].scheduling_info.periodicPHR_Timer = mac_MainConfig->phr_Config->choice.setup.periodicPHR_Timer;
|
||||
UE_mac_inst[Mod_idP].scheduling_info.prohibitPHR_Timer = mac_MainConfig->phr_Config->choice.setup.prohibitPHR_Timer;
|
||||
UE_mac_inst[Mod_idP].scheduling_info.PathlossChange = mac_MainConfig->phr_Config->choice.setup.dl_PathlossChange;
|
||||
} else {
|
||||
UE_mac_inst[Mod_id].PHR_reconfigured = 0;
|
||||
UE_mac_inst[Mod_id].PHR_state = MAC_MainConfig__phr_Config_PR_setup;
|
||||
UE_mac_inst[Mod_id].scheduling_info.periodicPHR_Timer = MAC_MainConfig__phr_Config__setup__periodicPHR_Timer_sf20;
|
||||
UE_mac_inst[Mod_id].scheduling_info.prohibitPHR_Timer = MAC_MainConfig__phr_Config__setup__prohibitPHR_Timer_sf20;
|
||||
UE_mac_inst[Mod_id].scheduling_info.PathlossChange = MAC_MainConfig__phr_Config__setup__dl_PathlossChange_dB1;
|
||||
UE_mac_inst[Mod_idP].PHR_reconfigured = 0;
|
||||
UE_mac_inst[Mod_idP].PHR_state = MAC_MainConfig__phr_Config_PR_setup;
|
||||
UE_mac_inst[Mod_idP].scheduling_info.periodicPHR_Timer = MAC_MainConfig__phr_Config__setup__periodicPHR_Timer_sf20;
|
||||
UE_mac_inst[Mod_idP].scheduling_info.prohibitPHR_Timer = MAC_MainConfig__phr_Config__setup__prohibitPHR_Timer_sf20;
|
||||
UE_mac_inst[Mod_idP].scheduling_info.PathlossChange = MAC_MainConfig__phr_Config__setup__dl_PathlossChange_dB1;
|
||||
}
|
||||
|
||||
UE_mac_inst[Mod_id].scheduling_info.periodicPHR_SF = get_sf_perioidicPHR_Timer(UE_mac_inst[Mod_id].scheduling_info.periodicPHR_Timer);
|
||||
UE_mac_inst[Mod_id].scheduling_info.prohibitPHR_SF = get_sf_prohibitPHR_Timer(UE_mac_inst[Mod_id].scheduling_info.prohibitPHR_Timer);
|
||||
UE_mac_inst[Mod_id].scheduling_info.PathlossChange_db = get_db_dl_PathlossChange(UE_mac_inst[Mod_id].scheduling_info.PathlossChange);
|
||||
UE_mac_inst[Mod_idP].scheduling_info.periodicPHR_SF = get_sf_perioidicPHR_Timer(UE_mac_inst[Mod_idP].scheduling_info.periodicPHR_Timer);
|
||||
UE_mac_inst[Mod_idP].scheduling_info.prohibitPHR_SF = get_sf_prohibitPHR_Timer(UE_mac_inst[Mod_idP].scheduling_info.prohibitPHR_Timer);
|
||||
UE_mac_inst[Mod_idP].scheduling_info.PathlossChange_db = get_db_dl_PathlossChange(UE_mac_inst[Mod_idP].scheduling_info.PathlossChange);
|
||||
LOG_D(MAC,"[UE %d] config PHR (%d): periodic %d (SF) prohibit %d (SF) pathlosschange %d (db) \n",
|
||||
Mod_id,
|
||||
Mod_idP,
|
||||
(mac_MainConfig->phr_Config)?mac_MainConfig->phr_Config->present:-1,
|
||||
UE_mac_inst[Mod_id].scheduling_info.periodicPHR_SF,
|
||||
UE_mac_inst[Mod_id].scheduling_info.prohibitPHR_SF,
|
||||
UE_mac_inst[Mod_id].scheduling_info.PathlossChange_db);
|
||||
UE_mac_inst[Mod_idP].scheduling_info.periodicPHR_SF,
|
||||
UE_mac_inst[Mod_idP].scheduling_info.prohibitPHR_SF,
|
||||
UE_mac_inst[Mod_idP].scheduling_info.PathlossChange_db);
|
||||
}
|
||||
}
|
||||
|
||||
if (physicalConfigDedicated != NULL) {
|
||||
if (eNB_flagP==1) {
|
||||
mac_xface->phy_config_dedicated_eNB(Mod_id, CC_id, UE_RNTI(Mod_id, UE_id), physicalConfigDedicated);
|
||||
mac_xface->phy_config_dedicated_eNB(Mod_idP, CC_idP, UE_RNTI(Mod_idP, UE_id), physicalConfigDedicated);
|
||||
} else {
|
||||
mac_xface->phy_config_dedicated_ue(Mod_id,0,eNB_index,physicalConfigDedicated);
|
||||
UE_mac_inst[Mod_id].physicalConfigDedicated=physicalConfigDedicated; // for SR proc
|
||||
mac_xface->phy_config_dedicated_ue(Mod_idP,0,eNB_index,physicalConfigDedicated);
|
||||
UE_mac_inst[Mod_idP].physicalConfigDedicated=physicalConfigDedicated; // for SR proc
|
||||
}
|
||||
}
|
||||
|
||||
@@ -273,11 +282,12 @@ rrc_mac_config_req(
|
||||
if (sCellToAddMod_r10 != NULL) {
|
||||
|
||||
if (eNB_flagP==1) {
|
||||
mac_xface->phy_config_dedicated_scell_eNB(Mod_id,UE_RNTI(Mod_id,UE_id),sCellToAddMod_r10,1);
|
||||
mac_xface->phy_config_dedicated_scell_eNB(Mod_idP,UE_RNTI(Mod_idP,UE_id),sCellToAddMod_r10,1);
|
||||
} else {
|
||||
//#warning "phy_config_dedicated_scell_ue is empty"
|
||||
mac_xface->phy_config_dedicated_scell_ue(Mod_id,eNB_index,sCellToAddMod_r10,1);
|
||||
UE_mac_inst[Mod_id].physicalConfigDedicatedSCell_r10 = sCellToAddMod_r10->radioResourceConfigDedicatedSCell_r10->physicalConfigDedicatedSCell_r10; // using SCell index 0
|
||||
|
||||
//#warning "phy_config_dedicated_scell_ue is empty"
|
||||
mac_xface->phy_config_dedicated_scell_ue(Mod_idP,eNB_index,sCellToAddMod_r10,1);
|
||||
UE_mac_inst[Mod_idP].physicalConfigDedicatedSCell_r10 = sCellToAddMod_r10->radioResourceConfigDedicatedSCell_r10->physicalConfigDedicatedSCell_r10; // using SCell index 0
|
||||
}
|
||||
}
|
||||
|
||||
@@ -286,22 +296,22 @@ rrc_mac_config_req(
|
||||
if (eNB_flagP == 0) {
|
||||
if (measObj!= NULL) {
|
||||
if (measObj[0]!= NULL) {
|
||||
UE_mac_inst[Mod_id].n_adj_cells = measObj[0]->measObject.choice.measObjectEUTRA.cellsToAddModList->list.count;
|
||||
LOG_I(MAC,"Number of adjacent cells %d\n",UE_mac_inst[Mod_id].n_adj_cells);
|
||||
UE_mac_inst[Mod_idP].n_adj_cells = measObj[0]->measObject.choice.measObjectEUTRA.cellsToAddModList->list.count;
|
||||
LOG_I(MAC,"Number of adjacent cells %d\n",UE_mac_inst[Mod_idP].n_adj_cells);
|
||||
|
||||
for (i=0; i<UE_mac_inst[Mod_id].n_adj_cells; i++) {
|
||||
UE_mac_inst[Mod_id].adj_cell_id[i] = measObj[0]->measObject.choice.measObjectEUTRA.cellsToAddModList->list.array[i]->physCellId;
|
||||
LOG_I(MAC,"Cell %d : Nid_cell %d\n",i,UE_mac_inst[Mod_id].adj_cell_id[i]);
|
||||
for (i=0; i<UE_mac_inst[Mod_idP].n_adj_cells; i++) {
|
||||
UE_mac_inst[Mod_idP].adj_cell_id[i] = measObj[0]->measObject.choice.measObjectEUTRA.cellsToAddModList->list.array[i]->physCellId;
|
||||
LOG_I(MAC,"Cell %d : Nid_cell %d\n",i,UE_mac_inst[Mod_idP].adj_cell_id[i]);
|
||||
}
|
||||
|
||||
mac_xface->phy_config_meas_ue(Mod_id,0,eNB_index,UE_mac_inst[Mod_id].n_adj_cells,UE_mac_inst[Mod_id].adj_cell_id);
|
||||
mac_xface->phy_config_meas_ue(Mod_idP,0,eNB_index,UE_mac_inst[Mod_idP].n_adj_cells,UE_mac_inst[Mod_idP].adj_cell_id);
|
||||
}
|
||||
|
||||
/*
|
||||
if (quantityConfig != NULL) {
|
||||
if (quantityConfig[0] != NULL) {
|
||||
UE_mac_inst[Mod_id].quantityConfig = quantityConfig[0];
|
||||
LOG_I(MAC,"UE %d configured filterCoeff.",UE_mac_inst[Mod_id].crnti);
|
||||
UE_mac_inst[Mod_idP].quantityConfig = quantityConfig[0];
|
||||
LOG_I(MAC,"UE %d configured filterCoeff.",UE_mac_inst[Mod_idP].crnti);
|
||||
mac_xface->phy_config_meas_ue
|
||||
}
|
||||
}
|
||||
@@ -312,51 +322,51 @@ rrc_mac_config_req(
|
||||
if (eNB_flagP==0) {
|
||||
if(mobilityControlInfo != NULL) {
|
||||
|
||||
LOG_D(MAC,"[UE%d] MAC Reset procedure triggered by RRC eNB %d \n",Mod_id,eNB_index);
|
||||
ue_mac_reset(Mod_id,eNB_index);
|
||||
LOG_D(MAC,"[UE%d] MAC Reset procedure triggered by RRC eNB %d \n",Mod_idP,eNB_index);
|
||||
ue_mac_reset(Mod_idP,eNB_index);
|
||||
|
||||
if(mobilityControlInfo->radioResourceConfigCommon.rach_ConfigCommon) {
|
||||
memcpy((void *)&UE_mac_inst[Mod_id].radioResourceConfigCommon->rach_ConfigCommon,
|
||||
memcpy((void *)&UE_mac_inst[Mod_idP].radioResourceConfigCommon->rach_ConfigCommon,
|
||||
(void *)mobilityControlInfo->radioResourceConfigCommon.rach_ConfigCommon,
|
||||
sizeof(RACH_ConfigCommon_t));
|
||||
}
|
||||
|
||||
memcpy((void *)&UE_mac_inst[Mod_id].radioResourceConfigCommon->prach_Config.prach_ConfigInfo,
|
||||
memcpy((void *)&UE_mac_inst[Mod_idP].radioResourceConfigCommon->prach_Config.prach_ConfigInfo,
|
||||
(void *)mobilityControlInfo->radioResourceConfigCommon.prach_Config.prach_ConfigInfo,
|
||||
sizeof(PRACH_ConfigInfo_t));
|
||||
UE_mac_inst[Mod_id].radioResourceConfigCommon->prach_Config.rootSequenceIndex = mobilityControlInfo->radioResourceConfigCommon.prach_Config.rootSequenceIndex;
|
||||
UE_mac_inst[Mod_idP].radioResourceConfigCommon->prach_Config.rootSequenceIndex = mobilityControlInfo->radioResourceConfigCommon.prach_Config.rootSequenceIndex;
|
||||
|
||||
if(mobilityControlInfo->radioResourceConfigCommon.pdsch_ConfigCommon) {
|
||||
memcpy((void *)&UE_mac_inst[Mod_id].radioResourceConfigCommon->pdsch_ConfigCommon,
|
||||
memcpy((void *)&UE_mac_inst[Mod_idP].radioResourceConfigCommon->pdsch_ConfigCommon,
|
||||
(void *)mobilityControlInfo->radioResourceConfigCommon.pdsch_ConfigCommon,
|
||||
sizeof(PDSCH_ConfigCommon_t));
|
||||
}
|
||||
|
||||
// not a pointer: mobilityControlInfo->radioResourceConfigCommon.pusch_ConfigCommon
|
||||
memcpy((void *)&UE_mac_inst[Mod_id].radioResourceConfigCommon->pusch_ConfigCommon,
|
||||
memcpy((void *)&UE_mac_inst[Mod_idP].radioResourceConfigCommon->pusch_ConfigCommon,
|
||||
(void *)&mobilityControlInfo->radioResourceConfigCommon.pusch_ConfigCommon,
|
||||
sizeof(PUSCH_ConfigCommon_t));
|
||||
|
||||
if(mobilityControlInfo->radioResourceConfigCommon.phich_Config) {
|
||||
/* memcpy((void *)&UE_mac_inst[Mod_id].radioResourceConfigCommon->phich_Config,
|
||||
/* memcpy((void *)&UE_mac_inst[Mod_idP].radioResourceConfigCommon->phich_Config,
|
||||
(void *)mobilityControlInfo->radioResourceConfigCommon.phich_Config,
|
||||
sizeof(PHICH_Config_t)); */
|
||||
}
|
||||
|
||||
if(mobilityControlInfo->radioResourceConfigCommon.pucch_ConfigCommon) {
|
||||
memcpy((void *)&UE_mac_inst[Mod_id].radioResourceConfigCommon->pucch_ConfigCommon,
|
||||
memcpy((void *)&UE_mac_inst[Mod_idP].radioResourceConfigCommon->pucch_ConfigCommon,
|
||||
(void *)mobilityControlInfo->radioResourceConfigCommon.pucch_ConfigCommon,
|
||||
sizeof(PUCCH_ConfigCommon_t));
|
||||
}
|
||||
|
||||
if(mobilityControlInfo->radioResourceConfigCommon.soundingRS_UL_ConfigCommon) {
|
||||
memcpy((void *)&UE_mac_inst[Mod_id].radioResourceConfigCommon->soundingRS_UL_ConfigCommon,
|
||||
memcpy((void *)&UE_mac_inst[Mod_idP].radioResourceConfigCommon->soundingRS_UL_ConfigCommon,
|
||||
(void *)mobilityControlInfo->radioResourceConfigCommon.soundingRS_UL_ConfigCommon,
|
||||
sizeof(SoundingRS_UL_ConfigCommon_t));
|
||||
}
|
||||
|
||||
if(mobilityControlInfo->radioResourceConfigCommon.uplinkPowerControlCommon) {
|
||||
memcpy((void *)&UE_mac_inst[Mod_id].radioResourceConfigCommon->uplinkPowerControlCommon,
|
||||
memcpy((void *)&UE_mac_inst[Mod_idP].radioResourceConfigCommon->uplinkPowerControlCommon,
|
||||
(void *)mobilityControlInfo->radioResourceConfigCommon.uplinkPowerControlCommon,
|
||||
sizeof(UplinkPowerControlCommon_t));
|
||||
}
|
||||
@@ -367,54 +377,54 @@ rrc_mac_config_req(
|
||||
}
|
||||
|
||||
if(mobilityControlInfo->radioResourceConfigCommon.tdd_Config) {
|
||||
UE_mac_inst[Mod_id].tdd_Config = mobilityControlInfo->radioResourceConfigCommon.tdd_Config;
|
||||
UE_mac_inst[Mod_idP].tdd_Config = mobilityControlInfo->radioResourceConfigCommon.tdd_Config;
|
||||
}
|
||||
|
||||
if(mobilityControlInfo->radioResourceConfigCommon.ul_CyclicPrefixLength) {
|
||||
memcpy((void *)&UE_mac_inst[Mod_id].radioResourceConfigCommon->ul_CyclicPrefixLength,
|
||||
memcpy((void *)&UE_mac_inst[Mod_idP].radioResourceConfigCommon->ul_CyclicPrefixLength,
|
||||
(void *)mobilityControlInfo->radioResourceConfigCommon.ul_CyclicPrefixLength,
|
||||
sizeof(UL_CyclicPrefixLength_t));
|
||||
}
|
||||
|
||||
// store the previous rnti in case of failure, and set thenew rnti
|
||||
UE_mac_inst[Mod_id].crnti_before_ho = UE_mac_inst[Mod_id].crnti;
|
||||
UE_mac_inst[Mod_id].crnti = ((mobilityControlInfo->newUE_Identity.buf[0])|(mobilityControlInfo->newUE_Identity.buf[1]<<8));
|
||||
LOG_I(MAC,"[UE %d] Received new identity %x from %d\n", Mod_id, UE_mac_inst[Mod_id].crnti, eNB_index);
|
||||
UE_mac_inst[Mod_id].rach_ConfigDedicated = malloc(sizeof(*mobilityControlInfo->rach_ConfigDedicated));
|
||||
UE_mac_inst[Mod_idP].crnti_before_ho = UE_mac_inst[Mod_idP].crnti;
|
||||
UE_mac_inst[Mod_idP].crnti = ((mobilityControlInfo->newUE_Identity.buf[0])|(mobilityControlInfo->newUE_Identity.buf[1]<<8));
|
||||
LOG_I(MAC,"[UE %d] Received new identity %x from %d\n", Mod_idP, UE_mac_inst[Mod_idP].crnti, eNB_index);
|
||||
UE_mac_inst[Mod_idP].rach_ConfigDedicated = malloc(sizeof(*mobilityControlInfo->rach_ConfigDedicated));
|
||||
|
||||
if (mobilityControlInfo->rach_ConfigDedicated) {
|
||||
memcpy((void*)UE_mac_inst[Mod_id].rach_ConfigDedicated,
|
||||
memcpy((void*)UE_mac_inst[Mod_idP].rach_ConfigDedicated,
|
||||
(void*)mobilityControlInfo->rach_ConfigDedicated,
|
||||
sizeof(*mobilityControlInfo->rach_ConfigDedicated));
|
||||
}
|
||||
|
||||
mac_xface->phy_config_afterHO_ue(Mod_id,0,eNB_index,mobilityControlInfo,0);
|
||||
mac_xface->phy_config_afterHO_ue(Mod_idP,0,eNB_index,mobilityControlInfo,0);
|
||||
}
|
||||
}
|
||||
|
||||
if (mbsfn_SubframeConfigList != NULL) {
|
||||
if (eNB_flagP == 1) {
|
||||
LOG_I(MAC,"[eNB %d][CONFIG] Received %d subframe allocation pattern for MBSFN\n", Mod_id, mbsfn_SubframeConfigList->list.count);
|
||||
eNB_mac_inst[Mod_id].common_channels[0].num_sf_allocation_pattern= mbsfn_SubframeConfigList->list.count;
|
||||
LOG_I(MAC,"[eNB %d][CONFIG] Received %d subframe allocation pattern for MBSFN\n", Mod_idP, mbsfn_SubframeConfigList->list.count);
|
||||
eNB_mac_inst[Mod_idP].common_channels[0].num_sf_allocation_pattern= mbsfn_SubframeConfigList->list.count;
|
||||
|
||||
for (i=0; i<mbsfn_SubframeConfigList->list.count; i++) {
|
||||
eNB_mac_inst[Mod_id].common_channels[0].mbsfn_SubframeConfig[i] = mbsfn_SubframeConfigList->list.array[i];
|
||||
LOG_I(MAC, "[eNB %d][CONFIG] MBSFN_SubframeConfig[%d] pattern is %x\n", Mod_id, i,
|
||||
eNB_mac_inst[Mod_id].common_channels[0].mbsfn_SubframeConfig[i]->subframeAllocation.choice.oneFrame.buf[0]);
|
||||
eNB_mac_inst[Mod_idP].common_channels[0].mbsfn_SubframeConfig[i] = mbsfn_SubframeConfigList->list.array[i];
|
||||
LOG_I(MAC, "[eNB %d][CONFIG] MBSFN_SubframeConfig[%d] pattern is %x\n", Mod_idP, i,
|
||||
eNB_mac_inst[Mod_idP].common_channels[0].mbsfn_SubframeConfig[i]->subframeAllocation.choice.oneFrame.buf[0]);
|
||||
}
|
||||
|
||||
#ifdef Rel10
|
||||
eNB_mac_inst[Mod_id].common_channels[0].MBMS_flag = MBMS_Flag;
|
||||
eNB_mac_inst[Mod_idP].common_channels[0].MBMS_flag = MBMS_Flag;
|
||||
#endif
|
||||
} else { // UE
|
||||
LOG_I(MAC,"[UE %d][CONFIG] Received %d subframe allocation pattern for MBSFN\n", Mod_id, mbsfn_SubframeConfigList->list.count);
|
||||
UE_mac_inst[Mod_id].num_sf_allocation_pattern= mbsfn_SubframeConfigList->list.count;
|
||||
LOG_I(MAC,"[UE %d][CONFIG] Received %d subframe allocation pattern for MBSFN\n", Mod_idP, mbsfn_SubframeConfigList->list.count);
|
||||
UE_mac_inst[Mod_idP].num_sf_allocation_pattern= mbsfn_SubframeConfigList->list.count;
|
||||
|
||||
for (i=0; i<mbsfn_SubframeConfigList->list.count; i++) {
|
||||
LOG_I(MAC, "[UE %d] Configuring MBSFN_SubframeConfig %d from received SIB2 \n", Mod_id, i);
|
||||
UE_mac_inst[Mod_id].mbsfn_SubframeConfig[i] = mbsfn_SubframeConfigList->list.array[i];
|
||||
// LOG_I("[UE %d] MBSFN_SubframeConfig[%d] pattern is %ld\n", Mod_id,
|
||||
// UE_mac_inst[Mod_id].mbsfn_SubframeConfig[i]->subframeAllocation.choice.oneFrame.buf[0]);
|
||||
LOG_I(MAC, "[UE %d] Configuring MBSFN_SubframeConfig %d from received SIB2 \n", Mod_idP, i);
|
||||
UE_mac_inst[Mod_idP].mbsfn_SubframeConfig[i] = mbsfn_SubframeConfigList->list.array[i];
|
||||
// LOG_I("[UE %d] MBSFN_SubframeConfig[%d] pattern is %ld\n", Mod_idP,
|
||||
// UE_mac_inst[Mod_idP].mbsfn_SubframeConfig[i]->subframeAllocation.choice.oneFrame.buf[0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -424,24 +434,24 @@ rrc_mac_config_req(
|
||||
if (mbsfn_AreaInfoList != NULL) {
|
||||
if (eNB_flagP == 1) {
|
||||
// One eNB could be part of multiple mbsfn syc area, this could change over time so reset each time
|
||||
LOG_I(MAC,"[eNB %d][CONFIG] Received %d MBSFN Area Info\n", Mod_id, mbsfn_AreaInfoList->list.count);
|
||||
eNB_mac_inst[Mod_id].common_channels[0].num_active_mbsfn_area = mbsfn_AreaInfoList->list.count;
|
||||
LOG_I(MAC,"[eNB %d][CONFIG] Received %d MBSFN Area Info\n", Mod_idP, mbsfn_AreaInfoList->list.count);
|
||||
eNB_mac_inst[Mod_idP].common_channels[0].num_active_mbsfn_area = mbsfn_AreaInfoList->list.count;
|
||||
|
||||
for (i =0; i< mbsfn_AreaInfoList->list.count; i++) {
|
||||
eNB_mac_inst[Mod_id].common_channels[0].mbsfn_AreaInfo[i] = mbsfn_AreaInfoList->list.array[i];
|
||||
LOG_I(MAC,"[eNB %d][CONFIG] MBSFN_AreaInfo[%d]: MCCH Repetition Period = %ld\n", Mod_id,i,
|
||||
eNB_mac_inst[Mod_id].common_channels[0].mbsfn_AreaInfo[i]->mcch_Config_r9.mcch_RepetitionPeriod_r9);
|
||||
mac_xface->phy_config_sib13_eNB(Mod_id,0,i,eNB_mac_inst[Mod_id].common_channels[0].mbsfn_AreaInfo[i]->mbsfn_AreaId_r9);
|
||||
eNB_mac_inst[Mod_idP].common_channels[0].mbsfn_AreaInfo[i] = mbsfn_AreaInfoList->list.array[i];
|
||||
LOG_I(MAC,"[eNB %d][CONFIG] MBSFN_AreaInfo[%d]: MCCH Repetition Period = %ld\n", Mod_idP,i,
|
||||
eNB_mac_inst[Mod_idP].common_channels[0].mbsfn_AreaInfo[i]->mcch_Config_r9.mcch_RepetitionPeriod_r9);
|
||||
mac_xface->phy_config_sib13_eNB(Mod_idP,0,i,eNB_mac_inst[Mod_idP].common_channels[0].mbsfn_AreaInfo[i]->mbsfn_AreaId_r9);
|
||||
}
|
||||
} else { // UE
|
||||
LOG_I(MAC,"[UE %d][CONFIG] Received %d MBSFN Area Info\n", Mod_id, mbsfn_AreaInfoList->list.count);
|
||||
UE_mac_inst[Mod_id].num_active_mbsfn_area = mbsfn_AreaInfoList->list.count;
|
||||
LOG_I(MAC,"[UE %d][CONFIG] Received %d MBSFN Area Info\n", Mod_idP, mbsfn_AreaInfoList->list.count);
|
||||
UE_mac_inst[Mod_idP].num_active_mbsfn_area = mbsfn_AreaInfoList->list.count;
|
||||
|
||||
for (i =0; i< mbsfn_AreaInfoList->list.count; i++) {
|
||||
UE_mac_inst[Mod_id].mbsfn_AreaInfo[i] = mbsfn_AreaInfoList->list.array[i];
|
||||
LOG_I(MAC,"[UE %d] MBSFN_AreaInfo[%d]: MCCH Repetition Period = %ld\n",Mod_id, i,
|
||||
UE_mac_inst[Mod_id].mbsfn_AreaInfo[i]->mcch_Config_r9.mcch_RepetitionPeriod_r9);
|
||||
mac_xface->phy_config_sib13_ue(Mod_id,0,eNB_index,i,UE_mac_inst[Mod_id].mbsfn_AreaInfo[i]->mbsfn_AreaId_r9);
|
||||
UE_mac_inst[Mod_idP].mbsfn_AreaInfo[i] = mbsfn_AreaInfoList->list.array[i];
|
||||
LOG_I(MAC,"[UE %d] MBSFN_AreaInfo[%d]: MCCH Repetition Period = %ld\n",Mod_idP, i,
|
||||
UE_mac_inst[Mod_idP].mbsfn_AreaInfo[i]->mcch_Config_r9.mcch_RepetitionPeriod_r9);
|
||||
mac_xface->phy_config_sib13_ue(Mod_idP,0,eNB_index,i,UE_mac_inst[Mod_idP].mbsfn_AreaInfo[i]->mbsfn_AreaId_r9);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -456,29 +466,29 @@ rrc_mac_config_req(
|
||||
LOG_I(MAC, "[CONFIG] Number of PMCH in this MBSFN Area %d\n", pmch_InfoList->list.count);
|
||||
|
||||
for (i =0; i< pmch_InfoList->list.count; i++) {
|
||||
eNB_mac_inst[Mod_id].common_channels[0].pmch_Config[i] = &pmch_InfoList->list.array[i]->pmch_Config_r9;
|
||||
eNB_mac_inst[Mod_idP].common_channels[0].pmch_Config[i] = &pmch_InfoList->list.array[i]->pmch_Config_r9;
|
||||
|
||||
LOG_I(MAC, "[CONFIG] PMCH[%d]: This PMCH stop (sf_AllocEnd_r9) at subframe %ldth\n", i,
|
||||
eNB_mac_inst[Mod_id].common_channels[0].pmch_Config[i]->sf_AllocEnd_r9);
|
||||
eNB_mac_inst[Mod_idP].common_channels[0].pmch_Config[i]->sf_AllocEnd_r9);
|
||||
LOG_I(MAC, "[CONFIG] PMCH[%d]: mch_Scheduling_Period = %ld\n", i,
|
||||
eNB_mac_inst[Mod_id].common_channels[0].pmch_Config[i]->mch_SchedulingPeriod_r9);
|
||||
eNB_mac_inst[Mod_idP].common_channels[0].pmch_Config[i]->mch_SchedulingPeriod_r9);
|
||||
LOG_I(MAC, "[CONFIG] PMCH[%d]: dataMCS = %ld\n", i,
|
||||
eNB_mac_inst[Mod_id].common_channels[0].pmch_Config[i]->dataMCS_r9);
|
||||
eNB_mac_inst[Mod_idP].common_channels[0].pmch_Config[i]->dataMCS_r9);
|
||||
|
||||
// MBMS session info list in each MCH
|
||||
eNB_mac_inst[Mod_id].common_channels[0].mbms_SessionList[i] = &pmch_InfoList->list.array[i]->mbms_SessionInfoList_r9;
|
||||
LOG_I(MAC, "PMCH[%d] Number of session (MTCH) is: %d\n",i, eNB_mac_inst[Mod_id].common_channels[0].mbms_SessionList[i]->list.count);
|
||||
eNB_mac_inst[Mod_idP].common_channels[0].mbms_SessionList[i] = &pmch_InfoList->list.array[i]->mbms_SessionInfoList_r9;
|
||||
LOG_I(MAC, "PMCH[%d] Number of session (MTCH) is: %d\n",i, eNB_mac_inst[Mod_idP].common_channels[0].mbms_SessionList[i]->list.count);
|
||||
}
|
||||
} else { // UE
|
||||
LOG_I(MAC, "[UE %d] Configuring PMCH_config from MCCH MESSAGE \n",Mod_id);
|
||||
LOG_I(MAC, "[UE %d] Configuring PMCH_config from MCCH MESSAGE \n",Mod_idP);
|
||||
|
||||
for (i =0; i< pmch_InfoList->list.count; i++) {
|
||||
UE_mac_inst[Mod_id].pmch_Config[i] = &pmch_InfoList->list.array[i]->pmch_Config_r9;
|
||||
LOG_I(MAC, "[UE %d] PMCH[%d]: MCH_Scheduling_Period = %ld\n", Mod_id, i,
|
||||
UE_mac_inst[Mod_id].pmch_Config[i]->mch_SchedulingPeriod_r9);
|
||||
UE_mac_inst[Mod_idP].pmch_Config[i] = &pmch_InfoList->list.array[i]->pmch_Config_r9;
|
||||
LOG_I(MAC, "[UE %d] PMCH[%d]: MCH_Scheduling_Period = %ld\n", Mod_idP, i,
|
||||
UE_mac_inst[Mod_idP].pmch_Config[i]->mch_SchedulingPeriod_r9);
|
||||
}
|
||||
|
||||
UE_mac_inst[Mod_id].mcch_status = 1;
|
||||
UE_mac_inst[Mod_idP].mcch_status = 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -487,28 +497,28 @@ rrc_mac_config_req(
|
||||
|
||||
if (eNB_flagP == 0) {
|
||||
if (cba_rnti) {
|
||||
UE_mac_inst[Mod_id].cba_rnti[num_active_cba_groups-1] = cba_rnti;
|
||||
UE_mac_inst[Mod_idP].cba_rnti[num_active_cba_groups-1] = cba_rnti;
|
||||
LOG_D(MAC,"[UE %d] configure CBA group %d RNTI %x for eNB %d (total active cba group %d)\n",
|
||||
Mod_id,Mod_id%num_active_cba_groups, cba_rnti,eNB_index,num_active_cba_groups);
|
||||
mac_xface->phy_config_cba_rnti(Mod_id,CC_id,eNB_flagP,eNB_index,cba_rnti,num_active_cba_groups-1, num_active_cba_groups);
|
||||
Mod_idP,Mod_idP%num_active_cba_groups, cba_rnti,eNB_index,num_active_cba_groups);
|
||||
mac_xface->phy_config_cba_rnti(Mod_idP,CC_idP,eNB_flagP,eNB_index,cba_rnti,num_active_cba_groups-1, num_active_cba_groups);
|
||||
}
|
||||
} else {
|
||||
if (cba_rnti) {
|
||||
LOG_D(MAC,"[eNB %d] configure CBA RNTI for UE %d (total active cba groups %d)\n",
|
||||
Mod_id, UE_id, num_active_cba_groups);
|
||||
eNB_mac_inst[Mod_id].common_channels[CC_id].num_active_cba_groups=num_active_cba_groups;
|
||||
Mod_idP, UE_id, num_active_cba_groups);
|
||||
eNB_mac_inst[Mod_idP].common_channels[CC_idP].num_active_cba_groups=num_active_cba_groups;
|
||||
|
||||
for (i=0; i < num_active_cba_groups; i ++) {
|
||||
if (eNB_mac_inst[Mod_id].common_channels[CC_id].cba_rnti[i] != cba_rnti + i) {
|
||||
eNB_mac_inst[Mod_id].common_channels[CC_id].cba_rnti[i] = cba_rnti + i;
|
||||
if (eNB_mac_inst[Mod_idP].common_channels[CC_idP].cba_rnti[i] != cba_rnti + i) {
|
||||
eNB_mac_inst[Mod_idP].common_channels[CC_idP].cba_rnti[i] = cba_rnti + i;
|
||||
}
|
||||
|
||||
//only configure UE ids up to num_active_cba_groups
|
||||
//we use them as candidates for the transmission of dci format0)
|
||||
if (UE_id%num_active_cba_groups == i) {
|
||||
mac_xface->phy_config_cba_rnti(Mod_id,CC_id,eNB_flagP,UE_id,cba_rnti + i,i,num_active_cba_groups );
|
||||
mac_xface->phy_config_cba_rnti(Mod_idP,CC_idP,eNB_flagP,UE_id,cba_rnti + i,i,num_active_cba_groups );
|
||||
LOG_D(MAC,"[eNB %d] configure CBA groups %d with RNTI %x for UE %d (total active cba groups %d)\n",
|
||||
Mod_id, i, eNB_mac_inst[Mod_id].common_channels[CC_id].cba_rnti[i],UE_id, num_active_cba_groups);
|
||||
Mod_idP, i, eNB_mac_inst[Mod_idP].common_channels[CC_idP].cba_rnti[i],UE_id, num_active_cba_groups);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -558,7 +568,7 @@ rrc_get_estimated_ue_distance(
|
||||
return eNB_UE_stats->distance.power_based;
|
||||
}
|
||||
|
||||
// LOG_D(LOCALIZE, "DEBUG ME, dist = %d\n", &eNB_mac_inst[ctxt_pP->module_id].UE_list.UE_template[CC_id][UE_id].distance.power_based);
|
||||
// LOG_D(LOCALIZE, "DEBUG ME, dist = %d\n", &eNB_mac_inst[ctxt_pP->module_id].UE_list.UE_template[CC_idP][UE_id].distance.power_based);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -251,7 +251,7 @@ typedef struct {
|
||||
typedef struct {
|
||||
uint8_t Num_ue_spec_dci ;
|
||||
uint8_t Num_common_dci ;
|
||||
uint32_t nCCE;
|
||||
// uint32_t nCCE;
|
||||
uint32_t num_pdcch_symbols;
|
||||
DCI_ALLOC_t dci_alloc[NUM_DCI_MAX] ;
|
||||
} DCI_PDU;
|
||||
@@ -667,9 +667,12 @@ typedef struct {
|
||||
|
||||
// Logical channel info for link with RLC
|
||||
|
||||
/// UE BSR info for each logical channel group id
|
||||
/// Last received UE BSR info for each logical channel group id
|
||||
uint8_t bsr_info[MAX_NUM_LCGID];
|
||||
|
||||
/// LCGID mapping
|
||||
long lcgidmap[11];
|
||||
|
||||
/// phr information
|
||||
int8_t phr_info;
|
||||
|
||||
@@ -750,7 +753,15 @@ typedef struct {
|
||||
uint16_t pre_nb_available_rbs[MAX_NUM_CCs];
|
||||
unsigned char rballoc_sub_UE[MAX_NUM_CCs][N_RBG_MAX];
|
||||
uint16_t ta_timer;
|
||||
int16_t ta_update;
|
||||
int16_t ta_update;
|
||||
int32_t context_active_timer;
|
||||
int32_t cqi_req_timer;
|
||||
int32_t ul_inactivity_timer;
|
||||
int32_t ul_failure_timer;
|
||||
int32_t ul_scheduled;
|
||||
int32_t ra_pdcch_order_sent;
|
||||
int32_t ul_out_of_sync;
|
||||
int32_t phr_received;
|
||||
} UE_sched_ctrl;
|
||||
/*! \brief eNB template for the Random access information */
|
||||
typedef struct {
|
||||
|
||||
@@ -99,7 +99,7 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
|
||||
#endif
|
||||
#if defined(ENABLE_ITTI)
|
||||
MessageDef *msg_p;
|
||||
const char *msg_name;
|
||||
const char *msg_name;
|
||||
instance_t instance;
|
||||
int result;
|
||||
#endif
|
||||
@@ -107,6 +107,8 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
|
||||
int CC_id,i,next_i;
|
||||
UE_list_t *UE_list=&eNB_mac_inst[module_idP].UE_list;
|
||||
rnti_t rnti;
|
||||
void *DLSCH_dci=NULL;
|
||||
int size_bits=0,size_bytes=0;
|
||||
|
||||
Protocol__ProgranMessage *msg;
|
||||
|
||||
@@ -117,8 +119,6 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
|
||||
|
||||
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
|
||||
DCI_pdu[CC_id] = &eNB_mac_inst[module_idP].common_channels[CC_id].DCI_pdu;
|
||||
DCI_pdu[CC_id]->nCCE=0;
|
||||
DCI_pdu[CC_id]->num_pdcch_symbols=1;
|
||||
mbsfn_status[CC_id]=0;
|
||||
// clear vrb_map
|
||||
memset(eNB_mac_inst[module_idP].common_channels[CC_id].vrb_map,0,100);
|
||||
@@ -134,8 +134,16 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
|
||||
mac_xface->get_eNB_UE_stats(module_idP, CC_id, rnti));
|
||||
next_i= UE_list->next[i];
|
||||
|
||||
PHY_vars_eNB_g[module_idP][CC_id]->pusch_stats_bsr[i][(frameP*10)+subframeP]=-63;
|
||||
if (i==UE_list->head)
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_UE0_BSR,PHY_vars_eNB_g[module_idP][CC_id]->pusch_stats_bsr[i][(frameP*10)+subframeP]);
|
||||
// increment this, it is cleared when we receive an sdu
|
||||
eNB_mac_inst[module_idP].UE_list.UE_sched_ctrl[i].ul_inactivity_timer++;
|
||||
|
||||
eNB_mac_inst[module_idP].UE_list.UE_sched_ctrl[i].cqi_req_timer++;
|
||||
|
||||
if (mac_xface->get_eNB_UE_stats(module_idP, CC_id, rnti)==NULL) {
|
||||
mac_remove_ue(module_idP, i, frameP, subframeP);
|
||||
//mac_remove_ue(module_idP, i, frameP, subframeP);
|
||||
//Inform the controller about the UE deactivation. Should be moved to RRC agent in the future
|
||||
if (mac_agent_registered[module_idP]) {
|
||||
agent_mac_xface[module_idP]->enb_agent_notify_ue_state_change(module_idP,
|
||||
@@ -143,6 +151,114 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
|
||||
PROTOCOL__PRP_UE_STATE_CHANGE_TYPE__PRUESC_DEACTIVATED);
|
||||
}
|
||||
}
|
||||
else {
|
||||
// check uplink failure
|
||||
if ((UE_list->UE_sched_ctrl[i].ul_failure_timer>0)&&
|
||||
(UE_list->UE_sched_ctrl[i].ul_out_of_sync==0)) {
|
||||
LOG_D(MAC,"UE %d rnti %x: UL Failure timer %d \n",i,rnti,UE_list->UE_sched_ctrl[i].ul_failure_timer);
|
||||
if (UE_list->UE_sched_ctrl[i].ra_pdcch_order_sent==0) {
|
||||
UE_list->UE_sched_ctrl[i].ra_pdcch_order_sent=1;
|
||||
|
||||
// add a format 1A dci for this UE to request an RA procedure (only one UE per subframe)
|
||||
LOG_D(MAC,"UE %d rnti %x: sending PDCCH order for RAPROC (failure timer %d) \n",i,rnti,UE_list->UE_sched_ctrl[i].ul_failure_timer);
|
||||
DLSCH_dci = (void *)UE_list->UE_template[CC_id][i].DLSCH_DCI[0];
|
||||
*(uint32_t*)DLSCH_dci = 0;
|
||||
if (PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.frame_type == TDD) {
|
||||
switch (PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL) {
|
||||
case 6:
|
||||
((DCI1A_1_5MHz_TDD_1_6_t*)DLSCH_dci)->type = 1;
|
||||
((DCI1A_1_5MHz_TDD_1_6_t*)DLSCH_dci)->rballoc = 31;
|
||||
size_bytes = sizeof(DCI1A_1_5MHz_TDD_1_6_t);
|
||||
size_bits = sizeof_DCI1A_1_5MHz_TDD_1_6_t;
|
||||
break;
|
||||
case 25:
|
||||
((DCI1A_5MHz_TDD_1_6_t*)DLSCH_dci)->type = 1;
|
||||
((DCI1A_5MHz_TDD_1_6_t*)DLSCH_dci)->rballoc = 511;
|
||||
size_bytes = sizeof(DCI1A_5MHz_TDD_1_6_t);
|
||||
size_bits = sizeof_DCI1A_5MHz_TDD_1_6_t;
|
||||
break;
|
||||
case 50:
|
||||
((DCI1A_10MHz_TDD_1_6_t*)DLSCH_dci)->type = 1;
|
||||
((DCI1A_10MHz_TDD_1_6_t*)DLSCH_dci)->rballoc = 2047;
|
||||
size_bytes = sizeof(DCI1A_10MHz_TDD_1_6_t);
|
||||
size_bits = sizeof_DCI1A_10MHz_TDD_1_6_t;
|
||||
break;
|
||||
case 100:
|
||||
((DCI1A_20MHz_TDD_1_6_t*)DLSCH_dci)->type = 1;
|
||||
((DCI1A_20MHz_TDD_1_6_t*)DLSCH_dci)->rballoc = 8191;
|
||||
size_bytes = sizeof(DCI1A_20MHz_TDD_1_6_t);
|
||||
size_bits = sizeof_DCI1A_20MHz_TDD_1_6_t;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else { // FDD
|
||||
switch (PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL) {
|
||||
case 6:
|
||||
((DCI1A_1_5MHz_FDD_t*)DLSCH_dci)->type = 1;
|
||||
((DCI1A_1_5MHz_FDD_t*)DLSCH_dci)->rballoc = 31;
|
||||
size_bytes = sizeof(DCI1A_1_5MHz_FDD_t);
|
||||
size_bits = sizeof_DCI1A_1_5MHz_FDD_t;
|
||||
break;
|
||||
case 15:/*
|
||||
((DCI1A_2_5MHz_FDD_t*)DLSCH_dci)->type = 1;
|
||||
((DCI1A_2_5MHz_FDD_t*)DLSCH_dci)->rballoc = 31;
|
||||
size_bytes = sizeof(DCI1A_1_5MHz_FDD_t);
|
||||
size_bits = sizeof_DCI1A_1_5MHz_FDD_t;*/
|
||||
break;
|
||||
case 25:
|
||||
((DCI1A_5MHz_FDD_t*)DLSCH_dci)->type = 1;
|
||||
((DCI1A_5MHz_FDD_t*)DLSCH_dci)->rballoc = 511;
|
||||
size_bytes = sizeof(DCI1A_5MHz_FDD_t);
|
||||
size_bits = sizeof_DCI1A_5MHz_FDD_t;
|
||||
break;
|
||||
case 50:
|
||||
((DCI1A_10MHz_FDD_t*)DLSCH_dci)->type = 1;
|
||||
((DCI1A_10MHz_FDD_t*)DLSCH_dci)->rballoc = 2047;
|
||||
size_bytes = sizeof(DCI1A_10MHz_FDD_t);
|
||||
size_bits = sizeof_DCI1A_10MHz_FDD_t;
|
||||
break;
|
||||
case 75:
|
||||
/* ((DCI1A_15MHz_FDD_t*)DLSCH_dci)->type = 1;
|
||||
((DCI1A_15MHz_FDD_t*)DLSCH_dci)->rballoc = 2047;
|
||||
size_bytes = sizeof(DCI1A_10MHz_FDD_t);
|
||||
size_bits = sizeof_DCI1A_10MHz_FDD_t;*/
|
||||
break;
|
||||
case 100:
|
||||
((DCI1A_20MHz_FDD_t*)DLSCH_dci)->type = 1;
|
||||
((DCI1A_20MHz_FDD_t*)DLSCH_dci)->rballoc = 8191;
|
||||
size_bytes = sizeof(DCI1A_20MHz_FDD_t);
|
||||
size_bits = sizeof_DCI1A_20MHz_FDD_t;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
add_ue_spec_dci(DCI_pdu[CC_id],
|
||||
DLSCH_dci,
|
||||
rnti,
|
||||
size_bytes,
|
||||
process_ue_cqi (module_idP,i),//aggregation,
|
||||
size_bits,
|
||||
format1A,
|
||||
0);
|
||||
}
|
||||
else { // ra_pdcch_sent==1
|
||||
LOG_D(MAC,"UE %d rnti %x: sent PDCCH order for RAPROC waiting (failure timer %d) \n",i,rnti,UE_list->UE_sched_ctrl[i].ul_failure_timer);
|
||||
if ((UE_list->UE_sched_ctrl[i].ul_failure_timer % 40) == 0)
|
||||
UE_list->UE_sched_ctrl[i].ra_pdcch_order_sent=0; // resend every 4 frames
|
||||
}
|
||||
|
||||
UE_list->UE_sched_ctrl[i].ul_failure_timer++;
|
||||
// check threshold
|
||||
if (UE_list->UE_sched_ctrl[i].ul_failure_timer > 200) {
|
||||
// inform RRC of failure and clear timer
|
||||
LOG_I(MAC,"UE %d rnti %x: UL Failure after repeated PDCCH orders: Triggering RRC \n",i,rnti,UE_list->UE_sched_ctrl[i].ul_failure_timer);
|
||||
mac_eNB_rrc_ul_failure(module_idP,CC_id,frameP,subframeP,rnti);
|
||||
UE_list->UE_sched_ctrl[i].ul_failure_timer=0;
|
||||
UE_list->UE_sched_ctrl[i].ul_out_of_sync=1;
|
||||
}
|
||||
}
|
||||
} // ul_failure_timer>0
|
||||
|
||||
i = next_i;
|
||||
}
|
||||
|
||||
@@ -489,7 +605,6 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
|
||||
} else {
|
||||
if (mac_xface->lte_frame_parms->frame_type == FDD) { //FDD
|
||||
|
||||
// schedule_RA(module_idP,frameP, subframeP, 0);
|
||||
schedule_ulsch(module_idP, frameP, cooperation_flag, 4, 8);
|
||||
#ifndef ENABLE_ENB_AGENT_DL_SCHEDULER
|
||||
schedule_ue_spec(module_idP, frameP, subframeP, mbsfn_status);
|
||||
@@ -656,7 +771,7 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
|
||||
break;
|
||||
}
|
||||
} else { //FDD
|
||||
// schedule_ulsch(module_idP,frameP,cooperation_flag,6,0);
|
||||
schedule_ulsch(module_idP,frameP,cooperation_flag,6,0);
|
||||
#ifndef ENABLE_ENB_AGENT_DL_SCHEDULER
|
||||
schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status);
|
||||
fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status);
|
||||
@@ -739,7 +854,7 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
|
||||
break;
|
||||
}
|
||||
} else { //FDD
|
||||
//schedule_ulsch(module_idP,frameP,cooperation_flag,7,1);
|
||||
schedule_ulsch(module_idP,frameP,cooperation_flag,7,1);
|
||||
#ifndef ENABLE_ENB_AGENT_DL_SCHEDULER
|
||||
schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status);
|
||||
fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status);
|
||||
@@ -804,7 +919,7 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
|
||||
break;
|
||||
}
|
||||
} else { //FDD
|
||||
//schedule_ulsch(module_idP,frameP,cooperation_flag,8,2);
|
||||
schedule_ulsch(module_idP,frameP,cooperation_flag,8,2);
|
||||
#ifndef ENABLE_ENB_AGENT_DL_SCHEDULER
|
||||
schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status);
|
||||
fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status);
|
||||
@@ -938,7 +1053,7 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
|
||||
break;
|
||||
}
|
||||
} else { //FDD
|
||||
// schedule_ulsch(module_idP,frameP,cooperation_flag,9,3);
|
||||
schedule_ulsch(module_idP,frameP,cooperation_flag,9,3);
|
||||
#ifndef ENABLE_ENB_AGENT_DL_SCHEDULER
|
||||
schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status);
|
||||
fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status);
|
||||
@@ -971,7 +1086,6 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
|
||||
for (CC_id=0;CC_id<MAX_NUM_CCs;CC_id++)
|
||||
allocate_CCEs(module_idP,CC_id,subframeP,0);
|
||||
|
||||
|
||||
#ifndef DISABLE_CONT_STATS
|
||||
//Send subframe trigger to the controller
|
||||
if (mac_agent_registered[module_idP]) {
|
||||
@@ -979,8 +1093,27 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
int dummy=0;
|
||||
for (i=0;
|
||||
i<DCI_pdu[CC_id]->Num_common_dci+DCI_pdu[CC_id]->Num_ue_spec_dci;
|
||||
i++)
|
||||
if (DCI_pdu[CC_id]->dci_alloc[i].rnti==2)
|
||||
dummy=1;
|
||||
|
||||
if (dummy==1)
|
||||
for (i=0;
|
||||
i<DCI_pdu[CC_id]->Num_common_dci+DCI_pdu[CC_id]->Num_ue_spec_dci;
|
||||
i++)
|
||||
LOG_I(MAC,"Frame %d, subframe %d: DCI %d/%d, format %d, rnti %x, NCCE %d(num_pdcch_symb %d)\n",
|
||||
frameP,subframeP,i,DCI_pdu[CC_id]->Num_common_dci+DCI_pdu[CC_id]->Num_ue_spec_dci,
|
||||
DCI_pdu[CC_id]->dci_alloc[i].format,
|
||||
DCI_pdu[CC_id]->dci_alloc[i].rnti,
|
||||
DCI_pdu[CC_id]->dci_alloc[i].firstCCE,
|
||||
DCI_pdu[CC_id]->num_pdcch_symbols);
|
||||
|
||||
LOG_D(MAC,"frameP %d, subframeP %d\n",frameP,subframeP);
|
||||
*/
|
||||
|
||||
stop_meas(&eNB_mac_inst[module_idP].eNB_scheduler);
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_ULSCH_SCHEDULER,VCD_FUNCTION_OUT);
|
||||
|
||||
@@ -251,6 +251,8 @@ void schedule_RA(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP,un
|
||||
}
|
||||
|
||||
if (!CCE_allocation_infeasible(module_idP,CC_id,1,subframeP,2,RA_template->RA_rnti)) {
|
||||
LOG_D(MAC,"Frame %d: Subframe %d : Adding common DCI for RA_RNTI %x\n",
|
||||
frameP,subframeP,RA_template->RA_rnti);
|
||||
add_common_dci(DCI_pdu,
|
||||
(void*)&RA_template->RA_alloc_pdu1[0],
|
||||
RA_template->RA_rnti,
|
||||
@@ -737,7 +739,10 @@ void initiate_ra_proc(module_id_t module_idP, int CC_id,frame_t frameP, uint16_t
|
||||
uint8_t i;
|
||||
RA_TEMPLATE *RA_template = (RA_TEMPLATE *)&eNB_mac_inst[module_idP].common_channels[CC_id].RA_template[0];
|
||||
|
||||
LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d Initiating RA procedure for preamble index %d\n",module_idP,CC_id,frameP,preamble_index);
|
||||
LOG_D(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d Initiating RA procedure for preamble index %d\n",module_idP,CC_id,frameP,preamble_index);
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_INITIATE_RA_PROC,1);
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_INITIATE_RA_PROC,0);
|
||||
|
||||
for (i=0; i<NB_RA_PROC_MAX; i++) {
|
||||
if (RA_template[i].RA_active==FALSE) {
|
||||
@@ -765,7 +770,7 @@ void cancel_ra_proc(module_id_t module_idP, int CC_id, frame_t frameP, rnti_t rn
|
||||
RA_TEMPLATE *RA_template = (RA_TEMPLATE *)&eNB_mac_inst[module_idP].common_channels[CC_id].RA_template[0];
|
||||
|
||||
MSC_LOG_EVENT(MSC_PHY_ENB, "RA Cancelling procedure ue %"PRIx16" ", rnti);
|
||||
LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d Cancelling RA procedure for UE rnti %x\n",module_idP,CC_id,frameP,rnti);
|
||||
LOG_D(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d Cancelling RA procedure for UE rnti %x\n",module_idP,CC_id,frameP,rnti);
|
||||
|
||||
for (i=0; i<NB_RA_PROC_MAX; i++) {
|
||||
if (rnti == RA_template[i].rnti) {
|
||||
|
||||
@@ -193,7 +193,7 @@ uint8_t find_active_UEs(module_id_t module_idP,int CC_id){
|
||||
// get aggregatiob form phy for a give UE
|
||||
unsigned char process_ue_cqi (module_id_t module_idP, int ue_idP)
|
||||
{
|
||||
unsigned char aggregation=2;
|
||||
unsigned char aggregation=1;
|
||||
// check the MCS and SNR and set the aggregation accordingly
|
||||
return aggregation;
|
||||
}
|
||||
@@ -287,44 +287,38 @@ int add_new_ue(module_id_t mod_idP, int cc_idP, rnti_t rntiP,int harq_pidP)
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
int mac_remove_ue(module_id_t mod_idP, int ue_idP, int frameP, sub_frame_t subframeP)
|
||||
int rrc_mac_remove_ue(module_id_t mod_idP,rnti_t rntiP)
|
||||
//------------------------------------------------------------------------------
|
||||
{
|
||||
|
||||
int prev,i, ret=-1;
|
||||
|
||||
rnti_t rnti;
|
||||
UE_list_t *UE_list = &eNB_mac_inst[mod_idP].UE_list;
|
||||
int pCC_id = UE_PCCID(mod_idP,ue_idP);
|
||||
|
||||
rnti = UE_list->UE_template[pCC_id][ue_idP].rnti;
|
||||
LOG_I(MAC,"Removing UE %d from Primary CC_id %d (rnti %x)\n",ue_idP,pCC_id, rnti);
|
||||
UE_list_t *UE_list = &eNB_mac_inst[mod_idP].UE_list;
|
||||
int UE_id = find_UE_id(mod_idP,rntiP);
|
||||
int pCC_id = UE_PCCID(mod_idP,UE_id);
|
||||
|
||||
LOG_I(MAC,"Removing UE %d from Primary CC_id %d (rnti %x)\n",UE_id,pCC_id, rntiP);
|
||||
dump_ue_list(UE_list,0);
|
||||
|
||||
// clear all remaining pending transmissions
|
||||
UE_list->UE_template[pCC_id][ue_idP].bsr_info[LCGID0] = 0;
|
||||
UE_list->UE_template[pCC_id][ue_idP].bsr_info[LCGID1] = 0;
|
||||
UE_list->UE_template[pCC_id][ue_idP].bsr_info[LCGID2] = 0;
|
||||
UE_list->UE_template[pCC_id][ue_idP].bsr_info[LCGID3] = 0;
|
||||
UE_list->UE_template[pCC_id][UE_id].bsr_info[LCGID0] = 0;
|
||||
UE_list->UE_template[pCC_id][UE_id].bsr_info[LCGID1] = 0;
|
||||
UE_list->UE_template[pCC_id][UE_id].bsr_info[LCGID2] = 0;
|
||||
UE_list->UE_template[pCC_id][UE_id].bsr_info[LCGID3] = 0;
|
||||
|
||||
UE_list->UE_template[pCC_id][ue_idP].ul_SR = 0;
|
||||
UE_list->UE_template[pCC_id][ue_idP].rnti = NOT_A_RNTI;
|
||||
UE_list->UE_template[pCC_id][ue_idP].ul_active = FALSE;
|
||||
eNB_ulsch_info[mod_idP][pCC_id][ue_idP].rnti = NOT_A_RNTI;
|
||||
eNB_ulsch_info[mod_idP][pCC_id][ue_idP].status = S_UL_NONE;
|
||||
eNB_dlsch_info[mod_idP][pCC_id][ue_idP].rnti = NOT_A_RNTI;
|
||||
eNB_dlsch_info[mod_idP][pCC_id][ue_idP].status = S_DL_NONE;
|
||||
|
||||
rrc_eNB_free_UE(
|
||||
mod_idP,
|
||||
rnti,
|
||||
frameP,
|
||||
subframeP);
|
||||
UE_list->UE_template[pCC_id][UE_id].ul_SR = 0;
|
||||
UE_list->UE_template[pCC_id][UE_id].rnti = NOT_A_RNTI;
|
||||
UE_list->UE_template[pCC_id][UE_id].ul_active = FALSE;
|
||||
eNB_ulsch_info[mod_idP][pCC_id][UE_id].rnti = NOT_A_RNTI;
|
||||
eNB_ulsch_info[mod_idP][pCC_id][UE_id].status = S_UL_NONE;
|
||||
eNB_dlsch_info[mod_idP][pCC_id][UE_id].rnti = NOT_A_RNTI;
|
||||
eNB_dlsch_info[mod_idP][pCC_id][UE_id].status = S_DL_NONE;
|
||||
|
||||
prev = UE_list->head;
|
||||
|
||||
for (i=UE_list->head; i>=0; i=UE_list->next[i]) {
|
||||
if (i == ue_idP) {
|
||||
if (i == UE_id) {
|
||||
// link prev to next in Active list
|
||||
//if (prev==UE_list->head)
|
||||
if (i==UE_list->head) {
|
||||
@@ -349,7 +343,7 @@ int mac_remove_ue(module_id_t mod_idP, int ue_idP, int frameP, sub_frame_t subfr
|
||||
prev = UE_list->head_ul;
|
||||
|
||||
for (i=UE_list->head_ul; i>=0; i=UE_list->next_ul[i]) {
|
||||
if (i == ue_idP) {
|
||||
if (i == UE_id) {
|
||||
// link prev to next in Active list
|
||||
if (prev==UE_list->head_ul) {
|
||||
UE_list->head_ul = UE_list->next_ul[i];
|
||||
@@ -366,11 +360,13 @@ int mac_remove_ue(module_id_t mod_idP, int ue_idP, int frameP, sub_frame_t subfr
|
||||
prev=i;
|
||||
}
|
||||
|
||||
mac_phy_remove_ue(mod_idP,rntiP);
|
||||
|
||||
if (ret == 0) {
|
||||
return (0);
|
||||
}
|
||||
|
||||
LOG_E(MAC,"error in mac_remove_ue(), could not find previous to %d in UE_list, should never happen, Dumping UE list\n",ue_idP);
|
||||
LOG_E(MAC,"error in mac_remove_ue(), could not find previous to %d in UE_list, should never happen, Dumping UE list\n",UE_id);
|
||||
dump_ue_list(UE_list,0);
|
||||
mac_xface->macphy_exit("mac_remove_ue: Problem in UE_list");
|
||||
return(-1);
|
||||
@@ -530,22 +526,9 @@ void swap_UEs(UE_list_t *listP,int nodeiP, int nodejP, int ul_flag)
|
||||
dump_ue_list(listP,ul_flag);
|
||||
}
|
||||
|
||||
void SR_indication(module_id_t mod_idP, int cc_idP, frame_t frameP, rnti_t rntiP, sub_frame_t subframeP)
|
||||
{
|
||||
|
||||
int UE_id = find_UE_id(mod_idP, rntiP);
|
||||
UE_list_t *UE_list = &eNB_mac_inst[mod_idP].UE_list;
|
||||
|
||||
if (UE_id != -1) {
|
||||
LOG_D(MAC,"[eNB %d][SR %x] Frame %d subframeP %d Signaling SR for UE %d on CC_id %d\n",mod_idP,rntiP,frameP,subframeP, UE_id,cc_idP);
|
||||
UE_list->UE_template[cc_idP][UE_id].ul_SR = 1;
|
||||
UE_list->UE_template[cc_idP][UE_id].ul_active = TRUE;
|
||||
} else {
|
||||
// AssertFatal(0, "find_UE_id(%u,rnti %d) not found", enb_mod_idP, rntiP);
|
||||
// AssertError(0, 0, "Frame %d: find_UE_id(%u,rnti %d) not found\n", frameP, enb_mod_idP, rntiP);
|
||||
LOG_D(MAC,"[eNB %d][SR %x] Frame %d subframeP %d Signaling SR for UE %d (unknown UEid) on CC_id %d\n",mod_idP,rntiP,frameP,subframeP, UE_id,cc_idP);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -707,16 +690,31 @@ void add_ue_spec_dci(DCI_PDU *DCI_pdu,void *pdu,rnti_t rnti,unsigned char dci_si
|
||||
uint8_t UE_is_to_be_scheduled(module_id_t module_idP,int CC_id,uint8_t UE_id)
|
||||
{
|
||||
|
||||
UE_TEMPLATE *UE_template = &eNB_mac_inst[module_idP].UE_list.UE_template[CC_id][UE_id];
|
||||
UE_TEMPLATE *UE_template = &eNB_mac_inst[module_idP].UE_list.UE_template[CC_id][UE_id];
|
||||
UE_sched_ctrl *UE_sched_ctl = &eNB_mac_inst[module_idP].UE_list.UE_sched_ctrl[UE_id];
|
||||
|
||||
// LOG_D(MAC,"[eNB %d][PUSCH] Frame %d subframeP %d Scheduling UE %d\n",module_idP,rnti,frameP,subframeP,
|
||||
// UE_id);
|
||||
|
||||
// do not schedule UE if UL is not working
|
||||
if (UE_sched_ctl->ul_failure_timer>0)
|
||||
return(0);
|
||||
if (UE_sched_ctl->ul_out_of_sync>0)
|
||||
return(0);
|
||||
|
||||
LOG_D(MAC,"[eNB %d][PUSCH] Checking UL requirements UE %d/%x\n",module_idP,UE_id,UE_RNTI(module_idP,UE_id));
|
||||
|
||||
if ((UE_template->bsr_info[LCGID0]>0) ||
|
||||
(UE_template->bsr_info[LCGID1]>0) ||
|
||||
(UE_template->bsr_info[LCGID2]>0) ||
|
||||
(UE_template->bsr_info[LCGID3]>0) ||
|
||||
(UE_template->ul_SR>0)) { // uplink scheduling request
|
||||
(UE_template->ul_SR>0) || // uplink scheduling request
|
||||
((UE_sched_ctl->ul_inactivity_timer>20)&&
|
||||
(UE_sched_ctl->ul_scheduled==0))|| // every 2 frames when RRC_CONNECTED
|
||||
((UE_sched_ctl->ul_inactivity_timer>10)&&
|
||||
(UE_sched_ctl->ul_scheduled==0)&&
|
||||
(mac_eNB_get_rrc_status(module_idP,UE_RNTI(module_idP,UE_id)) < RRC_CONNECTED))) // every Frame when not RRC_CONNECTED
|
||||
{
|
||||
|
||||
LOG_D(MAC,"[eNB %d][PUSCH] UE %d/%x should be scheduled\n",module_idP,UE_id,UE_RNTI(module_idP,UE_id));
|
||||
return(1);
|
||||
} else {
|
||||
return(0);
|
||||
@@ -995,19 +993,19 @@ int allocate_CCEs(int module_idP,
|
||||
|
||||
int *CCE_table = eNB_mac_inst[module_idP].CCE_table[CC_idP];
|
||||
DCI_PDU *DCI_pdu = &eNB_mac_inst[module_idP].common_channels[CC_idP].DCI_pdu;
|
||||
int nCCE_max = mac_xface->get_nCCE_max(module_idP,CC_idP,DCI_pdu->num_pdcch_symbols,subframeP);
|
||||
int nCCE_max = mac_xface->get_nCCE_max(module_idP,CC_idP,1,subframeP);
|
||||
int fCCE;
|
||||
int i,j;
|
||||
int allocation_is_feasible = 1;
|
||||
DCI_ALLOC_t *dci_alloc;
|
||||
|
||||
int nCCE=0;
|
||||
|
||||
LOG_D(MAC,"Allocate CCEs subframe %d, test %d : (common %d,uspec %d)\n",subframeP,test_onlyP,DCI_pdu->Num_common_dci,DCI_pdu->Num_ue_spec_dci);
|
||||
|
||||
init_CCE_table(module_idP,CC_idP);
|
||||
DCI_pdu->nCCE=0;
|
||||
DCI_pdu->num_pdcch_symbols=1;
|
||||
|
||||
while (allocation_is_feasible == 1) {
|
||||
init_CCE_table(module_idP,CC_idP);
|
||||
nCCE=0;
|
||||
|
||||
for (i=0;i<DCI_pdu->Num_common_dci + DCI_pdu->Num_ue_spec_dci;i++) {
|
||||
dci_alloc = &DCI_pdu->dci_alloc[i];
|
||||
@@ -1015,9 +1013,9 @@ int allocate_CCEs(int module_idP,
|
||||
i,DCI_pdu->Num_common_dci+DCI_pdu->Num_ue_spec_dci,
|
||||
DCI_pdu->Num_common_dci,DCI_pdu->Num_ue_spec_dci,
|
||||
dci_alloc->rnti,1<<dci_alloc->L,
|
||||
DCI_pdu->nCCE,nCCE_max,DCI_pdu->num_pdcch_symbols);
|
||||
nCCE,nCCE_max,DCI_pdu->num_pdcch_symbols);
|
||||
|
||||
if (DCI_pdu->nCCE + (1<<dci_alloc->L) > nCCE_max) {
|
||||
if (nCCE + (1<<dci_alloc->L) > nCCE_max) {
|
||||
if (DCI_pdu->num_pdcch_symbols == 3)
|
||||
allocation_is_feasible = 0;
|
||||
else {
|
||||
@@ -1036,7 +1034,7 @@ int allocate_CCEs(int module_idP,
|
||||
|
||||
LOG_D(MAC,"Allocating at nCCE %d\n",fCCE);
|
||||
if (test_onlyP == 0) {
|
||||
DCI_pdu->nCCE += (1<<dci_alloc->L);
|
||||
nCCE += (1<<dci_alloc->L);
|
||||
dci_alloc->firstCCE=fCCE;
|
||||
LOG_D(MAC,"Allocate CCEs subframe %d, test %d\n",subframeP,test_onlyP);
|
||||
}
|
||||
@@ -1053,7 +1051,7 @@ int allocate_CCEs(int module_idP,
|
||||
DCI_pdu->Num_common_dci,DCI_pdu->Num_ue_spec_dci,
|
||||
DCI_pdu->dci_alloc[j].rnti,DCI_pdu->dci_alloc[j].format,
|
||||
1<<DCI_pdu->dci_alloc[j].L,
|
||||
DCI_pdu->nCCE,nCCE_max,DCI_pdu->num_pdcch_symbols);
|
||||
nCCE,nCCE_max,DCI_pdu->num_pdcch_symbols);
|
||||
}
|
||||
}
|
||||
else {
|
||||
@@ -1107,3 +1105,41 @@ boolean_t CCE_allocation_infeasible(int module_idP,
|
||||
return(res);
|
||||
}
|
||||
|
||||
void SR_indication(module_id_t mod_idP, int cc_idP, frame_t frameP, rnti_t rntiP, sub_frame_t subframeP)
|
||||
{
|
||||
|
||||
int UE_id = find_UE_id(mod_idP, rntiP);
|
||||
UE_list_t *UE_list = &eNB_mac_inst[mod_idP].UE_list;
|
||||
|
||||
if (UE_id != -1) {
|
||||
if (mac_eNB_get_rrc_status(mod_idP,UE_RNTI(mod_idP,UE_id)) < RRC_CONNECTED)
|
||||
LOG_I(MAC,"[eNB %d][SR %x] Frame %d subframeP %d Signaling SR for UE %d on CC_id %d\n",mod_idP,rntiP,frameP,subframeP, UE_id,cc_idP);
|
||||
UE_list->UE_template[cc_idP][UE_id].ul_SR = 1;
|
||||
UE_list->UE_template[cc_idP][UE_id].ul_active = TRUE;
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_SR_INDICATION,1);
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_SR_INDICATION,0);
|
||||
} else {
|
||||
// AssertFatal(0, "find_UE_id(%u,rnti %d) not found", enb_mod_idP, rntiP);
|
||||
// AssertError(0, 0, "Frame %d: find_UE_id(%u,rnti %d) not found\n", frameP, enb_mod_idP, rntiP);
|
||||
LOG_D(MAC,"[eNB %d][SR %x] Frame %d subframeP %d Signaling SR for UE %d (unknown UEid) on CC_id %d\n",mod_idP,rntiP,frameP,subframeP, UE_id,cc_idP);
|
||||
}
|
||||
}
|
||||
|
||||
void UL_failure_indication(module_id_t mod_idP, int cc_idP, frame_t frameP, rnti_t rntiP, sub_frame_t subframeP)
|
||||
{
|
||||
|
||||
int UE_id = find_UE_id(mod_idP, rntiP);
|
||||
UE_list_t *UE_list = &eNB_mac_inst[mod_idP].UE_list;
|
||||
|
||||
if (UE_id != -1) {
|
||||
LOG_I(MAC,"[eNB %d][UE %d/%x] Frame %d subframeP %d Signaling UL Failure for UE %d on CC_id %d (timer %d)\n",
|
||||
mod_idP,UE_id,rntiP,frameP,subframeP, UE_id,cc_idP,
|
||||
UE_list->UE_sched_ctrl[UE_id].ul_failure_timer);
|
||||
if (UE_list->UE_sched_ctrl[UE_id].ul_failure_timer == 0)
|
||||
UE_list->UE_sched_ctrl[UE_id].ul_failure_timer=1;
|
||||
} else {
|
||||
// AssertFatal(0, "find_UE_id(%u,rnti %d) not found", enb_mod_idP, rntiP);
|
||||
// AssertError(0, 0, "Frame %d: find_UE_id(%u,rnti %d) not found\n", frameP, enb_mod_idP, rntiP);
|
||||
LOG_W(MAC,"[eNB %d][SR %x] Frame %d subframeP %d Signaling UL Failure for UE %d (unknown UEid) on CC_id %d\n",mod_idP,rntiP,frameP,subframeP, UE_id,cc_idP);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -89,6 +89,7 @@ void rx_sdu(
|
||||
eNB_MAC_INST *eNB = &eNB_mac_inst[enb_mod_idP];
|
||||
UE_list_t *UE_list= &eNB->UE_list;
|
||||
int crnti_rx=0;
|
||||
int old_buffer_info;
|
||||
|
||||
start_meas(&eNB->rx_ulsch_sdu);
|
||||
|
||||
@@ -105,9 +106,28 @@ void rx_sdu(
|
||||
}
|
||||
|
||||
LOG_D(MAC,"[eNB %d] CC_id %d Received ULSCH sdu from PHY (rnti %x, UE_id %d), parsing header\n",enb_mod_idP,CC_idP,rntiP,UE_id);
|
||||
|
||||
|
||||
if (sduP==NULL) { // we've got an error after N rounds
|
||||
UE_list->UE_sched_ctrl[UE_id].ul_scheduled &= (~(1<<harq_pidP));
|
||||
return;
|
||||
}
|
||||
|
||||
if (UE_id!=-1) {
|
||||
UE_list->UE_sched_ctrl[UE_id].ul_inactivity_timer=0;
|
||||
UE_list->UE_sched_ctrl[UE_id].ul_failure_timer =0;
|
||||
UE_list->UE_sched_ctrl[UE_id].ul_scheduled &= (~(1<<harq_pidP));
|
||||
|
||||
if (UE_list->UE_sched_ctrl[UE_id].ul_out_of_sync > 0) {
|
||||
UE_list->UE_sched_ctrl[UE_id].ul_out_of_sync=0;
|
||||
mac_eNB_rrc_ul_in_sync(enb_mod_idP,CC_idP,frameP,subframeP,UE_RNTI(enb_mod_idP,UE_id));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
payload_ptr = parse_ulsch_header(sduP,&num_ce,&num_sdu,rx_ces,rx_lcids,rx_lengths,sdu_lenP);
|
||||
|
||||
|
||||
|
||||
|
||||
eNB->eNB_stats[CC_idP].ulsch_bytes_rx=sdu_lenP;
|
||||
eNB->eNB_stats[CC_idP].total_ulsch_bytes_rx+=sdu_lenP;
|
||||
eNB->eNB_stats[CC_idP].total_ulsch_pdus_rx+=1;
|
||||
@@ -122,13 +142,23 @@ void rx_sdu(
|
||||
enb_mod_idP, CC_idP, rx_ces[i], UE_list->UE_template[CC_idP][UE_id].phr_info);
|
||||
UE_list->UE_template[CC_idP][UE_id].phr_info_configured=1;
|
||||
}
|
||||
UE_list->UE_sched_ctrl[UE_id].phr_received = 1;
|
||||
|
||||
payload_ptr+=sizeof(POWER_HEADROOM_CMD);
|
||||
break;
|
||||
|
||||
case CRNTI:
|
||||
UE_id = find_UE_id(enb_mod_idP,(((uint16_t)payload_ptr[0])<<8) + payload_ptr[1]);
|
||||
LOG_I(MAC, "[eNB %d] CC_id %d MAC CE_LCID %d (ce %d/%d): CRNTI %x (UE_id %d) in Msg3\n",enb_mod_idP, CC_idP, rx_ces[i], i,num_ce,(((uint16_t)payload_ptr[0])<<8) + payload_ptr[1],UE_id);
|
||||
LOG_I(MAC, "[eNB %d] Frame %d, Subframe %d CC_id %d MAC CE_LCID %d (ce %d/%d): CRNTI %x (UE_id %d) in Msg3\n",
|
||||
frameP,subframeP,enb_mod_idP, CC_idP, rx_ces[i], i,num_ce,(((uint16_t)payload_ptr[0])<<8) + payload_ptr[1],UE_id);
|
||||
if (UE_id!=-1) {
|
||||
UE_list->UE_sched_ctrl[UE_id].ul_inactivity_timer=0;
|
||||
UE_list->UE_sched_ctrl[UE_id].ul_failure_timer=0;
|
||||
if (UE_list->UE_sched_ctrl[UE_id].ul_out_of_sync > 0) {
|
||||
UE_list->UE_sched_ctrl[UE_id].ul_out_of_sync=0;
|
||||
mac_eNB_rrc_ul_in_sync(enb_mod_idP,CC_idP,frameP,subframeP,(((uint16_t)payload_ptr[0])<<8) + payload_ptr[1]);
|
||||
}
|
||||
}
|
||||
crnti_rx=1;
|
||||
payload_ptr+=2;
|
||||
|
||||
@@ -152,9 +182,22 @@ void rx_sdu(
|
||||
|
||||
UE_list->UE_template[CC_idP][UE_id].bsr_info[lcgid] = (payload_ptr[0] & 0x3f);
|
||||
|
||||
// update buffer info
|
||||
|
||||
UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[lcgid]=BSR_TABLE[UE_list->UE_template[CC_idP][UE_id].bsr_info[lcgid]];
|
||||
|
||||
UE_list->UE_template[CC_idP][UE_id].ul_total_buffer= UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[lcgid];
|
||||
|
||||
PHY_vars_eNB_g[enb_mod_idP][CC_idP]->pusch_stats_bsr[UE_id][(frameP*10)+subframeP] = (payload_ptr[0] & 0x3f);
|
||||
if (UE_id == UE_list->head)
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_UE0_BSR,PHY_vars_eNB_g[enb_mod_idP][CC_idP]->pusch_stats_bsr[UE_id][(frameP*10)+subframeP]);
|
||||
if (UE_list->UE_template[CC_idP][UE_id].ul_buffer_creation_time[lcgid] == 0 ) {
|
||||
UE_list->UE_template[CC_idP][UE_id].ul_buffer_creation_time[lcgid]=frameP;
|
||||
}
|
||||
if (mac_eNB_get_rrc_status(enb_mod_idP,UE_RNTI(enb_mod_idP,UE_id)) < RRC_CONNECTED)
|
||||
LOG_I(MAC, "[eNB %d] CC_id %d MAC CE_LCID %d : ul_total_buffer = %d (lcg increment %d)\n",
|
||||
enb_mod_idP, CC_idP, rx_ces[i], UE_list->UE_template[CC_idP][UE_id].ul_total_buffer,
|
||||
UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[lcgid]);
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -171,6 +214,41 @@ void rx_sdu(
|
||||
UE_list->UE_template[CC_idP][UE_id].bsr_info[LCGID2] =
|
||||
((payload_ptr[1] & 0x0F) << 2) | ((payload_ptr[2] & 0xC0) >> 6);
|
||||
UE_list->UE_template[CC_idP][UE_id].bsr_info[LCGID3] = (payload_ptr[2] & 0x3F);
|
||||
|
||||
// update buffer info
|
||||
old_buffer_info = UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[LCGID0];
|
||||
UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[LCGID0]=BSR_TABLE[UE_list->UE_template[CC_idP][UE_id].bsr_info[LCGID0]];
|
||||
|
||||
UE_list->UE_template[CC_idP][UE_id].ul_total_buffer+= UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[LCGID0];
|
||||
if (UE_list->UE_template[CC_idP][UE_id].ul_total_buffer >= old_buffer_info)
|
||||
UE_list->UE_template[CC_idP][UE_id].ul_total_buffer -= old_buffer_info;
|
||||
else
|
||||
UE_list->UE_template[CC_idP][UE_id].ul_total_buffer = 0;
|
||||
|
||||
old_buffer_info = UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[LCGID1];
|
||||
UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[LCGID1]=BSR_TABLE[UE_list->UE_template[CC_idP][UE_id].bsr_info[LCGID1]];
|
||||
UE_list->UE_template[CC_idP][UE_id].ul_total_buffer+= UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[LCGID1];
|
||||
if (UE_list->UE_template[CC_idP][UE_id].ul_total_buffer >= old_buffer_info)
|
||||
UE_list->UE_template[CC_idP][UE_id].ul_total_buffer -= old_buffer_info;
|
||||
else
|
||||
UE_list->UE_template[CC_idP][UE_id].ul_total_buffer = 0;
|
||||
|
||||
old_buffer_info = UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[LCGID2];
|
||||
UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[LCGID2]=BSR_TABLE[UE_list->UE_template[CC_idP][UE_id].bsr_info[LCGID2]];
|
||||
UE_list->UE_template[CC_idP][UE_id].ul_total_buffer+= UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[LCGID2];
|
||||
if (UE_list->UE_template[CC_idP][UE_id].ul_total_buffer >= old_buffer_info)
|
||||
UE_list->UE_template[CC_idP][UE_id].ul_total_buffer -= old_buffer_info;
|
||||
else
|
||||
UE_list->UE_template[CC_idP][UE_id].ul_total_buffer = 0;
|
||||
|
||||
old_buffer_info = UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[LCGID3];
|
||||
UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[LCGID3]=BSR_TABLE[UE_list->UE_template[CC_idP][UE_id].bsr_info[LCGID3]];
|
||||
UE_list->UE_template[CC_idP][UE_id].ul_total_buffer+= UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[LCGID3];
|
||||
if (UE_list->UE_template[CC_idP][UE_id].ul_total_buffer >= old_buffer_info)
|
||||
UE_list->UE_template[CC_idP][UE_id].ul_total_buffer -= old_buffer_info;
|
||||
else
|
||||
UE_list->UE_template[CC_idP][UE_id].ul_total_buffer = 0;
|
||||
|
||||
LOG_D(MAC, "[eNB %d] CC_id %d MAC CE_LCID %d: Received long BSR LCGID0 = %u LCGID1 = "
|
||||
"%u LCGID2 = %u LCGID3 = %u\n",
|
||||
enb_mod_idP, CC_idP,
|
||||
@@ -238,7 +316,8 @@ void rx_sdu(
|
||||
LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, Received CCCH: %x.%x.%x.%x.%x.%x, Terminating RA procedure for UE rnti %x\n",
|
||||
enb_mod_idP,CC_idP,frameP,
|
||||
payload_ptr[0],payload_ptr[1],payload_ptr[2],payload_ptr[3],payload_ptr[4], payload_ptr[5], rntiP);
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_TERMINATE_RA_PROC,1);
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_TERMINATE_RA_PROC,0);
|
||||
for (ii=0; ii<NB_RA_PROC_MAX; ii++) {
|
||||
LOG_D(MAC,"[eNB %d][RAPROC] CC_id %d Checking proc %d : rnti (%x, %x), active %d\n",
|
||||
enb_mod_idP, CC_idP, ii,
|
||||
@@ -296,10 +375,11 @@ void rx_sdu(
|
||||
case DCCH :
|
||||
case DCCH1 :
|
||||
// if(eNB_mac_inst[module_idP][CC_idP].Dcch_lchan[UE_id].Active==1){
|
||||
|
||||
|
||||
#if defined(ENABLE_MAC_PAYLOAD_DEBUG)
|
||||
LOG_T(MAC,"offset: %d\n",(unsigned char)((unsigned char*)payload_ptr-sduP));
|
||||
|
||||
|
||||
for (j=0; j<32; j++) {
|
||||
LOG_T(MAC,"%x ",payload_ptr[j]);
|
||||
}
|
||||
@@ -308,23 +388,29 @@ void rx_sdu(
|
||||
#endif
|
||||
|
||||
if (UE_id != -1) {
|
||||
LOG_D(MAC,"[eNB %d] CC_id %d Frame %d : ULSCH -> UL-DCCH, received %d bytes form UE %d on LCID %d \n",
|
||||
enb_mod_idP,CC_idP,frameP, rx_lengths[i], UE_id, rx_lcids[i]);
|
||||
// adjust buffer occupancy of the correponding logical channel group
|
||||
if (UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[UE_list->UE_template[CC_idP][UE_id].lcgidmap[rx_lcids[i]]] >= rx_lengths[i])
|
||||
UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[UE_list->UE_template[CC_idP][UE_id].lcgidmap[rx_lcids[i]]] -= rx_lengths[i];
|
||||
else
|
||||
UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[UE_list->UE_template[CC_idP][UE_id].lcgidmap[rx_lcids[i]]] = 0;
|
||||
|
||||
mac_rlc_data_ind(
|
||||
enb_mod_idP,
|
||||
rntiP,
|
||||
enb_mod_idP,
|
||||
frameP,
|
||||
ENB_FLAG_YES,
|
||||
MBMS_FLAG_NO,
|
||||
rx_lcids[i],
|
||||
(char *)payload_ptr,
|
||||
rx_lengths[i],
|
||||
1,
|
||||
NULL);//(unsigned int*)crc_status);
|
||||
UE_list->eNB_UE_stats[CC_idP][UE_id].num_pdu_rx[rx_lcids[i]]+=1;
|
||||
UE_list->eNB_UE_stats[CC_idP][UE_id].num_bytes_rx[rx_lcids[i]]+=rx_lengths[i];
|
||||
LOG_D(MAC,"[eNB %d] CC_id %d Frame %d : ULSCH -> UL-DCCH, received %d bytes form UE %d on LCID %d \n",
|
||||
enb_mod_idP,CC_idP,frameP, rx_lengths[i], UE_id, rx_lcids[i]);
|
||||
|
||||
mac_rlc_data_ind(
|
||||
enb_mod_idP,
|
||||
rntiP,
|
||||
enb_mod_idP,
|
||||
frameP,
|
||||
ENB_FLAG_YES,
|
||||
MBMS_FLAG_NO,
|
||||
rx_lcids[i],
|
||||
(char *)payload_ptr,
|
||||
rx_lengths[i],
|
||||
1,
|
||||
NULL);//(unsigned int*)crc_status);
|
||||
UE_list->eNB_UE_stats[CC_idP][UE_id].num_pdu_rx[rx_lcids[i]]+=1;
|
||||
UE_list->eNB_UE_stats[CC_idP][UE_id].num_bytes_rx[rx_lcids[i]]+=rx_lengths[i];
|
||||
} /* UE_id != -1 */
|
||||
|
||||
// }
|
||||
@@ -347,6 +433,17 @@ void rx_sdu(
|
||||
enb_mod_idP,CC_idP,frameP, rx_lengths[i], UE_id,rx_lcids[i]);
|
||||
|
||||
if (UE_id != -1) {
|
||||
// adjust buffer occupancy of the correponding logical channel group
|
||||
LOG_D(MAC,"[eNB %d] CC_id %d Frame %d : ULSCH -> UL-DTCH, received %d bytes from UE %d for lcid %d, removing from LCGID %d, %d\n",
|
||||
enb_mod_idP,CC_idP,frameP, rx_lengths[i], UE_id,rx_lcids[i],
|
||||
UE_list->UE_template[CC_idP][UE_id].lcgidmap[rx_lcids[i]],
|
||||
UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[UE_list->UE_template[CC_idP][UE_id].lcgidmap[rx_lcids[i]]]);
|
||||
|
||||
if (UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[UE_list->UE_template[CC_idP][UE_id].lcgidmap[rx_lcids[i]]] >= rx_lengths[i])
|
||||
UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[UE_list->UE_template[CC_idP][UE_id].lcgidmap[rx_lcids[i]]] -= rx_lengths[i];
|
||||
else
|
||||
UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[UE_list->UE_template[CC_idP][UE_id].lcgidmap[rx_lcids[i]]] = 0;
|
||||
|
||||
if ((rx_lengths[i] <SCH_PAYLOAD_SIZE_MAX) && (rx_lengths[i] > 0) ) { // MAX SIZE OF transport block
|
||||
mac_rlc_data_ind(
|
||||
enb_mod_idP,
|
||||
@@ -420,52 +517,6 @@ uint32_t bytes_to_bsr_index(int32_t nbytes)
|
||||
return(i-1);
|
||||
}
|
||||
|
||||
void adjust_bsr_info(int buffer_occupancy,
|
||||
uint16_t TBS,
|
||||
UE_TEMPLATE *UE_template)
|
||||
{
|
||||
|
||||
uint32_t tmp_bsr;
|
||||
|
||||
// could not serve all the uplink traffic
|
||||
if (buffer_occupancy > 0 ) {
|
||||
if (BSR_TABLE[UE_template->bsr_info[LCGID0]] <= TBS ) {
|
||||
tmp_bsr = BSR_TABLE[UE_template->bsr_info[LCGID0]]; // serving this amout of bytes
|
||||
UE_template->bsr_info[LCGID0] = 0;
|
||||
|
||||
if (BSR_TABLE[UE_template->bsr_info[LCGID1]] <= (TBS-tmp_bsr)) {
|
||||
tmp_bsr += BSR_TABLE[UE_template->bsr_info[LCGID1]];
|
||||
UE_template->bsr_info[LCGID1] = 0;
|
||||
|
||||
if (BSR_TABLE[UE_template->bsr_info[LCGID2]] <= (TBS-tmp_bsr)) {
|
||||
tmp_bsr += BSR_TABLE[UE_template->bsr_info[LCGID2]];
|
||||
UE_template->bsr_info[LCGID2] = 0;
|
||||
|
||||
if (BSR_TABLE[UE_template->bsr_info[LCGID3]] <= (TBS-tmp_bsr)) {
|
||||
tmp_bsr += BSR_TABLE[UE_template->bsr_info[LCGID3]];
|
||||
UE_template->bsr_info[LCGID3] = 0;
|
||||
} else {
|
||||
UE_template->bsr_info[LCGID3] = bytes_to_bsr_index((int32_t)BSR_TABLE[UE_template->bsr_info[LCGID3]] - ((int32_t) TBS - (int32_t)tmp_bsr));
|
||||
}
|
||||
} else {
|
||||
UE_template->bsr_info[LCGID2] = bytes_to_bsr_index((int32_t)BSR_TABLE[UE_template->bsr_info[LCGID2]] - ((int32_t)TBS - (int32_t)tmp_bsr));
|
||||
}
|
||||
} else {
|
||||
UE_template->bsr_info[LCGID1] = bytes_to_bsr_index((int32_t)BSR_TABLE[UE_template->bsr_info[LCGID1]] - ((int32_t)TBS - (int32_t)tmp_bsr));
|
||||
}
|
||||
} else {
|
||||
UE_template->bsr_info[LCGID0] = bytes_to_bsr_index((int32_t)BSR_TABLE[UE_template->bsr_info[LCGID0]] - (int32_t)TBS);
|
||||
}
|
||||
} else { // we have flushed all buffers so clear bsr
|
||||
UE_template->bsr_info[LCGID0] = 0;
|
||||
UE_template->bsr_info[LCGID1] = 0;
|
||||
UE_template->bsr_info[LCGID2] = 0;
|
||||
UE_template->bsr_info[LCGID3] = 0;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
void add_ue_ulsch_info(module_id_t module_idP, int CC_id, int UE_id, sub_frame_t subframeP, UE_ULSCH_STATUS status)
|
||||
{
|
||||
|
||||
@@ -477,66 +528,6 @@ void add_ue_ulsch_info(module_id_t module_idP, int CC_id, int UE_id, sub_frame_t
|
||||
|
||||
}
|
||||
|
||||
// This seems not to be used anymore
|
||||
/*
|
||||
int schedule_next_ulue(module_id_t module_idP, int UE_id, sub_frame_t subframeP){
|
||||
|
||||
int next_ue;
|
||||
|
||||
// first phase: scheduling for ACK
|
||||
switch (subframeP) {
|
||||
// scheduling for subframeP 2: for scheduled user during subframeP 5 and 6
|
||||
case 8:
|
||||
if ((eNB_dlsch_info[module_idP][UE_id].status == S_DL_SCHEDULED) &&
|
||||
(eNB_dlsch_info[module_idP][UE_id].subframe == 5 || eNB_dlsch_info[module_idP][UE_id].subframe == 6)){
|
||||
// set the downlink status
|
||||
eNB_dlsch_info[module_idP][UE_id].status = S_DL_BUFFERED;
|
||||
return UE_id;
|
||||
}
|
||||
break;
|
||||
// scheduling for subframeP 3: for scheduled user during subframeP 7 and 8
|
||||
case 9:
|
||||
if ((eNB_dlsch_info[module_idP][UE_id].status == S_DL_SCHEDULED) &&
|
||||
(eNB_dlsch_info[module_idP][UE_id].subframe == 7 || eNB_dlsch_info[module_idP][UE_id].subframe == 8)){
|
||||
eNB_dlsch_info[module_idP][UE_id].status = S_DL_BUFFERED;
|
||||
return UE_id;
|
||||
}
|
||||
break;
|
||||
// scheduling UL subframeP 4: for scheduled user during subframeP 9 and 0
|
||||
case 0 :
|
||||
if ((eNB_dlsch_info[module_idP][UE_id].status == S_DL_SCHEDULED) &&
|
||||
(eNB_dlsch_info[module_idP][UE_id].subframe == 9 || eNB_dlsch_info[module_idP][UE_id].subframe == 0)){
|
||||
eNB_dlsch_info[module_idP][UE_id].status = S_DL_BUFFERED;
|
||||
return UE_id;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
// second phase
|
||||
for (next_ue=0; next_ue <NUMBER_OF_UE_MAX; next_ue++ ){
|
||||
|
||||
if (eNB_ulsch_info[module_idP][next_ue].status == S_UL_WAITING )
|
||||
return next_ue;
|
||||
else if (eNB_ulsch_info[module_idP][next_ue].status == S_UL_SCHEDULED){
|
||||
eNB_ulsch_info[module_idP][next_ue].status = S_UL_BUFFERED;
|
||||
}
|
||||
}
|
||||
for (next_ue=0; next_ue <NUMBER_OF_UE_MAX; next_ue++ ){
|
||||
if (eNB_ulsch_info[module_idP][next_ue].status != S_UL_NONE )// do this just for active UEs
|
||||
eNB_ulsch_info[module_idP][next_ue].status = S_UL_WAITING;
|
||||
}
|
||||
next_ue = 0;
|
||||
return next_ue;
|
||||
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
unsigned char *parse_ulsch_header(unsigned char *mac_header,
|
||||
unsigned char *num_ce,
|
||||
unsigned char *num_sdu,
|
||||
@@ -691,8 +682,8 @@ void schedule_ulsch_rnti(module_id_t module_idP,
|
||||
uint8_t status = 0;
|
||||
uint8_t rb_table_index = -1;
|
||||
uint16_t TBS = 0;
|
||||
int32_t buffer_occupancy=0;
|
||||
uint32_t cqi_req,cshift,ndi,mcs,rballoc,tpc;
|
||||
// int32_t buffer_occupancy=0;
|
||||
uint32_t cqi_req,cshift,ndi,mcs=0,rballoc,tpc;
|
||||
int32_t normalized_rx_power, target_rx_power=-90;
|
||||
static int32_t tpc_accumulated=0;
|
||||
|
||||
@@ -700,9 +691,11 @@ void schedule_ulsch_rnti(module_id_t module_idP,
|
||||
eNB_MAC_INST *eNB=&eNB_mac_inst[module_idP];
|
||||
UE_list_t *UE_list=&eNB->UE_list;
|
||||
UE_TEMPLATE *UE_template;
|
||||
int rvidx_tab[4] = {0,2,3,1};
|
||||
LTE_DL_FRAME_PARMS *frame_parms;
|
||||
UE_sched_ctrl *UE_sched_ctrl;
|
||||
|
||||
// int rvidx_tab[4] = {0,2,3,1};
|
||||
LTE_DL_FRAME_PARMS *frame_parms;
|
||||
int drop_ue=0;
|
||||
|
||||
// LOG_I(MAC,"entering ulsch preprocesor\n");
|
||||
|
||||
@@ -719,6 +712,8 @@ void schedule_ulsch_rnti(module_id_t module_idP,
|
||||
|
||||
// don't schedule if Msg4 is not received yet
|
||||
if (UE_list->UE_template[UE_PCCID(module_idP,UE_id)][UE_id].configured==FALSE) {
|
||||
LOG_I(MAC,"[eNB %d] frame %d subfarme %d, UE %d: not configured, skipping UE scheduling \n",
|
||||
module_idP,frameP,subframeP,UE_id);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -737,46 +732,57 @@ void schedule_ulsch_rnti(module_id_t module_idP,
|
||||
eNB_UE_stats = mac_xface->get_eNB_UE_stats(module_idP,CC_id,rnti);
|
||||
|
||||
if (eNB_UE_stats==NULL) {
|
||||
LOG_W(MAC,"[eNB %d] frame %d subframe %d, UE %d CC %d: no PHY context\n", module_idP,frameP,subframeP,UE_id,CC_id);
|
||||
LOG_W(MAC,"[eNB %d] frame %d subframe %d, UE %d/%x CC %d: no PHY context\n", module_idP,frameP,subframeP,UE_id,rnti,CC_id);
|
||||
drop_ue=1;
|
||||
continue; // mac_xface->macphy_exit("[MAC][eNB] Cannot find eNB_UE_stats\n");
|
||||
}
|
||||
|
||||
if (drop_ue==1)
|
||||
continue;
|
||||
|
||||
if (CCE_allocation_infeasible(module_idP,CC_id,0,subframeP,aggregation,rnti)) {
|
||||
LOG_W(MAC,"[eNB %d] frame %d subframe %d, UE %d/%x CC %d: not enough nCCE\n", module_idP,frameP,subframeP,UE_id,rnti,CC_id);
|
||||
continue; // break;
|
||||
}
|
||||
|
||||
|
||||
// printf("UE %d/%x is feasible, mode %s\n",UE_id,rnti,mode_string[eNB_UE_stats->mode]);
|
||||
|
||||
if (eNB_UE_stats->mode == PUSCH) { // ue has a ulsch channel
|
||||
|
||||
DCI_pdu = &eNB->common_channels[CC_id].DCI_pdu;
|
||||
UE_template = &UE_list->UE_template[CC_id][UE_id];
|
||||
UE_template = &UE_list->UE_template[CC_id][UE_id];
|
||||
UE_sched_ctrl = &UE_list->UE_sched_ctrl[UE_id];
|
||||
|
||||
if (mac_xface->get_ue_active_harq_pid(module_idP,CC_id,rnti,frameP,subframeP,&harq_pid,&round,openair_harq_UL) == -1 ) {
|
||||
LOG_W(MAC,"[eNB %d] Scheduler Frame %d, subframeP %d: candidate harq_pid from PHY for UE %d CC %d RNTI %x\n",
|
||||
module_idP,frameP,subframeP, UE_id, CC_id, rnti);
|
||||
// NN --> RK: Don't schedule UE if we cannot get harq pid
|
||||
//should we continue or set harq_pid to 0?
|
||||
continue;
|
||||
} else
|
||||
LOG_T(MAC,"[eNB %d] Frame %d, subframeP %d, UE %d CC %d : got harq pid %d round %d (rnti %x,mode %s)\n",
|
||||
module_idP,frameP,subframeP,UE_id,CC_id, harq_pid, round,rnti,mode_string[eNB_UE_stats->mode]);
|
||||
|
||||
//#undef EXMIMO_IOT
|
||||
#ifndef EXMIMO_IOT
|
||||
|
||||
if (((UE_is_to_be_scheduled(module_idP,CC_id,UE_id)>0)) || (round>0) || ((frameP%10)==0))
|
||||
PHY_vars_eNB_g[module_idP][CC_id]->pusch_stats_BO[UE_id][(frameP*10)+subframeP] = UE_template->ul_total_buffer;
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_UE0_BO,PHY_vars_eNB_g[module_idP][CC_id]->pusch_stats_BO[UE_id][(frameP*10)+subframeP]);
|
||||
if (((UE_is_to_be_scheduled(module_idP,CC_id,UE_id)>0)) || (round>0))// || ((frameP%10)==0))
|
||||
// if there is information on bsr of DCCH, DTCH or if there is UL_SR, or if there is a packet to retransmit, or we want to schedule a periodic feedback every 10 frames
|
||||
#else
|
||||
if (round==0)
|
||||
#endif
|
||||
{
|
||||
LOG_D(MAC,"[eNB %d][PUSCH] Frame %d subframe %d Scheduling UE %d/%x in round %d(SR %d,UL_inactivity timer %d,UL_failure timer %d)\n",
|
||||
module_idP,frameP,subframeP,UE_id,rnti,round,UE_template->ul_SR,
|
||||
UE_sched_ctrl->ul_inactivity_timer,
|
||||
UE_sched_ctrl->ul_failure_timer);
|
||||
// reset the scheduling request
|
||||
UE_template->ul_SR = 0;
|
||||
aggregation = process_ue_cqi(module_idP,UE_id); // =2 by default!!
|
||||
aggregation = process_ue_cqi(module_idP,UE_id);
|
||||
status = mac_eNB_get_rrc_status(module_idP,rnti);
|
||||
cqi_req = (status < RRC_CONNECTED)? 0:1;
|
||||
if (status < RRC_CONNECTED)
|
||||
cqi_req = 0;
|
||||
else if (UE_sched_ctrl->cqi_req_timer>30) {
|
||||
cqi_req = 1;
|
||||
UE_sched_ctrl->cqi_req_timer=0;
|
||||
}
|
||||
else
|
||||
cqi_req = 0;
|
||||
|
||||
//power control
|
||||
//compute the expected ULSCH RX power (for the stats)
|
||||
@@ -821,7 +827,9 @@ void schedule_ulsch_rnti(module_id_t module_idP,
|
||||
UE_list->eNB_UE_stats[CC_id][UE_id].target_rx_power=target_rx_power;
|
||||
UE_list->eNB_UE_stats[CC_id][UE_id].ulsch_mcs1=UE_template->pre_assigned_mcs_ul;
|
||||
mcs = cmin (UE_template->pre_assigned_mcs_ul, openair_daq_vars.target_ue_ul_mcs); // adjust, based on user-defined MCS
|
||||
|
||||
if ((cqi_req==1) && (mcs>19)) {
|
||||
mcs=19;
|
||||
}
|
||||
if (UE_template->pre_allocated_rb_table_index_ul >=0) {
|
||||
rb_table_index=UE_template->pre_allocated_rb_table_index_ul;
|
||||
} else {
|
||||
@@ -830,9 +838,10 @@ void schedule_ulsch_rnti(module_id_t module_idP,
|
||||
}
|
||||
|
||||
UE_list->eNB_UE_stats[CC_id][UE_id].ulsch_mcs2=mcs;
|
||||
buffer_occupancy = UE_template->ul_total_buffer;
|
||||
// buffer_occupancy = UE_template->ul_total_buffer;
|
||||
|
||||
while ((rb_table[rb_table_index]>(frame_parms->N_RB_UL-1-first_rb[CC_id])) &&
|
||||
while (((rb_table[rb_table_index]>(frame_parms->N_RB_UL-1-first_rb[CC_id])) ||
|
||||
(rb_table[rb_table_index]>45)) &&
|
||||
(rb_table_index>0)) {
|
||||
rb_table_index--;
|
||||
}
|
||||
@@ -840,25 +849,254 @@ void schedule_ulsch_rnti(module_id_t module_idP,
|
||||
TBS = mac_xface->get_TBS_UL(mcs,rb_table[rb_table_index]);
|
||||
UE_list->eNB_UE_stats[CC_id][UE_id].total_rbs_used_rx+=rb_table[rb_table_index];
|
||||
UE_list->eNB_UE_stats[CC_id][UE_id].ulsch_TBS=TBS;
|
||||
buffer_occupancy -= TBS;
|
||||
// buffer_occupancy -= TBS;
|
||||
rballoc = mac_xface->computeRIV(frame_parms->N_RB_UL,
|
||||
first_rb[CC_id],
|
||||
rb_table[rb_table_index]);
|
||||
// bad indices : 20 (40 PRB), 21 (45 PRB), 22 (48 PRB)
|
||||
// increment for next UE allocation
|
||||
first_rb[CC_id]+=rb_table[rb_table_index];
|
||||
//store for possible retransmission
|
||||
UE_template->nb_rb_ul[harq_pid] = rb_table[rb_table_index];
|
||||
UE_sched_ctrl->ul_scheduled |= (1<<harq_pid);
|
||||
if (UE_id == UE_list->head)
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_UE0_SCHEDULED,UE_sched_ctrl->ul_scheduled);
|
||||
|
||||
LOG_D(MAC,"[eNB %d][PUSCH %d/%x] CC_id %d Frame %d subframeP %d Scheduled UE %d (mcs %d, first rb %d, nb_rb %d, rb_table_index %d, TBS %d, harq_pid %d)\n",
|
||||
if (mac_eNB_get_rrc_status(module_idP,rnti) < RRC_CONNECTED)
|
||||
LOG_I(MAC,"[eNB %d][PUSCH %d/%x] CC_id %d Frame %d subframeP %d Scheduled UE %d (mcs %d, first rb %d, nb_rb %d, rb_table_index %d, TBS %d, harq_pid %d)\n",
|
||||
module_idP,harq_pid,rnti,CC_id,frameP,subframeP,UE_id,mcs,
|
||||
first_rb[CC_id],rb_table[rb_table_index],
|
||||
rb_table_index,TBS,harq_pid);
|
||||
|
||||
// adjust total UL buffer status by TBS, wait for UL sdus to do final update
|
||||
LOG_D(MAC,"[eNB %d] CC_id %d UE %d/%x : adjusting ul_total_buffer, old %d, TBS %d\n", module_idP,CC_id,UE_id,rnti,UE_template->ul_total_buffer,TBS);
|
||||
if (UE_template->ul_total_buffer > TBS)
|
||||
UE_template->ul_total_buffer -= TBS;
|
||||
else
|
||||
UE_template->ul_total_buffer = 0;
|
||||
LOG_D(MAC,"ul_total_buffer, new %d\n", UE_template->ul_total_buffer);
|
||||
// Cyclic shift for DM RS
|
||||
cshift = 0;// values from 0 to 7 can be used for mapping the cyclic shift (36.211 , Table 5.5.2.1.1-1)
|
||||
|
||||
if (frame_parms->frame_type == TDD) {
|
||||
switch (frame_parms->N_RB_UL) {
|
||||
case 6:
|
||||
ULSCH_dci = UE_template->ULSCH_DCI[harq_pid];
|
||||
|
||||
((DCI0_1_5MHz_TDD_1_6_t *)ULSCH_dci)->type = 0;
|
||||
((DCI0_1_5MHz_TDD_1_6_t *)ULSCH_dci)->hopping = 0;
|
||||
((DCI0_1_5MHz_TDD_1_6_t *)ULSCH_dci)->rballoc = rballoc;
|
||||
((DCI0_1_5MHz_TDD_1_6_t *)ULSCH_dci)->mcs = mcs;
|
||||
((DCI0_1_5MHz_TDD_1_6_t *)ULSCH_dci)->ndi = ndi;
|
||||
((DCI0_1_5MHz_TDD_1_6_t *)ULSCH_dci)->TPC = tpc;
|
||||
((DCI0_1_5MHz_TDD_1_6_t *)ULSCH_dci)->cshift = cshift;
|
||||
((DCI0_1_5MHz_TDD_1_6_t *)ULSCH_dci)->padding = 0;
|
||||
((DCI0_1_5MHz_TDD_1_6_t *)ULSCH_dci)->dai = UE_template->DAI_ul[sched_subframe];
|
||||
((DCI0_1_5MHz_TDD_1_6_t *)ULSCH_dci)->cqi_req = cqi_req;
|
||||
|
||||
add_ue_spec_dci(DCI_pdu,
|
||||
ULSCH_dci,
|
||||
rnti,
|
||||
sizeof(DCI0_1_5MHz_TDD_1_6_t),
|
||||
aggregation,
|
||||
sizeof_DCI0_1_5MHz_TDD_1_6_t,
|
||||
format0,
|
||||
0);
|
||||
break;
|
||||
|
||||
default:
|
||||
case 25:
|
||||
ULSCH_dci = UE_template->ULSCH_DCI[harq_pid];
|
||||
|
||||
((DCI0_5MHz_TDD_1_6_t *)ULSCH_dci)->type = 0;
|
||||
((DCI0_5MHz_TDD_1_6_t *)ULSCH_dci)->hopping = 0;
|
||||
((DCI0_5MHz_TDD_1_6_t *)ULSCH_dci)->rballoc = rballoc;
|
||||
((DCI0_5MHz_TDD_1_6_t *)ULSCH_dci)->mcs = mcs;
|
||||
((DCI0_5MHz_TDD_1_6_t *)ULSCH_dci)->ndi = ndi;
|
||||
((DCI0_5MHz_TDD_1_6_t *)ULSCH_dci)->TPC = tpc;
|
||||
((DCI0_5MHz_TDD_1_6_t *)ULSCH_dci)->cshift = cshift;
|
||||
((DCI0_5MHz_TDD_1_6_t *)ULSCH_dci)->padding = 0;
|
||||
((DCI0_5MHz_TDD_1_6_t *)ULSCH_dci)->dai = UE_template->DAI_ul[sched_subframe];
|
||||
((DCI0_5MHz_TDD_1_6_t *)ULSCH_dci)->cqi_req = cqi_req;
|
||||
|
||||
add_ue_spec_dci(DCI_pdu,
|
||||
ULSCH_dci,
|
||||
rnti,
|
||||
sizeof(DCI0_5MHz_TDD_1_6_t),
|
||||
aggregation,
|
||||
sizeof_DCI0_5MHz_TDD_1_6_t,
|
||||
format0,
|
||||
0);
|
||||
break;
|
||||
|
||||
case 50:
|
||||
ULSCH_dci = UE_template->ULSCH_DCI[harq_pid];
|
||||
|
||||
((DCI0_10MHz_TDD_1_6_t *)ULSCH_dci)->type = 0;
|
||||
((DCI0_10MHz_TDD_1_6_t *)ULSCH_dci)->hopping = 0;
|
||||
((DCI0_10MHz_TDD_1_6_t *)ULSCH_dci)->rballoc = rballoc;
|
||||
((DCI0_10MHz_TDD_1_6_t *)ULSCH_dci)->mcs = mcs;
|
||||
((DCI0_10MHz_TDD_1_6_t *)ULSCH_dci)->ndi = ndi;
|
||||
((DCI0_10MHz_TDD_1_6_t *)ULSCH_dci)->TPC = tpc;
|
||||
((DCI0_10MHz_TDD_1_6_t *)ULSCH_dci)->cshift = cshift;
|
||||
((DCI0_10MHz_TDD_1_6_t *)ULSCH_dci)->padding = 0;
|
||||
((DCI0_10MHz_TDD_1_6_t *)ULSCH_dci)->dai = UE_template->DAI_ul[sched_subframe];
|
||||
((DCI0_10MHz_TDD_1_6_t *)ULSCH_dci)->cqi_req = cqi_req;
|
||||
|
||||
add_ue_spec_dci(DCI_pdu,
|
||||
ULSCH_dci,
|
||||
rnti,
|
||||
sizeof(DCI0_10MHz_TDD_1_6_t),
|
||||
aggregation,
|
||||
sizeof_DCI0_10MHz_TDD_1_6_t,
|
||||
format0,
|
||||
0);
|
||||
break;
|
||||
|
||||
case 100:
|
||||
ULSCH_dci = UE_template->ULSCH_DCI[harq_pid];
|
||||
|
||||
((DCI0_20MHz_TDD_1_6_t *)ULSCH_dci)->type = 0;
|
||||
((DCI0_20MHz_TDD_1_6_t *)ULSCH_dci)->hopping = 0;
|
||||
((DCI0_20MHz_TDD_1_6_t *)ULSCH_dci)->rballoc = rballoc;
|
||||
((DCI0_20MHz_TDD_1_6_t *)ULSCH_dci)->mcs = mcs;
|
||||
((DCI0_20MHz_TDD_1_6_t *)ULSCH_dci)->ndi = ndi;
|
||||
((DCI0_20MHz_TDD_1_6_t *)ULSCH_dci)->TPC = tpc;
|
||||
((DCI0_20MHz_TDD_1_6_t *)ULSCH_dci)->cshift = cshift;
|
||||
((DCI0_20MHz_TDD_1_6_t *)ULSCH_dci)->padding = 0;
|
||||
((DCI0_20MHz_TDD_1_6_t *)ULSCH_dci)->dai = UE_template->DAI_ul[sched_subframe];
|
||||
((DCI0_20MHz_TDD_1_6_t *)ULSCH_dci)->cqi_req = cqi_req;
|
||||
|
||||
add_ue_spec_dci(DCI_pdu,
|
||||
ULSCH_dci,
|
||||
rnti,
|
||||
sizeof(DCI0_20MHz_TDD_1_6_t),
|
||||
aggregation,
|
||||
sizeof_DCI0_20MHz_TDD_1_6_t,
|
||||
format0,
|
||||
0);
|
||||
break;
|
||||
}
|
||||
} // TDD
|
||||
else { //FDD
|
||||
switch (frame_parms->N_RB_UL) {
|
||||
case 25:
|
||||
default:
|
||||
|
||||
ULSCH_dci = UE_template->ULSCH_DCI[harq_pid];
|
||||
|
||||
((DCI0_5MHz_FDD_t *)ULSCH_dci)->type = 0;
|
||||
((DCI0_5MHz_FDD_t *)ULSCH_dci)->hopping = 0;
|
||||
((DCI0_5MHz_FDD_t *)ULSCH_dci)->rballoc = rballoc;
|
||||
((DCI0_5MHz_FDD_t *)ULSCH_dci)->mcs = mcs;
|
||||
((DCI0_5MHz_FDD_t *)ULSCH_dci)->ndi = ndi;
|
||||
((DCI0_5MHz_FDD_t *)ULSCH_dci)->TPC = tpc;
|
||||
((DCI0_5MHz_FDD_t *)ULSCH_dci)->cshift = cshift;
|
||||
((DCI0_5MHz_FDD_t *)ULSCH_dci)->padding = 0;
|
||||
((DCI0_5MHz_FDD_t *)ULSCH_dci)->cqi_req = cqi_req;
|
||||
|
||||
add_ue_spec_dci(DCI_pdu,
|
||||
ULSCH_dci,
|
||||
rnti,
|
||||
sizeof(DCI0_5MHz_FDD_t),
|
||||
aggregation,
|
||||
sizeof_DCI0_5MHz_FDD_t,
|
||||
format0,
|
||||
0);
|
||||
break;
|
||||
|
||||
case 6:
|
||||
ULSCH_dci = UE_template->ULSCH_DCI[harq_pid];
|
||||
|
||||
((DCI0_1_5MHz_FDD_t *)ULSCH_dci)->type = 0;
|
||||
((DCI0_1_5MHz_FDD_t *)ULSCH_dci)->hopping = 0;
|
||||
((DCI0_1_5MHz_FDD_t *)ULSCH_dci)->rballoc = rballoc;
|
||||
((DCI0_1_5MHz_FDD_t *)ULSCH_dci)->mcs = mcs;
|
||||
((DCI0_1_5MHz_FDD_t *)ULSCH_dci)->ndi = ndi;
|
||||
((DCI0_1_5MHz_FDD_t *)ULSCH_dci)->TPC = tpc;
|
||||
((DCI0_1_5MHz_FDD_t *)ULSCH_dci)->cshift = cshift;
|
||||
((DCI0_1_5MHz_FDD_t *)ULSCH_dci)->padding = 0;
|
||||
((DCI0_1_5MHz_FDD_t *)ULSCH_dci)->cqi_req = cqi_req;
|
||||
|
||||
add_ue_spec_dci(DCI_pdu,
|
||||
ULSCH_dci,
|
||||
rnti,
|
||||
sizeof(DCI0_1_5MHz_FDD_t),
|
||||
aggregation,
|
||||
sizeof_DCI0_1_5MHz_FDD_t,
|
||||
format0,
|
||||
0);
|
||||
break;
|
||||
|
||||
case 50:
|
||||
ULSCH_dci = UE_template->ULSCH_DCI[harq_pid];
|
||||
|
||||
((DCI0_10MHz_FDD_t *)ULSCH_dci)->type = 0;
|
||||
((DCI0_10MHz_FDD_t *)ULSCH_dci)->hopping = 0;
|
||||
((DCI0_10MHz_FDD_t *)ULSCH_dci)->rballoc = rballoc;
|
||||
((DCI0_10MHz_FDD_t *)ULSCH_dci)->mcs = mcs;
|
||||
((DCI0_10MHz_FDD_t *)ULSCH_dci)->ndi = ndi;
|
||||
((DCI0_10MHz_FDD_t *)ULSCH_dci)->TPC = tpc;
|
||||
((DCI0_10MHz_FDD_t *)ULSCH_dci)->padding = 0;
|
||||
((DCI0_10MHz_FDD_t *)ULSCH_dci)->cshift = cshift;
|
||||
((DCI0_10MHz_FDD_t *)ULSCH_dci)->cqi_req = cqi_req;
|
||||
|
||||
add_ue_spec_dci(DCI_pdu,
|
||||
ULSCH_dci,
|
||||
rnti,
|
||||
sizeof(DCI0_10MHz_FDD_t),
|
||||
aggregation,
|
||||
sizeof_DCI0_10MHz_FDD_t,
|
||||
format0,
|
||||
0);
|
||||
break;
|
||||
|
||||
case 100:
|
||||
ULSCH_dci = UE_template->ULSCH_DCI[harq_pid];
|
||||
|
||||
((DCI0_20MHz_FDD_t *)ULSCH_dci)->type = 0;
|
||||
((DCI0_20MHz_FDD_t *)ULSCH_dci)->hopping = 0;
|
||||
((DCI0_20MHz_FDD_t *)ULSCH_dci)->rballoc = rballoc;
|
||||
((DCI0_20MHz_FDD_t *)ULSCH_dci)->mcs = mcs;
|
||||
((DCI0_20MHz_FDD_t *)ULSCH_dci)->ndi = ndi;
|
||||
((DCI0_20MHz_FDD_t *)ULSCH_dci)->TPC = tpc;
|
||||
((DCI0_20MHz_FDD_t *)ULSCH_dci)->padding = 0;
|
||||
((DCI0_20MHz_FDD_t *)ULSCH_dci)->cshift = cshift;
|
||||
((DCI0_20MHz_FDD_t *)ULSCH_dci)->cqi_req = cqi_req;
|
||||
|
||||
add_ue_spec_dci(DCI_pdu,
|
||||
ULSCH_dci,
|
||||
rnti,
|
||||
sizeof(DCI0_20MHz_FDD_t),
|
||||
aggregation,
|
||||
sizeof_DCI0_20MHz_FDD_t,
|
||||
format0,
|
||||
0);
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
add_ue_ulsch_info(module_idP,
|
||||
CC_id,
|
||||
UE_id,
|
||||
subframeP,
|
||||
S_UL_SCHEDULED);
|
||||
|
||||
LOG_D(MAC,"[eNB %d] CC_id %d Frame %d, subframeP %d: Generated ULSCH DCI for next UE_id %d, format 0\n", module_idP,CC_id,frameP,subframeP,UE_id);
|
||||
#ifdef DEBUG
|
||||
dump_dci(frame_parms, &DCI_pdu->dci_alloc[DCI_pdu->Num_common_dci+DCI_pdu->Num_ue_spec_dci-1]);
|
||||
#endif
|
||||
|
||||
}
|
||||
else {
|
||||
LOG_D(MAC,"[eNB %d][PUSCH %d/%x] CC_id %d Frame %d subframeP %d Scheduled (PHICH) UE %d (mcs %d, first rb %d, nb_rb %d, rb_table_index %d, TBS %d, harq_pid %d,round %d)\n",
|
||||
module_idP,harq_pid,rnti,CC_id,frameP,subframeP,UE_id,mcs,
|
||||
first_rb[CC_id],rb_table[rb_table_index],
|
||||
rb_table_index,TBS,harq_pid);
|
||||
// Adjust BSR entries for LCGIDs
|
||||
adjust_bsr_info(buffer_occupancy,
|
||||
TBS,
|
||||
UE_template);
|
||||
|
||||
} else if (round > 0) { //we schedule a retransmission
|
||||
rb_table_index,TBS,harq_pid,round);
|
||||
}/*
|
||||
else if (round > 0) { //we schedule a retransmission
|
||||
|
||||
ndi = UE_template->oldNDI_UL[harq_pid];
|
||||
|
||||
@@ -869,7 +1107,7 @@ void schedule_ulsch_rnti(module_id_t module_idP,
|
||||
|
||||
}
|
||||
|
||||
LOG_D(MAC,"[eNB %d][PUSCH %d/%x] CC_id %d Frame %d subframeP %d Scheduled UE retransmission (mcs %d, first rb %d, nb_rb %d, harq_pid %d, round %d)\n",
|
||||
LOG_I(MAC,"[eNB %d][PUSCH %d/%x] CC_id %d Frame %d subframeP %d Scheduled UE retransmission (mcs %d, first rb %d, nb_rb %d, harq_pid %d, round %d)\n",
|
||||
module_idP,UE_id,rnti,CC_id,frameP,subframeP,mcs,
|
||||
first_rb[CC_id],UE_template->nb_rb_ul[harq_pid],
|
||||
harq_pid, round);
|
||||
@@ -885,227 +1123,7 @@ void schedule_ulsch_rnti(module_id_t module_idP,
|
||||
UE_list->eNB_UE_stats[CC_id][UE_id].ulsch_mcs1=mcs;
|
||||
UE_list->eNB_UE_stats[CC_id][UE_id].ulsch_mcs2=mcs;
|
||||
}
|
||||
|
||||
// Cyclic shift for DM RS
|
||||
if(cooperation_flag == 2) {
|
||||
if(UE_id == 1) { // For Distriibuted Alamouti, cyclic shift applied to 2nd UE
|
||||
cshift = 1;
|
||||
} else {
|
||||
cshift = 0;
|
||||
}
|
||||
} else {
|
||||
cshift = 0;// values from 0 to 7 can be used for mapping the cyclic shift (36.211 , Table 5.5.2.1.1-1)
|
||||
}
|
||||
|
||||
if (frame_parms->frame_type == TDD) {
|
||||
switch (frame_parms->N_RB_UL) {
|
||||
case 6:
|
||||
ULSCH_dci = UE_template->ULSCH_DCI[harq_pid];
|
||||
|
||||
((DCI0_1_5MHz_TDD_1_6_t *)ULSCH_dci)->type = 0;
|
||||
((DCI0_1_5MHz_TDD_1_6_t *)ULSCH_dci)->hopping = 0;
|
||||
((DCI0_1_5MHz_TDD_1_6_t *)ULSCH_dci)->rballoc = rballoc;
|
||||
((DCI0_1_5MHz_TDD_1_6_t *)ULSCH_dci)->mcs = mcs;
|
||||
((DCI0_1_5MHz_TDD_1_6_t *)ULSCH_dci)->ndi = ndi;
|
||||
((DCI0_1_5MHz_TDD_1_6_t *)ULSCH_dci)->TPC = tpc;
|
||||
((DCI0_1_5MHz_TDD_1_6_t *)ULSCH_dci)->cshift = cshift;
|
||||
((DCI0_1_5MHz_TDD_1_6_t *)ULSCH_dci)->padding = 0;
|
||||
((DCI0_1_5MHz_TDD_1_6_t *)ULSCH_dci)->dai = UE_template->DAI_ul[sched_subframe];
|
||||
((DCI0_1_5MHz_TDD_1_6_t *)ULSCH_dci)->cqi_req = cqi_req;
|
||||
|
||||
add_ue_spec_dci(DCI_pdu,
|
||||
ULSCH_dci,
|
||||
rnti,
|
||||
sizeof(DCI0_1_5MHz_TDD_1_6_t),
|
||||
aggregation,
|
||||
sizeof_DCI0_1_5MHz_TDD_1_6_t,
|
||||
format0,
|
||||
0);
|
||||
break;
|
||||
|
||||
default:
|
||||
case 25:
|
||||
ULSCH_dci = UE_template->ULSCH_DCI[harq_pid];
|
||||
|
||||
((DCI0_5MHz_TDD_1_6_t *)ULSCH_dci)->type = 0;
|
||||
((DCI0_5MHz_TDD_1_6_t *)ULSCH_dci)->hopping = 0;
|
||||
((DCI0_5MHz_TDD_1_6_t *)ULSCH_dci)->rballoc = rballoc;
|
||||
((DCI0_5MHz_TDD_1_6_t *)ULSCH_dci)->mcs = mcs;
|
||||
((DCI0_5MHz_TDD_1_6_t *)ULSCH_dci)->ndi = ndi;
|
||||
((DCI0_5MHz_TDD_1_6_t *)ULSCH_dci)->TPC = tpc;
|
||||
((DCI0_5MHz_TDD_1_6_t *)ULSCH_dci)->cshift = cshift;
|
||||
((DCI0_5MHz_TDD_1_6_t *)ULSCH_dci)->padding = 0;
|
||||
((DCI0_5MHz_TDD_1_6_t *)ULSCH_dci)->dai = UE_template->DAI_ul[sched_subframe];
|
||||
((DCI0_5MHz_TDD_1_6_t *)ULSCH_dci)->cqi_req = cqi_req;
|
||||
|
||||
add_ue_spec_dci(DCI_pdu,
|
||||
ULSCH_dci,
|
||||
rnti,
|
||||
sizeof(DCI0_5MHz_TDD_1_6_t),
|
||||
aggregation,
|
||||
sizeof_DCI0_5MHz_TDD_1_6_t,
|
||||
format0,
|
||||
0);
|
||||
break;
|
||||
|
||||
case 50:
|
||||
ULSCH_dci = UE_template->ULSCH_DCI[harq_pid];
|
||||
|
||||
((DCI0_10MHz_TDD_1_6_t *)ULSCH_dci)->type = 0;
|
||||
((DCI0_10MHz_TDD_1_6_t *)ULSCH_dci)->hopping = 0;
|
||||
((DCI0_10MHz_TDD_1_6_t *)ULSCH_dci)->rballoc = rballoc;
|
||||
((DCI0_10MHz_TDD_1_6_t *)ULSCH_dci)->mcs = mcs;
|
||||
((DCI0_10MHz_TDD_1_6_t *)ULSCH_dci)->ndi = ndi;
|
||||
((DCI0_10MHz_TDD_1_6_t *)ULSCH_dci)->TPC = tpc;
|
||||
((DCI0_10MHz_TDD_1_6_t *)ULSCH_dci)->cshift = cshift;
|
||||
((DCI0_10MHz_TDD_1_6_t *)ULSCH_dci)->padding = 0;
|
||||
((DCI0_10MHz_TDD_1_6_t *)ULSCH_dci)->dai = UE_template->DAI_ul[sched_subframe];
|
||||
((DCI0_10MHz_TDD_1_6_t *)ULSCH_dci)->cqi_req = cqi_req;
|
||||
|
||||
add_ue_spec_dci(DCI_pdu,
|
||||
ULSCH_dci,
|
||||
rnti,
|
||||
sizeof(DCI0_10MHz_TDD_1_6_t),
|
||||
aggregation,
|
||||
sizeof_DCI0_10MHz_TDD_1_6_t,
|
||||
format0,
|
||||
0);
|
||||
break;
|
||||
|
||||
case 100:
|
||||
ULSCH_dci = UE_template->ULSCH_DCI[harq_pid];
|
||||
|
||||
((DCI0_20MHz_TDD_1_6_t *)ULSCH_dci)->type = 0;
|
||||
((DCI0_20MHz_TDD_1_6_t *)ULSCH_dci)->hopping = 0;
|
||||
((DCI0_20MHz_TDD_1_6_t *)ULSCH_dci)->rballoc = rballoc;
|
||||
((DCI0_20MHz_TDD_1_6_t *)ULSCH_dci)->mcs = mcs;
|
||||
((DCI0_20MHz_TDD_1_6_t *)ULSCH_dci)->ndi = ndi;
|
||||
((DCI0_20MHz_TDD_1_6_t *)ULSCH_dci)->TPC = tpc;
|
||||
((DCI0_20MHz_TDD_1_6_t *)ULSCH_dci)->cshift = cshift;
|
||||
((DCI0_10MHz_TDD_1_6_t *)ULSCH_dci)->padding = 0;
|
||||
((DCI0_20MHz_TDD_1_6_t *)ULSCH_dci)->dai = UE_template->DAI_ul[sched_subframe];
|
||||
((DCI0_20MHz_TDD_1_6_t *)ULSCH_dci)->cqi_req = cqi_req;
|
||||
|
||||
add_ue_spec_dci(DCI_pdu,
|
||||
ULSCH_dci,
|
||||
rnti,
|
||||
sizeof(DCI0_20MHz_TDD_1_6_t),
|
||||
aggregation,
|
||||
sizeof_DCI0_20MHz_TDD_1_6_t,
|
||||
format0,
|
||||
0);
|
||||
break;
|
||||
}
|
||||
} // TDD
|
||||
else { //FDD
|
||||
switch (frame_parms->N_RB_UL) {
|
||||
case 25:
|
||||
default:
|
||||
|
||||
ULSCH_dci = UE_template->ULSCH_DCI[harq_pid];
|
||||
|
||||
((DCI0_5MHz_FDD_t *)ULSCH_dci)->type = 0;
|
||||
((DCI0_5MHz_FDD_t *)ULSCH_dci)->hopping = 0;
|
||||
((DCI0_5MHz_FDD_t *)ULSCH_dci)->rballoc = rballoc;
|
||||
((DCI0_5MHz_FDD_t *)ULSCH_dci)->mcs = mcs;
|
||||
((DCI0_5MHz_FDD_t *)ULSCH_dci)->ndi = ndi;
|
||||
((DCI0_5MHz_FDD_t *)ULSCH_dci)->TPC = tpc;
|
||||
((DCI0_5MHz_FDD_t *)ULSCH_dci)->cshift = cshift;
|
||||
((DCI0_5MHz_FDD_t *)ULSCH_dci)->padding = 0;
|
||||
((DCI0_5MHz_FDD_t *)ULSCH_dci)->cqi_req = cqi_req;
|
||||
|
||||
add_ue_spec_dci(DCI_pdu,
|
||||
ULSCH_dci,
|
||||
rnti,
|
||||
sizeof(DCI0_5MHz_FDD_t),
|
||||
aggregation,
|
||||
sizeof_DCI0_5MHz_FDD_t,
|
||||
format0,
|
||||
0);
|
||||
break;
|
||||
|
||||
case 6:
|
||||
ULSCH_dci = UE_template->ULSCH_DCI[harq_pid];
|
||||
|
||||
((DCI0_1_5MHz_FDD_t *)ULSCH_dci)->type = 0;
|
||||
((DCI0_1_5MHz_FDD_t *)ULSCH_dci)->hopping = 0;
|
||||
((DCI0_1_5MHz_FDD_t *)ULSCH_dci)->rballoc = rballoc;
|
||||
((DCI0_1_5MHz_FDD_t *)ULSCH_dci)->mcs = mcs;
|
||||
((DCI0_1_5MHz_FDD_t *)ULSCH_dci)->ndi = ndi;
|
||||
((DCI0_1_5MHz_FDD_t *)ULSCH_dci)->TPC = tpc;
|
||||
((DCI0_1_5MHz_FDD_t *)ULSCH_dci)->cshift = cshift;
|
||||
((DCI0_1_5MHz_FDD_t *)ULSCH_dci)->padding = 0;
|
||||
((DCI0_1_5MHz_FDD_t *)ULSCH_dci)->cqi_req = cqi_req;
|
||||
|
||||
add_ue_spec_dci(DCI_pdu,
|
||||
ULSCH_dci,
|
||||
rnti,
|
||||
sizeof(DCI0_1_5MHz_FDD_t),
|
||||
aggregation,
|
||||
sizeof_DCI0_1_5MHz_FDD_t,
|
||||
format0,
|
||||
0);
|
||||
break;
|
||||
|
||||
case 50:
|
||||
ULSCH_dci = UE_template->ULSCH_DCI[harq_pid];
|
||||
|
||||
((DCI0_10MHz_FDD_t *)ULSCH_dci)->type = 0;
|
||||
((DCI0_10MHz_FDD_t *)ULSCH_dci)->hopping = 0;
|
||||
((DCI0_10MHz_FDD_t *)ULSCH_dci)->rballoc = rballoc;
|
||||
((DCI0_10MHz_FDD_t *)ULSCH_dci)->mcs = mcs;
|
||||
((DCI0_10MHz_FDD_t *)ULSCH_dci)->ndi = ndi;
|
||||
((DCI0_10MHz_FDD_t *)ULSCH_dci)->TPC = tpc;
|
||||
((DCI0_10MHz_FDD_t *)ULSCH_dci)->padding = 0;
|
||||
((DCI0_10MHz_FDD_t *)ULSCH_dci)->cshift = cshift;
|
||||
((DCI0_10MHz_FDD_t *)ULSCH_dci)->cqi_req = cqi_req;
|
||||
|
||||
add_ue_spec_dci(DCI_pdu,
|
||||
ULSCH_dci,
|
||||
rnti,
|
||||
sizeof(DCI0_10MHz_FDD_t),
|
||||
aggregation,
|
||||
sizeof_DCI0_10MHz_FDD_t,
|
||||
format0,
|
||||
0);
|
||||
break;
|
||||
|
||||
case 100:
|
||||
ULSCH_dci = UE_template->ULSCH_DCI[harq_pid];
|
||||
|
||||
((DCI0_20MHz_FDD_t *)ULSCH_dci)->type = 0;
|
||||
((DCI0_20MHz_FDD_t *)ULSCH_dci)->hopping = 0;
|
||||
((DCI0_20MHz_FDD_t *)ULSCH_dci)->rballoc = rballoc;
|
||||
((DCI0_20MHz_FDD_t *)ULSCH_dci)->mcs = mcs;
|
||||
((DCI0_20MHz_FDD_t *)ULSCH_dci)->ndi = ndi;
|
||||
((DCI0_20MHz_FDD_t *)ULSCH_dci)->TPC = tpc;
|
||||
((DCI0_20MHz_FDD_t *)ULSCH_dci)->padding = 0;
|
||||
((DCI0_20MHz_FDD_t *)ULSCH_dci)->cshift = cshift;
|
||||
((DCI0_20MHz_FDD_t *)ULSCH_dci)->cqi_req = cqi_req;
|
||||
|
||||
add_ue_spec_dci(DCI_pdu,
|
||||
ULSCH_dci,
|
||||
rnti,
|
||||
sizeof(DCI0_20MHz_FDD_t),
|
||||
aggregation,
|
||||
sizeof_DCI0_20MHz_FDD_t,
|
||||
format0,
|
||||
0);
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
add_ue_ulsch_info(module_idP,
|
||||
CC_id,
|
||||
UE_id,
|
||||
subframeP,
|
||||
S_UL_SCHEDULED);
|
||||
|
||||
LOG_D(MAC,"[eNB %d] CC_id %d Frame %d, subframeP %d: Generated ULSCH DCI for next UE_id %d, format 0\n", module_idP,CC_id,frameP,subframeP,UE_id);
|
||||
#ifdef DEBUG
|
||||
dump_dci(frame_parms, &DCI_pdu->dci_alloc[DCI_pdu->Num_common_dci+DCI_pdu->Num_ue_spec_dci-1]);
|
||||
#endif
|
||||
*/
|
||||
|
||||
} // UE_is_to_be_scheduled
|
||||
} // UE is in PUSCH
|
||||
@@ -1188,7 +1206,7 @@ void schedule_ulsch_cba_rnti(module_id_t module_idP, unsigned char cooperation_f
|
||||
|
||||
// simple UE identity based grouping
|
||||
if ((UE_id % total_groups) == cba_group) { // this could be simplifed to active_UEs[UE_id % total_groups]++;
|
||||
if ((mac_get_rrc_status(module_idP,1,UE_id) > RRC_CONNECTED) &&
|
||||
if ((mac_eNB_get_rrc_status(module_idP,rnti) > RRC_CONNECTED) &&
|
||||
(UE_is_to_be_scheduled(module_idP,CC_id,UE_id) == 0)) {
|
||||
active_UEs[cba_group]++;
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user