aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp
Commit message (Collapse)AuthorAgeFilesLines
* mg: Fix slot_idx referenceWade Fife2021-03-081-1/+1
|
* lib: Use const-ref in for loops instead of const-copyMartin Braun2021-03-045-6/+6
| | | | | | 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.
* 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-043-5/+5
|
* 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.
* 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-043-3/+1
| | | | | 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-0487-1090/+1165
| | | | | | | | | 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
* mpmd: Skip find if "resource" key is specifiedmichael-west2021-02-116-36/+13
| | | | | | | | | | | 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>
* ADF535x: Change freq_resolution to mod2michael-west2021-02-041-4/+4
| | | | | | | | | 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-042-10/+33
| | | | | | | | | | - 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>
* 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>
* uhd: Split radio_control into rf_control interfacesLane Kolbly2021-01-114-56/+7
| | | | | | 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-112-32/+25
| | | | | | | | | 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: throw error if edge list is emptyGrant Meyerhoff2020-12-211-0/+8
|
* RFNoC: Demoted zero sample error to warningmichael-west2020-12-101-5/+11
| | | | | | | | 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
|
* 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: 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: 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.
* 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>
* MPMD: Reduce max frame size for 10 GbEmichael-west2020-11-061-1/+1
| | | | | | | | | | | | MTU discovery is passing on sizes beyond the maximum size, which allows packets to exceed the default MTU size of 8000 set for 10 GbE. This can cause TX to stop when using higher sample rates. Reducing the maximum frame size to 7972 (8000 minus 28 bytes for UDP and IP headers) guarantees the packet size will never exceed the default MTU for 10 GbE. Signed-off-by: michael-west <michael.west@ettus.com>
* multi_usrp: Fix typos in streamer destruction callbackmichael-west2020-11-051-4/+4
| | | | Signed-off-by: michael-west <michael.west@ettus.com>
* sim: Integrate simulator into UHDSamuel O'Brien2020-10-284-3/+197
| | | | | | | | | This commit adds a device::register_device which allows uhd to start up a simulator when uhd is called with the arguments type=sim. Creating the device object creates a subprocess using pybind and an embedded interpreter, and destroying the object cleans up those subprocesses. Signed-off-by: Samuel O'Brien <sam.obrien@ni.com>
* multi_usrp: Fix streamer destruction callbackmichael-west2020-10-221-91/+74
| | | | | | | | | | | | | | | | | The streamers were keeping a reference to the multi_usrp object, so the object would not destruct when the user deleted or reset the shared pointer to the object. An error would occur if the user attempted to make the same device and get streamers on it without explicitly deleting the streamers first. This change refactors the code such that the streamer destructor only depends on the existence of a weak_ptr to the underlying rfnoc_graph and a vector of edges returned by the connect function. It checks to see if the graph has been deleted before calling the functions to disconnect the edges. This allows the multi_usrp object and streamer objects to be destructed in any order. Signed-off-by: michael-west <michael.west@ettus.com>
* python: Add access to the property_tree from PythonMartin Braun2020-10-161-0/+4
| | | | | | | Example: >>> usrp = uhd.usrp.multi_usrp("") >>> tree = usrp.get_tree() >>> print(tree.access_int("/name").get())
* python: Move multi_usrp_python to its own moduleMartin Braun2020-10-122-191/+200
| | | | | This helps with recompilation times of UHD. No functional changes.
* n310/n300: Allow gain coercionMartin Braun2020-10-091-2/+14
| | | | | | | | | | | | The N310 had a different behaviour from other devices, where setting a gain out of range would cause an assertion error. This is problematic for two reasons: 1) Assertion errors should not be triggered by public APIs (if we throw public APIs, we should give a clear error message), and 2) Setting gain and frequency has a coercing behaviour on all other devices. This changeset clips the gain before calling into the gain table lookup.
* b200: handle overruns during continuous streamingmattprost2020-10-091-0/+3
| | | | | | | This allows the b200 devices to recover from overruns that occur during continuous streaming. Signed-off-by: mattprost <matt.prost@ni.com>
* lib: disable non pcie types in find with resourceSteven Koo2020-10-056-7/+36
| | | | | | | mpmd find doesn't respect the "resource" arg hint and can be detected when "resource" is set. This results in incorrect device selection when using PCIe. This change adds detection for "resource" as a prefix in the device hints for mpmd and the other devices.
* uhd: clang format device implSteven Koo2020-10-054-17/+18
|
* multi_usrp: Add get_mb_controller() API callCristina Fuentes2020-09-243-27/+39
|
* E3xx: Add retry to loopback_self_testmichael-west2020-09-111-27/+46
| | | | | | | | | The loopback test sometimes fails. It was found that it would pass on a retry. The root cause of the failure is unknown at this time, but the retry allows the test to pass. This is intended as a temporary patch until the root cause of the failure can be identified. Signed-off-by: michael-west <michael.west@ettus.com>
* lib: Remove recursive locks in apply_correctionsmichael-west2020-09-041-3/+0
| | | | | | | | | There were locks in the apply_tx/rx_fe_corrections() methods that were acquired before calling methods that re-acquired the locks. The mutexes were not recursive, so it caused applications to lock up. The locks are unnecessary in the top level methods, so they are being removed. Signed-off-by: michael-west <michael.west@ettus.com>
* x300,mpmd: Increase recv frames for dpdk streamingSteven Koo2020-09-032-1/+16
| | | | | | | | With the default 32 frames, high rate DPDK streaming would overrun or drop samples. This defaults num_recv_frames to 512 for DPDK, which has shown to resolve these issues. Signed-off-by: Steven Koo <steven.koo@ni.com>
* uhd: Add APIs for getting the available power rangeMartin Braun2020-08-173-0/+35
| | | | | | | | | The previously added APIs for getting/setting power reference levels was missing an option to read back the currently available power levels (minimum and maximum power levels). This adds getters for TX and RX power ranges to multi_usrp and radio_control. The power API is thus now more similar to the gain API, which always had getters for gain ranges.
* X300: Adjusting 10GbE frame sizes for HW limitsmichael-west2020-08-171-2/+2
| | | | | | | Lowering X300 10GbE default frame sizes to max size supported by hardware. Signed-off-by: michael-west <michael.west@ettus.com>
* multi_usrp: Use multi_usrp::sptrs in graph disconnect lambdasAaron Rossetto2020-08-171-9/+12
|
* uhd: Disable optimizations for Mac for build speedSteven Koo2020-08-121-0/+9
| | | | | twinrx_gain_tables takes long time to build with optimizations on macOS / Clang. Turn them off for this platform.
* rfnoc: Resolves streamer/link segfaults on pythonSteven Koo2020-08-112-21/+28
| | | | | | | | | This commit resolves a segfault that occurs during teardown. Since teardown isn't detereministic in python, there were cases where the graph would destruct before the streamers or links got chance to cleanup. This would result in a segfault. This change gives the lambda a shared pointer to the object the callback method is calling on, so that it won't destruct before being called.
* X300: Update frame sizes for 10GbEmichael-west2020-08-071-7/+5
| | | | | | | | | Setting default frame sizes for 10 GbE to match an Ethernet MTU of 9000, which is recommended in the UHD manual for the X300. The MTU detection code is left untouched, so it will automatically adjust if the MTU is lower than 9000. Signed-off-by: michael-west <michael.west@ettus.com>
* mpmd: Clean out link_if_mgrMartin Braun2020-08-072-7/+4
| | | | | | | | | The link_if_mgr used to be a factory for Liberio, UDP, and DPDK. Now, Liberio is gone and DPDK is handled by UDP. This makes the class superfluous. Instead of removing the class, we comment on this, and remove any DPDK references from the file.
* mpmd: Assume mgmt interface can route CHDR packetsSteven Koo2020-08-041-1/+15
| | | | | | | | | The e31x devices don't advertise CHDR interface availability when the low power FPGA is loaded. Since the e3xx and n3xx all route CHDR packets with Virtual NIC forwarding, it's safe to assume that if we can communicate with the mgmt_addr, we can communicate via CHDR too. We can then correctly set the reachability for the e31x from this assumption.