| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
| |
TRACE: Remains purple, but that's now no longer bright
ERROR: Is now bright red (was non-bold red before)
FATAL: Is now red-on-yellow
|
|
|
|
|
|
| |
The colour codes used for console logging were incorrectly defined.
Some colours would simply not rendered this way (e.g., red), others
had the boldness flag wrong.
|
|
|
|
|
|
|
| |
In log.cpp, a deadlock can occur while popping elements from the log
queue. If the queue is empty, the call does not timeout, and waits
infinitely. Replacing pop_with_wait() with pop_with_timed_wait() solves
this issue.
|
|
|
|
| |
`clang-format -i --style=file host/lib/utils/log.cpp`
|
|
|
|
| |
Updating all SPDX license identifiers to include "-or-later"
|
|
|
|
|
|
| |
This does not change the Python API itself, but it is still
a significant change. Most importantly, it removes the dependency on
Boost.Python.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add configuration sections to the UHD config file for NIC entries. Keys
are based on MAC addresses, and the entries beneath the section describe
which CPU and I/O thread to use for the NIC and its IPv4 address.
Make ring sizes configurable for uhd-dpdk. Ring size is now an argument
for packet buffers. Note that the maximum number of available buffers
is still determined at init!
Add ability to receive broadcasts to uhd-dpdk. This is controllable by
a boolean in the sockarg during socket creation. dpdk_zero_copy will
filter broadcast packets out.
Add dpdk_simple transport (to mirror udp_simple). This transport allows
receiving from broadcast addresses, but it only permits one outstanding
buffer at a time.
Fix IP checksum handling in UHD-DPDK.
TX checksums were not being calculated in the NIC, and in RX, the check
for IP checksums allowed values of zero (reported as none). Now packets
with bad IP checksums will be dropped.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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!)
|