Commit 9f33d090 authored by Laurent's avatar Laurent

merge develop

parents 2612df9e 4eae34a9
job1:
script:
- echo $PWD
- echo $USER
- echo $OAI_USER
- echo $OAI_EXTRA_ARGS
- echo $NFS_SHARE_DIR
- echo $EXTERNAL_SHARE_DIR
- echo $SHELL
- echo $OAI_TEST_CASE_GROUP
- echo $MACHINELIST
- echo $MACHINELISTGENERIC
- git rev-parse --abbrev-ref HEAD
- git_repo=`git config --get remote.origin.url`
- git_head=`git rev-parse HEAD`
- echo $git_head
- tmp=`git show-ref --head | grep $git_head`
- tmp=(${tmp///// })
- git_branch=${tmp[@]:(-1)}
- echo $git_branch
- source oaienv
- echo $OPENAIR_DIR
- NFS_TEST_RESULTS_DIR=$NFS_SHARE_DIR/$git_branch/$git_head
- 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 -5GRepo $git_repo -MachineList "$MACHINELIST" -MachineListGeneric "$MACHINELISTGENERIC" -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 -5GRepo $git_repo -MachineList "$MACHINELIST" -MachineListGeneric "$MACHINELISTGENERIC" -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
- sshpass -p "$OAI_PASS" rsync -az -e "ssh -o StrictHostKeyChecking=no " --rsync-path="mkdir -p $EXTERNAL_SHARE_DIR && rsync" $OPENAIR_DIR/cmake_targets/autotests/log $OAI_USER@localhost:$EXTERNAL_SHARE_DIR
- cat $OPENAIR_DIR/cmake_targets/autotests/log/results_autotests.xml
- date
- pwd
- echo $OAI_USER
- echo $OAI_PASS
- echo $OAI_TEST_CASE_GROUP
- echo $MACHINELIST
- echo $MACHINELISTGENERIC
- echo $RESULT_DIR
- echo $NRUNS_LTE_SOFTMODEM
- source oaienv
- rm -rf cmake_targets/autotests/log
- mkdir cmake_targets/autotests/log
- cd cmake_targets/autotests/v2
- python main.py
- date
only:
- triggers
- triggers
......@@ -37,11 +37,6 @@ set (OPENAIR_BIN_DIR ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY})
project (OpenAirInterface)
#add_definitions("-DEMIT_ASN_DEBUG=1")
add_subdirectory(${OPENAIR_TARGETS}/ARCH/LMSSDR/USERSPACE/LIB/lms7002m lms7002m)
add_subdirectory(${OPENAIR_TARGETS}/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR lmsSDR)
add_subdirectory(${OPENAIR_TARGETS}/ARCH/LMSSDR/USERSPACE/LIB/Si5351C Si5351C)
###########################################
# macros to define options as there is numerous options in oai
################################################
......@@ -512,7 +507,7 @@ set(HWLIB_BLADERF_SOURCE
add_library(oai_bladerfdevif MODULE ${HWLIB_BLADERF_SOURCE} )
include_directories("${OPENAIR_TARGETS}/ARCH/LMSSDR/USERSPACE/LIB/")
set (option_HWLMSSDRLIB_lib "-l LMS_SDR -l LMS7002M -l Si5351C")
set(HWLIB_LMSSDR_SOURCE
${OPENAIR_TARGETS}/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp
)
......@@ -559,16 +554,14 @@ elseif (${RF_BOARD} STREQUAL "OAI_BLADERF")
elseif (${RF_BOARD} STREQUAL "OAI_LMSSDR")
include_directories("${OPENAIR_TARGETS}/ARCH/LMSSDR/USERSPACE/LIB")
include_directories("${OPENAIR_TARGETS}/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR")
include_directories("${OPENAIR_TARGETS}/ARCH/LMSSDR/USERSPACE/LIB/lms7002m")
include_directories("${OPENAIR_TARGETS}/ARCH/LMSSDR/USERSPACE/LIB/Si5351C")
include_directories("${OPENAIR_TARGETS}/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/LMS_StreamBoard")
include_directories("/usr/local/include/lime")
include_directories("/usr/include/lime")
LINK_DIRECTORIES("/usr/lib/x86_64-linux-gnu")
LINK_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}/lmsSDR")
LINK_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}/lms7002m")
LINK_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}/Si5351C")
set(HW_SOURCE ${HW_SOURCE} ${OPENAIR_TARGETS}/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp)
set(option_HW_lib "-lLMS_SDR -lLMS7002M -lSi5351C -rdynamic -ldl")
set(option_HW_lib "-lLimeSuite -rdynamic -ldl")
elseif (${RF_BOARD} STREQUAL "CPRIGW")
set(HW_SOURCE ${HW_SOURCE}
......@@ -1691,7 +1684,7 @@ endif()
# Atlas is required by some packages, but not found in pkg-config
if(EXISTS "/usr/include/atlas/cblas.h")
include_directories("/usr/include/atlas")
list(APPEND ATLAS_LIBRARIES lapack cblas atlas)
list(APPEND ATLAS_LIBRARIES cblas atlas lapack)
else()
message("No Blas/Atlas libs found, some targets will fail")
endif()
......@@ -1845,14 +1838,6 @@ Message("-- HW_SOURCE=${HW_SOURCE}")
Message("-- option_TP_lib=${option_TP_lib}")
Message("-- TRANSPORT_SOURCE=${TRANSPORT_SOURCE}")
if (${RF_BOARD} STREQUAL "OAI_LMSSDR")
add_dependencies(lte-softmodem LMS7002M LMS_SDR Si5351C)
add_dependencies(lte-softmodem-nos1 LMS7002M LMS_SDR Si5351C)
add_dependencies(rrh_gw LMS7002M LMS_SDR Si5351C)
endif (${RF_BOARD} STREQUAL "OAI_LMSSDR")
# USIM process
#################
#add_executable(usim
......
......@@ -13,7 +13,7 @@
<Timeout_execution>36000</Timeout_execution>
<TestCaseExclusionList>010141 0102+ 010301 010303 010304 010305 0104+ 015508 015511 015520 015523 015518 015519 015520 015521 015522 015523 015602 015605 015818 015819 015820 015821 015822 015823 016102 016105 016502 016505 017002 017005 018002 018005 018502 018505 025514 025517 025520 025523 025518 025519 025520 025521 025522 025523</TestCaseExclusionList>
<nruns_lte-softmodem>3</nruns_lte-softmodem>
<MachineListGeneric>amerique mozart hutch starsky stevens calisson superserver </MachineListGeneric>
<MachineListGeneric>nano mozart hutch starsky stevens calisson superserver </MachineListGeneric>
<testCase id="010101" >
<class>compilation</class>
<desc>Build oaisim.Rel8</desc>
......
sudo /opt/ltebox/tools/stop_ltebox || true
sudo /opt/ltebox/tools/start_ltebox
sudo /opt/ltebox/tools/stop_ltebox || true
sudo /opt/hss_sim0609/starthss_real
The configuration for the bandrich in the test setup is a bit hackish.
Here come some notes explaining what we do here.
To get /dev/bandrich.data and /dev/bandrich.control (so that you don't need
to look for which /dev/ttyUSBx are used by your dongle, and always use
the same files, no matter what), add a udev file:
/etc/udev/rules.d/bandrich.rules
containing lines:
SUBSYSTEM=="tty", ENV{ID_VENDOR_ID}=="1a8d", ENV{ID_MODEL_ID}=="100d", ENV{ID_SERIAL_SHORT}=="357473040068155", ENV{ID_USB_INTERFACE_NUM}=="00", SYMLINK+="bandrich.data", MODE="0666"
SUBSYSTEM=="tty", ENV{ID_VENDOR_ID}=="1a8d", ENV{ID_MODEL_ID}=="100d", ENV{ID_SERIAL_SHORT}=="357473040068155", ENV{ID_USB_INTERFACE_NUM}=="02", SYMLINK+="bandrich.control", MODE="0666"
Change vendor_id/model_id/serial/interface num to match yours.
Use lsusb -v to find values.
At first we used /dev/ttyUSB2 linked to /dev/bandrich for both data (in
the wvdial configuration file) and control (in the python code, opening
/dev/bandrich the standard unix way and read and write into it, with no
special libusb commands).
But it turned out that using /dev/ttyUSB2 for data gives bad throughput
results. We tested downlink UDP at 15Mb/s but the maximum throughput for
a 5MHz cell was around 13, and we had a lot of packets lost at the iperf's
UDP level. Radio was looking fine (all packets acked correctly), so it was
not a radio problem. The dongle in a windows machine was working fine,
15Mbs/s. Using the wvdial configuration file from test setup v1 gave also
good results. The only difference was the use of /dev/ttyUSB0 instead of
/dev/ttyUSB2. Using /dev/ttyUSB0 solved the throughput issue.
But using /dev/ttyUSB0 for control in the pyton code did not work. The
output was incorrect.
So we decided to have /dev/bandrich.data linked to /dev/ttyUSB0 for data
(wvdial) and /dev/bandrich.control linked to /dev/ttyUSB2 for control
(in python code).
It may not be the correct way to go, but it seems to do the trick so far.
Your device may need some other solution.
Here, we get, as result of lsusb -v:
[SNIP]
Bus 003 Device 009: ID 1a8d:100d BandRich, Inc. 4G LTE adapter
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 64
idVendor 0x1a8d BandRich, Inc.
idProduct 0x100d 4G LTE adapter
bcdDevice 0.00
iManufacturer 10 BandRich, Inc.
iProduct 9 BandLuxe HSPA-LTE Adapter
iSerial 11 357473040068155
[SNIP]
You can also run:
udevadm monitor
and unplug/replug the dongle. It will print some information.
The command:
udevadm info --export-db
is also important to get the right identifier to put in ENV{}. (It also
gives the correct value.)
Here is extracted what we have for our dongle:
P: /devices/pci0000:00/0000:00:1a.0/usb3/3-1/3-1.2/3-1.2:1.2/ttyUSB2/tty/ttyUSB2
N: ttyUSB2
S: bandrich
S: serial/by-id/usb-BandRich__Inc._BandLuxe_HSPA-LTE_Adapter_357473040068155-if02-port0
S: serial/by-path/pci-0000:00:1a.0-usb-0:1.2:1.2-port0
E: DEVLINKS=/dev/bandrich /dev/serial/by-id/usb-BandRich__Inc._BandLuxe_HSPA-LTE_Adapter_357473040068155-if02-port0 /dev/serial/by-path/pci-0000:00:1a.0-usb-0:1.2:1.2-port0
E: DEVNAME=/dev/ttyUSB2
E: DEVPATH=/devices/pci0000:00/0000:00:1a.0/usb3/3-1/3-1.2/3-1.2:1.2/ttyUSB2/tty/ttyUSB2
E: ID_BUS=usb
E: ID_MM_CANDIDATE=1
E: ID_MODEL=BandLuxe_HSPA-LTE_Adapter
E: ID_MODEL_ENC=BandLuxe\x20HSPA-LTE\x20Adapter
E: ID_MODEL_FROM_DATABASE=4G LTE adapter
E: ID_MODEL_ID=100d
E: ID_PATH=pci-0000:00:1a.0-usb-0:1.2:1.2
E: ID_PATH_TAG=pci-0000_00_1a_0-usb-0_1_2_1_2
E: ID_REVISION=0000
E: ID_SERIAL=BandRich__Inc._BandLuxe_HSPA-LTE_Adapter_357473040068155
E: ID_SERIAL_SHORT=357473040068155
E: ID_TYPE=generic
E: ID_USB_DRIVER=option
E: ID_USB_INTERFACES=:ffffff:020600:0a0000:080650:
E: ID_USB_INTERFACE_NUM=02
E: ID_VENDOR=BandRich__Inc.
E: ID_VENDOR_ENC=BandRich\x2c\x20Inc.
E: ID_VENDOR_FROM_DATABASE=BandRich, Inc.
E: ID_VENDOR_ID=1a8d
E: MAJOR=188
E: MINOR=2
E: SUBSYSTEM=tty
E: USEC_INITIALIZED=672068596
You can also run:
udevadm info -a -p /sys/bus/usb-serial/devices/ttyUSB0
udevadm info -a -p /sys/bus/usb-serial/devices/ttyUSB2
Note: after creating the udev files, you need to unplug/replug your
dongle for /dev/bandrich.data and /dev/bandrich.control to appear.
Note: the mode 0666 is for everyone to access the dongle (no need for
root privileges). If you prefer you can set it to 0600 (only root)
or 0660 (root and group).
Then you need to configure pppd, to get correct 'route' information when
you run wvdial.
The file /etc/ppp/peers/wvdial should have the following content:
noauth
name wvdial
usepeerdns
defaultroute
replacedefaultroute
The file wvdial.bandrich.conf has been created by copying some information
found on the Internet. Its content may not be fully correct. Adapt to your
situation. It seems to work here.
echo $SERVER_IP
timeout -s 9 20s iperf -c $SERVER_IP -i1
echo $SERVER_IP
echo $UDP_BANDWIDTH
timeout -s 9 20s iperf -c $SERVER_IP -i1 -u -b $UDP_BANDWIDTH
sudo rm -rf /tmp/oai_test_setup
mkdir /tmp/oai_test_setup
cd /tmp/oai_test_setup
git clone $REPOSITORY_URL oai
cd oai
git checkout $COMMIT_ID
cd /tmp/oai_test_setup/oai
source oaienv
cd cmake_targets
rm -rf log
mkdir -p log
echo $BUILD_ARGUMENTS
./build_oai $BUILD_ARGUMENTS
echo $BUILD_OUTPUT
ls $BUILD_OUTPUT
cd /tmp/oai_test_setup/oai
source oaienv
echo $EXEC $EXEC_ARGS
$EXEC $EXEC_ARGS
cd /tmp/oai_test_setup/oai
source oaienv
cd cmake_targets
rm -rf log
mkdir -p log
bash -c "$PRE_BUILD"
$BUILD_PROG $BUILD_ARGUMENTS
bash -c "$PRE_EXEC"
import sys, os, select, re, time
def quit(r):
sys.stdout.flush()
os._exit(r)
class ModemResponse:
def __init__(self, retcode, retstring):
self.ret = retcode
self.data = retstring
class Modem:
def open(self):
self.i = os.open(self.devname, os.O_RDONLY)
self.o = os.open(self.devname, os.O_WRONLY)
#clear output of modem, if any is pending (not sure of this)
while True:
(ri, ro, re) = select.select([self.i], [], [self.i], 0)
if len(ri) == 0:
break
l = os.read(self.i, 65536)
print "WARNING: modem had unread data: '" + \
l.replace('\r', '\\r') + "'"
def __init__(self, devname):
self.devname = devname
self.i = -1
self.o = -1
self.open()
def send(self, s):
print "DEBUG: SEND TO MODEM: '" + s + "'"
os.write(self.o, s+"\r")
def recv(self):
return os.read(self.i, 65536)
def wait(self):
ok = '\r\nOK\r\n'
error = '\r\nERROR\r\n'
cme_error = '\r\nCME ERROR:[^\r]*\r\n'
no_carrier = '\r\nNO CARRIER\r\n'
l = ''
while True:
l = l + self.recv()
print "DEBUG: CURRENT MODEM RESPONSE: '" + \
l.replace('\r','\\r').replace('\n','\\n') + "'"
#AT returned 'things' are "\r\nXXXX\r\n", look for that.
#Check if last one matches 'ok', 'error' or 'cme_error'.
#(Hopefully this is enough and no other reply is possible.)
#This code accepts invalid responses from modem, ie. all
#that does not fit in the 'findall' is thrashed away, maybe
#we want to do something in this case?
res = re.findall('\r\n[^\r]*\r\n', l)
if len(res) == 0:
print "DEBUG: NO MATCH: wait for more input from modem"
continue
last_res = res[len(res)-1]
print "DEBUG: CURRENT LAST LINE: '" + \
last_res.replace('\r','\\r').replace('\n','\\n')+"'"
if re.match(ok, last_res) != None:
return ModemResponse(True, l)
if ( re.match(error, last_res) != None or
re.match(cme_error, last_res) != None or
re.match(no_carrier, last_res) != None):
return ModemResponse(False, l)
#TODO purge?
#re.purge()
def modem_reset_cycle(self):
#close all
os.close(self.i)
os.close(self.o)
self.i = -1
self.o = -1
print "DEBUG: RESET CYCLE: wait for modem to go away"
#wait for file descriptor to go away
while True:
try:
test = os.open(self.devname, os.O_RDONLY)
os.close(test)
time.sleep(0.1)
except BaseException, e:
break
print "DEBUG: RESET CYCLE: modem has gone away"
print "DEBUG: RESET CYCLE: wait for modem to come back"
#wait for file descriptor to be back, try to open it over and over
#TODO: use inotify here? (it's not in basic python as it seems)
while True:
try:
test = os.open(self.devname, os.O_RDONLY)
os.close(test)
break
except BaseException, e:
time.sleep(0.1)
print "DEBUG: RESET CYCLE: modem is back"
#back to business
self.open()
#enable control+C reception (to be refined if it does not work)
stty isig intr ^C
cd /tmp/oai_test_setup/oai
source oaienv
cd cmake_targets/lte_build_oai/build
ulimit -c unlimited
sudo rm -f core
#sudo -E ./lte-softmodem -O $OPENAIR_DIR/cmake_targets/autotests/v2/config/enb.band7.tm1.usrpb210.conf
sudo -E ./lte-softmodem -O /tmp/enb.conf
stty isig intr ^C
#timeout -s 9 20s iperf -s -i1
iperf -s -i1
stty isig intr ^C
#timeout -s 9 20s iperf -s -i1 -u
iperf -s -i1 -u
#enable control+C reception (to be refined if it does not work)
stty isig intr ^C
#If /dev/bandrich is not present when we start the test, what to do?
#The following commented lines are an attempt at solving this.
#This is not satisfying, so we rather do nothing.
##the UE got stuck once, I had to run usb_modeswitch by hand.
##So at this point, if /dev/bandrich does not exist, maybe the UE is
##stuck for whatever reason. Let's forcefully run usb_modeswitch.
#if [ ! -e /dev/bandrich ]; then sudo usb_modeswitch -v 1a8d -p 1000 -I -W -K; true; fi
#
##wait for /dev/bandrich (TODO: use inotify?)
##may fail if the bandrich is in a bad state
#while [ ! -e /dev/bandrich ]; do sleep 1; done
cd /tmp/oai_test_setup/oai
source oaienv
cd cmake_targets/autotests/v2/actions
python start_bandrich.py
sudo wvdial -C wvdial.bandrich.conf || true
python stop_bandrich.py
import time
from modem import quit, Modem
try:
modem = Modem("/dev/bandrich.control")
#test that modem is there
print "INFO: check modem's presence"
modem.send('AT')
if modem.wait().ret != True:
print "ERROR: no modem?"
quit(1)
#activate the modem, be brutal and reset it too!
print "INFO: reset and activate the modem"
modem.send('AT+CFUN=1,1')
if modem.wait().ret != True:
print "ERROR: failed asking modem for activation"
quit(1)
#modem has gone! wait for it to pop up again
modem.modem_reset_cycle()
#wait for modem to be connected
#timeout after one minute
print "INFO: wait for modem to be connected (timeout: one minute)"
start_time = time.time()
while True:
modem.send('AT+CGATT?')
r = modem.wait()
if r.ret != True:
print "ERROR: failed checking attachment status of modem"
quit(1)
if "+CGATT: 1" in r.data:
break
if not "CGATT: 0" in r.data:
print "ERROR: bad data when checking attachment status of modem"
quit(1)
time.sleep(0.1)
if time.time() > start_time + 60:
print "ERROR: modem not connected after one minute, close modem"
modem.send('AT+CFUN=4')
r = modem.wait()
if r.ret != True:
print "ERROR: closing modem failed"
quit(1)
print "INFO: modem is connected"
except BaseException, e:
print "ERROR: " + str(e)
quit(1)
quit(0)
import time
from modem import quit, Modem
try:
modem = Modem("/dev/bandrich.control")
#test that modem is there
print "INFO: check modem's presence"
modem.send('AT')
r = modem.wait()
if r.ret != True and "NO CARRIER" not in r.data:
print "ERROR: no modem?"
quit(1)
if "NO CARRIER" in r.data:
print "WARNING: 'NO CARRIER' detected, not sure if handled correctly"
#deactivate the modem
print "INFO: deactivate the modem"
modem.send('AT+CFUN=4')
if modem.wait().ret != True:
print "ERROR: failed asking modem for deactivation"
quit(1)
except BaseException, e:
print "ERROR: " + str(e)
quit(1)
quit(0)
[Dialer Defaults]
Modem = /dev/bandrich.data
ISDN = off
Modem Type = Analog Modem
Baud = 9600
Init = ATZ
Init2 = AT+CPIN?
Init3 = AT+CGREG?
Init4 = AT+COPS?
Init5 = AT+CSQ
Init6 =
Init7 = AT+CGATT=1
Init8 =
Init9 =
Phone = *99***1#
Phone1 =
Phone2 =
Phone3 =
Phone4 =
Dial Prefix =
Dial Attempts = 1
Dial Command = ATM1L3DT
Ask Password = off
Password = ''
Username = ImaginLab
Auto Reconnect = off
Abort on Busy = off
Carrier Check = on
Check Def Route = on
Abort on No Dialtone = on
Stupid Mode = on
Idle Seconds = 0
Auto DNS = on
;Minimize = off
;Dock = off
;Do NOT edit this file by hand!
This diff is collapsed.
Active_eNBs = ( "eNB_Eurecom_LTEBox");
# Asn1_verbosity, choice in: none, info, annoying
Asn1_verbosity = "none";
eNBs =
(
{
////////// Identification parameters:
eNB_ID = 0xe00;
cell_type = "CELL_MACRO_ENB";
eNB_name = "eNB_Eurecom_LTEBox";
// Tracking area code, 0x0000 and 0xfffe are reserved values
tracking_area_code = "1";
mobile_country_code = "208";
mobile_network_code = "92";
////////// Physical parameters:
component_carriers = (
{
node_function = "eNodeB_3GPP";
node_timing = "synch_to_ext_device";
node_synch_ref = 0;
frame_type = "FDD";
tdd_config = 3;
tdd_config_s = 0;
prefix_type = "NORMAL";
eutra_band = 7;
downlink_frequency = 2660000000L;
uplink_frequency_offset = -120000000;
Nid_cell = 0;
N_RB_DL = 50;
Nid_cell_mbsfn = 0;
nb_antenna_ports = 1;
nb_antennas_tx = 1;
nb_antennas_rx = 1;
tx_gain = 90;
rx_gain = 125;
prach_root = 0;
prach_config_index = 0;
prach_high_speed = "DISABLE";
prach_zero_correlation = 1;
prach_freq_offset = 2;
pucch_delta_shift = 1;
pucch_nRB_CQI = 1;
pucch_nCS_AN = 0;
pucch_n1_AN = 32;
pdsch_referenceSignalPower = -24;
pdsch_p_b = 0;
pusch_n_SB = 1;
pusch_enable64QAM = "DISABLE";
pusch_hoppingMode = "interSubFrame";
pusch_hoppingOffset = 0;
pusch_groupHoppingEnabled = "ENABLE";
pusch_groupAssignment = 0;
pusch_sequenceHoppingEnabled = "DISABLE";
pusch_nDMRS1 = 1;
phich_duration = "NORMAL";
phich_resource = "ONESIXTH";
srs_enable = "DISABLE";
/* srs_BandwidthConfig =;
srs_SubframeConfig =;
srs_ackNackST =;
srs_MaxUpPts =;*/
pusch_p0_Nominal = -96;
pusch_alpha = "AL1";
pucch_p0_Nominal = -103;
msg3_delta_Preamble = 6;
pucch_deltaF_Format1 = "deltaF2";
pucch_deltaF_Format1b = "deltaF3";
pucch_deltaF_Format2 = "deltaF0";
pucch_deltaF_Format2a = "deltaF0";
pucch_deltaF_Format2b = "deltaF0";
rach_numberOfRA_Preambles = 64;
rach_preamblesGroupAConfig = "DISABLE";
/*
rach_sizeOfRA_PreamblesGroupA = ;
rach_messageSizeGroupA = ;
rach_messagePowerOffsetGroupB = ;
*/
rach_powerRampingStep = 4;
rach_preambleInitialReceivedTargetPower = -104;
rach_preambleTransMax = 10;
rach_raResponseWindowSize = 10;
rach_macContentionResolutionTimer = 48;
rach_maxHARQ_Msg3Tx = 4;
pcch_default_PagingCycle = 128;
pcch_nB = "oneT";
bcch_modificationPeriodCoeff = 2;
ue_TimersAndConstants_t300 = 1000;
ue_TimersAndConstants_t301 = 1000;
ue_TimersAndConstants_t310 = 1000;
ue_TimersAndConstants_t311 = 10000;
ue_TimersAndConstants_n310 = 20;
ue_TimersAndConstants_n311 = 1;
ue_TransmissionMode = 1;
}
);
srb1_parameters :
{
# timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500]
timer_poll_retransmit = 80;
# timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200]
timer_reordering = 35;
# timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500]
timer_status_prohibit = 0;
# poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)]
poll_pdu = 4;
# poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)]
poll_byte = 99999;
# max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32]
max_retx_threshold = 4;
}
# ------- SCTP definitions
SCTP :
{
# Number of streams to use in input/output
SCTP_INSTREAMS = 2;
SCTP_OUTSTREAMS = 2;
};
////////// MME parameters:
mme_ip_address = ( { ipv4 = "192.168.12.26";
ipv6 = "192:168:30::17";
active = "yes";
preference = "ipv4";
}
);
NETWORK_INTERFACES :
{
ENB_INTERFACE_NAME_FOR_S1_MME = "eth0";
ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.19/24";
ENB_INTERFACE_NAME_FOR_S1U = "eth0";
ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.19/24";
ENB_PORT_FOR_S1U = 2152; # Spec 2152
};
log_config :
{
global_log_level ="info";
global_log_verbosity ="medium";
hw_log_level ="info";
hw_log_verbosity ="medium";
phy_log_level ="info";
phy_log_verbosity ="medium";
mac_log_level ="info";
mac_log_verbosity ="high";
rlc_log_level ="info";
rlc_log_verbosity ="medium";
pdcp_log_level ="info";
pdcp_log_verbosity ="medium";
rrc_log_level ="info";
rrc_log_verbosity ="medium";
};
}
);
Active_eNBs = ( "eNB_Eurecom_LTEBox");
# Asn1_verbosity, choice in: none, info, annoying
Asn1_verbosity = "none";
eNBs =
(
{
////////// Identification parameters:
eNB_ID = 0xe00;
cell_type = "CELL_MACRO_ENB";
eNB_name = "eNB_Eurecom_LTEBox";
// Tracking area code, 0x0000 and 0xfffe are reserved values
tracking_area_code = "1";
mobile_country_code = "208";
mobile_network_code = "92";
////////// Physical parameters:
component_carriers = (
{
node_function = "eNodeB_3GPP";
node_timing = "synch_to_ext_device";
node_synch_ref = 0;
frame_type = "FDD";
tdd_config = 3;
tdd_config_s = 0;
prefix_type = "NORMAL";
eutra_band = 7;
downlink_frequency = 2660000000L;
uplink_frequency_offset = -120000000;
Nid_cell = 0;
N_RB_DL = 100;
Nid_cell_mbsfn = 0;
nb_antenna_ports = 1;
nb_antennas_tx = 1;
nb_antennas_rx = 1;
tx_gain = 90;
rx_gain = 125;
prach_root = 0;
prach_config_index = 0;
prach_high_speed = "DISABLE";
prach_zero_correlation = 1;
prach_freq_offset = 2;
pucch_delta_shift = 1;
pucch_nRB_CQI = 1;
pucch_nCS_AN = 0;
pucch_n1_AN = 32;
pdsch_referenceSignalPower = -24;
pdsch_p_b = 0;
pusch_n_SB = 1;
pusch_enable64QAM = "DISABLE";
pusch_hoppingMode = "interSubFrame";
pusch_hoppingOffset = 0;
pusch_groupHoppingEnabled = "ENABLE";
pusch_groupAssignment = 0;
pusch_sequenceHoppingEnabled = "DISABLE";
pusch_nDMRS1 = 1;
phich_duration = "NORMAL";
phich_resource = "ONESIXTH";
srs_enable = "DISABLE";
/* srs_BandwidthConfig =;
srs_SubframeConfig =;
srs_ackNackST =;
srs_MaxUpPts =;*/
pusch_p0_Nominal = -96;
pusch_alpha = "AL1";
pucch_p0_Nominal = -103;
msg3_delta_Preamble = 6;
pucch_deltaF_Format1 = "deltaF2";
pucch_deltaF_Format1b = "deltaF3";
pucch_deltaF_Format2 = "deltaF0";
pucch_deltaF_Format2a = "deltaF0";
pucch_deltaF_Format2b = "deltaF0";
rach_numberOfRA_Preambles = 64;
rach_preamblesGroupAConfig = "DISABLE";
/*
rach_sizeOfRA_PreamblesGroupA = ;
rach_messageSizeGroupA = ;
rach_messagePowerOffsetGroupB = ;
*/
rach_powerRampingStep = 4;
rach_preambleInitialReceivedTargetPower = -104;
rach_preambleTransMax = 10;
rach_raResponseWindowSize = 10;
rach_macContentionResolutionTimer = 48;
rach_maxHARQ_Msg3Tx = 4;
pcch_default_PagingCycle = 128;
pcch_nB = "oneT";
bcch_modificationPeriodCoeff = 2;
ue_TimersAndConstants_t300 = 1000;
ue_TimersAndConstants_t301 = 1000;
ue_TimersAndConstants_t310 = 1000;
ue_TimersAndConstants_t311 = 10000;
ue_TimersAndConstants_n310 = 20;
ue_TimersAndConstants_n311 = 1;
ue_TransmissionMode = 1;
}
);
srb1_parameters :
{
# timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500]
timer_poll_retransmit = 80;
# timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200]
timer_reordering = 35;
# timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500]
timer_status_prohibit = 0;
# poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)]
poll_pdu = 4;
# poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)]
poll_byte = 99999;
# max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32]
max_retx_threshold = 4;
}
# ------- SCTP definitions
SCTP :
{
# Number of streams to use in input/output
SCTP_INSTREAMS = 2;
SCTP_OUTSTREAMS = 2;
};
////////// MME parameters:
mme_ip_address = ( { ipv4 = "192.168.12.26";
ipv6 = "192:168:30::17";
active = "yes";
preference = "ipv4";
}
);
NETWORK_INTERFACES :
{
ENB_INTERFACE_NAME_FOR_S1_MME = "eth0";
ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.19/24";
ENB_INTERFACE_NAME_FOR_S1U = "eth0";
ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.19/24";
ENB_PORT_FOR_S1U = 2152; # Spec 2152
};
log_config :
{
global_log_level ="info";
global_log_verbosity ="medium";
hw_log_level ="info";
hw_log_verbosity ="medium";
phy_log_level ="info";
phy_log_verbosity ="medium";
mac_log_level ="info";
mac_log_verbosity ="high";
rlc_log_level ="info";
rlc_log_verbosity ="medium";
pdcp_log_level ="info";
pdcp_log_verbosity ="medium";
rrc_log_level ="info";
rrc_log_verbosity ="medium";
};
}
);
Active_eNBs = ( "eNB_Eurecom_LTEBox");
# Asn1_verbosity, choice in: none, info, annoying
Asn1_verbosity = "none";
eNBs =
(
{
////////// Identification parameters:
eNB_ID = 0xe00;
cell_type = "CELL_MACRO_ENB";
eNB_name = "eNB_Eurecom_LTEBox";
// Tracking area code, 0x0000 and 0xfffe are reserved values
tracking_area_code = "1";
mobile_country_code = "208";
mobile_network_code = "92";
////////// Physical parameters:
component_carriers = (
{
node_function = "eNodeB_3GPP";
node_timing = "synch_to_ext_device";
node_synch_ref = 0;
frame_type = "FDD";
tdd_config = 3;
tdd_config_s = 0;
prefix_type = "NORMAL";
eutra_band = 7;
downlink_frequency = 2660000000L;
uplink_frequency_offset = -120000000;
Nid_cell = 0;
N_RB_DL = 25;
Nid_cell_mbsfn = 0;
nb_antenna_ports = 1;
nb_antennas_tx = 1;
nb_antennas_rx = 1;
tx_gain = 90;
rx_gain = 125;
prach_root = 0;
prach_config_index = 0;
prach_high_speed = "DISABLE";
prach_zero_correlation = 1;
prach_freq_offset = 2;
pucch_delta_shift = 1;
pucch_nRB_CQI = 1;
pucch_nCS_AN = 0;
pucch_n1_AN = 32;
pdsch_referenceSignalPower = -24;
pdsch_p_b = 0;
pusch_n_SB = 1;
pusch_enable64QAM = "DISABLE";
pusch_hoppingMode = "interSubFrame";
pusch_hoppingOffset = 0;
pusch_groupHoppingEnabled = "ENABLE";
pusch_groupAssignment = 0;
pusch_sequenceHoppingEnabled = "DISABLE";
pusch_nDMRS1 = 1;
phich_duration = "NORMAL";
phich_resource = "ONESIXTH";
srs_enable = "DISABLE";
/* srs_BandwidthConfig =;
srs_SubframeConfig =;
srs_ackNackST =;
srs_MaxUpPts =;*/
pusch_p0_Nominal = -96;
pusch_alpha = "AL1";
pucch_p0_Nominal = -103;
msg3_delta_Preamble = 6;
pucch_deltaF_Format1 = "deltaF2";
pucch_deltaF_Format1b = "deltaF3";
pucch_deltaF_Format2 = "deltaF0";
pucch_deltaF_Format2a = "deltaF0";
pucch_deltaF_Format2b = "deltaF0";
rach_numberOfRA_Preambles = 64;
rach_preamblesGroupAConfig = "DISABLE";
/*
rach_sizeOfRA_PreamblesGroupA = ;
rach_messageSizeGroupA = ;
rach_messagePowerOffsetGroupB = ;
*/
rach_powerRampingStep = 4;
rach_preambleInitialReceivedTargetPower = -104;
rach_preambleTransMax = 10;
rach_raResponseWindowSize = 10;
rach_macContentionResolutionTimer = 48;
rach_maxHARQ_Msg3Tx = 4;
pcch_default_PagingCycle = 128;
pcch_nB = "oneT";
bcch_modificationPeriodCoeff = 2;
ue_TimersAndConstants_t300 = 1000;
ue_TimersAndConstants_t301 = 1000;
ue_TimersAndConstants_t310 = 1000;
ue_TimersAndConstants_t311 = 10000;
ue_TimersAndConstants_n310 = 20;
ue_TimersAndConstants_n311 = 1;
ue_TransmissionMode = 1;
}
);
srb1_parameters :
{
# timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500]
timer_poll_retransmit = 80;
# timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200]
timer_reordering = 35;
# timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500]
timer_status_prohibit = 0;
# poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)]
poll_pdu = 4;
# poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)]
poll_byte = 99999;
# max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32]
max_retx_threshold = 4;
}
# ------- SCTP definitions
SCTP :
{
# Number of streams to use in input/output
SCTP_INSTREAMS = 2;
SCTP_OUTSTREAMS = 2;
};
////////// MME parameters:
mme_ip_address = ( { ipv4 = "192.168.12.26";
ipv6 = "192:168:30::17";
active = "yes";
preference = "ipv4";
}
);
NETWORK_INTERFACES :
{
ENB_INTERFACE_NAME_FOR_S1_MME = "eth0";
ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.19/24";
ENB_INTERFACE_NAME_FOR_S1U = "eth0";
ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.19/24";
ENB_PORT_FOR_S1U = 2152; # Spec 2152
};
log_config :
{
global_log_level ="info";
global_log_verbosity ="medium";
hw_log_level ="info";
hw_log_verbosity ="medium";
phy_log_level ="info";
phy_log_verbosity ="medium";
mac_log_level ="info";
mac_log_verbosity ="high";
rlc_log_level ="info";
rlc_log_verbosity ="medium";
pdcp_log_level ="info";
pdcp_log_verbosity ="medium";
rrc_log_level ="info";
rrc_log_verbosity ="medium";
};
}
);
import os, subprocess, time, fcntl, termios, tty, signal, thread
from utils import log
class connection:
def __init__(self, description, host, user, password):
self.description = description
self.host = host
self.user = user
self.password = password
self.sendlock = thread.allocate_lock()
try:
(pid, fd) = os.forkpty()
except BaseException, e:
log("ERROR: forkpty for '" + description + "': " + e)
(pid, fd) = (-1, -1)
if pid == -1:
log("ERROR: creating connection for '" + description + "'")
os._exit(1)
# child process, run ssh
if pid == 0:
try:
os.execvp('sshpass', ['sshpass', '-p', password,
'ssh', user + '@' + host])
except BaseException, e:
log("ERROR: execvp for '" + description + "': " + e)
log("ERROR: execvp failed for '" + description + "'")
os._exit(1)
# parent process
# make the TTY raw to avoid getting input printed and no ^M
try:
tty.setraw(fd, termios.TCSANOW)
except BaseException, e:
log("ERROR: failed configuring TTY: " + str(e))
os._exit(1)
# try:
# fcntl.fcntl(fd, fcntl.F_SETFL,
# fcntl.fcntl(fd, fcntl.F_GETFL) | os.O_NONBLOCK)
# except:
# log("ERROR: fcntl failed for '" + description + "'")
# os._exit(1)
self.pid = pid
self.fd = fd
self.active = True
self.retcode = -1
def send(self, string):
if self.active == False:
log("ERROR: send: child is dead for '" + self.description + "'")
return -1
try:
(pid, out) = os.waitpid(self.pid, os.WNOHANG)
except BaseException, e:
log("ERROR: send: waitpid failed for '" + self.description +
"': " + str(e))
(pid, out) = (self.pid, 1)
if pid != 0:
log("ERROR: send: child process dead for '" +
self.description + "'")
try:
os.close(self.fd)
except BaseException, e:
#we don't care about errors at this point
pass
self.active = False
self.retcode = out
return -1
self.sendlock.acquire()
length = len(string)
while length != 0:
try:
ret = os.write(self.fd, string)
except BaseException, e:
log("ERROR: send fails for '" + self.description + "': " +
str(e))
os._exit(1)
if ret == 0:
log("ERROR: send: write returns 0 for '" +
self.description + "'")
os._exit(1)
length = length - ret
string = string[ret:]
self.sendlock.release()
return 0
def kill(self, signal=signal.SIGTERM):
log("INFO: kill connection '" + self.description + "'")
try:
os.kill(self.pid, signal)
except BaseException, e:
log("ERROR: connection.kill: " + str(e))
import threading, os
from utils import log
class MachineWaiterThread(threading.Thread):
def __init__(self, machine, tasks):
threading.Thread.__init__(self)
self.machine = machine
self.tasks = tasks
def run(self):
try:
for task in self.tasks:
ret = task.wait()
if ret != 0:
log("ERROR: task '" + task.description + "' failed " +
"on machine " + self.machine.name)
task.postaction()
self.machine.unbusy()
except BaseException, e:
log("ERROR: MachineWaiterThread: " + str(e))
os._exit(1)
class Machine():
def __init__(self, machine, cond):
self.name = machine
self.free = True
self.cond = cond
def busy(self, tasks):
waiter = MachineWaiterThread(self, tasks)
waiter.start()
def unbusy(self):
self.cond.acquire()
self.free = True
self.cond.notify()
self.cond.release()
class MachineList():
def __init__(self, list):
self.list = []
self.cond = threading.Condition()
for m in list:
self.list.append(Machine(m, self.cond))
def get_free_machine(self):
try:
self.cond.acquire()
while True:
free_machine = None
for m in self.list:
if m.free == True:
free_machine = m
break
if free_machine != None:
break
self.cond.wait()
free_machine.free = False
self.cond.release()
except BaseException, e:
log("ERROR: machine_list: " + str(e))
os._exit(1)
return free_machine
def wait_all_free(self):
try:
self.cond.acquire()
while True:
all_free = True
for m in self.list:
if m.free == False:
all_free = False
break
if all_free == True:
break
self.cond.wait()
self.cond.release()
except BaseException, e:
log("ERROR: machine_list: " + str(e))
os._exit(1)
This diff is collapsed.
This diff is collapsed.
import subprocess, os, thread, sys, time
#logging facitiliy
#TODO: simplify (a first version redefined stdout, then we replaced 'print'
#instead, keeping stuff as is)
class Logger:
def __init__(self, stream):
self.stream = stream
self.start_of_line = True
self.lock = thread.allocate_lock()
openair_dir = os.environ.get('OPENAIR_DIR')
if openair_dir == None:
print "FATAL: no OPENAIR_DIR"
os._exit(1)
try:
self.logfile = open(openair_dir +
"/cmake_targets/autotests/log/python.stdout", "w")
except BaseException, e:
print "FATAL: cannot create log file"
print e
os._exit(1)
def put(self, data):
self.stream.write(data)
self.logfile.write(data)
def write(self, data):
self.lock.acquire()
for c in data:
if self.start_of_line:
self.start_of_line = False
t = time.strftime("%H:%M:%S", time.localtime()) + ": "
self.stream.write(t)
self.logfile.write(t)
self.put(c)
if c == '\n':
self.start_of_line = True
self.stream.flush()
self.logfile.flush()
self.lock.release()
logger = Logger(sys.stdout)
def log(x):
logger.write(x + "\n")
#check if given test is in list
#it is in list if one of the strings in 'list' is at the beginning of 'test'
def test_in_list(test, list):
for check in list:
check=check.replace('+','')
if (test.startswith(check)):
return True
return False
#run a local command in a shell
def quickshell(command):
process = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE,
stderr=subprocess.STDOUT)
(retout, reterr) = process.communicate()
if (process.returncode != 0):
log("ERROR: shell command failed: " + command)
if len(retout):
log("ERROR: command says: ")
for l in retout.splitlines():
log("ERROR: " + l)
os._exit(1)
return retout
RED="\x1b[31m"
GREEN="\x1b[32m"
YELLOW="\x1b[33m"
RESET="\x1b[m"
#an exception raised when a test fails
class TestFailed(Exception):
pass
#this function returns True if a test in 'x' is set to True
#to be used as: if do_tests(tests['b210']['alu']) ...
def do_tests(x):
if type(x) == list:
for v in x:
if do_tests(v): return True
return False
if type(x) == dict: return do_tests(x.values())
if x == True: return True
return False
......@@ -661,9 +661,9 @@ function main() {
CMakeFiles/nasmesh/nasmesh.ko $dbin/nasmesh.ko
#oai_nw_drv
compilations \
$oaisim_build_dir oai_nw_drv \
CMakeFiles/oai_nw_drv/oai_nw_drv.ko $dbin/oai_nw_drv.ko
#compilations \
# $oaisim_build_dir oai_nw_drv \
# CMakeFiles/oai_nw_drv/oai_nw_drv.ko $dbin/oai_nw_drv.ko
fi
cmake_file=$DIR/oaisim_mme_build_oai/CMakeLists.txt
......
#!/bin/bash
#WARNING: this file may not work properly, be sure to know what you
#do when using it
#/*
# * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
# * contributor license agreements. See the NOTICE file distributed with
# * this work for additional information regarding copyright ownership.
# * The OpenAirInterface Software Alliance licenses this file to You under
# * the OAI Public License, Version 1.0 (the "License"); you may not use this file
# * except in compliance with the License.
# * You may obtain a copy of the License at
# *
# * http://www.openairinterface.org/?page_id=698
# *
# * Unless required by applicable law or agreed to in writing, software
# * distributed under the License is distributed on an "AS IS" BASIS,
# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# * See the License for the specific language governing permissions and
# * limitations under the License.
# *-------------------------------------------------------------------------------
# * For more information about the OpenAirInterface (OAI) Software Alliance:
# * contact@openairinterface.org
# */
################################################################################
# file init_nas_s1
# brief loads the ue_ip module and sets up IP for the UE
# you may want to edit it to fit your settings (replace oip0 by oipX for
# instance)
# author Florian Kaltenberger
#
#######################################
LTEIF=oip0
#OPENAIR_DIR=/home/oai/svn-oai/openair4G
load_module() {
mod_name=${1##*/}
mod_name=${mod_name%.*}
if awk "/$mod_name/ {found=1 ;exit} END {if (found!=1) exit 1}" /proc/modules
then
echo "module $mod_name already loaded: I remove it first"
sudo rmmod $mod_name
fi
echo loading $mod_name
sudo insmod $1
}
load_module $OPENAIR_DIR/targets/bin/ue_ip.ko
if [ "$1" = "UE" ]; then
echo "bring up oip0 interface for UE"
ifconfig oip0 up
fi
ip route flush cache
sleep 1
sysctl -w net.ipv4.conf.all.log_martians=1
echo "Disabling reverse path filtering"
sysctl -w net.ipv4.conf.all.rp_filter=0
ip route flush cache
# Check table 200 lte in /etc/iproute2/rt_tables
fgrep lte /etc/iproute2/rt_tables > /dev/null
if [ $? -ne 0 ]; then
echo "200 lte " >> /etc/iproute2/rt_tables
fi
ip rule add fwmark 1 table lte
ip route add default dev $LTEIF table lte
......@@ -1938,3 +1938,82 @@ ID = VCD_FUNCTION_RECV_IF5
DESC = VCD function RECV_IF5
GROUP = ALL:VCD:ENB:VCD_FUNCTION
FORMAT = int,value
#################
#### UE LOGS ####
#################
#general logs
ID = UE_MASTER_TICK
DESC = UE master tick - one tick per ms, to be used as "reference clock", mostly for ticktime view
GROUP = ALL:GENERAL:UE
FORMAT = int,eNB_ID : int,frame : int,subframe
#PHY logs
ID = UE_PHY_UL_TICK
DESC = UE uplink tick - one tick per ms at start of uplink processing
GROUP = ALL:PHY:GRAPHIC:UE
FORMAT = int,eNB_ID : int,frame : int,subframe
ID = UE_PHY_DL_TICK
DESC = UE downlink tick - one tick per ms at start of downlink processing
GROUP = ALL:PHY:GRAPHIC:UE
FORMAT = int,eNB_ID : int,frame : int,subframe
ID = UE_PHY_DLSCH_UE_DCI
DESC = UE downlink UE specific DCI as sent by the PHY layer
GROUP = ALL:PHY:GRAPHIC:UE
FORMAT = int,eNB_ID : int,frame : int,subframe : int,UE_id : int,rnti : int,dci_format : int,harq_pid : int,mcs : int,TBS
ID = UE_PHY_DLSCH_UE_ACK
DESC = UE downlink UE ACK as seen by the PHY layer in process_HARQ_feedback
GROUP = ALL:PHY:GRAPHIC:UE
FORMAT = int,eNB_ID : int,frame : int,subframe : int,UE_id : int,rnti : int,harq_pid
ID = UE_PHY_DLSCH_UE_NACK
DESC = UE downlink UE NACK as seen by the PHY layer in process_HARQ_feedback
GROUP = ALL:PHY:GRAPHIC:UE
FORMAT = int,eNB_ID : int,frame : int,subframe : int,UE_id : int,rnti : int,harq_pid
ID = UE_PHY_ULSCH_UE_DCI
DESC = UE uplink UE specific DCI as sent by the PHY layer
GROUP = ALL:PHY:GRAPHIC:UE
FORMAT = int,eNB_ID : int,frame : int,subframe : int,UE_id : int,rnti : int,harq_pid : int,mcs : int,round : int,first_rb : int,nb_rb : int,TBS
ID = UE_PHY_ULSCH_UE_ACK
DESC = UE uplink UE ACK as seen by the PHY layer
GROUP = ALL:PHY:GRAPHIC:UE
FORMAT = int,eNB_ID : int,frame : int,subframe : int,UE_id : int,rnti : int,harq_pid
ID = UE_PHY_ULSCH_UE_NACK
DESC = UE uplink UE NACK as seen by the PHY layer
GROUP = ALL:PHY:GRAPHIC:UE
FORMAT = int,eNB_ID : int,frame : int,subframe : int,UE_id : int,rnti : int,harq_pid
ID = UE_PHY_INPUT_SIGNAL
DESC = UE received signal in the time domain for a duration of 1ms
GROUP = ALL:PHY:GRAPHIC:HEAVY:UE
FORMAT = int,eNB_ID : int,frame : int,subframe : int,antenna : buffer,rxdata
ID = UE_PHY_DL_CHANNEL_ESTIMATE
DESC = UE channel estimation in the time domain
GROUP = ALL:PHY:GRAPHIC:HEAVY:UE
FORMAT = int,eNB_ID : int,UE_ID : int,frame : int,subframe : int,antenna : buffer,chest_t
ID = UE_PHY_PDCCH_IQ
DESC = UE PDCCH received IQ data
GROUP = ALL:PHY:GRAPHIC:HEAVY:UE
FORMAT = int,nb_rb : int,NB_RB_DL : int,symbols_per_tti : buffer,rxdataF_comp
ID = UE_PHY_PDCCH_ENERGY
DESC = UE PDSCH 1 energy and threshold
GROUP = ALL:PHY:GRAPHIC:HEAVY:UE
FORMAT = int,eNB_ID : int,UE_ID : int,frame : int,subframe : int,pdcch_ch_level00 : int,pdcch_ch_level01 : int,pdcch_ch_level10: int,pdcch_ch_level11
ID = UE_PHY_PDSCH_IQ
DESC = UE PDSCH received IQ data
GROUP = ALL:PHY:GRAPHIC:HEAVY:UE
FORMAT = int,eNB_ID : int,UE_ID : int,frame : int,subframe : int,nb_rb : int,N_RB_UL : int,symbols_per_tti : buffer,pusch_comp
ID = UE_PHY_PDSCH_ENERGY
DESC = UE PDSCH 1 energy and threshold
GROUP = ALL:PHY:GRAPHIC:HEAVY:UE
FORMAT = int,eNB_ID : int,UE_ID : int,frame : int,subframe : int,pdsch_ch_level00 : int,pdsch_ch_level01 : int,pdsch_ch_level10: int,pdsch_ch_level11
ID = UE_PHY_PUSCH_TX_POWER
DESC = UE PUSCH tx power
GROUP = ALL:PHY:GRAPHIC:HEAVY:UE
FORMAT = int,eNB_ID : int,UE_id : int,frame : int,subframe : int,p0_pusch : int,ampl: int,g_pusch: int,pl: int,nb_rb
ID = UE_PHY_PUCCH_TX_POWER
DESC = UE PDSCH 1 energy and threshold
GROUP = ALL:PHY:GRAPHIC:HEAVY:UE
FORMAT = int,eNB_ID : int,UE_id : int,frame : int,subframe : int,p0_pucch : int,ampl: int,g_pucch: int,pl
ID = UE_PHY_MEAS
DESC = UE PHY measurements
GROUP = ALL:PHY:GRAPHIC:HEAVY:UE
FORMAT = int,eNB_ID : int,UE_ID : int,frame : int,subframe : int,rsrp : int,rssi : int,snr: int,rx_power: int,noise_power: int,w_cqi: int,freq_offset
......@@ -5,7 +5,7 @@ CFLAGS=-Wall -g -pthread -DT_TRACER -I.
LIBS=-lX11 -lm -lpng -lXft
all: record replay extract_config textlog enb vcd macpdu2wireshark
all: record replay extract_config textlog enb ue vcd macpdu2wireshark
record: utils.o record.o database.o config.o
$(CC) $(CFLAGS) -o record $^ $(LIBS)
......@@ -26,6 +26,11 @@ enb: utils.o enb.o database.o event.o handler.o config.o \
filter/filter.a
$(CC) $(CFLAGS) -o enb $^ $(LIBS)
ue: utils.o ue.o database.o event.o handler.o config.o \
event_selector.o view/view.a gui/gui.a logger/logger.a \
filter/filter.a
$(CC) $(CFLAGS) -o ue $^ $(LIBS)
vcd: utils.o vcd.o database.o event.o handler.o config.o \
event_selector.o view/view.a gui/gui.a logger/logger.a \
filter/filter.a
......
......@@ -349,6 +349,36 @@ static void enb_main_gui(enb_gui *e, gui *g, event_handler *h, void *database,
logger_add_view(l, v);
e->ul_mcs_logger = l;
/* UE x DL PHY (truly: DCI) throughput */
col = new_container(g, VERTICAL);
widget_add_child(g, line, col, -1);
w = new_xy_plot(g, 70, 10, "DL PHY [0]", 35);
w2 = new_textarea(g, 70, 11, 64);
xy_plot_set_range(g, w, 0, 1000, 0, 100000);
xy_plot_set_tick_type(g, w, XY_PLOT_SCROLL_TICK);
widget_add_child(g, col, w2, -1);
widget_add_child(g, col, w, -1);
container_set_child_growable(g, col, w, 1);
l = new_throughputlog(h, database, "ENB_PHY_DL_TICK", "frame", "subframe",
"ENB_PHY_DLSCH_UE_DCI", "TBS");
v = new_view_scrolltti(10, g, w, new_color(g, "#0c0c72"), w2);
logger_add_view(l, v);
/* UE x UL PHY (truly: DCI) throughput */
col = new_container(g, VERTICAL);
widget_add_child(g, line, col, -1);
w = new_xy_plot(g, 70, 10, "UL PHY [0]", 35);
w2 = new_textarea(g, 70, 11, 64);
xy_plot_set_range(g, w, 0, 1000, 0, 100000);
xy_plot_set_tick_type(g, w, XY_PLOT_SCROLL_TICK);
widget_add_child(g, col, w2, -1);
widget_add_child(g, col, w, -1);
container_set_child_growable(g, col, w, 1);
l = new_throughputlog(h, database, "ENB_PHY_DL_TICK", "frame", "subframe",
"ENB_PHY_ULSCH_UE_DCI", "TBS");
v = new_view_scrolltti(10, g, w, new_color(g, "#0c0c72"), w2);
logger_add_view(l, v);
/* downlink/uplink UE DCIs */
widget_add_child(g, top_container,
new_label(g,"DL/UL TICK/DCI/ACK/NACK [all UEs]"), -1);
......
This diff is collapsed.
......@@ -81,13 +81,13 @@
#define ITTI_DEBUG_ISSUES (1<<5)
#define ITTI_DEBUG_MP_STATISTICS (1<<6)
const int itti_debug = ITTI_DEBUG_ISSUES | ITTI_DEBUG_MP_STATISTICS;
const int itti_debug = (ITTI_DEBUG_ISSUES | ITTI_DEBUG_MP_STATISTICS);
/* Don't flush if using RTAI */
#ifdef RTAI
# define ITTI_DEBUG(m, x, args...) do { if ((m) & itti_debug) rt_log_debug (x, ##args); } while(0);
#else
# define ITTI_DEBUG(m, x, args...) do { if ((m) & itti_debug) fprintf(stdout, "[ITTI][D]"x, ##args); fflush (stdout); } while(0);
# define ITTI_DEBUG(m, x, args...) do { if ((m) & itti_debug) {fprintf(stdout, "[ITTI][D]"x, ##args); fflush (stdout);} } while(0);
#endif
#define ITTI_ERROR(x, args...) do { fprintf(stdout, "[ITTI][E]"x, ##args); fflush (stdout); } while(0);
......
......@@ -71,7 +71,5 @@ typedef struct {
#define INSTANCE_DEFAULT (UINT16_MAX - 1)
#define INSTANCE_ALL (UINT16_MAX)
typedef uint16_t instance_t;
#endif
......@@ -256,6 +256,7 @@ int test_logmap8(LTE_eNB_DLSCH_t *dlsch_eNB,
&PHY_vars_UE->lte_frame_parms,
PHY_vars_UE->dlsch_ue[0][0],
PHY_vars_UE->dlsch_ue[0][0]->harq_processes[PHY_vars_UE->dlsch_ue[0][0]->current_harq_pid],
frame,
subframe,
PHY_vars_UE->dlsch_ue[0][0]->current_harq_pid,
num_pdcch_symbols,1);
......
This diff is collapsed.
......@@ -22,6 +22,23 @@
#include "defs.h"
#include "log.h"
uint16_t dl_S_table_normal[10]={3,9,10,11,12,3,9,10,11,6};
uint16_t dl_S_table_extended[10]={3,8,9,10,3,8,9,5,0,0};
void set_S_config(LTE_DL_FRAME_PARMS *fp) {
int X = fp->srsX;
fp->ul_symbols_in_S_subframe=(1+X);
if ((fp->Ncp==EXTENDED) && (fp->tdd_config_S>7))
AssertFatal(1==0,"Illegal S subframe configuration for Extended Prefix mode\n");
fp->dl_symbols_in_S_subframe = (fp->Ncp==NORMAL)?dl_S_table_normal[fp->tdd_config_S] : dl_S_table_extended[fp->tdd_config_S];
}
int init_frame_parms(LTE_DL_FRAME_PARMS *frame_parms,uint8_t osf)
{
......@@ -29,7 +46,7 @@ int init_frame_parms(LTE_DL_FRAME_PARMS *frame_parms,uint8_t osf)
LOG_I(PHY,"Initializing frame parms for N_RB_DL %d, Ncp %d, osf %d\n",frame_parms->N_RB_DL,frame_parms->Ncp,osf);
if (frame_parms->Ncp==1) {
if (frame_parms->Ncp==EXTENDED) {
frame_parms->nb_prefix_samples0=512;
frame_parms->nb_prefix_samples = 512;
frame_parms->symbols_per_tti = 12;
......@@ -37,8 +54,10 @@ int init_frame_parms(LTE_DL_FRAME_PARMS *frame_parms,uint8_t osf)
frame_parms->nb_prefix_samples0 = 160;
frame_parms->nb_prefix_samples = 144;
frame_parms->symbols_per_tti = 14;
}
switch(osf) {
case 1:
log2_osf = 0;
......@@ -167,6 +186,8 @@ int init_frame_parms(LTE_DL_FRAME_PARMS *frame_parms,uint8_t osf)
printf("lte_parms.c: Setting N_RB_DL to %d, ofdm_symbol_size %d\n",frame_parms->N_RB_DL, frame_parms->ofdm_symbol_size);
if (frame_parms->frame_type == TDD) set_S_config(frame_parms);
// frame_parms->tdd_config=3;
return(0);
}
......
......@@ -34,7 +34,7 @@
*/
/*!\brief Timing drift hysterisis in samples*/
#define SYNCH_HYST 1
#define SYNCH_HYST 2
/*!
\brief This function is used for time-frequency scanning prior to complete cell search. It scans
......@@ -180,6 +180,7 @@ This function computes the time domain channel response, finds the peak and adju
void lte_adjust_synch(LTE_DL_FRAME_PARMS *frame_parms,
PHY_VARS_UE *phy_vars_ue,
module_id_t eNb_id,
uint8_t subframe,
unsigned char clear,
short coef);
......@@ -187,7 +188,8 @@ void lte_adjust_synch(LTE_DL_FRAME_PARMS *frame_parms,
void lte_ue_measurements(PHY_VARS_UE *phy_vars_ue,
unsigned int subframe_offset,
unsigned char N0_symbol,
unsigned char abstraction_flag);
unsigned char abstraction_flag,
uint8_t subframe);
//! \brief This function performance RSRP/RSCP measurements
void ue_rrc_measurements(PHY_VARS_UE *phy_vars_ue,
......
......@@ -34,6 +34,7 @@
void lte_adjust_synch(LTE_DL_FRAME_PARMS *frame_parms,
PHY_VARS_UE *ue,
unsigned char eNB_id,
uint8_t subframe,
unsigned char clear,
short coef)
{
......@@ -48,7 +49,7 @@ void lte_adjust_synch(LTE_DL_FRAME_PARMS *frame_parms,
ncoef = 32767 - coef;
#ifdef DEBUG_PHY
LOG_D(PHY,"frame %d: rx_offset (before) = %d\n",ue->proc.proc_rxtx[0].frame_rx,ue->rx_offset);
LOG_D(PHY,"AbsSubframe %d.%d: rx_offset (before) = %d\n",ue->proc.proc_rxtx[0].frame_rx%1024,subframe,ue->rx_offset);
#endif //DEBUG_PHY
......@@ -57,8 +58,8 @@ void lte_adjust_synch(LTE_DL_FRAME_PARMS *frame_parms,
temp = 0;
for (aa=0; aa<frame_parms->nb_antennas_rx; aa++) {
Re = ((int16_t*)ue->common_vars.dl_ch_estimates_time[eNB_id][aa])[(i<<2)];
Im = ((int16_t*)ue->common_vars.dl_ch_estimates_time[eNB_id][aa])[1+(i<<2)];
Re = ((int16_t*)ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates_time[eNB_id][aa])[(i<<2)];
Im = ((int16_t*)ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates_time[eNB_id][aa])[1+(i<<2)];
temp += (Re*Re/2) + (Im*Im/2);
}
......@@ -74,13 +75,15 @@ void lte_adjust_synch(LTE_DL_FRAME_PARMS *frame_parms,
else
max_pos_fil = ((max_pos_fil * coef) + (max_pos * ncoef)) >> 15;
// do not filter to have proactive timing adjustment
max_pos_fil = max_pos;
diff = max_pos_fil - frame_parms->nb_prefix_samples/8;
diff = max_pos_fil - (frame_parms->nb_prefix_samples>>3);
if ( diff > SYNCH_HYST )
ue->rx_offset++;
else if (diff < -SYNCH_HYST)
ue->rx_offset--;
if ( abs(diff) < SYNCH_HYST )
ue->rx_offset = 0;
else
ue->rx_offset = diff;
if ( ue->rx_offset < 0 )
ue->rx_offset += FRAME_LENGTH_COMPLEX_SAMPLES;
......@@ -91,8 +94,8 @@ void lte_adjust_synch(LTE_DL_FRAME_PARMS *frame_parms,
#ifdef DEBUG_PHY
LOG_D(PHY,"frame %d: rx_offset (after) = %d : max_pos = %d,max_pos_fil = %d (peak %d)\n",
ue->proc.proc_rxtx[0].frame_rx,ue->rx_offset,max_pos,max_pos_fil,temp);
LOG_D(PHY,"AbsSubframe %d.%d: rx_offset (after) = %d : max_pos = %d,max_pos_fil = %d (peak %d) target_pos %d \n",
ue->proc.proc_rxtx[0].frame_rx,subframe,ue->rx_offset,max_pos,max_pos_fil,temp,(frame_parms->nb_prefix_samples>>3));
#endif //DEBUG_PHY
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_ADJUST_SYNCH, VCD_FUNCTION_OUT);
......
......@@ -70,9 +70,9 @@ int lte_dl_bf_channel_estimation(PHY_VARS_UE *phy_vars_ue,
else
rballoc = dlsch0_harq->rb_alloc_even;
rxdataF = phy_vars_ue->common_vars.rxdataF;
rxdataF = phy_vars_ue->common_vars.common_vars_rx_data_per_thread[(Ns>>1)&0x1].rxdataF;
dl_bf_ch_estimates = phy_vars_ue->pdsch_vars[eNB_id]->dl_bf_ch_estimates;
dl_bf_ch_estimates = phy_vars_ue->pdsch_vars[(Ns>>1)&0x1][eNB_id]->dl_bf_ch_estimates;
beamforming_mode = phy_vars_ue->transmission_mode[eNB_id]>6 ? phy_vars_ue->transmission_mode[eNB_id] : 0;
if (phy_vars_ue->high_speed_flag == 0) // use second channel estimate position for temporary storage
......
......@@ -25,6 +25,7 @@
#include "defs.h"
#include "PHY/defs.h"
#include "filt96_32.h"
#include "T.h"
//#define DEBUG_CH
int lte_dl_channel_estimation(PHY_VARS_UE *ue,
......@@ -43,12 +44,14 @@ int lte_dl_channel_estimation(PHY_VARS_UE *ue,
int ch_offset,symbol_offset;
// unsigned int n;
// int i;
static int interpolateS11S12 = 1;
uint16_t Nid_cell = (eNB_offset == 0) ? ue->frame_parms.Nid_cell : ue->measurements.adj_cell_id[eNB_offset-1];
uint8_t nushift,pilot1,pilot2,pilot3;
int **dl_ch_estimates=ue->common_vars.dl_ch_estimates[eNB_offset];
int **rxdataF=ue->common_vars.rxdataF;
int **dl_ch_estimates =ue->common_vars.common_vars_rx_data_per_thread[(Ns>>1)&0x1].dl_ch_estimates[eNB_offset];
int **dl_ch_estimates_previous=ue->common_vars.common_vars_rx_data_per_thread[((Ns>>1)+1)&0x1].dl_ch_estimates[eNB_offset];
int **rxdataF=ue->common_vars.common_vars_rx_data_per_thread[(Ns>>1)&0x1].rxdataF;
if (ue->frame_parms.Ncp == 0) { // normal prefix
pilot1 = 4;
......@@ -637,13 +640,19 @@ int lte_dl_channel_estimation(PHY_VARS_UE *ue,
if (symbol == 0) {
// printf("Interpolating %d->0\n",4-ue->frame_parms.Ncp);
// dl_ch_prev = (int16_t *)&dl_ch_estimates[(p<<1)+aarx][(4-ue->frame_parms.Ncp)*(ue->frame_parms.ofdm_symbol_size)];
dl_ch_prev = (int16_t *)&dl_ch_estimates[(p<<1)+aarx][pilot3*(ue->frame_parms.ofdm_symbol_size)];
if(((Ns>>1)!=0) || ( ((Ns>>1)==0) && interpolateS11S12))
{
//LOG_D(PHY,"Interpolate s11-->s0 to get s12 and s13 Ns %d \n", Ns);
dl_ch_prev = (int16_t *)&dl_ch_estimates_previous[(p<<1)+aarx][pilot3*(ue->frame_parms.ofdm_symbol_size)];
multadd_complex_vector_real_scalar(dl_ch_prev,21845,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),1,ue->frame_parms.ofdm_symbol_size);
multadd_complex_vector_real_scalar(dl_ch,10923,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),0,ue->frame_parms.ofdm_symbol_size);
multadd_complex_vector_real_scalar(dl_ch_prev,21845,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),1,ue->frame_parms.ofdm_symbol_size);
multadd_complex_vector_real_scalar(dl_ch,10923,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),0,ue->frame_parms.ofdm_symbol_size);
multadd_complex_vector_real_scalar(dl_ch_prev,10923,dl_ch_prev+(2*((ue->frame_parms.ofdm_symbol_size)<<1)),1,ue->frame_parms.ofdm_symbol_size);
multadd_complex_vector_real_scalar(dl_ch,21845,dl_ch_prev+(2*((ue->frame_parms.ofdm_symbol_size)<<1)),0,ue->frame_parms.ofdm_symbol_size);
multadd_complex_vector_real_scalar(dl_ch_prev,10923,dl_ch_prev+(2*((ue->frame_parms.ofdm_symbol_size)<<1)),1,ue->frame_parms.ofdm_symbol_size);
multadd_complex_vector_real_scalar(dl_ch,21845,dl_ch_prev+(2*((ue->frame_parms.ofdm_symbol_size)<<1)),0,ue->frame_parms.ofdm_symbol_size);
}
interpolateS11S12 = 1;
} // this is 1/3,2/3 combination for pilots spaced by 3 symbols
else if (symbol == pilot1) {
dl_ch_prev = (int16_t *)&dl_ch_estimates[(p<<1)+aarx][0];
......@@ -692,6 +701,38 @@ int lte_dl_channel_estimation(PHY_VARS_UE *ue,
multadd_complex_vector_real_scalar(dl_ch_prev,21845,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)<<1),1,ue->frame_parms.ofdm_symbol_size);
multadd_complex_vector_real_scalar(dl_ch,10923,dl_ch_prev+(2*((ue->frame_parms.ofdm_symbol_size)<<1)),0,ue->frame_parms.ofdm_symbol_size);
} // pilot spacing 3 symbols (1/3,2/3 combination)
if((ue->rx_offset_diff !=0) && ((Ns>>1) == 9))
{
//LOG_D(PHY,"Extrapolate s7-->s11 to get s12 and s13 Ns %d\n", Ns);
interpolateS11S12 = 0;
//LOG_E(PHY,"Interpolate s7--s11 s12 s13 pilot 3 Ns %d l %d symbol %d \n", Ns, l, symbol);
int16_t *dlChEst_ofdm11 = (int16_t *)&dl_ch_estimates[(p<<1)+aarx][pilot3*(ue->frame_parms.ofdm_symbol_size)];
int16_t *dlChEst_ofdm7 = (int16_t *)&dl_ch_estimates[(p<<1)+aarx][pilot2*(ue->frame_parms.ofdm_symbol_size)];
// interpolate ofdm s12: 5/4*ofdms11 + -1/4*ofdms7 5/4 q1.15 40960 -1/4 q1.15 8192
int16_t *dlChEst_ofdm12 = (int16_t *)&dl_ch_estimates[(p<<1)+aarx][12*ue->frame_parms.ofdm_symbol_size];
for(int i=0; i<(2*ue->frame_parms.ofdm_symbol_size); i++)
{
int64_t tmp_mult = 0;
tmp_mult = ((int64_t)dlChEst_ofdm11[i] * 40960 - (int64_t)dlChEst_ofdm7[i] * 8192);
tmp_mult = tmp_mult >> 15;
dlChEst_ofdm12[i] = tmp_mult;
}
// interpolate ofdm s13: 3/2*ofdms11 + -1/2*ofdms7 3/2 q1.15 49152 1/2 q1.15 16384
int16_t *dlChEst_ofdm13 = (int16_t *)&dl_ch_estimates[(p<<1)+aarx][13*ue->frame_parms.ofdm_symbol_size];
for(int i=0; i<(2*ue->frame_parms.ofdm_symbol_size); i++)
{
int64_t tmp_mult = 0;
tmp_mult = ((int64_t)dlChEst_ofdm11[i] * 49152 - (int64_t)dlChEst_ofdm7[i] * 16384);
tmp_mult = tmp_mult >> 15;
dlChEst_ofdm13[i] = tmp_mult;
}
}
}
}
......@@ -733,11 +774,17 @@ int lte_dl_channel_estimation(PHY_VARS_UE *ue,
// do ifft of channel estimate
for (aarx=0; aarx<ue->frame_parms.nb_antennas_rx; aarx++)
for (p=0; p<ue->frame_parms.nb_antenna_ports_eNB; p++) {
if (ue->common_vars.dl_ch_estimates[eNB_offset][(p<<1)+aarx])
idft((int16_t*) &ue->common_vars.dl_ch_estimates[eNB_offset][(p<<1)+aarx][8],
(int16_t*) ue->common_vars.dl_ch_estimates_time[eNB_offset][(p<<1)+aarx],1);
if (ue->common_vars.common_vars_rx_data_per_thread[(Ns>>1)&0x1].dl_ch_estimates[eNB_offset][(p<<1)+aarx])
idft((int16_t*) &ue->common_vars.common_vars_rx_data_per_thread[(Ns>>1)&0x1].dl_ch_estimates[eNB_offset][(p<<1)+aarx][8],
(int16_t*) ue->common_vars.common_vars_rx_data_per_thread[(Ns>>1)&0x1].dl_ch_estimates_time[eNB_offset][(p<<1)+aarx],1);
}
#if T_TRACER
T(T_UE_PHY_DL_CHANNEL_ESTIMATE, T_INT(eNB_id), T_INT(ue->Mod_id),
T_INT(ue->proc.proc_rxtx[(Ns>>1)&1].frame_rx%1024), T_INT(ue->proc.proc_rxtx[(Ns>>1)&1].subframe_rx),
T_INT(0), T_BUFFER(&ue->common_vars.common_vars_rx_data_per_thread[(Ns>>1)&0x1].dl_ch_estimates_time[eNB_offset][0][0], 512 * 4));
#endif
return(0);
}
......@@ -44,8 +44,8 @@ int lte_dl_mbsfn_channel_estimation(PHY_VARS_UE *ue,
// unsigned int n;
// int i;
int **dl_ch_estimates=ue->common_vars.dl_ch_estimates[0];
int **rxdataF=ue->common_vars.rxdataF;
int **dl_ch_estimates=ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[0];
int **rxdataF=ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF;
ch_offset = (l*(ue->frame_parms.ofdm_symbol_size));
symbol_offset = ch_offset;//phy_vars_ue->lte_frame_parms.ofdm_symbol_size*l;
......@@ -734,31 +734,31 @@ int lte_dl_mbsfn_channel_estimation(PHY_VARS_UE *ue,
// do ifft of channel estimate
for (aa=0; aa<ue->frame_parms.nb_antennas_rx*ue->frame_parms.nb_antennas_tx; aa++) {
if (ue->common_vars.dl_ch_estimates[eNB_offset][aa]) {
if (ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_offset][aa]) {
switch (ue->frame_parms.N_RB_DL) {
case 6:
idft128((int16_t*) &ue->common_vars.dl_ch_estimates[eNB_offset][aa][8],
(int16_t*) ue->common_vars.dl_ch_estimates_time[eNB_offset][aa],
idft128((int16_t*) &ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_offset][aa][8],
(int16_t*) ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates_time[eNB_offset][aa],
1);
break;
case 25:
idft512((int16_t*) &ue->common_vars.dl_ch_estimates[eNB_offset][aa][8],
(int16_t*) ue->common_vars.dl_ch_estimates_time[eNB_offset][aa],
idft512((int16_t*) &ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_offset][aa][8],
(int16_t*) ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates_time[eNB_offset][aa],
1);
break;
case 50:
idft1024((int16_t*) &ue->common_vars.dl_ch_estimates[eNB_offset][aa][8],
(int16_t*) ue->common_vars.dl_ch_estimates_time[eNB_offset][aa],
idft1024((int16_t*) &ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_offset][aa][8],
(int16_t*) ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates_time[eNB_offset][aa],
1);
break;
case 75:
idft1536((int16_t*) &ue->common_vars.dl_ch_estimates[eNB_offset][aa][8],
(int16_t*) ue->common_vars.dl_ch_estimates_time[eNB_offset][aa],
idft1536((int16_t*) &ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_offset][aa][8],
(int16_t*) ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates_time[eNB_offset][aa],
1);
break;
case 100:
idft2048((int16_t*) &ue->common_vars.dl_ch_estimates[eNB_offset][aa][8],
(int16_t*) ue->common_vars.dl_ch_estimates_time[eNB_offset][aa],
idft2048((int16_t*) &ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_offset][aa][8],
(int16_t*) ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates_time[eNB_offset][aa],
1);
break;
default:
......
......@@ -510,14 +510,15 @@ int lte_sync_time_eNB(int32_t **rxdata, ///rx data in time domain
// perform a time domain correlation using the oversampled sync sequence
unsigned int n, ar, peak_val, peak_pos, mean_val;
unsigned int n, ar, peak_val, peak_pos;
uint64_t mean_val;
int result;
short *primary_synch_time;
int eNB_id = frame_parms->Nid_cell%3;
// msg("[SYNC TIME] Calling sync_time_eNB(%p,%p,%d,%d)\n",rxdata,frame_parms,eNB_id,length);
if (sync_corr_eNB == NULL) {
msg("[SYNC TIME] sync_corr_eNB not yet allocated! Exiting.\n");
LOG_E(PHY,"[SYNC TIME] sync_corr_eNB not yet allocated! Exiting.\n");
return(-1);
}
......@@ -535,7 +536,7 @@ int lte_sync_time_eNB(int32_t **rxdata, ///rx data in time domain
break;
default:
msg("[SYNC TIME] Illegal eNB_id!\n");
LOG_E(PHY,"[SYNC TIME] Illegal eNB_id!\n");
return (-1);
}
......@@ -567,7 +568,7 @@ int lte_sync_time_eNB(int32_t **rxdata, ///rx data in time domain
peak_val);
}
*/
mean_val += (sync_corr_eNB[n]>>10);
mean_val += sync_corr_eNB[n];
if (sync_corr_eNB[n]>peak_val) {
peak_val = sync_corr_eNB[n];
......@@ -575,17 +576,15 @@ int lte_sync_time_eNB(int32_t **rxdata, ///rx data in time domain
}
}
mean_val/=length;
*peak_val_out = peak_val;
if (peak_val <= (40*mean_val)) {
#ifdef DEBUG_PHY
msg("[SYNC TIME] No peak found (%u,%u,%u,%u)\n",peak_pos,peak_val,mean_val,40*mean_val);
#endif
if (peak_val <= (40*(uint32_t)mean_val)) {
LOG_D(PHY,"[SYNC TIME] No peak found (%u,%u,%u,%u)\n",peak_pos,peak_val,mean_val,40*mean_val);
return(-1);
} else {
#ifdef DEBUG_PHY
msg("[SYNC TIME] Peak found at pos %u, val = %u, mean_val = %u\n",peak_pos,peak_val,mean_val);
#endif
LOG_D(PHY,"[SYNC TIME] Peak found at pos %u, val = %u, mean_val = %u\n",peak_pos,peak_val,mean_val);
return(peak_pos);
}
......
......@@ -720,10 +720,11 @@ int32_t lte_srs_channel_estimation(LTE_DL_FRAME_PARMS *frame_parms,
//write_output("eNB_srs.m","srs_eNB",common_vars->srs,(frame_parms->ofdm_symbol_size),1,1);
mult_cpx_conj_vector((int16_t*) &common_vars->rxdataF[eNB_id][aa][2*frame_parms->ofdm_symbol_size*symbol],
(int16_t*) srs_vars->srs,
(int16_t*) srs_vars->srs_ch_estimates[eNB_id][aa],
frame_parms->ofdm_symbol_size,
15);
(int16_t*) srs_vars->srs,
(int16_t*) srs_vars->srs_ch_estimates[eNB_id][aa],
frame_parms->ofdm_symbol_size,
15,
0);
//msg("SRS channel estimation cmult out\n");
#ifdef USER_MODE
......
This diff is collapsed.
This diff is collapsed.
......@@ -675,12 +675,16 @@ typedef struct {
typedef struct {
/// HARQ process id
uint8_t harq_id;
/// ACK bits (after decoding)
/// ACK bits (after decoding) 0:NACK / 1:ACK / 2:DTX
uint8_t ack;
/// send status (for PUCCH)
uint8_t send_harq_status;
/// nCCE (for PUCCH)
uint8_t nCCE;
/// DAI value detected from DCI1/1a/1b/1d/2/2a/2b/2c. 0xff indicates not touched
uint8_t vDAI_DL;
/// DAI value detected from DCI0/4. 0xff indicates not touched
uint8_t vDAI_UL;
} harq_status_t;
typedef struct {
......
......@@ -118,7 +118,6 @@ LTE_eNB_DLSCH_t *new_eNB_dlsch(unsigned char Kmimo,unsigned char Mdlharq,uint32_
unsigned char exit_flag = 0,i,j,r,aa,layer;
int re;
unsigned char bw_scaling =1;
uint8_t nb_antennas_tx = frame_parms->nb_antennas_tx;
switch (N_RB_DL) {
case 6:
......
......@@ -159,6 +159,7 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue,
LTE_DL_FRAME_PARMS *frame_parms,
LTE_UE_DLSCH_t *dlsch,
LTE_DL_UE_HARQ_t *harq_process,
uint8_t frame,
uint8_t subframe,
uint8_t harq_pid,
uint8_t is_crnti,
......@@ -241,6 +242,11 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue,
return(dlsch->max_turbo_iterations);
}
if (dlsch->harq_ack[subframe].ack != 2) {
LOG_D(PHY, "[UE %d] DLSCH @ SF%d : ACK bit is %d instead of DTX even before PDSCH is decoded!\n",
phy_vars_ue->Mod_id, subframe, dlsch->harq_ack[subframe].ack);
}
if (llr8_flag == 0) {
//#ifdef __AVX2__
#if 0
......@@ -609,10 +615,20 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue,
//printf("CRC failed, segment %d\n",r);
err_flag = 1;
}
}
int32_t frame_rx_prev = frame;
int32_t subframe_rx_prev = subframe - 1;
if (subframe_rx_prev < 0) {
frame_rx_prev--;
subframe_rx_prev += 10;
}
frame_rx_prev = frame_rx_prev%1024;
if (err_flag == 1) {
LOG_D(PHY,"[UE %d] DLSCH: Setting NAK for SFN/SF %d/%d (pid %d, round %d, subframe %d)\n",
phy_vars_ue->Mod_id, frame_rx_prev, subframe_rx_prev, harq_pid, harq_process->round, subframe);
dlsch->harq_ack[subframe].ack = 0;
dlsch->harq_ack[subframe].harq_id = harq_pid;
dlsch->harq_ack[subframe].send_harq_status = 1;
......@@ -631,6 +647,9 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue,
return((1+dlsch->max_turbo_iterations));
} else {
LOG_D(PHY,"[UE %d] DLSCH: Setting ACK for SFN/SF %d/%d (pid %d, round %d, subframe %d)\n",
phy_vars_ue->Mod_id, frame_rx_prev, subframe_rx_prev, harq_pid, harq_process->round, subframe);
harq_process->status = SCH_IDLE;
harq_process->round = 0;
dlsch->harq_ack[subframe].ack = 1;
......@@ -640,6 +659,7 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue,
{
LOG_D(PHY,"[UE %d] DLSCH: Setting ACK for subframe %d (pid %d, round %d, TBS %d)\n",phy_vars_ue->Mod_id,subframe,harq_pid,harq_process->round,harq_process->TBS);
}
//LOG_D(PHY,"[UE %d] DLSCH: Setting ACK for subframe %d (pid %d, round %d)\n",phy_vars_ue->Mod_id,subframe,harq_pid,harq_process->round);
}
......
......@@ -595,7 +595,7 @@ int allocate_REs_in_RB(PHY_VARS_eNB* phy_vars_eNB,
int use2ndpilots = (frame_parms->mode1_flag==1)?1:0;
uint32_t tti_offset,aa;
uint32_t tti_offset; //,aa;
uint8_t re;
uint8_t qam64_table_offset_re = 0;
uint8_t qam64_table_offset_im = 0;
......
......@@ -118,7 +118,8 @@ void generate_nPRS(LTE_DL_FRAME_PARMS *frame_parms)
uint16_t next = 0;
uint8_t ns=0;
uint32_t fss_pusch = frame_parms->Nid_cell + frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.groupAssignmentPUSCH;
uint32_t fss_pucch = (frame_parms->Nid_cell) % 30;
uint32_t fss_pusch = (fss_pucch + frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.groupAssignmentPUSCH) % 30;
x2 = (32*(uint32_t)(frame_parms->Nid_cell/30)) + fss_pusch;
#ifdef DEBUG_GROUPHOP
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment