aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib
Commit message (Collapse)AuthorAgeFilesLines
* Remove remaining Python 2 referencesMartin Braun2020-05-0726-26/+26
| | | | | | | This changes two things in all applicable files: - Remove imports from __future__ - Change default shebangs from /usr/bin/env python to /usr/bin/env python3
* cores: Fix rx_vita_core_3000 assertion error in issue_stream_cmd()Martin Braun2020-05-051-3/+7
| | | | | | | | | | | | | | | | The current code had an assertion UHD_ASSERT_THROW(stream_cmd.num_samps <= 0x0fffffff); which would check that num_samps in a stream command don't exceed the counter depth in the FPGA. However, this is only relevant if the stream command is not "continuous" or "stop". num_samps could be unitialized, and randomly have a value larger than the maximum, and the assertion could trigger even though the value in num_samps is irrelevant. The new assertion checks for the correct case, and has a more verbose error message.
* multi_usrp: Remove rfnoc-specific code from multi_usrp.cppMartin Braun2020-04-281-38/+0
| | | | | This implementation of multi_usrp is only for non-RFNoC devices; the section was thus dead code.
* rh: Remove compiler warningMartin Braun2020-04-171-2/+4
| | | | | | | | | Adds UHD_UNUSED() to tag variables that is only used in a UHD_LOG_TRACE() macro. Note this would be also be possible by tagging the local functions {rx,tx}_band_to_log as unused, but g++ does not support that specific kind of attribute, at least in the current versions.
* ad9361: Remove compiler warningMartin Braun2020-04-171-1/+1
| | | | | Adds UHD_UNUSED() to tag a variable that is only used in a UHD_LOG_TRACE() macro.
* lib: rfnoc: Fix "unused" warnings for non-trace log levelsMartin Braun2020-04-172-9/+6
| | | | | | When the compile log level is higher than TRACE, the UHD_LOG_TRACE() macros get removed, which can lead to unused variables. This modifies UHD to avoid those warnings, with no functional changes.
* uhd: Add reference power level API to multi_usrp and radio_controlMartin Braun2020-04-175-0/+140
| | | | | | | | | | | | | | | | | | 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.
* cal: Add pwr_cal containerMartin Braun2020-04-173-0/+394
| | | | | | | This is a cal container for all types of power cal (RX or TX) that rely on a single, overall gain value. Includes Python API.
* 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.
* libusb: Remove deprecation warnings for libusb_set_debugMartin Braun2020-04-151-1/+14
| | | | | | | | | | | Starting with 1.0.22, libusb considers libusb_set_debug() deprecated. This replaces said call with libusb_set_option(), conditionally on the libusb version. This has no effect on the execution, but will remove some compiler versions, and make this code more future-proof. Note that Ubuntu 18.04 ships libusb 1.0.21, so this conditional code needs to remain until that version is deprecated and libusb version is bumped higher.
* rfnoc: Add RFNoC fosphor blockWade Fife2020-04-142-0/+419
|
* utils: log: fix logging race conditionmattprost2020-04-141-1/+3
| | | | | | | It was possible that output to cout would become interleaved inside of the uhd log messages. Signed-off-by: mattprost <matt.prost@ni.com>
* rpclib: Remove some warnings from object.hppMartin Braun2020-04-141-0/+12
| | | | | This removes -Wmaybe-uninitialized and -Wclass-memaccess from this file when using gcc.
* b200: Add a prop tree node usb_versionMartin Braun2020-04-141-0/+1
| | | | | At /mboards/0/usb_version, we can now read back an int. It's either 2 or 3, depending on what we're using.
* multi_usrp: Approximate legacy behaviour for recv_async_msg()Martin Braun2020-04-131-5/+29
| | | | | | | | | | | | | When using multi_usrp with an RFNoC device, the previous behaviour was to throw an exception when calling recv_async_msg() so users would know they're not supposed to call it (calling tx_stream::recv_async_msg is preferred). However, this breaks too many existing applications. Instead, we keep a weak pointer to the streamer, the same way that older devices do, and query the async message from that. This means that calling recv_async_msg() when there are multiple streamers can lead to unexpected behaviour, but that's a general issue with multi_usrp::recv_async_msg() and this way, the RFNoC devices now behave like older devices do.
* multi_usrp_rfnoc: Manually pass sample rate to ddc/ducsteviez2020-04-133-0/+24
| | | | | | | | | | | | | | This adds (and calls) methods to manually pass radio block sample rate to the input/output properties of the ddc/duc during creation of the multi_usrp_rfnoc object. The ddc/duc require this information in order to return valid, possible output/input sample rates in get_rx_rates()/get_tx_rates(). Before, the ddc/duc wouldn't have this rate until the rfnoc_graph had been connected and committed, which happens in get_rx_stream()/get_tx_stream(). Thus, this fixes an issue where a user was unable to query possible sample rates prior to specifying a sample rate and creating a stream.
* multi_usrp_rfnoc: Fix get_rx/tx_rates()steviez2020-04-131-12/+10
| | | | | This replaces incorrect code with the proper function calls to retrieve the range of possible sample rates.
* fixup! uhd: Add fuzzy serial number checkingmattprost2020-04-092-4/+3
|
* lib: Properly do reset routines in client_zeroMartin Braun2020-04-091-2/+6
| | | | | The current reset routines write a '1' twice for reset, instead of '0' then '1' (resets get triggered on a rising edge).
* uhd: mpm: Query prefs per-device for multi-device queriesLane Kolbly2020-04-083-6/+16
| | | | | | | If a user specifies a multi-device query, such as "serial0=1234,serial1=4321", we have to look up the preferences for each device. To minimize the impact to non-x400 devices, I simply push the get_usrp_args call down into mpmd_impl and mpmd_find.
* 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-084-1/+55
| | | | | | | | | 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".
* rfnoc: Add FIR filter RFNoC block controllerAaron Rossetto2020-04-072-0/+102
|
* fixup! rfnoc: Use multichannel register interface for RFNoC blocksmattprost2020-04-073-9/+9
|
* uhd: math: Add interpolation.hppMartin Braun2020-04-073-4/+146
| | | | | | | | - 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-024-34/+137
| | | | | | | | | | | | | | | | | | | | | | 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-024-54/+61
| | | | | | | | 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-024-170/+200
| | | | | | | | | 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.
* uhd: cal: Add iq_cal calibration data container classMartin Braun2020-04-023-0/+237
| | | | | | | | This class can be used to store calibration coefficients for the X300 DC offset and IQ imbalance calibration. Note: This also modifies Doxyfile.in to not document files generated by flatc.
* multi_usrp: Fix ALL_CHAN and ALL_MBOARDS API calls for Gen-3 devicesMartin Braun2020-03-311-105/+64
| | | | | | | | Most of the API calls that default an arg to ALL_CHANS or ALL_MBOARDS were in fact broken. This adds a macro to efficiently mux out API calls that take such wildcard arguments so we don't have to repeat the same loop all over the place, even for those API calls that already correctly implemented wildcards (for consistency).
* fixup! x300: lf/basic antenna API implementationMartin Braun2020-03-261-2/+2
|
* uhd: cal: Add database classMartin Braun2020-03-266-0/+282
| | | | | | This class contains methods to store and retrieve data from the local calibration database. Note that in this case, the "database" is just a bunch of files on the local filesystem.
* uhd: paths: Add get_cal_data_path() API callMartin Braun2020-03-261-0/+19
| | | | This points to the location where cal data is stored.
* x300: lf/basic antenna API implementationmattprost2020-03-234-110/+234
| | | | | | | | | | | | | | | | This results in a change of operation for LF/Basic Boards on X300/X310 devices. The RX streaming mode will now be specified by the antenna rather than the subdev: (AB or BA for complex streaming, and A or B for real-mode streaming, with AB being the default antenna value). For real-mode streaming, data is collected as complex data with zeroed-out values in the quadrature domain. The subdevs for these boards have been changed to 0 and 1 for the RX channels, and 0 for the TX channel, in order to align with subdev specs of other RFNoC devices. Note: the old streaming mode paradigm is still in place for the N210.
* cmake: Add CMakeRC module and ::rc namespaceMartin Braun2020-03-182-1/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | This module allows to add binary files into UHD (e.g., for cal data storage) in a platform-independent way. The upstream CMakeRC.cmake is modified in the following way to allow linkage against a shared object: ```diff # Generate the actual static library. Each source file is just a single file # with a character array compiled in containing the contents of the # corresponding resource file. add_library(${name} STATIC ${libcpp}) set_property(TARGET ${name} PROPERTY CMRC_LIBDIR "${libdir}") set_property(TARGET ${name} PROPERTY CMRC_NAMESPACE "${ARG_NAMESPACE}") target_link_libraries(${name} PUBLIC cmrc::base) set_property(TARGET ${name} PROPERTY CMRC_IS_RESOURCE_LIBRARY TRUE) + set_property(TARGET ${name} PROPERTY POSITION_INDEPENDENT_CODE ON) ``` This forces the -fPIC flag for the static object that CMakeRC generates, allowing to link it into a shared object file. The version of CMakeRC used is: a7e355290, cloned from git@github.com:vector-of-bool/cmrc.git.
* lib: deps: Add FlatBuffers 1.11.0 header filesMartin Braun2020-03-1816-0/+9175
| | | | | | | | | | FlatBuffers is used to (de-)serialize calibration data. For most use cases, only a few headers are required, so we provide them with UHD instead of requiring all UHD users to install their own version of FlatBuffers. This adds the headers to host/lib/deps, and updates the Debian copyright file appropriately.
* 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`.
* utils: Add bool specialization to cast::from_str()Aaron Rossetto2020-03-181-0/+25
| | | | | | | This adds a specialization to `uhd::cast::from_str()` to handle `bool` as a target type and interpret strings like 'y', 'Y', 'n', 'No', 'True', 'False', etc. as Boolean values, as well as the traditional '0' and '1' (which also work).
* tests: Allow custom mock_reg_iface_t in mock blockAaron Rossetto2020-03-131-2/+4
| | | | | | Allow clients to pass a custom instance of a mock_reg_iface_t for use with mock_block_container. This is especially useful when a block test subclasses mock_reg_iface_t to implement specialized behaviors.
* multi_usrp: Provide valid return value for multi_usrp::get_device()Martin Braun2020-03-121-3/+51
| | | | | | | | | | | | For RFNoC devices, multi_usrp::get_device() no longer returns a device pointer, rather, it returns a nullptr. This is intentional because access to the underlying device is no longer allowed. However, legacy code can segfault (e.g. portions ofr gr-uhd). This patch returns a faux uhd::device class, which almost mimicks the original behaviour perfectly, by redirecting its class methods back to multi_usrp_rfnoc. The only exception is recv_async_msg(), which requires a TX streamer. This function will always return false now.
* utils/C API: Fix property tree accessMartin Braun2020-03-121-4/+4
| | | | | | | | | | The introduction of multi_usrp_rfnoc caused multi_usrp::get_device()->get_tree() to segfault for gen3 devices. In defcb174, we introduced a fix for this (multi_usrp::get_tree()) but we didn't apply it to internal utilities. That means the uhd_cal_* utilties were broken, along with certain sections of the C API, and the latency test suite. This fixes the segfault issue.
* python: Export UHD paths utility functionsMartin Braun2020-03-121-0/+24
| | | | | | | | | All of the functions defined in uhd/utils/paths.hpp are now available in Python, with the exception of get_module_paths(). #!/usr/bin/env python3 import uhd print(uhd.get_lib_path()) # Prints location of libuhd
* 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