Previously the logic for the LTC5594 configuration was wrong. We
sometimes fell back into the default case which then didn't choose the
default but the first row in our lookup table. The default value was now
moved into an own constant and the lookup logic is now inverted to be
correct.
GetDboardSampleRate and GetDboardSampleRate rpc methods are not
dispatching per dboard because of missing db_idx field in the proto
definition. This means rpc is setting these rates for only single
dboard.
This change fixes dboard based dispatching for these rpc methods
from host client.
host:
Replace the msgpack-RPC (rpclib) client with a gRPC-based
implementation. Add auto-generated C++ client and Python bindings
from protobuf definitions. Remove rpclib dependency and integrate
FindgRPC into CMake.
mpm:
Replace the msgpack-RPC server with a gRPC server generated from
protobuf definitions. Add pb_utils.py for type conversion between
Python and protobuf. Update rpc_server.py to dispatch calls via
gRPC stubs. Update mpm_shell to use gRPC. Replace pyudev with sysfs
scan in uio device discovery.
Bump MPM compatibility number to 7.0 and RPC version to 2.
This change requires new depedencies. E.g. for Ubuntu 24.04 or 25.10:
libgrpc++-dev, libprotobuf-dev, protobuf-compiler-grpc, python3-grpcio
- Add mb_idx parameter to mpmd_mb_iface constructor and store _mb_index and _log_id
- Update all mpmd_mb_iface logging to use per-board log IDs (MPMD#N)
- Add mb_idx parameter to mpmd_mb_controller constructor and store _mb_index and _log_id
- Update all mpmd_mb_controller logging to use per-board log IDs (MPMD#N)
- Pass mb_idx when creating mpmd_mb_iface and mpmd_mb_controller instances
- Now all three levels of MPMD initialization use indexed logging for parallel visibility
Two new APIs are added to x400_rfdc_control:
- get_nco_good(): Combines the reset and FAIL flags into a single "good"
value
- get_nco_no_fail(): Provides information on the current status of the
NCO reset FAIL flag
This fixes many documentation issues where in the Doxygen output
sentences were incomplete and information was missing that is there in
the source files actually.
- boost::optional is replaced by std::optional
- In public APIs, boost::optional is still usable, but it is declared
deprecated. That means this is no API break (but it is an ABI break).
- Within the library portion (host/lib/**) there is no more usage of
boost::optional. Some backward-compatibility code (in actions.cpp and
ctrlport_endpoint.cpp) was moved out to the header.
Note: The most difficult replacement was that for
parse_log_level_from_string(), where boost::optional is the return
value. To retain API compatibility, we had to create a helper function.
This improves the logging IDs of files related to HBX. It adds the radio
as prefix to the logging ID to make it easier to recognize which
component wrote a log message as we typically have (at least) two in a
UHD session. Improved behavior for ADMV1320, ADMV1420, LTC5594
(demodulator) and for the TX and RX LOs.
This fixes some of the cornercases that could occur in the IQ DC offset
compensation:
1. If the frequency was set via the property tree, the compensation
would not work at all as it was previously triggered by the API
method.
2. Because of the same fact, there was no compensation if one measured
directly in the default frequency of 1 GHz without tuning away and
tuning back.
3. If only a partial compensation was done before and coefficients were
thus only available for some frequencies, no compensation was applied
for the lowest of these frequencies and below if the ADC self-cal was
run in the beginning of the session and it was never tuned close to a
frequency close to a higher compensation point.
4. There was a workaround in the code for this already but that led to
double calls to the FPGA for setting the coefficients during a retune.
5. The IQ cal script used to have the wrong unit in the progressbar and
some enumerate() leftovers which were not necessary anymore.
All of these issues are resolved with this.
This adds support for the new USRP X420. It is the latest addition to
our X4xx series and comes with two HBX daughterboards. The HBX is
a one-channel direct conversion transceiver that covers 5G NR FR3 and
X-/KU-Band needs for Research and Prototyping in a frequency range of 10
MHz up to 20 GHz. It supports analog bandwidths of up to 1 GHz.
This commit is the UHD/host portion of the X420 support.
Co-authored-by: Martin Anderseck <martin.anderseck@emerson.com>
Co-authored-by: Ahmed Salman <ahmed.salman@emerson.com>
Co-authored-by: Max Köhler <max.koehler@emerson.com>
Co-authored-by: Markus Schill <markus.schill@emerson.com>
This is the host-side counterpart for the new sub-channels in MPM. It
introduces the mode argument for many RPC calls to distinguish between
Real, I and Q sub-channels within one channel. Furthermore it updates
the ADC self-cal to calibrate all sub-channels within one logical
channel.
This removes the ZBX LO power from the LMX2572 driver to clean the LMX
driver from specifics that come from its users. The LO power setting now
takes place in the gluelayer between the ZBX driver and the LMX driver
(zbx_lo_ctrl).
Several files in UHD include headers or reference namespaces from Boost
without using them. We clear those out for a better view of how much
Boost is left in UHD.
UHD_SAFE_CALL macro had no semicolon after the code part. This
force the code using the macro to write something like
UHD_SAFE_CALL(some_func(););
which looks bit awkward. Adding a semicolon to allow writing
on liners like
UHD_SAFE_CALL(some_func());
Multi line code could still use a semicolon after the last
statement, as the compiler does not bother about double semicolon.
This became possible with the new dependency on C++17, which added std::
gcm() and std::lcm(). The standard library has some advantages over our
version (e.g., constexpr) but most importantly, it allows us to remove
the (version dependent!) Boost dependency in math.hpp.
This breaks the public API: `uhd::math::{gcd,lcm}` were defined in the
public header uhd/utils/math.hpp.
Previously Max287x assumed RFOUT (RFOUTA) port for output, and automatically enabled output from this port when setting the frequency of the chip. This allows for output selection of AUX_OUT (RFOUTB) instead during set_frequency.
This also adds a function to set the output enable for RF_OUT mirroring the added function for AUX_OUT, so that output enable is not solely controlled by setting frequency.
This is a combination of running include-what-you-need for clang14 on
the files in host/include with a manual vetting process.
As these are exposed header files, this seems like the most valuable are
to fix missing includes.
The manual vetting process consists of:
- Making sure iwyu uses <> includes consistently with our codebase (it
sometimes uses "" includes instead)
- For boost includes, do the "normal" inclusion (e.g., include
boost/optional.hpp instead of just all the individual sub-includes
that are required) for better cross-Boost-version compatibility
- Prefer cstddef over stddef.h
The code followed the FRAC2 for ADF5355, which only has 14 bits of
resolution. ADF5356 has 28 bits of resolution, and thus requires
a bigger word size.
Change the syrnchronization order to be following:
- Run the MTS (multi-tile sync) procedure
- Run the timekeeper alignment to next_pps edge
- Run the post timekeeper alignment steps (none for now)
This ensures that any effects caused due to delay adjustments which are
part of the MTS procedure do not affect timekeeper alignment.
Without this change timekeepers on two X4xx devices would be mis-aligned
slightly in a multi-device scenario.
Note that setting all timekeepers to a common time_spec on the next_pps
as a part of post-initialization application code will still align them perfectly.
Signed-off-by: Virendra Kakade <virendra.kakade@ni.com>
This change ensures that ADC selfcal is triggered during session start
if the clocking was reconfigured. So it saves time if several
consecutive sessions are opened with always the same settings.
It also makes the ADC self cal run if in an open session either
set_clock_source(), set_time_source() or set_sync_source() are called
and a clock reconfiguration was triggered by that.
This adds a new synchronization step in the MPMD device initialization.
- Add API calls to PeriphManagerBase and rpc.py (synchronize() and
aggregate_sync_data())
- Add sane default implementations to PeriphManagerBase
Note: This adds new APIs to MPM, but we won't change the compat number
in this commit, since the new API is not yet being used.
The X4x0 device is an outlier with respect to all other MPM devices when
it comes to this API. All other MPM-devices define this API on the
daughterboard, not the motherboard.
For all the reasons laid out in dboard_manager/base.py, we move this API
call for X4x0 also into the daughterboard RPC space.
Both get_master_clock_rate() and set_master_clock_rate() are explicitly
declared @no_rpc in MPM.
This is an API breakage in the UHD/MPM communication API.
The LO for the UBX can fail to lock in some cases where timed commands
are used to tune. The LOs on the UBX use a map to select the VCO
band. These changes give access to the maps for each LO and add a
calibration for the maps. This allows users to develop a calibration
that suits their use case.
Signed-off-by: michael-west <michael.west@ettus.com>
We currently do not set the calibration mode during ADC self
calbration. The default mode is selected in Vivado configuration.
Nevertheless we have seen issues where not setting the mode
lead to poor results in ADC self calibration.
This commit enable the RPC to call the set_calibration_mode
which was already implemented in our RFDC lib.
The keys for the table of frequency ranges for each VCO value counts up
consecutively but key "1" was there twice while "2" was missing. This
is fixed here.
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.