| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When connect_through_blocks() was called on blocks within a single
chain, there was a bug where the chain was incorrectly cropped. In
a standard FPGA image, say one was to use this API call to connect the
radio to the DDC. It would generate a chain of blocks hanging off the
radio as such:
Radio -> DDC -> SEP
What the code should do, and what this fix provides, is that the chain
gets cropped after the DDC, to look like this:
Radio -> DDC
With the current bug, it would assume the chain has a dangling edge, and
incorrectly throw an exception.
Note that this bug would not appear when source and destination block
are on separate chains (i.e., both have an SEP in their chain).
This patch includes minor logging and comment improvements around the
offending lines of code.
|
|
|
|
| |
Thanks to Mait for pointing these out!
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
| |
Some archs require linking against libatomic, others don't. We add some
CMake code that checks for libatomic.so requirement if:
- We are not on MSVC, AND
- Compiling std::atomics code would cause a linker error.
We then check for the existence of libatomic.so, and fail if we can't
find it.
|
|
|
|
|
| |
UHD requires Boost 1.65, so checks for Boost 1.61 will always be
satisfied.
|
|
|
|
|
|
|
|
| |
The Boost version is identical to the std:: version (which is available
since C++11) and thus is no longer needed.
Because of implicit includes, this breaks compilation in other parts.
Appropriate includes were added there also.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
| |
It could be possible that we only find one SEP connected edge, which
should be invalid.
|
|
|
|
|
|
|
|
|
|
|
| |
The conditional setting of some variables lead the compiler to assume
they might be used uninitialized. Circumventing compiler warning by
initializing variables to a default value, even if that's not the right
value (they will get set later).
Also applied clang-format to the same code section.
This fixes da1aeaeccc.
|
|
|
|
|
|
|
|
| |
Calling on connect with SEPs in the path is not supported. This change
enables connect_through_blocks to find SEPs in the connection chain
and link the src and dest blocks directly.
Signed-off-by: Steven Koo <steven.koo@ni.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit adds pybind11 glue code for the userland chdr parsing code
introduced in the uhd::utils::chdr namespace. Additionally, it moves
some pybind11 adapter code to a common pybind_adaptors.hpp file which
originally existed in the cal_python.hpp file.
This commit also adds unit tests for the python bindings using a
captured wireshark trace which is located in rfnoc_packets_*.py and some
handwritten packets in hardcoded_packets.py
Signed-off-by: Samuel O'Brien <sam.obrien@ni.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit introduces a new public api in uhd::utils which allows serializing
and deserializing chdr packets.
As far as testing, this commit adds the chdr_parse_test test. It uses a
wireshark trace located in rfnoc_packets_*.cpp as well as hand coded
packets from hardcoded_packets.cpp to test the serialization and
deserialization process
Signed-off-by: Samuel O'Brien <sam.obrien@ni.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
get_lib_path() uses the libuhd location on disk to dynamically
determine the installation prefix at runtime. This fix normalizes the
libuhd path before any path operations are done to extract the library
directory and then prefix directory.
Previously, using a non-normalized library path, the returned prefix
directory would be incorrect in some cases (e.g. when loaded through
GNU Radio). In these error cases, the libuhd path would be
$PREFIX/lib/./libuhd.so
(with a no-op /. inserted) which would result in a technically correct
library directory of `$PREFIX/lib/.` but an incorrect prefix directory
of `$PREFIX/lib`.
With the normalization fix, the libuhd path is corrected to
$PREFIX/lib/libuhd.so
and the subsequent path manipulation to get the library and prefix
directories will work as intended.
|
|
|
|
|
| |
This allows device::find() calls to proceed even when encountering an empty/invalid
serial number or serial number device argument hint.
|
|
|
|
|
|
|
| |
It was possible that output to cout would become interleaved inside of the
uhd log messages.
Signed-off-by: mattprost <matt.prost@ni.com>
|
| |
|
|
|
|
|
|
|
|
|
| |
We have integer 32-bit serial numbers for MPM devices, for example
"1234abcd". For serial numbers which have less than eight digits,
e.g. "123abcd", a user may feel inclined to prefix this number with
a 0 when they are searching for devices, e.g. "0123abcd". This change
makes it so that specifying "0123abcd" will match a device with serial
number "123ABCD".
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Up until now, we completely ignore the XDG specification.
This commit does the following to change that:
- It uses XDG_DATA_HOME and XDG_CONFIG_HOME for cal and config data,
respectively.
- If config data is in ~/.uhd/uhd.conf, that is still accepted, but if
it conflicts with $XDG_CONFIG_HOME/uhd.conf, it is ignored and a
warning is displayed
- The default location for cal data is thus ${HOME}/.local/share/uhd/cal
on Unix, and %LOCALAPPDATA%\uhd\cal on Windows. This is a change in
location!
- The UHD_CONFIG_DIR environment variable was confusingly named and is
now removed. It provided an alternative location than the home
directory. The same purpose is now much better served by XDG_DATA_HOME
and XDG_CONFIG_HOME.
The specification can be found here:
specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
|
|
|
|
|
|
|
|
|
| |
Now that we have cal::iq_cal and cal::database, there's no need to
manually wrangle CSV files for calibration data. This commit replaces
all CSV operations with cal::database calls and uses cal::iq_cal as
a container.
CSV files can still be read, but are considered deprecated.
|
|
|
|
| |
This points to the location where cal data is stored.
|
|
|
|
|
|
|
| |
This adds a specialization to `uhd::cast::from_str()` to handle `bool`
as a target type and interpret strings like 'y', 'Y', 'n', 'No', 'True',
'False', etc. as Boolean values, as well as the traditional '0' and '1'
(which also work).
|
|
|
|
|
|
|
|
|
| |
All of the functions defined in uhd/utils/paths.hpp are now available in
Python, with the exception of get_module_paths().
#!/usr/bin/env python3
import uhd
print(uhd.get_lib_path()) # Prints location of libuhd
|
|
|
|
|
|
| |
Whenever gains where set through a gain_group, it would output spurious
log messages that must stem from someone's debug code, since the log
messages are not very useful by themselves.
|
|
|
|
|
| |
Note: template_lvbitx.{cpp,hpp} need to be excluded from the list of
files that clang-format gets applied against.
|
|
|
|
|
| |
- Apply clang-format
- Remove unnecessary boost::format
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This replaces the package path constant with a runtime library path
lookup. The package path is taken to be the parent directory of the
library directory.
When boost >= 1.61 is not available, this maintains the current behavior
of using CMake to set path contants.
Runtime path determination is preferable for making a relocatable
library so that it is not necessary to do string substitution on
relocated binaries (as with, for example, building a conda package).
|
|
|
|
|
|
| |
_get_log_level() is an internal function that only gets called during
setup, so the logger isn't ready yet. It thus now logs to stderr instead
of the logger.
|
|
|
|
|
|
| |
Logging creates two threads, one for regular logging, and one for
fastpath logging. Now these threads are named using
uhd::set_thread_name()
|
|
|
|
|
|
|
|
|
|
|
| |
On systems like Windows, set_thread_name() is not supported, and would
previously log an error message telling the user that it can't set the
thread name. However, that prevents set_thread_name() to be called
before the logger is being set up, and the logger would like to use this
function.
Since it is obvious to the user if threads can be named or not, the log
message is considered redundant and is removed.
|
| |
|
|
|
|
|
|
|
| |
The prefs API is supposed to load the config files once, and stash them
away for the process to consume at will. Because the init_done is never
set, it will read the config files every time it's asked for them. This
is usually not a problem, but it causes the logging output to be messy.
|
|
|
|
|
| |
This is a more portable option to set thread names. References to
pthreads are now limited to thread.cpp, where they belong.
|
|
|
|
|
| |
Swap out hyphens for underscores in the DPDK args. Also update list
of distributions with the correct DPDK version in the repos.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
Adding graph_utils to keep rfnoc_graph utilities to contain helper
function and commonly used algorithms for the rfnoc_graph. These
functions aren't core to the rfnoc_graph's functionality, so we'll keep
them out of its API.
|
|
|
|
|
|
|
|
| |
boost::regex was a requirement until the minimum version of gcc was
increased. Since it is at version 5.3 now, using Boost.Regex is no
longer necessary.
This change is a pure search-and-replace; Boost and std versions of
regex are compatible and use the same syntax.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
uhd::get_system_time() is currently only used in USRP1 code, and it
turns out that our "optimized", platform-dependent implementation still
is a little slower than straight-up chrono. We therefore remove all the
special cases, and replace them with a single, standard solution.
|
|
|
|
| |
Applying formatting in anticipation of upcoming changes.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add convenience factory for making a gain group that has a single
zero-valued element. This factory requires a name, which should
probably be ALL_GAINS, or something similar (these constants are
device-specific).
Using this new make_zero factory in the X300 radio control when we
don't find any gain elements so that our gain groups aren't empty. This
simplifies our later setters/getters because we know that we'll always
have _something_ cached.
Note that we only register this zero value gain group for TX, as our
ADC is registered as a gain element, so our RX gain groups are never
empty.
|
| |
|
| |
|
|
|
|
|
| |
This is the inverse to std::to_string(), and we can overload it with
UHD-internal types.
|
| |
|
|
|
|
|
|
|
|
| |
Added cmake variable to set the component (currently UHD or MPM).
so the banner printed by the log_resource would reference the correct
component. Added accessor function and appropriate calls in log.cpp.
Signed-off-by: michael-west <michael.west@ettus.com>
|
|
|
|
|
|
|
|
|
|
| |
The first log message of UHD is always something like this:
[INFO] [UHD] linux; GNU C++ version [...]
However, it was being printed regardless of the requested log level.
This will disable all initial log messages if the requested log level is
greater than INFO.
|
| |
|