Commit 59241c47 authored by Rohit Gupta's avatar Rohit Gupta

Merge branch 'develop' into feature-38-bladerf

parents 9ab92439 e094226d
......@@ -20,9 +20,11 @@ job1:
- EXTERNAL_SHARE_RESULTS_DIR=$EXTERNAL_SHARE_DIR/$git_branch/$git_head
- echo $NFS_TEST_RESULTS_DIR
- echo $EXTERNAL_SHARE_RESULTS_DIR
- echo $NRUNS_LTE_SOFTMODEM
- echo $TIMEOUT_CMD
- mkdir -p $OPENAIR_DIR/cmake_targets/autotests/log
- python $OPENAIR_DIR/cmake_targets/autotests/run_exec_lte-softmodem_tests.py -c -5GRepoHeadVersion $git_head -n $NFS_SHARE_DIR -u $OAI_USER -p $OAI_PASS >& $OPENAIR_DIR/cmake_targets/autotests/python_autotest_cleanup.log
- python $OPENAIR_DIR/cmake_targets/autotests/run_exec_lte-softmodem_tests.py -r -5GRepoHeadVersion $git_head -n $NFS_SHARE_DIR -u $OAI_USER -p $OAI_PASS `echo $OAI_EXTRA_ARGS` -g $OAI_TEST_CASE_GROUP >& $OPENAIR_DIR/cmake_targets/autotests/python_autotest.log
- python $OPENAIR_DIR/cmake_targets/autotests/run_exec_lte-softmodem_tests.py -c -5GRepoHeadVersion $git_head -n $NFS_SHARE_DIR -u $OAI_USER -p $OAI_PASS $OAI_EXTRA_ARGS -g "$OAI_TEST_CASE_GROUP">& $OPENAIR_DIR/cmake_targets/autotests/python_autotest_cleanup.log
- python $OPENAIR_DIR/cmake_targets/autotests/run_exec_lte-softmodem_tests.py -r -5GRepoHeadVersion $git_head -n $NFS_SHARE_DIR -u $OAI_USER -p $OAI_PASS `echo $OAI_EXTRA_ARGS` -g "$OAI_TEST_CASE_GROUP" --nrun_lte_softmodem $NRUNS_LTE_SOFTMODEM --timeout_cmd $TIMEOUT_CMD >& $OPENAIR_DIR/cmake_targets/autotests/python_autotest.log
- mv $OPENAIR_DIR/cmake_targets/autotests/python_autotest.log $OPENAIR_DIR/cmake_targets/autotests/log/python_autotest.log
- mv $OPENAIR_DIR/cmake_targets/autotests/python_autotest_cleanup.log $OPENAIR_DIR/cmake_targets/autotests/log/python_autotest_cleanup.log
- 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
......
This diff is collapsed.
......@@ -98,46 +98,78 @@ Obj.# Case# Test# Description
01 55 lte-softmodem tests with USRP B210 RF as eNB and ALU EPC w/ Bandrich COTS UE for TX/1RX, 2TX/2RX
01 55 00 Band 7 FDD 5MHz UL Throughput for 60 sec for 1TX/1RX
01 55 01 Band 7 FDD 10MHz UL Throughput for 60 sec for 1TX/1RX
01 55 02 Band 7 FDD 20MHz UL Throughput for 60 sec for 1TX/1RX
01 55 03 Band 7 FDD 5MHz DL Throughput for 60 sec for 1TX/1RX
01 55 04 Band 7 FDD 10MHz DL Throughput for 60 sec for 1TX/1RX
01 55 05 Band 7 FDD 20MHz DL Throughput for 60 sec for 1TX/1RX
01 55 06 Band 7 FDD 5MHz UL Throughput for 60 sec for 2TX/2RX
01 55 07 Band 7 FDD 10MHz UL Throughput for 60 sec for 2TX/2RX
01 55 08 Band 7 FDD 20MHz UL Throughput for 60 sec for 2TX/2RX
01 55 09 Band 7 FDD 5MHz DL Throughput for 60 sec for 2TX/2RX
01 55 10 Band 7 FDD 10MHz DL Throughput for 60 sec for 2TX/2RX
01 55 11 Band 7 FDD 20MHz DL Throughput for 60 sec for 2TX/2RX
01 55 00 Band 7 FDD 5MHz UL Throughput for 300 sec for 1TX/1RX
01 55 01 Band 7 FDD 10MHz UL Throughput for 300 sec for 1TX/1RX
01 55 02 Band 7 FDD 20MHz UL Throughput for 300 sec for 1TX/1RX
01 55 03 Band 7 FDD 5MHz DL Throughput for 300 sec for 1TX/1RX
01 55 04 Band 7 FDD 10MHz DL Throughput for 300 sec for 1TX/1RX
01 55 05 Band 7 FDD 20MHz DL Throughput for 300 sec for 1TX/1RX
01 55 06 Band 7 FDD 5MHz UL Throughput for 300 sec for 2TX/2RX
01 55 07 Band 7 FDD 10MHz UL Throughput for 300 sec for 2TX/2RX
01 55 08 Band 7 FDD 20MHz UL Throughput for 300 sec for 2TX/2RX
01 55 09 Band 7 FDD 5MHz DL Throughput for 300 sec for 2TX/2RX
01 55 10 Band 7 FDD 10MHz DL Throughput for 300 sec for 2TX/2RX
01 55 11 Band 7 FDD 20MHz DL Throughput for 300 sec for 2TX/2RX
01 56 lte-softmodem tests with USRP B210 RF as eNB and OAI EPC (eNB and EPC are on same machines) w/ Bandrich COTS UE
01 56 00 Band 7 FDD 5MHz UL Throughput for 300 sec for 1TX/1RX
01 56 01 Band 7 FDD 10MHz UL Throughput for 300 sec for 1TX/1RX
01 56 02 Band 7 FDD 20MHz UL Throughput for 300 sec for 1TX/1RX
01 56 03 Band 7 FDD 5MHz DL Throughput for 300 sec for 1TX/1RX
01 56 04 Band 7 FDD 10MHz DL Throughput for 300 sec for 1TX/1RX
01 56 05 Band 7 FDD 20MHz DL Throughput for 300 sec for 1TX/1RX
01 57 lte-softmodem tests with USRP B210 RF as eNB and OAI EPC (eNB and EPC are on different machines) w/ Bandrich COTS UE
01 57 00 Band 7 FDD 5MHz UL Throughput for 300 sec for 1TX/1RX
01 57 01 Band 7 FDD 10MHz UL Throughput for 300 sec for 1TX/1RX
01 57 02 Band 7 FDD 20MHz UL Throughput for 300 sec for 1TX/1RX
01 57 03 Band 7 FDD 5MHz DL Throughput for 300 sec for 1TX/1RX
01 57 04 Band 7 FDD 10MHz DL Throughput for 300 sec for 1TX/1RX
01 57 05 Band 7 FDD 20MHz DL Throughput for 300 sec for 1TX/1RX
01 58 lte-softmodem tests with USRP X310 RF as eNB and ALU EPC w/ Bandrich COTS UE for `TX/1RX, 2TX/2RX
01 58 00 Band 7 FDD 5MHz UL Throughput for 60 sec for 1TX/1RX
01 58 01 Band 7 FDD 10MHz UL Throughput for 60 sec for 1TX/1RX
01 58 02 Band 7 FDD 20MHz UL Throughput for 60 sec for 1TX/1RX
01 58 03 Band 7 FDD 5MHz DL Throughput for 60 sec for 1TX/1RX
01 58 04 Band 7 FDD 10MHz DL Throughput for 60 sec for 1TX/1RX
01 58 05 Band 7 FDD 20MHz DL Throughput for 60 sec for 1TX/1RX
01 58 00 Band 7 FDD 5MHz UL Throughput for 300 sec for 1TX/1RX
01 58 01 Band 7 FDD 10MHz UL Throughput for 300 sec for 1TX/1RX
01 58 02 Band 7 FDD 20MHz UL Throughput for 300 sec for 1TX/1RX
01 58 03 Band 7 FDD 5MHz DL Throughput for 300 sec for 1TX/1RX
01 58 04 Band 7 FDD 10MHz DL Throughput for 300 sec for 1TX/1RX
01 58 05 Band 7 FDD 20MHz DL Throughput for 300 sec for 1TX/1RX
01 59 lte-softmodem tests with USRP X310 RF as eNB and OAI EPC (eNB and EPC are on same machines) w/ Bandrich COTS UE
01 61 lte-softmodem tests with USRP X310 RF as eNB and OAI EPC (eNB and EPC are on different machines) w/ Bandrich COTS UE
01 60 lte-softmodem tests with USRP X310 RF as eNB and OAI EPC (eNB and EPC are on different machines) w/ Bandrich COTS UE
01 60 00 Band 7 FDD 5MHz UL Throughput for 300 sec for 1TX/1RX
01 60 01 Band 7 FDD 10MHz UL Throughput for 300 sec for 1TX/1RX
01 60 02 Band 7 FDD 20MHz UL Throughput for 300 sec for 1TX/1RX
01 60 03 Band 7 FDD 5MHz DL Throughput for 300 sec for 1TX/1RX
01 60 04 Band 7 FDD 10MHz DL Throughput for 300 sec for 1TX/1RX
01 60 05 Band 7 FDD 20MHz DL Throughput for 300 sec for 1TX/1RX
01 61 lte-softmodem tests with EXMIMO RF as eNB and ALU EPC w/ Bandrich COTS UE for `TX/1RX, 2TX/2RX
01 61 00 Band 7 FDD 5MHz UL Throughput for 60 sec for 1TX/1RX
01 61 01 Band 7 FDD 10MHz UL Throughput for 60 sec for 1TX/1RX
01 61 02 Band 7 FDD 20MHz UL Throughput for 60 sec for 1TX/1RX
01 61 03 Band 7 FDD 5MHz DL Throughput for 60 sec for 1TX/1RX
01 61 04 Band 7 FDD 10MHz DL Throughput for 60 sec for 1TX/1RX
01 61 05 Band 7 FDD 20MHz DL Throughput for 60 sec for 1TX/1RX
01 61 00 Band 7 FDD 5MHz UL Throughput for 300 sec for 1TX/1RX
01 61 01 Band 7 FDD 10MHz UL Throughput for 300 sec for 1TX/1RX
01 61 02 Band 7 FDD 20MHz UL Throughput for 300 sec for 1TX/1RX
01 61 03 Band 7 FDD 5MHz DL Throughput for 300 sec for 1TX/1RX
01 61 04 Band 7 FDD 10MHz DL Throughput for 300 sec for 1TX/1RX
01 61 05 Band 7 FDD 20MHz DL Throughput for 300 sec for 1TX/1RX
01 62 lte-softmodem tests with EXMIMO RF as eNB and OAI EPC (eNB and EPC are on same machines) w/ Bandrich COTS UE
01 63 lte-softmodem tests with EXMIMO RF as eNB and OAI EPC (eNB and EPC are on different machines) w/ Bandrich COTS UE
01 63 00 Band 7 FDD 5MHz UL Throughput for 300 sec for 1TX/1RX
01 63 01 Band 7 FDD 10MHz UL Throughput for 300 sec for 1TX/1RX
01 63 02 Band 7 FDD 20MHz UL Throughput for 300 sec for 1TX/1RX
01 63 03 Band 7 FDD 5MHz DL Throughput for 300 sec for 1TX/1RX
01 63 04 Band 7 FDD 10MHz DL Throughput for 300 sec for 1TX/1RX
01 63 05 Band 7 FDD 20MHz DL Throughput for 300 sec for 1TX/1RX
01 65 00 lte-softmodem tests with BladeRF RF as eNB and ALU EPC w/ Bandrich COTS UE for TX/1RX
01 65 00 Band 7 FDD 5MHz UL Throughput for 300 sec for 1TX/1RX
01 65 01 Band 7 FDD 10MHz UL Throughput for 300 sec for 1TX/1RX
01 65 02 Band 7 FDD 20MHz UL Throughput for 300 sec for 1TX/1RX
01 65 03 Band 7 FDD 5MHz 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 64 lte-softmodem-noS1 tests
......
......@@ -192,6 +192,7 @@ class core:
if index == 0 or index == 1 :
return self.oai.before
else:
print "command = " + command + "rsp1 = " + rsp1 + " rsp2 = " + rsp2 + " index = " + str(index)
raise log.err(self.failed(command, rsp1 + ' or ' + rsp2,debug))
......@@ -240,7 +241,7 @@ class core:
if (rsp.find(expect) == -1):
return 'OK'
else:
print "command = " + cmd + "expect = " + expect + "rsp = " + rsp
print "command = " + command + "expect = " + expect + "rsp = " + rsp
raise log.err(self.failed(command, expect,debug))
......
......@@ -175,6 +175,7 @@ function test_compile() {
#\param $13 -> output of compilation program that needs to be found for test case to pass
#\param $14 -> tags to help identify the test case for readability in output xml file
#\param $15 => password for the user to run certain commands as sudo
#\param $16 => test config file params to be modified
function test_compile_and_run() {
xUnit_start
......@@ -195,12 +196,14 @@ function test_compile_and_run() {
compile_prog_out=${13}
tags=${14}
mypassword=${15}
test_config_file=${16}
build_dir=$tdir/$1/build
#exec_file=$build_dir/$6
xmlfile_testcase=$log_dir/test.$1.xml
#Temporary log file where execution log is stored.
temp_exec_log=$log_dir/temp_log.txt
export OPENAIR_LOGDIR=$log_dir
rm -fr $log_dir
mkdir -p $log_dir
......@@ -219,6 +222,10 @@ function test_compile_and_run() {
#compile_prog_array=()
#read -a compile_prog_array <<<"$compile_prog"
#test_config_file=`eval "echo \"$test_config_file\" "`
#echo "test_config_file = $test_config_file"
tags_array=()
read -a tags_array <<<"$tags"
......@@ -238,17 +245,21 @@ function test_compile_and_run() {
cd $log_dir
{
uname -a
#eval $pre_compile_prog
#cmake ..
#rm -fv $exec_file
echo "Executing $compile_prog $compile_args" >> $log_file
echo "Executing $pre_compile_prog"
eval $pre_compile_prog
if [ "$test_config_file" != "" ]; then
echo "Modifying test_config_file parameters..."
echo "$test_config_file" |xargs -L 1 $OPENAIR_DIR/cmake_targets/autotests/tools/search_repl.py
fi
echo "Executing $compile_prog $compile_args"
eval "$compile_prog $compile_args"
echo "Copying compilation log files to test case log directory: $log_dir"
cp -fvr $OPENAIR_DIR/cmake_targets/log/ $log_dir/compile_log
}>> $log_file 2>&1
echo "</COMPILATION LOG>" >> $log_file 2>&1
#done
#process the test case if it is that of execution
if [ "$class" == "execution" ]; then
tags_array_index=0
......@@ -437,7 +448,8 @@ for search_expr in "${test_case_array[@]}"
else
flag_run_test_case=1
fi
#We skip this test case if it is not in the group list
if [ "$flag_run_test_case" -ne "1" ]; then
continue
......@@ -458,6 +470,7 @@ for search_expr in "${test_case_array[@]}"
nruns=`xmlstarlet sel -t -v "/testCaseList/testCase[@id='$search_expr']/nruns" $xml_conf`
compile_prog_out=`xmlstarlet sel -t -v "/testCaseList/testCase[@id='$search_expr']/compile_prog_out" $xml_conf`
tags=`xmlstarlet sel -t -v "/testCaseList/testCase[@id='$search_expr']/tags" $xml_conf`
test_config_file=`xmlstarlet sel -t -v "/testCaseList/testCase[@id='$search_expr']/test_config_file" $xml_conf`
echo "class = $class"
echo "name = $name"
......@@ -497,7 +510,7 @@ for search_expr in "${test_case_array[@]}"
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
$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_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
echo "Unexpected class of test case...Skipping the test case $name ...."
fi
......
This diff is collapsed.
......@@ -21,6 +21,10 @@ 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
......@@ -126,8 +130,8 @@ def start_ue () :
break
ip = IPRoute()
idx = ip.link_lookup(ifname=iface)[0]
os.system ('route add 192.172.0.1 ppp0')
os.system ('ping 192.172.0.1')
os.system ('route add ' + gw + ' ppp0')
os.system ('ping ' + gw)
break
except Exception, e:
error = ' Interface ' + iface + 'does not exist...'
......@@ -159,36 +163,16 @@ def reset_ue():
VendorId=res[0][2]
ProductId=res[0][3]
usb_dir= find_usb_path(VendorId, ProductId)
print usb_dir
print "Bandrich 4G LTE Adapter found in..." + usb_dir
cmd = "sudo sh -c \"echo 0 > " + usb_dir + "/authorized\""
os.system(cmd + " ; sleep 5" )
os.system(cmd + " ; sleep 15" )
cmd = "sudo sh -c \"echo 1 > " + usb_dir + "/authorized\""
os.system(cmd + " ; sleep 5" )
def read_file(filename):
try:
file = open(filename, 'r')
return file.read()
except Exception, e:
#error = ' Filename ' + filename
#error = error + ' In function: ' + sys._getframe().f_code.co_name + ': *** Caught exception: ' + str(e.__class__) + " : " + str( e)
#error = error + traceback.format_exc()
#print error
return ''
def find_usb_path(idVendor, idProduct):
for root, dirs, files in os.walk("/sys/bus/usb/devices", topdown=False):
for name in dirs:
tmpdir= os.path.join(root, name)
tmpidVendor = read_file(tmpdir+'/idVendor').replace("\n","")
tmpidProduct = read_file(tmpdir+'/idProduct').replace("\n","")
#print "tmpdir = " + tmpdir + " tmpidVendor = " + tmpidVendor + " tmpidProduct = " + tmpidProduct
if tmpidVendor == idVendor and tmpidProduct == idProduct:
return tmpdir
return ''
for arg in sys.argv[1:]:
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
......@@ -199,8 +183,17 @@ for arg in sys.argv[1:]:
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
#!/usr/bin/python
import os
from pyroute2 import IPRoute
import sys
import re
import threading
import signal
import traceback
import commands
def read_file(filename):
try:
file = open(filename, 'r')
return file.read()
except Exception, e:
# WE just ignore the exception as some files are probably not present
#error = ' Filename ' + filename
#error = error + ' In function: ' + sys._getframe().f_code.co_name + ': *** Caught exception: ' + str(e.__class__) + " : " + str( e)
#error = error + traceback.format_exc()
#print error
return ''
def find_usb_path(idVendor, idProduct):
for root, dirs, files in os.walk("/sys/bus/usb/devices", topdown=False):
for name in dirs:
tmpdir= os.path.join(root, name)
tmpidVendor = read_file(tmpdir+'/idVendor').replace("\n","")
tmpidProduct = read_file(tmpdir+'/idProduct').replace("\n","")
if tmpidVendor == idVendor and tmpidProduct == idProduct:
return tmpdir
return ''
#!/usr/bin/python
import sys
import re
import os
#Arg 1 name of file
#Arg 2 keyword
#arg 3 replacement text
#Note that these should be seperated by spaces
if len(sys.argv) != 4:
print "search_repl.py: Wrong number of arguments. This program needs 3 arguments"
print "search_repl.py: Wrong number of arguments. This program needs 3 arguments. The number of arguments supplied : " + str(sys.argv)
sys.exit()
filename = sys.argv[1]
filename = os.path.expandvars(sys.argv[1])
keyword = sys.argv[2]
replacement_text = sys.argv[3]
file = open(filename, 'r')
string = file.read()
file.close()
if keyword == 'mme_ip_address':
#string = (re.sub(r"mme_ip_address\s*=\s*\([^\$]+)\)\s*;\s*", r"<% tex \1 %>", t, re.M)
replacement_text = keyword + ' = ( { ' + replacement_text + ' } ) ; '
string = re.sub(r"mme_ip_address\s*=\s*\(([^\$]+?)\)\s*;", replacement_text, string, re.M)
elif keyword == 'IPV4_LIST':
replacement_text = keyword + ' = ( ' + replacement_text + ' ) ; '
string = re.sub(r"IPV4_LIST\s*=\s*\(([^\$]+?)\)\s*;", replacement_text, string, re.M)
else :
replacement_text = keyword + ' = ' + replacement_text + ' ; '
string = re.sub(r"%s\s*=\s*([^\$]+?)\s*;" % keyword , replacement_text, string, re.M)
......
This diff is collapsed.
......@@ -180,7 +180,7 @@ check_install_bladerf_driver(){
$SUDO apt-get install -y bladerf libbladerf-dev
$SUDO apt-get install -y bladerf-firmware-fx3
$SUDO apt-get install -y bladerf-fpga-hostedx40
bladeRF-cli --flash-firmware /usr/share/Nuand/bladeRF/bladeRF_fw.img
$SUDO bladeRF-cli --flash-firmware /usr/share/Nuand/bladeRF/bladeRF_fw.img
}
check_install_additional_tools (){
......
#!/usr/bin/python
import time
import serial
import os
from pyroute2 import IPRoute
import sys
import re
import threading
import signal
import traceback
import commands
if os.environ.get('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 reset_bladerf():
stringIdBladeRF='OpenMoko, Inc'
status, out = commands.getstatusoutput('lsusb | grep -i \'' + stringIdBladeRF + '\'')
if (out == '') :
print "BladeRF 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 "BladeRF Found in directory..." + usb_dir
cmd = "sudo sh -c \"echo 0 > " + usb_dir + "/authorized\""
os.system(cmd + " ; sleep 5" )
cmd = "sudo sh -c \"echo 1 > " + usb_dir + "/authorized\""
os.system(cmd + " ; sleep 5" )
os.system ('sudo -E bladeRF-cli --flash-firmware /usr/share/Nuand/bladeRF/bladeRF_fw.img')
print "Resettting BladeRF..."
reset_bladerf()
os.system ("dmesg|tail")
......@@ -36,6 +36,7 @@
#include <stdlib.h>
#endif
#include "PHY/defs.h"
#include "assertions.h"
//#define cmin(a,b) ((a)<(b) ? (a) : (b))
......@@ -515,16 +516,14 @@ uint32_t lte_rate_matching_turbo(uint32_t RTC,
// if (rvidx==3)
// for (cnt=0;cnt<Ncb;cnt++)
// counter_buffer[rvidx][cnt]=0;
if (Ncb<(3*(RTC<<5))) {
msg("Exiting, RM condition (Nir %d, Nsoft %d, Kw %d\n",Nir,Nsoft,3*(RTC<<5));
return(0);
}
AssertFatal(Ncb>=(3*RTC<<5),"Exiting, RM condition (Ncb %d, Nir/C %d, Nsoft %d, Kw %d\n",Ncb,Nir/C,Nsoft,3*(RTC<<5));
Gp = G/Nl/Qm;
GpmodC = Gp%C;
#ifdef RM_DEBUG
printf("lte_rate_matching_turbo: Kw %d, rvidx %d, G %d, Qm %d, Nl%d, r %d\n",3*(RTC<<5),rvidx, G, Qm,Nl,r);
printf("lte_rate_matching_turbo: Ncb %d, Kw %d, Nir/C %d, rvidx %d, G %d, Qm %d, Nl%d, r %d\n",Ncb,3*(RTC<<5),Nir/C,rvidx, G, Qm,Nl,r);
#endif
if (r < (C-(GpmodC)))
......
......@@ -243,15 +243,16 @@ int lte_est_timing_advance(LTE_DL_FRAME_PARMS *frame_parms,
int lte_est_timing_advance_pusch(PHY_VARS_eNB* phy_vars_eNB,module_id_t UE_id,uint8_t subframe);
void lte_eNB_I0_measurements(PHY_VARS_eNB *phy_vars_eNb,
void lte_eNB_I0_measurements(PHY_VARS_eNB *phy_vars_eNB,
int subframe,
module_id_t eNB_id,
unsigned char clear);
void lte_eNB_I0_measurements_emul(PHY_VARS_eNB *phy_vars_eNb,
void lte_eNB_I0_measurements_emul(PHY_VARS_eNB *phy_vars_eNB,
uint8_t sect_id);
void lte_eNB_srs_measurements(PHY_VARS_eNB *phy_vars_eNb,
void lte_eNB_srs_measurements(PHY_VARS_eNB *phy_vars_eNBy,
module_id_t eNB_id,
module_id_t UE_id,
unsigned char init_averaging);
......
......@@ -39,57 +39,36 @@
int32_t rx_power_avg_eNB[3][3];
void lte_eNB_I0_measurements(PHY_VARS_eNB *phy_vars_eNb,
void lte_eNB_I0_measurements(PHY_VARS_eNB *phy_vars_eNB,
int subframe,
unsigned char eNB_id,
unsigned char clear)
{
LTE_eNB_COMMON *eNB_common_vars = &phy_vars_eNb->lte_eNB_common_vars;
LTE_DL_FRAME_PARMS *frame_parms = &phy_vars_eNb->lte_frame_parms;
PHY_MEASUREMENTS_eNB *phy_measurements = &phy_vars_eNb->PHY_measurements_eNB[eNB_id];
LTE_eNB_COMMON *eNB_common_vars = &phy_vars_eNB->lte_eNB_common_vars;
LTE_DL_FRAME_PARMS *frame_parms = &phy_vars_eNB->lte_frame_parms;
PHY_MEASUREMENTS_eNB *phy_measurements = &phy_vars_eNB->PHY_measurements_eNB[eNB_id];
int32_t *rb_mask = phy_vars_eNB->rb_mask_ul;
uint32_t aarx,rx_power_correction;
uint32_t rb;
int32_t *ul_ch;
int32_t n0_power_tot;
int len;
int offset;
int Nsymb = (frame_parms->Ncp==NORMAL)?14:12;
// noise measurements
// for the moment we measure the noise on the 7th OFDM symbol (in S subframe)
phy_measurements->n0_power_tot = 0;
/* printf("rxdataF0 %p, rxdataF1 %p\n",
(&eNB_common_vars->rxdataF[0][0][(frame_parms->ofdm_symbol_size + frame_parms->first_carrier_offset)<<1 ]),
(&eNB_common_vars->rxdataF[0][1][(frame_parms->ofdm_symbol_size + frame_parms->first_carrier_offset)<<1 ]));
*/
/*
for (i=0;i<512;i++)
printf("sector 0 antenna 0 : %d,%d\n",((short *)&eNB_common_vars->rxdataF[0][0][(19*frame_parms->ofdm_symbol_size)<<1])[i<<1],
((short *)&eNB_common_vars->rxdataF[0][0][(19*frame_parms->ofdm_symbol_size)<<1])[1+(i<<1)]);
for (i=0;i<12;i++)
// printf("sector 0 antenna 1 : %d,%d\n",((short *)&eNB_common_vars->rxdataF[0][1][(19*frame_parms->ofdm_symbol_size)<<1])[i<<1],
((short *)&eNB_common_vars->rxdataF[0][1][(19*frame_parms->ofdm_symbol_size)<<1])[1+(i<<1)]);
*/
if ( (frame_parms->ofdm_symbol_size == 128) ||
(frame_parms->ofdm_symbol_size == 512) )
rx_power_correction = 2;
else
rx_power_correction = 1;
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
if (clear == 1)
phy_measurements->n0_power[aarx]=0;
#ifdef USER_MODE
phy_measurements->n0_power[aarx] = ((k1*signal_energy(&eNB_common_vars->rxdata[eNB_id][aarx][(frame_parms->samples_per_tti<<1) -frame_parms->ofdm_symbol_size],
frame_parms->ofdm_symbol_size)) + k2*phy_measurements->n0_power[aarx])>>10;
#else
phy_measurements->n0_power[aarx] = ((k1*signal_energy(&eNB_common_vars->rxdata[eNB_id][aarx][(frame_parms->samples_per_tti<<1) -frame_parms->ofdm_symbol_size],
frame_parms->ofdm_symbol_size))+k2*phy_measurements->n0_power[aarx])>>10;
#endif
phy_measurements->n0_power[aarx] = (phy_measurements->n0_power[aarx] * 12*frame_parms->N_RB_DL)/(frame_parms->ofdm_symbol_size);
phy_measurements->n0_power_dB[aarx] = (unsigned short) dB_fixed(phy_measurements->n0_power[aarx]);
phy_measurements->n0_power_tot += phy_measurements->n0_power[aarx];
......@@ -97,52 +76,49 @@ void lte_eNB_I0_measurements(PHY_VARS_eNB *phy_vars_eNb,
phy_measurements->n0_power_tot_dB = (unsigned short) dB_fixed(phy_measurements->n0_power_tot);
phy_measurements->n0_power_tot_dBm = phy_measurements->n0_power_tot_dB - phy_vars_eNb->rx_total_gain_eNB_dB;
phy_measurements->n0_power_tot_dBm = phy_measurements->n0_power_tot_dB - phy_vars_eNB->rx_total_gain_eNB_dB;
// printf("n0_power %d\n",phy_measurements->n0_power_tot_dB);
for (rb=0; rb<frame_parms->N_RB_UL; rb++) {
n0_power_tot=0;
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
if (rb < 12)
// ul_ch = &eNB_common_vars->rxdataF[eNB_id][aarx][((19*(frame_parms->ofdm_symbol_size)) + frame_parms->first_carrier_offset + (rb*12))<<1];
ul_ch = &eNB_common_vars->rxdataF[eNB_id][aarx][((7*frame_parms->ofdm_symbol_size) + frame_parms->first_carrier_offset + (rb*12))<<1];
else if (rb>12)
ul_ch = &eNB_common_vars->rxdataF[eNB_id][aarx][((7*frame_parms->ofdm_symbol_size) + 6 + (rb-13)*12)<<1];
else {
ul_ch = NULL;
}
if (clear == 1)
phy_measurements->n0_subband_power[aarx][rb]=0;
if (ul_ch) {
// for (i=0;i<24;i+=2)
// printf("re %d => %d\n",i/2,ul_ch[i]);
phy_measurements->n0_subband_power[aarx][rb] = ((k1*(signal_energy_nodc(ul_ch,
24))*rx_power_correction) + (k2*phy_measurements->n0_subband_power[aarx][rb]))>>11; // 11 and 24 to compensate for repeated signal format
phy_measurements->n0_subband_power_dB[aarx][rb] = dB_fixed(phy_measurements->n0_subband_power[aarx][rb]);
// printf("eNb %d, aarx %d, rb %d : energy %d (%d dB)\n",eNB_id,aarx,rb,signal_energy_nodc(ul_ch,24), phy_measurements->n0_subband_power_dB[aarx][rb]);
n0_power_tot += phy_measurements->n0_subband_power[aarx][rb];
} else {
phy_measurements->n0_subband_power[aarx][rb] = 1;
phy_measurements->n0_subband_power_dB[aarx][rb] = -99;
n0_power_tot = 1;
if ((rb_mask[rb>>5]&(1<<(rb&31))) == 0) { // check that rb was not used in this subframe
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
// select the 7th symbol in an uplink subframe
offset = (frame_parms->first_carrier_offset + (rb*12))%frame_parms->ofdm_symbol_size;
offset += (7*frame_parms->ofdm_symbol_size);//(((Nsymb*subframe)+7)*frame_parms->ofdm_symbol_size);
ul_ch = &eNB_common_vars->rxdataF[eNB_id][aarx][offset];
len = 12;
// just do first half of middle PRB for odd number of PRBs
if (((frame_parms->N_RB_UL&1) == 1) &&
(rb==(frame_parms->N_RB_UL>>1))) {
len=6;
}
if (clear == 1)
phy_measurements->n0_subband_power[aarx][rb]=0;
AssertFatal(ul_ch, "RX signal buffer (freq) problem");
phy_measurements->n0_subband_power[aarx][rb] = signal_energy_nodc(ul_ch,len);
//((k1*(signal_energy_nodc(ul_ch,len)))
// + (k2*phy_measurements->n0_subband_power[aarx][rb]));
phy_measurements->n0_subband_power_dB[aarx][rb] = dB_fixed(phy_measurements->n0_subband_power[aarx][rb]);
// printf("subframe %d (%d): eNb %d, aarx %d, rb %d len %d: energy %d (%d dB)\n",subframe,offset,eNB_id,aarx,rb,len,signal_energy_nodc(ul_ch,len),
// phy_measurements->n0_subband_power_dB[aarx][rb]);
n0_power_tot += phy_measurements->n0_subband_power[aarx][rb];
}
phy_measurements->n0_subband_power_tot_dB[rb] = dB_fixed(n0_power_tot);
phy_measurements->n0_subband_power_tot_dBm[rb] = phy_measurements->n0_subband_power_tot_dB[rb] - phy_vars_eNB->rx_total_gain_eNB_dB - dB_fixed(frame_parms->N_RB_UL);
}
phy_measurements->n0_subband_power_tot_dB[rb] = dB_fixed(n0_power_tot);
phy_measurements->n0_subband_power_tot_dBm[rb] = phy_measurements->n0_subband_power_tot_dB[rb] - phy_vars_eNb->rx_total_gain_eNB_dB - 14;
}
}
void lte_eNB_srs_measurements(PHY_VARS_eNB *phy_vars_eNb,
unsigned char eNB_id,
unsigned char UE_id,
......
......@@ -2108,14 +2108,14 @@ uint8_t generate_dci_top(uint8_t num_ue_spec_dci,
if (dci_alloc[i].L == (uint8_t)L) {
#ifdef DEBUG_DCI_ENCODING
LOG_I(PHY,"Generating common DCI %d/%d (nCCE %d) of length %d, aggregation %d (%x)\n",i,num_common_dci,dci_alloc[i].nCCE,dci_alloc[i].dci_length,1<<dci_alloc[i].L,
LOG_I(PHY,"Generating common DCI %d/%d (nCCE %d) of length %d, aggregation %d (%x)\n",i,num_common_dci,dci_alloc[i].firstCCE,dci_alloc[i].dci_length,1<<dci_alloc[i].L,
*(unsigned int*)dci_alloc[i].dci_pdu);
dump_dci(frame_parms,&dci_alloc[i]);
#endif
if (dci_alloc[i].nCCE>=0) {
if (dci_alloc[i].firstCCE>=0) {
e_ptr = generate_dci0(dci_alloc[i].dci_pdu,
e+(72*dci_alloc[i].nCCE),
e+(72*dci_alloc[i].firstCCE),
dci_alloc[i].dci_length,
dci_alloc[i].L,
dci_alloc[i].rnti);
......@@ -2133,9 +2133,9 @@ uint8_t generate_dci_top(uint8_t num_ue_spec_dci,
dump_dci(frame_parms,&dci_alloc[i]);
#endif
if (dci_alloc[i].nCCE >= 0) {
if (dci_alloc[i].firstCCE >= 0) {
e_ptr = generate_dci0(dci_alloc[i].dci_pdu,
e+(72*dci_alloc[i].nCCE),
e+(72*dci_alloc[i].firstCCE),
dci_alloc[i].dci_length,
dci_alloc[i].L,
dci_alloc[i].rnti);
......@@ -2537,13 +2537,116 @@ uint16_t get_nquad(uint8_t num_pdcch_symbols,LTE_DL_FRAME_PARMS *frame_parms,uin
return(Nreg - 4 - (3*Ngroup_PHICH));
}
uint16_t get_nCCE_max(uint8_t Mod_id,uint8_t CC_id)
uint16_t get_nCCE_mac(uint8_t Mod_id,uint8_t CC_id,int num_pdcch_symbols,int subframe)
{
// check for eNB only !
return(get_nCCE(3,&PHY_vars_eNB_g[Mod_id][CC_id]->lte_frame_parms,1)); // 5, 15,21
return(get_nCCE(num_pdcch_symbols,
&PHY_vars_eNB_g[Mod_id][CC_id]->lte_frame_parms,
get_mi(&PHY_vars_eNB_g[Mod_id][CC_id]->lte_frame_parms,subframe)));
}
int get_nCCE_offset_l1(int *CCE_table,
const unsigned char L,
const int nCCE,
const int common_dci,
const unsigned short rnti,
const unsigned char subframe)
{
int search_space_free,m,nb_candidates = 0,l,i;
unsigned int Yk;
/*
printf("CCE Allocation: ");
for (i=0;i<nCCE;i++)
printf("%d.",CCE_table[i]);
printf("\n");
*/
if (common_dci == 1) {
// check CCE(0 ... L-1)
nb_candidates = (L==4) ? 4 : 2;
nb_candidates = min(nb_candidates,nCCE/L);
// printf("Common DCI nb_candidates %d, L %d\n",nb_candidates,L);
for (m = nb_candidates-1 ; m >=0 ; m--) {
search_space_free = 1;
for (l=0; l<L; l++) {
// printf("CCE_table[%d] %d\n",(m*L)+l,CCE_table[(m*L)+l]);
if (CCE_table[(m*L) + l] == 1) {
search_space_free = 0;
break;
}
}
if (search_space_free == 1) {
// printf("returning %d\n",m*L);
for (l=0; l<L; l++)
CCE_table[(m*L)+l]=1;
return(m*L);
}
}
return(-1);
} else { // Find first available in ue specific search space
// according to procedure in Section 9.1.1 of 36.213 (v. 8.6)
// compute Yk
Yk = (unsigned int)rnti;
for (i=0; i<=subframe; i++)
Yk = (Yk*39827)%65537;
Yk = Yk % (nCCE/L);
switch (L) {
case 1:
case 2:
nb_candidates = 6;
break;
case 4:
case 8:
nb_candidates = 2;
break;
default:
DevParam(L, nCCE, rnti);
break;
}
LOG_D(MAC,"rnti %x, Yk = %d, nCCE %d (nCCE/L %d),nb_cand %d\n",rnti,Yk,nCCE,nCCE/L,nb_candidates);
for (m = 0 ; m < nb_candidates ; m++) {
search_space_free = 1;
for (l=0; l<L; l++) {
if (CCE_table[(((Yk+m)%(nCCE/L))*L) + l] == 1) {
search_space_free = 0;
break;
}
}
if (search_space_free == 1) {
for (l=0; l<L; l++)
CCE_table[(((Yk+m)%(nCCE/L))*L)+l]=1;
return(((Yk+m)%(nCCE/L))*L);
}
}
return(-1);
}
}
void dci_decoding_procedure0(LTE_UE_PDCCH **lte_ue_pdcch_vars,
int do_common,
uint8_t subframe,
......@@ -2691,7 +2794,7 @@ void dci_decoding_procedure0(LTE_UE_PDCCH **lte_ue_pdcch_vars,
dci_alloc[*dci_cnt].dci_length = sizeof_bits;
dci_alloc[*dci_cnt].rnti = crc;
dci_alloc[*dci_cnt].L = L;
dci_alloc[*dci_cnt].nCCE = CCEind;
dci_alloc[*dci_cnt].firstCCE = CCEind;
if (sizeof_bytes<=4) {
dci_alloc[*dci_cnt].dci_pdu[3] = dci_decoded_output[0];
......
......@@ -453,7 +453,7 @@ uint32_t conv_1C_RIV(int32_t rballoc,uint32_t N_RB_DL) {
}
int get_prb(int N_RB_DL,int odd_slot,int vrb,int Ngap) {
uint32_t get_prb(int N_RB_DL,int odd_slot,int vrb,int Ngap) {
int offset;
......@@ -926,10 +926,15 @@ int generate_eNB_dlsch_params_from_dci(int frame,
// printf("FDD 1A: mcs %d, rballoc %x,rv %d, NPRB %d\n",mcs,rballoc,rv,NPRB);
}
dlsch0_harq = dlsch[0]->harq_processes[harq_pid];
dlsch0_harq->rb_alloc[0] = localRIV2alloc_LUT6[rballoc];
if (vrb_type==LOCALIZED) {
dlsch0_harq->rb_alloc[0] = localRIV2alloc_LUT6[rballoc];
}
else {
LOG_E(PHY,"Distributed RB allocation not done yet\n");
mac_xface->macphy_exit("exiting");
}
dlsch0_harq->vrb_type = vrb_type;
dlsch0_harq->nb_rb = RIV2nb_rb_LUT6[rballoc];//NPRB;
RIV_max = RIV_max6;
......@@ -960,7 +965,14 @@ int generate_eNB_dlsch_params_from_dci(int frame,
dlsch0_harq = dlsch[0]->harq_processes[harq_pid];
dlsch0_harq->rb_alloc[0] = localRIV2alloc_LUT25[rballoc];
if (vrb_type==LOCALIZED) {
dlsch0_harq->rb_alloc[0] = localRIV2alloc_LUT25[rballoc];
}
else {
LOG_E(PHY,"Distributed RB allocation not done yet\n");
mac_xface->macphy_exit("exiting");
}
dlsch0_harq->vrb_type = vrb_type;
dlsch0_harq->nb_rb = RIV2nb_rb_LUT25[rballoc];//NPRB;
RIV_max = RIV_max25;
......@@ -987,9 +999,16 @@ int generate_eNB_dlsch_params_from_dci(int frame,
}
dlsch0_harq = dlsch[0]->harq_processes[harq_pid];
if (vrb_type==LOCALIZED) {
dlsch0_harq->rb_alloc[0] = localRIV2alloc_LUT50_0[rballoc];
dlsch0_harq->rb_alloc[1] = localRIV2alloc_LUT50_1[rballoc];
}
else {
LOG_E(PHY,"Distributed RB allocation not done yet\n");
mac_xface->macphy_exit("exiting");
}
dlsch0_harq->rb_alloc[0] = localRIV2alloc_LUT50_0[rballoc];
dlsch0_harq->rb_alloc[1] = localRIV2alloc_LUT50_1[rballoc];
dlsch0_harq->vrb_type = vrb_type;
dlsch0_harq->nb_rb = RIV2nb_rb_LUT50[rballoc];//NPRB;
RIV_max = RIV_max50;
......@@ -1017,10 +1036,17 @@ int generate_eNB_dlsch_params_from_dci(int frame,
dlsch0_harq = dlsch[0]->harq_processes[harq_pid];
dlsch0_harq->vrb_type = vrb_type;
dlsch0_harq->rb_alloc[0] = localRIV2alloc_LUT100_0[rballoc];
dlsch0_harq->rb_alloc[1] = localRIV2alloc_LUT100_1[rballoc];
dlsch0_harq->rb_alloc[2] = localRIV2alloc_LUT100_2[rballoc];
dlsch0_harq->rb_alloc[3] = localRIV2alloc_LUT100_3[rballoc];
if (vrb_type==LOCALIZED) {
dlsch0_harq->rb_alloc[0] = localRIV2alloc_LUT100_0[rballoc];
dlsch0_harq->rb_alloc[1] = localRIV2alloc_LUT100_1[rballoc];
dlsch0_harq->rb_alloc[2] = localRIV2alloc_LUT100_2[rballoc];
dlsch0_harq->rb_alloc[3] = localRIV2alloc_LUT100_3[rballoc];
}
else {
LOG_E(PHY,"Distributed RB allocation not done yet\n");
mac_xface->macphy_exit("exiting");
}
dlsch0_harq->nb_rb = RIV2nb_rb_LUT100[rballoc];//NPRB;
......@@ -2682,17 +2708,17 @@ int generate_eNB_dlsch_params_from_dci(int frame,
#ifdef DEBUG_DCI
if (dlsch0) {
msg("dlsch0 eNB: dlsch0 %p\n",dlsch0);
msg("dlsch0 eNB: rnti %x\n",dlsch0->rnti);
msg("dlsch0 eNB: NBRB %d\n",dlsch0_harq->nb_rb);
msg("dlsch0 eNB: rballoc %x\n",dlsch0_harq->rb_alloc[0]);
msg("dlsch0 eNB: harq_pid %d\n",harq_pid);
msg("dlsch0 eNB: round %d\n",dlsch0_harq->round);
msg("dlsch0 eNB: rvidx %d\n",dlsch0_harq->rvidx);
msg("dlsch0 eNB: TBS %d (NPRB %d)\n",dlsch0_harq->TBS,NPRB);
msg("dlsch0 eNB: mcs %d\n",dlsch0_harq->mcs);
msg("dlsch0 eNB: tpmi %d\n",tpmi);
msg("dlsch0 eNB: mimo_mode %d\n",dlsch0_harq->mimo_mode);
printf("dlsch0 eNB: dlsch0 %p\n",dlsch0);
printf("dlsch0 eNB: rnti %x\n",dlsch0->rnti);
printf("dlsch0 eNB: NBRB %d\n",dlsch0_harq->nb_rb);
printf("dlsch0 eNB: rballoc %x\n",dlsch0_harq->rb_alloc[0]);
printf("dlsch0 eNB: harq_pid %d\n",harq_pid);
printf("dlsch0 eNB: round %d\n",dlsch0_harq->round);
printf("dlsch0 eNB: rvidx %d\n",dlsch0_harq->rvidx);
printf("dlsch0 eNB: TBS %d (NPRB %d)\n",dlsch0_harq->TBS,NPRB);
printf("dlsch0 eNB: mcs %d\n",dlsch0_harq->mcs);
printf("dlsch0 eNB: tpmi %d\n",tpmi);
printf("dlsch0 eNB: mimo_mode %d\n",dlsch0_harq->mimo_mode);
}
#endif
......@@ -5549,15 +5575,15 @@ int generate_ue_dlsch_params_from_dci(int frame,
#ifdef DEBUG_DCI
if (dlsch[0]) {
msg("PDSCH dlsch0 UE: rnti %x\n",dlsch[0]->rnti);
msg("PDSCH dlsch0 UE: NBRB %d\n",dlsch0_harq->nb_rb);
msg("PDSCH dlsch0 UE: rballoc %x\n",dlsch0_harq->rb_alloc[0]);
msg("PDSCH dlsch0 UE: harq_pid %d\n",harq_pid);
msg("PDSCH dlsch0 UE: DCINdi %d\n",dlsch0_harq->DCINdi);
msg("PDSCH dlsch0 UE: rvidx %d\n",dlsch0_harq->rvidx);
msg("PDSCH dlsch0 UE: TBS %d\n",dlsch0_harq->TBS);
msg("PDSCH dlsch0 UE: mcs %d\n",dlsch0_harq->mcs);
msg("PDSCH dlsch0 UE: pwr_off %d\n",dlsch0_harq->dl_power_off);
printf("PDSCH dlsch0 UE: rnti %x\n",dlsch[0]->rnti);
printf("PDSCH dlsch0 UE: NBRB %d\n",dlsch0_harq->nb_rb);
printf("PDSCH dlsch0 UE: rballoc %x\n",dlsch0_harq->rb_alloc_even[0]);
printf("PDSCH dlsch0 UE: harq_pid %d\n",harq_pid);
printf("PDSCH dlsch0 UE: DCINdi %d\n",dlsch0_harq->DCINdi);
printf("PDSCH dlsch0 UE: rvidx %d\n",dlsch0_harq->rvidx);
printf("PDSCH dlsch0 UE: TBS %d\n",dlsch0_harq->TBS);
printf("PDSCH dlsch0 UE: mcs %d\n",dlsch0_harq->mcs);
printf("PDSCH dlsch0 UE: pwr_off %d\n",dlsch0_harq->dl_power_off);
}
#endif
......
......@@ -273,6 +273,8 @@ typedef struct {
uint8_t Mdlharq;
/// MIMO transmission mode indicator for this sub-frame (for definition see 36-212 V8.6 2009-03, p.17)
uint8_t Kmimo;
/// Nsoft parameter related to UE Category
uint32_t Nsoft;
/// amplitude of PDSCH (compared to RS) in symbols without pilots
int16_t sqrt_rho_a;
/// amplitude of PDSCH (compared to RS) in symbols containing pilots
......@@ -583,13 +585,13 @@ typedef struct {
/// UL RSSI per receive antenna
int32_t UL_rssi[NB_ANTENNAS_RX];
/// PUCCH1a/b power (digital linear)
int32_t Po_PUCCH;
uint32_t Po_PUCCH;
/// PUCCH1a/b power (dBm)
int32_t Po_PUCCH_dBm;
/// PUCCH1 power (digital linear), conditioned on below threshold
int32_t Po_PUCCH1_below;
uint32_t Po_PUCCH1_below;
/// PUCCH1 power (digital linear), conditioned on above threshold
int32_t Po_PUCCH1_above;
uint32_t Po_PUCCH1_above;
/// Indicator that Po_PUCCH has been updated by PHY
int32_t Po_PUCCH_update;
/// DL Wideband CQI index (2 TBs)
......@@ -700,6 +702,8 @@ typedef struct {
uint8_t Mdlharq;
/// MIMO transmission mode indicator for this sub-frame (for definition see 36-212 V8.6 2009-03, p.17)
uint8_t Kmimo;
/// Nsoft parameter related to UE Category
uint32_t Nsoft;
/// Maximum number of Turbo iterations
uint8_t max_turbo_iterations;
/// accumulated tx power adjustment for PUCCH
......@@ -744,7 +748,7 @@ typedef struct {
/// Aggregation level
uint8_t L;
/// Position of first CCE of the dci
int nCCE;
int firstCCE;
/// flag to indicate that this is a RA response
boolean_t ra_flag;
/// rnti
......
......@@ -117,7 +117,7 @@ void free_eNB_dlsch(LTE_eNB_DLSCH_t *dlsch)
}
LTE_eNB_DLSCH_t *new_eNB_dlsch(unsigned char Kmimo,unsigned char Mdlharq,unsigned char N_RB_DL, uint8_t abstraction_flag)
LTE_eNB_DLSCH_t *new_eNB_dlsch(unsigned char Kmimo,unsigned char Mdlharq,uint32_t Nsoft,unsigned char N_RB_DL, uint8_t abstraction_flag)
{
LTE_eNB_DLSCH_t *dlsch;
......@@ -148,6 +148,7 @@ LTE_eNB_DLSCH_t *new_eNB_dlsch(unsigned char Kmimo,unsigned char Mdlharq,unsigne
bzero(dlsch,sizeof(LTE_eNB_DLSCH_t));
dlsch->Kmimo = Kmimo;
dlsch->Mdlharq = Mdlharq;
dlsch->Nsoft = Nsoft;
for (i=0; i<10; i++)
dlsch->harq_ids[i] = Mdlharq;
......@@ -400,7 +401,7 @@ int dlsch_encoding(unsigned char *a,
dlsch->harq_processes[harq_pid]->w[r],
dlsch->harq_processes[harq_pid]->e+r_offset,
dlsch->harq_processes[harq_pid]->C, // C
NSOFT, // Nsoft,
dlsch->Nsoft, // Nsoft,
dlsch->Mdlharq,
dlsch->Kmimo,
dlsch->harq_processes[harq_pid]->rvidx,
......
......@@ -81,7 +81,7 @@ void free_ue_dlsch(LTE_UE_DLSCH_t *dlsch)
}
}
LTE_UE_DLSCH_t *new_ue_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint8_t max_turbo_iterations,uint8_t N_RB_DL, uint8_t abstraction_flag)
LTE_UE_DLSCH_t *new_ue_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint32_t Nsoft,uint8_t max_turbo_iterations,uint8_t N_RB_DL, uint8_t abstraction_flag)
{
LTE_UE_DLSCH_t *dlsch;
......@@ -113,6 +113,7 @@ LTE_UE_DLSCH_t *new_ue_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint8_t max_turbo_ite
memset(dlsch,0,sizeof(LTE_UE_DLSCH_t));
dlsch->Kmimo = Kmimo;
dlsch->Mdlharq = Mdlharq;
dlsch->Nsoft = Nsoft;
dlsch->max_turbo_iterations = max_turbo_iterations;
for (i=0; i<Mdlharq; i++) {
......@@ -353,7 +354,7 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue,
(uint8_t*)&dummy_w[r][0],
dlsch_llr+r_offset,
harq_process->C,
NSOFT,
dlsch->Nsoft,
dlsch->Mdlharq,
dlsch->Kmimo,
harq_process->rvidx,
......
......@@ -662,14 +662,16 @@ int dlsch_qpsk_llr(LTE_DL_FRAME_PARMS *frame_parms,
if ((symbol_mod==0) || (symbol_mod==(4-frame_parms->Ncp))) {
if (frame_parms->mode1_flag==0)
len = (nb_rb*8)- (2*pbch_pss_sss_adjust/3);
len = (nb_rb*8) - (2*pbch_pss_sss_adjust/3);
else
len = (nb_rb*10) - (5*pbch_pss_sss_adjust/6);
} else {
len = (nb_rb*12) - pbch_pss_sss_adjust;
}
// printf("dlsch_qpsk_llr: symbol %d,nb_rb %d, len %d,pbch_pss_sss_adjust %d\n",symbol,nb_rb,len,pbch_pss_sss_adjust);
for (i=0; i<len; i++) {
*llr32 = *rxF;
// printf("llr %d : (%d,%d)\n",i,((int16_t*)llr32)[0],((int16_t*)llr32)[1]);
......
......@@ -574,12 +574,18 @@ int dump_eNB_stats(PHY_VARS_eNB *phy_vars_eNB, char* buffer, int length)
phy_vars_eNB->PHY_measurements_eNB[eNB].n0_power_dB[0],
phy_vars_eNB->PHY_measurements_eNB[eNB].n0_power_dB[1]);
len += sprintf(&buffer[len],"[eNB PROC] Subband I0: ");
len += sprintf(&buffer[len],"[eNB PROC] PRB I0 (%X.%X.%X.%X): ",
phy_vars_eNB->rb_mask_ul[0],
phy_vars_eNB->rb_mask_ul[1],phy_vars_eNB->rb_mask_ul[2],phy_vars_eNB->rb_mask_ul[3]);
for (i=0; i<25; i++)
len += sprintf(&buffer[len],"%2d ",
phy_vars_eNB->PHY_measurements_eNB[eNB].n0_subband_power_tot_dB[i]);
for (i=0; i<phy_vars_eNB->lte_frame_parms.N_RB_UL; i++) {
len += sprintf(&buffer[len],"%4d ",
phy_vars_eNB->PHY_measurements_eNB[eNB].n0_subband_power_tot_dBm[i]);
if ((i>0) && ((i%25) == 0))
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[eNB PROC] PERFORMANCE PARAMETERS\n");
/*
......@@ -635,11 +641,11 @@ int dump_eNB_stats(PHY_VARS_eNB *phy_vars_eNB, char* buffer, int length)
dB_fixed(phy_vars_eNB->lte_eNB_pusch_vars[UE_id]->ulsch_power[1]),
phy_vars_eNB->eNB_UE_stats[UE_id].UL_rssi[0],
phy_vars_eNB->eNB_UE_stats[UE_id].UL_rssi[1],
dB_fixed(phy_vars_eNB->eNB_UE_stats[UE_id].Po_PUCCH)-phy_vars_eNB->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,
dB_fixed(phy_vars_eNB->eNB_UE_stats[UE_id].Po_PUCCH1_below)-phy_vars_eNB->rx_total_gain_eNB_dB,
dB_fixed(phy_vars_eNB->eNB_UE_stats[UE_id].Po_PUCCH1_above)-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),
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),
phy_vars_eNB->eNB_UE_stats[UE_id].sector);
for(i=0; i<8; i++)
......
......@@ -56,15 +56,16 @@ void free_eNB_dlsch(LTE_eNB_DLSCH_t *dlsch);
void clean_eNb_dlsch(LTE_eNB_DLSCH_t *dlsch, uint8_t abstraction_flag);
/** \fn new_eNB_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint8_t abstraction_flag)
/** \fn new_eNB_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint32_t Nsoft,uint8_t abstraction_flag)
\brief This function allocates structures for a particular DLSCH at eNB
@returns Pointer to DLSCH to be removed
@param Kmimo Kmimo factor from 36-212/36-213
@param Mdlharq Maximum number of HARQ rounds (36-212/36-213)
@param Nsoft Soft-LLR buffer size from UE-Category
@params N_RB_DL total number of resource blocks (determine the operating BW)
@param abstraction_flag Flag to indicate abstracted interface
*/
LTE_eNB_DLSCH_t *new_eNB_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint8_t N_RB_DL, uint8_t abstraction_flag);
LTE_eNB_DLSCH_t *new_eNB_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint32_t Nsoft,uint8_t N_RB_DL, uint8_t abstraction_flag);
/** \fn free_ue_dlsch(LTE_UE_DLSCH_t *dlsch)
\brief This function frees memory allocated for a particular DLSCH at UE
......@@ -72,11 +73,16 @@ LTE_eNB_DLSCH_t *new_eNB_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint8_t N_RB_DL, ui
*/
void free_ue_dlsch(LTE_UE_DLSCH_t *dlsch);
LTE_eNB_ULSCH_t *new_eNB_ulsch(uint8_t Mdlharq,uint8_t max_turbo_iterations,uint8_t N_RB_UL, uint8_t abstraction_flag);
LTE_UE_DLSCH_t *new_ue_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint8_t max_turbo_iterations,uint8_t N_RB_DL, uint8_t abstraction_flag);
LTE_UE_ULSCH_t *new_ue_ulsch(unsigned char Mdlharq,unsigned char N_RB_UL, uint8_t abstraction_flag);
/** \fn new_ue_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint32_t Nsoft,uint8_t abstraction_flag)
\brief This function allocates structures for a particular DLSCH at eNB
@returns Pointer to DLSCH to be removed
@param Kmimo Kmimo factor from 36-212/36-213
@param Mdlharq Maximum number of HARQ rounds (36-212/36-213)
@param Nsoft Soft-LLR buffer size from UE-Category
@params N_RB_DL total number of resource blocks (determine the operating BW)
@param abstraction_flag Flag to indicate abstracted interface
*/
LTE_UE_DLSCH_t *new_ue_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint32_t Nsoft,uint8_t max_turbo_iterations,uint8_t N_RB_DL, uint8_t abstraction_flag);
void clean_eNb_ulsch(LTE_eNB_ULSCH_t *ulsch, uint8_t abstraction_flag);
......@@ -1233,11 +1239,20 @@ uint32_t get_TBS_DL(uint8_t mcs, uint16_t nb_rb);
uint32_t get_TBS_UL(uint8_t mcs, uint16_t nb_rb);
/* \brief Return bit-map of resource allocation for a given DCI rballoc (RIV format) and vrb type
@param N_RB_DL number of PRB on DL
@param indicator for even/odd slot
@param vrb vrb index
@param Ngap Gap indicator
*/
uint32_t get_prb(int N_RB_DL,int odd_slot,int vrb,int Ngap);
/* \brief Return prb for a given vrb index
@param vrb_type VRB type (0=localized,1=distributed)
@param rb_alloc_dci rballoc field from DCI
*/
uint32_t get_rballoc(vrb_t vrb_type,uint16_t rb_alloc_dci);
/* \brief Return bit-map of resource allocation for a given DCI rballoc (RIV format) and vrb type
@returns Transmission mode (1-7)
*/
......@@ -1577,6 +1592,12 @@ uint16_t computeRIV(uint16_t N_RB_DL,uint16_t RBstart,uint16_t Lcrbs);
uint32_t pmi_extend(LTE_DL_FRAME_PARMS *frame_parms,uint8_t wideband_pmi);
int get_nCCE_offset_l1(int *CCE_table,
const unsigned char L,
const int nCCE,
const int common_dci,
const unsigned short rnti,
const unsigned char subframe);
uint16_t get_nCCE(uint8_t num_pdcch_symbols,LTE_DL_FRAME_PARMS *frame_parms,uint8_t mi);
......@@ -1584,7 +1605,7 @@ uint16_t get_nquad(uint8_t num_pdcch_symbols,LTE_DL_FRAME_PARMS *frame_parms,uin
uint8_t get_mi(LTE_DL_FRAME_PARMS *frame,uint8_t subframe);
uint16_t get_nCCE_max(uint8_t Mod_id,uint8_t CC_id);
uint16_t get_nCCE_mac(uint8_t Mod_id,uint8_t CC_id,int num_pdcch_symbols,int subframe);
uint8_t get_num_pdcch_symbols(uint8_t num_dci,DCI_ALLOC_t *dci_alloc,LTE_DL_FRAME_PARMS *frame_parms,uint8_t subframe);
......@@ -1637,22 +1658,22 @@ void generate_pucch_emul(PHY_VARS_UE *phy_vars_ue,
uint8_t subframe);
int32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB,
PUCCH_FMT_t fmt,
uint8_t UE_id,
uint16_t n1_pucch,
uint16_t n2_pucch,
uint8_t shortened_format,
uint8_t *payload,
uint8_t subframe,
uint8_t pucch1_thres);
uint32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB,
PUCCH_FMT_t fmt,
uint8_t UE_id,
uint16_t n1_pucch,
uint16_t n2_pucch,
uint8_t shortened_format,
uint8_t *payload,
uint8_t subframe,
uint8_t pucch1_thres);
int32_t rx_pucch_emul(PHY_VARS_eNB *phy_vars_eNB,
uint8_t UE_index,
PUCCH_FMT_t fmt,
uint8_t n1_pucch_sel,
uint8_t *payload,
uint8_t subframe);
uint8_t UE_index,
PUCCH_FMT_t fmt,
uint8_t n1_pucch_sel,
uint8_t *payload,
uint8_t subframe);
/*!
......
This diff is collapsed.
......@@ -1657,8 +1657,15 @@ void rx_ulsch(PHY_VARS_eNB *phy_vars_eNB,
}
} else {
for (i=0; i<frame_parms->nb_antennas_rx; i++) {
/*
eNB_pusch_vars->ulsch_power[i] = signal_energy_nodc(eNB_pusch_vars->drs_ch_estimates[eNB_id][i],
ulsch[UE_id]->harq_processes[harq_pid]->nb_rb*12)*rx_power_correction;
*/
eNB_pusch_vars->ulsch_power[i] = signal_energy_nodc(eNB_pusch_vars->drs_ch_estimates[eNB_id][i],
ulsch[UE_id]->harq_processes[harq_pid]->nb_rb*12);
#ifdef LOCALIZATION
eNB_pusch_vars->subcarrier_power = (int32_t *)malloc(ulsch[UE_id]->harq_processes[harq_pid]->nb_rb*12*sizeof(int32_t));
eNB_pusch_vars->active_subcarrier = subcarrier_energy(eNB_pusch_vars->drs_ch_estimates[eNB_id][i],
......
......@@ -119,7 +119,7 @@ FD_lte_phy_scope_enb *create_lte_phy_scope_enb( void )
fl_set_xyplot_xgrid( fdui->pusch_llr,FL_GRID_MAJOR);
// I/Q PUCCH comp (format 1)
fdui->pucch_comp1 = fl_add_xyplot( FL_POINTS_XYPLOT, 540, 480, 240, 100, "PUCCH I/Q of MF Output" );
fdui->pucch_comp1 = fl_add_xyplot( FL_POINTS_XYPLOT, 540, 480, 240, 100, "PUCCH1 Energy (SR)" );
fl_set_object_boxtype( fdui->pucch_comp1, FL_EMBOSSED_BOX );
fl_set_object_color( fdui->pucch_comp1, FL_BLACK, FL_YELLOW );
fl_set_object_lcolor( fdui->pucch_comp1, FL_WHITE ); // Label color
......@@ -160,7 +160,7 @@ void phy_scope_eNB(FD_lte_phy_scope_enb *form,
int UE_id)
{
int eNB_id = 0;
int i,arx,atx,ind,k;
int i,i2,arx,atx,ind,k;
LTE_DL_FRAME_PARMS *frame_parms = &phy_vars_enb->lte_frame_parms;
int nsymb_ce = 12*frame_parms->N_RB_UL*frame_parms->symbols_per_tti;
uint8_t nb_antennas_rx = frame_parms->nb_antennas_rx;
......@@ -171,15 +171,17 @@ void phy_scope_eNB(FD_lte_phy_scope_enb *form,
int16_t *pusch_llr;
int16_t *pusch_comp;
int32_t *pucch1_comp;
int16_t *pucch1ab_comp;
int32_t *pucch1_thres;
int32_t *pucch1ab_comp;
float Re,Im,ymax;
float *llr, *bit;
float I[nsymb_ce*2], Q[nsymb_ce*2];
float I_pucch[10240],Q_pucch[10240],A_pucch[10240],B_pucch[10240];
float I_pucch[10240],Q_pucch[10240],A_pucch[10240],B_pucch[10240],C_pucch[10240];
float rxsig_t_dB[nb_antennas_rx][FRAME_LENGTH_COMPLEX_SAMPLES];
float chest_t_abs[nb_antennas_rx][frame_parms->ofdm_symbol_size];
float *chest_f_abs;
float time[FRAME_LENGTH_COMPLEX_SAMPLES];
float time2[2048];
float freq[nsymb_ce*nb_antennas_rx*nb_antennas_tx];
int frame = phy_vars_enb->proc[0].frame_tx;
uint32_t total_dlsch_bitrate = phy_vars_enb->total_dlsch_bitrate;
......@@ -206,7 +208,8 @@ void phy_scope_eNB(FD_lte_phy_scope_enb *form,
pusch_llr = (int16_t*) phy_vars_enb->lte_eNB_pusch_vars[UE_id]->llr;
pusch_comp = (int16_t*) phy_vars_enb->lte_eNB_pusch_vars[UE_id]->rxdataF_comp[eNB_id][0];
pucch1_comp = (int32_t*) phy_vars_enb->pucch1_stats[UE_id];
pucch1ab_comp = (int16_t*) phy_vars_enb->pucch1ab_stats[UE_id];
pucch1_thres = (int32_t*) phy_vars_enb->pucch1_stats_thres[UE_id];
pucch1ab_comp = (int32_t*) phy_vars_enb->pucch1ab_stats[UE_id];
// Received signal in time domain of receive antenna 0
if (rxsig_t != NULL) {
......@@ -236,19 +239,21 @@ void phy_scope_eNB(FD_lte_phy_scope_enb *form,
if (chest_t[0] !=NULL) {
for (i=0; i<(frame_parms->ofdm_symbol_size); i++) {
chest_t_abs[0][i] = 10*log10((float) (chest_t[0][2*i]*chest_t[0][2*i]+chest_t[0][2*i+1]*chest_t[0][2*i+1]));
i2 = (i+(frame_parms->ofdm_symbol_size>>1))%frame_parms->ofdm_symbol_size;
time2[i] = (float)(i-(frame_parms->ofdm_symbol_size>>1));
chest_t_abs[0][i] = 10*log10((float) (1+chest_t[0][2*i2]*chest_t[0][2*i2]+chest_t[0][2*i2+1]*chest_t[0][2*i2+1]));
if (chest_t_abs[0][i] > ymax)
ymax = chest_t_abs[0][i];
}
fl_set_xyplot_data(form->chest_t,time,chest_t_abs[0],(frame_parms->ofdm_symbol_size),"","","");
fl_set_xyplot_data(form->chest_t,time2,chest_t_abs[0],(frame_parms->ofdm_symbol_size),"","","");
}
for (arx=1; arx<nb_antennas_rx; arx++) {
if (chest_t[arx] !=NULL) {
for (i=0; i<(frame_parms->ofdm_symbol_size>>3); i++) {
chest_t_abs[arx][i] = 10*log10((float) (chest_t[arx][2*i]*chest_t[arx][2*i]+chest_t[arx][2*i+1]*chest_t[arx][2*i+1]));
chest_t_abs[arx][i] = 10*log10((float) (1+chest_t[arx][2*i]*chest_t[arx][2*i]+chest_t[arx][2*i+1]*chest_t[arx][2*i+1]));
if (chest_t_abs[arx][i] > ymax)
ymax = chest_t_abs[arx][i];
......@@ -337,16 +342,20 @@ void phy_scope_eNB(FD_lte_phy_scope_enb *form,
// PUSCH I/Q of MF Output
if (pucch1ab_comp!=NULL) {
for (ind=0; ind<10240; ind++) {
I_pucch[ind] = pucch1ab_comp[2*ind];
Q_pucch[ind] = pucch1ab_comp[2*ind+1];
I_pucch[ind] = (float)pucch1ab_comp[2*(ind)];
Q_pucch[ind] = (float)pucch1ab_comp[2*(ind)+1];
A_pucch[ind] = 10*log10(pucch1_comp[ind]);
B_pucch[ind] = ind;
C_pucch[ind] = (float)pucch1_thres[ind];
}
fl_set_xyplot_data(form->pucch_comp,I_pucch,Q_pucch,10240,"","","");
fl_set_xyplot_data(form->pucch_comp1,B_pucch,A_pucch,1024,"","","");
fl_set_xyplot_xbounds(form->pucch_comp,-200,200);
fl_set_xyplot_ybounds(form->pucch_comp,-100,100);
fl_set_xyplot_ybounds(form->pucch_comp1,10,40);
fl_add_xyplot_overlay(form->pucch_comp1,1,B_pucch,C_pucch,1024,FL_RED);
fl_set_xyplot_ybounds(form->pucch_comp,-5000,5000);
fl_set_xyplot_xbounds(form->pucch_comp,-5000,5000);
fl_set_xyplot_ybounds(form->pucch_comp1,20,80);
}
......
......@@ -76,6 +76,13 @@
#define openair_free(y,x) free((y))
#define PAGE_SIZE 4096
//#ifdef SHRLIBDEV
//extern int rxrescale;
//#define RX_IQRESCALELEN rxrescale
//#else
//#define RX_IQRESCALELEN 15
//#endif
//! \brief Allocate \c size bytes of memory on the heap with alignment 16 and zero it afterwards.
//! If no more memory is available, this function will terminate the program with an assertion error.
static inline void* malloc16_clear( size_t size )
......@@ -313,6 +320,8 @@ typedef struct PHY_VARS_eNB_s {
struct PhysicalConfigDedicated *physicalConfigDedicated[NUMBER_OF_UE_MAX];
uint32_t rb_mask_ul[4];
/// Information regarding TM5
MU_MIMO_mode mu_mimo_mode[NUMBER_OF_UE_MAX];
......@@ -374,12 +383,13 @@ typedef struct PHY_VARS_eNB_s {
#ifdef LOCALIZATION
/// time state for localization
time_stats_t localization_stats;
#endif
#endif
int32_t pucch1_stats_cnt[NUMBER_OF_UE_MAX][10];
int32_t pucch1_stats[NUMBER_OF_UE_MAX][10*1024];
int32_t pucch1_stats_thres[NUMBER_OF_UE_MAX][10*1024];
int32_t pucch1ab_stats_cnt[NUMBER_OF_UE_MAX][10];
int32_t pucch1ab_stats[NUMBER_OF_UE_MAX][10*1024];
int32_t pucch1ab_stats[NUMBER_OF_UE_MAX][2*10*1024];
#if ENABLE_RAL
hash_table_t *ral_thresholds_timed;
......
......@@ -44,7 +44,14 @@
/** @defgroup _ref_implementation_ OpenAirInterface LTE Implementation
* @{
* @defgroup _PHY_RF_INTERFACE_ Generic PHY - RF Interface
* @defgroup _PHY_RF_INTERFACE_ PHY - RF Interface
* @ingroup _PHY_RF_INTERFACE_
* @{
* @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
* @}
*
* @ingroup _ref_implementation_
* @{
* This module is responsible for defining the generic interface between PHY and RF Target
......@@ -339,13 +346,12 @@ typedef struct {
#define NUMBER_OF_SUBBANDS_MAX 13
#define NUMBER_OF_HARQ_PID_MAX 8
#if defined(CBMIMO1) || defined(EXMIMO) || defined(OAI_USRP)
#define MAX_FRAME_NUMBER 0x400
#if defined(CBMIMO1) || defined(EXMIMO) || defined(OAI_USRP)
#define NUMBER_OF_eNB_MAX 1
#define NUMBER_OF_UE_MAX 4
#define NUMBER_OF_CONNECTED_eNB_MAX 3
#else
#define MAX_FRAME_NUMBER 0xFFFF
#ifdef LARGE_SCALE
#define NUMBER_OF_eNB_MAX 2
#define NUMBER_OF_UE_MAX 120
......@@ -470,13 +476,13 @@ typedef struct {
//! estimated avg noise power (dB)
short n0_power_tot_dBm;
//! estimated avg noise power per RB per RX ant (lin)
unsigned short n0_subband_power[NB_ANTENNAS_RX][25];
unsigned short n0_subband_power[NB_ANTENNAS_RX][100];
//! estimated avg noise power per RB per RX ant (dB)
unsigned short n0_subband_power_dB[NB_ANTENNAS_RX][25];
unsigned short n0_subband_power_dB[NB_ANTENNAS_RX][100];
//! estimated avg noise power per RB (dB)
short n0_subband_power_tot_dB[25];
short n0_subband_power_tot_dB[100];
//! estimated avg noise power per RB (dBm)
short n0_subband_power_tot_dBm[25];
short n0_subband_power_tot_dBm[100];
// eNB measurements (per user)
//! estimated received spatial signal power (linear)
unsigned int rx_spatial_power[NUMBER_OF_UE_MAX][2][2];
......@@ -496,13 +502,13 @@ typedef struct {
/// Wideband CQI (sum of all RX antennas, in dB)
char wideband_cqi_tot[NUMBER_OF_UE_MAX];
/// Subband CQI per RX antenna and RB (= SINR)
int subband_cqi[NUMBER_OF_UE_MAX][NB_ANTENNAS_RX][25];
int subband_cqi[NUMBER_OF_UE_MAX][NB_ANTENNAS_RX][100];
/// Total Subband CQI and RB (= SINR)
int subband_cqi_tot[NUMBER_OF_UE_MAX][25];
int subband_cqi_tot[NUMBER_OF_UE_MAX][100];
/// Subband CQI in dB and RB (= SINR dB)
int subband_cqi_dB[NUMBER_OF_UE_MAX][NB_ANTENNAS_RX][25];
int subband_cqi_dB[NUMBER_OF_UE_MAX][NB_ANTENNAS_RX][100];
/// Total Subband CQI and RB
int subband_cqi_tot_dB[NUMBER_OF_UE_MAX][25];
int subband_cqi_tot_dB[NUMBER_OF_UE_MAX][100];
} PHY_MEASUREMENTS_eNB;
......
......@@ -399,7 +399,6 @@ uint32_t pdcch_alloc2ul_frame(LTE_DL_FRAME_PARMS *frame_parms,uint32_t frame, ui
uint16_t get_Np(uint8_t N_RB_DL,uint8_t nCCE,uint8_t plus1);
int get_nCCE_offset(unsigned char L, int nCCE, int common_dci, unsigned short rnti, unsigned char subframe);
void put_harq_pid_in_freelist(LTE_eNB_DLSCH_t *DLSCH_ptr, int harq_pid);
void remove_harq_pid_from_freelist(LTE_eNB_DLSCH_t *DLSCH_ptr, int harq_pid);
......
......@@ -405,8 +405,8 @@ uint8_t get_ack(LTE_DL_FRAME_PARMS *frame_parms,
if (harq_ack[0].send_harq_status == 1)
o_ACK[1] = harq_ack[0].ack;
} else if (harq_ack[8].send_harq_status == 1)
o_ACK[0] = harq_ack[8].ack;
} else if (harq_ack[0].send_harq_status == 1)
o_ACK[0] = harq_ack[0].ack;
status = harq_ack[9].send_harq_status + (harq_ack[0].send_harq_status<<1);
//printf("Subframe 4, TDD config 3: harq_ack[9] = %d,harq_ack[0] = %d\n",harq_ack[9].ack,harq_ack[0].ack);
......
This diff is collapsed.
......@@ -168,7 +168,7 @@ void dump_dlsch_SI(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t subframe)
1,
phy_vars_ue->lte_ue_pdcch_vars[eNB_id]->num_pdcch_symbols,
phy_vars_ue->frame_rx,subframe);
LOG_I(PHY,"[UE %d] Dumping dlsch_SI : ofdm_symbol_size %d, nsymb %d, nb_rb %d, mcs %d, nb_rb %d, num_pdcch_symbols %d,G %d\n",
LOG_D(PHY,"[UE %d] Dumping dlsch_SI : ofdm_symbol_size %d, nsymb %d, nb_rb %d, mcs %d, nb_rb %d, num_pdcch_symbols %d,G %d\n",
phy_vars_ue->Mod_id,
phy_vars_ue->lte_frame_parms.ofdm_symbol_size,
nsymb,
......@@ -2063,9 +2063,9 @@ int lte_ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *phy_vars_ue,uint8_t abst
#endif
#ifdef DEBUG_PHY_PROC
//#ifdef DEBUG_PHY_PROC
LOG_D(PHY,"[UE %d] Frame %d, slot %d, Mode %s: DCI found %i\n",phy_vars_ue->Mod_id,frame_rx,slot_rx,mode_string[phy_vars_ue->UE_mode[eNB_id]],dci_cnt);
#endif
//#endif
phy_vars_ue->lte_ue_pdcch_vars[eNB_id]->dci_received += dci_cnt;
/*
......@@ -2103,10 +2103,10 @@ int lte_ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *phy_vars_ue,uint8_t abst
#ifdef DEBUG_PHY_PROC
if (subframe_rx == 9) { //( frame_rx % 100 == 0) {
// if (subframe_rx == 9) { //( frame_rx % 100 == 0) {
LOG_D(PHY,"frame %d, subframe %d, rnti %x: dci %d/%d\n",frame_rx,subframe_rx,phy_vars_ue->lte_ue_pdcch_vars[eNB_id]->crnti,i,dci_cnt);
//dump_dci(&phy_vars_ue->lte_frame_parms, &dci_alloc_rx[i]);
}
// }
#endif
......@@ -2446,7 +2446,7 @@ int phy_procedures_UE_RX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstrac
else
openair_daq_vars.use_ia_receiver = (openair_daq_vars.use_ia_receiver+1)%3;
LOG_I(PHY,"[MYEMOS] frame %d, IA receiver %d, MCS %d, bitrate %d\n",
LOG_D(PHY,"[MYEMOS] frame %d, IA receiver %d, MCS %d, bitrate %d\n",
frame_rx,
openair_daq_vars.use_ia_receiver,
phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[phy_vars_ue->dlsch_ue[eNB_id][0]->current_harq_pid]->mcs,
......@@ -2624,13 +2624,13 @@ int phy_procedures_UE_RX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstrac
phy_vars_ue->dlsch_ue[eNB_id][0]->active = 0;
#ifdef DEBUG_PHY_PROC
//#ifdef DEBUG_PHY_PROC
LOG_D(PHY,"[UE %d][PDSCH %x/%d] Frame %d subframe %d Scheduling DLSCH decoding\n",
phy_vars_ue->Mod_id,
phy_vars_ue->dlsch_ue[eNB_id][0]->rnti,
harq_pid,
(subframe_prev == 9) ? (frame_rx-1) : frame_rx,subframe_prev);
#endif
//#endif
if (phy_vars_ue->dlsch_ue[eNB_id][0]) {
if (abstraction_flag == 0) {
......@@ -2676,17 +2676,18 @@ int phy_procedures_UE_RX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstrac
if (ret == (1+phy_vars_ue->dlsch_ue[eNB_id][0]->max_turbo_iterations)) {
phy_vars_ue->dlsch_errors[eNB_id]++;
#ifdef DEBUG_PHY_PROC
LOG_D(PHY,"[UE %d][PDSCH %x/%d] Frame %d subframe %d DLSCH in error (rv %d,mcs %d)\n",
//#ifdef DEBUG_PHY_PROC
LOG_D(PHY,"[UE %d][PDSCH %x/%d] Frame %d subframe %d DLSCH in error (rv %d,mcs %d,TBS %d)\n",
phy_vars_ue->Mod_id,phy_vars_ue->dlsch_ue[eNB_id][0]->rnti,
harq_pid,frame_rx,subframe_prev,
phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->rvidx,
phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->mcs);
phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->mcs,
phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->TBS);
// if (abstraction_flag ==0 )
//dump_dlsch(phy_vars_ue,eNB_id,subframe_prev,harq_pid);
//mac_xface->macphy_exit("");
#endif
dump_dlsch(phy_vars_ue,eNB_id,subframe_prev,harq_pid);
mac_xface->macphy_exit("");
//#endif
} else {
LOG_D(PHY,"[UE %d][PDSCH %x/%d] Frame %d subframe %d (slot_rx %d): Received DLSCH (rv %d,mcs %d,TBS %d)\n",
phy_vars_ue->Mod_id,phy_vars_ue->dlsch_ue[eNB_id][0]->rnti,
......@@ -2801,7 +2802,7 @@ int phy_procedures_UE_RX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstrac
frame_rx,subframe_prev);
#ifdef DEBUG_PHY_PROC
LOG_I(PHY,"Decoding DLSCH_SI : rb_alloc %x : nb_rb %d G %d TBS %d, num_pdcch_sym %d\n",phy_vars_ue->dlsch_ue_SI[eNB_id]->harq_processes[0]->rb_alloc_even[0],
LOG_D(PHY,"Decoding DLSCH_SI : rb_alloc %x : nb_rb %d G %d TBS %d, num_pdcch_sym %d\n",phy_vars_ue->dlsch_ue_SI[eNB_id]->harq_processes[0]->rb_alloc_even[0],
phy_vars_ue->dlsch_ue_SI[eNB_id]->harq_processes[0]->nb_rb,
phy_vars_ue->dlsch_ue_SI[eNB_id]->harq_processes[0]->G,
phy_vars_ue->dlsch_ue_SI[eNB_id]->harq_processes[0]->TBS,
......@@ -2849,7 +2850,7 @@ int phy_procedures_UE_RX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstrac
if (ret == (1+phy_vars_ue->dlsch_ue_SI[eNB_id]->max_turbo_iterations)) {
phy_vars_ue->dlsch_SI_errors[eNB_id]++;
#ifdef DEBUG_PHY_PROC
LOG_I(PHY,"[UE %d] Frame %d, subframe %d, received SI in error (TBS %d, mcs %d, rvidx %d, rballoc %X.%X.%X.%X\n",
LOG_D(PHY,"[UE %d] Frame %d, subframe %d, received SI in error (TBS %d, mcs %d, rvidx %d, rballoc %X.%X.%X.%X\n",
phy_vars_ue->Mod_id,
frame_rx,
subframe_prev,
......@@ -3282,7 +3283,7 @@ int phy_procedures_UE_RX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstrac
}
if (is_pmch_subframe((subframe_rx==9?-1:0)+frame_rx,subframe_rx,&phy_vars_ue->lte_frame_parms)) {
LOG_I(PHY,"ue calling pmch subframe ..\n ");
LOG_D(PHY,"ue calling pmch subframe ..\n ");
if ((slot_rx%2)==1) {
LOG_D(PHY,"[UE %d] Frame %d, subframe %d: Querying for PMCH demodulation(%d)\n",
......@@ -3430,7 +3431,7 @@ int phy_procedures_UE_RX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstrac
phy_vars_rn->sync_area[subframe_rx] = sync_area; // this could also go the harq data struct
phy_vars_rn->dlsch_rn_MCH[subframe_rx]->harq_processes[0]->TBS = phy_vars_ue->dlsch_ue_MCH[0]->harq_processes[0]->TBS;
phy_vars_rn->dlsch_rn_MCH[subframe_rx]->harq_processes[0]->mcs = phy_vars_ue->dlsch_ue_MCH[0]->harq_processes[0]->mcs;
LOG_I(PHY,"[RN/UE %d] Frame %d subframe %d: store the MCH PDU for MBSFN sync area %d (MCS %d, TBS %d)\n",
LOG_D(PHY,"[RN/UE %d] Frame %d subframe %d: store the MCH PDU for MBSFN sync area %d (MCS %d, TBS %d)\n",
phy_vars_ue->Mod_id, frame_rx,subframe_rx,sync_area,
phy_vars_rn->dlsch_rn_MCH[subframe_rx]->harq_processes[0]->mcs,
phy_vars_rn->dlsch_rn_MCH[subframe_rx]->harq_processes[0]->TBS>>3);
......
......@@ -184,15 +184,15 @@ int main(int argc, char **argv)
unsigned int ret;
unsigned int coded_bits_per_codeword=0,nsymb,dci_cnt,tbs=0;
unsigned int tx_lev=0,tx_lev_dB=0,trials,errs[4]= {0,0,0,0},errs2[4]= {0,0,0,0},round_trials[4]= {0,0,0,0},dci_errors=0,dlsch_active=0,num_layers;
unsigned int tx_lev=0,tx_lev_dB=0,trials,errs[4]= {0,0,0,0},errs2[4]= {0,0,0,0},round_trials[4]= {0,0,0,0},dci_errors=0,dlsch_active=0;//,num_layers;
int re_allocated;
char fname[32],vname[32];
FILE *bler_fd;
char bler_fname[256];
FILE *time_meas_fd;
char time_meas_fname[256];
FILE *tikz_fd;
char tikz_fname[256];
// FILE *tikz_fd;
// char tikz_fname[256];
FILE *input_trch_fd=NULL;
unsigned char input_trch_file=0;
......@@ -218,7 +218,7 @@ int main(int argc, char **argv)
uint8_t rx_sample_offset = 0;
//char stats_buffer[4096];
//int len;
uint8_t num_rounds = 4,fix_rounds=0;
uint8_t num_rounds = 4;//,fix_rounds=0;
uint8_t subframe=7;
int u;
int n=0;
......@@ -232,8 +232,8 @@ int main(int argc, char **argv)
// void *data;
// int ii;
int bler;
double blerr[4],uncoded_ber,avg_ber;
// int bler;
double blerr[4],uncoded_ber;//,avg_ber;
short *uncoded_ber_bit=NULL;
uint8_t N_RB_DL=25,osf=1;
frame_t frame_type = FDD;
......@@ -248,7 +248,7 @@ int main(int argc, char **argv)
int common_flag=0,TPC=0;
double cpu_freq_GHz;
time_stats_t ts;//,sts,usts;
// time_stats_t ts;//,sts,usts;
int avg_iter,iter_trials;
int rballocset=0;
int print_perf=0;
......@@ -262,17 +262,24 @@ int main(int argc, char **argv)
int TB0_active = 1;
uint32_t perfect_ce = 0;
LTE_DL_UE_HARQ_t *dlsch0_ue_harq;
LTE_DL_eNB_HARQ_t *dlsch0_eNB_harq;
// LTE_DL_UE_HARQ_t *dlsch0_ue_harq;
// LTE_DL_eNB_HARQ_t *dlsch0_eNB_harq;
uint8_t Kmimo;
FILE *proc_fd = NULL;
char buf[64];
uint8_t ue_category=4;
uint32_t Nsoft;
int CCE_table[800];
int threequarter_fs=0;
opp_enabled=1; // to enable the time meas
#if defined(__arm__)
FILE *proc_fd = NULL;
char buf[64];
proc_fd = fopen("/sys/devices/system/cpu/cpu4/cpufreq/cpuinfo_cur_freq", "r");
if(!proc_fd)
printf("cannot open /sys/devices/system/cpu/cpu4/cpufreq/cpuinfo_cur_freq");
......@@ -295,7 +302,7 @@ int main(int argc, char **argv)
// default parameters
n_frames = 1000;
snr0 = 0;
num_layers = 1;
// num_layers = 1;
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) {
......@@ -478,14 +485,12 @@ int main(int argc, char **argv)
case 'N':
channel_model=AWGN;
break;
default:
msg("Unsupported channel model!\n");
exit(-1);
}
break;
case 'R':
num_rounds=atoi(optarg);
break;
......@@ -915,10 +920,27 @@ int main(int argc, char **argv)
else
Kmimo=1;
switch (ue_category) {
case 1:
Nsoft = 250368;
break;
case 2:
case 3:
Nsoft = 1237248;
break;
case 4:
Nsoft = 1827072;
break;
default:
printf("Unsupported UE category %d\n",ue_category);
exit(-1);
break;
}
for (k=0; k<n_users; k++) {
// Create transport channel structures for 2 transport blocks (MIMO)
for (i=0; i<2; i++) {
PHY_vars_eNB->dlsch_eNB[k][i] = new_eNB_dlsch(Kmimo,8,N_RB_DL,0);
PHY_vars_eNB->dlsch_eNB[k][i] = new_eNB_dlsch(Kmimo,8,Nsoft,N_RB_DL,0);
if (!PHY_vars_eNB->dlsch_eNB[k][i]) {
printf("Can't get eNB dlsch structures\n");
......@@ -930,7 +952,7 @@ int main(int argc, char **argv)
}
for (i=0; i<2; i++) {
PHY_vars_UE->dlsch_ue[0][i] = new_ue_dlsch(Kmimo,8,MAX_TURBO_ITERATIONS,N_RB_DL,0);
PHY_vars_UE->dlsch_ue[0][i] = new_ue_dlsch(Kmimo,8,Nsoft,MAX_TURBO_ITERATIONS,N_RB_DL,0);
if (!PHY_vars_UE->dlsch_ue[0][i]) {
printf("Can't get ue dlsch structures\n");
......@@ -941,7 +963,7 @@ int main(int argc, char **argv)
}
// structure for SIC at UE
PHY_vars_UE->dlsch_eNB[0] = new_eNB_dlsch(Kmimo,8,N_RB_DL,0);
PHY_vars_UE->dlsch_eNB[0] = new_eNB_dlsch(Kmimo,8,Nsoft,N_RB_DL,0);
if (DLSCH_alloc_pdu2_1E[0].tpmi == 5) {
......@@ -1228,7 +1250,7 @@ int main(int argc, char **argv)
dci_alloc[num_dci].L = 1;
dci_alloc[num_dci].rnti = SI_RNTI;
dci_alloc[num_dci].format = format1A;
dci_alloc[num_dci].nCCE = 0;
dci_alloc[num_dci].firstCCE = 0;
dump_dci(&PHY_vars_eNB->lte_frame_parms,&dci_alloc[num_dci]);
printf("Generating dlsch params for user %d\n",k);
......@@ -1535,7 +1557,7 @@ int main(int argc, char **argv)
dci_alloc[num_dci].L = 1;
dci_alloc[num_dci].rnti = SI_RNTI;
dci_alloc[num_dci].format = format1A;
dci_alloc[num_dci].nCCE = 0;
dci_alloc[num_dci].firstCCE = 0;
dump_dci(&PHY_vars_eNB->lte_frame_parms,&dci_alloc[num_dci]);
printf("Generating dlsch params for user %d\n",k);
......@@ -1843,7 +1865,7 @@ int main(int argc, char **argv)
dci_alloc[num_dci].L = 1;
dci_alloc[num_dci].rnti = SI_RNTI;
dci_alloc[num_dci].format = format1A;
dci_alloc[num_dci].nCCE = 0;
dci_alloc[num_dci].firstCCE = 0;
dump_dci(&PHY_vars_eNB->lte_frame_parms,&dci_alloc[num_dci]);
printf("Generating dlsch params for user %d\n",k);
......@@ -1874,7 +1896,7 @@ int main(int argc, char **argv)
dci_alloc[num_dci].L = 1;
dci_alloc[num_dci].rnti = n_rnti+k;
dci_alloc[num_dci].format = format1E_2A_M10PRB;
dci_alloc[num_dci].nCCE = 4*k;
dci_alloc[num_dci].firstCCE = 4*k;
printf("Generating dlsch params for user %d\n",k);
generate_eNB_dlsch_params_from_dci(0,
subframe,
......@@ -1919,17 +1941,20 @@ int main(int argc, char **argv)
if (n_frames==1) printf("%d\n",numCCE);
// apply RNTI-based nCCE allocation
memset(CCE_table,0,800*sizeof(int));
for (i=num_common_dci; i<num_dci; i++) {
dci_alloc[i].nCCE = get_nCCE_offset(1<<dci_alloc[i].L,
numCCE,
(dci_alloc[i].rnti==SI_RNTI)? 1 : 0,
dci_alloc[i].rnti,
subframe);
dci_alloc[i].firstCCE = get_nCCE_offset_l1(CCE_table,
1<<dci_alloc[i].L,
numCCE,
(dci_alloc[i].rnti==SI_RNTI)? 1 : 0,
dci_alloc[i].rnti,
subframe);
if (n_frames==1)
printf("dci %d: rnti %x, format %d : nCCE %d/%d\n",i,dci_alloc[i].rnti, dci_alloc[i].format,
dci_alloc[i].nCCE,numCCE);
dci_alloc[i].firstCCE,numCCE);
}
for (k=0; k<n_users; k++) {
......@@ -2012,7 +2037,7 @@ int main(int argc, char **argv)
round_trials[3] = 0;
dci_errors=0;
avg_ber = 0;
// avg_ber = 0;
round=0;
avg_iter = 0;
......@@ -2597,15 +2622,15 @@ PMI_FEEDBACK:
}
start_meas(&PHY_vars_eNB->dlsch_modulation_stats);
re_allocated = dlsch_modulation(PHY_vars_eNB->lte_eNB_common_vars.txdataF[eNB_id],
AMP,
subframe,
&PHY_vars_eNB->lte_frame_parms,
num_pdcch_symbols,
PHY_vars_eNB->dlsch_eNB[k][0],
PHY_vars_eNB->dlsch_eNB[k][1]);
PHY_vars_eNB->dlsch_eNB[k][1]);
stop_meas(&PHY_vars_eNB->dlsch_modulation_stats);
/*
if (trials==0 && round==0)
......
......@@ -56,15 +56,15 @@ PHY_VARS_UE *PHY_vars_UE;
#define UL_RB_ALLOC 0x1ff;
#define CCCH_RB_ALLOC computeRIV(PHY_vars_eNB->lte_frame_parms.N_RB_UL,0,2)
#define DLSCH_RB_ALLOC 0x1fbf // igore DC component,RB13
#define DLSCH_RB_ALLOC ((uint16_t)0x1fbf) // igore DC component,RB13
DCI_PDU DCI_pdu;
DCI_PDU *get_dci(LTE_DL_FRAME_PARMS *lte_frame_parms,uint8_t log2L, uint8_t log2Lcommon, uint8_t format_selector, uint32_t rnti)
{
uint8_t BCCH_alloc_pdu[8];
uint8_t DLSCH_alloc_pdu[8];
uint8_t UL_alloc_pdu[8];
uint32_t BCCH_alloc_pdu[2];
uint32_t DLSCH_alloc_pdu[2];
uint32_t UL_alloc_pdu[2];
int i;
int dci_length_bytes,dci_length;
......@@ -370,31 +370,35 @@ DCI_PDU *get_dci(LTE_DL_FRAME_PARMS *lte_frame_parms,uint8_t log2L, uint8_t log2
DCI_pdu.dci_alloc[0].ra_flag = 0;
memcpy((void*)&DCI_pdu.dci_alloc[0].dci_pdu[0], &BCCH_alloc_pdu[0], BCCH_pdu_size_bytes);
DCI_pdu.Num_common_dci++;
/*
if (lte_frame_parms->N_RB_DL >= 25) {
// add ue specific dci
DCI_pdu.dci_alloc[1].dci_length = dci_length;
DCI_pdu.dci_alloc[1].L = log2L;
DCI_pdu.dci_alloc[1].rnti = rnti;
DCI_pdu.dci_alloc[1].format = format1;
DCI_pdu.dci_alloc[1].ra_flag = 0;
memcpy((void*)&DCI_pdu.dci_alloc[1].dci_pdu[0], &DLSCH_alloc_pdu[0], dci_length_bytes);
DCI_pdu.Num_ue_spec_dci++;
DCI_pdu.dci_alloc[0].dci_length = UL_pdu_size_bits;
DCI_pdu.dci_alloc[0].L = log2L;
DCI_pdu.dci_alloc[0].rnti = rnti;
DCI_pdu.dci_alloc[0].format = format0;
DCI_pdu.dci_alloc[0].ra_flag = 0;
memcpy((void*)&DCI_pdu.dci_alloc[0].dci_pdu[0], &UL_alloc_pdu[0], UL_pdu_size_bytes);
DCI_pdu.Num_ue_spec_dci++;
*/
DCI_pdu.dci_alloc[1].dci_length = dci_length;
DCI_pdu.dci_alloc[1].L = log2L;
DCI_pdu.dci_alloc[1].rnti = rnti;
DCI_pdu.dci_alloc[1].format = format1;
DCI_pdu.dci_alloc[1].ra_flag = 0;
memcpy((void*)&DCI_pdu.dci_alloc[1].dci_pdu[0], &DLSCH_alloc_pdu[0], dci_length_bytes);
DCI_pdu.Num_ue_spec_dci++;
if (lte_frame_parms->N_RB_DL >= 50) {
DCI_pdu.dci_alloc[2].dci_length = UL_pdu_size_bits;
DCI_pdu.dci_alloc[2].L = log2L;
DCI_pdu.dci_alloc[2].rnti = rnti;
DCI_pdu.dci_alloc[2].format = format0;
DCI_pdu.dci_alloc[2].ra_flag = 0;
memcpy((void*)&DCI_pdu.dci_alloc[0].dci_pdu[0], &UL_alloc_pdu[0], UL_pdu_size_bytes);
DCI_pdu.Num_ue_spec_dci++;
}
}
DCI_pdu.nCCE = 0;
for (i=0; i<DCI_pdu.Num_common_dci+DCI_pdu.Num_ue_spec_dci; i++) {
DCI_pdu.nCCE += (1<<(DCI_pdu.dci_alloc[i].L));
}
return(&DCI_pdu);
}
......@@ -431,10 +435,8 @@ int main(int argc, char **argv)
uint8_t dci_cnt=0;
LTE_DL_FRAME_PARMS *frame_parms;
uint8_t log2L=2, log2Lcommon=2, format_selector=0;
uint8_t numCCE,nCCE_max,common_active=0,ul_active=0,dl_active=0;
uint32_t rv;
uint8_t numCCE,common_active=0,ul_active=0,dl_active=0;
DCI_format_t format = format1;
uint32_t n_trials_common=0,n_trials_ul=0,n_trials_dl=0,false_detection_cnt=0;
uint8_t common_rx,ul_rx,dl_rx;
uint8_t tdd_config=3;
......@@ -448,19 +450,19 @@ int main(int argc, char **argv)
DCI_ALLOC_t dci_alloc_rx[8];
void* dlsch_pdu = NULL;
// int ret;
int ret;
uint8_t harq_pid;
uint8_t phich_ACK;
uint8_t num_phich_interf = 0;
lte_frame_type_t frame_type=TDD;
int re_offset;
uint32_t *txptr;
// int re_offset;
// uint32_t *txptr;
int aarx;
int k;
uint32_t perfect_ce = 0;
int CCE_table[800];
number_of_cards = 1;
openair_daq_vars.rx_rf_mode = 1;
......@@ -785,7 +787,7 @@ int main(int argc, char **argv)
i=0;
while (!feof(input_fd)) {
fscanf(input_fd,"%s %s",input_val_str,input_val_str2);//&input_val1,&input_val2);
ret=fscanf(input_fd,"%s %s",input_val_str,input_val_str2);//&input_val1,&input_val2);
if ((i%4)==0) {
((short*)txdata[0])[i/2] = (short)((1<<15)*strtod(input_val_str,NULL));
......@@ -812,7 +814,7 @@ int main(int argc, char **argv)
PHY_vars_UE->UE_mode[0] = PUSCH;
nCCE_max = get_nCCE(3,&PHY_vars_eNB->lte_frame_parms,get_mi(&PHY_vars_eNB->lte_frame_parms,0));
// nCCE_max = get_nCCE(3,&PHY_vars_eNB->lte_frame_parms,get_mi(&PHY_vars_eNB->lte_frame_parms,0));
//printf("nCCE_max %d\n",nCCE_max);
//printf("num_phich interferers %d\n",num_phich_interf);
......@@ -864,55 +866,62 @@ int main(int argc, char **argv)
numCCE=0;
n_trials_common++;
common_active = 1;
n_trials_ul++;
ul_active = 1;
n_trials_dl++;
dl_active = 1;
if (PHY_vars_eNB->lte_frame_parms.N_RB_DL >= 50) {
n_trials_ul++;
ul_active = 1;
}
if (PHY_vars_eNB->lte_frame_parms.N_RB_DL >= 25) {
n_trials_dl++;
dl_active = 1;
}
init_nCCE_table();
num_pdcch_symbols = get_num_pdcch_symbols(DCI_pdu.Num_common_dci+DCI_pdu.Num_ue_spec_dci,
DCI_pdu.dci_alloc, frame_parms, subframe);
DCI_pdu.nCCE = get_nCCE(num_pdcch_symbols,&PHY_vars_eNB->lte_frame_parms,get_mi(&PHY_vars_eNB->lte_frame_parms,subframe));
numCCE = get_nCCE(num_pdcch_symbols,&PHY_vars_eNB->lte_frame_parms,get_mi(&PHY_vars_eNB->lte_frame_parms,subframe));
if (n_frames==1) {
printf("num_dci %d, num_pddch_symbols %d, nCCE %d\n",
DCI_pdu.Num_common_dci+DCI_pdu.Num_ue_spec_dci,
num_pdcch_symbols,
DCI_pdu.nCCE);
num_pdcch_symbols,numCCE);
}
// apply RNTI-based nCCE allocation
memset(CCE_table,0,800*sizeof(int));
for (i = 0; i < DCI_pdu.Num_common_dci + DCI_pdu.Num_ue_spec_dci; i++) {
// SI RNTI
if (DCI_pdu.dci_alloc[i].rnti == SI_RNTI) {
DCI_pdu.dci_alloc[i].nCCE = get_nCCE_offset(1<<DCI_pdu.dci_alloc[i].L,
DCI_pdu.nCCE,
1,
SI_RNTI,
subframe);
DCI_pdu.dci_alloc[i].firstCCE = get_nCCE_offset_l1(CCE_table,
1<<DCI_pdu.dci_alloc[i].L,
numCCE,
1,
SI_RNTI,
subframe);
}
// RA RNTI
else if (DCI_pdu.dci_alloc[i].ra_flag == 1) {
DCI_pdu.dci_alloc[i].nCCE = get_nCCE_offset(1<<DCI_pdu.dci_alloc[i].L,
DCI_pdu.nCCE,
1,
DCI_pdu.dci_alloc[i].rnti,
subframe);
DCI_pdu.dci_alloc[i].firstCCE = get_nCCE_offset_l1(CCE_table,
1<<DCI_pdu.dci_alloc[i].L,
numCCE,
1,
DCI_pdu.dci_alloc[i].rnti,
subframe);
}
// C RNTI
else {
DCI_pdu.dci_alloc[i].nCCE = get_nCCE_offset(1<<DCI_pdu.dci_alloc[i].L,
DCI_pdu.nCCE,
0,
DCI_pdu.dci_alloc[i].rnti,
subframe);
DCI_pdu.dci_alloc[i].firstCCE = get_nCCE_offset_l1(CCE_table,
1<<DCI_pdu.dci_alloc[i].L,
numCCE,
0,
DCI_pdu.dci_alloc[i].rnti,
subframe);
}
if (n_frames==1)
printf("dci %d: rnti 0x%x, format %d, L %d, nCCE %d/%d dci_length %d\n",i,DCI_pdu.dci_alloc[i].rnti, DCI_pdu.dci_alloc[i].format,
DCI_pdu.dci_alloc[i].L, DCI_pdu.dci_alloc[i].nCCE, DCI_pdu.nCCE, DCI_pdu.dci_alloc[i].dci_length);
DCI_pdu.dci_alloc[i].L, DCI_pdu.dci_alloc[i].firstCCE, numCCE, DCI_pdu.dci_alloc[i].dci_length);
if (DCI_pdu.dci_alloc[i].nCCE==-1)
if (DCI_pdu.dci_alloc[i].firstCCE==-1)
exit(-1);
}
......@@ -946,7 +955,7 @@ int main(int argc, char **argv)
generate_phich_top(PHY_vars_eNB,
subframe,AMP,0,0);
/*
// generate 3 interfering PHICH
if (num_phich_interf>0) {
PHY_vars_eNB->ulsch_eNB[0]->harq_processes[harq_pid]->first_rb = 4;
......@@ -973,7 +982,7 @@ int main(int argc, char **argv)
}
PHY_vars_eNB->ulsch_eNB[0]->harq_processes[harq_pid]->first_rb = 0;
*/
}
// write_output("pilotsF.m","rsF",txdataF[0],lte_PHY_vars_eNB->lte_frame_parms.ofdm_symbol_size,1,1);
......@@ -1153,7 +1162,7 @@ int main(int argc, char **argv)
for (i = 0; i < dci_cnt; i++)
printf("dci %d: rnti 0x%x, format %d, L %d, nCCE %d/%d dci_length %d\n",i, dci_alloc_rx[i].rnti, dci_alloc_rx[i].format,
dci_alloc_rx[i].L, dci_alloc_rx[i].nCCE, numCCE, dci_alloc_rx[i].dci_length);
dci_alloc_rx[i].L, dci_alloc_rx[i].firstCCE, numCCE, dci_alloc_rx[i].dci_length);
}
for (i=0; i<dci_cnt; i++) {
......@@ -1228,8 +1237,8 @@ int main(int argc, char **argv)
} //trials
printf("SNR %f : n_errors_common = %d/%d (%e)\n", SNR,n_errors_common,n_trials_common,(double)n_errors_common/n_trials_common);
printf("SNR %f : n_errors_ul = %d/%d (%e)\n", SNR,n_errors_ul,n_trials_ul,(double)n_errors_ul/n_trials_ul);
printf("SNR %f : n_errors_dl = %d/%d (%e)\n", SNR,n_errors_dl,n_trials_dl,(double)n_errors_dl/n_trials_dl);
if (ul_active==1) printf("SNR %f : n_errors_ul = %d/%d (%e)\n", SNR,n_errors_ul,n_trials_ul,(double)n_errors_ul/n_trials_ul);
if (dl_active==1) printf("SNR %f : n_errors_dl = %d/%d (%e)\n", SNR,n_errors_dl,n_trials_dl,(double)n_errors_dl/n_trials_dl);
printf("SNR %f : n_errors_cfi = %d/%d (%e)\n", SNR,n_errors_cfi,trial,(double)n_errors_cfi/trial);
printf("SNR %f : n_errors_hi = %d/%d (%e)\n", SNR,n_errors_hi,trial,(double)n_errors_hi/trial);
......
......@@ -192,7 +192,7 @@ int main(int argc, char **argv)
break;
default:
msg("Unsupported channel model!\n");
printf("Unsupported channel model!\n");
exit(-1);
}
......@@ -204,13 +204,13 @@ int main(int argc, char **argv)
case 's':
snr0 = atof(optarg);
msg("Setting SNR0 to %f\n",snr0);
printf("Setting SNR0 to %f\n",snr0);
break;
case 'S':
snr1 = atof(optarg);
snr1set=1;
msg("Setting SNR1 to %f\n",snr1);
printf("Setting SNR1 to %f\n",snr1);
break;
case 'p':
......@@ -233,7 +233,7 @@ int main(int argc, char **argv)
if ((transmission_mode!=1) &&
(transmission_mode!=2) &&
(transmission_mode!=6)) {
msg("Unsupported transmission mode %d\n",transmission_mode);
printf("Unsupported transmission mode %d\n",transmission_mode);
exit(-1);
}
......@@ -243,7 +243,7 @@ int main(int argc, char **argv)
n_tx=atoi(optarg);
if ((n_tx==0) || (n_tx>2)) {
msg("Unsupported number of tx antennas %d\n",n_tx);
printf("Unsupported number of tx antennas %d\n",n_tx);
exit(-1);
}
......@@ -253,7 +253,7 @@ int main(int argc, char **argv)
n_rx=atoi(optarg);
if ((n_rx==0) || (n_rx>2)) {
msg("Unsupported number of rx antennas %d\n",n_rx);
printf("Unsupported number of rx antennas %d\n",n_rx);
exit(-1);
}
......@@ -367,7 +367,7 @@ int main(int argc, char **argv)
msg("[SIM] Using SCM/101\n");
printf("[SIM] Using SCM/101\n");
UE2eNB = new_channel_desc_scm(PHY_vars_eNB->lte_frame_parms.nb_antennas_tx,
PHY_vars_UE->lte_frame_parms.nb_antennas_rx,
channel_model,
......@@ -379,7 +379,7 @@ int main(int argc, char **argv)
if (UE2eNB==NULL) {
msg("Problem generating channel model. Exiting.\n");
printf("Problem generating channel model. Exiting.\n");
exit(-1);
}
......@@ -407,7 +407,7 @@ int main(int argc, char **argv)
PHY_vars_UE->lte_frame_parms.pucch_config_common.nRB_CQI = 0;
PHY_vars_UE->lte_frame_parms.pucch_config_common.nCS_AN = 0;
pucch_payload = 1;
pucch_payload = 0;
generate_pucch(PHY_vars_UE->lte_ue_common_vars.txdataF,
frame_parms,
......@@ -550,9 +550,7 @@ int main(int argc, char **argv)
}
}
lte_eNB_I0_measurements(PHY_vars_eNB,
0,
1);
for (i=0; i<2*nsymb*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES; i++) {
for (aa=0; aa<PHY_vars_eNB->lte_frame_parms.nb_antennas_rx; aa++) {
......@@ -600,6 +598,10 @@ int main(int argc, char **argv)
// if (sig == 1)
// printf("*");
lte_eNB_I0_measurements(PHY_vars_eNB,
subframe,
0,
1);
PHY_vars_eNB->PHY_measurements_eNB[0].n0_power_tot_dB = N0;//(int8_t)(sigma2_dB-10*log10(PHY_vars_eNB->lte_frame_parms.ofdm_symbol_size/(12*NB_RB)));
stat = rx_pucch(PHY_vars_eNB,
pucch_format,
......
......@@ -97,7 +97,7 @@ int main(int argc, char **argv)
int aarx,aatx;
double channelx,channely;
double sigma2, sigma2_dB=10,SNR,SNR2,snr0=-2.0,snr1,SNRmeas,rate,saving_bler;
double sigma2, sigma2_dB=10,SNR,SNR2,snr0=-2.0,snr1,SNRmeas,rate,saving_bler=0;
double input_snr_step=.2,snr_int=30;
double blerr;
......@@ -126,7 +126,7 @@ int main(int argc, char **argv)
unsigned int coded_bits_per_codeword,nsymb;
int subframe=3;
unsigned int tx_lev=0,tx_lev_dB,trials,errs[4]= {0,0,0,0},round_trials[4]= {0,0,0,0};
uint8_t transmission_mode=1,n_rx=1,n_tx=1;
uint8_t transmission_mode=1,n_rx=1;
FILE *bler_fd=NULL;
char bler_fname[512];
......@@ -341,10 +341,6 @@ int main(int argc, char **argv)
exit(-1);
}
if (transmission_mode>1) {
n_tx = 1;
}
break;
case 'y':
......@@ -645,8 +641,8 @@ int main(int argc, char **argv)
// Create transport channel structures for 2 transport blocks (MIMO)
for (i=0; i<2; i++) {
PHY_vars_eNB->dlsch_eNB[0][i] = new_eNB_dlsch(1,8,N_RB_DL,0);
PHY_vars_UE->dlsch_ue[0][i] = new_ue_dlsch(1,8,MAX_TURBO_ITERATIONS,N_RB_DL,0);
PHY_vars_eNB->dlsch_eNB[0][i] = new_eNB_dlsch(1,8,1827072,N_RB_DL,0);
PHY_vars_UE->dlsch_ue[0][i] = new_ue_dlsch(1,8,1827072,MAX_TURBO_ITERATIONS,N_RB_DL,0);
if (!PHY_vars_eNB->dlsch_eNB[0][i]) {
printf("Can't get eNB dlsch structures\n");
......@@ -661,7 +657,7 @@ int main(int argc, char **argv)
PHY_vars_eNB->dlsch_eNB[0][i]->rnti = 14;
PHY_vars_UE->dlsch_ue[0][i]->rnti = 14;
}
}
switch (PHY_vars_eNB->lte_frame_parms.N_RB_UL) {
......@@ -849,11 +845,11 @@ int main(int argc, char **argv)
harq_pid = subframe2harq_pid(&PHY_vars_UE->lte_frame_parms,PHY_vars_UE->frame_tx,subframe);
input_buffer_length = PHY_vars_UE->ulsch_ue[0]->harq_processes[harq_pid]->TBS/8;
input_buffer = (unsigned char *)malloc(input_buffer_length+4);
// printf("UL frame %d/subframe %d, harq_pid %d\n",PHY_vars_UE->frame,subframe,harq_pid);
if (input_fdUL == NULL) {
input_buffer_length = PHY_vars_UE->ulsch_ue[0]->harq_processes[harq_pid]->TBS/8;
input_buffer = (unsigned char *)malloc(input_buffer_length+4);
if (n_frames == 1) {
trch_out_fdUL= fopen("ulsch_trchUL.txt","w");
......@@ -875,7 +871,7 @@ int main(int argc, char **argv)
i=0;
while (!feof(input_fdUL)) {
fscanf(input_fdUL,"%s %s",input_val_str,input_val_str2);//&input_val1,&input_val2);
ret=fscanf(input_fdUL,"%s %s",input_val_str,input_val_str2);//&input_val1,&input_val2);
if ((i%4)==0) {
((short*)txdata[0])[i/2] = (short)((1<<15)*strtod(input_val_str,NULL));
......@@ -1205,6 +1201,7 @@ int main(int argc, char **argv)
start_meas(&PHY_vars_eNB->phy_proc_rx);
start_meas(&PHY_vars_eNB->ofdm_demod_stats);
lte_eNB_I0_measurements(PHY_vars_eNB,
subframe,
0,
1);
......
......@@ -163,7 +163,13 @@ typedef uint32_t mbms_session_id_t;
typedef uint16_t mbms_service_id_t;
typedef uint16_t rnti_t;
typedef uint8_t rrc_enb_index_t;
typedef uint8_t mme_code_t;
typedef uint32_t m_tmsi_t;
//Random UE identity length = 40 bits
#if ! defined(NOT_A_RANDOM_UE_IDENTITY)
#define NOT_A_RANDOM_UE_IDENTITY (uint64_t)0xFFFFFFFF
#endif
#if ! defined(NOT_A_RNTI)
#define NOT_A_RNTI (rnti_t)0
#endif
......
......@@ -170,6 +170,14 @@
#define ENB_CONFIG_STRING_ENB_IPV4_ADDR_FOR_S1U "ENB_IPV4_ADDRESS_FOR_S1U"
#define ENB_CONFIG_STRING_ENB_PORT_FOR_S1U "ENB_PORT_FOR_S1U"
#define ENB_CONFIG_STRING_RRH_GW_CONFIG "rrh_gw_config"
#define ENB_CONFIG_STRING_RRH_GW_LOCAL_IF_NAME "local_if_name"
#define ENB_CONFIG_STRING_RRH_GW_LOCAL_ADDRESS "local_address"
#define ENB_CONFIG_STRING_RRH_GW_REMOTE_ADDRESS "remote_address"
#define ENB_CONFIG_STRING_RRH_GW_LOCAL_PORT "local_port"
#define ENB_CONFIG_STRING_RRH_GW_REMOTE_PORT "remote_port"
#define ENB_CONFIG_STRING_RRH_GW_ACTIVE "active"
#define ENB_CONFIG_STRING_RRH_GW_PREFERENCE "preference"
#define ENB_CONFIG_STRING_ASN1_VERBOSITY "Asn1_verbosity"
#define ENB_CONFIG_STRING_ASN1_VERBOSITY_NONE "none"
......@@ -274,6 +282,18 @@ static void enb_config_display(void)
} else {
printf( "\tMNC: \t%02"PRIu16":\n",enb_properties.properties[i]->mnc);
}
for (j=0; j< enb_properties.properties[i]->nb_rrh_gw; j++) {
if (enb_properties.properties[i]->rrh_gw_config[j].active == 1 ){
printf( "\n\tRRH GW %d config for eNB %u:\n\n", j, i);
printf( "\tinterface name : \t%s:\n",enb_properties.properties[i]->rrh_gw_if_name);
printf( "\tlocal address : \t%s:\n",enb_properties.properties[i]->rrh_gw_config[j].local_address);
printf( "\tlocal port : \t%d:\n",enb_properties.properties[i]->rrh_gw_config[j].local_port);
printf( "\tremote address : \t%s:\n",enb_properties.properties[i]->rrh_gw_config[j].remote_address);
printf( "\tremote port : \t%d:\n",enb_properties.properties[i]->rrh_gw_config[j].remote_port);
printf( "\ttransport : \t%s Ethernet:\n\n",(enb_properties.properties[i]->rrh_gw_config[j].raw == 1)? "RAW" : "UDP");
}
}
for (j=0; j< enb_properties.properties[i]->nb_cc; j++) {
printf( "\teutra band for CC %d: \t%"PRId16":\n",j,enb_properties.properties[i]->eutra_band[j]);
......@@ -455,6 +475,8 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP)
config_setting_t *setting_srb1 = NULL;
config_setting_t *setting_mme_addresses = NULL;
config_setting_t *setting_mme_address = NULL;
config_setting_t *setting_rrh_gws = NULL;
config_setting_t *setting_rrh_gw = NULL;
config_setting_t *setting_enb = NULL;
config_setting_t *setting_otg = NULL;
config_setting_t *subsetting_otg = NULL;
......@@ -462,6 +484,7 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP)
int enb_properties_index = 0;
int num_enbs = 0;
int num_mme_address = 0;
int num_rrh_gw = 0;
int num_otg_elements =0;
int num_component_carriers =0;
int i = 0;
......@@ -558,10 +581,15 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP)
libconfig_int my_int;
char* if_name = NULL;
char* ipv4 = NULL;
char* ipv4_remote = NULL;
char* ipv6 = NULL;
char* active = NULL;
char* preference = NULL;
libconfig_int local_port = 0;
libconfig_int remote_port = 0;
const char* active_enb[MAX_ENB];
char* enb_interface_name_for_S1U = NULL;
char* enb_ipv4_address_for_S1U = NULL;
......@@ -2136,6 +2164,63 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP)
enb_properties.properties[enb_properties_index]->mme_ip_address[j].ipv6 = 1;
}
}
// RRH Config
setting_rrh_gws = config_setting_get_member (setting_enb, ENB_CONFIG_STRING_RRH_GW_CONFIG);
if ( setting_rrh_gws != NULL) {
num_rrh_gw = config_setting_length(setting_rrh_gws);
enb_properties.properties[enb_properties_index]->nb_rrh_gw = 0;
for (j = 0; j < num_rrh_gw; j++) {
setting_rrh_gw = config_setting_get_elem(setting_rrh_gws, j);
if ( !(
config_setting_lookup_string(setting_rrh_gw, ENB_CONFIG_STRING_RRH_GW_LOCAL_IF_NAME, (const char **)&if_name)
&& config_setting_lookup_string(setting_rrh_gw, ENB_CONFIG_STRING_RRH_GW_LOCAL_ADDRESS, (const char **)&ipv4)
&& config_setting_lookup_string(setting_rrh_gw, ENB_CONFIG_STRING_RRH_GW_REMOTE_ADDRESS , (const char **)&ipv4_remote)
&& config_setting_lookup_int(setting_rrh_gw, ENB_CONFIG_STRING_RRH_GW_LOCAL_PORT, &local_port)
&& config_setting_lookup_int(setting_rrh_gw, ENB_CONFIG_STRING_RRH_GW_REMOTE_PORT, &remote_port)
&& config_setting_lookup_string(setting_rrh_gw, ENB_CONFIG_STRING_RRH_GW_ACTIVE, (const char **)&active)
&& config_setting_lookup_string(setting_rrh_gw, ENB_CONFIG_STRING_RRH_GW_PREFERENCE, (const char **)&preference)
)
) {
AssertError (0, parse_errors ++,
"Failed to parse eNB configuration file %s, %u th enb %u the RRH GW address !\n",
lib_config_file_name_pP, i, j);
continue; // FIXME will prevent segfaults below, not sure what happens at function exit...
}
enb_properties.properties[enb_properties_index]->nb_rrh_gw += 1;
enb_properties.properties[enb_properties_index]->rrh_gw_if_name = strdup(if_name);
enb_properties.properties[enb_properties_index]->rrh_gw_config[j].local_address = strdup(ipv4);
enb_properties.properties[enb_properties_index]->rrh_gw_config[j].remote_address = strdup(ipv4_remote);
enb_properties.properties[enb_properties_index]->rrh_gw_config[j].local_port= local_port;
enb_properties.properties[enb_properties_index]->rrh_gw_config[j].remote_port= remote_port;
if (strcmp(active, "yes") == 0) {
enb_properties.properties[enb_properties_index]->rrh_gw_config[j].active = 1;
}
if (strcmp(preference, "udp") == 0) {
enb_properties.properties[enb_properties_index]->rrh_gw_config[j].udp = 1;
} else if (strcmp(preference, "raw") == 0) {
enb_properties.properties[enb_properties_index]->rrh_gw_config[j].raw = 1;
} else {//if (strcmp(preference, "no") == 0)
enb_properties.properties[enb_properties_index]->rrh_gw_config[j].udp = 1;
enb_properties.properties[enb_properties_index]->rrh_gw_config[j].raw = 1;
}
}
} else {
enb_properties.properties[enb_properties_index]->nb_rrh_gw = 0;
enb_properties.properties[enb_properties_index]->rrh_gw_if_name = "none";
enb_properties.properties[enb_properties_index]->rrh_gw_config[j].local_address = "0.0.0.0";
enb_properties.properties[enb_properties_index]->rrh_gw_config[j].remote_address = "0.0.0.0";
enb_properties.properties[enb_properties_index]->rrh_gw_config[j].local_port= 0;
enb_properties.properties[enb_properties_index]->rrh_gw_config[j].remote_port= 0;
enb_properties.properties[enb_properties_index]->rrh_gw_config[j].active = 0;
enb_properties.properties[enb_properties_index]->rrh_gw_config[j].udp = 0;
enb_properties.properties[enb_properties_index]->rrh_gw_config[j].raw = 0;
}
// SCTP SETTING
enb_properties.properties[enb_properties_index]->sctp_out_streams = SCTP_OUT_STREAMS;
......
......@@ -78,6 +78,17 @@ typedef struct mme_ip_address_s {
char *ipv6_address;
} mme_ip_address_t;
typedef struct rrh_gw_config_s {
unsigned udp:1;
unsigned raw:1;
unsigned active:1;
char *local_address;
char *remote_address;
uint16_t local_port;
uint16_t remote_port;
} rrh_gw_config_t;
typedef struct Enb_properties_s {
/* Unique eNB_id to identify the eNB within EPC.
* For macro eNB ids this field should be 20 bits long.
......@@ -203,6 +214,13 @@ typedef struct Enb_properties_s {
char *enb_interface_name_for_S1_MME;
in_addr_t enb_ipv4_address_for_S1_MME;
/* Nb of RRH to connect to */
uint8_t nb_rrh_gw;
char *rrh_gw_if_name;
/* List of MME to connect to */
rrh_gw_config_t rrh_gw_config[4];
// otg config
/* Nb of OTG elements */
uint8_t num_otg_elements;
......
......@@ -251,7 +251,8 @@ typedef struct {
typedef struct {
uint8_t Num_ue_spec_dci ;
uint8_t Num_common_dci ;
unsigned int nCCE;
uint32_t nCCE;
uint32_t num_pdcch_symbols;
DCI_ALLOC_t dci_alloc[NUM_DCI_MAX] ;
} DCI_PDU;
/*! \brief CCCH payload */
......@@ -735,7 +736,8 @@ typedef struct {
uint8_t dl_pow_off[MAX_NUM_CCs];
uint16_t pre_nb_available_rbs[MAX_NUM_CCs];
unsigned char rballoc_sub_UE[MAX_NUM_CCs][N_RBG_MAX];
uint16_t ta_timer;
int16_t ta_update;
} UE_sched_ctrl;
/*! \brief eNB template for the Random access information */
typedef struct {
......@@ -765,8 +767,6 @@ typedef struct {
uint8_t Msg3_subframe;
/// Flag to indicate the eNB should generate Msg4 upon reception of SDU from RRC. This is triggered by first ULSCH reception at eNB for new user.
uint8_t generate_Msg4;
/// Flag to indicate the eNB should generate the DCI for Msg4, after getting the SDU from RRC.
uint8_t generate_Msg4_dci;
/// Flag to indicate that eNB is waiting for ACK that UE has received Msg3.
uint8_t wait_ack_Msg4;
/// UE RNTI allocated during RAR
......@@ -835,8 +835,8 @@ typedef struct {
/// Outgoing CCCH pdu for PHY
CCCH_PDU CCCH_pdu;
RA_TEMPLATE RA_template[NB_RA_PROC_MAX];
/// BCCH active flag
uint8_t bcch_active;
/// VRB map for common channels
uint8_t vrb_map[100];
/// MBSFN SubframeConfig
struct MBSFN_SubframeConfig *mbsfn_SubframeConfig[8];
/// number of subframe allocation pattern available for MBSFN sync area
......@@ -883,9 +883,11 @@ typedef struct {
/// Common cell resources
COMMON_channels_t common_channels[MAX_NUM_CCs];
UE_list_t UE_list;
///subband bitmap configuration
SBMAP_CONF sbmap_conf;
/// CCE table used to build DCI scheduling information
int CCE_table[MAX_NUM_CCs][800];
/// active flag for Other lcid
// uint8_t lcid_active[NB_RB_MAX];
/// eNB stats
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -468,6 +468,7 @@ int l2_init(LTE_DL_FRAME_PARMS *frame_parms,int eMBMS_active, char *uecap_xer,ui
mac_xface->get_transmission_mode = get_transmission_mode;
mac_xface->get_rballoc = get_rballoc;
mac_xface->get_nb_rb = conv_nprb;
mac_xface->get_prb = get_prb;
// mac_xface->get_SB_size = Get_SB_size;
mac_xface->get_subframe_direction = get_subframe_direction;
mac_xface->Msg3_transmitted = Msg3_tx;
......@@ -507,7 +508,7 @@ int l2_init(LTE_DL_FRAME_PARMS *frame_parms,int eMBMS_active, char *uecap_xer,ui
mac_xface->computeRIV = computeRIV;
mac_xface->get_TBS_DL = get_TBS_DL;
mac_xface->get_TBS_UL = get_TBS_UL;
mac_xface->get_nCCE_max = get_nCCE_max;
mac_xface->get_nCCE_max = get_nCCE_mac;
mac_xface->get_nCCE_offset = get_nCCE_offset;
mac_xface->get_ue_mode = get_ue_mode;
mac_xface->phy_config_sib1_eNB = phy_config_sib1_eNB;
......
......@@ -176,6 +176,7 @@ void assign_rbs_required (module_id_t Mod_id,
eNB_UE_stats[CC_id]->DL_cqi[0], MIN_CQI_VALUE, MAX_CQI_VALUE);
*/
eNB_UE_stats[CC_id]->dlsch_mcs1=cqi_to_mcs[eNB_UE_stats[CC_id]->DL_cqi[0]];
eNB_UE_stats[CC_id]->dlsch_mcs1 = cmin(eNB_UE_stats[CC_id]->dlsch_mcs1,openair_daq_vars.target_ue_dl_mcs);
}
......@@ -729,38 +730,123 @@ void dlsch_scheduler_pre_processor (module_id_t Mod_id,
}
}
#define SF05_LIMIT 1
void dlsch_scheduler_pre_processor_reset (int module_idP,
int UE_id,
uint8_t CC_id,
int frameP,
int subframeP,
int N_RBG,
uint16_t nb_rbs_required[MAX_NUM_CCs][NUMBER_OF_UE_MAX],
uint16_t nb_rbs_required_remaining[MAX_NUM_CCs][NUMBER_OF_UE_MAX],
unsigned char rballoc_sub[MAX_NUM_CCs][N_RBG_MAX],
unsigned char MIMO_mode_indicator[MAX_NUM_CCs][N_RBG_MAX])
int UE_id,
uint8_t CC_id,
int frameP,
int subframeP,
int N_RBG,
uint16_t nb_rbs_required[MAX_NUM_CCs][NUMBER_OF_UE_MAX],
uint16_t nb_rbs_required_remaining[MAX_NUM_CCs][NUMBER_OF_UE_MAX],
unsigned char rballoc_sub[MAX_NUM_CCs][N_RBG_MAX],
unsigned char MIMO_mode_indicator[MAX_NUM_CCs][N_RBG_MAX])
{
int i;
int i,j;
UE_list_t *UE_list=&eNB_mac_inst[module_idP].UE_list;
UE_sched_ctrl *ue_sched_ctl = &UE_list->UE_sched_ctrl[UE_id];
rnti_t rnti = UE_RNTI(module_idP,UE_id);
uint8_t *vrb_map = &eNB_mac_inst[module_idP].common_channels[CC_id].vrb_map;
int RBGsize = PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL/N_RBG;
#ifdef SF05_LIMIT
int subframe05_limit=0;
int sf05_upper=-1,sf05_lower=-1;
#endif
LTE_eNB_UE_stats *eNB_UE_stats = mac_xface->get_eNB_UE_stats(module_idP,CC_id,rnti);
// initialize harq_pid and round
mac_xface->get_ue_active_harq_pid(module_idP,CC_id,rnti,
frameP,subframeP,
&ue_sched_ctl->harq_pid[CC_id],
&ue_sched_ctl->round[CC_id],
0);
if (ue_sched_ctl->ta_timer == 0) {
// WE SHOULD PROTECT the eNB_UE_stats with a mutex here ...
ue_sched_ctl->ta_timer = 20; // wait 20 subframes before taking TA measurement from PHY
switch (PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL) {
case 6:
ue_sched_ctl->ta_update = eNB_UE_stats->timing_advance_update;
break;
case 15:
ue_sched_ctl->ta_update = eNB_UE_stats->timing_advance_update/2;
break;
case 25:
ue_sched_ctl->ta_update = eNB_UE_stats->timing_advance_update/4;
break;
case 50:
ue_sched_ctl->ta_update = eNB_UE_stats->timing_advance_update/8;
break;
case 75:
ue_sched_ctl->ta_update = eNB_UE_stats->timing_advance_update/12;
break;
case 100:
ue_sched_ctl->ta_update = eNB_UE_stats->timing_advance_update/16;
break;
}
// clear the update in case PHY does not have a new measurement after timer expiry
eNB_UE_stats->timing_advance_update = 0;
}
else {
ue_sched_ctl->ta_timer--;
ue_sched_ctl->ta_update =0; // don't trigger a timing advance command
}
nb_rbs_required[CC_id][UE_id]=0;
ue_sched_ctl->pre_nb_available_rbs[CC_id] = 0;
ue_sched_ctl->dl_pow_off[CC_id] = 2;
nb_rbs_required_remaining[CC_id][UE_id] = 0;
#ifdef SF05_LIMIT
switch (N_RBG) {
case 6:
sf05_lower=0;
sf05_upper=5;
break;
case 8:
sf05_lower=2;
sf05_upper=5;
break;
case 13:
sf05_lower=4;
sf05_upper=7;
break;
case 17:
sf05_lower=7;
sf05_upper=9;
break;
case 25:
sf05_lower=11;
sf05_upper=13;
break;
}
#endif
// Initialize Subbands according to VRB map
for (i=0; i<N_RBG; i++) {
ue_sched_ctl->rballoc_sub_UE[CC_id][i] = 0;
rballoc_sub[CC_id][i] = 0;
#ifdef SF05_LIMIT
// for avoiding 6+ PRBs around DC in subframe 0-5 (avoid excessive errors)
if ((subframeP==0 || subframeP==5) &&
(i>=sf05_lower && i<=sf05_upper))
rballoc_sub[CC_id][i]=1;
#endif
// for SI-RNTI,RA-RNTI and P-RNTI allocations
for (j=0;j<RBGsize;j++) {
if (vrb_map[j+(i*RBGsize)]!=0) {
rballoc_sub[CC_id][i] = 1;
LOG_D(MAC,"Frame %d, subframe %d : vrb %d allocated\n",frameP,subframeP,j+(i*RBGsize));
break;
}
}
LOG_D(MAC,"Frame %d Subframe %d CC_id %d RBG %i : rb_alloc %d\n",frameP,subframeP,CC_id,i,rballoc_sub[CC_id][i]);
MIMO_mode_indicator[CC_id][i] = 2;
}
}
......@@ -828,8 +914,7 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP,
int frameP,
sub_frame_t subframeP,
uint16_t *first_rb,
uint8_t aggregation,
uint32_t *nCCE)
uint8_t aggregation)
{
int16_t i;
......@@ -839,7 +924,6 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP,
int16_t total_remaining_rbs[MAX_NUM_CCs];
uint16_t max_num_ue_to_be_scheduled=0,total_ue_count=0;
rnti_t rnti= -1;
uint32_t nCCE_to_be_used[MAX_NUM_CCs];
UE_list_t *UE_list = &eNB_mac_inst[module_idP].UE_list;
UE_TEMPLATE *UE_template = 0;
LTE_DL_FRAME_PARMS *frame_parms = 0;
......@@ -860,7 +944,6 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP,
// we need to distribute RBs among UEs
// step1: reset the vars
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
nCCE_to_be_used[CC_id]= nCCE[CC_id];
total_allocated_rbs[CC_id]=0;
total_remaining_rbs[CC_id]=0;
average_rbs_per_user[CC_id]=0;
......@@ -894,11 +977,13 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP,
if (UE_template->pre_allocated_nb_rb_ul > 0) {
total_ue_count+=1;
}
if((mac_xface->get_nCCE_max(module_idP,CC_id) - nCCE_to_be_used[CC_id]) > (1<<aggregation)) {
/*
if((mac_xface->get_nCCE_max(module_idP,CC_id,3,subframeP) - nCCE_to_be_used[CC_id]) > (1<<aggregation)) {
nCCE_to_be_used[CC_id] = nCCE_to_be_used[CC_id] + (1<<aggregation);
max_num_ue_to_be_scheduled+=1;
}
}*/
max_num_ue_to_be_scheduled+=1;
if (total_ue_count == 0) {
average_rbs_per_user[CC_id] = 0;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
guepe@guepe.25164:1451994252
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment