aboutsummaryrefslogtreecommitdiffstats
path: root/host
Commit message (Collapse)AuthorAgeFilesLines
* tests: Fix client_zero_test flush bit testMartin Braun2020-04-081-6/+12
| | | | | A test to check the address was using a & instead of a %, resulting in a -Wtautological-compare.
* 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-08270-1077/+272
| | | | | 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-086-1/+83
| | | | | | | | | 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".
* fixup! docs: Update Basic/LF dboard references to use new operating modeMartin Braun2020-04-071-6/+6
|
* tests: Add FIR filter block controller unit testAaron Rossetto2020-04-072-0/+247
|
* rfnoc: Add FIR filter RFNoC block controllerAaron Rossetto2020-04-075-3/+176
|
* uhd: Add quotes around test environment variablesLane Kolbly2020-04-071-1/+1
| | | | | | | On systems which have spaces in the environment variables, such as $PATH, attempting to run the generated test scripts will throw an error about a bad variable name. Adding quotes around the values prevents this error.
* fixup! rfnoc: Use multichannel register interface for RFNoC blocksmattprost2020-04-073-9/+9
|
* uhd: math: Add interpolation.hppMartin Braun2020-04-0713-52/+208
| | | | | | | | - 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
* devtest: add missing devtest to n3xxCiro Nishiguchi2020-04-031-0/+1
|
* utils: cal: Remove boost usage from usrp_cal_utils.hppMartin Braun2020-04-021-3/+0
| | | | | There were spurious boost includes left in here after applying 7ad64600f and a1f96194.
* cmake: Add ability to pass CXXFLAGS to CMake environmentAjith Saya2020-04-021-0/+3
| | | | CMAKE_CXX_FLAGS will now respect $CXX_FLAGS.
* uhd: paths: Harmonize around XDG Base Directory specificationMartin Braun2020-04-029-60/+159
| | | | | | | | | | | | | | | | | | | | | | 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>
* rfnoc: Add multichannel register interfacemattprost2020-04-024-5/+480
| | | | | | | | | | | 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>
* utils: cal: Enable "ignore cal file" option for DC and IQ cal toolsMartin Braun2020-04-021-5/+5
| | | | | | | | | | | The utilities uhd_cal_rx_iq_balance, uhd_cal_tx_iq_balance, and uhd_cal_tx_dc_offset now add the flags to ignore cal files. Otherwise, the utility would load existing cal data before generating new cal data. Note that this is not a huge problem, because the cal coefficients get overwritten during the cal process, but is unnecessary disk I/O. This commit also happens to remove all boost::format uses within usrp_cal_utils.hpp.
* utils: Add convert_cal_data utilityMartin Braun2020-04-023-0/+107
| | | | | | | | | This will convert cal data files based on CSV to the new binary format. In most cases, running ./convert_cal_data.py is sufficient.
* uhd: cal: Use usrp::cal::database instead of CSV filesMartin Braun2020-04-026-200/+229
| | | | | | | | | 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-0217-1/+760
| | | | | | | | 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.
* 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).
* utils: uhd_usrp_probe: Output frontend infoMichael West2020-03-311-5/+13
| | | | | | Add output of frontend info for RFNoC devices. Signed-off-by: Michael West <michael.west@ettus.com>
* docs: Update Basic/LF dboard references to use new operating modemattprost2020-03-312-21/+31
| | | | | | | | | | | | | | | On the new RFNoC with UHD 4.0 architecture, Basic/LF dboards use a new operating paradigm. The streaming mode (real mode or complex) is determined by setting the antennas (to A/B or AB/BA respectively). Basic/LF RX dboards also support 2 frontends (0 and 1), and Basic/LF TX dboards support 1 frontend (0). This new behavior only applies to applicable RFNoC devices (currently X300/X310). All pre-RFNoC devices (i.e. USRP2/N200 and earlier) maintain legacy behavior. RFNoC with UHD 3.xx branches also maintains old behavior. Signed-off-by: mattprost <matt.prost@ni.com>
* examples: Change benchmark_rate default thread priorityAaron Rossetto2020-03-271-1/+1
| | | | | | | | | | | | | | | | | | This commit modifies the benchmark_rate example to use the operating system's default thread priority, instead of real-time thread priority, by default. UHD 4.0 includes a number of significant improvements to the streaming architecture that allow for best performance to be achieved without having to resort to elevating the process thread priority to real-time. Internal testing shows degraded streaming performance in common use cases (i.e. non-DPDK) when the process thread priority is set to real-time. It should be noted that applications which use DPDK may still experience better performance when the process thread priority is set to real-time. Users may continue to manually override the process thread priority in benchmark_rate using the --priority=high command-line option. The need to elevate the process thread priority will be application- and deployment-dependent.
* fixup! x300: lf/basic antenna API implementationMartin Braun2020-03-261-2/+2
|
* uhd: cal: Add database classMartin Braun2020-03-2612-0/+542
| | | | | | 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-263-1/+25
| | | | 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.
* utils: uhd_images_downloader: use HTTPS instead of HTTP to avoid redirectMarcus Müller2020-03-201-1/+1
| | | | | | | | Since the webserver responding to requests at http://files.ettus.com replies with a redirect to the same URL, but using the https:// transport, this isn't only the safer thing we should be doing, anyways, but also the quicker, since it saves the user from one unnecessary redirect.
* uhd: math: Add linear_interp()Martin Braun2020-03-182-7/+30
| | | | This lets you linearly interpolate between two points.
* debian: Rename control file for libuhd to contain 4.0.0 versionMartin Braun2020-03-181-0/+0
|
* debian: Fixes to copyright fileMartin Braun2020-03-181-389/+385
| | | | | | - FindGit.cmake is no longer part of UHD, removed from copyright list - The file list includes FPGA code, which needs to be updated to point to fpga/ instead of fpga-src/
* cmake: Add CMakeRC module and ::rc namespaceMartin Braun2020-03-184-1/+665
| | | | | | | | | | | | | | | | | | | | | | | | | | 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-1817-0/+9179
| | | | | | | | | | 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-183-0/+60
| | | | | | | 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 name for mock terminatorAaron Rossetto2020-03-131-4/+6
| | | | | | | Allow a unit test to instantiate a mock_terminator_t and provide a custom name to be displayed when get_unique_id() is called (generally for logging purposes). The custom name is optional and the generic 'MOCK_TERMINATOR' is used if unset.
* tests: Allow custom mock_reg_iface_t in mock blockAaron Rossetto2020-03-132-8/+10
| | | | | | 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.
* utils: cal: Replace property tree accesses with other API callsMartin Braun2020-03-121-43/+35
| | | | | | | | | | The cal utils read the property tree to identify the daughterboard information (serial, type, etc.). The paths for properties have changed in UHD 4.0, causing these utilities to fail. Instead of conditionally parsing the property tree, this commit changes the utilities such that dictionaries are pulled out of the multi_usrp object, which work regardless of the device type.
* multi_usrp: Provide valid return value for multi_usrp::get_device()Martin Braun2020-03-123-8/+72
| | | | | | | | | | | | 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-123-8/+8
| | | | | | | | | | 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-123-0/+30
| | | | | | | | | 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
* python: Remove Python2-specific codeMartin Braun2020-03-121-7/+0
|
* 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.
* python: Arrange file in Python module into uhd/ subdirectoryMartin Braun2020-03-108-21/+54
| | | | | | | | | | | | | | | This adds the host/python/uhd subdirectory, which will add all files that go into the actual Python module once installed. Before, all Python files were directly in host/python and got sorted into their appropriate destination folders during configuration and installation. This change doesn't change anything (Python modules will look the same as they do now), except that it makes the source tree a tad neater, but more importantly, it creates a consistent directory structure when adding submodules to the uhd module. Apart from the PyBind11-generated shared object file (which gets generated during build time), the uhd/ subdirectory in host/python exactly resembles the Python module once installed, so it's more obvious where to add new submodules and files.
* examples: Update gain block testbench to use samplesWade Fife2020-03-092-26/+25
|
* sim: Parameterize chdr_word_t data typeWade Fife2020-03-092-2/+12
| | | | | | | | | | | | | | | | | | This replaces chdr_word_t, which was a statically defined 64-bit data type, with a paramaterizable data type that matches the defined CHDR_W. Code that formerly referenced the chdr_word_t data type can now define the data type for their desired CHDR_W and ITEM_W as follows: // Define the CHDR word and item/sample data types typedef ChdrData #(CHDR_W, ITEM_W)::chdr_word_t chdr_word_t; typedef ChdrData #(CHDR_W, ITEM_W)::item_t item_t; ITEM_W is optional when defining chdr_word_t if items are not needed. Static methods in the ChdrData class also provide the ability to convert between CHDR words and data items. For example: // Convert CHDR data buffer to a buffer of samples samples = ChdrData#(CHDR_W, ITEM_W)::chdr_to_item(data);
* uhd: Apply clang-format against all .cpp and .hpp files in host/Martin Braun2020-03-03432-22914/+24827
| | | | | Note: template_lvbitx.{cpp,hpp} need to be excluded from the list of files that clang-format gets applied against.