Commit Graph

615 Commits

Author SHA1 Message Date
Martin Braun
c2c45fb17e fixup! examples: gpio: Refactor example
The example refactoring required usage of the get/set source API, which
isn't available on B2xx series. This patch tests for the existence of
said API, and disables its usage if appropriate.
2022-06-01 13:28:31 -07:00
Martin Braun
8286b1f094 fixup! examples: gpio: Refactor example
The refactoring changed the behaviour of --bitbang: before, it would
terminate after one readback unless --repeat was specified, in which
case it would require a Ctrl-C (SIGINT). After the refactoring, it
always required a SIGINT. This changes the behaviour back to prior to
727141d, and will now only read back once, unless --repeat is provided.

This also fixes the bitbang devtest, which would go on indefinitely.
2022-05-27 13:02:55 -07:00
Martin Braun
727141d851 examples: gpio: Refactor example
The example had organically grown and was getting hard to read, and also
had some known issues. Summary of fixes:

- Default GPIO bank and connector are now derived from the device. This
  allows this example to pass without throwing an exception on E3xx and
  X4xx series when using default arguments.
- The bitbang test is moved into its own code section, to make the rest
  more readable.
- We move all the streamer-related code into a helper struct
- Some repetitive parts of the code are moved into their own functions
- The argument --require-loopback is added, which will fail tests if
  GPIO pins are not correctly looped back externally
- --list-banks is renamed to --list_banks for consistency
2022-05-25 07:56:27 -07:00
Wade Fife
92016a585a fpga: rfnoc: Remove rfnoc_version from target YAML
This causes the latest RFNoC protocol version to be used by default
and avoids the need to update YAML files every time the RFNoC
protocol version gets bumped.
2022-05-11 12:29:35 -07:00
Wade Fife
483b10fe54 examples: Fix gain testbench name 2022-04-06 06:38:17 -07:00
Martin Anderseck
bc8713e7af host: SPI: Read number of supported SPI slaves from device
Add support for reading the number of supported SPI slaves from
the device. This has become necessary because we may have bitfiles
with different capabilities and we want to report this back correctly.
2022-04-04 12:27:18 -07:00
Wade Fife
6318eaeff5 rfnoc: Update device port names in image core YAML
Update USRP RFNoC iamge core YAML files to use the more consistent
device port names. Clean up the formatting and make the files more
consistent.
2022-03-31 13:51:23 -07:00
Martin Braun
f43511e913 examples: Add replay_capture.py
This is an example that allows capturing RF data into DRAM, and then
stream it back to host, using the Python API.
2022-03-31 08:10:45 -07:00
Martin Braun
708f1c2b35 rfnoc: Remove UHD3-API usages
- rfnoc_replay_samples_from_file still had UHD3-vestiges for selecting
  block port and ID
- The documentation for stream_args_t also included block port and ID
  examples
2022-03-11 08:59:39 -06:00
Aaron Rossetto
7e8c52d807 tests: Atomicize counters in benchmark_rate
The counters that keep track of overruns, underruns, number of samples
transferred, etc., were not atomic. Thus, running benchmark_rate with
multiple threads would result in inaccurate statistics being reported at
the end of the run. This commit makes those counters atomic variables so
that they are updated properly.
2022-03-07 09:21:49 -06:00
Wade Fife
6ff8bd326b fpga: rfnoc: Regenerate noc_shells 2022-03-04 09:42:39 -06:00
michael-west
ad054cd3ef examples: benchmark_rate improvements
- Added support for tx_spb and rx_spb arguments
- Fixed TX thread timestamp for single channel

Signed-off-by: michael-west <michael.west@ettus.com>
2022-03-03 14:11:42 -06:00
Martin Braun
c9944cb7ee examples: replay: Improve rfnoc_replay_samples_from_file
- Use connect_through_blocks() to create connections
- Remove check for spp being an integer multiple of the word size, the
  atomic item size feature will do that for us now
- When using --nsamps, automatically terminate application after samples
  have been tx'd.
- Added sleep statements to throttle empty while loops
- Minor formatting changes
2022-03-02 10:14:28 -06:00
Rick Farina (Zero_Chaos)
b170ec5d75 cmake: ncurses: fix building with split tinfo
This fixes an issue where tinfo and ncurses are split into separate
libraries.
2022-02-24 13:33:39 -06:00
Martin Braun
1c726f5667 rfnoc: Remove references to nocscript from YAML files
The sw_iface entry in the `control` section is yet underdefined, so we
can remove it from the block descriptors.
2022-02-23 08:57:48 -06:00
Martin Anderseck
09689f9805 SPI: Add SPI example
Add example to demonstrate and test SPI functionality.
2022-01-14 14:35:36 -06:00
Andrew Lynch
5d80e28752 examples: support multiple streamers in benchmark_rate 2022-01-10 14:57:30 -06:00
Martin Braun
8972efb734 examples: Fix tx_bursts bandwidth/freq/gain reporting
This example would not specify a channel when querying the actual
frequency/bandwidth/gain after setting it. When using the --channels
options like this:

    tx_bursts --channels 1 --freq 1e9 [...]

...it would request the frequency of 1 GHz on channel 1, then query the
frequency on channel 0 when reporting the "actual" frequency.

Also removes some boost::format().
2021-12-16 09:18:47 -06:00
Wade Fife
270a7e13c3 rfnoc: Fix noc_shell direction comments
Some comments describing data flow direction were wrong. This commit
updates the Mako files and updates the noc_shell modules with newly
generated versions.
2021-12-08 08:36:46 -06:00
Martin Braun
746c896eaf examples: Improve rfnoc_rx_to_file
This example had some major issues since UHD 4, which are now fixed.
Mainly, the option to include a custom RFNoC block was not working.

The example was rehauled severely:
- Custom blocks are now usable again.
- UHD/RFNoC code is used for the connections, rather than a custom
  kludge.
- Sample rate is set via property propagation
- boost::format() was not helpful in this example, and was removed.
- A list of active connections is now printed
- The --block-args argument is dropped in favour of --block-props. The
  former never did anything useful, and "block args" are a UHD 3 thing.
2021-12-01 13:34:35 -08:00
Wade Fife
d3424e8b66 examples: Use cmul for gain block in-tree IP example 2021-11-15 12:32:06 -06:00
Wade Fife
ec814ff0c3 examples: Test all variants in gain testbench 2021-11-04 15:50:54 -05:00
Wade Fife
a99fec3973 examples: Make IQ order clear in gain RFNoC block 2021-11-04 15:50:54 -05:00
Lane Kolbly
905667d69a example: gpio: Separate bank and port arguments
"bank" refers to what the radio control sees, and "port" refers to what
the user looking at the physical device sees. For example, on X410 each
radio control only has a single (24-bit) output, which can be routed
to either of two ports.
2021-11-03 06:04:19 -07:00
Martin Braun
78336d4f6f rfnoc: Remove cruft from UHD 3 (constants)
This removes some constants from UHD that were left over from RFNoC/UHD
3.x. They are unused.

rfnoc_rx_to_file had a commented-out section that was also UHD-3 only.

Note that rfnoc/constants.hpp is pretty bare now, and could be removed.
However, it is in the public header section, so we shall leave the used
constants where they are.

This requires fixing includes in mgmt_portal.cpp.
2021-11-02 07:57:39 -07:00
Martin Braun
b6119e581e uhd: Replace Boost mutexes and locks with standard options
This is a very mechanical task that could almost have been done with
sed. Boost versions of mutexes and locks were removed, and replaced with
std:: versions. The replacement tables are as follows:

== Mutexes ==
- boost::mutex -> std::mutex
- boost::recursive_mutex -> std::recursive_mutex

Mutexes behave identically between Boost and std:: and have the same
API.

== Locks ==
C++11 has only two types of lock that we use/need in UHD:
- std::lock_guard: Identical to boost::lock_guard
- std::unique_lock: Identical to boost::unique_lock

Boost also has boost::mutex::scoped_lock, which is a typedef for
boost::unique_lock<>. However, we often have used scoped_lock where we
meant to use lock_guard<>. The name is a bit misleading, "scoped lock"
sounding a bit like an RAII mechanism. Therefore, some previous
boost::mutex::scoped_lock are now std::lock_guard<>.

std::unique_lock is required when doing more than RAII locking (i.e.,
unlocking, relocking, usage with condition variables, etc.).

== Condition Variables ==
Condition variables were out of the scope of this lock/mutex change, but
in UHD, we inconsistently use boost::condition vs.
boost::condition_variable. The former is a templated version of the
latter, and thus works fine with std::mutex'es. Therefore, some
boost::condition_variable where changed to boost::condition.

All locks and mutexes use `#include <mutex>`. The corresponding Boost
includes were removed. In some cases, this exposed issues with implicit
Boost includes elsewhere. The missing explicit includes were added.
2021-10-19 12:21:33 -07:00
Lars Amsel
0fa4f7179b bug: fix channel indexing when reading USRP power
the USRP power meter will only receive from a single channel which
is configured by the argument parameter. The streamer receive
data will therefor alwalys have a single channel. So do not index
with chan when passing the streamer to uhd.dsp.signals.get_usrp_power.
2021-10-11 10:43:10 -07:00
Martin Braun
4e1068671f python: multi_usrp: Fix issues in send_waveform()
- Like with RX, this now allows passing in stream time and existing
  streamer
- There was no EOB being sent at the end (now there is)
- Fixed some linter issues
2021-10-06 11:57:25 -07:00
Martin Braun
b34e2f0593 python: Fix dropped-sample calculation in benchmark_rate.py
This fixes a subtle bug, where a variable to cache the timestamp of an
error gets bound to the metadata instead of creating a copy thereof.
Without this fix, the calculation of dropped samples would always be 0,
because the difference in timestamps would incorrectly be always zero.
This fix will now make a copy of the timestamp.

Shoutout to GitHub user bhorsfield for finding this issue.
2021-09-28 06:25:25 -07:00
Martin Braun
652873b664 examples: Improve txrx_loopback_to_file (late recv, Boost, timing)
- Fixes a bug where the RX stream command set set independent of the
  device time. Now, we read back get_time_now() to calculate the command
  time.
- When using multiple RX USRPs, sync their times. Before, they were left
  untouched, causing possible timing mismatches.
- Increase the initial timeout value. The previous value had only been
  tested with N2x0.
- Replace the boost::thread_group with a std::thread.
- Remove some boost::format where it didn't add value.
2021-09-17 13:27:17 -07:00
Martin Braun
9985dd7ac5 cmake: Fix rfnoc-example (CMake paths)
This reverts part of 09d94529e, which should not have touched these
particular CMake files.
2021-09-17 12:53:46 -07:00
Martin Braun
09d94529e5 cmake: Replace CMAKE_{SOURCE,BINARY}_DIR with UHD_*_DIR
See the CMake 3.8 documentation on these two variables:
https://cmake.org/cmake/help/v3.8/variable/PROJECT-NAME_SOURCE_DIR.html
https://cmake.org/cmake/help/v3.8/variable/CMAKE_SOURCE_DIR.html

Under normal circumstances, these two are identical. For sub-projects
(i.e., when building UHD as part of something else that is also a CMake
project), only the former is useful. There is no discernible downside of
using UHD_SOURCE_DIR over CMAKE_SOURCE_DIR.

This was changed using sed:

$ sed -i "s/CMAKE_SOURCE_DIR/UHD_SOURCE_DIR/g" \
    `ag -l CMAKE_SOURCE_DIR **/{CMakeLists.txt,*.cmake}`
$ sed -i "s/CMAKE_BINARY_DIR/UHD_BINARY_DIR/g" \
    `ag -l CMAKE_BINARY_DIR **/{CMakeLists.txt,*.cmake}`

At the same time, we also replace the CMake variable UHD_HOST_ROOT (used
in MPM) with UHD_SOURCE_DIR. There's no reason to have two variables
with the same meaning and different names, but more importantly, this
means that UHD_SOURCE_DIR is defined even in those cases where MPM calls
into CMake files from UHD without any additional patches.

Shoutout to GitHub user marcobergamin for bringing this up.
2021-09-10 15:08:10 -05:00
Wade Fife
11a20a10c7 examples: Show how to use in-tree Verilog header
Adds example showing how to `include an in-tree Verilog header
file in the rfnoc_block_gain example.
2021-09-08 08:36:05 -05:00
Wade Fife
a6d43465e6 examples: Add x400/x410 target to RFNoC example 2021-08-30 08:20:10 -05:00
Martin Braun
6ce7ec8d5c examples: Fix icores example to match current RFNoC specs
The YAML file was using float-versions, not string versions.
2021-06-28 13:46:08 -05:00
Aaron Rossetto
78e24a4b3b examples: Update example CMakeLists.txt for minimum version bumps 2021-06-28 13:44:25 -05:00
mattprost
0ea89ffaa4 examples: Fix tx frequency tuning in radio loopback 2021-06-25 13:59:14 -05:00
Martin Braun
7044fcdca5 uhd: Remove includes of list_of.hpp where appropriate
This Boost header is included in some places, despite not being used.
2021-06-24 12:00:49 -05:00
Martin Braun
188fbb17cf uhd: Remove all occurences of boost::math::*round()
Its behaviour is almost identical to std::lround, which we use instead.
The only downside of std::lround is that it always returns a long, which
we don't always need. We thus add some casts for those cases to make the
compiler happy.
2021-06-24 12:00:49 -05:00
Wade Fife
ca21048bd2 fpga: Change RFNoC YAML version numbers to strings
Change version from a numeric to a string, in order to
differentiate between versions like "1.1" and "1.10".
2021-06-08 15:48:59 -05:00
Martin Braun
d2fc12dd8d examples: Fix underrun/seq error reporting in benchmark_rate.py
The numbers for these were swapped.
2021-05-20 14:58:43 -05:00
Lane Kolbly
1efdc3a7f6 examples: Add min dynamic range limit to ascii art DFT example
The DFT plotting routine hangs when the dynamic range equals zero,
so this change adds a limit so that the dynamic range never goes
below 10.
2021-04-15 14:00:34 -05:00
Wade Fife
ada6a4e467 examples: Add IP to OOT RFNoC gain example
This updates the gain example to show how to use RFNoC IP, in-tree
Xilinx IP, and out-of-tree Xilinx IP in a custom RFNoC block.
2021-03-17 17:46:06 -05:00
Lane Kolbly
bbd511dbcc examples: Remove unused arguments for rfnoc_radio_loopback 2021-03-11 09:52:18 -06:00
Martin Braun
107a49c0c2 host: Update code base using clang-tidy
The checks from the new clang-tidy file are applied to the source tree
using:

$ find . -name "*.cpp" | sort -u | xargs \
    --max-procs 8 --max-args 1 clang-tidy --format-style=file \
    --fix -p /path/to/compile_commands.json
2021-03-04 08:07:26 -06:00
Lane Kolbly
b6cddba226 examples: Fix PPS option in rfnoc_radio_loopback 2020-11-17 16:23:17 -06:00
michael-west
0a5e173eba examples: Fix --random option in benchmark_rate
The implementation was not properly configuring the stream command if
the --random flag was used.  It was especially bad when multiple
channels were specified.

Signed-off-by: michael-west <michael.west@ettus.com>
2020-10-12 15:10:07 -05:00
michael-west
7c02eb0dd3 Examples: Fix install paths in OOT RFNoC example
- Add missing "uhd/" subdirectory.
- Update install path for YAML file.
- Fix include directories and link libraries for init_gain_block.

Signed-off-by: michael-west <michael.west@ettus.com>
2020-09-13 09:48:11 -07:00
mattprost
fa2d383ff5 examples: replay samples from file
This example exercises the Replay Block RFNoC API. The Replay records
IQ data from a file and plays it back into a Radio for transmitting.

Signed-off-by: mattprost <matt.prost@ni.com>
2020-08-11 16:08:16 -05:00
Samuel O'Brien
84c33194ce example: Check for failure in tx_samples_from_file
I was using this example for testing with the simulator. If there is a
flow control failure, the original example would just silently finish,
outputing the message "Done!" (Not even printing a timeout message).

This commit asserts that the number of samples sent is equal to the
number of samples provided.

Signed-off-by: Samuel O'Brien <sam.obrien@ni.com>
2020-07-31 15:09:33 -05:00
Lars Amsel
5476ec584e examples: Fix usrp_power_meter example
This PR applies antenna channel settings before available calibration
data, and moves initialization code to setup_device, returning necessary
settings in a tuple.
2020-06-11 08:26:23 -05:00
Etienne Wodey
a24cfbac86 host/examples/ascii_art_dft.hpp: fix and modernize example main
Refresh screen after printing the DFT data.
Use C++14 std::this_thread::sleep_for to control the refresh rate.

Signed-off-by: Etienne Wodey <wodey@iqo.uni-hannover.de>
2020-05-26 13:02:50 -05:00
Martin Braun
14ed832af5 examples: Add usrp_power_meter example
This is a utility that can be used to measure received power, assuming
a calibrated device.

For example, it can be called like this:

    usrp_power_meter.py -a type=x300 -f 1e9 --mode continuous

To continuously measure input power at 1 GHz.
2020-05-19 13:30:20 -05:00
Martin Braun
1bba62a75a Remove remaining Python 2 references
This changes two things in all applicable files:
- Remove imports from __future__
- Change default shebangs from /usr/bin/env python to /usr/bin/env
  python3
2020-05-07 15:10:41 -05:00
Martin Braun
e31b16a07c rfnoc-example: Removed DRAM from image core
The DRAM was incorrectly connected, but it's also not necessary for this
example and is hence removed.
2020-05-05 08:04:50 -05:00
Michael West
52fb587373 examples: Update test_messages example
The example assumed that there was always at least one TX and on RX
channel.  Since that is not always true, this change checks for TX
and RX channels and only exucutes tests for what exists on the device.

Signed-off-by: Michael West <michael.west@ettus.com>
2020-04-30 15:14:28 -05:00
Michael West
8720f42b33 examples: Update gpio example
The example assumed that there was always at least one TX and on RX
channel.  Since that is not always true, this change checks for TX
and RX channels and only exucutes tests for what exists on the device.

Applied clang format.

Signed-off-by: Michael West <michael.west@ettus.com>
2020-04-30 15:14:28 -05:00
Martin Braun
261ee6d677 examples: Add --power command line option to tx_waveforms
If you run

    tx_waveforms --power -20 [other args]

it will try to set the out power to -20 dBm. The signal amplitude is
factored in, so changing --ampl will not change the actual TX power
unless it causes clipping, or becomes too low.

If the USRP does not support setting a power, the program will terminate
early. If it does support setting a power, but can't reach the requested
power, it will coerce, and print the actual, available power.
2020-04-17 07:59:50 -05:00
Martin Braun
d90e8a91fd examples: wavetable: Modify wave tables to ease power calculations
The existing implementation would create a real signal for any type of
signal (CONST, RAMP, SQUARE, and SINE), and then create the complex
signal by simply delaying the Q value by a 90 degree phase. This had
surprising results for all waveforms:
- CONST waveforms would have a baseband value of ampl + j ampl, thus
  increasing the output power by 3 dB vs. what one would expect when
  setting an amplitude. It is now ampl + j * 0, and the power is
  ampl**2. This now makes the power consistent with SINE, which it was
  not, even though a const signal is a sine signal with a frequency of
  zero.
- SQUARE waveforms would phase-delay the Q part, thus resulting in three
  power output levels (when both phases are zero, when both phases are
  ampl, and when one of them is zero and other is ampl). However, the
  square signal is useful for watching it in the scope, and there, it
  helps if the power is predictably either high or low within the
  selected frequency. The Q value is now always zero.
- RAMP waveforms had the same issue and were also resolved by setting
  Q to zero.
- SINE signals were fine, although the implementation used sin + j cos
  to calculate a complex sine, not cos + j sin according to Euler's
  formula.

To make this wavetable more useful with absolute power settings, the
changes mentioned above were implemented. The dBFs power of CONST and
SINE can now be calculated by using ampl**2, SQUARE by using
(ampl**2)/2, and RAMP by solving the integral over a ramp from -1 to 1.
2020-04-15 07:44:19 -05:00
Aaron Rossetto
f894cf0c0d examples: Change benchmark_rate default thread priority
This commit modifies the benchmark_rate example to use the operating
system's default thread priority, instead of real-time thread priority,
by default. UHD 4.0 includes a number of significant improvements to
the streaming architecture that allow for best performance to be
achieved without having to resort to elevating the process thread
priority to real-time. Internal testing shows degraded streaming
performance in common use cases (i.e. non-DPDK) when the process thread
priority is set to real-time.

It should be noted that applications which use DPDK may still experience
better performance when the process thread priority is set to real-time.
Users may continue to manually override the process thread priority
in benchmark_rate using the --priority=high command-line option. The
need to elevate the process thread priority will be application- and
deployment-dependent.
2020-03-27 16:02:20 -05:00
Wade Fife
bb6293bc60 examples: Update gain block testbench to use samples 2020-03-09 13:43:05 -05:00
Wade Fife
fc895feacb sim: Parameterize chdr_word_t data type
This replaces chdr_word_t, which was a statically defined 64-bit data
type, with a paramaterizable data type that matches the defined CHDR_W.
Code that formerly referenced the chdr_word_t data type can now define
the data type for their desired CHDR_W and ITEM_W as follows:

  // Define the CHDR word and item/sample data types
  typedef ChdrData #(CHDR_W, ITEM_W)::chdr_word_t chdr_word_t;
  typedef ChdrData #(CHDR_W, ITEM_W)::item_t      item_t;

ITEM_W is optional when defining chdr_word_t if items are not
needed. Static methods in the ChdrData class also provide the ability to
convert between CHDR words and data items. For example:

  // Convert CHDR data buffer to a buffer of samples
  samples = ChdrData#(CHDR_W, ITEM_W)::chdr_to_item(data);
2020-03-09 13:43:05 -05:00
Martin Braun
876d4150aa uhd: Apply clang-format against all .cpp and .hpp files in host/
Note: template_lvbitx.{cpp,hpp} need to be excluded from the list of
files that clang-format gets applied against.
2020-03-03 08:51:32 -06:00
steviez
ed72347d53 examples: Wrap get_gpio_src() with try/catch block
Non-RFNoC devices do not support get_gpio_src() entrypoing so wrap call
with a try/catch block
2020-02-19 16:00:46 -06:00
eklai
d7304cc724 x300: add front-panel GPIO source control
Adds a ZPU register to control the FP GPIO source. These are 2bits
per GPIO pin, totalling 24 bits. 0 corresponds to RF-A, 1 corresponds
to RF-B. The following Python code will control the upper 6 bits of the
front-panel GPIO from the B-side radio on an X300:

>>> import uhd
>>> U = uhd.usrp.MultiUSRP("type=x300")
>>> U.get_gpio_src_banks()
['FP0']
>>> U.get_gpio_src("FP0")
['RFA', 'RFA', 'RFA', 'RFA', 'RFA', 'RFA', 'RFA', 'RFA', 'RFA', 'RFA',
'RFA', 'RFA']
>>> U.set_gpio_src("FP0", ['RFA', 'RFA', 'RFA', 'RFA', 'RFA', 'RFA',
                           'RFB', 'RFB', 'RFB', 'RFB', 'RFB', 'RFB'])
>>> U.get_gpio_src("FP0")
['RFA', 'RFA', 'RFA', 'RFA', 'RFA', 'RFA', 'RFB', 'RFB', 'RFB', 'RFB',
'RFB', 'RFB']
>>> # Make all GPIOs outputs:
>>> U.set_gpio_attr("FP0A", "DDR", 0xFFF)
>>> U.set_gpio_attr("FP0B", "DDR", 0xFFF)
>>> # Control all GPIOs from software (not ATR):
>>> U.set_gpio_attr("FP0A", "CTRL", 0x000)
>>> U.set_gpio_attr("FP0B", "CTRL", 0x000)
>>> # Bottom 3 pins go high from radio A
>>> U.set_gpio_attr("FP0A", "OUT", 0x007)
>>> # Top 3 pins go high from radio B
>>> U.set_gpio_attr("FP0B", "OUT", 0xE00)

Amends the gpio.cpp example to allow switching the source.

Co-authored-by: Brent Stapleton <brent.stapleton@ettus.com>
2020-02-18 07:21:24 -06:00
mattprost
8f4b21d6ec examples: benchmark_rate clean print out
Cleans up the print out for the benchmark rate example. Removes
race condition that would cause send and receive initialization
messages to interleave to stdout.
2020-02-04 13:24:40 -06:00
Ciro Nishiguchi
eb7949e2b3 examples: Fix tx timeout caused by initial delay
Using default values, the initial delay for tx is larger than the
default timeout of tx_streamer::send. Changing the example to always
specify a timeout in send.
2020-01-20 11:57:34 -08:00
Brent Stapleton
708840002e uhd: fixing MSVC warnings
Small changes to remove various compiler warnings found in MSVC
- Adding uhd::narrow_cast to verious spots
- wavetable.hpp: all floats literals in the wavetable.
- paths_test: unnecessary character escape
- replay example: remove unreferenced noc_id
- adfXXXX: Fixing qualifiers to match between parent and derived
  classes
- rpc, block_id: Removing unused name in try...catch
2020-01-09 09:18:25 -08:00
Michael West
db4e383377 examples: Add options to benchmark_rate
- Add option for high or normal thread priority with default set to high
- Add rx_delay and tx_delay options to dynamically set start delays
  (default of 0.25 seconds for TX and 0.05 seconds for RX)

Signed-off-by: Michael West <michael.west@ettus.com>
2020-01-02 13:50:15 -08:00
mattprost
f69f069b18 examples: benchmark_rate dpdk recv/send thread priority elevation
Improves dpdk streaming performance for benchmark_rate by elevating
thread priority of the send and recv threads. It does this
conditionally, if use_dpdk=1 was passed in through the command line
args. Admittedly, this is not a perfect solution, as it does not
account for the case when a dpdk user is utilizing a config file to
pass in that information. The scope of this fix does seem
appropriate for an example.
2019-12-20 16:32:22 -08:00
Martin Braun
91f8a9b8b2 examples: gpio: Replace get_time_now() with steady_clock::now()
The gpio example would continously call get_time_now() to time a loop.
There is no need to query a device here, so we query the system timer
instead.

This fixes an issue where the large amounts of control traffic could
slow down TX, causing the TX and FDX tests to fail. This was only ever
seen on the X300_HG over 1GigE.
2019-11-26 12:21:34 -08:00
Martin Braun
9742e8ede5 examples: gpio: Fix minor issues
- Use GPIO_BIT(x) instead of 1<<x where appropriate
- Correctly use rx_buff/tx_buff in recv/send, respectively
2019-11-26 12:21:34 -08:00
Martin Braun
113b3262d3 examples: benchmark_rate.py: Add ?x_stream_args args
This allows adding stream args to the Python version of benchmark_rate
in the same way as for the C++ version, e.g.:

python3 ./benchmark_rate.py \
    --args addr=192.168.40.2,num_poll_offload_threads=4 \
    --rx_stream_args \
        recv_offload=1,num_recv_frames=32,recv_offload_wait_mode=poll \
    --tx_stream_args \
        send_offload=1,num_send_frames=32,send_offload_wait_mode=poll \
    [... other arguments ...]
2019-11-26 12:21:33 -08:00
Martin Braun
59a4360384 examples: gpio: Add note on which bank is being used
This will print the currently-used GPIO bank's name before starting the
test.
2019-11-26 12:21:33 -08:00
Martin Braun
c8950c1e0b examples: Send only single packets in test_messages
For the burst ACK test, test_messages would send 3 packets. However,
that assumes that the underlying link is fast enough to send three
packets in time, and some devices are hard to operate without underruns
without also specifying a start-of burst timestamp. Often, test_messages
would report that no ACK was received, but instead, an underrun was
received.

test_messages also doesn't need to send three packets. The three packets
came from the "start of burst" flag, which no device in UHD supports.

The change is thus to send a single packet with an EOB marker for the
burst ACK test. This will work regardless of the link speed and CPU
power.
2019-11-26 12:21:33 -08:00
Wade Fife
74b0352c4a examples: Update x310_rfnoc_image_core.yml example 2019-11-26 12:21:33 -08:00
Martin Braun
77cb9836ab examples: gpio: Add --list-banks option
The gpio example can now list all available banks before running tests.
Use like this:

    gpio --args $args --list-banks
2019-11-26 12:21:33 -08:00
Martin Braun
8fb790c8c3 examples: benchmark_rate: Add --rx_spp and --tx_spp
These command line arguments control the spp values used for streaming.
2019-11-26 12:21:33 -08:00
Sugandha Gupta
a801d6b046 examples: Add example out-of-tree module for RFNoC modules
This subdirectory is its own, self-contained project. It is supposed to
work against the UHD version it is shipped with.

Co-Authored-By: Martin Braun <martin.braun@ettus.com>
Co-Authored-By: Wade Fife <wade.fife@ni.com>
2019-11-26 12:21:32 -08:00
Martin Braun
d3a16b7022 uhd: Replace all occurrences of boost::bind with std::bind
Note: Replacing everything with a lambda would be even better, but that
can't be easily scripted so we'll do this as a first step to reduce the
Boost footprint.

This also removes occurences of #include <boost/bind.hpp>, and makes
sure all usages of std::bind have an #include <functional>. clang-format
wasn't always applied to minimize the changeset in this commit, however,
it was applied to the blocks of #includes.

Due to conflicts with other Boost libraries, the placeholders _1, _2,
etc. could not be directly used, but had to be explicitly called out
(as std::placeholders::_1, etc.). This makes the use of std::bind even
uglier, which serves as another reminder that using std::bind (and even
more so, boost::bind) should be avoided.

nirio/rpc/rpc_client.cpp still contains a reference to boost::bind. It
was not possible to remove it by simply doing a search and replace, so
it will be removed in a separate commit.
2019-11-26 12:21:32 -08:00
Brent Stapleton
dc698b990d examples: updating radio loopback
Modified to run with the new RFNoC API.
2019-11-26 12:21:32 -08:00
Martin Braun
32f0e96d8c examples: benchmark_rate: Remove usage of boost::posix_time
Replace with std::chrono functions instead, in our effort to reduce
Boost footprint.
2019-11-26 12:21:32 -08:00
Aaron Rossetto
7bf6ddcb95 examples: Add Rx/Tx stream args parameters to benchmark_rate 2019-11-26 12:21:32 -08:00
Martin Braun
fcc2e9c602 uhd: Replace boost::function with std::function
This is mostly a search-and-replace operation, with few exceptions:
- boost::function has a clear() method. In C++11, this is achieved by
  assigning nullptr to the std::function object.
- The empty() method is replaced by std::function's bool() operator
2019-11-26 12:21:32 -08:00
Martin Braun
0c43030e71 uhd: Replace BOOST_FOREACH(v, c) with for(v : c)
Also removes all references to boost/foreach.hpp. BOOST_FOREACH is no
longer necessary since all headers require C++11 anyway.
2019-11-26 12:21:32 -08:00
Martin Braun
1fe98e8701 uhd: Replace usage of boost smart pointers with C++11 counterparts
This removes the following Boost constructs:
- boost::shared_ptr, boost::weak_ptr
- boost::enable_shared_from_this
- boost::static_pointer_cast, boost::dynamic_pointer_cast

The appropriate includes were also removed. All C++11 versions of these
require #include <memory>.
Note that the stdlib and Boost versions have the exact same syntax, they
only differ in the namespace (boost vs. std). The modifications were all
done using sed, with the exception of boost::scoped_ptr, which was
replaced by std::unique_ptr.

References to boost::smart_ptr were also removed.

boost::intrusive_ptr is not removed in this commit, since it does not
have a 1:1 mapping to a C++11 construct.
2019-11-26 12:21:32 -08:00
Martin Braun
7d69dcdcc3 Remove proto-RFNoC files
This commit removes all files and parts of files that are used by
proto-RFNoC only.

uhd: Fix include CMakeLists.txt, add missing files
2019-11-26 12:16:25 -08:00
Brent Stapleton
9d27486550 rfnoc: examples: Porting examples to new RFNoC
rfnoc_nullsource_ce_rx, rfnoc_rx_to_file:

These examples are modified so they can be run with the new RFNoC API.

test_messages:

Fixes failures in the time test when it is executed immediately after an
underrun test. The DUC considers time specs on a per burst basis, so
when the underrun test leaves a burst unfinished, a time spec on the
next burst is ignored.
2019-11-26 12:16:25 -08:00
Martin Braun
2ed94af772 uhd: Remove deprecated objects and methods
This removes the following symbols:
- otw_type_t
- clock_config_t
- Any functions that use those symbols
- Non-standard args from examples (e.g., --total-time is deprecated in
  favour of --duration)
2019-11-26 11:49:08 -08:00
Martin Braun
9b0702c546 cmake: Bump dependency versions for UHD 4.0.0.0
- Boost >= 1.58
- CMake >= 3.5.1
- gcc >= 5.4.0
- Clang >= 3.8, AppleClang >= 600
- Python >= 3.5 (Py2k no longer supported)
- Numpy >= 1.11
- C++14 for lib, include may now use C++11 constructs.
  - Because there is no more code requiring C++03 syntax, we remove the
    include-specific clang-format file
2019-11-26 11:49:08 -08:00
natetemple
d3e1d6e9be Examples: wrap up ref setting with option check 2019-11-24 16:56:27 -08:00
natetemple
0e184f7185 Examples: Set refs in RFNoC examples 2019-11-24 16:55:27 -08:00
natetemple
1996adfc49 Examples: tx_bursts add subdev, ref, lo-offset, bw options 2019-11-22 20:38:27 -08:00
Martin Braun
8688b1e645 examples: test_pps_input: Also test for ref_locked on E31x
The E31x will always have a valid PPS, because it is generated
internally. The external PPS however is used to drive the ppsloop, which
means the ref_locked sensor can be a substitute for the PPS, but only on
in this case.

This commit also removes some superfluous includes from this example.
2019-11-21 15:02:03 -08:00
Ciro Nishiguchi
60a70f7142 examples: remove thread priority elevation
Remove UHD call to elevate thread priority to realtime. Setting all
threads to the same realtime priority can cause the threads to not share
access to the network interface fairly, which adversely affects
operation of the worker threads in UHD.
2019-10-22 16:18:46 -07:00
Michael Dickens
f520573c3d cmake: Use new UHDBoost.cmake in init_usrp and tools
Modifies the CMake for the following utilities:
- init_usrp (example)
- kitchen_sink
- nirio_programmer
2019-10-15 11:44:38 -07:00
Alex Williams
12a0656c65 examples: Add mode to remove latency of RX samples in latency_test
The timestamp from the streamer corresponds to the first sample, but
a better indicator of transport latency will use the time of the last
RX sample. Otherwise, nsamps will reduce the timing budget to send the
TX samples. Include this mode to allow latency_test to have a version
where there is largely no dependence amongst the variables.
2019-10-07 14:00:48 -07:00
Martin Braun
22b9593dce examples: Add replay example to CMake 2019-09-20 16:33:30 -05:00
Brent Stapleton
37c2463798 examples: bmark_rate: fixup INIT_DELAY
Fixing accounting for INIT_DELAY in the stream duration
2019-09-04 09:16:12 -07:00
Brent Stapleton
7d2ba938a7 python: Fixup bmark_rate printed statistics
- When printing statistics, the number of TX and RX timeouts were mixed
up.
- Fixing main() docstring

Fixes e735a63ff9 ("python: Adding Python API benchmark rate")
2019-08-21 16:36:37 -07:00
Brent Stapleton
431deb855b uhd: mpm: update all license header w/ "-or-later"
Updating all SPDX license identifiers to include "-or-later"
2019-03-08 00:43:07 +01:00
Moritz Fischer
5f10611c16 examples: tx_samples_c: Fix memory leak
Fix memory leak: 'buff' was never freed.

While we're at it replace the kludgy malloc(n*y*sizeof(float))
by calloc(sizeof(float), n*y).

Signed-off-by: Moritz Fischer <moritz.fischer@ettus.com>
2019-02-15 11:37:03 -08:00
Moritz Fischer
0f6ef4bf6e examples: benchmark_rate: Remove dead store to is_locked
Remove dead store to is_locked. The variable isn't read before
being overwritten, so the extra store is useless.

Signed-off-by: Moritz Fischer <moritz.fischer@ettus.com>
2019-02-15 11:37:03 -08:00
Martin Braun
33233e5c77 examples: Fix boundary condition in ascii_art_dft plotting
There was a corner case where the data could be such that the FFT plot
symbol selection would cause an out-of-bounds access on the symbols
table, and abort the example with an uncaught exception.
2019-01-21 18:13:33 -08:00
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
aafe4e8b74 ascii_art_dft: move example within include guard
Moving the example `main` within the include guards for the file. This
is mostly to help clang-format's include guard detection.
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
Derek Kozel
8027df7a22 examples: Improved error message in tx_waveforms
Non-CONST type waveforms require a non-zero wave freq
2019-01-14 10:24:08 -08:00
natetemple
a476cba5f5 Examples: Add lo-offset to tx_waveforms 2019-01-10 09:47:33 -08:00
natetemple
b5e80dfb2a Examples: update lo-offset naming in tx from file
Update tx_samples_from_file lo-offset naming convention
2019-01-10 09:47:33 -08:00
natetemple
75ea705378 Examples: Add LO Offset to rx_samples_to_file 2019-01-10 09:47:33 -08:00
mguyler-ni
b13a99e45f examples: change boost to std for time commands
- examples affected: rfnoc_rx_to_file
 - fixes UHD build error with Boost 1.67: boost::posix_time::seconds no
longer supports double argument as of version 1.67
2019-01-08 14:14:03 -08:00
Brent Stapleton
aa1ec63537 examples: optimize tx_waveforms memory allocations
Move filling the TX buffer outside the critical path. Now, we pre-fill
the TX buffer before entering the send loop (and before setting the
TX stream time), and fill the TX buffer after calling send() (for the
next iteration).
2019-01-03 09:20:18 -08:00
Brent Stapleton
7d34f4d2c8 examples: formatting in tx_waveforms
- Format `if` statements to multiple lines
- Add quick comment on the exit checks
2019-01-03 09:20:18 -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
Ciro Nishiguchi
9bb3616af7 uhd: Add benchmark_streamer support for multi-channel streamer
Add support for benchmarking multi-channel streamers. This also
simplifies the way the test parameters are specified to avoid confusion
due to the additional dimension. For rx, multi-channel streamer
configurations require split_stream noc blocks so that timestamps of
packets in the same streamer align. Add support for loopback FIFOs.
2018-12-17 16:39:53 -08:00
Rakesh Peter
11bbc3c0c2 examples: Add keyboard controls to rx_ascii_art_dft
- Add keyboard controls for sample rate, gain, analog bandwidth,
frequency, as well as the display's dynamic range, reference level,
and frame rate.
- The current values for these properties, as well as the keys to
control them, are displayed in a small window at the top of the
display. This control window can be toggled by pressing 'c'
2018-12-17 15:19:35 -08:00
Martin Braun
1467e88d19 examples: rfnoc_radio_loopback: Clean up example
- Remove unnecessary Boostisms
- Remove unecessary thread priority (this example doesn't actually do
  anything that requires high thread priority)
- Used auto in some places to increase readability
- Fixed some compiler warnings

No functional changes.
2018-12-03 11:01:09 -08:00
Wade Fife
84018da8b5 rfnoc: Add halt to replay API
The HALT feature allows a command that takes a long time to run to be
stopped while it is in progress.
2018-11-27 16:58:50 -08:00
Wade Fife
85665ac5a7 RFNoC: Fix replay example port args 2018-11-27 16:58:50 -08:00
Mark Meserve
4ecb817f2c uhd: fix rx antenna not being applied in txrx example 2018-11-16 16:41:59 -08:00
Martin Braun
a69ab0c23a cmake: Update coding style to use lowercase commands
Also updates our coding style file.

Ancient CMake versions required upper-case commands.  Later command
names became case-insensitive.  Now the preferred style is lower-case.

Run the following shell code (with GNU compliant sed):

cmake --help-command-list | grep -v "cmake version" | while read c; do
  echo 's/\b'"$(echo $c | tr '[:lower:]' '[:upper:]')"'\(\s*\)(/'"$c"'\1(/g'
done > convert.sed \
&& git ls-files -z -- bootstrap '*.cmake' '*.cmake.in' \
'*CMakeLists.txt' | xargs -0 gsed -i -f convert.sed && rm convert.sed

(Make sure the backslashes don't get mangled!)
2018-11-14 14:10:09 -08:00
Ciro Nishiguchi
09136828d4 uhd: Changes to traffic counter register names
This makes the noc traffic counter register actually reflect the
registers in the FPGA. The FPGA register names were changed prior to
merging to master, and the ready count registers were removed.
2018-10-31 15:21:16 -07:00
Ciro Nishiguchi
cb0a07aa04 uhd: Add dual measurements to benchmark_streamer
Add options to run benchmark_streamer with multiple streamers running
concurrently on separate threads.
2018-10-18 09:57:04 -07: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
Ciro Nishiguchi
3fd10e971a uhd: Add benchmark_streamer example 2018-10-11 13:16:22 -07:00
Trung Tran
6af6ac32c3 examples: add rfnoc_radio_loopback
This example will allow an RF->RF loopback using RFNoC devices.
2018-09-14 22:15:56 -07:00
Brent Stapleton
680855e85a python: Fix duration of benchmark rate
Duration of multichannel benchmark was 50 seconds longer than
intended- a 50ms initialization delay was mistakenly multiplied by
1000.

Fixes e735a63ff9 ("python: Adding Python API benchmark rate")
2018-09-12 09:59:55 -07:00
Michael West
3f39388059 Examples: Fix channel argument for rx_samples_to_file 2018-08-29 15:50:49 -07:00
Wade Fife
bed75f0ccb RFNoC: Add Replay API and example 2018-08-29 15:45:55 -07:00
Martin Braun
8e3ea14c94 uhd: Remove usage of time_t (except when required)
The C/C++ standards don't define what time_t is, only that it is
arithmetic (and real for C11, and integral for C++). It should not be
used in portable software and is only used as the return value for some
libc calls.
A common definition for time_t is int64_t, so we'll switch to that
permanently in our own APIs. System APIs will of course stick with
time_t.
2018-08-20 16:56:43 -07:00
Martin Braun
1f9a58cd0a rfnoc: examples: Removed some legacy code patterns from RFNoC examples
- Unnecessary use of Boost
- Use of thread_priority.hpp
2018-08-02 16:51:59 -07:00
Martin Braun
cb690f0a88 UHD: Added RFNoC examples 2018-06-22 09:11:23 -07:00
Brent Stapleton
e735a63ff9 python: Adding Python API benchmark rate
Python API version of the benchmark rate utility.
2018-06-20 19:02:32 -05:00
Paul David
a603c97d06 python: Added curses frequency plot example 2018-06-20 19:02:32 -05:00
Paul David
e74cf7635b python: Separating exposed Python data structures
- Separating exposed Python data structures into logical sections
- Exposes all of the multi_usrp API
- Adds a layer of Python for documentation and adding helper methods
- Adds improvements and fixes to the MultiUSRP object
- Includes additional exposed data structures (like time_spec_t, etc.)
- Add code to release the Python GIL during long C++ calls
2018-06-20 19:02:32 -05:00
Andrej Rode
22e24497a5 python: Initial commit of Python API
Initial commit of the Python API using Boost.Python. Bind the
MultiUSRP API for use in Python. Bindings intended to provide as
complete coverage as possible.
- Wrap most multi_usrp calls
- Adding multi channel send/recv examples in examples/python
- Adding setuptools support
- Initial attempt at binding the UHD types and filters
2018-06-20 19:02:32 -05:00
Sugandha Gupta
c661c352ca examples: Select subdev spec before setting channels 2018-06-12 06:48:59 -07:00
Martin Braun
36be5216c2 examples: Remove use of boost::posix_time from rx_ascii_art_dft 2018-05-09 16:46:38 -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
0303f1ed55 lib: Purge all references to boost::this_thread::sleep()
Replace with std::this_thread::sleep_for().
2018-04-30 17:10:26 -07:00
Martin Braun
566c57e2ac examples: De-boostify rx_samples_to_file
Removes boost::bind and all Boost time types from this example.
Re-enables compatibility with Boost 1.67.
2018-04-18 15:47:06 -07:00
Martin Braun
0e909a2a9d examples: Remove superfluous sleep 2018-04-18 10:11:06 -07:00
Daniel Jepson
0bcae6cb16 uhd: update settling time to double in txrx_loopback_to_file example 2018-04-10 09:58:34 -07:00
Daniel Jepson
dce94c60f7 uhd: increase tx buffer fill time for txrx_loopback_to_file example
The previous 0.1s fill time occasionally prevented rx from starting on time when
settling is set to the same 0.1s time. It was increased to 0.5s.
2018-04-10 09:58:34 -07:00
Daniel Jepson
c75edc1d48 uhd: fix subdevice selection order in txrx_loopback_to_file example 2018-04-10 09:58:34 -07:00
Martin Braun
bc615618b3 example: Refactor gpio.cpp
Minor changes:
- Remove some Boost usage
- Minor formatting changes
2018-03-30 12:44:25 -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
7fa1f6ed07 uhd: Moved get_system_time outside of public API
uhd::get_system_time() is an abstracted way of reading back a time, and
is not UHD-specific. As such, there's no reason to keep it in the public
part of the API where we're contractually obligated not to touch it.
Instead, moving it to the internal API space.
2018-03-05 13:53:45 -08: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
Marcus Müller
1651444b27 examples: replace boost::format%(a,b) by (boost::format%a%b)
The former compiles to evaluating `a`, then throwing away the result,
evaluating `b`, then using that to fill in the first placeholder in
`format`. And that is wrong.

Pointed to this by Clang++'s "unused result" warning.
2018-02-19 14:23:47 -08:00
Martin Braun
eaed9d5ac5 examples: Fix bandwidth unit (MHz vs. Hz) in tx_samples_from_file 2018-01-15 09:56:32 -08:00
Martin Braun
b3e0f60a7b examples: Add example to query and list all sensors
Reviewed-by: Brent Stapleton <brent.stapleton@ettus.com>
2018-01-12 16:18:01 -08:00
Martin Braun
4f948e2c8b Move all license headers to SPDX format. 2017-12-22 10:45:51 -08:00
ilovezfs
707db05b5a Fix build with Boost 1.66
Thanks to FX Coudert for suggesting this fix.
2017-12-19 09:17:19 -08:00
Martin Braun
3d5176874f Merge branch 'maint' 2017-07-17 18:44:48 -07:00
Martin Braun
49d3d20e0c examples: Improved output for latency_test 2017-06-30 12:03:35 -07:00
sugandhagupta
51aa599d0c examples/c-api: Fix invalid free of device_args
One does not simply free() stack / automatic variables.

Please `man 3 strdup()`.

Signed-off-by: Sugandha Gupta <sugandha.gupta@ettus.com>
Signed-off-by: Moritz Fischer <moritz.fischer@ettus.com>
2017-06-29 19:33:45 -07: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
644c03269c Merge branch 'maint' 2017-06-02 16:25:31 -07:00
Ashish Chaudhari
4fc9efd1f5 examples: Added channel param for samps to/from file example
- Also, fixed an issue with the --repeat option in tx_samples_from_file
2017-05-24 10:22:33 -07:00
natetemple
4152b42fbc Examples: Fix ascii typos 2017-05-20 22:02:04 -07:00
Martin Braun
82f0d5a6d2 examples: Added real streaming modes 2017-05-15 13:55:47 -07:00
Martin Braun
c3beb6d1ec Merge branch 'maint' 2017-05-03 15:59:47 -07:00
Andrej Rode
a96fdcfe27 examples: fix device_args parsing in tx_samples_c 2017-04-25 17:15:13 -07:00
Andrej Rode
d2a354bbe4 uhd: cast thread_group.create_thread() return value to void to avoid memory leak 2017-04-25 17:15:13 -07:00
Martin Braun
2790b51f30 Merge branch 'maint' 2017-04-13 15:33:03 -07:00
Andrej Rode
ce14b64054 examples: use next_pps in test_clock_synch 2017-04-12 12:14:47 -07:00
Martin Braun
f3cabe9ffd Merge branch 'maint' 2017-03-24 19:06:32 -07:00
Logan Fagg
7549513893 examples: Revised frequency hopping example for best practices 2017-03-21 18:01:16 -07:00
nate.temple
a59643f73c examples: Created TwinRX frequency hopping example 2017-03-21 18:01:16 -07:00
Martin Braun
da26a3e34e Merge branch 'maint' 2017-03-01 16:39:08 -08:00
Martin Braun
888e224e40 examples: Replaced throw with exit() in sync_to_gps 2017-02-27 17:04:50 -08:00
Martin Braun
e2e0aab185 examples: Added some more error strings to test_messages 2017-02-27 15:04:29 -08:00
Andrej Rode
26cc20847c uhd: replace BOOST_FOREACH with C++11 range-based for loop
Note: This is the first commit that uses for-range, and range-based
for-loops are now usable for UHD development.
2017-02-10 16:44:33 -08:00
Andrej Rode
f3a004faf7 init_usrp: add c++11 flags to compiler if available 2017-02-10 16:44:12 -08:00
Paul David
8b6680bc52 examples: Fix and cleanup test messages 2017-02-07 18:09:24 -08:00
michael-west
548e14cfd6 GPIO: Set CTRL register before OUT register in GPIO example. 2016-12-09 17:22:16 -08:00
Martin Braun
cc6087f452 fixup! Remove all boost:: namespace prefix for uint32_t, int32_t etc. (fixed-width types)
Now also removes the namespaces in examples/
2016-11-15 16:31:18 -08:00
Martin Braun
99c2730bc9 Remove all boost:: namespace prefix for uint32_t, int32_t etc. (fixed-width types)
- Also removes all references to boost/cstdint.hpp and replaces it with
  stdint.h (The 'correct' replacement would be <cstdint>, but not all of our
  compilers support that).
2016-11-08 08:02:22 -08:00
Philip Balister
11bdf9e8a5 Fix warning in rx_samples_c.c.
time_t is not guaranteed to be printable as in int type. Use
difftime to portably convert time_t to float and print result.

Signed-off-by: Philip Balister <philip@opensdr.com>
2016-10-13 17:34:40 -07:00
Philip Balister
b33ff03050 Fix warning in tx_samples_c.c.
Function needs pointer to size_t type. I suspect using uint64_t could
lead to trouble on a 32 bit machine.

Signed-off-by: Philip Balister <philip@opensdr.com>
2016-10-13 17:34:34 -07:00
Martin Braun
92cc4d83df examples: Fixed test_messages 2016-09-28 10:20:04 -07:00
Martin Braun
39888bb340 examples: Fixed check for setting time on PPS vs. now 2016-09-28 09:49:53 -07:00
Martin Braun
83912104a9 Merge branch 'UHD-3.9.LTS' into maint
This provides the GPS fixes.

Conflicts:
	host/CMakeLists.txt
	tools/debs/upload_debs.sh
2016-09-02 11:27:37 -07:00
michael-west
065065e90c Add example to synchronize USRPs to GPS time 2016-09-02 11:10:46 -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
62898fc131 examples: tx_waveforms was always checking lo_lock on channel 0, regardless of channel used 2016-08-11 09:59:24 -07:00
Martin Braun
0c454df028 Merge branch 'maint' 2016-08-03 16:49:58 -07:00
Martin Braun
c10c9d515d examples: test_dboard_coercion did not check the correct LO lock sensors for RX 2016-08-03 16:49: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
michael-west
7dd34d09d9 examples: tx_bursts fixes
- Wait for ACKs for all channels
- Put EOB on last data packet instead of empty packet
- Exit with failure when send times out and SIGINT has been received
2016-08-02 17:35:48 -07:00
Nicolas Cuervo
b448bb331a cmake: Fix compatibility with new versioning scheme
- Fixes init_usrp
2016-08-01 18:39:54 -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