merge develop
This commit is contained in:
+16
-35
@@ -1,38 +1,19 @@
|
|||||||
job1:
|
job1:
|
||||||
script:
|
script:
|
||||||
- echo $PWD
|
- date
|
||||||
- echo $USER
|
- pwd
|
||||||
- echo $OAI_USER
|
- echo $OAI_USER
|
||||||
- echo $OAI_EXTRA_ARGS
|
- echo $OAI_PASS
|
||||||
- echo $NFS_SHARE_DIR
|
- echo $OAI_TEST_CASE_GROUP
|
||||||
- echo $EXTERNAL_SHARE_DIR
|
- echo $MACHINELIST
|
||||||
- echo $SHELL
|
- echo $MACHINELISTGENERIC
|
||||||
- echo $OAI_TEST_CASE_GROUP
|
- echo $RESULT_DIR
|
||||||
- echo $MACHINELIST
|
- echo $NRUNS_LTE_SOFTMODEM
|
||||||
- echo $MACHINELISTGENERIC
|
- source oaienv
|
||||||
- git rev-parse --abbrev-ref HEAD
|
- rm -rf cmake_targets/autotests/log
|
||||||
- git_repo=`git config --get remote.origin.url`
|
- mkdir cmake_targets/autotests/log
|
||||||
- git_head=`git rev-parse HEAD`
|
- cd cmake_targets/autotests/v2
|
||||||
- echo $git_head
|
- python main.py
|
||||||
- tmp=`git show-ref --head | grep $git_head`
|
- date
|
||||||
- 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
|
|
||||||
only:
|
only:
|
||||||
- triggers
|
- triggers
|
||||||
|
|||||||
@@ -37,11 +37,6 @@ set (OPENAIR_BIN_DIR ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY})
|
|||||||
|
|
||||||
project (OpenAirInterface)
|
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
|
# 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} )
|
add_library(oai_bladerfdevif MODULE ${HWLIB_BLADERF_SOURCE} )
|
||||||
|
|
||||||
include_directories("${OPENAIR_TARGETS}/ARCH/LMSSDR/USERSPACE/LIB/")
|
include_directories("${OPENAIR_TARGETS}/ARCH/LMSSDR/USERSPACE/LIB/")
|
||||||
set (option_HWLMSSDRLIB_lib "-l LMS_SDR -l LMS7002M -l Si5351C")
|
|
||||||
set(HWLIB_LMSSDR_SOURCE
|
set(HWLIB_LMSSDR_SOURCE
|
||||||
${OPENAIR_TARGETS}/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp
|
${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")
|
elseif (${RF_BOARD} STREQUAL "OAI_LMSSDR")
|
||||||
include_directories("${OPENAIR_TARGETS}/ARCH/LMSSDR/USERSPACE/LIB")
|
include_directories("${OPENAIR_TARGETS}/ARCH/LMSSDR/USERSPACE/LIB")
|
||||||
include_directories("${OPENAIR_TARGETS}/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR")
|
include_directories("/usr/local/include/lime")
|
||||||
include_directories("${OPENAIR_TARGETS}/ARCH/LMSSDR/USERSPACE/LIB/lms7002m")
|
include_directories("/usr/include/lime")
|
||||||
include_directories("${OPENAIR_TARGETS}/ARCH/LMSSDR/USERSPACE/LIB/Si5351C")
|
|
||||||
include_directories("${OPENAIR_TARGETS}/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/LMS_StreamBoard")
|
|
||||||
LINK_DIRECTORIES("/usr/lib/x86_64-linux-gnu")
|
LINK_DIRECTORIES("/usr/lib/x86_64-linux-gnu")
|
||||||
LINK_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}/lmsSDR")
|
LINK_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}/lmsSDR")
|
||||||
LINK_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}/lms7002m")
|
LINK_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}/lms7002m")
|
||||||
LINK_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}/Si5351C")
|
LINK_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}/Si5351C")
|
||||||
set(HW_SOURCE ${HW_SOURCE} ${OPENAIR_TARGETS}/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp)
|
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")
|
elseif (${RF_BOARD} STREQUAL "CPRIGW")
|
||||||
set(HW_SOURCE ${HW_SOURCE}
|
set(HW_SOURCE ${HW_SOURCE}
|
||||||
@@ -1691,7 +1684,7 @@ endif()
|
|||||||
# Atlas is required by some packages, but not found in pkg-config
|
# Atlas is required by some packages, but not found in pkg-config
|
||||||
if(EXISTS "/usr/include/atlas/cblas.h")
|
if(EXISTS "/usr/include/atlas/cblas.h")
|
||||||
include_directories("/usr/include/atlas")
|
include_directories("/usr/include/atlas")
|
||||||
list(APPEND ATLAS_LIBRARIES lapack cblas atlas)
|
list(APPEND ATLAS_LIBRARIES cblas atlas lapack)
|
||||||
else()
|
else()
|
||||||
message("No Blas/Atlas libs found, some targets will fail")
|
message("No Blas/Atlas libs found, some targets will fail")
|
||||||
endif()
|
endif()
|
||||||
@@ -1845,14 +1838,6 @@ Message("-- HW_SOURCE=${HW_SOURCE}")
|
|||||||
Message("-- option_TP_lib=${option_TP_lib}")
|
Message("-- option_TP_lib=${option_TP_lib}")
|
||||||
Message("-- TRANSPORT_SOURCE=${TRANSPORT_SOURCE}")
|
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
|
# USIM process
|
||||||
#################
|
#################
|
||||||
#add_executable(usim
|
#add_executable(usim
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
<Timeout_execution>36000</Timeout_execution>
|
<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>
|
<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>
|
<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" >
|
<testCase id="010101" >
|
||||||
<class>compilation</class>
|
<class>compilation</class>
|
||||||
<desc>Build oaisim.Rel8</desc>
|
<desc>Build oaisim.Rel8</desc>
|
||||||
|
|||||||
@@ -0,0 +1,2 @@
|
|||||||
|
sudo /opt/ltebox/tools/stop_ltebox || true
|
||||||
|
sudo /opt/ltebox/tools/start_ltebox
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
sudo /opt/ltebox/tools/stop_ltebox
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
sudo /opt/ltebox/tools/stop_ltebox || true
|
||||||
|
sudo /opt/hss_sim0609/starthss_real
|
||||||
@@ -0,0 +1,136 @@
|
|||||||
|
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.
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
echo $SERVER_IP
|
||||||
|
timeout -s 9 20s iperf -c $SERVER_IP -i1
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
echo $SERVER_IP
|
||||||
|
echo $UDP_BANDWIDTH
|
||||||
|
timeout -s 9 20s iperf -c $SERVER_IP -i1 -u -b $UDP_BANDWIDTH
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
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
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
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
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
cd /tmp/oai_test_setup/oai
|
||||||
|
source oaienv
|
||||||
|
echo $EXEC $EXEC_ARGS
|
||||||
|
$EXEC $EXEC_ARGS
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
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"
|
||||||
@@ -0,0 +1,103 @@
|
|||||||
|
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()
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
#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
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
stty isig intr ^C
|
||||||
|
|
||||||
|
#timeout -s 9 20s iperf -s -i1
|
||||||
|
iperf -s -i1
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
stty isig intr ^C
|
||||||
|
|
||||||
|
#timeout -s 9 20s iperf -s -i1 -u
|
||||||
|
iperf -s -i1 -u
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
#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
|
||||||
@@ -0,0 +1,55 @@
|
|||||||
|
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)
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
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)
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
[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!
|
||||||
@@ -0,0 +1,389 @@
|
|||||||
|
import threading, os, re
|
||||||
|
|
||||||
|
from utils import quickshell, log, TestFailed, do_tests
|
||||||
|
from task import Task, WAITLOG_SUCCESS
|
||||||
|
|
||||||
|
class alu_test:
|
||||||
|
def __init__(self,
|
||||||
|
epc, enb, ue,
|
||||||
|
openair,
|
||||||
|
user, password,
|
||||||
|
log_subdir,
|
||||||
|
env):
|
||||||
|
self.epc_machine = epc
|
||||||
|
self.enb_machine = enb
|
||||||
|
self.ue_machine = ue
|
||||||
|
self.openair_dir = openair
|
||||||
|
self.oai_user = user
|
||||||
|
self.oai_password = password
|
||||||
|
self.env = env
|
||||||
|
|
||||||
|
self.task_hss = None
|
||||||
|
self.task_enb = None
|
||||||
|
self.task_ue = None
|
||||||
|
|
||||||
|
self.logdir = openair + '/cmake_targets/autotests/log/' + log_subdir
|
||||||
|
quickshell('mkdir -p ' + self.logdir)
|
||||||
|
|
||||||
|
#event object used to wait for several tasks at once
|
||||||
|
self.event = threading.Event()
|
||||||
|
|
||||||
|
##########################################################################
|
||||||
|
# finish
|
||||||
|
##########################################################################
|
||||||
|
def finish(self):
|
||||||
|
#brutally kill tasks still running
|
||||||
|
#TODO: call 'wait', some processes may still be there as zombies
|
||||||
|
if self.task_hss != None and self.task_hss.alive():
|
||||||
|
self.task_hss.kill()
|
||||||
|
if self.task_enb != None and self.task_enb.alive():
|
||||||
|
self.task_enb.kill()
|
||||||
|
if self.task_ue != None and self.task_ue.alive():
|
||||||
|
self.task_ue.kill()
|
||||||
|
|
||||||
|
##########################################################################
|
||||||
|
# start_epc
|
||||||
|
##########################################################################
|
||||||
|
def start_epc(self):
|
||||||
|
#launch HSS, wait for prompt
|
||||||
|
log("INFO: ALU test: run HSS")
|
||||||
|
self.task_hss = Task("actions/alu_hss.bash",
|
||||||
|
"alu_hss",
|
||||||
|
self.epc_machine,
|
||||||
|
self.oai_user,
|
||||||
|
self.oai_password,
|
||||||
|
self.env,
|
||||||
|
self.logdir + "/alu_hss." + self.epc_machine,
|
||||||
|
event=self.event)
|
||||||
|
self.task_hss.waitlog('S6AS_SIM-> ')
|
||||||
|
|
||||||
|
#then launch EPC, wait for connection on HSS side
|
||||||
|
log("INFO: ALU test: run EPC")
|
||||||
|
task_epc = Task("actions/alu_epc.bash",
|
||||||
|
"ALU EPC",
|
||||||
|
self.epc_machine,
|
||||||
|
self.oai_user,
|
||||||
|
self.oai_password,
|
||||||
|
self.env,
|
||||||
|
self.logdir + "/alu_epc." + self.epc_machine)
|
||||||
|
ret = task_epc.wait()
|
||||||
|
if ret != 0:
|
||||||
|
log("ERROR: EPC start failure");
|
||||||
|
raise TestFailed()
|
||||||
|
self.task_hss.waitlog('Connected\n')
|
||||||
|
|
||||||
|
##########################################################################
|
||||||
|
# stop_epc
|
||||||
|
##########################################################################
|
||||||
|
def stop_epc(self):
|
||||||
|
#stop EPC, wait for disconnection on HSS side
|
||||||
|
log("INFO: ALU test: stop EPC")
|
||||||
|
task_epc = Task("actions/alu_epc_stop.bash",
|
||||||
|
"alu_epc_stop",
|
||||||
|
self.epc_machine,
|
||||||
|
self.oai_user,
|
||||||
|
self.oai_password,
|
||||||
|
self.env,
|
||||||
|
self.logdir + "/alu_epc_stop." + self.epc_machine)
|
||||||
|
ret = task_epc.wait()
|
||||||
|
if ret != 0:
|
||||||
|
log("ERROR: ALU test: ALU EPC stop failed")
|
||||||
|
raise TestFailed()
|
||||||
|
self.task_hss.waitlog('Disconnected\n')
|
||||||
|
|
||||||
|
log("INFO: ALU test: stop HSS")
|
||||||
|
self.task_hss.sendnow("exit\n")
|
||||||
|
ret = self.task_hss.wait()
|
||||||
|
if ret != 0:
|
||||||
|
log("ERROR: ALU test: ALU HSS failed")
|
||||||
|
raise TestFailed()
|
||||||
|
|
||||||
|
##########################################################################
|
||||||
|
# compile_enb
|
||||||
|
##########################################################################
|
||||||
|
def compile_enb(self, build_arguments):
|
||||||
|
log("INFO: ALU test: compile softmodem")
|
||||||
|
envcomp = list(self.env)
|
||||||
|
envcomp.append('BUILD_ARGUMENTS="' + build_arguments + '"')
|
||||||
|
#we don't care about BUILD_OUTPUT but required (TODO: change that)
|
||||||
|
envcomp.append('BUILD_OUTPUT=/')
|
||||||
|
logdir = self.logdir + "/compile_log"
|
||||||
|
remote_files = "'/tmp/oai_test_setup/oai/cmake_targets/log/*'"
|
||||||
|
post_action = "mkdir -p "+ logdir + \
|
||||||
|
" && sshpass -p " + self.oai_password + \
|
||||||
|
" scp -r " + self.oai_user + \
|
||||||
|
"@" + self.enb_machine + ":" + remote_files + " " + logdir + \
|
||||||
|
" || true"
|
||||||
|
task = Task("actions/compilation.bash",
|
||||||
|
"compile_softmodem",
|
||||||
|
self.enb_machine,
|
||||||
|
self.oai_user,
|
||||||
|
self.oai_password,
|
||||||
|
envcomp,
|
||||||
|
self.logdir + "/compile_softmodem." + self.enb_machine,
|
||||||
|
post_action=post_action)
|
||||||
|
ret = task.wait()
|
||||||
|
if ret != 0:
|
||||||
|
log("ERROR: softmodem compilation failure");
|
||||||
|
raise TestFailed()
|
||||||
|
task.postaction()
|
||||||
|
|
||||||
|
##########################################################################
|
||||||
|
# start_enb
|
||||||
|
##########################################################################
|
||||||
|
def start_enb(self, config_file):
|
||||||
|
#copy wanted configuration file
|
||||||
|
quickshell("sshpass -p " + self.oai_password +
|
||||||
|
" scp config/" + config_file + " " +
|
||||||
|
self.oai_user + "@" + self.enb_machine + ":/tmp/enb.conf")
|
||||||
|
|
||||||
|
#run softmodem
|
||||||
|
log("INFO: ALU test: run softmodem with configuration file " +
|
||||||
|
config_file)
|
||||||
|
self.task_enb = Task("actions/run_enb.bash",
|
||||||
|
"run_softmodem",
|
||||||
|
self.enb_machine,
|
||||||
|
self.oai_user,
|
||||||
|
self.oai_password,
|
||||||
|
self.env,
|
||||||
|
self.logdir + "/run_softmodem." + self.enb_machine,
|
||||||
|
event=self.event)
|
||||||
|
self.task_enb.waitlog('got sync')
|
||||||
|
|
||||||
|
##########################################################################
|
||||||
|
# stop_enb
|
||||||
|
##########################################################################
|
||||||
|
def stop_enb(self):
|
||||||
|
log("INFO: ALU test: stop softmodem")
|
||||||
|
self.task_enb.sendnow("%c" % 3)
|
||||||
|
ret = self.task_enb.wait()
|
||||||
|
if ret != 0:
|
||||||
|
log("ERROR: ALU test: softmodem failed")
|
||||||
|
#not sure if we have to quit here or not
|
||||||
|
#os._exit(1)
|
||||||
|
|
||||||
|
##########################################################################
|
||||||
|
# start_bandrich_ue
|
||||||
|
##########################################################################
|
||||||
|
def start_bandrich_ue(self):
|
||||||
|
log("INFO: ALU test: start bandrich UE")
|
||||||
|
self.task_ue = Task("actions/start_bandrich.bash",
|
||||||
|
"start_bandrich",
|
||||||
|
self.ue_machine,
|
||||||
|
self.oai_user,
|
||||||
|
self.oai_password,
|
||||||
|
self.env,
|
||||||
|
self.logdir + "/start_bandrich." + self.ue_machine,
|
||||||
|
event=self.event)
|
||||||
|
self.task_ue.waitlog("local IP address", event=self.event)
|
||||||
|
self.event.wait()
|
||||||
|
|
||||||
|
#at this point one task has died or we have the line in the log
|
||||||
|
if self.task_ue.waitlog_state != WAITLOG_SUCCESS:
|
||||||
|
log("ERROR: ALU test: bandrich UE did not connect")
|
||||||
|
raise TestFailed()
|
||||||
|
|
||||||
|
self.event.clear()
|
||||||
|
|
||||||
|
if ( not self.task_enb.alive() or
|
||||||
|
not self.task_hss.alive() or
|
||||||
|
not self.task_ue.alive()):
|
||||||
|
log("ERROR: ALU test: eNB, HSS or UE task died")
|
||||||
|
raise TestFailed()
|
||||||
|
|
||||||
|
#get bandrich UE IP
|
||||||
|
l = open(self.task_ue.logfile, "r").read()
|
||||||
|
self.bandrich_ue_ip = re.search("local IP address (.*)\n", l) \
|
||||||
|
.groups()[0]
|
||||||
|
log("INFO: ALU test: bandrich UE IP address: " + self.bandrich_ue_ip)
|
||||||
|
|
||||||
|
##########################################################################
|
||||||
|
# stop_bandrich_ue
|
||||||
|
##########################################################################
|
||||||
|
def stop_bandrich_ue(self):
|
||||||
|
log("INFO: ALU test: stop bandrich UE")
|
||||||
|
self.task_ue.sendnow("%c" % 3)
|
||||||
|
ret = self.task_ue.wait()
|
||||||
|
if ret != 0:
|
||||||
|
log("ERROR: ALU test: task bandrich UE failed")
|
||||||
|
#not sure if we have to quit here or not
|
||||||
|
#os._exit(1)
|
||||||
|
|
||||||
|
##########################################################################
|
||||||
|
# _do_traffic (internal function, do not call out of the class)
|
||||||
|
##########################################################################
|
||||||
|
def _do_traffic(self, name,
|
||||||
|
server_code, server_machine, server_ip,
|
||||||
|
client_code, client_machine,
|
||||||
|
waitlog,
|
||||||
|
server_logfile, client_logfile,
|
||||||
|
udp_bandwidth=None):
|
||||||
|
log("INFO: ALU test: run traffic: " + name)
|
||||||
|
|
||||||
|
log("INFO: ALU test: launch server")
|
||||||
|
task_traffic_server = Task("actions/" + server_code + ".bash",
|
||||||
|
server_logfile,
|
||||||
|
server_machine,
|
||||||
|
self.oai_user,
|
||||||
|
self.oai_password,
|
||||||
|
self.env,
|
||||||
|
self.logdir + "/" + server_logfile + "." + server_machine,
|
||||||
|
event=self.event)
|
||||||
|
task_traffic_server.waitlog(waitlog)
|
||||||
|
|
||||||
|
env = list(self.env)
|
||||||
|
if udp_bandwidth != None:
|
||||||
|
env.append("UDP_BANDWIDTH=" + udp_bandwidth)
|
||||||
|
env.append("SERVER_IP=" + server_ip)
|
||||||
|
|
||||||
|
log("INFO: ALU test: launch client")
|
||||||
|
task_traffic_client = Task("actions/" + client_code + ".bash",
|
||||||
|
client_logfile,
|
||||||
|
client_machine,
|
||||||
|
self.oai_user,
|
||||||
|
self.oai_password,
|
||||||
|
env,
|
||||||
|
self.logdir + "/" + client_logfile + "." + client_machine,
|
||||||
|
event=self.event)
|
||||||
|
log("INFO: ALU test: wait for client to finish (or some error)")
|
||||||
|
|
||||||
|
self.event.wait()
|
||||||
|
log("DEBUG: event.wait() done")
|
||||||
|
|
||||||
|
if ( not self.task_enb.alive() or
|
||||||
|
not self.task_hss.alive() or
|
||||||
|
not self.task_ue.alive()):
|
||||||
|
log("ERROR: unexpected task exited, test failed, kill all")
|
||||||
|
if task_traffic_client.alive():
|
||||||
|
task_traffic_client.kill()
|
||||||
|
if self.task_enb.alive():
|
||||||
|
self.task_enb.kill()
|
||||||
|
if self.task_ue.alive():
|
||||||
|
self.task_ue.kill()
|
||||||
|
|
||||||
|
ret = task_traffic_client.wait()
|
||||||
|
if ret != 0:
|
||||||
|
log("ERROR: ALU test: downlink traffic failed")
|
||||||
|
#not sure if we have to quit here or not
|
||||||
|
#os._exit(1)
|
||||||
|
|
||||||
|
#stop downlink server
|
||||||
|
#log("INFO: ALU test: stop server (kill ssh connection)")
|
||||||
|
#task_traffic_server.kill()
|
||||||
|
log("INFO: ALU test: stop server (ctrl+z then kill -9 %1)")
|
||||||
|
task_traffic_server.sendnow("%ckill -9 %%1 || true\n" % 26)
|
||||||
|
log("INFO: ALU test: wait for server to quit")
|
||||||
|
task_traffic_server.wait()
|
||||||
|
|
||||||
|
self.event.clear()
|
||||||
|
|
||||||
|
if ( not self.task_enb.alive() or
|
||||||
|
not self.task_hss.alive() or
|
||||||
|
not self.task_ue.alive()):
|
||||||
|
log("ERROR: ALU test: eNB, HSS or UE task died")
|
||||||
|
raise TestFailed()
|
||||||
|
|
||||||
|
##########################################################################
|
||||||
|
# dl_tcp
|
||||||
|
##########################################################################
|
||||||
|
def dl_tcp(self):
|
||||||
|
self._do_traffic("bandrich downlink TCP",
|
||||||
|
"server_tcp", self.ue_machine, self.bandrich_ue_ip,
|
||||||
|
"client_tcp", self.epc_machine,
|
||||||
|
"Server listening on TCP port 5001",
|
||||||
|
"bandrich_downlink_tcp_server",
|
||||||
|
"bandrich_downlink_tcp_client")
|
||||||
|
|
||||||
|
##########################################################################
|
||||||
|
# ul_tcp
|
||||||
|
##########################################################################
|
||||||
|
def ul_tcp(self):
|
||||||
|
self._do_traffic("bandrich uplink TCP",
|
||||||
|
"server_tcp", self.epc_machine, "192.172.0.1",
|
||||||
|
"client_tcp", self.ue_machine,
|
||||||
|
"Server listening on TCP port 5001",
|
||||||
|
"bandrich_uplink_tcp_server",
|
||||||
|
"bandrich_uplink_tcp_client")
|
||||||
|
|
||||||
|
##########################################################################
|
||||||
|
# dl_udp
|
||||||
|
##########################################################################
|
||||||
|
def dl_udp(self, bandwidth):
|
||||||
|
self._do_traffic("bandrich downlink UDP",
|
||||||
|
"server_udp", self.ue_machine, self.bandrich_ue_ip,
|
||||||
|
"client_udp", self.epc_machine,
|
||||||
|
"Server listening on UDP port 5001",
|
||||||
|
"bandrich_downlink_udp_server",
|
||||||
|
"bandrich_downlink_udp_client",
|
||||||
|
udp_bandwidth=bandwidth)
|
||||||
|
|
||||||
|
##########################################################################
|
||||||
|
# ul_udp
|
||||||
|
##########################################################################
|
||||||
|
def ul_udp(self, bandwidth):
|
||||||
|
self._do_traffic("bandrich uplink UDP",
|
||||||
|
"server_udp", self.epc_machine, "192.172.0.1",
|
||||||
|
"client_udp", self.ue_machine,
|
||||||
|
"Server listening on UDP port 5001",
|
||||||
|
"bandrich_uplink_udp_server",
|
||||||
|
"bandrich_uplink_udp_client",
|
||||||
|
udp_bandwidth=bandwidth)
|
||||||
|
|
||||||
|
##############################################################################
|
||||||
|
# run_b210_alu
|
||||||
|
##############################################################################
|
||||||
|
|
||||||
|
def run_b210_alu(tests, openair_dir, oai_user, oai_password, env):
|
||||||
|
if not do_tests(tests['b210']['alu']):
|
||||||
|
return
|
||||||
|
|
||||||
|
#compile eNB
|
||||||
|
|
||||||
|
alu = alu_test(epc='amerique', enb='hutch', ue='stevens',
|
||||||
|
openair=openair_dir,
|
||||||
|
user=oai_user, password=oai_password,
|
||||||
|
log_subdir='enb_tests/b210_alu/compile_enb',
|
||||||
|
env=env)
|
||||||
|
|
||||||
|
try:
|
||||||
|
alu.compile_enb("--eNB -w USRP -x -c --disable-cpu-affinity")
|
||||||
|
except BaseException, e:
|
||||||
|
log("ERROR: ALU test failed: eNB compilation failed: " + str(e))
|
||||||
|
return
|
||||||
|
|
||||||
|
#run tests
|
||||||
|
|
||||||
|
udp_dl_bandwidth = { "5" : "15M",
|
||||||
|
"10" : "30M",
|
||||||
|
"20" : "60M" }
|
||||||
|
|
||||||
|
udp_ul_bandwidth = { "5" : "7M",
|
||||||
|
"10" : "15M",
|
||||||
|
"20" : "15M" }
|
||||||
|
|
||||||
|
for bw in ('5', '10', '20'):
|
||||||
|
if do_tests(tests['b210']['alu'][bw]):
|
||||||
|
log("INFO: ALU test: run tests for bandwidth " + bw + " MHz")
|
||||||
|
ctest = tests['b210']['alu'][bw]
|
||||||
|
alu = alu_test(epc='amerique', enb='hutch', ue='stevens',
|
||||||
|
openair=openair_dir,
|
||||||
|
user=oai_user, password=oai_password,
|
||||||
|
log_subdir='enb_tests/b210_alu/' + bw,
|
||||||
|
env=env)
|
||||||
|
try:
|
||||||
|
alu.start_epc()
|
||||||
|
alu.start_enb("enb.band7.tm1.usrpb210." + bw + "MHz.conf")
|
||||||
|
if do_tests(ctest['bandrich']):
|
||||||
|
alu.start_bandrich_ue()
|
||||||
|
if do_tests(ctest['bandrich']['tcp']['dl']): alu.dl_tcp()
|
||||||
|
if do_tests(ctest['bandrich']['tcp']['ul']): alu.ul_tcp()
|
||||||
|
if do_tests(ctest['bandrich']['udp']['dl']):
|
||||||
|
alu.dl_udp(udp_dl_bandwidth[bw])
|
||||||
|
if do_tests(ctest['bandrich']['udp']['ul']):
|
||||||
|
alu.ul_udp(udp_ul_bandwidth[bw])
|
||||||
|
alu.stop_bandrich_ue()
|
||||||
|
alu.stop_enb()
|
||||||
|
alu.stop_epc()
|
||||||
|
except BaseException, e:
|
||||||
|
log("ERROR: ALU test failed: " + str(e))
|
||||||
|
alu.finish()
|
||||||
@@ -0,0 +1,175 @@
|
|||||||
|
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";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
);
|
||||||
@@ -0,0 +1,175 @@
|
|||||||
|
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";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
);
|
||||||
@@ -0,0 +1,175 @@
|
|||||||
|
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";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
);
|
||||||
@@ -0,0 +1,104 @@
|
|||||||
|
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))
|
||||||
@@ -0,0 +1,79 @@
|
|||||||
|
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)
|
||||||
@@ -0,0 +1,687 @@
|
|||||||
|
#!/usr/bin/python
|
||||||
|
|
||||||
|
import os, re, sys, time, threading, thread
|
||||||
|
import xml.etree.ElementTree as ET
|
||||||
|
|
||||||
|
from utils import test_in_list, quickshell, log
|
||||||
|
from task import Task, WAITLOG_SUCCESS, WAITLOG_FAILURE
|
||||||
|
from machine_list import MachineList
|
||||||
|
|
||||||
|
oai_user = os.environ.get('OAI_USER')
|
||||||
|
oai_password = os.environ.get('OAI_PASS')
|
||||||
|
requested_tests = os.environ.get('OAI_TEST_CASE_GROUP')
|
||||||
|
machines = os.environ.get('MACHINELIST')
|
||||||
|
generic_machines = os.environ.get('MACHINELISTGENERIC')
|
||||||
|
result_dir = os.environ.get('RESULT_DIR')
|
||||||
|
nruns_softmodem = os.environ.get('NRUNS_LTE_SOFTMODEM')
|
||||||
|
openair_dir = os.environ.get('OPENAIR_DIR')
|
||||||
|
|
||||||
|
some_undef = False
|
||||||
|
if (oai_user == None) :
|
||||||
|
log("variable OAI_USER is not defined")
|
||||||
|
some_undef = True
|
||||||
|
if (oai_password == None) :
|
||||||
|
log("variable OAI_PASS is not defined")
|
||||||
|
some_undef = True
|
||||||
|
if (requested_tests == None) :
|
||||||
|
log("variable OAI_TEST_CASE_GROUP is not defined")
|
||||||
|
some_undef = True
|
||||||
|
if (machines == None) :
|
||||||
|
log("variable MACHINELIST is not defined")
|
||||||
|
some_undef = True
|
||||||
|
if (generic_machines == None) :
|
||||||
|
log("variable MACHINELISTGENERIC is not defined")
|
||||||
|
some_undef = True
|
||||||
|
if (result_dir == None) :
|
||||||
|
log("variable RESULT_DIR is not defined")
|
||||||
|
some_undef = True
|
||||||
|
if (nruns_softmodem == None) :
|
||||||
|
log("variable NRUNS_LTE_SOFTMODEM is not defined")
|
||||||
|
some_undef = True
|
||||||
|
if (openair_dir == None) :
|
||||||
|
log("variable OPENAIR_DIR is not defined")
|
||||||
|
some_undef = True
|
||||||
|
if (some_undef == True):
|
||||||
|
os._exit(1)
|
||||||
|
|
||||||
|
requested_tests = requested_tests .replace('"','')
|
||||||
|
machines = machines .replace('"','')
|
||||||
|
generic_machines = generic_machines .replace('"','')
|
||||||
|
|
||||||
|
xml_test_file = os.environ.get('OPENAIR_DIR') + \
|
||||||
|
"/cmake_targets/autotests/test_case_list.xml"
|
||||||
|
|
||||||
|
xmlTree = ET.parse(xml_test_file)
|
||||||
|
xmlRoot = xmlTree.getroot()
|
||||||
|
|
||||||
|
exclusion_tests=xmlRoot.findtext('TestCaseExclusionList',default='')
|
||||||
|
all_tests=xmlRoot.findall('testCase')
|
||||||
|
|
||||||
|
exclusion_tests=exclusion_tests.split()
|
||||||
|
requested_tests=requested_tests.split()
|
||||||
|
|
||||||
|
#check that exclusion tests are well formatted
|
||||||
|
#(6 digits or less than 6 digits followed by +)
|
||||||
|
for test in exclusion_tests:
|
||||||
|
if (not re.match('^[0-9]{6}$', test) and
|
||||||
|
not re.match('^[0-9]{1,5}\+$', test)):
|
||||||
|
log("ERROR: exclusion test is invalidly formatted: " + test)
|
||||||
|
os._exit(1)
|
||||||
|
|
||||||
|
#check that requested tests are well formatted
|
||||||
|
#(6 digits or less than 6 digits followed by +)
|
||||||
|
#be verbose
|
||||||
|
for test in requested_tests:
|
||||||
|
if (re.match('^[0-9]{6}$', test) or
|
||||||
|
re.match('^[0-9]{1,5}\+$', test)):
|
||||||
|
log("INFO: test group/case requested: " + test)
|
||||||
|
else:
|
||||||
|
log("ERROR: requested test is invalidly formatted: " + test)
|
||||||
|
os._exit(1)
|
||||||
|
|
||||||
|
#get the list of tests to be done
|
||||||
|
todo_tests=[]
|
||||||
|
for test in all_tests:
|
||||||
|
if (test_in_list(test.get('id'), requested_tests) and
|
||||||
|
not test_in_list(test.get('id'), exclusion_tests)):
|
||||||
|
log("INFO: test will be run: " + test.get('id'))
|
||||||
|
todo_tests.append(test)
|
||||||
|
else:
|
||||||
|
log("INFO: test will be skipped: " + test.get('id'))
|
||||||
|
|
||||||
|
#get commit ID to use
|
||||||
|
commit_id = quickshell("git rev-parse --verify HEAD").replace('\n','')
|
||||||
|
if (len(commit_id) != 20*2):
|
||||||
|
log("ERROR: bad commit '" + commit_id + "'")
|
||||||
|
log("INFO: test for commit " + commit_id)
|
||||||
|
|
||||||
|
#get repository URL
|
||||||
|
repository_url = quickshell("git config remote.origin.url").replace('\n','')
|
||||||
|
log("INFO: repository URL: " + repository_url)
|
||||||
|
|
||||||
|
#prepare environment for tasks
|
||||||
|
env = []
|
||||||
|
env.append("REPOSITORY_URL=" + repository_url)
|
||||||
|
env.append("COMMIT_ID=" + commit_id)
|
||||||
|
|
||||||
|
#clone repository on all machines in the test setup
|
||||||
|
tasks=[]
|
||||||
|
for machine in machines.split():
|
||||||
|
tasks.append(Task("actions/clone_repository.bash",
|
||||||
|
"clone repository on " + machine,
|
||||||
|
machine,
|
||||||
|
oai_user,
|
||||||
|
oai_password,
|
||||||
|
env,
|
||||||
|
openair_dir + "/cmake_targets/autotests/log/clone." \
|
||||||
|
+ machine))
|
||||||
|
for task in tasks:
|
||||||
|
log("INFO: wait for task: " + task.description)
|
||||||
|
ret = task.wait()
|
||||||
|
if ret != 0 or not "TEST_SETUP_SUCCESS" in open(task.logfile).read():
|
||||||
|
log("ERROR: task failed: " + task.description)
|
||||||
|
os._exit(1)
|
||||||
|
|
||||||
|
##############################################################################
|
||||||
|
# run compilation tests #
|
||||||
|
##############################################################################
|
||||||
|
|
||||||
|
machine_list = MachineList(generic_machines.split())
|
||||||
|
|
||||||
|
for test in todo_tests:
|
||||||
|
action = test.findtext('class')
|
||||||
|
if action != 'compilation':
|
||||||
|
continue
|
||||||
|
id = test.get('id')
|
||||||
|
machine = machine_list.get_free_machine()
|
||||||
|
log("INFO: start " + action + " test " + id + " on machine " +
|
||||||
|
machine.name)
|
||||||
|
tasks = []
|
||||||
|
runenv = list(env)
|
||||||
|
runenv.append('OPENAIR_DIR=/tmp/oai_test_setup/oai')
|
||||||
|
runenv.append('BUILD_ARGUMENTS="'
|
||||||
|
+ test.findtext('compile_prog_args')
|
||||||
|
+ '"')
|
||||||
|
runenv.append('BUILD_OUTPUT="'
|
||||||
|
+ test.findtext('compile_prog_out')
|
||||||
|
.replace('\n','')
|
||||||
|
+ '"')
|
||||||
|
logdir = openair_dir +"/cmake_targets/autotests/log/"+ id +"/compile_log"
|
||||||
|
remote_files = "'/tmp/oai_test_setup/oai/cmake_targets/log/*'"
|
||||||
|
post_action = "mkdir -p "+ logdir + \
|
||||||
|
" && sshpass -p " + oai_password + " scp -r " + oai_user + \
|
||||||
|
"@" + machine.name + ":" + remote_files + " " + logdir + \
|
||||||
|
" || true"
|
||||||
|
tasks.append(Task("actions/" + action + ".bash",
|
||||||
|
action + " of test " + id + " on " + machine.name,
|
||||||
|
machine.name,
|
||||||
|
oai_user,
|
||||||
|
oai_password,
|
||||||
|
runenv,
|
||||||
|
openair_dir + "/cmake_targets/autotests/log/"
|
||||||
|
+ id + "."
|
||||||
|
+ machine.name,
|
||||||
|
post_action=post_action))
|
||||||
|
machine.busy(tasks)
|
||||||
|
|
||||||
|
##############################################################################
|
||||||
|
# run execution tests #
|
||||||
|
##############################################################################
|
||||||
|
|
||||||
|
class ExecutionThread(threading.Thread):
|
||||||
|
def __init__(self, id, machine, test):
|
||||||
|
threading.Thread.__init__(self)
|
||||||
|
self.machine = machine
|
||||||
|
self.id = id
|
||||||
|
self.test = test
|
||||||
|
|
||||||
|
def run(self):
|
||||||
|
id = self.id
|
||||||
|
machine = self.machine
|
||||||
|
test = self.test
|
||||||
|
|
||||||
|
# step 1: compile
|
||||||
|
|
||||||
|
log("INFO: start compilation of test " + id + " on machine " +
|
||||||
|
machine.name)
|
||||||
|
tasks = []
|
||||||
|
runenv = list(env)
|
||||||
|
runenv.append('OPENAIR_DIR=/tmp/oai_test_setup/oai')
|
||||||
|
runenv.append('PRE_BUILD="'
|
||||||
|
+ test.findtext('pre_compile_prog')
|
||||||
|
+ '"')
|
||||||
|
runenv.append('BUILD_PROG="'
|
||||||
|
+ test.findtext('compile_prog')
|
||||||
|
+ '"')
|
||||||
|
runenv.append('BUILD_ARGUMENTS="'
|
||||||
|
+ test.findtext('compile_prog_args')
|
||||||
|
+ '"')
|
||||||
|
runenv.append('PRE_EXEC="'
|
||||||
|
+ test.findtext('pre_exec') + " "
|
||||||
|
+ test.findtext('pre_exec_args')
|
||||||
|
+ '"')
|
||||||
|
logdir = openair_dir +"/cmake_targets/autotests/log/"+ id + \
|
||||||
|
"/compile_log"
|
||||||
|
remote_files = "'/tmp/oai_test_setup/oai/cmake_targets/log/*'"
|
||||||
|
post_action = "mkdir -p "+ logdir + \
|
||||||
|
" && sshpass -p " + oai_password + \
|
||||||
|
" scp -r " + oai_user + "@" + machine.name + ":" + \
|
||||||
|
remote_files + " " + logdir + \
|
||||||
|
" || true"
|
||||||
|
task = Task("actions/execution_compile.bash",
|
||||||
|
"compilation of test " + id + " on " + machine.name,
|
||||||
|
machine.name,
|
||||||
|
oai_user,
|
||||||
|
oai_password,
|
||||||
|
runenv,
|
||||||
|
openair_dir + "/cmake_targets/autotests/log/"
|
||||||
|
+ id + "_compile."
|
||||||
|
+ machine.name,
|
||||||
|
post_action=post_action)
|
||||||
|
ret = task.wait()
|
||||||
|
task.postaction()
|
||||||
|
if ret != 0:
|
||||||
|
log("ERROR: compilation of test " + id + " failed: " + str(ret))
|
||||||
|
machine.unbusy()
|
||||||
|
return
|
||||||
|
|
||||||
|
#step 2: run all tests
|
||||||
|
|
||||||
|
nruns = test.findtext('nruns')
|
||||||
|
args = test.findtext('main_exec_args')
|
||||||
|
i = 0
|
||||||
|
for arg in args.splitlines():
|
||||||
|
i = i+1
|
||||||
|
runenv2 = list(runenv)
|
||||||
|
runenv2.append('OPENAIR_TARGETS=/tmp/oai_test_setup/oai/targets')
|
||||||
|
runenv2.append('EXEC="'
|
||||||
|
+ test.findtext('main_exec')
|
||||||
|
+ '"')
|
||||||
|
runenv2.append('EXEC_ARGS="' + arg + '"')
|
||||||
|
for run in range(int(nruns)):
|
||||||
|
log("INFO: start execution of test " + id + " case " +
|
||||||
|
str(i) + " run " + str(run) + " on machine " +
|
||||||
|
machine.name)
|
||||||
|
task =Task("actions/execution.bash",
|
||||||
|
"execution of test " + id + " on " + machine.name,
|
||||||
|
machine.name,
|
||||||
|
oai_user,
|
||||||
|
oai_password,
|
||||||
|
runenv2,
|
||||||
|
openair_dir + "/cmake_targets/autotests/log/"
|
||||||
|
+ id + "_case_" + str(i) + "_run_" + str(run)
|
||||||
|
+ "." + machine.name)
|
||||||
|
ret = task.wait()
|
||||||
|
if ret != 0:
|
||||||
|
log("ERROR: execution of test " +id+ " failed: " +
|
||||||
|
str(ret))
|
||||||
|
|
||||||
|
machine.unbusy()
|
||||||
|
|
||||||
|
for test in todo_tests:
|
||||||
|
action = test.findtext('class')
|
||||||
|
if action != 'execution':
|
||||||
|
continue
|
||||||
|
id = test.get('id')
|
||||||
|
machine = machine_list.get_free_machine()
|
||||||
|
ExecutionThread(id, machine, test).start()
|
||||||
|
|
||||||
|
#wait for compilation/execution tests to be finished
|
||||||
|
#log only if some compilation/execution tests are actually done
|
||||||
|
for test in todo_tests:
|
||||||
|
action = test.findtext('class')
|
||||||
|
if action == 'execution' or action == 'compilation':
|
||||||
|
log("INFO: requested compilation/execution tests " +
|
||||||
|
"have been launched, waiting for completion")
|
||||||
|
break
|
||||||
|
machine_list.wait_all_free()
|
||||||
|
|
||||||
|
##############################################################################
|
||||||
|
# run eNB softmodem tests #
|
||||||
|
##############################################################################
|
||||||
|
|
||||||
|
tests = {
|
||||||
|
'b210' : {
|
||||||
|
'alu' : {
|
||||||
|
'5' : {
|
||||||
|
'bandrich' : {
|
||||||
|
'tcp' : { 'ul': False, 'dl' : False },
|
||||||
|
'udp' : { 'ul': False, 'dl' : False }},
|
||||||
|
'sony' : {
|
||||||
|
'tcp' : { 'ul': False, 'dl' : False },
|
||||||
|
'udp' : { 'ul': False, 'dl' : False }}},
|
||||||
|
'10' : {
|
||||||
|
'bandrich' : {
|
||||||
|
'tcp' : { 'ul': False, 'dl' : False },
|
||||||
|
'udp' : { 'ul': False, 'dl' : False }},
|
||||||
|
'sony' : {
|
||||||
|
'tcp' : { 'ul': False, 'dl' : False },
|
||||||
|
'udp' : { 'ul': False, 'dl' : False }}},
|
||||||
|
'20' : {
|
||||||
|
'bandrich' : {
|
||||||
|
'tcp' : { 'ul': False, 'dl' : False },
|
||||||
|
'udp' : { 'ul': False, 'dl' : False }},
|
||||||
|
'sony' : {
|
||||||
|
'tcp' : { 'ul': False, 'dl' : False },
|
||||||
|
'udp' : { 'ul': False, 'dl' : False }}}},
|
||||||
|
'openair-cn' : {}
|
||||||
|
},
|
||||||
|
'x310' : {
|
||||||
|
'alu' : {},
|
||||||
|
'openair-cn' : {}
|
||||||
|
},
|
||||||
|
'exmimo2' : {
|
||||||
|
'alu' : {},
|
||||||
|
'openair-cn' : {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
todo_tests_ids = []
|
||||||
|
for test in todo_tests:
|
||||||
|
todo_tests_ids.append(test.get('id'))
|
||||||
|
|
||||||
|
for test in todo_tests_ids:
|
||||||
|
if test=='015500':tests['b210']['alu'][ '5']['bandrich']['udp']['ul']=True
|
||||||
|
if test=='015501':tests['b210']['alu']['10']['bandrich']['udp']['ul']=True
|
||||||
|
if test=='015502':tests['b210']['alu']['20']['bandrich']['udp']['ul']=True
|
||||||
|
if test=='015503':tests['b210']['alu'][ '5']['bandrich']['udp']['dl']=True
|
||||||
|
if test=='015504':tests['b210']['alu']['10']['bandrich']['udp']['dl']=True
|
||||||
|
if test=='015505':tests['b210']['alu']['20']['bandrich']['udp']['dl']=True
|
||||||
|
if test=='015506':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='015507':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='015508':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='015509':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='015510':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='015511':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='015512':tests['b210']['alu'][ '5']['bandrich']['tcp']['ul']=True
|
||||||
|
if test=='015513':tests['b210']['alu']['10']['bandrich']['tcp']['ul']=True
|
||||||
|
if test=='015514':tests['b210']['alu']['20']['bandrich']['tcp']['ul']=True
|
||||||
|
if test=='015515':tests['b210']['alu'][ '5']['bandrich']['tcp']['dl']=True
|
||||||
|
if test=='015516':tests['b210']['alu']['10']['bandrich']['tcp']['dl']=True
|
||||||
|
if test=='015517':tests['b210']['alu']['20']['bandrich']['tcp']['dl']=True
|
||||||
|
if test=='015518':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='015519':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='015520':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='015521':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='015522':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='015523':log('WARNING: skip test ' + test) #TODO
|
||||||
|
|
||||||
|
if test=='015600':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='015601':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='015602':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='015603':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='015604':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='015605':log('WARNING: skip test ' + test) #TODO
|
||||||
|
|
||||||
|
if test=='015700':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='015701':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='015702':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='015703':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='015704':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='015705':log('WARNING: skip test ' + test) #TODO
|
||||||
|
|
||||||
|
if test=='015800':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='015801':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='015802':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='015803':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='015804':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='015805':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='015806':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='015807':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='015808':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='015809':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='015810':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='015811':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='015812':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='015813':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='015814':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='015815':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='015816':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='015817':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='015818':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='015819':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='015820':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='015821':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='015822':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='015823':log('WARNING: skip test ' + test) #TODO
|
||||||
|
|
||||||
|
if test=='016000':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='016001':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='016002':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='016003':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='016004':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='016005':log('WARNING: skip test ' + test) #TODO
|
||||||
|
|
||||||
|
if test=='016100':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='016101':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='016102':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='016103':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='016104':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='016105':log('WARNING: skip test ' + test) #TODO
|
||||||
|
|
||||||
|
if test=='016300':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='016301':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='016302':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='016303':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='016304':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='016305':log('WARNING: skip test ' + test) #TODO
|
||||||
|
|
||||||
|
if test=='016500':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='016501':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='016502':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='016503':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='016504':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='016505':log('WARNING: skip test ' + test) #TODO
|
||||||
|
|
||||||
|
if test=='017000':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='017001':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='017002':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='017003':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='017004':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='017005':log('WARNING: skip test ' + test) #TODO
|
||||||
|
|
||||||
|
if test=='017500':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='017501':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='017502':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='017503':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='017504':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='017505':log('WARNING: skip test ' + test) #TODO
|
||||||
|
|
||||||
|
if test=='018000':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='018001':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='018002':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='018003':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='018004':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='018005':log('WARNING: skip test ' + test) #TODO
|
||||||
|
|
||||||
|
if test=='018500':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='018501':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='018502':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='018503':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='018504':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='018505':log('WARNING: skip test ' + test) #TODO
|
||||||
|
|
||||||
|
if test=='025500':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='025501':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='025502':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='025503':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='025504':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='025505':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='025506':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='025507':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='025508':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='025509':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='025510':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='025511':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='025512':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='025513':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='025514':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='025515':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='025516':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='025517':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='025518':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='025519':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='025520':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='025521':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='025522':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='025523':log('WARNING: skip test ' + test) #TODO
|
||||||
|
|
||||||
|
if test=='025700':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='025701':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='025702':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='025703':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='025704':log('WARNING: skip test ' + test) #TODO
|
||||||
|
if test=='025705':log('WARNING: skip test ' + test) #TODO
|
||||||
|
|
||||||
|
from alu_test import run_b210_alu
|
||||||
|
|
||||||
|
#B210 ALU tests
|
||||||
|
|
||||||
|
run_b210_alu(tests, openair_dir, oai_user, oai_password, env)
|
||||||
|
|
||||||
|
#for test in todo_tests:
|
||||||
|
# action = test.findtext('class')
|
||||||
|
# if action != 'lte-softmodem':
|
||||||
|
# continue
|
||||||
|
# if not "start_ltebox" in test.findtext('EPC_main_exec'):
|
||||||
|
# continue
|
||||||
|
# id = test.get('id')
|
||||||
|
# log("INFO: Running ALU test " + id)
|
||||||
|
# logdir = openair_dir + "/cmake_targets/autotests/log/" + id
|
||||||
|
# quickshell("mkdir -p " + logdir)
|
||||||
|
# epc_machine = test.findtext('EPC')
|
||||||
|
# enb_machine = test.findtext('eNB')
|
||||||
|
# ue_machine = test.findtext('UE')
|
||||||
|
#
|
||||||
|
# #event object used to wait for several tasks at once
|
||||||
|
# event = threading.Event()
|
||||||
|
#
|
||||||
|
# #launch HSS, wait for prompt
|
||||||
|
# log("INFO: " + id + ": run HSS")
|
||||||
|
# task_hss = Task("actions/alu_hss.bash",
|
||||||
|
# "ALU HSS",
|
||||||
|
# epc_machine,
|
||||||
|
# oai_user,
|
||||||
|
# oai_password,
|
||||||
|
# env,
|
||||||
|
# logdir + "/alu_hss." + epc_machine, event=event)
|
||||||
|
# task_hss.waitlog('S6AS_SIM-> ')
|
||||||
|
#
|
||||||
|
# #then launch EPC, wait for connection on HSS side
|
||||||
|
# log("INFO: " + id + ": run EPC")
|
||||||
|
# task = Task("actions/alu_epc.bash",
|
||||||
|
# "ALU EPC",
|
||||||
|
# epc_machine,
|
||||||
|
# oai_user,
|
||||||
|
# oai_password,
|
||||||
|
# env,
|
||||||
|
# logdir + "/alu_epc." + epc_machine)
|
||||||
|
# ret = task.wait()
|
||||||
|
# if ret != 0:
|
||||||
|
# log("ERROR: EPC start failure");
|
||||||
|
# os._exit(1)
|
||||||
|
# task_hss.waitlog('Connected\n')
|
||||||
|
#
|
||||||
|
# #compile softmodem
|
||||||
|
# log("INFO: " + id + ": compile softmodem")
|
||||||
|
# envcomp = list(env)
|
||||||
|
# envcomp.append('BUILD_ARGUMENTS="' +
|
||||||
|
# test.findtext('eNB_compile_prog_args') + '"')
|
||||||
|
# #we don't care about BUILD_OUTPUT but it's required (TODO: change that)
|
||||||
|
# envcomp.append('BUILD_OUTPUT=/')
|
||||||
|
# task = Task("actions/compilation.bash",
|
||||||
|
# "compile softmodem",
|
||||||
|
# enb_machine,
|
||||||
|
# oai_user,
|
||||||
|
# oai_password,
|
||||||
|
# envcomp,
|
||||||
|
# logdir + "/compile_softmodem." + enb_machine)
|
||||||
|
# ret = task.wait()
|
||||||
|
# if ret != 0:
|
||||||
|
# log("ERROR: softmodem compilation failure");
|
||||||
|
# os._exit(1)
|
||||||
|
#
|
||||||
|
## #copy wanted configuration file
|
||||||
|
## quickshell("sshpass -p " + oai_password +
|
||||||
|
## " scp config/enb.band7.tm1.usrpb210.conf " +
|
||||||
|
## oai_user + "@" + enb_machine + ":/tmp/enb.conf")
|
||||||
|
#
|
||||||
|
# #run softmodem
|
||||||
|
# log("INFO: " + id + ": run softmodem")
|
||||||
|
# task_enb = Task("actions/run_enb.bash",
|
||||||
|
# "run softmodem",
|
||||||
|
# enb_machine,
|
||||||
|
# oai_user,
|
||||||
|
# oai_password,
|
||||||
|
# env,
|
||||||
|
# logdir + "/run_softmodem." + enb_machine, event=event)
|
||||||
|
# task_enb.waitlog('got sync')
|
||||||
|
#
|
||||||
|
# #start UE
|
||||||
|
# log("INFO: " + id + ": start bandrich UE")
|
||||||
|
# task_ue = Task("actions/start_bandrich.bash",
|
||||||
|
# "start bandrich UE",
|
||||||
|
# ue_machine,
|
||||||
|
# oai_user,
|
||||||
|
# oai_password,
|
||||||
|
# env,
|
||||||
|
# logdir + "/start_bandrich." + ue_machine, event=event)
|
||||||
|
# task_ue.waitlog("local IP address", event=event)
|
||||||
|
#
|
||||||
|
# event.wait()
|
||||||
|
#
|
||||||
|
# #at this point one task has died or we have the line in the log
|
||||||
|
# if task_ue.waitlog_state != WAITLOG_SUCCESS:
|
||||||
|
# log("ERROR: " + id + ": bandrich UE did not connect")
|
||||||
|
# os._exit(1)
|
||||||
|
#
|
||||||
|
# event.clear()
|
||||||
|
#
|
||||||
|
# if ( not task_enb.alive() or
|
||||||
|
# not task_hss.alive() or
|
||||||
|
# not task_ue.alive()):
|
||||||
|
# log("ERROR: " + id + ": eNB or UE tasks died")
|
||||||
|
# os._exit(1)
|
||||||
|
#
|
||||||
|
# #get bandrich UE IP
|
||||||
|
# l = open(task_ue.logfile, "r").read()
|
||||||
|
# ue_ip = re.search("local IP address (.*)\n", l).groups()[0]
|
||||||
|
# log("INFO: " + id + ": bandrich UE IP address: " + ue_ip)
|
||||||
|
#
|
||||||
|
# #run traffic
|
||||||
|
# log("INFO: " + id + ": run downlink TCP traffic")
|
||||||
|
#
|
||||||
|
# log("INFO: " + id + ": launch server")
|
||||||
|
# task_traffic_ue = Task("actions/downlink_bandrich.bash",
|
||||||
|
# "start iperf on bandrich UE as server",
|
||||||
|
# ue_machine,
|
||||||
|
# oai_user,
|
||||||
|
# oai_password,
|
||||||
|
# env,
|
||||||
|
# logdir + "/downlink_bandrich." + ue_machine,
|
||||||
|
# event=event)
|
||||||
|
# task_traffic_ue.waitlog("Server listening on TCP port 5001")
|
||||||
|
#
|
||||||
|
# log("INFO: " + id + ": launch client")
|
||||||
|
# envepc = list(env)
|
||||||
|
# envepc.append("UE_IP=" + ue_ip)
|
||||||
|
# task = Task("actions/downlink_epc.bash",
|
||||||
|
# "start iperf on EPC as client",
|
||||||
|
# epc_machine,
|
||||||
|
# oai_user,
|
||||||
|
# oai_password,
|
||||||
|
# envepc,
|
||||||
|
# logdir + "/downlink_epc." + epc_machine, event=event)
|
||||||
|
# log("INFO: " + id + ": wait for client (or some error)")
|
||||||
|
#
|
||||||
|
# event.wait()
|
||||||
|
# log("DEBUG: event.wait() done")
|
||||||
|
#
|
||||||
|
# if ( not task_enb.alive() or
|
||||||
|
# not task_hss.alive() or
|
||||||
|
# not task_ue.alive()):
|
||||||
|
# log("ERROR: unexpected task exited, test failed, kill all")
|
||||||
|
# if task.alive():
|
||||||
|
# task.kill()
|
||||||
|
# if task_enb.alive():
|
||||||
|
# task_enb.kill()
|
||||||
|
# if task_ue.alive():
|
||||||
|
# task_ue.kill()
|
||||||
|
#
|
||||||
|
# ret = task.wait()
|
||||||
|
# if ret != 0:
|
||||||
|
# log("ERROR: " + id + ": downlink traffic failed")
|
||||||
|
# #not sure if we have to quit here or not
|
||||||
|
# #os._exit(1)
|
||||||
|
#
|
||||||
|
# #stop downlink server
|
||||||
|
# log("INFO: " + id + ": stop server (kill ssh connection)")
|
||||||
|
# task_traffic_ue.kill()
|
||||||
|
# log("INFO: " + id + ": wait for server to quit")
|
||||||
|
# task_traffic_ue.wait()
|
||||||
|
#
|
||||||
|
# #stop UE
|
||||||
|
# log("INFO: " + id + ": stop bandrich UE")
|
||||||
|
# task_ue.sendnow("%c" % 3)
|
||||||
|
# ret = task_ue.wait()
|
||||||
|
# if ret != 0:
|
||||||
|
# log("ERROR: " + id + ": task bandrich UE failed")
|
||||||
|
# #not sure if we have to quit here or not
|
||||||
|
# #os._exit(1)
|
||||||
|
#
|
||||||
|
# #stop softmodem
|
||||||
|
# log("INFO: " + id + ": stop softmodem")
|
||||||
|
# task_enb.sendnow("%c" % 3)
|
||||||
|
# ret = task_enb.wait()
|
||||||
|
# if ret != 0:
|
||||||
|
# log("ERROR: " + id + ": softmodem failed")
|
||||||
|
# #not sure if we have to quit here or not
|
||||||
|
# #os._exit(1)
|
||||||
|
#
|
||||||
|
# #stop EPC, wait for disconnection on HSS side
|
||||||
|
# log("INFO: " + id + ": stop EPC")
|
||||||
|
# task = Task("actions/alu_epc_stop.bash",
|
||||||
|
# "ALU EPC stop",
|
||||||
|
# epc_machine,
|
||||||
|
# oai_user,
|
||||||
|
# oai_password,
|
||||||
|
# env,
|
||||||
|
# logdir + "/alu_epc_stop." + epc_machine)
|
||||||
|
# ret = task.wait()
|
||||||
|
# if ret != 0:
|
||||||
|
# log("ERROR: " + id + ": ALU EPC stop failed")
|
||||||
|
# os._exit(1)
|
||||||
|
# task_hss.waitlog('Disconnected\n')
|
||||||
|
#
|
||||||
|
# log("INFO: " + id + ": stop HSS")
|
||||||
|
# task_hss.sendnow("exit\n")
|
||||||
|
# ret = task_hss.wait()
|
||||||
|
# if ret != 0:
|
||||||
|
# log("ERROR: " + id + ": ALU HSS failed")
|
||||||
|
# os._exit(1)
|
||||||
|
|
||||||
|
import utils
|
||||||
|
log(utils.GREEN + "GOODBYE" + utils.RESET)
|
||||||
|
#os._exit(0)
|
||||||
|
|
||||||
|
#run lte softmodem tests
|
||||||
@@ -0,0 +1,370 @@
|
|||||||
|
import os, time, threading, sys, os, errno, select
|
||||||
|
from connection import connection
|
||||||
|
|
||||||
|
import utils
|
||||||
|
from utils import log
|
||||||
|
|
||||||
|
#this class is to communicate between reader and sender threads
|
||||||
|
#the reader increments a count each time it receives the prompt
|
||||||
|
#and wakes up the sender
|
||||||
|
#it also indicates when it exits so the sender can exit too
|
||||||
|
#the sender (calling get) waits for the count to be greated than passed
|
||||||
|
#argument or if reader exited
|
||||||
|
#it returns argument+1 if things okay, -1 if reader exited
|
||||||
|
class Counter:
|
||||||
|
def __init__(self):
|
||||||
|
self.count = 0
|
||||||
|
self.cond = threading.Condition()
|
||||||
|
|
||||||
|
def inc(self):
|
||||||
|
self.cond.acquire()
|
||||||
|
self.count = self.count + 1
|
||||||
|
self.cond.notify()
|
||||||
|
self.cond.release()
|
||||||
|
|
||||||
|
def set(self, value):
|
||||||
|
self.cond.acquire()
|
||||||
|
self.count = value
|
||||||
|
self.cond.notify()
|
||||||
|
self.cond.release()
|
||||||
|
|
||||||
|
def get(self, current):
|
||||||
|
self.cond.acquire()
|
||||||
|
while True:
|
||||||
|
if self.count == -1:
|
||||||
|
ret = -1
|
||||||
|
break
|
||||||
|
if self.count >= current + 1:
|
||||||
|
ret = current + 1
|
||||||
|
break
|
||||||
|
self.cond.wait()
|
||||||
|
self.cond.release()
|
||||||
|
return ret
|
||||||
|
|
||||||
|
#this class is used for the main application to wait for some specific
|
||||||
|
#output from the remote program (typically the ALU HSS prompt, indicating
|
||||||
|
#it is ready and we can proceed further)
|
||||||
|
#(too much classes...)
|
||||||
|
class ProducerConsumer:
|
||||||
|
def __init__(self):
|
||||||
|
self.count = 0
|
||||||
|
self.cond = threading.Condition()
|
||||||
|
|
||||||
|
def add(self, v):
|
||||||
|
self.cond.acquire()
|
||||||
|
self.count = self.count + v
|
||||||
|
self.cond.notify()
|
||||||
|
self.cond.release()
|
||||||
|
|
||||||
|
def set(self, v):
|
||||||
|
self.cond.acquire()
|
||||||
|
self.count = v
|
||||||
|
self.cond.notify()
|
||||||
|
self.cond.release()
|
||||||
|
|
||||||
|
def get(self, old):
|
||||||
|
self.cond.acquire()
|
||||||
|
while True:
|
||||||
|
if self.count == -1:
|
||||||
|
ret = -1
|
||||||
|
break
|
||||||
|
if self.count > old:
|
||||||
|
ret = self.count
|
||||||
|
break
|
||||||
|
self.cond.wait()
|
||||||
|
self.cond.release()
|
||||||
|
return ret
|
||||||
|
|
||||||
|
#this thread gets input from the child process of the task
|
||||||
|
#it removes the prompts it gets (be carefully to use a prompt
|
||||||
|
#that will not be output of any command otherwise you dead)
|
||||||
|
class ReaderThread(threading.Thread):
|
||||||
|
def __init__(self, fdin, logfile, prompt, prompt_counter, producer):
|
||||||
|
threading.Thread.__init__(self)
|
||||||
|
self.fdin = fdin
|
||||||
|
self.logfile = logfile
|
||||||
|
self.prompt_counter = prompt_counter
|
||||||
|
self.prompt = prompt
|
||||||
|
self.promptsize = len(prompt)
|
||||||
|
self.stack = ""
|
||||||
|
self.stacksize = 0
|
||||||
|
self.producer = producer
|
||||||
|
|
||||||
|
def run(self):
|
||||||
|
try:
|
||||||
|
outfile = open(self.logfile, "w")
|
||||||
|
except BaseException, e:
|
||||||
|
log("ERROR: ReaderThread: " + self.logfile + ": " + str(e))
|
||||||
|
os._exit(1)
|
||||||
|
while True:
|
||||||
|
try:
|
||||||
|
(a, b, c) = select.select([ self.fdin ], [], [ self.fdin ])
|
||||||
|
except BaseException, e:
|
||||||
|
log("ERROR: ReaderThread: " + self.logfile +
|
||||||
|
": select failed: " + str(e))
|
||||||
|
os._exit(1)
|
||||||
|
try:
|
||||||
|
z = os.read(self.fdin, 1024)
|
||||||
|
except OSError, e:
|
||||||
|
if e.errno == errno.EIO:
|
||||||
|
#pipe has died, quit the thread
|
||||||
|
break
|
||||||
|
else:
|
||||||
|
log("ERROR: ReaderThread: " + self.logfile +
|
||||||
|
": unhandled error: " + str(e))
|
||||||
|
except BaseException, e:
|
||||||
|
log("ERROR: ReaderThread: " + self.logfile +
|
||||||
|
": unhandled error: " + str(e))
|
||||||
|
break
|
||||||
|
try:
|
||||||
|
produced = 0
|
||||||
|
#this part is to remove the prompt
|
||||||
|
for x in z:
|
||||||
|
if x == self.prompt[self.stacksize]:
|
||||||
|
self.stack = self.stack + x
|
||||||
|
self.stacksize = self.stacksize + 1
|
||||||
|
if self.stacksize == self.promptsize:
|
||||||
|
self.prompt_counter.inc()
|
||||||
|
self.stack = ""
|
||||||
|
self.stacksize = 0
|
||||||
|
else:
|
||||||
|
outfile.write(self.stack)
|
||||||
|
outfile.write(x)
|
||||||
|
produced = produced + len(self.stack) + len(x)
|
||||||
|
self.stack = ""
|
||||||
|
self.stacksize = 0
|
||||||
|
outfile.flush()
|
||||||
|
self.producer.add(produced)
|
||||||
|
except BaseException, e:
|
||||||
|
log("ERROR: ReaderThread: " + self.logfile + ": " + str(e))
|
||||||
|
os._exit(1)
|
||||||
|
try:
|
||||||
|
outfile.close()
|
||||||
|
except BaseException, e:
|
||||||
|
log("ERROR: ReaderThread: " + self.logfile + ": " + str(e))
|
||||||
|
os._exit(1)
|
||||||
|
#close the pipe, don't care about errors
|
||||||
|
try:
|
||||||
|
os.close(self.fdin)
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
#signal sender to quit
|
||||||
|
self.prompt_counter.set(-1)
|
||||||
|
self.producer.set(-1)
|
||||||
|
|
||||||
|
class SenderQuit(Exception):
|
||||||
|
pass
|
||||||
|
|
||||||
|
#this thread sends commands to the child process of the task
|
||||||
|
#it waits for the prompt between each command
|
||||||
|
#'event' is used for the main thread to wait for one of several tasks
|
||||||
|
#to quit, meaning error or end-of-test
|
||||||
|
class SenderThread(threading.Thread):
|
||||||
|
def __init__(self, fdout, prompt_counter, connection, env, action,
|
||||||
|
description, prompt, event=None):
|
||||||
|
threading.Thread.__init__(self)
|
||||||
|
self.fdin = fdout
|
||||||
|
self.prompt_counter = prompt_counter
|
||||||
|
self.connection = connection
|
||||||
|
self.env = env
|
||||||
|
self.action = action
|
||||||
|
self.description = description
|
||||||
|
self.prompt = prompt
|
||||||
|
self.count = 0
|
||||||
|
self.event = event
|
||||||
|
self.alive = True
|
||||||
|
|
||||||
|
def wait_prompt(self):
|
||||||
|
self.count = self.prompt_counter.get(self.count)
|
||||||
|
if self.count == -1:
|
||||||
|
raise SenderQuit()
|
||||||
|
|
||||||
|
def _run(self):
|
||||||
|
self.connection.send('export PS1=' + self.prompt + '\n')
|
||||||
|
self.wait_prompt()
|
||||||
|
self.connection.send('set +o emacs\n')
|
||||||
|
self.wait_prompt()
|
||||||
|
self.connection.send('echo\n')
|
||||||
|
self.wait_prompt()
|
||||||
|
self.connection.send('echo\n')
|
||||||
|
self.wait_prompt()
|
||||||
|
self.connection.send("echo -e '" + utils.GREEN +
|
||||||
|
'---------------------------------------------'
|
||||||
|
+ utils.RESET + "'\n")
|
||||||
|
self.wait_prompt()
|
||||||
|
self.connection.send('echo\n')
|
||||||
|
self.wait_prompt()
|
||||||
|
self.connection.send("echo -n -e '" + utils.YELLOW +
|
||||||
|
"COMMANDS START: " +
|
||||||
|
utils.RESET + "'\n")
|
||||||
|
self.wait_prompt()
|
||||||
|
self.connection.send('date\n')
|
||||||
|
self.wait_prompt()
|
||||||
|
|
||||||
|
for l in self.env:
|
||||||
|
self.connection.send('export ' + l + '\n')
|
||||||
|
self.wait_prompt()
|
||||||
|
|
||||||
|
with open(self.action) as f:
|
||||||
|
for line in f:
|
||||||
|
self.connection.send("echo -n -e '" + utils.GREEN +
|
||||||
|
"RUNNING: " + utils.RESET + "'\n")
|
||||||
|
self.wait_prompt()
|
||||||
|
self.connection.send("echo '" +
|
||||||
|
line.replace('\n','')
|
||||||
|
.replace("'", "'\\''") + "'\n")
|
||||||
|
self.wait_prompt()
|
||||||
|
self.connection.send(line)
|
||||||
|
self.wait_prompt()
|
||||||
|
self.connection.send("if [ $? != 0 ]; then " +
|
||||||
|
"echo -e '" + utils.RED +
|
||||||
|
"TEST_SETUP_ERROR: " + utils.RESET +
|
||||||
|
"last command failed, exiting'; " +
|
||||||
|
"date; exit 1; fi\n")
|
||||||
|
self.wait_prompt()
|
||||||
|
|
||||||
|
self.connection.send("echo -n -e '" + utils.YELLOW +
|
||||||
|
"COMMANDS DONE: " +
|
||||||
|
utils.RESET + "'\n")
|
||||||
|
self.wait_prompt()
|
||||||
|
self.connection.send('date\n')
|
||||||
|
self.wait_prompt()
|
||||||
|
self.connection.send("echo -e '" + utils.GREEN +
|
||||||
|
"TEST_SETUP_SUCCESS" + utils.RESET + "'\n")
|
||||||
|
self.wait_prompt()
|
||||||
|
self.connection.send('exit\n')
|
||||||
|
|
||||||
|
def run(self):
|
||||||
|
try:
|
||||||
|
self._run()
|
||||||
|
except SenderQuit:
|
||||||
|
log("WARNING: '" + self.description + "' exits too early?")
|
||||||
|
pass
|
||||||
|
except BaseException, e:
|
||||||
|
log("ERROR: task failed: " + str(e))
|
||||||
|
log("ERROR: action is: " + self.action)
|
||||||
|
log("ERROR: description is: " + self.description)
|
||||||
|
os._exit(1)
|
||||||
|
|
||||||
|
self.alive = False
|
||||||
|
|
||||||
|
if self.event != None:
|
||||||
|
self.event.set()
|
||||||
|
|
||||||
|
WAITLOG_RUNNING = 0
|
||||||
|
WAITLOG_SUCCESS = 1
|
||||||
|
WAITLOG_FAILURE = 2
|
||||||
|
|
||||||
|
class WaitlogFailed(Exception):
|
||||||
|
pass
|
||||||
|
|
||||||
|
#'event' is used by main thread to wait for any of several threads to quit.
|
||||||
|
#'Task' passes it the 'SenderThread' above, which sets it when it finishes.
|
||||||
|
class Task:
|
||||||
|
def __init__(self, action, description, machine, user, password, env,
|
||||||
|
logfile, post_action = None, event=None):
|
||||||
|
self.action = action
|
||||||
|
self.description = description
|
||||||
|
self.machine = machine
|
||||||
|
self.user = user
|
||||||
|
self.password = password
|
||||||
|
self.post_action = post_action
|
||||||
|
self.producer = ProducerConsumer()
|
||||||
|
self.logfile = logfile
|
||||||
|
|
||||||
|
prompt = "__OAI_TEST_SETUP_PROMPT__:"
|
||||||
|
prompt_counter = Counter()
|
||||||
|
|
||||||
|
self.connection = connection(description, machine, user, password)
|
||||||
|
|
||||||
|
self.reader = ReaderThread(self.connection.fd, logfile, prompt,
|
||||||
|
prompt_counter, self.producer)
|
||||||
|
self.reader.start()
|
||||||
|
|
||||||
|
self.sender = SenderThread(self.connection.fd, prompt_counter,
|
||||||
|
self.connection, env, action, description,
|
||||||
|
prompt, event)
|
||||||
|
self.sender.start()
|
||||||
|
|
||||||
|
def wait(self, timeout=-1):
|
||||||
|
if self.connection.active == False:
|
||||||
|
return self.connection.retcode
|
||||||
|
try:
|
||||||
|
(pid, ret) = os.waitpid(self.connection.pid, 0)
|
||||||
|
except KeyboardInterrupt, e:
|
||||||
|
log("ERROR: ctrl+c catched! " + str(e))
|
||||||
|
os._exit(1)
|
||||||
|
except BaseException, e:
|
||||||
|
log("ERROR: " + str(e))
|
||||||
|
os._exit(1)
|
||||||
|
self.sender.join()
|
||||||
|
self.reader.join()
|
||||||
|
return ret
|
||||||
|
|
||||||
|
#this function should not be called, it is used internally by 'waitlog'
|
||||||
|
#in mode 'background thread'
|
||||||
|
#TODO: join() the thread at some point
|
||||||
|
def _waitlog_thread(self, task, s):
|
||||||
|
consumed = 0
|
||||||
|
while True:
|
||||||
|
consumed = task.producer.get(consumed)
|
||||||
|
if consumed == -1:
|
||||||
|
log("ERROR: string '" + s + "' not found in logfile " +
|
||||||
|
task.logfile)
|
||||||
|
task.waitlog_state = WAITLOG_FAILURE
|
||||||
|
task.waitlog_event.set()
|
||||||
|
return
|
||||||
|
if s in open(task.logfile).read():
|
||||||
|
task.waitlog_state = WAITLOG_SUCCESS
|
||||||
|
task.waitlog_event.set()
|
||||||
|
return
|
||||||
|
|
||||||
|
#two ways to wait for a string in the log file:
|
||||||
|
# - blocking way
|
||||||
|
# - background thread, using an Event to signal success/failure
|
||||||
|
def waitlog(self, s, event=None):
|
||||||
|
if event != None:
|
||||||
|
self.waitlog_state = WAITLOG_RUNNING
|
||||||
|
self.waitlog_event = event
|
||||||
|
self.waitlog_thread = \
|
||||||
|
threading.Thread(target=self._waitlog_thread,
|
||||||
|
args=(self, s))
|
||||||
|
self.waitlog_thread.start()
|
||||||
|
return
|
||||||
|
|
||||||
|
#TODO: optimize, do not process all the file at each wakeup
|
||||||
|
consumed = 0
|
||||||
|
while True:
|
||||||
|
consumed = self.producer.get(consumed)
|
||||||
|
if consumed == -1:
|
||||||
|
log("ERROR: string '" + s + "' not found in logfile " +
|
||||||
|
self.logfile)
|
||||||
|
raise WaitlogFailed()
|
||||||
|
if s in open(self.logfile).read():
|
||||||
|
return
|
||||||
|
|
||||||
|
def sendnow(self, x):
|
||||||
|
self.connection.send(x)
|
||||||
|
|
||||||
|
def alive(self):
|
||||||
|
return self.sender.alive
|
||||||
|
|
||||||
|
def kill(self):
|
||||||
|
self.connection.kill()
|
||||||
|
#put some error log in logfile, for verbosity
|
||||||
|
try:
|
||||||
|
f = open(self.logfile, "a+")
|
||||||
|
f.write("\n\n" + utils.RED + "TEST_SETUP_ERROR: " + utils.RESET +
|
||||||
|
"task killed by test setup\n\n");
|
||||||
|
close(f)
|
||||||
|
except BaseException, e:
|
||||||
|
pass
|
||||||
|
|
||||||
|
def postaction(self):
|
||||||
|
if self.post_action != None:
|
||||||
|
out = utils.quickshell(self.post_action)
|
||||||
|
if len(out):
|
||||||
|
log("INFO: task '" + self.description +
|
||||||
|
"' post_action '" + self.post_action + "' says: ")
|
||||||
|
for l in out.splitlines():
|
||||||
|
log("INFO: " + l)
|
||||||
@@ -0,0 +1,84 @@
|
|||||||
|
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
|
CMakeFiles/nasmesh/nasmesh.ko $dbin/nasmesh.ko
|
||||||
|
|
||||||
#oai_nw_drv
|
#oai_nw_drv
|
||||||
compilations \
|
#compilations \
|
||||||
$oaisim_build_dir oai_nw_drv \
|
# $oaisim_build_dir oai_nw_drv \
|
||||||
CMakeFiles/oai_nw_drv/oai_nw_drv.ko $dbin/oai_nw_drv.ko
|
# CMakeFiles/oai_nw_drv/oai_nw_drv.ko $dbin/oai_nw_drv.ko
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cmake_file=$DIR/oaisim_mme_build_oai/CMakeLists.txt
|
cmake_file=$DIR/oaisim_mme_build_oai/CMakeLists.txt
|
||||||
|
|||||||
@@ -0,0 +1,71 @@
|
|||||||
|
#!/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
|
DESC = VCD function RECV_IF5
|
||||||
GROUP = ALL:VCD:ENB:VCD_FUNCTION
|
GROUP = ALL:VCD:ENB:VCD_FUNCTION
|
||||||
FORMAT = int,value
|
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
|
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
|
record: utils.o record.o database.o config.o
|
||||||
$(CC) $(CFLAGS) -o record $^ $(LIBS)
|
$(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
|
filter/filter.a
|
||||||
$(CC) $(CFLAGS) -o enb $^ $(LIBS)
|
$(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 \
|
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 \
|
event_selector.o view/view.a gui/gui.a logger/logger.a \
|
||||||
filter/filter.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);
|
logger_add_view(l, v);
|
||||||
e->ul_mcs_logger = l;
|
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 */
|
/* downlink/uplink UE DCIs */
|
||||||
widget_add_child(g, top_container,
|
widget_add_child(g, top_container,
|
||||||
new_label(g,"DL/UL TICK/DCI/ACK/NACK [all UEs]"), -1);
|
new_label(g,"DL/UL TICK/DCI/ACK/NACK [all UEs]"), -1);
|
||||||
|
|||||||
@@ -0,0 +1,876 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <pthread.h>
|
||||||
|
#include <signal.h>
|
||||||
|
#include "database.h"
|
||||||
|
#include "event.h"
|
||||||
|
#include "handler.h"
|
||||||
|
#include "logger/logger.h"
|
||||||
|
#include "view/view.h"
|
||||||
|
#include "gui/gui.h"
|
||||||
|
#include "filter/filter.h"
|
||||||
|
#include "utils.h"
|
||||||
|
#include "../T_defs.h"
|
||||||
|
#include "event_selector.h"
|
||||||
|
#include "openair_logo.h"
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
view *phyview;
|
||||||
|
view *macview;
|
||||||
|
view *rlcview;
|
||||||
|
view *pdcpview;
|
||||||
|
view *rrcview;
|
||||||
|
view *legacy;
|
||||||
|
widget *current_ue_label;
|
||||||
|
widget *prev_ue_button;
|
||||||
|
widget *next_ue_button;
|
||||||
|
widget *pdsch_iq_ue_xy_plot;
|
||||||
|
widget *dl_estimate_ue_xy_plot;
|
||||||
|
widget *pdcch_energy_ue_xy_plot;
|
||||||
|
widget *pdsch_energy_ue_xy_plot;
|
||||||
|
widget *pdcch_iq_ue_xy_plot;
|
||||||
|
widget *dl_ul_harq_ue_label;
|
||||||
|
widget *dl_mcs_xy_plot;
|
||||||
|
widget *ul_mcs_xy_plot;
|
||||||
|
widget *pusch_power_xy_plot;
|
||||||
|
widget *pucch_power_xy_plot;
|
||||||
|
widget *phy_meas_xy_plot;
|
||||||
|
logger *pdsch_iq_ue_logger;
|
||||||
|
logger *dl_estimate_ue_logger;
|
||||||
|
logger *pdcch_iq_ue_logger;
|
||||||
|
logger *dl_dci_logger[8];
|
||||||
|
logger *dl_ack_logger[8];
|
||||||
|
logger *dl_nack_logger[8];
|
||||||
|
logger *ul_dci_logger[8];
|
||||||
|
logger *ul_dci_retransmission_logger[8];
|
||||||
|
logger *ul_ack_logger[8];
|
||||||
|
logger *ul_nack_logger[8];
|
||||||
|
logger *dl_mcs_logger;
|
||||||
|
logger *ul_mcs_logger;
|
||||||
|
logger *pusch_power_logger;
|
||||||
|
logger *pusch_ampl_logger;
|
||||||
|
logger *pucch_power_logger;
|
||||||
|
logger *pucch_ampl_logger;
|
||||||
|
logger *pdcch_energy_logger;
|
||||||
|
logger *pdsch_energy_logger;
|
||||||
|
logger *phy_meas_logger;
|
||||||
|
} ue_gui;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
int socket;
|
||||||
|
int *is_on;
|
||||||
|
int nevents;
|
||||||
|
pthread_mutex_t lock;
|
||||||
|
ue_gui *e;
|
||||||
|
int ue; /* what UE is displayed in the UE specific views */
|
||||||
|
void *database;
|
||||||
|
} ue_data;
|
||||||
|
|
||||||
|
void is_on_changed(void *_d)
|
||||||
|
{
|
||||||
|
ue_data *d = _d;
|
||||||
|
char t;
|
||||||
|
|
||||||
|
if (pthread_mutex_lock(&d->lock)) abort();
|
||||||
|
|
||||||
|
if (d->socket == -1) goto no_connection;
|
||||||
|
|
||||||
|
t = 1;
|
||||||
|
if (socket_send(d->socket, &t, 1) == -1 ||
|
||||||
|
socket_send(d->socket, &d->nevents, sizeof(int)) == -1 ||
|
||||||
|
socket_send(d->socket, d->is_on, d->nevents * sizeof(int)) == -1)
|
||||||
|
goto connection_dies;
|
||||||
|
|
||||||
|
no_connection:
|
||||||
|
if (pthread_mutex_unlock(&d->lock)) abort();
|
||||||
|
return;
|
||||||
|
|
||||||
|
connection_dies:
|
||||||
|
close(d->socket);
|
||||||
|
d->socket = -1;
|
||||||
|
if (pthread_mutex_unlock(&d->lock)) abort();
|
||||||
|
}
|
||||||
|
|
||||||
|
void usage(void)
|
||||||
|
{
|
||||||
|
printf(
|
||||||
|
"options:\n"
|
||||||
|
" -d <database file> this option is mandatory\n"
|
||||||
|
" -on <GROUP or ID> turn log ON for given GROUP or ID\n"
|
||||||
|
" -off <GROUP or ID> turn log OFF for given GROUP or ID\n"
|
||||||
|
" -ON turn all logs ON\n"
|
||||||
|
" -OFF turn all logs OFF\n"
|
||||||
|
" note: you may pass several -on/-off/-ON/-OFF,\n"
|
||||||
|
" they will be processed in order\n"
|
||||||
|
" by default, all is off\n"
|
||||||
|
" -ip <host> connect to given IP address (default %s)\n"
|
||||||
|
" -p <port> connect to given port (default %d)\n"
|
||||||
|
" -debug-gui activate GUI debug logs\n",
|
||||||
|
DEFAULT_REMOTE_IP,
|
||||||
|
DEFAULT_REMOTE_PORT
|
||||||
|
);
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void *gui_thread(void *_g)
|
||||||
|
{
|
||||||
|
gui *g = _g;
|
||||||
|
gui_loop(g);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
static filter *ticktime_filter(void *database, char *event, int i, int ue)
|
||||||
|
{
|
||||||
|
/* filter is "harq_pid == i && UE_id == 0 && eNB_id == 0" */
|
||||||
|
return
|
||||||
|
filter_and(
|
||||||
|
filter_eq(filter_evarg(database, event, "harq_pid"), filter_int(i)),
|
||||||
|
filter_and(
|
||||||
|
filter_eq(filter_evarg(database, event, "UE_id"), filter_int(ue)),
|
||||||
|
filter_eq(filter_evarg(database, event, "eNB_ID"), filter_int(0))));
|
||||||
|
}
|
||||||
|
|
||||||
|
static void set_current_ue(gui *g, ue_data *e, int ue)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
char s[256];
|
||||||
|
|
||||||
|
sprintf(s, "[UE %d] ", ue);
|
||||||
|
label_set_text(g, e->e->current_ue_label, s);
|
||||||
|
sprintf(s, "PDSCH IQ [UE %d]", ue);
|
||||||
|
xy_plot_set_title(g, e->e->pdsch_iq_ue_xy_plot, s);
|
||||||
|
sprintf(s, "DL estimated channel [UE %d]", ue);
|
||||||
|
xy_plot_set_title(g, e->e->dl_estimate_ue_xy_plot, s);
|
||||||
|
sprintf(s, "PDCCH energy [UE %d]", ue);
|
||||||
|
xy_plot_set_title(g, e->e->pdcch_energy_ue_xy_plot, s);
|
||||||
|
sprintf(s, "PDSCH energy [UE %d]", ue);
|
||||||
|
xy_plot_set_title(g, e->e->pdsch_energy_ue_xy_plot, s);
|
||||||
|
sprintf(s, "PDCCH IQ [UE %d]", ue);
|
||||||
|
xy_plot_set_title(g, e->e->pdcch_iq_ue_xy_plot, s);
|
||||||
|
sprintf(s, "DL/UL HARQ (x8) [UE %d]", ue);
|
||||||
|
label_set_text(g, e->e->dl_ul_harq_ue_label, s);
|
||||||
|
sprintf(s, "DL MCS [UE %d]", ue);
|
||||||
|
xy_plot_set_title(g, e->e->dl_mcs_xy_plot, s);
|
||||||
|
sprintf(s, "UL MCS [UE %d]", ue);
|
||||||
|
xy_plot_set_title(g, e->e->ul_mcs_xy_plot, s);
|
||||||
|
sprintf(s, "PUSCH POWER [UE %d]", ue);
|
||||||
|
xy_plot_set_title(g, e->e->pusch_power_xy_plot, s);
|
||||||
|
sprintf(s, "PUCCH POWER [UE %d]", ue);
|
||||||
|
xy_plot_set_title(g, e->e->pucch_power_xy_plot, s);
|
||||||
|
sprintf(s, "PHY Measurements [UE %d]", ue);
|
||||||
|
xy_plot_set_title(g, e->e->phy_meas_xy_plot, s);
|
||||||
|
|
||||||
|
logger_set_filter(e->e->pdsch_iq_ue_logger,
|
||||||
|
filter_eq(
|
||||||
|
filter_evarg(e->database, "UE_PHY_PDSCH_IQ", "UE_ID"),
|
||||||
|
filter_int(ue)));
|
||||||
|
logger_set_filter(e->e->dl_estimate_ue_logger,
|
||||||
|
filter_eq(
|
||||||
|
filter_evarg(e->database, "UE_PHY_DL_CHANNEL_ESTIMATE", "UE_ID"),
|
||||||
|
filter_int(ue)));
|
||||||
|
logger_set_filter(e->e->pdcch_energy_logger,
|
||||||
|
filter_eq(
|
||||||
|
filter_evarg(e->database, "UE_PHY_PDCCH_ENERGY", "UE_ID"),
|
||||||
|
filter_int(ue)));
|
||||||
|
logger_set_filter(e->e->pdsch_energy_logger,
|
||||||
|
filter_eq(
|
||||||
|
filter_evarg(e->database, "UE_PHY_PDSCH_ENERGY", "UE_ID"),
|
||||||
|
filter_int(ue)));
|
||||||
|
logger_set_filter(e->e->phy_meas_logger,
|
||||||
|
filter_eq(
|
||||||
|
filter_evarg(e->database, "UE_PHY_MEAS", "UE_ID"),
|
||||||
|
filter_int(ue)));
|
||||||
|
/*logger_set_filter(e->pucch1_energy_ue_energy_logger,
|
||||||
|
filter_eq(
|
||||||
|
filter_evarg(e->database, "ENB_PHY_PUCCH_1_ENERGY", "UE_ID"),
|
||||||
|
filter_int(ue)));*/
|
||||||
|
/*logger_set_filter(e->e->pdcch_iq_ue_logger,
|
||||||
|
filter_eq(
|
||||||
|
filter_evarg(e->database, "UE_PHY_PDCCH_IQ", "UE_ID"),
|
||||||
|
filter_int(ue)));*/
|
||||||
|
for (i = 0; i < 8; i++) {
|
||||||
|
logger_set_filter(e->e->dl_dci_logger[i],
|
||||||
|
ticktime_filter(e->database, "UE_PHY_DLSCH_UE_DCI", i, ue));
|
||||||
|
logger_set_filter(e->e->dl_ack_logger[i],
|
||||||
|
ticktime_filter(e->database, "UE_PHY_DLSCH_UE_ACK", i, ue));
|
||||||
|
logger_set_filter(e->e->dl_nack_logger[i],
|
||||||
|
ticktime_filter(e->database, "UE_PHY_DLSCH_UE_NACK", i, ue));
|
||||||
|
logger_set_filter(e->e->ul_dci_logger[i],
|
||||||
|
ticktime_filter(e->database, "UE_PHY_ULSCH_UE_DCI", i, ue));
|
||||||
|
/*logger_set_filter(e->ul_dci_retransmission_logger[i],
|
||||||
|
ticktime_filter(e->database,
|
||||||
|
"ENB_PHY_ULSCH_UE_NO_DCI_RETRANSMISSION", i, ue));*/
|
||||||
|
logger_set_filter(e->e->ul_ack_logger[i],
|
||||||
|
ticktime_filter(e->database, "UE_PHY_ULSCH_UE_ACK", i, ue));
|
||||||
|
logger_set_filter(e->e->ul_nack_logger[i],
|
||||||
|
ticktime_filter(e->database, "UE_PHY_ULSCH_UE_NACK", i, ue));
|
||||||
|
}
|
||||||
|
logger_set_filter(e->e->dl_mcs_logger,
|
||||||
|
filter_eq(
|
||||||
|
filter_evarg(e->database, "UE_PHY_DLSCH_UE_DCI", "UE_id"),
|
||||||
|
filter_int(ue)));
|
||||||
|
logger_set_filter(e->e->ul_mcs_logger,
|
||||||
|
filter_eq(
|
||||||
|
filter_evarg(e->database, "UE_PHY_ULSCH_UE_DCI", "UE_id"),
|
||||||
|
filter_int(ue)));
|
||||||
|
logger_set_filter(e->e->pusch_power_logger,
|
||||||
|
filter_eq(
|
||||||
|
filter_evarg(e->database, "UE_PHY_PUSCH_TX_POWER", "UE_id"),
|
||||||
|
filter_int(ue)));
|
||||||
|
logger_set_filter(e->e->pusch_ampl_logger,
|
||||||
|
filter_eq(
|
||||||
|
filter_evarg(e->database, "UE_PHY_PUSCH_TX_POWER", "UE_id"),
|
||||||
|
filter_int(ue)));
|
||||||
|
logger_set_filter(e->e->pucch_power_logger,
|
||||||
|
filter_eq(
|
||||||
|
filter_evarg(e->database, "UE_PHY_PUCCH_TX_POWER", "UE_id"),
|
||||||
|
filter_int(ue)));
|
||||||
|
logger_set_filter(e->e->pucch_ampl_logger,
|
||||||
|
filter_eq(
|
||||||
|
filter_evarg(e->database, "UE_PHY_PUCCH_TX_POWER", "UE_id"),
|
||||||
|
filter_int(ue)));
|
||||||
|
}
|
||||||
|
|
||||||
|
static void click(void *private, gui *g,
|
||||||
|
char *notification, widget *w, void *notification_data)
|
||||||
|
{
|
||||||
|
int *d = notification_data;
|
||||||
|
int button = d[0];
|
||||||
|
ue_data *ed = private;
|
||||||
|
ue_gui *e = ed->e;
|
||||||
|
int ue = ed->ue;
|
||||||
|
|
||||||
|
if (button != 1) return;
|
||||||
|
if (w == e->prev_ue_button) { ue--; if (ue < 0) ue = 0; }
|
||||||
|
if (w == e->next_ue_button) ue++;
|
||||||
|
|
||||||
|
if (pthread_mutex_lock(&ed->lock)) abort();
|
||||||
|
if (ue != ed->ue) {
|
||||||
|
set_current_ue(g, ed, ue);
|
||||||
|
ed->ue = ue;
|
||||||
|
}
|
||||||
|
if (pthread_mutex_unlock(&ed->lock)) abort();
|
||||||
|
}
|
||||||
|
|
||||||
|
static void ue_main_gui(ue_gui *e, gui *g, event_handler *h, void *database,
|
||||||
|
ue_data *ed)
|
||||||
|
{
|
||||||
|
widget *main_window;
|
||||||
|
widget *top_container;
|
||||||
|
widget *line, *col;
|
||||||
|
widget *logo;
|
||||||
|
widget *input_signal_plot;
|
||||||
|
logger *input_signal_log;
|
||||||
|
view *input_signal_view;
|
||||||
|
widget *timeline_plot;
|
||||||
|
logger *timelog;
|
||||||
|
view *timeview;
|
||||||
|
view *subview;
|
||||||
|
widget *text;
|
||||||
|
view *textview;
|
||||||
|
int i;
|
||||||
|
widget *w, *w2;
|
||||||
|
view *v;
|
||||||
|
logger *l;
|
||||||
|
|
||||||
|
main_window = new_toplevel_window(g, 1200, 900, "eNB tracer");
|
||||||
|
top_container = new_container(g, VERTICAL);
|
||||||
|
widget_add_child(g, main_window, top_container, -1);
|
||||||
|
|
||||||
|
line = new_container(g, HORIZONTAL);
|
||||||
|
widget_add_child(g, top_container, line, -1);
|
||||||
|
logo = new_image(g, openair_logo_png, openair_logo_png_len);
|
||||||
|
|
||||||
|
/* logo + prev/next UE buttons */
|
||||||
|
col = new_container(g, VERTICAL);
|
||||||
|
widget_add_child(g, col, logo, -1);
|
||||||
|
w = new_container(g, HORIZONTAL);
|
||||||
|
widget_add_child(g, col, w, -1);
|
||||||
|
w2 = new_label(g, "");
|
||||||
|
widget_add_child(g, w, w2, -1);
|
||||||
|
e->current_ue_label = w2;
|
||||||
|
/* TODO: use button widget, not label widget */
|
||||||
|
w2 = new_label(g, " [prev UE] ");
|
||||||
|
widget_add_child(g, w, w2, -1);
|
||||||
|
label_set_clickable(g, w2, 1);
|
||||||
|
e->prev_ue_button = w2;
|
||||||
|
w2 = new_label(g, " [next UE] ");
|
||||||
|
widget_add_child(g, w, w2, -1);
|
||||||
|
label_set_clickable(g, w2, 1);
|
||||||
|
e->next_ue_button = w2;
|
||||||
|
widget_add_child(g, line, col, -1);
|
||||||
|
|
||||||
|
input_signal_plot = new_xy_plot(g, 256, 55, "input signal", 20);
|
||||||
|
widget_add_child(g, line, input_signal_plot, -1);
|
||||||
|
xy_plot_set_range(g, input_signal_plot, 0, 7680*10, 20, 70);
|
||||||
|
input_signal_log = new_framelog(h, database,
|
||||||
|
"UE_PHY_INPUT_SIGNAL", "subframe", "rxdata");
|
||||||
|
/* a skip value of 10 means to process 1 frame over 10, that is
|
||||||
|
* more or less 10 frames per second
|
||||||
|
*/
|
||||||
|
framelog_set_skip(input_signal_log, 10);
|
||||||
|
input_signal_view = new_view_xy(7680*10, 10,
|
||||||
|
g, input_signal_plot, new_color(g, "#0c0c72"), XY_LOOP_MODE);
|
||||||
|
logger_add_view(input_signal_log, input_signal_view);
|
||||||
|
|
||||||
|
/* UE x PDSCH IQ data */
|
||||||
|
w = new_xy_plot(g, 55, 55, "", 50);
|
||||||
|
e->pdsch_iq_ue_xy_plot = w;
|
||||||
|
widget_add_child(g, line, w, -1);
|
||||||
|
xy_plot_set_range(g, w, -500, 500, -500, 500);
|
||||||
|
l = new_iqlog(h, database, "UE_PHY_PDSCH_IQ", "nb_rb",
|
||||||
|
"N_RB_UL", "symbols_per_tti", "pusch_comp");
|
||||||
|
v = new_view_xy(100*12*14,10,g,w,new_color(g,"#000"),XY_FORCED_MODE);
|
||||||
|
logger_add_view(l, v);
|
||||||
|
e->pdsch_iq_ue_logger = l;
|
||||||
|
|
||||||
|
/* UE x estimated DL channel */
|
||||||
|
w = new_xy_plot(g, 280, 55, "", 50);
|
||||||
|
e->dl_estimate_ue_xy_plot = w;
|
||||||
|
widget_add_child(g, line, w, -1);
|
||||||
|
xy_plot_set_range(g, w, 0, 512*10, -10, 80);
|
||||||
|
l = new_framelog(h, database,
|
||||||
|
"UE_PHY_DL_CHANNEL_ESTIMATE", "subframe", "chest_t");
|
||||||
|
//framelog_set_skip(input_signal_log, 10);
|
||||||
|
framelog_set_update_only_at_sf9(l, 0);
|
||||||
|
v = new_view_xy(512*10, 10, g, w, new_color(g, "#0c0c72"), XY_LOOP_MODE);
|
||||||
|
logger_add_view(l, v);
|
||||||
|
e->dl_estimate_ue_logger = l;
|
||||||
|
|
||||||
|
/* PHY Meas */
|
||||||
|
w = new_xy_plot(g, 128, 55, "", 50);
|
||||||
|
e->phy_meas_xy_plot = w;
|
||||||
|
widget_add_child(g, line, w, -1);
|
||||||
|
xy_plot_set_range(g, w, 0, 1024*10, -130, 35);
|
||||||
|
/*l = new_ticked_ttilog(h, database,"UE_PHY_DL_TICK", "frame", "subframe","UE_PHY_MEAS", "rssi", 0, -1);
|
||||||
|
v = new_view_tti(10, g, w, new_color(g, "#720c0c"));
|
||||||
|
logger_add_view(l, v);
|
||||||
|
e->phy_meas_logger = l;*/
|
||||||
|
l = new_ticked_ttilog(h, database,"UE_PHY_DL_TICK", "frame", "subframe","UE_PHY_MEAS", "rsrp", 0, -1);
|
||||||
|
v = new_view_tti(10, g, w, new_color(g, "#0c0c72"));
|
||||||
|
logger_add_view(l, v);
|
||||||
|
e->phy_meas_logger = l;
|
||||||
|
l = new_ticked_ttilog(h, database,"UE_PHY_DL_TICK", "frame", "subframe","UE_PHY_MEAS", "snr", 0, -1);
|
||||||
|
v = new_view_tti(10, g, w, new_color(g, "#0c720c"));
|
||||||
|
logger_add_view(l, v);
|
||||||
|
e->phy_meas_logger = l;
|
||||||
|
|
||||||
|
/* UE x PDSCH energy */
|
||||||
|
w = new_xy_plot(g, 128, 55, "", 50);
|
||||||
|
e->pdsch_energy_ue_xy_plot = w;
|
||||||
|
widget_add_child(g, line, w, -1);
|
||||||
|
xy_plot_set_range(g, w, 0, 1024*10, -10, 80);
|
||||||
|
l = new_ttilog(h, database,
|
||||||
|
"UE_PHY_PDSCH_ENERGY", "frame", "subframe", "pdsch_ch_level00", 1);
|
||||||
|
v = new_view_tti(10, g, w, new_color(g, "#ff0000"));
|
||||||
|
logger_add_view(l, v);
|
||||||
|
e->pdsch_energy_logger = l;
|
||||||
|
l = new_ttilog(h, database,
|
||||||
|
"UE_PHY_PDSCH_ENERGY", "frame", "subframe", "pdsch_ch_level01", 1);
|
||||||
|
v = new_view_tti(10, g, w, new_color(g, "#00ff00"));
|
||||||
|
logger_add_view(l, v);
|
||||||
|
e->pdsch_energy_logger = l;
|
||||||
|
l = new_ttilog(h, database,
|
||||||
|
"UE_PHY_PDSCH_ENERGY", "frame", "subframe", "pdsch_ch_level10", 1);
|
||||||
|
v = new_view_tti(10, g, w, new_color(g, "#0f0f0f"));
|
||||||
|
logger_add_view(l, v);
|
||||||
|
e->pdsch_energy_logger = l;
|
||||||
|
l = new_ttilog(h, database,
|
||||||
|
"UE_PHY_PDSCH_ENERGY", "frame", "subframe", "pdsch_ch_level11", 1);
|
||||||
|
v = new_view_tti(10, g, w, new_color(g, "#0000ff"));
|
||||||
|
logger_add_view(l, v);
|
||||||
|
e->pdsch_energy_logger = l;
|
||||||
|
|
||||||
|
/* UE x PDCCH energy */
|
||||||
|
w = new_xy_plot(g, 128, 55, "", 50);
|
||||||
|
e->pdcch_energy_ue_xy_plot = w;
|
||||||
|
widget_add_child(g, line, w, -1);
|
||||||
|
xy_plot_set_range(g, w, 0, 1024*10, -10, 80);
|
||||||
|
l = new_ttilog(h, database,
|
||||||
|
"UE_PHY_PDCCH_ENERGY", "frame", "subframe", "pdcch_ch_level00", 1);
|
||||||
|
v = new_view_tti(10, g, w, new_color(g, "#ff0000"));
|
||||||
|
logger_add_view(l, v);
|
||||||
|
e->pdcch_energy_logger = l;
|
||||||
|
l = new_ttilog(h, database,
|
||||||
|
"UE_PHY_PDCCH_ENERGY", "frame", "subframe", "pdcch_ch_level01", 1);
|
||||||
|
v = new_view_tti(10, g, w, new_color(g, "#00ff00"));
|
||||||
|
logger_add_view(l, v);
|
||||||
|
e->pdcch_energy_logger = l;
|
||||||
|
l = new_ttilog(h, database,
|
||||||
|
"UE_PHY_PDCCH_ENERGY", "frame", "subframe", "pdcch_ch_level10", 1);
|
||||||
|
v = new_view_tti(10, g, w, new_color(g, "#0f0f0f"));
|
||||||
|
logger_add_view(l, v);
|
||||||
|
e->pdcch_energy_logger = l;
|
||||||
|
l = new_ttilog(h, database,
|
||||||
|
"UE_PHY_PDCCH_ENERGY", "frame", "subframe", "pdcch_ch_level11", 1);
|
||||||
|
v = new_view_tti(10, g, w, new_color(g, "#0000ff"));
|
||||||
|
logger_add_view(l, v);
|
||||||
|
e->pdcch_energy_logger = l;
|
||||||
|
|
||||||
|
/* UE x PDCCH IQ data */
|
||||||
|
w = new_xy_plot(g, 55, 55, "", 50);
|
||||||
|
e->pdcch_iq_ue_xy_plot = w;
|
||||||
|
widget_add_child(g, line, w, -1);
|
||||||
|
xy_plot_set_range(g, w, -100, 100, -100, 100);
|
||||||
|
l = new_iqlog(h, database, "UE_PHY_PDCCH_IQ", "nb_rb",
|
||||||
|
"NB_RB_DL", "symbols_per_tti", "rxdataF_comp");
|
||||||
|
v = new_view_xy(100*12*14,10,g,w,new_color(g,"#000"),XY_FORCED_MODE);
|
||||||
|
logger_add_view(l, v);
|
||||||
|
e->pdcch_iq_ue_logger = l;
|
||||||
|
|
||||||
|
/* UE x PDCCH IQ data */
|
||||||
|
/*w = new_xy_plot(g, 55, 55, "", 50);
|
||||||
|
e->pdcch_iq_ue_xy_plot = w;
|
||||||
|
widget_add_child(g, line, w, -1);
|
||||||
|
xy_plot_set_range(g, w, -2000, 2000, -2000, 2000);
|
||||||
|
l = new_iqdotlog(h, database, "UE_PHY_PDCCH_IQ", "I", "Q");
|
||||||
|
v = new_view_xy(500, 10, g, w, new_color(g,"#000"), XY_LOOP_MODE);
|
||||||
|
logger_add_view(l, v);
|
||||||
|
e->pdcch_iq_ue_logger = l;*/
|
||||||
|
|
||||||
|
/* UE x DL mcs */
|
||||||
|
line = new_container(g, HORIZONTAL);
|
||||||
|
widget_add_child(g, top_container, line, -1);
|
||||||
|
w = new_xy_plot(g, 128, 55, "", 20);
|
||||||
|
xy_plot_set_range(g, w, 0, 1024*10, -2, 30);
|
||||||
|
e->dl_mcs_xy_plot = w;
|
||||||
|
widget_add_child(g, line, w, -1);
|
||||||
|
l = new_ticked_ttilog(h, database, "UE_PHY_DL_TICK", "frame", "subframe",
|
||||||
|
"UE_PHY_DLSCH_UE_DCI", "mcs", 0, -1);
|
||||||
|
v = new_view_tti(10, g, w, new_color(g, "#0c0c72"));
|
||||||
|
logger_add_view(l, v);
|
||||||
|
e->dl_mcs_logger = l;
|
||||||
|
|
||||||
|
/* UE x UL mcs */
|
||||||
|
w = new_xy_plot(g, 128, 55, "", 20);
|
||||||
|
xy_plot_set_range(g, w, 0, 1024*10, -2, 30);
|
||||||
|
e->ul_mcs_xy_plot = w;
|
||||||
|
widget_add_child(g, line, w, -1);
|
||||||
|
l = new_ticked_ttilog(h, database, "UE_PHY_UL_TICK", "frame", "subframe",
|
||||||
|
"UE_PHY_ULSCH_UE_DCI", "mcs", 0, -1);
|
||||||
|
v = new_view_tti(10, g, w, new_color(g, "#0c0c72"));
|
||||||
|
logger_add_view(l, v);
|
||||||
|
e->ul_mcs_logger = l;
|
||||||
|
|
||||||
|
/* UE x PUSCH TX Power */
|
||||||
|
// line = new_container(g, HORIZONTAL);
|
||||||
|
// widget_add_child(g, top_container, line, -1);
|
||||||
|
w = new_xy_plot(g, 128, 55, "", 20);
|
||||||
|
e->pusch_power_xy_plot = w;
|
||||||
|
widget_add_child(g, line, w, -1);
|
||||||
|
xy_plot_set_range(g, w, 0, 1024*10, -30, 50);
|
||||||
|
l = new_ttilog(h, database,
|
||||||
|
"UE_PHY_PUSCH_TX_POWER", "frame", "subframe", "p0_pusch", 0);
|
||||||
|
v = new_view_tti(10, g, w, new_color(g, "#0c0c72"));
|
||||||
|
logger_add_view(l, v);
|
||||||
|
e->pusch_power_logger = l;
|
||||||
|
l = new_ttilog(h, database,
|
||||||
|
"UE_PHY_PUSCH_TX_POWER", "frame", "subframe", "ampl", 1);
|
||||||
|
v = new_view_tti(10, g, w, new_color(g, "#720c0c"));
|
||||||
|
logger_add_view(l, v);
|
||||||
|
e->pusch_ampl_logger = l;
|
||||||
|
|
||||||
|
/* UE x PUCCH TX Power */
|
||||||
|
// line = new_container(g, HORIZONTAL);
|
||||||
|
// widget_add_child(g, top_container, line, -1);
|
||||||
|
w = new_xy_plot(g, 128, 55, "", 20);
|
||||||
|
e->pucch_power_xy_plot = w;
|
||||||
|
widget_add_child(g, line, w, -1);
|
||||||
|
xy_plot_set_range(g, w, 0, 1024*10, -30, 50);
|
||||||
|
l = new_ttilog(h, database,
|
||||||
|
"UE_PHY_PUCCH_TX_POWER", "frame", "subframe", "p0_pucch", 0);
|
||||||
|
v = new_view_tti(10, g, w, new_color(g, "#0c0c72"));
|
||||||
|
logger_add_view(l, v);
|
||||||
|
e->pucch_power_logger = l;
|
||||||
|
l = new_ttilog(h, database,
|
||||||
|
"UE_PHY_PUCCH_TX_POWER", "frame", "subframe", "ampl", 1);
|
||||||
|
v = new_view_tti(10, g, w, new_color(g, "#720c0c"));
|
||||||
|
logger_add_view(l, v);
|
||||||
|
e->pucch_ampl_logger = l;
|
||||||
|
|
||||||
|
|
||||||
|
/* downlink/uplink UE DCIs */
|
||||||
|
widget_add_child(g, top_container,
|
||||||
|
new_label(g,"DL/UL TICK/DCI/ACK/NACK [all UEs]"), -1);
|
||||||
|
line = new_container(g, HORIZONTAL);
|
||||||
|
widget_add_child(g, top_container, line, -1);
|
||||||
|
timeline_plot = new_timeline(g, 512, 8, 5);
|
||||||
|
widget_add_child(g, line, timeline_plot, -1);
|
||||||
|
container_set_child_growable(g, line, timeline_plot, 1);
|
||||||
|
for (i = 0; i < 8; i++)
|
||||||
|
timeline_set_subline_background_color(g, timeline_plot, i,
|
||||||
|
new_color(g, i==0 || i==4 ? "#aaf" : "#eee"));
|
||||||
|
timeview = new_view_time(3600, 10, g, timeline_plot);
|
||||||
|
/* DL tick logging */
|
||||||
|
timelog = new_timelog(h, database, "UE_PHY_DL_TICK");
|
||||||
|
subview = new_subview_time(timeview, 0, new_color(g, "#77c"), 3600*1000);
|
||||||
|
logger_add_view(timelog, subview);
|
||||||
|
/* DL DCI logging */
|
||||||
|
timelog = new_timelog(h, database, "UE_PHY_DLSCH_UE_DCI");
|
||||||
|
subview = new_subview_time(timeview, 1, new_color(g, "#228"), 3600*1000);
|
||||||
|
logger_add_view(timelog, subview);
|
||||||
|
/* DL ACK */
|
||||||
|
timelog = new_timelog(h, database, "UE_PHY_DLSCH_UE_ACK");
|
||||||
|
subview = new_subview_time(timeview, 2, new_color(g, "#282"), 3600*1000);
|
||||||
|
logger_add_view(timelog, subview);
|
||||||
|
/* DL NACK */
|
||||||
|
timelog = new_timelog(h, database, "UE_PHY_DLSCH_UE_NACK");
|
||||||
|
subview = new_subview_time(timeview, 3, new_color(g, "#f22"), 3600*1000);
|
||||||
|
logger_add_view(timelog, subview);
|
||||||
|
|
||||||
|
/* UL tick logging */
|
||||||
|
timelog = new_timelog(h, database, "UE_PHY_UL_TICK");
|
||||||
|
subview = new_subview_time(timeview, 4, new_color(g, "#77c"), 3600*1000);
|
||||||
|
logger_add_view(timelog, subview);
|
||||||
|
/* UL DCI logging */
|
||||||
|
timelog = new_timelog(h, database, "UE_PHY_ULSCH_UE_DCI");
|
||||||
|
subview = new_subview_time(timeview, 5, new_color(g, "#228"), 3600*1000);
|
||||||
|
logger_add_view(timelog, subview);
|
||||||
|
/* UL retransmission without DCI logging */
|
||||||
|
//timelog = new_timelog(h,database,"ENB_PHY_ULSCH_UE_NO_DCI_RETRANSMISSION");
|
||||||
|
//subview = new_subview_time(timeview, 5, new_color(g, "#f22"), 3600*1000);
|
||||||
|
//logger_add_view(timelog, subview);
|
||||||
|
/* UL ACK */
|
||||||
|
timelog = new_timelog(h, database, "UE_PHY_ULSCH_UE_ACK");
|
||||||
|
subview = new_subview_time(timeview, 6, new_color(g, "#282"), 3600*1000);
|
||||||
|
logger_add_view(timelog, subview);
|
||||||
|
/* UL NACK */
|
||||||
|
timelog = new_timelog(h, database, "UE_PHY_ULSCH_UE_NACK");
|
||||||
|
subview = new_subview_time(timeview, 7, new_color(g, "#f22"), 3600*1000);
|
||||||
|
logger_add_view(timelog, subview);
|
||||||
|
|
||||||
|
/* harq processes' ticktime view */
|
||||||
|
e->dl_ul_harq_ue_label = new_label(g, "");
|
||||||
|
widget_add_child(g, top_container, e->dl_ul_harq_ue_label, -1);
|
||||||
|
line = new_container(g, HORIZONTAL);
|
||||||
|
widget_add_child(g, top_container, line, -1);
|
||||||
|
timeline_plot = new_timeline(g, 512, 2*8+2, 3);
|
||||||
|
widget_add_child(g, line, timeline_plot, -1);
|
||||||
|
container_set_child_growable(g, line, timeline_plot, 1);
|
||||||
|
for (i = 0; i < 2*8+2; i++)
|
||||||
|
timeline_set_subline_background_color(g, timeline_plot, i,
|
||||||
|
new_color(g, i==0 || i==9 ? "#ddd" : (i%9)&1 ? "#e6e6e6" : "#eee"));
|
||||||
|
timeview = new_view_ticktime(10, g, timeline_plot);
|
||||||
|
ticktime_set_tick(timeview,
|
||||||
|
new_ticklog(h, database, "UE_MASTER_TICK", "frame", "subframe"));
|
||||||
|
/* tick */
|
||||||
|
timelog = new_ticklog(h, database, "UE_MASTER_TICK", "frame", "subframe");
|
||||||
|
/* tick on DL view */
|
||||||
|
subview = new_subview_ticktime(timeview, 0, new_color(g,"#bbb"), 3600*1000);
|
||||||
|
logger_add_view(timelog, subview);
|
||||||
|
/* tick on UL view */
|
||||||
|
subview = new_subview_ticktime(timeview, 9, new_color(g,"#bbb"), 3600*1000);
|
||||||
|
logger_add_view(timelog, subview);
|
||||||
|
/* DL DCI */
|
||||||
|
for (i = 0; i < 8; i++) {
|
||||||
|
timelog = new_ticklog(h, database, "UE_PHY_DLSCH_UE_DCI",
|
||||||
|
"frame", "subframe");
|
||||||
|
subview = new_subview_ticktime(timeview, i+1,
|
||||||
|
new_color(g,"#55f"), 3600*1000);
|
||||||
|
logger_add_view(timelog, subview);
|
||||||
|
e->dl_dci_logger[i] = timelog;
|
||||||
|
}
|
||||||
|
/* DL ACK */
|
||||||
|
for (i = 0; i < 8; i++) {
|
||||||
|
timelog = new_ticklog(h, database, "UE_PHY_DLSCH_UE_ACK",
|
||||||
|
"frame", "subframe");
|
||||||
|
subview = new_subview_ticktime(timeview, i+1,
|
||||||
|
new_color(g,"#282"), 3600*1000);
|
||||||
|
logger_add_view(timelog, subview);
|
||||||
|
e->dl_ack_logger[i] = timelog;
|
||||||
|
}
|
||||||
|
/* DL NACK */
|
||||||
|
for (i = 0; i < 8; i++) {
|
||||||
|
timelog = new_ticklog(h, database, "UE_PHY_DLSCH_UE_NACK",
|
||||||
|
"frame", "subframe");
|
||||||
|
subview = new_subview_ticktime(timeview, i+1,
|
||||||
|
new_color(g,"#f22"), 3600*1000);
|
||||||
|
logger_add_view(timelog, subview);
|
||||||
|
e->dl_nack_logger[i] = timelog;
|
||||||
|
}
|
||||||
|
/* UL DCI/retransmission without DCI */
|
||||||
|
for (i = 0; i < 8; i++) {
|
||||||
|
/* first transmission */
|
||||||
|
timelog = new_ticklog(h, database, "UE_PHY_ULSCH_UE_DCI",
|
||||||
|
"frame", "subframe");
|
||||||
|
subview = new_subview_ticktime(timeview, i+9+1,
|
||||||
|
new_color(g,"#55f"), 3600*1000);
|
||||||
|
logger_add_view(timelog, subview);
|
||||||
|
e->ul_dci_logger[i] = timelog;
|
||||||
|
/* retransmission */
|
||||||
|
|
||||||
|
timelog = new_ticklog(h, database,
|
||||||
|
"ENB_PHY_ULSCH_UE_NO_DCI_RETRANSMISSION", "frame", "subframe");
|
||||||
|
subview = new_subview_ticktime(timeview, i+9+1,
|
||||||
|
new_color(g,"#99f"), 3600*1000);
|
||||||
|
logger_add_view(timelog, subview);
|
||||||
|
e->ul_dci_retransmission_logger[i] = timelog;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/* UL ACK */
|
||||||
|
for (i = 0; i < 8; i++) {
|
||||||
|
timelog = new_ticklog(h, database, "UE_PHY_ULSCH_UE_ACK",
|
||||||
|
"frame", "subframe");
|
||||||
|
subview = new_subview_ticktime(timeview, i+9+1,
|
||||||
|
new_color(g,"#282"), 3600*1000);
|
||||||
|
logger_add_view(timelog, subview);
|
||||||
|
e->ul_ack_logger[i] = timelog;
|
||||||
|
}
|
||||||
|
/* UL NACK */
|
||||||
|
for (i = 0; i < 8; i++) {
|
||||||
|
timelog = new_ticklog(h, database, "UE_PHY_ULSCH_UE_NACK",
|
||||||
|
"frame", "subframe");
|
||||||
|
subview = new_subview_ticktime(timeview, i+9+1,
|
||||||
|
new_color(g,"#f22"), 3600*1000);
|
||||||
|
logger_add_view(timelog, subview);
|
||||||
|
e->ul_nack_logger[i] = timelog;
|
||||||
|
}
|
||||||
|
|
||||||
|
#if 1
|
||||||
|
/* phy/mac/rlc/pdcp/rrc textlog */
|
||||||
|
line = new_container(g, HORIZONTAL);
|
||||||
|
widget_add_child(g, top_container, line, -1);
|
||||||
|
container_set_child_growable(g, top_container, line, 1);
|
||||||
|
|
||||||
|
/* phy */
|
||||||
|
col = new_container(g, VERTICAL);
|
||||||
|
widget_add_child(g, line, col, -1);
|
||||||
|
container_set_child_growable(g, line, col, 1);
|
||||||
|
widget_add_child(g, col, new_label(g, "PHY"), -1);
|
||||||
|
text = new_textlist(g, 100, 10, new_color(g, "#afa"));
|
||||||
|
widget_add_child(g, col, text, -1);
|
||||||
|
container_set_child_growable(g, col, text, 1);
|
||||||
|
textview = new_view_textlist(10000, 10, g, text);
|
||||||
|
e->phyview = textview;
|
||||||
|
|
||||||
|
/* mac */
|
||||||
|
col = new_container(g, VERTICAL);
|
||||||
|
widget_add_child(g, line, col, -1);
|
||||||
|
container_set_child_growable(g, line, col, 1);
|
||||||
|
widget_add_child(g, col, new_label(g, "MAC"), -1);
|
||||||
|
text = new_textlist(g, 100, 10, new_color(g, "#adf"));
|
||||||
|
widget_add_child(g, col, text, -1);
|
||||||
|
container_set_child_growable(g, col, text, 1);
|
||||||
|
textview = new_view_textlist(10000, 10, g, text);
|
||||||
|
e->macview = textview;
|
||||||
|
|
||||||
|
line = new_container(g, HORIZONTAL);
|
||||||
|
widget_add_child(g, top_container, line, -1);
|
||||||
|
container_set_child_growable(g, top_container, line, 1);
|
||||||
|
|
||||||
|
/* rlc */
|
||||||
|
col = new_container(g, VERTICAL);
|
||||||
|
widget_add_child(g, line, col, -1);
|
||||||
|
container_set_child_growable(g, line, col, 1);
|
||||||
|
widget_add_child(g, col, new_label(g, "RLC"), -1);
|
||||||
|
text = new_textlist(g, 100, 10, new_color(g, "#aff"));
|
||||||
|
widget_add_child(g, col, text, -1);
|
||||||
|
container_set_child_growable(g, col, text, 1);
|
||||||
|
textview = new_view_textlist(10000, 10, g, text);
|
||||||
|
e->rlcview = textview;
|
||||||
|
|
||||||
|
/* pdcp */
|
||||||
|
col = new_container(g, VERTICAL);
|
||||||
|
widget_add_child(g, line, col, -1);
|
||||||
|
container_set_child_growable(g, line, col, 1);
|
||||||
|
widget_add_child(g, col, new_label(g, "PDCP"), -1);
|
||||||
|
text = new_textlist(g, 100, 10, new_color(g, "#ed9"));
|
||||||
|
widget_add_child(g, col, text, -1);
|
||||||
|
container_set_child_growable(g, col, text, 1);
|
||||||
|
textview = new_view_textlist(10000, 10, g, text);
|
||||||
|
e->pdcpview = textview;
|
||||||
|
|
||||||
|
line = new_container(g, HORIZONTAL);
|
||||||
|
widget_add_child(g, top_container, line, -1);
|
||||||
|
container_set_child_growable(g, top_container, line, 1);
|
||||||
|
|
||||||
|
/* rrc */
|
||||||
|
col = new_container(g, VERTICAL);
|
||||||
|
widget_add_child(g, line, col, -1);
|
||||||
|
container_set_child_growable(g, line, col, 1);
|
||||||
|
widget_add_child(g, col, new_label(g, "RRC"), -1);
|
||||||
|
text = new_textlist(g, 100, 10, new_color(g, "#fdb"));
|
||||||
|
widget_add_child(g, col, text, -1);
|
||||||
|
container_set_child_growable(g, col, text, 1);
|
||||||
|
textview = new_view_textlist(10000, 10, g, text);
|
||||||
|
e->rrcview = textview;
|
||||||
|
|
||||||
|
/* legacy logs (LOG_I, LOG_D, ...) */
|
||||||
|
widget_add_child(g, top_container, new_label(g, "LEGACY"), -1);
|
||||||
|
text = new_textlist(g, 100, 10, new_color(g, "#eeb"));
|
||||||
|
widget_add_child(g, top_container, text, -1);
|
||||||
|
container_set_child_growable(g, top_container, text, 1);
|
||||||
|
e->legacy = new_view_textlist(10000, 10, g, text);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
set_current_ue(g, ed, 0);
|
||||||
|
register_notifier(g, "click", e->prev_ue_button, click, ed);
|
||||||
|
register_notifier(g, "click", e->next_ue_button, click, ed);
|
||||||
|
}
|
||||||
|
|
||||||
|
void view_add_log(view *v, char *log, event_handler *h, void *database,
|
||||||
|
int *is_on)
|
||||||
|
{
|
||||||
|
logger *textlog;
|
||||||
|
char *name, *desc;
|
||||||
|
|
||||||
|
database_get_generic_description(database,
|
||||||
|
event_id_from_name(database, log), &name, &desc);
|
||||||
|
textlog = new_textlog(h, database, name, desc);
|
||||||
|
logger_add_view(textlog, v);
|
||||||
|
free(name);
|
||||||
|
free(desc);
|
||||||
|
|
||||||
|
on_off(database, log, is_on, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
int main(int n, char **v)
|
||||||
|
{
|
||||||
|
extern int volatile gui_logd;
|
||||||
|
char *database_filename = NULL;
|
||||||
|
void *database;
|
||||||
|
char *ip = DEFAULT_REMOTE_IP;
|
||||||
|
int port = DEFAULT_REMOTE_PORT;
|
||||||
|
char **on_off_name;
|
||||||
|
int *on_off_action;
|
||||||
|
int on_off_n = 0;
|
||||||
|
int *is_on;
|
||||||
|
int number_of_events;
|
||||||
|
int i;
|
||||||
|
event_handler *h;
|
||||||
|
gui *g;
|
||||||
|
ue_gui eg;
|
||||||
|
ue_data ue_data;
|
||||||
|
|
||||||
|
/* write on a socket fails if the other end is closed and we get SIGPIPE */
|
||||||
|
if (signal(SIGPIPE, SIG_IGN) == SIG_ERR) abort();
|
||||||
|
|
||||||
|
on_off_name = malloc(n * sizeof(char *)); if (on_off_name == NULL) abort();
|
||||||
|
on_off_action = malloc(n * sizeof(int)); if (on_off_action == NULL) abort();
|
||||||
|
|
||||||
|
for (i = 1; i < n; i++) {
|
||||||
|
if (!strcmp(v[i], "-h") || !strcmp(v[i], "--help")) usage();
|
||||||
|
if (!strcmp(v[i], "-d"))
|
||||||
|
{ if (i > n-2) usage(); database_filename = v[++i]; continue; }
|
||||||
|
if (!strcmp(v[i], "-ip")) { if (i > n-2) usage(); ip = v[++i]; continue; }
|
||||||
|
if (!strcmp(v[i], "-p"))
|
||||||
|
{ if (i > n-2) usage(); port = atoi(v[++i]); continue; }
|
||||||
|
if (!strcmp(v[i], "-on")) { if (i > n-2) usage();
|
||||||
|
on_off_name[on_off_n]=v[++i]; on_off_action[on_off_n++]=1; continue; }
|
||||||
|
if (!strcmp(v[i], "-off")) { if (i > n-2) usage();
|
||||||
|
on_off_name[on_off_n]=v[++i]; on_off_action[on_off_n++]=0; continue; }
|
||||||
|
if (!strcmp(v[i], "-ON"))
|
||||||
|
{ on_off_name[on_off_n]=NULL; on_off_action[on_off_n++]=1; continue; }
|
||||||
|
if (!strcmp(v[i], "-OFF"))
|
||||||
|
{ on_off_name[on_off_n]=NULL; on_off_action[on_off_n++]=0; continue; }
|
||||||
|
if (!strcmp(v[i], "-debug-gui")) { gui_logd = 1; continue; }
|
||||||
|
usage();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (database_filename == NULL) {
|
||||||
|
printf("ERROR: provide a database file (-d)\n");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
database = parse_database(database_filename);
|
||||||
|
|
||||||
|
load_config_file(database_filename);
|
||||||
|
|
||||||
|
number_of_events = number_of_ids(database);
|
||||||
|
is_on = calloc(number_of_events, sizeof(int));
|
||||||
|
if (is_on == NULL) abort();
|
||||||
|
|
||||||
|
h = new_handler(database);
|
||||||
|
|
||||||
|
g = gui_init();
|
||||||
|
new_thread(gui_thread, g);
|
||||||
|
|
||||||
|
ue_data.ue = 0;
|
||||||
|
ue_data.e = ⪚
|
||||||
|
ue_data.database = database;
|
||||||
|
|
||||||
|
ue_main_gui(&eg, g, h, database, &ue_data);
|
||||||
|
|
||||||
|
for (i = 0; i < number_of_events; i++) {
|
||||||
|
logger *textlog;
|
||||||
|
char *name, *desc;
|
||||||
|
database_get_generic_description(database, i, &name, &desc);
|
||||||
|
if (!strncmp(name, "LEGACY_", 7)) {
|
||||||
|
textlog = new_textlog(h, database, name, desc);
|
||||||
|
logger_add_view(textlog, eg.legacy);
|
||||||
|
}
|
||||||
|
free(name);
|
||||||
|
free(desc);
|
||||||
|
}
|
||||||
|
|
||||||
|
on_off(database, "UE_MASTER_TICK", is_on, 1);
|
||||||
|
on_off(database, "UE_PHY_UL_TICK", is_on, 1);
|
||||||
|
on_off(database, "UE_PHY_DL_TICK", is_on, 1);
|
||||||
|
on_off(database, "UE_PHY_DLSCH_UE_DCI", is_on, 1);
|
||||||
|
on_off(database, "UE_PHY_DLSCH_UE_ACK", is_on, 1);
|
||||||
|
on_off(database, "UE_PHY_DLSCH_UE_NACK", is_on, 1);
|
||||||
|
on_off(database, "UE_PHY_ULSCH_UE_DCI", is_on, 1);
|
||||||
|
on_off(database, "UE_PHY_ULSCH_UE_ACK", is_on, 1);
|
||||||
|
on_off(database, "UE_PHY_ULSCH_UE_NACK", is_on, 1);
|
||||||
|
on_off(database, "UE_PHY_INPUT_SIGNAL", is_on, 1);
|
||||||
|
on_off(database, "UE_PHY_DL_CHANNEL_ESTIMATE", is_on, 1);
|
||||||
|
on_off(database, "UE_PHY_PDCCH_IQ", is_on, 1);
|
||||||
|
on_off(database, "UE_PHY_PDCCH_ENERGY", is_on, 1);
|
||||||
|
on_off(database, "UE_PHY_PDSCH_IQ", is_on, 1);
|
||||||
|
on_off(database, "UE_PHY_PDSCH_ENERGY", is_on, 1);
|
||||||
|
on_off(database, "UE_PHY_PUSCH_TX_POWER", is_on, 1);
|
||||||
|
on_off(database, "UE_PHY_PUCCH_TX_POWER", is_on, 1);
|
||||||
|
on_off(database, "UE_PHY_MEAS", is_on, 1);
|
||||||
|
|
||||||
|
on_off(database, "LEGACY_GROUP_INFO", is_on, 1);
|
||||||
|
on_off(database, "LEGACY_GROUP_ERROR", is_on, 1);
|
||||||
|
on_off(database, "LEGACY_GROUP_WARNING", is_on, 1);
|
||||||
|
|
||||||
|
view_add_log(eg.phyview, "UE_PHY_UL_TICK", h, database, is_on);
|
||||||
|
view_add_log(eg.phyview, "UE_PHY_DL_TICK", h, database, is_on);
|
||||||
|
view_add_log(eg.phyview, "UE_PHY_DLSCH_UE_DCI", h, database, is_on);
|
||||||
|
view_add_log(eg.phyview, "UE_PHY_DLSCH_UE_ACK", h, database, is_on);
|
||||||
|
view_add_log(eg.phyview, "UE_PHY_DLSCH_UE_NACK",h, database, is_on);
|
||||||
|
view_add_log(eg.phyview, "UE_PHY_ULSCH_UE_DCI", h, database, is_on);
|
||||||
|
view_add_log(eg.phyview, "UE_PHY_ULSCH_UE_ACK", h, database, is_on);
|
||||||
|
view_add_log(eg.phyview, "UE_PHY_ULSCH_UE_NACK", h, database, is_on);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* deactivate those two by default, they are a bit heavy */
|
||||||
|
//on_off(database, "ENB_MAC_UE_UL_SDU_WITH_DATA", is_on, 0);
|
||||||
|
//on_off(database, "ENB_MAC_UE_UL_PDU_WITH_DATA", is_on, 0);
|
||||||
|
|
||||||
|
for (i = 0; i < on_off_n; i++)
|
||||||
|
on_off(database, on_off_name[i], is_on, on_off_action[i]);
|
||||||
|
|
||||||
|
ue_data.socket = -1;
|
||||||
|
ue_data.is_on = is_on;
|
||||||
|
ue_data.nevents = number_of_events;
|
||||||
|
if (pthread_mutex_init(&ue_data.lock, NULL)) abort();
|
||||||
|
setup_event_selector(g, database, is_on, is_on_changed, &ue_data);
|
||||||
|
|
||||||
|
restart:
|
||||||
|
clear_remote_config();
|
||||||
|
ue_data.socket = connect_to(ip, port);
|
||||||
|
|
||||||
|
/* send the first message - activate selected traces */
|
||||||
|
is_on_changed(&ue_data);
|
||||||
|
|
||||||
|
/* read messages */
|
||||||
|
while (1) {
|
||||||
|
char v[T_BUFFER_MAX];
|
||||||
|
event e;
|
||||||
|
e = get_event(ue_data.socket, v, database);
|
||||||
|
if (e.type == -1) goto restart;
|
||||||
|
if (pthread_mutex_lock(&ue_data.lock)) abort();
|
||||||
|
handle_event(h, e);
|
||||||
|
if (pthread_mutex_unlock(&ue_data.lock)) abort();
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
@@ -81,13 +81,13 @@
|
|||||||
#define ITTI_DEBUG_ISSUES (1<<5)
|
#define ITTI_DEBUG_ISSUES (1<<5)
|
||||||
#define ITTI_DEBUG_MP_STATISTICS (1<<6)
|
#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 */
|
/* Don't flush if using RTAI */
|
||||||
#ifdef RTAI
|
#ifdef RTAI
|
||||||
# define ITTI_DEBUG(m, x, args...) do { if ((m) & itti_debug) rt_log_debug (x, ##args); } while(0);
|
# define ITTI_DEBUG(m, x, args...) do { if ((m) & itti_debug) rt_log_debug (x, ##args); } while(0);
|
||||||
#else
|
#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
|
#endif
|
||||||
#define ITTI_ERROR(x, args...) do { fprintf(stdout, "[ITTI][E]"x, ##args); fflush (stdout); } while(0);
|
#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_DEFAULT (UINT16_MAX - 1)
|
||||||
#define INSTANCE_ALL (UINT16_MAX)
|
#define INSTANCE_ALL (UINT16_MAX)
|
||||||
|
|
||||||
typedef uint16_t instance_t;
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -256,6 +256,7 @@ int test_logmap8(LTE_eNB_DLSCH_t *dlsch_eNB,
|
|||||||
&PHY_vars_UE->lte_frame_parms,
|
&PHY_vars_UE->lte_frame_parms,
|
||||||
PHY_vars_UE->dlsch_ue[0][0],
|
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],
|
PHY_vars_UE->dlsch_ue[0][0]->harq_processes[PHY_vars_UE->dlsch_ue[0][0]->current_harq_pid],
|
||||||
|
frame,
|
||||||
subframe,
|
subframe,
|
||||||
PHY_vars_UE->dlsch_ue[0][0]->current_harq_pid,
|
PHY_vars_UE->dlsch_ue[0][0]->current_harq_pid,
|
||||||
num_pdcch_symbols,1);
|
num_pdcch_symbols,1);
|
||||||
|
|||||||
+117
-75
@@ -29,7 +29,7 @@
|
|||||||
#include "LAYER2/MAC/extern.h"
|
#include "LAYER2/MAC/extern.h"
|
||||||
#include "MBSFN-SubframeConfigList.h"
|
#include "MBSFN-SubframeConfigList.h"
|
||||||
#include "UTIL/LOG/vcd_signal_dumper.h"
|
#include "UTIL/LOG/vcd_signal_dumper.h"
|
||||||
//#define DEBUG_PHY
|
#define DEBUG_PHY
|
||||||
#include "assertions.h"
|
#include "assertions.h"
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
@@ -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) {
|
if (mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.present == MBSFN_SubframeConfig__subframeAllocation_PR_oneFrame) {
|
||||||
fp->MBSFN_config[i].fourFrames_flag = 0;
|
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
|
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);
|
fp->MBSFN_config[i].mbsfn_SubframeConfig);
|
||||||
} else if (mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.present == MBSFN_SubframeConfig__subframeAllocation_PR_fourFrames) { // 24-bit subframe configuration
|
} 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;
|
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[1]<<8)|
|
||||||
(mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.choice.oneFrame.buf[2]<<16);
|
(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);
|
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) {
|
if (mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.present == MBSFN_SubframeConfig__subframeAllocation_PR_oneFrame) {
|
||||||
fp->MBSFN_config[i].fourFrames_flag = 0;
|
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
|
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);
|
fp->MBSFN_config[i].mbsfn_SubframeConfig);
|
||||||
} else if (mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.present == MBSFN_SubframeConfig__subframeAllocation_PR_fourFrames) { // 24-bit subframe configuration
|
} 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;
|
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[1]<<8)|
|
||||||
(mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.choice.oneFrame.buf[2]<<16);
|
(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);
|
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;
|
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) {
|
if (mbsfn_Area_idx == 0) {
|
||||||
fp->Nid_cell_mbsfn = (uint16_t)mbsfn_AreaId_r9;
|
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;
|
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) {
|
if (mbsfn_Area_idx == 0) {
|
||||||
fp->Nid_cell_mbsfn = (uint16_t)mbsfn_AreaId_r9;
|
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];
|
physicalConfigDedicated = eNB->physicalConfigDedicated[UE_id];
|
||||||
|
|
||||||
if (physicalConfigDedicated != NULL) {
|
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");
|
LOG_D(PHY,"------------------------------------------------------------------------\n");
|
||||||
|
|
||||||
if (physicalConfigDedicated->pdsch_ConfigDedicated) {
|
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);
|
int8_t UE_id = find_ue(rnti,eNB);
|
||||||
|
|
||||||
if (UE_id == -1) {
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -684,6 +684,7 @@ void phy_config_dedicated_eNB(uint8_t Mod_id,
|
|||||||
break;
|
break;
|
||||||
case AntennaInfoDedicated__transmissionMode_tm7:
|
case AntennaInfoDedicated__transmissionMode_tm7:
|
||||||
lte_gold_ue_spec_port5(eNB->lte_gold_uespec_port5_table[0],eNB->frame_parms.Nid_cell,rnti);
|
lte_gold_ue_spec_port5(eNB->lte_gold_uespec_port5_table[0],eNB->frame_parms.Nid_cell,rnti);
|
||||||
|
eNB->do_precoding = 1;
|
||||||
eNB->transmission_mode[UE_id] = 7;
|
eNB->transmission_mode[UE_id] = 7;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -725,13 +726,13 @@ void phy_config_dedicated_scell_eNB(uint8_t Mod_id,
|
|||||||
|
|
||||||
if ((dl_CarrierFreq_r10>=36000) && (dl_CarrierFreq_r10<=36199)) {
|
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
|
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)) {
|
} 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
|
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
|
// 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 {
|
} 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) {
|
if (physicalConfigDedicatedSCell_r10) {
|
||||||
@@ -1062,7 +1063,8 @@ int phy_init_lte_ue(PHY_VARS_UE *ue,
|
|||||||
// create shortcuts
|
// create shortcuts
|
||||||
LTE_DL_FRAME_PARMS* const fp = &ue->frame_parms;
|
LTE_DL_FRAME_PARMS* const fp = &ue->frame_parms;
|
||||||
LTE_UE_COMMON* const common_vars = &ue->common_vars;
|
LTE_UE_COMMON* const common_vars = &ue->common_vars;
|
||||||
LTE_UE_PDSCH** const pdsch_vars = ue->pdsch_vars;
|
LTE_UE_PDSCH** const pdsch_vars_th0 = ue->pdsch_vars[0];
|
||||||
|
LTE_UE_PDSCH** const pdsch_vars_th1 = ue->pdsch_vars[1];
|
||||||
LTE_UE_PDSCH** const pdsch_vars_SI = ue->pdsch_vars_SI;
|
LTE_UE_PDSCH** const pdsch_vars_SI = ue->pdsch_vars_SI;
|
||||||
LTE_UE_PDSCH** const pdsch_vars_ra = ue->pdsch_vars_ra;
|
LTE_UE_PDSCH** const pdsch_vars_ra = ue->pdsch_vars_ra;
|
||||||
LTE_UE_PDSCH** const pdsch_vars_mch = ue->pdsch_vars_MCH;
|
LTE_UE_PDSCH** const pdsch_vars_mch = ue->pdsch_vars_MCH;
|
||||||
@@ -1115,32 +1117,37 @@ int phy_init_lte_ue(PHY_VARS_UE *ue,
|
|||||||
// init RX buffers
|
// init RX buffers
|
||||||
|
|
||||||
common_vars->rxdata = (int32_t**)malloc16( fp->nb_antennas_rx*sizeof(int32_t*) );
|
common_vars->rxdata = (int32_t**)malloc16( fp->nb_antennas_rx*sizeof(int32_t*) );
|
||||||
common_vars->rxdataF = (int32_t**)malloc16( fp->nb_antennas_rx*sizeof(int32_t*) );
|
common_vars->common_vars_rx_data_per_thread[0].rxdataF = (int32_t**)malloc16( fp->nb_antennas_rx*sizeof(int32_t*) );
|
||||||
common_vars->rxdataF2 = (int32_t**)malloc16( fp->nb_antennas_rx*sizeof(int32_t*) );
|
common_vars->common_vars_rx_data_per_thread[1].rxdataF = (int32_t**)malloc16( fp->nb_antennas_rx*sizeof(int32_t*) );
|
||||||
|
|
||||||
for (i=0; i<fp->nb_antennas_rx; i++) {
|
for (i=0; i<fp->nb_antennas_rx; i++) {
|
||||||
common_vars->rxdata[i] = (int32_t*) malloc16_clear( (fp->samples_per_tti*10+2048)*sizeof(int32_t) );
|
common_vars->rxdata[i] = (int32_t*) malloc16_clear( (fp->samples_per_tti*10+2048)*sizeof(int32_t) );
|
||||||
common_vars->rxdataF[i] = (int32_t*)malloc16_clear( sizeof(int32_t)*(fp->ofdm_symbol_size*14) );
|
common_vars->common_vars_rx_data_per_thread[0].rxdataF[i] = (int32_t*)malloc16_clear( sizeof(int32_t)*(fp->ofdm_symbol_size*14) );
|
||||||
common_vars->rxdataF2[i] = (int32_t*)malloc16_clear( sizeof(int32_t)*(fp->ofdm_symbol_size*fp->symbols_per_tti*10) );
|
common_vars->common_vars_rx_data_per_thread[1].rxdataF[i] = (int32_t*)malloc16_clear( sizeof(int32_t)*(fp->ofdm_symbol_size*14) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Channel estimates
|
// Channel estimates
|
||||||
for (eNB_id=0; eNB_id<7; eNB_id++) {
|
for (eNB_id=0; eNB_id<7; eNB_id++) {
|
||||||
common_vars->dl_ch_estimates[eNB_id] = (int32_t**)malloc16_clear(8*sizeof(int32_t*));
|
common_vars->common_vars_rx_data_per_thread[0].dl_ch_estimates[eNB_id] = (int32_t**)malloc16_clear(8*sizeof(int32_t*));
|
||||||
common_vars->dl_ch_estimates_time[eNB_id] = (int32_t**)malloc16_clear(8*sizeof(int32_t*));
|
common_vars->common_vars_rx_data_per_thread[1].dl_ch_estimates[eNB_id] = (int32_t**)malloc16_clear(8*sizeof(int32_t*));
|
||||||
|
common_vars->common_vars_rx_data_per_thread[0].dl_ch_estimates_time[eNB_id] = (int32_t**)malloc16_clear(8*sizeof(int32_t*));
|
||||||
|
common_vars->common_vars_rx_data_per_thread[1].dl_ch_estimates_time[eNB_id] = (int32_t**)malloc16_clear(8*sizeof(int32_t*));
|
||||||
|
|
||||||
for (i=0; i<fp->nb_antennas_rx; i++)
|
for (i=0; i<fp->nb_antennas_rx; i++)
|
||||||
for (j=0; j<4; j++) {
|
for (j=0; j<4; j++) {
|
||||||
int idx = (j<<1) + i;
|
int idx = (j<<1) + i;
|
||||||
common_vars->dl_ch_estimates[eNB_id][idx] = (int32_t*)malloc16_clear( sizeof(int32_t)*fp->symbols_per_tti*(fp->ofdm_symbol_size+LTE_CE_FILTER_LENGTH) );
|
common_vars->common_vars_rx_data_per_thread[0].dl_ch_estimates[eNB_id][idx] = (int32_t*)malloc16_clear( sizeof(int32_t)*fp->symbols_per_tti*(fp->ofdm_symbol_size+LTE_CE_FILTER_LENGTH) );
|
||||||
common_vars->dl_ch_estimates_time[eNB_id][idx] = (int32_t*)malloc16_clear( sizeof(int32_t)*fp->ofdm_symbol_size*2 );
|
common_vars->common_vars_rx_data_per_thread[1].dl_ch_estimates[eNB_id][idx] = (int32_t*)malloc16_clear( sizeof(int32_t)*fp->symbols_per_tti*(fp->ofdm_symbol_size+LTE_CE_FILTER_LENGTH) );
|
||||||
|
common_vars->common_vars_rx_data_per_thread[0].dl_ch_estimates_time[eNB_id][idx] = (int32_t*)malloc16_clear( sizeof(int32_t)*fp->ofdm_symbol_size*2 );
|
||||||
|
common_vars->common_vars_rx_data_per_thread[1].dl_ch_estimates_time[eNB_id][idx] = (int32_t*)malloc16_clear( sizeof(int32_t)*fp->ofdm_symbol_size*2 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// DLSCH
|
// DLSCH
|
||||||
for (eNB_id=0; eNB_id<ue->n_connected_eNB; eNB_id++) {
|
for (eNB_id=0; eNB_id<ue->n_connected_eNB; eNB_id++) {
|
||||||
pdsch_vars[eNB_id] = (LTE_UE_PDSCH *)malloc16_clear(sizeof(LTE_UE_PDSCH));
|
pdsch_vars_th0[eNB_id] = (LTE_UE_PDSCH *)malloc16_clear(sizeof(LTE_UE_PDSCH));
|
||||||
|
pdsch_vars_th1[eNB_id] = (LTE_UE_PDSCH *)malloc16_clear(sizeof(LTE_UE_PDSCH));
|
||||||
pdsch_vars_SI[eNB_id] = (LTE_UE_PDSCH *)malloc16_clear(sizeof(LTE_UE_PDSCH));
|
pdsch_vars_SI[eNB_id] = (LTE_UE_PDSCH *)malloc16_clear(sizeof(LTE_UE_PDSCH));
|
||||||
pdsch_vars_ra[eNB_id] = (LTE_UE_PDSCH *)malloc16_clear(sizeof(LTE_UE_PDSCH));
|
pdsch_vars_ra[eNB_id] = (LTE_UE_PDSCH *)malloc16_clear(sizeof(LTE_UE_PDSCH));
|
||||||
pdsch_vars_mch[eNB_id] = (LTE_UE_PDSCH *)malloc16_clear(sizeof(LTE_UE_PDSCH));
|
pdsch_vars_mch[eNB_id] = (LTE_UE_PDSCH *)malloc16_clear(sizeof(LTE_UE_PDSCH));
|
||||||
@@ -1149,25 +1156,43 @@ int phy_init_lte_ue(PHY_VARS_UE *ue,
|
|||||||
pbch_vars[eNB_id] = (LTE_UE_PBCH *)malloc16_clear(sizeof(LTE_UE_PBCH));
|
pbch_vars[eNB_id] = (LTE_UE_PBCH *)malloc16_clear(sizeof(LTE_UE_PBCH));
|
||||||
|
|
||||||
if (abstraction_flag == 0) {
|
if (abstraction_flag == 0) {
|
||||||
phy_init_lte_ue__PDSCH( pdsch_vars[eNB_id], fp );
|
phy_init_lte_ue__PDSCH( pdsch_vars_th0[eNB_id], fp );
|
||||||
|
phy_init_lte_ue__PDSCH( pdsch_vars_th1[eNB_id], fp );
|
||||||
|
|
||||||
pdsch_vars[eNB_id]->llr_shifts = (uint8_t*)malloc16_clear(7*2*fp->N_RB_DL*12);
|
// thread 0
|
||||||
pdsch_vars[eNB_id]->llr_shifts_p = pdsch_vars[eNB_id]->llr_shifts;
|
pdsch_vars_th0[eNB_id]->llr_shifts = (uint8_t*)malloc16_clear(7*2*fp->N_RB_DL*12);
|
||||||
pdsch_vars[eNB_id]->dl_ch_mag1 = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
|
pdsch_vars_th0[eNB_id]->llr_shifts_p = pdsch_vars_th0[eNB_id]->llr_shifts;
|
||||||
pdsch_vars[eNB_id]->dl_ch_magb1 = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
|
pdsch_vars_th0[eNB_id]->dl_ch_mag1 = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
|
||||||
pdsch_vars[eNB_id]->llr[1] = (int16_t*)malloc16_clear( (8*((3*8*6144)+12))*sizeof(int16_t) );
|
pdsch_vars_th0[eNB_id]->dl_ch_magb1 = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
|
||||||
|
pdsch_vars_th0[eNB_id]->llr[1] = (int16_t*)malloc16_clear( (8*((3*8*6144)+12))*sizeof(int16_t) );
|
||||||
|
|
||||||
for (k=0; k<8; k++)
|
for (k=0; k<8; k++)
|
||||||
pdsch_vars[eNB_id]->rxdataF_comp1[k] = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
|
pdsch_vars_th0[eNB_id]->rxdataF_comp1[k] = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
|
||||||
|
|
||||||
|
// thread 1
|
||||||
|
pdsch_vars_th1[eNB_id]->llr_shifts = (uint8_t*)malloc16_clear(7*2*fp->N_RB_DL*12);
|
||||||
|
pdsch_vars_th1[eNB_id]->llr_shifts_p = pdsch_vars_th1[eNB_id]->llr_shifts;
|
||||||
|
pdsch_vars_th1[eNB_id]->dl_ch_mag1 = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
|
||||||
|
pdsch_vars_th1[eNB_id]->dl_ch_magb1 = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
|
||||||
|
pdsch_vars_th1[eNB_id]->llr[1] = (int16_t*)malloc16_clear( (8*((3*8*6144)+12))*sizeof(int16_t) );
|
||||||
|
|
||||||
|
for (k=0; k<8; k++)
|
||||||
|
pdsch_vars_th1[eNB_id]->rxdataF_comp1[k] = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
|
||||||
|
|
||||||
for (i=0; i<fp->nb_antennas_rx; i++)
|
for (i=0; i<fp->nb_antennas_rx; i++)
|
||||||
for (j=0; j<4; j++) {
|
for (j=0; j<4; j++) {
|
||||||
int idx = (j<<1)+i;
|
int idx = (j<<1)+i;
|
||||||
pdsch_vars[eNB_id]->dl_ch_mag1[idx] = (int32_t*)malloc16_clear( 7*2*sizeof(int32_t)*(fp->N_RB_DL*12) );
|
pdsch_vars_th0[eNB_id]->dl_ch_mag1[idx] = (int32_t*)malloc16_clear( 7*2*sizeof(int32_t)*(fp->N_RB_DL*12) );
|
||||||
pdsch_vars[eNB_id]->dl_ch_magb1[idx] = (int32_t*)malloc16_clear( 7*2*sizeof(int32_t)*(fp->N_RB_DL*12) );
|
pdsch_vars_th0[eNB_id]->dl_ch_magb1[idx] = (int32_t*)malloc16_clear( 7*2*sizeof(int32_t)*(fp->N_RB_DL*12) );
|
||||||
|
|
||||||
|
pdsch_vars_th1[eNB_id]->dl_ch_mag1[idx] = (int32_t*)malloc16_clear( 7*2*sizeof(int32_t)*(fp->N_RB_DL*12) );
|
||||||
|
pdsch_vars_th1[eNB_id]->dl_ch_magb1[idx] = (int32_t*)malloc16_clear( 7*2*sizeof(int32_t)*(fp->N_RB_DL*12) );
|
||||||
|
|
||||||
for (k=0; k<8; k++)
|
for (k=0; k<8; k++)
|
||||||
pdsch_vars[eNB_id]->rxdataF_comp1[idx][k] = (int32_t*)malloc16_clear( sizeof(int32_t)*(fp->N_RB_DL*12*14) );
|
{
|
||||||
|
pdsch_vars_th0[eNB_id]->rxdataF_comp1[idx][k] = (int32_t*)malloc16_clear( sizeof(int32_t)*(fp->N_RB_DL*12*14) );
|
||||||
|
pdsch_vars_th1[eNB_id]->rxdataF_comp1[idx][k] = (int32_t*)malloc16_clear( sizeof(int32_t)*(fp->N_RB_DL*12*14) );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
phy_init_lte_ue__PDSCH( pdsch_vars_SI[eNB_id], fp );
|
phy_init_lte_ue__PDSCH( pdsch_vars_SI[eNB_id], fp );
|
||||||
@@ -1224,14 +1249,17 @@ int phy_init_lte_ue(PHY_VARS_UE *ue,
|
|||||||
|
|
||||||
// initialization for the last instance of pdsch_vars (used for MU-MIMO)
|
// initialization for the last instance of pdsch_vars (used for MU-MIMO)
|
||||||
|
|
||||||
pdsch_vars[eNB_id] = (LTE_UE_PDSCH *)malloc16_clear( sizeof(LTE_UE_PDSCH) );
|
pdsch_vars_th0[eNB_id] = (LTE_UE_PDSCH *)malloc16_clear( sizeof(LTE_UE_PDSCH) );
|
||||||
|
pdsch_vars_th1[eNB_id] = (LTE_UE_PDSCH *)malloc16_clear( sizeof(LTE_UE_PDSCH) );
|
||||||
pdsch_vars_SI[eNB_id] = (LTE_UE_PDSCH *)malloc16_clear( sizeof(LTE_UE_PDSCH) );
|
pdsch_vars_SI[eNB_id] = (LTE_UE_PDSCH *)malloc16_clear( sizeof(LTE_UE_PDSCH) );
|
||||||
pdsch_vars_ra[eNB_id] = (LTE_UE_PDSCH *)malloc16_clear( sizeof(LTE_UE_PDSCH) );
|
pdsch_vars_ra[eNB_id] = (LTE_UE_PDSCH *)malloc16_clear( sizeof(LTE_UE_PDSCH) );
|
||||||
|
|
||||||
if (abstraction_flag == 0) {
|
if (abstraction_flag == 0) {
|
||||||
phy_init_lte_ue__PDSCH( pdsch_vars[eNB_id], fp );
|
phy_init_lte_ue__PDSCH( pdsch_vars_th0[eNB_id], fp );
|
||||||
pdsch_vars[eNB_id]->llr[1] = (int16_t*)malloc16_clear( (8*((3*8*6144)+12))*sizeof(int16_t) );
|
pdsch_vars_th0[eNB_id]->llr[1] = (int16_t*)malloc16_clear( (8*((3*8*6144)+12))*sizeof(int16_t) );
|
||||||
|
|
||||||
|
phy_init_lte_ue__PDSCH( pdsch_vars_th1[eNB_id], fp );
|
||||||
|
pdsch_vars_th1[eNB_id]->llr[1] = (int16_t*)malloc16_clear( (8*((3*8*6144)+12))*sizeof(int16_t) );
|
||||||
} else { //abstraction == 1
|
} else { //abstraction == 1
|
||||||
ue->sinr_dB = (double*) malloc16_clear( fp->N_RB_DL*12*sizeof(double) );
|
ue->sinr_dB = (double*) malloc16_clear( fp->N_RB_DL*12*sizeof(double) );
|
||||||
}
|
}
|
||||||
@@ -1304,49 +1332,54 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB,
|
|||||||
common_vars->txdataF[eNB_id] = (int32_t **)malloc16(NB_ANTENNA_PORTS_ENB*sizeof(int32_t*));
|
common_vars->txdataF[eNB_id] = (int32_t **)malloc16(NB_ANTENNA_PORTS_ENB*sizeof(int32_t*));
|
||||||
common_vars->txdataF_BF[eNB_id] = (int32_t **)malloc16(fp->nb_antennas_tx*sizeof(int32_t*));
|
common_vars->txdataF_BF[eNB_id] = (int32_t **)malloc16(fp->nb_antennas_tx*sizeof(int32_t*));
|
||||||
|
|
||||||
for (i=0; i<14; i++) {
|
if (eNB->node_function != NGFI_RRU_IF5) {
|
||||||
common_vars->txdataF[eNB_id][i] = (int32_t*)malloc16_clear(fp->ofdm_symbol_size*fp->symbols_per_tti*10*sizeof(int32_t) );
|
for (i=0; i<NB_ANTENNA_PORTS_ENB; i++) {
|
||||||
|
if (i<fp->nb_antenna_ports_eNB || i==5) {
|
||||||
|
common_vars->txdataF[eNB_id][i] = (int32_t*)malloc16_clear(fp->ofdm_symbol_size*fp->symbols_per_tti*10*sizeof(int32_t) );
|
||||||
#ifdef DEBUG_PHY
|
#ifdef DEBUG_PHY
|
||||||
msg("[openair][LTE_PHY][INIT] lte_common_vars->txdataF[%d][%d] = %p (%d bytes)\n",
|
printf("[openair][LTE_PHY][INIT] common_vars->txdataF[%d][%d] = %p (%lu bytes)\n",
|
||||||
eNB_id,i,common_vars->txdataF[eNB_id][i],
|
eNB_id,i,common_vars->txdataF[eNB_id][i],
|
||||||
fp->ofdm_symbol_size*fp->symbols_per_tti*10*sizeof(int32_t));
|
fp->ofdm_symbol_size*fp->symbols_per_tti*10*sizeof(int32_t));
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i=0; i<fp->nb_antennas_tx; i++) {
|
for (i=0; i<fp->nb_antennas_tx; i++) {
|
||||||
common_vars->txdataF_BF[eNB_id][i] = (int32_t*)malloc16_clear(fp->ofdm_symbol_size*sizeof(int32_t) );
|
common_vars->txdataF_BF[eNB_id][i] = (int32_t*)malloc16_clear(fp->ofdm_symbol_size*sizeof(int32_t) );
|
||||||
if (eNB->node_function != NGFI_RCC_IF4p5)
|
if (eNB->node_function != NGFI_RCC_IF4p5)
|
||||||
common_vars->txdata[eNB_id][i] = (int32_t*)malloc16_clear(fp->samples_per_tti*10*sizeof(int32_t) );
|
|
||||||
|
// Allocate 10 subframes of I/Q TX signal data (time) if not
|
||||||
|
common_vars->txdata[eNB_id][i] = (int32_t*)malloc16_clear( fp->samples_per_tti*10*sizeof(int32_t) );
|
||||||
|
|
||||||
#ifdef DEBUG_PHY
|
#ifdef DEBUG_PHY
|
||||||
msg("[openair][LTE_PHY][INIT] lte_common_vars->txdataF_BF[%d][%d] = %p (%d bytes)\n",
|
printf("[openair][LTE_PHY][INIT] common_vars->txdata[%d][%d] = %p (%lu bytes)\n",eNB_id,i,common_vars->txdata[eNB_id][i],
|
||||||
eNB_id,i,common_vars->txdataF_BF[eNB_id][i],
|
fp->samples_per_tti*10*sizeof(int32_t));
|
||||||
fp->ofdm_symbol_size*sizeof(int32_t));
|
|
||||||
msg("[openair][LTE_PHY][INIT] lte_common_vars->txdata[%d][%d] = %p\n",eNB_id,i,common_vars->txdata[eNB_id][i]);
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i=0; i<14; i++) { // 14 is the total number of antenna ports
|
for (i=0; i<NB_ANTENNA_PORTS_ENB; i++) {
|
||||||
common_vars->beam_weights[eNB_id][i] = (int32_t **)malloc16_clear(fp->nb_antennas_tx*sizeof(int32_t*));
|
if (i<fp->nb_antenna_ports_eNB || i==5) {
|
||||||
for (j=0; j<fp->nb_antennas_tx; j++) {
|
common_vars->beam_weights[eNB_id][i] = (int32_t **)malloc16_clear(fp->nb_antennas_tx*sizeof(int32_t*));
|
||||||
common_vars->beam_weights[eNB_id][i][j] = (int32_t *)malloc16_clear(fp->ofdm_symbol_size*sizeof(int32_t));
|
for (j=0; j<fp->nb_antennas_tx; j++) {
|
||||||
// antenna ports 0-3 are mapped on antennas 0-3
|
common_vars->beam_weights[eNB_id][i][j] = (int32_t *)malloc16_clear(fp->ofdm_symbol_size*sizeof(int32_t));
|
||||||
// antenna port 4 is mapped on antenna 0
|
// antenna ports 0-3 are mapped on antennas 0-3
|
||||||
// antenna ports 5-14 are mapped on all antennas
|
// antenna port 4 is mapped on antenna 0
|
||||||
if (((i<4) && (i==j)) || ((i==4) && (j==0))) {
|
// antenna ports 5-14 are mapped on all antennas
|
||||||
for (re=0; re<fp->ofdm_symbol_size; re++)
|
if (((i<4) && (i==j)) || ((i==4) && (j==0))) {
|
||||||
common_vars->beam_weights[eNB_id][i][j][re] = 0x00007fff;
|
for (re=0; re<fp->ofdm_symbol_size; re++)
|
||||||
}
|
common_vars->beam_weights[eNB_id][i][j][re] = 0x00007fff;
|
||||||
else if (i>4) {
|
}
|
||||||
for (re=0; re<fp->ofdm_symbol_size; re++)
|
else if (i>4) {
|
||||||
common_vars->beam_weights[eNB_id][i][j][re] = 0x00007fff/fp->nb_antennas_tx;
|
for (re=0; re<fp->ofdm_symbol_size; re++)
|
||||||
}
|
common_vars->beam_weights[eNB_id][i][j][re] = 0x00007fff/fp->nb_antennas_tx;
|
||||||
|
}
|
||||||
#ifdef DEBUG_PHY
|
#ifdef DEBUG_PHY
|
||||||
msg("[openair][LTE_PHY][INIT] lte_common_vars->beam_weights[%d][%d][%d] = %p (%d bytes)\n",
|
msg("[openair][LTE_PHY][INIT] lte_common_vars->beam_weights[%d][%d][%d] = %p (%d bytes)\n",
|
||||||
eNB_id,i,j,common_vars->beam_weights[eNB_id][i][j],
|
eNB_id,i,j,common_vars->beam_weights[eNB_id][i][j],
|
||||||
fp->ofdm_symbol_size*sizeof(int32_t));
|
fp->ofdm_symbol_size*sizeof(int32_t));
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// RX vars
|
// RX vars
|
||||||
@@ -1358,17 +1391,25 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB,
|
|||||||
|
|
||||||
for (i=0; i<fp->nb_antennas_rx; i++) {
|
for (i=0; i<fp->nb_antennas_rx; i++) {
|
||||||
if (eNB->node_function != NGFI_RCC_IF4p5) {
|
if (eNB->node_function != NGFI_RCC_IF4p5) {
|
||||||
|
// allocate 2 subframes of I/Q signal data (time) if not an RCC (no time-domain signals)
|
||||||
common_vars->rxdata[eNB_id][i] = (int32_t*)malloc16_clear( fp->samples_per_tti*10*sizeof(int32_t) );
|
common_vars->rxdata[eNB_id][i] = (int32_t*)malloc16_clear( fp->samples_per_tti*10*sizeof(int32_t) );
|
||||||
common_vars->rxdata_7_5kHz[eNB_id][i] = (int32_t*)malloc16_clear( fp->samples_per_tti*sizeof(int32_t) );
|
|
||||||
#ifdef DEBUG_PHY
|
if (eNB->node_function != NGFI_RRU_IF5)
|
||||||
printf("[openair][LTE_PHY][INIT] common_vars->rxdata[%d][%d] = %p\n",eNB_id,i,common_vars->rxdata[eNB_id][i]);
|
// allocate 2 subframes of I/Q signal data (time, 7.5 kHz offset)
|
||||||
printf("[openair][LTE_PHY][INIT] common_vars->rxdata_7_5kHz[%d][%d] = %p\n",eNB_id,i,common_vars->rxdata_7_5kHz[eNB_id][i]);
|
common_vars->rxdata_7_5kHz[eNB_id][i] = (int32_t*)malloc16_clear( 2*fp->samples_per_tti*2*sizeof(int32_t) );
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
if (eNB->node_function != NGFI_RRU_IF5)
|
||||||
|
// allocate 2 subframes of I/Q signal data (frequency)
|
||||||
|
common_vars->rxdataF[eNB_id][i] = (int32_t*)malloc16_clear(sizeof(int32_t)*(2*fp->ofdm_symbol_size*fp->symbols_per_tti) );
|
||||||
|
#ifdef DEBUG_PHY
|
||||||
|
printf("[openair][LTE_PHY][INIT] common_vars->rxdata[%d][%d] = %p (%lu bytes)\n",eNB_id,i,common_vars->rxdata[eNB_id][i],fp->samples_per_tti*10*sizeof(int32_t));
|
||||||
|
if (eNB->node_function != NGFI_RRU_IF5)
|
||||||
|
printf("[openair][LTE_PHY][INIT] common_vars->rxdata_7_5kHz[%d][%d] = %p (%lu bytes)\n",eNB_id,i,common_vars->rxdata_7_5kHz[eNB_id][i],fp->samples_per_tti*2*sizeof(int32_t));
|
||||||
|
#endif
|
||||||
common_vars->rxdataF[eNB_id][i] = (int32_t*)malloc16_clear(sizeof(int32_t)*(fp->ofdm_symbol_size*fp->symbols_per_tti) );
|
common_vars->rxdataF[eNB_id][i] = (int32_t*)malloc16_clear(sizeof(int32_t)*(fp->ofdm_symbol_size*fp->symbols_per_tti) );
|
||||||
}
|
}
|
||||||
|
|
||||||
if (eNB->node_function != NGFI_RRU_IF4p5) {
|
if ((eNB->node_function != NGFI_RRU_IF4p5)&&(eNB->node_function != NGFI_RRU_IF5)) {
|
||||||
// Channel estimates for SRS
|
// Channel estimates for SRS
|
||||||
for (UE_id=0; UE_id<NUMBER_OF_UE_MAX; UE_id++) {
|
for (UE_id=0; UE_id<NUMBER_OF_UE_MAX; UE_id++) {
|
||||||
|
|
||||||
@@ -1383,7 +1424,8 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB,
|
|||||||
|
|
||||||
common_vars->sync_corr[eNB_id] = (uint32_t*)malloc16_clear( LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*sizeof(uint32_t)*fp->samples_per_tti );
|
common_vars->sync_corr[eNB_id] = (uint32_t*)malloc16_clear( LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*sizeof(uint32_t)*fp->samples_per_tti );
|
||||||
}
|
}
|
||||||
} else { //UPLINK abstraction = 1
|
} // abstraction_flag = 0
|
||||||
|
else { //UPLINK abstraction = 1
|
||||||
eNB->sinr_dB = (double*) malloc16_clear( fp->N_RB_DL*12*sizeof(double) );
|
eNB->sinr_dB = (double*) malloc16_clear( fp->N_RB_DL*12*sizeof(double) );
|
||||||
}
|
}
|
||||||
} //eNB_id
|
} //eNB_id
|
||||||
@@ -1391,7 +1433,7 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB,
|
|||||||
|
|
||||||
|
|
||||||
if (abstraction_flag==0) {
|
if (abstraction_flag==0) {
|
||||||
if (eNB->node_function != NGFI_RRU_IF4p5) {
|
if ((eNB->node_function != NGFI_RRU_IF4p5)&&(eNB->node_function != NGFI_RRU_IF5)) {
|
||||||
generate_ul_ref_sigs_rx();
|
generate_ul_ref_sigs_rx();
|
||||||
|
|
||||||
// SRS
|
// SRS
|
||||||
@@ -1405,7 +1447,7 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB,
|
|||||||
|
|
||||||
// ULSCH VARS, skip if NFGI_RRU_IF4
|
// ULSCH VARS, skip if NFGI_RRU_IF4
|
||||||
|
|
||||||
if (eNB->node_function!=NGFI_RRU_IF4p5)
|
if ((eNB->node_function!=NGFI_RRU_IF4p5)&&(eNB->node_function != NGFI_RRU_IF5))
|
||||||
prach_vars->prachF = (int16_t*)malloc16_clear( 1024*2*sizeof(int16_t) );
|
prach_vars->prachF = (int16_t*)malloc16_clear( 1024*2*sizeof(int16_t) );
|
||||||
|
|
||||||
/* number of elements of an array X is computed as sizeof(X) / sizeof(X[0]) */
|
/* number of elements of an array X is computed as sizeof(X) / sizeof(X[0]) */
|
||||||
@@ -1418,7 +1460,7 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB,
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if (eNB->node_function != NGFI_RRU_IF4p5) {
|
if ((eNB->node_function != NGFI_RRU_IF4p5)&&(eNB->node_function != NGFI_RRU_IF5)) {
|
||||||
AssertFatal(fp->nb_antennas_rx <= sizeof(prach_vars->prach_ifft) / sizeof(prach_vars->prach_ifft[0]),
|
AssertFatal(fp->nb_antennas_rx <= sizeof(prach_vars->prach_ifft) / sizeof(prach_vars->prach_ifft[0]),
|
||||||
"nb_antennas_rx too large");
|
"nb_antennas_rx too large");
|
||||||
for (i=0; i<fp->nb_antennas_rx; i++) {
|
for (i=0; i<fp->nb_antennas_rx; i++) {
|
||||||
|
|||||||
@@ -22,6 +22,23 @@
|
|||||||
#include "defs.h"
|
#include "defs.h"
|
||||||
#include "log.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)
|
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);
|
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_samples0=512;
|
||||||
frame_parms->nb_prefix_samples = 512;
|
frame_parms->nb_prefix_samples = 512;
|
||||||
frame_parms->symbols_per_tti = 12;
|
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_samples0 = 160;
|
||||||
frame_parms->nb_prefix_samples = 144;
|
frame_parms->nb_prefix_samples = 144;
|
||||||
frame_parms->symbols_per_tti = 14;
|
frame_parms->symbols_per_tti = 14;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
switch(osf) {
|
switch(osf) {
|
||||||
case 1:
|
case 1:
|
||||||
log2_osf = 0;
|
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);
|
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;
|
// frame_parms->tdd_config=3;
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,7 +34,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/*!\brief Timing drift hysterisis in samples*/
|
/*!\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
|
\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,
|
void lte_adjust_synch(LTE_DL_FRAME_PARMS *frame_parms,
|
||||||
PHY_VARS_UE *phy_vars_ue,
|
PHY_VARS_UE *phy_vars_ue,
|
||||||
module_id_t eNb_id,
|
module_id_t eNb_id,
|
||||||
|
uint8_t subframe,
|
||||||
unsigned char clear,
|
unsigned char clear,
|
||||||
short coef);
|
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,
|
void lte_ue_measurements(PHY_VARS_UE *phy_vars_ue,
|
||||||
unsigned int subframe_offset,
|
unsigned int subframe_offset,
|
||||||
unsigned char N0_symbol,
|
unsigned char N0_symbol,
|
||||||
unsigned char abstraction_flag);
|
unsigned char abstraction_flag,
|
||||||
|
uint8_t subframe);
|
||||||
|
|
||||||
//! \brief This function performance RSRP/RSCP measurements
|
//! \brief This function performance RSRP/RSCP measurements
|
||||||
void ue_rrc_measurements(PHY_VARS_UE *phy_vars_ue,
|
void ue_rrc_measurements(PHY_VARS_UE *phy_vars_ue,
|
||||||
|
|||||||
@@ -34,6 +34,7 @@
|
|||||||
void lte_adjust_synch(LTE_DL_FRAME_PARMS *frame_parms,
|
void lte_adjust_synch(LTE_DL_FRAME_PARMS *frame_parms,
|
||||||
PHY_VARS_UE *ue,
|
PHY_VARS_UE *ue,
|
||||||
unsigned char eNB_id,
|
unsigned char eNB_id,
|
||||||
|
uint8_t subframe,
|
||||||
unsigned char clear,
|
unsigned char clear,
|
||||||
short coef)
|
short coef)
|
||||||
{
|
{
|
||||||
@@ -48,7 +49,7 @@ void lte_adjust_synch(LTE_DL_FRAME_PARMS *frame_parms,
|
|||||||
ncoef = 32767 - coef;
|
ncoef = 32767 - coef;
|
||||||
|
|
||||||
#ifdef DEBUG_PHY
|
#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
|
#endif //DEBUG_PHY
|
||||||
|
|
||||||
|
|
||||||
@@ -57,8 +58,8 @@ void lte_adjust_synch(LTE_DL_FRAME_PARMS *frame_parms,
|
|||||||
temp = 0;
|
temp = 0;
|
||||||
|
|
||||||
for (aa=0; aa<frame_parms->nb_antennas_rx; aa++) {
|
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)];
|
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.dl_ch_estimates_time[eNB_id][aa])[1+(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);
|
temp += (Re*Re/2) + (Im*Im/2);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -74,13 +75,15 @@ void lte_adjust_synch(LTE_DL_FRAME_PARMS *frame_parms,
|
|||||||
else
|
else
|
||||||
max_pos_fil = ((max_pos_fil * coef) + (max_pos * ncoef)) >> 15;
|
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 )
|
if ( abs(diff) < SYNCH_HYST )
|
||||||
ue->rx_offset++;
|
ue->rx_offset = 0;
|
||||||
else if (diff < -SYNCH_HYST)
|
else
|
||||||
ue->rx_offset--;
|
ue->rx_offset = diff;
|
||||||
|
|
||||||
if ( ue->rx_offset < 0 )
|
if ( ue->rx_offset < 0 )
|
||||||
ue->rx_offset += FRAME_LENGTH_COMPLEX_SAMPLES;
|
ue->rx_offset += FRAME_LENGTH_COMPLEX_SAMPLES;
|
||||||
@@ -91,8 +94,8 @@ void lte_adjust_synch(LTE_DL_FRAME_PARMS *frame_parms,
|
|||||||
|
|
||||||
|
|
||||||
#ifdef DEBUG_PHY
|
#ifdef DEBUG_PHY
|
||||||
LOG_D(PHY,"frame %d: rx_offset (after) = %d : max_pos = %d,max_pos_fil = %d (peak %d)\n",
|
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,ue->rx_offset,max_pos,max_pos_fil,temp);
|
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
|
#endif //DEBUG_PHY
|
||||||
|
|
||||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_ADJUST_SYNCH, VCD_FUNCTION_OUT);
|
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
|
else
|
||||||
rballoc = dlsch0_harq->rb_alloc_even;
|
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;
|
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
|
if (phy_vars_ue->high_speed_flag == 0) // use second channel estimate position for temporary storage
|
||||||
|
|||||||
@@ -25,6 +25,7 @@
|
|||||||
#include "defs.h"
|
#include "defs.h"
|
||||||
#include "PHY/defs.h"
|
#include "PHY/defs.h"
|
||||||
#include "filt96_32.h"
|
#include "filt96_32.h"
|
||||||
|
#include "T.h"
|
||||||
//#define DEBUG_CH
|
//#define DEBUG_CH
|
||||||
|
|
||||||
int lte_dl_channel_estimation(PHY_VARS_UE *ue,
|
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;
|
int ch_offset,symbol_offset;
|
||||||
// unsigned int n;
|
// unsigned int n;
|
||||||
// int i;
|
// 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];
|
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;
|
uint8_t nushift,pilot1,pilot2,pilot3;
|
||||||
int **dl_ch_estimates=ue->common_vars.dl_ch_estimates[eNB_offset];
|
int **dl_ch_estimates =ue->common_vars.common_vars_rx_data_per_thread[(Ns>>1)&0x1].dl_ch_estimates[eNB_offset];
|
||||||
int **rxdataF=ue->common_vars.rxdataF;
|
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
|
if (ue->frame_parms.Ncp == 0) { // normal prefix
|
||||||
pilot1 = 4;
|
pilot1 = 4;
|
||||||
@@ -637,13 +640,19 @@ int lte_dl_channel_estimation(PHY_VARS_UE *ue,
|
|||||||
if (symbol == 0) {
|
if (symbol == 0) {
|
||||||
// printf("Interpolating %d->0\n",4-ue->frame_parms.Ncp);
|
// 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][(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_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,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_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,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
|
} // this is 1/3,2/3 combination for pilots spaced by 3 symbols
|
||||||
else if (symbol == pilot1) {
|
else if (symbol == pilot1) {
|
||||||
dl_ch_prev = (int16_t *)&dl_ch_estimates[(p<<1)+aarx][0];
|
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_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);
|
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)
|
} // 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
|
// do ifft of channel estimate
|
||||||
for (aarx=0; aarx<ue->frame_parms.nb_antennas_rx; aarx++)
|
for (aarx=0; aarx<ue->frame_parms.nb_antennas_rx; aarx++)
|
||||||
for (p=0; p<ue->frame_parms.nb_antenna_ports_eNB; p++) {
|
for (p=0; p<ue->frame_parms.nb_antenna_ports_eNB; p++) {
|
||||||
if (ue->common_vars.dl_ch_estimates[eNB_offset][(p<<1)+aarx])
|
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.dl_ch_estimates[eNB_offset][(p<<1)+aarx][8],
|
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.dl_ch_estimates_time[eNB_offset][(p<<1)+aarx],1);
|
(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);
|
return(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -44,8 +44,8 @@ int lte_dl_mbsfn_channel_estimation(PHY_VARS_UE *ue,
|
|||||||
// unsigned int n;
|
// unsigned int n;
|
||||||
// int i;
|
// int i;
|
||||||
|
|
||||||
int **dl_ch_estimates=ue->common_vars.dl_ch_estimates[0];
|
int **dl_ch_estimates=ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[0];
|
||||||
int **rxdataF=ue->common_vars.rxdataF;
|
int **rxdataF=ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF;
|
||||||
|
|
||||||
ch_offset = (l*(ue->frame_parms.ofdm_symbol_size));
|
ch_offset = (l*(ue->frame_parms.ofdm_symbol_size));
|
||||||
symbol_offset = ch_offset;//phy_vars_ue->lte_frame_parms.ofdm_symbol_size*l;
|
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
|
// do ifft of channel estimate
|
||||||
for (aa=0; aa<ue->frame_parms.nb_antennas_rx*ue->frame_parms.nb_antennas_tx; aa++) {
|
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) {
|
switch (ue->frame_parms.N_RB_DL) {
|
||||||
case 6:
|
case 6:
|
||||||
idft128((int16_t*) &ue->common_vars.dl_ch_estimates[eNB_offset][aa][8],
|
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.dl_ch_estimates_time[eNB_offset][aa],
|
(int16_t*) ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates_time[eNB_offset][aa],
|
||||||
1);
|
1);
|
||||||
break;
|
break;
|
||||||
case 25:
|
case 25:
|
||||||
idft512((int16_t*) &ue->common_vars.dl_ch_estimates[eNB_offset][aa][8],
|
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.dl_ch_estimates_time[eNB_offset][aa],
|
(int16_t*) ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates_time[eNB_offset][aa],
|
||||||
1);
|
1);
|
||||||
break;
|
break;
|
||||||
case 50:
|
case 50:
|
||||||
idft1024((int16_t*) &ue->common_vars.dl_ch_estimates[eNB_offset][aa][8],
|
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.dl_ch_estimates_time[eNB_offset][aa],
|
(int16_t*) ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates_time[eNB_offset][aa],
|
||||||
1);
|
1);
|
||||||
break;
|
break;
|
||||||
case 75:
|
case 75:
|
||||||
idft1536((int16_t*) &ue->common_vars.dl_ch_estimates[eNB_offset][aa][8],
|
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.dl_ch_estimates_time[eNB_offset][aa],
|
(int16_t*) ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates_time[eNB_offset][aa],
|
||||||
1);
|
1);
|
||||||
break;
|
break;
|
||||||
case 100:
|
case 100:
|
||||||
idft2048((int16_t*) &ue->common_vars.dl_ch_estimates[eNB_offset][aa][8],
|
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.dl_ch_estimates_time[eNB_offset][aa],
|
(int16_t*) ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates_time[eNB_offset][aa],
|
||||||
1);
|
1);
|
||||||
break;
|
break;
|
||||||
default:
|
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
|
// 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;
|
int result;
|
||||||
short *primary_synch_time;
|
short *primary_synch_time;
|
||||||
int eNB_id = frame_parms->Nid_cell%3;
|
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);
|
// msg("[SYNC TIME] Calling sync_time_eNB(%p,%p,%d,%d)\n",rxdata,frame_parms,eNB_id,length);
|
||||||
if (sync_corr_eNB == NULL) {
|
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);
|
return(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -535,7 +536,7 @@ int lte_sync_time_eNB(int32_t **rxdata, ///rx data in time domain
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
msg("[SYNC TIME] Illegal eNB_id!\n");
|
LOG_E(PHY,"[SYNC TIME] Illegal eNB_id!\n");
|
||||||
return (-1);
|
return (-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -567,7 +568,7 @@ int lte_sync_time_eNB(int32_t **rxdata, ///rx data in time domain
|
|||||||
peak_val);
|
peak_val);
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
mean_val += (sync_corr_eNB[n]>>10);
|
mean_val += sync_corr_eNB[n];
|
||||||
|
|
||||||
if (sync_corr_eNB[n]>peak_val) {
|
if (sync_corr_eNB[n]>peak_val) {
|
||||||
peak_val = sync_corr_eNB[n];
|
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;
|
*peak_val_out = peak_val;
|
||||||
|
|
||||||
if (peak_val <= (40*mean_val)) {
|
if (peak_val <= (40*(uint32_t)mean_val)) {
|
||||||
#ifdef DEBUG_PHY
|
LOG_D(PHY,"[SYNC TIME] No peak found (%u,%u,%u,%u)\n",peak_pos,peak_val,mean_val,40*mean_val);
|
||||||
msg("[SYNC TIME] No peak found (%u,%u,%u,%u)\n",peak_pos,peak_val,mean_val,40*mean_val);
|
|
||||||
#endif
|
|
||||||
return(-1);
|
return(-1);
|
||||||
} else {
|
} else {
|
||||||
#ifdef DEBUG_PHY
|
LOG_D(PHY,"[SYNC TIME] Peak found at pos %u, val = %u, mean_val = %u\n",peak_pos,peak_val,mean_val);
|
||||||
msg("[SYNC TIME] Peak found at pos %u, val = %u, mean_val = %u\n",peak_pos,peak_val,mean_val);
|
|
||||||
#endif
|
|
||||||
return(peak_pos);
|
return(peak_pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -32,7 +32,8 @@
|
|||||||
#define k1 ((long long int) 1000)
|
#define k1 ((long long int) 1000)
|
||||||
#define k2 ((long long int) (1024-k1))
|
#define k2 ((long long int) (1024-k1))
|
||||||
|
|
||||||
//#define DEBUG_MEAS
|
//#define DEBUG_MEAS_RRC
|
||||||
|
//#define DEBUG_MEAS_UE
|
||||||
|
|
||||||
#ifdef USER_MODE
|
#ifdef USER_MODE
|
||||||
void print_shorts(char *s,short *x)
|
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,
|
void ue_rrc_measurements(PHY_VARS_UE *ue,
|
||||||
uint8_t subframe,
|
uint8_t slot,
|
||||||
uint8_t abstraction_flag)
|
uint8_t abstraction_flag)
|
||||||
{
|
{
|
||||||
|
|
||||||
int aarx,rb;
|
uint8_t subframe = slot>>1;
|
||||||
|
int aarx,rb,n;
|
||||||
int16_t *rxF,*rxF_pss,*rxF_sss;
|
int16_t *rxF,*rxF_pss,*rxF_sss;
|
||||||
|
|
||||||
uint16_t Nid_cell = ue->frame_parms.Nid_cell;
|
uint16_t Nid_cell = ue->frame_parms.Nid_cell;
|
||||||
uint8_t eNB_offset,nu,l,nushift,k;
|
uint8_t eNB_offset,nu,l,nushift,k;
|
||||||
uint16_t off;
|
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++) {
|
for (eNB_offset = 0; eNB_offset<1+ue->measurements.n_adj_cells; eNB_offset++) {
|
||||||
|
|
||||||
if (eNB_offset==0) {
|
if (eNB_offset==0) {
|
||||||
ue->measurements.rssi = 0;
|
ue->measurements.rssi = 0;
|
||||||
ue->measurements.n0_power_tot = 0;
|
//ue->measurements.n0_power_tot = 0;
|
||||||
|
|
||||||
if (abstraction_flag == 0) {
|
if (abstraction_flag == 0) {
|
||||||
if ((ue->frame_parms.frame_type == FDD) &&
|
if ((ue->frame_parms.frame_type == FDD) &&
|
||||||
@@ -189,9 +197,8 @@ void ue_rrc_measurements(PHY_VARS_UE *ue,
|
|||||||
|
|
||||||
if (ue->frame_parms.Ncp==NORMAL) {
|
if (ue->frame_parms.Ncp==NORMAL) {
|
||||||
for (aarx=0; aarx<ue->frame_parms.nb_antennas_rx; aarx++) {
|
for (aarx=0; aarx<ue->frame_parms.nb_antennas_rx; aarx++) {
|
||||||
|
rxF_sss = (int16_t *)&ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF[aarx][(5*ue->frame_parms.ofdm_symbol_size)];
|
||||||
rxF_sss = (int16_t *)&ue->common_vars.rxdataF[aarx][(5*ue->frame_parms.ofdm_symbol_size)];
|
rxF_pss = (int16_t *)&ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF[aarx][(6*ue->frame_parms.ofdm_symbol_size)];
|
||||||
rxF_pss = (int16_t *)&ue->common_vars.rxdataF[aarx][(6*ue->frame_parms.ofdm_symbol_size)];
|
|
||||||
|
|
||||||
|
|
||||||
//-ve spectrum from SSS
|
//-ve spectrum from SSS
|
||||||
@@ -216,7 +223,7 @@ void ue_rrc_measurements(PHY_VARS_UE *ue,
|
|||||||
ue->measurements.n0_power[aarx] += (((int32_t)rxF_pss[2+66]*rxF_pss[2+66])+((int32_t)rxF_pss[2+65]*rxF_pss[2+65]));
|
ue->measurements.n0_power[aarx] += (((int32_t)rxF_pss[2+66]*rxF_pss[2+66])+((int32_t)rxF_pss[2+65]*rxF_pss[2+65]));
|
||||||
// ue->measurements.n0_power[aarx] += (((int32_t)rxF_pss[2+64]*rxF_pss[2+64])+((int32_t)rxF_pss[2+63]*rxF_pss[2+63]));
|
// ue->measurements.n0_power[aarx] += (((int32_t)rxF_pss[2+64]*rxF_pss[2+64])+((int32_t)rxF_pss[2+63]*rxF_pss[2+63]));
|
||||||
// printf("pss32 %d\n",ue->measurements.n0_power[aarx]); //-ve spectrum from PSS
|
// printf("pss32 %d\n",ue->measurements.n0_power[aarx]); //-ve spectrum from PSS
|
||||||
rxF_pss = (int16_t *)&ue->common_vars.rxdataF[aarx][(7*ue->frame_parms.ofdm_symbol_size)];
|
rxF_pss = (int16_t *)&ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF[aarx][(7*ue->frame_parms.ofdm_symbol_size)];
|
||||||
// ue->measurements.n0_power[aarx] += (((int32_t)rxF_pss[-72]*rxF_pss[-72])+((int32_t)rxF_pss[-71]*rxF_pss[-71]));
|
// ue->measurements.n0_power[aarx] += (((int32_t)rxF_pss[-72]*rxF_pss[-72])+((int32_t)rxF_pss[-71]*rxF_pss[-71]));
|
||||||
// printf("pssm36 %d\n",ue->measurements.n0_power[aarx]);
|
// printf("pssm36 %d\n",ue->measurements.n0_power[aarx]);
|
||||||
ue->measurements.n0_power[aarx] += (((int32_t)rxF_pss[-70]*rxF_pss[-70])+((int32_t)rxF_pss[-69]*rxF_pss[-69]));
|
ue->measurements.n0_power[aarx] += (((int32_t)rxF_pss[-70]*rxF_pss[-70])+((int32_t)rxF_pss[-69]*rxF_pss[-69]));
|
||||||
@@ -225,23 +232,73 @@ 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]));
|
// 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]);
|
// 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_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_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);
|
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) &&
|
else if ((ue->frame_parms.frame_type == TDD) &&
|
||||||
(subframe == 0)) { // TDD SSS, compute noise in DTX REs
|
((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) {
|
if (ue->frame_parms.Ncp==NORMAL) {
|
||||||
for (aarx=0; aarx<ue->frame_parms.nb_antennas_rx; aarx++) {
|
for (aarx=0; aarx<ue->frame_parms.nb_antennas_rx; aarx++) {
|
||||||
|
|
||||||
rxF_sss = (int16_t *)&ue->common_vars.rxdataF[aarx][(6*ue->frame_parms.ofdm_symbol_size)];
|
rxF_sss = (int16_t *)&ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF[aarx][(6*ue->frame_parms.ofdm_symbol_size)];
|
||||||
// note this is a dummy pointer, the pss is not really there!
|
// note this is a dummy pointer, the pss is not really there!
|
||||||
// in FDD the pss is in the symbol after the sss, but not in TDD
|
// in FDD the pss is in the symbol after the sss, but not in TDD
|
||||||
rxF_pss = (int16_t *)&ue->common_vars.rxdataF[aarx][(7*ue->frame_parms.ofdm_symbol_size)];
|
rxF_pss = (int16_t *)&ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF[aarx][(7*ue->frame_parms.ofdm_symbol_size)];
|
||||||
|
|
||||||
//-ve spectrum from SSS
|
//-ve spectrum from SSS
|
||||||
// ue->measurements.n0_power[aarx] = (((int32_t)rxF_pss[-72]*rxF_pss[-72])+((int32_t)rxF_pss[-71]*rxF_pss[-71]));
|
// ue->measurements.n0_power[aarx] = (((int32_t)rxF_pss[-72]*rxF_pss[-72])+((int32_t)rxF_pss[-71]*rxF_pss[-71]));
|
||||||
@@ -263,8 +320,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);
|
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
|
// recompute nushift with eNB_offset corresponding to adjacent eNB on which to perform channel estimation
|
||||||
@@ -286,13 +344,13 @@ 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) {
|
for (l=0,nu=0; l<=(4-ue->frame_parms.Ncp); l+=(4-ue->frame_parms.Ncp),nu=3) {
|
||||||
k = (nu + nushift)%6;
|
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,
|
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);
|
eNB_offset,k,l);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
for (aarx=0; aarx<ue->frame_parms.nb_antennas_rx; aarx++) {
|
for (aarx=0; aarx<ue->frame_parms.nb_antennas_rx; aarx++) {
|
||||||
rxF = (int16_t *)&ue->common_vars.rxdataF[aarx][(l*ue->frame_parms.ofdm_symbol_size)];
|
rxF = (int16_t *)&ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF[aarx][(l*ue->frame_parms.ofdm_symbol_size)];
|
||||||
off = (ue->frame_parms.first_carrier_offset+k)<<1;
|
off = (ue->frame_parms.first_carrier_offset+k)<<1;
|
||||||
|
|
||||||
if (l==(4-ue->frame_parms.Ncp)) {
|
if (l==(4-ue->frame_parms.Ncp)) {
|
||||||
@@ -364,7 +422,7 @@ void ue_rrc_measurements(PHY_VARS_UE *ue,
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef DEBUG_MEAS
|
#ifdef DEBUG_MEAS_RRC
|
||||||
|
|
||||||
// if (slot == 0) {
|
// if (slot == 0) {
|
||||||
|
|
||||||
@@ -398,7 +456,8 @@ void ue_rrc_measurements(PHY_VARS_UE *ue,
|
|||||||
void lte_ue_measurements(PHY_VARS_UE *ue,
|
void lte_ue_measurements(PHY_VARS_UE *ue,
|
||||||
unsigned int subframe_offset,
|
unsigned int subframe_offset,
|
||||||
unsigned char N0_symbol,
|
unsigned char N0_symbol,
|
||||||
unsigned char abstraction_flag)
|
unsigned char abstraction_flag,
|
||||||
|
uint8_t subframe)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
@@ -448,7 +507,7 @@ void lte_ue_measurements(PHY_VARS_UE *ue,
|
|||||||
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
|
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
|
||||||
for (aatx=0; aatx<frame_parms->nb_antenna_ports_eNB; aatx++) {
|
for (aatx=0; aatx<frame_parms->nb_antenna_ports_eNB; aatx++) {
|
||||||
ue->measurements.rx_spatial_power[eNB_id][aatx][aarx] =
|
ue->measurements.rx_spatial_power[eNB_id][aatx][aarx] =
|
||||||
(signal_energy_nodc(&ue->common_vars.dl_ch_estimates[eNB_id][(aatx<<1) + aarx][0],
|
(signal_energy_nodc(&ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][(aatx<<1) + aarx][0],
|
||||||
(N_RB_DL*12)));
|
(N_RB_DL*12)));
|
||||||
//- ue->measurements.n0_power[aarx];
|
//- ue->measurements.n0_power[aarx];
|
||||||
|
|
||||||
@@ -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_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.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;
|
ue->measurements.rx_rssi_dBm[eNB_id] = ue->measurements.rx_power_avg_dB[eNB_id] - ue->rx_total_gain_dB;
|
||||||
#ifdef DEBUG_MEAS
|
#ifdef DEBUG_MEAS_UE
|
||||||
LOG_I(PHY,"[eNB %d] lte_ue_measurements: RSSI %d dBm, RSSI (digital) %d dB\n",
|
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],
|
eNB_id,
|
||||||
ue->measurements.rx_power_avg_dB[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
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -512,8 +575,8 @@ void lte_ue_measurements(PHY_VARS_UE *ue,
|
|||||||
// cqi/pmi information
|
// cqi/pmi information
|
||||||
|
|
||||||
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
|
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
|
||||||
dl_ch0 = &ue->common_vars.dl_ch_estimates[eNB_id][aarx][4];
|
dl_ch0 = &ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][aarx][4];
|
||||||
dl_ch1 = &ue->common_vars.dl_ch_estimates[eNB_id][2+aarx][4];
|
dl_ch1 = &ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][2+aarx][4];
|
||||||
|
|
||||||
for (subband=0; subband<nb_subbands; subband++) {
|
for (subband=0; subband<nb_subbands; subband++) {
|
||||||
|
|
||||||
@@ -567,13 +630,13 @@ void lte_ue_measurements(PHY_VARS_UE *ue,
|
|||||||
#if defined(__x86_64__) || defined(__i386__)
|
#if defined(__x86_64__) || defined(__i386__)
|
||||||
__m128i pmi128_re,pmi128_im,mmtmpPMI0,mmtmpPMI1 /* ,mmtmpPMI2,mmtmpPMI3 */ ;
|
__m128i pmi128_re,pmi128_im,mmtmpPMI0,mmtmpPMI1 /* ,mmtmpPMI2,mmtmpPMI3 */ ;
|
||||||
|
|
||||||
dl_ch0_128 = (__m128i *)&ue->common_vars.dl_ch_estimates[eNB_id][aarx][4];
|
dl_ch0_128 = (__m128i *)&ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][aarx][4];
|
||||||
dl_ch1_128 = (__m128i *)&ue->common_vars.dl_ch_estimates[eNB_id][2+aarx][4];
|
dl_ch1_128 = (__m128i *)&ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][2+aarx][4];
|
||||||
#elif defined(__arm__)
|
#elif defined(__arm__)
|
||||||
int32x4_t pmi128_re,pmi128_im,mmtmpPMI0,mmtmpPMI1,mmtmpPMI0b,mmtmpPMI1b;
|
int32x4_t pmi128_re,pmi128_im,mmtmpPMI0,mmtmpPMI1,mmtmpPMI0b,mmtmpPMI1b;
|
||||||
|
|
||||||
dl_ch0_128 = (int16x8_t *)&ue->common_vars.dl_ch_estimates[eNB_id][aarx][4];
|
dl_ch0_128 = (int16x8_t *)&ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][aarx][4];
|
||||||
dl_ch1_128 = (int16x8_t *)&ue->common_vars.dl_ch_estimates[eNB_id][2+aarx][4];
|
dl_ch1_128 = (int16x8_t *)&ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][2+aarx][4];
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
for (subband=0; subband<nb_subbands; subband++) {
|
for (subband=0; subband<nb_subbands; subband++) {
|
||||||
@@ -631,7 +694,7 @@ void lte_ue_measurements(PHY_VARS_UE *ue,
|
|||||||
else {
|
else {
|
||||||
// cqi information only for mode 1
|
// cqi information only for mode 1
|
||||||
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
|
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
|
||||||
dl_ch0 = &ue->common_vars.dl_ch_estimates[eNB_id][aarx][4];
|
dl_ch0 = &ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][aarx][4];
|
||||||
|
|
||||||
for (subband=0; subband<7; subband++) {
|
for (subband=0; subband<7; subband++) {
|
||||||
|
|
||||||
|
|||||||
@@ -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);
|
//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],
|
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,
|
||||||
(int16_t*) srs_vars->srs_ch_estimates[eNB_id][aa],
|
(int16_t*) srs_vars->srs_ch_estimates[eNB_id][aa],
|
||||||
frame_parms->ofdm_symbol_size,
|
frame_parms->ofdm_symbol_size,
|
||||||
15);
|
15,
|
||||||
|
0);
|
||||||
|
|
||||||
//msg("SRS channel estimation cmult out\n");
|
//msg("SRS channel estimation cmult out\n");
|
||||||
#ifdef USER_MODE
|
#ifdef USER_MODE
|
||||||
|
|||||||
@@ -41,6 +41,7 @@
|
|||||||
#include "PHY/sse_intrin.h"
|
#include "PHY/sse_intrin.h"
|
||||||
|
|
||||||
#include "assertions.h"
|
#include "assertions.h"
|
||||||
|
#include "T.h"
|
||||||
|
|
||||||
//#define DEBUG_DCI_ENCODING 1
|
//#define DEBUG_DCI_ENCODING 1
|
||||||
//#define DEBUG_DCI_DECODING 1
|
//#define DEBUG_DCI_DECODING 1
|
||||||
@@ -1684,6 +1685,7 @@ int32_t avgP[4];
|
|||||||
int32_t rx_pdcch(LTE_UE_COMMON *common_vars,
|
int32_t rx_pdcch(LTE_UE_COMMON *common_vars,
|
||||||
LTE_UE_PDCCH **pdcch_vars,
|
LTE_UE_PDCCH **pdcch_vars,
|
||||||
LTE_DL_FRAME_PARMS *frame_parms,
|
LTE_DL_FRAME_PARMS *frame_parms,
|
||||||
|
uint32_t frame,
|
||||||
uint8_t subframe,
|
uint8_t subframe,
|
||||||
uint8_t eNB_id,
|
uint8_t eNB_id,
|
||||||
MIMO_mode_t mimo_mode,
|
MIMO_mode_t mimo_mode,
|
||||||
@@ -1703,16 +1705,16 @@ int32_t rx_pdcch(LTE_UE_COMMON *common_vars,
|
|||||||
|
|
||||||
for (s=0; s<n_pdcch_symbols; s++) {
|
for (s=0; s<n_pdcch_symbols; s++) {
|
||||||
if (is_secondary_ue == 1) {
|
if (is_secondary_ue == 1) {
|
||||||
pdcch_extract_rbs_single(common_vars->rxdataF,
|
pdcch_extract_rbs_single(common_vars->common_vars_rx_data_per_thread[subframe&0x1].rxdataF,
|
||||||
common_vars->dl_ch_estimates[eNB_id+1], //add 1 to eNB_id to compensate for the shifted B/F'd pilots from the SeNB
|
common_vars->common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id+1], //add 1 to eNB_id to compensate for the shifted B/F'd pilots from the SeNB
|
||||||
pdcch_vars[eNB_id]->rxdataF_ext,
|
pdcch_vars[eNB_id]->rxdataF_ext,
|
||||||
pdcch_vars[eNB_id]->dl_ch_estimates_ext,
|
pdcch_vars[eNB_id]->dl_ch_estimates_ext,
|
||||||
s,
|
s,
|
||||||
high_speed_flag,
|
high_speed_flag,
|
||||||
frame_parms);
|
frame_parms);
|
||||||
#ifdef MU_RECEIVER
|
#ifdef MU_RECEIVER
|
||||||
pdcch_extract_rbs_single(common_vars->rxdataF,
|
pdcch_extract_rbs_single(common_vars->common_vars_rx_data_per_thread[subframe&0x1].rxdataF,
|
||||||
common_vars->dl_ch_estimates[eNB_id_i - 1],//subtract 1 to eNB_id_i to compensate for the non-shifted pilots from the PeNB
|
common_vars->common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id_i - 1],//subtract 1 to eNB_id_i to compensate for the non-shifted pilots from the PeNB
|
||||||
pdcch_vars[eNB_id_i]->rxdataF_ext,//shift by two to simulate transmission from a second antenna
|
pdcch_vars[eNB_id_i]->rxdataF_ext,//shift by two to simulate transmission from a second antenna
|
||||||
pdcch_vars[eNB_id_i]->dl_ch_estimates_ext,//shift by two to simulate transmission from a second antenna
|
pdcch_vars[eNB_id_i]->dl_ch_estimates_ext,//shift by two to simulate transmission from a second antenna
|
||||||
s,
|
s,
|
||||||
@@ -1720,16 +1722,16 @@ int32_t rx_pdcch(LTE_UE_COMMON *common_vars,
|
|||||||
frame_parms);
|
frame_parms);
|
||||||
#endif //MU_RECEIVER
|
#endif //MU_RECEIVER
|
||||||
} else if (frame_parms->nb_antenna_ports_eNB>1) {
|
} else if (frame_parms->nb_antenna_ports_eNB>1) {
|
||||||
pdcch_extract_rbs_dual(common_vars->rxdataF,
|
pdcch_extract_rbs_dual(common_vars->common_vars_rx_data_per_thread[subframe&0x1].rxdataF,
|
||||||
common_vars->dl_ch_estimates[eNB_id],
|
common_vars->common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id],
|
||||||
pdcch_vars[eNB_id]->rxdataF_ext,
|
pdcch_vars[eNB_id]->rxdataF_ext,
|
||||||
pdcch_vars[eNB_id]->dl_ch_estimates_ext,
|
pdcch_vars[eNB_id]->dl_ch_estimates_ext,
|
||||||
s,
|
s,
|
||||||
high_speed_flag,
|
high_speed_flag,
|
||||||
frame_parms);
|
frame_parms);
|
||||||
} else {
|
} else {
|
||||||
pdcch_extract_rbs_single(common_vars->rxdataF,
|
pdcch_extract_rbs_single(common_vars->common_vars_rx_data_per_thread[subframe&0x1].rxdataF,
|
||||||
common_vars->dl_ch_estimates[eNB_id],
|
common_vars->common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id],
|
||||||
pdcch_vars[eNB_id]->rxdataF_ext,
|
pdcch_vars[eNB_id]->rxdataF_ext,
|
||||||
pdcch_vars[eNB_id]->dl_ch_estimates_ext,
|
pdcch_vars[eNB_id]->dl_ch_estimates_ext,
|
||||||
s,
|
s,
|
||||||
@@ -1754,7 +1756,10 @@ int32_t rx_pdcch(LTE_UE_COMMON *common_vars,
|
|||||||
LOG_I(PHY,"subframe %d: pdcch log2_maxh = %d (%d,%d)\n",subframe,log2_maxh,avgP[0],avgs);
|
LOG_I(PHY,"subframe %d: pdcch log2_maxh = %d (%d,%d)\n",subframe,log2_maxh,avgP[0],avgs);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if T_TRACER
|
||||||
|
T(T_UE_PHY_PDCCH_ENERGY, T_INT(eNB_id), T_INT(0), T_INT(frame%1024), T_INT(subframe),
|
||||||
|
T_INT(avgP[0]), T_INT(avgP[1]), T_INT(avgP[2]), T_INT(avgP[3]));
|
||||||
|
#endif
|
||||||
for (s=0; s<n_pdcch_symbols; s++) {
|
for (s=0; s<n_pdcch_symbols; s++) {
|
||||||
pdcch_channel_compensation(pdcch_vars[eNB_id]->rxdataF_ext,
|
pdcch_channel_compensation(pdcch_vars[eNB_id]->rxdataF_ext,
|
||||||
pdcch_vars[eNB_id]->dl_ch_estimates_ext,
|
pdcch_vars[eNB_id]->dl_ch_estimates_ext,
|
||||||
@@ -1851,6 +1856,7 @@ int32_t rx_pdcch(LTE_UE_COMMON *common_vars,
|
|||||||
/*#ifdef DEBUG_PHY
|
/*#ifdef DEBUG_PHY
|
||||||
write_output("llr8_seq.m","llr8",&pdcch_vars[eNB_id]->llr[s*frame_parms->N_RB_DL*12],frame_parms->N_RB_DL*12,1,4);
|
write_output("llr8_seq.m","llr8",&pdcch_vars[eNB_id]->llr[s*frame_parms->N_RB_DL*12],frame_parms->N_RB_DL*12,1,4);
|
||||||
#endif*/
|
#endif*/
|
||||||
|
|
||||||
#ifdef MU_RECEIVER
|
#ifdef MU_RECEIVER
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1858,6 +1864,12 @@ int32_t rx_pdcch(LTE_UE_COMMON *common_vars,
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if T_TRACER
|
||||||
|
T(T_UE_PHY_PDCCH_IQ, T_INT(frame_parms->N_RB_DL), T_INT(frame_parms->N_RB_DL),
|
||||||
|
T_INT(n_pdcch_symbols),
|
||||||
|
T_BUFFER(pdcch_vars[eNB_id]->rxdataF_comp, frame_parms->N_RB_DL*12*n_pdcch_symbols* 4));
|
||||||
|
#endif
|
||||||
|
|
||||||
// decode pcfich here
|
// decode pcfich here
|
||||||
n_pdcch_symbols = rx_pcfich(frame_parms,
|
n_pdcch_symbols = rx_pcfich(frame_parms,
|
||||||
subframe,
|
subframe,
|
||||||
@@ -2651,6 +2663,7 @@ int get_nCCE_offset_l1(int *CCE_table,
|
|||||||
|
|
||||||
void dci_decoding_procedure0(LTE_UE_PDCCH **pdcch_vars,
|
void dci_decoding_procedure0(LTE_UE_PDCCH **pdcch_vars,
|
||||||
int do_common,
|
int do_common,
|
||||||
|
dci_detect_mode_t mode,
|
||||||
uint8_t subframe,
|
uint8_t subframe,
|
||||||
DCI_ALLOC_t *dci_alloc,
|
DCI_ALLOC_t *dci_alloc,
|
||||||
int16_t eNB_id,
|
int16_t eNB_id,
|
||||||
@@ -2692,6 +2705,11 @@ void dci_decoding_procedure0(LTE_UE_PDCCH **pdcch_vars,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (mode == NO_DCI) {
|
||||||
|
LOG_D(PHY, "skip DCI decoding: expect no DCIs at subframe %d\n", subframe);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (do_common == 1) {
|
if (do_common == 1) {
|
||||||
nb_candidates = (L2==4) ? 4 : 2;
|
nb_candidates = (L2==4) ? 4 : 2;
|
||||||
Yk=0;
|
Yk=0;
|
||||||
@@ -2842,7 +2860,7 @@ void dci_decoding_procedure0(LTE_UE_PDCCH **pdcch_vars,
|
|||||||
*dci_cnt = *dci_cnt+1;
|
*dci_cnt = *dci_cnt+1;
|
||||||
} else if (crc==pdcch_vars[eNB_id]->crnti) {
|
} else if (crc==pdcch_vars[eNB_id]->crnti) {
|
||||||
|
|
||||||
if ((format_c == format0)&&((dci_decoded_output[0]&0x80)==0)) {// check if pdu is format 0 or 1A
|
if ((mode&UL_DCI)&&(format_c == format0)&&((dci_decoded_output[0]&0x80)==0)) {// check if pdu is format 0 or 1A
|
||||||
if (*format0_found == 0) {
|
if (*format0_found == 0) {
|
||||||
dci_alloc[*dci_cnt].format = format0;
|
dci_alloc[*dci_cnt].format = format0;
|
||||||
*format0_found = 1;
|
*format0_found = 1;
|
||||||
@@ -2923,6 +2941,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
|
|||||||
uint8_t format1_size_bits=0,format1_size_bytes=0;
|
uint8_t format1_size_bits=0,format1_size_bytes=0;
|
||||||
uint8_t format2_size_bits=0,format2_size_bytes=0;
|
uint8_t format2_size_bits=0,format2_size_bytes=0;
|
||||||
uint8_t format2A_size_bits=0,format2A_size_bytes=0;
|
uint8_t format2A_size_bits=0,format2A_size_bytes=0;
|
||||||
|
dci_detect_mode_t mode = dci_detect_mode_select(&ue->frame_parms,subframe);
|
||||||
|
|
||||||
switch (frame_parms->N_RB_DL) {
|
switch (frame_parms->N_RB_DL) {
|
||||||
case 6:
|
case 6:
|
||||||
@@ -3125,7 +3144,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
|
|||||||
|
|
||||||
// First check common search spaces at aggregation 4 (SI_RNTI, P_RNTI and RA_RNTI format 0/1A),
|
// First check common search spaces at aggregation 4 (SI_RNTI, P_RNTI and RA_RNTI format 0/1A),
|
||||||
// and UE_SPEC format0 (PUSCH) too while we're at it
|
// and UE_SPEC format0 (PUSCH) too while we're at it
|
||||||
dci_decoding_procedure0(pdcch_vars,1,subframe,
|
dci_decoding_procedure0(pdcch_vars,1,mode,subframe,
|
||||||
dci_alloc,
|
dci_alloc,
|
||||||
eNB_id,
|
eNB_id,
|
||||||
frame_parms,
|
frame_parms,
|
||||||
@@ -3153,7 +3172,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
|
|||||||
|
|
||||||
// Now check common search spaces at aggregation 4 (SI_RNTI,P_RNTI and RA_RNTI and C-RNTI format 1C),
|
// Now check common search spaces at aggregation 4 (SI_RNTI,P_RNTI and RA_RNTI and C-RNTI format 1C),
|
||||||
// and UE_SPEC format0 (PUSCH) too while we're at it
|
// and UE_SPEC format0 (PUSCH) too while we're at it
|
||||||
dci_decoding_procedure0(pdcch_vars,1,subframe,
|
dci_decoding_procedure0(pdcch_vars,1,mode,subframe,
|
||||||
dci_alloc,
|
dci_alloc,
|
||||||
eNB_id,
|
eNB_id,
|
||||||
frame_parms,
|
frame_parms,
|
||||||
@@ -3185,7 +3204,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
|
|||||||
#ifdef DEBUG_DCI_DECODING
|
#ifdef DEBUG_DCI_DECODING
|
||||||
printf("[DCI search] doing common search/format0 aggregation 8\n");
|
printf("[DCI search] doing common search/format0 aggregation 8\n");
|
||||||
#endif
|
#endif
|
||||||
dci_decoding_procedure0(pdcch_vars,1,subframe,
|
dci_decoding_procedure0(pdcch_vars,1,mode,subframe,
|
||||||
dci_alloc,
|
dci_alloc,
|
||||||
eNB_id,
|
eNB_id,
|
||||||
frame_parms,
|
frame_parms,
|
||||||
@@ -3213,7 +3232,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
|
|||||||
|
|
||||||
// Now check common search spaces at aggregation 8 (SI_RNTI and RA_RNTI and C-RNTI format 1C),
|
// Now check common search spaces at aggregation 8 (SI_RNTI and RA_RNTI and C-RNTI format 1C),
|
||||||
// and UE_SPEC format0 (PUSCH) too while we're at it
|
// and UE_SPEC format0 (PUSCH) too while we're at it
|
||||||
dci_decoding_procedure0(pdcch_vars,1,subframe,
|
dci_decoding_procedure0(pdcch_vars,1,mode,subframe,
|
||||||
dci_alloc,
|
dci_alloc,
|
||||||
eNB_id,
|
eNB_id,
|
||||||
frame_parms,
|
frame_parms,
|
||||||
@@ -3246,7 +3265,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
|
|||||||
|
|
||||||
// Now check UE_SPEC format0/1A ue_spec search spaces at aggregation 8
|
// Now check UE_SPEC format0/1A ue_spec search spaces at aggregation 8
|
||||||
// printf("[DCI search] Format 0/1A aggregation 8\n");
|
// printf("[DCI search] Format 0/1A aggregation 8\n");
|
||||||
dci_decoding_procedure0(pdcch_vars,0,
|
dci_decoding_procedure0(pdcch_vars,0,mode,
|
||||||
subframe,
|
subframe,
|
||||||
dci_alloc,
|
dci_alloc,
|
||||||
eNB_id,
|
eNB_id,
|
||||||
@@ -3275,7 +3294,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
|
|||||||
|
|
||||||
// printf("[DCI search] Format 0 aggregation 4\n");
|
// printf("[DCI search] Format 0 aggregation 4\n");
|
||||||
// Now check UE_SPEC format 0 search spaces at aggregation 4
|
// Now check UE_SPEC format 0 search spaces at aggregation 4
|
||||||
dci_decoding_procedure0(pdcch_vars,0,
|
dci_decoding_procedure0(pdcch_vars,0,mode,
|
||||||
subframe,
|
subframe,
|
||||||
dci_alloc,
|
dci_alloc,
|
||||||
eNB_id,
|
eNB_id,
|
||||||
@@ -3308,7 +3327,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
|
|||||||
|
|
||||||
// printf("[DCI search] Format 0 aggregation 2\n");
|
// printf("[DCI search] Format 0 aggregation 2\n");
|
||||||
// Now check UE_SPEC format 0 search spaces at aggregation 2
|
// Now check UE_SPEC format 0 search spaces at aggregation 2
|
||||||
dci_decoding_procedure0(pdcch_vars,0,
|
dci_decoding_procedure0(pdcch_vars,0,mode,
|
||||||
subframe,
|
subframe,
|
||||||
dci_alloc,
|
dci_alloc,
|
||||||
eNB_id,
|
eNB_id,
|
||||||
@@ -3337,7 +3356,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
|
|||||||
|
|
||||||
// printf("[DCI search] Format 0 aggregation 4\n");
|
// printf("[DCI search] Format 0 aggregation 4\n");
|
||||||
// Now check UE_SPEC format 0 search spaces at aggregation 1
|
// Now check UE_SPEC format 0 search spaces at aggregation 1
|
||||||
dci_decoding_procedure0(pdcch_vars,0,
|
dci_decoding_procedure0(pdcch_vars,0,mode,
|
||||||
subframe,
|
subframe,
|
||||||
dci_alloc,
|
dci_alloc,
|
||||||
eNB_id,
|
eNB_id,
|
||||||
@@ -3371,7 +3390,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
|
|||||||
if ((tmode < 3) || (tmode == 7)) {
|
if ((tmode < 3) || (tmode == 7)) {
|
||||||
// Now check UE_SPEC format 1 search spaces at aggregation 1
|
// Now check UE_SPEC format 1 search spaces at aggregation 1
|
||||||
old_dci_cnt=dci_cnt;
|
old_dci_cnt=dci_cnt;
|
||||||
dci_decoding_procedure0(pdcch_vars,0,subframe,
|
dci_decoding_procedure0(pdcch_vars,0,mode,subframe,
|
||||||
dci_alloc,
|
dci_alloc,
|
||||||
eNB_id,
|
eNB_id,
|
||||||
frame_parms,
|
frame_parms,
|
||||||
@@ -3402,7 +3421,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
|
|||||||
|
|
||||||
// Now check UE_SPEC format 1 search spaces at aggregation 2
|
// Now check UE_SPEC format 1 search spaces at aggregation 2
|
||||||
old_dci_cnt=dci_cnt;
|
old_dci_cnt=dci_cnt;
|
||||||
dci_decoding_procedure0(pdcch_vars,0,subframe,
|
dci_decoding_procedure0(pdcch_vars,0,mode,subframe,
|
||||||
dci_alloc,
|
dci_alloc,
|
||||||
eNB_id,
|
eNB_id,
|
||||||
frame_parms,
|
frame_parms,
|
||||||
@@ -3434,7 +3453,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
|
|||||||
|
|
||||||
// Now check UE_SPEC format 1 search spaces at aggregation 4
|
// Now check UE_SPEC format 1 search spaces at aggregation 4
|
||||||
old_dci_cnt=dci_cnt;
|
old_dci_cnt=dci_cnt;
|
||||||
dci_decoding_procedure0(pdcch_vars,0,subframe,
|
dci_decoding_procedure0(pdcch_vars,0,mode,subframe,
|
||||||
dci_alloc,
|
dci_alloc,
|
||||||
eNB_id,
|
eNB_id,
|
||||||
frame_parms,
|
frame_parms,
|
||||||
@@ -3466,7 +3485,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
|
|||||||
//#ifdef ALL_AGGREGATION
|
//#ifdef ALL_AGGREGATION
|
||||||
// Now check UE_SPEC format 1 search spaces at aggregation 8
|
// Now check UE_SPEC format 1 search spaces at aggregation 8
|
||||||
old_dci_cnt=dci_cnt;
|
old_dci_cnt=dci_cnt;
|
||||||
dci_decoding_procedure0(pdcch_vars,0,subframe,
|
dci_decoding_procedure0(pdcch_vars,0,mode,subframe,
|
||||||
dci_alloc,
|
dci_alloc,
|
||||||
eNB_id,
|
eNB_id,
|
||||||
frame_parms,
|
frame_parms,
|
||||||
@@ -3500,7 +3519,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
|
|||||||
|
|
||||||
|
|
||||||
// Now check UE_SPEC format 2A_2A search spaces at aggregation 1
|
// Now check UE_SPEC format 2A_2A search spaces at aggregation 1
|
||||||
dci_decoding_procedure0(pdcch_vars,0,
|
dci_decoding_procedure0(pdcch_vars,0,mode,
|
||||||
subframe,
|
subframe,
|
||||||
dci_alloc,
|
dci_alloc,
|
||||||
eNB_id,
|
eNB_id,
|
||||||
@@ -3531,7 +3550,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
|
|||||||
return(dci_cnt);
|
return(dci_cnt);
|
||||||
|
|
||||||
// Now check UE_SPEC format 2 search spaces at aggregation 2
|
// Now check UE_SPEC format 2 search spaces at aggregation 2
|
||||||
dci_decoding_procedure0(pdcch_vars,0,
|
dci_decoding_procedure0(pdcch_vars,0,mode,
|
||||||
subframe,
|
subframe,
|
||||||
dci_alloc,
|
dci_alloc,
|
||||||
eNB_id,
|
eNB_id,
|
||||||
@@ -3562,7 +3581,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
|
|||||||
return(dci_cnt);
|
return(dci_cnt);
|
||||||
|
|
||||||
// Now check UE_SPEC format 2_2A search spaces at aggregation 4
|
// Now check UE_SPEC format 2_2A search spaces at aggregation 4
|
||||||
dci_decoding_procedure0(pdcch_vars,0,
|
dci_decoding_procedure0(pdcch_vars,0,mode,
|
||||||
subframe,
|
subframe,
|
||||||
dci_alloc,
|
dci_alloc,
|
||||||
eNB_id,
|
eNB_id,
|
||||||
@@ -3594,7 +3613,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
|
|||||||
|
|
||||||
//#ifdef ALL_AGGREGATION
|
//#ifdef ALL_AGGREGATION
|
||||||
// Now check UE_SPEC format 2_2A search spaces at aggregation 8
|
// Now check UE_SPEC format 2_2A search spaces at aggregation 8
|
||||||
dci_decoding_procedure0(pdcch_vars,0,
|
dci_decoding_procedure0(pdcch_vars,0,mode,
|
||||||
subframe,
|
subframe,
|
||||||
dci_alloc,
|
dci_alloc,
|
||||||
eNB_id,
|
eNB_id,
|
||||||
@@ -3620,7 +3639,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
|
|||||||
} else if (tmode == 4) {
|
} else if (tmode == 4) {
|
||||||
|
|
||||||
// Now check UE_SPEC format 2_2A search spaces at aggregation 1
|
// Now check UE_SPEC format 2_2A search spaces at aggregation 1
|
||||||
dci_decoding_procedure0(pdcch_vars,0,
|
dci_decoding_procedure0(pdcch_vars,0,mode,
|
||||||
subframe,
|
subframe,
|
||||||
dci_alloc,
|
dci_alloc,
|
||||||
eNB_id,
|
eNB_id,
|
||||||
@@ -3651,7 +3670,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
|
|||||||
return(dci_cnt);
|
return(dci_cnt);
|
||||||
|
|
||||||
// Now check UE_SPEC format 2 search spaces at aggregation 2
|
// Now check UE_SPEC format 2 search spaces at aggregation 2
|
||||||
dci_decoding_procedure0(pdcch_vars,0,
|
dci_decoding_procedure0(pdcch_vars,0,mode,
|
||||||
subframe,
|
subframe,
|
||||||
dci_alloc,
|
dci_alloc,
|
||||||
eNB_id,
|
eNB_id,
|
||||||
@@ -3682,7 +3701,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
|
|||||||
return(dci_cnt);
|
return(dci_cnt);
|
||||||
|
|
||||||
// Now check UE_SPEC format 2_2A search spaces at aggregation 4
|
// Now check UE_SPEC format 2_2A search spaces at aggregation 4
|
||||||
dci_decoding_procedure0(pdcch_vars,0,
|
dci_decoding_procedure0(pdcch_vars,0,mode,
|
||||||
subframe,
|
subframe,
|
||||||
dci_alloc,
|
dci_alloc,
|
||||||
eNB_id,
|
eNB_id,
|
||||||
@@ -3714,7 +3733,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
|
|||||||
|
|
||||||
//#ifdef ALL_AGGREGATION
|
//#ifdef ALL_AGGREGATION
|
||||||
// Now check UE_SPEC format 2_2A search spaces at aggregation 8
|
// Now check UE_SPEC format 2_2A search spaces at aggregation 8
|
||||||
dci_decoding_procedure0(pdcch_vars,0,
|
dci_decoding_procedure0(pdcch_vars,0,mode,
|
||||||
subframe,
|
subframe,
|
||||||
dci_alloc,
|
dci_alloc,
|
||||||
eNB_id,
|
eNB_id,
|
||||||
@@ -3743,7 +3762,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
|
|||||||
#ifdef DEBUG_DCI_DECODING
|
#ifdef DEBUG_DCI_DECODING
|
||||||
LOG_I(PHY," MU-MIMO check UE_SPEC format 1E_2A_M10PRB\n");
|
LOG_I(PHY," MU-MIMO check UE_SPEC format 1E_2A_M10PRB\n");
|
||||||
#endif
|
#endif
|
||||||
dci_decoding_procedure0(pdcch_vars,0,
|
dci_decoding_procedure0(pdcch_vars,0,mode,
|
||||||
subframe,
|
subframe,
|
||||||
dci_alloc,
|
dci_alloc,
|
||||||
eNB_id,
|
eNB_id,
|
||||||
@@ -3775,7 +3794,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
|
|||||||
return(dci_cnt);
|
return(dci_cnt);
|
||||||
|
|
||||||
// Now check UE_SPEC format 1E_2A_M10PRB search spaces aggregation 2
|
// Now check UE_SPEC format 1E_2A_M10PRB search spaces aggregation 2
|
||||||
dci_decoding_procedure0(pdcch_vars,0,
|
dci_decoding_procedure0(pdcch_vars,0,mode,
|
||||||
subframe,
|
subframe,
|
||||||
dci_alloc,
|
dci_alloc,
|
||||||
eNB_id,
|
eNB_id,
|
||||||
@@ -3806,7 +3825,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
|
|||||||
return(dci_cnt);
|
return(dci_cnt);
|
||||||
|
|
||||||
// Now check UE_SPEC format 1E_2A_M10PRB search spaces aggregation 4
|
// Now check UE_SPEC format 1E_2A_M10PRB search spaces aggregation 4
|
||||||
dci_decoding_procedure0(pdcch_vars,0,
|
dci_decoding_procedure0(pdcch_vars,0,mode,
|
||||||
subframe,
|
subframe,
|
||||||
dci_alloc,
|
dci_alloc,
|
||||||
eNB_id,
|
eNB_id,
|
||||||
@@ -3839,7 +3858,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
|
|||||||
//#ifdef ALL_AGGREGATION
|
//#ifdef ALL_AGGREGATION
|
||||||
|
|
||||||
// Now check UE_SPEC format 1E_2A_M10PRB search spaces at aggregation 8
|
// Now check UE_SPEC format 1E_2A_M10PRB search spaces at aggregation 8
|
||||||
dci_decoding_procedure0(pdcch_vars,0,
|
dci_decoding_procedure0(pdcch_vars,0,mode,
|
||||||
subframe,
|
subframe,
|
||||||
dci_alloc,
|
dci_alloc,
|
||||||
eNB_id,
|
eNB_id,
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -675,12 +675,16 @@ typedef struct {
|
|||||||
typedef struct {
|
typedef struct {
|
||||||
/// HARQ process id
|
/// HARQ process id
|
||||||
uint8_t harq_id;
|
uint8_t harq_id;
|
||||||
/// ACK bits (after decoding)
|
/// ACK bits (after decoding) 0:NACK / 1:ACK / 2:DTX
|
||||||
uint8_t ack;
|
uint8_t ack;
|
||||||
/// send status (for PUCCH)
|
/// send status (for PUCCH)
|
||||||
uint8_t send_harq_status;
|
uint8_t send_harq_status;
|
||||||
/// nCCE (for PUCCH)
|
/// nCCE (for PUCCH)
|
||||||
uint8_t nCCE;
|
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;
|
} harq_status_t;
|
||||||
|
|
||||||
typedef struct {
|
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;
|
unsigned char exit_flag = 0,i,j,r,aa,layer;
|
||||||
int re;
|
int re;
|
||||||
unsigned char bw_scaling =1;
|
unsigned char bw_scaling =1;
|
||||||
uint8_t nb_antennas_tx = frame_parms->nb_antennas_tx;
|
|
||||||
|
|
||||||
switch (N_RB_DL) {
|
switch (N_RB_DL) {
|
||||||
case 6:
|
case 6:
|
||||||
|
|||||||
@@ -159,6 +159,7 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue,
|
|||||||
LTE_DL_FRAME_PARMS *frame_parms,
|
LTE_DL_FRAME_PARMS *frame_parms,
|
||||||
LTE_UE_DLSCH_t *dlsch,
|
LTE_UE_DLSCH_t *dlsch,
|
||||||
LTE_DL_UE_HARQ_t *harq_process,
|
LTE_DL_UE_HARQ_t *harq_process,
|
||||||
|
uint8_t frame,
|
||||||
uint8_t subframe,
|
uint8_t subframe,
|
||||||
uint8_t harq_pid,
|
uint8_t harq_pid,
|
||||||
uint8_t is_crnti,
|
uint8_t is_crnti,
|
||||||
@@ -241,6 +242,11 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue,
|
|||||||
return(dlsch->max_turbo_iterations);
|
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) {
|
if (llr8_flag == 0) {
|
||||||
//#ifdef __AVX2__
|
//#ifdef __AVX2__
|
||||||
#if 0
|
#if 0
|
||||||
@@ -609,10 +615,20 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue,
|
|||||||
//printf("CRC failed, segment %d\n",r);
|
//printf("CRC failed, segment %d\n",r);
|
||||||
err_flag = 1;
|
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) {
|
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].ack = 0;
|
||||||
dlsch->harq_ack[subframe].harq_id = harq_pid;
|
dlsch->harq_ack[subframe].harq_id = harq_pid;
|
||||||
dlsch->harq_ack[subframe].send_harq_status = 1;
|
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));
|
return((1+dlsch->max_turbo_iterations));
|
||||||
} else {
|
} 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->status = SCH_IDLE;
|
||||||
harq_process->round = 0;
|
harq_process->round = 0;
|
||||||
dlsch->harq_ack[subframe].ack = 1;
|
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, 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 "defs.h"
|
||||||
#include "extern.h"
|
#include "extern.h"
|
||||||
#include "PHY/sse_intrin.h"
|
#include "PHY/sse_intrin.h"
|
||||||
|
#include "T.h"
|
||||||
|
|
||||||
#ifndef USER_MODE
|
#ifndef USER_MODE
|
||||||
#define NOCYGWIN_STATIC static
|
#define NOCYGWIN_STATIC static
|
||||||
@@ -74,6 +74,7 @@ int rx_pdsch(PHY_VARS_UE *ue,
|
|||||||
PDSCH_t type,
|
PDSCH_t type,
|
||||||
unsigned char eNB_id,
|
unsigned char eNB_id,
|
||||||
unsigned char eNB_id_i, //if this == ue->n_connected_eNB, we assume MU interference
|
unsigned char eNB_id_i, //if this == ue->n_connected_eNB, we assume MU interference
|
||||||
|
uint32_t frame,
|
||||||
uint8_t subframe,
|
uint8_t subframe,
|
||||||
unsigned char symbol,
|
unsigned char symbol,
|
||||||
unsigned char first_symbol_flag,
|
unsigned char first_symbol_flag,
|
||||||
@@ -112,7 +113,7 @@ int rx_pdsch(PHY_VARS_UE *ue,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case PDSCH:
|
case PDSCH:
|
||||||
pdsch_vars = &ue->pdsch_vars[eNB_id];
|
pdsch_vars = &ue->pdsch_vars[subframe&0x1][eNB_id];
|
||||||
dlsch = ue->dlsch[eNB_id];
|
dlsch = ue->dlsch[eNB_id];
|
||||||
dlsch0_harq = dlsch[0]->harq_processes[harq_pid];
|
dlsch0_harq = dlsch[0]->harq_processes[harq_pid];
|
||||||
dlsch1_harq = dlsch[1]->harq_processes[harq_pid];
|
dlsch1_harq = dlsch[1]->harq_processes[harq_pid];
|
||||||
@@ -120,7 +121,7 @@ int rx_pdsch(PHY_VARS_UE *ue,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
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);
|
return(-1);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -162,8 +163,8 @@ int rx_pdsch(PHY_VARS_UE *ue,
|
|||||||
#ifdef DEBUG_DLSCH_MOD
|
#ifdef DEBUG_DLSCH_MOD
|
||||||
LOG_I(PHY,"dlsch: using pmi %x (%p), rb_alloc %x\n",pmi2hex_2Ar1(dlsch0_harq->pmi_alloc),dlsch[0],dlsch0_harq->rb_alloc_even[0]);
|
LOG_I(PHY,"dlsch: using pmi %x (%p), rb_alloc %x\n",pmi2hex_2Ar1(dlsch0_harq->pmi_alloc),dlsch[0],dlsch0_harq->rb_alloc_even[0]);
|
||||||
#endif
|
#endif
|
||||||
nb_rb = dlsch_extract_rbs_dual(common_vars->rxdataF,
|
nb_rb = dlsch_extract_rbs_dual(common_vars->common_vars_rx_data_per_thread[subframe&0x1].rxdataF,
|
||||||
common_vars->dl_ch_estimates[eNB_id],
|
common_vars->common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id],
|
||||||
pdsch_vars[eNB_id]->rxdataF_ext,
|
pdsch_vars[eNB_id]->rxdataF_ext,
|
||||||
pdsch_vars[eNB_id]->dl_ch_estimates_ext,
|
pdsch_vars[eNB_id]->dl_ch_estimates_ext,
|
||||||
dlsch0_harq->pmi_alloc,
|
dlsch0_harq->pmi_alloc,
|
||||||
@@ -176,8 +177,8 @@ int rx_pdsch(PHY_VARS_UE *ue,
|
|||||||
|
|
||||||
if (dual_stream_flag==1) {
|
if (dual_stream_flag==1) {
|
||||||
if (eNB_id_i<ue->n_connected_eNB)
|
if (eNB_id_i<ue->n_connected_eNB)
|
||||||
nb_rb = dlsch_extract_rbs_dual(common_vars->rxdataF,
|
nb_rb = dlsch_extract_rbs_dual(common_vars->common_vars_rx_data_per_thread[subframe&0x1].rxdataF,
|
||||||
common_vars->dl_ch_estimates[eNB_id_i],
|
common_vars->common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id_i],
|
||||||
pdsch_vars[eNB_id_i]->rxdataF_ext,
|
pdsch_vars[eNB_id_i]->rxdataF_ext,
|
||||||
pdsch_vars[eNB_id_i]->dl_ch_estimates_ext,
|
pdsch_vars[eNB_id_i]->dl_ch_estimates_ext,
|
||||||
dlsch0_harq->pmi_alloc,
|
dlsch0_harq->pmi_alloc,
|
||||||
@@ -188,8 +189,8 @@ int rx_pdsch(PHY_VARS_UE *ue,
|
|||||||
ue->high_speed_flag,
|
ue->high_speed_flag,
|
||||||
frame_parms);
|
frame_parms);
|
||||||
else
|
else
|
||||||
nb_rb = dlsch_extract_rbs_dual(common_vars->rxdataF,
|
nb_rb = dlsch_extract_rbs_dual(common_vars->common_vars_rx_data_per_thread[subframe&0x1].rxdataF,
|
||||||
common_vars->dl_ch_estimates[eNB_id],
|
common_vars->common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id],
|
||||||
pdsch_vars[eNB_id_i]->rxdataF_ext,
|
pdsch_vars[eNB_id_i]->rxdataF_ext,
|
||||||
pdsch_vars[eNB_id_i]->dl_ch_estimates_ext,
|
pdsch_vars[eNB_id_i]->dl_ch_estimates_ext,
|
||||||
dlsch0_harq->pmi_alloc,
|
dlsch0_harq->pmi_alloc,
|
||||||
@@ -201,8 +202,8 @@ int rx_pdsch(PHY_VARS_UE *ue,
|
|||||||
frame_parms);
|
frame_parms);
|
||||||
}
|
}
|
||||||
} else if (beamforming_mode==0) { //else if nb_antennas_ports_eNB==1 && beamforming_mode == 0
|
} else if (beamforming_mode==0) { //else if nb_antennas_ports_eNB==1 && beamforming_mode == 0
|
||||||
nb_rb = dlsch_extract_rbs_single(common_vars->rxdataF,
|
nb_rb = dlsch_extract_rbs_single(common_vars->common_vars_rx_data_per_thread[subframe&0x1].rxdataF,
|
||||||
common_vars->dl_ch_estimates[eNB_id],
|
common_vars->common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id],
|
||||||
pdsch_vars[eNB_id]->rxdataF_ext,
|
pdsch_vars[eNB_id]->rxdataF_ext,
|
||||||
pdsch_vars[eNB_id]->dl_ch_estimates_ext,
|
pdsch_vars[eNB_id]->dl_ch_estimates_ext,
|
||||||
dlsch0_harq->pmi_alloc,
|
dlsch0_harq->pmi_alloc,
|
||||||
@@ -215,8 +216,8 @@ int rx_pdsch(PHY_VARS_UE *ue,
|
|||||||
|
|
||||||
if (dual_stream_flag==1) {
|
if (dual_stream_flag==1) {
|
||||||
if (eNB_id_i<ue->n_connected_eNB)
|
if (eNB_id_i<ue->n_connected_eNB)
|
||||||
nb_rb = dlsch_extract_rbs_single(common_vars->rxdataF,
|
nb_rb = dlsch_extract_rbs_single(common_vars->common_vars_rx_data_per_thread[subframe&0x1].rxdataF,
|
||||||
common_vars->dl_ch_estimates[eNB_id_i],
|
common_vars->common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id_i],
|
||||||
pdsch_vars[eNB_id_i]->rxdataF_ext,
|
pdsch_vars[eNB_id_i]->rxdataF_ext,
|
||||||
pdsch_vars[eNB_id_i]->dl_ch_estimates_ext,
|
pdsch_vars[eNB_id_i]->dl_ch_estimates_ext,
|
||||||
dlsch0_harq->pmi_alloc,
|
dlsch0_harq->pmi_alloc,
|
||||||
@@ -227,8 +228,8 @@ int rx_pdsch(PHY_VARS_UE *ue,
|
|||||||
ue->high_speed_flag,
|
ue->high_speed_flag,
|
||||||
frame_parms);
|
frame_parms);
|
||||||
|
|
||||||
nb_rb = dlsch_extract_rbs_single(common_vars->rxdataF,
|
nb_rb = dlsch_extract_rbs_single(common_vars->common_vars_rx_data_per_thread[subframe&0x1].rxdataF,
|
||||||
common_vars->dl_ch_estimates[eNB_id],
|
common_vars->common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id],
|
||||||
pdsch_vars[eNB_id_i]->rxdataF_ext,
|
pdsch_vars[eNB_id_i]->rxdataF_ext,
|
||||||
pdsch_vars[eNB_id_i]->dl_ch_estimates_ext,
|
pdsch_vars[eNB_id_i]->dl_ch_estimates_ext,
|
||||||
dlsch0_harq->pmi_alloc,
|
dlsch0_harq->pmi_alloc,
|
||||||
@@ -240,7 +241,7 @@ int rx_pdsch(PHY_VARS_UE *ue,
|
|||||||
frame_parms);
|
frame_parms);
|
||||||
}
|
}
|
||||||
} else if (beamforming_mode==7) { //else if beamforming_mode == 7
|
} else if (beamforming_mode==7) { //else if beamforming_mode == 7
|
||||||
nb_rb = dlsch_extract_rbs_TM7(common_vars->rxdataF,
|
nb_rb = dlsch_extract_rbs_TM7(common_vars->common_vars_rx_data_per_thread[subframe&0x1].rxdataF,
|
||||||
pdsch_vars[eNB_id]->dl_bf_ch_estimates,
|
pdsch_vars[eNB_id]->dl_bf_ch_estimates,
|
||||||
pdsch_vars[eNB_id]->rxdataF_ext,
|
pdsch_vars[eNB_id]->rxdataF_ext,
|
||||||
pdsch_vars[eNB_id]->dl_bf_ch_estimates_ext,
|
pdsch_vars[eNB_id]->dl_bf_ch_estimates_ext,
|
||||||
@@ -297,6 +298,13 @@ int rx_pdsch(PHY_VARS_UE *ue,
|
|||||||
|
|
||||||
// avgs = cmax(avgs,avg[(aarx<<1)+aatx]);
|
// 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;
|
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
|
// + 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);
|
return(-1);
|
||||||
break;
|
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);
|
return(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -5144,7 +5161,7 @@ unsigned short dlsch_extract_rbs_TM7(int **rxdataF,
|
|||||||
|
|
||||||
#ifdef USER_MODE
|
#ifdef USER_MODE
|
||||||
|
|
||||||
void dump_dlsch2(PHY_VARS_UE *ue,uint8_t eNB_id,uint16_t coded_bits_per_codeword,int round)
|
void dump_dlsch2(PHY_VARS_UE *ue,uint8_t eNB_id,uint8_t subframe,uint16_t coded_bits_per_codeword,int round)
|
||||||
{
|
{
|
||||||
|
|
||||||
unsigned int nsymb = (ue->frame_parms.Ncp == 0) ? 14 : 12;
|
unsigned int nsymb = (ue->frame_parms.Ncp == 0) ? 14 : 12;
|
||||||
@@ -5153,50 +5170,50 @@ void dump_dlsch2(PHY_VARS_UE *ue,uint8_t eNB_id,uint16_t coded_bits_per_codeword
|
|||||||
|
|
||||||
sprintf(fname,"dlsch%d_rxF_r%d_ext0.m",eNB_id,round);
|
sprintf(fname,"dlsch%d_rxF_r%d_ext0.m",eNB_id,round);
|
||||||
sprintf(vname,"dl%d_rxF_r%d_ext0",eNB_id,round);
|
sprintf(vname,"dl%d_rxF_r%d_ext0",eNB_id,round);
|
||||||
write_output(fname,vname,ue->pdsch_vars[eNB_id]->rxdataF_ext[0],12*N_RB_DL*nsymb,1,1);
|
write_output(fname,vname,ue->pdsch_vars[subframe&0x1][eNB_id]->rxdataF_ext[0],12*N_RB_DL*nsymb,1,1);
|
||||||
|
|
||||||
if (ue->frame_parms.nb_antennas_rx >1) {
|
if (ue->frame_parms.nb_antennas_rx >1) {
|
||||||
sprintf(fname,"dlsch%d_rxF_r%d_ext1.m",eNB_id,round);
|
sprintf(fname,"dlsch%d_rxF_r%d_ext1.m",eNB_id,round);
|
||||||
sprintf(vname,"dl%d_rxF_r%d_ext1",eNB_id,round);
|
sprintf(vname,"dl%d_rxF_r%d_ext1",eNB_id,round);
|
||||||
write_output(fname,vname,ue->pdsch_vars[eNB_id]->rxdataF_ext[1],12*N_RB_DL*nsymb,1,1);
|
write_output(fname,vname,ue->pdsch_vars[subframe&0x1][eNB_id]->rxdataF_ext[1],12*N_RB_DL*nsymb,1,1);
|
||||||
}
|
}
|
||||||
|
|
||||||
sprintf(fname,"dlsch%d_ch_r%d_ext00.m",eNB_id,round);
|
sprintf(fname,"dlsch%d_ch_r%d_ext00.m",eNB_id,round);
|
||||||
sprintf(vname,"dl%d_ch_r%d_ext00",eNB_id,round);
|
sprintf(vname,"dl%d_ch_r%d_ext00",eNB_id,round);
|
||||||
write_output(fname,vname,ue->pdsch_vars[eNB_id]->dl_ch_estimates_ext[0],12*N_RB_DL*nsymb,1,1);
|
write_output(fname,vname,ue->pdsch_vars[subframe&0x1][eNB_id]->dl_ch_estimates_ext[0],12*N_RB_DL*nsymb,1,1);
|
||||||
|
|
||||||
if (ue->transmission_mode[eNB_id]==7){
|
if (ue->transmission_mode[eNB_id]==7){
|
||||||
sprintf(fname,"dlsch%d_bf_ch_r%d.m",eNB_id,round);
|
sprintf(fname,"dlsch%d_bf_ch_r%d.m",eNB_id,round);
|
||||||
sprintf(vname,"dl%d_bf_ch_r%d",eNB_id,round);
|
sprintf(vname,"dl%d_bf_ch_r%d",eNB_id,round);
|
||||||
write_output(fname,vname,ue->pdsch_vars[eNB_id]->dl_bf_ch_estimates[0],512*nsymb,1,1);
|
write_output(fname,vname,ue->pdsch_vars[subframe&0x1][eNB_id]->dl_bf_ch_estimates[0],512*nsymb,1,1);
|
||||||
//write_output(fname,vname,phy_vars_ue->lte_ue_pdsch_vars[eNB_id]->dl_bf_ch_estimates[0],512,1,1);
|
//write_output(fname,vname,phy_vars_ue->lte_ue_pdsch_vars[eNB_id]->dl_bf_ch_estimates[0],512,1,1);
|
||||||
|
|
||||||
sprintf(fname,"dlsch%d_bf_ch_r%d_ext00.m",eNB_id,round);
|
sprintf(fname,"dlsch%d_bf_ch_r%d_ext00.m",eNB_id,round);
|
||||||
sprintf(vname,"dl%d_bf_ch_r%d_ext00",eNB_id,round);
|
sprintf(vname,"dl%d_bf_ch_r%d_ext00",eNB_id,round);
|
||||||
write_output(fname,vname,ue->pdsch_vars[eNB_id]->dl_bf_ch_estimates_ext[0],12*N_RB_DL*nsymb,1,1);
|
write_output(fname,vname,ue->pdsch_vars[subframe&0x1][eNB_id]->dl_bf_ch_estimates_ext[0],12*N_RB_DL*nsymb,1,1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ue->frame_parms.nb_antennas_rx == 2) {
|
if (ue->frame_parms.nb_antennas_rx == 2) {
|
||||||
sprintf(fname,"dlsch%d_ch_r%d_ext01.m",eNB_id,round);
|
sprintf(fname,"dlsch%d_ch_r%d_ext01.m",eNB_id,round);
|
||||||
sprintf(vname,"dl%d_ch_r%d_ext01",eNB_id,round);
|
sprintf(vname,"dl%d_ch_r%d_ext01",eNB_id,round);
|
||||||
write_output(fname,vname,ue->pdsch_vars[eNB_id]->dl_ch_estimates_ext[1],12*N_RB_DL*nsymb,1,1);
|
write_output(fname,vname,ue->pdsch_vars[subframe&0x1][eNB_id]->dl_ch_estimates_ext[1],12*N_RB_DL*nsymb,1,1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ue->frame_parms.nb_antenna_ports_eNB == 2) {
|
if (ue->frame_parms.nb_antenna_ports_eNB == 2) {
|
||||||
sprintf(fname,"dlsch%d_ch_r%d_ext10.m",eNB_id,round);
|
sprintf(fname,"dlsch%d_ch_r%d_ext10.m",eNB_id,round);
|
||||||
sprintf(vname,"dl%d_ch_r%d_ext10",eNB_id,round);
|
sprintf(vname,"dl%d_ch_r%d_ext10",eNB_id,round);
|
||||||
write_output(fname,vname,ue->pdsch_vars[eNB_id]->dl_ch_estimates_ext[2],12*N_RB_DL*nsymb,1,1);
|
write_output(fname,vname,ue->pdsch_vars[subframe&0x1][eNB_id]->dl_ch_estimates_ext[2],12*N_RB_DL*nsymb,1,1);
|
||||||
|
|
||||||
if (ue->frame_parms.nb_antennas_rx == 2) {
|
if (ue->frame_parms.nb_antennas_rx == 2) {
|
||||||
sprintf(fname,"dlsch%d_ch_r%d_ext11.m",eNB_id,round);
|
sprintf(fname,"dlsch%d_ch_r%d_ext11.m",eNB_id,round);
|
||||||
sprintf(vname,"dl%d_ch_r%d_ext11",eNB_id,round);
|
sprintf(vname,"dl%d_ch_r%d_ext11",eNB_id,round);
|
||||||
write_output(fname,vname,ue->pdsch_vars[eNB_id]->dl_ch_estimates_ext[3],12*N_RB_DL*nsymb,1,1);
|
write_output(fname,vname,ue->pdsch_vars[subframe&0x1][eNB_id]->dl_ch_estimates_ext[3],12*N_RB_DL*nsymb,1,1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sprintf(fname,"dlsch%d_rxF_r%d_uespec0.m",eNB_id,round);
|
sprintf(fname,"dlsch%d_rxF_r%d_uespec0.m",eNB_id,round);
|
||||||
sprintf(vname,"dl%d_rxF_r%d_uespec0",eNB_id,round);
|
sprintf(vname,"dl%d_rxF_r%d_uespec0",eNB_id,round);
|
||||||
write_output(fname,vname,ue->pdsch_vars[eNB_id]->rxdataF_uespec_pilots[0],12*N_RB_DL,1,1);
|
write_output(fname,vname,ue->pdsch_vars[subframe&0x1][eNB_id]->rxdataF_uespec_pilots[0],12*N_RB_DL,1,1);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
write_output("dlsch%d_ch_ext01.m","dl01_ch0_ext",pdsch_vars[eNB_id]->dl_ch_estimates_ext[1],12*N_RB_DL*nsymb,1,1);
|
write_output("dlsch%d_ch_ext01.m","dl01_ch0_ext",pdsch_vars[eNB_id]->dl_ch_estimates_ext[1],12*N_RB_DL*nsymb,1,1);
|
||||||
@@ -5205,26 +5222,26 @@ void dump_dlsch2(PHY_VARS_UE *ue,uint8_t eNB_id,uint16_t coded_bits_per_codeword
|
|||||||
*/
|
*/
|
||||||
sprintf(fname,"dlsch%d_r%d_rho.m",eNB_id,round);
|
sprintf(fname,"dlsch%d_r%d_rho.m",eNB_id,round);
|
||||||
sprintf(vname,"dl_rho_r%d_%d",eNB_id,round);
|
sprintf(vname,"dl_rho_r%d_%d",eNB_id,round);
|
||||||
write_output(fname,vname,ue->pdsch_vars[eNB_id]->dl_ch_rho_ext[0],12*N_RB_DL*nsymb,1,1);
|
write_output(fname,vname,ue->pdsch_vars[subframe&0x1][eNB_id]->dl_ch_rho_ext[0],12*N_RB_DL*nsymb,1,1);
|
||||||
|
|
||||||
sprintf(fname,"dlsch%d_rxF_r%d_comp0.m",eNB_id,round);
|
sprintf(fname,"dlsch%d_rxF_r%d_comp0.m",eNB_id,round);
|
||||||
sprintf(vname,"dl%d_rxF_r%d_comp0",eNB_id,round);
|
sprintf(vname,"dl%d_rxF_r%d_comp0",eNB_id,round);
|
||||||
write_output(fname,vname,ue->pdsch_vars[eNB_id]->rxdataF_comp0[0],12*N_RB_DL*nsymb,1,1);
|
write_output(fname,vname,ue->pdsch_vars[subframe&0x1][eNB_id]->rxdataF_comp0[0],12*N_RB_DL*nsymb,1,1);
|
||||||
if (ue->frame_parms.nb_antenna_ports_eNB == 2) {
|
if (ue->frame_parms.nb_antenna_ports_eNB == 2) {
|
||||||
sprintf(fname,"dlsch%d_rxF_r%d_comp1.m",eNB_id,round);
|
sprintf(fname,"dlsch%d_rxF_r%d_comp1.m",eNB_id,round);
|
||||||
sprintf(vname,"dl%d_rxF_r%d_comp1",eNB_id,round);
|
sprintf(vname,"dl%d_rxF_r%d_comp1",eNB_id,round);
|
||||||
write_output(fname,vname,ue->pdsch_vars[eNB_id]->rxdataF_comp1[0][round],12*N_RB_DL*nsymb,1,1);
|
write_output(fname,vname,ue->pdsch_vars[subframe&0x1][eNB_id]->rxdataF_comp1[0][round],12*N_RB_DL*nsymb,1,1);
|
||||||
}
|
}
|
||||||
|
|
||||||
sprintf(fname,"dlsch%d_rxF_r%d_llr.m",eNB_id,round);
|
sprintf(fname,"dlsch%d_rxF_r%d_llr.m",eNB_id,round);
|
||||||
sprintf(vname,"dl%d_r%d_llr",eNB_id,round);
|
sprintf(vname,"dl%d_r%d_llr",eNB_id,round);
|
||||||
write_output(fname,vname, ue->pdsch_vars[eNB_id]->llr[0],coded_bits_per_codeword,1,0);
|
write_output(fname,vname, ue->pdsch_vars[subframe&0x1][eNB_id]->llr[0],coded_bits_per_codeword,1,0);
|
||||||
sprintf(fname,"dlsch%d_r%d_mag1.m",eNB_id,round);
|
sprintf(fname,"dlsch%d_r%d_mag1.m",eNB_id,round);
|
||||||
sprintf(vname,"dl%d_r%d_mag1",eNB_id,round);
|
sprintf(vname,"dl%d_r%d_mag1",eNB_id,round);
|
||||||
write_output(fname,vname,ue->pdsch_vars[eNB_id]->dl_ch_mag0[0],12*N_RB_DL*nsymb,1,1);
|
write_output(fname,vname,ue->pdsch_vars[subframe&0x1][eNB_id]->dl_ch_mag0[0],12*N_RB_DL*nsymb,1,1);
|
||||||
sprintf(fname,"dlsch%d_r%d_mag2.m",eNB_id,round);
|
sprintf(fname,"dlsch%d_r%d_mag2.m",eNB_id,round);
|
||||||
sprintf(vname,"dl%d_r%d_mag2",eNB_id,round);
|
sprintf(vname,"dl%d_r%d_mag2",eNB_id,round);
|
||||||
write_output(fname,vname,ue->pdsch_vars[eNB_id]->dl_ch_magb0[0],12*N_RB_DL*nsymb,1,1);
|
write_output(fname,vname,ue->pdsch_vars[subframe&0x1][eNB_id]->dl_ch_magb0[0],12*N_RB_DL*nsymb,1,1);
|
||||||
|
|
||||||
// printf("log2_maxh = %d\n",ue->pdsch_vars[eNB_id]->log2_maxh);
|
// printf("log2_maxh = %d\n",ue->pdsch_vars[eNB_id]->log2_maxh);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -595,7 +595,7 @@ int allocate_REs_in_RB(PHY_VARS_eNB* phy_vars_eNB,
|
|||||||
|
|
||||||
int use2ndpilots = (frame_parms->mode1_flag==1)?1:0;
|
int use2ndpilots = (frame_parms->mode1_flag==1)?1:0;
|
||||||
|
|
||||||
uint32_t tti_offset,aa;
|
uint32_t tti_offset; //,aa;
|
||||||
uint8_t re;
|
uint8_t re;
|
||||||
uint8_t qam64_table_offset_re = 0;
|
uint8_t qam64_table_offset_re = 0;
|
||||||
uint8_t qam64_table_offset_im = 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;
|
uint16_t next = 0;
|
||||||
uint8_t ns=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;
|
x2 = (32*(uint32_t)(frame_parms->Nid_cell/30)) + fss_pusch;
|
||||||
#ifdef DEBUG_GROUPHOP
|
#ifdef DEBUG_GROUPHOP
|
||||||
|
|||||||
Regular → Executable
+154
-68
@@ -32,16 +32,20 @@
|
|||||||
|
|
||||||
#include "PHY/defs.h"
|
#include "PHY/defs.h"
|
||||||
#include "PHY/TOOLS/alaw_lut.h"
|
#include "PHY/TOOLS/alaw_lut.h"
|
||||||
|
#include "PHY/extern.h"
|
||||||
|
#include "SCHED/defs.h"
|
||||||
|
|
||||||
#include "targets/ARCH/ETHERNET/USERSPACE/LIB/if_defs.h"
|
//#include "targets/ARCH/ETHERNET/USERSPACE/LIB/if_defs.h"
|
||||||
|
#include "targets/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.h"
|
||||||
#include "UTIL/LOG/vcd_signal_dumper.h"
|
#include "UTIL/LOG/vcd_signal_dumper.h"
|
||||||
|
|
||||||
void send_IF4p5(PHY_VARS_eNB *eNB, int frame, int subframe, uint16_t packet_type, int k) {
|
void send_IF4p5(PHY_VARS_eNB *eNB, int frame, int subframe, uint16_t packet_type, int k) {
|
||||||
LTE_DL_FRAME_PARMS *fp = &eNB->frame_parms;
|
LTE_DL_FRAME_PARMS *fp = &eNB->frame_parms;
|
||||||
int32_t **txdataF = eNB->common_vars.txdataF[0];
|
int32_t **txdataF = (eNB->CC_id==0) ? eNB->common_vars.txdataF[0] : PHY_vars_eNB_g[0][0]->common_vars.txdataF[0];
|
||||||
int32_t **rxdataF = eNB->common_vars.rxdataF[0];
|
int32_t **rxdataF = eNB->common_vars.rxdataF[0];
|
||||||
int16_t **rxsigF = eNB->prach_vars.rxsigF;
|
int16_t **rxsigF = eNB->prach_vars.rxsigF;
|
||||||
void *tx_buffer = eNB->ifbuffer.tx;
|
void *tx_buffer = eNB->ifbuffer.tx[subframe&1];
|
||||||
|
void *tx_buffer_prach = eNB->ifbuffer.tx_prach;
|
||||||
|
|
||||||
uint16_t symbol_id=0, element_id=0;
|
uint16_t symbol_id=0, element_id=0;
|
||||||
uint16_t db_fulllength, db_halflength;
|
uint16_t db_fulllength, db_halflength;
|
||||||
@@ -49,31 +53,44 @@ void send_IF4p5(PHY_VARS_eNB *eNB, int frame, int subframe, uint16_t packet_type
|
|||||||
|
|
||||||
uint16_t *data_block=NULL, *i=NULL;
|
uint16_t *data_block=NULL, *i=NULL;
|
||||||
|
|
||||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_SEND_IF4, 1 );
|
IF4p5_header_t *packet_header=NULL;
|
||||||
|
eth_state_t *eth = (eth_state_t*) (eNB->ifdevice.priv);
|
||||||
|
int nsym = fp->symbols_per_tti;
|
||||||
|
|
||||||
|
if (eNB->CC_id==0) VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_SEND_IF4, 1 );
|
||||||
|
|
||||||
if (packet_type == IF4p5_PDLFFT) {
|
if (packet_type == IF4p5_PDLFFT) {
|
||||||
|
if (subframe_select(fp,subframe)==SF_S)
|
||||||
|
nsym=fp->dl_symbols_in_S_subframe;
|
||||||
|
|
||||||
db_fulllength = 12*fp->N_RB_DL;
|
db_fulllength = 12*fp->N_RB_DL;
|
||||||
db_halflength = (db_fulllength)>>1;
|
db_halflength = (db_fulllength)>>1;
|
||||||
slotoffsetF = (subframe)*(fp->ofdm_symbol_size)*((fp->Ncp==1) ? 12 : 14) + 1;
|
slotoffsetF = (subframe)*(fp->ofdm_symbol_size)*((fp->Ncp==1) ? 12 : 14) + 1;
|
||||||
blockoffsetF = slotoffsetF + fp->ofdm_symbol_size - db_halflength - 1;
|
blockoffsetF = slotoffsetF + fp->ofdm_symbol_size - db_halflength - 1;
|
||||||
|
|
||||||
IF4p5_header_t *dl_header = (IF4p5_header_t *)(tx_buffer + MAC_HEADER_SIZE_BYTES);
|
|
||||||
data_block = (uint16_t*)(tx_buffer + MAC_HEADER_SIZE_BYTES + sizeof_IF4p5_header_t);
|
|
||||||
|
|
||||||
gen_IF4p5_dl_header(dl_header, frame, subframe);
|
if (eth->flags == ETH_RAW_IF4p5_MODE) {
|
||||||
|
packet_header = (IF4p5_header_t *)(tx_buffer + MAC_HEADER_SIZE_BYTES);
|
||||||
|
data_block = (uint16_t*)(tx_buffer + MAC_HEADER_SIZE_BYTES + sizeof_IF4p5_header_t);
|
||||||
|
} else {
|
||||||
|
packet_header = (IF4p5_header_t *)(tx_buffer);
|
||||||
|
data_block = (uint16_t*)(tx_buffer + sizeof_IF4p5_header_t);
|
||||||
|
}
|
||||||
|
gen_IF4p5_dl_header(packet_header, frame, subframe);
|
||||||
|
|
||||||
for (symbol_id=0; symbol_id<fp->symbols_per_tti; symbol_id++) {
|
for (symbol_id=0; symbol_id<nsym; symbol_id++) {
|
||||||
|
if (eNB->CC_id==1) LOG_I(PHY,"DL_IF4p5: CC_id %d : frame %d, subframe %d, symbol %d\n",eNB->CC_id,frame,subframe,symbol_id);
|
||||||
|
|
||||||
for (element_id=0; element_id<db_halflength; element_id++) {
|
for (element_id=0; element_id<db_halflength; element_id++) {
|
||||||
i = (uint16_t*) &txdataF[0][blockoffsetF+element_id];
|
i = (uint16_t*) &txdataF[eNB->CC_id][blockoffsetF+element_id];
|
||||||
data_block[element_id] = ((uint16_t) lin2alaw[*i]) | (lin2alaw[*(i+1)]<<8);
|
data_block[element_id] = ((uint16_t) lin2alaw[*i]) | (lin2alaw[*(i+1)]<<8);
|
||||||
|
|
||||||
i = (uint16_t*) &txdataF[0][slotoffsetF+element_id];
|
i = (uint16_t*) &txdataF[eNB->CC_id][slotoffsetF+element_id];
|
||||||
data_block[element_id+db_halflength] = ((uint16_t) lin2alaw[*i]) | (lin2alaw[*(i+1)]<<8);
|
data_block[element_id+db_halflength] = ((uint16_t) lin2alaw[*i]) | (lin2alaw[*(i+1)]<<8);
|
||||||
}
|
}
|
||||||
|
|
||||||
dl_header->frame_status &= ~(0x000f<<26);
|
packet_header->frame_status &= ~(0x000f<<26);
|
||||||
dl_header->frame_status |= (symbol_id&0x000f)<<26;
|
packet_header->frame_status |= (symbol_id&0x000f)<<26;
|
||||||
|
|
||||||
if ((eNB->ifdevice.trx_write_func(&eNB->ifdevice,
|
if ((eNB->ifdevice.trx_write_func(&eNB->ifdevice,
|
||||||
symbol_id,
|
symbol_id,
|
||||||
@@ -87,58 +104,92 @@ void send_IF4p5(PHY_VARS_eNB *eNB, int frame, int subframe, uint16_t packet_type
|
|||||||
slotoffsetF += fp->ofdm_symbol_size;
|
slotoffsetF += fp->ofdm_symbol_size;
|
||||||
blockoffsetF += fp->ofdm_symbol_size;
|
blockoffsetF += fp->ofdm_symbol_size;
|
||||||
}
|
}
|
||||||
} else if (packet_type == IF4p5_PULFFT) {
|
} else if ((packet_type == IF4p5_PULFFT)||
|
||||||
|
(packet_type == IF4p5_PULTICK)){
|
||||||
db_fulllength = 12*fp->N_RB_UL;
|
db_fulllength = 12*fp->N_RB_UL;
|
||||||
db_halflength = (db_fulllength)>>1;
|
db_halflength = (db_fulllength)>>1;
|
||||||
slotoffsetF = 1;
|
slotoffsetF = 1;
|
||||||
blockoffsetF = slotoffsetF + fp->ofdm_symbol_size - db_halflength - 1;
|
blockoffsetF = slotoffsetF + fp->ofdm_symbol_size - db_halflength - 1;
|
||||||
|
|
||||||
IF4p5_header_t *ul_header = (IF4p5_header_t *)(tx_buffer + MAC_HEADER_SIZE_BYTES);
|
if (subframe_select(fp,subframe)==SF_S) {
|
||||||
data_block = (uint16_t*)(tx_buffer + MAC_HEADER_SIZE_BYTES + sizeof_IF4p5_header_t);
|
nsym=fp->ul_symbols_in_S_subframe;
|
||||||
|
slotoffsetF += (fp->ofdm_symbol_size*(fp->symbols_per_tti-nsym));
|
||||||
|
blockoffsetF += (fp->ofdm_symbol_size*(fp->symbols_per_tti-nsym));
|
||||||
|
}
|
||||||
|
|
||||||
gen_IF4p5_ul_header(ul_header, frame, subframe);
|
if (eth->flags == ETH_RAW_IF4p5_MODE) {
|
||||||
|
packet_header = (IF4p5_header_t *)(tx_buffer + MAC_HEADER_SIZE_BYTES);
|
||||||
|
data_block = (uint16_t*)(tx_buffer + MAC_HEADER_SIZE_BYTES + sizeof_IF4p5_header_t);
|
||||||
|
} else {
|
||||||
|
packet_header = (IF4p5_header_t *)(tx_buffer);
|
||||||
|
data_block = (uint16_t*)(tx_buffer + sizeof_IF4p5_header_t);
|
||||||
|
}
|
||||||
|
gen_IF4p5_ul_header(packet_header, packet_type, frame, subframe);
|
||||||
|
|
||||||
for (symbol_id=0; symbol_id<fp->symbols_per_tti; symbol_id++) {
|
if (packet_type == IF4p5_PULFFT) {
|
||||||
|
for (symbol_id=fp->symbols_per_tti-nsym; symbol_id<fp->symbols_per_tti; symbol_id++) {
|
||||||
for (element_id=0; element_id<db_halflength; element_id++) {
|
LOG_D(PHY,"IF4p5_PULFFT: frame %d, subframe %d, symbol %d\n",frame,subframe,symbol_id);
|
||||||
i = (uint16_t*) &rxdataF[0][blockoffsetF+element_id];
|
for (element_id=0; element_id<db_halflength; element_id++) {
|
||||||
data_block[element_id] = ((uint16_t) lin2alaw[*i]) | (lin2alaw[*(i+1)]<<8);
|
i = (uint16_t*) &rxdataF[0][blockoffsetF+element_id];
|
||||||
|
data_block[element_id] = ((uint16_t) lin2alaw[*i]) | (lin2alaw[*(i+1)]<<8);
|
||||||
i = (uint16_t*) &rxdataF[0][slotoffsetF+element_id];
|
|
||||||
data_block[element_id+db_halflength] = ((uint16_t) lin2alaw[*i]) | (lin2alaw[*(i+1)]<<8);
|
i = (uint16_t*) &rxdataF[0][slotoffsetF+element_id];
|
||||||
}
|
data_block[element_id+db_halflength] = ((uint16_t) lin2alaw[*i]) | (lin2alaw[*(i+1)]<<8);
|
||||||
|
}
|
||||||
ul_header->frame_status &= ~(0x000f<<26);
|
|
||||||
ul_header->frame_status |= (symbol_id&0x000f)<<26;
|
packet_header->frame_status &= ~(0x000f<<26);
|
||||||
|
packet_header->frame_status |= (symbol_id&0x000f)<<26;
|
||||||
|
|
||||||
|
if ((eNB->ifdevice.trx_write_func(&eNB->ifdevice,
|
||||||
|
symbol_id,
|
||||||
|
&tx_buffer,
|
||||||
|
db_fulllength,
|
||||||
|
1,
|
||||||
|
IF4p5_PULFFT)) < 0) {
|
||||||
|
perror("ETHERNET write for IF4p5_PULFFT\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
slotoffsetF += fp->ofdm_symbol_size;
|
||||||
|
blockoffsetF += fp->ofdm_symbol_size;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
if ((eNB->ifdevice.trx_write_func(&eNB->ifdevice,
|
if ((eNB->ifdevice.trx_write_func(&eNB->ifdevice,
|
||||||
symbol_id,
|
0,
|
||||||
&tx_buffer,
|
&tx_buffer,
|
||||||
db_fulllength,
|
0,
|
||||||
1,
|
1,
|
||||||
IF4p5_PULFFT)) < 0) {
|
IF4p5_PULTICK)) < 0) {
|
||||||
perror("ETHERNET write for IF4p5_PULFFT\n");
|
perror("ETHERNET write for IF4p5_PULFFT\n");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
slotoffsetF += fp->ofdm_symbol_size;
|
|
||||||
blockoffsetF += fp->ofdm_symbol_size;
|
|
||||||
}
|
|
||||||
} else if (packet_type == IF4p5_PRACH) {
|
} else if (packet_type == IF4p5_PRACH) {
|
||||||
// FIX: hard coded prach samples length
|
// FIX: hard coded prach samples length
|
||||||
db_fulllength = 840*2;
|
LOG_D(PHY,"IF4p5_PRACH: frame %d, subframe %d\n",frame,subframe);
|
||||||
|
db_fulllength = PRACH_HARD_CODED_NUM_SAMPLES;
|
||||||
|
|
||||||
|
if (eth->flags == ETH_RAW_IF4p5_MODE) {
|
||||||
|
packet_header = (IF4p5_header_t *)(tx_buffer_prach + MAC_HEADER_SIZE_BYTES);
|
||||||
|
data_block = (uint16_t*)(tx_buffer + MAC_HEADER_SIZE_BYTES + sizeof_IF4p5_header_t);
|
||||||
|
} else {
|
||||||
|
packet_header = (IF4p5_header_t *)(tx_buffer_prach);
|
||||||
|
data_block = (uint16_t*)(tx_buffer_prach + sizeof_IF4p5_header_t);
|
||||||
|
}
|
||||||
|
gen_IF4p5_prach_header(packet_header, frame, subframe);
|
||||||
|
|
||||||
IF4p5_header_t *prach_header = (IF4p5_header_t *)(tx_buffer + MAC_HEADER_SIZE_BYTES);
|
if (eth->flags == ETH_RAW_IF4p5_MODE) {
|
||||||
data_block = (uint16_t*)(tx_buffer + MAC_HEADER_SIZE_BYTES + sizeof_IF4p5_header_t);
|
memcpy((int16_t*)(tx_buffer_prach + MAC_HEADER_SIZE_BYTES + sizeof_IF4p5_header_t),
|
||||||
|
(&rxsigF[0][k]),
|
||||||
|
PRACH_BLOCK_SIZE_BYTES);
|
||||||
|
} else {
|
||||||
|
memcpy((int16_t*)(tx_buffer_prach + sizeof_IF4p5_header_t),
|
||||||
|
(&rxsigF[0][k]),
|
||||||
|
PRACH_BLOCK_SIZE_BYTES);
|
||||||
|
}
|
||||||
|
|
||||||
gen_IF4p5_prach_header(prach_header, frame, subframe);
|
|
||||||
|
|
||||||
memcpy((int16_t*)(tx_buffer + MAC_HEADER_SIZE_BYTES + sizeof_IF4p5_header_t),
|
|
||||||
(&rxsigF[0][k]),
|
|
||||||
db_fulllength*sizeof(int16_t));
|
|
||||||
|
|
||||||
if ((eNB->ifdevice.trx_write_func(&eNB->ifdevice,
|
if ((eNB->ifdevice.trx_write_func(&eNB->ifdevice,
|
||||||
symbol_id,
|
symbol_id,
|
||||||
&tx_buffer,
|
&tx_buffer_prach,
|
||||||
db_fulllength,
|
db_fulllength,
|
||||||
1,
|
1,
|
||||||
IF4p5_PRACH)) < 0) {
|
IF4p5_PRACH)) < 0) {
|
||||||
@@ -148,7 +199,7 @@ void send_IF4p5(PHY_VARS_eNB *eNB, int frame, int subframe, uint16_t packet_type
|
|||||||
AssertFatal(1==0, "send_IF4p5 - Unknown packet_type %x", packet_type);
|
AssertFatal(1==0, "send_IF4p5 - Unknown packet_type %x", packet_type);
|
||||||
}
|
}
|
||||||
|
|
||||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_SEND_IF4, 0 );
|
if (eNB->CC_id==0) VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_SEND_IF4, 0 );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -163,8 +214,9 @@ void recv_IF4p5(PHY_VARS_eNB *eNB, int *frame, int *subframe, uint16_t *packet_t
|
|||||||
uint16_t element_id;
|
uint16_t element_id;
|
||||||
uint16_t db_fulllength, db_halflength;
|
uint16_t db_fulllength, db_halflength;
|
||||||
int slotoffsetF=0, blockoffsetF=0;
|
int slotoffsetF=0, blockoffsetF=0;
|
||||||
|
eth_state_t *eth = (eth_state_t*) (eNB->ifdevice.priv);
|
||||||
|
|
||||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_RECV_IF4, 1 );
|
if (eNB->CC_id==0) VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_RECV_IF4, 1 );
|
||||||
|
|
||||||
if (eNB->node_function == NGFI_RRU_IF4p5) {
|
if (eNB->node_function == NGFI_RRU_IF4p5) {
|
||||||
db_fulllength = (12*fp->N_RB_DL);
|
db_fulllength = (12*fp->N_RB_DL);
|
||||||
@@ -183,17 +235,28 @@ void recv_IF4p5(PHY_VARS_eNB *eNB, int *frame, int *subframe, uint16_t *packet_t
|
|||||||
0) < 0) {
|
0) < 0) {
|
||||||
perror("ETHERNET read");
|
perror("ETHERNET read");
|
||||||
}
|
}
|
||||||
|
|
||||||
packet_header = (IF4p5_header_t*) (rx_buffer+MAC_HEADER_SIZE_BYTES);
|
|
||||||
data_block = (uint16_t*) (rx_buffer+MAC_HEADER_SIZE_BYTES+sizeof_IF4p5_header_t);
|
|
||||||
|
|
||||||
|
if (eth->flags == ETH_RAW_IF4p5_MODE) {
|
||||||
|
packet_header = (IF4p5_header_t*) (rx_buffer+MAC_HEADER_SIZE_BYTES);
|
||||||
|
data_block = (uint16_t*) (rx_buffer+MAC_HEADER_SIZE_BYTES+sizeof_IF4p5_header_t);
|
||||||
|
} else {
|
||||||
|
packet_header = (IF4p5_header_t*) (rx_buffer);
|
||||||
|
data_block = (uint16_t*) (rx_buffer+sizeof_IF4p5_header_t);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
*frame = ((packet_header->frame_status)>>6)&0xffff;
|
*frame = ((packet_header->frame_status)>>6)&0xffff;
|
||||||
*subframe = ((packet_header->frame_status)>>22)&0x000f;
|
*subframe = ((packet_header->frame_status)>>22)&0x000f;
|
||||||
|
|
||||||
|
*packet_type = packet_header->sub_type;
|
||||||
|
|
||||||
|
|
||||||
if (*packet_type == IF4p5_PDLFFT) {
|
if (*packet_type == IF4p5_PDLFFT) {
|
||||||
*symbol_number = ((packet_header->frame_status)>>26)&0x000f;
|
*symbol_number = ((packet_header->frame_status)>>26)&0x000f;
|
||||||
|
|
||||||
|
LOG_D(PHY,"DL_IF4p5: CC_id %d : frame %d, subframe %d, symbol %d\n",eNB->CC_id,*frame,*subframe,*symbol_number);
|
||||||
|
|
||||||
slotoffsetF = (*symbol_number)*(fp->ofdm_symbol_size) + (*subframe)*(fp->ofdm_symbol_size)*((fp->Ncp==1) ? 12 : 14) + 1;
|
slotoffsetF = (*symbol_number)*(fp->ofdm_symbol_size) + (*subframe)*(fp->ofdm_symbol_size)*((fp->Ncp==1) ? 12 : 14) + 1;
|
||||||
blockoffsetF = slotoffsetF + fp->ofdm_symbol_size - db_halflength - 1;
|
blockoffsetF = slotoffsetF + fp->ofdm_symbol_size - db_halflength - 1;
|
||||||
|
|
||||||
@@ -210,6 +273,8 @@ void recv_IF4p5(PHY_VARS_eNB *eNB, int *frame, int *subframe, uint16_t *packet_t
|
|||||||
} else if (*packet_type == IF4p5_PULFFT) {
|
} else if (*packet_type == IF4p5_PULFFT) {
|
||||||
*symbol_number = ((packet_header->frame_status)>>26)&0x000f;
|
*symbol_number = ((packet_header->frame_status)>>26)&0x000f;
|
||||||
|
|
||||||
|
if (eNB->CC_id==1) LOG_I(PHY,"UL_IF4p5: CC_id %d : frame %d, subframe %d, symbol %d\n",eNB->CC_id,*frame,*subframe,*symbol_number);
|
||||||
|
|
||||||
slotoffsetF = (*symbol_number)*(fp->ofdm_symbol_size) + 1;
|
slotoffsetF = (*symbol_number)*(fp->ofdm_symbol_size) + 1;
|
||||||
blockoffsetF = slotoffsetF + fp->ofdm_symbol_size - db_halflength - 1;
|
blockoffsetF = slotoffsetF + fp->ofdm_symbol_size - db_halflength - 1;
|
||||||
|
|
||||||
@@ -224,18 +289,27 @@ void recv_IF4p5(PHY_VARS_eNB *eNB, int *frame, int *subframe, uint16_t *packet_t
|
|||||||
}
|
}
|
||||||
|
|
||||||
} else if (*packet_type == IF4p5_PRACH) {
|
} else if (*packet_type == IF4p5_PRACH) {
|
||||||
|
if (eNB->CC_id==1) LOG_I(PHY,"PRACH_IF4p5: CC_id %d : frame %d, subframe %d, symbol %d\n",eNB->CC_id,*frame,*subframe);
|
||||||
|
|
||||||
// FIX: hard coded prach samples length
|
// FIX: hard coded prach samples length
|
||||||
db_fulllength = 840*2;
|
db_fulllength = PRACH_HARD_CODED_NUM_SAMPLES;
|
||||||
|
|
||||||
memcpy((&rxsigF[0][0]),
|
if (eth->flags == ETH_RAW_IF4p5_MODE) {
|
||||||
(int16_t*) (rx_buffer+MAC_HEADER_SIZE_BYTES+sizeof_IF4p5_header_t),
|
memcpy((&rxsigF[0][0]),
|
||||||
db_fulllength*sizeof(int16_t));
|
(int16_t*) (rx_buffer+MAC_HEADER_SIZE_BYTES+sizeof_IF4p5_header_t),
|
||||||
|
PRACH_BLOCK_SIZE_BYTES);
|
||||||
|
} else {
|
||||||
|
memcpy((&rxsigF[0][0]),
|
||||||
|
(int16_t*) (rx_buffer+sizeof_IF4p5_header_t),
|
||||||
|
PRACH_BLOCK_SIZE_BYTES);
|
||||||
|
}
|
||||||
|
} else if (*packet_type == IF4p5_PULTICK) {
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
AssertFatal(1==0, "recv_IF4p5 - Unknown packet_type %x", *packet_type);
|
AssertFatal(1==0, "recv_IF4p5 - Unknown packet_type %x", *packet_type);
|
||||||
}
|
}
|
||||||
|
|
||||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_RECV_IF4, 0 );
|
if (eNB->CC_id==0) VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_RECV_IF4, 0 );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -253,10 +327,10 @@ void gen_IF4p5_dl_header(IF4p5_header_t *dl_packet, int frame, int subframe) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void gen_IF4p5_ul_header(IF4p5_header_t *ul_packet, int frame, int subframe) {
|
void gen_IF4p5_ul_header(IF4p5_header_t *ul_packet, uint16_t packet_subtype, int frame, int subframe) {
|
||||||
|
|
||||||
ul_packet->type = IF4p5_PACKET_TYPE;
|
ul_packet->type = IF4p5_PACKET_TYPE;
|
||||||
ul_packet->sub_type = IF4p5_PULFFT;
|
ul_packet->sub_type = packet_subtype;
|
||||||
|
|
||||||
ul_packet->rsvd = 0;
|
ul_packet->rsvd = 0;
|
||||||
|
|
||||||
@@ -282,6 +356,18 @@ void gen_IF4p5_prach_header(IF4p5_header_t *prach_packet, int frame, int subfram
|
|||||||
|
|
||||||
void malloc_IF4p5_buffer(PHY_VARS_eNB *eNB) {
|
void malloc_IF4p5_buffer(PHY_VARS_eNB *eNB) {
|
||||||
// Keep the size large enough
|
// Keep the size large enough
|
||||||
eNB->ifbuffer.tx = malloc(RAW_IF4p5_PRACH_SIZE_BYTES);
|
eth_state_t *eth = (eth_state_t*) (eNB->ifdevice.priv);
|
||||||
eNB->ifbuffer.rx = malloc(RAW_IF4p5_PRACH_SIZE_BYTES);
|
int i;
|
||||||
|
|
||||||
|
if (eth->flags == ETH_RAW_IF4p5_MODE) {
|
||||||
|
for (i=0;i<10;i++)
|
||||||
|
eNB->ifbuffer.tx[i] = malloc(RAW_IF4p5_PRACH_SIZE_BYTES);
|
||||||
|
eNB->ifbuffer.tx_prach = malloc(RAW_IF4p5_PRACH_SIZE_BYTES);
|
||||||
|
eNB->ifbuffer.rx = malloc(RAW_IF4p5_PRACH_SIZE_BYTES);
|
||||||
|
} else {
|
||||||
|
for (i=0;i<10;i++)
|
||||||
|
eNB->ifbuffer.tx[i] = malloc(UDP_IF4p5_PRACH_SIZE_BYTES);
|
||||||
|
eNB->ifbuffer.tx_prach = malloc(UDP_IF4p5_PRACH_SIZE_BYTES);
|
||||||
|
eNB->ifbuffer.rx = malloc(UDP_IF4p5_PRACH_SIZE_BYTES);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,6 +37,7 @@
|
|||||||
#define IF4p5_PULFFT 0x0019
|
#define IF4p5_PULFFT 0x0019
|
||||||
#define IF4p5_PDLFFT 0x0020
|
#define IF4p5_PDLFFT 0x0020
|
||||||
#define IF4p5_PRACH 0x0021
|
#define IF4p5_PRACH 0x0021
|
||||||
|
#define IF4p5_PULTICK 0x0022
|
||||||
|
|
||||||
struct IF4p5_header {
|
struct IF4p5_header {
|
||||||
/// Type
|
/// Type
|
||||||
@@ -55,7 +56,7 @@ typedef struct IF4p5_header IF4p5_header_t;
|
|||||||
|
|
||||||
void gen_IF4p5_dl_header(IF4p5_header_t*, int, int);
|
void gen_IF4p5_dl_header(IF4p5_header_t*, int, int);
|
||||||
|
|
||||||
void gen_IF4p5_ul_header(IF4p5_header_t*, int, int);
|
void gen_IF4p5_ul_header(IF4p5_header_t*, uint16_t, int, int);
|
||||||
|
|
||||||
void gen_IF4p5_prach_header(IF4p5_header_t*, int, int);
|
void gen_IF4p5_prach_header(IF4p5_header_t*, int, int);
|
||||||
|
|
||||||
|
|||||||
@@ -21,11 +21,11 @@
|
|||||||
|
|
||||||
/*! \file PHY/LTE_TRANSPORT/if5_tools.c
|
/*! \file PHY/LTE_TRANSPORT/if5_tools.c
|
||||||
* \brief
|
* \brief
|
||||||
* \author S. Sandeep Kumar, Raymond Knopp
|
* \author S. Sandeep Kumar, Raymond Knopp, Tien-Thinh Nguyen
|
||||||
* \date 2016
|
* \date 2016
|
||||||
* \version 0.1
|
* \version 0.1
|
||||||
* \company Eurecom
|
* \company Eurecom
|
||||||
* \email: ee13b1025@iith.ac.in, knopp@eurecom.fr
|
* \email: ee13b1025@iith.ac.in, knopp@eurecom.fr, tien-thinh.nguyen@eurecom.fr
|
||||||
* \note
|
* \note
|
||||||
* \warning
|
* \warning
|
||||||
*/
|
*/
|
||||||
@@ -34,13 +34,21 @@
|
|||||||
|
|
||||||
#include "targets/ARCH/ETHERNET/USERSPACE/LIB/if_defs.h"
|
#include "targets/ARCH/ETHERNET/USERSPACE/LIB/if_defs.h"
|
||||||
#include "UTIL/LOG/vcd_signal_dumper.h"
|
#include "UTIL/LOG/vcd_signal_dumper.h"
|
||||||
|
//#define DEBUG_DL_MOBIPASS
|
||||||
|
//#define DEBUG_UL_MOBIPASS
|
||||||
|
#define SUBFRAME_SKIP_NUM_MOBIPASS 8
|
||||||
|
|
||||||
|
int dummy_cnt = 0;
|
||||||
|
int subframe_skip_extra = 0;
|
||||||
|
int start_flag = 1;
|
||||||
|
int offset_cnt = 1;
|
||||||
void send_IF5(PHY_VARS_eNB *eNB, openair0_timestamp proc_timestamp, int subframe, uint8_t *seqno, uint16_t packet_type) {
|
void send_IF5(PHY_VARS_eNB *eNB, openair0_timestamp proc_timestamp, int subframe, uint8_t *seqno, uint16_t packet_type) {
|
||||||
|
|
||||||
LTE_DL_FRAME_PARMS *fp=&eNB->frame_parms;
|
LTE_DL_FRAME_PARMS *fp=&eNB->frame_parms;
|
||||||
int32_t *txp[fp->nb_antennas_tx], *rxp[fp->nb_antennas_rx];
|
int32_t *txp[fp->nb_antennas_tx], *rxp[fp->nb_antennas_rx];
|
||||||
int32_t *tx_buffer=NULL;
|
int32_t *tx_buffer=NULL;
|
||||||
|
|
||||||
|
int8_t dummy_buffer[fp->samples_per_tti*2];
|
||||||
uint16_t packet_id=0, i=0;
|
uint16_t packet_id=0, i=0;
|
||||||
|
|
||||||
uint32_t spp_eth = (uint32_t) eNB->ifdevice.openair0_cfg->samples_per_packet;
|
uint32_t spp_eth = (uint32_t) eNB->ifdevice.openair0_cfg->samples_per_packet;
|
||||||
@@ -89,17 +97,18 @@ void send_IF5(PHY_VARS_eNB *eNB, openair0_timestamp proc_timestamp, int subframe
|
|||||||
}
|
}
|
||||||
|
|
||||||
} else if (packet_type == IF5_MOBIPASS) {
|
} else if (packet_type == IF5_MOBIPASS) {
|
||||||
uint16_t db_fulllength=640;
|
uint16_t db_fulllength = PAYLOAD_MOBIPASS_NUM_SAMPLES;
|
||||||
|
|
||||||
__m128i *data_block=NULL, *data_block_head=NULL;
|
__m128i *data_block=NULL, *data_block_head=NULL;
|
||||||
|
|
||||||
__m128i *txp128;
|
__m128i *txp128;
|
||||||
__m128i t0, t1;
|
__m128i t0, t1;
|
||||||
|
|
||||||
tx_buffer = memalign(16, MAC_HEADER_SIZE_BYTES + sizeof_IF5_mobipass_header_t + db_fulllength*sizeof(int16_t));
|
// tx_buffer = memalign(16, MAC_HEADER_SIZE_BYTES + sizeof_IF5_mobipass_header_t + db_fulllength*sizeof(int16_t));
|
||||||
|
tx_buffer = malloc(MAC_HEADER_SIZE_BYTES + sizeof_IF5_mobipass_header_t + db_fulllength*sizeof(int16_t));
|
||||||
IF5_mobipass_header_t *header = (IF5_mobipass_header_t *)((uint8_t *)tx_buffer + MAC_HEADER_SIZE_BYTES);
|
IF5_mobipass_header_t *header = (IF5_mobipass_header_t *)((uint8_t *)tx_buffer + MAC_HEADER_SIZE_BYTES);
|
||||||
data_block_head = (__m128i *)((uint8_t *)tx_buffer + MAC_HEADER_SIZE_BYTES + sizeof_IF5_mobipass_header_t + 4);
|
data_block_head = (__m128i *)((uint8_t *)tx_buffer + MAC_HEADER_SIZE_BYTES + sizeof_IF5_mobipass_header_t);
|
||||||
|
|
||||||
header->flags = 0;
|
header->flags = 0;
|
||||||
header->fifo_status = 0;
|
header->fifo_status = 0;
|
||||||
header->seqno = *seqno;
|
header->seqno = *seqno;
|
||||||
@@ -110,14 +119,14 @@ void send_IF5(PHY_VARS_eNB *eNB, openair0_timestamp proc_timestamp, int subframe
|
|||||||
txp128 = (__m128i *) txp[0];
|
txp128 = (__m128i *) txp[0];
|
||||||
|
|
||||||
for (packet_id=0; packet_id<fp->samples_per_tti/db_fulllength; packet_id++) {
|
for (packet_id=0; packet_id<fp->samples_per_tti/db_fulllength; packet_id++) {
|
||||||
header->time_stamp = (uint32_t)(proc_timestamp + packet_id*db_fulllength);
|
header->time_stamp = htonl((uint32_t)(proc_timestamp + packet_id*db_fulllength));
|
||||||
data_block = data_block_head;
|
data_block = data_block_head;
|
||||||
|
|
||||||
for (i=0; i<db_fulllength>>2; i+=2) {
|
for (i=0; i<db_fulllength>>2; i+=2) {
|
||||||
t0 = _mm_srai_epi16(*txp128++, 4);
|
t0 = _mm_srai_epi16(*txp128++, 4);
|
||||||
t1 = _mm_srai_epi16(*txp128++, 4);
|
t1 = _mm_srai_epi16(*txp128++, 4);
|
||||||
|
// *data_block++ = _mm_packs_epi16(t0, t1);
|
||||||
*data_block++ = _mm_packs_epi16(t0, t1);
|
_mm_storeu_si128(data_block++, _mm_packs_epi16(t0, t1));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write the packet to the fronthaul
|
// Write the packet to the fronthaul
|
||||||
@@ -129,18 +138,38 @@ void send_IF5(PHY_VARS_eNB *eNB, openair0_timestamp proc_timestamp, int subframe
|
|||||||
IF5_MOBIPASS)) < 0) {
|
IF5_MOBIPASS)) < 0) {
|
||||||
perror("ETHERNET write for IF5_MOBIPASS\n");
|
perror("ETHERNET write for IF5_MOBIPASS\n");
|
||||||
}
|
}
|
||||||
|
#ifdef DEBUG_DL_MOBIPASS
|
||||||
|
if ((subframe==0)&&(dummy_cnt == 100)) {
|
||||||
|
memcpy((void*)&dummy_buffer[packet_id*db_fulllength*2],(void*)data_block_head,db_fulllength*2);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
header->seqno += 1;
|
header->seqno += 1;
|
||||||
}
|
}
|
||||||
*seqno = header->seqno;
|
*seqno = header->seqno;
|
||||||
|
|
||||||
|
#ifdef DEBUG_DL_MOBIPASS
|
||||||
|
uint8_t txe;
|
||||||
|
txe = dB_fixed(signal_energy(txp[0],fp->samples_per_tti));
|
||||||
|
if (txe > 0){
|
||||||
|
LOG_D(PHY,"[Mobipass] frame:%d, subframe:%d, energy %d\n", (proc_timestamp/(10*fp->samples_per_tti))&1023,subframe, txe);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
} else {
|
} else {
|
||||||
AssertFatal(1==0, "send_IF5 - Unknown packet_type %x", packet_type);
|
AssertFatal(1==0, "send_IF5 - Unknown packet_type %x", packet_type);
|
||||||
}
|
}
|
||||||
|
|
||||||
free(tx_buffer);
|
free(tx_buffer);
|
||||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_SEND_IF5, 0 );
|
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_SEND_IF5, 0 );
|
||||||
|
#ifdef DEBUG_DL_MOBIPASS
|
||||||
|
if(subframe==0) {
|
||||||
|
if (dummy_cnt==100) {
|
||||||
|
write_output("txsigmb.m","txs",(void*)dummy_buffer, fp->samples_per_tti,1, 5);
|
||||||
|
exit(-1);
|
||||||
|
} else {
|
||||||
|
dummy_cnt++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -151,6 +180,8 @@ void recv_IF5(PHY_VARS_eNB *eNB, openair0_timestamp *proc_timestamp, int subfram
|
|||||||
int32_t *txp[fp->nb_antennas_tx], *rxp[fp->nb_antennas_rx];
|
int32_t *txp[fp->nb_antennas_tx], *rxp[fp->nb_antennas_rx];
|
||||||
|
|
||||||
uint16_t packet_id=0, i=0;
|
uint16_t packet_id=0, i=0;
|
||||||
|
int8_t dummy_buffer_rx[fp->samples_per_tti*2];
|
||||||
|
uint8_t rxe;
|
||||||
|
|
||||||
int32_t spp_eth = (int32_t) eNB->ifdevice.openair0_cfg->samples_per_packet;
|
int32_t spp_eth = (int32_t) eNB->ifdevice.openair0_cfg->samples_per_packet;
|
||||||
int32_t spsf = (int32_t) eNB->ifdevice.openair0_cfg->samples_per_frame/10;
|
int32_t spsf = (int32_t) eNB->ifdevice.openair0_cfg->samples_per_frame/10;
|
||||||
@@ -202,7 +233,128 @@ void recv_IF5(PHY_VARS_eNB *eNB, openair0_timestamp *proc_timestamp, int subfram
|
|||||||
|
|
||||||
} else if (packet_type == IF5_MOBIPASS) {
|
} else if (packet_type == IF5_MOBIPASS) {
|
||||||
|
|
||||||
|
uint16_t db_fulllength = PAYLOAD_MOBIPASS_NUM_SAMPLES;
|
||||||
|
openair0_timestamp timestamp_mobipass[fp->samples_per_tti/db_fulllength];
|
||||||
|
int lower_offset = 0;
|
||||||
|
int upper_offset = 70000;
|
||||||
|
int subframe_skip = 0;
|
||||||
|
int reset_flag = 0;
|
||||||
|
int32_t *rx_buffer=NULL;
|
||||||
|
__m128i *data_block=NULL, *data_block_head=NULL;
|
||||||
|
__m128i *rxp128;
|
||||||
|
__m128i r0, r1;
|
||||||
|
|
||||||
|
//rx_buffer = memalign(16, MAC_HEADER_SIZE_BYTES + sizeof_IF5_mobipass_header_t + db_fulllength*sizeof(int16_t));
|
||||||
|
rx_buffer = malloc(MAC_HEADER_SIZE_BYTES + sizeof_IF5_mobipass_header_t + db_fulllength*sizeof(int16_t));
|
||||||
|
IF5_mobipass_header_t *header = (IF5_mobipass_header_t *)((uint8_t *)rx_buffer + MAC_HEADER_SIZE_BYTES);
|
||||||
|
data_block_head = (__m128i *)((uint8_t *)rx_buffer + MAC_HEADER_SIZE_BYTES + sizeof_IF5_mobipass_header_t);
|
||||||
|
|
||||||
|
rxp[0] = (void*)&eNB->common_vars.rxdata[0][0][subframe*eNB->frame_parms.samples_per_tti];
|
||||||
|
rxp128 = (__m128i *) (rxp[0]);
|
||||||
|
|
||||||
|
eNB_proc_t *proc = &eNB->proc;
|
||||||
|
/*
|
||||||
|
// while(packet_id<fp->samples_per_tti/db_fulllength) {
|
||||||
|
data_block = data_block_head;
|
||||||
|
|
||||||
|
eNB->ifdevice.trx_read_func(&eNB->ifdevice,
|
||||||
|
&ts0,
|
||||||
|
(void**)&rx_buffer,
|
||||||
|
db_fulllength,
|
||||||
|
1
|
||||||
|
);
|
||||||
|
|
||||||
|
if ((header->seqno == 1)&&(first_packet==1)) {
|
||||||
|
first_packet = 0; //ignore the packets before synchnorization
|
||||||
|
packet_id = 0;
|
||||||
|
ts_offset = ntohl(ts0);
|
||||||
|
}
|
||||||
|
if (first_packet==0) {
|
||||||
|
packet_cnt++;
|
||||||
|
ts = ntohl(ts0);
|
||||||
|
packet_id = (ts-ts_offset)/db_fulllength;
|
||||||
|
packet_id = packet_id % (fp->samples_per_tti/db_fulllength);
|
||||||
|
|
||||||
|
printf("[IF5_tools]packet_id:%d\n", packet_id);
|
||||||
|
// if (ts_stored == 0) {
|
||||||
|
// ts_stored = 1;
|
||||||
|
*proc_timestamp = ntohl(ts - (packet_id*db_fulllength));
|
||||||
|
// }
|
||||||
|
rxp[0] = (void*)&eNB->common_vars.rxdata[0][0][(subframe*eNB->frame_parms.samples_per_tti)+packet_id*db_fulllength];
|
||||||
|
rxp128 = (__m128i *) (rxp[0]);
|
||||||
|
|
||||||
|
for (i=0; i<db_fulllength>>2; i+=2) {
|
||||||
|
r0 = _mm_loadu_si128(data_block++);
|
||||||
|
*rxp128++ =_mm_slli_epi16(_mm_srai_epi16(_mm_unpacklo_epi8(r0,r0),8),4);
|
||||||
|
*rxp128++ =_mm_slli_epi16(_mm_srai_epi16(_mm_unpackhi_epi8(r0,r0),8),4);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// }//end while
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
packet_id=0;
|
||||||
|
while(packet_id<fp->samples_per_tti/db_fulllength) {
|
||||||
|
data_block = data_block_head;
|
||||||
|
|
||||||
|
eNB->ifdevice.trx_read_func(&eNB->ifdevice,
|
||||||
|
×tamp_mobipass[packet_id],
|
||||||
|
(void**)&rx_buffer,
|
||||||
|
db_fulllength,
|
||||||
|
1
|
||||||
|
);
|
||||||
|
#ifdef DEBUG_UL_MOBIPASS
|
||||||
|
if (((proc->timestamp_tx + lower_offset) > ntohl(timestamp_mobipass[packet_id])) || ((proc->timestamp_tx + upper_offset) < ntohl(timestamp_mobipass[packet_id]))) {
|
||||||
|
//ignore the packet
|
||||||
|
subframe_skip_extra = (subframe_skip_extra + 1)%67;
|
||||||
|
LOG_D("[Mobipass] ignored packet, id:[%d,%d], proc->timestamp_tx:%llu, proc->timestamp_rx:%llu, seqno:%d\n", packet_id,subframe_skip_extra, proc->timestamp_tx, ntohl(timestamp_mobipass[packet_id]), header->seqno);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
//skip SUBFRAME_SKIP_NUM_MOBIPASS additional UL packets
|
||||||
|
if ((start_flag == 1) && (subframe_skip < SUBFRAME_SKIP_NUM_MOBIPASS)){
|
||||||
|
subframe_skip++;
|
||||||
|
offset_cnt = header->seqno;
|
||||||
|
} else {
|
||||||
|
if ((offset_cnt != header->seqno) && (start_flag == 0) && (proc->first_rx > 3)){
|
||||||
|
#ifdef DEBUG_UL_MOBIPASS
|
||||||
|
LOG_D(PHY,"[Mobipass] Reset sequence number, offset_cnt:%d, header->seqno:%d, packet_id:%d\n", offset_cnt, header->seqno, packet_id);
|
||||||
|
#endif
|
||||||
|
reset_flag=1;
|
||||||
|
}
|
||||||
|
if ((reset_flag == 1) && (proc->first_rx > 3 ) && (start_flag == 0) && (packet_id == 0)) {
|
||||||
|
packet_id = 1;
|
||||||
|
reset_flag = 0;
|
||||||
|
}
|
||||||
|
start_flag = 0;
|
||||||
|
|
||||||
|
//store rxdata and increase packet_id
|
||||||
|
rxp[0] = (void*)&eNB->common_vars.rxdata[0][0][(subframe*eNB->frame_parms.samples_per_tti)+packet_id*db_fulllength];
|
||||||
|
rxp128 = (__m128i *) (rxp[0]);
|
||||||
|
for (i=0; i<db_fulllength>>2; i+=2) {
|
||||||
|
r0 = _mm_loadu_si128(data_block++);
|
||||||
|
*rxp128++ =_mm_slli_epi16(_mm_srai_epi16(_mm_unpacklo_epi8(r0,r0),8),4);
|
||||||
|
*rxp128++ =_mm_slli_epi16(_mm_srai_epi16(_mm_unpackhi_epi8(r0,r0),8),4);
|
||||||
|
}
|
||||||
|
packet_id++;
|
||||||
|
offset_cnt = (header->seqno+1)&255;
|
||||||
|
}
|
||||||
|
}//end while
|
||||||
|
|
||||||
|
*proc_timestamp = ntohl(timestamp_mobipass[0]);
|
||||||
|
#ifdef DEBUG_UL_MOBIPASS
|
||||||
|
LOG_I(PHY,"[Mobipass][Recv_MOBIPASS] timestamp: %llu\n ", *proc_timestamp);
|
||||||
|
if (eNB->CC_id>0) {
|
||||||
|
rxe = dB_fixed(signal_energy(rxp[0],fp->samples_per_tti));
|
||||||
|
if (rxe > 0){
|
||||||
|
LOG_I(PHY,"[Mobipass] frame:%d, subframe:%d, energy %d\n", (*proc_timestamp/(10*fp->samples_per_tti))&1023,subframe, rxe);
|
||||||
|
// write_output("rxsigmb.m","rxs",(void*)dummy_buffer_rx, fp->samples_per_tti,1, 5);
|
||||||
|
// exit(-1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
AssertFatal(1==0, "recv_IF5 - Unknown packet_type %x", packet_type);
|
AssertFatal(1==0, "recv_IF5 - Unknown packet_type %x", packet_type);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -83,12 +83,12 @@ int pbch_detection(PHY_VARS_UE *ue, runmode_t mode)
|
|||||||
lte_ue_measurements(ue,
|
lte_ue_measurements(ue,
|
||||||
ue->rx_offset,
|
ue->rx_offset,
|
||||||
0,
|
0,
|
||||||
0);
|
0,0);
|
||||||
|
|
||||||
|
|
||||||
if (ue->frame_parms.frame_type == TDD) {
|
if (ue->frame_parms.frame_type == TDD) {
|
||||||
ue_rrc_measurements(ue,
|
ue_rrc_measurements(ue,
|
||||||
1,
|
2,
|
||||||
0);
|
0);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
@@ -900,8 +900,8 @@ uint16_t rx_pbch(LTE_UE_COMMON *lte_ue_common_vars,
|
|||||||
#ifdef DEBUG_PBCH
|
#ifdef DEBUG_PBCH
|
||||||
msg("[PBCH] starting extract\n");
|
msg("[PBCH] starting extract\n");
|
||||||
#endif
|
#endif
|
||||||
pbch_extract(lte_ue_common_vars->rxdataF,
|
pbch_extract(lte_ue_common_vars->common_vars_rx_data_per_thread[0].rxdataF,
|
||||||
lte_ue_common_vars->dl_ch_estimates[eNB_id],
|
lte_ue_common_vars->common_vars_rx_data_per_thread[0].dl_ch_estimates[eNB_id],
|
||||||
lte_ue_pbch_vars->rxdataF_ext,
|
lte_ue_pbch_vars->rxdataF_ext,
|
||||||
lte_ue_pbch_vars->dl_ch_estimates_ext,
|
lte_ue_pbch_vars->dl_ch_estimates_ext,
|
||||||
symbol,
|
symbol,
|
||||||
|
|||||||
@@ -191,7 +191,7 @@ void generate_pcfich(uint8_t num_pdcch_symbols,
|
|||||||
// mapping
|
// mapping
|
||||||
nsymb = (frame_parms->Ncp==0) ? 14:12;
|
nsymb = (frame_parms->Ncp==0) ? 14:12;
|
||||||
|
|
||||||
symbol_offset = (uint32_t)frame_parms->ofdm_symbol_size*((subframe*nsymb));
|
symbol_offset = (uint32_t)frame_parms->ofdm_symbol_size*(subframe*nsymb);
|
||||||
re_offset = frame_parms->first_carrier_offset;
|
re_offset = frame_parms->first_carrier_offset;
|
||||||
|
|
||||||
// loop over 4 quadruplets and lookup REGs
|
// loop over 4 quadruplets and lookup REGs
|
||||||
|
|||||||
@@ -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 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) {
|
if (frame_parms->frame_type == FDD) {
|
||||||
return((subframe<4) ? (frame - 1) : frame);
|
pusch_frame = ((subframe<4) ? (frame - 1) : frame);
|
||||||
} else {
|
} else {
|
||||||
// Note this is not true, but it doesn't matter, the frame number is irrelevant for TDD!
|
// 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 phich_subframe2_pusch_subframe(LTE_DL_FRAME_PARMS *frame_parms,uint8_t subframe)
|
||||||
{
|
{
|
||||||
|
uint8_t pusch_subframe = 255;
|
||||||
|
|
||||||
if (frame_parms->frame_type == FDD)
|
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) {
|
switch (frame_parms->tdd_config) {
|
||||||
case 0:
|
case 0:
|
||||||
if (subframe == 0)
|
if (subframe == 0)
|
||||||
return(3);
|
pusch_subframe = (3);
|
||||||
else if (subframe == 5) {
|
else if (subframe == 5) {
|
||||||
return (8);
|
pusch_subframe = (8);
|
||||||
} else if (subframe == 6)
|
} else if (subframe == 6)
|
||||||
return (2);
|
pusch_subframe = (2);
|
||||||
else if (subframe == 1)
|
else if (subframe == 1)
|
||||||
return (7);
|
pusch_subframe = (7);
|
||||||
else {
|
else {
|
||||||
LOG_E(PHY, "phich.c: phich_subframe2_pusch_subframe, illegal subframe %d for tdd_config %d\n",
|
LOG_E(PHY, "phich.c: phich_subframe2_pusch_subframe, illegal subframe %d for tdd_config %d\n",
|
||||||
subframe,frame_parms->tdd_config);
|
subframe,frame_parms->tdd_config);
|
||||||
return(0);
|
pusch_subframe = (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 1:
|
case 1:
|
||||||
if (subframe == 6)
|
if (subframe == 6)
|
||||||
return(2);
|
pusch_subframe = (2);
|
||||||
else if (subframe == 9)
|
else if (subframe == 9)
|
||||||
return (3);
|
pusch_subframe = (3);
|
||||||
else if (subframe == 1)
|
else if (subframe == 1)
|
||||||
return (7);
|
pusch_subframe = (7);
|
||||||
else if (subframe == 4)
|
else if (subframe == 4)
|
||||||
return (8);
|
pusch_subframe = (8);
|
||||||
else {
|
else {
|
||||||
LOG_E(PHY,"phich.c: phich_subframe2_pusch_subframe, illegal subframe %d for tdd_config %d\n",
|
LOG_E(PHY,"phich.c: phich_subframe2_pusch_subframe, illegal subframe %d for tdd_config %d\n",
|
||||||
subframe,frame_parms->tdd_config);
|
subframe,frame_parms->tdd_config);
|
||||||
return(0);
|
pusch_subframe = (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 2:
|
case 2:
|
||||||
if (subframe == 8)
|
if (subframe == 8)
|
||||||
return(2);
|
pusch_subframe = (2);
|
||||||
else if (subframe == 3)
|
else if (subframe == 3)
|
||||||
return (7);
|
pusch_subframe = (7);
|
||||||
else {
|
else {
|
||||||
LOG_E(PHY,"phich.c: phich_subframe2_pusch_subframe, illegal subframe %d for tdd_config %d\n",
|
LOG_E(PHY,"phich.c: phich_subframe2_pusch_subframe, illegal subframe %d for tdd_config %d\n",
|
||||||
subframe,frame_parms->tdd_config);
|
subframe,frame_parms->tdd_config);
|
||||||
return(0);
|
pusch_subframe = (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 3:
|
case 3:
|
||||||
if ( (subframe == 8) || (subframe == 9) ) {
|
if ( (subframe == 8) || (subframe == 9) ) {
|
||||||
return(subframe-6);
|
pusch_subframe = (subframe-6);
|
||||||
} else if (subframe==0)
|
} else if (subframe==0)
|
||||||
return(4);
|
pusch_subframe = (4);
|
||||||
else {
|
else {
|
||||||
LOG_E(PHY,"phich.c: phich_subframe2_pusch_subframe, illegal subframe %d for tdd_config %d\n",
|
LOG_E(PHY,"phich.c: phich_subframe2_pusch_subframe, illegal subframe %d for tdd_config %d\n",
|
||||||
subframe,frame_parms->tdd_config);
|
subframe,frame_parms->tdd_config);
|
||||||
return(0);
|
pusch_subframe = (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 4:
|
case 4:
|
||||||
if ( (subframe == 8) || (subframe == 9) ) {
|
if ( (subframe == 8) || (subframe == 9) ) {
|
||||||
return(subframe-6);
|
pusch_subframe = (subframe-6);
|
||||||
} else {
|
} else {
|
||||||
LOG_E(PHY,"phich.c: phich_subframe2_pusch_subframe, illegal subframe %d for tdd_config %d\n",
|
LOG_E(PHY,"phich.c: phich_subframe2_pusch_subframe, illegal subframe %d for tdd_config %d\n",
|
||||||
subframe,frame_parms->tdd_config);
|
subframe,frame_parms->tdd_config);
|
||||||
return(0);
|
pusch_subframe = (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 5:
|
case 5:
|
||||||
if (subframe == 8) {
|
if (subframe == 8) {
|
||||||
return(2);
|
pusch_subframe = (2);
|
||||||
} else {
|
} else {
|
||||||
LOG_E(PHY,"phich.c: phich_subframe2_pusch_subframe, illegal subframe %d for tdd_config %d\n",
|
LOG_E(PHY,"phich.c: phich_subframe2_pusch_subframe, illegal subframe %d for tdd_config %d\n",
|
||||||
subframe,frame_parms->tdd_config);
|
subframe,frame_parms->tdd_config);
|
||||||
return(0);
|
pusch_subframe = (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 6:
|
case 6:
|
||||||
if (subframe == 6) {
|
if (subframe == 6) {
|
||||||
return(2);
|
pusch_subframe = (2);
|
||||||
} else if (subframe == 9) {
|
} else if (subframe == 9) {
|
||||||
return(3);
|
pusch_subframe = (3);
|
||||||
} else if (subframe == 0) {
|
} else if (subframe == 0) {
|
||||||
return(4);
|
pusch_subframe = (4);
|
||||||
} else if (subframe == 1) {
|
} else if (subframe == 1) {
|
||||||
return(7);
|
pusch_subframe = (7);
|
||||||
} else if (subframe == 5) {
|
} else if (subframe == 5) {
|
||||||
return(8);
|
pusch_subframe = (8);
|
||||||
} else {
|
} else {
|
||||||
LOG_E(PHY,"phich.c: phich_subframe2_pusch_subframe, illegal subframe %d for tdd_config %d\n",
|
LOG_E(PHY,"phich.c: phich_subframe2_pusch_subframe, illegal subframe %d for tdd_config %d\n",
|
||||||
subframe,frame_parms->tdd_config);
|
subframe,frame_parms->tdd_config);
|
||||||
return(0);
|
pusch_subframe = (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
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)
|
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) +
|
nseq_PHICH = ((ulsch->harq_processes[harq_pid]->first_rb/Ngroup_PHICH) +
|
||||||
ulsch->harq_processes[harq_pid]->n_DMRS)%(2*NSF_PHICH);
|
ulsch->harq_processes[harq_pid]->n_DMRS)%(2*NSF_PHICH);
|
||||||
} else {
|
} 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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1374,13 +1393,13 @@ void rx_phich(PHY_VARS_UE *ue,
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
//#ifdef DEBUG_PHICH
|
//#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,
|
ue->Mod_id,harq_pid,
|
||||||
proc->frame_rx,
|
proc->frame_rx%1024,
|
||||||
subframe,
|
subframe,
|
||||||
HI16,
|
HI16,
|
||||||
nseq_PHICH,
|
nseq_PHICH,
|
||||||
ngroup_PHICH,
|
ngroup_PHICH,ulsch->harq_processes[harq_pid]->round+1,
|
||||||
ulsch->Mlimit);
|
ulsch->Mlimit);
|
||||||
//#endif
|
//#endif
|
||||||
|
|
||||||
@@ -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);
|
//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
|
} else { //ACK
|
||||||
if (ue->ulsch_Msg3_active[eNB_id] == 1) {
|
if (ue->ulsch_Msg3_active[eNB_id] == 1) {
|
||||||
@@ -1428,7 +1450,7 @@ void rx_phich(PHY_VARS_UE *ue,
|
|||||||
//#ifdef PHICH_DEBUG
|
//#ifdef PHICH_DEBUG
|
||||||
LOG_D(PHY,"[UE %d][PUSCH %d] Frame %d subframe %d PHICH, received ACK (%d) nseq %d, ngroup %d\n\n",
|
LOG_D(PHY,"[UE %d][PUSCH %d] Frame %d subframe %d PHICH, received ACK (%d) nseq %d, ngroup %d\n\n",
|
||||||
ue->Mod_id,harq_pid,
|
ue->Mod_id,harq_pid,
|
||||||
proc->frame_rx,
|
proc->frame_rx%1024,
|
||||||
subframe, HI16,
|
subframe, HI16,
|
||||||
nseq_PHICH,ngroup_PHICH);
|
nseq_PHICH,ngroup_PHICH);
|
||||||
//#endif
|
//#endif
|
||||||
@@ -1449,7 +1471,11 @@ void rx_phich(PHY_VARS_UE *ue,
|
|||||||
// inform MAC?
|
// inform MAC?
|
||||||
ue->ulsch_Msg3_active[eNB_id] = 0;
|
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
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ void dump_mch(PHY_VARS_UE *ue,uint8_t eNB_id,uint16_t coded_bits_per_codeword,in
|
|||||||
write_output(fname,vname,ue->pdsch_vars_MCH[eNB_id]->dl_ch_magb0[0],12*N_RB_DL*nsymb_pmch,1,1);
|
write_output(fname,vname,ue->pdsch_vars_MCH[eNB_id]->dl_ch_magb0[0],12*N_RB_DL*nsymb_pmch,1,1);
|
||||||
|
|
||||||
write_output("mch00_ch0.m","pmch00_ch0",
|
write_output("mch00_ch0.m","pmch00_ch0",
|
||||||
&(ue->common_vars.dl_ch_estimates[eNB_id][0][0]),
|
&(ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][0][0]),
|
||||||
ue->frame_parms.ofdm_symbol_size*12,1,1);
|
ue->frame_parms.ofdm_symbol_size*12,1,1);
|
||||||
|
|
||||||
write_output("rxsig_mch.m","rxs_mch",
|
write_output("rxsig_mch.m","rxs_mch",
|
||||||
@@ -969,8 +969,8 @@ int rx_pmch(PHY_VARS_UE *ue,
|
|||||||
|
|
||||||
//printf("*********************mch: symbol %d\n",symbol);
|
//printf("*********************mch: symbol %d\n",symbol);
|
||||||
|
|
||||||
mch_extract_rbs(common_vars->rxdataF,
|
mch_extract_rbs(common_vars->common_vars_rx_data_per_thread[subframe&0x1].rxdataF,
|
||||||
common_vars->dl_ch_estimates[eNB_id],
|
common_vars->common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id],
|
||||||
pdsch_vars[eNB_id]->rxdataF_ext,
|
pdsch_vars[eNB_id]->rxdataF_ext,
|
||||||
pdsch_vars[eNB_id]->dl_ch_estimates_ext,
|
pdsch_vars[eNB_id]->dl_ch_estimates_ext,
|
||||||
symbol,
|
symbol,
|
||||||
|
|||||||
@@ -1185,9 +1185,7 @@ void rx_prach(PHY_VARS_eNB *eNB,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (eNB->frame_parms.threequarter_fs == 1)
|
// Adjust CP length based on UL bandwidth
|
||||||
Ncp=(Ncp*3)>>2;
|
|
||||||
|
|
||||||
switch (eNB->frame_parms.N_RB_UL) {
|
switch (eNB->frame_parms.N_RB_UL) {
|
||||||
case 6:
|
case 6:
|
||||||
Ncp>>=4;
|
Ncp>>=4;
|
||||||
@@ -1208,6 +1206,11 @@ void rx_prach(PHY_VARS_eNB *eNB,
|
|||||||
case 75:
|
case 75:
|
||||||
Ncp=(Ncp*3)>>2;
|
Ncp=(Ncp*3)>>2;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 100:
|
||||||
|
if (eNB->frame_parms.threequarter_fs == 1)
|
||||||
|
Ncp=(Ncp*3)>>2;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -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 dlsch_llr Pointer to LLR values computed by dlsch_demodulation
|
||||||
@param lte_frame_parms Pointer to frame descriptor
|
@param lte_frame_parms Pointer to frame descriptor
|
||||||
@param dlsch Pointer to DLSCH descriptor
|
@param dlsch Pointer to DLSCH descriptor
|
||||||
|
@param frame Frame number
|
||||||
@param subframe Subframe number
|
@param subframe Subframe number
|
||||||
@param num_pdcch_symbols Number of PDCCH symbols
|
@param num_pdcch_symbols Number of PDCCH symbols
|
||||||
@param is_crnti indicates if PDSCH belongs to a CRNTI (necessary for parallelizing decoding threads)
|
@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_DL_FRAME_PARMS *lte_frame_parms,
|
||||||
LTE_UE_DLSCH_t *dlsch,
|
LTE_UE_DLSCH_t *dlsch,
|
||||||
LTE_DL_UE_HARQ_t *harq_process,
|
LTE_DL_UE_HARQ_t *harq_process,
|
||||||
|
uint8_t frame,
|
||||||
uint8_t subframe,
|
uint8_t subframe,
|
||||||
uint8_t harq_pid,
|
uint8_t harq_pid,
|
||||||
uint8_t is_crnti,
|
uint8_t is_crnti,
|
||||||
@@ -1179,6 +1181,7 @@ int32_t rx_pdsch(PHY_VARS_UE *phy_vars_ue,
|
|||||||
PDSCH_t type,
|
PDSCH_t type,
|
||||||
uint8_t eNB_id,
|
uint8_t eNB_id,
|
||||||
uint8_t eNB_id_i,
|
uint8_t eNB_id_i,
|
||||||
|
uint32_t frame,
|
||||||
uint8_t subframe,
|
uint8_t subframe,
|
||||||
uint8_t symbol,
|
uint8_t symbol,
|
||||||
uint8_t first_symbol_flag,
|
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,
|
int32_t rx_pdcch(LTE_UE_COMMON *lte_ue_common_vars,
|
||||||
LTE_UE_PDCCH **lte_ue_pdcch_vars,
|
LTE_UE_PDCCH **lte_ue_pdcch_vars,
|
||||||
LTE_DL_FRAME_PARMS *frame_parms,
|
LTE_DL_FRAME_PARMS *frame_parms,
|
||||||
|
uint32_t frame,
|
||||||
uint8_t subframe,
|
uint8_t subframe,
|
||||||
uint8_t eNB_id,
|
uint8_t eNB_id,
|
||||||
MIMO_mode_t mimo_mode,
|
MIMO_mode_t mimo_mode,
|
||||||
uint32_t high_speed_flag,
|
uint32_t high_speed_flag,
|
||||||
uint8_t is_secondary_ue);
|
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)
|
/*! \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 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
|
@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 si_rnti,
|
||||||
uint16_t ra_rnti,
|
uint16_t ra_rnti,
|
||||||
uint16_t p_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,
|
int32_t generate_eNB_dlsch_params_from_dci(int frame,
|
||||||
uint8_t subframe,
|
uint8_t subframe,
|
||||||
@@ -1538,7 +1570,8 @@ int32_t generate_ue_ulsch_params_from_rar(PHY_VARS_UE *phy_vars_ue,
|
|||||||
UE_rxtx_proc_t *proc,
|
UE_rxtx_proc_t *proc,
|
||||||
uint8_t eNB_id);
|
uint8_t eNB_id);
|
||||||
double sinr_eff_cqi_calc(PHY_VARS_UE *phy_vars_ue,
|
double sinr_eff_cqi_calc(PHY_VARS_UE *phy_vars_ue,
|
||||||
uint8_t eNB_id);
|
uint8_t eNB_id,
|
||||||
|
uint8_t subframe);
|
||||||
|
|
||||||
uint8_t sinr2cqi(double sinr,uint8_t trans_mode);
|
uint8_t sinr2cqi(double sinr,uint8_t trans_mode);
|
||||||
|
|
||||||
|
|||||||
@@ -555,6 +555,7 @@ void generate_pucch2x(int32_t **txdataF,
|
|||||||
N_UL_symb = (fp->Ncp==0) ? 7 : 6;
|
N_UL_symb = (fp->Ncp==0) ? 7 : 6;
|
||||||
data_ind = 0;
|
data_ind = 0;
|
||||||
zptr = z;
|
zptr = z;
|
||||||
|
nprime = 0;
|
||||||
for (ns=(subframe<<1),u=u0,v=v0; ns<(2+(subframe<<1)); ns++,u=u1,v=v1) {
|
for (ns=(subframe<<1),u=u0,v=v0; ns<(2+(subframe<<1)); ns++,u=u1,v=v1) {
|
||||||
|
|
||||||
if ((ns&1) == 0)
|
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 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
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
@@ -162,7 +163,7 @@ int pss_sss_extract(PHY_VARS_UE *ue,
|
|||||||
int rx_offset = frame_parms->ofdm_symbol_size-3*12;
|
int rx_offset = frame_parms->ofdm_symbol_size-3*12;
|
||||||
uint8_t pss_symb,sss_symb;
|
uint8_t pss_symb,sss_symb;
|
||||||
|
|
||||||
int32_t **rxdataF = ue->common_vars.rxdataF;
|
int32_t **rxdataF = ue->common_vars.common_vars_rx_data_per_thread[0].rxdataF;
|
||||||
|
|
||||||
if (frame_parms->frame_type == FDD) {
|
if (frame_parms->frame_type == FDD) {
|
||||||
pss_symb = 6-frame_parms->Ncp;
|
pss_symb = 6-frame_parms->Ncp;
|
||||||
@@ -191,8 +192,8 @@ int pss_sss_extract(PHY_VARS_UE *ue,
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (i=0; i<12; i++) {
|
for (i=0; i<12; i++) {
|
||||||
pss_rxF_ext[i]=pss_rxF[i];
|
if (doPss) {pss_rxF_ext[i]=pss_rxF[i];}
|
||||||
sss_rxF_ext[i]=sss_rxF[i];
|
if (doSss) {sss_rxF_ext[i]=sss_rxF[i];}
|
||||||
}
|
}
|
||||||
|
|
||||||
pss_rxF+=12;
|
pss_rxF+=12;
|
||||||
@@ -206,6 +207,28 @@ int pss_sss_extract(PHY_VARS_UE *ue,
|
|||||||
return(0);
|
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_re[7] = {16383, 25101, 30791, 32767, 30791, 25101, 16383};
|
||||||
int16_t phase_im[7] = {-28378, -21063, -11208, 0, 11207, 21062, 28377};
|
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) {
|
switch(uci_format) {
|
||||||
case wideband_cqi_rank1_2A:
|
case wideband_cqi_rank1_2A:
|
||||||
#ifdef DEBUG_UCI
|
#ifdef DEBUG_UCI
|
||||||
|
LOG_D(PHY,"[PRINT CQI] flat_LA %d\n", flag_LA);
|
||||||
switch(N_RB_DL) {
|
switch(N_RB_DL) {
|
||||||
case 6:
|
case 6:
|
||||||
LOG_I(PHY,"[PRINT CQI] wideband_cqi rank 1: eNB %d, cqi %d\n",eNB_id,
|
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);
|
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);
|
free_ue_ulsch(ulsch);
|
||||||
return(NULL);
|
return(NULL);
|
||||||
|
|
||||||
@@ -234,7 +234,7 @@ uint32_t ulsch_encoding(uint8_t *a,
|
|||||||
PHY_MEASUREMENTS *meas = &ue->measurements;
|
PHY_MEASUREMENTS *meas = &ue->measurements;
|
||||||
LTE_UE_ULSCH_t *ulsch=ue->ulsch[eNB_id];
|
LTE_UE_ULSCH_t *ulsch=ue->ulsch[eNB_id];
|
||||||
LTE_UE_DLSCH_t **dlsch = ue->dlsch[eNB_id];
|
LTE_UE_DLSCH_t **dlsch = ue->dlsch[eNB_id];
|
||||||
uint16_t rnti;
|
uint16_t rnti = 0xffff;
|
||||||
|
|
||||||
if (!ulsch) {
|
if (!ulsch) {
|
||||||
LOG_E(PHY,"Null ulsch ptr %p\n",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
|
// fill CQI/PMI information
|
||||||
if (ulsch->O>0) {
|
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;
|
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);
|
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));
|
//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;
|
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) {
|
if (ulsch->O<=32) {
|
||||||
@@ -469,6 +471,16 @@ uint32_t ulsch_encoding(uint8_t *a,
|
|||||||
Q_ACK = Qprime * Q_m;
|
Q_ACK = Qprime * Q_m;
|
||||||
Qprime_ACK = Qprime;
|
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
|
// Compute Q_cqi, assume O>11, p. 26 36-212
|
||||||
if (control_only_flag == 0) {
|
if (control_only_flag == 0) {
|
||||||
|
|
||||||
|
|||||||
@@ -1440,7 +1440,7 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,
|
|||||||
|
|
||||||
j2+=Q_m;
|
j2+=Q_m;
|
||||||
}
|
}
|
||||||
|
/* To be improved according to alignment of j2
|
||||||
#if defined(__x86_64__)||defined(__i386__)
|
#if defined(__x86_64__)||defined(__i386__)
|
||||||
#ifndef __AVX2__
|
#ifndef __AVX2__
|
||||||
for (iprime=0; iprime<G;iprime+=8,j2+=8)
|
for (iprime=0; iprime<G;iprime+=8,j2+=8)
|
||||||
@@ -1452,9 +1452,24 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,
|
|||||||
#elif defined(__arm__)
|
#elif defined(__arm__)
|
||||||
for (iprime=0; iprime<G;iprime+=8,j2+=8)
|
for (iprime=0; iprime<G;iprime+=8,j2+=8)
|
||||||
*((int16x8_t *)&ulsch_harq->e[iprime]) = *((int16x8_t *)&y[j2]);
|
*((int16x8_t *)&ulsch_harq->e[iprime]) = *((int16x8_t *)&y[j2]);
|
||||||
#endif
|
#endif
|
||||||
|
*/
|
||||||
|
int16_t *yp,*ep;
|
||||||
|
for (iprime=0,yp=&y[j2],ep=&ulsch_harq->e[0];
|
||||||
|
iprime<G;
|
||||||
|
iprime+=8,j2+=8,ep+=8,yp+=8) {
|
||||||
|
ep[0] = yp[0];
|
||||||
|
ep[1] = yp[1];
|
||||||
|
ep[2] = yp[2];
|
||||||
|
ep[3] = yp[3];
|
||||||
|
ep[4] = yp[4];
|
||||||
|
ep[5] = yp[5];
|
||||||
|
ep[6] = yp[6];
|
||||||
|
ep[7] = yp[7];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
stop_meas(&eNB->ulsch_demultiplexing_stats);
|
stop_meas(&eNB->ulsch_demultiplexing_stats);
|
||||||
|
|
||||||
// printf("after ACKNAK2 c[%d] = %p (iprime %d, G %d)\n",0,ulsch_harq->c[0],iprime,G);
|
// printf("after ACKNAK2 c[%d] = %p (iprime %d, G %d)\n",0,ulsch_harq->c[0],iprime,G);
|
||||||
|
|||||||
@@ -63,28 +63,30 @@ int beam_precoding(int32_t **txdataF,
|
|||||||
// clear txdata_BF[aa][re] for each call of ue_spec_beamforming
|
// clear txdata_BF[aa][re] for each call of ue_spec_beamforming
|
||||||
memset(txdataF_BF[aa],0,sizeof(int32_t)*(frame_parms->ofdm_symbol_size));
|
memset(txdataF_BF[aa],0,sizeof(int32_t)*(frame_parms->ofdm_symbol_size));
|
||||||
|
|
||||||
for (p=0; p<14; p++) {
|
for (p=0; p<NB_ANTENNA_PORTS_ENB; p++) {
|
||||||
//if (p==0 || p==1 || p==5 || p>7)
|
if (p<frame_parms->nb_antenna_ports_eNB || p==5) {
|
||||||
// mult_cpx_conj_vector((int16_t*)txdataF[p], (int16_t*)beam_weights[p][aa], (int16_t*)txdataF_BF[aa], frame_parms->ofdm_symbol_size, 15);
|
multadd_cpx_vector((int16_t*)&txdataF[p][slot_offset_F+symbol*frame_parms->ofdm_symbol_size],(int16_t*)beam_weights[p][aa], (int16_t*)txdataF_BF[aa], 0, frame_parms->ofdm_symbol_size, 15);
|
||||||
for (re=0;re<frame_parms->ofdm_symbol_size;re++) {
|
//mult_cpx_conj_vector((int16_t*)beam_weights[p][aa], (int16_t*)&txdataF[p][slot_offset_F+symbol*frame_parms->ofdm_symbol_size], (int16_t*)txdataF_BF[aa], frame_parms->ofdm_symbol_size, 15, 1);
|
||||||
if ((p==0 || p==1 || p==5 || p>=7) && txdataF[p][slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re]!=0) {
|
|
||||||
((int16_t*)&txdataF_BF[aa][re])[0] += (int16_t)((((int16_t*)&txdataF[p][slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re])[0]*((int16_t*)&beam_weights[p][aa][re])[0])>>15);
|
|
||||||
((int16_t*)&txdataF_BF[aa][re])[0] -= (int16_t)((((int16_t*)&txdataF[p][slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re])[1]*((int16_t*)&beam_weights[p][aa][re])[1])>>15);
|
|
||||||
((int16_t*)&txdataF_BF[aa][re])[1] += (int16_t)((((int16_t*)&txdataF[p][slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re])[0]*((int16_t*)&beam_weights[p][aa][re])[1])>>15);
|
|
||||||
((int16_t*)&txdataF_BF[aa][re])[1] += (int16_t)((((int16_t*)&txdataF[p][slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re])[1]*((int16_t*)&beam_weights[p][aa][re])[0])>>15);
|
|
||||||
|
|
||||||
/*
|
// if check version
|
||||||
printf("beamforming.c:txdataF[%d][%d]=%d+j%d, beam_weights[%d][%d][%d]=%d+j%d,txdata_BF[%d][%d]=%d+j%d\n",
|
/*for (re=0;re<frame_parms->ofdm_symbol_size;re++) {
|
||||||
p,slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re,
|
if (txdataF[p][slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re]!=0) {
|
||||||
((int16_t*)&txdataF[p][slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re])[0],
|
((int16_t*)&txdataF_BF[aa][re])[0] += (int16_t)((((int16_t*)&txdataF[p][slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re])[0]*((int16_t*)&beam_weights[p][aa][re])[0])>>15);
|
||||||
((int16_t*)&txdataF[p][slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re])[1],
|
((int16_t*)&txdataF_BF[aa][re])[0] -= (int16_t)((((int16_t*)&txdataF[p][slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re])[1]*((int16_t*)&beam_weights[p][aa][re])[1])>>15);
|
||||||
p,aa,re,
|
((int16_t*)&txdataF_BF[aa][re])[1] += (int16_t)((((int16_t*)&txdataF[p][slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re])[0]*((int16_t*)&beam_weights[p][aa][re])[1])>>15);
|
||||||
((int16_t*)&beam_weights[p][aa][re])[0],((int16_t*)&beam_weights[p][aa][re])[1],
|
((int16_t*)&txdataF_BF[aa][re])[1] += (int16_t)((((int16_t*)&txdataF[p][slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re])[1]*((int16_t*)&beam_weights[p][aa][re])[0])>>15);
|
||||||
aa,re,
|
|
||||||
((int16_t*)&txdataF_BF[aa][re])[0],
|
printf("beamforming.c:txdataF[%d][%d]=%d+j%d, beam_weights[%d][%d][%d]=%d+j%d,txdata_BF[%d][%d]=%d+j%d\n",
|
||||||
((int16_t*)&txdataF_BF[aa][re])[1]);
|
p,slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re,
|
||||||
*/
|
((int16_t*)&txdataF[p][slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re])[0],
|
||||||
}
|
((int16_t*)&txdataF[p][slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re])[1],
|
||||||
|
p,aa,re,
|
||||||
|
((int16_t*)&beam_weights[p][aa][re])[0],((int16_t*)&beam_weights[p][aa][re])[1],
|
||||||
|
aa,re,
|
||||||
|
((int16_t*)&txdataF_BF[aa][re])[0],
|
||||||
|
((int16_t*)&txdataF_BF[aa][re])[1]);
|
||||||
|
}
|
||||||
|
}*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@@ -1,11 +1,12 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
#include <stdlib.h>
|
||||||
#include "PHY/impl_defs_lte.h"
|
#include "PHY/impl_defs_lte.h"
|
||||||
|
|
||||||
int f_read(char *calibF_fname, int nb_ant, int nb_freq, int32_t **tdd_calib_coeffs){
|
int f_read(char *calibF_fname, int nb_ant, int nb_freq, int32_t **tdd_calib_coeffs){
|
||||||
|
|
||||||
FILE *calibF_fd;
|
FILE *calibF_fd;
|
||||||
int i,j,l,calibF_e;
|
int i,j,calibF_e;
|
||||||
|
|
||||||
calibF_fd = fopen(calibF_fname,"r");
|
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(i=0;i<nb_ant;i++){
|
||||||
for(j=0;j<nb_freq*2;j++){
|
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;
|
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]);
|
printf("%d\n",(int)tdd_calib_coeffs[1][599]);
|
||||||
} else
|
} else
|
||||||
printf("%s not found, running with defaults\n",calibF_fname);
|
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) {
|
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 :
|
default :
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
/* TODO: what to return? is this code used at all? */
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// temporal test function
|
// temporal test function
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ void normal_prefix_mod(int32_t *txdataF,int32_t *txdata,uint8_t nsymb,LTE_DL_FRA
|
|||||||
|
|
||||||
void do_OFDM_mod(int32_t **txdataF, int32_t **txdata, uint32_t frame,uint16_t next_slot, LTE_DL_FRAME_PARMS *frame_parms);
|
void do_OFDM_mod(int32_t **txdataF, int32_t **txdata, uint32_t frame,uint16_t next_slot, LTE_DL_FRAME_PARMS *frame_parms);
|
||||||
|
|
||||||
void do_OFDM_mod_symbol(LTE_eNB_COMMON *eNB_common_vars, int eNB_id, uint16_t next_slot, LTE_DL_FRAME_PARMS *frame_parms);
|
void do_OFDM_mod_symbol(LTE_eNB_COMMON *eNB_common_vars, int eNB_id, uint16_t next_slot, LTE_DL_FRAME_PARMS *frame_parms,int do_precoding);
|
||||||
|
|
||||||
void remove_7_5_kHz(PHY_VARS_eNB *phy_vars_eNB,uint8_t subframe);
|
void remove_7_5_kHz(PHY_VARS_eNB *phy_vars_eNB,uint8_t subframe);
|
||||||
|
|
||||||
|
|||||||
@@ -145,7 +145,7 @@ void PHY_ofdm_mod(int *input, /// pointer to complex input
|
|||||||
#else
|
#else
|
||||||
// on AVX2 need 256-bit alignment
|
// on AVX2 need 256-bit alignment
|
||||||
idft((int16_t *)&input[i*fftsize],
|
idft((int16_t *)&input[i*fftsize],
|
||||||
(fftsize<=512) ? (int16_t *)temp : (int16_t *)&output[(i*fftsize) + ((1+i)*nb_prefix_samples)],
|
(int16_t *)temp,
|
||||||
1);
|
1);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@@ -163,8 +163,6 @@ void PHY_ofdm_mod(int *input, /// pointer to complex input
|
|||||||
|
|
||||||
#ifndef __AVX2__
|
#ifndef __AVX2__
|
||||||
if (fftsize==128)
|
if (fftsize==128)
|
||||||
#else
|
|
||||||
if (fftsize<=512)
|
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
for (j=0; j<fftsize ; j++) {
|
for (j=0; j<fftsize ; j++) {
|
||||||
@@ -285,16 +283,16 @@ void do_OFDM_mod(int32_t **txdataF, int32_t **txdata, uint32_t frame,uint16_t ne
|
|||||||
}
|
}
|
||||||
|
|
||||||
// OFDM modulation for each symbol
|
// OFDM modulation for each symbol
|
||||||
void do_OFDM_mod_symbol(LTE_eNB_COMMON *eNB_common_vars, int eNB_id, uint16_t next_slot, LTE_DL_FRAME_PARMS *frame_parms)
|
void do_OFDM_mod_symbol(LTE_eNB_COMMON *eNB_common_vars, int eNB_id, uint16_t next_slot, LTE_DL_FRAME_PARMS *frame_parms,int do_precoding)
|
||||||
{
|
{
|
||||||
|
|
||||||
int aa, l, slot_offset;
|
int aa, l, slot_offset, slot_offsetF;
|
||||||
int32_t **txdataF = eNB_common_vars->txdataF[eNB_id];
|
int32_t **txdataF = eNB_common_vars->txdataF[eNB_id];
|
||||||
int32_t **txdataF_BF = eNB_common_vars->txdataF_BF[eNB_id];
|
int32_t **txdataF_BF = eNB_common_vars->txdataF_BF[eNB_id];
|
||||||
int32_t **txdata = eNB_common_vars->txdata[eNB_id];
|
int32_t **txdata = eNB_common_vars->txdata[eNB_id];
|
||||||
|
|
||||||
slot_offset = (next_slot)*(frame_parms->samples_per_tti>>1);
|
|
||||||
|
|
||||||
|
slot_offset = (next_slot)*(frame_parms->samples_per_tti>>1);
|
||||||
|
slot_offsetF = (next_slot)*(frame_parms->ofdm_symbol_size)*((frame_parms->Ncp==EXTENDED) ? 6 : 7);
|
||||||
//printf("Thread %d starting ... aa %d (%llu)\n",omp_get_thread_num(),aa,rdtsc());
|
//printf("Thread %d starting ... aa %d (%llu)\n",omp_get_thread_num(),aa,rdtsc());
|
||||||
for (l=0; l<frame_parms->symbols_per_tti>>1; l++) {
|
for (l=0; l<frame_parms->symbols_per_tti>>1; l++) {
|
||||||
|
|
||||||
@@ -302,13 +300,13 @@ void do_OFDM_mod_symbol(LTE_eNB_COMMON *eNB_common_vars, int eNB_id, uint16_t ne
|
|||||||
|
|
||||||
//printf("do_OFDM_mod_l, slot=%d, l=%d, NUMBER_OF_OFDM_CARRIERS=%d,OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES=%d\n",next_slot, l,NUMBER_OF_OFDM_CARRIERS,OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES);
|
//printf("do_OFDM_mod_l, slot=%d, l=%d, NUMBER_OF_OFDM_CARRIERS=%d,OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES=%d\n",next_slot, l,NUMBER_OF_OFDM_CARRIERS,OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES);
|
||||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_BEAM_PRECODING,1);
|
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_BEAM_PRECODING,1);
|
||||||
beam_precoding(txdataF,txdataF_BF,frame_parms,eNB_common_vars->beam_weights[eNB_id],next_slot,l,aa);
|
if (do_precoding==1) beam_precoding(txdataF,txdataF_BF,frame_parms,eNB_common_vars->beam_weights[eNB_id],next_slot,l,aa);
|
||||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_BEAM_PRECODING,0);
|
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_BEAM_PRECODING,0);
|
||||||
|
|
||||||
//PMCH case not implemented...
|
//PMCH case not implemented...
|
||||||
|
|
||||||
if (frame_parms->Ncp == 1)
|
if (frame_parms->Ncp == EXTENDED)
|
||||||
PHY_ofdm_mod(txdataF_BF[aa], // input
|
PHY_ofdm_mod((do_precoding == 1)?txdataF_BF[aa]:&txdataF[aa][slot_offsetF+l*frame_parms->ofdm_symbol_size], // input
|
||||||
&txdata[aa][slot_offset+l*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES], // output
|
&txdata[aa][slot_offset+l*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES], // output
|
||||||
frame_parms->ofdm_symbol_size,
|
frame_parms->ofdm_symbol_size,
|
||||||
1, // number of symbols
|
1, // number of symbols
|
||||||
@@ -316,7 +314,7 @@ void do_OFDM_mod_symbol(LTE_eNB_COMMON *eNB_common_vars, int eNB_id, uint16_t ne
|
|||||||
CYCLIC_PREFIX);
|
CYCLIC_PREFIX);
|
||||||
else {
|
else {
|
||||||
if (l==0) {
|
if (l==0) {
|
||||||
PHY_ofdm_mod(txdataF_BF[aa], // input
|
PHY_ofdm_mod((do_precoding==1)?txdataF_BF[aa]:&txdataF[aa][slot_offsetF+l*frame_parms->ofdm_symbol_size], // input
|
||||||
&txdata[aa][slot_offset], // output
|
&txdata[aa][slot_offset], // output
|
||||||
frame_parms->ofdm_symbol_size,
|
frame_parms->ofdm_symbol_size,
|
||||||
1, // number of symbols
|
1, // number of symbols
|
||||||
@@ -324,7 +322,7 @@ void do_OFDM_mod_symbol(LTE_eNB_COMMON *eNB_common_vars, int eNB_id, uint16_t ne
|
|||||||
CYCLIC_PREFIX);
|
CYCLIC_PREFIX);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
PHY_ofdm_mod(txdataF_BF[aa], // input
|
PHY_ofdm_mod((do_precoding==1)?txdataF_BF[aa]:&txdataF[aa][slot_offsetF+l*frame_parms->ofdm_symbol_size], // input
|
||||||
&txdata[aa][slot_offset+OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES0+(l-1)*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES], // output
|
&txdata[aa][slot_offset+OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES0+(l-1)*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES], // output
|
||||||
frame_parms->ofdm_symbol_size,
|
frame_parms->ofdm_symbol_size,
|
||||||
1, // number of symbols
|
1, // number of symbols
|
||||||
|
|||||||
@@ -109,18 +109,12 @@ int slot_fep(PHY_VARS_UE *ue,
|
|||||||
|
|
||||||
|
|
||||||
for (aa=0; aa<frame_parms->nb_antennas_rx; aa++) {
|
for (aa=0; aa<frame_parms->nb_antennas_rx; aa++) {
|
||||||
memset(&common_vars->rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],0,frame_parms->ofdm_symbol_size*sizeof(int));
|
memset(&common_vars->common_vars_rx_data_per_thread[(Ns>>1)&0x1].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],0,frame_parms->ofdm_symbol_size*sizeof(int));
|
||||||
|
|
||||||
rx_offset = sample_offset + slot_offset + nb_prefix_samples0 + subframe_offset - SOFFSET;
|
rx_offset = sample_offset + slot_offset + nb_prefix_samples0 + subframe_offset - SOFFSET;
|
||||||
// Align with 256 bit
|
// Align with 256 bit
|
||||||
// rx_offset = rx_offset&0xfffffff8;
|
// rx_offset = rx_offset&0xfffffff8;
|
||||||
|
|
||||||
#ifdef DEBUG_FEP
|
|
||||||
// if (ue->frame <100)
|
|
||||||
printf("slot_fep: frame %d: slot %d, symbol %d, nb_prefix_samples %d, nb_prefix_samples0 %d, slot_offset %d, subframe_offset %d, sample_offset %d,rx_offset %d\n", ue->proc.proc_rxtx[(Ns>>1)&1].frame_rx,Ns, symbol,
|
|
||||||
nb_prefix_samples,nb_prefix_samples0,slot_offset,subframe_offset,sample_offset,rx_offset);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (l==0) {
|
if (l==0) {
|
||||||
|
|
||||||
if (rx_offset > (frame_length_samples - frame_parms->ofdm_symbol_size))
|
if (rx_offset > (frame_length_samples - frame_parms->ofdm_symbol_size))
|
||||||
@@ -133,12 +127,12 @@ int slot_fep(PHY_VARS_UE *ue,
|
|||||||
(void *)&common_vars->rxdata[aa][rx_offset % frame_length_samples],
|
(void *)&common_vars->rxdata[aa][rx_offset % frame_length_samples],
|
||||||
frame_parms->ofdm_symbol_size*sizeof(int));
|
frame_parms->ofdm_symbol_size*sizeof(int));
|
||||||
dft((int16_t *)tmp_dft_in,
|
dft((int16_t *)tmp_dft_in,
|
||||||
(int16_t *)&common_vars->rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1);
|
(int16_t *)&common_vars->common_vars_rx_data_per_thread[(Ns>>1)&0x1].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1);
|
||||||
} else { // use dft input from RX buffer directly
|
} else { // use dft input from RX buffer directly
|
||||||
start_meas(&ue->rx_dft_stats);
|
start_meas(&ue->rx_dft_stats);
|
||||||
|
|
||||||
dft((int16_t *)&common_vars->rxdata[aa][(rx_offset) % frame_length_samples],
|
dft((int16_t *)&common_vars->rxdata[aa][(rx_offset) % frame_length_samples],
|
||||||
(int16_t *)&common_vars->rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1);
|
(int16_t *)&common_vars->common_vars_rx_data_per_thread[(Ns>>1)&0x1].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1);
|
||||||
stop_meas(&ue->rx_dft_stats);
|
stop_meas(&ue->rx_dft_stats);
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -148,8 +142,8 @@ int slot_fep(PHY_VARS_UE *ue,
|
|||||||
|
|
||||||
#ifdef DEBUG_FEP
|
#ifdef DEBUG_FEP
|
||||||
// if (ue->frame <100)
|
// if (ue->frame <100)
|
||||||
printf("slot_fep: frame %d: slot %d, symbol %d, nb_prefix_samples %d, nb_prefix_samples0 %d, slot_offset %d, subframe_offset %d, sample_offset %d,rx_offset %d\n", ue->proc.proc_rxtx[(Ns>>1)&1].frame_rx,Ns, symbol,
|
LOG_I(PHY,"slot_fep: frame %d: slot %d, symbol %d, nb_prefix_samples %d, nb_prefix_samples0 %d, slot_offset %d, subframe_offset %d, sample_offset %d,rx_offset %d, frame_length_samples %d\n", ue->proc.proc_rxtx[(Ns>>1)&1].frame_rx,Ns, symbol,
|
||||||
nb_prefix_samples,nb_prefix_samples0,slot_offset,subframe_offset,sample_offset,rx_offset);
|
nb_prefix_samples,nb_prefix_samples0,slot_offset,subframe_offset,sample_offset,rx_offset,frame_length_samples);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (rx_offset > (frame_length_samples - frame_parms->ofdm_symbol_size))
|
if (rx_offset > (frame_length_samples - frame_parms->ofdm_symbol_size))
|
||||||
@@ -164,11 +158,11 @@ int slot_fep(PHY_VARS_UE *ue,
|
|||||||
(void *)&common_vars->rxdata[aa][(rx_offset) % frame_length_samples],
|
(void *)&common_vars->rxdata[aa][(rx_offset) % frame_length_samples],
|
||||||
frame_parms->ofdm_symbol_size*sizeof(int));
|
frame_parms->ofdm_symbol_size*sizeof(int));
|
||||||
dft((int16_t *)tmp_dft_in,
|
dft((int16_t *)tmp_dft_in,
|
||||||
(int16_t *)&common_vars->rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1);
|
(int16_t *)&common_vars->common_vars_rx_data_per_thread[(Ns>>1)&0x1].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1);
|
||||||
} else { // use dft input from RX buffer directly
|
} else { // use dft input from RX buffer directly
|
||||||
|
|
||||||
dft((int16_t *)&common_vars->rxdata[aa][(rx_offset) % frame_length_samples],
|
dft((int16_t *)&common_vars->rxdata[aa][(rx_offset) % frame_length_samples],
|
||||||
(int16_t *)&common_vars->rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1);
|
(int16_t *)&common_vars->common_vars_rx_data_per_thread[(Ns>>1)&0x1].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1);
|
||||||
}
|
}
|
||||||
|
|
||||||
stop_meas(&ue->rx_dft_stats);
|
stop_meas(&ue->rx_dft_stats);
|
||||||
@@ -176,6 +170,10 @@ int slot_fep(PHY_VARS_UE *ue,
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef DEBUG_FEP
|
||||||
|
// if (ue->frame <100)
|
||||||
|
printf("slot_fep: frame %d: symbol %d rx_offset %d\n", ue->proc.proc_rxtx[(Ns>>1)&1].frame_rx, symbol,rx_offset);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ue->perfect_ce == 0) {
|
if (ue->perfect_ce == 0) {
|
||||||
@@ -211,7 +209,7 @@ int slot_fep(PHY_VARS_UE *ue,
|
|||||||
|
|
||||||
if (l==(4-frame_parms->Ncp)) {
|
if (l==(4-frame_parms->Ncp)) {
|
||||||
start_meas(&ue->dlsch_freq_offset_estimation_stats);
|
start_meas(&ue->dlsch_freq_offset_estimation_stats);
|
||||||
lte_est_freq_offset(common_vars->dl_ch_estimates[0],
|
lte_est_freq_offset(common_vars->common_vars_rx_data_per_thread[(Ns>>1)&0x1].dl_ch_estimates[0],
|
||||||
frame_parms,
|
frame_parms,
|
||||||
l,
|
l,
|
||||||
&common_vars->freq_offset,
|
&common_vars->freq_offset,
|
||||||
|
|||||||
@@ -109,14 +109,14 @@ int slot_fep_mbsfn(PHY_VARS_UE *ue,
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
for (aa=0; aa<frame_parms->nb_antennas_rx; aa++) {
|
for (aa=0; aa<frame_parms->nb_antennas_rx; aa++) {
|
||||||
memset(&common_vars->rxdataF[aa][frame_parms->ofdm_symbol_size*l],0,frame_parms->ofdm_symbol_size*sizeof(int));
|
memset(&common_vars->common_vars_rx_data_per_thread[subframe&0x1].rxdataF[aa][frame_parms->ofdm_symbol_size*l],0,frame_parms->ofdm_symbol_size*sizeof(int));
|
||||||
if (l==0) {
|
if (l==0) {
|
||||||
start_meas(&ue->rx_dft_stats);
|
start_meas(&ue->rx_dft_stats);
|
||||||
dft((int16_t *)&common_vars->rxdata[aa][(sample_offset +
|
dft((int16_t *)&common_vars->rxdata[aa][(sample_offset +
|
||||||
nb_prefix_samples0 +
|
nb_prefix_samples0 +
|
||||||
subframe_offset -
|
subframe_offset -
|
||||||
SOFFSET) % frame_length_samples],
|
SOFFSET) % frame_length_samples],
|
||||||
(int16_t *)&common_vars->rxdataF[aa][frame_parms->ofdm_symbol_size*l],1);
|
(int16_t *)&common_vars->common_vars_rx_data_per_thread[subframe&0x1].rxdataF[aa][frame_parms->ofdm_symbol_size*l],1);
|
||||||
stop_meas(&ue->rx_dft_stats);
|
stop_meas(&ue->rx_dft_stats);
|
||||||
} else {
|
} else {
|
||||||
if ((sample_offset +
|
if ((sample_offset +
|
||||||
@@ -134,7 +134,7 @@ int slot_fep_mbsfn(PHY_VARS_UE *ue,
|
|||||||
(frame_parms->ofdm_symbol_size+nb_prefix_samples)*(l-1) +
|
(frame_parms->ofdm_symbol_size+nb_prefix_samples)*(l-1) +
|
||||||
subframe_offset-
|
subframe_offset-
|
||||||
SOFFSET) % frame_length_samples],
|
SOFFSET) % frame_length_samples],
|
||||||
(int16_t *)&common_vars->rxdataF[aa][frame_parms->ofdm_symbol_size*l],1);
|
(int16_t *)&common_vars->common_vars_rx_data_per_thread[subframe&0x1].rxdataF[aa][frame_parms->ofdm_symbol_size*l],1);
|
||||||
stop_meas(&ue->rx_dft_stats);
|
stop_meas(&ue->rx_dft_stats);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -79,10 +79,10 @@ int slot_fep_ul(LTE_DL_FRAME_PARMS *frame_parms,
|
|||||||
|
|
||||||
if (no_prefix) {
|
if (no_prefix) {
|
||||||
// subframe_offset = frame_parms->ofdm_symbol_size * frame_parms->symbols_per_tti * (Ns>>1);
|
// subframe_offset = frame_parms->ofdm_symbol_size * frame_parms->symbols_per_tti * (Ns>>1);
|
||||||
slot_offset = frame_parms->ofdm_symbol_size * (frame_parms->symbols_per_tti>>1) * (Ns%2);
|
slot_offset = frame_parms->ofdm_symbol_size * (frame_parms->symbols_per_tti>>1) * (Ns&1);
|
||||||
} else {
|
} else {
|
||||||
// subframe_offset = frame_parms->samples_per_tti * (Ns>>1);
|
// subframe_offset = frame_parms->samples_per_tti * (Ns>>1);
|
||||||
slot_offset = (frame_parms->samples_per_tti>>1) * (Ns%2);
|
slot_offset = (frame_parms->samples_per_tti>>1) * (Ns&1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (l<0 || l>=7-frame_parms->Ncp) {
|
if (l<0 || l>=7-frame_parms->Ncp) {
|
||||||
@@ -108,18 +108,22 @@ int slot_fep_ul(LTE_DL_FRAME_PARMS *frame_parms,
|
|||||||
1
|
1
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
rx_offset += (frame_parms->ofdm_symbol_size+nb_prefix_samples)*l;
|
rx_offset += (frame_parms->ofdm_symbol_size+nb_prefix_samples)*l;
|
||||||
|
/* should never happen for eNB
|
||||||
if(rx_offset > (frame_length_samples - frame_parms->ofdm_symbol_size))
|
if(rx_offset > (frame_length_samples - frame_parms->ofdm_symbol_size))
|
||||||
{
|
{
|
||||||
memcpy((void *)&eNB_common_vars->rxdata_7_5kHz[eNB_id][aa][frame_length_samples],
|
memcpy((void *)&eNB_common_vars->rxdata_7_5kHz[eNB_id][aa][frame_length_samples],
|
||||||
(void *)&eNB_common_vars->rxdata_7_5kHz[eNB_id][aa][0],
|
(void *)&eNB_common_vars->rxdata_7_5kHz[eNB_id][aa][0],
|
||||||
frame_parms->ofdm_symbol_size*sizeof(int));
|
frame_parms->ofdm_symbol_size*sizeof(int));
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
if( (rx_offset & 7) != 0){
|
// check for 256-bit alignment of input buffer and do DFT directly, else do via intermediate buffer
|
||||||
|
if( (rx_offset & 15) != 0){
|
||||||
memcpy((void *)&tmp_dft_in,
|
memcpy((void *)&tmp_dft_in,
|
||||||
(void *)&eNB_common_vars->rxdata_7_5kHz[eNB_id][aa][(rx_offset % frame_length_samples)],
|
(void *)&eNB_common_vars->rxdata_7_5kHz[eNB_id][aa][(rx_offset % frame_length_samples)],
|
||||||
frame_parms->ofdm_symbol_size*sizeof(int));
|
frame_parms->ofdm_symbol_size*sizeof(int));
|
||||||
dft( (short *) tmp_dft_in,
|
dft( (short *) tmp_dft_in,
|
||||||
(short*) &eNB_common_vars->rxdataF[eNB_id][aa][frame_parms->ofdm_symbol_size*symbol],
|
(short*) &eNB_common_vars->rxdataF[eNB_id][aa][frame_parms->ofdm_symbol_size*symbol],
|
||||||
1
|
1
|
||||||
|
|||||||
@@ -27,6 +27,7 @@
|
|||||||
|
|
||||||
#if defined(__x86_64__) || defined(__i386__)
|
#if defined(__x86_64__) || defined(__i386__)
|
||||||
int16_t conjug[8]__attribute__((aligned(16))) = {-1,1,-1,1,-1,1,-1,1} ;
|
int16_t conjug[8]__attribute__((aligned(16))) = {-1,1,-1,1,-1,1,-1,1} ;
|
||||||
|
int16_t conjug2[8]__attribute__((aligned(16))) = {1,-1,1,-1,1,-1,1,-1} ;
|
||||||
#define simd_q15_t __m128i
|
#define simd_q15_t __m128i
|
||||||
#define simdshort_q15_t __m64
|
#define simdshort_q15_t __m64
|
||||||
#elif defined(__arm__)
|
#elif defined(__arm__)
|
||||||
@@ -41,7 +42,8 @@ int mult_cpx_conj_vector(int16_t *x1,
|
|||||||
int16_t *x2,
|
int16_t *x2,
|
||||||
int16_t *y,
|
int16_t *y,
|
||||||
uint32_t N,
|
uint32_t N,
|
||||||
int output_shift)
|
int output_shift,
|
||||||
|
int madd)
|
||||||
{
|
{
|
||||||
// Multiply elementwise the complex conjugate of x1 with x2.
|
// Multiply elementwise the complex conjugate of x1 with x2.
|
||||||
// x1 - input 1 in the format |Re0 Im0 Re1 Im1|,......,|Re(N-2) Im(N-2) Re(N-1) Im(N-1)|
|
// x1 - input 1 in the format |Re0 Im0 Re1 Im1|,......,|Re(N-2) Im(N-2) Re(N-1) Im(N-1)|
|
||||||
@@ -55,6 +57,8 @@ int mult_cpx_conj_vector(int16_t *x1,
|
|||||||
// N - the size f the vectors (this function does N cpx mpy. WARNING: N>=4;
|
// N - the size f the vectors (this function does N cpx mpy. WARNING: N>=4;
|
||||||
//
|
//
|
||||||
// output_shift - shift to be applied to generate output
|
// output_shift - shift to be applied to generate output
|
||||||
|
//
|
||||||
|
// madd - add the output to y
|
||||||
|
|
||||||
uint32_t i; // loop counter
|
uint32_t i; // loop counter
|
||||||
|
|
||||||
@@ -88,7 +92,11 @@ int mult_cpx_conj_vector(int16_t *x1,
|
|||||||
tmp_im = _mm_srai_epi32(tmp_im,output_shift);
|
tmp_im = _mm_srai_epi32(tmp_im,output_shift);
|
||||||
tmpy0 = _mm_unpacklo_epi32(tmp_re,tmp_im);
|
tmpy0 = _mm_unpacklo_epi32(tmp_re,tmp_im);
|
||||||
tmpy1 = _mm_unpackhi_epi32(tmp_re,tmp_im);
|
tmpy1 = _mm_unpackhi_epi32(tmp_re,tmp_im);
|
||||||
*y_128 = _mm_packs_epi32(tmpy0,tmpy1);
|
if (madd==0)
|
||||||
|
*y_128 = _mm_packs_epi32(tmpy0,tmpy1);
|
||||||
|
else
|
||||||
|
*y_128 += _mm_packs_epi32(tmpy0,tmpy1);
|
||||||
|
|
||||||
#elif defined(__arm__)
|
#elif defined(__arm__)
|
||||||
|
|
||||||
tmp_re = vmull_s16(((simdshort_q15_t *)x1_128)[0], ((simdshort_q15_t*)x2_128)[0]);
|
tmp_re = vmull_s16(((simdshort_q15_t *)x1_128)[0], ((simdshort_q15_t*)x2_128)[0]);
|
||||||
@@ -110,7 +118,10 @@ int mult_cpx_conj_vector(int16_t *x1,
|
|||||||
tmp_re = vqshlq_s32(tmp_re,shift);
|
tmp_re = vqshlq_s32(tmp_re,shift);
|
||||||
tmp_im = vqshlq_s32(tmp_im,shift);
|
tmp_im = vqshlq_s32(tmp_im,shift);
|
||||||
tmpy = vzip_s16(vmovn_s32(tmp_re),vmovn_s32(tmp_im));
|
tmpy = vzip_s16(vmovn_s32(tmp_re),vmovn_s32(tmp_im));
|
||||||
*y_128 = vcombine_s16(tmpy.val[0],tmpy.val[1]);
|
if (madd==0)
|
||||||
|
*y_128 = vcombine_s16(tmpy.val[0],tmpy.val[1]);
|
||||||
|
else
|
||||||
|
*y_128 += vcombine_s16(tmpy.val[0],tmpy.val[1]);
|
||||||
#endif
|
#endif
|
||||||
x1_128++;
|
x1_128++;
|
||||||
x2_128++;
|
x2_128++;
|
||||||
@@ -124,3 +135,81 @@ int mult_cpx_conj_vector(int16_t *x1,
|
|||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int multadd_cpx_vector(int16_t *x1,
|
||||||
|
int16_t *x2,
|
||||||
|
int16_t *y,
|
||||||
|
uint8_t zero_flag,
|
||||||
|
uint32_t N,
|
||||||
|
int output_shift)
|
||||||
|
{
|
||||||
|
// Multiply elementwise the complex conjugate of x1 with x2.
|
||||||
|
// x1 - input 1 in the format |Re0 Im0 Re1 Im1|,......,|Re(N-2) Im(N-2) Re(N-1) Im(N-1)|
|
||||||
|
// We assume x1 with a dinamic of 15 bit maximum
|
||||||
|
//
|
||||||
|
// x2 - input 2 in the format |Re0 Im0 Re1 Im1|,......,|Re(N-2) Im(N-2) Re(N-1) Im(N-1)|
|
||||||
|
// We assume x2 with a dinamic of 14 bit maximum
|
||||||
|
///
|
||||||
|
// y - output in the format |Re0 Im0 Re1 Im1|,......,|Re(N-2) Im(N-2) Re(N-1) Im(N-1)|
|
||||||
|
//
|
||||||
|
// zero_flag - Set output (y) to zero prior to disable accumulation
|
||||||
|
//
|
||||||
|
// N - the size f the vectors (this function does N cpx mpy. WARNING: N>=4;
|
||||||
|
//
|
||||||
|
// output_shift - shift to be applied to generate output
|
||||||
|
|
||||||
|
uint32_t i; // loop counter
|
||||||
|
|
||||||
|
simd_q15_t *x1_128;
|
||||||
|
simd_q15_t *x2_128;
|
||||||
|
simd_q15_t *y_128;
|
||||||
|
#if defined(__x86_64__) || defined(__i386__)
|
||||||
|
simd_q15_t tmp_re,tmp_im;
|
||||||
|
simd_q15_t tmpy0,tmpy1;
|
||||||
|
#elif defined(__arm__)
|
||||||
|
int32x4_t tmp_re,tmp_im;
|
||||||
|
int32x4_t tmp_re1,tmp_im1;
|
||||||
|
int16x4x2_t tmpy;
|
||||||
|
int32x4_t shift = vdupq_n_s32(-output_shift);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
x1_128 = (simd_q15_t *)&x1[0];
|
||||||
|
x2_128 = (simd_q15_t *)&x2[0];
|
||||||
|
y_128 = (simd_q15_t *)&y[0];
|
||||||
|
|
||||||
|
|
||||||
|
// we compute 4 cpx multiply for each loop
|
||||||
|
for(i=0; i<(N>>2); i++) {
|
||||||
|
#if defined(__x86_64__) || defined(__i386__)
|
||||||
|
tmp_re = _mm_sign_epi16(*x1_128,*(__m128i*)&conjug2[0]);
|
||||||
|
tmp_re = _mm_madd_epi16(tmp_re,*x2_128);
|
||||||
|
tmp_im = _mm_shufflelo_epi16(*x1_128,_MM_SHUFFLE(2,3,0,1));
|
||||||
|
tmp_im = _mm_shufflehi_epi16(tmp_im,_MM_SHUFFLE(2,3,0,1));
|
||||||
|
tmp_im = _mm_madd_epi16(tmp_im,*x2_128);
|
||||||
|
tmp_re = _mm_srai_epi32(tmp_re,output_shift);
|
||||||
|
tmp_im = _mm_srai_epi32(tmp_im,output_shift);
|
||||||
|
tmpy0 = _mm_unpacklo_epi32(tmp_re,tmp_im);
|
||||||
|
//print_ints("unpack lo:",&tmpy0[i]);
|
||||||
|
tmpy1 = _mm_unpackhi_epi32(tmp_re,tmp_im);
|
||||||
|
//print_ints("unpack hi:",&tmpy1[i]);
|
||||||
|
|
||||||
|
if (zero_flag == 1)
|
||||||
|
*y_128 = _mm_packs_epi32(tmpy0,tmpy1);
|
||||||
|
else
|
||||||
|
*y_128 = _mm_adds_epi16(*y_128,_mm_packs_epi32(tmpy0,tmpy1));
|
||||||
|
//print_shorts("*y_128:",&y_128[i]);
|
||||||
|
|
||||||
|
#elif defined(__arm__)
|
||||||
|
|
||||||
|
msg("mult_cpx_vector not implemented for __arm__");
|
||||||
|
#endif
|
||||||
|
x1_128++;
|
||||||
|
x2_128++;
|
||||||
|
y_128++;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
_mm_empty();
|
||||||
|
_m_empty();
|
||||||
|
|
||||||
|
return(0);
|
||||||
|
}
|
||||||
|
|||||||
@@ -116,13 +116,34 @@ int rotate_cpx_vector(int16_t *x,
|
|||||||
@param y - output in the format |Re0 Im0 Re1 Im1|,......,|Re(N-2) Im(N-2) Re(N-1) Im(N-1)|
|
@param y - output in the format |Re0 Im0 Re1 Im1|,......,|Re(N-2) Im(N-2) Re(N-1) Im(N-1)|
|
||||||
@param N - the size f the vectors (this function does N cpx mpy. WARNING: N>=4;
|
@param N - the size f the vectors (this function does N cpx mpy. WARNING: N>=4;
|
||||||
@param output_shift - shift to be applied to generate output
|
@param output_shift - shift to be applied to generate output
|
||||||
|
@param madd - if not zero result is added to output
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int mult_cpx_conj_vector(int16_t *x1,
|
int mult_cpx_conj_vector(int16_t *x1,
|
||||||
int16_t *x2,
|
int16_t *x2,
|
||||||
int16_t *y,
|
int16_t *y,
|
||||||
uint32_t N,
|
uint32_t N,
|
||||||
int output_shift);
|
int output_shift,
|
||||||
|
int madd);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
Element-wise multiplication and accumulation of two complex vectors x1 and x2.
|
||||||
|
@param x1 - input 1 in the format |Re0 Im0 Re1 Im1|,......,|Re(N-2) Im(N-2) Re(N-1) Im(N-1)|
|
||||||
|
We assume x1 with a dinamic of 15 bit maximum
|
||||||
|
@param x2 - input 2 in the format |Re0 Im0 Re1 Im1|,......,|Re(N-2) Im(N-2) Re(N-1) Im(N-1)|
|
||||||
|
We assume x2 with a dinamic of 14 bit maximum
|
||||||
|
@param y - output in the format |Re0 Im0 Re1 Im1|,......,|Re(N-2) Im(N-2) Re(N-1) Im(N-1)|
|
||||||
|
@param zero_flag Set output (y) to zero prior to accumulation
|
||||||
|
@param N - the size f the vectors (this function does N cpx mpy. WARNING: N>=4;
|
||||||
|
@param output_shift - shift to be applied to generate output
|
||||||
|
*/
|
||||||
|
|
||||||
|
int multadd_cpx_vector(int16_t *x1,
|
||||||
|
int16_t *x2,
|
||||||
|
int16_t *y,
|
||||||
|
uint8_t zero_flag,
|
||||||
|
uint32_t N,
|
||||||
|
int output_shift);
|
||||||
|
|
||||||
// lte_dfts.c
|
// lte_dfts.c
|
||||||
void init_fft(uint16_t size,
|
void init_fft(uint16_t size,
|
||||||
|
|||||||
@@ -559,15 +559,15 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form,
|
|||||||
bit_pdcch = (float*) calloc(12*frame_parms->N_RB_DL*num_pdcch_symbols*2,sizeof(float));
|
bit_pdcch = (float*) calloc(12*frame_parms->N_RB_DL*num_pdcch_symbols*2,sizeof(float));
|
||||||
|
|
||||||
rxsig_t = (int16_t**) phy_vars_ue->common_vars.rxdata;
|
rxsig_t = (int16_t**) phy_vars_ue->common_vars.rxdata;
|
||||||
chest_t = (int16_t**) phy_vars_ue->common_vars.dl_ch_estimates_time[eNB_id];
|
chest_t = (int16_t**) phy_vars_ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates_time[eNB_id];
|
||||||
chest_f = (int16_t**) phy_vars_ue->common_vars.dl_ch_estimates[eNB_id];
|
chest_f = (int16_t**) phy_vars_ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id];
|
||||||
pbch_llr = (int8_t*) phy_vars_ue->pbch_vars[eNB_id]->llr;
|
pbch_llr = (int8_t*) phy_vars_ue->pbch_vars[eNB_id]->llr;
|
||||||
pbch_comp = (int16_t*) phy_vars_ue->pbch_vars[eNB_id]->rxdataF_comp[0];
|
pbch_comp = (int16_t*) phy_vars_ue->pbch_vars[eNB_id]->rxdataF_comp[0];
|
||||||
pdcch_llr = (int8_t*) phy_vars_ue->pdcch_vars[eNB_id]->llr;
|
pdcch_llr = (int8_t*) phy_vars_ue->pdcch_vars[eNB_id]->llr;
|
||||||
pdcch_comp = (int16_t*) phy_vars_ue->pdcch_vars[eNB_id]->rxdataF_comp[0];
|
pdcch_comp = (int16_t*) phy_vars_ue->pdcch_vars[eNB_id]->rxdataF_comp[0];
|
||||||
pdsch_llr = (int16_t*) phy_vars_ue->pdsch_vars[eNB_id]->llr[0]; // stream 0
|
pdsch_llr = (int16_t*) phy_vars_ue->pdsch_vars[subframe&0x1][eNB_id]->llr[0]; // stream 0
|
||||||
// pdsch_llr = (int16_t*) phy_vars_ue->lte_ue_pdsch_vars_SI[eNB_id]->llr[0]; // stream 0
|
// pdsch_llr = (int16_t*) phy_vars_ue->lte_ue_pdsch_vars_SI[eNB_id]->llr[0]; // stream 0
|
||||||
pdsch_comp = (int16_t*) phy_vars_ue->pdsch_vars[eNB_id]->rxdataF_comp0[0];
|
pdsch_comp = (int16_t*) phy_vars_ue->pdsch_vars[subframe&0x1][eNB_id]->rxdataF_comp0[0];
|
||||||
|
|
||||||
// Received signal in time domain of receive antenna 0
|
// Received signal in time domain of receive antenna 0
|
||||||
if (rxsig_t != NULL) {
|
if (rxsig_t != NULL) {
|
||||||
|
|||||||
+31
-3
@@ -241,10 +241,16 @@ typedef struct eNB_proc_t_s {
|
|||||||
openair0_timestamp timestamp_tx;
|
openair0_timestamp timestamp_tx;
|
||||||
/// subframe to act upon for reception
|
/// subframe to act upon for reception
|
||||||
int subframe_rx;
|
int subframe_rx;
|
||||||
|
/// symbol mask for IF4p5 reception per subframe
|
||||||
|
uint32_t symbol_mask[10];
|
||||||
/// subframe to act upon for PRACH
|
/// subframe to act upon for PRACH
|
||||||
int subframe_prach;
|
int subframe_prach;
|
||||||
/// frame to act upon for reception
|
/// frame to act upon for reception
|
||||||
int frame_rx;
|
int frame_rx;
|
||||||
|
/// frame to act upon for transmission
|
||||||
|
int frame_tx;
|
||||||
|
/// frame offset for secondary eNBs (to correct for frame asynchronism at startup)
|
||||||
|
int frame_offset;
|
||||||
/// frame to act upon for PRACH
|
/// frame to act upon for PRACH
|
||||||
int frame_prach;
|
int frame_prach;
|
||||||
/// \internal This variable is protected by \ref mutex_fep.
|
/// \internal This variable is protected by \ref mutex_fep.
|
||||||
@@ -259,6 +265,8 @@ typedef struct eNB_proc_t_s {
|
|||||||
/// \brief Instance count for rx processing thread.
|
/// \brief Instance count for rx processing thread.
|
||||||
/// \internal This variable is protected by \ref mutex_prach.
|
/// \internal This variable is protected by \ref mutex_prach.
|
||||||
int instance_cnt_prach;
|
int instance_cnt_prach;
|
||||||
|
// instance count for over-the-air eNB synchronization
|
||||||
|
int instance_cnt_synch;
|
||||||
/// \internal This variable is protected by \ref mutex_asynch_rxtx.
|
/// \internal This variable is protected by \ref mutex_asynch_rxtx.
|
||||||
int instance_cnt_asynch_rxtx;
|
int instance_cnt_asynch_rxtx;
|
||||||
/// pthread structure for FH processing thread
|
/// pthread structure for FH processing thread
|
||||||
@@ -283,6 +291,8 @@ typedef struct eNB_proc_t_s {
|
|||||||
pthread_attr_t attr_single;
|
pthread_attr_t attr_single;
|
||||||
/// pthread attributes for prach processing thread
|
/// pthread attributes for prach processing thread
|
||||||
pthread_attr_t attr_prach;
|
pthread_attr_t attr_prach;
|
||||||
|
/// pthread attributes for over-the-air synch thread
|
||||||
|
pthread_attr_t attr_synch;
|
||||||
/// pthread attributes for asynchronous RX thread
|
/// pthread attributes for asynchronous RX thread
|
||||||
pthread_attr_t attr_asynch_rxtx;
|
pthread_attr_t attr_asynch_rxtx;
|
||||||
/// scheduling parameters for parallel fep thread
|
/// scheduling parameters for parallel fep thread
|
||||||
@@ -297,6 +307,8 @@ typedef struct eNB_proc_t_s {
|
|||||||
struct sched_param sched_param_single;
|
struct sched_param sched_param_single;
|
||||||
/// scheduling parameters for prach thread
|
/// scheduling parameters for prach thread
|
||||||
struct sched_param sched_param_prach;
|
struct sched_param sched_param_prach;
|
||||||
|
/// scheduling parameters for over-the-air synchronization thread
|
||||||
|
struct sched_param sched_param_synch;
|
||||||
/// scheduling parameters for asynch_rxtx thread
|
/// scheduling parameters for asynch_rxtx thread
|
||||||
struct sched_param sched_param_asynch_rxtx;
|
struct sched_param sched_param_asynch_rxtx;
|
||||||
/// pthread structure for parallel fep thread
|
/// pthread structure for parallel fep thread
|
||||||
@@ -307,6 +319,8 @@ typedef struct eNB_proc_t_s {
|
|||||||
pthread_t pthread_te;
|
pthread_t pthread_te;
|
||||||
/// pthread structure for PRACH thread
|
/// pthread structure for PRACH thread
|
||||||
pthread_t pthread_prach;
|
pthread_t pthread_prach;
|
||||||
|
/// pthread structure for eNB synch thread
|
||||||
|
pthread_t pthread_synch;
|
||||||
/// condition variable for parallel fep thread
|
/// condition variable for parallel fep thread
|
||||||
pthread_cond_t cond_fep;
|
pthread_cond_t cond_fep;
|
||||||
/// condition variable for parallel turbo-decoder thread
|
/// condition variable for parallel turbo-decoder thread
|
||||||
@@ -317,6 +331,8 @@ typedef struct eNB_proc_t_s {
|
|||||||
pthread_cond_t cond_FH;
|
pthread_cond_t cond_FH;
|
||||||
/// condition variable for PRACH processing thread;
|
/// condition variable for PRACH processing thread;
|
||||||
pthread_cond_t cond_prach;
|
pthread_cond_t cond_prach;
|
||||||
|
// condition variable for over-the-air eNB synchronization
|
||||||
|
pthread_cond_t cond_synch;
|
||||||
/// condition variable for asynch RX/TX thread
|
/// condition variable for asynch RX/TX thread
|
||||||
pthread_cond_t cond_asynch_rxtx;
|
pthread_cond_t cond_asynch_rxtx;
|
||||||
/// mutex for parallel fep thread
|
/// mutex for parallel fep thread
|
||||||
@@ -329,6 +345,8 @@ typedef struct eNB_proc_t_s {
|
|||||||
pthread_mutex_t mutex_FH;
|
pthread_mutex_t mutex_FH;
|
||||||
/// mutex for PRACH thread
|
/// mutex for PRACH thread
|
||||||
pthread_mutex_t mutex_prach;
|
pthread_mutex_t mutex_prach;
|
||||||
|
// mutex for over-the-air eNB synchronization
|
||||||
|
pthread_mutex_t mutex_synch;
|
||||||
/// mutex for asynch RX/TX thread
|
/// mutex for asynch RX/TX thread
|
||||||
pthread_mutex_t mutex_asynch_rxtx;
|
pthread_mutex_t mutex_asynch_rxtx;
|
||||||
/// parameters for turbo-decoding worker thread
|
/// parameters for turbo-decoding worker thread
|
||||||
@@ -346,6 +364,8 @@ typedef struct eNB_proc_t_s {
|
|||||||
|
|
||||||
/// Context data structure for RX/TX portion of subframe processing
|
/// Context data structure for RX/TX portion of subframe processing
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
/// index of the current UE RX/TX proc
|
||||||
|
int proc_id;
|
||||||
/// Component Carrier index
|
/// Component Carrier index
|
||||||
uint8_t CC_id;
|
uint8_t CC_id;
|
||||||
/// timestamp transmitted to HW
|
/// timestamp transmitted to HW
|
||||||
@@ -416,8 +436,15 @@ typedef struct PHY_VARS_eNB_s {
|
|||||||
int single_thread_flag;
|
int single_thread_flag;
|
||||||
openair0_rf_map rf_map;
|
openair0_rf_map rf_map;
|
||||||
int abstraction_flag;
|
int abstraction_flag;
|
||||||
void (*do_prach)(struct PHY_VARS_eNB_s *eNB);
|
openair0_timestamp ts_offset;
|
||||||
void (*fep)(struct PHY_VARS_eNB_s *eNB);
|
// indicator for synchronization state of eNB
|
||||||
|
int in_synch;
|
||||||
|
// indicator for master/slave (RRU)
|
||||||
|
int is_slave;
|
||||||
|
// indicator for precoding function (eNB,3GPP_eNB_BBU)
|
||||||
|
int do_precoding;
|
||||||
|
void (*do_prach)(struct PHY_VARS_eNB_s *eNB,int frame,int subframe);
|
||||||
|
void (*fep)(struct PHY_VARS_eNB_s *eNB,eNB_rxtx_proc_t *proc);
|
||||||
int (*td)(struct PHY_VARS_eNB_s *eNB,int UE_id,int harq_pid,int llr8_flag);
|
int (*td)(struct PHY_VARS_eNB_s *eNB,int UE_id,int harq_pid,int llr8_flag);
|
||||||
int (*te)(struct PHY_VARS_eNB_s *,uint8_t *,uint8_t,LTE_eNB_DLSCH_t *,int,uint8_t,time_stats_t *,time_stats_t *,time_stats_t *);
|
int (*te)(struct PHY_VARS_eNB_s *,uint8_t *,uint8_t,LTE_eNB_DLSCH_t *,int,uint8_t,time_stats_t *,time_stats_t *,time_stats_t *);
|
||||||
void (*proc_uespec_rx)(struct PHY_VARS_eNB_s *eNB,eNB_rxtx_proc_t *proc,const relaying_type_t r_type);
|
void (*proc_uespec_rx)(struct PHY_VARS_eNB_s *eNB,eNB_rxtx_proc_t *proc,const relaying_type_t r_type);
|
||||||
@@ -677,7 +704,7 @@ typedef struct {
|
|||||||
LTE_DL_FRAME_PARMS frame_parms_before_ho;
|
LTE_DL_FRAME_PARMS frame_parms_before_ho;
|
||||||
LTE_UE_COMMON common_vars;
|
LTE_UE_COMMON common_vars;
|
||||||
|
|
||||||
LTE_UE_PDSCH *pdsch_vars[NUMBER_OF_CONNECTED_eNB_MAX+1];
|
LTE_UE_PDSCH *pdsch_vars[2][NUMBER_OF_CONNECTED_eNB_MAX+1];
|
||||||
LTE_UE_PDSCH_FLP *pdsch_vars_flp[NUMBER_OF_CONNECTED_eNB_MAX+1];
|
LTE_UE_PDSCH_FLP *pdsch_vars_flp[NUMBER_OF_CONNECTED_eNB_MAX+1];
|
||||||
LTE_UE_PDSCH *pdsch_vars_SI[NUMBER_OF_CONNECTED_eNB_MAX+1];
|
LTE_UE_PDSCH *pdsch_vars_SI[NUMBER_OF_CONNECTED_eNB_MAX+1];
|
||||||
LTE_UE_PDSCH *pdsch_vars_ra[NUMBER_OF_CONNECTED_eNB_MAX+1];
|
LTE_UE_PDSCH *pdsch_vars_ra[NUMBER_OF_CONNECTED_eNB_MAX+1];
|
||||||
@@ -774,6 +801,7 @@ typedef struct {
|
|||||||
uint8_t prach_PreambleIndex;
|
uint8_t prach_PreambleIndex;
|
||||||
// uint8_t prach_timer;
|
// uint8_t prach_timer;
|
||||||
int rx_offset; /// Timing offset
|
int rx_offset; /// Timing offset
|
||||||
|
int rx_offset_diff; /// Timing adjustment for ofdm symbol0 on HW USRP
|
||||||
int timing_advance; ///timing advance signalled from eNB
|
int timing_advance; ///timing advance signalled from eNB
|
||||||
int hw_timing_advance;
|
int hw_timing_advance;
|
||||||
int N_TA_offset; ///timing offset used in TDD
|
int N_TA_offset; ///timing offset used in TDD
|
||||||
|
|||||||
@@ -504,6 +504,8 @@ typedef struct {
|
|||||||
uint8_t tdd_config;
|
uint8_t tdd_config;
|
||||||
/// TDD S-subframe configuration (0-9)
|
/// TDD S-subframe configuration (0-9)
|
||||||
uint8_t tdd_config_S;
|
uint8_t tdd_config_S;
|
||||||
|
/// srs extra symbol flag for TDD
|
||||||
|
uint8_t srsX;
|
||||||
/// indicates if node is a UE (NODE=2) or eNB (PRIMARY_CH=0).
|
/// indicates if node is a UE (NODE=2) or eNB (PRIMARY_CH=0).
|
||||||
uint8_t node_id;
|
uint8_t node_id;
|
||||||
/// Frequency index of CBMIMO1 card
|
/// Frequency index of CBMIMO1 card
|
||||||
@@ -542,11 +544,15 @@ typedef struct {
|
|||||||
uint32_t samples_per_tti;
|
uint32_t samples_per_tti;
|
||||||
/// Number of OFDM/SC-FDMA symbols in one subframe (to be modified to account for potential different in UL/DL)
|
/// Number of OFDM/SC-FDMA symbols in one subframe (to be modified to account for potential different in UL/DL)
|
||||||
uint16_t symbols_per_tti;
|
uint16_t symbols_per_tti;
|
||||||
|
/// Number of OFDM symbols in DL portion of S-subframe
|
||||||
|
uint16_t dl_symbols_in_S_subframe;
|
||||||
|
/// Number of SC-FDMA symbols in UL portion of S-subframe
|
||||||
|
uint16_t ul_symbols_in_S_subframe;
|
||||||
/// Number of Physical transmit antennas in node
|
/// Number of Physical transmit antennas in node
|
||||||
uint8_t nb_antennas_tx;
|
uint8_t nb_antennas_tx;
|
||||||
/// Number of Receive antennas in node
|
/// Number of Receive antennas in node
|
||||||
uint8_t nb_antennas_rx;
|
uint8_t nb_antennas_rx;
|
||||||
/// Number of Logical transmit antenna ports in eNodeB
|
/// Number of common transmit antenna ports in eNodeB (1 or 2)
|
||||||
uint8_t nb_antenna_ports_eNB;
|
uint8_t nb_antenna_ports_eNB;
|
||||||
/// PRACH_CONFIG
|
/// PRACH_CONFIG
|
||||||
PRACH_CONFIG_COMMON prach_config_common;
|
PRACH_CONFIG_COMMON prach_config_common;
|
||||||
@@ -778,6 +784,26 @@ typedef struct {
|
|||||||
#endif
|
#endif
|
||||||
} LTE_eNB_PUSCH;
|
} LTE_eNB_PUSCH;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
|
||||||
|
/// \brief Holds the received data in the frequency domain.
|
||||||
|
/// - first index: rx antenna [0..nb_antennas_rx[
|
||||||
|
/// - second index: symbol [0..28*ofdm_symbol_size[
|
||||||
|
int32_t **rxdataF;
|
||||||
|
|
||||||
|
/// \brief Hold the channel estimates in frequency domain.
|
||||||
|
/// - first index: eNB id [0..6] (hard coded)
|
||||||
|
/// - second index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
|
||||||
|
/// - third index: samples? [0..symbols_per_tti*(ofdm_symbol_size+LTE_CE_FILTER_LENGTH)[
|
||||||
|
int32_t **dl_ch_estimates[7];
|
||||||
|
|
||||||
|
/// \brief Hold the channel estimates in time domain (used for tracking).
|
||||||
|
/// - first index: eNB id [0..6] (hard coded)
|
||||||
|
/// - second index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
|
||||||
|
/// - third index: samples? [0..2*ofdm_symbol_size[
|
||||||
|
int32_t **dl_ch_estimates_time[7];
|
||||||
|
}LTE_UE_COMMON_PER_THREAD;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
/// \brief Holds the transmit data in time domain.
|
/// \brief Holds the transmit data in time domain.
|
||||||
/// For IFFT_FPGA this points to the same memory as PHY_vars->tx_vars[a].TX_DMA_BUFFER.
|
/// For IFFT_FPGA this points to the same memory as PHY_vars->tx_vars[a].TX_DMA_BUFFER.
|
||||||
@@ -789,29 +815,15 @@ typedef struct {
|
|||||||
/// - first index: tx antenna [0..nb_antennas_tx[
|
/// - first index: tx antenna [0..nb_antennas_tx[
|
||||||
/// - second index: sample [0..FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX[
|
/// - second index: sample [0..FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX[
|
||||||
int32_t **txdataF;
|
int32_t **txdataF;
|
||||||
|
|
||||||
/// \brief Holds the received data in time domain.
|
/// \brief Holds the received data in time domain.
|
||||||
/// Should point to the same memory as PHY_vars->rx_vars[a].RX_DMA_BUFFER.
|
/// Should point to the same memory as PHY_vars->rx_vars[a].RX_DMA_BUFFER.
|
||||||
/// - first index: rx antenna [0..nb_antennas_rx[
|
/// - first index: rx antenna [0..nb_antennas_rx[
|
||||||
/// - second index: sample [0..FRAME_LENGTH_COMPLEX_SAMPLES+2048[
|
/// - second index: sample [0..FRAME_LENGTH_COMPLEX_SAMPLES+2048[
|
||||||
int32_t **rxdata;
|
int32_t **rxdata;
|
||||||
/// \brief Holds the received data in the frequency domain.
|
|
||||||
/// - first index: rx antenna [0..nb_antennas_rx[
|
LTE_UE_COMMON_PER_THREAD common_vars_rx_data_per_thread[2];
|
||||||
/// - second index: symbol [0..28*ofdm_symbol_size[
|
|
||||||
int32_t **rxdataF;
|
|
||||||
/// \brief ?.
|
|
||||||
/// - first index: rx antenna [0..nb_antennas_rx[
|
|
||||||
/// - second index: ? [0..20*ofdm_symbol_size*symbols_per_tti[
|
|
||||||
int32_t **rxdataF2;
|
|
||||||
/// \brief Hold the channel estimates in frequency domain.
|
|
||||||
/// - first index: eNB id [0..6] (hard coded)
|
|
||||||
/// - second index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
|
|
||||||
/// - third index: samples? [0..symbols_per_tti*(ofdm_symbol_size+LTE_CE_FILTER_LENGTH)[
|
|
||||||
int32_t **dl_ch_estimates[7];
|
|
||||||
/// \brief Hold the channel estimates in time domain (used for tracking).
|
|
||||||
/// - first index: eNB id [0..6] (hard coded)
|
|
||||||
/// - second index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
|
|
||||||
/// - third index: samples? [0..2*ofdm_symbol_size[
|
|
||||||
int32_t **dl_ch_estimates_time[7];
|
|
||||||
/// holds output of the sync correlator
|
/// holds output of the sync correlator
|
||||||
int32_t *sync_corr;
|
int32_t *sync_corr;
|
||||||
/// estimated frequency offset (in radians) for all subcarriers
|
/// estimated frequency offset (in radians) for all subcarriers
|
||||||
@@ -994,6 +1006,8 @@ typedef struct {
|
|||||||
uint8_t num_pdcch_symbols;
|
uint8_t num_pdcch_symbols;
|
||||||
/// Allocated CRNTI for UE
|
/// Allocated CRNTI for UE
|
||||||
uint16_t crnti;
|
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)
|
/// Total number of PDU errors (diagnostic mode)
|
||||||
uint32_t dci_errors;
|
uint32_t dci_errors;
|
||||||
/// Total number of PDU received
|
/// Total number of PDU received
|
||||||
@@ -1098,6 +1112,14 @@ typedef enum {
|
|||||||
|
|
||||||
typedef enum {SF_DL, SF_UL, SF_S} lte_subframe_t;
|
typedef enum {SF_DL, SF_UL, SF_S} lte_subframe_t;
|
||||||
|
|
||||||
|
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
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -177,7 +177,7 @@
|
|||||||
#define DMA_BLKS_PER_SLOT (SLOT_LENGTH_BYTES/2048) // Number of DMA blocks per slot
|
#define DMA_BLKS_PER_SLOT (SLOT_LENGTH_BYTES/2048) // Number of DMA blocks per slot
|
||||||
#define SLOT_TIME_NS (SLOT_LENGTH_SAMPLES*(1e3)/7.68) // slot time in ns
|
#define SLOT_TIME_NS (SLOT_LENGTH_SAMPLES*(1e3)/7.68) // slot time in ns
|
||||||
|
|
||||||
#define NB_ANTENNA_PORTS_ENB 14 // total number of eNB antenna ports
|
#define NB_ANTENNA_PORTS_ENB 6 // total number of eNB antenna ports
|
||||||
|
|
||||||
#ifdef EXMIMO
|
#ifdef EXMIMO
|
||||||
#define TARGET_RX_POWER 55 // Target digital power for the AGC
|
#define TARGET_RX_POWER 55 // Target digital power for the AGC
|
||||||
|
|||||||
+24
-3
@@ -182,7 +182,7 @@ void phy_procedures_eNB_uespec_RX(PHY_VARS_eNB *phy_vars_eNB,eNB_rxtx_proc_t *pr
|
|||||||
@param phy_vars_eNB Pointer to eNB variables on which to act
|
@param phy_vars_eNB Pointer to eNB variables on which to act
|
||||||
@param abstraction_flag Indicator of PHY abstraction
|
@param abstraction_flag Indicator of PHY abstraction
|
||||||
*/
|
*/
|
||||||
void phy_procedures_eNB_common_RX(PHY_VARS_eNB *phy_vars_eNB);
|
void phy_procedures_eNB_common_RX(PHY_VARS_eNB *phy_vars_eNB,eNB_rxtx_proc_t *proc);
|
||||||
|
|
||||||
/*! \brief Scheduling for eNB TX procedures in TDD S-subframes.
|
/*! \brief Scheduling for eNB TX procedures in TDD S-subframes.
|
||||||
@param phy_vars_eNB Pointer to eNB variables on which to act
|
@param phy_vars_eNB Pointer to eNB variables on which to act
|
||||||
@@ -212,6 +212,13 @@ void prach_procedures(PHY_VARS_eNB *eNB);
|
|||||||
|
|
||||||
lte_subframe_t subframe_select(LTE_DL_FRAME_PARMS *frame_parms,uint8_t subframe);
|
lte_subframe_t subframe_select(LTE_DL_FRAME_PARMS *frame_parms,uint8_t subframe);
|
||||||
|
|
||||||
|
/*! \brief Function to compute which type of DCIs to detect in the given subframe
|
||||||
|
@param frame_parms Pointer to DL frame parameter descriptor
|
||||||
|
@param subframe Subframe index
|
||||||
|
@returns DCI detetion mode type (no DCIs, uplink DCIs, downlink DCIs, both uplink and downlink DCIs)
|
||||||
|
*/
|
||||||
|
dci_detect_mode_t dci_detect_mode_select(LTE_DL_FRAME_PARMS *frame_parms,uint8_t subframe);
|
||||||
|
|
||||||
/*! \brief Function to compute subframe type as a function of Frame type and TDD Configuration (implements Table 4.2.2 from 36.211, p.11 from version 8.6) and subframe index. Same as subframe_select, except that it uses the Mod_id and is provided as a service to the MAC scheduler.
|
/*! \brief Function to compute subframe type as a function of Frame type and TDD Configuration (implements Table 4.2.2 from 36.211, p.11 from version 8.6) and subframe index. Same as subframe_select, except that it uses the Mod_id and is provided as a service to the MAC scheduler.
|
||||||
@param Mod_id Index of eNB
|
@param Mod_id Index of eNB
|
||||||
@param CC_id Component Carrier Index
|
@param CC_id Component Carrier Index
|
||||||
@@ -300,6 +307,18 @@ uint8_t pdcch_alloc2ul_subframe(LTE_DL_FRAME_PARMS *frame_parms,uint8_t n);
|
|||||||
*/
|
*/
|
||||||
uint8_t get_ack(LTE_DL_FRAME_PARMS *frame_parms,harq_status_t *harq_ack,uint8_t subframe,uint8_t *o_ACK);
|
uint8_t get_ack(LTE_DL_FRAME_PARMS *frame_parms,harq_status_t *harq_ack,uint8_t subframe,uint8_t *o_ACK);
|
||||||
|
|
||||||
|
/*! \brief Reset ACK/NACK information
|
||||||
|
@param frame_parms Pointer to DL frame parameter descriptor
|
||||||
|
@param harq_ack Pointer to dlsch_ue harq_ack status descriptor
|
||||||
|
@param subframe Subframe for UE transmission (n in 36.213)
|
||||||
|
@param o_ACK Pointer to ACK/NAK payload for PUCCH/PUSCH
|
||||||
|
@returns status indicator for PUCCH/PUSCH transmission
|
||||||
|
*/
|
||||||
|
uint8_t reset_ack(LTE_DL_FRAME_PARMS *frame_parms,
|
||||||
|
harq_status_t *harq_ack,
|
||||||
|
unsigned char subframe,
|
||||||
|
unsigned char *o_ACK);
|
||||||
|
|
||||||
/*! \brief Compute UL ACK subframe from DL subframe. This is used to retrieve corresponding DLSCH HARQ pid at eNB upon reception of ACK/NAK information on PUCCH/PUSCH. Derived from Table 10.1-1 in 36.213 (p. 69 in version 8.6)
|
/*! \brief Compute UL ACK subframe from DL subframe. This is used to retrieve corresponding DLSCH HARQ pid at eNB upon reception of ACK/NAK information on PUCCH/PUSCH. Derived from Table 10.1-1 in 36.213 (p. 69 in version 8.6)
|
||||||
@param frame_parms Pointer to DL frame parameter descriptor
|
@param frame_parms Pointer to DL frame parameter descriptor
|
||||||
@param subframe Subframe for UE transmission (n in 36.213)
|
@param subframe Subframe for UE transmission (n in 36.213)
|
||||||
@@ -366,6 +385,7 @@ subframe n-4 which is acknowledged in subframe n (for FDD) according to n1_pucch
|
|||||||
TDD, this routine computes the complex procedure described in Section 10.1 of 36.213 (through tables 10.1-1,10.1-2)
|
TDD, this routine computes the complex procedure described in Section 10.1 of 36.213 (through tables 10.1-1,10.1-2)
|
||||||
@param phy_vars_ue Pointer to UE variables
|
@param phy_vars_ue Pointer to UE variables
|
||||||
@param proc Pointer to RXn-TXnp4 proc information
|
@param proc Pointer to RXn-TXnp4 proc information
|
||||||
|
@param harq_ack Pointer to dlsch_ue harq_ack status descriptor
|
||||||
@param eNB_id Index of eNB
|
@param eNB_id Index of eNB
|
||||||
@param b Pointer to PUCCH payload (b[0],b[1])
|
@param b Pointer to PUCCH payload (b[0],b[1])
|
||||||
@param SR 1 means there's a positive SR in parallel to ACK/NAK
|
@param SR 1 means there's a positive SR in parallel to ACK/NAK
|
||||||
@@ -373,6 +393,7 @@ TDD, this routine computes the complex procedure described in Section 10.1 of 36
|
|||||||
*/
|
*/
|
||||||
uint16_t get_n1_pucch(PHY_VARS_UE *phy_vars_ue,
|
uint16_t get_n1_pucch(PHY_VARS_UE *phy_vars_ue,
|
||||||
UE_rxtx_proc_t *proc,
|
UE_rxtx_proc_t *proc,
|
||||||
|
harq_status_t *harq_ack,
|
||||||
uint8_t eNB_id,
|
uint8_t eNB_id,
|
||||||
uint8_t *b,
|
uint8_t *b,
|
||||||
uint8_t SR);
|
uint8_t SR);
|
||||||
@@ -431,7 +452,7 @@ UE_MODE_t get_ue_mode(uint8_t Mod_id,uint8_t CC_id,uint8_t eNB_index);
|
|||||||
@param pucch_fmt Format of PUCCH that is being transmitted
|
@param pucch_fmt Format of PUCCH that is being transmitted
|
||||||
@returns Transmit power
|
@returns Transmit power
|
||||||
*/
|
*/
|
||||||
int8_t pucch_power_cntl(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t subframe,uint8_t eNB_id,PUCCH_FMT_t pucch_fmt);
|
int16_t pucch_power_cntl(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t subframe,uint8_t eNB_id,PUCCH_FMT_t pucch_fmt);
|
||||||
|
|
||||||
/*! \brief This function implements the power control mechanism for PUCCH from 36.213.
|
/*! \brief This function implements the power control mechanism for PUCCH from 36.213.
|
||||||
@param phy_vars_ue PHY variables
|
@param phy_vars_ue PHY variables
|
||||||
@@ -488,7 +509,7 @@ int get_ue_active_harq_pid(uint8_t Mod_id,uint8_t CC_id,uint16_t rnti,int frame,
|
|||||||
void dump_dlsch(PHY_VARS_UE *phy_vars_ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t subframe,uint8_t harq_pid);
|
void dump_dlsch(PHY_VARS_UE *phy_vars_ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t subframe,uint8_t harq_pid);
|
||||||
void dump_dlsch_SI(PHY_VARS_UE *phy_vars_ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t subframe);
|
void dump_dlsch_SI(PHY_VARS_UE *phy_vars_ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t subframe);
|
||||||
void dump_dlsch_ra(PHY_VARS_UE *phy_vars_ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t subframe);
|
void dump_dlsch_ra(PHY_VARS_UE *phy_vars_ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t subframe);
|
||||||
void dump_dlsch2(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint16_t coded_bits_per_codeword,int round);
|
void dump_dlsch2(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t subframe, uint16_t coded_bits_per_codeword,int round);
|
||||||
|
|
||||||
/*@}*/
|
/*@}*/
|
||||||
|
|
||||||
|
|||||||
@@ -320,85 +320,128 @@ unsigned char ul_ACK_subframe2_M(LTE_DL_FRAME_PARMS *frame_parms,unsigned char s
|
|||||||
}
|
}
|
||||||
|
|
||||||
// This function implements table 10.1-1 of 36-213, p. 69
|
// This function implements table 10.1-1 of 36-213, p. 69
|
||||||
uint8_t get_ack(LTE_DL_FRAME_PARMS *frame_parms,
|
// return the number 'Nbundled'
|
||||||
|
uint8_t get_reset_ack(LTE_DL_FRAME_PARMS *frame_parms,
|
||||||
harq_status_t *harq_ack,
|
harq_status_t *harq_ack,
|
||||||
unsigned char subframe,
|
unsigned char subframe,
|
||||||
unsigned char *o_ACK)
|
unsigned char *o_ACK,
|
||||||
|
uint8_t do_reset) // 1 to reset ACK/NACK status : 0 otherwise
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
uint8_t status=0;
|
uint8_t status=0;
|
||||||
uint8_t subframe_dl;
|
uint8_t subframe_ul=0xff, subframe_dl0=0xff, subframe_dl1=0xff;
|
||||||
|
|
||||||
// printf("get_ack: SF %d\n",subframe);
|
// printf("get_ack: SF %d\n",subframe);
|
||||||
if (frame_parms->frame_type == FDD) {
|
if (frame_parms->frame_type == FDD) {
|
||||||
if (subframe < 4)
|
if (subframe < 4)
|
||||||
subframe_dl = subframe + 6;
|
subframe_dl0 = subframe + 6;
|
||||||
else
|
else
|
||||||
subframe_dl = subframe - 4;
|
subframe_dl0 = subframe - 4;
|
||||||
|
|
||||||
o_ACK[0] = harq_ack[subframe_dl].ack;
|
o_ACK[0] = harq_ack[subframe_dl0].ack;
|
||||||
status = harq_ack[subframe_dl].send_harq_status;
|
status = harq_ack[subframe_dl0].send_harq_status;
|
||||||
//printf("get_ack: Getting ACK/NAK for PDSCH (subframe %d) => %d\n",subframe_dl,o_ACK[0]);
|
//printf("get_ack: Getting ACK/NAK for PDSCH (subframe %d) => %d\n",subframe_dl,o_ACK[0]);
|
||||||
} else {
|
} else {
|
||||||
switch (frame_parms->tdd_config) {
|
switch (frame_parms->tdd_config) {
|
||||||
case 1:
|
case 1:
|
||||||
if (subframe == 2) { // ACK subframes 5 (forget 6)
|
if (subframe == 2) { // ACK subframes 5,6
|
||||||
o_ACK[0] = harq_ack[5].ack;
|
subframe_ul = 6;
|
||||||
status = harq_ack[5].send_harq_status;
|
subframe_dl0 = 5;
|
||||||
|
subframe_dl1 = 6;
|
||||||
} else if (subframe == 3) { // ACK subframe 9
|
} else if (subframe == 3) { // ACK subframe 9
|
||||||
o_ACK[0] = harq_ack[9].ack;
|
subframe_ul = 9;
|
||||||
status = harq_ack[9].send_harq_status;
|
subframe_dl0 = 9;
|
||||||
|
subframe_dl1 = 0xff;
|
||||||
} else if (subframe == 4) { // nothing
|
} else if (subframe == 4) { // nothing
|
||||||
status = 0;
|
subframe_ul = 0xff;
|
||||||
} else if (subframe == 7) { // ACK subframes 0 (forget 1)
|
subframe_dl0 = 0xff; // invalid subframe number indicates ACK/NACK is not needed
|
||||||
o_ACK[0] = harq_ack[0].ack;
|
subframe_dl1 = 0xff;
|
||||||
status = harq_ack[0].send_harq_status;
|
} else if (subframe == 7) { // ACK subframes 0,1
|
||||||
|
subframe_ul = 1;
|
||||||
|
subframe_dl0 = 0;
|
||||||
|
subframe_dl1 = 1;
|
||||||
} else if (subframe == 8) { // ACK subframes 4
|
} else if (subframe == 8) { // ACK subframes 4
|
||||||
o_ACK[0] = harq_ack[4].ack;
|
subframe_ul = 4;
|
||||||
status = harq_ack[4].send_harq_status;
|
subframe_dl0 = 4;
|
||||||
|
subframe_dl1 = 0xff;
|
||||||
} else {
|
} else {
|
||||||
LOG_E(PHY,"phy_procedures_lte.c: get_ack, illegal subframe %d for tdd_config %d\n",
|
LOG_E(PHY,"phy_procedures_lte.c: get_ack, illegal subframe %d for tdd_config %d\n",
|
||||||
subframe,frame_parms->tdd_config);
|
subframe,frame_parms->tdd_config);
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// report ACK/NACK status
|
||||||
|
o_ACK[0] = 1;
|
||||||
|
status = 0;
|
||||||
|
if ((subframe_dl0 < 10) && (harq_ack[subframe_dl0].send_harq_status)) {
|
||||||
|
o_ACK[0] &= harq_ack[subframe_dl0].ack;
|
||||||
|
status = harq_ack[subframe_dl0].send_harq_status;
|
||||||
|
}
|
||||||
|
if ((subframe_dl1 < 10) && (harq_ack[subframe_dl1].send_harq_status)) {
|
||||||
|
o_ACK[0] &= harq_ack[subframe_dl1].ack;
|
||||||
|
status = harq_ack[subframe_dl1].send_harq_status;
|
||||||
|
}
|
||||||
|
// report status = Nbundled
|
||||||
|
if (!status) {
|
||||||
|
o_ACK[0] = 0;
|
||||||
|
} else {
|
||||||
|
if (harq_ack[subframe_ul].vDAI_UL < 0xff) {
|
||||||
|
status = harq_ack[subframe_ul].vDAI_UL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!do_reset && (subframe_ul < 10)) {
|
||||||
|
if ((subframe_dl0 < 10) && (subframe_dl1 < 10)) {
|
||||||
|
LOG_D(PHY,"ul-sf#%d vDAI_UL[sf#%d]=%d Nbundled=%d: dlsf#%d ACK=%d harq_status=%d vDAI_DL=%d, dlsf#%d ACK=%d harq_status=%d vDAI_DL=%d, o_ACK[0]=%d status=%d\n",
|
||||||
|
subframe, subframe_ul, harq_ack[subframe_ul].vDAI_UL, status,
|
||||||
|
subframe_dl0, harq_ack[subframe_dl0].ack, harq_ack[subframe_dl0].send_harq_status, harq_ack[subframe_dl0].vDAI_DL,
|
||||||
|
subframe_dl1, harq_ack[subframe_dl1].ack, harq_ack[subframe_dl1].send_harq_status, harq_ack[subframe_dl1].vDAI_DL,
|
||||||
|
o_ACK[0], status);
|
||||||
|
} else if (subframe_dl0 < 10) {
|
||||||
|
LOG_D(PHY,"ul-sf#%d vDAI_UL[sf#%d]=%d Nbundled=%d: dlsf#%d ACK=%d status=%d vDAI_DL=%d, o_ACK[0]=%d status=%d\n",
|
||||||
|
subframe, subframe_ul, harq_ack[subframe_ul].vDAI_UL, status,
|
||||||
|
subframe_dl0, harq_ack[subframe_dl0].ack, harq_ack[subframe_dl0].send_harq_status, harq_ack[subframe_dl0].vDAI_DL,
|
||||||
|
o_ACK[0], status);
|
||||||
|
}else if (subframe_dl1 < 10) {
|
||||||
|
LOG_D(PHY,"ul-sf#%d vDAI_UL[sf#%d]=%d Nbundled=%d: dlsf#%d ACK=%d status=%d vDAI_DL=%d, o_ACK[0]=%d status=%d\n",
|
||||||
|
subframe, subframe_ul, harq_ack[subframe_ul].vDAI_UL, status,
|
||||||
|
subframe_dl1, harq_ack[subframe_dl1].ack, harq_ack[subframe_dl1].send_harq_status, harq_ack[subframe_dl1].vDAI_DL,
|
||||||
|
o_ACK[0], status);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// reset ACK/NACK status
|
||||||
|
if (do_reset) {
|
||||||
|
LOG_D(PHY,"ul-sf#%d ACK/NACK status resetting @ dci0-sf#%d, dci1x/2x-sf#%d, dci1x/2x-sf#%d\n", subframe, subframe_ul, subframe_dl0, subframe_dl1);
|
||||||
|
if (subframe_ul < 10) {
|
||||||
|
harq_ack[subframe_ul].vDAI_UL = 0xff;
|
||||||
|
}
|
||||||
|
if (subframe_dl0 < 10) {
|
||||||
|
harq_ack[subframe_dl0].vDAI_DL = 0xff;
|
||||||
|
harq_ack[subframe_dl0].ack = 2;
|
||||||
|
harq_ack[subframe_dl0].send_harq_status = 0;
|
||||||
|
}
|
||||||
|
if (subframe_dl1 < 10) {
|
||||||
|
harq_ack[subframe_dl1].vDAI_DL = 0xff;
|
||||||
|
harq_ack[subframe_dl1].ack = 2;
|
||||||
|
harq_ack[subframe_dl1].send_harq_status = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 3:
|
case 3:
|
||||||
if (subframe == 2) { // ACK subframes 5 and 6
|
if (subframe == 2) { // ACK subframes 5 and 6
|
||||||
if (harq_ack[5].send_harq_status == 1) {
|
subframe_dl0 = 5;
|
||||||
o_ACK[0] = harq_ack[5].ack;
|
subframe_dl1 = 6;
|
||||||
|
|
||||||
if (harq_ack[6].send_harq_status == 1)
|
|
||||||
o_ACK[1] = harq_ack[6].ack;
|
|
||||||
} else if (harq_ack[6].send_harq_status == 1)
|
|
||||||
o_ACK[0] = harq_ack[6].ack;
|
|
||||||
|
|
||||||
status = harq_ack[5].send_harq_status + (harq_ack[6].send_harq_status<<1);
|
|
||||||
//printf("Subframe 2, TDD config 3: harq_ack[5] = %d (%d),harq_ack[6] = %d (%d)\n",harq_ack[5].ack,harq_ack[5].send_harq_status,harq_ack[6].ack,harq_ack[6].send_harq_status);
|
//printf("Subframe 2, TDD config 3: harq_ack[5] = %d (%d),harq_ack[6] = %d (%d)\n",harq_ack[5].ack,harq_ack[5].send_harq_status,harq_ack[6].ack,harq_ack[6].send_harq_status);
|
||||||
} else if (subframe == 3) { // ACK subframes 7 and 8
|
} else if (subframe == 3) { // ACK subframes 7 and 8
|
||||||
if (harq_ack[7].send_harq_status == 1) {
|
subframe_dl0 = 7;
|
||||||
o_ACK[0] = harq_ack[7].ack;
|
subframe_dl1 = 8;
|
||||||
|
|
||||||
if (harq_ack[8].send_harq_status == 1)
|
|
||||||
o_ACK[1] = harq_ack[8].ack;
|
|
||||||
} else if (harq_ack[8].send_harq_status == 1)
|
|
||||||
o_ACK[0] = harq_ack[8].ack;
|
|
||||||
|
|
||||||
status = harq_ack[7].send_harq_status + (harq_ack[8].send_harq_status<<1);
|
|
||||||
//printf("Subframe 3, TDD config 3: harq_ack[7] = %d,harq_ack[8] = %d\n",harq_ack[7].ack,harq_ack[8].ack);
|
//printf("Subframe 3, TDD config 3: harq_ack[7] = %d,harq_ack[8] = %d\n",harq_ack[7].ack,harq_ack[8].ack);
|
||||||
//printf("status %d : o_ACK (%d,%d)\n", status,o_ACK[0],o_ACK[1]);
|
//printf("status %d : o_ACK (%d,%d)\n", status,o_ACK[0],o_ACK[1]);
|
||||||
} else if (subframe == 4) { // ACK subframes 9 and 0
|
} else if (subframe == 4) { // ACK subframes 9 and 0
|
||||||
if (harq_ack[9].send_harq_status == 1) {
|
subframe_dl0 = 9;
|
||||||
o_ACK[0] = harq_ack[9].ack;
|
subframe_dl1 = 0;
|
||||||
|
|
||||||
if (harq_ack[0].send_harq_status == 1)
|
|
||||||
o_ACK[1] = harq_ack[0].ack;
|
|
||||||
} else if (harq_ack[0].send_harq_status == 1)
|
|
||||||
o_ACK[0] = harq_ack[0].ack;
|
|
||||||
|
|
||||||
status = harq_ack[9].send_harq_status + (harq_ack[0].send_harq_status<<1);
|
|
||||||
//printf("Subframe 4, TDD config 3: harq_ack[9] = %d,harq_ack[0] = %d\n",harq_ack[9].ack,harq_ack[0].ack);
|
//printf("Subframe 4, TDD config 3: harq_ack[9] = %d,harq_ack[0] = %d\n",harq_ack[9].ack,harq_ack[0].ack);
|
||||||
} else {
|
} else {
|
||||||
LOG_E(PHY,"phy_procedures_lte.c: get_ack, illegal subframe %d for tdd_config %d\n",
|
LOG_E(PHY,"phy_procedures_lte.c: get_ack, illegal subframe %d for tdd_config %d\n",
|
||||||
@@ -406,6 +449,25 @@ uint8_t get_ack(LTE_DL_FRAME_PARMS *frame_parms,
|
|||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// report ACK/NACK status
|
||||||
|
if (harq_ack[subframe_dl0].send_harq_status == 1) {
|
||||||
|
o_ACK[0] = harq_ack[subframe_dl0].ack;
|
||||||
|
|
||||||
|
if (harq_ack[subframe_dl1].send_harq_status == 1)
|
||||||
|
o_ACK[1] = harq_ack[subframe_dl1].ack;
|
||||||
|
} else if (harq_ack[subframe_dl1].send_harq_status == 1)
|
||||||
|
o_ACK[0] = harq_ack[subframe_dl1].ack;
|
||||||
|
|
||||||
|
status = harq_ack[subframe_dl0].send_harq_status + (harq_ack[subframe_dl1].send_harq_status<<1);
|
||||||
|
|
||||||
|
if (do_reset) {
|
||||||
|
// reset ACK/NACK status
|
||||||
|
harq_ack[subframe_dl0].ack = 2;
|
||||||
|
harq_ack[subframe_dl1].ack = 2;
|
||||||
|
harq_ack[subframe_dl0].send_harq_status = 0;
|
||||||
|
harq_ack[subframe_dl1].send_harq_status = 0;
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -416,6 +478,24 @@ uint8_t get_ack(LTE_DL_FRAME_PARMS *frame_parms,
|
|||||||
return(status);
|
return(status);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint8_t get_ack(LTE_DL_FRAME_PARMS *frame_parms,
|
||||||
|
harq_status_t *harq_ack,
|
||||||
|
unsigned char subframe,
|
||||||
|
unsigned char *o_ACK)
|
||||||
|
{
|
||||||
|
return get_reset_ack(frame_parms, harq_ack, subframe, o_ACK, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
uint8_t reset_ack(LTE_DL_FRAME_PARMS *frame_parms,
|
||||||
|
harq_status_t *harq_ack,
|
||||||
|
unsigned char subframe,
|
||||||
|
unsigned char *o_ACK)
|
||||||
|
{
|
||||||
|
return get_reset_ack(frame_parms, harq_ack, subframe, o_ACK, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
uint8_t Np6[4]= {0,1,3,5};
|
uint8_t Np6[4]= {0,1,3,5};
|
||||||
uint8_t Np15[4]= {0,3,8,13};
|
uint8_t Np15[4]= {0,3,8,13};
|
||||||
uint8_t Np25[4]= {0,5,13,22};
|
uint8_t Np25[4]= {0,5,13,22};
|
||||||
@@ -518,6 +598,34 @@ lte_subframe_t subframe_select(LTE_DL_FRAME_PARMS *frame_parms,unsigned char sub
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dci_detect_mode_t dci_detect_mode_select(LTE_DL_FRAME_PARMS *frame_parms,uint8_t subframe)
|
||||||
|
{
|
||||||
|
dci_detect_mode_t ret = 0;
|
||||||
|
|
||||||
|
static dci_detect_mode_t Table_8_2_3gpp_36_213[][10] = {
|
||||||
|
//subf0 , subf1 , subf2 , subf3 , subf4 , subf5 , subf6 , subf7 , subf8 , subf9
|
||||||
|
{UL_DL_DCI, UL_DL_DCI , NO_DCI , NO_DCI , NO_DCI , UL_DL_DCI , UL_DL_DCI , NO_DCI, NO_DCI , NO_DCI }, // tdd0
|
||||||
|
{DL_DCI , UL_DL_DCI , NO_DCI , NO_DCI , UL_DL_DCI , DL_DCI , UL_DL_DCI , NO_DCI, NO_DCI , UL_DL_DCI }, // tdd1
|
||||||
|
{DL_DCI , DL_DCI , NO_DCI , UL_DL_DCI , DL_DCI , DL_DCI , DL_DCI , NO_DCI, UL_DL_DCI , DL_DCI }, // tdd2
|
||||||
|
{UL_DL_DCI, DL_DCI , NO_DCI , NO_DCI , NO_DCI , DL_DCI , DL_DCI , DL_DCI, UL_DL_DCI , UL_DL_DCI }, // tdd3
|
||||||
|
{DL_DCI , DL_DCI , NO_DCI , NO_DCI , DL_DCI , DL_DCI , DL_DCI , DL_DCI, UL_DL_DCI , UL_DL_DCI }, // tdd4
|
||||||
|
{DL_DCI , DL_DCI , NO_DCI , DL_DCI , DL_DCI , DL_DCI , DL_DCI , DL_DCI, UL_DL_DCI , DL_DCI }, // tdd5
|
||||||
|
{UL_DL_DCI, UL_DL_DCI , NO_DCI , NO_DCI , NO_DCI , UL_DL_DCI , UL_DL_DCI , NO_DCI, NO_DCI , UL_DL_DCI }}; // tdd6
|
||||||
|
|
||||||
|
|
||||||
|
DevAssert(subframe>=0 && subframe<=9);
|
||||||
|
DevAssert((frame_parms->tdd_config)>=0 && (frame_parms->tdd_config)<=6);
|
||||||
|
|
||||||
|
if (frame_parms->frame_type == FDD) {
|
||||||
|
ret = UL_DL_DCI;
|
||||||
|
} else {
|
||||||
|
ret = Table_8_2_3gpp_36_213[frame_parms->tdd_config][subframe];
|
||||||
|
}
|
||||||
|
|
||||||
|
LOG_D(PHY, "subframe %d: detect UL_DCI=%d, detect DL_DCI=%d\n", subframe, (ret & UL_DCI)>0, (ret & DL_DCI)>0);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
lte_subframe_t get_subframe_direction(uint8_t Mod_id,uint8_t CC_id,uint8_t subframe)
|
lte_subframe_t get_subframe_direction(uint8_t Mod_id,uint8_t CC_id,uint8_t subframe)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|||||||
@@ -788,7 +788,7 @@ void generate_eNB_dlsch_params(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC
|
|||||||
|
|
||||||
eNB->dlsch[(uint8_t)UE_id][0]->nCCE[subframe] = dci_alloc->firstCCE;
|
eNB->dlsch[(uint8_t)UE_id][0]->nCCE[subframe] = dci_alloc->firstCCE;
|
||||||
|
|
||||||
LOG_D(PHY,"[eNB %"PRIu8"] Frame %d subframe %d : CCE resource for ue DCI (PDSCH %"PRIx16") => %"PRIu8"/%u\n",eNB->Mod_id,frame,subframe,
|
LOG_D(PHY,"[eNB %"PRIu8"] Frame %d subframe %d : CCE resource for ue DCI (PDSCH %"PRIx16") => %"PRIu8"\n",eNB->Mod_id,frame,subframe,
|
||||||
dci_alloc->rnti,eNB->dlsch[(uint8_t)UE_id][0]->nCCE[subframe]);
|
dci_alloc->rnti,eNB->dlsch[(uint8_t)UE_id][0]->nCCE[subframe]);
|
||||||
|
|
||||||
#if defined(SMBV)
|
#if defined(SMBV)
|
||||||
@@ -900,7 +900,7 @@ void pdsch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,LTE_eNB_DLSCH_t *d
|
|||||||
int i;
|
int i;
|
||||||
|
|
||||||
LOG_D(PHY,
|
LOG_D(PHY,
|
||||||
"[eNB %"PRIu8"][PDSCH %"PRIx16"/%"PRIu8"] Frame %d, subframe %d: Generating PDSCH/DLSCH with input size = %"PRIu16", G %d, nb_rb %"PRIu16", mcs %"PRIu8", pmi_alloc %"PRIx16", rv %"PRIu8" (round %"PRIu8")\n",
|
"[eNB %"PRIu8"][PDSCH %"PRIx16"/%"PRIu8"] Frame %d, subframe %d: Generating PDSCH/DLSCH with input size = %"PRIu16", G %d, nb_rb %"PRIu16", mcs %"PRIu8", pmi_alloc %"PRIx64", rv %"PRIu8" (round %"PRIu8")\n",
|
||||||
eNB->Mod_id, dlsch->rnti,harq_pid,
|
eNB->Mod_id, dlsch->rnti,harq_pid,
|
||||||
frame, subframe, input_buffer_length,
|
frame, subframe, input_buffer_length,
|
||||||
get_G(fp,
|
get_G(fp,
|
||||||
@@ -1146,7 +1146,7 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
|
|||||||
LTE_DL_FRAME_PARMS *fp=&eNB->frame_parms;
|
LTE_DL_FRAME_PARMS *fp=&eNB->frame_parms;
|
||||||
DCI_ALLOC_t *dci_alloc=(DCI_ALLOC_t *)NULL;
|
DCI_ALLOC_t *dci_alloc=(DCI_ALLOC_t *)NULL;
|
||||||
|
|
||||||
int offset = proc == &eNB->proc.proc_rxtx[0] ? 0 : 1;
|
int offset = eNB->CC_id;//proc == &eNB->proc.proc_rxtx[0] ? 0 : 1;
|
||||||
|
|
||||||
#if defined(SMBV)
|
#if defined(SMBV)
|
||||||
// counts number of allocations in subframe
|
// counts number of allocations in subframe
|
||||||
@@ -2032,8 +2032,8 @@ void prach_procedures(PHY_VARS_eNB *eNB) {
|
|||||||
T_INT(preamble_max), T_INT(preamble_energy_max), T_INT(preamble_delay_list[preamble_max]));
|
T_INT(preamble_max), T_INT(preamble_energy_max), T_INT(preamble_delay_list[preamble_max]));
|
||||||
|
|
||||||
if (eNB->mac_enabled==1) {
|
if (eNB->mac_enabled==1) {
|
||||||
uint8_t update_TA=4;
|
uint8_t update_TA = 4;
|
||||||
|
uint8_t update_TA2 = 1;
|
||||||
switch (fp->N_RB_DL) {
|
switch (fp->N_RB_DL) {
|
||||||
case 6:
|
case 6:
|
||||||
update_TA = 16;
|
update_TA = 16;
|
||||||
@@ -2047,8 +2047,11 @@ void prach_procedures(PHY_VARS_eNB *eNB) {
|
|||||||
update_TA = 2;
|
update_TA = 2;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 75:
|
||||||
|
update_TA = 3;
|
||||||
|
update_TA2 = 2;
|
||||||
case 100:
|
case 100:
|
||||||
update_TA = 1;
|
update_TA = 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2056,7 +2059,7 @@ void prach_procedures(PHY_VARS_eNB *eNB) {
|
|||||||
eNB->CC_id,
|
eNB->CC_id,
|
||||||
frame,
|
frame,
|
||||||
preamble_max,
|
preamble_max,
|
||||||
preamble_delay_list[preamble_max]*update_TA,
|
preamble_delay_list[preamble_max]*update_TA/update_TA2,
|
||||||
0,subframe,0);
|
0,subframe,0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2670,7 +2673,7 @@ void init_te_thread(PHY_VARS_eNB *eNB,pthread_attr_t *attr_te) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void eNB_fep_full_2thread(PHY_VARS_eNB *eNB) {
|
void eNB_fep_full_2thread(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc_rxtx) {
|
||||||
|
|
||||||
eNB_proc_t *proc = &eNB->proc;
|
eNB_proc_t *proc = &eNB->proc;
|
||||||
|
|
||||||
@@ -2716,28 +2719,27 @@ void eNB_fep_full_2thread(PHY_VARS_eNB *eNB) {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
void eNB_fep_full(PHY_VARS_eNB *eNB) {
|
void eNB_fep_full(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc_rxtx) {
|
||||||
|
|
||||||
eNB_proc_t *proc = &eNB->proc;
|
|
||||||
int l;
|
int l;
|
||||||
LTE_DL_FRAME_PARMS *fp=&eNB->frame_parms;
|
LTE_DL_FRAME_PARMS *fp=&eNB->frame_parms;
|
||||||
|
|
||||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_SLOT_FEP,1);
|
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_SLOT_FEP,1);
|
||||||
start_meas(&eNB->ofdm_demod_stats);
|
start_meas(&eNB->ofdm_demod_stats);
|
||||||
remove_7_5_kHz(eNB,proc->subframe_rx<<1);
|
remove_7_5_kHz(eNB,proc_rxtx->subframe_rx<<1);
|
||||||
remove_7_5_kHz(eNB,1+(proc->subframe_rx<<1));
|
remove_7_5_kHz(eNB,1+(proc_rxtx->subframe_rx<<1));
|
||||||
for (l=0; l<fp->symbols_per_tti/2; l++) {
|
for (l=0; l<fp->symbols_per_tti/2; l++) {
|
||||||
slot_fep_ul(fp,
|
slot_fep_ul(fp,
|
||||||
&eNB->common_vars,
|
&eNB->common_vars,
|
||||||
l,
|
l,
|
||||||
proc->subframe_rx<<1,
|
(proc_rxtx->subframe_rx)<<1,
|
||||||
0,
|
0,
|
||||||
0
|
0
|
||||||
);
|
);
|
||||||
slot_fep_ul(fp,
|
slot_fep_ul(fp,
|
||||||
&eNB->common_vars,
|
&eNB->common_vars,
|
||||||
l,
|
l,
|
||||||
1+(proc->subframe_rx<<1),
|
1+((proc_rxtx->subframe_rx)<<1),
|
||||||
0,
|
0,
|
||||||
0
|
0
|
||||||
);
|
);
|
||||||
@@ -2748,11 +2750,11 @@ void eNB_fep_full(PHY_VARS_eNB *eNB) {
|
|||||||
|
|
||||||
if (eNB->node_function == NGFI_RRU_IF4p5) {
|
if (eNB->node_function == NGFI_RRU_IF4p5) {
|
||||||
/// **** send_IF4 of rxdataF to RCC (no prach now) **** ///
|
/// **** send_IF4 of rxdataF to RCC (no prach now) **** ///
|
||||||
send_IF4p5(eNB, proc->frame_rx, proc->subframe_rx, IF4p5_PULFFT, 0);
|
send_IF4p5(eNB, proc_rxtx->frame_rx, proc_rxtx->subframe_rx, IF4p5_PULFFT, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void eNB_fep_rru_if5(PHY_VARS_eNB *eNB) {
|
void eNB_fep_rru_if5(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc_rxtx) {
|
||||||
|
|
||||||
eNB_proc_t *proc=&eNB->proc;
|
eNB_proc_t *proc=&eNB->proc;
|
||||||
uint8_t seqno=0;
|
uint8_t seqno=0;
|
||||||
@@ -2764,17 +2766,17 @@ void eNB_fep_rru_if5(PHY_VARS_eNB *eNB) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void do_prach(PHY_VARS_eNB *eNB) {
|
void do_prach(PHY_VARS_eNB *eNB,int frame,int subframe) {
|
||||||
|
|
||||||
eNB_proc_t *proc = &eNB->proc;
|
eNB_proc_t *proc = &eNB->proc;
|
||||||
LTE_DL_FRAME_PARMS *fp=&eNB->frame_parms;
|
LTE_DL_FRAME_PARMS *fp=&eNB->frame_parms;
|
||||||
|
|
||||||
// check if we have to detect PRACH first
|
// check if we have to detect PRACH first
|
||||||
if (is_prach_subframe(fp,proc->frame_rx,proc->subframe_rx)>0) {
|
if (is_prach_subframe(fp,frame,subframe)>0) {
|
||||||
/* accept some delay in processing - up to 5ms */
|
/* accept some delay in processing - up to 5ms */
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; i < 10 && proc->instance_cnt_prach == 0; i++) {
|
for (i = 0; i < 10 && proc->instance_cnt_prach == 0; i++) {
|
||||||
LOG_W(PHY,"[eNB] Frame %d Subframe %d, eNB PRACH thread busy (IC %d)!!\n", proc->frame_rx,proc->subframe_rx,proc->instance_cnt_prach);
|
LOG_W(PHY,"[eNB] Frame %d Subframe %d, eNB PRACH thread busy (IC %d)!!\n", frame,subframe,proc->instance_cnt_prach);
|
||||||
usleep(500);
|
usleep(500);
|
||||||
}
|
}
|
||||||
if (proc->instance_cnt_prach == 0) {
|
if (proc->instance_cnt_prach == 0) {
|
||||||
@@ -2784,15 +2786,15 @@ void do_prach(PHY_VARS_eNB *eNB) {
|
|||||||
|
|
||||||
// wake up thread for PRACH RX
|
// wake up thread for PRACH RX
|
||||||
if (pthread_mutex_lock(&proc->mutex_prach) != 0) {
|
if (pthread_mutex_lock(&proc->mutex_prach) != 0) {
|
||||||
LOG_E( PHY, "[eNB] ERROR pthread_mutex_lock for eNB PRACH thread %d (IC %d)\n", proc->instance_cnt_prach );
|
LOG_E( PHY, "[eNB] ERROR pthread_mutex_lock for eNB PRACH thread %d (IC %d)\n", proc->thread_index, proc->instance_cnt_prach);
|
||||||
exit_fun( "error locking mutex_prach" );
|
exit_fun( "error locking mutex_prach" );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
++proc->instance_cnt_prach;
|
++proc->instance_cnt_prach;
|
||||||
// set timing for prach thread
|
// set timing for prach thread
|
||||||
proc->frame_prach = proc->frame_rx;
|
proc->frame_prach = frame;
|
||||||
proc->subframe_prach = proc->subframe_rx;
|
proc->subframe_prach = subframe;
|
||||||
|
|
||||||
// the thread can now be woken up
|
// the thread can now be woken up
|
||||||
if (pthread_cond_signal(&proc->cond_prach) != 0) {
|
if (pthread_cond_signal(&proc->cond_prach) != 0) {
|
||||||
@@ -2806,28 +2808,34 @@ void do_prach(PHY_VARS_eNB *eNB) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void phy_procedures_eNB_common_RX(PHY_VARS_eNB *eNB){
|
void phy_procedures_eNB_common_RX(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc){
|
||||||
|
|
||||||
|
|
||||||
eNB_proc_t *proc = &eNB->proc;
|
// eNB_proc_t *proc = &eNB->proc;
|
||||||
LTE_DL_FRAME_PARMS *fp = &eNB->frame_parms;
|
LTE_DL_FRAME_PARMS *fp = &eNB->frame_parms;
|
||||||
const int subframe = proc->subframe_rx;
|
const int subframe = proc->subframe_rx;
|
||||||
const int frame = proc->frame_rx;
|
const int frame = proc->frame_rx;
|
||||||
int offset = (eNB->single_thread_flag==1) ? 0 : (subframe&1);
|
int offset = (eNB->single_thread_flag==1) ? 0 : (subframe&1);
|
||||||
|
|
||||||
if ((fp->frame_type == TDD) && (subframe_select(fp,subframe)!=SF_UL)) return;
|
|
||||||
|
|
||||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_RX0_ENB+offset, proc->frame_rx );
|
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_RX0_ENB+offset, proc->frame_rx );
|
||||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_RX0_ENB+offset, proc->subframe_rx );
|
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_RX0_ENB+offset, proc->subframe_rx );
|
||||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_RX_COMMON+offset, 1 );
|
|
||||||
|
if ((fp->frame_type == TDD) && (subframe_select(fp,subframe)!=SF_UL)) {
|
||||||
|
|
||||||
|
if (eNB->node_function == NGFI_RRU_IF4p5) {
|
||||||
|
/// **** in TDD during DL send_IF4 of ULTICK to RCC **** ///
|
||||||
|
send_IF4p5(eNB, proc->frame_rx, proc->subframe_rx, IF4p5_PULTICK, 0);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_RX_COMMON+offset, 1 );
|
||||||
start_meas(&eNB->phy_proc_rx);
|
start_meas(&eNB->phy_proc_rx);
|
||||||
LOG_D(PHY,"[eNB %d] Frame %d: Doing phy_procedures_eNB_common_RX(%d)\n",eNB->Mod_id,frame,subframe);
|
LOG_D(PHY,"[eNB %d] Frame %d: Doing phy_procedures_eNB_common_RX(%d)\n",eNB->Mod_id,frame,subframe);
|
||||||
|
|
||||||
|
|
||||||
if (eNB->fep) eNB->fep(eNB);
|
if (eNB->fep) eNB->fep(eNB,proc);
|
||||||
|
|
||||||
if (eNB->do_prach) eNB->do_prach(eNB);
|
|
||||||
|
|
||||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_RX_COMMON+offset, 0 );
|
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_RX_COMMON+offset, 0 );
|
||||||
}
|
}
|
||||||
@@ -2847,7 +2855,7 @@ void phy_procedures_eNB_uespec_RX(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,const
|
|||||||
|
|
||||||
const int subframe = proc->subframe_rx;
|
const int subframe = proc->subframe_rx;
|
||||||
const int frame = proc->frame_rx;
|
const int frame = proc->frame_rx;
|
||||||
int offset = (proc == &eNB->proc.proc_rxtx[0]) ? 0 : 1;
|
int offset = eNB->CC_id;//(proc == &eNB->proc.proc_rxtx[0]) ? 0 : 1;
|
||||||
|
|
||||||
|
|
||||||
if ((fp->frame_type == TDD) && (subframe_select(fp,subframe)!=SF_UL)) return;
|
if ((fp->frame_type == TDD) && (subframe_select(fp,subframe)!=SF_UL)) return;
|
||||||
|
|||||||
@@ -66,6 +66,8 @@ fifo_dump_emos_UE emos_dump_UE;
|
|||||||
|
|
||||||
#include "PHY/CODING/extern.h"
|
#include "PHY/CODING/extern.h"
|
||||||
|
|
||||||
|
#include "T.h"
|
||||||
|
|
||||||
#define DLSCH_RB_ALLOC 0x1fbf // skip DC RB (total 23/25 RBs)
|
#define DLSCH_RB_ALLOC 0x1fbf // skip DC RB (total 23/25 RBs)
|
||||||
#define DLSCH_RB_ALLOC_12 0x0aaa // skip DC RB (total 23/25 RBs)
|
#define DLSCH_RB_ALLOC_12 0x0aaa // skip DC RB (total 23/25 RBs)
|
||||||
|
|
||||||
@@ -97,20 +99,20 @@ void dump_dlsch(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t subf
|
|||||||
subframe,
|
subframe,
|
||||||
ue->transmission_mode[eNB_id]<7?0:ue->transmission_mode[eNB_id]);
|
ue->transmission_mode[eNB_id]<7?0:ue->transmission_mode[eNB_id]);
|
||||||
|
|
||||||
write_output("rxsigF0.m","rxsF0", ue->common_vars.rxdataF[0],2*nsymb*ue->frame_parms.ofdm_symbol_size,2,1);
|
write_output("rxsigF0.m","rxsF0", ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF[0],2*nsymb*ue->frame_parms.ofdm_symbol_size,2,1);
|
||||||
write_output("rxsigF0_ext.m","rxsF0_ext", ue->pdsch_vars[0]->rxdataF_ext[0],2*nsymb*ue->frame_parms.ofdm_symbol_size,1,1);
|
write_output("rxsigF0_ext.m","rxsF0_ext", ue->pdsch_vars[subframe&0x1][0]->rxdataF_ext[0],2*nsymb*ue->frame_parms.ofdm_symbol_size,1,1);
|
||||||
write_output("dlsch00_ch0_ext.m","dl00_ch0_ext", ue->pdsch_vars[0]->dl_ch_estimates_ext[0],300*nsymb,1,1);
|
write_output("dlsch00_ch0_ext.m","dl00_ch0_ext", ue->pdsch_vars[subframe&0x1][0]->dl_ch_estimates_ext[0],300*nsymb,1,1);
|
||||||
/*
|
/*
|
||||||
write_output("dlsch01_ch0_ext.m","dl01_ch0_ext",pdsch_vars[0]->dl_ch_estimates_ext[1],300*12,1,1);
|
write_output("dlsch01_ch0_ext.m","dl01_ch0_ext",pdsch_vars[0]->dl_ch_estimates_ext[1],300*12,1,1);
|
||||||
write_output("dlsch10_ch0_ext.m","dl10_ch0_ext",pdsch_vars[0]->dl_ch_estimates_ext[2],300*12,1,1);
|
write_output("dlsch10_ch0_ext.m","dl10_ch0_ext",pdsch_vars[0]->dl_ch_estimates_ext[2],300*12,1,1);
|
||||||
write_output("dlsch11_ch0_ext.m","dl11_ch0_ext",pdsch_vars[0]->dl_ch_estimates_ext[3],300*12,1,1);
|
write_output("dlsch11_ch0_ext.m","dl11_ch0_ext",pdsch_vars[0]->dl_ch_estimates_ext[3],300*12,1,1);
|
||||||
write_output("dlsch_rho.m","dl_rho",pdsch_vars[0]->rho[0],300*12,1,1);
|
write_output("dlsch_rho.m","dl_rho",pdsch_vars[0]->rho[0],300*12,1,1);
|
||||||
*/
|
*/
|
||||||
write_output("dlsch_rxF_comp0.m","dlsch0_rxF_comp0", ue->pdsch_vars[0]->rxdataF_comp0[0],300*12,1,1);
|
write_output("dlsch_rxF_comp0.m","dlsch0_rxF_comp0", ue->pdsch_vars[subframe&0x1][0]->rxdataF_comp0[0],300*12,1,1);
|
||||||
write_output("dlsch_rxF_llr.m","dlsch_llr", ue->pdsch_vars[0]->llr[0],coded_bits_per_codeword,1,0);
|
write_output("dlsch_rxF_llr.m","dlsch_llr", ue->pdsch_vars[subframe&0x1][0]->llr[0],coded_bits_per_codeword,1,0);
|
||||||
|
|
||||||
write_output("dlsch_mag1.m","dlschmag1",ue->pdsch_vars[0]->dl_ch_mag0,300*12,1,1);
|
write_output("dlsch_mag1.m","dlschmag1",ue->pdsch_vars[subframe&0x1][0]->dl_ch_mag0,300*12,1,1);
|
||||||
write_output("dlsch_mag2.m","dlschmag2",ue->pdsch_vars[0]->dl_ch_magb0,300*12,1,1);
|
write_output("dlsch_mag2.m","dlschmag2",ue->pdsch_vars[subframe&0x1][0]->dl_ch_magb0,300*12,1,1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void dump_dlsch_SI(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t subframe)
|
void dump_dlsch_SI(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t subframe)
|
||||||
@@ -139,7 +141,7 @@ void dump_dlsch_SI(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t s
|
|||||||
|
|
||||||
write_output("rxsig0.m","rxs0", &ue->common_vars.rxdata[0][subframe*ue->frame_parms.samples_per_tti],ue->frame_parms.samples_per_tti,1,1);
|
write_output("rxsig0.m","rxs0", &ue->common_vars.rxdata[0][subframe*ue->frame_parms.samples_per_tti],ue->frame_parms.samples_per_tti,1,1);
|
||||||
|
|
||||||
write_output("rxsigF0.m","rxsF0", ue->common_vars.rxdataF[0],nsymb*ue->frame_parms.ofdm_symbol_size,1,1);
|
write_output("rxsigF0.m","rxsF0", ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF[0],nsymb*ue->frame_parms.ofdm_symbol_size,1,1);
|
||||||
write_output("rxsigF0_ext.m","rxsF0_ext", ue->pdsch_vars_SI[0]->rxdataF_ext[0],2*nsymb*ue->frame_parms.ofdm_symbol_size,1,1);
|
write_output("rxsigF0_ext.m","rxsF0_ext", ue->pdsch_vars_SI[0]->rxdataF_ext[0],2*nsymb*ue->frame_parms.ofdm_symbol_size,1,1);
|
||||||
write_output("dlsch00_ch0_ext.m","dl00_ch0_ext", ue->pdsch_vars_SI[0]->dl_ch_estimates_ext[0],ue->frame_parms.N_RB_DL*12*nsymb,1,1);
|
write_output("dlsch00_ch0_ext.m","dl00_ch0_ext", ue->pdsch_vars_SI[0]->dl_ch_estimates_ext[0],ue->frame_parms.N_RB_DL*12*nsymb,1,1);
|
||||||
/*
|
/*
|
||||||
@@ -205,9 +207,6 @@ unsigned int get_tx_amp(int power_dBm, int power_max_dBm, int N_RB_UL, int nb_rb
|
|||||||
int gain_dB = power_dBm - power_max_dBm;
|
int gain_dB = power_dBm - power_max_dBm;
|
||||||
double gain_lin;
|
double gain_lin;
|
||||||
|
|
||||||
if (gain_dB < -20)
|
|
||||||
return(AMP/10);
|
|
||||||
|
|
||||||
gain_lin = pow(10,.1*gain_dB);
|
gain_lin = pow(10,.1*gain_dB);
|
||||||
if ((nb_rb >0) && (nb_rb <= N_RB_UL)) {
|
if ((nb_rb >0) && (nb_rb <= N_RB_UL)) {
|
||||||
return((int)(AMP*sqrt(gain_lin*N_RB_UL/(double)nb_rb)));
|
return((int)(AMP*sqrt(gain_lin*N_RB_UL/(double)nb_rb)));
|
||||||
@@ -243,7 +242,7 @@ void dump_dlsch_ra(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t s
|
|||||||
ue->pdcch_vars[eNB_id]->num_pdcch_symbols,
|
ue->pdcch_vars[eNB_id]->num_pdcch_symbols,
|
||||||
coded_bits_per_codeword);
|
coded_bits_per_codeword);
|
||||||
|
|
||||||
write_output("rxsigF0.m","rxsF0", ue->common_vars.rxdataF[0],2*12*ue->frame_parms.ofdm_symbol_size,2,1);
|
write_output("rxsigF0.m","rxsF0", ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF[0],2*12*ue->frame_parms.ofdm_symbol_size,2,1);
|
||||||
write_output("rxsigF0_ext.m","rxsF0_ext", ue->pdsch_vars_ra[0]->rxdataF_ext[0],2*12*ue->frame_parms.ofdm_symbol_size,1,1);
|
write_output("rxsigF0_ext.m","rxsF0_ext", ue->pdsch_vars_ra[0]->rxdataF_ext[0],2*12*ue->frame_parms.ofdm_symbol_size,1,1);
|
||||||
write_output("dlsch00_ch0_ext.m","dl00_ch0_ext", ue->pdsch_vars_ra[0]->dl_ch_estimates_ext[0],300*nsymb,1,1);
|
write_output("dlsch00_ch0_ext.m","dl00_ch0_ext", ue->pdsch_vars_ra[0]->dl_ch_estimates_ext[0],300*nsymb,1,1);
|
||||||
/*
|
/*
|
||||||
@@ -266,7 +265,7 @@ void phy_reset_ue(uint8_t Mod_id,uint8_t CC_id,uint8_t eNB_index)
|
|||||||
// This flushes ALL DLSCH and ULSCH harq buffers of ALL connected eNBs...add the eNB_index later
|
// This flushes ALL DLSCH and ULSCH harq buffers of ALL connected eNBs...add the eNB_index later
|
||||||
// for more flexibility
|
// for more flexibility
|
||||||
|
|
||||||
uint8_t i,j,k;
|
uint8_t i,j,k,s;
|
||||||
PHY_VARS_UE *ue = PHY_vars_UE_g[Mod_id][CC_id];
|
PHY_VARS_UE *ue = PHY_vars_UE_g[Mod_id][CC_id];
|
||||||
|
|
||||||
//[NUMBER_OF_CONNECTED_eNB_MAX][2];
|
//[NUMBER_OF_CONNECTED_eNB_MAX][2];
|
||||||
@@ -276,6 +275,13 @@ void phy_reset_ue(uint8_t Mod_id,uint8_t CC_id,uint8_t eNB_index)
|
|||||||
if(ue->dlsch[i][j]) {
|
if(ue->dlsch[i][j]) {
|
||||||
for(k=0; k<NUMBER_OF_HARQ_PID_MAX && ue->dlsch[i][j]->harq_processes[k]; k++) {
|
for(k=0; k<NUMBER_OF_HARQ_PID_MAX && ue->dlsch[i][j]->harq_processes[k]; k++) {
|
||||||
ue->dlsch[i][j]->harq_processes[k]->status = SCH_IDLE;
|
ue->dlsch[i][j]->harq_processes[k]->status = SCH_IDLE;
|
||||||
|
for (s=0; s<10; s++) {
|
||||||
|
// reset ACK/NACK bit to DTX for all subframes s = 0..9
|
||||||
|
ue->dlsch[i][j]->harq_ack[s].ack = 2;
|
||||||
|
ue->dlsch[i][j]->harq_ack[s].send_harq_status = 0;
|
||||||
|
ue->dlsch[i][j]->harq_ack[s].vDAI_UL = 0xff;
|
||||||
|
ue->dlsch[i][j]->harq_ack[s].vDAI_DL = 0xff;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -301,7 +307,9 @@ void ra_failed(uint8_t Mod_id,uint8_t CC_id,uint8_t eNB_index)
|
|||||||
|
|
||||||
// if contention resolution fails, go back to PRACH
|
// if contention resolution fails, go back to PRACH
|
||||||
PHY_vars_UE_g[Mod_id][CC_id]->UE_mode[eNB_index] = PRACH;
|
PHY_vars_UE_g[Mod_id][CC_id]->UE_mode[eNB_index] = PRACH;
|
||||||
LOG_E(PHY,"[UE %d] Random-access procedure fails, going back to PRACH, setting SIStatus = 0 and State RRC_IDLE\n",Mod_id);
|
PHY_vars_UE_g[Mod_id][CC_id]->pdcch_vars[eNB_index]->crnti_is_temporary = 0;
|
||||||
|
PHY_vars_UE_g[Mod_id][CC_id]->pdcch_vars[eNB_index]->crnti = 0;
|
||||||
|
LOG_E(PHY,"[UE %d] Random-access procedure fails, going back to PRACH, setting SIStatus = 0, discard temporary C-RNTI and State RRC_IDLE\n",Mod_id);
|
||||||
//mac_xface->macphy_exit("");
|
//mac_xface->macphy_exit("");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -310,8 +318,9 @@ void ra_succeeded(uint8_t Mod_id,uint8_t CC_id,uint8_t eNB_index)
|
|||||||
|
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
LOG_I(PHY,"[UE %d][RAPROC] Random-access procedure succeeded\n",Mod_id);
|
LOG_I(PHY,"[UE %d][RAPROC] Random-access procedure succeeded. Set C-RNTI = Temporary C-RNTI\n",Mod_id);
|
||||||
|
|
||||||
|
PHY_vars_UE_g[Mod_id][CC_id]->pdcch_vars[eNB_index]->crnti_is_temporary = 0;
|
||||||
PHY_vars_UE_g[Mod_id][CC_id]->ulsch_Msg3_active[eNB_index] = 0;
|
PHY_vars_UE_g[Mod_id][CC_id]->ulsch_Msg3_active[eNB_index] = 0;
|
||||||
PHY_vars_UE_g[Mod_id][CC_id]->UE_mode[eNB_index] = PUSCH;
|
PHY_vars_UE_g[Mod_id][CC_id]->UE_mode[eNB_index] = PUSCH;
|
||||||
|
|
||||||
@@ -337,7 +346,9 @@ void process_timing_advance_rar(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint16_t ti
|
|||||||
|
|
||||||
|
|
||||||
#ifdef DEBUG_PHY_PROC
|
#ifdef DEBUG_PHY_PROC
|
||||||
LOG_I(PHY,"[UE %d] AbsoluteSubFrame %d.%d, received (rar) timing_advance %d, HW timing advance %d\n",ue->Mod_id,proc->frame_rx, proc->subframe_rx, ue->timing_advance);
|
/* TODO: fix this log, what is 'HW timing advance'? */
|
||||||
|
/*LOG_I(PHY,"[UE %d] AbsoluteSubFrame %d.%d, received (rar) timing_advance %d, HW timing advance %d\n",ue->Mod_id,proc->frame_rx, proc->subframe_rx, ue->timing_advance);*/
|
||||||
|
LOG_I(PHY,"[UE %d] AbsoluteSubFrame %d.%d, received (rar) timing_advance %d\n",ue->Mod_id,proc->frame_rx, proc->subframe_rx, ue->timing_advance);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -728,6 +739,7 @@ void get_cqipmiri_params(PHY_VARS_UE *ue,uint8_t eNB_id)
|
|||||||
|
|
||||||
uint16_t get_n1_pucch(PHY_VARS_UE *ue,
|
uint16_t get_n1_pucch(PHY_VARS_UE *ue,
|
||||||
UE_rxtx_proc_t *proc,
|
UE_rxtx_proc_t *proc,
|
||||||
|
harq_status_t *harq_ack,
|
||||||
uint8_t eNB_id,
|
uint8_t eNB_id,
|
||||||
uint8_t *b,
|
uint8_t *b,
|
||||||
uint8_t SR)
|
uint8_t SR)
|
||||||
@@ -737,7 +749,8 @@ uint16_t get_n1_pucch(PHY_VARS_UE *ue,
|
|||||||
uint8_t nCCE0,nCCE1,harq_ack1,harq_ack0;
|
uint8_t nCCE0,nCCE1,harq_ack1,harq_ack0;
|
||||||
ANFBmode_t bundling_flag;
|
ANFBmode_t bundling_flag;
|
||||||
uint16_t n1_pucch0=0,n1_pucch1=0;
|
uint16_t n1_pucch0=0,n1_pucch1=0;
|
||||||
int subframe_offset;
|
static uint8_t candidate_dl[9]; // which downlink(s) the current ACK/NACK is associating to
|
||||||
|
uint8_t last_dl=0xff; // the last downlink with valid DL-DCI. for calculating the PUCCH resource index
|
||||||
int sf;
|
int sf;
|
||||||
int M;
|
int M;
|
||||||
// clear this, important for case where n1_pucch selection is not used
|
// clear this, important for case where n1_pucch selection is not used
|
||||||
@@ -775,41 +788,71 @@ uint16_t get_n1_pucch(PHY_VARS_UE *ue,
|
|||||||
M=1;
|
M=1;
|
||||||
|
|
||||||
// This is the offset for a particular subframe (2,3,4) => (0,2,4)
|
// This is the offset for a particular subframe (2,3,4) => (0,2,4)
|
||||||
if (subframe == 2) { // ACK subframes 5 (forget 6)
|
if (subframe == 2) { // ACK subframes 5,6
|
||||||
subframe_offset = 5;
|
candidate_dl[0] = 6;
|
||||||
|
candidate_dl[1] = 5;
|
||||||
M=2;
|
M=2;
|
||||||
} else if (subframe == 3) { // ACK subframe 9
|
} else if (subframe == 3) { // ACK subframe 9
|
||||||
subframe_offset = 9;
|
candidate_dl[0] = 9;
|
||||||
} else if (subframe == 7) { // ACK subframes 0 (forget 1)
|
} else if (subframe == 7) { // ACK subframes 0,1
|
||||||
subframe_offset = 0;
|
candidate_dl[0] = 1;
|
||||||
|
candidate_dl[1] = 0;
|
||||||
M=2;
|
M=2;
|
||||||
} else if (subframe == 8) { // ACK subframes 4
|
} else if (subframe == 8) { // ACK subframes 4
|
||||||
subframe_offset = 4;
|
candidate_dl[0] = 4;
|
||||||
} else {
|
} else {
|
||||||
LOG_E(PHY,"[UE%d] : Frame %d phy_procedures_lte.c: get_n1pucch, illegal subframe %d for tdd_config %d\n",
|
LOG_E(PHY,"[UE%d] : Frame %d phy_procedures_lte.c: get_n1pucch, illegal subframe %d for tdd_config %d\n",
|
||||||
ue->Mod_id,proc->frame_tx,subframe,frame_parms->tdd_config);
|
ue->Mod_id,proc->frame_tx,subframe,frame_parms->tdd_config);
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// checking which downlink candidate is the last downlink with valid DL-DCI
|
||||||
|
int k;
|
||||||
|
for (k=0;k<M;k++) {
|
||||||
|
if (harq_ack[candidate_dl[k]].send_harq_status>0) {
|
||||||
|
last_dl = candidate_dl[k];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (last_dl >= 10) {
|
||||||
|
LOG_E(PHY,"[UE%d] : Frame %d phy_procedures_lte.c: get_n1pucch, illegal subframe %d for tdd_config %d\n",
|
||||||
|
ue->Mod_id,proc->frame_tx,last_dl,frame_parms->tdd_config);
|
||||||
|
return (0);
|
||||||
|
}
|
||||||
|
|
||||||
|
LOG_D(PHY,"SFN/SF %d/%d calculating n1_pucch0 from last_dl=%d\n",
|
||||||
|
proc->frame_tx%1024,
|
||||||
|
proc->subframe_tx,
|
||||||
|
last_dl);
|
||||||
|
|
||||||
// i=0
|
// i=0
|
||||||
nCCE0 = ue->pdcch_vars[eNB_id]->nCCE[subframe_offset];
|
nCCE0 = ue->pdcch_vars[eNB_id]->nCCE[last_dl];
|
||||||
n1_pucch0 = get_Np(frame_parms->N_RB_DL,nCCE0,0) + nCCE0+ frame_parms->pucch_config_common.n1PUCCH_AN;
|
n1_pucch0 = get_Np(frame_parms->N_RB_DL,nCCE0,0) + nCCE0+ frame_parms->pucch_config_common.n1PUCCH_AN;
|
||||||
|
|
||||||
// set ACK/NAK to values if not DTX
|
harq_ack0 = b[0];
|
||||||
if (ue->dlsch[eNB_id][0]->harq_ack[subframe_offset].send_harq_status>0) // n-6 // subframe 5 is to be ACK/NAKed
|
|
||||||
harq_ack0 = ue->dlsch[eNB_id][0]->harq_ack[subframe_offset].ack;
|
|
||||||
|
|
||||||
|
|
||||||
if (harq_ack0!=2) { // DTX
|
if (harq_ack0!=2) { // DTX
|
||||||
if (SR == 0) { // last paragraph pg 68 from 36.213 (v8.6), m=0
|
if (frame_parms->frame_type == FDD ) {
|
||||||
b[0]=(M==2) ? 1-harq_ack0 : harq_ack0;
|
if (SR == 0) { // last paragraph pg 68 from 36.213 (v8.6), m=0
|
||||||
b[1]=harq_ack0; // in case we use pucch format 1b (subframes 2,7)
|
b[0]=(M==2) ? 1-harq_ack0 : harq_ack0;
|
||||||
|
b[1]=harq_ack0; // in case we use pucch format 1b (subframes 2,7)
|
||||||
ue->pucch_sel[subframe] = 0;
|
ue->pucch_sel[subframe] = 0;
|
||||||
return(n1_pucch0);
|
return(n1_pucch0);
|
||||||
} else { // SR and only 0 or 1 ACKs (first 2 entries in Table 7.3-1 of 36.213)
|
} else { // SR and only 0 or 1 ACKs (first 2 entries in Table 7.3-1 of 36.213)
|
||||||
b[0]=harq_ack0;
|
b[0]=harq_ack0;
|
||||||
return(ue->scheduling_request_config[eNB_id].sr_PUCCH_ResourceIndex);
|
return(ue->scheduling_request_config[eNB_id].sr_PUCCH_ResourceIndex);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (SR == 0) {
|
||||||
|
b[0] = harq_ack0;
|
||||||
|
b[1] = harq_ack0;
|
||||||
|
ue->pucch_sel[subframe] = 0;
|
||||||
|
return(n1_pucch0);
|
||||||
|
} else {
|
||||||
|
b[0] = harq_ack0;
|
||||||
|
b[1] = harq_ack0;
|
||||||
|
return(ue->scheduling_request_config[eNB_id].sr_PUCCH_ResourceIndex);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -823,20 +866,20 @@ uint16_t get_n1_pucch(PHY_VARS_UE *ue,
|
|||||||
harq_ack1 = 2; // DTX
|
harq_ack1 = 2; // DTX
|
||||||
harq_ack0 = 2; // DTX
|
harq_ack0 = 2; // DTX
|
||||||
// This is the offset for a particular subframe (2,3,4) => (0,2,4)
|
// This is the offset for a particular subframe (2,3,4) => (0,2,4)
|
||||||
subframe_offset = (subframe-2)<<1;
|
last_dl = (subframe-2)<<1;
|
||||||
// i=0
|
// i=0
|
||||||
nCCE0 = ue->pdcch_vars[eNB_id]->nCCE[5+subframe_offset];
|
nCCE0 = ue->pdcch_vars[eNB_id]->nCCE[5+last_dl];
|
||||||
n1_pucch0 = get_Np(frame_parms->N_RB_DL,nCCE0,0) + nCCE0+ frame_parms->pucch_config_common.n1PUCCH_AN;
|
n1_pucch0 = get_Np(frame_parms->N_RB_DL,nCCE0,0) + nCCE0+ frame_parms->pucch_config_common.n1PUCCH_AN;
|
||||||
// i=1
|
// i=1
|
||||||
nCCE1 = ue->pdcch_vars[eNB_id]->nCCE[(6+subframe_offset)%10];
|
nCCE1 = ue->pdcch_vars[eNB_id]->nCCE[(6+last_dl)%10];
|
||||||
n1_pucch1 = get_Np(frame_parms->N_RB_DL,nCCE1,1) + nCCE1 + frame_parms->pucch_config_common.n1PUCCH_AN;
|
n1_pucch1 = get_Np(frame_parms->N_RB_DL,nCCE1,1) + nCCE1 + frame_parms->pucch_config_common.n1PUCCH_AN;
|
||||||
|
|
||||||
// set ACK/NAK to values if not DTX
|
// set ACK/NAK to values if not DTX
|
||||||
if (ue->dlsch[eNB_id][0]->harq_ack[(6+subframe_offset)%10].send_harq_status>0) // n-6 // subframe 6 is to be ACK/NAKed
|
if (ue->dlsch[eNB_id][0]->harq_ack[(6+last_dl)%10].send_harq_status>0) // n-6 // subframe 6 is to be ACK/NAKed
|
||||||
harq_ack1 = ue->dlsch[eNB_id][0]->harq_ack[(6+subframe_offset)%10].ack;
|
harq_ack1 = ue->dlsch[eNB_id][0]->harq_ack[(6+last_dl)%10].ack;
|
||||||
|
|
||||||
if (ue->dlsch[eNB_id][0]->harq_ack[5+subframe_offset].send_harq_status>0) // n-6 // subframe 5 is to be ACK/NAKed
|
if (ue->dlsch[eNB_id][0]->harq_ack[5+last_dl].send_harq_status>0) // n-6 // subframe 5 is to be ACK/NAKed
|
||||||
harq_ack0 = ue->dlsch[eNB_id][0]->harq_ack[5+subframe_offset].ack;
|
harq_ack0 = ue->dlsch[eNB_id][0]->harq_ack[5+last_dl].ack;
|
||||||
|
|
||||||
|
|
||||||
if (harq_ack1!=2) { // n-6 // subframe 6,8,0 and maybe 5,7,9 is to be ACK/NAKed
|
if (harq_ack1!=2) { // n-6 // subframe 6,8,0 and maybe 5,7,9 is to be ACK/NAKed
|
||||||
@@ -897,7 +940,7 @@ uint16_t get_n1_pucch(PHY_VARS_UE *ue,
|
|||||||
} // switch tdd_config
|
} // switch tdd_config
|
||||||
}
|
}
|
||||||
|
|
||||||
LOG_E(PHY,"[UE%d] : Frame %d phy_procedures_lte.c: get_n1pucch, exit without proper return\n",proc->frame_tx);
|
LOG_E(PHY,"[UE%d] : Frame %d phy_procedures_lte.c: get_n1pucch, exit without proper return\n", ue->Mod_id, proc->frame_tx);
|
||||||
return(-1);
|
return(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -934,7 +977,7 @@ uint16_t get_n1_pucch(PHY_VARS_UE *ue,
|
|||||||
*/
|
*/
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void ulsch_common_procedures(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc) {
|
void ulsch_common_procedures(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc, uint8_t empty_subframe) {
|
||||||
|
|
||||||
int aa;
|
int aa;
|
||||||
LTE_DL_FRAME_PARMS *frame_parms=&ue->frame_parms;
|
LTE_DL_FRAME_PARMS *frame_parms=&ue->frame_parms;
|
||||||
@@ -971,6 +1014,37 @@ void ulsch_common_procedures(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc) {
|
|||||||
#else //this is the normal case
|
#else //this is the normal case
|
||||||
ulsch_start = (frame_parms->samples_per_tti*subframe_tx)-ue->N_TA_offset; //-ue->timing_advance;
|
ulsch_start = (frame_parms->samples_per_tti*subframe_tx)-ue->N_TA_offset; //-ue->timing_advance;
|
||||||
#endif //else EXMIMO
|
#endif //else EXMIMO
|
||||||
|
|
||||||
|
#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR)
|
||||||
|
if (empty_subframe)
|
||||||
|
{
|
||||||
|
//#if 1
|
||||||
|
overflow = ulsch_start - 9*frame_parms->samples_per_tti;
|
||||||
|
for (aa=0; aa<frame_parms->nb_antennas_tx; aa++) {
|
||||||
|
|
||||||
|
memset(&ue->common_vars.txdata[aa][ulsch_start],0,4*cmin(frame_parms->samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME,ulsch_start+frame_parms->samples_per_tti));
|
||||||
|
|
||||||
|
if (overflow> 0)
|
||||||
|
memset(&ue->common_vars.txdata[aa][0],0,4*overflow);
|
||||||
|
}
|
||||||
|
/*#else
|
||||||
|
overflow = ulsch_start - 9*frame_parms->samples_per_tti;
|
||||||
|
for (aa=0; aa<frame_parms->nb_antennas_tx; aa++) {
|
||||||
|
for (k=ulsch_start; k<cmin(frame_parms->samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME,ulsch_start+frame_parms->samples_per_tti); k++) {
|
||||||
|
((short*)ue->common_vars.txdata[aa])[2*k] = 0;
|
||||||
|
((short*)ue->common_vars.txdata[aa])[2*k+1] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (k=0; k<overflow; k++) {
|
||||||
|
((short*)ue->common_vars.txdata[aa])[2*k] = 0;
|
||||||
|
((short*)ue->common_vars.txdata[aa])[2*k+1] = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif*/
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if ((frame_tx%100) == 0)
|
if ((frame_tx%100) == 0)
|
||||||
LOG_D(PHY,"[UE %d] Frame %d, subframe %d: ulsch_start = %d (rxoff %d, HW TA %d, timing advance %d, TA_offset %d\n",
|
LOG_D(PHY,"[UE %d] Frame %d, subframe %d: ulsch_start = %d (rxoff %d, HW TA %d, timing advance %d, TA_offset %d\n",
|
||||||
ue->Mod_id,frame_tx,subframe_tx,
|
ue->Mod_id,frame_tx,subframe_tx,
|
||||||
@@ -1082,7 +1156,7 @@ void ue_prach_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin
|
|||||||
frame_tx,
|
frame_tx,
|
||||||
eNB_id,
|
eNB_id,
|
||||||
subframe_tx);
|
subframe_tx);
|
||||||
LOG_D(PHY,"Got prach_resources for eNB %d address %d, RRCCommon %d\n",eNB_id,ue->prach_resources[eNB_id],UE_mac_inst[ue->Mod_id].radioResourceConfigCommon);
|
LOG_D(PHY,"Got prach_resources for eNB %d address %p, RRCCommon %p\n",eNB_id,ue->prach_resources[eNB_id],UE_mac_inst[ue->Mod_id].radioResourceConfigCommon);
|
||||||
LOG_D(PHY,"Prach resources %p\n",ue->prach_resources[eNB_id]);
|
LOG_D(PHY,"Prach resources %p\n",ue->prach_resources[eNB_id]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1194,7 +1268,6 @@ void ue_ulsch_uespec_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB
|
|||||||
int Mod_id = ue->Mod_id;
|
int Mod_id = ue->Mod_id;
|
||||||
int CC_id = ue->CC_id;
|
int CC_id = ue->CC_id;
|
||||||
uint8_t Msg3_flag=0;
|
uint8_t Msg3_flag=0;
|
||||||
uint8_t ack_status=0;
|
|
||||||
uint16_t first_rb, nb_rb;
|
uint16_t first_rb, nb_rb;
|
||||||
unsigned int input_buffer_length;
|
unsigned int input_buffer_length;
|
||||||
int i;
|
int i;
|
||||||
@@ -1202,6 +1275,8 @@ void ue_ulsch_uespec_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB
|
|||||||
int tx_amp;
|
int tx_amp;
|
||||||
uint8_t ulsch_input_buffer[5477] __attribute__ ((aligned(32)));
|
uint8_t ulsch_input_buffer[5477] __attribute__ ((aligned(32)));
|
||||||
uint8_t access_mode;
|
uint8_t access_mode;
|
||||||
|
uint8_t Nbundled=0;
|
||||||
|
uint8_t ack_status=0;
|
||||||
|
|
||||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_TX_ULSCH_UESPEC,VCD_FUNCTION_IN);
|
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_TX_ULSCH_UESPEC,VCD_FUNCTION_IN);
|
||||||
|
|
||||||
@@ -1245,6 +1320,49 @@ void ue_ulsch_uespec_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ue->ulsch[eNB_id]->harq_processes[harq_pid]->subframe_scheduling_flag == 1) {
|
||||||
|
|
||||||
|
uint8_t isBad = 0;
|
||||||
|
if (ue->frame_parms.N_RB_UL <= ue->ulsch[eNB_id]->harq_processes[harq_pid]->first_rb) {
|
||||||
|
LOG_D(PHY,"Invalid PUSCH first_RB=%d for N_RB_UL=%d\n",
|
||||||
|
ue->ulsch[eNB_id]->harq_processes[harq_pid]->first_rb,
|
||||||
|
ue->frame_parms.N_RB_UL);
|
||||||
|
isBad = 1;
|
||||||
|
}
|
||||||
|
if (ue->frame_parms.N_RB_UL < ue->ulsch[eNB_id]->harq_processes[harq_pid]->nb_rb) {
|
||||||
|
LOG_D(PHY,"Invalid PUSCH num_RB=%d for N_RB_UL=%d\n",
|
||||||
|
ue->ulsch[eNB_id]->harq_processes[harq_pid]->nb_rb,
|
||||||
|
ue->frame_parms.N_RB_UL);
|
||||||
|
isBad = 1;
|
||||||
|
}
|
||||||
|
if (0 > ue->ulsch[eNB_id]->harq_processes[harq_pid]->first_rb) {
|
||||||
|
LOG_D(PHY,"Invalid PUSCH first_RB=%d\n",
|
||||||
|
ue->ulsch[eNB_id]->harq_processes[harq_pid]->first_rb);
|
||||||
|
isBad = 1;
|
||||||
|
}
|
||||||
|
if (0 >= ue->ulsch[eNB_id]->harq_processes[harq_pid]->nb_rb) {
|
||||||
|
LOG_D(PHY,"Invalid PUSCH num_RB=%d\n",
|
||||||
|
ue->ulsch[eNB_id]->harq_processes[harq_pid]->nb_rb);
|
||||||
|
isBad = 1;
|
||||||
|
}
|
||||||
|
if (ue->frame_parms.N_RB_UL < (ue->ulsch[eNB_id]->harq_processes[harq_pid]->nb_rb + ue->ulsch[eNB_id]->harq_processes[harq_pid]->first_rb)) {
|
||||||
|
LOG_D(PHY,"Invalid PUSCH num_RB=%d + first_RB=%d for N_RB_UL=%d\n",
|
||||||
|
ue->ulsch[eNB_id]->harq_processes[harq_pid]->nb_rb,
|
||||||
|
ue->ulsch[eNB_id]->harq_processes[harq_pid]->first_rb,
|
||||||
|
ue->frame_parms.N_RB_UL);
|
||||||
|
isBad = 1;
|
||||||
|
}
|
||||||
|
if ((0 > ue->ulsch[eNB_id]->harq_processes[harq_pid]->rvidx) ||
|
||||||
|
(3 < ue->ulsch[eNB_id]->harq_processes[harq_pid]->rvidx)) {
|
||||||
|
LOG_D(PHY,"Invalid PUSCH RV index=%d\n", ue->ulsch[eNB_id]->harq_processes[harq_pid]->rvidx);
|
||||||
|
isBad = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isBad) {
|
||||||
|
LOG_D(PHY,"Skip PUSCH generation!\n");
|
||||||
|
ue->ulsch[eNB_id]->harq_processes[harq_pid]->subframe_scheduling_flag = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (ue->ulsch[eNB_id]->harq_processes[harq_pid]->subframe_scheduling_flag == 1) {
|
if (ue->ulsch[eNB_id]->harq_processes[harq_pid]->subframe_scheduling_flag == 1) {
|
||||||
|
|
||||||
ue->generate_ul_signal[eNB_id] = 1;
|
ue->generate_ul_signal[eNB_id] = 1;
|
||||||
@@ -1254,7 +1372,7 @@ void ue_ulsch_uespec_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB
|
|||||||
LOG_D(PHY,"Generating PUSCH (Abssubframe: %d.%d): harq-Id: %d, round: %d, MaxReTrans: %d \n",frame_tx,subframe_tx,harq_pid,ue->ulsch[eNB_id]->harq_processes[harq_pid]->round,ue->ulsch[eNB_id]->Mlimit);
|
LOG_D(PHY,"Generating PUSCH (Abssubframe: %d.%d): harq-Id: %d, round: %d, MaxReTrans: %d \n",frame_tx,subframe_tx,harq_pid,ue->ulsch[eNB_id]->harq_processes[harq_pid]->round,ue->ulsch[eNB_id]->Mlimit);
|
||||||
if (ue->ulsch[eNB_id]->harq_processes[harq_pid]->round >= (ue->ulsch[eNB_id]->Mlimit - 1))
|
if (ue->ulsch[eNB_id]->harq_processes[harq_pid]->round >= (ue->ulsch[eNB_id]->Mlimit - 1))
|
||||||
{
|
{
|
||||||
LOG_D(PHY,"PUSCH MAX Retransmission acheived ==> send last pusch (%d) \n");
|
LOG_D(PHY,"PUSCH MAX Retransmission achieved ==> send last pusch\n");
|
||||||
ue->ulsch[eNB_id]->harq_processes[harq_pid]->subframe_scheduling_flag = 0;
|
ue->ulsch[eNB_id]->harq_processes[harq_pid]->subframe_scheduling_flag = 0;
|
||||||
ue->ulsch[eNB_id]->harq_processes[harq_pid]->round = 0;
|
ue->ulsch[eNB_id]->harq_processes[harq_pid]->round = 0;
|
||||||
}
|
}
|
||||||
@@ -1263,7 +1381,7 @@ void ue_ulsch_uespec_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB
|
|||||||
ue->dlsch[eNB_id][0]->harq_ack,
|
ue->dlsch[eNB_id][0]->harq_ack,
|
||||||
subframe_tx,
|
subframe_tx,
|
||||||
ue->ulsch[eNB_id]->o_ACK);
|
ue->ulsch[eNB_id]->o_ACK);
|
||||||
|
Nbundled = ack_status;
|
||||||
first_rb = ue->ulsch[eNB_id]->harq_processes[harq_pid]->first_rb;
|
first_rb = ue->ulsch[eNB_id]->harq_processes[harq_pid]->first_rb;
|
||||||
nb_rb = ue->ulsch[eNB_id]->harq_processes[harq_pid]->nb_rb;
|
nb_rb = ue->ulsch[eNB_id]->harq_processes[harq_pid]->nb_rb;
|
||||||
|
|
||||||
@@ -1283,6 +1401,22 @@ void ue_ulsch_uespec_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB
|
|||||||
{
|
{
|
||||||
ue->ulsch[eNB_id]->harq_processes[harq_pid]->O_ACK = 0;
|
ue->ulsch[eNB_id]->harq_processes[harq_pid]->O_ACK = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if T_TRACER
|
||||||
|
if(ue->ulsch[eNB_id]->o_ACK[0])
|
||||||
|
{
|
||||||
|
LOG_I(PHY,"PUSCH ACK\n");
|
||||||
|
T(T_UE_PHY_DLSCH_UE_ACK, T_INT(eNB_id), T_INT(frame_tx%1024), T_INT(subframe_tx), T_INT(Mod_id), T_INT(ue->dlsch[eNB_id][0]->rnti),
|
||||||
|
T_INT(ue->dlsch[eNB_id][0]->current_harq_pid));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
LOG_I(PHY,"PUSCH NACK\n");
|
||||||
|
T(T_UE_PHY_DLSCH_UE_NACK, T_INT(eNB_id), T_INT(frame_tx%1024), T_INT(subframe_tx), T_INT(Mod_id), T_INT(ue->dlsch[eNB_id][0]->rnti),
|
||||||
|
T_INT(ue->dlsch[eNB_id][0]->current_harq_pid));
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
LOG_D(PHY,"[UE %d][PDSCH %x] Frame %d subframe %d Generating ACK (%d,%d) for %d bits on PUSCH\n",
|
LOG_D(PHY,"[UE %d][PDSCH %x] Frame %d subframe %d Generating ACK (%d,%d) for %d bits on PUSCH\n",
|
||||||
Mod_id,
|
Mod_id,
|
||||||
ue->ulsch[eNB_id]->rnti,
|
ue->ulsch[eNB_id]->rnti,
|
||||||
@@ -1292,8 +1426,8 @@ void ue_ulsch_uespec_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef DEBUG_PHY_PROC
|
#ifdef DEBUG_PHY_PROC
|
||||||
LOG_D(PHY,
|
LOG_D(PHY,
|
||||||
"[UE %d][PUSCH %d] Frame %d subframe %d Generating PUSCH : first_rb %d, nb_rb %d, round %d, mcs %d, rv %d, cyclic_shift %d (cyclic_shift_common %d,n_DMRS2 %d,n_PRS %d), ACK (%d,%d), O_ACK %d\n",
|
"[UE %d][PUSCH %d] Frame %d subframe %d Generating PUSCH : first_rb %d, nb_rb %d, round %d, mcs %d, rv %d, cyclic_shift %d (cyclic_shift_common %d,n_DMRS2 %d,n_PRS %d), ACK (%d,%d), O_ACK %d, bundling %d\n",
|
||||||
Mod_id,harq_pid,frame_tx,subframe_tx,
|
Mod_id,harq_pid,frame_tx,subframe_tx,
|
||||||
first_rb,nb_rb,
|
first_rb,nb_rb,
|
||||||
ue->ulsch[eNB_id]->harq_processes[harq_pid]->round,
|
ue->ulsch[eNB_id]->harq_processes[harq_pid]->round,
|
||||||
@@ -1306,7 +1440,8 @@ void ue_ulsch_uespec_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB
|
|||||||
ue->ulsch[eNB_id]->harq_processes[harq_pid]->n_DMRS2,
|
ue->ulsch[eNB_id]->harq_processes[harq_pid]->n_DMRS2,
|
||||||
ue->frame_parms.pusch_config_common.ul_ReferenceSignalsPUSCH.nPRS[subframe_tx<<1],
|
ue->frame_parms.pusch_config_common.ul_ReferenceSignalsPUSCH.nPRS[subframe_tx<<1],
|
||||||
ue->ulsch[eNB_id]->o_ACK[0],ue->ulsch[eNB_id]->o_ACK[1],
|
ue->ulsch[eNB_id]->o_ACK[0],ue->ulsch[eNB_id]->o_ACK[1],
|
||||||
ue->ulsch[eNB_id]->harq_processes[harq_pid]->O_ACK);
|
ue->ulsch[eNB_id]->harq_processes[harq_pid]->O_ACK,
|
||||||
|
ue->ulsch[eNB_id]->bundling);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
@@ -1408,8 +1543,8 @@ void ue_ulsch_uespec_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB
|
|||||||
ue,
|
ue,
|
||||||
harq_pid,
|
harq_pid,
|
||||||
eNB_id,
|
eNB_id,
|
||||||
ue->transmission_mode[eNB_id],0,
|
ue->transmission_mode[eNB_id],0,
|
||||||
0)!=0) { // Nbundled, to be updated!!!!
|
Nbundled)!=0) {
|
||||||
LOG_E(PHY,"ulsch_coding.c: FATAL ERROR: returning\n");
|
LOG_E(PHY,"ulsch_coding.c: FATAL ERROR: returning\n");
|
||||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_TX, VCD_FUNCTION_OUT);
|
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_TX, VCD_FUNCTION_OUT);
|
||||||
stop_meas(&ue->phy_proc_tx);
|
stop_meas(&ue->phy_proc_tx);
|
||||||
@@ -1443,6 +1578,10 @@ void ue_ulsch_uespec_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB
|
|||||||
nb_rb);
|
nb_rb);
|
||||||
#else
|
#else
|
||||||
tx_amp = AMP;
|
tx_amp = AMP;
|
||||||
|
#endif
|
||||||
|
#if T_TRACER
|
||||||
|
T(T_UE_PHY_PUSCH_TX_POWER, T_INT(eNB_id),T_INT(Mod_id), T_INT(frame_tx%1024), T_INT(subframe_tx),T_INT(ue->tx_power_dBm[subframe_tx]),
|
||||||
|
T_INT(tx_amp),T_INT(ue->ulsch[eNB_id]->f_pusch),T_INT(get_PL(Mod_id,0,eNB_id)),T_INT(nb_rb));
|
||||||
#endif
|
#endif
|
||||||
LOG_D(PHY,"[UE %d][PUSCH %d] Frame %d subframe %d, generating PUSCH, Po_PUSCH: %d dBm (max %d dBm), amp %d\n",
|
LOG_D(PHY,"[UE %d][PUSCH %d] Frame %d subframe %d, generating PUSCH, Po_PUSCH: %d dBm (max %d dBm), amp %d\n",
|
||||||
Mod_id,harq_pid,frame_tx,subframe_tx,ue->tx_power_dBm[subframe_tx],ue->tx_power_max_dBm, tx_amp);
|
Mod_id,harq_pid,frame_tx,subframe_tx,ue->tx_power_dBm[subframe_tx],ue->tx_power_max_dBm, tx_amp);
|
||||||
@@ -1569,7 +1708,8 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin
|
|||||||
int Mod_id = ue->Mod_id;
|
int Mod_id = ue->Mod_id;
|
||||||
int CC_id = ue->CC_id;
|
int CC_id = ue->CC_id;
|
||||||
int tx_amp;
|
int tx_amp;
|
||||||
int8_t Po_PUCCH;
|
int16_t Po_PUCCH;
|
||||||
|
uint8_t ack_status=0;
|
||||||
|
|
||||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_TX_PUCCH,VCD_FUNCTION_IN);
|
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_TX_PUCCH,VCD_FUNCTION_IN);
|
||||||
|
|
||||||
@@ -1588,6 +1728,7 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin
|
|||||||
if(ue->ulsch[eNB_id]->harq_processes[harq_pid]->subframe_scheduling_flag)
|
if(ue->ulsch[eNB_id]->harq_processes[harq_pid]->subframe_scheduling_flag)
|
||||||
{
|
{
|
||||||
LOG_D(PHY,"PUSCH is programmed on this subframe [pid %d] AbsSuframe %d.%d ==> Skip PUCCH transmission \n",harq_pid,frame_tx,subframe_tx);
|
LOG_D(PHY,"PUSCH is programmed on this subframe [pid %d] AbsSuframe %d.%d ==> Skip PUCCH transmission \n",harq_pid,frame_tx,subframe_tx);
|
||||||
|
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_TX_PUCCH,VCD_FUNCTION_OUT);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1633,18 +1774,24 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin
|
|||||||
SR_payload=0;
|
SR_payload=0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (get_ack(&ue->frame_parms,
|
ack_status = get_ack(&ue->frame_parms,
|
||||||
ue->dlsch[eNB_id][0]->harq_ack,
|
ue->dlsch[eNB_id][0]->harq_ack,
|
||||||
subframe_tx,pucch_ack_payload) > 0) {
|
subframe_tx,pucch_ack_payload);
|
||||||
|
if (ack_status > 0) {
|
||||||
// we need to transmit ACK/NAK in this subframe
|
// we need to transmit ACK/NAK in this subframe
|
||||||
|
|
||||||
ue->generate_ul_signal[eNB_id] = 1;
|
ue->generate_ul_signal[eNB_id] = 1;
|
||||||
|
|
||||||
|
if ((frame_parms->frame_type == TDD) && (SR_payload>0)) {
|
||||||
|
format = pucch_format1b;
|
||||||
|
}
|
||||||
|
|
||||||
n1_pucch = get_n1_pucch(ue,
|
n1_pucch = get_n1_pucch(ue,
|
||||||
proc,
|
proc,
|
||||||
eNB_id,
|
ue->dlsch[eNB_id][0]->harq_ack,
|
||||||
pucch_ack_payload,
|
eNB_id,
|
||||||
SR_payload);
|
pucch_ack_payload,
|
||||||
|
SR_payload);
|
||||||
|
|
||||||
if (ue->mac_enabled == 1) {
|
if (ue->mac_enabled == 1) {
|
||||||
Po_PUCCH = pucch_power_cntl(ue,proc,subframe_tx,eNB_id,format);
|
Po_PUCCH = pucch_power_cntl(ue,proc,subframe_tx,eNB_id,format);
|
||||||
@@ -1663,29 +1810,51 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin
|
|||||||
#else
|
#else
|
||||||
tx_amp = AMP;
|
tx_amp = AMP;
|
||||||
#endif
|
#endif
|
||||||
|
#if T_TRACER
|
||||||
|
T(T_UE_PHY_PUCCH_TX_POWER, T_INT(eNB_id),T_INT(Mod_id), T_INT(frame_tx%1024), T_INT(subframe_tx),T_INT(ue->tx_power_dBm[subframe_tx]),
|
||||||
|
T_INT(tx_amp),T_INT(ue->dlsch[eNB_id][0]->g_pucch),T_INT(get_PL(ue->Mod_id,ue->CC_id,eNB_id)));
|
||||||
|
#endif
|
||||||
if (SR_payload>0) {
|
if (SR_payload>0) {
|
||||||
LOG_D(PHY,"[UE %d][SR %x] Frame %d subframe %d Generating PUCCH 1a/1b payload %d,%d (with SR for PUSCH), an_srs_simultanous %d, shorten_pucch %d, n1_pucch %d, Po_PUCCH, amp %d\n",
|
LOG_D(PHY,"[UE %d][SR %x] AbsSubFrame %d.%d Generating PUCCH %s payload %d,%d (with SR for PUSCH), an_srs_simultanous %d, shorten_pucch %d, n1_pucch %d, Po_PUCCH %d, amp %d\n",
|
||||||
Mod_id,
|
Mod_id,
|
||||||
ue->dlsch[eNB_id][0]->rnti,
|
ue->dlsch[eNB_id][0]->rnti,
|
||||||
frame_parms->soundingrs_ul_config_common.ackNackSRS_SimultaneousTransmission,
|
frame_tx % 1024, subframe_tx,
|
||||||
isShortenPucch,
|
(format == pucch_format1a? "1a": (
|
||||||
frame_tx, subframe_tx,
|
format == pucch_format1b? "1b" : "??")),
|
||||||
pucch_ack_payload[0],pucch_ack_payload[1],
|
pucch_ack_payload[0],pucch_ack_payload[1],
|
||||||
|
frame_parms->soundingrs_ul_config_common.ackNackSRS_SimultaneousTransmission,
|
||||||
|
isShortenPucch,
|
||||||
ue->scheduling_request_config[eNB_id].sr_PUCCH_ResourceIndex,
|
ue->scheduling_request_config[eNB_id].sr_PUCCH_ResourceIndex,
|
||||||
Po_PUCCH,
|
Po_PUCCH,
|
||||||
tx_amp);
|
tx_amp);
|
||||||
} else {
|
} else {
|
||||||
LOG_D(PHY,"[UE %d][PDSCH %x] Frame %d subframe %d Generating PUCCH 1a/1b, an_srs_simultanous %d, shorten_pucch %d, n1_pucch %d, b[0]=%d,b[1]=%d (SR_Payload %d), Po_PUCCH %d, amp %d\n",
|
LOG_D(PHY,"[UE %d][PDSCH %x] AbsSubFrame %d.%d rx_offset_diff: %d, Generating PUCCH %s, an_srs_simultanous %d, shorten_pucch %d, n1_pucch %d, b[0]=%d,b[1]=%d (SR_Payload %d), Po_PUCCH %d, amp %d\n",
|
||||||
Mod_id,
|
Mod_id,
|
||||||
ue->dlsch[eNB_id][0]->rnti,
|
ue->dlsch[eNB_id][0]->rnti,
|
||||||
frame_tx, subframe_tx,
|
frame_tx, subframe_tx,ue->rx_offset_diff,
|
||||||
|
(format == pucch_format1a? "1a": (
|
||||||
|
format == pucch_format1b? "1b" : "??")),
|
||||||
frame_parms->soundingrs_ul_config_common.ackNackSRS_SimultaneousTransmission,
|
frame_parms->soundingrs_ul_config_common.ackNackSRS_SimultaneousTransmission,
|
||||||
isShortenPucch,
|
isShortenPucch,
|
||||||
n1_pucch,pucch_ack_payload[0],pucch_ack_payload[1],SR_payload,
|
n1_pucch,pucch_ack_payload[0],pucch_ack_payload[1],SR_payload,
|
||||||
Po_PUCCH,
|
Po_PUCCH,
|
||||||
tx_amp);
|
tx_amp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if T_TRACER
|
||||||
|
if(pucch_ack_payload[0])
|
||||||
|
{
|
||||||
|
LOG_I(PHY,"PUCCH ACK\n");
|
||||||
|
T(T_UE_PHY_DLSCH_UE_ACK, T_INT(eNB_id), T_INT(frame_tx%1024), T_INT(subframe_tx), T_INT(Mod_id), T_INT(ue->dlsch[eNB_id][0]->rnti),
|
||||||
|
T_INT(ue->dlsch[eNB_id][0]->current_harq_pid));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
LOG_I(PHY,"PUCCH NACK\n");
|
||||||
|
T(T_UE_PHY_DLSCH_UE_NACK, T_INT(eNB_id), T_INT(frame_tx%1024), T_INT(subframe_tx), T_INT(Mod_id), T_INT(ue->dlsch[eNB_id][0]->rnti),
|
||||||
|
T_INT(ue->dlsch[eNB_id][0]->current_harq_pid));
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (abstraction_flag == 0) {
|
if (abstraction_flag == 0) {
|
||||||
|
|
||||||
@@ -1729,6 +1898,10 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin
|
|||||||
1);
|
1);
|
||||||
#else
|
#else
|
||||||
tx_amp = AMP;
|
tx_amp = AMP;
|
||||||
|
#endif
|
||||||
|
#if T_TRACER
|
||||||
|
T(T_UE_PHY_PUCCH_TX_POWER, T_INT(eNB_id),T_INT(Mod_id), T_INT(frame_tx%1024), T_INT(subframe_tx),T_INT(ue->tx_power_dBm[subframe_tx]),
|
||||||
|
T_INT(tx_amp),T_INT(ue->dlsch[eNB_id][0]->g_pucch),T_INT(get_PL(ue->Mod_id,ue->CC_id,eNB_id)));
|
||||||
#endif
|
#endif
|
||||||
LOG_D(PHY,"[UE %d][SR %x] Frame %d subframe %d Generating PUCCH 1 (SR for PUSCH), an_srs_simultanous %d, shorten_pucch %d, n1_pucch %d, Po_PUCCH %d\n",
|
LOG_D(PHY,"[UE %d][SR %x] Frame %d subframe %d Generating PUCCH 1 (SR for PUSCH), an_srs_simultanous %d, shorten_pucch %d, n1_pucch %d, Po_PUCCH %d\n",
|
||||||
Mod_id,
|
Mod_id,
|
||||||
@@ -1793,6 +1966,10 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin
|
|||||||
1);
|
1);
|
||||||
#else
|
#else
|
||||||
tx_amp = AMP;
|
tx_amp = AMP;
|
||||||
|
#endif
|
||||||
|
#if T_TRACER
|
||||||
|
T(T_UE_PHY_PUCCH_TX_POWER, T_INT(eNB_id),T_INT(Mod_id), T_INT(frame_tx%1024), T_INT(subframe_tx),T_INT(ue->tx_power_dBm[subframe_tx]),
|
||||||
|
T_INT(tx_amp),T_INT(ue->dlsch[eNB_id][0]->g_pucch),T_INT(get_PL(ue->Mod_id,ue->CC_id,eNB_id)));
|
||||||
#endif
|
#endif
|
||||||
LOG_D(PHY,"[UE %d][RNTI %x] AbsSubFrame %d.%d Generating PUCCH 2 (CQI), n2_pucch %d, Po_PUCCH %d, isShortenPucch %d, amp %d\n",
|
LOG_D(PHY,"[UE %d][RNTI %x] AbsSubFrame %d.%d Generating PUCCH 2 (CQI), n2_pucch %d, Po_PUCCH %d, isShortenPucch %d, amp %d\n",
|
||||||
Mod_id,
|
Mod_id,
|
||||||
@@ -1833,7 +2010,10 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin
|
|||||||
}
|
}
|
||||||
ue->tx_power_dBm[subframe_tx] = Po_PUCCH;
|
ue->tx_power_dBm[subframe_tx] = Po_PUCCH;
|
||||||
ue->tx_total_RE[subframe_tx] = 12;
|
ue->tx_total_RE[subframe_tx] = 12;
|
||||||
|
#if T_TRACER
|
||||||
|
T(T_UE_PHY_PUCCH_TX_POWER, T_INT(eNB_id),T_INT(Mod_id), T_INT(frame_tx%1024), T_INT(subframe_tx),T_INT(ue->tx_power_dBm[subframe_tx]),
|
||||||
|
T_INT(tx_amp),T_INT(ue->dlsch[eNB_id][0]->g_pucch),T_INT(get_PL(ue->Mod_id,ue->CC_id,eNB_id)));
|
||||||
|
#endif
|
||||||
#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR)
|
#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR)
|
||||||
tx_amp = get_tx_amp(Po_PUCCH,
|
tx_amp = get_tx_amp(Po_PUCCH,
|
||||||
ue->tx_power_max_dBm,
|
ue->tx_power_max_dBm,
|
||||||
@@ -1869,22 +2049,29 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin
|
|||||||
ue->generate_ul_signal[eNB_id] = 1;
|
ue->generate_ul_signal[eNB_id] = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_TX_PUCCH,VCD_FUNCTION_OUT);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void phy_procedures_UE_TX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t abstraction_flag,runmode_t mode,relaying_type_t r_type) {
|
void phy_procedures_UE_TX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t abstraction_flag,runmode_t mode,relaying_type_t r_type) {
|
||||||
|
|
||||||
|
|
||||||
LTE_DL_FRAME_PARMS *frame_parms=&ue->frame_parms;
|
LTE_DL_FRAME_PARMS *frame_parms=&ue->frame_parms;
|
||||||
int32_t ulsch_start=0;
|
//int32_t ulsch_start=0;
|
||||||
int subframe_tx = proc->subframe_tx;
|
int subframe_tx = proc->subframe_tx;
|
||||||
int frame_tx = proc->frame_tx;
|
int frame_tx = proc->frame_tx;
|
||||||
unsigned int aa;
|
unsigned int aa;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_TX,VCD_FUNCTION_IN);
|
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_TX,VCD_FUNCTION_IN);
|
||||||
|
|
||||||
|
#if T_TRACER
|
||||||
|
T(T_UE_PHY_UL_TICK, T_INT(ue->Mod_id), T_INT(frame_tx%1024), T_INT(subframe_tx));
|
||||||
|
#endif
|
||||||
|
|
||||||
ue->generate_ul_signal[eNB_id] = 0;
|
ue->generate_ul_signal[eNB_id] = 0;
|
||||||
|
|
||||||
start_meas(&ue->phy_proc_tx);
|
start_meas(&ue->phy_proc_tx);
|
||||||
@@ -1978,25 +2165,7 @@ void phy_procedures_UE_TX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,ui
|
|||||||
|
|
||||||
|
|
||||||
if (abstraction_flag == 0) {
|
if (abstraction_flag == 0) {
|
||||||
|
ulsch_common_procedures(ue,proc, (ue->generate_ul_signal[eNB_id] == 0));
|
||||||
if (ue->generate_ul_signal[eNB_id] == 1 )
|
|
||||||
{
|
|
||||||
ulsch_common_procedures(ue,proc);
|
|
||||||
}
|
|
||||||
else { // no uplink so clear signal buffer instead
|
|
||||||
#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR)//this is the EXPRESS MIMO case
|
|
||||||
ulsch_start = (ue->rx_offset+subframe_tx*frame_parms->samples_per_tti-
|
|
||||||
ue->hw_timing_advance-
|
|
||||||
ue->timing_advance-
|
|
||||||
ue->N_TA_offset+5)%(LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*frame_parms->samples_per_tti);
|
|
||||||
#else //this is the normal case
|
|
||||||
ulsch_start = (frame_parms->samples_per_tti*subframe_tx)-ue->N_TA_offset; //-ue->timing_advance;
|
|
||||||
#endif //else EXMIMO
|
|
||||||
for (aa=0; aa<frame_parms->nb_antennas_tx; aa++) {
|
|
||||||
memset(&ue->common_vars.txdata[aa][ulsch_start],0,frame_parms->samples_per_tti<<2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
} // mode != PRACH
|
} // mode != PRACH
|
||||||
|
|
||||||
|
|
||||||
@@ -2014,6 +2183,17 @@ void phy_procedures_UE_TX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,ui
|
|||||||
ue->generate_prach=0;
|
ue->generate_prach=0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// reset DL ACK/NACK status
|
||||||
|
reset_ack(&ue->frame_parms,
|
||||||
|
ue->dlsch[eNB_id][0]->harq_ack,
|
||||||
|
subframe_tx,
|
||||||
|
ue->ulsch[eNB_id]->o_ACK);
|
||||||
|
|
||||||
|
reset_ack(&ue->frame_parms,
|
||||||
|
ue->dlsch_SI[eNB_id]->harq_ack,
|
||||||
|
subframe_tx,
|
||||||
|
ue->ulsch[eNB_id]->o_ACK);
|
||||||
|
|
||||||
|
|
||||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_TX, VCD_FUNCTION_OUT);
|
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_TX, VCD_FUNCTION_OUT);
|
||||||
stop_meas(&ue->phy_proc_tx);
|
stop_meas(&ue->phy_proc_tx);
|
||||||
@@ -2042,7 +2222,11 @@ void phy_procedures_UE_S_TX(PHY_VARS_UE *ue,uint8_t eNB_id,uint8_t abstraction_f
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ue_measurement_procedures(uint16_t l, PHY_VARS_UE *ue,UE_rxtx_proc_t *proc, uint8_t eNB_id,uint8_t abstraction_flag,runmode_t mode)
|
void ue_measurement_procedures(
|
||||||
|
uint16_t l, // symbol index of each slot [0..6]
|
||||||
|
PHY_VARS_UE *ue,UE_rxtx_proc_t *proc, uint8_t eNB_id,
|
||||||
|
uint16_t slot, // slot index of each radio frame [0..19]
|
||||||
|
uint8_t abstraction_flag,runmode_t mode)
|
||||||
{
|
{
|
||||||
|
|
||||||
LTE_DL_FRAME_PARMS *frame_parms=&ue->frame_parms;
|
LTE_DL_FRAME_PARMS *frame_parms=&ue->frame_parms;
|
||||||
@@ -2059,13 +2243,25 @@ void ue_measurement_procedures(uint16_t l, PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,
|
|||||||
lte_ue_measurements(ue,
|
lte_ue_measurements(ue,
|
||||||
(subframe_rx*frame_parms->samples_per_tti+ue->rx_offset)%(frame_parms->samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME),
|
(subframe_rx*frame_parms->samples_per_tti+ue->rx_offset)%(frame_parms->samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME),
|
||||||
(subframe_rx == 1) ? 1 : 0,
|
(subframe_rx == 1) ? 1 : 0,
|
||||||
0);
|
0,subframe_rx);
|
||||||
} else {
|
} else {
|
||||||
lte_ue_measurements(ue,
|
lte_ue_measurements(ue,
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
1);
|
1,
|
||||||
|
subframe_rx);
|
||||||
}
|
}
|
||||||
|
#if T_TRACER
|
||||||
|
if(slot == 0)
|
||||||
|
T(T_UE_PHY_MEAS, T_INT(eNB_id), T_INT(ue->Mod_id), T_INT(proc->frame_rx%1024), T_INT(proc->subframe_rx),
|
||||||
|
T_INT((int)(10*log10(ue->measurements.rsrp[0])-ue->rx_total_gain_dB)),
|
||||||
|
T_INT((int)ue->measurements.rx_rssi_dBm[0]),
|
||||||
|
T_INT((int)(ue->measurements.rx_power_avg_dB[0] - ue->measurements.n0_power_avg_dB)),
|
||||||
|
T_INT((int)ue->measurements.rx_power_avg_dB[0]),
|
||||||
|
T_INT((int)ue->measurements.n0_power_avg_dB),
|
||||||
|
T_INT((int)ue->measurements.wideband_cqi_avg[0]),
|
||||||
|
T_INT((int)ue->common_vars.freq_offset));
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if (l==(6-ue->frame_parms.Ncp)) {
|
if (l==(6-ue->frame_parms.Ncp)) {
|
||||||
@@ -2074,16 +2270,16 @@ void ue_measurement_procedures(uint16_t l, PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,
|
|||||||
|
|
||||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_RRC_MEASUREMENTS, VCD_FUNCTION_IN);
|
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_RRC_MEASUREMENTS, VCD_FUNCTION_IN);
|
||||||
ue_rrc_measurements(ue,
|
ue_rrc_measurements(ue,
|
||||||
subframe_rx,
|
slot,
|
||||||
abstraction_flag);
|
abstraction_flag);
|
||||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_RRC_MEASUREMENTS, VCD_FUNCTION_OUT);
|
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_RRC_MEASUREMENTS, VCD_FUNCTION_OUT);
|
||||||
|
|
||||||
if (abstraction_flag==1)
|
if (abstraction_flag==1)
|
||||||
ue->sinr_eff = sinr_eff_cqi_calc(ue, 0);
|
ue->sinr_eff = sinr_eff_cqi_calc(ue, 0, subframe_rx);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((subframe_rx==0) && (l==(4-frame_parms->Ncp))) {
|
if ((subframe_rx==0) && (slot == 0) && (l==(4-frame_parms->Ncp))) {
|
||||||
|
|
||||||
// AGC
|
// AGC
|
||||||
|
|
||||||
@@ -2106,6 +2302,7 @@ void ue_measurement_procedures(uint16_t l, PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,
|
|||||||
lte_adjust_synch(&ue->frame_parms,
|
lte_adjust_synch(&ue->frame_parms,
|
||||||
ue,
|
ue,
|
||||||
eNB_id,
|
eNB_id,
|
||||||
|
subframe_rx,
|
||||||
0,
|
0,
|
||||||
16384);
|
16384);
|
||||||
}
|
}
|
||||||
@@ -2378,7 +2575,7 @@ void ue_pbch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc, uin
|
|||||||
|
|
||||||
} else if (((frame_tx & 0x03FF) != (proc->frame_rx & 0x03FF))) {
|
} else if (((frame_tx & 0x03FF) != (proc->frame_rx & 0x03FF))) {
|
||||||
//(pbch_tx_ant != ue->frame_parms.nb_antennas_tx)) {
|
//(pbch_tx_ant != ue->frame_parms.nb_antennas_tx)) {
|
||||||
LOG_D(PHY,"[UE %d] frame %d, subframe %d: Re-adjusting frame counter (PBCH ant_tx=%d, frame_rx=%d, frame%1024=%d, phase %d).\n",
|
LOG_D(PHY,"[UE %d] frame %d, subframe %d: Re-adjusting frame counter (PBCH ant_tx=%d, frame_rx=%d, frame%%1024=%d, phase %d).\n",
|
||||||
ue->Mod_id,
|
ue->Mod_id,
|
||||||
proc->frame_rx,
|
proc->frame_rx,
|
||||||
subframe_rx,
|
subframe_rx,
|
||||||
@@ -2482,6 +2679,7 @@ int ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint
|
|||||||
rx_pdcch(&ue->common_vars,
|
rx_pdcch(&ue->common_vars,
|
||||||
ue->pdcch_vars,
|
ue->pdcch_vars,
|
||||||
&ue->frame_parms,
|
&ue->frame_parms,
|
||||||
|
proc->frame_rx,
|
||||||
subframe_rx,
|
subframe_rx,
|
||||||
eNB_id,
|
eNB_id,
|
||||||
(ue->frame_parms.mode1_flag == 1) ? SISO : ALAMOUTI,
|
(ue->frame_parms.mode1_flag == 1) ? SISO : ALAMOUTI,
|
||||||
@@ -2556,9 +2754,7 @@ int ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
LOG_D(PHY,"[UE %d] Frame %d, subframe %d, Mode %s: DCI found %i\n",ue->Mod_id,frame_rx,subframe_rx,mode_string[ue->UE_mode[eNB_id]],dci_cnt);
|
LOG_D(PHY,"[UE %d] AbsSubFrame %d.%d, Mode %s: DCI found %i\n",ue->Mod_id,frame_rx%1024,subframe_rx,mode_string[ue->UE_mode[eNB_id]],dci_cnt);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ue->pdcch_vars[eNB_id]->dci_received += dci_cnt;
|
ue->pdcch_vars[eNB_id]->dci_received += dci_cnt;
|
||||||
|
|
||||||
@@ -2587,7 +2783,7 @@ int ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
// dump_dci(&ue->frame_parms, &dci_alloc_rx[i]);
|
//dump_dci(&ue->frame_parms, &dci_alloc_rx[i]);
|
||||||
if ((ue->UE_mode[eNB_id] > PRACH) &&
|
if ((ue->UE_mode[eNB_id] > PRACH) &&
|
||||||
(generate_ue_dlsch_params_from_dci(frame_rx,
|
(generate_ue_dlsch_params_from_dci(frame_rx,
|
||||||
subframe_rx,
|
subframe_rx,
|
||||||
@@ -2600,7 +2796,17 @@ int ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint
|
|||||||
SI_RNTI,
|
SI_RNTI,
|
||||||
0,
|
0,
|
||||||
P_RNTI,
|
P_RNTI,
|
||||||
ue->transmission_mode[eNB_id]<7?0:ue->transmission_mode[eNB_id])==0)) {
|
ue->transmission_mode[eNB_id]<7?0:ue->transmission_mode[eNB_id],
|
||||||
|
ue->pdcch_vars[eNB_id]->crnti_is_temporary? ue->pdcch_vars[eNB_id]->crnti: 0)==0)) {
|
||||||
|
|
||||||
|
// update TPC for PUCCH
|
||||||
|
if((dci_alloc_rx[i].format == format1) ||
|
||||||
|
(dci_alloc_rx[i].format == format1A) ||
|
||||||
|
(dci_alloc_rx[i].format == format2) ||
|
||||||
|
(dci_alloc_rx[i].format == format2A))
|
||||||
|
{
|
||||||
|
ue->dlsch[eNB_id][0]->g_pucch += ue->dlsch[eNB_id][0]->harq_processes[ue->dlsch[eNB_id][0]->current_harq_pid]->delta_PUCCH;
|
||||||
|
}
|
||||||
|
|
||||||
ue->dlsch_received[eNB_id]++;
|
ue->dlsch_received[eNB_id]++;
|
||||||
|
|
||||||
@@ -2644,7 +2850,8 @@ int ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint
|
|||||||
SI_RNTI,
|
SI_RNTI,
|
||||||
0,
|
0,
|
||||||
P_RNTI,
|
P_RNTI,
|
||||||
ue->transmission_mode[eNB_id]<7?0:ue->transmission_mode[eNB_id])==0) {
|
ue->transmission_mode[eNB_id]<7?0:ue->transmission_mode[eNB_id],
|
||||||
|
0)==0) {
|
||||||
|
|
||||||
ue->dlsch_SI_received[eNB_id]++;
|
ue->dlsch_SI_received[eNB_id]++;
|
||||||
|
|
||||||
@@ -2674,7 +2881,8 @@ int ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint
|
|||||||
SI_RNTI,
|
SI_RNTI,
|
||||||
0,
|
0,
|
||||||
P_RNTI,
|
P_RNTI,
|
||||||
ue->transmission_mode[eNB_id]<7?0:ue->transmission_mode[eNB_id])==0) {
|
ue->transmission_mode[eNB_id]<7?0:ue->transmission_mode[eNB_id],
|
||||||
|
0)==0) {
|
||||||
|
|
||||||
ue->dlsch_p_received[eNB_id]++;
|
ue->dlsch_p_received[eNB_id]++;
|
||||||
|
|
||||||
@@ -2709,7 +2917,8 @@ int ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint
|
|||||||
SI_RNTI,
|
SI_RNTI,
|
||||||
ue->prach_resources[eNB_id]->ra_RNTI,
|
ue->prach_resources[eNB_id]->ra_RNTI,
|
||||||
P_RNTI,
|
P_RNTI,
|
||||||
ue->transmission_mode[eNB_id]<7?0:ue->transmission_mode[eNB_id])==0) {
|
ue->transmission_mode[eNB_id]<7?0:ue->transmission_mode[eNB_id],
|
||||||
|
0)==0) {
|
||||||
|
|
||||||
ue->dlsch_ra_received[eNB_id]++;
|
ue->dlsch_ra_received[eNB_id]++;
|
||||||
|
|
||||||
@@ -2742,6 +2951,20 @@ int ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint
|
|||||||
eNB_id,
|
eNB_id,
|
||||||
0)==0)) {
|
0)==0)) {
|
||||||
|
|
||||||
|
#if T_TRACER
|
||||||
|
LTE_DL_FRAME_PARMS *frame_parms = &ue->frame_parms;
|
||||||
|
uint8_t harq_pid = subframe2harq_pid(frame_parms,
|
||||||
|
pdcch_alloc2ul_frame(frame_parms,proc->frame_rx,proc->subframe_rx),
|
||||||
|
pdcch_alloc2ul_subframe(frame_parms,proc->subframe_rx));
|
||||||
|
|
||||||
|
T(T_UE_PHY_ULSCH_UE_DCI, T_INT(eNB_id), T_INT(proc->frame_rx%1024), T_INT(proc->subframe_rx), T_INT(ue->Mod_id),
|
||||||
|
T_INT(dci_alloc_rx[i].rnti), T_INT(harq_pid),
|
||||||
|
T_INT(ue->ulsch[eNB_id]->harq_processes[harq_pid]->mcs),
|
||||||
|
T_INT(ue->ulsch[eNB_id]->harq_processes[harq_pid]->round),
|
||||||
|
T_INT(ue->ulsch[eNB_id]->harq_processes[harq_pid]->first_rb),
|
||||||
|
T_INT(ue->ulsch[eNB_id]->harq_processes[harq_pid]->nb_rb),
|
||||||
|
T_INT(ue->ulsch[eNB_id]->harq_processes[harq_pid]->TBS));
|
||||||
|
#endif
|
||||||
#ifdef DEBUG_PHY_PROC
|
#ifdef DEBUG_PHY_PROC
|
||||||
LOG_D(PHY,"[UE %d] Generate UE ULSCH C_RNTI format 0 (subframe %d)\n",ue->Mod_id,subframe_rx);
|
LOG_D(PHY,"[UE %d] Generate UE ULSCH C_RNTI format 0 (subframe %d)\n",ue->Mod_id,subframe_rx);
|
||||||
#endif
|
#endif
|
||||||
@@ -2871,6 +3094,7 @@ void ue_pmch_procedures(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc,int eNB_id,int abs
|
|||||||
&ue->frame_parms,
|
&ue->frame_parms,
|
||||||
ue->dlsch_MCH[0],
|
ue->dlsch_MCH[0],
|
||||||
ue->dlsch_MCH[0]->harq_processes[0],
|
ue->dlsch_MCH[0]->harq_processes[0],
|
||||||
|
frame_rx,
|
||||||
subframe_rx,
|
subframe_rx,
|
||||||
0,
|
0,
|
||||||
0,1);
|
0,1);
|
||||||
@@ -2895,7 +3119,8 @@ void ue_pmch_procedures(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc,int eNB_id,int abs
|
|||||||
ue->dlsch_mtch_errors[sync_area][0]++;
|
ue->dlsch_mtch_errors[sync_area][0]++;
|
||||||
|
|
||||||
LOG_D(PHY,"[UE %d] Frame %d, subframe %d: PMCH in error (%d,%d), not passing to L2 (TBS %d, iter %d,G %d)\n",
|
LOG_D(PHY,"[UE %d] Frame %d, subframe %d: PMCH in error (%d,%d), not passing to L2 (TBS %d, iter %d,G %d)\n",
|
||||||
frame_rx,subframe_rx,
|
ue->Mod_id,
|
||||||
|
frame_rx,subframe_rx,
|
||||||
ue->dlsch_mcch_errors[sync_area][0],
|
ue->dlsch_mcch_errors[sync_area][0],
|
||||||
ue->dlsch_mtch_errors[sync_area][0],
|
ue->dlsch_mtch_errors[sync_area][0],
|
||||||
ue->dlsch_MCH[0]->harq_processes[0]->TBS>>3,
|
ue->dlsch_MCH[0]->harq_processes[0]->TBS>>3,
|
||||||
@@ -2957,7 +3182,7 @@ void ue_pdsch_procedures(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc, int eNB_id, PDSC
|
|||||||
|
|
||||||
if (dlsch0 && (!dlsch1)) {
|
if (dlsch0 && (!dlsch1)) {
|
||||||
harq_pid = dlsch0->current_harq_pid;
|
harq_pid = dlsch0->current_harq_pid;
|
||||||
LOG_D(PHY,"[UE %d] PDSCH active in subframe %d (%d), harq_pid %d\n",ue->Mod_id,subframe_rx,harq_pid);
|
LOG_D(PHY,"[UE %d] PDSCH active in subframe %d, harq_pid %d\n",ue->Mod_id,subframe_rx,harq_pid);
|
||||||
|
|
||||||
if ((pdsch==PDSCH) &&
|
if ((pdsch==PDSCH) &&
|
||||||
(ue->transmission_mode[eNB_id] == 5) &&
|
(ue->transmission_mode[eNB_id] == 5) &&
|
||||||
@@ -2994,6 +3219,7 @@ void ue_pdsch_procedures(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc, int eNB_id, PDSC
|
|||||||
pdsch,
|
pdsch,
|
||||||
eNB_id,
|
eNB_id,
|
||||||
eNB_id_i,
|
eNB_id_i,
|
||||||
|
proc->frame_rx,
|
||||||
subframe_rx, // subframe,
|
subframe_rx, // subframe,
|
||||||
m,
|
m,
|
||||||
first_symbol_flag,
|
first_symbol_flag,
|
||||||
@@ -3046,6 +3272,9 @@ void process_rar(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc, int eNB_id, runmode_t mo
|
|||||||
ue->pdcch_vars[eNB_id]->crnti,
|
ue->pdcch_vars[eNB_id]->crnti,
|
||||||
timing_advance);
|
timing_advance);
|
||||||
|
|
||||||
|
// remember this c-rnti is still a tc-rnti
|
||||||
|
ue->pdcch_vars[eNB_id]->crnti_is_temporary = 1;
|
||||||
|
|
||||||
//timing_advance = 0;
|
//timing_advance = 0;
|
||||||
process_timing_advance_rar(ue,proc,timing_advance);
|
process_timing_advance_rar(ue,proc,timing_advance);
|
||||||
|
|
||||||
@@ -3117,7 +3346,7 @@ void ue_dlsch_procedures(PHY_VARS_UE *ue,
|
|||||||
pdsch_vars = ue->pdsch_vars_p[eNB_id];
|
pdsch_vars = ue->pdsch_vars_p[eNB_id];
|
||||||
break;
|
break;
|
||||||
case PDSCH:
|
case PDSCH:
|
||||||
pdsch_vars = ue->pdsch_vars[eNB_id];
|
pdsch_vars = ue->pdsch_vars[subframe_rx&0x1][eNB_id];
|
||||||
break;
|
break;
|
||||||
case PMCH:
|
case PMCH:
|
||||||
case PDSCH1:
|
case PDSCH1:
|
||||||
@@ -3174,6 +3403,7 @@ void ue_dlsch_procedures(PHY_VARS_UE *ue,
|
|||||||
&ue->frame_parms,
|
&ue->frame_parms,
|
||||||
dlsch0,
|
dlsch0,
|
||||||
dlsch0->harq_processes[harq_pid],
|
dlsch0->harq_processes[harq_pid],
|
||||||
|
frame_rx,
|
||||||
subframe_rx,
|
subframe_rx,
|
||||||
harq_pid,
|
harq_pid,
|
||||||
pdsch==PDSCH?1:0,
|
pdsch==PDSCH?1:0,
|
||||||
@@ -3233,6 +3463,7 @@ void ue_dlsch_procedures(PHY_VARS_UE *ue,
|
|||||||
mac_xface->ue_send_sdu(ue->Mod_id,
|
mac_xface->ue_send_sdu(ue->Mod_id,
|
||||||
CC_id,
|
CC_id,
|
||||||
frame_rx,
|
frame_rx,
|
||||||
|
subframe_rx,
|
||||||
dlsch0->harq_processes[dlsch0->current_harq_pid]->b,
|
dlsch0->harq_processes[dlsch0->current_harq_pid]->b,
|
||||||
dlsch0->harq_processes[dlsch0->current_harq_pid]->TBS>>3,
|
dlsch0->harq_processes[dlsch0->current_harq_pid]->TBS>>3,
|
||||||
eNB_id);
|
eNB_id);
|
||||||
@@ -3308,10 +3539,17 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin
|
|||||||
int frame_rx = proc->frame_rx;
|
int frame_rx = proc->frame_rx;
|
||||||
int subframe_rx = proc->subframe_rx;
|
int subframe_rx = proc->subframe_rx;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_RX, VCD_FUNCTION_IN);
|
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_RX, VCD_FUNCTION_IN);
|
||||||
|
|
||||||
|
#if T_TRACER
|
||||||
|
T(T_UE_PHY_DL_TICK, T_INT(ue->Mod_id), T_INT(frame_rx%1024), T_INT(subframe_rx));
|
||||||
|
#endif
|
||||||
|
|
||||||
|
T(T_UE_PHY_INPUT_SIGNAL, T_INT(ue->Mod_id), T_INT(frame_rx%1024), T_INT(subframe_rx), T_INT(0),
|
||||||
|
T_BUFFER(&ue->common_vars.rxdata[0][subframe_rx*ue->frame_parms.samples_per_tti],
|
||||||
|
ue->frame_parms.samples_per_tti * 4));
|
||||||
|
|
||||||
start_meas(&ue->phy_proc_rx);
|
start_meas(&ue->phy_proc_rx);
|
||||||
|
|
||||||
@@ -3333,7 +3571,7 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin
|
|||||||
|
|
||||||
|
|
||||||
#ifdef DEBUG_PHY_PROC
|
#ifdef DEBUG_PHY_PROC
|
||||||
LOG_D(PHY,"[%s %d] Frame %d subframe %d: Doing phy_procedures_UE_RX (%d)\n",
|
LOG_D(PHY,"[%s %d] Frame %d subframe %d: Doing phy_procedures_UE_RX\n",
|
||||||
(r_type == multicast_relay) ? "RN/UE" : "UE",
|
(r_type == multicast_relay) ? "RN/UE" : "UE",
|
||||||
ue->Mod_id,frame_rx, subframe_rx);
|
ue->Mod_id,frame_rx, subframe_rx);
|
||||||
#endif
|
#endif
|
||||||
@@ -3372,14 +3610,14 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin
|
|||||||
slot_fep(ue,
|
slot_fep(ue,
|
||||||
l,
|
l,
|
||||||
(subframe_rx<<1),
|
(subframe_rx<<1),
|
||||||
ue->rx_offset,
|
0,
|
||||||
0,
|
0,
|
||||||
0);
|
0);
|
||||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP, VCD_FUNCTION_OUT);
|
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP, VCD_FUNCTION_OUT);
|
||||||
stop_meas(&ue->ofdm_demod_stats);
|
stop_meas(&ue->ofdm_demod_stats);
|
||||||
}
|
}
|
||||||
|
|
||||||
ue_measurement_procedures(l-1,ue,proc,eNB_id,abstraction_flag,mode);
|
ue_measurement_procedures(l-1,ue,proc,eNB_id,(subframe_rx<<1),abstraction_flag,mode);
|
||||||
if ((l==pilot1) ||
|
if ((l==pilot1) ||
|
||||||
((pmch_flag==1)&(l==l2))) {
|
((pmch_flag==1)&(l==l2))) {
|
||||||
LOG_D(PHY,"[UE %d] Frame %d: Calling pdcch procedures (eNB %d)\n",ue->Mod_id,frame_rx,eNB_id);
|
LOG_D(PHY,"[UE %d] Frame %d: Calling pdcch procedures (eNB %d)\n",ue->Mod_id,frame_rx,eNB_id);
|
||||||
@@ -3392,7 +3630,7 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // for l=1..l2
|
} // for l=1..l2
|
||||||
ue_measurement_procedures(l-1,ue,proc,eNB_id,abstraction_flag,mode);
|
ue_measurement_procedures(l-1,ue,proc,eNB_id,(subframe_rx<<1),abstraction_flag,mode);
|
||||||
|
|
||||||
// If this is PMCH, call procedures and return
|
// If this is PMCH, call procedures and return
|
||||||
if (pmch_flag == 1) {
|
if (pmch_flag == 1) {
|
||||||
@@ -3403,7 +3641,7 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin
|
|||||||
slot_fep(ue,
|
slot_fep(ue,
|
||||||
0,
|
0,
|
||||||
1+(subframe_rx<<1),
|
1+(subframe_rx<<1),
|
||||||
ue->rx_offset,
|
0,
|
||||||
0,
|
0,
|
||||||
0);
|
0);
|
||||||
|
|
||||||
@@ -3476,14 +3714,14 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin
|
|||||||
slot_fep(ue,
|
slot_fep(ue,
|
||||||
l,
|
l,
|
||||||
1+(subframe_rx<<1),
|
1+(subframe_rx<<1),
|
||||||
ue->rx_offset,
|
0,
|
||||||
0,
|
0,
|
||||||
0);
|
0);
|
||||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP, VCD_FUNCTION_OUT);
|
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP, VCD_FUNCTION_OUT);
|
||||||
stop_meas(&ue->ofdm_demod_stats);
|
stop_meas(&ue->ofdm_demod_stats);
|
||||||
}
|
}
|
||||||
|
|
||||||
ue_measurement_procedures(l-1,ue,proc,eNB_id,abstraction_flag,mode);
|
ue_measurement_procedures(l-1,ue,proc,eNB_id,1+(subframe_rx<<1),abstraction_flag,mode);
|
||||||
|
|
||||||
} // for l=1..l2
|
} // for l=1..l2
|
||||||
|
|
||||||
@@ -3494,7 +3732,7 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin
|
|||||||
slot_fep(ue,
|
slot_fep(ue,
|
||||||
0,
|
0,
|
||||||
(next_subframe_rx<<1),
|
(next_subframe_rx<<1),
|
||||||
ue->rx_offset,
|
0,
|
||||||
0,
|
0,
|
||||||
0);
|
0);
|
||||||
}
|
}
|
||||||
@@ -3528,10 +3766,6 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin
|
|||||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC, VCD_FUNCTION_OUT);
|
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC, VCD_FUNCTION_OUT);
|
||||||
|
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
// printf("PDSCH inactive in subframe %d\n",subframe_rx-1);
|
|
||||||
ue->dlsch[eNB_id][0]->harq_ack[subframe_rx].send_harq_status = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// do procedures for SI-RNTI
|
// do procedures for SI-RNTI
|
||||||
if ((ue->dlsch_SI[eNB_id]) && (ue->dlsch_SI[eNB_id]->active == 1)) {
|
if ((ue->dlsch_SI[eNB_id]) && (ue->dlsch_SI[eNB_id]->active == 1)) {
|
||||||
|
|||||||
@@ -34,10 +34,10 @@
|
|||||||
#include "PHY/LTE_TRANSPORT/proto.h"
|
#include "PHY/LTE_TRANSPORT/proto.h"
|
||||||
#include "PHY/extern.h"
|
#include "PHY/extern.h"
|
||||||
|
|
||||||
int8_t pucch_power_cntl(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t subframe,uint8_t eNB_id,PUCCH_FMT_t pucch_fmt)
|
int16_t pucch_power_cntl(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t subframe,uint8_t eNB_id,PUCCH_FMT_t pucch_fmt)
|
||||||
{
|
{
|
||||||
|
|
||||||
int8_t Po_PUCCH;
|
int16_t Po_PUCCH;
|
||||||
//uint8_t harq_pid;
|
//uint8_t harq_pid;
|
||||||
|
|
||||||
// P_pucch = P_opucch+ PL + h(nCQI,nHARQ) + delta_pucchF(pucch_fmt) + g(i))
|
// P_pucch = P_opucch+ PL + h(nCQI,nHARQ) + delta_pucchF(pucch_fmt) + g(i))
|
||||||
|
|||||||
@@ -103,13 +103,13 @@ int16_t get_hundred_times_delta_IF_mac(module_id_t module_idP, uint8_t CC_id, rn
|
|||||||
int16_t get_hundred_times_delta_IF(PHY_VARS_UE *ue,uint8_t eNB_id,uint8_t harq_pid)
|
int16_t get_hundred_times_delta_IF(PHY_VARS_UE *ue,uint8_t eNB_id,uint8_t harq_pid)
|
||||||
{
|
{
|
||||||
|
|
||||||
uint32_t Nre = ue->ulsch[eNB_id]->harq_processes[harq_pid]->Nsymb_initial *
|
uint32_t Nre = 2*ue->ulsch[eNB_id]->harq_processes[harq_pid]->Nsymb_initial *
|
||||||
ue->ulsch[eNB_id]->harq_processes[harq_pid]->nb_rb*12;
|
ue->ulsch[eNB_id]->harq_processes[harq_pid]->nb_rb*12;
|
||||||
|
|
||||||
if (Nre==0)
|
if (Nre==0)
|
||||||
return(0);
|
return(0);
|
||||||
|
|
||||||
uint32_t MPR_x100 = 100*ue->ulsch[eNB_id]->harq_processes[harq_pid]->sumKr/Nre;
|
uint32_t MPR_x100 = 100*ue->ulsch[eNB_id]->harq_processes[harq_pid]->TBS/Nre;
|
||||||
// Note: MPR=is the effective spectral efficiency of the PUSCH
|
// Note: MPR=is the effective spectral efficiency of the PUSCH
|
||||||
// FK 20140908 sumKr is only set after the ulsch_encoding
|
// FK 20140908 sumKr is only set after the ulsch_encoding
|
||||||
|
|
||||||
@@ -137,7 +137,7 @@ void pusch_power_cntl(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uint8_
|
|||||||
proc->subframe_tx);
|
proc->subframe_tx);
|
||||||
|
|
||||||
uint8_t nb_rb = ue->ulsch[eNB_id]->harq_processes[harq_pid]->nb_rb;
|
uint8_t nb_rb = ue->ulsch[eNB_id]->harq_processes[harq_pid]->nb_rb;
|
||||||
int8_t PL;
|
int16_t PL;
|
||||||
|
|
||||||
|
|
||||||
// P_pusch = 10*log10(nb_rb + P_opusch(j)+ alpha(u)*PL + delta_TF(i) + f(i))
|
// P_pusch = 10*log10(nb_rb + P_opusch(j)+ alpha(u)*PL + delta_TF(i) + f(i))
|
||||||
@@ -174,8 +174,8 @@ void pusch_power_cntl(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uint8_
|
|||||||
else if (ue->ulsch[eNB_id]->PHR > 40)
|
else if (ue->ulsch[eNB_id]->PHR > 40)
|
||||||
ue->ulsch[eNB_id]->PHR = 40;
|
ue->ulsch[eNB_id]->PHR = 40;
|
||||||
|
|
||||||
LOG_D(PHY,"[UE %d][PUSCH %d] frame %d, subframe %d: Po_PUSCH %d dBm : tx power %d, Po_NOMINAL_PUSCH %d,log10(NPRB) %f,PHR %d, PL %d, alpha*PL %f,delta_IF %f,f_pusch %d\n",
|
LOG_D(PHY,"[UE %d][PUSCH %d] AbsSubframe %d.%d: nb_rb: %d, Po_PUSCH %d dBm : tx power %d, Po_NOMINAL_PUSCH %d,log10(NPRB) %f,PHR %d, PL %d, alpha*PL %f,delta_IF %f,f_pusch %d\n",
|
||||||
ue->Mod_id,harq_pid,proc->frame_tx,proc->subframe_tx,
|
ue->Mod_id,harq_pid,proc->frame_tx,proc->subframe_tx,nb_rb,
|
||||||
ue->ulsch[eNB_id]->Po_PUSCH,
|
ue->ulsch[eNB_id]->Po_PUSCH,
|
||||||
ue->tx_power_max_dBm,
|
ue->tx_power_max_dBm,
|
||||||
ue->frame_parms.ul_power_control_config_common.p0_NominalPUSCH,
|
ue->frame_parms.ul_power_control_config_common.p0_NominalPUSCH,
|
||||||
|
|||||||
@@ -1812,6 +1812,11 @@ int main(int argc, char **argv)
|
|||||||
eNB->common_vars.beam_weights[0][0][aa][re] = 0x00007fff/eNB->frame_parms.nb_antennas_tx;
|
eNB->common_vars.beam_weights[0][0][aa][re] = 0x00007fff/eNB->frame_parms.nb_antennas_tx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (transmission_mode<7)
|
||||||
|
eNB->do_precoding=0;
|
||||||
|
else
|
||||||
|
eNB->do_precoding=1;
|
||||||
|
|
||||||
eNB->mac_enabled=1;
|
eNB->mac_enabled=1;
|
||||||
if (two_thread_flag == 0) {
|
if (two_thread_flag == 0) {
|
||||||
eNB->te = dlsch_encoding;
|
eNB->te = dlsch_encoding;
|
||||||
@@ -2409,12 +2414,14 @@ int main(int argc, char **argv)
|
|||||||
do_OFDM_mod_symbol(&eNB->common_vars,
|
do_OFDM_mod_symbol(&eNB->common_vars,
|
||||||
eNB_id,
|
eNB_id,
|
||||||
(subframe*2),
|
(subframe*2),
|
||||||
&eNB->frame_parms);
|
&eNB->frame_parms,
|
||||||
|
eNB->do_precoding);
|
||||||
|
|
||||||
do_OFDM_mod_symbol(&eNB->common_vars,
|
do_OFDM_mod_symbol(&eNB->common_vars,
|
||||||
eNB_id,
|
eNB_id,
|
||||||
(subframe*2)+1,
|
(subframe*2)+1,
|
||||||
&eNB->frame_parms);
|
&eNB->frame_parms,
|
||||||
|
eNB->do_precoding);
|
||||||
|
|
||||||
|
|
||||||
stop_meas(&eNB->ofdm_mod_stats);
|
stop_meas(&eNB->ofdm_mod_stats);
|
||||||
@@ -2502,34 +2509,34 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
//common vars
|
//common vars
|
||||||
write_output("rxsig0.m","rxs0", &UE->common_vars.rxdata[0][0],10*UE->frame_parms.samples_per_tti,1,1);
|
write_output("rxsig0.m","rxs0", &UE->common_vars.rxdata[0][0],10*UE->frame_parms.samples_per_tti,1,1);
|
||||||
write_output("rxsigF0.m","rxsF0", &UE->common_vars.rxdataF[0][0],UE->frame_parms.ofdm_symbol_size*nsymb,1,1);
|
write_output("rxsigF0.m","rxsF0", &UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF[0][0],UE->frame_parms.ofdm_symbol_size*nsymb,1,1);
|
||||||
|
|
||||||
if (UE->frame_parms.nb_antennas_rx>1) {
|
if (UE->frame_parms.nb_antennas_rx>1) {
|
||||||
write_output("rxsig1.m","rxs1", UE->common_vars.rxdata[1],UE->frame_parms.samples_per_tti,1,1);
|
write_output("rxsig1.m","rxs1", UE->common_vars.rxdata[1],UE->frame_parms.samples_per_tti,1,1);
|
||||||
write_output("rxsigF1.m","rxsF1", UE->common_vars.rxdataF[1],UE->frame_parms.ofdm_symbol_size*nsymb,1,1);
|
write_output("rxsigF1.m","rxsF1", UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF[1],UE->frame_parms.ofdm_symbol_size*nsymb,1,1);
|
||||||
}
|
}
|
||||||
|
|
||||||
write_output("dlsch00_r0.m","dl00_r0",
|
write_output("dlsch00_r0.m","dl00_r0",
|
||||||
&(UE->common_vars.dl_ch_estimates[eNB_id][0][0]),
|
&(UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][0][0]),
|
||||||
UE->frame_parms.ofdm_symbol_size*nsymb,1,1);
|
UE->frame_parms.ofdm_symbol_size*nsymb,1,1);
|
||||||
|
|
||||||
if (UE->frame_parms.nb_antennas_rx>1)
|
if (UE->frame_parms.nb_antennas_rx>1)
|
||||||
write_output("dlsch01_r0.m","dl01_r0",
|
write_output("dlsch01_r0.m","dl01_r0",
|
||||||
&(UE->common_vars.dl_ch_estimates[eNB_id][1][0]),
|
&(UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][1][0]),
|
||||||
UE->frame_parms.ofdm_symbol_size*nsymb,1,1);
|
UE->frame_parms.ofdm_symbol_size*nsymb,1,1);
|
||||||
|
|
||||||
if (eNB->frame_parms.nb_antennas_tx>1)
|
if (eNB->frame_parms.nb_antennas_tx>1)
|
||||||
write_output("dlsch10_r0.m","dl10_r0",
|
write_output("dlsch10_r0.m","dl10_r0",
|
||||||
&(UE->common_vars.dl_ch_estimates[eNB_id][2][0]),
|
&(UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][2][0]),
|
||||||
UE->frame_parms.ofdm_symbol_size*nsymb,1,1);
|
UE->frame_parms.ofdm_symbol_size*nsymb,1,1);
|
||||||
|
|
||||||
if ((UE->frame_parms.nb_antennas_rx>1) && (eNB->frame_parms.nb_antennas_tx>1))
|
if ((UE->frame_parms.nb_antennas_rx>1) && (eNB->frame_parms.nb_antennas_tx>1))
|
||||||
write_output("dlsch11_r0.m","dl11_r0",
|
write_output("dlsch11_r0.m","dl11_r0",
|
||||||
&(UE->common_vars.dl_ch_estimates[eNB_id][3][0]),
|
&(UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][3][0]),
|
||||||
UE->frame_parms.ofdm_symbol_size*nsymb/2,1,1);
|
UE->frame_parms.ofdm_symbol_size*nsymb/2,1,1);
|
||||||
|
|
||||||
//pdsch_vars
|
//pdsch_vars
|
||||||
dump_dlsch2(UE,eNB_id,coded_bits_per_codeword,round);
|
dump_dlsch2(UE,eNB_id,subframe,coded_bits_per_codeword,round);
|
||||||
//dump_dlsch2(UE,eNB_id_i,coded_bits_per_codeword);
|
//dump_dlsch2(UE,eNB_id_i,coded_bits_per_codeword);
|
||||||
write_output("dlsch_e.m","e",eNB->dlsch[0][0]->harq_processes[0]->e,coded_bits_per_codeword,1,4);
|
write_output("dlsch_e.m","e",eNB->dlsch[0][0]->harq_processes[0]->e,coded_bits_per_codeword,1,4);
|
||||||
|
|
||||||
@@ -2587,7 +2594,7 @@ int main(int argc, char **argv)
|
|||||||
write_output(fname,vname, &UE->common_vars.rxdata[0][0],10*UE->frame_parms.samples_per_tti,1,1);
|
write_output(fname,vname, &UE->common_vars.rxdata[0][0],10*UE->frame_parms.samples_per_tti,1,1);
|
||||||
sprintf(fname,"rxsigF0_r%d.m",round);
|
sprintf(fname,"rxsigF0_r%d.m",round);
|
||||||
sprintf(vname,"rxs0F_r%d",round);
|
sprintf(vname,"rxs0F_r%d",round);
|
||||||
write_output(fname,vname, &UE->common_vars.rxdataF[0][0],UE->frame_parms.ofdm_symbol_size*nsymb,1,1);
|
write_output(fname,vname, &UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF[0][0],UE->frame_parms.ofdm_symbol_size*nsymb,1,1);
|
||||||
|
|
||||||
if (UE->frame_parms.nb_antennas_rx>1) {
|
if (UE->frame_parms.nb_antennas_rx>1) {
|
||||||
sprintf(fname,"rxsig1_r%d.m",round);
|
sprintf(fname,"rxsig1_r%d.m",round);
|
||||||
@@ -2595,20 +2602,20 @@ int main(int argc, char **argv)
|
|||||||
write_output(fname,vname, UE->common_vars.rxdata[1],UE->frame_parms.samples_per_tti,1,1);
|
write_output(fname,vname, UE->common_vars.rxdata[1],UE->frame_parms.samples_per_tti,1,1);
|
||||||
sprintf(fname,"rxsigF1_r%d.m",round);
|
sprintf(fname,"rxsigF1_r%d.m",round);
|
||||||
sprintf(vname,"rxs1F_r%d.m",round);
|
sprintf(vname,"rxs1F_r%d.m",round);
|
||||||
write_output(fname,vname, UE->common_vars.rxdataF[1],UE->frame_parms.ofdm_symbol_size*nsymb,1,1);
|
write_output(fname,vname, UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF[1],UE->frame_parms.ofdm_symbol_size*nsymb,1,1);
|
||||||
}
|
}
|
||||||
|
|
||||||
sprintf(fname,"dlsch00_r%d.m",round);
|
sprintf(fname,"dlsch00_r%d.m",round);
|
||||||
sprintf(vname,"dl00_r%d",round);
|
sprintf(vname,"dl00_r%d",round);
|
||||||
write_output(fname,vname,
|
write_output(fname,vname,
|
||||||
&(UE->common_vars.dl_ch_estimates[eNB_id][0][0]),
|
&(UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][0][0]),
|
||||||
UE->frame_parms.ofdm_symbol_size*nsymb,1,1);
|
UE->frame_parms.ofdm_symbol_size*nsymb,1,1);
|
||||||
|
|
||||||
if (UE->frame_parms.nb_antennas_rx>1) {
|
if (UE->frame_parms.nb_antennas_rx>1) {
|
||||||
sprintf(fname,"dlsch01_r%d.m",round);
|
sprintf(fname,"dlsch01_r%d.m",round);
|
||||||
sprintf(vname,"dl01_r%d",round);
|
sprintf(vname,"dl01_r%d",round);
|
||||||
write_output(fname,vname,
|
write_output(fname,vname,
|
||||||
&(UE->common_vars.dl_ch_estimates[eNB_id][1][0]),
|
&(UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][1][0]),
|
||||||
UE->frame_parms.ofdm_symbol_size*nsymb/2,1,1);
|
UE->frame_parms.ofdm_symbol_size*nsymb/2,1,1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2616,7 +2623,7 @@ int main(int argc, char **argv)
|
|||||||
sprintf(fname,"dlsch10_r%d.m",round);
|
sprintf(fname,"dlsch10_r%d.m",round);
|
||||||
sprintf(vname,"dl10_r%d",round);
|
sprintf(vname,"dl10_r%d",round);
|
||||||
write_output(fname,vname,
|
write_output(fname,vname,
|
||||||
&(UE->common_vars.dl_ch_estimates[eNB_id][2][0]),
|
&(UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][2][0]),
|
||||||
UE->frame_parms.ofdm_symbol_size*nsymb/2,1,1);
|
UE->frame_parms.ofdm_symbol_size*nsymb/2,1,1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2624,12 +2631,12 @@ int main(int argc, char **argv)
|
|||||||
sprintf(fname,"dlsch11_r%d.m",round);
|
sprintf(fname,"dlsch11_r%d.m",round);
|
||||||
sprintf(vname,"dl11_r%d",round);
|
sprintf(vname,"dl11_r%d",round);
|
||||||
write_output(fname,vname,
|
write_output(fname,vname,
|
||||||
&(UE->common_vars.dl_ch_estimates[eNB_id][3][0]),
|
&(UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][3][0]),
|
||||||
UE->frame_parms.ofdm_symbol_size*nsymb/2,1,1);
|
UE->frame_parms.ofdm_symbol_size*nsymb/2,1,1);
|
||||||
}
|
}
|
||||||
|
|
||||||
//pdsch_vars
|
//pdsch_vars
|
||||||
dump_dlsch2(UE,eNB_id,coded_bits_per_codeword,round);
|
dump_dlsch2(UE,eNB_id,subframe,coded_bits_per_codeword,round);
|
||||||
|
|
||||||
//write_output("dlsch_e.m","e",eNB->dlsch[0][0]->harq_processes[0]->e,coded_bits_per_codeword,1,4);
|
//write_output("dlsch_e.m","e",eNB->dlsch[0][0]->harq_processes[0]->e,coded_bits_per_codeword,1,4);
|
||||||
//write_output("dlsch_ber_bit.m","ber_bit",uncoded_ber_bit,coded_bits_per_codeword,1,0);
|
//write_output("dlsch_ber_bit.m","ber_bit",uncoded_ber_bit,coded_bits_per_codeword,1,0);
|
||||||
|
|||||||
@@ -3104,24 +3104,24 @@ PMI_FEEDBACK:
|
|||||||
for(aa=0; aa<frame_parms->nb_antenna_ports_eNB; aa++) {
|
for(aa=0; aa<frame_parms->nb_antenna_ports_eNB; aa++) {
|
||||||
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
|
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
|
||||||
for (i=0; i<frame_parms->N_RB_DL*12; i++) {
|
for (i=0; i<frame_parms->N_RB_DL*12; i++) {
|
||||||
((int16_t *) UE->common_vars.dl_ch_estimates[k][(aa<<1)+aarx])[2*i+((l+(Ns%2)*pilot2)*frame_parms->ofdm_symbol_size+LTE_CE_FILTER_LENGTH)*2]=(int16_t)(
|
((int16_t *) UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[k][(aa<<1)+aarx])[2*i+((l+(Ns%2)*pilot2)*frame_parms->ofdm_symbol_size+LTE_CE_FILTER_LENGTH)*2]=(int16_t)(
|
||||||
eNB2UE[round]->chF[aarx+(aa*frame_parms->nb_antennas_rx)][i].x*AMP);
|
eNB2UE[round]->chF[aarx+(aa*frame_parms->nb_antennas_rx)][i].x*AMP);
|
||||||
//printf("x=%d,AMP=%d\n",eNB2UE[round]->chF[aarx+(aa*frame_parms->nb_antennas_rx)][i].x,AMP);
|
//printf("x=%d,AMP=%d\n",eNB2UE[round]->chF[aarx+(aa*frame_parms->nb_antennas_rx)][i].x,AMP);
|
||||||
((int16_t *) UE->common_vars.dl_ch_estimates[k][(aa<<1)+aarx])[2*i+1+((l+(Ns%2)*pilot2)*frame_parms->ofdm_symbol_size+LTE_CE_FILTER_LENGTH)*2]=(int16_t)(
|
((int16_t *) UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[k][(aa<<1)+aarx])[2*i+1+((l+(Ns%2)*pilot2)*frame_parms->ofdm_symbol_size+LTE_CE_FILTER_LENGTH)*2]=(int16_t)(
|
||||||
eNB2UE[round]->chF[aarx+(aa*frame_parms->nb_antennas_rx)][i].y*AMP);
|
eNB2UE[round]->chF[aarx+(aa*frame_parms->nb_antennas_rx)][i].y*AMP);
|
||||||
|
|
||||||
if (transmission_mode == 7){
|
if (transmission_mode == 7){
|
||||||
//this should include the BF weights! Will not work for a random channel
|
//this should include the BF weights! Will not work for a random channel
|
||||||
if (UE->high_speed_flag==0) {
|
if (UE->high_speed_flag==0) {
|
||||||
((int16_t *)UE->pdsch_vars[0]->dl_bf_ch_estimates[(aa<<1)+aarx])[2*i]=(int16_t)(
|
((int16_t *)UE->pdsch_vars[subframe&0x1][0]->dl_bf_ch_estimates[(aa<<1)+aarx])[2*i]=(int16_t)(
|
||||||
eNB2UE[round]->chF[aarx+(aa*frame_parms->nb_antennas_rx)][i].x*AMP);
|
eNB2UE[round]->chF[aarx+(aa*frame_parms->nb_antennas_rx)][i].x*AMP);
|
||||||
((int16_t *)UE->pdsch_vars[0]->dl_bf_ch_estimates[(aa<<1)+aarx])[2*i+1]=(int16_t)(
|
((int16_t *)UE->pdsch_vars[subframe&0x1][0]->dl_bf_ch_estimates[(aa<<1)+aarx])[2*i+1]=(int16_t)(
|
||||||
eNB2UE[round]->chF[aarx+(aa*frame_parms->nb_antennas_rx)][i].y*AMP);
|
eNB2UE[round]->chF[aarx+(aa*frame_parms->nb_antennas_rx)][i].y*AMP);
|
||||||
//printf("**,x=%d,AMP=%d\n",eNB2UE[round]->chF[aarx+(aa*frame_parms->nb_antennas_rx)][i].x,AMP);
|
//printf("**,x=%d,AMP=%d\n",eNB2UE[round]->chF[aarx+(aa*frame_parms->nb_antennas_rx)][i].x,AMP);
|
||||||
} else {
|
} else {
|
||||||
((int16_t *)UE->pdsch_vars[0]->dl_bf_ch_estimates[(aa<<1)+aarx])[2*i+((l+(Ns%2)*pilot2)*frame_parms->ofdm_symbol_size)*2]=(int16_t)(
|
((int16_t *)UE->pdsch_vars[subframe&0x1][0]->dl_bf_ch_estimates[(aa<<1)+aarx])[2*i+((l+(Ns%2)*pilot2)*frame_parms->ofdm_symbol_size)*2]=(int16_t)(
|
||||||
eNB2UE[round]->chF[aarx+(aa*frame_parms->nb_antennas_rx)][i].x*AMP);
|
eNB2UE[round]->chF[aarx+(aa*frame_parms->nb_antennas_rx)][i].x*AMP);
|
||||||
((int16_t *)UE->pdsch_vars[0]->dl_bf_ch_estimates[(aa<<1)+aarx])[2*i+1+((l+(Ns%2)*pilot2)*frame_parms->ofdm_symbol_size)*2]=(int16_t)(
|
((int16_t *)UE->pdsch_vars[subframe&0x1][0]->dl_bf_ch_estimates[(aa<<1)+aarx])[2*i+1+((l+(Ns%2)*pilot2)*frame_parms->ofdm_symbol_size)*2]=(int16_t)(
|
||||||
eNB2UE[round]->chF[aarx+(aa*frame_parms->nb_antennas_rx)][i].y*AMP);
|
eNB2UE[round]->chF[aarx+(aa*frame_parms->nb_antennas_rx)][i].y*AMP);
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -3134,15 +3134,15 @@ PMI_FEEDBACK:
|
|||||||
for(aa=0; aa<frame_parms->nb_antenna_ports_eNB; aa++) {
|
for(aa=0; aa<frame_parms->nb_antenna_ports_eNB; aa++) {
|
||||||
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
|
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
|
||||||
for (i=0; i<frame_parms->N_RB_DL*12; i++) {
|
for (i=0; i<frame_parms->N_RB_DL*12; i++) {
|
||||||
((int16_t *) UE->common_vars.dl_ch_estimates[0][(aa<<1)+aarx])[2*i+((l+(Ns%2)*pilot2)*frame_parms->ofdm_symbol_size+LTE_CE_FILTER_LENGTH)*2]=(short)(AMP);
|
((int16_t *) UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[0][(aa<<1)+aarx])[2*i+((l+(Ns%2)*pilot2)*frame_parms->ofdm_symbol_size+LTE_CE_FILTER_LENGTH)*2]=(short)(AMP);
|
||||||
((int16_t *) UE->common_vars.dl_ch_estimates[0][(aa<<1)+aarx])[2*i+1+((l+(Ns%2)*pilot2)*frame_parms->ofdm_symbol_size+LTE_CE_FILTER_LENGTH)*2]=0/2;
|
((int16_t *) UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[0][(aa<<1)+aarx])[2*i+1+((l+(Ns%2)*pilot2)*frame_parms->ofdm_symbol_size+LTE_CE_FILTER_LENGTH)*2]=0/2;
|
||||||
if (transmission_mode == 7) {
|
if (transmission_mode == 7) {
|
||||||
if (UE->high_speed_flag==0){
|
if (UE->high_speed_flag==0){
|
||||||
((int16_t *) UE->pdsch_vars[0]->dl_bf_ch_estimates[(aa<<1)+aarx])[2*i]=(short)(AMP);
|
((int16_t *) UE->pdsch_vars[subframe&0x1][0]->dl_bf_ch_estimates[(aa<<1)+aarx])[2*i]=(short)(AMP);
|
||||||
((int16_t *) UE->pdsch_vars[0]->dl_bf_ch_estimates[(aa<<1)+aarx])[2*i+1]=0/2;
|
((int16_t *) UE->pdsch_vars[subframe&0x1][0]->dl_bf_ch_estimates[(aa<<1)+aarx])[2*i+1]=0/2;
|
||||||
} else {
|
} else {
|
||||||
((int16_t *) UE->pdsch_vars[0]->dl_bf_ch_estimates[(aa<<1)+aarx])[2*i+((l+(Ns%2)*pilot2)*frame_parms->ofdm_symbol_size)*2]=(short)(AMP);
|
((int16_t *) UE->pdsch_vars[subframe&0x1][0]->dl_bf_ch_estimates[(aa<<1)+aarx])[2*i+((l+(Ns%2)*pilot2)*frame_parms->ofdm_symbol_size)*2]=(short)(AMP);
|
||||||
((int16_t *) UE->pdsch_vars[0]->dl_bf_ch_estimates[(aa<<1)+aarx])[2*i+1+((l+(Ns%2)*pilot2)*frame_parms->ofdm_symbol_size)*2]=0/2;
|
((int16_t *) UE->pdsch_vars[subframe&0x1][0]->dl_bf_ch_estimates[(aa<<1)+aarx])[2*i+1+((l+(Ns%2)*pilot2)*frame_parms->ofdm_symbol_size)*2]=0/2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3199,6 +3199,7 @@ PMI_FEEDBACK:
|
|||||||
rx_pdcch(&UE->common_vars,
|
rx_pdcch(&UE->common_vars,
|
||||||
UE->pdcch_vars,
|
UE->pdcch_vars,
|
||||||
&UE->frame_parms,
|
&UE->frame_parms,
|
||||||
|
0, // frame
|
||||||
subframe,
|
subframe,
|
||||||
0,
|
0,
|
||||||
(UE->frame_parms.mode1_flag == 1) ? SISO : ALAMOUTI,
|
(UE->frame_parms.mode1_flag == 1) ? SISO : ALAMOUTI,
|
||||||
@@ -3405,6 +3406,7 @@ PMI_FEEDBACK:
|
|||||||
PDSCH,
|
PDSCH,
|
||||||
eNB_id,
|
eNB_id,
|
||||||
eNB_id_i,
|
eNB_id_i,
|
||||||
|
0, // frame
|
||||||
subframe,
|
subframe,
|
||||||
m,
|
m,
|
||||||
(m==UE->pdcch_vars[0]->num_pdcch_symbols)?1:0,
|
(m==UE->pdcch_vars[0]->num_pdcch_symbols)?1:0,
|
||||||
@@ -3430,6 +3432,7 @@ PMI_FEEDBACK:
|
|||||||
PDSCH,
|
PDSCH,
|
||||||
eNB_id,
|
eNB_id,
|
||||||
eNB_id_i,
|
eNB_id_i,
|
||||||
|
0, // frame
|
||||||
subframe,
|
subframe,
|
||||||
m,
|
m,
|
||||||
0,
|
0,
|
||||||
@@ -3455,6 +3458,7 @@ PMI_FEEDBACK:
|
|||||||
PDSCH,
|
PDSCH,
|
||||||
eNB_id,
|
eNB_id,
|
||||||
eNB_id_i,
|
eNB_id_i,
|
||||||
|
0, // frame
|
||||||
subframe,
|
subframe,
|
||||||
m,
|
m,
|
||||||
0,
|
0,
|
||||||
@@ -3481,34 +3485,34 @@ PMI_FEEDBACK:
|
|||||||
//write_output("rxsig0.m","rxs0", &UE->common_vars.rxdata[0][0],10*UE->frame_parms.samples_per_tti,1,1);
|
//write_output("rxsig0.m","rxs0", &UE->common_vars.rxdata[0][0],10*UE->frame_parms.samples_per_tti,1,1);
|
||||||
write_output("rxsig0.m","rxs0", &UE->common_vars.rxdata[0][subframe*UE->frame_parms.samples_per_tti],UE->frame_parms.samples_per_tti,1,1);
|
write_output("rxsig0.m","rxs0", &UE->common_vars.rxdata[0][subframe*UE->frame_parms.samples_per_tti],UE->frame_parms.samples_per_tti,1,1);
|
||||||
//write_output("rxsigF0.m","rxsF0", &UE->common_vars.rxdataF[0][subframe*nsymb*eNB->frame_parms.ofdm_symbol_size],UE->frame_parms.ofdm_symbol_size*nsymb,1,1);
|
//write_output("rxsigF0.m","rxsF0", &UE->common_vars.rxdataF[0][subframe*nsymb*eNB->frame_parms.ofdm_symbol_size],UE->frame_parms.ofdm_symbol_size*nsymb,1,1);
|
||||||
write_output("rxsigF0.m","rxsF0", &UE->common_vars.rxdataF[0][0],UE->frame_parms.ofdm_symbol_size*nsymb,1,1);
|
write_output("rxsigF0.m","rxsF0", &UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF[0][0],UE->frame_parms.ofdm_symbol_size*nsymb,1,1);
|
||||||
|
|
||||||
if (UE->frame_parms.nb_antennas_rx>1) {
|
if (UE->frame_parms.nb_antennas_rx>1) {
|
||||||
write_output("rxsig1.m","rxs1", UE->common_vars.rxdata[1],UE->frame_parms.samples_per_tti,1,1);
|
write_output("rxsig1.m","rxs1", UE->common_vars.rxdata[1],UE->frame_parms.samples_per_tti,1,1);
|
||||||
write_output("rxsigF1.m","rxsF1", UE->common_vars.rxdataF[1],UE->frame_parms.ofdm_symbol_size*nsymb,1,1);
|
write_output("rxsigF1.m","rxsF1", UE->common_vars..common_vars_rx_data_per_thread[subframe&0x1]rxdataF[1],UE->frame_parms.ofdm_symbol_size*nsymb,1,1);
|
||||||
}
|
}
|
||||||
|
|
||||||
write_output("dlsch00_r0.m","dl00_r0",
|
write_output("dlsch00_r0.m","dl00_r0",
|
||||||
&(UE->common_vars.dl_ch_estimates[eNB_id][0][0]),
|
&(UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][0][0]),
|
||||||
UE->frame_parms.ofdm_symbol_size*nsymb,1,1);
|
UE->frame_parms.ofdm_symbol_size*nsymb,1,1);
|
||||||
|
|
||||||
if (UE->frame_parms.nb_antennas_rx>1)
|
if (UE->frame_parms.nb_antennas_rx>1)
|
||||||
write_output("dlsch01_r0.m","dl01_r0",
|
write_output("dlsch01_r0.m","dl01_r0",
|
||||||
&(UE->common_vars.dl_ch_estimates[eNB_id][1][0]),
|
&(UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][1][0]),
|
||||||
UE->frame_parms.ofdm_symbol_size*nsymb,1,1);
|
UE->frame_parms.ofdm_symbol_size*nsymb,1,1);
|
||||||
|
|
||||||
if (eNB->frame_parms.nb_antennas_tx>1)
|
if (eNB->frame_parms.nb_antennas_tx>1)
|
||||||
write_output("dlsch10_r0.m","dl10_r0",
|
write_output("dlsch10_r0.m","dl10_r0",
|
||||||
&(UE->common_vars.dl_ch_estimates[eNB_id][2][0]),
|
&(UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][2][0]),
|
||||||
UE->frame_parms.ofdm_symbol_size*nsymb,1,1);
|
UE->frame_parms.ofdm_symbol_size*nsymb,1,1);
|
||||||
|
|
||||||
if ((UE->frame_parms.nb_antennas_rx>1) && (eNB->frame_parms.nb_antennas_tx>1))
|
if ((UE->frame_parms.nb_antennas_rx>1) && (eNB->frame_parms.nb_antennas_tx>1))
|
||||||
write_output("dlsch11_r0.m","dl11_r0",
|
write_output("dlsch11_r0.m","dl11_r0",
|
||||||
&(UE->common_vars.dl_ch_estimates[eNB_id][3][0]),
|
&(UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][3][0]),
|
||||||
UE->frame_parms.ofdm_symbol_size*nsymb/2,1,1);
|
UE->frame_parms.ofdm_symbol_size*nsymb/2,1,1);
|
||||||
|
|
||||||
//pdsch_vars
|
//pdsch_vars
|
||||||
dump_dlsch2(UE,eNB_id,coded_bits_per_codeword,round);
|
dump_dlsch2(UE,eNB_id,subframe,coded_bits_per_codeword,round);
|
||||||
//dump_dlsch2(UE,eNB_id_i,coded_bits_per_codeword);
|
//dump_dlsch2(UE,eNB_id_i,coded_bits_per_codeword);
|
||||||
write_output("dlsch_e.m","e",eNB->dlsch[0][0]->harq_processes[0]->e,coded_bits_per_codeword,1,4);
|
write_output("dlsch_e.m","e",eNB->dlsch[0][0]->harq_processes[0]->e,coded_bits_per_codeword,1,4);
|
||||||
|
|
||||||
@@ -3531,8 +3535,8 @@ PMI_FEEDBACK:
|
|||||||
if (trials==0 && round==0 && transmission_mode>=5 && transmission_mode<7) {
|
if (trials==0 && round==0 && transmission_mode>=5 && transmission_mode<7) {
|
||||||
for (iii=0; iii<NB_RB; iii++) {
|
for (iii=0; iii<NB_RB; iii++) {
|
||||||
//fprintf(csv_fd, "%d, %d", (UE->pdsch_vars[eNB_id]->pmi_ext[iii]),(UE->pdsch_vars[eNB_id_i]->pmi_ext[iii]));
|
//fprintf(csv_fd, "%d, %d", (UE->pdsch_vars[eNB_id]->pmi_ext[iii]),(UE->pdsch_vars[eNB_id_i]->pmi_ext[iii]));
|
||||||
fprintf(csv_fd,"%x,%x,",(UE->pdsch_vars[eNB_id]->pmi_ext[iii]),(UE->pdsch_vars[eNB_id]->pmi_ext[iii]));
|
fprintf(csv_fd,"%x,%x,",(UE->pdsch_vars[subframe&0x1][eNB_id]->pmi_ext[iii]),(UE->pdsch_vars[eNB_id]->pmi_ext[iii]));
|
||||||
printf("%x ",(UE->pdsch_vars[eNB_id]->pmi_ext[iii]));
|
printf("%x ",(UE->pdsch_vars[subframe&0x1][eNB_id]->pmi_ext[iii]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3556,7 +3560,7 @@ PMI_FEEDBACK:
|
|||||||
// calculate uncoded BLER
|
// calculate uncoded BLER
|
||||||
uncoded_ber=0;
|
uncoded_ber=0;
|
||||||
for (i=0;i<coded_bits_per_codeword;i++)
|
for (i=0;i<coded_bits_per_codeword;i++)
|
||||||
if (eNB->dlsch[0][0]->harq_processes[0]->e[i] != (UE->pdsch_vars[0]->llr[0][i]<0)) {
|
if (eNB->dlsch[0][0]->harq_processes[0]->e[i] != (UE->pdsch_vars[subframe&0x1][0]->llr[0][i]<0)) {
|
||||||
uncoded_ber_bit[i] = 1;
|
uncoded_ber_bit[i] = 1;
|
||||||
uncoded_ber++;
|
uncoded_ber++;
|
||||||
}
|
}
|
||||||
@@ -3575,14 +3579,14 @@ PMI_FEEDBACK:
|
|||||||
0,
|
0,
|
||||||
UE->dlsch[0][cw],
|
UE->dlsch[0][cw],
|
||||||
coded_bits_per_codeword,
|
coded_bits_per_codeword,
|
||||||
UE->pdsch_vars[eNB_id]->llr[cw],
|
UE->pdsch_vars[subframe&0x1][eNB_id]->llr[cw],
|
||||||
0,
|
0,
|
||||||
subframe<<1);
|
subframe<<1);
|
||||||
stop_meas(&UE->dlsch_unscrambling_stats);
|
stop_meas(&UE->dlsch_unscrambling_stats);
|
||||||
|
|
||||||
start_meas(&UE->dlsch_decoding_stats);
|
start_meas(&UE->dlsch_decoding_stats);
|
||||||
ret = dlsch_decoding(UE,
|
ret = dlsch_decoding(UE,
|
||||||
UE->pdsch_vars[eNB_id]->llr[cw],
|
UE->pdsch_vars[subframe&0x1][eNB_id]->llr[cw],
|
||||||
&UE->frame_parms,
|
&UE->frame_parms,
|
||||||
UE->dlsch[0][cw],
|
UE->dlsch[0][cw],
|
||||||
UE->dlsch[0][cw]->harq_processes[UE->dlsch[0][cw]->current_harq_pid],
|
UE->dlsch[0][cw]->harq_processes[UE->dlsch[0][cw]->current_harq_pid],
|
||||||
@@ -3683,7 +3687,7 @@ PMI_FEEDBACK:
|
|||||||
write_output(fname,vname, &UE->common_vars.rxdata[0][0],10*UE->frame_parms.samples_per_tti,1,1);
|
write_output(fname,vname, &UE->common_vars.rxdata[0][0],10*UE->frame_parms.samples_per_tti,1,1);
|
||||||
sprintf(fname,"rxsigF0_r%d.m",round);
|
sprintf(fname,"rxsigF0_r%d.m",round);
|
||||||
sprintf(vname,"rxs0F_r%d",round);
|
sprintf(vname,"rxs0F_r%d",round);
|
||||||
write_output(fname,vname, &UE->common_vars.rxdataF[0][0],2*UE->frame_parms.ofdm_symbol_size*nsymb,2,1);
|
write_output(fname,vname, &UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF[0][0],2*UE->frame_parms.ofdm_symbol_size*nsymb,2,1);
|
||||||
|
|
||||||
if (UE->frame_parms.nb_antennas_rx>1) {
|
if (UE->frame_parms.nb_antennas_rx>1) {
|
||||||
sprintf(fname,"rxsig1_r%d.m",round);
|
sprintf(fname,"rxsig1_r%d.m",round);
|
||||||
@@ -3691,20 +3695,20 @@ PMI_FEEDBACK:
|
|||||||
write_output(fname,vname, UE->common_vars.rxdata[1],UE->frame_parms.samples_per_tti,1,1);
|
write_output(fname,vname, UE->common_vars.rxdata[1],UE->frame_parms.samples_per_tti,1,1);
|
||||||
sprintf(fname,"rxsig1F_r%d.m",round);
|
sprintf(fname,"rxsig1F_r%d.m",round);
|
||||||
sprintf(vname,"rxs1F_r%d.m",round);
|
sprintf(vname,"rxs1F_r%d.m",round);
|
||||||
write_output(fname,vname, UE->common_vars.rxdataF[1],2*UE->frame_parms.ofdm_symbol_size*nsymb,2,1);
|
write_output(fname,vname, UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF[1],2*UE->frame_parms.ofdm_symbol_size*nsymb,2,1);
|
||||||
}
|
}
|
||||||
|
|
||||||
sprintf(fname,"dlsch00_r%d.m",round);
|
sprintf(fname,"dlsch00_r%d.m",round);
|
||||||
sprintf(vname,"dl00_r%d",round);
|
sprintf(vname,"dl00_r%d",round);
|
||||||
write_output(fname,vname,
|
write_output(fname,vname,
|
||||||
&(UE->common_vars.dl_ch_estimates[eNB_id][0][0]),
|
&(UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][0][0]),
|
||||||
UE->frame_parms.ofdm_symbol_size*nsymb,1,1);
|
UE->frame_parms.ofdm_symbol_size*nsymb,1,1);
|
||||||
|
|
||||||
if (UE->frame_parms.nb_antennas_rx>1) {
|
if (UE->frame_parms.nb_antennas_rx>1) {
|
||||||
sprintf(fname,"dlsch01_r%d.m",round);
|
sprintf(fname,"dlsch01_r%d.m",round);
|
||||||
sprintf(vname,"dl01_r%d",round);
|
sprintf(vname,"dl01_r%d",round);
|
||||||
write_output(fname,vname,
|
write_output(fname,vname,
|
||||||
&(UE->common_vars.dl_ch_estimates[eNB_id][1][0]),
|
&(UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][1][0]),
|
||||||
UE->frame_parms.ofdm_symbol_size*nsymb/2,1,1);
|
UE->frame_parms.ofdm_symbol_size*nsymb/2,1,1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3712,7 +3716,7 @@ PMI_FEEDBACK:
|
|||||||
sprintf(fname,"dlsch10_r%d.m",round);
|
sprintf(fname,"dlsch10_r%d.m",round);
|
||||||
sprintf(vname,"dl10_r%d",round);
|
sprintf(vname,"dl10_r%d",round);
|
||||||
write_output(fname,vname,
|
write_output(fname,vname,
|
||||||
&(UE->common_vars.dl_ch_estimates[eNB_id][2][0]),
|
&(UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][2][0]),
|
||||||
UE->frame_parms.ofdm_symbol_size*nsymb/2,1,1);
|
UE->frame_parms.ofdm_symbol_size*nsymb/2,1,1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3720,12 +3724,12 @@ PMI_FEEDBACK:
|
|||||||
sprintf(fname,"dlsch11_r%d.m",round);
|
sprintf(fname,"dlsch11_r%d.m",round);
|
||||||
sprintf(vname,"dl11_r%d",round);
|
sprintf(vname,"dl11_r%d",round);
|
||||||
write_output(fname,vname,
|
write_output(fname,vname,
|
||||||
&(UE->common_vars.dl_ch_estimates[eNB_id][3][0]),
|
&(UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][3][0]),
|
||||||
UE->frame_parms.ofdm_symbol_size*nsymb/2,1,1);
|
UE->frame_parms.ofdm_symbol_size*nsymb/2,1,1);
|
||||||
}
|
}
|
||||||
|
|
||||||
//pdsch_vars
|
//pdsch_vars
|
||||||
dump_dlsch2(UE,eNB_id,coded_bits_per_codeword,round);
|
dump_dlsch2(UE,eNB_id,subframe,coded_bits_per_codeword,round);
|
||||||
/*
|
/*
|
||||||
write_output("dlsch_e.m","e",eNB->dlsch[0][0]->harq_processes[0]->e,coded_bits_per_codeword,1,4);
|
write_output("dlsch_e.m","e",eNB->dlsch[0][0]->harq_processes[0]->e,coded_bits_per_codeword,1,4);
|
||||||
write_output("dlsch_ber_bit.m","ber_bit",uncoded_ber_bit,coded_bits_per_codeword,1,0);
|
write_output("dlsch_ber_bit.m","ber_bit",uncoded_ber_bit,coded_bits_per_codeword,1,0);
|
||||||
|
|||||||
@@ -447,8 +447,8 @@ int main(int argc, char **argv)
|
|||||||
for(aa=0; aa<frame_parms->nb_antennas_tx; aa++) {
|
for(aa=0; aa<frame_parms->nb_antennas_tx; aa++) {
|
||||||
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
|
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
|
||||||
for (i=0; i<frame_parms->N_RB_DL*12; i++) {
|
for (i=0; i<frame_parms->N_RB_DL*12; i++) {
|
||||||
((int16_t *) UE->common_vars.dl_ch_estimates[k][(aa<<1)+aarx])[2*i+(l*frame_parms->ofdm_symbol_size+LTE_CE_FILTER_LENGTH)*2]=(int16_t)(eNB2UE->chF[aarx+(aa*frame_parms->nb_antennas_rx)][i].x*AMP);
|
((int16_t *) UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[k][(aa<<1)+aarx])[2*i+(l*frame_parms->ofdm_symbol_size+LTE_CE_FILTER_LENGTH)*2]=(int16_t)(eNB2UE->chF[aarx+(aa*frame_parms->nb_antennas_rx)][i].x*AMP);
|
||||||
((int16_t *) UE->common_vars.dl_ch_estimates[k][(aa<<1)+aarx])[2*i+1+(l*frame_parms->ofdm_symbol_size+LTE_CE_FILTER_LENGTH)*2]=(int16_t)(eNB2UE->chF[aarx+(aa*frame_parms->nb_antennas_rx)][i].y*AMP);
|
((int16_t *) UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[k][(aa<<1)+aarx])[2*i+1+(l*frame_parms->ofdm_symbol_size+LTE_CE_FILTER_LENGTH)*2]=(int16_t)(eNB2UE->chF[aarx+(aa*frame_parms->nb_antennas_rx)][i].y*AMP);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -492,6 +492,7 @@ int main(int argc, char **argv)
|
|||||||
&UE->frame_parms,
|
&UE->frame_parms,
|
||||||
UE->dlsch_MCH[0],
|
UE->dlsch_MCH[0],
|
||||||
UE->dlsch_MCH[0]->harq_processes[0],
|
UE->dlsch_MCH[0]->harq_processes[0],
|
||||||
|
trials,
|
||||||
subframe,
|
subframe,
|
||||||
0,0,0);
|
0,0,0);
|
||||||
|
|
||||||
|
|||||||
@@ -932,6 +932,7 @@ int main(int argc, char **argv)
|
|||||||
lte_ue_measurements(UE,
|
lte_ue_measurements(UE,
|
||||||
0,
|
0,
|
||||||
1,
|
1,
|
||||||
|
0,
|
||||||
0);
|
0);
|
||||||
/*
|
/*
|
||||||
if (trial%100 == 0) {
|
if (trial%100 == 0) {
|
||||||
@@ -963,7 +964,7 @@ int main(int argc, char **argv)
|
|||||||
//sprintf(vname,"dl_ch00_%d",l);
|
//sprintf(vname,"dl_ch00_%d",l);
|
||||||
//write_output(fname,vname,&(common_vars->dl_ch_estimates[0][frame_parms->ofdm_symbol_size*(l%6)]),frame_parms->ofdm_symbol_size,1,1);
|
//write_output(fname,vname,&(common_vars->dl_ch_estimates[0][frame_parms->ofdm_symbol_size*(l%6)]),frame_parms->ofdm_symbol_size,1,1);
|
||||||
|
|
||||||
lte_est_freq_offset(UE->common_vars.dl_ch_estimates[0],
|
lte_est_freq_offset(UE->common_vars.common_vars_rx_data_per_thread[/*subframe*/0&0x1].dl_ch_estimates[0],
|
||||||
&UE->frame_parms,
|
&UE->frame_parms,
|
||||||
l,
|
l,
|
||||||
&freq_offset,
|
&freq_offset,
|
||||||
@@ -1051,13 +1052,13 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
if (n_frames==1) {
|
if (n_frames==1) {
|
||||||
|
|
||||||
write_output("H00.m","h00",&(UE->common_vars.dl_ch_estimates[0][0][0]),((frame_parms->Ncp==0)?7:6)*(eNB->frame_parms.ofdm_symbol_size),1,1);
|
write_output("H00.m","h00",&(UE->common_vars.common_vars_rx_data_per_thread[/*subframe*/0&0x1].dl_ch_estimates[0][0][0]),((frame_parms->Ncp==0)?7:6)*(eNB->frame_parms.ofdm_symbol_size),1,1);
|
||||||
|
|
||||||
if (n_tx==2)
|
if (n_tx==2)
|
||||||
write_output("H10.m","h10",&(UE->common_vars.dl_ch_estimates[0][2][0]),((frame_parms->Ncp==0)?7:6)*(eNB->frame_parms.ofdm_symbol_size),1,1);
|
write_output("H10.m","h10",&(UE->common_vars.common_vars_rx_data_per_thread[/*subframe*/0&0x1].dl_ch_estimates[0][2][0]),((frame_parms->Ncp==0)?7:6)*(eNB->frame_parms.ofdm_symbol_size),1,1);
|
||||||
|
|
||||||
write_output("rxsig0.m","rxs0", UE->common_vars.rxdata[0],FRAME_LENGTH_COMPLEX_SAMPLES,1,1);
|
write_output("rxsig0.m","rxs0", UE->common_vars.rxdata[0],FRAME_LENGTH_COMPLEX_SAMPLES,1,1);
|
||||||
write_output("rxsigF0.m","rxsF0", UE->common_vars.rxdataF[0],NUMBER_OF_OFDM_CARRIERS*2*((frame_parms->Ncp==0)?14:12),2,1);
|
write_output("rxsigF0.m","rxsF0", UE->common_vars.common_vars_rx_data_per_thread[/*subframe*/0&0x1].rxdataF[0],NUMBER_OF_OFDM_CARRIERS*2*((frame_parms->Ncp==0)?14:12),2,1);
|
||||||
write_output("PBCH_rxF0_ext.m","pbch0_ext",UE->pbch_vars[0]->rxdataF_ext[0],12*4*6,1,1);
|
write_output("PBCH_rxF0_ext.m","pbch0_ext",UE->pbch_vars[0]->rxdataF_ext[0],12*4*6,1,1);
|
||||||
write_output("PBCH_rxF0_comp.m","pbch0_comp",UE->pbch_vars[0]->rxdataF_comp[0],12*4*6,1,1);
|
write_output("PBCH_rxF0_comp.m","pbch0_comp",UE->pbch_vars[0]->rxdataF_comp[0],12*4*6,1,1);
|
||||||
write_output("PBCH_rxF_llr.m","pbch_llr",UE->pbch_vars[0]->llr,(frame_parms->Ncp==0) ? 1920 : 1728,1,4);
|
write_output("PBCH_rxF_llr.m","pbch_llr",UE->pbch_vars[0]->llr,(frame_parms->Ncp==0) ? 1920 : 1728,1,4);
|
||||||
|
|||||||
@@ -1060,9 +1060,9 @@ int main(int argc, char **argv)
|
|||||||
for(aa=0; aa<frame_parms->nb_antennas_tx; aa++) {
|
for(aa=0; aa<frame_parms->nb_antennas_tx; aa++) {
|
||||||
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
|
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
|
||||||
for (i=0; i<frame_parms->N_RB_DL*12; i++) {
|
for (i=0; i<frame_parms->N_RB_DL*12; i++) {
|
||||||
((int16_t *) UE->common_vars.dl_ch_estimates[k][(aa<<1)+aarx])[2*i+(l*frame_parms->ofdm_symbol_size+LTE_CE_FILTER_LENGTH)*2]=(int16_t)(
|
((int16_t *) UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[k][(aa<<1)+aarx])[2*i+(l*frame_parms->ofdm_symbol_size+LTE_CE_FILTER_LENGTH)*2]=(int16_t)(
|
||||||
eNB2UE->chF[aarx+(aa*frame_parms->nb_antennas_rx)][i].x*AMP);
|
eNB2UE->chF[aarx+(aa*frame_parms->nb_antennas_rx)][i].x*AMP);
|
||||||
((int16_t *) UE->common_vars.dl_ch_estimates[k][(aa<<1)+aarx])[2*i+1+(l*frame_parms->ofdm_symbol_size+LTE_CE_FILTER_LENGTH)*2]=(int16_t)(
|
((int16_t *) UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[k][(aa<<1)+aarx])[2*i+1+(l*frame_parms->ofdm_symbol_size+LTE_CE_FILTER_LENGTH)*2]=(int16_t)(
|
||||||
eNB2UE->chF[aarx+(aa*frame_parms->nb_antennas_rx)][i].y*AMP);
|
eNB2UE->chF[aarx+(aa*frame_parms->nb_antennas_rx)][i].y*AMP);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1072,8 +1072,8 @@ int main(int argc, char **argv)
|
|||||||
for(aa=0; aa<frame_parms->nb_antenna_ports_eNB; aa++) {
|
for(aa=0; aa<frame_parms->nb_antenna_ports_eNB; aa++) {
|
||||||
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
|
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
|
||||||
for (i=0; i<frame_parms->N_RB_DL*12; i++) {
|
for (i=0; i<frame_parms->N_RB_DL*12; i++) {
|
||||||
((int16_t *) UE->common_vars.dl_ch_estimates[0][(aa<<1)+aarx])[2*i+(l*frame_parms->ofdm_symbol_size+LTE_CE_FILTER_LENGTH)*2]=(short)(AMP);
|
((int16_t *) UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[0][(aa<<1)+aarx])[2*i+(l*frame_parms->ofdm_symbol_size+LTE_CE_FILTER_LENGTH)*2]=(short)(AMP);
|
||||||
((int16_t *) UE->common_vars.dl_ch_estimates[0][(aa<<1)+aarx])[2*i+1+(l*frame_parms->ofdm_symbol_size+LTE_CE_FILTER_LENGTH)*2]=0/2;
|
((int16_t *) UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[0][(aa<<1)+aarx])[2*i+1+(l*frame_parms->ofdm_symbol_size+LTE_CE_FILTER_LENGTH)*2]=0/2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1091,6 +1091,7 @@ int main(int argc, char **argv)
|
|||||||
rx_pdcch(&UE->common_vars,
|
rx_pdcch(&UE->common_vars,
|
||||||
UE->pdcch_vars,
|
UE->pdcch_vars,
|
||||||
&UE->frame_parms,
|
&UE->frame_parms,
|
||||||
|
trial,
|
||||||
subframe,
|
subframe,
|
||||||
0,
|
0,
|
||||||
(UE->frame_parms.mode1_flag == 1) ? SISO : ALAMOUTI,
|
(UE->frame_parms.mode1_flag == 1) ? SISO : ALAMOUTI,
|
||||||
@@ -1211,17 +1212,17 @@ int main(int argc, char **argv)
|
|||||||
write_output("txsig1.m","txs1", txdata[1],FRAME_LENGTH_COMPLEX_SAMPLES,1,1);
|
write_output("txsig1.m","txs1", txdata[1],FRAME_LENGTH_COMPLEX_SAMPLES,1,1);
|
||||||
|
|
||||||
write_output("rxsig0.m","rxs0", UE->common_vars.rxdata[0],10*frame_parms->samples_per_tti,1,1);
|
write_output("rxsig0.m","rxs0", UE->common_vars.rxdata[0],10*frame_parms->samples_per_tti,1,1);
|
||||||
write_output("rxsigF0.m","rxsF0", UE->common_vars.rxdataF[0],NUMBER_OF_OFDM_CARRIERS*2*((frame_parms->Ncp==0)?14:12),2,1);
|
write_output("rxsigF0.m","rxsF0", UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF[0],NUMBER_OF_OFDM_CARRIERS*2*((frame_parms->Ncp==0)?14:12),2,1);
|
||||||
|
|
||||||
if (n_rx>1) {
|
if (n_rx>1) {
|
||||||
write_output("rxsig1.m","rxs1", UE->common_vars.rxdata[1],10*frame_parms->samples_per_tti,1,1);
|
write_output("rxsig1.m","rxs1", UE->common_vars.rxdata[1],10*frame_parms->samples_per_tti,1,1);
|
||||||
write_output("rxsigF1.m","rxsF1", UE->common_vars.rxdataF[1],NUMBER_OF_OFDM_CARRIERS*2*((frame_parms->Ncp==0)?14:12),2,1);
|
write_output("rxsigF1.m","rxsF1", UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF[1],NUMBER_OF_OFDM_CARRIERS*2*((frame_parms->Ncp==0)?14:12),2,1);
|
||||||
}
|
}
|
||||||
|
|
||||||
write_output("H00.m","h00",&(UE->common_vars.dl_ch_estimates[0][0][0]),((frame_parms->Ncp==0)?7:6)*(eNB->frame_parms.ofdm_symbol_size),1,1);
|
write_output("H00.m","h00",&(UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[0][0][0]),((frame_parms->Ncp==0)?7:6)*(eNB->frame_parms.ofdm_symbol_size),1,1);
|
||||||
|
|
||||||
if (n_tx==2)
|
if (n_tx==2)
|
||||||
write_output("H10.m","h10",&(UE->common_vars.dl_ch_estimates[0][2][0]),((frame_parms->Ncp==0)?7:6)*(eNB->frame_parms.ofdm_symbol_size),1,1);
|
write_output("H10.m","h10",&(UE->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[0][2][0]),((frame_parms->Ncp==0)?7:6)*(eNB->frame_parms.ofdm_symbol_size),1,1);
|
||||||
|
|
||||||
write_output("pdcch_rxF_ext0.m","pdcch_rxF_ext0",UE->pdcch_vars[eNb_id]->rxdataF_ext[0],3*12*UE->frame_parms.N_RB_DL,1,1);
|
write_output("pdcch_rxF_ext0.m","pdcch_rxF_ext0",UE->pdcch_vars[eNb_id]->rxdataF_ext[0],3*12*UE->frame_parms.N_RB_DL,1,1);
|
||||||
write_output("pdcch_rxF_comp0.m","pdcch0_rxF_comp0",UE->pdcch_vars[eNb_id]->rxdataF_comp[0],4*12*UE->frame_parms.N_RB_DL,1,1);
|
write_output("pdcch_rxF_comp0.m","pdcch0_rxF_comp0",UE->pdcch_vars[eNb_id]->rxdataF_comp[0],4*12*UE->frame_parms.N_RB_DL,1,1);
|
||||||
|
|||||||
@@ -1490,6 +1490,7 @@ int main(int argc, char **argv)
|
|||||||
rx_pdcch(&PHY_vars_UE[UE_idx]->lte_ue_common_vars,
|
rx_pdcch(&PHY_vars_UE[UE_idx]->lte_ue_common_vars,
|
||||||
PHY_vars_UE[UE_idx]->lte_ue_pdcch_vars,
|
PHY_vars_UE[UE_idx]->lte_ue_pdcch_vars,
|
||||||
&PHY_vars_UE[UE_idx]->lte_frame_parms,
|
&PHY_vars_UE[UE_idx]->lte_frame_parms,
|
||||||
|
frame,
|
||||||
subframe,
|
subframe,
|
||||||
0,
|
0,
|
||||||
(PHY_vars_UE[UE_idx]->lte_frame_parms.mode1_flag == 1) ? SISO : ALAMOUTI,
|
(PHY_vars_UE[UE_idx]->lte_frame_parms.mode1_flag == 1) ? SISO : ALAMOUTI,
|
||||||
@@ -1534,6 +1535,7 @@ int main(int argc, char **argv)
|
|||||||
PDSCH,
|
PDSCH,
|
||||||
0,
|
0,
|
||||||
1,
|
1,
|
||||||
|
frame,
|
||||||
subframe, // subframe,
|
subframe, // subframe,
|
||||||
l, // symbol
|
l, // symbol
|
||||||
(l==PHY_vars_UE[UE_idx]->lte_ue_pdcch_vars[0]->num_pdcch_symbols)?1:0, // first_symbol_flag
|
(l==PHY_vars_UE[UE_idx]->lte_ue_pdcch_vars[0]->num_pdcch_symbols)?1:0, // first_symbol_flag
|
||||||
@@ -1564,6 +1566,7 @@ int main(int argc, char **argv)
|
|||||||
PDSCH,
|
PDSCH,
|
||||||
0,
|
0,
|
||||||
1,
|
1,
|
||||||
|
frame,
|
||||||
subframe, // subframe,
|
subframe, // subframe,
|
||||||
l, // symbol
|
l, // symbol
|
||||||
0, // first_symbol_flag
|
0, // first_symbol_flag
|
||||||
@@ -1588,6 +1591,7 @@ int main(int argc, char **argv)
|
|||||||
PDSCH,
|
PDSCH,
|
||||||
0,
|
0,
|
||||||
1,
|
1,
|
||||||
|
frame,
|
||||||
subframe, // subframe,
|
subframe, // subframe,
|
||||||
l, // symbol
|
l, // symbol
|
||||||
0, // first_symbol_flag
|
0, // first_symbol_flag
|
||||||
@@ -1618,6 +1622,7 @@ int main(int argc, char **argv)
|
|||||||
PDSCH,
|
PDSCH,
|
||||||
0,
|
0,
|
||||||
1,
|
1,
|
||||||
|
frame,
|
||||||
subframe, // subframe,
|
subframe, // subframe,
|
||||||
l, // symbol
|
l, // symbol
|
||||||
0, // first_symbol_flag
|
0, // first_symbol_flag
|
||||||
@@ -1651,6 +1656,7 @@ int main(int argc, char **argv)
|
|||||||
PHY_vars_UE[UE_idx]->lte_ue_pdsch_vars[0]->llr[0],
|
PHY_vars_UE[UE_idx]->lte_ue_pdsch_vars[0]->llr[0],
|
||||||
&PHY_vars_UE[UE_idx]->lte_frame_parms,
|
&PHY_vars_UE[UE_idx]->lte_frame_parms,
|
||||||
PHY_vars_UE[UE_idx]->dlsch_ue[0][0],
|
PHY_vars_UE[UE_idx]->dlsch_ue[0][0],
|
||||||
|
frame,
|
||||||
subframe,
|
subframe,
|
||||||
0,
|
0,
|
||||||
PHY_vars_UE[UE_idx]->lte_ue_pdcch_vars[0]->num_pdcch_symbols);
|
PHY_vars_UE[UE_idx]->lte_ue_pdcch_vars[0]->num_pdcch_symbols);
|
||||||
@@ -1677,9 +1683,9 @@ int main(int argc, char **argv)
|
|||||||
frame_parms,
|
frame_parms,
|
||||||
PHY_vars_UE[0]->lte_ue_pdcch_vars[0]->num_pdcch_symbols,
|
PHY_vars_UE[0]->lte_ue_pdcch_vars[0]->num_pdcch_symbols,
|
||||||
(int16_t**)PHY_vars_UE[0]->lte_ue_common_vars.dl_ch_estimates_time,
|
(int16_t**)PHY_vars_UE[0]->lte_ue_common_vars.dl_ch_estimates_time,
|
||||||
(int16_t**)PHY_vars_UE[0]->lte_ue_common_vars.dl_ch_estimates[0],
|
(int16_t**)PHY_vars_UE[0]->lte_ue_common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[0],
|
||||||
(int16_t**)PHY_vars_UE[0]->lte_ue_common_vars.rxdata,
|
(int16_t**)PHY_vars_UE[0]->lte_ue_common_vars.rxdata,
|
||||||
(int16_t**)PHY_vars_UE[0]->lte_ue_common_vars.rxdataF,
|
(int16_t**)PHY_vars_UE[0]->lte_ue_common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF,
|
||||||
(int16_t*)PHY_vars_UE[0]->lte_ue_pdcch_vars[0]->rxdataF_comp[0],
|
(int16_t*)PHY_vars_UE[0]->lte_ue_pdcch_vars[0]->rxdataF_comp[0],
|
||||||
(int16_t*)PHY_vars_UE[0]->lte_ue_pdsch_vars[0]->rxdataF_comp[0],
|
(int16_t*)PHY_vars_UE[0]->lte_ue_pdsch_vars[0]->rxdataF_comp[0],
|
||||||
(int16_t*)PHY_vars_UE[0]->lte_ue_pdsch_vars[1]->rxdataF_comp[0],
|
(int16_t*)PHY_vars_UE[0]->lte_ue_pdsch_vars[1]->rxdataF_comp[0],
|
||||||
@@ -1693,9 +1699,9 @@ int main(int argc, char **argv)
|
|||||||
frame_parms,
|
frame_parms,
|
||||||
PHY_vars_UE[1]->lte_ue_pdcch_vars[0]->num_pdcch_symbols,
|
PHY_vars_UE[1]->lte_ue_pdcch_vars[0]->num_pdcch_symbols,
|
||||||
(int16_t**)PHY_vars_UE[1]->lte_ue_common_vars.dl_ch_estimates_time,
|
(int16_t**)PHY_vars_UE[1]->lte_ue_common_vars.dl_ch_estimates_time,
|
||||||
(int16_t**)PHY_vars_UE[1]->lte_ue_common_vars.dl_ch_estimates[0],
|
(int16_t**)PHY_vars_UE[1]->lte_ue_common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[0],
|
||||||
(int16_t**)PHY_vars_UE[1]->lte_ue_common_vars.rxdata,
|
(int16_t**)PHY_vars_UE[1]->lte_ue_common_vars.rxdata,
|
||||||
(int16_t**)PHY_vars_UE[1]->lte_ue_common_vars.rxdataF,
|
(int16_t**)PHY_vars_UE[1]->lte_ue_common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF,
|
||||||
(int16_t*)PHY_vars_UE[1]->lte_ue_pdcch_vars[0]->rxdataF_comp[0],
|
(int16_t*)PHY_vars_UE[1]->lte_ue_pdcch_vars[0]->rxdataF_comp[0],
|
||||||
(int16_t*)PHY_vars_UE[1]->lte_ue_pdsch_vars[0]->rxdataF_comp[0],
|
(int16_t*)PHY_vars_UE[1]->lte_ue_pdsch_vars[0]->rxdataF_comp[0],
|
||||||
(int16_t*)PHY_vars_UE[1]->lte_ue_pdsch_vars[3]->rxdataF_comp[0],
|
(int16_t*)PHY_vars_UE[1]->lte_ue_pdsch_vars[3]->rxdataF_comp[0],
|
||||||
@@ -1712,10 +1718,10 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
if (n_frames==1) {
|
if (n_frames==1) {
|
||||||
|
|
||||||
write_output("H00.m","h00",&(PHY_vars_UE[0]->lte_ue_common_vars.dl_ch_estimates[0][0][0]),((frame_parms->Ncp==0)?7:6)*(PHY_vars_eNB->lte_frame_parms.ofdm_symbol_size),1,1);
|
write_output("H00.m","h00",&(PHY_vars_UE[0]->lte_ue_common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[0][0][0]),((frame_parms->Ncp==0)?7:6)*(PHY_vars_eNB->lte_frame_parms.ofdm_symbol_size),1,1);
|
||||||
|
|
||||||
if (n_tx==2)
|
if (n_tx==2)
|
||||||
write_output("H10.m","h10",&(PHY_vars_UE[0]->lte_ue_common_vars.dl_ch_estimates[0][2][0]),((frame_parms->Ncp==0)?7:6)*(PHY_vars_eNB->lte_frame_parms.ofdm_symbol_size),1,1);
|
write_output("H10.m","h10",&(PHY_vars_UE[0]->lte_ue_common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[0][2][0]),((frame_parms->Ncp==0)?7:6)*(PHY_vars_eNB->lte_frame_parms.ofdm_symbol_size),1,1);
|
||||||
|
|
||||||
write_output("rxsig0.m","rxs0", PHY_vars_UE[0]->lte_ue_common_vars.rxdata[0],FRAME_LENGTH_COMPLEX_SAMPLES,1,1);
|
write_output("rxsig0.m","rxs0", PHY_vars_UE[0]->lte_ue_common_vars.rxdata[0],FRAME_LENGTH_COMPLEX_SAMPLES,1,1);
|
||||||
write_output("rxsigF0.m","rxsF0", PHY_vars_UE[0]->lte_ue_common_vars.rxdataF[0],NUMBER_OF_OFDM_CARRIERS*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*nsymb,2,1);
|
write_output("rxsigF0.m","rxsF0", PHY_vars_UE[0]->lte_ue_common_vars.rxdataF[0],NUMBER_OF_OFDM_CARRIERS*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*nsymb,2,1);
|
||||||
@@ -1733,7 +1739,7 @@ int main(int argc, char **argv)
|
|||||||
PHY_vars_UE[0]->lte_ue_pdcch_vars[0]->num_pdcch_symbols,
|
PHY_vars_UE[0]->lte_ue_pdcch_vars[0]->num_pdcch_symbols,
|
||||||
0);
|
0);
|
||||||
|
|
||||||
dump_dlsch2(PHY_vars_UE[0],0,coded_bits_per_codeword);
|
dump_dlsch2(PHY_vars_UE[0],0,0,coded_bits_per_codeword);
|
||||||
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -1175,7 +1175,7 @@ int main(int argc, char **argv)
|
|||||||
eNB->td = (parallel_flag == 1) ? ulsch_decoding_data_2thread : ulsch_decoding_data;
|
eNB->td = (parallel_flag == 1) ? ulsch_decoding_data_2thread : ulsch_decoding_data;
|
||||||
eNB->do_prach = NULL;
|
eNB->do_prach = NULL;
|
||||||
|
|
||||||
phy_procedures_eNB_common_RX(eNB);
|
phy_procedures_eNB_common_RX(eNB,proc_rxtx);
|
||||||
phy_procedures_eNB_uespec_RX(eNB,proc_rxtx,no_relay);
|
phy_procedures_eNB_uespec_RX(eNB,proc_rxtx,no_relay);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -43,6 +43,13 @@ Description Contains global common definitions
|
|||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
|
||||||
|
/* boolean_t is also defined in openair2/COMMON/platform_types.h
|
||||||
|
* let's protect potential redefinition
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _BOOLEAN_T_DEFINED_
|
||||||
|
#define _BOOLEAN_T_DEFINED_
|
||||||
|
|
||||||
typedef signed char boolean_t;
|
typedef signed char boolean_t;
|
||||||
|
|
||||||
#if !defined(TRUE)
|
#if !defined(TRUE)
|
||||||
@@ -55,6 +62,8 @@ typedef signed char boolean_t;
|
|||||||
|
|
||||||
#define BOOL_NOT(b) (b^TRUE)
|
#define BOOL_NOT(b) (b^TRUE)
|
||||||
|
|
||||||
|
#endif /* _BOOLEAN_T_DEFINED_ */
|
||||||
|
|
||||||
#define NAS_UE_ID_FMT "0x%06x"
|
#define NAS_UE_ID_FMT "0x%06x"
|
||||||
|
|
||||||
/****************************************************************************/
|
/****************************************************************************/
|
||||||
|
|||||||
@@ -40,6 +40,13 @@
|
|||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// GENERIC TYPES
|
// GENERIC TYPES
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
/* boolean_t is also defined in openair2/COMMON/commonDef.h,
|
||||||
|
* let's protect potential redefinition
|
||||||
|
*/
|
||||||
|
#ifndef _BOOLEAN_T_DEFINED_
|
||||||
|
#define _BOOLEAN_T_DEFINED_
|
||||||
|
|
||||||
typedef signed char boolean_t;
|
typedef signed char boolean_t;
|
||||||
|
|
||||||
#if !defined(TRUE)
|
#if !defined(TRUE)
|
||||||
@@ -52,6 +59,8 @@ typedef signed char boolean_t;
|
|||||||
|
|
||||||
#define BOOL_NOT(b) (b^TRUE)
|
#define BOOL_NOT(b) (b^TRUE)
|
||||||
|
|
||||||
|
#endif /* _BOOLEAN_T_DEFINED_ */
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// GENERIC ACCESS STRATUM TYPES
|
// GENERIC ACCESS STRATUM TYPES
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user