Commit graph

51 commits

Author SHA1 Message Date
Brent Stapleton
967be2a4e8 uhd: mpm: apply clang-format to all files
Applying formatting changes to all .cpp and .hpp files in the following
directories:
```
find host/examples/ -iname *.hpp -o -iname *.cpp | \
    xargs clang-format -i -style=file
find host/tests/ -iname *.hpp -o -iname *.cpp | \
    xargs clang-format -i -style=file
find host/lib/usrp/dboard/neon/ -iname *.hpp -o -iname *.cpp | \
    xargs clang-format -i -style=file
find host/lib/usrp/dboard/magnesium/ -iname *.hpp -o -iname *.cpp | \
    xargs clang-format -i -style=file
find host/lib/usrp/device3/ -iname *.hpp -o -iname *.cpp | \
    xargs clang-format -i -style=file
find host/lib/usrp/mpmd/ -iname *.hpp -o -iname *.cpp | \
    xargs clang-format -i -style=file
find host/lib/usrp/x300/ -iname *.hpp -o -iname *.cpp | \
    xargs clang-format -i -style=file
find host/utils/ -iname *.hpp -o -iname *.cpp | \
    xargs clang-format -i -style=file
find mpm/ -iname *.hpp -o -iname *.cpp | \
    xargs clang-format -i -style=file
```

Also formatted host/include/, except Cpp03 was used as a the language
standard instead of Cpp11.
```
sed -i 's/ Cpp11/ Cpp03/g' .clang-format
find host/include/ -iname *.hpp -o -iname *.cpp | \
    xargs clang-format -i -style=file
```

Formatting style was designated by the .clang-format file.
2019-01-16 11:40:23 -08:00
Brent Stapleton
601e0ed87b examples: utils: skip formatting program options
Turning off clang formatting around the program option declarations.
clang-format makes them looks bad an unreadable because it thinks the
options are function calls or something.
2019-01-16 11:40:23 -08:00
Brent Stapleton
a7bd625203 examples: optimize benchmark_rate start time
Move the setting of the streaming start times back as late as possible.
Currently, there are memory allocations in between setting the
time_spec in the TX metadata and actually starting streaming. This will
lessen the need for an INIT_DELAY and decrease the probability of late
packets.
2019-01-03 09:20:18 -08:00
Brent Stapleton
06970692ae utils: fix bmark_rate MIMO synchronization
Fix USRP2 MIMO synchronization in benchmark_rate.

When synchronizing N2XXs connected with a MIMO cable, only the master's
time needs to be set; the slave will be synchronized automatically.
Currently, calling set_time_unknown_pps will attempt to synchronize the
slave on the next PPS, which can cause problems since the MIMO cable
doesn't propogate a PPS signal.
2018-10-12 10:27:55 -07:00
Martin Braun
3a4073799d examples: Avoid calculating dropped samples for negative offsets
There are cases when the first sample after an overrun has an earlier
timestamp than the timestamp of the error package. In this case,
benchmark_rate would incorrectly determine the number of dropped
samples, causing it to display a very large number.
This is not a fix of the negative offset issue, but will avoid
displaying overly pessimistic numbers dropped samples.

An error message is still displayed when this happens, which aids in
debugging this situation.
2018-05-03 10:05:48 -07:00
Martin Braun
fe4a53df93 examples: Fix sleep duration in benchmark_rate
The main thread sleeps while the receiver and transmitter threads are
going on. This fixes the calculated time it takes in single-channel
scenarios.
2018-05-03 10:05:48 -07:00
Martin Braun
46b9293ed2 examples: Add failure modes to benchmark_rate
When too many overruns, underruns, or dropped packets are detected,
benchmark_rate will now return EXIT_FAILURE. This allows to use it for
automated tests.

The thresholds are set very high by default, but can be manually tuned
by using new command line arguments:

    $ benchmark_rate --overrun-threshold 0 # Fail on any number of Os
2018-05-03 10:05:48 -07:00
Martin Braun
edd624e903 examples: Update benchmark_rate (more stats, timestamps)
- Messages are all timestamped, enables better understanding of the
  output log
- Less usage of Boost
- More stats (differentiate between RX and TX timeouts and sequence
  errors)
2018-03-14 15:18:00 -07:00
Martin Braun
305d0e79e2 examples: Fix some minor compiler warnings
All warnings reported by MSVC. Mostly related to narrowing conversions.
2018-02-19 17:01:40 -08:00
Martin Braun
ae5211d71d uhd: Update license headers
All copyright is now attributed to "Ettus Research, a National
Instruments company".

SPDX headers were also updated to latest version 3.0.
2018-02-19 16:54:52 -08:00
Martin Braun
4f948e2c8b Move all license headers to SPDX format. 2017-12-22 10:45:51 -08:00
Andrej Rode
c33928d2bb utils: add set_thread_name API call, move thread_priority to thread 2017-06-29 13:43:05 -07:00
Martin Braun
47cdd6319c uhd: Replaced many lexical_cast with appropriate C++11 equivalents 2017-06-29 13:40:07 -07:00
Martin Braun
39888bb340 examples: Fixed check for setting time on PPS vs. now 2016-09-28 09:49:53 -07:00
Derek Kozel
15173a8b72 examples: Added TX and RX channels args in benchmark_rate 2016-08-29 12:47:38 -07:00
Martin Braun
826af8bc5c examples: Remove default values for subdevs in benchmark_rate 2016-08-03 12:17:51 -07:00
Derek Kozel
ac93ba035d examples: Added tx and rx subdev arguments to benchmark_rate 2016-08-03 12:10:03 -07:00
Martin Braun
b9c3688d05 examples: Fixed unconditional wait for SISO case in benchmark_rate 2016-07-22 18:40:39 -07:00
Martin Braun
8a8b90183b examples: Added late command counter to benchmark_rate 2016-07-22 11:45:17 -07:00
michael-west
4d88b79727 examples: Fix RX thread in benchmark_rate example so it exits when EOB is seen 2016-07-22 11:31:40 -07:00
Martin Braun
f34e0beab1 Merge branch 'maint' 2016-05-19 17:43:48 -07:00
Paul David
1325cdd1fa examples: Increased the reference locking timeout in benchmark_rate 2016-05-17 10:15:29 -07:00
Martin Braun
c3b01cb670 examples: Add timeouts to benchmark_rate 2016-03-21 14:07:42 -07:00
Martin Braun
523a17872c examples: Re-enabled better thread interruption in benchmark_rate
The previous version (using atomic variables) was fine, but didn't work
with all the Boost versions we currently support on the 3.9.X release
line.
This is a slightly less safe, but still sufficient example.
2016-03-21 08:39:45 -07:00
Martin Braun
4cfc809bd5 Revert "examples: Modified benchmark_rate so thread interrupts cannot cause problems"
This reverts commit 8930d853f3.
2016-03-21 08:39:45 -07:00
Martin Braun
0dfbf9771e examples: Modified benchmark_rate so thread interrupts cannot cause problems 2016-03-21 08:39:45 -07:00
Martin Braun
4b24235c80 examples: Re-enabled better thread interruption in benchmark_rate
The previous version (using atomic variables) was fine, but didn't work
with all the Boost versions we currently support on the 3.9.X release
line.
This is a slightly less safe, but still sufficient example.
2016-03-17 10:17:57 -07:00
Martin Braun
c1c336e43a Revert "examples: Modified benchmark_rate so thread interrupts cannot cause problems"
This reverts commit 8930d853f3.
2016-03-16 21:39:33 -07:00
Martin Braun
8930d853f3 examples: Modified benchmark_rate so thread interrupts cannot cause problems 2016-03-14 15:07:53 -07:00
DaulPavid
35c6d74297 Corrected the UHD behavior in the event of a USB disconnect 2016-02-12 13:32:38 -08:00
Nicholas Corgan
715f4dd313 Fixed master-specific warnings
* MinGW: unused parameter warning, MSVC-specific pragma
* MSVC: bool narrowing
2015-03-27 13:36:18 -07:00
Martin Braun
864f84b5cc examples: Merged benchmark_rate and transport_hammer 2014-11-13 01:17:18 +01:00
Martin Braun
10ff484ccb examples: Whitespace and other cleanup 2014-10-28 19:42:22 +01:00
Nicholas Corgan
a6e18604be OctoClock firmware upgrade, added host driver
* OctoClock can communicate with UHD over Ethernet
* Can read NMEA strings from GPSDO and send to host
* Added multi_usrp_clock class for clock devices
* uhd::device can now filter to return only USRP devices or clock devices
* New OctoClock bootloader can accept firmware download over Ethernet
* Added octoclock_burn_eeprom,octoclock_firmware_burner utilities
* Added test_clock_synch example to show clock API
2014-07-23 07:37:32 -07:00
Martin Braun
853901782f uhd: Added nicer error reporting to rx examples 2014-04-10 21:26:39 +02:00
Ben Hilburn
178ac3f1c9 Merging USRP X300 and X310 support!! 2014-02-04 11:04:07 -08:00
Nicholas Corgan
96e50aebb7 examples: changed examples that force usage of all channels to allow user to input which channels to use 2013-08-26 16:04:18 -07:00
Josh Blum
6de009cc79 uhd: benchmark use builtin samp calculation 2013-08-20 19:19:49 -07:00
Josh Blum
eb3f43c548 uhd: dont handle multi-chan overflow recovery here 2013-07-19 12:43:22 -07:00
Josh Blum
c464a63e87 uhd: added new calls to streamer object + support work
* The transmit streamer gives access to the async msg queue.
* The receive streamer gives access to the issue stream cmd.
* Supporting usrp implementation files updated.
* Example applications updated to use this API.
2013-07-15 15:44:42 -07:00
Moritz Fischer
171e46cebe examples & utils: return EXIT_FAILURE and EXIT_SUCCESS respectively
instead of 0 and 1.
2012-10-26 14:00:29 -07:00
Josh Blum
749633397f examples: added multi-channel and host format options to benchmark 2012-04-13 11:51:33 -07:00
Josh Blum
f88dd2289b dsp rework: added otw mode for benchmark app 2012-02-03 10:57:49 -08:00
Josh Blum
fac15db5d7 uhd: renamed some of the stream types and functions 2011-11-03 20:37:11 -07:00
Josh Blum
a629bbe7e3 uhd: updated examples to use new streamer interface 2011-11-03 20:37:10 -07:00
Josh Blum
948a5fd052 uhd: benchmark example will print help if no rate specified 2011-07-08 12:03:14 -07:00
Josh Blum
aca0769eb1 uhd: on e100, this benchmark control thread should also have prio so it can spawn both 2011-06-17 21:02:07 +01:00
Josh Blum
c7f848ab0d e100: implemented spi, i2c, messages w/ peek/poke
spi and i2c are done w/ polling, but this is ok,
the transactions always complete by the first check

a gpio is used to wake up poll() and check for messages.
messages are read using poke32, unpacked, and enqueued.
2011-06-17 06:31:36 +01:00
Josh Blum
b769fe40f1 uhd: more benchmark tweaks, removed old benchmark rx 2011-06-15 14:42:12 -07:00
Josh Blum
868d586278 uhd: added dropped samples calculation to rx test 2011-06-15 14:17:28 -07:00