Commit c844f0aa authored by Xenofon Foukas's avatar Xenofon Foukas

Merge remote-tracking branch 'remotes/oai/develop' into develop

parents a022eaf6 83f4f69f
...@@ -171,6 +171,25 @@ Obj.# Case# Test# Description ...@@ -171,6 +171,25 @@ 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 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
......
...@@ -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)
......
...@@ -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,7 @@ function help() ...@@ -56,6 +56,7 @@ 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 " -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 +138,21 @@ function main() ...@@ -137,7 +138,21 @@ function main()
shift; shift;
exit 0 exit 0
;; ;;
-K | --itti-dump-file) -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,
......
...@@ -483,13 +483,10 @@ int lte_sync_time(int **rxdata, ///rx data in time domain ...@@ -483,13 +483,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],"\n[eNB PROC] PERFORMANCE PARAMETERS\n"); len += sprintf(&buffer[len],"\n[eNB PROC] PERFORMANCE PARAMETERS\n");
...@@ -644,7 +642,6 @@ int dump_eNB_stats(PHY_VARS_eNB *phy_vars_eNB, char* buffer, int length) ...@@ -644,7 +642,6 @@ int dump_eNB_stats(PHY_VARS_eNB *phy_vars_eNB, char* buffer, int length)
dB_fixed(phy_vars_eNB->eNB_UE_stats[UE_id].Po_PUCCH/phy_vars_eNB->lte_frame_parms.N_RB_UL)-phy_vars_eNB->rx_total_gain_eNB_dB, dB_fixed(phy_vars_eNB->eNB_UE_stats[UE_id].Po_PUCCH/phy_vars_eNB->lte_frame_parms.N_RB_UL)-phy_vars_eNB->rx_total_gain_eNB_dB,
phy_vars_eNB->lte_frame_parms.ul_power_control_config_common.p0_NominalPUCCH, phy_vars_eNB->lte_frame_parms.ul_power_control_config_common.p0_NominalPUCCH,
dB_fixed(phy_vars_eNB->eNB_UE_stats[UE_id].Po_PUCCH1_below/phy_vars_eNB->lte_frame_parms.N_RB_UL)-phy_vars_eNB->rx_total_gain_eNB_dB, dB_fixed(phy_vars_eNB->eNB_UE_stats[UE_id].Po_PUCCH1_below/phy_vars_eNB->lte_frame_parms.N_RB_UL)-phy_vars_eNB->rx_total_gain_eNB_dB,
dB_fixed(phy_vars_eNB->eNB_UE_stats[UE_id].Po_PUCCH1_above/phy_vars_eNB->lte_frame_parms.N_RB_UL)-phy_vars_eNB->rx_total_gain_eNB_dB,
PUCCH1_THRES+phy_vars_eNB->PHY_measurements_eNB[0].n0_power_tot_dBm-dB_fixed(phy_vars_eNB->lte_frame_parms.N_RB_UL), PUCCH1_THRES+phy_vars_eNB->PHY_measurements_eNB[0].n0_power_tot_dBm-dB_fixed(phy_vars_eNB->lte_frame_parms.N_RB_UL),
phy_vars_eNB->eNB_UE_stats[UE_id].sector); phy_vars_eNB->eNB_UE_stats[UE_id].sector);
......
/*******************************************************************************
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.
...@@ -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
...@@ -579,6 +582,9 @@ typedef struct { ...@@ -579,6 +582,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;
......
...@@ -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);
......
...@@ -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) +
......
...@@ -412,7 +412,7 @@ void calibrate_rf(openair0_device *device) { ...@@ -412,7 +412,7 @@ void calibrate_rf(openair0_device *device) {
bladerf_set_correction(brf->dev,BLADERF_MODULE_TX,BLADERF_CORR_LMS_DCOFF_I,offIold); bladerf_set_correction(brf->dev,BLADERF_MODULE_TX,BLADERF_CORR_LMS_DCOFF_I,offIold);
for (i=0;i<10;i++) { for (i=0;i<10;i++) {
trx_brf_read(device, &ptimestamp, (void **)&calib_buffp, RXDCLENGTH, 0); trx_brf_read(device, &ptimestamp, (void **)&calib_buffp, RXDCLENGTH, 0);
trx_brf_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0); trx_brf_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0, 0);
} }
for (meanIold=meanQold=i=j=0;i<RXDCLENGTH;i++) { for (meanIold=meanQold=i=j=0;i<RXDCLENGTH;i++) {
switch (i&3) { switch (i&3) {
...@@ -438,7 +438,7 @@ void calibrate_rf(openair0_device *device) { ...@@ -438,7 +438,7 @@ void calibrate_rf(openair0_device *device) {
bladerf_set_correction(brf->dev,BLADERF_MODULE_TX,BLADERF_CORR_LMS_DCOFF_I,offI); bladerf_set_correction(brf->dev,BLADERF_MODULE_TX,BLADERF_CORR_LMS_DCOFF_I,offI);
for (i=0;i<10;i++) { for (i=0;i<10;i++) {
trx_brf_read(device, &ptimestamp, (void **)&calib_buffp, RXDCLENGTH, 0); trx_brf_read(device, &ptimestamp, (void **)&calib_buffp, RXDCLENGTH, 0);
trx_brf_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0); trx_brf_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0, 0);
} }
for (meanI=meanQ=i=j=0;i<RXDCLENGTH;i++) { for (meanI=meanQ=i=j=0;i<RXDCLENGTH;i++) {
switch (i&3) { switch (i&3) {
...@@ -474,7 +474,7 @@ void calibrate_rf(openair0_device *device) { ...@@ -474,7 +474,7 @@ void calibrate_rf(openair0_device *device) {
for (i=0;i<10;i++) { for (i=0;i<10;i++) {
trx_brf_read(device, &ptimestamp, (void **)&calib_buffp, RXDCLENGTH, 0); trx_brf_read(device, &ptimestamp, (void **)&calib_buffp, RXDCLENGTH, 0);
trx_brf_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0); trx_brf_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0, 0);
} }
for (meanI=meanQ=i=j=0;i<RXDCLENGTH;i++) { for (meanI=meanQ=i=j=0;i<RXDCLENGTH;i++) {
switch (i&3) { switch (i&3) {
...@@ -503,7 +503,7 @@ void calibrate_rf(openair0_device *device) { ...@@ -503,7 +503,7 @@ void calibrate_rf(openair0_device *device) {
bladerf_set_correction(brf->dev,BLADERF_MODULE_TX,BLADERF_CORR_LMS_DCOFF_Q,offQold); bladerf_set_correction(brf->dev,BLADERF_MODULE_TX,BLADERF_CORR_LMS_DCOFF_Q,offQold);
for (i=0;i<10;i++) { for (i=0;i<10;i++) {
trx_brf_read(device, &ptimestamp, (void **)&calib_buffp, RXDCLENGTH, 0); trx_brf_read(device, &ptimestamp, (void **)&calib_buffp, RXDCLENGTH, 0);
trx_brf_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0); trx_brf_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0, 0);
} }
// project on fs/4 // project on fs/4
for (meanIold=meanQold=i=j=0;i<RXDCLENGTH;i++) { for (meanIold=meanQold=i=j=0;i<RXDCLENGTH;i++) {
...@@ -530,7 +530,7 @@ void calibrate_rf(openair0_device *device) { ...@@ -530,7 +530,7 @@ void calibrate_rf(openair0_device *device) {
bladerf_set_correction(brf->dev,BLADERF_MODULE_TX,BLADERF_CORR_LMS_DCOFF_Q,offQ); bladerf_set_correction(brf->dev,BLADERF_MODULE_TX,BLADERF_CORR_LMS_DCOFF_Q,offQ);
for (i=0;i<10;i++) { for (i=0;i<10;i++) {
trx_brf_read(device, &ptimestamp, (void **)&calib_buffp, RXDCLENGTH, 0); trx_brf_read(device, &ptimestamp, (void **)&calib_buffp, RXDCLENGTH, 0);
trx_brf_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0); trx_brf_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0, 0);
} }
for (meanI=meanQ=i=j=0;i<RXDCLENGTH;i++) { for (meanI=meanQ=i=j=0;i<RXDCLENGTH;i++) {
switch (i&3) { switch (i&3) {
...@@ -568,7 +568,7 @@ void calibrate_rf(openair0_device *device) { ...@@ -568,7 +568,7 @@ void calibrate_rf(openair0_device *device) {
for (i=0;i<10;i++) { for (i=0;i<10;i++) {
trx_brf_read(device, &ptimestamp, (void **)&calib_buffp, RXDCLENGTH, 0); trx_brf_read(device, &ptimestamp, (void **)&calib_buffp, RXDCLENGTH, 0);
trx_brf_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0); trx_brf_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0, 0);
} }
for (meanI=meanQ=i=j=0;i<RXDCLENGTH;i++) { for (meanI=meanQ=i=j=0;i<RXDCLENGTH;i++) {
switch (i&3) { switch (i&3) {
...@@ -601,7 +601,7 @@ void calibrate_rf(openair0_device *device) { ...@@ -601,7 +601,7 @@ void calibrate_rf(openair0_device *device) {
bladerf_set_correction(brf->dev,BLADERF_MODULE_TX,BLADERF_CORR_FPGA_PHASE,offphaseold); bladerf_set_correction(brf->dev,BLADERF_MODULE_TX,BLADERF_CORR_FPGA_PHASE,offphaseold);
for (i=0;i<10;i++) { for (i=0;i<10;i++) {
trx_brf_read(device, &ptimestamp, (void **)&calib_buffp, RXDCLENGTH, 0); trx_brf_read(device, &ptimestamp, (void **)&calib_buffp, RXDCLENGTH, 0);
trx_brf_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0); trx_brf_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0, 0);
} }
// project on fs/8 (Image of TX signal in +ve frequencies) // project on fs/8 (Image of TX signal in +ve frequencies)
for (meanIold=meanQold=i=j=0;i<RXDCLENGTH;i++) { for (meanIold=meanQold=i=j=0;i<RXDCLENGTH;i++) {
...@@ -618,7 +618,7 @@ void calibrate_rf(openair0_device *device) { ...@@ -618,7 +618,7 @@ void calibrate_rf(openair0_device *device) {
bladerf_set_correction(brf->dev,BLADERF_MODULE_TX,BLADERF_CORR_FPGA_PHASE,offphase); bladerf_set_correction(brf->dev,BLADERF_MODULE_TX,BLADERF_CORR_FPGA_PHASE,offphase);
for (i=0;i<10;i++) { for (i=0;i<10;i++) {
trx_brf_read(device, &ptimestamp, (void **)&calib_buffp, RXDCLENGTH, 0); trx_brf_read(device, &ptimestamp, (void **)&calib_buffp, RXDCLENGTH, 0);
trx_brf_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0); trx_brf_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0, 0);
} }
// project on fs/8 (Image of TX signal in +ve frequencies) // project on fs/8 (Image of TX signal in +ve frequencies)
for (meanI=meanQ=i=j=0;i<RXDCLENGTH;i++) { for (meanI=meanQ=i=j=0;i<RXDCLENGTH;i++) {
...@@ -648,7 +648,7 @@ void calibrate_rf(openair0_device *device) { ...@@ -648,7 +648,7 @@ void calibrate_rf(openair0_device *device) {
for (i=0;i<10;i++) { for (i=0;i<10;i++) {
trx_brf_read(device, &ptimestamp, (void **)&calib_buffp, RXDCLENGTH, 0); trx_brf_read(device, &ptimestamp, (void **)&calib_buffp, RXDCLENGTH, 0);
trx_brf_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0); trx_brf_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0, 0);
} }
// project on fs/8 (Image of TX signal in +ve frequencies) // project on fs/8 (Image of TX signal in +ve frequencies)
for (meanI=meanQ=i=j=0;i<RXDCLENGTH;i++) { for (meanI=meanQ=i=j=0;i<RXDCLENGTH;i++) {
...@@ -670,7 +670,7 @@ void calibrate_rf(openair0_device *device) { ...@@ -670,7 +670,7 @@ void calibrate_rf(openair0_device *device) {
bladerf_set_correction(brf->dev,BLADERF_MODULE_TX,BLADERF_CORR_FPGA_GAIN,offgainold); bladerf_set_correction(brf->dev,BLADERF_MODULE_TX,BLADERF_CORR_FPGA_GAIN,offgainold);
for (i=0;i<10;i++) { for (i=0;i<10;i++) {
trx_brf_read(device, &ptimestamp, (void **)&calib_buffp, RXDCLENGTH, 0); trx_brf_read(device, &ptimestamp, (void **)&calib_buffp, RXDCLENGTH, 0);
trx_brf_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0); trx_brf_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0, 0);
} }
// project on fs/8 (Image of TX signal in +ve frequencies) // project on fs/8 (Image of TX signal in +ve frequencies)
for (meanIold=meanQold=i=j=0;i<RXDCLENGTH;i++) { for (meanIold=meanQold=i=j=0;i<RXDCLENGTH;i++) {
...@@ -687,7 +687,7 @@ void calibrate_rf(openair0_device *device) { ...@@ -687,7 +687,7 @@ void calibrate_rf(openair0_device *device) {
bladerf_set_correction(brf->dev,BLADERF_MODULE_TX,BLADERF_CORR_FPGA_GAIN,offgain); bladerf_set_correction(brf->dev,BLADERF_MODULE_TX,BLADERF_CORR_FPGA_GAIN,offgain);
for (i=0;i<10;i++) { for (i=0;i<10;i++) {
trx_brf_read(device, &ptimestamp, (void **)&calib_buffp, RXDCLENGTH, 0); trx_brf_read(device, &ptimestamp, (void **)&calib_buffp, RXDCLENGTH, 0);
trx_brf_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0); trx_brf_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0, 0);
} }
// project on fs/8 (Image of TX signal in +ve frequencies) // project on fs/8 (Image of TX signal in +ve frequencies)
for (meanI=meanQ=i=j=0;i<RXDCLENGTH;i++) { for (meanI=meanQ=i=j=0;i<RXDCLENGTH;i++) {
...@@ -716,7 +716,7 @@ void calibrate_rf(openair0_device *device) { ...@@ -716,7 +716,7 @@ void calibrate_rf(openair0_device *device) {
for (i=0;i<10;i++) { for (i=0;i<10;i++) {
trx_brf_read(device, &ptimestamp, (void **)&calib_buffp, RXDCLENGTH, 0); trx_brf_read(device, &ptimestamp, (void **)&calib_buffp, RXDCLENGTH, 0);
trx_brf_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0); trx_brf_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0, 0);
} }
// project on fs/8 (Image of TX signal in +ve frequencies) // project on fs/8 (Image of TX signal in +ve frequencies)
for (meanI=meanQ=i=j=0;i<RXDCLENGTH;i++) { for (meanI=meanQ=i=j=0;i<RXDCLENGTH;i++) {
...@@ -741,7 +741,7 @@ void calibrate_rf(openair0_device *device) { ...@@ -741,7 +741,7 @@ void calibrate_rf(openair0_device *device) {
bladerf_set_correction(brf->dev,BLADERF_MODULE_RX,BLADERF_CORR_FPGA_PHASE,offphaseold); bladerf_set_correction(brf->dev,BLADERF_MODULE_RX,BLADERF_CORR_FPGA_PHASE,offphaseold);
for (i=0;i<10;i++) { for (i=0;i<10;i++) {
trx_brf_read(device, &ptimestamp, (void **)&calib_buffp, RXDCLENGTH, 0); trx_brf_read(device, &ptimestamp, (void **)&calib_buffp, RXDCLENGTH, 0);
trx_brf_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0); trx_brf_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0, 0);
} }
// project on -3fs/8 (Image of TX signal in -ve frequencies) // project on -3fs/8 (Image of TX signal in -ve frequencies)
for (meanIold=meanQold=i=j=0;i<RXDCLENGTH;i++) { for (meanIold=meanQold=i=j=0;i<RXDCLENGTH;i++) {
...@@ -758,7 +758,7 @@ void calibrate_rf(openair0_device *device) { ...@@ -758,7 +758,7 @@ void calibrate_rf(openair0_device *device) {
bladerf_set_correction(brf->dev,BLADERF_MODULE_RX,BLADERF_CORR_FPGA_PHASE,offphase); bladerf_set_correction(brf->dev,BLADERF_MODULE_RX,BLADERF_CORR_FPGA_PHASE,offphase);
for (i=0;i<10;i++) { for (i=0;i<10;i++) {
trx_brf_read(device, &ptimestamp, (void **)&calib_buffp, RXDCLENGTH, 0); trx_brf_read(device, &ptimestamp, (void **)&calib_buffp, RXDCLENGTH, 0);
trx_brf_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0); trx_brf_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0, 0);
} }
// project on -3fs/8 (Image of TX signal in -ve frequencies) // project on -3fs/8 (Image of TX signal in -ve frequencies)
for (meanI=meanQ=i=j=0;i<RXDCLENGTH;i++) { for (meanI=meanQ=i=j=0;i<RXDCLENGTH;i++) {
...@@ -788,7 +788,7 @@ void calibrate_rf(openair0_device *device) { ...@@ -788,7 +788,7 @@ void calibrate_rf(openair0_device *device) {
for (i=0;i<10;i++) { for (i=0;i<10;i++) {
trx_brf_read(device, &ptimestamp, (void **)&calib_buffp, RXDCLENGTH, 0); trx_brf_read(device, &ptimestamp, (void **)&calib_buffp, RXDCLENGTH, 0);
trx_brf_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0); trx_brf_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0, 0);
} }
// project on -3fs/8 (Image of TX signal in -ve frequencies) // project on -3fs/8 (Image of TX signal in -ve frequencies)
for (meanI=meanQ=i=j=0;i<RXDCLENGTH;i++) { for (meanI=meanQ=i=j=0;i<RXDCLENGTH;i++) {
...@@ -810,7 +810,7 @@ void calibrate_rf(openair0_device *device) { ...@@ -810,7 +810,7 @@ void calibrate_rf(openair0_device *device) {
bladerf_set_correction(brf->dev,BLADERF_MODULE_RX,BLADERF_CORR_FPGA_GAIN,offgainold); bladerf_set_correction(brf->dev,BLADERF_MODULE_RX,BLADERF_CORR_FPGA_GAIN,offgainold);
for (i=0;i<10;i++) { for (i=0;i<10;i++) {
trx_brf_read(device, &ptimestamp, (void **)&calib_buffp, RXDCLENGTH, 0); trx_brf_read(device, &ptimestamp, (void **)&calib_buffp, RXDCLENGTH, 0);
trx_brf_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0); trx_brf_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0,0);
} }
// project on -3fs/8 (Image of TX signal in +ve frequencies) // project on -3fs/8 (Image of TX signal in +ve frequencies)
for (meanIold=meanQold=i=j=0;i<RXDCLENGTH;i++) { for (meanIold=meanQold=i=j=0;i<RXDCLENGTH;i++) {
...@@ -827,7 +827,7 @@ void calibrate_rf(openair0_device *device) { ...@@ -827,7 +827,7 @@ void calibrate_rf(openair0_device *device) {
bladerf_set_correction(brf->dev,BLADERF_MODULE_RX,BLADERF_CORR_FPGA_GAIN,offgain); bladerf_set_correction(brf->dev,BLADERF_MODULE_RX,BLADERF_CORR_FPGA_GAIN,offgain);
for (i=0;i<10;i++) { for (i=0;i<10;i++) {
trx_brf_read(device, &ptimestamp, (void **)&calib_buffp, RXDCLENGTH, 0); trx_brf_read(device, &ptimestamp, (void **)&calib_buffp, RXDCLENGTH, 0);
trx_brf_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0); trx_brf_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0, 0);
} }
// project on 3fs/8 (Image of TX signal in -ve frequencies) // project on 3fs/8 (Image of TX signal in -ve frequencies)
for (meanI=meanQ=i=j=0;i<RXDCLENGTH;i++) { for (meanI=meanQ=i=j=0;i<RXDCLENGTH;i++) {
...@@ -856,7 +856,7 @@ void calibrate_rf(openair0_device *device) { ...@@ -856,7 +856,7 @@ void calibrate_rf(openair0_device *device) {
for (i=0;i<10;i++) { for (i=0;i<10;i++) {
trx_brf_read(device, &ptimestamp, (void **)&calib_buffp, RXDCLENGTH, 0); trx_brf_read(device, &ptimestamp, (void **)&calib_buffp, RXDCLENGTH, 0);
trx_brf_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0); trx_brf_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0, 0);
} }
// project on -3fs/8 (Image of TX signal in -ve frequencies) // project on -3fs/8 (Image of TX signal in -ve frequencies)
for (meanI=meanQ=i=j=0;i<RXDCLENGTH;i++) { for (meanI=meanQ=i=j=0;i<RXDCLENGTH;i++) {
...@@ -1068,7 +1068,6 @@ int device_init(openair0_device *device, openair0_config_t *openair0_cfg) { ...@@ -1068,7 +1068,6 @@ int device_init(openair0_device *device, openair0_config_t *openair0_cfg) {
bladerf_log_set_verbosity(get_brf_log_level(openair0_cfg->log_level)); bladerf_log_set_verbosity(get_brf_log_level(openair0_cfg->log_level));
printf("BLADERF: Initializing openair0_device\n"); printf("BLADERF: Initializing openair0_device\n");
device->priv = brf;
device->Mod_id = num_devices++; device->Mod_id = num_devices++;
device->type = BLADERF_DEV; device->type = BLADERF_DEV;
device->trx_start_func = trx_brf_start; device->trx_start_func = trx_brf_start;
......
...@@ -17,7 +17,7 @@ eNBs = ...@@ -17,7 +17,7 @@ eNBs =
mobile_country_code = "208"; mobile_country_code = "208";
mobile_network_code = "95"; mobile_network_code = "93";
////////// Physical parameters: ////////// Physical parameters:
...@@ -133,7 +133,7 @@ eNBs = ...@@ -133,7 +133,7 @@ eNBs =
////////// MME parameters: ////////// MME parameters:
mme_ip_address = ( { ipv4 = "192.168.12.62"; mme_ip_address = ( { ipv4 = "192.168.12.11";
ipv6 = "192:168:30::17"; ipv6 = "192:168:30::17";
active = "yes"; active = "yes";
preference = "ipv4"; preference = "ipv4";
...@@ -142,11 +142,11 @@ eNBs = ...@@ -142,11 +142,11 @@ eNBs =
NETWORK_INTERFACES : NETWORK_INTERFACES :
{ {
ENB_INTERFACE_NAME_FOR_S1_MME = "eth4"; ENB_INTERFACE_NAME_FOR_S1_MME = "eth0";
ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.242/24"; ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.212/24";
ENB_INTERFACE_NAME_FOR_S1U = "eth4"; ENB_INTERFACE_NAME_FOR_S1U = "eth0";
ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.242/24"; ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.212/24";
ENB_PORT_FOR_S1U = 2152; # Spec 2152 ENB_PORT_FOR_S1U = 2152; # Spec 2152
}; };
......
...@@ -17,7 +17,7 @@ eNBs = ...@@ -17,7 +17,7 @@ eNBs =
mobile_country_code = "208"; mobile_country_code = "208";
mobile_network_code = "95"; mobile_network_code = "93";
////////// Physical parameters: ////////// Physical parameters:
...@@ -133,7 +133,7 @@ eNBs = ...@@ -133,7 +133,7 @@ eNBs =
////////// MME parameters: ////////// MME parameters:
mme_ip_address = ( { ipv4 = "192.168.12.62"; mme_ip_address = ( { ipv4 = "192.168.12.11";
ipv6 = "192:168:30::17"; ipv6 = "192:168:30::17";
active = "yes"; active = "yes";
preference = "ipv4"; preference = "ipv4";
...@@ -142,11 +142,11 @@ eNBs = ...@@ -142,11 +142,11 @@ eNBs =
NETWORK_INTERFACES : NETWORK_INTERFACES :
{ {
ENB_INTERFACE_NAME_FOR_S1_MME = "eth4"; ENB_INTERFACE_NAME_FOR_S1_MME = "eth0";
ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.242/24"; ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.212/24";
ENB_INTERFACE_NAME_FOR_S1U = "eth4"; ENB_INTERFACE_NAME_FOR_S1U = "eth0";
ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.242/24"; ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.212/24";
ENB_PORT_FOR_S1U = 2152; # Spec 2152 ENB_PORT_FOR_S1U = 2152; # Spec 2152
}; };
......
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 = "10";
////////// Physical parameters:
component_carriers = (
{
frame_type = "TDD";
tdd_config = 3;
tdd_config_s = 0;
prefix_type = "NORMAL";
eutra_band = 38;
downlink_frequency = 2580000000L;
uplink_frequency_offset = 0;
Nid_cell = 0;
N_RB_DL = 25;
Nid_cell_mbsfn = 0;
nb_antennas_tx = 1;
nb_antennas_rx = 1;
tx_gain = 25;
rx_gain = 20;
prach_root = 0;
prach_config_index = 0;
prach_high_speed = "DISABLE";
prach_zero_correlation = 1;
prach_freq_offset = 2;
pucch_delta_shift = 1;
pucch_nRB_CQI = 1;
pucch_nCS_AN = 0;
pucch_n1_AN = 32;
pdsch_referenceSignalPower = 0;
pdsch_p_b = 0;
pusch_n_SB = 1;
pusch_enable64QAM = "DISABLE";
pusch_hoppingMode = "interSubFrame";
pusch_hoppingOffset = 0;
pusch_groupHoppingEnabled = "ENABLE";
pusch_groupAssignment = 0;
pusch_sequenceHoppingEnabled = "DISABLE";
pusch_nDMRS1 = 0;
phich_duration = "NORMAL";
phich_resource = "ONESIXTH";
srs_enable = "DISABLE";
/* srs_BandwidthConfig =;
srs_SubframeConfig =;
srs_ackNackST =;
srs_MaxUpPts =;*/
pusch_p0_Nominal = -108;
pusch_alpha = "AL1";
pucch_p0_Nominal = -108;
msg3_delta_Preamble = 6;
pucch_deltaF_Format1 = "deltaF2";
pucch_deltaF_Format1b = "deltaF3";
pucch_deltaF_Format2 = "deltaF0";
pucch_deltaF_Format2a = "deltaF0";
pucch_deltaF_Format2b = "deltaF0";
rach_numberOfRA_Preambles = 64;
rach_preamblesGroupAConfig = "DISABLE";
/*
rach_sizeOfRA_PreamblesGroupA = ;
rach_messageSizeGroupA = ;
rach_messagePowerOffsetGroupB = ;
*/
rach_powerRampingStep = 2;
rach_preambleInitialReceivedTargetPower = -100;
rach_preambleTransMax = 10;
rach_raResponseWindowSize = 10;
rach_macContentionResolutionTimer = 48;
rach_maxHARQ_Msg3Tx = 4;
pcch_default_PagingCycle = 128;
pcch_nB = "oneT";
bcch_modificationPeriodCoeff = 2;
ue_TimersAndConstants_t300 = 1000;
ue_TimersAndConstants_t301 = 1000;
ue_TimersAndConstants_t310 = 1000;
ue_TimersAndConstants_t311 = 10000;
ue_TimersAndConstants_n310 = 20;
ue_TimersAndConstants_n311 = 1;
}
);
////////// MME parameters:
mme_ip_address = ( { ipv4 = "0.0.0.0";
ipv6 = "0::0";
active = "yes";
preference = "ipv4";
}
);
NETWORK_INTERFACES :
{
ENB_INTERFACE_NAME_FOR_S1_MME = "none";
ENB_IPV4_ADDRESS_FOR_S1_MME = "0.0.0.0/24";
ENB_INTERFACE_NAME_FOR_S1U = "none";
ENB_IPV4_ADDRESS_FOR_S1U = "0.0.0.0/24";
ENB_PORT_FOR_S1U = 2153; # Spec 2152
};
log_config :
{
global_log_level ="trace";
global_log_verbosity ="medium";
hw_log_level ="info";
hw_log_verbosity ="medium";
phy_log_level ="trace";
phy_log_verbosity ="medium";
mac_log_level ="trace";
mac_log_verbosity ="medium";
rlc_log_level ="trace";
rlc_log_verbosity ="medium";
pdcp_log_level ="trace";
pdcp_log_verbosity ="medium";
rrc_log_level ="trace";
rrc_log_verbosity ="medium";
gtpu_log_level ="debug";
gtpu_log_verbosity ="medium";
udp_log_level ="debug";
udp_log_verbosity ="medium";
osa_log_level ="debug";
osa_log_verbosity ="low";
};
}
);
...@@ -150,7 +150,7 @@ rrh_gw_config = ( ...@@ -150,7 +150,7 @@ rrh_gw_config = (
rrh_gw_active = "yes"; rrh_gw_active = "yes";
tr_preference = "raw"; tr_preference = "raw";
rf_preference = "usrp_b200"; rf_preference = "usrp_b200";
iq_txshift = 5; iq_txshift = 4;
tx_sample_advance = 113; tx_sample_advance = 113;
tx_scheduling_advance = 9; tx_scheduling_advance = 9;
...@@ -163,8 +163,6 @@ rrh_gw_config = ( ...@@ -163,8 +163,6 @@ rrh_gw_config = (
ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.111/24"; ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.111/24";
ENB_INTERFACE_NAME_FOR_S1U = "eth4"; ENB_INTERFACE_NAME_FOR_S1U = "eth4";
ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.111/24"; ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.111/24";
ENB_PORT_FOR_S1U = 2152; # Spec 2152 ENB_PORT_FOR_S1U = 2152; # Spec 2152
}; };
......
...@@ -133,7 +133,7 @@ eNBs = ...@@ -133,7 +133,7 @@ eNBs =
////////// MME parameters: ////////// MME parameters:
mme_ip_address = ( { ipv4 = "192.168.12.26"; mme_ip_address = ( { ipv4 = "192.168.12.170";
ipv6 = "192:168:30::17"; ipv6 = "192:168:30::17";
active = "yes"; active = "yes";
preference = "ipv4"; preference = "ipv4";
...@@ -145,14 +145,14 @@ rrh_gw_config = ( ...@@ -145,14 +145,14 @@ rrh_gw_config = (
local_if_name = "eth0"; local_if_name = "eth0";
#remote_address = "169.254.10.158"; #remote_address = "169.254.10.158";
#local_address = "169.254.8.15"; #local_address = "169.254.8.15";
remote_address = "74:d4:35:cc:88:45"; remote_address = "74:d4:35:cc:88:e3";
local_address = "98:90:96:df:66:07"; local_address = "74:d4:35:cc:88:d1";
local_port = 50000; #for raw option local port must be the same to remote local_port = 50000; #for raw option local port must be the same to remote
remote_port = 50000; remote_port = 50000;
rrh_gw_active = "yes"; rrh_gw_active = "yes";
tr_preference = "raw"; tr_preference = "raw";
rf_preference = "usrp_b200"; rf_preference = "usrp_b200";
iq_txshift = 5; iq_txshift = 4;
tx_sample_advance = 70; tx_sample_advance = 70;
tx_scheduling_advance = 9; tx_scheduling_advance = 9;
...@@ -162,12 +162,11 @@ rrh_gw_config = ( ...@@ -162,12 +162,11 @@ rrh_gw_config = (
NETWORK_INTERFACES : NETWORK_INTERFACES :
{ {
ENB_INTERFACE_NAME_FOR_S1_MME = "eth4"; ENB_INTERFACE_NAME_FOR_S1_MME = "eth4";
ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.111/24"; ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.240/24";
ENB_INTERFACE_NAME_FOR_S1U = "eth4"; ENB_INTERFACE_NAME_FOR_S1U = "eth4";
ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.240/24";
ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.111/24";
ENB_PORT_FOR_S1U = 2152; # Spec 2152 ENB_PORT_FOR_S1U = 2152; # Spec 2152
}; };
......
This diff is collapsed.
/******************************************************************************
*
* Copyright(c) EURECOM / Thales Communications & Security
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of version 2 of the GNU General Public License as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
*
* The full GNU General Public License is included in this distribution in the
* file called LICENSE.
*
* Contact Information:
* Thales Communications & Security <philippe.agostini@thalesgroup.com>
*
*****************************************************************************/
/******************************************************************************
*
* Includes
*
*****************************************************************************/
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include "ieee80211p-netlinkapi.h"
#include "phy/DOT11/defs.h"
#include "PHY/TOOLS/defs.h"
#include <stdint.h>
#include <string.h>
#include <pthread.h>
#include <rtai_lxrt.h>
#include <rtai_sem.h>
#include <rtai_msg.h>
/******************************************************************************
*
* Definitions
*
*****************************************************************************/
enum nl80211_band {
NL80211_BAND_2GHZ,
NL80211_BAND_5GHZ,
NL80211_BAND_5_9GHZ,
NL80211_BAND_0_8GHZ,
};
enum ieee80211_band {
IEEE80211_BAND_2GHZ = NL80211_BAND_2GHZ,
IEEE80211_BAND_5GHZ = NL80211_BAND_5GHZ,
IEEE80211_BAND_5_9GHZ = NL80211_BAND_5_9GHZ,
IEEE80211_BAND_0_8GHZ = NL80211_BAND_0_8GHZ,
};
struct ieee80211p_rx_status {
short data_len; //frame data length in bytes
char rssi; //received power in dBm
char rate; //reveived data rate in units of 100 kbps
enum ieee80211_band band;
char flags; //RX flags
}; /* struct ieee80211p_rx_status */
extern uint32_t *txdata[2],*rxdata[2];
//CHANNEL_STATUS_t dot11_state = IDLE;
extern int oai_exit;
extern unsigned int *DAQ_MBOX;
extern int Ndbps[8];
extern int32_t rxDATA_F_comp_aggreg2[48*1024];
extern int32_t rxDATA_F_comp_aggreg3[48*1024];
extern uint32_t rxgain[4];
extern uint32_t rxg_max[4], rxg_med[4], rxg_byp[4];
#define FRAME_LENGTH_SAMPLES 76800
#define RX_THRES 60
#define SLOT_DURATION_5MHz 105
#define RX_THRES_dB 40
int tx_sdu_active = 0;
int tx_sdu_length = 0;
char rxsdu[2000];
void *tx_thread(void *arg)
{
int fd=*((int*)arg);
RT_TASK *task;
int ret;
int i;
char dummy_data[10];
if (fd > 0) {
ret = netlink_send(fd,NLCMD_INIT,10,&dummy_data[0]);
printf("tx_thread starting, fd %d\n",fd);
task = rt_task_init_schmod(nam2num("TASK1"), 0, 0, 0, SCHED_FIFO, 0xF);
mlockall(MCL_CURRENT | MCL_FUTURE);
// rt_make_hard_real_time();
while (!oai_exit) {
if (tx_sdu_active == 1)
printf("tx_thread: waiting (MBOX %d)\n",((unsigned int*)DAQ_MBOX)[0]);
while(((volatile int)tx_sdu_active) != 0) {
rt_sleep(nano2count(66666));
}
printf("tx_thread: calling netlink\n");
ret = netlink_recv(fd,rxsdu);
tx_sdu_active = 1;
tx_sdu_length = ret;
/*
if (ret > 0) {
printf("received TX SDU: ");
for (i=0;i<ret;i++) {
printf("%02hhx ",rxsdu[i]);
}
printf("\n");
}
*/
}
} else {
printf("tx_thread: no netlink\n");
}
printf("tx_thread exiting\n");
return(0);
}
/******************************************************************************
*
* Main
*
*****************************************************************************/
/*
int dot11_netlink_init() {
int fd;
int ret;
int i;
char txdata[10];
fd = netlink_init();
if (fd < 0) {
return -1;
}
ret = netlink_send(fd,NLCMD_INIT,10,&txdata[0]);
return(fd);
}
*/
This diff is collapsed.
...@@ -925,9 +925,7 @@ static void *UE_thread_rx(void *arg) ...@@ -925,9 +925,7 @@ static void *UE_thread_rx(void *arg)
phy_procedures_UE_RX( UE, 0, 0, UE->mode, no_relay, NULL ); phy_procedures_UE_RX( UE, 0, 0, UE->mode, no_relay, NULL );
} }
#ifdef OPENAIR2 if ((UE->mac_enabled==1) && (i==0)) {
if (i==0) {
ret = mac_xface->ue_scheduler(UE->Mod_id, ret = mac_xface->ue_scheduler(UE->Mod_id,
UE->frame_tx, UE->frame_tx,
UE->slot_rx>>1, UE->slot_rx>>1,
...@@ -950,7 +948,6 @@ static void *UE_thread_rx(void *arg) ...@@ -950,7 +948,6 @@ static void *UE_thread_rx(void *arg)
} }
} }
#endif
UE->slot_rx++; UE->slot_rx++;
if (UE->slot_rx == 20) { if (UE->slot_rx == 20) {
......
...@@ -169,8 +169,6 @@ void do_DL_sig(double **r_re0,double **r_im0, ...@@ -169,8 +169,6 @@ void do_DL_sig(double **r_re0,double **r_im0,
int32_t **dl_channel_est = PHY_vars_UE_g[UE_id][CC_id]->lte_ue_common_vars.dl_ch_estimates[0]; int32_t **dl_channel_est = PHY_vars_UE_g[UE_id][CC_id]->lte_ue_common_vars.dl_ch_estimates[0];
// double scale = pow(10.0,(enb_data[att_eNB_id]->tx_power_dBm + eNB2UE[att_eNB_id][UE_id]->path_loss_dB + (double) PHY_vars_UE_g[UE_id]->rx_total_gain_dB)/20.0); // double scale = pow(10.0,(enb_data[att_eNB_id]->tx_power_dBm + eNB2UE[att_eNB_id][UE_id]->path_loss_dB + (double) PHY_vars_UE_g[UE_id]->rx_total_gain_dB)/20.0);
double scale = pow(10.0,(frame_parms->pdsch_config_common.referenceSignalPower+eNB2UE[att_eNB_id][UE_id][CC_id]->path_loss_dB + (double) PHY_vars_UE_g[UE_id][CC_id]->rx_total_gain_dB)/20.0); double scale = pow(10.0,(frame_parms->pdsch_config_common.referenceSignalPower+eNB2UE[att_eNB_id][UE_id][CC_id]->path_loss_dB + (double) PHY_vars_UE_g[UE_id][CC_id]->rx_total_gain_dB)/20.0);
//this factor is not really needed (it was actually wrong in the non abstraction mode)
//scale = scale * sqrt(512.0/300.0); //TODO: make this variable for all BWs
LOG_D(OCM,"scale =%lf (%d dB)\n",scale,(int) (20*log10(scale))); LOG_D(OCM,"scale =%lf (%d dB)\n",scale,(int) (20*log10(scale)));
// freq_channel(desc1,frame_parms->N_RB_DL,nb_samples); // freq_channel(desc1,frame_parms->N_RB_DL,nb_samples);
//write_output("channel.m","ch",desc1->ch[0],desc1->channel_length,1,8); //write_output("channel.m","ch",desc1->ch[0],desc1->channel_length,1,8);
...@@ -204,12 +202,13 @@ void do_DL_sig(double **r_re0,double **r_im0, ...@@ -204,12 +202,13 @@ void do_DL_sig(double **r_re0,double **r_im0,
// calculate the SNR for the attached eNB (this assumes eNB always uses PMI stored in eNB_UE_stats; to be improved) // calculate the SNR for the attached eNB (this assumes eNB always uses PMI stored in eNB_UE_stats; to be improved)
init_snr(eNB2UE[att_eNB_id][UE_id][CC_id], enb_data[att_eNB_id], ue_data[UE_id], PHY_vars_UE_g[UE_id][CC_id]->sinr_dB, &PHY_vars_UE_g[UE_id][CC_id]->N0, init_snr(eNB2UE[att_eNB_id][UE_id][CC_id], enb_data[att_eNB_id], ue_data[UE_id], PHY_vars_UE_g[UE_id][CC_id]->sinr_dB, &PHY_vars_UE_g[UE_id][CC_id]->N0,
PHY_vars_UE_g[UE_id][CC_id]->transmission_mode[att_eNB_id], PHY_vars_eNB_g[att_eNB_id][CC_id]->eNB_UE_stats[UE_id].DL_pmi_single,PHY_vars_eNB_g[att_eNB_id][CC_id]->mu_mimo_mode[UE_id].dl_pow_off); PHY_vars_UE_g[UE_id][CC_id]->transmission_mode[att_eNB_id], PHY_vars_eNB_g[att_eNB_id][CC_id]->eNB_UE_stats[UE_id].DL_pmi_single,
PHY_vars_eNB_g[att_eNB_id][CC_id]->mu_mimo_mode[UE_id].dl_pow_off,PHY_vars_eNB_g[att_eNB_id][CC_id]->lte_frame_parms.N_RB_DL);
// calculate sinr here // calculate sinr here
for (eNB_id = 0; eNB_id < NB_eNB_INST; eNB_id++) { for (eNB_id = 0; eNB_id < NB_eNB_INST; eNB_id++) {
if (att_eNB_id != eNB_id) { if (att_eNB_id != eNB_id) {
calculate_sinr(eNB2UE[eNB_id][UE_id][CC_id], enb_data[eNB_id], ue_data[UE_id], PHY_vars_UE_g[UE_id][CC_id]->sinr_dB); calculate_sinr(eNB2UE[eNB_id][UE_id][CC_id], enb_data[eNB_id], ue_data[UE_id], PHY_vars_UE_g[UE_id][CC_id]->sinr_dB,PHY_vars_eNB_g[att_eNB_id][CC_id]->lte_frame_parms.N_RB_DL);
} }
} }
} // hold channel } // hold channel
...@@ -220,18 +219,6 @@ void do_DL_sig(double **r_re0,double **r_im0, ...@@ -220,18 +219,6 @@ void do_DL_sig(double **r_re0,double **r_im0,
Call do_OFDM_mod from phy_procedures_eNB_TX function Call do_OFDM_mod from phy_procedures_eNB_TX function
*/ */
//for (UE_id=0;UE_id<NB_UE_INST;UE_id++) {
// Compute RX signal for UE = UE_id
/*
for (i=0;i<(frame_parms->samples_per_tti>>1);i++) {
for (aa=0;aa<nb_antennas_rx;aa++) {
r_re[aa][i]=0.0;
r_im[aa][i]=0.0;
}
}
*/
// printf("r_re[0] %p\n",r_re[0]); // printf("r_re[0] %p\n",r_re[0]);
for (aa=0; aa<nb_antennas_rx; aa++) { for (aa=0; aa<nb_antennas_rx; aa++) {
memset((void*)r_re[aa],0,(frame_parms->samples_per_tti>>1)*sizeof(double)); memset((void*)r_re[aa],0,(frame_parms->samples_per_tti>>1)*sizeof(double));
......
This diff is collapsed.
...@@ -62,9 +62,9 @@ void extract_position(node_list* input_node_list, node_desc_t**, int nb_nodes);/ ...@@ -62,9 +62,9 @@ void extract_position(node_list* input_node_list, node_desc_t**, int nb_nodes);/
void get_beta_map(void);//Abstraction changes void get_beta_map(void);//Abstraction changes
void get_MIESM_param(void); void get_MIESM_param(void);
void init_snr(channel_desc_t *, node_desc_t *, node_desc_t *, double*, double*, uint8_t, uint16_t, uint8_t);//Abstraction changes void init_snr(channel_desc_t *, node_desc_t *, node_desc_t *, double*, double*, uint8_t, uint16_t, uint8_t, uint16_t);//Abstraction changes
void init_snr_up(channel_desc_t *, node_desc_t *, node_desc_t *, double*, double*, uint16_t, uint16_t);//Abstraction changes void init_snr_up(channel_desc_t *, node_desc_t *, node_desc_t *, double*, double*, uint16_t, uint16_t);//Abstraction changes
void calculate_sinr(channel_desc_t *, node_desc_t *, node_desc_t *, double *sinr_dB);//Abstraction changes void calculate_sinr(channel_desc_t *, node_desc_t *, node_desc_t *, double *sinr_dB, uint16_t);//Abstraction changes
void get_beta_map(void); void get_beta_map(void);
int dlsch_abstraction_EESM(double* sinr_dB, uint32_t rb_alloc[4], uint8_t mcs, uint8_t); //temporary testing for PHY abstraction int dlsch_abstraction_EESM(double* sinr_dB, uint32_t rb_alloc[4], uint8_t mcs, uint8_t); //temporary testing for PHY abstraction
int dlsch_abstraction_MIESM(double* sinr_dB,uint8_t TM, uint32_t rb_alloc[4], uint8_t mcs,uint8_t); int dlsch_abstraction_MIESM(double* sinr_dB,uint8_t TM, uint32_t rb_alloc[4], uint8_t mcs,uint8_t);
......
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