aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* 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
* x300: Fix MAX_RATE_1GIGE valueMartin Braun2021-09-071-1/+1
| | | | It held the same value as MAX_RATE_10GIGE due to a typo.
* ci: Device wait to redlock scope for Vivado closeSteven Koo2021-09-071-2/+2
| | | | | | | | Sometimes Vivado gets reopened too fast causing port in use errors. This moves the device reboot wait into the redlock scope to give some time for Vivado to close before the next agent tries to get the lock. Signed-off-by: Steven Koo <steven.koo@ni.com>
* x4xx_bist: use get_mpm_client in gpio bistGrant Meyerhoff2021-09-021-19/+18
|
* mpmd: Add discoverable feature for trig i/o modeGrant Meyerhoff2021-09-026-2/+105
|
* tests: Fix check in link_testMartin Braun2021-08-311-2/+2
| | | | | | | | The test_recv_get_release test should be checking received packets had the same content as they did on send(), but was instead assigning to the received buffer. Shoutouts to GitHub user johnwstanford for pointing out the issue.
* uhd: transport: Avoid exceptions in disconnect_receiver()Aaron Rossetto2021-08-311-10/+10
| | | | | | | | | | | | | | | | | | | | inline_io_service::disconnect_receiver() uses the recv_link_if parameter as a key into the _recv_tbl map. In some error cases, notably when an underlying link timeout occurs when setting up a transport, that key may not exist in the table. Attempting to index the table by that non-existent key causes an std::out_of_range exception to be thrown. However, in the aforementioned error case, disconnect_receiver() is called as part of a destructor of an object that is in one of the stack frames being unwound as the timeout exception is in flight. Throwing an exception while one is in flight ultimately causes the C++ runtime to terminate the process. (Generally, throwing an exception in a destructor, unless caught within the destructor, is considered a bad practice for this very reason.) This PR modifies disconnect_receiver() to check for the existence of the entry in the map and bypass the access if it is not present, thus preventing the exception from being thrown in this function which is invoked from another object's destructor.
* rfnoc: ddc: Improve unit tests and documentationMartin Braun2021-08-302-5/+26
| | | | | | | The previous commit fixed a bug in the DUC, where get_frequency_range() reported incorrect values. The DDC did not have this bug, but we port the updates to the unit tests and the documentation from the DUC to the DDC for consistency's sake.
* rfnoc: duc: Fix frequency range for DUC blockMartin Braun2021-08-304-13/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The tuning range of the DUC depends on the output sample rate (which is larger), but it was using the input sample rate. This was causing a bug where for Tx, the DSP tuning range was limited when using multi_usrp API, and thus would not allow to DSP-tune beyond the current sampling rate. In this patch, we also re-use the existing calculation of the sampling rate, and harmonize that code between duc_block_control and ddc_block_control. Consider the following Python REPL code: >>> import uhd >>> U = uhd.usrp.MultiUSRP('type=x300') >>> U.set_rx_rate(10e6) >>> U.set_tx_rate(10e6) >>> # Creating a streaming is required, or the input rate will not be >>> # set: >>> S = U.get_tx_stream(uhd.usrp.StreamArgs("fc32", "sc16")) >>> treq = uhd.types.TuneRequest(1e9) >>> treq.rf_freq = 1e9 >>> treq.dsp_freq = 50e6 >>> treq.dsp_freq_policy = uhd.types.TuneRequestPolicy.manual >>> treq.rf_freq_policy = uhd.types.TuneRequestPolicy.manual >>> tres = U.set_rx_freq(treq, 0) >>> print(str(tres)) Tune Result: Target RF Freq: 1000.000000 (MHz) Actual RF Freq: 1000.000000 (MHz) Target DSP Freq: 50.000000 (MHz) Actual DSP Freq: 5.000000 (MHz) >>> # Note the last two lines: The *target* DSP freq was already clipped >>> # to 5 MHz. These lines show 50.0 MHz when this patch is applied. This bugfix is accompanied some related changes: - The unit test is amended to verify the behaviour - The API documentation is amended with details on its behaviour
* python: Add new method bindings to noc_block_baseAaron Rossetto2021-08-301-0/+8
| | | | | This commit adds `get_src_epid()` and `get_port_num()` method bindings to the Python bindings for `noc_block_base`.
* examples: Add x400/x410 target to RFNoC exampleWade Fife2021-08-301-0/+3
|
* fpga: Set default part for sim in setupenv.shWade Fife2021-08-306-5/+24
| | | | | | | | | This sets the ARCH and PART_ID environment variables so that the selected part family is used for simulations by default. This can be overridden by changing them in the Makefile for the testbench if a testbench requires a specific part family. Prior to this change, the default was always ARCH=kintex7, PART_ID=xc7k410t/ffg900/-2, which required support for that part to be installed.
* cmake: Add check for libatomic linking requirementMartin Braun2021-08-272-0/+95
| | | | | | | | | | Some archs require linking against libatomic, others don't. We add some CMake code that checks for libatomic.so requirement if: - We are not on MSVC, AND - Compiling std::atomics code would cause a linker error. We then check for the existence of libatomic.so, and fail if we can't find it.
* x300: Fix sfpp_io_core tuser widthWade Fife2021-08-271-1/+1
|
* mpm: x4xx: update mboard_max_revAndrew Lynch2021-08-251-1/+1
|
* MPM: add X410 support for 250e6 master clock rateMichael Dickens2021-08-241-0/+1
|
* uhd: Remove Boost version checks for Boost 1.61Martin Braun2021-08-241-19/+4
| | | | | UHD requires Boost 1.65, so checks for Boost 1.61 will always be satisfied.
* fpga: Fix Xilinx bitfile parser for Python 3Martin Braun2021-08-241-31/+54
| | | | | | | | | The script was previously only Python 2 compatible. Python 2 support is now removed, so we don't maintain backwards compatibility with Python 2. This also fixes all linter warnings.