rename srsLTE to srsRAN
This commit is contained in:
parent
df8ec4ddd5
commit
4523ee6087
4
.gdbinit
4
.gdbinit
|
@ -12,7 +12,7 @@
|
|||
|
||||
python
|
||||
|
||||
###### srslte::bounded_vector<T, N> ########
|
||||
###### srsran::bounded_vector<T, N> ########
|
||||
|
||||
class BoundedVectorPrinter(object):
|
||||
def __init__(self, val):
|
||||
|
@ -35,7 +35,7 @@ class BoundedVectorPrinter(object):
|
|||
|
||||
@staticmethod
|
||||
def make(val):
|
||||
if str(val.type).startswith('srslte::bounded_vector<'):
|
||||
if str(val.type).startswith('srsran::bounded_vector<'):
|
||||
return BoundedVectorPrinter(val)
|
||||
|
||||
gdb.pretty_printers.append(BoundedVectorPrinter.make)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<!--
|
||||
Before filing an issue, search for solutions here:
|
||||
- srsLTE users mailing list (http://www.softwareradiosystems.com/mailman/listinfo/srslte-users)
|
||||
- srsRAN users mailing list (http://www.softwareradiosystems.com/mailman/listinfo/srsran-users)
|
||||
-->
|
||||
|
||||
## Issue Description ##
|
||||
|
|
|
@ -9,7 +9,7 @@ jobs:
|
|||
runs-on: ubuntu-18.04
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Build srsLTE on x86 Ubuntu 18.04
|
||||
- name: Build srsRAN on x86 Ubuntu 18.04
|
||||
run: |
|
||||
sudo apt update
|
||||
sudo apt install -y build-essential cmake libfftw3-dev libmbedtls-dev libpcsclite-dev libboost-program-options-dev libconfig++-dev libsctp-dev colordiff ninja-build valgrind
|
||||
|
@ -22,7 +22,7 @@ jobs:
|
|||
runs-on: ubuntu-16.04
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Build srsLTE on x86 Ubuntu 16.04
|
||||
- name: Build srsRAN on x86 Ubuntu 16.04
|
||||
run: |
|
||||
sudo apt update
|
||||
sudo apt install -y build-essential cmake libfftw3-dev libmbedtls-dev libpcsclite-dev libboost-program-options-dev libconfig++-dev libsctp-dev colordiff ninja-build valgrind
|
||||
|
@ -36,7 +36,7 @@ jobs:
|
|||
compiler: [gcc, clang]
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Build srsLTE on aarch64
|
||||
- name: Build srsRAN on aarch64
|
||||
uses: uraimo/run-on-arch-action@master
|
||||
with:
|
||||
architecture: aarch64
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#
|
||||
# Copyright 2013-2020 Software Radio Systems Limited
|
||||
# Copyright 2013-2021 Software Radio Systems Limited
|
||||
#
|
||||
# By using this file, you agree to the terms and conditions set
|
||||
# forth in the LICENSE file which can be found at the top level of
|
||||
|
@ -19,14 +19,14 @@ endif(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
|
|||
# Project setup
|
||||
########################################################################
|
||||
cmake_minimum_required(VERSION 2.6)
|
||||
project( SRSLTE )
|
||||
project( SRSRAN )
|
||||
message( STATUS "CMAKE_SYSTEM: " ${CMAKE_SYSTEM} )
|
||||
message( STATUS "CMAKE_SYSTEM_PROCESSOR: " ${CMAKE_SYSTEM_PROCESSOR} )
|
||||
message( STATUS "CMAKE_CXX_COMPILER: " ${CMAKE_CXX_COMPILER} )
|
||||
|
||||
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/modules")
|
||||
include(SRSLTEVersion) #sets version information
|
||||
include(SRSLTEPackage) #setup cpack
|
||||
include(SRSRANVersion) #sets version information
|
||||
include(SRSRANPackage) #setup cpack
|
||||
|
||||
include(CTest)
|
||||
|
||||
|
@ -43,8 +43,8 @@ set(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "")
|
|||
|
||||
# Generate CMake to include build information
|
||||
configure_file(
|
||||
${PROJECT_SOURCE_DIR}/cmake/modules/SRSLTEbuildinfo.cmake.in
|
||||
${CMAKE_BINARY_DIR}/SRSLTEbuildinfo.cmake
|
||||
${PROJECT_SOURCE_DIR}/cmake/modules/SRSRANbuildinfo.cmake.in
|
||||
${CMAKE_BINARY_DIR}/SRSRANbuildinfo.cmake
|
||||
)
|
||||
|
||||
########################################################################
|
||||
|
@ -167,7 +167,7 @@ else(POLARSSL_FOUND)
|
|||
endif(BUILD_STATIC)
|
||||
add_definitions(-DHAVE_MBEDTLS)
|
||||
else(MBEDTLS_FOUND)
|
||||
message(FATAL_ERROR "Either PolarSSL or mbedTLS are required to build srsLTE")
|
||||
message(FATAL_ERROR "Either PolarSSL or mbedTLS are required to build srsRAN")
|
||||
endif (MBEDTLS_FOUND)
|
||||
endif(POLARSSL_FOUND)
|
||||
|
||||
|
@ -257,7 +257,7 @@ if(Boost_FOUND)
|
|||
include_directories(${Boost_INCLUDE_DIRS})
|
||||
link_directories(${Boost_LIBRARY_DIRS})
|
||||
else(Boost_FOUND)
|
||||
message(FATAL_ERROR "Boost required to build srsLTE")
|
||||
message(FATAL_ERROR "Boost required to build srsRAN")
|
||||
endif (Boost_FOUND)
|
||||
|
||||
# srsGUI
|
||||
|
@ -310,10 +310,10 @@ set(DATA_DIR share/${CPACK_PACKAGE_NAME})
|
|||
|
||||
# Auto-generate config install helper and mark for installation
|
||||
configure_file(
|
||||
${PROJECT_SOURCE_DIR}/cmake/modules/SRSLTE_install_configs.sh.in
|
||||
${CMAKE_BINARY_DIR}/srslte_install_configs.sh
|
||||
${PROJECT_SOURCE_DIR}/cmake/modules/SRSRAN_install_configs.sh.in
|
||||
${CMAKE_BINARY_DIR}/srsran_install_configs.sh
|
||||
)
|
||||
install(PROGRAMS ${CMAKE_BINARY_DIR}/srslte_install_configs.sh DESTINATION ${RUNTIME_DIR})
|
||||
install(PROGRAMS ${CMAKE_BINARY_DIR}/srsran_install_configs.sh DESTINATION ${RUNTIME_DIR})
|
||||
|
||||
# Disables the project to build when calling "make install"
|
||||
set(CMAKE_SKIP_INSTALL_ALL_DEPENDENCY TRUE)
|
||||
|
@ -588,7 +588,7 @@ foreach(_header ${headers})
|
|||
list(APPEND HEADERS_ALL ${tmp})
|
||||
endif(IS_DIRECTORY ${_header})
|
||||
endforeach()
|
||||
add_custom_target(add_srslte_headers SOURCES ${HEADERS_ALL})
|
||||
add_custom_target(add_srsran_headers SOURCES ${HEADERS_ALL})
|
||||
|
||||
########################################################################
|
||||
# Add the subdirectories
|
||||
|
|
40
COPYRIGHT
40
COPYRIGHT
|
@ -1,9 +1,9 @@
|
|||
Files: *
|
||||
Copyright: 2013-2020, Software Radio Systems Limited.
|
||||
Copyright: 2013-2021, Software Radio Systems Limited.
|
||||
License:
|
||||
|
||||
|
||||
The following files are used within srsLTE:
|
||||
The following files are used within srsRAN:
|
||||
|
||||
Files: lib/src/phy/fec/viterbi37_port.c
|
||||
lib/src/phy/fec/viterbi37_sse.c
|
||||
|
@ -19,34 +19,34 @@ Files: srsue/src/upper/pcsc_usim.cc
|
|||
Copyright: 2002-2014, Jouni Malinen <j@w1.fi>
|
||||
License: BSD-3-clause
|
||||
|
||||
Files: lib/include/srslte/asn1/liblte_common.h
|
||||
lib/include/srslte/asn1/liblte_mme.h
|
||||
lib/include/srslte/common/liblte_security.h
|
||||
Files: lib/include/srsran/asn1/liblte_common.h
|
||||
lib/include/srsran/asn1/liblte_mme.h
|
||||
lib/include/srsran/common/liblte_security.h
|
||||
lib/src/asn1/liblte_common.cc
|
||||
lib/src/asn1/liblte_mme.cc
|
||||
lib/src/common/liblte_security.cc
|
||||
Copyright: 2012-2014 Ben Wojtowicz
|
||||
License: AGPL-3+
|
||||
|
||||
Files: lib/include/srslte/srslog/bundled/fmt/chrono.h
|
||||
lib/include/srslte/srslog/bundled/fmt/color.h
|
||||
lib/include/srslte/srslog/bundled/fmt/compile.h
|
||||
lib/include/srslte/srslog/bundled/fmt/core.h
|
||||
lib/include/srslte/srslog/bundled/fmt/format.h
|
||||
lib/include/srslte/srslog/bundled/fmt/format-inl.h
|
||||
lib/include/srslte/srslog/bundled/fmt/LICENSE.rst
|
||||
lib/include/srslte/srslog/bundled/fmt/locale.h
|
||||
lib/include/srslte/srslog/bundled/fmt/os.h
|
||||
lib/include/srslte/srslog/bundled/fmt/ostream.h
|
||||
lib/include/srslte/srslog/bundled/fmt/posix.h
|
||||
lib/include/srslte/srslog/bundled/fmt/printf.h
|
||||
lib/include/srslte/srslog/bundled/fmt/ranges.h
|
||||
Files: lib/include/srsran/srslog/bundled/fmt/chrono.h
|
||||
lib/include/srsran/srslog/bundled/fmt/color.h
|
||||
lib/include/srsran/srslog/bundled/fmt/compile.h
|
||||
lib/include/srsran/srslog/bundled/fmt/core.h
|
||||
lib/include/srsran/srslog/bundled/fmt/format.h
|
||||
lib/include/srsran/srslog/bundled/fmt/format-inl.h
|
||||
lib/include/srsran/srslog/bundled/fmt/LICENSE.rst
|
||||
lib/include/srsran/srslog/bundled/fmt/locale.h
|
||||
lib/include/srsran/srslog/bundled/fmt/os.h
|
||||
lib/include/srsran/srslog/bundled/fmt/ostream.h
|
||||
lib/include/srsran/srslog/bundled/fmt/posix.h
|
||||
lib/include/srsran/srslog/bundled/fmt/printf.h
|
||||
lib/include/srsran/srslog/bundled/fmt/ranges.h
|
||||
lib/src/srslog/bundled/fmt/format.cc
|
||||
lib/src/srslog/bundled/fmt/os.cc
|
||||
Copyright: 2012-2020, Victor Zverovich
|
||||
License: MIT
|
||||
|
||||
Files: lib/include/srslte/common/backward.hpp
|
||||
Files: lib/include/srsran/common/backward.hpp
|
||||
cmake/modules/FindBackward.cmake
|
||||
Copyright: 2013, Google Inc.
|
||||
License: MIT
|
||||
|
@ -63,7 +63,7 @@ License: AGPL-3+
|
|||
GNU Affero General Public License for more details.
|
||||
.
|
||||
On Debian systems, the complete text of the AGPL 3 can be found in
|
||||
/usr/share/doc/srslte/LICENSE
|
||||
/usr/share/doc/srsran/LICENSE
|
||||
|
||||
|
||||
License: LGPL-2.1
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
#
|
||||
# Copyright 2013-2020 Software Radio Systems Limited
|
||||
# Copyright 2013-2021 Software Radio Systems Limited
|
||||
#
|
||||
# By using this file, you agree to the terms and conditions set
|
||||
# forth in the LICENSE file which can be found at the top level of
|
||||
# the distribution.
|
||||
#
|
||||
|
||||
set(CTEST_PROJECT_NAME "srsLTE")
|
||||
set(CTEST_PROJECT_NAME "srsRAN")
|
||||
set(CTEST_NIGHTLY_START_TIME "00:00:00 GMT")
|
||||
set(CTEST_DROP_METHOD "http")
|
||||
set(CTEST_DROP_SITE "my.cdash.org")
|
||||
set(CTEST_DROP_LOCATION "/submit.php?project=srsLTE")
|
||||
set(CTEST_DROP_LOCATION "/submit.php?project=srsRAN")
|
||||
set(CTEST_DROP_SITE_CDASH TRUE)
|
||||
set(VALGRIND_COMMAND_OPTIONS "--error-exitcode=1 --trace-children=yes --leak-check=full --show-reachable=yes --vex-guest-max-insns=25")
|
||||
|
|
36
README.md
36
README.md
|
@ -1,12 +1,12 @@
|
|||
srsLTE
|
||||
srsRAN
|
||||
========
|
||||
|
||||
[![Build Status](https://travis-ci.org/srsLTE/srsLTE.svg?branch=master)](https://travis-ci.org/srsLTE/srsLTE)
|
||||
[![Language grade: C/C++](https://img.shields.io/lgtm/grade/cpp/g/srsLTE/srsLTE.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/srsLTE/srsLTE/context:cpp)
|
||||
[![Coverity](https://scan.coverity.com/projects/10045/badge.svg)](https://scan.coverity.com/projects/srslte)
|
||||
[![Build Status](https://travis-ci.org/srsRAN/srsRAN.svg?branch=master)](https://travis-ci.org/srsRAN/srsRAN)
|
||||
[![Language grade: C/C++](https://img.shields.io/lgtm/grade/cpp/g/srsRAN/srsRAN.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/srsRAN/srsRAN/context:cpp)
|
||||
[![Coverity](https://scan.coverity.com/projects/10045/badge.svg)](https://scan.coverity.com/projects/srsran)
|
||||
|
||||
srsLTE is a 4G/5G software radio suite developed by SRS (www.softwareradiosystems.com)
|
||||
See the srsLTE project pages (www.srslte.com) for documentation, guides and project news.
|
||||
srsRAN is a 4G/5G software radio suite developed by SRS (www.softwareradiosystems.com)
|
||||
See the srsRAN project pages (www.srsran.com) for documentation, guides and project news.
|
||||
|
||||
It includes:
|
||||
* srsUE - a complete SDR LTE UE application featuring all layers from PHY to IP
|
||||
|
@ -85,7 +85,7 @@ srsEPC Features
|
|||
Hardware
|
||||
--------
|
||||
|
||||
srsLTE has native support for the Ettus Universal Hardware Driver (UHD) and the bladeRF driver. We also support SoapySDR.
|
||||
srsRAN has native support for the Ettus Universal Hardware Driver (UHD) and the bladeRF driver. We also support SoapySDR.
|
||||
Thus, any hardware supported by SoapySDR can be used. There is no sampling rate conversion, therefore the hardware should
|
||||
support 30.72 MHz clock in order to work correctly with LTE sampling frequencies and decode signals from live LTE base stations.
|
||||
|
||||
|
@ -130,7 +130,7 @@ For CentOS, use the Fedora packages but replace `libconfig-devel` with just `lib
|
|||
Note that depending on your flavor and version of Linux, the actual package names may be different.
|
||||
|
||||
* Optional requirements:
|
||||
* srsgui: https://github.com/srslte/srsgui - for real-time plotting.
|
||||
* srsgui: https://github.com/srsran/srsgui - for real-time plotting.
|
||||
* libpcsclite-dev: https://pcsclite.apdu.fr/ - for accessing smart card readers
|
||||
* libdw-dev libdw - for truly informative backtraces using backward-cpp
|
||||
|
||||
|
@ -140,10 +140,10 @@ Note that depending on your flavor and version of Linux, the actual package name
|
|||
* BladeRF: https://github.com/Nuand/bladeRF
|
||||
* ZeroMQ: https://github.com/zeromq
|
||||
|
||||
Download and build srsLTE:
|
||||
Download and build srsRAN:
|
||||
```
|
||||
git clone https://github.com/srsLTE/srsLTE.git
|
||||
cd srsLTE
|
||||
git clone https://github.com/srsRAN/srsRAN.git
|
||||
cd srsRAN
|
||||
mkdir build
|
||||
cd build
|
||||
cmake ../
|
||||
|
@ -151,15 +151,15 @@ make
|
|||
make test
|
||||
```
|
||||
|
||||
Install srsLTE:
|
||||
Install srsRAN:
|
||||
|
||||
```
|
||||
sudo make install
|
||||
srslte_install_configs.sh user
|
||||
srsran_install_configs.sh user
|
||||
```
|
||||
|
||||
This installs srsLTE and also copies the default srsLTE config files to
|
||||
the user's home directory (~/.config/srslte).
|
||||
This installs srsRAN and also copies the default srsRAN config files to
|
||||
the user's home directory (~/.config/srsran).
|
||||
|
||||
|
||||
Execution Instructions
|
||||
|
@ -171,7 +171,7 @@ if needed, to meet the system configuration.
|
|||
On many systems they should work out of the box.
|
||||
|
||||
By default, all applications will search for config files in the user's home
|
||||
directory (~/.config/srslte) upon startup.
|
||||
directory (~/.config/srsran) upon startup.
|
||||
|
||||
Note that you have to execute the applications with root privileges to enable
|
||||
real-time thread priorities and to permit creation of virtual network interfaces.
|
||||
|
@ -180,7 +180,7 @@ srsENB and srsEPC can run on the same machine as a network-in-the-box configurat
|
|||
srsUE needs to run on a separate machine.
|
||||
|
||||
If you have installed the software suite using ```sudo make install``` and
|
||||
have installed the example config files using ```srslte_install_configs.sh user```,
|
||||
have installed the example config files using ```srsran_install_configs.sh user```,
|
||||
you may just start all applications with their default parameters.
|
||||
|
||||
### srsEPC
|
||||
|
@ -224,4 +224,4 @@ ping 172.16.0.1
|
|||
Support
|
||||
========
|
||||
|
||||
Mailing list: http://www.softwareradiosystems.com/mailman/listinfo/srslte-users
|
||||
Mailing list: http://www.softwareradiosystems.com/mailman/listinfo/srsran-users
|
||||
|
|
|
@ -4,8 +4,8 @@ rm -rf sysroot && mkdir sysroot
|
|||
cmake -DCMAKE_INSTALL_PREFIX="sysroot/" ../
|
||||
make install
|
||||
this="$(date +%Y-%m-%d_%H_%M_%S)"
|
||||
trialdir="srslte_trial_${this}"
|
||||
tar="srslte.build-${this}.tgz"
|
||||
trialdir="srsran_trial_${this}"
|
||||
tar="srsran.build-${this}.tgz"
|
||||
mkdir ${trialdir}
|
||||
tar czf "${trialdir}/$tar" -C "sysroot" .
|
||||
md5sum "${trialdir}/$tar" >>${trialdir}/checksums.md5
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
*
|
||||
* \section COPYRIGHT
|
||||
*
|
||||
* Copyright 2013-2020 Software Radio Systems Limited
|
||||
* Copyright 2013-2021 Software Radio Systems Limited
|
||||
*
|
||||
* By using this file, you agree to the terms and conditions set
|
||||
* forth in the LICENSE file which can be found at the top level of
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#
|
||||
# Copyright 2013-2020 Software Radio Systems Limited
|
||||
# Copyright 2013-2021 Software Radio Systems Limited
|
||||
#
|
||||
# By using this file, you agree to the terms and conditions set
|
||||
# forth in the LICENSE file which can be found at the top level of
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#
|
||||
# Copyright 2013-2020 Software Radio Systems Limited
|
||||
# Copyright 2013-2021 Software Radio Systems Limited
|
||||
#
|
||||
# By using this file, you agree to the terms and conditions set
|
||||
# forth in the LICENSE file which can be found at the top level of
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#
|
||||
# Copyright 2013-2020 Software Radio Systems Limited
|
||||
# Copyright 2013-2021 Software Radio Systems Limited
|
||||
#
|
||||
# By using this file, you agree to the terms and conditions set
|
||||
# forth in the LICENSE file which can be found at the top level of
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#
|
||||
# Copyright 2013-2020 Software Radio Systems Limited
|
||||
# Copyright 2013-2021 Software Radio Systems Limited
|
||||
#
|
||||
# By using this file, you agree to the terms and conditions set
|
||||
# forth in the LICENSE file which can be found at the top level of
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#
|
||||
# Copyright 2013-2020 Software Radio Systems Limited
|
||||
# Copyright 2013-2021 Software Radio Systems Limited
|
||||
#
|
||||
# By using this file, you agree to the terms and conditions set
|
||||
# forth in the LICENSE file which can be found at the top level of
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#
|
||||
# Copyright 2013-2020 Software Radio Systems Limited
|
||||
# Copyright 2013-2021 Software Radio Systems Limited
|
||||
#
|
||||
# By using this file, you agree to the terms and conditions set
|
||||
# forth in the LICENSE file which can be found at the top level of
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#
|
||||
# Copyright 2013-2020 Software Radio Systems Limited
|
||||
# Copyright 2013-2021 Software Radio Systems Limited
|
||||
#
|
||||
# By using this file, you agree to the terms and conditions set
|
||||
# forth in the LICENSE file which can be found at the top level of
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#
|
||||
# Copyright 2013-2020 Software Radio Systems Limited
|
||||
# Copyright 2013-2021 Software Radio Systems Limited
|
||||
#
|
||||
# By using this file, you agree to the terms and conditions set
|
||||
# forth in the LICENSE file which can be found at the top level of
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#
|
||||
# Copyright 2013-2020 Software Radio Systems Limited
|
||||
# Copyright 2013-2021 Software Radio Systems Limited
|
||||
#
|
||||
# By using this file, you agree to the terms and conditions set
|
||||
# forth in the LICENSE file which can be found at the top level of
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#
|
||||
# Copyright 2013-2020 Software Radio Systems Limited
|
||||
# Copyright 2013-2021 Software Radio Systems Limited
|
||||
#
|
||||
# By using this file, you agree to the terms and conditions set
|
||||
# forth in the LICENSE file which can be found at the top level of
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#
|
||||
# Copyright 2013-2020 Software Radio Systems Limited
|
||||
# Copyright 2013-2021 Software Radio Systems Limited
|
||||
#
|
||||
# By using this file, you agree to the terms and conditions set
|
||||
# forth in the LICENSE file which can be found at the top level of
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#
|
||||
# Copyright 2013-2020 Software Radio Systems Limited
|
||||
# Copyright 2013-2021 Software Radio Systems Limited
|
||||
#
|
||||
# By using this file, you agree to the terms and conditions set
|
||||
# forth in the LICENSE file which can be found at the top level of
|
||||
|
@ -52,7 +52,7 @@ IF(UHD_FOUND)
|
|||
set(CMAKE_REQUIRED_FLAGS "${CMAKE_CXX_FLAGS} -L${UHD_LIBRARY_DIR}")
|
||||
set(CMAKE_REQUIRED_LIBRARIES uhd boost_program_options boost_system)
|
||||
|
||||
# Checks whether the UHD driver supports X300 reset from srsLTE. This functionality requires changing the function
|
||||
# Checks whether the UHD driver supports X300 reset from srsRAN. This functionality requires changing the function
|
||||
# `x300_make_ctrl_iface_enet` visibility in the file `uhd/host/lib/usrp/x300_fw_ctrl.cpp`. This can be accomplished
|
||||
# adding the following line:
|
||||
# `UHD_API wb_iface::sptr x300_make_ctrl_iface_enet(uhd::transport::udp_simple::sptr udp, bool enable_errors);`
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#
|
||||
# Copyright 2013-2020 Software Radio Systems Limited
|
||||
# Copyright 2013-2021 Software Radio Systems Limited
|
||||
#
|
||||
# By using this file, you agree to the terms and conditions set
|
||||
# forth in the LICENSE file which can be found at the top level of
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#
|
||||
# Copyright 2013-2020 Software Radio Systems Limited
|
||||
# Copyright 2013-2021 Software Radio Systems Limited
|
||||
#
|
||||
# By using this file, you agree to the terms and conditions set
|
||||
# forth in the LICENSE file which can be found at the top level of
|
||||
|
|
|
@ -1,13 +0,0 @@
|
|||
#
|
||||
# Copyright 2013-2020 Software Radio Systems Limited
|
||||
#
|
||||
# By using this file, you agree to the terms and conditions set
|
||||
# forth in the LICENSE file which can be found at the top level of
|
||||
# the distribution.
|
||||
#
|
||||
|
||||
SET(SRSLTE_VERSION_MAJOR 20)
|
||||
SET(SRSLTE_VERSION_MINOR 10)
|
||||
SET(SRSLTE_VERSION_PATCH 1)
|
||||
SET(SRSLTE_VERSION_STRING "${SRSLTE_VERSION_MAJOR}.${SRSLTE_VERSION_MINOR}.${SRSLTE_VERSION_PATCH}")
|
||||
SET(SRSLTE_SOVERSION 0)
|
|
@ -1,21 +1,21 @@
|
|||
#
|
||||
# Copyright 2013-2020 Software Radio Systems Limited
|
||||
# Copyright 2013-2021 Software Radio Systems Limited
|
||||
#
|
||||
# By using this file, you agree to the terms and conditions set
|
||||
# forth in the LICENSE file which can be found at the top level of
|
||||
# the distribution.
|
||||
#
|
||||
|
||||
SET(CPACK_PACKAGE_DESCRIPTION "srsLTE")
|
||||
SET(CPACK_PACKAGE_DESCRIPTION "srsRAN")
|
||||
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "LTE library for SDR.")
|
||||
SET(CPACK_PACKAGE_NAME "srslte")
|
||||
SET(CPACK_PACKAGE_NAME "srsran")
|
||||
SET(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6 (>= 2.3.6), libgcc1 (>= 1:4.1), libboost-dev (>= 1.35)")
|
||||
|
||||
SET(CPACK_PACKAGE_CONTACT "Ismael Gomez ")
|
||||
SET(CPACK_PACKAGE_VENDOR "Software Radio Systems Limited")
|
||||
SET(CPACK_PACKAGE_VERSION_MAJOR ${SRSLTE_VERSION_MAJOR})
|
||||
SET(CPACK_PACKAGE_VERSION_MINOR ${SRSLTE_VERSION_MINOR})
|
||||
SET(CPACK_PACKAGE_VERSION_PATCH ${SRSLTE_VERSION_PATCH})
|
||||
SET(CPACK_PACKAGE_VERSION_MAJOR ${SRSRAN_VERSION_MAJOR})
|
||||
SET(CPACK_PACKAGE_VERSION_MINOR ${SRSRAN_VERSION_MINOR})
|
||||
SET(CPACK_PACKAGE_VERSION_PATCH ${SRSRAN_VERSION_PATCH})
|
||||
SET(VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
|
||||
|
||||
########################################################################
|
|
@ -0,0 +1,13 @@
|
|||
#
|
||||
# Copyright 2013-2021 Software Radio Systems Limited
|
||||
#
|
||||
# By using this file, you agree to the terms and conditions set
|
||||
# forth in the LICENSE file which can be found at the top level of
|
||||
# the distribution.
|
||||
#
|
||||
|
||||
SET(SRSRAN_VERSION_MAJOR 20)
|
||||
SET(SRSRAN_VERSION_MINOR 10)
|
||||
SET(SRSRAN_VERSION_PATCH 1)
|
||||
SET(SRSRAN_VERSION_STRING "${SRSRAN_VERSION_MAJOR}.${SRSRAN_VERSION_MINOR}.${SRSRAN_VERSION_PATCH}")
|
||||
SET(SRSRAN_SOVERSION 0)
|
|
@ -8,27 +8,27 @@
|
|||
#
|
||||
|
||||
# Auto-updated by CMake with actual install path
|
||||
SRSLTE_INSTALL_DIR="${CMAKE_INSTALL_PREFIX}/${DATA_DIR}"
|
||||
SRSRAN_INSTALL_DIR="${CMAKE_INSTALL_PREFIX}/${DATA_DIR}"
|
||||
|
||||
# check if install mode has been provided
|
||||
if ([ ! $1 ])
|
||||
then
|
||||
echo "Please call script with either user or service as first parameter."
|
||||
echo ""
|
||||
echo "E.g. ./srslte_install_configs.sh user"
|
||||
echo " .. to install all config files to $HOME/.config/srslte"
|
||||
echo "E.g. ./srsran_install_configs.sh user"
|
||||
echo " .. to install all config files to $HOME/.config/srsran"
|
||||
echo ""
|
||||
echo "E.g. ./srslte_install_configs.sh service"
|
||||
echo " .. to install all config files to /etc/srslte"
|
||||
echo "E.g. ./srsran_install_configs.sh service"
|
||||
echo " .. to install all config files to /etc/srsran"
|
||||
exit
|
||||
fi
|
||||
|
||||
if [ "$1" == "user" ]
|
||||
then
|
||||
dest_folder="$HOME/.config/srslte"
|
||||
dest_folder="$HOME/.config/srsran"
|
||||
elif [ "$1" == "service" ]
|
||||
then
|
||||
dest_folder="/etc/srslte"
|
||||
dest_folder="/etc/srsran"
|
||||
else
|
||||
echo "Please call script with either user or service as first parameter."
|
||||
exit
|
||||
|
@ -54,7 +54,7 @@ fi
|
|||
|
||||
|
||||
install_file(){
|
||||
source_path="$SRSLTE_INSTALL_DIR/$1"
|
||||
source_path="$SRSRAN_INSTALL_DIR/$1"
|
||||
dest_path=$(echo "$dest_folder/$1" | sed 's/\.[^.]*$//') # Strip .example from filename
|
||||
|
||||
# Check if config file already exists in location
|
||||
|
@ -88,12 +88,12 @@ install_file(){
|
|||
return
|
||||
}
|
||||
|
||||
# Install all srsLTE config files
|
||||
echo "Installing srsLTE configuration files:"
|
||||
# Install all srsRAN config files
|
||||
echo "Installing srsRAN configuration files:"
|
||||
|
||||
# Make sure the target directory exists
|
||||
if [ ! -d "$dest_folder" ]; then
|
||||
echo " - Creating srsLTE config folder $dest_folder"
|
||||
echo " - Creating srsRAN config folder $dest_folder"
|
||||
mkdir -p $dest_folder
|
||||
if [ $? -ne 0 ]; then
|
||||
exit
|
|
@ -16,6 +16,6 @@ OUTPUT_STRIP_TRAILING_WHITESPACE
|
|||
|
||||
message(STATUS "Generating build_info.h")
|
||||
configure_file(
|
||||
@PROJECT_SOURCE_DIR@/lib/include/srslte/build_info.h.in
|
||||
@CMAKE_BINARY_DIR@/lib/include/srslte/build_info.h
|
||||
@PROJECT_SOURCE_DIR@/lib/include/srsran/build_info.h.in
|
||||
@CMAKE_BINARY_DIR@/lib/include/srsran/build_info.h
|
||||
)
|
|
@ -1,7 +1,7 @@
|
|||
Source: srslte
|
||||
Source: srsran
|
||||
Section: universe/misc
|
||||
Priority: optional
|
||||
Maintainer: srsLTE Packagers <packagers@softwareradiosystems.com>
|
||||
Maintainer: srsRAN Packagers <packagers@softwareradiosystems.com>
|
||||
Build-Depends:
|
||||
debhelper (>= 9),
|
||||
dh-exec,
|
||||
|
@ -17,25 +17,25 @@ Build-Depends:
|
|||
txt2man
|
||||
Standards-Version: 4.2.1
|
||||
Homepage: http://www.softwareradiosystems.com
|
||||
Vcs-Git: https://github.com/srsLTE/srsLTE.git
|
||||
Vcs-Browser: https://github.com/srsLTE/srsLTE/
|
||||
Vcs-Git: https://github.com/srsRAN/srsRAN.git
|
||||
Vcs-Browser: https://github.com/srsRAN/srsRAN/
|
||||
|
||||
Package: srslte-dev
|
||||
Package: srsran-dev
|
||||
Architecture: any
|
||||
Multi-Arch: same
|
||||
Section: libdevel
|
||||
Depends: ${shlibs:Depends},
|
||||
${misc:Depends},
|
||||
srslte-core:any (= ${binary:Version})
|
||||
srsran-core:any (= ${binary:Version})
|
||||
Breaks: srslte (<= 19.03-0ubuntu1)
|
||||
Replaces: srslte (<= 19.03-0ubuntu1)
|
||||
Description: Static libraries and headers for srslte
|
||||
This software allows you to run a full end-to-end, open-source LTE system.
|
||||
Description: Static libraries and headers for srsran
|
||||
This software allows you to run a full end-to-end, open-source 4G/5G system.
|
||||
It contains a UE, eNB and EPC implementation.
|
||||
.
|
||||
This package contains the development files - static libraries and headers
|
||||
|
||||
Package: srslte
|
||||
Package: srsran
|
||||
Architecture: all
|
||||
Depends: ${shlibs:Depends},
|
||||
${misc:Depends},
|
||||
|
@ -46,13 +46,13 @@ Description: LTE software suite for software defined radios (metapackage)
|
|||
This software allows you to run a full end-to-end, open-source LTE system.
|
||||
It contains a UE, eNB and EPC implementation.
|
||||
.
|
||||
This package installs all srsLTE components.
|
||||
This package installs all srsRAN components.
|
||||
|
||||
Package: srsenb
|
||||
Architecture: any
|
||||
Depends: ${shlibs:Depends},
|
||||
${misc:Depends},
|
||||
srslte-core (= ${binary:Version})
|
||||
srsran-core (= ${binary:Version})
|
||||
Breaks: srslte (<= 19.03-0ubuntu1)
|
||||
Replaces: srslte (<= 19.03-0ubuntu1)
|
||||
Description: Complete SDR LTE eNodeB application
|
||||
|
@ -66,25 +66,25 @@ Package: srsepc
|
|||
Architecture: any
|
||||
Depends: ${shlibs:Depends},
|
||||
${misc:Depends},
|
||||
srslte-core (= ${binary:Version})
|
||||
srsran-core (= ${binary:Version})
|
||||
Recommends: srsenb
|
||||
Breaks: srslte (<= 19.03-0ubuntu1)
|
||||
Replaces: srslte (<= 19.03-0ubuntu1)
|
||||
Breaks: srsepc (<= 19.03-0ubuntu1)
|
||||
Replaces: srsepc (<= 19.03-0ubuntu1)
|
||||
Description: Light-weight LTE core network implementation
|
||||
This software allows you to run a full end-to-end, open-source LTE system.
|
||||
It contains a UE, eNB and EPC implementation.
|
||||
.
|
||||
This package contains a light-weight LTE core network implementation with MME, HSS and S/P-GW.
|
||||
|
||||
Package: srslte-core
|
||||
Package: srsran-core
|
||||
Architecture: any
|
||||
Multi-Arch: allowed
|
||||
Depends: ${shlibs:Depends},
|
||||
${misc:Depends}
|
||||
Breaks: srslte (<= 19.03-0ubuntu1)
|
||||
Replaces: srslte (<= 19.03-0ubuntu1)
|
||||
Description: Common files for srsLTE
|
||||
This software allows you to run a full end-to-end, open-source LTE system.
|
||||
Breaks: srslte-core (<= 19.03-0ubuntu1)
|
||||
Replaces: srslte-core (<= 19.03-0ubuntu1)
|
||||
Description: Common files for srsRAN
|
||||
This software allows you to run a full end-to-end, open-source 4G/5G system.
|
||||
It contains a UE, eNB and EPC implementation.
|
||||
.
|
||||
This package contains the common files for srsenb, srsue and srsepc.
|
||||
|
@ -93,9 +93,9 @@ Package: srsue
|
|||
Architecture: any
|
||||
Depends: ${shlibs:Depends},
|
||||
${misc:Depends},
|
||||
srslte-core (= ${binary:Version})
|
||||
Breaks: srslte (<= 19.03-0ubuntu1)
|
||||
Replaces: srslte (<= 19.03-0ubuntu1)
|
||||
srsran-core (= ${binary:Version})
|
||||
Breaks: srsue (<= 19.03-0ubuntu1)
|
||||
Replaces: srsue (<= 19.03-0ubuntu1)
|
||||
Description: User Equipment implementation for LTE
|
||||
This software enables using a software defined radio as the user equipment
|
||||
connecting to an LTE network.
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
|
||||
Upstream-Name: srsLTE
|
||||
Upstream-Contact: srsLTE packaging team <support@softwareradiosystems.com>
|
||||
Upstream-Name: srsRAN
|
||||
Upstream-Contact: srsRAN packaging team <support@softwareradiosystems.com>
|
||||
License: AGPL-3+
|
||||
Copyright: 2013-2020, Software Radio Systems Limited.
|
||||
Source: https://www.github.com/srsLTE
|
||||
Copyright: 2013-2021, Software Radio Systems Limited.
|
||||
Source: https://www.github.com/srsRAN
|
||||
|
||||
Files: *
|
||||
Copyright: 2013-2020, Software Radio Systems Limited.
|
||||
Copyright: 2013-2021, Software Radio Systems Limited.
|
||||
License: AGPL-3+
|
||||
|
||||
|
||||
The following files are used within srsLTE:
|
||||
The following files are used within srsRAN:
|
||||
|
||||
Files: lib/src/phy/fec/viterbi37_port.c
|
||||
lib/src/phy/fec/viterbi37_sse.c
|
||||
|
@ -26,34 +26,34 @@ Files: srsue/src/upper/pcsc_usim.cc
|
|||
Copyright: 2002-2014, Jouni Malinen <j@w1.fi>
|
||||
License: BSD-3-clause
|
||||
|
||||
Files: lib/include/srslte/asn1/liblte_common.h
|
||||
lib/include/srslte/asn1/liblte_mme.h
|
||||
lib/include/srslte/common/liblte_security.h
|
||||
Files: lib/include/srsran/asn1/liblte_common.h
|
||||
lib/include/srsran/asn1/liblte_mme.h
|
||||
lib/include/srsran/common/liblte_security.h
|
||||
lib/src/asn1/liblte_common.cc
|
||||
lib/src/asn1/liblte_mme.cc
|
||||
lib/src/common/liblte_security.cc
|
||||
Copyright: 2012-2014 Ben Wojtowicz
|
||||
License: AGPL-3+
|
||||
|
||||
Files: lib/include/srslte/srslog/bundled/fmt/chrono.h
|
||||
lib/include/srslte/srslog/bundled/fmt/color.h
|
||||
lib/include/srslte/srslog/bundled/fmt/compile.h
|
||||
lib/include/srslte/srslog/bundled/fmt/core.h
|
||||
lib/include/srslte/srslog/bundled/fmt/format.h
|
||||
lib/include/srslte/srslog/bundled/fmt/format-inl.h
|
||||
lib/include/srslte/srslog/bundled/fmt/LICENSE.rst
|
||||
lib/include/srslte/srslog/bundled/fmt/locale.h
|
||||
lib/include/srslte/srslog/bundled/fmt/os.h
|
||||
lib/include/srslte/srslog/bundled/fmt/ostream.h
|
||||
lib/include/srslte/srslog/bundled/fmt/posix.h
|
||||
lib/include/srslte/srslog/bundled/fmt/printf.h
|
||||
lib/include/srslte/srslog/bundled/fmt/ranges.h
|
||||
lib/src/srslog/bundled/fmt/format.cc
|
||||
lib/src/srslog/bundled/fmt/os.cc
|
||||
Files: lib/include/srsran/srslog/bundled/fmt/chrono.h
|
||||
lib/include/srsran/srslog/bundled/fmt/color.h
|
||||
lib/include/srsran/srslog/bundled/fmt/compile.h
|
||||
lib/include/srsran/srslog/bundled/fmt/core.h
|
||||
lib/include/srsran/srslog/bundled/fmt/format.h
|
||||
lib/include/srsran/srslog/bundled/fmt/format-inl.h
|
||||
lib/include/srsran/srslog/bundled/fmt/LICENSE.rst
|
||||
lib/include/srsran/srslog/bundled/fmt/locale.h
|
||||
lib/include/srsran/srslog/bundled/fmt/os.h
|
||||
lib/include/srsran/srslog/bundled/fmt/ostream.h
|
||||
lib/include/srsran/srslog/bundled/fmt/posix.h
|
||||
lib/include/srsran/srslog/bundled/fmt/printf.h
|
||||
lib/include/srsran/srslog/bundled/fmt/ranges.h
|
||||
lib/src/srsran/bundled/fmt/format.cc
|
||||
lib/src/srsran/bundled/fmt/os.cc
|
||||
Copyright: 2012-2020, Victor Zverovich
|
||||
License: MIT
|
||||
|
||||
Files: lib/include/srslte/common/backward.hpp
|
||||
Files: lib/include/srsran/common/backward.hpp
|
||||
cmake/modules/FindBackward.cmake
|
||||
Copyright: 2013, Google Inc.
|
||||
License: MIT
|
||||
|
@ -71,7 +71,7 @@ License: AGPL-3+
|
|||
GNU Affero General Public License for more details.
|
||||
.
|
||||
On Debian systems, the complete text of the AGPL 3 can be found in
|
||||
/usr/share/doc/srslte/LICENSE
|
||||
/usr/share/doc/srsran/LICENSE
|
||||
|
||||
|
||||
License: LGPL-2.1
|
||||
|
|
|
@ -18,7 +18,7 @@ DESCRIPTION
|
|||
- 75 Mbps DL in SISO configuration with commercial UEs
|
||||
- 50 Mbps UL in 20 MHz with commercial UEs
|
||||
|
||||
An example configuration file is available in /usr/share/srslte/enb.conf.example
|
||||
An example configuration file is available in /usr/share/srsran/enb.conf.example
|
||||
|
||||
OPTIONS
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ DESCRIPTION
|
|||
- S/P-GW with standard SGi exposed as virtual network interface (TUN device)
|
||||
- HSS (Home Subscriber Server) with configurable user database in CSV format
|
||||
|
||||
An example configuration file is available in /usr/share/srslte/epc.conf.example
|
||||
An example configuration file is available in /usr/share/srsran/epc.conf.example
|
||||
|
||||
OPTIONS
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ DESCRIPTION
|
|||
- 75 Mbps DL in 20 MHz SISO configuration in i7 Quad-Core CPU.
|
||||
- 36 Mbps DL in 10 MHz SISO configuration in i5 Dual-Core CPU.
|
||||
|
||||
An example configuration file is available in /usr/share/srslte/ue.conf.example
|
||||
An example configuration file is available in /usr/share/srsran/ue.conf.example
|
||||
|
||||
OPTIONS
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
# Copyright 2013-2020 Software Radio Systems Limited
|
||||
# Copyright 2013-2021 Software Radio Systems Limited
|
||||
#
|
||||
# By using this file, you agree to the terms and conditions set
|
||||
# forth in the LICENSE file which can be found at the top level of
|
||||
|
@ -12,21 +12,21 @@ DISTRO=disco
|
|||
COMMIT=eda7ca69a09933526e9318bcf553af0dc0b81598
|
||||
REL_FLAG=releases
|
||||
|
||||
echo 'Packaging srsLTE release' $RELEASE 'for Ubuntu' $DISTRO
|
||||
echo 'Packaging srsRAN release' $RELEASE 'for Ubuntu' $DISTRO
|
||||
|
||||
# Make build dir for the package
|
||||
BUILD_DIR=~/build-area/srslte_$RELEASE/$REL_FLAG/$DISTRO
|
||||
BUILD_DIR=~/build-area/srsran_$RELEASE/$REL_FLAG/$DISTRO
|
||||
mkdir -p $BUILD_DIR
|
||||
|
||||
# Make tarball of the package source
|
||||
pushd ~/srsLTE
|
||||
git archive $COMMIT -o $BUILD_DIR/srslte_$DISTRO.tar.gz
|
||||
pushd ~/srsRAN
|
||||
git archive $COMMIT -o $BUILD_DIR/srsran_$DISTRO.tar.gz
|
||||
popd
|
||||
|
||||
# Copy original tarball
|
||||
cp ~/build-area/srslte_$RELEASE/$REL_FLAG/srslte_$RELEASE.orig.tar.gz $BUILD_DIR
|
||||
cp ~/build-area/srsran_$RELEASE/$REL_FLAG/srsran_$RELEASE.orig.tar.gz $BUILD_DIR
|
||||
|
||||
mkdir $BUILD_DIR/srsLTE
|
||||
pushd $BUILD_DIR/srsLTE
|
||||
tar -vxzf ../srslte_$DISTRO.tar.gz
|
||||
mkdir $BUILD_DIR/srsRAN
|
||||
pushd $BUILD_DIR/srsRAN
|
||||
tar -vxzf ../srsran_$DISTRO.tar.gz
|
||||
popd
|
||||
|
|
|
@ -4,7 +4,7 @@ Description=Software Radio System's LTE eNB implementation
|
|||
[Service]
|
||||
Type=simple
|
||||
Restart=always
|
||||
ExecStart=/usr/bin/srsenb /etc/srslte/enb.conf
|
||||
ExecStart=/usr/bin/srsenb /etc/srsran/enb.conf
|
||||
RestartSec=2
|
||||
|
||||
[Install]
|
||||
|
|
|
@ -4,7 +4,7 @@ Description=Software Radio System's light-weight EPC implementation
|
|||
[Service]
|
||||
Type=simple
|
||||
Restart=always
|
||||
ExecStart=/usr/bin/srsepc /etc/srslte/epc.conf
|
||||
ExecStart=/usr/bin/srsepc /etc/srsran/epc.conf
|
||||
RestartSec=2
|
||||
|
||||
[Install]
|
||||
|
|
|
@ -7,7 +7,7 @@ set -e
|
|||
. /usr/share/debconf/confmodule
|
||||
|
||||
# Ask questions
|
||||
db_input low srslte/install_configs_question || true
|
||||
db_input low srsran/install_configs_question || true
|
||||
|
||||
# Show interface
|
||||
db_go || true
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
usr/lib/*/libsrslte_rf.so*
|
||||
usr/share/srslte
|
||||
usr/bin/srslte_install_configs.sh
|
||||
usr/lib/*/libsrsran_rf.so*
|
||||
usr/share/srsran
|
||||
usr/bin/srsran_install_configs.sh
|
||||
|
|
|
@ -4,11 +4,11 @@
|
|||
. /usr/share/debconf/confmodule
|
||||
|
||||
# Fetching configuration from debconf
|
||||
db_get srslte/install_configs_question
|
||||
db_get srsran/install_configs_question
|
||||
ANSWER1=$RET
|
||||
|
||||
if [ $ANSWER1 == "true" ]; then
|
||||
srslte_install_configs.sh user
|
||||
srsran_install_configs.sh user
|
||||
fi
|
||||
|
||||
#DEBHELPER#
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
Template: srslte/install_configs_question
|
||||
Template: srsran/install_configs_question
|
||||
Type: boolean
|
||||
Default: true
|
||||
Description: Install configs?
|
||||
This installs the default srsLTE configuration files to the user's
|
||||
home directory (~/.config/srslte) but keeps any existing config files.
|
||||
This installs the default srsRAN configuration files to the user's
|
||||
home directory (~/.config/srsran) but keeps any existing config files.
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
usr/lib/*/*.a
|
||||
usr/include/srslte
|
||||
usr/include/srsran
|
||||
|
|
|
@ -4,7 +4,7 @@ Description=Software Radio Systems's LTE UE implementation
|
|||
[Service]
|
||||
Type=simple
|
||||
Restart=always
|
||||
ExecStart=/usr/bin/srsue /etc/srslte/ue.conf
|
||||
ExecStart=/usr/bin/srsue /etc/srsran/ue.conf
|
||||
RestartSec=2
|
||||
|
||||
[Install]
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#
|
||||
# Copyright 2013-2020 Software Radio Systems Limited
|
||||
# Copyright 2013-2021 Software Radio Systems Limited
|
||||
#
|
||||
# By using this file, you agree to the terms and conditions set
|
||||
# forth in the LICENSE file which can be found at the top level of
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#
|
||||
# Copyright 2013-2020 Software Radio Systems Limited
|
||||
# Copyright 2013-2021 Software Radio Systems Limited
|
||||
#
|
||||
# By using this file, you agree to the terms and conditions set
|
||||
# forth in the LICENSE file which can be found at the top level of
|
||||
|
@ -11,7 +11,7 @@
|
|||
#################################################################
|
||||
|
||||
add_executable(synch_file synch_file.c)
|
||||
target_link_libraries(synch_file srslte_phy)
|
||||
target_link_libraries(synch_file srsran_phy)
|
||||
|
||||
#################################################################
|
||||
# These can be compiled without UHD or graphics support
|
||||
|
@ -19,30 +19,30 @@ target_link_libraries(synch_file srslte_phy)
|
|||
|
||||
if(RF_FOUND)
|
||||
add_executable(pdsch_ue pdsch_ue.c)
|
||||
target_link_libraries(pdsch_ue srslte_phy srslte_common srslte_rf pthread)
|
||||
target_link_libraries(pdsch_ue srsran_phy srsran_common srsran_rf pthread)
|
||||
|
||||
add_executable(pdsch_enodeb pdsch_enodeb.c)
|
||||
target_link_libraries(pdsch_enodeb srslte_phy srslte_common srslte_rf pthread)
|
||||
target_link_libraries(pdsch_enodeb srsran_phy srsran_common srsran_rf pthread)
|
||||
|
||||
add_executable(npdsch_enodeb npdsch_enodeb.c)
|
||||
target_link_libraries(npdsch_enodeb srslte_phy srslte_rf pthread)
|
||||
target_link_libraries(npdsch_enodeb srsran_phy srsran_rf pthread)
|
||||
|
||||
add_executable(npdsch_ue npdsch_ue.c npdsch_ue_helper.cc)
|
||||
target_link_libraries(npdsch_ue srslte_common srslte_phy srslte_rf pthread rrc_asn1)
|
||||
target_link_libraries(npdsch_ue srsran_common srsran_phy srsran_rf pthread rrc_asn1)
|
||||
else(RF_FOUND)
|
||||
add_definitions(-DDISABLE_RF)
|
||||
|
||||
add_executable(pdsch_ue pdsch_ue.c)
|
||||
target_link_libraries(pdsch_ue srslte_common srslte_phy pthread)
|
||||
target_link_libraries(pdsch_ue srsran_common srsran_phy pthread)
|
||||
|
||||
add_executable(pdsch_enodeb pdsch_enodeb.c)
|
||||
target_link_libraries(pdsch_enodeb srslte_common srslte_phy pthread)
|
||||
target_link_libraries(pdsch_enodeb srsran_common srsran_phy pthread)
|
||||
|
||||
add_executable(npdsch_enodeb npdsch_enodeb.c)
|
||||
target_link_libraries(npdsch_enodeb srslte_phy pthread)
|
||||
target_link_libraries(npdsch_enodeb srsran_phy pthread)
|
||||
|
||||
add_executable(npdsch_ue npdsch_ue.c npdsch_ue_helper.cc)
|
||||
target_link_libraries(npdsch_ue srslte_common srslte_phy pthread rrc_asn1)
|
||||
target_link_libraries(npdsch_ue srsran_common srsran_phy pthread rrc_asn1)
|
||||
endif(RF_FOUND)
|
||||
|
||||
if(SRSGUI_FOUND)
|
||||
|
@ -54,7 +54,7 @@ endif(SRSGUI_FOUND)
|
|||
|
||||
if (ZEROMQ_FOUND)
|
||||
add_executable(zmq_remote_rx zmq_remote_rx.c)
|
||||
target_link_libraries(zmq_remote_rx srslte_phy srslte_rf)
|
||||
target_link_libraries(zmq_remote_rx srsran_phy srsran_rf)
|
||||
endif (ZEROMQ_FOUND)
|
||||
|
||||
#################################################################
|
||||
|
@ -64,25 +64,25 @@ endif (ZEROMQ_FOUND)
|
|||
if(RF_FOUND)
|
||||
|
||||
add_executable(cell_search cell_search.c)
|
||||
target_link_libraries(cell_search srslte_phy srslte_common srslte_rf)
|
||||
target_link_libraries(cell_search srsran_phy srsran_common srsran_rf)
|
||||
|
||||
add_executable(usrp_capture usrp_capture.c)
|
||||
target_link_libraries(usrp_capture srslte_phy srslte_rf)
|
||||
target_link_libraries(usrp_capture srsran_phy srsran_rf)
|
||||
|
||||
add_executable(usrp_capture_sync usrp_capture_sync.c)
|
||||
target_link_libraries(usrp_capture_sync srslte_phy srslte_rf)
|
||||
target_link_libraries(usrp_capture_sync srsran_phy srsran_rf)
|
||||
|
||||
add_executable(usrp_capture_sync_nbiot usrp_capture_sync_nbiot.c)
|
||||
target_link_libraries(usrp_capture_sync_nbiot srslte_rf srslte_phy)
|
||||
target_link_libraries(usrp_capture_sync_nbiot srsran_rf srsran_phy)
|
||||
|
||||
add_executable(cell_search_nbiot cell_search_nbiot.c)
|
||||
target_link_libraries(cell_search_nbiot srslte_rf srslte_phy)
|
||||
target_link_libraries(cell_search_nbiot srsran_rf srsran_phy)
|
||||
|
||||
add_executable(usrp_txrx usrp_txrx.c)
|
||||
target_link_libraries(usrp_txrx srslte_phy srslte_rf)
|
||||
target_link_libraries(usrp_txrx srsran_phy srsran_rf)
|
||||
|
||||
add_executable(pssch_ue pssch_ue.c)
|
||||
target_link_libraries(pssch_ue srslte_phy srslte_common srslte_rf pthread)
|
||||
target_link_libraries(pssch_ue srsran_phy srsran_common srsran_rf pthread)
|
||||
|
||||
if(SRSGUI_FOUND)
|
||||
target_link_libraries(pssch_ue ${SRSGUI_LIBRARIES})
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
*
|
||||
* \section COPYRIGHT
|
||||
*
|
||||
* Copyright 2013-2020 Software Radio Systems Limited
|
||||
* Copyright 2013-2021 Software Radio Systems Limited
|
||||
*
|
||||
* By using this file, you agree to the terms and conditions set
|
||||
* forth in the LICENSE file which can be found at the top level of
|
||||
|
@ -21,13 +21,13 @@
|
|||
|
||||
#include <unistd.h>
|
||||
|
||||
#include "srslte/srslte.h"
|
||||
#include "srsran/srsran.h"
|
||||
|
||||
#include "srslte/common/crash_handler.h"
|
||||
#include "srslte/phy/rf/rf_utils.h"
|
||||
#include "srsran/common/crash_handler.h"
|
||||
#include "srsran/phy/rf/rf_utils.h"
|
||||
|
||||
#ifndef DISABLE_RF
|
||||
#include "srslte/phy/rf/rf.h"
|
||||
#include "srsran/phy/rf/rf.h"
|
||||
#endif
|
||||
|
||||
#define MHZ 1000000
|
||||
|
@ -40,14 +40,14 @@
|
|||
int band = -1;
|
||||
int earfcn_start = -1, earfcn_end = -1;
|
||||
|
||||
cell_search_cfg_t cell_detect_config = {.max_frames_pbch = SRSLTE_DEFAULT_MAX_FRAMES_PBCH,
|
||||
.max_frames_pss = SRSLTE_DEFAULT_MAX_FRAMES_PSS,
|
||||
.nof_valid_pss_frames = SRSLTE_DEFAULT_NOF_VALID_PSS_FRAMES,
|
||||
cell_search_cfg_t cell_detect_config = {.max_frames_pbch = SRSRAN_DEFAULT_MAX_FRAMES_PBCH,
|
||||
.max_frames_pss = SRSRAN_DEFAULT_MAX_FRAMES_PSS,
|
||||
.nof_valid_pss_frames = SRSRAN_DEFAULT_NOF_VALID_PSS_FRAMES,
|
||||
.init_agc = 0,
|
||||
.force_tdd = false};
|
||||
|
||||
struct cells {
|
||||
srslte_cell_t cell;
|
||||
srsran_cell_t cell;
|
||||
float freq;
|
||||
int dl_earfcn;
|
||||
float power;
|
||||
|
@ -65,7 +65,7 @@ void usage(char* prog)
|
|||
printf("\t-s earfcn_start [Default All]\n");
|
||||
printf("\t-e earfcn_end [Default All]\n");
|
||||
printf("\t-n nof_frames_total [Default 100]\n");
|
||||
printf("\t-v [set srslte_verbose to debug, default none]\n");
|
||||
printf("\t-v [set srsran_verbose to debug, default none]\n");
|
||||
}
|
||||
|
||||
void parse_args(int argc, char** argv)
|
||||
|
@ -92,7 +92,7 @@ void parse_args(int argc, char** argv)
|
|||
rf_gain = strtof(argv[optind], NULL);
|
||||
break;
|
||||
case 'v':
|
||||
srslte_verbose++;
|
||||
srsran_verbose++;
|
||||
break;
|
||||
default:
|
||||
usage(argv[0]);
|
||||
|
@ -105,10 +105,10 @@ void parse_args(int argc, char** argv)
|
|||
}
|
||||
}
|
||||
|
||||
int srslte_rf_recv_wrapper(void* h, void* data, uint32_t nsamples, srslte_timestamp_t* t)
|
||||
int srsran_rf_recv_wrapper(void* h, void* data, uint32_t nsamples, srsran_timestamp_t* t)
|
||||
{
|
||||
DEBUG(" ---- Receive %d samples ---- ", nsamples);
|
||||
return srslte_rf_recv_with_time((srslte_rf_t*)h, data, nsamples, 1, NULL, NULL);
|
||||
return srsran_rf_recv_with_time((srsran_rf_t*)h, data, nsamples, 1, NULL, NULL);
|
||||
}
|
||||
|
||||
bool go_exit = false;
|
||||
|
@ -121,46 +121,46 @@ void sig_int_handler(int signo)
|
|||
}
|
||||
}
|
||||
|
||||
static SRSLTE_AGC_CALLBACK(srslte_rf_set_rx_gain_wrapper)
|
||||
static SRSRAN_AGC_CALLBACK(srsran_rf_set_rx_gain_wrapper)
|
||||
{
|
||||
srslte_rf_set_rx_gain((srslte_rf_t*)h, gain_db);
|
||||
srsran_rf_set_rx_gain((srsran_rf_t*)h, gain_db);
|
||||
}
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
int n;
|
||||
srslte_rf_t rf;
|
||||
srslte_ue_cellsearch_t cs;
|
||||
srslte_ue_cellsearch_result_t found_cells[3];
|
||||
srsran_rf_t rf;
|
||||
srsran_ue_cellsearch_t cs;
|
||||
srsran_ue_cellsearch_result_t found_cells[3];
|
||||
int nof_freqs;
|
||||
srslte_earfcn_t channels[MAX_EARFCN];
|
||||
srsran_earfcn_t channels[MAX_EARFCN];
|
||||
uint32_t freq;
|
||||
uint32_t n_found_cells = 0;
|
||||
|
||||
srslte_debug_handle_crash(argc, argv);
|
||||
srsran_debug_handle_crash(argc, argv);
|
||||
|
||||
parse_args(argc, argv);
|
||||
|
||||
printf("Opening RF device...\n");
|
||||
if (srslte_rf_open(&rf, rf_args)) {
|
||||
if (srsran_rf_open(&rf, rf_args)) {
|
||||
ERROR("Error opening rf");
|
||||
exit(-1);
|
||||
}
|
||||
if (!cell_detect_config.init_agc) {
|
||||
srslte_rf_set_rx_gain(&rf, rf_gain);
|
||||
srsran_rf_set_rx_gain(&rf, rf_gain);
|
||||
} else {
|
||||
printf("Starting AGC thread...\n");
|
||||
if (srslte_rf_start_gain_thread(&rf, false)) {
|
||||
if (srsran_rf_start_gain_thread(&rf, false)) {
|
||||
ERROR("Error opening rf");
|
||||
exit(-1);
|
||||
}
|
||||
srslte_rf_set_rx_gain(&rf, 50);
|
||||
srsran_rf_set_rx_gain(&rf, 50);
|
||||
}
|
||||
|
||||
// Supress RF messages
|
||||
srslte_rf_suppress_stdout(&rf);
|
||||
srsran_rf_suppress_stdout(&rf);
|
||||
|
||||
nof_freqs = srslte_band_get_fd_band(band, channels, earfcn_start, earfcn_end, MAX_EARFCN);
|
||||
nof_freqs = srsran_band_get_fd_band(band, channels, earfcn_start, earfcn_end, MAX_EARFCN);
|
||||
if (nof_freqs < 0) {
|
||||
ERROR("Error getting EARFCN list");
|
||||
exit(-1);
|
||||
|
@ -172,18 +172,18 @@ int main(int argc, char** argv)
|
|||
sigprocmask(SIG_UNBLOCK, &sigset, NULL);
|
||||
signal(SIGINT, sig_int_handler);
|
||||
|
||||
if (srslte_ue_cellsearch_init(&cs, cell_detect_config.max_frames_pss, srslte_rf_recv_wrapper, (void*)&rf)) {
|
||||
if (srsran_ue_cellsearch_init(&cs, cell_detect_config.max_frames_pss, srsran_rf_recv_wrapper, (void*)&rf)) {
|
||||
ERROR("Error initiating UE cell detect");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
if (cell_detect_config.max_frames_pss) {
|
||||
srslte_ue_cellsearch_set_nof_valid_frames(&cs, cell_detect_config.nof_valid_pss_frames);
|
||||
srsran_ue_cellsearch_set_nof_valid_frames(&cs, cell_detect_config.nof_valid_pss_frames);
|
||||
}
|
||||
if (cell_detect_config.init_agc) {
|
||||
srslte_rf_info_t* rf_info = srslte_rf_get_info(&rf);
|
||||
srslte_ue_sync_start_agc(&cs.ue_sync,
|
||||
srslte_rf_set_rx_gain_wrapper,
|
||||
srsran_rf_info_t* rf_info = srsran_rf_get_info(&rf);
|
||||
srsran_ue_sync_start_agc(&cs.ue_sync,
|
||||
srsran_rf_set_rx_gain_wrapper,
|
||||
rf_info->min_rx_gain,
|
||||
rf_info->max_rx_gain,
|
||||
cell_detect_config.init_agc);
|
||||
|
@ -191,32 +191,32 @@ int main(int argc, char** argv)
|
|||
|
||||
for (freq = 0; freq < nof_freqs && !go_exit; freq++) {
|
||||
/* set rf_freq */
|
||||
srslte_rf_set_rx_freq(&rf, 0, (double)channels[freq].fd * MHZ);
|
||||
srsran_rf_set_rx_freq(&rf, 0, (double)channels[freq].fd * MHZ);
|
||||
INFO("Set rf_freq to %.3f MHz", (double)channels[freq].fd * MHZ / 1000000);
|
||||
|
||||
printf(
|
||||
"[%3d/%d]: EARFCN %d Freq. %.2f MHz looking for PSS.\n", freq, nof_freqs, channels[freq].id, channels[freq].fd);
|
||||
fflush(stdout);
|
||||
|
||||
if (SRSLTE_VERBOSE_ISINFO()) {
|
||||
if (SRSRAN_VERBOSE_ISINFO()) {
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
bzero(found_cells, 3 * sizeof(srslte_ue_cellsearch_result_t));
|
||||
bzero(found_cells, 3 * sizeof(srsran_ue_cellsearch_result_t));
|
||||
|
||||
INFO("Setting sampling frequency %.2f MHz for PSS search", SRSLTE_CS_SAMP_FREQ / 1000000);
|
||||
srslte_rf_set_rx_srate(&rf, SRSLTE_CS_SAMP_FREQ);
|
||||
INFO("Setting sampling frequency %.2f MHz for PSS search", SRSRAN_CS_SAMP_FREQ / 1000000);
|
||||
srsran_rf_set_rx_srate(&rf, SRSRAN_CS_SAMP_FREQ);
|
||||
INFO("Starting receiver...");
|
||||
srslte_rf_start_rx_stream(&rf, false);
|
||||
srsran_rf_start_rx_stream(&rf, false);
|
||||
|
||||
n = srslte_ue_cellsearch_scan(&cs, found_cells, NULL);
|
||||
n = srsran_ue_cellsearch_scan(&cs, found_cells, NULL);
|
||||
if (n < 0) {
|
||||
ERROR("Error searching cell");
|
||||
exit(-1);
|
||||
} else if (n > 0) {
|
||||
for (int i = 0; i < 3; i++) {
|
||||
if (found_cells[i].psr > 2.0) {
|
||||
srslte_cell_t cell;
|
||||
srsran_cell_t cell;
|
||||
cell.id = found_cells[i].cell_id;
|
||||
cell.cp = found_cells[i].cp;
|
||||
int ret = rf_mib_decoder(&rf, 1, &cell_detect_config, &cell, NULL);
|
||||
|
@ -224,7 +224,7 @@ int main(int argc, char** argv)
|
|||
ERROR("Error decoding MIB");
|
||||
exit(-1);
|
||||
}
|
||||
if (ret == SRSLTE_UE_MIB_FOUND) {
|
||||
if (ret == SRSRAN_UE_MIB_FOUND) {
|
||||
printf("Found CELL ID %d. %d PRB, %d ports\n", cell.id, cell.nof_prb, cell.nof_ports);
|
||||
if (cell.nof_ports > 0) {
|
||||
results[n_found_cells].cell = cell;
|
||||
|
@ -247,12 +247,12 @@ int main(int argc, char** argv)
|
|||
results[i].cell.id,
|
||||
results[i].cell.nof_prb,
|
||||
results[i].cell.nof_ports,
|
||||
srslte_convert_power_to_dB(results[i].power));
|
||||
srsran_convert_power_to_dB(results[i].power));
|
||||
}
|
||||
|
||||
printf("\nBye\n");
|
||||
|
||||
srslte_ue_cellsearch_free(&cs);
|
||||
srslte_rf_close(&rf);
|
||||
srsran_ue_cellsearch_free(&cs);
|
||||
srsran_rf_close(&rf);
|
||||
exit(0);
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
*
|
||||
* \section COPYRIGHT
|
||||
*
|
||||
* Copyright 2013-2020 Software Radio Systems Limited
|
||||
* Copyright 2013-2021 Software Radio Systems Limited
|
||||
*
|
||||
* By using this file, you agree to the terms and conditions set
|
||||
* forth in the LICENSE file which can be found at the top level of
|
||||
|
@ -19,11 +19,11 @@
|
|||
#include <sys/time.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "srslte/phy/rf/rf_utils.h"
|
||||
#include "srslte/phy/ue/ue_cell_search_nbiot.h"
|
||||
#include "srsran/phy/rf/rf_utils.h"
|
||||
#include "srsran/phy/ue/ue_cell_search_nbiot.h"
|
||||
|
||||
#ifndef DISABLE_RF
|
||||
#include "srslte/phy/rf/rf.h"
|
||||
#include "srsran/phy/rf/rf.h"
|
||||
#endif
|
||||
|
||||
#define MHZ 1000000
|
||||
|
@ -40,14 +40,14 @@ double raster_offset[NUM_RASTER_OFFSET] = {0.0, 2500.0, -2500.0, 7500.0, -7500.0
|
|||
int band = -1;
|
||||
int earfcn_start = -1, earfcn_end = -1;
|
||||
|
||||
cell_search_cfg_t cell_detect_config = {.max_frames_pbch = SRSLTE_DEFAULT_MAX_FRAMES_NPBCH,
|
||||
.max_frames_pss = SRSLTE_DEFAULT_MAX_FRAMES_NPSS,
|
||||
.nof_valid_pss_frames = SRSLTE_DEFAULT_NOF_VALID_NPSS_FRAMES,
|
||||
cell_search_cfg_t cell_detect_config = {.max_frames_pbch = SRSRAN_DEFAULT_MAX_FRAMES_NPBCH,
|
||||
.max_frames_pss = SRSRAN_DEFAULT_MAX_FRAMES_NPSS,
|
||||
.nof_valid_pss_frames = SRSRAN_DEFAULT_NOF_VALID_NPSS_FRAMES,
|
||||
.init_agc = 0.0,
|
||||
.force_tdd = false};
|
||||
|
||||
struct cells {
|
||||
srslte_nbiot_cell_t cell;
|
||||
srsran_nbiot_cell_t cell;
|
||||
float freq;
|
||||
int dl_earfcn;
|
||||
float power;
|
||||
|
@ -67,7 +67,7 @@ void usage(char* prog)
|
|||
printf("\t-e earfcn_end [Default All]\n");
|
||||
printf("\t-r Also scan frequencies with raster offset [Default %s]\n", scan_raster_offset ? "Yes" : "No");
|
||||
printf("\t-n nof_frames_total [Default 100]\n");
|
||||
printf("\t-v [set srslte_verbose to debug, default none]\n");
|
||||
printf("\t-v [set srsran_verbose to debug, default none]\n");
|
||||
}
|
||||
|
||||
void parse_args(int argc, char** argv)
|
||||
|
@ -97,7 +97,7 @@ void parse_args(int argc, char** argv)
|
|||
scan_raster_offset = true;
|
||||
break;
|
||||
case 'v':
|
||||
srslte_verbose++;
|
||||
srsran_verbose++;
|
||||
break;
|
||||
default:
|
||||
usage(argv[0]);
|
||||
|
@ -110,14 +110,14 @@ void parse_args(int argc, char** argv)
|
|||
}
|
||||
}
|
||||
|
||||
int srslte_rf_recv_wrapper(void* h, cf_t* data[SRSLTE_MAX_PORTS], uint32_t nsamples, srslte_timestamp_t* t)
|
||||
int srsran_rf_recv_wrapper(void* h, cf_t* data[SRSRAN_MAX_PORTS], uint32_t nsamples, srsran_timestamp_t* t)
|
||||
{
|
||||
DEBUG(" ---- Receive %d samples ----", nsamples);
|
||||
void* ptr[SRSLTE_MAX_PORTS];
|
||||
for (int i = 0; i < SRSLTE_MAX_PORTS; i++) {
|
||||
void* ptr[SRSRAN_MAX_PORTS];
|
||||
for (int i = 0; i < SRSRAN_MAX_PORTS; i++) {
|
||||
ptr[i] = data[i];
|
||||
}
|
||||
return srslte_rf_recv_with_time_multi(h, ptr, nsamples, true, NULL, NULL);
|
||||
return srsran_rf_recv_with_time_multi(h, ptr, nsamples, true, NULL, NULL);
|
||||
}
|
||||
|
||||
bool go_exit = false;
|
||||
|
@ -130,44 +130,44 @@ void sig_int_handler(int signo)
|
|||
}
|
||||
}
|
||||
|
||||
static SRSLTE_AGC_CALLBACK(srslte_rf_set_rx_gain_wrapper)
|
||||
static SRSRAN_AGC_CALLBACK(srsran_rf_set_rx_gain_wrapper)
|
||||
{
|
||||
srslte_rf_set_rx_gain((srslte_rf_t*)h, gain_db);
|
||||
srsran_rf_set_rx_gain((srsran_rf_t*)h, gain_db);
|
||||
}
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
int n;
|
||||
srslte_rf_t rf;
|
||||
srslte_ue_cellsearch_nbiot_t cs;
|
||||
srslte_nbiot_ue_cellsearch_result_t found_cells[3];
|
||||
srsran_rf_t rf;
|
||||
srsran_ue_cellsearch_nbiot_t cs;
|
||||
srsran_nbiot_ue_cellsearch_result_t found_cells[3];
|
||||
int nof_freqs;
|
||||
srslte_earfcn_t channels[MAX_EARFCN];
|
||||
srsran_earfcn_t channels[MAX_EARFCN];
|
||||
uint32_t freq;
|
||||
uint32_t n_found_cells = 0;
|
||||
|
||||
parse_args(argc, argv);
|
||||
|
||||
printf("Opening RF device...\n");
|
||||
if (srslte_rf_open(&rf, rf_args)) {
|
||||
if (srsran_rf_open(&rf, rf_args)) {
|
||||
fprintf(stderr, "Error opening rf\n");
|
||||
exit(-1);
|
||||
}
|
||||
if (!cell_detect_config.init_agc) {
|
||||
srslte_rf_set_rx_gain(&rf, rf_gain);
|
||||
srsran_rf_set_rx_gain(&rf, rf_gain);
|
||||
} else {
|
||||
printf("Starting AGC thread...\n");
|
||||
if (srslte_rf_start_gain_thread(&rf, false)) {
|
||||
if (srsran_rf_start_gain_thread(&rf, false)) {
|
||||
fprintf(stderr, "Error opening rf\n");
|
||||
exit(-1);
|
||||
}
|
||||
srslte_rf_set_rx_gain(&rf, 50);
|
||||
srsran_rf_set_rx_gain(&rf, 50);
|
||||
}
|
||||
|
||||
// Supress RF messages
|
||||
srslte_rf_suppress_stdout(&rf);
|
||||
srsran_rf_suppress_stdout(&rf);
|
||||
|
||||
nof_freqs = srslte_band_get_fd_band(band, channels, earfcn_start, earfcn_end, MAX_EARFCN);
|
||||
nof_freqs = srsran_band_get_fd_band(band, channels, earfcn_start, earfcn_end, MAX_EARFCN);
|
||||
if (nof_freqs < 0) {
|
||||
fprintf(stderr, "Error getting EARFCN list\n");
|
||||
exit(-1);
|
||||
|
@ -183,47 +183,47 @@ int main(int argc, char** argv)
|
|||
for (int i = 0; i < (scan_raster_offset ? NUM_RASTER_OFFSET : 1); i++) {
|
||||
// set rf_freq
|
||||
double rf_freq = channels[freq].fd * MHZ + raster_offset[i];
|
||||
srslte_rf_set_rx_freq(&rf, 0, rf_freq);
|
||||
srsran_rf_set_rx_freq(&rf, 0, rf_freq);
|
||||
INFO("Set rf_freq to %.3f Hz", rf_freq);
|
||||
|
||||
printf("[%3d/%d]: EARFCN %d, %.2f MHz looking for NPSS.\n", freq, nof_freqs, channels[freq].id, rf_freq / 1e6);
|
||||
fflush(stdout);
|
||||
|
||||
if (SRSLTE_VERBOSE_ISINFO()) {
|
||||
if (SRSRAN_VERBOSE_ISINFO()) {
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
bzero(found_cells, 3 * sizeof(srslte_nbiot_ue_cellsearch_result_t));
|
||||
bzero(found_cells, 3 * sizeof(srsran_nbiot_ue_cellsearch_result_t));
|
||||
|
||||
if (srslte_ue_cellsearch_nbiot_init(&cs, cell_detect_config.max_frames_pss, srslte_rf_recv_wrapper, (void*)&rf)) {
|
||||
if (srsran_ue_cellsearch_nbiot_init(&cs, cell_detect_config.max_frames_pss, srsran_rf_recv_wrapper, (void*)&rf)) {
|
||||
fprintf(stderr, "Error initiating UE cell detect\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
if (cell_detect_config.max_frames_pss) {
|
||||
srslte_ue_cellsearch_nbiot_set_nof_valid_frames(&cs, cell_detect_config.nof_valid_pss_frames);
|
||||
srsran_ue_cellsearch_nbiot_set_nof_valid_frames(&cs, cell_detect_config.nof_valid_pss_frames);
|
||||
}
|
||||
if (cell_detect_config.init_agc) {
|
||||
srslte_ue_sync_nbiot_start_agc(&cs.ue_sync, srslte_rf_set_rx_gain_wrapper, cell_detect_config.init_agc);
|
||||
srsran_ue_sync_nbiot_start_agc(&cs.ue_sync, srsran_rf_set_rx_gain_wrapper, cell_detect_config.init_agc);
|
||||
}
|
||||
|
||||
INFO("Setting sampling frequency %.2f MHz for NPSS search", SRSLTE_CS_SAMP_FREQ / 1000000);
|
||||
srslte_rf_set_rx_srate(&rf, SRSLTE_CS_SAMP_FREQ);
|
||||
INFO("Setting sampling frequency %.2f MHz for NPSS search", SRSRAN_CS_SAMP_FREQ / 1000000);
|
||||
srsran_rf_set_rx_srate(&rf, SRSRAN_CS_SAMP_FREQ);
|
||||
INFO("Starting receiver...");
|
||||
srslte_rf_start_rx_stream(&rf, false);
|
||||
srsran_rf_start_rx_stream(&rf, false);
|
||||
|
||||
n = srslte_ue_cellsearch_nbiot_scan(&cs);
|
||||
if (n == SRSLTE_SUCCESS) {
|
||||
srslte_rf_stop_rx_stream(&rf);
|
||||
n = srslte_ue_cellsearch_nbiot_detect(&cs, found_cells);
|
||||
if (n == SRSLTE_SUCCESS) {
|
||||
srslte_nbiot_cell_t cell;
|
||||
n = srsran_ue_cellsearch_nbiot_scan(&cs);
|
||||
if (n == SRSRAN_SUCCESS) {
|
||||
srsran_rf_stop_rx_stream(&rf);
|
||||
n = srsran_ue_cellsearch_nbiot_detect(&cs, found_cells);
|
||||
if (n == SRSRAN_SUCCESS) {
|
||||
srsran_nbiot_cell_t cell;
|
||||
cell.n_id_ncell = found_cells[0].n_id_ncell;
|
||||
cell.base.cp = SRSLTE_CP_NORM;
|
||||
cell.base.cp = SRSRAN_CP_NORM;
|
||||
|
||||
// TODO: add MIB decoding
|
||||
printf("Found CELL ID %d.\n", cell.n_id_ncell);
|
||||
memcpy(&results[n_found_cells].cell, &cell, sizeof(srslte_nbiot_cell_t));
|
||||
memcpy(&results[n_found_cells].cell, &cell, sizeof(srsran_nbiot_cell_t));
|
||||
results[n_found_cells].freq = channels[freq].fd;
|
||||
results[n_found_cells].dl_earfcn = channels[freq].id;
|
||||
results[n_found_cells].power = found_cells[0].peak;
|
||||
|
@ -232,7 +232,7 @@ int main(int argc, char** argv)
|
|||
printf("Cell found but couldn't detect ID.\n");
|
||||
}
|
||||
}
|
||||
srslte_ue_cellsearch_nbiot_free(&cs);
|
||||
srsran_ue_cellsearch_nbiot_free(&cs);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -247,6 +247,6 @@ int main(int argc, char** argv)
|
|||
|
||||
printf("\nBye\n");
|
||||
|
||||
srslte_rf_close(&rf);
|
||||
srsran_rf_close(&rf);
|
||||
exit(0);
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
*
|
||||
* \section COPYRIGHT
|
||||
*
|
||||
* Copyright 2013-2020 Software Radio Systems Limited
|
||||
* Copyright 2013-2021 Software Radio Systems Limited
|
||||
*
|
||||
* By using this file, you agree to the terms and conditions set
|
||||
* forth in the LICENSE file which can be found at the top level of
|
||||
|
@ -21,15 +21,15 @@
|
|||
#include <sys/select.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "srslte/phy/ch_estimation/chest_dl_nbiot.h"
|
||||
#include "srslte/phy/channel/ch_awgn.h"
|
||||
#include "srslte/phy/io/filesink.h"
|
||||
#include "srslte/phy/io/filesource.h"
|
||||
#include "srslte/phy/sync/npss.h"
|
||||
#include "srslte/phy/sync/nsss.h"
|
||||
#include "srslte/phy/ue/ue_dl_nbiot.h"
|
||||
#include "srslte/phy/utils/bit.h"
|
||||
#include "srslte/phy/utils/random.h"
|
||||
#include "srsran/phy/ch_estimation/chest_dl_nbiot.h"
|
||||
#include "srsran/phy/channel/ch_awgn.h"
|
||||
#include "srsran/phy/io/filesink.h"
|
||||
#include "srsran/phy/io/filesource.h"
|
||||
#include "srsran/phy/sync/npss.h"
|
||||
#include "srsran/phy/sync/nsss.h"
|
||||
#include "srsran/phy/ue/ue_dl_nbiot.h"
|
||||
#include "srsran/phy/utils/bit.h"
|
||||
#include "srsran/phy/utils/random.h"
|
||||
|
||||
#define UE_CRNTI 0x1234
|
||||
|
||||
|
@ -41,20 +41,20 @@ static const uint8_t dummy_sib1_payload[] = {0x43, 0x4d, 0xd0, 0x92, 0x22, 0x06,
|
|||
0x02, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
|
||||
|
||||
#ifndef DISABLE_RF
|
||||
#include "srslte/phy/rf/rf.h"
|
||||
static srslte_rf_t radio;
|
||||
#include "srsran/phy/rf/rf.h"
|
||||
static srsran_rf_t radio;
|
||||
#else
|
||||
#pragma message "Compiling npdsch_ue with no RF support"
|
||||
#endif
|
||||
|
||||
static char* output_file_name = NULL;
|
||||
|
||||
static srslte_nbiot_cell_t cell = {
|
||||
.base = {.nof_ports = 1, .nof_prb = SRSLTE_NBIOT_DEFAULT_NUM_PRB_BASECELL, .cp = SRSLTE_CP_NORM, .id = 0},
|
||||
.nbiot_prb = SRSLTE_NBIOT_DEFAULT_PRB_OFFSET,
|
||||
static srsran_nbiot_cell_t cell = {
|
||||
.base = {.nof_ports = 1, .nof_prb = SRSRAN_NBIOT_DEFAULT_NUM_PRB_BASECELL, .cp = SRSRAN_CP_NORM, .id = 0},
|
||||
.nbiot_prb = SRSRAN_NBIOT_DEFAULT_PRB_OFFSET,
|
||||
.n_id_ncell = 0,
|
||||
.nof_ports = 1,
|
||||
.mode = SRSLTE_NBIOT_MODE_STANDALONE,
|
||||
.mode = SRSRAN_NBIOT_MODE_STANDALONE,
|
||||
.is_r14 = true};
|
||||
|
||||
static uint32_t i_tbs_val = 1, last_i_tbs_val = 1;
|
||||
|
@ -67,22 +67,22 @@ static float rf_amp = 0.8, rf_gain = 70.0, rf_freq = 0;
|
|||
static float file_snr = -100.0;
|
||||
|
||||
static bool null_file_sink = false;
|
||||
static srslte_random_t* random_gen;
|
||||
static srslte_filesink_t fsink;
|
||||
static srslte_ofdm_t ifft;
|
||||
static srslte_npss_synch_t npss_sync;
|
||||
static srslte_nsss_synch_t nsss_sync;
|
||||
static srslte_npbch_t npbch;
|
||||
static srslte_npdcch_t npdcch;
|
||||
static srslte_npdsch_t npdsch;
|
||||
static srslte_npdsch_cfg_t sib1_npdsch_cfg;
|
||||
static srslte_npdsch_cfg_t npdsch_cfg;
|
||||
static srslte_nbiot_ue_dl_t ue_dl;
|
||||
static srslte_softbuffer_tx_t softbuffer;
|
||||
static srslte_ra_nbiot_dl_dci_t ra_dl;
|
||||
static srslte_ra_nbiot_dl_dci_t ra_dl_sib1;
|
||||
static srslte_chest_dl_nbiot_t ch_est;
|
||||
static srslte_mib_nb_t mib_nb;
|
||||
static srsran_random_t* random_gen;
|
||||
static srsran_filesink_t fsink;
|
||||
static srsran_ofdm_t ifft;
|
||||
static srsran_npss_synch_t npss_sync;
|
||||
static srsran_nsss_synch_t nsss_sync;
|
||||
static srsran_npbch_t npbch;
|
||||
static srsran_npdcch_t npdcch;
|
||||
static srsran_npdsch_t npdsch;
|
||||
static srsran_npdsch_cfg_t sib1_npdsch_cfg;
|
||||
static srsran_npdsch_cfg_t npdsch_cfg;
|
||||
static srsran_nbiot_ue_dl_t ue_dl;
|
||||
static srsran_softbuffer_tx_t softbuffer;
|
||||
static srsran_ra_nbiot_dl_dci_t ra_dl;
|
||||
static srsran_ra_nbiot_dl_dci_t ra_dl_sib1;
|
||||
static srsran_chest_dl_nbiot_t ch_est;
|
||||
static srsran_mib_nb_t mib_nb;
|
||||
static uint32_t sched_info_tag =
|
||||
0; // according to Table 16.4.1.3-3 in 36.213, 0 means 4 NPDSCH repetitions with TBS 208
|
||||
|
||||
|
@ -110,7 +110,7 @@ void usage(char* prog)
|
|||
printf("\t-l n_id_ncell [Default %d]\n", cell.n_id_ncell);
|
||||
printf("\t-R Is R14 cell [Default %s]\n", cell.is_r14 ? "Yes" : "No");
|
||||
printf("\t-p NB-IoT PRB id [Default %d]\n", cell.nbiot_prb);
|
||||
printf("\t-v [set srslte_verbose to debug, default none]\n");
|
||||
printf("\t-v [set srsran_verbose to debug, default none]\n");
|
||||
}
|
||||
|
||||
void parse_args(int argc, char** argv)
|
||||
|
@ -161,7 +161,7 @@ void parse_args(int argc, char** argv)
|
|||
cell.nbiot_prb = (uint32_t)strtol(argv[optind], NULL, 10);
|
||||
break;
|
||||
case 'v':
|
||||
srslte_verbose++;
|
||||
srsran_verbose++;
|
||||
break;
|
||||
default:
|
||||
usage(argv[0]);
|
||||
|
@ -186,12 +186,12 @@ void parse_args(int argc, char** argv)
|
|||
void base_init()
|
||||
{
|
||||
// init memory
|
||||
sf_buffer = srslte_vec_cf_malloc(sf_n_re);
|
||||
sf_buffer = srsran_vec_cf_malloc(sf_n_re);
|
||||
if (!sf_buffer) {
|
||||
perror("malloc");
|
||||
exit(-1);
|
||||
}
|
||||
output_buffer = srslte_vec_cf_malloc(sf_n_samples);
|
||||
output_buffer = srsran_vec_cf_malloc(sf_n_samples);
|
||||
if (!output_buffer) {
|
||||
perror("malloc");
|
||||
exit(-1);
|
||||
|
@ -199,7 +199,7 @@ void base_init()
|
|||
// open file or USRP
|
||||
if (output_file_name) {
|
||||
if (strcmp(output_file_name, "NULL")) {
|
||||
if (srslte_filesink_init(&fsink, output_file_name, SRSLTE_COMPLEX_FLOAT_BIN)) {
|
||||
if (srsran_filesink_init(&fsink, output_file_name, SRSRAN_COMPLEX_FLOAT_BIN)) {
|
||||
fprintf(stderr, "Error opening file %s\n", output_file_name);
|
||||
exit(-1);
|
||||
}
|
||||
|
@ -210,7 +210,7 @@ void base_init()
|
|||
} else {
|
||||
#ifndef DISABLE_RF
|
||||
printf("Opening RF device...\n");
|
||||
if (srslte_rf_open(&radio, rf_args)) {
|
||||
if (srsran_rf_open(&radio, rf_args)) {
|
||||
fprintf(stderr, "Error opening rf\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
@ -220,72 +220,72 @@ void base_init()
|
|||
#endif
|
||||
}
|
||||
|
||||
if (srslte_ofdm_tx_init(&ifft, SRSLTE_CP_NORM, sf_buffer, output_buffer, cell.base.nof_prb)) {
|
||||
if (srsran_ofdm_tx_init(&ifft, SRSRAN_CP_NORM, sf_buffer, output_buffer, cell.base.nof_prb)) {
|
||||
fprintf(stderr, "Error creating iFFT object\n");
|
||||
exit(-1);
|
||||
}
|
||||
srslte_ofdm_set_normalize(&ifft, true);
|
||||
srslte_ofdm_set_freq_shift(&ifft, -SRSLTE_NBIOT_FREQ_SHIFT_FACTOR);
|
||||
srsran_ofdm_set_normalize(&ifft, true);
|
||||
srsran_ofdm_set_freq_shift(&ifft, -SRSRAN_NBIOT_FREQ_SHIFT_FACTOR);
|
||||
|
||||
if (srslte_npss_synch_init(&npss_sync, sf_n_samples, srslte_symbol_sz(cell.base.nof_prb))) {
|
||||
if (srsran_npss_synch_init(&npss_sync, sf_n_samples, srsran_symbol_sz(cell.base.nof_prb))) {
|
||||
fprintf(stderr, "Error initializing NPSS object\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
if (srslte_nsss_synch_init(&nsss_sync, sf_n_samples, srslte_symbol_sz(cell.base.nof_prb))) {
|
||||
if (srsran_nsss_synch_init(&nsss_sync, sf_n_samples, srsran_symbol_sz(cell.base.nof_prb))) {
|
||||
fprintf(stderr, "Error initializing NSSS object\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
if (srslte_npbch_init(&npbch)) {
|
||||
if (srsran_npbch_init(&npbch)) {
|
||||
fprintf(stderr, "Error creating NPBCH object\n");
|
||||
exit(-1);
|
||||
}
|
||||
if (srslte_npbch_set_cell(&npbch, cell)) {
|
||||
if (srsran_npbch_set_cell(&npbch, cell)) {
|
||||
fprintf(stderr, "Error setting cell in NPBCH object\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
if (srslte_npdcch_init(&npdcch)) {
|
||||
if (srsran_npdcch_init(&npdcch)) {
|
||||
fprintf(stderr, "Error creating NPDCCH object\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
if (srslte_npdcch_set_cell(&npdcch, cell)) {
|
||||
if (srsran_npdcch_set_cell(&npdcch, cell)) {
|
||||
fprintf(stderr, "Configuring cell in NPDCCH\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
if (srslte_npdsch_init(&npdsch)) {
|
||||
if (srsran_npdsch_init(&npdsch)) {
|
||||
fprintf(stderr, "Error creating NPDSCH object\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
if (srslte_npdsch_set_cell(&npdsch, cell)) {
|
||||
if (srsran_npdsch_set_cell(&npdsch, cell)) {
|
||||
fprintf(stderr, "Configuring cell in NPDSCH\n");
|
||||
exit(-1);
|
||||
}
|
||||
srslte_npdsch_set_rnti(&npdsch, UE_CRNTI);
|
||||
srsran_npdsch_set_rnti(&npdsch, UE_CRNTI);
|
||||
|
||||
if (srslte_softbuffer_tx_init(&softbuffer, cell.base.nof_prb)) {
|
||||
if (srsran_softbuffer_tx_init(&softbuffer, cell.base.nof_prb)) {
|
||||
fprintf(stderr, "Error initiating soft buffer\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
random_gen = srslte_random_init(time(NULL));
|
||||
random_gen = srsran_random_init(time(NULL));
|
||||
}
|
||||
|
||||
void base_free()
|
||||
{
|
||||
srslte_random_free(random_gen);
|
||||
srslte_softbuffer_tx_free(&softbuffer);
|
||||
srslte_npdsch_free(&npdsch);
|
||||
srslte_npdcch_free(&npdcch);
|
||||
srslte_npbch_free(&npbch);
|
||||
srslte_chest_dl_nbiot_free(&ch_est);
|
||||
srslte_npss_synch_free(&npss_sync);
|
||||
srslte_nsss_synch_free(&nsss_sync);
|
||||
srslte_ofdm_tx_free(&ifft);
|
||||
srsran_random_free(random_gen);
|
||||
srsran_softbuffer_tx_free(&softbuffer);
|
||||
srsran_npdsch_free(&npdsch);
|
||||
srsran_npdcch_free(&npdcch);
|
||||
srsran_npbch_free(&npbch);
|
||||
srsran_chest_dl_nbiot_free(&ch_est);
|
||||
srsran_npss_synch_free(&npss_sync);
|
||||
srsran_nsss_synch_free(&nsss_sync);
|
||||
srsran_ofdm_tx_free(&ifft);
|
||||
|
||||
if (sf_buffer) {
|
||||
free(sf_buffer);
|
||||
|
@ -295,11 +295,11 @@ void base_free()
|
|||
}
|
||||
if (output_file_name) {
|
||||
if (!null_file_sink) {
|
||||
srslte_filesink_free(&fsink);
|
||||
srsran_filesink_free(&fsink);
|
||||
}
|
||||
} else {
|
||||
#ifndef DISABLE_RF
|
||||
srslte_rf_close(&radio);
|
||||
srsran_rf_close(&radio);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
@ -317,14 +317,14 @@ void sig_int_handler(int signo)
|
|||
|
||||
static int update_radl(void)
|
||||
{
|
||||
bzero(&ra_dl_sib1, sizeof(srslte_ra_nbiot_dl_dci_t));
|
||||
bzero(&ra_dl_sib1, sizeof(srsran_ra_nbiot_dl_dci_t));
|
||||
|
||||
// NB-IoT specific fields
|
||||
ra_dl_sib1.alloc.has_sib1 = true;
|
||||
ra_dl_sib1.alloc.sched_info_sib1 = mib_nb.sched_info_sib1;
|
||||
ra_dl_sib1.mcs_idx = 1;
|
||||
|
||||
bzero(&ra_dl, sizeof(srslte_ra_nbiot_dl_dci_t));
|
||||
bzero(&ra_dl, sizeof(srsran_ra_nbiot_dl_dci_t));
|
||||
ra_dl.mcs_idx = i_tbs_val;
|
||||
|
||||
// NB-IoT specific fields
|
||||
|
@ -337,19 +337,19 @@ static int update_radl(void)
|
|||
ra_dl.alloc.harq_ack = 1;
|
||||
ra_dl.alloc.i_n_start = 0;
|
||||
|
||||
srslte_nbiot_dl_dci_fprint(stdout, &ra_dl);
|
||||
srslte_ra_nbiot_dl_grant_t dummy_grant;
|
||||
srslte_ra_nbits_t dummy_nbits;
|
||||
srsran_nbiot_dl_dci_fprint(stdout, &ra_dl);
|
||||
srsran_ra_nbiot_dl_grant_t dummy_grant;
|
||||
srsran_ra_nbits_t dummy_nbits;
|
||||
|
||||
#define DUMMY_SFIDX 1
|
||||
#define DUMMY_SFN 0
|
||||
srslte_ra_nbiot_dl_dci_to_grant(&ra_dl, &dummy_grant, DUMMY_SFN, DUMMY_SFIDX, DUMMY_R_MAX, false, cell.mode);
|
||||
srslte_ra_nbiot_dl_grant_to_nbits(&dummy_grant, cell, 0, &dummy_nbits);
|
||||
srslte_ra_nbiot_dl_grant_fprint(stdout, &dummy_grant);
|
||||
srsran_ra_nbiot_dl_dci_to_grant(&ra_dl, &dummy_grant, DUMMY_SFN, DUMMY_SFIDX, DUMMY_R_MAX, false, cell.mode);
|
||||
srsran_ra_nbiot_dl_grant_to_nbits(&dummy_grant, cell, 0, &dummy_nbits);
|
||||
srsran_ra_nbiot_dl_grant_fprint(stdout, &dummy_grant);
|
||||
printf("Type new MCS index and press Enter: ");
|
||||
fflush(stdout);
|
||||
|
||||
return SRSLTE_SUCCESS;
|
||||
return SRSRAN_SUCCESS;
|
||||
}
|
||||
|
||||
/* Read new MCS from stdin */
|
||||
|
@ -396,14 +396,14 @@ uint8_t data_tmp[DATA_BUFF_SZ] = {};
|
|||
int main(int argc, char** argv)
|
||||
{
|
||||
int nf = 0, sf_idx = 0;
|
||||
cf_t npss_signal[SRSLTE_NPSS_TOT_LEN];
|
||||
cf_t nsss_signal[SRSLTE_NSSS_LEN * SRSLTE_NSSS_NUM_SEQ]; // for subframe 9
|
||||
cf_t npss_signal[SRSRAN_NPSS_TOT_LEN];
|
||||
cf_t nsss_signal[SRSRAN_NSSS_LEN * SRSRAN_NSSS_NUM_SEQ]; // for subframe 9
|
||||
|
||||
uint8_t bch_payload[SRSLTE_MIB_NB_LEN];
|
||||
uint8_t sib1_nb_payload[SRSLTE_NPDSCH_MAX_TBS];
|
||||
uint8_t bch_payload[SRSRAN_MIB_NB_LEN];
|
||||
uint8_t sib1_nb_payload[SRSRAN_NPDSCH_MAX_TBS];
|
||||
|
||||
srslte_dci_msg_t dci_msg;
|
||||
srslte_dci_location_t locations[SRSLTE_NOF_SF_X_FRAME][30];
|
||||
srsran_dci_msg_t dci_msg;
|
||||
srsran_dci_location_t locations[SRSRAN_NOF_SF_X_FRAME][30];
|
||||
|
||||
uint32_t sfn = 0;
|
||||
uint32_t hfn = 0; // Hyper frame number is incremented when sfn wraps and is also 10bit wide
|
||||
|
@ -423,60 +423,60 @@ int main(int argc, char** argv)
|
|||
printf("Target SNR: %.2fdB\n", file_snr);
|
||||
}
|
||||
|
||||
sf_n_re = 2 * SRSLTE_CP_NORM_NSYMB * cell.base.nof_prb * SRSLTE_NRE;
|
||||
sf_n_samples = 2 * SRSLTE_SLOT_LEN(srslte_symbol_sz(cell.base.nof_prb));
|
||||
sf_n_re = 2 * SRSRAN_CP_NORM_NSYMB * cell.base.nof_prb * SRSRAN_NRE;
|
||||
sf_n_samples = 2 * SRSRAN_SLOT_LEN(srsran_symbol_sz(cell.base.nof_prb));
|
||||
|
||||
/* this *must* be called after setting slot_len_* */
|
||||
base_init();
|
||||
|
||||
// buffer for outputting signal in RE representation (using sf_n_re)
|
||||
cf_t* sf_re_symbols[SRSLTE_MAX_PORTS] = {NULL, NULL, NULL, NULL};
|
||||
cf_t* sf_re_symbols[SRSRAN_MAX_PORTS] = {NULL, NULL, NULL, NULL};
|
||||
sf_re_symbols[0] = sf_buffer;
|
||||
|
||||
// buffer for outputting actual IQ samples (using sf_n_samples)
|
||||
cf_t* sf_symbols[SRSLTE_MAX_PORTS] = {NULL, NULL, NULL, NULL};
|
||||
cf_t* sf_symbols[SRSRAN_MAX_PORTS] = {NULL, NULL, NULL, NULL};
|
||||
sf_symbols[0] = output_buffer;
|
||||
|
||||
// construct MIB-NB
|
||||
mib_nb.sched_info_sib1 = sched_info_tag;
|
||||
mib_nb.sys_info_tag = 0;
|
||||
mib_nb.ac_barring = false;
|
||||
mib_nb.mode = SRSLTE_NBIOT_MODE_STANDALONE;
|
||||
mib_nb.mode = SRSRAN_NBIOT_MODE_STANDALONE;
|
||||
|
||||
// Initialize UE DL
|
||||
if (srslte_nbiot_ue_dl_init(&ue_dl, sf_symbols, SRSLTE_NBIOT_MAX_PRB, SRSLTE_NBIOT_NUM_RX_ANTENNAS)) {
|
||||
if (srsran_nbiot_ue_dl_init(&ue_dl, sf_symbols, SRSRAN_NBIOT_MAX_PRB, SRSRAN_NBIOT_NUM_RX_ANTENNAS)) {
|
||||
fprintf(stderr, "Error initiating UE downlink processing module\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
if (srslte_nbiot_ue_dl_set_cell(&ue_dl, cell)) {
|
||||
if (srsran_nbiot_ue_dl_set_cell(&ue_dl, cell)) {
|
||||
fprintf(stderr, "Setting cell in UE DL\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
srslte_nbiot_ue_dl_set_mib(&ue_dl, mib_nb);
|
||||
srsran_nbiot_ue_dl_set_mib(&ue_dl, mib_nb);
|
||||
|
||||
/* Generate NPSS/NSSS signals */
|
||||
srslte_npss_generate(npss_signal);
|
||||
srslte_nsss_generate(nsss_signal, cell.n_id_ncell);
|
||||
srsran_npss_generate(npss_signal);
|
||||
srsran_nsss_generate(nsss_signal, cell.n_id_ncell);
|
||||
|
||||
#ifdef NPSS_DUMP
|
||||
srslte_filesink_t debug_fsink;
|
||||
srsran_filesink_t debug_fsink;
|
||||
char fname[] = "npss.bin";
|
||||
if (srslte_filesink_init(&debug_fsink, fname, SRSLTE_COMPLEX_FLOAT_BIN)) {
|
||||
if (srsran_filesink_init(&debug_fsink, fname, SRSRAN_COMPLEX_FLOAT_BIN)) {
|
||||
fprintf(stderr, "Error opening file %s\n", fname);
|
||||
exit(-1);
|
||||
}
|
||||
srslte_filesink_write(&debug_fsink, npss_signal, SRSLTE_NPSS_LEN * 11);
|
||||
srslte_filesink_free(&debug_fsink);
|
||||
srsran_filesink_write(&debug_fsink, npss_signal, SRSRAN_NPSS_LEN * 11);
|
||||
srsran_filesink_free(&debug_fsink);
|
||||
#endif
|
||||
|
||||
/* Generate CRS+NRS signals */
|
||||
if (srslte_chest_dl_nbiot_init(&ch_est, SRSLTE_NBIOT_MAX_PRB)) {
|
||||
if (srsran_chest_dl_nbiot_init(&ch_est, SRSRAN_NBIOT_MAX_PRB)) {
|
||||
fprintf(stderr, "Error initializing equalizer\n");
|
||||
exit(-1);
|
||||
}
|
||||
if (srslte_chest_dl_nbiot_set_cell(&ch_est, cell) != SRSLTE_SUCCESS) {
|
||||
if (srsran_chest_dl_nbiot_set_cell(&ch_est, cell) != SRSRAN_SUCCESS) {
|
||||
fprintf(stderr, "Error setting channel estimator's cell configuration\n");
|
||||
return -1;
|
||||
}
|
||||
|
@ -489,10 +489,10 @@ int main(int argc, char** argv)
|
|||
signal(SIGINT, sig_int_handler);
|
||||
|
||||
if (!output_file_name) {
|
||||
int srate = srslte_sampling_freq_hz(cell.base.nof_prb);
|
||||
int srate = srsran_sampling_freq_hz(cell.base.nof_prb);
|
||||
if (srate != -1) {
|
||||
printf("Setting sampling rate %.2f MHz\n", (float)srate / 1000000);
|
||||
float srate_rf = srslte_rf_set_tx_srate(&radio, (double)srate);
|
||||
float srate_rf = srsran_rf_set_tx_srate(&radio, (double)srate);
|
||||
if (srate_rf != srate) {
|
||||
fprintf(stderr, "Could not set sampling rate\n");
|
||||
exit(-1);
|
||||
|
@ -501,9 +501,9 @@ int main(int argc, char** argv)
|
|||
fprintf(stderr, "Invalid number of PRB %d\n", cell.base.nof_prb);
|
||||
exit(-1);
|
||||
}
|
||||
srslte_rf_set_tx_gain(&radio, rf_gain);
|
||||
printf("Set TX gain: %.1f dB\n", srslte_rf_get_tx_gain(&radio));
|
||||
printf("Set TX freq: %.2f MHz\n", srslte_rf_set_tx_freq(&radio, 0, rf_freq) / 1000000);
|
||||
srsran_rf_set_tx_gain(&radio, rf_gain);
|
||||
printf("Set TX gain: %.1f dB\n", srsran_rf_get_tx_gain(&radio));
|
||||
printf("Set TX freq: %.2f MHz\n", srsran_rf_set_tx_freq(&radio, 0, rf_freq) / 1000000);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -512,7 +512,7 @@ int main(int argc, char** argv)
|
|||
}
|
||||
|
||||
/* Initiate valid DCI locations */
|
||||
for (int i = 0; i < SRSLTE_NOF_SF_X_FRAME; i++) {
|
||||
for (int i = 0; i < SRSRAN_NOF_SF_X_FRAME; i++) {
|
||||
locations[i][0].L = 1; // Agg-level 2, i.e. both NCEEs used
|
||||
locations[i][0].ncce = 0;
|
||||
}
|
||||
|
@ -521,48 +521,48 @@ int main(int argc, char** argv)
|
|||
|
||||
bool send_data = false;
|
||||
bool npdsch_active = false;
|
||||
srslte_softbuffer_tx_reset(&softbuffer);
|
||||
bzero(&sib1_npdsch_cfg, sizeof(srslte_npdsch_cfg_t));
|
||||
bzero(&npdsch_cfg, sizeof(srslte_npdsch_cfg_t));
|
||||
srsran_softbuffer_tx_reset(&softbuffer);
|
||||
bzero(&sib1_npdsch_cfg, sizeof(srsran_npdsch_cfg_t));
|
||||
bzero(&npdsch_cfg, sizeof(srsran_npdsch_cfg_t));
|
||||
|
||||
#ifndef DISABLE_RF
|
||||
bool start_of_burst = true;
|
||||
#endif
|
||||
|
||||
while ((nf < nof_frames || nof_frames == -1) && !go_exit) {
|
||||
for (sf_idx = 0; sf_idx < SRSLTE_NOF_SF_X_FRAME && (nf < nof_frames || nof_frames == -1); sf_idx++) {
|
||||
srslte_vec_cf_zero(sf_buffer, sf_n_re);
|
||||
for (sf_idx = 0; sf_idx < SRSRAN_NOF_SF_X_FRAME && (nf < nof_frames || nof_frames == -1); sf_idx++) {
|
||||
srsran_vec_cf_zero(sf_buffer, sf_n_re);
|
||||
|
||||
// Transmit NPBCH in subframe 0
|
||||
if (sf_idx == 0) {
|
||||
if ((sfn % SRSLTE_NPBCH_NUM_FRAMES) == 0) {
|
||||
srslte_npbch_mib_pack(hfn, sfn, mib_nb, bch_payload);
|
||||
if ((sfn % SRSRAN_NPBCH_NUM_FRAMES) == 0) {
|
||||
srsran_npbch_mib_pack(hfn, sfn, mib_nb, bch_payload);
|
||||
}
|
||||
srslte_npbch_put_subframe(&npbch, bch_payload, sf_re_symbols, sfn);
|
||||
if (SRSLTE_VERBOSE_ISDEBUG()) {
|
||||
srsran_npbch_put_subframe(&npbch, bch_payload, sf_re_symbols, sfn);
|
||||
if (SRSRAN_VERBOSE_ISDEBUG()) {
|
||||
printf("MIB payload: ");
|
||||
srslte_vec_fprint_hex(stdout, bch_payload, SRSLTE_MIB_NB_LEN);
|
||||
srsran_vec_fprint_hex(stdout, bch_payload, SRSRAN_MIB_NB_LEN);
|
||||
}
|
||||
}
|
||||
|
||||
// Transmit NPSS, NSSS and NRS
|
||||
if (sf_idx == 5) {
|
||||
// NPSS at subframe 5
|
||||
srslte_npss_put_subframe(&npss_sync, npss_signal, sf_buffer, cell.base.nof_prb, cell.nbiot_prb);
|
||||
srsran_npss_put_subframe(&npss_sync, npss_signal, sf_buffer, cell.base.nof_prb, cell.nbiot_prb);
|
||||
} else if ((sfn % 2 == 0) && sf_idx == 9) {
|
||||
// NSSS in every even numbered frame at subframe 9
|
||||
srslte_nsss_put_subframe(&nsss_sync, nsss_signal, sf_buffer, sfn, cell.base.nof_prb, cell.nbiot_prb);
|
||||
srsran_nsss_put_subframe(&nsss_sync, nsss_signal, sf_buffer, sfn, cell.base.nof_prb, cell.nbiot_prb);
|
||||
} else {
|
||||
// NRS in all other subframes (using CSR signal intentionally)
|
||||
// DEBUG("%d.%d: Putting %d NRS pilots", sfn, sf_idx, SRSLTE_REFSIGNAL_NUM_SF(1, cell.nof_ports));
|
||||
srslte_refsignal_nrs_put_sf(cell, 0, ch_est.nrs_signal.pilots[0][sf_idx], sf_buffer);
|
||||
// DEBUG("%d.%d: Putting %d NRS pilots", sfn, sf_idx, SRSRAN_REFSIGNAL_NUM_SF(1, cell.nof_ports));
|
||||
srsran_refsignal_nrs_put_sf(cell, 0, ch_est.nrs_signal.pilots[0][sf_idx], sf_buffer);
|
||||
}
|
||||
|
||||
#if HAVE_NPDSCH
|
||||
// only transmit in subframes not used for NPBCH, NPSS or NSSS and only use subframe 4 when there is no SIB1
|
||||
// transmission
|
||||
if (sf_idx != 0 && sf_idx != 5 && (!(sf_idx == 9 && sfn % 2 == 0)) &&
|
||||
!srslte_nbiot_ue_dl_is_sib1_sf(&ue_dl, sfn, sf_idx)) {
|
||||
!srsran_nbiot_ue_dl_is_sib1_sf(&ue_dl, sfn, sf_idx)) {
|
||||
send_data = true;
|
||||
} else {
|
||||
send_data = false;
|
||||
|
@ -575,43 +575,43 @@ int main(int argc, char** argv)
|
|||
|
||||
// overwrite Hyper Frame Number (HFN), 8 MSB
|
||||
uint8_t unpacked_hfn[4 * 8];
|
||||
srslte_bit_unpack_vector(sib1_nb_payload, unpacked_hfn, 4 * 8);
|
||||
srsran_bit_unpack_vector(sib1_nb_payload, unpacked_hfn, 4 * 8);
|
||||
uint8_t* tmp = unpacked_hfn;
|
||||
tmp += 12;
|
||||
srslte_bit_unpack(hfn >> 2, &tmp, 8);
|
||||
srsran_bit_unpack(hfn >> 2, &tmp, 8);
|
||||
uint8_t packed_hfn[4];
|
||||
srslte_bit_pack_vector(unpacked_hfn, packed_hfn, 32);
|
||||
srsran_bit_pack_vector(unpacked_hfn, packed_hfn, 32);
|
||||
memcpy(sib1_nb_payload, packed_hfn, sizeof(packed_hfn));
|
||||
|
||||
if (SRSLTE_VERBOSE_ISDEBUG()) {
|
||||
if (SRSRAN_VERBOSE_ISDEBUG()) {
|
||||
printf("SIB1-NB payload: ");
|
||||
srslte_vec_fprint_byte(stdout, sib1_nb_payload, sizeof(dummy_sib1_payload));
|
||||
srsran_vec_fprint_byte(stdout, sib1_nb_payload, sizeof(dummy_sib1_payload));
|
||||
}
|
||||
}
|
||||
|
||||
if (srslte_nbiot_ue_dl_is_sib1_sf(&ue_dl, sfn, sf_idx)) {
|
||||
if (srsran_nbiot_ue_dl_is_sib1_sf(&ue_dl, sfn, sf_idx)) {
|
||||
INFO("%d.%d: Transmitting SIB1-NB.", sfn, sf_idx);
|
||||
assert(send_data == false);
|
||||
|
||||
// configure DL grant for SIB1-NB transmission
|
||||
if (sib1_npdsch_cfg.sf_idx == 0) {
|
||||
srslte_ra_nbiot_dl_grant_t grant;
|
||||
srslte_ra_nbiot_dl_dci_to_grant(&ra_dl_sib1, &grant, sfn, sf_idx, DUMMY_R_MAX, true, cell.mode);
|
||||
if (srslte_npdsch_cfg(&sib1_npdsch_cfg, cell, &grant, sf_idx)) {
|
||||
srsran_ra_nbiot_dl_grant_t grant;
|
||||
srsran_ra_nbiot_dl_dci_to_grant(&ra_dl_sib1, &grant, sfn, sf_idx, DUMMY_R_MAX, true, cell.mode);
|
||||
if (srsran_npdsch_cfg(&sib1_npdsch_cfg, cell, &grant, sf_idx)) {
|
||||
fprintf(stderr, "Error configuring NPDSCH\n");
|
||||
exit(-1);
|
||||
}
|
||||
}
|
||||
|
||||
// Encode SIB1 content
|
||||
if (srslte_npdsch_encode_rnti(
|
||||
&npdsch, &sib1_npdsch_cfg, &softbuffer, sib1_nb_payload, SRSLTE_SIRNTI, sf_re_symbols)) {
|
||||
if (srsran_npdsch_encode_rnti(
|
||||
&npdsch, &sib1_npdsch_cfg, &softbuffer, sib1_nb_payload, SRSRAN_SIRNTI, sf_re_symbols)) {
|
||||
fprintf(stderr, "Error encoding NPDSCH\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
if (sib1_npdsch_cfg.sf_idx == sib1_npdsch_cfg.grant.nof_sf) {
|
||||
bzero(&sib1_npdsch_cfg, sizeof(srslte_npdsch_cfg_t));
|
||||
bzero(&sib1_npdsch_cfg, sizeof(srsran_npdsch_cfg_t));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -625,16 +625,16 @@ int main(int argc, char** argv)
|
|||
if (sf_idx == NPDCCH_SF_IDX && !npdsch_active) {
|
||||
// Encode NPDCCH
|
||||
INFO("Putting DCI to location: n=%d, L=%d", locations[sf_idx][0].ncce, locations[sf_idx][0].L);
|
||||
srslte_dci_msg_pack_npdsch(&ra_dl, SRSLTE_DCI_FORMATN1, &dci_msg, false);
|
||||
if (srslte_npdcch_encode(&npdcch, &dci_msg, locations[sf_idx][0], UE_CRNTI, sf_re_symbols, sf_idx)) {
|
||||
srsran_dci_msg_pack_npdsch(&ra_dl, SRSRAN_DCI_FORMATN1, &dci_msg, false);
|
||||
if (srsran_npdcch_encode(&npdcch, &dci_msg, locations[sf_idx][0], UE_CRNTI, sf_re_symbols, sf_idx)) {
|
||||
fprintf(stderr, "Error encoding DCI message\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
// Configure NPDSCH accordingly
|
||||
srslte_ra_nbiot_dl_grant_t grant;
|
||||
srslte_ra_nbiot_dl_dci_to_grant(&ra_dl, &grant, sfn, sf_idx, DUMMY_R_MAX, false, cell.mode);
|
||||
if (srslte_npdsch_cfg(&npdsch_cfg, cell, &grant, sf_idx)) {
|
||||
srsran_ra_nbiot_dl_grant_t grant;
|
||||
srsran_ra_nbiot_dl_dci_to_grant(&ra_dl, &grant, sfn, sf_idx, DUMMY_R_MAX, false, cell.mode);
|
||||
if (srsran_npdsch_cfg(&npdsch_cfg, cell, &grant, sf_idx)) {
|
||||
fprintf(stderr, "Error configuring NPDSCH\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
@ -645,11 +645,11 @@ int main(int argc, char** argv)
|
|||
// generate data only in first sf
|
||||
INFO("%d.%d: Generating %d random bits", sfn, sf_idx, npdsch_cfg.grant.mcs[0].tbs);
|
||||
for (int i = 0; i < npdsch_cfg.grant.mcs[0].tbs / 8; i++) {
|
||||
data[i] = srslte_random_uniform_int_dist(random_gen, 0, 255);
|
||||
data[i] = srsran_random_uniform_int_dist(random_gen, 0, 255);
|
||||
}
|
||||
if (SRSLTE_VERBOSE_ISDEBUG()) {
|
||||
if (SRSRAN_VERBOSE_ISDEBUG()) {
|
||||
printf("Tx payload: ");
|
||||
srslte_vec_fprint_b(stdout, data, npdsch_cfg.grant.mcs[0].tbs / 8);
|
||||
srsran_vec_fprint_b(stdout, data, npdsch_cfg.grant.mcs[0].tbs / 8);
|
||||
}
|
||||
npdsch_active = true;
|
||||
}
|
||||
|
@ -661,7 +661,7 @@ int main(int argc, char** argv)
|
|||
npdsch_cfg.grant.start_sfidx,
|
||||
npdsch_cfg.grant.nof_sf);
|
||||
// Encode NPDSCH
|
||||
if (srslte_npdsch_encode(&npdsch, &npdsch_cfg, &softbuffer, data, sf_re_symbols)) {
|
||||
if (srsran_npdsch_encode(&npdsch, &npdsch_cfg, &softbuffer, data, sf_re_symbols)) {
|
||||
fprintf(stderr, "Error encoding NPDSCH\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
@ -674,32 +674,32 @@ int main(int argc, char** argv)
|
|||
#endif
|
||||
|
||||
/* Transform to OFDM symbols */
|
||||
srslte_ofdm_tx_sf(&ifft);
|
||||
srsran_ofdm_tx_sf(&ifft);
|
||||
|
||||
if (output_file_name && file_snr != -100.0) {
|
||||
// compute average energy per symbol
|
||||
float abs_avg = srslte_vec_avg_power_cf(output_buffer, sf_n_samples);
|
||||
float abs_avg = srsran_vec_avg_power_cf(output_buffer, sf_n_samples);
|
||||
|
||||
// find the noise spectral density
|
||||
float snr_lin = srslte_convert_dB_to_power(file_snr);
|
||||
float snr_lin = srsran_convert_dB_to_power(file_snr);
|
||||
float n0 = abs_avg / snr_lin;
|
||||
float nstd = sqrtf(n0 / 2);
|
||||
|
||||
// add some noise to the signal
|
||||
srslte_ch_awgn_c(output_buffer, output_buffer, nstd, sf_n_samples);
|
||||
srsran_ch_awgn_c(output_buffer, output_buffer, nstd, sf_n_samples);
|
||||
}
|
||||
|
||||
/* send to file or usrp */
|
||||
if (output_file_name) {
|
||||
// write to file
|
||||
if (!null_file_sink) {
|
||||
srslte_filesink_write(&fsink, output_buffer, sf_n_samples);
|
||||
srsran_filesink_write(&fsink, output_buffer, sf_n_samples);
|
||||
}
|
||||
usleep(1000);
|
||||
} else {
|
||||
#ifndef DISABLE_RF
|
||||
// TODO: output scaling needed?
|
||||
srslte_rf_send2(&radio, output_buffer, sf_n_samples, true, start_of_burst, false);
|
||||
srsran_rf_send2(&radio, output_buffer, sf_n_samples, true, start_of_burst, false);
|
||||
start_of_burst = false;
|
||||
#endif
|
||||
}
|
||||
|
@ -717,5 +717,5 @@ int main(int argc, char** argv)
|
|||
|
||||
printf("Done\n");
|
||||
|
||||
return SRSLTE_SUCCESS;
|
||||
return SRSRAN_SUCCESS;
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
*
|
||||
* \section COPYRIGHT
|
||||
*
|
||||
* Copyright 2013-2020 Software Radio Systems Limited
|
||||
* Copyright 2013-2021 Software Radio Systems Limited
|
||||
*
|
||||
* By using this file, you agree to the terms and conditions set
|
||||
* forth in the LICENSE file which can be found at the top level of
|
||||
|
@ -23,31 +23,31 @@
|
|||
#include <unistd.h>
|
||||
|
||||
#include "npdsch_ue_helper.h"
|
||||
#include "srslte/phy/ch_estimation/chest_dl_nbiot.h"
|
||||
#include "srslte/phy/channel/ch_awgn.h"
|
||||
#include "srslte/phy/io/filesink.h"
|
||||
#include "srslte/phy/io/filesource.h"
|
||||
#include "srslte/phy/ue/ue_dl_nbiot.h"
|
||||
#include "srslte/phy/ue/ue_mib_nbiot.h"
|
||||
#include "srslte/phy/ue/ue_sync_nbiot.h"
|
||||
#include "srslte/phy/utils/bit.h"
|
||||
#include "srsran/phy/ch_estimation/chest_dl_nbiot.h"
|
||||
#include "srsran/phy/channel/ch_awgn.h"
|
||||
#include "srsran/phy/io/filesink.h"
|
||||
#include "srsran/phy/io/filesource.h"
|
||||
#include "srsran/phy/ue/ue_dl_nbiot.h"
|
||||
#include "srsran/phy/ue/ue_mib_nbiot.h"
|
||||
#include "srsran/phy/ue/ue_sync_nbiot.h"
|
||||
#include "srsran/phy/utils/bit.h"
|
||||
|
||||
#undef ENABLE_AGC_DEFAULT
|
||||
|
||||
#ifndef DISABLE_RF
|
||||
#include "srslte/phy/rf/rf.h"
|
||||
#include "srslte/phy/rf/rf_utils.h"
|
||||
#include "srsran/phy/rf/rf.h"
|
||||
#include "srsran/phy/rf/rf_utils.h"
|
||||
|
||||
#define ENABLE_MANUAL_NSSS_SEARCH 0
|
||||
#define HAVE_PCAP 1
|
||||
|
||||
#if HAVE_PCAP
|
||||
#include "srslte/common/pcap.h"
|
||||
#include "srsran/common/pcap.h"
|
||||
#endif
|
||||
|
||||
cell_search_cfg_t cell_detect_config = {.max_frames_pbch = SRSLTE_DEFAULT_MAX_FRAMES_NPBCH,
|
||||
.max_frames_pss = SRSLTE_DEFAULT_MAX_FRAMES_NPSS,
|
||||
.nof_valid_pss_frames = SRSLTE_DEFAULT_NOF_VALID_NPSS_FRAMES,
|
||||
cell_search_cfg_t cell_detect_config = {.max_frames_pbch = SRSRAN_DEFAULT_MAX_FRAMES_NPBCH,
|
||||
.max_frames_pss = SRSRAN_DEFAULT_MAX_FRAMES_NPSS,
|
||||
.nof_valid_pss_frames = SRSRAN_DEFAULT_NOF_VALID_NPSS_FRAMES,
|
||||
.init_agc = 0,
|
||||
.force_tdd = false};
|
||||
|
||||
|
@ -69,7 +69,7 @@ bool plot_track = true;
|
|||
#define NPSS_FIND_PLOT_WIDTH 80
|
||||
//#define CORRECT_SAMPLE_OFFSET
|
||||
|
||||
static srslte_nbiot_si_params_t sib2_params;
|
||||
static srsran_nbiot_si_params_t sib2_params;
|
||||
|
||||
/**********************************************************************
|
||||
* Program arguments processing
|
||||
|
@ -101,8 +101,8 @@ void args_default(prog_args_t* args)
|
|||
args->disable_plots = false;
|
||||
args->disable_plots_except_constellation = false;
|
||||
args->nof_subframes = -1;
|
||||
args->rnti = SRSLTE_SIRNTI;
|
||||
args->n_id_ncell = SRSLTE_CELL_ID_UNKNOWN;
|
||||
args->rnti = SRSRAN_SIRNTI;
|
||||
args->n_id_ncell = SRSRAN_CELL_ID_UNKNOWN;
|
||||
args->is_r14 = true;
|
||||
args->input_file_name = NULL;
|
||||
args->disable_cfo = false;
|
||||
|
@ -155,7 +155,7 @@ void usage(prog_args_t* args, char* prog)
|
|||
printf("\t plots are disabled. Graphics library not available\n");
|
||||
#endif // ENABLE_GUI
|
||||
printf("\t-n nof_subframes [Default %d]\n", args->nof_subframes);
|
||||
printf("\t-v [set srslte_verbose to debug, default none]\n");
|
||||
printf("\t-v [set srsran_verbose to debug, default none]\n");
|
||||
}
|
||||
|
||||
void parse_args(prog_args_t* args, int argc, char** argv)
|
||||
|
@ -219,7 +219,7 @@ void parse_args(prog_args_t* args, int argc, char** argv)
|
|||
args->disable_plots_except_constellation = true;
|
||||
break;
|
||||
case 'v':
|
||||
srslte_verbose++;
|
||||
srsran_verbose++;
|
||||
break;
|
||||
default:
|
||||
usage(args, argv[0]);
|
||||
|
@ -233,7 +233,7 @@ void parse_args(prog_args_t* args, int argc, char** argv)
|
|||
}
|
||||
/**********************************************************************/
|
||||
|
||||
static uint8_t rx_tb[SRSLTE_MAX_DL_BITS_CAT_NB1]; // Byte buffer for rx'ed transport blocks
|
||||
static uint8_t rx_tb[SRSRAN_MAX_DL_BITS_CAT_NB1]; // Byte buffer for rx'ed transport blocks
|
||||
|
||||
bool go_exit = false;
|
||||
void sig_int_handler(int signo)
|
||||
|
@ -262,8 +262,8 @@ void pcap_pack_and_write(FILE* pcap_file,
|
|||
.ueid = 1,
|
||||
.isRetx = reTX,
|
||||
.crcStatusOK = crc_ok,
|
||||
.sysFrameNumber = (uint16_t)(tti / SRSLTE_NOF_SF_X_FRAME),
|
||||
.subFrameNumber = (uint16_t)(tti % SRSLTE_NOF_SF_X_FRAME),
|
||||
.sysFrameNumber = (uint16_t)(tti / SRSRAN_NOF_SF_X_FRAME),
|
||||
.subFrameNumber = (uint16_t)(tti % SRSRAN_NOF_SF_X_FRAME),
|
||||
.nbiotMode = 1};
|
||||
if (pdu) {
|
||||
LTE_PCAP_MAC_WritePDU(pcap_file, &context, pdu, pdu_len_bytes);
|
||||
|
@ -272,25 +272,25 @@ void pcap_pack_and_write(FILE* pcap_file,
|
|||
#endif
|
||||
|
||||
#ifndef DISABLE_RF
|
||||
int srslte_rf_recv_wrapper(void* h, void* data, uint32_t nsamples, srslte_timestamp_t* t)
|
||||
int srsran_rf_recv_wrapper(void* h, void* data, uint32_t nsamples, srsran_timestamp_t* t)
|
||||
{
|
||||
DEBUG(" ---- Receive %d samples ----", nsamples);
|
||||
return srslte_rf_recv_with_time(h, data, nsamples, true, &t->full_secs, &t->frac_secs);
|
||||
return srsran_rf_recv_with_time(h, data, nsamples, true, &t->full_secs, &t->frac_secs);
|
||||
}
|
||||
|
||||
void srslte_rf_set_rx_gain_th_wrapper_(void* h, float f)
|
||||
void srsran_rf_set_rx_gain_th_wrapper_(void* h, float f)
|
||||
{
|
||||
srslte_rf_set_rx_gain_th((srslte_rf_t*)h, f);
|
||||
srsran_rf_set_rx_gain_th((srsran_rf_t*)h, f);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
enum receiver_state { DECODE_MIB, DECODE_SIB, DECODE_NPDSCH } state;
|
||||
|
||||
static srslte_nbiot_cell_t cell = {};
|
||||
static srsran_nbiot_cell_t cell = {};
|
||||
|
||||
srslte_nbiot_ue_dl_t ue_dl;
|
||||
srslte_nbiot_ue_sync_t ue_sync;
|
||||
srsran_nbiot_ue_dl_t ue_dl;
|
||||
srsran_nbiot_ue_sync_t ue_sync;
|
||||
prog_args_t prog_args;
|
||||
|
||||
bool have_sib1 = false;
|
||||
|
@ -317,13 +317,13 @@ int main(int argc, char** argv)
|
|||
{
|
||||
int ret;
|
||||
int64_t sf_cnt;
|
||||
srslte_ue_mib_nbiot_t ue_mib;
|
||||
srsran_ue_mib_nbiot_t ue_mib;
|
||||
#ifndef DISABLE_RF
|
||||
srslte_rf_t rf;
|
||||
srsran_rf_t rf;
|
||||
#endif
|
||||
uint32_t nof_trials = 0;
|
||||
int n;
|
||||
uint8_t bch_payload[SRSLTE_MIB_NB_LEN] = {};
|
||||
uint8_t bch_payload[SRSRAN_MIB_NB_LEN] = {};
|
||||
int sfn_offset;
|
||||
float cfo = 0;
|
||||
|
||||
|
@ -339,40 +339,40 @@ int main(int argc, char** argv)
|
|||
sigprocmask(SIG_UNBLOCK, &sigset, NULL);
|
||||
signal(SIGINT, sig_int_handler);
|
||||
|
||||
cell.base.nof_prb = SRSLTE_NBIOT_DEFAULT_NUM_PRB_BASECELL;
|
||||
cell.nbiot_prb = SRSLTE_NBIOT_DEFAULT_PRB_OFFSET;
|
||||
cell.base.nof_prb = SRSRAN_NBIOT_DEFAULT_NUM_PRB_BASECELL;
|
||||
cell.nbiot_prb = SRSRAN_NBIOT_DEFAULT_PRB_OFFSET;
|
||||
cell.n_id_ncell = prog_args.n_id_ncell;
|
||||
cell.is_r14 = prog_args.is_r14;
|
||||
|
||||
#ifndef DISABLE_RF
|
||||
if (!prog_args.input_file_name) {
|
||||
printf("Opening RF device...\n");
|
||||
if (srslte_rf_open_devname(&rf, prog_args.rf_dev, prog_args.rf_args, 1)) {
|
||||
if (srsran_rf_open_devname(&rf, prog_args.rf_dev, prog_args.rf_args, 1)) {
|
||||
fprintf(stderr, "Error opening rf\n");
|
||||
exit(-1);
|
||||
}
|
||||
/* Set receiver gain */
|
||||
if (prog_args.rf_gain > 0) {
|
||||
srslte_rf_set_rx_gain(&rf, prog_args.rf_gain);
|
||||
srsran_rf_set_rx_gain(&rf, prog_args.rf_gain);
|
||||
printf("Set RX gain: %.1f dB\n", prog_args.rf_gain);
|
||||
} else {
|
||||
printf("Starting AGC thread...\n");
|
||||
if (srslte_rf_start_gain_thread(&rf, false)) {
|
||||
if (srsran_rf_start_gain_thread(&rf, false)) {
|
||||
fprintf(stderr, "Error opening rf\n");
|
||||
exit(-1);
|
||||
}
|
||||
srslte_rf_set_rx_gain(&rf, 50);
|
||||
srsran_rf_set_rx_gain(&rf, 50);
|
||||
cell_detect_config.init_agc = 50;
|
||||
}
|
||||
|
||||
// set transceiver frequency
|
||||
printf("Set RX freq: %.6f MHz\n", srslte_rf_set_rx_freq(&rf, 0, prog_args.rf_freq) / 1000000);
|
||||
printf("Set RX freq: %.6f MHz\n", srsran_rf_set_rx_freq(&rf, 0, prog_args.rf_freq) / 1000000);
|
||||
|
||||
// set sampling frequency
|
||||
int srate = srslte_sampling_freq_hz(cell.base.nof_prb);
|
||||
int srate = srsran_sampling_freq_hz(cell.base.nof_prb);
|
||||
if (srate != -1) {
|
||||
printf("Setting sampling rate %.2f MHz\n", (float)srate / 1e6);
|
||||
double srate_rf = srslte_rf_set_rx_srate(&rf, srate);
|
||||
double srate_rf = srsran_rf_set_rx_srate(&rf, srate);
|
||||
printf("Actual sampling rate %.2f MHz\n", srate_rf / 1e6);
|
||||
// We don't check the result rate with requested rate
|
||||
} else {
|
||||
|
@ -381,55 +381,55 @@ int main(int argc, char** argv)
|
|||
}
|
||||
|
||||
INFO("Stopping RF and flushing buffer...\r");
|
||||
srslte_rf_stop_rx_stream(&rf);
|
||||
srsran_rf_stop_rx_stream(&rf);
|
||||
|
||||
#if ENABLE_MANUAL_NSSS_SEARCH
|
||||
// determine n_id_ncell
|
||||
if (prog_args.n_id_ncell == SRSLTE_CELL_ID_UNKNOWN) {
|
||||
srslte_nsss_synch_t nsss;
|
||||
if (prog_args.n_id_ncell == SRSRAN_CELL_ID_UNKNOWN) {
|
||||
srsran_nsss_synch_t nsss;
|
||||
float nsss_peak_value;
|
||||
int input_len = srate * 10 / 1000 * 2; // capture two full frames to make sure we have one NSSS
|
||||
|
||||
cf_t* buffer = srslte_vec_cf_malloc(input_len * 2);
|
||||
cf_t* buffer = srsran_vec_cf_malloc(input_len * 2);
|
||||
if (!buffer) {
|
||||
perror("malloc");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
if (srslte_nsss_synch_init(&nsss, input_len, srate / 15000)) {
|
||||
if (srsran_nsss_synch_init(&nsss, input_len, srate / 15000)) {
|
||||
fprintf(stderr, "Error initializing NSSS object\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
srslte_rf_start_rx_stream(&rf, false);
|
||||
n = srslte_rf_recv(&rf, buffer, input_len, 1);
|
||||
srsran_rf_start_rx_stream(&rf, false);
|
||||
n = srsran_rf_recv(&rf, buffer, input_len, 1);
|
||||
if (n != input_len) {
|
||||
fprintf(stderr, "Error receiving samples\n");
|
||||
exit(-1);
|
||||
}
|
||||
srslte_rf_stop_rx_stream(&rf);
|
||||
srsran_rf_stop_rx_stream(&rf);
|
||||
|
||||
// trying to find NSSS
|
||||
printf("Detecting NSSS signal .. ");
|
||||
fflush(stdout);
|
||||
uint32_t sfn_partial;
|
||||
srslte_nsss_sync_find(&nsss, buffer, &nsss_peak_value, (uint32_t*)&cell.n_id_ncell, &sfn_partial);
|
||||
srsran_nsss_sync_find(&nsss, buffer, &nsss_peak_value, (uint32_t*)&cell.n_id_ncell, &sfn_partial);
|
||||
printf("done!");
|
||||
srslte_nsss_synch_free(&nsss);
|
||||
srsran_nsss_synch_free(&nsss);
|
||||
free(buffer);
|
||||
} else {
|
||||
cell.n_id_ncell = prog_args.n_id_ncell;
|
||||
}
|
||||
printf("\nSetting n_id_ncell to %d.\n", cell.n_id_ncell);
|
||||
#else
|
||||
if (cell.n_id_ncell == SRSLTE_CELL_ID_UNKNOWN) {
|
||||
if (cell.n_id_ncell == SRSRAN_CELL_ID_UNKNOWN) {
|
||||
uint32_t ntrial = 0;
|
||||
do {
|
||||
ret = rf_cell_search_nbiot(&rf, &cell_detect_config, &cell, &cfo);
|
||||
if (ret != SRSLTE_SUCCESS) {
|
||||
if (ret != SRSRAN_SUCCESS) {
|
||||
printf("Cell not found after %d trials. Trying again (Press Ctrl+C to exit)\n", ntrial++);
|
||||
}
|
||||
} while (ret != SRSLTE_SUCCESS && !go_exit);
|
||||
} while (ret != SRSRAN_SUCCESS && !go_exit);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -445,31 +445,31 @@ int main(int argc, char** argv)
|
|||
cell.base.nof_ports = prog_args.file_nof_ports;
|
||||
cell.nof_ports = prog_args.file_nof_ports;
|
||||
|
||||
if (srslte_ue_sync_nbiot_init_file(
|
||||
if (srsran_ue_sync_nbiot_init_file(
|
||||
&ue_sync, cell, prog_args.input_file_name, prog_args.file_offset_time, prog_args.file_offset_freq)) {
|
||||
fprintf(stderr, "Error initiating ue_sync\n");
|
||||
exit(-1);
|
||||
}
|
||||
} else {
|
||||
#ifndef DISABLE_RF
|
||||
if (srslte_ue_sync_nbiot_init(&ue_sync, cell, srslte_rf_recv_wrapper, (void*)&rf)) {
|
||||
if (srsran_ue_sync_nbiot_init(&ue_sync, cell, srsran_rf_recv_wrapper, (void*)&rf)) {
|
||||
fprintf(stderr, "Error initiating ue_sync\n");
|
||||
exit(-1);
|
||||
}
|
||||
// reduce AGC period to every 10th frame
|
||||
srslte_ue_sync_nbiot_set_agc_period(&ue_sync, 10);
|
||||
srsran_ue_sync_nbiot_set_agc_period(&ue_sync, 10);
|
||||
#endif
|
||||
}
|
||||
|
||||
// Allocate memory to fit a full frame (needed for time re-alignment)
|
||||
cf_t* buff_ptrs[SRSLTE_MAX_PORTS] = {NULL};
|
||||
buff_ptrs[0] = srslte_vec_cf_malloc(SRSLTE_SF_LEN_PRB_NBIOT * 10);
|
||||
cf_t* buff_ptrs[SRSRAN_MAX_PORTS] = {NULL};
|
||||
buff_ptrs[0] = srsran_vec_cf_malloc(SRSRAN_SF_LEN_PRB_NBIOT * 10);
|
||||
|
||||
if (srslte_ue_mib_nbiot_init(&ue_mib, buff_ptrs, SRSLTE_NBIOT_MAX_PRB)) {
|
||||
if (srsran_ue_mib_nbiot_init(&ue_mib, buff_ptrs, SRSRAN_NBIOT_MAX_PRB)) {
|
||||
fprintf(stderr, "Error initaiting UE MIB decoder\n");
|
||||
exit(-1);
|
||||
}
|
||||
if (srslte_ue_mib_nbiot_set_cell(&ue_mib, cell) != SRSLTE_SUCCESS) {
|
||||
if (srsran_ue_mib_nbiot_set_cell(&ue_mib, cell) != SRSRAN_SUCCESS) {
|
||||
fprintf(stderr, "Error setting cell configuration in UE MIB decoder\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
@ -485,7 +485,7 @@ int main(int argc, char** argv)
|
|||
|
||||
#ifndef DISABLE_RF
|
||||
if (!prog_args.input_file_name) {
|
||||
srslte_rf_start_rx_stream(&rf, false);
|
||||
srsran_rf_start_rx_stream(&rf, false);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -495,48 +495,48 @@ int main(int argc, char** argv)
|
|||
|
||||
#ifndef DISABLE_RF
|
||||
if (prog_args.rf_gain < 0) {
|
||||
srslte_ue_sync_nbiot_start_agc(&ue_sync, srslte_rf_set_rx_gain_th_wrapper_, cell_detect_config.init_agc);
|
||||
srsran_ue_sync_nbiot_start_agc(&ue_sync, srsran_rf_set_rx_gain_th_wrapper_, cell_detect_config.init_agc);
|
||||
}
|
||||
#endif
|
||||
#ifdef PRINT_CHANGE_SCHEDULIGN
|
||||
srslte_ra_nbiot_dl_dci_t old_dl_dci;
|
||||
bzero(&old_dl_dci, sizeof(srslte_ra_nbiot_dl_dci_t));
|
||||
srsran_ra_nbiot_dl_dci_t old_dl_dci;
|
||||
bzero(&old_dl_dci, sizeof(srsran_ra_nbiot_dl_dci_t));
|
||||
#endif
|
||||
|
||||
ue_sync.correct_cfo = !prog_args.disable_cfo;
|
||||
|
||||
// Set initial CFO for ue_sync
|
||||
srslte_ue_sync_nbiot_set_cfo(&ue_sync, cfo);
|
||||
srsran_ue_sync_nbiot_set_cfo(&ue_sync, cfo);
|
||||
|
||||
srslte_npbch_decode_reset(&ue_mib.npbch);
|
||||
srsran_npbch_decode_reset(&ue_mib.npbch);
|
||||
|
||||
INFO("\nEntering main loop...");
|
||||
while (!go_exit && (sf_cnt < prog_args.nof_subframes || prog_args.nof_subframes == -1)) {
|
||||
ret = srslte_ue_sync_nbiot_zerocopy_multi(&ue_sync, buff_ptrs);
|
||||
ret = srsran_ue_sync_nbiot_zerocopy_multi(&ue_sync, buff_ptrs);
|
||||
if (ret < 0) {
|
||||
fprintf(stderr, "Error calling srslte_nbiot_ue_sync_zerocopy_multi()\n");
|
||||
fprintf(stderr, "Error calling srsran_nbiot_ue_sync_zerocopy_multi()\n");
|
||||
break;
|
||||
}
|
||||
|
||||
#ifdef CORRECT_SAMPLE_OFFSET
|
||||
float sample_offset =
|
||||
(float)srslte_ue_sync_get_last_sample_offset(&ue_sync) + srslte_ue_sync_get_sfo(&ue_sync) / 1000;
|
||||
srslte_ue_dl_set_sample_offset(&ue_dl, sample_offset);
|
||||
(float)srsran_ue_sync_get_last_sample_offset(&ue_sync) + srsran_ue_sync_get_sfo(&ue_sync) / 1000;
|
||||
srsran_ue_dl_set_sample_offset(&ue_dl, sample_offset);
|
||||
#endif
|
||||
|
||||
// srslte_ue_sync_nbiot_zerocopy_multi() returns 1 if successfully read 1 aligned subframe
|
||||
// srsran_ue_sync_nbiot_zerocopy_multi() returns 1 if successfully read 1 aligned subframe
|
||||
if (ret == 1) {
|
||||
switch (state) {
|
||||
case DECODE_MIB:
|
||||
if (srslte_ue_sync_nbiot_get_sfidx(&ue_sync) == 0) {
|
||||
n = srslte_ue_mib_nbiot_decode(&ue_mib, buff_ptrs[0], bch_payload, &cell.nof_ports, &sfn_offset);
|
||||
if (srsran_ue_sync_nbiot_get_sfidx(&ue_sync) == 0) {
|
||||
n = srsran_ue_mib_nbiot_decode(&ue_mib, buff_ptrs[0], bch_payload, &cell.nof_ports, &sfn_offset);
|
||||
if (n < 0) {
|
||||
fprintf(stderr, "Error decoding UE MIB\n");
|
||||
exit(-1);
|
||||
} else if (n == SRSLTE_UE_MIB_NBIOT_FOUND) {
|
||||
printf("MIB received (CFO: %+6.2f kHz)\n", srslte_ue_sync_nbiot_get_cfo(&ue_sync) / 1000);
|
||||
srslte_mib_nb_t mib;
|
||||
srslte_npbch_mib_unpack(bch_payload, &mib);
|
||||
} else if (n == SRSRAN_UE_MIB_NBIOT_FOUND) {
|
||||
printf("MIB received (CFO: %+6.2f kHz)\n", srsran_ue_sync_nbiot_get_cfo(&ue_sync) / 1000);
|
||||
srsran_mib_nb_t mib;
|
||||
srsran_npbch_mib_unpack(bch_payload, &mib);
|
||||
|
||||
// update SFN and set deployment mode
|
||||
system_frame_number = (mib.sfn + sfn_offset) % 1024;
|
||||
|
@ -545,34 +545,34 @@ int main(int argc, char** argv)
|
|||
// set number of ports of base cell to that of NB-IoT cell (FIXME: read eutra-NumCRS-Ports-r13)
|
||||
cell.base.nof_ports = cell.nof_ports;
|
||||
|
||||
if (cell.mode == SRSLTE_NBIOT_MODE_INBAND_SAME_PCI) {
|
||||
if (cell.mode == SRSRAN_NBIOT_MODE_INBAND_SAME_PCI) {
|
||||
cell.base.id = cell.n_id_ncell;
|
||||
}
|
||||
|
||||
if (SRSLTE_VERBOSE_ISINFO()) {
|
||||
srslte_mib_nb_printf(stdout, cell, &mib);
|
||||
if (SRSRAN_VERBOSE_ISINFO()) {
|
||||
srsran_mib_nb_printf(stdout, cell, &mib);
|
||||
}
|
||||
|
||||
// Initialize DL
|
||||
if (srslte_nbiot_ue_dl_init(&ue_dl, buff_ptrs, SRSLTE_NBIOT_MAX_PRB, SRSLTE_NBIOT_NUM_RX_ANTENNAS)) {
|
||||
if (srsran_nbiot_ue_dl_init(&ue_dl, buff_ptrs, SRSRAN_NBIOT_MAX_PRB, SRSRAN_NBIOT_NUM_RX_ANTENNAS)) {
|
||||
fprintf(stderr, "Error initiating UE downlink processing module\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
if (srslte_nbiot_ue_dl_set_cell(&ue_dl, cell)) {
|
||||
if (srsran_nbiot_ue_dl_set_cell(&ue_dl, cell)) {
|
||||
fprintf(stderr, "Configuring cell in UE DL\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
// Configure downlink receiver with the MIB params and the RNTI we use
|
||||
srslte_nbiot_ue_dl_set_mib(&ue_dl, mib);
|
||||
srslte_nbiot_ue_dl_set_rnti(&ue_dl, prog_args.rnti);
|
||||
srsran_nbiot_ue_dl_set_mib(&ue_dl, mib);
|
||||
srsran_nbiot_ue_dl_set_rnti(&ue_dl, prog_args.rnti);
|
||||
|
||||
// Pretty-print MIB
|
||||
srslte_bit_pack_vector(bch_payload, rx_tb, SRSLTE_MIB_NB_CRC_LEN);
|
||||
srsran_bit_pack_vector(bch_payload, rx_tb, SRSRAN_MIB_NB_CRC_LEN);
|
||||
#ifdef ENABLE_GUI
|
||||
if (bcch_bch_to_pretty_string(
|
||||
rx_tb, SRSLTE_MIB_NB_CRC_LEN, mib_buffer_decode, sizeof(mib_buffer_decode))) {
|
||||
rx_tb, SRSRAN_MIB_NB_CRC_LEN, mib_buffer_decode, sizeof(mib_buffer_decode))) {
|
||||
fprintf(stderr, "Error decoding MIB\n");
|
||||
}
|
||||
#endif
|
||||
|
@ -581,16 +581,16 @@ int main(int argc, char** argv)
|
|||
// write to PCAP
|
||||
pcap_pack_and_write(pcap_file,
|
||||
rx_tb,
|
||||
SRSLTE_MIB_NB_CRC_LEN,
|
||||
SRSRAN_MIB_NB_CRC_LEN,
|
||||
0,
|
||||
true,
|
||||
system_frame_number * SRSLTE_NOF_SF_X_FRAME,
|
||||
system_frame_number * SRSRAN_NOF_SF_X_FRAME,
|
||||
0,
|
||||
DIRECTION_DOWNLINK,
|
||||
NO_RNTI);
|
||||
#endif
|
||||
// activate SIB1 decoding
|
||||
srslte_nbiot_ue_dl_decode_sib1(&ue_dl, system_frame_number);
|
||||
srsran_nbiot_ue_dl_decode_sib1(&ue_dl, system_frame_number);
|
||||
state = DECODE_SIB;
|
||||
}
|
||||
}
|
||||
|
@ -598,16 +598,16 @@ int main(int argc, char** argv)
|
|||
|
||||
case DECODE_SIB:
|
||||
if (!have_sib1) {
|
||||
int dec_ret = srslte_nbiot_ue_dl_decode_npdsch(&ue_dl,
|
||||
int dec_ret = srsran_nbiot_ue_dl_decode_npdsch(&ue_dl,
|
||||
&buff_ptrs[0][prog_args.time_offset],
|
||||
rx_tb,
|
||||
system_frame_number,
|
||||
srslte_ue_sync_nbiot_get_sfidx(&ue_sync),
|
||||
SRSLTE_SIRNTI);
|
||||
if (dec_ret == SRSLTE_SUCCESS) {
|
||||
srsran_ue_sync_nbiot_get_sfidx(&ue_sync),
|
||||
SRSRAN_SIRNTI);
|
||||
if (dec_ret == SRSRAN_SUCCESS) {
|
||||
printf("SIB1 received\n");
|
||||
srslte_sys_info_block_type_1_nb_t sib = {};
|
||||
srslte_npdsch_sib1_unpack(rx_tb, &sib);
|
||||
srsran_sys_info_block_type_1_nb_t sib = {};
|
||||
srsran_npdsch_sib1_unpack(rx_tb, &sib);
|
||||
hyper_frame_number = sib.hyper_sfn;
|
||||
|
||||
have_sib1 = true;
|
||||
|
@ -623,37 +623,37 @@ int main(int argc, char** argv)
|
|||
get_sib2_params(rx_tb, ue_dl.npdsch_cfg.grant.mcs[0].tbs / 8, &sib2_params);
|
||||
|
||||
// Activate SIB2 decoding
|
||||
srslte_nbiot_ue_dl_decode_sib(
|
||||
&ue_dl, hyper_frame_number, system_frame_number, SRSLTE_NBIOT_SI_TYPE_SIB2, sib2_params);
|
||||
srsran_nbiot_ue_dl_decode_sib(
|
||||
&ue_dl, hyper_frame_number, system_frame_number, SRSRAN_NBIOT_SI_TYPE_SIB2, sib2_params);
|
||||
#if HAVE_PCAP
|
||||
pcap_pack_and_write(pcap_file,
|
||||
rx_tb,
|
||||
ue_dl.npdsch_cfg.grant.mcs[0].tbs / 8,
|
||||
0,
|
||||
true,
|
||||
system_frame_number * 10 + srslte_ue_sync_nbiot_get_sfidx(&ue_sync),
|
||||
SRSLTE_SIRNTI,
|
||||
system_frame_number * 10 + srsran_ue_sync_nbiot_get_sfidx(&ue_sync),
|
||||
SRSRAN_SIRNTI,
|
||||
DIRECTION_DOWNLINK,
|
||||
SI_RNTI);
|
||||
#endif
|
||||
// if SIB1 was decoded in this subframe, skip processing it further
|
||||
break;
|
||||
} else if (dec_ret == SRSLTE_ERROR) {
|
||||
} else if (dec_ret == SRSRAN_ERROR) {
|
||||
// reactivate SIB1 grant
|
||||
if (srslte_nbiot_ue_dl_has_grant(&ue_dl) == false) {
|
||||
srslte_nbiot_ue_dl_decode_sib1(&ue_dl, system_frame_number);
|
||||
if (srsran_nbiot_ue_dl_has_grant(&ue_dl) == false) {
|
||||
srsran_nbiot_ue_dl_decode_sib1(&ue_dl, system_frame_number);
|
||||
}
|
||||
}
|
||||
} else if (!have_sib2 && !srslte_nbiot_ue_dl_is_sib1_sf(
|
||||
&ue_dl, system_frame_number, srslte_ue_sync_nbiot_get_sfidx(&ue_sync))) {
|
||||
} else if (!have_sib2 && !srsran_nbiot_ue_dl_is_sib1_sf(
|
||||
&ue_dl, system_frame_number, srsran_ue_sync_nbiot_get_sfidx(&ue_sync))) {
|
||||
// SIB2 is transmitted over multiple subframes, so this needs to be called more than once ..
|
||||
int dec_ret = srslte_nbiot_ue_dl_decode_npdsch(&ue_dl,
|
||||
int dec_ret = srsran_nbiot_ue_dl_decode_npdsch(&ue_dl,
|
||||
&buff_ptrs[0][prog_args.time_offset],
|
||||
rx_tb,
|
||||
system_frame_number,
|
||||
srslte_ue_sync_nbiot_get_sfidx(&ue_sync),
|
||||
SRSLTE_SIRNTI);
|
||||
if (dec_ret == SRSLTE_SUCCESS) {
|
||||
srsran_ue_sync_nbiot_get_sfidx(&ue_sync),
|
||||
SRSRAN_SIRNTI);
|
||||
if (dec_ret == SRSRAN_SUCCESS) {
|
||||
printf("SIB2 received\n");
|
||||
have_sib2 = true;
|
||||
|
||||
|
@ -670,80 +670,80 @@ int main(int argc, char** argv)
|
|||
ue_dl.npdsch_cfg.grant.mcs[0].tbs / 8,
|
||||
0,
|
||||
true,
|
||||
system_frame_number * 10 + srslte_ue_sync_nbiot_get_sfidx(&ue_sync),
|
||||
SRSLTE_SIRNTI,
|
||||
system_frame_number * 10 + srsran_ue_sync_nbiot_get_sfidx(&ue_sync),
|
||||
SRSRAN_SIRNTI,
|
||||
DIRECTION_DOWNLINK,
|
||||
SI_RNTI);
|
||||
#endif
|
||||
} else {
|
||||
// reactivate SIB2 grant
|
||||
if (srslte_nbiot_ue_dl_has_grant(&ue_dl) == false) {
|
||||
srslte_nbiot_ue_dl_decode_sib(
|
||||
&ue_dl, hyper_frame_number, system_frame_number, SRSLTE_NBIOT_SI_TYPE_SIB2, sib2_params);
|
||||
if (srsran_nbiot_ue_dl_has_grant(&ue_dl) == false) {
|
||||
srsran_nbiot_ue_dl_decode_sib(
|
||||
&ue_dl, hyper_frame_number, system_frame_number, SRSRAN_NBIOT_SI_TYPE_SIB2, sib2_params);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (have_sib1 && (have_sib2 || prog_args.skip_sib2)) {
|
||||
if (prog_args.rnti == SRSLTE_SIRNTI) {
|
||||
srslte_nbiot_ue_dl_decode_sib1(&ue_dl, system_frame_number);
|
||||
if (prog_args.rnti == SRSRAN_SIRNTI) {
|
||||
srsran_nbiot_ue_dl_decode_sib1(&ue_dl, system_frame_number);
|
||||
}
|
||||
state = DECODE_NPDSCH;
|
||||
}
|
||||
break;
|
||||
case DECODE_NPDSCH:
|
||||
if (prog_args.rnti != SRSLTE_SIRNTI) {
|
||||
if (srslte_nbiot_ue_dl_has_grant(&ue_dl)) {
|
||||
if (prog_args.rnti != SRSRAN_SIRNTI) {
|
||||
if (srsran_nbiot_ue_dl_has_grant(&ue_dl)) {
|
||||
// attempt to decode NPDSCH
|
||||
n = srslte_nbiot_ue_dl_decode_npdsch(&ue_dl,
|
||||
n = srsran_nbiot_ue_dl_decode_npdsch(&ue_dl,
|
||||
&buff_ptrs[0][prog_args.time_offset],
|
||||
rx_tb,
|
||||
system_frame_number,
|
||||
srslte_ue_sync_nbiot_get_sfidx(&ue_sync),
|
||||
srsran_ue_sync_nbiot_get_sfidx(&ue_sync),
|
||||
prog_args.rnti);
|
||||
if (n == SRSLTE_SUCCESS) {
|
||||
if (n == SRSRAN_SUCCESS) {
|
||||
INFO("NPDSCH decoded ok.");
|
||||
}
|
||||
} else {
|
||||
// decode NPDCCH
|
||||
srslte_dci_msg_t dci_msg;
|
||||
n = srslte_nbiot_ue_dl_decode_npdcch(&ue_dl,
|
||||
srsran_dci_msg_t dci_msg;
|
||||
n = srsran_nbiot_ue_dl_decode_npdcch(&ue_dl,
|
||||
&buff_ptrs[0][prog_args.time_offset],
|
||||
system_frame_number,
|
||||
srslte_ue_sync_nbiot_get_sfidx(&ue_sync),
|
||||
srsran_ue_sync_nbiot_get_sfidx(&ue_sync),
|
||||
prog_args.rnti,
|
||||
&dci_msg);
|
||||
if (n == SRSLTE_NBIOT_UE_DL_FOUND_DCI) {
|
||||
if (n == SRSRAN_NBIOT_UE_DL_FOUND_DCI) {
|
||||
INFO("DCI found for rnti=%d", prog_args.rnti);
|
||||
// convert DCI to grant
|
||||
srslte_ra_nbiot_dl_dci_t dci_unpacked;
|
||||
srslte_ra_nbiot_dl_grant_t grant;
|
||||
if (srslte_nbiot_dci_msg_to_dl_grant(&dci_msg,
|
||||
srsran_ra_nbiot_dl_dci_t dci_unpacked;
|
||||
srsran_ra_nbiot_dl_grant_t grant;
|
||||
if (srsran_nbiot_dci_msg_to_dl_grant(&dci_msg,
|
||||
prog_args.rnti,
|
||||
&dci_unpacked,
|
||||
&grant,
|
||||
system_frame_number,
|
||||
srslte_ue_sync_nbiot_get_sfidx(&ue_sync),
|
||||
srsran_ue_sync_nbiot_get_sfidx(&ue_sync),
|
||||
64 /* TODO: remove */,
|
||||
cell.mode)) {
|
||||
fprintf(stderr, "Error unpacking DCI\n");
|
||||
return SRSLTE_ERROR;
|
||||
return SRSRAN_ERROR;
|
||||
}
|
||||
// activate grant
|
||||
srslte_nbiot_ue_dl_set_grant(&ue_dl, &grant);
|
||||
srsran_nbiot_ue_dl_set_grant(&ue_dl, &grant);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// decode SIB1 over and over again
|
||||
n = srslte_nbiot_ue_dl_decode_npdsch(&ue_dl,
|
||||
n = srsran_nbiot_ue_dl_decode_npdsch(&ue_dl,
|
||||
&buff_ptrs[0][prog_args.time_offset],
|
||||
rx_tb,
|
||||
system_frame_number,
|
||||
srslte_ue_sync_nbiot_get_sfidx(&ue_sync),
|
||||
srsran_ue_sync_nbiot_get_sfidx(&ue_sync),
|
||||
prog_args.rnti);
|
||||
|
||||
#ifdef ENABLE_GUI
|
||||
if (n == SRSLTE_SUCCESS) {
|
||||
if (n == SRSRAN_SUCCESS) {
|
||||
if (bcch_dl_sch_to_pretty_string(
|
||||
rx_tb, ue_dl.npdsch_cfg.grant.mcs[0].tbs / 8, sib1_buffer_decode, sizeof(sib1_buffer_decode))) {
|
||||
fprintf(stderr, "Error decoding SIB1\n");
|
||||
|
@ -752,16 +752,16 @@ int main(int argc, char** argv)
|
|||
#endif // ENABLE_GUI
|
||||
|
||||
// reactivate SIB1 grant
|
||||
if (srslte_nbiot_ue_dl_has_grant(&ue_dl) == false) {
|
||||
srslte_nbiot_ue_dl_decode_sib1(&ue_dl, system_frame_number);
|
||||
if (srsran_nbiot_ue_dl_has_grant(&ue_dl) == false) {
|
||||
srsran_nbiot_ue_dl_decode_sib1(&ue_dl, system_frame_number);
|
||||
}
|
||||
}
|
||||
|
||||
nof_trials++;
|
||||
|
||||
rsrq = SRSLTE_VEC_EMA(srslte_chest_dl_nbiot_get_rsrq(&ue_dl.chest), rsrq, 0.1);
|
||||
rsrp = SRSLTE_VEC_EMA(srslte_chest_dl_nbiot_get_rsrp(&ue_dl.chest), rsrp, 0.05);
|
||||
noise = SRSLTE_VEC_EMA(srslte_chest_dl_nbiot_get_noise_estimate(&ue_dl.chest), noise, 0.05);
|
||||
rsrq = SRSRAN_VEC_EMA(srsran_chest_dl_nbiot_get_rsrq(&ue_dl.chest), rsrq, 0.1);
|
||||
rsrp = SRSRAN_VEC_EMA(srsran_chest_dl_nbiot_get_rsrp(&ue_dl.chest), rsrp, 0.05);
|
||||
noise = SRSRAN_VEC_EMA(srsran_chest_dl_nbiot_get_noise_estimate(&ue_dl.chest), noise, 0.05);
|
||||
nframes++;
|
||||
if (isnan(rsrq)) {
|
||||
rsrq = 0;
|
||||
|
@ -774,16 +774,16 @@ int main(int argc, char** argv)
|
|||
}
|
||||
|
||||
// Plot and Printf
|
||||
if (srslte_ue_sync_nbiot_get_sfidx(&ue_sync) == 5) {
|
||||
if (srsran_ue_sync_nbiot_get_sfidx(&ue_sync) == 5) {
|
||||
float gain = prog_args.rf_gain;
|
||||
if (gain < 0) {
|
||||
gain = 10 * log10(srslte_agc_get_gain(&ue_sync.agc));
|
||||
gain = 10 * log10(srsran_agc_get_gain(&ue_sync.agc));
|
||||
}
|
||||
printf(
|
||||
"CFO: %+6.2f kHz, RSRP: %4.1f dBm "
|
||||
"SNR: %4.1f dB, RSRQ: %4.1f dB, "
|
||||
"NPDCCH detected: %d, NPDSCH-BLER: %5.2f%% (%d of total %d), NPDSCH-Rate: %5.2f kbit/s\r",
|
||||
srslte_ue_sync_nbiot_get_cfo(&ue_sync) / 1000,
|
||||
srsran_ue_sync_nbiot_get_cfo(&ue_sync) / 1000,
|
||||
10 * log10(rsrp),
|
||||
10 * log10(rsrp / noise),
|
||||
10 * log10(rsrq),
|
||||
|
@ -791,12 +791,12 @@ int main(int argc, char** argv)
|
|||
(float)100 * ue_dl.pkt_errors / ue_dl.pkts_total,
|
||||
ue_dl.pkt_errors,
|
||||
ue_dl.pkts_total,
|
||||
(ue_dl.bits_total / ((system_frame_number * 10 + srslte_ue_sync_nbiot_get_sfidx(&ue_sync)) / 1000.0)) /
|
||||
(ue_dl.bits_total / ((system_frame_number * 10 + srsran_ue_sync_nbiot_get_sfidx(&ue_sync)) / 1000.0)) /
|
||||
1000.0);
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (srslte_ue_sync_nbiot_get_sfidx(&ue_sync) == 9) {
|
||||
if (srsran_ue_sync_nbiot_get_sfidx(&ue_sync) == 9) {
|
||||
system_frame_number++;
|
||||
if (system_frame_number == 1024) {
|
||||
system_frame_number = 0;
|
||||
|
@ -817,7 +817,7 @@ int main(int argc, char** argv)
|
|||
#ifdef ENABLE_GUI
|
||||
if (!prog_args.disable_plots) {
|
||||
if ((system_frame_number % 4) == 0) {
|
||||
plot_sf_idx = srslte_ue_sync_nbiot_get_sfidx(&ue_sync);
|
||||
plot_sf_idx = srsran_ue_sync_nbiot_get_sfidx(&ue_sync);
|
||||
plot_track = true;
|
||||
sem_post(&plot_sem);
|
||||
}
|
||||
|
@ -826,12 +826,12 @@ int main(int argc, char** argv)
|
|||
} else if (ret == 0) {
|
||||
state = DECODE_MIB;
|
||||
printf("Finding PSS... Peak: %8.1f, FrameCnt: %d, State: %d\r",
|
||||
srslte_sync_nbiot_get_peak_value(&ue_sync.sfind),
|
||||
srsran_sync_nbiot_get_peak_value(&ue_sync.sfind),
|
||||
ue_sync.frame_total_cnt,
|
||||
ue_sync.state);
|
||||
#ifdef ENABLE_GUI
|
||||
if (!prog_args.disable_plots) {
|
||||
plot_sf_idx = srslte_ue_sync_nbiot_get_sfidx(&ue_sync);
|
||||
plot_sf_idx = srsran_ue_sync_nbiot_get_sfidx(&ue_sync);
|
||||
plot_track = false;
|
||||
sem_post(&plot_sem);
|
||||
}
|
||||
|
@ -851,8 +851,8 @@ int main(int argc, char** argv)
|
|||
printf("dci_detected=%d\n", ue_dl.nof_detected);
|
||||
}
|
||||
|
||||
srslte_nbiot_ue_dl_free(&ue_dl);
|
||||
srslte_ue_sync_nbiot_free(&ue_sync);
|
||||
srsran_nbiot_ue_dl_free(&ue_dl);
|
||||
srsran_ue_sync_nbiot_free(&ue_sync);
|
||||
|
||||
#if HAVE_PCAP
|
||||
printf("Saving PCAP file\n");
|
||||
|
@ -861,9 +861,9 @@ int main(int argc, char** argv)
|
|||
|
||||
#ifndef DISABLE_RF
|
||||
if (!prog_args.input_file_name) {
|
||||
srslte_ue_mib_nbiot_free(&ue_mib);
|
||||
srslte_rf_close(&rf);
|
||||
for (int i = 0; i < SRSLTE_MAX_PORTS; i++) {
|
||||
srsran_ue_mib_nbiot_free(&ue_mib);
|
||||
srsran_rf_close(&rf);
|
||||
for (int i = 0; i < SRSRAN_MAX_PORTS; i++) {
|
||||
if (buff_ptrs[i] != NULL)
|
||||
free(buff_ptrs[i]);
|
||||
}
|
||||
|
@ -881,7 +881,7 @@ int main(int argc, char** argv)
|
|||
#endif // ENABLE_GUI
|
||||
|
||||
printf("\nBye\n");
|
||||
return SRSLTE_SUCCESS;
|
||||
return SRSRAN_SUCCESS;
|
||||
}
|
||||
|
||||
/**********************************************************************
|
||||
|
@ -905,7 +905,7 @@ float tmp_plot2[110 * 15 * 2048];
|
|||
|
||||
void* plot_thread_run(void* arg)
|
||||
{
|
||||
uint32_t nof_re = SRSLTE_SF_LEN_RE(ue_dl.cell.base.nof_prb, ue_dl.cell.base.cp);
|
||||
uint32_t nof_re = SRSRAN_SF_LEN_RE(ue_dl.cell.base.nof_prb, ue_dl.cell.base.cp);
|
||||
#if HAVE_RSRP_PLOT
|
||||
float rsrp_lin = 0;
|
||||
#endif
|
||||
|
@ -979,9 +979,9 @@ void* plot_thread_run(void* arg)
|
|||
tmp_plot[i] = -80;
|
||||
}
|
||||
}
|
||||
int numpoints = SRSLTE_NRE * 2;
|
||||
int numpoints = SRSRAN_NRE * 2;
|
||||
bzero(tmp_plot2, sizeof(float) * numpoints);
|
||||
int g = (numpoints - SRSLTE_NRE) / 2;
|
||||
int g = (numpoints - SRSRAN_NRE) / 2;
|
||||
for (int i = 0; i < 12 * ue_dl.cell.base.nof_prb; i++) {
|
||||
tmp_plot2[g + i] = 20 * log10(cabsf(ue_dl.ce[0][i]));
|
||||
if (isinf(tmp_plot2[g + i])) {
|
||||
|
@ -992,17 +992,17 @@ void* plot_thread_run(void* arg)
|
|||
|
||||
if (!prog_args.input_file_name) {
|
||||
if (plot_track) {
|
||||
srslte_npss_synch_t* pss_obj = &ue_sync.strack.npss;
|
||||
int max = srslte_vec_max_fi(pss_obj->conv_output_avg, pss_obj->frame_size + pss_obj->fft_size - 1);
|
||||
srslte_vec_sc_prod_fff(pss_obj->conv_output_avg,
|
||||
srsran_npss_synch_t* pss_obj = &ue_sync.strack.npss;
|
||||
int max = srsran_vec_max_fi(pss_obj->conv_output_avg, pss_obj->frame_size + pss_obj->fft_size - 1);
|
||||
srsran_vec_sc_prod_fff(pss_obj->conv_output_avg,
|
||||
1 / pss_obj->conv_output_avg[max],
|
||||
tmp_plot2,
|
||||
pss_obj->frame_size + pss_obj->fft_size - 1);
|
||||
plot_real_setNewData(&p_sync, &tmp_plot2[max - NPSS_FIND_PLOT_WIDTH / 2], NPSS_FIND_PLOT_WIDTH);
|
||||
} else {
|
||||
int len = SRSLTE_NPSS_CORR_FILTER_LEN + ue_sync.sfind.npss.frame_size - 1;
|
||||
int max = srslte_vec_max_fi(ue_sync.sfind.npss.conv_output_avg, len);
|
||||
srslte_vec_sc_prod_fff(
|
||||
int len = SRSRAN_NPSS_CORR_FILTER_LEN + ue_sync.sfind.npss.frame_size - 1;
|
||||
int max = srsran_vec_max_fi(ue_sync.sfind.npss.conv_output_avg, len);
|
||||
srsran_vec_sc_prod_fff(
|
||||
ue_sync.sfind.npss.conv_output_avg, 1 / ue_sync.sfind.npss.conv_output_avg[max], tmp_plot2, len);
|
||||
plot_real_setNewData(&p_sync, tmp_plot2, len);
|
||||
}
|
||||
|
@ -1010,7 +1010,7 @@ void* plot_thread_run(void* arg)
|
|||
|
||||
#if HAVE_RSRP_PLOT
|
||||
// get current RSRP estimate
|
||||
rsrp_lin = SRSLTE_VEC_EMA(srslte_chest_dl_nbiot_get_rsrp(&ue_dl.chest), rsrp_lin, 0.05);
|
||||
rsrp_lin = SRSRAN_VEC_EMA(srsran_chest_dl_nbiot_get_rsrp(&ue_dl.chest), rsrp_lin, 0.05);
|
||||
rsrp_table[rsrp_table_index++] = 10 * log10(rsrp_lin);
|
||||
if (rsrp_table_index == rsrp_num_plot) {
|
||||
rsrp_table_index = 0;
|
||||
|
@ -1035,7 +1035,7 @@ void* plot_thread_run(void* arg)
|
|||
snprintf(lable_buf, LABLE_MAX_LEN, "%d", cell.n_id_ncell);
|
||||
key_value_setValueText(&id_label, lable_buf);
|
||||
|
||||
key_value_setValueText(&mode_label, srslte_nbiot_mode_string(cell.mode));
|
||||
key_value_setValueText(&mode_label, srsran_nbiot_mode_string(cell.mode));
|
||||
|
||||
snprintf(lable_buf, LABLE_MAX_LEN, "%d / %d", hyper_frame_number, system_frame_number);
|
||||
key_value_setValueText(&hfn_label, lable_buf);
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
*
|
||||
* \section COPYRIGHT
|
||||
*
|
||||
* Copyright 2013-2020 Software Radio Systems Limited
|
||||
* Copyright 2013-2021 Software Radio Systems Limited
|
||||
*
|
||||
* By using this file, you agree to the terms and conditions set
|
||||
* forth in the LICENSE file which can be found at the top level of
|
||||
|
@ -11,12 +11,12 @@
|
|||
*/
|
||||
|
||||
#include "npdsch_ue_helper.h"
|
||||
#include "srslte/asn1/rrc_nbiot.h"
|
||||
#include "srslte/phy/utils/vector.h" // for SRSLTE_MIN
|
||||
#include "srsran/asn1/rrc_nbiot.h"
|
||||
#include "srsran/phy/utils/vector.h" // for SRSRAN_MIN
|
||||
|
||||
int get_sib2_params(const uint8_t* sib1_payload, const uint32_t len, srslte_nbiot_si_params_t* sib2_params)
|
||||
int get_sib2_params(const uint8_t* sib1_payload, const uint32_t len, srsran_nbiot_si_params_t* sib2_params)
|
||||
{
|
||||
memset(sib2_params, 0, sizeof(srslte_nbiot_si_params_t));
|
||||
memset(sib2_params, 0, sizeof(srsran_nbiot_si_params_t));
|
||||
|
||||
// unpack SIB
|
||||
asn1::rrc::bcch_dl_sch_msg_nb_s dlsch_msg;
|
||||
|
@ -24,7 +24,7 @@ int get_sib2_params(const uint8_t* sib1_payload, const uint32_t len, srslte_nbio
|
|||
asn1::SRSASN_CODE err = dlsch_msg.unpack(dlsch_bref);
|
||||
if (err != asn1::SRSASN_SUCCESS) {
|
||||
fprintf(stderr, "Error unpacking DL-SCH message\n");
|
||||
return SRSLTE_ERROR;
|
||||
return SRSRAN_ERROR;
|
||||
}
|
||||
|
||||
// set SIB2-NB parameters
|
||||
|
@ -38,7 +38,7 @@ int get_sib2_params(const uint8_t* sib1_payload, const uint32_t len, srslte_nbio
|
|||
sib2_params->si_tb = sched_info->si_tb_r13.to_number();
|
||||
sib2_params->si_window_length = dlsch_msg.msg.c1().sib_type1_r13().si_win_len_r13.to_number();
|
||||
|
||||
return SRSLTE_SUCCESS;
|
||||
return SRSRAN_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -54,16 +54,16 @@ int bcch_bch_to_pretty_string(const uint8_t* bcch_bch_payload,
|
|||
asn1::SRSASN_CODE err = bch_msg.unpack(bch_bref);
|
||||
if (err != asn1::SRSASN_SUCCESS) {
|
||||
fprintf(stderr, "Error unpacking BCCH message\n");
|
||||
return SRSLTE_ERROR;
|
||||
return SRSRAN_ERROR;
|
||||
}
|
||||
|
||||
asn1::json_writer json_writer;
|
||||
bch_msg.to_json(json_writer);
|
||||
|
||||
uint32_t output_len = SRSLTE_MIN(max_output_len, json_writer.to_string().length());
|
||||
uint32_t output_len = SRSRAN_MIN(max_output_len, json_writer.to_string().length());
|
||||
memcpy(output, json_writer.to_string().c_str(), output_len);
|
||||
|
||||
return SRSLTE_SUCCESS;
|
||||
return SRSRAN_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -79,14 +79,14 @@ int bcch_dl_sch_to_pretty_string(const uint8_t* bcch_dl_sch_payload,
|
|||
asn1::SRSASN_CODE err = dlsch_msg.unpack(dlsch_bref);
|
||||
if (err != asn1::SRSASN_SUCCESS) {
|
||||
fprintf(stderr, "Error unpacking DL-SCH message\n");
|
||||
return SRSLTE_ERROR;
|
||||
return SRSRAN_ERROR;
|
||||
}
|
||||
|
||||
asn1::json_writer json_writer;
|
||||
dlsch_msg.to_json(json_writer);
|
||||
|
||||
uint32_t output_len = SRSLTE_MIN(max_output_len, json_writer.to_string().length());
|
||||
uint32_t output_len = SRSRAN_MIN(max_output_len, json_writer.to_string().length());
|
||||
memcpy(output, json_writer.to_string().c_str(), output_len);
|
||||
|
||||
return SRSLTE_SUCCESS;
|
||||
return SRSRAN_SUCCESS;
|
||||
}
|
|
@ -2,7 +2,7 @@
|
|||
*
|
||||
* \section COPYRIGHT
|
||||
*
|
||||
* Copyright 2013-2020 Software Radio Systems Limited
|
||||
* Copyright 2013-2021 Software Radio Systems Limited
|
||||
*
|
||||
* By using this file, you agree to the terms and conditions set
|
||||
* forth in the LICENSE file which can be found at the top level of
|
||||
|
@ -10,17 +10,17 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#ifndef SRSLTE_NPDSCH_UE_HELPER_H
|
||||
#define SRSLTE_NPDSCH_UE_HELPER_H
|
||||
#ifndef SRSRAN_NPDSCH_UE_HELPER_H
|
||||
#define SRSRAN_NPDSCH_UE_HELPER_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "srslte/phy/phch/ra_nbiot.h"
|
||||
#include "srsran/phy/phch/ra_nbiot.h"
|
||||
#include <stdint.h>
|
||||
|
||||
int get_sib2_params(const uint8_t* sib1_payload, const uint32_t len, srslte_nbiot_si_params_t* sib2_params);
|
||||
int get_sib2_params(const uint8_t* sib1_payload, const uint32_t len, srsran_nbiot_si_params_t* sib2_params);
|
||||
int bcch_bch_to_pretty_string(const uint8_t* bcch_bch_payload,
|
||||
const uint32_t input_len,
|
||||
char* output,
|
||||
|
@ -34,4 +34,4 @@ int bcch_dl_sch_to_pretty_string(const uint8_t* bcch_dl_sch_payload,
|
|||
}
|
||||
#endif
|
||||
|
||||
#endif // SRSLTE_NPDSCH_UE_HELPER_H
|
||||
#endif // SRSRAN_NPDSCH_UE_HELPER_H
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
*
|
||||
* \section COPYRIGHT
|
||||
*
|
||||
* Copyright 2013-2020 Software Radio Systems Limited
|
||||
* Copyright 2013-2021 Software Radio Systems Limited
|
||||
*
|
||||
* By using this file, you agree to the terms and conditions set
|
||||
* forth in the LICENSE file which can be found at the top level of
|
||||
|
@ -10,9 +10,9 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#include "srslte/common/crash_handler.h"
|
||||
#include "srslte/common/gen_mch_tables.h"
|
||||
#include "srslte/srslte.h"
|
||||
#include "srsran/common/crash_handler.h"
|
||||
#include "srsran/common/gen_mch_tables.h"
|
||||
#include "srsran/srsran.h"
|
||||
#include <pthread.h>
|
||||
#include <semaphore.h>
|
||||
#include <signal.h>
|
||||
|
@ -27,9 +27,9 @@
|
|||
#define M_CRNTI 0xFFFD
|
||||
|
||||
#ifndef DISABLE_RF
|
||||
#include "srslte/phy/common/phy_common.h"
|
||||
#include "srslte/phy/rf/rf.h"
|
||||
srslte_rf_t radio;
|
||||
#include "srsran/phy/common/phy_common.h"
|
||||
#include "srsran/phy/rf/rf.h"
|
||||
srsran_rf_t radio;
|
||||
#else
|
||||
#pragma message "Compiling pdsch_ue with no RF support"
|
||||
#endif
|
||||
|
@ -43,21 +43,21 @@ static char* output_file_name = NULL;
|
|||
#define PAGE_UP 53
|
||||
#define PAGE_DOWN 54
|
||||
|
||||
static srslte_cell_t cell = {
|
||||
static srsran_cell_t cell = {
|
||||
25, // nof_prb
|
||||
1, // nof_ports
|
||||
0, // cell_id
|
||||
SRSLTE_CP_NORM, // cyclic prefix
|
||||
SRSLTE_PHICH_NORM, // PHICH length
|
||||
SRSLTE_PHICH_R_1, // PHICH resources
|
||||
SRSLTE_FDD,
|
||||
SRSRAN_CP_NORM, // cyclic prefix
|
||||
SRSRAN_PHICH_NORM, // PHICH length
|
||||
SRSRAN_PHICH_R_1, // PHICH resources
|
||||
SRSRAN_FDD,
|
||||
};
|
||||
|
||||
static int net_port = -1; // -1 generates random dataThat means there is some problem sending samples to the device
|
||||
static uint32_t cfi = 2;
|
||||
static uint32_t mcs_idx = 1, last_mcs_idx = 1;
|
||||
static int nof_frames = -1;
|
||||
static srslte_tm_t transmission_mode = SRSLTE_TM1;
|
||||
static srsran_tm_t transmission_mode = SRSRAN_TM1;
|
||||
static uint32_t nof_tb = 1;
|
||||
static uint32_t multiplex_pmi = 0;
|
||||
static uint32_t multiplex_nof_layers = 1;
|
||||
|
@ -71,30 +71,30 @@ static float output_file_snr = +INFINITY;
|
|||
static bool use_standard_lte_rate = false;
|
||||
|
||||
static bool null_file_sink = false;
|
||||
static srslte_filesink_t fsink;
|
||||
static srslte_ofdm_t ifft[SRSLTE_MAX_PORTS];
|
||||
static srslte_ofdm_t ifft_mbsfn;
|
||||
static srslte_pbch_t pbch;
|
||||
static srslte_pcfich_t pcfich;
|
||||
static srslte_pdcch_t pdcch;
|
||||
static srslte_pdsch_t pdsch;
|
||||
static srslte_pdsch_cfg_t pdsch_cfg;
|
||||
static srslte_pmch_t pmch;
|
||||
static srslte_pmch_cfg_t pmch_cfg;
|
||||
static srslte_softbuffer_tx_t* softbuffers[SRSLTE_MAX_CODEWORDS];
|
||||
static srslte_regs_t regs;
|
||||
static srslte_dci_dl_t dci_dl;
|
||||
static int rvidx[SRSLTE_MAX_CODEWORDS] = {0, 0};
|
||||
static srsran_filesink_t fsink;
|
||||
static srsran_ofdm_t ifft[SRSRAN_MAX_PORTS];
|
||||
static srsran_ofdm_t ifft_mbsfn;
|
||||
static srsran_pbch_t pbch;
|
||||
static srsran_pcfich_t pcfich;
|
||||
static srsran_pdcch_t pdcch;
|
||||
static srsran_pdsch_t pdsch;
|
||||
static srsran_pdsch_cfg_t pdsch_cfg;
|
||||
static srsran_pmch_t pmch;
|
||||
static srsran_pmch_cfg_t pmch_cfg;
|
||||
static srsran_softbuffer_tx_t* softbuffers[SRSRAN_MAX_CODEWORDS];
|
||||
static srsran_regs_t regs;
|
||||
static srsran_dci_dl_t dci_dl;
|
||||
static int rvidx[SRSRAN_MAX_CODEWORDS] = {0, 0};
|
||||
|
||||
static cf_t * sf_buffer[SRSLTE_MAX_PORTS] = {NULL}, *output_buffer[SRSLTE_MAX_PORTS] = {NULL};
|
||||
static cf_t * sf_buffer[SRSRAN_MAX_PORTS] = {NULL}, *output_buffer[SRSRAN_MAX_PORTS] = {NULL};
|
||||
static uint32_t sf_n_re, sf_n_samples;
|
||||
|
||||
static pthread_t net_thread;
|
||||
static void* net_thread_fnc(void* arg);
|
||||
static sem_t net_sem;
|
||||
static bool net_packet_ready = false;
|
||||
static srslte_netsource_t net_source;
|
||||
static srslte_netsink_t net_sink;
|
||||
static srsran_netsource_t net_source;
|
||||
static srsran_netsink_t net_sink;
|
||||
|
||||
static int prbset_num = 1, last_prbset_num = 1;
|
||||
static int prbset_orig = 0;
|
||||
|
@ -130,7 +130,7 @@ static void usage(char* prog)
|
|||
printf("\t-u listen TCP/UDP port for input data (if mbsfn is active then the stream is over mbsfn only) (-1 is "
|
||||
"random) [Default %d]\n",
|
||||
net_port);
|
||||
printf("\t-v [set srslte_verbose to debug, default none]\n");
|
||||
printf("\t-v [set srsran_verbose to debug, default none]\n");
|
||||
printf("\t-s output file SNR [Default %f]\n", output_file_snr);
|
||||
printf("\t-q Enable/Disable 256QAM modulation (default %s)\n", enable_256qam ? "enabled" : "disabled");
|
||||
printf("\t-Q Use standard LTE sample rates (default %s)\n", use_standard_lte_rate ? "enabled" : "disabled");
|
||||
|
@ -177,7 +177,7 @@ static void parse_args(int argc, char** argv)
|
|||
cell.id = (uint32_t)strtol(argv[optind], NULL, 10);
|
||||
break;
|
||||
case 'x':
|
||||
transmission_mode = (srslte_tm_t)(strtol(argv[optind], NULL, 10) - 1);
|
||||
transmission_mode = (srsran_tm_t)(strtol(argv[optind], NULL, 10) - 1);
|
||||
break;
|
||||
case 'b':
|
||||
multiplex_pmi = (uint32_t)strtol(argv[optind], NULL, 10);
|
||||
|
@ -189,7 +189,7 @@ static void parse_args(int argc, char** argv)
|
|||
mbsfn_area_id = (int)strtol(argv[optind], NULL, 10);
|
||||
break;
|
||||
case 'v':
|
||||
srslte_verbose++;
|
||||
srsran_verbose++;
|
||||
break;
|
||||
case 's':
|
||||
output_file_snr = strtof(argv[optind], NULL);
|
||||
|
@ -222,12 +222,12 @@ static void base_init()
|
|||
|
||||
/* Configure cell and PDSCH in function of the transmission mode */
|
||||
switch (transmission_mode) {
|
||||
case SRSLTE_TM1:
|
||||
case SRSRAN_TM1:
|
||||
cell.nof_ports = 1;
|
||||
break;
|
||||
case SRSLTE_TM2:
|
||||
case SRSLTE_TM3:
|
||||
case SRSLTE_TM4:
|
||||
case SRSRAN_TM2:
|
||||
case SRSRAN_TM3:
|
||||
case SRSRAN_TM4:
|
||||
cell.nof_ports = 2;
|
||||
break;
|
||||
default:
|
||||
|
@ -236,38 +236,38 @@ static void base_init()
|
|||
}
|
||||
|
||||
/* Allocate memory */
|
||||
for (i = 0; i < SRSLTE_MAX_CODEWORDS; i++) {
|
||||
data[i] = srslte_vec_u8_malloc(SOFTBUFFER_SIZE);
|
||||
for (i = 0; i < SRSRAN_MAX_CODEWORDS; i++) {
|
||||
data[i] = srsran_vec_u8_malloc(SOFTBUFFER_SIZE);
|
||||
if (!data[i]) {
|
||||
perror("malloc");
|
||||
exit(-1);
|
||||
}
|
||||
bzero(data[i], sizeof(uint8_t) * SOFTBUFFER_SIZE);
|
||||
}
|
||||
data_mbms = srslte_vec_u8_malloc(SOFTBUFFER_SIZE);
|
||||
data_mbms = srsran_vec_u8_malloc(SOFTBUFFER_SIZE);
|
||||
|
||||
/* init memory */
|
||||
for (i = 0; i < SRSLTE_MAX_PORTS; i++) {
|
||||
sf_buffer[i] = srslte_vec_cf_malloc(sf_n_re);
|
||||
for (i = 0; i < SRSRAN_MAX_PORTS; i++) {
|
||||
sf_buffer[i] = srsran_vec_cf_malloc(sf_n_re);
|
||||
if (!sf_buffer[i]) {
|
||||
perror("malloc");
|
||||
exit(-1);
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < SRSLTE_MAX_PORTS; i++) {
|
||||
output_buffer[i] = srslte_vec_cf_malloc(sf_n_samples);
|
||||
for (i = 0; i < SRSRAN_MAX_PORTS; i++) {
|
||||
output_buffer[i] = srsran_vec_cf_malloc(sf_n_samples);
|
||||
if (!output_buffer[i]) {
|
||||
perror("malloc");
|
||||
exit(-1);
|
||||
}
|
||||
srslte_vec_cf_zero(output_buffer[i], sf_n_samples);
|
||||
srsran_vec_cf_zero(output_buffer[i], sf_n_samples);
|
||||
}
|
||||
|
||||
/* open file or USRP */
|
||||
if (output_file_name) {
|
||||
if (strcmp(output_file_name, "NULL")) {
|
||||
if (srslte_filesink_init(&fsink, output_file_name, SRSLTE_COMPLEX_FLOAT_BIN)) {
|
||||
if (srsran_filesink_init(&fsink, output_file_name, SRSRAN_COMPLEX_FLOAT_BIN)) {
|
||||
ERROR("Error opening file %s", output_file_name);
|
||||
exit(-1);
|
||||
}
|
||||
|
@ -278,7 +278,7 @@ static void base_init()
|
|||
} else {
|
||||
#ifndef DISABLE_RF
|
||||
printf("Opening RF device...\n");
|
||||
if (srslte_rf_open_devname(&radio, rf_dev, rf_args, cell.nof_ports)) {
|
||||
if (srsran_rf_open_devname(&radio, rf_dev, rf_args, cell.nof_ports)) {
|
||||
fprintf(stderr, "Error opening rf\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
@ -289,12 +289,12 @@ static void base_init()
|
|||
}
|
||||
|
||||
if (net_port > 0) {
|
||||
if (srslte_netsource_init(&net_source, "127.0.0.1", net_port, SRSLTE_NETSOURCE_UDP)) {
|
||||
if (srsran_netsource_init(&net_source, "127.0.0.1", net_port, SRSRAN_NETSOURCE_UDP)) {
|
||||
ERROR("Error creating input UDP socket at port %d", net_port);
|
||||
exit(-1);
|
||||
}
|
||||
if (null_file_sink) {
|
||||
if (srslte_netsink_init(&net_sink, "127.0.0.1", net_port + 1, SRSLTE_NETSINK_TCP)) {
|
||||
if (srsran_netsink_init(&net_sink, "127.0.0.1", net_port + 1, SRSRAN_NETSINK_TCP)) {
|
||||
ERROR("Error sink");
|
||||
exit(-1);
|
||||
}
|
||||
|
@ -307,76 +307,76 @@ static void base_init()
|
|||
|
||||
/* create ifft object */
|
||||
for (i = 0; i < cell.nof_ports; i++) {
|
||||
if (srslte_ofdm_tx_init(&ifft[i], SRSLTE_CP_NORM, sf_buffer[i], output_buffer[i], cell.nof_prb)) {
|
||||
if (srsran_ofdm_tx_init(&ifft[i], SRSRAN_CP_NORM, sf_buffer[i], output_buffer[i], cell.nof_prb)) {
|
||||
ERROR("Error creating iFFT object");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
srslte_ofdm_set_normalize(&ifft[i], true);
|
||||
srsran_ofdm_set_normalize(&ifft[i], true);
|
||||
}
|
||||
|
||||
if (srslte_ofdm_tx_init_mbsfn(&ifft_mbsfn, SRSLTE_CP_EXT, sf_buffer[0], output_buffer[0], cell.nof_prb)) {
|
||||
if (srsran_ofdm_tx_init_mbsfn(&ifft_mbsfn, SRSRAN_CP_EXT, sf_buffer[0], output_buffer[0], cell.nof_prb)) {
|
||||
ERROR("Error creating iFFT object");
|
||||
exit(-1);
|
||||
}
|
||||
srslte_ofdm_set_non_mbsfn_region(&ifft_mbsfn, 2);
|
||||
srslte_ofdm_set_normalize(&ifft_mbsfn, true);
|
||||
srsran_ofdm_set_non_mbsfn_region(&ifft_mbsfn, 2);
|
||||
srsran_ofdm_set_normalize(&ifft_mbsfn, true);
|
||||
|
||||
if (srslte_pbch_init(&pbch)) {
|
||||
if (srsran_pbch_init(&pbch)) {
|
||||
ERROR("Error creating PBCH object");
|
||||
exit(-1);
|
||||
}
|
||||
if (srslte_pbch_set_cell(&pbch, cell)) {
|
||||
if (srsran_pbch_set_cell(&pbch, cell)) {
|
||||
ERROR("Error creating PBCH object");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
if (srslte_regs_init(®s, cell)) {
|
||||
if (srsran_regs_init(®s, cell)) {
|
||||
ERROR("Error initiating regs");
|
||||
exit(-1);
|
||||
}
|
||||
if (srslte_pcfich_init(&pcfich, 1)) {
|
||||
if (srsran_pcfich_init(&pcfich, 1)) {
|
||||
ERROR("Error creating PBCH object");
|
||||
exit(-1);
|
||||
}
|
||||
if (srslte_pcfich_set_cell(&pcfich, ®s, cell)) {
|
||||
if (srsran_pcfich_set_cell(&pcfich, ®s, cell)) {
|
||||
ERROR("Error creating PBCH object");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
if (srslte_pdcch_init_enb(&pdcch, cell.nof_prb)) {
|
||||
if (srsran_pdcch_init_enb(&pdcch, cell.nof_prb)) {
|
||||
ERROR("Error creating PDCCH object");
|
||||
exit(-1);
|
||||
}
|
||||
if (srslte_pdcch_set_cell(&pdcch, ®s, cell)) {
|
||||
if (srsran_pdcch_set_cell(&pdcch, ®s, cell)) {
|
||||
ERROR("Error creating PDCCH object");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
if (srslte_pdsch_init_enb(&pdsch, cell.nof_prb)) {
|
||||
if (srsran_pdsch_init_enb(&pdsch, cell.nof_prb)) {
|
||||
ERROR("Error creating PDSCH object");
|
||||
exit(-1);
|
||||
}
|
||||
if (srslte_pdsch_set_cell(&pdsch, cell)) {
|
||||
if (srsran_pdsch_set_cell(&pdsch, cell)) {
|
||||
ERROR("Error creating PDSCH object");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
if (mbsfn_area_id > -1) {
|
||||
if (srslte_pmch_init(&pmch, cell.nof_prb, 1)) {
|
||||
if (srsran_pmch_init(&pmch, cell.nof_prb, 1)) {
|
||||
ERROR("Error creating PMCH object");
|
||||
}
|
||||
srslte_pmch_set_area_id(&pmch, mbsfn_area_id);
|
||||
srsran_pmch_set_area_id(&pmch, mbsfn_area_id);
|
||||
}
|
||||
|
||||
for (i = 0; i < SRSLTE_MAX_CODEWORDS; i++) {
|
||||
softbuffers[i] = calloc(sizeof(srslte_softbuffer_tx_t), 1);
|
||||
for (i = 0; i < SRSRAN_MAX_CODEWORDS; i++) {
|
||||
softbuffers[i] = calloc(sizeof(srsran_softbuffer_tx_t), 1);
|
||||
if (!softbuffers[i]) {
|
||||
ERROR("Error allocating soft buffer");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
if (srslte_softbuffer_tx_init(softbuffers[i], cell.nof_prb)) {
|
||||
if (srsran_softbuffer_tx_init(softbuffers[i], cell.nof_prb)) {
|
||||
ERROR("Error initiating soft buffer");
|
||||
exit(-1);
|
||||
}
|
||||
|
@ -386,31 +386,31 @@ static void base_init()
|
|||
static void base_free()
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < SRSLTE_MAX_CODEWORDS; i++) {
|
||||
srslte_softbuffer_tx_free(softbuffers[i]);
|
||||
for (i = 0; i < SRSRAN_MAX_CODEWORDS; i++) {
|
||||
srsran_softbuffer_tx_free(softbuffers[i]);
|
||||
if (softbuffers[i]) {
|
||||
free(softbuffers[i]);
|
||||
}
|
||||
}
|
||||
srslte_pdsch_free(&pdsch);
|
||||
srslte_pdcch_free(&pdcch);
|
||||
srslte_regs_free(®s);
|
||||
srslte_pbch_free(&pbch);
|
||||
srsran_pdsch_free(&pdsch);
|
||||
srsran_pdcch_free(&pdcch);
|
||||
srsran_regs_free(®s);
|
||||
srsran_pbch_free(&pbch);
|
||||
if (mbsfn_area_id > -1) {
|
||||
srslte_pmch_free(&pmch);
|
||||
srsran_pmch_free(&pmch);
|
||||
}
|
||||
srslte_ofdm_tx_free(&ifft_mbsfn);
|
||||
srsran_ofdm_tx_free(&ifft_mbsfn);
|
||||
for (i = 0; i < cell.nof_ports; i++) {
|
||||
srslte_ofdm_tx_free(&ifft[i]);
|
||||
srsran_ofdm_tx_free(&ifft[i]);
|
||||
}
|
||||
|
||||
for (i = 0; i < SRSLTE_MAX_CODEWORDS; i++) {
|
||||
for (i = 0; i < SRSRAN_MAX_CODEWORDS; i++) {
|
||||
if (data[i]) {
|
||||
free(data[i]);
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < SRSLTE_MAX_PORTS; i++) {
|
||||
for (i = 0; i < SRSRAN_MAX_PORTS; i++) {
|
||||
if (sf_buffer[i]) {
|
||||
free(sf_buffer[i]);
|
||||
}
|
||||
|
@ -421,16 +421,16 @@ static void base_free()
|
|||
}
|
||||
if (output_file_name) {
|
||||
if (!null_file_sink) {
|
||||
srslte_filesink_free(&fsink);
|
||||
srsran_filesink_free(&fsink);
|
||||
}
|
||||
} else {
|
||||
#ifndef DISABLE_RF
|
||||
srslte_rf_close(&radio);
|
||||
srsran_rf_close(&radio);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (net_port > 0) {
|
||||
srslte_netsource_free(&net_source);
|
||||
srsran_netsource_free(&net_source);
|
||||
sem_close(&net_sem);
|
||||
}
|
||||
}
|
||||
|
@ -458,7 +458,7 @@ static unsigned int reverse(register unsigned int x)
|
|||
static uint32_t prbset_to_bitmask()
|
||||
{
|
||||
uint32_t mask = 0;
|
||||
int nb = (int)ceilf((float)cell.nof_prb / srslte_ra_type0_P(cell.nof_prb));
|
||||
int nb = (int)ceilf((float)cell.nof_prb / srsran_ra_type0_P(cell.nof_prb));
|
||||
for (int i = 0; i < nb; i++) {
|
||||
if (i >= prbset_orig && i < prbset_orig + prbset_num) {
|
||||
mask = mask | (0x1 << i);
|
||||
|
@ -473,17 +473,17 @@ static int update_radl()
|
|||
|
||||
/* Configure cell and PDSCH in function of the transmission mode */
|
||||
switch (transmission_mode) {
|
||||
case SRSLTE_TM1:
|
||||
case SRSLTE_TM2:
|
||||
case SRSRAN_TM1:
|
||||
case SRSRAN_TM2:
|
||||
nof_tb = 1;
|
||||
dci_dl.format = SRSLTE_DCI_FORMAT1;
|
||||
dci_dl.format = SRSRAN_DCI_FORMAT1;
|
||||
break;
|
||||
case SRSLTE_TM3:
|
||||
dci_dl.format = SRSLTE_DCI_FORMAT2A;
|
||||
case SRSRAN_TM3:
|
||||
dci_dl.format = SRSRAN_DCI_FORMAT2A;
|
||||
nof_tb = 2;
|
||||
break;
|
||||
case SRSLTE_TM4:
|
||||
dci_dl.format = SRSLTE_DCI_FORMAT2;
|
||||
case SRSRAN_TM4:
|
||||
dci_dl.format = SRSRAN_DCI_FORMAT2;
|
||||
nof_tb = multiplex_nof_layers;
|
||||
if (multiplex_nof_layers == 1) {
|
||||
dci_dl.pinfo = (uint8_t)(multiplex_pmi + 1);
|
||||
|
@ -502,7 +502,7 @@ static int update_radl()
|
|||
dci_dl.tb[0].ndi = 0;
|
||||
dci_dl.tb[0].rv = rvidx[0];
|
||||
dci_dl.tb[0].cw_idx = 0;
|
||||
dci_dl.alloc_type = SRSLTE_RA_ALLOC_TYPE0;
|
||||
dci_dl.alloc_type = SRSRAN_RA_ALLOC_TYPE0;
|
||||
dci_dl.type0_alloc.rbg_bitmask = prbset_to_bitmask();
|
||||
|
||||
if (nof_tb > 1) {
|
||||
|
@ -511,11 +511,11 @@ static int update_radl()
|
|||
dci_dl.tb[1].rv = rvidx[1];
|
||||
dci_dl.tb[1].cw_idx = 1;
|
||||
} else {
|
||||
SRSLTE_DCI_TB_DISABLE(dci_dl.tb[1]);
|
||||
SRSRAN_DCI_TB_DISABLE(dci_dl.tb[1]);
|
||||
}
|
||||
|
||||
srslte_dci_dl_fprint(stdout, &dci_dl, cell.nof_prb);
|
||||
if (transmission_mode != SRSLTE_TM1) {
|
||||
srsran_dci_dl_fprint(stdout, &dci_dl, cell.nof_prb);
|
||||
if (transmission_mode != SRSRAN_TM1) {
|
||||
printf("\nTransmission mode key table:\n");
|
||||
printf(" Mode | 1TB | 2TB |\n");
|
||||
printf("----------+---------+-----+\n");
|
||||
|
@ -552,7 +552,7 @@ static int update_control()
|
|||
if (input[0] == 27) {
|
||||
switch (input[2]) {
|
||||
case RIGHT_KEY:
|
||||
if (prbset_orig + prbset_num < (int)ceilf((float)cell.nof_prb / srslte_ra_type0_P(cell.nof_prb)))
|
||||
if (prbset_orig + prbset_num < (int)ceilf((float)cell.nof_prb / srsran_ra_type0_P(cell.nof_prb)))
|
||||
prbset_orig++;
|
||||
break;
|
||||
case LEFT_KEY:
|
||||
|
@ -560,7 +560,7 @@ static int update_control()
|
|||
prbset_orig--;
|
||||
break;
|
||||
case UP_KEY:
|
||||
if (prbset_num < (int)ceilf((float)cell.nof_prb / srslte_ra_type0_P(cell.nof_prb)))
|
||||
if (prbset_num < (int)ceilf((float)cell.nof_prb / srsran_ra_type0_P(cell.nof_prb)))
|
||||
prbset_num++;
|
||||
break;
|
||||
case DOWN_KEY:
|
||||
|
@ -572,15 +572,15 @@ static int update_control()
|
|||
case PAGE_UP:
|
||||
if (!output_file_name) {
|
||||
rf_gain++;
|
||||
srslte_rf_set_tx_gain(&radio, rf_gain);
|
||||
printf("Set TX gain: %.1f dB\n", srslte_rf_get_tx_gain(&radio));
|
||||
srsran_rf_set_tx_gain(&radio, rf_gain);
|
||||
printf("Set TX gain: %.1f dB\n", srsran_rf_get_tx_gain(&radio));
|
||||
}
|
||||
break;
|
||||
case PAGE_DOWN:
|
||||
if (!output_file_name) {
|
||||
rf_gain--;
|
||||
srslte_rf_set_tx_gain(&radio, rf_gain);
|
||||
printf("Set TX gain: %.1f dB\n", srslte_rf_get_tx_gain(&radio));
|
||||
srsran_rf_set_tx_gain(&radio, rf_gain);
|
||||
printf("Set TX gain: %.1f dB\n", srsran_rf_get_tx_gain(&radio));
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
|
@ -588,40 +588,40 @@ static int update_control()
|
|||
} else {
|
||||
switch (input[0]) {
|
||||
case 'q':
|
||||
transmission_mode = SRSLTE_TM4;
|
||||
transmission_mode = SRSRAN_TM4;
|
||||
multiplex_pmi = 0;
|
||||
multiplex_nof_layers = 1;
|
||||
break;
|
||||
case 'w':
|
||||
transmission_mode = SRSLTE_TM4;
|
||||
transmission_mode = SRSRAN_TM4;
|
||||
multiplex_pmi = 1;
|
||||
multiplex_nof_layers = 1;
|
||||
break;
|
||||
case 'e':
|
||||
transmission_mode = SRSLTE_TM4;
|
||||
transmission_mode = SRSRAN_TM4;
|
||||
multiplex_pmi = 2;
|
||||
multiplex_nof_layers = 1;
|
||||
break;
|
||||
case 'r':
|
||||
transmission_mode = SRSLTE_TM4;
|
||||
transmission_mode = SRSRAN_TM4;
|
||||
multiplex_pmi = 3;
|
||||
multiplex_nof_layers = 1;
|
||||
break;
|
||||
case 'a':
|
||||
transmission_mode = SRSLTE_TM4;
|
||||
transmission_mode = SRSRAN_TM4;
|
||||
multiplex_pmi = 0;
|
||||
multiplex_nof_layers = 2;
|
||||
break;
|
||||
case 's':
|
||||
transmission_mode = SRSLTE_TM4;
|
||||
transmission_mode = SRSRAN_TM4;
|
||||
multiplex_pmi = 1;
|
||||
multiplex_nof_layers = 2;
|
||||
break;
|
||||
case 'z':
|
||||
transmission_mode = SRSLTE_TM3;
|
||||
transmission_mode = SRSRAN_TM3;
|
||||
break;
|
||||
case 'x':
|
||||
transmission_mode = SRSLTE_TM2;
|
||||
transmission_mode = SRSRAN_TM2;
|
||||
break;
|
||||
default:
|
||||
last_mcs_idx = mcs_idx;
|
||||
|
@ -653,7 +653,7 @@ static void* net_thread_fnc(void* arg)
|
|||
int rpm = 0, wpm = 0;
|
||||
|
||||
do {
|
||||
n = srslte_netsource_read(&net_source, &data2[rpm], DATA_BUFF_SZ - rpm);
|
||||
n = srsran_netsource_read(&net_source, &data2[rpm], DATA_BUFF_SZ - rpm);
|
||||
if (n > 0) {
|
||||
// TODO: I assume that both transport blocks have same size in case of 2 tb are active
|
||||
|
||||
|
@ -694,19 +694,19 @@ static void* net_thread_fnc(void* arg)
|
|||
int main(int argc, char** argv)
|
||||
{
|
||||
int nf = 0, sf_idx = 0, N_id_2 = 0;
|
||||
cf_t pss_signal[SRSLTE_PSS_LEN];
|
||||
float sss_signal0[SRSLTE_SSS_LEN]; // for subframe 0
|
||||
float sss_signal5[SRSLTE_SSS_LEN]; // for subframe 5
|
||||
uint8_t bch_payload[SRSLTE_BCH_PAYLOAD_LEN];
|
||||
cf_t pss_signal[SRSRAN_PSS_LEN];
|
||||
float sss_signal0[SRSRAN_SSS_LEN]; // for subframe 0
|
||||
float sss_signal5[SRSRAN_SSS_LEN]; // for subframe 5
|
||||
uint8_t bch_payload[SRSRAN_BCH_PAYLOAD_LEN];
|
||||
int i;
|
||||
cf_t* sf_symbols[SRSLTE_MAX_PORTS];
|
||||
srslte_dci_msg_t dci_msg;
|
||||
srslte_dci_location_t locations[SRSLTE_NOF_SF_X_FRAME][30];
|
||||
cf_t* sf_symbols[SRSRAN_MAX_PORTS];
|
||||
srsran_dci_msg_t dci_msg;
|
||||
srsran_dci_location_t locations[SRSRAN_NOF_SF_X_FRAME][30];
|
||||
uint32_t sfn;
|
||||
srslte_refsignal_t csr_refs;
|
||||
srslte_refsignal_t mbsfn_refs;
|
||||
srsran_refsignal_t csr_refs;
|
||||
srsran_refsignal_t mbsfn_refs;
|
||||
|
||||
srslte_debug_handle_crash(argc, argv);
|
||||
srsran_debug_handle_crash(argc, argv);
|
||||
|
||||
#ifdef DISABLE_RF
|
||||
if (argc < 3) {
|
||||
|
@ -717,7 +717,7 @@ int main(int argc, char** argv)
|
|||
|
||||
parse_args(argc, argv);
|
||||
|
||||
srslte_use_standard_symbol_size(use_standard_lte_rate);
|
||||
srsran_use_standard_symbol_size(use_standard_lte_rate);
|
||||
|
||||
uint8_t mch_table[10];
|
||||
bzero(&mch_table[0], sizeof(uint8_t) * 10);
|
||||
|
@ -725,45 +725,45 @@ int main(int argc, char** argv)
|
|||
generate_mcch_table(mch_table, mbsfn_sf_mask);
|
||||
}
|
||||
N_id_2 = cell.id % 3;
|
||||
sf_n_re = 2 * SRSLTE_CP_NORM_NSYMB * cell.nof_prb * SRSLTE_NRE;
|
||||
sf_n_samples = 2 * SRSLTE_SLOT_LEN(srslte_symbol_sz(cell.nof_prb));
|
||||
sf_n_re = 2 * SRSRAN_CP_NORM_NSYMB * cell.nof_prb * SRSRAN_NRE;
|
||||
sf_n_samples = 2 * SRSRAN_SLOT_LEN(srsran_symbol_sz(cell.nof_prb));
|
||||
|
||||
cell.phich_length = SRSLTE_PHICH_NORM;
|
||||
cell.phich_resources = SRSLTE_PHICH_R_1;
|
||||
cell.phich_length = SRSRAN_PHICH_NORM;
|
||||
cell.phich_resources = SRSRAN_PHICH_R_1;
|
||||
sfn = 0;
|
||||
|
||||
prbset_num = (int)ceilf((float)cell.nof_prb / srslte_ra_type0_P(cell.nof_prb));
|
||||
prbset_num = (int)ceilf((float)cell.nof_prb / srsran_ra_type0_P(cell.nof_prb));
|
||||
last_prbset_num = prbset_num;
|
||||
|
||||
/* this *must* be called after setting slot_len_* */
|
||||
base_init();
|
||||
|
||||
/* Generate PSS/SSS signals */
|
||||
srslte_pss_generate(pss_signal, N_id_2);
|
||||
srslte_sss_generate(sss_signal0, sss_signal5, cell.id);
|
||||
srsran_pss_generate(pss_signal, N_id_2);
|
||||
srsran_sss_generate(sss_signal0, sss_signal5, cell.id);
|
||||
|
||||
/* Generate reference signals */
|
||||
if (srslte_refsignal_cs_init(&csr_refs, cell.nof_prb)) {
|
||||
if (srsran_refsignal_cs_init(&csr_refs, cell.nof_prb)) {
|
||||
ERROR("Error initializing equalizer");
|
||||
exit(-1);
|
||||
}
|
||||
if (mbsfn_area_id > -1) {
|
||||
if (srslte_refsignal_mbsfn_init(&mbsfn_refs, cell.nof_prb)) {
|
||||
if (srsran_refsignal_mbsfn_init(&mbsfn_refs, cell.nof_prb)) {
|
||||
ERROR("Error initializing equalizer");
|
||||
exit(-1);
|
||||
}
|
||||
if (srslte_refsignal_mbsfn_set_cell(&mbsfn_refs, cell, mbsfn_area_id)) {
|
||||
if (srsran_refsignal_mbsfn_set_cell(&mbsfn_refs, cell, mbsfn_area_id)) {
|
||||
ERROR("Error initializing MBSFNR signal");
|
||||
exit(-1);
|
||||
}
|
||||
}
|
||||
|
||||
if (srslte_refsignal_cs_set_cell(&csr_refs, cell)) {
|
||||
if (srsran_refsignal_cs_set_cell(&csr_refs, cell)) {
|
||||
ERROR("Error setting cell");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
for (i = 0; i < SRSLTE_MAX_PORTS; i++) {
|
||||
for (i = 0; i < SRSRAN_MAX_PORTS; i++) {
|
||||
sf_symbols[i] = sf_buffer[i % cell.nof_ports];
|
||||
}
|
||||
|
||||
|
@ -776,10 +776,10 @@ int main(int argc, char** argv)
|
|||
signal(SIGINT, sig_int_handler);
|
||||
|
||||
if (!output_file_name) {
|
||||
int srate = srslte_sampling_freq_hz(cell.nof_prb);
|
||||
int srate = srsran_sampling_freq_hz(cell.nof_prb);
|
||||
if (srate != -1) {
|
||||
printf("Setting sampling rate %.2f MHz\n", (float)srate / 1000000);
|
||||
float srate_rf = srslte_rf_set_tx_srate(&radio, (double)srate);
|
||||
float srate_rf = srsran_rf_set_tx_srate(&radio, (double)srate);
|
||||
if (srate_rf != srate) {
|
||||
ERROR("Could not set sampling rate");
|
||||
exit(-1);
|
||||
|
@ -788,9 +788,9 @@ int main(int argc, char** argv)
|
|||
ERROR("Invalid number of PRB %d", cell.nof_prb);
|
||||
exit(-1);
|
||||
}
|
||||
srslte_rf_set_tx_gain(&radio, rf_gain);
|
||||
printf("Set TX gain: %.1f dB\n", srslte_rf_get_tx_gain(&radio));
|
||||
printf("Set TX freq: %.2f MHz\n", srslte_rf_set_tx_freq(&radio, cell.nof_ports, rf_freq) / 1000000);
|
||||
srsran_rf_set_tx_gain(&radio, rf_gain);
|
||||
printf("Set TX gain: %.1f dB\n", srsran_rf_get_tx_gain(&radio));
|
||||
printf("Set TX freq: %.2f MHz\n", srsran_rf_set_tx_freq(&radio, cell.nof_ports, rf_freq) / 1000000);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -806,21 +806,21 @@ int main(int argc, char** argv)
|
|||
}
|
||||
pmch_cfg.pdsch_cfg.grant.tb[0].tbs = 1096;
|
||||
|
||||
srslte_dl_sf_cfg_t dl_sf;
|
||||
srsran_dl_sf_cfg_t dl_sf;
|
||||
ZERO_OBJECT(dl_sf);
|
||||
|
||||
/* Initiate valid DCI locations */
|
||||
for (i = 0; i < SRSLTE_NOF_SF_X_FRAME; i++) {
|
||||
for (i = 0; i < SRSRAN_NOF_SF_X_FRAME; i++) {
|
||||
dl_sf.cfi = cfi;
|
||||
dl_sf.tti = i;
|
||||
srslte_pdcch_ue_locations(&pdcch, &dl_sf, locations[i], 30, UE_CRNTI);
|
||||
srsran_pdcch_ue_locations(&pdcch, &dl_sf, locations[i], 30, UE_CRNTI);
|
||||
}
|
||||
|
||||
nf = 0;
|
||||
|
||||
bool send_data = false;
|
||||
for (i = 0; i < SRSLTE_MAX_CODEWORDS; i++) {
|
||||
srslte_softbuffer_tx_reset(softbuffers[i]);
|
||||
for (i = 0; i < SRSRAN_MAX_CODEWORDS; i++) {
|
||||
srsran_softbuffer_tx_reset(softbuffers[i]);
|
||||
}
|
||||
|
||||
#ifndef DISABLE_RF
|
||||
|
@ -828,7 +828,7 @@ int main(int argc, char** argv)
|
|||
#endif
|
||||
|
||||
ZERO_OBJECT(pdsch_cfg);
|
||||
for (uint32_t j = 0; j < SRSLTE_MAX_CODEWORDS; j++) {
|
||||
for (uint32_t j = 0; j < SRSRAN_MAX_CODEWORDS; j++) {
|
||||
pdsch_cfg.softbuffers.tx[j] = softbuffers[j];
|
||||
}
|
||||
pdsch_cfg.rnti = UE_CRNTI;
|
||||
|
@ -836,13 +836,13 @@ int main(int argc, char** argv)
|
|||
pmch_cfg.pdsch_cfg = pdsch_cfg;
|
||||
|
||||
while ((nf < nof_frames || nof_frames == -1) && !go_exit) {
|
||||
for (sf_idx = 0; sf_idx < SRSLTE_NOF_SF_X_FRAME && (nf < nof_frames || nof_frames == -1) && !go_exit; sf_idx++) {
|
||||
for (sf_idx = 0; sf_idx < SRSRAN_NOF_SF_X_FRAME && (nf < nof_frames || nof_frames == -1) && !go_exit; sf_idx++) {
|
||||
/* Set Antenna port resource elements to zero */
|
||||
srslte_vec_cf_zero(sf_symbols[0], sf_n_re);
|
||||
srsran_vec_cf_zero(sf_symbols[0], sf_n_re);
|
||||
|
||||
if (sf_idx == 0 || sf_idx == 5) {
|
||||
srslte_pss_put_slot(pss_signal, sf_symbols[0], cell.nof_prb, SRSLTE_CP_NORM);
|
||||
srslte_sss_put_slot(sf_idx ? sss_signal5 : sss_signal0, sf_symbols[0], cell.nof_prb, SRSLTE_CP_NORM);
|
||||
srsran_pss_put_slot(pss_signal, sf_symbols[0], cell.nof_prb, SRSRAN_CP_NORM);
|
||||
srsran_sss_put_slot(sf_idx ? sss_signal5 : sss_signal0, sf_symbols[0], cell.nof_prb, SRSRAN_CP_NORM);
|
||||
}
|
||||
|
||||
/* Copy zeros, SSS, PSS into the rest of antenna ports */
|
||||
|
@ -851,23 +851,23 @@ int main(int argc, char** argv)
|
|||
}
|
||||
|
||||
if (mch_table[sf_idx] == 1 && mbsfn_area_id > -1) {
|
||||
srslte_refsignal_mbsfn_put_sf(cell, 0, csr_refs.pilots[0][sf_idx], mbsfn_refs.pilots[0][sf_idx], sf_symbols[0]);
|
||||
srsran_refsignal_mbsfn_put_sf(cell, 0, csr_refs.pilots[0][sf_idx], mbsfn_refs.pilots[0][sf_idx], sf_symbols[0]);
|
||||
} else {
|
||||
dl_sf.tti = nf * 10 + sf_idx;
|
||||
for (i = 0; i < cell.nof_ports; i++) {
|
||||
srslte_refsignal_cs_put_sf(&csr_refs, &dl_sf, (uint32_t)i, sf_symbols[i]);
|
||||
srsran_refsignal_cs_put_sf(&csr_refs, &dl_sf, (uint32_t)i, sf_symbols[i]);
|
||||
}
|
||||
}
|
||||
|
||||
srslte_pbch_mib_pack(&cell, sfn, bch_payload);
|
||||
srsran_pbch_mib_pack(&cell, sfn, bch_payload);
|
||||
if (sf_idx == 0) {
|
||||
srslte_pbch_encode(&pbch, bch_payload, sf_symbols, nf % 4);
|
||||
srsran_pbch_encode(&pbch, bch_payload, sf_symbols, nf % 4);
|
||||
}
|
||||
|
||||
dl_sf.tti = nf * 10 + sf_idx;
|
||||
dl_sf.cfi = cfi;
|
||||
|
||||
srslte_pcfich_encode(&pcfich, &dl_sf, sf_symbols);
|
||||
srsran_pcfich_encode(&pcfich, &dl_sf, sf_symbols);
|
||||
|
||||
/* Update DL resource allocation from control port */
|
||||
if (update_control()) {
|
||||
|
@ -882,7 +882,7 @@ int main(int argc, char** argv)
|
|||
}
|
||||
} else {
|
||||
INFO("SF: %d, Generating %d random bits", sf_idx, pdsch_cfg.grant.tb[0].tbs + pdsch_cfg.grant.tb[1].tbs);
|
||||
for (uint32_t tb = 0; tb < SRSLTE_MAX_CODEWORDS; tb++) {
|
||||
for (uint32_t tb = 0; tb < SRSRAN_MAX_CODEWORDS; tb++) {
|
||||
if (pdsch_cfg.grant.tb[tb].enabled) {
|
||||
for (i = 0; i < pdsch_cfg.grant.tb[tb].tbs / 8; i++) {
|
||||
data[tb][i] = (uint8_t)rand();
|
||||
|
@ -898,34 +898,34 @@ int main(int argc, char** argv)
|
|||
}
|
||||
if (send_data) {
|
||||
if (mch_table[sf_idx] == 0 || mbsfn_area_id < 0) { // PDCCH + PDSCH
|
||||
dl_sf.sf_type = SRSLTE_SF_NORM;
|
||||
dl_sf.sf_type = SRSRAN_SF_NORM;
|
||||
|
||||
/* Encode PDCCH */
|
||||
INFO("Putting DCI to location: n=%d, L=%d", locations[sf_idx][0].ncce, locations[sf_idx][0].L);
|
||||
|
||||
srslte_dci_msg_pack_pdsch(&cell, &dl_sf, NULL, &dci_dl, &dci_msg);
|
||||
srsran_dci_msg_pack_pdsch(&cell, &dl_sf, NULL, &dci_dl, &dci_msg);
|
||||
dci_msg.location = locations[sf_idx][0];
|
||||
if (srslte_pdcch_encode(&pdcch, &dl_sf, &dci_msg, sf_symbols)) {
|
||||
if (srsran_pdcch_encode(&pdcch, &dl_sf, &dci_msg, sf_symbols)) {
|
||||
ERROR("Error encoding DCI message");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
/* Configure pdsch_cfg parameters */
|
||||
if (srslte_ra_dl_dci_to_grant(&cell, &dl_sf, transmission_mode, enable_256qam, &dci_dl, &pdsch_cfg.grant)) {
|
||||
if (srsran_ra_dl_dci_to_grant(&cell, &dl_sf, transmission_mode, enable_256qam, &dci_dl, &pdsch_cfg.grant)) {
|
||||
ERROR("Error configuring PDSCH");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
/* Encode PDSCH */
|
||||
if (srslte_pdsch_encode(&pdsch, &dl_sf, &pdsch_cfg, data, sf_symbols)) {
|
||||
if (srsran_pdsch_encode(&pdsch, &dl_sf, &pdsch_cfg, data, sf_symbols)) {
|
||||
ERROR("Error encoding PDSCH");
|
||||
exit(-1);
|
||||
}
|
||||
if (net_port > 0 && net_packet_ready) {
|
||||
if (null_file_sink) {
|
||||
for (uint32_t tb = 0; tb < SRSLTE_MAX_CODEWORDS; tb++) {
|
||||
srslte_bit_pack_vector(data[tb], data_tmp, pdsch_cfg.grant.tb[tb].tbs);
|
||||
if (srslte_netsink_write(&net_sink, data_tmp, 1 + (pdsch_cfg.grant.tb[tb].tbs - 1) / 8) < 0) {
|
||||
for (uint32_t tb = 0; tb < SRSRAN_MAX_CODEWORDS; tb++) {
|
||||
srsran_bit_pack_vector(data[tb], data_tmp, pdsch_cfg.grant.tb[tb].tbs);
|
||||
if (srsran_netsink_write(&net_sink, data_tmp, 1 + (pdsch_cfg.grant.tb[tb].tbs - 1) / 8) < 0) {
|
||||
ERROR("Error sending data through UDP socket");
|
||||
}
|
||||
}
|
||||
|
@ -936,17 +936,17 @@ int main(int argc, char** argv)
|
|||
}
|
||||
}
|
||||
} else { // We're sending MCH on subframe 1 - PDCCH + PMCH
|
||||
dl_sf.sf_type = SRSLTE_SF_MBSFN;
|
||||
dl_sf.sf_type = SRSRAN_SF_MBSFN;
|
||||
|
||||
/* Force 1 word and MCS 2 */
|
||||
dci_dl.rnti = SRSLTE_MRNTI;
|
||||
dci_dl.alloc_type = SRSLTE_RA_ALLOC_TYPE0;
|
||||
dci_dl.rnti = SRSRAN_MRNTI;
|
||||
dci_dl.alloc_type = SRSRAN_RA_ALLOC_TYPE0;
|
||||
dci_dl.type0_alloc.rbg_bitmask = 0xffffffff;
|
||||
dci_dl.tb[0].mcs_idx = 2;
|
||||
dci_dl.format = SRSLTE_DCI_FORMAT1;
|
||||
dci_dl.format = SRSRAN_DCI_FORMAT1;
|
||||
|
||||
/* Configure pdsch_cfg parameters */
|
||||
if (srslte_ra_dl_dci_to_grant(&cell, &dl_sf, SRSLTE_TM1, enable_256qam, &dci_dl, &pmch_cfg.pdsch_cfg.grant)) {
|
||||
if (srsran_ra_dl_dci_to_grant(&cell, &dl_sf, SRSRAN_TM1, enable_256qam, &dci_dl, &pmch_cfg.pdsch_cfg.grant)) {
|
||||
ERROR("Error configuring PDSCH");
|
||||
exit(-1);
|
||||
}
|
||||
|
@ -958,14 +958,14 @@ int main(int argc, char** argv)
|
|||
pmch_cfg.area_id = mbsfn_area_id;
|
||||
|
||||
/* Encode PMCH */
|
||||
if (srslte_pmch_encode(&pmch, &dl_sf, &pmch_cfg, data_mbms, sf_symbols)) {
|
||||
if (srsran_pmch_encode(&pmch, &dl_sf, &pmch_cfg, data_mbms, sf_symbols)) {
|
||||
ERROR("Error encoding PDSCH");
|
||||
exit(-1);
|
||||
}
|
||||
if (net_port > 0 && net_packet_ready) {
|
||||
if (null_file_sink) {
|
||||
srslte_bit_pack_vector(data[0], data_tmp, pmch_cfg.pdsch_cfg.grant.tb[0].tbs);
|
||||
if (srslte_netsink_write(&net_sink, data_tmp, 1 + (pmch_cfg.pdsch_cfg.grant.tb[0].tbs - 1) / 8) < 0) {
|
||||
srsran_bit_pack_vector(data[0], data_tmp, pmch_cfg.pdsch_cfg.grant.tb[0].tbs);
|
||||
if (srsran_netsink_write(&net_sink, data_tmp, 1 + (pmch_cfg.pdsch_cfg.grant.tb[0].tbs - 1) / 8) < 0) {
|
||||
ERROR("Error sending data through UDP socket");
|
||||
}
|
||||
}
|
||||
|
@ -978,10 +978,10 @@ int main(int argc, char** argv)
|
|||
/* Transform to OFDM symbols */
|
||||
if (mch_table[sf_idx] == 0 || mbsfn_area_id < 0) {
|
||||
for (i = 0; i < cell.nof_ports; i++) {
|
||||
srslte_ofdm_tx_sf(&ifft[i]);
|
||||
srsran_ofdm_tx_sf(&ifft[i]);
|
||||
}
|
||||
} else {
|
||||
srslte_ofdm_tx_sf(&ifft_mbsfn);
|
||||
srsran_ofdm_tx_sf(&ifft_mbsfn);
|
||||
}
|
||||
|
||||
/* send to file or usrp */
|
||||
|
@ -989,22 +989,22 @@ int main(int argc, char** argv)
|
|||
if (!null_file_sink) {
|
||||
/* Apply AWGN */
|
||||
if (output_file_snr != +INFINITY) {
|
||||
float var = srslte_convert_dB_to_amplitude(-(output_file_snr + 3.0f));
|
||||
float var = srsran_convert_dB_to_amplitude(-(output_file_snr + 3.0f));
|
||||
for (int k = 0; k < cell.nof_ports; k++) {
|
||||
srslte_ch_awgn_c(output_buffer[k], output_buffer[k], var, sf_n_samples);
|
||||
srsran_ch_awgn_c(output_buffer[k], output_buffer[k], var, sf_n_samples);
|
||||
}
|
||||
}
|
||||
srslte_filesink_write_multi(&fsink, (void**)output_buffer, sf_n_samples, cell.nof_ports);
|
||||
srsran_filesink_write_multi(&fsink, (void**)output_buffer, sf_n_samples, cell.nof_ports);
|
||||
}
|
||||
usleep(1000);
|
||||
} else {
|
||||
#ifndef DISABLE_RF
|
||||
float norm_factor = (float)cell.nof_prb / 15 / sqrtf(pdsch_cfg.grant.nof_prb);
|
||||
for (i = 0; i < cell.nof_ports; i++) {
|
||||
srslte_vec_sc_prod_cfc(
|
||||
output_buffer[i], rf_amp * norm_factor, output_buffer[i], SRSLTE_SF_LEN_PRB(cell.nof_prb));
|
||||
srsran_vec_sc_prod_cfc(
|
||||
output_buffer[i], rf_amp * norm_factor, output_buffer[i], SRSRAN_SF_LEN_PRB(cell.nof_prb));
|
||||
}
|
||||
srslte_rf_send_multi(&radio, (void**)output_buffer, sf_n_samples, true, start_of_burst, false);
|
||||
srsran_rf_send_multi(&radio, (void**)output_buffer, sf_n_samples, true, start_of_burst, false);
|
||||
start_of_burst = false;
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
*
|
||||
* \section COPYRIGHT
|
||||
*
|
||||
* Copyright 2013-2020 Software Radio Systems Limited
|
||||
* Copyright 2013-2021 Software Radio Systems Limited
|
||||
*
|
||||
* By using this file, you agree to the terms and conditions set
|
||||
* forth in the LICENSE file which can be found at the top level of
|
||||
|
@ -22,21 +22,21 @@
|
|||
#include <sys/time.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "srslte/common/crash_handler.h"
|
||||
#include "srslte/common/gen_mch_tables.h"
|
||||
#include "srslte/phy/io/filesink.h"
|
||||
#include "srslte/srslte.h"
|
||||
#include "srsran/common/crash_handler.h"
|
||||
#include "srsran/common/gen_mch_tables.h"
|
||||
#include "srsran/phy/io/filesink.h"
|
||||
#include "srsran/srsran.h"
|
||||
|
||||
#define ENABLE_AGC_DEFAULT
|
||||
|
||||
#ifndef DISABLE_RF
|
||||
|
||||
#include "srslte/phy/rf/rf.h"
|
||||
#include "srslte/phy/rf/rf_utils.h"
|
||||
#include "srsran/phy/rf/rf.h"
|
||||
#include "srsran/phy/rf/rf_utils.h"
|
||||
|
||||
cell_search_cfg_t cell_detect_config = {.max_frames_pbch = SRSLTE_DEFAULT_MAX_FRAMES_PBCH,
|
||||
.max_frames_pss = SRSLTE_DEFAULT_MAX_FRAMES_PSS,
|
||||
.nof_valid_pss_frames = SRSLTE_DEFAULT_NOF_VALID_PSS_FRAMES,
|
||||
cell_search_cfg_t cell_detect_config = {.max_frames_pbch = SRSRAN_DEFAULT_MAX_FRAMES_PBCH,
|
||||
.max_frames_pss = SRSRAN_DEFAULT_MAX_FRAMES_PSS,
|
||||
.nof_valid_pss_frames = SRSRAN_DEFAULT_NOF_VALID_PSS_FRAMES,
|
||||
.init_agc = 0,
|
||||
.force_tdd = false};
|
||||
|
||||
|
@ -108,7 +108,7 @@ void args_default(prog_args_t* args)
|
|||
args->disable_plots = false;
|
||||
args->disable_plots_except_constellation = false;
|
||||
args->nof_subframes = -1;
|
||||
args->rnti = SRSLTE_SIRNTI;
|
||||
args->rnti = SRSRAN_SIRNTI;
|
||||
args->force_N_id_2 = -1; // Pick the best
|
||||
args->tdd_special_sf = -1;
|
||||
args->sf_config = -1;
|
||||
|
@ -188,7 +188,7 @@ void usage(prog_args_t* args, char* prog)
|
|||
printf("\t-N Non-MBSFN region [Default %d]\n", args->non_mbsfn_region);
|
||||
printf("\t-q Enable/Disable 256QAM modulation (default %s)\n", args->enable_256qam ? "enabled" : "disabled");
|
||||
printf("\t-Q Use standard LTE sample rates (default %s)\n", args->use_standard_lte_rate ? "enabled" : "disabled");
|
||||
printf("\t-v [set srslte_verbose to debug, default none]\n");
|
||||
printf("\t-v [set srsran_verbose to debug, default none]\n");
|
||||
}
|
||||
|
||||
void parse_args(prog_args_t* args, int argc, char** argv)
|
||||
|
@ -277,8 +277,8 @@ void parse_args(prog_args_t* args, int argc, char** argv)
|
|||
args->disable_plots_except_constellation = true;
|
||||
break;
|
||||
case 'v':
|
||||
srslte_verbose++;
|
||||
args->verbose = srslte_verbose;
|
||||
srsran_verbose++;
|
||||
args->verbose = srsran_verbose;
|
||||
break;
|
||||
case 'Z':
|
||||
args->decimate = (int)strtol(argv[optind], NULL, 10);
|
||||
|
@ -317,7 +317,7 @@ void parse_args(prog_args_t* args, int argc, char** argv)
|
|||
|
||||
/**********************************************************************/
|
||||
|
||||
uint8_t* data[SRSLTE_MAX_CODEWORDS];
|
||||
uint8_t* data[SRSRAN_MAX_CODEWORDS];
|
||||
|
||||
bool go_exit = false;
|
||||
|
||||
|
@ -331,23 +331,23 @@ void sig_int_handler(int signo)
|
|||
}
|
||||
}
|
||||
|
||||
cf_t* sf_buffer[SRSLTE_MAX_PORTS] = {NULL};
|
||||
cf_t* sf_buffer[SRSRAN_MAX_PORTS] = {NULL};
|
||||
|
||||
#ifndef DISABLE_RF
|
||||
|
||||
int srslte_rf_recv_wrapper(void* h, cf_t* data_[SRSLTE_MAX_PORTS], uint32_t nsamples, srslte_timestamp_t* t)
|
||||
int srsran_rf_recv_wrapper(void* h, cf_t* data_[SRSRAN_MAX_PORTS], uint32_t nsamples, srsran_timestamp_t* t)
|
||||
{
|
||||
DEBUG(" ---- Receive %d samples ----", nsamples);
|
||||
void* ptr[SRSLTE_MAX_PORTS];
|
||||
for (int i = 0; i < SRSLTE_MAX_PORTS; i++) {
|
||||
void* ptr[SRSRAN_MAX_PORTS];
|
||||
for (int i = 0; i < SRSRAN_MAX_PORTS; i++) {
|
||||
ptr[i] = data_[i];
|
||||
}
|
||||
return srslte_rf_recv_with_time_multi(h, ptr, nsamples, true, NULL, NULL);
|
||||
return srsran_rf_recv_with_time_multi(h, ptr, nsamples, true, NULL, NULL);
|
||||
}
|
||||
|
||||
static SRSLTE_AGC_CALLBACK(srslte_rf_set_rx_gain_th_wrapper_)
|
||||
static SRSRAN_AGC_CALLBACK(srsran_rf_set_rx_gain_th_wrapper_)
|
||||
{
|
||||
srslte_rf_set_rx_gain_th((srslte_rf_t*)h, gain_db);
|
||||
srsran_rf_set_rx_gain_th((srsran_rf_t*)h, gain_db);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -356,18 +356,18 @@ extern float mean_exec_time;
|
|||
|
||||
enum receiver_state { DECODE_MIB, DECODE_PDSCH } state;
|
||||
|
||||
srslte_cell_t cell;
|
||||
srslte_ue_dl_t ue_dl;
|
||||
srslte_ue_dl_cfg_t ue_dl_cfg;
|
||||
srslte_dl_sf_cfg_t dl_sf;
|
||||
srslte_pdsch_cfg_t pdsch_cfg;
|
||||
srslte_ue_sync_t ue_sync;
|
||||
srsran_cell_t cell;
|
||||
srsran_ue_dl_t ue_dl;
|
||||
srsran_ue_dl_cfg_t ue_dl_cfg;
|
||||
srsran_dl_sf_cfg_t dl_sf;
|
||||
srsran_pdsch_cfg_t pdsch_cfg;
|
||||
srsran_ue_sync_t ue_sync;
|
||||
prog_args_t prog_args;
|
||||
|
||||
uint32_t pkt_errors = 0, pkt_total = 0, nof_detected = 0, pmch_pkt_errors = 0, pmch_pkt_total = 0, nof_trials = 0;
|
||||
double evm = 0.0;
|
||||
|
||||
srslte_netsink_t net_sink, net_sink_signal;
|
||||
srsran_netsink_t net_sink, net_sink_signal;
|
||||
/* Useful macros for printing lines which will disappear */
|
||||
|
||||
#define PRINT_LINE_INIT() \
|
||||
|
@ -386,14 +386,14 @@ int main(int argc, char** argv)
|
|||
int ret;
|
||||
|
||||
#ifndef DISABLE_RF
|
||||
srslte_rf_t rf;
|
||||
srsran_rf_t rf;
|
||||
#endif
|
||||
|
||||
srslte_debug_handle_crash(argc, argv);
|
||||
srsran_debug_handle_crash(argc, argv);
|
||||
|
||||
parse_args(&prog_args, argc, argv);
|
||||
|
||||
srslte_use_standard_symbol_size(prog_args.use_standard_lte_rate);
|
||||
srsran_use_standard_symbol_size(prog_args.use_standard_lte_rate);
|
||||
|
||||
#ifdef ENABLE_GUI
|
||||
if (prog_args.mbsfn_area_id > -1) {
|
||||
|
@ -401,8 +401,8 @@ int main(int argc, char** argv)
|
|||
}
|
||||
#endif /* ENABLE_GUI */
|
||||
|
||||
for (int i = 0; i < SRSLTE_MAX_CODEWORDS; i++) {
|
||||
data[i] = srslte_vec_u8_malloc(2000 * 8);
|
||||
for (int i = 0; i < SRSRAN_MAX_CODEWORDS; i++) {
|
||||
data[i] = srsran_vec_u8_malloc(2000 * 8);
|
||||
if (!data[i]) {
|
||||
ERROR("Allocating data");
|
||||
go_exit = true;
|
||||
|
@ -432,19 +432,19 @@ int main(int argc, char** argv)
|
|||
}
|
||||
|
||||
if (prog_args.net_port > 0) {
|
||||
if (srslte_netsink_init(&net_sink, prog_args.net_address, prog_args.net_port, SRSLTE_NETSINK_UDP)) {
|
||||
if (srsran_netsink_init(&net_sink, prog_args.net_address, prog_args.net_port, SRSRAN_NETSINK_UDP)) {
|
||||
ERROR("Error initiating UDP socket to %s:%d", prog_args.net_address, prog_args.net_port);
|
||||
exit(-1);
|
||||
}
|
||||
srslte_netsink_set_nonblocking(&net_sink);
|
||||
srsran_netsink_set_nonblocking(&net_sink);
|
||||
}
|
||||
if (prog_args.net_port_signal > 0) {
|
||||
if (srslte_netsink_init(
|
||||
&net_sink_signal, prog_args.net_address_signal, prog_args.net_port_signal, SRSLTE_NETSINK_UDP)) {
|
||||
if (srsran_netsink_init(
|
||||
&net_sink_signal, prog_args.net_address_signal, prog_args.net_port_signal, SRSRAN_NETSINK_UDP)) {
|
||||
ERROR("Error initiating UDP socket to %s:%d", prog_args.net_address_signal, prog_args.net_port_signal);
|
||||
exit(-1);
|
||||
}
|
||||
srslte_netsink_set_nonblocking(&net_sink_signal);
|
||||
srsran_netsink_set_nonblocking(&net_sink_signal);
|
||||
}
|
||||
|
||||
float search_cell_cfo = 0;
|
||||
|
@ -452,21 +452,21 @@ int main(int argc, char** argv)
|
|||
#ifndef DISABLE_RF
|
||||
if (!prog_args.input_file_name) {
|
||||
printf("Opening RF device with %d RX antennas...\n", prog_args.rf_nof_rx_ant);
|
||||
if (srslte_rf_open_devname(&rf, prog_args.rf_dev, prog_args.rf_args, prog_args.rf_nof_rx_ant)) {
|
||||
if (srsran_rf_open_devname(&rf, prog_args.rf_dev, prog_args.rf_args, prog_args.rf_nof_rx_ant)) {
|
||||
fprintf(stderr, "Error opening rf\n");
|
||||
exit(-1);
|
||||
}
|
||||
/* Set receiver gain */
|
||||
if (prog_args.rf_gain > 0) {
|
||||
srslte_rf_set_rx_gain(&rf, prog_args.rf_gain);
|
||||
srsran_rf_set_rx_gain(&rf, prog_args.rf_gain);
|
||||
} else {
|
||||
printf("Starting AGC thread...\n");
|
||||
if (srslte_rf_start_gain_thread(&rf, false)) {
|
||||
if (srsran_rf_start_gain_thread(&rf, false)) {
|
||||
ERROR("Error opening rf");
|
||||
exit(-1);
|
||||
}
|
||||
srslte_rf_set_rx_gain(&rf, srslte_rf_get_rx_gain(&rf));
|
||||
cell_detect_config.init_agc = srslte_rf_get_rx_gain(&rf);
|
||||
srsran_rf_set_rx_gain(&rf, srsran_rf_get_rx_gain(&rf));
|
||||
cell_detect_config.init_agc = srsran_rf_get_rx_gain(&rf);
|
||||
}
|
||||
|
||||
sigset_t sigset;
|
||||
|
@ -477,7 +477,7 @@ int main(int argc, char** argv)
|
|||
|
||||
/* set receiver frequency */
|
||||
printf("Tunning receiver to %.3f MHz\n", (prog_args.rf_freq + prog_args.file_offset_freq) / 1000000);
|
||||
srslte_rf_set_rx_freq(&rf, prog_args.rf_nof_rx_ant, prog_args.rf_freq + prog_args.file_offset_freq);
|
||||
srsran_rf_set_rx_freq(&rf, prog_args.rf_nof_rx_ant, prog_args.rf_freq + prog_args.file_offset_freq);
|
||||
|
||||
uint32_t ntrial = 0;
|
||||
do {
|
||||
|
@ -492,15 +492,15 @@ int main(int argc, char** argv)
|
|||
} while (ret == 0 && !go_exit);
|
||||
|
||||
if (go_exit) {
|
||||
srslte_rf_close(&rf);
|
||||
srsran_rf_close(&rf);
|
||||
exit(0);
|
||||
}
|
||||
|
||||
/* set sampling frequency */
|
||||
int srate = srslte_sampling_freq_hz(cell.nof_prb);
|
||||
int srate = srsran_sampling_freq_hz(cell.nof_prb);
|
||||
if (srate != -1) {
|
||||
printf("Setting sampling rate %.2f MHz\n", (float)srate / 1000000);
|
||||
float srate_rf = srslte_rf_set_rx_srate(&rf, (double)srate);
|
||||
float srate_rf = srsran_rf_set_rx_srate(&rf, (double)srate);
|
||||
if (srate_rf != srate) {
|
||||
ERROR("Could not set sampling rate");
|
||||
exit(-1);
|
||||
|
@ -518,13 +518,13 @@ int main(int argc, char** argv)
|
|||
if (prog_args.input_file_name) {
|
||||
/* preset cell configuration */
|
||||
cell.id = prog_args.file_cell_id;
|
||||
cell.cp = SRSLTE_CP_NORM;
|
||||
cell.phich_length = SRSLTE_PHICH_NORM;
|
||||
cell.phich_resources = SRSLTE_PHICH_R_1;
|
||||
cell.cp = SRSRAN_CP_NORM;
|
||||
cell.phich_length = SRSRAN_PHICH_NORM;
|
||||
cell.phich_resources = SRSRAN_PHICH_R_1;
|
||||
cell.nof_ports = prog_args.file_nof_ports;
|
||||
cell.nof_prb = prog_args.file_nof_prb;
|
||||
|
||||
if (srslte_ue_sync_init_file_multi(&ue_sync,
|
||||
if (srsran_ue_sync_init_file_multi(&ue_sync,
|
||||
prog_args.file_nof_prb,
|
||||
prog_args.input_file_name,
|
||||
prog_args.file_offset_time,
|
||||
|
@ -544,42 +544,42 @@ int main(int argc, char** argv)
|
|||
decimate = prog_args.decimate;
|
||||
}
|
||||
}
|
||||
if (srslte_ue_sync_init_multi_decim(&ue_sync,
|
||||
if (srsran_ue_sync_init_multi_decim(&ue_sync,
|
||||
cell.nof_prb,
|
||||
cell.id == 1000,
|
||||
srslte_rf_recv_wrapper,
|
||||
srsran_rf_recv_wrapper,
|
||||
prog_args.rf_nof_rx_ant,
|
||||
(void*)&rf,
|
||||
decimate)) {
|
||||
ERROR("Error initiating ue_sync");
|
||||
exit(-1);
|
||||
}
|
||||
if (srslte_ue_sync_set_cell(&ue_sync, cell)) {
|
||||
if (srsran_ue_sync_set_cell(&ue_sync, cell)) {
|
||||
ERROR("Error initiating ue_sync");
|
||||
exit(-1);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
uint32_t max_num_samples = 3 * SRSLTE_SF_LEN_PRB(cell.nof_prb); /// Length in complex samples
|
||||
uint32_t max_num_samples = 3 * SRSRAN_SF_LEN_PRB(cell.nof_prb); /// Length in complex samples
|
||||
for (int i = 0; i < prog_args.rf_nof_rx_ant; i++) {
|
||||
sf_buffer[i] = srslte_vec_cf_malloc(max_num_samples);
|
||||
sf_buffer[i] = srsran_vec_cf_malloc(max_num_samples);
|
||||
}
|
||||
srslte_ue_mib_t ue_mib;
|
||||
if (srslte_ue_mib_init(&ue_mib, sf_buffer[0], cell.nof_prb)) {
|
||||
srsran_ue_mib_t ue_mib;
|
||||
if (srsran_ue_mib_init(&ue_mib, sf_buffer[0], cell.nof_prb)) {
|
||||
ERROR("Error initaiting UE MIB decoder");
|
||||
exit(-1);
|
||||
}
|
||||
if (srslte_ue_mib_set_cell(&ue_mib, cell)) {
|
||||
if (srsran_ue_mib_set_cell(&ue_mib, cell)) {
|
||||
ERROR("Error initaiting UE MIB decoder");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
if (srslte_ue_dl_init(&ue_dl, sf_buffer, cell.nof_prb, prog_args.rf_nof_rx_ant)) {
|
||||
if (srsran_ue_dl_init(&ue_dl, sf_buffer, cell.nof_prb, prog_args.rf_nof_rx_ant)) {
|
||||
ERROR("Error initiating UE downlink processing module");
|
||||
exit(-1);
|
||||
}
|
||||
if (srslte_ue_dl_set_cell(&ue_dl, cell)) {
|
||||
if (srsran_ue_dl_set_cell(&ue_dl, cell)) {
|
||||
ERROR("Error initiating UE downlink processing module");
|
||||
exit(-1);
|
||||
}
|
||||
|
@ -588,7 +588,7 @@ int main(int argc, char** argv)
|
|||
ue_sync.cfo_current_value = search_cell_cfo / 15000;
|
||||
ue_sync.cfo_is_copied = true;
|
||||
ue_sync.cfo_correct_enable_find = true;
|
||||
srslte_sync_set_cfo_cp_enable(&ue_sync.sfind, false, 0);
|
||||
srsran_sync_set_cfo_cp_enable(&ue_sync.sfind, false, 0);
|
||||
|
||||
ZERO_OBJECT(ue_dl_cfg);
|
||||
ZERO_OBJECT(dl_sf);
|
||||
|
@ -596,38 +596,38 @@ int main(int argc, char** argv)
|
|||
|
||||
pdsch_cfg.meas_evm_en = true;
|
||||
|
||||
if (cell.frame_type == SRSLTE_TDD && prog_args.tdd_special_sf >= 0 && prog_args.sf_config >= 0) {
|
||||
if (cell.frame_type == SRSRAN_TDD && prog_args.tdd_special_sf >= 0 && prog_args.sf_config >= 0) {
|
||||
dl_sf.tdd_config.ss_config = prog_args.tdd_special_sf;
|
||||
dl_sf.tdd_config.sf_config = prog_args.sf_config;
|
||||
dl_sf.tdd_config.configured = true;
|
||||
}
|
||||
|
||||
srslte_chest_dl_cfg_t chest_pdsch_cfg = {};
|
||||
srsran_chest_dl_cfg_t chest_pdsch_cfg = {};
|
||||
chest_pdsch_cfg.cfo_estimate_enable = prog_args.enable_cfo_ref;
|
||||
chest_pdsch_cfg.cfo_estimate_sf_mask = 1023;
|
||||
chest_pdsch_cfg.estimator_alg = srslte_chest_dl_str2estimator_alg(prog_args.estimator_alg);
|
||||
chest_pdsch_cfg.estimator_alg = srsran_chest_dl_str2estimator_alg(prog_args.estimator_alg);
|
||||
chest_pdsch_cfg.sync_error_enable = true;
|
||||
|
||||
// Special configuration for MBSFN channel estimation
|
||||
srslte_chest_dl_cfg_t chest_mbsfn_cfg = {};
|
||||
chest_mbsfn_cfg.filter_type = SRSLTE_CHEST_FILTER_TRIANGLE;
|
||||
srsran_chest_dl_cfg_t chest_mbsfn_cfg = {};
|
||||
chest_mbsfn_cfg.filter_type = SRSRAN_CHEST_FILTER_TRIANGLE;
|
||||
chest_mbsfn_cfg.filter_coef[0] = 0.1;
|
||||
chest_mbsfn_cfg.estimator_alg = SRSLTE_ESTIMATOR_ALG_INTERPOLATE;
|
||||
chest_mbsfn_cfg.noise_alg = SRSLTE_NOISE_ALG_PSS;
|
||||
chest_mbsfn_cfg.estimator_alg = SRSRAN_ESTIMATOR_ALG_INTERPOLATE;
|
||||
chest_mbsfn_cfg.noise_alg = SRSRAN_NOISE_ALG_PSS;
|
||||
|
||||
// Allocate softbuffer buffers
|
||||
srslte_softbuffer_rx_t rx_softbuffers[SRSLTE_MAX_CODEWORDS];
|
||||
for (uint32_t i = 0; i < SRSLTE_MAX_CODEWORDS; i++) {
|
||||
srsran_softbuffer_rx_t rx_softbuffers[SRSRAN_MAX_CODEWORDS];
|
||||
for (uint32_t i = 0; i < SRSRAN_MAX_CODEWORDS; i++) {
|
||||
pdsch_cfg.softbuffers.rx[i] = &rx_softbuffers[i];
|
||||
srslte_softbuffer_rx_init(pdsch_cfg.softbuffers.rx[i], cell.nof_prb);
|
||||
srsran_softbuffer_rx_init(pdsch_cfg.softbuffers.rx[i], cell.nof_prb);
|
||||
}
|
||||
|
||||
pdsch_cfg.rnti = prog_args.rnti;
|
||||
|
||||
/* Configure MBSFN area id and non-MBSFN Region */
|
||||
if (prog_args.mbsfn_area_id > -1) {
|
||||
srslte_ue_dl_set_mbsfn_area_id(&ue_dl, prog_args.mbsfn_area_id);
|
||||
srslte_ue_dl_set_non_mbsfn_region(&ue_dl, prog_args.non_mbsfn_region);
|
||||
srsran_ue_dl_set_mbsfn_area_id(&ue_dl, prog_args.mbsfn_area_id);
|
||||
srsran_ue_dl_set_non_mbsfn_region(&ue_dl, prog_args.non_mbsfn_region);
|
||||
}
|
||||
|
||||
#ifdef ENABLE_GUI
|
||||
|
@ -639,39 +639,39 @@ int main(int argc, char** argv)
|
|||
|
||||
#ifndef DISABLE_RF
|
||||
if (!prog_args.input_file_name) {
|
||||
srslte_rf_start_rx_stream(&rf, false);
|
||||
srsran_rf_start_rx_stream(&rf, false);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef DISABLE_RF
|
||||
if (prog_args.rf_gain < 0 && !prog_args.input_file_name) {
|
||||
srslte_rf_info_t* rf_info = srslte_rf_get_info(&rf);
|
||||
srslte_ue_sync_start_agc(&ue_sync,
|
||||
srslte_rf_set_rx_gain_th_wrapper_,
|
||||
srsran_rf_info_t* rf_info = srsran_rf_get_info(&rf);
|
||||
srsran_ue_sync_start_agc(&ue_sync,
|
||||
srsran_rf_set_rx_gain_th_wrapper_,
|
||||
rf_info->min_rx_gain,
|
||||
rf_info->max_rx_gain,
|
||||
cell_detect_config.init_agc);
|
||||
}
|
||||
#endif
|
||||
#ifdef PRINT_CHANGE_SCHEDULING
|
||||
srslte_ra_dl_grant_t old_dl_dci;
|
||||
bzero(&old_dl_dci, sizeof(srslte_ra_dl_grant_t));
|
||||
srsran_ra_dl_grant_t old_dl_dci;
|
||||
bzero(&old_dl_dci, sizeof(srsran_ra_dl_grant_t));
|
||||
#endif
|
||||
|
||||
ue_sync.cfo_correct_enable_track = !prog_args.disable_cfo;
|
||||
|
||||
srslte_pbch_decode_reset(&ue_mib.pbch);
|
||||
srsran_pbch_decode_reset(&ue_mib.pbch);
|
||||
|
||||
INFO("\nEntering main loop...");
|
||||
|
||||
// Variables for measurements
|
||||
uint32_t nframes = 0;
|
||||
float rsrp0 = 0.0, rsrp1 = 0.0, rsrq = 0.0, snr = 0.0, enodebrate = 0.0, uerate = 0.0, procrate = 0.0,
|
||||
sinr[SRSLTE_MAX_LAYERS][SRSLTE_MAX_CODEBOOKS] = {}, sync_err[SRSLTE_MAX_PORTS][SRSLTE_MAX_PORTS] = {};
|
||||
sinr[SRSRAN_MAX_LAYERS][SRSRAN_MAX_CODEBOOKS] = {}, sync_err[SRSRAN_MAX_PORTS][SRSRAN_MAX_PORTS] = {};
|
||||
bool decode_pdsch = false;
|
||||
|
||||
for (int i = 0; i < SRSLTE_MAX_LAYERS; i++) {
|
||||
srslte_vec_f_zero(sinr[i], SRSLTE_MAX_CODEBOOKS);
|
||||
for (int i = 0; i < SRSRAN_MAX_LAYERS; i++) {
|
||||
srsran_vec_f_zero(sinr[i], SRSRAN_MAX_CODEBOOKS);
|
||||
}
|
||||
|
||||
/* Main loop */
|
||||
|
@ -691,12 +691,12 @@ int main(int argc, char** argv)
|
|||
to.tv_usec = 0;
|
||||
|
||||
/* Set default verbose level */
|
||||
srslte_verbose = prog_args.verbose;
|
||||
srsran_verbose = prog_args.verbose;
|
||||
int n = select(1, &set, NULL, NULL, &to);
|
||||
if (n == 1) {
|
||||
/* If a new line is detected set verbose level to Debug */
|
||||
if (fgets(input, sizeof(input), stdin)) {
|
||||
srslte_verbose = SRSLTE_VERBOSE_DEBUG;
|
||||
srsran_verbose = SRSRAN_VERBOSE_DEBUG;
|
||||
pkt_errors = 0;
|
||||
pkt_total = 0;
|
||||
nof_detected = 0;
|
||||
|
@ -704,40 +704,40 @@ int main(int argc, char** argv)
|
|||
}
|
||||
}
|
||||
|
||||
cf_t* buffers[SRSLTE_MAX_CHANNELS] = {};
|
||||
for (int p = 0; p < SRSLTE_MAX_PORTS; p++) {
|
||||
cf_t* buffers[SRSRAN_MAX_CHANNELS] = {};
|
||||
for (int p = 0; p < SRSRAN_MAX_PORTS; p++) {
|
||||
buffers[p] = sf_buffer[p];
|
||||
}
|
||||
ret = srslte_ue_sync_zerocopy(&ue_sync, buffers, max_num_samples);
|
||||
ret = srsran_ue_sync_zerocopy(&ue_sync, buffers, max_num_samples);
|
||||
if (ret < 0) {
|
||||
ERROR("Error calling srslte_ue_sync_work()");
|
||||
ERROR("Error calling srsran_ue_sync_work()");
|
||||
}
|
||||
|
||||
#ifdef CORRECT_SAMPLE_OFFSET
|
||||
float sample_offset =
|
||||
(float)srslte_ue_sync_get_last_sample_offset(&ue_sync) + srslte_ue_sync_get_sfo(&ue_sync) / 1000;
|
||||
srslte_ue_dl_set_sample_offset(&ue_dl, sample_offset);
|
||||
(float)srsran_ue_sync_get_last_sample_offset(&ue_sync) + srsran_ue_sync_get_sfo(&ue_sync) / 1000;
|
||||
srsran_ue_dl_set_sample_offset(&ue_dl, sample_offset);
|
||||
#endif
|
||||
|
||||
/* srslte_ue_sync_get_buffer returns 1 if successfully read 1 aligned subframe */
|
||||
/* srsran_ue_sync_get_buffer returns 1 if successfully read 1 aligned subframe */
|
||||
if (ret == 1) {
|
||||
bool acks[SRSLTE_MAX_CODEWORDS] = {false};
|
||||
bool acks[SRSRAN_MAX_CODEWORDS] = {false};
|
||||
struct timeval t[3];
|
||||
|
||||
uint32_t sf_idx = srslte_ue_sync_get_sfidx(&ue_sync);
|
||||
uint32_t sf_idx = srsran_ue_sync_get_sfidx(&ue_sync);
|
||||
|
||||
switch (state) {
|
||||
case DECODE_MIB:
|
||||
if (sf_idx == 0) {
|
||||
uint8_t bch_payload[SRSLTE_BCH_PAYLOAD_LEN];
|
||||
uint8_t bch_payload[SRSRAN_BCH_PAYLOAD_LEN];
|
||||
int sfn_offset;
|
||||
n = srslte_ue_mib_decode(&ue_mib, bch_payload, NULL, &sfn_offset);
|
||||
n = srsran_ue_mib_decode(&ue_mib, bch_payload, NULL, &sfn_offset);
|
||||
if (n < 0) {
|
||||
ERROR("Error decoding UE MIB");
|
||||
exit(-1);
|
||||
} else if (n == SRSLTE_UE_MIB_FOUND) {
|
||||
srslte_pbch_mib_unpack(bch_payload, &cell, &sfn);
|
||||
srslte_cell_fprint(stdout, &cell, sfn);
|
||||
} else if (n == SRSRAN_UE_MIB_FOUND) {
|
||||
srsran_pbch_mib_unpack(bch_payload, &cell, &sfn);
|
||||
srsran_cell_fprint(stdout, &cell, sfn);
|
||||
printf("Decoded MIB. SFN: %d, offset: %d\n", sfn, sfn_offset);
|
||||
sfn = (sfn + sfn_offset) % 1024;
|
||||
state = DECODE_PDSCH;
|
||||
|
@ -746,9 +746,9 @@ int main(int argc, char** argv)
|
|||
break;
|
||||
case DECODE_PDSCH:
|
||||
|
||||
if (prog_args.rnti != SRSLTE_SIRNTI) {
|
||||
if (prog_args.rnti != SRSRAN_SIRNTI) {
|
||||
decode_pdsch = true;
|
||||
if (srslte_sfidx_tdd_type(dl_sf.tdd_config, sf_idx) == SRSLTE_TDD_SF_U) {
|
||||
if (srsran_sfidx_tdd_type(dl_sf.tdd_config, sf_idx) == SRSRAN_TDD_SF_U) {
|
||||
decode_pdsch = false;
|
||||
}
|
||||
} else {
|
||||
|
@ -764,14 +764,14 @@ int main(int argc, char** argv)
|
|||
|
||||
gettimeofday(&t[1], NULL);
|
||||
if (decode_pdsch) {
|
||||
srslte_sf_t sf_type;
|
||||
srsran_sf_t sf_type;
|
||||
if (mch_table[sf_idx] == 0 || prog_args.mbsfn_area_id < 0) { // Not an MBSFN subframe
|
||||
sf_type = SRSLTE_SF_NORM;
|
||||
sf_type = SRSRAN_SF_NORM;
|
||||
|
||||
// Set PDSCH channel estimation
|
||||
ue_dl_cfg.chest_cfg = chest_pdsch_cfg;
|
||||
} else {
|
||||
sf_type = SRSLTE_SF_MBSFN;
|
||||
sf_type = SRSRAN_SF_MBSFN;
|
||||
|
||||
// Set MBSFN channel estimation
|
||||
ue_dl_cfg.chest_cfg = chest_mbsfn_cfg;
|
||||
|
@ -781,25 +781,25 @@ int main(int argc, char** argv)
|
|||
for (uint32_t tm = 0; tm < 4 && !n; tm++) {
|
||||
dl_sf.tti = tti;
|
||||
dl_sf.sf_type = sf_type;
|
||||
ue_dl_cfg.cfg.tm = (srslte_tm_t)tm;
|
||||
ue_dl_cfg.cfg.tm = (srsran_tm_t)tm;
|
||||
ue_dl_cfg.cfg.pdsch.use_tbs_index_alt = prog_args.enable_256qam;
|
||||
|
||||
if ((ue_dl_cfg.cfg.tm == SRSLTE_TM1 && cell.nof_ports == 1) ||
|
||||
(ue_dl_cfg.cfg.tm > SRSLTE_TM1 && cell.nof_ports > 1)) {
|
||||
n = srslte_ue_dl_find_and_decode(&ue_dl, &dl_sf, &ue_dl_cfg, &pdsch_cfg, data, acks);
|
||||
if ((ue_dl_cfg.cfg.tm == SRSRAN_TM1 && cell.nof_ports == 1) ||
|
||||
(ue_dl_cfg.cfg.tm > SRSRAN_TM1 && cell.nof_ports > 1)) {
|
||||
n = srsran_ue_dl_find_and_decode(&ue_dl, &dl_sf, &ue_dl_cfg, &pdsch_cfg, data, acks);
|
||||
if (n > 0) {
|
||||
nof_detected++;
|
||||
last_decoded_tm = tm;
|
||||
for (uint32_t tb = 0; tb < SRSLTE_MAX_CODEWORDS; tb++) {
|
||||
for (uint32_t tb = 0; tb < SRSRAN_MAX_CODEWORDS; tb++) {
|
||||
if (pdsch_cfg.grant.tb[tb].enabled) {
|
||||
if (!acks[tb]) {
|
||||
if (sf_type == SRSLTE_SF_NORM) {
|
||||
if (sf_type == SRSRAN_SF_NORM) {
|
||||
pkt_errors++;
|
||||
} else {
|
||||
pmch_pkt_errors++;
|
||||
}
|
||||
}
|
||||
if (sf_type == SRSLTE_SF_NORM) {
|
||||
if (sf_type == SRSRAN_SF_NORM) {
|
||||
pkt_total++;
|
||||
} else {
|
||||
pmch_pkt_total++;
|
||||
|
@ -811,7 +811,7 @@ int main(int argc, char** argv)
|
|||
}
|
||||
// Feed-back ue_sync with chest_dl CFO estimation
|
||||
if (sf_idx == 5 && prog_args.enable_cfo_ref) {
|
||||
srslte_ue_sync_set_cfo_ref(&ue_sync, ue_dl.chest_res.cfo);
|
||||
srsran_ue_sync_set_cfo_ref(&ue_sync, ue_dl.chest_res.cfo);
|
||||
}
|
||||
|
||||
gettimeofday(&t[2], NULL);
|
||||
|
@ -821,25 +821,25 @@ int main(int argc, char** argv)
|
|||
/* Send data if socket active */
|
||||
if (prog_args.net_port > 0) {
|
||||
if (sf_idx == 1) {
|
||||
srslte_netsink_write(&net_sink, data[0], 1 + (n - 1) / 8);
|
||||
srsran_netsink_write(&net_sink, data[0], 1 + (n - 1) / 8);
|
||||
} else {
|
||||
// TODO: UDP Data transmission does not work
|
||||
for (uint32_t tb = 0; tb < SRSLTE_MAX_CODEWORDS; tb++) {
|
||||
for (uint32_t tb = 0; tb < SRSRAN_MAX_CODEWORDS; tb++) {
|
||||
if (pdsch_cfg.grant.tb[tb].enabled) {
|
||||
srslte_netsink_write(&net_sink, data[tb], 1 + (pdsch_cfg.grant.tb[tb].tbs - 1) / 8);
|
||||
srsran_netsink_write(&net_sink, data[tb], 1 + (pdsch_cfg.grant.tb[tb].tbs - 1) / 8);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#ifdef PRINT_CHANGE_SCHEDULING
|
||||
if (pdsch_cfg.dci.cw[0].mcs_idx != old_dl_dci.cw[0].mcs_idx ||
|
||||
memcmp(&pdsch_cfg.dci.type0_alloc, &old_dl_dci.type0_alloc, sizeof(srslte_ra_type0_t)) ||
|
||||
memcmp(&pdsch_cfg.dci.type1_alloc, &old_dl_dci.type1_alloc, sizeof(srslte_ra_type1_t)) ||
|
||||
memcmp(&pdsch_cfg.dci.type2_alloc, &old_dl_dci.type2_alloc, sizeof(srslte_ra_type2_t))) {
|
||||
memcmp(&pdsch_cfg.dci.type0_alloc, &old_dl_dci.type0_alloc, sizeof(srsran_ra_type0_t)) ||
|
||||
memcmp(&pdsch_cfg.dci.type1_alloc, &old_dl_dci.type1_alloc, sizeof(srsran_ra_type1_t)) ||
|
||||
memcmp(&pdsch_cfg.dci.type2_alloc, &old_dl_dci.type2_alloc, sizeof(srsran_ra_type2_t))) {
|
||||
old_dl_dci = pdsch_cfg.dci;
|
||||
fflush(stdout);
|
||||
printf("DCI %s\n", srslte_dci_format_string(pdsch_cfg.dci.dci_format));
|
||||
srslte_ra_pdsch_fprint(stdout, &old_dl_dci, cell.nof_prb);
|
||||
printf("DCI %s\n", srsran_dci_format_string(pdsch_cfg.dci.dci_format));
|
||||
srsran_ra_pdsch_fprint(stdout, &old_dl_dci, cell.nof_prb);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
@ -849,16 +849,16 @@ int main(int argc, char** argv)
|
|||
uint32_t enb_bits = ((pdsch_cfg.grant.tb[0].enabled ? pdsch_cfg.grant.tb[0].tbs : 0) +
|
||||
(pdsch_cfg.grant.tb[1].enabled ? pdsch_cfg.grant.tb[1].tbs : 0));
|
||||
uint32_t ue_bits = ((acks[0] ? pdsch_cfg.grant.tb[0].tbs : 0) + (acks[1] ? pdsch_cfg.grant.tb[1].tbs : 0));
|
||||
rsrq = SRSLTE_VEC_EMA(ue_dl.chest_res.rsrp_dbm, rsrq, 0.1f);
|
||||
rsrp0 = SRSLTE_VEC_EMA(ue_dl.chest_res.rsrp_port_dbm[0], rsrp0, 0.05f);
|
||||
rsrp1 = SRSLTE_VEC_EMA(ue_dl.chest_res.rsrp_port_dbm[1], rsrp1, 0.05f);
|
||||
snr = SRSLTE_VEC_EMA(ue_dl.chest_res.snr_db, snr, 0.05f);
|
||||
enodebrate = SRSLTE_VEC_EMA(enb_bits / 1000.0f, enodebrate, 0.05f);
|
||||
uerate = SRSLTE_VEC_EMA(ue_bits / 1000.0f, uerate, 0.001f);
|
||||
rsrq = SRSRAN_VEC_EMA(ue_dl.chest_res.rsrp_dbm, rsrq, 0.1f);
|
||||
rsrp0 = SRSRAN_VEC_EMA(ue_dl.chest_res.rsrp_port_dbm[0], rsrp0, 0.05f);
|
||||
rsrp1 = SRSRAN_VEC_EMA(ue_dl.chest_res.rsrp_port_dbm[1], rsrp1, 0.05f);
|
||||
snr = SRSRAN_VEC_EMA(ue_dl.chest_res.snr_db, snr, 0.05f);
|
||||
enodebrate = SRSRAN_VEC_EMA(enb_bits / 1000.0f, enodebrate, 0.05f);
|
||||
uerate = SRSRAN_VEC_EMA(ue_bits / 1000.0f, uerate, 0.001f);
|
||||
if (chest_pdsch_cfg.sync_error_enable) {
|
||||
for (uint32_t i = 0; i < cell.nof_ports; i++) {
|
||||
for (uint32_t j = 0; j < prog_args.rf_nof_rx_ant; j++) {
|
||||
sync_err[i][j] = SRSLTE_VEC_EMA(ue_dl.chest.sync_err[i][j], sync_err[i][j], 0.001f);
|
||||
sync_err[i][j] = SRSRAN_VEC_EMA(ue_dl.chest.sync_err[i][j], sync_err[i][j], 0.001f);
|
||||
if (!isnormal(sync_err[i][j])) {
|
||||
sync_err[i][j] = 0.0f;
|
||||
}
|
||||
|
@ -867,7 +867,7 @@ int main(int argc, char** argv)
|
|||
}
|
||||
float elapsed = (float)t[0].tv_usec + t[0].tv_sec * 1.0e+6f;
|
||||
if (elapsed != 0.0f) {
|
||||
procrate = SRSLTE_VEC_EMA(ue_bits / elapsed, procrate, 0.01f);
|
||||
procrate = SRSRAN_VEC_EMA(ue_bits / elapsed, procrate, 0.01f);
|
||||
}
|
||||
|
||||
nframes++;
|
||||
|
@ -889,13 +889,13 @@ int main(int argc, char** argv)
|
|||
if (sf_idx == 5) {
|
||||
float gain = prog_args.rf_gain;
|
||||
if (gain < 0) {
|
||||
gain = srslte_convert_power_to_dB(srslte_agc_get_gain(&ue_sync.agc));
|
||||
gain = srsran_convert_power_to_dB(srsran_agc_get_gain(&ue_sync.agc));
|
||||
}
|
||||
|
||||
/* Print transmission scheme */
|
||||
|
||||
/* Print basic Parameters */
|
||||
PRINT_LINE(" CFO: %+7.2f Hz", srslte_ue_sync_get_cfo(&ue_sync));
|
||||
PRINT_LINE(" CFO: %+7.2f Hz", srsran_ue_sync_get_cfo(&ue_sync));
|
||||
PRINT_LINE(" RSRP: %+5.1f dBm | %+5.1f dBm", rsrp0, rsrp1);
|
||||
PRINT_LINE(" SNR: %+5.1f dB", snr);
|
||||
PRINT_LINE(" TM: %d", last_decoded_tm + 1);
|
||||
|
@ -917,7 +917,7 @@ int main(int argc, char** argv)
|
|||
uint32_t ri = 0;
|
||||
float cn = 0;
|
||||
/* Compute condition number */
|
||||
if (srslte_ue_dl_select_ri(&ue_dl, &ri, &cn)) {
|
||||
if (srsran_ue_dl_select_ri(&ue_dl, &ri, &cn)) {
|
||||
/* Condition number calculation is not supported for the number of tx & rx antennas*/
|
||||
PRINT_LINE(" κ: NA");
|
||||
} else {
|
||||
|
@ -962,12 +962,12 @@ int main(int argc, char** argv)
|
|||
#endif /* ENABLE_GUI */
|
||||
} else if (ret == 0) {
|
||||
printf("Finding PSS... Peak: %8.1f, FrameCnt: %d, State: %d\r",
|
||||
srslte_sync_get_peak_value(&ue_sync.sfind),
|
||||
srsran_sync_get_peak_value(&ue_sync.sfind),
|
||||
ue_sync.frame_total_cnt,
|
||||
ue_sync.state);
|
||||
#ifdef ENABLE_GUI
|
||||
if (!prog_args.disable_plots) {
|
||||
plot_sf_idx = srslte_ue_sync_get_sfidx(&ue_sync);
|
||||
plot_sf_idx = srsran_ue_sync_get_sfidx(&ue_sync);
|
||||
plot_track = false;
|
||||
sem_post(&plot_sem);
|
||||
}
|
||||
|
@ -985,9 +985,9 @@ int main(int argc, char** argv)
|
|||
}
|
||||
}
|
||||
#endif
|
||||
srslte_ue_dl_free(&ue_dl);
|
||||
srslte_ue_sync_free(&ue_sync);
|
||||
for (int i = 0; i < SRSLTE_MAX_CODEWORDS; i++) {
|
||||
srsran_ue_dl_free(&ue_dl);
|
||||
srsran_ue_sync_free(&ue_sync);
|
||||
for (int i = 0; i < SRSRAN_MAX_CODEWORDS; i++) {
|
||||
if (data[i]) {
|
||||
free(data[i]);
|
||||
}
|
||||
|
@ -1000,8 +1000,8 @@ int main(int argc, char** argv)
|
|||
|
||||
#ifndef DISABLE_RF
|
||||
if (!prog_args.input_file_name) {
|
||||
srslte_ue_mib_free(&ue_mib);
|
||||
srslte_rf_close(&rf);
|
||||
srsran_ue_mib_free(&ue_mib);
|
||||
srsran_rf_close(&rf);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -1023,7 +1023,7 @@ static float tmp_plot2[110 * 15 * 2048];
|
|||
void* plot_thread_run(void* arg)
|
||||
{
|
||||
int i;
|
||||
uint32_t nof_re = SRSLTE_SF_LEN_RE(ue_dl.cell.nof_prb, ue_dl.cell.cp);
|
||||
uint32_t nof_re = SRSRAN_SF_LEN_RE(ue_dl.cell.nof_prb, ue_dl.cell.cp);
|
||||
|
||||
sdrgui_init();
|
||||
|
||||
|
@ -1068,18 +1068,18 @@ void* plot_thread_run(void* arg)
|
|||
uint32_t nof_symbols = pdsch_cfg.grant.nof_re;
|
||||
if (!prog_args.disable_plots_except_constellation) {
|
||||
for (i = 0; i < nof_re; i++) {
|
||||
tmp_plot[i] = srslte_convert_amplitude_to_dB(cabsf(ue_dl.sf_symbols[0][i]));
|
||||
tmp_plot[i] = srsran_convert_amplitude_to_dB(cabsf(ue_dl.sf_symbols[0][i]));
|
||||
if (isinf(tmp_plot[i])) {
|
||||
tmp_plot[i] = -80;
|
||||
}
|
||||
}
|
||||
int sz = srslte_symbol_sz(ue_dl.cell.nof_prb);
|
||||
int sz = srsran_symbol_sz(ue_dl.cell.nof_prb);
|
||||
if (sz > 0) {
|
||||
srslte_vec_f_zero(tmp_plot2, sz);
|
||||
srsran_vec_f_zero(tmp_plot2, sz);
|
||||
}
|
||||
int g = (sz - 12 * ue_dl.cell.nof_prb) / 2;
|
||||
for (i = 0; i < 12 * ue_dl.cell.nof_prb; i++) {
|
||||
tmp_plot2[g + i] = srslte_convert_amplitude_to_dB(cabsf(ue_dl.chest_res.ce[0][0][i]));
|
||||
tmp_plot2[g + i] = srsran_convert_amplitude_to_dB(cabsf(ue_dl.chest_res.ce[0][0][i]));
|
||||
if (isinf(tmp_plot2[g + i])) {
|
||||
tmp_plot2[g + i] = -80;
|
||||
}
|
||||
|
@ -1088,17 +1088,17 @@ void* plot_thread_run(void* arg)
|
|||
|
||||
if (!prog_args.input_file_name) {
|
||||
if (plot_track) {
|
||||
srslte_pss_t* pss_obj = srslte_sync_get_cur_pss_obj(&ue_sync.strack);
|
||||
int max = srslte_vec_max_fi(pss_obj->conv_output_avg, pss_obj->frame_size + pss_obj->fft_size - 1);
|
||||
srslte_vec_sc_prod_fff(pss_obj->conv_output_avg,
|
||||
srsran_pss_t* pss_obj = srsran_sync_get_cur_pss_obj(&ue_sync.strack);
|
||||
int max = srsran_vec_max_fi(pss_obj->conv_output_avg, pss_obj->frame_size + pss_obj->fft_size - 1);
|
||||
srsran_vec_sc_prod_fff(pss_obj->conv_output_avg,
|
||||
1 / pss_obj->conv_output_avg[max],
|
||||
tmp_plot2,
|
||||
pss_obj->frame_size + pss_obj->fft_size - 1);
|
||||
plot_real_setNewData(&p_sync, tmp_plot2, pss_obj->frame_size);
|
||||
} else {
|
||||
int max = srslte_vec_max_fi(ue_sync.sfind.pss.conv_output_avg,
|
||||
int max = srsran_vec_max_fi(ue_sync.sfind.pss.conv_output_avg,
|
||||
ue_sync.sfind.pss.frame_size + ue_sync.sfind.pss.fft_size - 1);
|
||||
srslte_vec_sc_prod_fff(ue_sync.sfind.pss.conv_output_avg,
|
||||
srsran_vec_sc_prod_fff(ue_sync.sfind.pss.conv_output_avg,
|
||||
1 / ue_sync.sfind.pss.conv_output_avg[max],
|
||||
tmp_plot2,
|
||||
ue_sync.sfind.pss.frame_size + ue_sync.sfind.pss.fft_size - 1);
|
||||
|
@ -1117,8 +1117,8 @@ void* plot_thread_run(void* arg)
|
|||
|
||||
if (plot_sf_idx == 1) {
|
||||
if (prog_args.net_port_signal > 0) {
|
||||
srslte_netsink_write(
|
||||
&net_sink_signal, &sf_buffer[srslte_ue_sync_sf_len(&ue_sync) / 7], srslte_ue_sync_sf_len(&ue_sync));
|
||||
srsran_netsink_write(
|
||||
&net_sink_signal, &sf_buffer[srsran_ue_sync_sf_len(&ue_sync) / 7], srsran_ue_sync_sf_len(&ue_sync));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
*
|
||||
* \section COPYRIGHT
|
||||
*
|
||||
* Copyright 2013-2020 Software Radio Systems Limited
|
||||
* Copyright 2013-2021 Software Radio Systems Limited
|
||||
*
|
||||
* By using this file, you agree to the terms and conditions set
|
||||
* forth in the LICENSE file which can be found at the top level of
|
||||
|
@ -18,25 +18,25 @@
|
|||
#include <strings.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "srslte/common/pcap.h"
|
||||
#include "srslte/phy/ch_estimation/chest_sl.h"
|
||||
#include "srslte/phy/common/phy_common_sl.h"
|
||||
#include "srslte/phy/dft/ofdm.h"
|
||||
#include "srslte/phy/phch/pscch.h"
|
||||
#include "srslte/phy/phch/pssch.h"
|
||||
#include "srslte/phy/phch/ra_sl.h"
|
||||
#include "srslte/phy/phch/sci.h"
|
||||
#include "srslte/phy/rf/rf.h"
|
||||
#include "srslte/phy/ue/ue_sync.h"
|
||||
#include "srslte/phy/utils/bit.h"
|
||||
#include "srslte/phy/utils/debug.h"
|
||||
#include "srslte/phy/utils/vector.h"
|
||||
#include "srsran/common/pcap.h"
|
||||
#include "srsran/phy/ch_estimation/chest_sl.h"
|
||||
#include "srsran/phy/common/phy_common_sl.h"
|
||||
#include "srsran/phy/dft/ofdm.h"
|
||||
#include "srsran/phy/phch/pscch.h"
|
||||
#include "srsran/phy/phch/pssch.h"
|
||||
#include "srsran/phy/phch/ra_sl.h"
|
||||
#include "srsran/phy/phch/sci.h"
|
||||
#include "srsran/phy/rf/rf.h"
|
||||
#include "srsran/phy/ue/ue_sync.h"
|
||||
#include "srsran/phy/utils/bit.h"
|
||||
#include "srsran/phy/utils/debug.h"
|
||||
#include "srsran/phy/utils/vector.h"
|
||||
|
||||
#define PCAP_FILENAME "/tmp/pssch.pcap"
|
||||
|
||||
static bool keep_running = true;
|
||||
|
||||
static srslte_cell_sl_t cell_sl = {.nof_prb = 50, .tm = SRSLTE_SIDELINK_TM4, .cp = SRSLTE_CP_NORM, .N_sl_id = 0};
|
||||
static srsran_cell_sl_t cell_sl = {.nof_prb = 50, .tm = SRSRAN_SIDELINK_TM4, .cp = SRSRAN_CP_NORM, .N_sl_id = 0};
|
||||
|
||||
typedef struct {
|
||||
bool use_standard_lte_rates;
|
||||
|
@ -70,16 +70,16 @@ void args_default(prog_args_t* args)
|
|||
args->num_sub_channel = 5;
|
||||
}
|
||||
|
||||
static srslte_pscch_t pscch = {}; // Defined global for plotting thread
|
||||
static srslte_pssch_t pssch = {};
|
||||
static srsran_pscch_t pscch = {}; // Defined global for plotting thread
|
||||
static srsran_pssch_t pssch = {};
|
||||
|
||||
#ifndef DISABLE_RF
|
||||
static srslte_rf_t radio;
|
||||
static srsran_rf_t radio;
|
||||
#endif // DISABLE_RF
|
||||
|
||||
static prog_args_t prog_args;
|
||||
|
||||
static srslte_filesource_t fsrc = {};
|
||||
static srsran_filesource_t fsrc = {};
|
||||
|
||||
#ifdef ENABLE_GUI
|
||||
#include "srsgui/srsgui.h"
|
||||
|
@ -115,8 +115,8 @@ void pcap_pack_and_write(FILE* pcap_file,
|
|||
.ueid = 1,
|
||||
.isRetx = reTX,
|
||||
.crcStatusOK = crc_ok,
|
||||
.sysFrameNumber = (uint16_t)(tti / SRSLTE_NOF_SF_X_FRAME),
|
||||
.subFrameNumber = (uint16_t)(tti % SRSLTE_NOF_SF_X_FRAME),
|
||||
.sysFrameNumber = (uint16_t)(tti / SRSRAN_NOF_SF_X_FRAME),
|
||||
.subFrameNumber = (uint16_t)(tti % SRSRAN_NOF_SF_X_FRAME),
|
||||
.nbiotMode = 0};
|
||||
if (pdu) {
|
||||
LTE_PCAP_MAC_WritePDU(pcap_file, &context, pdu, pdu_len_bytes);
|
||||
|
@ -141,7 +141,7 @@ void usage(prog_args_t* args, char* prog)
|
|||
#ifdef ENABLE_GUI
|
||||
printf("\t-w disable plots [Default enabled]\n");
|
||||
#endif
|
||||
printf("\t-v srslte_verbose\n");
|
||||
printf("\t-v srsran_verbose\n");
|
||||
}
|
||||
|
||||
void parse_args(prog_args_t* args, int argc, char** argv)
|
||||
|
@ -179,7 +179,7 @@ void parse_args(prog_args_t* args, int argc, char** argv)
|
|||
args->nof_rx_antennas = (int32_t)strtol(argv[optind], NULL, 10);
|
||||
break;
|
||||
case 'v':
|
||||
srslte_verbose++;
|
||||
srsran_verbose++;
|
||||
break;
|
||||
case 'w':
|
||||
args->disable_plots = true;
|
||||
|
@ -199,14 +199,14 @@ void parse_args(prog_args_t* args, int argc, char** argv)
|
|||
}
|
||||
|
||||
#ifndef DISABLE_RF
|
||||
int srslte_rf_recv_wrapper(void* h, cf_t* data[SRSLTE_MAX_PORTS], uint32_t nsamples, srslte_timestamp_t* t)
|
||||
int srsran_rf_recv_wrapper(void* h, cf_t* data[SRSRAN_MAX_PORTS], uint32_t nsamples, srsran_timestamp_t* t)
|
||||
{
|
||||
DEBUG(" ---- Receive %d samples ----", nsamples);
|
||||
void* ptr[SRSLTE_MAX_PORTS];
|
||||
for (int i = 0; i < SRSLTE_MAX_PORTS; i++) {
|
||||
void* ptr[SRSRAN_MAX_PORTS];
|
||||
for (int i = 0; i < SRSRAN_MAX_PORTS; i++) {
|
||||
ptr[i] = data[i];
|
||||
}
|
||||
return srslte_rf_recv_with_time_multi(h, ptr, nsamples, true, &t->full_secs, &t->frac_secs);
|
||||
return srsran_rf_recv_with_time_multi(h, ptr, nsamples, true, &t->full_secs, &t->frac_secs);
|
||||
}
|
||||
#endif // DISABLE_RF
|
||||
|
||||
|
@ -225,18 +225,18 @@ int main(int argc, char** argv)
|
|||
|
||||
FILE* pcap_file = LTE_PCAP_Open(MAC_LTE_DLT, PCAP_FILENAME);
|
||||
|
||||
srslte_use_standard_symbol_size(prog_args.use_standard_lte_rates);
|
||||
srsran_use_standard_symbol_size(prog_args.use_standard_lte_rates);
|
||||
|
||||
srslte_sl_comm_resource_pool_t sl_comm_resource_pool;
|
||||
if (srslte_sl_comm_resource_pool_get_default_config(&sl_comm_resource_pool, cell_sl) != SRSLTE_SUCCESS) {
|
||||
srsran_sl_comm_resource_pool_t sl_comm_resource_pool;
|
||||
if (srsran_sl_comm_resource_pool_get_default_config(&sl_comm_resource_pool, cell_sl) != SRSRAN_SUCCESS) {
|
||||
ERROR("Error initializing sl_comm_resource_pool");
|
||||
return SRSLTE_ERROR;
|
||||
return SRSRAN_ERROR;
|
||||
}
|
||||
|
||||
if (prog_args.input_file_name) {
|
||||
if (srslte_filesource_init(&fsrc, prog_args.input_file_name, SRSLTE_COMPLEX_FLOAT_BIN)) {
|
||||
if (srsran_filesource_init(&fsrc, prog_args.input_file_name, SRSRAN_COMPLEX_FLOAT_BIN)) {
|
||||
printf("Error opening file %s\n", prog_args.input_file_name);
|
||||
return SRSLTE_ERROR;
|
||||
return SRSRAN_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -244,21 +244,21 @@ int main(int argc, char** argv)
|
|||
if (!prog_args.input_file_name) {
|
||||
printf("Opening RF device...\n");
|
||||
|
||||
if (srslte_rf_open_multi(&radio, prog_args.rf_args, prog_args.nof_rx_antennas)) {
|
||||
if (srsran_rf_open_multi(&radio, prog_args.rf_args, prog_args.nof_rx_antennas)) {
|
||||
ERROR("Error opening rf");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
srslte_rf_set_rx_gain(&radio, prog_args.rf_gain);
|
||||
srsran_rf_set_rx_gain(&radio, prog_args.rf_gain);
|
||||
|
||||
printf("Set RX freq: %.6f MHz\n",
|
||||
srslte_rf_set_rx_freq(&radio, prog_args.nof_rx_antennas, prog_args.rf_freq) / 1e6);
|
||||
srsran_rf_set_rx_freq(&radio, prog_args.nof_rx_antennas, prog_args.rf_freq) / 1e6);
|
||||
printf("Set RX gain: %.1f dB\n", prog_args.rf_gain);
|
||||
int srate = srslte_sampling_freq_hz(cell_sl.nof_prb);
|
||||
int srate = srsran_sampling_freq_hz(cell_sl.nof_prb);
|
||||
|
||||
if (srate != -1) {
|
||||
printf("Setting sampling rate %.2f MHz\n", (float)srate / 1000000);
|
||||
float srate_rf = srslte_rf_set_rx_srate(&radio, (double)srate);
|
||||
float srate_rf = srsran_rf_set_rx_srate(&radio, (double)srate);
|
||||
if (srate_rf != srate) {
|
||||
ERROR("Could not set sampling rate");
|
||||
exit(-1);
|
||||
|
@ -271,99 +271,99 @@ int main(int argc, char** argv)
|
|||
#endif // DISABLE_RF
|
||||
|
||||
// allocate Rx buffers for 1ms worth of samples
|
||||
uint32_t sf_len = SRSLTE_SF_LEN_PRB(cell_sl.nof_prb);
|
||||
uint32_t sf_len = SRSRAN_SF_LEN_PRB(cell_sl.nof_prb);
|
||||
printf("Using a SF len of %d samples\n", sf_len);
|
||||
|
||||
cf_t* rx_buffer[SRSLTE_MAX_CHANNELS] = {}; //< For radio to receive samples
|
||||
cf_t* sf_buffer[SRSLTE_MAX_PORTS] = {NULL}; ///< For OFDM object to store subframe after FFT
|
||||
cf_t* rx_buffer[SRSRAN_MAX_CHANNELS] = {}; //< For radio to receive samples
|
||||
cf_t* sf_buffer[SRSRAN_MAX_PORTS] = {NULL}; ///< For OFDM object to store subframe after FFT
|
||||
|
||||
for (int i = 0; i < prog_args.nof_rx_antennas; i++) {
|
||||
rx_buffer[i] = srslte_vec_cf_malloc(sf_len);
|
||||
rx_buffer[i] = srsran_vec_cf_malloc(sf_len);
|
||||
if (!rx_buffer[i]) {
|
||||
perror("malloc");
|
||||
exit(-1);
|
||||
}
|
||||
sf_buffer[i] = srslte_vec_cf_malloc(sf_len);
|
||||
sf_buffer[i] = srsran_vec_cf_malloc(sf_len);
|
||||
if (!sf_buffer[i]) {
|
||||
perror("malloc");
|
||||
exit(-1);
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t sf_n_re = SRSLTE_CP_NSYMB(SRSLTE_CP_NORM) * SRSLTE_NRE * 2 * cell_sl.nof_prb;
|
||||
cf_t* equalized_sf_buffer = srslte_vec_malloc(sizeof(cf_t) * sf_n_re);
|
||||
uint32_t sf_n_re = SRSRAN_CP_NSYMB(SRSRAN_CP_NORM) * SRSRAN_NRE * 2 * cell_sl.nof_prb;
|
||||
cf_t* equalized_sf_buffer = srsran_vec_malloc(sizeof(cf_t) * sf_n_re);
|
||||
|
||||
// RX
|
||||
srslte_ofdm_t fft[SRSLTE_MAX_PORTS];
|
||||
srslte_ofdm_cfg_t ofdm_cfg = {};
|
||||
srsran_ofdm_t fft[SRSRAN_MAX_PORTS];
|
||||
srsran_ofdm_cfg_t ofdm_cfg = {};
|
||||
ofdm_cfg.nof_prb = cell_sl.nof_prb;
|
||||
ofdm_cfg.cp = SRSLTE_CP_NORM;
|
||||
ofdm_cfg.cp = SRSRAN_CP_NORM;
|
||||
ofdm_cfg.rx_window_offset = 0.0f;
|
||||
ofdm_cfg.normalize = true;
|
||||
ofdm_cfg.sf_type = SRSLTE_SF_NORM;
|
||||
ofdm_cfg.sf_type = SRSRAN_SF_NORM;
|
||||
ofdm_cfg.freq_shift_f = -0.5;
|
||||
for (int i = 0; i < prog_args.nof_rx_antennas; i++) {
|
||||
ofdm_cfg.in_buffer = rx_buffer[0];
|
||||
ofdm_cfg.out_buffer = sf_buffer[0];
|
||||
|
||||
if (srslte_ofdm_rx_init_cfg(&fft[i], &ofdm_cfg)) {
|
||||
if (srsran_ofdm_rx_init_cfg(&fft[i], &ofdm_cfg)) {
|
||||
ERROR("Error initiating FFT");
|
||||
goto clean_exit;
|
||||
}
|
||||
}
|
||||
|
||||
// SCI
|
||||
srslte_sci_t sci;
|
||||
srslte_sci_init(&sci, cell_sl, sl_comm_resource_pool);
|
||||
uint8_t sci_rx[SRSLTE_SCI_MAX_LEN] = {};
|
||||
char sci_msg[SRSLTE_SCI_MSG_MAX_LEN] = {};
|
||||
srsran_sci_t sci;
|
||||
srsran_sci_init(&sci, cell_sl, sl_comm_resource_pool);
|
||||
uint8_t sci_rx[SRSRAN_SCI_MAX_LEN] = {};
|
||||
char sci_msg[SRSRAN_SCI_MSG_MAX_LEN] = {};
|
||||
|
||||
// init PSCCH object
|
||||
if (srslte_pscch_init(&pscch, SRSLTE_MAX_PRB) != SRSLTE_SUCCESS) {
|
||||
if (srsran_pscch_init(&pscch, SRSRAN_MAX_PRB) != SRSRAN_SUCCESS) {
|
||||
ERROR("Error in PSCCH init");
|
||||
return SRSLTE_ERROR;
|
||||
return SRSRAN_ERROR;
|
||||
}
|
||||
|
||||
if (srslte_pscch_set_cell(&pscch, cell_sl) != SRSLTE_SUCCESS) {
|
||||
if (srsran_pscch_set_cell(&pscch, cell_sl) != SRSRAN_SUCCESS) {
|
||||
ERROR("Error in PSCCH set cell");
|
||||
return SRSLTE_ERROR;
|
||||
return SRSRAN_ERROR;
|
||||
}
|
||||
|
||||
// PSCCH Channel estimation
|
||||
srslte_chest_sl_cfg_t pscch_chest_sl_cfg = {};
|
||||
srslte_chest_sl_t pscch_chest = {};
|
||||
if (srslte_chest_sl_init(&pscch_chest, SRSLTE_SIDELINK_PSCCH, cell_sl, sl_comm_resource_pool) != SRSLTE_SUCCESS) {
|
||||
srsran_chest_sl_cfg_t pscch_chest_sl_cfg = {};
|
||||
srsran_chest_sl_t pscch_chest = {};
|
||||
if (srsran_chest_sl_init(&pscch_chest, SRSRAN_SIDELINK_PSCCH, cell_sl, sl_comm_resource_pool) != SRSRAN_SUCCESS) {
|
||||
ERROR("Error in chest PSCCH init");
|
||||
return SRSLTE_ERROR;
|
||||
return SRSRAN_ERROR;
|
||||
}
|
||||
|
||||
if (srslte_pssch_init(&pssch, cell_sl, sl_comm_resource_pool) != SRSLTE_SUCCESS) {
|
||||
if (srsran_pssch_init(&pssch, cell_sl, sl_comm_resource_pool) != SRSRAN_SUCCESS) {
|
||||
ERROR("Error initializing PSSCH");
|
||||
return SRSLTE_ERROR;
|
||||
return SRSRAN_ERROR;
|
||||
}
|
||||
|
||||
srslte_chest_sl_cfg_t pssch_chest_sl_cfg = {};
|
||||
srslte_chest_sl_t pssch_chest = {};
|
||||
if (srslte_chest_sl_init(&pssch_chest, SRSLTE_SIDELINK_PSSCH, cell_sl, sl_comm_resource_pool) != SRSLTE_SUCCESS) {
|
||||
srsran_chest_sl_cfg_t pssch_chest_sl_cfg = {};
|
||||
srsran_chest_sl_t pssch_chest = {};
|
||||
if (srsran_chest_sl_init(&pssch_chest, SRSRAN_SIDELINK_PSSCH, cell_sl, sl_comm_resource_pool) != SRSRAN_SUCCESS) {
|
||||
ERROR("Error in chest PSSCH init");
|
||||
return SRSLTE_ERROR;
|
||||
return SRSRAN_ERROR;
|
||||
}
|
||||
|
||||
uint8_t tb[SRSLTE_SL_SCH_MAX_TB_LEN] = {};
|
||||
uint8_t packed_tb[SRSLTE_SL_SCH_MAX_TB_LEN / 8] = {};
|
||||
uint8_t tb[SRSRAN_SL_SCH_MAX_TB_LEN] = {};
|
||||
uint8_t packed_tb[SRSRAN_SL_SCH_MAX_TB_LEN / 8] = {};
|
||||
|
||||
#ifndef DISABLE_RF
|
||||
srslte_ue_sync_t ue_sync = {};
|
||||
srsran_ue_sync_t ue_sync = {};
|
||||
if (!prog_args.input_file_name) {
|
||||
srslte_cell_t cell = {};
|
||||
srsran_cell_t cell = {};
|
||||
cell.nof_prb = cell_sl.nof_prb;
|
||||
cell.cp = SRSLTE_CP_NORM;
|
||||
cell.cp = SRSRAN_CP_NORM;
|
||||
cell.nof_ports = 1;
|
||||
|
||||
if (srslte_ue_sync_init_multi_decim_mode(&ue_sync,
|
||||
if (srsran_ue_sync_init_multi_decim_mode(&ue_sync,
|
||||
cell.nof_prb,
|
||||
false,
|
||||
srslte_rf_recv_wrapper,
|
||||
srsran_rf_recv_wrapper,
|
||||
prog_args.nof_rx_antennas,
|
||||
(void*)&radio,
|
||||
1,
|
||||
|
@ -372,12 +372,12 @@ int main(int argc, char** argv)
|
|||
exit(-1);
|
||||
}
|
||||
|
||||
if (srslte_ue_sync_set_cell(&ue_sync, cell)) {
|
||||
if (srsran_ue_sync_set_cell(&ue_sync, cell)) {
|
||||
ERROR("Error initiating ue_sync");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
srslte_rf_start_rx_stream(&radio, false);
|
||||
srsran_rf_start_rx_stream(&radio, false);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -399,7 +399,7 @@ int main(int argc, char** argv)
|
|||
while (keep_running) {
|
||||
if (prog_args.input_file_name) {
|
||||
// read subframe from file
|
||||
int nread = srslte_filesource_read(&fsrc, rx_buffer[0], sf_len);
|
||||
int nread = srsran_filesource_read(&fsrc, rx_buffer[0], sf_len);
|
||||
if (nread < 0) {
|
||||
fprintf(stderr, "Error reading from file\n");
|
||||
goto clean_exit;
|
||||
|
@ -412,18 +412,18 @@ int main(int argc, char** argv)
|
|||
} else {
|
||||
#ifndef DISABLE_RF
|
||||
// receive subframe from radio
|
||||
int ret = srslte_ue_sync_zerocopy(&ue_sync, rx_buffer, sf_len);
|
||||
int ret = srsran_ue_sync_zerocopy(&ue_sync, rx_buffer, sf_len);
|
||||
if (ret < 0) {
|
||||
ERROR("Error calling srslte_ue_sync_work()");
|
||||
ERROR("Error calling srsran_ue_sync_work()");
|
||||
}
|
||||
|
||||
// update SF index
|
||||
current_sf_idx = srslte_ue_sync_get_sfidx(&ue_sync);
|
||||
current_sf_idx = srsran_ue_sync_get_sfidx(&ue_sync);
|
||||
#endif // DISABLE_RF
|
||||
}
|
||||
|
||||
// do FFT (on first port)
|
||||
srslte_ofdm_rx_sf(&fft[0]);
|
||||
srsran_ofdm_rx_sf(&fft[0]);
|
||||
|
||||
for (int sub_channel_idx = 0; sub_channel_idx < sl_comm_resource_pool.num_sub_channel; sub_channel_idx++) {
|
||||
pscch_prb_start_idx = sub_channel_idx * sl_comm_resource_pool.size_sub_channel;
|
||||
|
@ -432,12 +432,12 @@ int main(int argc, char** argv)
|
|||
// PSCCH Channel estimation
|
||||
pscch_chest_sl_cfg.cyclic_shift = cyclic_shift;
|
||||
pscch_chest_sl_cfg.prb_start_idx = pscch_prb_start_idx;
|
||||
srslte_chest_sl_set_cfg(&pscch_chest, pscch_chest_sl_cfg);
|
||||
srslte_chest_sl_ls_estimate_equalize(&pscch_chest, sf_buffer[0], equalized_sf_buffer);
|
||||
srsran_chest_sl_set_cfg(&pscch_chest, pscch_chest_sl_cfg);
|
||||
srsran_chest_sl_ls_estimate_equalize(&pscch_chest, sf_buffer[0], equalized_sf_buffer);
|
||||
|
||||
if (srslte_pscch_decode(&pscch, equalized_sf_buffer, sci_rx, pscch_prb_start_idx) == SRSLTE_SUCCESS) {
|
||||
if (srslte_sci_format1_unpack(&sci, sci_rx) == SRSLTE_SUCCESS) {
|
||||
srslte_sci_info(&sci, sci_msg, sizeof(sci_msg));
|
||||
if (srsran_pscch_decode(&pscch, equalized_sf_buffer, sci_rx, pscch_prb_start_idx) == SRSRAN_SUCCESS) {
|
||||
if (srsran_sci_format1_unpack(&sci, sci_rx) == SRSRAN_SUCCESS) {
|
||||
srsran_sci_info(&sci, sci_msg, sizeof(sci_msg));
|
||||
fprintf(stdout, "%s", sci_msg);
|
||||
|
||||
num_decoded_sci++;
|
||||
|
@ -452,7 +452,7 @@ int main(int argc, char** argv)
|
|||
// Decode PSSCH
|
||||
uint32_t sub_channel_start_idx = 0;
|
||||
uint32_t L_subCH = 0;
|
||||
srslte_ra_sl_type0_from_riv(
|
||||
srsran_ra_sl_type0_from_riv(
|
||||
sci.riv, sl_comm_resource_pool.num_sub_channel, &L_subCH, &sub_channel_start_idx);
|
||||
|
||||
// 3GPP TS 36.213 Section 14.1.1.4C
|
||||
|
@ -462,11 +462,11 @@ int main(int argc, char** argv)
|
|||
pssch_prb_start_idx + sl_comm_resource_pool.start_prb_sub_channel;
|
||||
|
||||
// make sure PRBs are valid for DFT precoding
|
||||
nof_prb_pssch = srslte_dft_precoding_get_valid_prb(nof_prb_pssch);
|
||||
nof_prb_pssch = srsran_dft_precoding_get_valid_prb(nof_prb_pssch);
|
||||
|
||||
uint32_t N_x_id = 0;
|
||||
for (int j = 0; j < SRSLTE_SCI_CRC_LEN; j++) {
|
||||
N_x_id += pscch.sci_crc[j] * exp2(SRSLTE_SCI_CRC_LEN - 1 - j);
|
||||
for (int j = 0; j < SRSRAN_SCI_CRC_LEN; j++) {
|
||||
N_x_id += pscch.sci_crc[j] * exp2(SRSRAN_SCI_CRC_LEN - 1 - j);
|
||||
}
|
||||
|
||||
uint32_t rv_idx = 0;
|
||||
|
@ -479,17 +479,17 @@ int main(int argc, char** argv)
|
|||
pssch_chest_sl_cfg.sf_idx = current_sf_idx;
|
||||
pssch_chest_sl_cfg.prb_start_idx = pssch_prb_start_idx;
|
||||
pssch_chest_sl_cfg.nof_prb = nof_prb_pssch;
|
||||
srslte_chest_sl_set_cfg(&pssch_chest, pssch_chest_sl_cfg);
|
||||
srslte_chest_sl_ls_estimate_equalize(&pssch_chest, sf_buffer[0], equalized_sf_buffer);
|
||||
srsran_chest_sl_set_cfg(&pssch_chest, pssch_chest_sl_cfg);
|
||||
srsran_chest_sl_ls_estimate_equalize(&pssch_chest, sf_buffer[0], equalized_sf_buffer);
|
||||
|
||||
srslte_pssch_cfg_t pssch_cfg = {
|
||||
srsran_pssch_cfg_t pssch_cfg = {
|
||||
pssch_prb_start_idx, nof_prb_pssch, N_x_id, sci.mcs_idx, rv_idx, current_sf_idx};
|
||||
if (srslte_pssch_set_cfg(&pssch, pssch_cfg) == SRSLTE_SUCCESS) {
|
||||
if (srslte_pssch_decode(&pssch, equalized_sf_buffer, tb, SRSLTE_SL_SCH_MAX_TB_LEN) == SRSLTE_SUCCESS) {
|
||||
if (srsran_pssch_set_cfg(&pssch, pssch_cfg) == SRSRAN_SUCCESS) {
|
||||
if (srsran_pssch_decode(&pssch, equalized_sf_buffer, tb, SRSRAN_SL_SCH_MAX_TB_LEN) == SRSRAN_SUCCESS) {
|
||||
num_decoded_tb++;
|
||||
|
||||
// pack bit sand write to PCAP
|
||||
srslte_bit_pack_vector(tb, packed_tb, pssch.sl_sch_tb_len);
|
||||
srsran_bit_pack_vector(tb, packed_tb, pssch.sl_sch_tb_len);
|
||||
pcap_pack_and_write(pcap_file,
|
||||
packed_tb,
|
||||
pssch.sl_sch_tb_len / 8,
|
||||
|
@ -514,7 +514,7 @@ int main(int argc, char** argv)
|
|||
}
|
||||
}
|
||||
}
|
||||
if (SRSLTE_VERBOSE_ISDEBUG()) {
|
||||
if (SRSRAN_VERBOSE_ISDEBUG()) {
|
||||
char filename[64];
|
||||
snprintf(filename,
|
||||
64,
|
||||
|
@ -522,8 +522,8 @@ int main(int argc, char** argv)
|
|||
subframe_count,
|
||||
cyclic_shift,
|
||||
pscch_prb_start_idx);
|
||||
printf("Saving PSCCH symbols (%d) to %s\n", pscch.E / SRSLTE_PSCCH_QM, filename);
|
||||
srslte_vec_save_file(filename, pscch.mod_symbols, pscch.E / SRSLTE_PSCCH_QM * sizeof(cf_t));
|
||||
printf("Saving PSCCH symbols (%d) to %s\n", pscch.E / SRSRAN_PSCCH_QM, filename);
|
||||
srsran_vec_save_file(filename, pscch.mod_symbols, pscch.E / SRSRAN_PSCCH_QM * sizeof(cf_t));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -553,15 +553,15 @@ clean_exit:
|
|||
#endif
|
||||
|
||||
#ifndef DISABLE_RF
|
||||
srslte_rf_stop_rx_stream(&radio);
|
||||
srslte_rf_close(&radio);
|
||||
srslte_ue_sync_free(&ue_sync);
|
||||
srsran_rf_stop_rx_stream(&radio);
|
||||
srsran_rf_close(&radio);
|
||||
srsran_ue_sync_free(&ue_sync);
|
||||
#endif // DISABLE_RF
|
||||
|
||||
srslte_sci_free(&sci);
|
||||
srslte_pscch_free(&pscch);
|
||||
srslte_chest_sl_free(&pscch_chest);
|
||||
srslte_chest_sl_free(&pssch_chest);
|
||||
srsran_sci_free(&sci);
|
||||
srsran_pscch_free(&pscch);
|
||||
srsran_chest_sl_free(&pscch_chest);
|
||||
srsran_chest_sl_free(&pssch_chest);
|
||||
|
||||
for (int i = 0; i < prog_args.nof_rx_antennas; i++) {
|
||||
if (rx_buffer[i]) {
|
||||
|
@ -570,14 +570,14 @@ clean_exit:
|
|||
if (sf_buffer[i]) {
|
||||
free(sf_buffer[i]);
|
||||
}
|
||||
srslte_ofdm_rx_free(&fft[i]);
|
||||
srsran_ofdm_rx_free(&fft[i]);
|
||||
}
|
||||
|
||||
if (equalized_sf_buffer) {
|
||||
free(equalized_sf_buffer);
|
||||
}
|
||||
|
||||
return SRSLTE_SUCCESS;
|
||||
return SRSRAN_SUCCESS;
|
||||
}
|
||||
|
||||
///< Plotting Functions
|
||||
|
@ -605,7 +605,7 @@ void* plot_thread_run(void* arg)
|
|||
|
||||
while (keep_running) {
|
||||
sem_wait(&plot_sem);
|
||||
plot_scatter_setNewData(&pscatequal_pscch, pscch.mod_symbols, pscch.E / SRSLTE_PSCCH_QM);
|
||||
plot_scatter_setNewData(&pscatequal_pscch, pscch.mod_symbols, pscch.E / SRSRAN_PSCCH_QM);
|
||||
if (pssch.G > 0 && pssch.Qm > 0) {
|
||||
plot_scatter_setNewData(&pscatequal_pssch, pssch.symbols, pssch.G / pssch.Qm);
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
*
|
||||
* \section COPYRIGHT
|
||||
*
|
||||
* Copyright 2013-2020 Software Radio Systems Limited
|
||||
* Copyright 2013-2021 Software Radio Systems Limited
|
||||
*
|
||||
* By using this file, you agree to the terms and conditions set
|
||||
* forth in the LICENSE file which can be found at the top level of
|
||||
|
@ -16,7 +16,7 @@
|
|||
#include <sys/time.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "srslte/srslte.h"
|
||||
#include "srsran/srsran.h"
|
||||
|
||||
char* input_file_name;
|
||||
char* output_file_name = "abs_corr.txt";
|
||||
|
@ -38,7 +38,7 @@ void usage(char* prog)
|
|||
printf("\t-N out_N_id_2 [Default %d]\n", out_N_id_2);
|
||||
printf("\t-f force_N_id_2 [Default %d]\n", force_N_id_2);
|
||||
printf("\t-c force_cfo [Default disabled]\n");
|
||||
printf("\t-v srslte_verbose\n");
|
||||
printf("\t-v srsran_verbose\n");
|
||||
}
|
||||
|
||||
void parse_args(int argc, char** argv)
|
||||
|
@ -74,7 +74,7 @@ void parse_args(int argc, char** argv)
|
|||
force_cfo = strtof(argv[optind], NULL);
|
||||
break;
|
||||
case 'v':
|
||||
srslte_verbose++;
|
||||
srsran_verbose++;
|
||||
break;
|
||||
default:
|
||||
usage(argv[0]);
|
||||
|
@ -89,11 +89,11 @@ void parse_args(int argc, char** argv)
|
|||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
srslte_filesource_t fsrc;
|
||||
srslte_filesink_t fsink;
|
||||
srslte_pss_t pss[3]; // One for each N_id_2
|
||||
srslte_sss_t sss[3]; // One for each N_id_2
|
||||
srslte_cfo_t cfocorr;
|
||||
srsran_filesource_t fsrc;
|
||||
srsran_filesink_t fsink;
|
||||
srsran_pss_t pss[3]; // One for each N_id_2
|
||||
srsran_sss_t sss[3]; // One for each N_id_2
|
||||
srsran_cfo_t cfocorr;
|
||||
int peak_pos[3];
|
||||
float* cfo;
|
||||
float peak_value[3];
|
||||
|
@ -117,32 +117,32 @@ int main(int argc, char** argv)
|
|||
printf("Initializing...");
|
||||
fflush(stdout);
|
||||
|
||||
if (srslte_filesource_init(&fsrc, input_file_name, SRSLTE_COMPLEX_FLOAT_BIN)) {
|
||||
if (srsran_filesource_init(&fsrc, input_file_name, SRSRAN_COMPLEX_FLOAT_BIN)) {
|
||||
ERROR("Error opening file %s", input_file_name);
|
||||
exit(-1);
|
||||
}
|
||||
if (srslte_filesink_init(&fsink, output_file_name, SRSLTE_COMPLEX_FLOAT_BIN)) {
|
||||
if (srsran_filesink_init(&fsink, output_file_name, SRSRAN_COMPLEX_FLOAT_BIN)) {
|
||||
ERROR("Error opening file %s", output_file_name);
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
input = srslte_vec_cf_malloc(frame_length);
|
||||
input = srsran_vec_cf_malloc(frame_length);
|
||||
if (!input) {
|
||||
perror("malloc");
|
||||
exit(-1);
|
||||
}
|
||||
cfo = srslte_vec_f_malloc(nof_frames);
|
||||
cfo = srsran_vec_f_malloc(nof_frames);
|
||||
if (!cfo) {
|
||||
perror("malloc");
|
||||
exit(-1);
|
||||
}
|
||||
exec_time = srslte_vec_i32_malloc(nof_frames);
|
||||
exec_time = srsran_vec_i32_malloc(nof_frames);
|
||||
if (!exec_time) {
|
||||
perror("malloc");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
if (srslte_cfo_init(&cfocorr, frame_length)) {
|
||||
if (srsran_cfo_init(&cfocorr, frame_length)) {
|
||||
ERROR("Error initiating CFO");
|
||||
return -1;
|
||||
}
|
||||
|
@ -153,19 +153,19 @@ int main(int argc, char** argv)
|
|||
* a) requries more memory but has less latency and is paralellizable.
|
||||
*/
|
||||
for (N_id_2 = 0; N_id_2 < 3; N_id_2++) {
|
||||
if (srslte_pss_init_fft(&pss[N_id_2], frame_length, symbol_sz)) {
|
||||
if (srsran_pss_init_fft(&pss[N_id_2], frame_length, symbol_sz)) {
|
||||
ERROR("Error initializing PSS object");
|
||||
exit(-1);
|
||||
}
|
||||
if (srslte_pss_set_N_id_2(&pss[N_id_2], N_id_2)) {
|
||||
if (srsran_pss_set_N_id_2(&pss[N_id_2], N_id_2)) {
|
||||
ERROR("Error initializing N_id_2");
|
||||
exit(-1);
|
||||
}
|
||||
if (srslte_sss_init(&sss[N_id_2], symbol_sz)) {
|
||||
if (srsran_sss_init(&sss[N_id_2], symbol_sz)) {
|
||||
ERROR("Error initializing SSS object");
|
||||
exit(-1);
|
||||
}
|
||||
if (srslte_sss_set_N_id_2(&sss[N_id_2], N_id_2)) {
|
||||
if (srsran_sss_set_N_id_2(&sss[N_id_2], N_id_2)) {
|
||||
ERROR("Error initializing N_id_2");
|
||||
exit(-1);
|
||||
}
|
||||
|
@ -179,18 +179,18 @@ int main(int argc, char** argv)
|
|||
|
||||
/* read all file or nof_frames */
|
||||
frame_cnt = 0;
|
||||
while (frame_length == srslte_filesource_read(&fsrc, input, frame_length) && frame_cnt < nof_frames) {
|
||||
while (frame_length == srsran_filesource_read(&fsrc, input, frame_length) && frame_cnt < nof_frames) {
|
||||
gettimeofday(&tdata[1], NULL);
|
||||
if (force_cfo != CFO_AUTO) {
|
||||
srslte_cfo_correct(&cfocorr, input, input, force_cfo / 128);
|
||||
srsran_cfo_correct(&cfocorr, input, input, force_cfo / 128);
|
||||
}
|
||||
|
||||
if (force_N_id_2 != -1) {
|
||||
N_id_2 = force_N_id_2;
|
||||
peak_pos[N_id_2] = srslte_pss_find_pss(&pss[N_id_2], input, &peak_value[N_id_2]);
|
||||
peak_pos[N_id_2] = srsran_pss_find_pss(&pss[N_id_2], input, &peak_value[N_id_2]);
|
||||
} else {
|
||||
for (N_id_2 = 0; N_id_2 < 3; N_id_2++) {
|
||||
peak_pos[N_id_2] = srslte_pss_find_pss(&pss[N_id_2], input, &peak_value[N_id_2]);
|
||||
peak_pos[N_id_2] = srsran_pss_find_pss(&pss[N_id_2], input, &peak_value[N_id_2]);
|
||||
}
|
||||
float max_value = -99999;
|
||||
N_id_2 = -1;
|
||||
|
@ -205,16 +205,16 @@ int main(int argc, char** argv)
|
|||
|
||||
/* If peak detected */
|
||||
if (peak_value[N_id_2] > corr_peak_threshold) {
|
||||
sss_idx = peak_pos[N_id_2] - 2 * (symbol_sz + SRSLTE_CP_LEN(symbol_sz, SRSLTE_CP_NORM_LEN));
|
||||
sss_idx = peak_pos[N_id_2] - 2 * (symbol_sz + SRSRAN_CP_LEN(symbol_sz, SRSRAN_CP_NORM_LEN));
|
||||
if (sss_idx >= 0) {
|
||||
srslte_sss_m0m1_diff(&sss[N_id_2], &input[sss_idx], &m0, &m0_value, &m1, &m1_value);
|
||||
srsran_sss_m0m1_diff(&sss[N_id_2], &input[sss_idx], &m0, &m0_value, &m1, &m1_value);
|
||||
|
||||
cfo[frame_cnt] = srslte_pss_cfo_compute(&pss[N_id_2], &input[peak_pos[N_id_2] - 128]);
|
||||
cfo[frame_cnt] = srsran_pss_cfo_compute(&pss[N_id_2], &input[peak_pos[N_id_2] - 128]);
|
||||
printf("\t%d\t%d\t%d\t%d\t%.3f\t\t%3d\t%d\t%d\t%.3f\n",
|
||||
frame_cnt,
|
||||
N_id_2,
|
||||
srslte_sss_N_id_1(&sss[N_id_2], m0, m1, m1_value + m0_value),
|
||||
srslte_sss_subframe(m0, m1),
|
||||
srsran_sss_N_id_1(&sss[N_id_2], m0, m1, m1_value + m0_value),
|
||||
srsran_sss_subframe(m0, m1),
|
||||
peak_value[N_id_2],
|
||||
peak_pos[N_id_2],
|
||||
m0,
|
||||
|
@ -247,12 +247,12 @@ int main(int argc, char** argv)
|
|||
printf("Average CFO: %.3f\n", cfo_mean);
|
||||
|
||||
for (N_id_2 = 0; N_id_2 < 3; N_id_2++) {
|
||||
srslte_pss_free(&pss[N_id_2]);
|
||||
srslte_sss_free(&sss[N_id_2]);
|
||||
srsran_pss_free(&pss[N_id_2]);
|
||||
srsran_sss_free(&sss[N_id_2]);
|
||||
}
|
||||
|
||||
srslte_filesource_free(&fsrc);
|
||||
srslte_filesink_free(&fsink);
|
||||
srsran_filesource_free(&fsrc);
|
||||
srsran_filesink_free(&fsink);
|
||||
|
||||
free(input);
|
||||
free(cfo);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#
|
||||
# Copyright 2013-2020 Software Radio Systems Limited
|
||||
# Copyright 2013-2021 Software Radio Systems Limited
|
||||
#
|
||||
# By using this file, you agree to the terms and conditions set
|
||||
# forth in the LICENSE file which can be found at the top level of
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#
|
||||
# Copyright 2013-2020 Software Radio Systems Limited
|
||||
# Copyright 2013-2021 Software Radio Systems Limited
|
||||
#
|
||||
# By using this file, you agree to the terms and conditions set
|
||||
# forth in the LICENSE file which can be found at the top level of
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
*
|
||||
* \section COPYRIGHT
|
||||
*
|
||||
* Copyright 2013-2020 Software Radio Systems Limited
|
||||
* Copyright 2013-2021 Software Radio Systems Limited
|
||||
*
|
||||
* By using this file, you agree to the terms and conditions set
|
||||
* forth in the LICENSE file which can be found at the top level of
|
||||
|
@ -21,9 +21,9 @@
|
|||
|
||||
#include <stdbool.h>
|
||||
|
||||
#include "srslte/phy/io/filesink.h"
|
||||
#include "srslte/phy/rf/rf.h"
|
||||
#include "srslte/srslte.h"
|
||||
#include "srsran/phy/io/filesink.h"
|
||||
#include "srsran/phy/rf/rf.h"
|
||||
#include "srsran/srsran.h"
|
||||
|
||||
static bool keep_running = true;
|
||||
char* output_file_name;
|
||||
|
@ -45,7 +45,7 @@ void usage(char* prog)
|
|||
printf("\t-r RF Rate [Default %.6f Hz]\n", rf_rate);
|
||||
printf("\t-n nof_samples [Default %d]\n", nof_samples);
|
||||
printf("\t-A nof_rx_antennas [Default %d]\n", nof_rx_antennas);
|
||||
printf("\t-v srslte_verbose\n");
|
||||
printf("\t-v srsran_verbose\n");
|
||||
}
|
||||
|
||||
void parse_args(int argc, char** argv)
|
||||
|
@ -75,7 +75,7 @@ void parse_args(int argc, char** argv)
|
|||
nof_rx_antennas = (int)strtol(argv[optind], NULL, 10);
|
||||
break;
|
||||
case 'v':
|
||||
srslte_verbose++;
|
||||
srsran_verbose++;
|
||||
break;
|
||||
default:
|
||||
usage(argv[0]);
|
||||
|
@ -90,10 +90,10 @@ void parse_args(int argc, char** argv)
|
|||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
cf_t* buffer[SRSLTE_MAX_PORTS];
|
||||
cf_t* buffer[SRSRAN_MAX_PORTS];
|
||||
int sample_count, n;
|
||||
srslte_rf_t rf;
|
||||
srslte_filesink_t sink;
|
||||
srsran_rf_t rf;
|
||||
srsran_filesink_t sink;
|
||||
uint32_t buflen;
|
||||
|
||||
signal(SIGINT, int_handler);
|
||||
|
@ -104,17 +104,17 @@ int main(int argc, char** argv)
|
|||
sample_count = 0;
|
||||
|
||||
for (int i = 0; i < nof_rx_antennas; i++) {
|
||||
buffer[i] = srslte_vec_cf_malloc(buflen);
|
||||
buffer[i] = srsran_vec_cf_malloc(buflen);
|
||||
if (!buffer[i]) {
|
||||
perror("malloc");
|
||||
exit(-1);
|
||||
}
|
||||
}
|
||||
|
||||
srslte_filesink_init(&sink, output_file_name, SRSLTE_COMPLEX_FLOAT_BIN);
|
||||
srsran_filesink_init(&sink, output_file_name, SRSRAN_COMPLEX_FLOAT_BIN);
|
||||
|
||||
printf("Opening RF device...");
|
||||
if (srslte_rf_open_multi(&rf, rf_args, nof_rx_antennas)) {
|
||||
if (srsran_rf_open_multi(&rf, rf_args, nof_rx_antennas)) {
|
||||
ERROR("Error opening rf");
|
||||
exit(-1);
|
||||
}
|
||||
|
@ -124,13 +124,13 @@ int main(int argc, char** argv)
|
|||
sigaddset(&sigset, SIGINT);
|
||||
sigprocmask(SIG_UNBLOCK, &sigset, NULL);
|
||||
|
||||
srslte_rf_set_rx_gain(&rf, rf_gain);
|
||||
srslte_rf_set_rx_freq(&rf, nof_rx_antennas, rf_freq);
|
||||
srsran_rf_set_rx_gain(&rf, rf_gain);
|
||||
srsran_rf_set_rx_freq(&rf, nof_rx_antennas, rf_freq);
|
||||
printf("Set RX freq: %.2f MHz\n", rf_freq / 1000000);
|
||||
printf("Set RX gain: %.2f dB\n", rf_gain);
|
||||
float srate = srslte_rf_set_rx_srate(&rf, rf_rate);
|
||||
float srate = srsran_rf_set_rx_srate(&rf, rf_rate);
|
||||
if (srate != rf_rate) {
|
||||
srate = srslte_rf_set_rx_srate(&rf, rf_rate);
|
||||
srate = srsran_rf_set_rx_srate(&rf, rf_rate);
|
||||
if (srate != rf_rate) {
|
||||
ERROR("Error setting samplign frequency %.2f MHz", rf_rate * 1e-6);
|
||||
exit(-1);
|
||||
|
@ -138,16 +138,16 @@ int main(int argc, char** argv)
|
|||
}
|
||||
|
||||
printf("Correctly RX rate: %.2f MHz\n", srate * 1e-6);
|
||||
srslte_rf_start_rx_stream(&rf, false);
|
||||
srsran_rf_start_rx_stream(&rf, false);
|
||||
|
||||
while ((sample_count < nof_samples || nof_samples == -1) && keep_running) {
|
||||
n = srslte_rf_recv_with_time_multi(&rf, (void**)buffer, buflen, true, NULL, NULL);
|
||||
n = srsran_rf_recv_with_time_multi(&rf, (void**)buffer, buflen, true, NULL, NULL);
|
||||
if (n < 0) {
|
||||
ERROR("Error receiving samples");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
srslte_filesink_write_multi(&sink, (void**)buffer, buflen, nof_rx_antennas);
|
||||
srsran_filesink_write_multi(&sink, (void**)buffer, buflen, nof_rx_antennas);
|
||||
sample_count += buflen;
|
||||
}
|
||||
|
||||
|
@ -157,8 +157,8 @@ int main(int argc, char** argv)
|
|||
}
|
||||
}
|
||||
|
||||
srslte_filesink_free(&sink);
|
||||
srslte_rf_close(&rf);
|
||||
srsran_filesink_free(&sink);
|
||||
srsran_rf_close(&rf);
|
||||
|
||||
printf("Ok - wrote %d samples\n", sample_count);
|
||||
exit(0);
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
*
|
||||
* \section COPYRIGHT
|
||||
*
|
||||
* Copyright 2013-2020 Software Radio Systems Limited
|
||||
* Copyright 2013-2021 Software Radio Systems Limited
|
||||
*
|
||||
* By using this file, you agree to the terms and conditions set
|
||||
* forth in the LICENSE file which can be found at the top level of
|
||||
|
@ -21,8 +21,8 @@
|
|||
|
||||
#include <stdbool.h>
|
||||
|
||||
#include "srslte/phy/rf/rf.h"
|
||||
#include "srslte/srslte.h"
|
||||
#include "srsran/phy/rf/rf.h"
|
||||
#include "srsran/srsran.h"
|
||||
|
||||
static bool keep_running = true;
|
||||
char* output_file_name = NULL;
|
||||
|
@ -34,7 +34,7 @@ int nof_subframes = -1;
|
|||
int N_id_2 = -1;
|
||||
uint32_t nof_rx_antennas = 1;
|
||||
bool use_standard_lte_rates = false;
|
||||
srslte_ue_sync_mode_t sync_mode = SYNC_MODE_PSS;
|
||||
srsran_ue_sync_mode_t sync_mode = SYNC_MODE_PSS;
|
||||
|
||||
void int_handler(int dummy)
|
||||
{
|
||||
|
@ -96,7 +96,7 @@ void parse_args(int argc, char** argv)
|
|||
nof_rx_antennas = (uint32_t)strtol(argv[optind], NULL, 10);
|
||||
break;
|
||||
case 'v':
|
||||
srslte_verbose++;
|
||||
srsran_verbose++;
|
||||
break;
|
||||
default:
|
||||
usage(argv[0]);
|
||||
|
@ -109,42 +109,42 @@ void parse_args(int argc, char** argv)
|
|||
}
|
||||
}
|
||||
|
||||
int srslte_rf_recv_wrapper(void* h, cf_t* data[SRSLTE_MAX_PORTS], uint32_t nsamples, srslte_timestamp_t* t)
|
||||
int srsran_rf_recv_wrapper(void* h, cf_t* data[SRSRAN_MAX_PORTS], uint32_t nsamples, srsran_timestamp_t* t)
|
||||
{
|
||||
DEBUG(" ---- Receive %d samples ----", nsamples);
|
||||
void* ptr[SRSLTE_MAX_PORTS];
|
||||
for (int i = 0; i < SRSLTE_MAX_PORTS; i++) {
|
||||
void* ptr[SRSRAN_MAX_PORTS];
|
||||
for (int i = 0; i < SRSRAN_MAX_PORTS; i++) {
|
||||
ptr[i] = data[i];
|
||||
}
|
||||
return srslte_rf_recv_with_time_multi(h, ptr, nsamples, true, &t->full_secs, &t->frac_secs);
|
||||
return srsran_rf_recv_with_time_multi(h, ptr, nsamples, true, &t->full_secs, &t->frac_secs);
|
||||
}
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
cf_t* buffer[SRSLTE_MAX_CHANNELS] = {NULL};
|
||||
cf_t* buffer[SRSRAN_MAX_CHANNELS] = {NULL};
|
||||
int n = 0;
|
||||
srslte_rf_t rf = {};
|
||||
srslte_filesink_t sink = {};
|
||||
srslte_ue_sync_t ue_sync = {};
|
||||
srslte_cell_t cell = {};
|
||||
srsran_rf_t rf = {};
|
||||
srsran_filesink_t sink = {};
|
||||
srsran_ue_sync_t ue_sync = {};
|
||||
srsran_cell_t cell = {};
|
||||
|
||||
signal(SIGINT, int_handler);
|
||||
|
||||
parse_args(argc, argv);
|
||||
|
||||
srslte_use_standard_symbol_size(use_standard_lte_rates);
|
||||
srsran_use_standard_symbol_size(use_standard_lte_rates);
|
||||
|
||||
srslte_filesink_init(&sink, output_file_name, SRSLTE_COMPLEX_FLOAT_BIN);
|
||||
srsran_filesink_init(&sink, output_file_name, SRSRAN_COMPLEX_FLOAT_BIN);
|
||||
|
||||
printf("Opening RF device...\n");
|
||||
if (srslte_rf_open_multi(&rf, rf_args, nof_rx_antennas)) {
|
||||
if (srsran_rf_open_multi(&rf, rf_args, nof_rx_antennas)) {
|
||||
ERROR("Error opening rf");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
uint32_t max_num_samples = 3 * SRSLTE_SF_LEN_MAX;
|
||||
uint32_t max_num_samples = 3 * SRSRAN_SF_LEN_MAX;
|
||||
for (int i = 0; i < nof_rx_antennas; i++) {
|
||||
buffer[i] = srslte_vec_cf_malloc(max_num_samples);
|
||||
buffer[i] = srsran_vec_cf_malloc(max_num_samples);
|
||||
}
|
||||
|
||||
sigset_t sigset;
|
||||
|
@ -152,13 +152,13 @@ int main(int argc, char** argv)
|
|||
sigaddset(&sigset, SIGINT);
|
||||
sigprocmask(SIG_UNBLOCK, &sigset, NULL);
|
||||
|
||||
srslte_rf_set_rx_gain(&rf, rf_gain);
|
||||
printf("Set RX freq: %.6f MHz\n", srslte_rf_set_rx_freq(&rf, nof_rx_antennas, rf_freq) / 1000000);
|
||||
printf("Set RX gain: %.1f dB\n", srslte_rf_get_rx_gain(&rf));
|
||||
int srate = srslte_sampling_freq_hz(nof_prb);
|
||||
srsran_rf_set_rx_gain(&rf, rf_gain);
|
||||
printf("Set RX freq: %.6f MHz\n", srsran_rf_set_rx_freq(&rf, nof_rx_antennas, rf_freq) / 1000000);
|
||||
printf("Set RX gain: %.1f dB\n", srsran_rf_get_rx_gain(&rf));
|
||||
int srate = srsran_sampling_freq_hz(nof_prb);
|
||||
if (srate != -1) {
|
||||
printf("Setting sampling rate %.2f MHz\n", (float)srate / 1000000);
|
||||
float srate_rf = srslte_rf_set_rx_srate(&rf, (double)srate);
|
||||
float srate_rf = srsran_rf_set_rx_srate(&rf, (double)srate);
|
||||
if (srate_rf != srate) {
|
||||
ERROR("Could not set sampling rate");
|
||||
exit(-1);
|
||||
|
@ -167,19 +167,19 @@ int main(int argc, char** argv)
|
|||
ERROR("Invalid number of PRB %d", nof_prb);
|
||||
exit(-1);
|
||||
}
|
||||
srslte_rf_start_rx_stream(&rf, false);
|
||||
srsran_rf_start_rx_stream(&rf, false);
|
||||
|
||||
cell.cp = SRSLTE_CP_NORM;
|
||||
cell.cp = SRSRAN_CP_NORM;
|
||||
cell.id = N_id_2;
|
||||
cell.nof_prb = nof_prb;
|
||||
cell.nof_ports = 1;
|
||||
|
||||
if (srslte_ue_sync_init_multi_decim_mode(
|
||||
&ue_sync, cell.nof_prb, cell.id == 1000, srslte_rf_recv_wrapper, nof_rx_antennas, (void*)&rf, 1, sync_mode)) {
|
||||
if (srsran_ue_sync_init_multi_decim_mode(
|
||||
&ue_sync, cell.nof_prb, cell.id == 1000, srsran_rf_recv_wrapper, nof_rx_antennas, (void*)&rf, 1, sync_mode)) {
|
||||
fprintf(stderr, "Error initiating ue_sync\n");
|
||||
exit(-1);
|
||||
}
|
||||
if (srslte_ue_sync_set_cell(&ue_sync, cell)) {
|
||||
if (srsran_ue_sync_set_cell(&ue_sync, cell)) {
|
||||
ERROR("Error initiating ue_sync");
|
||||
exit(-1);
|
||||
}
|
||||
|
@ -187,39 +187,39 @@ int main(int argc, char** argv)
|
|||
uint32_t subframe_count = 0;
|
||||
bool start_capture = false;
|
||||
bool stop_capture = false;
|
||||
srslte_timestamp_t ts_rx_start = {};
|
||||
srsran_timestamp_t ts_rx_start = {};
|
||||
while ((subframe_count < nof_subframes || nof_subframes == -1) && !stop_capture) {
|
||||
n = srslte_ue_sync_zerocopy(&ue_sync, buffer, max_num_samples);
|
||||
n = srsran_ue_sync_zerocopy(&ue_sync, buffer, max_num_samples);
|
||||
if (n < 0) {
|
||||
ERROR("Error receiving samples");
|
||||
exit(-1);
|
||||
}
|
||||
if (n == 1) {
|
||||
if (!start_capture) {
|
||||
if (srslte_ue_sync_get_sfidx(&ue_sync) == 9) {
|
||||
if (srsran_ue_sync_get_sfidx(&ue_sync) == 9) {
|
||||
start_capture = true;
|
||||
}
|
||||
} else {
|
||||
printf("Writing to file %6d subframes...\r", subframe_count);
|
||||
srslte_filesink_write_multi(&sink, (void**)buffer, SRSLTE_SF_LEN_PRB(nof_prb), nof_rx_antennas);
|
||||
srsran_filesink_write_multi(&sink, (void**)buffer, SRSRAN_SF_LEN_PRB(nof_prb), nof_rx_antennas);
|
||||
|
||||
// store time stamp of first subframe
|
||||
if (subframe_count == 0) {
|
||||
srslte_ue_sync_get_last_timestamp(&ue_sync, &ts_rx_start);
|
||||
srsran_ue_sync_get_last_timestamp(&ue_sync, &ts_rx_start);
|
||||
}
|
||||
subframe_count++;
|
||||
}
|
||||
}
|
||||
if (!keep_running) {
|
||||
if (!start_capture || (start_capture && srslte_ue_sync_get_sfidx(&ue_sync) == 9)) {
|
||||
if (!start_capture || (start_capture && srsran_ue_sync_get_sfidx(&ue_sync) == 9)) {
|
||||
stop_capture = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
srslte_filesink_free(&sink);
|
||||
srslte_rf_close(&rf);
|
||||
srslte_ue_sync_free(&ue_sync);
|
||||
srsran_filesink_free(&sink);
|
||||
srsran_rf_close(&rf);
|
||||
srsran_ue_sync_free(&ue_sync);
|
||||
|
||||
for (int i = 0; i < nof_rx_antennas; i++) {
|
||||
if (buffer[i]) {
|
||||
|
@ -229,12 +229,12 @@ int main(int argc, char** argv)
|
|||
|
||||
printf("\nOk - wrote %d subframes\n", subframe_count);
|
||||
|
||||
srslte_ue_sync_set_tti_from_timestamp(&ue_sync, &ts_rx_start);
|
||||
srsran_ue_sync_set_tti_from_timestamp(&ue_sync, &ts_rx_start);
|
||||
printf("Start of capture at %ld+%.3f. TTI=%d.%d\n",
|
||||
ts_rx_start.full_secs,
|
||||
ts_rx_start.frac_secs,
|
||||
srslte_ue_sync_get_sfn(&ue_sync),
|
||||
srslte_ue_sync_get_sfidx(&ue_sync));
|
||||
srsran_ue_sync_get_sfn(&ue_sync),
|
||||
srsran_ue_sync_get_sfidx(&ue_sync));
|
||||
|
||||
return SRSLTE_SUCCESS;
|
||||
return SRSRAN_SUCCESS;
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
*
|
||||
* \section COPYRIGHT
|
||||
*
|
||||
* Copyright 2013-2020 Software Radio Systems Limited
|
||||
* Copyright 2013-2021 Software Radio Systems Limited
|
||||
*
|
||||
* By using this file, you agree to the terms and conditions set
|
||||
* forth in the LICENSE file which can be found at the top level of
|
||||
|
@ -20,11 +20,11 @@
|
|||
#include <time.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "srslte/phy/io/filesink.h"
|
||||
#include "srslte/phy/rf/rf.h"
|
||||
#include "srslte/phy/ue/ue_mib_nbiot.h"
|
||||
#include "srslte/phy/ue/ue_sync_nbiot.h"
|
||||
#include "srslte/phy/utils/debug.h"
|
||||
#include "srsran/phy/io/filesink.h"
|
||||
#include "srsran/phy/rf/rf.h"
|
||||
#include "srsran/phy/ue/ue_mib_nbiot.h"
|
||||
#include "srsran/phy/ue/ue_sync_nbiot.h"
|
||||
#include "srsran/phy/utils/debug.h"
|
||||
|
||||
static bool keep_running = true;
|
||||
char* output_file_name = NULL;
|
||||
|
@ -68,7 +68,7 @@ void parse_args(int argc, char** argv)
|
|||
nof_subframes = (int)strtol(argv[optind], NULL, 10);
|
||||
break;
|
||||
case 'v':
|
||||
srslte_verbose++;
|
||||
srsran_verbose++;
|
||||
break;
|
||||
default:
|
||||
usage(argv[0]);
|
||||
|
@ -81,10 +81,10 @@ void parse_args(int argc, char** argv)
|
|||
}
|
||||
}
|
||||
|
||||
int srslte_rf_recv_wrapper(void* h, void* data, uint32_t nsamples, srslte_timestamp_t* t)
|
||||
int srsran_rf_recv_wrapper(void* h, void* data, uint32_t nsamples, srsran_timestamp_t* t)
|
||||
{
|
||||
DEBUG(" ---- Receive %d samples ----", nsamples);
|
||||
return srslte_rf_recv(h, data, nsamples, 1);
|
||||
return srsran_rf_recv(h, data, nsamples, 1);
|
||||
}
|
||||
|
||||
int main(int argc, char** argv)
|
||||
|
@ -93,12 +93,12 @@ int main(int argc, char** argv)
|
|||
|
||||
parse_args(argc, argv);
|
||||
|
||||
srslte_filesink_t sink;
|
||||
srslte_filesink_init(&sink, output_file_name, SRSLTE_COMPLEX_FLOAT_BIN);
|
||||
srsran_filesink_t sink;
|
||||
srsran_filesink_init(&sink, output_file_name, SRSRAN_COMPLEX_FLOAT_BIN);
|
||||
|
||||
printf("Opening RF device...\n");
|
||||
srslte_rf_t rf;
|
||||
if (srslte_rf_open(&rf, rf_args)) {
|
||||
srsran_rf_t rf;
|
||||
if (srsran_rf_open(&rf, rf_args)) {
|
||||
fprintf(stderr, "Error opening rf\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
@ -108,30 +108,30 @@ int main(int argc, char** argv)
|
|||
sigaddset(&sigset, SIGINT);
|
||||
sigprocmask(SIG_UNBLOCK, &sigset, NULL);
|
||||
|
||||
srslte_rf_set_rx_gain(&rf, rf_gain);
|
||||
printf("Set RX freq: %.6f MHz\n", srslte_rf_set_rx_freq(&rf, 0, rf_freq) / 1000000);
|
||||
printf("Set RX gain: %.1f dB\n", srslte_rf_get_rx_gain(&rf));
|
||||
int srate = srslte_sampling_freq_hz(nof_prb);
|
||||
srsran_rf_set_rx_gain(&rf, rf_gain);
|
||||
printf("Set RX freq: %.6f MHz\n", srsran_rf_set_rx_freq(&rf, 0, rf_freq) / 1000000);
|
||||
printf("Set RX gain: %.1f dB\n", srsran_rf_get_rx_gain(&rf));
|
||||
int srate = srsran_sampling_freq_hz(nof_prb);
|
||||
if (srate != -1) {
|
||||
printf("Setting sampling rate %.2f MHz\n", (float)srate / 1e6);
|
||||
double srate_rf = srslte_rf_set_rx_srate(&rf, srate);
|
||||
double srate_rf = srsran_rf_set_rx_srate(&rf, srate);
|
||||
printf("Actual sampling rate %.2f MHz\n", srate_rf / 1e6);
|
||||
// We don't check the result rate with requested rate
|
||||
} else {
|
||||
fprintf(stderr, "Invalid number of PRB %d\n", nof_prb);
|
||||
exit(-1);
|
||||
}
|
||||
srslte_rf_start_rx_stream(&rf, false);
|
||||
srsran_rf_start_rx_stream(&rf, false);
|
||||
|
||||
srslte_nbiot_cell_t cell = {};
|
||||
srsran_nbiot_cell_t cell = {};
|
||||
cell.base.nof_prb = nof_prb;
|
||||
cell.base.nof_ports = 1;
|
||||
|
||||
cf_t* buff_ptrs[SRSLTE_MAX_PORTS] = {NULL, NULL, NULL, NULL};
|
||||
buff_ptrs[0] = srslte_vec_cf_malloc(SRSLTE_SF_LEN_PRB_NBIOT * 10);
|
||||
cf_t* buff_ptrs[SRSRAN_MAX_PORTS] = {NULL, NULL, NULL, NULL};
|
||||
buff_ptrs[0] = srsran_vec_cf_malloc(SRSRAN_SF_LEN_PRB_NBIOT * 10);
|
||||
|
||||
srslte_nbiot_ue_sync_t ue_sync;
|
||||
if (srslte_ue_sync_nbiot_init(&ue_sync, cell, srslte_rf_recv_wrapper, (void*)&rf)) {
|
||||
srsran_nbiot_ue_sync_t ue_sync;
|
||||
if (srsran_ue_sync_nbiot_init(&ue_sync, cell, srsran_rf_recv_wrapper, (void*)&rf)) {
|
||||
fprintf(stderr, "Error initiating ue_sync\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
@ -141,7 +141,7 @@ int main(int argc, char** argv)
|
|||
bool start_capture = false;
|
||||
bool stop_capture = false;
|
||||
while ((subframe_count < nof_subframes || nof_subframes == -1) && !stop_capture) {
|
||||
int n = srslte_ue_sync_nbiot_zerocopy_multi(&ue_sync, buff_ptrs);
|
||||
int n = srsran_ue_sync_nbiot_zerocopy_multi(&ue_sync, buff_ptrs);
|
||||
if (n < 0) {
|
||||
fprintf(stderr, "Error receiving samples\n");
|
||||
exit(-1);
|
||||
|
@ -150,7 +150,7 @@ int main(int argc, char** argv)
|
|||
if (n == 1) {
|
||||
if (!start_capture) {
|
||||
if (nof_warmup_subframes <= 0) {
|
||||
if (srslte_ue_sync_nbiot_get_sfidx(&ue_sync) == 9) {
|
||||
if (srsran_ue_sync_nbiot_get_sfidx(&ue_sync) == 9) {
|
||||
printf("Starting capture ..\n");
|
||||
start_capture = true;
|
||||
}
|
||||
|
@ -158,25 +158,25 @@ int main(int argc, char** argv)
|
|||
nof_warmup_subframes--;
|
||||
} else {
|
||||
printf("Writing subframe %d (%d/%d) to file (cfo=%6.2f kHz)\n",
|
||||
srslte_ue_sync_nbiot_get_sfidx(&ue_sync),
|
||||
srsran_ue_sync_nbiot_get_sfidx(&ue_sync),
|
||||
subframe_count,
|
||||
nof_subframes,
|
||||
srslte_ue_sync_nbiot_get_cfo(&ue_sync) / 1000);
|
||||
srslte_filesink_write(&sink, buff_ptrs[0], SRSLTE_SF_LEN_PRB(nof_prb));
|
||||
srsran_ue_sync_nbiot_get_cfo(&ue_sync) / 1000);
|
||||
srsran_filesink_write(&sink, buff_ptrs[0], SRSRAN_SF_LEN_PRB(nof_prb));
|
||||
subframe_count++;
|
||||
}
|
||||
}
|
||||
if (!keep_running) {
|
||||
if (!start_capture || (start_capture && srslte_ue_sync_nbiot_get_sfidx(&ue_sync) == 9)) {
|
||||
if (!start_capture || (start_capture && srsran_ue_sync_nbiot_get_sfidx(&ue_sync) == 9)) {
|
||||
printf("Stopping capture ..\n");
|
||||
stop_capture = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
srslte_filesink_free(&sink);
|
||||
srslte_rf_close(&rf);
|
||||
srslte_ue_sync_nbiot_free(&ue_sync);
|
||||
srsran_filesink_free(&sink);
|
||||
srsran_rf_close(&rf);
|
||||
srsran_ue_sync_nbiot_free(&ue_sync);
|
||||
|
||||
printf("Ok - wrote %d subframes\n", subframe_count);
|
||||
exit(0);
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
*
|
||||
* \section COPYRIGHT
|
||||
*
|
||||
* Copyright 2013-2020 Software Radio Systems Limited
|
||||
* Copyright 2013-2021 Software Radio Systems Limited
|
||||
*
|
||||
* By using this file, you agree to the terms and conditions set
|
||||
* forth in the LICENSE file which can be found at the top level of
|
||||
|
@ -18,15 +18,15 @@
|
|||
#include <time.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "srslte/phy/rf/rf.h"
|
||||
#include "srslte/srslte.h"
|
||||
#include "srsran/phy/rf/rf.h"
|
||||
#include "srsran/srsran.h"
|
||||
|
||||
uint32_t nof_prb = 25;
|
||||
uint32_t nof_frames = 20;
|
||||
|
||||
int time_adv_samples = 0;
|
||||
float tone_offset_hz = 1e6;
|
||||
float rf_rx_gain = 40, srslte_rf_tx_gain = 40, rf_freq = 2.4e9;
|
||||
float rf_rx_gain = 40, srsran_rf_tx_gain = 40, rf_freq = 2.4e9;
|
||||
char* rf_args = "";
|
||||
char* output_filename = NULL;
|
||||
char* input_filename = NULL;
|
||||
|
@ -37,7 +37,7 @@ void usage(char* prog)
|
|||
printf("\t-a RF args [Default %s]\n", rf_args);
|
||||
printf("\t-f RF TX/RX frequency [Default %.2f MHz]\n", rf_freq / 1e6);
|
||||
printf("\t-g RF RX gain [Default %.1f dB]\n", rf_rx_gain);
|
||||
printf("\t-G RF TX gain [Default %.1f dB]\n", srslte_rf_tx_gain);
|
||||
printf("\t-G RF TX gain [Default %.1f dB]\n", srsran_rf_tx_gain);
|
||||
printf("\t-t Single tone offset (Hz) [Default %f]\n", tone_offset_hz);
|
||||
printf("\t-T Time advance samples [Default %d]\n", time_adv_samples);
|
||||
printf("\t-i File name to read signal from [Default single tone]\n");
|
||||
|
@ -71,11 +71,11 @@ void parse_args(int argc, char** argv)
|
|||
rf_rx_gain = strtof(argv[optind], NULL);
|
||||
break;
|
||||
case 'G':
|
||||
srslte_rf_tx_gain = strtof(argv[optind], NULL);
|
||||
srsran_rf_tx_gain = strtof(argv[optind], NULL);
|
||||
break;
|
||||
case 'p':
|
||||
nof_prb = (uint32_t)strtol(argv[optind], NULL, 10);
|
||||
if (!srslte_nofprb_isvalid(nof_prb)) {
|
||||
if (!srsran_nofprb_isvalid(nof_prb)) {
|
||||
ERROR("Invalid number of UL RB %d", nof_prb);
|
||||
exit(-1);
|
||||
}
|
||||
|
@ -100,82 +100,82 @@ int main(int argc, char** argv)
|
|||
{
|
||||
parse_args(argc, argv);
|
||||
|
||||
uint32_t flen = srslte_sampling_freq_hz(nof_prb) / 1000;
|
||||
uint32_t flen = srsran_sampling_freq_hz(nof_prb) / 1000;
|
||||
|
||||
cf_t* rx_buffer = srslte_vec_cf_malloc(flen * nof_frames);
|
||||
cf_t* rx_buffer = srsran_vec_cf_malloc(flen * nof_frames);
|
||||
if (!rx_buffer) {
|
||||
perror("malloc");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
cf_t* tx_buffer = srslte_vec_cf_malloc((flen + time_adv_samples));
|
||||
cf_t* tx_buffer = srsran_vec_cf_malloc((flen + time_adv_samples));
|
||||
if (!tx_buffer) {
|
||||
perror("malloc");
|
||||
exit(-1);
|
||||
}
|
||||
srslte_vec_cf_zero(tx_buffer, flen + time_adv_samples);
|
||||
srsran_vec_cf_zero(tx_buffer, flen + time_adv_samples);
|
||||
|
||||
cf_t* zeros = srslte_vec_cf_malloc(flen);
|
||||
cf_t* zeros = srsran_vec_cf_malloc(flen);
|
||||
if (!zeros) {
|
||||
perror("calloc");
|
||||
exit(-1);
|
||||
}
|
||||
srslte_vec_cf_zero(zeros, flen);
|
||||
srsran_vec_cf_zero(zeros, flen);
|
||||
|
||||
float time_adv_sec = (float)time_adv_samples / srslte_sampling_freq_hz(nof_prb);
|
||||
float time_adv_sec = (float)time_adv_samples / srsran_sampling_freq_hz(nof_prb);
|
||||
|
||||
// Send through RF
|
||||
srslte_rf_t rf;
|
||||
srsran_rf_t rf;
|
||||
printf("Opening RF device...\n");
|
||||
if (srslte_rf_open(&rf, rf_args)) {
|
||||
if (srsran_rf_open(&rf, rf_args)) {
|
||||
ERROR("Error opening rf");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
int srate = srslte_sampling_freq_hz(nof_prb);
|
||||
srslte_rf_set_rx_srate(&rf, (double)srate);
|
||||
srslte_rf_set_tx_srate(&rf, (double)srate);
|
||||
int srate = srsran_sampling_freq_hz(nof_prb);
|
||||
srsran_rf_set_rx_srate(&rf, (double)srate);
|
||||
srsran_rf_set_tx_srate(&rf, (double)srate);
|
||||
|
||||
srslte_rf_set_rx_gain(&rf, rf_rx_gain);
|
||||
srslte_rf_set_tx_gain(&rf, srslte_rf_tx_gain);
|
||||
srslte_rf_set_rx_freq(&rf, 0, rf_freq);
|
||||
srsran_rf_set_rx_gain(&rf, rf_rx_gain);
|
||||
srsran_rf_set_tx_gain(&rf, srsran_rf_tx_gain);
|
||||
srsran_rf_set_rx_freq(&rf, 0, rf_freq);
|
||||
|
||||
printf("Subframe len: %d samples\n", flen);
|
||||
printf("Time advance: %f us\n", time_adv_sec * 1e6);
|
||||
printf("Set TX/RX rate: %.2f MHz\n", (float)srate / 1000000);
|
||||
printf("Set RX gain: %.1f dB\n", rf_rx_gain);
|
||||
printf("Set TX gain: %.1f dB\n", srslte_rf_tx_gain);
|
||||
printf("Set TX gain: %.1f dB\n", srsran_rf_tx_gain);
|
||||
printf("Set TX/RX freq: %.2f MHz\n", rf_freq / 1000000);
|
||||
srslte_rf_set_tx_freq(&rf, 0, rf_freq);
|
||||
srsran_rf_set_tx_freq(&rf, 0, rf_freq);
|
||||
|
||||
sleep(1);
|
||||
|
||||
if (input_filename) {
|
||||
srslte_vec_load_file(input_filename, &tx_buffer[time_adv_samples], flen * sizeof(cf_t));
|
||||
srsran_vec_load_file(input_filename, &tx_buffer[time_adv_samples], flen * sizeof(cf_t));
|
||||
} else {
|
||||
for (int i = 0; i < flen - time_adv_samples; i++) {
|
||||
tx_buffer[i + time_adv_samples] = 0.3 * cexpf(_Complex_I * 2 * M_PI * tone_offset_hz * ((float)i / (float)srate));
|
||||
}
|
||||
srslte_vec_save_file("srslte_rf_txrx_tone", tx_buffer, flen * sizeof(cf_t));
|
||||
srsran_vec_save_file("srsran_rf_txrx_tone", tx_buffer, flen * sizeof(cf_t));
|
||||
}
|
||||
|
||||
srslte_timestamp_t tstamp;
|
||||
srsran_timestamp_t tstamp;
|
||||
|
||||
srslte_rf_start_rx_stream(&rf, false);
|
||||
srsran_rf_start_rx_stream(&rf, false);
|
||||
uint32_t nframe = 0;
|
||||
|
||||
while (nframe < nof_frames) {
|
||||
printf("Rx subframe %d\n", nframe);
|
||||
srslte_rf_recv_with_time(&rf, &rx_buffer[flen * nframe], flen, true, &tstamp.full_secs, &tstamp.frac_secs);
|
||||
srsran_rf_recv_with_time(&rf, &rx_buffer[flen * nframe], flen, true, &tstamp.full_secs, &tstamp.frac_secs);
|
||||
nframe++;
|
||||
if (nframe == 9) {
|
||||
srslte_timestamp_add(&tstamp, 0, 2e-3 - time_adv_sec);
|
||||
srslte_rf_send_timed2(&rf, tx_buffer, flen + time_adv_samples, tstamp.full_secs, tstamp.frac_secs, true, true);
|
||||
srsran_timestamp_add(&tstamp, 0, 2e-3 - time_adv_sec);
|
||||
srsran_rf_send_timed2(&rf, tx_buffer, flen + time_adv_samples, tstamp.full_secs, tstamp.frac_secs, true, true);
|
||||
printf("Transmitting Signal\n");
|
||||
}
|
||||
}
|
||||
|
||||
srslte_vec_save_file(output_filename, &rx_buffer[10 * flen], flen * sizeof(cf_t));
|
||||
srsran_vec_save_file(output_filename, &rx_buffer[10 * flen], flen * sizeof(cf_t));
|
||||
|
||||
free(tx_buffer);
|
||||
free(rx_buffer);
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
*
|
||||
* \section COPYRIGHT
|
||||
*
|
||||
* Copyright 2013-2020 Software Radio Systems Limited
|
||||
* Copyright 2013-2021 Software Radio Systems Limited
|
||||
*
|
||||
* By using this file, you agree to the terms and conditions set
|
||||
* forth in the LICENSE file which can be found at the top level of
|
||||
|
@ -22,8 +22,8 @@
|
|||
|
||||
#include <stdbool.h>
|
||||
|
||||
#include "srslte/phy/rf/rf.h"
|
||||
#include "srslte/srslte.h"
|
||||
#include "srsran/phy/rf/rf.h"
|
||||
#include "srsran/srsran.h"
|
||||
|
||||
static bool keep_running = true;
|
||||
static uint32_t nof_rx_antennas = 1;
|
||||
|
@ -99,7 +99,7 @@ int main(int argc, char** argv)
|
|||
// Initializes memory for input buffer
|
||||
bzero(buffer, sizeof(void*) * max_rx_antennas);
|
||||
for (int i = 0; i < nof_rx_antennas; i++) {
|
||||
buffer[i] = srslte_vec_cf_malloc(buflen);
|
||||
buffer[i] = srsran_vec_cf_malloc(buflen);
|
||||
if (!buffer[i]) {
|
||||
perror("malloc");
|
||||
exit(-1);
|
||||
|
@ -114,7 +114,7 @@ int main(int argc, char** argv)
|
|||
ERROR("Error receiving samples");
|
||||
exit(-1);
|
||||
}
|
||||
if (srslte_verbose == SRSLTE_VERBOSE_INFO) {
|
||||
if (srsran_verbose == SRSRAN_VERBOSE_INFO) {
|
||||
printf("Received %d samples from radio\n", n);
|
||||
}
|
||||
|
||||
|
@ -127,7 +127,7 @@ int main(int argc, char** argv)
|
|||
print_cnt = 0;
|
||||
}
|
||||
} else {
|
||||
if (srslte_verbose == SRSLTE_VERBOSE_INFO) {
|
||||
if (srsran_verbose == SRSRAN_VERBOSE_INFO) {
|
||||
printf("Transmitted %d bytes to ZMQ\n", n);
|
||||
}
|
||||
}
|
||||
|
@ -145,27 +145,27 @@ int main(int argc, char** argv)
|
|||
exit(0);
|
||||
}
|
||||
|
||||
/* Example function to initialize the Radio frontend. In this case, we use srsLTE RF API to open a device,
|
||||
/* Example function to initialize the Radio frontend. In this case, we use srsRAN RF API to open a device,
|
||||
* which automatically picks UHD, bladeRF, limeSDR, etc.
|
||||
*/
|
||||
static srslte_rf_t radio = {};
|
||||
static srsran_rf_t radio = {};
|
||||
static char* rf_args = "fastpath";
|
||||
static float rf_gain = 40.0, rf_freq = -1.0, rf_rate = 11.52e6;
|
||||
static uint32_t rf_recv_frame_size_ms = 1;
|
||||
static int init_radio(uint32_t* buffer_len)
|
||||
{
|
||||
// Uses srsLTE RF API to open a device, could use other code here
|
||||
// Uses srsRAN RF API to open a device, could use other code here
|
||||
printf("Opening RF device...\n");
|
||||
if (srslte_rf_open_multi(&radio, rf_args, nof_rx_antennas)) {
|
||||
if (srsran_rf_open_multi(&radio, rf_args, nof_rx_antennas)) {
|
||||
ERROR("Error opening rf");
|
||||
return -1;
|
||||
}
|
||||
srslte_rf_set_rx_gain(&radio, rf_gain);
|
||||
srslte_rf_set_rx_freq(&radio, nof_rx_antennas, rf_freq);
|
||||
srsran_rf_set_rx_gain(&radio, rf_gain);
|
||||
srsran_rf_set_rx_freq(&radio, nof_rx_antennas, rf_freq);
|
||||
|
||||
printf("Set RX freq: %.2f MHz\n", rf_freq / 1000000);
|
||||
printf("Set RX gain: %.2f dB\n", rf_gain);
|
||||
float srate = srslte_rf_set_rx_srate(&radio, rf_rate);
|
||||
float srate = srsran_rf_set_rx_srate(&radio, rf_rate);
|
||||
if (srate != rf_rate) {
|
||||
ERROR("Error setting samplign frequency %.2f MHz", rf_rate * 1e-6);
|
||||
return -1;
|
||||
|
@ -176,20 +176,20 @@ static int init_radio(uint32_t* buffer_len)
|
|||
}
|
||||
|
||||
printf("Set RX rate: %.2f MHz\n", srate * 1e-6);
|
||||
srslte_rf_start_rx_stream(&radio, false);
|
||||
srsran_rf_start_rx_stream(&radio, false);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Example implementation to receive from Radio frontend. In this case we use srsLTE
|
||||
/* Example implementation to receive from Radio frontend. In this case we use srsRAN
|
||||
*/
|
||||
static int rx_radio(void** buffer, uint32_t buf_len)
|
||||
{
|
||||
return srslte_rf_recv_with_time_multi(&radio, buffer, buf_len, true, NULL, NULL);
|
||||
return srsran_rf_recv_with_time_multi(&radio, buffer, buf_len, true, NULL, NULL);
|
||||
}
|
||||
|
||||
static void close_radio()
|
||||
{
|
||||
srslte_rf_close(&radio);
|
||||
srsran_rf_close(&radio);
|
||||
}
|
||||
|
||||
static void int_handler(int dummy)
|
||||
|
@ -206,7 +206,7 @@ static void usage(char* prog)
|
|||
printf("\t-m RF receive frame size in ms [Default %d ms]\n", rf_recv_frame_size_ms);
|
||||
printf("\t-A Number of antennas [Max %d, Default %d]\n", max_rx_antennas, nof_rx_antennas);
|
||||
printf("\t-z ZMQ args [Default %s]\n", zmq_args);
|
||||
printf("\t-v srslte_verbose\n");
|
||||
printf("\t-v srsran_verbose\n");
|
||||
}
|
||||
|
||||
static void parse_args(int argc, char** argv)
|
||||
|
@ -230,7 +230,7 @@ static void parse_args(int argc, char** argv)
|
|||
rf_freq = strtof(argv[optind], NULL);
|
||||
break;
|
||||
case 'v':
|
||||
srslte_verbose++;
|
||||
srsran_verbose++;
|
||||
break;
|
||||
case 'z':
|
||||
zmq_args = argv[optind];
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#
|
||||
# Copyright 2013-2020 Software Radio Systems Limited
|
||||
# Copyright 2013-2021 Software Radio Systems Limited
|
||||
#
|
||||
# By using this file, you agree to the terms and conditions set
|
||||
# forth in the LICENSE file which can be found at the top level of
|
||||
|
@ -9,5 +9,5 @@
|
|||
########################################################################
|
||||
# Add subdirectories
|
||||
########################################################################
|
||||
add_subdirectory(srslte)
|
||||
add_subdirectory(srsran)
|
||||
|
||||
|
|
|
@ -1,64 +0,0 @@
|
|||
/**
|
||||
*
|
||||
* \section COPYRIGHT
|
||||
*
|
||||
* Copyright 2013-2020 Software Radio Systems Limited
|
||||
*
|
||||
* By using this file, you agree to the terms and conditions set
|
||||
* forth in the LICENSE file which can be found at the top level of
|
||||
* the distribution.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef SRSLTE_CONFIG_H
|
||||
#define SRSLTE_CONFIG_H
|
||||
|
||||
// Generic helper definitions for shared library support
|
||||
#if defined _WIN32 || defined __CYGWIN__
|
||||
#define SRSLTE_IMPORT __declspec(dllimport)
|
||||
#define SRSLTE_EXPORT __declspec(dllexport)
|
||||
#define SRSLTE_LOCAL
|
||||
#else
|
||||
#if __GNUC__ >= 4
|
||||
#define SRSLTE_IMPORT __attribute__((visibility("default")))
|
||||
#define SRSLTE_EXPORT __attribute__((visibility("default")))
|
||||
#else
|
||||
#define SRSLTE_IMPORT
|
||||
#define SRSLTE_EXPORT
|
||||
#define SRSLTE_LOCAL
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Define SRSLTE_API
|
||||
// SRSLTE_API is used for the public API symbols.
|
||||
#ifdef SRSLTE_DLL_EXPORTS // defined if we are building the SRSLTE DLL (instead of using it)
|
||||
#define SRSLTE_API SRSLTE_EXPORT
|
||||
#else
|
||||
#define SRSLTE_API SRSLTE_IMPORT
|
||||
#endif
|
||||
|
||||
// Useful macros for templates
|
||||
#define CONCAT(a, b) a##b
|
||||
#define CONCAT2(a, b) CONCAT(a, b)
|
||||
|
||||
#define STRING2(x) #x
|
||||
#define STRING(x) STRING2(x)
|
||||
|
||||
// Common error codes
|
||||
#define SRSLTE_SUCCESS 0
|
||||
#define SRSLTE_ERROR -1
|
||||
#define SRSLTE_ERROR_INVALID_INPUTS -2
|
||||
#define SRSLTE_ERROR_TIMEOUT -3
|
||||
#define SRSLTE_ERROR_INVALID_COMMAND -4
|
||||
#define SRSLTE_ERROR_OUT_OF_BOUNDS -5
|
||||
#define SRSLTE_ERROR_CANT_START -6
|
||||
#define SRSLTE_ERROR_ALREADY_STARTED -7
|
||||
|
||||
// cf_t definition
|
||||
typedef _Complex float cf_t;
|
||||
|
||||
#ifdef ENABLE_C16
|
||||
typedef _Complex short int c16_t;
|
||||
#endif /* ENABLE_C16 */
|
||||
|
||||
#endif // SRSLTE_CONFIG_H
|
|
@ -1,164 +0,0 @@
|
|||
/**
|
||||
*
|
||||
* \section COPYRIGHT
|
||||
*
|
||||
* Copyright 2013-2020 Software Radio Systems Limited
|
||||
*
|
||||
* By using this file, you agree to the terms and conditions set
|
||||
* forth in the LICENSE file which can be found at the top level of
|
||||
* the distribution.
|
||||
*
|
||||
*/
|
||||
|
||||
/**********************************************************************************************
|
||||
* File: chest_dl.h
|
||||
*
|
||||
* Description: 3GPP LTE Downlink channel estimator and equalizer.
|
||||
* Estimates the channel in the resource elements transmitting references and
|
||||
* interpolates for the rest of the resource grid.
|
||||
* The equalizer uses the channel estimates to produce an estimation of the
|
||||
* transmitted symbol.
|
||||
* This object depends on the srslte_refsignal_t object for creating the LTE
|
||||
* CSR signal.
|
||||
*
|
||||
* Reference:
|
||||
*********************************************************************************************/
|
||||
|
||||
#ifndef SRSLTE_CHEST_DL_H
|
||||
#define SRSLTE_CHEST_DL_H
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "srslte/config.h"
|
||||
|
||||
#include "srslte/phy/ch_estimation/chest_common.h"
|
||||
#include "srslte/phy/ch_estimation/refsignal_dl.h"
|
||||
#include "srslte/phy/common/phy_common.h"
|
||||
#include "srslte/phy/resampling/interp.h"
|
||||
#include "srslte/phy/sync/pss.h"
|
||||
#include "wiener_dl.h"
|
||||
|
||||
typedef struct SRSLTE_API {
|
||||
cf_t* ce[SRSLTE_MAX_PORTS][SRSLTE_MAX_PORTS];
|
||||
uint32_t nof_re;
|
||||
float noise_estimate;
|
||||
float noise_estimate_dbm;
|
||||
float snr_db;
|
||||
float snr_ant_port_db[SRSLTE_MAX_PORTS][SRSLTE_MAX_PORTS];
|
||||
float rsrp;
|
||||
float rsrp_dbm;
|
||||
float rsrp_neigh;
|
||||
float rsrp_port_dbm[SRSLTE_MAX_PORTS];
|
||||
float rsrp_ant_port_dbm[SRSLTE_MAX_PORTS][SRSLTE_MAX_PORTS];
|
||||
float rsrq;
|
||||
float rsrq_db;
|
||||
float rsrq_ant_port_db[SRSLTE_MAX_PORTS][SRSLTE_MAX_PORTS];
|
||||
float rssi_dbm;
|
||||
float cfo;
|
||||
float sync_error;
|
||||
} srslte_chest_dl_res_t;
|
||||
|
||||
// Noise estimation algorithm
|
||||
typedef enum SRSLTE_API {
|
||||
SRSLTE_NOISE_ALG_REFS = 0,
|
||||
SRSLTE_NOISE_ALG_PSS,
|
||||
SRSLTE_NOISE_ALG_EMPTY,
|
||||
} srslte_chest_dl_noise_alg_t;
|
||||
|
||||
// Channel estimator algorithm
|
||||
typedef enum SRSLTE_API {
|
||||
SRSLTE_ESTIMATOR_ALG_AVERAGE = 0,
|
||||
SRSLTE_ESTIMATOR_ALG_INTERPOLATE,
|
||||
SRSLTE_ESTIMATOR_ALG_WIENER,
|
||||
} srslte_chest_dl_estimator_alg_t;
|
||||
|
||||
typedef struct SRSLTE_API {
|
||||
srslte_cell_t cell;
|
||||
uint32_t nof_rx_antennas;
|
||||
|
||||
srslte_refsignal_t csr_refs;
|
||||
srslte_refsignal_t** mbsfn_refs;
|
||||
|
||||
srslte_wiener_dl_t* wiener_dl;
|
||||
|
||||
cf_t* pilot_estimates;
|
||||
cf_t* pilot_estimates_average;
|
||||
cf_t* pilot_recv_signal;
|
||||
cf_t* tmp_noise;
|
||||
cf_t* tmp_cfo_estimate;
|
||||
|
||||
#ifdef FREQ_SEL_SNR
|
||||
float snr_vector[12000];
|
||||
float pilot_power[12000];
|
||||
#endif
|
||||
|
||||
srslte_interp_linsrslte_vec_t srslte_interp_linvec;
|
||||
srslte_interp_lin_t srslte_interp_lin;
|
||||
srslte_interp_lin_t srslte_interp_lin_3;
|
||||
srslte_interp_lin_t srslte_interp_lin_mbsfn;
|
||||
|
||||
float rssi[SRSLTE_MAX_PORTS][SRSLTE_MAX_PORTS];
|
||||
float rsrp[SRSLTE_MAX_PORTS][SRSLTE_MAX_PORTS];
|
||||
float rsrp_corr[SRSLTE_MAX_PORTS][SRSLTE_MAX_PORTS];
|
||||
float noise_estimate[SRSLTE_MAX_PORTS][SRSLTE_MAX_PORTS];
|
||||
float sync_err[SRSLTE_MAX_PORTS][SRSLTE_MAX_PORTS];
|
||||
float cfo;
|
||||
|
||||
/* Use PSS for noise estimation in LS linear interpolation mode */
|
||||
cf_t pss_signal[SRSLTE_PSS_LEN];
|
||||
cf_t tmp_pss[SRSLTE_PSS_LEN];
|
||||
cf_t tmp_pss_noisy[SRSLTE_PSS_LEN];
|
||||
|
||||
} srslte_chest_dl_t;
|
||||
|
||||
typedef struct SRSLTE_API {
|
||||
|
||||
srslte_chest_dl_estimator_alg_t estimator_alg;
|
||||
srslte_chest_dl_noise_alg_t noise_alg;
|
||||
|
||||
srslte_chest_filter_t filter_type;
|
||||
float filter_coef[2];
|
||||
|
||||
uint16_t mbsfn_area_id;
|
||||
bool rsrp_neighbour;
|
||||
bool cfo_estimate_enable;
|
||||
uint32_t cfo_estimate_sf_mask;
|
||||
bool sync_error_enable;
|
||||
|
||||
} srslte_chest_dl_cfg_t;
|
||||
|
||||
SRSLTE_API int srslte_chest_dl_init(srslte_chest_dl_t* q, uint32_t max_prb, uint32_t nof_rx_antennas);
|
||||
|
||||
SRSLTE_API void srslte_chest_dl_free(srslte_chest_dl_t* q);
|
||||
|
||||
SRSLTE_API int srslte_chest_dl_res_init(srslte_chest_dl_res_t* q, uint32_t max_prb);
|
||||
SRSLTE_API int srslte_chest_dl_res_init_re(srslte_chest_dl_res_t* q, uint32_t nof_re);
|
||||
|
||||
SRSLTE_API void srslte_chest_dl_res_set_identity(srslte_chest_dl_res_t* q);
|
||||
|
||||
SRSLTE_API void srslte_chest_dl_res_set_ones(srslte_chest_dl_res_t* q);
|
||||
|
||||
SRSLTE_API void srslte_chest_dl_res_free(srslte_chest_dl_res_t* q);
|
||||
|
||||
/* These functions change the internal object state */
|
||||
|
||||
SRSLTE_API int srslte_chest_dl_set_mbsfn_area_id(srslte_chest_dl_t* q, uint16_t mbsfn_area_id);
|
||||
|
||||
SRSLTE_API int srslte_chest_dl_set_cell(srslte_chest_dl_t* q, srslte_cell_t cell);
|
||||
|
||||
/* These functions do not change the internal state */
|
||||
|
||||
SRSLTE_API int srslte_chest_dl_estimate(srslte_chest_dl_t* q,
|
||||
srslte_dl_sf_cfg_t* sf,
|
||||
cf_t* input[SRSLTE_MAX_PORTS],
|
||||
srslte_chest_dl_res_t* res);
|
||||
|
||||
SRSLTE_API int srslte_chest_dl_estimate_cfg(srslte_chest_dl_t* q,
|
||||
srslte_dl_sf_cfg_t* sf,
|
||||
srslte_chest_dl_cfg_t* cfg,
|
||||
cf_t* input[SRSLTE_MAX_PORTS],
|
||||
srslte_chest_dl_res_t* res);
|
||||
|
||||
SRSLTE_API srslte_chest_dl_estimator_alg_t srslte_chest_dl_str2estimator_alg(const char* str);
|
||||
|
||||
#endif // SRSLTE_CHEST_DL_H
|
|
@ -1,88 +0,0 @@
|
|||
/**
|
||||
*
|
||||
* \section COPYRIGHT
|
||||
*
|
||||
* Copyright 2013-2020 Software Radio Systems Limited
|
||||
*
|
||||
* By using this file, you agree to the terms and conditions set
|
||||
* forth in the LICENSE file which can be found at the top level of
|
||||
* the distribution.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef SRSLTE_CHEST_DL_NBIOT_H
|
||||
#define SRSLTE_CHEST_DL_NBIOT_H
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "srslte/config.h"
|
||||
|
||||
#include "srslte/phy/ch_estimation/chest_common.h"
|
||||
#include "srslte/phy/ch_estimation/chest_dl.h"
|
||||
#include "srslte/phy/ch_estimation/refsignal_dl_nbiot.h"
|
||||
#include "srslte/phy/common/phy_common.h"
|
||||
#include "srslte/phy/resampling/interp.h"
|
||||
|
||||
/*! \brief Downlink channel estimation for NB-IoT
|
||||
*
|
||||
* Estimates the channel in the resource elements transmitting references and
|
||||
* interpolates for the rest of the resource grid.
|
||||
* The equalizer uses the channel estimates to produce an estimation of the
|
||||
* transmitted symbol.
|
||||
* This object depends on the srslte_refsignal_t object for creating the LTE CSR signal.
|
||||
*/
|
||||
typedef struct {
|
||||
srslte_nbiot_cell_t cell;
|
||||
srslte_refsignal_dl_nbiot_t nrs_signal;
|
||||
|
||||
cf_t* pilot_estimates;
|
||||
cf_t* pilot_estimates_average;
|
||||
cf_t* pilot_recv_signal;
|
||||
cf_t* tmp_noise;
|
||||
|
||||
uint32_t smooth_filter_len;
|
||||
float smooth_filter[SRSLTE_CHEST_MAX_SMOOTH_FIL_LEN];
|
||||
|
||||
srslte_interp_linsrslte_vec_t srslte_interp_linvec;
|
||||
srslte_interp_lin_t srslte_interp_lin;
|
||||
|
||||
float rssi[SRSLTE_MAX_PORTS];
|
||||
float rsrp[SRSLTE_MAX_PORTS];
|
||||
float noise_estimate[SRSLTE_MAX_PORTS];
|
||||
|
||||
srslte_chest_dl_noise_alg_t noise_alg;
|
||||
|
||||
} srslte_chest_dl_nbiot_t;
|
||||
|
||||
SRSLTE_API int srslte_chest_dl_nbiot_init(srslte_chest_dl_nbiot_t* q, uint32_t max_prb);
|
||||
|
||||
SRSLTE_API void srslte_chest_dl_nbiot_free(srslte_chest_dl_nbiot_t* q);
|
||||
|
||||
SRSLTE_API int srslte_chest_dl_nbiot_set_cell(srslte_chest_dl_nbiot_t* q, srslte_nbiot_cell_t cell);
|
||||
|
||||
SRSLTE_API void srslte_chest_dl_nbiot_set_smooth_filter(srslte_chest_dl_nbiot_t* q, float* filter, uint32_t filter_len);
|
||||
|
||||
SRSLTE_API void srslte_chest_dl_nbiot_set_smooth_filter3_coeff(srslte_chest_dl_nbiot_t* q, float w);
|
||||
|
||||
SRSLTE_API void srslte_chest_dl_nbiot_set_noise_alg(srslte_chest_dl_nbiot_t* q,
|
||||
srslte_chest_dl_noise_alg_t noise_estimation_alg);
|
||||
|
||||
SRSLTE_API int srslte_chest_dl_nbiot_estimate(srslte_chest_dl_nbiot_t* q, cf_t* input, cf_t** ce, uint32_t sf_idx);
|
||||
|
||||
SRSLTE_API int srslte_chest_dl_nbiot_estimate_port(srslte_chest_dl_nbiot_t* q,
|
||||
cf_t* input,
|
||||
cf_t* ce,
|
||||
uint32_t sf_idx,
|
||||
uint32_t port_id);
|
||||
|
||||
SRSLTE_API float srslte_chest_dl_nbiot_get_noise_estimate(srslte_chest_dl_nbiot_t* q);
|
||||
|
||||
SRSLTE_API float srslte_chest_dl_nbiot_get_snr(srslte_chest_dl_nbiot_t* q);
|
||||
|
||||
SRSLTE_API float srslte_chest_dl_nbiot_get_rssi(srslte_chest_dl_nbiot_t* q);
|
||||
|
||||
SRSLTE_API float srslte_chest_dl_nbiot_get_rsrq(srslte_chest_dl_nbiot_t* q);
|
||||
|
||||
SRSLTE_API float srslte_chest_dl_nbiot_get_rsrp(srslte_chest_dl_nbiot_t* q);
|
||||
|
||||
#endif // SRSLTE_CHEST_DL_NBIOT_H
|
|
@ -1,107 +0,0 @@
|
|||
/**
|
||||
*
|
||||
* \section COPYRIGHT
|
||||
*
|
||||
* Copyright 2013-2020 Software Radio Systems Limited
|
||||
*
|
||||
* By using this file, you agree to the terms and conditions set
|
||||
* forth in the LICENSE file which can be found at the top level of
|
||||
* the distribution.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef SRSLTE_CHEST_SL_H
|
||||
#define SRSLTE_CHEST_SL_H
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "srslte/phy/common/phy_common_sl.h"
|
||||
#include "srslte/phy/resampling/interp.h"
|
||||
|
||||
#define SRSLTE_SL_N_RU_SEQ (30)
|
||||
#define SRSLTE_SL_MAX_DMRS_SYMB (4)
|
||||
#define SRSLTE_SL_DEFAULT_NOF_DMRS_CYCLIC_SHIFTS (1)
|
||||
#define SRSLTE_SL_MAX_PSCCH_NOF_DMRS_CYCLIC_SHIFTS (4)
|
||||
|
||||
// Base Sequence Number - always 0 for sidelink: 3GPP TS 36.211 version 15.6.0 Release 15 Sec. 5.5.1.4
|
||||
#define SRSLTE_SL_BASE_SEQUENCE_NUMBER 0
|
||||
#define SRSLTE_SL_MAX_DMRS_PERIOD_LENGTH 320
|
||||
|
||||
typedef struct SRSLTE_API {
|
||||
uint32_t prb_start_idx; // PRB start idx to map RE from RIV
|
||||
uint32_t nof_prb; // PSSCH nof_prb, Length of continuous PRB to map RE (in the pool) from RIV
|
||||
uint32_t N_x_id;
|
||||
uint32_t sf_idx; // PSSCH sf_idx
|
||||
uint32_t cyclic_shift;
|
||||
} srslte_chest_sl_cfg_t;
|
||||
|
||||
typedef struct SRSLTE_API {
|
||||
|
||||
srslte_sl_channels_t channel;
|
||||
srslte_cell_sl_t cell;
|
||||
srslte_sl_comm_resource_pool_t sl_comm_resource_pool;
|
||||
srslte_chest_sl_cfg_t chest_sl_cfg;
|
||||
|
||||
uint32_t sf_n_re;
|
||||
|
||||
uint32_t M_sc_rs;
|
||||
int8_t nof_dmrs_symbols;
|
||||
|
||||
// Orthogonal Sequence (W) Transmission Mode 1, 2 and PSBCH
|
||||
int8_t w[SRSLTE_SL_MAX_DMRS_SYMB];
|
||||
|
||||
// Cyclic Shift Values
|
||||
int8_t n_CS[SRSLTE_SL_MAX_DMRS_SYMB];
|
||||
|
||||
// Reference Signal Cyclic Shift
|
||||
float alpha[SRSLTE_SL_MAX_DMRS_SYMB];
|
||||
|
||||
// Group Hopping Flag
|
||||
uint32_t* f_gh_pattern;
|
||||
|
||||
cf_t* r_sequence[SRSLTE_SL_MAX_DMRS_SYMB][SRSLTE_SL_MAX_PSCCH_NOF_DMRS_CYCLIC_SHIFTS];
|
||||
|
||||
cf_t* r_sequence_rx[SRSLTE_SL_MAX_DMRS_SYMB];
|
||||
|
||||
cf_t* ce;
|
||||
cf_t* ce_average;
|
||||
cf_t* noise_tmp;
|
||||
float noise_estimated;
|
||||
|
||||
srslte_interp_linsrslte_vec_t lin_vec_sl;
|
||||
|
||||
bool sync_error_enable;
|
||||
bool rsrp_enable;
|
||||
float sync_err;
|
||||
float rsrp_corr;
|
||||
|
||||
} srslte_chest_sl_t;
|
||||
|
||||
SRSLTE_API int srslte_chest_sl_init(srslte_chest_sl_t* q,
|
||||
srslte_sl_channels_t channel,
|
||||
srslte_cell_sl_t cell,
|
||||
srslte_sl_comm_resource_pool_t sl_comm_resource_pool);
|
||||
|
||||
SRSLTE_API int srslte_chest_sl_set_cell(srslte_chest_sl_t* q, srslte_cell_sl_t cell);
|
||||
|
||||
SRSLTE_API int srslte_chest_sl_set_cfg(srslte_chest_sl_t* q, srslte_chest_sl_cfg_t chest_sl_cfg);
|
||||
|
||||
SRSLTE_API float srslte_chest_sl_get_sync_error(srslte_chest_sl_t* q);
|
||||
|
||||
SRSLTE_API float srslte_chest_sl_estimate_noise(srslte_chest_sl_t* q);
|
||||
|
||||
SRSLTE_API float srslte_chest_sl_get_rsrp(srslte_chest_sl_t* q);
|
||||
|
||||
SRSLTE_API int srslte_chest_sl_put_dmrs(srslte_chest_sl_t* q, cf_t* sf_buffer);
|
||||
|
||||
SRSLTE_API int srslte_chest_sl_get_dmrs(srslte_chest_sl_t* q, cf_t* sf_buffer, cf_t** dmrs_received);
|
||||
|
||||
SRSLTE_API void srslte_chest_sl_ls_estimate(srslte_chest_sl_t* q, cf_t* sf_buffer);
|
||||
|
||||
SRSLTE_API void srslte_chest_sl_ls_equalize(srslte_chest_sl_t* q, cf_t* sf_buffer, cf_t* equalized_sf_buffer);
|
||||
|
||||
SRSLTE_API void srslte_chest_sl_ls_estimate_equalize(srslte_chest_sl_t* q, cf_t* sf_buffer, cf_t* equalized_sf_buffer);
|
||||
|
||||
SRSLTE_API void srslte_chest_sl_free(srslte_chest_sl_t* q);
|
||||
|
||||
#endif
|
|
@ -1,116 +0,0 @@
|
|||
/**
|
||||
*
|
||||
* \section COPYRIGHT
|
||||
*
|
||||
* Copyright 2013-2020 Software Radio Systems Limited
|
||||
*
|
||||
* By using this file, you agree to the terms and conditions set
|
||||
* forth in the LICENSE file which can be found at the top level of
|
||||
* the distribution.
|
||||
*
|
||||
*/
|
||||
|
||||
/**********************************************************************************************
|
||||
* File: chest_ul.h
|
||||
*
|
||||
* Description: 3GPP LTE Uplink channel estimator and equalizer.
|
||||
* Estimates the channel in the resource elements transmitting references and
|
||||
* interpolates for the rest of the resource grid.
|
||||
* The equalizer uses the channel estimates to produce an estimation of the
|
||||
* transmitted symbol.
|
||||
*
|
||||
* Reference:
|
||||
*********************************************************************************************/
|
||||
|
||||
#ifndef SRSLTE_CHEST_UL_H
|
||||
#define SRSLTE_CHEST_UL_H
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "srslte/config.h"
|
||||
|
||||
#include "srslte/phy/ch_estimation/chest_common.h"
|
||||
#include "srslte/phy/ch_estimation/refsignal_ul.h"
|
||||
#include "srslte/phy/common/phy_common.h"
|
||||
#include "srslte/phy/phch/pucch_cfg.h"
|
||||
#include "srslte/phy/phch/pusch_cfg.h"
|
||||
#include "srslte/phy/resampling/interp.h"
|
||||
|
||||
typedef struct SRSLTE_API {
|
||||
cf_t* ce;
|
||||
uint32_t nof_re;
|
||||
float noise_estimate;
|
||||
float noise_estimate_dbm;
|
||||
float rsrp;
|
||||
float rsrp_dBfs;
|
||||
float epre;
|
||||
float epre_dBfs;
|
||||
float snr;
|
||||
float snr_db;
|
||||
float cfo_hz;
|
||||
float ta_us;
|
||||
} srslte_chest_ul_res_t;
|
||||
|
||||
typedef struct {
|
||||
srslte_cell_t cell;
|
||||
|
||||
srslte_refsignal_ul_t dmrs_signal;
|
||||
srslte_refsignal_ul_dmrs_pregen_t dmrs_pregen;
|
||||
bool dmrs_signal_configured;
|
||||
|
||||
srslte_refsignal_srs_pregen_t srs_pregen;
|
||||
bool srs_signal_configured;
|
||||
|
||||
cf_t* pilot_estimates;
|
||||
cf_t* pilot_estimates_tmp[4];
|
||||
cf_t* pilot_recv_signal;
|
||||
cf_t* pilot_known_signal;
|
||||
cf_t* tmp_noise;
|
||||
|
||||
#ifdef FREQ_SEL_SNR
|
||||
float snr_vector[12000];
|
||||
float pilot_power[12000];
|
||||
#endif
|
||||
uint32_t smooth_filter_len;
|
||||
float smooth_filter[SRSLTE_CHEST_MAX_SMOOTH_FIL_LEN];
|
||||
|
||||
srslte_interp_linsrslte_vec_t srslte_interp_linvec;
|
||||
|
||||
} srslte_chest_ul_t;
|
||||
|
||||
SRSLTE_API int srslte_chest_ul_init(srslte_chest_ul_t* q, uint32_t max_prb);
|
||||
|
||||
SRSLTE_API void srslte_chest_ul_free(srslte_chest_ul_t* q);
|
||||
|
||||
SRSLTE_API int srslte_chest_ul_res_init(srslte_chest_ul_res_t* q, uint32_t max_prb);
|
||||
|
||||
SRSLTE_API void srslte_chest_ul_res_set_identity(srslte_chest_ul_res_t* q);
|
||||
|
||||
SRSLTE_API void srslte_chest_ul_res_free(srslte_chest_ul_res_t* q);
|
||||
|
||||
SRSLTE_API int srslte_chest_ul_set_cell(srslte_chest_ul_t* q, srslte_cell_t cell);
|
||||
|
||||
SRSLTE_API void srslte_chest_ul_pregen(srslte_chest_ul_t* q,
|
||||
srslte_refsignal_dmrs_pusch_cfg_t* cfg,
|
||||
srslte_refsignal_srs_cfg_t* srs_cfg);
|
||||
|
||||
SRSLTE_API int srslte_chest_ul_estimate_pusch(srslte_chest_ul_t* q,
|
||||
srslte_ul_sf_cfg_t* sf,
|
||||
srslte_pusch_cfg_t* cfg,
|
||||
cf_t* input,
|
||||
srslte_chest_ul_res_t* res);
|
||||
|
||||
SRSLTE_API int srslte_chest_ul_estimate_pucch(srslte_chest_ul_t* q,
|
||||
srslte_ul_sf_cfg_t* sf,
|
||||
srslte_pucch_cfg_t* cfg,
|
||||
cf_t* input,
|
||||
srslte_chest_ul_res_t* res);
|
||||
|
||||
SRSLTE_API int srslte_chest_ul_estimate_srs(srslte_chest_ul_t* q,
|
||||
srslte_ul_sf_cfg_t* sf,
|
||||
srslte_refsignal_srs_cfg_t* cfg,
|
||||
srslte_refsignal_dmrs_pusch_cfg_t* pusch_cfg,
|
||||
cf_t* input,
|
||||
srslte_chest_ul_res_t* res);
|
||||
|
||||
#endif // SRSLTE_CHEST_UL_H
|
|
@ -1,124 +0,0 @@
|
|||
/**
|
||||
*
|
||||
* \section COPYRIGHT
|
||||
*
|
||||
* Copyright 2013-2020 Software Radio Systems Limited
|
||||
*
|
||||
* By using this file, you agree to the terms and conditions set
|
||||
* forth in the LICENSE file which can be found at the top level of
|
||||
* the distribution.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef SRSLTE_CSI_RS_H_
|
||||
#define SRSLTE_CSI_RS_H_
|
||||
|
||||
#include "srslte/config.h"
|
||||
#include "srslte/phy/common/phy_common_nr.h"
|
||||
#include <complex.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#define SRSLTE_CSI_RS_NOF_FREQ_DOMAIN_ALLOC_ROW1 4
|
||||
#define SRSLTE_CSI_RS_NOF_FREQ_DOMAIN_ALLOC_ROW2 12
|
||||
#define SRSLTE_CSI_RS_NOF_FREQ_DOMAIN_ALLOC_ROW4 3
|
||||
#define SRSLTE_CSI_RS_NOF_FREQ_DOMAIN_ALLOC_OTHER 6
|
||||
#define SRSLTE_CSI_RS_NOF_FREQ_DOMAIN_ALLOC_MAX 12
|
||||
|
||||
typedef enum SRSLTE_API {
|
||||
srslte_csi_rs_resource_mapping_row_1 = 0,
|
||||
srslte_csi_rs_resource_mapping_row_2,
|
||||
srslte_csi_rs_resource_mapping_row_4,
|
||||
srslte_csi_rs_resource_mapping_row_other,
|
||||
} srslte_csi_rs_resource_mapping_row_t;
|
||||
|
||||
typedef enum SRSLTE_API {
|
||||
srslte_csi_rs_resource_mapping_density_three = 0,
|
||||
srslte_csi_rs_resource_mapping_density_dot5_even,
|
||||
srslte_csi_rs_resource_mapping_density_dot5_odd,
|
||||
srslte_csi_rs_resource_mapping_density_one,
|
||||
srslte_csi_rs_resource_mapping_density_spare
|
||||
} srslte_csi_rs_density_t;
|
||||
|
||||
typedef enum SRSLTE_API {
|
||||
srslte_csi_rs_cdm_nocdm = 0,
|
||||
srslte_csi_rs_cdm_fd_cdm2,
|
||||
srslte_csi_rs_cdm_cdm4_fd2_td2,
|
||||
srslte_csi_rs_cdm_cdm8_fd2_td4
|
||||
} srslte_csi_rs_cdm_t;
|
||||
|
||||
/**
|
||||
* @brief Contains CSI-FrequencyOccupation flattened configuration
|
||||
*/
|
||||
typedef struct SRSLTE_API {
|
||||
uint32_t start_rb; ///< PRB where this CSI resource starts in relation to common resource block #0 (CRB#0) on the
|
||||
///< common resource block grid. Only multiples of 4 are allowed (0, 4, ..., 274)
|
||||
|
||||
uint32_t nof_rb; ///< Number of PRBs across which this CSI resource spans. Only multiples of 4 are allowed. The
|
||||
///< smallest configurable number is the minimum of 24 and the width of the associated BWP. If the
|
||||
///< configured value is larger than the width of the corresponding BWP, the UE shall assume that the
|
||||
///< actual CSI-RS bandwidth is equal to the width of the BWP.
|
||||
} srslte_csi_rs_freq_occupation_t;
|
||||
|
||||
/**
|
||||
* @brief Contains CSI-ResourcePeriodicityAndOffset flattened configuration
|
||||
*/
|
||||
typedef struct SRSLTE_API {
|
||||
uint32_t period; // 4,5,8,10,16,20,32,40,64,80,160,320,640
|
||||
uint32_t offset; // 0..period-1
|
||||
} srslte_csi_rs_period_and_offset_t;
|
||||
|
||||
/**
|
||||
* @brief Contains CSI-RS-ResourceMapping flattened configuration
|
||||
*/
|
||||
typedef struct SRSLTE_API {
|
||||
srslte_csi_rs_resource_mapping_row_t row;
|
||||
bool frequency_domain_alloc[SRSLTE_CSI_RS_NOF_FREQ_DOMAIN_ALLOC_MAX];
|
||||
uint32_t ports; // 1, 2, 4, 8, 12, 16, 24, 32
|
||||
uint32_t first_symbol_idx; // 0..13
|
||||
uint32_t first_symbol_idx2; // 2..12 (set to 0 for disabled)
|
||||
srslte_csi_rs_cdm_t cdm;
|
||||
srslte_csi_rs_density_t density;
|
||||
srslte_csi_rs_freq_occupation_t freq_band;
|
||||
} srslte_csi_rs_resource_mapping_t;
|
||||
|
||||
/**
|
||||
* @brief Contains NZP-CSI-RS-Resource flattened configuration
|
||||
*/
|
||||
typedef struct SRSLTE_API {
|
||||
srslte_csi_rs_resource_mapping_t resource_mapping;
|
||||
|
||||
float power_control_offset; // -8..15 dB
|
||||
float power_control_offset_ss; // -3, 0, 3, 6 dB
|
||||
|
||||
uint32_t scrambling_id; // 0..1023
|
||||
|
||||
srslte_csi_rs_period_and_offset_t periodicity;
|
||||
|
||||
} srslte_csi_rs_nzp_resource_t;
|
||||
|
||||
SRSLTE_API int srslte_csi_rs_nzp_put(const srslte_carrier_nr_t* carrier,
|
||||
const srslte_slot_cfg_t* slot_cfg,
|
||||
const srslte_csi_rs_nzp_resource_t* resource,
|
||||
cf_t* grid);
|
||||
|
||||
typedef struct SRSLTE_API {
|
||||
float rsrp;
|
||||
float rsrp_dB;
|
||||
float epre;
|
||||
float epre_dB;
|
||||
float n0;
|
||||
float n0_dB;
|
||||
float snr_dB;
|
||||
uint32_t nof_re;
|
||||
} srslte_csi_rs_measure_t;
|
||||
|
||||
SRSLTE_API int srslte_csi_rs_nzp_measure(const srslte_carrier_nr_t* carrier,
|
||||
const srslte_slot_cfg_t* slot_cfg,
|
||||
const srslte_csi_rs_nzp_resource_t* resource,
|
||||
const cf_t* grid,
|
||||
srslte_csi_rs_measure_t* measure);
|
||||
|
||||
SRSLTE_API uint32_t srslte_csi_rs_measure_info(const srslte_csi_rs_measure_t* measure, char* str, uint32_t str_len);
|
||||
|
||||
#endif // SRSLTE_CSI_RS_H_
|
|
@ -1,92 +0,0 @@
|
|||
/**
|
||||
*
|
||||
* \section COPYRIGHT
|
||||
*
|
||||
* Copyright 2013-2020 Software Radio Systems Limited
|
||||
*
|
||||
* By using this file, you agree to the terms and conditions set
|
||||
* forth in the LICENSE file which can be found at the top level of
|
||||
* the distribution.
|
||||
*
|
||||
*/
|
||||
|
||||
/**********************************************************************************************
|
||||
* File: refsignal_dl.h
|
||||
*
|
||||
* Description: Object to manage downlink reference signals for channel estimation.
|
||||
*
|
||||
* Reference: 3GPP TS 36.211 version 10.0.0 Release 10 Sec. 6.10
|
||||
*********************************************************************************************/
|
||||
|
||||
#ifndef SRSLTE_REFSIGNAL_DL_H
|
||||
#define SRSLTE_REFSIGNAL_DL_H
|
||||
|
||||
#include "srslte/config.h"
|
||||
#include "srslte/phy/common/phy_common.h"
|
||||
|
||||
// Number of references in a subframe: there are 2 symbols for port_id=0,1 x 2 slots x 2 refs per prb
|
||||
#define SRSLTE_REFSIGNAL_NUM_SF_MBSFN(nof_prb, port_id) ((2 + 18) * (nof_prb))
|
||||
|
||||
#define SRSLTE_REFSIGNAL_MAX_NUM_SF(nof_prb) (8 * nof_prb)
|
||||
#define SRSLTE_REFSIGNAL_MAX_NUM_SF_MBSFN(nof_prb) SRSLTE_REFSIGNAL_NUM_SF_MBSFN(nof_prb, 0)
|
||||
|
||||
#define SRSLTE_REFSIGNAL_PILOT_IDX(i, l, cell) (2 * cell.nof_prb * (l) + (i))
|
||||
|
||||
#define SRSLTE_REFSIGNAL_PILOT_IDX_MBSFN(i, l, cell) ((6 * cell.nof_prb * (l) + (i)))
|
||||
|
||||
/** Cell-Specific Reference Signal */
|
||||
typedef struct SRSLTE_API {
|
||||
srslte_cell_t cell;
|
||||
cf_t* pilots[2][SRSLTE_NOF_SF_X_FRAME]; // Saves the reference signal per subframe for ports 0,1 and ports 2,3
|
||||
srslte_sf_t type;
|
||||
uint16_t mbsfn_area_id;
|
||||
} srslte_refsignal_t;
|
||||
|
||||
SRSLTE_API int srslte_refsignal_cs_init(srslte_refsignal_t* q, uint32_t max_prb);
|
||||
|
||||
SRSLTE_API int srslte_refsignal_cs_set_cell(srslte_refsignal_t* q, srslte_cell_t cell);
|
||||
|
||||
SRSLTE_API void srslte_refsignal_free(srslte_refsignal_t* q);
|
||||
|
||||
SRSLTE_API int
|
||||
srslte_refsignal_cs_put_sf(srslte_refsignal_t* q, srslte_dl_sf_cfg_t* sf, uint32_t port_id, cf_t* sf_symbols);
|
||||
|
||||
SRSLTE_API int srslte_refsignal_cs_get_sf(srslte_refsignal_t* q,
|
||||
srslte_dl_sf_cfg_t* sf,
|
||||
uint32_t port_id,
|
||||
cf_t* sf_symbols,
|
||||
cf_t* pilots);
|
||||
|
||||
SRSLTE_API uint32_t srslte_refsignal_cs_fidx(srslte_cell_t cell, uint32_t l, uint32_t port_id, uint32_t m);
|
||||
|
||||
SRSLTE_API uint32_t srslte_refsignal_cs_nsymbol(uint32_t l, srslte_cp_t cp, uint32_t port_id);
|
||||
|
||||
SRSLTE_API uint32_t srslte_refsignal_cs_v(uint32_t port_id, uint32_t ref_symbol_idx);
|
||||
|
||||
SRSLTE_API uint32_t srslte_refsignal_cs_nof_symbols(srslte_refsignal_t* q, srslte_dl_sf_cfg_t* sf, uint32_t port_id);
|
||||
|
||||
SRSLTE_API uint32_t srslte_refsignal_cs_nof_pilots_x_slot(uint32_t nof_ports);
|
||||
|
||||
SRSLTE_API uint32_t srslte_refsignal_cs_nof_re(srslte_refsignal_t* q, srslte_dl_sf_cfg_t* sf, uint32_t port_id);
|
||||
|
||||
SRSLTE_API int srslte_refsignal_mbsfn_init(srslte_refsignal_t* q, uint32_t max_prb);
|
||||
|
||||
SRSLTE_API int srslte_refsignal_mbsfn_set_cell(srslte_refsignal_t* q, srslte_cell_t cell, uint16_t mbsfn_area_id);
|
||||
|
||||
SRSLTE_API int srslte_refsignal_mbsfn_get_sf(srslte_cell_t cell, uint32_t port_id, cf_t* sf_symbols, cf_t* pilots);
|
||||
|
||||
SRSLTE_API uint32_t srslte_refsignal_mbsfn_nsymbol(uint32_t l);
|
||||
|
||||
SRSLTE_API uint32_t srslte_refsignal_mbsfn_fidx(uint32_t l);
|
||||
|
||||
SRSLTE_API uint32_t srslte_refsignal_mbsfn_nof_symbols();
|
||||
|
||||
SRSLTE_API int srslte_refsignal_mbsfn_put_sf(srslte_cell_t cell,
|
||||
uint32_t port_id,
|
||||
cf_t* cs_pilots,
|
||||
cf_t* mbsfn_pilots,
|
||||
cf_t* sf_symbols);
|
||||
|
||||
SRSLTE_API int srslte_refsignal_mbsfn_gen_seq(srslte_refsignal_t* q, srslte_cell_t cell, uint32_t N_mbsfn_id);
|
||||
|
||||
#endif // SRSLTE_REFSIGNAL_DL_H
|
|
@ -1,55 +0,0 @@
|
|||
/**
|
||||
*
|
||||
* \section COPYRIGHT
|
||||
*
|
||||
* Copyright 2013-2020 Software Radio Systems Limited
|
||||
*
|
||||
* By using this file, you agree to the terms and conditions set
|
||||
* forth in the LICENSE file which can be found at the top level of
|
||||
* the distribution.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef SRSLTE_REFSIGNAL_DL_NBIOT_H
|
||||
#define SRSLTE_REFSIGNAL_DL_NBIOT_H
|
||||
|
||||
#include "srslte/config.h"
|
||||
#include "srslte/phy/common/phy_common.h"
|
||||
|
||||
// Number of references in a subframe: there are 2 symbols for port_id=0,1 x 2 slots x 2 refs per prb
|
||||
#define SRSLTE_NBIOT_NUM_NRS_X_SYM_X_PORT 2
|
||||
|
||||
// Max number of symbols with RE in one PRB (4 ports LTE plus 2 port NB-IoT)
|
||||
#define SRSLTE_NBIOT_MAX_NUM_RE_WITH_REFS 40
|
||||
|
||||
#define SRSLTE_NBIOT_REFSIGNAL_NUM_SF(nof_prb, port_id) (((port_id) < 2 ? 8 : 4) * (nof_prb))
|
||||
#define SRSLTE_NBIOT_REFSIGNAL_PILOT_IDX(i, l, nof_prb) (2 * nof_prb * (l) + (i))
|
||||
|
||||
/** Brief: Narrowband Reference Signal (NRS)
|
||||
*
|
||||
* Object to manage downlink reference signals for channel estimation. (3GPP TS 36.211 version 13.3 Sec. 10.2.6)
|
||||
*/
|
||||
typedef struct SRSLTE_API {
|
||||
srslte_nbiot_cell_t cell;
|
||||
cf_t* pilots[2][SRSLTE_NOF_SF_X_FRAME]; // Saves the reference signal per subframe for ports 0 and 1
|
||||
} srslte_refsignal_dl_nbiot_t;
|
||||
|
||||
SRSLTE_API int srslte_refsignal_dl_nbiot_init(srslte_refsignal_dl_nbiot_t* q);
|
||||
|
||||
SRSLTE_API void srslte_refsignal_dl_nbiot_free(srslte_refsignal_dl_nbiot_t* q);
|
||||
|
||||
SRSLTE_API uint32_t srslte_refsignal_dl_nbiot_nof_symbols(uint32_t port_id);
|
||||
|
||||
SRSLTE_API int srslte_refsignal_dl_nbiot_set_cell(srslte_refsignal_dl_nbiot_t* q, srslte_nbiot_cell_t cell);
|
||||
|
||||
SRSLTE_API uint32_t srslte_refsignal_dl_nbiot_fidx(srslte_nbiot_cell_t cell, uint32_t l, uint32_t port_id, uint32_t m);
|
||||
|
||||
SRSLTE_API uint32_t srslte_refsignal_nrs_nsymbol(uint32_t l);
|
||||
|
||||
SRSLTE_API uint32_t srslte_refsignal_nbiot_cs_nof_re(srslte_nbiot_cell_t* cell, uint32_t port_id);
|
||||
|
||||
SRSLTE_API int srslte_refsignal_nrs_put_sf(srslte_nbiot_cell_t cell, uint32_t port_id, cf_t* pilots, cf_t* sf_symbols);
|
||||
|
||||
SRSLTE_API int srslte_refsignal_nrs_get_sf(srslte_nbiot_cell_t cell, uint32_t port_id, cf_t* sf_symbols, cf_t* pilots);
|
||||
|
||||
#endif // SRSLTE_REFSIGNAL_DL_NBIOT_H
|
|
@ -1,184 +0,0 @@
|
|||
/**
|
||||
*
|
||||
* \section COPYRIGHT
|
||||
*
|
||||
* Copyright 2013-2020 Software Radio Systems Limited
|
||||
*
|
||||
* By using this file, you agree to the terms and conditions set
|
||||
* forth in the LICENSE file which can be found at the top level of
|
||||
* the distribution.
|
||||
*
|
||||
*/
|
||||
|
||||
/**********************************************************************************************
|
||||
* File: refsignal_ul.h
|
||||
*
|
||||
* Description: Object to manage uplink reference signals for channel estimation.
|
||||
*
|
||||
* Reference: 3GPP TS 36.211 version 10.0.0 Release 10 Sec. 5.5
|
||||
*********************************************************************************************/
|
||||
|
||||
#ifndef SRSLTE_REFSIGNAL_UL_H
|
||||
#define SRSLTE_REFSIGNAL_UL_H
|
||||
|
||||
#include "srslte/config.h"
|
||||
#include "srslte/phy/common/phy_common.h"
|
||||
#include "srslte/phy/phch/pucch_cfg.h"
|
||||
#include "srslte/phy/phch/pusch_cfg.h"
|
||||
|
||||
#define SRSLTE_NOF_GROUPS_U 30
|
||||
#define SRSLTE_NOF_SEQUENCES_U 2
|
||||
#define SRSLTE_NOF_DELTA_SS 30
|
||||
#define SRSLTE_NOF_CSHIFT 8
|
||||
|
||||
#define SRSLTE_REFSIGNAL_UL_L(ns_idx, cp) ((ns_idx + 1) * SRSLTE_CP_NSYMB(cp) - 4)
|
||||
|
||||
/* PUSCH DMRS common configuration (received in SIB2) */
|
||||
typedef struct SRSLTE_API {
|
||||
uint32_t cyclic_shift;
|
||||
uint32_t delta_ss;
|
||||
bool group_hopping_en;
|
||||
bool sequence_hopping_en;
|
||||
} srslte_refsignal_dmrs_pusch_cfg_t;
|
||||
|
||||
typedef struct SRSLTE_API {
|
||||
|
||||
// Common Configuration
|
||||
uint32_t subframe_config;
|
||||
uint32_t bw_cfg;
|
||||
bool simul_ack;
|
||||
|
||||
// Dedicated configuration
|
||||
uint32_t B;
|
||||
uint32_t b_hop;
|
||||
uint32_t n_srs;
|
||||
uint32_t I_srs;
|
||||
uint32_t k_tc;
|
||||
uint32_t n_rrc;
|
||||
bool dedicated_enabled;
|
||||
bool common_enabled;
|
||||
bool configured;
|
||||
} srslte_refsignal_srs_cfg_t;
|
||||
|
||||
/** Uplink DeModulation Reference Signal (DMRS) */
|
||||
typedef struct SRSLTE_API {
|
||||
srslte_cell_t cell;
|
||||
|
||||
uint32_t n_cs_cell[SRSLTE_NSLOTS_X_FRAME][SRSLTE_CP_NORM_NSYMB];
|
||||
uint32_t n_prs_pusch[SRSLTE_NOF_DELTA_SS][SRSLTE_NSLOTS_X_FRAME]; // We precompute n_prs needed for cyclic shift alpha
|
||||
// at srslte_refsignal_dl_init()
|
||||
uint32_t f_gh[SRSLTE_NSLOTS_X_FRAME];
|
||||
uint32_t u_pucch[SRSLTE_NSLOTS_X_FRAME];
|
||||
uint32_t v_pusch[SRSLTE_NSLOTS_X_FRAME][SRSLTE_NOF_DELTA_SS];
|
||||
} srslte_refsignal_ul_t;
|
||||
|
||||
typedef struct {
|
||||
uint32_t max_prb;
|
||||
cf_t** r[SRSLTE_NOF_CSHIFT][SRSLTE_NOF_SF_X_FRAME];
|
||||
} srslte_refsignal_ul_dmrs_pregen_t;
|
||||
|
||||
typedef struct {
|
||||
cf_t* r[SRSLTE_NOF_SF_X_FRAME];
|
||||
} srslte_refsignal_srs_pregen_t;
|
||||
|
||||
SRSLTE_API int srslte_refsignal_ul_set_cell(srslte_refsignal_ul_t* q, srslte_cell_t cell);
|
||||
|
||||
SRSLTE_API uint32_t srslte_refsignal_dmrs_N_rs(srslte_pucch_format_t format, srslte_cp_t cp);
|
||||
|
||||
SRSLTE_API uint32_t srslte_refsignal_dmrs_pucch_symbol(uint32_t m, srslte_pucch_format_t format, srslte_cp_t cp);
|
||||
|
||||
SRSLTE_API int srslte_refsignal_dmrs_pusch_pregen_init(srslte_refsignal_ul_dmrs_pregen_t* pregen, uint32_t max_prb);
|
||||
|
||||
SRSLTE_API int srslte_refsignal_dmrs_pusch_pregen(srslte_refsignal_ul_t* q,
|
||||
srslte_refsignal_ul_dmrs_pregen_t* pregen,
|
||||
srslte_refsignal_dmrs_pusch_cfg_t* cfg);
|
||||
|
||||
SRSLTE_API void srslte_refsignal_dmrs_pusch_pregen_free(srslte_refsignal_ul_t* q,
|
||||
srslte_refsignal_ul_dmrs_pregen_t* pregen);
|
||||
|
||||
SRSLTE_API int srslte_refsignal_dmrs_pusch_pregen_put(srslte_refsignal_ul_t* q,
|
||||
srslte_ul_sf_cfg_t* sf_cfg,
|
||||
srslte_refsignal_ul_dmrs_pregen_t* pregen,
|
||||
srslte_pusch_cfg_t* pusch_cfg,
|
||||
cf_t* sf_symbols);
|
||||
|
||||
SRSLTE_API int srslte_refsignal_dmrs_pusch_gen(srslte_refsignal_ul_t* q,
|
||||
srslte_refsignal_dmrs_pusch_cfg_t* cfg,
|
||||
uint32_t nof_prb,
|
||||
uint32_t sf_idx,
|
||||
uint32_t cyclic_shift_for_dmrs,
|
||||
cf_t* r_pusch);
|
||||
|
||||
SRSLTE_API void srslte_refsignal_dmrs_pusch_put(srslte_refsignal_ul_t* q,
|
||||
srslte_pusch_cfg_t* pusch_cfg,
|
||||
cf_t* r_pusch,
|
||||
cf_t* sf_symbols);
|
||||
|
||||
SRSLTE_API void srslte_refsignal_dmrs_pusch_get(srslte_refsignal_ul_t* q,
|
||||
srslte_pusch_cfg_t* pusch_cfg,
|
||||
cf_t* sf_symbols,
|
||||
cf_t* r_pusch);
|
||||
|
||||
SRSLTE_API int srslte_refsignal_dmrs_pucch_gen(srslte_refsignal_ul_t* q,
|
||||
srslte_ul_sf_cfg_t* sf,
|
||||
srslte_pucch_cfg_t* cfg,
|
||||
cf_t* r_pucch);
|
||||
|
||||
SRSLTE_API int
|
||||
srslte_refsignal_dmrs_pucch_put(srslte_refsignal_ul_t* q, srslte_pucch_cfg_t* cfg, cf_t* r_pucch, cf_t* output);
|
||||
|
||||
SRSLTE_API int
|
||||
srslte_refsignal_dmrs_pucch_get(srslte_refsignal_ul_t* q, srslte_pucch_cfg_t* cfg, cf_t* input, cf_t* r_pucch);
|
||||
|
||||
SRSLTE_API int srslte_refsignal_srs_pregen(srslte_refsignal_ul_t* q,
|
||||
srslte_refsignal_srs_pregen_t* pregen,
|
||||
srslte_refsignal_srs_cfg_t* cfg,
|
||||
srslte_refsignal_dmrs_pusch_cfg_t* dmrs);
|
||||
|
||||
SRSLTE_API int srslte_refsignal_srs_pregen_put(srslte_refsignal_ul_t* q,
|
||||
srslte_refsignal_srs_pregen_t* pregen,
|
||||
srslte_refsignal_srs_cfg_t* cfg,
|
||||
uint32_t tti,
|
||||
cf_t* sf_symbols);
|
||||
|
||||
SRSLTE_API void srslte_refsignal_srs_pregen_free(srslte_refsignal_ul_t* q, srslte_refsignal_srs_pregen_t* pregen);
|
||||
|
||||
SRSLTE_API int srslte_refsignal_srs_gen(srslte_refsignal_ul_t* q,
|
||||
srslte_refsignal_srs_cfg_t* cfg,
|
||||
srslte_refsignal_dmrs_pusch_cfg_t* pusch_cfg,
|
||||
uint32_t sf_idx,
|
||||
cf_t* r_srs);
|
||||
|
||||
SRSLTE_API int srslte_refsignal_srs_put(srslte_refsignal_ul_t* q,
|
||||
srslte_refsignal_srs_cfg_t* cfg,
|
||||
uint32_t tti,
|
||||
cf_t* r_srs,
|
||||
cf_t* sf_symbols);
|
||||
|
||||
SRSLTE_API int srslte_refsignal_srs_get(srslte_refsignal_ul_t* q,
|
||||
srslte_refsignal_srs_cfg_t* cfg,
|
||||
uint32_t tti,
|
||||
cf_t* r_srs,
|
||||
cf_t* sf_symbols);
|
||||
|
||||
SRSLTE_API void srslte_refsignal_srs_pusch_shortened(srslte_refsignal_ul_t* q,
|
||||
srslte_ul_sf_cfg_t* sf,
|
||||
srslte_refsignal_srs_cfg_t* srs_cfg,
|
||||
srslte_pusch_cfg_t* pusch_cfg);
|
||||
|
||||
SRSLTE_API void srslte_refsignal_srs_pucch_shortened(srslte_refsignal_ul_t* q,
|
||||
srslte_ul_sf_cfg_t* sf,
|
||||
srslte_refsignal_srs_cfg_t* srs_cfg,
|
||||
srslte_pucch_cfg_t* pucch_cfg);
|
||||
|
||||
SRSLTE_API int srslte_refsignal_srs_send_cs(uint32_t subframe_config, uint32_t sf_idx);
|
||||
|
||||
SRSLTE_API int srslte_refsignal_srs_send_ue(uint32_t I_srs, uint32_t tti);
|
||||
|
||||
SRSLTE_API uint32_t srslte_refsignal_srs_rb_start_cs(uint32_t bw_cfg, uint32_t nof_prb);
|
||||
|
||||
SRSLTE_API uint32_t srslte_refsignal_srs_rb_L_cs(uint32_t bw_cfg, uint32_t nof_prb);
|
||||
|
||||
SRSLTE_API uint32_t srslte_refsignal_srs_M_sc(srslte_refsignal_ul_t* q, srslte_refsignal_srs_cfg_t* cfg);
|
||||
|
||||
#endif // SRSLTE_REFSIGNAL_UL_H
|
|
@ -1,524 +0,0 @@
|
|||
/**
|
||||
*
|
||||
* \section COPYRIGHT
|
||||
*
|
||||
* Copyright 2013-2020 Software Radio Systems Limited
|
||||
*
|
||||
* By using this file, you agree to the terms and conditions set
|
||||
* forth in the LICENSE file which can be found at the top level of
|
||||
* the distribution.
|
||||
*
|
||||
*/
|
||||
|
||||
/**********************************************************************************************
|
||||
* File: phy_common.h
|
||||
*
|
||||
* Description: Common parameters and lookup functions for PHY
|
||||
*
|
||||
* Reference: 3GPP TS 36.211 version 10.0.0 Release 10
|
||||
*********************************************************************************************/
|
||||
|
||||
#ifndef SRSLTE_PHY_COMMON_H
|
||||
#define SRSLTE_PHY_COMMON_H
|
||||
|
||||
#include <math.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "srslte/config.h"
|
||||
|
||||
#define SRSLTE_NOF_SF_X_FRAME 10
|
||||
#define SRSLTE_NOF_SLOTS_PER_SF 2
|
||||
#define SRSLTE_NSLOTS_X_FRAME (SRSLTE_NOF_SLOTS_PER_SF * SRSLTE_NOF_SF_X_FRAME)
|
||||
|
||||
#define SRSLTE_NSOFT_BITS 250368 // Soft buffer size for Category 1 UE
|
||||
|
||||
#define SRSLTE_PC_MAX 23 // Maximum TX power for Category 1 UE (in dBm)
|
||||
|
||||
#define SRSLTE_NOF_NID_1 (168)
|
||||
#define SRSLTE_NOF_NID_2 (3)
|
||||
#define SRSLTE_NUM_PCI (SRSLTE_NOF_NID_1 * SRSLTE_NOF_NID_2)
|
||||
|
||||
#define SRSLTE_MAX_CARRIERS 5 // Maximum number of supported simultaneous carriers
|
||||
#define SRSLTE_MAX_PORTS 4
|
||||
#define SRSLTE_MAX_CHANNELS (SRSLTE_MAX_CARRIERS * SRSLTE_MAX_PORTS)
|
||||
#define SRSLTE_MAX_LAYERS 4
|
||||
#define SRSLTE_MAX_CODEWORDS 2
|
||||
#define SRSLTE_MAX_TB SRSLTE_MAX_CODEWORDS
|
||||
#define SRSLTE_MAX_QM 8
|
||||
|
||||
#define SRSLTE_MAX_CODEBLOCKS 32
|
||||
|
||||
#define SRSLTE_MAX_CODEBOOKS 4
|
||||
|
||||
#define SRSLTE_NOF_CFI 3
|
||||
#define SRSLTE_CFI_ISVALID(x) ((x >= 1 && x <= 3))
|
||||
#define SRSLTE_CFI_IDX(x) ((x - 1) % SRSLTE_NOF_CFI)
|
||||
|
||||
#define SRSLTE_LTE_CRC24A 0x1864CFB
|
||||
#define SRSLTE_LTE_CRC24B 0X1800063
|
||||
#define SRSLTE_LTE_CRC24C 0X1B2B117
|
||||
#define SRSLTE_LTE_CRC16 0x11021
|
||||
#define SRSLTE_LTE_CRC11 0xE21
|
||||
#define SRSLTE_LTE_CRC8 0x19B
|
||||
#define SRSLTE_LTE_CRC6 0x61
|
||||
|
||||
#define SRSLTE_MAX_MBSFN_AREA_IDS 256
|
||||
#define SRSLTE_PMCH_RV 0
|
||||
|
||||
typedef enum { SRSLTE_CP_NORM = 0, SRSLTE_CP_EXT } srslte_cp_t;
|
||||
typedef enum { SRSLTE_SF_NORM = 0, SRSLTE_SF_MBSFN } srslte_sf_t;
|
||||
|
||||
#define SRSLTE_INVALID_RNTI 0x0 // TS 36.321 - Table 7.1-1 RNTI 0x0 isn't a valid DL RNTI
|
||||
#define SRSLTE_CRNTI_START 0x000B
|
||||
#define SRSLTE_CRNTI_END 0xFFF3
|
||||
#define SRSLTE_RARNTI_START 0x0001
|
||||
#define SRSLTE_RARNTI_END 0x000A
|
||||
#define SRSLTE_SIRNTI 0xFFFF
|
||||
#define SRSLTE_PRNTI 0xFFFE
|
||||
#define SRSLTE_MRNTI 0xFFFD
|
||||
|
||||
#define SRSLTE_RNTI_ISRAR(rnti) (rnti >= SRSLTE_RARNTI_START && rnti <= SRSLTE_RARNTI_END)
|
||||
#define SRSLTE_RNTI_ISUSER(rnti) (rnti >= SRSLTE_CRNTI_START && rnti <= SRSLTE_CRNTI_END)
|
||||
#define SRSLTE_RNTI_ISSI(rnti) (rnti == SRSLTE_SIRNTI)
|
||||
#define SRSLTE_RNTI_ISPA(rnti) (rnti == SRSLTE_PRNTI)
|
||||
#define SRSLTE_RNTI_ISMBSFN(rnti) (rnti == SRSLTE_MRNTI)
|
||||
#define SRSLTE_RNTI_ISSIRAPA(rnti) (SRSLTE_RNTI_ISSI(rnti) || SRSLTE_RNTI_ISRAR(rnti) || SRSLTE_RNTI_ISPA(rnti))
|
||||
|
||||
#define SRSLTE_CELL_ID_UNKNOWN 1000
|
||||
|
||||
#define SRSLTE_MAX_NSYMB 7
|
||||
|
||||
#define SRSLTE_MAX_PRB 110
|
||||
#define SRSLTE_NRE 12
|
||||
|
||||
#define SRSLTE_SYMBOL_SZ_MAX 2048
|
||||
|
||||
#define SRSLTE_CP_NORM_NSYMB 7
|
||||
#define SRSLTE_CP_NORM_SF_NSYMB (2 * SRSLTE_CP_NORM_NSYMB)
|
||||
#define SRSLTE_CP_NORM_0_LEN 160
|
||||
#define SRSLTE_CP_NORM_LEN 144
|
||||
|
||||
#define SRSLTE_CP_EXT_NSYMB 6
|
||||
#define SRSLTE_CP_EXT_SF_NSYMB (2 * SRSLTE_CP_EXT_NSYMB)
|
||||
#define SRSLTE_CP_EXT_LEN 512
|
||||
#define SRSLTE_CP_EXT_7_5_LEN 1024
|
||||
|
||||
#define SRSLTE_CP_ISNORM(cp) (cp == SRSLTE_CP_NORM)
|
||||
#define SRSLTE_CP_ISEXT(cp) (cp == SRSLTE_CP_EXT)
|
||||
#define SRSLTE_CP_NSYMB(cp) (SRSLTE_CP_ISNORM(cp) ? SRSLTE_CP_NORM_NSYMB : SRSLTE_CP_EXT_NSYMB)
|
||||
|
||||
#define SRSLTE_CP_LEN(symbol_sz, c) ((int)ceilf((((float)(c) * (symbol_sz)) / 2048.0f)))
|
||||
#define SRSLTE_CP_LEN_NORM(symbol, symbol_sz) \
|
||||
(((symbol) == 0) ? SRSLTE_CP_LEN((symbol_sz), SRSLTE_CP_NORM_0_LEN) : SRSLTE_CP_LEN((symbol_sz), SRSLTE_CP_NORM_LEN))
|
||||
#define SRSLTE_CP_LEN_EXT(symbol_sz) (SRSLTE_CP_LEN((symbol_sz), SRSLTE_CP_EXT_LEN))
|
||||
|
||||
#define SRSLTE_CP_SZ(symbol_sz, cp) \
|
||||
(SRSLTE_CP_LEN(symbol_sz, (SRSLTE_CP_ISNORM(cp) ? SRSLTE_CP_NORM_LEN : SRSLTE_CP_EXT_LEN)))
|
||||
#define SRSLTE_SYMBOL_SZ(symbol_sz, cp) (symbol_sz + SRSLTE_CP_SZ(symbol_sz, cp))
|
||||
#define SRSLTE_SLOT_LEN(symbol_sz) (symbol_sz * 15 / 2)
|
||||
#define SRSLTE_SF_LEN(symbol_sz) (symbol_sz * 15)
|
||||
#define SRSLTE_SF_LEN_MAX (SRSLTE_SF_LEN(SRSLTE_SYMBOL_SZ_MAX))
|
||||
|
||||
#define SRSLTE_SLOT_LEN_PRB(nof_prb) (SRSLTE_SLOT_LEN(srslte_symbol_sz(nof_prb)))
|
||||
#define SRSLTE_SF_LEN_PRB(nof_prb) ((uint32_t)SRSLTE_SF_LEN(srslte_symbol_sz(nof_prb)))
|
||||
|
||||
#define SRSLTE_SLOT_LEN_RE(nof_prb, cp) (nof_prb * SRSLTE_NRE * SRSLTE_CP_NSYMB(cp))
|
||||
#define SRSLTE_SF_LEN_RE(nof_prb, cp) (2 * SRSLTE_SLOT_LEN_RE(nof_prb, cp))
|
||||
#define SRSLTE_NOF_RE(cell) (2 * SRSLTE_SLOT_LEN_RE(cell.nof_prb, cell.cp))
|
||||
|
||||
#define SRSLTE_TA_OFFSET (10e-6)
|
||||
|
||||
#define SRSLTE_LTE_TS (1.0f / (15000.0f * 2048.0f))
|
||||
|
||||
#define SRSLTE_SLOT_IDX_CPNORM(symbol_idx, symbol_sz) \
|
||||
(symbol_idx == 0 ? 0 \
|
||||
: (symbol_sz + SRSLTE_CP_LEN(symbol_sz, SRSLTE_CP_NORM_0_LEN) + \
|
||||
(symbol_idx - 1) * (symbol_sz + SRSLTE_CP_LEN(symbol_sz, SRSLTE_CP_NORM_LEN))))
|
||||
#define SRSLTE_SLOT_IDX_CPEXT(idx, symbol_sz) (idx * (symbol_sz + SRSLTE_CP(symbol_sz, SRSLTE_CP_EXT_LEN)))
|
||||
|
||||
#define SRSLTE_RE_IDX(nof_prb, symbol_idx, sample_idx) ((symbol_idx) * (nof_prb) * (SRSLTE_NRE) + sample_idx)
|
||||
|
||||
#define SRSLTE_RS_VSHIFT(cell_id) (cell_id % 6)
|
||||
|
||||
#define SRSLTE_GUARD_RE(nof_prb) ((srslte_symbol_sz(nof_prb) - nof_prb * SRSLTE_NRE) / 2)
|
||||
|
||||
#define SRSLTE_SYMBOL_HAS_REF(l, cp, nof_ports) ((l == 1 && nof_ports == 4) || l == 0 || l == SRSLTE_CP_NSYMB(cp) - 3)
|
||||
|
||||
#define SRSLTE_NOF_CTRL_SYMBOLS(cell, cfi) (cfi + (cell.nof_prb < 10 ? 1 : 0))
|
||||
|
||||
#define SRSLTE_SYMBOL_HAS_REF_MBSFN(l, s) ((l == 2 && s == 0) || (l == 0 && s == 1) || (l == 4 && s == 1))
|
||||
|
||||
#define SRSLTE_NON_MBSFN_REGION_GUARD_LENGTH(non_mbsfn_region, symbol_sz) \
|
||||
((non_mbsfn_region == 1) \
|
||||
? (SRSLTE_CP_LEN_EXT(symbol_sz) - SRSLTE_CP_LEN_NORM(0, symbol_sz)) \
|
||||
: (2 * SRSLTE_CP_LEN_EXT(symbol_sz) - SRSLTE_CP_LEN_NORM(0, symbol_sz) - SRSLTE_CP_LEN_NORM(1, symbol_sz)))
|
||||
|
||||
#define SRSLTE_FDD_NOF_HARQ (FDD_HARQ_DELAY_DL_MS + FDD_HARQ_DELAY_UL_MS)
|
||||
#define SRSLTE_MAX_HARQ_PROC 15
|
||||
|
||||
#define SRSLTE_NOF_LTE_BANDS 58
|
||||
|
||||
#define SRSLTE_DEFAULT_MAX_FRAMES_PBCH 500
|
||||
#define SRSLTE_DEFAULT_MAX_FRAMES_PSS 10
|
||||
#define SRSLTE_DEFAULT_NOF_VALID_PSS_FRAMES 10
|
||||
|
||||
#define ZERO_OBJECT(x) memset(&(x), 0x0, sizeof((x)))
|
||||
|
||||
typedef enum SRSLTE_API { SRSLTE_PHICH_NORM = 0, SRSLTE_PHICH_EXT } srslte_phich_length_t;
|
||||
|
||||
typedef enum SRSLTE_API {
|
||||
SRSLTE_PHICH_R_1_6 = 0,
|
||||
SRSLTE_PHICH_R_1_2,
|
||||
SRSLTE_PHICH_R_1,
|
||||
SRSLTE_PHICH_R_2
|
||||
} srslte_phich_r_t;
|
||||
|
||||
/// LTE duplex modes.
|
||||
typedef enum SRSLTE_API {
|
||||
/// FDD uses frame structure type 1.
|
||||
SRSLTE_FDD = 0,
|
||||
/// TDD uses frame structure type 2.
|
||||
SRSLTE_TDD = 1
|
||||
} srslte_frame_type_t;
|
||||
|
||||
/// Maximum number of TDD special subframe configurations.
|
||||
#define SRSLTE_MAX_TDD_SS_CONFIGS (10u)
|
||||
|
||||
/// Maximum number of TDD uplink-downlink subframe configurations.
|
||||
#define SRSLTE_MAX_TDD_SF_CONFIGS (7u)
|
||||
|
||||
/// Configuration fields for operating in TDD mode.
|
||||
typedef struct SRSLTE_API {
|
||||
/// Uplink-downlink configuration, valid range is [0,SRSLTE_MAX_TDD_SF_CONFIGS[.
|
||||
/// TS 36.211 v8.9.0 Table 4.2-2.
|
||||
uint32_t sf_config;
|
||||
/// Special subframe symbol length configuration, valid range is [0,SRSLTE_MAX_TDD_SS_CONFIGS[.
|
||||
/// TS 36.211 v13.13.0 Table 4.2-1.
|
||||
uint32_t ss_config;
|
||||
/// Set to true when the fields have been configured, otherwise false.
|
||||
bool configured;
|
||||
} srslte_tdd_config_t;
|
||||
|
||||
/// TDD uplink-downlink subframe types.
|
||||
typedef enum SRSLTE_API {
|
||||
/// Subframe is reserved for downlink transmissions.
|
||||
SRSLTE_TDD_SF_D = 0,
|
||||
/// Subframe is reserved for uplink transmissions.
|
||||
SRSLTE_TDD_SF_U = 1,
|
||||
/// Special subframe.
|
||||
SRSLTE_TDD_SF_S = 2,
|
||||
} srslte_tdd_sf_t;
|
||||
|
||||
typedef struct {
|
||||
uint8_t mbsfn_area_id;
|
||||
uint8_t non_mbsfn_region_length;
|
||||
uint8_t mbsfn_mcs;
|
||||
bool enable;
|
||||
bool is_mcch;
|
||||
} srslte_mbsfn_cfg_t;
|
||||
|
||||
// Common cell constant properties that require object reconfiguration
|
||||
typedef struct SRSLTE_API {
|
||||
uint32_t nof_prb;
|
||||
uint32_t nof_ports;
|
||||
uint32_t id;
|
||||
srslte_cp_t cp;
|
||||
srslte_phich_length_t phich_length;
|
||||
srslte_phich_r_t phich_resources;
|
||||
srslte_frame_type_t frame_type;
|
||||
} srslte_cell_t;
|
||||
|
||||
// Common downlink properties that may change every subframe
|
||||
typedef struct SRSLTE_API {
|
||||
srslte_tdd_config_t tdd_config;
|
||||
uint32_t tti;
|
||||
uint32_t cfi;
|
||||
srslte_sf_t sf_type;
|
||||
uint32_t non_mbsfn_region;
|
||||
} srslte_dl_sf_cfg_t;
|
||||
|
||||
typedef struct SRSLTE_API {
|
||||
srslte_tdd_config_t tdd_config;
|
||||
uint32_t tti;
|
||||
bool shortened;
|
||||
} srslte_ul_sf_cfg_t;
|
||||
|
||||
typedef enum SRSLTE_API {
|
||||
SRSLTE_TM1 = 0,
|
||||
SRSLTE_TM2,
|
||||
SRSLTE_TM3,
|
||||
SRSLTE_TM4,
|
||||
SRSLTE_TM5,
|
||||
SRSLTE_TM6,
|
||||
SRSLTE_TM7,
|
||||
SRSLTE_TM8,
|
||||
SRSLTE_TMINV // Invalid Transmission Mode
|
||||
} srslte_tm_t;
|
||||
|
||||
typedef enum SRSLTE_API {
|
||||
SRSLTE_TXSCHEME_PORT0,
|
||||
SRSLTE_TXSCHEME_DIVERSITY,
|
||||
SRSLTE_TXSCHEME_SPATIALMUX,
|
||||
SRSLTE_TXSCHEME_CDD
|
||||
} srslte_tx_scheme_t;
|
||||
|
||||
typedef enum SRSLTE_API { SRSLTE_MIMO_DECODER_ZF, SRSLTE_MIMO_DECODER_MMSE } srslte_mimo_decoder_t;
|
||||
|
||||
/*!
|
||||
* \brief Types of modulations and associated modulation order.
|
||||
*/
|
||||
typedef enum SRSLTE_API {
|
||||
SRSLTE_MOD_BPSK = 0, /*!< \brief BPSK. */
|
||||
SRSLTE_MOD_QPSK, /*!< \brief QPSK. */
|
||||
SRSLTE_MOD_16QAM, /*!< \brief QAM16. */
|
||||
SRSLTE_MOD_64QAM, /*!< \brief QAM64. */
|
||||
SRSLTE_MOD_256QAM, /*!< \brief QAM256. */
|
||||
SRSLTE_MOD_NITEMS
|
||||
} srslte_mod_t;
|
||||
|
||||
typedef enum {
|
||||
SRSLTE_DCI_FORMAT0 = 0,
|
||||
SRSLTE_DCI_FORMAT1,
|
||||
SRSLTE_DCI_FORMAT1A,
|
||||
SRSLTE_DCI_FORMAT1B,
|
||||
SRSLTE_DCI_FORMAT1C,
|
||||
SRSLTE_DCI_FORMAT1D,
|
||||
SRSLTE_DCI_FORMAT2,
|
||||
SRSLTE_DCI_FORMAT2A,
|
||||
SRSLTE_DCI_FORMAT2B,
|
||||
// SRSLTE_DCI_FORMAT3,
|
||||
// SRSLTE_DCI_FORMAT3A,
|
||||
SRSLTE_DCI_FORMATN0,
|
||||
SRSLTE_DCI_FORMATN1,
|
||||
SRSLTE_DCI_FORMATN2,
|
||||
SRSLTE_DCI_FORMAT_RAR, // Not a real LTE format. Used internally to indicate RAR grant
|
||||
SRSLTE_DCI_NOF_FORMATS
|
||||
} srslte_dci_format_t;
|
||||
|
||||
typedef enum {
|
||||
SRSLTE_PUCCH_ACK_NACK_FEEDBACK_MODE_NORMAL = 0, /* No cell selection no pucch3 */
|
||||
SRSLTE_PUCCH_ACK_NACK_FEEDBACK_MODE_CS,
|
||||
SRSLTE_PUCCH_ACK_NACK_FEEDBACK_MODE_PUCCH3,
|
||||
SRSLTE_PUCCH_ACK_NACK_FEEDBACK_MODE_ERROR,
|
||||
} srslte_ack_nack_feedback_mode_t;
|
||||
|
||||
typedef struct SRSLTE_API {
|
||||
int id;
|
||||
float fd;
|
||||
} srslte_earfcn_t;
|
||||
|
||||
enum band_geographical_area {
|
||||
SRSLTE_BAND_GEO_AREA_ALL,
|
||||
SRSLTE_BAND_GEO_AREA_NAR,
|
||||
SRSLTE_BAND_GEO_AREA_APAC,
|
||||
SRSLTE_BAND_GEO_AREA_EMEA,
|
||||
SRSLTE_BAND_GEO_AREA_JAPAN,
|
||||
SRSLTE_BAND_GEO_AREA_CALA,
|
||||
SRSLTE_BAND_GEO_AREA_NA
|
||||
};
|
||||
|
||||
///< NB-IoT specific structs
|
||||
typedef enum {
|
||||
SRSLTE_NBIOT_MODE_INBAND_SAME_PCI = 0,
|
||||
SRSLTE_NBIOT_MODE_INBAND_DIFFERENT_PCI,
|
||||
SRSLTE_NBIOT_MODE_GUARDBAND,
|
||||
SRSLTE_NBIOT_MODE_STANDALONE,
|
||||
SRSLTE_NBIOT_MODE_N_ITEMS,
|
||||
} srslte_nbiot_mode_t;
|
||||
|
||||
typedef struct SRSLTE_API {
|
||||
srslte_cell_t base; // the umbrella or super cell
|
||||
uint32_t nbiot_prb; // the index of the NB-IoT PRB within the cell
|
||||
uint32_t n_id_ncell;
|
||||
uint32_t nof_ports; // The number of antenna ports for NB-IoT
|
||||
bool is_r14; // Whether the cell is a R14 cell
|
||||
srslte_nbiot_mode_t mode;
|
||||
} srslte_nbiot_cell_t;
|
||||
|
||||
#define SRSLTE_NBIOT_MAX_PORTS 2
|
||||
#define SRSLTE_NBIOT_MAX_CODEWORDS SRSLTE_MAX_CODEWORDS
|
||||
|
||||
#define SRSLTE_SF_LEN_PRB_NBIOT (SRSLTE_SF_LEN_PRB(1))
|
||||
|
||||
#define SRSLTE_SF_LEN_RE_NBIOT (SRSLTE_SF_LEN_RE(1, SRSLTE_CP_NORM))
|
||||
|
||||
#define SRSLTE_NBIOT_FFT_SIZE 128
|
||||
#define SRSLTE_NBIOT_FREQ_SHIFT_FACTOR ((float)-0.5)
|
||||
#define SRSLTE_NBIOT_NUM_RX_ANTENNAS 1
|
||||
#define SRSLTE_NBIOT_MAX_PRB 1
|
||||
|
||||
#define SRSLTE_NBIOT_DEFAULT_NUM_PRB_BASECELL 1
|
||||
#define SRSLTE_NBIOT_DEFAULT_PRB_OFFSET 0
|
||||
|
||||
#define SRSLTE_DEFAULT_MAX_FRAMES_NPBCH 500
|
||||
#define SRSLTE_DEFAULT_MAX_FRAMES_NPSS 20
|
||||
#define SRSLTE_DEFAULT_NOF_VALID_NPSS_FRAMES 20
|
||||
|
||||
#define SRSLTE_NBIOT_NPBCH_NOF_TOTAL_BITS (1600) ///< Number of bits for the entire NPBCH (See 36.211 Sec 10.2.4.1)
|
||||
#define SRSLTE_NBIOT_NPBCH_NOF_BITS_SF \
|
||||
(SRSLTE_NBIOT_NPBCH_NOF_TOTAL_BITS / 8) ///< The NPBCH is transmitted in 8 blocks (See 36.211 Sec 10.2.4.4)
|
||||
|
||||
#define SRSLTE_MAX_DL_BITS_CAT_NB1 (680) ///< TS 36.306 v15.4.0 Table 4.1C-1
|
||||
|
||||
///< PHY common function declarations
|
||||
|
||||
SRSLTE_API bool srslte_cell_isvalid(srslte_cell_t* cell);
|
||||
|
||||
SRSLTE_API void srslte_cell_fprint(FILE* stream, srslte_cell_t* cell, uint32_t sfn);
|
||||
|
||||
SRSLTE_API bool srslte_cellid_isvalid(uint32_t cell_id);
|
||||
|
||||
SRSLTE_API bool srslte_nofprb_isvalid(uint32_t nof_prb);
|
||||
|
||||
/**
|
||||
* Returns the subframe type for a given subframe number and a TDD configuration.
|
||||
* Check TS 36.211 v8.9.0 Table 4.2-2.
|
||||
*
|
||||
* @param tdd_config TDD configuration.
|
||||
* @param sf_idx Subframe number, must be in range [0,SRSLTE_NOF_SF_X_FRAME[.
|
||||
* @return Returns the subframe type.
|
||||
*/
|
||||
SRSLTE_API srslte_tdd_sf_t srslte_sfidx_tdd_type(srslte_tdd_config_t tdd_config, uint32_t sf_idx);
|
||||
|
||||
/**
|
||||
* Returns the number of UpPTS symbols in a subframe.
|
||||
* Check TS 36.211 v13.13.0 Table 4.2-1.
|
||||
*
|
||||
* @param tdd_config TDD configuration.
|
||||
* @return Returns the number of UpPTS symbols.
|
||||
*/
|
||||
SRSLTE_API uint32_t srslte_sfidx_tdd_nof_up(srslte_tdd_config_t tdd_config);
|
||||
|
||||
/**
|
||||
* Returns the number of GP symbols in a subframe.
|
||||
* Check TS 36.211 v13.13.0 Table 4.2-1.
|
||||
*
|
||||
* @param tdd_config TDD configuration.
|
||||
* @return Returns the number of GP symbols.
|
||||
*/
|
||||
SRSLTE_API uint32_t srslte_sfidx_tdd_nof_gp(srslte_tdd_config_t tdd_config);
|
||||
|
||||
/**
|
||||
* Returns the number of DwPTS symbols in a subframe.
|
||||
* Check TS 36.211 v13.13.0 Table 4.2-1.
|
||||
*
|
||||
* @param tdd_config TDD configuration.
|
||||
* @return Returns the number of DwPTS symbols.
|
||||
*/
|
||||
SRSLTE_API uint32_t srslte_sfidx_tdd_nof_dw(srslte_tdd_config_t tdd_config);
|
||||
|
||||
SRSLTE_API uint32_t srslte_tdd_nof_harq(srslte_tdd_config_t tdd_config);
|
||||
|
||||
SRSLTE_API uint32_t srslte_sfidx_tdd_nof_dw_slot(srslte_tdd_config_t tdd_config, uint32_t slot, srslte_cp_t cp);
|
||||
|
||||
SRSLTE_API bool srslte_sfidx_isvalid(uint32_t sf_idx);
|
||||
|
||||
SRSLTE_API bool srslte_portid_isvalid(uint32_t port_id);
|
||||
|
||||
SRSLTE_API bool srslte_N_id_2_isvalid(uint32_t N_id_2);
|
||||
|
||||
SRSLTE_API bool srslte_N_id_1_isvalid(uint32_t N_id_1);
|
||||
|
||||
SRSLTE_API bool srslte_symbol_sz_isvalid(uint32_t symbol_sz);
|
||||
|
||||
SRSLTE_API int srslte_symbol_sz(uint32_t nof_prb);
|
||||
|
||||
SRSLTE_API int srslte_symbol_sz_power2(uint32_t nof_prb);
|
||||
|
||||
SRSLTE_API int srslte_nof_prb(uint32_t symbol_sz);
|
||||
|
||||
SRSLTE_API uint32_t srslte_max_cce(uint32_t nof_prb);
|
||||
|
||||
SRSLTE_API int srslte_sampling_freq_hz(uint32_t nof_prb);
|
||||
|
||||
SRSLTE_API void srslte_use_standard_symbol_size(bool enabled);
|
||||
|
||||
SRSLTE_API bool srslte_symbol_size_is_standard();
|
||||
|
||||
SRSLTE_API uint32_t srslte_re_x_prb(uint32_t ns, uint32_t symbol, uint32_t nof_ports, uint32_t nof_symbols);
|
||||
|
||||
SRSLTE_API uint32_t srslte_voffset(uint32_t symbol_id, uint32_t cell_id, uint32_t nof_ports);
|
||||
|
||||
SRSLTE_API int srslte_group_hopping_f_gh(uint32_t f_gh[SRSLTE_NSLOTS_X_FRAME], uint32_t cell_id);
|
||||
|
||||
SRSLTE_API uint32_t srslte_N_ta_new_rar(uint32_t ta);
|
||||
|
||||
SRSLTE_API uint32_t srslte_N_ta_new(uint32_t N_ta_old, uint32_t ta);
|
||||
|
||||
SRSLTE_API float srslte_coderate(uint32_t tbs, uint32_t nof_re);
|
||||
|
||||
SRSLTE_API char* srslte_cp_string(srslte_cp_t cp);
|
||||
|
||||
SRSLTE_API srslte_mod_t srslte_str2mod(const char* mod_str);
|
||||
|
||||
SRSLTE_API char* srslte_mod_string(srslte_mod_t mod);
|
||||
|
||||
SRSLTE_API uint32_t srslte_mod_bits_x_symbol(srslte_mod_t mod);
|
||||
|
||||
SRSLTE_API uint8_t srslte_band_get_band(uint32_t dl_earfcn);
|
||||
|
||||
SRSLTE_API bool srslte_band_is_tdd(uint32_t band);
|
||||
|
||||
SRSLTE_API double srslte_band_fd(uint32_t dl_earfcn);
|
||||
|
||||
SRSLTE_API double srslte_band_fu(uint32_t ul_earfcn);
|
||||
|
||||
SRSLTE_API uint32_t srslte_band_ul_earfcn(uint32_t dl_earfcn);
|
||||
|
||||
SRSLTE_API int
|
||||
srslte_band_get_fd_band(uint32_t band, srslte_earfcn_t* earfcn, int earfcn_start, int earfcn_end, uint32_t max_elems);
|
||||
|
||||
SRSLTE_API int srslte_band_get_fd_band_all(uint32_t band, srslte_earfcn_t* earfcn, uint32_t max_nelems);
|
||||
|
||||
SRSLTE_API int
|
||||
srslte_band_get_fd_region(enum band_geographical_area region, srslte_earfcn_t* earfcn, uint32_t max_elems);
|
||||
|
||||
SRSLTE_API int srslte_str2mimotype(char* mimo_type_str, srslte_tx_scheme_t* type);
|
||||
|
||||
SRSLTE_API char* srslte_mimotype2str(srslte_tx_scheme_t mimo_type);
|
||||
|
||||
/* Returns the interval tti1-tti2 mod 10240 */
|
||||
SRSLTE_API uint32_t srslte_tti_interval(uint32_t tti1, uint32_t tti2);
|
||||
|
||||
SRSLTE_API uint32_t srslte_print_check(char* s, size_t max_len, uint32_t cur_len, const char* format, ...);
|
||||
|
||||
SRSLTE_API bool srslte_nbiot_cell_isvalid(srslte_nbiot_cell_t* cell);
|
||||
SRSLTE_API bool srslte_nbiot_portid_isvalid(uint32_t port_id);
|
||||
SRSLTE_API float srslte_band_fu_nbiot(uint32_t ul_earfcn, const float m_ul);
|
||||
|
||||
SRSLTE_API char* srslte_nbiot_mode_string(srslte_nbiot_mode_t mode);
|
||||
|
||||
/**
|
||||
* Returns a constant string pointer with the ACK/NACK feedback mode
|
||||
*
|
||||
* @param ack_nack_feedback_mode Mode
|
||||
* @return Returns constant pointer with the text of the mode if succesful, `error` otherwise
|
||||
*/
|
||||
SRSLTE_API const char* srslte_ack_nack_feedback_mode_string(srslte_ack_nack_feedback_mode_t ack_nack_feedback_mode);
|
||||
|
||||
/**
|
||||
* Returns a constant string pointer with the ACK/NACK feedback mode
|
||||
*
|
||||
* @param ack_nack_feedback_mode Mode
|
||||
* @return Returns constant pointer with the text of the mode if succesful, `error` otherwise
|
||||
*/
|
||||
SRSLTE_API srslte_ack_nack_feedback_mode_t srslte_string_ack_nack_feedback_mode(const char* str);
|
||||
|
||||
/**
|
||||
* Returns the number of bits for Rank Indicador reporting depending on the cell
|
||||
*
|
||||
* @param cell
|
||||
*/
|
||||
SRSLTE_API uint32_t srslte_ri_nof_bits(const srslte_cell_t* cell);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // SRSLTE_PHY_COMMON_H
|
|
@ -1,167 +0,0 @@
|
|||
/**
|
||||
*
|
||||
* \section COPYRIGHT
|
||||
*
|
||||
* Copyright 2013-2020 Software Radio Systems Limited
|
||||
*
|
||||
* By using this file, you agree to the terms and conditions set
|
||||
* forth in the LICENSE file which can be found at the top level of
|
||||
* the distribution.
|
||||
*
|
||||
*/
|
||||
|
||||
/**********************************************************************************************
|
||||
* File: phy_common_sl.h
|
||||
*
|
||||
* Description: Common parameters and lookup functions for Sidelink PHY
|
||||
*
|
||||
* Reference: 3GPP TS 36.211 version 15.3.0 Release 15
|
||||
*********************************************************************************************/
|
||||
|
||||
#ifndef SRSLTE_PHY_COMMON_SL_H
|
||||
#define SRSLTE_PHY_COMMON_SL_H
|
||||
|
||||
/**
|
||||
* \brief Common parameters and lookup functions for Sidelink PHY
|
||||
*/
|
||||
|
||||
#include "srslte/phy/common/phy_common.h"
|
||||
|
||||
typedef enum SRSLTE_API {
|
||||
SRSLTE_SIDELINK_TM1 = 0,
|
||||
SRSLTE_SIDELINK_TM2,
|
||||
SRSLTE_SIDELINK_TM3,
|
||||
SRSLTE_SIDELINK_TM4
|
||||
} srslte_sl_tm_t;
|
||||
|
||||
typedef enum SRSLTE_API {
|
||||
SRSLTE_SIDELINK_PSBCH = 0, // Physical Sidelink Broadcast Channel
|
||||
SRSLTE_SIDELINK_PSCCH, // Physical Sidelink Control Channel
|
||||
SRSLTE_SIDELINK_PSSCH, // Physical Sidelink Shared Channel
|
||||
SRSLTE_SIDELINK_PSDCH // Physical Sidelink Discovery Channel
|
||||
} srslte_sl_channels_t;
|
||||
|
||||
typedef struct SRSLTE_API {
|
||||
srslte_sl_tm_t tm;
|
||||
uint32_t N_sl_id;
|
||||
uint32_t nof_prb;
|
||||
srslte_cp_t cp;
|
||||
} srslte_cell_sl_t;
|
||||
|
||||
#define SRSLTE_SL_MAX_PERIOD_LENGTH 320 // SL-PeriodComm-r12 3GPP TS 36.331 Section 6.3.8
|
||||
// SL-CommResourcePool: 3GPP TS 36.331 version 15.6.0 Release 15 Section 6.3.8
|
||||
typedef struct SRSLTE_API {
|
||||
uint32_t period_length;
|
||||
|
||||
uint32_t prb_num;
|
||||
uint32_t prb_start;
|
||||
uint32_t prb_end;
|
||||
|
||||
uint8_t pscch_sf_bitmap[SRSLTE_SL_MAX_PERIOD_LENGTH];
|
||||
uint8_t pssch_sf_bitmap[SRSLTE_SL_MAX_PERIOD_LENGTH];
|
||||
|
||||
uint32_t size_sub_channel; // sizeSubchannel-r14
|
||||
uint32_t num_sub_channel; // numSubchannel-r14
|
||||
uint32_t start_prb_sub_channel; // startRB-Subchannel-r14 offset
|
||||
bool adjacency_pscch_pssch; // adjacencyPSCCH-PSSCH-r14
|
||||
|
||||
uint32_t sf_bitmap_tm34_len;
|
||||
uint8_t sf_bitmap_tm34[SRSLTE_SL_MAX_PERIOD_LENGTH]; // sl_Subframe_r14: 3GPP 36.331 Section 6.3.8
|
||||
} srslte_sl_comm_resource_pool_t;
|
||||
|
||||
typedef enum SRSLTE_API {
|
||||
SRSLTE_SIDELINK_DATA_SYMBOL = 0,
|
||||
SRSLTE_SIDELINK_SYNC_SYMBOL,
|
||||
SRSLTE_SIDELINK_DMRS_SYMBOL,
|
||||
SRSLTE_SIDELINK_GUARD_SYMBOL
|
||||
} srslte_sl_symbol_t;
|
||||
|
||||
#define SRSLTE_SL_DUPLEX_MODE_FDD (1)
|
||||
#define SRSLTE_SL_DUPLEX_MODE_TDD (2)
|
||||
|
||||
#define SRSLTE_SLSS_SIDE_PEAK_OFFSET (0.005f)
|
||||
#define SRSLTE_SLSS_SIDE_PEAK_THRESHOLD_HIGH (0.49f) // square(0.7), max 70% of main peak
|
||||
#define SRSLTE_SLSS_SIDE_PEAK_THRESHOLD_LOW (0.09f) // square(0.3), min 30% of main peak
|
||||
|
||||
#define SRSLTE_PSBCH_NOF_PRB (6)
|
||||
#define SRSLTE_PSCCH_TM34_NOF_PRB (2)
|
||||
|
||||
#define SRSLTE_MIB_SL_LEN (40) // TM1/2: 40 bits
|
||||
#define SRSLTE_MIB_SL_V2X_LEN (48) // TM3/4: 48 bits
|
||||
#define SRSLTE_MIB_SL_MAX_LEN (SRSLTE_MIB_SL_V2X_LEN)
|
||||
|
||||
#define SRSLTE_SL_TM12_DEFAULT_NUM_DMRS_SYMBOLS (2)
|
||||
#define SRSLTE_SL_TM34_DEFAULT_NUM_DMRS_SYMBOLS (4) ///< In TM3/4, all channels have 4 DMRS by default
|
||||
|
||||
#define SRSLTE_PSBCH_TM12_NUM_DATA_SYMBOLS (8) // PSBCH is in 8 OFDM symbols (but only 7 are tx'ed)
|
||||
#define SRSLTE_PSBCH_TM12_NUM_DATA_SYMBOLS_EXT \
|
||||
(6) // PSBCH is in 7 OFDM symbols for extended cyclic prefix (but only 6 are tx'ed)
|
||||
#define SRSLTE_PSBCH_TM12_NUM_DMRS_SYMBOLS (2) ///< PSBCH has 2 DMRS symbols
|
||||
#define SRSLTE_PSBCH_TM12_NUM_SYNC_SYMBOLS (4) ///< Two symbols PSSS and two SSSS
|
||||
|
||||
#define SRSLTE_PSBCH_TM34_NUM_DATA_SYMBOLS (7) ///< SL-BCH is in 7 OFDM symbols (but only 6 are tx'ed)
|
||||
#define SRSLTE_PSBCH_TM34_NUM_DMRS_SYMBOLS (3) ///< PSBCH has 3 DMRS symbols in TM3 and TM4
|
||||
#define SRSLTE_PSBCH_TM34_NUM_SYNC_SYMBOLS (4) ///< Two symbols PSSS and two SSSS
|
||||
|
||||
#define SRSLTE_SCI_CRC_LEN (16)
|
||||
#define SRSLTE_SCI_MAX_LEN (45)
|
||||
#define SRSLTE_SCI_TM34_LEN (32)
|
||||
|
||||
#define SRSLTE_PSCCH_QM 2
|
||||
#define SRSLTE_PSCCH_TM12_NOF_PRB (1)
|
||||
#define SRSLTE_PSCCH_TM34_NOF_PRB (2)
|
||||
#define SRSLTE_PSCCH_MAX_NOF_PRB (SRSLTE_PSCCH_TM34_NOF_PRB)
|
||||
#define SRSLTE_PSCCH_SCRAMBLING_SEED (510) ///< Scrambling seed for PSCCH is 510
|
||||
|
||||
#define SRSLTE_PSCCH_TM12_NUM_DATA_SYMBOLS (12)
|
||||
#define SRSLTE_PSCCH_TM12_NUM_DMRS_SYMBOLS (2)
|
||||
#define SRSLTE_PSCCH_TM12_NUM_DATA_SYMBOLS_EXT (10)
|
||||
|
||||
#define SRSLTE_PSCCH_TM34_NUM_DATA_SYMBOLS (10)
|
||||
#define SRSLTE_PSCCH_TM34_NUM_DMRS_SYMBOLS (4)
|
||||
|
||||
#define SRSLTE_PSCCH_TM12_NOF_CODED_BITS \
|
||||
(SRSLTE_NRE * SRSLTE_PSCCH_TM12_NUM_DATA_SYMBOLS * SRSLTE_PSCCH_TM12_NOF_PRB * SRSLTE_PSCCH_QM)
|
||||
#define SRSLTE_PSCCH_TM34_NOF_CODED_BITS \
|
||||
(SRSLTE_NRE * SRSLTE_PSCCH_TM34_NUM_DATA_SYMBOLS * SRSLTE_PSCCH_TM34_NOF_PRB * SRSLTE_PSCCH_QM)
|
||||
#define SRSLTE_PSCCH_MAX_CODED_BITS SRSLTE_MAX(SRSLTE_PSCCH_TM12_NOF_CODED_BITS, SRSLTE_PSCCH_TM34_NOF_CODED_BITS)
|
||||
|
||||
#define SRSLTE_PSSCH_MAX_QM 6
|
||||
#define SRSLTE_PSSCH_CRC_LEN 24
|
||||
#define SRSLTE_MAX_CODEWORD_LEN 168000 // 12 subcarriers * 100 PRB * 14 symbols * 10 bits, assuming 1024QAM
|
||||
#define SRSLTE_SL_SCH_MAX_TB_LEN (48936) // 3GPP 36.306 v15.4.0 Table 4.1B-1
|
||||
#define SRSLTE_PSSCH_MAX_CODED_BITS (3 * SRSLTE_TCOD_MAX_LEN_CB + SRSLTE_TCOD_TOTALTAIL)
|
||||
|
||||
#define SRSLTE_PSSCH_TM12_NUM_DATA_SYMBOLS (12) // PSSCH is in 12 OFDM symbols (but only 11 are tx'ed)
|
||||
#define SRSLTE_PSSCH_TM12_NUM_DMRS_SYMBOLS (2) // PSSCH has 2 DMRS symbols in TM1 and TM2
|
||||
|
||||
#define SRSLTE_PSSCH_TM12_NUM_DATA_SYMBOLS_CP_EXT \
|
||||
(10) // PSSCH is in 10 OFDM symbols for extended cyclic prefix (but only 9 are tx'ed)
|
||||
#define SRSLTE_PSSCH_TM12_NUM_DMRS_SYMBOLS_CP_EXT \
|
||||
(2) // PSSCH has 2 DMRS symbols for extended cyclic prefix in TM1 and TM2
|
||||
|
||||
#define SRSLTE_PSSCH_TM34_NUM_DATA_SYMBOLS (10) // PSSCH is in 10 OFDM symbols (but only 9 are tx'ed)
|
||||
#define SRSLTE_PSSCH_TM34_NUM_DMRS_SYMBOLS (4) // PSSCH has 4 DMRS symbols in TM3 and TM4
|
||||
|
||||
SRSLTE_API int srslte_sl_group_hopping_f_gh(uint32_t f_gh[SRSLTE_NSLOTS_X_FRAME * 2], uint32_t N_x_id);
|
||||
#define SRSLTE_PSCCH_MAX_NUM_DATA_SYMBOLS (SRSLTE_PSCCH_TM12_NUM_DATA_SYMBOLS)
|
||||
|
||||
SRSLTE_API bool srslte_slss_side_peak_pos_is_valid(uint32_t side_peak_pos,
|
||||
uint32_t main_peak_pos,
|
||||
uint32_t side_peak_delta_a,
|
||||
uint32_t side_peak_delta_b);
|
||||
SRSLTE_API bool srslte_slss_side_peak_value_is_valid(float side_peak_value, float threshold_low, float threshold_high);
|
||||
|
||||
SRSLTE_API int srslte_sl_tm_to_cell_sl_tm_t(srslte_cell_sl_t* q, uint32_t tm);
|
||||
|
||||
SRSLTE_API uint32_t srslte_sl_get_num_symbols(srslte_sl_tm_t tm, srslte_cp_t cp);
|
||||
SRSLTE_API bool srslte_psbch_is_symbol(srslte_sl_symbol_t type, srslte_sl_tm_t tm, uint32_t i, srslte_cp_t cp);
|
||||
SRSLTE_API bool srslte_pscch_is_symbol(srslte_sl_symbol_t type, srslte_sl_tm_t tm, uint32_t i, srslte_cp_t cp);
|
||||
SRSLTE_API bool srslte_pssch_is_symbol(srslte_sl_symbol_t type, srslte_sl_tm_t tm, uint32_t i, srslte_cp_t cp);
|
||||
|
||||
SRSLTE_API uint32_t srslte_sci_format0_sizeof(uint32_t nof_prb);
|
||||
|
||||
SRSLTE_API int srslte_sl_comm_resource_pool_get_default_config(srslte_sl_comm_resource_pool_t* q,
|
||||
srslte_cell_sl_t cell);
|
||||
|
||||
#endif // SRSLTE_PHY_COMMON_SL_H
|
|
@ -1,162 +0,0 @@
|
|||
/**
|
||||
*
|
||||
* \section COPYRIGHT
|
||||
*
|
||||
* Copyright 2013-2020 Software Radio Systems Limited
|
||||
*
|
||||
* By using this file, you agree to the terms and conditions set
|
||||
* forth in the LICENSE file which can be found at the top level of
|
||||
* the distribution.
|
||||
*
|
||||
*/
|
||||
|
||||
/******************************************************************************
|
||||
* File: enb_dl.h
|
||||
*
|
||||
* Description: ENB downlink object.
|
||||
*
|
||||
* This module is a frontend to all the downlink data and control
|
||||
* channel processing modules for the ENB transmitter side.
|
||||
*
|
||||
* Reference:
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef SRSLTE_ENB_DL_H
|
||||
#define SRSLTE_ENB_DL_H
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
#include "srslte/phy/ch_estimation/refsignal_dl.h"
|
||||
#include "srslte/phy/common/phy_common.h"
|
||||
#include "srslte/phy/dft/ofdm.h"
|
||||
#include "srslte/phy/phch/dci.h"
|
||||
#include "srslte/phy/phch/pbch.h"
|
||||
#include "srslte/phy/phch/pcfich.h"
|
||||
#include "srslte/phy/phch/pdcch.h"
|
||||
#include "srslte/phy/phch/pdsch.h"
|
||||
#include "srslte/phy/phch/pdsch_cfg.h"
|
||||
#include "srslte/phy/phch/phich.h"
|
||||
#include "srslte/phy/phch/pmch.h"
|
||||
#include "srslte/phy/phch/ra.h"
|
||||
#include "srslte/phy/phch/regs.h"
|
||||
#include "srslte/phy/sync/pss.h"
|
||||
#include "srslte/phy/sync/sss.h"
|
||||
|
||||
#include "srslte/phy/enb/enb_ul.h"
|
||||
#include "srslte/phy/ue/ue_dl.h"
|
||||
|
||||
#include "srslte/phy/utils/debug.h"
|
||||
#include "srslte/phy/utils/vector.h"
|
||||
|
||||
#include "srslte/config.h"
|
||||
|
||||
typedef struct SRSLTE_API {
|
||||
srslte_cell_t cell;
|
||||
|
||||
srslte_dl_sf_cfg_t dl_sf;
|
||||
|
||||
cf_t* sf_symbols[SRSLTE_MAX_PORTS];
|
||||
|
||||
srslte_ofdm_t ifft[SRSLTE_MAX_PORTS];
|
||||
srslte_ofdm_t ifft_mbsfn;
|
||||
|
||||
srslte_pbch_t pbch;
|
||||
srslte_pcfich_t pcfich;
|
||||
srslte_regs_t regs;
|
||||
srslte_pdcch_t pdcch;
|
||||
srslte_pdsch_t pdsch;
|
||||
srslte_pmch_t pmch;
|
||||
srslte_phich_t phich;
|
||||
|
||||
srslte_refsignal_t csr_signal;
|
||||
srslte_refsignal_t mbsfnr_signal;
|
||||
|
||||
cf_t pss_signal[SRSLTE_PSS_LEN];
|
||||
float sss_signal0[SRSLTE_SSS_LEN];
|
||||
float sss_signal5[SRSLTE_SSS_LEN];
|
||||
|
||||
uint32_t nof_common_locations[3];
|
||||
srslte_dci_location_t common_locations[3][SRSLTE_MAX_CANDIDATES_COM];
|
||||
|
||||
} srslte_enb_dl_t;
|
||||
|
||||
typedef struct {
|
||||
uint8_t ack;
|
||||
uint32_t n_prb_lowest;
|
||||
uint32_t n_dmrs;
|
||||
} srslte_enb_dl_phich_t;
|
||||
|
||||
/* This function shall be called just after the initial synchronization */
|
||||
SRSLTE_API int srslte_enb_dl_init(srslte_enb_dl_t* q, cf_t* out_buffer[SRSLTE_MAX_PORTS], uint32_t max_prb);
|
||||
|
||||
SRSLTE_API void srslte_enb_dl_free(srslte_enb_dl_t* q);
|
||||
|
||||
SRSLTE_API int srslte_enb_dl_set_cell(srslte_enb_dl_t* q, srslte_cell_t cell);
|
||||
|
||||
SRSLTE_API bool srslte_enb_dl_location_is_common_ncce(srslte_enb_dl_t* q, uint32_t ncce);
|
||||
|
||||
SRSLTE_API void srslte_enb_dl_put_base(srslte_enb_dl_t* q, srslte_dl_sf_cfg_t* dl_sf);
|
||||
|
||||
SRSLTE_API void srslte_enb_dl_put_phich(srslte_enb_dl_t* q, srslte_phich_grant_t* grant, bool ack);
|
||||
|
||||
SRSLTE_API int srslte_enb_dl_put_pdcch_dl(srslte_enb_dl_t* q, srslte_dci_cfg_t* dci_cfg, srslte_dci_dl_t* dci_dl);
|
||||
|
||||
SRSLTE_API int srslte_enb_dl_put_pdcch_ul(srslte_enb_dl_t* q, srslte_dci_cfg_t* dci_cfg, srslte_dci_ul_t* dci_ul);
|
||||
|
||||
SRSLTE_API int
|
||||
srslte_enb_dl_put_pdsch(srslte_enb_dl_t* q, srslte_pdsch_cfg_t* pdsch, uint8_t* data[SRSLTE_MAX_CODEWORDS]);
|
||||
|
||||
SRSLTE_API int srslte_enb_dl_put_pmch(srslte_enb_dl_t* q, srslte_pmch_cfg_t* pmch_cfg, uint8_t* data);
|
||||
|
||||
SRSLTE_API void srslte_enb_dl_gen_signal(srslte_enb_dl_t* q);
|
||||
|
||||
SRSLTE_API bool srslte_enb_dl_gen_cqi_periodic(const srslte_cell_t* cell,
|
||||
const srslte_dl_cfg_t* dl_cfg,
|
||||
uint32_t tti,
|
||||
uint32_t last_ri,
|
||||
srslte_cqi_cfg_t* cqi_cfg);
|
||||
|
||||
SRSLTE_API bool srslte_enb_dl_gen_cqi_aperiodic(const srslte_cell_t* cell,
|
||||
const srslte_dl_cfg_t* dl_cfg,
|
||||
uint32_t ri,
|
||||
srslte_cqi_cfg_t* cqi_cfg);
|
||||
|
||||
SRSLTE_API void srslte_enb_dl_save_signal(srslte_enb_dl_t* q);
|
||||
|
||||
/**
|
||||
* Generates the uplink control information configuration from the cell, subframe and HARQ ACK information. Note that
|
||||
* it expects the UCI configuration shall have been configured already with scheduling request and channel quality
|
||||
* information prior to this call.
|
||||
*
|
||||
* @param cell points to the physical layer cell parameters
|
||||
* @param sf points to the subframe configuration
|
||||
* @param ack_info is the HARQ-ACK information
|
||||
* @param uci_cfg the UCI configuration destination
|
||||
*/
|
||||
SRSLTE_API void srslte_enb_dl_gen_ack(const srslte_cell_t* cell,
|
||||
const srslte_dl_sf_cfg_t* sf,
|
||||
const srslte_pdsch_ack_t* ack_info,
|
||||
srslte_uci_cfg_t* uci_cfg);
|
||||
|
||||
/**
|
||||
* gets the HARQ-ACK values from the received Uplink Control Information configuration, the cell, and HARQ ACK
|
||||
* info itself. Note that it expects that the HARQ-ACK info has been set prior the UCI Data decoding.
|
||||
*
|
||||
* @param cell points to the physical layer cell parameters
|
||||
* @param uci_cfg points to the UCI configration
|
||||
* @param uci_value points to the received UCI values
|
||||
* @param ack_info is the HARQ-ACK information
|
||||
*/
|
||||
SRSLTE_API void srslte_enb_dl_get_ack(const srslte_cell_t* cell,
|
||||
const srslte_uci_cfg_t* uci_cfg,
|
||||
const srslte_uci_value_t* uci_value,
|
||||
srslte_pdsch_ack_t* pdsch_ack);
|
||||
|
||||
/**
|
||||
* Gets the maximum signal power in decibels full scale. It is equivalent to the transmit power if all resource elements
|
||||
* were populated.
|
||||
* @return The maximum power
|
||||
*/
|
||||
SRSLTE_API float srslte_enb_dl_get_maximum_signal_power_dBfs(uint32_t nof_prb);
|
||||
|
||||
#endif // SRSLTE_ENB_DL_H
|
|
@ -1,67 +0,0 @@
|
|||
/**
|
||||
*
|
||||
* \section COPYRIGHT
|
||||
*
|
||||
* Copyright 2013-2020 Software Radio Systems Limited
|
||||
*
|
||||
* By using this file, you agree to the terms and conditions set
|
||||
* forth in the LICENSE file which can be found at the top level of
|
||||
* the distribution.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef SRSLTE_ENB_DL_NR_H
|
||||
#define SRSLTE_ENB_DL_NR_H
|
||||
|
||||
#include "srslte/phy/common/phy_common_nr.h"
|
||||
#include "srslte/phy/dft/ofdm.h"
|
||||
#include "srslte/phy/phch/pdcch_nr.h"
|
||||
#include "srslte/phy/phch/pdsch_nr.h"
|
||||
|
||||
typedef struct SRSLTE_API {
|
||||
srslte_pdsch_nr_args_t pdsch;
|
||||
srslte_pdcch_nr_args_t pdcch;
|
||||
uint32_t nof_tx_antennas;
|
||||
uint32_t nof_max_prb;
|
||||
} srslte_enb_dl_nr_args_t;
|
||||
|
||||
typedef struct SRSLTE_API {
|
||||
uint32_t max_prb;
|
||||
uint32_t nof_tx_antennas;
|
||||
srslte_carrier_nr_t carrier;
|
||||
srslte_coreset_t coreset;
|
||||
|
||||
srslte_ofdm_t fft[SRSLTE_MAX_PORTS];
|
||||
|
||||
cf_t* sf_symbols[SRSLTE_MAX_PORTS];
|
||||
srslte_pdsch_nr_t pdsch;
|
||||
srslte_dmrs_sch_t dmrs;
|
||||
|
||||
srslte_pdcch_nr_t pdcch;
|
||||
} srslte_enb_dl_nr_t;
|
||||
|
||||
SRSLTE_API int
|
||||
srslte_enb_dl_nr_init(srslte_enb_dl_nr_t* q, cf_t* output[SRSLTE_MAX_PORTS], const srslte_enb_dl_nr_args_t* args);
|
||||
|
||||
SRSLTE_API int srslte_enb_dl_nr_set_carrier(srslte_enb_dl_nr_t* q, const srslte_carrier_nr_t* carrier);
|
||||
|
||||
SRSLTE_API int srslte_enb_dl_nr_set_coreset(srslte_enb_dl_nr_t* q, const srslte_coreset_t* coreset);
|
||||
|
||||
SRSLTE_API void srslte_enb_dl_nr_free(srslte_enb_dl_nr_t* q);
|
||||
|
||||
SRSLTE_API int srslte_enb_dl_nr_base_zero(srslte_enb_dl_nr_t* q);
|
||||
|
||||
SRSLTE_API void srslte_enb_dl_nr_gen_signal(srslte_enb_dl_nr_t* q);
|
||||
|
||||
SRSLTE_API int
|
||||
srslte_enb_dl_nr_pdcch_put(srslte_enb_dl_nr_t* q, const srslte_slot_cfg_t* slot_cfg, const srslte_dci_dl_nr_t* dci_dl);
|
||||
|
||||
SRSLTE_API int srslte_enb_dl_nr_pdsch_put(srslte_enb_dl_nr_t* q,
|
||||
const srslte_slot_cfg_t* slot,
|
||||
const srslte_sch_cfg_nr_t* cfg,
|
||||
uint8_t* data[SRSLTE_MAX_TB]);
|
||||
|
||||
SRSLTE_API int
|
||||
srslte_enb_dl_nr_pdsch_info(const srslte_enb_dl_nr_t* q, const srslte_sch_cfg_nr_t* cfg, char* str, uint32_t str_len);
|
||||
|
||||
#endif // SRSLTE_ENB_DL_NR_H
|
|
@ -1,78 +0,0 @@
|
|||
/**
|
||||
*
|
||||
* \section COPYRIGHT
|
||||
*
|
||||
* Copyright 2013-2020 Software Radio Systems Limited
|
||||
*
|
||||
* By using this file, you agree to the terms and conditions set
|
||||
* forth in the LICENSE file which can be found at the top level of
|
||||
* the distribution.
|
||||
*
|
||||
*/
|
||||
|
||||
/******************************************************************************
|
||||
* File: enb_ul.h
|
||||
*
|
||||
* Description: ENB uplink object.
|
||||
*
|
||||
* This module is a frontend to all the uplink data and control
|
||||
* channel processing modules for the ENB receiver side.
|
||||
*
|
||||
* Reference:
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef SRSLTE_ENB_UL_H
|
||||
#define SRSLTE_ENB_UL_H
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
#include "srslte/phy/ch_estimation/chest_ul.h"
|
||||
#include "srslte/phy/common/phy_common.h"
|
||||
#include "srslte/phy/dft/ofdm.h"
|
||||
#include "srslte/phy/phch/prach.h"
|
||||
#include "srslte/phy/phch/pucch.h"
|
||||
#include "srslte/phy/phch/pusch.h"
|
||||
#include "srslte/phy/phch/pusch_cfg.h"
|
||||
#include "srslte/phy/phch/ra.h"
|
||||
|
||||
#include "srslte/phy/utils/debug.h"
|
||||
#include "srslte/phy/utils/vector.h"
|
||||
|
||||
#include "srslte/config.h"
|
||||
|
||||
typedef struct SRSLTE_API {
|
||||
srslte_cell_t cell;
|
||||
|
||||
cf_t* sf_symbols;
|
||||
srslte_chest_ul_res_t chest_res;
|
||||
|
||||
srslte_ofdm_t fft;
|
||||
srslte_chest_ul_t chest;
|
||||
srslte_pusch_t pusch;
|
||||
srslte_pucch_t pucch;
|
||||
|
||||
} srslte_enb_ul_t;
|
||||
|
||||
/* This function shall be called just after the initial synchronization */
|
||||
SRSLTE_API int srslte_enb_ul_init(srslte_enb_ul_t* q, cf_t* in_buffer, uint32_t max_prb);
|
||||
|
||||
SRSLTE_API void srslte_enb_ul_free(srslte_enb_ul_t* q);
|
||||
|
||||
SRSLTE_API int srslte_enb_ul_set_cell(srslte_enb_ul_t* q,
|
||||
srslte_cell_t cell,
|
||||
srslte_refsignal_dmrs_pusch_cfg_t* pusch_cfg,
|
||||
srslte_refsignal_srs_cfg_t* srs_cfg);
|
||||
|
||||
SRSLTE_API void srslte_enb_ul_fft(srslte_enb_ul_t* q);
|
||||
|
||||
SRSLTE_API int srslte_enb_ul_get_pucch(srslte_enb_ul_t* q,
|
||||
srslte_ul_sf_cfg_t* ul_sf,
|
||||
srslte_pucch_cfg_t* cfg,
|
||||
srslte_pucch_res_t* res);
|
||||
|
||||
SRSLTE_API int srslte_enb_ul_get_pusch(srslte_enb_ul_t* q,
|
||||
srslte_ul_sf_cfg_t* ul_sf,
|
||||
srslte_pusch_cfg_t* cfg,
|
||||
srslte_pusch_res_t* res);
|
||||
|
||||
#endif // SRSLTE_ENB_UL_H
|
|
@ -1,114 +0,0 @@
|
|||
/**
|
||||
*
|
||||
* \section COPYRIGHT
|
||||
*
|
||||
* Copyright 2013-2020 Software Radio Systems Limited
|
||||
*
|
||||
* By using this file, you agree to the terms and conditions set
|
||||
* forth in the LICENSE file which can be found at the top level of
|
||||
* the distribution.
|
||||
*
|
||||
*/
|
||||
|
||||
/**********************************************************************************************
|
||||
* File: turbodecoder.h
|
||||
*
|
||||
* Description: Turbo Decoder.
|
||||
* Parallel Concatenated Convolutional Code (PCCC) with two 8-state constituent
|
||||
* encoders and one turbo code internal interleaver. The coding rate of turbo
|
||||
* encoder is 1/3.
|
||||
* MAP_GEN is the MAX-LOG-MAP generic implementation of the decoder.
|
||||
*
|
||||
* Reference: 3GPP TS 36.212 version 10.0.0 Release 10 Sec. 5.1.3.2
|
||||
*********************************************************************************************/
|
||||
|
||||
#ifndef SRSLTE_TURBODECODER_H
|
||||
#define SRSLTE_TURBODECODER_H
|
||||
|
||||
#include "srslte/config.h"
|
||||
#include "srslte/phy/fec/cbsegm.h"
|
||||
#include "srslte/phy/fec/turbo/tc_interl.h"
|
||||
|
||||
#define SRSLTE_TCOD_RATE 3
|
||||
#define SRSLTE_TCOD_TOTALTAIL 12
|
||||
|
||||
#define SRSLTE_TCOD_MAX_LEN_CB 6144
|
||||
|
||||
// Expect the input to be aligned for sub-block window processing.
|
||||
#define SRSLTE_TDEC_EXPECT_INPUT_SB 1
|
||||
|
||||
// Include interfaces for 8 and 16 bit decoder implementations
|
||||
#define LLR_IS_8BIT
|
||||
#include "srslte/phy/fec/turbo/turbodecoder_impl.h"
|
||||
#undef LLR_IS_8BIT
|
||||
|
||||
#define LLR_IS_16BIT
|
||||
#include "srslte/phy/fec/turbo/turbodecoder_impl.h"
|
||||
#undef LLR_IS_16BIT
|
||||
|
||||
#define SRSLTE_TDEC_NOF_AUTO_MODES_8 2
|
||||
#define SRSLTE_TDEC_NOF_AUTO_MODES_16 3
|
||||
|
||||
typedef enum { SRSLTE_TDEC_8, SRSLTE_TDEC_16 } srslte_tdec_llr_type_t;
|
||||
|
||||
typedef struct SRSLTE_API {
|
||||
uint32_t max_long_cb;
|
||||
|
||||
void* dec8_hdlr[SRSLTE_TDEC_NOF_AUTO_MODES_8];
|
||||
void* dec16_hdlr[SRSLTE_TDEC_NOF_AUTO_MODES_16];
|
||||
srslte_tdec_8bit_impl_t* dec8[SRSLTE_TDEC_NOF_AUTO_MODES_8];
|
||||
srslte_tdec_16bit_impl_t* dec16[SRSLTE_TDEC_NOF_AUTO_MODES_16];
|
||||
int nof_blocks8[SRSLTE_TDEC_NOF_AUTO_MODES_8];
|
||||
int nof_blocks16[SRSLTE_TDEC_NOF_AUTO_MODES_16];
|
||||
|
||||
// Declare as void types as can be int8 or int16
|
||||
void* app1;
|
||||
void* app2;
|
||||
void* ext1;
|
||||
void* ext2;
|
||||
void* syst0;
|
||||
void* parity0;
|
||||
void* parity1;
|
||||
|
||||
void* input_conv;
|
||||
|
||||
bool force_not_sb;
|
||||
|
||||
srslte_tdec_impl_type_t dec_type;
|
||||
|
||||
srslte_tdec_llr_type_t current_llr_type;
|
||||
uint32_t current_dec;
|
||||
uint32_t current_long_cb;
|
||||
uint32_t current_inter_idx;
|
||||
int current_cbidx;
|
||||
srslte_tc_interl_t interleaver[4][SRSLTE_NOF_TC_CB_SIZES];
|
||||
int n_iter;
|
||||
} srslte_tdec_t;
|
||||
|
||||
SRSLTE_API int srslte_tdec_init(srslte_tdec_t* h, uint32_t max_long_cb);
|
||||
|
||||
SRSLTE_API int srslte_tdec_init_manual(srslte_tdec_t* h, uint32_t max_long_cb, srslte_tdec_impl_type_t dec_type);
|
||||
|
||||
SRSLTE_API void srslte_tdec_free(srslte_tdec_t* h);
|
||||
|
||||
SRSLTE_API void srslte_tdec_force_not_sb(srslte_tdec_t* h);
|
||||
|
||||
SRSLTE_API int srslte_tdec_new_cb(srslte_tdec_t* h, uint32_t long_cb);
|
||||
|
||||
SRSLTE_API int srslte_tdec_get_nof_iterations(srslte_tdec_t* h);
|
||||
|
||||
SRSLTE_API uint32_t srslte_tdec_autoimp_get_subblocks(uint32_t long_cb);
|
||||
|
||||
SRSLTE_API uint32_t srslte_tdec_autoimp_get_subblocks_8bit(uint32_t long_cb);
|
||||
|
||||
SRSLTE_API void srslte_tdec_iteration(srslte_tdec_t* h, int16_t* input, uint8_t* output);
|
||||
|
||||
SRSLTE_API int
|
||||
srslte_tdec_run_all(srslte_tdec_t* h, int16_t* input, uint8_t* output, uint32_t nof_iterations, uint32_t long_cb);
|
||||
|
||||
SRSLTE_API void srslte_tdec_iteration_8bit(srslte_tdec_t* h, int8_t* input, uint8_t* output);
|
||||
|
||||
SRSLTE_API int
|
||||
srslte_tdec_run_all_8bit(srslte_tdec_t* h, int8_t* input, uint8_t* output, uint32_t nof_iterations, uint32_t long_cb);
|
||||
|
||||
#endif // SRSLTE_TURBODECODER_H
|
|
@ -1,26 +0,0 @@
|
|||
/**
|
||||
*
|
||||
* \section COPYRIGHT
|
||||
*
|
||||
* Copyright 2013-2020 Software Radio Systems Limited
|
||||
*
|
||||
* By using this file, you agree to the terms and conditions set
|
||||
* forth in the LICENSE file which can be found at the top level of
|
||||
* the distribution.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef SRSLTE_FORMAT_H
|
||||
#define SRSLTE_FORMAT_H
|
||||
|
||||
typedef enum {
|
||||
SRSLTE_TEXT,
|
||||
SRSLTE_FLOAT,
|
||||
SRSLTE_COMPLEX_FLOAT,
|
||||
SRSLTE_COMPLEX_SHORT,
|
||||
SRSLTE_FLOAT_BIN,
|
||||
SRSLTE_COMPLEX_FLOAT_BIN,
|
||||
SRSLTE_COMPLEX_SHORT_BIN
|
||||
} srslte_datatype_t;
|
||||
|
||||
#endif // SRSLTE_FORMAT_H
|
|
@ -1,243 +0,0 @@
|
|||
/**
|
||||
*
|
||||
* \section COPYRIGHT
|
||||
*
|
||||
* Copyright 2013-2020 Software Radio Systems Limited
|
||||
*
|
||||
* By using this file, you agree to the terms and conditions set
|
||||
* forth in the LICENSE file which can be found at the top level of
|
||||
* the distribution.
|
||||
*
|
||||
*/
|
||||
|
||||
/******************************************************************************
|
||||
* File: dci.h
|
||||
*
|
||||
* Description: Downlink control information (DCI).
|
||||
* Packing/Unpacking functions to convert between bit streams
|
||||
* and packed DCI UL/DL grants defined in ra.h
|
||||
*
|
||||
* Reference: 3GPP TS 36.212 version 10.0.0 Release 10 Sec. 5.3.3
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef SRSLTE_DCI_H
|
||||
#define SRSLTE_DCI_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "srslte/config.h"
|
||||
#include "srslte/phy/common/phy_common.h"
|
||||
#include "srslte/phy/phch/ra.h"
|
||||
|
||||
#define SRSLTE_DCI_MAX_BITS 128
|
||||
#define SRSLTE_RAR_GRANT_LEN 20
|
||||
|
||||
#define SRSLTE_DCI_IS_TB_EN(tb) (!(tb.mcs_idx == 0 && tb.rv == 1))
|
||||
#define SRSLTE_DCI_TB_DISABLE(tb) \
|
||||
do { \
|
||||
tb.mcs_idx = 0; \
|
||||
tb.rv = 1; \
|
||||
} while (0)
|
||||
#define SRSLTE_DCI_HEXDEBUG 0
|
||||
|
||||
typedef struct {
|
||||
bool multiple_csi_request_enabled;
|
||||
bool cif_enabled;
|
||||
bool cif_present;
|
||||
bool srs_request_enabled;
|
||||
bool ra_format_enabled;
|
||||
bool is_not_ue_ss;
|
||||
} srslte_dci_cfg_t;
|
||||
|
||||
typedef struct SRSLTE_API {
|
||||
uint32_t L; // Aggregation level (logarithmic)
|
||||
uint32_t ncce; // Position of first CCE of the dci
|
||||
} srslte_dci_location_t;
|
||||
|
||||
typedef struct SRSLTE_API {
|
||||
uint8_t payload[SRSLTE_DCI_MAX_BITS];
|
||||
uint32_t nof_bits;
|
||||
srslte_dci_location_t location;
|
||||
srslte_dci_format_t format;
|
||||
uint16_t rnti;
|
||||
} srslte_dci_msg_t;
|
||||
|
||||
typedef struct SRSLTE_API {
|
||||
uint32_t mcs_idx;
|
||||
int rv;
|
||||
bool ndi;
|
||||
uint32_t cw_idx;
|
||||
} srslte_dci_tb_t;
|
||||
|
||||
typedef struct SRSLTE_API {
|
||||
|
||||
uint16_t rnti;
|
||||
srslte_dci_format_t format;
|
||||
srslte_dci_location_t location;
|
||||
uint32_t ue_cc_idx;
|
||||
|
||||
// Resource Allocation
|
||||
srslte_ra_type_t alloc_type;
|
||||
union {
|
||||
srslte_ra_type0_t type0_alloc;
|
||||
srslte_ra_type1_t type1_alloc;
|
||||
srslte_ra_type2_t type2_alloc;
|
||||
};
|
||||
|
||||
// Codeword information
|
||||
srslte_dci_tb_t tb[SRSLTE_MAX_CODEWORDS];
|
||||
bool tb_cw_swap;
|
||||
uint32_t pinfo;
|
||||
|
||||
// Power control
|
||||
bool pconf;
|
||||
bool power_offset;
|
||||
uint8_t tpc_pucch;
|
||||
|
||||
// RA order
|
||||
bool is_ra_order;
|
||||
uint32_t ra_preamble;
|
||||
uint32_t ra_mask_idx;
|
||||
|
||||
// Release 10
|
||||
uint32_t cif;
|
||||
bool cif_present;
|
||||
bool srs_request;
|
||||
bool srs_request_present;
|
||||
|
||||
// Other parameters
|
||||
uint32_t pid;
|
||||
uint32_t dai;
|
||||
bool is_tdd;
|
||||
bool is_dwpts;
|
||||
bool sram_id;
|
||||
|
||||
// For debugging purposes
|
||||
#if SRSLTE_DCI_HEXDEBUG
|
||||
uint32_t nof_bits;
|
||||
char hex_str[SRSLTE_DCI_MAX_BITS];
|
||||
#endif
|
||||
} srslte_dci_dl_t;
|
||||
|
||||
/** Unpacked DCI Format0 message */
|
||||
typedef struct SRSLTE_API {
|
||||
|
||||
uint16_t rnti;
|
||||
srslte_dci_format_t format;
|
||||
srslte_dci_location_t location;
|
||||
uint32_t ue_cc_idx;
|
||||
|
||||
srslte_ra_type2_t type2_alloc;
|
||||
/* 36.213 Table 8.4-2: SRSLTE_RA_PUSCH_HOP_HALF is 0 for < 10 Mhz and 10 for > 10 Mhz.
|
||||
* SRSLTE_RA_PUSCH_HOP_QUART is 00 for > 10 Mhz and SRSLTE_RA_PUSCH_HOP_QUART_NEG is 01 for > 10 Mhz.
|
||||
*/
|
||||
enum {
|
||||
SRSLTE_RA_PUSCH_HOP_DISABLED = -1,
|
||||
SRSLTE_RA_PUSCH_HOP_QUART = 0,
|
||||
SRSLTE_RA_PUSCH_HOP_QUART_NEG = 1,
|
||||
SRSLTE_RA_PUSCH_HOP_HALF = 2,
|
||||
SRSLTE_RA_PUSCH_HOP_TYPE2 = 3
|
||||
} freq_hop_fl;
|
||||
|
||||
// Codeword information
|
||||
srslte_dci_tb_t tb;
|
||||
uint32_t n_dmrs;
|
||||
bool cqi_request;
|
||||
|
||||
// TDD parametres
|
||||
uint32_t dai;
|
||||
uint32_t ul_idx;
|
||||
bool is_tdd;
|
||||
|
||||
// Power control
|
||||
uint8_t tpc_pusch;
|
||||
|
||||
// Release 10
|
||||
uint32_t cif;
|
||||
bool cif_present;
|
||||
uint8_t multiple_csi_request;
|
||||
bool multiple_csi_request_present;
|
||||
bool srs_request;
|
||||
bool srs_request_present;
|
||||
srslte_ra_type_t ra_type;
|
||||
bool ra_type_present;
|
||||
|
||||
// For debugging purposes
|
||||
#if SRSLTE_DCI_HEXDEBUG
|
||||
uint32_t nof_bits;
|
||||
char hex_str[SRSLTE_DCI_MAX_BITS];
|
||||
#endif /* SRSLTE_DCI_HEXDEBUG */
|
||||
|
||||
} srslte_dci_ul_t;
|
||||
|
||||
typedef struct SRSLTE_API {
|
||||
uint32_t rba;
|
||||
uint32_t trunc_mcs;
|
||||
uint32_t tpc_pusch;
|
||||
bool ul_delay;
|
||||
bool cqi_request;
|
||||
bool hopping_flag;
|
||||
} srslte_dci_rar_grant_t;
|
||||
|
||||
SRSLTE_API void srslte_dci_rar_unpack(uint8_t payload[SRSLTE_RAR_GRANT_LEN], srslte_dci_rar_grant_t* rar);
|
||||
|
||||
SRSLTE_API void srslte_dci_rar_pack(srslte_dci_rar_grant_t* rar, uint8_t payload[SRSLTE_RAR_GRANT_LEN]);
|
||||
|
||||
SRSLTE_API int srslte_dci_rar_to_ul_dci(srslte_cell_t* cell, srslte_dci_rar_grant_t* rar, srslte_dci_ul_t* dci_ul);
|
||||
|
||||
SRSLTE_API int srslte_dci_msg_pack_pusch(srslte_cell_t* cell,
|
||||
srslte_dl_sf_cfg_t* sf,
|
||||
srslte_dci_cfg_t* cfg,
|
||||
srslte_dci_ul_t* dci,
|
||||
srslte_dci_msg_t* msg);
|
||||
|
||||
SRSLTE_API int srslte_dci_msg_unpack_pusch(srslte_cell_t* cell,
|
||||
srslte_dl_sf_cfg_t* sf,
|
||||
srslte_dci_cfg_t* cfg,
|
||||
srslte_dci_msg_t* msg,
|
||||
srslte_dci_ul_t* dci);
|
||||
|
||||
SRSLTE_API int srslte_dci_msg_pack_pdsch(srslte_cell_t* cell,
|
||||
srslte_dl_sf_cfg_t* sf,
|
||||
srslte_dci_cfg_t* cfg,
|
||||
srslte_dci_dl_t* dci,
|
||||
srslte_dci_msg_t* msg);
|
||||
|
||||
SRSLTE_API int srslte_dci_msg_unpack_pdsch(srslte_cell_t* cell,
|
||||
srslte_dl_sf_cfg_t* sf,
|
||||
srslte_dci_cfg_t* cfg,
|
||||
srslte_dci_msg_t* msg,
|
||||
srslte_dci_dl_t* dci);
|
||||
|
||||
SRSLTE_API uint32_t srslte_dci_format_sizeof(const srslte_cell_t* cell,
|
||||
srslte_dl_sf_cfg_t* sf,
|
||||
srslte_dci_cfg_t* cfg,
|
||||
srslte_dci_format_t format);
|
||||
|
||||
SRSLTE_API void srslte_dci_dl_fprint(FILE* f, srslte_dci_dl_t* dci, uint32_t nof_prb);
|
||||
|
||||
SRSLTE_API uint32_t srslte_dci_dl_info(const srslte_dci_dl_t* dci_dl, char* str, uint32_t str_len);
|
||||
|
||||
SRSLTE_API uint32_t srslte_dci_ul_info(srslte_dci_ul_t* dci_ul, char* info_str, uint32_t len);
|
||||
|
||||
SRSLTE_API srslte_dci_format_t srslte_dci_format_from_string(char* str);
|
||||
|
||||
SRSLTE_API char* srslte_dci_format_string(srslte_dci_format_t format);
|
||||
|
||||
SRSLTE_API char* srslte_dci_format_string_short(srslte_dci_format_t format);
|
||||
|
||||
SRSLTE_API bool
|
||||
srslte_location_find(const srslte_dci_location_t* locations, uint32_t nof_locations, srslte_dci_location_t x);
|
||||
|
||||
SRSLTE_API bool
|
||||
srslte_location_find_ncce(const srslte_dci_location_t* locations, uint32_t nof_locations, uint32_t ncce);
|
||||
|
||||
SRSLTE_API int srslte_dci_location_set(srslte_dci_location_t* c, uint32_t L, uint32_t nCCE);
|
||||
|
||||
SRSLTE_API bool srslte_dci_location_isvalid(srslte_dci_location_t* c);
|
||||
|
||||
SRSLTE_API void srslte_dci_cfg_set_common_ss(srslte_dci_cfg_t* cfg);
|
||||
|
||||
SRSLTE_API uint32_t srslte_dci_format_max_tb(srslte_dci_format_t format);
|
||||
|
||||
#endif // DCI_
|
|
@ -1,74 +0,0 @@
|
|||
/**
|
||||
*
|
||||
* \section COPYRIGHT
|
||||
*
|
||||
* Copyright 2013-2020 Software Radio Systems Limited
|
||||
*
|
||||
* By using this file, you agree to the terms and conditions set
|
||||
* forth in the LICENSE file which can be found at the top level of
|
||||
* the distribution.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
* @file dci_nbiot.h
|
||||
*
|
||||
* @brief Downlink control information (DCI) for NB-IoT.
|
||||
*
|
||||
* Packing/Unpacking functions to convert between bit streams
|
||||
* and packed DCI UL/DL grants defined in ra_nbiot.h
|
||||
*
|
||||
* Reference: 3GPP TS 36.212 version 13.2.0 Release 13 Sec. 6.4.3
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef SRSLTE_DCI_NBIOT_H
|
||||
#define SRSLTE_DCI_NBIOT_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "srslte/config.h"
|
||||
#include "srslte/phy/common/phy_common.h"
|
||||
#include "srslte/phy/phch/dci.h"
|
||||
#include "srslte/phy/phch/ra_nbiot.h"
|
||||
|
||||
#define SRSLTE_DCI_MAX_BITS 128
|
||||
#define SRSLTE_NBIOT_RAR_GRANT_LEN 15
|
||||
|
||||
SRSLTE_API void srslte_nbiot_dci_rar_grant_unpack(srslte_nbiot_dci_rar_grant_t* rar,
|
||||
const uint8_t grant[SRSLTE_NBIOT_RAR_GRANT_LEN]);
|
||||
|
||||
SRSLTE_API int srslte_nbiot_dci_msg_to_dl_grant(const srslte_dci_msg_t* msg,
|
||||
const uint16_t msg_rnti,
|
||||
srslte_ra_nbiot_dl_dci_t* dl_dci,
|
||||
srslte_ra_nbiot_dl_grant_t* grant,
|
||||
const uint32_t sfn,
|
||||
const uint32_t sf_idx,
|
||||
const uint32_t r_max,
|
||||
const srslte_nbiot_mode_t mode);
|
||||
|
||||
SRSLTE_API int srslte_nbiot_dci_msg_to_ul_grant(const srslte_dci_msg_t* msg,
|
||||
srslte_ra_nbiot_ul_dci_t* ul_dci,
|
||||
srslte_ra_nbiot_ul_grant_t* grant,
|
||||
const uint32_t rx_tti,
|
||||
const srslte_npusch_sc_spacing_t spacing);
|
||||
|
||||
SRSLTE_API int
|
||||
srslte_nbiot_dci_rar_to_ul_grant(srslte_nbiot_dci_rar_grant_t* rar, srslte_ra_nbiot_ul_grant_t* grant, uint32_t rx_tti);
|
||||
|
||||
SRSLTE_API bool srslte_nbiot_dci_location_isvalid(const srslte_dci_location_t* c);
|
||||
|
||||
SRSLTE_API int srslte_dci_msg_pack_npdsch(const srslte_ra_nbiot_dl_dci_t* data,
|
||||
const srslte_dci_format_t format,
|
||||
srslte_dci_msg_t* msg,
|
||||
const bool crc_is_crnti);
|
||||
|
||||
SRSLTE_API int
|
||||
srslte_dci_msg_unpack_npdsch(const srslte_dci_msg_t* msg, srslte_ra_nbiot_dl_dci_t* data, const bool crc_is_crnti);
|
||||
|
||||
SRSLTE_API int srslte_dci_msg_unpack_npusch(const srslte_dci_msg_t* msg, srslte_ra_nbiot_ul_dci_t* data);
|
||||
|
||||
SRSLTE_API uint32_t srslte_dci_nbiot_format_sizeof(srslte_dci_format_t format);
|
||||
|
||||
#endif // SRSLTE_DCI_NBIOT_H
|
|
@ -1,143 +0,0 @@
|
|||
/**
|
||||
*
|
||||
* \section COPYRIGHT
|
||||
*
|
||||
* Copyright 2013-2020 Software Radio Systems Limited
|
||||
*
|
||||
* By using this file, you agree to the terms and conditions set
|
||||
* forth in the LICENSE file which can be found at the top level of
|
||||
* the distribution.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef SRSLTE_NPBCH_H
|
||||
#define SRSLTE_NPBCH_H
|
||||
|
||||
#include "srslte/config.h"
|
||||
#include "srslte/phy/common/phy_common.h"
|
||||
|
||||
#include "srslte/phy/fec/convolutional/convcoder.h"
|
||||
#include "srslte/phy/fec/convolutional/rm_conv.h"
|
||||
#include "srslte/phy/fec/convolutional/viterbi.h"
|
||||
#include "srslte/phy/fec/crc.h"
|
||||
#include "srslte/phy/mimo/layermap.h"
|
||||
#include "srslte/phy/mimo/precoding.h"
|
||||
#include "srslte/phy/modem/demod_soft.h"
|
||||
#include "srslte/phy/modem/mod.h"
|
||||
#include "srslte/phy/scrambling/scrambling.h"
|
||||
|
||||
#define SRSLTE_MIB_NB_LEN 34
|
||||
#define SRSLTE_MIB_NB_CRC_LEN (SRSLTE_MIB_NB_LEN + 16)
|
||||
#define SRSLTE_MIB_NB_ENC_LEN (3 * SRSLTE_MIB_NB_CRC_LEN)
|
||||
|
||||
#define SRSLTE_NPBCH_NUM_RE (12 * 11 - 4 * 8) // 100 RE, entire PRB minus 3 symbols minus 4 times NRS=CRS REs
|
||||
#define SRSLTE_NPBCH_NUM_BLOCKS 8 // MIB-NB is split across 8 blocks
|
||||
#define SRSLTE_NPBCH_NUM_REP 8 // number of repetitions per block
|
||||
#define SRSLTE_NPBCH_NUM_FRAMES (SRSLTE_NPBCH_NUM_BLOCKS * SRSLTE_NPBCH_NUM_REP)
|
||||
|
||||
typedef struct {
|
||||
uint16_t sfn;
|
||||
uint16_t hfn;
|
||||
uint8_t sched_info_sib1;
|
||||
uint8_t sys_info_tag;
|
||||
bool ac_barring;
|
||||
srslte_nbiot_mode_t mode;
|
||||
} srslte_mib_nb_t;
|
||||
|
||||
/**
|
||||
* \brief Narrowband Physical broadcast channel (NPBCH)
|
||||
*
|
||||
* Reference: 3GPP TS 36.211 version 13.2.0 Release 13 Sec. 10.2.4
|
||||
*/
|
||||
typedef struct SRS_API {
|
||||
srslte_nbiot_cell_t cell;
|
||||
|
||||
uint32_t frame_idx;
|
||||
uint32_t nof_symbols;
|
||||
|
||||
// buffers
|
||||
cf_t* ce[SRSLTE_MAX_PORTS];
|
||||
cf_t* symbols[SRSLTE_MAX_PORTS];
|
||||
cf_t* x[SRSLTE_MAX_PORTS];
|
||||
cf_t* d;
|
||||
float* llr;
|
||||
float* temp;
|
||||
float rm_f[SRSLTE_MIB_NB_ENC_LEN];
|
||||
uint8_t* rm_b;
|
||||
uint8_t data[SRSLTE_MIB_NB_CRC_LEN];
|
||||
uint8_t data_enc[SRSLTE_MIB_NB_ENC_LEN];
|
||||
|
||||
srslte_nbiot_mode_t op_mode;
|
||||
|
||||
// tx & rx objects
|
||||
srslte_modem_table_t mod;
|
||||
srslte_sequence_t seq;
|
||||
srslte_sequence_t seq_r14[SRSLTE_NPBCH_NUM_BLOCKS];
|
||||
srslte_viterbi_t decoder;
|
||||
srslte_crc_t crc;
|
||||
srslte_convcoder_t encoder;
|
||||
bool search_all_ports;
|
||||
} srslte_npbch_t;
|
||||
|
||||
SRSLTE_API int srslte_npbch_init(srslte_npbch_t* q);
|
||||
|
||||
SRSLTE_API void srslte_npbch_free(srslte_npbch_t* q);
|
||||
|
||||
SRSLTE_API int srslte_npbch_set_cell(srslte_npbch_t* q, srslte_nbiot_cell_t cell);
|
||||
|
||||
SRSLTE_API void srslte_npbch_mib_pack(uint32_t sfn, uint32_t hfn, srslte_mib_nb_t mib, uint8_t* msg);
|
||||
|
||||
SRSLTE_API void srslte_npbch_mib_unpack(uint8_t* msg, srslte_mib_nb_t* mib);
|
||||
|
||||
SRSLTE_API void srslte_mib_nb_printf(FILE* stream, srslte_nbiot_cell_t cell, srslte_mib_nb_t* mib);
|
||||
|
||||
SRSLTE_API int srslte_npbch_put_subframe(srslte_npbch_t* q,
|
||||
uint8_t bch_payload[SRSLTE_MIB_NB_LEN],
|
||||
cf_t* sf[SRSLTE_MAX_PORTS],
|
||||
uint32_t frame_idx);
|
||||
|
||||
SRSLTE_API int srslte_npbch_encode(srslte_npbch_t* q,
|
||||
uint8_t bch_payload[SRSLTE_MIB_NB_LEN],
|
||||
cf_t* sf[SRSLTE_MAX_PORTS],
|
||||
uint32_t frame_idx);
|
||||
|
||||
int srslte_npbch_rotate(srslte_npbch_t* q,
|
||||
uint32_t nf,
|
||||
cf_t* input_signal,
|
||||
cf_t* output_signal,
|
||||
int num_samples,
|
||||
bool back);
|
||||
|
||||
SRSLTE_API int srslte_npbch_decode(srslte_npbch_t* q,
|
||||
cf_t* slot1_symbols,
|
||||
cf_t* ce[SRSLTE_MAX_PORTS],
|
||||
float noise_estimate,
|
||||
uint8_t bch_payload[SRSLTE_MIB_NB_LEN],
|
||||
uint32_t* nof_tx_ports,
|
||||
int* sfn_offset);
|
||||
|
||||
SRSLTE_API int srslte_npbch_decode_nf(srslte_npbch_t* q,
|
||||
cf_t* slot1_symbols,
|
||||
cf_t* ce[SRSLTE_MAX_PORTS],
|
||||
float noise_estimate,
|
||||
uint8_t bch_payload[SRSLTE_MIB_NB_LEN],
|
||||
uint32_t* nof_tx_ports,
|
||||
int* sfn_offset,
|
||||
int nf);
|
||||
|
||||
SRSLTE_API void srslte_npbch_decode_reset(srslte_npbch_t* q);
|
||||
|
||||
SRSLTE_API int srslte_npbch_decode_frame(srslte_npbch_t* q,
|
||||
uint32_t src,
|
||||
uint32_t dst,
|
||||
uint32_t n,
|
||||
uint32_t nof_bits,
|
||||
uint32_t nof_ports);
|
||||
|
||||
SRSLTE_API uint32_t srslte_npbch_crc_check(srslte_npbch_t* q, uint8_t* bits, uint32_t nof_ports);
|
||||
|
||||
SRSLTE_API void srslte_npbch_crc_set_mask(uint8_t* data, int nof_ports);
|
||||
|
||||
SRSLTE_API int srslte_npbch_cp(cf_t* input, cf_t* output, srslte_nbiot_cell_t cell, bool put);
|
||||
|
||||
#endif // SRSLTE_NPBCH_H
|
|
@ -1,124 +0,0 @@
|
|||
/**
|
||||
*
|
||||
* \section COPYRIGHT
|
||||
*
|
||||
* Copyright 2013-2020 Software Radio Systems Limited
|
||||
*
|
||||
* By using this file, you agree to the terms and conditions set
|
||||
* forth in the LICENSE file which can be found at the top level of
|
||||
* the distribution.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef SRSLTE_NPDCCH_H
|
||||
#define SRSLTE_NPDCCH_H
|
||||
|
||||
#include "srslte/config.h"
|
||||
#include "srslte/phy/common/phy_common.h"
|
||||
#include "srslte/phy/fec/convolutional/convcoder.h"
|
||||
#include "srslte/phy/fec/convolutional/rm_conv.h"
|
||||
#include "srslte/phy/fec/convolutional/viterbi.h"
|
||||
#include "srslte/phy/fec/crc.h"
|
||||
#include "srslte/phy/mimo/layermap.h"
|
||||
#include "srslte/phy/mimo/precoding.h"
|
||||
#include "srslte/phy/modem/demod_soft.h"
|
||||
#include "srslte/phy/modem/mod.h"
|
||||
#include "srslte/phy/phch/dci.h"
|
||||
#include "srslte/phy/phch/regs.h"
|
||||
#include "srslte/phy/scrambling/scrambling.h"
|
||||
|
||||
#define SRSLTE_RARNTI_END_NBIOT 0x0100
|
||||
#define SRSLTE_NBIOT_NUM_NRS_SYMS 8
|
||||
#define SRSLTE_NPDCCH_MAX_RE (SRSLTE_NRE * SRSLTE_CP_NORM_SF_NSYMB - SRSLTE_NBIOT_NUM_NRS_SYMS)
|
||||
|
||||
#define SRSLTE_NBIOT_DCI_MAX_SIZE 23
|
||||
#define SRSLTE_AL_REPETITION_USS 64 // Higher layer configured parameter al-Repetition-USS
|
||||
|
||||
typedef enum SRSLTE_API {
|
||||
SRSLTE_NPDCCH_FORMAT1 = 0,
|
||||
SRSLTE_NPDCCH_FORMAT0_LOWER_HALF,
|
||||
SRSLTE_NPDCCH_FORMAT0_UPPER_HALF,
|
||||
SRSLTE_NPDCCH_FORMAT_NITEMS
|
||||
} srslte_npdcch_format_t;
|
||||
static const char srslte_npdcch_format_text[SRSLTE_NPDCCH_FORMAT_NITEMS][30] = {"Format 1",
|
||||
"Format 0 (Lower Half)",
|
||||
"Format 0 (Upper Half)"};
|
||||
|
||||
/**
|
||||
* @brief Narrowband Physical downlink control channel (NPDCCH)
|
||||
*
|
||||
* Reference: 3GPP TS 36.211 version 13.2.0 Release 11 Sec. 6.8 and 10.2.5
|
||||
*/
|
||||
typedef struct SRSLTE_API {
|
||||
srslte_nbiot_cell_t cell;
|
||||
uint32_t nof_cce;
|
||||
uint32_t ncce_bits;
|
||||
uint32_t max_bits;
|
||||
uint32_t i_n_start; /// start of the first OFDM symbol (signalled through NB-SIB1)
|
||||
uint32_t nof_nbiot_refs; /// number of NRS symbols per OFDM symbol
|
||||
uint32_t nof_lte_refs; /// number of CRS symbols per OFDM symbol
|
||||
uint32_t num_decoded_symbols;
|
||||
|
||||
/* buffers */
|
||||
cf_t* ce[SRSLTE_MAX_PORTS];
|
||||
cf_t* symbols[SRSLTE_MAX_PORTS];
|
||||
cf_t* x[SRSLTE_MAX_PORTS];
|
||||
cf_t* d;
|
||||
uint8_t* e;
|
||||
float rm_f[3 * (SRSLTE_DCI_MAX_BITS + 16)];
|
||||
float* llr[2]; // Two layers of LLRs for Format0 and Format1 NPDCCH
|
||||
|
||||
/* tx & rx objects */
|
||||
srslte_modem_table_t mod;
|
||||
srslte_sequence_t seq[SRSLTE_NOF_SF_X_FRAME];
|
||||
srslte_viterbi_t decoder;
|
||||
srslte_crc_t crc;
|
||||
|
||||
} srslte_npdcch_t;
|
||||
|
||||
SRSLTE_API int srslte_npdcch_init(srslte_npdcch_t* q);
|
||||
|
||||
SRSLTE_API void srslte_npdcch_free(srslte_npdcch_t* q);
|
||||
|
||||
SRSLTE_API int srslte_npdcch_set_cell(srslte_npdcch_t* q, srslte_nbiot_cell_t cell);
|
||||
|
||||
/// Encoding function
|
||||
SRSLTE_API int srslte_npdcch_encode(srslte_npdcch_t* q,
|
||||
srslte_dci_msg_t* msg,
|
||||
srslte_dci_location_t location,
|
||||
uint16_t rnti,
|
||||
cf_t* sf_symbols[SRSLTE_MAX_PORTS],
|
||||
uint32_t nsubframe);
|
||||
|
||||
/// Decoding functions: Extract the LLRs and save them in the srslte_npdcch_t object
|
||||
SRSLTE_API int srslte_npdcch_extract_llr(srslte_npdcch_t* q,
|
||||
cf_t* sf_symbols,
|
||||
cf_t* ce[SRSLTE_MAX_PORTS],
|
||||
float noise_estimate,
|
||||
uint32_t sf_idx);
|
||||
|
||||
/// Decoding functions: Try to decode a DCI message after calling srslte_npdcch_extract_llr
|
||||
SRSLTE_API int srslte_npdcch_decode_msg(srslte_npdcch_t* q,
|
||||
srslte_dci_msg_t* msg,
|
||||
srslte_dci_location_t* location,
|
||||
srslte_dci_format_t format,
|
||||
uint16_t* crc_rem);
|
||||
|
||||
SRSLTE_API int
|
||||
srslte_npdcch_dci_decode(srslte_npdcch_t* q, float* e, uint8_t* data, uint32_t E, uint32_t nof_bits, uint16_t* crc);
|
||||
|
||||
SRSLTE_API int
|
||||
srslte_npdcch_dci_encode(srslte_npdcch_t* q, uint8_t* data, uint8_t* e, uint32_t nof_bits, uint32_t E, uint16_t rnti);
|
||||
|
||||
SRSLTE_API void
|
||||
srslte_npdcch_dci_encode_conv(srslte_npdcch_t* q, uint8_t* data, uint32_t nof_bits, uint8_t* coded_data, uint16_t rnti);
|
||||
|
||||
SRSLTE_API uint32_t srslte_npdcch_ue_locations(srslte_dci_location_t* c, uint32_t max_candidates);
|
||||
|
||||
SRSLTE_API uint32_t srslte_npdcch_common_locations(srslte_dci_location_t* c, uint32_t max_candidates);
|
||||
|
||||
int srslte_npdcch_cp(srslte_npdcch_t* q, cf_t* input, cf_t* output, bool put, srslte_npdcch_format_t format);
|
||||
int srslte_npdcch_put(srslte_npdcch_t* q, cf_t* symbols, cf_t* sf_symbols, srslte_npdcch_format_t format);
|
||||
int srslte_npdcch_get(srslte_npdcch_t* q, cf_t* symbols, cf_t* sf_symbols, srslte_npdcch_format_t format);
|
||||
|
||||
#endif // SRSLTE_NPDCCH_H
|
|
@ -1,151 +0,0 @@
|
|||
/**
|
||||
*
|
||||
* \section COPYRIGHT
|
||||
*
|
||||
* Copyright 2013-2020 Software Radio Systems Limited
|
||||
*
|
||||
* By using this file, you agree to the terms and conditions set
|
||||
* forth in the LICENSE file which can be found at the top level of
|
||||
* the distribution.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef SRSLTE_NPDSCH_H
|
||||
#define SRSLTE_NPDSCH_H
|
||||
|
||||
#include "srslte/config.h"
|
||||
#include "srslte/phy/common/phy_common.h"
|
||||
#include "srslte/phy/fec/convolutional/convcoder.h"
|
||||
#include "srslte/phy/fec/crc.h"
|
||||
#include "srslte/phy/mimo/layermap.h"
|
||||
#include "srslte/phy/mimo/precoding.h"
|
||||
#include "srslte/phy/modem/demod_soft.h"
|
||||
#include "srslte/phy/modem/mod.h"
|
||||
#include "srslte/phy/phch/dci.h"
|
||||
#include "srslte/phy/phch/npdsch_cfg.h"
|
||||
#include "srslte/phy/phch/regs.h"
|
||||
#include "srslte/phy/phch/sch.h"
|
||||
#include "srslte/phy/scrambling/scrambling.h"
|
||||
|
||||
#define SRSLTE_NPDSCH_MAX_RE \
|
||||
(SRSLTE_CP_NORM_SF_NSYMB * SRSLTE_NRE - 8) ///< Full PRB minus 8 RE for NRS (one antenna port)
|
||||
#define SRSLTE_NPDSCH_MAX_TBS 680 ///< Max TBS in Rel13 NB-IoT
|
||||
#define SRSLTE_NPDSCH_CRC_LEN (24)
|
||||
#define SRSLTE_NPDSCH_MAX_TBS_CRC (SRSLTE_NPDSCH_MAX_TBS + SRSLTE_NPDSCH_CRC_LEN)
|
||||
#define SRSLTE_NPDSCH_MAX_TBS_ENC (3 * SRSLTE_NPDSCH_MAX_TBS_CRC)
|
||||
#define SRSLTE_NPDSCH_MAX_NOF_SF 10
|
||||
#define SRSLTE_NPDSCH_NUM_SEQ (2 * SRSLTE_NOF_SF_X_FRAME) ///< for even and odd numbered SFNs
|
||||
|
||||
/* @brief Narrowband Physical Downlink shared channel (NPDSCH)
|
||||
*
|
||||
* Reference: 3GPP TS 36.211 version 13.2.0 Release 13 Sec. 10.2.3
|
||||
*/
|
||||
typedef struct SRSLTE_API {
|
||||
srslte_nbiot_cell_t cell;
|
||||
uint32_t max_re;
|
||||
bool rnti_is_set;
|
||||
uint16_t rnti;
|
||||
|
||||
// buffers
|
||||
uint8_t data[SRSLTE_NPDSCH_MAX_TBS_CRC];
|
||||
uint8_t data_enc[SRSLTE_NPDSCH_MAX_TBS_ENC];
|
||||
float rm_f[SRSLTE_NPDSCH_MAX_TBS_ENC];
|
||||
cf_t* ce[SRSLTE_MAX_PORTS];
|
||||
cf_t* symbols[SRSLTE_MAX_PORTS];
|
||||
cf_t* sib_symbols[SRSLTE_MAX_PORTS]; // extra buffer for SIB1 symbols as they may be interleaved with other NPDSCH
|
||||
cf_t* tx_syms[SRSLTE_MAX_PORTS]; // pointer to either symbols or sib1_symbols
|
||||
cf_t* x[SRSLTE_MAX_PORTS];
|
||||
cf_t* d;
|
||||
|
||||
float* llr;
|
||||
uint8_t* temp;
|
||||
uint8_t* rm_b;
|
||||
|
||||
// tx & rx objects
|
||||
srslte_modem_table_t mod;
|
||||
srslte_viterbi_t decoder;
|
||||
srslte_sequence_t seq[SRSLTE_NPDSCH_NUM_SEQ];
|
||||
srslte_crc_t crc;
|
||||
srslte_convcoder_t encoder;
|
||||
} srslte_npdsch_t;
|
||||
|
||||
typedef struct {
|
||||
uint16_t hyper_sfn;
|
||||
// TODO: add all other fields
|
||||
} srslte_sys_info_block_type_1_nb_t;
|
||||
|
||||
SRSLTE_API int srslte_npdsch_init(srslte_npdsch_t* q);
|
||||
|
||||
SRSLTE_API void srslte_npdsch_free(srslte_npdsch_t* q);
|
||||
|
||||
SRSLTE_API int srslte_npdsch_set_cell(srslte_npdsch_t* q, srslte_nbiot_cell_t cell);
|
||||
|
||||
SRSLTE_API int srslte_npdsch_set_rnti(srslte_npdsch_t* q, uint16_t rnti);
|
||||
|
||||
SRSLTE_API int srslte_npdsch_cfg(srslte_npdsch_cfg_t* cfg,
|
||||
srslte_nbiot_cell_t cell,
|
||||
srslte_ra_nbiot_dl_grant_t* grant,
|
||||
uint32_t sf_idx);
|
||||
|
||||
SRSLTE_API int srslte_npdsch_encode(srslte_npdsch_t* q,
|
||||
srslte_npdsch_cfg_t* cfg,
|
||||
srslte_softbuffer_tx_t* softbuffer,
|
||||
uint8_t* data,
|
||||
cf_t* sf_symbols[SRSLTE_MAX_PORTS]);
|
||||
|
||||
SRSLTE_API int srslte_npdsch_encode_rnti_idx(srslte_npdsch_t* q,
|
||||
srslte_npdsch_cfg_t* cfg,
|
||||
srslte_softbuffer_tx_t* softbuffer,
|
||||
uint8_t* data,
|
||||
uint32_t rnti_idx,
|
||||
cf_t* sf_symbols[SRSLTE_MAX_PORTS]);
|
||||
|
||||
SRSLTE_API int srslte_npdsch_encode_rnti(srslte_npdsch_t* q,
|
||||
srslte_npdsch_cfg_t* cfg,
|
||||
srslte_softbuffer_tx_t* softbuffer,
|
||||
uint8_t* data,
|
||||
uint16_t rnti,
|
||||
cf_t* sf_symbols[SRSLTE_MAX_PORTS]);
|
||||
|
||||
SRSLTE_API int srslte_npdsch_encode_seq(srslte_npdsch_t* q,
|
||||
srslte_npdsch_cfg_t* cfg,
|
||||
srslte_softbuffer_tx_t* softbuffer,
|
||||
uint8_t* data,
|
||||
srslte_sequence_t* seq,
|
||||
cf_t* sf_symbols[SRSLTE_MAX_PORTS]);
|
||||
|
||||
SRSLTE_API int srslte_npdsch_decode(srslte_npdsch_t* q,
|
||||
srslte_npdsch_cfg_t* cfg,
|
||||
srslte_softbuffer_rx_t* softbuffer,
|
||||
cf_t* sf_symbols,
|
||||
cf_t* ce[SRSLTE_MAX_PORTS],
|
||||
float noise_estimate,
|
||||
uint32_t sfn,
|
||||
uint8_t* data);
|
||||
|
||||
SRSLTE_API int srslte_npdsch_decode_rnti(srslte_npdsch_t* q,
|
||||
srslte_npdsch_cfg_t* cfg,
|
||||
srslte_softbuffer_rx_t* softbuffer,
|
||||
cf_t* sf_symbols,
|
||||
cf_t* ce[SRSLTE_MAX_PORTS],
|
||||
float noise_estimate,
|
||||
uint16_t rnti,
|
||||
uint32_t sfn,
|
||||
uint8_t* data,
|
||||
uint32_t rep_counter);
|
||||
|
||||
SRSLTE_API int
|
||||
srslte_npdsch_rm_and_decode(srslte_npdsch_t* q, srslte_npdsch_cfg_t* cfg, float* softbits, uint8_t* data);
|
||||
|
||||
SRSLTE_API int
|
||||
srslte_npdsch_cp(srslte_npdsch_t* q, cf_t* input, cf_t* output, srslte_ra_nbiot_dl_grant_t* grant, bool put);
|
||||
|
||||
SRSLTE_API float srslte_npdsch_average_noi(srslte_npdsch_t* q);
|
||||
|
||||
SRSLTE_API uint32_t srslte_npdsch_last_noi(srslte_npdsch_t* q);
|
||||
|
||||
SRSLTE_API void srslte_npdsch_sib1_pack(srslte_cell_t* cell, srslte_sys_info_block_type_1_nb_t* sib, uint8_t* payload);
|
||||
|
||||
SRSLTE_API void srslte_npdsch_sib1_unpack(uint8_t* const msg, srslte_sys_info_block_type_1_nb_t* sib);
|
||||
|
||||
#endif // SRSLTE_NPDSCH_H
|
|
@ -1,99 +0,0 @@
|
|||
/**
|
||||
*
|
||||
* \section COPYRIGHT
|
||||
*
|
||||
* Copyright 2013-2020 Software Radio Systems Limited
|
||||
*
|
||||
* By using this file, you agree to the terms and conditions set
|
||||
* forth in the LICENSE file which can be found at the top level of
|
||||
* the distribution.
|
||||
*
|
||||
*/
|
||||
|
||||
/******************************************************************************
|
||||
* File: pbch.h
|
||||
*
|
||||
* Description: Physical broadcast channel. If cell.nof_ports = 0, the number
|
||||
* of ports is blindly determined using the CRC of the received
|
||||
* codeword for 1, 2 and 4 ports
|
||||
*
|
||||
* Reference: 3GPP TS 36.211 version 10.0.0 Release 10 Sec. 6.6
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef SRSLTE_PBCH_H
|
||||
#define SRSLTE_PBCH_H
|
||||
|
||||
#include "srslte/config.h"
|
||||
#include "srslte/phy/ch_estimation/chest_dl.h"
|
||||
#include "srslte/phy/common/phy_common.h"
|
||||
#include "srslte/phy/fec/convolutional/convcoder.h"
|
||||
#include "srslte/phy/fec/convolutional/rm_conv.h"
|
||||
#include "srslte/phy/fec/convolutional/viterbi.h"
|
||||
#include "srslte/phy/fec/crc.h"
|
||||
#include "srslte/phy/mimo/layermap.h"
|
||||
#include "srslte/phy/mimo/precoding.h"
|
||||
#include "srslte/phy/modem/demod_soft.h"
|
||||
#include "srslte/phy/modem/mod.h"
|
||||
#include "srslte/phy/scrambling/scrambling.h"
|
||||
|
||||
#define SRSLTE_BCH_PAYLOAD_LEN 24
|
||||
#define SRSLTE_BCH_PAYLOADCRC_LEN (SRSLTE_BCH_PAYLOAD_LEN + 16)
|
||||
#define SRSLTE_BCH_ENCODED_LEN 3 * (SRSLTE_BCH_PAYLOADCRC_LEN)
|
||||
|
||||
#define SRSLTE_PBCH_MAX_RE 256 // make it avx2-aligned
|
||||
|
||||
/* PBCH object */
|
||||
typedef struct SRSLTE_API {
|
||||
srslte_cell_t cell;
|
||||
|
||||
uint32_t nof_symbols;
|
||||
|
||||
/* buffers */
|
||||
cf_t* ce[SRSLTE_MAX_PORTS];
|
||||
cf_t* symbols[SRSLTE_MAX_PORTS];
|
||||
cf_t* x[SRSLTE_MAX_PORTS];
|
||||
cf_t* d;
|
||||
float* llr;
|
||||
float* temp;
|
||||
float rm_f[SRSLTE_BCH_ENCODED_LEN];
|
||||
uint8_t* rm_b;
|
||||
uint8_t data[SRSLTE_BCH_PAYLOADCRC_LEN];
|
||||
uint8_t data_enc[SRSLTE_BCH_ENCODED_LEN];
|
||||
|
||||
uint32_t frame_idx;
|
||||
|
||||
/* tx & rx objects */
|
||||
srslte_modem_table_t mod;
|
||||
srslte_sequence_t seq;
|
||||
srslte_viterbi_t decoder;
|
||||
srslte_crc_t crc;
|
||||
srslte_convcoder_t encoder;
|
||||
bool search_all_ports;
|
||||
|
||||
} srslte_pbch_t;
|
||||
|
||||
SRSLTE_API int srslte_pbch_init(srslte_pbch_t* q);
|
||||
|
||||
SRSLTE_API void srslte_pbch_free(srslte_pbch_t* q);
|
||||
|
||||
SRSLTE_API int srslte_pbch_set_cell(srslte_pbch_t* q, srslte_cell_t cell);
|
||||
|
||||
SRSLTE_API int srslte_pbch_decode(srslte_pbch_t* q,
|
||||
srslte_chest_dl_res_t* channel,
|
||||
cf_t* sf_symbols[SRSLTE_MAX_PORTS],
|
||||
uint8_t bch_payload[SRSLTE_BCH_PAYLOAD_LEN],
|
||||
uint32_t* nof_tx_ports,
|
||||
int* sfn_offset);
|
||||
|
||||
SRSLTE_API int srslte_pbch_encode(srslte_pbch_t* q,
|
||||
uint8_t bch_payload[SRSLTE_BCH_PAYLOAD_LEN],
|
||||
cf_t* sf_symbols[SRSLTE_MAX_PORTS],
|
||||
uint32_t frame_idx);
|
||||
|
||||
SRSLTE_API void srslte_pbch_decode_reset(srslte_pbch_t* q);
|
||||
|
||||
SRSLTE_API void srslte_pbch_mib_unpack(uint8_t* msg, srslte_cell_t* cell, uint32_t* sfn);
|
||||
|
||||
SRSLTE_API void srslte_pbch_mib_pack(srslte_cell_t* cell, uint32_t sfn, uint8_t* msg);
|
||||
|
||||
#endif // SRSLTE_PBCH_H
|
|
@ -1,82 +0,0 @@
|
|||
/**
|
||||
*
|
||||
* \section COPYRIGHT
|
||||
*
|
||||
* Copyright 2013-2020 Software Radio Systems Limited
|
||||
*
|
||||
* By using this file, you agree to the terms and conditions set
|
||||
* forth in the LICENSE file which can be found at the top level of
|
||||
* the distribution.
|
||||
*
|
||||
*/
|
||||
|
||||
/******************************************************************************
|
||||
* File: pcfich.h
|
||||
*
|
||||
* Description: Physical control format indicator channel
|
||||
*
|
||||
* Reference: 3GPP TS 36.211 version 10.0.0 Release 10 Sec. 6.7
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef SRSLTE_PCFICH_H
|
||||
#define SRSLTE_PCFICH_H
|
||||
|
||||
#include "srslte/config.h"
|
||||
#include "srslte/phy/ch_estimation/chest_dl.h"
|
||||
#include "srslte/phy/common/phy_common.h"
|
||||
#include "srslte/phy/mimo/layermap.h"
|
||||
#include "srslte/phy/mimo/precoding.h"
|
||||
#include "srslte/phy/modem/demod_soft.h"
|
||||
#include "srslte/phy/modem/mod.h"
|
||||
#include "srslte/phy/phch/regs.h"
|
||||
#include "srslte/phy/scrambling/scrambling.h"
|
||||
|
||||
#define PCFICH_CFI_LEN 32
|
||||
#define PCFICH_RE PCFICH_CFI_LEN / 2
|
||||
|
||||
/* PCFICH object */
|
||||
typedef struct SRSLTE_API {
|
||||
srslte_cell_t cell;
|
||||
int nof_symbols;
|
||||
|
||||
uint32_t nof_rx_antennas;
|
||||
|
||||
/* handler to REGs resource mapper */
|
||||
srslte_regs_t* regs;
|
||||
|
||||
/* buffers */
|
||||
cf_t ce[SRSLTE_MAX_PORTS][SRSLTE_MAX_PORTS][PCFICH_RE];
|
||||
cf_t symbols[SRSLTE_MAX_PORTS][PCFICH_RE];
|
||||
cf_t x[SRSLTE_MAX_PORTS][PCFICH_RE];
|
||||
cf_t d[PCFICH_RE];
|
||||
|
||||
// cfi table in floats
|
||||
float cfi_table_float[3][PCFICH_CFI_LEN];
|
||||
|
||||
/* bit message */
|
||||
uint8_t data[PCFICH_CFI_LEN];
|
||||
|
||||
/* received soft bits */
|
||||
float data_f[PCFICH_CFI_LEN];
|
||||
|
||||
/* tx & rx objects */
|
||||
srslte_modem_table_t mod;
|
||||
srslte_sequence_t seq[SRSLTE_NOF_SF_X_FRAME];
|
||||
|
||||
} srslte_pcfich_t;
|
||||
|
||||
SRSLTE_API int srslte_pcfich_init(srslte_pcfich_t* q, uint32_t nof_rx_antennas);
|
||||
|
||||
SRSLTE_API int srslte_pcfich_set_cell(srslte_pcfich_t* q, srslte_regs_t* regs, srslte_cell_t cell);
|
||||
|
||||
SRSLTE_API void srslte_pcfich_free(srslte_pcfich_t* q);
|
||||
|
||||
SRSLTE_API int srslte_pcfich_decode(srslte_pcfich_t* q,
|
||||
srslte_dl_sf_cfg_t* sf,
|
||||
srslte_chest_dl_res_t* channel,
|
||||
cf_t* sf_symbols[SRSLTE_MAX_PORTS],
|
||||
float* corr_result);
|
||||
|
||||
SRSLTE_API int srslte_pcfich_encode(srslte_pcfich_t* q, srslte_dl_sf_cfg_t* sf, cf_t* sf_symbols[SRSLTE_MAX_PORTS]);
|
||||
|
||||
#endif // SRSLTE_PCFICH_H
|
|
@ -1,137 +0,0 @@
|
|||
/**
|
||||
*
|
||||
* \section COPYRIGHT
|
||||
*
|
||||
* Copyright 2013-2020 Software Radio Systems Limited
|
||||
*
|
||||
* By using this file, you agree to the terms and conditions set
|
||||
* forth in the LICENSE file which can be found at the top level of
|
||||
* the distribution.
|
||||
*
|
||||
*/
|
||||
|
||||
/******************************************************************************
|
||||
* File: pdcch.h
|
||||
*
|
||||
* Description: Physical downlink control channel.
|
||||
*
|
||||
* Reference: 3GPP TS 36.211 version 10.0.0 Release 10 Sec. 6.8
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef SRSLTE_PDCCH_H
|
||||
#define SRSLTE_PDCCH_H
|
||||
|
||||
#include "srslte/config.h"
|
||||
#include "srslte/phy/ch_estimation/chest_dl.h"
|
||||
#include "srslte/phy/common/phy_common.h"
|
||||
#include "srslte/phy/fec/convolutional/convcoder.h"
|
||||
#include "srslte/phy/fec/convolutional/rm_conv.h"
|
||||
#include "srslte/phy/fec/convolutional/viterbi.h"
|
||||
#include "srslte/phy/fec/crc.h"
|
||||
#include "srslte/phy/mimo/layermap.h"
|
||||
#include "srslte/phy/mimo/precoding.h"
|
||||
#include "srslte/phy/modem/demod_soft.h"
|
||||
#include "srslte/phy/modem/mod.h"
|
||||
#include "srslte/phy/phch/dci.h"
|
||||
#include "srslte/phy/phch/regs.h"
|
||||
#include "srslte/phy/scrambling/scrambling.h"
|
||||
|
||||
typedef enum SRSLTE_API { SEARCH_UE, SEARCH_COMMON } srslte_pdcch_search_mode_t;
|
||||
|
||||
/* PDCCH object */
|
||||
typedef struct SRSLTE_API {
|
||||
srslte_cell_t cell;
|
||||
uint32_t nof_regs[3];
|
||||
uint32_t nof_cce[3];
|
||||
uint32_t max_bits;
|
||||
uint32_t nof_rx_antennas;
|
||||
bool is_ue;
|
||||
|
||||
srslte_regs_t* regs;
|
||||
|
||||
/* buffers */
|
||||
cf_t* ce[SRSLTE_MAX_PORTS][SRSLTE_MAX_PORTS];
|
||||
cf_t* symbols[SRSLTE_MAX_PORTS];
|
||||
cf_t* x[SRSLTE_MAX_PORTS];
|
||||
cf_t* d;
|
||||
uint8_t* e;
|
||||
float rm_f[3 * (SRSLTE_DCI_MAX_BITS + 16)];
|
||||
float* llr;
|
||||
|
||||
/* tx & rx objects */
|
||||
srslte_modem_table_t mod;
|
||||
srslte_sequence_t seq[SRSLTE_NOF_SF_X_FRAME];
|
||||
srslte_viterbi_t decoder;
|
||||
srslte_crc_t crc;
|
||||
|
||||
} srslte_pdcch_t;
|
||||
|
||||
SRSLTE_API int srslte_pdcch_init_ue(srslte_pdcch_t* q, uint32_t max_prb, uint32_t nof_rx_antennas);
|
||||
|
||||
SRSLTE_API int srslte_pdcch_init_enb(srslte_pdcch_t* q, uint32_t max_prb);
|
||||
|
||||
SRSLTE_API int srslte_pdcch_set_cell(srslte_pdcch_t* q, srslte_regs_t* regs, srslte_cell_t cell);
|
||||
|
||||
SRSLTE_API void srslte_pdcch_set_regs(srslte_pdcch_t* q, srslte_regs_t* regs);
|
||||
|
||||
SRSLTE_API void srslte_pdcch_free(srslte_pdcch_t* q);
|
||||
|
||||
SRSLTE_API float srslte_pdcch_coderate(uint32_t nof_bits, uint32_t l);
|
||||
|
||||
/* Encoding function */
|
||||
SRSLTE_API int srslte_pdcch_encode(srslte_pdcch_t* q,
|
||||
srslte_dl_sf_cfg_t* sf,
|
||||
srslte_dci_msg_t* msg,
|
||||
cf_t* sf_symbols[SRSLTE_MAX_PORTS]);
|
||||
|
||||
/* Decoding functions: Extract the LLRs and save them in the srslte_pdcch_t object */
|
||||
|
||||
SRSLTE_API int srslte_pdcch_extract_llr(srslte_pdcch_t* q,
|
||||
srslte_dl_sf_cfg_t* sf,
|
||||
srslte_chest_dl_res_t* channel,
|
||||
cf_t* sf_symbols[SRSLTE_MAX_PORTS]);
|
||||
|
||||
/* Decoding functions: Try to decode a DCI message after calling srslte_pdcch_extract_llr */
|
||||
SRSLTE_API int
|
||||
srslte_pdcch_decode_msg(srslte_pdcch_t* q, srslte_dl_sf_cfg_t* sf, srslte_dci_cfg_t* dci_cfg, srslte_dci_msg_t* msg);
|
||||
|
||||
SRSLTE_API int
|
||||
srslte_pdcch_dci_decode(srslte_pdcch_t* q, float* e, uint8_t* data, uint32_t E, uint32_t nof_bits, uint16_t* crc);
|
||||
|
||||
SRSLTE_API int
|
||||
srslte_pdcch_dci_encode(srslte_pdcch_t* q, uint8_t* data, uint8_t* e, uint32_t nof_bits, uint32_t E, uint16_t rnti);
|
||||
|
||||
SRSLTE_API void
|
||||
srslte_pdcch_dci_encode_conv(srslte_pdcch_t* q, uint8_t* data, uint32_t nof_bits, uint8_t* coded_data, uint16_t rnti);
|
||||
|
||||
/* Function for generation of UE-specific search space DCI locations */
|
||||
SRSLTE_API uint32_t srslte_pdcch_ue_locations(srslte_pdcch_t* q,
|
||||
srslte_dl_sf_cfg_t* sf,
|
||||
srslte_dci_location_t* locations,
|
||||
uint32_t max_locations,
|
||||
uint16_t rnti);
|
||||
|
||||
SRSLTE_API uint32_t srslte_pdcch_ue_locations_ncce(uint32_t nof_cce,
|
||||
srslte_dci_location_t* c,
|
||||
uint32_t max_candidates,
|
||||
uint32_t sf_idx,
|
||||
uint16_t rnti);
|
||||
|
||||
SRSLTE_API uint32_t srslte_pdcch_ue_locations_ncce_L(uint32_t nof_cce,
|
||||
srslte_dci_location_t* c,
|
||||
uint32_t max_candidates,
|
||||
uint32_t sf_idx,
|
||||
uint16_t rnti,
|
||||
int L);
|
||||
|
||||
/* Function for generation of common search space DCI locations */
|
||||
SRSLTE_API uint32_t srslte_pdcch_common_locations(srslte_pdcch_t* q,
|
||||
srslte_dci_location_t* locations,
|
||||
uint32_t max_locations,
|
||||
uint32_t cfi);
|
||||
|
||||
SRSLTE_API uint32_t srslte_pdcch_common_locations_ncce(uint32_t nof_cce,
|
||||
srslte_dci_location_t* c,
|
||||
uint32_t max_candidates);
|
||||
|
||||
#endif // SRSLTE_PDCCH_H
|
|
@ -1,124 +0,0 @@
|
|||
/**
|
||||
*
|
||||
* \section COPYRIGHT
|
||||
*
|
||||
* Copyright 2013-2020 Software Radio Systems Limited
|
||||
*
|
||||
* By using this file, you agree to the terms and conditions set
|
||||
* forth in the LICENSE file which can be found at the top level of
|
||||
* the distribution.
|
||||
*
|
||||
*/
|
||||
|
||||
/******************************************************************************
|
||||
* File: pdsch.h
|
||||
*
|
||||
* Description: Physical downlink shared channel
|
||||
*
|
||||
* Reference: 3GPP TS 36.211 version 10.0.0 Release 10 Sec. 6.4
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef SRSLTE_PDSCH_H
|
||||
#define SRSLTE_PDSCH_H
|
||||
|
||||
#include "srslte/config.h"
|
||||
#include "srslte/phy/ch_estimation/chest_dl.h"
|
||||
#include "srslte/phy/common/phy_common.h"
|
||||
#include "srslte/phy/mimo/layermap.h"
|
||||
#include "srslte/phy/mimo/precoding.h"
|
||||
#include "srslte/phy/modem/demod_soft.h"
|
||||
#include "srslte/phy/modem/evm.h"
|
||||
#include "srslte/phy/modem/mod.h"
|
||||
#include "srslte/phy/phch/dci.h"
|
||||
#include "srslte/phy/phch/pdsch_cfg.h"
|
||||
#include "srslte/phy/phch/regs.h"
|
||||
#include "srslte/phy/phch/sch.h"
|
||||
#include "srslte/phy/scrambling/scrambling.h"
|
||||
|
||||
/* PDSCH object */
|
||||
typedef struct SRSLTE_API {
|
||||
srslte_cell_t cell;
|
||||
|
||||
uint32_t nof_rx_antennas;
|
||||
uint32_t max_re;
|
||||
|
||||
bool is_ue;
|
||||
|
||||
bool llr_is_8bit;
|
||||
|
||||
/* buffers */
|
||||
// void buffers are shared for tx and rx
|
||||
cf_t* ce[SRSLTE_MAX_PORTS][SRSLTE_MAX_PORTS]; /* Channel estimation (Rx only) */
|
||||
cf_t* symbols[SRSLTE_MAX_PORTS]; /* PDSCH Encoded/Decoded Symbols */
|
||||
cf_t* x[SRSLTE_MAX_LAYERS]; /* Layer mapped */
|
||||
cf_t* d[SRSLTE_MAX_CODEWORDS]; /* Modulated/Demodulated codewords */
|
||||
void* e[SRSLTE_MAX_CODEWORDS];
|
||||
|
||||
float* csi[SRSLTE_MAX_CODEWORDS]; /* Channel Strengh Indicator */
|
||||
|
||||
/* tx & rx objects */
|
||||
srslte_modem_table_t mod[SRSLTE_MOD_NITEMS];
|
||||
|
||||
// EVM buffers, one for each codeword (avoid concurrency issue with coworker)
|
||||
srslte_evm_buffer_t* evm_buffer[SRSLTE_MAX_CODEWORDS];
|
||||
float avg_evm;
|
||||
|
||||
srslte_sch_t dl_sch;
|
||||
|
||||
void* coworker_ptr;
|
||||
|
||||
} srslte_pdsch_t;
|
||||
|
||||
typedef struct {
|
||||
uint8_t* payload;
|
||||
bool crc;
|
||||
float avg_iterations_block;
|
||||
float evm;
|
||||
} srslte_pdsch_res_t;
|
||||
|
||||
SRSLTE_API int srslte_pdsch_init_ue(srslte_pdsch_t* q, uint32_t max_prb, uint32_t nof_rx_antennas);
|
||||
|
||||
SRSLTE_API int srslte_pdsch_init_enb(srslte_pdsch_t* q, uint32_t max_prb);
|
||||
|
||||
SRSLTE_API void srslte_pdsch_free(srslte_pdsch_t* q);
|
||||
|
||||
/* These functions modify the state of the object and may take some time */
|
||||
SRSLTE_API int srslte_pdsch_enable_coworker(srslte_pdsch_t* q);
|
||||
|
||||
SRSLTE_API int srslte_pdsch_set_cell(srslte_pdsch_t* q, srslte_cell_t cell);
|
||||
|
||||
/* These functions do not modify the state and run in real-time */
|
||||
SRSLTE_API int srslte_pdsch_encode(srslte_pdsch_t* q,
|
||||
srslte_dl_sf_cfg_t* sf,
|
||||
srslte_pdsch_cfg_t* cfg,
|
||||
uint8_t* data[SRSLTE_MAX_CODEWORDS],
|
||||
cf_t* sf_symbols[SRSLTE_MAX_PORTS]);
|
||||
|
||||
SRSLTE_API int srslte_pdsch_decode(srslte_pdsch_t* q,
|
||||
srslte_dl_sf_cfg_t* sf,
|
||||
srslte_pdsch_cfg_t* cfg,
|
||||
srslte_chest_dl_res_t* channel,
|
||||
cf_t* sf_symbols[SRSLTE_MAX_PORTS],
|
||||
srslte_pdsch_res_t data[SRSLTE_MAX_CODEWORDS]);
|
||||
|
||||
SRSLTE_API int srslte_pdsch_select_pmi(srslte_pdsch_t* q,
|
||||
srslte_chest_dl_res_t* channel,
|
||||
uint32_t nof_layers,
|
||||
uint32_t* best_pmi,
|
||||
float sinr[SRSLTE_MAX_CODEBOOKS]);
|
||||
|
||||
SRSLTE_API int srslte_pdsch_compute_cn(srslte_pdsch_t* q, srslte_chest_dl_res_t* channel, float* cn);
|
||||
|
||||
SRSLTE_API uint32_t srslte_pdsch_grant_rx_info(srslte_pdsch_grant_t* grant,
|
||||
srslte_pdsch_res_t res[SRSLTE_MAX_CODEWORDS],
|
||||
char* str,
|
||||
uint32_t str_len);
|
||||
|
||||
SRSLTE_API uint32_t srslte_pdsch_rx_info(srslte_pdsch_cfg_t* cfg,
|
||||
srslte_pdsch_res_t res[SRSLTE_MAX_CODEWORDS],
|
||||
char* str,
|
||||
uint32_t str_len);
|
||||
|
||||
SRSLTE_API uint32_t srslte_pdsch_tx_info(srslte_pdsch_cfg_t* cfg, char* str, uint32_t str_len);
|
||||
|
||||
#endif // SRSLTE_PDSCH_H
|
|
@ -1,103 +0,0 @@
|
|||
/**
|
||||
*
|
||||
* \section COPYRIGHT
|
||||
*
|
||||
* Copyright 2013-2020 Software Radio Systems Limited
|
||||
*
|
||||
* By using this file, you agree to the terms and conditions set
|
||||
* forth in the LICENSE file which can be found at the top level of
|
||||
* the distribution.
|
||||
*
|
||||
*/
|
||||
|
||||
/******************************************************************************
|
||||
* File: pdsch_nr.h
|
||||
*
|
||||
* Description: Physical downlink shared channel for NR
|
||||
*
|
||||
* Reference: 3GPP TS 38.211 V15.8.0 Sec. 7.3.1
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef SRSLTE_PDSCH_NR_H
|
||||
#define SRSLTE_PDSCH_NR_H
|
||||
|
||||
#include "srslte/config.h"
|
||||
#include "srslte/phy/ch_estimation/dmrs_sch.h"
|
||||
#include "srslte/phy/modem/evm.h"
|
||||
#include "srslte/phy/modem/modem_table.h"
|
||||
#include "srslte/phy/phch/phch_cfg_nr.h"
|
||||
#include "srslte/phy/phch/regs.h"
|
||||
#include "srslte/phy/phch/sch_nr.h"
|
||||
#include "srslte/phy/scrambling/scrambling.h"
|
||||
|
||||
/**
|
||||
* @brief PDSCH encoder and decoder initialization arguments
|
||||
*/
|
||||
typedef struct SRSLTE_API {
|
||||
srslte_sch_nr_args_t sch;
|
||||
bool measure_evm;
|
||||
bool measure_time;
|
||||
} srslte_pdsch_nr_args_t;
|
||||
|
||||
/**
|
||||
* @brief PDSCH NR object
|
||||
*/
|
||||
typedef struct SRSLTE_API {
|
||||
uint32_t max_prb; ///< Maximum number of allocated prb
|
||||
uint32_t max_layers; ///< Maximum number of allocated layers
|
||||
uint32_t max_cw; ///< Maximum number of allocated code words
|
||||
srslte_carrier_nr_t carrier; ///< NR carrier configuration
|
||||
srslte_sch_nr_t sch; ///< SCH Encoder/Decoder Object
|
||||
uint8_t* b[SRSLTE_MAX_CODEWORDS]; ///< SCH Encoded and scrambled data
|
||||
cf_t* d[SRSLTE_MAX_CODEWORDS]; ///< PDSCH modulated bits
|
||||
cf_t* x[SRSLTE_MAX_LAYERS_NR]; ///< PDSCH modulated bits
|
||||
srslte_modem_table_t modem_tables[SRSLTE_MOD_NITEMS]; ///< Modulator tables
|
||||
srslte_evm_buffer_t* evm_buffer;
|
||||
bool meas_time_en;
|
||||
uint32_t meas_time_us;
|
||||
} srslte_pdsch_nr_t;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
typedef struct {
|
||||
uint8_t* payload;
|
||||
bool crc;
|
||||
float evm;
|
||||
} srslte_pdsch_res_nr_t;
|
||||
|
||||
SRSLTE_API int srslte_pdsch_nr_init_enb(srslte_pdsch_nr_t* q, const srslte_pdsch_nr_args_t* args);
|
||||
|
||||
SRSLTE_API int srslte_pdsch_nr_init_ue(srslte_pdsch_nr_t* q, const srslte_pdsch_nr_args_t* args);
|
||||
|
||||
SRSLTE_API void srslte_pdsch_nr_free(srslte_pdsch_nr_t* q);
|
||||
|
||||
SRSLTE_API int srslte_pdsch_nr_set_carrier(srslte_pdsch_nr_t* q, const srslte_carrier_nr_t* carrier);
|
||||
|
||||
SRSLTE_API int srslte_pdsch_nr_encode(srslte_pdsch_nr_t* q,
|
||||
const srslte_sch_cfg_nr_t* cfg,
|
||||
const srslte_sch_grant_nr_t* grant,
|
||||
uint8_t* data[SRSLTE_MAX_TB],
|
||||
cf_t* sf_symbols[SRSLTE_MAX_PORTS]);
|
||||
|
||||
SRSLTE_API int srslte_pdsch_nr_decode(srslte_pdsch_nr_t* q,
|
||||
const srslte_sch_cfg_nr_t* cfg,
|
||||
const srslte_sch_grant_nr_t* grant,
|
||||
srslte_chest_dl_res_t* channel,
|
||||
cf_t* sf_symbols[SRSLTE_MAX_PORTS],
|
||||
srslte_pdsch_res_nr_t data[SRSLTE_MAX_TB]);
|
||||
|
||||
SRSLTE_API uint32_t srslte_pdsch_nr_rx_info(const srslte_pdsch_nr_t* q,
|
||||
const srslte_sch_cfg_nr_t* cfg,
|
||||
const srslte_sch_grant_nr_t* grant,
|
||||
const srslte_pdsch_res_nr_t* res,
|
||||
char* str,
|
||||
uint32_t str_len);
|
||||
|
||||
SRSLTE_API uint32_t srslte_pdsch_nr_tx_info(const srslte_pdsch_nr_t* q,
|
||||
const srslte_sch_cfg_nr_t* cfg,
|
||||
const srslte_sch_grant_nr_t* grant,
|
||||
char* str,
|
||||
uint32_t str_len);
|
||||
|
||||
#endif // SRSLTE_PDSCH_NR_H
|
|
@ -1,118 +0,0 @@
|
|||
/**
|
||||
*
|
||||
* \section COPYRIGHT
|
||||
*
|
||||
* Copyright 2013-2020 Software Radio Systems Limited
|
||||
*
|
||||
* By using this file, you agree to the terms and conditions set
|
||||
* forth in the LICENSE file which can be found at the top level of
|
||||
* the distribution.
|
||||
*
|
||||
*/
|
||||
|
||||
/******************************************************************************
|
||||
* File: phich.h
|
||||
*
|
||||
* Description: Physical Hybrid ARQ indicator channel.
|
||||
*
|
||||
* Reference: 3GPP TS 36.211 version 10.0.0 Release 10 Sec. 6.9
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef SRSLTE_PHICH_H
|
||||
#define SRSLTE_PHICH_H
|
||||
|
||||
#include "regs.h"
|
||||
#include "srslte/config.h"
|
||||
#include "srslte/phy/ch_estimation/chest_dl.h"
|
||||
#include "srslte/phy/common/phy_common.h"
|
||||
#include "srslte/phy/mimo/layermap.h"
|
||||
#include "srslte/phy/mimo/precoding.h"
|
||||
#include "srslte/phy/modem/demod_soft.h"
|
||||
#include "srslte/phy/modem/mod.h"
|
||||
#include "srslte/phy/scrambling/scrambling.h"
|
||||
|
||||
#define SRSLTE_PHICH_NORM_NSEQUENCES 8
|
||||
#define SRSLTE_PHICH_EXT_NSEQUENCES 4
|
||||
#define SRSLTE_PHICH_NBITS 3
|
||||
|
||||
#define SRSLTE_PHICH_NORM_MSYMB SRSLTE_PHICH_NBITS * 4
|
||||
#define SRSLTE_PHICH_EXT_MSYMB SRSLTE_PHICH_NBITS * 2
|
||||
#define SRSLTE_PHICH_MAX_NSYMB SRSLTE_PHICH_NORM_MSYMB
|
||||
#define SRSLTE_PHICH_NORM_C 1
|
||||
#define SRSLTE_PHICH_EXT_C 2
|
||||
#define SRSLTE_PHICH_NORM_NSF 4
|
||||
#define SRSLTE_PHICH_EXT_NSF 2
|
||||
|
||||
/* phich object */
|
||||
typedef struct SRSLTE_API {
|
||||
srslte_cell_t cell;
|
||||
|
||||
uint32_t nof_rx_antennas;
|
||||
|
||||
/* handler to REGs resource mapper */
|
||||
srslte_regs_t* regs;
|
||||
|
||||
/* buffers */
|
||||
cf_t ce[SRSLTE_MAX_PORTS][SRSLTE_MAX_PORTS][SRSLTE_PHICH_MAX_NSYMB];
|
||||
cf_t sf_symbols[SRSLTE_MAX_PORTS][SRSLTE_PHICH_MAX_NSYMB];
|
||||
cf_t x[SRSLTE_MAX_PORTS][SRSLTE_PHICH_MAX_NSYMB];
|
||||
cf_t d[SRSLTE_PHICH_MAX_NSYMB];
|
||||
cf_t d0[SRSLTE_PHICH_MAX_NSYMB];
|
||||
cf_t z[SRSLTE_PHICH_NBITS];
|
||||
|
||||
/* bit message */
|
||||
uint8_t data[SRSLTE_PHICH_NBITS];
|
||||
float data_rx[SRSLTE_PHICH_NBITS];
|
||||
|
||||
/* tx & rx objects */
|
||||
srslte_modem_table_t mod;
|
||||
srslte_sequence_t seq[SRSLTE_NOF_SF_X_FRAME];
|
||||
|
||||
} srslte_phich_t;
|
||||
|
||||
typedef struct SRSLTE_API {
|
||||
uint32_t ngroup;
|
||||
uint32_t nseq;
|
||||
} srslte_phich_resource_t;
|
||||
|
||||
typedef struct SRSLTE_API {
|
||||
uint32_t n_prb_lowest;
|
||||
uint32_t n_dmrs;
|
||||
uint32_t I_phich;
|
||||
} srslte_phich_grant_t;
|
||||
|
||||
typedef struct SRSLTE_API {
|
||||
bool ack_value;
|
||||
float distance;
|
||||
} srslte_phich_res_t;
|
||||
|
||||
SRSLTE_API int srslte_phich_init(srslte_phich_t* q, uint32_t nof_rx_antennas);
|
||||
|
||||
SRSLTE_API void srslte_phich_free(srslte_phich_t* q);
|
||||
|
||||
SRSLTE_API int srslte_phich_set_cell(srslte_phich_t* q, srslte_regs_t* regs, srslte_cell_t cell);
|
||||
|
||||
SRSLTE_API void srslte_phich_set_regs(srslte_phich_t* q, srslte_regs_t* regs);
|
||||
|
||||
SRSLTE_API void srslte_phich_calc(srslte_phich_t* q, srslte_phich_grant_t* grant, srslte_phich_resource_t* n_phich);
|
||||
|
||||
SRSLTE_API int srslte_phich_decode(srslte_phich_t* q,
|
||||
srslte_dl_sf_cfg_t* sf,
|
||||
srslte_chest_dl_res_t* channel,
|
||||
srslte_phich_resource_t n_phich,
|
||||
cf_t* sf_symbols[SRSLTE_MAX_PORTS],
|
||||
srslte_phich_res_t* result);
|
||||
|
||||
SRSLTE_API int srslte_phich_encode(srslte_phich_t* q,
|
||||
srslte_dl_sf_cfg_t* sf,
|
||||
srslte_phich_resource_t n_phich,
|
||||
uint8_t ack,
|
||||
cf_t* sf_symbols[SRSLTE_MAX_PORTS]);
|
||||
|
||||
SRSLTE_API void srslte_phich_reset(srslte_phich_t* q, cf_t* slot_symbols[SRSLTE_MAX_PORTS]);
|
||||
|
||||
SRSLTE_API uint32_t srslte_phich_ngroups(srslte_phich_t* q);
|
||||
|
||||
SRSLTE_API uint32_t srslte_phich_nsf(srslte_phich_t* q);
|
||||
|
||||
#endif // SRSLTE_PHICH_H
|
|
@ -1,97 +0,0 @@
|
|||
/**
|
||||
*
|
||||
* \section COPYRIGHT
|
||||
*
|
||||
* Copyright 2013-2020 Software Radio Systems Limited
|
||||
*
|
||||
* By using this file, you agree to the terms and conditions set
|
||||
* forth in the LICENSE file which can be found at the top level of
|
||||
* the distribution.
|
||||
*
|
||||
*/
|
||||
|
||||
/******************************************************************************
|
||||
* File: pmch.h
|
||||
*
|
||||
* Description: Physical multicast channel
|
||||
*
|
||||
* Reference: 3GPP TS 36.211 version 10.0.0 Release 10 Sec. 6.5
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef SRSLTE_PMCH_H
|
||||
#define SRSLTE_PMCH_H
|
||||
|
||||
#include "srslte/config.h"
|
||||
#include "srslte/phy/common/phy_common.h"
|
||||
#include "srslte/phy/common/sequence.h"
|
||||
#include "srslte/phy/mimo/layermap.h"
|
||||
#include "srslte/phy/mimo/precoding.h"
|
||||
#include "srslte/phy/modem/demod_soft.h"
|
||||
#include "srslte/phy/modem/mod.h"
|
||||
#include "srslte/phy/phch/dci.h"
|
||||
#include "srslte/phy/phch/pdsch.h"
|
||||
#include "srslte/phy/phch/ra_dl.h"
|
||||
#include "srslte/phy/phch/regs.h"
|
||||
#include "srslte/phy/phch/sch.h"
|
||||
#include "srslte/phy/scrambling/scrambling.h"
|
||||
typedef struct {
|
||||
srslte_sequence_t seq[SRSLTE_NOF_SF_X_FRAME];
|
||||
} srslte_pmch_seq_t;
|
||||
|
||||
typedef struct SRSLTE_API {
|
||||
srslte_pdsch_cfg_t pdsch_cfg;
|
||||
uint16_t area_id;
|
||||
} srslte_pmch_cfg_t;
|
||||
|
||||
/* PMCH object */
|
||||
typedef struct SRSLTE_API {
|
||||
srslte_cell_t cell;
|
||||
|
||||
uint32_t nof_rx_antennas;
|
||||
|
||||
uint32_t max_re;
|
||||
|
||||
/* buffers */
|
||||
// void buffers are shared for tx and rx
|
||||
cf_t* ce[SRSLTE_MAX_PORTS][SRSLTE_MAX_PORTS];
|
||||
cf_t* symbols[SRSLTE_MAX_PORTS];
|
||||
cf_t* x[SRSLTE_MAX_PORTS];
|
||||
cf_t* d;
|
||||
void* e;
|
||||
|
||||
/* tx & rx objects */
|
||||
srslte_modem_table_t mod[4];
|
||||
|
||||
// This is to generate the scrambling seq for multiple MBSFN Area IDs
|
||||
srslte_pmch_seq_t** seqs;
|
||||
|
||||
srslte_sch_t dl_sch;
|
||||
|
||||
} srslte_pmch_t;
|
||||
|
||||
SRSLTE_API int srslte_pmch_init(srslte_pmch_t* q, uint32_t max_prb, uint32_t nof_rx_antennas);
|
||||
|
||||
SRSLTE_API void srslte_pmch_free(srslte_pmch_t* q);
|
||||
|
||||
SRSLTE_API int srslte_pmch_set_cell(srslte_pmch_t* q, srslte_cell_t cell);
|
||||
|
||||
SRSLTE_API int srslte_pmch_set_area_id(srslte_pmch_t* q, uint16_t area_id);
|
||||
|
||||
SRSLTE_API void srslte_pmch_free_area_id(srslte_pmch_t* q, uint16_t area_id);
|
||||
|
||||
SRSLTE_API void srslte_configure_pmch(srslte_pmch_cfg_t* pmch_cfg, srslte_cell_t* cell, srslte_mbsfn_cfg_t* mbsfn_cfg);
|
||||
|
||||
SRSLTE_API int srslte_pmch_encode(srslte_pmch_t* q,
|
||||
srslte_dl_sf_cfg_t* sf,
|
||||
srslte_pmch_cfg_t* cfg,
|
||||
uint8_t* data,
|
||||
cf_t* sf_symbols[SRSLTE_MAX_PORTS]);
|
||||
|
||||
SRSLTE_API int srslte_pmch_decode(srslte_pmch_t* q,
|
||||
srslte_dl_sf_cfg_t* sf,
|
||||
srslte_pmch_cfg_t* cfg,
|
||||
srslte_chest_dl_res_t* channel,
|
||||
cf_t* sf_symbols[SRSLTE_MAX_PORTS],
|
||||
srslte_pdsch_res_t* data);
|
||||
|
||||
#endif // SRSLTE_PMCH_H
|
|
@ -1,90 +0,0 @@
|
|||
/**
|
||||
*
|
||||
* \section COPYRIGHT
|
||||
*
|
||||
* Copyright 2013-2020 Software Radio Systems Limited
|
||||
*
|
||||
* By using this file, you agree to the terms and conditions set
|
||||
* forth in the LICENSE file which can be found at the top level of
|
||||
* the distribution.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef SRSLTE_PSCCH_H
|
||||
#define SRSLTE_PSCCH_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "srslte/phy/common/phy_common_sl.h"
|
||||
#include "srslte/phy/common/sequence.h"
|
||||
#include "srslte/phy/dft/dft_precoding.h"
|
||||
#include "srslte/phy/fec/convolutional/convcoder.h"
|
||||
#include "srslte/phy/fec/convolutional/viterbi.h"
|
||||
#include "srslte/phy/fec/crc.h"
|
||||
#include "srslte/phy/modem/modem_table.h"
|
||||
|
||||
/**
|
||||
* \brief Physical Sidelink control channel.
|
||||
*
|
||||
* Reference: 3GPP TS 36.211 version 15.6.0 Release 15 Section 9.4
|
||||
*/
|
||||
|
||||
typedef struct SRSLTE_API {
|
||||
|
||||
uint32_t max_prb;
|
||||
srslte_cell_sl_t cell;
|
||||
|
||||
uint32_t sci_len;
|
||||
uint32_t nof_tx_re;
|
||||
|
||||
uint32_t pscch_nof_prb;
|
||||
|
||||
// crc
|
||||
uint8_t* c;
|
||||
srslte_crc_t crc;
|
||||
uint8_t* sci_crc;
|
||||
|
||||
// channel coding
|
||||
srslte_viterbi_t dec;
|
||||
srslte_convcoder_t encoder;
|
||||
uint8_t* d;
|
||||
int16_t* d_16;
|
||||
|
||||
// rate matching
|
||||
uint32_t E;
|
||||
uint8_t* e;
|
||||
int16_t* e_16;
|
||||
|
||||
uint8_t* e_bytes; ///< To pack bits to bytes
|
||||
uint32_t nof_symbols;
|
||||
|
||||
// interleaving
|
||||
uint32_t* interleaver_lut;
|
||||
uint8_t* codeword;
|
||||
uint8_t* codeword_bytes;
|
||||
|
||||
// scrambling
|
||||
srslte_sequence_t seq;
|
||||
|
||||
// modulation
|
||||
srslte_modem_table_t mod;
|
||||
cf_t* mod_symbols;
|
||||
int16_t* llr;
|
||||
|
||||
// dft precoding
|
||||
srslte_dft_precoding_t dft_precoder;
|
||||
srslte_dft_precoding_t idft_precoder;
|
||||
|
||||
cf_t* scfdma_symbols;
|
||||
|
||||
} srslte_pscch_t;
|
||||
|
||||
SRSLTE_API int srslte_pscch_init(srslte_pscch_t* q, uint32_t max_prb);
|
||||
SRSLTE_API int srslte_pscch_set_cell(srslte_pscch_t* q, srslte_cell_sl_t cell);
|
||||
SRSLTE_API int srslte_pscch_encode(srslte_pscch_t* q, uint8_t* sci, cf_t* sf_buffer, uint32_t prb_start_idx);
|
||||
SRSLTE_API int srslte_pscch_decode(srslte_pscch_t* q, cf_t* equalized_sf_syms, uint8_t* sci, uint32_t prb_start_idx);
|
||||
SRSLTE_API int srslte_pscch_put(srslte_pscch_t* q, cf_t* sf_buffer, uint32_t prb_start_idx);
|
||||
SRSLTE_API int srslte_pscch_get(srslte_pscch_t* q, cf_t* sf_buffer, uint32_t prb_start_idx);
|
||||
SRSLTE_API void srslte_pscch_free(srslte_pscch_t* q);
|
||||
|
||||
#endif // SRSLTE_PSCCH_H
|
|
@ -1,175 +0,0 @@
|
|||
/**
|
||||
*
|
||||
* \section COPYRIGHT
|
||||
*
|
||||
* Copyright 2013-2020 Software Radio Systems Limited
|
||||
*
|
||||
* By using this file, you agree to the terms and conditions set
|
||||
* forth in the LICENSE file which can be found at the top level of
|
||||
* the distribution.
|
||||
*
|
||||
*/
|
||||
|
||||
/******************************************************************************
|
||||
* File: pucch.h
|
||||
*
|
||||
* Description: Physical uplink control channel.
|
||||
*
|
||||
* Reference: 3GPP TS 36.211 version 10.0.0 Release 10 Sec. 5.4
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef SRSLTE_PUCCH_H
|
||||
#define SRSLTE_PUCCH_H
|
||||
|
||||
#include "srslte/config.h"
|
||||
#include "srslte/phy/ch_estimation/chest_ul.h"
|
||||
#include "srslte/phy/common/phy_common.h"
|
||||
#include "srslte/phy/common/sequence.h"
|
||||
#include "srslte/phy/modem/mod.h"
|
||||
#include "srslte/phy/phch/cqi.h"
|
||||
#include "srslte/phy/phch/pucch_cfg.h"
|
||||
#include "srslte/phy/phch/uci.h"
|
||||
|
||||
#define SRSLTE_PUCCH_N_SEQ SRSLTE_NRE
|
||||
#define SRSLTE_PUCCH2_NOF_BITS SRSLTE_UCI_CQI_CODED_PUCCH_B
|
||||
#define SRSLTE_PUCCH2_N_SF (5)
|
||||
#define SRSLTE_PUCCH_1A_2A_NOF_ACK (1)
|
||||
#define SRSLTE_PUCCH_1B_2B_NOF_ACK (2)
|
||||
#define SRSLTE_PUCCH3_NOF_BITS (4 * SRSLTE_NRE)
|
||||
#define SRSLTE_PUCCH_MAX_SYMBOLS (SRSLTE_PUCCH_N_SEQ * SRSLTE_PUCCH2_N_SF * SRSLTE_NOF_SLOTS_PER_SF)
|
||||
|
||||
// PUCCH Format 1B Channel selection
|
||||
#define SRSLTE_PUCCH_CS_MAX_ACK 4
|
||||
#define SRSLTE_PUCCH_CS_MAX_CARRIERS 2
|
||||
#define SRSLTE_PUCCH_FORMAT3_MAX_CARRIERS 5
|
||||
|
||||
#define SRSLTE_PUCCH_DEFAULT_THRESHOLD_FORMAT1 (0.5f)
|
||||
#define SRSLTE_PUCCH_DEFAULT_THRESHOLD_FORMAT1A (0.5f)
|
||||
#define SRSLTE_PUCCH_DEFAULT_THRESHOLD_FORMAT2 (0.5f)
|
||||
#define SRSLTE_PUCCH_DEFAULT_THRESHOLD_FORMAT3 (0.5f)
|
||||
#define SRSLTE_PUCCH_DEFAULT_THRESHOLD_DMRS (0.4f)
|
||||
|
||||
/* PUCCH object */
|
||||
typedef struct SRSLTE_API {
|
||||
srslte_cell_t cell;
|
||||
srslte_modem_table_t mod;
|
||||
|
||||
srslte_uci_cqi_pucch_t cqi;
|
||||
|
||||
srslte_sequence_t seq_f2;
|
||||
bool is_ue;
|
||||
|
||||
int16_t llr[SRSLTE_PUCCH3_NOF_BITS];
|
||||
uint8_t bits_scram[SRSLTE_PUCCH_MAX_BITS];
|
||||
cf_t d[SRSLTE_PUCCH_MAX_BITS / 2];
|
||||
uint32_t n_cs_cell[SRSLTE_NSLOTS_X_FRAME][SRSLTE_CP_NORM_NSYMB];
|
||||
uint32_t f_gh[SRSLTE_NSLOTS_X_FRAME];
|
||||
|
||||
cf_t* z;
|
||||
cf_t* z_tmp;
|
||||
cf_t* ce;
|
||||
|
||||
} srslte_pucch_t;
|
||||
|
||||
typedef struct SRSLTE_API {
|
||||
srslte_uci_value_t uci_data;
|
||||
float dmrs_correlation;
|
||||
float snr_db;
|
||||
float correlation;
|
||||
bool detected;
|
||||
|
||||
// PUCCH Measurements
|
||||
bool ta_valid;
|
||||
float ta_us;
|
||||
} srslte_pucch_res_t;
|
||||
|
||||
SRSLTE_API int srslte_pucch_init_ue(srslte_pucch_t* q);
|
||||
|
||||
SRSLTE_API int srslte_pucch_init_enb(srslte_pucch_t* q);
|
||||
|
||||
SRSLTE_API void srslte_pucch_free(srslte_pucch_t* q);
|
||||
|
||||
/* These functions modify the state of the object and may take some time */
|
||||
SRSLTE_API int srslte_pucch_set_cell(srslte_pucch_t* q, srslte_cell_t cell);
|
||||
|
||||
/* These functions do not modify the state and run in real-time */
|
||||
SRSLTE_API void srslte_pucch_uci_gen_cfg(srslte_pucch_t* q, srslte_pucch_cfg_t* cfg, srslte_uci_data_t* uci_data);
|
||||
|
||||
SRSLTE_API int srslte_pucch_encode(srslte_pucch_t* q,
|
||||
srslte_ul_sf_cfg_t* sf,
|
||||
srslte_pucch_cfg_t* cfg,
|
||||
srslte_uci_value_t* uci_data,
|
||||
cf_t* sf_symbols);
|
||||
|
||||
SRSLTE_API int srslte_pucch_decode(srslte_pucch_t* q,
|
||||
srslte_ul_sf_cfg_t* sf,
|
||||
srslte_pucch_cfg_t* cfg,
|
||||
srslte_chest_ul_res_t* channel,
|
||||
cf_t* sf_symbols,
|
||||
srslte_pucch_res_t* data);
|
||||
|
||||
/* Other utilities. These functions do not modify the state and run in real-time */
|
||||
SRSLTE_API float srslte_pucch_alpha_format1(const uint32_t n_cs_cell[SRSLTE_NSLOTS_X_FRAME][SRSLTE_CP_NORM_NSYMB],
|
||||
const srslte_pucch_cfg_t* cfg,
|
||||
srslte_cp_t cp,
|
||||
bool is_dmrs,
|
||||
uint32_t ns,
|
||||
uint32_t l,
|
||||
uint32_t* n_oc,
|
||||
uint32_t* n_prime_ns);
|
||||
|
||||
SRSLTE_API float srslte_pucch_alpha_format2(const uint32_t n_cs_cell[SRSLTE_NSLOTS_X_FRAME][SRSLTE_CP_NORM_NSYMB],
|
||||
const srslte_pucch_cfg_t* cfg,
|
||||
uint32_t ns,
|
||||
uint32_t l);
|
||||
|
||||
SRSLTE_API int srslte_pucch_format2ab_mod_bits(srslte_pucch_format_t format, uint8_t bits[2], cf_t* d_10);
|
||||
|
||||
SRSLTE_API uint32_t srslte_pucch_m(const srslte_pucch_cfg_t* cfg, srslte_cp_t cp);
|
||||
|
||||
SRSLTE_API uint32_t srslte_pucch_n_prb(const srslte_cell_t* cell, const srslte_pucch_cfg_t* cfg, uint32_t ns);
|
||||
|
||||
SRSLTE_API int srslte_pucch_n_cs_cell(srslte_cell_t cell,
|
||||
uint32_t n_cs_cell[SRSLTE_NSLOTS_X_FRAME][SRSLTE_CP_NORM_NSYMB]);
|
||||
|
||||
/**
|
||||
* Checks PUCCH collision from cell and two PUCCH configurations. The provided configurations shall provide format and
|
||||
* n_pucch resource prior to this call.
|
||||
*
|
||||
* @param cell cell parameters
|
||||
* @param cfg1 First PUCCH configuration
|
||||
* @param cfg2 Second PUCCH configuration
|
||||
* @return SRSLTE_SUCCESS if no collision, SRSLTE_ERROR if collision and otherwise SRSLTE_INVALID_INPUTS
|
||||
*/
|
||||
SRSLTE_API int
|
||||
srslte_pucch_collision(const srslte_cell_t* cell, const srslte_pucch_cfg_t* cfg1, const srslte_pucch_cfg_t* cfg2);
|
||||
|
||||
/**
|
||||
* Checks PUCCH format 1b with channel selection collision configuration from a cell.
|
||||
*
|
||||
* @param cell cell parameters
|
||||
* @param cfg PUCCH configuration
|
||||
* @return SRSLTE_SUCCESS if no collision, SRSLTE_ERROR if collision and otherwise SRSLTE_INVALID_INPUTS
|
||||
*/
|
||||
SRSLTE_API int srslte_pucch_cfg_assert(const srslte_cell_t* cell, const srslte_pucch_cfg_t* cfg);
|
||||
|
||||
SRSLTE_API char* srslte_pucch_format_text(srslte_pucch_format_t format);
|
||||
|
||||
SRSLTE_API char* srslte_pucch_format_text_short(srslte_pucch_format_t format);
|
||||
|
||||
/**
|
||||
* Returns the number of ACK bits supported by a given PUCCH format
|
||||
* @param format PUCCH format
|
||||
* @return Returns the number of bits supported by the format
|
||||
*/
|
||||
SRSLTE_API uint32_t srslte_pucch_nof_ack_format(srslte_pucch_format_t format);
|
||||
|
||||
SRSLTE_API void
|
||||
srslte_pucch_tx_info(srslte_pucch_cfg_t* cfg, srslte_uci_value_t* uci_data, char* str, uint32_t str_len);
|
||||
|
||||
SRSLTE_API void
|
||||
srslte_pucch_rx_info(srslte_pucch_cfg_t* cfg, srslte_pucch_res_t* pucch_res, char* str, uint32_t str_len);
|
||||
|
||||
SRSLTE_API bool srslte_pucch_cfg_isvalid(srslte_pucch_cfg_t* cfg, uint32_t nof_prb);
|
||||
|
||||
#endif // SRSLTE_PUCCH_H
|
|
@ -1,130 +0,0 @@
|
|||
/**
|
||||
*
|
||||
* \section COPYRIGHT
|
||||
*
|
||||
* Copyright 2013-2020 Software Radio Systems Limited
|
||||
*
|
||||
* By using this file, you agree to the terms and conditions set
|
||||
* forth in the LICENSE file which can be found at the top level of
|
||||
* the distribution.
|
||||
*
|
||||
*/
|
||||
|
||||
/******************************************************************************
|
||||
* File: pusch.h
|
||||
*
|
||||
* Description: Physical uplink shared channel.
|
||||
*
|
||||
* Reference: 3GPP TS 36.211 version 10.0.0 Release 10 Sec. 5.3
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef SRSLTE_PUSCH_H
|
||||
#define SRSLTE_PUSCH_H
|
||||
|
||||
#include "srslte/config.h"
|
||||
#include "srslte/phy/ch_estimation/refsignal_ul.h"
|
||||
#include "srslte/phy/common/phy_common.h"
|
||||
#include "srslte/phy/dft/dft_precoding.h"
|
||||
#include "srslte/phy/mimo/layermap.h"
|
||||
#include "srslte/phy/mimo/precoding.h"
|
||||
#include "srslte/phy/modem/demod_soft.h"
|
||||
#include "srslte/phy/modem/evm.h"
|
||||
#include "srslte/phy/modem/mod.h"
|
||||
#include "srslte/phy/phch/dci.h"
|
||||
#include "srslte/phy/phch/pusch_cfg.h"
|
||||
#include "srslte/phy/phch/regs.h"
|
||||
#include "srslte/phy/phch/sch.h"
|
||||
#include "srslte/phy/scrambling/scrambling.h"
|
||||
|
||||
/* PUSCH object */
|
||||
typedef struct SRSLTE_API {
|
||||
srslte_cell_t cell;
|
||||
|
||||
bool is_ue;
|
||||
uint16_t ue_rnti;
|
||||
uint32_t max_re;
|
||||
|
||||
bool llr_is_8bit;
|
||||
|
||||
srslte_dft_precoding_t dft_precoding;
|
||||
|
||||
/* buffers */
|
||||
// void buffers are shared for tx and rx
|
||||
cf_t* ce;
|
||||
cf_t* z;
|
||||
cf_t* d;
|
||||
|
||||
void* q;
|
||||
void* g;
|
||||
|
||||
/* tx & rx objects */
|
||||
srslte_modem_table_t mod[SRSLTE_MOD_NITEMS];
|
||||
srslte_sch_t ul_sch;
|
||||
|
||||
// EVM buffer
|
||||
srslte_evm_buffer_t* evm_buffer;
|
||||
|
||||
} srslte_pusch_t;
|
||||
|
||||
typedef struct SRSLTE_API {
|
||||
uint8_t* ptr;
|
||||
srslte_uci_value_t uci;
|
||||
} srslte_pusch_data_t;
|
||||
|
||||
typedef struct SRSLTE_API {
|
||||
uint8_t* data;
|
||||
srslte_uci_value_t uci;
|
||||
bool crc;
|
||||
float avg_iterations_block;
|
||||
float evm;
|
||||
float epre_dbfs;
|
||||
} srslte_pusch_res_t;
|
||||
|
||||
SRSLTE_API int srslte_pusch_init_ue(srslte_pusch_t* q, uint32_t max_prb);
|
||||
|
||||
SRSLTE_API int srslte_pusch_init_enb(srslte_pusch_t* q, uint32_t max_prb);
|
||||
|
||||
SRSLTE_API void srslte_pusch_free(srslte_pusch_t* q);
|
||||
|
||||
/* These functions modify the state of the object and may take some time */
|
||||
SRSLTE_API int srslte_pusch_set_cell(srslte_pusch_t* q, srslte_cell_t cell);
|
||||
|
||||
/**
|
||||
* Asserts PUSCH grant attributes are in range
|
||||
* @param grant Pointer to PUSCH grant
|
||||
* @return it returns SRSLTE_SUCCESS if the grant is correct, otherwise it returns a SRSLTE_ERROR code
|
||||
*/
|
||||
SRSLTE_API int srslte_pusch_assert_grant(const srslte_pusch_grant_t* grant);
|
||||
|
||||
/* These functions do not modify the state and run in real-time */
|
||||
SRSLTE_API int srslte_pusch_encode(srslte_pusch_t* q,
|
||||
srslte_ul_sf_cfg_t* sf,
|
||||
srslte_pusch_cfg_t* cfg,
|
||||
srslte_pusch_data_t* data,
|
||||
cf_t* sf_symbols);
|
||||
|
||||
SRSLTE_API int srslte_pusch_decode(srslte_pusch_t* q,
|
||||
srslte_ul_sf_cfg_t* sf,
|
||||
srslte_pusch_cfg_t* cfg,
|
||||
srslte_chest_ul_res_t* channel,
|
||||
cf_t* sf_symbols,
|
||||
srslte_pusch_res_t* data);
|
||||
|
||||
SRSLTE_API uint32_t srslte_pusch_grant_tx_info(srslte_pusch_grant_t* grant,
|
||||
srslte_uci_cfg_t* uci_cfg,
|
||||
srslte_uci_value_t* uci_data,
|
||||
char* str,
|
||||
uint32_t str_len);
|
||||
|
||||
SRSLTE_API uint32_t srslte_pusch_tx_info(srslte_pusch_cfg_t* cfg,
|
||||
srslte_uci_value_t* uci_data,
|
||||
char* str,
|
||||
uint32_t str_len);
|
||||
|
||||
SRSLTE_API uint32_t srslte_pusch_rx_info(srslte_pusch_cfg_t* cfg,
|
||||
srslte_pusch_res_t* res,
|
||||
srslte_chest_ul_res_t* chest_res,
|
||||
char* str,
|
||||
uint32_t str_len);
|
||||
|
||||
#endif // SRSLTE_PUSCH_H
|
|
@ -1,98 +0,0 @@
|
|||
/**
|
||||
*
|
||||
* \section COPYRIGHT
|
||||
*
|
||||
* Copyright 2013-2020 Software Radio Systems Limited
|
||||
*
|
||||
* By using this file, you agree to the terms and conditions set
|
||||
* forth in the LICENSE file which can be found at the top level of
|
||||
* the distribution.
|
||||
*
|
||||
*/
|
||||
|
||||
/******************************************************************************
|
||||
* File: ra.h
|
||||
*
|
||||
* Description: Implements Resource allocation Procedures common in for DL and UL
|
||||
*
|
||||
* Reference: 3GPP TS 36.213 version 10.0.1 Release 10
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef SRSLTE_RA_H
|
||||
#define SRSLTE_RA_H
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "srslte/config.h"
|
||||
#include "srslte/phy/common/phy_common.h"
|
||||
|
||||
/**************************************************
|
||||
* Common structures used for Resource Allocation
|
||||
**************************************************/
|
||||
|
||||
typedef struct SRSLTE_API {
|
||||
srslte_mod_t mod;
|
||||
int tbs;
|
||||
int rv;
|
||||
uint32_t nof_bits;
|
||||
uint32_t cw_idx;
|
||||
bool enabled;
|
||||
|
||||
// this is for debugging and metrics purposes
|
||||
uint32_t mcs_idx;
|
||||
} srslte_ra_tb_t;
|
||||
|
||||
typedef enum SRSLTE_API {
|
||||
SRSLTE_RA_ALLOC_TYPE0 = 0,
|
||||
SRSLTE_RA_ALLOC_TYPE1 = 1,
|
||||
SRSLTE_RA_ALLOC_TYPE2 = 2
|
||||
} srslte_ra_type_t;
|
||||
|
||||
typedef struct SRSLTE_API {
|
||||
uint32_t rbg_bitmask;
|
||||
} srslte_ra_type0_t;
|
||||
|
||||
typedef struct SRSLTE_API {
|
||||
uint32_t vrb_bitmask;
|
||||
uint32_t rbg_subset;
|
||||
bool shift;
|
||||
} srslte_ra_type1_t;
|
||||
|
||||
typedef struct SRSLTE_API {
|
||||
uint32_t riv; // if L_crb==0, DCI message packer will take this value directly
|
||||
enum { SRSLTE_RA_TYPE2_NPRB1A_2 = 0, SRSLTE_RA_TYPE2_NPRB1A_3 = 1 } n_prb1a;
|
||||
enum { SRSLTE_RA_TYPE2_NG1 = 0, SRSLTE_RA_TYPE2_NG2 = 1 } n_gap;
|
||||
enum { SRSLTE_RA_TYPE2_LOC = 0, SRSLTE_RA_TYPE2_DIST = 1 } mode;
|
||||
} srslte_ra_type2_t;
|
||||
|
||||
#define SRSLTE_RA_NOF_TBS_IDX 34
|
||||
|
||||
SRSLTE_API uint32_t srslte_ra_type0_P(uint32_t nof_prb);
|
||||
|
||||
SRSLTE_API uint32_t srslte_ra_type2_n_vrb_dl(uint32_t nof_prb, bool ngap_is_1);
|
||||
|
||||
SRSLTE_API uint32_t srslte_ra_type2_n_rb_step(uint32_t nof_prb);
|
||||
|
||||
SRSLTE_API uint32_t srslte_ra_type2_ngap(uint32_t nof_prb, bool ngap_is_1);
|
||||
|
||||
SRSLTE_API uint32_t srslte_ra_type1_N_rb(uint32_t nof_prb);
|
||||
|
||||
SRSLTE_API uint32_t srslte_ra_type2_to_riv(uint32_t L_crb, uint32_t RB_start, uint32_t nof_prb);
|
||||
|
||||
SRSLTE_API void
|
||||
srslte_ra_type2_from_riv(uint32_t riv, uint32_t* L_crb, uint32_t* RB_start, uint32_t nof_prb, uint32_t nof_vrb);
|
||||
|
||||
SRSLTE_API int srslte_ra_tbs_idx_from_mcs(uint32_t mcs, bool use_tbs_index_alt, bool is_ul);
|
||||
|
||||
SRSLTE_API srslte_mod_t srslte_ra_dl_mod_from_mcs(uint32_t mcs, bool use_tbs_index_alt);
|
||||
|
||||
SRSLTE_API srslte_mod_t srslte_ra_ul_mod_from_mcs(uint32_t mcs);
|
||||
|
||||
SRSLTE_API int srslte_ra_mcs_from_tbs_idx(uint32_t tbs_idx, bool use_tbs_index_alt, bool is_ul);
|
||||
|
||||
SRSLTE_API int srslte_ra_tbs_from_idx(uint32_t tbs_idx, uint32_t n_prb);
|
||||
|
||||
SRSLTE_API int srslte_ra_tbs_to_table_idx(uint32_t tbs, uint32_t n_prb, uint32_t max_tbs_idx);
|
||||
|
||||
#endif // SRSLTE_RA_H
|
|
@ -1,65 +0,0 @@
|
|||
/**
|
||||
*
|
||||
* \section COPYRIGHT
|
||||
*
|
||||
* Copyright 2013-2020 Software Radio Systems Limited
|
||||
*
|
||||
* By using this file, you agree to the terms and conditions set
|
||||
* forth in the LICENSE file which can be found at the top level of
|
||||
* the distribution.
|
||||
*
|
||||
*/
|
||||
|
||||
/******************************************************************************
|
||||
* File: ra_dl.h
|
||||
*
|
||||
* Description: Implements Resource allocation Procedures for DL defined in Section 7
|
||||
*
|
||||
* Reference: 3GPP TS 36.213 version 10.0.1 Release 10
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef SRSLTE_RA_DL_H
|
||||
#define SRSLTE_RA_DL_H
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "srslte/config.h"
|
||||
#include "srslte/phy/common/phy_common.h"
|
||||
#include "srslte/phy/phch/dci.h"
|
||||
#include "srslte/phy/phch/pdsch_cfg.h"
|
||||
#include "srslte/phy/phch/ra.h"
|
||||
|
||||
/**************************************************
|
||||
* Structures used for Downlink Resource Allocation
|
||||
**************************************************/
|
||||
|
||||
/** Functions to generate a grant from a received DCI */
|
||||
SRSLTE_API int srslte_ra_dl_dci_to_grant(const srslte_cell_t* cell,
|
||||
srslte_dl_sf_cfg_t* sf,
|
||||
srslte_tm_t tm,
|
||||
bool pdsch_use_tbs_index_alt,
|
||||
const srslte_dci_dl_t* dci,
|
||||
srslte_pdsch_grant_t* grant);
|
||||
|
||||
SRSLTE_API int
|
||||
srslte_ra_dl_grant_to_grant_prb_allocation(const srslte_dci_dl_t* dci, srslte_pdsch_grant_t* grant, uint32_t nof_prb);
|
||||
|
||||
/** Functions used by the eNodeB scheduler */
|
||||
SRSLTE_API uint32_t srslte_ra_dl_approx_nof_re(const srslte_cell_t* cell, uint32_t nof_prb, uint32_t nof_ctrl_symbols);
|
||||
|
||||
SRSLTE_API uint32_t ra_re_x_prb(const srslte_cell_t* cell, srslte_dl_sf_cfg_t* sf, uint32_t slot, uint32_t prb_idx);
|
||||
|
||||
SRSLTE_API uint32_t srslte_ra_dl_grant_nof_re(const srslte_cell_t* cell,
|
||||
srslte_dl_sf_cfg_t* sf,
|
||||
srslte_pdsch_grant_t* grant);
|
||||
|
||||
/** Others */
|
||||
SRSLTE_API int srslte_dl_fill_ra_mcs(srslte_ra_tb_t* tb, int last_tbs, uint32_t nprb, bool pdsch_use_tbs_index_alt);
|
||||
|
||||
SRSLTE_API void
|
||||
srslte_ra_dl_compute_nof_re(const srslte_cell_t* cell, srslte_dl_sf_cfg_t* sf, srslte_pdsch_grant_t* grant);
|
||||
|
||||
SRSLTE_API uint32_t srslte_ra_dl_info(srslte_pdsch_grant_t* grant, char* info_str, uint32_t len);
|
||||
|
||||
#endif // SRSLTE_RA_DL_H
|
|
@ -1,60 +0,0 @@
|
|||
/**
|
||||
*
|
||||
* \section COPYRIGHT
|
||||
*
|
||||
* Copyright 2013-2020 Software Radio Systems Limited
|
||||
*
|
||||
* By using this file, you agree to the terms and conditions set
|
||||
* forth in the LICENSE file which can be found at the top level of
|
||||
* the distribution.
|
||||
*
|
||||
*/
|
||||
|
||||
/******************************************************************************
|
||||
* File: ra_ul.h
|
||||
*
|
||||
* Description: Implements Resource allocation Procedures for UL defined in Sections 8
|
||||
*
|
||||
* Reference: 3GPP TS 36.213 version 10.0.1 Release 10
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef SRSLTE_RA_UL_H
|
||||
#define SRSLTE_RA_UL_H
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "srslte/config.h"
|
||||
#include "srslte/phy/common/phy_common.h"
|
||||
#include "srslte/phy/phch/dci.h"
|
||||
#include "srslte/phy/phch/pusch_cfg.h"
|
||||
|
||||
// Structure for PUSCH frequency hopping procedure
|
||||
typedef struct SRSLTE_API {
|
||||
bool initialized;
|
||||
srslte_cell_t cell;
|
||||
srslte_sequence_t seq_type2_fo;
|
||||
} srslte_ra_ul_pusch_hopping_t;
|
||||
|
||||
SRSLTE_API int srslte_ra_ul_pusch_hopping_init(srslte_ra_ul_pusch_hopping_t* q, srslte_cell_t cell);
|
||||
|
||||
SRSLTE_API void srslte_ra_ul_pusch_hopping_free(srslte_ra_ul_pusch_hopping_t* q);
|
||||
|
||||
SRSLTE_API void srslte_ra_ul_pusch_hopping(srslte_ra_ul_pusch_hopping_t* q,
|
||||
srslte_ul_sf_cfg_t* sf,
|
||||
srslte_pusch_hopping_cfg_t* hopping_cfg,
|
||||
srslte_pusch_grant_t* grant);
|
||||
|
||||
/** Functions to generate a grant from a received DCI */
|
||||
SRSLTE_API int srslte_ra_ul_dci_to_grant(srslte_cell_t* cell,
|
||||
srslte_ul_sf_cfg_t* sf,
|
||||
srslte_pusch_hopping_cfg_t* hopping_cfg,
|
||||
srslte_dci_ul_t* dci,
|
||||
srslte_pusch_grant_t* grant);
|
||||
|
||||
SRSLTE_API void srslte_ra_ul_compute_nof_re(srslte_pusch_grant_t* grant, srslte_cp_t cp, uint32_t N_srs);
|
||||
|
||||
/** Others */
|
||||
SRSLTE_API uint32_t srslte_ra_ul_info(const srslte_pusch_grant_t* grant, char* info_str, uint32_t len);
|
||||
|
||||
#endif // SRSLTE_RA_UL_H
|
|
@ -1,133 +0,0 @@
|
|||
/**
|
||||
*
|
||||
* \section COPYRIGHT
|
||||
*
|
||||
* Copyright 2013-2020 Software Radio Systems Limited
|
||||
*
|
||||
* By using this file, you agree to the terms and conditions set
|
||||
* forth in the LICENSE file which can be found at the top level of
|
||||
* the distribution.
|
||||
*
|
||||
*/
|
||||
|
||||
/******************************************************************************
|
||||
* File: sch.h
|
||||
*
|
||||
* Description: Common UL and DL shared channel encode/decode functions.
|
||||
*
|
||||
* Reference: 3GPP TS 36.212 version 10.0.0 Release 10
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef SRSLTE_SCH_H
|
||||
#define SRSLTE_SCH_H
|
||||
|
||||
#include "srslte/config.h"
|
||||
#include "srslte/phy/common/phy_common.h"
|
||||
#include "srslte/phy/fec/crc.h"
|
||||
#include "srslte/phy/fec/turbo/rm_turbo.h"
|
||||
#include "srslte/phy/fec/turbo/turbocoder.h"
|
||||
#include "srslte/phy/fec/turbo/turbodecoder.h"
|
||||
#include "srslte/phy/phch/pdsch_cfg.h"
|
||||
#include "srslte/phy/phch/pusch_cfg.h"
|
||||
#include "srslte/phy/phch/uci.h"
|
||||
|
||||
#ifndef SRSLTE_RX_NULL
|
||||
#define SRSLTE_RX_NULL 10000
|
||||
#endif
|
||||
|
||||
#ifndef SRSLTE_TX_NULL
|
||||
#define SRSLTE_TX_NULL 100
|
||||
#endif
|
||||
|
||||
/* DL-SCH AND UL-SCH common functions */
|
||||
typedef struct SRSLTE_API {
|
||||
|
||||
uint32_t max_iterations;
|
||||
float avg_iterations;
|
||||
|
||||
bool llr_is_8bit;
|
||||
|
||||
/* buffers */
|
||||
uint8_t* cb_in;
|
||||
uint8_t* parity_bits;
|
||||
void* e;
|
||||
uint8_t* temp_g_bits;
|
||||
uint32_t* ul_interleaver;
|
||||
srslte_uci_bit_t ack_ri_bits[57600]; // 4*M_sc*Qm_max for RI and ACK
|
||||
|
||||
srslte_tcod_t encoder;
|
||||
srslte_tdec_t decoder;
|
||||
srslte_crc_t crc_tb;
|
||||
srslte_crc_t crc_cb;
|
||||
|
||||
srslte_uci_cqi_pusch_t uci_cqi;
|
||||
|
||||
} srslte_sch_t;
|
||||
|
||||
SRSLTE_API int srslte_sch_init(srslte_sch_t* q);
|
||||
|
||||
SRSLTE_API void srslte_sch_free(srslte_sch_t* q);
|
||||
|
||||
SRSLTE_API void srslte_sch_set_max_noi(srslte_sch_t* q, uint32_t max_iterations);
|
||||
|
||||
SRSLTE_API float srslte_sch_last_noi(srslte_sch_t* q);
|
||||
|
||||
SRSLTE_API int srslte_dlsch_encode(srslte_sch_t* q, srslte_pdsch_cfg_t* cfg, uint8_t* data, uint8_t* e_bits);
|
||||
|
||||
SRSLTE_API int srslte_dlsch_encode2(srslte_sch_t* q,
|
||||
srslte_pdsch_cfg_t* cfg,
|
||||
uint8_t* data,
|
||||
uint8_t* e_bits,
|
||||
int codeword_idx,
|
||||
uint32_t nof_layers);
|
||||
|
||||
SRSLTE_API int srslte_dlsch_decode(srslte_sch_t* q, srslte_pdsch_cfg_t* cfg, int16_t* e_bits, uint8_t* data);
|
||||
|
||||
SRSLTE_API int srslte_dlsch_decode2(srslte_sch_t* q,
|
||||
srslte_pdsch_cfg_t* cfg,
|
||||
int16_t* e_bits,
|
||||
uint8_t* data,
|
||||
int codeword_idx,
|
||||
uint32_t nof_layers);
|
||||
|
||||
SRSLTE_API int srslte_ulsch_encode(srslte_sch_t* q,
|
||||
srslte_pusch_cfg_t* cfg,
|
||||
uint8_t* data,
|
||||
srslte_uci_value_t* uci_data,
|
||||
uint8_t* g_bits,
|
||||
uint8_t* q_bits);
|
||||
|
||||
SRSLTE_API int srslte_ulsch_decode(srslte_sch_t* q,
|
||||
srslte_pusch_cfg_t* cfg,
|
||||
int16_t* q_bits,
|
||||
int16_t* g_bits,
|
||||
uint8_t* c_seq,
|
||||
uint8_t* data,
|
||||
srslte_uci_value_t* uci_data);
|
||||
|
||||
SRSLTE_API float srslte_sch_beta_cqi(uint32_t I_cqi);
|
||||
|
||||
SRSLTE_API float srslte_sch_beta_ack(uint32_t I_harq);
|
||||
|
||||
SRSLTE_API uint32_t srslte_sch_find_Ioffset_ack(float beta);
|
||||
|
||||
SRSLTE_API uint32_t srslte_sch_find_Ioffset_cqi(float beta);
|
||||
|
||||
SRSLTE_API uint32_t srslte_sch_find_Ioffset_ri(float beta);
|
||||
|
||||
///< Sidelink uses PUSCH Interleaver in all channels
|
||||
SRSLTE_API void srslte_sl_ulsch_interleave(uint8_t* g_bits,
|
||||
uint32_t Qm,
|
||||
uint32_t H_prime_total,
|
||||
uint32_t N_pusch_symbs,
|
||||
uint8_t* q_bits);
|
||||
|
||||
///< Sidelink uses PUSCH Deinterleaver in all channels
|
||||
SRSLTE_API void srslte_sl_ulsch_deinterleave(int16_t* q_bits,
|
||||
uint32_t Qm,
|
||||
uint32_t H_prime_total,
|
||||
uint32_t N_pusch_symbs,
|
||||
int16_t* g_bits,
|
||||
uint32_t* inteleaver_lut);
|
||||
|
||||
#endif // SRSLTE_SCH_H
|
|
@ -1,64 +0,0 @@
|
|||
/**
|
||||
*
|
||||
* \section COPYRIGHT
|
||||
*
|
||||
* Copyright 2013-2020 Software Radio Systems Limited
|
||||
*
|
||||
* By using this file, you agree to the terms and conditions set
|
||||
* forth in the LICENSE file which can be found at the top level of
|
||||
* the distribution.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef SRSLTE_UCI_CFG_H
|
||||
#define SRSLTE_UCI_CFG_H
|
||||
|
||||
#include "srslte/phy/phch/cqi.h"
|
||||
|
||||
#define SRSLTE_UCI_MAX_ACK_BITS 10
|
||||
#define SRSLTE_UCI_MAX_ACK_SR_BITS (SRSLTE_UCI_MAX_ACK_BITS + 1)
|
||||
#define SRSLTE_UCI_MAX_M 9
|
||||
|
||||
typedef struct SRSLTE_API {
|
||||
uint8_t ack_value[SRSLTE_UCI_MAX_ACK_BITS];
|
||||
bool valid;
|
||||
} srslte_uci_value_ack_t;
|
||||
|
||||
typedef struct SRSLTE_API {
|
||||
bool pending_tb[SRSLTE_MAX_CODEWORDS]; //< Indicates whether there was a grant that requires an ACK/NACK
|
||||
uint32_t nof_acks; //< Number of transport blocks, deduced from transmission mode
|
||||
uint32_t ncce[SRSLTE_UCI_MAX_M];
|
||||
uint32_t N_bundle;
|
||||
uint32_t tdd_ack_M;
|
||||
uint32_t tdd_ack_m;
|
||||
bool tdd_is_multiplex;
|
||||
uint32_t tpc_for_pucch;
|
||||
uint32_t grant_cc_idx;
|
||||
} srslte_uci_cfg_ack_t;
|
||||
|
||||
typedef struct SRSLTE_API {
|
||||
srslte_uci_cfg_ack_t ack[SRSLTE_MAX_CARRIERS];
|
||||
srslte_cqi_cfg_t cqi;
|
||||
bool is_scheduling_request_tti;
|
||||
} srslte_uci_cfg_t;
|
||||
|
||||
typedef struct SRSLTE_API {
|
||||
bool scheduling_request;
|
||||
srslte_cqi_value_t cqi;
|
||||
srslte_uci_value_ack_t ack;
|
||||
uint8_t ri; // Only 1-bit supported for RI
|
||||
} srslte_uci_value_t;
|
||||
|
||||
typedef struct SRSLTE_API {
|
||||
srslte_uci_cfg_t cfg;
|
||||
srslte_uci_value_t value;
|
||||
} srslte_uci_data_t;
|
||||
|
||||
typedef enum { UCI_BIT_0 = 0, UCI_BIT_1 = 1, UCI_BIT_REPETITION = 2, UCI_BIT_PLACEHOLDER = 3 } srslte_uci_bit_type_t;
|
||||
|
||||
typedef struct {
|
||||
uint32_t position;
|
||||
srslte_uci_bit_type_t type;
|
||||
} srslte_uci_bit_t;
|
||||
|
||||
#endif // SRSLTE_UCI_CFG_H
|
|
@ -1,49 +0,0 @@
|
|||
/**
|
||||
*
|
||||
* \section COPYRIGHT
|
||||
*
|
||||
* Copyright 2013-2020 Software Radio Systems Limited
|
||||
*
|
||||
* By using this file, you agree to the terms and conditions set
|
||||
* forth in the LICENSE file which can be found at the top level of
|
||||
* the distribution.
|
||||
*
|
||||
*/
|
||||
|
||||
/******************************************************************************
|
||||
* File: scrambling.h
|
||||
*
|
||||
* Description: Generic scrambling functions used by UL and DL channels.
|
||||
*
|
||||
* Reference: 3GPP TS 36.211 version 10.0.0 Release 10 Sec. 5.3.1, 6.3.1
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef SRSLTE_SCRAMBLING_H
|
||||
#define SRSLTE_SCRAMBLING_H
|
||||
|
||||
#include "srslte/config.h"
|
||||
#include "srslte/phy/common/phy_common.h"
|
||||
#include "srslte/phy/common/sequence.h"
|
||||
|
||||
/* Scrambling has no state */
|
||||
SRSLTE_API void srslte_scrambling_b(srslte_sequence_t* s, uint8_t* data);
|
||||
|
||||
SRSLTE_API void srslte_scrambling_b_offset(srslte_sequence_t* s, uint8_t* data, int offset, int len);
|
||||
|
||||
SRSLTE_API void srslte_scrambling_bytes(srslte_sequence_t* s, uint8_t* data, int len);
|
||||
|
||||
SRSLTE_API void srslte_scrambling_f(srslte_sequence_t* s, float* data);
|
||||
|
||||
SRSLTE_API void srslte_scrambling_f_offset(srslte_sequence_t* s, float* data, int offset, int len);
|
||||
|
||||
SRSLTE_API void srslte_scrambling_s(srslte_sequence_t* s, short* data);
|
||||
|
||||
SRSLTE_API void srslte_scrambling_s_offset(srslte_sequence_t* s, short* data, int offset, int len);
|
||||
|
||||
SRSLTE_API void srslte_scrambling_sb_offset(srslte_sequence_t* s, int8_t* data, int offset, int len);
|
||||
|
||||
SRSLTE_API void srslte_scrambling_c(srslte_sequence_t* s, cf_t* data);
|
||||
|
||||
SRSLTE_API void srslte_scrambling_c_offset(srslte_sequence_t* s, cf_t* data, int offset, int len);
|
||||
|
||||
#endif // SRSLTE_SCRAMBLING_H
|
|
@ -1,56 +0,0 @@
|
|||
/**
|
||||
*
|
||||
* \section COPYRIGHT
|
||||
*
|
||||
* Copyright 2013-2020 Software Radio Systems Limited
|
||||
*
|
||||
* By using this file, you agree to the terms and conditions set
|
||||
* forth in the LICENSE file which can be found at the top level of
|
||||
* the distribution.
|
||||
*
|
||||
*/
|
||||
|
||||
/******************************************************************************
|
||||
* File: cfo.h
|
||||
*
|
||||
* Description: Carrier frequency offset correction using complex exponentials.
|
||||
*
|
||||
* Reference:
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef SRSLTE_CFO_H
|
||||
#define SRSLTE_CFO_H
|
||||
|
||||
#include <complex.h>
|
||||
|
||||
#include "srslte/config.h"
|
||||
#include "srslte/phy/utils/cexptab.h"
|
||||
#include "srslte/phy/common/phy_common.h"
|
||||
|
||||
#define SRSLTE_CFO_CEXPTAB_SIZE 4096
|
||||
|
||||
typedef struct SRSLTE_API {
|
||||
float last_freq;
|
||||
float tol;
|
||||
int nsamples;
|
||||
int max_samples;
|
||||
srslte_cexptab_t tab;
|
||||
cf_t* cur_cexp;
|
||||
} srslte_cfo_t;
|
||||
|
||||
SRSLTE_API int srslte_cfo_init(srslte_cfo_t* h, uint32_t nsamples);
|
||||
|
||||
SRSLTE_API void srslte_cfo_free(srslte_cfo_t* h);
|
||||
|
||||
SRSLTE_API int srslte_cfo_resize(srslte_cfo_t* h, uint32_t samples);
|
||||
|
||||
SRSLTE_API void srslte_cfo_set_tol(srslte_cfo_t* h, float tol);
|
||||
|
||||
SRSLTE_API void srslte_cfo_correct(srslte_cfo_t* h, const cf_t* input, cf_t* output, float freq);
|
||||
|
||||
SRSLTE_API void
|
||||
srslte_cfo_correct_offset(srslte_cfo_t* h, const cf_t* input, cf_t* output, float freq, int cexp_offset, int nsamples);
|
||||
|
||||
SRSLTE_API float srslte_cfo_est_corr_cp(cf_t* input_buffer, uint32_t nof_prb);
|
||||
|
||||
#endif // SRSLTE_CFO_H
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue