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
wangjie
OpenXG-RAN
Commits
d0c5dafd
Commit
d0c5dafd
authored
Apr 07, 2020
by
Florian Kaltenberger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
making recent changes optional by a flag. hopefully this will make regression tests pass.
parent
e81b2b28
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
16 deletions
+28
-16
executables/nr-ru.c
executables/nr-ru.c
+3
-0
targets/ARCH/COMMON/common_lib.h
targets/ARCH/COMMON/common_lib.h
+2
-0
targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp
targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp
+23
-16
No files found.
executables/nr-ru.c
View file @
d0c5dafd
...
...
@@ -1156,6 +1156,9 @@ void fill_rf_config(RU_t *ru, char *rf_config_file) {
cfg
->
num_rb_dl
=
N_RB
;
cfg
->
tx_num_channels
=
ru
->
nb_tx
;
cfg
->
rx_num_channels
=
ru
->
nb_rx
;
cfg
->
clock_source
=
get_softmodem_params
()
->
clock_source
;
cfg
->
use_single_antenna_port_for_tdd
=
1
;
//TODO: make this parameterzable
for
(
i
=
0
;
i
<
ru
->
nb_tx
;
i
++
)
{
if
(
ru
->
if_frequency
==
0
)
{
...
...
targets/ARCH/COMMON/common_lib.h
View file @
d0c5dafd
...
...
@@ -236,6 +236,8 @@ typedef struct {
double
tx_sample_rate
;
//! check for threequarter sampling rate
int8_t
threequarter_fs
;
//! flag to indicate use of same antenna port for RX and TX (for TDD)
int8_t
use_single_antenna_port_for_tdd
;
}
openair0_config_t
;
/*! \brief RF mapping */
...
...
targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp
View file @
d0c5dafd
...
...
@@ -105,8 +105,8 @@ typedef struct {
int64_t
rx_count
;
int
wait_for_first_pps
;
int
use_gps
;
int
first_tx
;
int
first_rx
;
//
int first_tx;
//
int first_rx;
//! timestamp of RX packet
openair0_timestamp
rx_timestamp
;
uint32_t
recplay_mode
;
...
...
@@ -288,16 +288,11 @@ static int trx_usrp_start(openair0_device *device) {
// set the output pins to 1
s
->
usrp
->
set_gpio_attr
(
"FP0"
,
"OUT"
,
7
<<
7
,
0xf80
);
//if (s->use_gps == 1 || device->openair0_cfg[0].time_source == external) {
s
->
wait_for_first_pps
=
1
;
/*} else {
s->wait_for_first_pps = 0;
}*/
s
->
rx_count
=
0
;
s
->
tx_count
=
0
;
s
->
first_tx
=
1
;
s
->
first_rx
=
1
;
//
s->first_tx = 1;
//
s->first_rx = 1;
s
->
rx_timestamp
=
0
;
...
...
@@ -308,6 +303,16 @@ static int trx_usrp_start(openair0_device *device) {
boost
::
this_thread
::
sleep
(
boost
::
posix_time
::
milliseconds
(
1
));
}
// init recv and send streaming command
if
(
device
->
openair0_cfg
->
use_single_antenna_port_for_tdd
==
0
)
{
uhd
::
stream_cmd_t
cmd
(
uhd
::
stream_cmd_t
::
STREAM_MODE_START_CONTINUOUS
);
cmd
.
time_spec
=
uhd
::
time_spec_t
(
1.0
);
cmd
.
stream_now
=
false
;
// start at constant delay
s
->
rx_stream
->
issue_stream_cmd
(
cmd
);
}
// else the issue stream mode command needs to be called every TDD period
return
0
;
}
/*! \brief Terminate operation of the USRP transceiver -- free all associated resources
...
...
@@ -322,15 +327,15 @@ static void trx_usrp_end(openair0_device *device) {
if
(
s
==
NULL
)
return
;
if
(
s
->
recplay_mode
!=
RECPLAY_REPLAYMODE
)
{
// not subframes replay
/*
if
((
s
->
recplay_mode
!=
RECPLAY_REPLAYMODE
)
&&
(
device
->
openair0_cfg
->
use_single_antenna_port_for_tdd
==
0
))
{
s
->
rx_stream
->
issue_stream_cmd
(
uhd
::
stream_cmd_t
::
STREAM_MODE_STOP_CONTINUOUS
);
//send a mini EOB packet
s
->
tx_md
.
end_of_burst
=
true
;
s
->
tx_stream
->
send
(
""
,
0
,
s
->
tx_md
);
s
->
tx_md
.
end_of_burst
=
false
;
sleep
(
1
);
*/
}
if
(
s
->
recplay_mode
==
RECPLAY_RECORDMODE
)
{
// subframes store
...
...
@@ -588,7 +593,7 @@ static int trx_usrp_read_recplay(openair0_device *device, openair0_timestamp *pt
if
(
cur_samples
==
0
)
{
std
::
cerr
<<
"starting subframes file with wrap_count="
<<
wrap_count
<<
" wrap_ts="
<<
wrap_ts
<<
" ts="
<<
ptimestamp
<<
std
::
endl
;
<<
" ts="
<<
*
ptimestamp
<<
std
::
endl
;
}
memcpy
(
buff
[
0
],
&
s
->
recplay_state
->
ms_sample
->
samples
[
0
],
nsamps
*
4
);
...
...
@@ -1285,11 +1290,13 @@ extern "C" {
/* Setting TX/RX BW after streamers are created due to USRP calibration issue */
for
(
int
i
=
0
;
i
<
((
int
)
s
->
usrp
->
get_tx_num_channels
())
&&
i
<
openair0_cfg
[
0
].
tx_num_channels
;
i
++
)
{
s
->
usrp
->
set_tx_bandwidth
(
openair0_cfg
[
0
].
tx_bw
,
i
);
if
(
device
->
openair0_cfg
->
use_single_antenna_port_for_tdd
==
1
)
s
->
usrp
->
set_tx_antenna
(
"TX/RX"
,
i
);
}
for
(
int
i
=
0
;
i
<
((
int
)
s
->
usrp
->
get_rx_num_channels
())
&&
i
<
openair0_cfg
[
0
].
rx_num_channels
;
i
++
)
{
s
->
usrp
->
set_rx_bandwidth
(
openair0_cfg
[
0
].
rx_bw
,
i
);
if
(
device
->
openair0_cfg
->
use_single_antenna_port_for_tdd
==
1
)
s
->
usrp
->
set_rx_antenna
(
"TX/RX"
,
i
);
}
...
...
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