aboutsummaryrefslogtreecommitdiffstats
path: root/host
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* tests: Add UT for node removal prop resol'n restorationAaron Rossetto2020-11-201-0/+53
|
* graph: Restore default resolver callback at node removalAaron Rossetto2020-11-204-1/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* rfnoc: Add Makefile.srcs to switchboard.ymlWade Fife2020-11-191-0/+1
|
* examples: Fix PPS option in rfnoc_radio_loopbackLane Kolbly2020-11-171-1/+1
|
* utils: Fix GUI argument in rfnoc_image_builderMarkus Unger2020-11-161-1/+1
|
* 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>
* python: Clean up image builder generated codeWade Fife2020-11-069-117/+142
| | | | | This updates the RFNoC image to generate code that's a bit more tidy, with consistent spacing and better alignment.
* 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-285-3/+218
| | | | | | | | | 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>
* DUC: Fix incorrect DDS_GAINmichael-west2020-10-261-1/+1
| | | | | | | Fixes incorrect value for the DDS_GAIN that was causing the TX output power to be 6 dB lower than it was supposed to be. Signed-off-by: michael-west <michael.west@ettus.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>
* graph: Serialize all graph-related functionsAaron Rossetto2020-10-222-8/+13
| | | | | | | | 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.
* graph: Re-fetch dst_node descriptor after src_node potential removalAaron Rossetto2020-10-221-0/+3
| | | | | | | | | | | | | | | | | The graph_t::disconnect(src_node, dst_node) function removes connections (edges) from src_node to dst_node in the graph, and then removes the nodes (vertices) if their degree is zero after removing the connections. Because removing a vertex from the graph invalidates vertex descriptors, the graph_t::_remove_node() function resynchronizes the node-to-vertex descriptor map after removing the vertex. However, in graph_t::disconnect(), the vertex descriptor corresponding to dst_node was not being refetched after the potential removal of src_node, which results in the incorrect removal of innocent nodes under certain circumstances. This commit ensures that the node-to-vertex descriptor is reconsulted for the vertex descriptor corresponding to dst_node before removing it from the tree.
* fixup! rfnoc: Fix thread unsafe accesses in ctrlportCiro Nishiguchi2020-10-201-7/+5
|
* rfnoc: Fix thread unsafe accesses in ctrlportCiro Nishiguchi2020-10-201-56/+35
|
* python: Add access to the property_tree from PythonMartin Braun2020-10-167-0/+96
| | | | | | | Example: >>> usrp = uhd.usrp.multi_usrp("") >>> tree = usrp.get_tree() >>> print(tree.access_int("/name").get())
* uhd_images_downloader: Add environment variable for http authLane Kolbly2020-10-154-3/+79
| | | | | | | | | This allows the image downloader to download files from restricted sources using HTTP basic auth, specifying the credentials in the UHD_IMAGES_USER and UHD_IMAGES_PASSWORD environment variables: ``` UHD_IMAGES_USER=lane UHD_IMAGES_PASSWORD=MyS3cretPassword uhd_images_downloader.py ```
* uhd_images_downloader: Remove unused default_no parameterLane Kolbly2020-10-151-3/+2
| | | | | This parameter isn't used by any callers of the function. Additionally, it doesn't actually change the default answer.
* utils: Improve NMEA string outputmichael-west2020-10-121-47/+42
| | | | | | | | | | Separated output of GPGGA and GPRMC strings into separate try/catch so each one would display independently. Resolves issue of GPGGA string not displaying on devices that don't support the GPRMC string. Also removed unnecessary uses of boost::format. Signed-off-by: michael-west <michael.west@ettus.com>
* python: Move multi_usrp_python to its own moduleMartin Braun2020-10-123-192/+204
| | | | | This helps with recompilation times of UHD. No functional changes.
* examples: Fix --random option in benchmark_ratemichael-west2020-10-121-5/+11
| | | | | | | | The implementation was not properly configuring the stream command if the --random flag was used. It was especially bad when multiple channels were specified. Signed-off-by: michael-west <michael.west@ettus.com>
* deps: rpclib: Fix issue on socket closingMartin Braun2020-10-091-1/+7
| | | | | | | The rpclib server session closes its socket, which can fail. In our case, we only use the server for some tests, and we close the server on process exit, so we let the error slide. Since we close servers in dtors, not doing so would occasionally cause SIGABRT.
* tests: mock_block: Allow mock blocks to carry MB controllersMartin Braun2020-10-092-6/+9
|
* utils: Set rfnoc_create_verilog.py as executableWade Fife2020-10-091-0/+0
|
* 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>
* rfnoc: Alphabetize sections in CMakeLists.txtAaron Rossetto2020-10-091-22/+22
|
* rfnoc: Add add'l header files to CMakeLists.txtAaron Rossetto2020-10-091-0/+3
|
* sim: Embed MPM into libpyuhdSamuel O'Brien2020-10-071-0/+57
| | | | | | | When ENABLE_SIM and ENABLE_PYTHON_API are set, this commit embeds MPM (Built with -DMPM_DEVICE=sim) into the pyuhd package. Signed-off-by: Samuel O'Brien <sam.obrien@ni.com>
* debian: Update Python3 dependenciesmichael-west2020-10-062-3/+18
| | | | Signed-off-by: michael-west <michael.west@ettus.com>
* Docs: Update Python3 dependenciesmichael-west2020-10-061-9/+12
| | | | Signed-off-by: michael-west <michael.west@ettus.com>
* ic_reg_map: Allow registers to be arraysMartin Braun2020-10-061-19/+114
| | | | | | | | | | This lets you declare registers like this: REG_NAME[ARRAY_LEN] ADDRESS[BITS] DEFAULT ENUMS The reg object will now carray REG_NAME as an array. So, you can do regs.REG_NAME[0] = VALUE;
* ic_reg_maps: Add common regmap template for PythonToni Jones2020-10-061-4/+88
| | | | | | | Add COMMON_PY_TMPL which is identical to COMMON_TMPL in functionality but generates Python syntax rather than C++ header syntax. Modify the generate function which will now determine if the destination regmap file is a Python file or not and will use the appropriate template.
* docs: Fix sensor names for N3xx boardsMartin Braun2020-10-061-1/+2
|
* lib: disable non pcie types in find with resourceSteven Koo2020-10-059-8/+56
| | | | | | | 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-055-18/+19
|
* uhd: replace default initializers with named onesSteven Koo2020-09-252-8/+11
| | | | This resolves an issue with building on older compilers.
* lib: graph_utils: Error on single SEP edgeSteven Koo2020-09-251-10/+14
| | | | | It could be possible that we only find one SEP connected edge, which should be invalid.
* lib: graph_utils: Fix formatting and compiler warningsMartin Braun2020-09-251-13/+15
| | | | | | | | | | | 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.
* multi_usrp: Add get_mb_controller() API callCristina Fuentes2020-09-245-27/+60
|
* cal: sync log output between file system and resource dataLars Amsel2020-09-221-1/+3
| | | | | | To make the debug output of the database more readable the has_cal_data lookup for RC data prints the file that is looked up similar to the lookup for file system.
* package: Fix Python componentsmichael-west2020-09-131-3/+4
| | | | | | Update dependencies from python to python3. Signed-off-by: michael-west <michael.west@ettus.com>
* Prepare branch for releasemichael-west2020-09-131-165/+896
| | | | | | | - Update CHANGELOG - Update debian files Signed-off-by: michael-west <michael.west@ettus.com>
* Examples: Fix install paths in OOT RFNoC examplemichael-west2020-09-133-10/+14
| | | | | | | | - Add missing "uhd/" subdirectory. - Update install path for YAML file. - Fix include directories and link libraries for init_gain_block. Signed-off-by: michael-west <michael.west@ettus.com>
* 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>