aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* responder: Fix printw function argumentsA. Maitland Bottoms2021-10-221-1/+1
| | | | | | | This is necessary when compiling with -Werror=format-security as Debian package builds do. Thanks to mait for the fix!
* uhd: Remove spurious template from property dtorA. Maitland Bottoms2021-10-222-2/+2
| | | | | | | C++ syntax cleanup. g++ 11 is now more picky about syntax, and flags errors rather than ignores use of template-id for a destructor. Thanks to mait for these fixes!
* uhd: Fix spelling errorsA. Maitland Bottoms2021-10-223-3/+3
| | | | Thanks to Mait for pointing these out!
* docs: Clarify set/get_gpio_attr() and GPIO banksMartin Braun2021-10-221-10/+48
| | | | | | This adds a section on GPIO bank names to multi_usrp.hpp, and clarifies the difference between the multi_usrp and RFNoC APIs regarding GPIO control.
* docs: Fix GPIO documentation exampleLane Kolbly2021-10-201-5/+5
|
* images: Update image packager script for Python 3Aaron Rossetto2021-10-201-4/+3
| | | | | | This commit makes minor changes to create_imgs_package.py to make it Python 3-compatible, harmonizing it with the rest of the Python scripts in UHD which have already been updated for Python 3.
* uhd: math: Replace wrap-frequency math with a single functionMartin Braun2021-10-195-21/+41
| | | | | | | | | 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.
* uhd: math: Add a sign() functionMartin Braun2021-10-192-0/+22
| | | | | We've been having issues with moving locations of Boost headers for this function, and it's simple enough to implement ourselves.
* 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-1940-297/+292
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* cmake: use LooseVersion to ensure correct version comparisonsLars Amsel2021-10-141-3/+3
| | | | | | current implementation uses version strings for comparisons. This led version 3.10 to be smaller than 3.6 which is obviously wrong. Use LooseVersion to have correct version comparison.
* mpm: Fix handling of rfic_digital_loopback argumentMartin Anderseck2021-10-121-5/+5
| | | | | | | | In mpm arguments are handled as key=value pairs. Therefore setting rfic_digital_loopback to 0 should disable the digital data loopback inside the RFIC on N310. This fixes this behavior by correctly casting from string to boolean but keeps the full re-init sequence when using the rfic_digital_loopback flag.
* rfnoc: mgmt_portal: Remove two unused variablesMartin Braun2021-10-111-4/+6
| | | | Thanks for github user johnwstanford for pointing those out.
* mpm: rfdc: Tear down RFDC on teardownLane Kolbly2021-10-112-3/+5
| | | | | | | | | | | | | | | So, the Python garbage collector is a bit pernicious, in that it happens behind the scenes in a way which is difficult to predict. The rfdc_ctrl class expects that its "lifetime" will be a single live/die cycle of the FPGA (i.e. that when a new FPGA is loaded, it will be destructed). However, by default the Python GC will keep the X4xxRfdcCtrl class alive for an arbitrary amount of time, meaning that it's possible that multiple (C++) rfdc_ctrl classes can be alive at a single time. When the GC reaps all of these classes, libmetal segfaults when we call metal_finish several times in a row. This change works around that issue, if not the overall GC issue, by explicitly deleting the rfdc_ctrl object.
* bug: fix channel indexing when reading USRP powerLars Amsel2021-10-111-1/+1
| | | | | | | the USRP power meter will only receive from a single channel which is configured by the argument parameter. The streamer receive data will therefor alwalys have a single channel. So do not index with chan when passing the streamer to uhd.dsp.signals.get_usrp_power.
* devtest: Clarify data type in multi_usrp_test::send_waveform()Martin Braun2021-10-061-1/+1
|
* python: multi_usrp: Fix issues in send_waveform()Martin Braun2021-10-062-19/+36
| | | | | | | - Like with RX, this now allows passing in stream time and existing streamer - There was no EOB being sent at the end (now there is) - Fixed some linter issues
* python: multi_usrp: Fix issues with recv_num_samps()Martin Braun2021-10-061-24/+63
| | | | | | | | | - This function didn't set the time properly for multi-chan rx - There was no way to set a start time manually - It relied on garbage collection and correct destruction of streamers when being called multiple times. Addressed this by adding an option to pass in an existing streamer object. - Linter wasn't too happy with this function.
* libusb: Remove unused context variableMartin Braun2021-09-301-2/+5
| | | | | | | | | | | The USB managed buffer implementation created a context every time one was generated. The additional load is not very high, because the global session is a singleton, and simply returns the same context again with only a few branches. Also, managed buffers persist for the entire session. However, the context is never used in the managed buffer. This code is thus confusing for the reader of this code, and we remove the extraneous, unused context variable.
* ad9361: Add comment re overclockingMartin Braun2021-09-301-3/+23
| | | | | | | | | | As GitHub user marcosino points out, we're running the AD9361 in overclocked mode. This is because the driver was written with no longer valid recommendations. We add a comment and some debug messages to clarify this. Should there be RF impairments (signal integrity or other) because of overclocking, users would be able to check DEBUG log statements to correlate with overclocked configurations.
* docs: x410: Fix info on loading SD card images with bmaptoolMartin Braun2021-09-281-1/+5
|
* dissectors: Fix whitespace formatting in CMake filesMartin Braun2021-09-282-62/+59
| | | | | | This commit makes some of the CMake formatting consistent. CMake patches were not, in fact, required to fix bugs, but we keep the formatting improvements nevertheless.
* dissectors: Fix inclusion of glib.h and Python versionMartin Braun2021-09-283-3/+3
| | | | | | | | | | | | | | | | | | | | | Previously, we were doing this: ```cpp extern "C" { } ``` This is not how glib.h is supposed to be included, according to their documentation. It turns out that it happened to work for a long time, and lots of projects include glib.h that way, and the glib devs are trying to accommodate for those cases. How nice of them! However, on Fedora 34, we have a version of glib which does not have a workaround patch, so we include glib.h the it should be. The second issue was that a build script required the existence of a `python` executable, which is not always available. A `python3` executable can be assumed, since that's a dependency for UHD, too.
* python: Fix dropped-sample calculation in benchmark_rate.pyMartin Braun2021-09-281-5/+7
| | | | | | | | | | This fixes a subtle bug, where a variable to cache the timestamp of an error gets bound to the metadata instead of creating a copy thereof. Without this fix, the calculation of dropped samples would always be 0, because the difference in timestamps would incorrectly be always zero. This fix will now make a copy of the timestamp. Shoutout to GitHub user bhorsfield for finding this issue.
* devtest: Add receive stability test to B2xx devtestMartin Braun2021-09-282-0/+52
|
* devtest: Add receive stability testMartin Braun2021-09-281-0/+174
| | | | | | | At this point, this test chokes an RX streamer to force an overrun. It then confirms that the overrun message is returned to the call site, and that the streamer returns to continuous streaming after the overrun handling.
* docs: Improve docs for rx_streamer::recv() on overrunsMartin Braun2021-09-281-1/+21
|
* chdr: Rename var max_size_bytes to avoid confusionMartin Anderseck2021-09-282-21/+41
| | | | | | | | | The variable max_size_bytes has a different name in the source than in the header and is not self-explanatory in both. Therefore when comparing against it in the assertion in line 142 one could assume that a number of bytes needs to be compared with a byte value. Change variable to `buff_size` in source and header file to avoid confusion and add documentation.
* ad9361: Modify set-tx-gain procedure to update gain in one goMartin Braun2021-09-171-7/+13
| | | | | | | | | | | | | | | | | | | | | | | | | The previous behaviour of UHD for setting gain was: 1. Set "Mask Clr Atten Update". This will avoid "Immediately Update TPC Atten" to be cleared. 2. Then, assert "Immediately Update TPC Atten". 3. Poke the LSBs of the attenuation value. 4. Poke the MSB of the attenuation value. This order of operations has the downside of causing large Tx power spikes when setting the attenuation, because you need both registers to properly set the attenuation, but we are updating the gain immediately, even between the two attenuation register's update. Moreover, the upstream Linux driver for AD9361 by ADI also does not do this. We therefore change the procedure to match the kernel driver behaviour, which is: 0. [During initialization: Clear "Mask Clr Atten Update" 1. Poke the attenuation registers 2. Then, assert "Immediately Update TPC Atten". This avoids Tx power spikes. It also reduces the Tx-gain procedure to 3 pokes instead of 4.
* examples: Improve txrx_loopback_to_file (late recv, Boost, timing)Martin Braun2021-09-171-18/+22
| | | | | | | | | | | | - Fixes a bug where the RX stream command set set independent of the device time. Now, we read back get_time_now() to calculate the command time. - When using multiple RX USRPs, sync their times. Before, they were left untouched, causing possible timing mismatches. - Increase the initial timeout value. The previous value had only been tested with N2x0. - Replace the boost::thread_group with a std::thread. - Remove some boost::format where it didn't add value.
* cmake: Fix rfnoc-example (CMake paths)Martin Braun2021-09-173-11/+11
| | | | | This reverts part of 09d94529e, which should not have touched these particular CMake files.
* uhd: zbx: Prevent TX antenna config from disrupting RXLane Kolbly2021-09-162-2/+28
| | | | | | | | | | | | | | So, both the set_tx_antenna_switches and set_rx_antenna_switches functions configure the TX0_ANT_11 register (which controls the final switch before the TX/RX port, switching it between the three TX paths and the RX path). The RX antenna configuration code will, if the RX antenna is set to TX/RX, configure that switch to the TX/RX->RX path when the ATR is set to RX. However, the TX antenna config code will always configure that switch to the "bypass" path, for both the 0X and RX ATR modes, regardless of whether the RX side actually needs that path. Ergo, this change makes set_tx_antenna_switches only configure that switch when it is configuring the XX or TX modes.
* docs: sync: Update page on synchronizationMartin Braun2021-09-161-19/+24
| | | | | - Clarify features that only work on B100 and N2x0 (_external_) - De-emphasize MIMO-cable sync
* cmake: Fix issues with static builds and CMRCMartin Braun2021-09-161-2/+4
| | | | | | | | | | | | | | Adds uhd_rc as a link target to static builds of libuhd. This fixes build errors like this: ``` uhd/lib/cal/database.cpp:12:10: fatal error: cmrc/cmrc.hpp: No such file or directory #include <cmrc/cmrc.hpp> ``` This also adds uhd_rc as to $libuhd_libs instead of just listing it separately, and target objects from uhd_rc to $libuhd_sources.
* X300: Fix error message for wrong reference frequencyMartin Anderseck2021-09-161-1/+2
| | | | | Error message was not adapted when support for 11.52 MHz and 23.04 MHz references was added. Fixing this.
* x300: Remove unused variables in x300_eth_mgr.cppMartin Braun2021-09-161-8/+0
|
* fpga: x300: Update synchronizer constraintWade Fife2021-09-131-1/+1
|
* fpga: n3xx: Update synchronizer constraintWade Fife2021-09-131-3/+2
|
* fpga: lib: Update example constraint in synchronizerWade Fife2021-09-131-18/+40
|
* cmake: Replace CMAKE_{SOURCE,BINARY}_DIR with UHD_*_DIRMartin Braun2021-09-1025-185/+185
| | | | | | | | | | | | | | | | | | | | | | | | | | See the CMake 3.8 documentation on these two variables: https://cmake.org/cmake/help/v3.8/variable/PROJECT-NAME_SOURCE_DIR.html https://cmake.org/cmake/help/v3.8/variable/CMAKE_SOURCE_DIR.html Under normal circumstances, these two are identical. For sub-projects (i.e., when building UHD as part of something else that is also a CMake project), only the former is useful. There is no discernible downside of using UHD_SOURCE_DIR over CMAKE_SOURCE_DIR. This was changed using sed: $ sed -i "s/CMAKE_SOURCE_DIR/UHD_SOURCE_DIR/g" \ `ag -l CMAKE_SOURCE_DIR **/{CMakeLists.txt,*.cmake}` $ sed -i "s/CMAKE_BINARY_DIR/UHD_BINARY_DIR/g" \ `ag -l CMAKE_BINARY_DIR **/{CMakeLists.txt,*.cmake}` At the same time, we also replace the CMake variable UHD_HOST_ROOT (used in MPM) with UHD_SOURCE_DIR. There's no reason to have two variables with the same meaning and different names, but more importantly, this means that UHD_SOURCE_DIR is defined even in those cases where MPM calls into CMake files from UHD without any additional patches. Shoutout to GitHub user marcobergamin for bringing this up.
* fpga: Update help message for setupenv.shWade Fife2021-09-101-5/+7
| | | | | Updates the language in setupenv.sh --help to better reflect that there are many locations where Vivado is searched.
* rfnoc: Add vivado-path to rfnoc_image_builderWade Fife2021-09-102-0/+8
| | | | | | | Adds a --vivado-path option to rfnoc_image_builder that, if present, gets passed to setupenv.sh for the target device. This can be used to specify the location of Vivado if it is not installed in one of the default search locations.
* uhd: mpm: Expose filesystem version information on MPM treeLane Kolbly2021-09-081-0/+6
| | | | | This allows UHD clients to determine, for example, whether the currently loaded filesystem is up-to-date.
* python: multi_usrp: Fix overloaded function definitionMartin Anderseck2021-09-081-1/+1
| | | | | Fix function definition set_rx_iq_balance so that Python can reach the overloaded C++ function. There was a copy & paste error in there.
* radio: Improve log messages for non-implemented correctionsMartin Braun2021-09-082-5/+8
| | | | | This modifies some log messages or exception strings when using auto-correction APIs that are not supported by the underlying device.
* rh: Fix auto DC-offset correction and auto-IQ balance APIsMartin Braun2021-09-082-7/+1
| | | | | | | | N320 doesn't have an automatic RX IQ balance correction, so that API is removed. The auto-DC offset correction was calling into the manual DC offset correction code, which means auto-DC offset correction was never enabled for N320.
* cmake: tests: Add build-python path to PYTHONPATHMartin Braun2021-09-081-2/+5
| | | | | | | | | | | | | | | | This is more of an expressive change than a functional change; Python seems to add this path to the PYTHONPATH anyway, at least for some systems. We neverless make this change because: - It's more explicit/expressive. When tests are run, the PYTHONPATH env variable is printed, and it now contains this path where it should be, right at the front. People reading the ctest/python.unittest output now get told explicitly which path we mean. - This guarantees that this path is added, even if Python/unittest should behave differently on other systems or versions. To clarify: When running unit tests, we want to run the Python code from build/python, not the installed version. The latter may not yet exist, and if it does, it's not the version we are editing.
* examples: Show how to use in-tree Verilog headerWade Fife2021-09-081-0/+17
| | | | | Adds example showing how to `include an in-tree Verilog header file in the rfnoc_block_gain example.
* fpga: Remove stale references to UHD_FPGA_DIRWade Fife2021-09-088-16/+8
|
* fpga: tools: Add UHD_FPGA_DIR definition to synthesisWade Fife2021-09-083-6/+11
| | | | | | | | | | | | | | | | | This adds a Verilog definition named `UHD_FPGA_DIR that corresponds to the location of the UHD "fpga" directory. This allows you to include files in your out-of-tree modules relative to the FPGA directory. For example, you could include the library header file rfnoc_chdr_utils.vh using the following: `include `"`UHD_FPGA_DIR/usrp3/lib/rfnoc/core/rfnoc_chdr_utils.vh`" Some simulators may not support `" outside of the context of a `define, in which case you can do the following: `define RFNOC_CHDR_UTILS_PATH \ `"`UHD_FPGA_DIR/usrp3/lib/rfnoc/core/rfnoc_chdr_utils.vh`" `include `RFNOC_CHDR_UTILS_PATH