Commit Graph

15 Commits

Author SHA1 Message Date
Andre Zoch
fbc5ad9eb0 example: cpp: Enhanced documentation for rfnoc_* examples
- Added program documentation string.
- Marked required options as required().
- Added short option strings for required options.
- Made individual option descriptions more descriptive.
- Harmonized naming of options where appropriate.
  Introduced alias options for renamed options to keep
  backward compatibility.
2025-11-18 13:26:26 +01:00
Martin Anderseck
787e1422b8 examples: rfnoc: Add Tune Requests to examples
Changed rfnoc_replay_samples_from_file and rfnoc_rx_to_file examples to
demonstrate the use of tune requests in RFNoC blocks.

Co-authored-by: Riya Alias <riya.alias@ni.com>
2024-11-06 14:40:07 +01: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
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
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
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
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
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
natetemple
0e184f7185 Examples: Set refs in RFNoC examples 2019-11-24 16:55:27 -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
Brent Stapleton
967be2a4e8 uhd: mpm: apply clang-format to all files
Applying formatting changes to all .cpp and .hpp files in the following
directories:
```
find host/examples/ -iname *.hpp -o -iname *.cpp | \
    xargs clang-format -i -style=file
find host/tests/ -iname *.hpp -o -iname *.cpp | \
    xargs clang-format -i -style=file
find host/lib/usrp/dboard/neon/ -iname *.hpp -o -iname *.cpp | \
    xargs clang-format -i -style=file
find host/lib/usrp/dboard/magnesium/ -iname *.hpp -o -iname *.cpp | \
    xargs clang-format -i -style=file
find host/lib/usrp/device3/ -iname *.hpp -o -iname *.cpp | \
    xargs clang-format -i -style=file
find host/lib/usrp/mpmd/ -iname *.hpp -o -iname *.cpp | \
    xargs clang-format -i -style=file
find host/lib/usrp/x300/ -iname *.hpp -o -iname *.cpp | \
    xargs clang-format -i -style=file
find host/utils/ -iname *.hpp -o -iname *.cpp | \
    xargs clang-format -i -style=file
find mpm/ -iname *.hpp -o -iname *.cpp | \
    xargs clang-format -i -style=file
```

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

Formatting style was designated by the .clang-format file.
2019-01-16 11:40:23 -08:00
Brent Stapleton
601e0ed87b examples: utils: skip formatting program options
Turning off clang formatting around the program option declarations.
clang-format makes them looks bad an unreadable because it thinks the
options are function calls or something.
2019-01-16 11:40:23 -08:00
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
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