aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp
Commit message (Collapse)AuthorAgeFilesLines
* uhd: Apply clang-format against all .cpp and .hpp files in host/Martin Braun2020-03-03173-15372/+17286
| | | | | Note: template_lvbitx.{cpp,hpp} need to be excluded from the list of files that clang-format gets applied against.
* x300: add front-panel GPIO source controleklai2020-02-185-43/+120
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds a ZPU register to control the FP GPIO source. These are 2bits per GPIO pin, totalling 24 bits. 0 corresponds to RF-A, 1 corresponds to RF-B. The following Python code will control the upper 6 bits of the front-panel GPIO from the B-side radio on an X300: >>> import uhd >>> U = uhd.usrp.MultiUSRP("type=x300") >>> U.get_gpio_src_banks() ['FP0'] >>> U.get_gpio_src("FP0") ['RFA', 'RFA', 'RFA', 'RFA', 'RFA', 'RFA', 'RFA', 'RFA', 'RFA', 'RFA', 'RFA', 'RFA'] >>> U.set_gpio_src("FP0", ['RFA', 'RFA', 'RFA', 'RFA', 'RFA', 'RFA', 'RFB', 'RFB', 'RFB', 'RFB', 'RFB', 'RFB']) >>> U.get_gpio_src("FP0") ['RFA', 'RFA', 'RFA', 'RFA', 'RFA', 'RFA', 'RFB', 'RFB', 'RFB', 'RFB', 'RFB', 'RFB'] >>> # Make all GPIOs outputs: >>> U.set_gpio_attr("FP0A", "DDR", 0xFFF) >>> U.set_gpio_attr("FP0B", "DDR", 0xFFF) >>> # Control all GPIOs from software (not ATR): >>> U.set_gpio_attr("FP0A", "CTRL", 0x000) >>> U.set_gpio_attr("FP0B", "CTRL", 0x000) >>> # Bottom 3 pins go high from radio A >>> U.set_gpio_attr("FP0A", "OUT", 0x007) >>> # Top 3 pins go high from radio B >>> U.set_gpio_attr("FP0B", "OUT", 0xE00) Amends the gpio.cpp example to allow switching the source. Co-authored-by: Brent Stapleton <brent.stapleton@ettus.com>
* ad9361: Fix formattingMartin Braun2020-02-101-13/+10
| | | | | - Apply clang-format - Remove unnecessary boost::format
* multi_usrp: Add get_tree() API callMartin Braun2020-02-042-0/+10
| | | | | | This allows access to the underlying property tree without having to refer to the device object. Useful for RFNoC objects, where the device object is not accessible.
* multi_usrp: Amend APIs for GPIO source controlMartin Braun2020-01-232-1/+12
| | | | | | | | | | | This adds a new API call to multi_usrp: get_gpio_src_banks(). This returns a list of GPIO banks who's source can be controlled through the motherboard controller. The remaining GPIO source methods' docstrings are improved, to explain the difference between GPIO banks for set_gpio_attr() and set_gpio_src(). The former controls the actual value on a GPIO bank, and the latter who drives it. These can be different banks.
* mpm/mpmd: Expose APIs to drive GPIO sourcesMartin Braun2020-01-231-0/+40
| | | | | | | | | | | | | | | | | | | The N310 has a feature that allows the front panel GPIOs to be driven by various sources: The PS, or any of the radio channels. The MPM-based APIs did not expose any way to change that. Changes: - Add MPM APIs to PeripheralManagerBase and n3xx classes - Improve comments and explanations - Add host-side hooks into these new APIs in mpmd_mb_controller - Implement these APIs for N3xx The N3xx devices will have the option to set the GPIO source to "PS", or to one of "RF0", "RF1", "RF2", "RF3" (if there are four channels; the N300 and N320 can only go up to RF1). Note: The N310 radio does not have separate FP-GPIO banks for channels 0 and 1, which needs to be fixed in a separate commit.
* mpmd: Use dpdk_simple for MTU discoveryAlex Williams2020-01-221-91/+16
| | | | And delete the stale code for the DPDK-specific version.
* x300: Remove early x300_device_args usageAlex Williams2020-01-221-7/+6
| | | | | | | | Args were being parsed in x300_eth_manager::find(), before UHD could ascertain the args were intended for an X300 device (and not some other device). This caused unwarranted error messages to print in some cases. The changes here fix this and prevent the premature parsing and error messages.
* cmake: Find DPDK via pkg-config, if availableAlex Williams2020-01-222-1/+3
| | | | | | Debian uses pkg-config without the libdpdk.so linker script. Use the pkg-config file to grab the installed libraries and determine what to link to.
* uhd: fixing MSVC warningsBrent Stapleton2020-01-093-14/+23
| | | | | | | | | | | Small changes to remove various compiler warnings found in MSVC - Adding uhd::narrow_cast to verious spots - wavetable.hpp: all floats literals in the wavetable. - paths_test: unnecessary character escape - replay example: remove unreferenced noc_id - adfXXXX: Fixing qualifiers to match between parent and derived classes - rpc, block_id: Removing unused name in try...catch
* uhd: Correct rx/tx EEPROM typoToni Jones2020-01-071-5/+5
| | | | Correct a typo differentiating RX and TX EEPROM paths.
* multi_usrp: unify GPIO access typeBrent Stapleton2019-12-301-1/+1
| | | | | | | | GPIOs in the property tree are registered as uint32_t's, so the get_gpio_attr function should use that type as well. This resolves a property tree runtime_error when running the `gpio` example with a B2xx device.
* usrp: Change default number of data frames for X300Ciro Nishiguchi2019-12-201-16/+20
| | | | | | Change the default number of frames so that it works well when using offload threads, including DPDK. This matches the default number of frames in mpmd.
* transport,usrp: Make available packet-based flow controlAlex Williams2019-12-206-44/+59
| | | | | | | | DPDK provides a fixed number of fixed-size buffers for the receive window, so it needs packet-based flow control to avoid dropping packets. This change enables counting by packets. Co-authored-by: Ciro Nishiguchi <ciro.nishiguchi@ni.com>
* usrp: Add I/O service manager for DPDKCiro Nishiguchi2019-12-202-0/+24
|
* x300,mpmd: Enable DPDKMartin Braun2019-12-2012-465/+216
| | | | | | | | | | | | | | x300: - Remove obsolete variables from x300_eth_mgr and X300 motherboard components - Added some documentation / comments - Use constrained device args in more places - Enables the use of use_dpdk=1 - Switches between regular (kernel-based) and DPDK UDP mpmd: - Merge link_if_ctrl for udp and dpdk_udp - Update cmake options
* e31x: Fix filter bank and antenna switching for channel 0Sugandha Gupta2019-12-023-43/+60
| | | | | | The filter bank and antenna switches have different configuration for channel 0 and channel 1. This commit fixes the issue where channel 0 produces only noise due to incorrect switches.
* mpmd: Name the claimer task threadMartin Braun2019-11-261-13/+15
| | | | | We call set_thread_name() on the claimer loop so the thread can be identified using OS utilities.
* x300: pcie manager updatesVirendra Kakade2019-11-262-129/+93
| | | | Signed-off-by: Virendra Kakade <virendra.kakade@ni.com>
* mg: Turn the set-lock into a recursive mutexMartin Braun2019-11-262-15/+15
| | | | | Individual API calls might have to call each other (e.g., like set_rate() will call set_rx_frequency()), which would cause a deadlock.
* mg: Always set MCR on both daughterboardsMartin Braun2019-11-263-12/+33
| | | | | | | | | | | | | | | | | The N310 cannot set the MCR for its daughterboards separately. This patch modifies the radio block controller such that any block controller, when requested to change the master clock rate, will first change Radio 0, and then Radio 1. This fixes the following issues: - In multi_usrp, calling set_master_clock_rate() will not necessarily call set_rate() on the radios in any particular order, which will break when calling Radio 1 first - In RFNoC apps, it wasn't possible to run off of slot B alone without this change. Note: When calling set_rate() on one radio, the other radio is in an invalid state until its set_rate() is also called.
* mpmd: Fix get_mboard_name()Martin Braun2019-11-261-1/+1
| | | | | It used to produce the individual name of the USRP, but it should return a product name.
* n310: Fix GPIO registersMartin Braun2019-11-261-3/+6
| | | | | This enables the use of the dboard and FP GPIOs. The problem was that the register offset of 8 was not encoded.
* mg/rh/rfnoc: Harmonize peripheral registersMartin Braun2019-11-263-18/+29
| | | | | - Move the SPI addresses out of radio_control_impl - Fix the GPIO address spaces for N310/N300
* gpio_atr_3000: Fix return value for pin control registerMartin Braun2019-11-261-1/+3
| | | | | | | | | | | | | | | This fixes a bug where get_gpio_attr(bank, "CTRL") would return the inverted value of what was written. Reason is that the underlying register was an ATR disable register. The fix is to invert the cached values of the register. Now, the following Python code will work: >>> U = uhd.usrp.MultiUSRP("type=x300") >>> atr_enable = 0xF # Enable ATR on lower 4 pins, rest is GPIO >>> U.set_gpio_attr("FP0A", "CTRL", atr_enable) >>> U.get_gpio_attr("FP0A", "CTRL") == atr_enable True
* e310: Fix issues in MPM and UHDMartin Braun2019-11-261-7/+3
| | | | | | | | | | | - Remove superfluous INFO logging - Improve formatting in many places - Improve Pylint score in various places - Add tear_down to DB object - Simplify custom EEPROM code for E310 - Fix time source selection code - Remove references to GPS_CTRL and GPS_STATUS (are E320 only) - Move clock source control out of MboardRegs object
* mpm/mpmd: Remove token requirement for device infoMartin Braun2019-11-261-2/+2
| | | | | This removes the token requirement for get_proto_ver() and get_chdr_width().
* rfnoc: Rename thread affinity argsCiro Nishiguchi2019-11-262-49/+52
| | | | | | Rename thread affinity args such that they do not end with an integer. Arg names ending with an integer are interpreted as being targeted at a specific motherboard index in device_addr methods.
* lib,tests: Remove old DPDK files from buildAlex Williams2019-11-261-7/+8
| | | | The DPDK files are left behind as a reference, for now.
* rfnoc_graph: Modify find_blocks() to sort return valueMartin Braun2019-11-261-35/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With this patch, the elements of of the return value of find_blocks() are sorted lexicographically (specifically, using uhd::rfnoc::block_id_it::operator<()). The underlying block_container class stores the blocks in an unordered set, so the return value for find_blocks() was always sorted randomly. multi_usrp_rfnoc had to sort the return values every time find_blocks() was used to get a useful return value. Because find_blocks() had no contract for the order of returned blocks, this change simply sorts the return value before returning it. multi_usrp_rfnoc is modified to remove all the sorts that are now superfluous. A good way to see the change is to run uhd_usrp_probe, which will now contain content like this: | _____________________________________________________ | / | | RFNoC blocks on this device: | | | | * 0/DDC#0 | | * 0/DDC#1 | | * 0/DUC#0 | | * 0/DUC#1 | | * 0/DmaFIFO#0 | | * 0/Radio#0 | | * 0/Radio#1 Assuming the blocks don't change, the order of this list will always be the same following this patch. Note that the order is unrelated to the order on the control crossbar, which it never was.
* multi_usrp: Fix GPIO bank selectionMartin Braun2019-11-261-11/+68
| | | | | | | | | | When calling a multi_usrp object like this: usrp->set_gpio_attr("TXB", "CTRL", 0xFFFF); Previously, it would only be able to address daughterboard A. Now, there is a full backward-compatible solution (compatible with 3.15), that will address either daughterboard's GPIOs.
* liberio: porting to I/O servicesBrent Stapleton2019-11-261-11/+2
| | | | Fixes 85f0551 ("rfnoc: Add I/O service manager to X300 and MPMD")
* multi_usrp: Add set_rx_spp() callMartin Braun2019-11-262-2/+34
| | | | | | | | This API call is a more explicit way of setting the spp than passing in an spp value in the args of the stream args when creating streamers. For pre-RFNoC devices, this is done by injecting the spp arg back into the stream args. For RFNoC devices, the set_property() call on the radio is called.
* rfnoc: Restrict to inline I/O service based on link restrictionsCiro Nishiguchi2019-11-261-1/+33
| | | | | For links that do not support releasing buffers out of order, restrict the I/O service manager to always select the inline I/O service.
* rfnoc: Use graph_utils in multi_usrp chan generationBrent Stapleton2019-11-261-113/+142
|
* rfnoc: Merge I/O service device args with stream argsCiro Nishiguchi2019-11-264-42/+113
| | | | | This makes it possible for users to put I/O service-related args in either the device args or stream args.
* uhd: Remove all usages of boost::tuple and friendsMartin Braun2019-11-267-32/+31
| | | | | | | | | | | | | This replaces all of the following with standard C++ features: - boost::tuple - boost::make_tuple - boost::tuple::get - #include <boost/tuple/tuple.hpp> All usages were replaced with search-and-replace scripts (the usages of get could be automatically replaced with a vim macro, the rest was straightforward search-and-replace).
* uhd: Replace all occurrences of boost::bind with std::bindMartin Braun2019-11-2638-472/+475
| | | | | | | | | | | | | | | | | | | | | Note: Replacing everything with a lambda would be even better, but that can't be easily scripted so we'll do this as a first step to reduce the Boost footprint. This also removes occurences of #include <boost/bind.hpp>, and makes sure all usages of std::bind have an #include <functional>. clang-format wasn't always applied to minimize the changeset in this commit, however, it was applied to the blocks of #includes. Due to conflicts with other Boost libraries, the placeholders _1, _2, etc. could not be directly used, but had to be explicitly called out (as std::placeholders::_1, etc.). This makes the use of std::bind even uglier, which serves as another reminder that using std::bind (and even more so, boost::bind) should be avoided. nirio/rpc/rpc_client.cpp still contains a reference to boost::bind. It was not possible to remove it by simply doing a search and replace, so it will be removed in a separate commit.
* mpmd: Add skip_oldlog device argMartin Braun2019-11-261-0/+8
| | | | | | | | | | This device arg will avoid printing old log messages by dumping all log messages in the buffer immediately after claiming a device. This can be helpful because reading old log messages can be confusing during debug situations, or simply during situations where we expect errors to contain warnings or errors, but we want to hide them. skip_oldlog defaults to off, i.e., the previous behaviour.
* mpmd: Skip generation of mb_controller and mb_iface for skip_init=1Martin Braun2019-11-261-3/+6
| | | | | | | | | The mpmd_mb_controller requires access to the fully functional FPGA, which in turn assumes flawless initialization. skip_init doesn't init at all, so inializing an mb_controller may not be possible, and shouldn't be attempted. This skips init of both mb_iface and mb_controller for skip_init, leaving it to the other code to figure out if they are initialized.
* uhd: Introduce I/O service managerAaron Rossetto2019-11-2610-115/+815
| | | | | | | | | | | | | | | | | | | | | | | | | | - Implement I/O service detach link methods - The I/O service manager instantiates new I/O services or connects links to existing I/O services based on options provided by the user in stream_args. - Add a streamer ID parameter to methods to create transports so that the I/O service manager can group transports appropriately when using offload threads. - Change X300 and MPMD to use I/O service manager to connect links to I/O services. - There is now a single I/O service manager per rfnoc_graph (and it is also stored in the graph) - The I/O service manager now also knows the device args for the rfnoc_graph it was created with, and can make decisions based upon those (e.g, use a specific I/O service for DPDK, share cores between streamers, etc.) - The I/O Service Manager does not get any decision logic with this commit, though - The MB ifaces for mpmd and x300 now access this global I/O service manager - Add configuration of link parameters with overrides Co-Authored-By: Martin Braun <martin.braun@ettus.com> Co-Authored-By: Aaron Rossetto <aaron.rossetto@ni.com>
* uhd: Replace boost::regex with std::regexMartin Braun2019-11-262-9/+9
| | | | | | | | boost::regex was a requirement until the minimum version of gcc was increased. Since it is at version 5.3 now, using Boost.Regex is no longer necessary. This change is a pure search-and-replace; Boost and std versions of regex are compatible and use the same syntax.
* uhd: Replace boost::function with std::functionMartin Braun2019-11-265-9/+9
| | | | | | | This is mostly a search-and-replace operation, with few exceptions: - boost::function has a clear() method. In C++11, this is achieved by assigning nullptr to the std::function object. - The empty() method is replaced by std::function's bool() operator
* uhd: Replace usage of boost smart pointers with C++11 counterpartsMartin Braun2019-11-2649-181/+181
| | | | | | | | | | | | | | | | | | | This removes the following Boost constructs: - boost::shared_ptr, boost::weak_ptr - boost::enable_shared_from_this - boost::static_pointer_cast, boost::dynamic_pointer_cast The appropriate includes were also removed. All C++11 versions of these require #include <memory>. Note that the stdlib and Boost versions have the exact same syntax, they only differ in the namespace (boost vs. std). The modifications were all done using sed, with the exception of boost::scoped_ptr, which was replaced by std::unique_ptr. References to boost::smart_ptr were also removed. boost::intrusive_ptr is not removed in this commit, since it does not have a 1:1 mapping to a C++11 construct.
* rfnoc: Unify endianness of transportsAlex Williams2019-11-264-4/+4
| | | | | Ethernet now uses the same serialization of the RFNoC stream as all the other transports.
* rfnoc: Add DMA FIFO block controllerMartin Braun2019-11-261-354/+250
|
* Remove proto-RFNoC filesMartin Braun2019-11-2625-4889/+165
| | | | | | | This commit removes all files and parts of files that are used by proto-RFNoC only. uhd: Fix include CMakeLists.txt, add missing files
* x300/mpmd: Port all RFNoC devices to the new RFNoC frameworkMartin Braun2019-11-2685-8146/+11054
| | | | | | | Co-Authored-By: Alex Williams <alex.williams@ni.com> Co-Authored-By: Sugandha Gupta <sugandha.gupta@ettus.com> Co-Authored-By: Brent Stapleton <brent.stapleton@ettus.com> Co-Authored-By: Ciro Nishiguchi <ciro.nishiguchi@ni.com>
* rfnoc: Add multi_usrp_rfnoc, modify multi_usrpBrent Stapleton2019-11-266-392/+2406
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds a separate version of multi_usrp for RFNoC devices. It is compatible with RFNoC devices only, and prefers C++ APIs over property tree usage. The factory of multi_usrp is modified such that it picks the correct version, users of multi_usrp don't care about this change. This also introduces some API changes: - Removing redundant GPIO functions. Now all GPIO control, setting, and readback is done with uint32_t's. - Adding getter/setter for GPIO source. This was done to simplify the other GPIO settings, as the source for each pin is not always a binary. The CTRL mode, for example, can either be ATR or GPIO. However, the source can be controlled by various radios or "PS" or some other source. - Removing the mask from the RFNoC radio controllers' set_gpio_attr(). - Adding state caching to gpio_atr_3000, and a getter for it. Whenever an attribute is set, that value is cached, and can now be retreieved. - Remove low-level register API. Since UHD 3.10, there is no USRP that implements that API. Modifying the filter API in the following ways: - Splitting filter API getter/setter/list into separate RX and TX functions - Adding channel numbers as an argument - The filter name will no longer be a property tree path, but rather a filter name. For RFNoC devices, this will take the form `BLOCK_ID:FILTER_NAME`. For non-RFNoC devices, this will just be the filter name (e.g. `HB_1`) - Removing search mask from listing function. Users can do their own searching Co-Authored-By: Martin Braun <martin.braun@ettus.com>
* rfnoc: Add mb_controller base class and X300/MPMD implementationsMartin Braun2019-11-266-0/+228
|