Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
spbro
OpenXG-RAN
Commits
9e28189d
Commit
9e28189d
authored
9 years ago
by
kaltenbe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PLL Configuration
parent
c9780626
Branches unavailable
2024.w43
2024.w42
2024.w41
2024.w40
2024.w39
2024.w38
2024.w36
2024.w35
2024.w34
2024.w33
2024.w32
2024.w31
2024.w30
2024.w29
2024.w28
2024.w27
2024.w26
2024.w25
2024.w24
2024.w23
2024.w22
2024.w21
2024.w18
2024.w17
2024.w16
2024.w15
2024.w14
2024.w13
2024.w12
2024.w11
2024.w10
2024.w09
2024.w08
2024.w06
2024.w05
2024.w04
2024.w03
2024.w02
2024.w01
2023.w51
2023.w50
2023.w49
2023.w48
2023.w47
2023.w45
2023.w43
2023.w42
2023.w41
2023.w40
2023.w39
2023.w38
2023.w37
2023.w36
2023.w34
2023.w33
2023.w32
2023.w31
2023.w30
2023.w29
2023.w28
2023.w27
2023.w26
2023.w25
2023.w24
2023.w23
2023.w22
2023.w21
2023.w20
2023.w19
2023.w18
2023.w18b
2023.w16
2023.w15
2023.w14
2023.w13
2023.w12
2023.w11
2023.w11b
2023.w10
2023.w10b
2023.w09
2023.w08
2023.w08b
2023.w07
2023.w06
2023.w05
2023.w03
2023.w02
2022.42
2022.41
2022.w51
2022.w50
2022.w49
2022.w48
2022.w47
2022.w46
2022.w45
2022.w43
2022.w42
2022.w42b
2022.w41
2022.w40
2022.w39
2022.w38
2022.w37
2022.w37b
2022.w36
2022.w35
2022.w33
2022.w32
2022.w31
2022.w31b
2022.w30
2022.w29
2022.w26
2022.w25
2022.w24
2022.w24b
2022.w23
2022.w22
2022.w21
2022.w20
2022.w19
2022.w18
2022.w17
2022.w15
2022.w15b
2022.w14a
2022.w13
2022.w13b
2022.w13a
2022.w12
2022.w10
2022.w09
2022.w09b
2022.w08
2022.w08b
2022.w07
2022.w07b
2022.w06
2022.w06a
2022.w05
2022.w05b
2022.w03_hotfix
2022.w03_b
2022.w02
2022.w01
2021.wk46
2021.wk14_a
2021.wk13_d
2021.wk13_c
2021.w51_c
2021.w51_a
2021.w50_a
2021.w49_b
2021.w49_a
2021.w48
2021.w47
2021.w46
2021.w46-powder
2021.w45
2021.w45_b
2021.w44
2021.w43
2021.w42
2021.w37
2021.w36
2021.w35
2021.w34
2021.w33
2021.w32
2021.w31
2021.w30
2021.w29
2021.w28
2021.w27
2021.w26
2021.w25
2021.w24
2021.w23
2021.w22
2021.w20
2021.w19
2021.w18_b
2021.w18_a
2021.w17_b
2021.w16
2021.w15
2021.w14
2021.w13_a
2021.w12
2021.w11
2021.w10
2021.w09
2021.w08
2021.w06
2021.w05
2021.w04
2021.w02
2020.w51_2
2020.w51
2020.w50
2020.w49
2020.w48_2
2020.w48
2020.w47
2020.w46_2
2020.w46
2020.w45_2
2020.w45
2020.w44
2020.w42_2
2020.w42
2020.w41
2020.w39
2020.w38
2020.w37
2020.w36
2020.w34
2020.w33
2020.w31
2020.w30
2020.w29
2020.w28
2020.w26
2020.w25
2020.w24
2020.w23
2020.w22
2020.w19
2020.w17
2020.w16
2020.w15
2020.w11
2020.w09
2020.w06
2020.w05
2020.w04
2020.w03
2019.w51
2019.w44
2019.w41
2019.w36
2019.w30
2019.w28
2019.w27
2019.w25
2019.w23
2019.w21
2019.w17
2019.w15
2019.w13
2019.w11
2019.w10
2019.w09
2019.w08
2019.w07
2019.w06
2019.w04
2019.w03
2018.w51
2018.w48
2018.w47
2018.w46
2018.w44
2018.w41
2018.w40
2018.w39
2018.w36
2018.w33
2018.w31
2018.w29
2018.w25
2018.w19
2018.w15
2018.w12
2018.w11
2018.w10
2018.w09
2018.w08
2018.w07
2018.w06
2018.w05
2018.w04
2018.w03
2018.w02
2017.w48
2017.w46
2017.w43
2017.w42
2017.w34
2017.w30
2017.w25
2017.w24
2017.w22
2017.w20
2017.w19
2017.w15
2017.w14
2017.w13
2017.w12
2017.w11
2017.w10
2017.w09
2017.w08
2017.w07
2017.w06
2017.w05
2017.w04
2017.w03
2017.w02
2017.w01
2016.w50
2016.w49
v2.1.0
v2.0.0
v1.2.2
v1.2.1
v1.2.0
v1.1.1
v1.1.0
v1.0.3
v1.0.2
v1.0.1
v1.0.0
v1B0.8
v1B0.7
v1B0.6
v1B0.5
v1B0.4
v1B0.3
v1B0.2
v1B0.1
v0.6.1
v0.6.1_tdd
v0.6
v0.5.2
v0.5.1_tdd
v0.5
v0.4
v0.3
v0.2
v0.1
setparam
osa-etsi-ws-ue
osa-etsi-ws-try2
osa-etsi-ws-try1
osa-etsi-ws-gNB
oai_nr_sync
nr-ip-over-lte
nr-ip-over-lte-v.1.5
nr-ip-over-lte-v.1.4
nr-ip-over-lte-v.1.3
nr-ip-over-lte-v.1.2
nr-ip-over-lte-v.1.1
nr-ip-over-lte-v.1.0
flexran-eol
develop-nr-pdcch
develop-nr-2020w03
develop-nr-2020w02
develop-nr-2019w51
develop-nr-2019w50
develop-nr-2019w48
develop-nr-2019w47
develop-nr-2019w45
develop-nr-2019w43
develop-nr-2019w42
develop-nr-2019w40
develop-nr-2019w28
develop-nr-2019w23
benetel_phase_rotation
benetel_gnb_rel_2.0
benetel_gnb_rel_1.0
benetel_enb_rel_2.0
benetel_enb_rel_1.0
ARC_1.3
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
40 deletions
+45
-40
cmake_targets/CMakeLists.txt
cmake_targets/CMakeLists.txt
+6
-1
targets/ARCH/SODERA/USERSPACE/LIB/sodera_lib.cpp
targets/ARCH/SODERA/USERSPACE/LIB/sodera_lib.cpp
+39
-39
No files found.
cmake_targets/CMakeLists.txt
View file @
9e28189d
...
...
@@ -441,15 +441,20 @@ elseif (${RF_BOARD} STREQUAL "OAI_SODERA")
include_directories
(
"
${
OPENAIR_TARGETS
}
/ARCH/SODERA/USERSPACE/LIB"
)
include_directories
(
"
${
OPENAIR_TARGETS
}
/ARCH/SODERA/USERSPACE/LIB/lms7suite/src/lms7002m"
)
include_directories
(
"
${
OPENAIR_TARGETS
}
/ARCH/SODERA/USERSPACE/LIB/lms7suite/src/Si5351C"
)
include_directories
(
"
${
OPENAIR_TARGETS
}
/ARCH/SODERA/USERSPACE/LIB/lms7suite/src/LMS_StreamBoard"
)
set
(
HW_SOURCE
${
HW_SOURCE
}
${
OPENAIR_TARGETS
}
/ARCH/SODERA/USERSPACE/LIB/sodera_lib.cpp
)
LINK_DIRECTORIES
(
"
${
OPENAIR_TARGETS
}
/ARCH/SODERA/USERSPACE/LIB/lms7suite/src/lms7002m"
)
LINK_DIRECTORIES
(
"
${
OPENAIR_TARGETS
}
/ARCH/SODERA/USERSPACE/LIB/lms7suite/src/Si5351C"
)
LINK_DIRECTORIES
(
"
${
OPENAIR_TARGETS
}
/ARCH/SODERA/USERSPACE/LIB/lms7suite/src/LMS_StreamBoard"
)
LINK_DIRECTORIES
(
"
${
OPENAIR_TARGETS
}
/ARCH/SODERA/USERSPACE/LIB/lms7suite/src/kissFFT"
)
LINK_DIRECTORIES
(
"/usr/lib/x86_64-linux-gnu"
)
set
(
option_HW_lib
"usb-1.0"
)
set
(
LMS7002_LIB
"libLMS7002M.a"
)
set
(
Si5351C_LIB
"libSi5351C.a"
)
set
(
LMSStreamBoard_LIB
"libLMS_StreamBoard.a"
)
set
(
KISSFFT_LIB
"libkissFFT.a"
)
#set(LOWLATENCY False)
elseif
(
${
RF_BOARD
}
STREQUAL
"ETHERNET"
)
...
...
@@ -1449,7 +1454,7 @@ 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
}
${
LMS7002_LIB
}
${
Si5351C_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
}
${
LMS7002_LIB
}
${
Si5351C_LIB
}
${
LMSStreamBoard_LIB
}
${
KISSFFT_LIB
}
-Wl,--end-group
)
...
...
This diff is collapsed.
Click to expand it.
targets/ARCH/SODERA/USERSPACE/LIB/sodera_lib.cpp
View file @
9e28189d
...
...
@@ -52,6 +52,8 @@
#include "lmsComms.h"
#include "LMS7002M.h"
#include "Si5351C.h"
#include "LMS_StreamBoard.h"
#ifdef __SSE4_1__
# include <smmintrin.h>
#endif
...
...
@@ -72,24 +74,12 @@ typedef struct
// --------------------------------
// variables for SoDeRa configuration
// --------------------------------
/*
uhd::usrp::multi_usrp::sptr usrp;
//uhd::usrp::multi_usrp::sptr rx_usrp;
//create a send streamer and a receive streamer
uhd::tx_streamer::sptr tx_stream;
uhd::rx_streamer::sptr rx_stream;
uhd::tx_metadata_t tx_md;
uhd::rx_metadata_t rx_md;
uhd::time_spec_t tm_spec;
//setup variables and allocate buffer
uhd::async_metadata_t async_md;
*/
LMScomms
Port
;
Si5351C
Si
;
LMS7002M
lmsControl
;
LMS_StreamBoard
*
lmsStream
;
double
sample_rate
;
// time offset between transmiter timestamp and receiver timestamp;
double
tdiff
;
...
...
@@ -105,13 +95,13 @@ typedef struct
int64_t
rx_count
;
openair0_timestamp
rx_timestamp
;
}
sodera_
state_
t
;
}
sodera_t
;
sodera_
state_
t
sodera_state
;
sodera_t
sodera_state
;
static
int
trx_sodera_start
(
openair0_device
*
device
)
{
sodera_
state_t
*
s
=
(
sodera_state
_t
*
)
device
->
priv
;
sodera_
t
*
s
=
(
sodera
_t
*
)
device
->
priv
;
// init recv and send streaming
...
...
@@ -124,7 +114,7 @@ static int trx_sodera_start(openair0_device *device)
static
void
trx_sodera_end
(
openair0_device
*
device
)
{
sodera_
state_t
*
s
=
(
sodera_state
_t
*
)
device
->
priv
;
sodera_
t
*
s
=
(
sodera
_t
*
)
device
->
priv
;
...
...
@@ -132,7 +122,7 @@ static void trx_sodera_end(openair0_device *device)
static
int
trx_sodera_write
(
openair0_device
*
device
,
openair0_timestamp
timestamp
,
void
**
buff
,
int
nsamps
,
int
cc
,
int
flags
)
{
sodera_
state_t
*
s
=
(
sodera_state
_t
*
)
device
->
priv
;
sodera_
t
*
s
=
(
sodera
_t
*
)
device
->
priv
;
if
(
cc
>
1
)
{
// s->tx_stream->send(buff_ptrs, nsamps, s->tx_md);
...
...
@@ -145,7 +135,7 @@ static int trx_sodera_write(openair0_device *device, openair0_timestamp timestam
static
int
trx_sodera_read
(
openair0_device
*
device
,
openair0_timestamp
*
ptimestamp
,
void
**
buff
,
int
nsamps
,
int
cc
)
{
sodera_
state_t
*
s
=
(
sodera_state
_t
*
)
device
->
priv
;
sodera_
t
*
s
=
(
sodera
_t
*
)
device
->
priv
;
int
samples_received
=
0
,
i
,
j
;
int
nsamps2
;
// aligned to upper 32 or 16 byte boundary
#if defined(__x86_64) || defined(__i386__)
...
...
@@ -193,7 +183,7 @@ static bool is_equal(double a, double b)
int
trx_sodera_set_freq
(
openair0_device
*
device
,
openair0_config_t
*
openair0_cfg
,
int
dummy
)
{
sodera_
state_t
*
s
=
(
sodera_state
_t
*
)
device
->
priv
;
sodera_
t
*
s
=
(
sodera
_t
*
)
device
->
priv
;
// s->usrp->set_tx_freq(openair0_cfg[0].tx_freq[0]);
// s->usrp->set_rx_freq(openair0_cfg[0].rx_freq[0]);
...
...
@@ -204,7 +194,7 @@ int trx_sodera_set_freq(openair0_device* device, openair0_config_t *openair0_cfg
int
openair0_set_rx_frequencies
(
openair0_device
*
device
,
openair0_config_t
*
openair0_cfg
)
{
sodera_
state_t
*
s
=
(
sodera_state
_t
*
)
device
->
priv
;
sodera_
t
*
s
=
(
sodera
_t
*
)
device
->
priv
;
static
int
first_call
=
1
;
static
double
rf_freq
,
diff
;
...
...
@@ -222,7 +212,7 @@ int openair0_set_rx_frequencies(openair0_device* device, openair0_config_t *open
int
trx_sodera_set_gains
(
openair0_device
*
device
,
openair0_config_t
*
openair0_cfg
)
{
sodera_
state_t
*
s
=
(
sodera_state
_t
*
)
device
->
priv
;
sodera_
t
*
s
=
(
sodera
_t
*
)
device
->
priv
;
// s->usrp->set_tx_gain(openair0_cfg[0].tx_gain[0]);
// ::uhd::gain_range_t gain_range = s->usrp->get_rx_gain_range(0);
...
...
@@ -313,7 +303,7 @@ int trx_sodera_reset_stats(openair0_device* device) {
int
openair0_dev_init_sodera
(
openair0_device
*
device
,
openair0_config_t
*
openair0_cfg
)
{
sodera_
state_
t
*
s
=&
sodera_state
;
sodera_t
*
s
=&
sodera_state
;
size_t
i
;
...
...
@@ -332,7 +322,6 @@ int openair0_dev_init_sodera(openair0_device* device, openair0_config_t *openair
(
int
)
devInfo
.
hardware
,
(
int
)
devInfo
.
firmware
,
(
int
)
devInfo
.
protocol
);
LMS7002M
lmsControl
(
&
s
->
Port
);
printf
(
"Configuring Si5351C
\n
"
);
s
->
Si
.
Initialize
(
&
s
->
Port
);
...
...
@@ -396,29 +385,32 @@ int openair0_dev_init_sodera(openair0_device* device, openair0_config_t *openair
break
;
}
s
->
lmsControl
=
LMS7002M
(
&
s
->
Port
);
liblms7_status
opStatus
;
lmsControl
.
ResetChip
();
opStatus
=
lmsControl
.
LoadConfig
(
openair0_cfg
[
0
].
configFilename
);
s
->
lmsControl
.
ResetChip
();
opStatus
=
s
->
lmsControl
.
LoadConfig
(
openair0_cfg
[
0
].
configFilename
);
if
(
opStatus
!=
LIBLMS7_SUCCESS
)
{
printf
(
"Failed to load configuration file %s
\n
"
,
openair0_cfg
[
0
].
configFilename
);
exit
(
-
1
);
}
opStatus
=
lmsControl
.
UploadAll
();
opStatus
=
s
->
lmsControl
.
UploadAll
();
if
(
opStatus
!=
LIBLMS7_SUCCESS
)
{
printf
(
"Failed to upload configuration file
\n
"
);
exit
(
-
1
);
}
opStatus
=
lmsControl
.
SetFrequencySX
(
LMS7002M
::
Tx
,
openair0_cfg
[
0
].
tx_freq
[
0
]
/
1e6
,
30.72
);
opStatus
=
s
->
lmsControl
.
SetFrequencySX
(
LMS7002M
::
Tx
,
openair0_cfg
[
0
].
tx_freq
[
0
]
/
1e6
,
30.72
);
if
(
opStatus
!=
LIBLMS7_SUCCESS
)
{
printf
(
"Cannot set TX frequency %f MHz
\n
"
,
openair0_cfg
[
0
].
tx_freq
[
0
]
/
1e6
);
exit
(
-
1
);
}
opStatus
=
lmsControl
.
SetFrequencySX
(
LMS7002M
::
Rx
,
openair0_cfg
[
0
].
rx_freq
[
0
]
/
1e6
,
30.72
);
opStatus
=
s
->
lmsControl
.
SetFrequencySX
(
LMS7002M
::
Rx
,
openair0_cfg
[
0
].
rx_freq
[
0
]
/
1e6
,
30.72
);
if
(
opStatus
!=
LIBLMS7_SUCCESS
)
{
printf
(
"Cannot set RX frequency %f MHz
\n
"
,
openair0_cfg
[
0
].
rx_freq
[
0
]
/
1e6
);
...
...
@@ -428,12 +420,12 @@ int openair0_dev_init_sodera(openair0_device* device, openair0_config_t *openair
// this makes RX/TX sampling rates equal
opStatus
=
lmsControl
.
Modify_SPI_Reg_bits
(
EN_ADCCLKH_CLKGN
,
0
);
opStatus
=
s
->
lmsControl
.
Modify_SPI_Reg_bits
(
EN_ADCCLKH_CLKGN
,
0
);
if
(
opStatus
!=
LIBLMS7_SUCCESS
)
{
printf
(
"Cannot modify SPI (EN_ADCCLKH_CLKGN)
\n
"
);
exit
(
-
1
);
}
opStatus
=
lmsControl
.
Modify_SPI_Reg_bits
(
CLKH_OV_CLKL_CGEN
,
2
);
opStatus
=
s
->
lmsControl
.
Modify_SPI_Reg_bits
(
CLKH_OV_CLKL_CGEN
,
2
);
if
(
opStatus
!=
LIBLMS7_SUCCESS
)
{
printf
(
"Cannot modify SPI (CLKH_OV_CLKL_CGEN)
\n
"
);
exit
(
-
1
);
...
...
@@ -442,26 +434,34 @@ int openair0_dev_init_sodera(openair0_device* device, openair0_config_t *openair
const
float
cgen_freq_MHz
=
245.76
;
const
int
interpolation
=
0
;
// real interpolation = 2
const
int
decimation
=
0
;
// real decimation = 2
opStatus
=
lmsControl
.
SetInterfaceFrequency
(
cgen_freq_MHz
,
interpolation
,
decimation
);
opStatus
=
s
->
lmsControl
.
SetInterfaceFrequency
(
cgen_freq_MHz
,
interpolation
,
decimation
);
if
(
opStatus
!=
LIBLMS7_SUCCESS
)
{
printf
(
"Cannot SetInterfaceFrequency (%f,%d,%d)
\n
"
,
cgen_freq_MHz
,
interpolation
,
decimation
);
exit
(
-
1
);
}
// Run calibration procedure
float
txrx_calibrationBandwidth_MHz
=
5
;
opStatus
=
lmsControl
.
CalibrateTx
(
txrx_calibrationBandwidth_MHz
);
opStatus
=
s
->
lmsControl
.
CalibrateTx
(
txrx_calibrationBandwidth_MHz
);
if
(
opStatus
!=
LIBLMS7_SUCCESS
){
printf
(
"TX Calibration failed
\n
"
);
exit
(
-
1
);
}
opStatus
=
lmsControl
.
CalibrateRx
(
txrx_calibrationBandwidth_MHz
);
opStatus
=
s
->
lmsControl
.
CalibrateRx
(
txrx_calibrationBandwidth_MHz
);
if
(
opStatus
!=
LIBLMS7_SUCCESS
){
printf
(
"RX Calibration failed
\n
"
);
exit
(
-
1
);
}
s
->
lmsStream
=
new
LMS_StreamBoard
(
&
s
->
Port
);
LMS_StreamBoard
::
Status
opStreamStatus
;
// this will configure that sampling rate at output of FPGA
// LMS_StreamBoard::ConfigurePLL(&s->Port,openair0_cfg[0].sample_rate,openair0_cfg[0].sample_rate,90);
opStreamStatus
=
s
->
lmsStream
->
ConfigurePLL
(
&
s
->
Port
,
openair0_cfg
[
0
].
sample_rate
,
openair0_cfg
[
0
].
sample_rate
,
90
);
if
(
opStatus
!=
LIBLMS7_SUCCESS
){
printf
(
"Sample rate programming failed
\n
"
);
exit
(
-
1
);
}
/*
::uhd::gain_range_t gain_range = s->usrp->get_rx_gain_range(i);
// limit to maximum gain
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment