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
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
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
OpenXG
OpenXG-RAN
Commits
f85ccaa0
Commit
f85ccaa0
authored
Mar 28, 2022
by
Florian Kaltenberger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "making SFN dependent on GPS time (when available)"
This reverts commit
5679e4a3
.
parent
24594d99
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
14 deletions
+7
-14
executables/nr-ru.c
executables/nr-ru.c
+1
-8
targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp
targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp
+6
-6
No files found.
executables/nr-ru.c
View file @
f85ccaa0
...
...
@@ -604,7 +604,6 @@ void *emulatedRF_thread(void *param) {
void
rx_rf
(
RU_t
*
ru
,
int
*
frame
,
int
*
slot
)
{
RU_proc_t
*
proc
=
&
ru
->
proc
;
NR_DL_FRAME_PARMS
*
fp
=
ru
->
nr_frame_parms
;
openair0_config_t
*
cfg
=
&
ru
->
openair0_cfg
;
void
*
rxp
[
ru
->
nb_rx
];
unsigned
int
rxs
;
int
i
;
...
...
@@ -654,13 +653,7 @@ void rx_rf(RU_t *ru,int *frame,int *slot) {
}
}
//compute system frame number (SFN) according to O-RAN-WG4-CUS.0-v02.00 (using alpha=beta=0)
// this assumes that the USRP has been synchronized to the GPS time
// OAI uses timestamps in sample time stored in int64_t, but it will fit in double precision for many years to come.
double
gps_sec
=
((
double
)
ts
)
/
cfg
->
sample_rate
;
proc
->
frame_rx
=
((
int64_t
)
(
gps_sec
/
0
.
01
))
&
1023
;
//proc->frame_rx = (proc->timestamp_rx / (fp->samples_per_subframe*10))&1023;
proc
->
frame_rx
=
(
proc
->
timestamp_rx
/
(
fp
->
samples_per_subframe
*
10
))
&
1023
;
proc
->
tti_rx
=
fp
->
get_slot_from_timestamp
(
proc
->
timestamp_rx
,
fp
);
// synchronize first reception to frame 0 subframe 0
LOG_D
(
PHY
,
"RU %d/%d TS %llu , frame %d, slot %d.%d / %d
\n
"
,
...
...
targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp
View file @
f85ccaa0
...
...
@@ -203,8 +203,8 @@ static int sync_to_gps(openair0_device *device) {
//Set to GPS time
uhd
::
time_spec_t
gps_time
=
uhd
::
time_spec_t
(
time_t
(
s
->
usrp
->
get_mboard_sensor
(
"gps_time"
,
mboard
).
to_int
()));
s
->
usrp
->
set_time_next_pps
(
gps_time
+
1.0
,
mboard
);
//
s->usrp->set_time_next_pps(uhd::time_spec_t(0.0));
//
s->usrp->set_time_next_pps(gps_time+1.0, mboard);
s
->
usrp
->
set_time_next_pps
(
uhd
::
time_spec_t
(
0.0
));
//Wait for it to apply
//The wait is 2 seconds because N-Series has a known issue where
//the time at the last PPS does not properly update at the PPS edge
...
...
@@ -215,10 +215,10 @@ static int sync_to_gps(openair0_device *device) {
uhd
::
time_spec_t
time_last_pps
=
s
->
usrp
->
get_time_last_pps
(
mboard
);
std
::
cout
<<
"USRP time: "
<<
(
boost
::
format
(
"%0.9f"
)
%
time_last_pps
.
get_real_secs
())
<<
std
::
endl
;
std
::
cout
<<
"GPSDO time: "
<<
(
boost
::
format
(
"%0.9f"
)
%
gps_time
.
get_real_secs
())
<<
std
::
endl
;
if
(
gps_time
.
get_real_secs
()
==
time_last_pps
.
get_real_secs
())
std
::
cout
<<
std
::
endl
<<
"SUCCESS: USRP time synchronized to GPS time"
<<
std
::
endl
<<
std
::
endl
;
else
std
::
cerr
<<
std
::
endl
<<
"ERROR: Failed to synchronize USRP time to GPS time"
<<
std
::
endl
<<
std
::
endl
;
//
if (gps_time.get_real_secs() == time_last_pps.get_real_secs())
//
std::cout << std::endl << "SUCCESS: USRP time synchronized to GPS time" << std::endl << std::endl;
//
else
//
std::cerr << std::endl << "ERROR: Failed to synchronize USRP time to GPS time" << std::endl << std::endl;
}
if
(
num_gps_locked
==
num_mboards
and
num_mboards
>
1
)
{
...
...
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