| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
- 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.
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
| |
- 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.
|
|
|
|
|
| |
This reverts part of 09d94529e, which should not have touched these
particular CMake files.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
- Clarify features that only work on B100 and N2x0 (_external_)
- De-emphasize MIMO-cable sync
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
Error message was not adapted when support for 11.52 MHz and 23.04 MHz
references was added. Fixing this.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
Updates the language in setupenv.sh --help to better reflect that there
are many locations where Vivado is searched.
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
This allows UHD clients to determine, for example, whether the currently
loaded filesystem is up-to-date.
|
|
|
|
|
| |
Fix function definition set_rx_iq_balance so that Python can reach the
overloaded C++ function. There was a copy & paste error in there.
|
|
|
|
|
| |
This modifies some log messages or exception strings when using
auto-correction APIs that are not supported by the underlying device.
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
Adds example showing how to `include an in-tree Verilog header
file in the rfnoc_block_gain example.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
It held the same value as MAX_RATE_10GIGE due to a typo.
|
|
|
|
|
|
|
|
| |
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>
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
| |
This commit adds `get_src_epid()` and `get_port_num()` method bindings
to the Python bindings for `noc_block_base`.
|
| |
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
|
|
|
|
| |
UHD requires Boost 1.65, so checks for Boost 1.61 will always be
satisfied.
|
|
|
|
|
|
|
|
|
| |
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.
|