Commit 12cc3593 authored by Raymond.Knopp's avatar Raymond.Knopp

Merge branch 'develop' into develop-new-LMSSDR

Conflicts:
	targets/RT/USER/lte-softmodem.c
parents c70e705a dec41a2a
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
......@@ -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
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
#!/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);
......
......@@ -211,7 +211,7 @@ void phy_config_sib2_eNB(uint8_t Mod_id,
if (mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.present == MBSFN_SubframeConfig__subframeAllocation_PR_oneFrame) {
fp->MBSFN_config[i].fourFrames_flag = 0;
fp->MBSFN_config[i].mbsfn_SubframeConfig = mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.choice.oneFrame.buf[0]; // 6-bit subframe configuration
LOG_I(PHY, "[CONFIG] MBSFN_SubframeConfig[%d] pattern is %ld\n", i,
LOG_I(PHY, "[CONFIG] MBSFN_SubframeConfig[%d] pattern is %d\n", i,
fp->MBSFN_config[i].mbsfn_SubframeConfig);
} else if (mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.present == MBSFN_SubframeConfig__subframeAllocation_PR_fourFrames) { // 24-bit subframe configuration
fp->MBSFN_config[i].fourFrames_flag = 1;
......@@ -220,7 +220,7 @@ void phy_config_sib2_eNB(uint8_t Mod_id,
(mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.choice.oneFrame.buf[1]<<8)|
(mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.choice.oneFrame.buf[2]<<16);
LOG_I(PHY, "[CONFIG] MBSFN_SubframeConfig[%d] pattern is %ld\n", i,
LOG_I(PHY, "[CONFIG] MBSFN_SubframeConfig[%d] pattern is %d\n", i,
fp->MBSFN_config[i].mbsfn_SubframeConfig);
}
}
......@@ -331,7 +331,7 @@ void phy_config_sib2_ue(uint8_t Mod_id,int CC_id,
if (mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.present == MBSFN_SubframeConfig__subframeAllocation_PR_oneFrame) {
fp->MBSFN_config[i].fourFrames_flag = 0;
fp->MBSFN_config[i].mbsfn_SubframeConfig = mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.choice.oneFrame.buf[0]; // 6-bit subframe configuration
LOG_I(PHY, "[CONFIG] MBSFN_SubframeConfig[%d] pattern is %ld\n", i,
LOG_I(PHY, "[CONFIG] MBSFN_SubframeConfig[%d] pattern is %d\n", i,
fp->MBSFN_config[i].mbsfn_SubframeConfig);
} else if (mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.present == MBSFN_SubframeConfig__subframeAllocation_PR_fourFrames) { // 24-bit subframe configuration
fp->MBSFN_config[i].fourFrames_flag = 1;
......@@ -340,7 +340,7 @@ void phy_config_sib2_ue(uint8_t Mod_id,int CC_id,
(mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.choice.oneFrame.buf[1]<<8)|
(mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.choice.oneFrame.buf[2]<<16);
LOG_I(PHY, "[CONFIG] MBSFN_SubframeConfig[%d] pattern is %ld\n", i,
LOG_I(PHY, "[CONFIG] MBSFN_SubframeConfig[%d] pattern is %d\n", i,
fp->MBSFN_config[i].mbsfn_SubframeConfig);
}
}
......@@ -357,7 +357,7 @@ void phy_config_sib13_ue(uint8_t Mod_id,int CC_id,uint8_t eNB_id,int mbsfn_Area_
LTE_DL_FRAME_PARMS *fp = &PHY_vars_UE_g[Mod_id][CC_id]->frame_parms;
LOG_I(PHY,"[UE%d] Applying MBSFN_Area_id %d for index %d\n",Mod_id,mbsfn_AreaId_r9,mbsfn_Area_idx);
LOG_I(PHY,"[UE%d] Applying MBSFN_Area_id %ld for index %d\n",Mod_id,mbsfn_AreaId_r9,mbsfn_Area_idx);
if (mbsfn_Area_idx == 0) {
fp->Nid_cell_mbsfn = (uint16_t)mbsfn_AreaId_r9;
......@@ -376,7 +376,7 @@ void phy_config_sib13_eNB(uint8_t Mod_id,int CC_id,int mbsfn_Area_idx,
LTE_DL_FRAME_PARMS *fp = &PHY_vars_eNB_g[Mod_id][CC_id]->frame_parms;
LOG_I(PHY,"[eNB%d] Applying MBSFN_Area_id %d for index %d\n",Mod_id,mbsfn_AreaId_r9,mbsfn_Area_idx);
LOG_I(PHY,"[eNB%d] Applying MBSFN_Area_id %ld for index %d\n",Mod_id,mbsfn_AreaId_r9,mbsfn_Area_idx);
if (mbsfn_Area_idx == 0) {
fp->Nid_cell_mbsfn = (uint16_t)mbsfn_AreaId_r9;
......@@ -398,7 +398,7 @@ void phy_config_dedicated_eNB_step2(PHY_VARS_eNB *eNB)
physicalConfigDedicated = eNB->physicalConfigDedicated[UE_id];
if (physicalConfigDedicated != NULL) {
LOG_I(PHY,"[eNB %d] Frame %d: Sent physicalConfigDedicated=%p for UE %d\n",eNB->Mod_id,physicalConfigDedicated,UE_id);
LOG_I(PHY,"[eNB %d] Sent physicalConfigDedicated=%p for UE %d\n",eNB->Mod_id,physicalConfigDedicated,UE_id);
LOG_D(PHY,"------------------------------------------------------------------------\n");
if (physicalConfigDedicated->pdsch_ConfigDedicated) {
......@@ -653,7 +653,7 @@ void phy_config_dedicated_eNB(uint8_t Mod_id,
int8_t UE_id = find_ue(rnti,eNB);
if (UE_id == -1) {
LOG_E( PHY, "[eNB %"PRIu8"] find_ue() returns -1\n");
LOG_E( PHY, "[eNB %"PRIu8"] find_ue() returns -1\n", Mod_id);
return;
}
......@@ -725,13 +725,13 @@ void phy_config_dedicated_scell_eNB(uint8_t Mod_id,
if ((dl_CarrierFreq_r10>=36000) && (dl_CarrierFreq_r10<=36199)) {
carrier_freq_local = 1900000000 + (dl_CarrierFreq_r10-36000)*100000; //band 33 from 3GPP 36.101 v 10.9 Table 5.7.3-1
LOG_I(PHY,"[eNB %d] Frame %d: Configured SCell %d to frequency %d (ARFCN %d) for UE %d\n",Mod_id,/*eNB->frame*/0,CC_id,carrier_freq_local,dl_CarrierFreq_r10,UE_id);
LOG_I(PHY,"[eNB %d] Frame %d: Configured SCell %d to frequency %d (ARFCN %ld) for UE %d\n",Mod_id,/*eNB->frame*/0,CC_id,carrier_freq_local,dl_CarrierFreq_r10,UE_id);
} else if ((dl_CarrierFreq_r10>=6150) && (dl_CarrierFreq_r10<=6449)) {
carrier_freq_local = 832000000 + (dl_CarrierFreq_r10-6150)*100000; //band 20 from 3GPP 36.101 v 10.9 Table 5.7.3-1
// this is actually for the UL only, but we use it for DL too, since there is no TDD mode for this band
LOG_I(PHY,"[eNB %d] Frame %d: Configured SCell %d to frequency %d (ARFCN %d) for UE %d\n",Mod_id,/*eNB->frame*/0,CC_id,carrier_freq_local,dl_CarrierFreq_r10,UE_id);
LOG_I(PHY,"[eNB %d] Frame %d: Configured SCell %d to frequency %d (ARFCN %ld) for UE %d\n",Mod_id,/*eNB->frame*/0,CC_id,carrier_freq_local,dl_CarrierFreq_r10,UE_id);
} else {
LOG_E(PHY,"[eNB %d] Frame %d: ARFCN %d of SCell %d for UE %d not supported\n",Mod_id,/*eNB->frame*/0,dl_CarrierFreq_r10,CC_id,UE_id);
LOG_E(PHY,"[eNB %d] Frame %d: ARFCN %ld of SCell %d for UE %d not supported\n",Mod_id,/*eNB->frame*/0,dl_CarrierFreq_r10,CC_id,UE_id);
}
if (physicalConfigDedicatedSCell_r10) {
......
......@@ -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,
......@@ -738,6 +739,12 @@ int lte_dl_channel_estimation(PHY_VARS_UE *ue,
(int16_t*) ue->common_vars.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.dl_ch_estimates_time[eNB_offset][0][0], 512 * 4));
#endif
return(0);
}
......@@ -32,7 +32,8 @@
#define k1 ((long long int) 1000)
#define k2 ((long long int) (1024-k1))
//#define DEBUG_MEAS
//#define DEBUG_MEAS_RRC
//#define DEBUG_MEAS_UE
#ifdef USER_MODE
void print_shorts(char *s,short *x)
......@@ -165,23 +166,30 @@ int8_t set_RSRQ_filtered(uint8_t Mod_id,uint8_t CC_id,uint8_t eNB_index,float rs
}
void ue_rrc_measurements(PHY_VARS_UE *ue,
uint8_t subframe,
uint8_t abstraction_flag)
uint8_t slot,
uint8_t abstraction_flag)
{
int aarx,rb;
uint8_t subframe = slot>>1;
int aarx,rb,n;
int16_t *rxF,*rxF_pss,*rxF_sss;
uint16_t Nid_cell = ue->frame_parms.Nid_cell;
uint8_t eNB_offset,nu,l,nushift,k;
uint16_t off;
uint8_t isPss; // indicate if this is a slot for extracting PSS
uint8_t isSss; // indicate if this is a slot for extracting SSS
int32_t pss_ext[4][72]; // contain the extracted 6*12 REs for mapping the PSS
int32_t sss_ext[4][72]; // contain the extracted 6*12 REs for mapping the SSS
int32_t (*xss_ext)[72]; // point to either pss_ext or sss_ext for common calculation
int16_t *re,*im; // real and imag part of each 32-bit xss_ext[][] value
for (eNB_offset = 0; eNB_offset<1+ue->measurements.n_adj_cells; eNB_offset++) {
if (eNB_offset==0) {
ue->measurements.rssi = 0;
ue->measurements.n0_power_tot = 0;
//ue->measurements.n0_power_tot = 0;
if (abstraction_flag == 0) {
if ((ue->frame_parms.frame_type == FDD) &&
......@@ -225,16 +233,66 @@ void ue_rrc_measurements(PHY_VARS_UE *ue,
// ue->measurements.n0_power[aarx] += (((int32_t)rxF_pss[-64]*rxF_pss[-64])+((int32_t)rxF_pss[-63]*rxF_pss[-63]));
// printf("pssm32 %d\n",ue->measurements.n0_power[aarx]);
ue->measurements.n0_power_dB[aarx] = (unsigned short) dB_fixed(ue->measurements.n0_power[aarx]/12);
ue->measurements.n0_power_tot += ue->measurements.n0_power[aarx];
ue->measurements.n0_power_tot /*+=*/ = ue->measurements.n0_power[aarx];
}
ue->measurements.n0_power_tot_dB = (unsigned short) dB_fixed(ue->measurements.n0_power_tot/(12*aarx));
ue->measurements.n0_power_tot_dBm = ue->measurements.n0_power_tot_dB - ue->rx_total_gain_dB - dB_fixed(ue->frame_parms.ofdm_symbol_size);
}
} else {
LOG_E(PHY, "Not yet implemented: noise power calculation when prefix length = EXTENDED\n");
}
}
else if ((ue->frame_parms.frame_type == TDD) &&
(subframe == 0)) { // TDD SSS, compute noise in DTX REs
else if ((ue->frame_parms.frame_type == TDD) &&
((slot == 2) || (slot == 12) || (slot == 1) || (slot == 11))) { // TDD PSS/SSS, compute noise in DTX REs // 2016-09-29 wilson fix incorrect noise power calculation
#if 1 // fixing REs extraction in noise power calculation
// check if this slot has a PSS or SSS sequence
if ((slot == 2) || (slot == 12)) {
isPss = 1;
} else {
isPss = 0;
}
if ((slot == 1) || (slot == 11)) {
isSss = 1;
} else {
isSss = 0;
}
if (isPss) {
pss_only_extract(ue, pss_ext);
xss_ext = pss_ext;
}
if (isSss) {
sss_only_extract(ue, sss_ext);
xss_ext = sss_ext;
}
// calculate noise power
int num_tot=0; // number of REs totally used in calculating noise power
for (aarx=0; aarx<ue->frame_parms.nb_antennas_rx; aarx++) {
int num_per_rx=0; // number of REs used in caluclaing noise power for this RX antenna
ue->measurements.n0_power[aarx] = 0;
for (n=2; n<70; n++) { // skip the 2 REs next to PDSCH, i.e. n={0,1,70,71}
if (n==5) {n=67;}
re = (int16_t*)(&(xss_ext[aarx][n]));
im = re+1;
ue->measurements.n0_power[aarx] += (*re)*(*re) + (*im)*(*im);
num_per_rx++;
num_tot++;
}
ue->measurements.n0_power_dB[aarx] = (unsigned short) dB_fixed(ue->measurements.n0_power[aarx]/(num_per_rx));
ue->measurements.n0_power_tot /*+=*/ = ue->measurements.n0_power[aarx];
}
ue->measurements.n0_power_tot_dB = (unsigned short) dB_fixed(ue->measurements.n0_power_tot/(num_tot));
ue->measurements.n0_power_tot_dBm = ue->measurements.n0_power_tot_dB - ue->rx_total_gain_dB - dB_fixed(ue->frame_parms.ofdm_symbol_size);
#else
if (ue->frame_parms.Ncp==NORMAL) {
for (aarx=0; aarx<ue->frame_parms.nb_antennas_rx; aarx++) {
......@@ -263,8 +321,9 @@ void ue_rrc_measurements(PHY_VARS_UE *ue,
ue->measurements.n0_power_tot_dBm = ue->measurements.n0_power_tot_dB - ue->rx_total_gain_dB - dB_fixed(ue->frame_parms.ofdm_symbol_size);
}
}
}
#endif
}
}
}
// recompute nushift with eNB_offset corresponding to adjacent eNB on which to perform channel estimation
......@@ -286,7 +345,7 @@ void ue_rrc_measurements(PHY_VARS_UE *ue,
for (l=0,nu=0; l<=(4-ue->frame_parms.Ncp); l+=(4-ue->frame_parms.Ncp),nu=3) {
k = (nu + nushift)%6;
#ifdef DEBUG_MEAS
#ifdef DEBUG_MEAS_RRC
LOG_I(PHY,"[UE %d] Frame %d subframe %d Doing ue_rrc_measurements rsrp/rssi (Nid_cell %d, nushift %d, eNB_offset %d, k %d, l %d)\n",ue->Mod_id,ue->proc.proc_rxtx[subframe&1].frame_rx,subframe,Nid_cell,nushift,
eNB_offset,k,l);
#endif
......@@ -364,7 +423,7 @@ void ue_rrc_measurements(PHY_VARS_UE *ue,
}
#ifdef DEBUG_MEAS
#ifdef DEBUG_MEAS_RRC
// if (slot == 0) {
......@@ -498,10 +557,14 @@ void lte_ue_measurements(PHY_VARS_UE *ue,
ue->measurements.wideband_cqi_tot[eNB_id] = dB_fixed2(ue->measurements.rx_power_tot[eNB_id],ue->measurements.n0_power_tot);
ue->measurements.wideband_cqi_avg[eNB_id] = dB_fixed2(ue->measurements.rx_power_avg[eNB_id],ue->measurements.n0_power_avg);
ue->measurements.rx_rssi_dBm[eNB_id] = ue->measurements.rx_power_avg_dB[eNB_id] - ue->rx_total_gain_dB;
#ifdef DEBUG_MEAS
LOG_I(PHY,"[eNB %d] lte_ue_measurements: RSSI %d dBm, RSSI (digital) %d dB\n",
eNB_id,ue->measurements.rx_rssi_dBm[eNB_id],
ue->measurements.rx_power_avg_dB[eNB_id]);
#ifdef DEBUG_MEAS_UE
LOG_D(PHY,"[eNB %d] RSSI %d dBm, RSSI (digital) %d dB, WBandCQI %d dB, rxPwrAvg %d, n0PwrAvg %d\n",
eNB_id,
ue->measurements.rx_rssi_dBm[eNB_id],
ue->measurements.rx_power_avg_dB[eNB_id],
ue->measurements.wideband_cqi_avg[eNB_id],
ue->measurements.rx_power_avg[eNB_id],
ue->measurements.n0_power_avg);
#endif
}
......
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);
}
......
......@@ -35,7 +35,7 @@
#include "defs.h"
#include "extern.h"
#include "PHY/sse_intrin.h"
#include "T.h"
#ifndef USER_MODE
#define NOCYGWIN_STATIC static
......@@ -74,6 +74,7 @@ int rx_pdsch(PHY_VARS_UE *ue,
PDSCH_t type,
unsigned char eNB_id,
unsigned char eNB_id_i, //if this == ue->n_connected_eNB, we assume MU interference
uint32_t frame,
uint8_t subframe,
unsigned char symbol,
unsigned char first_symbol_flag,
......@@ -120,7 +121,7 @@ int rx_pdsch(PHY_VARS_UE *ue,
break;
default:
LOG_E(PHY,"[UE %d][FATAL] Frame %d subframe %d: Unknown PDSCH format %d\n",ue->proc.proc_rxtx[0].frame_rx,subframe,type);
LOG_E(PHY,"[UE][FATAL] Frame %d subframe %d: Unknown PDSCH format %d\n",ue->proc.proc_rxtx[0].frame_rx,subframe,type);
return(-1);
break;
}
......@@ -297,6 +298,13 @@ int rx_pdsch(PHY_VARS_UE *ue,
// avgs = cmax(avgs,avg[(aarx<<1)+aatx]);
#if T_TRACER
if (type == PDSCH)
{
T(T_UE_PHY_PDSCH_ENERGY, T_INT(eNB_id), T_INT(0), T_INT(frame%1024), T_INT(subframe),
T_INT(avg[0]), T_INT(avg[1]), T_INT(avg[2]), T_INT(avg[3]));
}
#endif
pdsch_vars[eNB_id]->log2_maxh = (log2_approx(avgs)/2)+1;
// + log2_approx(frame_parms->nb_antenna_ports_eNB-1) //-1 because log2_approx counts the number of bits
......@@ -825,6 +833,15 @@ int rx_pdsch(PHY_VARS_UE *ue,
return(-1);
break;
}
#if T_TRACER
T(T_UE_PHY_PDSCH_IQ, T_INT(eNB_id), T_INT(ue->Mod_id), T_INT(frame%1024),
T_INT(subframe), T_INT(nb_rb),
T_INT(frame_parms->N_RB_UL), T_INT(frame_parms->symbols_per_tti),
T_BUFFER(&pdsch_vars[eNB_id]->rxdataF_comp0[eNB_id][0],
2 * /* ulsch[UE_id]->harq_processes[harq_pid]->nb_rb */ frame_parms->N_RB_UL *12*frame_parms->symbols_per_tti*2));
#endif
return(0);
}
......
......@@ -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
......
......@@ -88,7 +88,7 @@ int pbch_detection(PHY_VARS_UE *ue, runmode_t mode)
if (ue->frame_parms.frame_type == TDD) {
ue_rrc_measurements(ue,
1,
2,
0);
}
else {
......
......@@ -142,125 +142,134 @@ unsigned char subframe2_ul_harq(LTE_DL_FRAME_PARMS *frame_parms,unsigned char su
uint8_t phich_frame2_pusch_frame(LTE_DL_FRAME_PARMS *frame_parms,frame_t frame,uint8_t subframe)
{
uint8_t pusch_frame = 255;
if (frame_parms->frame_type == FDD) {
return((subframe<4) ? (frame - 1) : frame);
pusch_frame = ((subframe<4) ? (frame - 1) : frame);
} else {
// Note this is not true, but it doesn't matter, the frame number is irrelevant for TDD!
return(frame);
pusch_frame = (frame);
}
LOG_D(PHY, "frame %d subframe %d: PUSCH frame = %d\n", frame, subframe, pusch_frame);
return pusch_frame;
}
uint8_t phich_subframe2_pusch_subframe(LTE_DL_FRAME_PARMS *frame_parms,uint8_t subframe)
{
uint8_t pusch_subframe = 255;
if (frame_parms->frame_type == FDD)
return(subframe<4 ? (subframe+6) : (subframe-4));
return subframe < 4 ? subframe + 6 : subframe - 4;
switch (frame_parms->tdd_config) {
case 0:
if (subframe == 0)
return(3);
pusch_subframe = (3);
else if (subframe == 5) {
return (8);
pusch_subframe = (8);
} else if (subframe == 6)
return (2);
pusch_subframe = (2);
else if (subframe == 1)
return (7);
pusch_subframe = (7);
else {
LOG_E(PHY, "phich.c: phich_subframe2_pusch_subframe, illegal subframe %d for tdd_config %d\n",
subframe,frame_parms->tdd_config);
return(0);
pusch_subframe = (0);
}
break;
case 1:
if (subframe == 6)
return(2);
pusch_subframe = (2);
else if (subframe == 9)
return (3);
pusch_subframe = (3);
else if (subframe == 1)
return (7);
pusch_subframe = (7);
else if (subframe == 4)
return (8);
pusch_subframe = (8);
else {
LOG_E(PHY,"phich.c: phich_subframe2_pusch_subframe, illegal subframe %d for tdd_config %d\n",
subframe,frame_parms->tdd_config);
return(0);
pusch_subframe = (0);
}
break;
case 2:
if (subframe == 8)
return(2);
pusch_subframe = (2);
else if (subframe == 3)
return (7);
pusch_subframe = (7);
else {
LOG_E(PHY,"phich.c: phich_subframe2_pusch_subframe, illegal subframe %d for tdd_config %d\n",
subframe,frame_parms->tdd_config);
return(0);
pusch_subframe = (0);
}
break;
case 3:
if ( (subframe == 8) || (subframe == 9) ) {
return(subframe-6);
pusch_subframe = (subframe-6);
} else if (subframe==0)
return(4);
pusch_subframe = (4);
else {
LOG_E(PHY,"phich.c: phich_subframe2_pusch_subframe, illegal subframe %d for tdd_config %d\n",
subframe,frame_parms->tdd_config);
return(0);
pusch_subframe = (0);
}
break;
case 4:
if ( (subframe == 8) || (subframe == 9) ) {
return(subframe-6);
pusch_subframe = (subframe-6);
} else {
LOG_E(PHY,"phich.c: phich_subframe2_pusch_subframe, illegal subframe %d for tdd_config %d\n",
subframe,frame_parms->tdd_config);
return(0);
pusch_subframe = (0);
}
break;
case 5:
if (subframe == 8) {
return(2);
pusch_subframe = (2);
} else {
LOG_E(PHY,"phich.c: phich_subframe2_pusch_subframe, illegal subframe %d for tdd_config %d\n",
subframe,frame_parms->tdd_config);
return(0);
pusch_subframe = (0);
}
break;
case 6:
if (subframe == 6) {
return(2);
pusch_subframe = (2);
} else if (subframe == 9) {
return(3);
pusch_subframe = (3);
} else if (subframe == 0) {
return(4);
pusch_subframe = (4);
} else if (subframe == 1) {
return(7);
pusch_subframe = (7);
} else if (subframe == 5) {
return(8);
pusch_subframe = (8);
} else {
LOG_E(PHY,"phich.c: phich_subframe2_pusch_subframe, illegal subframe %d for tdd_config %d\n",
subframe,frame_parms->tdd_config);
return(0);
pusch_subframe = (0);
}
break;
default:
LOG_E(PHY, "no implementation for TDD UL/DL-config = %d!\n", frame_parms->tdd_config);
pusch_subframe = (0);
}
return(0);
LOG_D(PHY, "subframe %d: PUSCH subframe = %d\n", subframe, pusch_subframe);
return pusch_subframe;
}
int check_pcfich(LTE_DL_FRAME_PARMS *frame_parms,uint16_t reg)
......@@ -1110,6 +1119,16 @@ void rx_phich(PHY_VARS_UE *ue,
nseq_PHICH = ((ulsch->harq_processes[harq_pid]->first_rb/Ngroup_PHICH) +
ulsch->harq_processes[harq_pid]->n_DMRS)%(2*NSF_PHICH);
} else {
LOG_D(PHY,"[UE %d][PUSCH %d] Frame %d subframe %d PHICH RX %s\n",
ue->Mod_id,
harq_pid,
proc->frame_rx,
subframe,
(ulsch->harq_processes[harq_pid]->status==SCH_IDLE? "SCH_IDLE" :
(ulsch->harq_processes[harq_pid]->status==ACTIVE? "ACTIVE" :
(ulsch->harq_processes[harq_pid]->status==CBA_ACTIVE? "CBA_ACTIVE":
(ulsch->harq_processes[harq_pid]->status==DISABLED? "DISABLED" : "UNKNOWN")))));
return;
}
......@@ -1374,7 +1393,7 @@ void rx_phich(PHY_VARS_UE *ue,
}
} else {
//#ifdef DEBUG_PHICH
LOG_D(PHY,"[UE %d][PUSCH %d] Frame %d subframe %d PHICH, received NAK (%d) nseq %d, ngroup %d\n",
LOG_D(PHY,"[UE %d][PUSCH %d] Frame %d subframe %d PHICH, received NAK (%d) nseq %d, ngroup %d (Mlimit %d)\n",
ue->Mod_id,harq_pid,
proc->frame_rx,
subframe,
......@@ -1414,7 +1433,10 @@ void rx_phich(PHY_VARS_UE *ue,
//LOG_I(PHY,"[HARQ-UL harqId: %d] PHICH NACK ==> subframe_scheduling_flag = %d round: %d\n", harq_pid, ulsch->harq_processes[harq_pid]->subframe_scheduling_flag,ulsch->harq_processes[harq_pid]->round);
}
}
#if T_TRACER
T(T_UE_PHY_ULSCH_UE_NACK, T_INT(eNB_id), T_INT(proc->frame_rx%1024), T_INT(subframe), T_INT(ue->Mod_id), T_INT(ulsch->rnti),
T_INT(harq_pid));
#endif
} else { //ACK
if (ue->ulsch_Msg3_active[eNB_id] == 1) {
......@@ -1449,7 +1471,11 @@ void rx_phich(PHY_VARS_UE *ue,
// inform MAC?
ue->ulsch_Msg3_active[eNB_id] = 0;
//LOG_I(PHY,"[HARQ-UL harqId: %d] PHICH ACK ==> subframe_scheduling_flag = %d round: %d\n", harq_pid, ulsch->harq_processes[harq_pid]->subframe_scheduling_flag, ulsch->harq_processes[harq_pid]->round);
#if T_TRACER
T(T_UE_PHY_ULSCH_UE_ACK, T_INT(eNB_id), T_INT(proc->frame_rx%1024), T_INT(subframe), T_INT(ue->Mod_id), T_INT(ulsch->rnti),
T_INT(harq_pid));
#endif
}
}
......
......@@ -1138,6 +1138,7 @@ void dlsch_scale_channel(int32_t **dl_ch_estimates_ext,
@param dlsch_llr Pointer to LLR values computed by dlsch_demodulation
@param lte_frame_parms Pointer to frame descriptor
@param dlsch Pointer to DLSCH descriptor
@param frame Frame number
@param subframe Subframe number
@param num_pdcch_symbols Number of PDCCH symbols
@param is_crnti indicates if PDSCH belongs to a CRNTI (necessary for parallelizing decoding threads)
......@@ -1149,6 +1150,7 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue,
LTE_DL_FRAME_PARMS *lte_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,
......@@ -1179,6 +1181,7 @@ int32_t rx_pdsch(PHY_VARS_UE *phy_vars_ue,
PDSCH_t type,
uint8_t eNB_id,
uint8_t eNB_id_i,
uint32_t frame,
uint8_t subframe,
uint8_t symbol,
uint8_t first_symbol_flag,
......@@ -1189,11 +1192,39 @@ int32_t rx_pdsch(PHY_VARS_UE *phy_vars_ue,
int32_t rx_pdcch(LTE_UE_COMMON *lte_ue_common_vars,
LTE_UE_PDCCH **lte_ue_pdcch_vars,
LTE_DL_FRAME_PARMS *frame_parms,
uint32_t frame,
uint8_t subframe,
uint8_t eNB_id,
MIMO_mode_t mimo_mode,
uint32_t high_speed_flag,
uint8_t is_secondary_ue);
/*! \brief Extract PSS and SSS resource elements
@param phy_vars_ue Pointer to UE variables
@param[out] pss_ext contain the PSS signals after the extraction
@param[out] sss_ext contain the SSS signals after the extraction
@returns 0 on success
*/
int pss_sss_extract(PHY_VARS_UE *phy_vars_ue,
int32_t pss_ext[4][72],
int32_t sss_ext[4][72]);
/*! \brief Extract only PSS resource elements
@param phy_vars_ue Pointer to UE variables
@param[out] pss_ext contain the PSS signals after the extraction
@returns 0 on success
*/
int pss_only_extract(PHY_VARS_UE *phy_vars_ue,
int32_t pss_ext[4][72]);
/*! \brief Extract only SSS resource elements
@param phy_vars_ue Pointer to UE variables
@param[out] sss_ext contain the SSS signals after the extraction
@returns 0 on success
*/
int sss_only_extract(PHY_VARS_UE *phy_vars_ue,
int32_t sss_ext[4][72]);
/*! \brief Performs detection of SSS to find cell ID and other framing parameters (FDD/TDD, normal/extended prefix)
@param phy_vars_ue Pointer to UE variables
@param tot_metric Pointer to variable containing maximum metric under framing hypothesis (to be compared to other hypotheses
......@@ -1499,7 +1530,8 @@ int generate_ue_dlsch_params_from_dci(int frame,
uint16_t si_rnti,
uint16_t ra_rnti,
uint16_t p_rnti,
uint8_t beamforming_mode);
uint8_t beamforming_mode,
uint16_t tc_rnti);
int32_t generate_eNB_dlsch_params_from_dci(int frame,
uint8_t subframe,
......
......@@ -555,6 +555,7 @@ void generate_pucch2x(int32_t **txdataF,
N_UL_symb = (fp->Ncp==0) ? 7 : 6;
data_ind = 0;
zptr = z;
nprime = 0;
for (ns=(subframe<<1),u=u0,v=v0; ns<(2+(subframe<<1)); ns++,u=u1,v=v1) {
if ((ns&1) == 0)
......
......@@ -146,9 +146,10 @@ int pss_ch_est(PHY_VARS_UE *ue,
}
int pss_sss_extract(PHY_VARS_UE *ue,
int _do_pss_sss_extract(PHY_VARS_UE *ue,
int32_t pss_ext[4][72],
int32_t sss_ext[4][72])
int32_t sss_ext[4][72],
uint8_t doPss, uint8_t doSss) // add flag to indicate extracting only PSS, only SSS, or both
{
......@@ -191,8 +192,8 @@ int pss_sss_extract(PHY_VARS_UE *ue,
}
for (i=0; i<12; i++) {
pss_rxF_ext[i]=pss_rxF[i];
sss_rxF_ext[i]=sss_rxF[i];
if (doPss) {pss_rxF_ext[i]=pss_rxF[i];}
if (doSss) {sss_rxF_ext[i]=sss_rxF[i];}
}
pss_rxF+=12;
......@@ -206,6 +207,28 @@ int pss_sss_extract(PHY_VARS_UE *ue,
return(0);
}
int pss_sss_extract(PHY_VARS_UE *phy_vars_ue,
int32_t pss_ext[4][72],
int32_t sss_ext[4][72])
{
return _do_pss_sss_extract(phy_vars_ue, pss_ext, sss_ext, 1 /* doPss */, 1 /* doSss */);
}
int pss_only_extract(PHY_VARS_UE *phy_vars_ue,
int32_t pss_ext[4][72])
{
static int32_t dummy[4][72];
return _do_pss_sss_extract(phy_vars_ue, pss_ext, dummy, 1 /* doPss */, 0 /* doSss */);
}
int sss_only_extract(PHY_VARS_UE *phy_vars_ue,
int32_t sss_ext[4][72])
{
static int32_t dummy[4][72];
return _do_pss_sss_extract(phy_vars_ue, dummy, sss_ext, 0 /* doPss */, 1 /* doSss */);
}
int16_t phase_re[7] = {16383, 25101, 30791, 32767, 30791, 25101, 16383};
int16_t phase_im[7] = {-28378, -21063, -11208, 0, 11207, 21062, 28377};
......
......@@ -581,6 +581,7 @@ void print_CQI(void *o,UCI_format_t uci_format,unsigned char eNB_id,int N_RB_DL)
switch(uci_format) {
case wideband_cqi_rank1_2A:
#ifdef DEBUG_UCI
LOG_D(PHY,"[PRINT CQI] flat_LA %d\n", flag_LA);
switch(N_RB_DL) {
case 6:
LOG_I(PHY,"[PRINT CQI] wideband_cqi rank 1: eNB %d, cqi %d\n",eNB_id,
......
......@@ -190,7 +190,7 @@ LTE_UE_ULSCH_t *new_ue_ulsch(unsigned char N_RB_UL, uint8_t abstraction_flag)
return(ulsch);
}
LOG_E(PHY,"new_ue_ulsch exit flag, size of %d , %d\n",exit_flag, sizeof(LTE_UE_ULSCH_t));
LOG_E(PHY,"new_ue_ulsch exit flag, size of %d , %zu\n",exit_flag, sizeof(LTE_UE_ULSCH_t));
free_ue_ulsch(ulsch);
return(NULL);
......@@ -234,7 +234,7 @@ uint32_t ulsch_encoding(uint8_t *a,
PHY_MEASUREMENTS *meas = &ue->measurements;
LTE_UE_ULSCH_t *ulsch=ue->ulsch[eNB_id];
LTE_UE_DLSCH_t **dlsch = ue->dlsch[eNB_id];
uint16_t rnti;
uint16_t rnti = 0xffff;
if (!ulsch) {
LOG_E(PHY,"Null ulsch ptr %p\n",ulsch);
......@@ -260,6 +260,7 @@ uint32_t ulsch_encoding(uint8_t *a,
// fill CQI/PMI information
if (ulsch->O>0) {
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_ULSCH_ENCODING_FILL_CQI, VCD_FUNCTION_IN);
rnti = ue->pdcch_vars[eNB_id]->crnti;
fill_CQI(ulsch,meas,0,harq_pid,ue->frame_parms.N_RB_DL,rnti, tmode,ue->sinr_eff);
......@@ -271,6 +272,7 @@ uint32_t ulsch_encoding(uint8_t *a,
//LOG_I(PHY,"XXX saving pmi for DL %x\n",pmi2hex_2Ar1(((wideband_cqi_rank1_2A_5MHz *)ulsch->o)->pmi));
dlsch[0]->pmi_alloc = ((wideband_cqi_rank1_2A_5MHz *)ulsch->o)->pmi;
}
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_ULSCH_ENCODING_FILL_CQI, VCD_FUNCTION_OUT);
}
if (ulsch->O<=32) {
......@@ -469,6 +471,16 @@ uint32_t ulsch_encoding(uint8_t *a,
Q_ACK = Qprime * Q_m;
Qprime_ACK = Qprime;
LOG_D(PHY,"UE (%x/%d) O_ACK %d, Mcs_initial %d, Nsymb_initial %d, beta_offset_harqack*8 %d, sum Kr %d, Qprime_ACK %d, Q_ACK %d\n",
rnti, harq_pid,
ulsch->harq_processes[harq_pid]->O_ACK,
ulsch->harq_processes[harq_pid]->Msc_initial,
ulsch->harq_processes[harq_pid]->Nsymb_initial,
ulsch->beta_offset_harqack_times8,
sumKr,
Qprime_ACK,
Q_ACK);
// Compute Q_cqi, assume O>11, p. 26 36-212
if (control_only_flag == 0) {
......
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include "PHY/impl_defs_lte.h"
int f_read(char *calibF_fname, int nb_ant, int nb_freq, int32_t **tdd_calib_coeffs){
FILE *calibF_fd;
int i,j,l,calibF_e;
int i,j,calibF_e;
calibF_fd = fopen(calibF_fname,"r");
......@@ -14,7 +15,7 @@ int f_read(char *calibF_fname, int nb_ant, int nb_freq, int32_t **tdd_calib_coef
for(i=0;i<nb_ant;i++){
for(j=0;j<nb_freq*2;j++){
fscanf(calibF_fd, "%d", &calibF_e);
if (fscanf(calibF_fd, "%d", &calibF_e) != 1) abort();
tdd_calib_coeffs[i][j] = (int16_t)calibF_e;
}
}
......@@ -22,11 +23,15 @@ int f_read(char *calibF_fname, int nb_ant, int nb_freq, int32_t **tdd_calib_coef
printf("%d\n",(int)tdd_calib_coeffs[1][599]);
} else
printf("%s not found, running with defaults\n",calibF_fname);
/* TODO: what to return? is this code used at all? */
return 0;
}
int estimate_DLCSI_from_ULCSI(int32_t **calib_dl_ch_estimates, int32_t **ul_ch_estimates, int32_t **tdd_calib_coeffs, int nb_ant, int nb_freq) {
/* TODO: what to return? is this code used at all? */
return 0;
}
......@@ -44,6 +49,8 @@ int compute_BF_weights(int32_t **beam_weights, int32_t **calib_dl_ch_estimates,
default :
break;
}
/* TODO: what to return? is this code used at all? */
return 0;
}
// temporal test function
......
......@@ -346,6 +346,8 @@ typedef struct eNB_proc_t_s {
/// Context data structure for RX/TX portion of subframe processing
typedef struct {
/// index of the current UE RX/TX proc
int proc_id;
/// Component Carrier index
uint8_t CC_id;
/// timestamp transmitted to HW
......
......@@ -994,6 +994,8 @@ typedef struct {
uint8_t num_pdcch_symbols;
/// Allocated CRNTI for UE
uint16_t crnti;
/// 1: the allocated crnti is Temporary C-RNTI / 0: otherwise
uint8_t crnti_is_temporary;
/// Total number of PDU errors (diagnostic mode)
uint32_t dci_errors;
/// Total number of PDU received
......@@ -1098,6 +1100,14 @@ typedef enum {
typedef enum {SF_DL, SF_UL, SF_S} lte_subframe_t;
#endif
typedef enum {
/// do not detect any DCIs in the current subframe
NO_DCI = 0x0,
/// detect only downlink DCIs in the current subframe
UL_DCI = 0x1,
/// detect only uplink DCIs in the current subframe
DL_DCI = 0x2,
/// detect both uplink and downlink DCIs in the current subframe
UL_DL_DCI = 0x3} dci_detect_mode_t;
#endif
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