aboutsummaryrefslogtreecommitdiffstats
path: root/host/include
Commit message (Collapse)AuthorAgeFilesLines
* utils: Add sideband_at_end support to Mako templateWade Fife2020-04-211-0/+2
| | | | | | | | This adds a new option to the "AXI-Stream Data" (axis_data) FPGA interface type. The new option, "sideband_at_end", can be added to the output port of a block's YAML description to control whether the sideband information should be sampled at the end (sideband_at_end: 1) or the beginning (sideband_at_end: 0) of the AXI-Stream packet.
* math: Add dB_to_lin() and lin_to_dB()Martin Braun2020-04-171-0/+11
| | | | | | | | | | | | | These are simply shorthands, but make the code a little more readable with respect to intent. It allows to replace const double power_db = 10 * std::log10(power_lin); with const double power_db = lin_to_dB(power_lin); which expresses the intent a little more clearly and concisely.
* uhd: Add reference power level API to multi_usrp and radio_controlMartin Braun2020-04-172-0/+205
| | | | | | | | | | | | | | | | | | 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-174-1/+541
| | | | | | | 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.
* rfnoc: Add RFNoC fosphor blockWade Fife2020-04-144-0/+442
|
* multi_usrp: Approximate legacy behaviour for recv_async_msg()Martin Braun2020-04-132-8/+5
| | | | | | | | | | | | | 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-132-0/+14
| | | | | | | | | | | | | | 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.
* uhd: Replace include guards with pragma onceLane Kolbly2020-04-08157-626/+157
| | | | | Pragma once is the more modern version of include guards, eliminating any potential problems with mistyping include guards. Let's use those.
* rfnoc: Add FIR filter RFNoC block controllerAaron Rossetto2020-04-073-3/+74
|
* uhd: math: Add interpolation.hppMartin Braun2020-04-076-38/+25
| | | | | | | | - 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-3/+0
| | | | | | | | | | | | | | | | | | | | | | 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: Add multichannel register interfacemattprost2020-04-022-5/+299
| | | | | | | | | | | This utility class implements the register access methods of reg_iface but adds built-in address translation features for consecutive instances of an RFNoC block. The register peek and poke methods accept an extra 'instance' parameter which is used to calculate the absolute address for the register access. This can be used for accessing registers for the different channels of a multi-channel block (i.e. Radio, DDC, DUC, etc). Signed-off-by: mattprost <matt.prost@ni.com>
* uhd: cal: Add iq_cal calibration data container classMartin Braun2020-04-027-0/+415
| | | | | | | | 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.
* uhd: Add calibration container classMartin Braun2020-04-023-0/+68
| | | | | | | This adds uhd::usrp::cal::container, which serves as a base class for calibration data. It also provides the interp_mode enum class which can be useful for future calibration classes.
* uhd: cal: Add database classMartin Braun2020-03-263-0/+152
| | | | | | 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/+3
| | | | This points to the location where cal data is stored.
* uhd: math: Add linear_interp()Martin Braun2020-03-181-6/+20
| | | | This lets you linearly interpolate between two points.
* utils: Add bool specialization to cast::from_str()Aaron Rossetto2020-03-181-0/+15
| | | | | | | 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-6/+6
| | | | | | 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-122-5/+21
| | | | | | | | | | | | 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.
* uhd: Apply clang-format against all .cpp and .hpp files in host/Martin Braun2020-03-0338-137/+196
| | | | | Note: template_lvbitx.{cpp,hpp} need to be excluded from the list of files that clang-format gets applied against.
* rfnoc: actions: Cleanup rx_event_action_info ctorsteviez2020-02-181-4/+4
| | | | | 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-181-2/+5
| | | | | | 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
* thread: Fix formatting in thread utilitiesMartin Braun2020-02-101-3/+3
| | | | | - Apply clang-format - Remove unnecessary boost::format
* lib: utils: Don't use hard-coded path constantsRyan Volz2020-02-071-0/+3
| | | | | | | | | | | | | 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: registry: Fix Doxygen for register_block_direct()Martin Braun2020-02-071-0/+12
|
* rfnoc: Update blocks to use autogenerated noc_shellWade Fife2020-02-067-13/+66
|
* octoclock: Change type of EEPROM property to mboard_eeprom_tMartin Braun2020-02-041-1/+2
| | | | | | | | | 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.
* multi_usrp: Add get_tree() API callMartin Braun2020-02-041-0/+4
| | | | | | 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.
* docs: fix typo in stream.hppMichael Dickens2020-01-291-1/+1
|
* rfnoc: Create mock factoryMartin Braun2020-01-291-0/+193
| | | | | | 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.
* multi_usrp: Amend APIs for GPIO source controlMartin Braun2020-01-231-12/+38
| | | | | | | | | | | 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.
* uhd: fixing MSVC warningsBrent Stapleton2020-01-091-1/+4
| | | | | | | | | | | 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
* rfnoc: fix typosBrent Stapleton2020-01-021-2/+2
| | | | Fixes: 967be2a4e82b ("uhd: mpm: apply clang-format to all files")
* utils: algorithm: Add missing include uhd/config.hppMartin Braun2019-12-051-0/+1
|
* docs: fixing doxygen errors reported during makesteviez2019-12-038-11/+16
|
* rfnoc: Fix RAM port direction in YAMLWade Fife2019-11-269-98/+98
|
* rfnoc: Update YAML to expose memory clock to blocksWade Fife2019-11-268-71/+71
|
* rfnoc: Replace DDC/DUC YAML variants with single versionWade Fife2019-11-264-144/+10
|
* rfnoc: Fix YAML block settingsWade Fife2019-11-2611-278/+199
|
* rfnoc: Add FIR block YAMLWade Fife2019-11-261-0/+61
|
* rfnoc_graph: Modify find_blocks() to sort return valueMartin Braun2019-11-261-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* image builder: Add ability to pick up extra Makefile.srcs from YAMLSMartin Braun2019-11-262-0/+6
| | | | | | | | | | | | | | The blocks that are neither OOT, nor core blocks (like the DDC/DUC, etc.) require additional info to find their appropriate Makefile.srcs files. We don't include them in every build, to avoid building IP for the FFT, FIR, and other blocks when they're not needed. However, those blocks are in-tree, and don't follow the same directory structure as out-of-tree modules, either. We therefore allow the YAML files for those blocks (which are shipped with UHD) to contain a path hint to their appropriate Makefile.srcs. The image builder uses those paths to amend the `make` command appropriately.
* multi_usrp: Add set_rx_spp() callMartin Braun2019-11-261-0/+11
| | | | | | | | 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.
* utils: image_builder: Support parameterized number of ports on blocksWade Fife2019-11-261-0/+68
|
* rfnoc: image_builder: Fix -I, allow devices/targets to bet set in YAMLMartin Braun2019-11-261-1/+2
| | | | | | | - The -I switch now allows pointing to an OOT - The image core file may now contain keys 'device' and 'default_target', which the image builder can use as default values. Command line switches --device and --target are still honoured.
* uhd: Replace all occurrences of boost::bind with std::bindMartin Braun2019-11-261-5/+4
| | | | | | | | | | | | | | | | | | | | | 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.
* rfnoc: Adding rfnoc_graph utilitiesBrent Stapleton2019-11-262-0/+69
| | | | | | | Adding graph_utils to keep rfnoc_graph utilities to contain helper function and commonly used algorithms for the rfnoc_graph. These functions aren't core to the rfnoc_graph's functionality, so we'll keep them out of its API.
* transport: Implement eov indications for Rx and Tx streamsAaron Rossetto2019-11-261-8/+48
|
* rfnoc: rename block clocks to ce_clkPaul Butler2019-11-265-15/+15
| | | | | | Renaming the CE clock in the RFNoC block YAML files so that the name is consistent across blocks. Corresponding `fpga` changes can be found in `rfnoc: rename block clocks to ce_clk`.