aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib
Commit message (Collapse)AuthorAgeFilesLines
* lib: gain_group: Remove spurious logsMartin Braun2020-03-121-2/+0
| | | | | | Whenever gains where set through a gain_group, it would output spurious log messages that must stem from someone's debug code, since the log messages are not very useful by themselves.
* uhd: Apply clang-format against all .cpp and .hpp files in host/Martin Braun2020-03-03358-22487/+24323
| | | | | Note: template_lvbitx.{cpp,hpp} need to be excluded from the list of files that clang-format gets applied against.
* device: read in preferences file before discoveryAndrew Lynch2020-02-261-1/+3
|
* rfnoc: Reuse the graph objectAndrew Lynch2020-02-261-1/+20
| | | | | Keep a reference to the graph object so that when a new multi_usrp is opened to the same device, the same graph is also used.
* lib: move OSX specific code to where the values are initially setMichael Dickens2020-02-211-0/+11
|
* lib: tweak prototypes to not be constexpr to allow building on OSXMichael Dickens2020-02-211-5/+5
| | | | Make all arguments const, in line with how other static methods are declared.
* rfnoc: actions: Cleanup rx_event_action_info ctorsteviez2020-02-182-9/+14
| | | | | Set error code member variable in rx_event_action_info constructor instead of relying on the caller to set it after object creation
* rfnoc: actions: Fix uninitialized timestampssteviez2020-02-182-9/+13
| | | | | | tx_event_action_info objects were being created with uninitialized timestamp members which led to uhd::tx_streamer::recv_async_msg() returning with invalid timestamps
* 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-102-19/+16
| | | | | - Apply clang-format - Remove unnecessary boost::format
* thread: Fix formatting in thread utilitiesMartin Braun2020-02-101-132/+144
| | | | | - Apply clang-format - Remove unnecessary boost::format
* lib: utils: Don't use hard-coded path constantsRyan Volz2020-02-071-2/+24
| | | | | | | | | | | | | This replaces the package path constant with a runtime library path lookup. The package path is taken to be the parent directory of the library directory. When boost >= 1.61 is not available, this maintains the current behavior of using CMake to set path contants. Runtime path determination is preferable for making a relocatable library so that it is not necessary to do string substitution on relocated binaries (as with, for example, building a conda package).
* rfnoc: ddc: Make scaling optional, prefer to change decimMartin Braun2020-02-071-28/+53
| | | | | | | | | | | This combines two intertwined changes: - The scaling_in and scaling_out properties of the DDC now start off uninitialized. This is to avoid invalid loops of property resolution: When the block is first initialized in a graph context, the default values for scaling over-constrain the resolution problem. - The resolver for samp_rate_in used to prefer changing samp_rate_out, it now prefers to modify the decimation. This is necessary to allow calling set_output_rate() before the graph is committed.
* octoclock: Change type of EEPROM property to mboard_eeprom_tMartin Braun2020-02-042-5/+8
| | | | | | | | | Before, the type was octoclock_eeprom_t, which was incompatible with mboard_eeprom_t and would cause issues with uhd_usrp_probe. octoclock_eeprom_t is a superset of mboard_eeprom_t, and there is no necessity for exposing the additional features to the public. This harmonizes the Octoclock prop tree with the rest of UHD, and fixes an issue where the Octoclock won't allow uhd_usrp_probe on master branch.
* octoclock: Avoid usage of uninitialized memoryMartin Braun2020-02-045-41/+48
| | | | | | | | The Octoclock host code would send uninitialized memory over the network, which would be flagged by tools such as Valgrind. This patch creates a factory function for OctoClock packets that initializes the memory to zero, defaults the proto version to the OctoClock default, and can provide a random sequence number if none is given.
* octoclock: Apply clang-formatMartin Braun2020-02-048-659/+753
|
* 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.
* rfnoc: Create mock factoryMartin Braun2020-01-293-3/+58
| | | | | | This is an API that allows creating mock block controllers, to write unit tests for block controllers. See rfnoc_blocks_test for an example how to use them.
* log: Remove LOG statement from _get_log_level()Martin Braun2020-01-291-2/+1
| | | | | | _get_log_level() is an internal function that only gets called during setup, so the logger isn't ready yet. It thus now logs to stderr instead of the logger.
* utils: log: Name all threadsMartin Braun2020-01-291-5/+16
| | | | | | Logging creates two threads, one for regular logging, and one for fastpath logging. Now these threads are named using uhd::set_thread_name()
* thread: Remove log messages for set_thread_name() when not supportedMartin Braun2020-01-291-10/+14
| | | | | | | | | | | On systems like Windows, set_thread_name() is not supported, and would previously log an error message telling the user that it can't set the thread name. However, that prevents set_thread_name() to be called before the logger is being set up, and the logger would like to use this function. Since it is obvious to the user if threads can be named or not, the log message is considered redundant and is removed.
* rfnoc_device: Remove spurious commentMartin Braun2020-01-231-2/+1
| | | | | This removes a comment that refers to Boost smart pointers, which were removed in UHD.
* 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-232-0/+48
| | | | | | | | | | | | | | | | | | | 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-224-2/+5
| | | | | | 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.
* transport: liberio: correctly release resources on destructionJoerg Hofrichter2020-01-221-6/+8
| | | | | | | | | | Stop the streaming and free the allocated buffers on destruction of the liberio xport object. Note: There is a lingering resource leak in the kernel module, this patch merely orders the resource release correctly. Signed-off-by: Joerg Hofrichter <joerg.hofrichter@ni.com>
* nirio: use `realpath` instead of `relpath`Michael Dickens2020-01-151-6/+6
| | | | | | | The latter causes issues with some builds using `/tmp` as the build directory. Ref: https://github.com/EttusResearch/uhddev/commit/9517de45709adaea8b574011573a565007149d5d This commit changed these from `abspath` to `relpath` for Windows needs. Trying `realpath` as an alternative to both of those.
* rfnoc: apply clang-format to block_idBrent Stapleton2020-01-101-1/+1
|
* uhd: fixing MSVC warningsBrent Stapleton2020-01-099-32/+55
| | | | | | | | | | | 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
* rpc: Applying clang formattingBrent Stapleton2020-01-091-84/+76
|
* uhd: Correct rx/tx EEPROM typoToni Jones2020-01-071-5/+5
| | | | Correct a typo differentiating RX and TX EEPROM paths.
* python: rfnoc: finishing noc_block_base::get_mtuBrent Stapleton2020-01-061-0/+26
| | | | | | | Adding bindings for res_source_info, which allows us to use noc_block_base::get_mtu. Fixes: 400b00c34338 ("rfnoc: adding RFNoC Python API")
* python: rfnoc: make block_id_t more compatible with stringsBrent Stapleton2020-01-061-0/+3
| | | | | Allows the RFNoC Python API to automatically convert strings to block_id_t's.
* rfnoc: adding RFNoC Python APIBrent Stapleton2020-01-021-0/+247
| | | | | | | | Adding Python bindings for the RFNoC API. This includes the rfnoc_graph, noc_block_base, and several other supporting classes. Templated functions are not currently supported. For example, `rfnoc_graph::get_block` can only return the basic block controller.
* uhd: fix for exception due to use of unconstructed mutexPatrick Sisterhen2020-01-021-4/+5
| | | | | | In chdr_ctrl_endpoint recv_thread, _recv_thread was starting at construction time and trying to lock mutex, but due to member declaration in class, mutex was not yet constructed
* 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.
* dpdk: Change client to wait on member variableCiro Nishiguchi2019-12-201-8/+12
| | | | | | Waiting on queue status seems to not always work, the queue state seems to not be updated immediately after pushing an item onto it when queried from a different thread.
* 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-207-46/+61
| | | | | | | | 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>
* rfnoc: Make chdr_ctrl_xport recv_io callbacks have symbolsAlex Williams2019-12-202-26/+50
| | | | This helps a little with debugging (for breakpoints).
* transport: Fix comment on recv_io_if::fc_callback_tAlex Williams2019-12-201-1/+1
| | | | It referenced the wrong function for releasing recv buffers.
* usrp: Add I/O service manager for DPDKCiro Nishiguchi2019-12-203-0/+93
|
* lib: Remove dpdk_zero_copy filesMartin Braun2019-12-2014-3420/+0
| | | | These were left here as a reference.
* 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
* dpdk: Add new DPDK stack to integrate with I/O servicesAlex Williams2019-12-2015-343/+2557
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | docs: Update DPDK docs with new parameters: Parameter names have had their hyphens changed to underscores, and the I/O CPU argument is now named after the lcores and reflects the naming used by DPDK. transport: Add new udp_dpdk_link, based atop the new APIs: This link is tightly coupled with the DPDK I/O service. The link class carries all the address information to communicate with the other host, and it can send packets directly through the DPDK NIC ports. However, for receiving packets, the I/O service must pull the packets from the DMA queue and attach them to the appropriate link object. The link object merely formats the frame_buff object underneath, which is embedded in the rte_mbuf container. For get_recv_buff, the link will pull buffers only from its internal queue (the one filled by the I/O service). transport: Add DPDK-specific I/O service: The I/O service is split into two parts, the user threads and the I/O worker threads. The user threads submit requests through various appropriate queues, and the I/O threads perform all the I/O on their behalf. This includes routing UDP packets to the correct receiver and getting the MAC address of a destination (by performing the ARP request and handling the ARP replies). The DPDK context stores I/O services. The context spawns all I/O services on init(), and I/O services can be fetched from the dpdk_ctx object by using a port ID. I/O service clients: The clients have two lockless ring buffers. One is to get a buffer from the I/O service; the other is to release a buffer back to the I/O service. Threads sleeping on buffer I/O are kept in a separate list from the service queue and are processed in the course of doing RX or TX. The list nodes are embedded in the dpdk_io_if, and the head of the list is on the dpdk_io_service. The I/O service will transfer the embedded wait_req to the list if it cannot acquire the mutex to complete the condition for waking. Co-authored-by: Martin Braun <martin.braun@ettus.com> Co-authored-by: Ciro Nishiguchi <ciro.nishiguchi@ni.com> Co-authored-by: Brent Stapleton <brent.stapleton@ettus.com>
* transport: Fix uninitialized offload I/O service _client_typeAlex Williams2019-12-201-5/+2
| | | | | | The client type is kept in _offload_thread_params, but a separate, unitialized field is checked in member functions. Remove the duplicate and switch the checks over. This fixes offload_io_srv_test.
* prefs: Output debug trace when config file cannot be located or loadedAaron Rossetto2019-12-172-8/+14
|
* ddc: fixup decimation propertyBrent Stapleton2019-12-051-2/+2
| | | | | | | | - Use coerce_decim(), not int(), to coerce the decimation rate - Fix typo Fixes: a36fc4604f9b ("rfnoc: DDC: Fix property propagation") Fixes: 36853315741a ("rfnoc: Add DDC block controller")