Commit 7a724e7d authored by Cedric Roux's avatar Cedric Roux

Merge remote-tracking branch 'origin/develop' into feature-131-new-license

Conflicts:
	openair1/PHY/INIT/lte_init.c
	openair1/PHY/LTE_TRANSPORT/dci_tools.c
	openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c
	openair1/SCHED/phy_procedures_lte_eNb.c
	openair1/SCHED/phy_procedures_lte_ue.c
	openair1/SIMULATION/LTE_PHY/dlsim.c
	openair1/SIMULATION/RF/adc.c
	openair2/LAYER2/MAC/lte_transport_init.c
	targets/RT/USER/lte-softmodem.c
	targets/RT/USER/sched_dlsch.c
	targets/RT/USER/sched_rx_pdsch.c
	targets/RT/USER/sched_ulsch.c
	targets/SIMU/USER/oaisim.c
parents f06dd02f e08e2577
...@@ -179,7 +179,7 @@ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-rpath -Wl,${CMAKE_CU ...@@ -179,7 +179,7 @@ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-rpath -Wl,${CMAKE_CU
# these changes are related to hardcoded path to include .h files # these changes are related to hardcoded path to include .h files
add_definitions(-DCMAKER) add_definitions(-DCMAKER)
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS} -g -DMALLOC_CHECK_=3") set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS} -g -DMALLOC_CHECK_=3")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS} -g -DMALLOC_CHECK_=3 -O3") set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS} -g -DMALLOC_CHECK_=3 -O2")
set(GIT_BRANCH "UNKNOWN") set(GIT_BRANCH "UNKNOWN")
...@@ -262,15 +262,7 @@ if (${ENABLE_ITTI}) ...@@ -262,15 +262,7 @@ if (${ENABLE_ITTI})
endif (${ENABLE_ITTI}) endif (${ENABLE_ITTI})
add_boolean_option(RTAI False "Use RTAI") add_boolean_option(RTAI False "Use RTAI")
if (${RTAI})
set(DEADLINE_SCHEDULER False)
set(CPU_AFFINITY False)
add_definitions("-DENABLE_RTAI_CLOCK")
add_definitions("-DCONFIG_RTAI_LXRT_INLINE")
include_directories ("/usr/realtime/include")
include_directories ("/usr/realtime/include/asm")
set(RTAI_SOURCE sched_dlsch.c sched_rx_pdsch.c rt_wrapper.c vcd_signal_dumper.c log.c)
endif (${RTAI})
############################# #############################
# ASN.1 grammar C code generation & dependancies # ASN.1 grammar C code generation & dependancies
...@@ -505,7 +497,7 @@ include_directories ("${OPENAIR_TARGETS}/ARCH/EXMIMO/DEFS/") ...@@ -505,7 +497,7 @@ include_directories ("${OPENAIR_TARGETS}/ARCH/EXMIMO/DEFS/")
#set (option_HWEXMIMOLIB_lib "-l ") #set (option_HWEXMIMOLIB_lib "-l ")
set(HWLIB_EXMIMO_SOURCE set(HWLIB_EXMIMO_SOURCE
${OPENAIR_TARGETS}/ARCH/EXMIMO/USERSPACE/LIB/openair0_lib.c ${OPENAIR_TARGETS}/ARCH/EXMIMO/USERSPACE/LIB/openair0_lib.c
${OPENAIR_TARGETS}/ARCH/EXMIMO/USERSPACE/LIB/gain_control.c # ${OPENAIR_TARGETS}/ARCH/EXMIMO/USERSPACE/LIB/gain_control.c
) )
add_library(oai_exmimodevif MODULE ${HWLIB_EXMIMO_SOURCE} ) add_library(oai_exmimodevif MODULE ${HWLIB_EXMIMO_SOURCE} )
...@@ -546,8 +538,8 @@ if (${RF_BOARD} STREQUAL "EXMIMO") ...@@ -546,8 +538,8 @@ if (${RF_BOARD} STREQUAL "EXMIMO")
include_directories ("${OPENAIR_TARGETS}/ARCH/EXMIMO/USERSPACE/LIB/") include_directories ("${OPENAIR_TARGETS}/ARCH/EXMIMO/USERSPACE/LIB/")
include_directories ("${OPENAIR_TARGETS}/ARCH/EXMIMO/DEFS/") include_directories ("${OPENAIR_TARGETS}/ARCH/EXMIMO/DEFS/")
set(HW_SOURCE ${HW_SOURCE} set(HW_SOURCE ${HW_SOURCE}
${OPENAIR_TARGETS}/ARCH/EXMIMO/USERSPACE/LIB/openair0_lib.c ${OPENAIR_TARGETS}/ARCH/EXMIMO/USERSPACE/LIB/openair0_lib.c)
${OPENAIR_TARGETS}/ARCH/EXMIMO/USERSPACE/LIB/gain_control.c) # ${OPENAIR_TARGETS}/ARCH/EXMIMO/USERSPACE/LIB/gain_control.c)
set(option_HW_lib "-rdynamic -ldl") set(option_HW_lib "-rdynamic -ldl")
elseif (${RF_BOARD} STREQUAL "OAI_USRP") elseif (${RF_BOARD} STREQUAL "OAI_USRP")
...@@ -628,6 +620,7 @@ add_boolean_option(NAS_ADDRESS_FIX False "specific to oaisim: for nasmesh driver ...@@ -628,6 +620,7 @@ 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(NAS_NETLINK False "???? Must be True to compile nasmesh driver without rtai")
add_boolean_option(OAISIM False "specific to oaisim") add_boolean_option(OAISIM False "specific to oaisim")
add_boolean_option(OAI_NW_DRIVER_USE_NETLINK True "????") add_boolean_option(OAI_NW_DRIVER_USE_NETLINK True "????")
add_boolean_option(USE_MME False "this flag is used only one time in lte-softmodem.c") add_boolean_option(USE_MME False "this flag is used only one time in lte-softmodem.c")
add_list_string_option(PACKAGE_NAME "NotDefined" "As per attribute name") add_list_string_option(PACKAGE_NAME "NotDefined" "As per attribute name")
add_boolean_option(MESSAGE_CHART_GENERATOR False "For generating sequence diagrams") add_boolean_option(MESSAGE_CHART_GENERATOR False "For generating sequence diagrams")
...@@ -968,6 +961,7 @@ set(PHY_SRC ...@@ -968,6 +961,7 @@ set(PHY_SRC
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/pucch.c ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/pucch.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/prach.c ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/prach.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/pmch.c ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/pmch.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/pch.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/group_hopping.c ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/group_hopping.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/srs_modulation.c ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/srs_modulation.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/drs_modulation.c ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/drs_modulation.c
...@@ -978,6 +972,8 @@ set(PHY_SRC ...@@ -978,6 +972,8 @@ set(PHY_SRC
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/rar_tools.c ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/rar_tools.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/print_stats.c ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/print_stats.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/initial_sync.c ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/initial_sync.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/if4_tools.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/if5_tools.c
${OPENAIR1_DIR}/PHY/MODULATION/ofdm_mod.c ${OPENAIR1_DIR}/PHY/MODULATION/ofdm_mod.c
${OPENAIR1_DIR}/PHY/MODULATION/slot_fep.c ${OPENAIR1_DIR}/PHY/MODULATION/slot_fep.c
${OPENAIR1_DIR}/PHY/MODULATION/slot_fep_mbsfn.c ${OPENAIR1_DIR}/PHY/MODULATION/slot_fep_mbsfn.c
...@@ -1614,10 +1610,9 @@ add_executable(lte-softmodem ...@@ -1614,10 +1610,9 @@ add_executable(lte-softmodem
${rrc_h} ${rrc_h}
${s1ap_h} ${s1ap_h}
${OPENAIR_BIN_DIR}/messages_xml.h ${OPENAIR_BIN_DIR}/messages_xml.h
${OPENAIR_TARGETS}/RT/USER/sched_dlsch.c
${OPENAIR_TARGETS}/RT/USER/sched_rx_pdsch.c
${OPENAIR_TARGETS}/RT/USER/rt_wrapper.c ${OPENAIR_TARGETS}/RT/USER/rt_wrapper.c
${OPENAIR_TARGETS}/RT/USER/lte-ue.c ${OPENAIR_TARGETS}/RT/USER/lte-ue.c
${OPENAIR_TARGETS}/RT/USER/lte-enb.c
${OPENAIR_TARGETS}/RT/USER/lte-softmodem.c ${OPENAIR_TARGETS}/RT/USER/lte-softmodem.c
${OPENAIR1_DIR}/SIMULATION/TOOLS/taus.c ${OPENAIR1_DIR}/SIMULATION/TOOLS/taus.c
${OPENAIR_TARGETS}/SIMU/USER/init_lte.c ${OPENAIR_TARGETS}/SIMU/USER/init_lte.c
...@@ -1650,10 +1645,9 @@ add_executable(lte-softmodem-nos1 ...@@ -1650,10 +1645,9 @@ add_executable(lte-softmodem-nos1
${rrc_h} ${rrc_h}
${s1ap_h} ${s1ap_h}
${OPENAIR_BIN_DIR}/messages_xml.h ${OPENAIR_BIN_DIR}/messages_xml.h
${OPENAIR_TARGETS}/RT/USER/sched_dlsch.c
${OPENAIR_TARGETS}/RT/USER/sched_rx_pdsch.c
${OPENAIR_TARGETS}/RT/USER/rt_wrapper.c ${OPENAIR_TARGETS}/RT/USER/rt_wrapper.c
${OPENAIR_TARGETS}/RT/USER/lte-ue.c ${OPENAIR_TARGETS}/RT/USER/lte-ue.c
${OPENAIR_TARGETS}/RT/USER/lte-enb.c
${OPENAIR_TARGETS}/RT/USER/lte-softmodem.c ${OPENAIR_TARGETS}/RT/USER/lte-softmodem.c
${OPENAIR1_DIR}/SIMULATION/TOOLS/taus.c ${OPENAIR1_DIR}/SIMULATION/TOOLS/taus.c
${OPENAIR_TARGETS}/SIMU/USER/init_lte.c ${OPENAIR_TARGETS}/SIMU/USER/init_lte.c
...@@ -1749,6 +1743,9 @@ add_executable(oaisim ...@@ -1749,6 +1743,9 @@ add_executable(oaisim
${s1ap_h} ${s1ap_h}
${x2ap_h} ${x2ap_h}
${OPENAIR_BIN_DIR}/messages_xml.h ${OPENAIR_BIN_DIR}/messages_xml.h
${OPENAIR_TARGETS}/RT/USER/lte-ue.c
${OPENAIR_TARGETS}/RT/USER/lte-enb.c
${OPENAIR_TARGETS}/RT/USER/rt_wrapper.c
${OPENAIR_TARGETS}/SIMU/USER/channel_sim.c ${OPENAIR_TARGETS}/SIMU/USER/channel_sim.c
${OPENAIR_TARGETS}/SIMU/USER/init_lte.c ${OPENAIR_TARGETS}/SIMU/USER/init_lte.c
${OPENAIR_TARGETS}/SIMU/USER/oaisim_config.c ${OPENAIR_TARGETS}/SIMU/USER/oaisim_config.c
...@@ -1792,6 +1789,9 @@ add_executable(oaisim_nos1 ...@@ -1792,6 +1789,9 @@ add_executable(oaisim_nos1
${s1ap_h} ${s1ap_h}
${x2ap_h} ${x2ap_h}
${OPENAIR_BIN_DIR}/messages_xml.h ${OPENAIR_BIN_DIR}/messages_xml.h
${OPENAIR_TARGETS}/RT/USER/lte-ue.c
${OPENAIR_TARGETS}/RT/USER/lte-enb.c
${OPENAIR_TARGETS}/RT/USER/rt_wrapper.c
${OPENAIR_TARGETS}/SIMU/USER/channel_sim.c ${OPENAIR_TARGETS}/SIMU/USER/channel_sim.c
${OPENAIR_TARGETS}/SIMU/USER/init_lte.c ${OPENAIR_TARGETS}/SIMU/USER/init_lte.c
${OPENAIR_TARGETS}/SIMU/USER/oaisim_config.c ${OPENAIR_TARGETS}/SIMU/USER/oaisim_config.c
......
...@@ -16,17 +16,22 @@ Obj.# Case# Test# Description ...@@ -16,17 +16,22 @@ Obj.# Case# Test# Description
01 01 20 Build lte-softmodem.USRP.Rel10 01 01 20 Build lte-softmodem.USRP.Rel10
01 01 21 Build lte-softmodem.EXMIMO.Rel10 01 01 21 Build lte-softmodem.EXMIMO.Rel10
01 01 22 Build lte-softmodem.BLADERF.Rel10 01 01 22 Build lte-softmodem.BLADERF.Rel10
01 01 23 Build lte-softmodem.ETHERNET.Rel10 01 01 23 Build lte-softmodem.ETHERNET.Rel10 (RCC)
01 01 24 Build lte-softmodem.LMSSDR.Rel10 01 01 24 Build lte-softmodem.LMSSDR.Rel10
01 01 30 Build (dlsim.Rel10 + ulsim.Rel10 + pucchsim.Rel10 + prachsim.Rel10 + pdcchsim.Rel10 + pbchsim.Rel10 + mbmssim.Rel10 01 01 30 Build (dlsim.Rel10 + ulsim.Rel10 + pucchsim.Rel10 + prachsim.Rel10 + pdcchsim.Rel10 + pbchsim.Rel10 + mbmssim.Rel10
secu_knas_encrypt_eia1.Rel10 secu_kenb.Rel10 aes128_ctr_encrypt.Rel10 aes128_ctr_decrypt.Rel10 secu_knas_encrypt_eea2.Rel10 secu_knas_encrypt_eia1.Rel10 secu_kenb.Rel10 aes128_ctr_encrypt.Rel10 aes128_ctr_decrypt.Rel10 secu_knas_encrypt_eea2.Rel10
secu_knas.Rel10 secu_knas_encrypt_eea1.Rel10 kdf.Rel10 aes128_cmac_encrypt.Rel10 secu_knas_encrypt_eia2.Rel10) secu_knas.Rel10 secu_knas_encrypt_eea1.Rel10 kdf.Rel10 aes128_cmac_encrypt.Rel10 secu_knas_encrypt_eia2.Rel10)
01 01 40 Build RRH Gateway for USRP (Rel 10) 01 01 40 Build RRH Gateway (time domain) for USRP (Rel 10)
01 01 41 Build RRH Gateway for EXMIMO (Rel 10) 01 01 41 Build RRH Gateway (time domain) for EXMIMO (Rel 10)
01 01 42 Build RRH Gateway for BLADERF (Rel 10) 01 01 42 Build RRH Gateway (time domain) for BLADERF (Rel 10)
01 01 43 Build RRH Gateway for LMSSDR (Rel 10) 01 01 43 Build RRH Gateway (time domain) for LMSSDR (Rel 10)
01 01 50 Build RRU (NGFI) for USRP (Rel 10) w/ ETHERNET transport
01 01 51 Build RRU (NGFI) for EXMIMO (Rel 10) w/ ETHERNET transport
01 01 52 Build RRU (NGFI) for BLADERF (Rel 10) w/ ETHERNET transport
01 01 53 Build RRU (NGFI) for LMSSDR (Rel 10) w/ ETHERNET transport
01 02 Run OAISIM-NOS1 Rel10 (TDD + 5MHz/10MHz/20MHz + TM 1,2), and check the operation 01 02 Run OAISIM-NOS1 Rel10 (TDD + 5MHz/10MHz/20MHz + TM 1,2), and check the operation
......
...@@ -313,7 +313,7 @@ def SSHSessionWrapper(machine, username, key_file, password, logdir_remote, logd ...@@ -313,7 +313,7 @@ def SSHSessionWrapper(machine, username, key_file, password, logdir_remote, logd
# \param CleanUpAluLteBox program to terminate AlU Bell Labs LTE Box # \param CleanUpAluLteBox program to terminate AlU Bell Labs LTE Box
# \param ExmimoRfStop String to stop EXMIMO card (specified in test_case_list.xml) # \param ExmimoRfStop String to stop EXMIMO card (specified in test_case_list.xml)
def cleanOldPrograms(oai, programList, CleanUpAluLteBox, ExmimoRfStop, logdir, logdirOAI5GRepo): def cleanOldPrograms(oai, programList, CleanUpAluLteBox, ExmimoRfStop, logdir, logdirOAI5GRepo):
cmd = 'sudo -E killall -9 -q -r ' + programList cmd = 'sudo -E killall -s INT -q -r ' + programList + ' ; sleep 5 ; sudo -E killall -9 -q -r ' + programList
result = oai.send(cmd, True) result = oai.send(cmd, True)
print "Killing old programs..." + result print "Killing old programs..." + result
programArray = programList.split() programArray = programList.split()
...@@ -588,7 +588,7 @@ def handle_testcaseclass_softmodem (testcase, oldprogramList, logdirOAI5GRepo , ...@@ -588,7 +588,7 @@ def handle_testcaseclass_softmodem (testcase, oldprogramList, logdirOAI5GRepo ,
RRH_pre_exec_args = testcase.findtext('RRH_pre_exec_args',default='') RRH_pre_exec_args = testcase.findtext('RRH_pre_exec_args',default='')
RRH_main_exec = testcase.findtext('RRH_main_exec',default='') RRH_main_exec = testcase.findtext('RRH_main_exec',default='')
RRH_main_exec_args = testcase.findtext('RRH_main_exec_args',default='') RRH_main_exec_args = testcase.findtext('RRH_main_exec_args',default='')
RRH_terminate_missing_procs = testcase.findtext('RRH_terminate_missing_procs',default='True') RRH_terminate_missing_procs = testcase.findtext('RRH_terminate_missing_procs',default='False')
eNBMachine = testcase.findtext('eNB',default='') eNBMachine = testcase.findtext('eNB',default='')
...@@ -601,7 +601,7 @@ def handle_testcaseclass_softmodem (testcase, oldprogramList, logdirOAI5GRepo , ...@@ -601,7 +601,7 @@ def handle_testcaseclass_softmodem (testcase, oldprogramList, logdirOAI5GRepo ,
eNB_main_exec_args = testcase.findtext('eNB_main_exec_args',default='') eNB_main_exec_args = testcase.findtext('eNB_main_exec_args',default='')
eNB_traffic_exec = testcase.findtext('eNB_traffic_exec',default='') eNB_traffic_exec = testcase.findtext('eNB_traffic_exec',default='')
eNB_traffic_exec_args = testcase.findtext('eNB_traffic_exec_args',default='') eNB_traffic_exec_args = testcase.findtext('eNB_traffic_exec_args',default='')
eNB_terminate_missing_procs = testcase.findtext('eNB_terminate_missing_procs',default='True') eNB_terminate_missing_procs = testcase.findtext('eNB_terminate_missing_procs',default='False')
eNB_search_expr_true = testcase.findtext('eNB_search_expr_true','') eNB_search_expr_true = testcase.findtext('eNB_search_expr_true','')
if re.compile('\w+').match(eNB_search_expr_true) != None: if re.compile('\w+').match(eNB_search_expr_true) != None:
eNB_search_expr_true = eNB_search_expr_true + ' duration=' + str(timeout_cmd-90) + 's' eNB_search_expr_true = eNB_search_expr_true + ' duration=' + str(timeout_cmd-90) + 's'
...@@ -616,7 +616,7 @@ def handle_testcaseclass_softmodem (testcase, oldprogramList, logdirOAI5GRepo , ...@@ -616,7 +616,7 @@ def handle_testcaseclass_softmodem (testcase, oldprogramList, logdirOAI5GRepo ,
UE_main_exec_args = testcase.findtext('UE_main_exec_args',default='') UE_main_exec_args = testcase.findtext('UE_main_exec_args',default='')
UE_traffic_exec = testcase.findtext('UE_traffic_exec',default='') UE_traffic_exec = testcase.findtext('UE_traffic_exec',default='')
UE_traffic_exec_args = testcase.findtext('UE_traffic_exec_args',default='') UE_traffic_exec_args = testcase.findtext('UE_traffic_exec_args',default='')
UE_terminate_missing_procs = testcase.findtext('UE_terminate_missing_procs',default='True') UE_terminate_missing_procs = testcase.findtext('UE_terminate_missing_procs',default='False')
UE_search_expr_true = testcase.findtext('UE_search_expr_true','') UE_search_expr_true = testcase.findtext('UE_search_expr_true','')
UE_stop_script = testcase.findtext('UE_stop_script','') UE_stop_script = testcase.findtext('UE_stop_script','')
if re.compile('\w+').match(UE_search_expr_true) != None: if re.compile('\w+').match(UE_search_expr_true) != None:
...@@ -637,7 +637,7 @@ def handle_testcaseclass_softmodem (testcase, oldprogramList, logdirOAI5GRepo , ...@@ -637,7 +637,7 @@ def handle_testcaseclass_softmodem (testcase, oldprogramList, logdirOAI5GRepo ,
HSS_main_exec_args = testcase.findtext('HSS_main_exec_args',default='') HSS_main_exec_args = testcase.findtext('HSS_main_exec_args',default='')
EPC_traffic_exec = testcase.findtext('EPC_traffic_exec',default='') EPC_traffic_exec = testcase.findtext('EPC_traffic_exec',default='')
EPC_traffic_exec_args = testcase.findtext('EPC_traffic_exec_args',default='') EPC_traffic_exec_args = testcase.findtext('EPC_traffic_exec_args',default='')
EPC_terminate_missing_procs = testcase.findtext('EPC_terminate_missing_procs',default='True') EPC_terminate_missing_procs = testcase.findtext('EPC_terminate_missing_procs',default='False')
EPC_search_expr_true = testcase.findtext('EPC_search_expr_true','') EPC_search_expr_true = testcase.findtext('EPC_search_expr_true','')
if re.compile('\w+').match(EPC_search_expr_true) != None: if re.compile('\w+').match(EPC_search_expr_true) != None:
EPC_search_expr_true = EPC_search_expr_true + ' duration=' + str(timeout_cmd-90) + 's' EPC_search_expr_true = EPC_search_expr_true + ' duration=' + str(timeout_cmd-90) + 's'
...@@ -1304,6 +1304,8 @@ logdirOpenaircnRepo = logdir + 'openair-cn/' ...@@ -1304,6 +1304,8 @@ logdirOpenaircnRepo = logdir + 'openair-cn/'
if flag_remove_logdir == True: if flag_remove_logdir == True:
print "Removing directory: " + locallogdir print "Removing directory: " + locallogdir
os.system(' rm -fr ' + locallogdir + '; mkdir -p ' + locallogdir ) os.system(' rm -fr ' + locallogdir + '; mkdir -p ' + locallogdir )
else:
os.system('mkdir -p ' + locallogdir)
paramiko_logfile = os.path.expandvars('$OPENAIR_DIR/cmake_targets/autotests/log/paramiko.log') paramiko_logfile = os.path.expandvars('$OPENAIR_DIR/cmake_targets/autotests/log/paramiko.log')
res=os.system(' echo > ' + paramiko_logfile) res=os.system(' echo > ' + paramiko_logfile)
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -73,7 +73,7 @@ def start_ue () : ...@@ -73,7 +73,7 @@ def start_ue () :
time.sleep ( 2) time.sleep ( 2)
#Now we check if ppp0 interface is up and running #Now we check if ppp0 interface is up and running
try: try:
cmd = 'sudo adb -s ' + device_id + ' shell netcfg |grep 192.' cmd = 'sudo adb -s ' + device_id + ' shell netcfg |grep UP'
status, out = commands.getstatusoutput(cmd) status, out = commands.getstatusoutput(cmd)
if (out == '') : if (out == '') :
print "Waiting for UE to connect and get IP Address..." print "Waiting for UE to connect and get IP Address..."
......
...@@ -31,6 +31,26 @@ ...@@ -31,6 +31,26 @@
# \author Navid Nikaein, Rohit Gupta # \author Navid Nikaein, Rohit Gupta
# To free unused memory else test setup runs out of memory # To free unused memory else test setup runs out of memory
sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches '
mem_threshold=0.2 #If free memory is less than this threshold, then VM drop cache is called
mem_tot=`vmstat -s -S k |grep "total memory" | awk '{print $1}'`
mem_free=`vmstat -s -S k |grep "free memory" | awk '{print $1}'`
mem_frac=`bc <<< "scale=4;$mem_free/$mem_tot"`
echo $mem_frac
#mem_frac=`bc <<< "scale=4;`echo $mem_free`/`echo $mem_tot`"`
echo "Total Memory = $mem_tot k "
echo "Free Memory = $mem_free k"
echo "Fraction free memory = $mem_frac "
res=`bc <<< "$mem_frac < 0.2" `
echo "Comparison Result = $res"
if [ "$res" == "1" ]
then
echo "Free memory less than threshold = $mem_threshold"
sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches '
fi
...@@ -48,7 +48,7 @@ PRINT_STATS="False" ...@@ -48,7 +48,7 @@ PRINT_STATS="False"
VCD_TIMING="False" VCD_TIMING="False"
DEADLINE_SCHEDULER_FLAG_USER="False" DEADLINE_SCHEDULER_FLAG_USER="False"
FORCE_DEADLINE_SCHEDULER_FLAG_USER="" FORCE_DEADLINE_SCHEDULER_FLAG_USER=""
CPU_AFFINITY_FLAG_USER="True" #Only valid when lowlatecy flag is set to False CPU_AFFINITY_FLAG_USER="False" #Only valid when lowlatecy flag is set to False
REL="Rel10" REL="Rel10"
HW="None" HW="None"
TP="None" TP="None"
...@@ -306,9 +306,6 @@ function main() { ...@@ -306,9 +306,6 @@ function main() {
if [ "$HW" = "None" -a "$TP" = "None" ] ; then if [ "$HW" = "None" -a "$TP" = "None" ] ; then
echo_fatal "Define a local radio head (e.g. -w EXMIMO) or a transport protocol (e.g. -t ETHERNET) to communicate with a remote radio head!" echo_fatal "Define a local radio head (e.g. -w EXMIMO) or a transport protocol (e.g. -t ETHERNET) to communicate with a remote radio head!"
fi fi
if [ "$HW" != "None" -a "$TP" != "None" ] ; then
echo_fatal "Currently eNB can not support simultaniously local and remote radio heads!!"
fi
if [ "$HW" = "None" ] ; then if [ "$HW" = "None" ] ; then
echo_info "No radio head has been selected (HW set to $HW)" echo_info "No radio head has been selected (HW set to $HW)"
fi fi
...@@ -333,9 +330,9 @@ function main() { ...@@ -333,9 +330,9 @@ function main() {
#By default: EXMIMO: enable #By default: EXMIMO: enable
if [ "$FORCE_DEADLINE_SCHEDULER_FLAG_USER" = "" ]; then if [ "$FORCE_DEADLINE_SCHEDULER_FLAG_USER" = "" ]; then
if [ "$HW" = "EXMIMO" ] ; then if [ "$HW" = "EXMIMO" ] ; then
DEADLINE_SCHEDULER_FLAG_USER="True" DEADLINE_SCHEDULER_FLAG_USER="False"
elif [ "$HW" = "ETHERNET" ] ; then elif [ "$HW" = "ETHERNET" ] ; then
DEADLINE_SCHEDULER_FLAG_USER="True" DEADLINE_SCHEDULER_FLAG_USER="False"
elif [ "$HW" = "OAI_USRP" ] ; then elif [ "$HW" = "OAI_USRP" ] ; then
DEADLINE_SCHEDULER_FLAG_USER="False" DEADLINE_SCHEDULER_FLAG_USER="False"
elif [ "$HW" = "OAI_BLADERF" ] ; then elif [ "$HW" = "OAI_BLADERF" ] ; then
...@@ -725,7 +722,9 @@ function main() { ...@@ -725,7 +722,9 @@ function main() {
#add exmimo compilation #add exmimo compilation
#TODO EXMIMO library support #TODO EXMIMO library support
compilations \
$build_dir oai_exmimodevif \
liboai_exmimodevif.so $dbin/liboai_exmimodevif.so.$REL
echo_info "liboai_device.so is linked to EXMIMO device library" echo_info "liboai_device.so is linked to EXMIMO device library"
elif [ "$HW" == "OAI_USRP" ] ; then elif [ "$HW" == "OAI_USRP" ] ; then
if [ -d "/usr/include/uhd" ] ; then if [ -d "/usr/include/uhd" ] ; then
......
...@@ -179,7 +179,7 @@ install_nettle_from_source() { ...@@ -179,7 +179,7 @@ install_nettle_from_source() {
cd /tmp cd /tmp
echo "Downloading nettle archive" echo "Downloading nettle archive"
$SUDO rm -rf /tmp/nettle-2.5.tar.gz* /tmp/nettle-2.5 $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 wget http://ftp.nluug.nl/gnu/nettle/nettle-2.5.tar.gz
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
wget ftp://ftp.lysator.liu.se/pub/security/lsh/nettle-2.5.tar.gz wget ftp://ftp.lysator.liu.se/pub/security/lsh/nettle-2.5.tar.gz
fi fi
...@@ -284,7 +284,9 @@ check_install_additional_tools (){ ...@@ -284,7 +284,9 @@ check_install_additional_tools (){
wvdial \ wvdial \
python-numpy \ python-numpy \
sshpass \ sshpass \
nscd nscd \
bc \
ntp
$SUDO pip install paramiko $SUDO pip install paramiko
$SUDO pip install pyroute2 $SUDO pip install pyroute2
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
#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 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 DEBUG_TURBO_ENCODER 1
#define CALLGRIND 1 //#define CALLGRIND 1
unsigned short threegpplte_interleaver_output; unsigned short threegpplte_interleaver_output;
unsigned long long threegpplte_interleaver_tmp; unsigned long long threegpplte_interleaver_tmp;
...@@ -414,8 +414,10 @@ char interleave_compact_byte(short * base_interleaver,unsigned char * input, uns ...@@ -414,8 +414,10 @@ char interleave_compact_byte(short * base_interleaver,unsigned char * input, uns
#else #else
int input_length_words=1+((n-1)>>2); int input_length_words=1+((n-1)>>2);
#endif #endif
for ( i=0; i< input_length_words ; i ++ ) { for ( i=0; i< input_length_words ; i ++ ) {
#if defined(__x86_64__) || defined(__i386__) #if defined(__x86_64__) || defined(__i386__)
#ifndef __AVX2__ #ifndef __AVX2__
tmp=_mm_insert_epi8(tmp,expandInput[*ptr_intl++],7); tmp=_mm_insert_epi8(tmp,expandInput[*ptr_intl++],7);
...@@ -543,6 +545,7 @@ void threegpplte_turbo_encoder(unsigned char *input, ...@@ -543,6 +545,7 @@ void threegpplte_turbo_encoder(unsigned char *input,
unsigned char systematic2[768] __attribute__((aligned(32))); unsigned char systematic2[768] __attribute__((aligned(32)));
interleave_compact_byte(base_interleaver,input,systematic2,input_length_bytes); interleave_compact_byte(base_interleaver,input,systematic2,input_length_bytes);
#if defined(__x86_64__) || defined(__i386__) #if defined(__x86_64__) || defined(__i386__)
...@@ -564,6 +567,7 @@ void threegpplte_turbo_encoder(unsigned char *input, ...@@ -564,6 +567,7 @@ void threegpplte_turbo_encoder(unsigned char *input,
_mm_add_pi8(all_treillis[state0][cur_s1].parity1_64[code_rate], _mm_add_pi8(all_treillis[state0][cur_s1].parity1_64[code_rate],
all_treillis[state1][cur_s2].parity2_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], *ptr_output++ = _mm_add_pi8(all_treillis[state0][cur_s1].systematic_andp1_64[code_rate],
all_treillis[state1][cur_s2].parity2_64[code_rate]); all_treillis[state1][cur_s2].parity2_64[code_rate]);
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
/// ///
/// ///
#undef __AVX2__
#include "PHY/sse_intrin.h" #include "PHY/sse_intrin.h"
#ifndef TEST_DEBUG #ifndef TEST_DEBUG
......
...@@ -104,18 +104,18 @@ void log_map8(llr_t* systematic, ...@@ -104,18 +104,18 @@ void log_map8(llr_t* systematic,
msg("log_map, frame_length %d\n",frame_length); msg("log_map, frame_length %d\n",frame_length);
#endif #endif
start_meas(gamma_stats) ; if (gamma_stats) start_meas(gamma_stats) ;
compute_gamma8(m11,m10,systematic,y_parity,frame_length,term_flag) ; compute_gamma8(m11,m10,systematic,y_parity,frame_length,term_flag) ;
stop_meas(gamma_stats); if (gamma_stats) stop_meas(gamma_stats);
start_meas(alpha_stats) ; if (alpha_stats) start_meas(alpha_stats) ;
compute_alpha8(alpha,beta,m11,m10,frame_length,F) ; compute_alpha8(alpha,beta,m11,m10,frame_length,F) ;
stop_meas(alpha_stats); if (alpha_stats) stop_meas(alpha_stats);
start_meas(beta_stats) ; if (beta_stats) start_meas(beta_stats) ;
compute_beta8(alpha,beta,m11,m10,frame_length,F,offset8_flag) ; compute_beta8(alpha,beta,m11,m10,frame_length,F,offset8_flag) ;
stop_meas(beta_stats); if (beta_stats) stop_meas(beta_stats);
start_meas(ext_stats) ; if (ext_stats) start_meas(ext_stats) ;
compute_ext8(alpha,beta,m11,m10,ext,systematic,frame_length) ; compute_ext8(alpha,beta,m11,m10,ext,systematic,frame_length) ;
stop_meas(ext_stats); if (ext_stats) stop_meas(ext_stats);
} }
...@@ -935,7 +935,7 @@ unsigned char phy_threegpplte_turbo_decoder8(short *y, ...@@ -935,7 +935,7 @@ unsigned char phy_threegpplte_turbo_decoder8(short *y,
} }
start_meas(init_stats); if (init_stats) start_meas(init_stats);
if ((n&15)>0) { if ((n&15)>0) {
...@@ -1298,7 +1298,7 @@ unsigned char phy_threegpplte_turbo_decoder8(short *y, ...@@ -1298,7 +1298,7 @@ unsigned char phy_threegpplte_turbo_decoder8(short *y,
msg("\n"); msg("\n");
#endif //DEBUG_LOGMAP #endif //DEBUG_LOGMAP
stop_meas(init_stats); if (init_stats) stop_meas(init_stats);
// do log_map from first parity bit // do log_map from first parity bit
...@@ -1310,7 +1310,7 @@ unsigned char phy_threegpplte_turbo_decoder8(short *y, ...@@ -1310,7 +1310,7 @@ unsigned char phy_threegpplte_turbo_decoder8(short *y,
printf("\n*******************ITERATION %d (n %d, n2 %d), ext %p\n\n",iteration_cnt,n,n2,ext); printf("\n*******************ITERATION %d (n %d, n2 %d), ext %p\n\n",iteration_cnt,n,n2,ext);
#endif //DEBUG_LOGMAP #endif //DEBUG_LOGMAP
start_meas(intl1_stats); if (intl1_stats) start_meas(intl1_stats);
pi4_p=pi4tab8[iind]; pi4_p=pi4tab8[iind];
for (i=0; i<(n2>>4); i++) { // steady-state portion for (i=0; i<(n2>>4); i++) { // steady-state portion
...@@ -1351,7 +1351,7 @@ unsigned char phy_threegpplte_turbo_decoder8(short *y, ...@@ -1351,7 +1351,7 @@ unsigned char phy_threegpplte_turbo_decoder8(short *y,
#endif #endif
} }
stop_meas(intl1_stats); if (intl1_stats) stop_meas(intl1_stats);
// do log_map from second parity bit // do log_map from second parity bit
...@@ -1456,7 +1456,7 @@ unsigned char phy_threegpplte_turbo_decoder8(short *y, ...@@ -1456,7 +1456,7 @@ unsigned char phy_threegpplte_turbo_decoder8(short *y,
// Check if we decoded the block // Check if we decoded the block
if (iteration_cnt>1) { if (iteration_cnt>1) {
start_meas(intl2_stats); if (intl2_stats) start_meas(intl2_stats);
if ((n2&0x7f) == 0) { // n2 is a multiple of 128 bits if ((n2&0x7f) == 0) { // n2 is a multiple of 128 bits
...@@ -1595,7 +1595,7 @@ unsigned char phy_threegpplte_turbo_decoder8(short *y, ...@@ -1595,7 +1595,7 @@ unsigned char phy_threegpplte_turbo_decoder8(short *y,
break; break;
} }
stop_meas(intl2_stats); if (intl2_stats) stop_meas(intl2_stats);
if ((crc == oldcrc) && (crc!=0)) { if ((crc == oldcrc) && (crc!=0)) {
return(iteration_cnt); return(iteration_cnt);
......
...@@ -25,7 +25,7 @@ uint32_t sub_block_interleaving_turbo(uint32_t D, uint8_t *d,uint8_t *w) ...@@ -25,7 +25,7 @@ uint32_t sub_block_interleaving_turbo(uint32_t D, uint8_t *d,uint8_t *w)
{ {
uint32_t RTC = (D>>5), ND, ND3; uint32_t RTC = (D>>5), ND, ND3;
uint32_t row,col,Kpi,index; uint32_t row,col,Kpi;
uint32_t index3,k,k2; uint32_t index3,k,k2;
#ifdef RM_DEBUG #ifdef RM_DEBUG
uint32_t nulled=0; uint32_t nulled=0;
...@@ -56,7 +56,6 @@ uint32_t sub_block_interleaving_turbo(uint32_t D, uint8_t *d,uint8_t *w) ...@@ -56,7 +56,6 @@ uint32_t sub_block_interleaving_turbo(uint32_t D, uint8_t *d,uint8_t *w)
#ifdef RM_DEBUG #ifdef RM_DEBUG
printf("Col %d\n",col); printf("Col %d\n",col);
#endif #endif
index = bitrev[col];
index3 = bitrev_x3[col];//3*index; index3 = bitrev_x3[col];//3*index;
for (row=0; row<RTC; row++) { for (row=0; row<RTC; row++) {
...@@ -80,10 +79,7 @@ uint32_t sub_block_interleaving_turbo(uint32_t D, uint8_t *d,uint8_t *w) ...@@ -80,10 +79,7 @@ uint32_t sub_block_interleaving_turbo(uint32_t D, uint8_t *d,uint8_t *w)
#endif #endif
index3+=96; index3+=96;
index+=32; k++;k2+=2;
k++;
k2++;
k2++;
} }
} }
...@@ -494,7 +490,8 @@ uint32_t lte_rate_matching_turbo(uint32_t RTC, ...@@ -494,7 +490,8 @@ uint32_t lte_rate_matching_turbo(uint32_t RTC,
// if (rvidx==3) // if (rvidx==3)
// for (cnt=0;cnt<Ncb;cnt++) // for (cnt=0;cnt<Ncb;cnt++)
// counter_buffer[rvidx][cnt]=0; // counter_buffer[rvidx][cnt]=0;
AssertFatal(Ncb>=(3*RTC<<5),"Exiting, RM condition (Ncb %d, Nir/C %d, Nsoft %d, Kw %d\n",Ncb,Nir/C,Nsoft,3*(RTC<<5)); if (Ncb>(3*(RTC<<5)))
AssertFatal(1==0,"Exiting, RM condition (Ncb %d, RTC %d, Nir/C %d, Nsoft %d, Kw %d)\n",Ncb,RTC,Nir/C,Nsoft,3*(RTC<<5));
Gp = G/Nl/Qm; Gp = G/Nl/Qm;
......
...@@ -125,7 +125,7 @@ int lte_segmentation(unsigned char *input_buffer, ...@@ -125,7 +125,7 @@ int lte_segmentation(unsigned char *input_buffer,
while (k<((Kr - L)>>3)) { while (k<((Kr - L)>>3)) {
output_buffers[r][k] = input_buffer[s]; output_buffers[r][k] = input_buffer[s];
// printf("encoding segment %d : byte %d => %d\n",r,k,input_buffer[s]); // printf("encoding segment %d : byte %d (%d) => %d\n",r,k,Kr>>3,input_buffer[s]);
k++; k++;
s++; s++;
} }
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
#include "PHY/defs.h" #include "PHY/defs.h"
#ifdef OPENAIR_LTE
#include "SystemInformationBlockType2.h" #include "SystemInformationBlockType2.h"
//#include "RadioResourceConfigCommonSIB.h" //#include "RadioResourceConfigCommonSIB.h"
#include "RadioResourceConfigDedicated.h" #include "RadioResourceConfigDedicated.h"
...@@ -13,18 +13,6 @@ ...@@ -13,18 +13,6 @@
#ifdef Rel10 #ifdef Rel10
#include "SCellToAddMod-r10.h" #include "SCellToAddMod-r10.h"
#endif #endif
#else
/**
\fn int phy_init(unsigned char nb_antennas_tx)
\brief Allocate and Initialize the PHY variables after receiving static configuration
@param nb_antennas_tx Number of TX antennas
*/
int phy_init(unsigned char nb_antennas_tx);
#endif
#ifdef OPENAIR_LTE
/** @addtogroup _PHY_STRUCTURES_ /** @addtogroup _PHY_STRUCTURES_
* @{ * @{
*/ */
...@@ -57,7 +45,6 @@ int phy_init_lte_ue(PHY_VARS_UE *phy_vars_ue, ...@@ -57,7 +45,6 @@ int phy_init_lte_ue(PHY_VARS_UE *phy_vars_ue,
\details Only a subset of phy_vars_eNb is initialized. \details Only a subset of phy_vars_eNb is initialized.
@param[out] phy_vars_eNb Pointer to eNB Variables @param[out] phy_vars_eNb Pointer to eNB Variables
@param is_secondary_eNb Flag to indicate this eNB gets synch from another @param is_secondary_eNb Flag to indicate this eNB gets synch from another
@param cooperation_flag 0 for no cooperation, 1 for Delay Diversity and 2 for Distributed Alamouti
@param abstraction_flag 1 indicates memory should be allocated for abstracted MODEM @param abstraction_flag 1 indicates memory should be allocated for abstracted MODEM
@returns 0 on success @returns 0 on success
@returns -1 if any memory allocation failed @returns -1 if any memory allocation failed
...@@ -65,7 +52,6 @@ int phy_init_lte_ue(PHY_VARS_UE *phy_vars_ue, ...@@ -65,7 +52,6 @@ int phy_init_lte_ue(PHY_VARS_UE *phy_vars_ue,
*/ */
int phy_init_lte_eNB(PHY_VARS_eNB *phy_vars_eNb, int phy_init_lte_eNB(PHY_VARS_eNB *phy_vars_eNb,
unsigned char is_secondary_eNb, unsigned char is_secondary_eNb,
unsigned char cooperation_flag,
unsigned char abstraction_flag); unsigned char abstraction_flag);
/** \brief Configure LTE_DL_FRAME_PARMS with components derived after initial synchronization (MIB decoding + primary/secondary synch). /** \brief Configure LTE_DL_FRAME_PARMS with components derived after initial synchronization (MIB decoding + primary/secondary synch).
...@@ -309,17 +295,28 @@ void phy_config_dedicated_scell_eNB(uint8_t Mod_id, ...@@ -309,17 +295,28 @@ void phy_config_dedicated_scell_eNB(uint8_t Mod_id,
int CC_id); int CC_id);
#endif #endif
#endif
/*! !\fn void phy_cleanup(void) /*! !\fn void phy_cleanup(void)
\brief Cleanup the PHY variables*/ \brief Cleanup the PHY variables*/
void phy_cleanup(void); void phy_cleanup(void);
#ifdef OPENAIR_LTE
int init_frame_parms(LTE_DL_FRAME_PARMS *frame_parms,uint8_t osf); int init_frame_parms(LTE_DL_FRAME_PARMS *frame_parms,uint8_t osf);
void dump_frame_parms(LTE_DL_FRAME_PARMS *frame_parms); void dump_frame_parms(LTE_DL_FRAME_PARMS *frame_parms);
#endif
void lte_param_init(unsigned char N_tx,
unsigned char N_rx,
unsigned char transmission_mode,
uint8_t extended_prefix_flag,
frame_t frame_type,
uint16_t Nid_cell,
uint8_t tdd_config,
uint8_t N_RB_DL,
uint8_t threequarter_fs,
uint8_t osf,
uint32_t perfect_ce);
/** @} */ /** @} */
#endif #endif
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
*/ */
//#define DEBUG_PHY //#define DEBUG_PHY
t
/* /*
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -9,8 +9,8 @@ ...@@ -9,8 +9,8 @@
#include "PHY/defs.h" #include "PHY/defs.h"
#include "PHY/extern.h" #include "PHY/extern.h"
extern PHY_VARS_eNB *PHY_vars_eNB; extern PHY_VARS_eNB *eNB;
extern PHY_VARS_UE *PHY_vars_UE; extern PHY_VARS_UE *UE;
void lte_param_init(unsigned char N_tx, void lte_param_init(unsigned char N_tx,
unsigned char N_rx, unsigned char N_rx,
...@@ -25,13 +25,14 @@ void lte_param_init(unsigned char N_tx, ...@@ -25,13 +25,14 @@ void lte_param_init(unsigned char N_tx,
uint32_t perfect_ce) uint32_t perfect_ce)
{ {
LTE_DL_FRAME_PARMS *lte_frame_parms; LTE_DL_FRAME_PARMS *frame_parms;
int i; int i;
printf("Start lte_param_init\n"); printf("Start lte_param_init\n");
PHY_vars_eNB = malloc(sizeof(PHY_VARS_eNB)); eNB = malloc(sizeof(PHY_VARS_eNB));
PHY_vars_UE = malloc(sizeof(PHY_VARS_UE)); UE = malloc(sizeof(PHY_VARS_UE));
memset((void*)eNB,0,sizeof(PHY_VARS_eNB));
memset((void*)UE,0,sizeof(PHY_VARS_UE));
//PHY_config = malloc(sizeof(PHY_CONFIG)); //PHY_config = malloc(sizeof(PHY_CONFIG));
mac_xface = malloc(sizeof(MAC_xface)); mac_xface = malloc(sizeof(MAC_xface));
...@@ -39,69 +40,68 @@ void lte_param_init(unsigned char N_tx, ...@@ -39,69 +40,68 @@ void lte_param_init(unsigned char N_tx,
randominit(0); randominit(0);
set_taus_seed(0); set_taus_seed(0);
lte_frame_parms = &(PHY_vars_eNB->lte_frame_parms); frame_parms = &(eNB->frame_parms);
lte_frame_parms->N_RB_DL = N_RB_DL; //50 for 10MHz and 25 for 5 MHz frame_parms->N_RB_DL = N_RB_DL; //50 for 10MHz and 25 for 5 MHz
lte_frame_parms->N_RB_UL = N_RB_DL; frame_parms->N_RB_UL = N_RB_DL;
lte_frame_parms->threequarter_fs = threequarter_fs; frame_parms->threequarter_fs = threequarter_fs;
lte_frame_parms->Ncp = extended_prefix_flag; frame_parms->Ncp = extended_prefix_flag;
lte_frame_parms->Ncp_UL = extended_prefix_flag; frame_parms->Ncp_UL = extended_prefix_flag;
lte_frame_parms->Nid_cell = Nid_cell; frame_parms->Nid_cell = Nid_cell;
lte_frame_parms->nushift = Nid_cell%6; frame_parms->nushift = Nid_cell%6;
lte_frame_parms->nb_antennas_tx = N_tx; frame_parms->nb_antennas_tx = N_tx;
lte_frame_parms->nb_antennas_rx = N_rx; frame_parms->nb_antennas_rx = N_rx;
lte_frame_parms->nb_antennas_tx_eNB = (transmission_mode == 1)? 1 : 2; frame_parms->nb_antennas_tx_eNB = N_tx;
lte_frame_parms->phich_config_common.phich_resource = oneSixth; frame_parms->phich_config_common.phich_resource = oneSixth;
lte_frame_parms->phich_config_common.phich_duration = normal; frame_parms->phich_config_common.phich_duration = normal;
frame_parms->tdd_config = tdd_config;
lte_frame_parms->tdd_config = tdd_config; frame_parms->frame_type = frame_type;
lte_frame_parms->frame_type = frame_type; // frame_parms->Csrs = 2;
// lte_frame_parms->Csrs = 2; // frame_parms->Bsrs = 0;
// lte_frame_parms->Bsrs = 0; // frame_parms->kTC = 0;44
// lte_frame_parms->kTC = 0;44 // frame_parms->n_RRC = 0;
// lte_frame_parms->n_RRC = 0; frame_parms->mode1_flag = (transmission_mode == 1)? 1 : 0;
lte_frame_parms->mode1_flag = (transmission_mode == 1)? 1 : 0;
init_frame_parms(frame_parms,osf);
init_frame_parms(lte_frame_parms,osf);
//copy_lte_parms_to_phy_framing(frame_parms, &(PHY_config->PHY_framing));
//copy_lte_parms_to_phy_framing(lte_frame_parms, &(PHY_config->PHY_framing));
// phy_init_top(frame_parms); //allocation
// phy_init_top(lte_frame_parms); //allocation
UE->is_secondary_ue = 0;
PHY_vars_UE->is_secondary_ue = 0; UE->frame_parms = *frame_parms;
PHY_vars_UE->lte_frame_parms = *lte_frame_parms; eNB->frame_parms = *frame_parms;
PHY_vars_eNB->lte_frame_parms = *lte_frame_parms;
phy_init_lte_top(frame_parms);
phy_init_lte_top(lte_frame_parms); dump_frame_parms(frame_parms);
dump_frame_parms(lte_frame_parms);
UE->measurements.n_adj_cells=0;
PHY_vars_UE->PHY_measurements.n_adj_cells=0; UE->measurements.adj_cell_id[0] = Nid_cell+1;
PHY_vars_UE->PHY_measurements.adj_cell_id[0] = Nid_cell+1; UE->measurements.adj_cell_id[1] = Nid_cell+2;
PHY_vars_UE->PHY_measurements.adj_cell_id[1] = Nid_cell+2;
for (i=0; i<3; i++) for (i=0; i<3; i++)
lte_gold(lte_frame_parms,PHY_vars_UE->lte_gold_table[i],Nid_cell+i); lte_gold(frame_parms,UE->lte_gold_table[i],Nid_cell+i);
phy_init_lte_ue(PHY_vars_UE,1,0); phy_init_lte_ue(UE,1,0);
phy_init_lte_eNB(PHY_vars_eNB,0,0,0); phy_init_lte_eNB(eNB,0,0);
generate_pcfich_reg_mapping(&PHY_vars_UE->lte_frame_parms); generate_pcfich_reg_mapping(&UE->frame_parms);
generate_phich_reg_mapping(&PHY_vars_UE->lte_frame_parms); generate_phich_reg_mapping(&UE->frame_parms);
// DL power control init // DL power control init
if (transmission_mode == 1) { if (transmission_mode == 1) {
PHY_vars_eNB->pdsch_config_dedicated->p_a = dB0; // 4 = 0dB eNB->pdsch_config_dedicated->p_a = dB0; // 4 = 0dB
((PHY_vars_eNB->lte_frame_parms).pdsch_config_common).p_b = 0; ((eNB->frame_parms).pdsch_config_common).p_b = 0;
PHY_vars_UE->pdsch_config_dedicated->p_a = dB0; // 4 = 0dB UE->pdsch_config_dedicated->p_a = dB0; // 4 = 0dB
((PHY_vars_UE->lte_frame_parms).pdsch_config_common).p_b = 0; ((UE->frame_parms).pdsch_config_common).p_b = 0;
} else { // rho_a = rhob } else { // rho_a = rhob
PHY_vars_eNB->pdsch_config_dedicated->p_a = dB0; // 4 = 0dB eNB->pdsch_config_dedicated->p_a = dB0; // 4 = 0dB
((PHY_vars_eNB->lte_frame_parms).pdsch_config_common).p_b = 1; ((eNB->frame_parms).pdsch_config_common).p_b = 1;
PHY_vars_UE->pdsch_config_dedicated->p_a = dB0; // 4 = 0dB UE->pdsch_config_dedicated->p_a = dB0; // 4 = 0dB
((PHY_vars_UE->lte_frame_parms).pdsch_config_common).p_b = 1; ((UE->frame_parms).pdsch_config_common).p_b = 1;
} }
PHY_vars_UE->perfect_ce = perfect_ce; UE->perfect_ce = perfect_ce;
printf("Done lte_param_init\n"); printf("Done lte_param_init\n");
......
...@@ -2,131 +2,50 @@ ...@@ -2,131 +2,50 @@
#include "PHY/defs.h" #include "PHY/defs.h"
#include "PHY/extern.h" #include "PHY/extern.h"
#ifdef EXMIMO
#include "openair0_lib.h"
extern int card;
#endif
void void
phy_adjust_gain (PHY_VARS_UE *phy_vars_ue, uint32_t rx_power_fil_dB, uint8_t eNB_id) phy_adjust_gain (PHY_VARS_UE *ue, uint32_t rx_power_fil_dB, uint8_t eNB_id)
{ {
#ifdef EXMIMO
exmimo_config_t *p_exmimo_config = openair0_exmimo_pci[card].exmimo_config_ptr;
uint16_t i;
#endif
LOG_D(PHY,"Gain control: rssi %d (%d,%d)\n", LOG_D(PHY,"Gain control: rssi %d (%d,%d)\n",
rx_power_fil_dB, rx_power_fil_dB,
phy_vars_ue->PHY_measurements.rssi, ue->measurements.rssi,
phy_vars_ue->PHY_measurements.rx_power_avg_dB[eNB_id] ue->measurements.rx_power_avg_dB[eNB_id]
); );
// Gain control with hysterisis // Gain control with hysterisis
// Adjust gain in phy_vars_ue->rx_vars[0].rx_total_gain_dB // Adjust gain in ue->rx_vars[0].rx_total_gain_dB
if (rx_power_fil_dB < TARGET_RX_POWER - 5) //&& (phy_vars_ue->rx_total_gain_dB < MAX_RF_GAIN) ) if (rx_power_fil_dB < TARGET_RX_POWER - 5) //&& (ue->rx_total_gain_dB < MAX_RF_GAIN) )
phy_vars_ue->rx_total_gain_dB+=5; ue->rx_total_gain_dB+=5;
else if (rx_power_fil_dB > TARGET_RX_POWER + 5) //&& (phy_vars_ue->rx_total_gain_dB > MIN_RF_GAIN) ) else if (rx_power_fil_dB > TARGET_RX_POWER + 5) //&& (ue->rx_total_gain_dB > MIN_RF_GAIN) )
phy_vars_ue->rx_total_gain_dB-=5; ue->rx_total_gain_dB-=5;
if (phy_vars_ue->rx_total_gain_dB>MAX_RF_GAIN) { if (ue->rx_total_gain_dB>MAX_RF_GAIN) {
/* /*
if ((openair_daq_vars.rx_rf_mode==0) && (openair_daq_vars.mode == openair_NOT_SYNCHED)) { if ((openair_daq_vars.rx_rf_mode==0) && (openair_daq_vars.mode == openair_NOT_SYNCHED)) {
openair_daq_vars.rx_rf_mode=1; openair_daq_vars.rx_rf_mode=1;
phy_vars_ue->rx_total_gain_dB = max(MIN_RF_GAIN,MAX_RF_GAIN-25); ue->rx_total_gain_dB = max(MIN_RF_GAIN,MAX_RF_GAIN-25);
} }
else { else {
*/ */
phy_vars_ue->rx_total_gain_dB = MAX_RF_GAIN; ue->rx_total_gain_dB = MAX_RF_GAIN;
} else if (phy_vars_ue->rx_total_gain_dB<MIN_RF_GAIN) { } else if (ue->rx_total_gain_dB<MIN_RF_GAIN) {
/* /*
if ((openair_daq_vars.rx_rf_mode==1) && (openair_daq_vars.mode == openair_NOT_SYNCHED)) { if ((openair_daq_vars.rx_rf_mode==1) && (openair_daq_vars.mode == openair_NOT_SYNCHED)) {
openair_daq_vars.rx_rf_mode=0; openair_daq_vars.rx_rf_mode=0;
phy_vars_ue->rx_total_gain_dB = min(MAX_RF_GAIN,MIN_RF_GAIN+25); ue->rx_total_gain_dB = min(MAX_RF_GAIN,MIN_RF_GAIN+25);
} }
else { else {
*/ */
phy_vars_ue->rx_total_gain_dB = MIN_RF_GAIN; ue->rx_total_gain_dB = MIN_RF_GAIN;
}
LOG_D(PHY,"Gain control: rx_total_gain_dB = %d (max %d,rxpf %d)\n",phy_vars_ue->rx_total_gain_dB,MAX_RF_GAIN,rx_power_fil_dB);
#ifdef EXMIMO
if (phy_vars_ue->rx_total_gain_dB>phy_vars_ue->rx_gain_max[0]) {
phy_vars_ue->rx_total_gain_dB = phy_vars_ue->rx_gain_max[0];
for (i=0; i<phy_vars_ue->lte_frame_parms.nb_antennas_rx; i++) {
p_exmimo_config->rf.rx_gain[i][0] = 30;
} }
} else if (phy_vars_ue->rx_total_gain_dB<(phy_vars_ue->rx_gain_max[0]-30)) { LOG_D(PHY,"Gain control: rx_total_gain_dB = %d (max %d,rxpf %d)\n",ue->rx_total_gain_dB,MAX_RF_GAIN,rx_power_fil_dB);
// for the moment we stay in max gain mode
phy_vars_ue->rx_total_gain_dB = phy_vars_ue->rx_gain_max[0] - 30;
for (i=0; i<phy_vars_ue->lte_frame_parms.nb_antennas_rx; i++) {
p_exmimo_config->rf.rx_gain[i][0] = 0;
}
/*
phy_vars_ue->rx_gain_mode[0] = byp;
phy_vars_ue->rx_gain_mode[1] = byp;
exmimo_pci_interface->rf.rf_mode0 = 22991; //bypass
exmimo_pci_interface->rf.rf_mode1 = 22991; //bypass
if (phy_vars_ue->rx_total_gain_dB<(phy_vars_ue->rx_gain_byp[0]-50)) {
exmimo_pci_interface->rf.rx_gain00 = 0;
exmimo_pci_interface->rf.rx_gain10 = 0;
}
*/
} else {
for (i=0; i<phy_vars_ue->lte_frame_parms.nb_antennas_rx; i++) {
p_exmimo_config->rf.rx_gain[i][0] = 30 - phy_vars_ue->rx_gain_max[0] + phy_vars_ue->rx_total_gain_dB;
}
}
/*
break;
case med_gain:
case byp_gain:
if (phy_vars_ue->rx_total_gain_dB>phy_vars_ue->rx_gain_byp[0]) {
phy_vars_ue->rx_gain_mode[0] = max_gain;
phy_vars_ue->rx_gain_mode[1] = max_gain;
exmimo_pci_interface->rf.rf_mode0 = 55759; //max gain
exmimo_pci_interface->rf.rf_mode1 = 55759; //max gain
if (phy_vars_ue->rx_total_gain_dB>phy_vars_ue->rx_gain_max[0]) {
exmimo_pci_interface->rf.rx_gain00 = 50;
exmimo_pci_interface->rf.rx_gain10 = 50;
}
else {
exmimo_pci_interface->rf.rx_gain00 = 50 - phy_vars_ue->rx_gain_max[0] + phy_vars_ue->rx_total_gain_dB;
exmimo_pci_interface->rf.rx_gain10 = 50 - phy_vars_ue->rx_gain_max[1] + phy_vars_ue->rx_total_gain_dB;
}
}
else if (phy_vars_ue->rx_total_gain_dB<(phy_vars_ue->rx_gain_byp[0]-50)) {
exmimo_pci_interface->rf.rx_gain00 = 0;
exmimo_pci_interface->rf.rx_gain10 = 0;
}
else {
exmimo_pci_interface->rf.rx_gain00 = 50 - phy_vars_ue->rx_gain_byp[0] + phy_vars_ue->rx_total_gain_dB;
exmimo_pci_interface->rf.rx_gain10 = 50 - phy_vars_ue->rx_gain_byp[1] + phy_vars_ue->rx_total_gain_dB;
}
break;
default:
exmimo_pci_interface->rf.rx_gain00 = 50;
exmimo_pci_interface->rf.rx_gain10 = 50;
break;
}
*/
#endif
#ifdef DEBUG_PHY #ifdef DEBUG_PHY
/* if ((phy_vars_ue->frame%100==0) || (phy_vars_ue->frame < 10)) /* if ((ue->frame%100==0) || (ue->frame < 10))
msg("[PHY][ADJUST_GAIN] frame %d, rx_power = %d, rx_power_fil = %d, rx_power_fil_dB = %d, coef=%d, ncoef=%d, rx_total_gain_dB = %d (%d,%d,%d)\n", msg("[PHY][ADJUST_GAIN] frame %d, rx_power = %d, rx_power_fil = %d, rx_power_fil_dB = %d, coef=%d, ncoef=%d, rx_total_gain_dB = %d (%d,%d,%d)\n",
phy_vars_ue->frame,rx_power,rx_power_fil,rx_power_fil_dB,coef,ncoef,phy_vars_ue->rx_total_gain_dB, ue->frame,rx_power,rx_power_fil,rx_power_fil_dB,coef,ncoef,ue->rx_total_gain_dB,
TARGET_RX_POWER,MAX_RF_GAIN,MIN_RF_GAIN); TARGET_RX_POWER,MAX_RF_GAIN,MIN_RF_GAIN);
*/ */
#endif //DEBUG_PHY #endif //DEBUG_PHY
......
...@@ -189,9 +189,9 @@ void phy_adjust_gain (PHY_VARS_UE *phy_vars_ue, ...@@ -189,9 +189,9 @@ void phy_adjust_gain (PHY_VARS_UE *phy_vars_ue,
unsigned char eNB_id); unsigned char eNB_id);
int lte_ul_channel_estimation(PHY_VARS_eNB *phy_vars_eNB, int lte_ul_channel_estimation(PHY_VARS_eNB *phy_vars_eNB,
eNB_rxtx_proc_t *proc,
module_id_t eNB_id, module_id_t eNB_id,
module_id_t UE_id, module_id_t UE_id,
uint8_t subframe,
uint8_t l, uint8_t l,
uint8_t Ns, uint8_t Ns,
uint8_t cooperation_flag); uint8_t cooperation_flag);
...@@ -214,7 +214,7 @@ int lte_est_timing_advance(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -214,7 +214,7 @@ int lte_est_timing_advance(LTE_DL_FRAME_PARMS *frame_parms,
unsigned char number_of_cards, unsigned char number_of_cards,
short coef); short coef);
int lte_est_timing_advance_pusch(PHY_VARS_eNB* phy_vars_eNB,module_id_t UE_id,uint8_t subframe); int lte_est_timing_advance_pusch(PHY_VARS_eNB* phy_vars_eNB,module_id_t UE_id);
void lte_eNB_I0_measurements(PHY_VARS_eNB *phy_vars_eNB, void lte_eNB_I0_measurements(PHY_VARS_eNB *phy_vars_eNB,
int subframe, int subframe,
......
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
#include "PHY/defs.h" #include "PHY/defs.h"
#include "PHY/extern.h" #include "PHY/extern.h"
#include "UTIL/LOG/vcd_signal_dumper.h"
#define DEBUG_PHY #define DEBUG_PHY
// Adjust location synchronization point to account for drift // Adjust location synchronization point to account for drift
...@@ -9,7 +11,7 @@ ...@@ -9,7 +11,7 @@
// last channel estimate of the receiver // last channel estimate of the receiver
void lte_adjust_synch(LTE_DL_FRAME_PARMS *frame_parms, void lte_adjust_synch(LTE_DL_FRAME_PARMS *frame_parms,
PHY_VARS_UE *phy_vars_ue, PHY_VARS_UE *ue,
unsigned char eNB_id, unsigned char eNB_id,
unsigned char clear, unsigned char clear,
short coef) short coef)
...@@ -20,10 +22,12 @@ void lte_adjust_synch(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -20,10 +22,12 @@ void lte_adjust_synch(LTE_DL_FRAME_PARMS *frame_parms,
int diff; int diff;
short Re,Im,ncoef; short Re,Im,ncoef;
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_ADJUST_SYNCH, VCD_FUNCTION_IN);
ncoef = 32767 - coef; ncoef = 32767 - coef;
#ifdef DEBUG_PHY #ifdef DEBUG_PHY
LOG_D(PHY,"frame %d, slot %d: rx_offset (before) = %d\n",phy_vars_ue->frame_rx,phy_vars_ue->slot_rx,phy_vars_ue->rx_offset); LOG_D(PHY,"frame %d: rx_offset (before) = %d\n",ue->proc.proc_rxtx[0].frame_rx,ue->rx_offset);
#endif //DEBUG_PHY #endif //DEBUG_PHY
...@@ -32,8 +36,8 @@ void lte_adjust_synch(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -32,8 +36,8 @@ void lte_adjust_synch(LTE_DL_FRAME_PARMS *frame_parms,
temp = 0; temp = 0;
for (aa=0; aa<frame_parms->nb_antennas_rx; aa++) { for (aa=0; aa<frame_parms->nb_antennas_rx; aa++) {
Re = ((int16_t*)phy_vars_ue->lte_ue_common_vars.dl_ch_estimates_time[eNB_id][aa])[(i<<2)]; Re = ((int16_t*)ue->common_vars.dl_ch_estimates_time[eNB_id][aa])[(i<<2)];
Im = ((int16_t*)phy_vars_ue->lte_ue_common_vars.dl_ch_estimates_time[eNB_id][aa])[1+(i<<2)]; Im = ((int16_t*)ue->common_vars.dl_ch_estimates_time[eNB_id][aa])[1+(i<<2)];
temp += (Re*Re/2) + (Im*Im/2); temp += (Re*Re/2) + (Im*Im/2);
} }
...@@ -53,29 +57,30 @@ void lte_adjust_synch(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -53,29 +57,30 @@ void lte_adjust_synch(LTE_DL_FRAME_PARMS *frame_parms,
diff = max_pos_fil - frame_parms->nb_prefix_samples/8; diff = max_pos_fil - frame_parms->nb_prefix_samples/8;
if ( diff > SYNCH_HYST ) if ( diff > SYNCH_HYST )
phy_vars_ue->rx_offset++; ue->rx_offset++;
else if (diff < -SYNCH_HYST) else if (diff < -SYNCH_HYST)
phy_vars_ue->rx_offset--; ue->rx_offset--;
if ( phy_vars_ue->rx_offset < 0 ) if ( ue->rx_offset < 0 )
phy_vars_ue->rx_offset += FRAME_LENGTH_COMPLEX_SAMPLES; ue->rx_offset += FRAME_LENGTH_COMPLEX_SAMPLES;
if ( phy_vars_ue->rx_offset >= FRAME_LENGTH_COMPLEX_SAMPLES ) if ( ue->rx_offset >= FRAME_LENGTH_COMPLEX_SAMPLES )
phy_vars_ue->rx_offset -= FRAME_LENGTH_COMPLEX_SAMPLES; ue->rx_offset -= FRAME_LENGTH_COMPLEX_SAMPLES;
#ifdef DEBUG_PHY #ifdef DEBUG_PHY
LOG_D(PHY,"frame %d: rx_offset (after) = %d : max_pos = %d,max_pos_fil = %d (peak %d)\n", LOG_D(PHY,"frame %d: rx_offset (after) = %d : max_pos = %d,max_pos_fil = %d (peak %d)\n",
phy_vars_ue->frame_rx,phy_vars_ue->rx_offset,max_pos,max_pos_fil,temp); ue->proc.proc_rxtx[0].frame_rx,ue->rx_offset,max_pos,max_pos_fil,temp);
#endif //DEBUG_PHY #endif //DEBUG_PHY
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_ADJUST_SYNCH, VCD_FUNCTION_OUT);
} }
int lte_est_timing_advance(LTE_DL_FRAME_PARMS *frame_parms, int lte_est_timing_advance(LTE_DL_FRAME_PARMS *frame_parms,
LTE_eNB_SRS *lte_eNb_srs, LTE_eNB_SRS *lte_eNB_srs,
unsigned int *eNB_id, unsigned int *eNB_id,
unsigned char clear, unsigned char clear,
unsigned char number_of_cards, unsigned char number_of_cards,
...@@ -105,23 +110,23 @@ int lte_est_timing_advance(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -105,23 +110,23 @@ int lte_est_timing_advance(LTE_DL_FRAME_PARMS *frame_parms,
// do ifft of channel estimate // do ifft of channel estimate
switch(frame_parms->N_RB_DL) { switch(frame_parms->N_RB_DL) {
case 6: case 6:
dft128((int16_t*) &lte_eNb_srs->srs_ch_estimates[ind][aa][0], dft128((int16_t*) &lte_eNB_srs->srs_ch_estimates[ind][aa][0],
(int16_t*) lte_eNb_srs->srs_ch_estimates_time[ind][aa], (int16_t*) lte_eNB_srs->srs_ch_estimates_time[ind][aa],
1); 1);
break; break;
case 25: case 25:
dft512((int16_t*) &lte_eNb_srs->srs_ch_estimates[ind][aa][0], dft512((int16_t*) &lte_eNB_srs->srs_ch_estimates[ind][aa][0],
(int16_t*) lte_eNb_srs->srs_ch_estimates_time[ind][aa], (int16_t*) lte_eNB_srs->srs_ch_estimates_time[ind][aa],
1); 1);
break; break;
case 50: case 50:
dft1024((int16_t*) &lte_eNb_srs->srs_ch_estimates[ind][aa][0], dft1024((int16_t*) &lte_eNB_srs->srs_ch_estimates[ind][aa][0],
(int16_t*) lte_eNb_srs->srs_ch_estimates_time[ind][aa], (int16_t*) lte_eNB_srs->srs_ch_estimates_time[ind][aa],
1); 1);
break; break;
case 100: case 100:
dft2048((int16_t*) &lte_eNb_srs->srs_ch_estimates[ind][aa][0], dft2048((int16_t*) &lte_eNB_srs->srs_ch_estimates[ind][aa][0],
(int16_t*) lte_eNb_srs->srs_ch_estimates_time[ind][aa], (int16_t*) lte_eNB_srs->srs_ch_estimates_time[ind][aa],
1); 1);
break; break;
} }
...@@ -129,7 +134,7 @@ int lte_est_timing_advance(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -129,7 +134,7 @@ int lte_est_timing_advance(LTE_DL_FRAME_PARMS *frame_parms,
#ifdef DEBUG_PHY #ifdef DEBUG_PHY
sprintf(fname,"srs_ch_estimates_time_%d%d.m",ind,aa); sprintf(fname,"srs_ch_estimates_time_%d%d.m",ind,aa);
sprintf(vname,"srs_time_%d%d",ind,aa); sprintf(vname,"srs_time_%d%d",ind,aa);
write_output(fname,vname,lte_eNb_srs->srs_ch_estimates_time[ind][aa],frame_parms->ofdm_symbol_size*2,2,1); write_output(fname,vname,lte_eNB_srs->srs_ch_estimates_time[ind][aa],frame_parms->ofdm_symbol_size*2,2,1);
#endif #endif
#endif #endif
} }
...@@ -140,8 +145,8 @@ int lte_est_timing_advance(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -140,8 +145,8 @@ int lte_est_timing_advance(LTE_DL_FRAME_PARMS *frame_parms,
temp = 0; temp = 0;
for (aa=0; aa<frame_parms->nb_antennas_rx; aa++) { for (aa=0; aa<frame_parms->nb_antennas_rx; aa++) {
Re = ((int16_t*)lte_eNb_srs->srs_ch_estimates_time[ind][aa])[(i<<1)]; Re = ((int16_t*)lte_eNB_srs->srs_ch_estimates_time[ind][aa])[(i<<1)];
Im = ((int16_t*)lte_eNb_srs->srs_ch_estimates_time[ind][aa])[1+(i<<1)]; Im = ((int16_t*)lte_eNB_srs->srs_ch_estimates_time[ind][aa])[1+(i<<1)];
temp += (Re*Re/2) + (Im*Im/2); temp += (Re*Re/2) + (Im*Im/2);
} }
...@@ -167,7 +172,7 @@ int lte_est_timing_advance(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -167,7 +172,7 @@ int lte_est_timing_advance(LTE_DL_FRAME_PARMS *frame_parms,
} }
int lte_est_timing_advance_pusch(PHY_VARS_eNB* phy_vars_eNB,uint8_t UE_id,uint8_t sched_subframe) int lte_est_timing_advance_pusch(PHY_VARS_eNB* eNB,uint8_t UE_id)
{ {
static int first_run=1; static int first_run=1;
static int max_pos_fil2=0; static int max_pos_fil2=0;
...@@ -175,8 +180,8 @@ int lte_est_timing_advance_pusch(PHY_VARS_eNB* phy_vars_eNB,uint8_t UE_id,uint8_ ...@@ -175,8 +180,8 @@ int lte_est_timing_advance_pusch(PHY_VARS_eNB* phy_vars_eNB,uint8_t UE_id,uint8_
short Re,Im,coef=24576; short Re,Im,coef=24576;
short ncoef = 32768 - coef; short ncoef = 32768 - coef;
LTE_DL_FRAME_PARMS *frame_parms = &phy_vars_eNB->lte_frame_parms; LTE_DL_FRAME_PARMS *frame_parms = &eNB->frame_parms;
LTE_eNB_PUSCH *eNB_pusch_vars = phy_vars_eNB->lte_eNB_pusch_vars[UE_id]; LTE_eNB_PUSCH *eNB_pusch_vars = eNB->pusch_vars[UE_id];
int32_t **ul_ch_estimates_time= eNB_pusch_vars->drs_ch_estimates_time[0]; int32_t **ul_ch_estimates_time= eNB_pusch_vars->drs_ch_estimates_time[0];
uint8_t cyclic_shift = 0; uint8_t cyclic_shift = 0;
int sync_pos = (frame_parms->ofdm_symbol_size-cyclic_shift*frame_parms->ofdm_symbol_size/12)%(frame_parms->ofdm_symbol_size); int sync_pos = (frame_parms->ofdm_symbol_size-cyclic_shift*frame_parms->ofdm_symbol_size/12)%(frame_parms->ofdm_symbol_size);
...@@ -208,7 +213,7 @@ int lte_est_timing_advance_pusch(PHY_VARS_eNB* phy_vars_eNB,uint8_t UE_id,uint8_ ...@@ -208,7 +213,7 @@ int lte_est_timing_advance_pusch(PHY_VARS_eNB* phy_vars_eNB,uint8_t UE_id,uint8_
max_pos_fil2 = ((max_pos_fil2 * coef) + (max_pos * ncoef)) >> 15; max_pos_fil2 = ((max_pos_fil2 * coef) + (max_pos * ncoef)) >> 15;
#ifdef DEBUG_PHY #ifdef DEBUG_PHY
LOG_D(PHY,"frame %d: max_pos = %d, max_pos_fil = %d, sync_pos=%d\n",phy_vars_eNB->proc[sched_subframe].frame_rx,max_pos,max_pos_fil2,sync_pos); LOG_D(PHY,"frame %d: max_pos = %d, max_pos_fil = %d, sync_pos=%d\n",eNB->proc.frame_rx,max_pos,max_pos_fil2,sync_pos);
#endif //DEBUG_PHY #endif //DEBUG_PHY
return(max_pos_fil2-sync_pos); return(max_pos_fil2-sync_pos);
......
...@@ -53,7 +53,7 @@ void lte_sync_timefreq(PHY_VARS_UE *ue,int band,unsigned int DL_freq) ...@@ -53,7 +53,7 @@ void lte_sync_timefreq(PHY_VARS_UE *ue,int band,unsigned int DL_freq)
//compute frequency-domain representation of 6144-sample chunk //compute frequency-domain representation of 6144-sample chunk
rxp = &ue->lte_ue_common_vars.rxdata[0][i]; rxp = &ue->common_vars.rxdata[0][i];
sp=spectrum; sp=spectrum;
while (1) { while (1) {
...@@ -312,8 +312,8 @@ void lte_sync_timefreq(PHY_VARS_UE *ue,int band,unsigned int DL_freq) ...@@ -312,8 +312,8 @@ void lte_sync_timefreq(PHY_VARS_UE *ue,int band,unsigned int DL_freq)
} // loop on pss index } // loop on pss index
} }
if (rxp == &ue->lte_ue_common_vars.rxdata[0][i+38400*4]) { if (rxp == &ue->common_vars.rxdata[0][i+38400*4]) {
rxp = &ue->lte_ue_common_vars.rxdata[0][i+38400*4]; rxp = &ue->common_vars.rxdata[0][i+38400*4];
sp=spectrum_p5ms; sp=spectrum_p5ms;
} else { } else {
break; break;
......
...@@ -25,29 +25,29 @@ static int16_t ru_90c[2*128] = {32767, 0,32766, -402,32758, -804,32746, -1206,32 ...@@ -25,29 +25,29 @@ static int16_t ru_90c[2*128] = {32767, 0,32766, -402,32758, -804,32746, -1206,32
#define SCALE 0x3FFF #define SCALE 0x3FFF
int32_t lte_ul_channel_estimation(PHY_VARS_eNB *phy_vars_eNB, int32_t lte_ul_channel_estimation(PHY_VARS_eNB *eNB,
eNB_rxtx_proc_t *proc,
uint8_t eNB_id, uint8_t eNB_id,
uint8_t UE_id, uint8_t UE_id,
uint8_t sched_subframe,
unsigned char l, unsigned char l,
unsigned char Ns, unsigned char Ns,
uint8_t cooperation_flag) uint8_t cooperation_flag)
{ {
LTE_DL_FRAME_PARMS *frame_parms = &phy_vars_eNB->lte_frame_parms; LTE_DL_FRAME_PARMS *frame_parms = &eNB->frame_parms;
LTE_eNB_PUSCH *eNB_pusch_vars = phy_vars_eNB->lte_eNB_pusch_vars[UE_id]; LTE_eNB_PUSCH *pusch_vars = eNB->pusch_vars[UE_id];
int32_t **ul_ch_estimates=eNB_pusch_vars->drs_ch_estimates[eNB_id]; int32_t **ul_ch_estimates=pusch_vars->drs_ch_estimates[eNB_id];
int32_t **ul_ch_estimates_time= eNB_pusch_vars->drs_ch_estimates_time[eNB_id]; int32_t **ul_ch_estimates_time= pusch_vars->drs_ch_estimates_time[eNB_id];
int32_t **ul_ch_estimates_0= eNB_pusch_vars->drs_ch_estimates_0[eNB_id]; int32_t **ul_ch_estimates_0= pusch_vars->drs_ch_estimates_0[eNB_id];
int32_t **ul_ch_estimates_1= eNB_pusch_vars->drs_ch_estimates_1[eNB_id]; int32_t **ul_ch_estimates_1= pusch_vars->drs_ch_estimates_1[eNB_id];
int32_t **rxdataF_ext= eNB_pusch_vars->rxdataF_ext[eNB_id]; int32_t **rxdataF_ext= pusch_vars->rxdataF_ext[eNB_id];
int subframe = phy_vars_eNB->proc[sched_subframe].subframe_rx; int subframe = proc->subframe_rx;
uint8_t harq_pid = subframe2harq_pid(frame_parms,phy_vars_eNB->proc[sched_subframe].frame_rx,subframe); uint8_t harq_pid = subframe2harq_pid(frame_parms,proc->frame_rx,subframe);
int16_t delta_phase = 0; int16_t delta_phase = 0;
int16_t *ru1 = ru_90; int16_t *ru1 = ru_90;
int16_t *ru2 = ru_90; int16_t *ru2 = ru_90;
int16_t current_phase1,current_phase2; int16_t current_phase1,current_phase2;
uint16_t N_rb_alloc = phy_vars_eNB->ulsch_eNB[UE_id]->harq_processes[harq_pid]->nb_rb; uint16_t N_rb_alloc = eNB->ulsch[UE_id]->harq_processes[harq_pid]->nb_rb;
uint16_t aa,Msc_RS,Msc_RS_idx; uint16_t aa,Msc_RS,Msc_RS_idx;
uint16_t * Msc_idx_ptr; uint16_t * Msc_idx_ptr;
int k,pilot_pos1 = 3 - frame_parms->Ncp, pilot_pos2 = 10 - 2*frame_parms->Ncp; int k,pilot_pos1 = 3 - frame_parms->Ncp, pilot_pos2 = 10 - 2*frame_parms->Ncp;
...@@ -89,7 +89,7 @@ int32_t lte_ul_channel_estimation(PHY_VARS_eNB *phy_vars_eNB, ...@@ -89,7 +89,7 @@ int32_t lte_ul_channel_estimation(PHY_VARS_eNB *phy_vars_eNB,
Msc_RS = N_rb_alloc*12; Msc_RS = N_rb_alloc*12;
cyclic_shift = (frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.cyclicShift + cyclic_shift = (frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.cyclicShift +
phy_vars_eNB->ulsch_eNB[UE_id]->harq_processes[harq_pid]->n_DMRS2 + eNB->ulsch[UE_id]->harq_processes[harq_pid]->n_DMRS2 +
frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.nPRS[(subframe<<1)+Ns]) % 12; frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.nPRS[(subframe<<1)+Ns]) % 12;
#if defined(USER_MODE) #if defined(USER_MODE)
...@@ -307,7 +307,7 @@ int32_t lte_ul_channel_estimation(PHY_VARS_eNB *phy_vars_eNB, ...@@ -307,7 +307,7 @@ int32_t lte_ul_channel_estimation(PHY_VARS_eNB *phy_vars_eNB,
#if T_TRACER #if T_TRACER
if (aa == 0) if (aa == 0)
T(T_ENB_PHY_UL_CHANNEL_ESTIMATE, T_INT(eNB_id), T_INT(UE_id), T(T_ENB_PHY_UL_CHANNEL_ESTIMATE, T_INT(eNB_id), T_INT(UE_id),
T_INT(phy_vars_eNB->proc[sched_subframe].frame_rx), T_INT(subframe), T_INT(proc->frame_rx), T_INT(subframe),
T_INT(0), T_BUFFER(ul_ch_estimates_time[0], 512 * 4)); T_INT(0), T_BUFFER(ul_ch_estimates_time[0], 512 * 4));
#endif #endif
...@@ -649,11 +649,11 @@ extern uint16_t transmission_offset_tdd[16]; ...@@ -649,11 +649,11 @@ extern uint16_t transmission_offset_tdd[16];
#define DEBUG_SRS #define DEBUG_SRS
int32_t lte_srs_channel_estimation(LTE_DL_FRAME_PARMS *frame_parms, int32_t lte_srs_channel_estimation(LTE_DL_FRAME_PARMS *frame_parms,
LTE_eNB_COMMON *eNb_common_vars, LTE_eNB_COMMON *common_vars,
LTE_eNB_SRS *eNb_srs_vars, LTE_eNB_SRS *srs_vars,
SOUNDINGRS_UL_CONFIG_DEDICATED *soundingrs_ul_config_dedicated, SOUNDINGRS_UL_CONFIG_DEDICATED *soundingrs_ul_config_dedicated,
unsigned char sub_frame_number, unsigned char sub_frame_number,
unsigned char eNb_id) unsigned char eNB_id)
{ {
int T_SFC,aa; int T_SFC,aa;
...@@ -670,7 +670,7 @@ int32_t lte_srs_channel_estimation(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -670,7 +670,7 @@ int32_t lte_srs_channel_estimation(LTE_DL_FRAME_PARMS *frame_parms,
T_SFC = (Ssrs<=7 ? 5 : 10); T_SFC = (Ssrs<=7 ? 5 : 10);
/* /*
msg("SRS channel estimation eNb %d, subframs %d, %d %d %d %d %d\n",eNb_id,sub_frame_number, msg("SRS channel estimation eNB %d, subframs %d, %d %d %d %d %d\n",eNB_id,sub_frame_number,
SRS_parms->Csrs, SRS_parms->Csrs,
SRS_parms->Bsrs, SRS_parms->Bsrs,
SRS_parms->kTC, SRS_parms->kTC,
...@@ -682,34 +682,34 @@ int32_t lte_srs_channel_estimation(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -682,34 +682,34 @@ int32_t lte_srs_channel_estimation(LTE_DL_FRAME_PARMS *frame_parms,
if (generate_srs_rx(frame_parms, if (generate_srs_rx(frame_parms,
soundingrs_ul_config_dedicated, soundingrs_ul_config_dedicated,
eNb_srs_vars->srs)==-1) { srs_vars->srs)==-1) {
msg("lte_srs_channel_estimation: Error in generate_srs_rx\n"); msg("lte_srs_channel_estimation: Error in generate_srs_rx\n");
return(-1); return(-1);
} }
for (aa=0; aa<nb_antennas_rx; aa++) { for (aa=0; aa<nb_antennas_rx; aa++) {
#ifdef DEBUG_SRS #ifdef DEBUG_SRS
msg("SRS channel estimation eNb %d, subframs %d, aarx %d, %p, %p, %p\n",eNb_id,sub_frame_number,aa, msg("SRS channel estimation eNB %d, subframs %d, aarx %d, %p, %p, %p\n",eNB_id,sub_frame_number,aa,
&eNb_common_vars->rxdataF[eNb_id][aa][2*frame_parms->ofdm_symbol_size*symbol], &common_vars->rxdataF[eNB_id][aa][2*frame_parms->ofdm_symbol_size*symbol],
eNb_srs_vars->srs, srs_vars->srs,
eNb_srs_vars->srs_ch_estimates[eNb_id][aa]); srs_vars->srs_ch_estimates[eNB_id][aa]);
#endif #endif
//write_output("eNb_rxF.m","rxF",&eNb_common_vars->rxdataF[0][aa][2*frame_parms->ofdm_symbol_size*symbol],2*(frame_parms->ofdm_symbol_size),2,1); //write_output("eNB_rxF.m","rxF",&common_vars->rxdataF[0][aa][2*frame_parms->ofdm_symbol_size*symbol],2*(frame_parms->ofdm_symbol_size),2,1);
//write_output("eNb_srs.m","srs_eNb",eNb_common_vars->srs,(frame_parms->ofdm_symbol_size),1,1); //write_output("eNB_srs.m","srs_eNB",common_vars->srs,(frame_parms->ofdm_symbol_size),1,1);
mult_cpx_conj_vector((int16_t*) &eNb_common_vars->rxdataF[eNb_id][aa][2*frame_parms->ofdm_symbol_size*symbol], mult_cpx_conj_vector((int16_t*) &common_vars->rxdataF[eNB_id][aa][2*frame_parms->ofdm_symbol_size*symbol],
(int16_t*) eNb_srs_vars->srs, (int16_t*) srs_vars->srs,
(int16_t*) eNb_srs_vars->srs_ch_estimates[eNb_id][aa], (int16_t*) srs_vars->srs_ch_estimates[eNB_id][aa],
frame_parms->ofdm_symbol_size, frame_parms->ofdm_symbol_size,
15); 15);
//msg("SRS channel estimation cmult out\n"); //msg("SRS channel estimation cmult out\n");
#ifdef USER_MODE #ifdef USER_MODE
#ifdef DEBUG_SRS #ifdef DEBUG_SRS
sprintf(fname,"eNB_id%d_an%d_srs_ch_est.m",eNb_id,aa); sprintf(fname,"eNB_id%d_an%d_srs_ch_est.m",eNB_id,aa);
sprintf(vname,"eNB%d_%d_srs_ch_est",eNb_id,aa); sprintf(vname,"eNB%d_%d_srs_ch_est",eNB_id,aa);
write_output(fname,vname,eNb_srs_vars->srs_ch_estimates[eNb_id][aa],frame_parms->ofdm_symbol_size,1,1); write_output(fname,vname,srs_vars->srs_ch_estimates[eNB_id][aa],frame_parms->ofdm_symbol_size,1,1);
#endif #endif
#endif #endif
} }
...@@ -718,7 +718,7 @@ int32_t lte_srs_channel_estimation(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -718,7 +718,7 @@ int32_t lte_srs_channel_estimation(LTE_DL_FRAME_PARMS *frame_parms,
/* /*
else { else {
for (aa=0;aa<nb_antennas_rx;aa++) for (aa=0;aa<nb_antennas_rx;aa++)
bzero(eNb_srs_vars->srs_ch_estimates[eNb_id][aa],frame_parms->ofdm_symbol_size*sizeof(int)); bzero(srs_vars->srs_ch_estimates[eNB_id][aa],frame_parms->ofdm_symbol_size*sizeof(int));
} }
*/ */
return(0); return(0);
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
//Calibration //Calibration
int lte_dl_cell_spec_SS(PHY_VARS_eNB *phy_vars_eNB, int lte_dl_cell_spec_SS(PHY_VARS_eNB *eNB,
int32_t *output, int32_t *output,
short amp, short amp,
unsigned char Ns, unsigned char Ns,
...@@ -48,27 +48,27 @@ int lte_dl_cell_spec_SS(PHY_VARS_eNB *phy_vars_eNB, ...@@ -48,27 +48,27 @@ int lte_dl_cell_spec_SS(PHY_VARS_eNB *phy_vars_eNB,
return(-1); return(-1);
} }
mprime = 110 - phy_vars_eNB->lte_frame_parms.N_RB_DL; mprime = 110 - eNB->frame_parms.N_RB_DL;
k = (nu + phy_vars_eNB->lte_frame_parms.nushift); k = (nu + eNB->frame_parms.nushift);
if (k > 6)//b if (k > 6)//b
k -=6;//b k -=6;//b
k+=phy_vars_eNB->lte_frame_parms.first_carrier_offset; k+=eNB->frame_parms.first_carrier_offset;
for (m=0; m<phy_vars_eNB->lte_frame_parms.N_RB_DL<<1; m++) { // loop over pilots in one slot/symbol, 2*N_RB_DL pilots for (m=0; m<eNB->frame_parms.N_RB_DL<<1; m++) { // loop over pilots in one slot/symbol, 2*N_RB_DL pilots
mprime_dword = mprime>>4; mprime_dword = mprime>>4;
mprime_qpsk_symb = mprime&0xf; mprime_qpsk_symb = mprime&0xf;
// this is r_mprime from 3GPP 36-211 6.10.1.2 // this is r_mprime from 3GPP 36-211 6.10.1.2
output[k] = qpsk[(phy_vars_eNB->lte_gold_table[Ns][l][mprime_dword]>>(2*mprime_qpsk_symb))&3]; output[k] = qpsk[(eNB->lte_gold_table[Ns][l][mprime_dword]>>(2*mprime_qpsk_symb))&3];
//output[k] = (lte_gold_table[eNB_offset][Ns][l][mprime_dword]>>(2*mprime_qpsk_symb))&3; //output[k] = (lte_gold_table[eNB_offset][Ns][l][mprime_dword]>>(2*mprime_qpsk_symb))&3;
#ifdef DEBUG_DL_CELL_SPEC #ifdef DEBUG_DL_CELL_SPEC
printf("Ns %d, l %d, m %d,mprime_dword %d, mprime_qpsk_symbol %d\n", printf("Ns %d, l %d, m %d,mprime_dword %d, mprime_qpsk_symbol %d\n",
Ns,l,m,mprime_dword,mprime_qpsk_symb); Ns,l,m,mprime_dword,mprime_qpsk_symb);
printf("index = %d (k %d)\n",(phy_vars_eNB->lte_gold_table[Ns][l][mprime_dword]>>(2*mprime_qpsk_symb))&3,k); printf("index = %d (k %d)\n",(eNB->lte_gold_table[Ns][l][mprime_dword]>>(2*mprime_qpsk_symb))&3,k);
#endif #endif
mprime++; mprime++;
...@@ -80,9 +80,9 @@ int lte_dl_cell_spec_SS(PHY_VARS_eNB *phy_vars_eNB, ...@@ -80,9 +80,9 @@ int lte_dl_cell_spec_SS(PHY_VARS_eNB *phy_vars_eNB,
#endif #endif
k+=6;//b k+=6;//b
if (k >= phy_vars_eNB->lte_frame_parms.ofdm_symbol_size) { if (k >= eNB->frame_parms.ofdm_symbol_size) {
k++; // skip DC carrier k++; // skip DC carrier
k-=phy_vars_eNB->lte_frame_parms.ofdm_symbol_size; k-=eNB->frame_parms.ofdm_symbol_size;
} }
// printf("** k %d\n",k); // printf("** k %d\n",k);
...@@ -92,7 +92,7 @@ int lte_dl_cell_spec_SS(PHY_VARS_eNB *phy_vars_eNB, ...@@ -92,7 +92,7 @@ int lte_dl_cell_spec_SS(PHY_VARS_eNB *phy_vars_eNB,
} }
int lte_dl_cell_spec(PHY_VARS_eNB *phy_vars_eNB, int lte_dl_cell_spec(PHY_VARS_eNB *eNB,
int32_t *output, int32_t *output,
short amp, short amp,
unsigned char Ns, unsigned char Ns,
...@@ -127,31 +127,31 @@ int lte_dl_cell_spec(PHY_VARS_eNB *phy_vars_eNB, ...@@ -127,31 +127,31 @@ int lte_dl_cell_spec(PHY_VARS_eNB *phy_vars_eNB,
return(-1); return(-1);
} }
mprime = 110 - phy_vars_eNB->lte_frame_parms.N_RB_DL; mprime = 110 - eNB->frame_parms.N_RB_DL;
k = (nu + phy_vars_eNB->lte_frame_parms.nushift); k = (nu + eNB->frame_parms.nushift);
if (k > 5) if (k > 5)
k -=6; k -=6;
k+=phy_vars_eNB->lte_frame_parms.first_carrier_offset; k+=eNB->frame_parms.first_carrier_offset;
DevAssert( Ns < 20 ); DevAssert( Ns < 20 );
DevAssert( l < 2 ); DevAssert( l < 2 );
DevAssert( mprime>>4 < 14 ); DevAssert( mprime>>4 < 14 );
for (m=0; m<phy_vars_eNB->lte_frame_parms.N_RB_DL<<1; m++) { for (m=0; m<eNB->frame_parms.N_RB_DL<<1; m++) {
mprime_dword = mprime>>4; mprime_dword = mprime>>4;
mprime_qpsk_symb = mprime&0xf; mprime_qpsk_symb = mprime&0xf;
// this is r_mprime from 3GPP 36-211 6.10.1.2 // this is r_mprime from 3GPP 36-211 6.10.1.2
output[k] = qpsk[(phy_vars_eNB->lte_gold_table[Ns][l][mprime_dword]>>(2*mprime_qpsk_symb))&3]; output[k] = qpsk[(eNB->lte_gold_table[Ns][l][mprime_dword]>>(2*mprime_qpsk_symb))&3];
//output[k] = (lte_gold_table[eNB_offset][Ns][l][mprime_dword]>>(2*mprime_qpsk_symb))&3; //output[k] = (lte_gold_table[eNB_offset][Ns][l][mprime_dword]>>(2*mprime_qpsk_symb))&3;
#ifdef DEBUG_DL_CELL_SPEC #ifdef DEBUG_DL_CELL_SPEC
printf("Ns %d, l %d, m %d,mprime_dword %d, mprime_qpsk_symbol %d\n", printf("Ns %d, l %d, m %d,mprime_dword %d, mprime_qpsk_symbol %d\n",
Ns,l,m,mprime_dword,mprime_qpsk_symb); Ns,l,m,mprime_dword,mprime_qpsk_symb);
printf("index = %d (k %d)\n",(phy_vars_eNB->lte_gold_table[Ns][l][mprime_dword]>>(2*mprime_qpsk_symb))&3,k); printf("index = %d (k %d)\n",(eNB->lte_gold_table[Ns][l][mprime_dword]>>(2*mprime_qpsk_symb))&3,k);
#endif #endif
mprime++; mprime++;
...@@ -163,9 +163,9 @@ int lte_dl_cell_spec(PHY_VARS_eNB *phy_vars_eNB, ...@@ -163,9 +163,9 @@ int lte_dl_cell_spec(PHY_VARS_eNB *phy_vars_eNB,
#endif #endif
k+=6; k+=6;
if (k >= phy_vars_eNB->lte_frame_parms.ofdm_symbol_size) { if (k >= eNB->frame_parms.ofdm_symbol_size) {
k++; // skip DC carrier k++; // skip DC carrier
k-=phy_vars_eNB->lte_frame_parms.ofdm_symbol_size; k-=eNB->frame_parms.ofdm_symbol_size;
} }
// printf("** k %d\n",k); // printf("** k %d\n",k);
...@@ -174,7 +174,7 @@ int lte_dl_cell_spec(PHY_VARS_eNB *phy_vars_eNB, ...@@ -174,7 +174,7 @@ int lte_dl_cell_spec(PHY_VARS_eNB *phy_vars_eNB,
return(0); return(0);
} }
int lte_dl_cell_spec_rx(PHY_VARS_UE *phy_vars_ue, int lte_dl_cell_spec_rx(PHY_VARS_UE *ue,
uint8_t eNB_offset, uint8_t eNB_offset,
int *output, int *output,
unsigned char Ns, unsigned char Ns,
...@@ -202,19 +202,19 @@ int lte_dl_cell_spec_rx(PHY_VARS_UE *phy_vars_ue, ...@@ -202,19 +202,19 @@ int lte_dl_cell_spec_rx(PHY_VARS_UE *phy_vars_ue,
((short *)&qpsk[3])[0] = -pamp; ((short *)&qpsk[3])[0] = -pamp;
((short *)&qpsk[3])[1] = pamp; ((short *)&qpsk[3])[1] = pamp;
mprime = 110 - phy_vars_ue->lte_frame_parms.N_RB_DL; mprime = 110 - ue->frame_parms.N_RB_DL;
for (m=0; m<phy_vars_ue->lte_frame_parms.N_RB_DL<<1; m++) { for (m=0; m<ue->frame_parms.N_RB_DL<<1; m++) {
mprime_dword = mprime>>4; mprime_dword = mprime>>4;
mprime_qpsk_symb = mprime&0xf; mprime_qpsk_symb = mprime&0xf;
// this is r_mprime from 3GPP 36-211 6.10.1.2 // this is r_mprime from 3GPP 36-211 6.10.1.2
output[k] = qpsk[(phy_vars_ue->lte_gold_table[eNB_offset][Ns][l][mprime_dword]>>(2*mprime_qpsk_symb))&3]; output[k] = qpsk[(ue->lte_gold_table[eNB_offset][Ns][l][mprime_dword]>>(2*mprime_qpsk_symb))&3];
#ifdef DEBUG_DL_CELL_SPEC #ifdef DEBUG_DL_CELL_SPEC
printf("Ns %d, l %d, m %d,mprime_dword %d, mprime_qpsk_symbol %d\n", printf("Ns %d, l %d, m %d,mprime_dword %d, mprime_qpsk_symbol %d\n",
Ns,l,m,mprime_dword,mprime_qpsk_symb); Ns,l,m,mprime_dword,mprime_qpsk_symb);
printf("index = %d (k %d)\n",(phy_vars_ue->lte_gold_table[eNB_offset][Ns][l][mprime_dword]>>(2*mprime_qpsk_symb))&3,k); printf("index = %d (k %d)\n",(ue->lte_gold_table[eNB_offset][Ns][l][mprime_dword]>>(2*mprime_qpsk_symb))&3,k);
#endif #endif
mprime++; mprime++;
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
//extern unsigned int lte_gold_table[10][3][42]; //extern unsigned int lte_gold_table[10][3][42];
//#define DEBUG_DL_MBSFN //#define DEBUG_DL_MBSFN
int lte_dl_mbsfn(PHY_VARS_eNB *phy_vars_eNB, int32_t *output, int lte_dl_mbsfn(PHY_VARS_eNB *eNB, int32_t *output,
short amp, short amp,
int subframe, int subframe,
unsigned char l) unsigned char l)
...@@ -34,9 +34,9 @@ int lte_dl_mbsfn(PHY_VARS_eNB *phy_vars_eNB, int32_t *output, ...@@ -34,9 +34,9 @@ int lte_dl_mbsfn(PHY_VARS_eNB *phy_vars_eNB, int32_t *output,
((short *)&qpsk[3])[1] = -a; ((short *)&qpsk[3])[1] = -a;
mprime = 3*(110 - phy_vars_eNB->lte_frame_parms.N_RB_DL); mprime = 3*(110 - eNB->frame_parms.N_RB_DL);
for (m=0; m<phy_vars_eNB->lte_frame_parms.N_RB_DL*6; m++) { for (m=0; m<eNB->frame_parms.N_RB_DL*6; m++) {
if ((l==0) || (l==2)) if ((l==0) || (l==2))
k = m<<1; k = m<<1;
...@@ -47,24 +47,24 @@ int lte_dl_mbsfn(PHY_VARS_eNB *phy_vars_eNB, int32_t *output, ...@@ -47,24 +47,24 @@ int lte_dl_mbsfn(PHY_VARS_eNB *phy_vars_eNB, int32_t *output,
return(-1); return(-1);
} }
k+=phy_vars_eNB->lte_frame_parms.first_carrier_offset; k+=eNB->frame_parms.first_carrier_offset;
mprime_dword = mprime>>4; mprime_dword = mprime>>4;
mprime_qpsk_symb = mprime&0xf; mprime_qpsk_symb = mprime&0xf;
if (k >= phy_vars_eNB->lte_frame_parms.ofdm_symbol_size) { if (k >= eNB->frame_parms.ofdm_symbol_size) {
k++; // skip DC carrier k++; // skip DC carrier
k-=phy_vars_eNB->lte_frame_parms.ofdm_symbol_size; k-=eNB->frame_parms.ofdm_symbol_size;
} }
output[k] = qpsk[(phy_vars_eNB->lte_gold_mbsfn_table[subframe][l][mprime_dword]>>(2*mprime_qpsk_symb))&3]; output[k] = qpsk[(eNB->lte_gold_mbsfn_table[subframe][l][mprime_dword]>>(2*mprime_qpsk_symb))&3];
//output[k] = (lte_gold_table[eNB_offset][subframe][l][mprime_dword]>>(2*mprime_qpsk_symb))&3; //output[k] = (lte_gold_table[eNB_offset][subframe][l][mprime_dword]>>(2*mprime_qpsk_symb))&3;
#ifdef DEBUG_DL_MBSFN #ifdef DEBUG_DL_MBSFN
msg("subframe %d, l %d, m %d, mprime %d, mprime_dword %d, mprime_qpsk_symbol %d\n", msg("subframe %d, l %d, m %d, mprime %d, mprime_dword %d, mprime_qpsk_symbol %d\n",
subframe,l,m,mprime,mprime_dword,mprime_qpsk_symb); subframe,l,m,mprime,mprime_dword,mprime_qpsk_symb);
msg("index = %d (k %d)(%x)\n",(phy_vars_eNB->lte_gold_mbsfn_table[subframe][l][mprime_dword]>>(2*mprime_qpsk_symb))&3,k,phy_vars_eNB->lte_gold_mbsfn_table[subframe][l][mprime_dword]); msg("index = %d (k %d)(%x)\n",(eNB->lte_gold_mbsfn_table[subframe][l][mprime_dword]>>(2*mprime_qpsk_symb))&3,k,eNB->lte_gold_mbsfn_table[subframe][l][mprime_dword]);
#endif #endif
mprime++; mprime++;
...@@ -82,7 +82,7 @@ int lte_dl_mbsfn(PHY_VARS_eNB *phy_vars_eNB, int32_t *output, ...@@ -82,7 +82,7 @@ int lte_dl_mbsfn(PHY_VARS_eNB *phy_vars_eNB, int32_t *output,
int lte_dl_mbsfn_rx(PHY_VARS_UE *phy_vars_ue, int lte_dl_mbsfn_rx(PHY_VARS_UE *ue,
int *output, int *output,
int subframe, int subframe,
unsigned char l) unsigned char l)
...@@ -103,20 +103,20 @@ int lte_dl_mbsfn_rx(PHY_VARS_UE *phy_vars_ue, ...@@ -103,20 +103,20 @@ int lte_dl_mbsfn_rx(PHY_VARS_UE *phy_vars_ue,
((short *)&qpsk[3])[0] = -ONE_OVER_SQRT2_Q15; ((short *)&qpsk[3])[0] = -ONE_OVER_SQRT2_Q15;
((short *)&qpsk[3])[1] = ONE_OVER_SQRT2_Q15; ((short *)&qpsk[3])[1] = ONE_OVER_SQRT2_Q15;
mprime = 3*(110 - phy_vars_ue->lte_frame_parms.N_RB_DL); mprime = 3*(110 - ue->frame_parms.N_RB_DL);
for (m=0; m<phy_vars_ue->lte_frame_parms.N_RB_DL*6; m++) { for (m=0; m<ue->frame_parms.N_RB_DL*6; m++) {
mprime_dword = mprime>>4; mprime_dword = mprime>>4;
mprime_qpsk_symb = mprime&0xf; mprime_qpsk_symb = mprime&0xf;
// this is r_mprime from 3GPP 36-211 6.10.1.2 // this is r_mprime from 3GPP 36-211 6.10.1.2
output[k] = qpsk[(phy_vars_ue->lte_gold_mbsfn_table[subframe][l][mprime_dword]>>(2*mprime_qpsk_symb))&3]; output[k] = qpsk[(ue->lte_gold_mbsfn_table[subframe][l][mprime_dword]>>(2*mprime_qpsk_symb))&3];
#ifdef DEBUG_DL_MBSFN #ifdef DEBUG_DL_MBSFN
printf("subframe %d, l %d, m %d, mprime %d, mprime_dword %d, mprime_qpsk_symbol %d\n", printf("subframe %d, l %d, m %d, mprime %d, mprime_dword %d, mprime_qpsk_symbol %d\n",
subframe,l,m,mprime, mprime_dword,mprime_qpsk_symb); subframe,l,m,mprime, mprime_dword,mprime_qpsk_symb);
printf("index = %d (k %d) (%x)\n",(phy_vars_ue->lte_gold_mbsfn_table[subframe][l][mprime_dword]>>(2*mprime_qpsk_symb))&3,k,phy_vars_ue->lte_gold_mbsfn_table[subframe][l][mprime_dword]); printf("index = %d (k %d) (%x)\n",(ue->lte_gold_mbsfn_table[subframe][l][mprime_dword]>>(2*mprime_qpsk_symb))&3,k,ue->lte_gold_mbsfn_table[subframe][l][mprime_dword]);
#endif #endif
mprime++; mprime++;
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
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},{-1,-1,1,1},{1,-1,-1,1},{-1,1,1,-1}}; 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},{-1,-1,1,1},{1,-1,-1,1},{-1,1,1,-1}};
int lte_dl_ue_spec(PHY_VARS_eNB *phy_vars_eNB, int lte_dl_ue_spec(PHY_VARS_eNB *eNB,
uint8_t UE_id, uint8_t UE_id,
int32_t *output, int32_t *output,
short amp, short amp,
...@@ -35,7 +35,7 @@ int lte_dl_ue_spec(PHY_VARS_eNB *phy_vars_eNB, ...@@ -35,7 +35,7 @@ int lte_dl_ue_spec(PHY_VARS_eNB *phy_vars_eNB,
int32_t qpsk[4],nqpsk[4],*qpsk_p,*output_p; int32_t qpsk[4],nqpsk[4],*qpsk_p,*output_p;
int16_t a; int16_t a;
int w,lprime,ind,l,ind_dword,ind_qpsk_symb,nPRB; int w,lprime,ind,l,ind_dword,ind_qpsk_symb,nPRB;
// LTE_eNB_DLSCH_t *dlsch = phy_vars_eNB->dlsch_eNB[UE_id][0]; // LTE_eNB_DLSCH_t *dlsch = eNB->dlsch_eNB[UE_id][0];
a = (amp*ONE_OVER_SQRT2_Q15)>>15; a = (amp*ONE_OVER_SQRT2_Q15)>>15;
((short *)&qpsk[0])[0] = a; ((short *)&qpsk[0])[0] = a;
...@@ -58,13 +58,13 @@ int lte_dl_ue_spec(PHY_VARS_eNB *phy_vars_eNB, ...@@ -58,13 +58,13 @@ int lte_dl_ue_spec(PHY_VARS_eNB *phy_vars_eNB,
if (p>=7) { if (p>=7) {
if (SS_flag==0) { if (SS_flag==0) {
if (phy_vars_eNB->lte_frame_parms.Ncp == NORMAL) { if (eNB->frame_parms.Ncp == NORMAL) {
// this is 3GPP 36-211 6.10.3.2, NORMAL CP, p>=7 // this is 3GPP 36-211 6.10.3.2, NORMAL CP, p>=7
// position output pointer to 5th symbol in slot // position output pointer to 5th symbol in slot
output_p = output+(60*phy_vars_eNB->lte_frame_parms.N_RB_DL); output_p = output+(60*eNB->frame_parms.N_RB_DL);
// shift to 2nd RE in PRB for p=7,8,11,13 // shift to 2nd RE in PRB for p=7,8,11,13
if ((p==7) || (p==8) || (p==11) || (p==13)) output_p++; if ((p==7) || (p==8) || (p==11) || (p==13)) output_p++;
...@@ -72,12 +72,12 @@ int lte_dl_ue_spec(PHY_VARS_eNB *phy_vars_eNB, ...@@ -72,12 +72,12 @@ int lte_dl_ue_spec(PHY_VARS_eNB *phy_vars_eNB,
for (lprime=0; lprime<2; lprime++) { for (lprime=0; lprime<2; lprime++) {
ind = 3*lprime*phy_vars_eNB->lte_frame_parms.N_RB_DL; ind = 3*lprime*eNB->frame_parms.N_RB_DL;
l = lprime + ((Ns&1)<<1); l = lprime + ((Ns&1)<<1);
// loop over pairs of PRBs, this is the periodicity of the W_bar_NCP sequence // loop over pairs of PRBs, this is the periodicity of the W_bar_NCP sequence
// unroll the computations for the 6 pilots, select qpsk or nqpsk as function of W_bar_NCP // unroll the computations for the 6 pilots, select qpsk or nqpsk as function of W_bar_NCP
for (nPRB=0; nPRB<phy_vars_eNB->lte_frame_parms.N_RB_DL; nPRB+=2) { for (nPRB=0; nPRB<eNB->frame_parms.N_RB_DL; nPRB+=2) {
// First pilot // First pilot
w = Wbar_NCP[p-7][l]; w = Wbar_NCP[p-7][l];
...@@ -87,13 +87,13 @@ int lte_dl_ue_spec(PHY_VARS_eNB *phy_vars_eNB, ...@@ -87,13 +87,13 @@ int lte_dl_ue_spec(PHY_VARS_eNB *phy_vars_eNB,
ind_dword = ind>>4; ind_dword = ind>>4;
ind_qpsk_symb = ind&0xf; ind_qpsk_symb = ind&0xf;
*output_p = qpsk_p[(phy_vars_eNB->lte_gold_uespec_table[0][Ns][lprime][ind_dword]>>(2*ind_qpsk_symb))&3]; *output_p = qpsk_p[(eNB->lte_gold_uespec_table[0][Ns][lprime][ind_dword]>>(2*ind_qpsk_symb))&3];
#ifdef DEBUG_DL_UESPEC #ifdef DEBUG_DL_UESPEC
LOG_D(PHY,"Ns %d, l %d, m %d,ind_dword %d, ind_qpsk_symbol %d\n", LOG_D(PHY,"Ns %d, l %d, m %d,ind_dword %d, ind_qpsk_symbol %d\n",
Ns,l,m,mprime_dword,mprime_qpsk_symb); Ns,l,m,mprime_dword,mprime_qpsk_symb);
LOG_D(PHY,"index = %d\n",(phy_vars_eNB->lte_gold_uespec_table[0][Ns][lprime][ind_dword]>>(2*ind_qpsk_symb))&3); LOG_D(PHY,"index = %d\n",(eNB->lte_gold_uespec_table[0][Ns][lprime][ind_dword]>>(2*ind_qpsk_symb))&3);
#endif #endif
output_p+=5; output_p+=5;
...@@ -106,12 +106,12 @@ int lte_dl_ue_spec(PHY_VARS_eNB *phy_vars_eNB, ...@@ -106,12 +106,12 @@ int lte_dl_ue_spec(PHY_VARS_eNB *phy_vars_eNB,
ind_dword = ind>>4; ind_dword = ind>>4;
ind_qpsk_symb = ind&0xf; ind_qpsk_symb = ind&0xf;
*output_p = qpsk_p[(phy_vars_eNB->lte_gold_uespec_table[0][Ns][lprime][ind_dword]>>(2*ind_qpsk_symb))&3]; *output_p = qpsk_p[(eNB->lte_gold_uespec_table[0][Ns][lprime][ind_dword]>>(2*ind_qpsk_symb))&3];
#ifdef DEBUG_DL_UESPEC #ifdef DEBUG_DL_UESPEC
LOG_D(PHY,"Ns %d, l %d, m %d,ind_dword %d, ind_qpsk_symbol %d\n", LOG_D(PHY,"Ns %d, l %d, m %d,ind_dword %d, ind_qpsk_symbol %d\n",
Ns,l,m,mprime_dword,mprime_qpsk_symb); Ns,l,m,mprime_dword,mprime_qpsk_symb);
LOG_D(PHY,"index = %d\n",(phy_vars_eNB->lte_gold_uespec_table[0][Ns][lprime][ind_dword]>>(2*ind_qpsk_symb))&3); LOG_D(PHY,"index = %d\n",(eNB->lte_gold_uespec_table[0][Ns][lprime][ind_dword]>>(2*ind_qpsk_symb))&3);
#endif #endif
output_p+=5; output_p+=5;
...@@ -123,12 +123,12 @@ int lte_dl_ue_spec(PHY_VARS_eNB *phy_vars_eNB, ...@@ -123,12 +123,12 @@ int lte_dl_ue_spec(PHY_VARS_eNB *phy_vars_eNB,
ind_dword = ind>>4; ind_dword = ind>>4;
ind_qpsk_symb = ind&0xf; ind_qpsk_symb = ind&0xf;
*output_p = qpsk_p[(phy_vars_eNB->lte_gold_uespec_table[0][Ns][lprime][ind_dword]>>(2*ind_qpsk_symb))&3]; *output_p = qpsk_p[(eNB->lte_gold_uespec_table[0][Ns][lprime][ind_dword]>>(2*ind_qpsk_symb))&3];
#ifdef DEBUG_DL_UESPEC #ifdef DEBUG_DL_UESPEC
LOG_D(PHY,"Ns %d, l %d, m %d,ind_dword %d, ind_qpsk_symbol %d\n", LOG_D(PHY,"Ns %d, l %d, m %d,ind_dword %d, ind_qpsk_symbol %d\n",
Ns,l,m,mprime_dword,mprime_qpsk_symb); Ns,l,m,mprime_dword,mprime_qpsk_symb);
LOG_D(PHY,"index = %d\n",(phy_vars_eNB->lte_gold_uespec_table[0][Ns][lprime][ind_dword]>>(2*ind_qpsk_symb))&3); LOG_D(PHY,"index = %d\n",(eNB->lte_gold_uespec_table[0][Ns][lprime][ind_dword]>>(2*ind_qpsk_symb))&3);
#endif #endif
output_p+=2; output_p+=2;
...@@ -142,13 +142,13 @@ int lte_dl_ue_spec(PHY_VARS_eNB *phy_vars_eNB, ...@@ -142,13 +142,13 @@ int lte_dl_ue_spec(PHY_VARS_eNB *phy_vars_eNB,
ind_dword = ind>>4; ind_dword = ind>>4;
ind_qpsk_symb = ind&0xf; ind_qpsk_symb = ind&0xf;
*output_p = qpsk_p[(phy_vars_eNB->lte_gold_uespec_table[0][Ns][lprime][ind_dword]>>(2*ind_qpsk_symb))&3]; *output_p = qpsk_p[(eNB->lte_gold_uespec_table[0][Ns][lprime][ind_dword]>>(2*ind_qpsk_symb))&3];
#ifdef DEBUG_DL_UESPEC #ifdef DEBUG_DL_UESPEC
LOG_D(PHY,"Ns %d, l %d, m %d,ind_dword %d, ind_qpsk_symbol %d\n", LOG_D(PHY,"Ns %d, l %d, m %d,ind_dword %d, ind_qpsk_symbol %d\n",
Ns,l,m,mprime_dword,mprime_qpsk_symb); Ns,l,m,mprime_dword,mprime_qpsk_symb);
LOG_D(PHY,"index = %d\n",(phy_vars_eNB->lte_gold_uespec_table[0][Ns][lprime][ind_dword]>>(2*ind_qpsk_symb))&3); LOG_D(PHY,"index = %d\n",(eNB->lte_gold_uespec_table[0][Ns][lprime][ind_dword]>>(2*ind_qpsk_symb))&3);
#endif #endif
output_p+=5; output_p+=5;
...@@ -161,12 +161,12 @@ int lte_dl_ue_spec(PHY_VARS_eNB *phy_vars_eNB, ...@@ -161,12 +161,12 @@ int lte_dl_ue_spec(PHY_VARS_eNB *phy_vars_eNB,
ind_dword = ind>>4; ind_dword = ind>>4;
ind_qpsk_symb = ind&0xf; ind_qpsk_symb = ind&0xf;
*output_p = qpsk_p[(phy_vars_eNB->lte_gold_uespec_table[0][Ns][lprime][ind_dword]>>(2*ind_qpsk_symb))&3]; *output_p = qpsk_p[(eNB->lte_gold_uespec_table[0][Ns][lprime][ind_dword]>>(2*ind_qpsk_symb))&3];
#ifdef DEBUG_DL_UESPEC #ifdef DEBUG_DL_UESPEC
LOG_D(PHY,"Ns %d, l %d, m %d,ind_dword %d, ind_qpsk_symbol %d\n", LOG_D(PHY,"Ns %d, l %d, m %d,ind_dword %d, ind_qpsk_symbol %d\n",
Ns,l,m,mprime_dword,mprime_qpsk_symb); Ns,l,m,mprime_dword,mprime_qpsk_symb);
LOG_D(PHY,"index = %d\n",(phy_vars_eNB->lte_gold_uespec_table[0][Ns][lprime][ind_dword]>>(2*ind_qpsk_symb))&3); LOG_D(PHY,"index = %d\n",(eNB->lte_gold_uespec_table[0][Ns][lprime][ind_dword]>>(2*ind_qpsk_symb))&3);
#endif #endif
output_p+=5; output_p+=5;
...@@ -178,12 +178,12 @@ int lte_dl_ue_spec(PHY_VARS_eNB *phy_vars_eNB, ...@@ -178,12 +178,12 @@ int lte_dl_ue_spec(PHY_VARS_eNB *phy_vars_eNB,
ind_dword = ind>>4; ind_dword = ind>>4;
ind_qpsk_symb = ind&0xf; ind_qpsk_symb = ind&0xf;
*output_p = qpsk_p[(phy_vars_eNB->lte_gold_uespec_table[0][Ns][lprime][ind_dword]>>(2*ind_qpsk_symb))&3]; *output_p = qpsk_p[(eNB->lte_gold_uespec_table[0][Ns][lprime][ind_dword]>>(2*ind_qpsk_symb))&3];
#ifdef DEBUG_DL_UESPEC #ifdef DEBUG_DL_UESPEC
LOG_D(PHY,"Ns %d, l %d, m %d,ind_dword %d, ind_qpsk_symbol %d\n", LOG_D(PHY,"Ns %d, l %d, m %d,ind_dword %d, ind_qpsk_symbol %d\n",
Ns,l,m,mprime_dword,mprime_qpsk_symb); Ns,l,m,mprime_dword,mprime_qpsk_symb);
LOG_D(PHY,"index = %d\n",(phy_vars_eNB->lte_gold_uespec_table[0][Ns][lprime][ind_dword]>>(2*ind_qpsk_symb))&3); LOG_D(PHY,"index = %d\n",(eNB->lte_gold_uespec_table[0][Ns][lprime][ind_dword]>>(2*ind_qpsk_symb))&3);
#endif #endif
output_p+=2; output_p+=2;
...@@ -231,9 +231,9 @@ int lte_dl_cell_spec_rx(PHY_VARS_UE *phy_vars_ue, ...@@ -231,9 +231,9 @@ int lte_dl_cell_spec_rx(PHY_VARS_UE *phy_vars_ue,
((short *)&qpsk[3])[0] = -pamp; ((short *)&qpsk[3])[0] = -pamp;
((short *)&qpsk[3])[1] = pamp; ((short *)&qpsk[3])[1] = pamp;
mprime = 110 - phy_vars_ue->lte_frame_parms.N_RB_DL; mprime = 110 - phy_vars_ue->frame_parms.N_RB_DL;
for (m=0;m<phy_vars_ue->lte_frame_parms.N_RB_DL<<1;m++) { for (m=0;m<phy_vars_ue->frame_parms.N_RB_DL<<1;m++) {
mprime_dword = mprime>>4; mprime_dword = mprime>>4;
mprime_qpsk_symb = mprime&0xf; mprime_qpsk_symb = mprime&0xf;
......
This diff is collapsed.
This diff is collapsed.
...@@ -114,7 +114,7 @@ typedef struct { ...@@ -114,7 +114,7 @@ typedef struct {
/// downlink power offset field /// downlink power offset field
uint8_t dl_power_off; uint8_t dl_power_off;
/// Concatenated "e"-sequences (for definition see 36-212 V8.6 2009-03, p.17-18) /// Concatenated "e"-sequences (for definition see 36-212 V8.6 2009-03, p.17-18)
uint8_t e[MAX_NUM_CHANNEL_BITS]; uint8_t e[MAX_NUM_CHANNEL_BITS] __attribute__((aligned(32)));
/// Turbo-code outputs (36-212 V8.6 2009-03, p.12 /// Turbo-code outputs (36-212 V8.6 2009-03, p.12
uint8_t *d[MAX_NUM_DLSCH_SEGMENTS];//[(96+3+(3*6144))]; uint8_t *d[MAX_NUM_DLSCH_SEGMENTS];//[(96+3+(3*6144))];
/// Sub-block interleaver outputs (36-212 V8.6 2009-03, p.16-17) /// Sub-block interleaver outputs (36-212 V8.6 2009-03, p.16-17)
...@@ -378,7 +378,7 @@ typedef struct { ...@@ -378,7 +378,7 @@ typedef struct {
/// coded RI bits /// coded RI bits
int16_t q_RI[MAX_RI_PAYLOAD]; int16_t q_RI[MAX_RI_PAYLOAD];
/// Concatenated "e"-sequences (for definition see 36-212 V8.6 2009-03, p.17-18) /// Concatenated "e"-sequences (for definition see 36-212 V8.6 2009-03, p.17-18)
int16_t e[MAX_NUM_CHANNEL_BITS]; int16_t e[MAX_NUM_CHANNEL_BITS] __attribute__((aligned(32)));
/// Temporary h sequence to flag PUSCH_x/PUSCH_y symbols which are not scrambled /// Temporary h sequence to flag PUSCH_x/PUSCH_y symbols which are not scrambled
uint8_t h[MAX_NUM_CHANNEL_BITS]; uint8_t h[MAX_NUM_CHANNEL_BITS];
/// Pointer to the payload /// Pointer to the payload
...@@ -674,6 +674,8 @@ typedef struct { ...@@ -674,6 +674,8 @@ typedef struct {
uint32_t Nsoft; uint32_t Nsoft;
/// Maximum number of Turbo iterations /// Maximum number of Turbo iterations
uint8_t max_turbo_iterations; uint8_t max_turbo_iterations;
/// number of iterations used in last turbo decoding
uint8_t last_iteration_cnt;
/// accumulated tx power adjustment for PUCCH /// accumulated tx power adjustment for PUCCH
int8_t g_pucch; int8_t g_pucch;
} LTE_UE_DLSCH_t; } LTE_UE_DLSCH_t;
...@@ -690,13 +692,17 @@ typedef enum {format0, ...@@ -690,13 +692,17 @@ typedef enum {format0,
format2B, format2B,
format2C, format2C,
format2D, format2D,
format3 format3,
format3A,
format4
} DCI_format_t; } DCI_format_t;
typedef enum { typedef enum {
SI_PDSCH=0, SI_PDSCH=0,
RA_PDSCH, RA_PDSCH,
P_PDSCH,
PDSCH, PDSCH,
PDSCH1,
PMCH PMCH
} PDSCH_t; } PDSCH_t;
......
This diff is collapsed.
...@@ -159,7 +159,8 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue, ...@@ -159,7 +159,8 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue,
#ifdef DEBUG_DLSCH_DECODING #ifdef DEBUG_DLSCH_DECODING
uint16_t i; uint16_t i;
#endif #endif
#ifdef __AVX2__ //#ifdef __AVX2__
#if 0
int Kr_last,skipped_last=0; int Kr_last,skipped_last=0;
uint8_t (*tc_2cw)(int16_t *y, uint8_t (*tc_2cw)(int16_t *y,
int16_t *y2, int16_t *y2,
...@@ -220,7 +221,8 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue, ...@@ -220,7 +221,8 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue,
} }
if (llr8_flag == 0) { if (llr8_flag == 0) {
#ifdef __AVX2__ //#ifdef __AVX2__
#if 0
tc_2cw = phy_threegpplte_turbo_decoder16avx2; tc_2cw = phy_threegpplte_turbo_decoder16avx2;
#endif #endif
tc = phy_threegpplte_turbo_decoder16; tc = phy_threegpplte_turbo_decoder16;
...@@ -639,6 +641,8 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue, ...@@ -639,6 +641,8 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue,
} }
} }
dlsch->last_iteration_cnt = ret;
return(ret); return(ret);
} }
...@@ -783,7 +787,7 @@ int dlsch_abstraction_MIESM(double* sinr_dB,uint8_t TM, uint32_t rb_alloc[4], ui ...@@ -783,7 +787,7 @@ int dlsch_abstraction_MIESM(double* sinr_dB,uint8_t TM, uint32_t rb_alloc[4], ui
uint32_t dlsch_decoding_emul(PHY_VARS_UE *phy_vars_ue, uint32_t dlsch_decoding_emul(PHY_VARS_UE *phy_vars_ue,
uint8_t subframe, uint8_t subframe,
uint8_t dlsch_id, PDSCH_t dlsch_id,
uint8_t eNB_id) uint8_t eNB_id)
{ {
...@@ -799,7 +803,7 @@ uint32_t dlsch_decoding_emul(PHY_VARS_UE *phy_vars_ue, ...@@ -799,7 +803,7 @@ uint32_t dlsch_decoding_emul(PHY_VARS_UE *phy_vars_ue,
// may not be necessary for PMCH?? // may not be necessary for PMCH??
for (eNB_id2=0; eNB_id2<NB_eNB_INST; eNB_id2++) { for (eNB_id2=0; eNB_id2<NB_eNB_INST; eNB_id2++) {
if (PHY_vars_eNB_g[eNB_id2][CC_id]->lte_frame_parms.Nid_cell == phy_vars_ue->lte_frame_parms.Nid_cell) if (PHY_vars_eNB_g[eNB_id2][CC_id]->frame_parms.Nid_cell == phy_vars_ue->frame_parms.Nid_cell)
break; break;
} }
...@@ -814,9 +818,9 @@ uint32_t dlsch_decoding_emul(PHY_VARS_UE *phy_vars_ue, ...@@ -814,9 +818,9 @@ uint32_t dlsch_decoding_emul(PHY_VARS_UE *phy_vars_ue,
switch (dlsch_id) { switch (dlsch_id) {
case 0: // SI case SI_PDSCH: // SI
dlsch_ue = phy_vars_ue->dlsch_ue_SI[eNB_id]; dlsch_ue = phy_vars_ue->dlsch_SI[eNB_id];
dlsch_eNB = PHY_vars_eNB_g[eNB_id2][CC_id]->dlsch_eNB_SI; dlsch_eNB = PHY_vars_eNB_g[eNB_id2][CC_id]->dlsch_SI;
// printf("Doing SI: TBS %d\n",dlsch_ue->harq_processes[0]->TBS>>3); // printf("Doing SI: TBS %d\n",dlsch_ue->harq_processes[0]->TBS>>3);
memcpy(dlsch_ue->harq_processes[0]->b,dlsch_eNB->harq_processes[0]->b,dlsch_ue->harq_processes[0]->TBS>>3); memcpy(dlsch_ue->harq_processes[0]->b,dlsch_eNB->harq_processes[0]->b,dlsch_ue->harq_processes[0]->TBS>>3);
#ifdef DEBUG_DLSCH_DECODING #ifdef DEBUG_DLSCH_DECODING
...@@ -830,9 +834,9 @@ uint32_t dlsch_decoding_emul(PHY_VARS_UE *phy_vars_ue, ...@@ -830,9 +834,9 @@ uint32_t dlsch_decoding_emul(PHY_VARS_UE *phy_vars_ue,
return(1); return(1);
break; break;
case 1: // RA case RA_PDSCH: // RA
dlsch_ue = phy_vars_ue->dlsch_ue_ra[eNB_id]; dlsch_ue = phy_vars_ue->dlsch_ra[eNB_id];
dlsch_eNB = PHY_vars_eNB_g[eNB_id2][CC_id]->dlsch_eNB_ra; dlsch_eNB = PHY_vars_eNB_g[eNB_id2][CC_id]->dlsch_ra;
memcpy(dlsch_ue->harq_processes[0]->b,dlsch_eNB->harq_processes[0]->b,dlsch_ue->harq_processes[0]->TBS>>3); memcpy(dlsch_ue->harq_processes[0]->b,dlsch_eNB->harq_processes[0]->b,dlsch_ue->harq_processes[0]->TBS>>3);
#ifdef DEBUG_DLSCH_DECODING #ifdef DEBUG_DLSCH_DECODING
LOG_D(PHY,"RA Decoded\n"); LOG_D(PHY,"RA Decoded\n");
...@@ -845,12 +849,12 @@ uint32_t dlsch_decoding_emul(PHY_VARS_UE *phy_vars_ue, ...@@ -845,12 +849,12 @@ uint32_t dlsch_decoding_emul(PHY_VARS_UE *phy_vars_ue,
return(1); return(1);
break; break;
case 2: // TB0 case PDSCH: // TB0
dlsch_ue = phy_vars_ue->dlsch_ue[eNB_id][0]; dlsch_ue = phy_vars_ue->dlsch[eNB_id][0];
harq_pid = dlsch_ue->current_harq_pid; harq_pid = dlsch_ue->current_harq_pid;
ue_id= (uint32_t)find_ue((int16_t)phy_vars_ue->lte_ue_pdcch_vars[(uint32_t)eNB_id]->crnti,PHY_vars_eNB_g[eNB_id2][CC_id]); ue_id= (uint32_t)find_ue((int16_t)phy_vars_ue->pdcch_vars[(uint32_t)eNB_id]->crnti,PHY_vars_eNB_g[eNB_id2][CC_id]);
DevAssert( ue_id != (uint32_t)-1 ); DevAssert( ue_id != (uint32_t)-1 );
dlsch_eNB = PHY_vars_eNB_g[eNB_id2][CC_id]->dlsch_eNB[ue_id][0]; dlsch_eNB = PHY_vars_eNB_g[eNB_id2][CC_id]->dlsch[ue_id][0];
#ifdef DEBUG_DLSCH_DECODING #ifdef DEBUG_DLSCH_DECODING
...@@ -885,17 +889,18 @@ uint32_t dlsch_decoding_emul(PHY_VARS_UE *phy_vars_ue, ...@@ -885,17 +889,18 @@ uint32_t dlsch_decoding_emul(PHY_VARS_UE *phy_vars_ue,
dlsch_ue->harq_ack[subframe].ack = 0; dlsch_ue->harq_ack[subframe].ack = 0;
dlsch_ue->harq_ack[subframe].harq_id = harq_pid; dlsch_ue->harq_ack[subframe].harq_id = harq_pid;
dlsch_ue->harq_ack[subframe].send_harq_status = 1; dlsch_ue->harq_ack[subframe].send_harq_status = 1;
dlsch_ue->last_iteration_cnt = 1+dlsch_ue->max_turbo_iterations;
return(1+dlsch_ue->max_turbo_iterations); return(1+dlsch_ue->max_turbo_iterations);
} }
break; break;
case 3: { // TB1 case PDSCH1: { // TB1
dlsch_ue = phy_vars_ue->dlsch_ue[eNB_id][1]; dlsch_ue = phy_vars_ue->dlsch[eNB_id][1];
harq_pid = dlsch_ue->current_harq_pid; harq_pid = dlsch_ue->current_harq_pid;
int8_t UE_id = find_ue( phy_vars_ue->lte_ue_pdcch_vars[eNB_id]->crnti, PHY_vars_eNB_g[eNB_id2][CC_id] ); int8_t UE_id = find_ue( phy_vars_ue->pdcch_vars[eNB_id]->crnti, PHY_vars_eNB_g[eNB_id2][CC_id] );
DevAssert( UE_id != -1 ); DevAssert( UE_id != -1 );
dlsch_eNB = PHY_vars_eNB_g[eNB_id2][CC_id]->dlsch_eNB[UE_id][1]; dlsch_eNB = PHY_vars_eNB_g[eNB_id2][CC_id]->dlsch[UE_id][1];
// reset HARQ // reset HARQ
dlsch_ue->harq_processes[harq_pid]->status = SCH_IDLE; dlsch_ue->harq_processes[harq_pid]->status = SCH_IDLE;
dlsch_ue->harq_processes[harq_pid]->round = 0; dlsch_ue->harq_processes[harq_pid]->round = 0;
...@@ -909,10 +914,10 @@ uint32_t dlsch_decoding_emul(PHY_VARS_UE *phy_vars_ue, ...@@ -909,10 +914,10 @@ uint32_t dlsch_decoding_emul(PHY_VARS_UE *phy_vars_ue,
break; break;
} }
case 5: // PMCH case PMCH: // PMCH
dlsch_ue = phy_vars_ue->dlsch_ue_MCH[eNB_id]; dlsch_ue = phy_vars_ue->dlsch_MCH[eNB_id];
dlsch_eNB = PHY_vars_eNB_g[eNB_id2][CC_id]->dlsch_eNB_MCH; dlsch_eNB = PHY_vars_eNB_g[eNB_id2][CC_id]->dlsch_MCH;
LOG_D(PHY,"decoding pmch emul (size is %d, enb %d %d)\n", dlsch_ue->harq_processes[0]->TBS>>3, eNB_id, eNB_id2); LOG_D(PHY,"decoding pmch emul (size is %d, enb %d %d)\n", dlsch_ue->harq_processes[0]->TBS>>3, eNB_id, eNB_id2);
#ifdef DEBUG_DLSCH_DECODING #ifdef DEBUG_DLSCH_DECODING
...@@ -934,17 +939,20 @@ uint32_t dlsch_decoding_emul(PHY_VARS_UE *phy_vars_ue, ...@@ -934,17 +939,20 @@ uint32_t dlsch_decoding_emul(PHY_VARS_UE *phy_vars_ue,
memcpy(dlsch_ue->harq_processes[0]->b, memcpy(dlsch_ue->harq_processes[0]->b,
dlsch_eNB->harq_processes[0]->b, dlsch_eNB->harq_processes[0]->b,
dlsch_ue->harq_processes[0]->TBS>>3); dlsch_ue->harq_processes[0]->TBS>>3);
dlsch_ue->last_iteration_cnt = 1;
return(1); return(1);
} else { } else {
// retransmission // retransmission
dlsch_ue->last_iteration_cnt = 1+dlsch_ue->max_turbo_iterations;
return(1+dlsch_ue->max_turbo_iterations); return(1+dlsch_ue->max_turbo_iterations);
} }
break; break;
default: default:
dlsch_ue = phy_vars_ue->dlsch_ue[eNB_id][0]; dlsch_ue = phy_vars_ue->dlsch[eNB_id][0];
LOG_E(PHY,"dlsch_decoding_emul: FATAL, unknown DLSCH_id %d\n",dlsch_id); LOG_E(PHY,"dlsch_decoding_emul: FATAL, unknown DLSCH_id %d\n",dlsch_id);
dlsch_ue->last_iteration_cnt = 1+dlsch_ue->max_turbo_iterations;
return(1+dlsch_ue->max_turbo_iterations); return(1+dlsch_ue->max_turbo_iterations);
} }
......
...@@ -832,7 +832,7 @@ void dlsch_64qam_llr(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -832,7 +832,7 @@ void dlsch_64qam_llr(LTE_DL_FRAME_PARMS *frame_parms,
len_mod4 =len&3; len_mod4 =len&3;
len2=len>>2; // length in quad words (4 REs) len2=len>>2; // length in quad words (4 REs)
len2+=(len_mod4?0:1); len2+=((len_mod4==0)?0:1);
for (i=0; i<len2; i++) { for (i=0; i<len2; i++) {
......
This diff is collapsed.
This diff is collapsed.
/*! \file PHY/LTE_TRANSPORT/if4_tools.h
* \brief
* \author S. Sandeep Kumar, Raymond Knopp
* \date 2016
* \version 0.1
* \company Eurecom
* \email: ee13b1025@iith.ac.in, knopp@eurecom.fr
* \note
* \warning
*/
#include "PHY/defs.h"
/// Macro for IF4 packet type
#define IF4p5_PACKET_TYPE 0x080A
#define IF4p5_PULFFT 0x0019
#define IF4p5_PDLFFT 0x0020
#define IF4p5_PRACH 0x0021
struct IF4p5_header {
/// Type
uint16_t type;
/// Sub-Type
uint16_t sub_type;
/// Reserved
uint32_t rsvd;
/// Frame Status
uint32_t frame_status;
} __attribute__ ((__packed__));
typedef struct IF4p5_header IF4p5_header_t;
#define sizeof_IF4p5_header_t 12
void gen_IF4p5_dl_header(IF4p5_header_t*, int, int);
void gen_IF4p5_ul_header(IF4p5_header_t*, int, int);
void gen_IF4p5_prach_header(IF4p5_header_t*, int, int);
void send_IF4p5(PHY_VARS_eNB*, int, int, uint16_t, int);
void recv_IF4p5(PHY_VARS_eNB*, int*, int*, uint16_t*, uint32_t*);
void malloc_IF4p5_buffer(PHY_VARS_eNB*);
This diff is collapsed.
/*! \file PHY/LTE_TRANSPORT/if5_tools.h
* \brief
* \author S. Sandeep Kumar, Raymond Knopp
* \date 2016
* \version 0.1
* \company Eurecom
* \email: ee13b1025@iith.ac.in, knopp@eurecom.fr
* \note
* \warning
*/
#include <stdint.h>
#include "PHY/defs.h"
#define IF5_RRH_GW_DL 0x0022
#define IF5_RRH_GW_UL 0x0023
#define IF5_MOBIPASS 0xbffe
struct IF5_mobipass_header {
///
uint16_t flags;
///
uint16_t fifo_status;
///
uint8_t seqno;
///
uint8_t ack;
///
uint32_t word0;
///
uint32_t time_stamp;
} __attribute__ ((__packed__));
typedef struct IF5_mobipass_header IF5_mobipass_header_t;
#define sizeof_IF5_mobipass_header_t 14
void send_IF5(PHY_VARS_eNB*, openair0_timestamp, int, uint8_t*, uint16_t);
void recv_IF5(PHY_VARS_eNB*, openair0_timestamp*, int, uint16_t);
This diff is collapsed.
...@@ -1024,9 +1024,10 @@ uint16_t rx_pbch_emul(PHY_VARS_UE *phy_vars_ue, ...@@ -1024,9 +1024,10 @@ uint16_t rx_pbch_emul(PHY_VARS_UE *phy_vars_ue,
double bler=0.0;//, x=0.0; double bler=0.0;//, x=0.0;
double sinr=0.0; double sinr=0.0;
uint16_t nb_rb = phy_vars_ue->lte_frame_parms.N_RB_DL; uint16_t nb_rb = phy_vars_ue->frame_parms.N_RB_DL;
int16_t f; int16_t f;
uint8_t CC_id=phy_vars_ue->CC_id; uint8_t CC_id=phy_vars_ue->CC_id;
int frame_rx = phy_vars_ue->proc.proc_rxtx[0].frame_rx;
// compute effective sinr // compute effective sinr
// TODO: adapt this to varible bandwidth // TODO: adapt this to varible bandwidth
...@@ -1045,10 +1046,10 @@ uint16_t rx_pbch_emul(PHY_VARS_UE *phy_vars_ue, ...@@ -1045,10 +1046,10 @@ uint16_t rx_pbch_emul(PHY_VARS_UE *phy_vars_ue,
sinr, sinr,
bler); bler);
if (pbch_phase == (phy_vars_ue->frame_rx % 4)) { if (pbch_phase == (frame_rx % 4)) {
if (uniformrandom() >= bler) { if (uniformrandom() >= bler) {
memcpy(phy_vars_ue->lte_ue_pbch_vars[eNB_id]->decoded_output,PHY_vars_eNB_g[eNB_id][CC_id]->pbch_pdu,PBCH_PDU_SIZE); memcpy(phy_vars_ue->pbch_vars[eNB_id]->decoded_output,PHY_vars_eNB_g[eNB_id][CC_id]->pbch_pdu,PBCH_PDU_SIZE);
return(PHY_vars_eNB_g[eNB_id][CC_id]->lte_frame_parms.nb_antennas_tx_eNB); return(PHY_vars_eNB_g[eNB_id][CC_id]->frame_parms.nb_antennas_tx_eNB);
} else } else
return(-1); return(-1);
} else } else
......
#include "PHY/defs.h"
#include "PHY/extern.h"
#include "assertions.h"
const unsigned int Ttab[4] = {32,64,128,256};
// This function implements the initialization of paging parameters for UE (See Section 7, 36.304)
// It must be called after setting IMSImod1024 during UE startup and after receiving SIB2
int init_ue_paging_info(PHY_VARS_UE *ue, long defaultPagingCycle, long nB) {
LTE_DL_FRAME_PARMS *fp = &ue->frame_parms;
unsigned int T = Ttab[defaultPagingCycle];
unsigned int N = (nB<=2) ? T : (T>>(nB-2));
unsigned int Ns = (nB<2) ? (1<<(2-nB)) : 1;
unsigned int UE_ID = ue->IMSImod1024;
unsigned int i_s = (UE_ID/N)%Ns;
ue->PF = (T/N) * (UE_ID % N);
// This implements Section 7.2 from 36.304
if (Ns==1)
ue->PO = (fp->frame_type==FDD) ? 9 : 0;
else if (Ns==2)
ue->PO = (fp->frame_type==FDD) ? (4+(5*i_s)) : (5*i_s);
else if (Ns==4)
ue->PO = (fp->frame_type==FDD) ? (4*(i_s&1)+(5*(i_s>>1))) : ((i_s&1)+(5*(i_s>>1)));
else
AssertFatal(1==0,"init_ue_paging_info: Ns is %d\n",Ns);
return(0);
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -57,7 +57,7 @@ int mult_cpx_conj_vector(int16_t *x1, ...@@ -57,7 +57,7 @@ int mult_cpx_conj_vector(int16_t *x1,
// we compute 4 cpx multiply for each loop // we compute 4 cpx multiply for each loop
for(i=0; i<(N>>2); i++) { for(i=0; i<(N>>2); i++) {
#if defined(__x86_64__) || defined(__i386__) #if defined(__x86_64__) || defined(__i386__)
tmp_re = _mm_madd_epi16(*x1_128,*x2_128); tmp_re = _mm_madd_epi16(*x1_128,*x2_128);
tmp_im = _mm_shufflelo_epi16(*x1_128,_MM_SHUFFLE(2,3,0,1)); tmp_im = _mm_shufflelo_epi16(*x1_128,_MM_SHUFFLE(2,3,0,1));
tmp_im = _mm_shufflehi_epi16(tmp_im,_MM_SHUFFLE(2,3,0,1)); tmp_im = _mm_shufflehi_epi16(tmp_im,_MM_SHUFFLE(2,3,0,1));
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment