Commit 84a1c737 authored by Raymond Knopp's avatar Raymond Knopp

Merge remote-tracking branch 'origin/develop' into bugfix-48-L1L2signaling

Conflicts:
	openair1/PHY/LTE_TRANSPORT/print_stats.c
	openair1/SCHED/phy_procedures_lte_eNb.c
	openair1/SCHED/phy_procedures_lte_ue.c
	targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf
	targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf
parents 26f5d0d9 16b0ec39
...@@ -8,6 +8,7 @@ job1: ...@@ -8,6 +8,7 @@ job1:
- echo $EXTERNAL_SHARE_DIR - echo $EXTERNAL_SHARE_DIR
- echo $SHELL - echo $SHELL
- git rev-parse --abbrev-ref HEAD - git rev-parse --abbrev-ref HEAD
- git_repo=`git config --get remote.origin.url`
- git_head=`git rev-parse HEAD` - git_head=`git rev-parse HEAD`
- echo $git_head - echo $git_head
- tmp=`git show-ref --head | grep $git_head` - tmp=`git show-ref --head | grep $git_head`
...@@ -23,8 +24,8 @@ job1: ...@@ -23,8 +24,8 @@ job1:
- echo $NRUNS_LTE_SOFTMODEM - echo $NRUNS_LTE_SOFTMODEM
- echo $TIMEOUT_CMD - echo $TIMEOUT_CMD
- mkdir -p $OPENAIR_DIR/cmake_targets/autotests/log - mkdir -p $OPENAIR_DIR/cmake_targets/autotests/log
- python $OPENAIR_DIR/cmake_targets/autotests/run_exec_lte-softmodem_tests.py -c -5GRepoHeadVersion $git_head -n $NFS_SHARE_DIR -u $OAI_USER -p $OAI_PASS $OAI_EXTRA_ARGS -g "$OAI_TEST_CASE_GROUP">& $OPENAIR_DIR/cmake_targets/autotests/python_autotest_cleanup.log - python $OPENAIR_DIR/cmake_targets/autotests/run_exec_lte-softmodem_tests.py -c -5GRepo $git_repo -5GRepoHeadVersion $git_head -n $NFS_SHARE_DIR -u $OAI_USER -p $OAI_PASS $OAI_EXTRA_ARGS -g "$OAI_TEST_CASE_GROUP">& $OPENAIR_DIR/cmake_targets/autotests/python_autotest_cleanup.log
- python $OPENAIR_DIR/cmake_targets/autotests/run_exec_lte-softmodem_tests.py -r -5GRepoHeadVersion $git_head -n $NFS_SHARE_DIR -u $OAI_USER -p $OAI_PASS `echo $OAI_EXTRA_ARGS` -g "$OAI_TEST_CASE_GROUP" --nrun_lte_softmodem $NRUNS_LTE_SOFTMODEM --timeout_cmd $TIMEOUT_CMD >& $OPENAIR_DIR/cmake_targets/autotests/python_autotest.log - python $OPENAIR_DIR/cmake_targets/autotests/run_exec_lte-softmodem_tests.py -r -5GRepo $git_repo -5GRepoHeadVersion $git_head -n $NFS_SHARE_DIR -u $OAI_USER -p $OAI_PASS `echo $OAI_EXTRA_ARGS` -g "$OAI_TEST_CASE_GROUP" --nrun_lte_softmodem $NRUNS_LTE_SOFTMODEM --timeout_cmd $TIMEOUT_CMD >& $OPENAIR_DIR/cmake_targets/autotests/python_autotest.log
- mv $OPENAIR_DIR/cmake_targets/autotests/python_autotest.log $OPENAIR_DIR/cmake_targets/autotests/log/python_autotest.log - mv $OPENAIR_DIR/cmake_targets/autotests/python_autotest.log $OPENAIR_DIR/cmake_targets/autotests/log/python_autotest.log
- mv $OPENAIR_DIR/cmake_targets/autotests/python_autotest_cleanup.log $OPENAIR_DIR/cmake_targets/autotests/log/python_autotest_cleanup.log - mv $OPENAIR_DIR/cmake_targets/autotests/python_autotest_cleanup.log $OPENAIR_DIR/cmake_targets/autotests/log/python_autotest_cleanup.log
- sshpass -p "$OAI_PASS" rsync -az -e "ssh -o StrictHostKeyChecking=no " --rsync-path="mkdir -p $NFS_TEST_RESULTS_DIR && rsync" $OPENAIR_DIR/cmake_targets/autotests/log $OAI_USER@localhost:$NFS_TEST_RESULTS_DIR - sshpass -p "$OAI_PASS" rsync -az -e "ssh -o StrictHostKeyChecking=no " --rsync-path="mkdir -p $NFS_TEST_RESULTS_DIR && rsync" $OPENAIR_DIR/cmake_targets/autotests/log $OAI_USER@localhost:$NFS_TEST_RESULTS_DIR
......
...@@ -176,42 +176,65 @@ add_definitions(-DCMAKER) ...@@ -176,42 +176,65 @@ 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 -O2") set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS} -g -DMALLOC_CHECK_=3 -O2")
Message("RF_BOARD is ${RF_BOARD}")
# Below has been put in comment because does not work with set(GIT_BRANCH "UNKNOWN")
# SVN authentication. set(GIT_COMMIT_HASH "UNKNOWN")
# set(GIT_COMMIT_DATE "UNKNOWN")
#find_package(Subversion)
#if(SUBVERSION_FOUND)
# Subversion_WC_INFO(${OPENAIR_DIR} openair) find_package(Git)
# set (FIRMWARE_VERSION "${openair_WC_REVISION} - ${openair_WC_LAST_CHANGED_DATE}") if(GIT_FOUND)
# Subversion_WC_LOG(${OPENAIR_DIR} Project) message("git found: ${GIT_EXECUTABLE}")
#else() # Get the current working branch
# set (FIRMWARE_VERSION "No svn information") execute_process(
#endif() COMMAND git rev-parse --abbrev-ref HEAD
#add_definitions("-DFIRMWARE_VERSION=\"${FIRMWARE_VERSION}\"") WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE GIT_BRANCH
OUTPUT_STRIP_TRAILING_WHITESPACE
)
# Get the latest abbreviated commit hash of the working branch
execute_process(
COMMAND git log -1 --format=%h
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE GIT_COMMIT_HASH
OUTPUT_STRIP_TRAILING_WHITESPACE
)
# Get the latest commit date of the working branch
execute_process(
COMMAND git log -1 --format=%cd
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE GIT_COMMIT_DATE
OUTPUT_STRIP_TRAILING_WHITESPACE
)
endif()
# Below is a hard-coded info # Below is a hard-coded info
set (FIRMWARE_VERSION "No svn information") set (FIRMWARE_VERSION "No svn information")
add_definitions("-DFIRMWARE_VERSION=\"${FIRMWARE_VERSION}\"") add_definitions("-DFIRMWARE_VERSION=\"${FIRMWARE_VERSION}\"")
add_definitions("-DPACKAGE_VERSION=\"${FIRMWARE_VERSION}\"") add_definitions("-DPACKAGE_VERSION=\"Branch: ${GIT_BRANCH} Abrev. Hash: ${GIT_COMMIT_HASH} Date: ${GIT_COMMIT_DATE}\"")
add_definitions("-DPACKAGE_BUGREPORT=\"OpenAirInterface web site\"") add_definitions("-DPACKAGE_BUGREPORT=\"openair4g-devel@lists.eurecom.fr\"")
# Debug related options # Debug related options
######################################### #########################################
add_boolean_option(MSG_PRINT False "print debug messages") add_boolean_option(ASN_DEBUG False "ASN1 coder/decoder Debug")
add_boolean_option(DISABLE_XER_PRINT False "print XER Format") add_boolean_option(EMIT_ASN_DEBUG False "ASN1 coder/decoder Debug")
add_boolean_option(XER_PRINT False "print XER Format") add_boolean_option(MSG_PRINT False "print debug messages")
add_boolean_option(RRC_MSG_PRINT False "print RRC messages") add_boolean_option(DISABLE_XER_PRINT False "print XER Format")
add_boolean_option(PDCP_MSG_PRINT False "print PDCP messages to /tmp/pdcp.log") add_boolean_option(XER_PRINT False "print XER Format")
add_boolean_option(DEBUG_PDCP_PAYLOAD False "print PDCP PDU to stdout") # if true, make sure that global and PDCP log levels are trace add_boolean_option(RRC_MSG_PRINT False "print RRC messages")
add_boolean_option(PDCP_MSG_PRINT False "print PDCP messages to /tmp/pdcp.log")
add_boolean_option(DEBUG_PDCP_PAYLOAD False "print PDCP PDU to stdout") # if true, make sure that global and PDCP log levels are trace
add_boolean_option(DEBUG_MAC_INTERFACE False "print MAC-RLC PDU exchange to stdout") # if true, make sure that global and PDCP log levels are trace add_boolean_option(DEBUG_MAC_INTERFACE False "print MAC-RLC PDU exchange to stdout") # if true, make sure that global and PDCP log levels are trace
add_boolean_option(TRACE_RLC_PAYLOAD False "print RLC PDU to stdout") # if true, make sure that global and PDCP log levels are trace add_boolean_option(TRACE_RLC_PAYLOAD False "print RLC PDU to stdout") # if true, make sure that global and PDCP log levels are trace
add_boolean_option(TEST_OMG False "???") add_boolean_option(TEST_OMG False "???")
add_boolean_option(DEBUG_OMG False "???") add_boolean_option(DEBUG_OMG False "???")
add_boolean_option(XFORMS False "This adds the possibility to see the signal oscilloscope") add_boolean_option(XFORMS False "This adds the possibility to see the signal oscilloscope")
add_boolean_option(PRINT_STATS False "This adds the possibility to see the status") add_boolean_option(PRINT_STATS False "This adds the possibility to see the status")
add_boolean_option(DEBUG_CONSOLE False "makes debugging easier, disables stdout/stderr buffering") add_boolean_option(DEBUG_CONSOLE False "makes debugging easier, disables stdout/stderr buffering")
...@@ -322,6 +345,7 @@ set(S1AP_OAI_generated ...@@ -322,6 +345,7 @@ set(S1AP_OAI_generated
${S1AP_C_DIR}/s1ap_decoder.c ${S1AP_C_DIR}/s1ap_decoder.c
${S1AP_C_DIR}/s1ap_encoder.c ${S1AP_C_DIR}/s1ap_encoder.c
${S1AP_C_DIR}/s1ap_xer_print.c ${S1AP_C_DIR}/s1ap_xer_print.c
${S1AP_C_DIR}/s1ap_compare.c
${S1AP_C_DIR}/s1ap_ies_defs.h ${S1AP_C_DIR}/s1ap_ies_defs.h
) )
file(GLOB s1ap_h ${S1AP_C_DIR}/*.h) file(GLOB s1ap_h ${S1AP_C_DIR}/*.h)
...@@ -1086,7 +1110,6 @@ add_library(CN_UTILS ...@@ -1086,7 +1110,6 @@ add_library(CN_UTILS
${OPENAIR3_DIR}/UTILS/conversions.c ${OPENAIR3_DIR}/UTILS/conversions.c
${OPENAIR3_DIR}/UTILS/enum_string.c ${OPENAIR3_DIR}/UTILS/enum_string.c
${OPENAIR3_DIR}/UTILS/log.c ${OPENAIR3_DIR}/UTILS/log.c
${OPENAIR3_DIR}/UTILS/mme_config.c
${OPENAIR3_DIR}/UTILS/mcc_mnc_itu.c ${OPENAIR3_DIR}/UTILS/mcc_mnc_itu.c
) )
...@@ -1427,6 +1450,9 @@ include(FindPkgConfig) ...@@ -1427,6 +1450,9 @@ include(FindPkgConfig)
pkg_search_module(LIBXML2 libxml-2.0 REQUIRED) pkg_search_module(LIBXML2 libxml-2.0 REQUIRED)
include_directories(${LIBXML2_INCLUDE_DIRS}) include_directories(${LIBXML2_INCLUDE_DIRS})
pkg_search_module(LIBXSLT libxslt REQUIRED)
include_directories(${LIBXSLT_INCLUDE_DIRS})
pkg_search_module(OPENSSL openssl REQUIRED) pkg_search_module(OPENSSL openssl REQUIRED)
include_directories(${OPENSSL_INCLUDE_DIRS}) include_directories(${OPENSSL_INCLUDE_DIRS})
...@@ -1718,6 +1744,7 @@ endforeach(myExe) ...@@ -1718,6 +1744,7 @@ endforeach(myExe)
add_executable(test_epc_generate_scenario add_executable(test_epc_generate_scenario
${OPENAIR3_DIR}/TEST/EPC_TEST/generate_scenario.c ${OPENAIR3_DIR}/TEST/EPC_TEST/generate_scenario.c
${OPENAIR3_DIR}/TEST/EPC_TEST/generate_scenario.h
${OPENAIR2_DIR}/ENB_APP/enb_config.h ${OPENAIR2_DIR}/ENB_APP/enb_config.h
${OPENAIR2_DIR}/COMMON/commonDef.h ${OPENAIR2_DIR}/COMMON/commonDef.h
${OPENAIR2_DIR}/COMMON/messages_def.h ${OPENAIR2_DIR}/COMMON/messages_def.h
...@@ -1726,7 +1753,28 @@ add_executable(test_epc_generate_scenario ...@@ -1726,7 +1753,28 @@ add_executable(test_epc_generate_scenario
${OPENAIR_BIN_DIR}/messages_xml.h ${OPENAIR_BIN_DIR}/messages_xml.h
) )
target_link_libraries (test_epc_generate_scenario target_link_libraries (test_epc_generate_scenario
-Wl,--start-group RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB GTPV1U LIB_NAS_UE SECU_CN UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB PHY LFDS ${MSC_LIB} L2 -Wl,--end-group pthread m rt crypt sctp ${LIBXML2_LIBRARIES} ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} ${CONFIG_LIBRARIES} -Wl,--start-group RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB GTPV1U LIB_NAS_UE SECU_CN UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB PHY LFDS ${ITTI_LIB} ${MSC_LIB} L2 -Wl,--end-group pthread m rt crypt sctp ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} ${CONFIG_LIBRARIES}
)
add_executable(test_epc_play_scenario
${OPENAIR3_DIR}/TEST/EPC_TEST/play_scenario.c
${OPENAIR3_DIR}/TEST/EPC_TEST/play_scenario_decode.c
${OPENAIR3_DIR}/TEST/EPC_TEST/play_scenario_display.c
${OPENAIR3_DIR}/TEST/EPC_TEST/play_scenario_fsm.c
${OPENAIR3_DIR}/TEST/EPC_TEST/play_scenario_parse.c
${OPENAIR3_DIR}/TEST/EPC_TEST/play_scenario_s1ap.c
${OPENAIR3_DIR}/TEST/EPC_TEST/play_scenario_s1ap_compare_ie.c
${OPENAIR3_DIR}/TEST/EPC_TEST/play_scenario_s1ap_eNB_defs.h
${OPENAIR3_DIR}/TEST/EPC_TEST/play_scenario_sctp.c
${OPENAIR3_DIR}/TEST/EPC_TEST/play_scenario.h
${OPENAIR2_DIR}/COMMON/commonDef.h
${OPENAIR2_DIR}/COMMON/messages_def.h
${OPENAIR2_DIR}/COMMON/messages_types.h
${OPENAIR_BIN_DIR}/messages_xml.h
)
target_include_directories(test_epc_play_scenario PUBLIC /usr/local/share/asn1c)
target_link_libraries (test_epc_play_scenario
-Wl,--start-group RRC_LIB S1AP_LIB X2AP_LIB GTPV1U LIB_NAS_UE SECU_CN UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB PHY LFDS ${ITTI_LIB} ${MSC_LIB} -Wl,--end-group pthread m rt crypt sctp ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} ${CONFIG_LIBRARIES}
) )
......
...@@ -171,6 +171,41 @@ Obj.# Case# Test# Description ...@@ -171,6 +171,41 @@ Obj.# Case# Test# Description
01 65 04 Band 7 FDD 10MHz DL Throughput for 300 sec for 1TX/1RX 01 65 04 Band 7 FDD 10MHz DL Throughput for 300 sec for 1TX/1RX
01 65 05 Band 7 FDD 20MHz DL Throughput for 300 sec for 1TX/1RX 01 65 05 Band 7 FDD 20MHz DL Throughput for 300 sec for 1TX/1RX
01 70 00 lte-softmodem tests with SoDeRa RF as eNB and ALU EPC w/ Bandrich COTS UE for TX/1RX
01 70 00 Band 7 FDD 5MHz UL Throughput for 300 sec for 1TX/1RX
01 70 01 Band 7 FDD 10MHz UL Throughput for 300 sec for 1TX/1RX
01 70 02 Band 7 FDD 20MHz UL Throughput for 300 sec for 1TX/1RX
01 70 03 Band 7 FDD 5MHz DL Throughput for 300 sec for 1TX/1RX
01 70 04 Band 7 FDD 10MHz DL Throughput for 300 sec for 1TX/1RX
01 70 05 Band 7 FDD 20MHz DL Throughput for 300 sec for 1TX/1RX
01 75 00 lte-softmodem + RRH tests with B210 RF as eNB and ALU EPC w/ Bandrich COTS UE for TX/1RX
01 75 00 Band 7 FDD 5MHz UL Throughput for 300 sec for 1TX/1RX
01 75 01 Band 7 FDD 10MHz UL Throughput for 300 sec for 1TX/1RX
01 75 02 Band 7 FDD 20MHz UL Throughput for 300 sec for 1TX/1RX
01 75 03 Band 7 FDD 5MHz DL Throughput for 300 sec for 1TX/1RX
01 75 04 Band 7 FDD 10MHz DL Throughput for 300 sec for 1TX/1RX
01 75 05 Band 7 FDD 20MHz DL Throughput for 300 sec for 1TX/1RX
01 80 00 lte-softmodem + RRH tests with BladeRF RF as eNB and ALU EPC w/ Bandrich COTS UE for TX/1RX
01 80 00 Band 7 FDD 5MHz UL Throughput for 300 sec for 1TX/1RX
01 80 01 Band 7 FDD 10MHz UL Throughput for 300 sec for 1TX/1RX
01 80 02 Band 7 FDD 20MHz UL Throughput for 300 sec for 1TX/1RX
01 80 03 Band 7 FDD 5MHz DL Throughput for 300 sec for 1TX/1RX
01 80 04 Band 7 FDD 10MHz DL Throughput for 300 sec for 1TX/1RX
01 80 05 Band 7 FDD 20MHz DL Throughput for 300 sec for 1TX/1RX
01 85 00 lte-softmodem + RRH tests with USRP X310 RF as eNB and ALU EPC w/ Bandrich COTS UE for TX/1RX
01 85 00 Band 7 FDD 5MHz UL Throughput for 300 sec for 1TX/1RX
01 85 01 Band 7 FDD 10MHz UL Throughput for 300 sec for 1TX/1RX
01 85 02 Band 7 FDD 20MHz UL Throughput for 300 sec for 1TX/1RX
01 85 03 Band 7 FDD 5MHz DL Throughput for 300 sec for 1TX/1RX
01 85 04 Band 7 FDD 10MHz DL Throughput for 300 sec for 1TX/1RX
01 85 05 Band 7 FDD 20MHz DL Throughput for 300 sec for 1TX/1RX
01 64 lte-softmodem-noS1 tests 01 64 lte-softmodem-noS1 tests
02 Functional test case 02 Functional test case
......
...@@ -12,7 +12,7 @@ trap handle_ctrl_c INT ...@@ -12,7 +12,7 @@ trap handle_ctrl_c INT
source $OPENAIR_DIR/cmake_targets/tools/test_helper source $OPENAIR_DIR/cmake_targets/tools/test_helper
#SUDO="sudo -E " SUDO="sudo -E -S"
tdir=$OPENAIR_DIR/cmake_targets/autotests tdir=$OPENAIR_DIR/cmake_targets/autotests
rm -fr $tdir/bin rm -fr $tdir/bin
mkdir -p $tdir/bin mkdir -p $tdir/bin
...@@ -404,14 +404,12 @@ until [ -z "$1" ] ...@@ -404,14 +404,12 @@ until [ -z "$1" ]
esac esac
done done
if [ "$SET_PASSWORD" == "1" ]; then if [ "$SET_PASSWORD" != "1" ]; then
mypassword=$passwd read -s -p "Enter Password: " passwd
else
read -s -p "Enter Password: " mypassword
fi fi
tmpfile=`mktemp` tmpfile=`mktemp`
echo \'$passwd\' | $SUDO echo $HOME >& $tmpfile echo $passwd | $SUDO echo $HOME > $tmpfile
tstsudo=`cat $tmpfile` tstsudo=`cat $tmpfile`
if [ "$tstsudo" != "$HOME" ]; then if [ "$tstsudo" != "$HOME" ]; then
echo "$USER might not have sudo privileges. Exiting" echo "$USER might not have sudo privileges. Exiting"
...@@ -509,7 +507,7 @@ for search_expr in "${test_case_array[@]}" ...@@ -509,7 +507,7 @@ for search_expr in "${test_case_array[@]}"
if [ "$class" == "compilation" ]; then if [ "$class" == "compilation" ]; then
test_compile "$name" "$compile_prog" "$compile_prog_args" "$pre_exec" "$pre_exec_args" "$main_exec" "$main_exec_args" "search_array_true[@]" "$search_expr_false" "$nruns" "$pre_compile_prog" "$class" "$compile_prog_out" "$tags" test_compile "$name" "$compile_prog" "$compile_prog_args" "$pre_exec" "$pre_exec_args" "$main_exec" "$main_exec_args" "search_array_true[@]" "$search_expr_false" "$nruns" "$pre_compile_prog" "$class" "$compile_prog_out" "$tags"
elif [ "$class" == "execution" ]; then elif [ "$class" == "execution" ]; then
$SUDO killall -q oaisim_nos1 echo \'passwd\' | $SUDO killall -q oaisim_nos1
test_compile_and_run "$name" "$compile_prog" "$compile_prog_args" "$pre_exec" "$pre_exec_args" "$main_exec" "$main_exec_args" "search_array_true[@]" "$search_expr_false" "$nruns" "$pre_compile_prog" "$class" "$compile_prog_out" "$tags" "$mypassword" "$test_config_file" test_compile_and_run "$name" "$compile_prog" "$compile_prog_args" "$pre_exec" "$pre_exec_args" "$main_exec" "$main_exec_args" "search_array_true[@]" "$search_expr_false" "$nruns" "$pre_compile_prog" "$class" "$compile_prog_out" "$tags" "$mypassword" "$test_config_file"
else else
echo "Unexpected class of test case...Skipping the test case $name ...." echo "Unexpected class of test case...Skipping the test case $name ...."
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -131,6 +131,7 @@ def start_ue () : ...@@ -131,6 +131,7 @@ def start_ue () :
ip = IPRoute() ip = IPRoute()
idx = ip.link_lookup(ifname=iface)[0] idx = ip.link_lookup(ifname=iface)[0]
os.system ('route add ' + gw + ' ppp0') os.system ('route add ' + gw + ' ppp0')
os.system('sleep 5')
os.system ('ping ' + gw) os.system ('ping ' + gw)
break break
except Exception, e: except Exception, e:
......
#!/usr/bin/python
import time
import serial
import os
from pyroute2 import IPRoute
import sys
import re
import threading
import signal
import traceback
import os
import commands
# configure the serial connections (the parameters differs on the device you are connecting to)
#First we find an open port to work with
serial_port=''
ser=serial.Serial()
openair_dir = os.environ.get('OPENAIR_DIR')
if openair_dir == None:
print "Error getting OPENAIR_DIR environment variable"
sys.exit(1)
sys.path.append(os.path.expandvars('$OPENAIR_DIR/cmake_targets/autotests/tools/'))
from lib_autotest import *
def find_open_port():
global serial_port, ser
max_ports=100
if os.path.exists(serial_port) == True:
return serial_port
for port in range(0,100):
serial_port = '/dev/ttyUSB'+str(port)
if os.path.exists(serial_port) == True:
print 'New Serial Port : ' + serial_port
break
ser = serial.Serial(port=serial_port)
return
#serial_port = '/dev/ttyUSB2'
bandrich_ppd_config = os.environ.get('OPENAIR_DIR') + '/cmake_targets/autotests/tools/wdial.bandrich.conf'
exit_flag=0
def signal_handler(signal, frame):
print('You pressed Ctrl+C!')
print('Resetting the UE to detached state')
timeout=10
exit_flag=1
send_command('AT+CGATT=0' , 'OK' , timeout)
sys.exit(0)
signal.signal(signal.SIGINT, signal_handler)
#ser.open()
#ser.isOpen()
class pppThread (threading.Thread):
def __init__(self, threadID, name, counter):
threading.Thread.__init__(self)
self.threadID = threadID
self.name = name
self.counter = counter
def run(self):
print "Starting " + self.name
#Here we keep running pppd thread in indefinite loop as this script terminates sometimes
#while 1:
while 1:
time.sleep(5) #Hard coded, do not reduce this number!
print "Starting wvdial now..."
print 'exit_flag = ' + str(exit_flag)
send_command('AT+CGATT=1','OK', 300)
os.system('wvdial -C ' + bandrich_ppd_config + '' )
if exit_flag == 1:
print "Exit flag set to true. Exiting pppThread now"
print "Terminating wvdial now..."
def send_command (cmd, response, timeout):
count=0
sleep_duration = 1
print 'In function: send_command: cmd = <' + cmd + '> response: <' + response + '> \n'
global serial_port, ser
while count <= timeout:
try:
#Sometimes the port does not exist coz of reset in modem.
#In that case, we need to search for this port again
if os.path.exists(serial_port) == False:
find_open_port()
ser.write (cmd + '\r\n')
out = ''
time.sleep(sleep_duration)
count = count + sleep_duration
while ser.inWaiting() > 0:
out += ser.read(1)
print 'out = <' + out + '> response = <' + response + '> \n'
if re.search(response, out):
break
except Exception, e:
error = ' cmd : ' + cmd + ' response : ' + response
error = error + ' In function: ' + sys._getframe().f_code.co_name + ': *** Caught exception: ' + str(e.__class__) + " : " + str( e)
error = error + traceback.format_exc()
print error
def start_ue () :
#print 'Enter your commands below.\r\nInsert "exit" to leave the application.'
timeout=60 #timeout in seconds
send_command('AT', 'OK' , timeout)
#send_command('AT+CFUN=1' , 'OK' , timeout)
#send_command('AT+CGATT=0' , 'OK' , timeout)
send_command('AT+CGATT=1','OK', 300)
#os.system('wvdial -C ' + bandrich_ppd_config + ' &' )
thread_ppp = pppThread(1, "ppp_thread", 1)
thread_ppp.start()
iface='ppp0'
while 1:
time.sleep ( 2)
#Now we check if ppp0 interface is up and running
try:
if exit_flag == 1:
break
ip = IPRoute()
idx = ip.link_lookup(ifname=iface)[0]
os.system ('route add ' + gw + ' ppp0')
os.system('sleep 5')
os.system ('ping ' + gw)
break
except Exception, e:
error = ' Interface ' + iface + 'does not exist...'
error = error + ' In function: ' + sys._getframe().f_code.co_name + ': *** Caught exception: ' + str(e.__class__) + " : " + str( e)
error = error + traceback.format_exc()
print error
thread_ppp.join()
def stop_ue():
timeout=60
os.system('killall wvdial')
send_command('AT', 'OK' , timeout)
send_command('AT+CGATT=0' , 'OK|ERROR' , timeout)
#send_command('AT+CFUN=4' , 'OK' , timeout)
#reset the USB BUS of Bandrich UE
def reset_ue():
stringIdBandrich='Huawei Technologies Co., Ltd. E398 LTE/UMTS/GSM Modem/Networkcard'
status, out = commands.getstatusoutput('lsusb | grep -i \'' + stringIdBandrich + '\'')
if (out == '') :
print "Bandrich 4G LTE Adapter not found. Exiting now..."
sys.exit()
p=re.compile('Bus\s*(\w+)\s*Device\s*(\w+):\s*ID\s*(\w+):(\w+)')
res=p.findall(out)
BusId=res[0][0]
DeviceId=res[0][1]
VendorId=res[0][2]
ProductId=res[0][3]
usb_dir= find_usb_path(VendorId, ProductId)
print "Bandrich 4G LTE Adapter found in..." + usb_dir
cmd = "sudo sh -c \"echo 0 > " + usb_dir + "/authorized\""
os.system(cmd + " ; sleep 15" )
cmd = "sudo sh -c \"echo 1 > " + usb_dir + "/authorized\""
os.system(cmd + " ; sleep 30" )
i=1
gw='192.172.0.1'
while i < len(sys.argv):
arg=sys.argv[i]
if arg == '--start-ue' :
find_open_port()
print 'Using Serial port : ' + serial_port
start_ue()
elif arg == '--stop-ue' :
find_open_port()
print 'Using Serial port : ' + serial_port
stop_ue()
elif arg == '--reset-ue' :
reset_ue()
elif arg == '-gw' :
gw = sys.argv[i+1]
i=i+1
elif arg == '-h' :
print "--reset-ue: Reset the UE on USB Bus. Similar to unplugging and plugging the UE"
print "--stop-ue: Stop the UE. Send DETACH command"
print "--start-ue: Start the UE. Send ATTACH command"
print "-gw: Specify the default gw as sometimes the gateway/route arguments are not set properly via wvdial"
else :
print " Script called with wrong arguments, arg = " + arg
sys.exit()
i = i +1
...@@ -26,6 +26,9 @@ if keyword == 'mme_ip_address': ...@@ -26,6 +26,9 @@ if keyword == 'mme_ip_address':
elif keyword == 'IPV4_LIST': elif keyword == 'IPV4_LIST':
replacement_text = keyword + ' = ( ' + replacement_text + ' ) ; ' replacement_text = keyword + ' = ( ' + replacement_text + ' ) ; '
string = re.sub(r"IPV4_LIST\s*=\s*\(([^\$]+?)\)\s*;", replacement_text, string, re.M) string = re.sub(r"IPV4_LIST\s*=\s*\(([^\$]+?)\)\s*;", replacement_text, string, re.M)
elif keyword == 'rrh_gw_config':
replacement_text = keyword + ' = ( { ' + replacement_text + ' } ) ; '
string = re.sub(r"rrh_gw_config\s*=\s*\(([^\$]+?)\)\s*;", replacement_text, string, re.M)
else : else :
replacement_text = keyword + ' = ' + replacement_text + ' ; ' replacement_text = keyword + ' = ' + replacement_text + ' ; '
string = re.sub(r"%s\s*=\s*([^\$]+?)\s*;" % keyword , replacement_text, string, re.M) string = re.sub(r"%s\s*=\s*([^\$]+?)\s*;" % keyword , replacement_text, string, re.M)
......
...@@ -42,13 +42,13 @@ THIS_SCRIPT_PATH=$(dirname $(readlink -f $0)) ...@@ -42,13 +42,13 @@ THIS_SCRIPT_PATH=$(dirname $(readlink -f $0))
source $THIS_SCRIPT_PATH/tools/build_helper source $THIS_SCRIPT_PATH/tools/build_helper
MSC_GEN="False" MSC_GEN="False"
XFORMS="False" XFORMS="True"
PRINT_STATS="False" PRINT_STATS="False"
VCD_TIMING="False" VCD_TIMING="False"
LOWLATENCY_FLAG_USER="False" LOWLATENCY_FLAG_USER="False"
FORCE_LOWLATENCY_FLAG_USER="" FORCE_LOWLATENCY_FLAG_USER=""
REL="Rel10" REL="Rel10"
HW="EXMIMO" HW="None"
TP="None" TP="None"
NOS1=0 NOS1=0
EPC=0 EPC=0
...@@ -91,7 +91,7 @@ Options ...@@ -91,7 +91,7 @@ Options
default is Rel10, default is Rel10,
Rel8 limits the implementation to 3GPP Release 8 version Rel8 limits the implementation to 3GPP Release 8 version
-w | --hardware -w | --hardware
EXMIMO (Default), USRP, BLADERF, LMSSDR, None EXMIMO, USRP, BLADERF, ETHERNET, LMSSDR, None (Default)
Adds this RF board support (in external packages installation and in compilation) Adds this RF board support (in external packages installation and in compilation)
-t | --transport protocol -t | --transport protocol
ETHERNET , None ETHERNET , None
...@@ -760,9 +760,9 @@ fi ...@@ -760,9 +760,9 @@ fi
rm -fr $OPENAIR_DIR/cmake_targets/autotests/log rm -fr $OPENAIR_DIR/cmake_targets/autotests/log
mkdir -p $OPENAIR_DIR/cmake_targets/autotests/log mkdir -p $OPENAIR_DIR/cmake_targets/autotests/log
if [ "$RUN_GROUP" -eq "1" ]; then if [ "$RUN_GROUP" -eq "1" ]; then
$OPENAIR_DIR/cmake_targets/autotests/run_exec_autotests.bash -g "$TEST_CASE_GROUP" -p '$mypassword' >& $OPENAIR_DIR/cmake_targets/autotests/log/autotests.log & $OPENAIR_DIR/cmake_targets/autotests/run_exec_autotests.bash -g "$TEST_CASE_GROUP" -p $mypassword >& $OPENAIR_DIR/cmake_targets/autotests/log/autotests.log &
else else
$OPENAIR_DIR/cmake_targets/autotests/run_exec_autotests.bash -p '$mypassword' >& $OPENAIR_DIR/cmake_targets/autotests/log/autotests.log & $OPENAIR_DIR/cmake_targets/autotests/run_exec_autotests.bash -p $mypassword >& $OPENAIR_DIR/cmake_targets/autotests/log/autotests.log &
fi fi
wait wait
else else
......
cmake_minimum_required(VERSION 2.8) cmake_minimum_required(VERSION 2.8)
set ( CMAKE_BUILD_TYPE "RelWithDebInfo" ) set ( CMAKE_BUILD_TYPE "RelWithDebInfo" )
set ( ASN_DEBUG False)
set ( ADDR_CONF False ) set ( ADDR_CONF False )
set ( DEBUG_OMG False ) set ( DEBUG_OMG False )
set ( DISABLE_XER_PRINT False ) set ( DISABLE_XER_PRINT False )
set ( DRIVER2013 True ) set ( DRIVER2013 True )
set ( EMOS False ) set ( EMOS False )
set ( EMIT_ASN_DEBUG False )
set ( ENABLE_FXP True ) set ( ENABLE_FXP True )
set ( ENABLE_ITTI True ) set ( ENABLE_ITTI True )
set ( ENABLE_NAS_UE_LOGGING True ) set ( ENABLE_NAS_UE_LOGGING True )
...@@ -47,9 +49,9 @@ set ( OAI_EMU False ) ...@@ -47,9 +49,9 @@ set ( OAI_EMU False )
set ( OAISIM False ) set ( OAISIM False )
set ( OAI_NW_DRIVER_TYPE_ETHERNET False ) set ( OAI_NW_DRIVER_TYPE_ETHERNET False )
set ( OAI_NW_DRIVER_USE_NETLINK True ) set ( OAI_NW_DRIVER_USE_NETLINK True )
set ( OPENAIR1 False ) set ( OPENAIR1 True )
set ( OPENAIR2 False ) set ( OPENAIR2 True )
set ( OPENAIR_LTE F ) set ( OPENAIR_LTE True )
set ( PACKAGE_NAME "epc_test" ) set ( PACKAGE_NAME "epc_test" )
set ( PBS_SIM False ) set ( PBS_SIM False )
set ( PDCP_USE_NETLINK True ) set ( PDCP_USE_NETLINK True )
...@@ -74,4 +76,4 @@ set ( SMBV False ) ...@@ -74,4 +76,4 @@ set ( SMBV False )
set ( TEST_OMG False ) set ( TEST_OMG False )
set ( USE_MME "R10" ) set ( USE_MME "R10" )
set ( USER_MODE True ) set ( USER_MODE True )
set ( XER_PRINT False ) set ( XER_PRINT True )
...@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 2.8) ...@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 2.8)
set(PACKAGE_NAME "unitary_tests_simulators") set(PACKAGE_NAME "unitary_tests_simulators")
set(PHYSIM True) set(PHYSIM True)
set(RF_BOARD None) set(RF_BOARD None)
set(XFORMS False) set(XFORMS True)
set(DEBUG_PHY False) set(DEBUG_PHY False)
set(MU_RECIEVER False) set(MU_RECIEVER False)
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
################################################################################ ################################################################################
# file build_helper # file build_helper
# brief # brief
# author Laurent Thomas # authors Laurent Thomas, Lionel GAUTHIER
# #
####################################### #######################################
SUDO='sudo -E' SUDO='sudo -E'
...@@ -269,7 +269,9 @@ check_install_oai_software() { ...@@ -269,7 +269,9 @@ check_install_oai_software() {
pydb \ pydb \
wvdial \ wvdial \
python-numpy \ python-numpy \
sshpass sshpass \
libxslt1-dev
$SUDO update-alternatives --set liblapack.so /usr/lib/atlas-base/atlas/liblapack.so $SUDO update-alternatives --set liblapack.so /usr/lib/atlas-base/atlas/liblapack.so
if [ `lsb_release -rs` = '12.04' ] ; then if [ `lsb_release -rs` = '12.04' ] ; then
install_nettle_from_source install_nettle_from_source
...@@ -288,13 +290,15 @@ install_asn1c_from_source(){ ...@@ -288,13 +290,15 @@ install_asn1c_from_source(){
asn1_install_dir=$OPENAIR_DIR/cmake_targets/log/asn1c_install_log.txt asn1_install_dir=$OPENAIR_DIR/cmake_targets/log/asn1c_install_log.txt
echo_info "\nInstalling ASN1. The log file for ASN1 installation is here: $asn1_install_dir " echo_info "\nInstalling ASN1. The log file for ASN1 installation is here: $asn1_install_dir "
( (
rm -rf /tmp/asn1c-r1516 $SUDO rm -rf /tmp/asn1c-r1516
mkdir -p /tmp/asn1c-r1516 mkdir -p /tmp/asn1c-r1516
cd /tmp/asn1c-r1516 cd /tmp/asn1c-r1516
svn co https://github.com/vlm/asn1c/trunk /tmp/asn1c-r1516 -r 1516 rm -rf /tmp/asn1c-r1516/*
patch -p0 < $OPENAIR_DIR/openair3/S1AP/MESSAGES/ASN1/asn1cpatch.p0 svn co https://github.com/vlm/asn1c/trunk /tmp/asn1c-r1516 -r 1516 > /tmp/log_compile_asn1c
patch -p0 < $OPENAIR_DIR/openair3/S1AP/MESSAGES/ASN1/asn1cpatch_2.p0 patch -p0 < $OPENAIR_DIR/openair3/S1AP/MESSAGES/ASN1/asn1cpatch.p0 >> /tmp/log_compile_asn1c
patch -p0 < $OPENAIR_DIR/openair2/RRC/LITE/MESSAGES/asn1c/asn1cpatch.p0 patch -p0 < $OPENAIR_DIR/openair3/S1AP/MESSAGES/ASN1/asn1cpatch_2.p0 >> /tmp/log_compile_asn1c
patch -p0 < $OPENAIR_DIR/openair2/RRC/LITE/MESSAGES/asn1c/asn1cpatch.p0 >> /tmp/log_compile_asn1c
patch -p0 < $OPENAIR_DIR/openair3/S1AP/MESSAGES/ASN1/asn1cpatch_3.p0 >> /tmp/log_compile_asn1c
./configure ./configure
make -j`nproc` make -j`nproc`
$SUDO make install $SUDO make install
...@@ -324,7 +328,6 @@ install_nas_tools() { ...@@ -324,7 +328,6 @@ install_nas_tools() {
} }
################################ ################################
# set_openair_env # set_openair_env
############################### ###############################
...@@ -397,4 +400,4 @@ if [[ $ip =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then ...@@ -397,4 +400,4 @@ if [[ $ip =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then
fi fi
return $stat return $stat
} }
\ No newline at end of file
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
# Contact Information # Contact Information
# OpenAirInterface Admin: openair_admin@eurecom.fr # OpenAirInterface Admin: openair_admin@eurecom.fr
# OpenAirInterface Tech : openair_tech@eurecom.fr # OpenAirInterface Tech : openair_tech@eurecom.fr
# OpenAirInterface Dev : openair4g-devel@eurecom.fr # OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr
# #
# Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE # Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
# #
...@@ -121,6 +121,7 @@ function main() ...@@ -121,6 +121,7 @@ function main()
echo "Cleaning TEST_EPC" echo "Cleaning TEST_EPC"
fi fi
rm -f $OPENAIR_DIR/targets/bin/test_epc_generate_scenario rm -f $OPENAIR_DIR/targets/bin/test_epc_generate_scenario
rm -f $OPENAIR_DIR/targets/bin/test_epc_play_scenario
rm -Rf build 2>&1 rm -Rf build 2>&1
mkdir -m 777 -p -v build mkdir -m 777 -p -v build
fi fi
...@@ -140,6 +141,13 @@ function main() ...@@ -140,6 +141,13 @@ function main()
compilations \ compilations \
epc_test test_epc_generate_scenario \ epc_test test_epc_generate_scenario \
test_epc_generate_scenario $dbin/test_epc_generate_scenario test_epc_generate_scenario $dbin/test_epc_generate_scenario
compilations \
epc_test test_epc_play_scenario \
test_epc_play_scenario $dbin/test_epc_play_scenario
$SUDO cp -upv test_epc_generate_scenario /usr/local/bin
$SUDO cp -upv test_epc_play_scenario /usr/local/bin
} }
......
...@@ -29,9 +29,9 @@ ...@@ -29,9 +29,9 @@
################################################################################ ################################################################################
# file run_enb_s1_usrp # file run_enb_s1_usrp
# brief run script for eNB USRP. # brief run script for eNB USRP.
# author Lionel GAUTHIER # author Lionel GAUTHIER and Navid Nikaein
# company Eurecom # company Eurecom
# email: lionel.gauthier@eurecom.fr # email: lionel.gauthier@eurecom.fr and navid.nikaein@eurecom.fr
################################ ################################
...@@ -56,6 +56,8 @@ function help() ...@@ -56,6 +56,8 @@ function help()
echo_error "Mandatory arguments to long options are mandatory for short options too." echo_error "Mandatory arguments to long options are mandatory for short options too."
echo_error " -g, --gdb Run with GDB." echo_error " -g, --gdb Run with GDB."
echo_error " -h, --help Print this help." echo_error " -h, --help Print this help."
echo_error " -e, --ulsch-max-errors num-errs maximum allowed number of uplink errors"
echo_error " -f, --rf-config-file filename RF specific configuration file"
echo_error " -K, --itti-dump-file filename ITTI dump file containing all ITTI events occuring during EPC runtime.(can omit file name if last argument)" echo_error " -K, --itti-dump-file filename ITTI dump file containing all ITTI events occuring during EPC runtime.(can omit file name if last argument)"
echo_error " -M, --target-dl-mcs mcs Downlink target MCS." echo_error " -M, --target-dl-mcs mcs Downlink target MCS."
echo_error " -m, --mscgen directory Generate mscgen output files in a directory" echo_error " -m, --mscgen directory Generate mscgen output files in a directory"
...@@ -137,7 +139,27 @@ function main() ...@@ -137,7 +139,27 @@ function main()
shift; shift;
exit 0 exit 0
;; ;;
-K | --itti-dump-file) -e | --ulsch-max-errors)
ulsch_max_errors=$2
echo "setting --ulsch-max-errors to $ulsch_max_errors"
exe_arguments="$exe_arguments --ulsch-max-errors=$ulsch_max_errors"
shift 2;
;;
-f | --rf-config-file)
rf_config_file=$2
# can omit file name if last arg on the line
if [ "x$rf_config_file" = "x" ]; then
rf_config_file=null
shift 1;
else
shift 2;
fi
if [ "$rf_config_file" != "null" ]; then
echo "setting --rf-config-file to $rf_config_file"
exe_arguments="$exe_arguments --rf-config-file=$rf_config_file"
fi
;;
-K | --itti-dump-file)
itti_dump_file=$2 itti_dump_file=$2
# can omit file name if last arg on the line # can omit file name if last arg on the line
if [ "x$itti_dump_file" = "x" ]; then if [ "x$itti_dump_file" = "x" ]; then
......
...@@ -13,5 +13,5 @@ sudo -E $OPENAIR_DIR/cmake_targets/tools/init_exmimo2 ...@@ -13,5 +13,5 @@ sudo -E $OPENAIR_DIR/cmake_targets/tools/init_exmimo2
#now we stop the card from transmitting anything #now we stop the card from transmitting anything
cd $OPENAIR_DIR/targets/bin cd $OPENAIR_DIR/targets/bin
sudo -E octave $OPENAIR_DIR/cmake_targets/tools/exmimo_stop_octave.m sudo -E octave -H --no-gui $OPENAIR_DIR/cmake_targets/tools/exmimo_stop_octave.m
...@@ -38,23 +38,16 @@ extern int card; ...@@ -38,23 +38,16 @@ extern int card;
#endif #endif
void void
phy_adjust_gain (PHY_VARS_UE *phy_vars_ue, uint8_t eNB_id) phy_adjust_gain (PHY_VARS_UE *phy_vars_ue, uint32_t rx_power_fil_dB, uint8_t eNB_id)
{ {
uint16_t rx_power_fil_dB;
#ifdef EXMIMO #ifdef EXMIMO
exmimo_config_t *p_exmimo_config = openair0_exmimo_pci[card].exmimo_config_ptr; exmimo_config_t *p_exmimo_config = openair0_exmimo_pci[card].exmimo_config_ptr;
uint16_t i; uint16_t i;
#endif #endif
int rssi;
rssi = dB_fixed(phy_vars_ue->PHY_measurements.rssi);
if (rssi>0) rx_power_fil_dB = rssi;
else rx_power_fil_dB = phy_vars_ue->PHY_measurements.rx_power_avg_dB[eNB_id];
LOG_D(PHY,"Gain control: rssi %d (%d,%d)\n", LOG_D(PHY,"Gain control: rssi %d (%d,%d)\n",
rssi, rx_power_fil_dB,
phy_vars_ue->PHY_measurements.rssi, phy_vars_ue->PHY_measurements.rssi,
phy_vars_ue->PHY_measurements.rx_power_avg_dB[eNB_id] phy_vars_ue->PHY_measurements.rx_power_avg_dB[eNB_id]
); );
......
...@@ -213,6 +213,7 @@ int8_t set_RSRQ_filtered(module_id_t Mod_id,uint8_t CC_id,uint8_t eNB_index,floa ...@@ -213,6 +213,7 @@ int8_t set_RSRQ_filtered(module_id_t Mod_id,uint8_t CC_id,uint8_t eNB_index,floa
//! Automatic gain control //! Automatic gain control
void phy_adjust_gain (PHY_VARS_UE *phy_vars_ue, void phy_adjust_gain (PHY_VARS_UE *phy_vars_ue,
uint32_t rx_power_fil_dB,
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,
......
...@@ -485,13 +485,10 @@ int lte_sync_time(int **rxdata, ///rx data in time domain ...@@ -485,13 +485,10 @@ int lte_sync_time(int **rxdata, ///rx data in time domain
*eNB_id = sync_source; *eNB_id = sync_source;
#ifdef DEBUG_PHY LOG_D(PHY,"[UE] lte_sync_time: Sync source = %d, Peak found at pos %d, val = %d (%d dB)\n",sync_source,peak_pos,peak_val,dB_fixed(peak_val)/2);
msg("[PHY][UE] lte_sync_time: Sync source = %d, Peak found at pos %d, val = %d\n",
sync_source,peak_pos,peak_val);
#ifdef DEBUG_PHY
if (debug_cnt == 0) { if (debug_cnt == 0) {
write_output("sync_corr0_ue.m","synccorr0",sync_corr_ue0,2*length,1,2); write_output("sync_corr0_ue.m","synccorr0",sync_corr_ue0,2*length,1,2);
write_output("sync_corr1_ue.m","synccorr1",sync_corr_ue1,2*length,1,2); write_output("sync_corr1_ue.m","synccorr1",sync_corr_ue1,2*length,1,2);
......
...@@ -280,7 +280,6 @@ int initial_sync(PHY_VARS_UE *phy_vars_ue, runmode_t mode) ...@@ -280,7 +280,6 @@ int initial_sync(PHY_VARS_UE *phy_vars_ue, runmode_t mode)
uint8_t flip_fdd_ncp,flip_fdd_ecp,flip_tdd_ncp,flip_tdd_ecp; uint8_t flip_fdd_ncp,flip_fdd_ecp,flip_tdd_ncp,flip_tdd_ecp;
// uint16_t Nid_cell_fdd_ncp=0,Nid_cell_fdd_ecp=0,Nid_cell_tdd_ncp=0,Nid_cell_tdd_ecp=0; // uint16_t Nid_cell_fdd_ncp=0,Nid_cell_fdd_ecp=0,Nid_cell_tdd_ncp=0,Nid_cell_tdd_ecp=0;
LTE_DL_FRAME_PARMS *frame_parms = &phy_vars_ue->lte_frame_parms; LTE_DL_FRAME_PARMS *frame_parms = &phy_vars_ue->lte_frame_parms;
int i;
int ret=-1; int ret=-1;
int aarx,rx_power=0; int aarx,rx_power=0;
/*#ifdef OAI_USRP /*#ifdef OAI_USRP
...@@ -309,34 +308,6 @@ int initial_sync(PHY_VARS_UE *phy_vars_ue, runmode_t mode) ...@@ -309,34 +308,6 @@ int initial_sync(PHY_VARS_UE *phy_vars_ue, runmode_t mode)
LOG_I(PHY,"[UE%d] Initial sync : Estimated PSS position %d, Nid2 %d\n",phy_vars_ue->Mod_id,sync_pos,phy_vars_ue->lte_ue_common_vars.eNb_id); LOG_I(PHY,"[UE%d] Initial sync : Estimated PSS position %d, Nid2 %d\n",phy_vars_ue->Mod_id,sync_pos,phy_vars_ue->lte_ue_common_vars.eNb_id);
#endif #endif
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++)
rx_power += signal_energy(&phy_vars_ue->lte_ue_common_vars.rxdata[aarx][sync_pos2],
frame_parms->ofdm_symbol_size+frame_parms->nb_prefix_samples);
phy_vars_ue->PHY_measurements.rx_power_avg_dB[0] = dB_fixed(rx_power/frame_parms->nb_antennas_rx);
#ifdef DEBUG_INITIAL_SYNCH
LOG_I(PHY,"[UE%d] Initial sync : Estimated power: %d dB\n",phy_vars_ue->Mod_id,phy_vars_ue->PHY_measurements.rx_power_avg_dB[0] );
#endif
#ifdef EXMIMO
if ((openair_daq_vars.rx_gain_mode == DAQ_AGC_ON) &&
(mode != rx_calib_ue) && (mode != rx_calib_ue_med) && (mode != rx_calib_ue_byp) )
//phy_adjust_gain(phy_vars_ue,0);
gain_control_all(phy_vars_ue->PHY_measurements.rx_power_avg_dB[0],0);
#else
#ifndef OAI_USRP
#ifndef OAI_BLADERF
#ifndef OAI_LMSSDR
phy_adjust_gain(phy_vars_ue,0);
#endif
#endif
#endif
#endif
// SSS detection // SSS detection
// PSS is hypothesized in last symbol of first slot in Frame // PSS is hypothesized in last symbol of first slot in Frame
...@@ -525,20 +496,20 @@ int initial_sync(PHY_VARS_UE *phy_vars_ue, runmode_t mode) ...@@ -525,20 +496,20 @@ int initial_sync(PHY_VARS_UE *phy_vars_ue, runmode_t mode)
#endif #endif
if (phy_vars_ue->UE_scan_carrier == 0) { if (phy_vars_ue->UE_scan_carrier == 0) {
#ifdef OPENAIR2 if (phy_vars_ue->mac_enabled==1) {
LOG_I(PHY,"[UE%d] Sending synch status to higher layers\n",phy_vars_ue->Mod_id); LOG_I(PHY,"[UE%d] Sending synch status to higher layers\n",phy_vars_ue->Mod_id);
//mac_resynch(); //mac_resynch();
mac_xface->dl_phy_sync_success(phy_vars_ue->Mod_id,phy_vars_ue->frame_rx,0,1);//phy_vars_ue->lte_ue_common_vars.eNb_id); mac_xface->dl_phy_sync_success(phy_vars_ue->Mod_id,phy_vars_ue->frame_rx,0,1);//phy_vars_ue->lte_ue_common_vars.eNb_id);
#endif //OPENAIR2 phy_vars_ue->UE_mode[0] = PRACH;
}
else {
phy_vars_ue->UE_mode[0] = PUSCH;
}
generate_pcfich_reg_mapping(frame_parms); generate_pcfich_reg_mapping(frame_parms);
generate_phich_reg_mapping(frame_parms); generate_phich_reg_mapping(frame_parms);
// init_prach625(frame_parms); // init_prach625(frame_parms);
#ifndef OPENAIR2
phy_vars_ue->UE_mode[0] = PUSCH;
#else
phy_vars_ue->UE_mode[0] = PRACH;
#endif
//phy_vars_ue->lte_ue_pbch_vars[0]->pdu_errors=0; //phy_vars_ue->lte_ue_pbch_vars[0]->pdu_errors=0;
phy_vars_ue->lte_ue_pbch_vars[0]->pdu_errors_conseq=0; phy_vars_ue->lte_ue_pbch_vars[0]->pdu_errors_conseq=0;
//phy_vars_ue->lte_ue_pbch_vars[0]->pdu_errors_last=0; //phy_vars_ue->lte_ue_pbch_vars[0]->pdu_errors_last=0;
...@@ -592,6 +563,65 @@ int initial_sync(PHY_VARS_UE *phy_vars_ue, runmode_t mode) ...@@ -592,6 +563,65 @@ int initial_sync(PHY_VARS_UE *phy_vars_ue, runmode_t mode)
} }
// gain control
if (ret!=0) { //we are not synched, so we cannot use rssi measurement (which is based on channel estimates)
rx_power = 0;
// do a measurement on the best guess of the PSS
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++)
rx_power += signal_energy(&phy_vars_ue->lte_ue_common_vars.rxdata[aarx][sync_pos2],
frame_parms->ofdm_symbol_size+frame_parms->nb_prefix_samples);
/*
// do a measurement on the full frame
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++)
rx_power += signal_energy(&phy_vars_ue->lte_ue_common_vars.rxdata[aarx][0],
frame_parms->samples_per_tti*10);
*/
// we might add a low-pass filter here later
phy_vars_ue->PHY_measurements.rx_power_avg[0] = rx_power/frame_parms->nb_antennas_rx;
phy_vars_ue->PHY_measurements.rx_power_avg_dB[0] = dB_fixed(phy_vars_ue->PHY_measurements.rx_power_avg[0]);
#ifdef DEBUG_INITIAL_SYNCH
LOG_I(PHY,"[UE%d] Initial sync : Estimated power: %d dB\n",phy_vars_ue->Mod_id,phy_vars_ue->PHY_measurements.rx_power_avg_dB[0] );
#endif
#ifdef EXMIMO
if ((openair_daq_vars.rx_gain_mode == DAQ_AGC_ON) &&
(mode != rx_calib_ue) && (mode != rx_calib_ue_med) && (mode != rx_calib_ue_byp) )
//phy_adjust_gain(phy_vars_ue,0);
gain_control_all(phy_vars_ue->PHY_measurements.rx_power_avg_dB[0],0);
#else
#ifndef OAI_USRP
#ifndef OAI_BLADERF
#ifndef OAI_LMSSDR
phy_adjust_gain(phy_vars_ue,phy_vars_ue->PHY_measurements.rx_power_avg_dB[0],0);
#endif
#endif
#endif
#endif
}
else {
#ifdef EXMIMO
if ((openair_daq_vars.rx_gain_mode == DAQ_AGC_ON) &&
(mode != rx_calib_ue) && (mode != rx_calib_ue_med) && (mode != rx_calib_ue_byp) )
//phy_adjust_gain(phy_vars_ue,0);
gain_control_all(dB_fixed(phy_vars_ue->PHY_measurements.rssi),0);
#else
#ifndef OAI_USRP
#ifndef OAI_BLADERF
#ifndef OAI_LMSSDR
phy_adjust_gain(phy_vars_ue,dB_fixed(phy_vars_ue->PHY_measurements.rssi),0);
#endif
#endif
#endif
#endif
}
// exit_fun("debug exit"); // exit_fun("debug exit");
return ret; return ret;
} }
......
...@@ -107,10 +107,10 @@ int dump_ue_stats(PHY_VARS_UE *phy_vars_ue, char* buffer, int length, runmode_t ...@@ -107,10 +107,10 @@ int dump_ue_stats(PHY_VARS_UE *phy_vars_ue, char* buffer, int length, runmode_t
len += sprintf(&buffer[len], "[UE PROC] timing_advance = %d\n",phy_vars_ue->timing_advance); len += sprintf(&buffer[len], "[UE PROC] timing_advance = %d\n",phy_vars_ue->timing_advance);
if (phy_vars_ue->UE_mode[0]==PUSCH) { if (phy_vars_ue->UE_mode[0]==PUSCH) {
len += sprintf(&buffer[len], "[UE PROC] Po_PUSCH = %d dBm (PL %d dB, Po_NOMINAL_PUSCH %d dBm, PHR %d dB)\n", len += sprintf(&buffer[len], "[UE PROC] Po_PUSCH = %d dBm (PL %d dB, Po_NOMINAL_PUSCH %d dBm, PHR %d dB)\n",
PHY_vars_UE_g[0][0]->ulsch_ue[0]->Po_PUSCH, phy_vars_ue->ulsch_ue[0]->Po_PUSCH,
get_PL(phy_vars_ue->Mod_id,phy_vars_ue->CC_id,0), get_PL(phy_vars_ue->Mod_id,phy_vars_ue->CC_id,0),
mac_xface->get_Po_NOMINAL_PUSCH(phy_vars_ue->Mod_id,0), phy_vars_ue->lte_frame_parms.ul_power_control_config_common.p0_NominalPUSCH,
PHY_vars_UE_g[0][0]->ulsch_ue[0]->PHR); phy_vars_ue->ulsch_ue[0]->PHR);
len += sprintf(&buffer[len], "[UE PROC] Po_PUCCH = %d dBm (Po_NOMINAL_PUCCH %d dBm, g_pucch %d dB)\n", len += sprintf(&buffer[len], "[UE PROC] Po_PUCCH = %d dBm (Po_NOMINAL_PUCCH %d dBm, g_pucch %d dB)\n",
get_PL(phy_vars_ue->Mod_id,phy_vars_ue->CC_id,0)+ get_PL(phy_vars_ue->Mod_id,phy_vars_ue->CC_id,0)+
phy_vars_ue->lte_frame_parms.ul_power_control_config_common.p0_NominalPUCCH+ phy_vars_ue->lte_frame_parms.ul_power_control_config_common.p0_NominalPUCCH+
...@@ -582,9 +582,7 @@ int dump_eNB_stats(PHY_VARS_eNB *phy_vars_eNB, char* buffer, int length) ...@@ -582,9 +582,7 @@ int dump_eNB_stats(PHY_VARS_eNB *phy_vars_eNB, char* buffer, int length)
len += sprintf(&buffer[len],"%4d ", len += sprintf(&buffer[len],"%4d ",
phy_vars_eNB->PHY_measurements_eNB[eNB].n0_subband_power_tot_dBm[i]); phy_vars_eNB->PHY_measurements_eNB[eNB].n0_subband_power_tot_dBm[i]);
if ((i>0) && ((i%25) == 0)) if ((i>0) && ((i%25) == 0))
len += sprintf(&buffer[len],"\n ", len += sprintf(&buffer[len],"\n");
phy_vars_eNB->PHY_measurements_eNB[eNB].n0_subband_power_tot_dBm[i]);
} }
len += sprintf(&buffer[len],"\n"); len += sprintf(&buffer[len],"\n");
len += sprintf(&buffer[len],"\nPERFORMANCE PARAMETERS\n"); len += sprintf(&buffer[len],"\nPERFORMANCE PARAMETERS\n");
......
/*******************************************************************************
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenAirInterface is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
#include "defs.h"
int mult_cpx_matrix_h(short *x1[2][2],
short *x2[2][2],
short *y[2][2],
unsigned int N,
unsigned short output_shift,
short hermitian)
{
if (hermitian) {
// this computes x1^H*x2 and stores it in y
mult_cpx_vector_h(x2[0][0],x1[0][0],y[0][0],N,output_shift,1);
mult_cpx_vector_h(x2[0][1],x1[0][1],y[0][0],N,output_shift,1);
mult_cpx_vector_h(x2[0][0],x1[1][0],y[1][0],N,output_shift,1);
mult_cpx_vector_h(x2[0][1],x1[1][1],y[1][0],N,output_shift,1);
mult_cpx_vector_h(x2[1][0],x1[0][0],y[0][1],N,output_shift,1);
mult_cpx_vector_h(x2[1][1],x1[0][1],y[0][1],N,output_shift,1);
mult_cpx_vector_h(x2[1][0],x1[1][0],y[1][1],N,output_shift,1);
mult_cpx_vector_h(x2[1][1],x1[1][1],y[1][1],N,output_shift,1);
} else {
// this computes x1*x2^H and stores it in y
mult_cpx_vector_h(x1[0][0],x2[0][0],y[0][0],N,output_shift,1);
mult_cpx_vector_h(x1[0][1],x2[0][1],y[0][0],N,output_shift,1);
mult_cpx_vector_h(x1[0][0],x2[1][0],y[0][1],N,output_shift,1);
mult_cpx_vector_h(x1[0][1],x2[1][1],y[0][1],N,output_shift,1);
mult_cpx_vector_h(x1[1][0],x2[0][0],y[1][0],N,output_shift,1);
mult_cpx_vector_h(x1[1][1],x2[0][1],y[1][0],N,output_shift,1);
mult_cpx_vector_h(x1[1][0],x2[1][0],y[1][1],N,output_shift,1);
mult_cpx_vector_h(x1[1][1],x2[1][1],y[1][1],N,output_shift,1);
}
}
int mult_cpx_matrix_vector(int *x1[2][2],
int *x2[2],
int *y[2],
unsigned int N,
unsigned short output_shift)
{
Zero_Buffer(y[0],N*8);
Zero_Buffer(y[1],N*8);
// this computes x1*x2 and stores it in y (32 bit)
mult_cpx_vector_add32((short*)x2[0],(short*)x1[0][0],(short*)y[0],N);
mult_cpx_vector_add32((short*)x2[1],(short*)x1[0][1],(short*)y[0],N);
mult_cpx_vector_add32((short*)x2[0],(short*)x1[1][0],(short*)y[1],N);
mult_cpx_vector_add32((short*)x2[1],(short*)x1[1][1],(short*)y[1],N);
// shift and pack
shift_and_pack((short*)y[0],N,output_shift);
shift_and_pack((short*)y[1],N,output_shift);
}
#ifdef MAIN_MM
#include <stdio.h>
#include <stdlib.h>
main ()
{
short x1_00[256] __attribute__((aligned(16)));
short x1_10[256] __attribute__((aligned(16)));
short x1_01[256] __attribute__((aligned(16)));
short x1_11[256] __attribute__((aligned(16)));
short x2_0[256] __attribute__((aligned(16)));
short x2_1[256] __attribute__((aligned(16)));
short y_0[256] __attribute__((aligned(16)));
short y_1[256] __attribute__((aligned(16)));
int *x1[2][2];
int *x2[2];
int *y[2];
int i,m,n;
x1[0][0] = (int*)x1_00;
x1[0][1] = (int*)x1_01;
x1[1][0] = (int*)x1_10;
x1[1][1] = (int*)x1_11;
x2[0] = (int*)x2_0;
x2[1] = (int*)x2_1;
y[0] = (int*)y_0;
y[1] = (int*)y_1;
for(m=0; m<2; m++) {
for(n=0; n<2; n++) {
for(i=0; i<256; i+=4) {
((short*)x1[m][n])[i] = ((short) rand())/4;
((short*)x1[m][n])[i+1] = ((short) rand())/4;
((short*)x1[m][n])[i+2] = -((short*)x1[m][n])[i+1];
((short*)x1[m][n])[i+3] = ((short*)x1[m][n])[i];
}
}
for(i=0; i<256; i+=4) {
((short*)x2[m])[i] = ((short) rand())/4;
((short*)x2[m])[i+1] = ((short) rand())/4;
((short*)x2[m])[i+2] = ((short*)x2[m])[i];
((short*)x2[m])[i+3] = ((short*)x2[m])[i+1];
}
Zero_Buffer(y[m],512);
}
/*
input[0] = 100;
input[1] = 200;
input[2] = -200;
input[3] = 100;
input[4] = 1000;
input[5] = 2000;
input[6] = -2000;
input[7] = 1000;
input[8] = 100;
input[9] = 200;
input[10] = -200;
input[11] = 100;
input[12] = 1000;
input[13] = 2000;
input[14] = -2000;
input[15] = 1000;
input2[0] = 2;
input2[1] = 1;
input2[2] = 2;
input2[3] = 1;
input2[4] = 20;
input2[5] = 10;
input2[6] = 20;
input2[7] = 10;
input2[8] = 2;
input2[9] = 1;
input2[10] = 2;
input2[11] = 1;
input2[12] = 2000;
input2[13] = 1000;
input2[14] = 2000;
input2[15] = 1000;
x1[0][0] = (int*)input;
x1[0][1] = (int*)input;
x1[1][0] = (int*)input;
x1[1][1] = (int*)input;
x2[0] = (int*)input2;
x2[1] = (int*)input2;
y[0] = (int*)output;
y[1] = (int*)output2;
*/
mult_cpx_matrix_vector(x1,x2,y,64,15);
//mult_cpx_vector_add32(x2[0],x1[0][0],y[0],64);
for (i=0; i<128; i+=2)
printf("i=%d, x1 = [%d+1i*%d %d+1i*%d; %d+1i*%d %d+1i*%d]; x2 = [%d+1i*%d; %d+1i*%d]; y = [%d+1i*%d; %d+1i*%d]; y_m= round(x1*x2./pow2(15)); y-y_m \n",
i,
((short*)x1[0][0])[2*i], ((short*)x1[0][0])[2*i+2],
((short*)x1[0][1])[2*i], ((short*)x1[0][1])[2*i+2],
((short*)x1[1][0])[2*i], ((short*)x1[1][0])[2*i+2],
((short*)x1[1][1])[2*i], ((short*)x1[1][1])[2*i+2],
((short*)x2[0])[2*i], ((short*)x2[0])[2*i+1],
((short*)x2[1])[2*i], ((short*)x2[1])[2*i+1],
((short*)y[0])[2*i], ((short*)y[0])[2*i+1],
((short*)y[1])[2*i], ((short*)y[1])[2*i+1]);
//((int*)y[0])[i], ((int*)y[0])[i+1],
//((int*)y[1])[i], ((int*)y[1])[i+1]);
}
#endif
...@@ -50,7 +50,7 @@ int mult_cpx_conj_vector(int16_t *x1, ...@@ -50,7 +50,7 @@ int mult_cpx_conj_vector(int16_t *x1,
uint32_t N, uint32_t N,
int output_shift) int output_shift)
{ {
// Multiply elementwise two complex vectors of N elements with repeated formatted output // Multiply elementwise the complex conjugate of x1 with x2.
// x1 - input 1 in the format |Re0 Im0 Re1 Im1|,......,|Re(N-2) Im(N-2) Re(N-1) Im(N-1)| // x1 - input 1 in the format |Re0 Im0 Re1 Im1|,......,|Re(N-2) Im(N-2) Re(N-1) Im(N-1)|
// We assume x1 with a dinamic of 15 bit maximum // We assume x1 with a dinamic of 15 bit maximum
// //
...@@ -90,7 +90,7 @@ int mult_cpx_conj_vector(int16_t *x1, ...@@ -90,7 +90,7 @@ int mult_cpx_conj_vector(int16_t *x1,
tmp_im = _mm_shufflelo_epi16(*x1_128,_MM_SHUFFLE(2,3,0,1)); tmp_im = _mm_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));
tmp_im = _mm_sign_epi16(tmp_im,*(__m128i*)&conjug[0]); tmp_im = _mm_sign_epi16(tmp_im,*(__m128i*)&conjug[0]);
tmp_im = _mm_madd_epi16(tmp_im,*x1_128); tmp_im = _mm_madd_epi16(tmp_im,*x2_128);
tmp_re = _mm_srai_epi32(tmp_re,output_shift); tmp_re = _mm_srai_epi32(tmp_re,output_shift);
tmp_im = _mm_srai_epi32(tmp_im,output_shift); tmp_im = _mm_srai_epi32(tmp_im,output_shift);
tmpy0 = _mm_unpacklo_epi32(tmp_re,tmp_im); tmpy0 = _mm_unpacklo_epi32(tmp_re,tmp_im);
...@@ -130,3 +130,4 @@ int mult_cpx_conj_vector(int16_t *x1, ...@@ -130,3 +130,4 @@ int mult_cpx_conj_vector(int16_t *x1,
return(0); return(0);
} }
This diff is collapsed.
This diff is collapsed.
...@@ -719,13 +719,13 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form, ...@@ -719,13 +719,13 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form,
// PDSCH LLRs // PDSCH LLRs
if (pdsch_llr != NULL) { if (pdsch_llr != NULL) {
for (i=0; i<coded_bits_per_codeword/4; i++) { for (i=0; i<coded_bits_per_codeword; i++) {
llr[i] = (float) pdsch_llr[4*i]; llr[i] = (float) pdsch_llr[i];
bit[i] = (float) i; bit[i] = (float) i;
} }
fl_set_xyplot_xbounds(form->pdsch_llr,0,coded_bits_per_codeword/4); fl_set_xyplot_xbounds(form->pdsch_llr,0,coded_bits_per_codeword);
fl_set_xyplot_data(form->pdsch_llr,bit,llr,coded_bits_per_codeword/4,"","",""); fl_set_xyplot_data(form->pdsch_llr,bit,llr,coded_bits_per_codeword,"","","");
} }
// PDSCH I/Q of MF Output // PDSCH I/Q of MF Output
......
...@@ -26,6 +26,9 @@ ...@@ -26,6 +26,9 @@
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/ *******************************************************************************/
#ifndef __TIME_MEAS_DEFS__H__
#define __TIME_MEAS_DEFS__H__
#include <unistd.h> #include <unistd.h>
#include <math.h> #include <math.h>
#include <stdint.h> #include <stdint.h>
...@@ -148,3 +151,4 @@ static inline void copy_meas(time_stats_t *dst_ts,time_stats_t *src_ts) ...@@ -148,3 +151,4 @@ static inline void copy_meas(time_stats_t *dst_ts,time_stats_t *src_ts)
dst_ts->max=src_ts->max; dst_ts->max=src_ts->max;
} }
} }
#endif
...@@ -278,6 +278,9 @@ typedef struct PHY_VARS_eNB_s { ...@@ -278,6 +278,9 @@ typedef struct PHY_VARS_eNB_s {
int **dl_precoder_SeNB[3]; int **dl_precoder_SeNB[3];
char log2_maxp; /// holds the maximum channel/precoder coefficient char log2_maxp; /// holds the maximum channel/precoder coefficient
/// if ==0 enables phy only test mode
int mac_enabled;
/// For emulation only (used by UE abstraction to retrieve DCI) /// For emulation only (used by UE abstraction to retrieve DCI)
uint8_t num_common_dci[2]; // num_dci in even/odd subframes uint8_t num_common_dci[2]; // num_dci in even/odd subframes
uint8_t num_ue_spec_dci[2]; // num_dci in even/odd subframes uint8_t num_ue_spec_dci[2]; // num_dci in even/odd subframes
...@@ -583,6 +586,9 @@ typedef struct { ...@@ -583,6 +586,9 @@ typedef struct {
/// holds the maximum channel/precoder coefficient /// holds the maximum channel/precoder coefficient
char log2_maxp; char log2_maxp;
/// if ==0 enables phy only test mode
int mac_enabled;
/// Flag to initialize averaging of PHY measurements /// Flag to initialize averaging of PHY measurements
int init_averaging; int init_averaging;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -61,25 +61,7 @@ ...@@ -61,25 +61,7 @@
extern unsigned int dlsch_tbs25[27][25],TBStable[27][110]; extern unsigned int dlsch_tbs25[27][25],TBStable[27][110];
extern unsigned char offset_mumimo_llr_drange_fix; extern unsigned char offset_mumimo_llr_drange_fix;
#ifdef XFORMS
#include "PHY/TOOLS/lte_phy_scope.h" #include "PHY/TOOLS/lte_phy_scope.h"
#endif
//#define AWGN
//#define NO_DCI
//#define ABSTRACTION
/*
#define RBmask0 0x00fc00fc
#define RBmask1 0x0
#define RBmask2 0x0
#define RBmask3 0x0
*/
PHY_VARS_eNB *PHY_vars_eNB; PHY_VARS_eNB *PHY_vars_eNB;
PHY_VARS_UE *PHY_vars_UE; PHY_VARS_UE *PHY_vars_UE;
...@@ -237,10 +219,9 @@ int main(int argc, char **argv) ...@@ -237,10 +219,9 @@ int main(int argc, char **argv)
short *uncoded_ber_bit=NULL; short *uncoded_ber_bit=NULL;
uint8_t N_RB_DL=25,osf=1; uint8_t N_RB_DL=25,osf=1;
frame_t frame_type = FDD; frame_t frame_type = FDD;
#ifdef XFORMS int xforms=0;
FD_lte_phy_scope_ue *form_ue; FD_lte_phy_scope_ue *form_ue;
char title[255]; char title[255];
#endif
uint32_t DLSCH_RB_ALLOC = 0x1fff; uint32_t DLSCH_RB_ALLOC = 0x1fff;
int numCCE=0; int numCCE=0;
int dci_length_bytes=0,dci_length=0; int dci_length_bytes=0,dci_length=0;
...@@ -305,7 +286,7 @@ int main(int argc, char **argv) ...@@ -305,7 +286,7 @@ int main(int argc, char **argv)
// num_layers = 1; // num_layers = 1;
perfect_ce = 0; perfect_ce = 0;
while ((c = getopt (argc, argv, "ahdpZDe:Em:n:o:s:f:t:c:g:r:F:x:y:z:AM:N:I:i:O:R:S:C:T:b:u:v:w:B:PLl:Y")) != -1) { while ((c = getopt (argc, argv, "ahdpZDe:Em:n:o:s:f:t:c:g:r:F:x:y:z:AM:N:I:i:O:R:S:C:T:b:u:v:w:B:PLl:XY")) != -1) {
switch (c) { switch (c) {
case 'a': case 'a':
awgn_flag = 1; awgn_flag = 1;
...@@ -557,6 +538,10 @@ int main(int argc, char **argv) ...@@ -557,6 +538,10 @@ int main(int argc, char **argv)
break; break;
case 'X':
xforms=1;
break;
case 'Y': case 'Y':
perfect_ce=1; perfect_ce=1;
break; break;
...@@ -636,21 +621,20 @@ int main(int argc, char **argv) ...@@ -636,21 +621,20 @@ int main(int argc, char **argv)
if ((transmission_mode > 1) && (n_tx != 2)) if ((transmission_mode > 1) && (n_tx != 2))
printf("n_tx must be >1 for transmission_mode %d\n",transmission_mode); printf("n_tx must be >1 for transmission_mode %d\n",transmission_mode);
#ifdef XFORMS if (xforms==1) {
fl_initialize (&argc, argv, NULL, 0, 0); fl_initialize (&argc, argv, NULL, 0, 0);
form_ue = create_lte_phy_scope_ue(); form_ue = create_lte_phy_scope_ue();
sprintf (title, "LTE PHY SCOPE eNB"); sprintf (title, "LTE PHY SCOPE eNB");
fl_show_form (form_ue->lte_phy_scope_ue, FL_PLACE_HOTSPOT, FL_FULLBORDER, title); fl_show_form (form_ue->lte_phy_scope_ue, FL_PLACE_HOTSPOT, FL_FULLBORDER, title);
if (!dual_stream_UE==0) { if (!dual_stream_UE==0) {
openair_daq_vars.use_ia_receiver = 1; openair_daq_vars.use_ia_receiver = 1;
fl_set_button(form_ue->button_0,1); fl_set_button(form_ue->button_0,1);
fl_set_object_label(form_ue->button_0, "IA Receiver ON"); fl_set_object_label(form_ue->button_0, "IA Receiver ON");
fl_set_object_color(form_ue->button_0, FL_GREEN, FL_GREEN); fl_set_object_color(form_ue->button_0, FL_GREEN, FL_GREEN);
}
} }
#endif
if (transmission_mode==5) { if (transmission_mode==5) {
n_users = 2; n_users = 2;
printf("dual_stream_UE=%d\n", dual_stream_UE); printf("dual_stream_UE=%d\n", dual_stream_UE);
...@@ -3496,13 +3480,13 @@ PMI_FEEDBACK: ...@@ -3496,13 +3480,13 @@ PMI_FEEDBACK:
// PHY_vars_UE->dlsch_ue[0][0]->harq_processes[0]->round++; // PHY_vars_UE->dlsch_ue[0][0]->harq_processes[0]->round++;
} }
#ifdef XFORMS if (xforms==1) {
phy_scope_UE(form_ue, phy_scope_UE(form_ue,
PHY_vars_UE, PHY_vars_UE,
eNB_id, eNB_id,
0,// UE_id 0,// UE_id
subframe); subframe);
#endif }
} //round } //round
......
...@@ -173,7 +173,9 @@ int main(int argc, char **argv) ...@@ -173,7 +173,9 @@ int main(int argc, char **argv)
lte_frame_type_t frame_type = FDD; lte_frame_type_t frame_type = FDD;
uint32_t Nsoft = 1827072;
/*
#ifdef XFORMS #ifdef XFORMS
FD_lte_phy_scope_ue *form_ue; FD_lte_phy_scope_ue *form_ue;
char title[255]; char title[255];
...@@ -183,6 +185,7 @@ int main(int argc, char **argv) ...@@ -183,6 +185,7 @@ int main(int argc, char **argv)
sprintf (title, "LTE DL SCOPE UE"); sprintf (title, "LTE DL SCOPE UE");
fl_show_form (form_ue->lte_phy_scope_ue, FL_PLACE_HOTSPOT, FL_FULLBORDER, title); fl_show_form (form_ue->lte_phy_scope_ue, FL_PLACE_HOTSPOT, FL_FULLBORDER, title);
#endif #endif
*/
logInit(); logInit();
number_of_cards = 1; number_of_cards = 1;
...@@ -382,14 +385,14 @@ int main(int argc, char **argv) ...@@ -382,14 +385,14 @@ int main(int argc, char **argv)
0); 0);
// Create transport channel structures for 2 transport blocks (MIMO) // Create transport channel structures for 2 transport blocks (MIMO)
PHY_vars_eNB->dlsch_eNB_MCH = new_eNB_dlsch(1,8,N_RB_DL,0); PHY_vars_eNB->dlsch_eNB_MCH = new_eNB_dlsch(1,8,Nsoft,N_RB_DL,0);
if (!PHY_vars_eNB->dlsch_eNB_MCH) { if (!PHY_vars_eNB->dlsch_eNB_MCH) {
printf("Can't get eNB dlsch structures\n"); printf("Can't get eNB dlsch structures\n");
exit(-1); exit(-1);
} }
PHY_vars_UE->dlsch_ue_MCH[0] = new_ue_dlsch(1,8,MAX_TURBO_ITERATIONS_MBSFN,N_RB_DL,0); PHY_vars_UE->dlsch_ue_MCH[0] = new_ue_dlsch(1,8,Nsoft,MAX_TURBO_ITERATIONS_MBSFN,N_RB_DL,0);
PHY_vars_eNB->lte_frame_parms.num_MBSFN_config = 1; PHY_vars_eNB->lte_frame_parms.num_MBSFN_config = 1;
PHY_vars_eNB->lte_frame_parms.MBSFN_config[0].radioframeAllocationPeriod = 0; PHY_vars_eNB->lte_frame_parms.MBSFN_config[0].radioframeAllocationPeriod = 0;
......
...@@ -52,9 +52,7 @@ ...@@ -52,9 +52,7 @@
#include "LAYER2/MAC/vars.h" #include "LAYER2/MAC/vars.h"
#include "OCG_vars.h" #include "OCG_vars.h"
#ifdef XFORMS
#include "PHY/TOOLS/lte_phy_scope.h" #include "PHY/TOOLS/lte_phy_scope.h"
#endif
extern unsigned short dftsizes[33]; extern unsigned short dftsizes[33];
extern short *ul_ref_sigs[30][2][33]; extern short *ul_ref_sigs[30][2][33];
...@@ -74,12 +72,9 @@ node_desc_t *ue_data[NUMBER_OF_UE_MAX]; ...@@ -74,12 +72,9 @@ node_desc_t *ue_data[NUMBER_OF_UE_MAX];
extern uint16_t beta_ack[16],beta_ri[16],beta_cqi[16]; extern uint16_t beta_ack[16],beta_ri[16],beta_cqi[16];
//extern char* namepointer_chMag ; //extern char* namepointer_chMag ;
int xforms=0;
#ifdef XFORMS
FD_lte_phy_scope_enb *form_enb; FD_lte_phy_scope_enb *form_enb;
char title[255]; char title[255];
#endif
/*the following parameters are used to control the processing times*/ /*the following parameters are used to control the processing times*/
double t_tx_max = -1000000000; /*!< \brief initial max process time for tx */ double t_tx_max = -1000000000; /*!< \brief initial max process time for tx */
...@@ -204,7 +199,7 @@ int main(int argc, char **argv) ...@@ -204,7 +199,7 @@ int main(int argc, char **argv)
logInit(); logInit();
while ((c = getopt (argc, argv, "hapZEbm:n:Y:X:x:s:w:e:q:d:D:O:c:r:i:f:y:c:oA:C:R:g:N:l:S:T:QB:PI:L")) != -1) { while ((c = getopt (argc, argv, "hapZEbm:n:Y:X:x:s:w:e:q:d:D:O:c:r:i:f:y:c:oA:C:R:g:N:l:S:T:QB:PI:LF")) != -1) {
switch (c) { switch (c) {
case 'a': case 'a':
channel_model = AWGN; channel_model = AWGN;
...@@ -454,6 +449,10 @@ int main(int argc, char **argv) ...@@ -454,6 +449,10 @@ int main(int argc, char **argv)
max_turbo_iterations=atoi(optarg); max_turbo_iterations=atoi(optarg);
break; break;
case 'F':
xforms=1;
break;
case 'Z': case 'Z':
dump_table = 1; dump_table = 1;
break; break;
...@@ -594,12 +593,12 @@ int main(int argc, char **argv) ...@@ -594,12 +593,12 @@ int main(int argc, char **argv)
} }
#ifdef XFORMS if (xforms==1) {
fl_initialize (&argc, argv, NULL, 0, 0); fl_initialize (&argc, argv, NULL, 0, 0);
form_enb = create_lte_phy_scope_enb(); form_enb = create_lte_phy_scope_enb();
sprintf (title, "LTE PHY SCOPE eNB"); sprintf (title, "LTE PHY SCOPE eNB");
fl_show_form (form_enb->lte_phy_scope_enb, FL_PLACE_HOTSPOT, FL_FULLBORDER, title); fl_show_form (form_enb->lte_phy_scope_enb, FL_PLACE_HOTSPOT, FL_FULLBORDER, title);
#endif }
PHY_vars_UE->lte_ue_pdcch_vars[0]->crnti = 14; PHY_vars_UE->lte_ue_pdcch_vars[0]->crnti = 14;
...@@ -1354,9 +1353,9 @@ int main(int argc, char **argv) ...@@ -1354,9 +1353,9 @@ int main(int argc, char **argv)
if ((errs[0]>=100) && (trials>(n_frames/2))) if ((errs[0]>=100) && (trials>(n_frames/2)))
break; break;
#ifdef XFORMS if (xforms==1)
phy_scope_eNB(form_enb,PHY_vars_eNB,0); phy_scope_eNB(form_enb,PHY_vars_eNB,0);
#endif
/*calculate the total processing time for each packet, get the max, min, and number of packets that exceed t>3000us*/ /*calculate the total processing time for each packet, get the max, min, and number of packets that exceed t>3000us*/
double t_tx = (double)PHY_vars_UE->phy_proc_tx.p_time/cpu_freq_GHz/1000.0; double t_tx = (double)PHY_vars_UE->phy_proc_tx.p_time/cpu_freq_GHz/1000.0;
......
...@@ -48,7 +48,19 @@ Description Contains global common definitions ...@@ -48,7 +48,19 @@ Description Contains global common definitions
#include <stdint.h> #include <stdint.h>
#include <stddef.h> #include <stddef.h>
#include <stdbool.h>
typedef signed char boolean_t;
#if !defined(TRUE)
#define TRUE (boolean_t)0x01
#endif
#if !defined(FALSE)
#define FALSE (boolean_t)0x00
#endif
#define BOOL_NOT(b) (b^TRUE)
#define NAS_UE_ID_FMT "0x%06x" #define NAS_UE_ID_FMT "0x%06x"
...@@ -59,13 +71,6 @@ Description Contains global common definitions ...@@ -59,13 +71,6 @@ Description Contains global common definitions
#define RETURNok (0) #define RETURNok (0)
#define RETURNerror (-1) #define RETURNerror (-1)
#ifndef FALSE
#define FALSE (0)
#endif
#ifndef TRUE
#define TRUE (1)
#endif
/* /*
* Name of the environment variable which defines the default directory * Name of the environment variable which defines the default directory
* where the NAS application is executed and where are located files * where the NAS application is executed and where are located files
......
...@@ -112,7 +112,7 @@ typedef struct net_ip_address_s { ...@@ -112,7 +112,7 @@ typedef struct net_ip_address_s {
unsigned ipv4:1; unsigned ipv4:1;
unsigned ipv6:1; unsigned ipv6:1;
char ipv4_address[16]; char ipv4_address[16];
char ipv6_address[40]; char ipv6_address[46];
} net_ip_address_t; } net_ip_address_t;
typedef uint64_t bitrate_t; typedef uint64_t bitrate_t;
......
...@@ -265,7 +265,7 @@ static const eutra_band_t eutra_bands[] = { ...@@ -265,7 +265,7 @@ static const eutra_band_t eutra_bands[] = {
Enb_properties_array_t enb_properties; Enb_properties_array_t enb_properties;
static void enb_config_display(void) void enb_config_display(void)
{ {
int i,j; int i,j;
...@@ -1019,7 +1019,7 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP) ...@@ -1019,7 +1019,7 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP)
enb_properties.properties[enb_properties_index]->prach_zero_correlation[j] =prach_zero_correlation; enb_properties.properties[enb_properties_index]->prach_zero_correlation[j] =prach_zero_correlation;
if ((prach_zero_correlation <0) || (prach_zero_correlation > 63)) if ((prach_zero_correlation <0) || (prach_zero_correlation > 15))
AssertError (0, parse_errors ++, AssertError (0, parse_errors ++,
"Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for prach_zero_correlation choice: 0..15!\n", "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for prach_zero_correlation choice: 0..15!\n",
lib_config_file_name_pP, i, prach_zero_correlation); lib_config_file_name_pP, i, prach_zero_correlation);
......
...@@ -264,6 +264,7 @@ typedef struct Enb_properties_array_s { ...@@ -264,6 +264,7 @@ typedef struct Enb_properties_array_s {
Enb_properties_t *properties[MAX_ENB]; Enb_properties_t *properties[MAX_ENB];
} Enb_properties_array_t; } Enb_properties_array_t;
void enb_config_display(void);
const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP); const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP);
const Enb_properties_array_t *enb_config_get(void); const Enb_properties_array_t *enb_config_get(void);
......
...@@ -47,8 +47,8 @@ int8_t get_Po_NOMINAL_PUSCH(module_id_t module_idP,uint8_t CC_id) ...@@ -47,8 +47,8 @@ int8_t get_Po_NOMINAL_PUSCH(module_id_t module_idP,uint8_t CC_id)
if (CC_id>0) { if (CC_id>0) {
LOG_E(MAC,"Transmission on secondary CCs is not supported yet\n"); LOG_E(MAC,"Transmission on secondary CCs is not supported yet\n");
mac_xface->macphy_exit("MAC FATAL CC_id>0"); //mac_xface->macphy_exit("MAC FATAL CC_id>0");
return 0; // not reached return 0;
} }
if (UE_mac_inst[module_idP].radioResourceConfigCommon) { if (UE_mac_inst[module_idP].radioResourceConfigCommon) {
...@@ -56,7 +56,8 @@ int8_t get_Po_NOMINAL_PUSCH(module_id_t module_idP,uint8_t CC_id) ...@@ -56,7 +56,8 @@ int8_t get_Po_NOMINAL_PUSCH(module_id_t module_idP,uint8_t CC_id)
} }
else { else {
LOG_E(MAC,"[UE %d] CCid %d FATAL radioResourceConfigCommon is NULL !!!\n",module_idP,CC_id); LOG_E(MAC,"[UE %d] CCid %d FATAL radioResourceConfigCommon is NULL !!!\n",module_idP,CC_id);
mac_xface->macphy_exit("FATAL radioResourceConfigCommon is NULL"); //mac_xface->macphy_exit("FATAL radioResourceConfigCommon is NULL");
return 0;
} }
return(-120 + (rach_ConfigCommon->powerRampingParameters.preambleInitialReceivedTargetPower<<1) + return(-120 + (rach_ConfigCommon->powerRampingParameters.preambleInitialReceivedTargetPower<<1) +
......
...@@ -60,6 +60,8 @@ ...@@ -60,6 +60,8 @@
# include "DRB-ToAddModList.h" # include "DRB-ToAddModList.h"
# include "SRB-ToAddMod.h" # include "SRB-ToAddMod.h"
# include "SRB-ToAddModList.h" # include "SRB-ToAddModList.h"
# include "DRB-ToReleaseList.h"
#ifdef Rel10 #ifdef Rel10
#include "PMCH-InfoList-r9.h" #include "PMCH-InfoList-r9.h"
#endif #endif
......
...@@ -51,10 +51,6 @@ ...@@ -51,10 +51,6 @@
#include "UTIL/OPT/opt.h" #include "UTIL/OPT/opt.h"
/*----------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------*/
#ifndef HAVE_STRNDUP
char * strndup (const char *s, size_t size);
#endif
static int oai_emulation_; /*!< \brief indicating that the parsing position is now within OAI_Emulation_*/ static int oai_emulation_; /*!< \brief indicating that the parsing position is now within OAI_Emulation_*/
static int environment_system_config_; /*!< \brief indicating that the parsing position is now within Envi_Config_*/ static int environment_system_config_; /*!< \brief indicating that the parsing position is now within Envi_Config_*/
......
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.
...@@ -275,7 +275,6 @@ do { \ ...@@ -275,7 +275,6 @@ do { \
(bITsTRING)->size = 3; \ (bITsTRING)->size = 3; \
(bITsTRING)->bits_unused = 4; \ (bITsTRING)->bits_unused = 4; \
} while(0) } while(0)
/*
/* TS 36.413 v10.9.0 section 9.2.1.38: /* TS 36.413 v10.9.0 section 9.2.1.38:
* E-UTRAN CGI/Cell Identity * E-UTRAN CGI/Cell Identity
* The leftmost bits of the Cell * The leftmost bits of the Cell
......
...@@ -17,7 +17,7 @@ eNBs = ...@@ -17,7 +17,7 @@ eNBs =
mobile_country_code = "208"; mobile_country_code = "208";
mobile_network_code = "93"; mobile_network_code = "95";
////////// Physical parameters: ////////// Physical parameters:
...@@ -132,7 +132,7 @@ eNBs = ...@@ -132,7 +132,7 @@ eNBs =
}; };
////////// MME parameters: ////////// MME parameters:
mme_ip_address = ( { ipv4 = "192.168.12.171"; mme_ip_address = ( { ipv4 = "192.168.12.62";
ipv6 = "192:168:30::17"; ipv6 = "192:168:30::17";
active = "yes"; active = "yes";
preference = "ipv4"; preference = "ipv4";
......
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