Commit Graph

615 Commits

Author SHA1 Message Date
Martin Braun
563600521e examples: rfnoc-gain: Add gain property
With this change, the gain value can also be changed through the
property API.
2024-09-02 08:22:58 +02:00
Martin Braun
9f3b9e0282 examples: Overhaul RFNoC OOT example directory structure
- Renamed rfnoc-example to rfnoc-gain. This is because a) it's obvious
  that this is an example as it is located in host/examples, b) because
  we have sub-directories of this OOT that are called 'examples' (where
  we ship the OOT examples) so that got confusing and c) names of OOTs
  should declare what they do, and despite this being an example, it
  provides a gain block.
- Changed directory structure so that installation paths and in-repo
  paths match.
  - Block descriptor YAMLs are now in rfnoc/blocks/*.yml
  - HDL sources are in fpga/gain/rfnoc_block_gain
- Improved top-level README
- Added an example for DTS files
- Updated gain.yml to use new features (checks, specifying fpga_includes,
  specifying DTS)
2024-09-02 08:22:58 +02:00
Martin Braun
38b89ae965 cmake: Make UHDPython.cmake available to OOTs
This installs UHDPython.cmake to lib/uhd/, so that OOT RFNoC modules can
use it (and don't have to use a version that ships with the OOT). This
makes maintanance of that file a lot easier.

Now that this file can (and should) be used outside of UHD, we
"namespace" the macros and functions by prefacing them with 'UHD_'
(e.g., there's now UHD_PYTHON_CHECK_MODULE).

This file requires creating UHDMinDepVersions.cmake, which also gets
installed.
2024-09-02 08:22:58 +02:00
Grant Meyerhoff
56978cc8b9 examples: use coerced bandwidth for display 2024-08-13 11:18:50 +02:00
Martin Braun
4565e3f3ec rfnoc-example: Modify default build paths
- This change requires UHD 4.7, but since we ship the example together
  with UHD, we simply change that to match the UHD version
- Bitfiles now get put into the build/ directory. All other FPGA build
  artifacts get put into subdirs under build/. All assuming bitfiles are
  built using 'make'.
- The X310 example image core is adapted to not produce warnings about
  unconnected ports, same as within UHD (these warnings are new starting
  with UHD 4.7).
2024-07-09 08:28:06 +02:00
Martin Braun
f646ff838b examples: Move setup time in tx_waveforms after tuning
This avoids potential LO-lock-detect failures.
2024-06-28 13:16:32 +02:00
Lars Amsel
4289cc1eef examples: Don't do timed commands for X410 in tx_waveform examples
X410 cannot reliably tune using timed command. Therefore explicitly
disable that in TX examples for X410.
2024-06-26 14:49:20 +02:00
Lars Amsel
3a6d4ef1d7 host: remove superfluous usage of const in return values
Returning a const value does not ensure value constness. Instead,
it prevent move semantics (see C++ core guidelines F.49).
2024-06-25 16:59:56 +02:00
Martin Braun
d3b034911f examples: Consistently comment out sections in rx_samples_to_file
This example had some sections commented out using `#ifdef __linux__`,
but not consistently. This enables or disables all relevant code, which
reduces warnings on non-Linux systems.
2024-06-25 16:57:59 +02:00
Marian Koop
675ab7c824 example: python: Make use of timespec consistent in MultiUSRP and RFNoC use cases
Created new command argument to specify transmit delay, and utilize it in all
three code path (MultiUSRP, DRAM send, and DRAM upload + issue_stream_cmd.
For the first code path use of predefined transmit start time is new behavior,
and could also result into unexpected errors if the tx_delay is selected to small.
2024-06-11 10:20:08 +02:00
Sheikh Usman Ali
ad35a0f4eb example: cpp: Fix bug error lo_locked.to_bool()
Moved Code block section for clock sync setup block from later stage to
 earlier stage before check Ref and LO Lock detect block. Specifically
 moved `//clock sync setup is complete do timed tuning of LOs and NCOs`
 section.

This helped resolve the `Error: AssertionError: lo_locked.to_bool()`
2024-06-11 10:20:08 +02:00
Marian Koop
aedb8ac79f example: python: Changed setting frequency to use time commands
Modified example to support demonstratig the X440 phase repeatability
performance when using dram feature. Change is compatible with all supported
rfnoc devices that utilize the RFNoC Replay Block, but only improves
phase repeatability performance of X440.

Separated loops configuring radio properties and converted setting carrier
frequency into timed commands. This required moving this code to a later
part in the programming flow, after all the clock source settings are
applied and the LO locks are confirmed.
2024-06-11 10:20:08 +02:00
Marian Koop
de1542331f example: cpp: Changed setting frequency to use time commands
Modified example to support demonstratig the X440 phase repeatability
performance. Change is compatible with all supported devices, but only
improves phase repeatability performance of X440.

Separated loops configuring radio properties and converted setting carrier
frequency into timed commands. This required moving this code to a later
part in the programming flow, after all the clock source settings are
applied and the LO locks are confirmed.
2024-06-11 10:20:08 +02:00
Martin Braun
d8564b5a0a cmake: Fix Python path corruption from pybind11
The Pybind11 CMake package uses its own underlying Python-finding calls,
which in turn can corrupt the Python include directories. This will
prevent building MPM or UHD from within a USRP OpenEmbedded SDK.

This band-aid solution will quarantine the call to
`find_package(pybind11)` and then manually export the relevant variables.
A better solution would be to update CMake minimum version to 3.12, and
use `find_package(Python ...)` further up in the file, as laid out in
the pybind11 manual.
2024-05-16 14:47:30 -05:00
Martin Braun
23cb967a8e examples: Remove usage of boost::process:🧒:wait_for
This method is marked deprecated in the Boost source (not, however, in
the Boost documentation) with no clear substitute. In this particular
case (we are using (`dd` to measure disk speed when running Linux in
`rx_samples_to_file`) we simply replace `wait_for` with an unconditional
`sleep_for`.
2024-04-02 11:02:11 +02:00
Marian Koop
987f214c84 examples: Fix rx_gain_estimate_power
The --antenna option was previously unusable.
2024-04-02 11:01:15 +02:00
ahmed.salman
68eb97c44f examples: fix rx_samples_to_file fail for multichannel fullpath
Fix for the issue where the example rx_samples_to_file fails in the case
when samples from multiple channels are to be taken and a full path is
given for the data files to be stored.

The example source code used to put a channel number in front of the
filename which caused the code to not be able to find the path.

Now the channel number is added at the end of the filename and before the
extension if it exists in the file argument given by the user.
2024-03-06 08:11:41 +01:00
Martin Braun
6f892f797a examples: Add Python support to rfnoc-example
- Generate Pybind11 bindings for the C++ code
- Generate a Python module (rfnoc_example) that can be imported and used
- Add an example to show how the gain block affects dBFS readings
2024-02-28 09:38:28 -06:00
Martin Anderseck
94323947b8 examples: Amend rx_to_file.py to use DramReceiver
When calling rx_to_file.py with the --dram option, it will internally
use DramReceiver and buffer the signal into the DRAM before transferring
it to the host.
2024-02-27 11:29:00 -06:00
Marian Koop
bc97db2847 examples: Fixed bugs observing cmd argument -c in remote_rx.py example
Fixed bug that used hardcoded channel variable to configure
device (rate, freq, gain), but channel list from argument during
streaming configuration.
Fixed bug when specifying multiple channels with duration argument
that resulted into python syntax error.
Changed multi channel behavior to use unique streamer per channel,
which now requires specifying dest-port per channel. This approach
ensures receiver implementation can associate data with a usrp
channel.
2024-01-03 08:56:28 -06:00
Joel Keeling
e01adabf99 examples: Improve tx examples and fix some issues
- tx_waveforms fixes:
  - Fixed power bug. Changed loop style to 'for each' in order to avoid this
    issue in the future
- tx_samples_from_file:
  - Fixed bug where channels 1 and higher could not be configured correctly.
  - Added the 'power' argument.
  - Added support for multiple channels.
  - Re-added 'channel' argument for backwards compatibility.
  - Added additional error checking.
  - Changed help descriptions to match other example apps.
2023-12-04 11:41:46 -06:00
Martin Braun
13ef6264ef image builder: Remove superfluous entries from block YAMLs 2023-11-30 10:21:07 -06:00
Virendra Kakade
d6608fc4d0 fixup! examples: L band capture example using dual rate 2023-11-02 08:30:45 -05:00
Virendra Kakade
33a869892f examples: L band capture example using dual rate
This example demonstrates the simultaneous capture of the entire L-band
which extends from 1 GHz to 2.4 GHz using one channel on each of the two
radios using the dual rate feature. This is supported ionly on the X440 device.
Read the comments in the example for details.

Does the following:
- Sets up connections in rfnoc graph
- Configures radios and dual replay blocks
- Synchronously captures data and streams to replay block
- Fetches data to host and plots a windowed FFT.
- Repeat.

Signed-off-by: Virendra Kakade <virendra.kakade@ni.com>
Co-authored-by: Martin Anderseck <martin.anderseck@ni.com>
2023-10-27 15:43:18 -05:00
Aki Tomita
261f6ec1df tests: fix when the rx cmd's stream_now is set 2023-08-24 19:59:44 -05:00
Martin Braun
ebd5dd03cf Apply clang-formatting to all C/C++ files
- Used clang-format version 14
- Ran ./tools/clang-formatter.sh apply
2023-08-07 15:35:56 -05:00
Saarthak Mohan
cc36b4e35d examples: Add power controls to rx_ascii_art_dft.cpp 2023-07-11 11:46:08 -05:00
Martin Braun
51c1a74eee examples: Amend tx_waveforms.py to use DramTransmitter
When calling tx_waveforms.py with the --dram option, it will internally
use DramTransmitter and first upload the signal before transmitting it
from DRAM.
2023-07-07 12:35:55 -07:00
Martin Braun
e398d13d67 examples: Remove default --ref and --pps values
This changes the behaviour of the examples in a way that leaving
out the --ref argument will not force it to be 'internal'. Previously,
the following command:

    rx_samples_to_file --args type=xxx,clock_source=external

would still use the internal reference, because the default value for
--ref was internal, and no other value for --ref was provided. Even
worse, the following command:

    rx_samples_to_file --args \
        type=xxx,clock_source=external,time_source=external

might throw errors/warnings, because internal clock source plus external
time source is generally not supported, and the example would force the
clock source to be internal unless `--ref internal` was also provided.

For all cases that `clock_source` or `time_source` were not given as
a device argument, this is a no-op because `internal` is the default
value anyway.

In two examples, this includes minor code changes:
- In rfnoc_radio_loopback, if both --ref and --pps were given, we now
  use set_sync_source() to speed up setting the reference sources. On
  the N310/N300 series in particular, this saves a few seconds at
  initialization over the previous implementation (which set clock and
  time reference separately).
- In test_dboard_coercion, the code would fail without a default value
  for --ref, so we no longer require such a default value.
2023-05-19 08:52:20 -05:00
mkoop
9c2df8cc9a extension: windows: Fixed linking extension example to uhd.lib
Symtom to observed
Example of how to use a (new) feature/behavior
2023-03-30 08:00:47 -05:00
Wade Fife
02558b69f7 examples: Add throttle to replay_capture.py
Adds --throttle argument, which controls the playback rate to the host
and is set as a percentage of maximum stream endpoint throughput.

Also adds --no-progress to disable the TQDM progress bar and increases
the buffer size used with TQDM to avoid overusing the CPU during
playback to the host.
2023-03-13 17:51:17 -04:00
Virendra Kakade
a5bd377eca tests: benchmark_rate improvements
- Move default delay determination logic from the
  individual streamer functions to the main loop
  to ensure accurate run durations.
- Use a default delay in multi_streamer multi-channel
  configurations to ensure that all channel streamers
  are setup before streaming starts and thus prevent any
  errors during streamer setup.
- Fix some formatting errors and comments.

Signed-off-by: Virendra Kakade <virendra.kakade@ni.com>
2023-03-01 21:52:28 -05:00
Wade Fife
69b0989397 fpga: Update RFNoC YAML copyright 2023-02-22 21:55:02 -06:00
Wade Fife
d647481681 examples: Fix play region in replay_capture.py 2023-02-06 13:09:11 -06:00
Adam Vander Pas
0695a93077 examples: rx_samples_to_file: multi_streamer option
Add 'multi_streamer' command line parameter to enable
using a additional thread for each channel used in the
example run.
2023-02-02 14:50:03 -06:00
Adam Vander Pas
4d9b68aa6a examples: rx_samples_to_file: Add disk write speed check
Run 'dd' utility for 1 second to quickly benchmark the
write speed of the file location. A warning is then displayed
to the user if the rate/channel count/data type selection is
likely to cause overflows.
2022-12-13 13:03:07 -06:00
Adam Vander Pas
d91c86dd33 examples: rx_samples_to_file: Add multichannel option
This modifies the command line parameters of rx_samples_to_file to
allow setting multiple RF channels to recieve from.

Data recieved from each channel is saved in a different file using
ch0_<filename> prefixes.
2022-12-07 15:32:30 -06:00
Wade Fife
1e718d9be8 examples: Upgrade RFNoC example to Vivado 2021.1 2022-10-20 10:15:18 -05:00
Martin Braun
a835bb67bc examples: remote_rx: Add --mac-address argument
This allows manually overriding the MAC address for a target.
2022-09-23 13:01:58 -07:00
Martin Braun
4d6b7263f5 Revert "uhd: Revert Raw UDP Host Changes"
This reverts commit 6cb1dcca83.

Raw UDP support is added back in on both MPM and UHD side.
2022-09-21 15:35:55 -07:00
Steven Koo
6cb1dcca83 uhd: Revert Raw UDP Host Changes
This reverts the Raw UDP host changes which is breaking
multiple interface streaming.

Commits addb81aa5d2d6adcd3a0c7a8d59fcd96af0c1ec4^..b1ca51f97aaa2226ed6ef339fb26fbea54ab7593
are reverted.

Reverts:
doc: Update manual on streaming
examples: Add remote RX streaming example
rfnoc: Enable remote UDP streaming
mpm: e320: Enable raw UDP streaming
mpm: n3xx: Enable raw UDP streaming
mpm: x4xx: Enable transport manager adapter
mpm: Enable opt-in transport adapter control
rfnoc: Transition stream managers and mgmt_portal to topo_graph_t
rfnoc: Add topology graph object
uhd/mpm: Add API to set remote routes
mpm: xports: Add XportAdapterMgr class
2022-09-12 17:00:19 -05:00
Martin Braun
d31e4a4ffe examples: Add remote RX streaming example
Co-authored-by: Virendra Kakade <virendra.kakade@ni.com>
2022-08-30 13:43:36 -05:00
Martin Anderseck
4f993faf13 extension: Add extension example
Added example for extension framework which can be used as template for
own extensions.
2022-08-30 08:49:26 -05:00
Martin Anderseck
4789c32f40 extension: Add extension framework
This change adds the extension framwork that enables external libraries
to extend the UHD functionality in MultiUSRP and RFNoC. Its main purpose
is to be able to use external frontend modules, signal conditioning
modules etc. and to control them together with the USRP device. To make
it easier to install into the correct directory the UHD_MODULE_PATH gets
exported in CMake.
2022-08-30 08:49:26 -05:00
mattprost
94f78c50a0 examples: Enable radio loopback for a single radio
Utilize the skip_property_propagation option in the case of looping back
to a single radio block. Looping back to the same block causes a cycle
in the graph, which is not supported with property propagation. To work
around this, remove the forward property edge on the radio connection,
which breaks the cycle. The properties will then propagate forward once
through each block in the chain and then back.

Signed-off-by: mattprost <matt.prost@ni.com>
2022-08-22 18:06:52 -05:00
Wade Fife
4b03e237a9 fpga: Update makefiles to allow parallel FPGA builds
This adds the ability to do IP generation and FPGA builds using the
--jobs (-j) option with Make. For example, rather than generating each
IP one after another, you can generate up to N at a time using N Vivado
instances. This greatly reduces the IP generation time. Similarly,
parallel jobs can be used to easily build different FPGA variants
simultaneously.

Because FPGA builds can consume a lot of memory, care must be taken to
ensure that the number of jobs is not too high for the amount of memory
available.

New IP make targets were added for each USRP so that IP can be built
separately from the FPGA. The IP targets are now a dependency on each
FPGA target.

For example, you can generate the IP for X310 using 4 parallel jobs
using the following command:

  make -j4 X310_IP

Or, build two X310 bitstreams simultaneously:

  make -j2 X310_XG X310_HG
2022-08-16 10:16:22 -05:00
Yuki Kikuchi
bb0bda49d9 examples: rx_samples_c: Use error_code instead of return_code 2022-07-21 13:30:10 -05:00
Martin Anderseck
dd561fa124 spi: Replace old signal names with up to date ones
It's no use talking about racism and then continue using
terms like master and slave. The X400 SPI interface is still
pretty new, so without interfering with too much legacy we
should still be able to jump onto a new, better naming scheme
for the SPI signals. Following the Open Source Hardware
Association's Resolution to Redefine SPI Signal Names
<https://www.oshwa.org/a-resolution-to-redefine-spi-signal-names/>
we will use Controller and Peripheral, Serial Data Out
(SDO) and Serial Data In (SDI) and Chip Select (CS).
Leftovers like MISO and MOSI are legacy from long existing
APIs which cannot be changed easily without breaking user
applications.
2022-07-14 16:24:35 -05:00
Martin Braun
b7ed05f196 examples: Fix rfnoc_replay_samples_from_file
It was creating a TX streamer with zero channels.

Without this fix, you might see an error like this:

```
Error: AssertionError: channel < _mtu_out.size()
in connect_channel at
/path/to/uhd/host/lib/rfnoc/rfnoc_tx_streamer.cpp:127
```
2022-06-30 11:06:52 -07:00
mattprost
500b522390 examples: gpio: output before end of stream
The gpio values should be output before the stream ends. This matches
the behavior of other tests in this file and prevents strange logs for
passing tests.

Signed-off-by: mattprost <matt.prost@ni.com>
2022-06-13 12:03:43 -07:00
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