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
lizhongxiao
OpenXG-RAN
Commits
daad3da6
Commit
daad3da6
authored
May 27, 2022
by
Robert Schmidt
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/usrp-tune-offset' into integration_2022_wk21b
parents
21a820b0
e1b090cf
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
49 additions
and
20 deletions
+49
-20
executables/nr-ru.c
executables/nr-ru.c
+6
-3
executables/nr-uesoftmodem.c
executables/nr-uesoftmodem.c
+1
-0
executables/softmodem-common.h
executables/softmodem-common.h
+4
-0
openair1/PHY/NR_UE_TRANSPORT/nr_ue_rf_helpers.c
openair1/PHY/NR_UE_TRANSPORT/nr_ue_rf_helpers.c
+4
-3
targets/ARCH/COMMON/common_lib.h
targets/ARCH/COMMON/common_lib.h
+1
-0
targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp
targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp
+24
-10
targets/RT/USER/lte-ru.c
targets/RT/USER/lte-ru.c
+5
-2
targets/RT/USER/lte-uesoftmodem.c
targets/RT/USER/lte-uesoftmodem.c
+4
-2
No files found.
executables/nr-ru.c
View file @
daad3da6
...
...
@@ -1056,11 +1056,12 @@ void fill_rf_config(RU_t *ru, char *rf_config_file) {
cfg
->
tx_gain
[
i
]
=
ru
->
att_tx
;
cfg
->
rx_gain
[
i
]
=
ru
->
max_rxgain
-
ru
->
att_rx
;
cfg
->
configFilename
=
rf_config_file
;
LOG_I
(
PHY
,
"Channel %d: setting tx_gain offset %
f, rx_gain offset %f, tx_freq %lu Hz, rx_freq %lu
Hz
\n
"
,
LOG_I
(
PHY
,
"Channel %d: setting tx_gain offset %
.0f, rx_gain offset %.0f, tx_freq %.0f Hz, rx_freq %.0f Hz, tune_offset %.0f
Hz
\n
"
,
i
,
cfg
->
tx_gain
[
i
],
cfg
->
rx_gain
[
i
],
(
unsigned
long
)
cfg
->
tx_freq
[
i
],
(
unsigned
long
)
cfg
->
rx_freq
[
i
]);
cfg
->
tx_freq
[
i
],
cfg
->
rx_freq
[
i
],
cfg
->
tune_offset
);
}
}
...
...
@@ -2058,6 +2059,8 @@ static void NRRCconfig_RU(void) {
RC
.
ru
[
j
]
->
openair0_cfg
.
time_source
=
internal
;
}
RC
.
ru
[
j
]
->
openair0_cfg
.
tune_offset
=
get_softmodem_params
()
->
tune_offset
;
if
(
strcmp
(
*
(
RUParamList
.
paramarray
[
j
][
RU_LOCAL_RF_IDX
].
strptr
),
"yes"
)
==
0
)
{
if
(
!
(
config_isparamset
(
RUParamList
.
paramarray
[
j
],
RU_LOCAL_IF_NAME_IDX
))
)
{
RC
.
ru
[
j
]
->
if_south
=
LOCAL_RF
;
...
...
executables/nr-uesoftmodem.c
View file @
daad3da6
...
...
@@ -354,6 +354,7 @@ void init_openair0(void) {
openair0_cfg
[
card
].
num_rb_dl
=
frame_parms
->
N_RB_DL
;
openair0_cfg
[
card
].
clock_source
=
get_softmodem_params
()
->
clock_source
;
openair0_cfg
[
card
].
time_source
=
get_softmodem_params
()
->
timing_source
;
openair0_cfg
[
card
].
tune_offset
=
get_softmodem_params
()
->
tune_offset
;
openair0_cfg
[
card
].
tx_num_channels
=
min
(
4
,
frame_parms
->
nb_antennas_tx
);
openair0_cfg
[
card
].
rx_num_channels
=
min
(
4
,
frame_parms
->
nb_antennas_rx
);
...
...
executables/softmodem-common.h
View file @
daad3da6
...
...
@@ -60,6 +60,7 @@ extern "C"
#define CONFIG_HLP_DMRSSYNC "tells RU to insert DMRS in subframe 1 slot 0"
#define CONFIG_HLP_CLK "tells hardware to use a clock reference (0:internal, 1:external, 2:gpsdo)\n"
#define CONFIG_HLP_TME "tells hardware to use a time reference (0:internal, 1:external, 2:gpsdo)\n"
#define CONFIG_HLP_TUNE_OFFSET "LO tuning offset to use in Hz\n"
#define CONFIG_HLP_USIM "use XOR autentication algo in case of test usim mode\n"
#define CONFIG_HLP_NOSNGLT "Disables single-thread mode in lte-softmodem\n"
#define CONFIG_HLP_DLF "Set the downlink frequency for all component carriers\n"
...
...
@@ -118,6 +119,7 @@ extern "C"
#define EMULATE_RF softmodem_params.emulate_rf
#define CLOCK_SOURCE softmodem_params.clock_source
#define TIMING_SOURCE softmodem_params.timing_source
#define TUNE_OFFSET softmodem_params.tune_offset
#define SEND_DMRSSYNC softmodem_params.send_dmrs_sync
#define USIM_TEST softmodem_params.usim_test
#define PRB_INTERPOLATION softmodem_params.prb_interpolation
...
...
@@ -141,6 +143,7 @@ extern int usrp_tx_thread;
{"usim-test", CONFIG_HLP_USIM, PARAMFLAG_BOOL, u8ptr:&USIM_TEST, defintval:0, TYPE_UINT8, 0}, \
{"clock-source", CONFIG_HLP_CLK, 0, uptr:&CLOCK_SOURCE, defintval:0, TYPE_UINT, 0}, \
{"time-source", CONFIG_HLP_TME, 0, uptr:&TIMING_SOURCE, defintval:0, TYPE_UINT, 0}, \
{"tune-offset", CONFIG_HLP_TUNE_OFFSET, 0, dblptr:&TUNE_OFFSET, defintval:0, TYPE_DOUBLE, 0}, \
{"wait-for-sync", NULL, PARAMFLAG_BOOL, iptr:&WAIT_FOR_SYNC, defintval:0, TYPE_INT, 0}, \
{"single-thread-enable", CONFIG_HLP_NOSNGLT, PARAMFLAG_BOOL, iptr:&SINGLE_THREAD_FLAG, defintval:0, TYPE_INT, 0}, \
{"C" , CONFIG_HLP_DLF, 0, u64ptr:&(downlink_frequency[0][0]), defuintval:0, TYPE_UINT64, 0}, \
...
...
@@ -245,6 +248,7 @@ typedef struct {
int
band
;
uint32_t
clock_source
;
uint32_t
timing_source
;
double
tune_offset
;
int
hw_timing_advance
;
uint32_t
send_dmrs_sync
;
int
prb_interpolation
;
...
...
openair1/PHY/NR_UE_TRANSPORT/nr_ue_rf_helpers.c
View file @
daad3da6
...
...
@@ -67,7 +67,7 @@ void nr_rf_card_config_gain(openair0_config_t *openair0_cfg,
openair0_cfg
->
autocal
[
i
]
=
1
;
if
(
i
<
openair0_cfg
->
rx_num_channels
)
{
LOG_I
(
PHY
,
"HW: Configuring channel %d (rf_chain %d): setting tx_gain %
f, rx_gain %
f
\n
"
,
LOG_I
(
PHY
,
"HW: Configuring channel %d (rf_chain %d): setting tx_gain %
.0f, rx_gain %.0
f
\n
"
,
i
,
rf_chain
,
openair0_cfg
->
tx_gain
[
i
],
...
...
@@ -103,11 +103,12 @@ void nr_rf_card_config_freq(openair0_config_t *openair0_cfg,
openair0_cfg
->
autocal
[
i
]
=
1
;
if
(
i
<
openair0_cfg
->
rx_num_channels
)
{
LOG_I
(
PHY
,
"HW: Configuring channel %d (rf_chain %d): setting tx_freq %
f Hz, rx_freq %f Hz
\n
"
,
LOG_I
(
PHY
,
"HW: Configuring channel %d (rf_chain %d): setting tx_freq %
.0f Hz, rx_freq %.0f Hz, tune_offset %.0f
\n
"
,
i
,
rf_chain
,
openair0_cfg
->
tx_freq
[
i
],
openair0_cfg
->
rx_freq
[
i
]);
openair0_cfg
->
rx_freq
[
i
],
openair0_cfg
->
tune_offset
);
}
}
...
...
targets/ARCH/COMMON/common_lib.h
View file @
daad3da6
...
...
@@ -188,6 +188,7 @@ typedef struct {
//! \brief Center frequency in Hz for TX.
//! index: [0..rx_num_channels[ !!! see lte-ue.c:427 FIXME iterates over rx_num_channels
double
tx_freq
[
4
];
double
tune_offset
;
//! \brief memory
//! \brief Pointer to Calibration table for RX gains
rx_gain_calib_table_t
*
rx_gain_calib_table
;
...
...
targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp
View file @
daad3da6
...
...
@@ -747,8 +747,12 @@ static bool is_equal(double a, double b) {
void
*
freq_thread
(
void
*
arg
)
{
openair0_device
*
device
=
(
openair0_device
*
)
arg
;
usrp_state_t
*
s
=
(
usrp_state_t
*
)
device
->
priv
;
s
->
usrp
->
set_tx_freq
(
device
->
openair0_cfg
[
0
].
tx_freq
[
0
]);
s
->
usrp
->
set_rx_freq
(
device
->
openair0_cfg
[
0
].
rx_freq
[
0
]);
uhd
::
tune_request_t
tx_tune_req
(
device
->
openair0_cfg
[
0
].
tx_freq
[
0
],
device
->
openair0_cfg
[
0
].
tune_offset
);
uhd
::
tune_request_t
rx_tune_req
(
device
->
openair0_cfg
[
0
].
rx_freq
[
0
],
device
->
openair0_cfg
[
0
].
tune_offset
);
s
->
usrp
->
set_tx_freq
(
tx_tune_req
);
s
->
usrp
->
set_rx_freq
(
rx_tune_req
);
return
NULL
;
}
/*! \brief Set frequencies (TX/RX). Spawns a thread to handle the frequency change to not block the calling thread
...
...
@@ -760,14 +764,18 @@ void *freq_thread(void *arg) {
int
trx_usrp_set_freq
(
openair0_device
*
device
,
openair0_config_t
*
openair0_cfg
,
int
dont_block
)
{
usrp_state_t
*
s
=
(
usrp_state_t
*
)
device
->
priv
;
pthread_t
f_thread
;
printf
(
"Setting USRP TX Freq %f, RX Freq %f
\n
"
,
openair0_cfg
[
0
].
tx_freq
[
0
],
openair0_cfg
[
0
].
rx_freq
[
0
]);
printf
(
"Setting USRP TX Freq %f, RX Freq %f, tune_offset: %f, dont_block: %d
\n
"
,
openair0_cfg
[
0
].
tx_freq
[
0
],
openair0_cfg
[
0
].
rx_freq
[
0
],
openair0_cfg
[
0
].
tune_offset
,
dont_block
);
// spawn a thread to handle the frequency change to not block the calling thread
if
(
dont_block
==
1
)
pthread_create
(
&
f_thread
,
NULL
,
freq_thread
,(
void
*
)
device
);
else
{
s
->
usrp
->
set_tx_freq
(
device
->
openair0_cfg
[
0
].
tx_freq
[
0
]);
s
->
usrp
->
set_rx_freq
(
device
->
openair0_cfg
[
0
].
rx_freq
[
0
]);
uhd
::
tune_request_t
tx_tune_req
(
openair0_cfg
[
0
].
tx_freq
[
0
],
openair0_cfg
[
0
].
tune_offset
);
uhd
::
tune_request_t
rx_tune_req
(
openair0_cfg
[
0
].
rx_freq
[
0
],
openair0_cfg
[
0
].
tune_offset
);
s
->
usrp
->
set_tx_freq
(
tx_tune_req
);
s
->
usrp
->
set_rx_freq
(
rx_tune_req
);
}
return
(
0
);
...
...
@@ -780,9 +788,11 @@ int trx_usrp_set_freq(openair0_device *device, openair0_config_t *openair0_cfg,
*/
int
openair0_set_rx_frequencies
(
openair0_device
*
device
,
openair0_config_t
*
openair0_cfg
)
{
usrp_state_t
*
s
=
(
usrp_state_t
*
)
device
->
priv
;
uhd
::
tune_request_t
rx_tune_req
(
openair0_cfg
[
0
].
rx_freq
[
0
]);
rx_tune_req
.
rf_freq_policy
=
uhd
::
tune_request_t
::
POLICY_MANUAL
;
rx_tune_req
.
rf_freq
=
openair0_cfg
[
0
].
rx_freq
[
0
];
uhd
::
tune_request_t
rx_tune_req
(
openair0_cfg
[
0
].
rx_freq
[
0
],
openair0_cfg
[
0
].
tune_offset
);
printf
(
"In openair0_set_rx_frequencies, freq: %f, tune offset: %f
\n
"
,
openair0_cfg
[
0
].
rx_freq
[
0
],
openair0_cfg
[
0
].
tune_offset
);
//rx_tune_req.rf_freq_policy = uhd::tune_request_t::POLICY_MANUAL;
//rx_tune_req.rf_freq = openair0_cfg[0].rx_freq[0];
s
->
usrp
->
set_rx_freq
(
rx_tune_req
);
return
(
0
);
}
...
...
@@ -1277,7 +1287,9 @@ extern "C" {
for
(
int
i
=
0
;
i
<
((
int
)
s
->
usrp
->
get_rx_num_channels
());
i
++
)
{
if
(
i
<
openair0_cfg
[
0
].
rx_num_channels
)
{
s
->
usrp
->
set_rx_rate
(
openair0_cfg
[
0
].
sample_rate
,
i
+
choffset
);
s
->
usrp
->
set_rx_freq
(
openair0_cfg
[
0
].
rx_freq
[
i
],
i
+
choffset
);
uhd
::
tune_request_t
rx_tune_req
(
openair0_cfg
[
0
].
rx_freq
[
i
],
openair0_cfg
[
0
].
tune_offset
);
s
->
usrp
->
set_rx_freq
(
rx_tune_req
,
i
+
choffset
);
set_rx_gain_offset
(
&
openair0_cfg
[
0
],
i
,
bw_gain_adjust
);
::
uhd
::
gain_range_t
gain_range
=
s
->
usrp
->
get_rx_gain_range
(
i
+
choffset
);
// limit to maximum gain
...
...
@@ -1303,7 +1315,9 @@ extern "C" {
if
(
i
<
openair0_cfg
[
0
].
tx_num_channels
)
{
s
->
usrp
->
set_tx_rate
(
openair0_cfg
[
0
].
sample_rate
,
i
+
choffset
);
s
->
usrp
->
set_tx_freq
(
openair0_cfg
[
0
].
tx_freq
[
i
],
i
+
choffset
);
uhd
::
tune_request_t
tx_tune_req
(
openair0_cfg
[
0
].
tx_freq
[
i
],
openair0_cfg
[
0
].
tune_offset
);
s
->
usrp
->
set_tx_freq
(
tx_tune_req
,
i
+
choffset
);
s
->
usrp
->
set_tx_gain
(
gain_range_tx
.
stop
()
-
openair0_cfg
[
0
].
tx_gain
[
i
],
i
+
choffset
);
LOG_I
(
HW
,
"USRP TX_GAIN:%3.2lf gain_range:%3.2lf tx_gain:%3.2lf
\n
"
,
gain_range_tx
.
stop
()
-
openair0_cfg
[
0
].
tx_gain
[
i
],
gain_range_tx
.
stop
(),
openair0_cfg
[
0
].
tx_gain
[
i
]);
}
...
...
targets/RT/USER/lte-ru.c
View file @
daad3da6
...
...
@@ -1371,11 +1371,12 @@ void fill_rf_config(RU_t *ru,
cfg
->
tx_gain
[
i
]
=
(
double
)
ru
->
att_tx
;
cfg
->
rx_gain
[
i
]
=
ru
->
max_rxgain
-
(
double
)
ru
->
att_rx
;
cfg
->
configFilename
=
rf_config_file
;
LOG_I
(
PHY
,
"channel %d, Setting tx_gain offset %
f, rx_gain offset %f, tx_freq %f, rx_freq %f
\n
"
,
LOG_I
(
PHY
,
"channel %d, Setting tx_gain offset %
.0f, rx_gain offset %.0f, tx_freq %.0f, rx_freq %.0f, tune_offset %.0f Hz
\n
"
,
i
,
cfg
->
tx_gain
[
i
],
cfg
->
rx_gain
[
i
],
cfg
->
tx_freq
[
i
],
cfg
->
rx_freq
[
i
]);
cfg
->
rx_freq
[
i
],
cfg
->
tune_offset
);
}
}
...
...
@@ -2972,6 +2973,8 @@ RU_t **RCconfig_RU(int nb_RU,int nb_L1_inst,PHY_VARS_eNB ***eNB,uint64_t *ru_mas
ru
[
j
]
->
openair0_cfg
.
time_source
=
unset
;
}
ru
[
j
]
->
openair0_cfg
.
tune_offset
=
get_softmodem_params
()
->
tune_offset
;
LOG_I
(
PHY
,
"RU %d is_slave=%s
\n
"
,
j
,
*
(
RUParamList
.
paramarray
[
j
][
RU_IS_SLAVE_IDX
].
strptr
));
if
(
strcmp
(
*
(
RUParamList
.
paramarray
[
j
][
RU_IS_SLAVE_IDX
].
strptr
),
"yes"
)
==
0
)
ru
[
j
]
->
is_slave
=
1
;
...
...
targets/RT/USER/lte-uesoftmodem.c
View file @
daad3da6
...
...
@@ -446,6 +446,7 @@ void init_openair0(LTE_DL_FRAME_PARMS *frame_parms,int rxgain) {
openair0_cfg
[
card
].
num_rb_dl
=
frame_parms
->
N_RB_DL
;
openair0_cfg
[
card
].
clock_source
=
get_softmodem_params
()
->
clock_source
;
openair0_cfg
[
card
].
time_source
=
get_softmodem_params
()
->
timing_source
;
openair0_cfg
[
card
].
tune_offset
=
get_softmodem_params
()
->
tune_offset
;
openair0_cfg
[
card
].
tx_num_channels
=
min
(
2
,
frame_parms
->
nb_antennas_tx
);
openair0_cfg
[
card
].
rx_num_channels
=
min
(
2
,
frame_parms
->
nb_antennas_rx
);
...
...
@@ -464,11 +465,12 @@ void init_openair0(LTE_DL_FRAME_PARMS *frame_parms,int rxgain) {
openair0_cfg
[
card
].
tx_gain
[
i
]
=
tx_gain
[
0
][
i
];
openair0_cfg
[
card
].
rx_gain
[
i
]
=
rxgain
-
rx_gain_off
;
openair0_cfg
[
card
].
configFilename
=
get_softmodem_params
()
->
rf_config_file
;
printf
(
"Card %d, channel %d, Setting tx_gain %
f, rx_gain %f, tx_freq %f, rx_freq %
f
\n
"
,
printf
(
"Card %d, channel %d, Setting tx_gain %
.0f, rx_gain %.0f, tx_freq %.0f, rx_freq %.0f, tune_offset %.0
f
\n
"
,
card
,
i
,
openair0_cfg
[
card
].
tx_gain
[
i
],
openair0_cfg
[
card
].
rx_gain
[
i
],
openair0_cfg
[
card
].
tx_freq
[
i
],
openair0_cfg
[
card
].
rx_freq
[
i
]);
openair0_cfg
[
card
].
rx_freq
[
i
],
openair0_cfg
[
card
].
tune_offset
);
}
if
(
usrp_args
)
openair0_cfg
[
card
].
sdr_addrs
=
usrp_args
;
...
...
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