aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/include/uhdlib/utils
Commit message (Collapse)AuthorAgeFilesLines
* lib: Make simple_claimer atomicMartin Braun2022-01-141-38/+19
| | | | | | | | | | | | | | | This fixes multiple issues: - The simple_claimer was not truly atomic, it tested and set the locked-flag on separate lines - It used a Boost yield statement, although we're not running Boost threads - It used the deprecated UHD_INLINE macro We also remove spin_wait_with_timeout(), which was only used in claim_with_wait() because it's not worth putting into its own function. This is no API change on simple_claimer, but it may result in different performance of this spinlock.
* lib: Fix missing includes in rpc.hppMartin Braun2021-02-011-0/+4
|
* 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-082-0/+4
|
* uhd: Replace include guards with pragma onceLane Kolbly2020-04-0813-53/+14
| | | | | 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
* uhd: cal: Use usrp::cal::database instead of CSV filesMartin Braun2020-04-021-0/+2
| | | | | | | | | 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: Apply clang-format against all .cpp and .hpp files in host/Martin Braun2020-03-0313-329/+307
| | | | | Note: template_lvbitx.{cpp,hpp} need to be excluded from the list of files that clang-format gets applied against.
* uhd: fixing MSVC warningsBrent Stapleton2020-01-092-3/+5
| | | | | | | | | | | 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
|
* rfnoc: Split up offload I/O service into multiple filesCiro Nishiguchi2019-11-261-0/+71
|
* uhd: Replace all occurrences of boost::bind with std::bindMartin Braun2019-11-261-1/+1
| | | | | | | | | | | | | | | | | | | | | 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.
* uhd: Replace boost::function with std::functionMartin Braun2019-11-261-2/+2
| | | | | | | This is mostly a search-and-replace operation, with few exceptions: - boost::function has a clear() method. In C++11, this is achieved by assigning nullptr to the std::function object. - The empty() method is replaced by std::function's bool() operator
* lib: Replace uhd::get_system_time() with steady_clockMartin Braun2019-11-261-3/+4
| | | | | | Benchmarks show that using C++ chrono features beats uhd::get_system_time(), and the latter is simply not appropriate unless a uhd::time_spec_t is required.
* uhd: utils: Add compat check for 32-bit compat numbersMartin Braun2019-11-261-0/+13
|
* rpc: add exception when client constructor failsMark Meserve2019-10-151-3/+36
|
* rpc: convert client to sptrMark Meserve2019-10-151-12/+13
|
* lib: utils: Add is_a_tty()Martin Braun2019-10-071-0/+55
| | | | | | | This is a portable version of POSIX's isatty(). Windows has its own version, called _isatty(). UHD thus gains its own, portable version. The underscores aren't beautiful, but they're necessary so we can distinguish the POSIX version from the UHD version.
* fixup! uhdlib: add rational approximation to math utilitiesMartin Braun2019-05-231-1/+1
|
* uhdlib: add rational approximation to math utilitiesMark Meserve2019-05-071-0/+75
|
* mpmd,transport,prefs: Add xport_mgr for dpdk_zero_copyAlex Williams2019-01-251-0/+34
| | | | | | | | | | | | | | | | | | | | | | | Add configuration sections to the UHD config file for NIC entries. Keys are based on MAC addresses, and the entries beneath the section describe which CPU and I/O thread to use for the NIC and its IPv4 address. Make ring sizes configurable for uhd-dpdk. Ring size is now an argument for packet buffers. Note that the maximum number of available buffers is still determined at init! Add ability to receive broadcasts to uhd-dpdk. This is controllable by a boolean in the sockarg during socket creation. dpdk_zero_copy will filter broadcast packets out. Add dpdk_simple transport (to mirror udp_simple). This transport allows receiving from broadcast addresses, but it only permits one outstanding buffer at a time. Fix IP checksum handling in UHD-DPDK. TX checksums were not being calculated in the NIC, and in RX, the check for IP checksums allowed values of zero (reported as none). Now packets with bad IP checksums will be dropped.
* rpc,mpmd: replace all set_timeout() to new apiTrung Tran2019-01-141-5/+0
| | | | | Using new rpc client new API that ensure atomic setting of timeout on each rpc call.
* utils:rpc: set rpc timeout during rpc callTrung Tran2019-01-141-3/+120
| | | | | | | | | | | | | The current implementation of the UHD RPC client has a timeout that is being accessed non-atomically. Many calls follow the pattern: 1. set_timeout(value) 2. request_rpc() 3. set_timeout(default) which is not atomic. Other concurrent calls on the same rpc client may change the timeout value; leads to unexpected behavior These new set of function will, instead, handle setting and re-setting the timeout atomically in the RPC request.
* Test: Add unit test for eeprom_utilsmichael-west2018-10-251-1/+1
|
* X300: Prevent duplicate MAC and IP addresses from being programmed in MBMichael West2018-10-251-0/+80
| | | | EEPROM
* lib: move atomic.hpp and system_time.hpp to uhdlibMartin Braun2018-04-062-0/+92
|
* lib: add auto_timer profiling utilityPatrick Sisterhen2018-03-161-0/+137
| | | | | Note: This tool is not considered done, complete, unchangeable, or anything other than experimental.
* uhd: Move internal headers to uhdlib/Martin Braun2018-03-143-0/+280
| | | | | | | | | | | | | | | | To avoid the proliferation of additional include directories and multiple ways of including project-local headers, we now default to moving all headers that are used across UHD into the uhdlib/ subdirectory. Some #include statements were also reordered as they were modified for closer compliance with the coding guidelines. Internal cpp source files should now include files like this: #include <uhdlib/rfnoc/ctrl_iface.hpp> Reviewed-by: Ashish Chaudhari <ashish.chaudhari@ettus.com>
* lib: Add 'prefs' APIMartin Braun2018-02-201-0/+54
| | | | | | | | | | | | | This defines and reads configuration files that can be used to customize UHD's behaviour. On Unix systems, they default to: /etc/uhd/uhd.conf $APPDATA/.uhd/uhd.conf On Windows systems, it will look in: %ProgramData%/uhd/uhd.conf %AppData%/.uhd/uhd.conf
* lib: Add path_expandvars() internal API callMartin Braun2018-02-201-0/+24
|
* uhd: Update license headersMartin Braun2018-02-194-4/+4
| | | | | | | All copyright is now attributed to "Ettus Research, a National Instruments company". SPDX headers were also updated to latest version 3.0.
* rfnoc: Factor out ceil_log2() into central locationMartin Braun2018-02-191-0/+25
| | | | - New file: uhdlib/utils/math.hpp
* rfnoc: Factored out FPGA compat checkMartin Braun2018-02-191-0/+30
| | | | | - Applied changes to DUC and DDC blocks - Fixed minor formatting
* lib: Add config_parser classMartin Braun2018-02-011-0/+121
| | | | | | | This class is not publicly exported. It is meant to read config files in the INI format. Reviewed-by: Brent Stapleton <brent.stapleton@ettus.com>
* uhd: Add narrow_cast and narrowMartin Braun2018-01-121-0/+99
Reviewed-by: Ashish Chaudhari <ashish.chaudhari@ettus.com>