aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib
Commit message (Collapse)AuthorAgeFilesLines
* lib: Use const-ref in for loops instead of const-copyMartin Braun2021-03-046-7/+7
| | | | | | This is potentially a performance issue, even though it doesn't have a big impact in this context. Clang will warn about it, and this fixes the compiler warning.
* lib: Add some virtual dtorsMartin Braun2021-03-046-1/+19
| | | | | | | 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.
* twinrx: Fix missing default copy ctorMartin Braun2021-03-041-0/+3
| | | | | | | twinrx_gain_config_t defined an assignment operator, but not a default copy ctor. This is not allowed in modern C++, although compilers let it slide and provide their own defaults. Clang, however, throws a warning so let's fix it.
* lib: Fix warnings related to unnecessary lambda capturesMartin Braun2021-03-0411-18/+28
|
* convert: Remove unused variablesMartin Braun2021-03-042-4/+0
| | | | This reduces compiler warnings when using clang.
* mg: Remove unused private attribute from ad9371_ifaceMartin Braun2021-03-042-4/+0
| | | | This fixes a clang warning.
* rh: Remove unused constantMartin Braun2021-03-041-1/+0
| | | | This fixes a clang warning.
* lib: lmx2592: Comment out some unused constantsMartin Braun2021-03-041-7/+10
| | | | | | These constants are useful for reference, but they're not used. We keep them in-tree (as comments) because of their utility, but comment them out to fix clang warnings.
* rh: cpld control: Comment out gain table addressMartin Braun2021-03-041-1/+1
| | | | This fixes a clang warning.
* rfnoc: tx_streamer: Remove EOV size attributeMartin Braun2021-03-041-2/+0
| | | | It is unused, and causes clang warnings.
* rh: Remove use of magic number of identify durationMartin Braun2021-03-042-3/+3
| | | | This fixes a clang compiler warning.
* lib: Remove unused constantsMartin Braun2021-03-045-9/+6
| | | | | The constants were either commented out, when their value is still useful to the reader, or removed if not.
* host: Update code base using clang-tidyMartin Braun2021-03-04170-1856/+1955
| | | | | | | | | 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
* ic_reg_maps: Add SPCC reg mapToni Jones2021-03-011-0/+116
| | | | Add SPCC reg map for reference and testing.
* mpmd: Skip find if "resource" key is specifiedmichael-west2021-02-118-49/+14
| | | | | | | | | | | MPM devices were being discovered when trying to locate PCIe connected devices. Adding filter to exclude them if the "resource" key is specified in the device address arguments. Replaces "lib: disable non pcie types in find with resource" to reduce impact to older devices and remove API change. Signed-off-by: michael-west <michael.west@ettus.com>
* TwinRX: Fix LO lock failuremichael-west2021-02-101-11/+2
| | | | | | | 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>
* ADF535x: Change freq_resolution to mod2michael-west2021-02-042-26/+28
| | | | | | | | | 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>
* dboard_iface: Modify sleep() functionMichael West2021-02-041-5/+14
| | | | | | | | | The algorithm for the sleep() function is changed to first increment the command time if the command time is set. If the command time is not set, it just performs a sleep on the host. The intention is to make a best effort to create the requested delay on the device. Signed-off-by: Michael West <michael.west@ettus.com>
* TwinRX: Spur cleanupmichael-west2021-02-043-11/+49
| | | | | | | | | | - 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>
* lib: Fix missing includes in rpc.hppMartin Braun2021-02-011-0/+4
|
* cmake: fix cut-and-paste typo to fix SIM APPLE buildMichael Dickens2021-01-251-1/+1
| | | | Ref: 00c306d5c441e60e7dfd2516e05e4e433977ecee
* uhd: lambda capture the node instead of vert descSteven Koo2021-01-212-4/+17
| | | | | | | | | | | 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>
* msgpack/predef: add riscV supportGwenhael Goavec-Merou2021-01-213-1/+51
|
* uhd: Check for overflow after timeout buff readSteven Koo2021-01-213-24/+15
| | | | | | | | | | | | 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>
* uhd_image_loader: Consume .lvbitx filesLane Kolbly2021-01-111-117/+237
| | | | | | | | | | | | .lvbitx files contain the device tree and the FPGA bitstream, so this change allows a user to download a .lvbitx to their device instead of having to juggle separate .bin and .dts files. If a .lvbitx file does not contain a .dts section for any reason, download will still succeed, and a warning will be printed that no dts file was found. This behaviour was chosen (over erroring) to mimic the existing behaviour when a .bin file is found but there is no corresponding .dts file.
* utils: check config file before finding devices for image loaderAndrew Lynch2021-01-111-1/+2
|
* mpmd: Add support to delay and trigger fpga/dts load after updateVirendra Kakade2021-01-112-80/+130
| | | | | | | | | Add a new image_loader argument delay_reload to provide a way to update components but optionally delay the actual load. Similarly add a new argument, just_reload, to enable uhd to reload the fpga/dts components. Signed-off-by: Virendra Kakade <virendra.kakade@ni.com>
* rfnoc: Update radio to support multiple SPCWade Fife2021-01-111-4/+10
|
* chdr: Fix u64_to_host vs. u64_from_host usageMartin Braun2021-01-111-1/+1
|
* rfnoc: Add accessors for item width and nipc for NSSWade Fife2021-01-112-0/+23
| | | | | | - Add get_item_width() and get_nipc() methods to the Null/Source/Sink block controller. - Add missing enumerated types for get_count() method.
* uhd: Split radio_control into rf_control interfacesLane Kolbly2021-01-1111-76/+237
| | | | | | These rf_control interfaces allow easier implementation of radio controls as well as allowing easier sharing of code for implementing e.g. gain_profile.
* Create C++ wrappers for MPM RPC callsLane Kolbly2021-01-115-37/+194
| | | | | | | | | 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.
* uhd: revert "Check property type at access..."Steven Koo2021-01-081-25/+1
| | | | | | | | | | This change reverts cb9329a681552e6ac6277d16e1627afcbb23e637. The type checking is causing some conversion issues on clang/macos. The type_index checking doesn't work correctly across shared libraries and should not be relied on to verify type, since it can vary from compiler to compiler. Signed-off-by: Steven Koo <steven.koo@ni.com>
* usrprio: catch exceptions if rpc data read failsSteven Koo2020-12-211-3/+17
| | | | | | | | | This is an unhandled exception case that can cause silent failures for detecting ethernet x310 devices if the niusrpriorpc service is enabled. The "out_args >> vtr_size" read can throw an exception if there are no PCIe devices connected. Signed-off-by: Steven Koo <steven.koo@ni.com>
* fixup! RFNoC: Handle receive of 0 samplesmichael-west2020-12-211-3/+3
|
* rfnoc: Fix remote stream buffer formatWade Fife2020-12-211-0/+18
| | | | | | | | When configuring remote streams, we were setting the format at the source stream endpoint, but not at the destination stream endpoint. Therefore, the destination used the default or whatever it was set to during a previous run. This change sets the format at the destination stream to match the format of the source stream.
* uhd: throw error if edge list is emptyGrant Meyerhoff2020-12-211-0/+8
|
* rfnoc: Fix time conversion in ctrlport_endpoint sleep methodCiro Nishiguchi2020-12-211-2/+4
|
* RFNoC: Handle receive of 0 samplesmichael-west2020-12-102-0/+11
| | | | | | | 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>
* RFNoC: Demoted zero sample error to warningmichael-west2020-12-102-7/+14
| | | | | | | | Requesting zero samples was resulting in an error and causing applications to crash. This was a change frome previous versions of UHD. Demoted to warning so applications continue as they did before. Signed-off-by: Michael West <michael.west@ettus.com>
* fixup! N310: Low band IF adjustmentsmichael-west2020-12-091-1/+1
|
* python: Add find() to the Python APIMartin Braun2020-12-072-0/+28
| | | | | | | | | | | | This a mapping of uhd::device::find() into uhd.find() on the Python side. The uhd::device is intentionally not mapped into Python (prefer MultiUSRP or RfnocGraph instead), so the namespace is moved up one level. Example: >>> import uhd >>> # Now print the device args for all found B200s: >>> for dev_args in uhd.find("type=b200")): print(dev_args.to_string())
* mpmd: Export RPC token and mb_args to the property treeMartin Braun2020-12-043-0/+13
| | | | | | There are applications (typically for debugging purposes) which need access to the token and the mb_args. They are thus published via the property tree.
* multi_usrp_rfnoc: Serialize make_rfnoc_deviceAaron Rossetto2020-12-041-1/+24
| | | | | | | | | | | | | | | In certain execution environments (e.g. NI's LabVIEW), the instantiation of multi_usrp objects may execute in parallel in two different threads. As the RFNoC block instances are shared between the multi_usrp instances, there is a risk that threads racing to configure the initial state of the Tx and Rx chains may operate on inconsistent or incomplete views of the state of the RFNoC blocks that make up the chain, leaving them in an invalid state that leads to client-facing errors. This commit serializes calls to make_rfnoc_device to prevent creating multiple multi_usrp objects in parallel. It also creates a map of existing multi_usrp devices and returns the existing multi_usrp object if it exists.
* python: Make TuneRequest implicitly convertible from doubleMartin Braun2020-12-011-0/+1
| | | | | | | | | | This allows to do the following: >>> usrp = uhd.usrp.MultiUSRP(args) >>> usrp.set_tx_frequency(1e9) In the past, you would have to manually convert the frequency to a uhd.types.TuneRequest before passing it to set_?x_frequency(). This new behaviour makes Python match the C++ behaviour.
* python: multi_usrp: Let get_tree() return a raw pointerMartin Braun2020-12-011-1/+1
| | | | | | | | | | | | | | | | | | This changes the Python version of MultiUSRP.get_tree() such that it returns a raw pointer to the tree instead of returning the sptr. This fixes an issue where calling get_tree() will reliably cause a segfault during garbage collection, at least on some USRPs. The downside of this approach is that storing the return value from get_tree() can produce a dangling pointer when the underlying object is destroyed. It's still better than segfaults, and the recommended way to use get_tree() anyway is not to store the return value (unless it's in a local scope), but tack on property tree methods to get_tree() itself. Examples: >>> usrp = uhd.usrp.MultiUSRP('...') >>> usrp.get_tree().exists('/path/to/prop') # This is fine This change has no noticable API changes.
* python: Improve access to device_addr_tMartin Braun2020-11-232-1/+9
| | | | | | | | This makes two changes: - Add device_addr_t as a type that the Python property tree access can handle - Add a to_dict() call to device_addr_t (in Python) that will return a regular dictionary from a device_addr_t for a more Pythonic access.
* python: multi_usrp: Fix get_radio_control()Martin Braun2020-11-231-1/+1
| | | | | | | | This function was incorrectly wrapped into Python and would fail with Python saying it can't hold a reference to the radio block. This changes the wrapping into returning a raw pointer, but also makes the return value policy reference_internal so that garbage collection happens in the right order.
* graph: Restore default resolver callback at node removalAaron Rossetto2020-11-203-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* N310: Low band IF adjustmentsmichael-west2020-11-161-18/+10
| | | | | | | - Put ADF4351 at fixed integer-n mode IF freq - Set ADF4351 in low noise mode Signed-off-by: michael-west <michael.west@ettus.com>