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
91160656
Commit
91160656
authored
8 years ago
by
Rohit Gupta
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
minor fix to usrp timing logging
parent
7525238f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
17 deletions
+23
-17
targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp
targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp
+23
-17
No files found.
targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp
View file @
91160656
...
...
@@ -46,6 +46,7 @@
#include <fstream>
#include <cmath>
#include <time.h>
#include "UTIL/LOG/log_extern.h"
#include "common_lib.h"
#ifdef __SSE4_1__
# include <smmintrin.h>
...
...
@@ -213,9 +214,11 @@ static int trx_usrp_write(openair0_device *device, openair0_timestamp timestamp,
time_avg
=
time_diff
;
else
time_avg
=
(
time_diff
+
time_avg
)
/
2.0
;
if
(
loop
%
10000
==
0
)
printf
(
"
\n
usrp_write: min(ns)=%d, max(ns)=%d, avg(ns)=%d"
,
(
int
)
time_min
,
(
int
)
time_max
,(
int
)
time_avg
);
//prints statics of uhd every 10 seconds
if
(
loop
%
(
10
*
((
int
)
device
->
openair0_cfg
[
0
].
sample_rate
/
(
int
)
nsamps
))
==
0
)
LOG_I
(
HW
,
"usrp_write: min(ns)=%d, max(ns)=%d, avg(ns)=%d
\n
"
,
(
int
)
time_min
,
(
int
)
time_max
,(
int
)
time_avg
);
loop
++
;
return
ret
;
}
...
...
@@ -318,20 +321,23 @@ static int trx_usrp_read(openair0_device *device, openair0_timestamp *ptimestamp
s
->
rx_timestamp
=
s
->
rx_md
.
time_spec
.
to_ticks
(
s
->
sample_rate
);
*
ptimestamp
=
s
->
rx_timestamp
;
clock_gettime
(
CLOCK_MONOTONIC_RAW
,
&
tp_end
);
time_diff
=
(
tp_end
.
tv_sec
-
tp_start
.
tv_sec
)
*
1E09
+
(
tp_end
.
tv_nsec
-
tp_start
.
tv_nsec
);
if
(
time_min
==
0
||
loop
==
1
||
time_min
>
time_diff
)
time_min
=
time_diff
;
if
(
time_max
==
0
||
loop
==
1
||
time_max
<
time_diff
)
time_max
=
time_diff
;
if
(
time_avg
==
0
||
loop
==
1
)
time_avg
=
time_diff
;
else
time_avg
=
(
time_diff
+
time_avg
)
/
2.0
;
if
(
loop
%
10000
==
0
)
printf
(
"
\n
usrp_read: min(ns)=%d, max(ns)=%d, avg(ns)=%d"
,
(
int
)
time_min
,
(
int
)
time_max
,(
int
)
time_avg
);
loop
++
;
return
samples_received
;
clock_gettime
(
CLOCK_MONOTONIC_RAW
,
&
tp_end
);
time_diff
=
(
tp_end
.
tv_sec
-
tp_start
.
tv_sec
)
*
1E09
+
(
tp_end
.
tv_nsec
-
tp_start
.
tv_nsec
);
if
(
time_min
==
0
||
loop
==
1
||
time_min
>
time_diff
)
time_min
=
time_diff
;
if
(
time_max
==
0
||
loop
==
1
||
time_max
<
time_diff
)
time_max
=
time_diff
;
if
(
time_avg
==
0
||
loop
==
1
)
time_avg
=
time_diff
;
else
time_avg
=
(
time_diff
+
time_avg
)
/
2.0
;
//prints statics of uhd every 10 seconds
if
(
loop
%
(
10
*
((
int
)
device
->
openair0_cfg
[
0
].
sample_rate
/
(
int
)
nsamps
))
==
0
)
LOG_I
(
HW
,
"usrp_read: min(ns)=%d, max(ns)=%d, avg(ns)=%d
\n
"
,
(
int
)
time_min
,
(
int
)
time_max
,(
int
)
time_avg
);
loop
++
;
return
samples_received
;
}
/*! \brief Get current timestamp of USRP
...
...
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