| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
In C++, variables whose address are taken must be defined somewhere.
PERIPH_BASE had no such definition, so on some compilers/systems caused
a linker error. This commit switches to using enums to prevent this
happening again in the future.
|
| |
|
|
|
|
| |
Support DPDK versions 19.11 and 20.11
|
|
|
|
|
|
|
|
|
|
|
|
| |
This class has a member _num_drops, which can be read out using the
get_num_drops() API call. However, when dropping packets, this counter
was not incremented, which is fixed now.
This also includes a very minor optimization from 2 map<> lookups to
1 lookup (they are in O(log N)). Since there are usually a small
two-digit number of endpoints connected to the async message receiver,
this change is not expected to yield major improvements, but the lookup
*is* in a hot loop.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
These two values where being mixed up in the code. To summarize:
- The MTU is the max CHDR packet size, including header & timestamp.
- The max payload is the total number of bytes regular payload plus
metadata that can be fit into into a CHDR packet. It is strictly
smaller than the MTU. For example, for 64-bit CHDR widths, if
a timestamp is desired, the max payload is 16 bytes smaller than
the MTU.
The other issue was that we were using a magic constant (DEFAULT_SPP)
which was causing conflicts with MTUs and max payloads.
This constant was harmful in multiple ways:
- The explanatory comment was incorrect (it stated it would cap packets
to 1500 bytes, which it didn't)
- It imposed random, hardcoded values that interfered with an 'spp
discovery', i.e., the ability to derive a good spp value from MTUs
- The current value capped packet sizes to 8000 bytes CHDR packets, even
when we wanted to use bigger ones
This patch changes the following:
- noc_block_base now has improved docs for MTU, and additional APIs
(get_max_payload_size(), get_chdr_hdr_len()) which return the
current payload size given MTU and CHDR width, and the CHDR header
length.
- The internally used graph nodes for TX and RX streamers also get
equipped with the same new two API calls.
- The radio, siggen, and replay block all where doing different
calculations for their spp/ipp values. Now, they all use the max
payload value to calculate spp/ipp. Unit tests where adapted
accordingly. Usage of DEFAULT_SPP was removed.
- The replay block used a hardcoded 16 bytes for header lengths, which
was replaced by get_chdr_hdr_len()
- The TX and RX streamers where discarding the MTU value and using the
max payload size as the MTU, which then propagated throughout the
graph. Now, both values are stored and can be used where appropriate.
|
|
|
|
|
|
| |
Add API calls to Radio control to get ticks and time.
Signed-off-by: michael-west <michael.west@ettus.com>
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
| |
Refactors register addresses into a gpio_atr_offsets structure which
contains the various register addresses. This allows creating other
devices with different GPIO register layouts with greater ease, and
eliminates the use of macros (yay!)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
| |
A recv() of zero samples on an RX stream should return immediately
(i.e., without respect to the timeout and regardless of the availability
of samples), surfacing any stream error conditions via metadata. This
convention was broken in a2f10ee9, causing a recv() of zero samples to
wait for the entire timeout period and then return ERROR_CODE_TIMEOUT if
no samples are available. This commit restores the desired semantics.
|
|
|
|
|
|
|
|
|
|
|
|
| |
This serves two purposes:
- This file no longer goes into the compiled DLL if B200 is disabled
- Discourage use of this file for new devices, making it clear that this
architecture is no longer used
The file itself is left untouched, only the class is renamed from
radio_ctrl_core_3000 to b200_radio_ctrl_core.
Note: In UHD 3, this file was also used by N230.
|
|
|
|
| |
This Boost header is included in some places, despite not being used.
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Superfluous 'this' capture.
|
|
|
|
|
|
|
|
| |
- Missing override
- Superfluous 'this' lambda capture
- Register state in zbx_cpld_ctrl was being initialized too late (this
is actually a bug depending on compiler version)
- Remove lots of unused fields from experts
|
|
|
|
|
|
| |
The ostream<< overloads where in the wrong namespace to be found by the
expert framework. Other compilers are more forgiving; not so clang 10.
This enables compilation on that compiler.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Co-authored-by: Lars Amsel <lars.amsel@ni.com>
Co-authored-by: Michael Auchter <michael.auchter@ni.com>
Co-authored-by: Martin Braun <martin.braun@ettus.com>
Co-authored-by: Paul Butler <paul.butler@ni.com>
Co-authored-by: Cristina Fuentes <cristina.fuentes-curiel@ni.com>
Co-authored-by: Humberto Jimenez <humberto.jimenez@ni.com>
Co-authored-by: Virendra Kakade <virendra.kakade@ni.com>
Co-authored-by: Lane Kolbly <lane.kolbly@ni.com>
Co-authored-by: Max Köhler <max.koehler@ni.com>
Co-authored-by: Andrew Lynch <andrew.lynch@ni.com>
Co-authored-by: Grant Meyerhoff <grant.meyerhoff@ni.com>
Co-authored-by: Ciro Nishiguchi <ciro.nishiguchi@ni.com>
Co-authored-by: Thomas Vogel <thomas.vogel@ni.com>
|
|
|
|
|
|
|
|
|
| |
This function had an issue where it might return negative frequency
values. A quick fix was to limit it to positive frequencies.
Since this function was duplicated between multi_usrp and
multi_usrp_rfnoc, this patch also moves it to a common location to not
have to fix it twice.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The experts framework has two ways of integrating expert nodes into the
property tree: add_prop_node() and add_dual_prop_node(). In the latter
case, the experts should take care of coercion, and thus, we subscribe
to the desired value.
In the former case, this is not necessary, and precludes us from using
set_coercer() with prop nodes on the prop tree. This change lets us use
regular nodes in the expert framework that also use property tree
coercers.
As of now, there is not a single property node in UHD that uses
add_prop_node() and also does any kind of coercion, so this change has
no effect on current code (this is only used in TwinRX as of now).
|
|
|
|
|
|
|
|
|
|
|
| |
Disabling this feature will allow the USRP to send a continuous stream
of Rx data to a host machine without throttling due to lack of flow
control credits. This is unnecessary overhead on lossless transports
such as pcie or aurora.
Usage: add 'enable_fc=false' to stream_args.args
Signed-off-by: mattprost <matt.prost@ni.com>
|
|
|
|
|
|
| |
This adds uhd::rfnoc::radio_control::get_spc(). It can be overridden by
radio implementations, but radio_control_impl has a sensible default
implementation, return the value that is in the SPC radio register.
|
|
|
|
| |
This avoids more clang compiler warnings.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The const-ness of some radio_control differed between base class and
implementation. This fixes the consistency, but also makes sure these
methods follow the rules for when to make methods 'const'.
The following rules apply:
- Methods that query static capabilities are const. Here, we made
get_tx_lo_sources() const (the RX version was already const).
- Getters that may have to interact with the device (e.g., peek
a register) are not const, because the act of peeking is usually also
non-const. Here, we changed get_rx_lo_export_enabled() to non-const.
- All base classes are fixed such that the derived classes and the base
classes have the same const-ness. Clang was warning about differences.
This can cause very tricky bugs, where the radio_control_impl version
can get called instead of the intended child class.
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
Note: This is the same procedure as 107a49c0, but applied to all the new
code since then.
|
|
|
|
| |
This is a pessimizing move, and clang warns about it.
|
| |
|
|
|
|
|
|
|
| |
Classes where we call delete (implicitly or explicitly) with a virtual
inheritance structure need to declare dtors as virtual.
This reduces compiler warnings with clang. There are no known bugs (yet)
due to this.
|
|
|
|
| |
It is unused, and causes clang warnings.
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
Always write register 6 in the ADF5356. Conditional write was causing
the LO not to lock at some frequencies.
Signed-off-by: michael-west <michael.west@ettus.com>
|
|
|
|
|
|
|
|
|
| |
The freq_resolution parameter to the set_frequency() method was
confusing. Changing it to the mod2 value clarifies the intention and
makes the math to reduce the FRAC2 and MOD2 values much easier to read
and maintain.
Signed-off-by: michael-west <michael.west@ettus.com>
|
|
|
|
|
|
|
|
|
|
| |
- Reduce FRAC2 and MOD2 values on ADF5356
- Add write to register 10 and delay during retune on ADF5356
- Make negative bleed conditional on integer or fractional N mode for
ADF5356
- Tune unused LOs out of band to remove interference
Signed-off-by: michael-west <michael.west@ettus.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
This commit adds another resolve_all_properties method to use the
node instead of the vertex descriptor. The vertex descriptor could be
removed. This could cause the lambda capture to have an outdated
vertex descriptor, which would result in a hang when looking for it.
This resolves the issue by capturing the node and looking for the vertex
descriptor.
Signed-off-by: Steven Koo <steven.koo@ni.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Error processing has been moved to another thread, so it's possible
that consecutive recv calls may miss the signalling that
an overflow occurred. We have no guarantee that the flag had been
set by the time the second recv call to find the errors occurs.
This adds another check for an overflow after calling
_get_aligned_buffs with a min 1ms timeout. Hopefully this is long
enough for the error to propogate, but it's not guaranteed.
Signed-off-by: Steven Koo <steven.koo@ni.com>
|
|
|
|
|
|
| |
These rf_control interfaces allow easier implementation of
radio controls as well as allowing easier sharing of code
for implementing e.g. gain_profile.
|
|
|
|
|
|
|
|
|
| |
This gives us type-safety, as well as allowing us to create unit tests for
RFNoC radio_controls without having to create actual RPC servers and clients
in the unit tests.
This change also fixes a bug in mpmd_mb_controller::set_sync_source, where
it was calling the wrong MPM function.
|
| |
|
|
|
|
|
|
|
| |
Returns immediately if requested number of samples is zero. Prevents
timeout error from being thrown if user requests no samples.
Signed-off-by: michael-west <michael.west@ettus.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The default resolve callback behavior for a newly-instantiated `node_t`
object resolves all dirty properties associated with the node, then
marks the properties as clean. When the node is added to a graph, its
resolver callback is updated to use the graph property propagation
algorithm in `graph_t::resolve_all_properties()`, which is considerably
more sophisticated and relies on the graph topology to do its work.
When a connection between two nodes is broken via the
`graph::disconnect()` method, nodes which no longer have incoming or
outgoing edges (connections) are removed from the graph. Prior to this
change, the removed node's resolver callback was left pointing at the
graph property propagation algorithm. In certain use cases, this could
result in unexpected client-facing behavior. Consider, for example, this
code (incomplete and for illustrative purposes only) which creates a
streamer on one transmit chain of a multi-channel device, destroys that
streamer, then creates a stream on the other transmit chain. Attempting
to set the TX rate on the first chain after destroying the streamer does
not result in the expected rate change, despite the same code working
correctly before creating the streamer:
constexpr size_t CH0 = ..., CH1 = ...;
uhd::usrp::multi_usrp::sptr usrp = uhd::usrp::multi_usrp::make(...);
// Set a TX rate on both chains; this succeeds
usrp->set_tx_rate(initial_rate, CH0);
usrp->set_tx_rate(initial_rate, CH1);
assert(initial_rate == usrp->get_tx_rate(CH0));
assert(initial_rate == usrp->get_tx_rate(CH1));
// Create a TX streamer for channel 0
std::vector<size_t> chain0_chans{CH0};
stream_args_t sa;
sa.channels = chain0_chans;
sa.otw_format = ...;
sa.cpu_format = ...;
uhd::tx_streamer::sptr txs = usrp->get_tx_stream(sa);
// Destroy the first streamer (disconnecting the graph) and
// create a streamer for channel 1
txs.reset();
std::vector<size_t> chain1_chans{CH1};
sa.channels = chain1_chans;
txs = usrp->get_tx_stream(sa);
// Now try to set a new TX rate on both chains
usrp->set_tx_rate(updated_rate, CH0);
usrp->set_tx_rate(updated_rate, CH1);
assert(updated_rate == usrp->get_tx_rate(CH0)); // <--- FAILS
assert(updated_rate == usrp->get_tx_rate(CH1));
The reason this fails is because the second call to `set_tx_rate()` on
channel 0 internally sets the 'interp' (interpolation ratio) property on
the DUC node via the call to the DUC block controller's
`set_input_rate()` function. As the DUC node is no longer part of the
graph, having been removed from it when the first streamer instance was
destroyed, the graph property propagation algorithm doesn't 'see' the
node with the dirty property, and the 'interp' property resolver
callback is never invoked. As a result, the DUC's input rate property,
which depends on the interpolation ratio value, is never updated, and
thus calling the `get_tx_rate()` function to query the new rate of the
TX chain results in an unexpected value. In fact, in this particular
case, `set_tx_rate()` actually raises a warning that the TX rate
couldn't be set, and a message is printed to the console.
This commit remedies the situation by restoring the default resolve
callback behavior for a node when it is removed from the graph. This
allows the framework to be able to invoke the property resolver callback
on that node when a property is updated, the expected behavior of a
newly instantiated node.
|
|
|
|
|
|
|
|
| |
This commit expands the scope of the former _release_mutex, renaming it
_graph_mutex and ensuring that all graph modification functions are
serialized against each other. This ensures that callers to graph_t's
public functions are always operating on a coherent view of the
underlying BGL graph object.
|
|
|
|
|
|
|
|
| |
Bypass the LO1 feedback divider if it is not required. Some TwinRX units
have seen issues when tuning to frequencies between 3.5GHz and 5.1GHz
while following that data path.
Signed-off-by: mattprost <matt.prost@ni.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This change improves the DPDK link status detection algorithm in the
following ways:
- The status of the links are checked at an interval of 250 ms. If all
links report as being up, the driver proceeds.
- If any of the DPDK links has not reported as being up by the end of
the link status detection timeout (1000 ms by default), the algorithm
throws a runtime error rather than proceeds with one or more down
links.
- Users may override the default link status detection timeout by
passing dpdk_link_timeout=N, where N is the desired timeout in
milliseconds, either via device arguments or in the UHD configuration
file.
|