Commit f6f7597e authored by Sandeep Kumar's avatar Sandeep Kumar

Merge branch 'enhancement-10-harmony' of...

Merge branch 'enhancement-10-harmony' of https://gitlab.eurecom.fr/oai/openairinterface5g into enhancement-10-harmony
parents a8def02f 94fd52a4
......@@ -32,3 +32,8 @@ job1:
- 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 $EXTERNAL_SHARE_DIR && rsync" $OPENAIR_DIR/cmake_targets/autotests/log $OAI_USER@localhost:$EXTERNAL_SHARE_DIR
- cat $OPENAIR_DIR/cmake_targets/autotests/log/results_autotests.xml
- exce_log=`egrep -i 'warning|error|critical|exception' $NFS_TEST_RESULTS_DIR/log/python_autotest.log `
- if [ -n "$exce_log" ]; then echo -e "\e[31mThere are errors in $NFS_TEST_RESULTS_DIR/log/python_autotest.log. Please check the logs\e[0m" ; fi
- exce_log=`egrep -i 'warning|error|critical|exception' $NFS_TEST_RESULTS_DIR/log/python_autotest_cleanup.log `
- if [ -n "$exce_log" ]; then echo -e "\e[31mThere are errors in $NFS_TEST_RESULTS_DIR/log/python_autotest_cleanup.log. Please check the logs\e[0m" ; fi
OpenAirInterface is under GNU GPLv3 license. The full GNU General Public License is included in this distribution in the file called "COPYING".
The OpenAirInterface (OAI) software is composed of six different parts:
openair1: 3GPP LTE Rel-8 PHY layer + PHY RF simulation
openair2: 3GPP LTE Rel-9 RLC/MAC/PDCP/RRC implementations, eNB application, X2AP. Note that for RLC, the following versions are userL UM_v9.3.0, TM_v9.3.0, and AM_v9.3.0. For PDCP, PDCP_v10.1.0 is used. For RRC, only LITE is used.
openair3: 3GPP LTE Rel9 and 10 MME/NAS, S+P-GW, HSS, S1AP (ENB and MME).
common: some common OAI utilities, other tools can be found at openair2/UTILS
targets: scripts to compile and lauch different system targets (simulation, emulation and real-time platforms, user-space tools for these platforms (tbd))
see README files in these subdirectories for more information
see also https://twiki.eurecom.fr/twiki/bin/view/OpenAirInterface/WebHome
OpenAirInterface is under OpenAirInterface Software Alliance license.
├── http://www.openairinterface.org/?page_id=101
├── http://www.openairinterface.org/?page_id=698
The OpenAirInterface (OAI) software is composed of the following parts:
openairinterface5g
├── cmake_targets: build utilities to compile (simulation, emulation and real-time platforms), and generated build files
├── common : some common OAI utilities, other tools can be found at openair2/UTILS
├── COPYING
├── maketags : script to generate emacs tags
├── openair1 : 3GPP LTE Rel-10 PHY layer + PHY RF simulation and a subset of Rel 12 Features.
├── openair2 :3GPP LTE Rel-10 RLC/MAC/PDCP/RRC/X2AP implementation.
├── LAYER2/RLC/ with the following subdirectories: UM_v9.3.0, TM_v9.3.0, and AM_v9.3.0.
├── LAYER2/PDCP/PDCP_v10.1.0.
├── RRC/LITE
├── PHY_INTERFACE
├── X2AP
├── ENB_APP
├── openair3: 3GPP LTE Rel10 for S1AP, NAS GTPV1-U for both ENB and UE.
├── GTPV1-U
├── NAS
├── S1AP
├── SCTP
├── SECU
├── UDP
└── targets: top level wrapper for unitary simulation for PHY channels, system-level emulation (eNB-UE with and without S1), and realtime eNB and UE and RRH GW.
......@@ -260,6 +260,7 @@ endif (${ENABLE_ITTI})
add_boolean_option(RTAI False "Use RTAI")
#############################
# ASN.1 grammar C code generation & dependancies
################################
......@@ -493,7 +494,7 @@ include_directories ("${OPENAIR_TARGETS}/ARCH/EXMIMO/DEFS/")
#set (option_HWEXMIMOLIB_lib "-l ")
set(HWLIB_EXMIMO_SOURCE
${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} )
......@@ -534,8 +535,8 @@ if (${RF_BOARD} STREQUAL "EXMIMO")
include_directories ("${OPENAIR_TARGETS}/ARCH/EXMIMO/USERSPACE/LIB/")
include_directories ("${OPENAIR_TARGETS}/ARCH/EXMIMO/DEFS/")
set(HW_SOURCE ${HW_SOURCE}
${OPENAIR_TARGETS}/ARCH/EXMIMO/USERSPACE/LIB/openair0_lib.c
${OPENAIR_TARGETS}/ARCH/EXMIMO/USERSPACE/LIB/gain_control.c)
${OPENAIR_TARGETS}/ARCH/EXMIMO/USERSPACE/LIB/openair0_lib.c)
# ${OPENAIR_TARGETS}/ARCH/EXMIMO/USERSPACE/LIB/gain_control.c)
set(option_HW_lib "-rdynamic -ldl")
elseif (${RF_BOARD} STREQUAL "OAI_USRP")
......@@ -596,7 +597,7 @@ endif (${TRANSP_PRO} STREQUAL "ETHERNET")
include_directories ("${OPENAIR_TARGETS}/ARCH/COMMON")
Message("LOWLATENCY flag is ${LOWLATENCY}")
Message("DEADLINE_SCHEDULER flag is ${DEADLINE_SCHEDULER}")
Message("CPU_Affinity flag is ${CPU_AFFINITY}")
##############################################################
......@@ -610,7 +611,7 @@ add_boolean_option(RRC_DEFAULT_RAB_IS_AM False "set the RLC mode to AM for the d
add_boolean_option(OAI_NW_DRIVER_TYPE_ETHERNET False "????")
add_boolean_option(DISABLE_USE_NAS False "???")
add_boolean_option(LOWLATENCY True "Use the Linux scheduler SCHED_DEADLINE: kernel >= 3.14")
add_boolean_option(DEADLINE_SCHEDULER True "Use the Linux scheduler SCHED_DEADLINE: kernel >= 3.14")
add_boolean_option(CPU_AFFINITY False "Enable CPU Affinity of threads (only valid without deadline scheduler). It is enabled only with >2 CPUs")
add_boolean_option(NAS_ADDRESS_FIX False "specific to oaisim: for nasmesh driver")
add_boolean_option(NAS_NETLINK False "???? Must be True to compile nasmesh driver without rtai")
......@@ -1478,9 +1479,9 @@ add_boolean_option(OAI_NW_DRIVER_USE_NETLINK True "????")
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/pgm_link.c
)
add_library(OPENAIR0_LIB
${OPENAIR_TARGETS}/ARCH/EXMIMO/USERSPACE/LIB/openair0_lib.c
)
# add_library(OPENAIR0_LIB
# ${OPENAIR_TARGETS}/ARCH/EXMIMO/USERSPACE/LIB/openair0_lib.c
# )
# System packages that are required
# We use either the cmake buildin, in ubuntu are in: /usr/share/cmake*/Modules/
......
......@@ -29,10 +29,7 @@
# *******************************************************************************/
# \file test01.py
# \brief test 01 for OAI
# \author Navid Nikaein
# \date 2013 - 2015
# \author Rohit Gupta
# \version 0.1
# @ingroup _test
......@@ -316,12 +313,12 @@ def SSHSessionWrapper(machine, username, key_file, password, logdir_remote, logd
# \param CleanUpAluLteBox program to terminate AlU Bell Labs LTE Box
# \param ExmimoRfStop String to stop EXMIMO card (specified in test_case_list.xml)
def cleanOldPrograms(oai, programList, CleanUpAluLteBox, ExmimoRfStop):
cmd = 'killall -q -r ' + programList
cmd = 'killall -9 -q -r ' + programList
result = oai.send(cmd, True)
print "Killing old programs..." + result
programArray = programList.split()
programListJoin = '|'.join(programArray)
cmd = " ( date ;echo \"Starting cleaning old programs.. \" ; dmesg|tail )>& $HOME/.oai_test_setup_cleanup.log.`hostname` 2>&1 ; sync"
cmd = " ( date ;echo \"Starting cleaning old programs.. \" ; dmesg|tail ; echo \"Current disk space.. \" ; df -h )>& $HOME/.oai_test_setup_cleanup.log.`hostname` 2>&1 ; sync"
result=oai.send_recv(cmd)
cmd = cleanupOldProgramsScript + ' ' + '\''+programListJoin+'\''
#result = oai.send_recv(cmd)
......@@ -330,7 +327,7 @@ def cleanOldPrograms(oai, programList, CleanUpAluLteBox, ExmimoRfStop):
print "Looking for old programs..." + result
res=oai.send_recv(CleanUpAluLteBox, True)
cmd = "( " + ExmimoRfStop + " ) >> $HOME/.oai_test_setup_cleanup.log.`hostname` ; sync "
res=oai.send_recv(cmd, False)
res=oai.send_recv(cmd, False, timeout=600)
#res = oai.send_recv(ExmimoRfStop, False)
cmd = " ( date ;echo \"Finished cleaning old programs.. \" ; dmesg | tail)>> $HOME/.oai_test_setup_cleanup.log.`hostname` 2>&1 ; sync"
res=oai.send_recv(cmd)
......@@ -1529,9 +1526,8 @@ for testcase in testcaseList:
print "Now copying files to NFS Share"
oai_localhost = openair('localdomain','localhost')
oai_localhost.connect(user,pw)
cmd = ' rm -fr ' + NFSTestsResultsDir + ' ; mkdir -p ' + NFSTestsResultsDir
cmd = ' mkdir -p ' + NFSTestsResultsDir
res = oai_localhost.send_recv(cmd)
print "Deleting NFSTestResults Dir..." + res
print "Copying files from GilabCI Runner Machine : " + host + " .locallogdir = " + locallogdir + ", NFSTestsResultsDir = " + NFSTestsResultsDir
SSHSessionWrapper('localhost', user, None, pw , NFSTestsResultsDir , locallogdir, "put_all")
......@@ -1568,12 +1564,15 @@ res=os.system(cmd)
print "Now copying files to NFS Share"
oai_localhost = openair('localdomain','localhost')
oai_localhost.connect(user,pw)
cmd = ' rm -fr ' + NFSTestsResultsDir + ' ; mkdir -p ' + NFSTestsResultsDir
cmd = 'mkdir -p ' + NFSTestsResultsDir
res = oai_localhost.send_recv(cmd)
print "Deleting NFSTestResults Dir..." + res
print "Copying files from GilabCI Runner Machine : " + host + " .locallogdir = " + locallogdir + ", NFSTestsResultsDir = " + NFSTestsResultsDir
SSHSessionWrapper('localhost', user, None, pw , NFSTestsResultsDir , locallogdir, "put_all")
cmd = "cat " + NFSTestsResultsDir + "/log/*/*.xml > " + NFSTestsResultsDir + "/log/results_autotests.xml"
res = oai_localhost.send_recv(cmd)
oai_localhost.disconnect()
sys.exit()
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -141,6 +141,7 @@ def send_command (cmd, response, timeout):
error = error + ' In function: ' + sys._getframe().f_code.co_name + ': *** Caught exception: ' + str(e.__class__) + " : " + str( e)
error = error + traceback.format_exc()
print error
time.sleep(1)
def start_ue () :
......@@ -200,10 +201,12 @@ def reset_ue():
ProductId=res[0][3]
usb_dir= find_usb_path(VendorId, ProductId)
print "Bandrich 4G LTE Adapter found in..." + usb_dir
print "Sleeping now for 45 seconds...please wait..."
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" )
stop_ue()
i=1
gw='192.172.0.1'
......@@ -218,6 +221,7 @@ while i < len(sys.argv):
print 'Using Serial port : ' + serial_port
stop_ue()
elif arg == '--reset-ue' :
find_open_port()
reset_ue()
elif arg == '-gw' :
gw = sys.argv[i+1]
......
......@@ -143,6 +143,7 @@ def send_command (cmd, response, timeout):
error = error + ' In function: ' + sys._getframe().f_code.co_name + ': *** Caught exception: ' + str(e.__class__) + " : " + str( e)
error = error + traceback.format_exc()
print error
time.sleep(1)
def start_ue () :
......@@ -211,6 +212,7 @@ def reset_ue():
os.system(cmd + " ; sleep 15" )
cmd = "sudo sh -c \"echo 1 > " + usb_dir + "/authorized\""
os.system(cmd + " ; sleep 30" )
stop_ue()
i=1
gw='192.172.0.1'
......@@ -225,6 +227,7 @@ while i < len(sys.argv):
print 'Using Serial port : ' + serial_port
stop_ue()
elif arg == '--reset-ue' :
find_open_port()
reset_ue()
elif arg == '-gw' :
gw = sys.argv[i+1]
......
......@@ -43,7 +43,8 @@ def kill_processes(name):
cmd = 'sudo adb -s ' + device_id +' shell "ps |grep ' + name + '"'
status, out = commands.getstatusoutput(cmd)
if status != 0:
print "Error execting command to kill process " + name
print "Error executing command to kill process " + name
print "Error =" + out
sys.exit(1)
print "Out = " + out
if out=='':
......@@ -51,7 +52,7 @@ def kill_processes(name):
out_arr = out.split()
pid_to_kill = out_arr[1]
print "Now killing process ID " + pid_to_kill + " on Phone"
cmd = 'sudo adb -s ' + device_id +' shell "kill ' + pid_to_kill + '"'
cmd = 'sudo adb -s ' + device_id +' shell "kill -9 ' + pid_to_kill + '"'
status, out = commands.getstatusoutput(cmd)
if status != 0:
print "Error execting command to kill process " + name
......@@ -62,6 +63,7 @@ def start_ue () :
#print 'Enter your commands below.\r\nInsert "exit" to leave the application.'
print 'Killing old iperf/ping sessions'
kill_processes('iperf')
kill_processes('iperf3')
kill_processes('ping')
print "Turning off airplane mode"
os.system('sudo -E adb devices')
......@@ -93,6 +95,7 @@ def stop_ue():
os.system('sudo adb -s ' + device_id + ' shell \"settings put global airplane_mode_on 1; am broadcast -a android.intent.action.AIRPLANE_MODE --ez state true\" ')
print "Killing iperf/ping sessions"
kill_processes('iperf')
kill_processes('iperf3')
kill_processes('ping')
i=1
......
#!/bin/bash
#******************************************************************************
# OpenAirInterface
# Copyright(c) 1999 - 2014 Eurecom
# OpenAirInterface is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# OpenAirInterface is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with OpenAirInterface.The full GNU General Public License is
# included in this distribution in the file called "COPYING". If not,
# see <http://www.gnu.org/licenses/>.
# Contact Information
# OpenAirInterface Admin: openair_admin@eurecom.fr
# OpenAirInterface Tech : openair_tech@eurecom.fr
# OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr
# Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
# *******************************************************************************/
# \author Navid Nikaein, Rohit Gupta
#arg1 timeout to wait before running the script
#arg2 interface
#arg3 iperf arguments
args=($*)
timeout=${args[0]}
iface=${args[1]}
iperf3_args=(${args[@]:2})
#array=${1:-1}
echo "args = ${args[@]}"
echo "timeout = $timeout"
echo "iface = $iface"
echo "iperf3_args = ${iperf3_args[@]}"
sleep $timeout
while true; do var=`ifconfig $iface` ;sleep 1; if [ "$var" != "" ]; then break; fi ; done ; sleep 5
iperf3 ${iperf3_args[@]}
#!/bin/bash
#******************************************************************************
# OpenAirInterface
# Copyright(c) 1999 - 2014 Eurecom
# OpenAirInterface is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# OpenAirInterface is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with OpenAirInterface.The full GNU General Public License is
# included in this distribution in the file called "COPYING". If not,
# see <http://www.gnu.org/licenses/>.
# Contact Information
# OpenAirInterface Admin: openair_admin@eurecom.fr
# OpenAirInterface Tech : openair_tech@eurecom.fr
# OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr
# Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
# *******************************************************************************/
# \author Navid Nikaein, Rohit Gupta
#arg1 timeout to wait before running the script
#arg2 interface
#arg3 iperf3 arguments
args=($*)
timeout=${args[0]}
device_id=${args[1]}
iperf3_args=(${args[@]:2})
#array=${1:-1}
echo "args = ${args[@]}"
echo "timeout = $timeout"
echo "device_id = $device_id"
echo "iperf3_args = ${iperf3_args[@]}"
sleep $timeout
while true ; do
cmd=`sudo adb -s $device_id shell netcfg |grep 192.`
if [ -z "$cmd" ]; then
echo "Wating for UE to connect and get IP Address..."
sleep 1
else
echo "UE is now connected. IP Address settings are... $cmd"
break
fi
done
echo "Starting iperf3 now..."
sudo adb -s $device_id shell /data/local/tmp/iperf3 ${iperf3_args[@]}
......@@ -54,9 +54,9 @@ file.close()
if keyword == 'mme_ip_address':
replacement_text = keyword + ' = ( { ' + replacement_text + ' } ) ; '
string = re.sub(r"mme_ip_address\s*=\s*\(([^\$]+?)\)\s*;", replacement_text, string, re.M)
elif keyword == 'IPV4_LIST':
elif keyword == 'IPV4_LIST' or keyword=='GUMMEI_LIST' or keyword == 'TAI_LIST':
replacement_text = keyword + ' = ( ' + replacement_text + ' ) ; '
string = re.sub(r"IPV4_LIST\s*=\s*\(([^\$]+?)\)\s*;", replacement_text, string, re.M)
string = re.sub(r"%s\s*=\s*\(([^\$]+?)\)\s*;" % keyword, 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)
......
......@@ -45,8 +45,8 @@ MSC_GEN="False"
XFORMS="True"
PRINT_STATS="False"
VCD_TIMING="False"
LOWLATENCY_FLAG_USER="False"
FORCE_LOWLATENCY_FLAG_USER=""
DEADLINE_SCHEDULER_FLAG_USER="False"
FORCE_DEADLINE_SCHEDULER_FLAG_USER=""
CPU_AFFINITY_FLAG_USER="True" #Only valid when lowlatecy flag is set to False
REL="Rel10"
HW="None"
......@@ -125,7 +125,7 @@ Options
--disable-deadline
Disables deadline scheduler of Linux kernel (>=3.14.x).
--enable-deadline
Disables deadline scheduler of Linux kernel (>=3.14.x).
Enable deadline scheduler of Linux kernel (>=3.14.x).
--disable-cpu-affinity
Disables CPU Affinity between UHD/TX/RX Threads (Valid only when deadline scheduler is disabled). By defaulT, CPU Affinity is enabled when not using deadline scheduler. It is enabled only with >2 CPUs. For eNB, CPU_0-> Device library (UHD), CPU_1->TX Threads, CPU_2...CPU_MAX->Rx Threads. For UE, CPU_0->Device Library(UHD), CPU_1..CPU_MAX -> All the UE threads
Usage (first build):
......@@ -259,11 +259,11 @@ function main() {
echo_info "Will build doxygen support"
shift;;
--disable-deadline)
FORCE_LOWLATENCY_FLAG_USER="False"
FORCE_DEADLINE_SCHEDULER_FLAG_USER="False"
echo_info "Disabling the usage of deadline scheduler"
shift 1;;
--enable-deadline)
FORCE_LOWLATENCY_FLAG_USER="True"
FORCE_DEADLINE_SCHEDULER_FLAG_USER="True"
echo_info "Enabling the usage of deadline scheduler"
shift 1;;
--disable-cpu-affinity)
......@@ -314,33 +314,33 @@ function main() {
#By default: USRP: disable,
#By default: BLADERF: enable,
#By default: EXMIMO: enable
if [ "$FORCE_LOWLATENCY_FLAG_USER" = "" ]; then
if [ "$FORCE_DEADLINE_SCHEDULER_FLAG_USER" = "" ]; then
if [ "$HW" = "EXMIMO" ] ; then
LOWLATENCY_FLAG_USER="False"
DEADLINE_SCHEDULER_FLAG_USER="False"
elif [ "$HW" = "ETHERNET" ] ; then
LOWLATENCY_FLAG_USER="True"
DEADLINE_SCHEDULER_FLAG_USER="True"
elif [ "$HW" = "OAI_USRP" ] ; then
LOWLATENCY_FLAG_USER="False"
DEADLINE_SCHEDULER_FLAG_USER="False"
elif [ "$HW" = "OAI_BLADERF" ] ; then
LOWLATENCY_FLAG_USER="False"
DEADLINE_SCHEDULER_FLAG_USER="False"
elif [ "$HW" = "OAI_LMSSDR" ] ; then
LOWLATENCY_FLAG_USER="False"
DEADLINE_SCHEDULER_FLAG_USER="False"
elif [ "$HW" = "None" ] ; then
LOWLATENCY_FLAG_USER="False"
DEADLINE_SCHEDULER_FLAG_USER="False"
else
echo_error "Unknown HW type $HW. Exiting now..."
exit
fi
else
LOWLATENCY_FLAG_USER=$FORCE_LOWLATENCY_FLAG_USER
DEADLINE_SCHEDULER_FLAG_USER=$FORCE_DEADLINE_SCHEDULER_FLAG_USER
fi
#Disable CPU Affinity for deadline scheduler
if [ "$LOWLATENCY_FLAG_USER" = "True" ] ; then
if [ "$DEADLINE_SCHEDULER_FLAG_USER" = "True" ] ; then
CPU_AFFINITY_FLAG_USER="False"
fi
echo_info "Flags for Deadline scheduler: $LOWLATENCY_FLAG_USER"
echo_info "Flags for Deadline scheduler: $DEADLINE_SCHEDULER_FLAG_USER"
echo_info "Flags for CPU Affinity: $CPU_AFFINITY_FLAG_USER"
############################################
......@@ -432,7 +432,7 @@ function main() {
echo "set ( RF_BOARD \"${HW}\")" >> $cmake_file
echo "set ( TRANSP_PRO \"${TP}\")" >> $cmake_file
echo "set(PACKAGE_NAME \"${lte_exec}\")" >> $cmake_file
echo "set (LOWLATENCY \"${LOWLATENCY_FLAG_USER}\" )" >>$cmake_file
echo "set (DEADLINE_SCHEDULER \"${DEADLINE_SCHEDULER_FLAG_USER}\" )" >>$cmake_file
echo "set (CPU_AFFINITY \"${CPU_AFFINITY_FLAG_USER}\" )" >>$cmake_file
echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)' >> $cmake_file
cd $DIR/$lte_build_dir/build
......@@ -660,7 +660,7 @@ function main() {
echo "set(RF_BOARD \"${HW}\")" >> $cmake_file
echo "set(TRANSP_PRO \"${TP}\")" >> $cmake_file
echo 'set(PACKAGE_NAME "\"rrh_gw\"")' >> $cmake_file
echo "set (LOWLATENCY \"${LOWLATENCY_FLAG_USER}\" )" >>$cmake_file
echo "set (DEADLINE_SCHEDULER \"${DEADLINE_SCHEDULER_FLAG_USER}\" )" >>$cmake_file
echo "set (CPU_AFFINITY \"${CPU_AFFINITY_FLAG_USER}\" )" >>$cmake_file
echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)' >> $cmake_file
cd $DIR/$rrh_build_dir/build
......@@ -692,7 +692,9 @@ function main() {
#add exmimo compilation
#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"
elif [ "$HW" == "OAI_USRP" ] ; then
if [ -d "/usr/include/uhd" ] ; then
......
......@@ -29,7 +29,7 @@ set ( LINUX_LIST False )
set ( LINUX True )
set ( LOCALIZATION False )
set ( LOG_NO_THREAD True )
set ( LOWLATENCY False )
set ( DEADLINE_SCHEDULER False )
set ( MAC_CONTEXT 1 )
set ( MAX_NUM_CCs 1 )
set ( MESSAGE_CHART_GENERATOR False)
......
......@@ -28,7 +28,7 @@ set ( LINUX_LIST False )
set ( LINUX True )
set ( LOCALIZATION False )
set ( LOG_NO_THREAD True )
set ( LOWLATENCY False )
set ( DEADLINE_SCHEDULER False )
set ( MAC_CONTEXT 1 )
set ( MAX_NUM_CCs 1 )
set ( MESSAGE_CHART_GENERATOR False)
......
......@@ -29,7 +29,7 @@ set ( LINUX_LIST False )
set ( LINUX False )
set ( LOCALIZATION False )
set ( LOG_NO_THREAD False )
set ( LOWLATENCY False )
set ( DEADLINE_SCHEDULER False )
set ( MAC_CONTEXT 1 )
set ( MAX_NUM_CCs 1 )
set ( MIH_C_MEDIEVAL_EXTENSIONS False )
......
......@@ -28,7 +28,7 @@ set ( LINUX_LIST False )
set ( LINUX True )
set ( LOCALIZATION False )
set ( LOG_NO_THREAD 1 )
set ( LOWLATENCY False )
set ( DEADLINE_SCHEDULER False )
set ( MAC_CONTEXT 1 )
set ( MAX_NUM_CCs 1 )
set ( MESSAGE_CHART_GENERATOR False )
......
......@@ -29,7 +29,7 @@ set ( LINUX_LIST False )
set ( LINUX True )
set ( LOCALIZATION False )
set ( LOG_NO_THREAD True )
set ( LOWLATENCY False )
set ( DEADLINE_SCHEDULER False )
set ( MAC_CONTEXT 1 )
set ( MAX_NUM_CCs 1 )
set ( MESSAGE_CHART_GENERATOR False)
......
......@@ -293,7 +293,8 @@ check_install_oai_software() {
python-numpy \
sshpass \
libxslt1-dev \
android-tools-adb
android-tools-adb \
iperf3
$SUDO update-alternatives --set liblapack.so /usr/lib/atlas-base/atlas/liblapack.so
......
......@@ -8,8 +8,12 @@ if [ "$OPENAIR_DIR" == "" ]; then
fi
sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches'
#load the module
sudo -E $OPENAIR_DIR/cmake_targets/tools/init_exmimo2
exmimo_mod=`lsmod |grep openair_rf`
#load the module only if absent to avoid kernel crashes
if [ -z "$exmimo_mod" ]
then
sudo -E $OPENAIR_DIR/cmake_targets/tools/init_exmimo2
fi
#now we stop the card from transmitting anything
cd $OPENAIR_DIR/targets/bin
......
......@@ -30,20 +30,10 @@
#include "PHY/defs.h"
#include "PHY/extern.h"
#ifdef EXMIMO
#include "openair0_lib.h"
extern int card;
#endif
void
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",
rx_power_fil_dB,
ue->measurements.rssi,
......@@ -80,77 +70,6 @@ phy_adjust_gain (PHY_VARS_UE *ue, uint32_t rx_power_fil_dB, uint8_t eNB_id)
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);
#ifdef EXMIMO
if (ue->rx_total_gain_dB>ue->rx_gain_max[0]) {
ue->rx_total_gain_dB = ue->rx_gain_max[0];
for (i=0; i<ue->frame_parms.nb_antennas_rx; i++) {
p_exmimo_config->rf.rx_gain[i][0] = 30;
}
} else if (ue->rx_total_gain_dB<(ue->rx_gain_max[0]-30)) {
// for the moment we stay in max gain mode
ue->rx_total_gain_dB = ue->rx_gain_max[0] - 30;
for (i=0; i<ue->frame_parms.nb_antennas_rx; i++) {
p_exmimo_config->rf.rx_gain[i][0] = 0;
}
/*
ue->rx_gain_mode[0] = byp;
ue->rx_gain_mode[1] = byp;
exmimo_pci_interface->rf.rf_mode0 = 22991; //bypass
exmimo_pci_interface->rf.rf_mode1 = 22991; //bypass
if (ue->rx_total_gain_dB<(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<ue->frame_parms.nb_antennas_rx; i++) {
p_exmimo_config->rf.rx_gain[i][0] = 30 - ue->rx_gain_max[0] + ue->rx_total_gain_dB;
}
}
/*
break;
case med_gain:
case byp_gain:
if (ue->rx_total_gain_dB>ue->rx_gain_byp[0]) {
ue->rx_gain_mode[0] = max_gain;
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 (ue->rx_total_gain_dB>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 - ue->rx_gain_max[0] + ue->rx_total_gain_dB;
exmimo_pci_interface->rf.rx_gain10 = 50 - ue->rx_gain_max[1] + ue->rx_total_gain_dB;
}
}
else if (ue->rx_total_gain_dB<(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 - ue->rx_gain_byp[0] + ue->rx_total_gain_dB;
exmimo_pci_interface->rf.rx_gain10 = 50 - ue->rx_gain_byp[1] + 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
/* 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",
......
......@@ -6817,6 +6817,7 @@ void dft60(int16_t *x,int16_t *y,unsigned char scale)
for (i=0; i<60; i++) {
y128[i] = mulhi_int16(y128[i],norm128);
printf("y[%d] = (%d,%d)\n",i,((int16_t*)&y128[i])[0],((int16_t*)&y128[i])[1]);
}
}
......@@ -18553,6 +18554,7 @@ int main(int argc, char**argv)
simd_q15_t x[4096],y[4096],tw0,tw1,tw2,tw3;
#endif
int i;
simd_q15_t *x128=x,*y128=y;
set_taus_seed(0);
opp_enabled = 1;
......@@ -18592,17 +18594,22 @@ int main(int argc, char**argv)
((int16_t *)&tw3)[5] = 0;
((int16_t *)&tw3)[6] = 32767;
((int16_t *)&tw3)[7] = 0;
*/
for (i=0;i<300;i++) {
#if defined(__x86_64__) || defined(__i386__)
#ifndef __AVX2__
x[i] = _mm_set1_epi32(taus());
x[i] = _mm_srai_epi16(x[i],4);
#else
x[i] = _mm256_set1_epi32(taus());
x[i] = _mm256_srai_epi16(x[i],4);
#endif
#elif defined(__arm__)
x[i] = (int16x8_t)vdupq_n_s32(taus());
x[i] = vshrq_n_s16(x[i],4);
#endif
}
/*
bfly2_tw1(x,x+1,y,y+1);
printf("(%d,%d) (%d,%d) => (%d,%d) (%d,%d)\n",((int16_t*)&x[0])[0],((int16_t*)&x[0])[1],((int16_t*)&x[1])[0],((int16_t*)&x[1])[1],((int16_t*)&y[0])[0],((int16_t*)&y[0])[1],((int16_t*)&y[1])[0],((int16_t*)&y[1])[1]);
printf("(%d,%d) (%d,%d) => (%d,%d) (%d,%d)\n",((int16_t*)&x[0])[0],((int16_t*)&x[0])[1],((int16_t*)&x[1])[0],((int16_t*)&x[1])[1],((int16_t*)&y[0])[2],((int16_t*)&y[0])[3],((int16_t*)&y[1])[2],((int16_t*)&y[1])[3]);
......@@ -18743,27 +18750,27 @@ int main(int argc, char**argv)
for (i=0;i<48;i++)
printf("%d,%d,",((int16_t*)(&y[i]))[0],((int16_t *)(&y[i]))[1]);
printf("\n");
*/
dft60((int16_t *)x,(int16_t *)y,1);
printf("\n\n60-point\n");
printf("X: ");
for (i=0;i<60;i++)
printf("%d,%d,",((int16_t*)(&x[i]))[0],((int16_t *)(&x[i]))[1]);
printf("%d,%d,",((int16_t*)(&x128[i]))[0],((int16_t *)(&x128[i]))[1]);
printf("\nY:");
for (i=0;i<60;i++)
printf("%d,%d,",((int16_t*)(&y[i]))[0],((int16_t *)(&y[i]))[1]);
printf("%d,%d,",((int16_t*)(&y128[i]))[0],((int16_t *)(&y128[i]))[1]);
printf("\n");
dft72((int16_t *)x,(int16_t *)y,1);
printf("\n\n72-point\n");
printf("X: ");
for (i=0;i<72;i++)
printf("%d,%d,",((int16_t*)(&x[i]))[0],((int16_t *)(&x[i]))[1]);
printf("%d,%d,",((int16_t*)(&x128[i]))[0],((int16_t *)(&x128[i]))[1]);
printf("\nY:");
for (i=0;i<72;i++)
printf("%d: %d,%d\n",i,((int16_t*)(&y[i]))[0],((int16_t *)(&y[i]))[1]);
printf("%d: %d,%d\n",i,((int16_t*)(&y128[i]))[0],((int16_t *)(&y128[i]))[1]);
printf("\n");
/*
dft96((int16_t *)x,(int16_t *)y,1);
printf("\n\n96-point\n");
printf("X: ");
......@@ -18783,17 +18790,17 @@ int main(int argc, char**argv)
for (i=0;i<108;i++)
printf("%d: %d,%d\n",i,((int16_t*)(&y[i]))[0],((int16_t *)(&y[i]))[1]);
printf("\n");
*/
dft120((int16_t *)x,(int16_t *)y,1);
printf("\n\n120-point\n");
printf("X: ");
for (i=0;i<120;i++)
printf("%d,%d,",((int16_t*)(&x[i]))[0],((int16_t *)(&x[i]))[1]);
printf("%d,%d,",((int16_t*)(&x128[i]))[0],((int16_t *)(&x128[i]))[1]);
printf("\nY:");
for (i=0;i<120;i++)
printf("%d: %d,%d\n",i,((int16_t*)(&y[i]))[0],((int16_t *)(&y[i]))[1]);
printf("%d: %d,%d\n",i,((int16_t*)(&y128[i]))[0],((int16_t *)(&y128[i]))[1]);
printf("\n");
/*
dft144((int16_t *)x,(int16_t *)y,1);
printf("\n\n144-point\n");
printf("X: ");
......@@ -50,6 +50,7 @@
* @defgroup _GENERIC_PHY_RF_INTERFACE_ Generic PHY - RF Interface
* @defgroup _USRP_PHY_RF_INTERFACE_ PHY - USRP RF Interface
* @defgroup _BLADERF_PHY_RF_INTERFACE_ PHY - BLADERF RF Interface
* @defgroup _LMSSDR_PHY_RF_INTERFACE_ PHY - LMSSDR RF Interface
* @}
*
* @ingroup _ref_implementation_
......
......@@ -583,7 +583,6 @@ void fill_dci(DCI_PDU *DCI_pdu,PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
void fill_dci_emos(DCI_PDU *DCI_pdu, uint8_t subframe, PHY_VARS_eNB *eNB)
{
//uint8_t cooperation_flag = eNB->cooperation_flag;
uint8_t transmission_mode = eNB->transmission_mode[0];
......
......@@ -37,6 +37,7 @@
#include <stdlib.h>
#include <inttypes.h>
#include "bladerf_lib.h"
#include "math.h"
/** @addtogroup _BLADERF_PHY_RF_INTERFACE_
* @{
......@@ -58,14 +59,16 @@ int num_devices=0;
/*! \brief BladeRF Init function (not used at the moment)
* \param device RF frontend parameters set by application
* \returns 0 on success
*/
int trx_brf_init(openair0_device *device) {
return 0;
}
/*! \brief get current timestamp
*\param device the hardware to use
*\param module the bladeRf module
*\returns timestamp of BladeRF
*/
openair0_timestamp trx_get_timestamp(openair0_device *device, bladerf_module module) {
......@@ -83,28 +86,22 @@ openair0_timestamp trx_get_timestamp(openair0_device *device, bladerf_module mod
}
/*! \brief Start BladeRF
*\param device the hardware to use
* \param device the hardware to use
* \returns 0 on success
*/
int trx_brf_start(openair0_device *device) {
return 0;
}
/*! \brief Get BladeRF stats
*\param device the hardware to use
*/
static void trx_brf_stats(openair0_device *device){
}
/*! \brief Called to send samples to the BladeRF RF target
@param device pointer to the device structure specific to the RF hardware target
@param timestamp The timestamp at whicch the first sample MUST be sent
@param buff Buffer which holds the samples
@param nsamps number of samples to be sent
@param cc index of the component carrier
@param flags Ignored for the moment
\param device pointer to the device structure specific to the RF hardware target
\param timestamp The timestamp at whicch the first sample MUST be sent
\param buff Buffer which holds the samples
\param nsamps number of samples to be sent
\param cc index of the component carrier
\param flags Ignored for the moment
\returns 0 on success
*/
static int trx_brf_write(openair0_device *device,openair0_timestamp ptimestamp, void **buff, int nsamps, int cc, int flags) {
......@@ -156,6 +153,7 @@ static int trx_brf_write(openair0_device *device,openair0_timestamp ptimestamp,
* \param[out] buff An array of pointers to buffers for received samples. The buffers must be large enough to hold the number of samples \ref nsamps.
* \param nsamps Number of samples. One sample is 2 byte I + 2 byte Q => 4 byte.
* \param cc Index of component carrier
* \returns number of samples read
*/
static int trx_brf_read(openair0_device *device, openair0_timestamp *ptimestamp, void **buff, int nsamps, int cc) {
......@@ -176,9 +174,10 @@ static int trx_brf_read(openair0_device *device, openair0_timestamp *ptimestamp,
brf->num_rx_errors++;
} else if ( brf->meta_rx.status & BLADERF_META_STATUS_OVERRUN) {
brf->num_overflows++;
printf("RX overrun (%d) is detected. t=%u. Got %u samples. nsymps %d\n",
printf("RX overrun (%d) is detected. t=" "%" PRIu64 "Got %u samples. nsymps %d\n",
brf->num_overflows,brf->meta_rx.timestamp, brf->meta_rx.actual_count, nsamps);
}
//printf("Current RX timestampe %u\n", brf->meta_rx.timestamp);
//printf("[BRF] (buff %p) ts=0x%"PRIu64" %s\n",samples, brf->meta_rx.timestamp,bladerf_strerror(status));
brf->rx_current_ts=brf->meta_rx.timestamp;
......@@ -196,7 +195,7 @@ static int trx_brf_read(openair0_device *device, openair0_timestamp *ptimestamp,
/*! \brief Terminate operation of the BladeRF transceiver -- free all associated resources
* \param device the hardware to use
*/
int trx_brf_end(openair0_device *device) {
void trx_brf_end(openair0_device *device) {
int status;
brf_state_t *brf = (brf_state_t*)device->priv;
......@@ -208,7 +207,6 @@ int trx_brf_end(openair0_device *device) {
fprintf(stderr, "Failed to disable TX module: %s\n", bladerf_strerror(status));
}
bladerf_close(brf->dev);
return 0;
}
/*! \brief print the BladeRF statistics
......@@ -231,10 +229,11 @@ int trx_brf_reset_stats(openair0_device* device) {
}
/*! \brief Stop USRP
* \param device the hardware to use
/*! \brief Stop BladeRF
* \param card the hardware to use
* \returns 0 in success
*/
int trx_brf_stop(openair0_device* device) {
int trx_brf_stop(int card) {
return(0);
......@@ -242,9 +241,11 @@ int trx_brf_stop(openair0_device* device) {
/*! \brief Set frequencies (TX/RX)
* \param device the hardware to use
* \param openair0_cfg1 openair0 Config structure (ignored. It is there to comply with RF common API)
* \param exmimo_dump_config (ignored)
* \returns 0 in success
*/
int trx_brf_set_freq(openair0_device* device) {
int trx_brf_set_freq(openair0_device* device, openair0_config_t *openair0_cfg1,int exmimo_dump_config) {
int status;
brf_state_t *brf = (brf_state_t *)device->priv;
......@@ -269,9 +270,10 @@ int trx_brf_set_freq(openair0_device* device) {
/*! \brief Set Gains (TX/RX)
* \param device the hardware to use
* \param openair0_cfg openair0 Config structure
* \returns 0 in success
*/
int trx_brf_set_gains(openair0_device* device) {
int trx_brf_set_gains(openair0_device* device, openair0_config_t *openair0_cfg) {
return(0);
......@@ -283,12 +285,17 @@ int trx_brf_set_gains(openair0_device* device) {
int16_t cos_fsover8[8] = {2047, 1447, 0, -1448, -2047, -1448, 0, 1447};
int16_t cos_3fsover8[8] = {2047, -1448, 0, 1447, -2047, 1447, 0, -1448};
/*! \brief calibration table for BladeRF */
rx_gain_calib_table_t calib_table_fx4[] = {
{2300000000.0,53.5},
{1880000000.0,57.0},
{816000000.0,73.0},
{-1,0}};
/*! \brief set RX gain offset from calibration table
* \param openair0_cfg RF frontend parameters set by application
* \param chain_index RF chain ID
*/
void set_rx_gain_offset(openair0_config_t *openair0_cfg, int chain_index) {
int i=0;
......@@ -310,6 +317,9 @@ void set_rx_gain_offset(openair0_config_t *openair0_cfg, int chain_index) {
}
/*! \brief Calibrate LMSSDR RF
* \param device the hardware to use
*/
void calibrate_rf(openair0_device *device) {
......@@ -885,11 +895,10 @@ void calibrate_rf(openair0_device *device) {
/*! \brief Initialize Openair BLADERF target. It returns 0 if OK
* \param device the hardware to use
* \param openair0_cfg RF frontend parameters set by application
* \returns 0 on success
*/
int device_init(openair0_device *device, openair0_config_t *openair0_cfg) {
int status;
int card=0;
brf_state_t *brf = (brf_state_t*)malloc(sizeof(brf_state_t));
memset(brf, 0, sizeof(brf_state_t));
/* device specific */
......@@ -1063,8 +1072,6 @@ int device_init(openair0_device *device, openair0_config_t *openair0_cfg) {
}else
printf("[BRF] RX module calibrated DC \n");
bladerf_log_set_verbosity(get_brf_log_level(openair0_cfg->log_level));
printf("BLADERF: Initializing openair0_device\n");
......@@ -1091,16 +1098,18 @@ int device_init(openair0_device *device, openair0_config_t *openair0_cfg) {
/*! \brief bladeRF error report
* \param status
* \returns 0 on success
*/
int brf_error(int status) {
//exit(-1);
//return 1; // or status error code
return status; // or status error code
}
/*! \brief Open BladeRF from serial port
* \param serial name of serial port on which to open BladeRF device
* \returns bladerf device structure
*/
struct bladerf * open_bladerf_from_serial(const char *serial) {
......@@ -1131,6 +1140,7 @@ struct bladerf * open_bladerf_from_serial(const char *serial) {
/*! \brief Get BladeRF log level
* \param log_level log level
* \returns log level of BLADERF device
*/
int get_brf_log_level(int log_level){
......
......@@ -106,6 +106,27 @@ typedef struct {
/*
* func prototypes
*/
/*! \brief BladeRF Init function (not used at the moment)
* \param device RF frontend parameters set by application
*/
int trx_brf_init(openair0_device *device);
/*! \brief get current timestamp
*\param device the hardware to use
*\param module the bladeRf module
*/
openair0_timestamp trx_get_timestamp(openair0_device *device, bladerf_module module);
/*! \brief Get BladeRF log level
* \param log_level log level
* \returns log level of BLADERF device
*/
int get_brf_log_level(int log_level);
/*! \brief bladeRF error report
* \param status
* \returns 0 on success
*/
int brf_error(int status);
/*@}*/
......@@ -51,6 +51,9 @@
#define BBU_LOCAL_RADIO_HEAD 0
#define BBU_REMOTE_RADIO_HEAD 1
#define MAX_CARDS 8
typedef int64_t openair0_timestamp;
typedef volatile int64_t openair0_vtimestamp;
......@@ -59,9 +62,9 @@ typedef volatile int64_t openair0_vtimestamp;
typedef struct openair0_device_t openair0_device;
#ifndef EXMIMO
#define MAX_CARDS 1
#endif
//#define USRP_GAIN_OFFSET (56.0) // 86 calibrated for USRP B210 @ 2.6 GHz to get equivalent RS EPRE in OAI to SMBV100 output
......@@ -145,16 +148,12 @@ typedef struct {
unsigned int samples_per_frame;
//! the sample rate for both transmit and receive.
double sample_rate;
//! number of samples per RX/TX packet (USRP + Ethernet)
unsigned int samples_per_packet;
//! delay in sending samples (write) due to hardware access, softmodem processing and fronthaul delay if exist
int tx_scheduling_advance;
//! flag to indicate that the device is doing mmapped DMA transfers
int mmapped_dma;
//! offset in samples between TX and RX paths
int tx_sample_advance;
//! configurable tx thread lauch delay
int txlaunch_wait; /* 1 or 0 */
//! configurable tx thread lauch delay
int txlaunch_wait_slotcount;
int samples_per_packet;
int tx_scheduling_advance;
//! number of RX channels (=RX antennas)
int rx_num_channels;
//! number of TX channels (=TX antennas)
......@@ -165,7 +164,7 @@ typedef struct {
//! \brief Center frequency in Hz for TX.
//! index: [0..rx_num_channels[ !!! see lte-ue.c:427 FIXME iterates over rx_num_channels
double tx_freq[4];
//! \brief memory
//! \brief Pointer to Calibration table for RX gains
rx_gain_calib_table_t *rx_gain_calib_table;
......
......@@ -36,17 +36,34 @@
* 28.01.2013: Initial version
*/
#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <fcntl.h>
#include <getopt.h>
#include <unistd.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/mman.h>
#include <string.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <sched.h>
#include <linux/sched.h>
#include <signal.h>
#include <execinfo.h>
#include <getopt.h>
#include <sys/sysinfo.h>
#include <sys/ioctl.h>
#include <linux/kernel.h>
#include <linux/types.h>
#include <syscall.h>
#include "openair0_lib.h"
#include "openair_device.h"
#include "common_lib.h"
#include <pthread.h>
#define max(a,b) ((a)>(b) ? (a) : (b))
exmimo_pci_interface_bot_virtual_t openair0_exmimo_pci[MAX_CARDS]; // contains userspace pointers for each card
......@@ -66,6 +83,14 @@ static uint32_t rf_vcocal[4] = {910,910,910,910};
static uint32_t rf_vcocal_850[4] = {2015, 2015, 2015, 2015};
static uint32_t rf_rxdc[4] = {32896,32896,32896,32896};
extern volatile int oai_exit;
void kill_watchdog(openair0_device *);
void create_watchdog(openair0_device *);
unsigned int log2_int( unsigned int x )
{
unsigned int ans = 0 ;
......@@ -247,16 +272,279 @@ int openair0_stop_without_reset(int card)
#define MY_RF_MODE (RXEN + TXEN + TXLPFNORM + TXLPFEN + TXLPF25 + RXLPFNORM + RXLPFEN + RXLPF25 + LNA1ON +LNAMax + RFBBNORM + DMAMODE_RX + DMAMODE_TX)
#define RF_MODE_BASE (LNA1ON + RFBBNORM)
static void *watchdog_thread(void *arg) {
int policy, s, j;
struct sched_param sparam;
char cpu_affinity[1024];
cpu_set_t cpuset;
exmimo_state_t *exm=((openair0_device *)arg)->priv;
openair0_config_t *cfg=&((openair0_device *)arg)->openair0_cfg[0];
volatile unsigned int *daq_mbox = openair0_daq_cnt();
unsigned int mbox,diff;
/* Set affinity mask to include CPUs 1 to MAX_CPUS */
/* CPU 0 is reserved for UHD threads */
/* CPU 1 is reserved for all TX threads */
/* Enable CPU Affinity only if number of CPUs >2 */
CPU_ZERO(&cpuset);
#ifdef CPU_AFFINITY
if (get_nprocs() > 2)
{
for (j = 1; j < get_nprocs(); j++)
CPU_SET(j, &cpuset);
s = pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset);
if (s != 0)
{
perror( "pthread_setaffinity_np");
printf("Error setting processor affinity");
}
}
#endif //CPU_AFFINITY
/* Check the actual affinity mask assigned to the thread */
s = pthread_getaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset);
if (s != 0)
{
perror( "pthread_getaffinity_np");
printf("Error getting processor affinity ");
}
memset(cpu_affinity,0,sizeof(cpu_affinity));
for (j = 0; j < CPU_SETSIZE; j++)
if (CPU_ISSET(j, &cpuset))
{
char temp[1024];
sprintf (temp, " CPU_%d", j);
strcat(cpu_affinity, temp);
}
memset(&sparam, 0 , sizeof (sparam));
sparam.sched_priority = sched_get_priority_max(SCHED_FIFO);
policy = SCHED_FIFO ;
s = pthread_setschedparam(pthread_self(), policy, &sparam);
if (s != 0)
{
perror("pthread_setschedparam : ");
printf("Error setting thread priority");
}
s = pthread_getschedparam(pthread_self(), &policy, &sparam);
if (s != 0)
{
perror("pthread_getschedparam : ");
printf("Error getting thread priority");
}
printf("EXMIMO2 Watchdog TX thread started on CPU %d TID %ld, sched_policy = %s , priority = %d, CPU Affinity=%s \n",
sched_getcpu(),
syscall(__NR_gettid),
(policy == SCHED_FIFO) ? "SCHED_FIFO" :
(policy == SCHED_RR) ? "SCHED_RR" :
(policy == SCHED_OTHER) ? "SCHED_OTHER" :
"???",
sparam.sched_priority,
cpu_affinity );
mlockall(MCL_CURRENT | MCL_FUTURE);
exm->watchdog_exit = 0;
exm->ts = 0;
exm->last_mbox = 0;
if (cfg->sample_rate==30.72e6) {
exm->samples_per_tick = 15360;
exm->samples_per_frame = 307200;
}
else if (cfg->sample_rate==23.04e6) {
exm->samples_per_tick = 11520;
exm->samples_per_frame = 230400;
}
else if (cfg->sample_rate==15.36e6) {
exm->samples_per_tick = 7680;
exm->samples_per_frame = 153600;
}
else if (cfg->sample_rate==7.68e6) {
exm->samples_per_tick = 3840;
exm->samples_per_frame = 76800;
}
else if (cfg->sample_rate==3.84e6) {
exm->samples_per_tick = 1920;
exm->samples_per_frame = 38400;
}
else if (cfg->sample_rate==1.92e6) {
exm->samples_per_tick = 960;
exm->samples_per_frame = 19200;
}
else {
printf("Unknown sampling rate %f, exiting \n",cfg->sample_rate);
exm->watchdog_exit=1;
}
// main loop to keep up with DMA transfers from exmimo2
while ((!oai_exit) && (!exm->watchdog_exit)) {
if (exm->daq_state == running) {
// grab time from MBOX
mbox = daq_mbox[0];
if (mbox<exm->last_mbox) { // wrap-around
diff = 150 + mbox - exm->last_mbox;
}
else {
diff = mbox - exm->last_mbox;
}
exm->last_mbox = mbox;
pthread_mutex_lock(&exm->watchdog_mutex);
exm->ts += (diff*exm->samples_per_frame/150) ;
if (diff > 10) // we're too late so exit
exm->watchdog_exit = 1;
if (exm->ts - exm->last_ts_rx > exm->samples_per_frame) {
exm->watchdog_exit = 1;
printf("RX Overflow, exiting\n");
}
pthread_mutex_unlock(&exm->watchdog_mutex);
}
usleep(500); // sleep for 500us
}
oai_exit=1;
return NULL;
}
void create_watchdog(openair0_device *dev) {
exmimo_state_t *priv = dev->priv;
priv->watchdog_exit=0;
#ifndef DEADLINE_SCHEDULER
priv->watchdog_sched_param.sched_priority = sched_get_priority_max(SCHED_FIFO);
pthread_attr_setschedparam(&priv->watchdog_attr,&priv->watchdog_sched_param);
pthread_attr_setschedpolicy(&priv->watchdog_attr,SCHED_FIFO);
pthread_create(&priv->watchdog,&priv->watchdog_attr,watchdog_thread,dev);
#else
pthread_create(&priv->watchdog,NULL,watchdog_thread,devv);
#endif
pthread_mutex_init(&priv->watchdog_mutex,NULL);
}
int trx_exmimo_start(openair0_device *device) {
exmimo_state_t *exm=device->priv;
openair0_start_rt_acquisition(0);
exm->daq_state = running;
return(0);
}
int trx_exmimo_write(openair0_device *device,openair0_timestamp ptimestamp, void **buff, int nsamps, int cc, int flags) {
return(0);
}
int trx_exmimo_read(openair0_device *device, openair0_timestamp *ptimestamp, void **buff, int nsamps, int cc) {
exmimo_state_t *exm=device->priv;
openair0_config_t *cfg=&device->openair0_cfg[0];
openair0_timestamp ts,diff;
int i;
pthread_mutex_lock(&exm->watchdog_mutex);
ts = exm->ts;
pthread_mutex_unlock(&exm->watchdog_mutex);
while (ts < exm->last_ts_rx + nsamps) {
diff = exm->last_ts_rx+nsamps - ts; // difference in samples between current timestamp and last RX received sample
// go to sleep until we should have enough samples (1024 for a bit more)
usleep((unsigned int)((double)(diff+1024)*1e6/cfg->sample_rate));
// get new timestamp, in case we have to sleep again
pthread_mutex_lock(&exm->watchdog_mutex);
ts = exm->ts;
pthread_mutex_unlock(&exm->watchdog_mutex);
}
if (cfg->mmapped_dma == 0) { // if buff is not the dma buffer, do a memcpy, otherwise do nothing
for (i=0;i<cc;i++) {
memcpy(buff[i],
openair0_exmimo_pci[0].adc_head[i]+(exm->last_ts_rx % exm->samples_per_frame),
nsamps*sizeof(int));
}
}
*ptimestamp=exm->last_ts_rx;
exm->last_ts_rx += nsamps;
return(0);
}
void trx_exmimo_end(openair0_device *device) {
exmimo_state_t *exm=device->priv;
exm->daq_state = idle;
openair0_stop(0);
}
int trx_exmimo_get_stats(openair0_device* device) {
return(0);
}
int trx_exmimo_reset_stats(openair0_device* device) {
return(0);
}
int trx_exmimo_stop(int card) {
return(0);
}
int trx_exmimo_set_freq(openair0_device* device, openair0_config_t *openair0_cfg1,int exmimo_dump_config) {
return(0);
}
int trx_exmimo_set_gains(openair0_device* device, openair0_config_t *openair0_cfg) {
return(0);
}
void kill_watchdog(openair0_device *device) {
exmimo_state_t *exm=(exmimo_state_t *)device->priv;
exm->watchdog_exit=1;
}
int device_init(openair0_device *device, openair0_config_t *openair0_cfg) {
// Initialize card
// exmimo_config_t *p_exmimo_config;
exmimo_id_t *p_exmimo_id;
int ret;
exmimo_state_t *exm = (exmimo_state_t *)malloc(sizeof(exmimo_state_t));
ret = openair0_open();
if ( ret != 0 ) {
if (ret == -1)
printf("Error opening /dev/openair0");
......@@ -289,6 +577,23 @@ int device_init(openair0_device *device, openair0_config_t *openair0_cfg) {
device->type = EXMIMO_DEV;
// Add stuff that was in lte-softmodem here
//
device->trx_start_func = trx_exmimo_start;
device->trx_end_func = trx_exmimo_end;
device->trx_read_func = trx_exmimo_read;
device->trx_write_func = trx_exmimo_write;
device->trx_get_stats_func = trx_exmimo_get_stats;
device->trx_reset_stats_func = trx_exmimo_reset_stats;
device->trx_stop_func = trx_exmimo_stop;
device->trx_set_freq_func = trx_exmimo_set_freq;
device->trx_set_gains_func = trx_exmimo_set_gains;
device->openair0_cfg = openair0_cfg;
device->priv = (void *)exm;
create_watchdog(device);
return(0);
}
......@@ -326,8 +631,6 @@ int openair0_config(openair0_config_t *openair0_cfg, int UE_flag)
p_exmimo_config->framing.multicard_syncmode=SYNCMODE_SLAVE;
/* device specific */
openair0_cfg[card].txlaunch_wait = 1;//manage when TX processing is triggered
openair0_cfg[card].txlaunch_wait_slotcount = 1; //manage when TX processing is triggered
openair0_cfg[card].iq_txshift = 4;//shift
openair0_cfg[card].iq_rxrescale = 15;//rescale iqs
......
......@@ -42,6 +42,29 @@
#include "pcie_interface.h"
#include "openair_device.h"
#include "common_lib.h"
#include <pthread.h>
#include <sched.h>
#include <linux/sched.h>
typedef enum {
idle=0,
waiting_for_synch,
running
} exmimo_daq_state_t;
typedef struct {
pthread_t watchdog;
pthread_attr_t watchdog_attr;
struct sched_param watchdog_sched_param;
pthread_mutex_t watchdog_mutex;
int watchdog_exit;
exmimo_daq_state_t daq_state;
openair0_timestamp ts;
openair0_timestamp last_ts_rx;
int samples_per_tick;
int samples_per_frame;
int last_mbox;
} exmimo_state_t;
// Use this to access shared memory (configuration structures, adc/dac data buffers, ...)
// contains userspace pointers
......
......@@ -796,7 +796,8 @@ INPUT = $(OPENAIR1_DIR)/PHY/defs.h \
$(OPENAIR_TARGETS)/ARCH/COMMON/common_lib.h \
$(OPENAIR_TARGETS)/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp \
$(OPENAIR_TARGETS)/ARCH/BLADERF/USERSPACE/LIB/bladerf_lib.c \
$(OPENAIR_TARGETS)/ARCH/BLADERF/USERSPACE/LIB/bladerf_lib.h
$(OPENAIR_TARGETS)/ARCH/BLADERF/USERSPACE/LIB/bladerf_lib.h \
$(OPENAIR_TARGETS)/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp
# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
......
Active_eNBs = ( "eNB_Eurecom_LTEBox");
# Asn1_verbosity, choice in: none, info, annoying
Asn1_verbosity = "none";
eNBs =
(
{
////////// Identification parameters:
eNB_ID = 0xe00;
cell_type = "CELL_MACRO_ENB";
eNB_name = "eNB_Eurecom_LTEBox";
// Tracking area code, 0x0000 and 0xfffe are reserved values
tracking_area_code = "1";
mobile_country_code = "208";
mobile_network_code = "92";
////////// Physical parameters:
component_carriers = (
{
frame_type = "FDD";
tdd_config = 3;
tdd_config_s = 0;
prefix_type = "NORMAL";
eutra_band = 7;
downlink_frequency = 2660000000L;
uplink_frequency_offset = -120000000;
Nid_cell = 0;
N_RB_DL = 25;
Nid_cell_mbsfn = 0;
nb_antennas_tx = 1;
nb_antennas_rx = 1;
tx_gain = 32;
rx_gain = 116;
prach_root = 0;
prach_config_index = 0;
prach_high_speed = "DISABLE";
prach_zero_correlation = 1;
prach_freq_offset = 2;
pucch_delta_shift = 1;
pucch_nRB_CQI = 1;
pucch_nCS_AN = 0;
pucch_n1_AN = 32;
pdsch_referenceSignalPower = -16;
pdsch_p_b = 0;
pusch_n_SB = 1;
pusch_enable64QAM = "DISABLE";
pusch_hoppingMode = "interSubFrame";
pusch_hoppingOffset = 0;
pusch_groupHoppingEnabled = "ENABLE";
pusch_groupAssignment = 0;
pusch_sequenceHoppingEnabled = "DISABLE";
pusch_nDMRS1 = 1;
phich_duration = "NORMAL";
phich_resource = "ONESIXTH";
srs_enable = "DISABLE";
/* srs_BandwidthConfig =;
srs_SubframeConfig =;
srs_ackNackST =;
srs_MaxUpPts =;*/
pusch_p0_Nominal = -90;
pusch_alpha = "AL1";
pucch_p0_Nominal = -108;
msg3_delta_Preamble = 6;
pucch_deltaF_Format1 = "deltaF2";
pucch_deltaF_Format1b = "deltaF3";
pucch_deltaF_Format2 = "deltaF0";
pucch_deltaF_Format2a = "deltaF0";
pucch_deltaF_Format2b = "deltaF0";
rach_numberOfRA_Preambles = 64;
rach_preamblesGroupAConfig = "DISABLE";
/*
rach_sizeOfRA_PreamblesGroupA = ;
rach_messageSizeGroupA = ;
rach_messagePowerOffsetGroupB = ;
*/
rach_powerRampingStep = 4;
rach_preambleInitialReceivedTargetPower = -108;
rach_preambleTransMax = 10;
rach_raResponseWindowSize = 10;
rach_macContentionResolutionTimer = 48;
rach_maxHARQ_Msg3Tx = 4;
pcch_default_PagingCycle = 128;
pcch_nB = "oneT";
bcch_modificationPeriodCoeff = 2;
ue_TimersAndConstants_t300 = 1000;
ue_TimersAndConstants_t301 = 1000;
ue_TimersAndConstants_t310 = 1000;
ue_TimersAndConstants_t311 = 10000;
ue_TimersAndConstants_n310 = 20;
ue_TimersAndConstants_n311 = 1;
}
);
srb1_parameters :
{
# timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500]
timer_poll_retransmit = 80;
# timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200]
timer_reordering = 35;
# timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500]
timer_status_prohibit = 0;
# poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)]
poll_pdu = 4;
# poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)]
poll_byte = 99999;
# max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32]
max_retx_threshold = 4;
}
# ------- SCTP definitions
SCTP :
{
# Number of streams to use in input/output
SCTP_INSTREAMS = 2;
SCTP_OUTSTREAMS = 2;
};
////////// MME parameters:
mme_ip_address = ( { ipv4 = "192.168.12.26";
ipv6 = "192:168:30::17";
active = "yes";
preference = "ipv4";
}
);
NETWORK_INTERFACES :
{
ENB_INTERFACE_NAME_FOR_S1_MME = "eth0";
ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.111/24";
ENB_INTERFACE_NAME_FOR_S1U = "eth0";
ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.111/24";
ENB_PORT_FOR_S1U = 2152; # Spec 2152
};
log_config :
{
global_log_level ="debug";
global_log_verbosity ="medium";
hw_log_level ="info";
hw_log_verbosity ="medium";
phy_log_level ="info";
phy_log_verbosity ="medium";
mac_log_level ="info";
mac_log_verbosity ="high";
rlc_log_level ="info";
rlc_log_verbosity ="medium";
pdcp_log_level ="info";
pdcp_log_verbosity ="medium";
rrc_log_level ="info";
rrc_log_verbosity ="medium";
};
}
);
......@@ -151,7 +151,7 @@ rrh_gw_config = (
tr_preference = "raw";
rf_preference = "usrp_b200";
iq_txshift = 4;
tx_sample_advance = 113;
tx_sample_advance = 103;
tx_scheduling_advance = 9;
}
......
......@@ -163,7 +163,7 @@ eNBs =
tr_preference = "raw";
rf_preference = "usrp_b200";
iq_txshift = 4;
tx_sample_advance = 70;
tx_sample_advance = 80;
tx_scheduling_advance = 9;
}
);
......
Active_eNBs = ( "eNB_Eurecom_LTEBox");
# Asn1_verbosity, choice in: none, info, annoying
Asn1_verbosity = "none";
eNBs =
(
{
////////// Identification parameters:
eNB_ID = 0xe00;
cell_type = "CELL_MACRO_ENB";
eNB_name = "eNB_Eurecom_LTEBox";
// Tracking area code, 0x0000 and 0xfffe are reserved values
tracking_area_code = "1";
mobile_country_code = "208";
mobile_network_code = "95";
////////// Physical parameters:
component_carriers = (
{
frame_type = "FDD";
tdd_config = 3;
tdd_config_s = 0;
prefix_type = "NORMAL";
eutra_band = 7;
downlink_frequency = 2660000000L;
uplink_frequency_offset = -120000000;
Nid_cell = 0;
N_RB_DL = 25;
Nid_cell_mbsfn = 0;
nb_antennas_tx = 1;
nb_antennas_rx = 1;
tx_gain = 90;
rx_gain = 125;
prach_root = 0;
prach_config_index = 0;
prach_high_speed = "DISABLE";
prach_zero_correlation = 1;
prach_freq_offset = 2;
pucch_delta_shift = 1;
pucch_nRB_CQI = 1;
pucch_nCS_AN = 0;
pucch_n1_AN = 32;
pdsch_referenceSignalPower = -26;
pdsch_p_b = 0;
pusch_n_SB = 1;
pusch_enable64QAM = "DISABLE";
pusch_hoppingMode = "interSubFrame";
pusch_hoppingOffset = 0;
pusch_groupHoppingEnabled = "ENABLE";
pusch_groupAssignment = 0;
pusch_sequenceHoppingEnabled = "DISABLE";
pusch_nDMRS1 = 1;
phich_duration = "NORMAL";
phich_resource = "ONESIXTH";
srs_enable = "DISABLE";
/* srs_BandwidthConfig =;
srs_SubframeConfig =;
srs_ackNackST =;
srs_MaxUpPts =;*/
pusch_p0_Nominal = -90;
pusch_alpha = "AL1";
pucch_p0_Nominal = -108;
msg3_delta_Preamble = 6;
pucch_deltaF_Format1 = "deltaF2";
pucch_deltaF_Format1b = "deltaF3";
pucch_deltaF_Format2 = "deltaF0";
pucch_deltaF_Format2a = "deltaF0";
pucch_deltaF_Format2b = "deltaF0";
rach_numberOfRA_Preambles = 64;
rach_preamblesGroupAConfig = "DISABLE";
/*
rach_sizeOfRA_PreamblesGroupA = ;
rach_messageSizeGroupA = ;
rach_messagePowerOffsetGroupB = ;
*/
rach_powerRampingStep = 4;
rach_preambleInitialReceivedTargetPower = -108;
rach_preambleTransMax = 10;
rach_raResponseWindowSize = 10;
rach_macContentionResolutionTimer = 48;
rach_maxHARQ_Msg3Tx = 4;
pcch_default_PagingCycle = 128;
pcch_nB = "oneT";
bcch_modificationPeriodCoeff = 2;
ue_TimersAndConstants_t300 = 1000;
ue_TimersAndConstants_t301 = 1000;
ue_TimersAndConstants_t310 = 1000;
ue_TimersAndConstants_t311 = 10000;
ue_TimersAndConstants_n310 = 20;
ue_TimersAndConstants_n311 = 1;
}
);
srb1_parameters :
{
# timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500]
timer_poll_retransmit = 80;
# timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200]
timer_reordering = 35;
# timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500]
timer_status_prohibit = 0;
# poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)]
poll_pdu = 4;
# poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)]
poll_byte = 99999;
# max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32]
max_retx_threshold = 4;
}
# ------- SCTP definitions
SCTP :
{
# Number of streams to use in input/output
SCTP_INSTREAMS = 2;
SCTP_OUTSTREAMS = 2;
};
////////// MME parameters:
mme_ip_address = ( { ipv4 = "192.170.0.1";
ipv6 = "192:168:30::17";
active = "yes";
preference = "ipv4";
}
);
NETWORK_INTERFACES :
{
ENB_INTERFACE_NAME_FOR_S1_MME = "eth0:3";
ENB_IPV4_ADDRESS_FOR_S1_MME = "192.170.0.2/24";
ENB_INTERFACE_NAME_FOR_S1U = "eth0:4";
ENB_IPV4_ADDRESS_FOR_S1U = "192.170.1.2/24";
ENB_PORT_FOR_S1U = 2152; # Spec 2152
};
log_config :
{
global_log_level ="debug";
global_log_verbosity ="medium";
hw_log_level ="info";
hw_log_verbosity ="medium";
phy_log_level ="info";
phy_log_verbosity ="medium";
mac_log_level ="info";
mac_log_verbosity ="high";
rlc_log_level ="info";
rlc_log_verbosity ="medium";
pdcp_log_level ="info";
pdcp_log_verbosity ="medium";
rrc_log_level ="info";
rrc_log_verbosity ="medium";
};
}
);
\ No newline at end of file
Active_eNBs = ( "eNB_Eurecom_LTEBox");
# Asn1_verbosity, choice in: none, info, annoying
Asn1_verbosity = "none";
eNBs =
(
{
////////// Identification parameters:
eNB_ID = 0xe00;
cell_type = "CELL_MACRO_ENB";
eNB_name = "eNB_Eurecom_LTEBox";
// Tracking area code, 0x0000 and 0xfffe are reserved values
tracking_area_code = "1";
mobile_country_code = "208";
mobile_network_code = "92";
////////// Physical parameters:
component_carriers = (
{
frame_type = "FDD";
tdd_config = 3;
tdd_config_s = 0;
prefix_type = "NORMAL";
eutra_band = 7;
downlink_frequency = 2660000000L;
uplink_frequency_offset = -120000000;
Nid_cell = 0;
N_RB_DL = 25;
Nid_cell_mbsfn = 0;
nb_antennas_tx = 1;
nb_antennas_rx = 1;
tx_gain = 90;
rx_gain = 125;
prach_root = 0;
prach_config_index = 0;
prach_high_speed = "DISABLE";
prach_zero_correlation = 1;
prach_freq_offset = 2;
pucch_delta_shift = 1;
pucch_nRB_CQI = 1;
pucch_nCS_AN = 0;
pucch_n1_AN = 32;
pdsch_referenceSignalPower = -26;
pdsch_p_b = 0;
pusch_n_SB = 1;
pusch_enable64QAM = "DISABLE";
pusch_hoppingMode = "interSubFrame";
pusch_hoppingOffset = 0;
pusch_groupHoppingEnabled = "ENABLE";
pusch_groupAssignment = 0;
pusch_sequenceHoppingEnabled = "DISABLE";
pusch_nDMRS1 = 1;
phich_duration = "NORMAL";
phich_resource = "ONESIXTH";
srs_enable = "DISABLE";
/* srs_BandwidthConfig =;
srs_SubframeConfig =;
srs_ackNackST =;
srs_MaxUpPts =;*/
pusch_p0_Nominal = -90;
pusch_alpha = "AL1";
pucch_p0_Nominal = -108;
msg3_delta_Preamble = 6;
pucch_deltaF_Format1 = "deltaF2";
pucch_deltaF_Format1b = "deltaF3";
pucch_deltaF_Format2 = "deltaF0";
pucch_deltaF_Format2a = "deltaF0";
pucch_deltaF_Format2b = "deltaF0";
rach_numberOfRA_Preambles = 64;
rach_preamblesGroupAConfig = "DISABLE";
/*
rach_sizeOfRA_PreamblesGroupA = ;
rach_messageSizeGroupA = ;
rach_messagePowerOffsetGroupB = ;
*/
rach_powerRampingStep = 4;
rach_preambleInitialReceivedTargetPower = -108;
rach_preambleTransMax = 10;
rach_raResponseWindowSize = 10;
rach_macContentionResolutionTimer = 48;
rach_maxHARQ_Msg3Tx = 4;
pcch_default_PagingCycle = 128;
pcch_nB = "oneT";
bcch_modificationPeriodCoeff = 2;
ue_TimersAndConstants_t300 = 1000;
ue_TimersAndConstants_t301 = 1000;
ue_TimersAndConstants_t310 = 1000;
ue_TimersAndConstants_t311 = 10000;
ue_TimersAndConstants_n310 = 20;
ue_TimersAndConstants_n311 = 1;
}
);
srb1_parameters :
{
# timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500]
timer_poll_retransmit = 80;
# timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200]
timer_reordering = 35;
# timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500]
timer_status_prohibit = 0;
# poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)]
poll_pdu = 4;
# poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)]
poll_byte = 99999;
# max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32]
max_retx_threshold = 4;
}
# ------- SCTP definitions
SCTP :
{
# Number of streams to use in input/output
SCTP_INSTREAMS = 2;
SCTP_OUTSTREAMS = 2;
};
////////// MME parameters:
mme_ip_address = ( {ipv4 = "192.168.12.170";
ipv6="192:168:30::17";
active="yes";
preference="ipv4";});
NETWORK_INTERFACES :
{
ENB_INTERFACE_NAME_FOR_S1_MME = "eth4";
ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.242/24";
ENB_INTERFACE_NAME_FOR_S1U = "eth4";
ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.242/24";
ENB_PORT_FOR_S1U = 2152; # Spec 2152
};
log_config :
{
global_log_level ="debug";
global_log_verbosity ="medium";
hw_log_level ="info";
hw_log_verbosity ="medium";
phy_log_level ="info";
phy_log_verbosity ="medium";
mac_log_level ="info";
mac_log_verbosity ="high";
rlc_log_level ="info";
rlc_log_verbosity ="medium";
pdcp_log_level ="info";
pdcp_log_verbosity ="medium";
rrc_log_level ="info";
rrc_log_verbosity ="medium";
};
}
);
......@@ -8,14 +8,14 @@ include $(OPENAIR_TARGETS)/Makefile.common
KERNEL_VERSION:=$(shell echo `uname -r | cut -d. -f-2`)
KERNEL_TYPE:=$(shell echo `uname -r | cut -d. -f-3 | cut -d- -f3`)
LOWLATENCY_KERNEL:=$(shell if [ $(KERNEL_TYPE) = "lowlatency" ]; then echo "1" ; else echo "0" ; fi)
DEADLINE_SCHEDULER_KERNEL:=$(shell if [ $(KERNEL_TYPE) = "lowlatency" ]; then echo "1" ; else echo "0" ; fi)
include $(OPENAIR2_DIR)/RRC/LITE/MESSAGES/Makefile.inc
ifdef EXMIMO
#ifdef LOWLATENCY # this ifdef is to be removed after the debugging
ifeq ($(LOWLATENCY_KERNEL),1)
CFLAGS+=-DLOWLATENCY
#ifdef DEADLINE_SCHEDULER # this ifdef is to be removed after the debugging
ifeq ($(DEADLINE_SCHEDULER_KERNEL),1)
CFLAGS+=-DDEADLINE_SCHEDULER
endif
#endif
endif
......@@ -431,7 +431,7 @@ show:
@echo IS_REL10 is $(IS_REL10)
@echo openssl $(OPENSSL_FOUND)
@echo nettle $(NETTLE_FOUND)
@echo lowlatency kernel: $(LOWLATENCY_KERNEL)
@echo lowlatency kernel: $(DEADLINE_SCHEDULER_KERNEL)
beautiful:
astyle --style=gnu -s2 $(SRC)
......
......@@ -254,7 +254,7 @@ void *rrh_eNB_thread(void *arg) {
pthread_mutex_init(&sync_trx_mutex,NULL);
/* create eNB module's TX/RX threads */
#ifdef LOWLATENCY
#ifdef DEADLINE_SCHEDULER
error_code_eNB_rx = pthread_create(&eNB_rx_thread, NULL, rrh_eNB_rx_thread, (void *)dev);
error_code_eNB_tx = pthread_create(&eNB_tx_thread, NULL, rrh_eNB_tx_thread, (void *)dev);
LOG_I(RRH,"[eNB][SCHED] deadline scheduling applied to eNB TX/RX threads\n");
......@@ -302,7 +302,7 @@ void *rrh_eNB_thread(void *arg) {
timerspec.it_interval.tv_nsec = rt_period%1000000000;
#ifdef LOWLATENCY
#ifdef DEADLINE_SCHEDULER
error_code_timer = pthread_create(&main_timer_proc_thread, NULL, timer_proc, (void *)&timerspec);
LOG_I(RRH,"[eNB][SCHED] deadline scheduling applied to timer thread \n");
#else
......@@ -368,7 +368,7 @@ void *rrh_eNB_rx_thread(void *arg) {
measurements = dev->measurements;
next_rx_pos = spp_eth;
#ifdef LOWLATENCY
#ifdef DEADLINE_SCHEDULER
struct sched_attr attr;
unsigned int flags = 0;
......@@ -560,7 +560,7 @@ void *rrh_eNB_tx_thread(void *arg) {
unsigned int subframe=0,frame=0;
unsigned int pck_tx=0;
#ifdef LOWLATENCY
#ifdef DEADLINE_SCHEDULER
struct sched_attr attr;
unsigned int flags = 0;
......
......@@ -127,7 +127,7 @@ extern volatile int start_UE;
#endif
extern volatile int oai_exit;
extern openair0_config_t openair0_cfg[MAX_CARDS];
extern openair0_config_t *openair0_cfg;
extern pthread_cond_t sync_cond;
extern pthread_mutex_t sync_mutex;
......@@ -307,8 +307,9 @@ static void* eNB_thread_rxtx( void* param ) {
MSC_START_USE();
#ifdef LOWLATENCY
#ifdef DEADLINE_SCHEDULER
struct sched_attr attr;
unsigned int flags = 0;
uint64_t runtime = 850000 ;
uint64_t deadline = 1 * 1000000 ; // each tx thread will finish within 1ms
......@@ -556,12 +557,11 @@ static void* eNB_thread_rxtx( void* param ) {
stop_meas( &softmodem_stats_rxtx_sf );
#ifdef LOWLATENCY
if (opp_enabled) {
if(softmodem_stats_rxtx_sf.diff_now/(cpuf) > attr.sched_runtime) {
#ifdef DEADLINE_SCHEDULER
if (opp_enabled){
if(softmodem_stats_rxtx_sf.diff_now/(cpuf) > attr.sched_runtime){
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_RUNTIME_TX_ENB, (softmodem_stats_rxtx_sf.diff_now/cpuf - attr.sched_runtime)/1000000.0);
}
}
#endif
print_meas_now(&softmodem_stats_rxtx_sf,"eNB_TX_SF",tx_time_file);
......@@ -623,7 +623,7 @@ static void* eNB_thread_rx_common( void* param ) {
MSC_START_USE();
#ifdef LOWLATENCY
#ifdef DEADLINE_SCHEDULER
struct sched_attr attr;
unsigned int flags = 0;
uint64_t runtime = 870000 ;
......@@ -711,7 +711,9 @@ static void* eNB_thread_rx_common( void* param ) {
"???",
sparam.sched_priority, cpu_affinity);
#endif // LOWLATENCY
#endif // DEADLINE_SCHEDULER
mlockall(MCL_CURRENT | MCL_FUTURE);
......@@ -797,15 +799,17 @@ static void* eNB_thread_rx_common( void* param ) {
break;
}
stop_meas( &softmodem_stats_rxtx_sf );
#ifdef LOWLATENCY
stop_meas( &softmodem_stats_rxtx_sf );
#ifdef DEADLINE_SCHEDULER
if (opp_enabled){
if(softmodem_stats_rxtx_sf.diff_now/(cpuf) > attr.sched_runtime){
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_RUNTIME_RXTX_ENB, (softmodem_stats_rxtx_sf.diff_now/cpuf - attr.sched_runtime)/1000000.0);
}
}
#endif // LOWLATENCY
#endif // DEADLINE_SCHEDULER
print_meas_now(&softmodem_stats_rx_sf,"eNB_RX_SF", rx_time_file);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_PROC_RXTX0+(proc->subframe_rx&1), 0 );
print_meas_now(&softmodem_stats_rx_sf,"eNB_RX_SF", rx_time_file);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_PROC_RXTX0+(proc->subframe_rx&1), 0 );
......@@ -835,7 +839,7 @@ static void* eNB_thread_prach( void* param ) {
MSC_START_USE();
#ifdef LOWLATENCY
#ifdef DEADLINE_SCHEDULER
struct sched_attr attr;
unsigned int flags = 0;
uint64_t runtime = 870000 ;
......@@ -923,7 +927,7 @@ static void* eNB_thread_prach( void* param ) {
"???",
sparam.sched_priority, cpu_affinity);
#endif // LOWLATENCY
#endif // DEADLINE_SCHEDULER
mlockall(MCL_CURRENT | MCL_FUTURE);
......@@ -990,7 +994,7 @@ void init_eNB_proc(void) {
proc = &eNB->proc;
proc_rxtx = proc->proc_rxtx;
#ifndef LOWLATENCY
#ifndef DEADLINE_SCHEDULER
/*
pthread_attr_init( &attr_eNB_proc_tx[CC_id][i] );
if (pthread_attr_setstacksize( &attr_eNB_proc_tx[CC_id][i], 64 *PTHREAD_STACK_MIN ) != 0)
......@@ -1031,7 +1035,7 @@ void init_eNB_proc(void) {
pthread_cond_init( &proc_rxtx[0].cond_rxtx, NULL);
pthread_cond_init( &proc_rxtx[1].cond_rxtx, NULL);
pthread_cond_init( &proc->cond_prach, NULL);
#ifndef LOWLATENCY
#ifndef DEADLINE_SCHEDULER
pthread_create( &proc_rxtx[0].pthread_rxtx, &proc_rxtx[0].attr_rxtx, eNB_thread_rxtx, &proc_rxtx[0] );
pthread_create( &proc_rxtx[1].pthread_rxtx, &proc_rxtx[1].attr_rxtx, eNB_thread_rxtx, &proc_rxtx[1] );
pthread_create( &proc->pthread_rx, &proc->attr_rx, eNB_thread_rx_common, &eNB->proc );
......@@ -1148,11 +1152,7 @@ int setup_eNB_buffers(PHY_VARS_eNB **phy_vars_eNB, openair0_config_t *openair0_c
int i, CC_id;
#ifndef EXMIMO
uint16_t N_TA_offset = 0;
#else
int j;
#endif
LTE_DL_FRAME_PARMS *frame_parms;
......@@ -1164,7 +1164,7 @@ int setup_eNB_buffers(PHY_VARS_eNB **phy_vars_eNB, openair0_config_t *openair0_c
printf("phy_vars_eNB[%d] not initialized\n", CC_id);
return(-1);
}
#ifndef EXMIMO
if (frame_parms->frame_type == TDD) {
if (frame_parms->N_RB_DL == 100)
N_TA_offset = 624;
......@@ -1173,8 +1173,8 @@ int setup_eNB_buffers(PHY_VARS_eNB **phy_vars_eNB, openair0_config_t *openair0_c
else if (frame_parms->N_RB_DL == 25)
N_TA_offset = 624/4;
}
#endif
/*
// replace RX signal buffers with mmaped HW versions
#ifdef EXMIMO
openair0_cfg[CC_id].tx_num_channels = 0;
......@@ -1225,6 +1225,8 @@ int setup_eNB_buffers(PHY_VARS_eNB **phy_vars_eNB, openair0_config_t *openair0_c
}
#else // not EXMIMO
*/
rxdata = (int32_t**)malloc16(frame_parms->nb_antennas_rx*sizeof(int32_t*));
txdata = (int32_t**)malloc16(frame_parms->nb_antennas_tx*sizeof(int32_t*));
......@@ -1243,7 +1245,7 @@ int setup_eNB_buffers(PHY_VARS_eNB **phy_vars_eNB, openair0_config_t *openair0_c
memset(txdata[i],0, openair0_cfg[rf_map[CC_id].card].samples_per_frame*sizeof(int32_t));
printf("txdata[%d] @ %p\n", i, phy_vars_eNB[CC_id]->common_vars.txdata[0][i]);
}
#endif
}
......
......@@ -147,7 +147,6 @@ int sync_var=-1; //!< protected by mutex \ref sync_mutex.
#ifdef XFORMS
static pthread_t forms_thread; //xforms
#endif
......@@ -635,11 +634,6 @@ void *l2l1_task(void *arg)
static void get_options (int argc, char **argv)
{
int c;
......@@ -1540,7 +1534,7 @@ int main( int argc, char **argv )
}
#ifndef LOWLATENCY
#ifndef DEADLINE_SCHEDULER
/* Currently we set affinity for UHD to CPU 0 for eNB/UE and only if number of CPUS >2 */
......@@ -1826,7 +1820,6 @@ int main( int argc, char **argv )
// start the main thread
if (UE_flag == 1) init_UE();
else init_eNB(node_function);
......
......@@ -100,6 +100,7 @@ extern pthread_cond_t sync_cond;
extern pthread_mutex_t sync_mutex;
extern int sync_var;
extern openair0_config_t openair0_cfg[MAX_CARDS];
extern uint32_t downlink_frequency[MAX_NUM_CCs][4];
extern int32_t uplink_frequency_offset[MAX_NUM_CCs][4];
......@@ -226,7 +227,7 @@ static void *UE_thread_synch(void *arg)
printf("UE_thread_sync in with PHY_vars_UE %p\n",arg);
printf("waiting for sync (UE_thread_synch) \n");
#ifndef LOWLATENCY
#ifndef DEADLINE_SCHEDULER
int policy, s, j;
struct sched_param sparam;
char cpu_affinity[1024];
......@@ -666,7 +667,8 @@ static void *UE_thread_tx(void *arg)
UE->instance_cnt_tx=-1;
#ifdef LOWLATENCY
#ifdef DEADLINE_SCHEDULER
struct sched_attr attr;
unsigned int flags = 0;
......@@ -873,7 +875,9 @@ static void *UE_thread_rx(void *arg)
UE->instance_cnt_rx=-1;
#ifdef LOWLATENCY
#ifdef DEADLINE_SCHEDULER
struct sched_attr attr;
unsigned int flags = 0;
......@@ -1179,7 +1183,8 @@ void *UE_thread(void *arg)
MessageDef *message_p;
#endif
#ifdef LOWLATENCY
#ifdef DEADLINE_SCHEDULER
struct sched_attr attr;
unsigned int flags = 0;
......@@ -1535,7 +1540,6 @@ void *UE_thread(void *arg)
/*!
* \brief Initialize the UE theads.
* Creates the UE threads:
......
......@@ -387,7 +387,7 @@ void *timer_proc(void *arg) {
struct itimerspec *old_value;
#ifdef LOWLATENCY
#ifdef DEADLINE_SCHEDULER
struct sched_attr attr;
unsigned int flags = 0;
......
......@@ -28,7 +28,7 @@
*******************************************************************************/
/*! \file rt_wrapper.h
* \brief provides a wrapper for the timing function, runtime calculations for real-time opeartions depending on weather RTAI or LOWLATENCY kernels are used or not
* \brief provides a wrapper for the timing function, runtime calculations for real-time opeartions depending on weather RTAI or DEADLINE_SCHEDULER kernels are used or not
* \author F. Kaltenberger and Navid Nikaein
* \date 2013
* \version 0.1
......@@ -241,7 +241,7 @@ double get_runtime_rx(int rx_subframe, uint16_t runtime_phy_rx[29][6], uint32_t
return runtime;
}
#ifdef LOWLATENCY
#ifdef DEADLINE_SCHEDULER
int sched_setattr(pid_t pid, const struct sched_attr *attr, unsigned int flags)
{
......
......@@ -72,7 +72,7 @@ double get_runtime_rx(int rx_subframe, uint16_t runtime_phy_rx[29][6], uint32_t
* see https://www.kernel.org/doc/Documentation/scheduler/sched-deadline.txt or
* http://www.blaess.fr/christophe/2014/04/05/utiliser-un-appel-systeme-inconnu-de-la-libc/
*/
#ifdef LOWLATENCY
#ifdef DEADLINE_SCHEDULER
#define gettid() syscall(__NR_gettid)
......
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