aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/include
Commit message (Collapse)AuthorAgeFilesLines
* uhd: remove liberioRobertWalstab2020-07-201-178/+0
|
* utils: Expose CHDR Types in Public APIrobot-rover2020-07-1310-877/+11
| | | | | | | | | | This commit exposes uhdlib/rfnoc/chdr_types.hpp in the public includes. Additionally, it takes some types from uhdlib/rfnoc/rfnoc_common.hpp and exposes them publicly in uhd/rfnoc/rfnoc_types.hpp. Finally, one constant is moved from uhdlib/rfnoc/rfnoc_common.hpp to uhd/rfnoc/constants.hpp Signed-off-by: robot-rover <sam.obrien@ni.com>
* rfnoc: Rename chdr_packet to chdr_packet_writerSamuel O'Brien2020-07-137-31/+36
| | | | | | | | | It would be confusing to have two classes named chdr_packet. As it makes more sense to name the new public chdr parser class chdr_packet, the internal uhd::rfnoc::chdr::chdr_packet class is being renamed to chdr_packet_writer to better represent its functionality. Signed-off-by: Samuel O'Brien <sam.obrien@ni.com>
* cores: Remove shutdown function from spi_core_3000Martin Braun2020-07-081-7/+0
| | | | | | | | This effectively reverts 0433e74. The set_shutdown() and get_shutdown() API calls do not have a counterpart in simple_spi_core.v, which is typically the HDL endpoint for this core driver, and thus could write to a non-existent register. They are also never used in UHD, nor are they part of the spi_iface interface.
* CHDR: support multiple CHDR widthsAndrew Lynch2020-06-261-5/+28
| | | | | Support management payloads on busses over 64 bits Automatically set CHDR width for mpmd_link_if_ctrl_udp
* uhd: Implement discoverable_features for radio_controlLane Kolbly2020-06-251-1/+3
| | | | | radio_control doesn't implement any discoverable_features in particular, but this gives it the API to do so.
* uhd: Create discoverable feature registry implementationLane Kolbly2020-06-251-0/+42
| | | | | | Classes which want to implement discoverable_feature can simply inherit from this registry and get access to an ergonomic map-backed registry of features.
* radio_control: Provide default implementations for ref power APIsMartin Braun2020-06-101-0/+8
| | | | | | | | The various implementations for the reference power APIs are always the same, assuming the existence of a pwr_cal_mgr object. We therefore store references to power cal managers in radio_control_impl, which radios can choose to populate. The APIs then don't have to be reimplemented in the various radio classes, unless they want to for whatever reason.
* rfnoc: radio: Add APIs to query cal keysMartin Braun2020-05-201-0/+2
| | | | | | | | This allows asking the radio for the keys it uses to read/write its calibration data. By querying radio_control::get_{rx,tx}_power_ref_keys(), the return values can be used to access uhd::usrp::cal::database::read_cal_data().
* lib: Add power cal managerMartin Braun2020-05-191-0/+151
| | | | | This is a utility class that can be used by USRP or daughterboard drivers to tie power calibration into their respective drivers.
* TwinRX: Remove decimation from frontendMichael West2020-05-121-9/+0
| | | | | | | | | | | | | | The decimation in the rx_frontend_gen3 was added to reduce the bandwidth between the Radio and the DDC due to the limitation in bandwidth over the crossbar for dynamically connected blocks. The default FPGA image for the X300 now has a static connection between the Radio and DDC, so this is no longer necessary. This change allows the TwinRX receive channels to be time aligned with channels from other daughterboards so they can be used in the same streamer. Signed-off-by: Michael West <michael.west@ettus.com>
* uhd: Add reference power level API to multi_usrp and radio_controlMartin Braun2020-04-171-0/+6
| | | | | | | | | | | | | | | | | | This adds the following API calls: - multi_usrp::has_{rx,tx}_power_reference() - multi_usrp::set_{rx,tx}_power_reference() - multi_usrp::get_{rx,tx}_power_reference() - radio_control::has_{rx,tx}_power_reference() - radio_control::set_{rx,tx}_power_reference() - radio_control::get_{rx,tx}_power_reference() It also adds a manual page explaining the philosophy of the API. Note that this does not actually add this feature to any device implementation. Calling the new API calls will thus result in `uhd::not_implemented_error` exceptions being thrown. This commit is to lock down the API and ABI.
* lib: utils: interpolation: Add bilinear interpolationMartin Braun2020-04-171-0/+117
| | | | | | This allows to treat a std::map<KeyType<std::map<KeyType, ValueType>> as a set of x-y coordinates, and bilinearly interpolate a z-value given four x/y pairs.
* uhd: Add missing include guardsLane Kolbly2020-04-083-0/+6
|
* uhd: Replace include guards with pragma onceLane Kolbly2020-04-08113-451/+115
| | | | | Pragma once is the more modern version of include guards, eliminating any potential problems with mistyping include guards. Let's use those.
* uhd: Add fuzzy serial number checkingLane Kolbly2020-04-081-0/+29
| | | | | | | | | We have integer 32-bit serial numbers for MPM devices, for example "1234abcd". For serial numbers which have less than eight digits, e.g. "123abcd", a user may feel inclined to prefix this number with a 0 when they are searching for devices, e.g. "0123abcd". This change makes it so that specifying "0123abcd" will match a device with serial number "123ABCD".
* uhd: math: Add interpolation.hppMartin Braun2020-04-071-0/+140
| | | | | | | | - Moves linear_interp from cal to utils - Moves the interp_mode enum class to interpolation.hpp - Adds three interpolation methods for maps: at_interpolate_1d(), at_nearest(), at_lin_interp() - Adds unit tests
* uhd: paths: Harmonize around XDG Base Directory specificationMartin Braun2020-04-021-0/+22
| | | | | | | | | | | | | | | | | | | | | | Up until now, we completely ignore the XDG specification. This commit does the following to change that: - It uses XDG_DATA_HOME and XDG_CONFIG_HOME for cal and config data, respectively. - If config data is in ~/.uhd/uhd.conf, that is still accepted, but if it conflicts with $XDG_CONFIG_HOME/uhd.conf, it is ignored and a warning is displayed - The default location for cal data is thus ${HOME}/.local/share/uhd/cal on Unix, and %LOCALAPPDATA%\uhd\cal on Windows. This is a change in location! - The UHD_CONFIG_DIR environment variable was confusingly named and is now removed. It provided an alternative location than the home directory. The same purpose is now much better served by XDG_DATA_HOME and XDG_CONFIG_HOME. The specification can be found here: specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
* rfnoc: Use multichannel register interface for RFNoC blocksmattprost2020-04-021-0/+4
| | | | | | | | Allows RFNoC blocks to perform register peeks and pokes on blocks with multiple channels without having to worry about handling register address translation every time. Signed-off-by: mattprost <matt.prost@ni.com>
* uhd: cal: Use usrp::cal::database instead of CSV filesMartin Braun2020-04-022-3/+46
| | | | | | | | | Now that we have cal::iq_cal and cal::database, there's no need to manually wrangle CSV files for calibration data. This commit replaces all CSV operations with cal::database calls and uses cal::iq_cal as a container. CSV files can still be read, but are considered deprecated.
* lib: Use from_str<bool> in constrained_device_args_tAaron Rossetto2020-03-181-17/+7
| | | | | | | This modifies `constrained_device_args_t::bool_arg::parse()` to use `uhd::cast::from_str<bool>` to interpret strings as Boolean values, deduplicating the string parsing code and single-sourcing it from `uhd::cast`.
* uhd: Apply clang-format against all .cpp and .hpp files in host/Martin Braun2020-03-0372-2530/+2592
| | | | | Note: template_lvbitx.{cpp,hpp} need to be excluded from the list of files that clang-format gets applied against.
* 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.
* ad9361: Fix formattingMartin Braun2020-02-101-6/+6
| | | | | - Apply clang-format - Remove unnecessary boost::format
* 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.
* mpm/mpmd: Expose APIs to drive GPIO sourcesMartin Braun2020-01-231-0/+8
| | | | | | | | | | | | | | | | | | | 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.
* uhd: fixing MSVC warningsBrent Stapleton2020-01-095-17/+30
| | | | | | | | | | | 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
|
* 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.
* transport,usrp: Make available packet-based flow controlAlex Williams2019-12-201-2/+2
| | | | | | | | 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-201-0/+7
| | | | 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-201-0/+69
|
* lib: Remove dpdk_zero_copy filesMartin Braun2019-12-203-406/+0
| | | | These were left here as a reference.
* dpdk: Add new DPDK stack to integrate with I/O servicesAlex Williams2019-12-209-90/+1121
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* rfnoc: fix incorrect long fifo wait timeoutsVirendra Kakade2019-11-261-2/+2
| | | | | | | This fixes behavior where we would get long 100 sec timeouts on fifo waits instead of 100 ms timeouts. Signed-off-by: Virendra Kakade <virendra.kakade@ni.com>
* lib: Add DPDK service queueAlex Williams2019-11-261-0/+237
| | | | | | | This is a data structure intended for use by the DPDK I/O service. It uses DPDK's lockless ring in multi-producer, single-consumer mode to allow clients to submit requests to the DPDK I/O service's worker thread. Clients can specify a timeout for the requests to be fulfilled.
* rfnoc: fix invalid access when sending packet with no samplesCiro Nishiguchi2019-11-261-1/+3
|
* mg/rh/rfnoc: Harmonize peripheral registersMartin Braun2019-11-261-3/+0
| | | | | - Move the SPI addresses out of radio_control_impl - Fix the GPIO address spaces for N310/N300
* detail::graph: Add shutdown capabilityMartin Braun2019-11-261-4/+12
| | | | | | | | | | | | In the existing graph, when the shutdown was simply a release. However, any outstanding actions would trigger warnings (because released graphs aren't supposed to still have actions being passed around), which would sometimes be visible at the end of an application. This is a safer solution than simply releasing, because it explicitly sets a shutdown flag that all graph-affecting functions (property propagation and action handling) respect. Once the flag is set, the graph can no longer be booted up again.
* rfnoc: Rename thread affinity argsCiro Nishiguchi2019-11-261-24/+21
| | | | | | 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.
* transport: Add new base for DPDK links, based on 18.11Alex Williams2019-11-261-0/+319
| | | | | | | | | | | | dpdk_ctx represents the central context and manager of all memory and threads allocated via the DPDK EAL. In this commit, it parses the user's arguments, configures all the ports, and brings them up. dpdk_port represents each DPDK NIC port's configuration, and it manages the allocation of individual queues and their flow rules. It also would provide access to an ARP table and functions for handling ARP requests and responses. The flow rules and ARP functions are not yet implemented.
* rfnoc: Make polling I/O service not block on flow controlCiro Nishiguchi2019-11-265-27/+77
| | | | | | Add a new method to io_service::send_io to check whether the destination is ready for data, to make it possible to poll send_io rather than block waiting for flow control credits.
* rfnoc: Make I/O services relinquish CPU while waitingCiro Nishiguchi2019-11-262-16/+41
|
* rfnoc: xports: Count FC bytes as multiples of CHDR widthMartin Braun2019-11-264-17/+41
| | | | | | | | SEPs on the FPGA can only occupy multiples of the CHDR width in their FIFOs, unlike SW, where buffers are stored in RAM and can be aligned anyhow. Therefore, we align the counting of bytes for FC purpose and count multiples of CHDR width instead of the true number of bytes per packet.
* rfnoc: Restrict to inline I/O service based on link restrictionsCiro Nishiguchi2019-11-262-0/+36
| | | | | 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: Merge I/O service device args with stream argsCiro Nishiguchi2019-11-262-3/+18
| | | | | This makes it possible for users to put I/O service-related args in either the device args or stream args.
* rfnoc: Split up offload I/O service into multiple filesCiro Nishiguchi2019-11-263-0/+339
|
* uhd: Replace all occurrences of boost::bind with std::bindMartin Braun2019-11-262-8/+9
| | | | | | | | | | | | | | | | | | | | | 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.