Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
oai
openairinterface5G
Commits
b7e147e5
Commit
b7e147e5
authored
Feb 17, 2016
by
Aikaterini Trilyraki
Browse files
Merge branch 'enhancement-74-SoDeRa' into develop
parents
e439a593
1de3183d
Changes
86
Expand all
Hide whitespace changes
Inline
Side-by-side
cmake_targets/CMakeLists.txt
View file @
b7e147e5
...
...
@@ -42,6 +42,10 @@ set (OPENAIR_BIN_DIR ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY})
project
(
OpenAirInterface
)
add_subdirectory
(
${
OPENAIR_TARGETS
}
/ARCH/LMSSDR/USERSPACE/LIB/lms7002m lms7002m
)
add_subdirectory
(
${
OPENAIR_TARGETS
}
/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR lmsSDR
)
add_subdirectory
(
${
OPENAIR_TARGETS
}
/ARCH/LMSSDR/USERSPACE/LIB/Si5351C Si5351C
)
###########################################
# macros to define options as there is numerous options in oai
################################################
...
...
@@ -159,7 +163,7 @@ set(CMAKE_C_FLAGS
"
${
CMAKE_C_FLAGS
}
-DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_FCNTL_H=1 -DHAVE_ARPA_INET_H=1 -DHAVE_SYS_TIME_H=1 -DHAVE_SYS_SOCKET_H=1 -DHAVE_STRERROR=1 -DHAVE_SOCKET=1 -DHAVE_MEMSET=1 -DHAVE_GETTIMEOFDAY=1 -DHAVE_STDLIB_H=1 -DHAVE_MALLOC=1 -DHAVE_LIBSCTP"
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
${
C_FLAGS_PROCESSOR
}
"
"
${
CMAKE_CXX_FLAGS
}
${
C_FLAGS_PROCESSOR
}
-std=c++11
"
)
...
...
@@ -172,6 +176,7 @@ add_definitions(-DCMAKER)
set
(
CMAKE_C_FLAGS_DEBUG
"
${
CMAKE_C_FLAGS
}
-g -DMALLOC_CHECK_=3"
)
set
(
CMAKE_C_FLAGS_RELWITHDEBINFO
"
${
CMAKE_C_FLAGS
}
-g -DMALLOC_CHECK_=3 -O2"
)
Message
(
"RF_BOARD is
${
RF_BOARD
}
"
)
# Below has been put in comment because does not work with
# SVN authentication.
#
...
...
@@ -412,7 +417,7 @@ add_list1_option(NB_ANTENNAS_RX "2" "Number of antennas in reception" "1" "2" "4
add_list1_option
(
NB_ANTENNAS_TX
"2"
"Number of antennas in transmission"
"1"
"2"
"4"
)
add_list1_option
(
NB_ANTENNAS_TXRX
"2"
"Number of antennas in ????"
"1"
"2"
"4"
)
add_list2_option
(
RF_BOARD
"EXMIMO"
"RF head type"
"None"
"EXMIMO"
"OAI_USRP"
"OAI_BLADERF"
"CPRIGW"
)
add_list2_option
(
RF_BOARD
"EXMIMO"
"RF head type"
"None"
"EXMIMO"
"OAI_USRP"
"OAI_BLADERF"
"CPRIGW"
"OAI_LMSSDR"
)
add_list2_option
(
TRANSP_PRO
"None"
"Transport protocol type"
"None"
"ETHERNET"
)
...
...
@@ -443,6 +448,13 @@ set(HWLIB_BLADERF_SOURCE
)
add_library
(
oai_bladerfdevif MODULE
${
HWLIB_BLADERF_SOURCE
}
)
include_directories
(
"
${
OPENAIR_TARGETS
}
/ARCH/LMSSDR/USERSPACE/LIB/"
)
set
(
option_HWLMSSDRLIB_lib
"-l LMS_SDR -l LMS7002M -l Si5351C"
)
set
(
HWLIB_LMSSDR_SOURCE
${
OPENAIR_TARGETS
}
/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp
)
add_library
(
oai_lmssdrdevif MODULE
${
HWLIB_LMSSDR_SOURCE
}
)
include_directories
(
"
${
OPENAIR_TARGETS
}
/ARCH/ETHERNET/USERSPACE/LIB/"
)
set
(
TPLIB_ETHERNET_SOURCE
${
OPENAIR_TARGETS
}
/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.c
...
...
@@ -451,6 +463,7 @@ set(TPLIB_ETHERNET_SOURCE
)
add_library
(
oai_eth_transpro MODULE
${
TPLIB_ETHERNET_SOURCE
}
)
# RF devices / transport protocols settings
######################################################################
if
(
${
RF_BOARD
}
STREQUAL
"EXMIMO"
)
...
...
@@ -478,9 +491,25 @@ elseif (${RF_BOARD} STREQUAL "OAI_BLADERF")
${
OPENAIR_TARGETS
}
/ARCH/BLADERF/USERSPACE/LIB/bladerf_lib.c
)
LINK_DIRECTORIES
(
"/usr/lib/x86_64-linux-gnu"
)
set
(
option_HW_lib
"bladeRF -rdynamic -ldl"
)
elseif
(
${
RF_BOARD
}
STREQUAL
"CPRIGW"
)
#to ask
#set(LOWLATENCY False)
elseif
(
${
RF_BOARD
}
STREQUAL
"OAI_LMSSDR"
)
include_directories
(
"
${
OPENAIR_TARGETS
}
/ARCH/LMSSDR/USERSPACE/LIB"
)
include_directories
(
"
${
OPENAIR_TARGETS
}
/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR"
)
include_directories
(
"
${
OPENAIR_TARGETS
}
/ARCH/LMSSDR/USERSPACE/LIB/lms7002m"
)
include_directories
(
"
${
OPENAIR_TARGETS
}
/ARCH/LMSSDR/USERSPACE/LIB/Si5351C"
)
include_directories
(
"
${
OPENAIR_TARGETS
}
/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/LMS_StreamBoard"
)
LINK_DIRECTORIES
(
"/usr/lib/x86_64-linux-gnu"
)
LINK_DIRECTORIES
(
"
${
CMAKE_CURRENT_BINARY_DIR
}
/lmsSDR"
)
LINK_DIRECTORIES
(
"
${
CMAKE_CURRENT_BINARY_DIR
}
/lms7002m"
)
LINK_DIRECTORIES
(
"
${
CMAKE_CURRENT_BINARY_DIR
}
/Si5351C"
)
set
(
HW_SOURCE
${
HW_SOURCE
}
${
OPENAIR_TARGETS
}
/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp
)
set
(
LOWLATENCY False
)
set
(
option_HW_lib
"-lLMS_SDR -lLMS7002M -lSi5351C -rdynamic -ldl"
)
elseif
(
${
RF_BOARD
}
STREQUAL
"CPRIGW"
)
set
(
HW_SOURCE
${
HW_SOURCE
}
${
OPENAIR_TARGETS
}
/ARCH/CPRIGW/USERSPACE/LIB/cprigw_lib.c
)
...
...
@@ -1491,13 +1520,14 @@ add_executable(lte-softmodem
target_link_libraries
(
lte-softmodem
-Wl,--start-group
RRC_LIB S1AP_LIB S1AP_ENB GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB PHY LFDS L2
${
MSC_LIB
}
${
RAL_LIB
}
${
NAS_UE_LIB
}
${
ITTI_LIB
}
${
MIH_LIB
}
RRC_LIB S1AP_LIB S1AP_ENB GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB PHY LFDS L2
${
MSC_LIB
}
${
RAL_LIB
}
${
NAS_UE_LIB
}
${
ITTI_LIB
}
${
MIH_LIB
}
-Wl,--end-group
)
target_link_libraries
(
lte-softmodem
${
LIBXML2_LIBRARIES
}
)
target_link_libraries
(
lte-softmodem pthread m
${
CONFIG_LIBRARIES
}
rt crypt
${
CRYPTO_LIBRARIES
}
${
OPENSSL_LIBRARIES
}
${
NETTLE_LIBRARIES
}
sctp
${
option_HW_lib
}
${
option_TP_lib
}
${
XFORMS_LIBRARIES
}
)
target_link_libraries
(
lte-softmodem
${
LIBBOOST_LIBRARIES
}
)
target_link_libraries
(
lte-softmodem
${
LIB_LMS_LIBRARIES
}
)
# lte-softmodem-nos1 is both eNB and UE implementation
###################################################
...
...
@@ -1531,8 +1561,7 @@ target_link_libraries (lte-softmodem-nos1
target_link_libraries
(
lte-softmodem-nos1
${
LIBXML2_LIBRARIES
}
)
target_link_libraries
(
lte-softmodem-nos1 pthread m
${
CONFIG_LIBRARIES
}
rt crypt
${
CRYPTO_LIBRARIES
}
${
OPENSSL_LIBRARIES
}
${
NETTLE_LIBRARIES
}
${
option_HW_lib
}
${
option_TP_lib
}
${
XFORMS_LIBRARIES
}
)
target_link_libraries
(
lte-softmodem-nos1
${
LIBBOOST_LIBRARIES
}
)
target_link_libraries
(
lte-softmodem-nos1
${
LIB_LMS_LIBRARIES
}
)
# rrh
################################
...
...
@@ -1546,7 +1575,6 @@ add_executable(rrh_gw
${
HW_SOURCE
}
${
TRANSPORT_SOURCE
}
)
# assert
target_include_directories
(
rrh_gw PRIVATE
${
OPENAIR_DIR
}
/common/utils/itti
)
target_link_libraries
(
rrh_gw
-Wl,--start-group
...
...
@@ -1554,12 +1582,21 @@ target_link_libraries(rrh_gw
-Wl,--end-group
)
target_link_libraries
(
rrh_gw rt pthread m
)
target_link_libraries
(
rrh_gw
${
option_HW_lib
}
${
option_TP_lib
}
${
LIBBOOST_LIBRARIES
}
)
target_link_libraries
(
rrh_gw
${
LIB_LMS_LIBRARIES
}
)
Message
(
"-- option_HW_lib=
${
option_HW_lib
}
"
)
Message
(
"-- HW_SOURCE=
${
HW_SOURCE
}
"
)
Message
(
"-- option_TP_lib=
${
option_TP_lib
}
"
)
Message
(
"-- TRANSPORT_SOURCE=
${
TRANSPORT_SOURCE
}
"
)
if
(
${
RF_BOARD
}
STREQUAL
"OAI_LMSSDR"
)
add_dependencies
(
lte-softmodem LMS7002M LMS_SDR Si5351C
)
add_dependencies
(
lte-softmodem-nos1 LMS7002M LMS_SDR Si5351C
)
add_dependencies
(
rrh_gw LMS7002M LMS_SDR Si5351C
)
endif
(
${
RF_BOARD
}
STREQUAL
"OAI_LMSSDR"
)
# USIM process
#################
#add_executable(usim
...
...
cmake_targets/build_oai
View file @
b7e147e5
...
...
@@ -91,7 +91,7 @@ Options
default is Rel10,
Rel8 limits the implementation to 3GPP Release 8 version
-w | --hardware
EXMIMO (Default), USRP, BLADERF, None
EXMIMO (Default), USRP, BLADERF,
LMSSDR,
None
Adds this RF board support (in external packages installation and in compilation)
-t | --transport protocol
ETHERNET , None
...
...
@@ -181,7 +181,7 @@ function main() {
-w
|
--hardware
)
HW
=
"
$2
"
#"${i#*=}"
# Use OAI_USRP as the key word USRP is used inside UHD driver
if
[
"
$HW
"
!=
"BLADERF"
-a
"
$HW
"
!=
"USRP"
-a
"
$HW
"
!=
"None"
-a
"
$HW
"
!=
"EXMIMO"
]
;
then
if
[
"
$HW
"
!=
"BLADERF"
-a
"
$HW
"
!=
"USRP"
-a
"
$HW
"
!=
"LMSSDR"
-a
"
$HW
"
!=
"None"
-a
"
$HW
"
!=
"EXMIMO"
]
;
then
echo_fatal
"Unknown HW type
$HW
will exit..."
else
if
[
"
$HW
"
==
"USRP"
]
;
then
...
...
@@ -190,6 +190,9 @@ function main() {
if
[
"
$HW
"
==
"BLADERF"
]
;
then
HW
=
"OAI_BLADERF"
fi
if
[
"
$HW
"
==
"LMSSDR"
]
;
then
HW
=
"OAI_LMSSDR"
fi
echo_info
"Setting hardware to:
$HW
"
fi
shift
2
;;
...
...
@@ -299,6 +302,7 @@ function main() {
fi
fi
echo_info
"RF HW set to
$HW
"
#Now we set flags to enable deadline scheduler settings
#By default: USRP: disable,
#By default: BLADERF: enable,
...
...
@@ -312,6 +316,8 @@ function main() {
LOWLATENCY_FLAG_USER
=
"False"
elif
[
"
$HW
"
=
"OAI_BLADERF"
]
;
then
LOWLATENCY_FLAG_USER
=
"False"
elif
[
"
$HW
"
=
"OAI_LMSSDR"
]
;
then
LOWLATENCY_FLAG_USER
=
"False"
elif
[
"
$HW
"
=
"None"
]
;
then
LOWLATENCY_FLAG_USER
=
"False"
else
...
...
@@ -689,6 +695,16 @@ function main() {
ln
-s
liboai_bladerfdevif.so liboai_device.so
ln
-s
$dbin
/liboai_bladerfdevif.so.
$REL
$dbin
/liboai_device.so
echo_info
"liboai_device.so is linked to BLADERF device library"
elif
[
"
$HW
"
==
"OAI_LMSSDR"
]
;
then
# if [ -f "/usr/include/libbladeRF.h" ] ; then
compilations
\
$build_dir
oai_lmssdrdevif
\
liboai_lmssdrdevif.so
$dbin
/liboai_lmssdrdevif.so.
$REL
# fi
ln
-s
liboai_lmssdrdevif.so liboai_device.so
ln
-s
$dbin
/liboai_lmssdrdevif.so.
$REL
$dbin
/liboai_device.so
echo_info
"liboai_device.so is linked to LMSSDR device library"
else
echo_info
"liboai_device.so is not linked to any device library"
fi
...
...
openair1/PHY/LTE_REFSIG/primary_synch.h
View file @
b7e147e5
/*******************************************************************************
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenAirInterface is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
short
primary_synch0
[
144
]
=
{
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
32767
,
0
,
-
26120
,
-
19785
,
11971
,
-
30502
,
-
24020
,
-
22288
,
32117
,
6492
,
31311
,
9658
,
-
16384
,
-
28378
,
25100
,
-
21063
,
-
7292
,
-
31946
,
20429
,
25618
,
14948
,
29158
,
11971
,
-
30502
,
31311
,
9658
,
25100
,
-
21063
,
-
16384
,
28377
,
-
24020
,
22287
,
32117
,
6492
,
-
7292
,
31945
,
20429
,
25618
,
-
26120
,
-
19785
,
-
16384
,
-
28378
,
-
16384
,
28377
,
-
26120
,
-
19785
,
-
32402
,
4883
,
31311
,
-
9659
,
32117
,
6492
,
-
7292
,
-
31946
,
32767
,
-
1
,
25100
,
-
21063
,
-
24020
,
22287
,
-
32402
,
4883
,
-
32402
,
4883
,
-
24020
,
22287
,
25100
,
-
21063
,
32767
,
-
1
,
-
7292
,
-
31946
,
32117
,
6492
,
31311
,
-
9659
,
-
32402
,
4883
,
-
26120
,
-
19785
,
-
16384
,
28377
,
-
16384
,
-
28378
,
-
26120
,
-
19785
,
20429
,
25618
,
-
7292
,
31945
,
32117
,
6492
,
-
24020
,
22287
,
-
16384
,
28377
,
25100
,
-
21063
,
31311
,
9658
,
11971
,
-
30502
,
14948
,
29158
,
20429
,
25618
,
-
7292
,
-
31946
,
25100
,
-
21063
,
-
16384
,
-
28378
,
31311
,
9658
,
32117
,
6492
,
-
24020
,
-
22288
,
11971
,
-
30502
,
-
26120
,
-
19785
,
32767
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
};
short
primary_synch1
[
144
]
=
{
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
32767
,
0
,
-
31754
,
-
8086
,
-
24020
,
-
22288
,
2448
,
32675
,
-
26120
,
19784
,
27073
,
18458
,
-
16384
,
28377
,
25100
,
21062
,
-
29523
,
14217
,
-
7292
,
31945
,
-
13477
,
-
29868
,
-
24020
,
-
22288
,
27073
,
18458
,
25100
,
21062
,
-
16384
,
-
28378
,
2448
,
-
32676
,
-
26120
,
19784
,
-
29523
,
-
14218
,
-
7292
,
31945
,
-
31754
,
-
8086
,
-
16384
,
28377
,
-
16384
,
-
28378
,
-
31754
,
-
8086
,
31311
,
-
9659
,
27073
,
-
18459
,
-
26120
,
19784
,
-
29523
,
14217
,
32767
,
-
1
,
25100
,
21062
,
2448
,
-
32676
,
31311
,
-
9659
,
31311
,
-
9659
,
2448
,
-
32676
,
25100
,
21062
,
32767
,
0
,
-
29523
,
14217
,
-
26120
,
19784
,
27073
,
-
18459
,
31311
,
-
9659
,
-
31754
,
-
8086
,
-
16384
,
-
28378
,
-
16384
,
28377
,
-
31754
,
-
8086
,
-
7292
,
31945
,
-
29523
,
-
14218
,
-
26120
,
19784
,
2448
,
-
32676
,
-
16384
,
-
28378
,
25100
,
21062
,
27073
,
18458
,
-
24020
,
-
22288
,
-
13477
,
-
29868
,
-
7292
,
31945
,
-
29523
,
14217
,
25100
,
21062
,
-
16384
,
28377
,
27073
,
18458
,
-
26120
,
19784
,
2448
,
32675
,
-
24020
,
-
22288
,
-
31754
,
-
8086
,
32767
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
};
short
primary_synch2
[
144
]
=
{
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
32767
,
0
,
-
31754
,
8085
,
-
24020
,
22287
,
2448
,
-
32676
,
-
26120
,
-
19785
,
27073
,
-
18459
,
-
16384
,
-
28378
,
25100
,
-
21063
,
-
29523
,
-
14218
,
-
7292
,
-
31946
,
-
13477
,
29867
,
-
24020
,
22287
,
27073
,
-
18459
,
25100
,
-
21063
,
-
16384
,
28377
,
2448
,
32675
,
-
26120
,
-
19785
,
-
29523
,
14217
,
-
7292
,
-
31946
,
-
31754
,
8085
,
-
16384
,
-
28378
,
-
16384
,
28377
,
-
31754
,
8085
,
31311
,
9658
,
27073
,
18458
,
-
26120
,
-
19785
,
-
29523
,
-
14218
,
32767
,
0
,
25100
,
-
21063
,
2448
,
32675
,
31311
,
9658
,
31311
,
9658
,
2448
,
32675
,
25100
,
-
21063
,
32767
,
0
,
-
29523
,
-
14218
,
-
26120
,
-
19785
,
27073
,
18458
,
31311
,
9658
,
-
31754
,
8085
,
-
16384
,
28377
,
-
16384
,
-
28378
,
-
31754
,
8085
,
-
7292
,
-
31946
,
-
29523
,
14217
,
-
26120
,
-
19785
,
2448
,
32675
,
-
16384
,
28377
,
25100
,
-
21063
,
27073
,
-
18459
,
-
24020
,
22287
,
-
13477
,
29867
,
-
7292
,
-
31946
,
-
29523
,
-
14218
,
25100
,
-
21063
,
-
16384
,
-
28378
,
27073
,
-
18459
,
-
26120
,
-
19785
,
2448
,
-
32676
,
-
24020
,
22287
,
-
31754
,
8085
,
32767
,
-
1
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
};
...
...
openair1/PHY/LTE_TRANSPORT/initial_sync.c
View file @
b7e147e5
...
...
@@ -48,7 +48,7 @@
#include
"gain_control.h"
#endif
#if defined(OAI_USRP) || defined(EXMIMO)
#if defined(OAI_USRP) || defined(EXMIMO)
|| defined(OAI_LMSSDR)
#include
"common_lib.h"
extern
openair0_config_t
openair0_cfg
[];
#endif
...
...
@@ -291,17 +291,10 @@ int initial_sync(PHY_VARS_UE *phy_vars_ue, runmode_t mode)
frame_parms
->
Ncp
=
NORMAL
;
frame_parms
->
frame_type
=
FDD
;
init_frame_parms
(
frame_parms
,
1
);
// write_output("rxdata0.m","rxd0",phy_vars_ue->lte_ue_common_vars.rxdata[0],10*frame_parms->samples_per_tti,1,1);
/*#ifdef OAI_USRP
for (aarx = 0; aarx<frame_parms->nb_antennas_rx;aarx++) {
rxdata128 = (__m128i*)phy_vars_ue->lte_ue_common_vars.rxdata[aarx];
for (i=0; i<(frame_parms->samples_per_tti*10)>>2; i++) {
rxdata128[i] = _mm_srai_epi16(rxdata128[i],4);
}
}
#endif*/
/*
write_output("rxdata0.m","rxd0",phy_vars_ue->lte_ue_common_vars.rxdata[0],10*frame_parms->samples_per_tti,1,1);
exit(-1);
*/
sync_pos
=
lte_sync_time
(
phy_vars_ue
->
lte_ue_common_vars
.
rxdata
,
frame_parms
,
(
int
*
)
&
phy_vars_ue
->
lte_ue_common_vars
.
eNb_id
);
...
...
@@ -336,9 +329,11 @@ int initial_sync(PHY_VARS_UE *phy_vars_ue, runmode_t mode)
#else
#ifndef OAI_USRP
#ifndef OAI_BLADERF
#ifndef OAI_BLADERF
#ifndef OAI_LMSSDR
phy_adjust_gain
(
phy_vars_ue
,
0
);
#endif
#endif
#endif
#endif
#endif
...
...
@@ -569,7 +564,7 @@ int initial_sync(PHY_VARS_UE *phy_vars_ue, runmode_t mode)
phy_vars_ue
->
lte_frame_parms
.
phich_config_common
.
phich_duration
,
phich_string
[
phy_vars_ue
->
lte_frame_parms
.
phich_config_common
.
phich_resource
],
phy_vars_ue
->
lte_frame_parms
.
nb_antennas_tx_eNB
);
#if defined(OAI_USRP) || defined(EXMIMO)
#if defined(OAI_USRP) || defined(EXMIMO)
|| defined(OAI_LMSSDR)
LOG_I
(
PHY
,
"[UE %d] Frame %d Measured Carrier Frequency %.0f Hz (offset %d Hz)
\n
"
,
phy_vars_ue
->
Mod_id
,
phy_vars_ue
->
frame_rx
,
...
...
openair1/PHY/LTE_TRANSPORT/print_stats.c
View file @
b7e147e5
...
...
@@ -50,7 +50,7 @@
#endif
extern
int
mac_get_rrc_status
(
uint8_t
Mod_id
,
uint8_t
eNB_flag
,
uint8_t
index
);
#if defined(OAI_USRP) || defined(EXMIMO) || defined(OAI_BLADERF)
#if defined(OAI_USRP) || defined(EXMIMO) || defined(OAI_BLADERF)
|| defined(OAI_LMSSDR)
#include
"common_lib.h"
extern
openair0_config_t
openair0_cfg
[];
#endif
...
...
@@ -97,10 +97,10 @@ int dump_ue_stats(PHY_VARS_UE *phy_vars_ue, char* buffer, int length, runmode_t
#ifdef EXMIMO
len
+=
sprintf
(
&
buffer
[
len
],
"[UE PROC] RX Gain %d dB (LNA %d, vga %d dB)
\n
"
,
phy_vars_ue
->
rx_total_gain_dB
,
openair0_cfg
[
0
].
rxg_mode
[
0
],(
int
)
openair0_cfg
[
0
].
rx_gain
[
0
]);
#endif
#if defined(OAI_USRP) || defined(OAI_BLADERF)
#if defined(OAI_USRP) || defined(OAI_BLADERF)
|| defined(OAI_LMSSDR)
len
+=
sprintf
(
&
buffer
[
len
],
"[UE PROC] RX Gain %d dB
\n
"
,
phy_vars_ue
->
rx_total_gain_dB
);
#endif
#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF)
#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF)
|| defined(OAI_LMSSDR)
len
+=
sprintf
(
&
buffer
[
len
],
"[UE_PROC] Frequency offset %d Hz (%d), estimated carrier frequency %f Hz
\n
"
,
phy_vars_ue
->
lte_ue_common_vars
.
freq_offset
,
openair_daq_vars
.
freq_offset
,
openair0_cfg
[
0
].
rx_freq
[
0
]
-
phy_vars_ue
->
lte_ue_common_vars
.
freq_offset
);
#endif
len
+=
sprintf
(
&
buffer
[
len
],
"[UE PROC] UE mode = %s (%d)
\n
"
,
mode_string
[
phy_vars_ue
->
UE_mode
[
0
]],
phy_vars_ue
->
UE_mode
[
0
]);
...
...
openair1/PHY/TOOLS/lte_phy_scope.c
View file @
b7e147e5
...
...
@@ -88,7 +88,7 @@ FD_lte_phy_scope_enb *create_lte_phy_scope_enb( void )
fl_set_object_boxtype
(
fdui
->
rxsig_t
,
FL_EMBOSSED_BOX
);
fl_set_object_color
(
fdui
->
rxsig_t
,
FL_BLACK
,
FL_RED
);
fl_set_object_lcolor
(
fdui
->
rxsig_t
,
FL_WHITE
);
// Label color
fl_set_xyplot_ybounds
(
fdui
->
rxsig_t
,
3
0
,
70
);
fl_set_xyplot_ybounds
(
fdui
->
rxsig_t
,
1
0
,
70
);
// Time-domain channel response
fdui
->
chest_t
=
fl_add_xyplot
(
FL_NORMAL_XYPLOT
,
410
,
20
,
370
,
100
,
"Channel Impulse Response (samples, abs)"
);
...
...
@@ -396,7 +396,7 @@ FD_lte_phy_scope_ue *create_lte_phy_scope_ue( void )
fl_set_object_boxtype
(
fdui
->
rxsig_t
,
FL_EMBOSSED_BOX
);
fl_set_object_color
(
fdui
->
rxsig_t
,
FL_BLACK
,
FL_RED
);
fl_set_object_lcolor
(
fdui
->
rxsig_t
,
FL_WHITE
);
// Label color
fl_set_xyplot_ybounds
(
fdui
->
rxsig_t
,
3
0
,
70
);
fl_set_xyplot_ybounds
(
fdui
->
rxsig_t
,
1
0
,
70
);
// Time-domain channel response
fdui
->
chest_t
=
fl_add_xyplot
(
FL_NORMAL_XYPLOT
,
410
,
20
,
370
,
100
,
"Channel Impulse Response (samples, abs)"
);
...
...
openair1/SCHED/phy_procedures_lte_ue.c
View file @
b7e147e5
...
...
@@ -121,7 +121,7 @@ extern int rx_sig_fifo;
#endif
#if defined(EXMIMO) || defined(OAI_USRP)
#if defined(EXMIMO) || defined(OAI_USRP)
|| defined(OAI_BLADERF) || defined(OAI_LMSSDR)
extern
uint32_t
downlink_frequency
[
MAX_NUM_CCs
][
4
];
#endif
...
...
@@ -197,7 +197,7 @@ void dump_dlsch_SI(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t subframe)
exit
(
-
1
);
}
#if defined(EXMIMO) || defined(OAI_USRP)
#if defined(EXMIMO) || defined(OAI_USRP)
|| defined(OAI_BLADERF) || defined(OAI_LMSSDR)
//unsigned int gain_table[31] = {100,112,126,141,158,178,200,224,251,282,316,359,398,447,501,562,631,708,794,891,1000,1122,1258,1412,1585,1778,1995,2239,2512,2818,3162};
/*
unsigned int get_tx_amp_prach(int power_dBm, int power_max_dBm, int N_RB_UL)
...
...
@@ -669,7 +669,7 @@ void phy_procedures_UE_TX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstra
uint8_t
ack_status
=
0
;
int8_t
Po_PUCCH
;
int32_t
ulsch_start
=
0
;
#if defined(EXMIMO) || defined(OAI_USRP)
#if defined(EXMIMO) || defined(OAI_USRP)
|| defined(OAI_BLADERF) || defined(OAI_LMSSDR)
int
overflow
=
0
;
int
k
,
l
;
#endif
...
...
@@ -969,7 +969,7 @@ void phy_procedures_UE_TX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstra
#endif
phy_vars_ue
->
tx_total_RE
=
nb_rb
*
12
;
#if defined(EXMIMO) || defined(OAI_USRP)
#if defined(EXMIMO) || defined(OAI_USRP)
|| defined(OAI_BLADERF) || defined(OAI_LMSSDR)
tx_amp
=
get_tx_amp
(
phy_vars_ue
->
tx_power_dBm
,
phy_vars_ue
->
tx_power_max_dBm
,
phy_vars_ue
->
lte_frame_parms
.
N_RB_UL
,
...
...
@@ -1065,7 +1065,7 @@ void phy_procedures_UE_TX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstra
#endif
phy_vars_ue
->
tx_total_RE
=
12
;
#if defined(EXMIMO) || defined(OAI_USRP)
#if defined(EXMIMO) || defined(OAI_USRP)
|| defined(OAI_BLADERF) || defined(OAI_LMSSDR)
tx_amp
=
get_tx_amp
(
Po_PUCCH
,
phy_vars_ue
->
tx_power_max_dBm
,
phy_vars_ue
->
lte_frame_parms
.
N_RB_UL
,
...
...
@@ -1128,7 +1128,7 @@ void phy_procedures_UE_TX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstra
#endif
phy_vars_ue
->
tx_total_RE
=
12
;
#if defined(EXMIMO) || defined(OAI_USRP)
#if defined(EXMIMO) || defined(OAI_USRP)
|| defined(OAI_BLADERF) || defined(OAI_LMSSDR)
tx_amp
=
get_tx_amp
(
Po_PUCCH
,
phy_vars_ue
->
tx_power_max_dBm
,
phy_vars_ue
->
lte_frame_parms
.
N_RB_UL
,
...
...
@@ -1230,7 +1230,7 @@ void phy_procedures_UE_TX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstra
if
(
abstraction_flag
==
0
)
{
nsymb
=
(
frame_parms
->
Ncp
==
0
)
?
14
:
12
;
#if defined(EXMIMO) || defined(OAI_USRP) //this is the EXPRESS MIMO case
#if defined(EXMIMO) || defined(OAI_USRP)
|| defined(OAI_BLADERF) || defined(OAI_LMSSDR)
//this is the EXPRESS MIMO case
ulsch_start
=
(
phy_vars_ue
->
rx_offset
+
subframe_tx
*
frame_parms
->
samples_per_tti
-
openair_daq_vars
.
timing_advance
-
phy_vars_ue
->
timing_advance
-
...
...
@@ -1257,7 +1257,7 @@ void phy_procedures_UE_TX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstra
for
(
aa
=
0
;
aa
<
frame_parms
->
nb_antennas_tx
;
aa
++
)
{
if
(
frame_parms
->
Ncp
==
1
)
PHY_ofdm_mod
(
&
phy_vars_ue
->
lte_ue_common_vars
.
txdataF
[
aa
][
subframe_tx
*
nsymb
*
frame_parms
->
ofdm_symbol_size
],
#if defined(EXMIMO) || defined(OAI_USRP)
#if defined(EXMIMO) || defined(OAI_USRP)
|| defined(OAI_BLADERF) || defined(OAI_LMSSDR)
dummy_tx_buffer
,
#else
&
phy_vars_ue
->
lte_ue_common_vars
.
txdata
[
aa
][
ulsch_start
],
...
...
@@ -1268,7 +1268,7 @@ void phy_procedures_UE_TX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstra
CYCLIC_PREFIX
);
else
normal_prefix_mod
(
&
phy_vars_ue
->
lte_ue_common_vars
.
txdataF
[
aa
][
subframe_tx
*
nsymb
*
frame_parms
->
ofdm_symbol_size
],
#if defined(EXMIMO) || defined(OAI_USRP)
#if defined(EXMIMO) || defined(OAI_USRP)
|| defined(OAI_BLADERF) || defined(OAI_LMSSDR)
dummy_tx_buffer
,
#else
&
phy_vars_ue
->
lte_ue_common_vars
.
txdata
[
aa
][
ulsch_start
],
...
...
@@ -1289,7 +1289,7 @@ void phy_procedures_UE_TX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstra
}
*/
#ifndef OFDMA_ULSCH
#if defined(EXMIMO) || defined(OAI_USRP)
#if defined(EXMIMO) || defined(OAI_USRP)
|| defined(OAI_BLADERF) || defined(OAI_LMSSDR)
apply_7_5_kHz
(
phy_vars_ue
,
dummy_tx_buffer
,
0
);
apply_7_5_kHz
(
phy_vars_ue
,
dummy_tx_buffer
,
1
);
#else
...
...
@@ -1304,7 +1304,7 @@ void phy_procedures_UE_TX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstra
*/
#endif
#if defined(EXMIMO) || defined(OAI_USRP)
#if defined(EXMIMO) || defined(OAI_USRP)
|| defined(OAI_BLADERF) || defined(OAI_LMSSDR)
overflow
=
ulsch_start
-
9
*
frame_parms
->
samples_per_tti
;
//if ((slot_tx==4) && (aa==0)) printf("ulsch_start %d, overflow %d\n",ulsch_start,overflow);
...
...
@@ -1404,7 +1404,7 @@ void phy_procedures_UE_TX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstra
phy_vars_ue
->
tx_total_RE
=
96
;
#if defined(EXMIMO) || defined(OAI_USRP)
#if defined(EXMIMO) || defined(OAI_USRP)
|| defined(OAI_BLADERF) || defined(OAI_LMSSDR)
phy_vars_ue
->
lte_ue_prach_vars
[
eNB_id
]
->
amp
=
get_tx_amp
(
phy_vars_ue
->
tx_power_dBm
,
phy_vars_ue
->
tx_power_max_dBm
,
phy_vars_ue
->
lte_frame_parms
.
N_RB_UL
,
...
...
@@ -1553,9 +1553,11 @@ void lte_ue_measurement_procedures(uint16_t l, PHY_VARS_UE *phy_vars_ue,uint8_t
#else
#ifndef OAI_USRP
#ifndef OAI_BLADERF
#ifndef OAI_BLADERF
#ifndef OAI_LMSSDR
phy_adjust_gain
(
phy_vars_ue
,
0
);
#endif
#endif
#endif
#endif
#endif
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_UE_GAIN_CONTROL
,
VCD_FUNCTION_OUT
);
...
...
targets/ARCH/COMMON/common_lib.c
View file @
b7e147e5
...
...
@@ -60,6 +60,9 @@ case USRP_X300_DEV:
case
BLADERF_DEV
:
printf
(
"[%s] has loaded BLADERF device.
\n
"
,((
device
->
host_type
==
BBU_HOST
)
?
"BBU"
:
"RRH"
));
break
;
case
LMSSDR_DEV
:
printf
(
"[%s] has loaded LMSSDR device.
\n
"
,((
device
->
host_type
==
BBU_HOST
)
?
"BBU"
:
"RRH"
));
break
;
case
NONE_DEV
:
printf
(
"[%s] has not loaded a HW device.
\n
"
,((
device
->
host_type
==
BBU_HOST
)
?
"BBU"
:
"RRH"
));
break
;
...
...
@@ -162,6 +165,7 @@ int openair0_transport_load(openair0_device *device, openair0_config_t *openair0
}
}
return
0
;
}
...
...
targets/ARCH/COMMON/common_lib.h
View file @
b7e147e5
...
...
@@ -90,6 +90,8 @@ typedef enum {
USRP_X300_DEV
,
/*!\brief device is BLADE RF*/
BLADERF_DEV
,
/*!\brief device is LMSSDR (SoDeRa)*/
LMSSDR_DEV
,
/*!\brief device is NONE*/
NONE_DEV
,
MAX_RF_DEV_TYPE
...
...
@@ -195,7 +197,8 @@ typedef struct {
char
*
my_addr
;
//! local port number for Ethernet interface (eNB/BBU, UE)
unsigned
int
my_port
;
//! Configuration file for LMS7002M
char
*
configFilename
;
}
openair0_config_t
;
/*! \brief RF mapping */
...
...
@@ -206,6 +209,7 @@ typedef struct {
int
chain
;
}
openair0_rf_map
;
typedef
struct
{
char
*
remote_addr
;
//! remote port number for Ethernet interface
...
...
@@ -355,7 +359,7 @@ extern "C"
* \param device the hardware to use
*/
openair0_timestamp
get_usrp_time
(
openair0_device
*
device
);
/*! \brief Set RX frequencies
* \param device the hardware to use
* \param openair0_cfg RF frontend parameters set by application
...
...
targets/ARCH/LMSSDR/USERSPACE/LIB/Si5351C/CMakeLists.txt
0 → 100644
View file @
b7e147e5
set
(
si5351_src_files
Si5351C.cpp
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
${
C_FLAGS_PROCESSOR
}
-std=c++11 "
)
add_library
(
Si5351C STATIC
${
si5351_src_files
}
)
target_include_directories
(
Si5351C PUBLIC ../lms7002m
${
CMAKE_CURRENT_SOURCE_DIR
}
)
target_link_libraries
(
Si5351C LMS7002M
)
targets/ARCH/LMSSDR/USERSPACE/LIB/Si5351C/Si5351C.cpp
0 → 100644
View file @
b7e147e5
This diff is collapsed.
Click to expand it.
targets/ARCH/LMSSDR/USERSPACE/LIB/Si5351C/Si5351C.h
0 → 100644
View file @
b7e147e5
/**
@file Si5351C.h
@brief Header for Si5351C.cpp
@author Lime Microsystems
*/
#ifndef SI5351C_MODULE
#define SI5351C_MODULE
#include
<stdio.h>
#include
<string>
using
namespace
std
;
//---------------------------------------------------------------------------
enum
eSi_CLOCK_INPUT
{
Si_CLKIN
,
Si_XTAL
,
Si_CMOS
};
struct
Si5351_Channel
{
Si5351_Channel
()
:
outputDivider
(
1
),
outputFreqHz
(
1
),
multisynthDivider
(
1
),
pllSource
(
0
),
phaseOffset
(
0
),
powered
(
true
),
inverted
(
false
),
int_mode
(
false
)
{};
int
outputDivider
;
unsigned
long
outputFreqHz
;
float
multisynthDivider
;
int
pllSource
;
float
phaseOffset
;
bool
powered
;
bool
inverted
;
bool
int_mode
;
};
struct
Si5351_PLL
{
Si5351_PLL
()
:
inputFreqHz
(
0
),
VCO_Hz
(
0
),
feedbackDivider
(
0
),
CLKIN_DIV
(
1
),
CLK_SRC
(
1
)
{}
unsigned
long
inputFreqHz
;
float
VCO_Hz
;
float
feedbackDivider
;
int
CLKIN_DIV
;
int
CLK_SRC
;
//0-XTAL, 1-CLKIN
};
class
LMScomms
;
class
Si5351C
{
public:
enum
Status
{
SUCCESS
,
FAILED
,
};
struct
StatusBits
{
StatusBits
()
:
sys_init
(
0
),
sys_init_stky
(
0
),
lol_b
(
0
),
lol_b_stky
(
0
),
lol_a
(
0
),
lol_a_stky
(
0
),
los
(
0
),
los_stky
(
0
)
{
}
int
sys_init
;
int
sys_init_stky
;
int
lol_b
;
int
lol_b_stky
;
int
lol_a
;
int
lol_a_stky
;
int
los
;
int
los_stky
;
};
StatusBits
GetStatusBits
();
Status
ClearStatus
();
Si5351C
();
~
Si5351C
();
void
Initialize
(
LMScomms
*
mng
);
bool
LoadRegValuesFromFile
(
string
FName
);
void
SetPLL
(
unsigned
char
id
,
unsigned
long
CLKIN_Hz
,
int
CLK_SRC
);
void
SetClock
(
unsigned
char
id
,
unsigned
long
fOut_Hz
,
bool
enabled
=
true
,
bool
inverted
=
false
);
Status
UploadConfiguration
();
Status
ConfigureClocks
();
void
Reset
();
private:
void
FindVCO
(
Si5351_Channel
*
clocks
,
Si5351_PLL
*
plls
,
const
unsigned
long
Fmin
,
const
unsigned
long
Fmax
);
LMScomms
*
device
;