aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/cores
Commit message (Collapse)AuthorAgeFilesLines
* host: SPI: Read number of supported SPI slaves from deviceMartin Anderseck2022-04-041-4/+14
| | | | | | Add support for reading the number of supported SPI slaves from the device. This has become necessary because we may have bitfiles with different capabilities and we want to report this back correctly.
* SPI: Implement SPI engine for x410Martin Anderseck2022-01-132-0/+176
| | | | | Add SPI Core host implementation for x410 and a discoverable feature to make it accessible.
* RFNoC: Fix DSP frequency accuracymichael-west2022-01-101-4/+5
| | | | | | | | | | The host code was calculating and programming a 32-bit value for the DSP frequency, but the DDS modules in the FPGA only use the upper 24-bits. This led to inaccurate frequency values being returned. This change corrects the resolution of the value on the host side so an accurate value is returned. Signed-off-by: michael-west <michael.west@ettus.com>
* host: gpio: Create gpio_atr_offsets to store GPIO registersLane Kolbly2021-10-271-39/+47
| | | | | | | Refactors register addresses into a gpio_atr_offsets structure which contains the various register addresses. This allows creating other devices with different GPIO register layouts with greater ease, and eliminates the use of macros (yay!)
* uhd: math: Replace wrap-frequency math with a single functionMartin Braun2021-10-191-5/+1
| | | | | | | | | In multiple places in the UHD code, we were doing the same calculation for a wrapped frequency (wrap it into the first Nyquist zone). This math was using boost::math, too. Instead of editing every instance, we create a new function, uhd::math::wrap_frequency(), and replace all of its separate implementations with this function. The new function also no longer relies on boost::math::sign.
* lib: Remove all remaining usage of boost::numeric::bounds<>Martin Braun2021-10-191-2/+3
| | | | Replaced by std::numeric_limits<>.
* uhd: Replace Boost mutexes and locks with standard optionsMartin Braun2021-10-192-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a very mechanical task that could almost have been done with sed. Boost versions of mutexes and locks were removed, and replaced with std:: versions. The replacement tables are as follows: == Mutexes == - boost::mutex -> std::mutex - boost::recursive_mutex -> std::recursive_mutex Mutexes behave identically between Boost and std:: and have the same API. == Locks == C++11 has only two types of lock that we use/need in UHD: - std::lock_guard: Identical to boost::lock_guard - std::unique_lock: Identical to boost::unique_lock Boost also has boost::mutex::scoped_lock, which is a typedef for boost::unique_lock<>. However, we often have used scoped_lock where we meant to use lock_guard<>. The name is a bit misleading, "scoped lock" sounding a bit like an RAII mechanism. Therefore, some previous boost::mutex::scoped_lock are now std::lock_guard<>. std::unique_lock is required when doing more than RAII locking (i.e., unlocking, relocking, usage with condition variables, etc.). == Condition Variables == Condition variables were out of the scope of this lock/mutex change, but in UHD, we inconsistently use boost::condition vs. boost::condition_variable. The former is a templated version of the latter, and thus works fine with std::mutex'es. Therefore, some boost::condition_variable where changed to boost::condition. All locks and mutexes use `#include <mutex>`. The corresponding Boost includes were removed. In some cases, this exposed issues with implicit Boost includes elsewhere. The missing explicit includes were added.
* uhd: Fix usage of std::abs with template parametersMartin Braun2021-07-231-1/+1
| | | | | | | | | `std::abs` is only a templated function, when dealing with complex numbers. For real values, it is an overload. There is no documented standard way to use `std::abs<double>()` for real-valued arguments. We therefore remove all usages of `std::abs<>()` and replace them with `std::abs()` where they were taking a real-valued argument.
* b200: Move the B200 radio control core into usrp/b200/Martin Braun2021-07-202-350/+0
| | | | | | | | | | | | This serves two purposes: - This file no longer goes into the compiled DLL if B200 is disabled - Discourage use of this file for new devices, making it clear that this architecture is no longer used The file itself is left untouched, only the class is renamed from radio_ctrl_core_3000 to b200_radio_ctrl_core. Note: In UHD 3, this file was also used by N230.
* core: remove boost::math in favor of std cmathMichael Dickens2021-07-062-13/+16
| | | | | | | | | | | | | | | | | | | | | | YA Boost removal!!! Justification --- const int if_freq_sign = boost::math::sign(fe_conn.get_if_freq()); _dsp_freq_offset = if_freq * (-if_freq_sign); // boost::math::sign : 1 if x > 0, -1 if x < 0, and 0 if x is zero. // ==> if if_freq_sign > 0 then * by -1 else +1 (effectively) // std::signbit : true if arg is negative, false otherwise // ==> need 'not' of input argument to invert for same result as prior algorithm double fe_if_freq = fe_conn.get_if_freq(); if (!std::signbit(fe_if_freq)) { if_freq *= -1.0; } --- The above should result in the same algorithm except possibly if fe_if_freq is exactly 0.0 in which case the results might be off by the sign (+0.0 versus -0.0).
* uhd: Remove includes of list_of.hpp where appropriateMartin Braun2021-06-244-4/+0
| | | | This Boost header is included in some places, despite not being used.
* uhd: Remove all occurences of boost::math::*round()Martin Braun2021-06-248-26/+22
| | | | | | | Its behaviour is almost identical to std::lround, which we use instead. The only downside of std::lround is that it always returns a long, which we don't always need. We thus add some casts for those cases to make the compiler happy.
* lib: Use const-ref in for loops instead of const-copyMartin Braun2021-03-041-1/+1
| | | | | | This is potentially a performance issue, even though it doesn't have a big impact in this context. Clang will warn about it, and this fixes the compiler warning.
* host: Update code base using clang-tidyMartin Braun2021-03-0420-158/+164
| | | | | | | | | The checks from the new clang-tidy file are applied to the source tree using: $ find . -name "*.cpp" | sort -u | xargs \ --max-procs 8 --max-args 1 clang-tidy --format-style=file \ --fix -p /path/to/compile_commands.json
* RFNoC: Demoted zero sample error to warningmichael-west2020-12-101-5/+11
| | | | | | | | Requesting zero samples was resulting in an error and causing applications to crash. This was a change frome previous versions of UHD. Demoted to warning so applications continue as they did before. Signed-off-by: Michael West <michael.west@ettus.com>
* b200: handle overruns during continuous streamingmattprost2020-10-091-0/+3
| | | | | | | This allows the b200 devices to recover from overruns that occur during continuous streaming. Signed-off-by: mattprost <matt.prost@ni.com>
* cores: Remove shutdown function from spi_core_3000Martin Braun2020-07-081-14/+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.
* TwinRX: Remove decimation from frontendMichael West2020-05-121-18/+6
| | | | | | | | | | | | | | 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>
* 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.
* x300: lf/basic antenna API implementationmattprost2020-03-231-0/+1
| | | | | | | | | | | | | | | | 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.
* uhd: Apply clang-format against all .cpp and .hpp files in host/Martin Braun2020-03-0319-878/+1045
| | | | | Note: template_lvbitx.{cpp,hpp} need to be excluded from the list of files that clang-format gets applied against.
* gpio_atr_3000: Fix return value for pin control registerMartin Braun2019-11-261-1/+3
| | | | | | | | | | | | | | | This fixes a bug where get_gpio_attr(bank, "CTRL") would return the inverted value of what was written. Reason is that the underlying register was an ATR disable register. The fix is to invert the cached values of the register. Now, the following Python code will work: >>> U = uhd.usrp.MultiUSRP("type=x300") >>> atr_enable = 0xF # Enable ATR on lower 4 pins, rest is GPIO >>> U.set_gpio_attr("FP0A", "CTRL", atr_enable) >>> U.get_gpio_attr("FP0A", "CTRL") == atr_enable True
* uhd: Remove all usages of boost::tuple and friendsMartin Braun2019-11-262-5/+6
| | | | | | | | | | | | | This replaces all of the following with standard C++ features: - boost::tuple - boost::make_tuple - boost::tuple::get - #include <boost/tuple/tuple.hpp> All usages were replaced with search-and-replace scripts (the usages of get could be automatically replaced with a vim macro, the rest was straightforward search-and-replace).
* uhd: Replace all occurrences of boost::bind with std::bindMartin Braun2019-11-266-23/+23
| | | | | | | | | | | | | | | | | | | | | 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 usage of boost smart pointers with C++11 counterpartsMartin Braun2019-11-261-3/+3
| | | | | | | | | | | | | | | | | | | This removes the following Boost constructs: - boost::shared_ptr, boost::weak_ptr - boost::enable_shared_from_this - boost::static_pointer_cast, boost::dynamic_pointer_cast The appropriate includes were also removed. All C++11 versions of these require #include <memory>. Note that the stdlib and Boost versions have the exact same syntax, they only differ in the namespace (boost vs. std). The modifications were all done using sed, with the exception of boost::scoped_ptr, which was replaced by std::unique_ptr. References to boost::smart_ptr were also removed. boost::intrusive_ptr is not removed in this commit, since it does not have a 1:1 mapping to a C++11 construct.
* rfnoc: Add DMA FIFO block controllerMartin Braun2019-11-261-354/+250
|
* rfnoc: Add multi_usrp_rfnoc, modify multi_usrpBrent Stapleton2019-11-261-12/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds a separate version of multi_usrp for RFNoC devices. It is compatible with RFNoC devices only, and prefers C++ APIs over property tree usage. The factory of multi_usrp is modified such that it picks the correct version, users of multi_usrp don't care about this change. This also introduces some API changes: - Removing redundant GPIO functions. Now all GPIO control, setting, and readback is done with uint32_t's. - Adding getter/setter for GPIO source. This was done to simplify the other GPIO settings, as the source for each pin is not always a binary. The CTRL mode, for example, can either be ATR or GPIO. However, the source can be controlled by various radios or "PS" or some other source. - Removing the mask from the RFNoC radio controllers' set_gpio_attr(). - Adding state caching to gpio_atr_3000, and a getter for it. Whenever an attribute is set, that value is cached, and can now be retreieved. - Remove low-level register API. Since UHD 3.10, there is no USRP that implements that API. Modifying the filter API in the following ways: - Splitting filter API getter/setter/list into separate RX and TX functions - Adding channel numbers as an argument - The filter name will no longer be a property tree path, but rather a filter name. For RFNoC devices, this will take the form `BLOCK_ID:FILTER_NAME`. For non-RFNoC devices, this will just be the filter name (e.g. `HB_1`) - Removing search mask from listing function. Users can do their own searching Co-Authored-By: Martin Braun <martin.braun@ettus.com>
* gpio_atr_3000: Formatting changesBrent Stapleton2019-11-261-142/+196
| | | | | | | | Applying clang format for upcoming changes. clang-format -i --style=file host/lib/usrp/cores/gpio_atr_3000.cpp clang-format -i --style=file \ host/lib/include/uhdlib/usrp/cores/gpio_atr_3000.hpp
* cores: gpio_atr_3000: Add capability to configure register offsetMartin Braun2019-11-261-33/+45
| | | | | | The existing implementation assumes registers are spaced 4 bytes apart. In the current radio block design, all backward compatible registers are spaced 8 bytes apart. This adds a feature to configure that offset.
* tx_fe_200: make register offset controllableBrent Stapleton2019-11-261-9/+10
| | | | | | Following the changes in RX frontend controls, TX frontend register offsets are now arguments to the factory function. They default to 4, which is what the register offset was in the file before these changes.
* rx_fe_3000: Changing register address calcBrent Stapleton2019-11-261-18/+29
| | | | | | | | Changing how we calculate RX frontend register addresses to allow for different register offsets. The register addresses are now calculated in a manor similar to how gpio_atr_300_impl does register address calculations, which is to allow a reg_offset to be passes in at construction. The current default is reg_offset=4.
* lib: cores: Adapt spi_core_3000 for use with register_ifaceMartin Braun2019-11-261-49/+80
| | | | | Removes the requirement for a wb_iface, and also the requirement for regs to be 4 addresses apart.
* lib: utils: Add new signature to get_freq_and_freq_word()Martin Braun2019-11-261-0/+8
| | | | | The new signature uses tuple as the return value, instead of passing in output variables as references (C-style).
* rx_fe_3000: formatting for upcoming changesBrent Stapleton2019-08-251-84/+102
|
* cores: Use NSDMI consistently in ?x_dsp_core_3000.*Martin Braun2019-05-222-23/+16
| | | | | | There are edge cases where the lack of initialization of _current_freq could crash libuhd. To resolve this, we initialize all elements of those cores to sensible values using NSDMI.
* cores: Apply clang-format to ?x_dsp_core_3000.*Martin Braun2019-05-222-230/+268
|
* uhd: mpm: update all license header w/ "-or-later"Brent Stapleton2019-03-081-1/+1
| | | | Updating all SPDX license identifiers to include "-or-later"
* cmake: Update coding style to use lowercase commandsMartin Braun2018-11-141-2/+2
| | | | | | | | | | | | | | | | | Also updates our coding style file. Ancient CMake versions required upper-case commands. Later command names became case-insensitive. Now the preferred style is lower-case. Run the following shell code (with GNU compliant sed): cmake --help-command-list | grep -v "cmake version" | while read c; do echo 's/\b'"$(echo $c | tr '[:lower:]' '[:upper:]')"'\(\s*\)(/'"$c"'\1(/g' done > convert.sed \ && git ls-files -z -- bootstrap '*.cmake' '*.cmake.in' \ '*CMakeLists.txt' | xargs -0 gsed -i -f convert.sed && rm convert.sed (Make sure the backslashes don't get mangled!)
* cores:rx_frontend_core_3000: fix real modeGwenhael Goavec-Merou2018-10-291-0/+2
|
* cores: Update rx_frontend_gen3.v controls for 1/4-rate mixerMartin Braun2018-09-251-7/+11
| | | | | | | This tracks the changes on rx_frontend_gen3.v, which was updated to use a quarter-rate downconverter instead of a generic CORDIC. The X3x0 FPGA compat number is incremented as the rx_frontend is part of the device architecture rather than an RFNoC block.
* fixup! DDC/DUC: switch CORDIC -> DDS for all relevant variable namesmichael-west2018-09-132-12/+12
|
* rfnoc: dma_fifo: Added a more robust flush mechanismAshish Chaudhari2018-08-031-35/+59
| | | | | | | | | - The flushing mechanism now looks similar to that in noc_shell - Make use of new flush bit in FIFO control register - Restrict using the clear bit only after flushing to ensure no partial packets are introduced in the stream. (clear immediately empties out FIFOs) - Changes are backwards compatible with older FPGAs
* uhd: Expose DC Offset range via multi_usrp interfaceDerek Kozel2018-07-113-0/+27
|
* *_dsp_core: Update frequency when updating ratesVidush2018-06-212-0/+16
| | | | | Since the frequency shifter is set to a relative rate, it needs to be updated when changing the sampling rate.
* lib: Purge all references to boost::this_thread::sleep()Martin Braun2018-04-306-14/+20
| | | | Replace with std::this_thread::sleep_for().
* cores: rx_vita_core_3000: Replace boost::this_thread::sleep()Martin Braun2018-04-171-2/+3
| | | | Use std::this_thread::sleep_for() instead.
* cores: Demote some log messages in time coreMartin Braun2018-03-301-2/+6
|
* DDC/DUC: switch CORDIC -> DDS for all relevant variable namesRyan Marlow2018-03-222-12/+12
| | | | - Bump compat number for DDC/DUC to 2.0
* uhd: Move internal headers to uhdlib/Martin Braun2018-03-1443-1158/+30
| | | | | | | | | | | | | | | | 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>
* uhd: Move some gpio_defs constants definitions out of headersMartin Braun2018-02-271-1/+2
| | | | Reviewed-by: Trung Tran <trung.tran@ettus.com>